sugar-toolkit-gtk3/src/sugar3/Makefile.am
Daniel Drake 48ad255a78 Reimplement Palettes for GTK3
Moving from GTK2 to GTK3 has presented various challenges regarding
palettes.

In GTK2, we were able to access some internal API of the GtkMenu class
and use it to embed a GtkMenu in a regular window. As of GTK3, that API
has become private and we can no longer access it.

We still want to use GtkMenu for the advanced functionality it provides
(multiple-level menus, keyboard navigation, etc), but we are now limited
to popping it up with its own (internal) window, rather than being able
to pack it into one of our own.

Our palettes can historically be used either as a menu, or as a general
area where widgets can be added, or both. The new restrictions upon
GtkMenu force some changes here, but we work hard to stick to the old
API as far as possible.

A Palette instance now acts as a controller of either a "window widget"
(where any type of widget can be displayed as usual) or a "menu widget"
which just pops up a GtkMenu. A Palette defaults to the window mode, but
dynamically switches to menu mode if/when the user attempts to access
the menu element.

As a result of this, palettes can now pack either a user-defined collection
of widgets, or a menu, but types can no longer be mixed. This should
only affect a handful of palettes which will need to pick a single
approach and convert to it.

Some further challenges are presented by the fact that GtkMenu performs a
grab on the whole screen, meaning that all input events are delivered to
the GtkMenu widget. Through some careful event filtering and examination
of the mouse cursor position we are still able to determine when the mouse
has entered or left the invoker or menu areas.

This work is authored by Benjamin Berg, Marco Pesenti Gritti, Simon
Schampijer and Daniel Drake.
2011-12-20 19:19:16 +01:00

151 lines
3.4 KiB
Makefile

SUBDIRS = activity bundle graphics presence datastore dispatch
sugardir = $(pythondir)/sugar3
sugar_PYTHON = \
__init__.py \
env.py \
logger.py \
mime.py \
network.py \
profile.py \
session.py \
util.py \
wm.py
lib_LTLIBRARIES = libsugarext.la
libsugarext_la_CFLAGS = \
-DHAVE_ALSA \
$(EXT_CFLAGS) \
$(WARN_CFLAGS)
libsugarext_la_LDFLAGS = $(LDADD)
libsugarext_la_LIBADD = $(EXT_LIBS) -lSM -lICE -lasound
libsugarext_la_SOURCES = \
$(BUILT_SOURCES) \
acme-volume-alsa.c \
acme-volume-alsa.h \
acme-volume.c \
acme-volume.h \
eggaccelerators.c \
eggaccelerators.h \
eggdesktopfile.c \
eggdesktopfile.h \
eggsmclient.c \
eggsmclient.h \
eggsmclient-private.h \
eggsmclient-xsmp.c \
gdk-wrapper.c \
gdk-wrapper.h \
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 \
rsvg-wrapper.c \
rsvg-wrapper.h \
sugar-grid.c \
sugar-grid.h \
sugar-key-grabber.c \
sugar-key-grabber.h
sugar_LTLIBRARIES = _sugarbaseext.la
_sugarbaseext_la_CFLAGS = \
-DXDG_PREFIX=sugar_mime \
$(WARN_CFLAGS) \
$(EXT_CFLAGS) \
$(PYTHON_INCLUDES)
BUILT_SOURCES = \
sugar-marshal.c \
sugar-marshal.h
_sugarbaseext_la_LDFLAGS = -module -avoid-version
_sugarbaseext_la_LIBADD = $(EXT_LIBS)
_sugarbaseext_la_SOURCES = \
_sugarbaseextmodule.c \
xdgmime.c \
xdgmime.h \
xdgmimealias.c \
xdgmimealias.h \
xdgmimecache.c \
xdgmimecache.h \
xdgmimeglob.c \
xdgmimeglob.h \
xdgmimeint.c \
xdgmimeint.h \
xdgmimemagic.c \
xdgmimemagic.h \
xdgmimeparent.c \
xdgmimeparent.h
nodist__sugarbaseext_la_SOURCES = _sugarbaseext.c
_sugarbaseext.c: _sugarbaseext.defs _sugarbaseext.override
.defs.c:
(cd $(srcdir)\
&& $(PYGTK_CODEGEN) \
--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
sugar-marshal.h: sugar-marshal.list
$(GLIB_GENMARSHAL) --prefix=sugar_marshal \
$(srcdir)/sugar-marshal.list --header > sugar-marshal.h
CLEANFILES = $(BUILT_SOURCES) _sugarbaseext.c
EXTRA_DIST = sugar-marshal.list _sugarbaseext.override _sugarbaseext.defs
-include $(INTROSPECTION_MAKEFILE)
INTROSPECTION_GIRS = SugarExt-1.0.gir
INTROSPECTION_SCANNER_ARGS = --identifier-prefix=Sugar --symbol-prefix=sugar \
--identifier-prefix=EggSM --symbol-prefix=egg_sm \
--identifier-prefix=Gsm --symbol-prefix=gsm \
--identifier-prefix=Acme --symbol-prefix=acme \
--identifier-prefix=GdkWrapper --symbol-prefix=gdk_wrapper
SugarExt_1_0_gir_LIBS = libsugarext.la
SugarExt_1_0_gir_FILES = \
acme-volume.c \
acme-volume.h \
acme-volume-alsa.c \
acme-volume-alsa.h \
eggsmclient.c \
eggsmclient.h \
gsm-session.c \
gsm-session.h \
gsm-xsmp.c \
gsm-xsmp.h \
sugar-key-grabber.c \
sugar-key-grabber.h \
sugar-grid.c \
sugar-grid.h \
gdk-wrapper.c \
gdk-wrapper.h \
rsvg-wrapper.c \
rsvg-wrapper.h
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)