#include "gtktexttag.h"
#include "gtktexttypes.h"
#include "gtktexttagtable.h"
-#include "gtksignal.h"
#include "gtkmain.h"
#include "gtkintl.h"
#include "gtkmarshalers.h"
-#include "gtktypebuiltins.h"
#include <stdlib.h>
#include <string.h>
(GInstanceInitFunc) gtk_text_tag_init
};
- our_type = g_type_register_static (G_TYPE_OBJECT,
- "GtkTextTag",
- &our_info,
- 0);
+ our_type = g_type_register_static (G_TYPE_OBJECT, "GtkTextTag",
+ &our_info, 0);
}
return our_type;
PROP_NAME,
g_param_spec_string ("name",
_("Tag name"),
- _("Name used to refer to the text tag. NULL for anonymous tags."),
+ _("Name used to refer to the text tag. NULL for anonymous tags"),
NULL,
G_PARAM_READABLE | G_PARAM_WRITABLE | G_PARAM_CONSTRUCT_ONLY));
PROP_STYLE,
g_param_spec_enum ("style",
_("Font style"),
- _("Font style as a PangoStyle, e.g. PANGO_STYLE_ITALIC."),
+ _("Font style as a PangoStyle, e.g. PANGO_STYLE_ITALIC"),
PANGO_TYPE_STYLE,
PANGO_STYLE_NORMAL,
G_PARAM_READABLE | G_PARAM_WRITABLE));
PROP_VARIANT,
g_param_spec_enum ("variant",
_("Font variant"),
- _("Font variant as a PangoVariant, e.g. PANGO_VARIANT_SMALL_CAPS."),
+ _("Font variant as a PangoVariant, e.g. PANGO_VARIANT_SMALL_CAPS"),
PANGO_TYPE_VARIANT,
PANGO_VARIANT_NORMAL,
G_PARAM_READABLE | G_PARAM_WRITABLE));
PROP_WEIGHT,
g_param_spec_int ("weight",
_("Font weight"),
- _("Font weight as an integer, see predefined values in PangoWeight; for example, PANGO_WEIGHT_BOLD."),
+ _("Font weight as an integer, see predefined values in PangoWeight; for example, PANGO_WEIGHT_BOLD"),
0,
G_MAXINT,
PANGO_WEIGHT_NORMAL,
PROP_STRETCH,
g_param_spec_enum ("stretch",
_("Font stretch"),
- _("Font stretch as a PangoStretch, e.g. PANGO_STRETCH_CONDENSED."),
+ _("Font stretch as a PangoStretch, e.g. PANGO_STRETCH_CONDENSED"),
PANGO_TYPE_STRETCH,
PANGO_STRETCH_NORMAL,
G_PARAM_READABLE | G_PARAM_WRITABLE));
PROP_SIZE,
g_param_spec_int ("size",
_("Font size"),
- _("Font size in Pango units."),
+ _("Font size in Pango units"),
0,
G_MAXINT,
0,
PROP_SCALE,
g_param_spec_double ("scale",
_("Font scale"),
- _("Font size as a scale factor relative to the default font size. This properly adapts to theme changes etc. so is recommended. Pango predefines some scales such as PANGO_SCALE_X_LARGE."),
+ _("Font size as a scale factor relative to the default font size. This properly adapts to theme changes etc. so is recommended. Pango predefines some scales such as PANGO_SCALE_X_LARGE"),
0.0,
G_MAXDOUBLE,
1.0,
PROP_LANGUAGE,
g_param_spec_string ("language",
_("Language"),
- _("The language this text is in, as an ISO code. Pango can use this as a hint when rendering the text. If you don't understand this parameter, you probably don't need it."),
+ _("The language this text is in, as an ISO code. Pango can use this as a hint when rendering the text. If you don't understand this parameter, you probably don't need it"),
NULL,
G_PARAM_READABLE | G_PARAM_WRITABLE));
g_signal_new ("event",
G_OBJECT_CLASS_TYPE (object_class),
G_SIGNAL_RUN_LAST,
- GTK_SIGNAL_OFFSET (GtkTextTagClass, event),
+ G_STRUCT_OFFSET (GtkTextTagClass, event),
_gtk_boolean_handled_accumulator, NULL,
_gtk_marshal_BOOLEAN__OBJECT_BOXED_BOXED,
G_TYPE_BOOLEAN,
{
GtkTextTag *tag;
- tag = GTK_TEXT_TAG (g_object_new (gtk_text_tag_get_type (),
- "name", name,
- NULL));
+ tag = g_object_new (GTK_TYPE_TEXT_TAG, "name", name, NULL);
return tag;
}
if (text_tag->values->appearance.bg_stipple != bitmap)
{
if (bitmap != NULL)
- gdk_bitmap_ref (bitmap);
+ g_object_ref (bitmap);
if (text_tag->values->appearance.bg_stipple)
- gdk_bitmap_unref (text_tag->values->appearance.bg_stipple);
+ g_object_unref (text_tag->values->appearance.bg_stipple);
text_tag->values->appearance.bg_stipple = bitmap;
}
if (text_tag->values->appearance.fg_stipple != bitmap)
{
if (bitmap != NULL)
- gdk_bitmap_ref (bitmap);
+ g_object_ref (bitmap);
if (text_tag->values->appearance.fg_stipple)
- gdk_bitmap_unref (text_tag->values->appearance.fg_stipple);
+ g_object_unref (text_tag->values->appearance.fg_stipple);
text_tag->values->appearance.fg_stipple = bitmap;
}
case PROP_BG_FULL_HEIGHT:
text_tag->bg_full_height_set = TRUE;
text_tag->values->bg_full_height = g_value_get_boolean (value);
- g_object_notify (object, "bg_full_height_set");
+ g_object_notify (object, "background_full_height_set");
break;
case PROP_LANGUAGE:
if (!text_tag->bg_stipple_set &&
text_tag->values->appearance.bg_stipple)
{
- g_object_unref (G_OBJECT (text_tag->values->appearance.bg_stipple));
+ g_object_unref (text_tag->values->appearance.bg_stipple);
text_tag->values->appearance.bg_stipple = NULL;
}
break;
if (!text_tag->fg_stipple_set &&
text_tag->values->appearance.fg_stipple)
{
- g_object_unref (G_OBJECT (text_tag->values->appearance.fg_stipple));
+ g_object_unref (text_tag->values->appearance.fg_stipple);
text_tag->values->appearance.fg_stipple = NULL;
}
break;
*/
if (text_tag->table)
- g_signal_emit_by_name (G_OBJECT (text_tag->table),
+ g_signal_emit_by_name (text_tag->table,
"tag_changed",
text_tag, size_changed);
}
-static void
-get_color_arg (GValue *value, GdkColor *orig)
-{
- g_value_init (value, GDK_TYPE_COLOR);
- g_value_set_boxed (value, orig);
-}
-
static void
gtk_text_tag_get_property (GObject *object,
guint prop_id,
break;
case PROP_BACKGROUND_GDK:
- get_color_arg (value, &tag->values->appearance.bg_color);
+ g_value_set_boxed (value, &tag->values->appearance.bg_color);
break;
case PROP_FOREGROUND_GDK:
- get_color_arg (value, &tag->values->appearance.fg_color);
+ g_value_set_boxed (value, &tag->values->appearance.fg_color);
break;
case PROP_BACKGROUND_STIPPLE:
g_return_val_if_fail (G_IS_OBJECT (event_object), FALSE);
g_return_val_if_fail (event != NULL, FALSE);
- g_signal_emit (G_OBJECT (tag),
+ g_signal_emit (tag,
signals[EVENT],
0,
event_object,
static GType our_type = 0;
if (our_type == 0)
- our_type = g_boxed_type_register_static ("GtkTypeTextAttributes",
+ our_type = g_boxed_type_register_static ("GtkTextAttributes",
(GBoxedCopyFunc) gtk_text_attributes_ref,
(GBoxedFreeFunc) gtk_text_attributes_unref);
/* Add refs */
if (src->appearance.bg_stipple)
- gdk_bitmap_ref (src->appearance.bg_stipple);
+ g_object_ref (src->appearance.bg_stipple);
if (src->appearance.fg_stipple)
- gdk_bitmap_ref (src->appearance.fg_stipple);
+ g_object_ref (src->appearance.fg_stipple);
/* Remove refs */
if (dest->appearance.bg_stipple)
- gdk_bitmap_unref (dest->appearance.bg_stipple);
+ g_object_unref (dest->appearance.bg_stipple);
if (dest->appearance.fg_stipple)
- gdk_bitmap_unref (dest->appearance.fg_stipple);
+ g_object_unref (dest->appearance.fg_stipple);
if (dest->font)
pango_font_description_free (dest->font);
g_assert (!values->realized);
if (values->appearance.bg_stipple)
- gdk_bitmap_unref (values->appearance.bg_stipple);
+ g_object_unref (values->appearance.bg_stipple);
if (values->appearance.fg_stipple)
- gdk_bitmap_unref (values->appearance.fg_stipple);
+ g_object_unref (values->appearance.fg_stipple);
if (values->tabs)
pango_tab_array_free (values->tabs);
if (tag->bg_stipple_set)
{
- gdk_bitmap_ref (vals->appearance.bg_stipple);
+ g_object_ref (vals->appearance.bg_stipple);
if (dest->appearance.bg_stipple)
- gdk_bitmap_unref (dest->appearance.bg_stipple);
+ g_object_unref (dest->appearance.bg_stipple);
dest->appearance.bg_stipple = vals->appearance.bg_stipple;
dest->appearance.draw_bg = TRUE;
if (tag->fg_stipple_set)
{
- gdk_bitmap_ref (vals->appearance.fg_stipple);
+ g_object_ref (vals->appearance.fg_stipple);
if (dest->appearance.fg_stipple)
- gdk_bitmap_unref (dest->appearance.fg_stipple);
+ g_object_unref (dest->appearance.fg_stipple);
dest->appearance.fg_stipple = vals->appearance.fg_stipple;
}