Commit 7aee9ea6 authored by Raja R Harinath's avatar Raja R Harinath

Remove defines. `glib' provides the same thing as GINT_TO_POINTER,

* panel.h (ITOP,PTOI): Remove defines.  `glib' provides the same
thing as GINT_TO_POINTER, GPOINTER_TO_INT.
* main.c: s/PTOI/GPOINTER_TO_INT/, s/ITOP/GINT_TO_POINTER/.
* menu.c: Likewise.
* panel.c: Likewise.
* panel_config.c: Likewise.
* applet-lib.cc: Likewise.
parent eb388eb8
1998-07-15 Raja R Harinath <harinath@cs.umn.edu> 1998-07-15 Raja R Harinath <harinath@cs.umn.edu>
* panel.h (ITOP,PTOI): Remove defines. `glib' provides the same
thing as GINT_TO_POINTER, GPOINTER_TO_INT.
* main.c: s/PTOI/GPOINTER_TO_INT/, s/ITOP/GINT_TO_POINTER/.
* menu.c: Likewise.
* panel.c: Likewise.
* panel_config.c: Likewise.
* applet-lib.cc: Likewise.
* mico-glue.cc (panel_corba_gtk_main_quit): Give a parameter to * mico-glue.cc (panel_corba_gtk_main_quit): Give a parameter to
orb->shutdown(). orb->shutdown().
* applet-lib.cc (applet_corba_gtk_main_quit): Likewise. * applet-lib.cc (applet_corba_gtk_main_quit): Likewise.
......
1998-07-15 Raja R Harinath <harinath@cs.umn.edu> 1998-07-15 Raja R Harinath <harinath@cs.umn.edu>
* panel.h (ITOP,PTOI): Remove defines. `glib' provides the same
thing as GINT_TO_POINTER, GPOINTER_TO_INT.
* main.c: s/PTOI/GPOINTER_TO_INT/, s/ITOP/GINT_TO_POINTER/.
* menu.c: Likewise.
* panel.c: Likewise.
* panel_config.c: Likewise.
* applet-lib.cc: Likewise.
* mico-glue.cc (panel_corba_gtk_main_quit): Give a parameter to * mico-glue.cc (panel_corba_gtk_main_quit): Give a parameter to
orb->shutdown(). orb->shutdown().
* applet-lib.cc (applet_corba_gtk_main_quit): Likewise. * applet-lib.cc (applet_corba_gtk_main_quit): Likewise.
......
...@@ -319,7 +319,7 @@ gnome_panel_applet_unregister_callback_dir(int applet_id, ...@@ -319,7 +319,7 @@ gnome_panel_applet_unregister_callback_dir(int applet_id,
static int static int
applet_event(GtkWidget *widget, GdkEvent *event, gpointer data) applet_event(GtkWidget *widget, GdkEvent *event, gpointer data)
{ {
int ourid = PTOI(data); int ourid = GPOINTER_TO_INT(data);
GdkEventButton *bevent; GdkEventButton *bevent;
int in_drag; int in_drag;
...@@ -405,7 +405,7 @@ bind_top_applet_events(GtkWidget *widget, int applet_id) ...@@ -405,7 +405,7 @@ bind_top_applet_events(GtkWidget *widget, int applet_id)
gtk_signal_connect(GTK_OBJECT(widget), gtk_signal_connect(GTK_OBJECT(widget),
"event", "event",
GTK_SIGNAL_FUNC(applet_event), GTK_SIGNAL_FUNC(applet_event),
ITOP(applet_id)); GINT_TO_POINTER(applet_id));
if (GTK_IS_CONTAINER(widget)) if (GTK_IS_CONTAINER(widget))
gtk_container_foreach (GTK_CONTAINER (widget), gtk_container_foreach (GTK_CONTAINER (widget),
......
...@@ -779,7 +779,7 @@ orientation_change(int applet_id, PanelWidget *panel) ...@@ -779,7 +779,7 @@ orientation_change(int applet_id, PanelWidget *panel)
static void static void
orient_change_foreach(gpointer data, gpointer user_data) orient_change_foreach(gpointer data, gpointer user_data)
{ {
int applet_id = PTOI(gtk_object_get_user_data(GTK_OBJECT(data))); int applet_id = GPOINTER_TO_INT(gtk_object_get_user_data(GTK_OBJECT(data)));
PanelWidget *panel = user_data; PanelWidget *panel = user_data;
orientation_change(applet_id,panel); orientation_change(applet_id,panel);
...@@ -843,7 +843,7 @@ back_change(int applet_id, ...@@ -843,7 +843,7 @@ back_change(int applet_id,
static void static void
back_change_foreach(gpointer data, gpointer user_data) back_change_foreach(gpointer data, gpointer user_data)
{ {
int applet_id = PTOI(gtk_object_get_user_data(GTK_OBJECT(data))); int applet_id = GPOINTER_TO_INT(gtk_object_get_user_data(GTK_OBJECT(data)));
PanelWidget *panel = user_data; PanelWidget *panel = user_data;
back_change(applet_id,panel); back_change(applet_id,panel);
...@@ -866,7 +866,7 @@ static void state_hide_foreach(gpointer data, gpointer user_data); ...@@ -866,7 +866,7 @@ static void state_hide_foreach(gpointer data, gpointer user_data);
static void static void
state_restore_foreach(gpointer data, gpointer user_data) state_restore_foreach(gpointer data, gpointer user_data)
{ {
int applet_id = PTOI(gtk_object_get_user_data(GTK_OBJECT(data))); int applet_id = GPOINTER_TO_INT(gtk_object_get_user_data(GTK_OBJECT(data)));
AppletInfo *info = get_applet_info(applet_id); AppletInfo *info = get_applet_info(applet_id);
if(info->type == APPLET_DRAWER) { if(info->type == APPLET_DRAWER) {
...@@ -888,7 +888,7 @@ state_restore_foreach(gpointer data, gpointer user_data) ...@@ -888,7 +888,7 @@ state_restore_foreach(gpointer data, gpointer user_data)
static void static void
state_hide_foreach(gpointer data, gpointer user_data) state_hide_foreach(gpointer data, gpointer user_data)
{ {
int applet_id = PTOI(gtk_object_get_user_data(GTK_OBJECT(data))); int applet_id = GPOINTER_TO_INT(gtk_object_get_user_data(GTK_OBJECT(data)));
AppletInfo *info = get_applet_info(applet_id); AppletInfo *info = get_applet_info(applet_id);
if(info->type == APPLET_DRAWER) { if(info->type == APPLET_DRAWER) {
...@@ -978,7 +978,7 @@ panel_size_allocate(GtkWidget *widget, GtkAllocation *alloc, gpointer data) ...@@ -978,7 +978,7 @@ panel_size_allocate(GtkWidget *widget, GtkAllocation *alloc, gpointer data)
static int static int
panel_applet_added_idle(gpointer data) panel_applet_added_idle(gpointer data)
{ {
int applet_id = PTOI(data); int applet_id = GPOINTER_TO_INT(data);
AppletInfo *info = get_applet_info(applet_id); AppletInfo *info = get_applet_info(applet_id);
PanelWidget *panel = gtk_object_get_data(GTK_OBJECT(info->widget), PanelWidget *panel = gtk_object_get_data(GTK_OBJECT(info->widget),
PANEL_APPLET_PARENT_KEY); PANEL_APPLET_PARENT_KEY);
...@@ -993,7 +993,7 @@ panel_applet_added_idle(gpointer data) ...@@ -993,7 +993,7 @@ panel_applet_added_idle(gpointer data)
static void static void
panel_applet_added(GtkWidget *widget, GtkWidget *applet, gpointer data) panel_applet_added(GtkWidget *widget, GtkWidget *applet, gpointer data)
{ {
int applet_id = PTOI(gtk_object_get_user_data(GTK_OBJECT(applet))); int applet_id = GPOINTER_TO_INT(gtk_object_get_user_data(GTK_OBJECT(applet)));
AppletInfo *info = get_applet_info(applet_id); AppletInfo *info = get_applet_info(applet_id);
GtkWidget *panelw = gtk_object_get_data(GTK_OBJECT(widget), GtkWidget *panelw = gtk_object_get_data(GTK_OBJECT(widget),
PANEL_PARENT); PANEL_PARENT);
...@@ -1019,13 +1019,13 @@ panel_applet_added(GtkWidget *widget, GtkWidget *applet, gpointer data) ...@@ -1019,13 +1019,13 @@ panel_applet_added(GtkWidget *widget, GtkWidget *applet, gpointer data)
snapped_widget_queue_pop_down(SNAPPED_WIDGET(panelw)); snapped_widget_queue_pop_down(SNAPPED_WIDGET(panelw));
} }
gtk_idle_add(panel_applet_added_idle,ITOP(applet_id)); gtk_idle_add(panel_applet_added_idle,GINT_TO_POINTER(applet_id));
} }
static void static void
count_open_drawers(gpointer data, gpointer user_data) count_open_drawers(gpointer data, gpointer user_data)
{ {
int applet_id = PTOI(gtk_object_get_user_data(GTK_OBJECT(data))); int applet_id = GPOINTER_TO_INT(gtk_object_get_user_data(GTK_OBJECT(data)));
AppletInfo *info = get_applet_info(applet_id); AppletInfo *info = get_applet_info(applet_id);
int *count = user_data; int *count = user_data;
if(info->type == APPLET_DRAWER && if(info->type == APPLET_DRAWER &&
...@@ -1263,7 +1263,7 @@ panel_destroy(GtkWidget *widget, gpointer data) ...@@ -1263,7 +1263,7 @@ panel_destroy(GtkWidget *widget, gpointer data)
PanelWidget *panel = PANEL_WIDGET(DRAWER_WIDGET(widget)->panel); PanelWidget *panel = PANEL_WIDGET(DRAWER_WIDGET(widget)->panel);
if(panel->master_widget) { if(panel->master_widget) {
int applet_id = int applet_id =
PTOI(gtk_object_get_user_data(GTK_OBJECT(panel->master_widget))); GPOINTER_TO_INT(gtk_object_get_user_data(GTK_OBJECT(panel->master_widget)));
AppletInfo *info = get_applet_info(applet_id); AppletInfo *info = get_applet_info(applet_id);
info->assoc = NULL; info->assoc = NULL;
panel_clean_applet(applet_id); panel_clean_applet(applet_id);
...@@ -1286,7 +1286,7 @@ panel_destroy(GtkWidget *widget, gpointer data) ...@@ -1286,7 +1286,7 @@ panel_destroy(GtkWidget *widget, gpointer data)
static void static void
applet_move_foreach(gpointer data, gpointer user_data) applet_move_foreach(gpointer data, gpointer user_data)
{ {
int applet_id = PTOI(gtk_object_get_user_data(GTK_OBJECT(data))); int applet_id = GPOINTER_TO_INT(gtk_object_get_user_data(GTK_OBJECT(data)));
AppletInfo *info = get_applet_info(applet_id); AppletInfo *info = get_applet_info(applet_id);
if(info->type == APPLET_DRAWER) { if(info->type == APPLET_DRAWER) {
......
...@@ -754,7 +754,7 @@ create_applets_menu(int fake_submenus) ...@@ -754,7 +754,7 @@ create_applets_menu(int fake_submenus)
static void static void
create_new_panel(GtkWidget *w,gpointer data) create_new_panel(GtkWidget *w,gpointer data)
{ {
PanelType type = PTOI(data); PanelType type = GPOINTER_TO_INT(data);
GdkColor bcolor = {0,0,0,1}; GdkColor bcolor = {0,0,0,1};
GtkWidget *panel; GtkWidget *panel;
......
...@@ -555,7 +555,7 @@ set_back (GtkWidget *widget, gpointer data) ...@@ -555,7 +555,7 @@ set_back (GtkWidget *widget, gpointer data)
{ {
GtkWidget *pixf,*colf; GtkWidget *pixf,*colf;
PerPanelConfig *ppc = gtk_object_get_user_data(GTK_OBJECT(widget)); PerPanelConfig *ppc = gtk_object_get_user_data(GTK_OBJECT(widget));
PanelBackType back_type = PTOI(data); PanelBackType back_type = GPOINTER_TO_INT(data);
if(!GTK_TOGGLE_BUTTON(widget)->active) if(!GTK_TOGGLE_BUTTON(widget)->active)
return FALSE; return FALSE;
...@@ -699,13 +699,13 @@ background_page (PerPanelConfig *ppc) ...@@ -699,13 +699,13 @@ background_page (PerPanelConfig *ppc)
gtk_signal_connect (GTK_OBJECT (ppc->non), "toggled", gtk_signal_connect (GTK_OBJECT (ppc->non), "toggled",
GTK_SIGNAL_FUNC (set_back), GTK_SIGNAL_FUNC (set_back),
ITOP(PANEL_BACK_NONE)); GINT_TO_POINTER(PANEL_BACK_NONE));
gtk_signal_connect (GTK_OBJECT (ppc->pix), "toggled", gtk_signal_connect (GTK_OBJECT (ppc->pix), "toggled",
GTK_SIGNAL_FUNC (set_back), GTK_SIGNAL_FUNC (set_back),
ITOP(PANEL_BACK_PIXMAP)); GINT_TO_POINTER(PANEL_BACK_PIXMAP));
gtk_signal_connect (GTK_OBJECT (ppc->col), "toggled", gtk_signal_connect (GTK_OBJECT (ppc->col), "toggled",
GTK_SIGNAL_FUNC (set_back), GTK_SIGNAL_FUNC (set_back),
ITOP(PANEL_BACK_COLOR)); GINT_TO_POINTER(PANEL_BACK_COLOR));
if(ppc->back_type == PANEL_BACK_NONE) if(ppc->back_type == PANEL_BACK_NONE)
gtk_toggle_button_set_state (GTK_TOGGLE_BUTTON (ppc->non), TRUE); gtk_toggle_button_set_state (GTK_TOGGLE_BUTTON (ppc->non), TRUE);
......
...@@ -445,7 +445,7 @@ panel_quit(void) ...@@ -445,7 +445,7 @@ panel_quit(void)
static void static void
move_applet_callback(GtkWidget *widget, gpointer data) move_applet_callback(GtkWidget *widget, gpointer data)
{ {
AppletInfo *info = get_applet_info(PTOI(data)); AppletInfo *info = get_applet_info(GPOINTER_TO_INT(data));
PanelWidget *panel; PanelWidget *panel;
g_return_if_fail(info != NULL); g_return_if_fail(info != NULL);
...@@ -531,7 +531,7 @@ panel_clean_applet(int applet_id) ...@@ -531,7 +531,7 @@ panel_clean_applet(int applet_id)
static void static void
remove_applet_callback(GtkWidget *widget, gpointer data) remove_applet_callback(GtkWidget *widget, gpointer data)
{ {
panel_clean_applet(PTOI(data)); panel_clean_applet(GPOINTER_TO_INT(data));
} }
static void static void
...@@ -745,7 +745,7 @@ create_applet_menu(AppletInfo *info) ...@@ -745,7 +745,7 @@ create_applet_menu(AppletInfo *info)
setup_menuitem(menuitem,NULL,_("Remove from panel")); setup_menuitem(menuitem,NULL,_("Remove from panel"));
gtk_signal_connect(GTK_OBJECT(menuitem), "activate", gtk_signal_connect(GTK_OBJECT(menuitem), "activate",
(GtkSignalFunc) remove_applet_callback, (GtkSignalFunc) remove_applet_callback,
ITOP(info->applet_id)); GINT_TO_POINTER(info->applet_id));
gtk_menu_append(GTK_MENU(info->menu), menuitem); gtk_menu_append(GTK_MENU(info->menu), menuitem);
info->remove_item = menuitem; info->remove_item = menuitem;
...@@ -753,7 +753,7 @@ create_applet_menu(AppletInfo *info) ...@@ -753,7 +753,7 @@ create_applet_menu(AppletInfo *info)
setup_menuitem(menuitem,NULL,_("Move applet")); setup_menuitem(menuitem,NULL,_("Move applet"));
gtk_signal_connect(GTK_OBJECT(menuitem), "activate", gtk_signal_connect(GTK_OBJECT(menuitem), "activate",
(GtkSignalFunc) move_applet_callback, (GtkSignalFunc) move_applet_callback,
ITOP(info->applet_id)); GINT_TO_POINTER(info->applet_id));
gtk_menu_append(GTK_MENU(info->menu), menuitem); gtk_menu_append(GTK_MENU(info->menu), menuitem);
if(user_menu) { if(user_menu) {
...@@ -779,7 +779,7 @@ static void ...@@ -779,7 +779,7 @@ static void
applet_menu_position (GtkMenu *menu, int *x, int *y, gpointer data) applet_menu_position (GtkMenu *menu, int *x, int *y, gpointer data)
{ {
int wx, wy; int wx, wy;
AppletInfo *info = get_applet_info(PTOI(data)); AppletInfo *info = get_applet_info(GPOINTER_TO_INT(data));
PanelWidget *panel; PanelWidget *panel;
GtkWidget *w; /*the panel window widget*/ GtkWidget *w; /*the panel window widget*/
...@@ -887,7 +887,7 @@ show_applet_menu(int applet_id, GdkEventButton *event) ...@@ -887,7 +887,7 @@ show_applet_menu(int applet_id, GdkEventButton *event)
snapped_widget_queue_pop_down(SNAPPED_WIDGET(panel)); snapped_widget_queue_pop_down(SNAPPED_WIDGET(panel));
} }
gtk_menu_popup(GTK_MENU(info->menu), NULL, NULL, applet_menu_position, gtk_menu_popup(GTK_MENU(info->menu), NULL, NULL, applet_menu_position,
ITOP(applet_id), event->button, event->time); GINT_TO_POINTER(applet_id), event->button, event->time);
} }
...@@ -897,7 +897,7 @@ applet_button_press(GtkWidget *widget,GdkEventButton *event, gpointer data) ...@@ -897,7 +897,7 @@ applet_button_press(GtkWidget *widget,GdkEventButton *event, gpointer data)
{ {
if(event->button==3) { if(event->button==3) {
if(!panel_applet_in_drag) if(!panel_applet_in_drag)
show_applet_menu(PTOI(data), event); show_applet_menu(GPOINTER_TO_INT(data), event);
return TRUE; return TRUE;
} }
return FALSE; return FALSE;
...@@ -925,7 +925,7 @@ applet_show_menu(int applet_id) ...@@ -925,7 +925,7 @@ applet_show_menu(int applet_id)
} }
gtk_menu_popup(GTK_MENU(info->menu), NULL, NULL, applet_menu_position, gtk_menu_popup(GTK_MENU(info->menu), NULL, NULL, applet_menu_position,
ITOP(applet_id), 0/*3*/, time(NULL)); GINT_TO_POINTER(applet_id), 0/*3*/, time(NULL));
gtk_grab_add(info->menu); gtk_grab_add(info->menu);
gdk_pointer_grab(info->menu->window, gdk_pointer_grab(info->menu->window,
TRUE, TRUE,
...@@ -1246,7 +1246,7 @@ applet_set_tooltip(int applet_id, const char *tooltip) ...@@ -1246,7 +1246,7 @@ applet_set_tooltip(int applet_id, const char *tooltip)
static int static int
applet_destroy(GtkWidget *w, gpointer data) applet_destroy(GtkWidget *w, gpointer data)
{ {
int applet_id = PTOI(data); int applet_id = GPOINTER_TO_INT(data);
AppletInfo *info = get_applet_info(applet_id); AppletInfo *info = get_applet_info(applet_id);
g_return_val_if_fail(info!=NULL,FALSE); g_return_val_if_fail(info!=NULL,FALSE);
...@@ -1308,7 +1308,7 @@ register_toy(GtkWidget *applet, ...@@ -1308,7 +1308,7 @@ register_toy(GtkWidget *applet,
info.cfg = NULL; info.cfg = NULL;
info.user_menu = NULL; info.user_menu = NULL;
gtk_object_set_user_data(GTK_OBJECT(eventbox),ITOP(applet_count)); gtk_object_set_user_data(GTK_OBJECT(eventbox),GINT_TO_POINTER(applet_count));
if(type == APPLET_DRAWER) { if(type == APPLET_DRAWER) {
...@@ -1353,13 +1353,13 @@ register_toy(GtkWidget *applet, ...@@ -1353,13 +1353,13 @@ register_toy(GtkWidget *applet,
gtk_signal_connect(GTK_OBJECT(eventbox), gtk_signal_connect(GTK_OBJECT(eventbox),
"button_press_event", "button_press_event",
GTK_SIGNAL_FUNC(applet_button_press), GTK_SIGNAL_FUNC(applet_button_press),
ITOP(applet_count-1)); GINT_TO_POINTER(applet_count-1));
info.destroy_callback = gtk_signal_connect(GTK_OBJECT(eventbox), info.destroy_callback = gtk_signal_connect(GTK_OBJECT(eventbox),
"destroy", "destroy",
GTK_SIGNAL_FUNC( GTK_SIGNAL_FUNC(
applet_destroy), applet_destroy),
ITOP(applet_count-1)); GINT_TO_POINTER(applet_count-1));
gtk_widget_show_all(eventbox); gtk_widget_show_all(eventbox);
......
...@@ -141,19 +141,6 @@ extern char *cookie; ...@@ -141,19 +141,6 @@ extern char *cookie;
((applet_id>=0 && applet_id<applet_count) ? \ ((applet_id>=0 && applet_id<applet_count) ? \
(&g_array_index(applets,AppletInfo,applet_id)):NULL) (&g_array_index(applets,AppletInfo,applet_id)):NULL)
/*a few macros to reduce compiler warnings*/
#if (SIZEOF_INT == SIZEOF_VOID_P)
# define PTOI(p) (int)((gpointer)p)
# define ITOP(i) (gpointer)((int)i)
#elif (SIZEOF_LONG == SIZEOF_VOID_P)
# define PTOI(p) (long)((gpointer)p)
# define ITOP(i) (gpointer)((long)i)
/*I doubt there is a such a platform, but why not*/
#elif (SIZEOF_SHORT == SIZEOF_VOID_P)
# define PTOI(p) (short)((gpointer)p)
# define ITOP(i) (gpointer)((short)i)
#endif
END_GNOME_DECLS END_GNOME_DECLS
#endif #endif
...@@ -555,7 +555,7 @@ set_back (GtkWidget *widget, gpointer data) ...@@ -555,7 +555,7 @@ set_back (GtkWidget *widget, gpointer data)
{ {
GtkWidget *pixf,*colf; GtkWidget *pixf,*colf;
PerPanelConfig *ppc = gtk_object_get_user_data(GTK_OBJECT(widget)); PerPanelConfig *ppc = gtk_object_get_user_data(GTK_OBJECT(widget));
PanelBackType back_type = PTOI(data); PanelBackType back_type = GPOINTER_TO_INT(data);
if(!GTK_TOGGLE_BUTTON(widget)->active) if(!GTK_TOGGLE_BUTTON(widget)->active)
return FALSE; return FALSE;
...@@ -699,13 +699,13 @@ background_page (PerPanelConfig *ppc) ...@@ -699,13 +699,13 @@ background_page (PerPanelConfig *ppc)
gtk_signal_connect (GTK_OBJECT (ppc->non), "toggled", gtk_signal_connect (GTK_OBJECT (ppc->non), "toggled",
GTK_SIGNAL_FUNC (set_back), GTK_SIGNAL_FUNC (set_back),
ITOP(PANEL_BACK_NONE)); GINT_TO_POINTER(PANEL_BACK_NONE));
gtk_signal_connect (GTK_OBJECT (ppc->pix), "toggled", gtk_signal_connect (GTK_OBJECT (ppc->pix), "toggled",
GTK_SIGNAL_FUNC (set_back), GTK_SIGNAL_FUNC (set_back),
ITOP(PANEL_BACK_PIXMAP)); GINT_TO_POINTER(PANEL_BACK_PIXMAP));
gtk_signal_connect (GTK_OBJECT (ppc->col), "toggled", gtk_signal_connect (GTK_OBJECT (ppc->col), "toggled",
GTK_SIGNAL_FUNC (set_back), GTK_SIGNAL_FUNC (set_back),
ITOP(PANEL_BACK_COLOR)); GINT_TO_POINTER(PANEL_BACK_COLOR));
if(ppc->back_type == PANEL_BACK_NONE) if(ppc->back_type == PANEL_BACK_NONE)
gtk_toggle_button_set_state (GTK_TOGGLE_BUTTON (ppc->non), TRUE); gtk_toggle_button_set_state (GTK_TOGGLE_BUTTON (ppc->non), TRUE);
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment