summaryrefslogtreecommitdiffstats
path: root/kbstateapplet
diff options
context:
space:
mode:
authortoma <toma@283d02a7-25f6-0310-bc7c-ecb5cbfe19da>2009-11-25 17:56:58 +0000
committertoma <toma@283d02a7-25f6-0310-bc7c-ecb5cbfe19da>2009-11-25 17:56:58 +0000
commit00bb99ac80741fc50ef8a289719373032f2391eb (patch)
tree3a5a9bf72f942784b38bf77dd66c534662fab5f2 /kbstateapplet
downloadtdeaccessibility-00bb99ac80741fc50ef8a289719373032f2391eb.zip
tdeaccessibility-00bb99ac80741fc50ef8a289719373032f2391eb.tar.gz
Copy the KDE 3.5 branch to branches/trinity for new KDE 3.5 features.
BUG:215923 git-svn-id: svn://anonsvn.kde.org/home/kde/branches/trinity/kdeaccessibility@1054174 283d02a7-25f6-0310-bc7c-ecb5cbfe19da
Diffstat (limited to 'kbstateapplet')
-rw-r--r--kbstateapplet/Makefile.am24
-rw-r--r--kbstateapplet/configure.in.in23
-rw-r--r--kbstateapplet/images/Makefile.am2
-rw-r--r--kbstateapplet/images/cr16-action-altkey.pngbin0 -> 150 bytes
-rw-r--r--kbstateapplet/images/cr16-action-capskey.pngbin0 -> 206 bytes
-rw-r--r--kbstateapplet/images/cr16-action-controlkey.pngbin0 -> 191 bytes
-rw-r--r--kbstateapplet/images/cr16-action-hyperkey.pngbin0 -> 152 bytes
-rw-r--r--kbstateapplet/images/cr16-action-kbstate_mouse.pngbin0 -> 223 bytes
-rw-r--r--kbstateapplet/images/cr16-action-kbstate_mouse_left.pngbin0 -> 117 bytes
-rw-r--r--kbstateapplet/images/cr16-action-kbstate_mouse_left_selected.pngbin0 -> 142 bytes
-rw-r--r--kbstateapplet/images/cr16-action-kbstate_mouse_mid.pngbin0 -> 104 bytes
-rw-r--r--kbstateapplet/images/cr16-action-kbstate_mouse_mid_selected.pngbin0 -> 128 bytes
-rw-r--r--kbstateapplet/images/cr16-action-kbstate_mouse_right.pngbin0 -> 111 bytes
-rw-r--r--kbstateapplet/images/cr16-action-kbstate_mouse_right_selected.pngbin0 -> 141 bytes
-rw-r--r--kbstateapplet/images/cr16-action-kbstate_slowkeys.pngbin0 -> 226 bytes
-rw-r--r--kbstateapplet/images/cr16-action-kbstate_stickykeys.pngbin0 -> 188 bytes
-rw-r--r--kbstateapplet/images/cr16-action-key.pngbin0 -> 75 bytes
-rw-r--r--kbstateapplet/images/cr16-action-keypressno.pngbin0 -> 233 bytes
-rw-r--r--kbstateapplet/images/cr16-action-keypressok.pngbin0 -> 256 bytes
-rw-r--r--kbstateapplet/images/cr16-action-lockkey.pngbin0 -> 193 bytes
-rw-r--r--kbstateapplet/images/cr16-action-metakey.pngbin0 -> 180 bytes
-rw-r--r--kbstateapplet/images/cr16-action-shiftkey.pngbin0 -> 210 bytes
-rw-r--r--kbstateapplet/images/cr16-action-superkey.pngbin0 -> 183 bytes
-rw-r--r--kbstateapplet/images/cr16-action-unlatched.pngbin0 -> 75 bytes
-rw-r--r--kbstateapplet/images/cr22-action-altkey.pngbin0 -> 153 bytes
-rw-r--r--kbstateapplet/images/cr22-action-capskey.pngbin0 -> 216 bytes
-rw-r--r--kbstateapplet/images/cr22-action-controlkey.pngbin0 -> 205 bytes
-rw-r--r--kbstateapplet/images/cr22-action-hyperkey.pngbin0 -> 161 bytes
-rw-r--r--kbstateapplet/images/cr22-action-kbstate_mouse.pngbin0 -> 334 bytes
-rw-r--r--kbstateapplet/images/cr22-action-kbstate_mouse_left.pngbin0 -> 121 bytes
-rw-r--r--kbstateapplet/images/cr22-action-kbstate_mouse_left_selected.pngbin0 -> 166 bytes
-rw-r--r--kbstateapplet/images/cr22-action-kbstate_mouse_mid.pngbin0 -> 119 bytes
-rw-r--r--kbstateapplet/images/cr22-action-kbstate_mouse_mid_selected.pngbin0 -> 143 bytes
-rw-r--r--kbstateapplet/images/cr22-action-kbstate_mouse_right.pngbin0 -> 115 bytes
-rw-r--r--kbstateapplet/images/cr22-action-kbstate_mouse_right_selected.pngbin0 -> 175 bytes
-rw-r--r--kbstateapplet/images/cr22-action-kbstate_slowkeys.pngbin0 -> 271 bytes
-rw-r--r--kbstateapplet/images/cr22-action-kbstate_stickykeys.pngbin0 -> 209 bytes
-rw-r--r--kbstateapplet/images/cr22-action-key.pngbin0 -> 80 bytes
-rw-r--r--kbstateapplet/images/cr22-action-keypressno.pngbin0 -> 228 bytes
-rw-r--r--kbstateapplet/images/cr22-action-keypressok.pngbin0 -> 349 bytes
-rw-r--r--kbstateapplet/images/cr22-action-lockkey.pngbin0 -> 202 bytes
-rw-r--r--kbstateapplet/images/cr22-action-metakey.pngbin0 -> 199 bytes
-rw-r--r--kbstateapplet/images/cr22-action-shiftkey.pngbin0 -> 217 bytes
-rw-r--r--kbstateapplet/images/cr22-action-superkey.pngbin0 -> 187 bytes
-rw-r--r--kbstateapplet/images/cr22-action-unlatched.pngbin0 -> 80 bytes
-rw-r--r--kbstateapplet/images/cr32-action-altkey.pngbin0 -> 162 bytes
-rw-r--r--kbstateapplet/images/cr32-action-capskey.pngbin0 -> 258 bytes
-rw-r--r--kbstateapplet/images/cr32-action-controlkey.pngbin0 -> 239 bytes
-rw-r--r--kbstateapplet/images/cr32-action-hyperkey.pngbin0 -> 168 bytes
-rw-r--r--kbstateapplet/images/cr32-action-kbstate_mouse.pngbin0 -> 430 bytes
-rw-r--r--kbstateapplet/images/cr32-action-kbstate_mouse_left.pngbin0 -> 155 bytes
-rw-r--r--kbstateapplet/images/cr32-action-kbstate_mouse_left_selected.pngbin0 -> 187 bytes
-rw-r--r--kbstateapplet/images/cr32-action-kbstate_mouse_mid.pngbin0 -> 144 bytes
-rw-r--r--kbstateapplet/images/cr32-action-kbstate_mouse_mid_selected.pngbin0 -> 109 bytes
-rw-r--r--kbstateapplet/images/cr32-action-kbstate_mouse_right.pngbin0 -> 156 bytes
-rw-r--r--kbstateapplet/images/cr32-action-kbstate_mouse_right_selected.pngbin0 -> 199 bytes
-rw-r--r--kbstateapplet/images/cr32-action-kbstate_slowkeys.pngbin0 -> 392 bytes
-rw-r--r--kbstateapplet/images/cr32-action-kbstate_stickykeys.pngbin0 -> 254 bytes
-rw-r--r--kbstateapplet/images/cr32-action-key.pngbin0 -> 83 bytes
-rw-r--r--kbstateapplet/images/cr32-action-keypressno.pngbin0 -> 215 bytes
-rw-r--r--kbstateapplet/images/cr32-action-keypressok.pngbin0 -> 521 bytes
-rw-r--r--kbstateapplet/images/cr32-action-lockkey.pngbin0 -> 240 bytes
-rw-r--r--kbstateapplet/images/cr32-action-metakey.pngbin0 -> 228 bytes
-rw-r--r--kbstateapplet/images/cr32-action-shiftkey.pngbin0 -> 259 bytes
-rw-r--r--kbstateapplet/images/cr32-action-superkey.pngbin0 -> 197 bytes
-rw-r--r--kbstateapplet/images/cr32-action-unlatched.pngbin0 -> 83 bytes
-rw-r--r--kbstateapplet/images/cr48-action-altkey.pngbin0 -> 170 bytes
-rw-r--r--kbstateapplet/images/cr48-action-capskey.pngbin0 -> 319 bytes
-rw-r--r--kbstateapplet/images/cr48-action-controlkey.pngbin0 -> 246 bytes
-rw-r--r--kbstateapplet/images/cr48-action-hyperkey.pngbin0 -> 178 bytes
-rw-r--r--kbstateapplet/images/cr48-action-kbstate_mouse.pngbin0 -> 726 bytes
-rw-r--r--kbstateapplet/images/cr48-action-kbstate_mouse_left.pngbin0 -> 189 bytes
-rw-r--r--kbstateapplet/images/cr48-action-kbstate_mouse_left_selected.pngbin0 -> 238 bytes
-rw-r--r--kbstateapplet/images/cr48-action-kbstate_mouse_mid.pngbin0 -> 186 bytes
-rw-r--r--kbstateapplet/images/cr48-action-kbstate_mouse_mid_selected.pngbin0 -> 128 bytes
-rw-r--r--kbstateapplet/images/cr48-action-kbstate_mouse_right.pngbin0 -> 193 bytes
-rw-r--r--kbstateapplet/images/cr48-action-kbstate_mouse_right_selected.pngbin0 -> 244 bytes
-rw-r--r--kbstateapplet/images/cr48-action-kbstate_slowkeys.pngbin0 -> 944 bytes
-rw-r--r--kbstateapplet/images/cr48-action-kbstate_stickykeys.pngbin0 -> 301 bytes
-rw-r--r--kbstateapplet/images/cr48-action-key.pngbin0 -> 88 bytes
-rw-r--r--kbstateapplet/images/cr48-action-keypressno.pngbin0 -> 269 bytes
-rw-r--r--kbstateapplet/images/cr48-action-keypressok.pngbin0 -> 784 bytes
-rw-r--r--kbstateapplet/images/cr48-action-lockkey.pngbin0 -> 279 bytes
-rw-r--r--kbstateapplet/images/cr48-action-metakey.pngbin0 -> 286 bytes
-rw-r--r--kbstateapplet/images/cr48-action-shiftkey.pngbin0 -> 296 bytes
-rw-r--r--kbstateapplet/images/cr48-action-superkey.pngbin0 -> 220 bytes
-rw-r--r--kbstateapplet/images/cr48-action-unlatched.pngbin0 -> 88 bytes
-rw-r--r--kbstateapplet/images/cr64-action-altkey.pngbin0 -> 173 bytes
-rw-r--r--kbstateapplet/images/cr64-action-capskey.pngbin0 -> 336 bytes
-rw-r--r--kbstateapplet/images/cr64-action-controlkey.pngbin0 -> 272 bytes
-rw-r--r--kbstateapplet/images/cr64-action-hyperkey.pngbin0 -> 181 bytes
-rw-r--r--kbstateapplet/images/cr64-action-kbstate_mouse.pngbin0 -> 856 bytes
-rw-r--r--kbstateapplet/images/cr64-action-kbstate_mouse_left.pngbin0 -> 204 bytes
-rw-r--r--kbstateapplet/images/cr64-action-kbstate_mouse_left_selected.pngbin0 -> 228 bytes
-rw-r--r--kbstateapplet/images/cr64-action-kbstate_mouse_mid.pngbin0 -> 205 bytes
-rw-r--r--kbstateapplet/images/cr64-action-kbstate_mouse_mid_selected.pngbin0 -> 146 bytes
-rw-r--r--kbstateapplet/images/cr64-action-kbstate_mouse_right.pngbin0 -> 209 bytes
-rw-r--r--kbstateapplet/images/cr64-action-kbstate_mouse_right_selected.pngbin0 -> 263 bytes
-rw-r--r--kbstateapplet/images/cr64-action-kbstate_slowkeys.pngbin0 -> 994 bytes
-rw-r--r--kbstateapplet/images/cr64-action-kbstate_stickykeys.pngbin0 -> 360 bytes
-rw-r--r--kbstateapplet/images/cr64-action-key.pngbin0 -> 96 bytes
-rw-r--r--kbstateapplet/images/cr64-action-keypressno.pngbin0 -> 337 bytes
-rw-r--r--kbstateapplet/images/cr64-action-keypressok.pngbin0 -> 1000 bytes
-rw-r--r--kbstateapplet/images/cr64-action-lockkey.pngbin0 -> 311 bytes
-rw-r--r--kbstateapplet/images/cr64-action-metakey.pngbin0 -> 348 bytes
-rw-r--r--kbstateapplet/images/cr64-action-shiftkey.pngbin0 -> 316 bytes
-rw-r--r--kbstateapplet/images/cr64-action-superkey.pngbin0 -> 236 bytes
-rw-r--r--kbstateapplet/images/cr64-action-unlatched.pngbin0 -> 96 bytes
-rw-r--r--kbstateapplet/images/crsc-action-altkey.svg7
-rw-r--r--kbstateapplet/images/crsc-action-capskey.svg7
-rw-r--r--kbstateapplet/images/crsc-action-controlkey.svg7
-rw-r--r--kbstateapplet/images/crsc-action-hyperkey.svg11
-rw-r--r--kbstateapplet/images/crsc-action-kbstate_mouse.svg13
-rw-r--r--kbstateapplet/images/crsc-action-kbstate_mouse_left.svg7
-rw-r--r--kbstateapplet/images/crsc-action-kbstate_mouse_left_selected.svg7
-rw-r--r--kbstateapplet/images/crsc-action-kbstate_mouse_mid.svg7
-rw-r--r--kbstateapplet/images/crsc-action-kbstate_mouse_mid_selected.svg7
-rw-r--r--kbstateapplet/images/crsc-action-kbstate_mouse_right.svg7
-rw-r--r--kbstateapplet/images/crsc-action-kbstate_mouse_right_selected.svg7
-rw-r--r--kbstateapplet/images/crsc-action-kbstate_slowkeys.svg9
-rw-r--r--kbstateapplet/images/crsc-action-kbstate_stickykeys.svg9
-rw-r--r--kbstateapplet/images/crsc-action-key.svg5
-rw-r--r--kbstateapplet/images/crsc-action-keypressno.svg9
-rw-r--r--kbstateapplet/images/crsc-action-keypressok.svg7
-rw-r--r--kbstateapplet/images/crsc-action-lockkey.svg7
-rw-r--r--kbstateapplet/images/crsc-action-metakey.svg7
-rw-r--r--kbstateapplet/images/crsc-action-shiftkey.svg7
-rw-r--r--kbstateapplet/images/crsc-action-superkey.svg17
-rw-r--r--kbstateapplet/images/crsc-action-unlatched.svg5
-rw-r--r--kbstateapplet/kbstate.cpp1079
-rw-r--r--kbstateapplet/kbstate.h200
-rw-r--r--kbstateapplet/kbstateapplet.desktop101
-rw-r--r--kbstateapplet/kdeexportfix.h22
133 files changed, 1620 insertions, 0 deletions
diff --git a/kbstateapplet/Makefile.am b/kbstateapplet/Makefile.am
new file mode 100644
index 0000000..23466d9
--- /dev/null
+++ b/kbstateapplet/Makefile.am
@@ -0,0 +1,24 @@
+INCLUDES = $(all_includes)
+
+kde_module_LTLIBRARIES = kbstate_panelapplet.la
+
+kbstate_panelapplet_la_SOURCES = kbstate.cpp
+
+METASOURCES = AUTO
+noinst_HEADERS = kbstate.h kdeexportfix.h
+
+lnkdir = $(kde_datadir)/kicker/applets
+lnk_DATA = kbstateapplet.desktop
+
+EXTRA_DIST = $(lnk_DATA)
+
+kbstate_panelapplet_la_LDFLAGS = $(KDE_PLUGIN) -module $(all_libraries)
+kbstate_panelapplet_la_LIBADD = $(LIB_KDEUI)
+
+messages:
+ $(XGETTEXT) *.cpp *.h -o $(podir)/kbstateapplet.pot
+
+srcdoc:
+ kdoc -a -p -H -d $$HOME/web/src/kbstateapplet kbstateapplet *.h -lqt -lkdecore -lkdeui -lkfile
+
+SUBDIRS = images
diff --git a/kbstateapplet/configure.in.in b/kbstateapplet/configure.in.in
new file mode 100644
index 0000000..3989388
--- /dev/null
+++ b/kbstateapplet/configure.in.in
@@ -0,0 +1,23 @@
+# add this here so the test programs below compile
+KDE_CHECK_HEADER(X11/Xlib.h)
+KDE_CHECK_HEADER(X11/extensions/XKBstr.h, ,
+ DO_NOT_COMPILE="$DO_NOT_COMPILE kbstateapplet",
+[
+#include <X11/Xlib.h>
+])
+
+dnl Solaris lacks this file, so we should skip kbstateapplet here
+KDE_CHECK_HEADER(X11/XKBlib.h, ,
+ DO_NOT_COMPILE="$DO_NOT_COMPILE kbstateapplet",
+[
+#include <X11/Xlib.h>
+])
+
+dnl Solaris lacks this file, so we should skip kbstateapplet here
+KDE_CHECK_HEADER(X11/extensions/XKB.h, ,
+ DO_NOT_COMPILE="$DO_NOT_COMPILE kbstateapplet",
+[
+#include <stdio.h>
+#include <X11/Xlib.h>
+#include <X11/XKBlib.h>
+])
diff --git a/kbstateapplet/images/Makefile.am b/kbstateapplet/images/Makefile.am
new file mode 100644
index 0000000..b8ded81
--- /dev/null
+++ b/kbstateapplet/images/Makefile.am
@@ -0,0 +1,2 @@
+kbstateiconsdir = $(kde_datadir)/kbstateapplet/icons
+kbstateicons_ICON = AUTO \ No newline at end of file
diff --git a/kbstateapplet/images/cr16-action-altkey.png b/kbstateapplet/images/cr16-action-altkey.png
new file mode 100644
index 0000000..e049c31
--- /dev/null
+++ b/kbstateapplet/images/cr16-action-altkey.png
Binary files differ
diff --git a/kbstateapplet/images/cr16-action-capskey.png b/kbstateapplet/images/cr16-action-capskey.png
new file mode 100644
index 0000000..fb98d7b
--- /dev/null
+++ b/kbstateapplet/images/cr16-action-capskey.png
Binary files differ
diff --git a/kbstateapplet/images/cr16-action-controlkey.png b/kbstateapplet/images/cr16-action-controlkey.png
new file mode 100644
index 0000000..3593fdd
--- /dev/null
+++ b/kbstateapplet/images/cr16-action-controlkey.png
Binary files differ
diff --git a/kbstateapplet/images/cr16-action-hyperkey.png b/kbstateapplet/images/cr16-action-hyperkey.png
new file mode 100644
index 0000000..da3fc29
--- /dev/null
+++ b/kbstateapplet/images/cr16-action-hyperkey.png
Binary files differ
diff --git a/kbstateapplet/images/cr16-action-kbstate_mouse.png b/kbstateapplet/images/cr16-action-kbstate_mouse.png
new file mode 100644
index 0000000..a1121c5
--- /dev/null
+++ b/kbstateapplet/images/cr16-action-kbstate_mouse.png
Binary files differ
diff --git a/kbstateapplet/images/cr16-action-kbstate_mouse_left.png b/kbstateapplet/images/cr16-action-kbstate_mouse_left.png
new file mode 100644
index 0000000..59bf8fb
--- /dev/null
+++ b/kbstateapplet/images/cr16-action-kbstate_mouse_left.png
Binary files differ
diff --git a/kbstateapplet/images/cr16-action-kbstate_mouse_left_selected.png b/kbstateapplet/images/cr16-action-kbstate_mouse_left_selected.png
new file mode 100644
index 0000000..40e28d8
--- /dev/null
+++ b/kbstateapplet/images/cr16-action-kbstate_mouse_left_selected.png
Binary files differ
diff --git a/kbstateapplet/images/cr16-action-kbstate_mouse_mid.png b/kbstateapplet/images/cr16-action-kbstate_mouse_mid.png
new file mode 100644
index 0000000..c5b9141
--- /dev/null
+++ b/kbstateapplet/images/cr16-action-kbstate_mouse_mid.png
Binary files differ
diff --git a/kbstateapplet/images/cr16-action-kbstate_mouse_mid_selected.png b/kbstateapplet/images/cr16-action-kbstate_mouse_mid_selected.png
new file mode 100644
index 0000000..8e7e570
--- /dev/null
+++ b/kbstateapplet/images/cr16-action-kbstate_mouse_mid_selected.png
Binary files differ
diff --git a/kbstateapplet/images/cr16-action-kbstate_mouse_right.png b/kbstateapplet/images/cr16-action-kbstate_mouse_right.png
new file mode 100644
index 0000000..673495b
--- /dev/null
+++ b/kbstateapplet/images/cr16-action-kbstate_mouse_right.png
Binary files differ
diff --git a/kbstateapplet/images/cr16-action-kbstate_mouse_right_selected.png b/kbstateapplet/images/cr16-action-kbstate_mouse_right_selected.png
new file mode 100644
index 0000000..fb35c27
--- /dev/null
+++ b/kbstateapplet/images/cr16-action-kbstate_mouse_right_selected.png
Binary files differ
diff --git a/kbstateapplet/images/cr16-action-kbstate_slowkeys.png b/kbstateapplet/images/cr16-action-kbstate_slowkeys.png
new file mode 100644
index 0000000..ebda302
--- /dev/null
+++ b/kbstateapplet/images/cr16-action-kbstate_slowkeys.png
Binary files differ
diff --git a/kbstateapplet/images/cr16-action-kbstate_stickykeys.png b/kbstateapplet/images/cr16-action-kbstate_stickykeys.png
new file mode 100644
index 0000000..744802d
--- /dev/null
+++ b/kbstateapplet/images/cr16-action-kbstate_stickykeys.png
Binary files differ
diff --git a/kbstateapplet/images/cr16-action-key.png b/kbstateapplet/images/cr16-action-key.png
new file mode 100644
index 0000000..55b8c22
--- /dev/null
+++ b/kbstateapplet/images/cr16-action-key.png
Binary files differ
diff --git a/kbstateapplet/images/cr16-action-keypressno.png b/kbstateapplet/images/cr16-action-keypressno.png
new file mode 100644
index 0000000..ed3b5a5
--- /dev/null
+++ b/kbstateapplet/images/cr16-action-keypressno.png
Binary files differ
diff --git a/kbstateapplet/images/cr16-action-keypressok.png b/kbstateapplet/images/cr16-action-keypressok.png
new file mode 100644
index 0000000..040bae2
--- /dev/null
+++ b/kbstateapplet/images/cr16-action-keypressok.png
Binary files differ
diff --git a/kbstateapplet/images/cr16-action-lockkey.png b/kbstateapplet/images/cr16-action-lockkey.png
new file mode 100644
index 0000000..f5920e1
--- /dev/null
+++ b/kbstateapplet/images/cr16-action-lockkey.png
Binary files differ
diff --git a/kbstateapplet/images/cr16-action-metakey.png b/kbstateapplet/images/cr16-action-metakey.png
new file mode 100644
index 0000000..9537dcd
--- /dev/null
+++ b/kbstateapplet/images/cr16-action-metakey.png
Binary files differ
diff --git a/kbstateapplet/images/cr16-action-shiftkey.png b/kbstateapplet/images/cr16-action-shiftkey.png
new file mode 100644
index 0000000..f329803
--- /dev/null
+++ b/kbstateapplet/images/cr16-action-shiftkey.png
Binary files differ
diff --git a/kbstateapplet/images/cr16-action-superkey.png b/kbstateapplet/images/cr16-action-superkey.png
new file mode 100644
index 0000000..69b5495
--- /dev/null
+++ b/kbstateapplet/images/cr16-action-superkey.png
Binary files differ
diff --git a/kbstateapplet/images/cr16-action-unlatched.png b/kbstateapplet/images/cr16-action-unlatched.png
new file mode 100644
index 0000000..55b8c22
--- /dev/null
+++ b/kbstateapplet/images/cr16-action-unlatched.png
Binary files differ
diff --git a/kbstateapplet/images/cr22-action-altkey.png b/kbstateapplet/images/cr22-action-altkey.png
new file mode 100644
index 0000000..12a2ffd
--- /dev/null
+++ b/kbstateapplet/images/cr22-action-altkey.png
Binary files differ
diff --git a/kbstateapplet/images/cr22-action-capskey.png b/kbstateapplet/images/cr22-action-capskey.png
new file mode 100644
index 0000000..4a89ba2
--- /dev/null
+++ b/kbstateapplet/images/cr22-action-capskey.png
Binary files differ
diff --git a/kbstateapplet/images/cr22-action-controlkey.png b/kbstateapplet/images/cr22-action-controlkey.png
new file mode 100644
index 0000000..3072dac
--- /dev/null
+++ b/kbstateapplet/images/cr22-action-controlkey.png
Binary files differ
diff --git a/kbstateapplet/images/cr22-action-hyperkey.png b/kbstateapplet/images/cr22-action-hyperkey.png
new file mode 100644
index 0000000..84653a1
--- /dev/null
+++ b/kbstateapplet/images/cr22-action-hyperkey.png
Binary files differ
diff --git a/kbstateapplet/images/cr22-action-kbstate_mouse.png b/kbstateapplet/images/cr22-action-kbstate_mouse.png
new file mode 100644
index 0000000..fa62c4a
--- /dev/null
+++ b/kbstateapplet/images/cr22-action-kbstate_mouse.png
Binary files differ
diff --git a/kbstateapplet/images/cr22-action-kbstate_mouse_left.png b/kbstateapplet/images/cr22-action-kbstate_mouse_left.png
new file mode 100644
index 0000000..8068f76
--- /dev/null
+++ b/kbstateapplet/images/cr22-action-kbstate_mouse_left.png
Binary files differ
diff --git a/kbstateapplet/images/cr22-action-kbstate_mouse_left_selected.png b/kbstateapplet/images/cr22-action-kbstate_mouse_left_selected.png
new file mode 100644
index 0000000..d305816
--- /dev/null
+++ b/kbstateapplet/images/cr22-action-kbstate_mouse_left_selected.png
Binary files differ
diff --git a/kbstateapplet/images/cr22-action-kbstate_mouse_mid.png b/kbstateapplet/images/cr22-action-kbstate_mouse_mid.png
new file mode 100644
index 0000000..7cc9365
--- /dev/null
+++ b/kbstateapplet/images/cr22-action-kbstate_mouse_mid.png
Binary files differ
diff --git a/kbstateapplet/images/cr22-action-kbstate_mouse_mid_selected.png b/kbstateapplet/images/cr22-action-kbstate_mouse_mid_selected.png
new file mode 100644
index 0000000..ca10e56
--- /dev/null
+++ b/kbstateapplet/images/cr22-action-kbstate_mouse_mid_selected.png
Binary files differ
diff --git a/kbstateapplet/images/cr22-action-kbstate_mouse_right.png b/kbstateapplet/images/cr22-action-kbstate_mouse_right.png
new file mode 100644
index 0000000..3c8b806
--- /dev/null
+++ b/kbstateapplet/images/cr22-action-kbstate_mouse_right.png
Binary files differ
diff --git a/kbstateapplet/images/cr22-action-kbstate_mouse_right_selected.png b/kbstateapplet/images/cr22-action-kbstate_mouse_right_selected.png
new file mode 100644
index 0000000..eeedcfe
--- /dev/null
+++ b/kbstateapplet/images/cr22-action-kbstate_mouse_right_selected.png
Binary files differ
diff --git a/kbstateapplet/images/cr22-action-kbstate_slowkeys.png b/kbstateapplet/images/cr22-action-kbstate_slowkeys.png
new file mode 100644
index 0000000..6f3c784
--- /dev/null
+++ b/kbstateapplet/images/cr22-action-kbstate_slowkeys.png
Binary files differ
diff --git a/kbstateapplet/images/cr22-action-kbstate_stickykeys.png b/kbstateapplet/images/cr22-action-kbstate_stickykeys.png
new file mode 100644
index 0000000..8380024
--- /dev/null
+++ b/kbstateapplet/images/cr22-action-kbstate_stickykeys.png
Binary files differ
diff --git a/kbstateapplet/images/cr22-action-key.png b/kbstateapplet/images/cr22-action-key.png
new file mode 100644
index 0000000..8839538
--- /dev/null
+++ b/kbstateapplet/images/cr22-action-key.png
Binary files differ
diff --git a/kbstateapplet/images/cr22-action-keypressno.png b/kbstateapplet/images/cr22-action-keypressno.png
new file mode 100644
index 0000000..36e6c45
--- /dev/null
+++ b/kbstateapplet/images/cr22-action-keypressno.png
Binary files differ
diff --git a/kbstateapplet/images/cr22-action-keypressok.png b/kbstateapplet/images/cr22-action-keypressok.png
new file mode 100644
index 0000000..eb8bf1d
--- /dev/null
+++ b/kbstateapplet/images/cr22-action-keypressok.png
Binary files differ
diff --git a/kbstateapplet/images/cr22-action-lockkey.png b/kbstateapplet/images/cr22-action-lockkey.png
new file mode 100644
index 0000000..eab7fe8
--- /dev/null
+++ b/kbstateapplet/images/cr22-action-lockkey.png
Binary files differ
diff --git a/kbstateapplet/images/cr22-action-metakey.png b/kbstateapplet/images/cr22-action-metakey.png
new file mode 100644
index 0000000..7bb6091
--- /dev/null
+++ b/kbstateapplet/images/cr22-action-metakey.png
Binary files differ
diff --git a/kbstateapplet/images/cr22-action-shiftkey.png b/kbstateapplet/images/cr22-action-shiftkey.png
new file mode 100644
index 0000000..57728a4
--- /dev/null
+++ b/kbstateapplet/images/cr22-action-shiftkey.png
Binary files differ
diff --git a/kbstateapplet/images/cr22-action-superkey.png b/kbstateapplet/images/cr22-action-superkey.png
new file mode 100644
index 0000000..c281174
--- /dev/null
+++ b/kbstateapplet/images/cr22-action-superkey.png
Binary files differ
diff --git a/kbstateapplet/images/cr22-action-unlatched.png b/kbstateapplet/images/cr22-action-unlatched.png
new file mode 100644
index 0000000..8839538
--- /dev/null
+++ b/kbstateapplet/images/cr22-action-unlatched.png
Binary files differ
diff --git a/kbstateapplet/images/cr32-action-altkey.png b/kbstateapplet/images/cr32-action-altkey.png
new file mode 100644
index 0000000..a14311e
--- /dev/null
+++ b/kbstateapplet/images/cr32-action-altkey.png
Binary files differ
diff --git a/kbstateapplet/images/cr32-action-capskey.png b/kbstateapplet/images/cr32-action-capskey.png
new file mode 100644
index 0000000..ae9c16b
--- /dev/null
+++ b/kbstateapplet/images/cr32-action-capskey.png
Binary files differ
diff --git a/kbstateapplet/images/cr32-action-controlkey.png b/kbstateapplet/images/cr32-action-controlkey.png
new file mode 100644
index 0000000..34edc2b
--- /dev/null
+++ b/kbstateapplet/images/cr32-action-controlkey.png
Binary files differ
diff --git a/kbstateapplet/images/cr32-action-hyperkey.png b/kbstateapplet/images/cr32-action-hyperkey.png
new file mode 100644
index 0000000..12022e1
--- /dev/null
+++ b/kbstateapplet/images/cr32-action-hyperkey.png
Binary files differ
diff --git a/kbstateapplet/images/cr32-action-kbstate_mouse.png b/kbstateapplet/images/cr32-action-kbstate_mouse.png
new file mode 100644
index 0000000..7bb545f
--- /dev/null
+++ b/kbstateapplet/images/cr32-action-kbstate_mouse.png
Binary files differ
diff --git a/kbstateapplet/images/cr32-action-kbstate_mouse_left.png b/kbstateapplet/images/cr32-action-kbstate_mouse_left.png
new file mode 100644
index 0000000..1285dee
--- /dev/null
+++ b/kbstateapplet/images/cr32-action-kbstate_mouse_left.png
Binary files differ
diff --git a/kbstateapplet/images/cr32-action-kbstate_mouse_left_selected.png b/kbstateapplet/images/cr32-action-kbstate_mouse_left_selected.png
new file mode 100644
index 0000000..f14a894
--- /dev/null
+++ b/kbstateapplet/images/cr32-action-kbstate_mouse_left_selected.png
Binary files differ
diff --git a/kbstateapplet/images/cr32-action-kbstate_mouse_mid.png b/kbstateapplet/images/cr32-action-kbstate_mouse_mid.png
new file mode 100644
index 0000000..73e8d86
--- /dev/null
+++ b/kbstateapplet/images/cr32-action-kbstate_mouse_mid.png
Binary files differ
diff --git a/kbstateapplet/images/cr32-action-kbstate_mouse_mid_selected.png b/kbstateapplet/images/cr32-action-kbstate_mouse_mid_selected.png
new file mode 100644
index 0000000..1b7fa59
--- /dev/null
+++ b/kbstateapplet/images/cr32-action-kbstate_mouse_mid_selected.png
Binary files differ
diff --git a/kbstateapplet/images/cr32-action-kbstate_mouse_right.png b/kbstateapplet/images/cr32-action-kbstate_mouse_right.png
new file mode 100644
index 0000000..76da4bb
--- /dev/null
+++ b/kbstateapplet/images/cr32-action-kbstate_mouse_right.png
Binary files differ
diff --git a/kbstateapplet/images/cr32-action-kbstate_mouse_right_selected.png b/kbstateapplet/images/cr32-action-kbstate_mouse_right_selected.png
new file mode 100644
index 0000000..243f3f5
--- /dev/null
+++ b/kbstateapplet/images/cr32-action-kbstate_mouse_right_selected.png
Binary files differ
diff --git a/kbstateapplet/images/cr32-action-kbstate_slowkeys.png b/kbstateapplet/images/cr32-action-kbstate_slowkeys.png
new file mode 100644
index 0000000..4d898a0
--- /dev/null
+++ b/kbstateapplet/images/cr32-action-kbstate_slowkeys.png
Binary files differ
diff --git a/kbstateapplet/images/cr32-action-kbstate_stickykeys.png b/kbstateapplet/images/cr32-action-kbstate_stickykeys.png
new file mode 100644
index 0000000..765c27d
--- /dev/null
+++ b/kbstateapplet/images/cr32-action-kbstate_stickykeys.png
Binary files differ
diff --git a/kbstateapplet/images/cr32-action-key.png b/kbstateapplet/images/cr32-action-key.png
new file mode 100644
index 0000000..6e3cb09
--- /dev/null
+++ b/kbstateapplet/images/cr32-action-key.png
Binary files differ
diff --git a/kbstateapplet/images/cr32-action-keypressno.png b/kbstateapplet/images/cr32-action-keypressno.png
new file mode 100644
index 0000000..b227c56
--- /dev/null
+++ b/kbstateapplet/images/cr32-action-keypressno.png
Binary files differ
diff --git a/kbstateapplet/images/cr32-action-keypressok.png b/kbstateapplet/images/cr32-action-keypressok.png
new file mode 100644
index 0000000..75a1d77
--- /dev/null
+++ b/kbstateapplet/images/cr32-action-keypressok.png
Binary files differ
diff --git a/kbstateapplet/images/cr32-action-lockkey.png b/kbstateapplet/images/cr32-action-lockkey.png
new file mode 100644
index 0000000..f3b7bfb
--- /dev/null
+++ b/kbstateapplet/images/cr32-action-lockkey.png
Binary files differ
diff --git a/kbstateapplet/images/cr32-action-metakey.png b/kbstateapplet/images/cr32-action-metakey.png
new file mode 100644
index 0000000..3ab3ed8
--- /dev/null
+++ b/kbstateapplet/images/cr32-action-metakey.png
Binary files differ
diff --git a/kbstateapplet/images/cr32-action-shiftkey.png b/kbstateapplet/images/cr32-action-shiftkey.png
new file mode 100644
index 0000000..0f73f01
--- /dev/null
+++ b/kbstateapplet/images/cr32-action-shiftkey.png
Binary files differ
diff --git a/kbstateapplet/images/cr32-action-superkey.png b/kbstateapplet/images/cr32-action-superkey.png
new file mode 100644
index 0000000..fb3e9a9
--- /dev/null
+++ b/kbstateapplet/images/cr32-action-superkey.png
Binary files differ
diff --git a/kbstateapplet/images/cr32-action-unlatched.png b/kbstateapplet/images/cr32-action-unlatched.png
new file mode 100644
index 0000000..6e3cb09
--- /dev/null
+++ b/kbstateapplet/images/cr32-action-unlatched.png
Binary files differ
diff --git a/kbstateapplet/images/cr48-action-altkey.png b/kbstateapplet/images/cr48-action-altkey.png
new file mode 100644
index 0000000..109267f
--- /dev/null
+++ b/kbstateapplet/images/cr48-action-altkey.png
Binary files differ
diff --git a/kbstateapplet/images/cr48-action-capskey.png b/kbstateapplet/images/cr48-action-capskey.png
new file mode 100644
index 0000000..6418494
--- /dev/null
+++ b/kbstateapplet/images/cr48-action-capskey.png
Binary files differ
diff --git a/kbstateapplet/images/cr48-action-controlkey.png b/kbstateapplet/images/cr48-action-controlkey.png
new file mode 100644
index 0000000..6167b81
--- /dev/null
+++ b/kbstateapplet/images/cr48-action-controlkey.png
Binary files differ
diff --git a/kbstateapplet/images/cr48-action-hyperkey.png b/kbstateapplet/images/cr48-action-hyperkey.png
new file mode 100644
index 0000000..0e115a7
--- /dev/null
+++ b/kbstateapplet/images/cr48-action-hyperkey.png
Binary files differ
diff --git a/kbstateapplet/images/cr48-action-kbstate_mouse.png b/kbstateapplet/images/cr48-action-kbstate_mouse.png
new file mode 100644
index 0000000..30067fa
--- /dev/null
+++ b/kbstateapplet/images/cr48-action-kbstate_mouse.png
Binary files differ
diff --git a/kbstateapplet/images/cr48-action-kbstate_mouse_left.png b/kbstateapplet/images/cr48-action-kbstate_mouse_left.png
new file mode 100644
index 0000000..522e36a
--- /dev/null
+++ b/kbstateapplet/images/cr48-action-kbstate_mouse_left.png
Binary files differ
diff --git a/kbstateapplet/images/cr48-action-kbstate_mouse_left_selected.png b/kbstateapplet/images/cr48-action-kbstate_mouse_left_selected.png
new file mode 100644
index 0000000..e42fe28
--- /dev/null
+++ b/kbstateapplet/images/cr48-action-kbstate_mouse_left_selected.png
Binary files differ
diff --git a/kbstateapplet/images/cr48-action-kbstate_mouse_mid.png b/kbstateapplet/images/cr48-action-kbstate_mouse_mid.png
new file mode 100644
index 0000000..3119781
--- /dev/null
+++ b/kbstateapplet/images/cr48-action-kbstate_mouse_mid.png
Binary files differ
diff --git a/kbstateapplet/images/cr48-action-kbstate_mouse_mid_selected.png b/kbstateapplet/images/cr48-action-kbstate_mouse_mid_selected.png
new file mode 100644
index 0000000..511076c
--- /dev/null
+++ b/kbstateapplet/images/cr48-action-kbstate_mouse_mid_selected.png
Binary files differ
diff --git a/kbstateapplet/images/cr48-action-kbstate_mouse_right.png b/kbstateapplet/images/cr48-action-kbstate_mouse_right.png
new file mode 100644
index 0000000..d4bd834
--- /dev/null
+++ b/kbstateapplet/images/cr48-action-kbstate_mouse_right.png
Binary files differ
diff --git a/kbstateapplet/images/cr48-action-kbstate_mouse_right_selected.png b/kbstateapplet/images/cr48-action-kbstate_mouse_right_selected.png
new file mode 100644
index 0000000..b35029f
--- /dev/null
+++ b/kbstateapplet/images/cr48-action-kbstate_mouse_right_selected.png
Binary files differ
diff --git a/kbstateapplet/images/cr48-action-kbstate_slowkeys.png b/kbstateapplet/images/cr48-action-kbstate_slowkeys.png
new file mode 100644
index 0000000..6c707e0
--- /dev/null
+++ b/kbstateapplet/images/cr48-action-kbstate_slowkeys.png
Binary files differ
diff --git a/kbstateapplet/images/cr48-action-kbstate_stickykeys.png b/kbstateapplet/images/cr48-action-kbstate_stickykeys.png
new file mode 100644
index 0000000..3150fdf
--- /dev/null
+++ b/kbstateapplet/images/cr48-action-kbstate_stickykeys.png
Binary files differ
diff --git a/kbstateapplet/images/cr48-action-key.png b/kbstateapplet/images/cr48-action-key.png
new file mode 100644
index 0000000..91ffaf8
--- /dev/null
+++ b/kbstateapplet/images/cr48-action-key.png
Binary files differ
diff --git a/kbstateapplet/images/cr48-action-keypressno.png b/kbstateapplet/images/cr48-action-keypressno.png
new file mode 100644
index 0000000..6a27e01
--- /dev/null
+++ b/kbstateapplet/images/cr48-action-keypressno.png
Binary files differ
diff --git a/kbstateapplet/images/cr48-action-keypressok.png b/kbstateapplet/images/cr48-action-keypressok.png
new file mode 100644
index 0000000..3137bda
--- /dev/null
+++ b/kbstateapplet/images/cr48-action-keypressok.png
Binary files differ
diff --git a/kbstateapplet/images/cr48-action-lockkey.png b/kbstateapplet/images/cr48-action-lockkey.png
new file mode 100644
index 0000000..a149438
--- /dev/null
+++ b/kbstateapplet/images/cr48-action-lockkey.png
Binary files differ
diff --git a/kbstateapplet/images/cr48-action-metakey.png b/kbstateapplet/images/cr48-action-metakey.png
new file mode 100644
index 0000000..87b30fb
--- /dev/null
+++ b/kbstateapplet/images/cr48-action-metakey.png
Binary files differ
diff --git a/kbstateapplet/images/cr48-action-shiftkey.png b/kbstateapplet/images/cr48-action-shiftkey.png
new file mode 100644
index 0000000..9f35c0b
--- /dev/null
+++ b/kbstateapplet/images/cr48-action-shiftkey.png
Binary files differ
diff --git a/kbstateapplet/images/cr48-action-superkey.png b/kbstateapplet/images/cr48-action-superkey.png
new file mode 100644
index 0000000..e28d56a
--- /dev/null
+++ b/kbstateapplet/images/cr48-action-superkey.png
Binary files differ
diff --git a/kbstateapplet/images/cr48-action-unlatched.png b/kbstateapplet/images/cr48-action-unlatched.png
new file mode 100644
index 0000000..91ffaf8
--- /dev/null
+++ b/kbstateapplet/images/cr48-action-unlatched.png
Binary files differ
diff --git a/kbstateapplet/images/cr64-action-altkey.png b/kbstateapplet/images/cr64-action-altkey.png
new file mode 100644
index 0000000..2bc4fdf
--- /dev/null
+++ b/kbstateapplet/images/cr64-action-altkey.png
Binary files differ
diff --git a/kbstateapplet/images/cr64-action-capskey.png b/kbstateapplet/images/cr64-action-capskey.png
new file mode 100644
index 0000000..aeb8d37
--- /dev/null
+++ b/kbstateapplet/images/cr64-action-capskey.png
Binary files differ
diff --git a/kbstateapplet/images/cr64-action-controlkey.png b/kbstateapplet/images/cr64-action-controlkey.png
new file mode 100644
index 0000000..6474c9c
--- /dev/null
+++ b/kbstateapplet/images/cr64-action-controlkey.png
Binary files differ
diff --git a/kbstateapplet/images/cr64-action-hyperkey.png b/kbstateapplet/images/cr64-action-hyperkey.png
new file mode 100644
index 0000000..7d07b5d
--- /dev/null
+++ b/kbstateapplet/images/cr64-action-hyperkey.png
Binary files differ
diff --git a/kbstateapplet/images/cr64-action-kbstate_mouse.png b/kbstateapplet/images/cr64-action-kbstate_mouse.png
new file mode 100644
index 0000000..65c0bed
--- /dev/null
+++ b/kbstateapplet/images/cr64-action-kbstate_mouse.png
Binary files differ
diff --git a/kbstateapplet/images/cr64-action-kbstate_mouse_left.png b/kbstateapplet/images/cr64-action-kbstate_mouse_left.png
new file mode 100644
index 0000000..477a376
--- /dev/null
+++ b/kbstateapplet/images/cr64-action-kbstate_mouse_left.png
Binary files differ
diff --git a/kbstateapplet/images/cr64-action-kbstate_mouse_left_selected.png b/kbstateapplet/images/cr64-action-kbstate_mouse_left_selected.png
new file mode 100644
index 0000000..7238a43
--- /dev/null
+++ b/kbstateapplet/images/cr64-action-kbstate_mouse_left_selected.png
Binary files differ
diff --git a/kbstateapplet/images/cr64-action-kbstate_mouse_mid.png b/kbstateapplet/images/cr64-action-kbstate_mouse_mid.png
new file mode 100644
index 0000000..af48eac
--- /dev/null
+++ b/kbstateapplet/images/cr64-action-kbstate_mouse_mid.png
Binary files differ
diff --git a/kbstateapplet/images/cr64-action-kbstate_mouse_mid_selected.png b/kbstateapplet/images/cr64-action-kbstate_mouse_mid_selected.png
new file mode 100644
index 0000000..09090f6
--- /dev/null
+++ b/kbstateapplet/images/cr64-action-kbstate_mouse_mid_selected.png
Binary files differ
diff --git a/kbstateapplet/images/cr64-action-kbstate_mouse_right.png b/kbstateapplet/images/cr64-action-kbstate_mouse_right.png
new file mode 100644
index 0000000..9358126
--- /dev/null
+++ b/kbstateapplet/images/cr64-action-kbstate_mouse_right.png
Binary files differ
diff --git a/kbstateapplet/images/cr64-action-kbstate_mouse_right_selected.png b/kbstateapplet/images/cr64-action-kbstate_mouse_right_selected.png
new file mode 100644
index 0000000..6b89e7d
--- /dev/null
+++ b/kbstateapplet/images/cr64-action-kbstate_mouse_right_selected.png
Binary files differ
diff --git a/kbstateapplet/images/cr64-action-kbstate_slowkeys.png b/kbstateapplet/images/cr64-action-kbstate_slowkeys.png
new file mode 100644
index 0000000..737fb13
--- /dev/null
+++ b/kbstateapplet/images/cr64-action-kbstate_slowkeys.png
Binary files differ
diff --git a/kbstateapplet/images/cr64-action-kbstate_stickykeys.png b/kbstateapplet/images/cr64-action-kbstate_stickykeys.png
new file mode 100644
index 0000000..4b705d7
--- /dev/null
+++ b/kbstateapplet/images/cr64-action-kbstate_stickykeys.png
Binary files differ
diff --git a/kbstateapplet/images/cr64-action-key.png b/kbstateapplet/images/cr64-action-key.png
new file mode 100644
index 0000000..0858c19
--- /dev/null
+++ b/kbstateapplet/images/cr64-action-key.png
Binary files differ
diff --git a/kbstateapplet/images/cr64-action-keypressno.png b/kbstateapplet/images/cr64-action-keypressno.png
new file mode 100644
index 0000000..c8abb2f
--- /dev/null
+++ b/kbstateapplet/images/cr64-action-keypressno.png
Binary files differ
diff --git a/kbstateapplet/images/cr64-action-keypressok.png b/kbstateapplet/images/cr64-action-keypressok.png
new file mode 100644
index 0000000..04af637
--- /dev/null
+++ b/kbstateapplet/images/cr64-action-keypressok.png
Binary files differ
diff --git a/kbstateapplet/images/cr64-action-lockkey.png b/kbstateapplet/images/cr64-action-lockkey.png
new file mode 100644
index 0000000..66f92c2
--- /dev/null
+++ b/kbstateapplet/images/cr64-action-lockkey.png
Binary files differ
diff --git a/kbstateapplet/images/cr64-action-metakey.png b/kbstateapplet/images/cr64-action-metakey.png
new file mode 100644
index 0000000..d862c94
--- /dev/null
+++ b/kbstateapplet/images/cr64-action-metakey.png
Binary files differ
diff --git a/kbstateapplet/images/cr64-action-shiftkey.png b/kbstateapplet/images/cr64-action-shiftkey.png
new file mode 100644
index 0000000..93fe232
--- /dev/null
+++ b/kbstateapplet/images/cr64-action-shiftkey.png
Binary files differ
diff --git a/kbstateapplet/images/cr64-action-superkey.png b/kbstateapplet/images/cr64-action-superkey.png
new file mode 100644
index 0000000..2c80b3b
--- /dev/null
+++ b/kbstateapplet/images/cr64-action-superkey.png
Binary files differ
diff --git a/kbstateapplet/images/cr64-action-unlatched.png b/kbstateapplet/images/cr64-action-unlatched.png
new file mode 100644
index 0000000..0858c19
--- /dev/null
+++ b/kbstateapplet/images/cr64-action-unlatched.png
Binary files differ
diff --git a/kbstateapplet/images/crsc-action-altkey.svg b/kbstateapplet/images/crsc-action-altkey.svg
new file mode 100644
index 0000000..237120c
--- /dev/null
+++ b/kbstateapplet/images/crsc-action-altkey.svg
@@ -0,0 +1,7 @@
+<?xml version="1.0" encoding="UTF-8" standalone="no"?>
+<!DOCTYPE svg PUBLIC "-//W3C//DTD SVG 20010904//EN"
+"http://www.w3.org/TR/2001/REC-SVG-20010904/DTD/svg10.dtd">
+<svg width="64" height="64">
+ <path style="fill:none;stroke:#808080;stroke-width:2;"
+ d="M 14 50 L 50 50 " />
+</svg>
diff --git a/kbstateapplet/images/crsc-action-capskey.svg b/kbstateapplet/images/crsc-action-capskey.svg
new file mode 100644
index 0000000..35a5abe
--- /dev/null
+++ b/kbstateapplet/images/crsc-action-capskey.svg
@@ -0,0 +1,7 @@
+<?xml version="1.0" encoding="UTF-8" standalone="no"?>
+<!DOCTYPE svg PUBLIC "-//W3C//DTD SVG 20010904//EN"
+"http://www.w3.org/TR/2001/REC-SVG-20010904/DTD/svg10.dtd">
+<svg width="64" height="64">
+ <path style="fill:none;stroke:#808080;stroke-width:2;"
+ d="M 32 50 L 14 32 L 24 32 L 24 14 L 40 14 L 40 32 L 50 32 L 32 50 z " />
+</svg>
diff --git a/kbstateapplet/images/crsc-action-controlkey.svg b/kbstateapplet/images/crsc-action-controlkey.svg
new file mode 100644
index 0000000..1adda99
--- /dev/null
+++ b/kbstateapplet/images/crsc-action-controlkey.svg
@@ -0,0 +1,7 @@
+<?xml version="1.0" encoding="UTF-8" standalone="no"?>
+<!DOCTYPE svg PUBLIC "-//W3C//DTD SVG 20010904//EN"
+"http://www.w3.org/TR/2001/REC-SVG-20010904/DTD/svg10.dtd">
+<svg width="64" height="64">
+ <path style="fill:none;stroke:#808080;stroke-width:2;"
+ d="M 14 32 L 32 14 L 50 32 " />
+</svg>
diff --git a/kbstateapplet/images/crsc-action-hyperkey.svg b/kbstateapplet/images/crsc-action-hyperkey.svg
new file mode 100644
index 0000000..dee8c43
--- /dev/null
+++ b/kbstateapplet/images/crsc-action-hyperkey.svg
@@ -0,0 +1,11 @@
+<?xml version="1.0" encoding="UTF-8" standalone="no"?>
+<!DOCTYPE svg PUBLIC "-//W3C//DTD SVG 20010904//EN"
+"http://www.w3.org/TR/2001/REC-SVG-20010904/DTD/svg10.dtd">
+<svg width="64" height="64">
+ <path style="fill:none;stroke:#808080;stroke-width:2;"
+ d="M 14 14 L 50 14 " />
+ <path style="fill:none;stroke:#808080;stroke-width:2;"
+ d="M 14 32 L 50 32 " />
+ <path style="fill:none;stroke:#808080;stroke-width:2;"
+ d="M 14 50 L 50 50 " />
+</svg>
diff --git a/kbstateapplet/images/crsc-action-kbstate_mouse.svg b/kbstateapplet/images/crsc-action-kbstate_mouse.svg
new file mode 100644
index 0000000..fc20b85
--- /dev/null
+++ b/kbstateapplet/images/crsc-action-kbstate_mouse.svg
@@ -0,0 +1,13 @@
+<?xml version="1.0" encoding="UTF-8" standalone="no"?>
+<!DOCTYPE svg PUBLIC "-//W3C//DTD SVG 20010904//EN"
+"http://www.w3.org/TR/2001/REC-SVG-20010904/DTD/svg10.dtd">
+<svg height="64" width="64">
+ <path style="fill:none;stroke:#808080;stroke-width:2;"
+ d="M 13,31 L 13,32 C 13,46 21,50 22,51 L 42,51 C 42,51 51,46 51,32 L 51,31 L 39,29 L 25,29 L 13,31 z " />
+ <path style="fill:none;stroke:#808080;stroke-width:2;"
+ d="M 13,31 L 13,15 L 25,13 L 25,29 L 13,31 z " />
+ <path style="fill:none;stroke:#808080;stroke-width:2;"
+ d="M 25,29 L 25,13 L 39,13 L 39,29 L 25,29 z " />
+ <path style="fill:none;stroke:#808080;stroke-width:2;"
+ d="M 39,29 L 39,13 L 51,15 L 51,31 L 39,29 z " />
+</svg>
diff --git a/kbstateapplet/images/crsc-action-kbstate_mouse_left.svg b/kbstateapplet/images/crsc-action-kbstate_mouse_left.svg
new file mode 100644
index 0000000..52bffea
--- /dev/null
+++ b/kbstateapplet/images/crsc-action-kbstate_mouse_left.svg
@@ -0,0 +1,7 @@
+<?xml version="1.0" encoding="UTF-8" standalone="no"?>
+<!DOCTYPE svg PUBLIC "-//W3C//DTD SVG 20010904//EN"
+"http://www.w3.org/TR/2001/REC-SVG-20010904/DTD/svg10.dtd">
+<svg height="64" width="64">
+ <path style="fill:#808080;stroke:#808080;stroke-width:2"
+ d="M 21 23 A 2 2 0 1 1 17,23 A 2 2 0 1 1 21 23 z" />
+</svg>
diff --git a/kbstateapplet/images/crsc-action-kbstate_mouse_left_selected.svg b/kbstateapplet/images/crsc-action-kbstate_mouse_left_selected.svg
new file mode 100644
index 0000000..c98a3a7
--- /dev/null
+++ b/kbstateapplet/images/crsc-action-kbstate_mouse_left_selected.svg
@@ -0,0 +1,7 @@
+<?xml version="1.0" encoding="UTF-8" standalone="no"?>
+<!DOCTYPE svg PUBLIC "-//W3C//DTD SVG 20010904//EN"
+"http://www.w3.org/TR/2001/REC-SVG-20010904/DTD/svg10.dtd">
+<svg height="64" width="64">
+ <path style="fill:#808080;stroke:#808080;stroke-width:2"
+ d="M 13,31 L 13,15 L 25,13 L 25,29 L 13,31 z " />
+</svg>
diff --git a/kbstateapplet/images/crsc-action-kbstate_mouse_mid.svg b/kbstateapplet/images/crsc-action-kbstate_mouse_mid.svg
new file mode 100644
index 0000000..9080915
--- /dev/null
+++ b/kbstateapplet/images/crsc-action-kbstate_mouse_mid.svg
@@ -0,0 +1,7 @@
+<?xml version="1.0" encoding="UTF-8" standalone="no"?>
+<!DOCTYPE svg PUBLIC "-//W3C//DTD SVG 20010904//EN"
+"http://www.w3.org/TR/2001/REC-SVG-20010904/DTD/svg10.dtd">
+<svg height="64" width="64">
+ <path style="fill:#808080;stroke:#808080;stroke-width:2"
+ d="M 34 21 A 2 2 0 1 1 30,21 A 2 2 0 1 1 34 21 z" />
+</svg>
diff --git a/kbstateapplet/images/crsc-action-kbstate_mouse_mid_selected.svg b/kbstateapplet/images/crsc-action-kbstate_mouse_mid_selected.svg
new file mode 100644
index 0000000..4c0bf2b
--- /dev/null
+++ b/kbstateapplet/images/crsc-action-kbstate_mouse_mid_selected.svg
@@ -0,0 +1,7 @@
+<?xml version="1.0" encoding="UTF-8" standalone="no"?>
+<!DOCTYPE svg PUBLIC "-//W3C//DTD SVG 20010904//EN"
+"http://www.w3.org/TR/2001/REC-SVG-20010904/DTD/svg10.dtd">
+<svg height="64" width="64">
+ <path style="fill:#808080;stroke:#808080;stroke-width:2"
+ d="M 25,29 L 25,13 L 39,13 L 39,29 L 25,29 z " />
+</svg>
diff --git a/kbstateapplet/images/crsc-action-kbstate_mouse_right.svg b/kbstateapplet/images/crsc-action-kbstate_mouse_right.svg
new file mode 100644
index 0000000..652c3d7
--- /dev/null
+++ b/kbstateapplet/images/crsc-action-kbstate_mouse_right.svg
@@ -0,0 +1,7 @@
+<?xml version="1.0" encoding="UTF-8" standalone="no"?>
+<!DOCTYPE svg PUBLIC "-//W3C//DTD SVG 20010904//EN"
+"http://www.w3.org/TR/2001/REC-SVG-20010904/DTD/svg10.dtd">
+<svg height="64" width="64">
+ <path style="fill:#808080;stroke:#808080;stroke-width:2;"
+ d="M 47 23 A 2 2 0 1 1 43,23 A 2 2 0 1 1 47 23 z" />
+</svg>
diff --git a/kbstateapplet/images/crsc-action-kbstate_mouse_right_selected.svg b/kbstateapplet/images/crsc-action-kbstate_mouse_right_selected.svg
new file mode 100644
index 0000000..2d890fd
--- /dev/null
+++ b/kbstateapplet/images/crsc-action-kbstate_mouse_right_selected.svg
@@ -0,0 +1,7 @@
+<?xml version="1.0" encoding="UTF-8" standalone="no"?>
+<!DOCTYPE svg PUBLIC "-//W3C//DTD SVG 20010904//EN"
+"http://www.w3.org/TR/2001/REC-SVG-20010904/DTD/svg10.dtd">
+<svg height="64" width="64">
+ <path style="fill:#808080;stroke:#808080;stroke-width:2"
+ d="M 39,29 L 39,13 L 51,15 L 51,31 L 39,29 z " />
+</svg>
diff --git a/kbstateapplet/images/crsc-action-kbstate_slowkeys.svg b/kbstateapplet/images/crsc-action-kbstate_slowkeys.svg
new file mode 100644
index 0000000..bfff429
--- /dev/null
+++ b/kbstateapplet/images/crsc-action-kbstate_slowkeys.svg
@@ -0,0 +1,9 @@
+<?xml version="1.0" encoding="UTF-8" standalone="no"?>
+<!DOCTYPE svg PUBLIC "-//W3C//DTD SVG 20010904//EN"
+"http://www.w3.org/TR/2001/REC-SVG-20010904/DTD/svg10.dtd">
+<svg height="64" width="64">
+ <path style="fill:none;stroke:#808080;stroke-width:2;"
+ d="M 53 33 A 20 20 0 1 1 13,33 A 20 20 0 1 1 53 33 z" />
+ <path style="fill:none;stroke:#808080;stroke-width:2;"
+ d="M 33,16 L 33,33 L 46,33" />
+</svg>
diff --git a/kbstateapplet/images/crsc-action-kbstate_stickykeys.svg b/kbstateapplet/images/crsc-action-kbstate_stickykeys.svg
new file mode 100644
index 0000000..9d9c2dc
--- /dev/null
+++ b/kbstateapplet/images/crsc-action-kbstate_stickykeys.svg
@@ -0,0 +1,9 @@
+<?xml version="1.0" encoding="UTF-8" standalone="no"?>
+<!DOCTYPE svg PUBLIC "-//W3C//DTD SVG 20010904//EN"
+"http://www.w3.org/TR/2001/REC-SVG-20010904/DTD/svg10.dtd">
+<svg height="64" width="64">
+ <path style="fill:none;stroke:#808080;stroke-width:2;"
+ d="M 14 32 L 32 50 L 50 32 " />
+ <path style="fill:none;stroke:#808080;stroke-width:2;"
+ d="M 32,14 L 32,50" />
+</svg>
diff --git a/kbstateapplet/images/crsc-action-key.svg b/kbstateapplet/images/crsc-action-key.svg
new file mode 100644
index 0000000..644dca1
--- /dev/null
+++ b/kbstateapplet/images/crsc-action-key.svg
@@ -0,0 +1,5 @@
+<?xml version="1.0" encoding="UTF-8" standalone="no"?>
+<!DOCTYPE svg PUBLIC "-//W3C//DTD SVG 20010904//EN"
+"http://www.w3.org/TR/2001/REC-SVG-20010904/DTD/svg10.dtd">
+<svg width="64" height="64">
+</svg>
diff --git a/kbstateapplet/images/crsc-action-keypressno.svg b/kbstateapplet/images/crsc-action-keypressno.svg
new file mode 100644
index 0000000..e59b782
--- /dev/null
+++ b/kbstateapplet/images/crsc-action-keypressno.svg
@@ -0,0 +1,9 @@
+<?xml version="1.0" encoding="UTF-8" standalone="no"?>
+<!DOCTYPE svg PUBLIC "-//W3C//DTD SVG 20010904//EN"
+"http://www.w3.org/TR/2001/REC-SVG-20010904/DTD/svg10.dtd">
+<svg width="64" height="64">
+ <path style="fill:none;stroke:#ff0000;stroke-width:4;"
+ d="M 25 25 L 55 55 " />
+ <path style="fill:none;stroke:#ff0000;stroke-width:4;"
+ d="M 25 55 L 55 25 " />
+</svg>
diff --git a/kbstateapplet/images/crsc-action-keypressok.svg b/kbstateapplet/images/crsc-action-keypressok.svg
new file mode 100644
index 0000000..7ae244d
--- /dev/null
+++ b/kbstateapplet/images/crsc-action-keypressok.svg
@@ -0,0 +1,7 @@
+<?xml version="1.0" encoding="UTF-8" standalone="no"?>
+<!DOCTYPE svg PUBLIC "-//W3C//DTD SVG 20010904//EN"
+"http://www.w3.org/TR/2001/REC-SVG-20010904/DTD/svg10.dtd">
+<svg width="64" height="64">
+ <path style="fill:#00ff00;stroke:#00c000;stroke-width:2;"
+ d="M 14 31 L 23 55 L 55 22 L 25 42 L 14 31 z " />
+</svg>
diff --git a/kbstateapplet/images/crsc-action-lockkey.svg b/kbstateapplet/images/crsc-action-lockkey.svg
new file mode 100644
index 0000000..9611a09
--- /dev/null
+++ b/kbstateapplet/images/crsc-action-lockkey.svg
@@ -0,0 +1,7 @@
+<?xml version="1.0" encoding="UTF-8" standalone="no"?>
+<!DOCTYPE svg PUBLIC "-//W3C//DTD SVG 20010904//EN"
+"http://www.w3.org/TR/2001/REC-SVG-20010904/DTD/svg10.dtd">
+<svg width="64" height="64">
+ <path style="fill:none;stroke:#808080;stroke-width:2;"
+ d="M 32 50 L 22 40 L 28 40 L 28 30 L 36 30 L 36 40 L 42 40 L 32 50 z " />
+</svg>
diff --git a/kbstateapplet/images/crsc-action-metakey.svg b/kbstateapplet/images/crsc-action-metakey.svg
new file mode 100644
index 0000000..49e07ad
--- /dev/null
+++ b/kbstateapplet/images/crsc-action-metakey.svg
@@ -0,0 +1,7 @@
+<?xml version="1.0" encoding="UTF-8" standalone="no"?>
+<!DOCTYPE svg PUBLIC "-//W3C//DTD SVG 20010904//EN"
+"http://www.w3.org/TR/2001/REC-SVG-20010904/DTD/svg10.dtd">
+<svg width="64" height="64">
+ <path style="fill:#000000;stroke:#808080;stroke-width:2;"
+ d="M 32 14 L 14 32 L 32 50 L 50 32 L 32 14 z " />
+</svg>
diff --git a/kbstateapplet/images/crsc-action-shiftkey.svg b/kbstateapplet/images/crsc-action-shiftkey.svg
new file mode 100644
index 0000000..8ec78c9
--- /dev/null
+++ b/kbstateapplet/images/crsc-action-shiftkey.svg
@@ -0,0 +1,7 @@
+<?xml version="1.0" encoding="UTF-8" standalone="no"?>
+<!DOCTYPE svg PUBLIC "-//W3C//DTD SVG 20010904//EN"
+"http://www.w3.org/TR/2001/REC-SVG-20010904/DTD/svg10.dtd">
+<svg width="64" height="64">
+ <path style="fill:none;stroke:#808080;stroke-width:2;"
+ d="M 32 14 L 14 32 L 24 32 L 24 50 L 40 50 L 40 32 L 50 32 L 32 14 z " />
+</svg>
diff --git a/kbstateapplet/images/crsc-action-superkey.svg b/kbstateapplet/images/crsc-action-superkey.svg
new file mode 100644
index 0000000..c0f6e58
--- /dev/null
+++ b/kbstateapplet/images/crsc-action-superkey.svg
@@ -0,0 +1,17 @@
+<?xml version="1.0" encoding="UTF-8" standalone="no"?>
+<!DOCTYPE svg PUBLIC "-//W3C//DTD SVG 20010904//EN"
+"http://www.w3.org/TR/2001/REC-SVG-20010904/DTD/svg10.dtd">
+<svg width="64" height="64">
+ <path style="fill:none;stroke:#808080;stroke-width:2;"
+ d="M 14 14 L 50 14 " />
+ <path style="fill:none;stroke:#808080;stroke-width:2;"
+ d="M 14 32 L 50 32 " />
+ <path style="fill:none;stroke:#808080;stroke-width:2;"
+ d="M 14 50 L 50 50 " />
+ <path style="fill:none;stroke:#808080;stroke-width:2;"
+ d="M 14 14 L 14 50 " />
+ <path style="fill:none;stroke:#808080;stroke-width:2;"
+ d="M 32 14 L 32 50 " />
+ <path style="fill:none;stroke:#808080;stroke-width:2;"
+ d="M 50 14 L 50 50 " />
+</svg>
diff --git a/kbstateapplet/images/crsc-action-unlatched.svg b/kbstateapplet/images/crsc-action-unlatched.svg
new file mode 100644
index 0000000..644dca1
--- /dev/null
+++ b/kbstateapplet/images/crsc-action-unlatched.svg
@@ -0,0 +1,5 @@
+<?xml version="1.0" encoding="UTF-8" standalone="no"?>
+<!DOCTYPE svg PUBLIC "-//W3C//DTD SVG 20010904//EN"
+"http://www.w3.org/TR/2001/REC-SVG-20010904/DTD/svg10.dtd">
+<svg width="64" height="64">
+</svg>
diff --git a/kbstateapplet/kbstate.cpp b/kbstateapplet/kbstate.cpp
new file mode 100644
index 0000000..05ee26a
--- /dev/null
+++ b/kbstateapplet/kbstate.cpp
@@ -0,0 +1,1079 @@
+/*
+ * Copyright (c) 2004 Gunnar Schmi Dt <gunnar@schmi-dt.de>
+ *
+ * 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
+ */
+
+#include <qpainter.h>
+#include <qtooltip.h>
+#include <qdrawutil.h>
+#include <qcursor.h>
+#include <qimage.h>
+#include <qpopupmenu.h>
+
+#include <kaboutapplication.h>
+#include <kpopupmenu.h>
+#include <kaboutdata.h>
+#include <klocale.h>
+#include <kglobal.h>
+#include <kglobalsettings.h>
+#include <kapplication.h>
+#include <kiconloader.h>
+#include <kiconeffect.h>
+#include <knotifyclient.h>
+#include <kshortcut.h>
+#include <kkeynative.h>
+#include <kdemacros.h>
+#include <kprocess.h>
+#include "kdeexportfix.h"
+#include "kbstate.h"
+#include "kbstate.moc"
+
+extern "C"
+{
+#include <X11/Xlib.h>
+#include <X11/Xutil.h>
+#include <X11/XKBlib.h>
+#define XK_MISCELLANY
+#define XK_XKB_KEYS
+#include <X11/keysymdef.h>
+#include <X11/extensions/XKB.h>
+
+ KDE_EXPORT KPanelApplet* init(QWidget *parent, const QString& configFile)
+ {
+ KGlobal::locale()->insertCatalogue("kbstateapplet");
+ KbStateApplet *applet = new KbStateApplet(configFile, KPanelApplet::Normal, KPanelApplet::About, parent, "kbstateapplet");
+ return applet;
+ }
+}
+
+struct ModifierKey {
+ const unsigned int mask;
+ const KeySym keysym;
+ const char *name;
+ const char *icon;
+ const char *text;
+ const bool isModifier;
+};
+
+static ModifierKey modifierKeys[] = {
+ { ShiftMask, 0, I18N_NOOP("Shift"), "shiftkey", "", true },
+ { ControlMask, 0, I18N_NOOP("Control"), "controlkey", "", true },
+ { 0, XK_Alt_L, I18N_NOOP("Alt"), "altkey", "", true },
+ { 0, 0, I18N_NOOP("Win"), "superkey", "", true },
+ { 0, XK_Meta_L, I18N_NOOP("Meta"), "metakey", "", true },
+ { 0, XK_Super_L, I18N_NOOP("Super"), "superkey", "", true },
+ { 0, XK_Hyper_L, I18N_NOOP("Hyper"), "hyperkey", "", true },
+ { 0, 0, I18N_NOOP("Alt Graph"), "", I18N_NOOP("æ"), true },
+ { 0, XK_Num_Lock, I18N_NOOP("Num Lock"), "lockkey", I18N_NOOP("Num"), false },
+ { LockMask, 0, I18N_NOOP("Caps Lock"), "capskey", "", false },
+ { 0, XK_Scroll_Lock, I18N_NOOP("Scroll Lock"), "lockkey", I18N_NOOP("Scroll"), false },
+ { 0, 0, "", "", "", false }
+};
+
+
+/********************************************************************/
+
+KbStateApplet::KbStateApplet(const QString& configFile, Type t, int actions,
+ QWidget *parent, const char *name)
+ : KPanelApplet( configFile, t, actions, parent, name )
+{
+ for (int i = 0; i < 8; i++) {
+ icons[i] = 0;
+ }
+ instance = new KInstance ("kbstateapplet");
+ loadConfig();
+ initMasks();
+ mouse = new MouseIcon (instance, this, "mouse");
+ sticky = new TimeoutIcon (instance, "", "kbstate_stickykeys", this, "sticky");
+ slow = new TimeoutIcon (instance, "", "kbstate_slowkeys", this, "slow");
+ bounce = new TimeoutIcon (instance, "", "", this, "bounce");
+
+ xkb = XkbGetMap(qt_xdisplay(), 0, XkbUseCoreKbd);
+
+ if (xkb != 0) {
+ XkbGetControls (qt_xdisplay(), XkbAllControlsMask, xkb);
+ if (xkb->ctrls != 0)
+ accessxFeatures = xkb->ctrls->enabled_ctrls;
+ else
+ accessxFeatures = 0;
+ }
+ else
+ accessxFeatures = 0;
+
+ //startTimer(100); // ten times a second
+ connect(kapp, SIGNAL(kdisplayPaletteChanged()), SLOT(paletteChanged()));
+
+ kapp->installX11EventFilter (this);
+ int opcode_rtn, error_rtn;
+ XkbQueryExtension (this->x11Display(), &opcode_rtn, &xkb_base_event_type, &error_rtn, NULL, NULL);
+ XkbSelectEvents (this->x11Display(), XkbUseCoreKbd, XkbAllEventsMask,
+ XkbAllEventsMask);
+
+ buildPopupMenu();
+}
+
+KbStateApplet::~KbStateApplet() {
+ kapp->removeX11EventFilter (this);
+ setCustomMenu(0);
+ delete instance;
+ delete popup;
+ delete sizePopup;
+}
+// Builds, connects _popup menu
+void KbStateApplet::buildPopupMenu()
+{
+ sizePopup=new KPopupMenu(this);
+ sizePopup->setCheckable( true );
+ sizePopup->insertItem(i18n("Small"), 13);
+ sizePopup->insertItem(i18n("Medium"), 20);
+ sizePopup->insertItem(i18n("Large"), 26);
+ connect(sizePopup,SIGNAL(activated(int)), this, SLOT(setIconDim(int)));
+
+ showPopup=new KPopupMenu(this);
+ showPopup->setCheckable( true );
+ modifierItem=showPopup->insertItem(i18n("Modifier Keys"), this, SLOT(toggleModifier()));
+ lockkeysItem=showPopup->insertItem(i18n("Lock Keys"), this, SLOT(toggleLockkeys()));
+ mouseItem=showPopup->insertItem(i18n("Mouse Status"), this, SLOT(toggleMouse()));
+ accessxItem=showPopup->insertItem(i18n("AccessX Status"), this, SLOT(toggleAccessX()));
+
+ popup = new KPopupMenu(this);
+ popup->setCheckable( true );
+ popup->insertTitle(0, i18n("Keyboard Status Applet"));
+ popup->insertItem(i18n("Set Icon Size"),sizePopup);
+ fillSpaceItem = popup->insertItem(i18n("Fill Available Space"),
+ this, SLOT(toggleFillSpace()));
+ popup->insertItem(i18n("Show"),showPopup);
+ popup->insertItem(i18n("Configure AccessX Features..."), this, SLOT(configureAccessX()));
+ popup->insertItem(i18n("Configure Keyboard..."), this, SLOT(configureKeyboard()));
+ popup->insertItem(i18n("Configure Mouse..."), this, SLOT(configureMouse()));
+ popup->insertSeparator();
+ popup->insertItem(i18n("About"), this, SLOT(about()));
+ setCustomMenu(popup);
+ updateMenu();
+}
+
+void KbStateApplet::updateMenu()
+{ if (popup) {
+ showPopup->setItemChecked (modifierItem, showModifiers);
+ showPopup->setItemChecked (lockkeysItem, showLockkeys);
+ showPopup->setItemChecked (mouseItem, showMouse);
+ showPopup->setItemChecked (accessxItem, showAccessX);
+ popup->setItemChecked (fillSpaceItem, fillSpace);
+ sizePopup->setItemChecked(13, size == 13);
+ sizePopup->setItemChecked(20, size == 20);
+ sizePopup->setItemChecked(26, size == 26);
+ }
+}
+
+void calculateSizes (int space, int modifiers, int lockkeys, int accessx,
+ bool showMouse, int &lines, int &length, int &size)
+// Calculates the layout based on a given number of modifiers, lockkeys and
+// accessx features.
+// Output:
+// lines: number of lines
+// length: number of icons per line
+// size: size of the icons
+{
+ // Calculate lines and length
+ if (showMouse)
+ ++accessx;
+
+ lines = space>=size ? space/size : 1;
+ length = modifiers + lockkeys + accessx;
+
+ if (length > 0 && lines >= 2) {
+ length = (length + lines-1)/lines;
+
+ // As we want to have some line breaks, we need to do some corrections:
+ // Calculate the number of lines that are really needed:
+ int linesNeeded = (modifiers+length-1)/length + (lockkeys+length-1)/length;
+ int tmp1 = modifiers%length == 0 ? 0 : length - modifiers%length;
+ int tmp2 = lockkeys%length == 0 ? 0 : length - lockkeys%length;
+ if ((tmp1 + tmp2) < accessx)
+ linesNeeded = (modifiers+lockkeys+accessx + length-1)/length;
+
+ // If we need more lines than we have, try with more icons per line:
+ while (linesNeeded > lines) {
+ length++;
+ linesNeeded = (modifiers+length-1)/length + (lockkeys+length-1)/length;
+ int tmp1 = modifiers%length == 0 ? 0 : length - modifiers%length;
+ int tmp2 = lockkeys%length == 0 ? 0 : length - lockkeys%length;
+ if ((tmp1 + tmp2) < accessx)
+ linesNeeded = (modifiers+lockkeys+accessx + length-1)/length;
+ }
+ lines = linesNeeded;
+ }
+}
+
+int KbStateApplet::widthForHeight(int h) const {
+ int lines, length;
+ int size = this->size;
+
+ int accessx = 0;
+ if ((accessxFeatures & XkbStickyKeysMask) != 0)
+ accessx++;
+ if ((accessxFeatures & XkbSlowKeysMask) != 0)
+ accessx++;
+ if ((accessxFeatures & XkbBounceKeysMask) != 0)
+ accessx++;
+
+ calculateSizes (h, showModifiers?modifiers.count():0,
+ showLockkeys?lockkeys.count():0,
+ showAccessX?accessx:0,
+ showMouse, lines, length, size);
+
+ if (fillSpace)
+ size = h/lines;
+
+ return length*size;
+}
+
+int KbStateApplet::heightForWidth(int w) const {
+ int lines, length;
+ int size = this->size;
+
+ int accessx = 0;
+ if ((accessxFeatures & XkbStickyKeysMask) != 0)
+ accessx++;
+ if ((accessxFeatures & XkbSlowKeysMask) != 0)
+ accessx++;
+ if ((accessxFeatures & XkbBounceKeysMask) != 0)
+ accessx++;
+
+ calculateSizes (w, showModifiers?modifiers.count():0,
+ showLockkeys?lockkeys.count():0,
+ showAccessX?accessx:0,
+ showMouse, lines, length, size);
+
+ if (fillSpace)
+ size = w/lines;
+
+ return length*size;
+}
+
+void KbStateApplet::mousePressEvent(QMouseEvent *e) {
+ if (e->button() == RightButton)
+ popup->popup(e->globalPos());
+}
+
+void KbStateApplet::setIconDim (int size) {
+ this->size = size;
+ saveConfig();
+ updateMenu();
+ update();
+ updateGeometry();
+ emit updateLayout();
+}
+
+void KbStateApplet::toggleFillSpace() {
+ fillSpace = !fillSpace;
+ saveConfig();
+ updateMenu();
+ layout();
+ updateGeometry();
+ emit updateLayout();
+}
+
+void KbStateApplet::resizeEvent( QResizeEvent*e ) {
+ QWidget::resizeEvent(e);
+ layout();
+}
+
+void KbStateApplet::layout() {
+ int size = this->size;
+
+ int lines, length, x,y,dx,dy, ldx,ldy;
+ int modifierCount = showModifiers?modifiers.count():0;
+ int lockkeyCount = showLockkeys?lockkeys.count():0;
+ int accessxCount = 0;
+
+ if (showAccessX) {
+ if ((accessxFeatures & XkbStickyKeysMask) != 0)
+ accessxCount++;
+ if ((accessxFeatures & XkbSlowKeysMask) != 0)
+ accessxCount++;
+ if ((accessxFeatures & XkbBounceKeysMask) != 0)
+ accessxCount++;
+ }
+
+ if (orientation() == Vertical) {
+ calculateSizes (width(), modifierCount, lockkeyCount, accessxCount,
+ showMouse, lines, length, size);
+
+ if (fillSpace)
+ size = width()/lines;
+
+ x = (width()-lines*size)/2;
+ y = 0;
+ dx = 0;
+ dy = size;
+ ldx= size;
+ ldy= 0;
+ }
+ else {
+ calculateSizes (height(), modifierCount, lockkeyCount, accessxCount,
+ showMouse, lines, length, size);
+
+ if (fillSpace)
+ size = height()/lines;
+
+ x = 0;
+ y = (height()-lines*size)/2;
+ dx = size;
+ dy = 0;
+ ldx= 0;
+ ldy= size;
+ }
+
+ StatusIcon *icon;
+ int item = 1;
+ for (icon = modifiers.first(); icon; icon = modifiers.next()) {
+ if (showModifiers) {
+ icon->setGeometry (x, y, size, size);
+ icon->show();
+ icon->update();
+ item++; x+=dx; y+=dy;
+ if (item > length) {
+ x = x - length*dx + ldx;
+ y = y - length*dy + ldy;
+ item = 1;
+ }
+ }
+ else
+ icon->hide();
+ }
+
+ int lockkeyLines = (lockkeyCount+length-1)/length;
+ int accessxLines = lines - (modifierCount+length-1)/length - lockkeyLines;
+
+ if (showMouse)
+ ++accessxCount;
+
+ if (lockkeyLines*length + accessxLines*length
+ >= lockkeyCount + accessxCount)
+ {
+ if (lines > 1 && item > 1) {
+ x = x - (item-1)*dx + ldx;
+ y = y - (item-1)*dy + ldy;
+ item = 1;
+ }
+ }
+ else {
+ accessxLines++;
+ }
+
+ if (showMouse && showAccessX && accessxLines > 0) {
+ mouse->setGeometry (x, y, size, size);
+ mouse->show();
+ mouse->update();
+ accessxCount--;
+ item++; x+=dx; y+=dy;
+ if (item > length) {
+ x = x - length*dx + ldx;
+ y = y - length*dy + ldy;
+ item = 1;
+ accessxLines--;
+ }
+ }
+ else
+ mouse->hide();
+
+ if ((accessxFeatures & XkbStickyKeysMask) != 0
+ && showAccessX && accessxLines > 0)
+ {
+ sticky->setGeometry (x, y, size, size);
+ sticky->show();
+ sticky->update();
+ accessxCount--;
+ item++; x+=dx; y+=dy;
+ if (item > length) {
+ x = x - length*dx + ldx;
+ y = y - length*dy + ldy;
+ item = 1;
+ accessxLines--;
+ }
+ }
+ else
+ sticky->hide();
+
+ if ((accessxFeatures & XkbSlowKeysMask) != 0
+ && showAccessX && accessxLines > 0)
+ {
+ slow->setGeometry (x, y, size, size);
+ slow->show();
+ slow->update();
+ accessxCount--;
+ item++; x+=dx; y+=dy;
+ if (item > length) {
+ x = x - length*dx + ldx;
+ y = y - length*dy + ldy;
+ item = 1;
+ accessxLines--;
+ }
+ }
+ else
+ slow->hide();
+
+ if ((accessxFeatures & XkbBounceKeysMask) != 0
+ && showAccessX && accessxLines > 0)
+ {
+ bounce->setGeometry (x, y, size, size);
+ bounce->show();
+ bounce->update();
+ accessxCount--;
+ item++; x+=dx; y+=dy;
+ if (item > length) {
+ x = x - length*dx + ldx;
+ y = y - length*dy + ldy;
+ item = 1;
+ accessxLines--;
+ }
+ }
+ else
+ bounce->hide();
+
+ if (lines > 1) {
+ if (item != 1) {
+ x = x - (item-1)*dx + ldx;
+ y = y - (item-1)*dy + ldy;
+ }
+ item = 1;
+ }
+ for (icon = lockkeys.first(); icon; icon = lockkeys.next()) {
+ if (showLockkeys) {
+ icon->setGeometry (x, y, size, size);
+ icon->show();
+ icon->update();
+ item++; x+=dx; y+=dy;
+ if (item > length) {
+ x = x - length*dx + ldx;
+ y = y - length*dy + ldy;
+ item = 1;
+ }
+ }
+ else
+ icon->hide();
+ }
+
+ if ((accessxFeatures & XkbBounceKeysMask) != 0
+ && showAccessX && accessxCount > 0)
+ {
+ bounce->setGeometry (x, y, size, size);
+ bounce->show();
+ bounce->update();
+ item++; x+=dx; y+=dy;
+ accessxCount--;
+ }
+
+ if ((accessxFeatures & XkbSlowKeysMask) != 0
+ && showAccessX && accessxCount > 0)
+ {
+ slow->setGeometry (x, y, size, size);
+ slow->show();
+ slow->update();
+ item++; x+=dx; y+=dy;
+ accessxCount--;
+ }
+
+ if ((accessxFeatures & XkbStickyKeysMask) != 0
+ && showAccessX && accessxCount > 0)
+ {
+ sticky->setGeometry (x, y, size, size);
+ sticky->show();
+ sticky->update();
+ item++; x+=dx; y+=dy;
+ accessxCount--;
+ }
+
+ if (showMouse && accessxCount > 0)
+ {
+ mouse->setGeometry (x, y, size, size);
+ mouse->show();
+ mouse->update();
+ item++; x+=dx; y+=dy;
+ accessxCount--;
+ }
+}
+
+void KbStateApplet::paletteChanged() {
+ for (int i = 0; i < 8; i++) {
+ if (icons[i])
+ icons[i]->updateImages();
+ }
+ mouse->update();
+ sticky->update();
+ slow->update();
+ bounce->update();
+}
+
+void KbStateApplet::initMasks() {
+ for (int i = 0; i < 8; i++) {
+ if (icons[i])
+ delete icons[i];
+ icons[i] = 0;
+ }
+ state = 0;
+
+ for (int i = 0; strcmp(modifierKeys[i].name, "") != 0; i++) {
+ int mask = modifierKeys[i].mask;
+ if (mask == 0)
+ if (modifierKeys[i].keysym != 0)
+ mask = XkbKeysymToModifiers (this->x11Display(), modifierKeys[i].keysym);
+ else if (!strcmp(modifierKeys[i].name, "Win"))
+ mask = KKeyNative::modX(KKey::WIN);
+ else
+ mask = XkbKeysymToModifiers (this->x11Display(), XK_Mode_switch)
+ | XkbKeysymToModifiers (this->x11Display(), XK_ISO_Level3_Shift)
+ | XkbKeysymToModifiers (this->x11Display(), XK_ISO_Level3_Latch)
+ | XkbKeysymToModifiers (this->x11Display(), XK_ISO_Level3_Lock);
+
+ int map = 0;
+ for (map = 0; map < 8; map++) {
+ if ((mask & (1 << map)) != 0)
+ break;
+ }
+ if ((map <= 7) && !(icons[map])) {
+ icons[map] = new KeyIcon (i, instance, this, modifierKeys[i].name);
+ QToolTip::add (icons[map], i18n (modifierKeys[i].name));
+ connect (icons[map], SIGNAL(stateChangeRequest (KeyIcon*,bool,bool)),
+ SLOT(stateChangeRequest (KeyIcon*,bool,bool)));
+ if (modifierKeys[i].isModifier)
+ modifiers.append(icons[map]);
+ else
+ lockkeys.append(icons[map]);
+ }
+ }
+}
+
+bool KbStateApplet::x11Event (XEvent *evt) {
+ if (evt->type == xkb_base_event_type + XkbEventCode) {
+ XkbEvent *kbevt = (XkbEvent *)evt;
+ switch (kbevt->any.xkb_type) {
+ case XkbStateNotify:
+ timerEvent (0);
+
+ mouse->setState (kbevt->state.ptr_buttons);
+ break;
+ case XkbAccessXNotify:
+ switch (kbevt->accessx.detail) {
+ case XkbAXN_SKPress:
+ slow->setGlyth(i18n("a (the first letter in the alphabet)", "a"));
+ slow->setImage("unlatched");
+ break;
+ case XkbAXN_SKAccept:
+ slow->setImage("keypressok");
+ break;
+ case XkbAXN_SKRelease:
+ slow->setGlyth(" ");
+ slow->setImage("kbstate_slowkeys");
+ break;
+ case XkbAXN_SKReject:
+ slow->setImage("keypressno", kbevt->accessx.sk_delay>150?kbevt->accessx.sk_delay:150);
+ break;
+ case XkbAXN_BKAccept:
+ slow->setGlyth(i18n("a (the first letter in the alphabet)", "a"));
+ bounce->setImage("keypressok", kbevt->accessx.sk_delay>150?kbevt->accessx.sk_delay:150);
+ break;
+ case XkbAXN_BKReject:
+ slow->setGlyth(i18n("a (the first letter in the alphabet)", "a"));
+ bounce->setImage("keypressno", kbevt->accessx.sk_delay>150?kbevt->accessx.sk_delay:150);
+ break;
+ }
+ break;
+ case XkbControlsNotify: {
+ XkbControlsNotifyEvent* event = (XkbControlsNotifyEvent*)evt;
+ accessxFeatures = event->enabled_ctrls;
+
+ if ((accessxFeatures & XkbMouseKeysMask) != 0) {
+ XkbGetControls (qt_xdisplay(), XkbMouseKeysMask, xkb);
+ if (xkb->ctrls->mk_dflt_btn < 1)
+ mouse->setActiveKey (1);
+ else if (xkb->ctrls->mk_dflt_btn > 3)
+ mouse->setActiveKey (1);
+ else
+ mouse->setActiveKey (xkb->ctrls->mk_dflt_btn);
+ }
+ else
+ mouse->setActiveKey (0);
+
+ layout();
+ updateGeometry();
+ emit updateLayout();
+ break;
+ }
+ case XkbExtensionDeviceNotify:
+ /* This is a hack around the fact that XFree86's XKB doesn't give AltGr notifications */
+ break;
+ default:
+ break;
+ }
+ }
+ return false;
+}
+
+void KbStateApplet::timerEvent(QTimerEvent*) {
+ XkbStateRec state_return;
+ XkbGetState (this->x11Display(), XkbUseCoreKbd, &state_return);
+ unsigned char latched = XkbStateMods (&state_return);
+ unsigned char locked = XkbModLocks (&state_return);
+ int mods = ((int)latched)<<8 | locked;
+
+ if (state != mods) {
+ state = mods;
+ for (int i = 0; i < 8; i++) {
+ if (icons[i])
+ icons[i]->setState ((latched&(1<<i)) != 0, (locked&(1<<i)) != 0);
+ }
+ }
+}
+
+void KbStateApplet::stateChangeRequest (KeyIcon *source, bool latched, bool locked) {
+ for (int i = 0; i < 8; i++) {
+ if (icons[i] == source) {
+ if (locked)
+ XkbLockModifiers (this->x11Display(), XkbUseCoreKbd, 1<<i, 1<<i);
+ else if (latched) {
+ XkbLockModifiers (this->x11Display(), XkbUseCoreKbd, 1<<i, 0);
+ XkbLatchModifiers (this->x11Display(), XkbUseCoreKbd, 1<<i, 1<<i);
+ }
+ else {
+ XkbLockModifiers (this->x11Display(), XkbUseCoreKbd, 1<<i, 0);
+ XkbLatchModifiers (this->x11Display(), XkbUseCoreKbd, 1<<i, 0);
+ }
+ }
+ }
+}
+
+
+void KbStateApplet::toggleModifier() {
+ showModifiers = !showModifiers;
+ updateMenu();
+ layout();
+ updateGeometry();
+ saveConfig();
+ emit updateLayout();
+}
+
+void KbStateApplet::toggleLockkeys() {
+ showLockkeys = !showLockkeys;
+ updateMenu();
+ layout();
+ updateGeometry();
+ saveConfig();
+ emit updateLayout();
+}
+
+void KbStateApplet::toggleMouse() {
+ showMouse = !showMouse;
+ updateMenu();
+ layout();
+ updateGeometry();
+ saveConfig();
+ emit updateLayout();
+}
+
+void KbStateApplet::toggleAccessX() {
+ showAccessX = !showAccessX;
+ updateMenu();
+ layout();
+ updateGeometry();
+ saveConfig();
+ emit updateLayout();
+}
+
+void KbStateApplet::configureAccessX() {
+ kapp->startServiceByDesktopName("kcmaccess");
+}
+
+void KbStateApplet::configureKeyboard() {
+ // The modulename "keyboard" is ambiguous on SuSE systems
+ // as there is also a YaST-module called "keyboard".
+ KProcess proc;
+ proc << "kcmshell";
+ proc << "kde/keyboard";
+ proc.start(KProcess::DontCare);
+ proc.detach();
+}
+
+void KbStateApplet::configureMouse() {
+ kapp->startServiceByDesktopName("mouse");
+}
+
+void KbStateApplet::about() {
+ KAboutData about("kbstateapplet", I18N_NOOP("Keyboard Status Applet"), "0.2",
+ I18N_NOOP("Panel applet that shows the state of the modifier keys"), KAboutData::License_GPL_V2, "(C) 2004 Gunnar Schmi Dt");
+ KAboutApplication a(&about, this);
+ a.exec();
+}
+
+void KbStateApplet::loadConfig()
+{
+ KConfig *c = config();
+ c->setGroup("General");
+ size = c->readNumEntry("IconDim", 20);
+ fillSpace = c->readBoolEntry("fill space", true);
+ showModifiers = c->readBoolEntry("Modifierkeys visible",true);
+ showLockkeys = c->readBoolEntry("Lockkeys visible",true);
+ showMouse = c->readBoolEntry("Mouse status visible",true);
+ showAccessX = c->readBoolEntry("Slowkeys status visible",true);
+ showAccessX = c->readBoolEntry("AccessX status visible",showAccessX);
+}
+
+void KbStateApplet::saveConfig()
+{
+ KConfig *c = config();
+ c->setGroup("General");
+ c->writeEntry("IconDim", size);
+ c->writeEntry("fill space", fillSpace);
+ c->writeEntry("Modifierkeys visible", showModifiers);
+ c->writeEntry("Lockkeys visible", showLockkeys);
+ c->writeEntry("Mouse status visible", showMouse);
+ c->writeEntry("AccessX status visible", showAccessX);
+ c->sync();
+}
+
+/********************************************************************/
+
+KeyIcon::KeyIcon (int keyId, KInstance *instance,
+ QWidget *parent, const char *name)
+ : StatusIcon (modifierKeys[keyId].name, parent, name) {
+ this->instance = instance;
+ this->keyId = keyId;
+ this->tristate = (modifierKeys[keyId].isModifier);
+ isLocked = false;
+ isLatched = false;
+ updateImages ();
+ connect (this, SIGNAL(clicked()), SLOT(clickedSlot()));
+}
+
+KeyIcon::~KeyIcon () {
+}
+
+void KeyIcon::setState (bool latched, bool locked) {
+ latched = latched | locked;
+
+ isLatched = latched;
+ isLocked = locked;
+ update();
+}
+
+void KeyIcon::clickedSlot () {
+ if (tristate)
+ emit stateChangeRequest (this, !isLocked, isLatched&!isLocked);
+ else
+ emit stateChangeRequest (this, false, !isLocked);
+}
+
+
+void KeyIcon::resizeEvent( QResizeEvent*e )
+{
+ QWidget::resizeEvent(e);
+ updateImages();
+}
+
+void KeyIcon::updateImages () {
+ int size = width()<height() ? width() : height();
+
+ locked = instance->iconLoader()->loadIcon("lock_overlay", KIcon::Panel, size-4);
+ if (strcmp(modifierKeys[keyId].icon, "")) {
+ latched = instance->iconLoader()->loadIcon(modifierKeys[keyId].icon, KIcon::NoGroup, size-4);
+ unlatched = instance->iconLoader()->loadIcon(modifierKeys[keyId].icon, KIcon::NoGroup, size-4);
+
+ QImage img = latched.convertToImage();
+ KIconEffect::colorize(img, KGlobalSettings::highlightedTextColor(), 1.0);
+ latched.convertFromImage (img);
+
+ img = unlatched.convertToImage();
+ KIconEffect::colorize(img, KGlobalSettings::textColor(), 1.0);
+ unlatched.convertFromImage (img);
+ }
+
+ update();
+}
+
+void KeyIcon::drawButton (QPainter *p) {
+ QColor black;
+
+ int x = (width()-locked.width())/2;
+ int y = (height()-locked.height())/2;
+ int o = 0;
+ if (isLocked || isLatched) {
+ qDrawShadePanel (p, 0, 0, width(), height(), colorGroup(), true, 1, NULL);
+ p->fillRect (1,1,width()-2,height()-2, KGlobalSettings::highlightColor());
+ if (strcmp(modifierKeys[keyId].icon, ""))
+ p->drawPixmap (x+1,y+1, latched);
+ black = KGlobalSettings::highlightedTextColor();
+ o = 1;
+ }
+ else {
+ qDrawShadePanel (p, 0, 0, width(), height(), colorGroup(), false, 1, NULL);
+ if (strcmp(modifierKeys[keyId].icon, ""))
+ p->drawPixmap (x,y, unlatched);
+ black = KGlobalSettings::textColor();
+ }
+
+ QString text = i18n(modifierKeys[keyId].text);
+ if (!text.isEmpty() && !text.isNull()) {
+ QFont font = KGlobalSettings::generalFont();
+ font.setWeight(QFont::Black);
+ QFontMetrics metrics(font);
+ QRect rect = metrics.boundingRect (text);
+ int size;
+ if (!strcmp(modifierKeys[keyId].name, "Alt Graph"))
+ size = rect.width()>rect.height()?rect.width():rect.height();
+ else
+ size = rect.width()>12*rect.height()/5?rect.width():12*rect.height()/5;
+
+ if (font.pixelSize() != -1)
+ font.setPixelSize (font.pixelSize()*width()*19/size/32);
+ else
+ font.setPointSizeFloat (font.pointSizeFloat()*width()*19/size/32);
+
+ p->setPen (black);
+ p->setFont (font);
+ if (!strcmp(modifierKeys[keyId].name, "Alt Graph"))
+ p->drawText (o,o, width(), height(), Qt::AlignCenter, text);
+ else
+ p->drawText (o,o, width(), height()*(251)/384, Qt::AlignCenter, text);
+ }
+ if (tristate && isLocked) {
+ p->drawPixmap(x+o,y+o, locked);
+ }
+}
+
+/********************************************************************/
+
+MouseIcon::MouseIcon (KInstance *instance, QWidget *parent, const char *name)
+ : StatusIcon ("", parent, name)
+{
+ this->instance = instance;
+ state = 0;
+ activekey = 0;
+ updateImages ();
+ connect (this, SIGNAL(clicked()), SLOT(clickedSlot()));
+}
+
+MouseIcon::~MouseIcon () {
+}
+
+void MouseIcon::setState (int state) {
+ this->state = state;
+
+ update();
+}
+
+void MouseIcon::setActiveKey (int activekey) {
+ this->activekey = activekey;
+
+ update();
+}
+
+void MouseIcon::resizeEvent( QResizeEvent*e )
+{
+ QWidget::resizeEvent(e);
+ updateImages();
+}
+
+QPixmap loadIcon(KInstance *instance, int size, QColor color, QString name) {
+ KIconLoader *loader = instance->iconLoader();
+ QPixmap result = loader->loadIcon(name, KIcon::NoGroup, size);
+
+ QImage img = result.convertToImage();
+ KIconEffect::colorize(img, color, 1.0);
+ result.convertFromImage (img);
+
+ return result;
+}
+
+void MouseIcon::updateImages () {
+ int size = width()<height() ? width() : height();
+
+ QColor textcolor = KGlobalSettings::textColor();
+ QColor basecolor = KGlobalSettings::baseColor();
+ mouse = loadIcon (instance, size, textcolor, "kbstate_mouse");
+ leftSelected = loadIcon (instance, size, textcolor,
+ "kbstate_mouse_left_selected");
+ middleSelected = loadIcon (instance, size, textcolor,
+ "kbstate_mouse_mid_selected");
+ rightSelected = loadIcon (instance, size, textcolor,
+ "kbstate_mouse_right_selected");
+ leftDot = loadIcon (instance, size, textcolor, "kbstate_mouse_left");
+ middleDot = loadIcon (instance, size, textcolor, "kbstate_mouse_mid");
+ rightDot = loadIcon (instance, size, textcolor, "kbstate_mouse_right");
+ leftDotSelected = loadIcon (instance, size, basecolor,
+ "kbstate_mouse_left");
+ middleDotSelected = loadIcon (instance, size, basecolor,
+ "kbstate_mouse_mid");
+ rightDotSelected = loadIcon (instance, size, basecolor,
+ "kbstate_mouse_right");
+
+ update();
+}
+
+void MouseIcon::drawButton (QPainter *p) {
+ p->drawPixmap(0,0, mouse);
+ if ((state & Button1Mask) != 0)
+ p->drawPixmap(0,0, leftSelected);
+ if ((state & Button2Mask) != 0)
+ p->drawPixmap(0,0, middleSelected);
+ if ((state & Button3Mask) != 0)
+ p->drawPixmap(0,0, rightSelected);
+ switch (activekey) {
+ case 0:
+ break;
+ case 1:
+ if ((state & Button1Mask) != 0)
+ p->drawPixmap(0,0, leftDotSelected);
+ else
+ p->drawPixmap(0,0, leftDot);
+ break;
+ case 2:
+ if ((state & Button2Mask) != 0)
+ p->drawPixmap(0,0, middleDotSelected);
+ else
+ p->drawPixmap(0,0, middleDot);
+ break;
+ case 3:
+ if ((state & Button3Mask) != 0)
+ p->drawPixmap(0,0, rightDotSelected);
+ else
+ p->drawPixmap(0,0, rightDot);
+ break;
+ }
+}
+
+/********************************************************************/
+
+TimeoutIcon::TimeoutIcon (KInstance *instance, const QString &text,
+ const QString &featurename,
+ QWidget *parent, const char *name)
+ : StatusIcon (text, parent, name) {
+ this->instance = instance;
+ this->featurename = featurename;
+ glyth = " ";
+ setImage (featurename);
+ connect (&timer, SIGNAL(timeout()), this, SLOT(timeout()));
+}
+
+TimeoutIcon::~TimeoutIcon () {
+}
+
+void TimeoutIcon::update () {
+ int size = width()<height() ? width() : height();
+ if (pixmap.width() != size)
+ pixmap = instance->iconLoader()->loadIcon(iconname, KIcon::NoGroup, size);
+
+ QImage img = pixmap.convertToImage();
+ KIconEffect::colorize(img, KGlobalSettings::textColor(), 1.0);
+ pixmap.convertFromImage (img);
+
+ image = pixmap;
+ QWidget::update();
+}
+
+void TimeoutIcon::setGlyth (const QString &glyth) {
+ timer.stop();
+ this->glyth = glyth;
+
+ QImage img = pixmap.convertToImage();
+ KIconEffect::colorize(img, KGlobalSettings::textColor(), 1.0);
+ pixmap.convertFromImage (img);
+
+ image = pixmap;
+ update();
+}
+
+void TimeoutIcon::setImage (const QString &name, int timeout) {
+ timer.stop();
+ iconname = name;
+ if (!name.isNull() && !name.isEmpty()) {
+ int size = width()<height() ? width() : height();
+ pixmap = instance->iconLoader()->loadIcon(iconname, KIcon::NoGroup, size);
+
+ QImage img = pixmap.convertToImage();
+ KIconEffect::colorize(img, KGlobalSettings::textColor(), 1.0);
+ pixmap.convertFromImage (img);
+
+ image = pixmap;
+ }
+ update();
+ if (timeout > 0)
+ timer.start (timeout, true);
+}
+
+void TimeoutIcon::timeout () {
+ setGlyth (" ");
+ setImage(featurename);
+}
+
+
+void TimeoutIcon::drawButton (QPainter *p) {
+ QString text = glyth;
+ int count = 1;
+ int factor = 19;
+
+ if (!iconname.isNull() && !iconname.isEmpty())
+ p->drawPixmap(0,0, image);
+ else if (glyth == " ") {
+ text = i18n("a (the first letter in the alphabet)", "a");
+ count = 3;
+ factor = 64;
+ }
+
+ QFont font = KGlobalSettings::generalFont();
+ font.setWeight(QFont::Black);
+ QFontMetrics metrics(font);
+ QRect rect = metrics.boundingRect (text);
+ int size = count*rect.width() > rect.height()
+ ? count*rect.width() : rect.height();
+ if (font.pixelSize() != -1)
+ font.setPixelSize (font.pixelSize()*width()*factor/size/64);
+ else
+ font.setPointSizeFloat (font.pointSizeFloat()*width()*factor/size/64);
+
+ p->setFont (font);
+ if (count == 1) {
+ p->setPen (KGlobalSettings::textColor());
+ p->drawText (0,0, width()/2, height()/2, Qt::AlignCenter, text);
+ }
+ else {
+ QColor t = KGlobalSettings::textColor();
+ QColor b = KGlobalSettings::baseColor();
+ p->setPen (QColor ((2*t.red()+3*b.red())/5,
+ (2*t.green()+3*b.green())/5,
+ (2*t.blue()+3*b.blue())/5));
+ p->drawText (width()/2,0, width()/2, height(), Qt::AlignCenter, text);
+ p->setPen (QColor ((2*t.red()+b.red())/3,
+ (2*t.green()+b.green())/3,
+ (2*t.blue()+b.blue())/3));
+ p->drawText (0,0, width(), height(), Qt::AlignCenter, text);
+ p->setPen (KGlobalSettings::textColor());
+ p->drawText (0,0, width()/2, height(), Qt::AlignCenter, text);
+ }
+}
+
+/********************************************************************/
+
+StatusIcon::StatusIcon (const QString &text, QWidget *parent, const char *name)
+ : QPushButton (text, parent, name) {
+ setSizePolicy(QSizePolicy(QSizePolicy::Ignored, QSizePolicy::Ignored));
+}
+
+StatusIcon::~StatusIcon () {
+}
+
+QSize StatusIcon::minimumSizeHint () const {
+ return QSize (0,0);
+}
diff --git a/kbstateapplet/kbstate.h b/kbstateapplet/kbstate.h
new file mode 100644
index 0000000..edcd3dc
--- /dev/null
+++ b/kbstateapplet/kbstate.h
@@ -0,0 +1,200 @@
+/*
+ * Copyright (c) 2004 Gunnar Schmi Dt <gunnar@schmi-dt.de>
+ *
+ * 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
+ */
+
+#ifndef __kbstate_h__
+#define __kbstate_h__
+
+#include <kpanelapplet.h>
+#include <qpushbutton.h>
+#include <qptrlist.h>
+#include <qtimer.h>
+
+extern "C"
+{
+#include <X11/Xlib.h>
+#include <X11/XKBlib.h>
+}
+
+class QLabel;
+class QGridLayout;
+class KPopupMenu;
+
+class StatusIcon : public QPushButton {
+ Q_OBJECT
+public:
+ StatusIcon (const QString &text, QWidget *parent, const char *name=0);
+ ~StatusIcon ();
+
+ QSize minimumSizeHint () const;
+};
+typedef QPtrList<StatusIcon> IconList;
+
+class TimeoutIcon : public StatusIcon {
+ Q_OBJECT
+public:
+ TimeoutIcon (KInstance *instance, const QString &text,
+ const QString &featurename,
+ QWidget *parent, const char *name=0);
+ ~TimeoutIcon ();
+
+ void update ();
+ void setGlyth (const QString &glyth);
+ void setImage (const QString &name, int timeout = 0);
+
+ void drawButton (QPainter *p);
+
+private:
+ QString glyth;
+ QString iconname;
+ QString featurename;
+ QPixmap pixmap;
+ QPixmap image;
+ QTimer timer;
+ KInstance *instance;
+
+private slots:
+ void timeout ();
+};
+
+class KeyIcon : public StatusIcon {
+ Q_OBJECT
+public:
+ KeyIcon (int keyId, KInstance *instance,
+ QWidget *parent, const char *name=0);
+ ~KeyIcon ();
+ void setState (bool latched, bool locked);
+ void drawButton (QPainter *p);
+ void updateImages ();
+
+signals:
+ void stateChangeRequest (KeyIcon *source, bool latched, bool locked);
+
+protected:
+ void resizeEvent(QResizeEvent*);
+
+private slots:
+ void clickedSlot();
+
+private:
+ QPixmap locked;
+ QPixmap latched;
+ QPixmap unlatched;
+ bool isLatched;
+ bool isLocked;
+ bool tristate;
+ int keyId;
+ KInstance *instance;
+};
+
+class MouseIcon : public StatusIcon {
+ Q_OBJECT
+ public:
+ MouseIcon (KInstance *instance, QWidget *parent, const char *name=0);
+ ~MouseIcon ();
+ void setState (int state);
+ void setActiveKey (int activekey);
+ void drawButton (QPainter *p);
+ void updateImages ();
+
+ protected:
+ void resizeEvent(QResizeEvent*);
+
+ private:
+ QPixmap mouse;
+ QPixmap leftSelected;
+ QPixmap middleSelected;
+ QPixmap rightSelected;
+ QPixmap leftDot;
+ QPixmap middleDot;
+ QPixmap rightDot;
+ QPixmap leftDotSelected;
+ QPixmap middleDotSelected;
+ QPixmap rightDotSelected;
+ int state, activekey;
+ KInstance *instance;
+};
+
+class KbStateApplet : public KPanelApplet {
+ Q_OBJECT
+
+public:
+ KbStateApplet(const QString& configFile, Type t = Normal, int actions = 0,
+ QWidget *parent = 0, const char *name = 0);
+ ~KbStateApplet();
+
+ int widthForHeight(int height) const;
+ int heightForWidth(int width) const;
+
+protected:
+ void mousePressEvent(QMouseEvent *e);
+ void timerEvent(QTimerEvent*);
+ void resizeEvent(QResizeEvent*);
+ bool x11Event (XEvent *);
+
+public slots:
+ void about();
+ void configureAccessX();
+ void configureMouse();
+ void configureKeyboard();
+ void toggleModifier ();
+ void toggleLockkeys ();
+ void toggleMouse ();
+ void toggleAccessX ();
+ void paletteChanged();
+
+ void toggleFillSpace ();
+
+private slots:
+ void setIconDim (int size);
+ void stateChangeRequest (KeyIcon *source, bool latched, bool locked);
+
+private:
+ void loadConfig();
+ void saveConfig();
+ void layout();
+
+ int xkb_base_event_type;
+
+ KeyIcon *(icons[8]);
+ IconList modifiers;
+ IconList lockkeys;
+ TimeoutIcon *sticky;
+ TimeoutIcon *slow;
+ TimeoutIcon *bounce;
+ MouseIcon *mouse;
+
+ int state;
+ unsigned int accessxFeatures;
+ int size;
+
+ void initMasks();
+
+ void buildPopupMenu();
+ void updateMenu();
+ KPopupMenu *popup;
+ KPopupMenu *sizePopup;
+ KPopupMenu *showPopup;
+ int modifierItem, lockkeysItem, mouseItem, accessxItem;
+ int fillSpaceItem;
+ bool showModifiers, showLockkeys, showMouse, showAccessX;
+ bool fillSpace;
+
+ KInstance *instance;
+ XkbDescPtr xkb;
+};
+
+#endif // __kbstate_h__
diff --git a/kbstateapplet/kbstateapplet.desktop b/kbstateapplet/kbstateapplet.desktop
new file mode 100644
index 0000000..bf5231d
--- /dev/null
+++ b/kbstateapplet/kbstateapplet.desktop
@@ -0,0 +1,101 @@
+[Desktop Entry]
+Type=Plugin
+Name=Keyboard Status Applet
+Name[bg]=Състояние на клавиатурата
+Name[br]=Arloadig stad ar stokellaoueg
+Name[ca]=Applet d'estat del teclat
+Name[cs]=Applet ukazují stav klávesnice
+Name[da]=Tastaturstatus-applet
+Name[de]=Tastaturstatus
+Name[el]=Μικροεφαρμογή κατάστασης πληκτρολογίου
+Name[es]=Aplicación integrada en el panel con el estado del teclado
+Name[et]=Klaviatuuristaatuse aplett
+Name[eu]=Teklatuaren egoeraren applet-a
+Name[fa]=برنامک وضعیت صفحه کلید
+Name[fi]=Näppäimistötilan sovelma
+Name[fr]=Applet d'état du clavier
+Name[ga]=Feidhmchláirín Stádais an Mhéarchláir
+Name[gl]=Applet de Estado do Teclado
+Name[he]=יישומון מצב המקלדת
+Name[hi]=कुंजीपट स्थिति ऐप्लेट
+Name[hu]=Billentyűállapot-jelző
+Name[is]=Lyklaborðsstöðu smáforrit
+Name[it]=Applet per lo stato della tastiera
+Name[ja]=キーボード状態アプレット
+Name[ka]=კლავიატურის სტატუსის აპლეტი
+Name[km]= អាប់ភ្លេត​ស្ថានភាព​ក្ដារ​ចុច
+Name[lt]=Klaviatūros būklės įskiepis
+Name[mk]=Аплет за статус на тастатурата
+Name[ms]=Aplet Status Papan Kekunci
+Name[nb]=Miniprogram for tastaturstatus
+Name[nds]=Tastatuurstatus-Lüttprogramm
+Name[ne]=कुञ्जीपाटी वस्तुस्थिति एप्लेट
+Name[nl]=Toetsenbordstatus-applet
+Name[pa]=ਕੀ-ਬੋਰਡ ਸਥਿਤੀ ਐਪਲਿਟ
+Name[pl]=Aplet stanu klawiatury
+Name[pt]='Applet' de estado do teclado
+Name[pt_BR]=Mini-aplicativo de status do teclado
+Name[ru]=Аплет состояния клавиатуры
+Name[sk]=Applet Stav klávesnice
+Name[sl]=Vstavek za stanje tipkovnice
+Name[sr]=Аплет за статус тастатуре
+Name[sr@Latn]=Aplet za status tastature
+Name[sv]=Miniprogram för tangentbordsstatus
+Name[ta]=விசைப்பலகை நிலை குறுநிரல்
+Name[tg]=Апплети ҳолати радифи ҳарфҳо
+Name[th]=แอพเพล็ตสถานะแป้นพิมพ์
+Name[tr]=Klavye Durum Uygulaması
+Name[uk]=Аплет стану клавіатури
+Name[vi]=Tiểu dụng Trạng thái Bàn phím
+Name[zh_CN]=键盘状态小程序
+Name[zh_TW]=鍵盤狀態小程式
+Comment=Panel applet that shows the state of the modifier keys
+Comment[bg]=Аплет за системния панел, които показва състоянието на клавишите модификатори
+Comment[bs]=Panel applet koji pokazuje stanje modifikatorskih tipaka
+Comment[ca]=Applet del plafó que mostra l'estat de les tecles modificadores
+Comment[cs]=Applet, který zobrazuje stav klávesnice
+Comment[da]=Panelprogram der viser tilstanden for ændringstaster
+Comment[de]=Ein Miniprogramm für die Kontrollleiste, das den Status der Sondertasten anzeigt
+Comment[el]=Μικροεφαρμογή του πίνακα που εμφανίζει την κατάσταση των πλήκτρων τροποποίησης
+Comment[es]=Aplicación integrada en el panel que muestra el estado de las teclas modificadoras
+Comment[et]=Paneeliaplett, mis näitab muuteklahvide olekut
+Comment[eu]=Panelaren applet-ak tekla aldatzaileen egoera erakusten du
+Comment[fa]=برنامک تابلو که وضعیت کلیدهای تغییردهنده را نمایش می‌دهد
+Comment[fi]=Muunnosnäppäinten tilan näyttävä paneelisovelma
+Comment[fr]=Applet du tableau de bord affichant l'état des touches de modifications
+Comment[ga]=Feidhmchláirín painéil a thaispeánann staid na n-eochracha mionathraithe
+Comment[gl]=Applet do painel que mostra o estado das teclas modificadoras
+Comment[hi]=फलक ऐप्लेट जो कि परिवर्धक कुंजियों की स्थिति दिखाता है
+Comment[hu]=Panel-kisalkalmazás a módosítóbillentyűk állapotának kiírásához
+Comment[is]=Spjaldforrit sem sýnir stöðu breytilykla
+Comment[it]=Applet del pannello che mostra lo stato dei tasti modificatori
+Comment[ja]=修飾キーの状態を表示するパネルアプレット
+Comment[ka]=პანელის აპლეტი, რომელიც მოდიფიკატორ კლავიშთა მდგომარეობას ასახავს
+Comment[km]=​អាប់ភ្លេត​បន្ទះ​ដែល​បង្ហាញ​ស្ថានភាព​របស់​គ្រាប់ចុច​កែប្រែ
+Comment[lt]=Pulto įskiepis rodantis klaviatūros modifikuojančiųjų klavišų būseną
+Comment[mk]=Аплет на панелот што ја покажува состојбата на копчињата за менување
+Comment[ms]=Panel aplet yang menayangkan keadaan kekunci pengubah suai
+Comment[nb]=Panel-miniprogram som viser tilstanden for valgtastene
+Comment[nds]=Paneel-Lüttprogramm, dat den Tostand vun de Sünnertasten wiest
+Comment[ne]=परिमार्जक कुञ्जीको वस्तुस्थिति देखाउने प्यानल ऐप्लेट
+Comment[nl]=Een paneelapplet dat de status van de modificatietoetsen weergeeft
+Comment[pa]=ਸੋਧਕ ਸਵਿੱਚਾਂ ਦੀ ਹਾਲਤ ਵੇਖਾਉਣ ਨਾਲ ਤੁਸੀਂ ਪੈਨਲ ਐਪਲਿਟ ਵੇਖ ਸਕਦੇ ਹੋ
+Comment[pl]=Apleta panelu, który pokazuje stan klawiszy modyfikujących
+Comment[pt]='Applet' do painel que mostra o estado das teclas modificadoras
+Comment[pt_BR]=Ícone de painel que mostra o estado das teclas modificadoras
+Comment[ru]=Аплет, показывающий состояния специальных клавиш
+Comment[sk]=Applet panelu, ktorý zobrazí stav modifikačných kláves
+Comment[sl]=Pultni vstavek, ki prikazuje stanje modifikatorskih tipk (modifikatorjev)
+Comment[sr]=Панелни аплет који приказује стање модификаторских тастера
+Comment[sr@Latn]=Panelni aplet koji prikazuje stanje modifikatorskih tastera
+Comment[sv]=Panelminiprogram som visar tillståndet hos väljartangenter
+Comment[ta]=மாற்றி விசைகளின் நிலையைக் காட்டும் ஒரு பலக குறுநிரல்
+Comment[tg]=Апплети нишонмедодаи ҳолати махсуси тугмаҳо
+Comment[th]=ถาดแอพเพล็ตสำหรับแสดงสถานะของปุ่มพิมพ์ร่วม
+Comment[tr]=Değiştirici tuş alanını gösteren bir panel eklentisi
+Comment[uk]=Аплет панелі, який показує стан клавіш-модифікаторів
+Comment[vi]=Tiểu dụng bảng điều khiển hiển thị trạng thái phím bổ trợ
+Comment[zh_CN]=显示修饰键状态的面板小程序
+Comment[zh_TW]=一個顯示鍵盤狀態的面板小程式
+Icon=key_enter
+X-KDE-Library=kbstate_panelapplet
diff --git a/kbstateapplet/kdeexportfix.h b/kbstateapplet/kdeexportfix.h
new file mode 100644
index 0000000..172dd94
--- /dev/null
+++ b/kbstateapplet/kdeexportfix.h
@@ -0,0 +1,22 @@
+/***************************************************** vim:set ts=4 sw=4 sts=4:
+ kdelibs < 3.3.2 had a bug in the KDE_EXPORT macro. This file fixes this
+ by undefining it.
+ -------------------
+ Copyright : (C) 2005 by Gary Cramblitt <garycramblitt@comcast.net>
+ -------------------
+ Original author: Gary Cramblitt <garycramblitt@comcast.net>
+ ******************************************************************************/
+
+/***************************************************************************
+ * *
+ * 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; version 2 of the License. *
+ * *
+ ***************************************************************************/
+
+#include <kdeversion.h>
+#if KDE_VERSION < KDE_MAKE_VERSION (3,3,2)
+#undef KDE_EXPORT
+#define KDE_EXPORT
+#endif