First go at adding events support to Browser

This commit is contained in:
Marco Pesenti Gritti
2007-03-13 11:41:27 +01:00
parent ac8805246d
commit e05313c152
6 changed files with 120 additions and 4 deletions
+9
View File
@@ -1,5 +1,14 @@
;; -*- scheme -*-
; object definitions ...
(define-boxed SugarBrowserEvent
(in-module "Sugar")
(c-name "SugarBrowserEvent")
(gtype-id "SUGAR_TYPE_BROWSER_EVENT")
(copy-func "sugar_browser_event_copy")
(release-func "sugar_browser_event_free")
)
(define-object AddressEntry
(in-module "Sugar")
(parent "GtkEntry")
+15 -1
View File
@@ -19,7 +19,7 @@ headers
extern Pycairo_CAPI_t *Pycairo_CAPI;
%%
modulename gecko
modulename _sugar
%%
import gobject.GObject as PyGObject_Type
import gtk.Entry as PyGtkEntry_Type
@@ -179,3 +179,17 @@ _wrap_sugar_cairo_surface_from_gdk_pixbuf(PyGObject *self, PyObject *args, PyObj
return PycairoSurface_FromSurface(surface, NULL);
}
%%
override-slot SugarBrowserEvent.tp_getattr
static PyObject *
_wrap_sugar_browser_event_tp_getattr(PyObject *self, char *attr)
{
SugarBrowserEvent *event = pyg_boxed_get(self, SugarBrowserEvent);
if (!strcmp(attr, "__members__"))
return Py_BuildValue("[s]", "image_uri");
if (!strcmp(attr, "image_uri"))
return PyString_FromString(event->image_uri);
return NULL;
}
%%
-2
View File
@@ -8,8 +8,6 @@ headers
#include <gtkmozembed.h>
%%
modulename gtkmozembed
%%
import gobject.GObject as PyGObject_Type
import gtk.Object as PyGtkObject_Type