From 7a52bff245e02ca84943c7246f82e7aa96498e43 Mon Sep 17 00:00:00 2001 From: Dana Jansens Date: Thu, 31 Jan 2008 23:08:30 -0500 Subject: [PATCH] create the loco library for composting. it links against libGL. openbox.c calls it when it takes over a screen, and when it is exiting. --- Makefile.am | 34 +++++++++++++++++++++++++++++++--- configure.ac | 40 ++++++++++++++++++++++++++++++++++++++++ loco/loco-4.0.pc.in | 14 ++++++++++++++ loco/loco.c | 29 +++++++++++++++++++++++++++++ loco/loco.h | 29 +++++++++++++++++++++++++++++ openbox/openbox.c | 5 +++++ 6 files changed, 148 insertions(+), 3 deletions(-) create mode 100644 loco/loco-4.0.pc.in create mode 100644 loco/loco.c create mode 100644 loco/loco.h diff --git a/Makefile.am b/Makefile.am index a27eba24..f8c1a17d 100644 --- a/Makefile.am +++ b/Makefile.am @@ -26,7 +26,8 @@ check_PROGRAMS = \ lib_LTLIBRARIES = \ render/libobrender.la \ - obt/libobt.la + obt/libobt.la \ + loco/liboco.la bin_PROGRAMS = \ openbox/openbox \ @@ -140,6 +141,31 @@ obt_libobt_la_SOURCES = \ obt/xevent.h \ obt/xevent.c +## loco ## + +loco_liboco_la_CPPFLAGS = \ + $(GL_CFLAGS) \ + $(XSHAPE_CFLAGS) \ + $(XRENDER_CFLAGS) \ + $(XDAMAGE_CFLAGS) \ + $(XCOMPOSITE_CFLAGS) \ + $(GLIB_CFLAGS) \ + -DG_LOG_DOMAIN=\"Loco\" \ + -DLOCALEDIR=\"$(localedir)\" \ + -DDATADIR=\"$(datadir)\" \ + -DCONFIGDIR=\"$(configdir)\" +loco_liboco_la_LDFLAGS = \ + -version-info $(LOCO_CURRENT):$(LOCO_REVISION):$(LOCO_AGE) +loco_liboco_la_LIBADD = \ + $(GL_LIBS) \ + $(XSHAPE_LIBS) \ + $(XRENDER_LIBS) \ + $(XDAMAGE_LIBS) \ + $(XCOMPOSITE_LIBS) \ + $(GLIB_LIBS) +loco_liboco_la_SOURCES = \ + loco/loco.c + ## openbox ## openbox_openbox_CPPFLAGS = \ @@ -165,7 +191,8 @@ openbox_openbox_LDADD = \ $(EFENCE_LIBS) \ $(LIBINTL) \ render/libobrender.la \ - obt/libobt.la + obt/libobt.la \ + loco/liboco.la openbox_openbox_LDFLAGS = -export-dynamic openbox_openbox_SOURCES = \ gettext.h \ @@ -408,7 +435,8 @@ obtpubinclude_HEADERS = \ nodist_pkgconfig_DATA = \ render/obrender-4.0.pc \ - obt/obt-4.0.pc + obt/obt-4.0.pc \ + loco/loco-4.0.pc ## data ## diff --git a/configure.ac b/configure.ac index b26065f2..5d080401 100644 --- a/configure.ac +++ b/configure.ac @@ -27,6 +27,13 @@ OBT_INTERFACE_AGE=0 OBT_BINARY_AGE=0 OBT_VERSION=$OBT_MAJOR_VERSION.$OBT_MINOR_VERSION +LOCO_MAJOR_VERSION=4 +LOCO_MINOR_VERSION=0 +LOCO_MICRO_VERSION=0 +LOCO_INTERFACE_AGE=0 +LOCO_BINARY_AGE=0 +LOCO_VERSION=$OB_MAJOR_VERSION.$OB_MINOR_VERSION + AC_SUBST(RR_MAJOR_VERSION) AC_SUBST(RR_MINOR_VERSION) AC_SUBST(RR_MICRO_VERSION) @@ -39,6 +46,12 @@ AC_SUBST(OBT_MICRO_VERSION) AC_SUBST(OBT_INTERFACE_AGE) AC_SUBST(OBT_BINARY_AGE) AC_SUBST(OBT_VERSION) +AC_SUBST(LOCO_MAJOR_VERSION) +AC_SUBST(LOCO_MINOR_VERSION) +AC_SUBST(LOCO_MICRO_VERSION) +AC_SUBST(LOCO_INTERFACE_AGE) +AC_SUBST(LOCO_BINARY_AGE) +AC_SUBST(LOCO_VERSION) dnl Libtool versioning RR_RELEASE=$RR_MAJOR_VERSION.$RR_MINOR_VERSION @@ -53,6 +66,12 @@ OBT_REVISION=$OBT_INTERFACE_AGE OBT_AGE=`expr $OBT_BINARY_AGE - $OBT_INTERFACE_AGE` OBT_CURRENT_MINUS_AGE=`expr $OBT_CURRENT - $OBT_AGE` +LOCO_RELEASE=$LOCO_MAJOR_VERSION.$LOCO_MINOR_VERSION +LOCO_CURRENT=`expr $LOCO_MICRO_VERSION - $LOCO_INTERFACE_AGE` +LOCO_REVISION=$LOCO_INTERFACE_AGE +LOCO_AGE=`expr $LOCO_BINARY_AGE - $LOCO_INTERFACE_AGE` +LOCO_CURRENT_MINUS_AGE=`expr $LOCO_CURRENT - $LOCO_AGE` + AC_SUBST(RR_RELEASE) AC_SUBST(RR_CURRENT) AC_SUBST(RR_REVISION) @@ -63,6 +82,11 @@ AC_SUBST(OBT_CURRENT) AC_SUBST(OBT_REVISION) AC_SUBST(OBT_AGE) AC_SUBST(OBT_CURRENT_MINUS_AGE) +AC_SUBST(LOCO_RELEASE) +AC_SUBST(LOCO_CURRENT) +AC_SUBST(LOCO_REVISION) +AC_SUBST(LOCO_AGE) +AC_SUBST(LOCO_CURRENT_MINUS_AGE) AC_PREFIX_DEFAULT([/usr/local]) test "$prefix" = "NONE" && prefix=$ac_default_prefix @@ -205,6 +229,21 @@ else xcomposite_found=no fi +AC_MSG_CHECKING(for GL_CFLAGS) +AC_ARG_WITH(gl-cflags, [ --with-gl-cflags=CFLAGS ], + [GL_CFLAGS="$withval"], + [GL_CFLAGS=""]) + +AC_MSG_RESULT($GL_CFLAGS) +AC_MSG_CHECKING(for GL_LIBS) +AC_ARG_WITH(gl-libs, [ --with-gl-libs=LIBS ], + [GL_LIBS="$withval"], + [GL_LIBS="-lGL"]) +AC_MSG_RESULT($GL_LIBS) + +AC_SUBST(GL_CFLAGS) +AC_SUBST(GL_LIBS) + dnl Check for session management X11_SM @@ -225,6 +264,7 @@ AC_CONFIG_FILES([ po/Makefile.in render/obrender-4.0.pc obt/obt-4.0.pc + loco/loco-4.0.pc render/version.h obt/version.h ]) diff --git a/loco/loco-4.0.pc.in b/loco/loco-4.0.pc.in new file mode 100644 index 00000000..b3dedf58 --- /dev/null +++ b/loco/loco-4.0.pc.in @@ -0,0 +1,14 @@ +prefix=@prefix@ +exec_prefix=@exec_prefix@ +libdir=@libdir@ +includedir=@includedir@ + +glcflags=@GL_CFLAGS@ +gllibs=@GL_LIBS@ + +Name: lOco +Description: Openbox Composite Library +Version: @VERSION@ +Requires: glib-2.0 +Libs: -L${libdir} ${gllibs} +Cflags: -I${includedir}/openbox/@OB_VERSION@ ${glcflags} diff --git a/loco/loco.c b/loco/loco.c new file mode 100644 index 00000000..baed45fc --- /dev/null +++ b/loco/loco.c @@ -0,0 +1,29 @@ +/* -*- indent-tabs-mode: nil; tab-width: 4; c-basic-offset: 4; -*- + + loco.c for the Openbox window manager + Copyright (c) 2008 Derek Foreman + Copyright (c) 2008 Dana Jansens + + This program 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. + + This program 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. + + See the COPYING file for a copy of the GNU General Public License. +*/ + +#include "obt/mainloop.h" +#include + +void loco_set_mainloop(ObtMainLoop *loop) +{ +} + +void loco_shutdown(void) +{ +} diff --git a/loco/loco.h b/loco/loco.h new file mode 100644 index 00000000..5136f26a --- /dev/null +++ b/loco/loco.h @@ -0,0 +1,29 @@ +/* -*- indent-tabs-mode: nil; tab-width: 4; c-basic-offset: 4; -*- + + loco.c for the Openbox window manager + Copyright (c) 2008 Derek Foreman + Copyright (c) 2008 Dana Jansens + + This program 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. + + This program 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. + + See the COPYING file for a copy of the GNU General Public License. +*/ + +#ifndef loco__loco_h +#define loco__loco_h + +struct _ObtMainLoop; + +void loco_set_mainloop(struct _ObtMainLoop *loop); +void loco_shutdown(void); + + +#endif diff --git a/openbox/openbox.c b/openbox/openbox.c index 80f81594..3b53c246 100644 --- a/openbox/openbox.c +++ b/openbox/openbox.c @@ -48,6 +48,7 @@ #include "obt/prop.h" #include "obt/keyboard.h" #include "obt/parse.h" +#include "loco/loco.h" #ifdef HAVE_FCNTL_H # include @@ -199,6 +200,8 @@ gint main(gint argc, gchar **argv) XC_top_left_corner); if (screen_annex()) { /* it will be ours! */ + loco_set_mainloop(ob_main_loop); + do { if (reconfigure) obt_keyboard_reload(); @@ -363,6 +366,8 @@ gint main(gint argc, gchar **argv) config_shutdown(); actions_shutdown(reconfigure); } while (reconfigure); + + loco_shutdown(); } XSync(obt_display, FALSE); -- 2.39.2