[gnome-panel/wip/segeiger/panel-applet-get-gtk-orient: 6/6] libpanel-applet: add panel_applet_get_gtk_orient to API



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

    libpanel-applet: add panel_applet_get_gtk_orient to API

 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..04a9262 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]