Web   ·   Wiki   ·   Activities   ·   Blog   ·   Lists   ·   Chat   ·   Meeting   ·   Bugs   ·   Git   ·   Translate   ·   Archive   ·   People   ·   Donate
summaryrefslogtreecommitdiffstats
path: root/python
diff options
context:
space:
mode:
authorJonas Smedegaard <dr@jones.dk>2008-06-20 22:19:16 (GMT)
committer Jonas Smedegaard <dr@jones.dk>2008-06-20 22:19:16 (GMT)
commitae437e7c97695787b075a3b7000b9de48c72a38b (patch)
treed344649706dd1125003b7dc9867d7d93d7db766c /python
parent575b6689b13b85b58551eaee386015725cd5b82b (diff)
Imported Upstream version 0.4.1upstream/0.4.1
Diffstat (limited to 'python')
-rw-r--r--python/Makefile.in26
-rw-r--r--python/config.py1
-rw-r--r--python/hulahop.c256
-rw-r--r--python/hulahop.defs9
4 files changed, 279 insertions, 13 deletions
diff --git a/python/Makefile.in b/python/Makefile.in
index 6846562..c407d7f 100644
--- a/python/Makefile.in
+++ b/python/Makefile.in
@@ -1,8 +1,8 @@
-# Makefile.in generated by automake 1.10 from Makefile.am.
+# Makefile.in generated by automake 1.10.1 from Makefile.am.
# @configure_input@
# Copyright (C) 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002,
-# 2003, 2004, 2005, 2006 Free Software Foundation, Inc.
+# 2003, 2004, 2005, 2006, 2007, 2008 Free Software Foundation, Inc.
# This Makefile.in is free software; the Free Software Foundation
# gives unlimited permission to copy and/or distribute it,
# with or without modifications, as long as this notice is preserved.
@@ -121,6 +121,7 @@ LIBTOOL = @LIBTOOL@
LIBXUL_CFLAGS = @LIBXUL_CFLAGS@
LIBXUL_DIR = @LIBXUL_DIR@
LIBXUL_LIBS = @LIBXUL_LIBS@
+LIBXUL_SDK_DIR = @LIBXUL_SDK_DIR@
LN_S = @LN_S@
LTLIBOBJS = @LTLIBOBJS@
MAKEINFO = @MAKEINFO@
@@ -270,8 +271,8 @@ install-pkgpyexecLTLIBRARIES: $(pkgpyexec_LTLIBRARIES)
@list='$(pkgpyexec_LTLIBRARIES)'; for p in $$list; do \
if test -f $$p; then \
f=$(am__strip_dir) \
- echo " $(LIBTOOL) --mode=install $(pkgpyexecLTLIBRARIES_INSTALL) $(INSTALL_STRIP_FLAG) '$$p' '$(DESTDIR)$(pkgpyexecdir)/$$f'"; \
- $(LIBTOOL) --mode=install $(pkgpyexecLTLIBRARIES_INSTALL) $(INSTALL_STRIP_FLAG) "$$p" "$(DESTDIR)$(pkgpyexecdir)/$$f"; \
+ echo " $(LIBTOOL) $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=install $(pkgpyexecLTLIBRARIES_INSTALL) $(INSTALL_STRIP_FLAG) '$$p' '$(DESTDIR)$(pkgpyexecdir)/$$f'"; \
+ $(LIBTOOL) $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=install $(pkgpyexecLTLIBRARIES_INSTALL) $(INSTALL_STRIP_FLAG) "$$p" "$(DESTDIR)$(pkgpyexecdir)/$$f"; \
else :; fi; \
done
@@ -279,8 +280,8 @@ uninstall-pkgpyexecLTLIBRARIES:
@$(NORMAL_UNINSTALL)
@list='$(pkgpyexec_LTLIBRARIES)'; for p in $$list; do \
p=$(am__strip_dir) \
- echo " $(LIBTOOL) --mode=uninstall rm -f '$(DESTDIR)$(pkgpyexecdir)/$$p'"; \
- $(LIBTOOL) --mode=uninstall rm -f "$(DESTDIR)$(pkgpyexecdir)/$$p"; \
+ echo " $(LIBTOOL) $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=uninstall rm -f '$(DESTDIR)$(pkgpyexecdir)/$$p'"; \
+ $(LIBTOOL) $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=uninstall rm -f "$(DESTDIR)$(pkgpyexecdir)/$$p"; \
done
clean-pkgpyexecLTLIBRARIES:
@@ -363,8 +364,8 @@ ID: $(HEADERS) $(SOURCES) $(LISP) $(TAGS_FILES)
unique=`for i in $$list; do \
if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \
done | \
- $(AWK) ' { files[$$0] = 1; } \
- END { for (i in files) print i; }'`; \
+ $(AWK) '{ files[$$0] = 1; nonemtpy = 1; } \
+ END { if (nonempty) { for (i in files) print i; }; }'`; \
mkid -fID $$unique
tags: TAGS
@@ -376,8 +377,8 @@ TAGS: $(HEADERS) $(SOURCES) $(TAGS_DEPENDENCIES) \
unique=`for i in $$list; do \
if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \
done | \
- $(AWK) ' { files[$$0] = 1; } \
- END { for (i in files) print i; }'`; \
+ $(AWK) '{ files[$$0] = 1; nonempty = 1; } \
+ END { if (nonempty) { for (i in files) print i; }; }'`; \
if test -z "$(ETAGS_ARGS)$$tags$$unique"; then :; else \
test -n "$$unique" || unique=$$empty_fix; \
$(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \
@@ -387,13 +388,12 @@ ctags: CTAGS
CTAGS: $(HEADERS) $(SOURCES) $(TAGS_DEPENDENCIES) \
$(TAGS_FILES) $(LISP)
tags=; \
- here=`pwd`; \
list='$(SOURCES) $(HEADERS) $(LISP) $(TAGS_FILES)'; \
unique=`for i in $$list; do \
if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \
done | \
- $(AWK) ' { files[$$0] = 1; } \
- END { for (i in files) print i; }'`; \
+ $(AWK) '{ files[$$0] = 1; nonempty = 1; } \
+ END { if (nonempty) { for (i in files) print i; }; }'`; \
test -z "$(CTAGS_ARGS)$$tags$$unique" \
|| $(CTAGS) $(CTAGSFLAGS) $(AM_CTAGSFLAGS) $(CTAGS_ARGS) \
$$tags $$unique
diff --git a/python/config.py b/python/config.py
new file mode 100644
index 0000000..dfa77b8
--- /dev/null
+++ b/python/config.py
@@ -0,0 +1 @@
+libxul_dir = '/home/marco/sugar-jhbuild/install/lib64/xulrunner-1.9'
diff --git a/python/hulahop.c b/python/hulahop.c
new file mode 100644
index 0000000..81caddd
--- /dev/null
+++ b/python/hulahop.c
@@ -0,0 +1,256 @@
+/* -- THIS FILE IS GENERATED - DO NOT EDIT *//* -*- Mode: C; c-basic-offset: 4 -*- */
+
+#include <Python.h>
+
+
+
+#line 4 "hulahop.override"
+#include <Python.h>
+#include <pygtk/pygtk.h>
+
+#include "hulahop-web-view.h"
+
+#line 14 "hulahop.c"
+
+
+/* ---------- types from other modules ---------- */
+static PyTypeObject *_PyGtkBin_Type;
+#define PyGtkBin_Type (*_PyGtkBin_Type)
+
+
+/* ---------- forward type declarations ---------- */
+PyTypeObject G_GNUC_INTERNAL PyHulahopWebView_Type;
+
+#line 25 "hulahop.c"
+
+
+
+/* ----------- 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)
+{
+
+ hulahop_web_view_grab_focus(HULAHOP_WEB_VIEW(self->obj));
+
+ Py_INCREF(Py_None);
+ return Py_None;
+}
+
+#line 19 "hulahop.override"
+static PyObject *
+_wrap_hulahop_web_view_get_browser(PyGObject *self)
+{
+ return hulahop_web_view_get_browser(HULAHOP_WEB_VIEW(self->obj));
+}
+#line 57 "hulahop.c"
+
+
+#line 26 "hulahop.override"
+static PyObject *
+_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"
+
+
+static PyObject *
+_wrap_hulahop_web_view_push_js_context(PyGObject *self)
+{
+
+ hulahop_web_view_push_js_context(HULAHOP_WEB_VIEW(self->obj));
+
+ Py_INCREF(Py_None);
+ return Py_None;
+}
+
+static PyObject *
+_wrap_hulahop_web_view_pop_js_context(PyGObject *self)
+{
+
+ hulahop_web_view_pop_js_context(HULAHOP_WEB_VIEW(self->obj));
+
+ Py_INCREF(Py_None);
+ return Py_None;
+}
+
+static PyObject *
+_wrap_hulahop_web_view_evaluate_script(PyGObject *self, PyObject *args, PyObject *kwargs)
+{
+ static char *kwlist[] = { "script", NULL };
+ char *script;
+
+ if (!PyArg_ParseTupleAndKeywords(args, kwargs,"s:HulahopWebView.evaluate_script", kwlist, &script))
+ return NULL;
+
+ hulahop_web_view_evaluate_script(HULAHOP_WEB_VIEW(self->obj), script);
+
+ 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,
+ NULL },
+ { "get_window_root", (PyCFunction)_wrap_hulahop_web_view_get_window_root, METH_NOARGS,
+ NULL },
+ { "push_js_context", (PyCFunction)_wrap_hulahop_web_view_push_js_context, METH_NOARGS,
+ NULL },
+ { "pop_js_context", (PyCFunction)_wrap_hulahop_web_view_pop_js_context, METH_NOARGS,
+ NULL },
+ { "evaluate_script", (PyCFunction)_wrap_hulahop_web_view_evaluate_script, METH_VARARGS|METH_KEYWORDS,
+ NULL },
+ { NULL, NULL, 0, NULL }
+};
+
+PyTypeObject G_GNUC_INTERNAL PyHulahopWebView_Type = {
+ PyObject_HEAD_INIT(NULL)
+ 0, /* ob_size */
+ "_hulahop.WebView", /* tp_name */
+ sizeof(PyGObject), /* tp_basicsize */
+ 0, /* tp_itemsize */
+ /* methods */
+ (destructor)0, /* tp_dealloc */
+ (printfunc)0, /* tp_print */
+ (getattrfunc)0, /* tp_getattr */
+ (setattrfunc)0, /* tp_setattr */
+ (cmpfunc)0, /* tp_compare */
+ (reprfunc)0, /* tp_repr */
+ (PyNumberMethods*)0, /* tp_as_number */
+ (PySequenceMethods*)0, /* tp_as_sequence */
+ (PyMappingMethods*)0, /* tp_as_mapping */
+ (hashfunc)0, /* tp_hash */
+ (ternaryfunc)0, /* tp_call */
+ (reprfunc)0, /* tp_str */
+ (getattrofunc)0, /* tp_getattro */
+ (setattrofunc)0, /* tp_setattro */
+ (PyBufferProcs*)0, /* tp_as_buffer */
+ Py_TPFLAGS_DEFAULT | Py_TPFLAGS_BASETYPE, /* tp_flags */
+ NULL, /* Documentation string */
+ (traverseproc)0, /* tp_traverse */
+ (inquiry)0, /* tp_clear */
+ (richcmpfunc)0, /* tp_richcompare */
+ offsetof(PyGObject, weakreflist), /* tp_weaklistoffset */
+ (getiterfunc)0, /* tp_iter */
+ (iternextfunc)0, /* tp_iternext */
+ (struct PyMethodDef*)_PyHulahopWebView_methods, /* tp_methods */
+ (struct PyMemberDef*)0, /* tp_members */
+ (struct PyGetSetDef*)0, /* tp_getset */
+ NULL, /* tp_base */
+ NULL, /* tp_dict */
+ (descrgetfunc)0, /* tp_descr_get */
+ (descrsetfunc)0, /* tp_descr_set */
+ offsetof(PyGObject, inst_dict), /* tp_dictoffset */
+ (initproc)0, /* tp_init */
+ (allocfunc)0, /* tp_alloc */
+ (newfunc)0, /* tp_new */
+ (freefunc)0, /* tp_free */
+ (inquiry)0 /* tp_is_gc */
+};
+
+
+
+/* ----------- functions ----------- */
+
+static PyObject *
+_wrap_hulahop_startup(PyObject *self)
+{
+ int ret;
+
+
+ ret = hulahop_startup();
+
+ return PyBool_FromLong(ret);
+
+}
+
+static PyObject *
+_wrap_hulahop_shutdown(PyObject *self)
+{
+
+ hulahop_shutdown();
+
+ Py_INCREF(Py_None);
+ return Py_None;
+}
+
+static PyObject *
+_wrap_hulahop_set_profile_path(PyObject *self, PyObject *args, PyObject *kwargs)
+{
+ static char *kwlist[] = { "path", NULL };
+ char *path;
+
+ if (!PyArg_ParseTupleAndKeywords(args, kwargs,"s:set_profile_path", kwlist, &path))
+ return NULL;
+
+ hulahop_set_profile_path(path);
+
+ Py_INCREF(Py_None);
+ return Py_None;
+}
+
+static PyObject *
+_wrap_hulahop_add_components_path(PyObject *self, PyObject *args, PyObject *kwargs)
+{
+ static char *kwlist[] = { "path", NULL };
+ char *path;
+
+ if (!PyArg_ParseTupleAndKeywords(args, kwargs,"s:add_components_path", kwlist, &path))
+ return NULL;
+
+ hulahop_add_components_path(path);
+
+ Py_INCREF(Py_None);
+ return Py_None;
+}
+
+const PyMethodDef pyhulahop_functions[] = {
+ { "startup", (PyCFunction)_wrap_hulahop_startup, METH_NOARGS,
+ NULL },
+ { "shutdown", (PyCFunction)_wrap_hulahop_shutdown, METH_NOARGS,
+ NULL },
+ { "set_profile_path", (PyCFunction)_wrap_hulahop_set_profile_path, METH_VARARGS|METH_KEYWORDS,
+ NULL },
+ { "add_components_path", (PyCFunction)_wrap_hulahop_add_components_path, METH_VARARGS|METH_KEYWORDS,
+ NULL },
+ { NULL, NULL, 0, NULL }
+};
+
+/* initialise stuff extension classes */
+void
+pyhulahop_register_classes(PyObject *d)
+{
+ PyObject *module;
+
+ if ((module = PyImport_ImportModule("gtk")) != NULL) {
+ _PyGtkBin_Type = (PyTypeObject *)PyObject_GetAttrString(module, "Bin");
+ if (_PyGtkBin_Type == NULL) {
+ PyErr_SetString(PyExc_ImportError,
+ "cannot import name Bin from gtk");
+ return ;
+ }
+ } else {
+ PyErr_SetString(PyExc_ImportError,
+ "could not import gtk");
+ return ;
+ }
+
+
+#line 255 "hulahop.c"
+ pygobject_register_class(d, "HulahopWebView", HULAHOP_TYPE_WEB_VIEW, &PyHulahopWebView_Type, Py_BuildValue("(O)", &PyGtkBin_Type));
+}
diff --git a/python/hulahop.defs b/python/hulahop.defs
index 403208c..55c1733 100644
--- a/python/hulahop.defs
+++ b/python/hulahop.defs
@@ -67,3 +67,12 @@
(return-type "none")
)
+(define-method evaluate_script
+ (of-object "HulahopWebView")
+ (c-name "hulahop_web_view_evaluate_script")
+ (parameters
+ '("gchar*" "script")
+ )
+ (return-type "none")
+)
+