forked from AuroraMiddleware/gtk
border-image: Remove pack/unpack functions
They are not used anymore. Also, it's no longer necessary to register GtkBorderImage as a custom GType.
This commit is contained in:
parent
96abf8c725
commit
9b47a6a4e3
@ -35,9 +35,6 @@
|
||||
*/
|
||||
#include "fallback-c89.c"
|
||||
|
||||
G_DEFINE_BOXED_TYPE (GtkBorderImage, _gtk_border_image,
|
||||
_gtk_border_image_ref, _gtk_border_image_unref)
|
||||
|
||||
struct _GtkBorderImage {
|
||||
GtkCssImage *source;
|
||||
|
||||
@ -116,74 +113,6 @@ _gtk_border_image_unref (GtkBorderImage *image)
|
||||
}
|
||||
}
|
||||
|
||||
GParameter *
|
||||
_gtk_border_image_unpack (const GValue *value,
|
||||
guint *n_params)
|
||||
{
|
||||
GParameter *parameter = g_new0 (GParameter, 4);
|
||||
GtkBorderImage *image = g_value_get_boxed (value);
|
||||
|
||||
parameter[0].name = "border-image-source";
|
||||
g_value_init (¶meter[0].value, GTK_TYPE_CSS_IMAGE);
|
||||
|
||||
parameter[1].name = "border-image-slice";
|
||||
g_value_init (¶meter[1].value, GTK_TYPE_BORDER);
|
||||
|
||||
parameter[2].name = "border-image-repeat";
|
||||
g_value_init (¶meter[2].value, GTK_TYPE_CSS_BORDER_IMAGE_REPEAT);
|
||||
|
||||
parameter[3].name = "border-image-width";
|
||||
g_value_init (¶meter[3].value, GTK_TYPE_BORDER);
|
||||
|
||||
if (image != NULL)
|
||||
{
|
||||
g_value_set_object (¶meter[0].value, image->source);
|
||||
g_value_set_boxed (¶meter[1].value, &image->slice);
|
||||
g_value_set_boxed (¶meter[2].value, &image->repeat);
|
||||
g_value_set_boxed (¶meter[3].value, image->width);
|
||||
}
|
||||
|
||||
*n_params = 4;
|
||||
return parameter;
|
||||
}
|
||||
|
||||
void
|
||||
_gtk_border_image_pack (GValue *value,
|
||||
GtkStyleProperties *props,
|
||||
GtkStateFlags state)
|
||||
{
|
||||
GtkBorderImage *image;
|
||||
GtkBorder *slice, *width;
|
||||
GtkCssBorderImageRepeat *repeat;
|
||||
GtkCssImage *source;
|
||||
const GValue *val;
|
||||
|
||||
val = _gtk_style_properties_peek_property (props,
|
||||
GTK_CSS_STYLE_PROPERTY (_gtk_style_property_lookup ("border-image-source")),
|
||||
state);
|
||||
source = g_value_get_object (val);
|
||||
if (source == NULL)
|
||||
return;
|
||||
|
||||
gtk_style_properties_get (props, state,
|
||||
"border-image-slice", &slice,
|
||||
"border-image-repeat", &repeat,
|
||||
"border-image-width", &width,
|
||||
NULL);
|
||||
|
||||
image = _gtk_border_image_new (source, slice, width, repeat);
|
||||
g_value_take_boxed (value, image);
|
||||
|
||||
if (slice != NULL)
|
||||
gtk_border_free (slice);
|
||||
|
||||
if (width != NULL)
|
||||
gtk_border_free (width);
|
||||
|
||||
if (repeat != NULL)
|
||||
g_free (repeat);
|
||||
}
|
||||
|
||||
typedef struct _GtkBorderImageSliceSize GtkBorderImageSliceSize;
|
||||
struct _GtkBorderImageSliceSize {
|
||||
double offset;
|
||||
|
@ -26,19 +26,13 @@
|
||||
|
||||
#include "gtkborder.h"
|
||||
#include "gtkcssimageprivate.h"
|
||||
#include "gtkstyleproperties.h"
|
||||
#include "gtkthemingengine.h"
|
||||
#include "gtkcsstypesprivate.h"
|
||||
#include "gtkstylecontextprivate.h"
|
||||
|
||||
G_BEGIN_DECLS
|
||||
|
||||
typedef struct _GtkBorderImage GtkBorderImage;
|
||||
|
||||
#define GTK_TYPE_BORDER_IMAGE (_gtk_border_image_get_type ())
|
||||
|
||||
GType _gtk_border_image_get_type (void) G_GNUC_CONST;
|
||||
|
||||
GtkBorderImage * _gtk_border_image_new (GtkCssImage *source,
|
||||
GtkBorder *slice,
|
||||
GtkBorder *width,
|
||||
@ -56,12 +50,6 @@ void _gtk_border_image_render (GtkBorderImage *imag
|
||||
gdouble width,
|
||||
gdouble height);
|
||||
|
||||
GParameter * _gtk_border_image_unpack (const GValue *value,
|
||||
guint *n_params);
|
||||
void _gtk_border_image_pack (GValue *value,
|
||||
GtkStyleProperties *props,
|
||||
GtkStateFlags state);
|
||||
|
||||
G_END_DECLS
|
||||
|
||||
#endif /* __GTK_BORDER_IMAGE_H__ */
|
||||
|
Loading…
Reference in New Issue
Block a user