[beryl-commits] r1553 - in trunk/aquamarine: . src

onestone at server.beryl-project.org onestone at server.beryl-project.org
Tue Dec 5 20:23:11 CET 2006


Author: onestone
Date: 2006-12-05 20:22:19 +0100 (Tue, 05 Dec 2006)
New Revision: 1553

Added:
   trunk/aquamarine/src/integration.cpp
   trunk/aquamarine/src/integration.h
Modified:
   trunk/aquamarine/configure.in.in
   trunk/aquamarine/src/Makefile.am
   trunk/aquamarine/src/aquamarine.cpp
   trunk/aquamarine/src/decorator.cpp
   trunk/aquamarine/src/decorator.h
Log:
aquamarine: Added KDE->Beryl integration

Modified: trunk/aquamarine/configure.in.in
===================================================================
--- trunk/aquamarine/configure.in.in	2006-12-05 17:42:09 UTC (rev 1552)
+++ trunk/aquamarine/configure.in.in	2006-12-05 19:22:19 UTC (rev 1553)
@@ -11,4 +11,20 @@
  AC_MSG_ERROR([Unable to find KDecoration. Make sure you have the kdebase development package installed.]))
 ])
 
+BERYL_SETTINGS_REQUIRES="\
+		    gtk+-2.0 >= 2.8.0 \
+            berylsettings \
+            beryl"
+
+AC_ARG_ENABLE(berylsettings, AC_HELP_STRING([--disable-berylsettings], [disable beryl settings]), [berylsettings="${enableval}"], [berylsettings="yes"])
+AM_CONDITIONAL(include_bs, test "$berylsettings" = "yes")
+
+if test "$berylsettings" = "yes"; then
+  KDE_PKG_CHECK_MODULES(BERYLSETTINGS, $BERYL_SETTINGS_REQUIRES,
+    AC_DEFINE(HAVE_BERYL_SETTINGS,1,[check for berylsettings]),
+      AC_MSG_WARN([berylsettings not found.]))
+  AC_SUBST(BERYLSETTINGS_LIBS)
+  AC_SUBST(BERYLSETTINGS_CFLAGS)
+fi
+
 AQUAMARINE_CHECK_KDECORATION

Modified: trunk/aquamarine/src/Makefile.am
===================================================================
--- trunk/aquamarine/src/Makefile.am	2006-12-05 17:42:09 UTC (rev 1552)
+++ trunk/aquamarine/src/Makefile.am	2006-12-05 19:22:19 UTC (rev 1553)
@@ -8,10 +8,12 @@
 	window.cpp \
 	switcher.cpp \
 	KWinInterface.skel \
-	options.cpp
+	options.cpp \
+	integration.cpp
 
-aquamarine_LDADD = $(LIB_KDECORE) -lkdecorations
-aquamarine_LDFLAGS = $(all_libraries) 
+aquamarine_LDADD = $(LIB_KDECORE) -lkdecorations $(BERYLSETTINGS_LIBS)
+aquamarine_LDFLAGS = $(all_libraries)
+KDE_CXXFLAGS = $(BERYLSETTINGS_CFLAGS)
 
 METASOURCES = AUTO
 

Modified: trunk/aquamarine/src/aquamarine.cpp
===================================================================
--- trunk/aquamarine/src/aquamarine.cpp	2006-12-05 17:42:09 UTC (rev 1552)
+++ trunk/aquamarine/src/aquamarine.cpp	2006-12-05 19:22:19 UTC (rev 1553)
@@ -49,6 +49,9 @@
 static const KCmdLineOptions options[] = {
     {"replace", "Replace existing window decorator", 0},
     {"deco <deco>", "Decoration", 0},
+#ifdef HAVE_BERYL_SETTINGS
+	{"integration", "Integrate KDE settings into Beryl", 0},
+#endif
     KCmdLineLastOption
 };
 

Modified: trunk/aquamarine/src/decorator.cpp
===================================================================
--- trunk/aquamarine/src/decorator.cpp	2006-12-05 17:42:09 UTC (rev 1552)
+++ trunk/aquamarine/src/decorator.cpp	2006-12-05 19:22:19 UTC (rev 1553)
@@ -40,6 +40,7 @@
 #include "decorator.h"
 #include "options.h"
 #include "utils.h"
+#include "integration.h"
 
 #include <stdio.h>
 
@@ -124,6 +125,17 @@
     m_config = new KConfig ("kwinrc");
     m_config->setGroup ("Style");
 
+#ifdef HAVE_BERYL_SETTINGS
+	m_integrate = args->isSet ("integration");
+	printf("Integration : %s\n",m_integrate? "Enabled" : "Disabled");
+	if (m_integrate)
+	{
+		m_integration = new Aquamarine::Integration ();
+	}
+#endif
+	connect (this, SIGNAL (settingsChanged (int)),
+             SLOT (slotSettingsChanged (int)));
+
     QString
         decoName;
     if (args->isSet ("deco"))
@@ -450,6 +462,11 @@
     unsigned long
         changed = m_options->updateSettings ();
 
+#ifdef HAVE_BERYL_SETTINGS
+	if (m_integrate)
+		m_integration->updateSettings();
+#endif
+
     if (m_plugins->reset (changed))
     {
         for (QMap < WId, Aquamarine::Window * >::ConstIterator it =
@@ -462,6 +479,16 @@
 }
 
 void
+Aquamarine::Decorator::slotSettingsChanged (int)
+{
+	kdDebug () << k_funcinfo << endl;
+#ifdef HAVE_BERYL_SETTINGS
+	if (m_integrate)
+		m_integration->updateSettings();
+#endif
+}
+
+void
 Aquamarine::Decorator::slotWindowAdded (WId id)
 {
     kdDebug () << k_funcinfo << endl;

Modified: trunk/aquamarine/src/decorator.h
===================================================================
--- trunk/aquamarine/src/decorator.h	2006-12-05 17:42:09 UTC (rev 1552)
+++ trunk/aquamarine/src/decorator.h	2006-12-05 19:22:19 UTC (rev 1553)
@@ -28,6 +28,10 @@
 #ifndef AQUAMARINE_DECORATOR_H
 #define AQUAMARINE_DECORATOR_H
 
+#ifdef HAVE_CONFIG_H
+#  include "../config.h"
+#endif
+
 #include <kapplication.h>
 
 #include <X11/Xlib.h>
@@ -55,6 +59,8 @@
 class KConfig;
 class KWinModule;
 
+
+
 static const long defaultMask = StructureNotifyMask | PropertyChangeMask;
 
 namespace Aquamarine
@@ -63,6 +69,10 @@
     class Options;
     class Switcher;
 
+#ifdef HAVE_BERYL_SETTINGS
+	class Integration;
+#endif
+
     class PluginManager:public KDecorationPlugins
     {
       public:
@@ -124,6 +134,7 @@
         void slotWindowRemoved (WId id);
         void slotActiveWindowChanged (WId id);
         void slotWindowChanged (WId id, const unsigned long *properties);
+		void slotSettingsChanged (int category);
 
       private:
 
@@ -151,6 +162,11 @@
 
         WId m_activeWM;
         bool m_restart;
+
+#ifdef HAVE_BERYL_SETTINGS
+		bool m_integrate;
+		Aquamarine::Integration * m_integration;
+#endif
     };
 
 }

Added: trunk/aquamarine/src/integration.cpp
===================================================================
--- trunk/aquamarine/src/integration.cpp	                        (rev 0)
+++ trunk/aquamarine/src/integration.cpp	2006-12-05 19:22:19 UTC (rev 1553)
@@ -0,0 +1,338 @@
+/*
+ *  Aquamarine the KDE window decorator
+ *
+ *  Copyright (c) 2006 Dennis Kasprzyk <onestone at beryl-project.org>
+ *  Copyright (c) 2006 Volker Krause <vkrause at kde.org>
+ *
+ *  Uses code of:
+ *      Emerald window decorator (www.beryl-project.org)
+ *      gtk-window-decorator (www.freedesktop.org/wiki/Software/Compiz)
+ *      KWin window manager (www.kde.org)
+ *
+ *  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.
+ *
+ *  You should have received a copy of the GNU General Public License
+ *  along with this program; if not, write to the Free Software
+ *  Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
+ *
+ */
+
+#ifdef HAVE_CONFIG_H
+#  include "../config.h"
+#endif
+
+#ifdef HAVE_BERYL_SETTINGS
+
+#include <kconfig.h>
+#include <kshortcut.h>
+#include <kdebug.h>
+
+#include "integration.h"
+
+Aquamarine::Integration::Integration ()
+{
+    updateSettings ();
+}
+
+void
+Aquamarine::Integration::updateSettings ()
+{
+	KConfig *gc = new KConfig("kdeglobals",false,false);
+	KConfig *kwc = new KConfig("kwinrc",false);
+	gc->setGroup("Global Shortcuts");
+	kwc->setGroup("Windows");
+
+	BerylSettingsContext *settings = beryl_settings_context_new();
+	beryl_settings_context_read(settings);
+
+	BerylSettingsPlugin *core,*move,*resize,*rotate,*plane,*switcher;
+	core = beryl_settings_context_find_plugin(settings, NULL);
+	move = beryl_settings_context_find_plugin(settings, "move");
+	resize = beryl_settings_context_find_plugin(settings, "resize");
+	rotate = beryl_settings_context_find_plugin(settings, "rotate");
+	plane = beryl_settings_context_find_plugin(settings, "plane");
+	switcher = beryl_settings_context_find_plugin(settings, "switcher");
+
+	bool changed = false;
+
+	// core
+	changed |= KdeKeyToBeryl(gc->readEntry("Window Close"), core, "close_window");
+	changed |= KdeKeyToBeryl(gc->readEntry("Run Command"), core, "run");
+	changed |= KdeKeyToBeryl(gc->readEntry("Popup Launch Menu"), core, "main_menu");
+	changed |= KdeKeyToBeryl(gc->readEntry("Window Lower"), core, "lower_window");
+	changed |= KdeKeyToBeryl(gc->readEntry("Window Maximize"), core, "toggle_window_maximized");
+	changed |= KdeKeyToBeryl(gc->readEntry("Window Minimize"), core, "minimize_window");
+	changed |= KdeKeyToBeryl(gc->readEntry("Window Maximize Horizontal"), core, "toggle_maximize_window_horizontally");
+	changed |= KdeKeyToBeryl(gc->readEntry("Window Maximize Vertical"), core, "toggle_maximize_window_vertically");
+	changed |= KdeKeyToBeryl(gc->readEntry("Toggle Showing Desktop"), core, "show_desktop");
+	changed |= KdeKeyToBeryl(gc->readEntry("Desktop Screenshot"), core, "run_command_screenshot");
+	changed |= KdeStrToBeryl("ksnapshot", core, "command_screenshot");
+	changed |= KdeKeyToBeryl(gc->readEntry("Window Screenshot"), core, "run_command_window_screenshot");
+	changed |= KdeStrToBeryl("ksnapshot -c", core, "command_window_screenshot");
+	changed |= KdeKeyToBeryl(gc->readEntry("Window Operations Menu"), core, "window_menu");
+	changed |= KdeKeyToBeryl(gc->readEntry("Window Shade"), core, "toggle_window_shaded");
+	changed |= KdeKeyToBeryl(gc->readEntry("Window Raise"), core, "raise_window");
+	changed |= KdeKeyToBeryl(gc->readEntry("Window Fullscreen"), core, "toggle_window_fullscreen");
+
+	changed |= KdeKeyToBeryl("none", core, "unmaximize_window");
+	changed |= KdeKeyToBeryl("none", core, "maximize_window");
+	changed |= KdeKeyToBeryl("none", core, "maximize_window_horizontally");
+	changed |= KdeKeyToBeryl("none", core, "maximize_window_vertically");
+
+	changed |= KdeStrToBeryl("xkill", core, "command0");
+	changed |= KdeKeyToBeryl(gc->readEntry("Kill Window"), core, "run_command0");
+
+	changed |= KdeBoolToBeryl(kwc->readBoolEntry("AutoRaise"), core, "autoraise");
+	changed |= KdeIntToBeryl(kwc->readNumEntry("AutoRaiseInterval"), core, "autoraise_delay");
+	changed |= KdeBoolToBeryl(kwc->readBoolEntry("ClickRaise"), core, "raise_on_click");
+	changed |= KdeBoolToBeryl(kwc->readEntry("FocusPolicy") == "ClickToFocus", core, "click_to_focus");
+
+	switch (kwc->readNumEntry("FocusStealingPreventionLevel"))
+	{
+		case 1:
+			changed |= KdeStrToBeryl("Low", core, "focus_stealing_prevention_level");
+			break;
+		case 2:
+			changed |= KdeStrToBeryl("Normal", core, "focus_stealing_prevention_level");
+			break;
+		case 3:
+			changed |= KdeStrToBeryl("High", core, "focus_stealing_prevention_level");
+			break;
+		case 4:
+			changed |= KdeStrToBeryl("Extreme", core, "focus_stealing_prevention_level");
+			break;
+		default:
+			changed |= KdeStrToBeryl("None", core, "focus_stealing_prevention_level");
+			break;
+	}
+
+	kwc->setGroup("Desktops");
+	changed |= KdeIntToBeryl(kwc->readNumEntry("Number"), core, "number_of_desktops");
+	kwc->setGroup("Windows");
+
+	// move
+	changed |= KdeBoolToBeryl(kwc->readBoolEntry("MoveResizeMaximizedWindows"), move, "snapoff_maximized");
+	changed |= KdeKeyToBeryl(gc->readEntry("Window Move"), move, "initiate");
+
+	// resize
+	if (kwc->readEntry("ResizeMode") == "Opaque")
+		changed |= KdeStrToBeryl("Normal", resize, "resize_mode");
+	else if (kwc->readEntry("ResizeMode") == "Transparent")
+		changed |= KdeStrToBeryl("Outline", resize, "resize_mode");
+	changed |= KdeKeyToBeryl(gc->readEntry("Window Resize"), resize, "initiate");
+
+	// rotate
+	changed |= KdeKeyToBeryl(gc->readEntry("Switch to Next Desktop"), rotate, "rotate_right");
+	changed |= KdeKeyToBeryl(gc->readEntry("Switch to Previous Desktop"), rotate, "rotate_left");
+	changed |= KdeKeyToBeryl(gc->readEntry("Switch to Desktop 1"), rotate, "rotate_to_1");
+	changed |= KdeKeyToBeryl(gc->readEntry("Switch to Desktop 2"), rotate, "rotate_to_2");
+	changed |= KdeKeyToBeryl(gc->readEntry("Switch to Desktop 3"), rotate, "rotate_to_3");
+	changed |= KdeKeyToBeryl(gc->readEntry("Switch to Desktop 4"), rotate, "rotate_to_4");
+	changed |= KdeKeyToBeryl(gc->readEntry("Switch to Desktop 5"), rotate, "rotate_to_5");
+	changed |= KdeKeyToBeryl(gc->readEntry("Switch to Desktop 6"), rotate, "rotate_to_6");
+	changed |= KdeKeyToBeryl(gc->readEntry("Switch to Desktop 7"), rotate, "rotate_to_7");
+	changed |= KdeKeyToBeryl(gc->readEntry("Switch to Desktop 8"), rotate, "rotate_to_8");
+	changed |= KdeKeyToBeryl(gc->readEntry("Switch to Desktop 9"), rotate, "rotate_to_9");
+	changed |= KdeKeyToBeryl(gc->readEntry("Switch to Desktop 10"), rotate, "rotate_to_10");
+	changed |= KdeKeyToBeryl(gc->readEntry("Switch to Desktop 11"), rotate, "rotate_to_11");
+	changed |= KdeKeyToBeryl(gc->readEntry("Switch to Desktop 12"), rotate, "rotate_to_12");
+
+	changed |= KdeKeyToBeryl(gc->readEntry("Window to Next Desktop"), rotate, "rotate_right_window");
+	changed |= KdeKeyToBeryl(gc->readEntry("Window to Previous Desktop"), rotate, "rotate_left_window");
+	changed |= KdeKeyToBeryl(gc->readEntry("Window to Desktop 1"), rotate, "rotate_to_1_window");
+	changed |= KdeKeyToBeryl(gc->readEntry("Window to Desktop 2"), rotate, "rotate_to_2_window");
+	changed |= KdeKeyToBeryl(gc->readEntry("Window to Desktop 3"), rotate, "rotate_to_3_window");
+	changed |= KdeKeyToBeryl(gc->readEntry("Window to Desktop 4"), rotate, "rotate_to_4_window");
+	changed |= KdeKeyToBeryl(gc->readEntry("Window to Desktop 5"), rotate, "rotate_to_5_window");
+	changed |= KdeKeyToBeryl(gc->readEntry("Window to Desktop 6"), rotate, "rotate_to_6_window");
+	changed |= KdeKeyToBeryl(gc->readEntry("Window to Desktop 7"), rotate, "rotate_to_7_window");
+	changed |= KdeKeyToBeryl(gc->readEntry("Window to Desktop 8"), rotate, "rotate_to_8_window");
+	changed |= KdeKeyToBeryl(gc->readEntry("Window to Desktop 9"), rotate, "rotate_to_9_window");
+	changed |= KdeKeyToBeryl(gc->readEntry("Window to Desktop 10"), rotate, "rotate_to_10_window");
+	changed |= KdeKeyToBeryl(gc->readEntry("Window to Desktop 11"), rotate, "rotate_to_11_window");
+	changed |= KdeKeyToBeryl(gc->readEntry("Window to Desktop 12"), rotate, "rotate_to_12_window");
+
+	// plane
+	changed |= KdeKeyToBeryl(gc->readEntry("Switch One Desktop Up"), rotate, "plane_up");
+	changed |= KdeKeyToBeryl(gc->readEntry("Switch One Desktop Down"), rotate, "plane_down");
+	changed |= KdeKeyToBeryl(gc->readEntry("Switch One Desktop to the Left"), rotate, "plane_left");
+	changed |= KdeKeyToBeryl(gc->readEntry("Switch One Desktop to the Right"), rotate, "plane_right");
+	changed |= KdeKeyToBeryl(gc->readEntry("Switch to Desktop 1"), rotate, "plane_to_1");
+	changed |= KdeKeyToBeryl(gc->readEntry("Switch to Desktop 2"), rotate, "plane_to_2");
+	changed |= KdeKeyToBeryl(gc->readEntry("Switch to Desktop 3"), rotate, "plane_to_3");
+	changed |= KdeKeyToBeryl(gc->readEntry("Switch to Desktop 4"), rotate, "plane_to_4");
+	changed |= KdeKeyToBeryl(gc->readEntry("Switch to Desktop 5"), rotate, "plane_to_5");
+	changed |= KdeKeyToBeryl(gc->readEntry("Switch to Desktop 6"), rotate, "plane_to_6");
+	changed |= KdeKeyToBeryl(gc->readEntry("Switch to Desktop 7"), rotate, "plane_to_7");
+	changed |= KdeKeyToBeryl(gc->readEntry("Switch to Desktop 8"), rotate, "plane_to_8");
+	changed |= KdeKeyToBeryl(gc->readEntry("Switch to Desktop 9"), rotate, "plane_to_9");
+	changed |= KdeKeyToBeryl(gc->readEntry("Switch to Desktop 10"), rotate, "plane_to_10");
+	changed |= KdeKeyToBeryl(gc->readEntry("Switch to Desktop 11"), rotate, "plane_to_11");
+	changed |= KdeKeyToBeryl(gc->readEntry("Switch to Desktop 12"), rotate, "plane_to_12");
+
+	// switcher
+	changed |= KdeKeyToBeryl(gc->readEntry("Walk Through Windows"), switcher, "next");
+	changed |= KdeKeyToBeryl(gc->readEntry("Walk Through Windows (Reverse)"), switcher, "prev");
+
+	if (changed)
+	{
+		beryl_settings_context_write(settings);
+		beryl_settings_send_reload_signal();
+	}
+
+	beryl_settings_context_destroy(settings);
+	delete gc;
+	delete kwc;
+}
+
+bool Aquamarine::Integration::KdeKeyToBeryl (QString keyString, BerylSettingsPlugin * plugin, char * beryl_name)
+{
+	if (!plugin)
+		return false;
+
+	BerylSetting *setting;
+
+	KKey key(keyString);
+
+	setting = beryl_settings_plugin_find_setting(plugin, beryl_name, FALSE);
+	if (!setting)
+		return false;
+
+	gint keysym;
+	gint keymod;
+	gboolean enabled;
+	beryl_setting_value_get_keysym(&setting->value,&keysym);
+	beryl_setting_value_get_keymods(&setting->value,&keymod);
+	beryl_setting_value_get_key_enabled(&setting->value,&enabled);
+
+	gboolean kde_enabled = !key.isNull();
+	int kde_keysym = key.sym();
+	int kde_keymod = 0;
+
+	if (key.modFlags() & KKey::SHIFT)
+		kde_keymod |= ShiftMask;
+	if (key.modFlags() & KKey::CTRL)
+		kde_keymod |= ControlMask;
+	if (key.modFlags() & KKey::ALT)
+		kde_keymod |= CompAltMask;
+	if (key.modFlags() & KKey::WIN)
+		kde_keymod |= CompSuperMask;
+
+	if (keysym != kde_keysym || keymod != kde_keymod || enabled != kde_enabled)
+	{
+		kdDebug () << "Changing keybinding for \"" << beryl_name << "\" to \""
+				<< key.toString() << "\"" << endl;
+		beryl_setting_value_set_keysym(&setting->value,&kde_keysym);
+		beryl_setting_value_set_keymods(&setting->value,&kde_keymod);
+		beryl_setting_value_set_key_enabled(&setting->value,&kde_enabled);
+		return true;
+	}
+	else
+	{
+		kdDebug () << "Keybinding \"" << key.toString() << "\" for \"" << beryl_name
+				<< "\" is already set in Beryl" << endl;
+		return false;
+	}
+}
+
+bool Aquamarine::Integration::KdeStrToBeryl (QString val, BerylSettingsPlugin * plugin, char * beryl_name)
+{
+	if (!plugin)
+		return false;
+
+	BerylSetting *setting;
+
+	setting = beryl_settings_plugin_find_setting(plugin, beryl_name, FALSE);
+	if (!setting)
+		return false;
+
+	const gchar *bstr;
+	beryl_setting_value_get_string(&setting->value,&bstr);
+
+	QString berylStr(bstr);
+
+	if (berylStr != val)
+	{
+		kdDebug () << "Changing string value for \"" << beryl_name << "\" to \""
+				<< val << "\"" << endl;
+		const gchar *to = val.ascii();
+		beryl_setting_value_set_string(&setting->value,&to);
+		return true;
+	}
+	else
+	{
+		kdDebug () << "String value \"" << val << "\" for \"" << beryl_name
+				<< "\" is already set in Beryl" << endl;
+		return false;
+	}
+}
+
+bool Aquamarine::Integration::KdeBoolToBeryl (bool val, BerylSettingsPlugin * plugin, char * beryl_name)
+{
+	if (!plugin)
+		return false;
+
+	BerylSetting *setting;
+
+	setting = beryl_settings_plugin_find_setting(plugin, beryl_name, FALSE);
+	if (!setting)
+		return false;
+
+	gboolean bbool;
+	beryl_setting_value_get_bool(&setting->value,&bbool);
+
+	gboolean berylBool = val;
+
+	if (berylBool != bbool)
+	{
+		kdDebug () << "Changing bool value for \"" << beryl_name << "\" to \""
+				<< val << "\"" << endl;
+		beryl_setting_value_set_bool(&setting->value,&berylBool);
+		return true;
+	}
+	else
+	{
+		kdDebug () << "Bool value \"" << val << "\" for \"" << beryl_name
+				<< "\" is already set in Beryl" << endl;
+		return false;
+	}
+}
+
+bool Aquamarine::Integration::KdeIntToBeryl (int val, BerylSettingsPlugin * plugin, char * beryl_name)
+{
+	if (!plugin)
+		return false;
+
+	BerylSetting *setting;
+
+	setting = beryl_settings_plugin_find_setting(plugin, beryl_name, FALSE);
+	if (!setting)
+		return false;
+
+	gint bint;
+	beryl_setting_value_get_bool(&setting->value,&bint);
+
+	if (bint != val)
+	{
+		kdDebug () << "Changing int value for \"" << beryl_name << "\" to \""
+				<< val << "\"" << endl;
+		beryl_setting_value_set_int(&setting->value,&val);
+		return true;
+	}
+	else
+	{
+		kdDebug () << "Int value \"" << val << "\" for \"" << beryl_name
+				<< "\" is already set in Beryl" << endl;
+		return false;
+	}
+}
+
+#endif

Added: trunk/aquamarine/src/integration.h
===================================================================
--- trunk/aquamarine/src/integration.h	                        (rev 0)
+++ trunk/aquamarine/src/integration.h	2006-12-05 19:22:19 UTC (rev 1553)
@@ -0,0 +1,67 @@
+/*
+ *  Aquamarine the KDE window decorator
+ *
+ *  Copyright (c) 2006 Dennis Kasprzyk <onestone at beryl-project.org>
+ *  Copyright (c) 2006 Volker Krause <vkrause at kde.org>
+ *
+ *  Uses code of:
+ *      Emerald window decorator (www.beryl-project.org)
+ *      gtk-window-decorator (www.freedesktop.org/wiki/Software/Compiz)
+ *      KWin window manager (www.kde.org)
+ *
+ *  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.
+ *
+ *  You should have received a copy of the GNU General Public License
+ *  along with this program; if not, write to the Free Software
+ *  Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
+ *
+ */
+
+
+
+#ifndef AQUAMARINE_INTEGRATION_H
+#define AQUAMARINE_INTEGRATION_H
+
+#ifdef HAVE_CONFIG_H
+#  include "../config.h"
+#endif
+
+#ifdef HAVE_BERYL_SETTINGS
+
+extern "C" {
+#include <beryl-settings.h>
+}
+
+class KConfig;
+
+namespace Aquamarine
+{
+
+    class Integration
+    {
+      public:
+
+		Integration ();
+
+        void updateSettings ();
+
+	  private:
+
+		bool KdeKeyToBeryl (QString keyString, BerylSettingsPlugin * plugin, char * beryl_name);
+		bool KdeStrToBeryl (QString val, BerylSettingsPlugin * plugin, char * beryl_name);
+		bool KdeBoolToBeryl (bool val, BerylSettingsPlugin * plugin, char * beryl_name);
+		bool KdeIntToBeryl (int val, BerylSettingsPlugin * plugin, char * beryl_name);
+    };
+
+}
+
+#endif
+#endif




More information about the commits mailing list