diff options
-rw-r--r-- | components/xulappinfo.js | 2 | ||||
-rwxr-xr-x | configure | 22 | ||||
-rw-r--r-- | python/config.py | 2 | ||||
-rw-r--r-- | python/hulahop.c | 132 | ||||
-rw-r--r-- | tests/test-web-view.py | 39 |
5 files changed, 130 insertions, 67 deletions
diff --git a/components/xulappinfo.js b/components/xulappinfo.js index 0c694d9..d472dd1 100644 --- a/components/xulappinfo.js +++ b/components/xulappinfo.js @@ -2,7 +2,7 @@ const APPLICATION_ID = '{ab9fc198-f515-477b-843f-8fb52810a3e0}' const APPLICATION_VENDOR = 'Sugar' const APPLICATION_NAME = 'Browser Activity' -const APPLICATION_VERSION = '0.4.5' +const APPLICATION_VERSION = '0.4.7' const APPLICATION_BUILD_ID = '2008072400' const PLATFORM_VERSION = '1.9' @@ -1,6 +1,6 @@ #! /bin/sh # Guess values for system-dependent variables and create Makefiles. -# Generated by GNU Autoconf 2.61 for hulahop 0.4.5. +# Generated by GNU Autoconf 2.61 for hulahop 0.4.7. # # Copyright (C) 1992, 1993, 1994, 1995, 1996, 1998, 1999, 2000, 2001, # 2002, 2003, 2004, 2005, 2006 Free Software Foundation, Inc. @@ -726,8 +726,8 @@ SHELL=${CONFIG_SHELL-/bin/sh} # Identity of this package. PACKAGE_NAME='hulahop' PACKAGE_TARNAME='hulahop' -PACKAGE_VERSION='0.4.5' -PACKAGE_STRING='hulahop 0.4.5' +PACKAGE_VERSION='0.4.7' +PACKAGE_STRING='hulahop 0.4.7' PACKAGE_BUGREPORT='' ac_unique_file="configure.ac" @@ -1421,7 +1421,7 @@ if test "$ac_init_help" = "long"; then # Omit some internal or obsolete options to make the list less imposing. # This message is too long to be a string in the A/UX 3.1 sh. cat <<_ACEOF -\`configure' configures hulahop 0.4.5 to adapt to many kinds of systems. +\`configure' configures hulahop 0.4.7 to adapt to many kinds of systems. Usage: $0 [OPTION]... [VAR=VALUE]... @@ -1491,7 +1491,7 @@ fi if test -n "$ac_init_help"; then case $ac_init_help in - short | recursive ) echo "Configuration of hulahop 0.4.5:";; + short | recursive ) echo "Configuration of hulahop 0.4.7:";; esac cat <<\_ACEOF @@ -1601,7 +1601,7 @@ fi test -n "$ac_init_help" && exit $ac_status if $ac_init_version; then cat <<\_ACEOF -hulahop configure 0.4.5 +hulahop configure 0.4.7 generated by GNU Autoconf 2.61 Copyright (C) 1992, 1993, 1994, 1995, 1996, 1998, 1999, 2000, 2001, @@ -1615,7 +1615,7 @@ cat >config.log <<_ACEOF This file contains any messages produced by compilers while running configure, to aid debugging if configure makes a mistake. -It was created by hulahop $as_me 0.4.5, which was +It was created by hulahop $as_me 0.4.7, which was generated by GNU Autoconf 2.61. Invocation command line was $ $0 $@ @@ -1969,7 +1969,7 @@ ac_compiler_gnu=$ac_cv_c_compiler_gnu -HULAHOP_VERSION=0.4.5 +HULAHOP_VERSION=0.4.7 HULAHOP_BUILD_ID=2008072400 @@ -2404,7 +2404,7 @@ fi # Define the identity of the package. PACKAGE='hulahop' - VERSION='0.4.5' + VERSION='0.4.7' cat >>confdefs.h <<_ACEOF @@ -20520,7 +20520,7 @@ exec 6>&1 # report actual input values of CONFIG_FILES etc. instead of their # values after options handling. ac_log=" -This file was extended by hulahop $as_me 0.4.5, which was +This file was extended by hulahop $as_me 0.4.7, which was generated by GNU Autoconf 2.61. Invocation command line was CONFIG_FILES = $CONFIG_FILES @@ -20567,7 +20567,7 @@ Report bugs to <bug-autoconf@gnu.org>." _ACEOF cat >>$CONFIG_STATUS <<_ACEOF ac_cs_version="\\ -hulahop config.status 0.4.5 +hulahop config.status 0.4.7 configured by $0, generated by GNU Autoconf 2.61, with options \\"`echo "$ac_configure_args" | sed 's/^ //; s/[\\""\`\$]/\\\\&/g'`\\" diff --git a/python/config.py b/python/config.py index 3187eac..52b362e 100644 --- a/python/config.py +++ b/python/config.py @@ -1 +1 @@ -libxul_dir = '/home/erikos/sugar-jhbuild/install/lib64/xulrunner-1.9b5' +libxul_dir = '/home/erikos/sugar-jhbuild/install/lib64/xulrunner-1.9.0.2' diff --git a/python/hulahop.c b/python/hulahop.c index 81caddd..9a31345 100644 --- a/python/hulahop.c +++ b/python/hulahop.c @@ -28,16 +28,6 @@ PyTypeObject G_GNUC_INTERNAL PyHulahopWebView_Type; /* ----------- HulahopWebView ----------- */ static PyObject * -_wrap_hulahop_web_view_create_window(PyGObject *self) -{ - - hulahop_web_view_create_window(HULAHOP_WEB_VIEW(self->obj)); - - Py_INCREF(Py_None); - return Py_None; -} - -static PyObject * _wrap_hulahop_web_view_grab_focus(PyGObject *self) { @@ -53,7 +43,7 @@ _wrap_hulahop_web_view_get_browser(PyGObject *self) { return hulahop_web_view_get_browser(HULAHOP_WEB_VIEW(self->obj)); } -#line 57 "hulahop.c" +#line 47 "hulahop.c" #line 26 "hulahop.override" @@ -62,7 +52,7 @@ _wrap_hulahop_web_view_get_window_root(PyGObject *self) { return hulahop_web_view_get_window_root(HULAHOP_WEB_VIEW(self->obj)); } -#line 66 "hulahop.c" +#line 56 "hulahop.c" static PyObject * @@ -100,9 +90,29 @@ _wrap_hulahop_web_view_evaluate_script(PyGObject *self, PyObject *args, PyObject return Py_None; } +static PyObject * +_wrap_HulahopWebView__do_setup(PyObject *cls, PyObject *args, PyObject *kwargs) +{ + gpointer klass; + static char *kwlist[] = { "self", NULL }; + PyGObject *self; + + if (!PyArg_ParseTupleAndKeywords(args, kwargs,"O!:HulahopWebView.setup", kwlist, &PyHulahopWebView_Type, &self)) + return NULL; + klass = g_type_class_ref(pyg_type_from_object(cls)); + if (HULAHOP_WEB_VIEW_CLASS(klass)->setup) + HULAHOP_WEB_VIEW_CLASS(klass)->setup(HULAHOP_WEB_VIEW(self->obj)); + else { + PyErr_SetString(PyExc_NotImplementedError, "virtual method HulahopWebView.setup not implemented"); + g_type_class_unref(klass); + return NULL; + } + g_type_class_unref(klass); + Py_INCREF(Py_None); + return Py_None; +} + static const PyMethodDef _PyHulahopWebView_methods[] = { - { "create_window", (PyCFunction)_wrap_hulahop_web_view_create_window, METH_NOARGS, - NULL }, { "grab_focus", (PyCFunction)_wrap_hulahop_web_view_grab_focus, METH_NOARGS, NULL }, { "get_browser", (PyCFunction)_wrap_hulahop_web_view_get_browser, METH_NOARGS, @@ -115,6 +125,8 @@ static const PyMethodDef _PyHulahopWebView_methods[] = { NULL }, { "evaluate_script", (PyCFunction)_wrap_hulahop_web_view_evaluate_script, METH_VARARGS|METH_KEYWORDS, NULL }, + { "do_setup", (PyCFunction)_wrap_HulahopWebView__do_setup, METH_VARARGS|METH_KEYWORDS|METH_CLASS, + NULL }, { NULL, NULL, 0, NULL } }; @@ -163,6 +175,77 @@ PyTypeObject G_GNUC_INTERNAL PyHulahopWebView_Type = { (inquiry)0 /* tp_is_gc */ }; +static void +_wrap_HulahopWebView__proxy_do_setup(HulahopWebView *self) +{ + PyGILState_STATE __py_state; + PyObject *py_self; + PyObject *py_retval; + PyObject *py_method; + + __py_state = pyg_gil_state_ensure(); + py_self = pygobject_new((GObject *) self); + if (!py_self) { + if (PyErr_Occurred()) + PyErr_Print(); + pyg_gil_state_release(__py_state); + return; + } + + + py_method = PyObject_GetAttrString(py_self, "do_setup"); + if (!py_method) { + if (PyErr_Occurred()) + PyErr_Print(); + Py_DECREF(py_self); + pyg_gil_state_release(__py_state); + return; + } + py_retval = PyObject_CallObject(py_method, NULL); + if (!py_retval) { + if (PyErr_Occurred()) + PyErr_Print(); + Py_XDECREF(py_retval); + Py_DECREF(py_method); + Py_DECREF(py_self); + pyg_gil_state_release(__py_state); + return; + } + if (py_retval != Py_None) { + PyErr_SetString(PyExc_TypeError, "virtual method should return None"); + PyErr_Print(); + Py_XDECREF(py_retval); + Py_DECREF(py_method); + Py_DECREF(py_self); + pyg_gil_state_release(__py_state); + return; + } + + + Py_XDECREF(py_retval); + Py_DECREF(py_method); + Py_DECREF(py_self); + pyg_gil_state_release(__py_state); +} + +static int +__HulahopWebView_class_init(gpointer gclass, PyTypeObject *pyclass) +{ + PyObject *o; + HulahopWebViewClass *klass = HULAHOP_WEB_VIEW_CLASS(gclass); + PyObject *gsignals = PyDict_GetItemString(pyclass->tp_dict, "__gsignals__"); + + o = PyObject_GetAttrString((PyObject *) pyclass, "do_setup"); + if (o == NULL) + PyErr_Clear(); + else { + if (!PyObject_TypeCheck(o, &PyCFunction_Type) + && !(gsignals && PyDict_GetItemString(gsignals, "setup"))) + klass->setup = _wrap_HulahopWebView__proxy_do_setup; + Py_DECREF(o); + } + return 0; +} /* ----------- functions ----------- */ @@ -219,6 +302,22 @@ _wrap_hulahop_add_components_path(PyObject *self, PyObject *args, PyObject *kwar return Py_None; } +static PyObject * +_wrap_hulahop_get_view_for_window(PyObject *self, PyObject *args, PyObject *kwargs) +{ + static char *kwlist[] = { "dom_window", NULL }; + PyObject *dom_window; + HulahopWebView *ret; + + if (!PyArg_ParseTupleAndKeywords(args, kwargs,"O:get_view_for_window", kwlist, &dom_window)) + return NULL; + + ret = hulahop_get_view_for_window(dom_window); + + /* pygobject_new handles NULL checking */ + return pygobject_new((GObject *)ret); +} + const PyMethodDef pyhulahop_functions[] = { { "startup", (PyCFunction)_wrap_hulahop_startup, METH_NOARGS, NULL }, @@ -228,6 +327,8 @@ const PyMethodDef pyhulahop_functions[] = { NULL }, { "add_components_path", (PyCFunction)_wrap_hulahop_add_components_path, METH_VARARGS|METH_KEYWORDS, NULL }, + { "get_view_for_window", (PyCFunction)_wrap_hulahop_get_view_for_window, METH_VARARGS|METH_KEYWORDS, + NULL }, { NULL, NULL, 0, NULL } }; @@ -251,6 +352,7 @@ pyhulahop_register_classes(PyObject *d) } -#line 255 "hulahop.c" +#line 356 "hulahop.c" pygobject_register_class(d, "HulahopWebView", HULAHOP_TYPE_WEB_VIEW, &PyHulahopWebView_Type, Py_BuildValue("(O)", &PyGtkBin_Type)); + pyg_register_class_init(HULAHOP_TYPE_WEB_VIEW, __HulahopWebView_class_init); } diff --git a/tests/test-web-view.py b/tests/test-web-view.py deleted file mode 100644 index 86038e3..0000000 --- a/tests/test-web-view.py +++ /dev/null @@ -1,39 +0,0 @@ -import os - -import gtk - -import hulahop -hulahop.startup(os.path.expanduser('~/.test-hulahop')) -from hulahop.webview import WebView - -def quit(window): - hulahop.shutdown() - gtk.main_quit() - -def entry_activate_cb(entry): - web_view.load_uri(entry.get_text()) - -window = gtk.Window() -window.set_default_size(600, 400) -window.connect("destroy", quit) - -vbox = gtk.VBox() - -entry = gtk.Entry() -entry.connect('activate', entry_activate_cb) -vbox.pack_start(entry, False) -entry.show() - -web_view = WebView() -web_view.load_uri('http://www.gnome.org') -vbox.pack_start(web_view) -web_view.show() - -window.add(vbox) -vbox.show() - -window.show() - -entry.grab_focus() - -gtk.main() |