diff --git a/ChangeLog b/ChangeLog index c83cf7a0e4..75d6ceed22 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,10 @@ +Thu Oct 10 14:41:05 2002 Manish Singh + + * gtk/gtktextbtree.c gtk/gtktextbuffer.c gtk/gtktextdisplay.c + gtk/gtktextlayout.c gtk/gtktextmark.c gtk/gtktexttag.[ch] + gtk/gtktexttagtable.c gtk/gtktextutil.c gtk/gtktextview.[ch]: + Deprecation cleanup + Thu Oct 10 14:35:31 2002 Owen Taylor * gtk/gtkscrolledwindow.[ch]: Privately export diff --git a/ChangeLog.pre-2-10 b/ChangeLog.pre-2-10 index c83cf7a0e4..75d6ceed22 100644 --- a/ChangeLog.pre-2-10 +++ b/ChangeLog.pre-2-10 @@ -1,3 +1,10 @@ +Thu Oct 10 14:41:05 2002 Manish Singh + + * gtk/gtktextbtree.c gtk/gtktextbuffer.c gtk/gtktextdisplay.c + gtk/gtktextlayout.c gtk/gtktextmark.c gtk/gtktexttag.[ch] + gtk/gtktexttagtable.c gtk/gtktextutil.c gtk/gtktextview.[ch]: + Deprecation cleanup + Thu Oct 10 14:35:31 2002 Owen Taylor * gtk/gtkscrolledwindow.[ch]: Privately export diff --git a/ChangeLog.pre-2-2 b/ChangeLog.pre-2-2 index c83cf7a0e4..75d6ceed22 100644 --- a/ChangeLog.pre-2-2 +++ b/ChangeLog.pre-2-2 @@ -1,3 +1,10 @@ +Thu Oct 10 14:41:05 2002 Manish Singh + + * gtk/gtktextbtree.c gtk/gtktextbuffer.c gtk/gtktextdisplay.c + gtk/gtktextlayout.c gtk/gtktextmark.c gtk/gtktexttag.[ch] + gtk/gtktexttagtable.c gtk/gtktextutil.c gtk/gtktextview.[ch]: + Deprecation cleanup + Thu Oct 10 14:35:31 2002 Owen Taylor * gtk/gtkscrolledwindow.[ch]: Privately export diff --git a/ChangeLog.pre-2-4 b/ChangeLog.pre-2-4 index c83cf7a0e4..75d6ceed22 100644 --- a/ChangeLog.pre-2-4 +++ b/ChangeLog.pre-2-4 @@ -1,3 +1,10 @@ +Thu Oct 10 14:41:05 2002 Manish Singh + + * gtk/gtktextbtree.c gtk/gtktextbuffer.c gtk/gtktextdisplay.c + gtk/gtktextlayout.c gtk/gtktextmark.c gtk/gtktexttag.[ch] + gtk/gtktexttagtable.c gtk/gtktextutil.c gtk/gtktextview.[ch]: + Deprecation cleanup + Thu Oct 10 14:35:31 2002 Owen Taylor * gtk/gtkscrolledwindow.[ch]: Privately export diff --git a/ChangeLog.pre-2-6 b/ChangeLog.pre-2-6 index c83cf7a0e4..75d6ceed22 100644 --- a/ChangeLog.pre-2-6 +++ b/ChangeLog.pre-2-6 @@ -1,3 +1,10 @@ +Thu Oct 10 14:41:05 2002 Manish Singh + + * gtk/gtktextbtree.c gtk/gtktextbuffer.c gtk/gtktextdisplay.c + gtk/gtktextlayout.c gtk/gtktextmark.c gtk/gtktexttag.[ch] + gtk/gtktexttagtable.c gtk/gtktextutil.c gtk/gtktextview.[ch]: + Deprecation cleanup + Thu Oct 10 14:35:31 2002 Owen Taylor * gtk/gtkscrolledwindow.[ch]: Privately export diff --git a/ChangeLog.pre-2-8 b/ChangeLog.pre-2-8 index c83cf7a0e4..75d6ceed22 100644 --- a/ChangeLog.pre-2-8 +++ b/ChangeLog.pre-2-8 @@ -1,3 +1,10 @@ +Thu Oct 10 14:41:05 2002 Manish Singh + + * gtk/gtktextbtree.c gtk/gtktextbuffer.c gtk/gtktextdisplay.c + gtk/gtktextlayout.c gtk/gtktextmark.c gtk/gtktexttag.[ch] + gtk/gtktexttagtable.c gtk/gtktextutil.c gtk/gtktextview.[ch]: + Deprecation cleanup + Thu Oct 10 14:35:31 2002 Owen Taylor * gtk/gtkscrolledwindow.[ch]: Privately export diff --git a/gtk/gtktextbtree.c b/gtk/gtktextbtree.c index 42194fbc2d..3fa504d2cb 100644 --- a/gtk/gtktextbtree.c +++ b/gtk/gtktextbtree.c @@ -57,7 +57,6 @@ #include #include #include -#include "gtksignal.h" #include "gtktexttag.h" #include "gtktexttagtable.h" #include "gtktextlayout.h" @@ -425,9 +424,9 @@ _gtk_text_btree_new (GtkTextTagTable *table, tree->end_iter_segment_byte_index = 0; tree->end_iter_segment_char_offset = 0; - g_object_ref (G_OBJECT (tree->table)); + g_object_ref (tree->table); - tree->tag_changed_handler = g_signal_connect (G_OBJECT (tree->table), + tree->tag_changed_handler = g_signal_connect (tree->table, "tag_changed", G_CALLBACK (tag_changed_cb), tree); @@ -471,8 +470,8 @@ _gtk_text_btree_new (GtkTextTagTable *table, seg->body.mark.not_deleteable = TRUE; - g_object_ref (G_OBJECT (tree->insert_mark)); - g_object_ref (G_OBJECT (tree->selection_bound_mark)); + g_object_ref (tree->insert_mark); + g_object_ref (tree->selection_bound_mark); } tree->refcount = 1; @@ -499,10 +498,10 @@ _gtk_text_btree_unref (GtkTextBTree *tree) if (tree->refcount == 0) { - g_signal_handler_disconnect (G_OBJECT (tree->table), + g_signal_handler_disconnect (tree->table, tree->tag_changed_handler); - g_object_unref (G_OBJECT (tree->table)); + g_object_unref (tree->table); tree->table = NULL; gtk_text_btree_node_destroy (tree, tree->root_node); @@ -517,9 +516,9 @@ _gtk_text_btree_unref (GtkTextBTree *tree) tree->child_anchor_table = NULL; } - g_object_unref (G_OBJECT (tree->insert_mark)); + g_object_unref (tree->insert_mark); tree->insert_mark = NULL; - g_object_unref (G_OBJECT (tree->selection_bound_mark)); + g_object_unref (tree->selection_bound_mark); tree->selection_bound_mark = NULL; g_free (tree); @@ -2698,7 +2697,7 @@ _gtk_text_btree_release_mark_segment (GtkTextBTree *tree, /* Remove the ref on the mark, which frees segment as a side effect * if this is the last reference. */ - g_object_unref (G_OBJECT (segment->body.mark.obj)); + g_object_unref (segment->body.mark.obj); } void @@ -5778,7 +5777,7 @@ gtk_text_btree_get_tag_info (GtkTextBTree *tree, info = g_new (GtkTextTagInfo, 1); info->tag = tag; - g_object_ref (G_OBJECT (tag)); + g_object_ref (tag); info->tag_root = NULL; info->toggle_count = 0; @@ -5826,7 +5825,7 @@ gtk_text_btree_remove_tag_info (GtkTextBTree *tree, list->next = NULL; g_slist_free (list); - g_object_unref (G_OBJECT (info->tag)); + g_object_unref (info->tag); g_free (info); return; diff --git a/gtk/gtktextbuffer.c b/gtk/gtktextbuffer.c index 60f557b5ce..3271a55736 100644 --- a/gtk/gtktextbuffer.c +++ b/gtk/gtktextbuffer.c @@ -32,7 +32,6 @@ #include "gtkclipboard.h" #include "gtkinvisible.h" #include "gtkmarshalers.h" -#include "gtksignal.h" #include "gtktextbuffer.h" #include "gtktextbtree.h" #include "gtktextiterprivate.h" @@ -148,10 +147,8 @@ gtk_text_buffer_get_type (void) (GInstanceInitFunc) gtk_text_buffer_init }; - our_type = g_type_register_static (G_TYPE_OBJECT, - "GtkTextBuffer", - &our_info, - 0); + our_type = g_type_register_static (G_TYPE_OBJECT, "GtkTextBuffer", + &our_info, 0); } return our_type; @@ -192,11 +189,11 @@ gtk_text_buffer_class_init (GtkTextBufferClass *klass) G_STRUCT_OFFSET (GtkTextBufferClass, insert_text), NULL, NULL, _gtk_marshal_VOID__BOXED_STRING_INT, - GTK_TYPE_NONE, + G_TYPE_NONE, 3, GTK_TYPE_TEXT_ITER | G_SIGNAL_TYPE_STATIC_SCOPE, - GTK_TYPE_STRING | G_SIGNAL_TYPE_STATIC_SCOPE, - GTK_TYPE_INT); + G_TYPE_STRING | G_SIGNAL_TYPE_STATIC_SCOPE, + G_TYPE_INT); signals[INSERT_PIXBUF] = g_signal_new ("insert_pixbuf", @@ -205,7 +202,7 @@ gtk_text_buffer_class_init (GtkTextBufferClass *klass) G_STRUCT_OFFSET (GtkTextBufferClass, insert_pixbuf), NULL, NULL, _gtk_marshal_VOID__BOXED_OBJECT, - GTK_TYPE_NONE, + G_TYPE_NONE, 2, GTK_TYPE_TEXT_ITER | G_SIGNAL_TYPE_STATIC_SCOPE, GDK_TYPE_PIXBUF); @@ -217,7 +214,7 @@ gtk_text_buffer_class_init (GtkTextBufferClass *klass) G_STRUCT_OFFSET (GtkTextBufferClass, insert_child_anchor), NULL, NULL, _gtk_marshal_VOID__BOXED_OBJECT, - GTK_TYPE_NONE, + G_TYPE_NONE, 2, GTK_TYPE_TEXT_ITER | G_SIGNAL_TYPE_STATIC_SCOPE, GTK_TYPE_TEXT_CHILD_ANCHOR); @@ -229,7 +226,7 @@ gtk_text_buffer_class_init (GtkTextBufferClass *klass) G_STRUCT_OFFSET (GtkTextBufferClass, delete_range), NULL, NULL, _gtk_marshal_VOID__BOXED_BOXED, - GTK_TYPE_NONE, + G_TYPE_NONE, 2, GTK_TYPE_TEXT_ITER | G_SIGNAL_TYPE_STATIC_SCOPE, GTK_TYPE_TEXT_ITER | G_SIGNAL_TYPE_STATIC_SCOPE); @@ -241,7 +238,7 @@ gtk_text_buffer_class_init (GtkTextBufferClass *klass) G_STRUCT_OFFSET (GtkTextBufferClass, changed), NULL, NULL, _gtk_marshal_VOID__VOID, - GTK_TYPE_NONE, + G_TYPE_NONE, 0); signals[MODIFIED_CHANGED] = @@ -251,7 +248,7 @@ gtk_text_buffer_class_init (GtkTextBufferClass *klass) G_STRUCT_OFFSET (GtkTextBufferClass, modified_changed), NULL, NULL, _gtk_marshal_VOID__VOID, - GTK_TYPE_NONE, + G_TYPE_NONE, 0); signals[MARK_SET] = @@ -261,7 +258,7 @@ gtk_text_buffer_class_init (GtkTextBufferClass *klass) G_STRUCT_OFFSET (GtkTextBufferClass, mark_set), NULL, NULL, _gtk_marshal_VOID__BOXED_OBJECT, - GTK_TYPE_NONE, + G_TYPE_NONE, 2, GTK_TYPE_TEXT_ITER, GTK_TYPE_TEXT_MARK); @@ -273,7 +270,7 @@ gtk_text_buffer_class_init (GtkTextBufferClass *klass) G_STRUCT_OFFSET (GtkTextBufferClass, mark_deleted), NULL, NULL, _gtk_marshal_VOID__OBJECT, - GTK_TYPE_NONE, + G_TYPE_NONE, 1, GTK_TYPE_TEXT_MARK); @@ -284,7 +281,7 @@ gtk_text_buffer_class_init (GtkTextBufferClass *klass) G_STRUCT_OFFSET (GtkTextBufferClass, apply_tag), NULL, NULL, _gtk_marshal_VOID__OBJECT_BOXED_BOXED, - GTK_TYPE_NONE, + G_TYPE_NONE, 3, GTK_TYPE_TEXT_TAG, GTK_TYPE_TEXT_ITER, @@ -297,7 +294,7 @@ gtk_text_buffer_class_init (GtkTextBufferClass *klass) G_STRUCT_OFFSET (GtkTextBufferClass, remove_tag), NULL, NULL, _gtk_marshal_VOID__OBJECT_BOXED_BOXED, - GTK_TYPE_NONE, + G_TYPE_NONE, 3, GTK_TYPE_TEXT_TAG, GTK_TYPE_TEXT_ITER, @@ -310,7 +307,7 @@ gtk_text_buffer_class_init (GtkTextBufferClass *klass) G_STRUCT_OFFSET (GtkTextBufferClass, begin_user_action), NULL, NULL, _gtk_marshal_VOID__VOID, - GTK_TYPE_NONE, + G_TYPE_NONE, 0); signals[END_USER_ACTION] = @@ -320,7 +317,7 @@ gtk_text_buffer_class_init (GtkTextBufferClass *klass) G_STRUCT_OFFSET (GtkTextBufferClass, end_user_action), NULL, NULL, _gtk_marshal_VOID__VOID, - GTK_TYPE_NONE, + G_TYPE_NONE, 0); } @@ -411,9 +408,7 @@ gtk_text_buffer_new (GtkTextTagTable *table) { GtkTextBuffer *text_buffer; - text_buffer = GTK_TEXT_BUFFER (g_object_new (GTK_TYPE_TEXT_BUFFER, - "tag_table", table, - NULL)); + text_buffer = g_object_new (GTK_TYPE_TEXT_BUFFER, "tag_table", table, NULL); return text_buffer; } @@ -431,7 +426,7 @@ gtk_text_buffer_finalize (GObject *object) if (buffer->tag_table) { _gtk_text_tag_table_remove_buffer (buffer->tag_table, buffer); - g_object_unref (G_OBJECT (buffer->tag_table)); + g_object_unref (buffer->tag_table); buffer->tag_table = NULL; } @@ -529,7 +524,7 @@ gtk_text_buffer_real_insert_text (GtkTextBuffer *buffer, _gtk_text_btree_insert (iter, text, len); - g_signal_emit (G_OBJECT (buffer), signals[CHANGED], 0); + g_signal_emit (buffer, signals[CHANGED], 0); } static void @@ -549,7 +544,7 @@ gtk_text_buffer_emit_insert (GtkTextBuffer *buffer, if (len > 0) { - g_signal_emit (G_OBJECT (buffer), signals[INSERT_TEXT], 0, + g_signal_emit (buffer, signals[INSERT_TEXT], 0, iter, text, len); } } @@ -731,7 +726,7 @@ save_range (GtkTextIter *range_start, r = g_new (Range, 1); r->buffer = gtk_text_iter_get_buffer (range_start); - g_object_ref (G_OBJECT (r->buffer)); + g_object_ref (r->buffer); r->start_mark = gtk_text_buffer_create_mark (gtk_text_iter_get_buffer (range_start), @@ -787,7 +782,7 @@ restore_range (Range *r) if (gtk_text_iter_compare (r->range_end, r->whole_end) > 0) *r->range_end = *r->whole_end; - g_object_unref (G_OBJECT (r->buffer)); + g_object_unref (r->buffer); g_free (r); } @@ -1253,7 +1248,7 @@ gtk_text_buffer_real_delete_range (GtkTextBuffer *buffer, /* may have deleted the selection... */ update_selection_clipboards (buffer); - g_signal_emit (G_OBJECT (buffer), signals[CHANGED], 0); + g_signal_emit (buffer, signals[CHANGED], 0); } static void @@ -1270,7 +1265,7 @@ gtk_text_buffer_emit_delete (GtkTextBuffer *buffer, gtk_text_iter_order (start, end); - g_signal_emit (G_OBJECT (buffer), + g_signal_emit (buffer, signals[DELETE_RANGE], 0, start, end); @@ -1529,7 +1524,7 @@ gtk_text_buffer_real_insert_pixbuf (GtkTextBuffer *buffer, { _gtk_text_btree_insert_pixbuf (iter, pixbuf); - g_signal_emit (G_OBJECT (buffer), signals[CHANGED], 0); + g_signal_emit (buffer, signals[CHANGED], 0); } /** @@ -1558,7 +1553,7 @@ gtk_text_buffer_insert_pixbuf (GtkTextBuffer *buffer, g_return_if_fail (GDK_IS_PIXBUF (pixbuf)); g_return_if_fail (gtk_text_iter_get_buffer (iter) == buffer); - g_signal_emit (G_OBJECT (buffer), signals[INSERT_PIXBUF], 0, + g_signal_emit (buffer, signals[INSERT_PIXBUF], 0, iter, pixbuf); } @@ -1574,7 +1569,7 @@ gtk_text_buffer_real_insert_anchor (GtkTextBuffer *buffer, { _gtk_text_btree_insert_child_anchor (iter, anchor); - g_signal_emit (G_OBJECT (buffer), signals[CHANGED], 0); + g_signal_emit (buffer, signals[CHANGED], 0); } /** @@ -1606,7 +1601,7 @@ gtk_text_buffer_insert_child_anchor (GtkTextBuffer *buffer, g_return_if_fail (GTK_IS_TEXT_CHILD_ANCHOR (anchor)); g_return_if_fail (gtk_text_iter_get_buffer (iter) == buffer); - g_signal_emit (G_OBJECT (buffer), signals[INSERT_CHILD_ANCHOR], 0, + g_signal_emit (buffer, signals[INSERT_CHILD_ANCHOR], 0, iter, anchor); } @@ -1638,7 +1633,7 @@ gtk_text_buffer_create_child_anchor (GtkTextBuffer *buffer, gtk_text_buffer_insert_child_anchor (buffer, iter, anchor); - g_object_unref (G_OBJECT (anchor)); + g_object_unref (anchor); return anchor; } @@ -1663,15 +1658,15 @@ gtk_text_buffer_mark_set (GtkTextBuffer *buffer, * default behavior. */ - g_object_ref (G_OBJECT (mark)); + g_object_ref (mark); - g_signal_emit (G_OBJECT (buffer), + g_signal_emit (buffer, signals[MARK_SET], 0, location, mark); - g_object_unref (G_OBJECT (mark)); + g_object_unref (mark); } /** @@ -1828,7 +1823,7 @@ gtk_text_buffer_delete_mark (GtkTextBuffer *buffer, g_return_if_fail (!gtk_text_mark_get_deleted (mark)); g_return_if_fail (GTK_IS_TEXT_BUFFER (buffer)); - g_object_ref (G_OBJECT (mark)); + g_object_ref (mark); _gtk_text_btree_remove_mark (get_btree (buffer), mark); @@ -1836,11 +1831,11 @@ gtk_text_buffer_delete_mark (GtkTextBuffer *buffer, * removing the mark, rather than removing the mark in a default * handler. */ - g_signal_emit (G_OBJECT (buffer), signals[MARK_DELETED], + g_signal_emit (buffer, signals[MARK_DELETED], 0, mark); - g_object_unref (G_OBJECT (mark)); + g_object_unref (mark); } /** @@ -2134,11 +2129,11 @@ gtk_text_buffer_emit_tag (GtkTextBuffer *buffer, gtk_text_iter_order (&start_tmp, &end_tmp); if (apply) - g_signal_emit (G_OBJECT (buffer), signals[APPLY_TAG], + g_signal_emit (buffer, signals[APPLY_TAG], 0, tag, &start_tmp, &end_tmp); else - g_signal_emit (G_OBJECT (buffer), signals[REMOVE_TAG], + g_signal_emit (buffer, signals[REMOVE_TAG], 0, tag, &start_tmp, &end_tmp); } @@ -2617,7 +2612,7 @@ gtk_text_buffer_set_modified (GtkTextBuffer *buffer, else { buffer->modified = fixed_setting; - g_signal_emit (G_OBJECT (buffer), signals[MODIFIED_CHANGED], 0); + g_signal_emit (buffer, signals[MODIFIED_CHANGED], 0); } } @@ -2948,7 +2943,7 @@ clipboard_text_received (GtkClipboard *clipboard, post_paste_cleanup (request_data); } - g_object_unref (G_OBJECT (buffer)); + g_object_unref (buffer); g_free (request_data); } @@ -3025,7 +3020,7 @@ paste_from_buffer (ClipboardRequest *request_data, GtkTextIter insert_point; /* We're about to emit a bunch of signals, so be safe */ - g_object_ref (G_OBJECT (src_buffer)); + g_object_ref (src_buffer); pre_paste_prep (request_data, &insert_point); @@ -3043,7 +3038,7 @@ paste_from_buffer (ClipboardRequest *request_data, post_paste_cleanup (request_data); - g_object_unref (G_OBJECT (src_buffer)); + g_object_unref (src_buffer); g_free (request_data); } @@ -3266,7 +3261,7 @@ gtk_text_buffer_paste_clipboard (GtkTextBuffer *buffer, override_location, FALSE); data->buffer = buffer; - g_object_ref (G_OBJECT (buffer)); + g_object_ref (buffer); data->interactive = TRUE; data->default_editable = default_editable; @@ -3483,7 +3478,7 @@ gtk_text_buffer_begin_user_action (GtkTextBuffer *buffer) if (buffer->user_action_count == 1) { /* Outermost nested user action begin emits the signal */ - g_signal_emit (G_OBJECT (buffer), signals[BEGIN_USER_ACTION], 0); + g_signal_emit (buffer, signals[BEGIN_USER_ACTION], 0); } } @@ -3505,7 +3500,7 @@ gtk_text_buffer_end_user_action (GtkTextBuffer *buffer) if (buffer->user_action_count == 0) { /* Ended the outermost-nested user action end, so emit the signal */ - g_signal_emit (G_OBJECT (buffer), signals[END_USER_ACTION], 0); + g_signal_emit (buffer, signals[END_USER_ACTION], 0); } } diff --git a/gtk/gtktextdisplay.c b/gtk/gtktextdisplay.c index b1c4ceebe6..e531a46526 100644 --- a/gtk/gtktextdisplay.c +++ b/gtk/gtktextdisplay.c @@ -124,8 +124,8 @@ gtk_text_render_state_new (GtkWidget *widget, static void gtk_text_render_state_destroy (GtkTextRenderState *state) { - gdk_gc_unref (state->fg_gc); - gdk_gc_unref (state->bg_gc); + g_object_unref (state->fg_gc); + g_object_unref (state->bg_gc); g_free (state); } @@ -410,7 +410,7 @@ render_layout_line (GdkDrawable *drawable, { gdk_gc_set_clip_rectangle (render_state->fg_gc, &render_state->clip_rect); - g_object_unref (G_OBJECT (mask)); + g_object_unref (mask); } } @@ -426,7 +426,7 @@ render_layout_line (GdkDrawable *drawable, if (widgets) { - g_object_ref (G_OBJECT (widget)); + g_object_ref (widget); *widgets = g_list_prepend (*widgets, widget); } } diff --git a/gtk/gtktextlayout.c b/gtk/gtktextlayout.c index bb76ae0801..fbff791534 100644 --- a/gtk/gtktextlayout.c +++ b/gtk/gtktextlayout.c @@ -77,7 +77,6 @@ */ #define GTK_TEXT_USE_INTERNAL_UNSUPPORTED_API -#include "gtksignal.h" #include "gtkmarshalers.h" #include "gtktextlayout.h" #include "gtktextbtree.h" @@ -149,10 +148,8 @@ gtk_text_layout_get_type (void) (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; @@ -178,7 +175,7 @@ gtk_text_layout_class_init (GtkTextLayoutClass *klass) G_STRUCT_OFFSET (GtkTextLayoutClass, invalidated), NULL, NULL, _gtk_marshal_VOID__VOID, - GTK_TYPE_NONE, + G_TYPE_NONE, 0); signals[CHANGED] = @@ -188,11 +185,11 @@ gtk_text_layout_class_init (GtkTextLayoutClass *klass) 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", @@ -201,11 +198,11 @@ gtk_text_layout_class_init (GtkTextLayoutClass *klass) 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 @@ -217,7 +214,7 @@ gtk_text_layout_init (GtkTextLayout *text_layout) 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 @@ -245,12 +242,12 @@ gtk_text_layout_finalize (GObject *object) 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; } @@ -281,7 +278,7 @@ gtk_text_layout_set_buffer (GtkTextLayout *layout, _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; } @@ -289,7 +286,7 @@ gtk_text_layout_set_buffer (GtkTextLayout *layout, { 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); } @@ -332,16 +329,16 @@ gtk_text_layout_set_contexts (GtkTextLayout *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); @@ -518,7 +515,7 @@ gtk_text_layout_get_size (GtkTextLayout *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 @@ -527,8 +524,7 @@ gtk_text_layout_changed (GtkTextLayout *layout, 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 @@ -1189,9 +1185,9 @@ gtk_text_attr_appearance_destroy (PangoAttribute *attr) 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); } @@ -1245,9 +1241,9 @@ gtk_text_attr_appearance_new (const GtkTextAppearance *appearance) 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; } @@ -1540,7 +1536,7 @@ allocate_child_widgets (GtkTextLayout *text_layout, NULL, &extents); - g_signal_emit (G_OBJECT (text_layout), + g_signal_emit (text_layout, signals[ALLOCATE_CHILD], 0, shaped_object, @@ -1973,7 +1969,7 @@ gtk_text_layout_free_line_display (GtkTextLayout *layout, if (display != layout->one_display_cache) { if (display->layout) - g_object_unref (G_OBJECT (display->layout)); + g_object_unref (display->layout); if (display->cursors) { diff --git a/gtk/gtktextmark.c b/gtk/gtktextmark.c index b17fc34588..269793654a 100644 --- a/gtk/gtktextmark.c +++ b/gtk/gtktextmark.c @@ -77,8 +77,7 @@ gtk_text_mark_get_type (void) (GInstanceInitFunc) gtk_text_mark_init, }; - object_type = g_type_register_static (G_TYPE_OBJECT, - "GtkTextMark", + object_type = g_type_register_static (G_TYPE_OBJECT, "GtkTextMark", &object_info, 0); } diff --git a/gtk/gtktexttag.c b/gtk/gtktexttag.c index 59653791c3..9e6bdcb024 100644 --- a/gtk/gtktexttag.c +++ b/gtk/gtktexttag.c @@ -51,11 +51,9 @@ #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 #include @@ -171,10 +169,8 @@ gtk_text_tag_get_type (void) (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; @@ -620,7 +616,7 @@ gtk_text_tag_class_init (GtkTextTagClass *klass) 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, @@ -653,9 +649,7 @@ gtk_text_tag_new (const gchar *name) { 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; } @@ -958,10 +952,10 @@ gtk_text_tag_set_property (GObject *object, 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; } @@ -978,10 +972,10 @@ gtk_text_tag_set_property (GObject *object, 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; } @@ -1215,7 +1209,7 @@ gtk_text_tag_set_property (GObject *object, 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; @@ -1225,7 +1219,7 @@ gtk_text_tag_set_property (GObject *object, 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; @@ -1350,7 +1344,7 @@ gtk_text_tag_set_property (GObject *object, */ 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); } @@ -1745,7 +1739,7 @@ gtk_text_tag_event (GtkTextTag *tag, 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, @@ -1900,18 +1894,18 @@ gtk_text_attributes_copy_values (GtkTextAttributes *src, /* 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); @@ -1967,10 +1961,10 @@ gtk_text_attributes_unref (GtkTextAttributes *values) 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); @@ -2054,9 +2048,9 @@ _gtk_text_attributes_fill_from_tags (GtkTextAttributes *dest, 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; @@ -2064,9 +2058,9 @@ _gtk_text_attributes_fill_from_tags (GtkTextAttributes *dest, 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; } diff --git a/gtk/gtktexttag.h b/gtk/gtktexttag.h index f74df6b099..0d73be129e 100644 --- a/gtk/gtktexttag.h +++ b/gtk/gtktexttag.h @@ -1,8 +1,12 @@ #ifndef GTK_TEXT_TAG_H #define GTK_TEXT_TAG_H -#include +#include #include +#include + +/* Not needed, retained for compatibility -Yosh */ +#include #ifdef __cplusplus extern "C" { diff --git a/gtk/gtktexttagtable.c b/gtk/gtktexttagtable.c index 3b1fa1997c..5e685eab48 100644 --- a/gtk/gtktexttagtable.c +++ b/gtk/gtktexttagtable.c @@ -1,7 +1,6 @@ #include "gtktexttagtable.h" #include "gtkmarshalers.h" -#include "gtksignal.h" #include "gtktextbuffer.h" /* just for the lame notify_will_remove_tag hack */ #include @@ -52,10 +51,8 @@ gtk_text_tag_table_get_type (void) (GInstanceInitFunc) gtk_text_tag_table_init }; - our_type = g_type_register_static (G_TYPE_OBJECT, - "GtkTextTagTable", - &our_info, - 0); + our_type = g_type_register_static (G_TYPE_OBJECT, "GtkTextTagTable", + &our_info, 0); } return our_type; @@ -87,23 +84,23 @@ gtk_text_tag_table_class_init (GtkTextTagTableClass *klass) signals[TAG_ADDED] = g_signal_new ("tag_added", - GTK_CLASS_TYPE (object_class), + G_OBJECT_CLASS_TYPE (object_class), G_SIGNAL_RUN_LAST, G_STRUCT_OFFSET (GtkTextTagTableClass, tag_added), NULL, NULL, _gtk_marshal_VOID__OBJECT, - GTK_TYPE_NONE, + G_TYPE_NONE, 1, GTK_TYPE_TEXT_TAG); signals[TAG_REMOVED] = g_signal_new ("tag_removed", - GTK_CLASS_TYPE (object_class), + G_OBJECT_CLASS_TYPE (object_class), G_SIGNAL_RUN_LAST, G_STRUCT_OFFSET (GtkTextTagTableClass, tag_removed), NULL, NULL, _gtk_marshal_VOID__OBJECT, - GTK_TYPE_NONE, + G_TYPE_NONE, 1, GTK_TYPE_TEXT_TAG); } @@ -127,7 +124,7 @@ gtk_text_tag_table_new (void) { GtkTextTagTable *table; - table = GTK_TEXT_TAG_TABLE (g_object_new (gtk_text_tag_table_get_type (), NULL)); + table = g_object_new (GTK_TYPE_TEXT_TAG_TABLE, NULL); return table; } @@ -151,7 +148,7 @@ foreach_unref (GtkTextTag *tag, gpointer data) } tag->table = NULL; - g_object_unref (G_OBJECT (tag)); + g_object_unref (tag); } static void @@ -237,7 +234,7 @@ gtk_text_tag_table_add (GtkTextTagTable *table, return; } - g_object_ref (G_OBJECT (tag)); + g_object_ref (tag); if (tag->name) g_hash_table_insert (table->hash, tag->name, tag); @@ -256,7 +253,7 @@ gtk_text_tag_table_add (GtkTextTagTable *table, g_assert (size > 0); tag->priority = size - 1; - g_signal_emit (G_OBJECT (table), signals[TAG_ADDED], 0, tag); + g_signal_emit (table, signals[TAG_ADDED], 0, tag); } /** @@ -324,9 +321,9 @@ gtk_text_tag_table_remove (GtkTextTagTable *table, table->anon_count -= 1; } - g_signal_emit (G_OBJECT (table), signals[TAG_REMOVED], 0, tag); + g_signal_emit (table, signals[TAG_REMOVED], 0, tag); - g_object_unref (G_OBJECT (tag)); + g_object_unref (tag); } struct ForeachData diff --git a/gtk/gtktextutil.c b/gtk/gtktextutil.c index 85a3c3bfba..62d75505ea 100644 --- a/gtk/gtktextutil.c +++ b/gtk/gtktextutil.c @@ -106,7 +106,7 @@ _gtk_text_util_append_special_char_menuitems (GtkMenuShell *menushe g_object_set_data (G_OBJECT (menuitem), "gtk-unicode-menu-entry", &bidi_menu_entries[i]); - g_signal_connect_data (G_OBJECT (menuitem), "activate", + g_signal_connect_data (menuitem, "activate", G_CALLBACK (activate_cb), info, (GClosureNotify) g_free, 0); diff --git a/gtk/gtktextview.c b/gtk/gtktextview.c index b409b75be3..da8d32b491 100644 --- a/gtk/gtktextview.c +++ b/gtk/gtktextview.c @@ -37,7 +37,6 @@ #include "gtkmenuitem.h" #include "gtkseparatormenuitem.h" #include "gtksettings.h" -#include "gtksignal.h" #include "gtkstock.h" #include "gtktextdisplay.h" #include "gtktextview.h" @@ -46,7 +45,6 @@ #include "gtksizegroup.h" /* FIXME http://bugzilla.gnome.org/show_bug.cgi?id=72258 */ #include "gtktextutil.h" #include "gtkwindow.h" -#include /* How scrolling, validation, exposes, etc. work. * @@ -415,26 +413,28 @@ static GtkTargetEntry target_table[] = { static GtkContainerClass *parent_class = NULL; static guint signals[LAST_SIGNAL] = { 0 }; -GtkType +GType gtk_text_view_get_type (void) { - static GtkType our_type = 0; + static GType our_type = 0; if (our_type == 0) { - static const GtkTypeInfo our_info = + static const GTypeInfo our_info = { - "GtkTextView", - sizeof (GtkTextView), - sizeof (GtkTextViewClass), - (GtkClassInitFunc) gtk_text_view_class_init, - (GtkObjectInitFunc) gtk_text_view_init, - /* reserved_1 */ NULL, - /* reserved_2 */ NULL, - (GtkClassInitFunc) NULL + sizeof (GtkTextViewClass), + NULL, /* base_init */ + NULL, /* base_finalize */ + (GClassInitFunc) gtk_text_view_class_init, + NULL, /* class_finalize */ + NULL, /* class_data */ + sizeof (GtkTextView), + 0, /* n_preallocs */ + (GInstanceInitFunc) gtk_text_view_init, }; - our_type = gtk_type_unique (GTK_TYPE_CONTAINER, &our_info); + our_type = g_type_register_static (GTK_TYPE_CONTAINER, "GtkTextView", + &our_info, 0); } return our_type; @@ -451,16 +451,16 @@ add_move_binding (GtkBindingSet *binding_set, gtk_binding_entry_add_signal (binding_set, keyval, modmask, "move_cursor", 3, - GTK_TYPE_ENUM, step, - GTK_TYPE_INT, count, - GTK_TYPE_BOOL, FALSE); + G_TYPE_ENUM, step, + G_TYPE_INT, count, + G_TYPE_BOOLEAN, FALSE); /* Selection-extending version */ gtk_binding_entry_add_signal (binding_set, keyval, modmask | GDK_SHIFT_MASK, "move_cursor", 3, - GTK_TYPE_ENUM, step, - GTK_TYPE_INT, count, - GTK_TYPE_BOOL, TRUE); + G_TYPE_ENUM, step, + G_TYPE_INT, count, + G_TYPE_BOOLEAN, TRUE); } static void @@ -472,7 +472,7 @@ gtk_text_view_class_init (GtkTextViewClass *klass) GtkContainerClass *container_class = GTK_CONTAINER_CLASS (klass); GtkBindingSet *binding_set; - parent_class = gtk_type_class (GTK_TYPE_CONTAINER); + parent_class = g_type_class_peek_parent (klass); /* Default handlers and virtual methods */ @@ -640,101 +640,125 @@ gtk_text_view_class_init (GtkTextViewClass *klass) */ signals[MOVE_CURSOR] = - gtk_signal_new ("move_cursor", - GTK_RUN_LAST | GTK_RUN_ACTION, - GTK_CLASS_TYPE (object_class), - GTK_SIGNAL_OFFSET (GtkTextViewClass, move_cursor), - _gtk_marshal_VOID__ENUM_INT_BOOLEAN, - GTK_TYPE_NONE, 3, GTK_TYPE_MOVEMENT_STEP, GTK_TYPE_INT, GTK_TYPE_BOOL); + g_signal_new ("move_cursor", + G_OBJECT_CLASS_TYPE (gobject_class), + G_SIGNAL_RUN_LAST | G_SIGNAL_ACTION, + G_STRUCT_OFFSET (GtkTextViewClass, move_cursor), + NULL, NULL, + _gtk_marshal_VOID__ENUM_INT_BOOLEAN, + G_TYPE_NONE, 3, + GTK_TYPE_MOVEMENT_STEP, + G_TYPE_INT, + G_TYPE_BOOLEAN); signals[PAGE_HORIZONTALLY] = - gtk_signal_new ("page_horizontally", - GTK_RUN_LAST | GTK_RUN_ACTION, - GTK_CLASS_TYPE (object_class), - GTK_SIGNAL_OFFSET (GtkTextViewClass, page_horizontally), - _gtk_marshal_VOID__INT_BOOLEAN, - GTK_TYPE_NONE, 2, GTK_TYPE_INT, GTK_TYPE_BOOL); + g_signal_new ("page_horizontally", + G_OBJECT_CLASS_TYPE (gobject_class), + G_SIGNAL_RUN_LAST | G_SIGNAL_ACTION, + G_STRUCT_OFFSET (GtkTextViewClass, page_horizontally), + NULL, NULL, + _gtk_marshal_VOID__INT_BOOLEAN, + G_TYPE_NONE, 2, + G_TYPE_INT, + G_TYPE_BOOLEAN); signals[SET_ANCHOR] = - gtk_signal_new ("set_anchor", - GTK_RUN_LAST | GTK_RUN_ACTION, - GTK_CLASS_TYPE (object_class), - GTK_SIGNAL_OFFSET (GtkTextViewClass, set_anchor), - _gtk_marshal_VOID__VOID, - GTK_TYPE_NONE, 0); + g_signal_new ("set_anchor", + G_OBJECT_CLASS_TYPE (gobject_class), + G_SIGNAL_RUN_LAST | G_SIGNAL_ACTION, + G_STRUCT_OFFSET (GtkTextViewClass, set_anchor), + NULL, NULL, + _gtk_marshal_VOID__VOID, + G_TYPE_NONE, 0); signals[INSERT_AT_CURSOR] = - gtk_signal_new ("insert_at_cursor", - GTK_RUN_LAST | GTK_RUN_ACTION, - GTK_CLASS_TYPE (object_class), - GTK_SIGNAL_OFFSET (GtkTextViewClass, insert_at_cursor), - _gtk_marshal_VOID__STRING, - GTK_TYPE_NONE, 1, GTK_TYPE_STRING); + g_signal_new ("insert_at_cursor", + G_OBJECT_CLASS_TYPE (gobject_class), + G_SIGNAL_RUN_LAST | G_SIGNAL_ACTION, + G_STRUCT_OFFSET (GtkTextViewClass, insert_at_cursor), + NULL, NULL, + _gtk_marshal_VOID__STRING, + G_TYPE_NONE, 1, + G_TYPE_STRING); signals[DELETE_FROM_CURSOR] = - gtk_signal_new ("delete_from_cursor", - GTK_RUN_LAST | GTK_RUN_ACTION, - GTK_CLASS_TYPE (object_class), - GTK_SIGNAL_OFFSET (GtkTextViewClass, delete_from_cursor), - _gtk_marshal_VOID__ENUM_INT, - GTK_TYPE_NONE, 2, GTK_TYPE_DELETE_TYPE, GTK_TYPE_INT); + g_signal_new ("delete_from_cursor", + G_OBJECT_CLASS_TYPE (gobject_class), + G_SIGNAL_RUN_LAST | G_SIGNAL_ACTION, + G_STRUCT_OFFSET (GtkTextViewClass, delete_from_cursor), + NULL, NULL, + _gtk_marshal_VOID__ENUM_INT, + G_TYPE_NONE, 2, + GTK_TYPE_DELETE_TYPE, + G_TYPE_INT); signals[CUT_CLIPBOARD] = - gtk_signal_new ("cut_clipboard", - GTK_RUN_LAST | GTK_RUN_ACTION, - GTK_CLASS_TYPE (object_class), - GTK_SIGNAL_OFFSET (GtkTextViewClass, cut_clipboard), - _gtk_marshal_VOID__VOID, - GTK_TYPE_NONE, 0); + g_signal_new ("cut_clipboard", + G_OBJECT_CLASS_TYPE (gobject_class), + G_SIGNAL_RUN_LAST | G_SIGNAL_ACTION, + G_STRUCT_OFFSET (GtkTextViewClass, cut_clipboard), + NULL, NULL, + _gtk_marshal_VOID__VOID, + G_TYPE_NONE, 0); signals[COPY_CLIPBOARD] = - gtk_signal_new ("copy_clipboard", - GTK_RUN_LAST | GTK_RUN_ACTION, - GTK_CLASS_TYPE (object_class), - GTK_SIGNAL_OFFSET (GtkTextViewClass, copy_clipboard), - _gtk_marshal_VOID__VOID, - GTK_TYPE_NONE, 0); + g_signal_new ("copy_clipboard", + G_OBJECT_CLASS_TYPE (gobject_class), + G_SIGNAL_RUN_LAST | G_SIGNAL_ACTION, + G_STRUCT_OFFSET (GtkTextViewClass, copy_clipboard), + NULL, NULL, + _gtk_marshal_VOID__VOID, + G_TYPE_NONE, 0); signals[PASTE_CLIPBOARD] = - gtk_signal_new ("paste_clipboard", - GTK_RUN_LAST | GTK_RUN_ACTION, - GTK_CLASS_TYPE (object_class), - GTK_SIGNAL_OFFSET (GtkTextViewClass, paste_clipboard), - _gtk_marshal_VOID__VOID, - GTK_TYPE_NONE, 0); + g_signal_new ("paste_clipboard", + G_OBJECT_CLASS_TYPE (gobject_class), + G_SIGNAL_RUN_LAST | G_SIGNAL_ACTION, + G_STRUCT_OFFSET (GtkTextViewClass, paste_clipboard), + NULL, NULL, + _gtk_marshal_VOID__VOID, + G_TYPE_NONE, 0); signals[TOGGLE_OVERWRITE] = - gtk_signal_new ("toggle_overwrite", - GTK_RUN_LAST | GTK_RUN_ACTION, - GTK_CLASS_TYPE (object_class), - GTK_SIGNAL_OFFSET (GtkTextViewClass, toggle_overwrite), - _gtk_marshal_VOID__VOID, - GTK_TYPE_NONE, 0); + g_signal_new ("toggle_overwrite", + G_OBJECT_CLASS_TYPE (gobject_class), + G_SIGNAL_RUN_LAST | G_SIGNAL_ACTION, + G_STRUCT_OFFSET (GtkTextViewClass, toggle_overwrite), + NULL, NULL, + _gtk_marshal_VOID__VOID, + G_TYPE_NONE, 0); signals[MOVE_FOCUS] = - gtk_signal_new ("move_focus", - GTK_RUN_LAST | GTK_RUN_ACTION, - GTK_CLASS_TYPE (object_class), - GTK_SIGNAL_OFFSET (GtkTextViewClass, move_focus), - _gtk_marshal_VOID__ENUM, - GTK_TYPE_NONE, 1, GTK_TYPE_DIRECTION_TYPE); + g_signal_new ("move_focus", + G_OBJECT_CLASS_TYPE (gobject_class), + G_SIGNAL_RUN_LAST | G_SIGNAL_ACTION, + G_STRUCT_OFFSET (GtkTextViewClass, move_focus), + NULL, NULL, + _gtk_marshal_VOID__ENUM, + G_TYPE_NONE, 1, + GTK_TYPE_DIRECTION_TYPE); signals[SET_SCROLL_ADJUSTMENTS] = - gtk_signal_new ("set_scroll_adjustments", - GTK_RUN_LAST, - GTK_CLASS_TYPE (object_class), - GTK_SIGNAL_OFFSET (GtkTextViewClass, set_scroll_adjustments), - _gtk_marshal_VOID__OBJECT_OBJECT, - GTK_TYPE_NONE, 2, GTK_TYPE_ADJUSTMENT, GTK_TYPE_ADJUSTMENT); + g_signal_new ("set_scroll_adjustments", + G_OBJECT_CLASS_TYPE (gobject_class), + G_SIGNAL_RUN_LAST | G_SIGNAL_ACTION, + G_STRUCT_OFFSET (GtkTextViewClass, set_scroll_adjustments), + NULL, NULL, + _gtk_marshal_VOID__OBJECT_OBJECT, + G_TYPE_NONE, 2, + GTK_TYPE_ADJUSTMENT, + GTK_TYPE_ADJUSTMENT); widget_class->set_scroll_adjustments_signal = signals[SET_SCROLL_ADJUSTMENTS]; signals[POPULATE_POPUP] = - gtk_signal_new ("populate_popup", - GTK_RUN_LAST, - GTK_CLASS_TYPE (object_class), - GTK_SIGNAL_OFFSET (GtkTextViewClass, populate_popup), - _gtk_marshal_VOID__OBJECT, - GTK_TYPE_NONE, 1, GTK_TYPE_MENU); + g_signal_new ("populate_popup", + G_OBJECT_CLASS_TYPE (gobject_class), + G_SIGNAL_RUN_LAST, + G_STRUCT_OFFSET (GtkTextViewClass, populate_popup), + NULL, NULL, + _gtk_marshal_VOID__OBJECT, + G_TYPE_NONE, 1, + GTK_TYPE_MENU); /* * Key bindings @@ -830,102 +854,102 @@ gtk_text_view_class_init (GtkTextViewClass *klass) /* Select all */ gtk_binding_entry_add_signal (binding_set, GDK_a, GDK_CONTROL_MASK, - "move_cursor", 3, - GTK_TYPE_MOVEMENT_STEP, GTK_MOVEMENT_BUFFER_ENDS, - GTK_TYPE_INT, -1, - GTK_TYPE_BOOL, FALSE); + "move_cursor", 3, + GTK_TYPE_MOVEMENT_STEP, GTK_MOVEMENT_BUFFER_ENDS, + G_TYPE_INT, -1, + G_TYPE_BOOLEAN, FALSE); gtk_binding_entry_add_signal (binding_set, GDK_a, GDK_CONTROL_MASK, - "move_cursor", 3, - GTK_TYPE_MOVEMENT_STEP, GTK_MOVEMENT_BUFFER_ENDS, - GTK_TYPE_INT, 1, - GTK_TYPE_BOOL, TRUE); + "move_cursor", 3, + GTK_TYPE_MOVEMENT_STEP, GTK_MOVEMENT_BUFFER_ENDS, + G_TYPE_INT, 1, + G_TYPE_BOOLEAN, TRUE); gtk_binding_entry_add_signal (binding_set, GDK_Page_Up, GDK_CONTROL_MASK, - "page_horizontally", 2, - GTK_TYPE_INT, -1, - GTK_TYPE_BOOL, FALSE); + "page_horizontally", 2, + G_TYPE_INT, -1, + G_TYPE_BOOLEAN, FALSE); gtk_binding_entry_add_signal (binding_set, GDK_Page_Up, GDK_CONTROL_MASK | GDK_SHIFT_MASK, - "page_horizontally", 2, - GTK_TYPE_INT, -1, - GTK_TYPE_BOOL, TRUE); + "page_horizontally", 2, + G_TYPE_INT, -1, + G_TYPE_BOOLEAN, TRUE); gtk_binding_entry_add_signal (binding_set, GDK_KP_Page_Up, GDK_CONTROL_MASK, - "page_horizontally", 2, - GTK_TYPE_INT, -1, - GTK_TYPE_BOOL, FALSE); + "page_horizontally", 2, + G_TYPE_INT, -1, + G_TYPE_BOOLEAN, FALSE); gtk_binding_entry_add_signal (binding_set, GDK_KP_Page_Up, GDK_CONTROL_MASK | GDK_SHIFT_MASK, - "page_horizontally", 2, - GTK_TYPE_INT, -1, - GTK_TYPE_BOOL, TRUE); + "page_horizontally", 2, + G_TYPE_INT, -1, + G_TYPE_BOOLEAN, TRUE); gtk_binding_entry_add_signal (binding_set, GDK_Page_Down, GDK_CONTROL_MASK, - "page_horizontally", 2, - GTK_TYPE_INT, 1, - GTK_TYPE_BOOL, FALSE); + "page_horizontally", 2, + G_TYPE_INT, 1, + G_TYPE_BOOLEAN, FALSE); gtk_binding_entry_add_signal (binding_set, GDK_Page_Down, GDK_CONTROL_MASK | GDK_SHIFT_MASK, - "page_horizontally", 2, - GTK_TYPE_INT, 1, - GTK_TYPE_BOOL, TRUE); + "page_horizontally", 2, + G_TYPE_INT, 1, + G_TYPE_BOOLEAN, TRUE); gtk_binding_entry_add_signal (binding_set, GDK_KP_Page_Down, GDK_CONTROL_MASK, - "page_horizontally", 2, - GTK_TYPE_INT, 1, - GTK_TYPE_BOOL, FALSE); + "page_horizontally", 2, + G_TYPE_INT, 1, + G_TYPE_BOOLEAN, FALSE); gtk_binding_entry_add_signal (binding_set, GDK_KP_Page_Down, GDK_CONTROL_MASK | GDK_SHIFT_MASK, - "page_horizontally", 2, - GTK_TYPE_INT, 1, - GTK_TYPE_BOOL, TRUE); + "page_horizontally", 2, + G_TYPE_INT, 1, + G_TYPE_BOOLEAN, TRUE); /* Deleting text */ gtk_binding_entry_add_signal (binding_set, GDK_Delete, 0, - "delete_from_cursor", 2, - GTK_TYPE_ENUM, GTK_DELETE_CHARS, - GTK_TYPE_INT, 1); + "delete_from_cursor", 2, + G_TYPE_ENUM, GTK_DELETE_CHARS, + G_TYPE_INT, 1); gtk_binding_entry_add_signal (binding_set, GDK_KP_Delete, 0, - "delete_from_cursor", 2, - GTK_TYPE_ENUM, GTK_DELETE_CHARS, - GTK_TYPE_INT, 1); + "delete_from_cursor", 2, + G_TYPE_ENUM, GTK_DELETE_CHARS, + G_TYPE_INT, 1); gtk_binding_entry_add_signal (binding_set, GDK_BackSpace, 0, - "delete_from_cursor", 2, - GTK_TYPE_ENUM, GTK_DELETE_CHARS, - GTK_TYPE_INT, -1); + "delete_from_cursor", 2, + G_TYPE_ENUM, GTK_DELETE_CHARS, + G_TYPE_INT, -1); /* Make this do the same as Backspace, to help with mis-typing */ gtk_binding_entry_add_signal (binding_set, GDK_BackSpace, GDK_SHIFT_MASK, - "delete_from_cursor", 2, - GTK_TYPE_ENUM, GTK_DELETE_CHARS, - GTK_TYPE_INT, -1); + "delete_from_cursor", 2, + G_TYPE_ENUM, GTK_DELETE_CHARS, + G_TYPE_INT, -1); gtk_binding_entry_add_signal (binding_set, GDK_Delete, GDK_CONTROL_MASK, - "delete_from_cursor", 2, - GTK_TYPE_ENUM, GTK_DELETE_WORD_ENDS, - GTK_TYPE_INT, 1); + "delete_from_cursor", 2, + G_TYPE_ENUM, GTK_DELETE_WORD_ENDS, + G_TYPE_INT, 1); gtk_binding_entry_add_signal (binding_set, GDK_KP_Delete, GDK_CONTROL_MASK, - "delete_from_cursor", 2, - GTK_TYPE_ENUM, GTK_DELETE_WORD_ENDS, - GTK_TYPE_INT, 1); + "delete_from_cursor", 2, + G_TYPE_ENUM, GTK_DELETE_WORD_ENDS, + G_TYPE_INT, 1); gtk_binding_entry_add_signal (binding_set, GDK_BackSpace, GDK_CONTROL_MASK, - "delete_from_cursor", 2, - GTK_TYPE_ENUM, GTK_DELETE_WORD_ENDS, - GTK_TYPE_INT, -1); + "delete_from_cursor", 2, + G_TYPE_ENUM, GTK_DELETE_WORD_ENDS, + G_TYPE_INT, -1); /* Cut/copy/paste */ gtk_binding_entry_add_signal (binding_set, GDK_x, GDK_CONTROL_MASK, - "cut_clipboard", 0); + "cut_clipboard", 0); gtk_binding_entry_add_signal (binding_set, GDK_c, GDK_CONTROL_MASK, - "copy_clipboard", 0); + "copy_clipboard", 0); gtk_binding_entry_add_signal (binding_set, GDK_v, GDK_CONTROL_MASK, - "paste_clipboard", 0); + "paste_clipboard", 0); gtk_binding_entry_add_signal (binding_set, GDK_Delete, GDK_SHIFT_MASK, "cut_clipboard", 0); @@ -936,24 +960,24 @@ gtk_text_view_class_init (GtkTextViewClass *klass) /* Overwrite */ gtk_binding_entry_add_signal (binding_set, GDK_Insert, 0, - "toggle_overwrite", 0); + "toggle_overwrite", 0); gtk_binding_entry_add_signal (binding_set, GDK_KP_Insert, 0, - "toggle_overwrite", 0); + "toggle_overwrite", 0); /* Control-tab focus motion */ gtk_binding_entry_add_signal (binding_set, GDK_Tab, GDK_CONTROL_MASK, - "move_focus", 1, - GTK_TYPE_DIRECTION_TYPE, GTK_DIR_TAB_FORWARD); + "move_focus", 1, + GTK_TYPE_DIRECTION_TYPE, GTK_DIR_TAB_FORWARD); gtk_binding_entry_add_signal (binding_set, GDK_KP_Tab, GDK_CONTROL_MASK, - "move_focus", 1, - GTK_TYPE_DIRECTION_TYPE, GTK_DIR_TAB_FORWARD); + "move_focus", 1, + GTK_TYPE_DIRECTION_TYPE, GTK_DIR_TAB_FORWARD); gtk_binding_entry_add_signal (binding_set, GDK_Tab, GDK_SHIFT_MASK | GDK_CONTROL_MASK, - "move_focus", 1, - GTK_TYPE_DIRECTION_TYPE, GTK_DIR_TAB_BACKWARD); + "move_focus", 1, + GTK_TYPE_DIRECTION_TYPE, GTK_DIR_TAB_BACKWARD); gtk_binding_entry_add_signal (binding_set, GDK_KP_Tab, GDK_SHIFT_MASK | GDK_CONTROL_MASK, - "move_focus", 1, - GTK_TYPE_DIRECTION_TYPE, GTK_DIR_TAB_BACKWARD); + "move_focus", 1, + GTK_TYPE_DIRECTION_TYPE, GTK_DIR_TAB_BACKWARD); } static void @@ -990,13 +1014,13 @@ gtk_text_view_init (GtkTextView *text_view) */ text_view->im_context = gtk_im_multicontext_new (); - g_signal_connect (G_OBJECT (text_view->im_context), "commit", + g_signal_connect (text_view->im_context, "commit", G_CALLBACK (gtk_text_view_commit_handler), text_view); - g_signal_connect (G_OBJECT (text_view->im_context), "preedit_changed", + g_signal_connect (text_view->im_context, "preedit_changed", G_CALLBACK (gtk_text_view_preedit_changed_handler), text_view); - g_signal_connect (G_OBJECT (text_view->im_context), "retrieve_surrounding", + g_signal_connect (text_view->im_context, "retrieve_surrounding", G_CALLBACK (gtk_text_view_retrieve_surrounding_handler), text_view); - g_signal_connect (G_OBJECT (text_view->im_context), "delete_surrounding", + g_signal_connect (text_view->im_context, "delete_surrounding", G_CALLBACK (gtk_text_view_delete_surrounding_handler), text_view); text_view->cursor_visible = TRUE; @@ -1026,7 +1050,7 @@ gtk_text_view_init (GtkTextView *text_view) GtkWidget* gtk_text_view_new (void) { - return GTK_WIDGET (gtk_type_new (gtk_text_view_get_type ())); + return g_object_new (GTK_TYPE_TEXT_VIEW, NULL); } /** @@ -1099,9 +1123,10 @@ gtk_text_view_set_buffer (GtkTextView *text_view, g_slist_free (copy); - g_signal_handlers_disconnect_by_func (G_OBJECT (text_view->buffer), - (gpointer) gtk_text_view_mark_set_handler, text_view); - g_object_unref (G_OBJECT (text_view->buffer)); + g_signal_handlers_disconnect_by_func (text_view->buffer, + gtk_text_view_mark_set_handler, + text_view); + g_object_unref (text_view->buffer); text_view->dnd_mark = NULL; if (GTK_WIDGET_REALIZED (text_view)) @@ -1118,7 +1143,7 @@ gtk_text_view_set_buffer (GtkTextView *text_view, { GtkTextIter start; - g_object_ref (G_OBJECT (buffer)); + g_object_ref (buffer); if (text_view->layout) gtk_text_layout_set_buffer (text_view->layout, buffer); @@ -1135,7 +1160,7 @@ gtk_text_view_set_buffer (GtkTextView *text_view, text_view->first_para_pixels = 0; - g_signal_connect (G_OBJECT (text_view->buffer), "mark_set", + g_signal_connect (text_view->buffer, "mark_set", G_CALLBACK (gtk_text_view_mark_set_handler), text_view); if (GTK_WIDGET_REALIZED (text_view)) @@ -1161,7 +1186,7 @@ get_buffer (GtkTextView *text_view) GtkTextBuffer *b; b = gtk_text_buffer_new (NULL); gtk_text_view_set_buffer (text_view, b); - g_object_unref (G_OBJECT (b)); + g_object_unref (b); } return text_view->buffer; @@ -1508,7 +1533,7 @@ free_pending_scroll (GtkTextPendingScroll *scroll) if (!gtk_text_mark_get_deleted (scroll->mark)) gtk_text_buffer_delete_mark (gtk_text_mark_get_buffer (scroll->mark), scroll->mark); - g_object_unref (G_OBJECT (scroll->mark)); + g_object_unref (scroll->mark); g_free (scroll); } @@ -1549,7 +1574,7 @@ gtk_text_view_queue_scroll (GtkTextView *text_view, &iter, gtk_text_mark_get_left_gravity (mark)); - g_object_ref (G_OBJECT (scroll->mark)); + g_object_ref (scroll->mark); cancel_pending_scroll (text_view); @@ -1626,13 +1651,13 @@ gtk_text_view_set_adjustment_upper (GtkAdjustment *adj, gdouble upper) value_changed = TRUE; } - gtk_signal_emit_by_name (GTK_OBJECT (adj), "changed"); + gtk_adjustment_changed (adj); DV(g_print(">Changed adj upper to %g ("G_STRLOC")\n", upper)); if (value_changed) { DV(g_print(">Changed adj value because upper decreased ("G_STRLOC")\n")); - gtk_signal_emit_by_name (GTK_OBJECT (adj), "value_changed"); + gtk_adjustment_value_changed (adj); } } } @@ -1672,8 +1697,8 @@ gtk_text_view_update_adjustments (GtkTextView *text_view) text_view->vadjustment->page_increment = SCREEN_HEIGHT (text_view) * 0.9; - gtk_signal_emit_by_name (GTK_OBJECT (get_hadjustment (text_view)), "changed"); - gtk_signal_emit_by_name (GTK_OBJECT (get_hadjustment (text_view)), "changed"); + gtk_adjustment_changed (get_hadjustment (text_view)); + gtk_adjustment_changed (get_vadjustment (text_view)); } } @@ -2443,9 +2468,9 @@ gtk_text_view_finalize (GObject *object) pango_tab_array_free (text_view->tabs); if (text_view->hadjustment) - g_object_unref (G_OBJECT (text_view->hadjustment)); + g_object_unref (text_view->hadjustment); if (text_view->vadjustment) - g_object_unref (G_OBJECT (text_view->vadjustment)); + g_object_unref (text_view->vadjustment); text_window_free (text_view->text_window); @@ -2461,7 +2486,7 @@ gtk_text_view_finalize (GObject *object) if (text_view->bottom_window) text_window_free (text_view->bottom_window); - g_object_unref (G_OBJECT (text_view->im_context)); + g_object_unref (text_view->im_context); (* G_OBJECT_CLASS (parent_class)->finalize) (object); } @@ -2958,7 +2983,7 @@ gtk_text_view_size_allocate (GtkWidget *widget, text_view->hadjustment->lower = 0; text_view->hadjustment->upper = MAX (SCREEN_WIDTH (text_view), text_view->width); - gtk_signal_emit_by_name (GTK_OBJECT (text_view->hadjustment), "changed"); + gtk_adjustment_changed (text_view->hadjustment); text_view->vadjustment->page_size = SCREEN_HEIGHT (text_view); text_view->vadjustment->page_increment = SCREEN_HEIGHT (text_view) * 0.9; @@ -2966,7 +2991,7 @@ gtk_text_view_size_allocate (GtkWidget *widget, text_view->vadjustment->lower = 0; text_view->vadjustment->upper = MAX (SCREEN_HEIGHT (text_view), text_view->height); - gtk_signal_emit_by_name (GTK_OBJECT (text_view->vadjustment), "changed"); + gtk_adjustment_changed (text_view->vadjustment); if (yoffset_changed) gtk_adjustment_value_changed (vadj); @@ -3977,7 +4002,7 @@ gtk_text_view_focus_out_event (GtkWidget *widget, GdkEventFocus *event) } g_signal_handlers_disconnect_by_func (gdk_keymap_get_for_display (gtk_widget_get_display (widget)), - (gpointer) keymap_direction_changed, + keymap_direction_changed, text_view); text_view->need_im_reset = TRUE; @@ -4105,7 +4130,7 @@ gtk_text_view_paint (GtkWidget *widget, child, event); - g_object_unref (G_OBJECT (child)); + g_object_unref (child); tmp_list = tmp_list->next; } @@ -5008,7 +5033,7 @@ gtk_text_view_move_focus (GtkTextView *text_view, return; /* Propagate to toplevel */ - g_signal_emit_by_name (G_OBJECT (toplevel), "move_focus", direction_type); + g_signal_emit_by_name (toplevel, "move_focus", direction_type); } /* @@ -5187,10 +5212,10 @@ gtk_text_view_start_selection_drag (GtkTextView *text_view, gtk_text_buffer_place_cursor (buffer, &newplace); } - text_view->selection_drag_handler = gtk_signal_connect (GTK_OBJECT (text_view), - "motion_notify_event", - GTK_SIGNAL_FUNC (selection_motion_event_handler), - NULL); + text_view->selection_drag_handler = g_signal_connect (text_view, + "motion_notify_event", + G_CALLBACK (selection_motion_event_handler), + NULL); } /* returns whether we were really dragging */ @@ -5200,7 +5225,7 @@ gtk_text_view_end_selection_drag (GtkTextView *text_view, GdkEventButton *event) if (text_view->selection_drag_handler == 0) return FALSE; - gtk_signal_disconnect (GTK_OBJECT (text_view), text_view->selection_drag_handler); + g_signal_handler_disconnect (text_view, text_view->selection_drag_handler); text_view->selection_drag_handler = 0; if (text_view->scroll_timeout != 0) @@ -5281,17 +5306,17 @@ gtk_text_view_ensure_layout (GtkTextView *text_view) text_view->layout = gtk_text_layout_new (); - g_signal_connect (G_OBJECT (text_view->layout), + g_signal_connect (text_view->layout, "invalidated", G_CALLBACK (invalidated_handler), text_view); - g_signal_connect (G_OBJECT (text_view->layout), + g_signal_connect (text_view->layout, "changed", G_CALLBACK (changed_handler), text_view); - g_signal_connect (G_OBJECT (text_view->layout), + g_signal_connect (text_view->layout, "allocate_child", G_CALLBACK (gtk_text_view_child_allocated), text_view); @@ -5311,8 +5336,8 @@ gtk_text_view_ensure_layout (GtkTextView *text_view) gtk_text_layout_set_contexts (text_view->layout, ltr_context, rtl_context); - g_object_unref (G_OBJECT (ltr_context)); - g_object_unref (G_OBJECT (rtl_context)); + g_object_unref (ltr_context); + g_object_unref (rtl_context); gtk_text_view_check_keymap_direction (text_view); @@ -5393,11 +5418,11 @@ gtk_text_view_destroy_layout (GtkTextView *text_view) gtk_text_view_remove_validate_idles (text_view); - g_signal_handlers_disconnect_by_func (G_OBJECT (text_view->layout), - (gpointer) invalidated_handler, + g_signal_handlers_disconnect_by_func (text_view->layout, + invalidated_handler, text_view); - g_signal_handlers_disconnect_by_func (G_OBJECT (text_view->layout), - (gpointer) changed_handler, + g_signal_handlers_disconnect_by_func (text_view->layout, + changed_handler, text_view); /* Remove layout from all anchored children */ @@ -5418,7 +5443,7 @@ gtk_text_view_destroy_layout (GtkTextView *text_view) gtk_text_view_stop_cursor_blink (text_view); gtk_text_view_end_selection_drag (text_view, NULL); - g_object_unref (G_OBJECT (text_view->layout)); + g_object_unref (text_view->layout); text_view->layout = NULL; } } @@ -5828,37 +5853,41 @@ gtk_text_view_set_scroll_adjustments (GtkTextView *text_view, if (text_view->hadjustment && (text_view->hadjustment != hadj)) { - gtk_signal_disconnect_by_data (GTK_OBJECT (text_view->hadjustment), text_view); - g_object_unref (G_OBJECT (text_view->hadjustment)); + g_signal_handlers_disconnect_by_func (text_view->hadjustment, + gtk_text_view_value_changed, + text_view); + g_object_unref (text_view->hadjustment); } if (text_view->vadjustment && (text_view->vadjustment != vadj)) { - gtk_signal_disconnect_by_data (GTK_OBJECT (text_view->vadjustment), text_view); - g_object_unref (G_OBJECT (text_view->vadjustment)); + g_signal_handlers_disconnect_by_func (text_view->vadjustment, + gtk_text_view_value_changed, + text_view); + g_object_unref (text_view->vadjustment); } if (text_view->hadjustment != hadj) { text_view->hadjustment = hadj; - g_object_ref (G_OBJECT (text_view->hadjustment)); + g_object_ref (text_view->hadjustment); gtk_object_sink (GTK_OBJECT (text_view->hadjustment)); - gtk_signal_connect (GTK_OBJECT (text_view->hadjustment), "value_changed", - (GtkSignalFunc) gtk_text_view_value_changed, - text_view); + g_signal_connect (text_view->hadjustment, "value_changed", + G_CALLBACK (gtk_text_view_value_changed), + text_view); need_adjust = TRUE; } if (text_view->vadjustment != vadj) { text_view->vadjustment = vadj; - g_object_ref (G_OBJECT (text_view->vadjustment)); + g_object_ref (text_view->vadjustment); gtk_object_sink (GTK_OBJECT (text_view->vadjustment)); - gtk_signal_connect (GTK_OBJECT (text_view->vadjustment), "value_changed", - (GtkSignalFunc) gtk_text_view_value_changed, - text_view); + g_signal_connect (text_view->vadjustment, "value_changed", + G_CALLBACK (gtk_text_view_value_changed), + text_view); need_adjust = TRUE; } @@ -6263,7 +6292,7 @@ activate_cb (GtkWidget *menuitem, GtkTextView *text_view) { const gchar *signal = g_object_get_data (G_OBJECT (menuitem), "gtk-signal"); - gtk_signal_emit_by_name (GTK_OBJECT (text_view), signal); + g_signal_emit_by_name (text_view, signal); } static void @@ -6276,8 +6305,8 @@ append_action_signal (GtkTextView *text_view, GtkWidget *menuitem = gtk_image_menu_item_new_from_stock (stock_id, NULL); g_object_set_data (G_OBJECT (menuitem), "gtk-signal", (char *)signal); - gtk_signal_connect (GTK_OBJECT (menuitem), "activate", - GTK_SIGNAL_FUNC (activate_cb), text_view); + g_signal_connect (menuitem, "activate", + G_CALLBACK (activate_cb), text_view); gtk_widget_set_sensitive (menuitem, sensitive); @@ -6465,9 +6494,10 @@ popup_targets_received (GtkClipboard *clipboard, unichar_chosen_func, text_view); - gtk_signal_emit (GTK_OBJECT (text_view), - signals[POPULATE_POPUP], - text_view->popup_menu); + g_signal_emit (text_view, + signals[POPULATE_POPUP], + 0, + text_view->popup_menu); if (info->button) gtk_menu_popup (GTK_MENU (text_view->popup_menu), NULL, NULL, @@ -6735,7 +6765,7 @@ text_window_invalidate_rect (GtkTextWindow *win, gdk_draw_rectangle (win->bin_window, gc, TRUE, window_rect.x, window_rect.y, window_rect.width, window_rect.height); - gdk_gc_unref (gc); + g_object_unref (gc); } #endif } @@ -7334,8 +7364,8 @@ text_view_child_new_anchored (GtkWidget *child, vc->from_top_of_line = 0; vc->from_left_of_buffer = 0; - g_object_ref (G_OBJECT (vc->widget)); - g_object_ref (G_OBJECT (vc->anchor)); + g_object_ref (vc->widget); + g_object_ref (vc->anchor); g_object_set_data (G_OBJECT (child), "gtk-text-view-child", @@ -7361,8 +7391,8 @@ text_view_child_new_window (GtkWidget *child, vc->from_top_of_line = 0; vc->from_left_of_buffer = 0; - - g_object_ref (G_OBJECT (vc->widget)); + + g_object_ref (vc->widget); vc->type = type; vc->x = x; @@ -7385,10 +7415,10 @@ text_view_child_free (GtkTextViewChild *child) { gtk_text_child_anchor_unregister_child (child->anchor, child->widget); - g_object_unref (G_OBJECT (child->anchor)); + g_object_unref (child->anchor); } - g_object_unref (G_OBJECT (child->widget)); + g_object_unref (child->widget); g_free (child); } diff --git a/gtk/gtktextview.h b/gtk/gtktextview.h index ad8f6e1802..ad0edb40d0 100644 --- a/gtk/gtktextview.h +++ b/gtk/gtktextview.h @@ -37,11 +37,11 @@ extern "C" { #endif /* __cplusplus */ #define GTK_TYPE_TEXT_VIEW (gtk_text_view_get_type ()) -#define GTK_TEXT_VIEW(obj) (GTK_CHECK_CAST ((obj), GTK_TYPE_TEXT_VIEW, GtkTextView)) -#define GTK_TEXT_VIEW_CLASS(klass) (GTK_CHECK_CLASS_CAST ((klass), GTK_TYPE_TEXT_VIEW, GtkTextViewClass)) -#define GTK_IS_TEXT_VIEW(obj) (GTK_CHECK_TYPE ((obj), GTK_TYPE_TEXT_VIEW)) -#define GTK_IS_TEXT_VIEW_CLASS(klass) (GTK_CHECK_CLASS_TYPE ((klass), GTK_TYPE_TEXT_VIEW)) -#define GTK_TEXT_VIEW_GET_CLASS(obj) (GTK_CHECK_GET_CLASS ((obj), GTK_TYPE_TEXT_VIEW, GtkTextViewClass)) +#define GTK_TEXT_VIEW(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), GTK_TYPE_TEXT_VIEW, GtkTextView)) +#define GTK_TEXT_VIEW_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), GTK_TYPE_TEXT_VIEW, GtkTextViewClass)) +#define GTK_IS_TEXT_VIEW(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), GTK_TYPE_TEXT_VIEW)) +#define GTK_IS_TEXT_VIEW_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), GTK_TYPE_TEXT_VIEW)) +#define GTK_TEXT_VIEW_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), GTK_TYPE_TEXT_VIEW, GtkTextViewClass)) typedef enum { @@ -211,7 +211,7 @@ struct _GtkTextViewClass void (*_gtk_reserved8) (void); }; -GtkType gtk_text_view_get_type (void) G_GNUC_CONST; +GType gtk_text_view_get_type (void) G_GNUC_CONST; GtkWidget * gtk_text_view_new (void); GtkWidget * gtk_text_view_new_with_buffer (GtkTextBuffer *buffer); void gtk_text_view_set_buffer (GtkTextView *text_view,