pygobject r767 - in trunk: . gio tests
- From: johan svn gnome org
- To: svn-commits-list gnome org
- Subject: pygobject r767 - in trunk: . gio tests
- Date: Tue, 8 Apr 2008 15:51:27 +0100 (BST)
Author: johan
Date: Tue Apr 8 15:51:27 2008
New Revision: 767
URL: http://svn.gnome.org/viewvc/pygobject?rev=767&view=rev
Log:
2008-04-08 Johan Dahlin <jdahlin async com br>
* gio/gio-types.defs:
* gio/gio.defs:
* gio/gio.override:
* tests/test_gio.py:
Add basic support for GThemedIcon, based on patch by
Thomas Leonard (#521883)
Modified:
trunk/ChangeLog
trunk/gio/gio-types.defs
trunk/gio/gio.defs
trunk/gio/gio.override
trunk/tests/test_gio.py
Modified: trunk/gio/gio-types.defs
==============================================================================
--- trunk/gio/gio-types.defs (original)
+++ trunk/gio/gio-types.defs Tue Apr 8 15:51:27 2008
@@ -36,6 +36,13 @@
(gtype-id "G_TYPE_ICON")
)
+(define-object ThemedIcon
+ (in-module "gio")
+ (c-name "GThemedIcon")
+ (gtype-id "G_TYPE_THEMED_ICON")
+ (implements "GIcon")
+)
+
(define-object LoadableIcon
(in-module "gio")
(c-name "GLoadableIcon")
Modified: trunk/gio/gio.defs
==============================================================================
--- trunk/gio/gio.defs (original)
+++ trunk/gio/gio.defs Tue Apr 8 15:51:27 2008
@@ -4000,6 +4000,20 @@
)
)
+(define-method get_names
+ (c-name "g_themed_icon_get_names")
+ (of-object "GThemedIcon")
+ (return-type "const-gchar*-const*")
+)
+
+(define-method append_name
+ (c-name "g_themed_icon_append_name")
+ (of-object "GThemedIcon")
+ (return-type "none")
+ (parameters
+ '("char*" "iconname")
+ )
+)
;; From gunionvolumemonitor.h
Modified: trunk/gio/gio.override
==============================================================================
--- trunk/gio/gio.override (original)
+++ trunk/gio/gio.override Tue Apr 8 15:51:27 2008
@@ -159,3 +159,24 @@
return ret;
}
+%%
+override g_themed_icon_get_names noargs
+static PyObject *
+_wrap_g_themed_icon_get_names(PyGObject *self)
+{
+ const char * const *names;
+ PyObject *ret;
+
+ names = g_themed_icon_get_names(G_THEMED_ICON(self->obj));
+
+ ret = PyList_New(0);
+ while (names && *names) {
+ PyObject *item = PyString_FromString(names[0]);
+ PyList_Append(ret, item);
+ Py_DECREF(item);
+
+ names++;
+ }
+
+ return ret;
+}
Modified: trunk/tests/test_gio.py
==============================================================================
--- trunk/tests/test_gio.py (original)
+++ trunk/tests/test_gio.py Tue Apr 8 15:51:27 2008
@@ -199,3 +199,16 @@
def testGetMounts(self):
mounts = self.monitor.get_mounts()
self.failUnless(isinstance(mounts, list))
+
+
+class TestThemedIcon(unittest.TestCase):
+ def setUp(self):
+ self.icon = gio.ThemedIcon("open")
+
+ def testGetNames(self):
+ self.assertEquals(self.icon.get_names(), ['open'])
+
+ def testAppendName(self):
+ self.assertEquals(self.icon.get_names(), ['open'])
+ self.icon.append_name('close')
+ self.assertEquals(self.icon.get_names(), ['open', 'close'])
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]