Commit cb7c950a authored by Manish Singh's avatar Manish Singh Committed by Manish Singh

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
parent 951e2027
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]
......
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]
......
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]
......
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]
......
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]
......
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]
......
......@@ -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
......
......@@ -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);
......
......@@ -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,
......
......@@ -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);
......
......@@ -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
......
......@@ -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
......
......@@ -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))