diff --git a/ChangeLog b/ChangeLog index 528f38aa81..c6e931028c 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,12 @@ +Sun Oct 13 12:29:15 2002 Manish Singh + + * gtk/gtkcolorsel.[ch] gtk/gtkcombo.[ch] gtk/gtkplug.[ch] + gtk/gtksocket.[ch] gtk/gtktreeview.[ch] gtk/gtktreeviewcolumn.[ch]: + Deprecation cleanup + + * gtk/gtkcolorseldialog.c: make window not resizable (lost + accidently in the previous cleanup) + Sun Oct 13 20:20:51 2002 Soeren Sandmann * gtk/gtktooltips.c (gtk_tooltips_force_window): Make tooltip @@ -18,7 +27,7 @@ Sun Oct 13 18:50:14 2002 Soeren Sandmann #94616, Ben Martin; #94772, sbaillie@bigpond.net.au; -Oct 13 17:41:53 2002 Soeren Sandmann +Sun Oct 13 17:41:53 2002 Soeren Sandmann * gtk/gtkwidget.c (gtk_widget_queue_clear_area): Don't invalidate a widget if it or one of its ancestors isn't mapped. diff --git a/ChangeLog.pre-2-10 b/ChangeLog.pre-2-10 index 528f38aa81..c6e931028c 100644 --- a/ChangeLog.pre-2-10 +++ b/ChangeLog.pre-2-10 @@ -1,3 +1,12 @@ +Sun Oct 13 12:29:15 2002 Manish Singh + + * gtk/gtkcolorsel.[ch] gtk/gtkcombo.[ch] gtk/gtkplug.[ch] + gtk/gtksocket.[ch] gtk/gtktreeview.[ch] gtk/gtktreeviewcolumn.[ch]: + Deprecation cleanup + + * gtk/gtkcolorseldialog.c: make window not resizable (lost + accidently in the previous cleanup) + Sun Oct 13 20:20:51 2002 Soeren Sandmann * gtk/gtktooltips.c (gtk_tooltips_force_window): Make tooltip @@ -18,7 +27,7 @@ Sun Oct 13 18:50:14 2002 Soeren Sandmann #94616, Ben Martin; #94772, sbaillie@bigpond.net.au; -Oct 13 17:41:53 2002 Soeren Sandmann +Sun Oct 13 17:41:53 2002 Soeren Sandmann * gtk/gtkwidget.c (gtk_widget_queue_clear_area): Don't invalidate a widget if it or one of its ancestors isn't mapped. diff --git a/ChangeLog.pre-2-2 b/ChangeLog.pre-2-2 index 528f38aa81..c6e931028c 100644 --- a/ChangeLog.pre-2-2 +++ b/ChangeLog.pre-2-2 @@ -1,3 +1,12 @@ +Sun Oct 13 12:29:15 2002 Manish Singh + + * gtk/gtkcolorsel.[ch] gtk/gtkcombo.[ch] gtk/gtkplug.[ch] + gtk/gtksocket.[ch] gtk/gtktreeview.[ch] gtk/gtktreeviewcolumn.[ch]: + Deprecation cleanup + + * gtk/gtkcolorseldialog.c: make window not resizable (lost + accidently in the previous cleanup) + Sun Oct 13 20:20:51 2002 Soeren Sandmann * gtk/gtktooltips.c (gtk_tooltips_force_window): Make tooltip @@ -18,7 +27,7 @@ Sun Oct 13 18:50:14 2002 Soeren Sandmann #94616, Ben Martin; #94772, sbaillie@bigpond.net.au; -Oct 13 17:41:53 2002 Soeren Sandmann +Sun Oct 13 17:41:53 2002 Soeren Sandmann * gtk/gtkwidget.c (gtk_widget_queue_clear_area): Don't invalidate a widget if it or one of its ancestors isn't mapped. diff --git a/ChangeLog.pre-2-4 b/ChangeLog.pre-2-4 index 528f38aa81..c6e931028c 100644 --- a/ChangeLog.pre-2-4 +++ b/ChangeLog.pre-2-4 @@ -1,3 +1,12 @@ +Sun Oct 13 12:29:15 2002 Manish Singh + + * gtk/gtkcolorsel.[ch] gtk/gtkcombo.[ch] gtk/gtkplug.[ch] + gtk/gtksocket.[ch] gtk/gtktreeview.[ch] gtk/gtktreeviewcolumn.[ch]: + Deprecation cleanup + + * gtk/gtkcolorseldialog.c: make window not resizable (lost + accidently in the previous cleanup) + Sun Oct 13 20:20:51 2002 Soeren Sandmann * gtk/gtktooltips.c (gtk_tooltips_force_window): Make tooltip @@ -18,7 +27,7 @@ Sun Oct 13 18:50:14 2002 Soeren Sandmann #94616, Ben Martin; #94772, sbaillie@bigpond.net.au; -Oct 13 17:41:53 2002 Soeren Sandmann +Sun Oct 13 17:41:53 2002 Soeren Sandmann * gtk/gtkwidget.c (gtk_widget_queue_clear_area): Don't invalidate a widget if it or one of its ancestors isn't mapped. diff --git a/ChangeLog.pre-2-6 b/ChangeLog.pre-2-6 index 528f38aa81..c6e931028c 100644 --- a/ChangeLog.pre-2-6 +++ b/ChangeLog.pre-2-6 @@ -1,3 +1,12 @@ +Sun Oct 13 12:29:15 2002 Manish Singh + + * gtk/gtkcolorsel.[ch] gtk/gtkcombo.[ch] gtk/gtkplug.[ch] + gtk/gtksocket.[ch] gtk/gtktreeview.[ch] gtk/gtktreeviewcolumn.[ch]: + Deprecation cleanup + + * gtk/gtkcolorseldialog.c: make window not resizable (lost + accidently in the previous cleanup) + Sun Oct 13 20:20:51 2002 Soeren Sandmann * gtk/gtktooltips.c (gtk_tooltips_force_window): Make tooltip @@ -18,7 +27,7 @@ Sun Oct 13 18:50:14 2002 Soeren Sandmann #94616, Ben Martin; #94772, sbaillie@bigpond.net.au; -Oct 13 17:41:53 2002 Soeren Sandmann +Sun Oct 13 17:41:53 2002 Soeren Sandmann * gtk/gtkwidget.c (gtk_widget_queue_clear_area): Don't invalidate a widget if it or one of its ancestors isn't mapped. diff --git a/ChangeLog.pre-2-8 b/ChangeLog.pre-2-8 index 528f38aa81..c6e931028c 100644 --- a/ChangeLog.pre-2-8 +++ b/ChangeLog.pre-2-8 @@ -1,3 +1,12 @@ +Sun Oct 13 12:29:15 2002 Manish Singh + + * gtk/gtkcolorsel.[ch] gtk/gtkcombo.[ch] gtk/gtkplug.[ch] + gtk/gtksocket.[ch] gtk/gtktreeview.[ch] gtk/gtktreeviewcolumn.[ch]: + Deprecation cleanup + + * gtk/gtkcolorseldialog.c: make window not resizable (lost + accidently in the previous cleanup) + Sun Oct 13 20:20:51 2002 Soeren Sandmann * gtk/gtktooltips.c (gtk_tooltips_force_window): Make tooltip @@ -18,7 +27,7 @@ Sun Oct 13 18:50:14 2002 Soeren Sandmann #94616, Ben Martin; #94772, sbaillie@bigpond.net.au; -Oct 13 17:41:53 2002 Soeren Sandmann +Sun Oct 13 17:41:53 2002 Soeren Sandmann * gtk/gtkwidget.c (gtk_widget_queue_clear_area): Don't invalidate a widget if it or one of its ancestors isn't mapped. diff --git a/gtk/gtkcolorsel.c b/gtk/gtkcolorsel.c index a54d7a165b..fce9576478 100644 --- a/gtk/gtkcolorsel.c +++ b/gtk/gtkcolorsel.c @@ -35,7 +35,6 @@ #include "gtkselection.h" #include "gtkdnd.h" #include "gtkdrawingarea.h" -#include "gtksignal.h" #include "gtkhbox.h" #include "gtkhbbox.h" #include "gtkrc.h" @@ -43,7 +42,7 @@ #include "gtktable.h" #include "gtklabel.h" #include "gtkmarshalers.h" -#include "gtkpixmap.h" +#include "gtkimage.h" #include "gtkspinbutton.h" #include "gtkrange.h" #include "gtkhscale.h" @@ -235,7 +234,7 @@ set_color_icon (GdkDragContext *context, gdk_pixbuf_fill (pixbuf, pixel); gtk_drag_set_icon_pixbuf (context, pixbuf, -2, -2); - gdk_pixbuf_unref (pixbuf); + g_object_unref (pixbuf); } static void @@ -262,7 +261,7 @@ color_sample_drag_end (GtkWidget *widget, GdkDragContext *context, gpointer data) { - gtk_object_set_data (GTK_OBJECT (widget), "gtk-color-selection-drag-window", NULL); + g_object_set_data (G_OBJECT (widget), "gtk-color-selection-drag-window", NULL); } static void @@ -468,10 +467,10 @@ color_sample_setup_dnd (GtkColorSelection *colorsel, GtkWidget *sample) targets, 1, GDK_ACTION_COPY | GDK_ACTION_MOVE); - gtk_signal_connect (GTK_OBJECT (sample), - "drag_begin", - GTK_SIGNAL_FUNC (color_sample_drag_begin), - colorsel); + g_signal_connect (sample, + "drag_begin", + G_CALLBACK (color_sample_drag_begin), + colorsel); if (sample == priv->cur_sample) { @@ -482,20 +481,20 @@ color_sample_setup_dnd (GtkColorSelection *colorsel, GtkWidget *sample) targets, 1, GDK_ACTION_COPY); - gtk_signal_connect (GTK_OBJECT (sample), - "drag_end", - GTK_SIGNAL_FUNC (color_sample_drag_end), - colorsel); + g_signal_connect (sample, + "drag_end", + G_CALLBACK (color_sample_drag_end), + colorsel); } - gtk_signal_connect (GTK_OBJECT (sample), - "drag_data_get", - GTK_SIGNAL_FUNC (color_sample_drag_handle), - colorsel); - gtk_signal_connect (GTK_OBJECT (sample), - "drag_data_received", - GTK_SIGNAL_FUNC (color_sample_drop_handle), - colorsel); + g_signal_connect (sample, + "drag_data_get", + G_CALLBACK (color_sample_drag_handle), + colorsel); + g_signal_connect (sample, + "drag_data_received", + G_CALLBACK (color_sample_drop_handle), + colorsel); } @@ -522,12 +521,12 @@ color_sample_new (GtkColorSelection *colorsel) gtk_box_pack_start (GTK_BOX (priv->sample_area), priv->cur_sample, TRUE, TRUE, 0); - gtk_signal_connect (GTK_OBJECT (priv->old_sample), "expose_event", - GTK_SIGNAL_FUNC (color_old_sample_expose), - colorsel); - gtk_signal_connect (GTK_OBJECT (priv->cur_sample), "expose_event", - GTK_SIGNAL_FUNC (color_cur_sample_expose), - colorsel); + g_signal_connect (priv->old_sample, "expose_event", + G_CALLBACK (color_old_sample_expose), + colorsel); + g_signal_connect (priv->cur_sample, "expose_event", + G_CALLBACK (color_cur_sample_expose), + colorsel); color_sample_setup_dnd (colorsel, priv->old_sample); color_sample_setup_dnd (colorsel, priv->cur_sample); @@ -560,7 +559,7 @@ palette_get_color (GtkWidget *drawing_area, gdouble *color) g_return_if_fail (color != NULL); - color_val = gtk_object_get_data (GTK_OBJECT (drawing_area), "color_val"); + color_val = g_object_get_data (G_OBJECT (drawing_area), "color_val"); if (color_val == NULL) { /* Default to white for no good reason */ @@ -675,7 +674,7 @@ palette_drag_end (GtkWidget *widget, GdkDragContext *context, gpointer data) { - gtk_object_set_data (GTK_OBJECT (widget), "gtk-color-selection-drag-window", NULL); + g_object_set_data (G_OBJECT (widget), "gtk-color-selection-drag-window", NULL); } static GdkColor * @@ -795,7 +794,7 @@ palette_set_color (GtkWidget *drawing_area, gtk_widget_modify_bg (drawing_area, GTK_STATE_NORMAL, &gdk_color); - if (GPOINTER_TO_INT (gtk_object_get_data (GTK_OBJECT (drawing_area), "color_set")) == 0) + if (GPOINTER_TO_INT (g_object_get_data (G_OBJECT (drawing_area), "color_set")) == 0) { static const GtkTargetEntry targets[] = { { "application/x-color", 0 } @@ -805,16 +804,17 @@ palette_set_color (GtkWidget *drawing_area, targets, 1, GDK_ACTION_COPY | GDK_ACTION_MOVE); - gtk_signal_connect (GTK_OBJECT (drawing_area), - "drag_begin", - GTK_SIGNAL_FUNC (palette_drag_begin), - colorsel); - gtk_signal_connect (GTK_OBJECT (drawing_area), - "drag_data_get", - GTK_SIGNAL_FUNC (palette_drag_handle), - colorsel); + g_signal_connect (drawing_area, + "drag_begin", + G_CALLBACK (palette_drag_begin), + colorsel); + g_signal_connect (drawing_area, + "drag_data_get", + G_CALLBACK (palette_drag_handle), + colorsel); - gtk_object_set_data (GTK_OBJECT (drawing_area), "color_set", GINT_TO_POINTER (1)); + g_object_set_data (G_OBJECT (drawing_area), "color_set", + GINT_TO_POINTER (1)); } new_color[0] = color[0]; @@ -902,9 +902,9 @@ do_popup (GtkColorSelection *colorsel, mi = gtk_menu_item_new_with_mnemonic (_("_Save color here")); - gtk_signal_connect (GTK_OBJECT (mi), "activate", - GTK_SIGNAL_FUNC (save_color_selected), - drawing_area); + g_signal_connect (mi, "activate", + G_CALLBACK (save_color_selected), + drawing_area); gtk_menu_shell_append (GTK_MENU_SHELL (menu), mi); @@ -972,7 +972,7 @@ palette_release (GtkWidget *drawing_area, g_object_get_data (G_OBJECT (drawing_area), "gtk-colorsel-have-pointer") != NULL) { - if (GPOINTER_TO_INT (gtk_object_get_data (GTK_OBJECT (drawing_area), "color_set")) != 0) + if (GPOINTER_TO_INT (g_object_get_data (G_OBJECT (drawing_area), "color_set")) != 0) { gdouble color[4]; palette_get_color (drawing_area, color); @@ -986,11 +986,11 @@ palette_release (GtkWidget *drawing_area, static void palette_unset_color (GtkWidget *drawing_area) { - if (GPOINTER_TO_INT (gtk_object_get_data (GTK_OBJECT (drawing_area), "color_set")) == 0) + if (GPOINTER_TO_INT (g_object_get_data (G_OBJECT (drawing_area), "color_set")) == 0) return; gtk_widget_reset_rc_styles (drawing_area); - gtk_object_set_data (GTK_OBJECT (drawing_area), "color_set", GINT_TO_POINTER (0)); + g_object_set_data (G_OBJECT (drawing_area), "color_set", GINT_TO_POINTER (0)); } static void @@ -1037,7 +1037,7 @@ palette_activate (GtkWidget *widget, (event->keyval == GDK_KP_Enter) || (event->keyval == GDK_KP_Space)) { - if (GPOINTER_TO_INT (gtk_object_get_data (GTK_OBJECT (widget), "color_set")) != 0) + if (GPOINTER_TO_INT (g_object_get_data (G_OBJECT (widget), "color_set")) != 0) { gdouble color[4]; palette_get_color (widget, color); @@ -1076,28 +1076,27 @@ palette_new (GtkColorSelection *colorsel) GTK_WIDGET_SET_FLAGS (retval, GTK_CAN_FOCUS); - gtk_object_set_data (GTK_OBJECT (retval), "color_set", GINT_TO_POINTER (0)); + g_object_set_data (G_OBJECT (retval), "color_set", GINT_TO_POINTER (0)); gtk_widget_set_events (retval, GDK_BUTTON_PRESS_MASK | GDK_BUTTON_RELEASE_MASK | GDK_EXPOSURE_MASK | GDK_ENTER_NOTIFY_MASK | GDK_LEAVE_NOTIFY_MASK); - - gtk_signal_connect (GTK_OBJECT (retval), "expose_event", - GTK_SIGNAL_FUNC (palette_expose), colorsel); - gtk_signal_connect (GTK_OBJECT (retval), "button_press_event", - GTK_SIGNAL_FUNC (palette_press), colorsel); - gtk_signal_connect (GTK_OBJECT (retval), "button_release_event", - GTK_SIGNAL_FUNC (palette_release), colorsel); - gtk_signal_connect (GTK_OBJECT (retval), "enter_notify_event", - GTK_SIGNAL_FUNC (palette_enter), colorsel); - gtk_signal_connect (GTK_OBJECT (retval), "leave_notify_event", - GTK_SIGNAL_FUNC (palette_leave), colorsel); - gtk_signal_connect (GTK_OBJECT (retval), "key_press_event", - GTK_SIGNAL_FUNC (palette_activate), colorsel); - gtk_signal_connect (GTK_OBJECT (retval), "popup_menu", - GTK_SIGNAL_FUNC (palette_popup), colorsel); + g_signal_connect (retval, "expose_event", + G_CALLBACK (palette_expose), colorsel); + g_signal_connect (retval, "button_press_event", + G_CALLBACK (palette_press), colorsel); + g_signal_connect (retval, "button_release_event", + G_CALLBACK (palette_release), colorsel); + g_signal_connect (retval, "enter_notify_event", + G_CALLBACK (palette_enter), colorsel); + g_signal_connect (retval, "leave_notify_event", + G_CALLBACK (palette_leave), colorsel); + g_signal_connect (retval, "key_press_event", + G_CALLBACK (palette_activate), colorsel); + g_signal_connect (retval, "popup_menu", + G_CALLBACK (palette_popup), colorsel); gtk_drag_dest_set (retval, GTK_DEST_DEFAULT_HIGHLIGHT | @@ -1106,10 +1105,10 @@ palette_new (GtkColorSelection *colorsel) targets, 1, GDK_ACTION_COPY); - gtk_signal_connect (GTK_OBJECT (retval), "drag_end", - GTK_SIGNAL_FUNC (palette_drag_end), NULL); - gtk_signal_connect (GTK_OBJECT (retval), "drag_data_received", - GTK_SIGNAL_FUNC (palette_drop_handle), colorsel); + g_signal_connect (retval, "drag_end", + G_CALLBACK (palette_drag_end), NULL); + g_signal_connect (retval, "drag_data_received", + G_CALLBACK (palette_drop_handle), colorsel); gtk_tooltips_set_tip (priv->tooltips, retval, @@ -1129,24 +1128,23 @@ static GdkCursor * make_picker_cursor (GdkScreen *screen) { GdkCursor *cursor; - GdkColor fg, bg; + GdkColor bg = { 0, 0xffff, 0xffff, 0xffff }; + GdkColor fg = { 0, 0x0000, 0x0000, 0x0000 }; + GdkWindow *window = gdk_screen_get_root_window (screen); GdkPixmap *pixmap = - gdk_bitmap_create_from_data (gdk_screen_get_root_window (screen), - (gchar *)dropper_bits, DROPPER_WIDTH, DROPPER_HEIGHT); + gdk_bitmap_create_from_data (window, (gchar *) dropper_bits, + DROPPER_WIDTH, DROPPER_HEIGHT); GdkPixmap *mask = - gdk_bitmap_create_from_data (gdk_screen_get_root_window (screen), - (gchar *)dropper_mask, DROPPER_WIDTH, DROPPER_HEIGHT); + gdk_bitmap_create_from_data (window, (gchar *) dropper_mask, + DROPPER_WIDTH, DROPPER_HEIGHT); + cursor = gdk_cursor_new_from_pixmap (pixmap, mask, &fg, &bg, + DROPPER_X_HOT, DROPPER_Y_HOT); - gdk_color_white (gdk_screen_get_system_colormap (screen), &bg); - gdk_color_black (gdk_screen_get_system_colormap (screen), &fg); - - cursor = gdk_cursor_new_from_pixmap (pixmap, mask, &fg, &bg, DROPPER_X_HOT ,DROPPER_Y_HOT); - - gdk_pixmap_unref (pixmap); - gdk_pixmap_unref (mask); + g_object_unref (pixmap); + g_object_unref (mask); return cursor; } @@ -1167,9 +1165,9 @@ grab_color_at_mouse (GdkScreen *screen, priv = colorsel->private_data; - image = gdk_image_get (root_window, x_root, y_root, 1, 1); + image = gdk_drawable_get_image (root_window, x_root, y_root, 1, 1); pixel = gdk_image_get_pixel (image, 0, 0); - gdk_image_unref (image); + g_object_unref (image); gdk_colormap_query_color (colormap, pixel, &color); @@ -1229,10 +1227,12 @@ mouse_release (GtkWidget *invisible, shutdown_eyedropper (GTK_WIDGET (data)); - gtk_signal_disconnect_by_func (GTK_OBJECT (invisible), - GTK_SIGNAL_FUNC (mouse_motion), data); - gtk_signal_disconnect_by_func (GTK_OBJECT (invisible), - GTK_SIGNAL_FUNC (mouse_release), data); + g_signal_handlers_disconnect_by_func (invisible, + mouse_motion, + data); + g_signal_handlers_disconnect_by_func (invisible, + mouse_release, + data); return TRUE; } @@ -1252,12 +1252,12 @@ key_press (GtkWidget *invisible, { shutdown_eyedropper (data); - gtk_signal_disconnect_by_func (GTK_OBJECT (invisible), - GTK_SIGNAL_FUNC (mouse_press), - data); - gtk_signal_disconnect_by_func (GTK_OBJECT (invisible), - GTK_SIGNAL_FUNC (key_press), - data); + g_signal_handlers_disconnect_by_func (invisible, + mouse_press, + data); + g_signal_handlers_disconnect_by_func (invisible, + key_press, + data); return TRUE; } @@ -1277,18 +1277,18 @@ mouse_press (GtkWidget *invisible, if (event->type == GDK_BUTTON_PRESS && event->button == 1) { - gtk_signal_connect (GTK_OBJECT (invisible), "motion_notify_event", - GTK_SIGNAL_FUNC (mouse_motion), - data); - gtk_signal_connect (GTK_OBJECT (invisible), "button_release_event", - GTK_SIGNAL_FUNC (mouse_release), - data); - gtk_signal_disconnect_by_func (GTK_OBJECT (invisible), - GTK_SIGNAL_FUNC (mouse_press), - data); - gtk_signal_disconnect_by_func (GTK_OBJECT (invisible), - GTK_SIGNAL_FUNC (key_press), - data); + g_signal_connect (invisible, "motion_notify_event", + G_CALLBACK (mouse_motion), + data); + g_signal_connect (invisible, "button_release_event", + G_CALLBACK (mouse_release), + data); + g_signal_handlers_disconnect_by_func (invisible, + mouse_press, + data); + g_signal_handlers_disconnect_by_func (invisible, + key_press, + data); return TRUE; } @@ -1299,7 +1299,7 @@ mouse_press (GtkWidget *invisible, static void get_screen_color (GtkWidget *button) { - GtkColorSelection *colorsel = gtk_object_get_data (GTK_OBJECT (button), "COLORSEL"); + GtkColorSelection *colorsel = g_object_get_data (G_OBJECT (button), "COLORSEL"); ColorSelectionPrivate *priv = colorsel->private_data; GdkScreen *screen = gtk_widget_get_screen (GTK_WIDGET (button)); GdkCursor *picker_cursor; @@ -1337,10 +1337,10 @@ get_screen_color (GtkWidget *button) gtk_grab_add (priv->dropper_grab_widget); - gtk_signal_connect (GTK_OBJECT (priv->dropper_grab_widget), "button_press_event", - GTK_SIGNAL_FUNC (mouse_press), colorsel); - gtk_signal_connect (GTK_OBJECT (priv->dropper_grab_widget), "key_press_event", - GTK_SIGNAL_FUNC (key_press), colorsel); + g_signal_connect (priv->dropper_grab_widget, "button_press_event", + G_CALLBACK (mouse_press), colorsel); + g_signal_connect (priv->dropper_grab_widget, "key_press_event", + G_CALLBACK (key_press), colorsel); } static void @@ -1408,7 +1408,7 @@ adjustment_changed (GtkAdjustment *adjustment, GtkColorSelection *colorsel; ColorSelectionPrivate *priv; - colorsel = GTK_COLOR_SELECTION (gtk_object_get_data (GTK_OBJECT (adjustment), "COLORSEL")); + colorsel = GTK_COLOR_SELECTION (g_object_get_data (G_OBJECT (adjustment), "COLORSEL")); priv = colorsel->private_data; if (priv->changing) @@ -1500,21 +1500,20 @@ make_label_spinbutton (GtkColorSelection *colorsel, { adjust = GTK_ADJUSTMENT (gtk_adjustment_new (0.0, 0.0, 255.0, 1.0, 1.0, 1.0)); } - gtk_object_set_data (GTK_OBJECT (adjust), "COLORSEL", colorsel); + g_object_set_data (G_OBJECT (adjust), "COLORSEL", colorsel); *spinbutton = gtk_spin_button_new (adjust, 10.0, 0); gtk_tooltips_set_tip (priv->tooltips, *spinbutton, tooltip, NULL); - gtk_signal_connect (GTK_OBJECT (adjust), "value_changed", - GTK_SIGNAL_FUNC (adjustment_changed), - GINT_TO_POINTER (channel_type)); + g_signal_connect (adjust, "value_changed", + G_CALLBACK (adjustment_changed), + GINT_TO_POINTER (channel_type)); label = gtk_label_new_with_mnemonic (text); gtk_label_set_mnemonic_widget (GTK_LABEL (label), *spinbutton); gtk_misc_set_alignment (GTK_MISC (label), 1.0, 0.5); gtk_table_attach_defaults (GTK_TABLE (table), label, i, i+1, j, j+1); gtk_table_attach_defaults (GTK_TABLE (table), *spinbutton, i+1, i+2, j, j+1); - } static void @@ -1530,7 +1529,7 @@ make_palette_frame (GtkColorSelection *colorsel, frame = gtk_frame_new (NULL); gtk_frame_set_shadow_type (GTK_FRAME (frame), GTK_SHADOW_IN); priv->custom_palette[i][j] = palette_new (colorsel); - gtk_widget_set_usize (priv->custom_palette[i][j], CUSTOM_PALETTE_ENTRY_WIDTH, CUSTOM_PALETTE_ENTRY_HEIGHT); + gtk_widget_set_size_request (priv->custom_palette[i][j], CUSTOM_PALETTE_ENTRY_WIDTH, CUSTOM_PALETTE_ENTRY_HEIGHT); gtk_container_add (GTK_CONTAINER (frame), priv->custom_palette[i][j]); gtk_table_attach_defaults (GTK_TABLE (table), frame, i, i+1, j, j+1); } @@ -1673,26 +1672,29 @@ default_change_palette_func (GdkScreen *screen, g_free (str); } -GtkType +GType gtk_color_selection_get_type (void) { - static GtkType color_selection_type = 0; + static GType color_selection_type = 0; if (!color_selection_type) { - static const GtkTypeInfo color_selection_info = + static const GTypeInfo color_selection_info = { - "GtkColorSelection", - sizeof (GtkColorSelection), sizeof (GtkColorSelectionClass), - (GtkClassInitFunc) gtk_color_selection_class_init, - (GtkObjectInitFunc) gtk_color_selection_init, - /* reserved_1 */ NULL, - /* reserved_2 */ NULL, - (GtkClassInitFunc) NULL, + NULL, /* base_init */ + NULL, /* base_finalize */ + (GClassInitFunc) gtk_color_selection_class_init, + NULL, /* class_finalize */ + NULL, /* class_data */ + sizeof (GtkColorSelection), + 0, /* n_preallocs */ + (GInstanceInitFunc) gtk_color_selection_init, }; - color_selection_type = gtk_type_unique (GTK_TYPE_VBOX, &color_selection_info); + color_selection_type = + g_type_register_static (GTK_TYPE_VBOX, "GtkColorSelection", + &color_selection_info, 0); } return color_selection_type; @@ -1701,15 +1703,15 @@ gtk_color_selection_get_type (void) static void gtk_color_selection_class_init (GtkColorSelectionClass *klass) { - GtkObjectClass *object_class; GObjectClass *gobject_class; + GtkObjectClass *object_class; GtkWidgetClass *widget_class; - object_class = GTK_OBJECT_CLASS (klass); gobject_class = G_OBJECT_CLASS (klass); + object_class = GTK_OBJECT_CLASS (klass); widget_class = GTK_WIDGET_CLASS (klass); - parent_class = gtk_type_class (GTK_TYPE_VBOX); + parent_class = g_type_class_peek_parent (klass); object_class->destroy = gtk_color_selection_destroy; gobject_class->finalize = gtk_color_selection_finalize; @@ -1751,12 +1753,13 @@ gtk_color_selection_class_init (GtkColorSelectionClass *klass) G_PARAM_READABLE | G_PARAM_WRITABLE)); color_selection_signals[COLOR_CHANGED] = - gtk_signal_new ("color_changed", - GTK_RUN_FIRST, - GTK_CLASS_TYPE (object_class), - GTK_SIGNAL_OFFSET (GtkColorSelectionClass, color_changed), - _gtk_marshal_VOID__VOID, - GTK_TYPE_NONE, 0); + g_signal_new ("color_changed", + G_OBJECT_CLASS_TYPE (object_class), + G_SIGNAL_RUN_FIRST, + G_STRUCT_OFFSET (GtkColorSelectionClass, color_changed), + NULL, NULL, + _gtk_marshal_VOID__VOID, + G_TYPE_NONE, 0); gtk_settings_install_property (g_param_spec_string ("gtk-color-palette", _("Custom palette"), @@ -1795,8 +1798,8 @@ gtk_color_selection_init (GtkColorSelection *colorsel) vbox = gtk_vbox_new (FALSE, 4); priv->triangle_colorsel = gtk_hsv_new (); - gtk_signal_connect (GTK_OBJECT (priv->triangle_colorsel), "changed", - GTK_SIGNAL_FUNC (hsv_changed), colorsel); + g_signal_connect (priv->triangle_colorsel, "changed", + G_CALLBACK (hsv_changed), colorsel); gtk_hsv_set_metrics (GTK_HSV (priv->triangle_colorsel), 174, 15); gtk_box_pack_start (GTK_BOX (top_hbox), vbox, FALSE, FALSE, 0); gtk_box_pack_start (GTK_BOX (vbox), priv->triangle_colorsel, FALSE, FALSE, 0); @@ -1807,7 +1810,7 @@ gtk_color_selection_init (GtkColorSelection *colorsel) gtk_box_pack_end (GTK_BOX (vbox), hbox, FALSE, FALSE, 0); frame = gtk_frame_new (NULL); - gtk_widget_set_usize (frame, -1, 30); + gtk_widget_set_size_request (frame, -1, 30); gtk_frame_set_shadow_type (GTK_FRAME (frame), GTK_SHADOW_IN); color_sample_new (colorsel); gtk_container_add (GTK_CONTAINER (frame), priv->sample_area); @@ -1816,9 +1819,9 @@ gtk_color_selection_init (GtkColorSelection *colorsel) button = gtk_button_new (); gtk_widget_set_events (button, GDK_POINTER_MOTION_MASK | GDK_POINTER_MOTION_HINT_MASK); - gtk_object_set_data (GTK_OBJECT (button), "COLORSEL", colorsel); - gtk_signal_connect (GTK_OBJECT (button), "clicked", - GTK_SIGNAL_FUNC (get_screen_color), NULL); + g_object_set_data (G_OBJECT (button), "COLORSEL", colorsel); + g_signal_connect (button, "clicked", + G_CALLBACK (get_screen_color), NULL); picker_image = gtk_image_new_from_stock (GTK_STOCK_COLOR_PICKER, GTK_ICON_SIZE_BUTTON); gtk_container_add (GTK_CONTAINER (button), picker_image); gtk_widget_show (GTK_WIDGET (picker_image)); @@ -1853,7 +1856,7 @@ gtk_color_selection_init (GtkColorSelection *colorsel) gtk_misc_set_alignment (GTK_MISC (priv->opacity_label), 1.0, 0.5); gtk_table_attach_defaults (GTK_TABLE (table), priv->opacity_label, 0, 1, 4, 5); adjust = GTK_ADJUSTMENT (gtk_adjustment_new (0.0, 0.0, 255.0, 1.0, 1.0, 0.0)); - gtk_object_set_data (GTK_OBJECT (adjust), "COLORSEL", colorsel); + g_object_set_data (G_OBJECT (adjust), "COLORSEL", colorsel); priv->opacity_slider = gtk_hscale_new (adjust); gtk_tooltips_set_tip (priv->tooltips, priv->opacity_slider, @@ -1861,15 +1864,15 @@ gtk_color_selection_init (GtkColorSelection *colorsel) gtk_label_set_mnemonic_widget (GTK_LABEL (priv->opacity_label), priv->opacity_slider); gtk_scale_set_draw_value (GTK_SCALE (priv->opacity_slider), FALSE); - gtk_signal_connect (GTK_OBJECT (adjust), "value_changed", - GTK_SIGNAL_FUNC (adjustment_changed), - GINT_TO_POINTER (COLORSEL_OPACITY)); + g_signal_connect (adjust, "value_changed", + G_CALLBACK (adjustment_changed), + GINT_TO_POINTER (COLORSEL_OPACITY)); gtk_table_attach_defaults (GTK_TABLE (table), priv->opacity_slider, 1, 7, 4, 5); priv->opacity_entry = gtk_entry_new (); - gtk_widget_set_usize (priv->opacity_entry, 40, 0); + gtk_widget_set_size_request (priv->opacity_entry, 40, -1); - gtk_signal_connect (GTK_OBJECT (priv->opacity_entry), "activate", - GTK_SIGNAL_FUNC (opacity_entry_changed), colorsel); + g_signal_connect (priv->opacity_entry, "activate", + G_CALLBACK (opacity_entry_changed), colorsel); gtk_table_attach_defaults (GTK_TABLE (table), priv->opacity_entry, 7, 8, 4, 5); label = gtk_label_new_with_mnemonic (_("Color _Name:")); @@ -1879,14 +1882,14 @@ gtk_color_selection_init (GtkColorSelection *colorsel) gtk_label_set_mnemonic_widget (GTK_LABEL (label), priv->hex_entry); - gtk_signal_connect (GTK_OBJECT (priv->hex_entry), "activate", - GTK_SIGNAL_FUNC (hex_changed), colorsel); + g_signal_connect (priv->hex_entry, "activate", + G_CALLBACK (hex_changed), colorsel); gtk_tooltips_set_tip (priv->tooltips, priv->hex_entry, _("You can enter an HTML-style hexadecimal color value, or simply a color name such as 'orange' in this entry."), NULL); - gtk_widget_set_usize (priv->hex_entry, 75, -1); + gtk_widget_set_size_request (priv->hex_entry, 75, -1); gtk_table_set_col_spacing (GTK_TABLE (table), 3, 15); gtk_table_attach_defaults (GTK_TABLE (table), priv->hex_entry, 1, 5, 5, 6); @@ -2026,7 +2029,7 @@ gtk_color_selection_new (void) color[2] = 1.0; color[3] = 1.0; - colorsel = gtk_type_new (GTK_TYPE_COLOR_SELECTION); + colorsel = g_object_new (GTK_TYPE_COLOR_SELECTION, NULL); priv = colorsel->private_data; gtk_color_selection_set_color (colorsel, color); gtk_color_selection_set_has_opacity_control (colorsel, TRUE); @@ -2489,7 +2492,7 @@ gtk_color_selection_get_palette_color (GtkColorSelection *colorsel, x = index % GTK_CUSTOM_PALETTE_WIDTH; y = index / GTK_CUSTOM_PALETTE_WIDTH; - if (GPOINTER_TO_INT (gtk_object_get_data (GTK_OBJECT (priv->custom_palette[x][y]), "color_set")) == 0) + if (GPOINTER_TO_INT (g_object_get_data (G_OBJECT (priv->custom_palette[x][y]), "color_set")) == 0) return FALSE; palette_get_color (priv->custom_palette[x][y], col); diff --git a/gtk/gtkcolorsel.h b/gtk/gtkcolorsel.h index 499fb748e6..ace6aa33b3 100644 --- a/gtk/gtkcolorsel.h +++ b/gtk/gtkcolorsel.h @@ -36,11 +36,11 @@ extern "C" { #define GTK_TYPE_COLOR_SELECTION (gtk_color_selection_get_type ()) -#define GTK_COLOR_SELECTION(obj) (GTK_CHECK_CAST ((obj), GTK_TYPE_COLOR_SELECTION, GtkColorSelection)) -#define GTK_COLOR_SELECTION_CLASS(klass) (GTK_CHECK_CLASS_CAST ((klass), GTK_TYPE_COLOR_SELECTION, GtkColorSelectionClass)) -#define GTK_IS_COLOR_SELECTION(obj) (GTK_CHECK_TYPE ((obj), GTK_TYPE_COLOR_SELECTION)) -#define GTK_IS_COLOR_SELECTION_CLASS(klass) (GTK_CHECK_CLASS_TYPE ((klass), GTK_TYPE_COLOR_SELECTION)) -#define GTK_COLOR_SELECTION_GET_CLASS(obj) (GTK_CHECK_GET_CLASS ((obj), GTK_TYPE_COLOR_SELECTION, GtkColorSelectionClass)) +#define GTK_COLOR_SELECTION(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), GTK_TYPE_COLOR_SELECTION, GtkColorSelection)) +#define GTK_COLOR_SELECTION_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), GTK_TYPE_COLOR_SELECTION, GtkColorSelectionClass)) +#define GTK_IS_COLOR_SELECTION(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), GTK_TYPE_COLOR_SELECTION)) +#define GTK_IS_COLOR_SELECTION_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), GTK_TYPE_COLOR_SELECTION)) +#define GTK_COLOR_SELECTION_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), GTK_TYPE_COLOR_SELECTION, GtkColorSelectionClass)) typedef struct _GtkColorSelection GtkColorSelection; @@ -77,7 +77,7 @@ struct _GtkColorSelectionClass /* ColorSelection */ -GtkType gtk_color_selection_get_type (void) G_GNUC_CONST; +GType gtk_color_selection_get_type (void) G_GNUC_CONST; GtkWidget *gtk_color_selection_new (void); gboolean gtk_color_selection_get_has_opacity_control (GtkColorSelection *colorsel); void gtk_color_selection_set_has_opacity_control (GtkColorSelection *colorsel, diff --git a/gtk/gtkcolorseldialog.c b/gtk/gtkcolorseldialog.c index 3d16c0a029..d93c967ca9 100644 --- a/gtk/gtkcolorseldialog.c +++ b/gtk/gtkcolorseldialog.c @@ -119,6 +119,7 @@ gtk_color_selection_dialog_new (const gchar *title) colorseldiag = g_object_new (GTK_TYPE_COLOR_SELECTION_DIALOG, NULL); gtk_window_set_title (GTK_WINDOW (colorseldiag), title); + gtk_window_set_resizable (GTK_WINDOW (colorseldiag), FALSE); return GTK_WIDGET (colorseldiag); } diff --git a/gtk/gtkcombo.c b/gtk/gtkcombo.c index a1676bb040..06d354b6ca 100644 --- a/gtk/gtkcombo.c +++ b/gtk/gtkcombo.c @@ -39,7 +39,6 @@ #include "gtklistitem.h" #include "gtkscrolledwindow.h" #include "gtkmain.h" -#include "gtksignal.h" #include "gtkwindow.h" #include "gdk/gdkkeysyms.h" #include "gtkcombo.h" @@ -107,7 +106,6 @@ static gint gtk_combo_entry_key_press (GtkEntry *widget, static gint gtk_combo_window_key_press (GtkWidget *window, GdkEventKey *event, GtkCombo *combo); -static void gtk_combo_item_destroy (GtkObject *object); static void gtk_combo_size_allocate (GtkWidget *widget, GtkAllocation *allocation); static void gtk_combo_set_property (GObject *object, @@ -128,10 +126,11 @@ gtk_combo_class_init (GtkComboClass * klass) GtkWidgetClass *widget_class; gobject_class = (GObjectClass *) klass; - parent_class = gtk_type_class (GTK_TYPE_HBOX); oclass = (GtkObjectClass *) klass; widget_class = (GtkWidgetClass *) klass; + parent_class = g_type_class_peek_parent (klass); + gobject_class->set_property = gtk_combo_set_property; gobject_class->get_property = gtk_combo_get_property; @@ -189,7 +188,7 @@ gtk_combo_destroy (GtkObject *object) if (combo->popwin) { gtk_widget_destroy (combo->popwin); - gtk_widget_unref (combo->popwin); + g_object_unref (combo->popwin); combo->popwin = NULL; } @@ -207,39 +206,39 @@ gtk_combo_entry_key_press (GtkEntry * entry, GdkEventKey * event, GtkCombo * com (event->state & GDK_MOD1_MASK)) { GtkEditable *editable = GTK_EDITABLE (entry); - GCompletion * cmpl; - gchar* prefix; - gchar* nprefix = NULL; - gint pos; + GCompletion * cmpl; + gchar* prefix; + gchar* nprefix = NULL; + gint pos; - if ( !GTK_LIST (combo->list)->children ) - return FALSE; + if ( !GTK_LIST (combo->list)->children ) + return FALSE; - gtk_signal_emit_stop_by_name (GTK_OBJECT (entry), "key_press_event"); + g_signal_stop_emission_by_name (entry, "key_press_event"); - cmpl = g_completion_new ((GCompletionFunc)gtk_combo_func); - g_completion_add_items (cmpl, GTK_LIST (combo->list)->children); + cmpl = g_completion_new ((GCompletionFunc)gtk_combo_func); + g_completion_add_items (cmpl, GTK_LIST (combo->list)->children); - pos = gtk_editable_get_position (editable); - prefix = gtk_editable_get_chars (editable, 0, pos); + pos = gtk_editable_get_position (editable); + prefix = gtk_editable_get_chars (editable, 0, pos); - g_completion_complete (cmpl, prefix, &nprefix); + g_completion_complete (cmpl, prefix, &nprefix); - if (nprefix && strlen (nprefix) > strlen (prefix)) - { - gtk_editable_insert_text (editable, nprefix + pos, - strlen (nprefix) - strlen (prefix), &pos); - gtk_editable_set_position (editable, pos); + if (nprefix && strlen (nprefix) > strlen (prefix)) + { + gtk_editable_insert_text (editable, nprefix + pos, + strlen (nprefix) - strlen (prefix), &pos); + gtk_editable_set_position (editable, pos); + } + + if (nprefix) + g_free (nprefix); + g_free (prefix); + g_completion_free (cmpl); + + return TRUE; } - if (nprefix) - g_free (nprefix); - g_free (prefix); - g_completion_free (cmpl); - - return TRUE; - } - if (!combo->use_arrows || !GTK_LIST (combo->list)->children) return FALSE; @@ -258,7 +257,7 @@ gtk_combo_entry_key_press (GtkEntry * entry, GdkEventKey * event, GtkCombo * com if (li) { gtk_list_select_child (GTK_LIST (combo->list), GTK_WIDGET (li->data)); - gtk_signal_emit_stop_by_name (GTK_OBJECT (entry), "key_press_event"); + g_signal_stop_emission_by_name (entry, "key_press_event"); return TRUE; } } @@ -275,7 +274,7 @@ gtk_combo_entry_key_press (GtkEntry * entry, GdkEventKey * event, GtkCombo * com if (li) { gtk_list_select_child (GTK_LIST (combo->list), GTK_WIDGET (li->data)); - gtk_signal_emit_stop_by_name (GTK_OBJECT (entry), "key_press_event"); + g_signal_stop_emission_by_name (entry, "key_press_event"); return TRUE; } } @@ -301,7 +300,7 @@ gtk_combo_window_key_press (GtkWidget *window, } } - gtk_signal_emit_stop_by_name (GTK_OBJECT (window), "key_press_event"); + g_signal_stop_emission_by_name (window, "key_press_event"); return TRUE; } @@ -354,13 +353,13 @@ gtk_combo_func (GtkListItem * li) GtkWidget *label; gchar *ltext = NULL; - ltext = (gchar *) gtk_object_get_data (GTK_OBJECT (li), gtk_combo_string_key); + ltext = g_object_get_data (G_OBJECT (li), gtk_combo_string_key); if (!ltext) { label = GTK_BIN (li)->child; if (!label || !GTK_IS_LABEL (label)) return NULL; - gtk_label_get (GTK_LABEL (label), <ext); + ltext = (gchar *) gtk_label_get_text (GTK_LABEL (label)); } return ltext; } @@ -395,7 +394,7 @@ gtk_combo_entry_focus_out (GtkEntry * entry, GdkEventFocus * event, GtkCombo * c /* this is needed because if we call gtk_widget_grab_focus() it isn't guaranteed it's the *last* call before the main-loop, so the focus can be lost anyway... - the signal_emit_stop doesn't seem to work either... + the signal_stop_emission doesn't seem to work either... */ focus_idle = g_idle_source_new (); g_source_set_closure (focus_idle, @@ -403,7 +402,7 @@ gtk_combo_entry_focus_out (GtkEntry * entry, GdkEventFocus * event, GtkCombo * c G_OBJECT (combo))); g_source_attach (focus_idle, NULL); - /*gtk_signal_emit_stop_by_name (GTK_OBJECT (entry), "focus_out_event"); */ + /*g_signal_stop_emission_by_name (entry, "focus_out_event"); */ return TRUE; } return FALSE; @@ -520,7 +519,7 @@ gtk_combo_popup_list (GtkCombo * combo) } gtk_window_move (GTK_WINDOW (combo->popwin), x, y); - gtk_widget_set_usize (combo->popwin, width, height); + gtk_widget_set_size_request (combo->popwin, width, height); gtk_widget_show (combo->popwin); gtk_widget_grab_focus (combo->popwin); @@ -610,7 +609,7 @@ gtk_combo_update_entry (GtkList * list, GtkCombo * combo) char *text; gtk_grab_remove (GTK_WIDGET (combo)); - gtk_signal_handler_block (GTK_OBJECT (list), combo->list_change_id); + g_signal_handler_block (list, combo->list_change_id); if (list->selection) { text = gtk_combo_func (GTK_LIST_ITEM (list->selection->data)); @@ -618,7 +617,7 @@ gtk_combo_update_entry (GtkList * list, GtkCombo * combo) text = ""; gtk_entry_set_text (GTK_ENTRY (combo->entry), text); } - gtk_signal_handler_unblock (GTK_OBJECT (list), combo->list_change_id); + g_signal_handler_unblock (list, combo->list_change_id); } static void @@ -630,13 +629,13 @@ gtk_combo_update_list (GtkEntry * entry, GtkCombo * combo) gtk_grab_remove (GTK_WIDGET (combo)); - gtk_signal_handler_block (GTK_OBJECT (entry), combo->entry_change_id); + g_signal_handler_block (entry, combo->entry_change_id); if (slist && slist->data) gtk_list_unselect_child (list, GTK_WIDGET (slist->data)); li = gtk_combo_find (combo); if (li) gtk_list_select_child (list, GTK_WIDGET (li)); - gtk_signal_handler_unblock (GTK_OBJECT (entry), combo->entry_change_id); + g_signal_handler_unblock (entry, combo->entry_change_id); } static gint @@ -768,7 +767,7 @@ combo_event_box_realize (GtkWidget *widget) GdkCursor *cursor = gdk_cursor_new_for_display (gtk_widget_get_display (widget), GDK_TOP_LEFT_ARROW); gdk_window_set_cursor (widget->window, cursor); - gdk_cursor_destroy (cursor); + gdk_cursor_unref (cursor); } static void @@ -794,25 +793,27 @@ gtk_combo_init (GtkCombo * combo) GTK_WIDGET_UNSET_FLAGS (combo->button, GTK_CAN_FOCUS); gtk_widget_show (combo->entry); gtk_widget_show (combo->button); - combo->entry_change_id = gtk_signal_connect (GTK_OBJECT (combo->entry), "changed", - (GtkSignalFunc) gtk_combo_update_list, combo); - gtk_signal_connect (GTK_OBJECT (combo->entry), "key_press_event", - (GtkSignalFunc) gtk_combo_entry_key_press, combo); - gtk_signal_connect_after (GTK_OBJECT (combo->entry), "focus_out_event", - (GtkSignalFunc) gtk_combo_entry_focus_out, combo); - combo->activate_id = gtk_signal_connect (GTK_OBJECT (combo->entry), "activate", - (GtkSignalFunc) gtk_combo_activate, combo); - gtk_signal_connect (GTK_OBJECT (combo->button), "button_press_event", - (GtkSignalFunc) gtk_combo_popup_button_press, combo); - gtk_signal_connect (GTK_OBJECT (combo->button), "leave_notify_event", - (GtkSignalFunc) gtk_combo_popup_button_leave, combo); + combo->entry_change_id = g_signal_connect (combo->entry, "changed", + G_CALLBACK (gtk_combo_update_list), + combo); + g_signal_connect (combo->entry, "key_press_event", + G_CALLBACK (gtk_combo_entry_key_press), combo); + g_signal_connect_after (combo->entry, "focus_out_event", + G_CALLBACK (gtk_combo_entry_focus_out), combo); + combo->activate_id = g_signal_connect (combo->entry, "activate", + G_CALLBACK (gtk_combo_activate), + combo); + g_signal_connect (combo->button, "button_press_event", + G_CALLBACK (gtk_combo_popup_button_press), combo); + g_signal_connect (combo->button, "leave_notify_event", + G_CALLBACK (gtk_combo_popup_button_leave), combo); combo->popwin = gtk_window_new (GTK_WINDOW_POPUP); - gtk_widget_ref (combo->popwin); + g_object_ref (combo->popwin); gtk_window_set_resizable (GTK_WINDOW (combo->popwin), FALSE); - gtk_signal_connect (GTK_OBJECT (combo->popwin), "key_press_event", - GTK_SIGNAL_FUNC (gtk_combo_window_key_press), combo); + g_signal_connect (combo->popwin, "key_press_event", + G_CALLBACK (gtk_combo_window_key_press), combo); gtk_widget_set_events (combo->popwin, GDK_KEY_PRESS_MASK); @@ -850,21 +851,24 @@ gtk_combo_init (GtkCombo * combo) gtk_scrolled_window_get_hadjustment (GTK_SCROLLED_WINDOW (combo->popup))); gtk_widget_show (combo->list); - combo->list_change_id = gtk_signal_connect (GTK_OBJECT (combo->list), "selection_changed", - (GtkSignalFunc) gtk_combo_update_entry, combo); - gtk_signal_connect (GTK_OBJECT (combo->popwin), "key_press_event", - (GtkSignalFunc) gtk_combo_list_key_press, combo); - gtk_signal_connect (GTK_OBJECT (combo->popwin), "button_press_event", - GTK_SIGNAL_FUNC (gtk_combo_button_press), combo); + combo->list_change_id = g_signal_connect (combo->list, + "selection_changed", + G_CALLBACK (gtk_combo_update_entry), + combo); + g_signal_connect (combo->popwin, "key_press_event", + G_CALLBACK (gtk_combo_list_key_press), combo); + g_signal_connect (combo->popwin, "button_press_event", + G_CALLBACK (gtk_combo_button_press), combo); + + g_signal_connect (combo->list, "event_after", + G_CALLBACK (gtk_combo_button_event_after), combo); - gtk_signal_connect (GTK_OBJECT (combo->list), "event_after", - (GtkSignalFunc) gtk_combo_button_event_after, combo); /* We connect here on the button, because we'll have a grab on it * when the event occurs. But we are actually interested in enters * for the combo->list. */ - gtk_signal_connect (GTK_OBJECT (combo->button), "enter_notify_event", - GTK_SIGNAL_FUNC (gtk_combo_list_enter), combo); + g_signal_connect (combo->button, "enter_notify_event", + G_CALLBACK (gtk_combo_list_enter), combo); } static void @@ -889,33 +893,37 @@ gtk_combo_unrealize (GtkWidget *widget) GTK_WIDGET_CLASS (parent_class)->unrealize (widget); } -GtkType +GType gtk_combo_get_type (void) { - static GtkType combo_type = 0; + static GType combo_type = 0; if (!combo_type) { - static const GtkTypeInfo combo_info = + static const GTypeInfo combo_info = { - "GtkCombo", - sizeof (GtkCombo), sizeof (GtkComboClass), - (GtkClassInitFunc) gtk_combo_class_init, - (GtkObjectInitFunc) gtk_combo_init, - /* reserved_1 */ NULL, - /* reserved_2 */ NULL, - (GtkClassInitFunc) NULL, + NULL, /* base_init */ + NULL, /* base_finalize */ + (GClassInitFunc) gtk_combo_class_init, + NULL, /* class_finalize */ + NULL, /* class_data */ + sizeof (GtkCombo), + 0, /* n_preallocs */ + (GInstanceInitFunc) gtk_combo_init, }; - combo_type = gtk_type_unique (GTK_TYPE_HBOX, &combo_info); + + combo_type = g_type_register_static (GTK_TYPE_HBOX, "GtkCombo", + &combo_info, 0); } + return combo_type; } GtkWidget* gtk_combo_new (void) { - return GTK_WIDGET (gtk_type_new (GTK_TYPE_COMBO)); + return g_object_new (GTK_TYPE_COMBO, NULL); } void @@ -1008,48 +1016,14 @@ gtk_combo_set_popdown_strings (GtkCombo * combo, GList * strings) } } -static void -gtk_combo_item_destroy (GtkObject * object) -{ - gchar *key; - - key = gtk_object_get_data (object, gtk_combo_string_key); - if (key) - { - gtk_object_remove_data (object, gtk_combo_string_key); - g_free (key); - } -} - void gtk_combo_set_item_string (GtkCombo * combo, GtkItem * item, const gchar * item_value) { - gchar *val; - gint connected = 0; - g_return_if_fail (GTK_IS_COMBO (combo)); g_return_if_fail (item != NULL); - val = gtk_object_get_data (GTK_OBJECT (item), gtk_combo_string_key); - if (val) - { - g_free (val); - connected = 1; - } - if (item_value) - { - val = g_strdup (item_value); - gtk_object_set_data (GTK_OBJECT (item), gtk_combo_string_key, val); - if (!connected) - gtk_signal_connect (GTK_OBJECT (item), "destroy", - (GtkSignalFunc) gtk_combo_item_destroy, val); - } - else - { - gtk_object_set_data (GTK_OBJECT (item), gtk_combo_string_key, NULL); - if (connected) - gtk_signal_disconnect_by_data(GTK_OBJECT (item), val); - } + g_object_set_data_full (G_OBJECT (item), gtk_combo_string_key, + g_strdup (item_value), g_free); } static void @@ -1084,7 +1058,7 @@ gtk_combo_disable_activate (GtkCombo* combo) g_return_if_fail (GTK_IS_COMBO (combo)); if ( combo->activate_id ) { - gtk_signal_disconnect (GTK_OBJECT(combo->entry), combo->activate_id); + g_signal_handler_disconnect (combo->entry, combo->activate_id); combo->activate_id = 0; } } diff --git a/gtk/gtkcombo.h b/gtk/gtkcombo.h index f56acfeb8a..70f9b48466 100644 --- a/gtk/gtkcombo.h +++ b/gtk/gtkcombo.h @@ -35,11 +35,11 @@ extern "C" { #endif /* __cplusplus */ #define GTK_TYPE_COMBO (gtk_combo_get_type ()) -#define GTK_COMBO(obj) (GTK_CHECK_CAST ((obj), GTK_TYPE_COMBO, GtkCombo)) -#define GTK_COMBO_CLASS(klass) (GTK_CHECK_CLASS_CAST ((klass), GTK_TYPE_COMBO, GtkComboClass)) -#define GTK_IS_COMBO(obj) (GTK_CHECK_TYPE ((obj), GTK_TYPE_COMBO)) -#define GTK_IS_COMBO_CLASS(klass) (GTK_CHECK_CLASS_TYPE ((klass), GTK_TYPE_COMBO)) -#define GTK_COMBO_GET_CLASS(obj) (GTK_CHECK_GET_CLASS ((obj), GTK_TYPE_COMBO, GtkComboClass)) +#define GTK_COMBO(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), GTK_TYPE_COMBO, GtkCombo)) +#define GTK_COMBO_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), GTK_TYPE_COMBO, GtkComboClass)) +#define GTK_IS_COMBO(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), GTK_TYPE_COMBO)) +#define GTK_IS_COMBO_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), GTK_TYPE_COMBO)) +#define GTK_COMBO_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), GTK_TYPE_COMBO, GtkComboClass)) typedef struct _GtkCombo GtkCombo; @@ -77,7 +77,7 @@ struct _GtkComboClass { void (*_gtk_reserved4) (void); }; -GtkType gtk_combo_get_type (void) G_GNUC_CONST; +GType gtk_combo_get_type (void) G_GNUC_CONST; GtkWidget* gtk_combo_new (void); /* the text in the entry must be or not be in the list */ diff --git a/gtk/gtkplug.c b/gtk/gtkplug.c index 0ba21ce5a6..466423d714 100644 --- a/gtk/gtkplug.c +++ b/gtk/gtkplug.c @@ -83,10 +83,10 @@ enum { static guint plug_signals[LAST_SIGNAL] = { 0 }; -GtkType +GType gtk_plug_get_type () { - static GtkType plug_type = 0; + static GType plug_type = 0; if (!plug_type) { @@ -103,7 +103,8 @@ gtk_plug_get_type () (GInstanceInitFunc) gtk_plug_init, }; - plug_type = g_type_register_static (GTK_TYPE_WINDOW, "GtkPlug", &plug_info, 0); + plug_type = g_type_register_static (GTK_TYPE_WINDOW, "GtkPlug", + &plug_info, 0); } return plug_type; @@ -117,8 +118,8 @@ gtk_plug_class_init (GtkPlugClass *class) GtkWindowClass *window_class = (GtkWindowClass *)class; GtkContainerClass *container_class = (GtkContainerClass *)class; - parent_class = gtk_type_class (GTK_TYPE_WINDOW); - bin_class = gtk_type_class (GTK_TYPE_BIN); + parent_class = g_type_class_peek_parent (class); + bin_class = g_type_class_peek (GTK_TYPE_BIN); gobject_class->finalize = gtk_plug_finalize; @@ -148,7 +149,7 @@ gtk_plug_class_init (GtkPlugClass *class) G_STRUCT_OFFSET (GtkPlugClass, embedded), NULL, NULL, _gtk_marshal_VOID__VOID, - GTK_TYPE_NONE, 0); + G_TYPE_NONE, 0); } static void @@ -244,7 +245,7 @@ _gtk_plug_add_to_socket (GtkPlug *plug, gtk_widget_set_parent (widget, GTK_WIDGET (socket)); - g_signal_emit_by_name (G_OBJECT (socket), "plug_added", 0); + g_signal_emit_by_name (socket, "plug_added", 0); } static void @@ -311,7 +312,7 @@ _gtk_plug_remove_from_socket (GtkPlug *plug, gtk_plug_set_is_child (plug, FALSE); - g_signal_emit_by_name (G_OBJECT (socket), "plug_removed", &result); + g_signal_emit_by_name (socket, "plug_removed", &result); if (!result) gtk_widget_destroy (GTK_WIDGET (socket)); @@ -379,7 +380,7 @@ gtk_plug_construct_for_display (GtkPlug *plug, } if (plug->socket_window) - g_signal_emit (G_OBJECT (plug), plug_signals[EMBEDDED], 0); + g_signal_emit (plug, plug_signals[EMBEDDED], 0); } } @@ -414,7 +415,7 @@ gtk_plug_new_for_display (GdkDisplay *display, { GtkPlug *plug; - plug = GTK_PLUG (gtk_type_new (GTK_TYPE_PLUG)); + plug = g_object_new (GTK_TYPE_PLUG, NULL); gtk_plug_construct_for_display (plug, display, socket_id); return GTK_WIDGET (plug); } @@ -466,7 +467,7 @@ gtk_plug_unrealize (GtkWidget *widget) if (plug->socket_window != NULL) { gdk_window_set_user_data (plug->socket_window, NULL); - gdk_window_unref (plug->socket_window); + g_object_unref (plug->socket_window); plug->socket_window = NULL; } @@ -1108,7 +1109,7 @@ gtk_plug_filter_func (GdkXEvent *gdk_xevent, GdkEvent *event, gpointer data) GtkWidget *widget = GTK_WIDGET (plug); gdk_window_set_user_data (plug->socket_window, NULL); - gdk_window_unref (plug->socket_window); + g_object_unref (plug->socket_window); plug->socket_window = NULL; /* Emit a delete window, as if the user attempted @@ -1157,7 +1158,7 @@ gtk_plug_filter_func (GdkXEvent *gdk_xevent, GdkEvent *event, gpointer data) g_hash_table_foreach (plug->grabbed_keys, add_grabbed_key_always, plug); if (!was_embedded) - g_signal_emit (G_OBJECT (plug), plug_signals[EMBEDDED], 0); + g_signal_emit (plug, plug_signals[EMBEDDED], 0); } done: diff --git a/gtk/gtkplug.h b/gtk/gtkplug.h index 139189e730..cd46ea0ec7 100644 --- a/gtk/gtkplug.h +++ b/gtk/gtkplug.h @@ -38,11 +38,11 @@ extern "C" { #define GTK_TYPE_PLUG (gtk_plug_get_type ()) -#define GTK_PLUG(obj) (GTK_CHECK_CAST ((obj), GTK_TYPE_PLUG, GtkPlug)) -#define GTK_PLUG_CLASS(klass) (GTK_CHECK_CLASS_CAST ((klass), GTK_TYPE_PLUG, GtkPlugClass)) -#define GTK_IS_PLUG(obj) (GTK_CHECK_TYPE ((obj), GTK_TYPE_PLUG)) -#define GTK_IS_PLUG_CLASS(klass) (GTK_CHECK_CLASS_TYPE ((klass), GTK_TYPE_PLUG)) -#define GTK_PLUG_GET_CLASS(obj) (GTK_CHECK_GET_CLASS ((obj), GTK_TYPE_PLUG, GtkPlugClass)) +#define GTK_PLUG(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), GTK_TYPE_PLUG, GtkPlug)) +#define GTK_PLUG_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), GTK_TYPE_PLUG, GtkPlugClass)) +#define GTK_IS_PLUG(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), GTK_TYPE_PLUG)) +#define GTK_IS_PLUG_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), GTK_TYPE_PLUG)) +#define GTK_PLUG_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), GTK_TYPE_PLUG, GtkPlugClass)) typedef struct _GtkPlug GtkPlug; @@ -75,7 +75,7 @@ struct _GtkPlugClass }; -GtkType gtk_plug_get_type (void) G_GNUC_CONST; +GType gtk_plug_get_type (void) G_GNUC_CONST; #ifndef GDK_MULTIHEAD_SAFE void gtk_plug_construct (GtkPlug *plug, diff --git a/gtk/gtksocket.c b/gtk/gtksocket.c index ef6ca39658..2fee53f671 100644 --- a/gtk/gtksocket.c +++ b/gtk/gtksocket.c @@ -33,7 +33,6 @@ #include "gtkwindow.h" #include "gtkplug.h" #include "gtkprivate.h" -#include "gtksignal.h" #include "gtksocket.h" #include "gtkdnd.h" @@ -135,10 +134,10 @@ gtk_socket_get_private (GtkSocket *socket) return private; } -GtkType +GType gtk_socket_get_type (void) { - static GtkType socket_type = 0; + static GType socket_type = 0; if (!socket_type) { @@ -155,7 +154,8 @@ gtk_socket_get_type (void) (GInstanceInitFunc) gtk_socket_init, }; - socket_type = g_type_register_static (GTK_TYPE_CONTAINER, "GtkSocket", &socket_info, 0); + socket_type = g_type_register_static (GTK_TYPE_CONTAINER, "GtkSocket", + &socket_info, 0); } return socket_type; @@ -183,7 +183,7 @@ gtk_socket_class_init (GtkSocketClass *class) widget_class = (GtkWidgetClass*) class; container_class = (GtkContainerClass*) class; - parent_class = gtk_type_class (GTK_TYPE_CONTAINER); + parent_class = g_type_class_peek_parent (class); gobject_class->finalize = gtk_socket_finalize; gobject_class->notify = gtk_socket_notify; @@ -207,7 +207,7 @@ gtk_socket_class_init (GtkSocketClass *class) G_STRUCT_OFFSET (GtkSocketClass, plug_added), NULL, NULL, _gtk_marshal_VOID__VOID, - GTK_TYPE_NONE, 0); + G_TYPE_NONE, 0); socket_signals[PLUG_REMOVED] = g_signal_new ("plug_removed", G_OBJECT_CLASS_TYPE (class), @@ -656,7 +656,6 @@ remove_grabbed_key (GtkSocket *socket, accel_entry->closure); return; } - } g_warning ("GtkSocket: request to remove non-present grabbed key %u,%#x\n", @@ -735,9 +734,11 @@ gtk_socket_hierarchy_changed (GtkWidget *widget, { gtk_window_remove_accel_group (GTK_WINDOW (socket->toplevel), socket->accel_group); g_signal_handlers_disconnect_by_func (socket->toplevel, - (gpointer) socket_update_focus_in, socket); + socket_update_focus_in, + socket); g_signal_handlers_disconnect_by_func (socket->toplevel, - (gpointer) socket_update_active, socket); + socket_update_active, + socket); } socket->toplevel = toplevel; @@ -987,7 +988,7 @@ gtk_socket_add_window (GtkSocket *socket, if (gdk_error_trap_pop ()) { - gdk_window_unref (socket->plug_window); + g_object_unref (socket->plug_window); socket->plug_window = NULL; return; } @@ -1044,7 +1045,7 @@ gtk_socket_add_window (GtkSocket *socket, } if (socket->plug_window) - g_signal_emit (G_OBJECT (socket), socket_signals[PLUG_ADDED], 0); + g_signal_emit (socket, socket_signals[PLUG_ADDED], 0); } @@ -1322,7 +1323,7 @@ gtk_socket_filter_func (GdkXEvent *gdk_xevent, GdkEvent *event, gpointer data) gtk_socket_end_embedding (socket); g_object_ref (widget); - g_signal_emit (G_OBJECT (widget), socket_signals[PLUG_REMOVED], 0, &result); + g_signal_emit (widget, socket_signals[PLUG_REMOVED], 0, &result); if (!result) gtk_widget_destroy (widget); g_object_unref (widget); diff --git a/gtk/gtksocket.h b/gtk/gtksocket.h index bdc4baecf4..f47d79ec31 100644 --- a/gtk/gtksocket.h +++ b/gtk/gtksocket.h @@ -34,11 +34,11 @@ extern "C" { #define GTK_TYPE_SOCKET (gtk_socket_get_type ()) -#define GTK_SOCKET(obj) (GTK_CHECK_CAST ((obj), GTK_TYPE_SOCKET, GtkSocket)) -#define GTK_SOCKET_CLASS(klass) (GTK_CHECK_CLASS_CAST ((klass), GTK_TYPE_SOCKET, GtkSocketClass)) -#define GTK_IS_SOCKET(obj) (GTK_CHECK_TYPE ((obj), GTK_TYPE_SOCKET)) -#define GTK_IS_SOCKET_CLASS(klass) (GTK_CHECK_CLASS_TYPE ((klass), GTK_TYPE_SOCKET)) -#define GTK_SOCKET_GET_CLASS(obj) (GTK_CHECK_GET_CLASS ((obj), GTK_TYPE_SOCKET, GtkSocketClass)) +#define GTK_SOCKET(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), GTK_TYPE_SOCKET, GtkSocket)) +#define GTK_SOCKET_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), GTK_TYPE_SOCKET, GtkSocketClass)) +#define GTK_IS_SOCKET(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), GTK_TYPE_SOCKET)) +#define GTK_IS_SOCKET_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), GTK_TYPE_SOCKET)) +#define GTK_SOCKET_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), GTK_TYPE_SOCKET, GtkSocketClass)) typedef struct _GtkSocket GtkSocket; @@ -83,8 +83,8 @@ struct _GtkSocketClass }; +GType gtk_socket_get_type (void) G_GNUC_CONST; GtkWidget* gtk_socket_new (void); -GtkType gtk_socket_get_type (void) G_GNUC_CONST; void gtk_socket_add_id (GtkSocket *socket, GdkNativeWindow window_id); diff --git a/gtk/gtktreeview.c b/gtk/gtktreeview.c index f977f2fcab..0c47b7dfd8 100644 --- a/gtk/gtktreeview.c +++ b/gtk/gtktreeview.c @@ -18,12 +18,14 @@ */ +#include +#include + #include "gtktreeview.h" #include "gtkrbtree.h" #include "gtktreednd.h" #include "gtktreeprivate.h" #include "gtkcellrenderer.h" -#include "gtksignal.h" #include "gtkmain.h" #include "gtkmarshalers.h" #include "gtkbutton.h" @@ -37,9 +39,6 @@ #include "gtkentry.h" #include "gtktreemodelsort.h" -#include -#include - #define GTK_TREE_VIEW_SEARCH_DIALOG_KEY "gtk-tree-view-search-dialog" #define GTK_TREE_VIEW_PRIORITY_VALIDATE (GDK_PRIORITY_REDRAW + 5) #define GTK_TREE_VIEW_PRIORITY_SCROLL_SYNC (GTK_TREE_VIEW_PRIORITY_VALIDATE + 2) @@ -416,10 +415,10 @@ static guint tree_view_signals [LAST_SIGNAL] = { 0 }; /* GType Methods */ -GtkType +GType gtk_tree_view_get_type (void) { - static GtkType tree_view_type = 0; + static GType tree_view_type = 0; if (!tree_view_type) { @@ -436,7 +435,9 @@ gtk_tree_view_get_type (void) (GInstanceInitFunc) gtk_tree_view_init }; - tree_view_type = g_type_register_static (GTK_TYPE_CONTAINER, "GtkTreeView", &tree_view_info, 0); + tree_view_type = + g_type_register_static (GTK_TYPE_CONTAINER, "GtkTreeView", + &tree_view_info, 0); } return tree_view_type; @@ -637,160 +638,169 @@ gtk_tree_view_class_init (GtkTreeViewClass *class) _("Make the expanders indented"), TRUE, G_PARAM_READABLE)); + /* Signals */ widget_class->set_scroll_adjustments_signal = - gtk_signal_new ("set_scroll_adjustments", - GTK_RUN_LAST, - GTK_CLASS_TYPE (object_class), - GTK_SIGNAL_OFFSET (GtkTreeViewClass, 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_TYPE_FROM_CLASS (o_class), + G_SIGNAL_RUN_LAST | G_SIGNAL_ACTION, + G_STRUCT_OFFSET (GtkTreeViewClass, set_scroll_adjustments), + NULL, NULL, + _gtk_marshal_VOID__OBJECT_OBJECT, + G_TYPE_NONE, 2, + GTK_TYPE_ADJUSTMENT, + GTK_TYPE_ADJUSTMENT); tree_view_signals[ROW_ACTIVATED] = - gtk_signal_new ("row_activated", - GTK_RUN_LAST | GTK_RUN_ACTION, - GTK_CLASS_TYPE (object_class), - GTK_SIGNAL_OFFSET (GtkTreeViewClass, row_activated), - _gtk_marshal_VOID__BOXED_OBJECT, - GTK_TYPE_NONE, 2, - GTK_TYPE_TREE_PATH, - GTK_TYPE_TREE_VIEW_COLUMN); + g_signal_new ("row_activated", + G_TYPE_FROM_CLASS (o_class), + G_SIGNAL_RUN_LAST | G_SIGNAL_ACTION, + G_STRUCT_OFFSET (GtkTreeViewClass, row_activated), + NULL, NULL, + _gtk_marshal_VOID__BOXED_OBJECT, + G_TYPE_NONE, 2, + GTK_TYPE_TREE_PATH, + GTK_TYPE_TREE_VIEW_COLUMN); tree_view_signals[TEST_EXPAND_ROW] = g_signal_new ("test_expand_row", - G_TYPE_FROM_CLASS (object_class), - G_SIGNAL_RUN_LAST, - G_STRUCT_OFFSET (GtkTreeViewClass, test_expand_row), - _gtk_boolean_handled_accumulator, NULL, - _gtk_marshal_BOOLEAN__BOXED_BOXED, - G_TYPE_BOOLEAN, 2, - GTK_TYPE_TREE_ITER, - GTK_TYPE_TREE_PATH); + G_TYPE_FROM_CLASS (o_class), + G_SIGNAL_RUN_LAST, + G_STRUCT_OFFSET (GtkTreeViewClass, test_expand_row), + _gtk_boolean_handled_accumulator, NULL, + _gtk_marshal_BOOLEAN__BOXED_BOXED, + G_TYPE_BOOLEAN, 2, + GTK_TYPE_TREE_ITER, + GTK_TYPE_TREE_PATH); tree_view_signals[TEST_COLLAPSE_ROW] = g_signal_new ("test_collapse_row", - G_TYPE_FROM_CLASS (object_class), - G_SIGNAL_RUN_LAST, - G_STRUCT_OFFSET (GtkTreeViewClass, test_collapse_row), - _gtk_boolean_handled_accumulator, NULL, - _gtk_marshal_BOOLEAN__BOXED_BOXED, - G_TYPE_BOOLEAN, 2, - GTK_TYPE_TREE_ITER, - GTK_TYPE_TREE_PATH); + G_TYPE_FROM_CLASS (o_class), + G_SIGNAL_RUN_LAST, + G_STRUCT_OFFSET (GtkTreeViewClass, test_collapse_row), + _gtk_boolean_handled_accumulator, NULL, + _gtk_marshal_BOOLEAN__BOXED_BOXED, + G_TYPE_BOOLEAN, 2, + GTK_TYPE_TREE_ITER, + GTK_TYPE_TREE_PATH); tree_view_signals[ROW_EXPANDED] = g_signal_new ("row_expanded", - G_TYPE_FROM_CLASS (object_class), - G_SIGNAL_RUN_LAST, - G_STRUCT_OFFSET (GtkTreeViewClass, row_expanded), - NULL, NULL, - _gtk_marshal_VOID__BOXED_BOXED, - GTK_TYPE_NONE, 2, - GTK_TYPE_TREE_ITER, - GTK_TYPE_TREE_PATH); + G_TYPE_FROM_CLASS (o_class), + G_SIGNAL_RUN_LAST, + G_STRUCT_OFFSET (GtkTreeViewClass, row_expanded), + NULL, NULL, + _gtk_marshal_VOID__BOXED_BOXED, + G_TYPE_NONE, 2, + GTK_TYPE_TREE_ITER, + GTK_TYPE_TREE_PATH); tree_view_signals[ROW_COLLAPSED] = g_signal_new ("row_collapsed", - G_TYPE_FROM_CLASS (object_class), - G_SIGNAL_RUN_LAST, - G_STRUCT_OFFSET (GtkTreeViewClass, row_collapsed), - NULL, NULL, - _gtk_marshal_VOID__BOXED_BOXED, - GTK_TYPE_NONE, 2, - GTK_TYPE_TREE_ITER, - GTK_TYPE_TREE_PATH); + G_TYPE_FROM_CLASS (o_class), + G_SIGNAL_RUN_LAST, + G_STRUCT_OFFSET (GtkTreeViewClass, row_collapsed), + NULL, NULL, + _gtk_marshal_VOID__BOXED_BOXED, + G_TYPE_NONE, 2, + GTK_TYPE_TREE_ITER, + GTK_TYPE_TREE_PATH); tree_view_signals[COLUMNS_CHANGED] = g_signal_new ("columns_changed", - G_TYPE_FROM_CLASS (object_class), - G_SIGNAL_RUN_LAST, - G_STRUCT_OFFSET (GtkTreeViewClass, columns_changed), - NULL, NULL, - _gtk_marshal_NONE__NONE, - G_TYPE_NONE, 0); + G_TYPE_FROM_CLASS (o_class), + G_SIGNAL_RUN_LAST, + G_STRUCT_OFFSET (GtkTreeViewClass, columns_changed), + NULL, NULL, + _gtk_marshal_NONE__NONE, + G_TYPE_NONE, 0); tree_view_signals[CURSOR_CHANGED] = g_signal_new ("cursor_changed", - G_TYPE_FROM_CLASS (object_class), - G_SIGNAL_RUN_LAST, - G_STRUCT_OFFSET (GtkTreeViewClass, cursor_changed), - NULL, NULL, - _gtk_marshal_NONE__NONE, - G_TYPE_NONE, 0); + G_TYPE_FROM_CLASS (o_class), + G_SIGNAL_RUN_LAST, + G_STRUCT_OFFSET (GtkTreeViewClass, cursor_changed), + NULL, NULL, + _gtk_marshal_NONE__NONE, + G_TYPE_NONE, 0); tree_view_signals[MOVE_CURSOR] = g_signal_new ("move_cursor", - G_TYPE_FROM_CLASS (object_class), - G_SIGNAL_RUN_LAST | GTK_RUN_ACTION, - G_STRUCT_OFFSET (GtkTreeViewClass, move_cursor), - NULL, NULL, - _gtk_marshal_BOOLEAN__ENUM_INT, - GTK_TYPE_BOOL, 2, GTK_TYPE_MOVEMENT_STEP, GTK_TYPE_INT); + G_TYPE_FROM_CLASS (object_class), + G_SIGNAL_RUN_LAST | G_SIGNAL_ACTION, + G_STRUCT_OFFSET (GtkTreeViewClass, move_cursor), + NULL, NULL, + _gtk_marshal_BOOLEAN__ENUM_INT, + G_TYPE_BOOLEAN, 2, + GTK_TYPE_MOVEMENT_STEP, + G_TYPE_INT); tree_view_signals[SELECT_ALL] = g_signal_new ("select_all", - G_TYPE_FROM_CLASS (object_class), - G_SIGNAL_RUN_LAST | GTK_RUN_ACTION, - G_STRUCT_OFFSET (GtkTreeViewClass, select_all), - NULL, NULL, - _gtk_marshal_NONE__NONE, - GTK_TYPE_NONE, 0); + G_TYPE_FROM_CLASS (object_class), + G_SIGNAL_RUN_LAST | G_SIGNAL_ACTION, + G_STRUCT_OFFSET (GtkTreeViewClass, select_all), + NULL, NULL, + _gtk_marshal_NONE__NONE, + G_TYPE_NONE, 0); tree_view_signals[UNSELECT_ALL] = g_signal_new ("unselect_all", G_TYPE_FROM_CLASS (object_class), - G_SIGNAL_RUN_LAST | GTK_RUN_ACTION, + G_SIGNAL_RUN_LAST | G_SIGNAL_ACTION, G_STRUCT_OFFSET (GtkTreeViewClass, unselect_all), NULL, NULL, _gtk_marshal_NONE__NONE, - GTK_TYPE_NONE, 0); + G_TYPE_NONE, 0); tree_view_signals[SELECT_CURSOR_ROW] = g_signal_new ("select_cursor_row", - G_TYPE_FROM_CLASS (object_class), - G_SIGNAL_RUN_LAST | GTK_RUN_ACTION, - G_STRUCT_OFFSET (GtkTreeViewClass, select_cursor_row), - NULL, NULL, - _gtk_marshal_VOID__BOOLEAN, - GTK_TYPE_NONE, 1, + G_TYPE_FROM_CLASS (object_class), + G_SIGNAL_RUN_LAST | G_SIGNAL_ACTION, + G_STRUCT_OFFSET (GtkTreeViewClass, select_cursor_row), + NULL, NULL, + _gtk_marshal_VOID__BOOLEAN, + G_TYPE_NONE, 1, G_TYPE_BOOLEAN); tree_view_signals[TOGGLE_CURSOR_ROW] = g_signal_new ("toggle_cursor_row", - G_TYPE_FROM_CLASS (object_class), - G_SIGNAL_RUN_LAST | GTK_RUN_ACTION, - G_STRUCT_OFFSET (GtkTreeViewClass, toggle_cursor_row), - NULL, NULL, - _gtk_marshal_NONE__NONE, - GTK_TYPE_NONE, 0); + G_TYPE_FROM_CLASS (object_class), + G_SIGNAL_RUN_LAST | G_SIGNAL_ACTION, + G_STRUCT_OFFSET (GtkTreeViewClass, toggle_cursor_row), + NULL, NULL, + _gtk_marshal_NONE__NONE, + G_TYPE_NONE, 0); tree_view_signals[EXPAND_COLLAPSE_CURSOR_ROW] = g_signal_new ("expand_collapse_cursor_row", - G_TYPE_FROM_CLASS (object_class), - G_SIGNAL_RUN_LAST | GTK_RUN_ACTION, - G_STRUCT_OFFSET (GtkTreeViewClass, expand_collapse_cursor_row), - NULL, NULL, - _gtk_marshal_VOID__BOOLEAN_BOOLEAN_BOOLEAN, - GTK_TYPE_NONE, 3, GTK_TYPE_BOOL, GTK_TYPE_BOOL, GTK_TYPE_BOOL); + G_TYPE_FROM_CLASS (object_class), + G_SIGNAL_RUN_LAST | G_SIGNAL_ACTION, + G_STRUCT_OFFSET (GtkTreeViewClass, expand_collapse_cursor_row), + NULL, NULL, + _gtk_marshal_VOID__BOOLEAN_BOOLEAN_BOOLEAN, + G_TYPE_NONE, 3, + G_TYPE_BOOLEAN, + G_TYPE_BOOLEAN, + G_TYPE_BOOLEAN); tree_view_signals[SELECT_CURSOR_PARENT] = g_signal_new ("select_cursor_parent", - G_TYPE_FROM_CLASS (object_class), - G_SIGNAL_RUN_LAST | GTK_RUN_ACTION, - G_STRUCT_OFFSET (GtkTreeViewClass, select_cursor_parent), - NULL, NULL, - _gtk_marshal_NONE__NONE, - GTK_TYPE_NONE, 0); + G_TYPE_FROM_CLASS (object_class), + G_SIGNAL_RUN_LAST | G_SIGNAL_ACTION, + G_STRUCT_OFFSET (GtkTreeViewClass, select_cursor_parent), + NULL, NULL, + _gtk_marshal_NONE__NONE, + G_TYPE_NONE, 0); tree_view_signals[START_INTERACTIVE_SEARCH] = g_signal_new ("start_interactive_search", - G_TYPE_FROM_CLASS (object_class), - G_SIGNAL_RUN_LAST | GTK_RUN_ACTION, - G_STRUCT_OFFSET (GtkTreeViewClass, start_interactive_search), - NULL, NULL, - _gtk_marshal_NONE__NONE, - GTK_TYPE_NONE, 0); + G_TYPE_FROM_CLASS (object_class), + G_SIGNAL_RUN_LAST | G_SIGNAL_ACTION, + G_STRUCT_OFFSET (GtkTreeViewClass, start_interactive_search), + NULL, NULL, + _gtk_marshal_NONE__NONE, + G_TYPE_NONE, 0); /* Key bindings */ gtk_tree_view_add_move_binding (binding_set, GDK_Up, 0, @@ -818,28 +828,28 @@ gtk_tree_view_class_init (GtkTreeViewClass *class) GTK_MOVEMENT_PAGES, 1); gtk_binding_entry_add_signal (binding_set, GDK_Right, 0, "move_cursor", 2, - GTK_TYPE_ENUM, GTK_MOVEMENT_VISUAL_POSITIONS, - GTK_TYPE_INT, 1); + G_TYPE_ENUM, GTK_MOVEMENT_VISUAL_POSITIONS, + G_TYPE_INT, 1); gtk_binding_entry_add_signal (binding_set, GDK_Left, 0, "move_cursor", 2, - GTK_TYPE_ENUM, GTK_MOVEMENT_VISUAL_POSITIONS, - GTK_TYPE_INT, -1); + G_TYPE_ENUM, GTK_MOVEMENT_VISUAL_POSITIONS, + G_TYPE_INT, -1); gtk_binding_entry_add_signal (binding_set, GDK_Right, GDK_CONTROL_MASK, "move_cursor", 2, - GTK_TYPE_ENUM, GTK_MOVEMENT_VISUAL_POSITIONS, - GTK_TYPE_INT, 1); + G_TYPE_ENUM, GTK_MOVEMENT_VISUAL_POSITIONS, + G_TYPE_INT, 1); gtk_binding_entry_add_signal (binding_set, GDK_Left, GDK_CONTROL_MASK, "move_cursor", 2, - GTK_TYPE_ENUM, GTK_MOVEMENT_VISUAL_POSITIONS, - GTK_TYPE_INT, -1); + G_TYPE_ENUM, GTK_MOVEMENT_VISUAL_POSITIONS, + G_TYPE_INT, -1); gtk_binding_entry_add_signal (binding_set, GDK_Right, GDK_CONTROL_MASK|GDK_SHIFT_MASK, "move_cursor", 2, - GTK_TYPE_ENUM, GTK_MOVEMENT_VISUAL_POSITIONS, - GTK_TYPE_INT, 1); + G_TYPE_ENUM, GTK_MOVEMENT_VISUAL_POSITIONS, + G_TYPE_INT, 1); gtk_binding_entry_add_signal (binding_set, GDK_Left, GDK_CONTROL_MASK|GDK_SHIFT_MASK, "move_cursor", 2, - GTK_TYPE_ENUM, GTK_MOVEMENT_VISUAL_POSITIONS, - GTK_TYPE_INT, -1); + G_TYPE_ENUM, GTK_MOVEMENT_VISUAL_POSITIONS, + G_TYPE_INT, -1); gtk_binding_entry_add_signal (binding_set, GDK_space, GDK_CONTROL_MASK, "toggle_cursor_row", 0); @@ -850,58 +860,58 @@ gtk_tree_view_class_init (GtkTreeViewClass *class) gtk_binding_entry_add_signal (binding_set, GDK_backslash, GDK_CONTROL_MASK, "unselect_all", 0); gtk_binding_entry_add_signal (binding_set, GDK_space, GDK_SHIFT_MASK, "select_cursor_row", 1, - GTK_TYPE_BOOL, TRUE); + G_TYPE_BOOLEAN, TRUE); gtk_binding_entry_add_signal (binding_set, GDK_space, 0, "select_cursor_row", 1, - GTK_TYPE_BOOL, TRUE); + G_TYPE_BOOLEAN, TRUE); /* expand and collapse rows */ gtk_binding_entry_add_signal (binding_set, GDK_plus, 0, "expand_collapse_cursor_row", 3, - GTK_TYPE_BOOL, FALSE, - GTK_TYPE_BOOL, TRUE, - GTK_TYPE_BOOL, FALSE); + G_TYPE_BOOLEAN, FALSE, + G_TYPE_BOOLEAN, TRUE, + G_TYPE_BOOLEAN, FALSE); /* Not doable on US keyboards */ gtk_binding_entry_add_signal (binding_set, GDK_plus, GDK_SHIFT_MASK, "expand_collapse_cursor_row", 3, - GTK_TYPE_BOOL, FALSE, - GTK_TYPE_BOOL, TRUE, - GTK_TYPE_BOOL, TRUE); + G_TYPE_BOOLEAN, FALSE, + G_TYPE_BOOLEAN, TRUE, + G_TYPE_BOOLEAN, TRUE); gtk_binding_entry_add_signal (binding_set, GDK_KP_Add, 0, "expand_collapse_cursor_row", 3, - GTK_TYPE_BOOL, FALSE, - GTK_TYPE_BOOL, TRUE, - GTK_TYPE_BOOL, FALSE); + G_TYPE_BOOLEAN, FALSE, + G_TYPE_BOOLEAN, TRUE, + G_TYPE_BOOLEAN, FALSE); gtk_binding_entry_add_signal (binding_set, GDK_KP_Add, GDK_SHIFT_MASK, "expand_collapse_cursor_row", 3, - GTK_TYPE_BOOL, FALSE, - GTK_TYPE_BOOL, TRUE, - GTK_TYPE_BOOL, TRUE); + G_TYPE_BOOLEAN, FALSE, + G_TYPE_BOOLEAN, TRUE, + G_TYPE_BOOLEAN, TRUE); gtk_binding_entry_add_signal (binding_set, GDK_KP_Add, GDK_SHIFT_MASK, "expand_collapse_cursor_row", 3, - GTK_TYPE_BOOL, FALSE, - GTK_TYPE_BOOL, TRUE, - GTK_TYPE_BOOL, TRUE); + G_TYPE_BOOLEAN, FALSE, + G_TYPE_BOOLEAN, TRUE, + G_TYPE_BOOLEAN, TRUE); gtk_binding_entry_add_signal (binding_set, GDK_Right, GDK_SHIFT_MASK, "expand_collapse_cursor_row", 3, - GTK_TYPE_BOOL, TRUE, - GTK_TYPE_BOOL, TRUE, - GTK_TYPE_BOOL, TRUE); + G_TYPE_BOOLEAN, TRUE, + G_TYPE_BOOLEAN, TRUE, + G_TYPE_BOOLEAN, TRUE); gtk_binding_entry_add_signal (binding_set, GDK_minus, 0, "expand_collapse_cursor_row", 3, - GTK_TYPE_BOOL, FALSE, - GTK_TYPE_BOOL, FALSE, - GTK_TYPE_BOOL, FALSE); + G_TYPE_BOOLEAN, FALSE, + G_TYPE_BOOLEAN, FALSE, + G_TYPE_BOOLEAN, FALSE); gtk_binding_entry_add_signal (binding_set, GDK_minus, GDK_SHIFT_MASK, "expand_collapse_cursor_row", 3, - GTK_TYPE_BOOL, FALSE, - GTK_TYPE_BOOL, FALSE, - GTK_TYPE_BOOL, TRUE); + G_TYPE_BOOLEAN, FALSE, + G_TYPE_BOOLEAN, FALSE, + G_TYPE_BOOLEAN, TRUE); gtk_binding_entry_add_signal (binding_set, GDK_KP_Subtract, 0, "expand_collapse_cursor_row", 3, - GTK_TYPE_BOOL, FALSE, - GTK_TYPE_BOOL, FALSE, - GTK_TYPE_BOOL, FALSE); + G_TYPE_BOOLEAN, FALSE, + G_TYPE_BOOLEAN, FALSE, + G_TYPE_BOOLEAN, FALSE); gtk_binding_entry_add_signal (binding_set, GDK_KP_Subtract, GDK_SHIFT_MASK, "expand_collapse_cursor_row", 3, - GTK_TYPE_BOOL, FALSE, - GTK_TYPE_BOOL, FALSE, - GTK_TYPE_BOOL, TRUE); + G_TYPE_BOOLEAN, FALSE, + G_TYPE_BOOLEAN, FALSE, + G_TYPE_BOOLEAN, TRUE); gtk_binding_entry_add_signal (binding_set, GDK_Left, GDK_SHIFT_MASK, "expand_collapse_cursor_row", 3, - GTK_TYPE_BOOL, FALSE, - GTK_TYPE_BOOL, FALSE, - GTK_TYPE_BOOL, TRUE); + G_TYPE_BOOLEAN, FALSE, + G_TYPE_BOOLEAN, FALSE, + G_TYPE_BOOLEAN, TRUE); gtk_binding_entry_add_signal (binding_set, GDK_BackSpace, 0, "select_cursor_parent", 0); @@ -1142,8 +1152,8 @@ gtk_tree_view_destroy (GtkObject *object) tree_view->priv->anchor = NULL; /* destroy interactive search dialog */ - search_dialog = gtk_object_get_data (GTK_OBJECT (tree_view), - GTK_TREE_VIEW_SEARCH_DIALOG_KEY); + search_dialog = g_object_get_data (G_OBJECT (tree_view), + GTK_TREE_VIEW_SEARCH_DIALOG_KEY); if (search_dialog) gtk_tree_view_search_dialog_destroy (search_dialog, tree_view); @@ -1552,11 +1562,13 @@ gtk_tree_view_size_allocate_columns (GtkWidget *widget) if (column == tree_view->priv->drag_column) { GtkAllocation drag_allocation; - gdk_window_get_size (tree_view->priv->drag_window, - &(drag_allocation.width), &(drag_allocation.height)); + gdk_drawable_get_size (tree_view->priv->drag_window, + &(drag_allocation.width), + &(drag_allocation.height)); drag_allocation.x = 0; drag_allocation.y = 0; - gtk_widget_size_allocate (tree_view->priv->drag_column->button, &drag_allocation); + gtk_widget_size_allocate (tree_view->priv->drag_column->button, + &drag_allocation); width += drag_allocation.width; continue; } @@ -2018,9 +2030,12 @@ gtk_tree_view_button_press (GtkWidget *widget, column->use_resized_width = TRUE; /* block attached dnd signal handler */ - drag_data = gtk_object_get_data (GTK_OBJECT (widget), "gtk-site-data"); + drag_data = g_object_get_data (G_OBJECT (widget), "gtk-site-data"); if (drag_data) - gtk_signal_handler_block_by_data (GTK_OBJECT (widget), drag_data); + g_signal_handlers_block_matched (widget, + G_SIGNAL_MATCH_DATA, + 0, 0, NULL, NULL, + drag_data); if (!GTK_WIDGET_HAS_FOCUS (widget)) gtk_widget_grab_focus (widget); @@ -2098,9 +2113,12 @@ gtk_tree_view_button_release_column_resize (GtkWidget *widget, tree_view->priv->drag_pos = -1; /* unblock attached dnd signal handler */ - drag_data = gtk_object_get_data (GTK_OBJECT (widget), "gtk-site-data"); + drag_data = g_object_get_data (G_OBJECT (widget), "gtk-site-data"); if (drag_data) - gtk_signal_handler_unblock_by_data (GTK_OBJECT (widget), drag_data); + g_signal_handlers_unblock_matched (widget, + G_SIGNAL_MATCH_DATA, + 0, 0, NULL, NULL, + drag_data); GTK_TREE_VIEW_UNSET_FLAG (tree_view, GTK_TREE_VIEW_IN_COLUMN_RESIZE); gtk_widget_get_pointer (widget, &x, NULL); @@ -2356,11 +2374,11 @@ gtk_tree_view_motion_draw_column_motion_arrow (GtkTreeView *tree_view) col.pixel = 0; gdk_gc_set_foreground(gc, &col); gdk_draw_rectangle (mask, gc, TRUE, 2, 2, width - 4, height - 4); - gdk_gc_destroy (gc); + g_object_unref (gc); gdk_window_shape_combine_mask (tree_view->priv->drag_highlight_window, mask, 0, 0); - if (mask) gdk_pixmap_unref (mask); + if (mask) g_object_unref (mask); tree_view->priv->drag_column_window_state = DRAG_COLUMN_WINDOW_STATE_ORIGINAL; } } @@ -2428,10 +2446,10 @@ gtk_tree_view_motion_draw_column_motion_arrow (GtkTreeView *tree_view) else j--; } - gdk_gc_destroy (gc); + g_object_unref (gc); gdk_window_shape_combine_mask (tree_view->priv->drag_highlight_window, mask, 0, 0); - if (mask) gdk_pixmap_unref (mask); + if (mask) g_object_unref (mask); } tree_view->priv->drag_column_window_state = DRAG_COLUMN_WINDOW_STATE_ARROW; @@ -2504,10 +2522,10 @@ gtk_tree_view_motion_draw_column_motion_arrow (GtkTreeView *tree_view) gdk_draw_line (mask, gc, k, height, k, height - tree_view->priv->expander_size + j); j--; } - gdk_gc_destroy (gc); + g_object_unref (gc); gdk_window_shape_combine_mask (tree_view->priv->drag_highlight_window, mask, 0, 0); - if (mask) gdk_pixmap_unref (mask); + if (mask) g_object_unref (mask); } tree_view->priv->drag_column_window_state = arrow_type; @@ -3684,7 +3702,7 @@ gtk_tree_view_leave_notify (GtkWidget *widget, ensure_unprelighted (tree_view); -return TRUE; + return TRUE; } @@ -3697,8 +3715,8 @@ gtk_tree_view_focus_out (GtkWidget *widget, gtk_widget_queue_draw (widget); /* destroy interactive search dialog */ - search_dialog = gtk_object_get_data (GTK_OBJECT (widget), - GTK_TREE_VIEW_SEARCH_DIALOG_KEY); + search_dialog = g_object_get_data (G_OBJECT (widget), + GTK_TREE_VIEW_SEARCH_DIALOG_KEY); if (search_dialog) gtk_tree_view_search_dialog_destroy (search_dialog, GTK_TREE_VIEW (widget)); @@ -4590,7 +4608,7 @@ check_model_dnd (GtkTreeModel *model, "on GtkTreeView when using models that don't support " "the %s interface and enabling drag-and-drop. The simplest way to do this " "is to connect to '%s' and call " - "gtk_signal_emit_stop_by_name() in your signal handler to prevent " + "g_signal_stop_emission_by_name() in your signal handler to prevent " "the default handler from running. Look at the source code " "for the default handler in gtktreeview.c to get an idea what " "your handler should do. (gtktreeview.c is in the GTK source " @@ -4905,7 +4923,7 @@ gtk_tree_view_maybe_begin_dragging_row (GtkTreeView *tree_view, tree_view->priv->press_start_x + 1, cell_y + 1); - gdk_pixmap_unref (row_pix); + g_object_unref (row_pix); } set_source_row (context, model, path); @@ -5669,37 +5687,41 @@ gtk_tree_view_set_adjustments (GtkTreeView *tree_view, if (tree_view->priv->hadjustment && (tree_view->priv->hadjustment != hadj)) { - gtk_signal_disconnect_by_func (GTK_OBJECT (tree_view->priv->hadjustment), (GtkSignalFunc) gtk_tree_view_adjustment_changed, tree_view); - gtk_object_unref (GTK_OBJECT (tree_view->priv->hadjustment)); + g_signal_handlers_disconnect_by_func (tree_view->priv->hadjustment, + gtk_tree_view_adjustment_changed, + tree_view); + g_object_unref (tree_view->priv->hadjustment); } if (tree_view->priv->vadjustment && (tree_view->priv->vadjustment != vadj)) { - gtk_signal_disconnect_by_func (GTK_OBJECT (tree_view->priv->vadjustment), (GtkSignalFunc) gtk_tree_view_adjustment_changed, tree_view); - gtk_object_unref (GTK_OBJECT (tree_view->priv->vadjustment)); + g_signal_handlers_disconnect_by_func (tree_view->priv->vadjustment, + gtk_tree_view_adjustment_changed, + tree_view); + g_object_unref (tree_view->priv->vadjustment); } if (tree_view->priv->hadjustment != hadj) { tree_view->priv->hadjustment = hadj; - gtk_object_ref (GTK_OBJECT (tree_view->priv->hadjustment)); + g_object_ref (tree_view->priv->hadjustment); gtk_object_sink (GTK_OBJECT (tree_view->priv->hadjustment)); - gtk_signal_connect (GTK_OBJECT (tree_view->priv->hadjustment), "value_changed", - (GtkSignalFunc) gtk_tree_view_adjustment_changed, - tree_view); + g_signal_connect (tree_view->priv->hadjustment, "value_changed", + G_CALLBACK (gtk_tree_view_adjustment_changed), + tree_view); need_adjust = TRUE; } if (tree_view->priv->vadjustment != vadj) { tree_view->priv->vadjustment = vadj; - gtk_object_ref (GTK_OBJECT (tree_view->priv->vadjustment)); + g_object_ref (tree_view->priv->vadjustment); gtk_object_sink (GTK_OBJECT (tree_view->priv->vadjustment)); - gtk_signal_connect (GTK_OBJECT (tree_view->priv->vadjustment), "value_changed", - (GtkSignalFunc) gtk_tree_view_adjustment_changed, - tree_view); + g_signal_connect (tree_view->priv->vadjustment, "value_changed", + G_CALLBACK (gtk_tree_view_adjustment_changed), + tree_view); need_adjust = TRUE; } @@ -6132,7 +6154,7 @@ gtk_tree_view_row_deleted (GtkTreeModel *model, gtk_widget_queue_resize (GTK_WIDGET (tree_view)); if (selection_changed) - g_signal_emit_by_name (G_OBJECT (tree_view->priv->selection), "changed"); + g_signal_emit_by_name (tree_view->priv->selection, "changed"); } @@ -6613,26 +6635,26 @@ gtk_tree_view_add_move_binding (GtkBindingSet *binding_set, gtk_binding_entry_add_signal (binding_set, keyval, modmask, "move_cursor", 2, - GTK_TYPE_ENUM, step, - GTK_TYPE_INT, count); + G_TYPE_ENUM, step, + G_TYPE_INT, count); gtk_binding_entry_add_signal (binding_set, keyval, GDK_SHIFT_MASK, "move_cursor", 2, - GTK_TYPE_ENUM, step, - GTK_TYPE_INT, count); + G_TYPE_ENUM, step, + G_TYPE_INT, count); if ((modmask & GDK_CONTROL_MASK) == GDK_CONTROL_MASK) return; gtk_binding_entry_add_signal (binding_set, keyval, GDK_CONTROL_MASK | GDK_SHIFT_MASK, "move_cursor", 2, - GTK_TYPE_ENUM, step, - GTK_TYPE_INT, count); + G_TYPE_ENUM, step, + G_TYPE_INT, count); gtk_binding_entry_add_signal (binding_set, keyval, GDK_CONTROL_MASK, "move_cursor", 2, - GTK_TYPE_ENUM, step, - GTK_TYPE_INT, count); + G_TYPE_ENUM, step, + G_TYPE_INT, count); } static gint @@ -6792,7 +6814,7 @@ gtk_tree_view_set_column_drag_info (GtkTreeView *tree_view, { gint width; - gdk_window_get_size (tree_view->priv->header_window, &width, NULL); + gdk_drawable_get_size (tree_view->priv->header_window, &width, NULL); reorder->right_align = width + TREE_VIEW_COLUMN_DRAG_DEAD_MULTIPLIER (tree_view); } } @@ -6887,7 +6909,7 @@ _gtk_tree_view_column_start_drag (GtkTreeView *tree_view, gdk_window_show (tree_view->priv->drag_window); gdk_window_get_origin (tree_view->priv->header_window, &x, &y); - gdk_window_get_size (tree_view->priv->header_window, &width, &height); + gdk_drawable_get_size (tree_view->priv->header_window, &width, &height); gtk_widget_grab_focus (GTK_WIDGET (tree_view)); while (gtk_events_pending ()) @@ -7266,7 +7288,7 @@ gtk_tree_view_move_cursor_left_right (GtkTreeView *tree_view, cursor_tree, cursor_node, NULL); - g_signal_emit (G_OBJECT (tree_view), tree_view_signals[CURSOR_CHANGED], 0); + g_signal_emit (tree_view, tree_view_signals[CURSOR_CHANGED], 0); } gtk_tree_view_clamp_column_visible (tree_view, tree_view->priv->focus_column); } @@ -7567,22 +7589,23 @@ gtk_tree_view_real_start_interactive_search (GtkTreeView *tree_view) gtk_window_set_title (GTK_WINDOW (window), "search dialog"); gtk_container_set_border_width (GTK_CONTAINER (window), 3); gtk_window_set_modal (GTK_WINDOW (window), TRUE); - g_signal_connect (G_OBJECT (window), "delete_event", + g_signal_connect (window, "delete_event", G_CALLBACK (gtk_tree_view_search_delete_event), tree_view); - g_signal_connect (G_OBJECT (window), "key_press_event", + g_signal_connect (window, "key_press_event", G_CALLBACK (gtk_tree_view_search_key_press_event), tree_view); - g_signal_connect (G_OBJECT (window), "button_press_event", + g_signal_connect (window, "button_press_event", G_CALLBACK (gtk_tree_view_search_button_press_event), tree_view); /* add entry */ entry = gtk_entry_new (); gtk_widget_show (entry); - g_signal_connect (G_OBJECT (entry), "changed", - G_CALLBACK (gtk_tree_view_search_init), tree_view); - g_signal_connect (G_OBJECT (entry), "populate_popup", + g_signal_connect (entry, "changed", + G_CALLBACK (gtk_tree_view_search_init), + tree_view); + g_signal_connect (entry, "populate_popup", G_CALLBACK (gtk_tree_view_search_disable_popdown), tree_view); gtk_container_add (GTK_CONTAINER (window), entry); @@ -7683,11 +7706,7 @@ gtk_tree_view_adjustment_changed (GtkAdjustment *adjustment, GtkWidget * gtk_tree_view_new (void) { - GtkTreeView *tree_view; - - tree_view = GTK_TREE_VIEW (gtk_type_new (gtk_tree_view_get_type ())); - - return GTK_WIDGET (tree_view); + return g_object_new (GTK_TYPE_TREE_VIEW, NULL); } /** @@ -7701,12 +7720,7 @@ gtk_tree_view_new (void) GtkWidget * gtk_tree_view_new_with_model (GtkTreeModel *model) { - GtkTreeView *tree_view; - - tree_view = GTK_TREE_VIEW (gtk_type_new (gtk_tree_view_get_type ())); - gtk_tree_view_set_model (tree_view, model); - - return GTK_WIDGET (tree_view); + return g_object_new (GTK_TYPE_TREE_VIEW, "model", model, NULL); } /* Public Accessors @@ -7753,16 +7767,21 @@ gtk_tree_view_set_model (GtkTreeView *tree_view, gtk_tree_view_unref_and_check_selection_tree (tree_view, tree_view->priv->tree); - g_signal_handlers_disconnect_by_func (G_OBJECT (tree_view->priv->model), - (gpointer) gtk_tree_view_row_changed, tree_view); - g_signal_handlers_disconnect_by_func (G_OBJECT (tree_view->priv->model), - (gpointer) gtk_tree_view_row_inserted, tree_view); - g_signal_handlers_disconnect_by_func (G_OBJECT (tree_view->priv->model), - (gpointer) gtk_tree_view_row_has_child_toggled, tree_view); - g_signal_handlers_disconnect_by_func (G_OBJECT (tree_view->priv->model), - (gpointer) gtk_tree_view_row_deleted, tree_view); - g_signal_handlers_disconnect_by_func (G_OBJECT (tree_view->priv->model), - (gpointer) gtk_tree_view_rows_reordered, tree_view); + g_signal_handlers_disconnect_by_func (tree_view->priv->model, + gtk_tree_view_row_changed, + tree_view); + g_signal_handlers_disconnect_by_func (tree_view->priv->model, + gtk_tree_view_row_inserted, + tree_view); + g_signal_handlers_disconnect_by_func (tree_view->priv->model, + gtk_tree_view_row_has_child_toggled, + tree_view); + g_signal_handlers_disconnect_by_func (tree_view->priv->model, + gtk_tree_view_row_deleted, + tree_view); + g_signal_handlers_disconnect_by_func (tree_view->priv->model, + gtk_tree_view_rows_reordered, + tree_view); for (; tmplist; tmplist = tmplist->next) _gtk_tree_view_column_unset_model (tmplist->data, @@ -8021,7 +8040,7 @@ gtk_tree_view_set_headers_visible (GtkTreeView *tree_view, tree_view->priv->vadjustment->page_increment = (GTK_WIDGET (tree_view)->allocation.height - TREE_VIEW_HEADER_HEIGHT (tree_view)) / 2; tree_view->priv->vadjustment->lower = 0; tree_view->priv->vadjustment->upper = tree_view->priv->height; - gtk_signal_emit_by_name (GTK_OBJECT (tree_view->priv->vadjustment), "changed"); + gtk_adjustment_changed (tree_view->priv->vadjustment); gtk_widget_queue_resize (GTK_WIDGET (tree_view)); @@ -8202,8 +8221,8 @@ gtk_tree_view_remove_column (GtkTreeView *tree_view, gtk_widget_queue_resize (GTK_WIDGET (tree_view)); } - g_object_unref (G_OBJECT (column)); - g_signal_emit (G_OBJECT (tree_view), tree_view_signals[COLUMNS_CHANGED], 0); + g_object_unref (column); + g_signal_emit (tree_view, tree_view_signals[COLUMNS_CHANGED], 0); return tree_view->priv->n_columns; } @@ -8228,7 +8247,7 @@ gtk_tree_view_insert_column (GtkTreeView *tree_view, g_return_val_if_fail (GTK_IS_TREE_VIEW_COLUMN (column), -1); g_return_val_if_fail (column->tree_view == NULL, -1); - g_object_ref (G_OBJECT (column)); + g_object_ref (column); gtk_object_sink (GTK_OBJECT (column)); if (tree_view->priv->n_columns == 0 && @@ -8259,7 +8278,7 @@ gtk_tree_view_insert_column (GtkTreeView *tree_view, gtk_widget_queue_resize (GTK_WIDGET (tree_view)); } - g_signal_emit (G_OBJECT (tree_view), tree_view_signals[COLUMNS_CHANGED], 0); + g_signal_emit (tree_view, tree_view_signals[COLUMNS_CHANGED], 0); return tree_view->priv->n_columns; } @@ -8452,7 +8471,7 @@ gtk_tree_view_move_column_after (GtkTreeView *tree_view, gtk_tree_view_size_allocate_columns (GTK_WIDGET (tree_view)); } - g_signal_emit (G_OBJECT (tree_view), tree_view_signals[COLUMNS_CHANGED], 0); + g_signal_emit (tree_view, tree_view_signals[COLUMNS_CHANGED], 0); } /** @@ -8715,7 +8734,7 @@ gtk_tree_view_row_activated (GtkTreeView *tree_view, { g_return_if_fail (GTK_IS_TREE_VIEW (tree_view)); - g_signal_emit (G_OBJECT(tree_view), tree_view_signals[ROW_ACTIVATED], 0, path, column); + g_signal_emit (tree_view, tree_view_signals[ROW_ACTIVATED], 0, path, column); } @@ -8975,7 +8994,7 @@ gtk_tree_view_real_expand_row (GtkTreeView *tree_view, return retval; } - g_signal_emit (G_OBJECT (tree_view), tree_view_signals[TEST_EXPAND_ROW], 0, &iter, path, &expand); + g_signal_emit (tree_view, tree_view_signals[TEST_EXPAND_ROW], 0, &iter, path, &expand); if (expand) return FALSE; @@ -9017,7 +9036,7 @@ gtk_tree_view_real_expand_row (GtkTreeView *tree_view, install_presize_handler (tree_view); - g_signal_emit (G_OBJECT (tree_view), tree_view_signals[ROW_EXPANDED], 0, &iter, path); + g_signal_emit (tree_view, tree_view_signals[ROW_EXPANDED], 0, &iter, path); return TRUE; } @@ -9075,7 +9094,7 @@ gtk_tree_view_real_collapse_row (GtkTreeView *tree_view, gtk_tree_model_get_iter (tree_view->priv->model, &iter, path); - g_signal_emit (G_OBJECT (tree_view), tree_view_signals[TEST_COLLAPSE_ROW], 0, &iter, path, &collapse); + g_signal_emit (tree_view, tree_view_signals[TEST_COLLAPSE_ROW], 0, &iter, path, &collapse); if (collapse) return FALSE; @@ -9176,7 +9195,7 @@ gtk_tree_view_real_collapse_row (GtkTreeView *tree_view, if (gtk_tree_view_unref_and_check_selection_tree (tree_view, node->children)) { _gtk_rbtree_remove (node->children); - g_signal_emit_by_name (G_OBJECT (tree_view->priv->selection), "changed", 0); + g_signal_emit_by_name (tree_view->priv->selection, "changed"); } else _gtk_rbtree_remove (node->children); @@ -9209,7 +9228,7 @@ gtk_tree_view_real_collapse_row (GtkTreeView *tree_view, gtk_widget_queue_resize (GTK_WIDGET (tree_view)); } - g_signal_emit (G_OBJECT (tree_view), tree_view_signals[ROW_COLLAPSED], 0, &iter, path); + g_signal_emit (tree_view, tree_view_signals[ROW_COLLAPSED], 0, &iter, path); /* now that we've collapsed all rows, we want to try to set the prelight * again. To do this, we fake a motion event and send it to ourselves. */ @@ -9457,7 +9476,7 @@ gtk_tree_view_real_set_cursor (GtkTreeView *tree_view, } } - g_signal_emit (G_OBJECT (tree_view), tree_view_signals[CURSOR_CHANGED], 0); + g_signal_emit (tree_view, tree_view_signals[CURSOR_CHANGED], 0); } /** @@ -10506,9 +10525,9 @@ gtk_tree_view_search_position_func (GtkTreeView *tree_view, gtk_widget_realize (search_dialog); gdk_window_get_origin (tree_window, &tree_x, &tree_y); - gdk_window_get_size (tree_window, - &tree_width, - &tree_height); + gdk_drawable_get_size (tree_window, + &tree_width, + &tree_height); gtk_widget_size_request (search_dialog, &requisition); if (tree_x + tree_width - requisition.width > gdk_screen_get_width (screen)) @@ -10536,7 +10555,7 @@ gtk_tree_view_search_disable_popdown (GtkEntry *entry, GtkTreeView *tree_view = (GtkTreeView *)data; tree_view->priv->disable_popdown = 1; - g_signal_connect (G_OBJECT (menu), "hide", + g_signal_connect (menu, "hide", G_CALLBACK (gtk_tree_view_search_enable_popdown), data); } @@ -10981,7 +11000,8 @@ gtk_tree_view_real_start_editing (GtkTreeView *tree_view, gtk_cell_editable_start_editing (GTK_CELL_EDITABLE (cell_editable), (GdkEvent *)event); gtk_widget_grab_focus (GTK_WIDGET (cell_editable)); - g_signal_connect (cell_editable, "remove_widget", G_CALLBACK (gtk_tree_view_remove_widget), tree_view); + g_signal_connect (cell_editable, "remove_widget", + G_CALLBACK (gtk_tree_view_remove_widget), tree_view); } static void diff --git a/gtk/gtktreeview.h b/gtk/gtktreeview.h index 256fd47257..68221c8f26 100644 --- a/gtk/gtktreeview.h +++ b/gtk/gtktreeview.h @@ -42,11 +42,11 @@ typedef enum } GtkTreeViewDropPosition; #define GTK_TYPE_TREE_VIEW (gtk_tree_view_get_type ()) -#define GTK_TREE_VIEW(obj) (GTK_CHECK_CAST ((obj), GTK_TYPE_TREE_VIEW, GtkTreeView)) -#define GTK_TREE_VIEW_CLASS(klass) (GTK_CHECK_CLASS_CAST ((klass), GTK_TYPE_TREE_VIEW, GtkTreeViewClass)) -#define GTK_IS_TREE_VIEW(obj) (GTK_CHECK_TYPE ((obj), GTK_TYPE_TREE_VIEW)) -#define GTK_IS_TREE_VIEW_CLASS(klass) (GTK_CHECK_CLASS_TYPE ((klass), GTK_TYPE_TREE_VIEW)) -#define GTK_TREE_VIEW_GET_CLASS(obj) (GTK_CHECK_GET_CLASS ((obj), GTK_TYPE_TREE_VIEW, GtkTreeViewClass)) +#define GTK_TREE_VIEW(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), GTK_TYPE_TREE_VIEW, GtkTreeView)) +#define GTK_TREE_VIEW_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), GTK_TYPE_TREE_VIEW, GtkTreeViewClass)) +#define GTK_IS_TREE_VIEW(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), GTK_TYPE_TREE_VIEW)) +#define GTK_IS_TREE_VIEW_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), GTK_TYPE_TREE_VIEW)) +#define GTK_TREE_VIEW_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), GTK_TYPE_TREE_VIEW, GtkTreeViewClass)) typedef struct _GtkTreeView GtkTreeView; typedef struct _GtkTreeViewClass GtkTreeViewClass; @@ -127,7 +127,7 @@ typedef gboolean (*GtkTreeViewSearchEqualFunc) (GtkTreeModel *model, /* Creators */ -GtkType gtk_tree_view_get_type (void); +GType gtk_tree_view_get_type (void); GtkWidget *gtk_tree_view_new (void); GtkWidget *gtk_tree_view_new_with_model (GtkTreeModel *model); diff --git a/gtk/gtktreeviewcolumn.c b/gtk/gtktreeviewcolumn.c index df055b95ce..8c09f5ea01 100644 --- a/gtk/gtktreeviewcolumn.c +++ b/gtk/gtktreeviewcolumn.c @@ -17,10 +17,10 @@ * Boston, MA 02111-1307, USA. */ +#include #include "gtktreeviewcolumn.h" #include "gtktreeview.h" #include "gtktreeprivate.h" -#include "gtksignal.h" #include "gtkbutton.h" #include "gtkalignment.h" #include "gtklabel.h" @@ -28,7 +28,6 @@ #include "gtkmarshalers.h" #include "gtkarrow.h" #include "gtkintl.h" -#include enum { @@ -128,10 +127,10 @@ static GtkObjectClass *parent_class = NULL; static guint tree_column_signals[LAST_SIGNAL] = { 0 }; -GtkType +GType gtk_tree_view_column_get_type (void) { - static GtkType tree_column_type = 0; + static GType tree_column_type = 0; if (!tree_column_type) { @@ -148,7 +147,9 @@ gtk_tree_view_column_get_type (void) (GInstanceInitFunc) gtk_tree_view_column_init, }; - tree_column_type = g_type_register_static (GTK_TYPE_OBJECT, "GtkTreeViewColumn", &tree_column_info, 0); + tree_column_type = + g_type_register_static (GTK_TYPE_OBJECT, "GtkTreeViewColumn", + &tree_column_info, 0); } return tree_column_type; @@ -171,12 +172,12 @@ gtk_tree_view_column_class_init (GtkTreeViewColumnClass *class) tree_column_signals[CLICKED] = g_signal_new ("clicked", - GTK_CLASS_TYPE (object_class), + G_OBJECT_CLASS_TYPE (object_class), G_SIGNAL_RUN_LAST, G_STRUCT_OFFSET (GtkTreeViewColumnClass, clicked), NULL, NULL, _gtk_marshal_VOID__VOID, - GTK_TYPE_NONE, 0); + G_TYPE_NONE, 0); g_object_class_install_property (object_class, PROP_VISIBLE, @@ -348,7 +349,7 @@ gtk_tree_view_column_finalize (GObject *object) d (info->func_data); } gtk_tree_view_column_clear_attributes_by_info (tree_column, info); - g_object_unref (G_OBJECT (info->cell)); + g_object_unref (info->cell); g_free (info); } @@ -555,12 +556,12 @@ gtk_tree_view_column_create_button (GtkTreeViewColumn *tree_column) gtk_widget_set_parent_window (tree_column->button, tree_view->priv->header_window); gtk_widget_set_parent (tree_column->button, GTK_WIDGET (tree_view)); - g_signal_connect (G_OBJECT (tree_column->button), "event", + g_signal_connect (tree_column->button, "event", G_CALLBACK (gtk_tree_view_column_button_event), - (gpointer) tree_column); - g_signal_connect (G_OBJECT (tree_column->button), "clicked", - (GtkSignalFunc) gtk_tree_view_column_button_clicked, - (gpointer) tree_column); + tree_column); + g_signal_connect (tree_column->button, "clicked", + G_CALLBACK (gtk_tree_view_column_button_clicked), + tree_column); tree_column->alignment = gtk_alignment_new (tree_column->xalign, 0.5, 0.0, 0.0); @@ -575,9 +576,9 @@ gtk_tree_view_column_create_button (GtkTreeViewColumn *tree_column) gtk_widget_show (child); } - g_signal_connect (G_OBJECT (child), "mnemonic_activate", + g_signal_connect (child, "mnemonic_activate", G_CALLBACK (gtk_tree_view_column_mnemonic_activate), - (gpointer) tree_column); + tree_column); if (tree_column->xalign <= 0.5) gtk_box_pack_end (GTK_BOX (hbox), tree_column->arrow, FALSE, FALSE, 0); @@ -674,7 +675,7 @@ gtk_tree_view_column_update_button (GtkTreeViewColumn *tree_column) * left otherwise; do this by packing boxes, so flipping text direction will * reverse things */ - gtk_widget_ref (arrow); + g_object_ref (arrow); gtk_container_remove (GTK_CONTAINER (hbox), arrow); if (tree_column->xalign <= 0.5) @@ -687,7 +688,7 @@ gtk_tree_view_column_update_button (GtkTreeViewColumn *tree_column) /* move it to the front */ gtk_box_reorder_child (GTK_BOX (hbox), arrow, 0); } - gtk_widget_unref (arrow); + g_object_unref (arrow); if (tree_column->show_sort_indicator) gtk_widget_show (arrow); @@ -814,7 +815,7 @@ gtk_tree_view_column_button_event (GtkWidget *widget, static void gtk_tree_view_column_button_clicked (GtkWidget *widget, gpointer data) { - g_signal_emit_by_name (G_OBJECT (data), "clicked"); + g_signal_emit_by_name (data, "clicked"); } static gboolean @@ -928,9 +929,9 @@ gtk_tree_view_column_setup_sort_column_id_callback (GtkTreeViewColumn *tree_colu if (tree_column->sort_column_changed_signal == 0) tree_column->sort_column_changed_signal = - g_signal_connect (G_OBJECT (model), "sort_column_changed", - GTK_SIGNAL_FUNC (gtk_tree_view_model_sort_column_changed), - tree_column); + g_signal_connect (model, "sort_column_changed", + G_CALLBACK (gtk_tree_view_model_sort_column_changed), + tree_column); if (gtk_tree_sortable_get_sort_column_id (GTK_TREE_SORTABLE (model), &real_sort_column_id, @@ -1013,9 +1014,11 @@ _gtk_tree_view_column_unset_model (GtkTreeViewColumn *column, GtkTreeModel *old_model) { if (column->sort_column_changed_signal) - g_signal_handler_disconnect (G_OBJECT (old_model), - column->sort_column_changed_signal); - column->sort_column_changed_signal = 0; + { + g_signal_handler_disconnect (old_model, + column->sort_column_changed_signal); + column->sort_column_changed_signal = 0; + } } void @@ -1028,9 +1031,9 @@ _gtk_tree_view_column_set_tree_view (GtkTreeViewColumn *column, gtk_tree_view_column_create_button (column); column->property_changed_signal = - g_signal_connect_swapped (GTK_OBJECT (tree_view), + g_signal_connect_swapped (tree_view, "notify::model", - GTK_SIGNAL_FUNC (gtk_tree_view_column_setup_sort_column_id_callback), + G_CALLBACK (gtk_tree_view_column_setup_sort_column_id_callback), column); gtk_tree_view_column_setup_sort_column_id_callback (column); @@ -1045,13 +1048,13 @@ _gtk_tree_view_column_unset_tree_view (GtkTreeViewColumn *column) } if (column->property_changed_signal) { - g_signal_handler_disconnect (G_OBJECT (column->tree_view), column->property_changed_signal); + g_signal_handler_disconnect (column->tree_view, column->property_changed_signal); column->property_changed_signal = 0; } if (column->sort_column_changed_signal) { - g_signal_handler_disconnect (G_OBJECT (gtk_tree_view_get_model (GTK_TREE_VIEW (column->tree_view))), + g_signal_handler_disconnect (gtk_tree_view_get_model (GTK_TREE_VIEW (column->tree_view)), column->sort_column_changed_signal); column->sort_column_changed_signal = 0; } @@ -1138,7 +1141,7 @@ gtk_tree_view_column_new (void) { GtkTreeViewColumn *tree_column; - tree_column = GTK_TREE_VIEW_COLUMN (gtk_type_new (GTK_TYPE_TREE_VIEW_COLUMN)); + tree_column = g_object_new (GTK_TYPE_TREE_VIEW_COLUMN, NULL); return tree_column; } @@ -1225,7 +1228,7 @@ gtk_tree_view_column_pack_start (GtkTreeViewColumn *tree_column, g_return_if_fail (GTK_IS_CELL_RENDERER (cell)); g_return_if_fail (! gtk_tree_view_column_get_cell_info (tree_column, cell)); - g_object_ref (G_OBJECT (cell)); + g_object_ref (cell); gtk_object_sink (GTK_OBJECT (cell)); cell_info = g_new0 (GtkTreeViewColumnCellInfo, 1); @@ -1259,7 +1262,7 @@ gtk_tree_view_column_pack_end (GtkTreeViewColumn *tree_column, g_return_if_fail (GTK_IS_CELL_RENDERER (cell)); g_return_if_fail (! gtk_tree_view_column_get_cell_info (tree_column, cell)); - g_object_ref (G_OBJECT (cell)); + g_object_ref (cell); gtk_object_sink (GTK_OBJECT (cell)); cell_info = g_new0 (GtkTreeViewColumnCellInfo, 1); @@ -1290,7 +1293,7 @@ gtk_tree_view_column_clear (GtkTreeViewColumn *tree_column) GtkTreeViewColumnCellInfo *info = (GtkTreeViewColumnCellInfo *)list->data; gtk_tree_view_column_clear_attributes (tree_column, info->cell); - g_object_unref (G_OBJECT (info->cell)); + g_object_unref (info->cell); g_free (info); } @@ -1976,12 +1979,12 @@ gtk_tree_view_column_set_widget (GtkTreeViewColumn *tree_column, if (widget) { - gtk_object_ref (GTK_OBJECT (widget)); + g_object_ref (widget); gtk_object_sink (GTK_OBJECT (widget)); } if (tree_column->child) - gtk_object_unref (GTK_OBJECT (tree_column->child)); + g_object_unref (tree_column->child); tree_column->child = widget; gtk_tree_view_column_update_button (tree_column); @@ -2114,13 +2117,13 @@ gtk_tree_view_column_set_sort_column_id (GtkTreeViewColumn *tree_column, { if (tree_column->sort_clicked_signal) { - g_signal_handler_disconnect (G_OBJECT (tree_column), tree_column->sort_clicked_signal); + g_signal_handler_disconnect (tree_column, tree_column->sort_clicked_signal); tree_column->sort_clicked_signal = 0; } if (tree_column->sort_column_changed_signal) { - g_signal_handler_disconnect (G_OBJECT (tree_column), tree_column->sort_column_changed_signal); + g_signal_handler_disconnect (tree_column, tree_column->sort_column_changed_signal); tree_column->sort_column_changed_signal = 0; } @@ -2132,7 +2135,7 @@ gtk_tree_view_column_set_sort_column_id (GtkTreeViewColumn *tree_column, gtk_tree_view_column_set_clickable (tree_column, TRUE); if (! tree_column->sort_clicked_signal) - tree_column->sort_clicked_signal = g_signal_connect (G_OBJECT (tree_column), + tree_column->sort_clicked_signal = g_signal_connect (tree_column, "clicked", G_CALLBACK (gtk_tree_view_column_sort), NULL); diff --git a/gtk/gtktreeviewcolumn.h b/gtk/gtktreeviewcolumn.h index 22d20ef704..863202279d 100644 --- a/gtk/gtktreeviewcolumn.h +++ b/gtk/gtktreeviewcolumn.h @@ -20,21 +20,24 @@ #ifndef __GTK_TREE_VIEW_COLUMN_H__ #define __GTK_TREE_VIEW_COLUMN_H__ -#include +#include #include #include #include +/* Not needed, retained for compatibility -Yosh */ +#include + #ifdef __cplusplus extern "C" { #endif /* __cplusplus */ #define GTK_TYPE_TREE_VIEW_COLUMN (gtk_tree_view_column_get_type ()) -#define GTK_TREE_VIEW_COLUMN(obj) (GTK_CHECK_CAST ((obj), GTK_TYPE_TREE_VIEW_COLUMN, GtkTreeViewColumn)) -#define GTK_TREE_VIEW_COLUMN_CLASS(klass) (GTK_CHECK_CLASS_CAST ((klass), GTK_TYPE_TREE_VIEW_COLUMN, GtkTreeViewColumnClass)) -#define GTK_IS_TREE_VIEW_COLUMN(obj) (GTK_CHECK_TYPE ((obj), GTK_TYPE_TREE_VIEW_COLUMN)) -#define GTK_IS_TREE_VIEW_COLUMN_CLASS(klass) (GTK_CHECK_CLASS_TYPE ((klass), GTK_TYPE_TREE_VIEW_COLUMN)) -#define GTK_TREE_VIEW_COLUMN_GET_CLASS(obj) (GTK_CHECK_GET_CLASS ((obj), GTK_TYPE_TREE_VIEW_COLUMN, GtkTreeViewColumnClass)) +#define GTK_TREE_VIEW_COLUMN(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), GTK_TYPE_TREE_VIEW_COLUMN, GtkTreeViewColumn)) +#define GTK_TREE_VIEW_COLUMN_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), GTK_TYPE_TREE_VIEW_COLUMN, GtkTreeViewColumnClass)) +#define GTK_IS_TREE_VIEW_COLUMN(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), GTK_TYPE_TREE_VIEW_COLUMN)) +#define GTK_IS_TREE_VIEW_COLUMN_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), GTK_TYPE_TREE_VIEW_COLUMN)) +#define GTK_TREE_VIEW_COLUMN_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), GTK_TYPE_TREE_VIEW_COLUMN, GtkTreeViewColumnClass)) typedef enum { @@ -116,7 +119,7 @@ struct _GtkTreeViewColumnClass void (*_gtk_reserved4) (void); }; -GtkType gtk_tree_view_column_get_type (void); +GType gtk_tree_view_column_get_type (void); GtkTreeViewColumn *gtk_tree_view_column_new (void); GtkTreeViewColumn *gtk_tree_view_column_new_with_attributes (const gchar *title, GtkCellRenderer *cell,