>From 66dcbea59b5addc98ae7cfbaeeaf78432d8ec6af Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?"Rodolfo=20Garc=C3=ADa=20Pe=C3=B1as=20(kix)"?= <[email protected]>
Date: Mon, 25 Jun 2012 13:29:35 +0200
Subject: [PATCH 03/11] New colormap header file

The functions for colormap are moved from funcs.h to the new
file colormap.h. These files are included where needed.

The functions wColormapInstallRoot and wColormapUninstallRoot are
removed, because are not used.
---
 src/actions.c  |    2 +-
 src/client.c   |    2 +-
 src/colormap.c |   20 --------------------
 src/colormap.h |   27 +++++++++++++++++++++++++++
 src/event.c    |    1 +
 src/funcs.h    |    4 ----
 src/shutdown.c |    1 +
 src/window.c   |    1 +
 8 files changed, 32 insertions(+), 26 deletions(-)
 create mode 100644 src/colormap.h

diff --git a/src/actions.c b/src/actions.c
index ba395b6..302afd5 100644
--- a/src/actions.c
+++ b/src/actions.c
@@ -35,7 +35,7 @@
 #include "window.h"
 #include "client.h"
 #include "icon.h"
-#include "funcs.h"
+#include "colormap.h"
 #include "application.h"
 #include "actions.h"
 #include "stacking.h"
diff --git a/src/client.c b/src/client.c
index 93245e0..3287306 100644
--- a/src/client.c
+++ b/src/client.c
@@ -37,7 +37,7 @@
 #include "actions.h"
 #include "icon.h"
 #include "client.h"
-#include "funcs.h"
+#include "colormap.h"
 #include "stacking.h"
 #include "appicon.h"
 #include "appmenu.h"
diff --git a/src/colormap.c b/src/colormap.c
index a4f3af4..3a8906a 100644
--- a/src/colormap.c
+++ b/src/colormap.c
@@ -92,26 +92,6 @@ void wColormapInstallForWindow(WScreen * scr, WWindow * wwin)
        XSync(dpy, False);
 }
 
-void wColormapInstallRoot(WScreen * scr)
-{
-       if (scr->root_colormap_install_count == 0) {
-               wColormapInstallForWindow(scr, NULL);
-               scr->original_cmap_window = scr->cmap_window;
-       }
-       scr->root_colormap_install_count++;
-}
-
-void wColormapUninstallRoot(WScreen * scr)
-{
-       if (scr->root_colormap_install_count > 0)
-               scr->root_colormap_install_count--;
-
-       if (scr->root_colormap_install_count == 0) {
-               wColormapInstallForWindow(scr, scr->original_cmap_window);
-               scr->original_cmap_window = NULL;
-       }
-}
-
 void wColormapAllowClientInstallation(WScreen * scr, Bool starting)
 {
        scr->flags.colormap_stuff_blocked = starting;
diff --git a/src/colormap.h b/src/colormap.h
new file mode 100644
index 0000000..0236541
--- /dev/null
+++ b/src/colormap.h
@@ -0,0 +1,27 @@
+/*
+ *  Window Maker window manager
+ *
+ *  Copyright (c) 2000-2003 Alfredo K. Kojima
+ *
+ *  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 WMCOLORMAP_H
+#define WMCOLORMAP_H
+
+void wColormapInstallForWindow(WScreen *scr, WWindow *wwin);
+void wColormapAllowClientInstallation(WScreen * scr, Bool starting);
+
+#endif /* WMCOLORMAP_H */
diff --git a/src/event.c b/src/event.c
index 8e287d1..53d5acf 100644
--- a/src/event.c
+++ b/src/event.c
@@ -67,6 +67,7 @@
 #include "xinerama.h"
 #include "wmspec.h"
 #include "rootmenu.h"
+#include "colormap.h"
 
 /******** Global Variables **********/
 extern XContext wWinContext;
diff --git a/src/funcs.h b/src/funcs.h
index 65ceb4a..74927b9 100644
--- a/src/funcs.h
+++ b/src/funcs.h
@@ -41,10 +41,6 @@ void OpenWindowMenu2(WWindow *wwin, int x, int y, int 
keyboard);
 void OpenMiniwindowMenu(WWindow *wwin, int x, int y);
 void CloseWindowMenu(WScreen *scr);
 void DestroyWindowMenu(WScreen *scr);
-void wColormapInstallForWindow(WScreen *scr, WWindow *wwin);
-void wColormapInstallRoot(WScreen *scr);
-void wColormapUninstallRoot(WScreen *scr);
-void wColormapAllowClientInstallation(WScreen *scr, Bool starting);
 void PlaceIcon(WScreen *scr, int *x_ret, int *y_ret, int head);
 void StartWindozeCycle(WWindow *wwin, XEvent *event, Bool next, Bool 
class_only);
 void SendHelperMessage(WScreen *scr, char type, int workspace, char *msg);
diff --git a/src/shutdown.c b/src/shutdown.c
index 6d87306..d86bd0d 100644
--- a/src/shutdown.c
+++ b/src/shutdown.c
@@ -36,6 +36,7 @@
 #include "session.h"
 #include "winspector.h"
 #include "wmspec.h"
+#include "colormap.h"
 
 extern Atom _XA_WM_DELETE_WINDOW;
 extern Time LastTimestamp;
diff --git a/src/window.c b/src/window.c
index c7f41d0..9e44e34 100644
--- a/src/window.c
+++ b/src/window.c
@@ -50,6 +50,7 @@
 #include "actions.h"
 #include "client.h"
 #include "funcs.h"
+#include "colormap.h"
 #include "keybind.h"
 #include "stacking.h"
 #include "defaults.h"
-- 
1.7.10

-- 
||// //\\// Rodolfo "kix" Garcia
||\\// //\\ http://www.kix.es/
>From 66dcbea59b5addc98ae7cfbaeeaf78432d8ec6af Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?"Rodolfo=20Garc=C3=ADa=20Pe=C3=B1as=20(kix)"?= <[email protected]>
Date: Mon, 25 Jun 2012 13:29:35 +0200
Subject: [PATCH 03/11] New colormap header file

The functions for colormap are moved from funcs.h to the new
file colormap.h. These files are included where needed.

The functions wColormapInstallRoot and wColormapUninstallRoot are
removed, because are not used.
---
 src/actions.c  |    2 +-
 src/client.c   |    2 +-
 src/colormap.c |   20 --------------------
 src/colormap.h |   27 +++++++++++++++++++++++++++
 src/event.c    |    1 +
 src/funcs.h    |    4 ----
 src/shutdown.c |    1 +
 src/window.c   |    1 +
 8 files changed, 32 insertions(+), 26 deletions(-)
 create mode 100644 src/colormap.h

diff --git a/src/actions.c b/src/actions.c
index ba395b6..302afd5 100644
--- a/src/actions.c
+++ b/src/actions.c
@@ -35,7 +35,7 @@
 #include "window.h"
 #include "client.h"
 #include "icon.h"
-#include "funcs.h"
+#include "colormap.h"
 #include "application.h"
 #include "actions.h"
 #include "stacking.h"
diff --git a/src/client.c b/src/client.c
index 93245e0..3287306 100644
--- a/src/client.c
+++ b/src/client.c
@@ -37,7 +37,7 @@
 #include "actions.h"
 #include "icon.h"
 #include "client.h"
-#include "funcs.h"
+#include "colormap.h"
 #include "stacking.h"
 #include "appicon.h"
 #include "appmenu.h"
diff --git a/src/colormap.c b/src/colormap.c
index a4f3af4..3a8906a 100644
--- a/src/colormap.c
+++ b/src/colormap.c
@@ -92,26 +92,6 @@ void wColormapInstallForWindow(WScreen * scr, WWindow * wwin)
 	XSync(dpy, False);
 }
 
-void wColormapInstallRoot(WScreen * scr)
-{
-	if (scr->root_colormap_install_count == 0) {
-		wColormapInstallForWindow(scr, NULL);
-		scr->original_cmap_window = scr->cmap_window;
-	}
-	scr->root_colormap_install_count++;
-}
-
-void wColormapUninstallRoot(WScreen * scr)
-{
-	if (scr->root_colormap_install_count > 0)
-		scr->root_colormap_install_count--;
-
-	if (scr->root_colormap_install_count == 0) {
-		wColormapInstallForWindow(scr, scr->original_cmap_window);
-		scr->original_cmap_window = NULL;
-	}
-}
-
 void wColormapAllowClientInstallation(WScreen * scr, Bool starting)
 {
 	scr->flags.colormap_stuff_blocked = starting;
diff --git a/src/colormap.h b/src/colormap.h
new file mode 100644
index 0000000..0236541
--- /dev/null
+++ b/src/colormap.h
@@ -0,0 +1,27 @@
+/*
+ *  Window Maker window manager
+ *
+ *  Copyright (c) 2000-2003 Alfredo K. Kojima
+ *
+ *  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 WMCOLORMAP_H
+#define WMCOLORMAP_H
+
+void wColormapInstallForWindow(WScreen *scr, WWindow *wwin);
+void wColormapAllowClientInstallation(WScreen * scr, Bool starting);
+
+#endif /* WMCOLORMAP_H */
diff --git a/src/event.c b/src/event.c
index 8e287d1..53d5acf 100644
--- a/src/event.c
+++ b/src/event.c
@@ -67,6 +67,7 @@
 #include "xinerama.h"
 #include "wmspec.h"
 #include "rootmenu.h"
+#include "colormap.h"
 
 /******** Global Variables **********/
 extern XContext wWinContext;
diff --git a/src/funcs.h b/src/funcs.h
index 65ceb4a..74927b9 100644
--- a/src/funcs.h
+++ b/src/funcs.h
@@ -41,10 +41,6 @@ void OpenWindowMenu2(WWindow *wwin, int x, int y, int keyboard);
 void OpenMiniwindowMenu(WWindow *wwin, int x, int y);
 void CloseWindowMenu(WScreen *scr);
 void DestroyWindowMenu(WScreen *scr);
-void wColormapInstallForWindow(WScreen *scr, WWindow *wwin);
-void wColormapInstallRoot(WScreen *scr);
-void wColormapUninstallRoot(WScreen *scr);
-void wColormapAllowClientInstallation(WScreen *scr, Bool starting);
 void PlaceIcon(WScreen *scr, int *x_ret, int *y_ret, int head);
 void StartWindozeCycle(WWindow *wwin, XEvent *event, Bool next, Bool class_only);
 void SendHelperMessage(WScreen *scr, char type, int workspace, char *msg);
diff --git a/src/shutdown.c b/src/shutdown.c
index 6d87306..d86bd0d 100644
--- a/src/shutdown.c
+++ b/src/shutdown.c
@@ -36,6 +36,7 @@
 #include "session.h"
 #include "winspector.h"
 #include "wmspec.h"
+#include "colormap.h"
 
 extern Atom _XA_WM_DELETE_WINDOW;
 extern Time LastTimestamp;
diff --git a/src/window.c b/src/window.c
index c7f41d0..9e44e34 100644
--- a/src/window.c
+++ b/src/window.c
@@ -50,6 +50,7 @@
 #include "actions.h"
 #include "client.h"
 #include "funcs.h"
+#include "colormap.h"
 #include "keybind.h"
 #include "stacking.h"
 #include "defaults.h"
-- 
1.7.10

Reply via email to