[gnome-panel/wip/segeiger/panel-applet-get-gtk-orient] libpanelapplet/panel-applet.h: Add new function 'panel_applet_get_gtk_orient'



commit b19be2dfa9d79e9b48601a99b0ee0da6d3a01e34
Author: Sebastian Geiger <sbastig gmx net>
Date:   Wed Jun 10 21:25:57 2015 +0200

    libpanelapplet/panel-applet.h: Add new function 'panel_applet_get_gtk_orient'
    
    This function accepts an applet and returns the applets orientation as a GtkOrientation.

 libpanel-applet/panel-applet.c |   22 ++++++++++++++++++++++
 libpanel-applet/panel-applet.h |    1 +
 2 files changed, 23 insertions(+), 0 deletions(-)
---
diff --git a/libpanel-applet/panel-applet.c b/libpanel-applet/panel-applet.c
index c593b0b..8b03ae8 100644
--- a/libpanel-applet/panel-applet.c
+++ b/libpanel-applet/panel-applet.c
@@ -404,6 +404,28 @@ panel_applet_get_orient (PanelApplet *applet)
        return applet->priv->orient;
 }
 
+/**
+ * panel_applet_get_gtk_orient:
+ * @applet: a #PanelApplet
+ *
+ * Gets the #GtkOrientation of @applet.
+ *
+ * Returns: the #GtkOrientation of @applet.
+ *
+ * Since 3.18
+ */
+GtkOrientation
+panel_applet_get_gtk_orient (PanelApplet *applet)
+{
+       g_return_val_if_fail (PANEL_IS_APPLET (applet), GTK_ORIENTATION_HORIZONTAL);
+
+       if (applet->priv->orient == PANEL_APPLET_ORIENT_LEFT ||
+               applet->priv->orient == PANEL_APPLET_ORIENT_RIGHT)
+               return GTK_ORIENTATION_VERTICAL;
+
+       return GTK_ORIENTATION_HORIZONTAL;
+}
+
 /* Applets cannot set their orientation, so API is not public. */
 static void
 panel_applet_set_orient (PanelApplet      *applet,
diff --git a/libpanel-applet/panel-applet.h b/libpanel-applet/panel-applet.h
index dfec892..1af5f64 100644
--- a/libpanel-applet/panel-applet.h
+++ b/libpanel-applet/panel-applet.h
@@ -129,6 +129,7 @@ struct _PanelAppletClass {
 GType              panel_applet_get_type             (void) G_GNUC_CONST;
  
 PanelAppletOrient  panel_applet_get_orient           (PanelApplet *applet);
+GtkOrientation     panel_applet_get_gtk_orient       (PanelApplet *applet);
 cairo_pattern_t   *panel_applet_get_background       (PanelApplet *applet);
 
 void               panel_applet_set_background_widget (PanelApplet *applet,


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]