From 62a46ff92b234d07437f9f36efea576996eb84e2 Mon Sep 17 00:00:00 2001 From: Marco Pesenti Gritti Date: Thu, 12 Oct 2006 10:47:17 +0000 Subject: Create a private sugar lib and put our extensions there. --- (limited to 'bindings/gecko') diff --git a/bindings/gecko/Makefile.am b/bindings/gecko/Makefile.am deleted file mode 100644 index 7da2e52..0000000 --- a/bindings/gecko/Makefile.am +++ /dev/null @@ -1,33 +0,0 @@ -INCLUDES = \ - $(PYTHON_INCLUDES) \ - $(PYGTK_CFLAGS) \ - $(GECKO_CFLAGS) - -geckodir = $(pkgdatadir)/bindings -pkgpyexecdir = $(geckodir) - -pkgpyexec_LTLIBRARIES = gecko.la - -gecko_la_LDFLAGS = -module -avoid-version -gecko_la_LIBADD = $(GECKO_LIBS) - -gecko_la_SOURCES = \ - geckomodule.c \ - gecko-browser.h \ - gecko-browser.cpp - -nodist_gecko_la_SOURCES = gecko.c - -gecko.c: gecko.defs gecko.override - -CLEANFILES = gecko.c -EXTRA_DIST = gecko.override gecko.defs - -.defs.c: - (cd $(srcdir)\ - && $(PYGTK_CODEGEN) \ - --register $(GNOMEPYTHONEXTRAS_DEFSDIR)/gtkmozembed.defs \ - --override $*.override \ - --prefix py$* $*.defs) > gen-$*.c \ - && cp gen-$*.c $*.c \ - && rm -f gen-$*.c diff --git a/bindings/gecko/gecko-browser.cpp b/bindings/gecko/gecko-browser.cpp deleted file mode 100644 index cab07f8..0000000 --- a/bindings/gecko/gecko-browser.cpp +++ /dev/null @@ -1,78 +0,0 @@ -/* - * Copyright (C) 2006 Red Hat, Inc - * - * Sugar is free software; you can redistribute it and/or modify it - * under the terms of the GNU General Public License as published by - * the Free Software Foundation; either version 2 of the License, or - * (at your option) any later version. - * - * Sugar is distributed in the hope that it will be useful, but - * WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - * General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program; if not, write to the Free Software - * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307, USA. - */ - -#include "gecko-browser.h" - -#include -#include -#include - -void -gecko_browser_startup(void) -{ - nsCOMPtr prefService; - - prefService = do_GetService(NS_PREFSERVICE_CONTRACTID); - NS_ENSURE_TRUE(prefService, ); - - nsCOMPtr pref; - prefService->GetBranch("", getter_AddRefs(pref)); - NS_ENSURE_TRUE(pref, ); - - pref->SetBoolPref ("dom.disable_open_during_load", TRUE); -} - -G_DEFINE_TYPE(GeckoBrowser, gecko_browser, GTK_TYPE_MOZ_EMBED) - -//static guint signals[N_SIGNALS]; - -GeckoBrowser * -gecko_browser_new(void) -{ - return GECKO_BROWSER(g_object_new(GECKO_TYPE_BROWSER, NULL)); -} - -static void -gecko_browser_class_init(GeckoBrowserClass *browser_class) -{ -} - -GeckoBrowser * -gecko_browser_create_window(GeckoBrowser *browser) -{ - return GECKO_BROWSER_GET_CLASS(browser)->create_window(browser); -} - -static void -gecko_browser_new_window_cb(GtkMozEmbed *embed, - GtkMozEmbed **newEmbed, - guint chromemask) -{ - GeckoBrowser *browser; - - browser = gecko_browser_create_window(GECKO_BROWSER(embed)); - - *newEmbed = GTK_MOZ_EMBED(browser); -} - -static void -gecko_browser_init(GeckoBrowser *browser) -{ - g_signal_connect(G_OBJECT(browser), "new-window", - G_CALLBACK(gecko_browser_new_window_cb), NULL); -} diff --git a/bindings/gecko/gecko-browser.h b/bindings/gecko/gecko-browser.h deleted file mode 100644 index d41d2c5..0000000 --- a/bindings/gecko/gecko-browser.h +++ /dev/null @@ -1,54 +0,0 @@ -/* - * Copyright (C) 2006 Red Hat, Inc - * - * Sugar is free software; you can redistribute it and/or modify it - * under the terms of the GNU General Public License as published by - * the Free Software Foundation; either version 2 of the License, or - * (at your option) any later version. - * - * Sugar is distributed in the hope that it will be useful, but - * WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - * General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program; if not, write to the Free Software - * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307, USA. - */ - -#ifndef __GECKO_BROWSER_H__ -#define __GECKO_BROWSER_H__ - -#include - -G_BEGIN_DECLS - -typedef struct _GeckoBrowser GeckoBrowser; -typedef struct _GeckoBrowserClass GeckoBrowserClass; -typedef struct _GeckoBrowserPrivate GeckoBrowserPrivate; - -#define GECKO_TYPE_BROWSER (gecko_browser_get_type()) -#define GECKO_BROWSER(object) (G_TYPE_CHECK_INSTANCE_CAST((object), GECKO_TYPE_BROWSER, GeckoBrowser)) -#define GECKO_BROWSER_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST((klass), GECKO_TYPE_BROWSER, GeckoBrowserClass)) -#define GECKO_IS_BROWSER(object) (G_TYPE_CHECK_INSTANCE_TYPE((object), GECKO_TYPE_BROWSER)) -#define GECKO_IS_BROWSER_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE((klass), GECKO_TYPE_BROWSER)) -#define GECKO_BROWSER_GET_CLASS(object) (G_TYPE_INSTANCE_GET_CLASS((object), GECKO_TYPE_BROWSER, GeckoBrowserClass)) - -struct _GeckoBrowser { - GtkMozEmbed base_instance; -}; - -struct _GeckoBrowserClass { - GtkMozEmbedClass base_class; - - GeckoBrowser * (* create_window) (GeckoBrowser *browser); -}; - -GType gecko_browser_get_type (void); -void gecko_browser_startup (void); -GeckoBrowser *gecko_browser_new (void); -GeckoBrowser *gecko_browser_create_window (GeckoBrowser *browser); - -G_END_DECLS - -#endif diff --git a/bindings/gecko/gecko.defs b/bindings/gecko/gecko.defs deleted file mode 100644 index c7f6c1a..0000000 --- a/bindings/gecko/gecko.defs +++ /dev/null @@ -1,40 +0,0 @@ -;; -*- scheme -*- -; object definitions ... -(define-object Browser - (in-module "Gecko") - (parent "GtkMozEmbed") - (c-name "GeckoBrowser") - (gtype-id "GECKO_TYPE_BROWSER") -) - -;; Enumerations and flags ... - - -;; From gecko-browser.h - -(define-function get_type - (c-name "gecko_browser_get_type") - (return-type "GType") -) - -(define-function startup - (c-name "gecko_browser_startup") - (return-type "none") -) - -(define-function new - (c-name "gecko_browser_new") - (is-constructor-of "GeckoBrowser") - (return-type "GeckoBrowser*") -) - -(define-method create_window - (of-object "GeckoBrowser") - (c-name "gecko_browser_create_window") - (return-type "GeckoBrowser*") -) - -(define-virtual create_window - (of-object "GeckoBrowser") - (return-type "GeckoBrowser*") -) diff --git a/bindings/gecko/gecko.override b/bindings/gecko/gecko.override deleted file mode 100644 index b32caa6..0000000 --- a/bindings/gecko/gecko.override +++ /dev/null @@ -1,18 +0,0 @@ -/* -*- Mode: C; c-basic-offset: 4 -*- */ -%% -headers -#include - -#include "pygobject.h" -#include "gecko-browser.h" - -%% -modulename gecko -%% -import gobject.GObject as PyGObject_Type -import gtkmozembed.MozEmbed as PyGtkMozEmbed_Type -%% -ignore-glob - *_get_type - _* -%% diff --git a/bindings/gecko/geckomodule.c b/bindings/gecko/geckomodule.c deleted file mode 100644 index 8455de8..0000000 --- a/bindings/gecko/geckomodule.c +++ /dev/null @@ -1,27 +0,0 @@ -#ifdef HAVE_CONFIG_H -#include "config.h" -#endif - -/* include this first, before NO_IMPORT_PYGOBJECT is defined */ -#include - -void pygecko_register_classes (PyObject *d); - -extern PyMethodDef pygecko_functions[]; - -DL_EXPORT(void) -initgecko(void) -{ - PyObject *m, *d; - - init_pygobject (); - - m = Py_InitModule ("gecko", pygecko_functions); - d = PyModule_GetDict (m); - - pygecko_register_classes (d); - - if (PyErr_Occurred ()) { - Py_FatalError ("can't initialise module globalkeys"); - } -} -- cgit v0.9.1