summaryrefslogtreecommitdiff
path: root/x11-plugins
authorMichael Krelin <hacker@klever.net>2007-02-21 01:16:18 (UTC)
committer Michael Krelin <hacker@klever.net>2007-02-21 01:16:18 (UTC)
commitb3277651c9c02a910e384b6633bf4b1915e6302a (patch) (unidiff)
tree255e8eb73dafaeeab6053bd99ff26b9ce73d529c /x11-plugins
parent7232b0256da0c1b1577ce3bf55868d74f36f4dd4 (diff)
downloadmisc-b3277651c9c02a910e384b6633bf4b1915e6302a.zip
misc-b3277651c9c02a910e384b6633bf4b1915e6302a.tar.gz
misc-b3277651c9c02a910e384b6633bf4b1915e6302a.tar.bz2
fvwmkb added
Diffstat (limited to 'x11-plugins') (more/less context) (ignore whitespace changes)
-rw-r--r--x11-plugins/fvwmkb/Manifest12
-rw-r--r--x11-plugins/fvwmkb/files/digest-fvwmkb-0.3.2-r13
-rw-r--r--x11-plugins/fvwmkb/files/fvwmkb-0.3.2-r1.patch314
-rw-r--r--x11-plugins/fvwmkb/fvwmkb-0.3.2-r1.ebuild44
4 files changed, 373 insertions, 0 deletions
diff --git a/x11-plugins/fvwmkb/Manifest b/x11-plugins/fvwmkb/Manifest
new file mode 100644
index 0000000..e26912b
--- a/dev/null
+++ b/x11-plugins/fvwmkb/Manifest
@@ -0,0 +1,12 @@
1AUX fvwmkb-0.3.2-r1.patch 8445 RMD160 b2b84ec464d8120ed58f00e2da7cb25729bff7d5 SHA1 6b63cc8d793486092faa99a7dce77684c4dda981 SHA256 4fee3e987cd93188f7e77ad525469f6e8d584e20c8f48b6b4cd0815df6796e30
2MD5 a994284c429aff529dc4b572749a9625 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
5DIST 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
7MD5 e4ec45ca8ca2f3cc9eba59e685b93c5a fvwmkb-0.3.2-r1.ebuild 992
8RMD160 e4bd734cda8f19667e658070f9facf52550c8389 fvwmkb-0.3.2-r1.ebuild 992
9SHA256 68ed1267bd6a35e8220a78dce8ccd4923fb73f49dc79a836f385a4860d32c347 fvwmkb-0.3.2-r1.ebuild 992
10MD5 1ae8545ce2288519d7c9065e25959088 files/digest-fvwmkb-0.3.2-r1 235
11RMD160 eb80be00cce8fce5cb5c90d3101f5dfc37c1bb4b files/digest-fvwmkb-0.3.2-r1 235
12SHA256 93f61036c82ee2a645448a22bd871eb8d814be02212ffa9306fc5e0d383c5ad3 files/digest-fvwmkb-0.3.2-r1 235
diff --git a/x11-plugins/fvwmkb/files/digest-fvwmkb-0.3.2-r1 b/x11-plugins/fvwmkb/files/digest-fvwmkb-0.3.2-r1
new file mode 100644
index 0000000..cace036
--- a/dev/null
+++ b/x11-plugins/fvwmkb/files/digest-fvwmkb-0.3.2-r1
@@ -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-r1.patch b/x11-plugins/fvwmkb/files/fvwmkb-0.3.2-r1.patch
new file mode 100644
index 0000000..2428c08
--- a/dev/null
+++ b/x11-plugins/fvwmkb/files/fvwmkb-0.3.2-r1.patch
@@ -0,0 +1,314 @@
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/src/FvwmKb.cpp b/src/FvwmKb.cpp
153index 9e7baa9..73b2382 100644
154--- a/src/FvwmKb.cpp
155+++ b/src/FvwmKb.cpp
156@@ -21,7 +21,9 @@
157 // Boston, MA 02111-1307 USA
158
159
160-#include <hash_map.h>
161+#include <ext/hash_map>
162+#include <string>
163+using namespace __gnu_cxx;
164 #include "FvwmKb.h"
165 #include "messages.h"
166 #include "ex.h"
167@@ -49,7 +51,7 @@ int main(int argc, char **argv)
168
169 try {
170 // set up connection
171 -Fvwm fvwm(argv[1], argv[2], M_FOCUS_CHANGE | M_DESTROY_WINDOW);
172 +Fvwm fvwm(argv[1], argv[2], M_FOCUS_CHANGE | M_DESTROY_WINDOW | M_STRING);
173
174 #ifdef DEBUG
175 fprintf(stderr,"fvwm initialized ok\n", argv[1], argv[2]);
176@@ -191,9 +193,27 @@ int main(int argc, char **argv)
177 }
178 };
179 break;
180 + case evString:
181 + if(ev.strString.find("ToggleGroup")) {
182 + // FIXME: At the very beginning ev.windows means nothing
183 + if(ev.window != fvwm_no_app_window) {
184 + XkbGetState(dpy, XkbUseCoreKbd, &xkbstate);
185 + XkbLockGroup(dpy,XkbUseCoreKbd, xkbstate.locked_group^1);
186 + XkbGetState(dpy, XkbUseCoreKbd, &xkbstate);
187 + WinRecordPtr = WinGroup.find(ev.window);
188 + if(WinRecordPtr != WinGroup.end()) {
189 + WinGroup[ev.window] = xkbstate.locked_group;
190 + fvwm.ChangeXkbDecor(xkbstate.locked_group);
191 + last_group = xkbstate.locked_group;
192 + }
193 + }
194 + }else{
195 + fprintf(stderr, "unknown string received from fvwm: %s\n", ev.strString.c_str());
196 + }
197 + break;
198
199 default:
200 - fprintf(stderr, "unknown event for window: %ul\n", ev.window);
201 + //fprintf(stderr, "unknown event for window: %ul\n", ev.window);
202 break;
203 };
204
205diff --git a/src/wm.cpp b/src/wm.cpp
206index d6973d1..d2f8de5 100644
207--- a/src/wm.cpp
208+++ b/src/wm.cpp
209@@ -22,6 +22,7 @@
210
211
212 #include <string.h>
213+#include <string>
214 #include "FvwmKb.h"
215 #include "messages.h"
216 #include "ex.h"
217@@ -54,7 +55,7 @@ Fvwm::Fvwm(char *sfd, char *rfd, unsigned long mask)
218 #ifdef DEBUG
219 fprintf(stderr,"message mask sent ok\n");
220 #endif // DEBUG
221-
222+ SendPacket("NOP FINISHED STARTUP",0);
223 }
224
225 Bool Fvwm::PeekEvent(void)
226@@ -93,7 +94,7 @@ void Fvwm::ReadEvent(wmEvent *ev)
227 readexactE(recfd, header, FVWM_HEADER_SIZE * sizeof(unsigned long));
228
229 #ifdef DEBUG
230- fprintf(stderr,"header: [0] = %ul; [1] = %ul; [2] = %ul\n",
231+ fprintf(stderr,"header: [0] = 0x%08lX ; [1] = %lu; [2] = %lu\n",
232 header[0], header[1], header[2]);
233 #endif // DEBUG
234
235@@ -112,7 +113,19 @@ void Fvwm::ReadEvent(wmEvent *ev)
236 ev->window = Window(body[0]);
237 };
238 break;
239- default:
240+ case M_STRING: {
241 +static unsigned long body[sizeof(unsigned long)*256]; // Max body size
242 +if(header[1]>=256)
243 + // FIXME: Wrong exception to throw
244 + throw FvwmUnknownMessageTypeEx(header[0]);
245 +else{
246 + memset(body,0,sizeof(body));
247 + readexactE(recfd,body,(header[1]-4)*sizeof(unsigned long));
248 + ev->type = evString;
249 + ev->strString = (const char*)body;
250 +}
251+ };
252+ break;
253 throw FvwmUnknownMessageTypeEx(header[0]);
254 };
255 }
256@@ -135,7 +148,7 @@ void Fvwm::ChangeXkbDecor(XkbGroup group)
257 // source - http://www.fvwm.org/mod_m2f_communication.html
258 // It might be better to rewrite this function accumulating an entire packet
259 // in some intermediate buffer (as real SendText does).
260-void Fvwm::SendPacket(char *message, Window window)
261+void Fvwm::SendPacket(char *message, unsigned long window)
262 {
263 if (message == NULL)
264 return;
265@@ -148,16 +161,16 @@ void Fvwm::SendPacket(char *message, Window window)
266 writeexactE(sendfd, &window, sizeof(window));
267
268 #ifdef DEBUG
269- fprintf(stderr,"window id %ul sent\n", window);
270+ fprintf(stderr,"window id %lu sent\n", window);
271 #endif // DEBUG
272
273- size_t len=strlen(message); // calc the length of the message
274+ unsigned long len=strlen(message); // calc the length of the message
275 writeexactE(sendfd, &len, sizeof(len)); // send the message length
276 writeexactE(sendfd, message, len); // send the message itself
277
278 // send a 1, indicating that this module will keep going
279 // a 0 would mean that this module is done
280- int flag = 1;
281+ unsigned long flag = 1;
282 writeexactE(sendfd, &flag, sizeof(flag));
283 }
284
285diff --git a/src/wm.h b/src/wm.h
286index c16ea08..4b584d7 100644
287--- a/src/wm.h
288+++ b/src/wm.h
289@@ -32,12 +32,15 @@
290 // generic way though as we have to pass wm-specific arguments.
291
292 // generic interface to wm events
293-enum wmEventType { evFocusWindow, // window is focused
294 - evDestroyWindow }; // window is destroyed
295+enum wmEventType { evUnknown,
296 + evFocusWindow, // window is focused
297 + evDestroyWindow,
298 + evString }; // window is destroyed
299
300 struct wmEvent {
301 wmEventType type;
302 Window window;
303+ std::string strString;
304 };
305
306
307@@ -59,6 +62,7 @@ public:
308 // input focus
309 #define M_DESTROY_WINDOW ((unsigned long)(1<<7)) // The window has just
310 // been destroyed
311 +#define M_STRING ((unsigned long)(1<<22)) // String has been sent to module
312
313 #define FVWM_HEADER_SIZE 3 // fvwm message header size
314 // without starting flag
diff --git a/x11-plugins/fvwmkb/fvwmkb-0.3.2-r1.ebuild b/x11-plugins/fvwmkb/fvwmkb-0.3.2-r1.ebuild
new file mode 100644
index 0000000..87811af
--- a/dev/null
+++ b/x11-plugins/fvwmkb/fvwmkb-0.3.2-r1.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}