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

Deprecation cleanup

Wed Oct  9 15:07:08 2002  Manish Singh  <yosh@gimp.org>

        * gtk/gtkbindings.[ch] gtk/gtkcalendar.[ch] gtk/gtkfilesel.[ch]
        gtk/gtkfontsel.[ch] gtk/gtkitem.[ch] gtk/gtkitemfactory.[ch]:
        Deprecation cleanup
parent 7eecad56
......@@ -32,7 +32,6 @@
#include <gdkkeysyms.h>
#include "gtkbindings.h"
#include "gtkkeyhash.h"
#include "gtksignal.h"
#include "gtkwidget.h"
#include "gtkrc.h"
......@@ -80,7 +79,7 @@ binding_signal_free (GtkBindingSignal *sig)
for (i = 0; i < sig->n_args; i++)
{
if (GTK_FUNDAMENTAL_TYPE (sig->args[i].arg_type) == GTK_TYPE_STRING)
if (G_TYPE_FUNDAMENTAL (sig->args[i].arg_type) == G_TYPE_STRING)
g_free (sig->args[i].d.string_data);
}
g_free (sig->args);
......@@ -362,11 +361,11 @@ binding_compose_params (GtkObject *object,
g_value_init (&tmp_value, G_TYPE_DOUBLE);
g_value_set_double (&tmp_value, args->d.double_data);
break;
case G_TYPE_LONG:
case G_TYPE_LONG:
g_value_init (&tmp_value, G_TYPE_LONG);
g_value_set_long (&tmp_value, args->d.long_data);
break;
case G_TYPE_STRING:
case G_TYPE_STRING:
/* gtk_rc_parse_flags/enum() has fancier parsing for this; we can't call
* that since we don't have a GParamSpec, so just do something simple
*/
......@@ -505,7 +504,7 @@ gtk_binding_entry_activate (GtkBindingEntry *entry,
sig->signal_name,
g_type_name (G_OBJECT_TYPE (object)));
}
else if (!(query.signal_flags & GTK_RUN_ACTION))
else if (!(query.signal_flags & G_SIGNAL_ACTION))
{
accelerator = gtk_accelerator_name (entry->keyval, entry->modifiers);
g_warning ("gtk_binding_entry_activate(): binding \"%s::%s\": "
......@@ -587,10 +586,10 @@ gtk_binding_set_by_class (gpointer object_class)
if (binding_set)
return binding_set;
binding_set = gtk_binding_set_new (gtk_type_name (GTK_CLASS_TYPE (class)));
binding_set = gtk_binding_set_new (g_type_name (G_OBJECT_CLASS_TYPE (class)));
gtk_binding_set_add_path (binding_set,
GTK_PATH_CLASS,
gtk_type_name (GTK_CLASS_TYPE (class)),
g_type_name (G_OBJECT_CLASS_TYPE (class)),
GTK_PATH_PRIO_GTK);
g_dataset_id_set_data (class, key_id_class_binding_set, binding_set);
......@@ -705,19 +704,19 @@ gtk_binding_entry_add_signall (GtkBindingSet *binding_set,
binding_signal_free (signal);
return;
}
switch (GTK_FUNDAMENTAL_TYPE (tmp_arg->arg_type))
switch (G_TYPE_FUNDAMENTAL (tmp_arg->arg_type))
{
case GTK_TYPE_LONG:
arg->arg_type = GTK_TYPE_LONG;
case G_TYPE_LONG:
arg->arg_type = G_TYPE_LONG;
arg->d.long_data = tmp_arg->d.long_data;
break;
case GTK_TYPE_DOUBLE:
arg->arg_type = GTK_TYPE_DOUBLE;
case G_TYPE_DOUBLE:
arg->arg_type = G_TYPE_DOUBLE;
arg->d.double_data = tmp_arg->d.double_data;
break;
case GTK_TYPE_STRING:
case G_TYPE_STRING:
if (tmp_arg->arg_type != GTK_TYPE_IDENTIFIER)
arg->arg_type = GTK_TYPE_STRING;
arg->arg_type = G_TYPE_STRING;
else
arg->arg_type = GTK_TYPE_IDENTIFIER;
arg->d.string_data = g_strdup (tmp_arg->d.string_data);
......@@ -730,7 +729,7 @@ gtk_binding_entry_add_signall (GtkBindingSet *binding_set,
break;
default:
g_warning ("gtk_binding_entry_add_signall(): unsupported type `%s' for arg[%u]",
gtk_type_name (arg->arg_type), n);
g_type_name (arg->arg_type), n);
binding_signal_free (signal);
return;
}
......@@ -775,46 +774,46 @@ gtk_binding_entry_add_signal (GtkBindingSet *binding_set,
slist = g_slist_prepend (slist, arg);
arg->arg_type = va_arg (args, GtkType);
switch (GTK_FUNDAMENTAL_TYPE (arg->arg_type))
switch (G_TYPE_FUNDAMENTAL (arg->arg_type))
{
/* for elaborated commenting about var args collection, take a look
* at gtk_arg_collect_value() in gtkargcollector.c
*/
case GTK_TYPE_CHAR:
case GTK_TYPE_UCHAR:
case GTK_TYPE_INT:
case GTK_TYPE_UINT:
case GTK_TYPE_BOOL:
case GTK_TYPE_ENUM:
case GTK_TYPE_FLAGS:
arg->arg_type = GTK_TYPE_LONG;
case G_TYPE_CHAR:
case G_TYPE_UCHAR:
case G_TYPE_INT:
case G_TYPE_UINT:
case G_TYPE_BOOLEAN:
case G_TYPE_ENUM:
case G_TYPE_FLAGS:
arg->arg_type = G_TYPE_LONG;
arg->d.long_data = va_arg (args, gint);
break;
case GTK_TYPE_LONG:
case GTK_TYPE_ULONG:
arg->arg_type = GTK_TYPE_LONG;
case G_TYPE_LONG:
case G_TYPE_ULONG:
arg->arg_type = G_TYPE_LONG;
arg->d.long_data = va_arg (args, glong);
break;
case GTK_TYPE_FLOAT:
case GTK_TYPE_DOUBLE:
arg->arg_type = GTK_TYPE_DOUBLE;
case G_TYPE_FLOAT:
case G_TYPE_DOUBLE:
arg->arg_type = G_TYPE_DOUBLE;
arg->d.double_data = va_arg (args, gdouble);
break;
case GTK_TYPE_STRING:
case G_TYPE_STRING:
if (arg->arg_type != GTK_TYPE_IDENTIFIER)
arg->arg_type = GTK_TYPE_STRING;
arg->arg_type = G_TYPE_STRING;
arg->d.string_data = va_arg (args, gchar*);
if (!arg->d.string_data)
{
g_warning ("gtk_binding_entry_add_signal(): type `%s' arg[%u] is `NULL'",
gtk_type_name (arg->arg_type),
g_type_name (arg->arg_type),
i);
i += n_args + 1;
}
break;
default:
g_warning ("gtk_binding_entry_add_signal(): unsupported type `%s' for arg[%u]",
gtk_type_name (arg->arg_type), i);
g_type_name (arg->arg_type), i);
i += n_args + 1;
break;
}
......@@ -1046,24 +1045,24 @@ gtk_bindings_activate_list (GtkObject *object,
if (!handled)
{
GSList *patterns;
GtkType class_type;
GType class_type;
patterns = gtk_binding_entries_sort_patterns (entries, GTK_PATH_CLASS, is_release);
class_type = GTK_OBJECT_TYPE (object);
class_type = G_TYPE_FROM_INSTANCE (object);
while (class_type && !handled)
{
guint path_length;
const gchar *path;
gchar *path_reversed;
path = gtk_type_name (class_type);
path = g_type_name (class_type);
path_reversed = g_strdup (path);
g_strreverse (path_reversed);
path_length = strlen (path);
handled = binding_match_activate (patterns, object, path_length, path, path_reversed);
g_free (path_reversed);
class_type = gtk_type_parent (class_type);
class_type = g_type_parent (class_type);
}
g_slist_free (patterns);
}
......@@ -1193,7 +1192,7 @@ gtk_binding_parse_signal (GScanner *scanner,
{
need_arg = FALSE;
arg = g_new (GtkBindingArg, 1);
arg->arg_type = GTK_TYPE_DOUBLE;
arg->arg_type = G_TYPE_DOUBLE;
arg->d.double_data = scanner->value.v_float;
if (negate)
{
......@@ -1210,7 +1209,7 @@ gtk_binding_parse_signal (GScanner *scanner,
{
need_arg = FALSE;
arg = g_new (GtkBindingArg, 1);
arg->arg_type = GTK_TYPE_LONG;
arg->arg_type = G_TYPE_LONG;
arg->d.long_data = scanner->value.v_int;
if (negate)
{
......@@ -1227,7 +1226,7 @@ gtk_binding_parse_signal (GScanner *scanner,
{
need_arg = FALSE;
arg = g_new (GtkBindingArg, 1);
arg->arg_type = GTK_TYPE_STRING;
arg->arg_type = G_TYPE_STRING;
arg->d.string_data = g_strdup (scanner->value.v_string);
args = g_slist_prepend (args, arg);
}
......@@ -1290,7 +1289,7 @@ gtk_binding_parse_signal (GScanner *scanner,
GtkBindingArg *arg;
arg = slist->data;
if (GTK_FUNDAMENTAL_TYPE (arg->arg_type) == GTK_TYPE_STRING)
if (G_TYPE_FUNDAMENTAL (arg->arg_type) == G_TYPE_STRING)
g_free (arg->d.string_data);
g_free (arg);
}
......
......@@ -86,7 +86,7 @@ struct _GtkBindingSignal
struct _GtkBindingArg
{
GtkType arg_type;
GType arg_type;
union {
glong long_data;
gdouble double_data;
......
......@@ -38,7 +38,9 @@
#include <stdlib.h>
#include <time.h>
#include <stdio.h>
#include "gtkcalendar.h"
#include "gtkmarshalers.h"
#include "gdk/gdkkeysyms.h"
/***************************************************************************/
......@@ -307,27 +309,28 @@ static gint top_y_for_row (GtkCalendar *calendar,
static char *default_abbreviated_dayname[7];
static char *default_monthname[12];
GtkType
GType
gtk_calendar_get_type (void)
{
static GtkType calendar_type = 0;
static GType calendar_type = 0;
if (!calendar_type)
{
static const GTypeInfo calendar_info =
{
sizeof (GtkCalendarClass),
NULL, /* base_init */
NULL, /* base_finalize */
NULL, /* base_init */
NULL, /* base_finalize */
(GClassInitFunc) gtk_calendar_class_init,
NULL, /* class_finalize */
NULL, /* class_data */
NULL, /* class_finalize */
NULL, /* class_data */
sizeof (GtkCalendar),
16, /* n_preallocs */
0, /* n_preallocs */
(GInstanceInitFunc) gtk_calendar_init,
};
calendar_type = g_type_register_static (GTK_TYPE_WIDGET, "GtkCalendar", &calendar_info, 0);
calendar_type = g_type_register_static (GTK_TYPE_WIDGET, "GtkCalendar",
&calendar_info, 0);
}
return calendar_type;
......@@ -337,14 +340,12 @@ static void
gtk_calendar_class_init (GtkCalendarClass *class)
{
GObjectClass *gobject_class;
GtkObjectClass *object_class;
GtkWidgetClass *widget_class;
gobject_class = (GObjectClass*) class;
object_class = (GtkObjectClass*) class;
widget_class = (GtkWidgetClass*) class;
parent_class = gtk_type_class (GTK_TYPE_WIDGET);
parent_class = g_type_class_peek_parent (class);
gobject_class->finalize = gtk_calendar_finalize;
......@@ -370,40 +371,61 @@ gtk_calendar_class_init (GtkCalendarClass *class)
class->next_year = NULL;
gtk_calendar_signals[MONTH_CHANGED_SIGNAL] =
gtk_signal_new ("month_changed",
GTK_RUN_FIRST, GTK_CLASS_TYPE (object_class),
GTK_SIGNAL_OFFSET (GtkCalendarClass, month_changed),
gtk_signal_default_marshaller, GTK_TYPE_NONE, 0);
g_signal_new ("month_changed",
G_OBJECT_CLASS_TYPE (gobject_class),
G_SIGNAL_RUN_FIRST,
G_STRUCT_OFFSET (GtkCalendarClass, month_changed),
NULL, NULL,
_gtk_marshal_VOID__VOID,
G_TYPE_NONE, 0);
gtk_calendar_signals[DAY_SELECTED_SIGNAL] =
gtk_signal_new ("day_selected",
GTK_RUN_FIRST, GTK_CLASS_TYPE (object_class),
GTK_SIGNAL_OFFSET (GtkCalendarClass, day_selected),
gtk_signal_default_marshaller, GTK_TYPE_NONE, 0);
g_signal_new ("day_selected",
G_OBJECT_CLASS_TYPE (gobject_class),
G_SIGNAL_RUN_FIRST,
G_STRUCT_OFFSET (GtkCalendarClass, day_selected),
NULL, NULL,
_gtk_marshal_VOID__VOID,
G_TYPE_NONE, 0);
gtk_calendar_signals[DAY_SELECTED_DOUBLE_CLICK_SIGNAL] =
gtk_signal_new ("day_selected_double_click",
GTK_RUN_FIRST, GTK_CLASS_TYPE (object_class),
GTK_SIGNAL_OFFSET (GtkCalendarClass, day_selected_double_click),
gtk_signal_default_marshaller, GTK_TYPE_NONE, 0);
g_signal_new ("day_selected_double_click",
G_OBJECT_CLASS_TYPE (gobject_class),
G_SIGNAL_RUN_FIRST,
G_STRUCT_OFFSET (GtkCalendarClass, day_selected_double_click),
NULL, NULL,
_gtk_marshal_VOID__VOID,
G_TYPE_NONE, 0);
gtk_calendar_signals[PREV_MONTH_SIGNAL] =
gtk_signal_new ("prev_month",
GTK_RUN_FIRST, GTK_CLASS_TYPE (object_class),
GTK_SIGNAL_OFFSET (GtkCalendarClass, prev_month),
gtk_signal_default_marshaller, GTK_TYPE_NONE, 0);
g_signal_new ("prev_month",
G_OBJECT_CLASS_TYPE (gobject_class),
G_SIGNAL_RUN_FIRST,
G_STRUCT_OFFSET (GtkCalendarClass, prev_month),
NULL, NULL,
_gtk_marshal_VOID__VOID,
G_TYPE_NONE, 0);
gtk_calendar_signals[NEXT_MONTH_SIGNAL] =
gtk_signal_new ("next_month",
GTK_RUN_FIRST, GTK_CLASS_TYPE (object_class),
GTK_SIGNAL_OFFSET (GtkCalendarClass, next_month),
gtk_signal_default_marshaller, GTK_TYPE_NONE, 0);
g_signal_new ("next_month",
G_OBJECT_CLASS_TYPE (gobject_class),
G_SIGNAL_RUN_FIRST,
G_STRUCT_OFFSET (GtkCalendarClass, next_month),
NULL, NULL,
_gtk_marshal_VOID__VOID,
G_TYPE_NONE, 0);
gtk_calendar_signals[PREV_YEAR_SIGNAL] =
gtk_signal_new ("prev_year",
GTK_RUN_FIRST, GTK_CLASS_TYPE (object_class),
GTK_SIGNAL_OFFSET (GtkCalendarClass, prev_year),
gtk_signal_default_marshaller, GTK_TYPE_NONE, 0);
g_signal_new ("prev_year",
G_OBJECT_CLASS_TYPE (gobject_class),
G_SIGNAL_RUN_FIRST,
G_STRUCT_OFFSET (GtkCalendarClass, prev_year),
NULL, NULL,
_gtk_marshal_VOID__VOID,
G_TYPE_NONE, 0);
gtk_calendar_signals[NEXT_YEAR_SIGNAL] =
gtk_signal_new ("next_year",
GTK_RUN_FIRST, GTK_CLASS_TYPE (object_class),
GTK_SIGNAL_OFFSET (GtkCalendarClass, next_year),
gtk_signal_default_marshaller, GTK_TYPE_NONE, 0);
g_signal_new ("next_year",
G_OBJECT_CLASS_TYPE (gobject_class),
G_SIGNAL_RUN_FIRST,
G_STRUCT_OFFSET (GtkCalendarClass, next_year),
NULL, NULL,
_gtk_marshal_VOID__VOID,
G_TYPE_NONE, 0);
}
static void
......@@ -420,7 +442,7 @@ gtk_calendar_init (GtkCalendar *calendar)
widget = GTK_WIDGET (calendar);
GTK_WIDGET_SET_FLAGS (widget, GTK_CAN_FOCUS);
calendar->private_data = (gpointer) g_malloc (sizeof (GtkCalendarPrivateData));
calendar->private_data = g_malloc (sizeof (GtkCalendarPrivateData));
private_data = GTK_CALENDAR_PRIVATE_DATA (calendar);
if (!default_abbreviated_dayname[0])
......@@ -483,7 +505,7 @@ gtk_calendar_init (GtkCalendar *calendar)
GtkWidget*
gtk_calendar_new (void)
{
return GTK_WIDGET (gtk_type_new (GTK_TYPE_CALENDAR));
return g_object_new (GTK_TYPE_CALENDAR, NULL);
}
/* column_from_x: returns the column 0-6 that the
......@@ -645,10 +667,12 @@ gtk_calendar_set_month_prev (GtkCalendar *calendar)
gtk_calendar_freeze (calendar);
gtk_calendar_compute_days (calendar);
gtk_signal_emit (GTK_OBJECT (calendar),
gtk_calendar_signals[PREV_MONTH_SIGNAL]);
gtk_signal_emit (GTK_OBJECT (calendar),
gtk_calendar_signals[MONTH_CHANGED_SIGNAL]);
g_signal_emit (calendar,
gtk_calendar_signals[PREV_MONTH_SIGNAL],
0);
g_signal_emit (calendar,
gtk_calendar_signals[MONTH_CHANGED_SIGNAL],
0);
if (month_len < calendar->selected_day)
{
......@@ -688,10 +712,12 @@ gtk_calendar_set_month_next (GtkCalendar *calendar)
gtk_calendar_freeze (calendar);
gtk_calendar_compute_days (calendar);
gtk_signal_emit (GTK_OBJECT (calendar),
gtk_calendar_signals[NEXT_MONTH_SIGNAL]);
gtk_signal_emit (GTK_OBJECT (calendar),
gtk_calendar_signals[MONTH_CHANGED_SIGNAL]);
g_signal_emit (calendar,
gtk_calendar_signals[NEXT_MONTH_SIGNAL],
0);
g_signal_emit (calendar,
gtk_calendar_signals[MONTH_CHANGED_SIGNAL],
0);
month_len = month_length[leap (calendar->year)][calendar->month + 1];
......@@ -717,10 +743,12 @@ gtk_calendar_set_year_prev (GtkCalendar *calendar)
calendar->year--;
gtk_calendar_freeze (calendar);
gtk_calendar_compute_days (calendar);
gtk_signal_emit (GTK_OBJECT (calendar),
gtk_calendar_signals[PREV_YEAR_SIGNAL]);
gtk_signal_emit (GTK_OBJECT (calendar),
gtk_calendar_signals[MONTH_CHANGED_SIGNAL]);
g_signal_emit (calendar,
gtk_calendar_signals[PREV_YEAR_SIGNAL],
0);
g_signal_emit (calendar,
gtk_calendar_signals[MONTH_CHANGED_SIGNAL],
0);
month_len = month_length[leap (calendar->year)][calendar->month + 1];
......@@ -750,10 +778,12 @@ gtk_calendar_set_year_next (GtkCalendar *calendar)
calendar->year++;
gtk_calendar_compute_days (calendar);
gtk_signal_emit (GTK_OBJECT (calendar),
gtk_calendar_signals[NEXT_YEAR_SIGNAL]);
gtk_signal_emit (GTK_OBJECT (calendar),
gtk_calendar_signals[MONTH_CHANGED_SIGNAL]);
g_signal_emit (calendar,
gtk_calendar_signals[NEXT_YEAR_SIGNAL],
0);
g_signal_emit (calendar,
gtk_calendar_signals[MONTH_CHANGED_SIGNAL],
0);
month_len = month_length[leap (calendar->year)][calendar->month + 1];
......@@ -811,8 +841,9 @@ gtk_calendar_main_button (GtkWidget *widget,
else if (event->type == GDK_2BUTTON_PRESS)
{
if (day_month == MONTH_CURRENT)
gtk_signal_emit (GTK_OBJECT (calendar),
gtk_calendar_signals[DAY_SELECTED_DOUBLE_CLICK_SIGNAL]);
g_signal_emit (calendar,
gtk_calendar_signals[DAY_SELECTED_DOUBLE_CLICK_SIGNAL],
0);
}
}
......@@ -1125,9 +1156,9 @@ gtk_calendar_unrealize (GtkWidget *widget)
private_data->day_name_win = NULL;
}
if (calendar->xor_gc)
gdk_gc_unref (calendar->xor_gc);
g_object_unref (calendar->xor_gc);
if (calendar->gc)
gdk_gc_unref (calendar->gc);
g_object_unref (calendar->gc);
if (GTK_WIDGET_CLASS (parent_class)->unrealize)
(* GTK_WIDGET_CLASS (parent_class)->unrealize) (widget);
......@@ -1294,7 +1325,7 @@ gtk_calendar_size_request (GtkWidget *widget,
requisition->height = height + (widget->style->ythickness + INNER_BORDER) * 2;
g_object_unref (G_OBJECT (layout));
g_object_unref (layout);
}
static void
......@@ -1459,9 +1490,10 @@ gtk_calendar_paint_header (GtkWidget *widget)
max_year_width = private_data->max_year_width;
gdk_gc_set_foreground (gc, BACKGROUND_COLOR (GTK_WIDGET (calendar)));
gtk_draw_shadow (widget->style, private_data->header_win,
GTK_STATE_NORMAL, GTK_SHADOW_OUT,
0, 0, header_width, private_data->header_h);
gtk_paint_shadow (widget->style, private_data->header_win,
GTK_STATE_NORMAL, GTK_SHADOW_OUT,
NULL, widget, "calendar",
0, 0, header_width, private_data->header_h);
sprintf (buffer, "%d", calendar->year);
......@@ -1503,7 +1535,7 @@ gtk_calendar_paint_header (GtkWidget *widget)
gtk_calendar_paint_arrow (widget, ARROW_YEAR_LEFT);
gtk_calendar_paint_arrow (widget, ARROW_YEAR_RIGHT);
g_object_unref (G_OBJECT (layout));
g_object_unref (layout);
}
static void
......@@ -1600,7 +1632,7 @@ gtk_calendar_paint_day_names (GtkWidget *widget)
layout);
}
g_object_unref (G_OBJECT (layout));
g_object_unref (layout);
}
static void
......@@ -1695,7 +1727,7 @@ gtk_calendar_paint_week_numbers (GtkWidget *widget)
gdk_draw_layout (private_data->week_win, gc, x_loc, y_loc, layout);
}
g_object_unref (G_OBJECT (layout));
g_object_unref (layout);
}
static void
......@@ -1852,7 +1884,7 @@ gtk_calendar_paint_day (GtkWidget *widget,
day_height);
}
g_object_unref (G_OBJECT (layout));
g_object_unref (layout);
}
......@@ -2110,8 +2142,9 @@ gtk_calendar_select_month (GtkCalendar *calendar,
gtk_calendar_compute_days (calendar);
gtk_widget_queue_draw (GTK_WIDGET (calendar));
gtk_signal_emit (GTK_OBJECT (calendar),
gtk_calendar_signals[MONTH_CHANGED_SIGNAL]);
g_signal_emit (calendar,
gtk_calendar_signals[MONTH_CHANGED_SIGNAL],
0);
return TRUE;
}
......@@ -2144,8 +2177,9 @@ gtk_calendar_select_day (GtkCalendar *calendar,
gtk_calendar_paint_day_num (GTK_WIDGET (calendar), day);
}
gtk_signal_emit (GTK_OBJECT (calendar),
gtk_calendar_signals[DAY_SELECTED_SIGNAL]);
g_signal_emit (calendar,
gtk_calendar_signals[DAY_SELECTED_SIGNAL],
0);
}
static void
......@@ -2442,7 +2476,7 @@ gtk_calendar_paint_arrow (GtkWidget *widget,
gdk_window_clear (window);
gdk_window_set_background (window, &(widget)->style->bg[state]);
gdk_window_get_size (window, &width, &height);
gdk_drawable_get_size (window, &width, &height);
gdk_window_clear_area (window,
0,0,
width,height);
......
......@@ -30,9 +30,11 @@
#define __GTK_CALENDAR_H__
#include <gdk/gdk.h>
#include <gtk/gtksignal.h>
#include <gtk/gtkwidget.h>
/* Not needed, retained for compatibility -Yosh */
#include <gtk/gtksignal.h>
#ifdef __cplusplus
extern "C" {
......@@ -40,11 +42,11 @@ extern "C" {
#define GTK_TYPE_CALENDAR (gtk_calendar_get_type ())
#define GTK_CALENDAR(obj) (GTK_CHECK_CAST ((obj), GTK_TYPE_CALENDAR, GtkCalendar))
#define GTK_CALENDAR_CLASS(klass) (GTK_CHECK_CLASS_CAST ((klass), GTK_TYPE_CALENDAR, GtkCalendarClass))
#define GTK_IS_CALENDAR(obj) (GTK_CHECK_TYPE ((obj), GTK_TYPE_CALENDAR))
#define GTK_IS_CALENDAR_CLASS(klass) (GTK_CHECK_CLASS_TYPE ((klass), GTK_TYPE_CALENDAR))
#define GTK_CALENDAR_GET_CLASS(obj) (GTK_CHECK_GET_CLASS ((obj), GTK_TYPE_CALENDAR, GtkCalendarClass))
#define GTK_CALENDAR(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), GTK_TYPE_CALENDAR, GtkCalendar))
#define GTK_CALENDAR_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), GTK_TYPE_CALENDAR, GtkCalendarClass))
#define GTK_IS_CALENDAR(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), GTK_TYPE_CALENDAR))
#define GTK_IS_CALENDAR_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), GTK_TYPE_CALENDAR))
#define GTK_CALENDAR_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), GTK_TYPE_CALENDAR, GtkCalendarClass))
typedef struct _GtkCalendar GtkCalendar;
......@@ -113,7 +115,7 @@ struct _GtkCalendarClass
};
GtkType gtk_calendar_get_type (void) G_GNUC_CONST;
GType gtk_calendar_get_type (void) G_GNUC_CONST;
GtkWidget* gtk_calendar_new (void);
gboolean gtk_calendar_select_month (GtkCalendar *calendar,
......
......@@ -69,7 +69,6 @@
#include "gtkmain.h"
#include "gtkscrolledwindow.h"
#include "gtkstock.h"
#include "gtksignal.h"
#include "gtktreeselection.h"
#include "gtktreeview.h"
#include "gtkvbox.h"
......@@ -465,26 +464,29 @@ translate_win32_path (GtkFileSelection *filesel)
}
#endif
GtkType
GType
gtk_file_selection_get_type (void)
{
static GtkType file_selection_type = 0;
static GType file_selection_type = 0;
if (!file_selection_type)
{
static const GtkTypeInfo filesel_info =
static const GTypeInfo filesel_info =
{
"GtkFileSelection",
sizeof (GtkFileSelection),
sizeof (GtkFileSelectionClass),
(GtkClassInitFunc) gtk_file_selection_class_init,
(GtkObjectInitFunc) gtk_file_selection_init,
/* reserved_1 */ NULL,
/* reserved_2 */ NULL,
(GtkClassInitFunc) NULL,
NULL, /* base_init */
NULL, /* base_finalize */
(GClassInitFunc) gtk_file_selection_class_init,
NULL, /* class_finalize */
NULL, /* class_data */
sizeof (GtkFileSelection),
0, /* n_preallocs */
(GInstanceInitFunc) gtk_file_selection_init,
};
file_selection_type = gtk_type_unique (GTK_TYPE_DIALOG, &filesel_info);
file_selection_type =
g_type_register_static (GTK_TYPE_DIALOG, "GtkFileSelection",
&filesel_info, 0);
}
return file_selection_type;
......@@ -501,7 +503,7 @@ gtk_file_selection_class_init (GtkFileSelectionClass *class)
object_class = (GtkObjectClass*) class;
widget_class = (GtkWidgetClass*) class;
parent_class = gtk_type_class (GTK_TYPE_DIALOG);
parent_class = g_type_class_peek_parent (class);
gobject_class->finalize = gtk_file_selection_finalize;
gobject_class->set_property = gtk_file_selection_set_property;
......@@ -692,7 +694,8 @@ gtk_file_selection_init (GtkFileSelection *filesel)
gtk_tree_view_column_set_sizing (column, GTK_TREE_VIEW_COLUMN_AUTOSIZE);
gtk_tree_view_append_column (GTK_TREE_VIEW (filesel->dir_list), column);
gtk_widget_set_usize (filesel->dir_list, DIR_LIST_WIDTH, DIR_LIST_HEIGHT);
gtk_widget_set_size_request (filesel->dir_list,
DIR_LIST_WIDTH, DIR_LIST_HEIGHT);
g_signal_connect (filesel->dir_list, "row_activated",
G_CALLBACK (gtk_file_selection_dir_activate), filesel);
......@@ -727,7 +730,8 @@ gtk_file_selection_init (GtkFileSelection *filesel)
gtk_tree_view_column_set_sizing (column, GTK_TREE_VIEW_COLUMN_AUTOSIZE);
gtk_tree_view_append_column (GTK_TREE_VIEW (filesel->file_list), column);
gtk_widget_set_usize (filesel->file_list, FILE_LIST_WIDTH, FILE_LIST_HEIGHT);
gtk_widget_set_size_request (filesel->file_list,
FILE_LIST_WIDTH, FILE_LIST_HEIGHT);
g_signal_connect (filesel->file_list, "row_activated",
G_CALLBACK (gtk_file_selection_file_activate), filesel);
g_signal_connect (gtk_tree_view_get_selection (GTK_TREE_VIEW (filesel->file_list)), "changed",
......@@ -779,16 +783,16 @@ gtk_file_selection_init (GtkFileSelection *filesel)
gtk_widget_show (eventbox);
filesel->selection_entry = gtk_entry_new ();
gtk_signal_connect (GTK_OBJECT (filesel->selection_entry), "key_press_event",
(GtkSignalFunc) gtk_file_selection_key_press, filesel);
gtk_signal_connect (GTK_OBJECT (filesel->selection_entry), "insert_text",
(GtkSignalFunc) gtk_file_selection_insert_text, NULL);
gtk_signal_connect_object (GTK_OBJECT (filesel->selection_entry), "focus_in_event",
(GtkSignalFunc) grab_default,
GTK_OBJECT (filesel->ok_button));
gtk_signal_connect_object (GTK_OBJECT (filesel->selection_entry), "activate",
(GtkSignalFunc) gtk_button_clicked,
GTK_OBJECT (filesel->ok_button));
g_signal_connect (filesel->selection_entry, "key_press_event",
G_CALLBACK (gtk_file_selection_key_press), filesel);
g_signal_connect (filesel->selection_entry, "insert_text",
G_CALLBACK (gtk_file_selection_insert_text), NULL);
g_signal_connect_swapped (filesel->selection_entry, "focus_in_event",
G_CALLBACK (grab_default),
filesel->ok_button);
g_signal_connect_swapped (filesel->selection_entry, "activate",
G_CALLBACK (gtk_button_clicked),
filesel->ok_button);
gtk_box_pack_start (GTK_BOX (entry_vbox), filesel->selection_entry, TRUE, TRUE, 0);
gtk_widget_show (filesel->selection_entry);
......@@ -1023,8 +1027,8 @@ file_selection_setup_dnd (GtkFileSelection *filesel)
drop_types, n_drop_types,
GDK_ACTION_COPY);
gtk_signal_connect (GTK_OBJECT(filesel), "drag_data_received",
GTK_SIGNAL_FUNC(filenames_dropped), NULL);
g_signal_connect (filesel, "drag_data_received",
G_CALLBACK (filenames_dropped), NULL);
eventbox = gtk_widget_get_parent (filesel->selection_text);
gtk_drag_source_set (eventbox,
......@@ -1032,10 +1036,8 @@ file_selection_setup_dnd (GtkFileSelection *filesel)
drag_types, n_drag_types,
GDK_ACTION_COPY);
gtk_signal_connect (GTK_OBJECT (eventbox),
"drag_data_get",
GTK_SIGNAL_FUNC (filenames_drag_get),
filesel);
g_signal_connect (eventbox, "drag_data_get",
G_CALLBACK (filenames_drag_get), filesel);
}
GtkWidget*
......@@ -1043,7 +1045,7 @@ gtk_file_selection_new (const gchar *title)
{
GtkFileSelection *filesel;
filesel = gtk_type_new (GTK_TYPE_FILE_SELECTION);
filesel = g_object_new (GTK_TYPE_FILE_SELECTION, NULL);
gtk_window_set_title (GTK_WINDOW (filesel), title);
gtk_dialog_set_has_separator (GTK_DIALOG (filesel), FALSE);
......@@ -1061,9 +1063,9 @@ gtk_file_selection_show_fileop_buttons (GtkFileSelection *filesel)
if (!filesel->fileop_c_dir)
{
filesel->fileop_c_dir = gtk_button_new_with_mnemonic (_("_New Folder"));
gtk_signal_connect (GTK_OBJECT (filesel->fileop_c_dir), "clicked",