More fixes for signal simulation in the completion prototype
[ephy-history.git] / ephyhistory.override
blob23c3e9343c5b4a766be2b0fe9cada84b93601a69
1 %%
2 headers
3 #include <Python.h>               
4 #include "pygobject.h"
5 #include "ephy-history.h"
6 #include "ephy-history-node.h"
7 #include "ephy-history-page-node.h"
8 #include "ephy-history-visit-node.h"
10 static PyObject *
11 _helper_wrap_gobject_gptrarray (GPtrArray *list, gboolean dealloc)
13     PyObject *py_list;
14     int i;
16     if ((py_list = PyList_New(0)) == NULL) {
17         return NULL;
18     }
19     for( i = 0; i < list->len; i++ ) {
20         PyObject *obj = pygobject_new (G_OBJECT (g_ptr_array_index(list, i)));
21         PyList_Append(py_list, obj);
22         Py_DECREF(obj);
23     }
24     if (dealloc) g_ptr_array_free (list, TRUE);
25     return py_list;
28 static PyObject *
29 _helper_wrap_guint64_garray (GArray *list, gboolean dealloc)
31     PyObject *py_list;
32     int i;
34     if ((py_list = PyList_New(0)) == NULL) {
35         return NULL;
36     }
37     for( i = 0; i < list->len; i++ ) {
38         PyList_Append (py_list, PyLong_FromUnsignedLongLong (g_array_index (list, guint64, i))); 
39     }
40     if (dealloc) g_array_free (list, TRUE);
41     return py_list;
44 modulename ephyhistory                     
46 import gobject.GObject as PyGObject_Type  
48 ignore-glob
49   *_get_type                            
51 override ephy_history_get_hosts noargs
52 static PyObject *
53 _wrap_ephy_history_get_hosts (PyGObject *self)
55     GPtrArray *list = ephy_history_get_hosts ((EphyHistory *) (self->obj));
57     return _helper_wrap_gobject_gptrarray (list, FALSE);
60 override ephy_history_get_pages noargs
61 static PyObject *
62 _wrap_ephy_history_get_pages (PyGObject *self)
64     GPtrArray *list = ephy_history_get_pages ((EphyHistory *) (self->obj));
66     return _helper_wrap_gobject_gptrarray (list, FALSE);
69 override ephy_history_get_page_ids noargs
70 static PyObject *
71 _wrap_ephy_history_get_page_ids (PyGObject *self)
73     GArray *list = ephy_history_get_page_ids ((EphyHistory *) (self->obj));
75     return _helper_wrap_guint64_garray (list, FALSE);