Deprecation cleanup

Tue Oct  8 17:34:26 2002  Manish Singh  <yosh@gimp.org>

        * gtk/gtkmain.c gtk/gtkscrolledwindow.[ch] gtk/gtksettings.c
        gtk/gtkstatusbar.[ch] gtk/gtkstyle.c gtk/gtktoolbar.[ch]
        gtk/gtkviewport.[ch] gtk/gtkwindow.[ch]: Deprecation cleanup
This commit is contained in:
Manish Singh 2002-10-09 00:38:22 +00:00 committed by Manish Singh
parent 951e202764
commit cb7c950af0
18 changed files with 357 additions and 275 deletions

View File

@ -1,3 +1,9 @@
Tue Oct 8 17:34:26 2002 Manish Singh <yosh@gimp.org>
* gtk/gtkmain.c gtk/gtkscrolledwindow.[ch] gtk/gtksettings.c
gtk/gtkstatusbar.[ch] gtk/gtkstyle.c gtk/gtktoolbar.[ch]
gtk/gtkviewport.[ch] gtk/gtkwindow.[ch]: Deprecation cleanup
Tue Oct 8 15:25:53 2002 Manish Singh <yosh@gimp.org>
* gtk/gtkhpaned.[ch] gtk/gtkpaned.[ch] gtk/gtkprogress.[ch]

View File

@ -1,3 +1,9 @@
Tue Oct 8 17:34:26 2002 Manish Singh <yosh@gimp.org>
* gtk/gtkmain.c gtk/gtkscrolledwindow.[ch] gtk/gtksettings.c
gtk/gtkstatusbar.[ch] gtk/gtkstyle.c gtk/gtktoolbar.[ch]
gtk/gtkviewport.[ch] gtk/gtkwindow.[ch]: Deprecation cleanup
Tue Oct 8 15:25:53 2002 Manish Singh <yosh@gimp.org>
* gtk/gtkhpaned.[ch] gtk/gtkpaned.[ch] gtk/gtkprogress.[ch]

View File

@ -1,3 +1,9 @@
Tue Oct 8 17:34:26 2002 Manish Singh <yosh@gimp.org>
* gtk/gtkmain.c gtk/gtkscrolledwindow.[ch] gtk/gtksettings.c
gtk/gtkstatusbar.[ch] gtk/gtkstyle.c gtk/gtktoolbar.[ch]
gtk/gtkviewport.[ch] gtk/gtkwindow.[ch]: Deprecation cleanup
Tue Oct 8 15:25:53 2002 Manish Singh <yosh@gimp.org>
* gtk/gtkhpaned.[ch] gtk/gtkpaned.[ch] gtk/gtkprogress.[ch]

View File

@ -1,3 +1,9 @@
Tue Oct 8 17:34:26 2002 Manish Singh <yosh@gimp.org>
* gtk/gtkmain.c gtk/gtkscrolledwindow.[ch] gtk/gtksettings.c
gtk/gtkstatusbar.[ch] gtk/gtkstyle.c gtk/gtktoolbar.[ch]
gtk/gtkviewport.[ch] gtk/gtkwindow.[ch]: Deprecation cleanup
Tue Oct 8 15:25:53 2002 Manish Singh <yosh@gimp.org>
* gtk/gtkhpaned.[ch] gtk/gtkpaned.[ch] gtk/gtkprogress.[ch]

View File

@ -1,3 +1,9 @@
Tue Oct 8 17:34:26 2002 Manish Singh <yosh@gimp.org>
* gtk/gtkmain.c gtk/gtkscrolledwindow.[ch] gtk/gtksettings.c
gtk/gtkstatusbar.[ch] gtk/gtkstyle.c gtk/gtktoolbar.[ch]
gtk/gtkviewport.[ch] gtk/gtkwindow.[ch]: Deprecation cleanup
Tue Oct 8 15:25:53 2002 Manish Singh <yosh@gimp.org>
* gtk/gtkhpaned.[ch] gtk/gtkpaned.[ch] gtk/gtkprogress.[ch]

View File

@ -1,3 +1,9 @@
Tue Oct 8 17:34:26 2002 Manish Singh <yosh@gimp.org>
* gtk/gtkmain.c gtk/gtkscrolledwindow.[ch] gtk/gtksettings.c
gtk/gtkstatusbar.[ch] gtk/gtkstyle.c gtk/gtktoolbar.[ch]
gtk/gtkviewport.[ch] gtk/gtkwindow.[ch]: Deprecation cleanup
Tue Oct 8 15:25:53 2002 Manish Singh <yosh@gimp.org>
* gtk/gtkhpaned.[ch] gtk/gtkpaned.[ch] gtk/gtkprogress.[ch]

View File

@ -56,7 +56,6 @@
#include "gtkrc.h"
#include "gtkselection.h"
#include "gtksettings.h"
#include "gtksignal.h"
#include "gtkwidget.h"
#include "gtkwindow.h"
#include "gtkprivate.h"
@ -1086,7 +1085,7 @@ gtk_main (void)
gtk_main_loop_level++;
loop = g_main_new (TRUE);
loop = g_main_loop_new (NULL, TRUE);
main_loops = g_slist_prepend (main_loops, loop);
tmp_list = functions = init_functions;
@ -1102,10 +1101,10 @@ gtk_main (void)
}
g_list_free (functions);
if (g_main_is_running (main_loops->data))
if (g_main_loop_is_running (main_loops->data))
{
GDK_THREADS_LEAVE ();
g_main_run (loop);
g_main_loop_run (loop);
GDK_THREADS_ENTER ();
gdk_flush ();
}
@ -1149,7 +1148,7 @@ gtk_main (void)
main_loops = g_slist_remove (main_loops, loop);
g_main_destroy (loop);
g_main_loop_unref (loop);
gtk_main_loop_level--;
}
@ -1165,7 +1164,7 @@ gtk_main_quit (void)
{
g_return_if_fail (main_loops != NULL);
g_main_quit (main_loops->data);
g_main_loop_quit (main_loops->data);
}
gint
@ -1174,7 +1173,7 @@ gtk_events_pending (void)
gboolean result;
GDK_THREADS_LEAVE ();
result = g_main_pending ();
result = g_main_context_pending (NULL);
GDK_THREADS_ENTER ();
return result;
@ -1184,11 +1183,11 @@ gboolean
gtk_main_iteration (void)
{
GDK_THREADS_LEAVE ();
g_main_iteration (TRUE);
g_main_context_iteration (NULL, TRUE);
GDK_THREADS_ENTER ();
if (main_loops)
return !g_main_is_running (main_loops->data);
return !g_main_loop_is_running (main_loops->data);
else
return TRUE;
}
@ -1197,11 +1196,11 @@ gboolean
gtk_main_iteration_do (gboolean blocking)
{
GDK_THREADS_LEAVE ();
g_main_iteration (blocking);
g_main_context_iteration (NULL, blocking);
GDK_THREADS_ENTER ();
if (main_loops)
return !g_main_is_running (main_loops->data);
return !g_main_loop_is_running (main_loops->data);
else
return TRUE;
}
@ -1445,11 +1444,11 @@ gtk_main_do_event (GdkEvent *event)
break;
case GDK_DELETE:
gtk_widget_ref (event_widget);
g_object_ref (event_widget);
if ((!window_group->grabs || gtk_widget_get_toplevel (window_group->grabs->data) == event_widget) &&
!gtk_widget_event (event_widget, event))
gtk_widget_destroy (event_widget);
gtk_widget_unref (event_widget);
g_object_unref (event_widget);
break;
case GDK_DESTROY:
@ -1458,11 +1457,11 @@ gtk_main_do_event (GdkEvent *event)
*/
if (!event_widget->parent)
{
gtk_widget_ref (event_widget);
g_object_ref (event_widget);
if (!gtk_widget_event (event_widget, event) &&
GTK_WIDGET_REALIZED (event_widget))
gtk_widget_destroy (event_widget);
gtk_widget_unref (event_widget);
g_object_unref (event_widget);
}
break;
@ -1613,14 +1612,14 @@ gtk_grab_notify_foreach (GtkWidget *child,
if (was_grabbed != is_grabbed)
{
g_object_ref (G_OBJECT (child));
g_object_ref (child);
gtk_signal_emit_by_name (GTK_OBJECT (child), "grab_notify", was_grabbed);
g_signal_emit_by_name (child, "grab_notify", was_grabbed);
if (GTK_IS_CONTAINER (child))
gtk_container_foreach (GTK_CONTAINER (child), gtk_grab_notify_foreach, info);
g_object_unref (G_OBJECT (child));
g_object_unref (child);
}
}
@ -1679,7 +1678,7 @@ gtk_grab_add (GtkWidget *widget)
was_grabbed = (group->grabs != NULL);
gtk_widget_ref (widget);
g_object_ref (widget);
group->grabs = g_slist_prepend (group->grabs, widget);
gtk_grab_notify (group, widget, FALSE);
@ -1712,7 +1711,7 @@ gtk_grab_remove (GtkWidget *widget)
group = gtk_main_get_window_group (widget);
group->grabs = g_slist_remove (group->grabs, widget);
gtk_widget_unref (widget);
g_object_unref (widget);
gtk_grab_notify (group, widget, TRUE);
}
@ -1848,10 +1847,10 @@ gtk_quit_add_destroy (guint main_level,
object_p = g_new (GtkObject*, 1);
*object_p = object;
gtk_signal_connect (object,
"destroy",
GTK_SIGNAL_FUNC (gtk_widget_destroyed),
object_p);
g_signal_connect (object,
"destroy",
G_CALLBACK (gtk_widget_destroyed),
object_p);
gtk_quit_add (main_level, (GtkFunction) gtk_quit_destructor, object_p);
}
@ -1979,7 +1978,7 @@ guint
gtk_idle_add (GtkFunction function,
gpointer data)
{
return g_idle_add_full (GTK_PRIORITY_DEFAULT, function, data, NULL);
return g_idle_add_full (G_PRIORITY_DEFAULT_IDLE, function, data, NULL);
}
guint
@ -2217,7 +2216,7 @@ gtk_propagate_event (GtkWidget *widget,
handled_event = FALSE;
gtk_widget_ref (widget);
g_object_ref (widget);
if ((event->type == GDK_KEY_PRESS) ||
(event->type == GDK_KEY_RELEASE))
@ -2264,18 +2263,18 @@ gtk_propagate_event (GtkWidget *widget,
handled_event = !GTK_WIDGET_IS_SENSITIVE (widget) || gtk_widget_event (widget, event);
tmp = widget->parent;
gtk_widget_unref (widget);
g_object_unref (widget);
widget = tmp;
if (!handled_event && widget)
gtk_widget_ref (widget);
g_object_ref (widget);
else
break;
}
}
else
gtk_widget_unref (widget);
g_object_unref (widget);
}
#if 0

View File

@ -28,7 +28,6 @@
#include "gtkbindings.h"
#include "gtkmarshalers.h"
#include "gtkscrolledwindow.h"
#include "gtksignal.h"
#include "gtkintl.h"
@ -138,26 +137,29 @@ static GtkContainerClass *parent_class = NULL;
static guint signals[LAST_SIGNAL] = {0};
GtkType
GType
gtk_scrolled_window_get_type (void)
{
static GtkType scrolled_window_type = 0;
static GType scrolled_window_type = 0;
if (!scrolled_window_type)
{
static const GtkTypeInfo scrolled_window_info =
static const GTypeInfo scrolled_window_info =
{
"GtkScrolledWindow",
sizeof (GtkScrolledWindow),
sizeof (GtkScrolledWindowClass),
(GtkClassInitFunc) gtk_scrolled_window_class_init,
(GtkObjectInitFunc) gtk_scrolled_window_init,
/* reserved_1 */ NULL,
/* reserved_2 */ NULL,
(GtkClassInitFunc) NULL,
NULL, /* base_init */
NULL, /* base_finalize */
(GClassInitFunc) gtk_scrolled_window_class_init,
NULL, /* class_finalize */
NULL, /* class_data */
sizeof (GtkScrolledWindow),
0, /* n_preallocs */
(GInstanceInitFunc) gtk_scrolled_window_init,
};
scrolled_window_type = gtk_type_unique (GTK_TYPE_BIN, &scrolled_window_info);
scrolled_window_type =
g_type_register_static (GTK_TYPE_BIN, "GtkScrolledWindow",
&scrolled_window_info, 0);
}
return scrolled_window_type;
@ -207,7 +209,8 @@ gtk_scrolled_window_class_init (GtkScrolledWindowClass *class)
object_class = (GtkObjectClass*) class;
widget_class = (GtkWidgetClass*) class;
container_class = (GtkContainerClass*) class;
parent_class = gtk_type_class (GTK_TYPE_BIN);
parent_class = g_type_class_peek_parent (class);
gobject_class->finalize = gtk_scrolled_window_finalize;
gobject_class->set_property = gtk_scrolled_window_set_property;
@ -377,7 +380,7 @@ gtk_scrolled_window_set_hadjustment (GtkScrolledWindow *scrolled_window,
gtk_widget_pop_composite_child ();
gtk_widget_set_parent (scrolled_window->hscrollbar, GTK_WIDGET (scrolled_window));
gtk_widget_ref (scrolled_window->hscrollbar);
g_object_ref (scrolled_window->hscrollbar);
gtk_widget_show (scrolled_window->hscrollbar);
}
else
@ -388,17 +391,17 @@ gtk_scrolled_window_set_hadjustment (GtkScrolledWindow *scrolled_window,
if (old_adjustment == hadjustment)
return;
gtk_signal_disconnect_by_func (GTK_OBJECT (old_adjustment),
GTK_SIGNAL_FUNC (gtk_scrolled_window_adjustment_changed),
scrolled_window);
g_signal_handlers_disconnect_by_func (old_adjustment,
gtk_scrolled_window_adjustment_changed,
scrolled_window);
gtk_range_set_adjustment (GTK_RANGE (scrolled_window->hscrollbar),
hadjustment);
}
hadjustment = gtk_range_get_adjustment (GTK_RANGE (scrolled_window->hscrollbar));
gtk_signal_connect (GTK_OBJECT (hadjustment),
"changed",
GTK_SIGNAL_FUNC (gtk_scrolled_window_adjustment_changed),
scrolled_window);
g_signal_connect (hadjustment,
"changed",
G_CALLBACK (gtk_scrolled_window_adjustment_changed),
scrolled_window);
gtk_scrolled_window_adjustment_changed (hadjustment, scrolled_window);
if (bin->child)
@ -431,7 +434,7 @@ gtk_scrolled_window_set_vadjustment (GtkScrolledWindow *scrolled_window,
gtk_widget_pop_composite_child ();
gtk_widget_set_parent (scrolled_window->vscrollbar, GTK_WIDGET (scrolled_window));
gtk_widget_ref (scrolled_window->vscrollbar);
g_object_ref (scrolled_window->vscrollbar);
gtk_widget_show (scrolled_window->vscrollbar);
}
else
@ -442,17 +445,17 @@ gtk_scrolled_window_set_vadjustment (GtkScrolledWindow *scrolled_window,
if (old_adjustment == vadjustment)
return;
gtk_signal_disconnect_by_func (GTK_OBJECT (old_adjustment),
GTK_SIGNAL_FUNC (gtk_scrolled_window_adjustment_changed),
scrolled_window);
g_signal_handlers_disconnect_by_func (old_adjustment,
gtk_scrolled_window_adjustment_changed,
scrolled_window);
gtk_range_set_adjustment (GTK_RANGE (scrolled_window->vscrollbar),
vadjustment);
}
vadjustment = gtk_range_get_adjustment (GTK_RANGE (scrolled_window->vscrollbar));
gtk_signal_connect (GTK_OBJECT (vadjustment),
"changed",
GTK_SIGNAL_FUNC (gtk_scrolled_window_adjustment_changed),
scrolled_window);
g_signal_connect (vadjustment,
"changed",
G_CALLBACK (gtk_scrolled_window_adjustment_changed),
scrolled_window);
gtk_scrolled_window_adjustment_changed (vadjustment, scrolled_window);
if (bin->child)
@ -583,7 +586,7 @@ gtk_scrolled_window_set_shadow_type (GtkScrolledWindow *scrolled_window,
scrolled_window->shadow_type = type;
if (GTK_WIDGET_DRAWABLE (scrolled_window))
gtk_widget_queue_clear (GTK_WIDGET (scrolled_window));
gtk_widget_queue_draw (GTK_WIDGET (scrolled_window));
gtk_widget_queue_resize (GTK_WIDGET (scrolled_window));
@ -630,8 +633,8 @@ gtk_scrolled_window_finalize (GObject *object)
{
GtkScrolledWindow *scrolled_window = GTK_SCROLLED_WINDOW (object);
gtk_widget_unref (scrolled_window->hscrollbar);
gtk_widget_unref (scrolled_window->vscrollbar);
g_object_unref (scrolled_window->hscrollbar);
g_object_unref (scrolled_window->vscrollbar);
G_OBJECT_CLASS (parent_class)->finalize (object);
}
@ -895,7 +898,7 @@ gtk_scrolled_window_move_focus_out (GtkScrolledWindow *scrolled_window,
g_object_ref (scrolled_window);
scrolled_window->focus_out = TRUE;
g_signal_emit_by_name (G_OBJECT (toplevel), "move_focus", direction_type);
g_signal_emit_by_name (toplevel, "move_focus", direction_type);
scrolled_window->focus_out = FALSE;
g_object_unref (scrolled_window);

View File

@ -40,11 +40,11 @@ extern "C" {
#define GTK_TYPE_SCROLLED_WINDOW (gtk_scrolled_window_get_type ())
#define GTK_SCROLLED_WINDOW(obj) (GTK_CHECK_CAST ((obj), GTK_TYPE_SCROLLED_WINDOW, GtkScrolledWindow))
#define GTK_SCROLLED_WINDOW_CLASS(klass) (GTK_CHECK_CLASS_CAST ((klass), GTK_TYPE_SCROLLED_WINDOW, GtkScrolledWindowClass))
#define GTK_IS_SCROLLED_WINDOW(obj) (GTK_CHECK_TYPE ((obj), GTK_TYPE_SCROLLED_WINDOW))
#define GTK_IS_SCROLLED_WINDOW_CLASS(klass) (GTK_CHECK_CLASS_TYPE ((klass), GTK_TYPE_SCROLLED_WINDOW))
#define GTK_SCROLLED_WINDOW_GET_CLASS(obj) (GTK_CHECK_GET_CLASS ((obj), GTK_TYPE_SCROLLED_WINDOW, GtkScrolledWindowClass))
#define GTK_SCROLLED_WINDOW(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), GTK_TYPE_SCROLLED_WINDOW, GtkScrolledWindow))
#define GTK_SCROLLED_WINDOW_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), GTK_TYPE_SCROLLED_WINDOW, GtkScrolledWindowClass))
#define GTK_IS_SCROLLED_WINDOW(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), GTK_TYPE_SCROLLED_WINDOW))
#define GTK_IS_SCROLLED_WINDOW_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), GTK_TYPE_SCROLLED_WINDOW))
#define GTK_SCROLLED_WINDOW_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), GTK_TYPE_SCROLLED_WINDOW, GtkScrolledWindowClass))
@ -96,7 +96,7 @@ struct _GtkScrolledWindowClass
};
GtkType gtk_scrolled_window_get_type (void) G_GNUC_CONST;
GType gtk_scrolled_window_get_type (void) G_GNUC_CONST;
GtkWidget* gtk_scrolled_window_new (GtkAdjustment *hadjustment,
GtkAdjustment *vadjustment);
void gtk_scrolled_window_set_hadjustment (GtkScrolledWindow *scrolled_window,

View File

@ -97,7 +97,8 @@ gtk_settings_get_type (void)
(GInstanceInitFunc) gtk_settings_init,
};
settings_type = g_type_register_static (G_TYPE_OBJECT, "GtkSettings", &settings_info, 0);
settings_type = g_type_register_static (G_TYPE_OBJECT, "GtkSettings",
&settings_info, 0);
}
return settings_type;
@ -591,7 +592,7 @@ _gtk_rc_property_parser_from_type (GType type)
}
void
gtk_settings_install_property (GParamSpec *pspec)
gtk_settings_install_property (GParamSpec *pspec)
{
GtkRcPropertyParser parser;
@ -603,8 +604,8 @@ gtk_settings_install_property (GParamSpec *pspec)
}
void
gtk_settings_install_property_parser (GParamSpec *pspec,
GtkRcPropertyParser parser)
gtk_settings_install_property_parser (GParamSpec *pspec,
GtkRcPropertyParser parser)
{
g_return_if_fail (G_IS_PARAM_SPEC (pspec));
g_return_if_fail (parser != NULL);

View File

@ -28,7 +28,6 @@
#include "gtkframe.h"
#include "gtklabel.h"
#include "gtkmarshalers.h"
#include "gtksignal.h"
#include "gtkstatusbar.h"
#include "gtkwindow.h"
#include "gtkintl.h"
@ -75,26 +74,28 @@ static void gtk_statusbar_destroy_window (GtkStatusbar *statusbar);
static GtkContainerClass *parent_class;
static guint statusbar_signals[SIGNAL_LAST] = { 0 };
GtkType
GType
gtk_statusbar_get_type (void)
{
static GtkType statusbar_type = 0;
static GType statusbar_type = 0;
if (!statusbar_type)
{
static const GtkTypeInfo statusbar_info =
static const GTypeInfo statusbar_info =
{
"GtkStatusbar",
sizeof (GtkStatusbar),
sizeof (GtkStatusbarClass),
(GtkClassInitFunc) gtk_statusbar_class_init,
(GtkObjectInitFunc) gtk_statusbar_init,
/* reserved_1 */ NULL,
/* reserved_2 */ NULL,
(GtkClassInitFunc) NULL,
NULL, /* base_init */
NULL, /* base_finalize */
(GClassInitFunc) gtk_statusbar_class_init,
NULL, /* class_finalize */
NULL, /* class_data */
sizeof (GtkStatusbar),
0, /* n_preallocs */
(GInstanceInitFunc) gtk_statusbar_init,
};
statusbar_type = gtk_type_unique (GTK_TYPE_HBOX, &statusbar_info);
statusbar_type = g_type_register_static (GTK_TYPE_HBOX, "GtkStatusBar",
&statusbar_info, 0);
}
return statusbar_type;
@ -111,7 +112,7 @@ gtk_statusbar_class_init (GtkStatusbarClass *class)
widget_class = (GtkWidgetClass *) class;
container_class = (GtkContainerClass *) class;
parent_class = gtk_type_class (GTK_TYPE_HBOX);
parent_class = g_type_class_peek_parent (class);
object_class->destroy = gtk_statusbar_destroy;
@ -135,23 +136,25 @@ gtk_statusbar_class_init (GtkStatusbarClass *class)
class->text_popped = gtk_statusbar_update;
statusbar_signals[SIGNAL_TEXT_PUSHED] =
gtk_signal_new ("text_pushed",
GTK_RUN_LAST,
GTK_CLASS_TYPE (object_class),
GTK_SIGNAL_OFFSET (GtkStatusbarClass, text_pushed),
_gtk_marshal_VOID__UINT_STRING,
GTK_TYPE_NONE, 2,
GTK_TYPE_UINT,
GTK_TYPE_STRING);
g_signal_new ("text_pushed",
G_OBJECT_CLASS_TYPE (class),
G_SIGNAL_RUN_LAST,
G_STRUCT_OFFSET (GtkStatusbarClass, text_pushed),
NULL, NULL,
_gtk_marshal_VOID__UINT_STRING,
G_TYPE_NONE, 2,
G_TYPE_UINT,
G_TYPE_STRING);
statusbar_signals[SIGNAL_TEXT_POPPED] =
gtk_signal_new ("text_popped",
GTK_RUN_LAST,
GTK_CLASS_TYPE (object_class),
GTK_SIGNAL_OFFSET (GtkStatusbarClass, text_popped),
_gtk_marshal_VOID__UINT_STRING,
GTK_TYPE_NONE, 2,
GTK_TYPE_UINT,
GTK_TYPE_STRING);
g_signal_new ("text_popped",
G_OBJECT_CLASS_TYPE (class),
G_SIGNAL_RUN_LAST,
G_STRUCT_OFFSET (GtkStatusbarClass, text_popped),
NULL, NULL,
_gtk_marshal_VOID__UINT_STRING,
G_TYPE_NONE, 2,
G_TYPE_UINT,
G_TYPE_STRING);
gtk_widget_class_install_style_property (widget_class,
g_param_spec_enum ("shadow_type",
@ -187,7 +190,7 @@ gtk_statusbar_init (GtkStatusbar *statusbar)
/* don't expand the size request for the label; if we
* do that then toplevels weirdly resize
*/
gtk_widget_set_usize (statusbar->label, 1, -1);
gtk_widget_set_size_request (statusbar->label, 1, -1);
gtk_container_add (GTK_CONTAINER (statusbar->frame), statusbar->label);
gtk_widget_show (statusbar->label);
@ -200,7 +203,7 @@ gtk_statusbar_init (GtkStatusbar *statusbar)
GtkWidget*
gtk_statusbar_new (void)
{
return gtk_type_new (GTK_TYPE_STATUSBAR);
return g_object_new (GTK_TYPE_STATUSBAR, NULL);
}
static void
@ -229,12 +232,12 @@ gtk_statusbar_get_context_id (GtkStatusbar *statusbar,
/* we need to preserve namespaces on object datas */
string = g_strconcat ("gtk-status-bar-context:", context_description, NULL);
id = gtk_object_get_data (GTK_OBJECT (statusbar), string);
id = g_object_get_data (G_OBJECT (statusbar), string);
if (!id)
{
id = g_new (guint, 1);
*id = statusbar->seq_context_id++;
gtk_object_set_data_full (GTK_OBJECT (statusbar), string, id, (GtkDestroyNotify) g_free);
g_object_set_data_full (G_OBJECT (statusbar), string, id, g_free);
statusbar->keys = g_slist_prepend (statusbar->keys, string);
}
else
@ -262,10 +265,11 @@ gtk_statusbar_push (GtkStatusbar *statusbar,
statusbar->messages = g_slist_prepend (statusbar->messages, msg);
gtk_signal_emit (GTK_OBJECT (statusbar),
statusbar_signals[SIGNAL_TEXT_PUSHED],
msg->context_id,
msg->text);
g_signal_emit (statusbar,
statusbar_signals[SIGNAL_TEXT_PUSHED],
0,
msg->context_id,
msg->text);
return msg->message_id;
}
@ -304,10 +308,11 @@ gtk_statusbar_pop (GtkStatusbar *statusbar,
msg = statusbar->messages ? statusbar->messages->data : NULL;
gtk_signal_emit (GTK_OBJECT (statusbar),
statusbar_signals[SIGNAL_TEXT_POPPED],
(guint) (msg ? msg->context_id : 0),
msg ? msg->text : NULL);
g_signal_emit (statusbar,
statusbar_signals[SIGNAL_TEXT_POPPED],
0,
(guint) (msg ? msg->context_id : 0),
msg ? msg->text : NULL);
}
void

View File

@ -36,11 +36,11 @@ extern "C" {
#define GTK_TYPE_STATUSBAR (gtk_statusbar_get_type ())
#define GTK_STATUSBAR(obj) (GTK_CHECK_CAST ((obj), GTK_TYPE_STATUSBAR, GtkStatusbar))
#define GTK_STATUSBAR_CLASS(klass) (GTK_CHECK_CLASS_CAST ((klass), GTK_TYPE_STATUSBAR, GtkStatusbarClass))
#define GTK_IS_STATUSBAR(obj) (GTK_CHECK_TYPE ((obj), GTK_TYPE_STATUSBAR))
#define GTK_IS_STATUSBAR_CLASS(klass) (GTK_CHECK_CLASS_TYPE ((klass), GTK_TYPE_STATUSBAR))
#define GTK_STATUSBAR_GET_CLASS(obj) (GTK_CHECK_GET_CLASS ((obj), GTK_TYPE_STATUSBAR, GtkStatusbarClass))
#define GTK_STATUSBAR(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), GTK_TYPE_STATUSBAR, GtkStatusbar))
#define GTK_STATUSBAR_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), GTK_TYPE_STATUSBAR, GtkStatusbarClass))
#define GTK_IS_STATUSBAR(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), GTK_TYPE_STATUSBAR))
#define GTK_IS_STATUSBAR_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), GTK_TYPE_STATUSBAR))
#define GTK_STATUSBAR_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), GTK_TYPE_STATUSBAR, GtkStatusbarClass))
typedef struct _GtkStatusbar GtkStatusbar;
@ -85,7 +85,7 @@ struct _GtkStatusbarClass
};
GtkType gtk_statusbar_get_type (void) G_GNUC_CONST;
GType gtk_statusbar_get_type (void) G_GNUC_CONST;
GtkWidget* gtk_statusbar_new (void);
/* If you don't want to use contexts, 0 is a predefined global
* context_id you can pass to push/pop/remove

View File

@ -474,8 +474,7 @@ gtk_style_get_type (void)
(GInstanceInitFunc) gtk_style_init,
};
style_type = g_type_register_static (G_TYPE_OBJECT,
"GtkStyle",
style_type = g_type_register_static (G_TYPE_OBJECT, "GtkStyle",
&style_info, 0);
}
@ -779,7 +778,7 @@ gtk_style_attach (GtkStyle *style,
g_return_val_if_fail (GTK_IS_STYLE (style), NULL);
g_return_val_if_fail (window != NULL, NULL);
colormap = gdk_window_get_colormap (window);
colormap = gdk_drawable_get_colormap (window);
if (!style->styles)
style->styles = g_slist_append (NULL, style);
@ -839,7 +838,7 @@ gtk_style_detach (GtkStyle *style)
{
GTK_STYLE_GET_CLASS (style)->unrealize (style);
gdk_colormap_unref (style->colormap);
g_object_unref (style->colormap);
style->colormap = NULL;
if (style->private_font_desc)
@ -868,7 +867,7 @@ gtk_style_detach (GtkStyle *style)
GtkStyle*
gtk_style_ref (GtkStyle *style)
{
return (GtkStyle *) g_object_ref (G_OBJECT (style));
return (GtkStyle *) g_object_ref (style);
}
/**
@ -880,7 +879,7 @@ gtk_style_ref (GtkStyle *style)
void
gtk_style_unref (GtkStyle *style)
{
g_object_unref (G_OBJECT (style));
g_object_unref (style);
}
static void
@ -890,7 +889,7 @@ gtk_style_realize (GtkStyle *style,
g_return_if_fail (GTK_IS_STYLE (style));
g_return_if_fail (GDK_IS_COLORMAP (colormap));
style->colormap = gdk_colormap_ref (colormap);
style->colormap = g_object_ref (colormap);
style->depth = gdk_colormap_get_visual (colormap)->depth;
GTK_STYLE_GET_CLASS (style)->realize (style);
@ -1583,8 +1582,7 @@ gtk_style_real_init_from_rc (GtkStyle *style,
iter = style->icon_factories;
while (iter != NULL)
{
g_object_ref (G_OBJECT (iter->data));
g_object_ref (iter->data);
iter = g_slist_next (iter);
}
}
@ -1721,10 +1719,17 @@ gtk_style_real_realize (GtkStyle *style)
style->text_aa[i].green = (style->text[i].green + style->base[i].green) / 2;
style->text_aa[i].blue = (style->text[i].blue + style->base[i].blue) / 2;
}
gdk_color_black (style->colormap, &style->black);
gdk_color_white (style->colormap, &style->white);
style->black.red = 0x0000;
style->black.green = 0x0000;
style->black.blue = 0x0000;
gdk_colormap_alloc_color (style->colormap, &style->black, FALSE, TRUE);
style->white.red = 0xffff;
style->white.green = 0xffff;
style->white.blue = 0xffff;
gdk_colormap_alloc_color (style->colormap, &style->white, FALSE, TRUE);
gc_values_mask = GDK_GC_FOREGROUND;
gc_values.foreground = style->black;
@ -1740,28 +1745,28 @@ gtk_style_real_realize (GtkStyle *style)
&style->bg[i],
style->rc_style->bg_pixmap_name[i]);
if (!gdk_color_alloc (style->colormap, &style->fg[i]))
if (!gdk_colormap_alloc_color (style->colormap, &style->fg[i], FALSE, TRUE))
g_warning ("unable to allocate color: ( %d %d %d )",
style->fg[i].red, style->fg[i].green, style->fg[i].blue);
if (!gdk_color_alloc (style->colormap, &style->bg[i]))
if (!gdk_colormap_alloc_color (style->colormap, &style->bg[i], FALSE, TRUE))
g_warning ("unable to allocate color: ( %d %d %d )",
style->bg[i].red, style->bg[i].green, style->bg[i].blue);
if (!gdk_color_alloc (style->colormap, &style->light[i]))
if (!gdk_colormap_alloc_color (style->colormap, &style->light[i], FALSE, TRUE))
g_warning ("unable to allocate color: ( %d %d %d )",
style->light[i].red, style->light[i].green, style->light[i].blue);
if (!gdk_color_alloc (style->colormap, &style->dark[i]))
if (!gdk_colormap_alloc_color (style->colormap, &style->dark[i], FALSE, TRUE))
g_warning ("unable to allocate color: ( %d %d %d )",
style->dark[i].red, style->dark[i].green, style->dark[i].blue);
if (!gdk_color_alloc (style->colormap, &style->mid[i]))
if (!gdk_colormap_alloc_color (style->colormap, &style->mid[i], FALSE, TRUE))
g_warning ("unable to allocate color: ( %d %d %d )",
style->mid[i].red, style->mid[i].green, style->mid[i].blue);
if (!gdk_color_alloc (style->colormap, &style->text[i]))
if (!gdk_colormap_alloc_color (style->colormap, &style->text[i], FALSE, TRUE))
g_warning ("unable to allocate color: ( %d %d %d )",
style->text[i].red, style->text[i].green, style->text[i].blue);
if (!gdk_color_alloc (style->colormap, &style->base[i]))
if (!gdk_colormap_alloc_color (style->colormap, &style->base[i], FALSE, TRUE))
g_warning ("unable to allocate color: ( %d %d %d )",
style->base[i].red, style->base[i].green, style->base[i].blue);
if (!gdk_color_alloc (style->colormap, &style->text_aa[i]))
if (!gdk_colormap_alloc_color (style->colormap, &style->text_aa[i], FALSE, TRUE))
g_warning ("unable to allocate color: ( %d %d %d )",
style->text_aa[i].red, style->text_aa[i].green, style->text_aa[i].blue);
@ -1811,7 +1816,7 @@ gtk_style_real_unrealize (GtkStyle *style)
gtk_gc_release (style->text_aa_gc[i]);
if (style->bg_pixmap[i] && style->bg_pixmap[i] != (GdkPixmap*) GDK_PARENT_RELATIVE)
gdk_pixmap_unref (style->bg_pixmap[i]);
g_object_unref (style->bg_pixmap[i]);
}
gdk_colormap_free_colors (style->colormap, style->fg, 5);
@ -1964,8 +1969,7 @@ scale_or_ref (GdkPixbuf *src,
if (width == gdk_pixbuf_get_width (src) &&
height == gdk_pixbuf_get_height (src))
{
gdk_pixbuf_ref (src);
return src;
return g_object_ref (src);
}
else
{
@ -2031,7 +2035,7 @@ gtk_default_render_icon (GtkStyle *style,
if (size != (GtkIconSize)-1 && gtk_icon_source_get_size_wildcarded (source))
scaled = scale_or_ref (base_pixbuf, width, height);
else
scaled = GDK_PIXBUF (g_object_ref (G_OBJECT (base_pixbuf)));
scaled = g_object_ref (base_pixbuf);
/* If the state was wildcarded, then generate a state. */
if (gtk_icon_source_get_state_wildcarded (source))
@ -2043,7 +2047,7 @@ gtk_default_render_icon (GtkStyle *style,
gdk_pixbuf_saturate_and_pixelate (scaled, stated,
0.8, TRUE);
gdk_pixbuf_unref (scaled);
g_object_unref (scaled);
}
else if (state == GTK_STATE_PRELIGHT)
{
@ -2052,7 +2056,7 @@ gtk_default_render_icon (GtkStyle *style,
gdk_pixbuf_saturate_and_pixelate (scaled, stated,
1.2, FALSE);
gdk_pixbuf_unref (scaled);
g_object_unref (scaled);
}
else
{
@ -2071,11 +2075,11 @@ sanitize_size (GdkWindow *window,
gint *height)
{
if ((*width == -1) && (*height == -1))
gdk_window_get_size (window, width, height);
gdk_drawable_get_size (window, width, height);
else if (*width == -1)
gdk_window_get_size (window, width, NULL);
gdk_drawable_get_size (window, width, NULL);
else if (*height == -1)
gdk_window_get_size (window, NULL, height);
gdk_drawable_get_size (window, NULL, height);
}
static GdkBitmap *
@ -2285,7 +2289,7 @@ draw_spin_entry_shadow (GtkStyle *style,
gint window_width, window_height;
gboolean focus_inset;
gdk_window_get_size (window, &window_width, &window_height);
gdk_drawable_get_size (window, &window_width, &window_height);
if (width == -1)
width = window_width;
@ -3458,7 +3462,7 @@ gtk_default_draw_flat_box (GtkStyle *style,
if (freeme)
g_object_unref (G_OBJECT (freeme));
g_object_unref (freeme);
}
static void
@ -4850,7 +4854,7 @@ get_insensitive_layout (GdkDrawable *drawable,
g_slist_free (stippled_ranges);
if (stipple)
g_object_unref (G_OBJECT (stipple));
g_object_unref (stipple);
return new_layout;
}
@ -4885,7 +4889,7 @@ gtk_default_draw_layout (GtkStyle *style,
gdk_draw_layout (window, gc, x, y, ins);
g_object_unref (G_OBJECT (ins));
g_object_unref (ins);
}
else
{

View File

@ -142,26 +142,28 @@ static GtkContainerClass *parent_class;
static guint toolbar_signals[LAST_SIGNAL] = { 0 };
GtkType
GType
gtk_toolbar_get_type (void)
{
static GtkType toolbar_type = 0;
static GType toolbar_type = 0;
if (!toolbar_type)
{
static const GtkTypeInfo toolbar_info =
static const GTypeInfo toolbar_info =
{
"GtkToolbar",
sizeof (GtkToolbar),
sizeof (GtkToolbarClass),
(GtkClassInitFunc) gtk_toolbar_class_init,
(GtkObjectInitFunc) gtk_toolbar_init,
/* reserved_1 */ NULL,
/* reserved_2 */ NULL,
(GtkClassInitFunc) NULL,
NULL, /* base_init */
NULL, /* base_finalize */
(GClassInitFunc) gtk_toolbar_class_init,
NULL, /* class_finalize */
NULL, /* class_data */
sizeof (GtkToolbar),
0, /* n_preallocs */
(GInstanceInitFunc) gtk_toolbar_init,
};
toolbar_type = gtk_type_unique (gtk_container_get_type (), &toolbar_info);
toolbar_type = g_type_register_static (GTK_TYPE_CONTAINER, "GtkToolbar",
&toolbar_info, 0);
}
return toolbar_type;
@ -180,7 +182,7 @@ gtk_toolbar_class_init (GtkToolbarClass *class)
widget_class = (GtkWidgetClass *) class;
container_class = (GtkContainerClass *) class;
parent_class = gtk_type_class (gtk_container_get_type ());
parent_class = g_type_class_peek_parent (class);
object_class->destroy = gtk_toolbar_destroy;
gobject_class->set_property = gtk_toolbar_set_property;
@ -202,21 +204,23 @@ gtk_toolbar_class_init (GtkToolbarClass *class)
class->style_changed = gtk_real_toolbar_style_changed;
toolbar_signals[ORIENTATION_CHANGED] =
gtk_signal_new ("orientation_changed",
GTK_RUN_FIRST,
GTK_CLASS_TYPE (object_class),
GTK_SIGNAL_OFFSET (GtkToolbarClass, orientation_changed),
_gtk_marshal_VOID__ENUM,
GTK_TYPE_NONE, 1,
GTK_TYPE_ORIENTATION);
g_signal_new ("orientation_changed",
G_OBJECT_CLASS_TYPE (gobject_class),
G_SIGNAL_RUN_FIRST,
G_STRUCT_OFFSET (GtkToolbarClass, orientation_changed),
NULL, NULL,
_gtk_marshal_VOID__ENUM,
G_TYPE_NONE, 1,
GTK_TYPE_ORIENTATION);
toolbar_signals[STYLE_CHANGED] =
gtk_signal_new ("style_changed",
GTK_RUN_FIRST,
GTK_CLASS_TYPE (object_class),
GTK_SIGNAL_OFFSET (GtkToolbarClass, style_changed),
_gtk_marshal_VOID__ENUM,
GTK_TYPE_NONE, 1,
GTK_TYPE_TOOLBAR_STYLE);
g_signal_new ("style_changed",
G_OBJECT_CLASS_TYPE (gobject_class),
G_SIGNAL_RUN_FIRST,
G_STRUCT_OFFSET (GtkToolbarClass, style_changed),
NULL, NULL,
_gtk_marshal_VOID__ENUM,
G_TYPE_NONE, 1,
GTK_TYPE_TOOLBAR_STYLE);
g_object_class_install_property (gobject_class,
PROP_ORIENTATION,
@ -341,15 +345,17 @@ toolbar_screen_changed (GtkToolbar *toolbar)
if (settings)
{
toolbar->style_set_connection = g_signal_connect_swapped (settings,
"notify::gtk-toolbar-style",
G_CALLBACK (style_change_notify),
toolbar);
toolbar->style_set_connection =
g_signal_connect_swapped (settings,
"notify::gtk-toolbar-style",
G_CALLBACK (style_change_notify),
toolbar);
toolbar->icon_size_connection = g_signal_connect_swapped (settings,
"notify::gtk-toolbar-icon-size",
G_CALLBACK (icon_size_change_notify),
toolbar);
toolbar->icon_size_connection =
g_signal_connect_swapped (settings,
"notify::gtk-toolbar-icon-size",
G_CALLBACK (icon_size_change_notify),
toolbar);
g_object_ref (settings);
@ -370,7 +376,7 @@ gtk_toolbar_hierarchy_changed (GtkWidget *widget,
if (previous_toplevel)
g_signal_handlers_disconnect_by_func (previous_toplevel,
(gpointer) toolbar_screen_changed,
toolbar_screen_changed,
widget);
toplevel = gtk_widget_get_toplevel (widget);
@ -450,7 +456,7 @@ gtk_toolbar_new (void)
{
GtkToolbar *toolbar;
toolbar = gtk_type_new (gtk_toolbar_get_type ());
toolbar = g_object_new (GTK_TYPE_TOOLBAR, NULL);
return GTK_WIDGET (toolbar);
}
@ -467,7 +473,7 @@ gtk_toolbar_destroy (GtkObject *object)
if (toolbar->tooltips)
{
gtk_object_unref (GTK_OBJECT (toolbar->tooltips));
g_object_unref (toolbar->tooltips);
toolbar->tooltips = NULL;
}
@ -479,10 +485,10 @@ gtk_toolbar_destroy (GtkObject *object)
if (child->type != GTK_TOOLBAR_CHILD_SPACE)
{
gtk_widget_ref (child->widget);
g_object_ref (child->widget);
gtk_widget_unparent (child->widget);
gtk_widget_destroy (child->widget);
gtk_widget_unref (child->widget);
g_object_unref (child->widget);
}
g_free (child);
@ -1422,8 +1428,8 @@ gtk_toolbar_internal_insert_element (GtkToolbar *toolbar,
GTK_WIDGET_UNSET_FLAGS (child->widget, GTK_CAN_FOCUS);
if (callback)
gtk_signal_connect (GTK_OBJECT (child->widget), "clicked",
callback, user_data);
g_signal_connect (child->widget, "clicked",
callback, user_data);
if (toolbar->style == GTK_TOOLBAR_BOTH_HORIZ)
box = gtk_hbox_new (FALSE, 0);
@ -1486,7 +1492,7 @@ gtk_toolbar_set_orientation (GtkToolbar *toolbar,
{
g_return_if_fail (GTK_IS_TOOLBAR (toolbar));
gtk_signal_emit (GTK_OBJECT (toolbar), toolbar_signals[ORIENTATION_CHANGED], orientation);
g_signal_emit (toolbar, toolbar_signals[ORIENTATION_CHANGED], 0, orientation);
}
/**
@ -1513,7 +1519,7 @@ gtk_toolbar_set_style (GtkToolbar *toolbar,
g_return_if_fail (GTK_IS_TOOLBAR (toolbar));
toolbar->style_set = TRUE;
gtk_signal_emit (GTK_OBJECT (toolbar), toolbar_signals[STYLE_CHANGED], style);
g_signal_emit (toolbar, toolbar_signals[STYLE_CHANGED], 0, style);
}
/**
@ -1554,7 +1560,7 @@ gtk_toolbar_unset_style (GtkToolbar *toolbar)
NULL);
if (style != toolbar->style)
gtk_signal_emit (GTK_OBJECT (toolbar), toolbar_signals[STYLE_CHANGED], style);
g_signal_emit (toolbar, toolbar_signals[STYLE_CHANGED], 0, style);
toolbar->style_set = FALSE;
}
@ -1688,13 +1694,13 @@ gtk_real_toolbar_style_changed (GtkToolbar *toolbar,
{
if (child->icon)
{
gtk_object_ref (GTK_OBJECT (child->icon));
g_object_ref (child->icon);
gtk_container_remove (GTK_CONTAINER (box),
child->icon);
}
if (child->label)
{
gtk_object_ref (GTK_OBJECT (child->label));
g_object_ref (child->label);
gtk_container_remove (GTK_CONTAINER (box),
child->label);
}
@ -1707,12 +1713,12 @@ gtk_real_toolbar_style_changed (GtkToolbar *toolbar,
if (child->label)
{
gtk_box_pack_end (GTK_BOX (box), child->label, FALSE, FALSE, 0);
gtk_object_unref (GTK_OBJECT (child->label));
g_object_unref (child->label);
}
if (child->icon)
{
gtk_box_pack_end (GTK_BOX (box), child->icon, FALSE, FALSE, 0);
gtk_object_unref (GTK_OBJECT (child->icon));
g_object_unref (child->icon);
}
gtk_container_add (GTK_CONTAINER (child->widget),
box);
@ -1732,13 +1738,13 @@ gtk_real_toolbar_style_changed (GtkToolbar *toolbar,
{
if (child->icon)
{
gtk_object_ref (GTK_OBJECT (child->icon));
g_object_ref (child->icon);
gtk_container_remove (GTK_CONTAINER (box),
child->icon);
}
if (child->label)
{
gtk_object_ref (GTK_OBJECT (child->label));
g_object_ref (child->label);
gtk_container_remove (GTK_CONTAINER (box),
child->label);
}
@ -1751,12 +1757,12 @@ gtk_real_toolbar_style_changed (GtkToolbar *toolbar,
if (child->label)
{
gtk_box_pack_end (GTK_BOX (box), child->label, TRUE, TRUE, 0);
gtk_object_unref (GTK_OBJECT (child->label));
g_object_unref (child->label);
}
if (child->icon)
{
gtk_box_pack_end (GTK_BOX (box), child->icon, FALSE, FALSE, 0);
gtk_object_unref (GTK_OBJECT (child->icon));
g_object_unref (child->icon);
}
gtk_container_add (GTK_CONTAINER (child->widget), box);

View File

@ -32,9 +32,11 @@
#include <gdk/gdk.h>
#include <gtk/gtkcontainer.h>
#include <gtk/gtkenums.h>
#include <gtk/gtktooltips.h>
/* Not needed, retained for compatibility -Yosh */
#include <gtk/gtkpixmap.h>
#include <gtk/gtksignal.h>
#include <gtk/gtktooltips.h>
#ifdef __cplusplus
@ -43,11 +45,11 @@ extern "C" {
#define GTK_TYPE_TOOLBAR (gtk_toolbar_get_type ())
#define GTK_TOOLBAR(obj) (GTK_CHECK_CAST ((obj), GTK_TYPE_TOOLBAR, GtkToolbar))
#define GTK_TOOLBAR_CLASS(klass) (GTK_CHECK_CLASS_CAST ((klass), GTK_TYPE_TOOLBAR, GtkToolbarClass))
#define GTK_IS_TOOLBAR(obj) (GTK_CHECK_TYPE ((obj), GTK_TYPE_TOOLBAR))
#define GTK_IS_TOOLBAR_CLASS(klass) (GTK_CHECK_CLASS_TYPE ((klass), GTK_TYPE_TOOLBAR))
#define GTK_TOOLBAR_GET_CLASS(obj) (GTK_CHECK_GET_CLASS ((obj), GTK_TYPE_TOOLBAR, GtkToolbarClass))
#define GTK_TOOLBAR(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), GTK_TYPE_TOOLBAR, GtkToolbar))
#define GTK_TOOLBAR_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), GTK_TYPE_TOOLBAR, GtkToolbarClass))
#define GTK_IS_TOOLBAR(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), GTK_TYPE_TOOLBAR))
#define GTK_IS_TOOLBAR_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), GTK_TYPE_TOOLBAR))
#define GTK_TOOLBAR_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), GTK_TYPE_TOOLBAR, GtkToolbarClass))
typedef enum
@ -116,7 +118,7 @@ struct _GtkToolbarClass
};
GtkType gtk_toolbar_get_type (void) G_GNUC_CONST;
GType gtk_toolbar_get_type (void) G_GNUC_CONST;
GtkWidget* gtk_toolbar_new (void);
/* Simple button items */

View File

@ -24,7 +24,6 @@
* GTK+ at ftp://ftp.gtk.org/pub/gtk/.
*/
#include "gtksignal.h"
#include "gtkviewport.h"
#include "gtkintl.h"
#include "gtkmarshalers.h"
@ -72,26 +71,28 @@ static void gtk_viewport_style_set (GtkWidget *widget,
static GtkBinClass *parent_class;
GtkType
GType
gtk_viewport_get_type (void)
{
static GtkType viewport_type = 0;
static GType viewport_type = 0;
if (!viewport_type)
{
static const GtkTypeInfo viewport_info =
static const GTypeInfo viewport_info =
{
"GtkViewport",
sizeof (GtkViewport),
sizeof (GtkViewportClass),
(GtkClassInitFunc) gtk_viewport_class_init,
(GtkObjectInitFunc) gtk_viewport_init,
/* reserved_1 */ NULL,
/* reserved_2 */ NULL,
(GtkClassInitFunc) NULL,
NULL, /* base_init */
NULL, /* base_finalize */
(GClassInitFunc) gtk_viewport_class_init,
NULL, /* class_finalize */
NULL, /* class_data */
sizeof (GtkViewport),
0, /* n_preallocs */
(GInstanceInitFunc) gtk_viewport_init,
};
viewport_type = gtk_type_unique (GTK_TYPE_BIN, &viewport_info);
viewport_type = g_type_register_static (GTK_TYPE_BIN, "GtkViewport",
&viewport_info, 0);
}
return viewport_type;
@ -109,7 +110,8 @@ gtk_viewport_class_init (GtkViewportClass *class)
gobject_class = G_OBJECT_CLASS (class);
widget_class = (GtkWidgetClass*) class;
container_class = (GtkContainerClass*) class;
parent_class = (GtkBinClass*) gtk_type_class (GTK_TYPE_BIN);
parent_class = g_type_class_peek_parent (class);
gobject_class->set_property = gtk_viewport_set_property;
gobject_class->get_property = gtk_viewport_get_property;
@ -152,12 +154,15 @@ gtk_viewport_class_init (GtkViewportClass *class)
G_PARAM_READWRITE));
widget_class->set_scroll_adjustments_signal =
gtk_signal_new ("set_scroll_adjustments",
GTK_RUN_LAST,
GTK_CLASS_TYPE (object_class),
GTK_SIGNAL_OFFSET (GtkViewportClass, set_scroll_adjustments),
_gtk_marshal_VOID__OBJECT_OBJECT,
GTK_TYPE_NONE, 2, GTK_TYPE_ADJUSTMENT, GTK_TYPE_ADJUSTMENT);
g_signal_new ("set_scroll_adjustments",
G_OBJECT_CLASS_TYPE (gobject_class),
G_SIGNAL_RUN_LAST | G_SIGNAL_ACTION,
G_STRUCT_OFFSET (GtkViewportClass, set_scroll_adjustments),
NULL, NULL,
_gtk_marshal_VOID__OBJECT_OBJECT,
G_TYPE_NONE, 2,
GTK_TYPE_ADJUSTMENT,
GTK_TYPE_ADJUSTMENT);
}
static void
@ -259,14 +264,24 @@ gtk_viewport_destroy (GtkObject *object)
if (viewport->hadjustment)
{
gtk_signal_disconnect_by_data (GTK_OBJECT (viewport->hadjustment), viewport);
gtk_object_unref (GTK_OBJECT (viewport->hadjustment));
g_signal_handlers_disconnect_by_func (viewport->hadjustment,
gtk_viewport_adjustment_changed,
viewport);
g_signal_handlers_disconnect_by_func (viewport->hadjustment,
gtk_viewport_adjustment_value_changed,
viewport);
g_object_unref (viewport->hadjustment);
viewport->hadjustment = NULL;
}
if (viewport->vadjustment)
{
gtk_signal_disconnect_by_data (GTK_OBJECT (viewport->vadjustment), viewport);
gtk_object_unref (GTK_OBJECT (viewport->vadjustment));
g_signal_handlers_disconnect_by_func (viewport->vadjustment,
gtk_viewport_adjustment_changed,
viewport);
g_signal_handlers_disconnect_by_func (viewport->vadjustment,
gtk_viewport_adjustment_value_changed,
viewport);
g_object_unref (viewport->vadjustment);
viewport->vadjustment = NULL;
}
@ -328,8 +343,13 @@ gtk_viewport_set_hadjustment (GtkViewport *viewport,
if (viewport->hadjustment && viewport->hadjustment != adjustment)
{
gtk_signal_disconnect_by_data (GTK_OBJECT (viewport->hadjustment), viewport);
gtk_object_unref (GTK_OBJECT (viewport->hadjustment));
g_signal_handlers_disconnect_by_func (viewport->hadjustment,
gtk_viewport_adjustment_changed,
viewport);
g_signal_handlers_disconnect_by_func (viewport->hadjustment,
gtk_viewport_adjustment_value_changed,
viewport);
g_object_unref (viewport->hadjustment);
viewport->hadjustment = NULL;
}
@ -340,15 +360,15 @@ gtk_viewport_set_hadjustment (GtkViewport *viewport,
if (viewport->hadjustment != adjustment)
{
viewport->hadjustment = adjustment;
gtk_object_ref (GTK_OBJECT (viewport->hadjustment));
g_object_ref (viewport->hadjustment);
gtk_object_sink (GTK_OBJECT (viewport->hadjustment));
gtk_signal_connect (GTK_OBJECT (adjustment), "changed",
(GtkSignalFunc) gtk_viewport_adjustment_changed,
(gpointer) viewport);
gtk_signal_connect (GTK_OBJECT (adjustment), "value_changed",
(GtkSignalFunc) gtk_viewport_adjustment_value_changed,
(gpointer) viewport);
g_signal_connect (adjustment, "changed",
G_CALLBACK (gtk_viewport_adjustment_changed),
viewport);
g_signal_connect (adjustment, "value_changed",
G_CALLBACK (gtk_viewport_adjustment_value_changed),
viewport);
gtk_viewport_adjustment_changed (adjustment, viewport);
}
@ -373,8 +393,13 @@ gtk_viewport_set_vadjustment (GtkViewport *viewport,
if (viewport->vadjustment && viewport->vadjustment != adjustment)
{
gtk_signal_disconnect_by_data (GTK_OBJECT (viewport->vadjustment), viewport);
gtk_object_unref (GTK_OBJECT (viewport->vadjustment));
g_signal_handlers_disconnect_by_func (viewport->vadjustment,
gtk_viewport_adjustment_changed,
viewport);
g_signal_handlers_disconnect_by_func (viewport->vadjustment,
gtk_viewport_adjustment_value_changed,
viewport);
g_object_unref (viewport->vadjustment);
viewport->vadjustment = NULL;
}
@ -385,15 +410,15 @@ gtk_viewport_set_vadjustment (GtkViewport *viewport,
if (viewport->vadjustment != adjustment)
{
viewport->vadjustment = adjustment;
gtk_object_ref (GTK_OBJECT (viewport->vadjustment));
g_object_ref (viewport->vadjustment);
gtk_object_sink (GTK_OBJECT (viewport->vadjustment));
gtk_signal_connect (GTK_OBJECT (adjustment), "changed",
(GtkSignalFunc) gtk_viewport_adjustment_changed,
(gpointer) viewport);
gtk_signal_connect (GTK_OBJECT (adjustment), "value_changed",
(GtkSignalFunc) gtk_viewport_adjustment_value_changed,
(gpointer) viewport);
g_signal_connect (adjustment, "changed",
G_CALLBACK (gtk_viewport_adjustment_changed),
viewport);
g_signal_connect (adjustment, "value_changed",
G_CALLBACK (gtk_viewport_adjustment_value_changed),
viewport);
gtk_viewport_adjustment_changed (adjustment, viewport);
}
@ -570,9 +595,10 @@ gtk_viewport_paint (GtkWidget *widget,
{
viewport = GTK_VIEWPORT (widget);
gtk_draw_shadow (widget->style, widget->window,
GTK_STATE_NORMAL, viewport->shadow_type,
0, 0, -1, -1);
gtk_paint_shadow (widget->style, widget->window,
GTK_STATE_NORMAL, viewport->shadow_type,
NULL, widget, "viewport",
0, 0, -1, -1);
}
}
@ -752,17 +778,17 @@ gtk_viewport_size_allocate (GtkWidget *widget,
gtk_widget_size_allocate (bin->child, &child_allocation);
}
gtk_signal_emit_by_name (GTK_OBJECT (viewport->hadjustment), "changed");
gtk_signal_emit_by_name (GTK_OBJECT (viewport->vadjustment), "changed");
gtk_adjustment_changed (viewport->hadjustment);
gtk_adjustment_changed (viewport->vadjustment);
if (viewport->hadjustment->value != hval)
{
viewport->hadjustment->value = hval;
gtk_signal_emit_by_name (GTK_OBJECT (viewport->hadjustment), "value_changed");
gtk_adjustment_value_changed (viewport->hadjustment);
}
if (viewport->vadjustment->value != vval)
{
viewport->vadjustment->value = vval;
gtk_signal_emit_by_name (GTK_OBJECT (viewport->vadjustment), "value_changed");
gtk_adjustment_value_changed (viewport->vadjustment);
}
}

View File

@ -39,11 +39,11 @@ extern "C" {
#define GTK_TYPE_VIEWPORT (gtk_viewport_get_type ())
#define GTK_VIEWPORT(obj) (GTK_CHECK_CAST ((obj), GTK_TYPE_VIEWPORT, GtkViewport))
#define GTK_VIEWPORT_CLASS(klass) (GTK_CHECK_CLASS_CAST ((klass), GTK_TYPE_VIEWPORT, GtkViewportClass))
#define GTK_IS_VIEWPORT(obj) (GTK_CHECK_TYPE ((obj), GTK_TYPE_VIEWPORT))
#define GTK_IS_VIEWPORT_CLASS(klass) (GTK_CHECK_CLASS_TYPE ((klass), GTK_TYPE_VIEWPORT))
#define GTK_VIEWPORT_GET_CLASS(obj) (GTK_CHECK_GET_CLASS ((obj), GTK_TYPE_VIEWPORT, GtkViewportClass))
#define GTK_VIEWPORT(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), GTK_TYPE_VIEWPORT, GtkViewport))
#define GTK_VIEWPORT_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), GTK_TYPE_VIEWPORT, GtkViewportClass))
#define GTK_IS_VIEWPORT(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), GTK_TYPE_VIEWPORT))
#define GTK_IS_VIEWPORT_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), GTK_TYPE_VIEWPORT))
#define GTK_VIEWPORT_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), GTK_TYPE_VIEWPORT, GtkViewportClass))
typedef struct _GtkViewport GtkViewport;
@ -70,7 +70,7 @@ struct _GtkViewportClass
};
GtkType gtk_viewport_get_type (void) G_GNUC_CONST;
GType gtk_viewport_get_type (void) G_GNUC_CONST;
GtkWidget* gtk_viewport_new (GtkAdjustment *hadjustment,
GtkAdjustment *vadjustment);
GtkAdjustment* gtk_viewport_get_hadjustment (GtkViewport *viewport);

View File

@ -1267,7 +1267,7 @@ gtk_window_remove_accel_group (GtkWindow *window,
g_return_if_fail (GTK_IS_ACCEL_GROUP (accel_group));
g_signal_handlers_disconnect_by_func (accel_group,
(gpointer) gtk_window_notify_keys_changed,
gtk_window_notify_keys_changed,
window);
_gtk_accel_group_detach (accel_group, G_OBJECT (window));
}
@ -1628,7 +1628,7 @@ gtk_window_add_embedded_xid (GtkWindow *window, guint xid)
g_object_set_data_full (G_OBJECT (window), "gtk-embedded",
embedded_windows,
embedded_windows ?
(GtkDestroyNotify) g_list_free : NULL);
(GDestroyNotify) g_list_free : NULL);
}
void
@ -1654,7 +1654,7 @@ gtk_window_remove_embedded_xid (GtkWindow *window, guint xid)
g_object_set_data_full (G_OBJECT (window), "gtk-embedded",
embedded_windows,
embedded_windows ?
(GtkDestroyNotify) g_list_free : NULL);
(GDestroyNotify) g_list_free : NULL);
}
void
@ -1702,7 +1702,7 @@ disconnect_parent_destroyed (GtkWindow *window)
if (window->transient_parent)
{
g_signal_handlers_disconnect_by_func (window->transient_parent,
G_CALLBACK (parent_destroyed_callback),
parent_destroyed_callback,
window);
}
}
@ -1730,13 +1730,13 @@ gtk_window_unset_transient_for (GtkWindow *window)
if (window->transient_parent)
{
g_signal_handlers_disconnect_by_func (window->transient_parent,
G_CALLBACK (gtk_window_transient_parent_realized),
gtk_window_transient_parent_realized,
window);
g_signal_handlers_disconnect_by_func (window->transient_parent,
G_CALLBACK (gtk_window_transient_parent_unrealized),
gtk_window_transient_parent_unrealized,
window);
g_signal_handlers_disconnect_by_func (window->transient_parent,
G_CALLBACK (gtk_widget_destroyed),
gtk_widget_destroyed,
&window->transient_parent);
if (window->destroy_with_parent)
@ -2083,7 +2083,7 @@ gtk_window_set_geometry_hints (GtkWindow *window,
if (info->widget)
g_signal_handlers_disconnect_by_func (info->widget,
G_CALLBACK (gtk_widget_destroyed),
gtk_widget_destroyed,
&info->widget);
info->widget = geometry_widget;
@ -3370,7 +3370,7 @@ gtk_window_finalize (GObject *object)
{
if (window->geometry_info->widget)
g_signal_handlers_disconnect_by_func (window->geometry_info->widget,
G_CALLBACK (gtk_widget_destroyed),
gtk_widget_destroyed,
&window->geometry_info->widget);
g_free (window->geometry_info);
}