Web   ·   Wiki   ·   Activities   ·   Blog   ·   Lists   ·   Chat   ·   Meeting   ·   Bugs   ·   Git   ·   Translate   ·   Archive   ·   People   ·   Donate
summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorSimon Schampijer <simon@schampijer.de>2011-10-29 12:47:08 (GMT)
committer Simon Schampijer <simon@schampijer.de>2011-10-29 12:47:08 (GMT)
commitdd5057164ea5f54362ef9c24e040803fa53f2740 (patch)
tree5d1cfc883ad5145b71487ac7e13198cd9e295c0f
parent969583f7a3037bfeacb473045447de8514039428 (diff)
parent7eed2d1ea092eeef9460a254ae72f23256ba7bac (diff)
Merge branch 'master' of git.sugarlabs.org:~erikos/sugar-toolkit/sugar-toolkit-gtk3
-rw-r--r--.gitignore2
-rw-r--r--Makefile.am1
-rw-r--r--configure.ac2
-rw-r--r--src/sugar3/Makefile.am85
-rw-r--r--src/sugar3/_sugarext.defs339
-rw-r--r--src/sugar3/_sugarext.override79
-rw-r--r--src/sugar3/_sugarextmodule.c48
-rw-r--r--src/sugar3/activity/Makefile.am1
-rw-r--r--src/sugar3/activity/activity.py14
-rw-r--r--src/sugar3/activity/main.py160
-rw-r--r--src/sugar3/eggaccelerators.h2
-rw-r--r--src/sugar3/eggsmclient-private.h1
-rw-r--r--src/sugar3/sugar-key-grabber.h2
-rw-r--r--src/sugar3/sugar-menu.h2
14 files changed, 65 insertions, 673 deletions
diff --git a/.gitignore b/.gitignore
index fe4cc56..60ce11b 100644
--- a/.gitignore
+++ b/.gitignore
@@ -2,6 +2,8 @@
*.lo
*.pyc
*~
+*.gir
+*.typelib
.deps
.libs
diff --git a/Makefile.am b/Makefile.am
index b62b8cc..6359a2b 100644
--- a/Makefile.am
+++ b/Makefile.am
@@ -1,4 +1,5 @@
ACLOCAL_AMFLAGS = -I m4
+DISTCHECK_CONFIGURE_FLAGS = --enable-introspection
DISTCLEANFILES = \
intltool-extract \
diff --git a/configure.ac b/configure.ac
index a12f071..e815274 100644
--- a/configure.ac
+++ b/configure.ac
@@ -35,6 +35,8 @@ AC_SUBST(GETTEXT_PACKAGE)
AC_DEFINE_UNQUOTED(GETTEXT_PACKAGE, "$GETTEXT_PACKAGE", [Gettext package])
AM_GLIB_GNU_GETTEXT
+GOBJECT_INTROSPECTION_CHECK([1.30.0])
+
AC_OUTPUT([
Makefile
src/Makefile
diff --git a/src/sugar3/Makefile.am b/src/sugar3/Makefile.am
index a66b741..4c32796 100644
--- a/src/sugar3/Makefile.am
+++ b/src/sugar3/Makefile.am
@@ -9,68 +9,51 @@ sugar_PYTHON = \
util.py \
wm.py
-pkgpyexecdir = $(pythondir)/sugar3
+lib_LTLIBRARIES = libsugarext.la
-pkgpyexec_LTLIBRARIES = _sugarext.la
-
-_sugarext_la_CFLAGS = \
+libsugarext_la_CFLAGS = \
-DHAVE_ALSA \
- $(WARN_CFLAGS) \
- $(EXT_CFLAGS) \
- $(PYTHON_INCLUDES)
+ $(EXT_CFLAGS) \
+ $(WARN_CFLAGS)
-_sugarext_la_LDFLAGS = -module -avoid-version
-_sugarext_la_LIBADD = $(EXT_LIBS) -lSM -lICE
+libsugarext_la_LDFLAGS = $(LDADD)
+libsugarext_la_LIBADD = $(EXT_LIBS) -lSM -lICE -lasound
-_sugarext_la_SOURCES = \
+libsugarext_la_SOURCES = \
$(BUILT_SOURCES) \
- _sugarextmodule.c \
- acme-volume.h \
- acme-volume.c \
- acme-volume-alsa.h \
acme-volume-alsa.c \
- gsm-app.h \
- gsm-app.c \
- gsm-client.h \
- gsm-client.c \
- gsm-client-xsmp.h \
- gsm-client-xsmp.c \
- gsm-xsmp.h \
- gsm-xsmp.c \
- gsm-session.h \
- gsm-session.c \
+ acme-volume-alsa.h \
+ acme-volume.c \
+ acme-volume.h \
eggaccelerators.c \
eggaccelerators.h \
- eggdesktopfile.h \
eggdesktopfile.c \
- eggsmclient.h \
+ eggdesktopfile.h \
eggsmclient.c \
+ eggsmclient.h \
eggsmclient-private.h \
eggsmclient-xsmp.c \
+ gsm-app.c \
+ gsm-app.h \
+ gsm-client.c \
+ gsm-client.h \
+ gsm-client-xsmp.c \
+ gsm-client-xsmp.h \
+ gsm-session.c \
+ gsm-session.h \
+ gsm-xsmp.c \
+ gsm-xsmp.h \
sugar-grid.c \
sugar-grid.h \
sugar-key-grabber.c \
sugar-key-grabber.h \
- sugar-menu.h \
- sugar-menu.c
+ sugar-menu.c \
+ sugar-menu.h
BUILT_SOURCES = \
- _sugarext.c \
sugar-marshal.c \
sugar-marshal.h
-_sugarext.c: _sugarext.defs _sugarext.override
-
-.defs.c:
- (cd $(srcdir)\
- && $(PYGTK_CODEGEN) \
- --register $(PYGTK_DEFSDIR)/gdk-types.defs \
- --register $(PYGTK_DEFSDIR)/gtk-types.defs \
- --override $*.override \
- --prefix py$* $*.defs) > gen-$*.c \
- && cp gen-$*.c $*.c \
- && rm -f gen-$*.c
-
sugar-marshal.c: sugar-marshal.list
$(GLIB_GENMARSHAL) --prefix=sugar_marshal \
$(srcdir)/sugar-marshal.list --header --body > sugar-marshal.c
@@ -80,4 +63,22 @@ sugar-marshal.h: sugar-marshal.list
$(srcdir)/sugar-marshal.list --header > sugar-marshal.h
CLEANFILES = $(BUILT_SOURCES)
-EXTRA_DIST = sugar-marshal.list _sugarext.defs _sugarext.override
+EXTRA_DIST = sugar-marshal.list
+
+-include $(INTROSPECTION_MAKEFILE)
+INTROSPECTION_GIRS = SugarExt-1.0.gir
+INTROSPECTION_SCANNER_ARGS = --identifier-prefix=Sugar --symbol-prefix=sugar \
+ --identifier-prefix=Gsm --symbol-prefix=gsm
+SugarExt_1_0_gir_LIBS = libsugarext.la
+SugarExt_1_0_gir_FILES = $(libsugarext_la_SOURCES)
+SugarExt_1_0_gir_INCLUDES = Gtk-3.0 Gdk-3.0
+SugarExt_1_0_gir_PACKAGES = gtk+-3.0 gdk-3.0
+SugarExt_1_0_gir_EXPORT_PACKAGES = SugarExt-1.0
+
+girdir = $(datadir)/gir-1.0
+gir_DATA = SugarExt-1.0.gir
+
+typelibdir = $(libdir)/girepository-1.0
+typelib_DATA = SugarExt-1.0.typelib
+
+CLEANFILES += $(gir_DATA) $(typelib_DATA)
diff --git a/src/sugar3/_sugarext.defs b/src/sugar3/_sugarext.defs
deleted file mode 100644
index 070fb5b..0000000
--- a/src/sugar3/_sugarext.defs
+++ /dev/null
@@ -1,339 +0,0 @@
-;; -*- scheme -*-
-; object definitions
-
-(define-object KeyGrabber
- (in-module "Sugar")
- (parent "GObject")
- (c-name "SugarKeyGrabber")
- (gtype-id "SUGAR_TYPE_KEY_GRABBER")
-)
-
-(define-object Menu
- (in-module "Sugar")
- (parent "GtkMenu")
- (c-name "SugarMenu")
- (gtype-id "SUGAR_TYPE_MENU")
-)
-
-(define-object Grid
- (in-module "Sugar")
- (parent "GObject")
- (c-name "SugarGrid")
- (gtype-id "SUGAR_TYPE_GRID")
-)
-
-(define-object SMClientXSMP
- (in-module "Egg")
- (parent "EggSMClient")
- (c-name "EggSMClientXSMP")
- (gtype-id "EGG_TYPE_SM_CLIENT_XSMP")
-)
-
-(define-object SMClient
- (in-module "Egg")
- (parent "GObject")
- (c-name "EggSMClient")
- (gtype-id "EGG_TYPE_SM_CLIENT")
-)
-
-(define-object Session
- (in-module "Gsm")
- (parent "GObject")
- (c-name "GsmSession")
- (gtype-id "GSM_TYPE_SESSION")
-)
-
-(define-object Volume
- (in-module "Acme")
- (parent "GObject")
- (c-name "AcmeVolume")
- (gtype-id "ACME_TYPE_VOLUME")
-)
-
-(define-object VolumeAlsa
- (in-module "Acme")
- (parent "AcmeVolume")
- (c-name "AcmeVolumeAlsa")
- (gtype-id "ACME_TYPE_VOLUME_ALSA")
-)
-
-;; From sugar-menu.h
-
-(define-method set_active
- (of-object "SugarMenu")
- (c-name "sugar_menu_set_active")
- (return-type "none")
- (parameters
- '("gboolean" "active")
- )
-)
-
-(define-method embed
- (of-object "SugarMenu")
- (c-name "sugar_menu_embed")
- (return-type "none")
- (parameters
- '("GtkContainer" "container")
- )
-)
-
-(define-method unembed
- (of-object "SugarMenu")
- (c-name "sugar_menu_unembed")
- (return-type "none")
-)
-
-;; From sugar-grid.h
-
-(define-method setup
- (of-object "SugarGrid")
- (c-name "sugar_grid_setup")
- (return-type "none")
- (parameters
- '("gint" "width")
- '("gint" "height")
- )
-)
-
-(define-method add_weight
- (of-object "SugarGrid")
- (c-name "sugar_grid_add_weight")
- (return-type "none")
- (parameters
- '("GdkRectangle*" "rect")
- )
-)
-
-(define-method remove_weight
- (of-object "SugarGrid")
- (c-name "sugar_grid_remove_weight")
- (return-type "none")
- (parameters
- '("GdkRectangle*" "rect")
- )
-)
-
-(define-method compute_weight
- (of-object "SugarGrid")
- (c-name "sugar_grid_compute_weight")
- (return-type "guint")
- (parameters
- '("GdkRectangle*" "rect")
- )
-)
-
-;; From sugar-key-grabber.h
-
-(define-function sugar_key_grabber_get_type
- (c-name "sugar_key_grabber_get_type")
- (return-type "GType")
-)
-
-(define-method grab_keys
- (of-object "SugarKeyGrabber")
- (c-name "sugar_key_grabber_grab_keys")
- (return-type "none")
- (parameters
- '("const-char*[]" "keys")
- )
-)
-
-(define-method get_key
- (of-object "SugarKeyGrabber")
- (c-name "sugar_key_grabber_get_key")
- (return-type "char*")
- (parameters
- '("guint" "keycode")
- '("guint" "state")
- )
-)
-
-(define-method is_modifier
- (of-object "SugarKeyGrabber")
- (c-name "sugar_key_grabber_is_modifier")
- (return-type "gboolean")
- (parameters
- '("guint" "keycode")
- '("guint" "mask" (default "-1"))
- )
-)
-
-;; From eggsmclient.h
-
-(define-function egg_sm_client_get_type
- (c-name "egg_sm_client_get_type")
- (return-type "GType")
-)
-
-(define-function egg_sm_client_get_option_group
- (c-name "egg_sm_client_get_option_group")
- (return-type "GOptionGroup*")
-)
-
-(define-method is_resumed
- (of-object "EggSMClient")
- (c-name "egg_sm_client_is_resumed")
- (return-type "gboolean")
-)
-
-(define-method get_state_file
- (of-object "EggSMClient")
- (c-name "egg_sm_client_get_state_file")
- (return-type "GKeyFile*")
-)
-
-(define-method set_restart_command
- (of-object "EggSMClient")
- (c-name "egg_sm_client_set_restart_command")
- (return-type "none")
- (parameters
- '("int" "argc")
- '("const-char**" "argv")
- )
-)
-
-(define-method startup
- (of-object "EggSMClient")
- (c-name "egg_sm_client_startup")
- (return-type "none")
-)
-
-(define-method will_quit
- (of-object "EggSMClient")
- (c-name "egg_sm_client_will_quit")
- (return-type "none")
- (parameters
- '("gboolean" "will_quit")
- )
-)
-
-(define-function egg_sm_client_end_session
- (c-name "egg_sm_client_end_session")
- (return-type "gboolean")
- (parameters
- '("EggSMClientEndStyle" "style")
- '("gboolean" "request_confirmation")
- )
-)
-
-;; From xsmp.h
-
-(define-function xsmp_init
- (c-name "gsm_xsmp_init")
- (return-type "char*")
-)
-
-(define-function xsmp_run
- (c-name "gsm_xsmp_run")
- (return-type "none")
-)
-
-(define-function xsmp_shutdown
- (c-name "gsm_xsmp_shutdown")
- (return-type "none")
-)
-
-;; From session.h
-
-(define-method set_name
- (of-object "GsmSession")
- (c-name "gsm_session_set_name")
- (return-type "none")
- (parameters
- '("const-char*" "name")
- )
-)
-
-(define-method start
- (of-object "GsmSession")
- (c-name "gsm_session_start")
- (return-type "none")
-)
-
-(define-method get_phase
- (of-object "GsmSession")
- (c-name "gsm_session_get_phase")
- (return-type "GsmSessionPhase")
-)
-
-(define-method initiate_shutdown
- (of-object "GsmSession")
- (c-name "gsm_session_initiate_shutdown")
- (return-type "none")
-)
-
-(define-method cancel_shutdown
- (of-object "GsmSession")
- (c-name "gsm_session_cancel_shutdown")
- (return-type "none")
-)
-
-(define-method register_client
- (of-object "GsmSession")
- (c-name "gsm_session_register_client")
- (return-type "char*")
- (parameters
- '("GsmClient*" "client")
- '("const-char*" "previous_id")
- )
-)
-
-(define-function session_create_global
- (c-name "gsm_session_create_global")
- (return-type "GsmSession*")
-)
-
-;; From acme-volume.h
-
-(define-function acme_volume_get_type
- (c-name "acme_volume_get_type")
- (return-type "GType")
-)
-
-(define-method get_volume
- (of-object "AcmeVolume")
- (c-name "acme_volume_get_volume")
- (return-type "int")
-)
-
-(define-method set_volume
- (of-object "AcmeVolume")
- (c-name "acme_volume_set_volume")
- (return-type "none")
- (parameters
- '("int" "val")
- )
-)
-
-(define-method get_mute
- (of-object "AcmeVolume")
- (c-name "acme_volume_get_mute")
- (return-type "gboolean")
-)
-
-(define-method set_mute
- (of-object "AcmeVolume")
- (c-name "acme_volume_set_mute")
- (return-type "none")
- (parameters
- '("gboolean" "val")
- )
-)
-
-(define-method mute_toggle
- (of-object "AcmeVolume")
- (c-name "acme_volume_mute_toggle")
- (return-type "none")
-)
-
-(define-method get_threshold
- (of-object "AcmeVolume")
- (c-name "acme_volume_get_threshold")
- (return-type "int")
-)
-
-(define-function acme_volume_new
- (c-name "acme_volume_new")
- (is-constructor-of "AcmeVolume")
- (return-type "AcmeVolume*")
-)
diff --git a/src/sugar3/_sugarext.override b/src/sugar3/_sugarext.override
deleted file mode 100644
index def0927..0000000
--- a/src/sugar3/_sugarext.override
+++ /dev/null
@@ -1,79 +0,0 @@
-/* -*- Mode: C; c-basic-offset: 4 -*- */
-%%
-headers
-#include <Python.h>
-
-#include "pygobject.h"
-#include "sugar-grid.h"
-#include "sugar-key-grabber.h"
-#include "sugar-menu.h"
-#include "gsm-session.h"
-#include "gsm-xsmp.h"
-#include "acme-volume-alsa.h"
-
-#include "eggsmclient.h"
-#include "eggsmclient-private.h"
-
-#include <pygtk/pygtk.h>
-#include <glib.h>
-
-%%
-modulename sugar._sugarext
-%%
-import gobject.GObject as PyGObject_Type
-import gtk.Widget as PyGtkWidget_Type
-import gtk.Entry as PyGtkEntry_Type
-import gtk.Menu as PyGtkMenu_Type
-import gtk.Container as PyGtkContainer_Type
-import gtk.gdk.Window as PyGdkWindow_Type
-import gtk.Image as PyGtkImage_Type
-%%
-ignore-glob
- *_get_type
- _*
-%%
-override sugar_key_grabber_grab_keys kwargs
-static PyObject *
-_wrap_sugar_key_grabber_grab_keys(PyGObject *self, PyObject *args, PyObject *kwargs)
-{
- static char *kwlist[] = { "key", NULL };
- PyObject *py_keys;
- char **keys;
- int i, len;
-
- if (!PyArg_ParseTupleAndKeywords(args,kwargs,
- "O:SugarKeyGrabber.grab_keys",
- kwlist, &py_keys))
- return NULL;
-
- if (!PySequence_Check(py_keys) || (len = PySequence_Size(py_keys)) < 0) {
- PyErr_SetString(PyExc_ValueError,
- "keys should be a sequence of strings");
- return NULL;
- }
-
- keys = g_new(char*, len + 1);
- for (i = 0; i < len; i++) {
- PyObject *item = PySequence_GetItem(py_keys, i);
- if (!item) {
- g_free(keys);
- return NULL;
- }
- if (!PyString_Check(item)) {
- PyErr_SetString(PyExc_TypeError, "key must be a string");
- g_free(keys);
- Py_DECREF(item);
- return NULL;
- }
- keys[i] = PyString_AsString(item);
- Py_DECREF(item);
- }
- keys[len] = NULL;
-
- sugar_key_grabber_grab_keys (SUGAR_KEY_GRABBER(self->obj), (const char**) keys);
-
- Py_INCREF(Py_None);
- return Py_None;
-}
-
-%%
diff --git a/src/sugar3/_sugarextmodule.c b/src/sugar3/_sugarextmodule.c
deleted file mode 100644
index dc5dfca..0000000
--- a/src/sugar3/_sugarextmodule.c
+++ /dev/null
@@ -1,48 +0,0 @@
-/*
- * Copyright (C) 2006-2007, Red Hat, Inc.
- *
- * This library is free software; you can redistribute it and/or
- * modify it under the terms of the GNU Lesser General Public
- * License as published by the Free Software Foundation; either
- * version 2 of the License, or (at your option) any later version.
- *
- * This library 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
- * Lesser General Public License for more details.
- *
- * You should have received a copy of the GNU Lesser General Public
- * License along with this library; if not, write to the
- * Free Software Foundation, Inc., 59 Temple Place - Suite 330,
- * Boston, MA 02111-1307, USA.
- */
-
-#ifdef HAVE_CONFIG_H
-#include "config.h"
-#endif
-
-/* include this first, before NO_IMPORT_PYGOBJECT is defined */
-#include <pygobject.h>
-#include <pygtk/pygtk.h>
-
-extern PyMethodDef py_sugarext_functions[];
-
-void py_sugarext_register_classes (PyObject *d);
-
-DL_EXPORT(void)
-init_sugarext(void)
-{
- PyObject *m, *d;
-
- init_pygobject();
- init_pygtk();
-
- m = Py_InitModule("_sugarext", py_sugarext_functions);
- d = PyModule_GetDict(m);
-
- py_sugarext_register_classes(d);
-
- if (PyErr_Occurred ()) {
- Py_FatalError ("can't initialise module _sugarext");
- }
-}
diff --git a/src/sugar3/activity/Makefile.am b/src/sugar3/activity/Makefile.am
index 50e12a5..40701d1 100644
--- a/src/sugar3/activity/Makefile.am
+++ b/src/sugar3/activity/Makefile.am
@@ -7,6 +7,5 @@ sugar_PYTHON = \
activityservice.py \
bundlebuilder.py \
i18n.py \
- main.py \
namingalert.py \
widgets.py
diff --git a/src/sugar3/activity/activity.py b/src/sugar3/activity/activity.py
index 1261984..ced8c0f 100644
--- a/src/sugar3/activity/activity.py
+++ b/src/sugar3/activity/activity.py
@@ -259,6 +259,17 @@ class Activity(Window, Gtk.Container):
the base class __init()__ before doing Activity specific things.
"""
+ # Stuff that needs to be done early
+
+ icons_path = os.path.join(get_bundle_path(), 'icons')
+ Gtk.IconTheme.get_default().append_search_path(icons_path)
+
+ # This code can be removed when we grow an xsettings daemon (the GTK+
+ # init routines will then automatically figure out the font settings)
+ settings = Gtk.Settings.get_default()
+ settings.set_property('gtk-font-name',
+ '%s %f' % (style.FONT_FACE, style.FONT_SIZE))
+
Window.__init__(self)
if 'SUGAR_ACTIVITY_ROOT' in os.environ:
@@ -349,6 +360,9 @@ class Activity(Window, Gtk.Container):
self.__jobject_updated_cb)
self.set_title(self._jobject.metadata['title'])
+ def run_main_loop(self):
+ Gtk.main()
+
def _initialize_journal_object(self):
title = _('%s Activity') % get_bundle_name()
client = GConf.Client.get_default()
diff --git a/src/sugar3/activity/main.py b/src/sugar3/activity/main.py
deleted file mode 100644
index de767ac..0000000
--- a/src/sugar3/activity/main.py
+++ /dev/null
@@ -1,160 +0,0 @@
-# Copyright (C) 2008 Red Hat, Inc.
-#
-# This library is free software; you can redistribute it and/or
-# modify it under the terms of the GNU Lesser General Public
-# License as published by the Free Software Foundation; either
-# version 2 of the License, or (at your option) any later version.
-#
-# This library 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
-# Lesser General Public License for more details.
-#
-# You should have received a copy of the GNU Lesser General Public
-# License along with this library; if not, write to the
-# Free Software Foundation, Inc., 59 Temple Place - Suite 330,
-# Boston, MA 02111-1307, USA.
-
-import os
-import sys
-import gettext
-from optparse import OptionParser
-
-from gi.repository import Gtk
-import dbus
-import dbus.service
-import dbus.glib
-
-import sugar
-from sugar3.activity import activityhandle
-from sugar3.activity import i18n
-from sugar3.bundle.activitybundle import ActivityBundle
-from sugar3.graphics import style
-from sugar import logger
-
-
-def create_activity_instance(constructor, handle):
- activity = constructor(handle)
- activity.show()
-
-
-def get_single_process_name(bundle_id):
- return bundle_id
-
-
-def get_single_process_path(bundle_id):
- return '/' + bundle_id.replace('.', '/')
-
-
-class SingleProcess(dbus.service.Object):
-
- def __init__(self, name_service, constructor):
- self.constructor = constructor
-
- bus = dbus.SessionBus()
- bus_name = dbus.service.BusName(name_service, bus=bus)
- object_path = get_single_process_path(name_service)
- dbus.service.Object.__init__(self, bus_name, object_path)
-
- @dbus.service.method('org.laptop.SingleProcess', in_signature='a{sv}')
- def create(self, handle_dict):
- handle = activityhandle.create_from_dict(handle_dict)
- create_activity_instance(self.constructor, handle)
-
-
-def main():
- parser = OptionParser()
- parser.add_option('-b', '--bundle-id', dest='bundle_id',
- help='identifier of the activity bundle')
- parser.add_option('-a', '--activity-id', dest='activity_id',
- help='identifier of the activity instance')
- parser.add_option('-o', '--object-id', dest='object_id',
- help='identifier of the associated datastore object')
- parser.add_option('-u', '--uri', dest='uri',
- help='URI to load')
- parser.add_option('-s', '--single-process', dest='single_process',
- action='store_true',
- help='start all the instances in the same process')
- parser.add_option('-i', '--invited', dest='invited',
- action='store_true', default=False,
- help='the activity is being launched for handling an '
- 'invite from the network')
- (options, args) = parser.parse_args()
-
- logger.start()
-
- if 'SUGAR_BUNDLE_PATH' not in os.environ:
- print 'SUGAR_BUNDLE_PATH is not defined in the environment.'
- sys.exit(1)
-
- if len(args) == 0:
- print 'A python class must be specified as first argument.'
- sys.exit(1)
-
- bundle_path = os.environ['SUGAR_BUNDLE_PATH']
- sys.path.append(bundle_path)
-
- bundle = ActivityBundle(bundle_path)
-
- os.environ['SUGAR_BUNDLE_ID'] = bundle.get_bundle_id()
- os.environ['SUGAR_BUNDLE_NAME'] = bundle.get_name()
- os.environ['SUGAR_BUNDLE_VERSION'] = str(bundle.get_activity_version())
-
- Gtk.IconTheme.get_default().append_search_path(bundle.get_icons_path())
-
- # This code can be removed when we grow an xsettings daemon (the GTK+
- # init routines will then automatically figure out the font settings)
- settings = Gtk.Settings.get_default()
- settings.set_property('gtk-font-name',
- '%s %f' % (style.FONT_FACE, style.FONT_SIZE))
-
- locale_path = i18n.get_locale_path(bundle.get_bundle_id())
-
- gettext.bindtextdomain(bundle.get_bundle_id(), locale_path)
- gettext.bindtextdomain('sugar-toolkit', sugar3.locale_path)
- gettext.textdomain(bundle.get_bundle_id())
-
- splitted_module = args[0].rsplit('.', 1)
- module_name = splitted_module[0]
- class_name = splitted_module[1]
-
- module = __import__(module_name)
- for comp in module_name.split('.')[1:]:
- module = getattr(module, comp)
-
- activity_constructor = getattr(module, class_name)
- activity_handle = activityhandle.ActivityHandle(
- activity_id=options.activity_id,
- object_id=options.object_id, uri=options.uri,
- invited=options.invited)
-
- if options.single_process is True:
- sessionbus = dbus.SessionBus()
-
- service_name = get_single_process_name(options.bundle_id)
- service_path = get_single_process_path(options.bundle_id)
-
- bus_object = sessionbus.get_object(
- 'org.freedesktop.DBus', '/org/freedesktop/DBus')
- try:
- name = bus_object.GetNameOwner(
- service_name, dbus_interface='org.freedesktop.DBus')
- except dbus.DBusException:
- name = None
-
- if not name:
- SingleProcess(service_name, activity_constructor)
- else:
- single_process = sessionbus.get_object(service_name, service_path)
- single_process.create(activity_handle.get_dict(),
- dbus_interface='org.laptop.SingleProcess')
-
- print 'Created %s in a single process.' % service_name
- sys.exit(0)
-
- if hasattr(module, 'start'):
- module.start()
-
- create_activity_instance(activity_constructor, activity_handle)
-
- Gtk.main()
diff --git a/src/sugar3/eggaccelerators.h b/src/sugar3/eggaccelerators.h
index 96d5390..423b274 100644
--- a/src/sugar3/eggaccelerators.h
+++ b/src/sugar3/eggaccelerators.h
@@ -21,7 +21,7 @@
#ifndef __EGG_ACCELERATORS_H__
#define __EGG_ACCELERATORS_H__
-#include <gtk/gtkaccelgroup.h>
+#include <gtk/gtk.h>
#include <gdk/gdk.h>
G_BEGIN_DECLS
diff --git a/src/sugar3/eggsmclient-private.h b/src/sugar3/eggsmclient-private.h
index d2958c9..fd95ace 100644
--- a/src/sugar3/eggsmclient-private.h
+++ b/src/sugar3/eggsmclient-private.h
@@ -20,7 +20,6 @@
#ifndef __EGG_SM_CLIENT_PRIVATE_H__
#define __EGG_SM_CLIENT_PRIVATE_H__
-#include <gdkconfig.h>
#include "eggsmclient.h"
G_BEGIN_DECLS
diff --git a/src/sugar3/sugar-key-grabber.h b/src/sugar3/sugar-key-grabber.h
index ab02870..9abc887 100644
--- a/src/sugar3/sugar-key-grabber.h
+++ b/src/sugar3/sugar-key-grabber.h
@@ -21,7 +21,7 @@
#define __SUGAR_KEY_GRABBER_H__
#include <glib-object.h>
-#include <gdk/gdkwindow.h>
+#include <gdk/gdk.h>
G_BEGIN_DECLS
diff --git a/src/sugar3/sugar-menu.h b/src/sugar3/sugar-menu.h
index 74ce891..c3bb3d0 100644
--- a/src/sugar3/sugar-menu.h
+++ b/src/sugar3/sugar-menu.h
@@ -20,7 +20,7 @@
#ifndef __SUGAR_MENU_H__
#define __SUGAR_MENU_H__
-#include <gtk/gtkmenu.h>
+#include <gtk/gtk.h>
G_BEGIN_DECLS