summaryrefslogtreecommitdiff
path: root/gtk/compat.h
diff options
context:
space:
mode:
authorVincent Sanders <vince@kyllikki.org>2015-04-11 15:20:52 +0100
committerVincent Sanders <vince@kyllikki.org>2015-04-11 15:20:52 +0100
commitdf4e9e322dc8c64af1fc8aabc26c8d4ddab32574 (patch)
treea4b4b0d8553fcf1cbee0f0ba0439b1d301694105 /gtk/compat.h
parente193566de41d65e055db306b9ca28b35daa8bc43 (diff)
downloadnetsurf-df4e9e322dc8c64af1fc8aabc26c8d4ddab32574.tar.gz
netsurf-df4e9e322dc8c64af1fc8aabc26c8d4ddab32574.tar.bz2
Add widget alignment gtk compatability interface.
Diffstat (limited to 'gtk/compat.h')
-rw-r--r--gtk/compat.h25
1 files changed, 25 insertions, 0 deletions
diff --git a/gtk/compat.h b/gtk/compat.h
index 52d10f35e..d35c5d75f 100644
--- a/gtk/compat.h
+++ b/gtk/compat.h
@@ -69,6 +69,31 @@
#define NSGTK_STOCK_OPEN GTK_STOCK_OPEN
#endif
+/* widget alignment only available since 3.0 */
+#if !GTK_CHECK_VERSION(3,0,0)
+typedef enum {
+ GTK_ALIGN_FILL,
+ GTK_ALIGN_START,
+ GTK_ALIGN_END,
+ GTK_ALIGN_CENTER,
+ GTK_ALIGN_BASELINE
+} GtkAlign;
+#endif
+
+/**
+ * Set the alignment of a widget.
+ *
+ * sets both the horizontal and vertical alignement of a widget
+ *
+ * @note this type of alignemnt was not available prior to GTK 3.0 so
+ * we emulate it using gtk_misc_set_alignment.
+ *
+ * \param widget The widget to set alignent on.
+ * \param halign The horizontal alignment to set.
+ * \param valign The vertical alignment to set
+ */
+void nsgtk_widget_set_alignment(GtkWidget *widget, GtkAlign halign, GtkAlign valign);
+
void nsgtk_widget_set_can_focus(GtkWidget *widget, gboolean can_focus);
gboolean nsgtk_widget_has_focus(GtkWidget *widget);
gboolean nsgtk_widget_get_visible(GtkWidget *widget);