Skip to content

Commit

Permalink
merge sawman :)
Browse files Browse the repository at this point in the history
  • Loading branch information
Andreas Shimokawa committed Oct 4, 2012
1 parent f1b9914 commit 46d3a52
Show file tree
Hide file tree
Showing 48 changed files with 286 additions and 41 deletions.
73 changes: 73 additions & 0 deletions README.SaWMan
@@ -0,0 +1,73 @@
SaWMan
-------

DirectFB proudly presents SaWMan, the Shared application and Window Manager,
as a co-development of Royal Philips and Denis Oliver Kropp.

SaWMan is a new window manager module for use with DirectFB. Its main difference
to the default module is that it allows one process to be an application and window
manager, implementing all kinds of diversity, while SaWMan is only the working horse.

On its own, SaWMan will behave similar to the default window manager, but as soon as
there's an application manager, SaWMan will do synchronous RPCs to that application in
relevant functions of the window manager module. That means it switches to the process
and continues after it has completed the requested call and returned a result. The data
which those calls operate on is already in shared memory, e.g. a window configuration.

The application manager can hook itself into several operations with this, e.g. it can
forbid or modify requested window configurations right before they're actually applied
by SaWMan.

For non-desktop and especially non-pointer environments like TVs, it is important to
provide a simple and convenient layout and focus management. The layout of all windows
can be completely overridden by the application manager, e.g. to implement a screen
tiling mode.

The integration of application management allows easy definition and handling of
application specific constraints. The manager has a list of applications identified
by their name. Launching applications is usually initiated by the application manager
itself, e.g. based on global keys grabbed by an input only window. However, the public
SaWMan interfaces provide a way to send launch/shutdown requests from any application
to the application manager.

While the key grabbing only provides asynchronous notification about keys which are
then handled in the manager's main loop, SaWMan provides a hook to let the manager
basically filter every single input event in a synchronous way, similar to the window
configuration. Critical operations like layout and focus switching are best done in
this callback.

[...]

For more information you can check the more or less documented header files in the
include/ directory, or have a look at 'testman' - a minimal example of a manager
implementation in the samples/ directory. You'll also find a small test program
called 'testrun' which demonstrates launching of applications from another application.


Running testman
----------------

Once you have a session running after setting the option "wm = sawman" you'll notice
that there's nothing new, except the old window manager hacks (builtin keys) are gone.

However, if you start 'testman' from the samples/ directory, you'll see windows being
tiled on the screen, unless these windows have the DWCAPS_NODECORATION flag, e.g. LiTE
and XDirectFB use that.

You can try running "df_andi --dfb:force-windowed" or even simply run df_window.

Hitting F9 cycles the focus through managed windows.
F10 would switch layout modes, but there's only one implemented in the test code.
F11 switches between "smooth software" or "standard (hw/sw)" scaling (for windows only).

The smooth scaling algorithms have also been developed in the scope of this project.


Using testrun
--------------

The command "testrun <name>" will start/stop an application.

Available in the test code are:
Penguins df_andi --dfb:mode=640x480,force-windowed
Windows df_windows
24 changes: 24 additions & 0 deletions configure.in
Expand Up @@ -650,6 +650,19 @@ else
enable_pure_voodoo=no
fi

AC_ARG_ENABLE(sawman,
AC_HELP_STRING([--enable-sawman],
[enable SaWMan (window manager and application mananger) @<:@default=no@:>@]),
[], [enable_one=no])
if test "$enable_sawman" = "yes"; then
DIRECTFB_BUILD_SAWMAN=1
DEP_SAWMAN=sawman
else
DIRECTFB_BUILD_SAWMAN=0
enable_sawman=no
DEP_SAWMAN=
fi

AC_SUBST(DIRECTFB_BUILD_ONE)
AM_CONDITIONAL(DIRECTFB_BUILD_ONE, test "$DIRECTFB_BUILD_ONE" = "1")

Expand All @@ -659,8 +672,12 @@ AM_CONDITIONAL(DIRECTFB_BUILD_VOODOO, test "$DIRECTFB_BUILD_VOODOO" = "1")
AC_SUBST(DIRECTFB_BUILD_PURE_VOODOO)
AM_CONDITIONAL(DIRECTFB_BUILD_PURE_VOODOO, test "$DIRECTFB_BUILD_PURE_VOODOO" = "1")

AC_SUBST(DIRECTFB_BUILD_SAWMAN)
AM_CONDITIONAL(DIRECTFB_BUILD_SAWMAN, test "$DIRECTFB_BUILD_SAWMAN" = "1")

AC_SUBST(DEP_ONE)
AC_SUBST(DEP_VOODOO)
AC_SUBST(DEP_SAWMAN)

dnl If we're not building a pure voodoo lib, we need sqrt sin cos for
dnl various files
Expand Down Expand Up @@ -688,6 +705,8 @@ AC_SUBST(FUSION_BUILD_KERNEL)
AM_CONDITIONAL(ENABLE_ONE, test "$enable_one" = "yes")
AM_CONDITIONAL(ENABLE_VOODOO, test "$enable_voodoo" = "yes")

AM_CONDITIONAL(ENABLE_SAWMAN, test "$enable_sawman" = "yes")


AC_ARG_ENABLE(unique,
AC_HELP_STRING([--enable-unique],
Expand Down Expand Up @@ -2164,6 +2183,9 @@ lib/voodoo/build.h
lib/voodoo/unix/Makefile
lib/voodoo/voodoo.pc

lib/sawman/Makefile
lib/sawman/sawman.pc

patches/Makefile

proxy/Makefile
Expand Down Expand Up @@ -2202,6 +2224,7 @@ wm/unique/Makefile
wm/unique/classes/Makefile
wm/unique/data/Makefile
wm/unique/devices/Makefile
wm/sawman/Makefile

gfxdrivers/Makefile
gfxdrivers/ati128/Makefile
Expand Down Expand Up @@ -2337,6 +2360,7 @@ Building System Modules:
Building Window Manager Modules:
Default yes
UniQuE $enable_unique
SaWMan $enable_sawman

Building Image Provider Modules:
GIF $enable_gif
Expand Down
6 changes: 5 additions & 1 deletion lib/Makefile.am
Expand Up @@ -8,5 +8,9 @@ if ENABLE_VOODOO
VOODOO_DIR = voodoo
endif

SUBDIRS = direct fusion $(ONE_DIR) $(VOODOO_DIR)
if ENABLE_SAWMAN
SAWMAN_DIR = sawman
endif

SUBDIRS = direct fusion $(ONE_DIR) $(VOODOO_DIR) $(SAWMAN_DIR)

7 changes: 7 additions & 0 deletions lib/sawman/.gitignore
@@ -0,0 +1,7 @@
SaWMan.cpp
SaWMan.h
SaWManManager.cpp
SaWManManager.h
SaWManProcess.cpp
SaWManProcess.h
sawman.pc
105 changes: 105 additions & 0 deletions lib/sawman/Makefile.am
@@ -0,0 +1,105 @@
## Makefile.am for SaWMan/src

INCLUDES = \
-I$(top_builddir)/include \
-I$(top_builddir)/src \
-I$(top_builddir)/lib \
-I$(top_builddir)/sawman \
-I$(top_srcdir)/include \
-I$(top_srcdir)/src \
-I$(top_srcdir)/lib \
-I$(top_srcdir)/lib/sawman \
$(DIRECTFB_CFLAGS)

AM_CPPFLAGS = \
-DDATADIR=\"${RUNTIME_SYSROOT}@DATADIR@\" \
-DMODULEDIR=\"${RUNTIME_SYSROOT}@MODULEDIR@\" \
-DSYSCONFDIR=\"@sysconfdir@\"

pkgconfigdir = $(libdir)/pkgconfig
pkgconfig_DATA = sawman.pc

includedir = @INCLUDEDIR@/sawman

include_HEADERS = \
sawman.h \
sawman_types.h

lib_LTLIBRARIES = libsawman.la

libsawman_la_SOURCES = \
SaWMan.cpp \
SaWMan.h \
SaWMan_includes.h \
SaWMan_real.cpp \
SaWManManager.cpp \
SaWManManager.h \
SaWManManager_includes.h \
SaWManManager_real.cpp \
SaWManProcess.cpp \
SaWManProcess.h \
SaWManProcess_includes.h \
SaWManProcess_real.cpp \
isawman.c \
isawman.h \
isawmanmanager.c \
isawmanmanager.h \
region.c \
region.h \
sawman_core.c \
sawman_internal.h \
sawman_config.c \
sawman_config.h \
sawman_draw.c \
sawman_draw.h \
sawman_updates.c \
sawman_updates.h \
sawman_window.c \
sawman_window.h

libsawman_la_LIBADD = \
$(DIRECTFB_LIBS)

libsawman_la_LDFLAGS = \
-version-info $(LT_CURRENT):$(LT_REVISION):$(LT_AGE) \
-release $(LT_RELEASE)


#
## and now rebuild the static version with the *correct* object files
#
if BUILD_STATIC

clean-local:
rm -f libsawman_fixed.a

all-local: libsawman_fixed.a

libsawman_fixed.a: .libs/libsawman.a
rm -f libsawman_fixed.a
${AR} cru libsawman_fixed.a `find . -name "*.o" | grep -v '.libs'`
${RANLIB} libsawman_fixed.a
cp -pf libsawman_fixed.a .libs/libsawman.a

.libs/libsawman.a: libsawman.la

else

clean-local:

all-local:

endif


distclean-local:
rm -f SaWMan.cpp
rm -f SaWMan.h
rm -f SaWManManager.cpp
rm -f SaWManManager.h
rm -f SaWManProcess.cpp
rm -f SaWManProcess.h

include $(top_srcdir)/rules/flux_comp_sawman.make
include $(top_srcdir)/rules/nmfile.make

File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
2 changes: 2 additions & 0 deletions rules/flux_comp_sawman.make
@@ -0,0 +1,2 @@
$(builddir)/%.cpp $(builddir)/%.h: $(srcdir)/%.flux
fluxcomp $<
8 changes: 0 additions & 8 deletions samples/.cvsignore

This file was deleted.

3 changes: 0 additions & 3 deletions samples/.gitignore

This file was deleted.

19 changes: 0 additions & 19 deletions samples/Makefile.am

This file was deleted.

5 changes: 5 additions & 0 deletions tests/.gitignore
@@ -1,11 +1,13 @@
coretest_blit2
coretest_task
coretest_fillrect
coretest_task_fillrect
dfbtest_blit
dfbtest_blit_multi
dfbtest_blit2
dfbtest_clipboard
dfbtest_fillrect
dfbtest_flip
dfbtest_font
dfbtest_gl1
dfbtest_gl2
Expand Down Expand Up @@ -40,6 +42,9 @@ fusion_fork
fusion_reactor
fusion_skirmish
fusion_stream
sample1
testman
testrun
voodoo_bench
voodoo_bench_client
voodoo_bench_client_unix
Expand Down
29 changes: 28 additions & 1 deletion tests/Makefile.am
Expand Up @@ -21,13 +21,23 @@ VOODOO_PROGS = \
voodoo_bench_server_unix
endif

if DIRECTFB_BUILD_SAWMAN
SAWMAN_PROGS = \
sample1 \
testrun \
testman
endif


INCLUDES = \
-I$(top_builddir)/include \
-I$(top_builddir)/lib \
-I$(top_builddir)/lib/One \
-I$(top_builddir)/lib/sawman \
-I$(top_srcdir)/include \
-I$(top_srcdir)/lib \
-I$(top_srcdir)/lib/One \
-I$(top_srcdir)/lib/sawman \
-I$(top_srcdir)/src \
-DLINUX_2_6

Expand Down Expand Up @@ -94,7 +104,8 @@ bin_PROGRAMS = \
direct_stream \
direct_test \
$(ONE_PROGS) \
$(VOODOO_PROGS)
$(VOODOO_PROGS) \
$(SAWMAN_PROGS)

libdirectfb = $(top_builddir)/src/libdirectfb.la
libfusion = $(top_builddir)/lib/fusion/libfusion.la
Expand All @@ -114,6 +125,13 @@ else
libone =
endif

if DIRECTFB_BUILD_SAWMAN
libsawman = \
../lib/sawman/libsawman.la
else
libsawman =
endif

coretest_blit2_SOURCES = coretest_blit2.c
coretest_blit2_LDADD = $(libdirectfb) $(libone) $(libvoodoo) $(libfusion) $(libdirect)

Expand Down Expand Up @@ -269,3 +287,12 @@ voodoo_bench_client_unix_LDADD = $(libdirectfb) $(libone) $(libvoodoo) $(libfu

voodoo_bench_server_unix_SOURCES = voodoo_bench_server_unix.c
voodoo_bench_server_unix_LDADD = $(libdirectfb) $(libone) $(libvoodoo) $(libfusion) $(libdirect)

testman_SOURCES = testman.c
testman_LDADD = $(libdirectfb) $(libone) $(libvoodoo) $(libfusion) $(libdirect) $(libsawman)

testrun_SOURCES = testrun.c
testrun_LDADD = $(libdirectfb) $(libone) $(libvoodoo) $(libfusion) $(libdirect) $(libsawman)

sample1_SOURCES = sample1.c
sample1_LDADD = $(libdirectfb) $(libone) $(libvoodoo) $(libfusion) $(libdirect) $(libsawman)
File renamed without changes.
File renamed without changes.
File renamed without changes.
1 change: 1 addition & 0 deletions tools/.gitignore
Expand Up @@ -18,6 +18,7 @@ mkdgifft
raw15toraw24
raw16toraw24
raw32toraw24
swmdump
voodooplay
voodooplay_client
voodooplay_server

0 comments on commit 46d3a52

Please sign in to comment.