[Xfce4-commits] <xfce4-panel:devel> Properly use XfceScreenPosition in the plugins.

Nick Schermer noreply at xfce.org
Mon Oct 26 21:18:03 CET 2009


Updating branch refs/heads/devel
         to 38cb0e38337d6308ac873b8075df9f1167ad4a9a (commit)
       from 0e7c60d67c36972cf7b8b1f414bfd3a444453736 (commit)

commit 38cb0e38337d6308ac873b8075df9f1167ad4a9a
Author: Nick Schermer <nick at xfce.org>
Date:   Mon Oct 26 14:36:40 2009 +0100

    Properly use XfceScreenPosition in the plugins.

 plugins/launcher/launcher.c     |    6 +-
 plugins/systray/systray.c       |   64 +++++++++++++++-----------------
 plugins/windowmenu/windowmenu.c |   78 +++++++++++++++++++-------------------
 3 files changed, 72 insertions(+), 76 deletions(-)

diff --git a/plugins/launcher/launcher.c b/plugins/launcher/launcher.c
index 79dca38..eafab73 100644
--- a/plugins/launcher/launcher.c
+++ b/plugins/launcher/launcher.c
@@ -62,7 +62,7 @@ static void launcher_plugin_save (XfcePanelPlugin *panel_plugin);
 static void launcher_plugin_orientation_changed (XfcePanelPlugin *panel_plugin, GtkOrientation orientation);
 static gboolean launcher_plugin_size_changed (XfcePanelPlugin *panel_plugin, gint size);
 static void launcher_plugin_configure_plugin (XfcePanelPlugin *panel_plugin);
-static void launcher_plugin_screen_position_changed (XfcePanelPlugin *panel_plugin, gint position);
+static void launcher_plugin_screen_position_changed (XfcePanelPlugin *panel_plugin, XfceScreenPosition position);
 
 static void launcher_plugin_icon_theme_changed (GtkIconTheme *icon_theme, LauncherPlugin *plugin);
 
@@ -981,8 +981,8 @@ launcher_plugin_configure_plugin (XfcePanelPlugin *panel_plugin)
 
 
 static void
-launcher_plugin_screen_position_changed (XfcePanelPlugin *panel_plugin,
-                                         gint             position)
+launcher_plugin_screen_position_changed (XfcePanelPlugin    *panel_plugin,
+                                         XfceScreenPosition  position)
 {
   LauncherPlugin *plugin = XFCE_LAUNCHER_PLUGIN (panel_plugin);
 
diff --git a/plugins/systray/systray.c b/plugins/systray/systray.c
index e591d9f..0b571bc 100644
--- a/plugins/systray/systray.c
+++ b/plugins/systray/systray.c
@@ -39,33 +39,33 @@
 
 
 
-static void     systray_plugin_get_property                 (GObject         *object,
-                                                             guint            prop_id,
-                                                             GValue          *value,
-                                                             GParamSpec      *pspec);
-static void     systray_plugin_set_property                 (GObject         *object,
-                                                             guint            prop_id,
-                                                             const GValue    *value,
-                                                             GParamSpec      *pspec);
-static void     systray_plugin_construct                    (XfcePanelPlugin *panel_plugin);
-static void     systray_plugin_free_data                    (XfcePanelPlugin *panel_plugin);
-static void     systray_plugin_screen_position_changed      (XfcePanelPlugin *panel_plugin,
-                                                             gint             screen_position);
-static void     systray_plugin_orientation_changed          (XfcePanelPlugin *panel_plugin,
-                                                             GtkOrientation   orientation);
-static gboolean systray_plugin_size_changed                 (XfcePanelPlugin *panel_plugin,
+static void     systray_plugin_get_property                 (GObject            *object,
+                                                             guint               prop_id,
+                                                             GValue             *value,
+                                                             GParamSpec         *pspec);
+static void     systray_plugin_set_property                 (GObject            *object,
+                                                             guint               prop_id,
+                                                             const GValue       *value,
+                                                             GParamSpec         *pspec);
+static void     systray_plugin_construct                    (XfcePanelPlugin    *panel_plugin);
+static void     systray_plugin_free_data                    (XfcePanelPlugin    *panel_plugin);
+static void     systray_plugin_screen_position_changed      (XfcePanelPlugin    *panel_plugin,
+                                                             XfceScreenPosition  screen_position);
+static void     systray_plugin_orientation_changed          (XfcePanelPlugin    *panel_plugin,
+                                                             GtkOrientation      orientation);
+static gboolean systray_plugin_size_changed                 (XfcePanelPlugin    *panel_plugin,
                                                              gint size);
-static void     systray_plugin_configure_plugin             (XfcePanelPlugin *panel_plugin);
-static void     systray_plugin_icon_added                   (SystrayManager  *manager,
-                                                             GtkWidget       *icon,
-                                                             SystrayPlugin   *plugin);
-static void     systray_plugin_icon_removed                 (SystrayManager  *manager,
-                                                             GtkWidget       *icon,
-                                                             SystrayPlugin   *plugin);
-static void     systray_plugin_lost_selection               (SystrayManager  *manager,
-                                                             SystrayPlugin   *plugin);
-static void     systray_plugin_dialog_add_application_names (SystrayPlugin   *plugin,
-                                                             GtkListStore    *store);
+static void     systray_plugin_configure_plugin             (XfcePanelPlugin    *panel_plugin);
+static void     systray_plugin_icon_added                   (SystrayManager     *manager,
+                                                             GtkWidget          *icon,
+                                                             SystrayPlugin      *plugin);
+static void     systray_plugin_icon_removed                 (SystrayManager     *manager,
+                                                             GtkWidget          *icon,
+                                                             SystrayPlugin      *plugin);
+static void     systray_plugin_lost_selection               (SystrayManager     *manager,
+                                                             SystrayPlugin      *plugin);
+static void     systray_plugin_dialog_add_application_names (SystrayPlugin      *plugin,
+                                                             GtkListStore       *store);
 
 
 
@@ -334,11 +334,10 @@ systray_plugin_free_data (XfcePanelPlugin *panel_plugin)
 
 
 static void
-systray_plugin_screen_position_changed (XfcePanelPlugin *panel_plugin,
-                                        gint             screen_position)
+systray_plugin_screen_position_changed (XfcePanelPlugin    *panel_plugin,
+                                        XfceScreenPosition  screen_position)
 {
   SystrayPlugin      *plugin = XFCE_SYSTRAY_PLUGIN (panel_plugin);
-  XfceScreenPosition  position;
   GdkScreen          *screen;
   GdkRectangle        geom;
   gint                mon, x, y;
@@ -346,11 +345,8 @@ systray_plugin_screen_position_changed (XfcePanelPlugin *panel_plugin,
 
   panel_return_if_fail (GTK_WIDGET_REALIZED (panel_plugin));
 
-  /* get the plugin position */
-  position = xfce_panel_plugin_get_screen_position (panel_plugin);
-
   /* get the button position */
-  switch (position)
+  switch (screen_position)
     {
       /*    horizontal west */
       case XFCE_SCREEN_POSITION_NW_H:
@@ -389,7 +385,7 @@ systray_plugin_screen_position_changed (XfcePanelPlugin *panel_plugin,
         gdk_window_get_root_origin (GTK_WIDGET (panel_plugin)->window, &x, &y);
 
         /* get the position based on the screen position */
-        if (position == XFCE_SCREEN_POSITION_FLOATING_H)
+        if (screen_position == XFCE_SCREEN_POSITION_FLOATING_H)
             arrow_type = ((x < (geom.x + geom.width / 2)) ? GTK_ARROW_RIGHT : GTK_ARROW_LEFT);
         else
             arrow_type = ((y < (geom.y + geom.height / 2)) ? GTK_ARROW_DOWN : GTK_ARROW_UP);
diff --git a/plugins/windowmenu/windowmenu.c b/plugins/windowmenu/windowmenu.c
index 5f34209..f5a40a2 100644
--- a/plugins/windowmenu/windowmenu.c
+++ b/plugins/windowmenu/windowmenu.c
@@ -82,43 +82,43 @@ enum
 
 
 
-static void      window_menu_plugin_get_property            (GObject          *object,
-                                                             guint             prop_id,
-                                                             GValue           *value,
-                                                             GParamSpec       *pspec);
-static void      window_menu_plugin_set_property            (GObject          *object,
-                                                             guint             prop_id,
-                                                             const GValue     *value,
-                                                             GParamSpec       *pspec);
-static void      window_menu_plugin_screen_changed          (GtkWidget        *widget,
-                                                             GdkScreen        *previous_screen);
-static void      window_menu_plugin_construct               (XfcePanelPlugin  *panel_plugin);
-static void      window_menu_plugin_free_data               (XfcePanelPlugin  *panel_plugin);
-static void      window_menu_plugin_screen_position_changed (XfcePanelPlugin  *panel_plugin,
-                                                             gint             position);
-static gboolean  window_menu_plugin_size_changed            (XfcePanelPlugin  *panel_plugin,
-                                                             gint              size);
-static void      window_menu_plugin_configure_plugin        (XfcePanelPlugin  *panel_plugin);
-static void      window_menu_plugin_active_window_changed   (WnckScreen       *screen,
-                                                             WnckWindow       *previous_window,
-                                                             WindowMenuPlugin *plugin);
-static void      window_menu_plugin_window_state_changed    (WnckWindow       *window,
-                                                             WnckWindowState   changed_mask,
-                                                             WnckWindowState   new_state,
-                                                             WindowMenuPlugin *plugin);
-static void      window_menu_plugin_window_opened           (WnckScreen       *screen,
-                                                             WnckWindow       *window,
-                                                             WindowMenuPlugin *plugin);
-static void      window_menu_plugin_window_closed           (WnckScreen       *screen,
-                                                             WnckWindow       *window,
-                                                             WindowMenuPlugin *plugin);
-static void      window_menu_plugin_windows_disconnect      (WindowMenuPlugin *plugin);
-static void      window_menu_plugin_windows_connect         (WindowMenuPlugin *plugin,
-                                                             gboolean          traverse_windows);
-static gboolean  window_menu_plugin_button_press_event      (GtkWidget        *button,
-                                                             GdkEventButton   *event,
-                                                             WindowMenuPlugin *plugin);
-static GtkWidget *window_menu_plugin_menu_new               (WindowMenuPlugin *plugin);
+static void      window_menu_plugin_get_property            (GObject            *object,
+                                                             guint               prop_id,
+                                                             GValue             *value,
+                                                             GParamSpec         *pspec);
+static void      window_menu_plugin_set_property            (GObject            *object,
+                                                             guint               prop_id,
+                                                             const GValue       *value,
+                                                             GParamSpec         *pspec);
+static void      window_menu_plugin_screen_changed          (GtkWidget          *widget,
+                                                             GdkScreen          *previous_screen);
+static void      window_menu_plugin_construct               (XfcePanelPlugin    *panel_plugin);
+static void      window_menu_plugin_free_data               (XfcePanelPlugin    *panel_plugin);
+static void      window_menu_plugin_screen_position_changed (XfcePanelPlugin    *panel_plugin,
+                                                             XfceScreenPosition  screen_position);
+static gboolean  window_menu_plugin_size_changed            (XfcePanelPlugin    *panel_plugin,
+                                                             gint                size);
+static void      window_menu_plugin_configure_plugin        (XfcePanelPlugin    *panel_plugin);
+static void      window_menu_plugin_active_window_changed   (WnckScreen         *screen,
+                                                             WnckWindow         *previous_window,
+                                                             WindowMenuPlugin   *plugin);
+static void      window_menu_plugin_window_state_changed    (WnckWindow         *window,
+                                                             WnckWindowState     changed_mask,
+                                                             WnckWindowState     new_state,
+                                                             WindowMenuPlugin   *plugin);
+static void      window_menu_plugin_window_opened           (WnckScreen         *screen,
+                                                             WnckWindow         *window,
+                                                             WindowMenuPlugin   *plugin);
+static void      window_menu_plugin_window_closed           (WnckScreen         *screen,
+                                                             WnckWindow         *window,
+                                                             WindowMenuPlugin   *plugin);
+static void      window_menu_plugin_windows_disconnect      (WindowMenuPlugin   *plugin);
+static void      window_menu_plugin_windows_connect         (WindowMenuPlugin   *plugin,
+                                                             gboolean            traverse_windows);
+static gboolean  window_menu_plugin_button_press_event      (GtkWidget          *button,
+                                                             GdkEventButton     *event,
+                                                             WindowMenuPlugin   *plugin);
+static GtkWidget *window_menu_plugin_menu_new               (WindowMenuPlugin   *plugin);
 
 
 
@@ -439,8 +439,8 @@ window_menu_plugin_free_data (XfcePanelPlugin *panel_plugin)
 
 
 static void
-window_menu_plugin_screen_position_changed (XfcePanelPlugin *panel_plugin,
-                                            gint             position)
+window_menu_plugin_screen_position_changed (XfcePanelPlugin    *panel_plugin,
+                                            XfceScreenPosition  screen_position)
 {
   WindowMenuPlugin *plugin = XFCE_WINDOW_MENU_PLUGIN (panel_plugin);
   GtkArrowType      arrow_type = GTK_ARROW_NONE;



More information about the Xfce4-commits mailing list