Fixing some mixed indentations and ending whitespaces.
authorAndriy Grytsenko <andrej@rep.kiev.ua>
Sun, 10 Aug 2014 15:47:27 +0000 (18:47 +0300)
committerAndriy Grytsenko <andrej@rep.kiev.ua>
Sun, 10 Aug 2014 15:47:27 +0000 (18:47 +0300)
30 files changed:
src/bg.c
src/configurator.c
src/ev.c
src/gtk-run.c
src/misc.c
src/panel.c
src/plugins/batt/batt_sys.c
src/plugins/batt/batt_sys.h
src/plugins/cpufreq/cpufreq.c
src/plugins/dclock.c
src/plugins/indicator/indicator.c
src/plugins/menu.c
src/plugins/monitors/monitors.c
src/plugins/netstat/devproc.c
src/plugins/netstat/lxnm_client.c
src/plugins/netstat/statusicon.c
src/plugins/netstat/wireless.c
src/plugins/netstatus/netstatus-dialog.c
src/plugins/netstatus/netstatus-iface.c
src/plugins/netstatus/netstatus-iface.h
src/plugins/netstatus/netstatus-sysdeps.c
src/plugins/netstatus/netstatus-sysdeps.h
src/plugins/netstatus/netstatus-util.c
src/plugins/volume/volume-impl.c
src/plugins/volume/volume.c
src/plugins/xkb/test/layouts_n_variants.c
src/plugins/xkb/test/setxkbmap_query.c
src/plugins/xkb/xkb-plugin.c
src/plugins/xkb/xkb.c
src/private.h

index d7de0db..59ed594 100644 (file)
--- a/src/bg.c
+++ b/src/bg.c
@@ -253,7 +253,7 @@ FbBg *fb_bg_get_for_display(void)
     if (!default_bg)
     {
         default_bg = fb_bg_new();
-        g_object_add_weak_pointer( G_OBJECT(default_bg), 
+        g_object_add_weak_pointer( G_OBJECT(default_bg),
                 (gpointer)&default_bg );
     }
     else
index 33d89c6..212ac90 100644 (file)
@@ -193,7 +193,7 @@ static void set_monitor(GtkAdjustment *widget, Panel *p)
 
 static void set_alignment(Panel* p, int align)
 {
-    if (p->margin_control) 
+    if (p->margin_control)
         gtk_widget_set_sensitive(p->margin_control, (align != ALLIGN_CENTER));
     p->allign = align;
     update_panel_geometry(p);
@@ -588,14 +588,14 @@ static void init_plugin_list( Panel* p, GtkTreeView* view, GtkWidget* label )
         gtk_tree_selection_select_iter( tree_sel, &it );
 }
 
-static void on_add_plugin_row_activated( GtkTreeView *tree_view, 
-                                         GtkTreePath *path, 
-                                         GtkTreeViewColumn *col, 
-                                         gpointer user_data) 
+static void on_add_plugin_row_activated( GtkTreeView *tree_view,
+                                         GtkTreePath *path,
+                                         GtkTreeViewColumn *col,
+                                         gpointer user_data)
 {
     GtkWidget *dlg;
 
-    dlg = (GtkWidget *) user_data; 
+    dlg = (GtkWidget *) user_data;
 
     (void) tree_view;
     (void) path;
@@ -737,7 +737,7 @@ static void on_add_plugin( GtkButton* btn, GtkTreeView* _view )
     gtk_tree_view_set_model( view, GTK_TREE_MODEL(list) );
     g_object_unref( list );
 
-    /* 
+    /*
      * The user can add a plugin either by clicking the "Add" button, or by
      * double-clicking the plugin.
      */
index fa66404..e4dd66e 100644 (file)
--- a/src/ev.c
+++ b/src/ev.c
@@ -58,7 +58,7 @@ struct _FbEv {
     Window active_window;
     Window *client_list;
     Window *client_list_stacking;
-    
+
     Window   xroot;
     Atom     id;
     GC       gc;
@@ -112,7 +112,7 @@ fb_ev_class_init (FbEvClass *klass)
 {
     GObjectClass *object_class = G_OBJECT_CLASS (klass);
 
-    signals [EV_CURRENT_DESKTOP] = 
+    signals [EV_CURRENT_DESKTOP] =
         g_signal_new ("current_desktop",
               G_OBJECT_CLASS_TYPE (object_class),
               G_SIGNAL_RUN_FIRST,
@@ -120,7 +120,7 @@ fb_ev_class_init (FbEvClass *klass)
               NULL, NULL,
               g_cclosure_marshal_VOID__VOID,
               G_TYPE_NONE, 0);
-    signals [EV_NUMBER_OF_DESKTOPS] = 
+    signals [EV_NUMBER_OF_DESKTOPS] =
         g_signal_new ("number_of_desktops",
               G_OBJECT_CLASS_TYPE (object_class),
               G_SIGNAL_RUN_FIRST,
@@ -128,7 +128,7 @@ fb_ev_class_init (FbEvClass *klass)
               NULL, NULL,
               g_cclosure_marshal_VOID__VOID,
               G_TYPE_NONE, 0);
-    signals [EV_DESKTOP_NAMES] = 
+    signals [EV_DESKTOP_NAMES] =
         g_signal_new ("desktop_names",
               G_OBJECT_CLASS_TYPE (object_class),
               G_SIGNAL_RUN_FIRST,
@@ -136,7 +136,7 @@ fb_ev_class_init (FbEvClass *klass)
               NULL, NULL,
               g_cclosure_marshal_VOID__VOID,
               G_TYPE_NONE, 0);
-    signals [EV_ACTIVE_WINDOW] = 
+    signals [EV_ACTIVE_WINDOW] =
         g_signal_new ("active_window",
               G_OBJECT_CLASS_TYPE (object_class),
               G_SIGNAL_RUN_FIRST,
@@ -144,7 +144,7 @@ fb_ev_class_init (FbEvClass *klass)
               NULL, NULL,
               g_cclosure_marshal_VOID__VOID,
               G_TYPE_NONE, 0);
-    signals [EV_DESTROY_WINDOW] = 
+    signals [EV_DESTROY_WINDOW] =
         g_signal_new ("destroy_window",
               G_OBJECT_CLASS_TYPE (object_class),
               G_SIGNAL_RUN_FIRST,
@@ -152,7 +152,7 @@ fb_ev_class_init (FbEvClass *klass)
               NULL, NULL,
               g_cclosure_marshal_VOID__POINTER,
               G_TYPE_NONE, 1, G_TYPE_POINTER);
-    signals [EV_CLIENT_LIST_STACKING] = 
+    signals [EV_CLIENT_LIST_STACKING] =
         g_signal_new ("client_list_stacking",
               G_OBJECT_CLASS_TYPE (object_class),
               G_SIGNAL_RUN_FIRST,
@@ -160,7 +160,7 @@ fb_ev_class_init (FbEvClass *klass)
               NULL, NULL,
               g_cclosure_marshal_VOID__VOID,
               G_TYPE_NONE, 0);
-    signals [EV_CLIENT_LIST] = 
+    signals [EV_CLIENT_LIST] =
         g_signal_new ("client_list",
               G_OBJECT_CLASS_TYPE (object_class),
               G_SIGNAL_RUN_FIRST,
@@ -212,21 +212,21 @@ fb_ev_emit(FbEv *ev, int signal)
     DBG("\n");
     if( signal == EV_ACTIVE_WINDOW )
     {
-       Window* win = None;
-               ev->active_window = None;
-               win = (Window*)get_xaproperty (GDK_ROOT_WINDOW(), a_NET_ACTIVE_WINDOW, XA_WINDOW, 0);
-               if (win) {
-                       ev->active_window = *win;
-                       /* g_debug( "WIN: %p", *win ); */
-                       XFree (win);
-               }
+        Window* win = None;
+        ev->active_window = None;
+        win = (Window*)get_xaproperty (GDK_ROOT_WINDOW(), a_NET_ACTIVE_WINDOW, XA_WINDOW, 0);
+        if (win) {
+            ev->active_window = *win;
+            /* g_debug( "WIN: %p", *win ); */
+            XFree (win);
+        }
     }
     g_signal_emit(ev, signals [signal], 0);
 }
 
 void fb_ev_emit_destroy(FbEv *ev, Window win)
 {
-    g_signal_emit(ev, signals [EV_DESTROY_WINDOW], 0, win );   
+    g_signal_emit(ev, signals [EV_DESTROY_WINDOW], 0, win );
 }
 
 static void
@@ -297,11 +297,11 @@ fb_ev_current_desktop(FbEv *ev)
             ev->current_desktop = *data;
             XFree (data);
         } else
-            ev->current_desktop = 0;              
+            ev->current_desktop = 0;
     }
     RET(ev->current_desktop);
 }
-        
+
 int
 fb_ev_number_of_desktops(FbEv *ev)
 {
@@ -314,7 +314,7 @@ fb_ev_number_of_desktops(FbEv *ev)
             ev->number_of_desktops = *data;
             XFree (data);
         } else
-            ev->number_of_desktops = 0;              
+            ev->number_of_desktops = 0;
     }
     RET(ev->number_of_desktops);
 
@@ -322,16 +322,16 @@ fb_ev_number_of_desktops(FbEv *ev)
 
 Window *fb_ev_active_window(FbEv *ev)
 {
-       return &ev->active_window;      
+    return &ev->active_window;
 }
 
 Window *fb_ev_client_list(FbEv *ev)
 {
-       return ev->client_list;
+    return ev->client_list;
 }
 
 Window *fb_ev_client_list_stacking(FbEv *ev)
 {
-       return ev->client_list_stacking;
+    return ev->client_list_stacking;
 }
 
index d187798..638a4a9 100644 (file)
@@ -310,46 +310,46 @@ static void on_entry_changed( GtkEntry* entry, GtkImage* img )
 
 static void activate_window(GtkWindow* toplevel_window)
 {
-       /* Calling gtk_window_present() cannot support
-        * source indication. Use our own implementation.
-        * Without this, the window activated might be
-        * put in background by WM to avoid stealing
-        * of focus.
-        * See EWMH spec, source indication part:
-        * http://standards.freedesktop.org/wm-spec/wm-spec-latest.html#sourceindication
-        */
-       GtkWidget* widget = GTK_WIDGET(toplevel_window);
-       GdkScreen* screen = gtk_widget_get_screen(widget);
-       if (gdk_x11_screen_supports_net_wm_hint (screen,
+    /* Calling gtk_window_present() cannot support
+     * source indication. Use our own implementation.
+     * Without this, the window activated might be
+     * put in background by WM to avoid stealing
+     * of focus.
+     * See EWMH spec, source indication part:
+     * http://standards.freedesktop.org/wm-spec/wm-spec-latest.html#sourceindication
+     */
+    GtkWidget* widget = GTK_WIDGET(toplevel_window);
+    GdkScreen* screen = gtk_widget_get_screen(widget);
+    if (gdk_x11_screen_supports_net_wm_hint (screen,
                                           gdk_atom_intern_static_string ("_NET_ACTIVE_WINDOW")))
     {
-               GdkWindow* window = gtk_widget_get_window(widget);
-               GdkDisplay* display = gtk_widget_get_display(widget);
-               GdkWindow* root = gdk_screen_get_root_window(screen);
-
-               /* show the window first */
-               gtk_widget_show(widget);
-
-               /* then, activate it */
-               XClientMessageEvent xclient;
-               memset(&xclient, 0, sizeof (xclient));
-               xclient.type = ClientMessage;
-               xclient.window = GDK_WINDOW_XID(window);
-               xclient.message_type = gdk_x11_get_xatom_by_name_for_display(display,
-                                                                       "_NET_ACTIVE_WINDOW");
-               xclient.format = 32;
-               xclient.data.l[0] = 2; /* source indication: 2 represents direct user actions. */
-               xclient.data.l[1] = gtk_get_current_event_time();
-               xclient.data.l[2] = None; /* currently active window */
-               xclient.data.l[3] = 0;
-               xclient.data.l[4] = 0;
-
-               XSendEvent(GDK_DISPLAY_XDISPLAY(display), GDK_WINDOW_XID(root), False,
-                                 SubstructureRedirectMask|SubstructureNotifyMask,
-                                 (XEvent *)&xclient);
+        GdkWindow* window = gtk_widget_get_window(widget);
+        GdkDisplay* display = gtk_widget_get_display(widget);
+        GdkWindow* root = gdk_screen_get_root_window(screen);
+
+        /* show the window first */
+        gtk_widget_show(widget);
+
+        /* then, activate it */
+        XClientMessageEvent xclient;
+        memset(&xclient, 0, sizeof (xclient));
+        xclient.type = ClientMessage;
+        xclient.window = GDK_WINDOW_XID(window);
+        xclient.message_type = gdk_x11_get_xatom_by_name_for_display(display,
+                                                                   "_NET_ACTIVE_WINDOW");
+        xclient.format = 32;
+        xclient.data.l[0] = 2; /* source indication: 2 represents direct user actions. */
+        xclient.data.l[1] = gtk_get_current_event_time();
+        xclient.data.l[2] = None; /* currently active window */
+        xclient.data.l[3] = 0;
+        xclient.data.l[4] = 0;
+
+        XSendEvent(GDK_DISPLAY_XDISPLAY(display), GDK_WINDOW_XID(root), False,
+                  SubstructureRedirectMask|SubstructureNotifyMask,
+                  (XEvent *)&xclient);
     } /* if _NET_ACTIVE_WINDOW command is not supported */
-       else
-               gtk_window_present(toplevel_window);
+    else
+        gtk_window_present(toplevel_window);
 }
 
 void gtk_run()
@@ -358,50 +358,50 @@ void gtk_run()
 
     if(!win)
     {
-               win = gtk_dialog_new_with_buttons( _("Run"),
-                                                                                  NULL,
-                                                                                  GTK_DIALOG_NO_SEPARATOR,
-                                                                                  GTK_STOCK_CANCEL, GTK_RESPONSE_CANCEL,
-                                                                                  GTK_STOCK_OK, GTK_RESPONSE_OK,
-                                                                                  NULL );
-               gtk_dialog_set_alternative_button_order((GtkDialog*)win, 
-                                                               GTK_RESPONSE_OK, GTK_RESPONSE_CANCEL, -1);
-               gtk_dialog_set_default_response( (GtkDialog*)win, GTK_RESPONSE_OK );
-               entry = gtk_entry_new();
-
-               gtk_entry_set_activates_default( (GtkEntry*)entry, TRUE );
-               dlg_vbox = gtk_dialog_get_content_area((GtkDialog*)win);
-               gtk_box_pack_start( (GtkBox*)dlg_vbox,
-                                                        gtk_label_new(_("Enter the command you want to execute:")),
-                                                        FALSE, FALSE, 8 );
-               hbox = gtk_hbox_new( FALSE, 2 );
-               img = gtk_image_new_from_stock( GTK_STOCK_EXECUTE, GTK_ICON_SIZE_DIALOG );
-               gtk_box_pack_start( (GtkBox*)hbox, img,
-                                                        FALSE, FALSE, 4 );
-               gtk_box_pack_start( (GtkBox*)hbox, entry, TRUE, TRUE, 4 );
-               gtk_box_pack_start( (GtkBox*)dlg_vbox,
-                                                        hbox, FALSE, FALSE, 8 );
-               g_signal_connect( win, "response", G_CALLBACK(on_response), entry );
-               gtk_window_set_position( (GtkWindow*)win, GTK_WIN_POS_CENTER );
-               gtk_window_set_default_size( (GtkWindow*)win, 360, -1 );
-               gtk_widget_show_all( win );
-
-               setup_auto_complete( (GtkEntry*)entry );
-               gtk_widget_show(win);
-
-               g_signal_connect(entry ,"changed", G_CALLBACK(on_entry_changed), img);
-
-               /* get all apps */
-               menu_cache = menu_cache_lookup(g_getenv("XDG_MENU_PREFIX") ? "applications.menu" : "lxde-applications.menu" );
-               if( menu_cache )
-               {
-                       menu_cache_reload(menu_cache);
-                       app_list = (GSList*)menu_cache_list_all_apps(menu_cache);
-                       reload_notify_id = menu_cache_add_reload_notify(menu_cache, reload_apps, NULL);
-               }
-       }
-
-       activate_window(GTK_WINDOW(win));
+        win = gtk_dialog_new_with_buttons( _("Run"),
+                                           NULL,
+                                           GTK_DIALOG_NO_SEPARATOR,
+                                           GTK_STOCK_CANCEL, GTK_RESPONSE_CANCEL,
+                                           GTK_STOCK_OK, GTK_RESPONSE_OK,
+                                           NULL );
+        gtk_dialog_set_alternative_button_order((GtkDialog*)win,
+                                GTK_RESPONSE_OK, GTK_RESPONSE_CANCEL, -1);
+        gtk_dialog_set_default_response( (GtkDialog*)win, GTK_RESPONSE_OK );
+        entry = gtk_entry_new();
+
+        gtk_entry_set_activates_default( (GtkEntry*)entry, TRUE );
+        dlg_vbox = gtk_dialog_get_content_area((GtkDialog*)win);
+        gtk_box_pack_start( (GtkBox*)dlg_vbox,
+                             gtk_label_new(_("Enter the command you want to execute:")),
+                             FALSE, FALSE, 8 );
+        hbox = gtk_hbox_new( FALSE, 2 );
+        img = gtk_image_new_from_stock( GTK_STOCK_EXECUTE, GTK_ICON_SIZE_DIALOG );
+        gtk_box_pack_start( (GtkBox*)hbox, img,
+                             FALSE, FALSE, 4 );
+        gtk_box_pack_start( (GtkBox*)hbox, entry, TRUE, TRUE, 4 );
+        gtk_box_pack_start( (GtkBox*)dlg_vbox,
+                             hbox, FALSE, FALSE, 8 );
+        g_signal_connect( win, "response", G_CALLBACK(on_response), entry );
+        gtk_window_set_position( (GtkWindow*)win, GTK_WIN_POS_CENTER );
+        gtk_window_set_default_size( (GtkWindow*)win, 360, -1 );
+        gtk_widget_show_all( win );
+
+        setup_auto_complete( (GtkEntry*)entry );
+        gtk_widget_show(win);
+
+        g_signal_connect(entry ,"changed", G_CALLBACK(on_entry_changed), img);
+
+        /* get all apps */
+        menu_cache = menu_cache_lookup(g_getenv("XDG_MENU_PREFIX") ? "applications.menu" : "lxde-applications.menu" );
+        if( menu_cache )
+        {
+            menu_cache_reload(menu_cache);
+            app_list = (GSList*)menu_cache_list_all_apps(menu_cache);
+            reload_notify_id = menu_cache_add_reload_notify(menu_cache, reload_apps, NULL);
+        }
+    }
+
+    activate_window(GTK_WINDOW(win));
 }
 
 
index 5a2837a..9d65626 100644 (file)
@@ -364,7 +364,7 @@ void resolve_atoms()
     Atom atoms[ N_ATOMS ];
 
     ENTER;
-   
+
     if( !  XInternAtoms( GDK_DISPLAY_XDISPLAY(gdk_display_get_default()), (char**)atom_names,
             N_ATOMS, False, atoms ) )
     {
index b8fce1f..4e40f4b 100644 (file)
@@ -474,14 +474,14 @@ static gboolean delay_update_background( Panel* p )
        gdk_display_sync( gtk_widget_get_display(p->topgwin) );
        panel_update_background( p );
     }
-    
+
     return FALSE;
 }
 
 static void
 panel_realize(GtkWidget *widget, Panel *p)
 {
-    g_idle_add_full( G_PRIORITY_LOW, 
+    g_idle_add_full( G_PRIORITY_LOW,
             (GSourceFunc)delay_update_background, p, NULL );
 }
 
@@ -494,7 +494,7 @@ panel_style_set(GtkWidget *widget, GtkStyle* prev, Panel *p)
 #else
     if( GTK_WIDGET_REALIZED( widget ) )
 #endif
-        g_idle_add_full( G_PRIORITY_LOW, 
+        g_idle_add_full( G_PRIORITY_LOW,
                 (GSourceFunc)delay_update_background, p, NULL );
 }
 
@@ -566,12 +566,12 @@ panel_popupmenu_configure(GtkWidget *widget, gpointer user_data)
 /* Handler for "button_press_event" signal with Panel as parameter. */
 static gboolean panel_button_press_event_with_panel(GtkWidget *widget, GdkEventButton *event, Panel *panel)
 {
-    if (event->button == 3)     /* right button */
+    if (event->button == 3) /* right button */
     {
         GtkMenu* popup = (GtkMenu*) lxpanel_get_plugin_menu(panel, NULL, FALSE);
         gtk_menu_popup(popup, NULL, NULL, NULL, NULL, event->button, event->time);
         return TRUE;
-    }    
+    }
     return FALSE;
 }
 
@@ -748,7 +748,7 @@ static void panel_popupmenu_about( GtkMenuItem* item, Panel* panel )
          gtk_about_dialog_set_logo( GTK_ABOUT_DIALOG(about),
                                     gtk_icon_theme_load_icon(panel->icon_theme, "start-here", 48, 0, NULL));
     }
-    else 
+    else
     {
         gtk_about_dialog_set_logo(  GTK_ABOUT_DIALOG(about),
                                     gdk_pixbuf_new_from_file(PACKAGE_DATA_DIR "/images/my-computer.png", NULL));
@@ -761,25 +761,25 @@ static void panel_popupmenu_about( GtkMenuItem* item, Panel* panel )
     gtk_about_dialog_set_authors(GTK_ABOUT_DIALOG(about), authors);
     gtk_about_dialog_set_translator_credits(GTK_ABOUT_DIALOG(about), translators);
     gtk_dialog_run(GTK_DIALOG(about));
-    gtk_widget_destroy(about); 
+    gtk_widget_destroy(about);
 }
 
 void panel_apply_icon( GtkWindow *w )
 {
-       GdkPixbuf* window_icon;
-       
-       if(gtk_icon_theme_has_icon(gtk_icon_theme_get_default(), "video-display"))
+    GdkPixbuf* window_icon;
+
+    if(gtk_icon_theme_has_icon(gtk_icon_theme_get_default(), "video-display"))
     {
-               window_icon = gtk_icon_theme_load_icon(gtk_icon_theme_get_default(), "video-display", 24, 0, NULL);
-       }
-       else if(gtk_icon_theme_has_icon(gtk_icon_theme_get_default(), "start-here"))
+        window_icon = gtk_icon_theme_load_icon(gtk_icon_theme_get_default(), "video-display", 24, 0, NULL);
+    }
+    else if(gtk_icon_theme_has_icon(gtk_icon_theme_get_default(), "start-here"))
     {
-               window_icon = gtk_icon_theme_load_icon(gtk_icon_theme_get_default(), "start-here", 24, 0, NULL);
-       }
+        window_icon = gtk_icon_theme_load_icon(gtk_icon_theme_get_default(), "start-here", 24, 0, NULL);
+    }
     else
     {
-               window_icon = gdk_pixbuf_new_from_file(PACKAGE_DATA_DIR "/images/my-computer.png", NULL);
-       }
+        window_icon = gdk_pixbuf_new_from_file(PACKAGE_DATA_DIR "/images/my-computer.png", NULL);
+    }
     gtk_window_set_icon(w, window_icon);
 }
 
@@ -988,7 +988,7 @@ void panel_establish_autohide(Panel *p)
     }
     else if ( ! p->visible)
     {
-       gtk_widget_show(p->box);
+    gtk_widget_show(p->box);
         p->visible = TRUE;
     }
 }
@@ -1470,14 +1470,14 @@ int panel_handle_x_error(Display * d, XErrorEvent * ev)
         XGetErrorText(d, ev->error_code, buf, 256);
         LOG(LOG_WARN, "lxpanel : X error: %s\n", buf);
     }
-    return 0;  /* Ignored */
+    return 0;    /* Ignored */
 }
 
 int panel_handle_x_error_swallow_BadWindow_BadDrawable(Display * d, XErrorEvent * ev)
 {
     if ((ev->error_code != BadWindow) && (ev->error_code != BadDrawable))
         panel_handle_x_error(d, ev);
-    return 0;  /* Ignored */
+    return 0;    /* Ignored */
 }
 
 /* Lightweight lock related functions - X clipboard hacks */
@@ -1555,7 +1555,7 @@ static void _start_panels_from_dir(const char *panel_dir)
     while((name = g_dir_read_name(dir)) != NULL)
     {
         char* panel_config = g_build_filename( panel_dir, name, NULL );
-        if (strchr(panel_config, '~') == NULL) /* Skip editor backup files in case user has hand edited in this directory */
+        if (strchr(panel_config, '~') == NULL)    /* Skip editor backup files in case user has hand edited in this directory */
         {
             Panel* panel = panel_new( panel_config, name );
             if( panel )
@@ -1609,9 +1609,9 @@ int main(int argc, char *argv[], char *env[])
 
     setlocale(LC_CTYPE, "");
 
-       g_thread_init(NULL);
-/*     gdk_threads_init();
-       gdk_threads_enter(); */
+    g_thread_init(NULL);
+/*    gdk_threads_init();
+    gdk_threads_enter(); */
 
     gtk_init(&argc, &argv);
 
@@ -1689,9 +1689,9 @@ restart:
 
     load_global_config();
 
-       /* NOTE: StructureNotifyMask is required by XRandR
-        * See init_randr_support() in gdkscreen-x11.c of gtk+ for detail.
-        */
+    /* NOTE: StructureNotifyMask is required by XRandR
+     * See init_randr_support() in gdkscreen-x11.c of gtk+ for detail.
+     */
     gdk_window_set_events(gdk_get_default_root_window(), GDK_STRUCTURE_MASK |
             GDK_SUBSTRUCTURE_MASK | GDK_PROPERTY_CHANGE_MASK);
     gdk_window_add_filter(gdk_get_default_root_window (), (GdkFilterFunc)panel_event_filter, NULL);
index 0b9011e..9262220 100644 (file)
@@ -1,22 +1,22 @@
 /*
  *      batt_sys.h
- *      
+ *
  *      Copyright 2009 Juergen Hötzel <juergen@archlinux.org>
- *             
- *     Parts shameless stolen and glibified from acpi package  
+ *
+ *     Parts shameless stolen and glibified from acpi package
  *     Copyright (C) 2001  Grahame Bowland <grahame@angrygoats.net>
- *     (C) 2008-2009  Michael Meskes  <meskes@debian.org> 
- *      
+ *     (C) 2008-2009  Michael Meskes  <meskes@debian.org>
+ *
  *      This program is free software; you can redistribute it and/or modify
  *      it under the terms of the GNU General Public License as published by
  *      the Free Software Foundation; either version 2 of the License, or
  *      (at your option) any later version.
- *      
+ *
  *      This program is distributed in the hope that it will be useful,
  *      but WITHOUT ANY WARRANTY; without even the implied warranty of
  *      MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
  *      GNU General Public License for more details.
- *      
+ *
  *      You should have received a copy of the GNU General Public License
  *      along with this program; if not, write to the Free Software
  *      Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston,
@@ -68,9 +68,9 @@ static gchar* parse_info_file(battery *b, char *sys_file)
     g_string_append_printf (filename, "/%s/%s", b->path, sys_file);
 
     if (g_file_get_contents(filename->str, &buf, NULL, NULL) == TRUE) {
-       value = g_strdup( buf );
-       value = g_strstrip( value );
-       g_free( buf );
+        value = g_strdup( buf );
+        value = g_strstrip( value );
+        g_free( buf );
     }
 
     g_string_free(filename, TRUE);
@@ -79,15 +79,15 @@ static gchar* parse_info_file(battery *b, char *sys_file)
 }
 
 /* get_gint_from_infofile():
- *     If the sys_file exists, then its value is converted to an int,
- *     divided by 1000, and returned.
- *     Failure is indicated by returning -1. */
+ *         If the sys_file exists, then its value is converted to an int,
+ *         divided by 1000, and returned.
+ *         Failure is indicated by returning -1. */
 static gint get_gint_from_infofile(battery *b, gchar *sys_file)
 {
     gchar *file_content = parse_info_file(b, sys_file);
 
     if (file_content != NULL)
-       return atoi(file_content) / 1000;
+        return atoi(file_content) / 1000;
 
     return -1;
 }
@@ -101,44 +101,44 @@ void battery_print(battery *b, int show_capacity)
 {
     if ( b->type_battery )
     {
-       if (b->state) {
-           
-           printf("%s %d: %s, %d%%", BATTERY_DESC, b->battery_num - 1, b->state, b->percentage);
-           
-           if (b->seconds > 0) {
-               int hours = b->seconds / 3600;
-               int seconds = b->seconds - 3600 * hours;
-               int minutes = seconds / 60;
-               seconds -= 60 * minutes;
-               printf(", %02d:%02d:%02d%s", hours, minutes, seconds,
-                       b->poststr);
-           } else if (b->poststr != NULL) {
-               printf(", %s", b->poststr);
-           }
-
-           printf("\n");
-           
-           if (show_capacity && b->charge_full_design > 0) {
-               int percentage = -1;
-               int charge_full = -1;
-               if (b->charge_full <= 100) {
-                   /* some broken systems just give a percentage here */
-                   percentage = b->charge_full;
-                   charge_full = percentage * b->charge_full_design / 100;
-               } else {
-                   percentage = b->charge_full * 100 / b->charge_full_design;
-                   charge_full = b->charge_full;
-               }
-               if (percentage > 100)
-                   percentage = 100;
-
-               printf ("%s %d: design capacity %d %s, "
-                       "last full capacity %d %s = %d%%\n",
-                       BATTERY_DESC, b->battery_num - 1, b->charge_full_design,
-                       b->capacity_unit, charge_full, b->capacity_unit,
-                       percentage);
-           }
-       }
+        if (b->state) {
+
+            printf("%s %d: %s, %d%%", BATTERY_DESC, b->battery_num - 1, b->state, b->percentage);
+
+            if (b->seconds > 0) {
+                int hours = b->seconds / 3600;
+                int seconds = b->seconds - 3600 * hours;
+                int minutes = seconds / 60;
+                seconds -= 60 * minutes;
+                printf(", %02d:%02d:%02d%s", hours, minutes, seconds,
+                        b->poststr);
+            } else if (b->poststr != NULL) {
+                printf(", %s", b->poststr);
+            }
+
+            printf("\n");
+
+            if (show_capacity && b->charge_full_design > 0) {
+                int percentage = -1;
+                int charge_full = -1;
+                if (b->charge_full <= 100) {
+                    /* some broken systems just give a percentage here */
+                    percentage = b->charge_full;
+                    charge_full = percentage * b->charge_full_design / 100;
+                } else {
+                    percentage = b->charge_full * 100 / b->charge_full_design;
+                    charge_full = b->charge_full;
+                }
+                if (percentage > 100)
+                    percentage = 100;
+
+                printf ("%s %d: design capacity %d %s, "
+                        "last full capacity %d %s = %d%%\n",
+                        BATTERY_DESC, b->battery_num - 1, b->charge_full_design,
+                        b->capacity_unit, charge_full, b->capacity_unit,
+                        percentage);
+            }
+        }
     }
 }
 
@@ -183,7 +183,7 @@ battery* battery_update(battery *b)
      * Ideally the kernel would not export the sysfs file when the value is not
      * available. */
     if (b->current_now < -1)
-           b->current_now = - b->current_now;
+            b->current_now = - b->current_now;
 
     b->charge_full = get_gint_from_infofile(b, "charge_full");
     b->energy_full = get_gint_from_infofile(b, "energy_full");
@@ -198,44 +198,44 @@ battery* battery_update(battery *b)
 
     b->state = get_gchar_from_infofile(b, "status");
     if (!b->state)
-       b->state = get_gchar_from_infofile(b, "state");
+        b->state = get_gchar_from_infofile(b, "state");
     if (!b->state) {
-       if (b->charge_now != -1 || b->energy_now != -1
-               || b->charge_full != -1 || b->energy_full != -1)
-           b->state = "available";
-       else
-           b->state = "unavailable";
+        if (b->charge_now != -1 || b->energy_now != -1
+                || b->charge_full != -1 || b->energy_full != -1)
+            b->state = "available";
+        else
+            b->state = "unavailable";
     }
 
 
     /* convert energy values (in mWh) to charge values (in mAh) if needed and possible */
 
     if (b->energy_full != -1 && b->charge_full == -1) {
-       if (b->voltage_now != -1 && b->voltage_now != 0) {
-           b->charge_full = b->energy_full * 1000 / b->voltage_now;
-       } else {
-           b->charge_full = b->energy_full;
-           b->capacity_unit = "mWh";
-       }
+        if (b->voltage_now != -1 && b->voltage_now != 0) {
+            b->charge_full = b->energy_full * 1000 / b->voltage_now;
+        } else {
+            b->charge_full = b->energy_full;
+            b->capacity_unit = "mWh";
+        }
     }
 
     if (b->energy_full_design != -1 && b->charge_full_design == -1) {
-       if (b->voltage_now != -1 && b->voltage_now != 0) {
-           b->charge_full_design = b->energy_full_design * 1000 / b->voltage_now;
-       } else {
-           b->charge_full_design = b->energy_full_design;
-           b->capacity_unit = "mWh";
-       }
+        if (b->voltage_now != -1 && b->voltage_now != 0) {
+            b->charge_full_design = b->energy_full_design * 1000 / b->voltage_now;
+        } else {
+            b->charge_full_design = b->energy_full_design;
+            b->capacity_unit = "mWh";
+        }
     }
 
     if (b->energy_now != -1 && b->charge_now == -1) {
-       if (b->voltage_now != -1 && b->voltage_now != 0) {
-           b->charge_now = b->energy_now * 1000 / b->voltage_now;
-           if (b->current_now != -1)
-               b->current_now = b->current_now * 1000 / b->voltage_now;
-       } else {
-           b->charge_now = b->energy_now;
-       }
+        if (b->voltage_now != -1 && b->voltage_now != 0) {
+            b->charge_now = b->energy_now * 1000 / b->voltage_now;
+            if (b->current_now != -1)
+                b->current_now = b->current_now * 1000 / b->voltage_now;
+        } else {
+            b->charge_now = b->energy_now;
+        }
     }
 
     if (b->power_now < -1)
@@ -243,43 +243,43 @@ battery* battery_update(battery *b)
     else if (b->power_now == -1 && b->voltage_now != -1 && b->current_now != -1)
         b->power_now = b->voltage_now * b->current_now / 1000; // P = U*I
     if (b->power_now != -1 && b->current_now == -1) {
-       if (b->voltage_now != -1 && b->voltage_now != 0)
-           b->current_now = b->power_now * 1000 / b->voltage_now;
+        if (b->voltage_now != -1 && b->voltage_now != 0)
+            b->current_now = b->power_now * 1000 / b->voltage_now;
     }
 
 
     if (b->charge_full < MIN_CAPACITY)
-       b->percentage = 0;
+        b->percentage = 0;
     else {
-       int promille = (b->charge_now * 1000) / b->charge_full;
-       b->percentage = (promille + 5) / 10; /* round properly */
+        int promille = (b->charge_now * 1000) / b->charge_full;
+        b->percentage = (promille + 5) / 10; /* round properly */
     }
     if (b->percentage > 100)
-       b->percentage = 100;
+        b->percentage = 100;
 
 
     if (b->current_now == -1) {
-       b->poststr = "rate information unavailable";
-       b->seconds = -1;
+        b->poststr = "rate information unavailable";
+        b->seconds = -1;
     } else if (!strcasecmp(b->state, "charging")) {
-       if (b->current_now > MIN_PRESENT_RATE) {
-           b->seconds = 3600 * (b->charge_full - b->charge_now) / b->current_now;
-           b->poststr = " until charged";
-       } else {
-           b->poststr = "charging at zero rate - will never fully charge.";
-           b->seconds = -1;
-       }
+        if (b->current_now > MIN_PRESENT_RATE) {
+            b->seconds = 3600 * (b->charge_full - b->charge_now) / b->current_now;
+            b->poststr = " until charged";
+        } else {
+            b->poststr = "charging at zero rate - will never fully charge.";
+            b->seconds = -1;
+        }
     } else if (!strcasecmp(b->state, "discharging")) {
-       if (b->current_now > MIN_PRESENT_RATE) {
-           b->seconds = 3600 * b->charge_now / b->current_now;
-           b->poststr = " remaining";
-       } else {
-           b->poststr = "discharging at zero rate - will never fully discharge.";
-           b->seconds = -1;
-       }
+        if (b->current_now > MIN_PRESENT_RATE) {
+            b->seconds = 3600 * b->charge_now / b->current_now;
+            b->poststr = " remaining";
+        } else {
+            b->poststr = "discharging at zero rate - will never fully discharge.";
+            b->seconds = -1;
+        }
     } else {
-       b->poststr = NULL;
-       b->seconds = -1;
+        b->poststr = NULL;
+        b->seconds = -1;
     }
 
     return b;
@@ -291,23 +291,23 @@ battery *battery_get() {
     const gchar *entry;
     GDir * dir = g_dir_open( ACPI_PATH_SYS_POWER_SUPPY, 0, &error );
     battery *b = NULL;
-    if ( dir == NULL ) 
+    if ( dir == NULL )
     {
-       g_warning( "NO ACPI/sysfs support in kernel: %s", error->message );
-       return NULL;
+        g_warning( "NO ACPI/sysfs support in kernel: %s", error->message );
+        return NULL;
     }
-    while ( ( entry = g_dir_read_name (dir) ) != NULL )  
+    while ( ( entry = g_dir_read_name (dir) ) != NULL )
     {
-       b = battery_new();
-       b->path = g_strdup( entry );
-       battery_update ( b );
-       if ( b->type_battery == TRUE ) 
-           break;
-       /* ignore non-batteries */
-       else {                  
-           g_free(b);
-           b = NULL;
-       }
+        b = battery_new();
+        b->path = g_strdup( entry );
+        battery_update ( b );
+        if ( b->type_battery == TRUE )
+            break;
+        /* ignore non-batteries */
+        else {
+            g_free(b);
+            b = NULL;
+        }
     }
     g_dir_close( dir );
     return b;
@@ -324,10 +324,10 @@ void battery_free(battery* bat)
 gboolean battery_is_charging( battery *b )
 {
     if (!b->state)
-       return TRUE; // Same as "Unkown"
+        return TRUE; // Same as "Unkown"
     return ( strcasecmp( b->state, "Unknown" ) == 0 ||
-            strcasecmp( b->state, "Full" ) == 0
-            || strcasecmp( b->state, "Charging" ) == 0 );
+             strcasecmp( b->state, "Full" ) == 0
+             || strcasecmp( b->state, "Charging" ) == 0 );
 }
 
 gint battery_get_remaining( battery *b )
index a6d1483..ad2bdbe 100644 (file)
@@ -1,18 +1,18 @@
 /*
  *      batt_sys.h
- *      
+ *
  *      Copyright 2009 Juergen Hötzel <juergen@archlinux.org>
- *      
+ *
  *      This program is free software; you can redistribute it and/or modify
  *      it under the terms of the GNU General Public License as published by
  *      the Free Software Foundation; either version 2 of the License, or
  *      (at your option) any later version.
- *      
+ *
  *      This program is distributed in the hope that it will be useful,
  *      but WITHOUT ANY WARRANTY; without even the implied warranty of
  *      MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
  *      GNU General Public License for more details.
- *      
+ *
  *      You should have received a copy of the GNU General Public License
  *      along with this program; if not, write to the Free Software
  *      Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston,
index 72e1a8a..08747ff 100644 (file)
@@ -215,7 +215,7 @@ get_cpus(cpufreq *cf)
             snprintf(cpu_path, sizeof(cpu_path), "%s/%s/cpufreq", SYSFS_CPU_DIRECTORY, cpu);
 
             GDir * cpufreqDir = g_dir_open(SYSFS_CPU_DIRECTORY, 0, NULL);
-               if (cpufreqDir == NULL)
+            if (cpufreqDir == NULL)
             {
                 cf->cpus = NULL;
                 cf->has_cpufreq = 0;
@@ -307,7 +307,7 @@ clicked(GtkWidget *widget, GdkEventButton *evt, Panel *panel)
     if( evt->button == 1 )
     {
 // Setting governor can't work without root privilege
-//      gtk_menu_popup( cpufreq_menu((cpufreq*)plugin->priv), NULL, NULL, NULL, NULL, 
+//      gtk_menu_popup( cpufreq_menu((cpufreq*)plugin->priv), NULL, NULL, NULL, NULL,
 //                      evt->button, evt->time );
       return TRUE;
     }
index e5991b2..2229154 100644 (file)
@@ -54,7 +54,7 @@ typedef struct {
        AWAITING_SECOND_CHANGE,                 /* Experimenting to determine interval, waiting for second change */
        ONE_SECOND_INTERVAL,                    /* Determined that one second interval is necessary */
        ONE_MINUTE_INTERVAL                     /* Determined that one minute interval is sufficient */
-    } expiration_interval;                     
+    } expiration_interval;
     int experiment_count;                      /* Count of experiments that have been done to determine interval */
     char * prev_clock_value;                   /* Previous value of clock */
     char * prev_tooltip_value;                 /* Previous value of tooltip */
index 85e9494..d4a60c3 100644 (file)
@@ -168,9 +168,9 @@ place_in_menu_cb (GtkWidget * widget, gpointer user_data)
 
 /* Position the entry */
 static void
-place_in_menu (GtkWidget *menubar, 
-               GtkWidget *menuitem, 
-               IndicatorObject *io, 
+place_in_menu (GtkWidget *menubar,
+               GtkWidget *menuitem,
+               IndicatorObject *io,
                IndicatorObjectEntry *entry)
 {
   incoming_position_t position;
@@ -269,7 +269,7 @@ entry_secondary_activated (GtkWidget * widget, GdkEvent * event, gpointer user_d
 
           g_return_val_if_fail(INDICATOR_IS_OBJECT(io), FALSE);
 
-          g_signal_emit_by_name(io, INDICATOR_OBJECT_SIGNAL_SECONDARY_ACTIVATE, 
+          g_signal_emit_by_name(io, INDICATOR_OBJECT_SIGNAL_SECONDARY_ACTIVATE,
               entry, event->button.time);
         }
       }
@@ -413,7 +413,7 @@ entry_moved_find_cb (GtkWidget * widget, gpointer userdata)
 }
 
 /* Gets called when an entry for an object was moved. */
-static void 
+static void
 entry_moved (IndicatorObject * io, IndicatorObjectEntry * entry,
              gint old G_GNUC_UNUSED, gint new G_GNUC_UNUSED, gpointer user_data)
 {
@@ -593,7 +593,7 @@ menubar_press (GtkWidget * widget,
 static gboolean
 menubar_scroll (GtkWidget      *widget G_GNUC_UNUSED,
                 GdkEventScroll *event,
-                gpointer        data G_GNUC_UNUSED)    
+                gpointer        data G_GNUC_UNUSED)
 {
 
     GtkWidget *menuitem;
index 17fe64e..c7d9b53 100644 (file)
@@ -466,7 +466,7 @@ static int load_menu(menup* m, MenuCacheDir* dir, GtkWidget* menu, int pos )
 {
     GSList * l;
     /* number of visible entries */
-    gint count = 0;            
+    gint count = 0;
 #if MENU_CACHE_CHECK_VERSION(0, 4, 0)
     GSList *children;
 #if MENU_CACHE_CHECK_VERSION(0, 5, 0)
@@ -488,11 +488,11 @@ static int load_menu(menup* m, MenuCacheDir* dir, GtkWidget* menu, int pos )
 #endif
     {
         MenuCacheItem* item = MENU_CACHE_ITEM(l->data);
-       
-        gboolean is_visible = ((menu_cache_item_get_type(item) != MENU_CACHE_TYPE_APP) || 
+
+        gboolean is_visible = ((menu_cache_item_get_type(item) != MENU_CACHE_TYPE_APP) ||
                               (panel_menu_item_evaluate_visibility(item, m->visibility_flags)));
-       
-       if (is_visible) 
+
+       if (is_visible)
        {
             GtkWidget * mi = create_item(item, m);
            count++;
@@ -501,14 +501,14 @@ static int load_menu(menup* m, MenuCacheDir* dir, GtkWidget* menu, int pos )
                 if( pos >= 0 )
                     ++pos;
                /* process subentries */
-               if (menu_cache_item_get_type(item) == MENU_CACHE_TYPE_DIR) 
+               if (menu_cache_item_get_type(item) == MENU_CACHE_TYPE_DIR)
                {
                     GtkWidget* sub = gtk_menu_new();
                    /*  always pass -1 for position */
-                   gint s_count = load_menu( m, MENU_CACHE_DIR(item), sub, -1 );    
-                    if (s_count) 
-                       gtk_menu_item_set_submenu( GTK_MENU_ITEM(mi), sub );        
-                   else 
+                   gint s_count = load_menu( m, MENU_CACHE_DIR(item), sub, -1 );
+                    if (s_count)
+                       gtk_menu_item_set_submenu( GTK_MENU_ITEM(mi), sub );
+                   else
                    {
                        /* don't keep empty submenus */
                        gtk_widget_destroy( sub );
index b00a6c9..c58c740 100644 (file)
  *       in the config file.
  *     - edit the monitors_constructor() function so that options are correctly
  *     aplied. Adding something like :
- *     
+ *
  *     else if (g_ascii_strcasecmp(s.t[0], "DisplayFOO") == 0)
  *         mp->displayed_monitors[FOO_POSITION] = atoi(s.t[1])
  *     else if (g_ascii_strcasecmp(s.t[0], "FOOColor") == 0)
- *         colors[FOO_POSITION] = g_strndup(s.t[1], COLOR_SIZE-1);       
+ *         colors[FOO_POSITION] = g_strndup(s.t[1], COLOR_SIZE-1);
  *
  *     should be enough.
  * 6) Enjoy.
  */
 
 /*
- * FIXME : known BUGS : 
+ * FIXME : known BUGS :
  *     - when removing a monitor and re-adding it, it is drawn with a white
  *     border of BORDER_SIZE pixels around it.
  */
@@ -87,7 +87,7 @@
 #endif
 
 /*
- * Stats are stored in a circular buffer. 
+ * Stats are stored in a circular buffer.
  * Newest values are on the left of the ring cursor.
  * Oldest values are on the right of the ring cursor.
  */
@@ -111,7 +111,7 @@ typedef struct Monitor Monitor;
 typedef gboolean (*update_func) (Monitor *);
 typedef void (*tooltip_update_func) (Monitor *);
 
-/* 
+/*
  * Position of our monitors : monitor 0 will always be on the left of the
  * plugin, monitor 1 on the right of monitor 0 (or on the left of the plugin if
  * monitor 0 is not displayed), etc.
@@ -130,8 +130,8 @@ typedef struct {
     guint    timer;                          /* Timer for regular updates     */
 } MonitorsPlugin;
 
-/* 
- * Prototypes 
+/*
+ * Prototypes
  */
 static void monitor_set_foreground_color(MonitorsPlugin *, Monitor *, const gchar *);
 
@@ -157,7 +157,7 @@ static gboolean monitors_apply_config(gpointer);
  *                              Monitor functions                             *
  ******************************************************************************/
 static Monitor*
-monitor_init(MonitorsPlugin *mp, Monitor *m, gchar *color) 
+monitor_init(MonitorsPlugin *mp, Monitor *m, gchar *color)
 {
     ENTER;
 
@@ -168,11 +168,11 @@ monitor_init(MonitorsPlugin *mp, Monitor *m, gchar *color)
     monitor_set_foreground_color(mp, m, color);
 
     /* Signals */
-    g_signal_connect(G_OBJECT(m->da), "configure-event", 
+    g_signal_connect(G_OBJECT(m->da), "configure-event",
         G_CALLBACK(configure_event), (gpointer) m);
     g_signal_connect (G_OBJECT(m->da), "expose-event",
         G_CALLBACK(expose_event), (gpointer) m);
-    /* g_signal_connect(G_OBJECT(m->da), "button-press-event", 
+    /* g_signal_connect(G_OBJECT(m->da), "button-press-event",
                     G_CALLBACK(plugin_button_press_event), p); */
 
     return m;
@@ -284,7 +284,7 @@ cpu_tooltip_update (Monitor *m)
 static gboolean
 mem_update(Monitor * m)
 {
-    ENTER; 
+    ENTER;
 
     FILE *meminfo;
     int const buflen = 80;
@@ -379,7 +379,7 @@ mem_tooltip_update (Monitor *m)
  *                            Basic events handlers                           *
  ******************************************************************************/
 static gboolean
-configure_event(GtkWidget* widget, GdkEventConfigure* dummy, gpointer data) 
+configure_event(GtkWidget* widget, GdkEventConfigure* dummy, gpointer data)
 {
     (void) dummy;
     GtkAllocation allocation;
@@ -439,8 +439,8 @@ configure_event(GtkWidget* widget, GdkEventConfigure* dummy, gpointer data)
                            nvalues * sizeof(stats_set));
                 }
                 /* New allocation is smaller, and also smaller than the ring
-                 * buffer cursor.  Discard all oldest samples following the ring 
-                 * buffer cursor and additional samples at the beginning of the 
+                 * buffer cursor.  Discard all oldest samples following the ring
+                 * buffer cursor and additional samples at the beginning of the
                  * buffer. */
                 else
                 {
@@ -468,7 +468,7 @@ configure_event(GtkWidget* widget, GdkEventConfigure* dummy, gpointer data)
 }
 
 static gboolean
-expose_event(GtkWidget * widget, GdkEventExpose * event, Monitor *m) 
+expose_event(GtkWidget * widget, GdkEventExpose * event, Monitor *m)
 {
     /* Draw the requested part of the pixmap onto the drawing area.
      * Translate it in both x and y by the border size. */
@@ -539,9 +539,9 @@ redraw_pixmap (Monitor *m)
 }
 
 
-static update_func update_functions [N_MONITORS] = { 
-    [CPU_POSITION] = cpu_update, 
-    [MEM_POSITION] = mem_update 
+static update_func update_functions [N_MONITORS] = {
+    [CPU_POSITION] = cpu_update,
+    [MEM_POSITION] = mem_update
 };
 
 static char *default_colors[N_MONITORS] = {
@@ -558,12 +558,12 @@ static tooltip_update_func tooltip_update[N_MONITORS] = {
 /* Colors currently used. We cannot store them in the "struct Monitor"s where
  * they belong, because we free these when the user removes them. And since we
  * want the colors to stay the same even after removing/adding a widget... */
-static char *colors[N_MONITORS] = { 
-    NULL, 
-    NULL 
+static char *colors[N_MONITORS] = {
+    NULL,
+    NULL
 };
 
-/* 
+/*
  * This function is called every UPDATE_PERIOD seconds. It updates all
  * monitors.
  */
@@ -643,7 +643,7 @@ monitors_constructor(Panel *panel, config_setting_t *settings)
     if (config_setting_lookup_string(settings, "RAMColor", &tmp))
         colors[MEM_POSITION] = g_strndup(tmp, COLOR_SIZE-1);
 
-    /* Initializing monitors */ 
+    /* Initializing monitors */
     for (i = 0; i < N_MONITORS; i++)
     {
         if (!colors[i])
@@ -651,9 +651,9 @@ monitors_constructor(Panel *panel, config_setting_t *settings)
 
         if (mp->displayed_monitors[i])
         {
-            mp->monitors[i] = monitors_add_monitor(p, mp, 
-                                                   update_functions[i], 
-                                                   tooltip_update[i], 
+            mp->monitors[i] = monitors_add_monitor(p, mp,
+                                                   update_functions[i],
+                                                   tooltip_update[i],
                                                    colors[i]);
         }
     }
@@ -685,7 +685,7 @@ monitors_destructor(gpointer user_data)
     }
 
     g_free(mp->action);
-    g_free(mp); 
+    g_free(mp);
 
     RET();
 }
@@ -733,9 +733,9 @@ start:
         if (mp->displayed_monitors[i] && !mp->monitors[i])
         {
             /* We've just activated monitor<i> */
-            mp->monitors[i] = monitors_add_monitor(p, mp, 
-                                                   update_functions[i], 
-                                                   tooltip_update[i], 
+            mp->monitors[i] = monitors_add_monitor(p, mp,
+                                                   update_functions[i],
+                                                   tooltip_update[i],
                                                    colors[i]);
             /*
              * It is probably best for users if their monitors are always
@@ -745,7 +745,7 @@ start:
              * gtk_box_pack_start/gtk_box_pack_end, and use
              * gtk_box_reorder_child.
              */
-            gtk_box_reorder_child(GTK_BOX(p), 
+            gtk_box_reorder_child(GTK_BOX(p),
                                   mp->monitors[i]->da,current_n_monitors-1);
         }
         else if (!mp->displayed_monitors[i] && mp->monitors[i])
@@ -755,7 +755,7 @@ start:
             monitor_free(mp->monitors[i]);
             mp->monitors[i] = NULL;
         }
-        if (mp->monitors[i] && 
+        if (mp->monitors[i] &&
             strncmp(mp->monitors[i]->color, colors[i], COLOR_SIZE) != 0)
         {
             /* We've changed the color */
index c218c53..03786f7 100644 (file)
@@ -247,7 +247,7 @@ int netproc_scandevice(int sockfd, int iwsockfd, FILE *fp, NETDEVLIST_PTR *netde
                /* check interface hw_type */
                bzero(&ifr, sizeof(ifr));
                strncpy(ifr.ifr_name, name, strlen(name));
-               ifr.ifr_name[strlen(name)+1] = '\0';
+               ifr.ifr_name[strlen(name)+1] = '\0';
                if (ioctl(sockfd, SIOCGIFHWADDR, &ifr)<0)
                        continue;
 
@@ -279,7 +279,7 @@ int netproc_scandevice(int sockfd, int iwsockfd, FILE *fp, NETDEVLIST_PTR *netde
                        if (devptr->info.recv_packets!=in_packets&&devptr->info.trans_packets!=out_packets) {
                                if (devptr->info.status!=NETDEV_STAT_BOTHRS)
                                        devptr->info.updated = TRUE;
-                       
+
                                devptr->info.status = NETDEV_STAT_BOTHRS;
                        } else if (devptr->info.recv_packets!=in_packets) {
                                if (devptr->info.status!=NETDEV_STAT_RECVDATA)
@@ -326,7 +326,7 @@ int netproc_scandevice(int sockfd, int iwsockfd, FILE *fp, NETDEVLIST_PTR *netde
                                /* Workaround for Atheros Cards */
                                if (strncmp(devptr->info.ifname, "ath", 3)==0)
                                        wireless_refresh(iwsockfd, devptr->info.ifname);
-                               
+
                                /* plug */
                                bzero(&ifr, sizeof(ifr));
                                strcpy(ifr.ifr_name, devptr->info.ifname);
index adbfaf7..ac1ab60 100644 (file)
@@ -130,9 +130,9 @@ lxnm_send_command(GIOChannel *gio, int command, const char* cmdargs)
 }
 
 char *lxnm_wireless_command_make(const char *ifname, const char *essid,
-                                                                const char *apaddr, const char *key,
-                                                                int protocol, int key_mgmt,
-                                                                int group, int pairwise)
+                                 const char *apaddr, const char *key,
+                                 int protocol, int key_mgmt,
+                                 int group, int pairwise)
 {
     char *cmd_essid;
     char *cmd_key;
@@ -141,13 +141,13 @@ char *lxnm_wireless_command_make(const char *ifname, const char *essid,
     if (essid==NULL || strlen(essid)==0) {
         cmd_essid = g_strdup("NULL");
     } else {
-       cmd_essid = asc2hex(essid);
+        cmd_essid = asc2hex(essid);
     }
 
     if (key==NULL || strlen(key)==0) {
         cmd_key = g_strdup("OFF");
     } else {
-       cmd_key = asc2hex(key);
+        cmd_key = asc2hex(key);
     }
 
     cmd = g_strdup_printf("%s %s %s %s %d %d %d %d", ifname, cmd_essid, apaddr,
index 78ea4b8..d3e0f14 100644 (file)
@@ -38,20 +38,20 @@ struct statusicon *create_statusicon(GtkWidget *box, const char *filename,
     gtk_box_pack_start(GTK_BOX(box), newicon->main, TRUE, TRUE, 0);
 
     /* icon */
-    
+
     /*icon theme*/
     GtkIconTheme* icon_theme = gtk_icon_theme_get_default();
-    
+
     /*if we've got a theme*/
     if(gtk_icon_theme_has_icon(icon_theme, icon_name)) {
-               GdkPixbuf* temp_pixbuf = gtk_icon_theme_load_icon(icon_theme, icon_name, 24, 0, NULL);
-               newicon->icon = gtk_image_new_from_pixbuf(temp_pixbuf);
-       }
-    
+        GdkPixbuf* temp_pixbuf = gtk_icon_theme_load_icon(icon_theme, icon_name, 24, 0, NULL);
+        newicon->icon = gtk_image_new_from_pixbuf(temp_pixbuf);
+    }
+
     /* oh well...*/
     else {
-               newicon->icon = gtk_image_new_from_file(filename);
-       }
+        newicon->icon = gtk_image_new_from_file(filename);
+    }
     gtk_container_add(GTK_CONTAINER(newicon->main), newicon->icon);
     gtk_widget_show_all(newicon->main);
 
@@ -63,7 +63,7 @@ struct statusicon *create_statusicon(GtkWidget *box, const char *filename,
 
 void statusicon_destroy(struct statusicon *icon)
 {
-       if (icon==NULL)
+    if (icon==NULL)
         return;
 
     gtk_widget_destroy(GTK_WIDGET(icon->icon));
index f2360fc..1a35ff7 100644 (file)
 
 /*
 static const char * iw_ie_cypher_name[] = {
-       "none",
-       "WEP-40",
-       "TKIP",
-       "WRAP",
-       "CCMP",
-       "WEP-104",
+    "none",
+    "WEP-40",
+    "TKIP",
+    "WRAP",
+    "CCMP",
+    "WEP-104",
 };
 
 static const char * iw_ie_key_mgmt_name[] = {
-       "none",
-       "802.1x",
-       "PSK",
+    "none",
+    "802.1x",
+    "PSK",
 };
 */
 
 void wireless_aplist_free(void *aplist, GObject *dummy)
 {
-       APLIST *ptr;
-       APLIST *delptr;
+    APLIST *ptr;
+    APLIST *delptr;
 
     if (aplist!=NULL) {
         ptr = aplist;
         do {
-                       g_free(ptr->info->essid);
-                       g_free(ptr->info->apaddr);
-                       g_free(ptr->info);
+            g_free(ptr->info->essid);
+            g_free(ptr->info->apaddr);
+            g_free(ptr->info);
 
             delptr = ptr;
             ptr = ptr->next;
-                       g_free(delptr);
+            g_free(delptr);
         } while(ptr!=NULL);
     }
 }
 
-void 
-wireless_gen_ie(ap_info *info, unsigned char *buffer, int ielen)
+void wireless_gen_ie(ap_info *info, unsigned char *buffer, int ielen)
 {
        int offset = 2;
        int count;
@@ -94,7 +93,7 @@ wireless_gen_ie(ap_info *info, unsigned char *buffer, int ielen)
                        offset += 4;
                        break;
 
-               case 0x30: /* IEEE 802.11i/WPA2 */ 
+               case 0x30: /* IEEE 802.11i/WPA2 */
                        wpa_oui = wpa2_oui;
                        break;
 
@@ -245,7 +244,7 @@ wireless_parse_scanning_event(struct iw_event *event, ap_info *oldinfo)
                                /* check IE type */
                                switch(iebuf[offset]) {
                                        case 0xdd: /* WPA or else */
-                                       case 0x30: /* IEEE 802.11i/WPA2 */ 
+                                       case 0x30: /* IEEE 802.11i/WPA2 */
                                                wireless_gen_ie(info, iebuf, ielen);
                                                break;
                                }
@@ -425,7 +424,7 @@ realloc:
 
                                /* Bad error */
                                free(buffer);
-                               fprintf(stderr, 
+                               fprintf(stderr,
                                "%-8.16s  Failed to read scan data : %s\n\n",
                                                ifname, strerror(errno));
                                return NULL;
index 672887c..2fc7b76 100644 (file)
@@ -98,7 +98,7 @@ static void
 netstatus_dialog_update_state (NetstatusDialogData *data)
 {
   NetstatusState state;
-  
+
   state = netstatus_iface_get_state (data->iface);
   gtk_label_set_text (GTK_LABEL (data->status),
                      netstatus_get_state_string (state));
@@ -124,7 +124,7 @@ netstatus_dialog_update_name (NetstatusDialogData *data)
       gtk_window_set_title (GTK_WINDOW (data->dialog), p);
       g_free (p);
     }
-  
+
   UNKNOWN_STR (text, iface_name);
   gtk_entry_set_text (GTK_ENTRY (data->name_entry), text);
 }
@@ -177,11 +177,11 @@ netstatus_dialog_update_activity (NetstatusDialogData *data)
   print_packets_string (str, stats.out_packets);
   print_bytes_string (str, stats.out_bytes);
   gtk_label_set_text (GTK_LABEL (data->sent), str->str);
-       
+
   print_packets_string (str, stats.in_packets);
   print_bytes_string (str, stats.in_bytes);
   gtk_label_set_text (GTK_LABEL (data->received), str->str);
-  
+
   g_string_free (str, TRUE);
 }
 
@@ -305,7 +305,7 @@ netstatus_dialog_update_device_support (NetstatusDialogData *data)
 
       /* Device type */
       gtk_label_set_text (GTK_LABEL (data->dev_type), type);
-      
+
       /* Address */
       if (addr)
        gtk_label_set_text (GTK_LABEL (data->dev_addr), addr);
@@ -389,7 +389,7 @@ netstatus_dialog_response (GtkWidget *dialog,
        if (error)
          {
            GtkWidget *message_dialog;
-                                                                              
+
            message_dialog = gtk_message_dialog_new (GTK_WINDOW (dialog),
                                                     GTK_DIALOG_DESTROY_WITH_PARENT,
                                                     GTK_MESSAGE_ERROR,
@@ -399,11 +399,11 @@ netstatus_dialog_response (GtkWidget *dialog,
 
            gtk_window_set_resizable (GTK_WINDOW (message_dialog), FALSE);
            gtk_window_set_screen (GTK_WINDOW (message_dialog), screen);
-           
+
            g_signal_connect (message_dialog, "response",
                              G_CALLBACK (gtk_widget_destroy),
                              NULL);
-           
+
            gtk_widget_show (message_dialog);
 
            g_error_free (error);
@@ -581,7 +581,7 @@ netstatus_dialog_setup_configure_button (NetstatusDialogData *data)
                    G_CALLBACK (netstatus_iface_configure), data);
 
   netstatus_dialog_detect_configuration_tool (data);
-  
+
   if (!data->config_tool)
     gtk_widget_hide (data->configure_button);
 
@@ -595,7 +595,7 @@ netstatus_dialog_setup_connection (NetstatusDialogData *data)
   GtkWidget *hbox;
   GtkWidget *icon;
   GtkListStore* model;
-  
+
   hbox = (GtkWidget*)gtk_builder_get_object(data->builder, "connection_hbox");
 
   icon = netstatus_icon_new (data->iface);
@@ -664,7 +664,7 @@ netstatus_dialog_setup_device_support (NetstatusDialogData *data)
   data->dev_frame = (GtkWidget*)gtk_builder_get_object(data->builder, "dev_frame");
   data->dev_type  = (GtkWidget*)gtk_builder_get_object(data->builder, "dev_type_label");
   data->dev_addr  = (GtkWidget*)gtk_builder_get_object(data->builder, "dev_addr_label");
-  
+
   netstatus_dialog_update_device_support (data);
 }
 
@@ -702,7 +702,7 @@ _netstatus_dialog_iface_list_monitor (NetstatusDialogData *data)
       gtk_list_store_clear(model);
       g_signal_handlers_block_by_func (data->name_entry,
                                       G_CALLBACK (netstatus_dialog_set_iface_name), data);
-                                      
+
       for (l = iface_names; l; l = l->next)
         {
           GtkTreeIter it;
@@ -766,7 +766,7 @@ netstatus_dialog_new (NetstatusIface *iface)
                                        G_CALLBACK (netstatus_dialog_iface_name_changed),
                                        data,
                                        data->dialog);
-  
+
   netstatus_connect_signal_while_alive (data->iface,
                                        "notify::wireless",
                                        G_CALLBACK (netstatus_dialog_iface_signal_strength_changed),
index 970e1d3..b2b8674 100644 (file)
@@ -249,7 +249,7 @@ netstatus_iface_get_property (GObject    *object,
                              GParamSpec *pspec)
 {
   NetstatusIface *iface = (NetstatusIface *) object;
-  
+
   switch (property_id)
     {
     case PROP_NAME:
@@ -304,7 +304,7 @@ netstatus_iface_set_name (NetstatusIface *iface,
   iface->priv->name = g_strdup (name);
 
   netstatus_iface_init_monitor (iface);
-  
+
   g_object_notify (G_OBJECT (iface), "name");
 }
 
@@ -389,7 +389,7 @@ netstatus_iface_clear_error (NetstatusIface *iface,
 
       g_error_free (iface->priv->error);
       iface->priv->error = NULL;
-     
+
       g_object_notify (G_OBJECT (iface), "state");
       g_object_notify (G_OBJECT (iface), "error");
     }
@@ -470,7 +470,7 @@ netstatus_iface_poll_iface_statistics (NetstatusIface *iface,
                                         NETSTATUS_ERROR_STATISTICS,
                                         error_message);
       g_free (error_message);
-      
+
       return FALSE;
     }
 
@@ -522,7 +522,7 @@ netstatus_iface_poll_state (NetstatusIface *iface)
   dprintf (POLLING, "Bytes in: %ld out: %ld. Prev in: %ld out: %ld\n",
           in_bytes, out_bytes,
           iface->priv->stats.in_bytes, iface->priv->stats.out_bytes);
-  
+
   rx = in_packets  > iface->priv->stats.in_packets;
   tx = out_packets > iface->priv->stats.out_packets;
 
@@ -567,7 +567,7 @@ netstatus_iface_poll_wireless_details (NetstatusIface *iface,
                                         NETSTATUS_ERROR_WIRELESS_DETAILS,
                                         error_message);
       g_free (error_message);
-      
+
       return FALSE;
     }
 
@@ -643,7 +643,7 @@ netstatus_iface_monitor_timeout (NetstatusIface *iface)
     }
 
   netstatus_iface_increase_poll_delay_in_error (iface);
-  
+
   return TRUE;
 }
 
@@ -708,7 +708,7 @@ netstatus_iface_get_inet4_details (NetstatusIface  *iface,
                 g_strerror (errno));
       return FALSE;
     }
-  
+
   if_req.ifr_addr.sa_family = AF_INET;
 
   strncpy (if_req.ifr_name, iface->priv->name, IF_NAMESIZE - 1);
@@ -776,17 +776,17 @@ print_ash_addr (guchar *p)
   int      i = 0;
 
   str = g_string_new ("[");
-  
+
   while (p [i] != 0xc9 && p [i] != 0xff && (i < ASH_ALEN))
     g_string_append_printf (str, "%1x", p [i++]);
 
   g_string_append_c (str, ']');
-  
+
   retval = str->str;
   g_string_free (str, FALSE);
 
   return retval;
-  
+
 #undef ASH_ALEN
 }
 
@@ -798,7 +798,7 @@ print_ax25_addr (guchar *p)
   int      i;
 
   str = g_string_new (NULL);
-  
+
   for (i = 0; i < 6; i++)
     {
       char c = (p [i] & 0377) >> 1;
@@ -807,7 +807,7 @@ print_ax25_addr (guchar *p)
        {
          retval = str->str;
          g_string_free (str, FALSE);
-         
+
          return retval;
        }
 
@@ -1024,7 +1024,6 @@ static struct HwType
 static struct HwType *
 netstatus_iface_get_hw_details (NetstatusIface  *iface,
                                char           **hw_addr)
-                               
 {
 #ifdef SIOCGIFHWADDR
   static struct HwType *hw_type = NULL;
@@ -1034,7 +1033,7 @@ netstatus_iface_get_hw_details (NetstatusIface  *iface,
 
   if (hw_addr)
     *hw_addr = NULL;
-  
+
   if (!iface->priv->name)
     return NULL;
 
@@ -1044,7 +1043,7 @@ netstatus_iface_get_hw_details (NetstatusIface  *iface,
                 g_strerror (errno));
       return NULL;
     }
-  
+
   strncpy (if_req.ifr_name, iface->priv->name, IF_NAMESIZE - 1);
   if_req.ifr_name [IF_NAMESIZE - 1] = '\0';
   if (ioctl (fd, SIOCGIFHWADDR, &if_req) < 0)
@@ -1078,7 +1077,7 @@ netstatus_iface_get_hw_details (NetstatusIface  *iface,
 
 #else /* !defined(SIOCGIFHWADDR) */
   return NULL;
-#endif 
+#endif
 }
 
 gboolean
@@ -1163,7 +1162,7 @@ get_ifconf (int      fd,
                                      NETSTATUS_ERROR_IOCTL_IFCONF,
                                      _("SIOCGIFCONF error: %s"),
                                      g_strerror (errno));
-                                     
+
              return NULL;
            }
        }
@@ -1197,7 +1196,7 @@ netstatus_list_interface_names (GError **error)
   GList         *loopbacks;
   char          *p;
   int            fd;
-  
+
   if ((fd = socket (AF_INET, SOCK_DGRAM, 0)) < 0)
     {
       if (error)
index 5f1ad41..cdfe03e 100644 (file)
@@ -19,7 +19,7 @@
  *
  * Authors:
  *    Erwann Chenede  <erwann.chenede@sun.com>
- *    Mark McLoughlin  <mark@skynet.ie>  
+ *    Mark McLoughlin  <mark@skynet.ie>
  */
 
 #ifndef __NETSTATUS_IFACE_H__
@@ -45,8 +45,8 @@ typedef struct _NetstatusIfacePrivate NetstatusIfacePrivate;
 
 struct _NetstatusIface
 {
-  GObject                 parent_instance; 
-       
+  GObject                 parent_instance;
+
   NetstatusIfacePrivate  *priv;
 };
 
index 213623a..da62a61 100644 (file)
@@ -19,7 +19,7 @@
  *
  * Authors:
  *    Erwann Chenede  <erwann.chenede@sun.com>
- *    Mark McLoughlin  <mark@skynet.ie>  
+ *    Mark McLoughlin  <mark@skynet.ie>
  *    Joe Marcus Clarke  <marcus@freebsd.org>
  */
 
@@ -169,7 +169,7 @@ netstatus_sysdeps_read_iface_statistics (const char  *iface,
   g_return_val_if_fail (out_packets != NULL, NULL);
   g_return_val_if_fail (in_bytes != NULL, NULL);
   g_return_val_if_fail (out_bytes != NULL, NULL);
-  
+
   *in_packets  = -1;
   *out_packets = -1;
   *in_bytes    = -1;
@@ -302,7 +302,7 @@ netstatus_sysdeps_read_iface_wireless_details (const char *iface,
     *is_wireless = FALSE;
   if (signal_strength)
     *signal_strength = 0;
-  
+
   fh = get_proc_net_wireless_fh ();
   if (!fh)
     return NULL;
@@ -602,7 +602,7 @@ netstatus_sysdeps_read_iface_statistics (const char *iface,
                                       error->message);
       g_error_free (error);
       g_free (command_line);
-      
+
       return error_message;
     }
   g_free (command_line);
@@ -662,7 +662,7 @@ netstatus_sysdeps_read_iface_statistics (const char *iface,
     }
   else
     {
-      error_message = g_strdup_printf ("Error running /usr/bin/netstat for '%s': %s", 
+      error_message = g_strdup_printf ("Error running /usr/bin/netstat for '%s': %s",
                                       iface, error->message);
       g_error_free (error);
     }
index e9d4365..9aa64bf 100644 (file)
@@ -19,7 +19,7 @@
  *
  * Authors:
  *    Erwann Chenede  <erwann.chenede@sun.com>
- *    Mark McLoughlin  <mark@skynet.ie>  
+ *    Mark McLoughlin  <mark@skynet.ie>
  */
 
 #ifndef __NETSTATUS_SYSDEPS_H__
index 878db94..59bea7c 100644 (file)
@@ -126,7 +126,7 @@ netstatus_connect_signal_while_alive (gpointer    object,
   GType     type;
   guint     signal_id = 0;
   GQuark    detail = 0;
-  
+
   type = G_OBJECT_TYPE (object);
 
   if (!g_signal_parse_name (detailed_signal, type, &signal_id, &detail, FALSE))
index 9c6f437..7715196 100644 (file)
@@ -85,7 +85,7 @@ on_vscale1_button_release_event (GtkWidget *widget,
                                  gpointer user_data);
 
 static void
-get_current_levels() 
+get_current_levels()
 {
        ioctl(mixer_fd, MIXER_READ(SOUND_MIXER_VOLUME), &tmpvol);
        orig.mainvol = tmpvol.left;
@@ -132,7 +132,7 @@ create_volume_window (void)
        g_signal_connect ((gpointer) spinbutton1, "value-changed",
                          G_CALLBACK (on_spinbutton1_button_release_event),
                          NULL);
-       g_object_set_data_full(G_OBJECT (volume_window), "spinbutton1", 
+       g_object_set_data_full(G_OBJECT (volume_window), "spinbutton1",
                               gtk_widget_ref (spinbutton1),
                               (GDestroyNotify) gtk_widget_unref);
 
@@ -162,19 +162,19 @@ create_volume_window (void)
 
        g_object_set_data (G_OBJECT (volume_window), "volume_window", volume_window);
        g_object_set_data_full (G_OBJECT (volume_window), "frame",
-                               gtk_widget_ref (frame), 
+                               gtk_widget_ref (frame),
                                (GDestroyNotify) gtk_widget_unref);
        g_object_set_data_full (G_OBJECT (volume_window), "vbox1",
-                               gtk_widget_ref (vbox1), 
+                               gtk_widget_ref (vbox1),
                                (GDestroyNotify) gtk_widget_unref);
        g_object_set_data_full (G_OBJECT (volume_window), "hbox1",
-                               gtk_widget_ref (hbox1), 
+                               gtk_widget_ref (hbox1),
                                (GDestroyNotify) gtk_widget_unref);
        g_object_set_data_full (G_OBJECT (volume_window), "hbox3",
-                               gtk_widget_ref (hbox3), 
+                               gtk_widget_ref (hbox3),
                                (GDestroyNotify) gtk_widget_unref);
        g_object_set_data_full (G_OBJECT (volume_window), "hbox4",
-                               gtk_widget_ref (hbox4), 
+                               gtk_widget_ref (hbox4),
                                (GDestroyNotify) gtk_widget_unref);
 
        gtk_window_add_accel_group (GTK_WINDOW (volume_window), accel_group);
@@ -186,8 +186,8 @@ create_volume_window (void)
 
 static StereoVolume vol;
 
-static gboolean 
-on_spinbutton1_button_release_event (GtkWidget *widget, 
+static gboolean
+on_spinbutton1_button_release_event (GtkWidget *widget,
                                     GdkEventButton *event,
                                     gpointer user_data)
 {
@@ -202,10 +202,10 @@ on_spinbutton1_button_release_event (GtkWidget *widget,
 
 static gboolean
 on_vscale1_button_release_event (GtkWidget *widget,
-                                GdkEventButton *event,
+                                GdkEventButton *event,
                                 gpointer user_data)
 {
-       vol.left = vol.right = 
+       vol.left = vol.right =
                (int) gtk_adjustment_get_value(GTK_ADJUSTMENT(user_data));
        ioctl(mixer_fd, MIXER_WRITE(SOUND_MIXER_VOLUME), &vol);
        return FALSE;
index ac03134..9558f5d 100644 (file)
@@ -93,17 +93,15 @@ static void update_icon (GtkWidget *p, volume_t *vol)
        else {
                        icon = gdk_pixbuf_new_from_xpm_data((const char **) volume_xpm);
        }
-       
-        
-       
+
        if (icon) {
-               if (curr_image) { 
+               if (curr_image) {
                        gtk_container_remove(GTK_CONTAINER(p), curr_image);
                        curr_image = NULL;
                }
                image = gtk_image_new_from_pixbuf(icon);
                gtk_container_add(GTK_CONTAINER(p), image);
-                
+
                curr_image = image;
        }
        gtk_widget_show_all(p);
@@ -118,9 +116,9 @@ static void on_volume_focus (GtkWidget* dlg, GdkEventFocus *event, GtkWidget *p)
        GtkAdjustment *vol_adjustment = gtk_spin_button_get_adjustment (vol_spin);
        if (! vol_adjustment) return;
        curr_volume = gtk_adjustment_get_value (vol_adjustment);
-       
+
        update_icon(p, vol);
-       
+
        /* FIXME: use smarter method */
        gtk_widget_destroy( dlg );
        vol->dlg = NULL;
@@ -137,7 +135,7 @@ static void on_mouse_scroll (GtkWidget* widget, GdkEventScroll* evt, volume_t *v
        }
        else {
                if (! vol_spin) return;
-               GtkAdjustment *vol_adjustment = 
+               GtkAdjustment *vol_adjustment =
                        gtk_spin_button_get_adjustment (vol_spin);
                if (! vol_adjustment) return;
 
@@ -167,8 +165,8 @@ static gboolean on_button_press (GtkWidget* widget, GdkEventButton* evt, Panel*
                skip_botton1_event = FALSE;
        }
 
-       switch ( evt->button ) { 
-       case 1: {       /*  Left click */
+       switch ( evt->button ) {
+       case 1: {       /*  Left click */
                if ( ! vol->dlg ) {
                        vol->dlg = create_volume_window();
 
index 0d7f00e..5592ebb 100644 (file)
@@ -6,17 +6,17 @@
  * it under the terms of the GNU General Public License as published by
  * the Free Software Foundation; either version 2 of the License, or
  * (at your option) any later version.
- * 
+ *
  * This program is distributed in the hope that it will be useful,
  * but WITHOUT ANY WARRANTY; without even the implied warranty of
  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
  * GNU General Public License for more details.
- * 
+ *
  * You should have received a copy of the GNU General Public License
  * along with this program; if not, write to the Free Software
  * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston,
  * MA 02110-1301, USA.
- * 
+ *
  */
 
 #include <stdio.h>
@@ -32,7 +32,7 @@ int  main(int argc, char *argv[])
     FILE *fp;
     char  buf[MAX_BUF_LEN];
     char *x11_xkb_dir=NULL;
-    
+
     /* Open the command for reading. */
     fp = popen("pkg-config --variable=xkb_base xkeyboard-config", "r");
     if(fp == NULL)
@@ -40,7 +40,7 @@ int  main(int argc, char *argv[])
         printf("Failed to run command\n");
         return -1;
     }
-    
+
     /* Read the output a line at a time - output it. */
     while(fgets(buf, MAX_BUF_LEN, fp) != NULL)
     {
@@ -54,9 +54,9 @@ int  main(int argc, char *argv[])
     }
     /* close */
     pclose(fp);
-    
+
     printf("Found: '%s'\n", x11_xkb_dir != NULL ? x11_xkb_dir : "none");
     g_free(x11_xkb_dir);
-    
+
     return 0;
 }
index a4e9a52..82914a9 100644 (file)
@@ -6,17 +6,17 @@
  * it under the terms of the GNU General Public License as published by
  * the Free Software Foundation; either version 2 of the License, or
  * (at your option) any later version.
- * 
+ *
  * This program is distributed in the hope that it will be useful,
  * but WITHOUT ANY WARRANTY; without even the implied warranty of
  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
  * GNU General Public License for more details.
- * 
+ *
  * You should have received a copy of the GNU General Public License
  * along with this program; if not, write to the Free Software
  * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston,
  * MA 02110-1301, USA.
- * 
+ *
  */
 
 #include <stdio.h>
@@ -31,7 +31,7 @@ int  main(int argc, char *argv[])
     FILE *fp;
     char  buf[MAX_BUF_LEN];
     char *layouts=NULL, *variants=NULL, *model=NULL;
-    
+
     /* Open the command for reading. */
     fp = popen("setxkbmap -query", "r");
     if(fp == NULL)
@@ -39,12 +39,12 @@ int  main(int argc, char *argv[])
         printf("Failed to run command\n");
         return -1;
     }
-    
+
     GRegex *p_regex_model = g_regex_new("(?<=model:).*", 0, 0, NULL);
     GRegex *p_regex_layouts = g_regex_new("(?<=layout:).*", 0, 0, NULL);
     GRegex *p_regex_variants = g_regex_new("(?<=variant:).*", 0, 0, NULL);
     GMatchInfo *p_match_info;
-    
+
     /* Read the output a line at a time - output it. */
     while(fgets(buf, MAX_BUF_LEN, fp) != NULL)
     {
@@ -59,7 +59,7 @@ int  main(int argc, char *argv[])
             continue;
         }
         g_match_info_free(p_match_info);
-        
+
         // layouts
         g_regex_match(p_regex_layouts, buf, 0, &p_match_info);
         if(g_match_info_matches(p_match_info))
@@ -71,7 +71,7 @@ int  main(int argc, char *argv[])
             continue;
         }
         g_match_info_free(p_match_info);
-        
+
         // variants
         g_regex_match(p_regex_variants, buf, 0, &p_match_info);
         if(g_match_info_matches(p_match_info))
@@ -83,16 +83,16 @@ int  main(int argc, char *argv[])
             continue;
         }
         g_match_info_free(p_match_info);
-        
+
         //printf("No match: '%s'\n", buf);
     }
-    
+
     g_regex_unref(p_regex_model);
     g_regex_unref(p_regex_layouts);
     g_regex_unref(p_regex_variants);
-    
+
     /* close */
     pclose(fp);
-    
+
     return 0;
 }
index 21cb6a8..a4e2e76 100644 (file)
@@ -168,7 +168,7 @@ void xkb_redraw(XkbPlugin *p_xkb)
 }
 
 /* Handler for "active_window" event on root window listener. */
-static void on_xkb_fbev_active_window_event(FbEv * ev, gpointer p_data) 
+static void on_xkb_fbev_active_window_event(FbEv * ev, gpointer p_data)
 {
     XkbPlugin * xkb = (XkbPlugin *)p_data;
     if (xkb->enable_perwin)
@@ -341,7 +341,7 @@ static void xkb_destructor(gpointer user_data)
 }
 
 /* Handler for "toggled" event on per-application check box of configuration dialog. */
-static void on_xkb_checkbutton_per_app_toggled(GtkToggleButton *tb, gpointer p_data) 
+static void on_xkb_checkbutton_per_app_toggled(GtkToggleButton *tb, gpointer p_data)
 {
     if(user_active == TRUE)
     {
@@ -383,13 +383,13 @@ static void on_xkb_checkbutton_keep_system_layouts_toggled(GtkToggleButton *tb,
         p_xkb->keep_system_layouts = gtk_toggle_button_get_active(tb);
         config_group_set_int(p_xkb->settings, "KeepSysLayouts", p_xkb->keep_system_layouts);
         xkb_redraw(p_xkb);
-        
+
         gtk_widget_set_sensitive(p_xkb->p_frame_kbd_model, !p_xkb->keep_system_layouts);
         gtk_widget_set_sensitive(p_xkb->p_frame_kbd_layouts, !p_xkb->keep_system_layouts);
         gtk_widget_set_sensitive(p_xkb->p_frame_change_layout, !p_xkb->keep_system_layouts);
         gtk_widget_set_sensitive(p_xkb->p_entry_advanced_opt, !p_xkb->keep_system_layouts);
         gtk_widget_set_sensitive(p_xkb->p_checkbutton_no_reset_opt, !p_xkb->keep_system_layouts);
-        
+
         if(!p_xkb->keep_system_layouts)
         {
             gtk_entry_set_icon_from_stock(GTK_ENTRY(p_xkb->p_entry_advanced_opt), GTK_ENTRY_ICON_SECONDARY, "gtk-save");
@@ -532,18 +532,18 @@ static void  on_cell_renderer_layout_change_incl_toggled(GtkCellRendererToggle *
     GtkTreeIter  tree_iter;
     GtkTreePath *p_tree_path = gtk_tree_path_new_from_string(path_str);
     gboolean     included;
-    
+
     /* get toggled iter */
     gtk_tree_model_get_iter(p_model, &tree_iter, p_tree_path);
     gtk_tree_model_get(p_model, &tree_iter, COLUMN_CHANGE_INCL, &included, -1);
-    
+
     /* do something with the value */
     included = !included;
-    
+
     /* set new value */
     gtk_list_store_set(GTK_LIST_STORE(p_model), &tree_iter, COLUMN_CHANGE_INCL, included, -1);
     gtk_list_store_set(GTK_LIST_STORE(p_model), &tree_iter, COLUMN_CHANGE_WEIGHT, included ? PANGO_WEIGHT_ULTRAHEAVY : PANGO_WEIGHT_NORMAL, -1);
-    
+
     /* clean up */
     gtk_tree_path_free(p_tree_path);
 }
@@ -581,7 +581,7 @@ static gboolean  on_treeviews_lists_button_press_event(GtkWidget *p_widget,
 static void on_button_kbd_model_clicked(GtkButton *p_button, gpointer *p_data)
 {
     XkbPlugin *p_xkb = (XkbPlugin *)p_data;
-    
+
     // dialog
     GtkWidget *p_dialog = gtk_dialog_new_with_buttons(_("Select Keyboard Model"),
                             p_xkb->p_dialog_config,
@@ -589,14 +589,14 @@ static void on_button_kbd_model_clicked(GtkButton *p_button, gpointer *p_data)
                             GTK_STOCK_CANCEL, GTK_RESPONSE_CANCEL,
                             GTK_STOCK_OK, GTK_RESPONSE_OK,
                             NULL);
-    
+
     // scrolledwindow
     GtkWidget * p_scrolledwindow_kbd_model = gtk_scrolled_window_new(NULL, NULL);
     gtk_scrolled_window_set_policy(GTK_SCROLLED_WINDOW(p_scrolledwindow_kbd_model),
                                    GTK_POLICY_AUTOMATIC, GTK_POLICY_AUTOMATIC);
     gtk_box_pack_start(GTK_BOX(gtk_dialog_get_content_area(GTK_DIALOG(p_dialog))),
                        p_scrolledwindow_kbd_model, TRUE, TRUE, 2);
-    
+
     // liststore
     GtkListStore *p_liststore_kbd_model = gtk_list_store_new(NUM_MODEL_COLUMNS, G_TYPE_STRING, G_TYPE_STRING);
     GtkWidget *p_treeview_kbd_model = gtk_tree_view_new_with_model(GTK_TREE_MODEL(p_liststore_kbd_model));
@@ -615,8 +615,8 @@ static void on_button_kbd_model_clicked(GtkButton *p_button, gpointer *p_data)
     p_column = gtk_tree_view_column_new_with_attributes(_("Id"), p_renderer, "text", COLUMN_MODEL_ID, NULL);
     gtk_tree_view_column_set_sort_column_id(p_column, COLUMN_MODEL_ID);
     gtk_tree_view_append_column(GTK_TREE_VIEW(p_treeview_kbd_model), p_column);
-    
-    
+
+
     // populate model
     GKeyFile *p_keyfile = g_key_file_new();
     gchar *xkbcfg_filepath = g_strdup_printf("%s/models.cfg", XKBCONFDIR);
@@ -641,14 +641,14 @@ static void on_button_kbd_model_clicked(GtkButton *p_button, gpointer *p_data)
         g_key_file_free(p_keyfile);
     }
     g_free(xkbcfg_filepath);
-    
+
     // callback for double click
     g_signal_connect(p_treeview_kbd_model, "button-press-event",
                      G_CALLBACK(on_treeviews_lists_button_press_event),
                      gtk_dialog_get_widget_for_response(GTK_DIALOG(p_dialog), GTK_RESPONSE_OK));
     // sort for description
     gtk_tree_view_column_clicked(p_column);
-    
+
     gtk_widget_set_size_request(p_dialog, 700, 500);
     gtk_widget_show_all(GTK_WIDGET(p_scrolledwindow_kbd_model));
     gint  response = gtk_dialog_run(GTK_DIALOG(p_dialog));
@@ -681,9 +681,9 @@ static gboolean  change_opt_tree_model_foreach(GtkTreeModel *p_model,
                                                gpointer p_data)
 {
     XkbPlugin *p_xkb = (XkbPlugin *)p_data;
-    
+
     gboolean  included;
-    
+
     gtk_tree_model_get(p_model, p_iter, COLUMN_CHANGE_INCL, &included,  -1);
     if(included)
     {
@@ -694,9 +694,9 @@ static gboolean  change_opt_tree_model_foreach(GtkTreeModel *p_model,
             g_string_append_c(p_xkb->p_gstring_change_opt_partial, ',');
         }
         g_string_append(p_xkb->p_gstring_change_opt_partial, change_opt_id);
-        
+
         //g_printf("\npartial change opt = '%s'\n", p_xkb->p_gstring_change_opt_partial->str);
-        
+
         g_free(change_opt_id);
     }
     return FALSE;
@@ -705,7 +705,7 @@ static gboolean  change_opt_tree_model_foreach(GtkTreeModel *p_model,
 static void on_button_kbd_change_layout_clicked(GtkButton *p_button, gpointer *p_data)
 {
     XkbPlugin *p_xkb = (XkbPlugin *)p_data;
-    
+
     // dialog
     GtkWidget *p_dialog = gtk_dialog_new_with_buttons(_("Select Layout Change Type"),
                             p_xkb->p_dialog_config,
@@ -713,14 +713,14 @@ static void on_button_kbd_change_layout_clicked(GtkButton *p_button, gpointer *p
                             GTK_STOCK_CANCEL, GTK_RESPONSE_CANCEL,
                             GTK_STOCK_OK, GTK_RESPONSE_OK,
                             NULL);
-    
+
     // scrolledwindow
     GtkWidget * p_scrolledwindow_kbd_change = gtk_scrolled_window_new(NULL, NULL);
     gtk_scrolled_window_set_policy(GTK_SCROLLED_WINDOW(p_scrolledwindow_kbd_change),
                                    GTK_POLICY_AUTOMATIC, GTK_POLICY_AUTOMATIC);
     gtk_box_pack_start(GTK_BOX(gtk_dialog_get_content_area(GTK_DIALOG(p_dialog))),
                        p_scrolledwindow_kbd_change, TRUE, TRUE, 2);
-    
+
     // liststore
     GtkListStore *p_liststore_kbd_change = gtk_list_store_new(NUM_CHANGE_COLUMNS, G_TYPE_STRING, G_TYPE_STRING, G_TYPE_BOOLEAN, G_TYPE_INT);
     GtkWidget *p_treeview_kbd_change = gtk_tree_view_new_with_model(GTK_TREE_MODEL(p_liststore_kbd_change));
@@ -748,7 +748,7 @@ static void on_button_kbd_change_layout_clicked(GtkButton *p_button, gpointer *p
                                                                              NULL);
     gtk_tree_view_column_set_sort_column_id(p_column, COLUMN_CHANGE_ID);
     gtk_tree_view_append_column(GTK_TREE_VIEW(p_treeview_kbd_change), p_column);
-    
+
     // populate model
     GKeyFile *p_keyfile = g_key_file_new();
     gchar *xkbcfg_filepath = g_strdup_printf("%s/toggle.cfg", XKBCONFDIR);
@@ -789,7 +789,7 @@ static void on_button_kbd_change_layout_clicked(GtkButton *p_button, gpointer *p
         g_strfreev(change_opts);
     }
     g_free(xkbcfg_filepath);
-    
+
     // callback for double click
     //g_signal_connect(p_treeview_kbd_change, "button-press-event",
                      //G_CALLBACK(on_treeviews_lists_button_press_event),
@@ -811,7 +811,7 @@ static void on_button_kbd_change_layout_clicked(GtkButton *p_button, gpointer *p
         p_xkb->kbd_change_option = g_strdup(p_xkb->p_gstring_change_opt_partial->str);
         config_group_set_string(p_xkb->settings, "ToggleOpt", p_xkb->kbd_change_option);
         g_string_free(p_xkb->p_gstring_change_opt_partial, TRUE/*free also gstring->str*/);
-        
+
         gtk_button_set_label(GTK_BUTTON(p_xkb->p_button_change_layout), p_xkb->kbd_change_option);
         xkb_setxkbmap(p_xkb);
         xkb_redraw(p_xkb);
@@ -878,7 +878,7 @@ static void on_button_rm_layout_clicked(GtkButton *p_button, gpointer *p_data)
 static void on_button_add_layout_clicked(GtkButton *p_button, gpointer *p_data)
 {
     XkbPlugin *p_xkb = (XkbPlugin *)p_data;
-    
+
     // dialog
     GtkWidget *p_dialog = gtk_dialog_new_with_buttons(_("Add Keyboard Layout"),
                             p_xkb->p_dialog_config,
@@ -886,14 +886,14 @@ static void on_button_add_layout_clicked(GtkButton *p_button, gpointer *p_data)
                             GTK_STOCK_CANCEL, GTK_RESPONSE_CANCEL,
                             GTK_STOCK_OK, GTK_RESPONSE_OK,
                             NULL);
-    
+
     // scrolledwindow
     GtkWidget * p_scrolledwindow_add_layout = gtk_scrolled_window_new(NULL, NULL);
     gtk_scrolled_window_set_policy(GTK_SCROLLED_WINDOW(p_scrolledwindow_add_layout),
                                    GTK_POLICY_AUTOMATIC, GTK_POLICY_AUTOMATIC);
     gtk_box_pack_start(GTK_BOX(gtk_dialog_get_content_area(GTK_DIALOG(p_dialog))),
                        p_scrolledwindow_add_layout, TRUE, TRUE, 2);
-    
+
     // treestore
     GtkTreeStore *p_treestore_add_layout = gtk_tree_store_new(NUM_ADD_COLUMNS, GDK_TYPE_PIXBUF, G_TYPE_STRING, G_TYPE_STRING);
     GtkWidget *p_treeview_add_layout = gtk_tree_view_new_with_model(GTK_TREE_MODEL(p_treestore_add_layout));
@@ -919,7 +919,7 @@ static void on_button_add_layout_clicked(GtkButton *p_button, gpointer *p_data)
     gtk_tree_view_append_column(GTK_TREE_VIEW(p_treeview_add_layout), p_column_desc);
     // search column
     gtk_tree_view_set_search_column(GTK_TREE_VIEW(p_treeview_add_layout), COLUMN_ADD_DESC);
-    
+
     // populate model
     GKeyFile *p_keyfile = g_key_file_new();
     gchar *xkbcfg_filepath = g_strdup_printf("%s/layouts.cfg", XKBCONFDIR);
@@ -970,7 +970,7 @@ static void on_button_add_layout_clicked(GtkButton *p_button, gpointer *p_data)
             }
             else
             {
-                
+
                 gtk_tree_store_append(p_treestore_add_layout, &tree_child, &tree_top);
                 gtk_tree_store_set(p_treestore_add_layout, &tree_child,
                                     COLUMN_ADD_LAYOUT, keys_layouts[layout_idx],
@@ -984,14 +984,14 @@ static void on_button_add_layout_clicked(GtkButton *p_button, gpointer *p_data)
         g_key_file_free(p_keyfile);
     }
     g_free(xkbcfg_filepath);
-    
+
     // callback for double click
     g_signal_connect(p_treeview_add_layout, "button-press-event",
                      G_CALLBACK(on_treeviews_lists_button_press_event),
                      gtk_dialog_get_widget_for_response(GTK_DIALOG(p_dialog), GTK_RESPONSE_OK));
     // sort for description
     gtk_tree_view_column_clicked(p_column_desc);
-    
+
     gtk_widget_set_size_request(p_dialog, 700, 500);
     gtk_widget_show_all(GTK_WIDGET(p_scrolledwindow_add_layout));
     gint  response = gtk_dialog_run(GTK_DIALOG(p_dialog));
@@ -1008,7 +1008,7 @@ static void on_button_add_layout_clicked(GtkButton *p_button, gpointer *p_data)
             GString *p_gstring_new_variant = g_string_new("");
             gtk_tree_model_get(GTK_TREE_MODEL(p_treestore_add_layout),
                                &tree_iter_sel, COLUMN_ADD_LAYOUT, &layout_add, -1);
-            
+
             if(strchr(layout_add, '(') == NULL)
             {
                 g_string_append(p_gstring_new_layout, layout_add);
@@ -1037,9 +1037,9 @@ static void on_button_add_layout_clicked(GtkButton *p_button, gpointer *p_data)
             }
             xkb_add_layout(p_xkb, p_gstring_new_layout->str, p_gstring_new_variant->str);
             xkb_update_layouts_n_variants(p_xkb);
-            
+
             gtk_widget_set_sensitive(p_xkb->p_button_rm_layout, p_xkb->num_layouts > 1);
-            
+
             g_free(layout_add);
             g_string_free(p_gstring_new_layout, TRUE/*free also gstring->str*/);
             g_string_free(p_gstring_new_variant, TRUE/*free also gstring->str*/);
@@ -1090,10 +1090,10 @@ static gboolean  layouts_tree_model_foreach(GtkTreeModel *p_model,
     XkbPlugin *p_xkb = (XkbPlugin *)p_data;
     gchar *layout_val;
     gchar *variant_val;
-    
+
     gtk_tree_model_get(p_model, p_iter, COLUMN_LAYOUT, &layout_val,  -1);
     gtk_tree_model_get(p_model, p_iter, COLUMN_VARIANT, &variant_val,  -1);
-    
+
     if(strlen(p_xkb->p_gstring_layouts_partial->str))
     {
         g_string_append_c(p_xkb->p_gstring_layouts_partial, ',');
@@ -1101,10 +1101,10 @@ static gboolean  layouts_tree_model_foreach(GtkTreeModel *p_model,
     }
     g_string_append(p_xkb->p_gstring_layouts_partial, layout_val);
     g_string_append(p_xkb->p_gstring_variants_partial, variant_val);
-    
+
     //g_printf("\npartial layouts = '%s'\n", p_xkb->p_gstring_layouts_partial->str);
     //g_printf("partial variants = '%s'\n", p_xkb->p_gstring_variants_partial->str);
-    
+
     g_free(layout_val);
     g_free(variant_val);
     p_xkb->num_layouts++;
index e675cff..d32ae92 100644 (file)
@@ -18,7 +18,7 @@
 
 /* Originally derived from xfce4-xkb-plugin, Copyright 2004 Alexander Iliev,
  * which credits Michael Glickman. */
+
 /* Modified by Giuseppe Penone <giuspen@gmail.com> starting from 2012-07 and lxpanel 0.5.10 */
 
 #include "xkb.h"
@@ -41,7 +41,7 @@ typedef enum
     NEW_KBD_STATE_NOTIFY_IGNORE_NO,
     NEW_KBD_STATE_NOTIFY_IGNORE_YES_SET,
     NEW_KBD_STATE_NOTIFY_IGNORE_YES_ALL,
-    
+
 } t_new_kbd_notify_ignore;
 
 static void             xkb_enter_locale_by_process(XkbPlugin * xkb);
@@ -76,38 +76,38 @@ int xkb_get_current_group_xkb_no(XkbPlugin * xkb)
 }
 
 /* Return the count of members in the current group. */
-int xkb_get_group_count(XkbPlugin * xkb) 
-{ 
+int xkb_get_group_count(XkbPlugin * xkb)
+{
   return xkb->group_count;
 }
 
 /* Get the current group name. */
-const char * xkb_get_current_group_name(XkbPlugin * xkb) 
+const char * xkb_get_current_group_name(XkbPlugin * xkb)
 {
     return xkb->group_names[xkb->current_group_xkb_no];
 }
 
 /* Convert a group number to a symbol name. */
-const char * xkb_get_symbol_name_by_res_no(XkbPlugin * xkb, int n) 
+const char * xkb_get_symbol_name_by_res_no(XkbPlugin * xkb, int n)
 {
     return xkb->symbol_names[n];
 }
 
 /* Get the current symbol name. */
-const char * xkb_get_current_symbol_name(XkbPlugin * xkb) 
+const char * xkb_get_current_symbol_name(XkbPlugin * xkb)
 {
     return xkb_get_symbol_name_by_res_no(xkb, xkb->current_group_xkb_no);
 }
 
 /* Get the current symbol name converted to lowercase. */
-const char * xkb_get_current_symbol_name_lowercase(XkbPlugin * xkb) 
+const char * xkb_get_current_symbol_name_lowercase(XkbPlugin * xkb)
 {
     const char * tmp = xkb_get_current_symbol_name(xkb);
     return ((tmp != NULL) ? g_utf8_strdown(tmp, -1) : NULL);
 }
 
 /* Refresh current group number from Xkb state. */
-static void refresh_group_xkb(XkbPlugin * xkb) 
+static void refresh_group_xkb(XkbPlugin * xkb)
 {
     /* Get the current group number.
      * This shouldn't be necessary, but mask the group number down for safety. */
@@ -200,7 +200,7 @@ static int initialize_keyboard_description(XkbPlugin * xkb)
                         else if ((*p < 'a') || (*p > 'z'))
                             *p = '\0';
                     }
-                    
+
                     /* Crosscheck the group count determined from the "ctrls" structure,
                      * that determined from the "groups" vector, and that determined from the "symbols" string.
                      * The "ctrls" structure is considered less reliable because it has been observed to be incorrect. */
@@ -229,12 +229,12 @@ static int initialize_keyboard_description(XkbPlugin * xkb)
         if (xkb->symbol_names[i] == NULL)
             xkb->symbol_names[i] = g_strdup("None");
     }
-    
+
     /* Create or recreate hash table */
     if (xkb->p_hash_table_group != NULL)
         g_hash_table_destroy(xkb->p_hash_table_group);
     xkb->p_hash_table_group = g_hash_table_new(g_direct_hash, NULL);
-    
+
     return TRUE;
 }
 
@@ -311,7 +311,7 @@ void xkb_mechanism_constructor(XkbPlugin * xkb)
 }
 
 /* Deallocate resources associated with Xkb interface. */
-void xkb_mechanism_destructor(XkbPlugin * xkb) 
+void xkb_mechanism_destructor(XkbPlugin * xkb)
 {
     /* Remove event filter. */
     gdk_window_remove_filter(NULL, (GdkFilterFunc) xkb_event_filter, xkb);
@@ -331,14 +331,14 @@ void xkb_mechanism_destructor(XkbPlugin * xkb)
             xkb->symbol_names[i] = NULL;
         }
     }
-    
+
     /* Destroy the hash table. */
     g_hash_table_destroy(xkb->p_hash_table_group);
     xkb->p_hash_table_group = NULL;
 }
 
 /* Set the layout to the next layout. */
-int xkb_change_group(XkbPlugin * xkb, int increment) 
+int xkb_change_group(XkbPlugin * xkb, int increment)
 {
     /* Apply the increment and wrap the result. */
     int next_group = xkb->current_group_xkb_no + increment;
index e451fd2..e2afc4a 100644 (file)
@@ -94,7 +94,7 @@ struct _Panel {
     guint round_corners : 1;
     guint usefontcolor : 1;
     guint usefontsize : 1;
-    guint fontsize;    
+    guint fontsize;
     guint transparent : 1;
     guint background : 1;
     guint spacing;