|
Lines 36-42
typedef struct
Link Here
|
| 36 |
GtkContainer *image_ctnr; |
36 |
GtkContainer *image_ctnr; |
| 37 |
GtkContainer *header_ctnr; |
37 |
GtkContainer *header_ctnr; |
| 38 |
GtkContainer *subheader_ctnr; |
38 |
GtkContainer *subheader_ctnr; |
| 39 |
GtkTooltips *tooltips; |
|
|
| 40 |
} NameplateTilePrivate; |
39 |
} NameplateTilePrivate; |
| 41 |
|
40 |
|
| 42 |
#define NAMEPLATE_TILE_GET_PRIVATE(o) (G_TYPE_INSTANCE_GET_PRIVATE ((o), NAMEPLATE_TILE_TYPE, NameplateTilePrivate)) |
41 |
#define NAMEPLATE_TILE_GET_PRIVATE(o) (G_TYPE_INSTANCE_GET_PRIVATE ((o), NAMEPLATE_TILE_TYPE, NameplateTilePrivate)) |
|
Lines 100-106
nameplate_tile_class_init (NameplateTileClass * this_class)
Link Here
|
| 100 |
static void |
99 |
static void |
| 101 |
nameplate_tile_init (NameplateTile * this) |
100 |
nameplate_tile_init (NameplateTile * this) |
| 102 |
{ |
101 |
{ |
| 103 |
NAMEPLATE_TILE_GET_PRIVATE (this)->tooltips = NULL; |
|
|
| 104 |
} |
102 |
} |
| 105 |
|
103 |
|
| 106 |
static GObject * |
104 |
static GObject * |
|
Lines 117-122
nameplate_tile_constructor (GType type, guint n_param, GObjectConstructParam * p
Link Here
|
| 117 |
static void |
115 |
static void |
| 118 |
nameplate_tile_finalize (GObject * g_object) |
116 |
nameplate_tile_finalize (GObject * g_object) |
| 119 |
{ |
117 |
{ |
|
|
118 |
NameplateTile *np_tile; |
| 119 |
NameplateTilePrivate *priv; |
| 120 |
|
| 121 |
np_tile = NAMEPLATE_TILE (g_object); |
| 122 |
priv = NAMEPLATE_TILE_GET_PRIVATE (np_tile); |
| 123 |
|
| 120 |
(*G_OBJECT_CLASS (nameplate_tile_parent_class)->finalize) (g_object); |
124 |
(*G_OBJECT_CLASS (nameplate_tile_parent_class)->finalize) (g_object); |
| 121 |
} |
125 |
} |
| 122 |
|
126 |
|
|
Lines 124-130
static void
Link Here
|
| 124 |
nameplate_tile_get_property (GObject * g_object, guint prop_id, GValue * value, |
128 |
nameplate_tile_get_property (GObject * g_object, guint prop_id, GValue * value, |
| 125 |
GParamSpec * param_spec) |
129 |
GParamSpec * param_spec) |
| 126 |
{ |
130 |
{ |
| 127 |
GtkTooltipsData *tooltip; |
131 |
char *tooltip; |
| 128 |
NameplateTile *np_tile = NAMEPLATE_TILE (g_object); |
132 |
NameplateTile *np_tile = NAMEPLATE_TILE (g_object); |
| 129 |
|
133 |
|
| 130 |
switch (prop_id) |
134 |
switch (prop_id) |
|
Lines 141-148
nameplate_tile_get_property (GObject * g_object, guint prop_id, GValue * value,
Link Here
|
| 141 |
g_value_set_object (value, np_tile->subheader); |
145 |
g_value_set_object (value, np_tile->subheader); |
| 142 |
break; |
146 |
break; |
| 143 |
case PROP_NAMEPLATE_TOOLTIP: |
147 |
case PROP_NAMEPLATE_TOOLTIP: |
| 144 |
tooltip = gtk_tooltips_data_get (GTK_WIDGET (np_tile)); |
148 |
tooltip = gtk_widget_get_tooltip_text (GTK_WIDGET (np_tile)); |
| 145 |
g_value_set_string (value, tooltip ? tooltip->tip_text : NULL); |
149 |
g_value_set_string (value, tooltip); |
|
|
150 |
g_free (tooltip); |
| 146 |
break; |
151 |
break; |
| 147 |
|
152 |
|
| 148 |
default: |
153 |
default: |
|
Lines 229-245
nameplate_tile_set_property (GObject * g_object, guint prop_id, const GValue * v
Link Here
|
| 229 |
break; |
234 |
break; |
| 230 |
|
235 |
|
| 231 |
case PROP_NAMEPLATE_TOOLTIP: |
236 |
case PROP_NAMEPLATE_TOOLTIP: |
| 232 |
if (tooltip) { |
237 |
gtk_widget_set_tooltip_text (GTK_WIDGET (this), tooltip); |
| 233 |
if (! priv->tooltips) |
|
|
| 234 |
priv->tooltips = gtk_tooltips_new (); |
| 235 |
|
| 236 |
gtk_tooltips_set_tip (priv->tooltips, GTK_WIDGET(this), tooltip, tooltip); |
| 237 |
gtk_tooltips_enable(priv->tooltips); |
| 238 |
} |
| 239 |
else |
| 240 |
if (priv->tooltips) |
| 241 |
gtk_tooltips_disable(priv->tooltips); |
| 242 |
|
| 243 |
break; |
238 |
break; |
| 244 |
|
239 |
|
| 245 |
|
240 |
|