[the-board] [tb] Add tb-mx-util with function to get padding from MxStylables
- From: Lucas Rocha <lucasr src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [the-board] [tb] Add tb-mx-util with function to get padding from MxStylables
- Date: Tue, 7 Dec 2010 18:02:07 +0000 (UTC)
commit 625bdcbff48415f6eb5675e9418534fe3e92584a
Author: Lucas Rocha <lucasr gnome org>
Date: Tue Dec 7 17:54:45 2010 +0000
[tb] Add tb-mx-util with function to get padding from MxStylables
src/Makefile-tb.am | 6 ++++--
src/tb/tb-mx-util.c | 24 ++++++++++++++++++++++++
src/tb/tb-mx-util.h | 8 ++++++++
3 files changed, 36 insertions(+), 2 deletions(-)
---
diff --git a/src/Makefile-tb.am b/src/Makefile-tb.am
index 62be74e..cee4562 100644
--- a/src/Makefile-tb.am
+++ b/src/Makefile-tb.am
@@ -22,7 +22,8 @@ tb_source_h = \
tb/tb-box.h \
tb/tb-gio-util.h \
tb/tb-gdk-util.h \
- tb/tb-gobject-util.h
+ tb/tb-gobject-util.h \
+ tb/tb-mx-util.h
if HAVE_LIBSOUP
tb_source_h += tb/tb-soup-util.h
@@ -32,7 +33,8 @@ tb_source_c = \
tb/tb-box.c \
tb/tb-gio-util.c \
tb/tb-gdk-util.c \
- tb/tb-gobject-util.c
+ tb/tb-gobject-util.c \
+ tb/tb-mx-util.c
if HAVE_LIBSOUP
tb_source_c += tb/tb-soup-util.c
diff --git a/src/tb/tb-mx-util.c b/src/tb/tb-mx-util.c
new file mode 100644
index 0000000..e3065c7
--- /dev/null
+++ b/src/tb/tb-mx-util.c
@@ -0,0 +1,24 @@
+
+#include <mx/mx.h>
+
+#include "tb/tb-mx-util.h"
+
+/* This is only necessary because the mx_stylable_get_property
+ * is not properly gir-introspected yet */
+
+/**
+ * tb_mx_stylable_get_padding:
+ *
+ * Returns: (transfer full): the stylable padding.
+ */
+MxPadding *
+tb_mx_stylable_get_padding (MxStylable *stylable)
+{
+ GValue padding;
+
+ g_value_init (&padding, MX_TYPE_PADDING);
+
+ mx_stylable_get_property (stylable, "padding", &padding);
+
+ return g_value_get_boxed (&padding);
+}
diff --git a/src/tb/tb-mx-util.h b/src/tb/tb-mx-util.h
new file mode 100644
index 0000000..2817cfb
--- /dev/null
+++ b/src/tb/tb-mx-util.h
@@ -0,0 +1,8 @@
+#ifndef __TB_MX_UTIL_H__
+#define __TB_MX_UTIL_H__
+
+#include <mx/mx.h>
+
+MxPadding *tb_mx_stylable_get_padding (MxStylable *stylable);
+
+#endif /* __TB_MX_UTIL_H__ */
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]