Cleanup the source structure

This commit is contained in:
Marco Pesenti Gritti 2007-10-16 11:04:59 +02:00
parent 087856f233
commit 6240c1cf6f
87 changed files with 110 additions and 139 deletions

View File

@ -1,6 +1,6 @@
ACLOCAL_AMFLAGS = -I m4
SUBDIRS = bin data lib po shell sugar services
SUBDIRS = bin data lib po shell services
bin_SCRIPTS = \
sugar-emulator

View File

@ -19,12 +19,7 @@ AC_PATH_PROG(PYGTK_CODEGEN, pygtk-codegen-2.0, no)
PKG_CHECK_MODULES(SHELL, pygtk-2.0 gtk+-2.0)
PKG_CHECK_MODULES(NATIVE_FACTORY, dbus-1)
PKG_CHECK_MODULES(LIBUI, gtk+-2.0)
PKG_CHECK_MODULES(LIBUI_BINDINGS, pygtk-2.0)
PKG_CHECK_MODULES(LIB_BINDINGS, pygobject-2.0)
PKG_CHECK_MODULES(LIB, pygtk-2.0 gtk+-2.0)
PYGTK_DEFSDIR=`$PKG_CONFIG --variable=defsdir pygtk-2.0`
AC_SUBST(PYGTK_DEFSDIR)
@ -52,6 +47,14 @@ bin/Makefile
data/Makefile
data/icons/Makefile
lib/Makefile
lib/sugar/Makefile
lib/sugar/activity/Makefile
lib/sugar/bundle/Makefile
lib/sugar/clipboard/Makefile
lib/sugar/graphics/Makefile
lib/sugar/objects/Makefile
lib/sugar/presence/Makefile
lib/sugar/datastore/Makefile
services/Makefile
services/shell/Makefile
shell/Makefile
@ -83,13 +86,5 @@ services/console/interface/network/Makefile
services/console/interface/logviewer/Makefile
services/console/interface/terminal/Makefile
services/console/interface/xserver/Makefile
sugar/Makefile
sugar/activity/Makefile
sugar/bundle/Makefile
sugar/clipboard/Makefile
sugar/graphics/Makefile
sugar/objects/Makefile
sugar/presence/Makefile
sugar/datastore/Makefile
po/Makefile.in
])

View File

@ -1,50 +1 @@
libsugarui_la_CPPFLAGS = \
$(LIBUI_CFLAGS)
noinst_LTLIBRARIES = libsugarui.la
libsugarui_la_LIBADD = \
$(LIBUI_LIBS)
libsugarui_la_SOURCES = \
$(BUILT_SOURCES) \
eggaccelerators.c \
eggaccelerators.h \
sexy-icon-entry.h \
sexy-icon-entry.c \
sugar-address-entry.c \
sugar-address-entry.h \
sugar-key-grabber.c \
sugar-key-grabber.h \
sugar-menu.h \
sugar-menu.c \
sugar-x11-util.c \
sugar-x11-util.h
BUILT_SOURCES = \
sugar-marshal.c \
sugar-marshal.h
stamp_files = \
stamp-sugar-marshal.c \
stamp-sugar-marshal.h
sugar-marshal.c: stamp-sugar-marshal.c
@true
stamp-sugar-marshal.c: sugar-marshal.list
$(GLIB_GENMARSHAL) --prefix=sugar_marshal \
$(srcdir)/sugar-marshal.list --header --body > \
sugar-marshal.c && echo timestamp > $(@F)
sugar-marshal.h: stamp-sugar-marshal.h
@true
stamp-sugar-marshal.h: sugar-marshal.list
$(GLIB_GENMARSHAL) --prefix=sugar_marshal \
$(srcdir)/sugar-marshal.list --header > \
sugar-marshal.h && echo timestamp > $(@F)
CLEANFILES = $(stamp_files) $(BUILT_SOURCES)
DISTCLEANFILES = $(stamp_files) $(BUILT_SOURCES)
MAINTAINERCLEANFILES = $(stamp_files) $(BUILT_SOURCES)
EXTRA_DIST = sugar-marshal.list
SUBDIRS = sugar

2
lib/sugar/.gitignore vendored Normal file
View File

@ -0,0 +1,2 @@
_sugarext.c
_sugarext.c

74
lib/sugar/Makefile.am Normal file
View File

@ -0,0 +1,74 @@
SUBDIRS = activity bundle clipboard graphics objects presence datastore
sugardir = $(pythondir)/sugar
sugar_PYTHON = \
env.py \
network.py \
profile.py \
util.py \
wm.py
pkgpyexecdir = $(pythondir)/sugar
pkgpyexec_LTLIBRARIES = _sugarext.la
_sugarext_la_CFLAGS = \
$(LIB_CFLAGS) \
$(PYTHON_INCLUDES)
_sugarext_la_LDFLAGS = -module -avoid-version
_sugarext_la_LIBADD = $(LIB_LIBS)
_sugarext_la_SOURCES = \
$(BUILT_SOURCES) \
_sugarextmodule.c \
eggaccelerators.c \
eggaccelerators.h \
sexy-icon-entry.h \
sexy-icon-entry.c \
sugar-address-entry.c \
sugar-address-entry.h \
sugar-key-grabber.c \
sugar-key-grabber.h \
sugar-menu.h \
sugar-menu.c \
sugar-x11-util.c \
sugar-x11-util.h
nodist__sugarext_la_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
stamp_files = \
stamp-sugar-marshal.c \
stamp-sugar-marshal.h
sugar-marshal.c: stamp-sugar-marshal.c
@true
stamp-sugar-marshal.c: sugar-marshal.list
$(GLIB_GENMARSHAL) --prefix=sugar_marshal \
$(srcdir)/sugar-marshal.list --header --body > \
sugar-marshal.c && echo timestamp > $(@F)
sugar-marshal.h: stamp-sugar-marshal.h
@true
stamp-sugar-marshal.h: sugar-marshal.list
$(GLIB_GENMARSHAL) --prefix=sugar_marshal \
$(srcdir)/sugar-marshal.list --header > \
sugar-marshal.h && echo timestamp > $(@F)
CLEANFILES = $(stamp_files)
EXTRA_DIST = sugar-marshal.list _sugarext.defs _sugarext.override

View File

@ -24,25 +24,25 @@
/* include this first, before NO_IMPORT_PYGOBJECT is defined */
#include <pygobject.h>
extern PyMethodDef py_sugaruiext_functions[];
extern PyMethodDef py_sugarext_functions[];
void py_sugaruiext_register_classes (PyObject *d);
void py_sugaruiext_add_constants (PyObject *module, const gchar *strip_prefix);
void py_sugarext_register_classes (PyObject *d);
void py_sugarext_add_constants (PyObject *module, const gchar *strip_prefix);
DL_EXPORT(void)
init_sugaruiext(void)
init_sugarext(void)
{
PyObject *m, *d;
init_pygobject ();
m = Py_InitModule ("_sugaruiext", py_sugaruiext_functions);
m = Py_InitModule ("_sugarext", py_sugarext_functions);
d = PyModule_GetDict (m);
py_sugaruiext_register_classes (d);
py_sugaruiext_add_constants(m, "SEXY_");
py_sugarext_register_classes (d);
py_sugarext_add_constants(m, "SEXY_");
if (PyErr_Occurred ()) {
Py_FatalError ("can't initialise module _sugaruiext");
Py_FatalError ("can't initialise module _sugarext");
}
}

View File

@ -17,12 +17,12 @@
import gtk
from sugar import _sugaruiext
from sugar import _sugarext
ICON_ENTRY_PRIMARY = _sugaruiext.ICON_ENTRY_PRIMARY
ICON_ENTRY_SECONDARY = _sugaruiext.ICON_ENTRY_SECONDARY
ICON_ENTRY_PRIMARY = _sugarext.ICON_ENTRY_PRIMARY
ICON_ENTRY_SECONDARY = _sugarext.ICON_ENTRY_SECONDARY
class IconEntry(_sugaruiext.IconEntry):
class IconEntry(_sugarext.IconEntry):
def set_icon_from_name(self, position, name):
icon_theme = gtk.icon_theme_get_default()
icon_info = icon_theme.lookup_icon(name,
@ -41,5 +41,5 @@ class IconEntry(_sugaruiext.IconEntry):
if image.get_storage_type() not in [gtk.IMAGE_PIXBUF, gtk.IMAGE_STOCK]:
raise ValueError('Image must have a storage type of pixbuf or ' +
'stock, not %r.' % image.get_storage_type())
_sugaruiext.IconEntry.set_icon(self, position, image)
_sugarext.IconEntry.set_icon(self, position, image)

View File

@ -25,7 +25,7 @@ import hippo
from sugar.graphics import palettegroup
from sugar.graphics import animator
from sugar.graphics import style
from sugar import _sugaruiext
from sugar import _sugarext
# Helper function to find the gap position and size of widget a
def _calculate_gap(a, b):
@ -435,15 +435,15 @@ class PaletteActionBar(gtk.HButtonBox):
self.pack_start(button)
button.show()
class _Menu(_sugaruiext.Menu):
class _Menu(_sugarext.Menu):
__gtype_name__ = 'SugarPaletteMenu'
def __init__(self, palette):
_sugaruiext.Menu.__init__(self)
_sugarext.Menu.__init__(self)
self._palette = palette
def do_insert(self, item, position):
_sugaruiext.Menu.do_insert(self, item, position)
_sugarext.Menu.do_insert(self, item, position)
self._palette._update_separators()
self.show()

View File

@ -17,22 +17,22 @@
import gtk
import _sugaruiext
import _sugarext
def get_activity_id(wnck_window):
window = gtk.gdk.window_foreign_new(wnck_window.get_xid())
return _sugaruiext.x11_get_string_property(
return _sugarext.x11_get_string_property(
window, '_SUGAR_ACTIVITY_ID')
def get_bundle_id(wnck_window):
window = gtk.gdk.window_foreign_new(wnck_window.get_xid())
return _sugaruiext.x11_get_string_property(
return _sugarext.x11_get_string_property(
window, '_SUGAR_BUNDLE_ID')
def set_activity_id(window, activity_id):
_sugaruiext.x11_set_string_property(
_sugarext.x11_set_string_property(
window, '_SUGAR_ACTIVITY_ID', activity_id)
def set_bundle_id(window, bundle_id):
_sugaruiext.x11_set_string_property(
_sugarext.x11_set_string_property(
window, '_SUGAR_BUNDLE_ID', bundle_id)

View File

@ -24,7 +24,7 @@ import gtk
from hardware import hardwaremanager
from model.shellmodel import ShellModel
from sugar._sugaruiext import KeyGrabber
from sugar._sugarext import KeyGrabber
_BRIGHTNESS_STEP = 2
_VOLUME_STEP = 10

2
sugar/.gitignore vendored
View File

@ -1,2 +0,0 @@
_sugarext.c
_sugaruiext.c

View File

@ -1 +0,0 @@
LGPL

View File

@ -1,48 +0,0 @@
SUBDIRS = activity bundle clipboard graphics objects presence datastore
sugardir = $(pythondir)/sugar
sugar_PYTHON = \
env.py \
network.py \
profile.py \
util.py \
wm.py
pkgpyexecdir = $(pythondir)/sugar
pkgpyexec_LTLIBRARIES = _sugaruiext.la
_sugaruiext_la_CFLAGS = \
$(LIBUI_CFLAGS) \
$(LIBUI_BINDINGS_CFLAGS) \
$(PYTHON_INCLUDES) \
-I$(top_srcdir)/lib
_sugaruiext_la_LDFLAGS = -module -avoid-version
_sugaruiext_la_LIBADD = \
$(LIBUI_BINDINGS_LIBS) \
$(LIBUI_LIBS) \
$(top_builddir)/lib/libsugarui.la
_sugaruiext_la_SOURCES = \
_sugaruiextmodule.c
nodist__sugaruiext_la_SOURCES = _sugaruiext.c
_sugaruiext.c: _sugaruiext.defs _sugaruiext.override
CLEANFILES = _sugaruiext.c
EXTRA_DIST = \
_sugaruiext.defs \
_sugaruiext.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