GCC warning sweep and correct the C-style casting.
authorJim Huang <jserv.tw@gmail.com>
Sat, 4 Nov 2006 15:52:39 +0000 (15:52 +0000)
committerJim Huang <jserv.tw@gmail.com>
Sat, 4 Nov 2006 15:52:39 +0000 (15:52 +0000)
src/misc.h: Added prototype for create_generic_config_dlg.
src/plugins/ptk-app-menu.c (app_menu) (on_menu): Wrapped in #if defined( PTK_APP_MENU_DEMO ).

13 files changed:
src/configurator.c
src/misc.c
src/misc.h
src/panel.c
src/plugins/dclock.c
src/plugins/launchbar.c
src/plugins/menu.c
src/plugins/netstatus/netstatus.c
src/plugins/ptk-app-menu.c
src/plugins/separator.c
src/plugins/space.c
src/plugins/taskbar.c
src/systray/tray.c

index 6d7289b..cb1ed2f 100644 (file)
@@ -257,7 +257,7 @@ mk_position()
     margin_spinb = gtk_spin_button_new (margin_adj, 1.0, 0);
     gtk_spin_button_set_value(GTK_SPIN_BUTTON(margin_spinb), p->margin);
     g_signal_connect( margin_spinb, "value-changed",
-                      set_margin, NULL);
+                      G_CALLBACK(set_margin), NULL);
     gtk_table_attach(GTK_TABLE(t), margin_spinb, 3, 4, 1, 2, GTK_FILL, 0, 0, 0);
     gtk_table_set_col_spacing(GTK_TABLE(t), 1, 20);
 
@@ -536,9 +536,9 @@ on_sel_plugin_changed( GtkTreeSelection* tree_sel, GtkWidget* label )
     if( gtk_tree_selection_get_selected( tree_sel, &model, &it ) )
     {
         GtkTreeView* view = gtk_tree_selection_get_tree_view( tree_sel );
-        GtkWidget *edit_btn = (GtkWidget*)g_object_get_data( (GtkWidget*)view, "edit_btn" );
+        GtkWidget *edit_btn = GTK_WIDGET(g_object_get_data( G_OBJECT(view), "edit_btn" ));
         gtk_tree_model_get( model, &it, 1, &pl, -1 );
-        gtk_label_set_text( label, _(pl->class->description) );
+        gtk_label_set_text( GTK_LABEL(label), _(pl->class->description) );
         gtk_widget_set_sensitive( edit_btn, pl->class->config != NULL );
     }
 }
@@ -620,7 +620,7 @@ void modify_plugin( GtkTreeView* view )
 
     gtk_tree_model_get( model, &it, 1, &pl, -1 );
     if( pl->class->config )
-        pl->class->config( pl, (GtkWindow*)gtk_widget_get_toplevel(view) );
+        pl->class->config( pl, (GtkWindow*)gtk_widget_get_toplevel(GTK_WIDGET(view)) );
 }
 
 static int get_widget_index( plugin* pl )
@@ -669,7 +669,7 @@ static void on_moveup_plugin(  GtkButton* btn, GtkTreeView* view )
             }
             if( pl->pwid )
             {
-                gtk_box_reorder_child( p->box, pl->pwid, get_widget_index( pl ) );
+                gtk_box_reorder_child( GTK_BOX(p->box), pl->pwid, get_widget_index( pl ) );
             }
             return;
         }
@@ -683,7 +683,6 @@ static void on_movedown_plugin(  GtkButton* btn, GtkTreeView* view )
     GtkTreeIter it, next;
     GtkTreeModel* model;
     GtkTreeSelection* tree_sel = gtk_tree_view_get_selection( view );
-    GtkTreePath* path;
     plugin* pl;
     int i;
 
@@ -709,27 +708,30 @@ static void on_movedown_plugin(  GtkButton* btn, GtkTreeView* view )
     }
     if( pl->pwid )
     {
-        gtk_box_reorder_child( p->box, pl->pwid, get_widget_index( pl ) );
+        gtk_box_reorder_child( GTK_BOX(p->box), pl->pwid, get_widget_index( pl ) );
     }
 }
 
 static GtkWidget *
 mk_tab_plugins()
 {
-    GtkWidget *sw, *paned, *hbox, *vbox, *rvbox, *label, *bin;
-    GtkWidget *scroll, *plugin_list, *button, *image;
+    GtkWidget *hbox, *vbox, *label;
+    GtkWidget *scroll, *plugin_list, *button;
 
     hbox = gtk_hbox_new( FALSE, 2 );
 
     vbox = gtk_vbox_new( FALSE, 2 );
-    gtk_box_pack_start( hbox, vbox, TRUE, TRUE, 2 );
+    gtk_box_pack_start( GTK_BOX(hbox), vbox, TRUE, TRUE, 2 );
 
     /* Left pane */
     plugin_list = gtk_tree_view_new();
     /* plugin list */
     scroll = gtk_scrolled_window_new(NULL, NULL);
-    gtk_scrolled_window_set_policy( scroll, GTK_POLICY_AUTOMATIC,GTK_POLICY_AUTOMATIC);
-    gtk_scrolled_window_set_shadow_type( scroll, GTK_SHADOW_IN );
+    gtk_scrolled_window_set_policy( GTK_SCROLLED_WINDOW(scroll), 
+                                   GTK_POLICY_AUTOMATIC,
+                                   GTK_POLICY_AUTOMATIC);
+    gtk_scrolled_window_set_shadow_type( GTK_SCROLLED_WINDOW(scroll), 
+                                        GTK_SHADOW_IN );
     gtk_container_add( GTK_CONTAINER(scroll), plugin_list );
     gtk_box_pack_start( GTK_BOX( vbox ), scroll, TRUE, TRUE, 4 );
 
@@ -752,19 +754,23 @@ mk_tab_plugins()
     button = gtk_button_new_from_stock( GTK_STOCK_EDIT );
     gtk_box_pack_start( GTK_BOX( vbox ), button, FALSE, FALSE, 2 );
     g_signal_connect_swapped( button, "clicked", G_CALLBACK(modify_plugin), plugin_list );
-    g_object_set_data( plugin_list, "edit_btn", button );
+    g_object_set_data( G_OBJECT(plugin_list), "edit_btn", button );
 
     button = gtk_button_new_from_stock( GTK_STOCK_REMOVE );
     gtk_box_pack_start( GTK_BOX( vbox ), button, FALSE, FALSE, 2 );
     g_signal_connect( button, "clicked", G_CALLBACK(on_remove_plugin), plugin_list );
 
     button = gtk_button_new();
-    gtk_container_add( button, gtk_image_new_from_stock(GTK_STOCK_GO_UP, GTK_ICON_SIZE_BUTTON) );
+    gtk_container_add( GTK_CONTAINER(button), 
+                      gtk_image_new_from_stock(GTK_STOCK_GO_UP, 
+                                               GTK_ICON_SIZE_BUTTON) );
     gtk_box_pack_start( GTK_BOX( vbox ), button, FALSE, FALSE, 2 );
     g_signal_connect( button, "clicked", G_CALLBACK(on_moveup_plugin), plugin_list );
 
     button = gtk_button_new();
-    gtk_container_add( button, gtk_image_new_from_stock(GTK_STOCK_GO_DOWN, GTK_ICON_SIZE_BUTTON) );
+    gtk_container_add( GTK_CONTAINER(button), 
+                      gtk_image_new_from_stock(GTK_STOCK_GO_DOWN, 
+                                               GTK_ICON_SIZE_BUTTON) );
     gtk_box_pack_start( GTK_BOX( vbox ), button, FALSE, FALSE, 2 );
     g_signal_connect( button, "clicked", G_CALLBACK(on_movedown_plugin), plugin_list );
 
@@ -827,7 +833,7 @@ mk_dialog()
     g_signal_connect (G_OBJECT(dialog), "destroy",      (GCallback) dialog_destroy_event, NULL);
     g_signal_connect (G_OBJECT(dialog), "delete_event", (GCallback) dialog_delete_event,  NULL);
     gtk_window_set_modal(GTK_WINDOW(dialog), FALSE);
-    gtk_window_set_position( dialog, GTK_WIN_POS_CENTER );
+    gtk_window_set_position( GTK_WINDOW(dialog), GTK_WIN_POS_CENTER );
 
     /*
     gtk_window_set_skip_taskbar_hint(GTK_WINDOW(dialog), TRUE);
@@ -976,9 +982,9 @@ static void notify_apply_config( GtkWidget* widget )
     GtkWidget* dlg;
 
     dlg = gtk_widget_get_toplevel( widget );
-    apply_func = g_object_get_data( dlg, "apply_func" );
+    apply_func = g_object_get_data( G_OBJECT(dlg), "apply_func" );
     if( apply_func )
-        apply_func( g_object_get_data(dlg, "plugin") );
+        apply_func( g_object_get_data(G_OBJECT(dlg), "plugin") );
 }
 
 static void on_entry_changed( GtkEditable* edit, gpointer user_data )
@@ -986,21 +992,21 @@ static void on_entry_changed( GtkEditable* edit, gpointer user_data )
     char** val = (char**)user_data;
     g_free( *val );
     *val = g_strdup( gtk_entry_get_text(GTK_ENTRY(edit)) );
-    notify_apply_config( edit );
+    notify_apply_config( GTK_WIDGET(edit) );
 }
 
 static void on_spin_changed( GtkSpinButton* spin, gpointer user_data )
 {
     int* val = (int*)user_data;
     *val = (int)gtk_spin_button_get_value( spin );
-    notify_apply_config( spin );
+    notify_apply_config( GTK_WIDGET(spin) );
 }
 
 static void on_toggle_changed( GtkToggleButton* btn, gpointer user_data )
 {
     gboolean* val = (gboolean*)user_data;
     *val = gtk_toggle_button_get_active( btn );
-    notify_apply_config( btn );
+    notify_apply_config( GTK_WIDGET(btn) );
 }
 
 /* Parameters: const char* name, gpointer ret_value, GType type, ....NULL */
@@ -1009,7 +1015,7 @@ GtkWidget* create_generic_config_dlg( const char* title, GtkWidget* parent,
                                       const char* name, ... )
 {
     va_list args;
-    GtkWidget* dlg = gtk_dialog_new_with_buttons( title, parent, 0,
+    GtkWidget* dlg = gtk_dialog_new_with_buttons( title, GTK_WINDOW(parent), 0,
                                                   GTK_STOCK_CLOSE,
                                                   GTK_RESPONSE_CLOSE,
                                                   NULL );
@@ -1017,12 +1023,12 @@ GtkWidget* create_generic_config_dlg( const char* title, GtkWidget* parent,
     /* this is a dirty hack.  We need to check if this response is GTK_RESPONSE_CLOSE or not. */
     g_signal_connect( dlg, "response", G_CALLBACK(gtk_widget_destroy), NULL );
     if( apply_func )
-        g_object_set_data( dlg, "apply_func", apply_func );
+        g_object_set_data( G_OBJECT(dlg), "apply_func", apply_func );
     if( plugin )
-        g_object_set_data( dlg, "plugin", plugin );
+        g_object_set_data( G_OBJECT(dlg), "plugin", plugin );
 
-    gtk_box_set_spacing( GTK_DIALOG(dlg)->vbox, 4 );
-    gtk_container_set_border_width( GTK_DIALOG(dlg)->vbox, 8 );
+    gtk_box_set_spacing( GTK_BOX(GTK_DIALOG(dlg)->vbox), 4 );
+    gtk_container_set_border_width( GTK_CONTAINER(GTK_DIALOG(dlg)->vbox), 8 );
 
     va_start( args, name );
     while( name )
@@ -1035,34 +1041,37 @@ GtkWidget* create_generic_config_dlg( const char* title, GtkWidget* parent,
         {
             case G_TYPE_STRING:
                 entry = gtk_entry_new();
-                gtk_entry_set_text( entry, *(char**)val );
-                g_signal_connect( entry, "changed", on_entry_changed, val );
+                gtk_entry_set_text( GTK_ENTRY(entry), *(char**)val );
+                g_signal_connect( entry, "changed", 
+                                 G_CALLBACK(on_entry_changed), val );
                 break;
             case G_TYPE_INT:
             {
                 /* FIXME: the range shouldn't be hardcoded */
                 entry = gtk_spin_button_new_with_range( 0, 1000, 1 );
-                gtk_spin_button_set_value( entry, *(int*)val );
-                g_signal_connect( entry, "value-changed", on_spin_changed, val );
+                gtk_spin_button_set_value( GTK_SPIN_BUTTON(entry), *(int*)val );
+                g_signal_connect( entry, "value-changed", 
+                                 G_CALLBACK(on_spin_changed), val );
                 break;
             }
             case G_TYPE_BOOLEAN:
                 entry = gtk_check_button_new();
-                gtk_container_add( entry, label );
-                gtk_toggle_button_set_active( entry, *(gboolean*)val );
-                g_signal_connect( entry, "toggled", on_toggle_changed, val );
+                gtk_container_add( GTK_CONTAINER(entry), label );
+                gtk_toggle_button_set_active( GTK_TOGGLE_BUTTON(entry), *(gboolean*)val );
+                g_signal_connect( entry, "toggled", 
+                                 G_CALLBACK(on_toggle_changed), val );
                 break;
         }
         if( entry )
         {
             if( type == G_TYPE_BOOLEAN )
-                gtk_box_pack_start( GTK_DIALOG(dlg)->vbox, entry, FALSE, FALSE, 2 );
+                gtk_box_pack_start( GTK_BOX(GTK_DIALOG(dlg)->vbox), entry, FALSE, FALSE, 2 );
             else
             {
                 GtkWidget* hbox = gtk_hbox_new( FALSE, 2 );
-                gtk_box_pack_start( hbox, label, FALSE, FALSE, 2 );
-                gtk_box_pack_start( hbox, entry, TRUE, TRUE, 2 );
-                gtk_box_pack_start( GTK_DIALOG(dlg)->vbox, hbox, FALSE, FALSE, 2 );
+                gtk_box_pack_start( GTK_BOX(hbox), label, FALSE, FALSE, 2 );
+                gtk_box_pack_start( GTK_BOX(hbox), entry, TRUE, TRUE, 2 );
+                gtk_box_pack_start( GTK_BOX(GTK_DIALOG(dlg)->vbox), hbox, FALSE, FALSE, 2 );
             }
         }
         name = va_arg( args, const char* );
index 59c01fc..20e5794 100644 (file)
@@ -1127,21 +1127,22 @@ GtkWidget* recreate_box( GtkBox* oldbox, GtkOrientation orientation )
 
     if( GTK_IS_HBOX(oldbox) ) {
         if( orientation == GTK_ORIENTATION_HORIZONTAL )
-            return oldbox;
+            return GTK_WIDGET(oldbox);
     }
     else {
         if( orientation == GTK_ORIENTATION_VERTICAL )
-            return oldbox;
+            return GTK_WIDGET(oldbox);
     }
     my_box_new = orientation == GTK_ORIENTATION_HORIZONTAL ? gtk_hbox_new : gtk_vbox_new;
 
-    newbox = my_box_new( gtk_box_get_homogeneous(oldbox),
-                         gtk_box_get_spacing(oldbox) );
+    newbox = GTK_BOX(my_box_new( gtk_box_get_homogeneous(oldbox),
+                                 gtk_box_get_spacing(oldbox) ));
     gtk_container_set_border_width (GTK_CONTAINER (newbox),
-                                    gtk_container_get_border_width(oldbox) );
+                                    gtk_container_get_border_width(GTK_CONTAINER(oldbox)) );
     children = gtk_container_get_children( GTK_CONTAINER (oldbox) );
     for( child = children; child; child = child->next ) {
-        gboolean expand, fill, padding;
+        gboolean expand, fill;
+       guint padding;
         GtkWidget* w = GTK_WIDGET(child->data);
         gtk_box_query_child_packing( oldbox, w,
                                      &expand, &fill, &padding, NULL );
@@ -1151,9 +1152,9 @@ GtkWidget* recreate_box( GtkBox* oldbox, GtkOrientation orientation )
         g_object_unref( w );
     }
     g_list_free( children );
-    gtk_widget_show_all(newbox);
-    gtk_widget_destroy( oldbox );
-    return newbox;
+    gtk_widget_show_all( GTK_WIDGET(newbox) );
+    gtk_widget_destroy( GTK_WIDGET(oldbox) );
+    return GTK_WIDGET(newbox);
 }
 
 void show_error( GtkWindow* parent_win, const char* msg )
index c96086d..86bb932 100644 (file)
@@ -83,4 +83,9 @@ GtkWidget* recreate_box( GtkBox* oldbox, GtkOrientation orientation );
 
 void show_error( GtkWindow* parent_win, const char* msg );
 
+/* Parameters: const char* name, gpointer ret_value, GType type, ....NULL */
+GtkWidget* create_generic_config_dlg( const char* title, GtkWidget* parent,                         
+                                     GSourceFunc apply_func, gpointer plugin,
+                                     const char* name, ... );
+
 #endif
index 00d63b1..529f096 100644 (file)
@@ -487,10 +487,10 @@ void panel_set_orientation(panel *p)
 
     /* recreate the main layout box */
     if( p->box ) {
-        GtkBox* newbox = recreate_box( p->box, p->orientation );
-        if( newbox != p->box ) {
-            p->box = newbox;
-            gtk_container_add( p->bbox, newbox );
+        GtkBox* newbox = GTK_BOX(recreate_box( GTK_BOX(p->box), p->orientation ));
+        if( GTK_WIDGET(newbox) != p->box ) {
+            p->box = GTK_WIDGET(newbox);
+            gtk_container_add( GTK_CONTAINER(p->bbox), GTK_WIDGET(newbox) );
         }
     }
     /* NOTE: This loop won't be executed when panel started since
@@ -669,7 +669,6 @@ int
 panel_start( panel *p, char **fp )
 {
     line s;
-    long pos;
 
     /* parse global section */
     ENTER;
@@ -810,7 +809,6 @@ int
 main(int argc, char *argv[], char *env[])
 {
     int i;
-    int quit = 0;
     void configure();
     char *fp, *pfp; /* point to current position of profile data in memory */
 
index a44a18f..436f635 100644 (file)
@@ -84,7 +84,6 @@ dclock_constructor(plugin *p, char** fp)
 {
     line s;
     dclock *dc;
-    char output [40] ;
 
     ENTER;
     dc = g_new0(dclock, 1);
@@ -189,13 +188,13 @@ static void dclock_config( plugin *p, GtkWindow* parent )
     GtkWidget* dlg;
     dclock *dc = (dclock *)p->priv;
     dlg = create_generic_config_dlg( _(p->class->name),
-                                     parent,
-                                     apply_config, p,
+                                     GTK_WIDGET(parent),
+                                    (GSourceFunc) apply_config, (gpointer) p,
                                      _("Clock Format"), &dc->cfmt, G_TYPE_STRING,
                                      _("Tooltip Format"), &dc->tfmt, G_TYPE_STRING,
                                      _("Action"), &dc->action, G_TYPE_STRING,
                                      NULL );
-    gtk_window_present( dlg );
+    gtk_window_present( GTK_WINDOW(dlg) );
 }
 
 static void save_config( plugin* p, FILE* fp )
index 404e8b2..7d81485 100644 (file)
@@ -400,11 +400,11 @@ static void orientation_changed( plugin* p )
 {
     launchbar *lb = (launchbar *)p->priv;
     GtkBox* newbox;
-    newbox = recreate_box( lb->box, p->panel->orientation );
-    if( newbox != lb->box ) {
+    newbox = GTK_BOX(recreate_box( GTK_BOX(lb->box), p->panel->orientation ));
+    if( GTK_WIDGET(newbox) != lb->box ) {
         /* Since the old box has been destroyed,
         we need to re-add the new box to the container */
-        lb->box = newbox;
+        lb->box = GTK_WIDGET(newbox);
         gtk_container_add(GTK_CONTAINER(p->pwid), lb->box);
     }
 }
index 2463bf4..16a2997 100644 (file)
@@ -313,10 +313,11 @@ read_system_menu(GtkMenu* menu, plugin *p, char** fp)
 static void
 read_include(plugin *p, char **fp)
 {
+    ENTER;
+#if 0
     gchar *name;
     line s;
     menup *m = (menup *)p->priv;
-#if 0
     /* FIXME: this is disabled */
     ENTER;
     s.len = 256;
index 63edf58..174045d 100644 (file)
@@ -128,8 +128,8 @@ static void netstatus_config( plugin* p, GtkWindow* parent  )
     netstatus *ns = (netstatus*)p->priv;
     dlg = create_generic_config_dlg(
                 _(p->class->name),
-                parent,
-                apply_config, p,
+                GTK_WIDGET(parent),
+                (GSourceFunc) apply_config, p,
                 _("Interface to monitor"), &ns->iface, G_TYPE_STRING,
                 _("Config tool"), &ns->config_tool, G_TYPE_STRING,
                 NULL );
index 77f690f..0551a9b 100644 (file)
@@ -183,8 +183,9 @@ static void app_dirs_foreach( GFunc func, gpointer user_data );
 
 static int compare_menu_item_titles( gpointer a, gpointer b )
 {
-    char* title_a = gtk_label_get_text( gtk_bin_get_child(GTK_BIN(a)) );
-    char* title_b = gtk_label_get_text( gtk_bin_get_child(GTK_BIN(b)) );
+    const gchar *title_a, *title_b;
+    title_a = gtk_label_get_text( GTK_LABEL(gtk_bin_get_child(GTK_BIN(a))) );
+    title_b = gtk_label_get_text( GTK_LABEL(gtk_bin_get_child(GTK_BIN(b))) );
     return g_ascii_strcasecmp(title_a, title_b);
 }
 
@@ -192,7 +193,7 @@ static int find_menu_item_by_name( gpointer a, gpointer b )
 {
     PtkAppMenuItem* data = g_object_get_qdata( G_OBJECT(a), data_id );
     const char* name = (char*)b;
-    return strcmp(data->name, b);
+    return strcmp(data->name, name);
 }
 
 /* Moved to misc.c of lxpanel to be used in other plugins */
@@ -276,7 +277,7 @@ static gboolean on_menu_item_expose( GtkWidget* item,
     PtkAppMenuItem* data = (PtkAppMenuItem*)user_data;
     if( !data )
         return FALSE;
-    img = gtk_image_menu_item_get_image(item);
+    img = GTK_WIDGET(gtk_image_menu_item_get_image((GtkImageMenuItem *) item));
     if( img )
         return FALSE;
     if( G_UNLIKELY(!data) || G_UNLIKELY(!data->icon) )
@@ -305,9 +306,9 @@ static gboolean on_menu_item_expose( GtkWidget* item,
     else
     {
         img = gtk_image_new();
-        gtk_image_set_pixel_size( img, ICON_SIZE );
+        gtk_image_set_pixel_size( GTK_IMAGE(img), ICON_SIZE );
     }
-    gtk_image_menu_item_set_image( item, img );
+    gtk_image_menu_item_set_image( (GtkImageMenuItem *) item, img );
     return FALSE;
 }
 
@@ -344,10 +345,10 @@ static void do_load_dir( int prefix_len,
 
     file = g_key_file_new();
 
-    while( name = g_dir_read_name( dir ) )
+    while( (name = g_dir_read_name( dir )) )
     {
         char* fpath;
-        char **cats, **cat;
+        char **cats;
         char **only_show_in;
 
         if( name[0] =='.' )
@@ -399,7 +400,7 @@ static void do_load_dir( int prefix_len,
                         PtkAppMenuItem* data;
                         GList* prev;
                         prev =g_list_find_custom( sub_menus[i], (fpath + prefix_len),
-                                                                                                            find_menu_item_by_name );
+                                                 (GCompareFunc) find_menu_item_by_name );
                         if( ! prev )
                         {
                             menu_item = gtk_image_menu_item_new_with_label( title );
@@ -410,7 +411,7 @@ static void do_load_dir( int prefix_len,
                             GtkLabel* label;
                             menu_item = GTK_WIDGET(prev->data);
                             label = GTK_LABEL(gtk_bin_get_child(GTK_BIN(menu_item)));
-                            data = (PtkAppMenuItem*)g_object_get_qdata( menu_item, data_id );
+                            data = (PtkAppMenuItem*)g_object_get_qdata( G_OBJECT(menu_item), data_id );
                             gtk_label_set_text( label, title );
                             g_free( data->name );
                             g_free( data->exec );
@@ -419,8 +420,10 @@ static void do_load_dir( int prefix_len,
                         data->name = g_strdup( fpath + prefix_len );
                         data->exec = exec ? translate_exec_to_cmd( exec, data->icon, title, fpath ) : NULL;
                         g_free( title );
-                        g_signal_connect( menu_item, "expose-event", on_menu_item_expose, data );
-                        g_signal_connect( menu_item, "size-request", on_menu_item_size_request, data );
+                        g_signal_connect( menu_item, "expose-event", 
+                                         G_CALLBACK(on_menu_item_expose), data );
+                        g_signal_connect( menu_item, "size-request", 
+                                         G_CALLBACK(on_menu_item_size_request), data );
                         icon = g_strdup( g_key_file_get_string( file, desktop_ent, "Icon", NULL) );
                         if( icon )
                         {
@@ -431,9 +434,13 @@ static void do_load_dir( int prefix_len,
                         data->icon = icon;
                         if( !prev )
                         {
-                            g_signal_connect( menu_item, "activate", on_app_menu_item_activate, data );
-                            g_object_set_qdata_full( menu_item, data_id, data, ptk_app_menu_item_free );
-                            sub_menus[i] = g_list_insert_sorted( sub_menus[i], menu_item,compare_menu_item_titles );
+                            g_signal_connect( menu_item, "activate", 
+                                             G_CALLBACK(on_app_menu_item_activate), data );
+                            g_object_set_qdata_full( G_OBJECT(menu_item), data_id, data, 
+                                                    (GDestroyNotify) ptk_app_menu_item_free );
+                            sub_menus[i] = g_list_insert_sorted( sub_menus[i], 
+                                                    (gpointer) menu_item,
+                                                    (GCompareFunc) compare_menu_item_titles );
                         }
                     } /* if( title ) */
                     g_free( exec );
@@ -452,6 +459,7 @@ static void load_dir( const char* path, GList** sub_menus )
     do_load_dir( strlen( path ) + 1, path, sub_menus );
 }
 
+#if defined( PTK_APP_MENU_DEMO )
 static GtkWidget* app_menu = NULL;
 static void on_menu( GtkWidget* btn, gpointer user_data )
 {
@@ -465,6 +473,7 @@ static void on_menu( GtkWidget* btn, gpointer user_data )
         app_menu = ptk_app_menu_new();
     gtk_menu_popup(GTK_MENU(app_menu), NULL, NULL, NULL, NULL, 0, 0 );
 }
+#endif
 
 void on_app_menu_destroy( gpointer user_data, GObject* menu )
 {
@@ -507,7 +516,7 @@ void ptk_app_menu_insert_items( GtkMenu* menu, int position )
       PtkAppMenuItem* data;
       if( ! (sub_items = sub_menus[i]) )
          continue;
-      sub_menu = gtk_menu_new();
+      sub_menu = GTK_MENU(gtk_menu_new());
 
       for( l = sub_items; l; l = l->next )
          gtk_menu_shell_append( GTK_MENU_SHELL(sub_menu), GTK_WIDGET(l->data) );
index 2fdc9fc..3872e77 100644 (file)
@@ -42,14 +42,14 @@ static void
 separator_destructor(plugin *p)
 {
     ENTER;
-    GtkWidget* eb = (GtkEventBox*)p->priv;
+    GtkWidget* eb = GTK_WIDGET((GtkEventBox*)p->priv);
     gtk_widget_destroy( eb );
     RET();
 }
 
 static void orientation_changed( plugin* p )
 {
-    GtkWidget* eb = (GtkEventBox*)p->priv;
+    GtkWidget* eb = GTK_WIDGET((GtkEventBox*)p->priv);
     GtkWidget* sep = gtk_bin_get_child( GTK_BIN(eb) );
     if( GTK_IS_VSEPARATOR(sep) ) {
         if( p->panel->orientation == GTK_ORIENTATION_HORIZONTAL )
index 96d5116..16f5201 100644 (file)
@@ -108,10 +108,10 @@ static void space_config(plugin* p, GtkWindow* parent )
     GtkWidget* dlg;
     space *sp = (space *)p->priv;
     dlg =  create_generic_config_dlg( _(p->class->name),
-                                     parent,
-                                     apply_config, p,
+                                     GTK_WIDGET(parent),
+                                     (GSourceFunc) apply_config, (gpointer) p,
                                      _("Size"), &sp->size, G_TYPE_INT,  NULL );
-    gtk_window_present( dlg );
+    gtk_window_present( GTK_WINDOW(dlg) );
 }
 
 static void save_config( plugin* p, FILE* fp )
index cbb409a..7feee25 100644 (file)
@@ -451,7 +451,7 @@ get_netwm_icon(Window tkwin, int iw, int ih)
             if (src == NULL)
                 RET(NULL);
             ret = gdk_pixbuf_scale_ratio (src, iw, ih, GDK_INTERP_HYPER, TRUE);
-            g_object_unref(src);
+            g_object_unref(G_OBJECT(src));
         }
         XFree (data);
     }
@@ -1439,8 +1439,8 @@ static void taskbar_config( plugin* p, GtkWindow* parent )
 
     dlg =  create_generic_config_dlg(
                 _(p->class->name),
-                parent,
-                apply_config, p,
+                GTK_WIDGET(parent),
+                (GSourceFunc) apply_config, (gpointer) p,
                 _("Show tooltips"), &tb->tooltips, G_TYPE_BOOLEAN,
                 _("Icons only"), &tb->icons_only, G_TYPE_BOOLEAN,
                 _("Accept SkipPager"), &tb->accept_skip_pager, G_TYPE_BOOLEAN,
@@ -1452,7 +1452,7 @@ static void taskbar_config( plugin* p, GtkWindow* parent )
                 _("Max width of task button"), &tb->task_width_max, G_TYPE_INT,
                 _("Spacing"), &tb->spacing, G_TYPE_INT,
                 NULL );
-    gtk_window_present( dlg );
+    gtk_window_present( GTK_WINDOW(dlg) );
 }
 
 static void save_config( plugin* p, FILE* fp )
@@ -1483,15 +1483,15 @@ update_label_orient( GtkWidget* child, gpointer user_data )
                       This is the limit of gtk+, and turn off ellipsize do
                       cause problems here. How can this be solved? Sigh!
             */
-            gtk_label_set_ellipsize( child, PANGO_ELLIPSIZE_NONE );
+            gtk_label_set_ellipsize( GTK_LABEL(child), PANGO_ELLIPSIZE_NONE );
         }
         else if( p->panel->edge == EDGE_RIGHT ) {
             angle = 270.0;
-            gtk_label_set_ellipsize( child, PANGO_ELLIPSIZE_NONE );
+            gtk_label_set_ellipsize( GTK_LABEL(child), PANGO_ELLIPSIZE_NONE );
         }
         else {
             angle = 0.0;
-            gtk_label_set_ellipsize( child, PANGO_ELLIPSIZE_END );
+            gtk_label_set_ellipsize( GTK_LABEL(child), PANGO_ELLIPSIZE_END );
         }
         gtk_label_set_angle( GTK_LABEL(child), angle );
         gtk_misc_set_alignment(GTK_MISC(child), 0.0, 0.5);
@@ -1507,16 +1507,16 @@ static void orientation_changed( plugin* p )
     for( child = children; child; child = child->next ) {
         GtkWidget *button = GTK_WIDGET(child->data);
         GtkBox *box = (GtkBox*)gtk_bin_get_child( GTK_BIN(button) );
-        GtkBox *newbox = recreate_box( box, p->panel->orientation );
+        GtkBox *newbox = GTK_BOX(recreate_box( box, p->panel->orientation ));
         if( newbox != box ) {
-            gtk_container_add( GTK_CONTAINER(button), newbox );
+            gtk_container_add( GTK_CONTAINER(button), GTK_WIDGET(newbox) );
         }
         gtk_container_foreach( GTK_CONTAINER(newbox),
                                update_label_orient, p );
     }
     g_list_free( children );
 
-    gtk_bar_set_orientation( tb->bar, p->panel->orientation );
+    gtk_bar_set_orientation( GTK_BAR(tb->bar), p->panel->orientation );
 }
 
 plugin_class taskbar_plugin_class = {
index 719f20b..cbc42f4 100644 (file)
@@ -154,11 +154,11 @@ static void orientation_changed( plugin* p )
 {
     tray *tr = (tray *)p->priv;
     GtkBox* newbox;
-    newbox = recreate_box( tr->box, p->panel->orientation );
-    if( newbox != tr->box ) {
+    newbox = GTK_BOX(recreate_box( GTK_BOX(tr->box), p->panel->orientation ));
+    if( GTK_WIDGET(newbox) != tr->box ) {
         /* Since the old box has been destroyed,
         we need to re-add the new box to the container */
-        tr->box = newbox;
+        tr->box = GTK_WIDGET(newbox);
         gtk_container_add(GTK_CONTAINER(p->pwid), tr->box);
     }
 }