summaryrefslogtreecommitdiff
Unidiff
Diffstat (more/less context) (ignore whitespace changes)
-rw-r--r--x11-plugins/fvwmkb/Manifest11
-rw-r--r--x11-plugins/fvwmkb/files/digest-fvwmkb-0.3.2-r23
-rw-r--r--x11-plugins/fvwmkb/files/fvwmkb-0.3.2-r2.patch341
-rw-r--r--x11-plugins/fvwmkb/fvwmkb-0.3.2-r2.ebuild44
4 files changed, 399 insertions, 0 deletions
diff --git a/x11-plugins/fvwmkb/Manifest b/x11-plugins/fvwmkb/Manifest
index e26912b..a14c7a7 100644
--- a/x11-plugins/fvwmkb/Manifest
+++ b/x11-plugins/fvwmkb/Manifest
@@ -1,12 +1,23 @@
1AUX fvwmkb-0.3.2-r1.patch 8445 RMD160 b2b84ec464d8120ed58f00e2da7cb25729bff7d5 SHA1 6b63cc8d793486092faa99a7dce77684c4dda981 SHA256 4fee3e987cd93188f7e77ad525469f6e8d584e20c8f48b6b4cd0815df6796e30 1AUX fvwmkb-0.3.2-r1.patch 8445 RMD160 b2b84ec464d8120ed58f00e2da7cb25729bff7d5 SHA1 6b63cc8d793486092faa99a7dce77684c4dda981 SHA256 4fee3e987cd93188f7e77ad525469f6e8d584e20c8f48b6b4cd0815df6796e30
2MD5 a994284c429aff529dc4b572749a9625 files/fvwmkb-0.3.2-r1.patch 8445 2MD5 a994284c429aff529dc4b572749a9625 files/fvwmkb-0.3.2-r1.patch 8445
3RMD160 b2b84ec464d8120ed58f00e2da7cb25729bff7d5 files/fvwmkb-0.3.2-r1.patch 8445 3RMD160 b2b84ec464d8120ed58f00e2da7cb25729bff7d5 files/fvwmkb-0.3.2-r1.patch 8445
4SHA256 4fee3e987cd93188f7e77ad525469f6e8d584e20c8f48b6b4cd0815df6796e30 files/fvwmkb-0.3.2-r1.patch 8445 4SHA256 4fee3e987cd93188f7e77ad525469f6e8d584e20c8f48b6b4cd0815df6796e30 files/fvwmkb-0.3.2-r1.patch 8445
5AUX fvwmkb-0.3.2-r2.patch 8967 RMD160 b82ea16c59639a9f239bb755a6070ea779091794 SHA1 e5f356a5f4318dba311aaaad30e15f03f94ef307 SHA256 d3e146fcf2649a0eda98044005b6eab62477977034e2ad4de623c65804d4324f
6MD5 07fe60335403fadf04b85bdf416b7d8e files/fvwmkb-0.3.2-r2.patch 8967
7RMD160 b82ea16c59639a9f239bb755a6070ea779091794 files/fvwmkb-0.3.2-r2.patch 8967
8SHA256 d3e146fcf2649a0eda98044005b6eab62477977034e2ad4de623c65804d4324f files/fvwmkb-0.3.2-r2.patch 8967
5DIST FvwmKb-0.3.2.tar.gz 54131 RMD160 299ec96313f97502f955fdd618a6aecd02b554fc SHA1 7c1b9e81db40bc3142b532d3c83e7f2c2fd84173 SHA256 ef3f59aaf48f0bd1263f6d34a21ddf0d340b537adc7b720ac68bb56e15b573ff 9DIST FvwmKb-0.3.2.tar.gz 54131 RMD160 299ec96313f97502f955fdd618a6aecd02b554fc SHA1 7c1b9e81db40bc3142b532d3c83e7f2c2fd84173 SHA256 ef3f59aaf48f0bd1263f6d34a21ddf0d340b537adc7b720ac68bb56e15b573ff
6EBUILD fvwmkb-0.3.2-r1.ebuild 992 RMD160 e4bd734cda8f19667e658070f9facf52550c8389 SHA1 66a216b44583db73086cdcaaa3923fe092e5e483 SHA256 68ed1267bd6a35e8220a78dce8ccd4923fb73f49dc79a836f385a4860d32c347 10EBUILD fvwmkb-0.3.2-r1.ebuild 992 RMD160 e4bd734cda8f19667e658070f9facf52550c8389 SHA1 66a216b44583db73086cdcaaa3923fe092e5e483 SHA256 68ed1267bd6a35e8220a78dce8ccd4923fb73f49dc79a836f385a4860d32c347
7MD5 e4ec45ca8ca2f3cc9eba59e685b93c5a fvwmkb-0.3.2-r1.ebuild 992 11MD5 e4ec45ca8ca2f3cc9eba59e685b93c5a fvwmkb-0.3.2-r1.ebuild 992
8RMD160 e4bd734cda8f19667e658070f9facf52550c8389 fvwmkb-0.3.2-r1.ebuild 992 12RMD160 e4bd734cda8f19667e658070f9facf52550c8389 fvwmkb-0.3.2-r1.ebuild 992
9SHA256 68ed1267bd6a35e8220a78dce8ccd4923fb73f49dc79a836f385a4860d32c347 fvwmkb-0.3.2-r1.ebuild 992 13SHA256 68ed1267bd6a35e8220a78dce8ccd4923fb73f49dc79a836f385a4860d32c347 fvwmkb-0.3.2-r1.ebuild 992
14EBUILD fvwmkb-0.3.2-r2.ebuild 992 RMD160 e4bd734cda8f19667e658070f9facf52550c8389 SHA1 66a216b44583db73086cdcaaa3923fe092e5e483 SHA256 68ed1267bd6a35e8220a78dce8ccd4923fb73f49dc79a836f385a4860d32c347
15MD5 e4ec45ca8ca2f3cc9eba59e685b93c5a fvwmkb-0.3.2-r2.ebuild 992
16RMD160 e4bd734cda8f19667e658070f9facf52550c8389 fvwmkb-0.3.2-r2.ebuild 992
17SHA256 68ed1267bd6a35e8220a78dce8ccd4923fb73f49dc79a836f385a4860d32c347 fvwmkb-0.3.2-r2.ebuild 992
10MD5 1ae8545ce2288519d7c9065e25959088 files/digest-fvwmkb-0.3.2-r1 235 18MD5 1ae8545ce2288519d7c9065e25959088 files/digest-fvwmkb-0.3.2-r1 235
11RMD160 eb80be00cce8fce5cb5c90d3101f5dfc37c1bb4b files/digest-fvwmkb-0.3.2-r1 235 19RMD160 eb80be00cce8fce5cb5c90d3101f5dfc37c1bb4b files/digest-fvwmkb-0.3.2-r1 235
12SHA256 93f61036c82ee2a645448a22bd871eb8d814be02212ffa9306fc5e0d383c5ad3 files/digest-fvwmkb-0.3.2-r1 235 20SHA256 93f61036c82ee2a645448a22bd871eb8d814be02212ffa9306fc5e0d383c5ad3 files/digest-fvwmkb-0.3.2-r1 235
21MD5 1ae8545ce2288519d7c9065e25959088 files/digest-fvwmkb-0.3.2-r2 235
22RMD160 eb80be00cce8fce5cb5c90d3101f5dfc37c1bb4b files/digest-fvwmkb-0.3.2-r2 235
23SHA256 93f61036c82ee2a645448a22bd871eb8d814be02212ffa9306fc5e0d383c5ad3 files/digest-fvwmkb-0.3.2-r2 235
diff --git a/x11-plugins/fvwmkb/files/digest-fvwmkb-0.3.2-r2 b/x11-plugins/fvwmkb/files/digest-fvwmkb-0.3.2-r2
new file mode 100644
index 0000000..cace036
--- a/dev/null
+++ b/x11-plugins/fvwmkb/files/digest-fvwmkb-0.3.2-r2
@@ -0,0 +1,3 @@
1MD5 44e8f1b62f077fbfdf73ec473c655ad1 FvwmKb-0.3.2.tar.gz 54131
2RMD160 299ec96313f97502f955fdd618a6aecd02b554fc FvwmKb-0.3.2.tar.gz 54131
3SHA256 ef3f59aaf48f0bd1263f6d34a21ddf0d340b537adc7b720ac68bb56e15b573ff FvwmKb-0.3.2.tar.gz 54131
diff --git a/x11-plugins/fvwmkb/files/fvwmkb-0.3.2-r2.patch b/x11-plugins/fvwmkb/files/fvwmkb-0.3.2-r2.patch
new file mode 100644
index 0000000..85dda69
--- a/dev/null
+++ b/x11-plugins/fvwmkb/files/fvwmkb-0.3.2-r2.patch
@@ -0,0 +1,341 @@
1diff --git a/.gitignore b/.gitignore
2new file mode 100644
3index 0000000..01ddd90
4--- /dev/null
5+++ b/.gitignore
6@@ -0,0 +1,23 @@
7+aclocal.m4
8+autom4te.cache
9+config.guess
10+config.h
11+config.h.in
12+config.log
13+config.status
14+config.sub
15+configure
16+install-sh
17+missing
18+mkinstalldirs
19+stamp-h
20+stamp-h.in
21+depcomp
22+stamp-h1
23+
24+Makefile
25+Makefile.in
26+.deps
27+
28+FvwmKb
29+*.o
30diff --git a/TODO b/TODO
31index e1345e3..d930f10 100644
32--- a/TODO
33+++ b/TODO
34@@ -3,12 +3,10 @@ This file is a part of FvwmKb.
35 Copyright (C) 1999 Alexander Vorobiev
36 $Id: TODO,v 1.1.1.1 1999/04/16 14:55:26 sparrow Exp $
37
38-* Add an ability to accept messages from Fvwm to change locked group -
39- so it will be possible to change group from menu or clicking
40- titlebar button
41-
42 * Make man page
43
44 * Add more pixmaps
45
46 * Add support for other window managers
47+
48+* Add suport for autoconf-ing fvwm modules dir
49diff --git a/autogen.sh b/autogen.sh
50new file mode 100755
51index 0000000..82808f9
52--- /dev/null
53+++ b/autogen.sh
54@@ -0,0 +1,9 @@
55+#!/bin/sh
56+WANT_AUTOMAKE=1.8
57+export WANT_AUTOMAKE
58+aclocal \
59+&& autoheader \
60+&& automake -a \
61+&& autoheader \
62+&& autoconf \
63+&& ./configure "$@"
64diff --git a/configure.ac b/configure.ac
65new file mode 100644
66index 0000000..1149343
67--- /dev/null
68+++ b/configure.ac
69@@ -0,0 +1,82 @@
70+dnl This file is a part of FvwmKb.
71+dnl Copyright (C) 1999 Alexander Vorobiev
72+dnl $Id: configure.in,v 1.4 1999/10/26 20:28:03 sparrow Exp $
73+
74+AC_INIT([FvwmKb],[0.3.2-git],[hacker@klever.net])
75+AC_CONFIG_SRCDIR([src/FvwmKb.cpp])
76+AC_CONFIG_HEADER([config.h])
77+AM_INIT_AUTOMAKE([dist-bzip2])
78+
79+AC_MSG_CHECKING([for fvwm module install directory])
80+AC_ARG_WITH(moduledir,
81+ [ --with-moduledir=DIR directory in which fvwm modules are installed ],
82+ [ case "$withval" in
83+ no)
84+ AC_MSG_ERROR(Can not disable moduledir.)
85+ ;;
86+ yes)
87+ ;;
88+ *)
89+ val="$withval"
90+ ;;
91+ esac ])
92+
93+FVWM_MODULEDIR="$val"
94+AC_MSG_RESULT($FVWM_MODULEDIR)
95+AC_SUBST(FVWM_MODULEDIR)
96+
97+dnl Checks for programs.
98+AC_LANG_CPLUSPLUS
99+AC_PROG_CXX
100+AC_PROG_CXXCPP
101+AC_PROG_INSTALL
102+
103+dnl Checks for libraries.
104+AC_CHECK_LIB(stdc++, main)
105+
106+AC_PATH_X
107+AC_PATH_XTRA
108+CFLAGS="$X_CFLAGS"
109+LDFLAGS="$X_LDFLAGS $X_LIBS"
110+
111+AC_CHECK_LIB(X11, XkbOpenDisplay, x_libs="-lX11 $X_EXTRA_LIBS")
112+x_cflags="$X_CFLAGS"
113+x_ldflags="$X_LDFLAGS $X_LIBS"
114+
115+if test -z "$x_includes"; then
116+ x_includes="/usr/include"
117+fi
118+
119+AC_SUBST(x_cflags)
120+AC_SUBST(x_includes)
121+AC_SUBST(x_ldflags)
122+AC_SUBST(x_libs)
123+
124+dnl Checks for header files.
125+AC_CHECK_HEADERS(errno.h stdio.h fcntl.h unistd.h limits.h X11/XKBlib.h)
126+AC_CHECK_HEADERS(sys/time.h signal.h)
127+AC_CHECK_HEADERS(hash_map)
128+
129+dnl Checks for typedefs, structures, and compiler characteristics.
130+AC_C_CONST
131+AC_TYPE_SIZE_T
132+
133+AC_MSG_CHECKING([for debug flag])
134+dodebug=false
135+AC_ARG_ENABLE([debug],
136+ AC_HELP_STRING([--enable-debug],[enable debugging code]),
137+ [ test "${enableval}" != "no" && dodebug=true ]
138+)
139+AC_MSG_RESULT([$dodebug])
140+AH_TEMPLATE(DEBUG,[ Turning on debugging code ])
141+if ${dodebug} ; then
142+ AC_DEFINE_UNQUOTED([DEBUG],[1])
143+fi
144+
145+AC_CONFIG_FILES([
146+ Makefile
147+ src/Makefile
148+ doc/Makefile
149+ pixmaps/Makefile
150+])
151+AC_OUTPUT
152diff --git a/pixmaps/de.xpm b/pixmaps/de.xpm
153new file mode 100644
154index 0000000..e676897
155--- /dev/null
156+++ b/pixmaps/de.xpm
157@@ -0,0 +1,21 @@
158+/* XPM */
159+static char * de_xpm[] = {
160+"14 14 4 1",
161 +" c None",
162 +".c #000000",
163 +"+c #DE0008",
164 +"@c #FFDE08",
165+"..............",
166+"..............",
167+"..............",
168+"..............",
169+"..............",
170+"++++++++++++++",
171+"++++++++++++++",
172+"++++++++++++++",
173+"++++++++++++++",
174+"@@@@@@@@@@@@@@",
175+"@@@@@@@@@@@@@@",
176+"@@@@@@@@@@@@@@",
177+"@@@@@@@@@@@@@@",
178+"@@@@@@@@@@@@@@"};
179diff --git a/src/FvwmKb.cpp b/src/FvwmKb.cpp
180index 9e7baa9..73b2382 100644
181--- a/src/FvwmKb.cpp
182+++ b/src/FvwmKb.cpp
183@@ -21,7 +21,9 @@
184 // Boston, MA 02111-1307 USA
185
186
187-#include <hash_map.h>
188+#include <ext/hash_map>
189+#include <string>
190+using namespace __gnu_cxx;
191 #include "FvwmKb.h"
192 #include "messages.h"
193 #include "ex.h"
194@@ -49,7 +51,7 @@ int main(int argc, char **argv)
195
196 try {
197 // set up connection
198 -Fvwm fvwm(argv[1], argv[2], M_FOCUS_CHANGE | M_DESTROY_WINDOW);
199 +Fvwm fvwm(argv[1], argv[2], M_FOCUS_CHANGE | M_DESTROY_WINDOW | M_STRING);
200
201 #ifdef DEBUG
202 fprintf(stderr,"fvwm initialized ok\n", argv[1], argv[2]);
203@@ -191,9 +193,27 @@ int main(int argc, char **argv)
204 }
205 };
206 break;
207 + case evString:
208 + if(ev.strString.find("ToggleGroup")) {
209 + // FIXME: At the very beginning ev.windows means nothing
210 + if(ev.window != fvwm_no_app_window) {
211 + XkbGetState(dpy, XkbUseCoreKbd, &xkbstate);
212 + XkbLockGroup(dpy,XkbUseCoreKbd, xkbstate.locked_group^1);
213 + XkbGetState(dpy, XkbUseCoreKbd, &xkbstate);
214 + WinRecordPtr = WinGroup.find(ev.window);
215 + if(WinRecordPtr != WinGroup.end()) {
216 + WinGroup[ev.window] = xkbstate.locked_group;
217 + fvwm.ChangeXkbDecor(xkbstate.locked_group);
218 + last_group = xkbstate.locked_group;
219 + }
220 + }
221 + }else{
222 + fprintf(stderr, "unknown string received from fvwm: %s\n", ev.strString.c_str());
223 + }
224 + break;
225
226 default:
227 - fprintf(stderr, "unknown event for window: %ul\n", ev.window);
228 + //fprintf(stderr, "unknown event for window: %ul\n", ev.window);
229 break;
230 };
231
232diff --git a/src/wm.cpp b/src/wm.cpp
233index d6973d1..d2f8de5 100644
234--- a/src/wm.cpp
235+++ b/src/wm.cpp
236@@ -22,6 +22,7 @@
237
238
239 #include <string.h>
240+#include <string>
241 #include "FvwmKb.h"
242 #include "messages.h"
243 #include "ex.h"
244@@ -54,7 +55,7 @@ Fvwm::Fvwm(char *sfd, char *rfd, unsigned long mask)
245 #ifdef DEBUG
246 fprintf(stderr,"message mask sent ok\n");
247 #endif // DEBUG
248-
249+ SendPacket("NOP FINISHED STARTUP",0);
250 }
251
252 Bool Fvwm::PeekEvent(void)
253@@ -93,7 +94,7 @@ void Fvwm::ReadEvent(wmEvent *ev)
254 readexactE(recfd, header, FVWM_HEADER_SIZE * sizeof(unsigned long));
255
256 #ifdef DEBUG
257- fprintf(stderr,"header: [0] = %ul; [1] = %ul; [2] = %ul\n",
258+ fprintf(stderr,"header: [0] = 0x%08lX ; [1] = %lu; [2] = %lu\n",
259 header[0], header[1], header[2]);
260 #endif // DEBUG
261
262@@ -112,7 +113,19 @@ void Fvwm::ReadEvent(wmEvent *ev)
263 ev->window = Window(body[0]);
264 };
265 break;
266- default:
267+ case M_STRING: {
268 +static unsigned long body[sizeof(unsigned long)*256]; // Max body size
269 +if(header[1]>=256)
270 + // FIXME: Wrong exception to throw
271 + throw FvwmUnknownMessageTypeEx(header[0]);
272 +else{
273 + memset(body,0,sizeof(body));
274 + readexactE(recfd,body,(header[1]-4)*sizeof(unsigned long));
275 + ev->type = evString;
276 + ev->strString = (const char*)body;
277 +}
278+ };
279+ break;
280 throw FvwmUnknownMessageTypeEx(header[0]);
281 };
282 }
283@@ -135,7 +148,7 @@ void Fvwm::ChangeXkbDecor(XkbGroup group)
284 // source - http://www.fvwm.org/mod_m2f_communication.html
285 // It might be better to rewrite this function accumulating an entire packet
286 // in some intermediate buffer (as real SendText does).
287-void Fvwm::SendPacket(char *message, Window window)
288+void Fvwm::SendPacket(char *message, unsigned long window)
289 {
290 if (message == NULL)
291 return;
292@@ -148,16 +161,16 @@ void Fvwm::SendPacket(char *message, Window window)
293 writeexactE(sendfd, &window, sizeof(window));
294
295 #ifdef DEBUG
296- fprintf(stderr,"window id %ul sent\n", window);
297+ fprintf(stderr,"window id %lu sent\n", window);
298 #endif // DEBUG
299
300- size_t len=strlen(message); // calc the length of the message
301+ unsigned long len=strlen(message); // calc the length of the message
302 writeexactE(sendfd, &len, sizeof(len)); // send the message length
303 writeexactE(sendfd, message, len); // send the message itself
304
305 // send a 1, indicating that this module will keep going
306 // a 0 would mean that this module is done
307- int flag = 1;
308+ unsigned long flag = 1;
309 writeexactE(sendfd, &flag, sizeof(flag));
310 }
311
312diff --git a/src/wm.h b/src/wm.h
313index c16ea08..4b584d7 100644
314--- a/src/wm.h
315+++ b/src/wm.h
316@@ -32,12 +32,15 @@
317 // generic way though as we have to pass wm-specific arguments.
318
319 // generic interface to wm events
320-enum wmEventType { evFocusWindow, // window is focused
321 - evDestroyWindow }; // window is destroyed
322+enum wmEventType { evUnknown,
323 + evFocusWindow, // window is focused
324 + evDestroyWindow,
325 + evString }; // window is destroyed
326
327 struct wmEvent {
328 wmEventType type;
329 Window window;
330+ std::string strString;
331 };
332
333
334@@ -59,6 +62,7 @@ public:
335 // input focus
336 #define M_DESTROY_WINDOW ((unsigned long)(1<<7)) // The window has just
337 // been destroyed
338 +#define M_STRING ((unsigned long)(1<<22)) // String has been sent to module
339
340 #define FVWM_HEADER_SIZE 3 // fvwm message header size
341 // without starting flag
diff --git a/x11-plugins/fvwmkb/fvwmkb-0.3.2-r2.ebuild b/x11-plugins/fvwmkb/fvwmkb-0.3.2-r2.ebuild
new file mode 100644
index 0000000..87811af
--- a/dev/null
+++ b/x11-plugins/fvwmkb/fvwmkb-0.3.2-r2.ebuild
@@ -0,0 +1,44 @@
1# Copyright 1999-2006 Gentoo Foundation
2# Distributed under the terms of the GNU General Public License v2
3# $Header: $
4
5inherit eutils autotools
6
7DESCRIPTION="A keyboard layout switcher module for fvwm window manager"
8HOMEPAGE="http://sourceforge.net/projects/fvwmkb/"
9SRC_URI="mirror://sourceforge/fvwmkb/FvwmKb-${PV}.tar.gz"
10LICENSE="GPL-2"
11KEYWORDS="~x86 ~amd64"
12SLOT="0"
13
14RDEPEND="x11-wm/fvwm"
15DEPEND="${RDEPEND}
16 sys-devel/autoconf
17 sys-devel/automake
18"
19
20S=${WORKDIR}/FvwmKb-${PV}
21
22src_unpack() {
23 unpack ${A}
24 cd ${S}
25 epatch ${FILESDIR}/${PF}.patch
26 eautoreconf
27}
28
29src_compile() {
30 econf \
31 --with-moduledir="$(fvwm-config -m)" \
32 || die "econf failed"
33 emake || die "emake failed"
34}
35
36
37src_install () {
38 dodir `fvwm-config -m`
39 emake DESTDIR="${D}" install || die "emake install failed"
40 dodoc AUTHORS COPYING ChangeLog INSTALL INSTALL.FvwmKb INSTALL.FvwmKb.koi8 NEWS README README.koi8 TODO doc/*.sample
41 dodir /usr/share/pixmaps
42 insinto /usr/share/pixmaps
43 doins pixmaps/*.xpm
44}