Commit dd29fa3c authored by Glynn Foster's avatar Glynn Foster Committed by Glynn Foster

* basep-widget.c: * basep-widget.h: * button-widget.c: * drawer-widget.c:

2001-11-18  Glynn Foster  <glynn.foster@sun.com>

	* applet.c: * basep-widget.c: * basep-widget.h: * button-widget.c:
	* button-widget.h: * drawer-widget.c: * drawer-widget.h:
	* drawer.c: * edge-widget.c: * edge-widget.h: * floating-widget.c:
	* floating-widget.h: * foobar-widget.c: * foobar-widget.h: * launcher.c:
	* logout.c: * main.c: * menu-util.c: * menu.c: * multiscreen-stuff.c:
	* panel-applet-frame.c: * panel-widget.c: * panel-widget.h: * panel.c:
	* panel_config.c: * session.c: * sliding-widget.c: * sliding-widget.h:

	Finish off moving GtkType to GType and give a more consistant approach
	to all the header stuff.
parent 758fe6e3
2001-11-18 Glynn Foster <glynn.foster@sun.com>
* applet.c: * basep-widget.c: * basep-widget.h: * button-widget.c:
* button-widget.h: * drawer-widget.c: * drawer-widget.h:
* drawer.c: * edge-widget.c: * edge-widget.h: * floating-widget.c:
* floating-widget.h: * foobar-widget.c: * foobar-widget.h: * launcher.c:
* logout.c: * main.c: * menu-util.c: * menu.c: * multiscreen-stuff.c:
* panel-applet-frame.c: * panel-widget.c: * panel-widget.h: * panel.c:
* panel_config.c: * session.c: * sliding-widget.c: * sliding-widget.h:
Finish off moving GtkType to GType and give a more consistant approach
to all the header stuff.
Sun Nov 18 00:52:58 2001 George Lebl <jirka@5z.com>
* Makefile.am, main.c: set the standard gnome program properties
......
......@@ -48,7 +48,7 @@ move_applet_callback (GtkWidget *widget, AppletInfo *info)
g_return_if_fail (info != NULL);
g_return_if_fail (info->widget != NULL);
g_return_if_fail (info->widget->parent != NULL);
g_return_if_fail (IS_PANEL_WIDGET (info->widget->parent));
g_return_if_fail (PANEL_IS_WIDGET (info->widget->parent));
panel = PANEL_WIDGET (info->widget->parent);
......@@ -651,7 +651,7 @@ applet_button_press (GtkWidget *widget,
return TRUE;
}
if (IS_BUTTON_WIDGET (widget))
if (BUTTON_IS_WIDGET (widget))
return FALSE;
else
return TRUE;
......@@ -801,7 +801,7 @@ panel_applet_register (GtkWidget *applet,
panel = PANEL_WIDGET(list->data);
}
if(IS_BUTTON_WIDGET (applet) || !GTK_WIDGET_NO_WINDOW(applet))
if(BUTTON_IS_WIDGET (applet) || !GTK_WIDGET_NO_WINDOW(applet))
gtk_signal_connect(GTK_OBJECT(applet),
"button_press_event",
GTK_SIGNAL_FUNC(applet_button_press),
......
......@@ -89,7 +89,7 @@ enum {
widget core
************************/
GType \
GType
basep_widget_get_type (void)
{
static GType object_type = 0;
......@@ -1009,7 +1009,7 @@ static void
reparent_button_widgets(GtkWidget *w, gpointer data)
{
GdkWindow *newwin = data;
if(IS_BUTTON_WIDGET(w)) {
if(BUTTON_IS_WIDGET(w)) {
ButtonWidget *button = BUTTON_WIDGET(w);
/* we can just reparent them all to 0,0 as the next thing
* that will happen is a queue_resize and on size allocate
......@@ -1245,7 +1245,7 @@ basep_widget_update_winhints (BasePWidget *basep)
}
/* drawers are always in DOCK, or NORMAL */
if ( IS_DRAWER_WIDGET(w) &&
if ( DRAWER_IS_WIDGET(w) &&
! global_config.normal_layer)
layer = WIN_LAYER_DOCK;
......@@ -1326,7 +1326,7 @@ basep_style_set (GtkWidget *widget, GtkStyle *previous_style)
basep = BASEP_WIDGET (widget);
g_return_if_fail (basep->panel != NULL);
g_return_if_fail (IS_PANEL_WIDGET (basep->panel));
g_return_if_fail (PANEL_IS_WIDGET (basep->panel));
panel = PANEL_WIDGET (basep->panel);
......@@ -1669,7 +1669,7 @@ basep_widget_set_hidebuttons (BasePWidget *basep)
* except for the drawers case that is */
if ((basep->state == BASEP_HIDDEN_LEFT ||
basep->state == BASEP_HIDDEN_RIGHT) &&
! IS_DRAWER_WIDGET (basep))
! DRAWER_IS_WIDGET (basep))
basep_widget_explicit_show (basep);
} else {
g_return_if_fail (klass && klass->set_hidebuttons);
......@@ -2261,7 +2261,7 @@ basep_calculate_borders (int screen)
g_assert (pd != NULL);
if ( ! IS_EDGE_WIDGET (pd->panel) &&
if ( ! EDGE_IS_WIDGET (pd->panel) &&
! IS_ALIGNED_WIDGET (pd->panel))
continue;
......@@ -2275,7 +2275,7 @@ basep_calculate_borders (int screen)
edge = BORDER_POS (basep->pos)->edge;
if (IS_EDGE_WIDGET (basep)) {
if (EDGE_IS_WIDGET (basep)) {
BasePState state = basep->state;
if (PANEL_WIDGET (basep->panel)->orient ==
PANEL_VERTICAL) {
......
......@@ -16,7 +16,7 @@ G_BEGIN_DECLS
#define BASEP_WIDGET_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), BASEP_TYPE_WIDGET, BasePWidgetClass))
#define BASEP_IS_WIDGET(object) (G_TYPE_CHECK_INSTANCE_TYPE ((object), BASEP_TYPE_WIDGET))
#define BASEP_IS_WIDGET_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), BASEP_TYPE_WIDGET))
#define BASEP_WIDGET_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), BASEP_TYPE_WIDGET, BasePWidgetClass))
#define BASEP_WIDGET_GET_CLASS(object) (G_TYPE_INSTANCE_GET_CLASS ((object), BASEP_TYPE_WIDGET, BasePWidgetClass))
#define BASEP_TYPE_POS (basep_pos_get_type ())
#define BASEP_POS(object) (G_TYPE_CHECK_INSTANCE_CAST((object), BASEP_TYPE_POS, BasePPos))
......
......@@ -22,7 +22,7 @@
extern GlobalConfig global_config;
static void button_widget_class_init (ButtonWidgetClass *klass);
static void button_widget_init (ButtonWidget *button);
static void button_widget_instance_init (ButtonWidget *button);
static void button_widget_size_request (GtkWidget *widget,
GtkRequisition *requisition);
static void button_widget_size_allocate (GtkWidget *widget,
......@@ -46,29 +46,32 @@ static void button_widget_unpressed (ButtonWidget *button);
/*list of all the button widgets*/
static GList *buttons = NULL;
static GtkWidgetClass *parent_class;
static GtkWidgetClass *button_widget_parent_class;
GType
button_widget_get_type (void)
{
static GType button_widget_type = 0;
static GType object_type = 0;
if (!button_widget_type) {
GtkTypeInfo button_widget_info = {
"ButtonWidget",
sizeof (ButtonWidget),
if (object_type == 0) {
static const GTypeInfo object_info = {
sizeof (ButtonWidgetClass),
(GtkClassInitFunc) button_widget_class_init,
(GtkObjectInitFunc) button_widget_init,
NULL,
NULL,
(GBaseInitFunc) NULL,
(GBaseFinalizeFunc) NULL,
(GClassInitFunc) button_widget_class_init,
NULL, /* class_finalize */
NULL, /* class_data */
sizeof (ButtonWidget),
0, /* n_preallocs */
(GInstanceInitFunc) button_widget_instance_init
};
button_widget_type = gtk_type_unique (GTK_TYPE_WIDGET,
&button_widget_info);
object_type = g_type_register_static (GTK_TYPE_WIDGET, "ButtonWidget", &object_info, 0);
button_widget_parent_class = g_type_class_ref (GTK_TYPE_WIDGET);
}
return button_widget_type;
return object_type;
}
enum {
......@@ -86,7 +89,6 @@ button_widget_class_init (ButtonWidgetClass *class)
GtkObjectClass *object_class = (GtkObjectClass*) class;
GtkWidgetClass *widget_class = (GtkWidgetClass*) class;
parent_class = gtk_type_class (GTK_TYPE_WIDGET);
button_widget_signals[CLICKED_SIGNAL] =
gtk_signal_new("clicked",
......@@ -265,7 +267,7 @@ button_widget_realize(GtkWidget *widget)
int x,y,w,h;
g_return_if_fail (widget != NULL);
g_return_if_fail (IS_BUTTON_WIDGET (widget));
g_return_if_fail (BUTTON_IS_WIDGET (widget));
panel = PANEL_WIDGET(widget->parent);
parent = panel->panel_parent;
......@@ -308,7 +310,7 @@ button_widget_unrealize (GtkWidget *widget)
ButtonWidget *button_widget;
g_return_if_fail (widget != NULL);
g_return_if_fail (IS_BUTTON_WIDGET (widget));
g_return_if_fail (BUTTON_IS_WIDGET (widget));
button_widget = BUTTON_WIDGET (widget);
......@@ -316,32 +318,32 @@ button_widget_unrealize (GtkWidget *widget)
gdk_window_destroy (button_widget->event_window);
button_widget->event_window = NULL;
if (GTK_WIDGET_CLASS (parent_class)->unrealize)
(* GTK_WIDGET_CLASS (parent_class)->unrealize) (widget);
if (GTK_WIDGET_CLASS (button_widget_parent_class)->unrealize)
(* GTK_WIDGET_CLASS (button_widget_parent_class)->unrealize) (widget);
}
static void
button_widget_map (GtkWidget *widget)
{
g_return_if_fail (widget != NULL);
g_return_if_fail (IS_BUTTON_WIDGET (widget));
g_return_if_fail (BUTTON_IS_WIDGET (widget));
if (GTK_WIDGET_REALIZED (widget) && !GTK_WIDGET_MAPPED (widget))
gdk_window_show (BUTTON_WIDGET (widget)->event_window);
GTK_WIDGET_CLASS (parent_class)->map (widget);
GTK_WIDGET_CLASS (button_widget_parent_class)->map (widget);
}
static void
button_widget_unmap (GtkWidget *widget)
{
g_return_if_fail (widget != NULL);
g_return_if_fail (IS_BUTTON_WIDGET (widget));
g_return_if_fail (BUTTON_IS_WIDGET (widget));
if (GTK_WIDGET_MAPPED (widget))
gdk_window_hide (BUTTON_WIDGET (widget)->event_window);
GTK_WIDGET_CLASS (parent_class)->unmap (widget);
GTK_WIDGET_CLASS (button_widget_parent_class)->unmap (widget);
}
static void
......@@ -531,7 +533,7 @@ void
button_widget_set_dnd_highlight(ButtonWidget *button, gboolean highlight)
{
g_return_if_fail (button != NULL);
g_return_if_fail (IS_BUTTON_WIDGET (button));
g_return_if_fail (BUTTON_IS_WIDGET (button));
if(button->dnd_highlight != highlight) {
button->dnd_highlight = highlight;
......@@ -552,7 +554,7 @@ button_widget_draw(ButtonWidget *button, guchar *rgb, int rowstride)
int size, off;
g_return_if_fail(button != NULL);
g_return_if_fail(IS_BUTTON_WIDGET(button));
g_return_if_fail(BUTTON_IS_WIDGET(button));
g_return_if_fail(rgb != NULL);
g_return_if_fail(rowstride >= 0);
......@@ -612,7 +614,7 @@ button_widget_draw_xlib(ButtonWidget *button, GdkPixmap *pixmap)
int off;
g_return_if_fail(button != NULL);
g_return_if_fail(IS_BUTTON_WIDGET(button));
g_return_if_fail(BUTTON_IS_WIDGET(button));
g_return_if_fail(pixmap != NULL);
widget = GTK_WIDGET(button);
......@@ -663,7 +665,7 @@ button_widget_size_allocate(GtkWidget *widget, GtkAllocation *allocation)
ButtonWidget *button_widget;
g_return_if_fail (widget != NULL);
g_return_if_fail (IS_BUTTON_WIDGET (widget));
g_return_if_fail (BUTTON_IS_WIDGET (widget));
button_widget = BUTTON_WIDGET (widget);
......@@ -684,7 +686,7 @@ button_widget_size_allocate(GtkWidget *widget, GtkAllocation *allocation)
static void
button_widget_init (ButtonWidget *button)
button_widget_instance_init (ButtonWidget *button)
{
buttons = g_list_prepend(buttons,button);
......@@ -715,7 +717,7 @@ pressed_timeout_func(gpointer data)
ButtonWidget *button;
g_return_val_if_fail (data != NULL, FALSE);
g_return_val_if_fail (IS_BUTTON_WIDGET (data), FALSE);
g_return_val_if_fail (BUTTON_IS_WIDGET (data), FALSE);
button = BUTTON_WIDGET (data);
......@@ -730,7 +732,7 @@ button_widget_button_press (GtkWidget *widget, GdkEventButton *event)
ButtonWidget *button;
g_return_val_if_fail (widget != NULL, FALSE);
g_return_val_if_fail (IS_BUTTON_WIDGET (widget), FALSE);
g_return_val_if_fail (BUTTON_IS_WIDGET (widget), FALSE);
g_return_val_if_fail (event != NULL, FALSE);
button = BUTTON_WIDGET (widget);
......@@ -751,7 +753,7 @@ static gboolean
button_widget_button_release (GtkWidget *widget, GdkEventButton *event)
{
g_return_val_if_fail (widget != NULL, FALSE);
g_return_val_if_fail (IS_BUTTON_WIDGET (widget), FALSE);
g_return_val_if_fail (BUTTON_IS_WIDGET (widget), FALSE);
g_return_val_if_fail (event != NULL, FALSE);
if (event->button == 1) {
......@@ -769,7 +771,7 @@ button_widget_enter_notify (GtkWidget *widget, GdkEventCrossing *event)
GtkWidget *event_widget;
g_return_val_if_fail (widget != NULL, FALSE);
g_return_val_if_fail (IS_BUTTON_WIDGET (widget), FALSE);
g_return_val_if_fail (BUTTON_IS_WIDGET (widget), FALSE);
g_return_val_if_fail (event != NULL, FALSE);
event_widget = gtk_get_event_widget ((GdkEvent*) event);
......@@ -795,7 +797,7 @@ button_widget_leave_notify (GtkWidget *widget, GdkEventCrossing *event)
ButtonWidget *button;
g_return_val_if_fail (widget != NULL, FALSE);
g_return_val_if_fail (IS_BUTTON_WIDGET (widget), FALSE);
g_return_val_if_fail (BUTTON_IS_WIDGET (widget), FALSE);
g_return_val_if_fail (event != NULL, FALSE);
event_widget = gtk_get_event_widget ((GdkEvent*) event);
......@@ -830,7 +832,7 @@ static void
button_widget_pressed(ButtonWidget *button)
{
g_return_if_fail(button != NULL);
g_return_if_fail(IS_BUTTON_WIDGET(button));
g_return_if_fail(BUTTON_IS_WIDGET(button));
button->pressed = TRUE;
if(button->cache)
......@@ -844,7 +846,7 @@ static void
button_widget_unpressed(ButtonWidget *button)
{
g_return_if_fail(button != NULL);
g_return_if_fail(IS_BUTTON_WIDGET(button));
g_return_if_fail(BUTTON_IS_WIDGET(button));
button->pressed = FALSE;
if(button->cache)
......@@ -861,7 +863,7 @@ void
button_widget_down(ButtonWidget *button)
{
g_return_if_fail(button != NULL);
g_return_if_fail(IS_BUTTON_WIDGET(button));
g_return_if_fail(BUTTON_IS_WIDGET(button));
if(!button->pressed)
gtk_signal_emit(GTK_OBJECT(button),
......@@ -871,7 +873,7 @@ void
button_widget_up(ButtonWidget *button)
{
g_return_if_fail(button != NULL);
g_return_if_fail(IS_BUTTON_WIDGET(button));
g_return_if_fail(BUTTON_IS_WIDGET(button));
if(button->pressed)
gtk_signal_emit(GTK_OBJECT(button),
......@@ -932,7 +934,7 @@ gboolean
button_widget_set_pixmap(ButtonWidget *button, const char *pixmap, int size)
{
g_return_val_if_fail(button != NULL, FALSE);
g_return_val_if_fail(IS_BUTTON_WIDGET(button), FALSE);
g_return_val_if_fail(BUTTON_IS_WIDGET(button), FALSE);
if (size < 0)
size = PANEL_WIDGET(GTK_WIDGET(button)->parent)->sz;
......@@ -965,7 +967,7 @@ void
button_widget_set_text(ButtonWidget *button, const char *text)
{
g_return_if_fail(button != NULL);
g_return_if_fail(IS_BUTTON_WIDGET(button));
g_return_if_fail(BUTTON_IS_WIDGET(button));
g_free(button->text);
button->text = text?g_strdup(text):NULL;
......@@ -985,7 +987,7 @@ button_widget_set_params(ButtonWidget *button,
PanelOrient orient)
{
g_return_if_fail(button != NULL);
g_return_if_fail(IS_BUTTON_WIDGET(button));
g_return_if_fail(BUTTON_IS_WIDGET(button));
g_return_if_fail(pobject >= 0);
g_return_if_fail(pobject < LAST_POBJECT);
......
......@@ -8,10 +8,11 @@
extern "C" {
#endif /* __cplusplus */
#define TYPE_BUTTON_WIDGET (button_widget_get_type ())
#define BUTTON_WIDGET(obj) GTK_CHECK_CAST (obj, button_widget_get_type (), ButtonWidget)
#define BUTTON_WIDGET_CLASS(klass) GTK_CHECK_CLASS_CAST (klass, button_widget_get_type (), ButtonWidgetClass)
#define IS_BUTTON_WIDGET(obj) GTK_CHECK_TYPE (obj, button_widget_get_type ())
#define BUTTON_TYPE_WIDGET (button_widget_get_type ())
#define BUTTON_WIDGET(object) (G_TYPE_CHECK_INSTANCE_CAST ((object), BUTTON_TYPE_WIDGET, ButtonWidget))
#define BUTTON_WIDGET_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass, BUTTON_TYPE_WIDGET, ButtonWidgetClass))
#define BUTTON_IS_WIDGET(object) (G_TYPE_CHECK_INSTANCE_TYPE ((object), BUTTON_TYPE_WIDGET))
#define BUTTON_IS_WIDGET_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), BUTTON_TYPE_WIDGET))
typedef struct _ButtonWidget ButtonWidget;
typedef struct _ButtonWidgetClass ButtonWidgetClass;
......
......@@ -20,7 +20,7 @@ extern int pw_minimized_size;
#undef DRAWER_WIDGET_DEBUG
static void drawer_pos_class_init (DrawerPosClass *klass);
static void drawer_pos_init (DrawerPos *pos);
static void drawer_pos_instance_init (DrawerPos *pos);
static void drawer_pos_set_hidebuttons (BasePWidget *basep);
static PanelOrient drawer_pos_get_applet_orient (BasePWidget *basep);
......@@ -49,30 +49,29 @@ static void drawer_pos_hidebutton_click (BasePWidget *basep);
static void drawer_pos_pre_convert_hook (BasePWidget *basep);
static BasePPosClass *parent_class;
static BasePPosClass *drawer_pos_parent_class;
GType
drawer_pos_get_type (void)
{
static GType drawer_pos_type = 0;
if (drawer_pos_type == 0) {
GtkTypeInfo drawer_pos_info = {
"DrawerPos",
sizeof (DrawerPos),
static GType object_type = 0;
if (object_type == 0) {
static const GTypeInfo object_info = {
sizeof (DrawerPosClass),
(GtkClassInitFunc) drawer_pos_class_init,
(GtkObjectInitFunc) drawer_pos_init,
NULL,
NULL,
NULL
(GBaseInitFunc) NULL,
(GBaseFinalizeFunc) NULL,
(GClassInitFunc) drawer_pos_class_init,
NULL, /* class_finalize */
NULL, /* class_data */
sizeof (DrawerPos),
0, /* n_preallocs */
(GInstanceInitFunc) drawer_pos_instance_init
};
drawer_pos_type = gtk_type_unique (BASEP_TYPE_POS,
&drawer_pos_info);
object_type = g_type_register_static (BASEP_TYPE_POS, "DrawerPos", &object_info, 0);
drawer_pos_parent_class = g_type_class_ref (BASEP_TYPE_POS);
}
return drawer_pos_type;
return object_type;
}
static void
......@@ -81,8 +80,6 @@ drawer_pos_class_init (DrawerPosClass *klass)
/*GtkObjectClass *object_class = GTK_OBJECT_CLASS(klass);*/
BasePPosClass *pos_class = BASEP_POS_CLASS(klass);
parent_class = gtk_type_class(BASEP_TYPE_POS);
/* fill out the virtual funcs */
pos_class->set_hidebuttons = drawer_pos_set_hidebuttons;
pos_class->get_applet_orient = drawer_pos_get_applet_orient;
......@@ -102,7 +99,7 @@ drawer_pos_class_init (DrawerPosClass *klass)
}
static void
drawer_pos_init (DrawerPos *pos) { }
drawer_pos_instance_init (DrawerPos *pos) { }
static void
drawer_pos_set_hidebuttons (BasePWidget *basep)
......@@ -480,8 +477,8 @@ drawer_widget_new (PanelOrient orient,
DrawerPos *pos;
PanelOrientation porient;
drawer = gtk_type_new (TYPE_DRAWER_WIDGET);
drawer->pos = gtk_type_new (TYPE_DRAWER_POS);
drawer = gtk_type_new (DRAWER_TYPE_WIDGET);
drawer->pos = gtk_type_new (DRAWER_TYPE_POS);
pos = DRAWER_POS (drawer->pos);
pos->orient = orient;
......
......@@ -13,18 +13,18 @@
G_BEGIN_DECLS
#define TYPE_DRAWER_POS (drawer_pos_get_type ())
#define DRAWER_POS(o) (GTK_CHECK_CAST ((o), TYPE_DRAWER_POS, DrawerPos))
#define DRAWER_POS_CLASS(k) (GTK_CHECK_CLASS_CAST ((k), DRAWER_POS_TYPE, DrawerPosClass))
#define IS_DRAWER_POS(o) (GTK_CHECK_TYPE ((o), TYPE_DRAWER_POS))
#define IS_DRAWER_POS_CLASS(k) (GTK_CHECK_CLASS_TYPE ((k), TYPE_DRAWER_POS))
#define TYPE_DRAWER_WIDGET (BASEP_TYPE_WIDGET)
#define DRAWER_WIDGET(o) (BASEP_WIDGET(o))
#define DRAWER_WIDGET_CLASS(k) (BASEP_WIDGET_CLASS(k))
#define IS_DRAWER_WIDGET(o) (BASEP_IS_WIDGET(o) && IS_DRAWER_POS(BASEP_WIDGET(o)->pos))
#define DRAWER_TYPE_POS (drawer_pos_get_type ())
#define DRAWER_POS(object) (G_TYPE_CHECK_INSTANCE_CAST ((object), DRAWER_TYPE_POS, DrawerPos))
#define DRAWER_POS_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), DRAWER_TYPE_POS, DrawerPosClass))
#define DRAWER_IS_POS(object) (G_TYPE_CHECK_INSTANCE_TYPE ((object), DRAWER_TYPE_POS))
#define DRAWER_IS_POS_CLASS(k) (G_TYPE_CHECK_CLASS_TYPE ((klass), DRAWER_TYPE_POS))
#define DRAWER_TYPE_WIDGET (BASEP_TYPE_WIDGET)
#define DRAWER_WIDGET(object) (BASEP_WIDGET(object))
#define DRAWER_WIDGET_CLASS(klass) (BASEP_WIDGET_CLASS(klass))
#define DRAWER_IS_WIDGET(object) (BASEP_IS_WIDGET(object) && DRAWER_IS_POS(BASEP_WIDGET(object)->pos))
/* this is not reliable */
#define IS_DRAWER_WIDGET_CLASS(k) (BASEP_IS_WIDGET_CLASS(k))
#define DRAWER_IS_WIDGET_CLASS(klass) (BASEP_IS_WIDGET_CLASS(klass))
typedef BasePWidget DrawerWidget;
typedef BasePWidgetClass DrawerWidgetClass;
......@@ -50,6 +50,7 @@ struct _DrawerPosClass {
};
GType drawer_pos_get_type (void) G_GNUC_CONST;
GtkWidget *drawer_widget_new (PanelOrient orient,
BasePMode mode,
BasePState state,
......
......@@ -453,7 +453,7 @@ load_drawer_applet (int mypanel_id, const char *pixmap, const char *tooltip,
drawer = create_empty_drawer_applet(tooltip, pixmap, orient);
if(drawer) panel_setup(drawer->drawer);
panels_to_sync = TRUE;
} else if ( ! IS_DRAWER_WIDGET (dr_pd->panel)) {
} else if ( ! DRAWER_IS_WIDGET (dr_pd->panel)) {
g_warning ("I found a bogus panel for a drawer, making a new one");
drawer = create_empty_drawer_applet(tooltip, pixmap, orient);
if(drawer) panel_setup(drawer->drawer);
......
......@@ -15,7 +15,7 @@ extern GlobalConfig global_config;
extern int pw_minimized_size;
static void edge_pos_class_init (EdgePosClass *klass);
static void edge_pos_init (EdgePos *pos);
static void edge_pos_instance_init (EdgePos *pos);
static void edge_pos_set_pos (BasePWidget *basep,
int x, int y,
......@@ -30,30 +30,31 @@ static void edge_pos_get_size (BasePWidget *basep,
static void edge_pos_pre_convert_hook (BasePWidget *basep);
static BorderPosClass *parent_class;
static BorderPosClass *edge_pos_parent_class;
GType
edge_pos_get_type (void)
{
static GType edge_pos_type = 0;
if (edge_pos_type == 0) {
GtkTypeInfo edge_pos_info = {
"EdgePos",
sizeof (EdgePos),
sizeof (EdgePosClass),
(GtkClassInitFunc) edge_pos_class_init,
(GtkObjectInitFunc) edge_pos_init,
NULL,
NULL,
NULL
static GType object_type = 0;
if (object_type == 0) {
static const GTypeInfo object_info = {
sizeof (EdgePosClass),
(GBaseInitFunc) NULL,
(GBaseFinalizeFunc) NULL,
(GClassInitFunc) edge_pos_class_init,
NULL, /* class_finalize */
NULL, /* class_data */
sizeof (EdgePos),
0, /* n_preallocs */
(GInstanceInitFunc) edge_pos_instance_init
};
edge_pos_type = gtk_type_unique (BORDER_TYPE_POS,
&edge_pos_info);
object_type = g_type_register_static (BORDER_TYPE_POS, "EdgePos", &object_info, 0);
edge_pos_parent_class = g_type_class_ref (BORDER_TYPE_POS);
}
return edge_pos_type;
return object_type;
}
static void
......@@ -61,7 +62,6 @@ edge_pos_class_init (EdgePosClass *klass)
{
BasePPosClass *pos_class = BASEP_POS_CLASS(klass);
parent_class = gtk_type_class(BORDER_TYPE_POS);
pos_class->set_pos = edge_pos_set_pos;
pos_class->get_pos = edge_pos_get_pos;
......@@ -70,7 +70,7 @@ edge_pos_class_init (EdgePosClass *klass)
}
static void
edge_pos_init (EdgePos *pos) { }
edge_pos_instance_init (EdgePos *pos) { }
static void
edge_pos_set_pos (BasePWidget *basep,
......@@ -214,10 +214,10 @@ edge_widget_new (int screen,
gboolean rotate_pixmap_bg,
GdkColor *back_color)
{
EdgeWidget *edgew = gtk_type_new (TYPE_EDGE_WIDGET);
EdgeWidget *edgew = gtk_type_new (EDGE_TYPE_WIDGET);
BasePWidget *basep = BASEP_WIDGET (edgew);
basep->pos = gtk_type_new (TYPE_EDGE_POS);
basep->pos = gtk_type_new (EDGE_TYPE_POS);
border_widget_construct (BORDER_WIDGET (basep),
screen,
......
......@@ -17,18 +17,18 @@ G_BEGIN_DECLS
since we do need a seperate GtkType
*/
#define TYPE_EDGE_POS (edge_pos_get_type ())
#define EDGE_POS(o) (GTK_CHECK_CAST ((o), TYPE_EDGE_POS, EdgePos))
#define EDGE_POS_CLASS(k) (GTK_CHECK_CLASS_CAST ((k), TYPE_EDGE_POS, EdgePosClass))
#define IS_EDGE_POS(o) (GTK_CHECK_TYPE ((o), TYPE_EDGE_POS))
#define IS_EDGE_POS_CLASS(k) (GTK_CHECK_CLASS_TYPE ((k), TYPE_EDGE_POS))
#define EDGE_TYPE_POS (edge_pos_get_type ())
#define EDGE_POS(object) (G_TYPE_CHECK_INSTANCE_CAST ((object), EDGE_TYPE_POS, EdgePos))
#define EDGE_POS_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), EDGE_TYPE_POS, EdgePosClass))
#define EDGE_IS_POS(object) (G_TYPE_CHECK_INSTANCE_TYPE ((object), EDGE_TYPE_POS))
#define EDGE_IS_POS_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), EDGE_TYPE_POS))
#define TYPE_EDGE_WIDGET (BORDER_TYPE_WIDGET)
#define EDGE_WIDGET(o) (BORDER_WIDGET(o))
#define EDGE_WIDGET_CLASS(k) (BORDER_WIDGET_CLASS(k))
#define IS_EDGE_WIDGET(o) (BORDER_IS_WIDGET(o) && IS_EDGE_POS(BASEP_WIDGET(o)->pos))
#define EDGE_TYPE_WIDGET (BORDER_TYPE_WIDGET)
#define EDGE_WIDGET(object) (BORDER_WIDGET(object))
#define EDGE_WIDGET_CLASS(klass) (BORDER_WIDGET_CLASS(klass))
#define EDGE_IS_WIDGET(object) (BORDER_IS_WIDGET(object) && EDGE_IS_POS(BASEP_WIDGET(object)->pos))
/* this is not reliable */
#define IS_EDGE_WIDGET_CLASS(k) (BORDER_IS_WIDGET_CLASS(k))
#define EDGE_IS_WIDGET_CLASS(klass) (BORDER_IS_WIDGET_CLASS(klass))
typedef BorderWidget EdgeWidget;
typedef BorderWidgetClass EdgeWidgetClass;
......@@ -45,6 +45,7 @@ struct _EdgePosClass {
};
GType edge_pos_get_type (void) G_GNUC_CONST;
GtkWidget *edge_widget_new (int screen,
BorderEdge edge,
BasePMode mode,
......
......@@ -17,7 +17,7 @@
#include "multiscreen-stuff.h"
static void floating_pos_class_init (FloatingPosClass *klass);
static void floating_pos_init (FloatingPos *pos);
static void floating_pos_instance_init (FloatingPos *pos);
static void floating_pos_set_hidebuttons (BasePWidget *basep);
static PanelOrient floating_pos_get_applet_orient (BasePWidget *basep);
......@@ -53,30 +53,31 @@ static void floating_pos_pre_convert_hook (BasePWidget *basep);
static void floating_pos_show_hide_left (BasePWidget *basep);
static void floating_pos_show_hide_right (BasePWidget *basep);
static BasePPosClass *parent_class;
static BasePPosClass *floating_pos_parent_class;
GType
floating_pos_get_type (void)
{
static GType floating_pos_type = 0;
if (floating_pos_type == 0) {
GtkTypeInfo floating_pos_info = {
"FloatingPos",
sizeof (FloatingPos),
sizeof (FloatingPosClass),
(GtkClassInitFunc) floating_pos_class_init,
(GtkObjectInitFunc) floating_pos_init,
NULL,
NULL,
NULL
static GType object_type= 0;
if (object_type == 0) {
static const GTypeInfo object_info = {
sizeof (FloatingPosClass),
(GBaseInitFunc) NULL,
(GBaseFinalizeFunc) NULL,
(GClassInitFunc) floating_pos_class_init,
NULL, /* class_finalize */
NULL, /* class_data */
sizeof (FloatingPos),
0, /* n_preallocs */
(GInstanceInitFunc) floating_pos_instance_init
};
floating_pos_type = gtk_type_unique (BASEP_TYPE_POS,
&floating_pos_info);
object_type = g_type_register_static (BASEP_TYPE_POS, "FloatingPos", &object_info, 0);
floating_pos_parent_class = g_type_class_ref (BASEP_TYPE_POS);
}
return floating_pos_type;
return object_type;
}
enum {
......@@ -91,8 +92,6 @@ floating_pos_class_init (FloatingPosClass *klass)
GtkObjectClass *object_class = GTK_OBJECT_CLASS(klass);
BasePPosClass *pos_class = BASEP_POS_CLASS(klass);
parent_class = gtk_type_class(BASEP_TYPE_POS);
floating_pos_signals[COORDS_CHANGE_SIGNAL] =
gtk_signal_new ("floating_coords_change",
GTK_RUN_LAST,
......@@ -120,7 +119,7 @@ floating_pos_class_init (FloatingPosClass *klass)
}
static void
floating_pos_init (FloatingPos *pos) { }
floating_pos_instance_init (FloatingPos *pos) { }
static void
floating_pos_set_hidebuttons (BasePWidget *basep)
......@@ -539,8 +538,8 @@ floating_widget_new (int screen,
FloatingWidget *floating;
FloatingPos *pos;
floating = gtk_type_new (TYPE_FLOATING_WIDGET);
floating->pos = gtk_type_new (TYPE_FLOATING_POS);
floating = gtk_type_new (FLOATING_TYPE_WIDGET);
floating->pos = gtk_type_new (FLOATING_TYPE_POS);
pos = FLOATING_POS (floating->pos);
pos->x = x;
......
......@@ -11,18 +11,18 @@
G_BEGIN_DECLS
#define TYPE_FLOATING_POS (floating_pos_get_type ())
#define FLOATING_POS(o) (GTK_CHECK_CAST ((o), TYPE_FLOATING_POS, FloatingPos))