*/
#define GTK_TEXT_USE_INTERNAL_UNSUPPORTED_API
-#include "gtksignal.h"
#include "gtkmarshalers.h"
#include "gtktextlayout.h"
#include "gtktextbtree.h"
(GInstanceInitFunc) gtk_text_layout_init
};
- our_type = g_type_register_static (G_TYPE_OBJECT,
- "GtkTextLayout",
- &our_info,
- 0);
+ our_type = g_type_register_static (G_TYPE_OBJECT, "GtkTextLayout",
+ &our_info, 0);
}
return our_type;
G_STRUCT_OFFSET (GtkTextLayoutClass, invalidated),
NULL, NULL,
_gtk_marshal_VOID__VOID,
- GTK_TYPE_NONE,
+ G_TYPE_NONE,
0);
signals[CHANGED] =
G_STRUCT_OFFSET (GtkTextLayoutClass, changed),
NULL, NULL,
_gtk_marshal_VOID__INT_INT_INT,
- GTK_TYPE_NONE,
+ G_TYPE_NONE,
3,
- GTK_TYPE_INT,
- GTK_TYPE_INT,
- GTK_TYPE_INT);
+ G_TYPE_INT,
+ G_TYPE_INT,
+ G_TYPE_INT);
signals[ALLOCATE_CHILD] =
g_signal_new ("allocate_child",
G_STRUCT_OFFSET (GtkTextLayoutClass, allocate_child),
NULL, NULL,
_gtk_marshal_VOID__OBJECT_INT_INT,
- GTK_TYPE_NONE,
+ G_TYPE_NONE,
3,
GTK_TYPE_OBJECT,
- GTK_TYPE_INT,
- GTK_TYPE_INT);
+ G_TYPE_INT,
+ G_TYPE_INT);
}
static void
GtkTextLayout*
gtk_text_layout_new (void)
{
- return GTK_TEXT_LAYOUT (g_object_new (gtk_text_layout_get_type (), NULL));
+ return g_object_new (GTK_TYPE_TEXT_LAYOUT, NULL);
}
static void
if (layout->ltr_context)
{
- g_object_unref (G_OBJECT (layout->ltr_context));
+ g_object_unref (layout->ltr_context);
layout->ltr_context = NULL;
}
if (layout->rtl_context)
{
- g_object_unref (G_OBJECT (layout->rtl_context));
+ g_object_unref (layout->rtl_context);
layout->rtl_context = NULL;
}
+ if (layout->one_display_cache)
+ {
+ GtkTextLineDisplay *tmp_display = layout->one_display_cache;
+ layout->one_display_cache = NULL;
+ gtk_text_layout_free_line_display (layout, tmp_display);
+ }
+
(* G_OBJECT_CLASS (parent_class)->finalize) (object);
}
_gtk_text_btree_remove_view (_gtk_text_buffer_get_btree (layout->buffer),
layout);
- g_object_unref (G_OBJECT (layout->buffer));
+ g_object_unref (layout->buffer);
layout->buffer = NULL;
}
{
layout->buffer = buffer;
- g_object_ref (G_OBJECT (buffer));
+ g_object_ref (buffer);
_gtk_text_btree_add_view (_gtk_text_buffer_get_btree (buffer), layout);
}
g_return_if_fail (GTK_IS_TEXT_LAYOUT (layout));
if (layout->ltr_context)
- g_object_unref (G_OBJECT (ltr_context));
+ g_object_unref (ltr_context);
layout->ltr_context = ltr_context;
- g_object_ref (G_OBJECT (ltr_context));
+ g_object_ref (ltr_context);
if (layout->rtl_context)
- g_object_unref (G_OBJECT (rtl_context));
+ g_object_unref (rtl_context);
layout->rtl_context = rtl_context;
- g_object_ref (G_OBJECT (rtl_context));
+ g_object_ref (rtl_context);
DV (g_print ("invalidating all due to new pango contexts (%s)\n", G_STRLOC));
gtk_text_layout_invalidate_all (layout);
static void
gtk_text_layout_invalidated (GtkTextLayout *layout)
{
- g_signal_emit (G_OBJECT (layout), signals[INVALIDATED], 0);
+ g_signal_emit (layout, signals[INVALIDATED], 0);
}
void
gint old_height,
gint new_height)
{
- g_signal_emit (G_OBJECT (layout), signals[CHANGED], 0,
- y, old_height, new_height);
+ g_signal_emit (layout, signals[CHANGED], 0, y, old_height, new_height);
}
void
* @layout: a #GtkTextLayout
* @anchor: iter pointing into a line that will be used as the
* coordinate origin
- * @y0: offset from the top of the line pointed to by @anchor at
- * which to begin validation. (The offset here is in pixels
- * after validation.)
- * @y1: offset from the top of the line pointed to by @anchor at
- * which to end validation. (The offset here is in pixels
- * after validation.)
+ * @y0_: offset from the top of the line pointed to by @anchor at
+ * which to begin validation. (The offset here is in pixels
+ * after validation.)
+ * @y1_: offset from the top of the line pointed to by @anchor at
+ * which to end validation. (The offset here is in pixels
+ * after validation.)
*
* Ensure that a region of a #GtkTextLayout is valid. The ::changed
* signal will be emitted if any lines are validated.
GtkTextAppearance *appearance = &((GtkTextAttrAppearance *)attr)->appearance;
if (appearance->bg_stipple)
- gdk_drawable_unref (appearance->bg_stipple);
+ g_object_unref (appearance->bg_stipple);
if (appearance->fg_stipple)
- gdk_drawable_unref (appearance->fg_stipple);
+ g_object_unref (appearance->fg_stipple);
g_free (attr);
}
result->appearance = *appearance;
if (appearance->bg_stipple)
- gdk_drawable_ref (appearance->bg_stipple);
+ g_object_ref (appearance->bg_stipple);
if (appearance->fg_stipple)
- gdk_drawable_ref (appearance->fg_stipple);
+ g_object_ref (appearance->fg_stipple);
return (PangoAttribute *)result;
}
NULL,
&extents);
- g_signal_emit (G_OBJECT (text_layout),
+ g_signal_emit (text_layout,
signals[ALLOCATE_CHILD],
0,
shaped_object,
if (display != layout->one_display_cache)
{
if (display->layout)
- g_object_unref (G_OBJECT (display->layout));
+ g_object_unref (display->layout);
if (display->cursors)
{