summaryrefslogtreecommitdiff
path: root/x11-plugins/fvwmkb
Side-by-side diff
Diffstat (limited to 'x11-plugins/fvwmkb') (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
@@ -2,11 +2,22 @@ AUX fvwmkb-0.3.2-r1.patch 8445 RMD160 b2b84ec464d8120ed58f00e2da7cb25729bff7d5 S
MD5 a994284c429aff529dc4b572749a9625 files/fvwmkb-0.3.2-r1.patch 8445
RMD160 b2b84ec464d8120ed58f00e2da7cb25729bff7d5 files/fvwmkb-0.3.2-r1.patch 8445
SHA256 4fee3e987cd93188f7e77ad525469f6e8d584e20c8f48b6b4cd0815df6796e30 files/fvwmkb-0.3.2-r1.patch 8445
+AUX fvwmkb-0.3.2-r2.patch 8967 RMD160 b82ea16c59639a9f239bb755a6070ea779091794 SHA1 e5f356a5f4318dba311aaaad30e15f03f94ef307 SHA256 d3e146fcf2649a0eda98044005b6eab62477977034e2ad4de623c65804d4324f
+MD5 07fe60335403fadf04b85bdf416b7d8e files/fvwmkb-0.3.2-r2.patch 8967
+RMD160 b82ea16c59639a9f239bb755a6070ea779091794 files/fvwmkb-0.3.2-r2.patch 8967
+SHA256 d3e146fcf2649a0eda98044005b6eab62477977034e2ad4de623c65804d4324f files/fvwmkb-0.3.2-r2.patch 8967
DIST FvwmKb-0.3.2.tar.gz 54131 RMD160 299ec96313f97502f955fdd618a6aecd02b554fc SHA1 7c1b9e81db40bc3142b532d3c83e7f2c2fd84173 SHA256 ef3f59aaf48f0bd1263f6d34a21ddf0d340b537adc7b720ac68bb56e15b573ff
EBUILD fvwmkb-0.3.2-r1.ebuild 992 RMD160 e4bd734cda8f19667e658070f9facf52550c8389 SHA1 66a216b44583db73086cdcaaa3923fe092e5e483 SHA256 68ed1267bd6a35e8220a78dce8ccd4923fb73f49dc79a836f385a4860d32c347
MD5 e4ec45ca8ca2f3cc9eba59e685b93c5a fvwmkb-0.3.2-r1.ebuild 992
RMD160 e4bd734cda8f19667e658070f9facf52550c8389 fvwmkb-0.3.2-r1.ebuild 992
SHA256 68ed1267bd6a35e8220a78dce8ccd4923fb73f49dc79a836f385a4860d32c347 fvwmkb-0.3.2-r1.ebuild 992
+EBUILD fvwmkb-0.3.2-r2.ebuild 992 RMD160 e4bd734cda8f19667e658070f9facf52550c8389 SHA1 66a216b44583db73086cdcaaa3923fe092e5e483 SHA256 68ed1267bd6a35e8220a78dce8ccd4923fb73f49dc79a836f385a4860d32c347
+MD5 e4ec45ca8ca2f3cc9eba59e685b93c5a fvwmkb-0.3.2-r2.ebuild 992
+RMD160 e4bd734cda8f19667e658070f9facf52550c8389 fvwmkb-0.3.2-r2.ebuild 992
+SHA256 68ed1267bd6a35e8220a78dce8ccd4923fb73f49dc79a836f385a4860d32c347 fvwmkb-0.3.2-r2.ebuild 992
MD5 1ae8545ce2288519d7c9065e25959088 files/digest-fvwmkb-0.3.2-r1 235
RMD160 eb80be00cce8fce5cb5c90d3101f5dfc37c1bb4b files/digest-fvwmkb-0.3.2-r1 235
SHA256 93f61036c82ee2a645448a22bd871eb8d814be02212ffa9306fc5e0d383c5ad3 files/digest-fvwmkb-0.3.2-r1 235
+MD5 1ae8545ce2288519d7c9065e25959088 files/digest-fvwmkb-0.3.2-r2 235
+RMD160 eb80be00cce8fce5cb5c90d3101f5dfc37c1bb4b files/digest-fvwmkb-0.3.2-r2 235
+SHA256 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 @@
+MD5 44e8f1b62f077fbfdf73ec473c655ad1 FvwmKb-0.3.2.tar.gz 54131
+RMD160 299ec96313f97502f955fdd618a6aecd02b554fc FvwmKb-0.3.2.tar.gz 54131
+SHA256 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 @@
+diff --git a/.gitignore b/.gitignore
+new file mode 100644
+index 0000000..01ddd90
+--- /dev/null
++++ b/.gitignore
+@@ -0,0 +1,23 @@
++aclocal.m4
++autom4te.cache
++config.guess
++config.h
++config.h.in
++config.log
++config.status
++config.sub
++configure
++install-sh
++missing
++mkinstalldirs
++stamp-h
++stamp-h.in
++depcomp
++stamp-h1
++
++Makefile
++Makefile.in
++.deps
++
++FvwmKb
++*.o
+diff --git a/TODO b/TODO
+index e1345e3..d930f10 100644
+--- a/TODO
++++ b/TODO
+@@ -3,12 +3,10 @@ This file is a part of FvwmKb.
+ Copyright (C) 1999 Alexander Vorobiev
+ $Id: TODO,v 1.1.1.1 1999/04/16 14:55:26 sparrow Exp $
+
+-* Add an ability to accept messages from Fvwm to change locked group -
+- so it will be possible to change group from menu or clicking
+- titlebar button
+-
+ * Make man page
+
+ * Add more pixmaps
+
+ * Add support for other window managers
++
++* Add suport for autoconf-ing fvwm modules dir
+diff --git a/autogen.sh b/autogen.sh
+new file mode 100755
+index 0000000..82808f9
+--- /dev/null
++++ b/autogen.sh
+@@ -0,0 +1,9 @@
++#!/bin/sh
++WANT_AUTOMAKE=1.8
++export WANT_AUTOMAKE
++aclocal \
++&& autoheader \
++&& automake -a \
++&& autoheader \
++&& autoconf \
++&& ./configure "$@"
+diff --git a/configure.ac b/configure.ac
+new file mode 100644
+index 0000000..1149343
+--- /dev/null
++++ b/configure.ac
+@@ -0,0 +1,82 @@
++dnl This file is a part of FvwmKb.
++dnl Copyright (C) 1999 Alexander Vorobiev
++dnl $Id: configure.in,v 1.4 1999/10/26 20:28:03 sparrow Exp $
++
++AC_INIT([FvwmKb],[0.3.2-git],[hacker@klever.net])
++AC_CONFIG_SRCDIR([src/FvwmKb.cpp])
++AC_CONFIG_HEADER([config.h])
++AM_INIT_AUTOMAKE([dist-bzip2])
++
++AC_MSG_CHECKING([for fvwm module install directory])
++AC_ARG_WITH(moduledir,
++ [ --with-moduledir=DIR directory in which fvwm modules are installed ],
++ [ case "$withval" in
++ no)
++ AC_MSG_ERROR(Can not disable moduledir.)
++ ;;
++ yes)
++ ;;
++ *)
++ val="$withval"
++ ;;
++ esac ])
++
++FVWM_MODULEDIR="$val"
++AC_MSG_RESULT($FVWM_MODULEDIR)
++AC_SUBST(FVWM_MODULEDIR)
++
++dnl Checks for programs.
++AC_LANG_CPLUSPLUS
++AC_PROG_CXX
++AC_PROG_CXXCPP
++AC_PROG_INSTALL
++
++dnl Checks for libraries.
++AC_CHECK_LIB(stdc++, main)
++
++AC_PATH_X
++AC_PATH_XTRA
++CFLAGS="$X_CFLAGS"
++LDFLAGS="$X_LDFLAGS $X_LIBS"
++
++AC_CHECK_LIB(X11, XkbOpenDisplay, x_libs="-lX11 $X_EXTRA_LIBS")
++x_cflags="$X_CFLAGS"
++x_ldflags="$X_LDFLAGS $X_LIBS"
++
++if test -z "$x_includes"; then
++ x_includes="/usr/include"
++fi
++
++AC_SUBST(x_cflags)
++AC_SUBST(x_includes)
++AC_SUBST(x_ldflags)
++AC_SUBST(x_libs)
++
++dnl Checks for header files.
++AC_CHECK_HEADERS(errno.h stdio.h fcntl.h unistd.h limits.h X11/XKBlib.h)
++AC_CHECK_HEADERS(sys/time.h signal.h)
++AC_CHECK_HEADERS(hash_map)
++
++dnl Checks for typedefs, structures, and compiler characteristics.
++AC_C_CONST
++AC_TYPE_SIZE_T
++
++AC_MSG_CHECKING([for debug flag])
++dodebug=false
++AC_ARG_ENABLE([debug],
++ AC_HELP_STRING([--enable-debug],[enable debugging code]),
++ [ test "${enableval}" != "no" && dodebug=true ]
++)
++AC_MSG_RESULT([$dodebug])
++AH_TEMPLATE(DEBUG,[ Turning on debugging code ])
++if ${dodebug} ; then
++ AC_DEFINE_UNQUOTED([DEBUG],[1])
++fi
++
++AC_CONFIG_FILES([
++ Makefile
++ src/Makefile
++ doc/Makefile
++ pixmaps/Makefile
++])
++AC_OUTPUT
+diff --git a/pixmaps/de.xpm b/pixmaps/de.xpm
+new file mode 100644
+index 0000000..e676897
+--- /dev/null
++++ b/pixmaps/de.xpm
+@@ -0,0 +1,21 @@
++/* XPM */
++static char * de_xpm[] = {
++"14 14 4 1",
++" c None",
++". c #000000",
++"+ c #DE0008",
++"@ c #FFDE08",
++"..............",
++"..............",
++"..............",
++"..............",
++"..............",
++"++++++++++++++",
++"++++++++++++++",
++"++++++++++++++",
++"++++++++++++++",
++"@@@@@@@@@@@@@@",
++"@@@@@@@@@@@@@@",
++"@@@@@@@@@@@@@@",
++"@@@@@@@@@@@@@@",
++"@@@@@@@@@@@@@@"};
+diff --git a/src/FvwmKb.cpp b/src/FvwmKb.cpp
+index 9e7baa9..73b2382 100644
+--- a/src/FvwmKb.cpp
++++ b/src/FvwmKb.cpp
+@@ -21,7 +21,9 @@
+ // Boston, MA 02111-1307 USA
+
+
+-#include <hash_map.h>
++#include <ext/hash_map>
++#include <string>
++using namespace __gnu_cxx;
+ #include "FvwmKb.h"
+ #include "messages.h"
+ #include "ex.h"
+@@ -49,7 +51,7 @@ int main(int argc, char **argv)
+
+ try {
+ // set up connection
+- Fvwm fvwm(argv[1], argv[2], M_FOCUS_CHANGE | M_DESTROY_WINDOW);
++ Fvwm fvwm(argv[1], argv[2], M_FOCUS_CHANGE | M_DESTROY_WINDOW | M_STRING);
+
+ #ifdef DEBUG
+ fprintf(stderr,"fvwm initialized ok\n", argv[1], argv[2]);
+@@ -191,9 +193,27 @@ int main(int argc, char **argv)
+ }
+ };
+ break;
++ case evString:
++ if(ev.strString.find("ToggleGroup")) {
++ // FIXME: At the very beginning ev.windows means nothing
++ if(ev.window != fvwm_no_app_window) {
++ XkbGetState(dpy, XkbUseCoreKbd, &xkbstate);
++ XkbLockGroup(dpy,XkbUseCoreKbd, xkbstate.locked_group^1);
++ XkbGetState(dpy, XkbUseCoreKbd, &xkbstate);
++ WinRecordPtr = WinGroup.find(ev.window);
++ if(WinRecordPtr != WinGroup.end()) {
++ WinGroup[ev.window] = xkbstate.locked_group;
++ fvwm.ChangeXkbDecor(xkbstate.locked_group);
++ last_group = xkbstate.locked_group;
++ }
++ }
++ }else{
++ fprintf(stderr, "unknown string received from fvwm: %s\n", ev.strString.c_str());
++ }
++ break;
+
+ default:
+- fprintf(stderr, "unknown event for window: %ul\n", ev.window);
++ //fprintf(stderr, "unknown event for window: %ul\n", ev.window);
+ break;
+ };
+
+diff --git a/src/wm.cpp b/src/wm.cpp
+index d6973d1..d2f8de5 100644
+--- a/src/wm.cpp
++++ b/src/wm.cpp
+@@ -22,6 +22,7 @@
+
+
+ #include <string.h>
++#include <string>
+ #include "FvwmKb.h"
+ #include "messages.h"
+ #include "ex.h"
+@@ -54,7 +55,7 @@ Fvwm::Fvwm(char *sfd, char *rfd, unsigned long mask)
+ #ifdef DEBUG
+ fprintf(stderr,"message mask sent ok\n");
+ #endif // DEBUG
+-
++ SendPacket("NOP FINISHED STARTUP",0);
+ }
+
+ Bool Fvwm::PeekEvent(void)
+@@ -93,7 +94,7 @@ void Fvwm::ReadEvent(wmEvent *ev)
+ readexactE(recfd, header, FVWM_HEADER_SIZE * sizeof(unsigned long));
+
+ #ifdef DEBUG
+- fprintf(stderr,"header: [0] = %ul; [1] = %ul; [2] = %ul\n",
++ fprintf(stderr,"header: [0] = 0x%08lX ; [1] = %lu; [2] = %lu\n",
+ header[0], header[1], header[2]);
+ #endif // DEBUG
+
+@@ -112,7 +113,19 @@ void Fvwm::ReadEvent(wmEvent *ev)
+ ev->window = Window(body[0]);
+ };
+ break;
+- default:
++ case M_STRING: {
++ static unsigned long body[sizeof(unsigned long)*256]; // Max body size
++ if(header[1]>=256)
++ // FIXME: Wrong exception to throw
++ throw FvwmUnknownMessageTypeEx(header[0]);
++ else{
++ memset(body,0,sizeof(body));
++ readexactE(recfd,body,(header[1]-4)*sizeof(unsigned long));
++ ev->type = evString;
++ ev->strString = (const char*)body;
++ }
++ };
++ break;
+ throw FvwmUnknownMessageTypeEx(header[0]);
+ };
+ }
+@@ -135,7 +148,7 @@ void Fvwm::ChangeXkbDecor(XkbGroup group)
+ // source - http://www.fvwm.org/mod_m2f_communication.html
+ // It might be better to rewrite this function accumulating an entire packet
+ // in some intermediate buffer (as real SendText does).
+-void Fvwm::SendPacket(char *message, Window window)
++void Fvwm::SendPacket(char *message, unsigned long window)
+ {
+ if (message == NULL)
+ return;
+@@ -148,16 +161,16 @@ void Fvwm::SendPacket(char *message, Window window)
+ writeexactE(sendfd, &window, sizeof(window));
+
+ #ifdef DEBUG
+- fprintf(stderr,"window id %ul sent\n", window);
++ fprintf(stderr,"window id %lu sent\n", window);
+ #endif // DEBUG
+
+- size_t len=strlen(message); // calc the length of the message
++ unsigned long len=strlen(message); // calc the length of the message
+ writeexactE(sendfd, &len, sizeof(len)); // send the message length
+ writeexactE(sendfd, message, len); // send the message itself
+
+ // send a 1, indicating that this module will keep going
+ // a 0 would mean that this module is done
+- int flag = 1;
++ unsigned long flag = 1;
+ writeexactE(sendfd, &flag, sizeof(flag));
+ }
+
+diff --git a/src/wm.h b/src/wm.h
+index c16ea08..4b584d7 100644
+--- a/src/wm.h
++++ b/src/wm.h
+@@ -32,12 +32,15 @@
+ // generic way though as we have to pass wm-specific arguments.
+
+ // generic interface to wm events
+-enum wmEventType { evFocusWindow, // window is focused
+- evDestroyWindow }; // window is destroyed
++enum wmEventType { evUnknown,
++ evFocusWindow, // window is focused
++ evDestroyWindow,
++ evString }; // window is destroyed
+
+ struct wmEvent {
+ wmEventType type;
+ Window window;
++ std::string strString;
+ };
+
+
+@@ -59,6 +62,7 @@ public:
+ // input focus
+ #define M_DESTROY_WINDOW ((unsigned long)(1<<7)) // The window has just
+ // been destroyed
++#define M_STRING ((unsigned long)(1<<22)) // String has been sent to module
+
+ #define FVWM_HEADER_SIZE 3 // fvwm message header size
+ // 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 @@
+# Copyright 1999-2006 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+# $Header: $
+
+inherit eutils autotools
+
+DESCRIPTION="A keyboard layout switcher module for fvwm window manager"
+HOMEPAGE="http://sourceforge.net/projects/fvwmkb/"
+SRC_URI="mirror://sourceforge/fvwmkb/FvwmKb-${PV}.tar.gz"
+LICENSE="GPL-2"
+KEYWORDS="~x86 ~amd64"
+SLOT="0"
+
+RDEPEND="x11-wm/fvwm"
+DEPEND="${RDEPEND}
+ sys-devel/autoconf
+ sys-devel/automake
+"
+
+S=${WORKDIR}/FvwmKb-${PV}
+
+src_unpack() {
+ unpack ${A}
+ cd ${S}
+ epatch ${FILESDIR}/${PF}.patch
+ eautoreconf
+}
+
+src_compile() {
+ econf \
+ --with-moduledir="$(fvwm-config -m)" \
+ || die "econf failed"
+ emake || die "emake failed"
+}
+
+
+src_install () {
+ dodir `fvwm-config -m`
+ emake DESTDIR="${D}" install || die "emake install failed"
+ dodoc AUTHORS COPYING ChangeLog INSTALL INSTALL.FvwmKb INSTALL.FvwmKb.koi8 NEWS README README.koi8 TODO doc/*.sample
+ dodir /usr/share/pixmaps
+ insinto /usr/share/pixmaps
+ doins pixmaps/*.xpm
+}