commit
ae0c828ac2
@ -0,0 +1,18 @@
|
|||||||
|
Leonid Zeitlin <lz@europe.com>
|
||||||
|
creator and maintainer
|
||||||
|
|
||||||
|
Thanks to:
|
||||||
|
Mikhail Senin <m_senin@mail.ru>,
|
||||||
|
Default group config and per-window groups,
|
||||||
|
Rashid N. Achilov <achilov@granch.ru>
|
||||||
|
FreeBSD port
|
||||||
|
Vadim Kriklivy (K&K Analitic) <analitic@vinnitsa.com>
|
||||||
|
Feature suggestions, Ukrainian translation
|
||||||
|
Sergey V Turchin <zerg@altlinux.org>
|
||||||
|
Autostart patch
|
||||||
|
Stergios Dramis <sdramis@egnatia.ee.auth.gr>
|
||||||
|
Greek translation
|
||||||
|
Shlomi Loubaton <shlomister@gmail.com>
|
||||||
|
Manpage, Debian package maintainer
|
||||||
|
Igal aka "Koala" <igalfr@netvision.net.il>
|
||||||
|
Hebrew translation, Gentoo ebuild maintainer
|
@ -0,0 +1,90 @@
|
|||||||
|
2001-07-29 Leonid Zeitlin <lz@europe.com>
|
||||||
|
* Initial release 0.1
|
||||||
|
|
||||||
|
2001-09-01 Leonid Zeitlin <lz@europe.com>
|
||||||
|
* Version 0.2
|
||||||
|
* added DCOP bindings (see README)
|
||||||
|
* fixed a compilation problem with gcc 2.96
|
||||||
|
* fixed a bug that prevented KKBSwitch from working with XFree86 4.0.x
|
||||||
|
(older versions tolerated this bug)
|
||||||
|
|
||||||
|
2001-11-19 Leonid Zeitlin <lz@europe.com>
|
||||||
|
* Version 0.3 (not indended for public release)
|
||||||
|
* If XKeyboard configuration changes while KKBSwitch is running, it can
|
||||||
|
now detect the change and adapt to it
|
||||||
|
* Wrote documentation
|
||||||
|
|
||||||
|
2001-11-21 Leonid Zeitlin <lz@europe.com>
|
||||||
|
* Version 1.0
|
||||||
|
* Integrated online help
|
||||||
|
* Added "What's this" functionality
|
||||||
|
* Cleaned up some code
|
||||||
|
|
||||||
|
2002-06-16 Leonid Zeitlin <lz@europe.com>
|
||||||
|
* Version 1.1
|
||||||
|
* Ported to KDE 3.0. Everything else is the same
|
||||||
|
|
||||||
|
2002-11-02 Leonid Zeitlin <lz@europe.com>
|
||||||
|
* Version 1.2
|
||||||
|
* Added configuration of default layout and the per-window layout mode (using
|
||||||
|
code contributed by Mikhail Senin <m_senin@mail.ru>). Updated documentation
|
||||||
|
accordingly
|
||||||
|
* Added Russian translation
|
||||||
|
|
||||||
|
2003-10-18 Leonid Zeitlin <lz@europe.com>
|
||||||
|
* Version 1.3
|
||||||
|
* Added configurable style of layout indicator icon. Three styles are
|
||||||
|
implemented: country flag (as in previous versions of KKBSwitch),
|
||||||
|
language code (a la Windows), country flag with language code
|
||||||
|
superimposed (a la kxkb)
|
||||||
|
* Added ability to activate particular layouts with keyboard shortcuts
|
||||||
|
* Added autostart option
|
||||||
|
* Work around missing country flag icons in Red Hat 9: try to use
|
||||||
|
gkb icons instead
|
||||||
|
* In configuration dialog the default layout is now displayed in bold
|
||||||
|
* Added Ukrainian translation
|
||||||
|
|
||||||
|
2003-11-02 Leonid Zeitlin <lz@europe.com>
|
||||||
|
* Version 1.3.1
|
||||||
|
* Restored compatibility with KDE 3.0, unintentionally broken in the
|
||||||
|
previous release
|
||||||
|
* Updated Ukrainian translation
|
||||||
|
|
||||||
|
2004-01-08 Leonid Zeitlin <lz@europe.com>
|
||||||
|
* Version 1.3.2
|
||||||
|
* Bugfix: previously the config dialog failed to set a icon for a layout, for
|
||||||
|
which KKBSwitch could not initially guess the icon
|
||||||
|
* Added Greek translation (from Stergios Dramis <sdramis@egnatia.ee.auth.gr>)
|
||||||
|
* Set KDEDIR in RPM spec file (fixes reported problems with incorrect
|
||||||
|
installation from SRPM)
|
||||||
|
* configure option to not install ru_ua layout file (--disable-ru-ua-layout)
|
||||||
|
|
||||||
|
2004-05-10 Leonid Zeitlin <lz@europe.com>
|
||||||
|
* Version 1.4.
|
||||||
|
* Reworked Pick Icon dialog: new look and ability to browse for an
|
||||||
|
arbitrary image file to use as an icon (suggested by Rashid Achilov).
|
||||||
|
* Option "Use per-window layout" replaced by "Layout scope". Now the
|
||||||
|
layout can apply either globally (same as "per-window layout" off), to
|
||||||
|
one window only (same as "per-window layout" on) or to windows of
|
||||||
|
one application (new feature) (technically, one window class)
|
||||||
|
(suggested by Oded Arbel).
|
||||||
|
* Internal code refactoring, must fix some obscure bugs.
|
||||||
|
|
||||||
|
2004-06-16 Leonid Zeitlin <lz@europe.com>
|
||||||
|
* Version 1.4.1.
|
||||||
|
* Fixed a bug that could crash KKBSwitch if no window was active when
|
||||||
|
the program started up.
|
||||||
|
* Fixed alignment of the system tray icon.
|
||||||
|
* Added Slovak translation (from Michal Sulek <reloadshot@atlas.sk>)
|
||||||
|
|
||||||
|
2004-11-06 Leonid Zeitlin <lz@europe.com>
|
||||||
|
* Version 1.4.2
|
||||||
|
* Added Hebrew translation by Igal aka "Koala" and manpage by Shlomi Loubaton
|
||||||
|
(required for Debian)
|
||||||
|
|
||||||
|
2005-01-15 Leonid Zeitlin <lz@europe.com>
|
||||||
|
* Version 1.4.3
|
||||||
|
* Added Bulgarian translation by Petko Yotov <5ko@free.fr> and Czech
|
||||||
|
translation by Michal Bukovsky <michal@trilogic.cz>
|
||||||
|
* Try harder to guess layout icon. If group_names file produces no match, try XKB
|
||||||
|
layout name as country code.
|
@ -0,0 +1,248 @@
|
|||||||
|
# Doxyfile 1.3.5-KDevelop
|
||||||
|
|
||||||
|
#---------------------------------------------------------------------------
|
||||||
|
# Project related configuration options
|
||||||
|
#---------------------------------------------------------------------------
|
||||||
|
PROJECT_NAME = kkbswitch.kdevelop
|
||||||
|
PROJECT_NUMBER = 0.1
|
||||||
|
OUTPUT_DIRECTORY =
|
||||||
|
OUTPUT_LANGUAGE = English
|
||||||
|
USE_WINDOWS_ENCODING = NO
|
||||||
|
BRIEF_MEMBER_DESC = YES
|
||||||
|
REPEAT_BRIEF = YES
|
||||||
|
ABBREVIATE_BRIEF = "The $name class" \
|
||||||
|
"The $name widget" \
|
||||||
|
"The $name file" \
|
||||||
|
is \
|
||||||
|
provides \
|
||||||
|
specifies \
|
||||||
|
contains \
|
||||||
|
represents \
|
||||||
|
a \
|
||||||
|
an \
|
||||||
|
the
|
||||||
|
ALWAYS_DETAILED_SEC = NO
|
||||||
|
INLINE_INHERITED_MEMB = NO
|
||||||
|
FULL_PATH_NAMES = NO
|
||||||
|
STRIP_FROM_PATH = /home/lz/src/kkbswitch/kkbswitch/
|
||||||
|
SHORT_NAMES = NO
|
||||||
|
JAVADOC_AUTOBRIEF = NO
|
||||||
|
MULTILINE_CPP_IS_BRIEF = NO
|
||||||
|
DETAILS_AT_TOP = NO
|
||||||
|
INHERIT_DOCS = YES
|
||||||
|
DISTRIBUTE_GROUP_DOC = NO
|
||||||
|
TAB_SIZE = 8
|
||||||
|
ALIASES =
|
||||||
|
OPTIMIZE_OUTPUT_FOR_C = NO
|
||||||
|
OPTIMIZE_OUTPUT_JAVA = NO
|
||||||
|
SUBGROUPING = YES
|
||||||
|
#---------------------------------------------------------------------------
|
||||||
|
# Build related configuration options
|
||||||
|
#---------------------------------------------------------------------------
|
||||||
|
EXTRACT_ALL = NO
|
||||||
|
EXTRACT_PRIVATE = NO
|
||||||
|
EXTRACT_STATIC = NO
|
||||||
|
EXTRACT_LOCAL_CLASSES = YES
|
||||||
|
HIDE_UNDOC_MEMBERS = NO
|
||||||
|
HIDE_UNDOC_CLASSES = NO
|
||||||
|
HIDE_FRIEND_COMPOUNDS = NO
|
||||||
|
HIDE_IN_BODY_DOCS = NO
|
||||||
|
INTERNAL_DOCS = NO
|
||||||
|
CASE_SENSE_NAMES = YES
|
||||||
|
HIDE_SCOPE_NAMES = NO
|
||||||
|
SHOW_INCLUDE_FILES = YES
|
||||||
|
INLINE_INFO = YES
|
||||||
|
SORT_MEMBER_DOCS = YES
|
||||||
|
SORT_BRIEF_DOCS = NO
|
||||||
|
SORT_BY_SCOPE_NAME = NO
|
||||||
|
GENERATE_TODOLIST = YES
|
||||||
|
GENERATE_TESTLIST = YES
|
||||||
|
GENERATE_BUGLIST = YES
|
||||||
|
GENERATE_DEPRECATEDLIST= YES
|
||||||
|
ENABLED_SECTIONS =
|
||||||
|
MAX_INITIALIZER_LINES = 30
|
||||||
|
SHOW_USED_FILES = YES
|
||||||
|
#---------------------------------------------------------------------------
|
||||||
|
# configuration options related to warning and progress messages
|
||||||
|
#---------------------------------------------------------------------------
|
||||||
|
QUIET = NO
|
||||||
|
WARNINGS = YES
|
||||||
|
WARN_IF_UNDOCUMENTED = YES
|
||||||
|
WARN_IF_DOC_ERROR = YES
|
||||||
|
WARN_FORMAT = "$file:$line: $text"
|
||||||
|
WARN_LOGFILE =
|
||||||
|
#---------------------------------------------------------------------------
|
||||||
|
# configuration options related to the input files
|
||||||
|
#---------------------------------------------------------------------------
|
||||||
|
INPUT = /home/lz/src/kkbswitch/kkbswitch
|
||||||
|
FILE_PATTERNS = *.c \
|
||||||
|
*.cc \
|
||||||
|
*.cxx \
|
||||||
|
*.cpp \
|
||||||
|
*.c++ \
|
||||||
|
*.java \
|
||||||
|
*.ii \
|
||||||
|
*.ixx \
|
||||||
|
*.ipp \
|
||||||
|
*.i++ \
|
||||||
|
*.inl \
|
||||||
|
*.h \
|
||||||
|
*.hh \
|
||||||
|
*.hxx \
|
||||||
|
*.hpp \
|
||||||
|
*.h++ \
|
||||||
|
*.idl \
|
||||||
|
*.odl \
|
||||||
|
*.cs \
|
||||||
|
*.php \
|
||||||
|
*.php3 \
|
||||||
|
*.inc \
|
||||||
|
*.C \
|
||||||
|
*.H \
|
||||||
|
*.tlh \
|
||||||
|
*.diff \
|
||||||
|
*.patch \
|
||||||
|
*.moc \
|
||||||
|
*.xpm \
|
||||||
|
*.dox
|
||||||
|
RECURSIVE = yes
|
||||||
|
EXCLUDE =
|
||||||
|
EXCLUDE_SYMLINKS = NO
|
||||||
|
EXCLUDE_PATTERNS =
|
||||||
|
EXAMPLE_PATH =
|
||||||
|
EXAMPLE_PATTERNS = *
|
||||||
|
EXAMPLE_RECURSIVE = NO
|
||||||
|
IMAGE_PATH =
|
||||||
|
INPUT_FILTER =
|
||||||
|
FILTER_SOURCE_FILES = NO
|
||||||
|
#---------------------------------------------------------------------------
|
||||||
|
# configuration options related to source browsing
|
||||||
|
#---------------------------------------------------------------------------
|
||||||
|
SOURCE_BROWSER = NO
|
||||||
|
INLINE_SOURCES = NO
|
||||||
|
STRIP_CODE_COMMENTS = YES
|
||||||
|
REFERENCED_BY_RELATION = YES
|
||||||
|
REFERENCES_RELATION = YES
|
||||||
|
VERBATIM_HEADERS = YES
|
||||||
|
#---------------------------------------------------------------------------
|
||||||
|
# configuration options related to the alphabetical class index
|
||||||
|
#---------------------------------------------------------------------------
|
||||||
|
ALPHABETICAL_INDEX = NO
|
||||||
|
COLS_IN_ALPHA_INDEX = 5
|
||||||
|
IGNORE_PREFIX =
|
||||||
|
#---------------------------------------------------------------------------
|
||||||
|
# configuration options related to the HTML output
|
||||||
|
#---------------------------------------------------------------------------
|
||||||
|
GENERATE_HTML = YES
|
||||||
|
HTML_OUTPUT = html
|
||||||
|
HTML_FILE_EXTENSION = .html
|
||||||
|
HTML_HEADER =
|
||||||
|
HTML_FOOTER =
|
||||||
|
HTML_STYLESHEET =
|
||||||
|
HTML_ALIGN_MEMBERS = YES
|
||||||
|
GENERATE_HTMLHELP = NO
|
||||||
|
CHM_FILE =
|
||||||
|
HHC_LOCATION =
|
||||||
|
GENERATE_CHI = NO
|
||||||
|
BINARY_TOC = NO
|
||||||
|
TOC_EXPAND = NO
|
||||||
|
DISABLE_INDEX = NO
|
||||||
|
ENUM_VALUES_PER_LINE = 4
|
||||||
|
GENERATE_TREEVIEW = NO
|
||||||
|
TREEVIEW_WIDTH = 250
|
||||||
|
#---------------------------------------------------------------------------
|
||||||
|
# configuration options related to the LaTeX output
|
||||||
|
#---------------------------------------------------------------------------
|
||||||
|
GENERATE_LATEX = YES
|
||||||
|
LATEX_OUTPUT = latex
|
||||||
|
LATEX_CMD_NAME = latex
|
||||||
|
MAKEINDEX_CMD_NAME = makeindex
|
||||||
|
COMPACT_LATEX = NO
|
||||||
|
PAPER_TYPE = a4wide
|
||||||
|
EXTRA_PACKAGES =
|
||||||
|
LATEX_HEADER =
|
||||||
|
PDF_HYPERLINKS = NO
|
||||||
|
USE_PDFLATEX = NO
|
||||||
|
LATEX_BATCHMODE = NO
|
||||||
|
LATEX_HIDE_INDICES = NO
|
||||||
|
#---------------------------------------------------------------------------
|
||||||
|
# configuration options related to the RTF output
|
||||||
|
#---------------------------------------------------------------------------
|
||||||
|
GENERATE_RTF = NO
|
||||||
|
RTF_OUTPUT = rtf
|
||||||
|
COMPACT_RTF = NO
|
||||||
|
RTF_HYPERLINKS = NO
|
||||||
|
RTF_STYLESHEET_FILE =
|
||||||
|
RTF_EXTENSIONS_FILE =
|
||||||
|
#---------------------------------------------------------------------------
|
||||||
|
# configuration options related to the man page output
|
||||||
|
#---------------------------------------------------------------------------
|
||||||
|
GENERATE_MAN = NO
|
||||||
|
MAN_OUTPUT = man
|
||||||
|
MAN_EXTENSION = .3
|
||||||
|
MAN_LINKS = NO
|
||||||
|
#---------------------------------------------------------------------------
|
||||||
|
# configuration options related to the XML output
|
||||||
|
#---------------------------------------------------------------------------
|
||||||
|
GENERATE_XML = yes
|
||||||
|
XML_OUTPUT = xml
|
||||||
|
XML_SCHEMA =
|
||||||
|
XML_DTD =
|
||||||
|
XML_PROGRAMLISTING = YES
|
||||||
|
#---------------------------------------------------------------------------
|
||||||
|
# configuration options for the AutoGen Definitions output
|
||||||
|
#---------------------------------------------------------------------------
|
||||||
|
GENERATE_AUTOGEN_DEF = NO
|
||||||
|
#---------------------------------------------------------------------------
|
||||||
|
# configuration options related to the Perl module output
|
||||||
|
#---------------------------------------------------------------------------
|
||||||
|
GENERATE_PERLMOD = NO
|
||||||
|
PERLMOD_LATEX = NO
|
||||||
|
PERLMOD_PRETTY = YES
|
||||||
|
PERLMOD_MAKEVAR_PREFIX =
|
||||||
|
#---------------------------------------------------------------------------
|
||||||
|
# Configuration options related to the preprocessor
|
||||||
|
#---------------------------------------------------------------------------
|
||||||
|
ENABLE_PREPROCESSING = YES
|
||||||
|
MACRO_EXPANSION = NO
|
||||||
|
EXPAND_ONLY_PREDEF = NO
|
||||||
|
SEARCH_INCLUDES = YES
|
||||||
|
INCLUDE_PATH =
|
||||||
|
INCLUDE_FILE_PATTERNS =
|
||||||
|
PREDEFINED =
|
||||||
|
EXPAND_AS_DEFINED =
|
||||||
|
SKIP_FUNCTION_MACROS = YES
|
||||||
|
#---------------------------------------------------------------------------
|
||||||
|
# Configuration::additions related to external references
|
||||||
|
#---------------------------------------------------------------------------
|
||||||
|
TAGFILES =
|
||||||
|
GENERATE_TAGFILE =
|
||||||
|
ALLEXTERNALS = NO
|
||||||
|
EXTERNAL_GROUPS = YES
|
||||||
|
PERL_PATH = /usr/bin/perl
|
||||||
|
#---------------------------------------------------------------------------
|
||||||
|
# Configuration options related to the dot tool
|
||||||
|
#---------------------------------------------------------------------------
|
||||||
|
CLASS_DIAGRAMS = YES
|
||||||
|
HIDE_UNDOC_RELATIONS = YES
|
||||||
|
HAVE_DOT = NO
|
||||||
|
CLASS_GRAPH = YES
|
||||||
|
COLLABORATION_GRAPH = YES
|
||||||
|
UML_LOOK = NO
|
||||||
|
TEMPLATE_RELATIONS = NO
|
||||||
|
INCLUDE_GRAPH = YES
|
||||||
|
INCLUDED_BY_GRAPH = YES
|
||||||
|
CALL_GRAPH = NO
|
||||||
|
GRAPHICAL_HIERARCHY = YES
|
||||||
|
DOT_IMAGE_FORMAT = png
|
||||||
|
DOT_PATH =
|
||||||
|
DOTFILE_DIRS =
|
||||||
|
MAX_DOT_GRAPH_WIDTH = 1024
|
||||||
|
MAX_DOT_GRAPH_HEIGHT = 1024
|
||||||
|
MAX_DOT_GRAPH_DEPTH = 1000
|
||||||
|
GENERATE_LEGEND = YES
|
||||||
|
DOT_CLEANUP = YES
|
||||||
|
#---------------------------------------------------------------------------
|
||||||
|
# Configuration::additions related to the search engine
|
||||||
|
#---------------------------------------------------------------------------
|
||||||
|
SEARCHENGINE = NO
|
@ -0,0 +1,167 @@
|
|||||||
|
Basic Installation
|
||||||
|
==================
|
||||||
|
|
||||||
|
These are generic installation instructions.
|
||||||
|
|
||||||
|
The `configure' shell script attempts to guess correct values for
|
||||||
|
various system-dependent variables used during compilation. It uses
|
||||||
|
those values to create a `Makefile' in each directory of the package.
|
||||||
|
It may also create one or more `.h' files containing system-dependent
|
||||||
|
definitions. Finally, it creates a shell script `config.status' that
|
||||||
|
you can run in the future to recreate the current configuration, a file
|
||||||
|
`config.cache' that saves the results of its tests to speed up
|
||||||
|
reconfiguring, and a file `config.log' containing compiler output
|
||||||
|
(useful mainly for debugging `configure').
|
||||||
|
|
||||||
|
If you need to do unusual things to compile the package, please try
|
||||||
|
to figure out how `configure' could check whether to do them, and mail
|
||||||
|
diffs or instructions to the address given in the `README' so they can
|
||||||
|
be considered for the next release. If at some point `config.cache'
|
||||||
|
contains results you don't want to keep, you may remove or edit it.
|
||||||
|
|
||||||
|
The file `configure.in' is used to create `configure' by a program
|
||||||
|
called `autoconf'. You only need `configure.in' if you want to change
|
||||||
|
it or regenerate `configure' using a newer version of `autoconf'.
|
||||||
|
|
||||||
|
The simplest way to compile this package is:
|
||||||
|
|
||||||
|
1. `cd' to the directory containing the package's source code and type
|
||||||
|
`./configure' to configure the package for your system. If you're
|
||||||
|
using `csh' on an old version of System V, you might need to type
|
||||||
|
`sh ./configure' instead to prevent `csh' from trying to execute
|
||||||
|
`configure' itself.
|
||||||
|
|
||||||
|
Running `configure' takes a while. While running, it prints some
|
||||||
|
messages telling which features it is checking for.
|
||||||
|
|
||||||
|
2. Type `make' to compile the package.
|
||||||
|
|
||||||
|
3. Type `make install' to install the programs and any data files and
|
||||||
|
documentation.
|
||||||
|
|
||||||
|
4. You can remove the program binaries and object files from the
|
||||||
|
source code directory by typing `make clean'.
|
||||||
|
|
||||||
|
Compilers and Options
|
||||||
|
=====================
|
||||||
|
|
||||||
|
Some systems require unusual options for compilation or linking that
|
||||||
|
the `configure' script does not know about. You can give `configure'
|
||||||
|
initial values for variables by setting them in the environment. Using
|
||||||
|
a Bourne-compatible shell, you can do that on the command line like
|
||||||
|
this:
|
||||||
|
CC=c89 CFLAGS=-O2 LIBS=-lposix ./configure
|
||||||
|
|
||||||
|
Or on systems that have the `env' program, you can do it like this:
|
||||||
|
env CPPFLAGS=-I/usr/local/include LDFLAGS=-s ./configure
|
||||||
|
|
||||||
|
Compiling For Multiple Architectures
|
||||||
|
====================================
|
||||||
|
|
||||||
|
You can compile the package for more than one kind of computer at the
|
||||||
|
same time, by placing the object files for each architecture in their
|
||||||
|
own directory. To do this, you must use a version of `make' that
|
||||||
|
supports the `VPATH' variable, such as GNU `make'. `cd' to the
|
||||||
|
directory where you want the object files and executables to go and run
|
||||||
|
the `configure' script. `configure' automatically checks for the
|
||||||
|
source code in the directory that `configure' is in and in `..'.
|
||||||
|
|
||||||
|
If you have to use a `make' that does not supports the `VPATH'
|
||||||
|
variable, you have to compile the package for one architecture at a time
|
||||||
|
in the source code directory. After you have installed the package for
|
||||||
|
one architecture, use `make distclean' before reconfiguring for another
|
||||||
|
architecture.
|
||||||
|
|
||||||
|
Installation Names
|
||||||
|
==================
|
||||||
|
|
||||||
|
By default, `make install' will install the package's files in
|
||||||
|
`/usr/local/bin', `/usr/local/man', etc. You can specify an
|
||||||
|
installation prefix other than `/usr/local' by giving `configure' the
|
||||||
|
option `--prefix=PATH'.
|
||||||
|
|
||||||
|
You can specify separate installation prefixes for
|
||||||
|
architecture-specific files and architecture-independent files. If you
|
||||||
|
give `configure' the option `--exec-prefix=PATH', the package will use
|
||||||
|
PATH as the prefix for installing programs and libraries.
|
||||||
|
Documentation and other data files will still use the regular prefix.
|
||||||
|
|
||||||
|
If the package supports it, you can cause programs to be installed
|
||||||
|
with an extra prefix or suffix on their names by giving `configure' the
|
||||||
|
option `--program-prefix=PREFIX' or `--program-suffix=SUFFIX'.
|
||||||
|
|
||||||
|
Optional Features
|
||||||
|
=================
|
||||||
|
|
||||||
|
Some packages pay attention to `--enable-FEATURE' options to
|
||||||
|
`configure', where FEATURE indicates an optional part of the package.
|
||||||
|
They may also pay attention to `--with-PACKAGE' options, where PACKAGE
|
||||||
|
is something like `gnu-as' or `x' (for the X Window System). The
|
||||||
|
`README' should mention any `--enable-' and `--with-' options that the
|
||||||
|
package recognizes.
|
||||||
|
|
||||||
|
For packages that use the X Window System, `configure' can usually
|
||||||
|
find the X include and library files automatically, but if it doesn't,
|
||||||
|
you can use the `configure' options `--x-includes=DIR' and
|
||||||
|
`--x-libraries=DIR' to specify their locations.
|
||||||
|
|
||||||
|
Specifying the System Type
|
||||||
|
==========================
|
||||||
|
|
||||||
|
There may be some features `configure' can not figure out
|
||||||
|
automatically, but needs to determine by the type of host the package
|
||||||
|
will run on. Usually `configure' can figure that out, but if it prints
|
||||||
|
a message saying it can not guess the host type, give it the
|
||||||
|
`--host=TYPE' option. TYPE can either be a short name for the system
|
||||||
|
type, such as `sun4', or a canonical name with three fields:
|
||||||
|
CPU-COMPANY-SYSTEM
|
||||||
|
|
||||||
|
See the file `config.sub' for the possible values of each field. If
|
||||||
|
`config.sub' isn't included in this package, then this package doesn't
|
||||||
|
need to know the host type.
|
||||||
|
|
||||||
|
If you are building compiler tools for cross-compiling, you can also
|
||||||
|
use the `--target=TYPE' option to select the type of system they will
|
||||||
|
produce code for and the `--build=TYPE' option to select the type of
|
||||||
|
system on which you are compiling the package.
|
||||||
|
|
||||||
|
Sharing Defaults
|
||||||
|
================
|
||||||
|
|
||||||
|
If you want to set default values for `configure' scripts to share,
|
||||||
|
you can create a site shell script called `config.site' that gives
|
||||||
|
default values for variables like `CC', `cache_file', and `prefix'.
|
||||||
|
`configure' looks for `PREFIX/share/config.site' if it exists, then
|
||||||
|
`PREFIX/etc/config.site' if it exists. Or, you can set the
|
||||||
|
`CONFIG_SITE' environment variable to the location of the site script.
|
||||||
|
A warning: not all `configure' scripts look for a site script.
|
||||||
|
|
||||||
|
Operation Controls
|
||||||
|
==================
|
||||||
|
|
||||||
|
`configure' recognizes the following options to control how it
|
||||||
|
operates.
|
||||||
|
|
||||||
|
`--cache-file=FILE'
|
||||||
|
Use and save the results of the tests in FILE instead of
|
||||||
|
`./config.cache'. Set FILE to `/dev/null' to disable caching, for
|
||||||
|
debugging `configure'.
|
||||||
|
|
||||||
|
`--help'
|
||||||
|
Print a summary of the options to `configure', and exit.
|
||||||
|
|
||||||
|
`--quiet'
|
||||||
|
`--silent'
|
||||||
|
`-q'
|
||||||
|
Do not print messages saying which checks are being made.
|
||||||
|
|
||||||
|
`--srcdir=DIR'
|
||||||
|
Look for the package's source code in directory DIR. Usually
|
||||||
|
`configure' can determine that directory automatically.
|
||||||
|
|
||||||
|
`--version'
|
||||||
|
Print the version of Autoconf used to generate the `configure'
|
||||||
|
script, and exit.
|
||||||
|
|
||||||
|
`configure' also accepts some other, not widely useful, options.
|
||||||
|
|
@ -0,0 +1,45 @@
|
|||||||
|
SUBDIRS = $(TOPSUBDIRS)
|
||||||
|
|
||||||
|
$(top_srcdir)/configure.in: configure.in.in $(top_srcdir)/subdirs
|
||||||
|
cd $(top_srcdir) && $(MAKE) -f admin/Makefile.common configure.in ;
|
||||||
|
|
||||||
|
$(top_srcdir)/subdirs:
|
||||||
|
cd $(top_srcdir) && $(MAKE) -f admin/Makefile.common subdirs
|
||||||
|
|
||||||
|
$(top_srcdir)/acinclude.m4: $(top_srcdir)/admin/acinclude.m4.in $(top_srcdir)/admin/libtool.m4.in
|
||||||
|
@cd $(top_srcdir) && cat admin/acinclude.m4.in admin/libtool.m4.in > acinclude.m4
|
||||||
|
|
||||||
|
MAINTAINERCLEANFILES = subdirs configure.in acinclude.m4 configure.files
|
||||||
|
|
||||||
|
package-messages:
|
||||||
|
cd $(top_srcdir) && $(MAKE) includedir=$(kde_includes) -f admin/Makefile.common package-messages
|
||||||
|
$(MAKE) -C po merge
|
||||||
|
|
||||||
|
EXTRA_DIST = admin COPYING configure.in.in Makefile.cvs kkbswitch.1\
|
||||||
|
configure.files Doxyfile kkbswitch.kdevelop kkbswitch.lsm \
|
||||||
|
kkbswitch.spec kkbswitch.xpm subdirs kkbswitch.sgml
|
||||||
|
|
||||||
|
man_MANS = kkbswitch.1
|
||||||
|
DISTCHECK_CONFIGURE_FLAGS = --disable-ru-ua-layout
|
||||||
|
KDE_OPTIONS = noautodist
|
||||||
|
|
||||||
|
dist-hook:
|
||||||
|
cd $(top_distdir) && perl admin/am_edit -padmin
|
||||||
|
cd $(top_distdir) && $(MAKE) -f admin/Makefile.common subdirs
|
||||||
|
# rm -f $(distdir)/kkbswitch.kdevelop.pcs
|
||||||
|
# rm -f $(distdir)/$(PACKAGE)-*.tar.gz
|
||||||
|
|
||||||
|
|
||||||
|
rpmdir = _rpm
|
||||||
|
specfile = $(PACKAGE).spec
|
||||||
|
rpm: $(specfile)
|
||||||
|
rm -rf $(rpmdir)
|
||||||
|
mkdir $(rpmdir)
|
||||||
|
mkdir -p rpms
|
||||||
|
cd $(rpmdir) && \
|
||||||
|
mkdir RPMS SRPMS SOURCES SPECS BUILD RPMS/i386 RPMS/noarch && \
|
||||||
|
cp ../$(specfile) SPECS && \
|
||||||
|
cp ../$(distdir).tar.gz SOURCES && \
|
||||||
|
rpmbuild --define "_topdir "`pwd` -ba SPECS/$(specfile) && \
|
||||||
|
cp SRPMS/* RPMS/*/* ../rpms && cd .. && rm -rf $(rpmdir)
|
||||||
|
|
@ -0,0 +1,10 @@
|
|||||||
|
all:
|
||||||
|
@echo "This Makefile is only for the CVS repository"
|
||||||
|
@echo "This will be deleted before making the distribution"
|
||||||
|
@echo ""
|
||||||
|
$(MAKE) -f admin/Makefile.common cvs
|
||||||
|
|
||||||
|
dist:
|
||||||
|
$(MAKE) -f admin/Makefile.common dist
|
||||||
|
|
||||||
|
.SILENT:
|
@ -0,0 +1,81 @@
|
|||||||
|
NOTE: As of version 1.0 KKBSwitch has online documentation, so refer to it for
|
||||||
|
more information. This README file will no longer be maintained, but the
|
||||||
|
documentation will instead.
|
||||||
|
|
||||||
|
|
||||||
|
KKBSwitch
|
||||||
|
by Leonid Zeitlin <lz@europe.com>
|
||||||
|
Version 1.0
|
||||||
|
|
||||||
|
KKBSwitch is a keyboard layout indicator for KDE 2. It is useful when you have
|
||||||
|
configured the XKeyboard extension of your X Server to have more than one
|
||||||
|
keyboard group, for example US/ASCII and Russian. KKBSwitch displays an icon
|
||||||
|
in the system tray that indicates which layout is currently active. Note that
|
||||||
|
KKBSwitch does not help you configure XKeyboard, it merely serves as the
|
||||||
|
indicator of the current group. You still have to configure XKeyboard by
|
||||||
|
editing XF86Config file.
|
||||||
|
|
||||||
|
KKBSwitch features:
|
||||||
|
- displays an icon in the KDE's system tray indicating the active keyboard group
|
||||||
|
- you can switch keyboard groups by clicking the icon or selecting the
|
||||||
|
desired group from the icon's menu
|
||||||
|
- icons corresponding to different groups are configurable (chosen from country
|
||||||
|
flag pixmaps that ship with KDE)
|
||||||
|
- "Toggle mode" (see below for more).
|
||||||
|
|
||||||
|
Using KKBSwicth.
|
||||||
|
|
||||||
|
The most basic usage is simply to let it sit in the system tray and show you
|
||||||
|
which keyboard group is currently active. You can also click the KKBSwicth
|
||||||
|
system tray icon to switch keyboard layouts. When right-clicked, the system
|
||||||
|
tray icon displays a menu with the following entries:
|
||||||
|
|
||||||
|
- one or more entries corresponding to the configured keyboard groups (XKeyboard
|
||||||
|
can have up to 4 groups configured). The currently active group will be checked.
|
||||||
|
Selecting a menu entry corresponding to a group will make that group active.
|
||||||
|
- "Configure Keyboard Switch..." entry lets you configure KKBSwitch
|
||||||
|
- "About Keyboard Switch" displays a standard "About" dialog
|
||||||
|
- "Quit" quits KKBSwitch.
|
||||||
|
|
||||||
|
Configuring KKBSwicth.
|
||||||
|
|
||||||
|
In the KKBSwitch configuration dialog you can do the following:
|
||||||
|
- set the icons corresponding to the available keyboard groups. Note that
|
||||||
|
KKBSwitch will try hard to guess the correct icon based on the name of the
|
||||||
|
keyboard group (the names are configured in XKeyboard). For example, it will
|
||||||
|
display the US flag for US/ASCII group, German flag for German group, Russian
|
||||||
|
flag for Russian group, etc. If it cannot guess an icon, it will display the
|
||||||
|
"default" icon, which simply shows the group's number. Use the configuration
|
||||||
|
dialog to customize the icons: select a group in the "Available keyboard groups"
|
||||||
|
listbox, and click "Change icon..." button. You will be able to select from the
|
||||||
|
list of country flag pixmaps that is shipped with KDE.
|
||||||
|
- turn the "Toggle mode" on and off. "Toggle mode" is a convient feature of
|
||||||
|
KKBSwitch, which is useful if you have more than 2 groups. When "Toggle mode"
|
||||||
|
is on, pressing the XKeyboard's group switch key or clicking KKBSwitch's tray
|
||||||
|
icon will toggle between the two most recently used groups. To activate the
|
||||||
|
third or the fourth (if available) group you'll need to right-click KKBSwitch's
|
||||||
|
tray icon and select the desired group from the menu. For example, I have
|
||||||
|
US/ASCII, Russian and Ukrainian layouts configured. Most of the time I use
|
||||||
|
either US/ASCII or Russian layout and switch back and forth between them without
|
||||||
|
activating the rarely needed Ukrainian layout. But sometimes I need to write
|
||||||
|
something in Ukrainian, so I select this layout from the tray icon's menu. When
|
||||||
|
"Toggle mode" is on, the two most recently used groups will be marked with an
|
||||||
|
asterisk in the KKBSwitch tray icon's menu.
|
||||||
|
|
||||||
|
|
||||||
|
DCOP Bindings
|
||||||
|
|
||||||
|
As of version 0.2, KKBSwitch can be manipulated programmatically with DCOP.
|
||||||
|
It exports an interface named KBSwitchIntf. The interfaces offers the following
|
||||||
|
methods:
|
||||||
|
- int getNumKbdGroups() - returns the number of configured keyboard groups
|
||||||
|
(layouts)
|
||||||
|
- ASYNC selectNextGroup() - does the same thing as clicking on the KKBSwitch's
|
||||||
|
tray icon, i.e. makes the next keyboard group active. If in "toggle mode", toggles
|
||||||
|
between the two recently used ones, just like clicking on the tray icon does.
|
||||||
|
- ASYNC selectGroup(int groupno) - makes the group whose number is groupno active
|
||||||
|
(like selecting a group from the tray icon popup menu)
|
||||||
|
- QStringList getGroupNames() - returns the list of the keyboard group names,
|
||||||
|
as configured in XKeyboard.
|
||||||
|
|
||||||
|
|
@ -0,0 +1,9 @@
|
|||||||
|
1. Perhaps show items in popup menu that corresponds to the two most
|
||||||
|
frequently used layouts in "toggle mode" in bold, rather then with asterisks.
|
||||||
|
2. Translate documentation.
|
||||||
|
3. Create UI to configure keyboard groups. Should be possible in XFree86
|
||||||
|
>= 4.3 (and X.Org), e.g. run setxkbmap -layout "us,ru,ua"
|
||||||
|
4. Somehow automatically detect wrong keyboard layout. E.g. if I type "vfvf
|
||||||
|
vskf hfve", magically figure out that I meant to type "ÍÁÍÁ ÍÙÌÁ ÒÁÍÕ" in
|
||||||
|
Russian. There are Windows programs that do that, like Punto Switcher.
|
||||||
|
5. Need an icon!
|
File diff suppressed because it is too large
Load Diff
File diff suppressed because it is too large
Load Diff
@ -0,0 +1,225 @@
|
|||||||
|
/* config.h.in. Generated from configure.in by autoheader. */
|
||||||
|
|
||||||
|
/* Define if you have the CoreAudio API */
|
||||||
|
#undef HAVE_COREAUDIO
|
||||||
|
|
||||||
|
/* Define to 1 if you have the <crt_externs.h> header file. */
|
||||||
|
#undef HAVE_CRT_EXTERNS_H
|
||||||
|
|
||||||
|
/* Defines if your system has the crypt function */
|
||||||
|
#undef HAVE_CRYPT
|
||||||
|
|
||||||
|
/* Define to 1 if you have the <dlfcn.h> header file. */
|
||||||
|
#undef HAVE_DLFCN_H
|
||||||
|
|
||||||
|
/* Define to 1 if you have the <inttypes.h> header file. */
|
||||||
|
#undef HAVE_INTTYPES_H
|
||||||
|
|
||||||
|
/* Define if you have libjpeg */
|
||||||
|
#undef HAVE_LIBJPEG
|
||||||
|
|
||||||
|
/* Define if you have libpng */
|
||||||
|
#undef HAVE_LIBPNG
|
||||||
|
|
||||||
|
/* Define if you have a working libpthread (will enable threaded code) */
|
||||||
|
#undef HAVE_LIBPTHREAD
|
||||||
|
|
||||||
|
/* Define to 1 if you have the `xkbfile' library (-lxkbfile). */
|
||||||
|
#undef HAVE_LIBXKBFILE
|
||||||
|
|
||||||
|
/* Define if you have libz */
|
||||||
|
#undef HAVE_LIBZ
|
||||||
|
|
||||||
|
/* Define to 1 if you have the <memory.h> header file. */
|
||||||
|
#undef HAVE_MEMORY_H
|
||||||
|
|
||||||
|
/* Define if your system needs _NSGetEnviron to set up the environment */
|
||||||
|
#undef HAVE_NSGETENVIRON
|
||||||
|
|
||||||
|
/* Define if you have the res_init function */
|
||||||
|
#undef HAVE_RES_INIT
|
||||||
|
|
||||||
|
/* Define if you have a STL implementation by SGI */
|
||||||
|
#undef HAVE_SGI_STL
|
||||||
|
|
||||||
|
/* Define to 1 if you have the `snprintf' function. */
|
||||||
|
#undef HAVE_SNPRINTF
|
||||||
|
|
||||||
|
/* Define to 1 if you have the <stdint.h> header file. */
|
||||||
|
#undef HAVE_STDINT_H
|
||||||
|
|
||||||
|
/* Define to 1 if you have the <stdlib.h> header file. */
|
||||||
|
#undef HAVE_STDLIB_H
|
||||||
|
|
||||||
|
/* Define to 1 if you have the <strings.h> header file. */
|
||||||
|
#undef HAVE_STRINGS_H
|
||||||
|
|
||||||
|
/* Define to 1 if you have the <string.h> header file. */
|
||||||
|
#undef HAVE_STRING_H
|
||||||
|
|
||||||
|
/* Define if you have strlcat */
|
||||||
|
#undef HAVE_STRLCAT
|
||||||
|
|
||||||
|
/* Define if you have the strlcat prototype */
|
||||||
|
#undef HAVE_STRLCAT_PROTO
|
||||||
|
|
||||||
|
/* Define if you have strlcpy */
|
||||||
|
#undef HAVE_STRLCPY
|
||||||
|
|
||||||
|
/* Define if you have the strlcpy prototype */
|
||||||
|
#undef HAVE_STRLCPY_PROTO
|
||||||
|
|
||||||
|
/* Define to 1 if you have the <sys/stat.h> header file. */
|
||||||
|
#undef HAVE_SYS_STAT_H
|
||||||
|
|
||||||
|
/* Define to 1 if you have the <sys/types.h> header file. */
|
||||||
|
#undef HAVE_SYS_TYPES_H
|
||||||
|
|
||||||
|
/* Define to 1 if you have the <unistd.h> header file. */
|
||||||
|
#undef HAVE_UNISTD_H
|
||||||
|
|
||||||
|
/* Define to 1 if you have the `vsnprintf' function. */
|
||||||
|
#undef HAVE_VSNPRINTF
|
||||||
|
|
||||||
|
/* Define to 1 if you have the <X11/extensions/XKBrules.h> header file. */
|
||||||
|
#undef HAVE_X11_EXTENSIONS_XKBRULES_H
|
||||||
|
|
||||||
|
/* Suffix for lib directories */
|
||||||
|
#undef KDELIBSUFF
|
||||||
|
|
||||||
|
/* Define a safe value for MAXPATHLEN */
|
||||||
|
#undef KDEMAXPATHLEN
|
||||||
|
|
||||||
|
/* Name of package */
|
||||||
|
#undef PACKAGE
|
||||||
|
|
||||||
|
/* Define to the address where bug reports for this package should be sent. */
|
||||||
|
#undef PACKAGE_BUGREPORT
|
||||||
|
|
||||||
|
/* Define to the full name of this package. */
|
||||||
|
#undef PACKAGE_NAME
|
||||||
|
|
||||||
|
/* Define to the full name and version of this package. */
|
||||||
|
#undef PACKAGE_STRING
|
||||||
|
|
||||||
|
/* Define to the one symbol short name of this package. */
|
||||||
|
#undef PACKAGE_TARNAME
|
||||||
|
|
||||||
|
/* Define to the version of this package. */
|
||||||
|
#undef PACKAGE_VERSION
|
||||||
|
|
||||||
|
/* The size of a `char *', as computed by sizeof. */
|
||||||
|
#undef SIZEOF_CHAR_P
|
||||||
|
|
||||||
|
/* The size of a `int', as computed by sizeof. */
|
||||||
|
#undef SIZEOF_INT
|
||||||
|
|
||||||
|
/* The size of a `long', as computed by sizeof. */
|
||||||
|
#undef SIZEOF_LONG
|
||||||
|
|
||||||
|
/* The size of a `short', as computed by sizeof. */
|
||||||
|
#undef SIZEOF_SHORT
|
||||||
|
|
||||||
|
/* The size of a `size_t', as computed by sizeof. */
|
||||||
|
#undef SIZEOF_SIZE_T
|
||||||
|
|
||||||
|
/* The size of a `unsigned long', as computed by sizeof. */
|
||||||
|
#undef SIZEOF_UNSIGNED_LONG
|
||||||
|
|
||||||
|
/* Define to 1 if you have the ANSI C header files. */
|
||||||
|
#undef STDC_HEADERS
|
||||||
|
|
||||||
|
/* Version number of package */
|
||||||
|
#undef VERSION
|
||||||
|
|
||||||
|
/* Define to 1 if your processor stores words with the most significant byte
|
||||||
|
first (like Motorola and SPARC, unlike Intel and VAX). */
|
||||||
|
#undef WORDS_BIGENDIAN
|
||||||
|
|
||||||
|
/*
|
||||||
|
* jpeg.h needs HAVE_BOOLEAN, when the system uses boolean in system
|
||||||
|
* headers and I'm too lazy to write a configure test as long as only
|
||||||
|
* unixware is related
|
||||||
|
*/
|
||||||
|
#ifdef _UNIXWARE
|
||||||
|
#define HAVE_BOOLEAN
|
||||||
|
#endif
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
/*
|
||||||
|
* AIX defines FD_SET in terms of bzero, but fails to include <strings.h>
|
||||||
|
* that defines bzero.
|
||||||
|
*/
|
||||||
|
|
||||||
|
#if defined(_AIX)
|
||||||
|
#include <strings.h>
|
||||||
|
#endif
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
#if defined(HAVE_NSGETENVIRON) && defined(HAVE_CRT_EXTERNS_H)
|
||||||
|
# include <sys/time.h>
|
||||||
|
# include <crt_externs.h>
|
||||||
|
# define environ (*_NSGetEnviron())
|
||||||
|
#endif
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
#if !defined(HAVE_STRLCAT_PROTO)
|
||||||
|
#ifdef __cplusplus
|
||||||
|
extern "C" {
|
||||||
|
#endif
|
||||||
|
unsigned long strlcat(char*, const char*, unsigned long);
|
||||||
|
#ifdef __cplusplus
|
||||||
|
}
|
||||||
|
#endif
|
||||||
|
#endif
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
#if !defined(HAVE_STRLCPY_PROTO)
|
||||||
|
#ifdef __cplusplus
|
||||||
|
extern "C" {
|
||||||
|
#endif
|
||||||
|
unsigned long strlcpy(char*, const char*, unsigned long);
|
||||||
|
#ifdef __cplusplus
|
||||||
|
}
|
||||||
|
#endif
|
||||||
|
#endif
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
/*
|
||||||
|
* On HP-UX, the declaration of vsnprintf() is needed every time !
|
||||||
|
*/
|
||||||
|
|
||||||
|
#if !defined(HAVE_VSNPRINTF) || defined(hpux)
|
||||||
|
#if __STDC__
|
||||||
|
#include <stdarg.h>
|
||||||
|
#include <stdlib.h>
|
||||||
|
#else
|
||||||
|
#include <varargs.h>
|
||||||
|
#endif
|
||||||
|
#ifdef __cplusplus
|
||||||
|
extern "C"
|
||||||
|
#endif
|
||||||
|
int vsnprintf(char *str, size_t n, char const *fmt, va_list ap);
|
||||||
|
#ifdef __cplusplus
|
||||||
|
extern "C"
|
||||||
|
#endif
|
||||||
|
int snprintf(char *str, size_t n, char const *fmt, ...);
|
||||||
|
#endif
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
#if defined(__SVR4) && !defined(__svr4__)
|
||||||
|
#define __svr4__ 1
|
||||||
|
#endif
|
||||||
|
|
||||||
|
|
||||||
|
/* Compatibility define */
|
||||||
|
#undef ksize_t
|
||||||
|
|
||||||
|
/* Define the real type of socklen_t */
|
||||||
|
#undef socklen_t
|
@ -0,0 +1,2 @@
|
|||||||
|
./admin/configure.in.min
|
||||||
|
configure.in.in
|
@ -0,0 +1,104 @@
|
|||||||
|
dnl This file is part of the KDE libraries/packages
|
||||||
|
dnl Copyright (C) 2001 Stephan Kulow (coolo@kde.org)
|
||||||
|
|
||||||
|
dnl This file is free software; you can redistribute it and/or
|
||||||
|
dnl modify it under the terms of the GNU Library General Public
|
||||||
|
dnl License as published by the Free Software Foundation; either
|
||||||
|
dnl version 2 of the License, or (at your option) any later version.
|
||||||
|
|
||||||
|
dnl This library is distributed in the hope that it will be useful,
|
||||||
|
dnl but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||||
|
dnl MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
|
||||||
|
dnl Library General Public License for more details.
|
||||||
|
|
||||||
|
dnl You should have received a copy of the GNU Library General Public License
|
||||||
|
dnl along with this library; see the file COPYING.LIB. If not, write to
|
||||||
|
dnl the Free Software Foundation, Inc., 59 Temple Place - Suite 330,
|
||||||
|
dnl Boston, MA 02111-1307, USA.
|
||||||
|
|
||||||
|
# Original Author was Kalle@kde.org
|
||||||
|
# I lifted it in some mater. (Stephan Kulow)
|
||||||
|
# I used much code from Janos Farkas
|
||||||
|
|
||||||
|
dnl Process this file with autoconf to produce a configure script.
|
||||||
|
|
||||||
|
AC_INIT(acinclude.m4) dnl a source file from your sub dir
|
||||||
|
|
||||||
|
dnl This is so we can use kde-common
|
||||||
|
AC_CONFIG_AUX_DIR(admin)
|
||||||
|
|
||||||
|
dnl This ksh/zsh feature conflicts with `cd blah ; pwd`
|
||||||
|
unset CDPATH
|
||||||
|
|
||||||
|
dnl Checking host/target/build systems, for make, install etc.
|
||||||
|
AC_CANONICAL_SYSTEM
|
||||||
|
dnl Perform program name transformation
|
||||||
|
AC_ARG_PROGRAM
|
||||||
|
|
||||||
|
dnl Automake doc recommends to do this only here. (Janos)
|
||||||
|
AM_INIT_AUTOMAKE(kkbswitch, 1.4.3) dnl searches for some needed programs
|
||||||
|
|
||||||
|
KDE_SET_PREFIX
|
||||||
|
|
||||||
|
dnl generate the config header
|
||||||
|
AM_CONFIG_HEADER(config.h) dnl at the distribution this done
|
||||||
|
|
||||||
|
dnl Checks for programs.
|
||||||
|
AC_CHECK_COMPILERS
|
||||||
|
AC_ENABLE_SHARED(yes)
|
||||||
|
AC_ENABLE_STATIC(no)
|
||||||
|
KDE_PROG_LIBTOOL
|
||||||
|
|
||||||
|
dnl for NLS support. Call them in this order!
|
||||||
|
dnl WITH_NLS is for the po files
|
||||||
|
AM_KDE_WITH_NLS
|
||||||
|
|
||||||
|
KDE_USE_QT(3.0.0)
|
||||||
|
AC_PATH_KDE
|
||||||
|
#MIN_CONFIG(3.0.0)
|
||||||
|
|
||||||
|
dnl PACKAGE set before
|
||||||
|
AC_C_BIGENDIAN
|
||||||
|
AC_CHECK_KDEMAXPATHLEN
|
||||||
|
|
||||||
|
AC_CHECK_HEADERS([X11/extensions/XKBrules.h], [], [], [
|
||||||
|
#include <stdio.h>
|
||||||
|
#include <X11/XKBlib.h>])
|
||||||
|
|
||||||
|
save_LDFLAGS="$LDFLAGS"
|
||||||
|
LDFLAGS="$LDFLAGS $all_libraries"
|
||||||
|
AC_CHECK_LIB(xkbfile, XkbRF_GetNamesProp)
|
||||||
|
LDFLAGS="$save_LDFLAGS"
|
||||||
|
|
||||||
|
AC_ARG_ENABLE(ru-ua-layout,
|
||||||
|
[ --enable-ru-ua-layout Install Russian/Ukrainian layout file
|
||||||
|
(default: don't install)],
|
||||||
|
enable_ru_ua_layout="$enableval",
|
||||||
|
enable_ru_ua_layout="no")
|
||||||
|
|
||||||
|
AM_CONDITIONAL(ENABLE_RU_UA_LAYOUT, test "x$enable_ru_ua_layout" = "xyes")
|
||||||
|
|
||||||
|
dnl set prefix according to installed KDE. Strange that KDE build scripts
|
||||||
|
dnl don't do it by default
|
||||||
|
AC_PREFIX_DEFAULT(`kde-config --prefix`)
|
||||||
|
|
||||||
|
KDE_CREATE_SUBDIRSLIST
|
||||||
|
AC_CONFIG_FILES([ Makefile ])
|
||||||
|
AC_CONFIG_FILES([ doc/Makefile ])
|
||||||
|
AC_CONFIG_FILES([ doc/en/Makefile ])
|
||||||
|
AC_CONFIG_FILES([ kkbswitch/Makefile ])
|
||||||
|
AC_CONFIG_FILES([ kkbswitch.upd/Makefile ])
|
||||||
|
AC_CONFIG_FILES([ po/Makefile ])
|
||||||
|
AC_OUTPUT
|
||||||
|
if test "$all_tests" = "bad"; then
|
||||||
|
if test ! "$cache_file" = "/dev/null"; then
|
||||||
|
echo ""
|
||||||
|
echo "Please remove the file $cache_file after changing your setup"
|
||||||
|
echo "so that configure will find the changes next time."
|
||||||
|
echo ""
|
||||||
|
fi
|
||||||
|
else
|
||||||
|
echo ""
|
||||||
|
echo "Good - your configure finished. Start make now"
|
||||||
|
echo ""
|
||||||
|
fi
|
@ -0,0 +1,27 @@
|
|||||||
|
#MIN_CONFIG(3.0.0)
|
||||||
|
|
||||||
|
AM_INIT_AUTOMAKE(kkbswitch, 1.4.3)
|
||||||
|
AC_C_BIGENDIAN
|
||||||
|
AC_CHECK_KDEMAXPATHLEN
|
||||||
|
|
||||||
|
AC_CHECK_HEADERS([X11/extensions/XKBrules.h], [], [], [
|
||||||
|
#include <stdio.h>
|
||||||
|
#include <X11/XKBlib.h>])
|
||||||
|
|
||||||
|
save_LDFLAGS="$LDFLAGS"
|
||||||
|
LDFLAGS="$LDFLAGS $all_libraries"
|
||||||
|
AC_CHECK_LIB(xkbfile, XkbRF_GetNamesProp)
|
||||||
|
LDFLAGS="$save_LDFLAGS"
|
||||||
|
|
||||||
|
AC_ARG_ENABLE(ru-ua-layout,
|
||||||
|
[ --enable-ru-ua-layout Install Russian/Ukrainian layout file
|
||||||
|
(default: don't install)],
|
||||||
|
enable_ru_ua_layout="$enableval",
|
||||||
|
enable_ru_ua_layout="no")
|
||||||
|
|
||||||
|
AM_CONDITIONAL(ENABLE_RU_UA_LAYOUT, test "x$enable_ru_ua_layout" = "xyes")
|
||||||
|
|
||||||
|
dnl set prefix according to installed KDE. Strange that KDE build scripts
|
||||||
|
dnl don't do it by default
|
||||||
|
AC_PREFIX_DEFAULT(`kde-config --prefix`)
|
||||||
|
|
@ -0,0 +1,6 @@
|
|||||||
|
# the SUBDIRS is filled automatically by am_edit. If files are
|
||||||
|
# in this directory they are installed into the english dir
|
||||||
|
|
||||||
|
KDE_LANG = en
|
||||||
|
KDE_DOCS = kkbswitch
|
||||||
|
SUBDIRS = $(AUTODIRS)
|
@ -0,0 +1,13 @@
|
|||||||
|
KDE_DOCS = kkbswitch
|
||||||
|
KDE_LANG = en
|
||||||
|
|
||||||
|
.PHONY: html
|
||||||
|
|
||||||
|
html: HTML/index.html
|
||||||
|
|
||||||
|
HTML/index.html: $(srcdir)/index.docbook
|
||||||
|
rm -fr HTML
|
||||||
|
mkdir HTML
|
||||||
|
(cd HTML && meinproc --check --stylesheet $(KDE_XSL_STYLESHEET) ../$(srcdir)/index.docbook && ln -s /usr/share/doc/HTML/en/common; \
|
||||||
|
for name in ../$(srcdir)/*.png; do ln -s $$name; done)
|
||||||
|
|
After Width: | Height: | Size: 844 B |
After Width: | Height: | Size: 1.3 KiB |
After Width: | Height: | Size: 807 B |
@ -0,0 +1,695 @@
|
|||||||
|
<?xml version="1.0" ?>
|
||||||
|
<!DOCTYPE book PUBLIC "-//KDE//DTD DocBook XML V4.1-Based Variant V1.0//EN"
|
||||||
|
"dtd/kdex.dtd" [
|
||||||
|
<!ENTITY kkbswitch '<application>KKBSwitch</application>'>
|
||||||
|
<!ENTITY kapp "&kkbswitch;"><!-- replace KKBSwitch here -->
|
||||||
|
<!ENTITY kkbswitchVersion '1.4.3'>
|
||||||
|
<!ENTITY % addindex "IGNORE">
|
||||||
|
<!ENTITY % English "INCLUDE"><!-- change language only here -->
|
||||||
|
|
||||||
|
|
||||||
|
<!-- Do not define any other entities; instead, use the entities
|
||||||
|
from kde-genent.entities and $LANG/user.entities. -->
|
||||||
|
]>
|
||||||
|
<!-- kdoctemplate v0.8 October 1 1999
|
||||||
|
Minor update to "Credits and Licenses" section on August 24, 2000
|
||||||
|
Removed "Revision history" section on 22 January 2001 -->
|
||||||
|
|
||||||
|
|
||||||
|
<book lang="&language;">
|
||||||
|
|
||||||
|
<bookinfo>
|
||||||
|
<title>The &kkbswitch; Handbook</title>
|
||||||
|
|
||||||
|
<authorgroup>
|
||||||
|
<author>
|
||||||
|
<firstname>Leonid</firstname>
|
||||||
|
<surname>Zeitlin</surname>
|
||||||
|
<affiliation>
|
||||||
|
<address><email>lz@europe.com</email></address>
|
||||||
|
</affiliation>
|
||||||
|
</author>
|
||||||
|
</authorgroup>
|
||||||
|
|
||||||
|
<!-- TRANS:ROLES_OF_TRANSLATORS -->
|
||||||
|
|
||||||
|
<copyright>
|
||||||
|
<year>2002, 2003, 2004, 2005</year>
|
||||||
|
<holder>Leonid Zeitlin</holder>
|
||||||
|
</copyright>
|
||||||
|
<legalnotice>&FDLNotice;</legalnotice>
|
||||||
|
|
||||||
|
<date>23/01/2005</date>
|
||||||
|
<releaseinfo>&kkbswitchVersion;</releaseinfo>
|
||||||
|
|
||||||
|
<!-- Abstract about this handbook -->
|
||||||
|
|
||||||
|
<abstract>
|
||||||
|
<para>
|
||||||
|
&kkbswitch; is a keyboard layout indicator for &kde;.
|
||||||
|
</para>
|
||||||
|
</abstract>
|
||||||
|
|
||||||
|
<keywordset>
|
||||||
|
<keyword>KDE</keyword>
|
||||||
|
<keyword>KKBSwitch</keyword>
|
||||||
|
<keyword>keyboard</keyword>
|
||||||
|
<keyword>layout</keyword>
|
||||||
|
<keyword>indicator</keyword>
|
||||||
|
<keyword>XKeyboard</keyword>
|
||||||
|
</keywordset>
|
||||||
|
|
||||||
|
</bookinfo>
|
||||||
|
|
||||||
|
<chapter id="introduction">
|
||||||
|
<title>Introduction</title>
|
||||||
|
|
||||||
|
<para>
|
||||||
|
&kkbswitch; is a keyboard layout indicator for &kde; 2 or 3. It is useful when
|
||||||
|
you have configured the XKeyboard extension of your X Server to have more than
|
||||||
|
one keyboard group (layout), for example US/ASCII and Russian. &kkbswitch;
|
||||||
|
displays an icon in the system tray that indicates which layout is currently
|
||||||
|
active. Note that &kkbswitch; does not help you configure XKeyboard, it merely
|
||||||
|
serves as the indicator of the current layout. You still have to configure
|
||||||
|
XKeyboard by editing the <filename>XF86Config</filename> file.
|
||||||
|
</para>
|
||||||
|
<para>
|
||||||
|
Please report any problems or feature requests to the author, Leonid
|
||||||
|
Zeitlin, at the address <email>lz@europe.com</email>.
|
||||||
|
</para>
|
||||||
|
|
||||||
|
</chapter>
|
||||||
|
|
||||||
|
<chapter id="using-kapp">
|
||||||
|
<title>Using &kkbswitch;</title>
|
||||||
|
|
||||||
|
<para>
|
||||||
|
The most basic usage is simply to let it sit in the system tray and show you
|
||||||
|
which keyboard layout is currently active. You can also click the KKBSwicth
|
||||||
|
system tray icon to switch keyboard layouts. When right-clicked, the system
|
||||||
|
tray icon displays a menu with the following entries:
|
||||||
|
</para>
|
||||||
|
|
||||||
|
<itemizedlist>
|
||||||
|
<listitem><para>
|
||||||
|
One or more entries corresponding to the configured keyboard layouts.
|
||||||
|
Note that XKeyboard can have up to 4 layouts configured. The currently active
|
||||||
|
layout will be checked. Selecting a menu entry corresponding to a layout will
|
||||||
|
make that layout active.
|
||||||
|
</para></listitem>
|
||||||
|
<listitem><para>
|
||||||
|
<guimenuitem>"Configure Keyboard Switch..."</guimenuitem>.
|
||||||
|
This entry lets you configure &kkbswitch;
|
||||||
|
</para></listitem>
|
||||||
|
<listitem><para>
|
||||||
|
<guimenuitem>"Help"</guimenuitem>. Brings up the online help (probably the
|
||||||
|
document you are reading now).
|
||||||
|
</para></listitem>
|
||||||
|
<listitem><para>
|
||||||
|
<guimenuitem>"About Keyboard Switch"</guimenuitem>.
|
||||||
|
This entry displays a standard "About" dialog box.
|
||||||
|
</para></listitem>
|
||||||
|
<listitem><para>
|
||||||
|
<guimenuitem>"Quit"</guimenuitem>.
|
||||||
|
Quit &kkbswitch;.
|
||||||
|
</para></listitem>
|
||||||
|
</itemizedlist>
|
||||||
|
|
||||||
|
<sect1 id="configure-kkbswitch">
|
||||||
|
<title>Configuring &kkbswitch;</title>
|
||||||
|
|
||||||
|
<para>
|
||||||
|
In the &kkbswitch; configuration dialog (invoked by selecting
|
||||||
|
<guimenuitem>"Configure Keyboard Switch..."</guimenuitem> from the tray icon's
|
||||||
|
context menu) you will be able to configure various aspects of &kkbswitch;'s
|
||||||
|
behavior. The configuration dialog consits of two pages, <guilabel>General</guilabel>
|
||||||
|
and <guilabel>Shortcuts</guilabel>.
|
||||||
|
</para>
|
||||||
|
|
||||||
|
<sect2 id="general-page">
|
||||||
|
<title>The <guilabel>General</guilabel> page</title>
|
||||||
|
|
||||||
|
<sect3 id="specifying-icons">
|
||||||
|
<title>Setting the icons corresponding to the available keyboard
|
||||||
|
layouts</title>
|
||||||
|
|
||||||
|
<para>
|
||||||
|
The appearance of the system tray icons that represent keyboard layouts depends on the icon <emphasis>style</emphasis>. &kkbswitch; implements the following three styles:
|
||||||
|
<variablelist>
|
||||||
|
<varlistentry>
|
||||||
|
<term>Country flag</term>
|
||||||
|
<listitem><para>
|
||||||
|
This style displays a country flag corresponding to the currently selected layout.
|
||||||
|
Note that this was the only style in version of &kkbswitch; prior to 1.3.
|
||||||
|
</para></listitem>
|
||||||
|
</varlistentry>
|
||||||
|
|
||||||
|
<varlistentry>
|
||||||
|
<term>Language code</term>
|
||||||
|
<listitem><para>
|
||||||
|
This style displays the two-letter ISO language code corresponding to the currently selected layout. This style mimics &Windows; layout indicator.
|
||||||
|
</para></listitem>
|
||||||
|
</varlistentry>
|
||||||
|
|
||||||
|
<varlistentry>
|
||||||
|
<term>Flag and code</term>
|
||||||
|
<listitem><para>
|
||||||
|
This style displays the language code against the background of a country flag. This style mimics &kde;'s <application>kxkb</application> application.
|
||||||
|
</para></listitem>
|
||||||
|
</varlistentry>
|
||||||
|
</variablelist>
|
||||||
|
</para>
|
||||||
|
|
||||||
|
<para>The following table illustrates the look of &kkbswitch; tray icon menu with different icon styles.
|
||||||
|
<informaltable>
|
||||||
|
<tgroup cols="3">
|
||||||
|
<thead>
|
||||||
|
<row>
|
||||||
|
<entry>Country flag</entry>
|
||||||
|
<entry>Language code</entry>
|
||||||
|
<entry>Flag and code</entry>
|
||||||
|
</row>
|
||||||
|
</thead>
|
||||||
|
<tbody>
|
||||||
|
<row>
|
||||||
|
<entry>
|
||||||
|
<inlinemediaobject>
|
||||||
|
<imageobject><imagedata fileref="flag_style.png"/></imageobject>
|
||||||
|
</inlinemediaobject>
|
||||||
|
</entry>
|
||||||
|
|
||||||
|
<entry>
|
||||||
|
<inlinemediaobject>
|
||||||
|
<imageobject><imagedata fileref="code_style.png"/></imageobject>
|
||||||
|
</inlinemediaobject>
|
||||||
|
</entry>
|
||||||
|
|
||||||
|
<entry>
|
||||||
|
<inlinemediaobject>
|
||||||
|
<imageobject><imagedata fileref="flag_code_style.png"/></imageobject>
|
||||||
|
</inlinemediaobject>
|
||||||
|
</entry>
|
||||||
|
</row>
|
||||||
|
</tbody>
|
||||||
|
</tgroup>
|
||||||
|
</informaltable>
|
||||||
|
</para>
|
||||||
|
|
||||||
|
<para>
|
||||||
|
The desired style can be selected in the <guilabel>Layout icon style</guilabel> combo box.
|
||||||
|
</para>
|
||||||
|
|
||||||
|
<para>
|
||||||
|
Note that &kkbswitch; will try hard to guess the correct flag and language code based on the name of the
|
||||||
|
keyboard layout (the names are configured in XKeyboard). For example, it will
|
||||||
|
display the US flag and/or "EN" language code for US/ASCII layout, German flag and/or "DE" language code for German layout,
|
||||||
|
Russian flag and/or "RU" language code for Russian layout, etc. If it cannot guess
|
||||||
|
an icon, it will display a "default" icon, which simply shows the layout's number.
|
||||||
|
Use the configuration dialog to customize flag icons: select a layout in the
|
||||||
|
<guilabel>"Available keyboard layouts"</guilabel> listbox and click
|
||||||
|
<guibutton>"Change icon..."</guibutton> button. You will be presented with "Pick icon" dialog box. There you will be able to select from the list of country flag pixmaps that are shipped with &kde;. If you'd like to use a custom image, click the <guibutton>"Browse"</guibutton> button in the bottom of the dialog box and browse for the image file you'd like to use. Note that the preferred size for layout icons is 21 by 14 pixels. If your image has different dimensions, &kkbswitch; will scale it appropriately, but the result might look not very good.
|
||||||
|
</para>
|
||||||
|
|
||||||
|
<para>
|
||||||
|
Note that changing the icon is not available for the Language Code style, which does not feature a flag.
|
||||||
|
</para>
|
||||||
|
|
||||||
|
<para>
|
||||||
|
If you have specified a custom icon for a layout, you can always go back to the standard icon (the one the &kkbswitch; has guessed) by clicking <guibutton>"Use Default Icon"</guibutton> button. This button will be enabled only when the layout selected in the <guilabel>"Available keyboard layouts"</guilabel> listbox has a custom icon.
|
||||||
|
</para>
|
||||||
|
</sect3>
|
||||||
|
|
||||||
|
<sect3 id="default-group">
|
||||||
|
<title>Specifying default layout</title>
|
||||||
|
<para>
|
||||||
|
You can mark one of the configured keyboard layouts as the default. The default
|
||||||
|
layout will be activated when &kkbswitch; starts up. To mark a layout as
|
||||||
|
default, simply select the layout in the <guilabel>"Available keyboard
|
||||||
|
layouts"</guilabel> listbox and click <guibutton>"Set as default"</guibutton>
|
||||||
|
button. The default layout's name is shown in boldface in the
|
||||||
|
<guilabel>"Available keyboard layouts"</guilabel> listbox.
|
||||||
|
</para>
|
||||||
|
</sect3>
|
||||||
|
|
||||||
|
<sect3 id="group-scope">
|
||||||
|
<title>Specifying layout scope</title>
|
||||||
|
<para>
|
||||||
|
&kkbswitch; supports three modes of operation with regards to the scope of the active keyboard layout. Possible settings are:
|
||||||
|
<variablelist>
|
||||||
|
|
||||||
|
<varlistentry>
|
||||||
|
<term>All windows</term>
|
||||||
|
<listitem>
|
||||||
|
<para>
|
||||||
|
In this mode the active layout applies to all windows on your desktop. In other words, at any given time all windows use the same layout.
|
||||||
|
</para>
|
||||||
|
</listitem>
|
||||||
|
</varlistentry>
|
||||||
|
|
||||||
|
<varlistentry>
|
||||||
|
<term>Windows of one application</term>
|
||||||
|
<listitem>
|
||||||
|
<para>
|
||||||
|
In this mode the active layout applies to windows one application<footnote><para>A technically inclined user familiar with &X-Window; API would be interested to know that &kkbswitch; considers windows that have the same Window Class (from WM_CLASS property) as belonging to the same application.</para></footnote>. In other words, each application has its own active layout. When a window gets focused, KKBSwitch automatically shows the active layout of this window's application in the system tray. When you change the active layout, either by pressing XKeyboard's group switch key, or by clicking KKBSwitch's tray icon, or by using its context menu, this change affects only the currently active application. Other applications retain their layouts.
|
||||||
|
</para>
|
||||||
|
</listitem>
|
||||||
|
</varlistentry>
|
||||||
|
|
||||||
|
<varlistentry>
|
||||||
|
<term>One window</term>
|
||||||
|
<listitem>
|
||||||
|
<para>
|
||||||
|
In this mode the active layout applies to the focused window only. In other words, each window has its own active layout. When a window gets focused, KKBSwitch automatically shows this window's active layout in the system tray. When you change the active layout, either by pressing XKeyboard's group switch key, or by clicking KKBSwitch's tray icon, or by using its context menu, this change affects only the currently focused window. Other windows retain their layouts.
|
||||||
|
</para>
|
||||||
|
</listitem>
|
||||||
|
</varlistentry>
|
||||||
|
|
||||||
|
</variablelist>
|
||||||
|
</para>
|
||||||
|
|
||||||
|
<para>
|
||||||
|
Pick the mode that you prefer in the <guilabel>"Layout applies to"</guilabel> combo box. The author's opinion is that "Windows of one application" is the most reasonable choice, but opinions vary.
|
||||||
|
</para>
|
||||||
|
|
||||||
|
<para>
|
||||||
|
Note that in "Windows of one application" and "One window" modes, all new windows start up with the default layout. In "All windows" mode new windows start with the active (global) layout.
|
||||||
|
</para>
|
||||||
|
</sect3>
|
||||||
|
|
||||||
|
<sect3 id="toggle-mode">
|
||||||
|
<title>Using "Toggle Mode"</title>
|
||||||
|
<para>
|
||||||
|
"Toggle mode" is a convenient feature of &kkbswitch;, which is useful if you
|
||||||
|
have more than 2 layouts. When "Toggle mode" is on, pressing the XKeyboard's
|
||||||
|
group switch key or clicking &kkbswitch;'s tray icon will toggle between the
|
||||||
|
two most recently used layouts. To activate the third or the fourth (if
|
||||||
|
available) layout
|
||||||
|
you'll need to right-click &kkbswitch;'s tray icon and select the desired
|
||||||
|
layout from the menu or use keyboard shortcuts (see <xref linkend="shortcuts"/>). For example, I have US/ASCII, Russian and Ukrainian
|
||||||
|
layouts configured. Most of the time I use either US/ASCII or Russian layout and
|
||||||
|
switch back and forth between them without activating the rarely needed
|
||||||
|
Ukrainian layout. But sometimes I need to write something in Ukrainian, so I
|
||||||
|
select this layout from the tray icon's menu.
|
||||||
|
</para>
|
||||||
|
<para>
|
||||||
|
To turn the "Toggle mode" on and off use the <guilabel>Use "Toggle
|
||||||
|
Mode"</guilabel> checkbox in the configuration dialog.
|
||||||
|
</para>
|
||||||
|
|
||||||
|
<para>
|
||||||
|
When "Toggle mode" is on, the two most recently used layouts will be marked
|
||||||
|
with an asterisk in the &kkbswitch; tray icon's menu.
|
||||||
|
</para>
|
||||||
|
|
||||||
|
</sect3>
|
||||||
|
|
||||||
|
<sect3 id="autostart">
|
||||||
|
<title>Starting &kkbswitch; automatically when you log in</title>
|
||||||
|
<para>
|
||||||
|
Use <guilabel>"Autostart"</guilabel> checkbox to enable &kkbswitch; autostart feature. When this checkbox is on, &kkbswitch; will start automatically each time you log in to &kde;. Note that this is independent of &kde;'s session restoration feature. If you configure &kde; to restore the previous session on login (under &kde; Components | Session Manager in &kcontrolcenter;), and &kkbswitch; was running in your previous session, &kde; will restore &kkbswitch;
|
||||||
|
in the new session regardless of the autostart setting.
|
||||||
|
</para>
|
||||||
|
</sect3>
|
||||||
|
|
||||||
|
</sect2>
|
||||||
|
|
||||||
|
<sect2 id="shortcuts">
|
||||||
|
<title>The <guilabel>Shortcuts</guilabel> page</title>
|
||||||
|
<para>
|
||||||
|
&kkbswitch; allows you to quickly activate particular layouts with keyboard shortcuts. This is configured at the <guilabel>Shortcuts</guilabel> page.
|
||||||
|
The <guilabel>"Use shortcuts to activate keyboard layouts"</guilabel> checkbox allows to turns the shortcut feature on and off. Uncheck the checkbox if you don't want to use shortcuts at all. If the checkbox is checked, the shortcuts are enabled. You can configure what key combinations activate which layouts at the key chooser pane under the checkbox. This is a standard &kde; key chooser widget that should be familiar to you from other &kde; applications. The default shortcuts are: <keycombo action="simul"><keycap>Ctrl</keycap> <keycap>Alt</keycap> <keycap>1</keycap></keycombo> to activate the first layout, <keycombo action="simul"><keycap>Ctrl</keycap> <keycap>Alt</keycap> <keycap>2</keycap></keycombo> the activate the second one, etc.
|
||||||
|
</para>
|
||||||
|
</sect2>
|
||||||
|
|
||||||
|
<sect2 id="group-names">
|
||||||
|
<title>How &kkbswitch; guesses icons for keyboard layouts</title>
|
||||||
|
<para>
|
||||||
|
&kkbswitch; uses the name of the keyboard layout, as defined by XKeyboard, to
|
||||||
|
guess the icon to represent it. The process is entirely automatic; this section
|
||||||
|
is only for those who want to tweak how this guessing works or just are curious.
|
||||||
|
The algorithm is very simple. The &kkbswitch; distribution contains a file named
|
||||||
|
<filename>group_names</filename>, which resides in &kkbswitch;'s data directory
|
||||||
|
(<filename
|
||||||
|
class="directory">$<envar>KDEDIR</envar>/share/apps/kkbswitch</filename>).
|
||||||
|
The file is a standard &kde; config file. It contains two sections. The secion named "Mapping" contains mappings from XKeyboard group names to country codes.
|
||||||
|
It contains various key=value pairs, key being the name of the XKeyboard layout and
|
||||||
|
value the two-letter country code of the flag to display. The second section, "Language" contains similar mappings from XKeyboard group names to language codes. Note that if a group name is not found in the "Language" section, it is looked up in "Mapping" section, thus only layouts where country code and language code do not coincide need to be listed in "Language" section (e.g. for US/ASCII group the country code would be "us", but the language code would be "en").
|
||||||
|
</para>
|
||||||
|
|
||||||
|
<para>
|
||||||
|
Once the country-code
|
||||||
|
has been determined, &kkbswitch; will look for an icon named
|
||||||
|
<filename>flag.png</filename> in the directory <filename
|
||||||
|
class="directory">$<envar>KDEDIR</envar>/share/locale/l10n/<replaceable>country code</replaceable></filename> for icons styles that feature a flag and use the language code for styles that feature the a language code.
|
||||||
|
</para>
|
||||||
|
|
||||||
|
<para>
|
||||||
|
As I was told, in &RedHat; 9 systems, the &kde; default country flag icons are missing. To work around that, if &kkbswitch; cannot find country flag icons in the location specified above, it will look for <acronym>GNOME</acronym>'s <application>gkb</application> icons in <filename class="directory">/usr/share/pixmaps/gkb</filename>. Unfortunately, <application>gkb</application> icons have size 40x60, while &kde; ones are 21x14. Thus &kkbswitch; rescales <application>gkb</application> icons on the fly, and the quality of the resulting images leaves a lot to be desired. But still it's better than nothing.
|
||||||
|
</para>
|
||||||
|
|
||||||
|
<para>
|
||||||
|
Of course, you can override the flag icon selection algorithm by specifying the icon you want to use, as described in <xref linkend="specifying-icons"/>.
|
||||||
|
</para>
|
||||||
|
|
||||||
|
</sect2>
|
||||||
|
</sect1>
|
||||||
|
</chapter>
|
||||||
|
|
||||||
|
<chapter id="developers">
|
||||||
|
<title>Developer's Guide to &kkbswitch;</title>
|
||||||
|
|
||||||
|
<para>
|
||||||
|
&kkbswitch; can be manipulated programmatically via DCOP. It exports an
|
||||||
|
interface named <classname>KBSwitchIntf</classname>. The interface offers the
|
||||||
|
following methods.
|
||||||
|
</para>
|
||||||
|
|
||||||
|
<funcsynopsis>
|
||||||
|
<funcprototype>
|
||||||
|
<funcdef>int <function>getNumKbdGroups</function></funcdef>
|
||||||
|
<void/>
|
||||||
|
</funcprototype>
|
||||||
|
</funcsynopsis>
|
||||||
|
<para>
|
||||||
|
This method returns the number of configured keyboard groups (layouts).
|
||||||
|
</para>
|
||||||
|
|
||||||
|
<funcsynopsis>
|
||||||
|
<funcprototype>
|
||||||
|
<funcdef>ASYNC <function>selectNextGroup</function></funcdef>
|
||||||
|
<void/>
|
||||||
|
</funcprototype>
|
||||||
|
</funcsynopsis>
|
||||||
|
<para>
|
||||||
|
This method does the same thing as clicking on the &kkbswitch;'s
|
||||||
|
tray icon, i.e. makes the next keyboard layout active. If in "toggle mode",
|
||||||
|
toggles between the two recently used ones, just like clicking on the tray icon
|
||||||
|
does.
|
||||||
|
</para>
|
||||||
|
|
||||||
|
<funcsynopsis>
|
||||||
|
<funcprototype>
|
||||||
|
<funcdef>ASYNC <function>selectGroup</function></funcdef>
|
||||||
|
<paramdef>int <parameter>groupno</parameter></paramdef>
|
||||||
|
</funcprototype>
|
||||||
|
</funcsynopsis>
|
||||||
|
<para>
|
||||||
|
This method makes the layout whose number is <parameter>groupno</parameter>
|
||||||
|
active (like selecting a layout from the tray icon popup menu).
|
||||||
|
</para>
|
||||||
|
|
||||||
|
<funcsynopsis>
|
||||||
|
<funcprototype>
|
||||||
|
<funcdef>QStringList <function>getGroupNames</function></funcdef>
|
||||||
|
<void/>
|
||||||
|
</funcprototype>
|
||||||
|
</funcsynopsis>
|
||||||
|
<para>
|
||||||
|
This method returns the list of the keyboard layout names, as configured in
|
||||||
|
XKeyboard.
|
||||||
|
</para>
|
||||||
|
|
||||||
|
<sect1 id="examples">
|
||||||
|
<title>Examples</title>
|
||||||
|
<para>
|
||||||
|
The following examples illustrate how one can manipulate &kkbswitch; with the
|
||||||
|
command line tool <command>dcop</command>.
|
||||||
|
</para>
|
||||||
|
|
||||||
|
<informalexample>
|
||||||
|
<para>Select the next keyboard group (layout):</para>
|
||||||
|
<para>
|
||||||
|
<screen>
|
||||||
|
<prompt>%</prompt> <userinput><command>dcop</command> kkbswitch KBSwitchIntf selectNextGroup</userinput>
|
||||||
|
</screen>
|
||||||
|
</para>
|
||||||
|
</informalexample>
|
||||||
|
|
||||||
|
<informalexample>
|
||||||
|
<para>Select the group (layout) number 0:</para>
|
||||||
|
<para>
|
||||||
|
<screen>
|
||||||
|
<prompt>%</prompt> <userinput><command>dcop</command> kkbswitch KBSwitchIntf selectGroup 0</userinput>
|
||||||
|
</screen>
|
||||||
|
</para>
|
||||||
|
</informalexample>
|
||||||
|
|
||||||
|
</sect1>
|
||||||
|
</chapter>
|
||||||
|
|
||||||
|
|
||||||
|
<chapter id="credits">
|
||||||
|
|
||||||
|
<title>Credits and License</title>
|
||||||
|
|
||||||
|
<para>
|
||||||
|
&kkbswitch;
|
||||||
|
</para>
|
||||||
|
<para>
|
||||||
|
Program copyright 2001-2004 Leonid Zeitlin <email>lz@europe.com</email>
|
||||||
|
</para>
|
||||||
|
|
||||||
|
<para>
|
||||||
|
Contributors:
|
||||||
|
<itemizedlist>
|
||||||
|
<listitem><para>Mikhail Senin <email>m_senin@mail.ru</email> - implemented
|
||||||
|
configuration for the default layout and per-window layouts
|
||||||
|
</para>
|
||||||
|
</listitem>
|
||||||
|
|
||||||
|
<listitem>
|
||||||
|
<para>
|
||||||
|
Rashid N. Achilov <email>achilov@granch.ru</email> - made a FreeBSD port, suggested "Browse" button in "Pick icon" dialog box.
|
||||||
|
</para>
|
||||||
|
</listitem>
|
||||||
|
|
||||||
|
<listitem>
|
||||||
|
<para>
|
||||||
|
Vadim Kriklivy <email>analitic@vinnitsa.com</email> - suggested "Language code" icon style (a la &Windows;) and shortcuts feature, made Ukrainian translation.
|
||||||
|
</para>
|
||||||
|
</listitem>
|
||||||
|
|
||||||
|
<listitem>
|
||||||
|
<para>
|
||||||
|
Sergey V Turchin <email>zerg@altlinux.org</email> - implemented autostart feature.
|
||||||
|
</para>
|
||||||
|
</listitem>
|
||||||
|
|
||||||
|
<listitem>
|
||||||
|
<para>
|
||||||
|
Stergios Dramis <email>sdramis@egnatia.ee.auth.gr</email> - contributed Greek translation.
|
||||||
|
</para>
|
||||||
|
</listitem>
|
||||||
|
|
||||||
|
<listitem>
|
||||||
|
<para>
|
||||||
|
Michal Šulek <email>reloadshot@atlas.sk</email> - contributed Slovak translation.
|
||||||
|
</para>
|
||||||
|
</listitem>
|
||||||
|
|
||||||
|
<listitem>
|
||||||
|
<para>
|
||||||
|
Shlomi Loubaton <email>shlomister@gmail.com</email> - contributed manpage, Debian package
|
||||||
|
maintainer.
|
||||||
|
</para>
|
||||||
|
</listitem>
|
||||||
|
|
||||||
|
<listitem>
|
||||||
|
<para>
|
||||||
|
Igal aka "Koala" <email>igalfr@netvision.net.il</email> - contributed Hebrew translation, Gentoo ebuild maintainer.
|
||||||
|
</para>
|
||||||
|
</listitem>
|
||||||
|
|
||||||
|
<listitem>
|
||||||
|
<para>
|
||||||
|
Petko Yotov <email>5ko@free.fr</email> - contributed Bulgarian translation.
|
||||||
|
</para>
|
||||||
|
</listitem>
|
||||||
|
|
||||||
|
<listitem>
|
||||||
|
<para>
|
||||||
|
Michal Bukovský <email>michal@trilogic.cz</email> - contributed Czech translation.
|
||||||
|
</para>
|
||||||
|
</listitem>
|
||||||
|
|
||||||
|
</itemizedlist>
|
||||||
|
</para>
|
||||||
|
|
||||||
|
<para>
|
||||||
|
Documentation copyright 2001-2005 Leonid Zeitlin <email>lz@europe.com</email>
|
||||||
|
</para>
|
||||||
|
|
||||||
|
<!-- TRANS:CREDIT_FOR_TRANSLATORS -->
|
||||||
|
|
||||||
|
&underFDL; <!-- FDL: do not remove. Commercial development should -->
|
||||||
|
<!-- replace this with their copyright and either remove it or re-set this.-->
|
||||||
|
|
||||||
|
<!-- Determine which license your application is licensed under,
|
||||||
|
and delete all the remaining licenses below:
|
||||||
|
|
||||||
|
(NOTE: All documentation are licensed under the FDL,
|
||||||
|
regardless of what license the application uses) -->
|
||||||
|
|
||||||
|
&underGPL; <!-- GPL License -->
|
||||||
|
|
||||||
|
</chapter>
|
||||||
|
|
||||||
|
<appendix id="installation">
|
||||||
|
<title>Installation</title>
|
||||||
|
|
||||||
|
<sect1 id="getting-KKBSwitch">
|
||||||
|
<title>How to obtain &kkbswitch;</title>
|
||||||
|
|
||||||
|
<para>
|
||||||
|
&kkbswitch; has a home page at SourceForge:
|
||||||
|
<ulink url="http://kkbswitch.sourceforge.net">
|
||||||
|
http://kkbswitch.sourceforge.net</ulink>. Check there for the latest news. The latest version is available for download from the project page: <ulink url="http://sourceforge.net/projects/kkbswitch">
|
||||||
|
http://sourceforge.net/projects/kkbswitch</ulink>.
|
||||||
|
</para>
|
||||||
|
<!-- <para>
|
||||||
|
&kkbswitch; can be found in the at the <ulink
|
||||||
|
url="http://apps.kde.com/">apps.kde.com</ulink> site at <ulink
|
||||||
|
url="http://ftp.kde.com/Desktop/Utilities/KKBSwitch/">
|
||||||
|
http://ftp.kde.com/Desktop/Utilities/KKBSwitch/</ulink>
|
||||||
|
</para>
|
||||||
|
<para>
|
||||||
|
&kkbswitch; doesn't have a homepage yet. For the latest version check <ulink
|
||||||
|
url="http://apps.kde.com/">apps.kde.com</ulink>
|
||||||
|
</para> -->
|
||||||
|
</sect1>
|
||||||
|
|
||||||
|
<sect1 id="requirements">
|
||||||
|
<title>Requirements</title>
|
||||||
|
<para>
|
||||||
|
&kkbswitch; doesn't require any special environment to compile and run besides
|
||||||
|
the standard &kde; 2 or 3 kdelibs and kdebase.
|
||||||
|
</para>
|
||||||
|
</sect1>
|
||||||
|
|
||||||
|
<sect1 id="compilation">
|
||||||
|
<title>Compilation and Installation</title>
|
||||||
|
<para>
|
||||||
|
In order to compile and install &kkbswitch; on your system, type the following
|
||||||
|
in the base directory of the &kkbswitch; distribution:
|
||||||
|
<screen width="40">
|
||||||
|
<prompt>%</prompt> <userinput>./configure</userinput>
|
||||||
|
<prompt>%</prompt> <userinput>make</userinput>
|
||||||
|
<prompt>%</prompt> <userinput>make install</userinput>
|
||||||
|
</screen>
|
||||||
|
</para>
|
||||||
|
|
||||||
|
<para>
|
||||||
|
Options you may want or need to give to the <command>configure</command> command are:
|
||||||
|
</para>
|
||||||
|
<simplelist>
|
||||||
|
<member>
|
||||||
|
<option>--prefix</option>=<replaceable>dir</replaceable> - set the prefix where your &kde; installation is located. Alternatively, you can set $<envar>KDEDIR</envar> environment variable to the &kde; directory. Under regular circumstances, the configuration script will find the &kde; location automatically; use this option only if you are having problems without it.
|
||||||
|
</member>
|
||||||
|
<member>
|
||||||
|
<option>--enable-ru-ua-layout</option> - install the Russian/Ukrainian layout file (described in <xref linkend="ru_ua"/>). This option is useful for users of XFree86 prior to version 4.3, who want to use Russian/Ukrainian layout file. Note that with this option it is not possible to install &kkbswitch; without root privileges, because the layout file <emphasis>must</emphasis> go to the system XKB layout directory where ordinary users don't have write access.
|
||||||
|
</member>
|
||||||
|
<member>
|
||||||
|
<option>--without-arts</option> - do not check for &arts; development headers. &arts; is &kde;'s multimedia framework, which &kkbswitch; does not use. However, since &kkbswitch; uses standard &kde; configuration macros, the configuration script will check for &arts; headers and complain if they are not found. If this happens to you, specify this option to compile &kkbswitch;. Alternatively, install &arts; development headers, you'll need them one day.
|
||||||
|
</member>
|
||||||
|
</simplelist>
|
||||||
|
|
||||||
|
|
||||||
|
<para>
|
||||||
|
Since &kkbswitch; uses autoconf and automake you should have not trouble
|
||||||
|
compiling it. &kkbswitch; was tested under several versions of &Linux; and FreeBSD,
|
||||||
|
and a FreeBSD port is available.
|
||||||
|
</para>
|
||||||
|
|
||||||
|
<para>
|
||||||
|
If you system uses <application>RPM</application> you may want to download
|
||||||
|
&kkbswitch; source RPM package. To build a binary RPM out of source RPM run this
|
||||||
|
command (as root):
|
||||||
|
<screen>
|
||||||
|
<prompt>%</prompt> <userinput><command>rpmbuild</command> <option>--rebuild</option> <filename>kkbswitch-&kkbswitchVersion;-1.src.rpm</filename></userinput>
|
||||||
|
</screen>
|
||||||
|
|
||||||
|
(You may add <option>--with ru_ua_layout</option> option if you need the Russian/Ukrainian layout file, see <xref linkend="ru_ua"/>).
|
||||||
|
Then, still as root, go to your binary RPM directory (on &RedHat; Intel systems,
|
||||||
|
<filename class="directory">/usr/src/redhat/RPMS/i386</filename>) and install
|
||||||
|
the binary RPM you've just built with this command:
|
||||||
|
</para>
|
||||||
|
|
||||||
|
<screen>
|
||||||
|
<prompt>%</prompt> <userinput><command>rpm</command> <option>-ihv</option> <filename>kkbswitch-&kkbswitchVersion;-1.i386.rpm</filename></userinput>
|
||||||
|
</screen>
|
||||||
|
|
||||||
|
<para>
|
||||||
|
Note that with older versions of <application>RPM</application> you will need to use command <userinput><command>rpm</command> <option>--rebuild</option></userinput> instead of <userinput><command>rpmbuild</command> <option>--rebuild</option></userinput>
|
||||||
|
</para>
|
||||||
|
|
||||||
|
</sect1>
|
||||||
|
</appendix>
|
||||||
|
|
||||||
|
<appendix id="ru_ua">
|
||||||
|
<title>The Russian/Ukrainian keyboard layout file</title>
|
||||||
|
<para>
|
||||||
|
For the benefit of Ukrainian users of &kkbswitch; and XFree86 versions before 4.3,
|
||||||
|
a Russian/Ukrainian keyboard layout file is included with the distribution (users of XFree86 4.3 and later, including X.Org server, read the note in the end of this appendix). This file is experimental, so report any problems with it to the author of &kkbswitch;. The file is named
|
||||||
|
<filename>ru_ua</filename> and by default gets installed to the directory
|
||||||
|
<filename class="directory">/usr/X11R6/lib/X11/xkb/symbols</filename>, where
|
||||||
|
this type of XKeyboard configuation file is supposed to go. The file defines a
|
||||||
|
configuration with 3 keyboard groups (layouts): US/ASCII, Russian and Ukrainian.
|
||||||
|
To use this layout, you can do one of the following.
|
||||||
|
<orderedlist>
|
||||||
|
<listitem>
|
||||||
|
<para>
|
||||||
|
If you feel comfortable editing your <filename>XF86Config</filename> file and
|
||||||
|
know its structure you can simply edit the file (usually
|
||||||
|
<filename>/etc/X11/XF86Config-4</filename> for XFree86 4.x), and in InputDevice
|
||||||
|
section for keyboard set XkbLayout option to "ru_ua". It is recommented to set
|
||||||
|
XkbVariant to "winkeys", since only this variant was tested.
|
||||||
|
</para>
|
||||||
|
</listitem>
|
||||||
|
<listitem>
|
||||||
|
<para>
|
||||||
|
If you are using &RedHat; &Linux;, you may create a file named
|
||||||
|
<filename>.Xkbmap</filename> in your home directory and write the text "ru_ua"
|
||||||
|
(without quotes) in it. The default X session startup script will pick this file
|
||||||
|
and activate the layout named in it.
|
||||||
|
</para>
|
||||||
|
</listitem>
|
||||||
|
<listitem>
|
||||||
|
<para>
|
||||||
|
Run the command <userinput><command>setxkbmap</command> ru_ua</userinput> either
|
||||||
|
manually from command prompt our in one of your X session startup script.
|
||||||
|
</para>
|
||||||
|
</listitem>
|
||||||
|
</orderedlist>
|
||||||
|
</para>
|
||||||
|
|
||||||
|
<note>
|
||||||
|
<para>Users of XFree86 4.3 and later versions, including X.Org server, don't need any additional files if they want a three-language layout. Just specify <userinput>XkbLayout "us,ru,ua"</userinput> in your <filename>XF86Config</filename> (<filename>xorg.conf</filename> for X.Org server) file.
|
||||||
|
</para>
|
||||||
|
</note>
|
||||||
|
|
||||||
|
</appendix>
|
||||||
|
|
||||||
|
&documentation.index;
|
||||||
|
</book>
|
||||||
|
<!--
|
||||||
|
Local Variables:
|
||||||
|
mode: sgml
|
||||||
|
sgml-minimize-attributes:nil
|
||||||
|
sgml-general-insert-case:lower
|
||||||
|
sgml-indent-step:0
|
||||||
|
sgml-indent-data:nil
|
||||||
|
End:
|
||||||
|
-->
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
@ -0,0 +1,136 @@
|
|||||||
|
.\" This manpage has been automatically generated by docbook2man
|
||||||
|
.\" from a DocBook document. This tool can be found at:
|
||||||
|
.\" <http://shell.ipoline.com/~elmert/comp/docbook2X/>
|
||||||
|
.\" Please send any bug reports, improvements, comments, patches,
|
||||||
|
.\" etc. to Steve Cheng <steve@ggi-project.org>.
|
||||||
|
.TH "KKBSWITCH" "1" "06 November 2004" "" ""
|
||||||
|
|
||||||
|
.SH NAME
|
||||||
|
kkbswitch \- A keyboard layout indicator for KDE 3.
|
||||||
|
.SH SYNOPSIS
|
||||||
|
|
||||||
|
\fBkkbswitch\fR [ \fB--help\fI\fB\fR ] [ \fB--help-kde\fI\fB\fR ] [ \fB--help-qt\fI\fB\fR ] [ \fB--version\fI -v\fB\fR ] [ \fB--license\fI\fB\fR ] [ \fB--author\fI\fB\fR ] [ \fB--caption <caption>\fI\fB\fR ] [ \fB--icon <icon>\fI\fB\fR ] [ \fB--miniicon <icon>\fI\fB\fR ] [ \fB--dcopserver <server>\fI\fB\fR ] [ \fB--nocrashhandler\fI\fB\fR ] [ \fB--waitforwm\fI\fB\fR ] [ \fB--style <style>\fI\fB\fR ] [ \fB--geometry <geometry>\fI\fB\fR ] [ \fB--display <display>\fI\fB\fR ] [ \fB--session <sessionid>\fI\fB\fR ] [ \fB--cmap\fI\fB\fR ] [ \fB--ncols <columns>\fI\fB\fR ] [ \fB--nograb\fI\fB\fR ] [ \fB--dograb\fI\fB\fR ] [ \fB--sync\fI\fB\fR ] [ \fB--font\fI --fn <fontname>\fB\fR ] [ \fB--background\fI --bg <colour>\fB\fR ] [ \fB--button\fI --btn <colour>\fB\fR ] [ \fB--name\fI <name>\fB\fR ] [ \fB--title\fI <title>\fB\fR ] [ \fB--visual\fI TrueColor\fB\fR ] [ \fB--inputstyle\fI <style>\fB\fR ] [ \fB--im\fI <server>\fB\fR ] [ \fB--noxim\fI\fB\fR ]
|
||||||
|
|
||||||
|
.SH "DESCRIPTION"
|
||||||
|
.PP
|
||||||
|
This manual page documents briefly the
|
||||||
|
\fBkkbswitch\fR command.
|
||||||
|
.PP
|
||||||
|
This manual page was written for the Debian GNU/Linux distribution
|
||||||
|
because the original program does not have a manual page.
|
||||||
|
Instead, it has documentation in the KDE handbook format; see below.
|
||||||
|
.PP
|
||||||
|
\fBkkbswitch\fR is a keyboard layout indicator for KDE.
|
||||||
|
.PP
|
||||||
|
It is useful when you have configured the XKeyboard extension of your X Server to have more than one keyboard group (layout), for example US/ASCII and Russian.
|
||||||
|
KKBSwitch displays an icon in the system tray that indicates which layout is currently active and enables layout switching by clicking the icon or by right click and selecting layout from a popup menu. Note that KKBSwitch does not help you configure XKeyboard.
|
||||||
|
This means that you still have to configure XKeyboard by editing the XF86Config file or use a setup program to do it for you.
|
||||||
|
KKBSwitch is a KDE application, but is reported to work under GNOME as well.
|
||||||
|
.SH "OPTIONS"
|
||||||
|
.PP
|
||||||
|
These programs follow the usual GNU command line syntax,
|
||||||
|
with long options starting with two dashes (`-'). A summary of
|
||||||
|
options is included below.
|
||||||
|
.TP
|
||||||
|
\fB-h --help \fR
|
||||||
|
Show summary of options.
|
||||||
|
.TP
|
||||||
|
\fB-v --version \fR
|
||||||
|
Show version information.
|
||||||
|
.TP
|
||||||
|
\fB--author \fR
|
||||||
|
Show information about the author.
|
||||||
|
.TP
|
||||||
|
\fB--license \fR
|
||||||
|
Show license information.
|
||||||
|
.TP
|
||||||
|
\fB--caption <caption> \fR
|
||||||
|
Specify the caption of the window.
|
||||||
|
.TP
|
||||||
|
\fB--icon <icon> \fR
|
||||||
|
Specify the icon of the window.
|
||||||
|
.TP
|
||||||
|
\fB--miniicon <icon> \fR
|
||||||
|
Specify the mini-icon of the window.
|
||||||
|
.TP
|
||||||
|
\fB--dcopserver <server> \fR
|
||||||
|
Specify the DCOP server to use.
|
||||||
|
.TP
|
||||||
|
\fB--nocrashhandler \fR
|
||||||
|
Disable KDE crash handler (enables core dumps).
|
||||||
|
.TP
|
||||||
|
\fB--waitforwm \fR
|
||||||
|
Waits for a compatible window manager to start.
|
||||||
|
.TP
|
||||||
|
\fB--style <style> \fR
|
||||||
|
Sets the application's GUI style (overrides KDE).
|
||||||
|
.TP
|
||||||
|
\fB--geometry <geometry> \fR
|
||||||
|
Sets the geometry of the window.
|
||||||
|
.TP
|
||||||
|
\fB--display <display> \fR
|
||||||
|
Specifies the X display to use.
|
||||||
|
.TP
|
||||||
|
\fB--session <sessionid> \fR
|
||||||
|
Restores the application for the given session ID.
|
||||||
|
.TP
|
||||||
|
\fB--cmap \fR
|
||||||
|
Forces use of an internal colour map on an 8-bit display.
|
||||||
|
.TP
|
||||||
|
\fB--ncols <count> \fR
|
||||||
|
Limits the number of colours allowed in an 8-bit display.
|
||||||
|
.TP
|
||||||
|
\fB--nograb \fR
|
||||||
|
Forces Qt to never grab the mouse or keyboard.
|
||||||
|
.TP
|
||||||
|
\fB--dograb \fR
|
||||||
|
Overrides --nograb, which may be implicitly set.
|
||||||
|
.TP
|
||||||
|
\fB--sync \fR
|
||||||
|
Forces synchronous mode (for debugging).
|
||||||
|
.TP
|
||||||
|
\fB--font <font> --fn <font>\fR
|
||||||
|
Sets the default application font.
|
||||||
|
.TP
|
||||||
|
\fB--background <colour> --bg <colour>\fR
|
||||||
|
Sets the default background colour and application
|
||||||
|
pallette.
|
||||||
|
.TP
|
||||||
|
\fB--foreground <colour> --fg <colour>\fR
|
||||||
|
Sets the default foreground colour.
|
||||||
|
.TP
|
||||||
|
\fB--button <colour> --btn <colour>\fR
|
||||||
|
Sets the default button colour.
|
||||||
|
.TP
|
||||||
|
\fB--name <name> \fR
|
||||||
|
Sets the application name.
|
||||||
|
.TP
|
||||||
|
\fB--title <name> \fR
|
||||||
|
Sets the application title.
|
||||||
|
.TP
|
||||||
|
\fB--visual TrueColor \fR
|
||||||
|
Forces the application to use a True Colour visual on 8-bit
|
||||||
|
displays.
|
||||||
|
.TP
|
||||||
|
\fB--inputstyle <style> \fR
|
||||||
|
Sets X Input Method (XIM) input style. Possible values are:
|
||||||
|
onthespot, overthespot, offthespot, and root.
|
||||||
|
.TP
|
||||||
|
\fB--im <server> \fR
|
||||||
|
Sets X Input Method (XIM) server.
|
||||||
|
.TP
|
||||||
|
\fB--noxim \fR
|
||||||
|
Disables X Input Method (XIM) support.
|
||||||
|
.SH "SEE ALSO"
|
||||||
|
.PP
|
||||||
|
This program includes documentation in the format of KDE handbook available in /usr/share/doc/HTML/en/kkbswitch or by help option in the user interface.
|
||||||
|
.SH "AUTHOR"
|
||||||
|
.PP
|
||||||
|
This manual page was written by Shlomi Loubaton <shlomister@gmail.com> for
|
||||||
|
the Debian GNU/Linux system (but may be used by others). Permission is
|
||||||
|
granted to copy, distribute and/or modify this document under
|
||||||
|
the terms of the GNU General Public License, Version 2 any
|
||||||
|
later version published by the Free Software Foundation.
|
||||||
|
.PP
|
||||||
|
On Debian systems, the complete text of the GNU General Public
|
||||||
|
License can be found in /usr/share/common-licenses/GPL.
|
@ -0,0 +1,215 @@
|
|||||||
|
<?xml version = '1.0'?>
|
||||||
|
<kdevelop>
|
||||||
|
<general>
|
||||||
|
<author>Leonid Zeitlin</author>
|
||||||
|
<email>lz@europe.com</email>
|
||||||
|
<version>1.4.1</version>
|
||||||
|
<projectmanagement>KDevKDEAutoProject</projectmanagement>
|
||||||
|
<primarylanguage>C++</primarylanguage>
|
||||||
|
<keywords>
|
||||||
|
<keyword>C++</keyword>
|
||||||
|
<keyword>Code</keyword>
|
||||||
|
<keyword>Qt</keyword>
|
||||||
|
<keyword>KDE</keyword>
|
||||||
|
</keywords>
|
||||||
|
<projectdirectory>.</projectdirectory>
|
||||||
|
<absoluteprojectpath>false</absoluteprojectpath>
|
||||||
|
<description/>
|
||||||
|
<ignoreparts>
|
||||||
|
<part>KDevClearCase</part>
|
||||||
|
<part>KDevPerforce</part>
|
||||||
|
</ignoreparts>
|
||||||
|
<secondaryLanguages/>
|
||||||
|
</general>
|
||||||
|
<kdevautoproject>
|
||||||
|
<general>
|
||||||
|
<activetarget>kkbswitch/kkbswitch</activetarget>
|
||||||
|
<useconfiguration>default</useconfiguration>
|
||||||
|
</general>
|
||||||
|
<run>
|
||||||
|
<mainprogram>kkbswitch/kkbswitch</mainprogram>
|
||||||
|
<directoryradio>build</directoryradio>
|
||||||
|
<runarguments>
|
||||||
|
<kkbswitch/>
|
||||||
|
</runarguments>
|
||||||
|
<customdirectory>/</customdirectory>
|
||||||
|
<programargs/>
|
||||||
|
<terminal>false</terminal>
|
||||||
|
<autocompile>true</autocompile>
|
||||||
|
<envvars/>
|
||||||
|
</run>
|
||||||
|
<configurations>
|
||||||
|
<optimized>
|
||||||
|
<builddir>optimized</builddir>
|
||||||
|
<ccompiler>kdevgccoptions</ccompiler>
|
||||||
|
<cxxcompiler>kdevgppoptions</cxxcompiler>
|
||||||
|
<f77compiler>kdevg77options</f77compiler>
|
||||||
|
<cxxflags>-O2 -g0</cxxflags>
|
||||||
|
</optimized>
|
||||||
|
<debug>
|
||||||
|
<configargs>--enable-debug=full</configargs>
|
||||||
|
<builddir>debug</builddir>
|
||||||
|
<ccompiler>kdevgccoptions</ccompiler>
|
||||||
|
<cxxcompiler>kdevgppoptions</cxxcompiler>
|
||||||
|
<f77compiler>kdevg77options</f77compiler>
|
||||||
|
<cxxflags>-O0 -g3</cxxflags>
|
||||||
|
<envvars/>
|
||||||
|
</debug>
|
||||||
|
</configurations>
|
||||||
|
<make>
|
||||||
|
<envvars>
|
||||||
|
<envvar value="1" name="WANT_AUTOCONF_2_5" />
|
||||||
|
<envvar value="1" name="WANT_AUTOMAKE_1_6" />
|
||||||
|
</envvars>
|
||||||
|
<abortonerror>true</abortonerror>
|
||||||
|
<numberofjobs>1</numberofjobs>
|
||||||
|
<dontact>false</dontact>
|
||||||
|
<makebin/>
|
||||||
|
</make>
|
||||||
|
</kdevautoproject>
|
||||||
|
<kdevfileview>
|
||||||
|
<groups>
|
||||||
|
<group pattern="*.cpp;*.cxx;*.h" name="Sources" />
|
||||||
|
<group pattern="*.ui" name="User Interface" />
|
||||||
|
<group pattern="*.png" name="Icons" />
|
||||||
|
<group pattern="*.po;*.ts" name="Translations" />
|
||||||
|
<group pattern="*" name="Others" />
|
||||||
|
<hidenonprojectfiles>false</hidenonprojectfiles>
|
||||||
|
<hidenonlocation>false</hidenonlocation>
|
||||||
|
</groups>
|
||||||
|
<tree>
|
||||||
|
<hidepatterns>*.o,*.lo,CVS</hidepatterns>
|
||||||
|
<hidenonprojectfiles>false</hidenonprojectfiles>
|
||||||
|
</tree>
|
||||||
|
</kdevfileview>
|
||||||
|
<kdevdoctreeview>
|
||||||
|
<ignoretocs>
|
||||||
|
<toc>ada</toc>
|
||||||
|
<toc>ada_bugs_gcc</toc>
|
||||||
|
<toc>bash</toc>
|
||||||
|
<toc>bash_bugs</toc>
|
||||||
|
<toc>clanlib</toc>
|
||||||
|
<toc>w3c-dom-level2-html</toc>
|
||||||
|
<toc>fortran_bugs_gcc</toc>
|
||||||
|
<toc>gnome1</toc>
|
||||||
|
<toc>gnustep</toc>
|
||||||
|
<toc>gtk</toc>
|
||||||
|
<toc>gtk_bugs</toc>
|
||||||
|
<toc>haskell</toc>
|
||||||
|
<toc>haskell_bugs_ghc</toc>
|
||||||
|
<toc>java_bugs_gcc</toc>
|
||||||
|
<toc>java_bugs_sun</toc>
|
||||||
|
<toc>pascal_bugs_fp</toc>
|
||||||
|
<toc>php</toc>
|
||||||
|
<toc>php_bugs</toc>
|
||||||
|
<toc>perl</toc>
|
||||||
|
<toc>perl_bugs</toc>
|
||||||
|
<toc>python</toc>
|
||||||
|
<toc>python_bugs</toc>
|
||||||
|
<toc>ruby</toc>
|
||||||
|
<toc>ruby_bugs</toc>
|
||||||
|
<toc>sdl</toc>
|
||||||
|
<toc>w3c-svg</toc>
|
||||||
|
<toc>sw</toc>
|
||||||
|
<toc>w3c-uaag10</toc>
|
||||||
|
<toc>wxwindows_bugs</toc>
|
||||||
|
<toc>libmilter</toc>
|
||||||
|
<toc>c++_bugs_gcc</toc>
|
||||||
|
<toc>kdev3api</toc>
|
||||||
|
<toc>libc</toc>
|
||||||
|
<toc>libstdc++</toc>
|
||||||
|
<toc>opengl</toc>
|
||||||
|
<toc>qt-kdev3</toc>
|
||||||
|
</ignoretocs>
|
||||||
|
<ignoreqt_xml>
|
||||||
|
<toc>qmake User Guide</toc>
|
||||||
|
<toc>Guide to the Qt Translation Tools</toc>
|
||||||
|
<toc>Qt Assistant Manual</toc>
|
||||||
|
</ignoreqt_xml>
|
||||||
|
<projectdoc>
|
||||||
|
<userdocDir>html/</userdocDir>
|
||||||
|
<apidocDir>html/</apidocDir>
|
||||||
|
</projectdoc>
|
||||||
|
<ignoredoxygen/>
|
||||||
|
<ignorekdocs/>
|
||||||
|
<ignoredevhelp/>
|
||||||
|
</kdevdoctreeview>
|
||||||
|
<kdevdebugger>
|
||||||
|
<general>
|
||||||
|
<dbgshell>libtool</dbgshell>
|
||||||
|
<programargs/>
|
||||||
|
<gdbpath/>
|
||||||
|
<configGdbScript/>
|
||||||
|
<runShellScript/>
|
||||||
|
<runGdbScript/>
|
||||||
|
<breakonloadinglibs>true</breakonloadinglibs>
|
||||||
|
<separatetty>false</separatetty>
|
||||||
|
<floatingtoolbar>false</floatingtoolbar>
|
||||||
|
</general>
|
||||||
|
<display>
|
||||||
|
<staticmembers>false</staticmembers>
|
||||||
|
<demanglenames>true</demanglenames>
|
||||||
|
<outputradix>10</outputradix>
|
||||||
|
</display>
|
||||||
|
</kdevdebugger>
|
||||||
|
<kdevfilecreate>
|
||||||
|
<filetypes/>
|
||||||
|
<useglobaltypes>
|
||||||
|
<type ext="ui" />
|
||||||
|
<type ext="cpp" />
|
||||||
|
<type ext="h" />
|
||||||
|
</useglobaltypes>
|
||||||
|
</kdevfilecreate>
|
||||||
|
<kdevcppsupport>
|
||||||
|
<references/>
|
||||||
|
<codecompletion>
|
||||||
|
<includeGlobalFunctions>true</includeGlobalFunctions>
|
||||||
|
<includeTypes>true</includeTypes>
|
||||||
|
<includeEnums>true</includeEnums>
|
||||||
|
<includeTypedefs>false</includeTypedefs>
|
||||||
|
<automaticCodeCompletion>true</automaticCodeCompletion>
|
||||||
|
<automaticArgumentsHint>true</automaticArgumentsHint>
|
||||||
|
<automaticHeaderCompletion>true</automaticHeaderCompletion>
|
||||||
|
<codeCompletionDelay>250</codeCompletionDelay>
|
||||||
|
<argumentsHintDelay>400</argumentsHintDelay>
|
||||||
|
<headerCompletionDelay>250</headerCompletionDelay>
|
||||||
|
</codecompletion>
|
||||||
|
</kdevcppsupport>
|
||||||
|
<cppsupportpart>
|
||||||
|
<filetemplates>
|
||||||
|
<interfacesuffix>.h</interfacesuffix>
|
||||||
|
<implementationsuffix>.cpp</implementationsuffix>
|
||||||
|
</filetemplates>
|
||||||
|
</cppsupportpart>
|
||||||
|
<dist>
|
||||||
|
<custom>false</custom>
|
||||||
|
<bzip>false</bzip>
|
||||||
|
<archname/>
|
||||||
|
<appname/>
|
||||||
|
<version>1.3.2</version>
|
||||||
|
<release/>
|
||||||
|
<vendor/>
|
||||||
|
<licence/>
|
||||||
|
<summary/>
|
||||||
|
<group/>
|
||||||
|
<packager/>
|
||||||
|
<description/>
|
||||||
|
<changelog/>
|
||||||
|
<devpackage>false</devpackage>
|
||||||
|
<docspackage>false</docspackage>
|
||||||
|
<appicon>false</appicon>
|
||||||
|
<arch>0</arch>
|
||||||
|
<genHTML>false</genHTML>
|
||||||
|
<useRPM>false</useRPM>
|
||||||
|
<ftpkde>false</ftpkde>
|
||||||
|
<appskde>false</appskde>
|
||||||
|
<url/>
|
||||||
|
</dist>
|
||||||
|
<kdevdocumentation>
|
||||||
|
<projectdoc>
|
||||||
|
<docsystem/>
|
||||||
|
<docurl/>
|
||||||
|
<usermanualurl/>
|
||||||
|
</projectdoc>
|
||||||
|
</kdevdocumentation>
|
||||||
|
</kdevelop>
|
@ -0,0 +1,16 @@
|
|||||||
|
Begin3
|
||||||
|
Title: Kkbswitch
|
||||||
|
Version: 1.1
|
||||||
|
Entered-date: 01SEP01
|
||||||
|
Description: KKBSwitch is a keyboard layout indicator for KDE 2 or 3
|
||||||
|
Keywords: keyboard layout indicator KDE XKeyboard
|
||||||
|
Author: Leonid Zeitlin <lz@europe.com>
|
||||||
|
Maintained-by: Leonid Zeitlin <lz@europe.com>
|
||||||
|
Primary-site: ftp.kde.org /pub/kde/unstable/apps/utils
|
||||||
|
kkbswitch-1.1.tar.gz
|
||||||
|
kkbswitch-1.1-1.src.rpm
|
||||||
|
Home-page:
|
||||||
|
Original-site:
|
||||||
|
Platforms: Linux and other Unices
|
||||||
|
Copying-policy: GNU Public License
|
||||||
|
End
|
@ -0,0 +1,375 @@
|
|||||||
|
<!DOCTYPE refentry PUBLIC "-//OASIS//DTD DocBook V4.1//EN" [
|
||||||
|
|
||||||
|
<!-- Process this file with docbook-to-man to generate an nroff manual
|
||||||
|
page: `docbook-to-man manpage.sgml > manpage.1'. You may view
|
||||||
|
the manual page with: `docbook-to-man manpage.sgml | nroff -man |
|
||||||
|
less'. A typical entry in a Makefile or Makefile.am is:
|
||||||
|
|
||||||
|
manpage.1: manpage.sgml
|
||||||
|
docbook-to-man $< > $@
|
||||||
|
|
||||||
|
|
||||||
|
The docbook-to-man binary is found in the docbook-to-man package.
|
||||||
|
Please remember that if you create the nroff version in one of the
|
||||||
|
debian/rules file targets (such as build), you will need to include
|
||||||
|
docbook-to-man in your Build-Depends control field.
|
||||||
|
|
||||||
|
-->
|
||||||
|
|
||||||
|
<!-- Fill in your name for FIRSTNAME and SURNAME. -->
|
||||||
|
<!ENTITY dhfirstname "<firstname>Shlomi</firstname>">
|
||||||
|
<!ENTITY dhsurname "<surname>Loubaton</surname>">
|
||||||
|
<!-- Please adjust the date whenever revising the manpage. -->
|
||||||
|
<!ENTITY dhdate "<date>October 24, 2004</date>">
|
||||||
|
<!-- SECTION should be 1-8, maybe w/ subsection other parameters are
|
||||||
|
allowed: see man(7), man(1). -->
|
||||||
|
<!ENTITY dhsection "<manvolnum>1</manvolnum>">
|
||||||
|
<!ENTITY dhemail "<email>shlomister@gmail.com</email>">
|
||||||
|
<!ENTITY dhusername "Shlomi Loubaton">
|
||||||
|
<!ENTITY dhucpackage "<refentrytitle>KKBSWITCH</refentrytitle>">
|
||||||
|
<!ENTITY dhpackage "kkbswitch">
|
||||||
|
|
||||||
|
<!ENTITY debian "<productname>Debian GNU/Linux</productname>">
|
||||||
|
<!ENTITY gnu "<acronym>GNU</acronym>">
|
||||||
|
<!ENTITY gpl "&gnu; <acronym>GPL</acronym>">
|
||||||
|
]>
|
||||||
|
|
||||||
|
<refentry>
|
||||||
|
<refentryinfo>
|
||||||
|
<address>
|
||||||
|
&dhemail;
|
||||||
|
</address>
|
||||||
|
<author>
|
||||||
|
&dhfirstname;
|
||||||
|
&dhsurname;
|
||||||
|
</author>
|
||||||
|
<copyright>
|
||||||
|
<year>2004</year>
|
||||||
|
<holder>&dhusername;</holder>
|
||||||
|
</copyright>
|
||||||
|
&dhdate;
|
||||||
|
</refentryinfo>
|
||||||
|
<refmeta>
|
||||||
|
&dhucpackage;
|
||||||
|
|
||||||
|
&dhsection;
|
||||||
|
</refmeta>
|
||||||
|
<refnamediv>
|
||||||
|
<refname>&dhpackage;</refname>
|
||||||
|
|
||||||
|
<refpurpose>A keyboard layout indicator for KDE 3.</refpurpose>
|
||||||
|
</refnamediv>
|
||||||
|
<refsynopsisdiv>
|
||||||
|
<cmdsynopsis>
|
||||||
|
<command>&dhpackage;</command>
|
||||||
|
|
||||||
|
<arg><option>--help<replaceable></replaceable></option></arg>
|
||||||
|
<arg><option>--help-kde<replaceable></replaceable></option></arg>
|
||||||
|
<arg><option>--help-qt<replaceable></replaceable></option></arg>
|
||||||
|
<arg><option>--version<replaceable> -v</replaceable></option></arg>
|
||||||
|
<arg><option>--license<replaceable></replaceable</option></arg>
|
||||||
|
<arg><option>--author<replaceable></replaceable></option></arg>
|
||||||
|
<arg><option>--caption <caption><replaceable></replaceable></option></arg>
|
||||||
|
<arg><option>--icon <icon><replaceable></replaceable></option></arg>
|
||||||
|
<arg><option>--miniicon <icon><replaceable></replaceable></option></arg>
|
||||||
|
<arg><option>--dcopserver <server><replaceable></replaceable></option></arg>
|
||||||
|
<arg><option>--nocrashhandler<replaceable></replaceable></option></arg>
|
||||||
|
<arg><option>--waitforwm<replaceable></replaceable></option></arg>
|
||||||
|
<arg><option>--style <style><replaceable></replaceable></option></arg>
|
||||||
|
<arg><option>--geometry <geometry><replaceable></replaceable></option></arg>
|
||||||
|
<arg><option>--display <display><replaceable></replaceable></option></arg>
|
||||||
|
<arg><option>--session <sessionid><replaceable></replaceable></option></arg>
|
||||||
|
<arg><option>--cmap<replaceable></replaceable></option></arg>
|
||||||
|
<arg><option>--ncols <columns><replaceable></replaceable></option></arg>
|
||||||
|
<arg><option>--nograb<replaceable></replaceable></option></arg>
|
||||||
|
<arg><option>--dograb<replaceable></replaceable></option></arg>
|
||||||
|
<arg><option>--sync<replaceable></replaceable></option></arg>
|
||||||
|
<arg><option>--font<replaceable> --fn <fontname></replaceable></option></arg>
|
||||||
|
<arg><option>--background<replaceable> --bg <colour></replaceable></option></arg>
|
||||||
|
<arg><option>--button<replaceable> --btn <colour></replaceable></option></arg>
|
||||||
|
<arg><option>--name<replaceable> <name></replaceable></option></arg>
|
||||||
|
<arg><option>--title<replaceable> <title></replaceable></option></arg>
|
||||||
|
<arg><option>--visual<replaceable> TrueColor</replaceable></option></arg>
|
||||||
|
<arg><option>--inputstyle<replaceable> <style></replaceable></option></arg>
|
||||||
|
<arg><option>--im<replaceable> <server></replaceable></option></arg>
|
||||||
|
<arg><option>--noxim<replaceable></replaceable></option></arg>
|
||||||
|
|
||||||
|
</cmdsynopsis>
|
||||||
|
</refsynopsisdiv>
|
||||||
|
<refsect1>
|
||||||
|
<title>DESCRIPTION</title>
|
||||||
|
|
||||||
|
<para>This manual page documents briefly the
|
||||||
|
<command>&dhpackage;</command> command.</para>
|
||||||
|
|
||||||
|
<para>This manual page was written for the &debian; distribution
|
||||||
|
because the original program does not have a manual page.
|
||||||
|
Instead, it has documentation in the KDE handbook format; see below.</para>
|
||||||
|
|
||||||
|
<para><command>&dhpackage;</command> is a keyboard layout indicator for KDE.
|
||||||
|
</para>
|
||||||
|
|
||||||
|
<para>It is useful when you have configured the XKeyboard extension of your X Server to have more than one keyboard group (layout), for example US/ASCII and Russian.
|
||||||
|
KKBSwitch displays an icon in the system tray that indicates which layout is currently active and enables layout switching by clicking the icon or by right click and selecting layout from a popup menu. Note that KKBSwitch does not help you configure XKeyboard.
|
||||||
|
This means that you still have to configure XKeyboard by editing the XF86Config file or use a setup program to do it for you.
|
||||||
|
KKBSwitch is a KDE application, but is reported to work under GNOME as well.</para>
|
||||||
|
|
||||||
|
</refsect1>
|
||||||
|
<refsect1>
|
||||||
|
<title>OPTIONS</title>
|
||||||
|
|
||||||
|
<para>These programs follow the usual &gnu; command line syntax,
|
||||||
|
with long options starting with two dashes (`-'). A summary of
|
||||||
|
options is included below.</para>
|
||||||
|
|
||||||
|
<variablelist>
|
||||||
|
<varlistentry>
|
||||||
|
<term><option>-h</option>
|
||||||
|
<option>--help</option>
|
||||||
|
</term>
|
||||||
|
<listitem>
|
||||||
|
<para>Show summary of options.</para>
|
||||||
|
</listitem>
|
||||||
|
</varlistentry>
|
||||||
|
<varlistentry>
|
||||||
|
<term><option>-v</option>
|
||||||
|
<option>--version</option>
|
||||||
|
</term>
|
||||||
|
<listitem>
|
||||||
|
<para>Show version information.</para>
|
||||||
|
</listitem>
|
||||||
|
</varlistentry>
|
||||||
|
<varlistentry>
|
||||||
|
<term><option>--author</option>
|
||||||
|
</term>
|
||||||
|
<listitem>
|
||||||
|
<para>Show information about the author.</para>
|
||||||
|
</listitem>
|
||||||
|
</varlistentry>
|
||||||
|
<varlistentry>
|
||||||
|
<term><option>--license</option>
|
||||||
|
</term>
|
||||||
|
<listitem>
|
||||||
|
<para>Show license information.</para>
|
||||||
|
</listitem>
|
||||||
|
</varlistentry>
|
||||||
|
<varlistentry>
|
||||||
|
<term><option>--caption <caption></option>
|
||||||
|
</term>
|
||||||
|
<listitem>
|
||||||
|
<para>Specify the caption of the window.</para>
|
||||||
|
</listitem>
|
||||||
|
</varlistentry>
|
||||||
|
<varlistentry>
|
||||||
|
<term><option>--icon <icon></option>
|
||||||
|
</term>
|
||||||
|
<listitem>
|
||||||
|
<para>Specify the icon of the window.</para>
|
||||||
|
</listitem>
|
||||||
|
</varlistentry>
|
||||||
|
<varlistentry>
|
||||||
|
<term><option>--miniicon <icon></option>
|
||||||
|
</term>
|
||||||
|
<listitem>
|
||||||
|
<para>Specify the mini-icon of the window.</para>
|
||||||
|
</listitem>
|
||||||
|
</varlistentry>
|
||||||
|
<varlistentry>
|
||||||
|
<term><option>--dcopserver <server></option>
|
||||||
|
</term>
|
||||||
|
<listitem>
|
||||||
|
<para>Specify the DCOP server to use.</para>
|
||||||
|
</listitem>
|
||||||
|
</varlistentry>
|
||||||
|
<varlistentry>
|
||||||
|
<term><option>--nocrashhandler</option>
|
||||||
|
</term>
|
||||||
|
<listitem>
|
||||||
|
<para>Disable KDE crash handler (enables core dumps).</para>
|
||||||
|
</listitem>
|
||||||
|
</varlistentry>
|
||||||
|
<varlistentry>
|
||||||
|
<term><option>--waitforwm</option>
|
||||||
|
</term>
|
||||||
|
<listitem>
|
||||||
|
<para>Waits for a compatible window manager to start.</para>
|
||||||
|
</listitem>
|
||||||
|
</varlistentry>
|
||||||
|
<varlistentry>
|
||||||
|
<term><option>--style <style></option>
|
||||||
|
</term>
|
||||||
|
<listitem>
|
||||||
|
<para>Sets the application's GUI style (overrides KDE).</para>
|
||||||
|
</listitem>
|
||||||
|
</varlistentry>
|
||||||
|
<varlistentry>
|
||||||
|
<term><option>--geometry <geometry></option>
|
||||||
|
</term>
|
||||||
|
<listitem>
|
||||||
|
<para>Sets the geometry of the window.</para>
|
||||||
|
</listitem>
|
||||||
|
</varlistentry>
|
||||||
|
<varlistentry>
|
||||||
|
<term><option>--display <display></option>
|
||||||
|
</term>
|
||||||
|
<listitem>
|
||||||
|
<para>Specifies the X display to use.</para>
|
||||||
|
</listitem>
|
||||||
|
</varlistentry>
|
||||||
|
<varlistentry>
|
||||||
|
<term><option>--session <sessionid></option>
|
||||||
|
</term>
|
||||||
|
<listitem>
|
||||||
|
<para>Restores the application for the given session ID.</para>
|
||||||
|
</listitem>
|
||||||
|
</varlistentry>
|
||||||
|
<varlistentry>
|
||||||
|
<term><option>--cmap</option>
|
||||||
|
</term>
|
||||||
|
<listitem>
|
||||||
|
<para>Forces use of an internal colour map on an 8-bit display.</para>
|
||||||
|
</listitem>
|
||||||
|
</varlistentry>
|
||||||
|
<varlistentry>
|
||||||
|
<term><option>--ncols <count></option>
|
||||||
|
</term>
|
||||||
|
<listitem>
|
||||||
|
<para>Limits the number of colours allowed in an 8-bit display.</para>
|
||||||
|
</listitem>
|
||||||
|
</varlistentry>
|
||||||
|
<varlistentry>
|
||||||
|
<term><option>--nograb</option>
|
||||||
|
</term>
|
||||||
|
<listitem>
|
||||||
|
<para>Forces Qt to never grab the mouse or keyboard.</para>
|
||||||
|
</listitem>
|
||||||
|
</varlistentry>
|
||||||
|
<varlistentry>
|
||||||
|
<term><option>--dograb</option>
|
||||||
|
</term>
|
||||||
|
<listitem>
|
||||||
|
<para>Overrides --nograb, which may be implicitly set.</para>
|
||||||
|
</listitem>
|
||||||
|
</varlistentry>
|
||||||
|
<varlistentry>
|
||||||
|
<term><option>--sync</option>
|
||||||
|
</term>
|
||||||
|
<listitem>
|
||||||
|
<para>Forces synchronous mode (for debugging).</para>
|
||||||
|
</listitem>
|
||||||
|
</varlistentry>
|
||||||
|
<varlistentry>
|
||||||
|
<term><option>--font <font></option>
|
||||||
|
<option>--fn <font></option></term>
|
||||||
|
<listitem>
|
||||||
|
<para>Sets the default application font.</para>
|
||||||
|
</listitem>
|
||||||
|
</varlistentry>
|
||||||
|
<varlistentry>
|
||||||
|
<term><option>--background <colour></option>
|
||||||
|
<option>--bg <colour></option></term>
|
||||||
|
<listitem>
|
||||||
|
<para>Sets the default background colour and application
|
||||||
|
pallette.</para>
|
||||||
|
</listitem>
|
||||||
|
</varlistentry>
|
||||||
|
<varlistentry>
|
||||||
|
<term><option>--foreground <colour></option>
|
||||||
|
<option>--fg <colour></option></term>
|
||||||
|
<listitem>
|
||||||
|
<para>Sets the default foreground colour.</para>
|
||||||
|
</listitem>
|
||||||
|
</varlistentry>
|
||||||
|
<varlistentry>
|
||||||
|
<term><option>--button <colour></option>
|
||||||
|
<option>--btn <colour></option></term>
|
||||||
|
<listitem>
|
||||||
|
<para>Sets the default button colour.</para>
|
||||||
|
</listitem>
|
||||||
|
</varlistentry>
|
||||||
|
<varlistentry>
|
||||||
|
<term><option>--name <name></option>
|
||||||
|
</term>
|
||||||
|
<listitem>
|
||||||
|
<para>Sets the application name.</para>
|
||||||
|
</listitem>
|
||||||
|
</varlistentry>
|
||||||
|
<varlistentry>
|
||||||
|
<term><option>--title <name></option>
|
||||||
|
</term>
|
||||||
|
<listitem>
|
||||||
|
<para>Sets the application title.</para>
|
||||||
|
</listitem>
|
||||||
|
</varlistentry>
|
||||||
|
<varlistentry>
|
||||||
|
<term><option>--visual TrueColor</option>
|
||||||
|
</term>
|
||||||
|
<listitem>
|
||||||
|
<para>Forces the application to use a True Colour visual on 8-bit
|
||||||
|
displays.</para>
|
||||||
|
</listitem>
|
||||||
|
</varlistentry>
|
||||||
|
<varlistentry>
|
||||||
|
<term><option>--inputstyle <style></option>
|
||||||
|
</term>
|
||||||
|
<listitem>
|
||||||
|
<para>Sets X Input Method (XIM) input style. Possible values are:
|
||||||
|
onthespot, overthespot, offthespot, and root.</para>
|
||||||
|
</listitem>
|
||||||
|
</varlistentry>
|
||||||
|
<varlistentry>
|
||||||
|
<term><option>--im <server></option>
|
||||||
|
</term>
|
||||||
|
<listitem>
|
||||||
|
<para>Sets X Input Method (XIM) server.</para>
|
||||||
|
</listitem>
|
||||||
|
</varlistentry>
|
||||||
|
<varlistentry>
|
||||||
|
<term><option>--noxim</option>
|
||||||
|
</term>
|
||||||
|
<listitem>
|
||||||
|
<para>Disables X Input Method (XIM) support.</para>
|
||||||
|
</listitem>
|
||||||
|
</varlistentry>
|
||||||
|
</variablelist>
|
||||||
|
</refsect1>
|
||||||
|
<refsect1>
|
||||||
|
<title>SEE ALSO</title>
|
||||||
|
|
||||||
|
<para>This program includes documentation in the format of KDE handbook available in /usr/share/doc/HTML/en/kkbswitch or by help option in the user interface.</para>
|
||||||
|
</refsect1>
|
||||||
|
<refsect1>
|
||||||
|
<title>AUTHOR</title>
|
||||||
|
|
||||||
|
<para>This manual page was written by &dhusername; &dhemail; for
|
||||||
|
the &debian; system (but may be used by others). Permission is
|
||||||
|
granted to copy, distribute and/or modify this document under
|
||||||
|
the terms of the &gnu; General Public License, Version 2 any
|
||||||
|
later version published by the Free Software Foundation.
|
||||||
|
</para>
|
||||||
|
<para>
|
||||||
|
On Debian systems, the complete text of the GNU General Public
|
||||||
|
License can be found in /usr/share/common-licenses/GPL.
|
||||||
|
</para>
|
||||||
|
|
||||||
|
</refsect1>
|
||||||
|
</refentry>
|
||||||
|
|
||||||
|
<!-- Keep this comment at the end of the file
|
||||||
|
Local variables:
|
||||||
|
mode: sgml
|
||||||
|
sgml-omittag:t
|
||||||
|
sgml-shorttag:t
|
||||||
|
sgml-minimize-attributes:nil
|
||||||
|
sgml-always-quote-attributes:t
|
||||||
|
sgml-indent-step:2
|
||||||
|
sgml-indent-data:t
|
||||||
|
sgml-parent-document:nil
|
||||||
|
sgml-default-dtd-file:nil
|
||||||
|
sgml-exposed-tags:nil
|
||||||
|
sgml-local-catalogs:nil
|
||||||
|
sgml-local-ecat-files:nil
|
||||||
|
End:
|
||||||
|
-->
|
||||||
|
|
||||||
|
|
@ -0,0 +1,104 @@
|
|||||||
|
# This spec file was generated using Kpp
|
||||||
|
# If you find any problems with this spec file please report
|
||||||
|
# the error to ian geiser <geiseri@msoe.edu>
|
||||||
|
|
||||||
|
# build with --without ru_ua_layout to disable installation
|
||||||
|
# of ru_ua XKB layout file
|
||||||
|
|
||||||
|
Summary: Keyboard layout indicator for KDE
|
||||||
|
Name: kkbswitch
|
||||||
|
Version: 1.4.3
|
||||||
|
Release: 1
|
||||||
|
License: GPL
|
||||||
|
Vendor: Leonid Zeitlin <lz@europe.com>
|
||||||
|
Url: http://kkbswitch.sourceforge.net
|
||||||
|
Packager: Leonid Zeitlin <lz@europe.com>
|
||||||
|
Group: User Interface/Desktops
|
||||||
|
Source: kkbswitch-%{version}.tar.gz
|
||||||
|
BuildRequires: kdelibs-devel
|
||||||
|
BuildRoot: %{_tmppath}/kkbswitch-root
|
||||||
|
|
||||||
|
%description
|
||||||
|
KKBSwitch is a keyboard layout indicator for KDE. It is useful when
|
||||||
|
you have configured the XKeyboard extension of your X Server to have more
|
||||||
|
than one keyboard group (layout), for example US/ASCII and Russian.
|
||||||
|
KKBSwitch displays an icon in the system tray that indicates which layout
|
||||||
|
is currently active. Note that KKBSwitch does not help you configure
|
||||||
|
XKeyboard, it merely serves as the indicator of the current layout. You
|
||||||
|
still have to configure XKeyboard by editing the XF86Config file.
|
||||||
|
|
||||||
|
%prep
|
||||||
|
%setup
|
||||||
|
|
||||||
|
%build
|
||||||
|
export KDEDIR=%{_prefix}
|
||||||
|
# Workaround for legacy auto* tools
|
||||||
|
#[ -x /usr/bin/autoconf-2.5? ] && ln -s /usr/bin/autoconf-2.5? autoconf
|
||||||
|
#[ -x /usr/bin/autoheader-2.5? ] && ln -s /usr/bin/autoheader-2.5?
|
||||||
|
#autoheader
|
||||||
|
#[ -x /usr/bin/aclocal-1.5 ] && ln -s /usr/bin/aclocal-1.5 aclocal
|
||||||
|
#[ -x /usr/bin/automake-1.5 ] && ln -s /usr/bin/automake-1.5 automake
|
||||||
|
#export PATH=`pwd`:$PATH
|
||||||
|
# End workaround
|
||||||
|
|
||||||
|
CFLAGS="$RPM_OPT_FLAGS" CXXFLAGS="$RPM_OPT_FLAGS" ./configure \
|
||||||
|
--prefix=%{_prefix} --mandir=%{_mandir} $LOCALFLAGS \
|
||||||
|
%{?_with_ru_ua_layout:--enable-ru-ua-layout}
|
||||||
|
|
||||||
|
# Setup for parallel builds
|
||||||
|
numprocs=`egrep -c ^cpu[0-9]+ /proc/stat || :`
|
||||||
|
if [ "$numprocs" = "0" ]; then
|
||||||
|
numprocs=1
|
||||||
|
fi
|
||||||
|
|
||||||
|
make -j$numprocs
|
||||||
|
|
||||||
|
%install
|
||||||
|
make install-strip DESTDIR=$RPM_BUILD_ROOT
|
||||||
|
|
||||||
|
%clean
|
||||||
|
rm -rf $RPM_BUILD_ROOT
|
||||||
|
|
||||||
|
|
||||||
|
%files
|
||||||
|
%doc %{_docdir}/HTML/*/kkbswitch/*
|
||||||
|
%{_bindir}/kkbswitch
|
||||||
|
%{_datadir}/applnk/Utilities/kkbswitch.desktop
|
||||||
|
%{_datadir}/apps/kkbswitch/*
|
||||||
|
%{_datadir}/apps/kconf_update/kkbswitch.upd
|
||||||
|
%{_datadir}/apps/kconf_update/kkbswitch_update_14_icons
|
||||||
|
%{_datadir}/apps/kconf_update/kkbswitch_update_14_options
|
||||||
|
%{_datadir}/locale/*/LC_MESSAGES/kkbswitch.mo
|
||||||
|
%{_datadir}/autostart/kkbswitch.desktop
|
||||||
|
%{_mandir}/man1/kkbswitch.1*
|
||||||
|
%if 0%{?_with_ru_ua_layout:1}
|
||||||
|
/usr/X11R6/lib/X11/xkb/symbols/ru_ua
|
||||||
|
%endif
|
||||||
|
%changelog
|
||||||
|
* Sat Jan 15 2005 Leonid Zeitlin <lz@europe.com> 1.4.2
|
||||||
|
- Version 1.4.3
|
||||||
|
|
||||||
|
* Sat Nov 13 2004 Leonid Zeitlin <lz@europe.com> 1.4.2-2
|
||||||
|
- Added explicit BuildRequires: kdelibs-devel
|
||||||
|
- Don't use %configure, it causes binary to be named something like
|
||||||
|
i686-redhat-linux-gnu-kkbswitch on older (RH 7.3) systems
|
||||||
|
|
||||||
|
* Sat Nov 6 2004 Leonid Zeitlin <lz@europe.com>
|
||||||
|
- Version 1.4.2
|
||||||
|
|
||||||
|
* Tue Jun 15 2004 Leonid Zeitlin <lz@europe.com>
|
||||||
|
- Version 1.4.1
|
||||||
|
|
||||||
|
* Sat May 8 2004 Leonid Zeitlin <lz@europe.com>
|
||||||
|
- Version 1.4
|
||||||
|
- provide files list explicitly
|
||||||
|
- --without ru_ua_layout support
|
||||||
|
|
||||||
|
* Thu Jan 8 2004 Leonid Zeitlin <lz@europe.com>
|
||||||
|
- Version 1.3.2
|
||||||
|
|
||||||
|
* Sun Nov 2 2003 Leonid Zeitlin <lz@europe.com>
|
||||||
|
- Version 1.3.1
|
||||||
|
|
||||||
|
* Tue Oct 21 2003 Leonid Zeitlin <lz@europe.com>
|
||||||
|
- Version 1.3
|
@ -0,0 +1,4 @@
|
|||||||
|
|
||||||
|
updatedir = $(kde_datadir)/kconf_update
|
||||||
|
update_SCRIPTS = kkbswitch_update_14_icons kkbswitch_update_14_options
|
||||||
|
update_DATA = kkbswitch.upd
|
@ -0,0 +1,9 @@
|
|||||||
|
Id=kkbswitch1.4-icons
|
||||||
|
File=kkbswitchrc
|
||||||
|
Group=Icons
|
||||||
|
Script=kkbswitch_update_14_icons
|
||||||
|
#
|
||||||
|
Id=kkbswitch1.4-options
|
||||||
|
File=kkbswitchrc
|
||||||
|
Group=Options
|
||||||
|
Script=kkbswitch_update_14_options
|
@ -0,0 +1,29 @@
|
|||||||
|
#!/bin/sh
|
||||||
|
|
||||||
|
# update Icons section
|
||||||
|
if [ -z "$DISPLAY" ]; then
|
||||||
|
DISPLAY=":0"
|
||||||
|
fi
|
||||||
|
|
||||||
|
# get group names
|
||||||
|
eval $(xkbcomp $DISPLAY - | grep -i 'name\[group[0-9]*\] *=' | sed -e 's/\[/_/;s/]//')
|
||||||
|
|
||||||
|
IFS='='
|
||||||
|
while read name value; do
|
||||||
|
loname=$(echo "$name" | tr 'A-Z' 'a-z');
|
||||||
|
case "$loname" in
|
||||||
|
group[1-4])
|
||||||
|
groupname=$(eval echo -n \$"name_$loname");
|
||||||
|
if [ -n "$groupname" ]; then
|
||||||
|
echo "$groupname=$value"
|
||||||
|
echo "# DELETE $name"
|
||||||
|
else
|
||||||
|
echo "$name=$value"
|
||||||
|
fi
|
||||||
|
;;
|
||||||
|
*)
|
||||||
|
echo "$name=$value"
|
||||||
|
;;
|
||||||
|
esac
|
||||||
|
done;
|
||||||
|
|
@ -0,0 +1,16 @@
|
|||||||
|
#!/bin/sh
|
||||||
|
|
||||||
|
# update options section
|
||||||
|
IFS='=';
|
||||||
|
while read name value; do
|
||||||
|
if [ "$name" = "perwindow_group" ]; then
|
||||||
|
if [ "$value" = "true" ]; then
|
||||||
|
echo "group_scope=2"
|
||||||
|
else
|
||||||
|
echo "group_scope=0"
|
||||||
|
fi
|
||||||
|
echo "# DELETE perwindow_group"
|
||||||
|
else
|
||||||
|
echo "$name=$value"
|
||||||
|
fi
|
||||||
|
done
|
@ -0,0 +1,47 @@
|
|||||||
|
/* XPM */
|
||||||
|
static char *magick[] = {
|
||||||
|
/* columns rows colors chars-per-pixel */
|
||||||
|
"32 32 9 1",
|
||||||
|
" c #00000040",
|
||||||
|
". c #0000c040",
|
||||||
|
"X c #0000ff6f",
|
||||||
|
"o c #00808074",
|
||||||
|
"O c #00c0c074",
|
||||||
|
"+ c #80808025",
|
||||||
|
"@ c #c0c0c079",
|
||||||
|
"# c #ffffff20",
|
||||||
|
"$ c None",
|
||||||
|
/* pixels */
|
||||||
|
"$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$",
|
||||||
|
"$$$$$$$$$$$$$ $$$$$$$$$$$$$$$$$",
|
||||||
|
"$$$$$$$$$$$$$ + $$$$$$$$$$$$$$$",
|
||||||
|
"$$$$$$$$$$$$$ @@ $$$$$$$$$$$$$",
|
||||||
|
"$$$$$ $$$$$$ @@ .. $$$$$$$$$$$",
|
||||||
|
"$$$$$ + $$$$ + XX.. $$$$$$$$$",
|
||||||
|
"$$$$$ @@ $$ @ ..XX.. $$$$$$$",
|
||||||
|
"$$$$$ @@ .. ##@ ..XX. $$$$$",
|
||||||
|
"$$$$$ + XX.. @##@ ..X @+ $$$",
|
||||||
|
"$$$$$ @ ..XX.. @##@ . @@ + $",
|
||||||
|
"$$$$$ ##@ ..XX. @##@ +@ @@ $",
|
||||||
|
"$$$$$ ####@ ..X @+ @##@ @@ $",
|
||||||
|
"$$$$$ ######@ . @@ + ###@ + $",
|
||||||
|
"$$$$$ ########@ +@ @@ @####@ $",
|
||||||
|
"$ $$ ##########@ @@ @@####@ $",
|
||||||
|
"$ o ############@ + @@####@ $",
|
||||||
|
"$ Ooo @############@ @@####@ $",
|
||||||
|
"$ oOOoo @###########@ @@####@ $",
|
||||||
|
"$ ooOOoo @#########@ @@####@ $",
|
||||||
|
"$ @ ooOO + ########@ @@####@ $",
|
||||||
|
"$ ##@ oo @@ @#######@ @@####@ $",
|
||||||
|
"$ ####@ @@ @@######@ @@####@ $",
|
||||||
|
"$ ######@ + @@######@ @@@###@ $",
|
||||||
|
"$ ########@ @@######@ @@@#@ $",
|
||||||
|
"$ @@#######@ @@@#####@ $$ @@@ $",
|
||||||
|
"$ @@@#####@ @@@###@ $$$$ @ $",
|
||||||
|
"$$$ @@@###@ $$ @@@#@ $$$$$$ $",
|
||||||
|
"$$$$$ @@@#@ $$$$ @@@ $$$$$$$$$",
|
||||||
|
"$$$$$$$ @@@ $$$$$$ @ $$$$$$$$$",
|
||||||
|
"$$$$$$$$$ @ $$$$$$$$ $$$$$$$$$",
|
||||||
|
"$$$$$$$$$$$ $$$$$$$$$$$$$$$$$$$",
|
||||||
|
"$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$"
|
||||||
|
};
|
@ -0,0 +1,29 @@
|
|||||||
|
|
||||||
|
METASOURCES = AUTO
|
||||||
|
|
||||||
|
bin_PROGRAMS = kkbswitch
|
||||||
|
kkbswitch_LDFLAGS = $(KDE_RPATH) $(all_libraries)
|
||||||
|
kkbswitch_SOURCES = boldlistboxitem.cpp boldmenuitem.cpp kbconfig.cpp kbconfigdlg.cpp kbgroup.cpp kbpickicondlg.cpp kbswitchapp.cpp kbswitchintf.cpp kbswitchtrayicon.cpp main.cpp pathlistboxitem.cpp xkeyboard.cpp kbswitchintf.skel boldlistboxitem.h boldmenuitem.h kbconfigdlg.h kbconfig.h kbgroup.h kbpickicondlg.h kbswitchapp.h kbswitchintf.h kbswitchtrayicon.h pathlistboxitem.h xkeyboard.h windowwatcher.cpp singlewindowwatcher.cpp windowclasswatcher.cpp
|
||||||
|
|
||||||
|
INCLUDES = $(all_includes)
|
||||||
|
|
||||||
|
kkbswitch_LDADD = $(LIB_KIO) $(LIB_KDEUI)
|
||||||
|
|
||||||
|
messages:
|
||||||
|
$(XGETTEXT) *.cpp -o $(podir)/kkbswitch.pot
|
||||||
|
|
||||||
|
noinst_HEADERS = windowwatcher.h singlewindowwatcher.h windowclasswatcher.h
|
||||||
|
|
||||||
|
kkbswitchdatadir = $(kde_datadir)/kkbswitch
|
||||||
|
kkbswitchdata_DATA = group_names
|
||||||
|
|
||||||
|
applnkUtilities_DATA = kkbswitch.desktop
|
||||||
|
applnkUtilitiesdir = $(kde_appsdir)/Utilities
|
||||||
|
|
||||||
|
if ENABLE_RU_UA_LAYOUT
|
||||||
|
xkbsymbolsdir = $(x_libraries)/X11/xkb/symbols
|
||||||
|
xkbsymbols_DATA = ru_ua
|
||||||
|
endif
|
||||||
|
|
||||||
|
autostartdir = $(prefix)/share/autostart
|
||||||
|
autostart_DATA = kkbswitch.desktop
|
@ -0,0 +1,31 @@
|
|||||||
|
|
||||||
|
METASOURCES = AUTO
|
||||||
|
|
||||||
|
bin_PROGRAMS =
|
||||||
|
lib_LTLIBRARIES =
|
||||||
|
kdeinit_LTLIBRARIES = kkbswitch.la
|
||||||
|
kkbswitch_la_LDFLAGS = $(KDE_RPATH) $(all_libraries) -module -avoid-version
|
||||||
|
kkbswitch_la_SOURCES = boldlistboxitem.cpp boldmenuitem.cpp kbconfig.cpp kbconfigdlg.cpp kbgroup.cpp kbpickicondlg.cpp kbswitchapp.cpp kbswitchintf.cpp kbswitchtrayicon.cpp main.cpp pathlistboxitem.cpp xkeyboard.cpp kbswitchintf.skel boldlistboxitem.h boldmenuitem.h kbconfigdlg.h kbconfig.h kbgroup.h kbpickicondlg.h kbswitchapp.h kbswitchintf.h kbswitchtrayicon.h pathlistboxitem.h xkeyboard.h windowwatcher.cpp singlewindowwatcher.cpp windowclasswatcher.cpp
|
||||||
|
|
||||||
|
INCLUDES = $(all_includes)
|
||||||
|
|
||||||
|
kkbswitch_la_LIBADD = $(LIB_KIO) $(LIB_KDEUI)
|
||||||
|
|
||||||
|
messages:
|
||||||
|
$(XGETTEXT) *.cpp -o $(podir)/kkbswitch.pot
|
||||||
|
|
||||||
|
noinst_HEADERS = windowwatcher.h singlewindowwatcher.h windowclasswatcher.h
|
||||||
|
|
||||||
|
kkbswitchdatadir = $(kde_datadir)/kkbswitch
|
||||||
|
kkbswitchdata_DATA = group_names
|
||||||
|
|
||||||
|
applnkUtilities_DATA = kkbswitch.desktop
|
||||||
|
applnkUtilitiesdir = $(kde_appsdir)/Utilities
|
||||||
|
|
||||||
|
if ENABLE_RU_UA_LAYOUT
|
||||||
|
xkbsymbolsdir = $(x_libraries)/X11/xkb/symbols
|
||||||
|
xkbsymbols_DATA = ru_ua
|
||||||
|
endif
|
||||||
|
|
||||||
|
autostartdir = $(prefix)/share/autostart
|
||||||
|
autostart_DATA = kkbswitch.desktop
|
@ -0,0 +1,39 @@
|
|||||||
|
/***************************************************************************
|
||||||
|
boldlistboxitem.cpp - description
|
||||||
|
-------------------
|
||||||
|
begin : ??? ??? 12 2003
|
||||||
|
copyright : (C) 2003 by Leonid Zeitlin
|
||||||
|
email : lz@europe.com
|
||||||
|
***************************************************************************/
|
||||||
|
|
||||||
|
/***************************************************************************
|
||||||
|
* *
|
||||||
|
* 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. *
|
||||||
|
* *
|
||||||
|
***************************************************************************/
|
||||||
|
|
||||||
|
#include "boldlistboxitem.h"
|
||||||
|
#include <qpainter.h>
|
||||||
|
|
||||||
|
BoldListBoxItem::BoldListBoxItem(QListBox *listbox, const QPixmap &pix,
|
||||||
|
const QString &text, bool bold)
|
||||||
|
: QListBoxPixmap(listbox, pix, text), m_bold(bold)
|
||||||
|
{
|
||||||
|
}
|
||||||
|
|
||||||
|
BoldListBoxItem::~BoldListBoxItem()
|
||||||
|
{
|
||||||
|
}
|
||||||
|
|
||||||
|
void BoldListBoxItem::paint(QPainter *painter)
|
||||||
|
{
|
||||||
|
if (m_bold) {
|
||||||
|
QFont font = painter->font();
|
||||||
|
font.setBold(true);
|
||||||
|
painter->setFont(font);
|
||||||
|
}
|
||||||
|
QListBoxPixmap::paint(painter);
|
||||||
|
}
|
@ -0,0 +1,40 @@
|
|||||||
|
/***************************************************************************
|
||||||
|
boldlistboxitem.h - description
|
||||||
|
-------------------
|
||||||
|
begin : Sun Oct 12 2003
|
||||||
|
copyright : (C) 2003 by Leonid Zeitlin
|
||||||
|
email : lz@europe.com
|
||||||
|
***************************************************************************/
|
||||||
|
|
||||||
|
/***************************************************************************
|
||||||
|
* *
|
||||||
|
* 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. *
|
||||||
|
* *
|
||||||
|
***************************************************************************/
|
||||||
|
|
||||||
|
#ifndef BOLDLISTBOXITEM_H
|
||||||
|
#define BOLDLISTBOXITEM_H
|
||||||
|
|
||||||
|
#include <qlistbox.h>
|
||||||
|
|
||||||
|
/**Listbox item that can optionally display its text in bold
|
||||||
|
*@author Leonid Zeitlin
|
||||||
|
*/
|
||||||
|
|
||||||
|
class BoldListBoxItem : public QListBoxPixmap {
|
||||||
|
private:
|
||||||
|
bool m_bold;
|
||||||
|
protected:
|
||||||
|
virtual void paint (QPainter *painter);
|
||||||
|
public:
|
||||||
|
BoldListBoxItem(QListBox *listbox, const QPixmap &pix, const QString &text,
|
||||||
|
bool bold = false);
|
||||||
|
~BoldListBoxItem();
|
||||||
|
bool bold() { return m_bold; }
|
||||||
|
void setBold(bool bold) { m_bold = bold; }
|
||||||
|
};
|
||||||
|
|
||||||
|
#endif
|
@ -0,0 +1,68 @@
|
|||||||
|
/***************************************************************************
|
||||||
|
boldmenuitem.cpp - description
|
||||||
|
-------------------
|
||||||
|
begin : Sat Sep 1 2001
|
||||||
|
copyright : (C) 2001 by Leonid Zeitlin
|
||||||
|
email : lz@europe.com
|
||||||
|
***************************************************************************/
|
||||||
|
|
||||||
|
/***************************************************************************
|
||||||
|
* *
|
||||||
|
* 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. *
|
||||||
|
* *
|
||||||
|
***************************************************************************/
|
||||||
|
|
||||||
|
#include "boldmenuitem.h"
|
||||||
|
#include <qfont.h>
|
||||||
|
#include <qpainter.h>
|
||||||
|
#include <qpalette.h>
|
||||||
|
#include <qstyle.h>
|
||||||
|
#include <kdebug.h>
|
||||||
|
#include <kglobalsettings.h>
|
||||||
|
#include <kdeversion.h>
|
||||||
|
#if KDE_VERSION_MAJOR >= 3
|
||||||
|
#include <kapplication.h>
|
||||||
|
#else
|
||||||
|
#include <kapp.h>
|
||||||
|
#endif
|
||||||
|
|
||||||
|
|
||||||
|
BoldMenuItem::BoldMenuItem(const QString &text, const QColor &active_text_color,
|
||||||
|
bool bold)
|
||||||
|
: m_text(text), m_active_text_color(active_text_color), m_bold(bold)
|
||||||
|
{
|
||||||
|
}
|
||||||
|
|
||||||
|
BoldMenuItem::~BoldMenuItem(){
|
||||||
|
}
|
||||||
|
|
||||||
|
void BoldMenuItem::paint(QPainter* painter, const QColorGroup& /*cg*/,
|
||||||
|
bool act, bool /*enabled*/, int x, int y, int w, int h)
|
||||||
|
{
|
||||||
|
QFont font = painter->font();
|
||||||
|
if (font.bold() != m_bold) {
|
||||||
|
font.setBold(m_bold);
|
||||||
|
painter->setFont(font);
|
||||||
|
}
|
||||||
|
//if (act) painter->setPen(KGlobalSettings::highlightedTextColor());
|
||||||
|
//if (act) painter->setPen(cg.highlightedText());
|
||||||
|
if (act) painter->setPen(m_active_text_color);
|
||||||
|
kdDebug() << "bg color = " << painter->brush().color().rgb() << endl;
|
||||||
|
|
||||||
|
painter->drawText(x, y, w, h, AlignLeft | AlignVCenter | ShowPrefix | DontClip,
|
||||||
|
m_text);
|
||||||
|
//KApplication::style().drawItem(painter, QRect(x, y, w, h), AlignLeft | AlignVCenter | ShowPrefix | DontClip,
|
||||||
|
// cg, enabled, 0, m_text);
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
void BoldMenuItem::setFont(const QFont& font)
|
||||||
|
{
|
||||||
|
m_size = QFontMetrics(font).size(AlignLeft | AlignVCenter | ShowPrefix | DontClip,
|
||||||
|
m_text);
|
||||||
|
QCustomMenuItem::setFont(font);
|
||||||
|
}
|
||||||
|
|
@ -0,0 +1,52 @@
|
|||||||
|
/***************************************************************************
|
||||||
|
boldmenuitem.h - description
|
||||||
|
-------------------
|
||||||
|
begin : Sat Sep 1 2001
|
||||||
|
copyright : (C) 2001 by Leonid Zeitlin
|
||||||
|
email : lz@europe.com
|
||||||
|
***************************************************************************/
|
||||||
|
|
||||||
|
/***************************************************************************
|
||||||
|
* *
|
||||||
|
* 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. *
|
||||||
|
* *
|
||||||
|
***************************************************************************/
|
||||||
|
|
||||||
|
#ifndef BOLDMENUITEM_H
|
||||||
|
#define BOLDMENUITEM_H
|
||||||
|
|
||||||
|
#include <qmenudata.h>
|
||||||
|
|
||||||
|
/**A custom menu item that can display its text in bold
|
||||||
|
*@author Leonid Zeitlin
|
||||||
|
* 02.09.2001: somehow I cannot make it work. The item looks ok when not
|
||||||
|
* selected, but appears empty when selected. I have a suspicion that this
|
||||||
|
* is a problem with some KDE styles (B3 in particular), the style doesn't
|
||||||
|
* paint custom menu items correctly. With some other styles, such as Qt built-in
|
||||||
|
* Windows style, everything works correctly. I suspend the work on this for the
|
||||||
|
* time being...
|
||||||
|
*/
|
||||||
|
|
||||||
|
class BoldMenuItem : public QCustomMenuItem {
|
||||||
|
private:
|
||||||
|
QString m_text;
|
||||||
|
QColor m_active_text_color;
|
||||||
|
bool m_bold;
|
||||||
|
QSize m_size;
|
||||||
|
public:
|
||||||
|
BoldMenuItem(const QString &text, const QColor &active_text_color, bool bold = false);
|
||||||
|
~BoldMenuItem();
|
||||||
|
QString& text() { return m_text; };
|
||||||
|
void setText(const QString& value) { m_text = value; };
|
||||||
|
bool bold() { return m_bold; };
|
||||||
|
void setBold(bool value) { m_bold = value; };
|
||||||
|
virtual void paint(QPainter* painter, const QColorGroup& /*cg*/,
|
||||||
|
bool act, bool /*enabled*/, int x, int y, int w, int h);
|
||||||
|
virtual void setFont(const QFont& font);
|
||||||
|
virtual QSize sizeHint() { return m_size; };
|
||||||
|
};
|
||||||
|
|
||||||
|
#endif
|
@ -0,0 +1,44 @@
|
|||||||
|
[Mapping]
|
||||||
|
US/ASCII=us
|
||||||
|
Belgian=be
|
||||||
|
Bulgarian=bg
|
||||||
|
Canadian=ca
|
||||||
|
Czech=cz
|
||||||
|
Danish=dk
|
||||||
|
Finnish=fi
|
||||||
|
French=fr
|
||||||
|
Georgian=ge
|
||||||
|
German=de
|
||||||
|
Great Britain=gb
|
||||||
|
Greek=gr
|
||||||
|
Hungarian=hu
|
||||||
|
Icelandic=is
|
||||||
|
ISO8859-7=gr
|
||||||
|
Israelian=il
|
||||||
|
Italian=it
|
||||||
|
Latvian=lv
|
||||||
|
Lithuanian=lt
|
||||||
|
Macedonian=mk
|
||||||
|
Norwegian=no
|
||||||
|
Polish=pl
|
||||||
|
Portugese=pt
|
||||||
|
Russian=ru
|
||||||
|
Slovak=sk
|
||||||
|
Spanish=es
|
||||||
|
Swedish=se
|
||||||
|
Swiss French=ch
|
||||||
|
Swiss German=ch
|
||||||
|
Thai=th
|
||||||
|
Ukrainian=ua
|
||||||
|
Vietnamese=vn
|
||||||
|
|
||||||
|
[Languages]
|
||||||
|
US/ASCII=en
|
||||||
|
Canadian=en
|
||||||
|
Great Britain=en
|
||||||
|
Greek=el
|
||||||
|
ISO8859-7=el
|
||||||
|
Israelian=he
|
||||||
|
Swiss French=fr
|
||||||
|
Swiss German=de
|
||||||
|
Ukrainian=uk
|
@ -0,0 +1,340 @@
|
|||||||
|
/***************************************************************************
|
||||||
|
kbconfig.cpp - description
|
||||||
|
-------------------
|
||||||
|
begin : Sun Jul 8 2001
|
||||||
|
copyright : (C) 2001 by Leonid Zeitlin
|
||||||
|
email : lz@europe.com
|
||||||
|
***************************************************************************/
|
||||||
|
|
||||||
|
/***************************************************************************
|
||||||
|
* *
|
||||||
|
* 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. *
|
||||||
|
* *
|
||||||
|
***************************************************************************/
|
||||||
|
|
||||||
|
#include <config.h>
|
||||||
|
#include <kdeversion.h>
|
||||||
|
#include <klocale.h>
|
||||||
|
#include <kglobal.h>
|
||||||
|
#if KDE_VERSION_MAJOR >= 3
|
||||||
|
#include <kstandarddirs.h>
|
||||||
|
#include <kapplication.h>
|
||||||
|
#else
|
||||||
|
#include <kstddirs.h>
|
||||||
|
#include <kapp.h>
|
||||||
|
#endif
|
||||||
|
#include <kglobalsettings.h>
|
||||||
|
#include <kdebug.h>
|
||||||
|
#include <kglobalaccel.h>
|
||||||
|
|
||||||
|
#include <qnamespace.h>
|
||||||
|
#include <qpainter.h>
|
||||||
|
#include <qimage.h>
|
||||||
|
|
||||||
|
#include "kbconfig.h"
|
||||||
|
#include "xkeyboard.h"
|
||||||
|
|
||||||
|
#ifdef HAVE_X11_EXTENSIONS_XKBRULES_H
|
||||||
|
#include <X11/extensions/XKBrules.h>
|
||||||
|
#endif
|
||||||
|
|
||||||
|
#define TOGGLE_MODE_ENTRY "toggle_mode"
|
||||||
|
#define DEFAULT_GROUP_ENTRY "default_group"
|
||||||
|
//#define PERWINDOW_GROUP_ENTRY "perwindow_group"
|
||||||
|
#define ICON_TYPE_ENTRY "icon_type"
|
||||||
|
#define AUTOSTART_ENTRY "autostart"
|
||||||
|
#define USE_SHORTCUTS_ENTRY "use_shorcuts"
|
||||||
|
#define GROUP_SCOPE_ENTRY "group_scope"
|
||||||
|
|
||||||
|
KBConfig::KBConfig()
|
||||||
|
{
|
||||||
|
m_toggle_mode = false;
|
||||||
|
m_groups.setAutoDelete(true);
|
||||||
|
m_default_groupno = 0;
|
||||||
|
//m_perwindow_group = false;
|
||||||
|
m_group_scope = SCOPE_GLOBAL;
|
||||||
|
m_autostart = true;
|
||||||
|
m_icon_style = ICON_CODE_AND_FLAG;
|
||||||
|
//m_keys = new KGlobalAccel(NULL);
|
||||||
|
m_keys = NULL;
|
||||||
|
}
|
||||||
|
|
||||||
|
KBConfig::~KBConfig()
|
||||||
|
{
|
||||||
|
delete m_keys;
|
||||||
|
}
|
||||||
|
|
||||||
|
/** load the KBSwitch configration from the application KConfig object */
|
||||||
|
void KBConfig::load(KConfig *config){
|
||||||
|
config->setGroup(OPTIONS_SECTION);
|
||||||
|
m_toggle_mode = config->readBoolEntry(TOGGLE_MODE_ENTRY);
|
||||||
|
m_default_groupno = config->readNumEntry(DEFAULT_GROUP_ENTRY);
|
||||||
|
//m_perwindow_group = config->readBoolEntry(PERWINDOW_GROUP_ENTRY);
|
||||||
|
m_group_scope = GroupScope(config->readNumEntry(GROUP_SCOPE_ENTRY, SCOPE_GLOBAL));
|
||||||
|
m_autostart = config->readBoolEntry(AUTOSTART_ENTRY, true);
|
||||||
|
m_icon_style = IconStyle(config->readNumEntry(ICON_TYPE_ENTRY, ICON_FLAG));
|
||||||
|
m_use_shortcuts = config->readBoolEntry(USE_SHORTCUTS_ENTRY, false);
|
||||||
|
|
||||||
|
XKeyboard *xkb = XKeyboard::self();
|
||||||
|
QStringList list;
|
||||||
|
xkb->getGroupNames(list);
|
||||||
|
unsigned int i = 0;
|
||||||
|
m_groups.clear();
|
||||||
|
m_groups.resize(xkb->getNumKbdGroups());
|
||||||
|
QString name;
|
||||||
|
for (QStringList::Iterator iter = list.begin(); iter != list.end(); iter++, i++) {
|
||||||
|
name = *iter;
|
||||||
|
if (name == QString::null) name = i18n("<Unnamed>");
|
||||||
|
m_groups.insert(i, new KBGroup(name));
|
||||||
|
}
|
||||||
|
|
||||||
|
QValueVector<QPixmap> pixlist;
|
||||||
|
QStringList iconpaths;
|
||||||
|
drawIcons(m_icon_style, &pixlist, &iconpaths);
|
||||||
|
for (i = 0; i < m_groups.count(); i++) {
|
||||||
|
m_groups[i]->setPixmap(pixlist[i]);
|
||||||
|
m_groups[i]->setIconPath(iconpaths[i]);
|
||||||
|
}
|
||||||
|
|
||||||
|
if (m_keys) delete m_keys;
|
||||||
|
m_keys = new KGlobalAccel(NULL);
|
||||||
|
for (int i = 0; i < groupCount(); i++) {
|
||||||
|
m_keys->insert(QString::fromLatin1("SetGroup %1").arg(i),
|
||||||
|
i18n("Activate %1 keyboard layout").arg(m_groups[i]->getName()),
|
||||||
|
QString::null, Qt::ALT+Qt::CTRL+Qt::Key_1 + i, KKey::QtWIN+Qt::CTRL+Qt::Key_1 + i,
|
||||||
|
kapp, SLOT(slotGroupSelected(int)));
|
||||||
|
}
|
||||||
|
m_keys->readSettings(config);
|
||||||
|
checkKeysEnabled();
|
||||||
|
}
|
||||||
|
|
||||||
|
void KBConfig::save(KConfig *config)
|
||||||
|
{
|
||||||
|
config->setGroup(OPTIONS_SECTION);
|
||||||
|
config->writeEntry(TOGGLE_MODE_ENTRY, m_toggle_mode);
|
||||||
|
config->writeEntry(DEFAULT_GROUP_ENTRY, m_default_groupno);
|
||||||
|
//config->writeEntry(PERWINDOW_GROUP_ENTRY, m_perwindow_group);
|
||||||
|
config->writeEntry(GROUP_SCOPE_ENTRY, m_group_scope);
|
||||||
|
config->writeEntry(ICON_TYPE_ENTRY, m_icon_style);
|
||||||
|
config->writeEntry(AUTOSTART_ENTRY, m_autostart);
|
||||||
|
config->writeEntry(USE_SHORTCUTS_ENTRY, m_use_shortcuts);
|
||||||
|
m_keys->writeSettings(config);
|
||||||
|
}
|
||||||
|
|
||||||
|
void KBConfig::drawIcons(IconStyle icon_style, QValueVector<QPixmap> *icons,
|
||||||
|
QStringList *iconpaths)
|
||||||
|
{
|
||||||
|
QString path, countryCode, langCode;
|
||||||
|
QStringList layouts;
|
||||||
|
|
||||||
|
KGlobal::dirs()->addResourceDir("appdata", ".");
|
||||||
|
KConfig map("group_names", true, true, "appdata");
|
||||||
|
KConfig *config = kapp->config();
|
||||||
|
config->setGroup(ICONS_SECTION);
|
||||||
|
getXkbLayouts(layouts);
|
||||||
|
|
||||||
|
icons->clear();
|
||||||
|
icons->resize(m_groups.count());
|
||||||
|
iconpaths->clear();
|
||||||
|
for (unsigned int i = 0; i < m_groups.count(); i++) {
|
||||||
|
map.setGroup("Mapping");
|
||||||
|
countryCode = map.readEntry(m_groups[i]->getName());
|
||||||
|
// if the country code can't be guessed from group name, try XKB layout name
|
||||||
|
if (countryCode.isEmpty() && i < layouts.count()) countryCode = layouts[i];
|
||||||
|
map.setGroup("Languages");
|
||||||
|
langCode = map.readEntry(m_groups[i]->getName());
|
||||||
|
if (langCode.isEmpty()) langCode = countryCode;
|
||||||
|
QPixmap &pix = (*icons)[i];
|
||||||
|
pix.resize(0, 0);
|
||||||
|
path = QString::null;
|
||||||
|
if (icon_style == ICON_FLAG /*&& !countryCode.isEmpty()*/)
|
||||||
|
drawFlagPixmap(pix, path, countryCode, i, config);
|
||||||
|
else if (icon_style == ICON_CODE_AND_FLAG /*&& !countryCode.isEmpty()*/)
|
||||||
|
drawCodeAndFlagPixmap(pix, path, countryCode, langCode, i, config);
|
||||||
|
if (pix.isNull() && !langCode.isEmpty())
|
||||||
|
drawCodePixmap(pix, langCode);
|
||||||
|
if (pix.isNull()) drawDefaultPixmap(pix, i);
|
||||||
|
iconpaths->append(path);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
/** No descriptions */
|
||||||
|
/*void KBConfig::guessGroupPixmaps(){
|
||||||
|
KGlobal::dirs()->addResourceDir("appdata", ".");
|
||||||
|
KConfig map("group_names", true, true, "appdata");
|
||||||
|
QString path, countryCode, langCode;
|
||||||
|
QPixmap pix;
|
||||||
|
|
||||||
|
for (unsigned int i = 0; i < m_groups.count(); i++) {
|
||||||
|
if (m_groups[i]->getPixmap().isNull()) {
|
||||||
|
map.setGroup("Mapping");
|
||||||
|
countryCode = map.readEntry(m_groups[i]->getName());
|
||||||
|
map.setGroup("Languages");
|
||||||
|
langCode = map.readEntry(m_groups[i]->getName());
|
||||||
|
if (langCode.isEmpty()) langCode = countryCode;
|
||||||
|
pix.resize(0, 0);
|
||||||
|
if (m_icon_type == ICON_FLAG && !countryCode.isEmpty())
|
||||||
|
drawFlagPixmap(pix, countryCode);
|
||||||
|
else if (m_icon_type == ICON_CODE_AND_FLAG && !countryCode.isEmpty())
|
||||||
|
drawCodeAndFlagPixmap(pix, countryCode, langCode);
|
||||||
|
if (pix.isNull() && !langCode.isEmpty())
|
||||||
|
drawCodePixmap(pix, langCode);
|
||||||
|
if (!pix.isNull()) m_groups[i]->setPixmap(pix);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}*/
|
||||||
|
|
||||||
|
bool KBConfig::getGroupImage(QImage &img, QString &path, const QString &code,
|
||||||
|
int group, KConfig *config)
|
||||||
|
{
|
||||||
|
bool ret = true;
|
||||||
|
bool need_to_scale = false;
|
||||||
|
|
||||||
|
path = config->readEntry(m_groups[group]->getName()/*entryForGroup(group)*/);
|
||||||
|
if (path.isEmpty() || !img.load(path)) {
|
||||||
|
if (code.isEmpty()) ret = false;
|
||||||
|
else {
|
||||||
|
path = locate("locale", QString("l10n/%1/flag.png").arg(code));
|
||||||
|
if (!path.isEmpty()) ret = img.load(path);
|
||||||
|
else {
|
||||||
|
// I am told in Red Hat 9 standard KDE flag pixmaps are missing.
|
||||||
|
// Workaround: we have to simulate them by rescaling GKB's pixmaps
|
||||||
|
path = QString("/usr/share/pixmaps/gkb/%1.png").arg(code);
|
||||||
|
ret = img.load(path) && !img.isNull();
|
||||||
|
need_to_scale = true;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
if (ret) {
|
||||||
|
// if need_to_scale is not already set, set it if image is too wide
|
||||||
|
if (!need_to_scale) need_to_scale = img.width() > 24;
|
||||||
|
if (need_to_scale) img = img.smoothScale(FLAG_ICON_WIDTH, FLAG_ICON_HEIGHT);
|
||||||
|
}
|
||||||
|
return ret;
|
||||||
|
}
|
||||||
|
|
||||||
|
void KBConfig::drawFlagPixmap(QPixmap &pix, QString &path, const QString &code,
|
||||||
|
int group, KConfig *config)
|
||||||
|
{
|
||||||
|
QImage img;
|
||||||
|
if (getGroupImage(img, path, code, group, config))
|
||||||
|
pix.convertFromImage(img);
|
||||||
|
}
|
||||||
|
|
||||||
|
void KBConfig::drawCodePixmap(QPixmap &pix, const QString &code)
|
||||||
|
{
|
||||||
|
pix.resize(19, 16);
|
||||||
|
|
||||||
|
QPainter painter(&pix);
|
||||||
|
QFont font("helvetica", 9, QFont::Bold);
|
||||||
|
font.setPixelSize(10);
|
||||||
|
painter.setFont(font);
|
||||||
|
painter.setPen(KGlobalSettings::highlightedTextColor());
|
||||||
|
|
||||||
|
pix.fill(KGlobalSettings::highlightColor());
|
||||||
|
painter.drawText(1, 0, pix.width(), pix.height(),
|
||||||
|
Qt::AlignHCenter | Qt::AlignVCenter, code.upper());
|
||||||
|
|
||||||
|
/*QSize size = painter.fontMetrics().size(0, code.upper());
|
||||||
|
kdDebug() << size.width() << " x " << size.height() << endl;*/
|
||||||
|
}
|
||||||
|
|
||||||
|
void KBConfig::drawCodeAndFlagPixmap(QPixmap &pix, QString &path,
|
||||||
|
const QString &countryCode, const QString &langCode, int group, KConfig *config)
|
||||||
|
{
|
||||||
|
QImage img;
|
||||||
|
if (!getGroupImage(img, path, countryCode, group, config)) return; // could not find flag
|
||||||
|
if (img.depth() <= 8) img = img.convertDepth(32);
|
||||||
|
|
||||||
|
// the following code is taken from kdebase/kxkb/pixmap.cpp
|
||||||
|
for (int y = 0; y < img.height(); y++)
|
||||||
|
for(int x = 0; x < img.width(); x++) {
|
||||||
|
QRgb rgb = img.pixel(x, y);
|
||||||
|
img.setPixel(x, y, qRgb(qRed(rgb)*3/4, qGreen(rgb)*3/4, qBlue(rgb)*3/4));
|
||||||
|
}
|
||||||
|
pix.convertFromImage(img);
|
||||||
|
|
||||||
|
QPainter painter(&pix);
|
||||||
|
painter.setPen(Qt::black);
|
||||||
|
painter.setFont(QFont("helvetica", 10, QFont::Bold));
|
||||||
|
painter.drawText(1, 1, pix.width(), pix.height()-2, Qt::AlignCenter, langCode);
|
||||||
|
painter.setPen(Qt::white);
|
||||||
|
painter.drawText(0, 0, pix.width(), pix.height()-2, Qt::AlignCenter, langCode);
|
||||||
|
}
|
||||||
|
|
||||||
|
void KBConfig::drawDefaultPixmap(QPixmap &pix, int group)
|
||||||
|
{
|
||||||
|
pix.resize(FLAG_ICON_WIDTH, FLAG_ICON_HEIGHT);
|
||||||
|
QPainter painter(&pix);
|
||||||
|
pix.fill();
|
||||||
|
painter.drawText(0, 0, pix.width(), pix.height(),
|
||||||
|
Qt::AlignHCenter | Qt::AlignVCenter, QString::number(group+1));
|
||||||
|
}
|
||||||
|
|
||||||
|
void KBConfig::checkKeysEnabled()
|
||||||
|
{
|
||||||
|
m_keys->setEnabled(m_use_shortcuts);
|
||||||
|
m_keys->updateConnections();
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
/** No descriptions */
|
||||||
|
/*void KBConfig::drawDefaultPixmaps(){
|
||||||
|
QPixmap pix(16, 16);
|
||||||
|
QPainter painter(&pix);
|
||||||
|
|
||||||
|
for (unsigned int i = 0; i < m_groups.count(); i++) {
|
||||||
|
if (m_groups[i]->getPixmap().isNull()) {
|
||||||
|
pix.fill();
|
||||||
|
painter.drawText(0, 0, pix.width(), pix.height(),
|
||||||
|
Qt::AlignHCenter | Qt::AlignVCenter, QString::number(i+1));
|
||||||
|
m_groups[i]->setPixmap(pix);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}*/
|
||||||
|
|
||||||
|
/** No descriptions */
|
||||||
|
/*void KBConfig::loadConfiguredPixmaps(KConfig *config){
|
||||||
|
QString path;
|
||||||
|
QPixmap pix;
|
||||||
|
config->setGroup(ICONS_SECTION);
|
||||||
|
for (unsigned int i = 0; i < m_groups.count(); i++) {
|
||||||
|
path = config->readEntry(entryForGroup(i));
|
||||||
|
if (!path.isEmpty() && pix.load(path))
|
||||||
|
m_groups[i]->setPixmap(pix);
|
||||||
|
}
|
||||||
|
}*/
|
||||||
|
|
||||||
|
/** No descriptions */
|
||||||
|
/*void KBConfig::notifyChanged(){
|
||||||
|
emit changed();
|
||||||
|
}*/
|
||||||
|
|
||||||
|
|
||||||
|
/*!
|
||||||
|
\fn KBConfig::getXkbLayouts(const QStringList &layouts)
|
||||||
|
*/
|
||||||
|
void KBConfig::getXkbLayouts(QStringList &layouts)
|
||||||
|
{
|
||||||
|
#if HAVE_X11_EXTENSIONS_XKBRULES_H && HAVE_LIBXKBFILE
|
||||||
|
XkbRF_VarDefsRec vardefs;
|
||||||
|
int i;
|
||||||
|
|
||||||
|
usleep(10000);
|
||||||
|
if (XkbRF_GetNamesProp(qt_xdisplay(), NULL, &vardefs)) {
|
||||||
|
layouts = QStringList::split(',', vardefs.layout, true);
|
||||||
|
for (QStringList::Iterator it = layouts.begin(); it != layouts.end(); ++it) {
|
||||||
|
i = 0;
|
||||||
|
while ((*it)[i] >= 'a' && (*it)[i] <= 'z') i++;
|
||||||
|
*it = (*it).left(i);
|
||||||
|
}
|
||||||
|
if (vardefs.layout) XFree(vardefs.layout);
|
||||||
|
if (vardefs.model) XFree(vardefs.model);
|
||||||
|
if (vardefs.variant) XFree(vardefs.variant);
|
||||||
|
if (vardefs.options) XFree(vardefs.options);
|
||||||
|
}
|
||||||
|
#endif
|
||||||
|
}
|
@ -0,0 +1,110 @@
|
|||||||
|
/***************************************************************************
|
||||||
|
kbconfig.h - description
|
||||||
|
-------------------
|
||||||
|
begin : Sun Jul 8 2001
|
||||||
|
copyright : (C) 2001 by Leonid Zeitlin
|
||||||
|
email : lz@europe.com
|
||||||
|
***************************************************************************/
|
||||||
|
|
||||||
|
/***************************************************************************
|
||||||
|
* *
|
||||||
|
* 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. *
|
||||||
|
* *
|
||||||
|
***************************************************************************/
|
||||||
|
|
||||||
|
#ifndef KBCONFIG_H
|
||||||
|
#define KBCONFIG_H
|
||||||
|
|
||||||
|
#include "kbgroup.h"
|
||||||
|
|
||||||
|
#include <qptrvector.h>
|
||||||
|
#include <qvaluevector.h>
|
||||||
|
#include <kconfig.h>
|
||||||
|
|
||||||
|
#define ICONS_SECTION "Icons"
|
||||||
|
#define OPTIONS_SECTION "Options"
|
||||||
|
|
||||||
|
#define FLAG_ICON_WIDTH 21
|
||||||
|
#define FLAG_ICON_HEIGHT 14
|
||||||
|
|
||||||
|
class KGlobalAccel;
|
||||||
|
|
||||||
|
typedef QPtrVector<KBGroup> KBGroupVector;
|
||||||
|
|
||||||
|
/**The class that stores configuration information of KBSwitch
|
||||||
|
*@author Leonid Zeitlin
|
||||||
|
*/
|
||||||
|
|
||||||
|
class KBConfig {
|
||||||
|
public:
|
||||||
|
enum IconStyle { ICON_FLAG, ICON_CODE, ICON_CODE_AND_FLAG };
|
||||||
|
enum GroupScope { SCOPE_GLOBAL, SCOPE_CLASS, SCOPE_WINDOW };
|
||||||
|
private:
|
||||||
|
KBGroupVector m_groups;
|
||||||
|
bool m_toggle_mode;
|
||||||
|
int m_default_groupno;
|
||||||
|
//bool m_perwindow_group;
|
||||||
|
GroupScope m_group_scope;
|
||||||
|
bool m_autostart;
|
||||||
|
bool m_use_shortcuts;
|
||||||
|
IconStyle m_icon_style;
|
||||||
|
KGlobalAccel *m_keys;
|
||||||
|
public:
|
||||||
|
KBConfig();
|
||||||
|
~KBConfig();
|
||||||
|
int groupCount() { return m_groups.count(); };
|
||||||
|
KBGroup *getGroup(int groupno) { return m_groups[groupno]; };
|
||||||
|
bool toggle_mode() {return m_toggle_mode; };
|
||||||
|
/** No descriptions */
|
||||||
|
void set_toggle_mode(bool value) {m_toggle_mode = value; };
|
||||||
|
int default_groupno() { return m_default_groupno; };
|
||||||
|
void set_default_groupno(int value) { m_default_groupno = value; };
|
||||||
|
/*bool perwindow_group() { return m_perwindow_group; };
|
||||||
|
void set_perwindow_group(int value) { m_perwindow_group = value; };*/
|
||||||
|
GroupScope group_scope() { return m_group_scope; }
|
||||||
|
void set_group_scope(GroupScope value) { m_group_scope = value; }
|
||||||
|
bool autostart() { return m_autostart; }
|
||||||
|
void set_autostart(bool value) { m_autostart = value; }
|
||||||
|
IconStyle icon_style() { return m_icon_style; }
|
||||||
|
void set_icon_style(IconStyle value) { m_icon_style = value; }
|
||||||
|
bool use_shortcuts() { return m_use_shortcuts; }
|
||||||
|
void set_use_shortcuts(bool value) { m_use_shortcuts = value; }
|
||||||
|
KGlobalAccel *keys() { return m_keys; }
|
||||||
|
/** Load the KBSwitch configration from the application KConfig object */
|
||||||
|
void load(KConfig *config);
|
||||||
|
/** Save the KBSwitch configration to the application KConfig object */
|
||||||
|
void save(KConfig *config);
|
||||||
|
/** No descriptions */
|
||||||
|
/*void notifyChanged();*/
|
||||||
|
/*static QString entryForGroup(int i) {
|
||||||
|
return QString("Group%1").arg(i+1);
|
||||||
|
}*/
|
||||||
|
void drawIcons(IconStyle icon_style, QValueVector<QPixmap> *icons,
|
||||||
|
QStringList *iconpaths);
|
||||||
|
void checkKeysEnabled();
|
||||||
|
int getNextGroup(int groupno) {
|
||||||
|
return groupno >= groupCount() - 1 ? 0 : groupno + 1;
|
||||||
|
}
|
||||||
|
private: // Private methods
|
||||||
|
/** No descriptions */
|
||||||
|
//void guessGroupPixmaps();
|
||||||
|
/** No descriptions */
|
||||||
|
//void drawDefaultPixmaps();
|
||||||
|
/** No descriptions */
|
||||||
|
//void loadConfiguredPixmaps(KConfig *config);
|
||||||
|
void drawFlagPixmap(QPixmap &pix, QString &path, const QString &code,
|
||||||
|
int group, KConfig *config);
|
||||||
|
void drawCodePixmap(QPixmap &pix, const QString &code);
|
||||||
|
void drawCodeAndFlagPixmap(QPixmap &pix, QString &path,
|
||||||
|
const QString &countryCode, const QString &langCode, int group,
|
||||||
|
KConfig *config);
|
||||||
|
void drawDefaultPixmap(QPixmap &pix, int group);
|
||||||
|
bool getGroupImage(QImage &img, QString &path, const QString &code, int group,
|
||||||
|
KConfig *config);
|
||||||
|
void getXkbLayouts(QStringList &layouts);
|
||||||
|
};
|
||||||
|
|
||||||
|
#endif
|
@ -0,0 +1,408 @@
|
|||||||
|
/***************************************************************************
|
||||||
|
kbconfigdlg.cpp - description
|
||||||
|
-------------------
|
||||||
|
begin : Sun Jul 8 2001
|
||||||
|
copyright : (C) 2001 by Leonid Zeitlin
|
||||||
|
email : lz@europe.com
|
||||||
|
***************************************************************************/
|
||||||
|
|
||||||
|
/***************************************************************************
|
||||||
|
* *
|
||||||
|
* 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. *
|
||||||
|
* *
|
||||||
|
***************************************************************************/
|
||||||
|
|
||||||
|
#include "kbconfigdlg.h"
|
||||||
|
#include "kbpickicondlg.h"
|
||||||
|
#include "boldlistboxitem.h"
|
||||||
|
|
||||||
|
#include <qlayout.h>
|
||||||
|
#include <qlabel.h>
|
||||||
|
#include <qcheckbox.h>
|
||||||
|
#include <qwhatsthis.h>
|
||||||
|
#include <qvbox.h>
|
||||||
|
#include <qstyle.h>
|
||||||
|
#include <qgroupbox.h>
|
||||||
|
#include <qheader.h>
|
||||||
|
#include <qobjectlist.h>
|
||||||
|
#include <qpushbutton.h>
|
||||||
|
#include <qcombobox.h>
|
||||||
|
|
||||||
|
#include <kdeversion.h>
|
||||||
|
#include <klistbox.h>
|
||||||
|
#include <klocale.h>
|
||||||
|
#include <kdebug.h>
|
||||||
|
#if KDE_VERSION_MAJOR >= 3
|
||||||
|
#include <kapplication.h>
|
||||||
|
#else
|
||||||
|
#include <kapp.h>
|
||||||
|
#endif
|
||||||
|
#include <klistview.h>
|
||||||
|
#include <kkeydialog.h>
|
||||||
|
#include <kconfig.h>
|
||||||
|
|
||||||
|
/* This little subclass of KKeyChooser reimplements sizeHint() to
|
||||||
|
look a little smaller in our config dialog. The default size
|
||||||
|
is way too large IMHO and makes General page look oversized
|
||||||
|
*/
|
||||||
|
class SmallerKeyChooser : public KKeyChooser {
|
||||||
|
private:
|
||||||
|
QSize m_size_hint;
|
||||||
|
void calcSizeHint();
|
||||||
|
public:
|
||||||
|
SmallerKeyChooser(KGlobalAccel *accel, QWidget *parent) :
|
||||||
|
KKeyChooser(accel, parent) { calcSizeHint(); }
|
||||||
|
virtual QSize sizeHint() const { return m_size_hint; }
|
||||||
|
};
|
||||||
|
|
||||||
|
void SmallerKeyChooser::calcSizeHint()
|
||||||
|
{
|
||||||
|
m_size_hint = KKeyChooser::sizeHint();
|
||||||
|
|
||||||
|
KListView *lv = NULL;
|
||||||
|
QGroupBox *gb = NULL;
|
||||||
|
const QObjectList *objects = children();
|
||||||
|
QObjectListIt iter(*objects);
|
||||||
|
QObject *obj;
|
||||||
|
|
||||||
|
while ( (obj = iter.current()) ) {
|
||||||
|
++iter;
|
||||||
|
if (obj->inherits("KListView"))
|
||||||
|
lv = dynamic_cast<KListView*>(obj);
|
||||||
|
else if (obj->inherits("QGroupBox"))
|
||||||
|
gb = dynamic_cast<QGroupBox*>(obj);
|
||||||
|
}
|
||||||
|
if (!lv || !gb) return; // oops, should not happen
|
||||||
|
|
||||||
|
QListViewItem *item = lv->firstChild();
|
||||||
|
if (!item) return;
|
||||||
|
|
||||||
|
int height = item->height() * (1 + item->childCount()) + lv->header()->height() +
|
||||||
|
style().pixelMetric(QStyle::PM_ScrollBarExtent) + gb->sizeHint().height() +
|
||||||
|
layout()->spacing() * 2;
|
||||||
|
int width = lv->columnWidth(0) + lv->columnWidth(1);
|
||||||
|
m_size_hint = QSize(width, height);
|
||||||
|
}
|
||||||
|
|
||||||
|
static inline bool iconTypeShowsFlag(KBConfig::IconStyle icon_style)
|
||||||
|
{
|
||||||
|
return icon_style == KBConfig::ICON_FLAG || icon_style == KBConfig::ICON_CODE_AND_FLAG;
|
||||||
|
}
|
||||||
|
|
||||||
|
KBConfigDlg::KBConfigDlg(KBConfig *kbconf, QWidget *parent, const char *name )
|
||||||
|
: KDialogBase(Tabbed, i18n("Configure")/*caption*/, Ok | Apply | Cancel | Help,
|
||||||
|
Ok, parent, name, true /*modal*/)
|
||||||
|
{
|
||||||
|
m_kbconf = kbconf;
|
||||||
|
m_default_groupno = m_kbconf->default_groupno();
|
||||||
|
|
||||||
|
setHelp(QString("configure-kkbswitch"));
|
||||||
|
setButtonBoxOrientation(Horizontal);
|
||||||
|
setupGeneralPage();
|
||||||
|
setupShortcutsPage();
|
||||||
|
|
||||||
|
showConfig();
|
||||||
|
slotIconTypeSelected(m_kbconf->icon_style());
|
||||||
|
}
|
||||||
|
|
||||||
|
KBConfigDlg::~KBConfigDlg(){
|
||||||
|
}
|
||||||
|
|
||||||
|
void KBConfigDlg::setupGeneralPage()
|
||||||
|
{
|
||||||
|
QFrame *page = addPage(i18n("&General")); //makeMainWidget();
|
||||||
|
QVBoxLayout *vlayout = new QVBoxLayout(page);
|
||||||
|
vlayout->setSpacing(2);
|
||||||
|
|
||||||
|
QLabel *lbl = new QLabel(i18n("Available &keyboard layouts:"), page);
|
||||||
|
vlayout->addWidget(lbl);
|
||||||
|
|
||||||
|
QHBoxLayout *groupsLayout = new QHBoxLayout(vlayout);
|
||||||
|
groupsLayout->setSpacing(2);
|
||||||
|
|
||||||
|
lbGroups = new KListBox(page);
|
||||||
|
QObject::connect(lbGroups, SIGNAL(selectionChanged()), this, SLOT(slotLayoutSelected()));
|
||||||
|
QObject::connect(lbGroups, SIGNAL(doubleClicked(QListBoxItem *)), this,
|
||||||
|
SLOT(slotListBoxExecuted(QListBoxItem *)));
|
||||||
|
groupsLayout->addWidget(lbGroups);
|
||||||
|
lbl->setBuddy(lbGroups);
|
||||||
|
QWhatsThis::add(lbGroups, i18n("This list box shows keyboard layouts available in your system.\n"
|
||||||
|
"Select a layout and click \"Change Icon...\" button to change the icon for a layout.\n"
|
||||||
|
"If you have configured a non-default icon, you can reset the icon to default with \"Use Default Icon\" button.\n"
|
||||||
|
"The layout shown is bold is the default layout. Use \"Set as default\" button "
|
||||||
|
"to set the default layout."));
|
||||||
|
|
||||||
|
QVBoxLayout *btnLayout = new QVBoxLayout(groupsLayout);
|
||||||
|
btnLayout->setSpacing(2);
|
||||||
|
|
||||||
|
btnChangeIcon = new QPushButton(i18n("Cha&nge Icon..."), page);
|
||||||
|
QObject::connect(btnChangeIcon, SIGNAL(clicked()), this, SLOT(slotPickIcon()));
|
||||||
|
btnLayout->addWidget(btnChangeIcon, 0, Qt::AlignTop);
|
||||||
|
QWhatsThis::add(btnChangeIcon, i18n("Click this button to change the icon for the "
|
||||||
|
"layout selected in the list box to the left."));
|
||||||
|
|
||||||
|
btnSetDefaultIcon = new QPushButton(i18n("Use &Default Icon"), page);
|
||||||
|
QObject::connect(btnSetDefaultIcon, SIGNAL(clicked()), this, SLOT(slotSetDefaultIcon()));
|
||||||
|
btnLayout->addWidget(btnSetDefaultIcon, 0, Qt::AlignTop);
|
||||||
|
QWhatsThis::add(btnSetDefaultIcon, i18n("Click this button to use default icon for the "
|
||||||
|
"layout selected in the list box to the left."));
|
||||||
|
|
||||||
|
btnSetDefaultGroup = new QPushButton(i18n("&Set as Default"), page);
|
||||||
|
QObject::connect(btnSetDefaultGroup, SIGNAL(clicked()), this, SLOT(slotSetDefaultGroup()));
|
||||||
|
btnLayout->addWidget(btnSetDefaultGroup, 0, Qt::AlignTop);
|
||||||
|
QWhatsThis::add(btnSetDefaultGroup, i18n("Cick this button to set the layout selected "
|
||||||
|
"in the list box to the left as the default"));
|
||||||
|
|
||||||
|
btnLayout->addItem(new QSpacerItem(1, 1, QSizePolicy::Minimum,
|
||||||
|
QSizePolicy::MinimumExpanding));
|
||||||
|
|
||||||
|
lbl = new QLabel(i18n("Layout &icon style:"), page);
|
||||||
|
vlayout->addWidget(lbl);
|
||||||
|
|
||||||
|
cbxIconType = new QComboBox(page);
|
||||||
|
cbxIconType->setEditable(false);
|
||||||
|
cbxIconType->insertItem(i18n("Country flag"));
|
||||||
|
cbxIconType->insertItem(i18n("Language code"));
|
||||||
|
cbxIconType->insertItem(i18n("Flag and code"));
|
||||||
|
QObject::connect(cbxIconType, SIGNAL(activated(int)), this, SLOT(slotIconTypeSelected(int)));
|
||||||
|
vlayout->addWidget(cbxIconType);
|
||||||
|
lbl->setBuddy(cbxIconType);
|
||||||
|
QWhatsThis::add(cbxIconType, i18n("<p>Select the style of icons representing the "
|
||||||
|
"current keyboard layout.\n"
|
||||||
|
"You can choose from the following styles:"
|
||||||
|
"<ul><li><b>Country flag</b> - displays the corresponding contry flag"
|
||||||
|
"<li><b>Language code</b> - displays the language ISO 2-letter code"
|
||||||
|
"<li><b>Flag and code</b> - displays the language code superimposed over the country flag."
|
||||||
|
"</ul></p>"));
|
||||||
|
|
||||||
|
lbl = new QLabel(i18n("&Layout applies to:"), page);
|
||||||
|
vlayout->addWidget(lbl);
|
||||||
|
|
||||||
|
cbxGroupScope = new QComboBox(page);
|
||||||
|
cbxGroupScope->setEditable(false);
|
||||||
|
cbxGroupScope->insertItem(i18n("All windows"));
|
||||||
|
cbxGroupScope->insertItem(i18n("Windows of one application"));
|
||||||
|
cbxGroupScope->insertItem(i18n("One window"));
|
||||||
|
vlayout->addWidget(cbxGroupScope);
|
||||||
|
lbl->setBuddy(cbxGroupScope);
|
||||||
|
QWhatsThis::add(cbxGroupScope, i18n("<p>Select what windows the currently selected "
|
||||||
|
"keyboard layout applies to:\n"
|
||||||
|
"<ul><li><b>All windows</b> - one layout applies to all windows on your desktop\n"
|
||||||
|
"<li><b>Windows of one application</b> - layout applies to one application; each "
|
||||||
|
"application can have its own layout. When you switch between applications, layout follows the active application\n"
|
||||||
|
"<li><b>One window</b> - layout applies to one window only; each window can have its own layout. "
|
||||||
|
"When you switch between windows, layout follows the active window.</ul></p>"));
|
||||||
|
|
||||||
|
chkToggleMode = new QCheckBox(i18n("Use \"&Toggle Mode\""), page);
|
||||||
|
vlayout->addWidget(chkToggleMode);
|
||||||
|
QWhatsThis::add(chkToggleMode, i18n("Toggle mode is useful when you have more than two keyboard "
|
||||||
|
"layouts defined. When toggle mode is on your normal layout switch key toggles between two most frequently used layouts. "
|
||||||
|
"To activate other layouts use KKBSwitch's tray popup menu"));
|
||||||
|
|
||||||
|
/*chkPerwindowGroup = new QCheckBox(i18n("Use &per-window layout"), page);
|
||||||
|
vlayout->addWidget(chkPerwindowGroup);
|
||||||
|
QWhatsThis::add(chkPerwindowGroup, i18n("When this checkbox is checked, "
|
||||||
|
"each window has its own current keyboard layout. When it's unchecked, "
|
||||||
|
"the current layout affects all windows"));*/
|
||||||
|
|
||||||
|
chkAutostart = new QCheckBox(i18n("A&utostart"), page);
|
||||||
|
vlayout->addWidget(chkAutostart);
|
||||||
|
QWhatsThis::add(chkAutostart, i18n("When this checkbox is checked, KKBSwitch "
|
||||||
|
"will start automatically when you log in"));
|
||||||
|
}
|
||||||
|
|
||||||
|
void KBConfigDlg::setupShortcutsPage()
|
||||||
|
{
|
||||||
|
QVBox *box = addVBoxPage(i18n("Sho&rtcuts"));
|
||||||
|
chkUseShortcuts = new QCheckBox(i18n("Use shortcuts to &activate keyboard layouts"), box);
|
||||||
|
connect(chkUseShortcuts, SIGNAL(toggled(bool)), this, SLOT(slotUseShortcutsToggled(bool)));
|
||||||
|
QWhatsThis::add(chkUseShortcuts, i18n("Check this checkbox to be able to quickly "
|
||||||
|
"activate any keyboard layout with keyboard shorcuts. Once this checkbox "
|
||||||
|
"is checked, you can adjust the shortcuts at the key chooser pane below. "
|
||||||
|
"Especially useful if you have three or four keyboard layouts configured"));
|
||||||
|
|
||||||
|
keyChooser = new SmallerKeyChooser(m_kbconf->keys(), box);
|
||||||
|
}
|
||||||
|
|
||||||
|
/** Display the current KBSwitch configuration in the dialog */
|
||||||
|
void KBConfigDlg::showConfig(){
|
||||||
|
int i;
|
||||||
|
KBGroup *group;
|
||||||
|
KConfig *conf = kapp->config();
|
||||||
|
|
||||||
|
m_iconpaths.clear();
|
||||||
|
conf->setGroup(ICONS_SECTION);
|
||||||
|
for (i = 0; i < m_kbconf->groupCount(); i++) {
|
||||||
|
group = m_kbconf->getGroup(i);
|
||||||
|
(void) new BoldListBoxItem(lbGroups, group->getPixmap(), group->getName(),
|
||||||
|
i == m_default_groupno);
|
||||||
|
//m_iconpaths.append(conf->readEntry(KBConfig::entryForGroup(i)));
|
||||||
|
m_iconpaths.append(group->getIconPath());
|
||||||
|
}
|
||||||
|
if (m_kbconf->groupCount() > 0) lbGroups->setCurrentItem(0);
|
||||||
|
lbGroups->setMinimumHeight(lbGroups->itemHeight() * (m_kbconf->groupCount() + 1));
|
||||||
|
cbxIconType->setCurrentItem(m_kbconf->icon_style());
|
||||||
|
cbxGroupScope->setCurrentItem(m_kbconf->group_scope());
|
||||||
|
chkToggleMode->setChecked(m_kbconf->toggle_mode());
|
||||||
|
//chkPerwindowGroup->setChecked(m_kbconf->perwindow_group());
|
||||||
|
chkAutostart->setChecked(m_kbconf->autostart());
|
||||||
|
chkUseShortcuts->setChecked(m_kbconf->use_shortcuts());
|
||||||
|
slotUseShortcutsToggled(m_kbconf->use_shortcuts());
|
||||||
|
}
|
||||||
|
|
||||||
|
/** Fire up "Pick Icon" dialog */
|
||||||
|
void KBConfigDlg::slotPickIcon(){
|
||||||
|
int index = lbGroups->currentItem();
|
||||||
|
QApplication::setOverrideCursor(QCursor(Qt::WaitCursor));
|
||||||
|
KBPickIconDlg dlg(m_iconpaths[index], *(lbGroups->pixmap(index)), this);
|
||||||
|
QApplication::restoreOverrideCursor();
|
||||||
|
if (dlg.exec()) {
|
||||||
|
QString path = dlg.getIconPath();
|
||||||
|
KBGroup *group = m_kbconf->getGroup(index);
|
||||||
|
if (!path.isEmpty() && path != group->getIconPath()) {
|
||||||
|
kapp->config()->writeEntry(group->getName()/*KBConfig::entryForGroup(index)*/, path);
|
||||||
|
redrawIcons(KBConfig::IconStyle(cbxIconType->currentItem()));
|
||||||
|
checkIconDefault(index);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
void KBConfigDlg::slotSetDefaultGroup()
|
||||||
|
{
|
||||||
|
int new_default_group = lbGroups->currentItem();
|
||||||
|
if (m_default_groupno != new_default_group) {
|
||||||
|
BoldListBoxItem *item = dynamic_cast<BoldListBoxItem*>(lbGroups->item(m_default_groupno));
|
||||||
|
item->setBold(false);
|
||||||
|
m_default_groupno = new_default_group;
|
||||||
|
// NB: don't use selectedItem(); it's not present in Qt 3.0, and
|
||||||
|
// we want to maintain compatibility with it
|
||||||
|
int curitem = lbGroups->currentItem();
|
||||||
|
if (curitem > -1) { // should not be -1, but just in case
|
||||||
|
item = dynamic_cast<BoldListBoxItem*>(lbGroups->item(curitem));
|
||||||
|
item->setBold(true);
|
||||||
|
lbGroups->triggerUpdate(false);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
/** No descriptions */
|
||||||
|
void KBConfigDlg::slotLayoutSelected(){
|
||||||
|
btnChangeIcon->setEnabled(lbGroups->currentItem() != -1 &&
|
||||||
|
iconTypeShowsFlag(KBConfig::IconStyle(cbxIconType->currentItem())));
|
||||||
|
checkIconDefault(lbGroups->currentItem());
|
||||||
|
btnSetDefaultGroup->setEnabled(lbGroups->currentItem() != -1 &&
|
||||||
|
lbGroups->currentItem() != m_default_groupno);
|
||||||
|
}
|
||||||
|
|
||||||
|
/** No descriptions */
|
||||||
|
void KBConfigDlg::slotListBoxExecuted(QListBoxItem *){
|
||||||
|
if (iconTypeShowsFlag(KBConfig::IconStyle(cbxIconType->currentItem())))
|
||||||
|
slotPickIcon();
|
||||||
|
}
|
||||||
|
|
||||||
|
/** No descriptions */
|
||||||
|
void KBConfigDlg::saveConfig(){
|
||||||
|
QString path;
|
||||||
|
const QPixmap *pix;
|
||||||
|
KConfig *conf = kapp->config();
|
||||||
|
conf->setGroup(ICONS_SECTION);
|
||||||
|
for (int i = 0; i < m_kbconf->groupCount(); i++) {
|
||||||
|
path = m_iconpaths[i];
|
||||||
|
if (!path.isEmpty()) m_kbconf->getGroup(i)->setIconPath(path);
|
||||||
|
//if (!path.isEmpty() && path != m_kbconf->getGroup(i)->getIconPath())
|
||||||
|
// conf->writeEntry(KBConfig::entryForGroup(i), path);
|
||||||
|
pix = lbGroups->pixmap(i);
|
||||||
|
if (pix) m_kbconf->getGroup(i)->setPixmap(*pix);
|
||||||
|
}
|
||||||
|
m_kbconf->set_toggle_mode(chkToggleMode->isChecked());
|
||||||
|
m_kbconf->set_group_scope(KBConfig::GroupScope(cbxGroupScope->currentItem()));
|
||||||
|
m_kbconf->set_default_groupno(m_default_groupno);
|
||||||
|
//m_kbconf->set_perwindow_group(chkPerwindowGroup->isChecked());
|
||||||
|
m_kbconf->set_icon_style(KBConfig::IconStyle(cbxIconType->currentItem()));
|
||||||
|
m_kbconf->set_autostart(chkAutostart->isChecked());
|
||||||
|
m_kbconf->set_use_shortcuts(chkUseShortcuts->isChecked());
|
||||||
|
keyChooser->commitChanges();
|
||||||
|
m_kbconf->checkKeysEnabled();
|
||||||
|
m_kbconf->save(conf);
|
||||||
|
|
||||||
|
//m_kbconf->notifyChanged();
|
||||||
|
conf->sync();
|
||||||
|
}
|
||||||
|
|
||||||
|
/** No descriptions */
|
||||||
|
void KBConfigDlg::slotOk(){
|
||||||
|
saveConfig();
|
||||||
|
KDialogBase::slotOk();
|
||||||
|
}
|
||||||
|
|
||||||
|
/** No descriptions */
|
||||||
|
void KBConfigDlg::slotApply(){
|
||||||
|
saveConfig();
|
||||||
|
KDialogBase::slotApply();
|
||||||
|
}
|
||||||
|
|
||||||
|
void KBConfigDlg::slotIconTypeSelected(int index)
|
||||||
|
{
|
||||||
|
KBConfig::IconStyle icon_style = KBConfig::IconStyle(index);
|
||||||
|
redrawIcons(icon_style);
|
||||||
|
slotLayoutSelected();
|
||||||
|
}
|
||||||
|
|
||||||
|
void KBConfigDlg::redrawIcons(KBConfig::IconStyle icon_style)
|
||||||
|
{
|
||||||
|
QValueVector<QPixmap> pixlist;
|
||||||
|
m_kbconf->drawIcons(icon_style, &pixlist, &m_iconpaths);
|
||||||
|
int curIndex = lbGroups->currentItem();
|
||||||
|
// NB: don't use count(), use size(); count() is not present in Qt 3.0, and
|
||||||
|
// we want to maintain compatibility with it
|
||||||
|
for (unsigned int i = 0; i < pixlist.size(); i++) {
|
||||||
|
BoldListBoxItem *curItem = dynamic_cast<BoldListBoxItem*>(lbGroups->item(i));
|
||||||
|
lbGroups->changeItem(new BoldListBoxItem(NULL, pixlist[i],
|
||||||
|
curItem->text(), curItem->bold()), i);
|
||||||
|
}
|
||||||
|
lbGroups->setCurrentItem(curIndex);
|
||||||
|
}
|
||||||
|
|
||||||
|
void KBConfigDlg::slotCancel()
|
||||||
|
{
|
||||||
|
KConfig *config = kapp->config();
|
||||||
|
config->rollback();
|
||||||
|
config->reparseConfiguration();
|
||||||
|
KDialogBase::slotCancel();
|
||||||
|
}
|
||||||
|
|
||||||
|
void KBConfigDlg::slotUseShortcutsToggled(bool on)
|
||||||
|
{
|
||||||
|
keyChooser->setEnabled(on);
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
/*!
|
||||||
|
\fn KBConfigDlg::slotSetDefaultIcon()
|
||||||
|
*/
|
||||||
|
void KBConfigDlg::slotSetDefaultIcon()
|
||||||
|
{
|
||||||
|
int index = lbGroups->currentItem();
|
||||||
|
kapp->config()->setGroup(ICONS_SECTION);
|
||||||
|
kapp->config()->deleteEntry(m_kbconf->getGroup(index)->getName()/*KBConfig::entryForGroup(index)*/);
|
||||||
|
redrawIcons(KBConfig::IconStyle(cbxIconType->currentItem()));
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
/*!
|
||||||
|
\fn KBConfigDlg::checkIconDefault()
|
||||||
|
*/
|
||||||
|
void KBConfigDlg::checkIconDefault(int index)
|
||||||
|
{
|
||||||
|
KConfig *conf = kapp->config();
|
||||||
|
if (index == -1 || ! iconTypeShowsFlag(KBConfig::IconStyle(cbxIconType->currentItem()))) {
|
||||||
|
btnSetDefaultIcon->setEnabled(false);
|
||||||
|
}
|
||||||
|
else {
|
||||||
|
conf->setGroup(ICONS_SECTION);
|
||||||
|
btnSetDefaultIcon->setEnabled(!conf->readEntry(m_kbconf->getGroup(index)->getName()/*KBConfig::entryForGroup(index)*/).isNull());
|
||||||
|
}
|
||||||
|
}
|
@ -0,0 +1,84 @@
|
|||||||
|
/***************************************************************************
|
||||||
|
kbconfigdlg.h - description
|
||||||
|
-------------------
|
||||||
|
begin : Sun Jul 8 2001
|
||||||
|
copyright : (C) 2001 by Leonid Zeitlin
|
||||||
|
email : lz@europe.com
|
||||||
|
***************************************************************************/
|
||||||
|
|
||||||
|
/***************************************************************************
|
||||||
|
* *
|
||||||
|
* 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. *
|
||||||
|
* *
|
||||||
|
***************************************************************************/
|
||||||
|
|
||||||
|
#ifndef KBCONFIGDLG_H
|
||||||
|
#define KBCONFIGDLG_H
|
||||||
|
|
||||||
|
#include <kdialogbase.h>
|
||||||
|
#include "kbconfig.h"
|
||||||
|
|
||||||
|
class QWidget;
|
||||||
|
class QCheckBox;
|
||||||
|
class QPushButton;
|
||||||
|
class QComboBox;
|
||||||
|
class QStringList;
|
||||||
|
class KKeyChooser;
|
||||||
|
|
||||||
|
|
||||||
|
/**Configuration dialog for KKBSwitch
|
||||||
|
*@author Leonid Zeitlin
|
||||||
|
*/
|
||||||
|
|
||||||
|
class KBConfigDlg : public KDialogBase {
|
||||||
|
Q_OBJECT
|
||||||
|
public:
|
||||||
|
KBConfigDlg(KBConfig *kbconf, QWidget *parent=0, const char *name=0);
|
||||||
|
~KBConfigDlg();
|
||||||
|
private: // Private attributes
|
||||||
|
/** */
|
||||||
|
KListBox *lbGroups;
|
||||||
|
/** */
|
||||||
|
QCheckBox *chkToggleMode;
|
||||||
|
//QCheckBox *chkPerwindowGroup;
|
||||||
|
QCheckBox *chkAutostart;
|
||||||
|
QPushButton *btnChangeIcon;
|
||||||
|
QPushButton *btnSetDefaultIcon;
|
||||||
|
QPushButton *btnSetDefaultGroup;
|
||||||
|
QComboBox *cbxIconType;
|
||||||
|
QComboBox *cbxGroupScope;
|
||||||
|
KKeyChooser *keyChooser;
|
||||||
|
QCheckBox *chkUseShortcuts;
|
||||||
|
QStringList m_iconpaths;
|
||||||
|
int m_default_groupno;
|
||||||
|
KBConfig *m_kbconf;
|
||||||
|
/** Display the current KBSwitch configuration in the dialog */
|
||||||
|
void showConfig();
|
||||||
|
void saveConfig();
|
||||||
|
void redrawIcons(KBConfig::IconStyle icon_style);
|
||||||
|
void setupGeneralPage();
|
||||||
|
void setupShortcutsPage();
|
||||||
|
void checkIconDefault(int index);
|
||||||
|
private slots: // Private slots
|
||||||
|
/** Fire up "Pick Icon" dialog */
|
||||||
|
void slotPickIcon();
|
||||||
|
void slotSetDefaultGroup();
|
||||||
|
/** No descriptions */
|
||||||
|
void slotLayoutSelected();
|
||||||
|
/** No descriptions */
|
||||||
|
void slotListBoxExecuted(QListBoxItem *item);
|
||||||
|
void slotIconTypeSelected(int index);
|
||||||
|
void slotUseShortcutsToggled(bool on);
|
||||||
|
void slotSetDefaultIcon();
|
||||||
|
protected: // Protected methods
|
||||||
|
/** No descriptions */
|
||||||
|
virtual void slotApply();
|
||||||
|
/** No descriptions */
|
||||||
|
virtual void slotOk();
|
||||||
|
virtual void slotCancel();
|
||||||
|
};
|
||||||
|
|
||||||
|
#endif
|
@ -0,0 +1,26 @@
|
|||||||
|
/***************************************************************************
|
||||||
|
kbgroup.cpp - description
|
||||||
|
-------------------
|
||||||
|
begin : Wed Jul 4 2001
|
||||||
|
copyright : (C) 2001 by Leonid Zeitlin
|
||||||
|
email : lz@europe.com
|
||||||
|
***************************************************************************/
|
||||||
|
|
||||||
|
/***************************************************************************
|
||||||
|
* *
|
||||||
|
* 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. *
|
||||||
|
* *
|
||||||
|
***************************************************************************/
|
||||||
|
|
||||||
|
#include "kbgroup.h"
|
||||||
|
#include <kdebug.h>
|
||||||
|
|
||||||
|
KBGroup::KBGroup(const QString& name){
|
||||||
|
m_name = name;
|
||||||
|
}
|
||||||
|
|
||||||
|
KBGroup::~KBGroup(){
|
||||||
|
}
|
@ -0,0 +1,48 @@
|
|||||||
|
/***************************************************************************
|
||||||
|
kbgroup.h - description
|
||||||
|
-------------------
|
||||||
|
begin : Wed Jul 4 2001
|
||||||
|
copyright : (C) 2001 by Leonid Zeitlin
|
||||||
|
email : lz@europe.com
|
||||||
|
***************************************************************************/
|
||||||
|
|
||||||
|
/***************************************************************************
|
||||||
|
* *
|
||||||
|
* 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. *
|
||||||
|
* *
|
||||||
|
***************************************************************************/
|
||||||
|
|
||||||
|
#ifndef KBGROUP_H
|
||||||
|
#define KBGROUP_H
|
||||||
|
|
||||||
|
#include <qpixmap.h>
|
||||||
|
#include <qstring.h>
|
||||||
|
|
||||||
|
/**A helper class the holds keyboard group's name and pixmap
|
||||||
|
*@author Leonid Zeitlin
|
||||||
|
*/
|
||||||
|
|
||||||
|
class KBGroup {
|
||||||
|
public:
|
||||||
|
KBGroup(const QString& name);
|
||||||
|
~KBGroup();
|
||||||
|
/** */
|
||||||
|
const QPixmap& getPixmap() { return m_pixmap; }
|
||||||
|
/** No descriptions */
|
||||||
|
const QString& getName() { return m_name; }
|
||||||
|
/** No descriptions */
|
||||||
|
void setPixmap(const QPixmap& pixmap) { m_pixmap = pixmap; }
|
||||||
|
const QString& getIconPath() { return m_iconpath; }
|
||||||
|
void setIconPath(const QString &iconpath) { m_iconpath = iconpath; }
|
||||||
|
private: // Private attributes
|
||||||
|
/** */
|
||||||
|
QString m_name;
|
||||||
|
/** */
|
||||||
|
QPixmap m_pixmap;
|
||||||
|
QString m_iconpath;
|
||||||
|
};
|
||||||
|
|
||||||
|
#endif
|
@ -0,0 +1,203 @@
|
|||||||
|
/***************************************************************************
|
||||||
|
kbpickicondlg.cpp - description
|
||||||
|
-------------------
|
||||||
|
begin : Sat Jul 21 2001
|
||||||
|
copyright : (C) 2001 by Leonid Zeitlin
|
||||||
|
email : lz@europe.com
|
||||||
|
***************************************************************************/
|
||||||
|
|
||||||
|
/***************************************************************************
|
||||||
|
* *
|
||||||
|
* 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. *
|
||||||
|
* *
|
||||||
|
***************************************************************************/
|
||||||
|
|
||||||
|
#include "kbpickicondlg.h"
|
||||||
|
|
||||||
|
#include <qvbox.h>
|
||||||
|
#include <qdir.h>
|
||||||
|
#include <qwhatsthis.h>
|
||||||
|
#include <qpushbutton.h>
|
||||||
|
#include <qimage.h>
|
||||||
|
|
||||||
|
#include <kdeversion.h>
|
||||||
|
#include <klocale.h>
|
||||||
|
#if KDE_VERSION_MAJOR >= 3
|
||||||
|
#include <kstandarddirs.h>
|
||||||
|
#else
|
||||||
|
#include <kstddirs.h>
|
||||||
|
#endif
|
||||||
|
#include <kglobal.h>
|
||||||
|
#include <kfiledialog.h>
|
||||||
|
#include <kmessagebox.h>
|
||||||
|
|
||||||
|
#include "kbconfig.h"
|
||||||
|
#include "pathlistboxitem.h"
|
||||||
|
|
||||||
|
KBPickIconDlg::KBPickIconDlg(const QString ¤tPath, const QPixmap ¤tPixmap,
|
||||||
|
QWidget *parent, const char *name )
|
||||||
|
: KDialogBase(parent, name, true /*modal*/, i18n("Pick an icon") /*caption*/, Ok | Cancel) {
|
||||||
|
QVBox *page = makeVBoxMainWidget();
|
||||||
|
|
||||||
|
lbIcons = new KListBox(page);
|
||||||
|
QObject::connect(lbIcons, SIGNAL(doubleClicked(QListBoxItem*)),
|
||||||
|
this, SLOT(slotOk()));
|
||||||
|
QObject::connect(lbIcons, SIGNAL(returnPressed(QListBoxItem*)),
|
||||||
|
this, SLOT(slotOk()));
|
||||||
|
QWhatsThis::add(lbIcons, i18n("Select one of the icons"));
|
||||||
|
|
||||||
|
QPushButton *btnBrowse = new QPushButton(i18n("&Browse..."), page);
|
||||||
|
QObject::connect(btnBrowse, SIGNAL(clicked()), this, SLOT(slotBrowseForIcon()));
|
||||||
|
QWhatsThis::add(btnBrowse, i18n("Browse for an image file to use as an icon"));
|
||||||
|
|
||||||
|
loadCountryFlags();
|
||||||
|
|
||||||
|
// I am told in Red Hat 9 standard KDE flag pixmaps are missing.
|
||||||
|
// Workaround: we have to simulate them by rescaling GKB's pixmaps
|
||||||
|
if (lbIcons->count() == 0) {
|
||||||
|
loadGkbCountryFlags();
|
||||||
|
}
|
||||||
|
lbIcons->sort();
|
||||||
|
showCurrentPath(currentPath, currentPixmap);
|
||||||
|
lbIcons->setFocus();
|
||||||
|
}
|
||||||
|
|
||||||
|
KBPickIconDlg::~KBPickIconDlg(){
|
||||||
|
}
|
||||||
|
|
||||||
|
/** Get the path name of the selected icon. Returns empty string if no icon selected */
|
||||||
|
QString KBPickIconDlg::getIconPath(){
|
||||||
|
QListBoxItem *item = lbIcons->selectedItem();
|
||||||
|
if (item)
|
||||||
|
return dynamic_cast<PathListBoxItem*>(item)->path;
|
||||||
|
else return QString::null; // should not happen
|
||||||
|
}
|
||||||
|
|
||||||
|
/** No descriptions */
|
||||||
|
const QPixmap* KBPickIconDlg::getIcon(){
|
||||||
|
if (lbIcons->currentItem() != -1)
|
||||||
|
return lbIcons->pixmap(lbIcons->currentItem());
|
||||||
|
else return NULL;
|
||||||
|
}
|
||||||
|
|
||||||
|
/** Browse for an arbitrary icon file */
|
||||||
|
void KBPickIconDlg::slotBrowseForIcon()
|
||||||
|
{
|
||||||
|
QString iconPath = KFileDialog::getOpenFileName(QString::null,
|
||||||
|
i18n("*.png *.jpg *.gif *.xpm|Icon files (*.png, *.jpg, *.gif, *.xpm)\n*.*|All files (*.*)"));
|
||||||
|
if (iconPath.isEmpty()) return;
|
||||||
|
QImage img;
|
||||||
|
if (img.load(iconPath)) {
|
||||||
|
double aspectRatio = img.width() / img.height();
|
||||||
|
QString message = QString::null;
|
||||||
|
bool too_big, too_wide, too_narrow;
|
||||||
|
too_narrow = aspectRatio < FLAG_ICON_WIDTH / FLAG_ICON_HEIGHT - 0.1;
|
||||||
|
too_wide = aspectRatio > FLAG_ICON_WIDTH / FLAG_ICON_HEIGHT + 0.1;
|
||||||
|
too_big = img.width() > FLAG_ICON_WIDTH * 2;
|
||||||
|
if (too_big || too_narrow || too_wide) {
|
||||||
|
message = i18n("The size of this image (%1 by %2) is not good.\n"
|
||||||
|
"Preferred size for the layout icons is %3 by %4.\n")
|
||||||
|
.arg(img.width()).arg(img.height()).arg(FLAG_ICON_WIDTH).arg(FLAG_ICON_HEIGHT);
|
||||||
|
if (too_big) {
|
||||||
|
QString msg_tail = "";
|
||||||
|
if (too_wide) msg_tail = i18n(" and also too wide");
|
||||||
|
else if (too_narrow) msg_tail += i18n(" and also too narrow");
|
||||||
|
message += i18n("This image is too big%1.").arg(msg_tail);
|
||||||
|
}
|
||||||
|
else if (too_wide) message += i18n("This image is too wide.");
|
||||||
|
else if (too_narrow) message += i18n("This image is too narrow.");
|
||||||
|
message += "\n";
|
||||||
|
message += i18n("KKBSwitch will scale it to appropriate size, but the result may not look very good.\n"
|
||||||
|
"Are you sure you want to use this image?");
|
||||||
|
if (KMessageBox::questionYesNo(this, message) != KMessageBox::Yes) return;
|
||||||
|
}
|
||||||
|
if (img.width() > FLAG_ICON_WIDTH + 3 || img.height() > FLAG_ICON_HEIGHT + 3)
|
||||||
|
img = img.smoothScale(FLAG_ICON_WIDTH, FLAG_ICON_HEIGHT);
|
||||||
|
QPixmap pix;
|
||||||
|
pix.convertFromImage(img);
|
||||||
|
PathListBoxItem *item = new PathListBoxItem(lbIcons, pix, QFileInfo(iconPath).fileName(),
|
||||||
|
iconPath);
|
||||||
|
lbIcons->setSelected(item, true);
|
||||||
|
lbIcons->centerCurrentItem();
|
||||||
|
}
|
||||||
|
else KMessageBox::error(this, i18n("Cannot read icon from file %1. "
|
||||||
|
"Either it is not an image file or it is corrupt.").arg(iconPath));
|
||||||
|
}
|
||||||
|
|
||||||
|
void KBPickIconDlg::loadCountryFlags()
|
||||||
|
{
|
||||||
|
QPixmap pix;
|
||||||
|
QDir dir;
|
||||||
|
QStringList locales;
|
||||||
|
QString path;
|
||||||
|
QStringList dirs = KGlobal::dirs()->findDirs("locale", "l10n");
|
||||||
|
|
||||||
|
for (QStringList::Iterator dirIter = dirs.begin(); dirIter != dirs.end(); dirIter++) {
|
||||||
|
dir.setPath(*dirIter);
|
||||||
|
locales = dir.entryList(QDir::Dirs, QDir::Name);
|
||||||
|
for (QStringList::Iterator iter = locales.begin(); iter != locales.end(); iter++) {
|
||||||
|
path = dir.path() + "/" + *iter + "/flag.png";
|
||||||
|
if (*iter != "." && *iter != ".." && pix.load(path)) {
|
||||||
|
KConfig config(dir.path() + "/" + *iter + "/entry.desktop", true, false,
|
||||||
|
"locale" /*doesn't really matter*/);
|
||||||
|
config.setGroup("KCM Locale");
|
||||||
|
new PathListBoxItem(lbIcons, pix, config.readEntry("Name"), path);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
void KBPickIconDlg::loadGkbCountryFlags()
|
||||||
|
{
|
||||||
|
QDir dir;
|
||||||
|
QString path, code, name;
|
||||||
|
QPixmap pix;
|
||||||
|
QImage img;
|
||||||
|
|
||||||
|
dir.setPath("/usr/share/pixmaps/gkb");
|
||||||
|
const QFileInfoList *icons = dir.entryInfoList(QDir::Files, QDir::Name);
|
||||||
|
if (icons) {
|
||||||
|
QFileInfoListIterator iter(*icons);
|
||||||
|
QFileInfo *info;
|
||||||
|
for (; (info = iter.current()); ++iter) {
|
||||||
|
path = info->filePath();
|
||||||
|
code = info->baseName();
|
||||||
|
if (img.load(path)) {
|
||||||
|
KConfig config("l10n/" + code + "/entry.desktop", true, false, "locale");
|
||||||
|
config.setGroup("KCM Locale");
|
||||||
|
name = config.readEntry("Name");
|
||||||
|
if (!name.isNull()) {
|
||||||
|
pix.convertFromImage(img.smoothScale(FLAG_ICON_WIDTH, FLAG_ICON_HEIGHT));
|
||||||
|
new PathListBoxItem(lbIcons, pix, name, path);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
void KBPickIconDlg::showCurrentPath(const QString ¤tPath,
|
||||||
|
const QPixmap ¤tPixmap)
|
||||||
|
{
|
||||||
|
PathListBoxItem *item = NULL;
|
||||||
|
bool itemFound = false;
|
||||||
|
for (unsigned i = 0; i < lbIcons->count(); i++) {
|
||||||
|
item = dynamic_cast<PathListBoxItem*>(lbIcons->item(i));
|
||||||
|
if (item->path == currentPath) {
|
||||||
|
itemFound = true;
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
// why this strange manipulation of HScrollBarMode?
|
||||||
|
// Strangely, without it, if the selected item is the last in the listbox, it ends up
|
||||||
|
// being obscured by the horizontal scrollbar
|
||||||
|
lbIcons->setHScrollBarMode(QScrollView::AlwaysOn);
|
||||||
|
if (!itemFound) item = new PathListBoxItem(lbIcons, currentPixmap,
|
||||||
|
QFileInfo(currentPath).fileName(), currentPath);
|
||||||
|
lbIcons->updateScrollBars();
|
||||||
|
lbIcons->setSelected(item, true);
|
||||||
|
lbIcons->ensureCurrentVisible();
|
||||||
|
lbIcons->setHScrollBarMode(QScrollView::Auto);
|
||||||
|
}
|
@ -0,0 +1,61 @@
|
|||||||
|
/***************************************************************************
|
||||||
|
kbpickicondlg.h - description
|
||||||
|
-------------------
|
||||||
|
begin : Sat Jul 21 2001
|
||||||
|
copyright : (C) 2001 by Leonid Zeitlin
|
||||||
|
email : lz@europe.com
|
||||||
|
***************************************************************************/
|
||||||
|
|
||||||
|
/***************************************************************************
|
||||||
|
* *
|
||||||
|
* 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. *
|
||||||
|
* *
|
||||||
|
***************************************************************************/
|
||||||
|
|
||||||
|
#ifndef KBPICKICONDLG_H
|
||||||
|
#define KBPICKICONDLG_H
|
||||||
|
|
||||||
|
#include <kdialogbase.h>
|
||||||
|
|
||||||
|
class QWidget;
|
||||||
|
class QStringList;
|
||||||
|
class QPixmap;
|
||||||
|
class KListBox;
|
||||||
|
|
||||||
|
/**A dialog to pick an icon for a keyboard layout
|
||||||
|
*@author Leonid Zeitlin
|
||||||
|
*/
|
||||||
|
|
||||||
|
class KBPickIconDlg : public KDialogBase {
|
||||||
|
Q_OBJECT
|
||||||
|
public:
|
||||||
|
KBPickIconDlg(const QString ¤tPath, const QPixmap ¤tPixmap,
|
||||||
|
QWidget *parent=0, const char *name=0);
|
||||||
|
~KBPickIconDlg();
|
||||||
|
/** Get the path name of the selected icon. Returns empty string if no icon selected */
|
||||||
|
QString getIconPath();
|
||||||
|
/** No descriptions */
|
||||||
|
const QPixmap* getIcon();
|
||||||
|
private: // Private attributes
|
||||||
|
/** */
|
||||||
|
//QStringList m_pathnames;
|
||||||
|
//QString m_iconpath;
|
||||||
|
//KIconView *m_iconview;
|
||||||
|
KListBox *lbIcons;
|
||||||
|
//QLabel *lblIcon;
|
||||||
|
//QRadioButton *rbFlags;
|
||||||
|
//QRadioButton *rbBrowse;
|
||||||
|
void loadCountryFlags();
|
||||||
|
void loadGkbCountryFlags();
|
||||||
|
void showCurrentPath(const QString ¤tPath, const QPixmap ¤tPixmap);
|
||||||
|
private slots: // Private slots
|
||||||
|
/** Browse for an arbitrary icon file */
|
||||||
|
void slotBrowseForIcon();
|
||||||
|
/** Respond to user selecting a flag in the icon view */
|
||||||
|
//void slotFlagSelected(QIconViewItem *item);
|
||||||
|
};
|
||||||
|
|
||||||
|
#endif
|
@ -0,0 +1,379 @@
|
|||||||
|
/***************************************************************************
|
||||||
|
kbswitchapp.cpp - description
|
||||||
|
-------------------
|
||||||
|
begin : Sun Jul 1 2001
|
||||||
|
copyright : (C) 2001 by Leonid Zeitlin
|
||||||
|
email : lz@europe.com
|
||||||
|
***************************************************************************/
|
||||||
|
|
||||||
|
/***************************************************************************
|
||||||
|
* *
|
||||||
|
* 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. *
|
||||||
|
* *
|
||||||
|
***************************************************************************/
|
||||||
|
|
||||||
|
#include "config.h"
|
||||||
|
#include "kbswitchapp.h"
|
||||||
|
#include "kbconfigdlg.h"
|
||||||
|
#include "singlewindowwatcher.h"
|
||||||
|
#include "windowclasswatcher.h"
|
||||||
|
|
||||||
|
#include <kdebug.h>
|
||||||
|
#include <klocale.h>
|
||||||
|
#include <kwinmodule.h>
|
||||||
|
|
||||||
|
KBSwitchApp::KBSwitchApp()
|
||||||
|
{
|
||||||
|
#ifndef HAVE_LIBXKLAVIER
|
||||||
|
//m_kwin_module = NULL;
|
||||||
|
m_watcher = NULL;
|
||||||
|
#endif
|
||||||
|
if (!m_xkb.xkbAvailable()) return; // oops! No XKB in the server
|
||||||
|
m_kbconf.load(config());
|
||||||
|
m_cur_groupno = m_next_groupno = -1;
|
||||||
|
#ifdef HAVE_LIBXKLAVIER
|
||||||
|
XklSetGroupPerApp(m_kbconf.group_scope() != KBConfig::SCOPE_GLOBAL);
|
||||||
|
if (m_kbconf.toggle_mode())
|
||||||
|
XklSetSecondaryGroupsMask(12); /* binary 1100 */
|
||||||
|
#else
|
||||||
|
//resetWindowMap();
|
||||||
|
//enableKWinModule();
|
||||||
|
enableWatcher();
|
||||||
|
#endif
|
||||||
|
|
||||||
|
m_intf = new KBSwitchIntf(this, &m_kbconf);
|
||||||
|
QObject::connect(m_intf, SIGNAL(nextGroupSelected()), this, SLOT(slotSelectNextGroup()));
|
||||||
|
QObject::connect(m_intf, SIGNAL(groupSelected(int)), this, SLOT(slotGroupSelected(int)));
|
||||||
|
|
||||||
|
QObject::connect(&m_xkb, SIGNAL(layoutChanged()), this, SLOT(reconfigure()));
|
||||||
|
QObject::connect(&m_xkb, SIGNAL(groupChanged(int)), this, SLOT(slotXkbGroupChanged(int)));
|
||||||
|
|
||||||
|
m_force_group_setting = false;
|
||||||
|
int start_group = m_kbconf.default_groupno();
|
||||||
|
|
||||||
|
m_trayicon = new KBSwitchTrayIcon(&m_kbconf);
|
||||||
|
QObject::connect(m_trayicon, SIGNAL(groupSelected(int)), this,
|
||||||
|
SLOT(slotGroupSelected(int)));
|
||||||
|
QObject::connect(m_trayicon, SIGNAL(clicked()), this, SLOT(slotSelectNextGroup()));
|
||||||
|
QObject::connect(m_trayicon, SIGNAL(preferencesSelected()), this,
|
||||||
|
SLOT(slotPreferences()));
|
||||||
|
|
||||||
|
if (start_group != m_xkb.getGroupNo()) {
|
||||||
|
setStartGroup(start_group);
|
||||||
|
}
|
||||||
|
else {
|
||||||
|
adaptToGroup(start_group);
|
||||||
|
}
|
||||||
|
|
||||||
|
setMainWidget(m_trayicon);
|
||||||
|
m_trayicon->show();
|
||||||
|
|
||||||
|
#ifdef HAVE_LIBXKLAVIER
|
||||||
|
XklStartListen();
|
||||||
|
#endif
|
||||||
|
}
|
||||||
|
|
||||||
|
KBSwitchApp::~KBSwitchApp(){
|
||||||
|
#ifndef HAVE_LIBXKLAVIER
|
||||||
|
//disableKWinModule();
|
||||||
|
disableWatcher();
|
||||||
|
#endif
|
||||||
|
}
|
||||||
|
|
||||||
|
/** No descriptions */
|
||||||
|
bool KBSwitchApp::x11EventFilter(XEvent *e){
|
||||||
|
// let m_xkb process the event and emit signals if necessary
|
||||||
|
m_xkb.processEvent(e);
|
||||||
|
return KApplication::x11EventFilter(e);
|
||||||
|
}
|
||||||
|
|
||||||
|
/** Update the tray icon to show the flag corresponding to the current keyboard group */
|
||||||
|
void KBSwitchApp::updateIcon(int groupno){
|
||||||
|
if (groupno >= 0 && groupno < m_kbconf.groupCount()) { // check just in case
|
||||||
|
m_trayicon->updateTrayIcon(groupno);
|
||||||
|
if (m_kbconf.toggle_mode()) m_trayicon->setToggleGroups(m_cur_groupno, m_next_groupno);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
/** No descriptions */
|
||||||
|
void KBSwitchApp::slotGroupSelected(int groupno)
|
||||||
|
{
|
||||||
|
#ifdef HAVE_LIBXKLAVIER
|
||||||
|
XklAllowOneSwitchToSecondaryGroup();
|
||||||
|
m_xkb.setGroupNo(groupno);
|
||||||
|
#else
|
||||||
|
if (m_cur_groupno != groupno) {
|
||||||
|
setGroups(groupno, m_cur_groupno);
|
||||||
|
}
|
||||||
|
#endif
|
||||||
|
}
|
||||||
|
|
||||||
|
/** No descriptions */
|
||||||
|
void KBSwitchApp::internalToggleGroups()
|
||||||
|
{
|
||||||
|
int tmp = m_next_groupno;
|
||||||
|
m_next_groupno = m_cur_groupno;
|
||||||
|
m_cur_groupno = tmp;
|
||||||
|
}
|
||||||
|
|
||||||
|
/** No descriptions */
|
||||||
|
void KBSwitchApp::forceSetGroup(int groupno)
|
||||||
|
{
|
||||||
|
m_force_group_setting = true;
|
||||||
|
#ifndef HAVE_LIBXKLAVIER
|
||||||
|
//if (m_active_window != m_window_map.end())
|
||||||
|
// m_active_window.data().groupno = groupno;
|
||||||
|
#endif
|
||||||
|
m_xkb.setGroupNo(groupno);
|
||||||
|
}
|
||||||
|
|
||||||
|
/** No descriptions */
|
||||||
|
void KBSwitchApp::slotSelectNextGroup()
|
||||||
|
{
|
||||||
|
#ifdef HAVE_LIBXKLAVIER
|
||||||
|
m_xkb.setGroupNo(XklGetNextGroup());
|
||||||
|
#else
|
||||||
|
//forceSetGroup(m_next_groupno);
|
||||||
|
m_xkb.setGroupNo(m_next_groupno);
|
||||||
|
#endif
|
||||||
|
}
|
||||||
|
|
||||||
|
/** No descriptions */
|
||||||
|
void KBSwitchApp::slotPreferences(){
|
||||||
|
KBConfigDlg dlg(&m_kbconf);
|
||||||
|
QObject::connect(&dlg, SIGNAL(okClicked()), m_trayicon, SLOT(slotUpdateIcons()));
|
||||||
|
QObject::connect(&dlg, SIGNAL(applyClicked()), m_trayicon, SLOT(slotUpdateIcons()));
|
||||||
|
QObject::connect(&dlg, SIGNAL(okClicked()), this, SLOT(slotPrefChanged()));
|
||||||
|
QObject::connect(&dlg, SIGNAL(applyClicked()), this, SLOT(slotPrefChanged()));
|
||||||
|
dlg.exec();
|
||||||
|
}
|
||||||
|
|
||||||
|
/** Called when XKeyboard configuration changes */
|
||||||
|
void KBSwitchApp::reconfigure(){
|
||||||
|
m_kbconf.load(config());
|
||||||
|
m_trayicon->reconfigure();
|
||||||
|
|
||||||
|
// make sure default group is still valid
|
||||||
|
if (m_kbconf.default_groupno() >= m_xkb.getNumKbdGroups())
|
||||||
|
m_kbconf.set_default_groupno(0);
|
||||||
|
|
||||||
|
int groupno = m_xkb.getGroupNo();
|
||||||
|
if (groupno >= m_xkb.getNumKbdGroups()) {
|
||||||
|
// current group no longer valid, reset to default group
|
||||||
|
setStartGroup(m_kbconf.default_groupno());
|
||||||
|
}
|
||||||
|
else if (!m_force_group_setting) {
|
||||||
|
adaptToGroup(groupno);
|
||||||
|
}
|
||||||
|
#ifndef HAVE_LIBXKLAVIER
|
||||||
|
//resetWindowMap();
|
||||||
|
if (m_watcher) m_watcher->reset();
|
||||||
|
#endif
|
||||||
|
}
|
||||||
|
|
||||||
|
/** Respond to XKB changing the current group */
|
||||||
|
void KBSwitchApp::slotXkbGroupChanged(int groupno){
|
||||||
|
#ifdef HAVE_LIBXKLAVIER
|
||||||
|
updateIcon(groupno);
|
||||||
|
/* XWindowAttributes attrs;
|
||||||
|
XGetWindowAttributes(qt_xdisplay(), qt_xrootwin(), &attrs);
|
||||||
|
kdDebug() << "root event mask is " << attrs.your_event_mask << endl;
|
||||||
|
kdDebug() << "SubstructureNotifyMask is " <<
|
||||||
|
((attrs.your_event_mask & SubstructureNotifyMask) ? "ON" : "OFF") << endl;*/
|
||||||
|
#else
|
||||||
|
bool accept = false;
|
||||||
|
if (m_force_group_setting) { // the change of group is forced by us
|
||||||
|
if (groupno == m_cur_groupno) { // the group is what we wanted, fine
|
||||||
|
m_force_group_setting = false;
|
||||||
|
accept = true;
|
||||||
|
}
|
||||||
|
else { // oops, not the group we expected
|
||||||
|
forceSetGroup(m_cur_groupno);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
else { // the change is caused by something external, we didn't request it
|
||||||
|
if (m_kbconf.toggle_mode() && groupno != m_next_groupno) { // toggle mode, and the group is not correct
|
||||||
|
m_xkb.setGroupNo(m_next_groupno);
|
||||||
|
}
|
||||||
|
else { // adjust to this group
|
||||||
|
if (m_kbconf.toggle_mode()) internalToggleGroups();
|
||||||
|
else {
|
||||||
|
m_cur_groupno = groupno;
|
||||||
|
m_next_groupno = m_kbconf.getNextGroup(groupno);
|
||||||
|
}
|
||||||
|
accept = true;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
if (accept) {
|
||||||
|
updateIcon(groupno);
|
||||||
|
if (m_watcher) m_watcher->changeGroup(groupno, m_next_groupno);
|
||||||
|
}
|
||||||
|
/*if (m_kbconf.toggle_mode() && !force_group_setting && groupno != m_next_groupno) {
|
||||||
|
forceSetGroup(m_next_groupno);
|
||||||
|
}
|
||||||
|
else {
|
||||||
|
updateIcon(groupno);
|
||||||
|
force_group_setting = false;
|
||||||
|
if (m_kbconf.toggle_mode()) internalToggleGroups();
|
||||||
|
else {
|
||||||
|
kdDebug() << "slotXkbGroupChanged, change group to " << groupno << endl;
|
||||||
|
m_cur_groupno = groupno;
|
||||||
|
m_next_groupno = m_kbconf.getNextGroup(groupno);
|
||||||
|
}
|
||||||
|
if (m_watcher) m_watcher->changeGroup(groupno, m_next_groupno);
|
||||||
|
}*/
|
||||||
|
#endif
|
||||||
|
}
|
||||||
|
|
||||||
|
/** Set the keyboard to the given group and set internal variable accordingly */
|
||||||
|
void KBSwitchApp::setStartGroup(int start_group){
|
||||||
|
/*m_next_groupno = start_group;
|
||||||
|
if (m_kbconf.toggle_mode()) {
|
||||||
|
m_cur_groupno = getNextGroup(start_group);
|
||||||
|
}
|
||||||
|
else {
|
||||||
|
m_cur_groupno = start_group;
|
||||||
|
}
|
||||||
|
forceSetGroup(m_next_groupno);*/
|
||||||
|
setGroups(start_group, m_kbconf.getNextGroup(start_group));
|
||||||
|
}
|
||||||
|
|
||||||
|
/** adapt internal state to the given group */
|
||||||
|
void KBSwitchApp::adaptToGroup(int groupno) {
|
||||||
|
if (! m_kbconf.toggle_mode() || // if not in toggle mode
|
||||||
|
(m_cur_groupno != groupno // or in toggle mode and internal variables are invalid
|
||||||
|
|| m_next_groupno >= m_kbconf.groupCount()
|
||||||
|
|| m_next_groupno == m_cur_groupno)) {
|
||||||
|
m_cur_groupno = groupno;
|
||||||
|
m_next_groupno = m_kbconf.getNextGroup(groupno);
|
||||||
|
}
|
||||||
|
#ifndef HAVE_LIBXKLAVIER
|
||||||
|
if (m_watcher) m_watcher->changeGroup(groupno, m_next_groupno);
|
||||||
|
/*if (m_active_window != m_window_map.end()) {
|
||||||
|
m_active_window.data().groupno = groupno;
|
||||||
|
m_active_window.data().next_groupno = m_next_groupno;
|
||||||
|
}*/
|
||||||
|
#endif
|
||||||
|
updateIcon(groupno);
|
||||||
|
}
|
||||||
|
|
||||||
|
/*void KBSwitchApp::slotWindowChanged(WId activeWindow)
|
||||||
|
{
|
||||||
|
#ifndef HAVE_LIBXKLAVIER
|
||||||
|
m_active_window = m_window_map.find(activeWindow);
|
||||||
|
if (m_active_window == m_window_map.end())
|
||||||
|
addWindowToMap(activeWindow);
|
||||||
|
if (m_active_window.data().groupno != m_cur_groupno) {
|
||||||
|
setGroups(m_active_window.data().groupno, m_active_window.data().next_groupno);
|
||||||
|
}
|
||||||
|
else m_next_groupno = m_active_window.data().next_groupno;
|
||||||
|
#endif
|
||||||
|
}*/
|
||||||
|
|
||||||
|
void KBSwitchApp::slotWindowChanged(int groupno, int next_groupno)
|
||||||
|
{
|
||||||
|
if (groupno != m_cur_groupno) {
|
||||||
|
setGroups(groupno, next_groupno);
|
||||||
|
}
|
||||||
|
else m_next_groupno = next_groupno;
|
||||||
|
}
|
||||||
|
|
||||||
|
/*void KBSwitchApp::slotWindowRemoved(WId window)
|
||||||
|
{
|
||||||
|
#ifndef HAVE_LIBXKLAVIER
|
||||||
|
m_window_map.remove(window);
|
||||||
|
#endif
|
||||||
|
}
|
||||||
|
|
||||||
|
#ifndef HAVE_LIBXKLAVIER
|
||||||
|
void KBSwitchApp::resetWindowMap()
|
||||||
|
{
|
||||||
|
WId active_window_id;
|
||||||
|
|
||||||
|
m_window_map.clear();
|
||||||
|
|
||||||
|
if (m_kwin_module && (active_window_id = m_kwin_module->activeWindow()))
|
||||||
|
addWindowToMap(active_window_id);
|
||||||
|
else
|
||||||
|
m_active_window = m_window_map.end();
|
||||||
|
}*/
|
||||||
|
|
||||||
|
/** Enable window manager notifications */
|
||||||
|
/*void KBSwitchApp::enableKWinModule()
|
||||||
|
{
|
||||||
|
if (m_kwin_module == NULL) {
|
||||||
|
m_kwin_module = new KWinModule();
|
||||||
|
connect(m_kwin_module, SIGNAL(activeWindowChanged(WId)), SLOT(slotWindowChanged(WId)));
|
||||||
|
connect(m_kwin_module, SIGNAL(windowRemoved(WId)), SLOT(slotWindowRemoved(WId)));
|
||||||
|
resetWindowMap();
|
||||||
|
if (m_cur_groupno != -1 && m_cur_groupno != m_kbconf.default_groupno())
|
||||||
|
setStartGroup(m_kbconf.default_groupno());
|
||||||
|
}
|
||||||
|
}*/
|
||||||
|
|
||||||
|
/** Disable window manager notifications */
|
||||||
|
/*void KBSwitchApp::disableKWinModule()
|
||||||
|
{
|
||||||
|
if (m_kwin_module) {
|
||||||
|
m_kwin_module->disconnect();
|
||||||
|
delete m_kwin_module;
|
||||||
|
m_kwin_module = NULL;
|
||||||
|
resetWindowMap();
|
||||||
|
}
|
||||||
|
}*/
|
||||||
|
|
||||||
|
/** adds a new window to the internal window map */
|
||||||
|
/*void KBSwitchApp::addWindowToMap(WId window_id)
|
||||||
|
{
|
||||||
|
KBWinInfo wininfo = { m_kbconf.default_groupno(),
|
||||||
|
m_kbconf.getNextGroup(m_kbconf.default_groupno()) };
|
||||||
|
|
||||||
|
m_active_window = m_window_map.insert(window_id, wininfo);
|
||||||
|
}
|
||||||
|
#endif*/
|
||||||
|
|
||||||
|
void KBSwitchApp::enableWatcher()
|
||||||
|
{
|
||||||
|
if (!m_watcher) {
|
||||||
|
m_watcher_type = m_kbconf.group_scope();
|
||||||
|
if (m_watcher_type == KBConfig::SCOPE_WINDOW)
|
||||||
|
m_watcher = new SingleWindowWatcher(&m_kbconf, this);
|
||||||
|
else if (m_watcher_type == KBConfig::SCOPE_CLASS)
|
||||||
|
m_watcher = new WindowClassWatcher(&m_kbconf, this);
|
||||||
|
else return; // if scope is global, don't create watcher
|
||||||
|
connect(m_watcher, SIGNAL(windowChanged(int, int )),
|
||||||
|
SLOT(slotWindowChanged(int, int)));
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
void KBSwitchApp::disableWatcher()
|
||||||
|
{
|
||||||
|
if (m_watcher) {
|
||||||
|
m_watcher->disconnect();
|
||||||
|
delete m_watcher;
|
||||||
|
m_watcher = NULL;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
/** React to a change in KKBSwitch's user preferences,
|
||||||
|
* made by user in Configure dialog */
|
||||||
|
void KBSwitchApp::slotPrefChanged()
|
||||||
|
{
|
||||||
|
#ifndef HAVE_LIBXKLAVIER
|
||||||
|
if (m_kbconf.group_scope() != m_watcher_type) {
|
||||||
|
disableWatcher();
|
||||||
|
enableWatcher();
|
||||||
|
}
|
||||||
|
#endif
|
||||||
|
}
|
||||||
|
|
||||||
|
/** Set the current and next groups */
|
||||||
|
void KBSwitchApp::setGroups(int group, int next_group)
|
||||||
|
{
|
||||||
|
m_cur_groupno = group;
|
||||||
|
m_next_groupno = next_group;
|
||||||
|
forceSetGroup(group);
|
||||||
|
}
|
@ -0,0 +1,131 @@
|
|||||||
|
/***************************************************************************
|
||||||
|
kbswitchapp.h - description
|
||||||
|
-------------------
|
||||||
|
begin : Sun Jul 1 2001
|
||||||
|
copyright : (C) 2001 by Leonid Zeitlin
|
||||||
|
email : lz@europe.com
|
||||||
|
***************************************************************************/
|
||||||
|
|
||||||
|
/***************************************************************************
|
||||||
|
* *
|
||||||
|
* 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. *
|
||||||
|
* *
|
||||||
|
***************************************************************************/
|
||||||
|
|
||||||
|
#ifndef KBSWITCHAPP_H
|
||||||
|
#define KBSWITCHAPP_H
|
||||||
|
|
||||||
|
#ifdef HAVE_CONFIG_H
|
||||||
|
#include <config.h>
|
||||||
|
#endif
|
||||||
|
|
||||||
|
#include <kdeversion.h>
|
||||||
|
#if KDE_VERSION_MAJOR >= 3
|
||||||
|
#include <kuniqueapplication.h>
|
||||||
|
#else
|
||||||
|
#include <kuniqueapp.h>
|
||||||
|
#endif
|
||||||
|
|
||||||
|
//#include <qmap.h>
|
||||||
|
|
||||||
|
#include "kbgroup.h"
|
||||||
|
#include "kbswitchtrayicon.h"
|
||||||
|
#include "kbconfig.h"
|
||||||
|
#include "xkeyboard.h"
|
||||||
|
#include "kbswitchintf.h"
|
||||||
|
#include "windowwatcher.h"
|
||||||
|
|
||||||
|
/*class KWinModule;
|
||||||
|
|
||||||
|
typedef struct _KBWinInfo {
|
||||||
|
int groupno;
|
||||||
|
int next_groupno;
|
||||||
|
} KBWinInfo;
|
||||||
|
|
||||||
|
typedef QMap<WId, KBWinInfo> KBWindowMap;*/
|
||||||
|
|
||||||
|
/**
|
||||||
|
*@author Leonid Zeitlin
|
||||||
|
*/
|
||||||
|
|
||||||
|
class KBSwitchApp : public KUniqueApplication {
|
||||||
|
Q_OBJECT
|
||||||
|
public:
|
||||||
|
KBSwitchApp();
|
||||||
|
~KBSwitchApp();
|
||||||
|
protected: // Protected methods
|
||||||
|
/** No descriptions */
|
||||||
|
bool x11EventFilter(XEvent *e);
|
||||||
|
private: // Private attributes
|
||||||
|
/** */
|
||||||
|
bool m_force_group_setting;
|
||||||
|
int m_cur_groupno;
|
||||||
|
int m_next_groupno;
|
||||||
|
XKeyboard m_xkb;
|
||||||
|
/** */
|
||||||
|
KBSwitchTrayIcon * m_trayicon;
|
||||||
|
/** No descriptions */
|
||||||
|
KBConfig m_kbconf;
|
||||||
|
KBSwitchIntf *m_intf;
|
||||||
|
#ifndef HAVE_LIBXKLAVIER
|
||||||
|
/** Window manager interface */
|
||||||
|
//KWinModule *m_kwin_module;
|
||||||
|
/** Maps Window IDs to their keyboard groups */
|
||||||
|
//KBWindowMap m_window_map;
|
||||||
|
//KBWindowMap::iterator m_active_window;
|
||||||
|
WindowWatcher *m_watcher;
|
||||||
|
KBConfig::GroupScope m_watcher_type;
|
||||||
|
#endif
|
||||||
|
private: // Private methods
|
||||||
|
/** Update the tray icon to show the flag corresponding to the current keyboard group */
|
||||||
|
void updateIcon(int groupno);
|
||||||
|
/** No descriptions */
|
||||||
|
void internalToggleGroups();
|
||||||
|
/** No descriptions */
|
||||||
|
void forceSetGroup(int groupno);
|
||||||
|
/** No descriptions */
|
||||||
|
/*int getNextGroup(int groupno) {
|
||||||
|
return groupno >= m_kbconf.groupCount() - 1 ? 0 : groupno + 1;
|
||||||
|
}*/
|
||||||
|
/** No descriptions */
|
||||||
|
void setStartGroup(int start_group);
|
||||||
|
void adaptToGroup(int groupno);
|
||||||
|
#ifndef HAVE_LIBXKLAVIER
|
||||||
|
/** initialize Window groups map */
|
||||||
|
//void resetWindowMap();
|
||||||
|
/** Disable window manager notifications */
|
||||||
|
//void disableKWinModule();
|
||||||
|
/** Enable window manager notifications */
|
||||||
|
//void enableKWinModule();
|
||||||
|
/** adds a new window to the internal window map */
|
||||||
|
//void addWindowToMap(WId window_id);
|
||||||
|
void enableWatcher();
|
||||||
|
void disableWatcher();
|
||||||
|
#endif
|
||||||
|
/** Set the current and next groups */
|
||||||
|
void setGroups(int group, int next_group);
|
||||||
|
private slots: // Private slots
|
||||||
|
/** No descriptions */
|
||||||
|
void slotGroupSelected(int groupno);
|
||||||
|
/** No descriptions */
|
||||||
|
void slotSelectNextGroup();
|
||||||
|
/** No descriptions */
|
||||||
|
void slotPreferences();
|
||||||
|
/** No descriptions */
|
||||||
|
void reconfigure();
|
||||||
|
/** Respond to XKB changing the current group */
|
||||||
|
void slotXkbGroupChanged(int groupno);
|
||||||
|
/** Respond to changing of active window - active it's kb group */
|
||||||
|
//void slotWindowChanged(WId activeWindow);
|
||||||
|
/** Respond to removal of a window - remote it from Window groups map */
|
||||||
|
//void slotWindowRemoved(WId window);
|
||||||
|
void slotWindowChanged(int groupno, int next_groupno);
|
||||||
|
/** React to a change in KKBSwitch's user preferences,
|
||||||
|
* made by user in Configure dialog */
|
||||||
|
void slotPrefChanged();
|
||||||
|
};
|
||||||
|
|
||||||
|
#endif
|
@ -0,0 +1,51 @@
|
|||||||
|
/***************************************************************************
|
||||||
|
kbswitchintf.cpp - description
|
||||||
|
-------------------
|
||||||
|
begin : Sun Aug 12 2001
|
||||||
|
copyright : (C) 2001 by Leonid Zeitlin
|
||||||
|
email : lz@europe.com
|
||||||
|
***************************************************************************/
|
||||||
|
|
||||||
|
/***************************************************************************
|
||||||
|
* *
|
||||||
|
* 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. *
|
||||||
|
* *
|
||||||
|
***************************************************************************/
|
||||||
|
|
||||||
|
#include "kbswitchintf.h"
|
||||||
|
//#include <kapp.h>
|
||||||
|
|
||||||
|
KBSwitchIntf::KBSwitchIntf(QObject *parent, KBConfig *conf)
|
||||||
|
: QObject(parent, "KBSwitchIntf"), DCOPObject("KBSwitchIntf")
|
||||||
|
{
|
||||||
|
m_kbconf = conf;
|
||||||
|
}
|
||||||
|
|
||||||
|
KBSwitchIntf::~KBSwitchIntf(){
|
||||||
|
}
|
||||||
|
|
||||||
|
int KBSwitchIntf::getNumKbdGroups()
|
||||||
|
{
|
||||||
|
return m_kbconf->groupCount();
|
||||||
|
}
|
||||||
|
|
||||||
|
ASYNC KBSwitchIntf::selectNextGroup()
|
||||||
|
{
|
||||||
|
emit nextGroupSelected();
|
||||||
|
}
|
||||||
|
|
||||||
|
ASYNC KBSwitchIntf::selectGroup(int groupno)
|
||||||
|
{
|
||||||
|
emit groupSelected(groupno);
|
||||||
|
}
|
||||||
|
|
||||||
|
QStringList KBSwitchIntf::getGroupNames()
|
||||||
|
{
|
||||||
|
QStringList result;
|
||||||
|
for (int i = 0; i < m_kbconf->groupCount(); i++)
|
||||||
|
result.append(m_kbconf->getGroup(i)->getName());
|
||||||
|
return result;
|
||||||
|
}
|
@ -0,0 +1,54 @@
|
|||||||
|
/***************************************************************************
|
||||||
|
kbswitchintf.h - description
|
||||||
|
-------------------
|
||||||
|
begin : Sun Aug 12 2001
|
||||||
|
copyright : (C) 2001 by Leonid Zeitlin
|
||||||
|
email : lz@europe.com
|
||||||
|
***************************************************************************/
|
||||||
|
|
||||||
|
/***************************************************************************
|
||||||
|
* *
|
||||||
|
* 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. *
|
||||||
|
* *
|
||||||
|
***************************************************************************/
|
||||||
|
|
||||||
|
#ifndef KBSWITCHINTF_H
|
||||||
|
#define KBSWITCHINTF_H
|
||||||
|
|
||||||
|
#include <dcopobject.h>
|
||||||
|
#include <qobject.h>
|
||||||
|
#include <qstringlist.h>
|
||||||
|
|
||||||
|
#include "kbconfig.h"
|
||||||
|
|
||||||
|
/**This class implements DCOP bindings for KBSwitch
|
||||||
|
*@author Leonid Zeitlin
|
||||||
|
*/
|
||||||
|
|
||||||
|
/* Interesting to note: moc failed on this file when the k_dcop section immediately
|
||||||
|
followed the signals section (the error message was "syntax error"). After I
|
||||||
|
separated the signals and k_dcop sections with the public section everything worked.
|
||||||
|
Apparently, the k_dcop "keyword" confuses moc, which is only natural given that
|
||||||
|
moc doesn't know about dcopidl! */
|
||||||
|
class KBSwitchIntf : public QObject, public DCOPObject {
|
||||||
|
K_DCOP
|
||||||
|
Q_OBJECT
|
||||||
|
signals:
|
||||||
|
void nextGroupSelected();
|
||||||
|
void groupSelected(int groupno);
|
||||||
|
public:
|
||||||
|
KBSwitchIntf(QObject *parent, KBConfig *conf);
|
||||||
|
~KBSwitchIntf();
|
||||||
|
private:
|
||||||
|
KBConfig *m_kbconf;
|
||||||
|
k_dcop:
|
||||||
|
int getNumKbdGroups();
|
||||||
|
ASYNC selectNextGroup();
|
||||||
|
ASYNC selectGroup(int groupno);
|
||||||
|
QStringList getGroupNames();
|
||||||
|
};
|
||||||
|
|
||||||
|
#endif
|
@ -0,0 +1 @@
|
|||||||
|
#
|
@ -0,0 +1,74 @@
|
|||||||
|
/****************************************************************************
|
||||||
|
**
|
||||||
|
** DCOP Skeleton created by dcopidl2cpp from kbswitchintf.kidl
|
||||||
|
**
|
||||||
|
** WARNING! All changes made in this file will be lost!
|
||||||
|
**
|
||||||
|
*****************************************************************************/
|
||||||
|
|
||||||
|
#include "./kbswitchintf.h"
|
||||||
|
|
||||||
|
#include <kdatastream.h>
|
||||||
|
|
||||||
|
|
||||||
|
static const char* const KBSwitchIntf_ftable[5][3] = {
|
||||||
|
{ "int", "getNumKbdGroups()", "getNumKbdGroups()" },
|
||||||
|
{ "ASYNC", "selectNextGroup()", "selectNextGroup()" },
|
||||||
|
{ "ASYNC", "selectGroup(int)", "selectGroup(int groupno)" },
|
||||||
|
{ "QStringList", "getGroupNames()", "getGroupNames()" },
|
||||||
|
{ 0, 0, 0 }
|
||||||
|
};
|
||||||
|
static const int KBSwitchIntf_ftable_hiddens[4] = {
|
||||||
|
0,
|
||||||
|
0,
|
||||||
|
0,
|
||||||
|
0,
|
||||||
|
};
|
||||||
|
|
||||||
|
bool KBSwitchIntf::process(const QCString &fun, const QByteArray &data, QCString& replyType, QByteArray &replyData)
|
||||||
|
{
|
||||||
|
if ( fun == KBSwitchIntf_ftable[0][1] ) { // int getNumKbdGroups()
|
||||||
|
replyType = KBSwitchIntf_ftable[0][0];
|
||||||
|
QDataStream _replyStream( replyData, IO_WriteOnly );
|
||||||
|
_replyStream << getNumKbdGroups( );
|
||||||
|
} else if ( fun == KBSwitchIntf_ftable[1][1] ) { // void selectNextGroup()
|
||||||
|
replyType = KBSwitchIntf_ftable[1][0];
|
||||||
|
selectNextGroup( );
|
||||||
|
} else if ( fun == KBSwitchIntf_ftable[2][1] ) { // void selectGroup(int)
|
||||||
|
int arg0;
|
||||||
|
QDataStream arg( data, IO_ReadOnly );
|
||||||
|
arg >> arg0;
|
||||||
|
replyType = KBSwitchIntf_ftable[2][0];
|
||||||
|
selectGroup(arg0 );
|
||||||
|
} else if ( fun == KBSwitchIntf_ftable[3][1] ) { // QStringList getGroupNames()
|
||||||
|
replyType = KBSwitchIntf_ftable[3][0];
|
||||||
|
QDataStream _replyStream( replyData, IO_WriteOnly );
|
||||||
|
_replyStream << getGroupNames( );
|
||||||
|
} else {
|
||||||
|
return DCOPObject::process( fun, data, replyType, replyData );
|
||||||
|
}
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
|
||||||
|
QCStringList KBSwitchIntf::interfaces()
|
||||||
|
{
|
||||||
|
QCStringList ifaces = DCOPObject::interfaces();
|
||||||
|
ifaces += "KBSwitchIntf";
|
||||||
|
return ifaces;
|
||||||
|
}
|
||||||
|
|
||||||
|
QCStringList KBSwitchIntf::functions()
|
||||||
|
{
|
||||||
|
QCStringList funcs = DCOPObject::functions();
|
||||||
|
for ( int i = 0; KBSwitchIntf_ftable[i][2]; i++ ) {
|
||||||
|
if (KBSwitchIntf_ftable_hiddens[i])
|
||||||
|
continue;
|
||||||
|
QCString func = KBSwitchIntf_ftable[i][0];
|
||||||
|
func += ' ';
|
||||||
|
func += KBSwitchIntf_ftable[i][2];
|
||||||
|
funcs << func;
|
||||||
|
}
|
||||||
|
return funcs;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
@ -0,0 +1,200 @@
|
|||||||
|
/***************************************************************************
|
||||||
|
kbswitchtrayicon.cpp - description
|
||||||
|
-------------------
|
||||||
|
begin : Wed Jul 4 2001
|
||||||
|
copyright : (C) 2001 by Leonid Zeitlin
|
||||||
|
email : lz@europe.com
|
||||||
|
***************************************************************************/
|
||||||
|
|
||||||
|
/***************************************************************************
|
||||||
|
* *
|
||||||
|
* 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. *
|
||||||
|
* *
|
||||||
|
***************************************************************************/
|
||||||
|
|
||||||
|
#include <kdeversion.h>
|
||||||
|
|
||||||
|
#undef USE_BOLD_MENUITEM
|
||||||
|
|
||||||
|
#include "kbswitchtrayicon.h"
|
||||||
|
#include "xkeyboard.h"
|
||||||
|
#ifdef USE_BOLD_MENUITEM
|
||||||
|
#include "boldmenuitem.h"
|
||||||
|
#endif
|
||||||
|
#include <kpopupmenu.h>
|
||||||
|
#if KDE_VERSION_MAJOR >= 3
|
||||||
|
#include <kstandarddirs.h>
|
||||||
|
#else
|
||||||
|
#include <kstddirs.h>
|
||||||
|
#endif
|
||||||
|
#include <klocale.h>
|
||||||
|
#include <kstdaction.h>
|
||||||
|
#include <kaction.h>
|
||||||
|
#include <kaboutapplication.h>
|
||||||
|
#if KDE_VERSION_MAJOR >= 3
|
||||||
|
#include <kapplication.h>
|
||||||
|
#else
|
||||||
|
#include <kapp.h>
|
||||||
|
#endif
|
||||||
|
#include <kiconloader.h>
|
||||||
|
#include <kdebug.h>
|
||||||
|
#include <kdeversion.h>
|
||||||
|
#include <qtooltip.h>
|
||||||
|
#include <qstyle.h>
|
||||||
|
#include <qpainter.h>
|
||||||
|
|
||||||
|
#ifdef USE_BOLD_MENUITEM
|
||||||
|
static QColor getActiveTextColor(KPopupMenu *menu)
|
||||||
|
{
|
||||||
|
int id = menu->insertItem("test text");
|
||||||
|
QMenuItem *item = menu->findItem(id);
|
||||||
|
QStyleOption styleopt = QStyleOption(item);
|
||||||
|
QPainter painter(menu);
|
||||||
|
QColorGroup &cg = menu->colorGroup();
|
||||||
|
KApplication::style().drawControl(QStyle::CE_PopupMenuItem, &painter, menu,
|
||||||
|
menu->contentsRect(), cg, QStyle::Style_Enabled | QStyle::Style_Active,
|
||||||
|
styleopt);
|
||||||
|
menu->removeItem(id);
|
||||||
|
return painter.pen().color();
|
||||||
|
}
|
||||||
|
#endif
|
||||||
|
|
||||||
|
KBSwitchTrayIcon::KBSwitchTrayIcon(KBConfig *conf){
|
||||||
|
QPixmap pix;
|
||||||
|
#if KDE_VERSION_MAJOR >= 3
|
||||||
|
KActionCollection *actions = new KActionCollection(this);
|
||||||
|
#define ACTION_PARENT actions
|
||||||
|
#else
|
||||||
|
#define ACTION_PARENT this
|
||||||
|
#endif
|
||||||
|
|
||||||
|
m_kbconf = conf;
|
||||||
|
//QObject::connect(conf, SIGNAL(changed()), this, SLOT(updateMenuIcons()));
|
||||||
|
KPopupMenu * menu = contextMenu();
|
||||||
|
addLayoutItems(menu, false);
|
||||||
|
QObject::connect(menu, SIGNAL(activated(int)), this, SLOT(slotMenuActivated(int)));
|
||||||
|
|
||||||
|
menu->insertSeparator();
|
||||||
|
KAction *pref = KStdAction::preferences(this, SIGNAL(preferencesSelected()), ACTION_PARENT);
|
||||||
|
pref->plug(menu);
|
||||||
|
KAction *help = KStdAction::help(this, SLOT(slotHelp()), ACTION_PARENT);
|
||||||
|
help->plug(menu);
|
||||||
|
KAction *about = KStdAction::aboutApp(this, SLOT(slotAbout()), ACTION_PARENT);
|
||||||
|
about->plug(menu);
|
||||||
|
|
||||||
|
/*QString path = locate("icon", "hicolor/16x16/apps/locale.png");
|
||||||
|
if (!path.isEmpty()) pix.load(path);*/
|
||||||
|
pix = kapp->iconLoader()->loadIcon("locale", KIcon::Small);
|
||||||
|
menu->changeTitle(menu->idAt(0), pix, i18n("Keyboard Switch"));
|
||||||
|
setAlignment(Qt::AlignHCenter | Qt::AlignCenter);
|
||||||
|
}
|
||||||
|
|
||||||
|
KBSwitchTrayIcon::~KBSwitchTrayIcon(){
|
||||||
|
}
|
||||||
|
|
||||||
|
/** No descriptions */
|
||||||
|
void KBSwitchTrayIcon::slotMenuActivated(int id){
|
||||||
|
if (id >= 0 && id < m_kbconf->groupCount()) emit groupSelected(id);
|
||||||
|
}
|
||||||
|
|
||||||
|
/** No descriptions */
|
||||||
|
void KBSwitchTrayIcon::setActiveGroup(int groupno){
|
||||||
|
int i;
|
||||||
|
KPopupMenu *menu = contextMenu();
|
||||||
|
for (i = 0; i < m_kbconf->groupCount(); i++)
|
||||||
|
menu->setItemChecked(i, false);
|
||||||
|
menu->setItemChecked(groupno, true);
|
||||||
|
}
|
||||||
|
|
||||||
|
/** No descriptions */
|
||||||
|
void KBSwitchTrayIcon::setToggleGroups(int group1, int group2){
|
||||||
|
int i;
|
||||||
|
bool toggling;
|
||||||
|
KPopupMenu *menu = contextMenu();
|
||||||
|
|
||||||
|
for (i = 0; i < m_kbconf->groupCount(); i++) {
|
||||||
|
toggling = (i == group1 || i == group2);
|
||||||
|
#ifdef USE_BOLD_MENUITEM
|
||||||
|
QMenuItem *item = menu->findItem(i);
|
||||||
|
BoldMenuItem *bolditem = dynamic_cast<BoldMenuItem*>(item->custom());
|
||||||
|
bolditem->setBold(toggling);
|
||||||
|
#else
|
||||||
|
if (toggling)
|
||||||
|
menu->changeItem(i, m_kbconf->getGroup(i)->getName() + "*");
|
||||||
|
else menu->changeItem(i, m_kbconf->getGroup(i)->getName());
|
||||||
|
#endif
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
/** No descriptions */
|
||||||
|
void KBSwitchTrayIcon::mouseReleaseEvent(QMouseEvent *event){
|
||||||
|
if (event->button() == LeftButton) {
|
||||||
|
emit clicked();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
/** No descriptions */
|
||||||
|
void KBSwitchTrayIcon::slotAbout(){
|
||||||
|
KAboutApplication about;
|
||||||
|
about.exec();
|
||||||
|
}
|
||||||
|
|
||||||
|
/** No descriptions */
|
||||||
|
void KBSwitchTrayIcon::updateMenuIcons(){
|
||||||
|
KPopupMenu *menu = contextMenu();
|
||||||
|
for (int i = 0; i < m_kbconf->groupCount(); i++) {
|
||||||
|
menu->changeItem(i, m_kbconf->getGroup(i)->getPixmap(), menu->text(i));
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
/** No descriptions */
|
||||||
|
void KBSwitchTrayIcon::addLayoutItems(KPopupMenu *menu, bool clearOld) {
|
||||||
|
KBGroup *group;
|
||||||
|
int index;
|
||||||
|
#ifdef USE_BOLD_MENUITEM
|
||||||
|
QColor active_text_color = getActiveTextColor(menu);
|
||||||
|
#endif
|
||||||
|
|
||||||
|
if (clearOld)
|
||||||
|
for (int i = 0; i < XKeyboard::MaxNumKbdGroups; i++)
|
||||||
|
if ((index = menu->indexOf(i)) >= 0) menu->removeItemAt(index);
|
||||||
|
|
||||||
|
for (int i = 0; i < m_kbconf->groupCount(); i++) {
|
||||||
|
group = m_kbconf->getGroup(i);
|
||||||
|
#ifdef USE_BOLD_MENUITEM
|
||||||
|
/* the work on BoldMenuItems suspended: see comments in boldmenuitem.h */
|
||||||
|
menu->insertItem(group->getPixmap(),
|
||||||
|
new BoldMenuItem(group->getName(), active_text_color, false), i);
|
||||||
|
#else
|
||||||
|
menu->insertItem(group->getPixmap(), group->getName(), i, i + 1);
|
||||||
|
#endif
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
/** No descriptions */
|
||||||
|
void KBSwitchTrayIcon::reconfigure(){
|
||||||
|
addLayoutItems(contextMenu(), true);
|
||||||
|
}
|
||||||
|
|
||||||
|
/** Update the tray icon display for the given group */
|
||||||
|
void KBSwitchTrayIcon::updateTrayIcon(int groupno){
|
||||||
|
const QPixmap& pix = m_kbconf->getGroup(groupno)->getPixmap();
|
||||||
|
setPixmap(pix);
|
||||||
|
setActiveGroup(groupno);
|
||||||
|
QToolTip::remove(this);
|
||||||
|
QToolTip::add(this, m_kbconf->getGroup(groupno)->getName());
|
||||||
|
}
|
||||||
|
|
||||||
|
/** Update menu and tray icons after configuration has changed */
|
||||||
|
void KBSwitchTrayIcon::slotUpdateIcons(){
|
||||||
|
updateTrayIcon(XKeyboard::self()->getGroupNo());
|
||||||
|
updateMenuIcons();
|
||||||
|
}
|
||||||
|
|
||||||
|
/** Display help */
|
||||||
|
void KBSwitchTrayIcon::slotHelp(){
|
||||||
|
kapp->invokeHelp();
|
||||||
|
}
|
@ -0,0 +1,72 @@
|
|||||||
|
/***************************************************************************
|
||||||
|
kbswitchtrayicon.h - description
|
||||||
|
-------------------
|
||||||
|
begin : Wed Jul 4 2001
|
||||||
|
copyright : (C) 2001 by Leonid Zeitlin
|
||||||
|
email : lz@europe.com
|
||||||
|
***************************************************************************/
|
||||||
|
|
||||||
|
/***************************************************************************
|
||||||
|
* *
|
||||||
|
* 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. *
|
||||||
|
* *
|
||||||
|
***************************************************************************/
|
||||||
|
|
||||||
|
#ifndef KBSWITCHTRAYICON_H
|
||||||
|
#define KBSWITCHTRAYICON_H
|
||||||
|
|
||||||
|
#include <ksystemtray.h>
|
||||||
|
|
||||||
|
#include "kbgroup.h"
|
||||||
|
#include "kbconfig.h"
|
||||||
|
|
||||||
|
/**The tray icon showing the current keyboard group
|
||||||
|
*@author Leonid Zeitlin
|
||||||
|
*/
|
||||||
|
|
||||||
|
class KBSwitchTrayIcon : public KSystemTray {
|
||||||
|
Q_OBJECT
|
||||||
|
public:
|
||||||
|
KBSwitchTrayIcon(KBConfig *conf);
|
||||||
|
~KBSwitchTrayIcon();
|
||||||
|
/** No descriptions */
|
||||||
|
void setToggleGroups(int group1, int group2);
|
||||||
|
/** No descriptions */
|
||||||
|
void reconfigure();
|
||||||
|
/** Update the tray icon display for the given group */
|
||||||
|
void updateTrayIcon(int groupno);
|
||||||
|
signals:
|
||||||
|
void groupSelected(int groupno);
|
||||||
|
/** No descriptions */
|
||||||
|
void clicked();
|
||||||
|
/** No descriptions */
|
||||||
|
void preferencesSelected();
|
||||||
|
private slots: // Private slots
|
||||||
|
/** No descriptions */
|
||||||
|
void slotMenuActivated(int id);
|
||||||
|
/** Display help */
|
||||||
|
void slotHelp();
|
||||||
|
private: // Private attributes
|
||||||
|
/** */
|
||||||
|
KBConfig *m_kbconf;
|
||||||
|
protected: // Protected methods
|
||||||
|
/** No descriptions */
|
||||||
|
void mouseReleaseEvent(QMouseEvent *event);
|
||||||
|
public slots: // Public slots
|
||||||
|
/** No descriptions */
|
||||||
|
void slotAbout();
|
||||||
|
/** Update menu and tray icons after configuration has changed */
|
||||||
|
void slotUpdateIcons();
|
||||||
|
private: // Private methods
|
||||||
|
/** No descriptions */
|
||||||
|
void addLayoutItems(KPopupMenu *menu, bool clearOld);
|
||||||
|
/** No descriptions */
|
||||||
|
void updateMenuIcons();
|
||||||
|
/** No descriptions */
|
||||||
|
void setActiveGroup(int groupno);
|
||||||
|
};
|
||||||
|
|
||||||
|
#endif
|
@ -0,0 +1,19 @@
|
|||||||
|
[Desktop Entry]
|
||||||
|
Encoding=UTF-8
|
||||||
|
Type=Application
|
||||||
|
Name=KKBSwitch
|
||||||
|
Exec=kkbswitch -caption "%c" %i %m
|
||||||
|
MimeTypes=
|
||||||
|
Terminal=false
|
||||||
|
Icon=keyboard_layout.png
|
||||||
|
MiniIcon=keyboard_layout.png
|
||||||
|
DocPath=kkbswitch/index.html
|
||||||
|
Comment=Keyboard Layout Indicator
|
||||||
|
Comment[ru]=Индикатор раскладки клавиатуры
|
||||||
|
Comment[uk]=Індикатор розкладки клавіатури
|
||||||
|
Terminal=0
|
||||||
|
X-KDE-autostart-after=panel
|
||||||
|
X-KDE-autostart-condition=kkbswitchrc:Options:autostart:true
|
||||||
|
X-KDE-autostart-phase=2
|
||||||
|
X-KDE-StartupNotify=false
|
||||||
|
Categories=Qt;KDE;Utility;TrayIcon;
|
@ -0,0 +1,66 @@
|
|||||||
|
/***************************************************************************
|
||||||
|
main.cpp - description
|
||||||
|
-------------------
|
||||||
|
begin : Sun Jul 1 21:57:08 EEST 2001
|
||||||
|
copyright : (C) 2001 by Leonid Zeitlin
|
||||||
|
email : lz@europe.com
|
||||||
|
***************************************************************************/
|
||||||
|
|
||||||
|
/***************************************************************************
|
||||||
|
* *
|
||||||
|
* 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. *
|
||||||
|
* *
|
||||||
|
***************************************************************************/
|
||||||
|
|
||||||
|
#include <kcmdlineargs.h>
|
||||||
|
#include <kaboutdata.h>
|
||||||
|
#include <klocale.h>
|
||||||
|
#include <stdlib.h>
|
||||||
|
|
||||||
|
//#include "kkbswitch.h"
|
||||||
|
#include "kbswitchapp.h"
|
||||||
|
|
||||||
|
static const char *description =
|
||||||
|
I18N_NOOP("Keyboard Switch");
|
||||||
|
// INSERT A DESCRIPTION FOR YOUR APPLICATION HERE
|
||||||
|
|
||||||
|
|
||||||
|
static KCmdLineOptions options[] =
|
||||||
|
{
|
||||||
|
{ 0, 0, 0 }
|
||||||
|
// INSERT YOUR COMMANDLINE OPTIONS HERE
|
||||||
|
};
|
||||||
|
|
||||||
|
//extern "C" int kdemain(int argc, char *argv[])
|
||||||
|
int main(int argc, char *argv[])
|
||||||
|
{
|
||||||
|
|
||||||
|
KAboutData aboutData( "kkbswitch", I18N_NOOP("Keyboard Switch"),
|
||||||
|
VERSION, description, KAboutData::License_GPL,
|
||||||
|
"(c) 2001-2005 Leonid Zeitlin", 0, 0, "lz@europe.com");
|
||||||
|
aboutData.addAuthor("Leonid Zeitlin", I18N_NOOP("Creator and maintainer"), "lz@europe.com");
|
||||||
|
aboutData.addCredit("Mikhail Senin", I18N_NOOP("Default group config and per-window groups"),
|
||||||
|
"m_senin@mail.ru");
|
||||||
|
aboutData.addCredit("Rashid N. Achilov", I18N_NOOP("FreeBSD port, feature suggestions"), "achilov@granch.ru");
|
||||||
|
aboutData.addCredit("Vadim Kriklivy (K&K Analitic)", I18N_NOOP("Feature suggestions, Ukrainian translation"),
|
||||||
|
"analitic@vinnitsa.com");
|
||||||
|
aboutData.addCredit("Sergey V Turchin", I18N_NOOP("Autostart patch"),"zerg@altlinux.org");
|
||||||
|
aboutData.addCredit("Stergios Dramis", I18N_NOOP("Greek translation"), "sdramis@egnatia.ee.auth.gr");
|
||||||
|
aboutData.addCredit("Michal Sulek", I18N_NOOP("Slovak translation"), "reloadshot@atlas.sk");
|
||||||
|
KCmdLineArgs::init( argc, argv, &aboutData );
|
||||||
|
KCmdLineArgs::addCmdLineOptions( options ); // Add our own options.
|
||||||
|
|
||||||
|
if (!KUniqueApplication::start()) // starting a second instance - just exit
|
||||||
|
exit(0);
|
||||||
|
|
||||||
|
KBSwitchApp a;
|
||||||
|
#ifdef HAVE_LIBXKLAVIER
|
||||||
|
//XklStartListen();
|
||||||
|
#endif
|
||||||
|
if (XKeyboard::self()->xkbAvailable())
|
||||||
|
return a.exec();
|
||||||
|
else return -1;
|
||||||
|
}
|
@ -0,0 +1,28 @@
|
|||||||
|
/***************************************************************************
|
||||||
|
pathlistboxitem.cpp - description
|
||||||
|
-------------------
|
||||||
|
begin : ??? ??? 17 2004
|
||||||
|
copyright : (C) 2004 by Leonid Zeitlin
|
||||||
|
email : lz@europe.com
|
||||||
|
***************************************************************************/
|
||||||
|
|
||||||
|
/***************************************************************************
|
||||||
|
* *
|
||||||
|
* 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. *
|
||||||
|
* *
|
||||||
|
***************************************************************************/
|
||||||
|
|
||||||
|
#include "pathlistboxitem.h"
|
||||||
|
|
||||||
|
PathListBoxItem::PathListBoxItem(QListBox *listbox, const QPixmap &pix,
|
||||||
|
const QString &text, const QString &a_path) : QListBoxPixmap(listbox, pix, text),
|
||||||
|
path(a_path)
|
||||||
|
{
|
||||||
|
}
|
||||||
|
|
||||||
|
PathListBoxItem::~PathListBoxItem()
|
||||||
|
{
|
||||||
|
}
|
@ -0,0 +1,36 @@
|
|||||||
|
/***************************************************************************
|
||||||
|
pathlistboxitem.h - description
|
||||||
|
-------------------
|
||||||
|
begin : ??? ??? 17 2004
|
||||||
|
copyright : (C) 2004 by Leonid Zeitlin
|
||||||
|
email : lz@europe.com
|
||||||
|
***************************************************************************/
|
||||||
|
|
||||||
|
/***************************************************************************
|
||||||
|
* *
|
||||||
|
* 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. *
|
||||||
|
* *
|
||||||
|
***************************************************************************/
|
||||||
|
|
||||||
|
#ifndef PATHLISTBOXITEM_H
|
||||||
|
#define PATHLISTBOXITEM_H
|
||||||
|
|
||||||
|
#include <qlistbox.h>
|
||||||
|
#include <qstring.h>
|
||||||
|
|
||||||
|
/**
|
||||||
|
*@author Leonid Zeitlin
|
||||||
|
*/
|
||||||
|
|
||||||
|
class PathListBoxItem : public QListBoxPixmap {
|
||||||
|
public:
|
||||||
|
QString path;
|
||||||
|
PathListBoxItem(QListBox *listbox, const QPixmap &pix, const QString &text,
|
||||||
|
const QString &a_path);
|
||||||
|
~PathListBoxItem();
|
||||||
|
};
|
||||||
|
|
||||||
|
#endif
|
@ -0,0 +1,427 @@
|
|||||||
|
// Russian + Ukrainian keyboard
|
||||||
|
// Based on:
|
||||||
|
// russian standard keyboard
|
||||||
|
// AEN <aen@logic.ru>
|
||||||
|
// Last Changes 2001/12/23 by Leon Kanter <leon@blackcatlinux.com>
|
||||||
|
// $XFree86: xc/programs/xkbcomp/symbols/ru,v 3.8 2001/01/17 23:45:59 dawes Exp $
|
||||||
|
// and:
|
||||||
|
// ukrainian standard keyboard
|
||||||
|
// AEN <aen@logic.ru> & Leon Kanter <leon@geon.donetsk.ua>
|
||||||
|
// Last Changes 2001/12/11 by Andriy Rysin <arysin@yahoo.com>
|
||||||
|
// This keyboard layout has Russian characters at group 2 and Ukrainian
|
||||||
|
// at group 3.
|
||||||
|
// By Leonid Zeitlin <lz@europe.com>
|
||||||
|
// Last Changes 2002/11/09
|
||||||
|
|
||||||
|
|
||||||
|
partial default alphanumeric_keys
|
||||||
|
xkb_symbols "basic" {
|
||||||
|
|
||||||
|
// Describes the differences between a very simple en_US
|
||||||
|
// keyboard and a very simple Russian keyboard
|
||||||
|
|
||||||
|
name[Group1]= "US/ASCII";
|
||||||
|
name[Group2]= "Russian";
|
||||||
|
name[Group3]= "Ukrainian";
|
||||||
|
|
||||||
|
key <AE01> { [ 1, exclam ],
|
||||||
|
[ 1, exclam ] ,
|
||||||
|
[ 1, exclam ] };
|
||||||
|
key <AE02> { [ 2, at ],
|
||||||
|
[ 2, quotedbl ] ,
|
||||||
|
[ 2, quotedbl ] };
|
||||||
|
key <AE03> { [ 3, numbersign ],
|
||||||
|
[ 3, numbersign ] ,
|
||||||
|
[ 3, numbersign ] };
|
||||||
|
key <AE04> { [ 4, dollar ],
|
||||||
|
[ 4, asterisk ] ,
|
||||||
|
[ 4, asterisk ] };
|
||||||
|
key <AE05> { [ 5, percent ],
|
||||||
|
[ 5, colon ] ,
|
||||||
|
[ 5, colon ] };
|
||||||
|
key <AE06> { [ 6, asciicircum ],
|
||||||
|
[ 6, comma ] ,
|
||||||
|
[ 6, comma ] };
|
||||||
|
key <AE07> { [ 7, ampersand ],
|
||||||
|
[ 7, period ] ,
|
||||||
|
[ 7, period ] };
|
||||||
|
key <AE08> { [ 8, asterisk ],
|
||||||
|
[ 8, semicolon ] ,
|
||||||
|
[ 8, semicolon ] };
|
||||||
|
key <AE09> { [ 9, parenleft ],
|
||||||
|
[ 9, parenleft ] ,
|
||||||
|
[ 9, parenleft ] };
|
||||||
|
key <AE10> { [ 0, parenright ],
|
||||||
|
[ 0, parenright ] ,
|
||||||
|
[ 0, parenright ] };
|
||||||
|
key <AE11> { [ minus, underscore ],
|
||||||
|
[ minus, underscore ] ,
|
||||||
|
[ minus, underscore ] };
|
||||||
|
key <AE12> { [ equal, plus ],
|
||||||
|
[ equal, plus ] ,
|
||||||
|
[ equal, plus ] };
|
||||||
|
key <BKSL> { [ backslash, bar ],
|
||||||
|
[ backslash, bar ] ,
|
||||||
|
[Ukrainian_ghe_with_upturn,Ukrainian_GHE_WITH_UPTURN]};
|
||||||
|
key <AB10> { [ slash, question ],
|
||||||
|
[ slash, question ] ,
|
||||||
|
[ slash, question ] };
|
||||||
|
key <LSGT> { [ less, greater ],
|
||||||
|
[ slash, bar ] ,
|
||||||
|
[ slash, bar ] };
|
||||||
|
|
||||||
|
key.type[group2]="ALPHABETIC";
|
||||||
|
key.type[group3]="ALPHABETIC";
|
||||||
|
|
||||||
|
key <TLDE> { [ grave, asciitilde ],
|
||||||
|
[ Cyrillic_io, Cyrillic_IO ] ,
|
||||||
|
[ apostrophe, asciitilde ] };
|
||||||
|
key <AD01> { [ q, Q ],
|
||||||
|
[ Cyrillic_shorti, Cyrillic_SHORTI ] ,
|
||||||
|
[ Cyrillic_shorti, Cyrillic_SHORTI ] };
|
||||||
|
key <AD02> { [ w, W ],
|
||||||
|
[ Cyrillic_tse, Cyrillic_TSE ] ,
|
||||||
|
[ Cyrillic_tse, Cyrillic_TSE ] };
|
||||||
|
key <AD03> { [ e, E ],
|
||||||
|
[ Cyrillic_u, Cyrillic_U ] ,
|
||||||
|
[ Cyrillic_u, Cyrillic_U ] };
|
||||||
|
key <AD04> { [ r, R ],
|
||||||
|
[ Cyrillic_ka, Cyrillic_KA ] ,
|
||||||
|
[ Cyrillic_ka, Cyrillic_KA ] };
|
||||||
|
key <AD05> { [ t, T ],
|
||||||
|
[ Cyrillic_ie, Cyrillic_IE ] ,
|
||||||
|
[ Cyrillic_ie, Cyrillic_IE ] };
|
||||||
|
key <AD06> { [ y, Y ],
|
||||||
|
[ Cyrillic_en, Cyrillic_EN ] ,
|
||||||
|
[ Cyrillic_en, Cyrillic_EN ] };
|
||||||
|
key <AD07> { [ u, U ],
|
||||||
|
[ Cyrillic_ghe, Cyrillic_GHE ] ,
|
||||||
|
[ Cyrillic_ghe, Cyrillic_GHE ] };
|
||||||
|
key <AD08> { [ i, I ],
|
||||||
|
[ Cyrillic_sha, Cyrillic_SHA ] ,
|
||||||
|
[ Cyrillic_sha, Cyrillic_SHA ] };
|
||||||
|
key <AD09> { [ o, O ],
|
||||||
|
[ Cyrillic_shcha, Cyrillic_SHCHA ] ,
|
||||||
|
[ Cyrillic_shcha, Cyrillic_SHCHA ] };
|
||||||
|
key <AD10> { [ p, P ],
|
||||||
|
[ Cyrillic_ze, Cyrillic_ZE ] ,
|
||||||
|
[ Cyrillic_ze, Cyrillic_ZE ] };
|
||||||
|
key <AD11> { [ bracketleft, braceleft ],
|
||||||
|
[ Cyrillic_ha, Cyrillic_HA ] ,
|
||||||
|
[ Cyrillic_ha, Cyrillic_HA ] };
|
||||||
|
key <AD12> { [ bracketright, braceright ],
|
||||||
|
[Cyrillic_hardsign,Cyrillic_HARDSIGN ] ,
|
||||||
|
[ Ukrainian_yi, Ukrainian_YI ] };
|
||||||
|
key <AC01> { [ a, A ],
|
||||||
|
[ Cyrillic_ef, Cyrillic_EF ] ,
|
||||||
|
[ Cyrillic_ef, Cyrillic_EF ] };
|
||||||
|
key <AC02> { [ s, S ],
|
||||||
|
[ Cyrillic_yeru, Cyrillic_YERU ] ,
|
||||||
|
[ Ukrainian_i, Ukrainian_I ] };
|
||||||
|
key <AC03> { [ d, D ],
|
||||||
|
[ Cyrillic_ve, Cyrillic_VE ] ,
|
||||||
|
[ Cyrillic_ve, Cyrillic_VE ] };
|
||||||
|
key <AC04> { [ f, F ],
|
||||||
|
[ Cyrillic_a, Cyrillic_A ] ,
|
||||||
|
[ Cyrillic_a, Cyrillic_A ] };
|
||||||
|
key <AC05> { [ g, G ],
|
||||||
|
[ Cyrillic_pe, Cyrillic_PE ] ,
|
||||||
|
[ Cyrillic_pe, Cyrillic_PE ] };
|
||||||
|
key <AC06> { [ h, H ],
|
||||||
|
[ Cyrillic_er, Cyrillic_ER ] ,
|
||||||
|
[ Cyrillic_er, Cyrillic_ER ] };
|
||||||
|
key <AC07> { [ j, J ],
|
||||||
|
[ Cyrillic_o, Cyrillic_O ] ,
|
||||||
|
[ Cyrillic_o, Cyrillic_O ] };
|
||||||
|
key <AC08> { [ k, K ],
|
||||||
|
[ Cyrillic_el, Cyrillic_EL ] ,
|
||||||
|
[ Cyrillic_el, Cyrillic_EL ] };
|
||||||
|
key <AC09> { [ l, L ],
|
||||||
|
[ Cyrillic_de, Cyrillic_DE ] ,
|
||||||
|
[ Cyrillic_de, Cyrillic_DE ] };
|
||||||
|
key <AC10> { [ semicolon, colon ],
|
||||||
|
[ Cyrillic_zhe, Cyrillic_ZHE ] ,
|
||||||
|
[ Cyrillic_zhe, Cyrillic_ZHE ] };
|
||||||
|
key <AC11> { [ apostrophe, quotedbl ],
|
||||||
|
[ Cyrillic_e, Cyrillic_E ] ,
|
||||||
|
[ Ukrainian_ie, Ukrainian_IE ] };
|
||||||
|
key <AB01> { [ z, Z ],
|
||||||
|
[ Cyrillic_ya, Cyrillic_YA ] ,
|
||||||
|
[ Cyrillic_ya, Cyrillic_YA ] };
|
||||||
|
key <AB02> { [ x, X ],
|
||||||
|
[ Cyrillic_che, Cyrillic_CHE ] ,
|
||||||
|
[ Cyrillic_che, Cyrillic_CHE ] };
|
||||||
|
key <AB03> { [ c, C ],
|
||||||
|
[ Cyrillic_es, Cyrillic_ES ] ,
|
||||||
|
[ Cyrillic_es, Cyrillic_ES ] };
|
||||||
|
key <AB04> { [ v, V ],
|
||||||
|
[ Cyrillic_em, Cyrillic_EM ] ,
|
||||||
|
[ Cyrillic_em, Cyrillic_EM ] };
|
||||||
|
key <AB06> { [ n, N ],
|
||||||
|
[ Cyrillic_te, Cyrillic_TE ] ,
|
||||||
|
[ Cyrillic_te, Cyrillic_TE ] };
|
||||||
|
key <AB05> { [ b, B ],
|
||||||
|
[ Cyrillic_i, Cyrillic_I ] ,
|
||||||
|
[ Cyrillic_i, Cyrillic_I ] };
|
||||||
|
key <AB07> { [ m, M ],
|
||||||
|
[Cyrillic_softsign,Cyrillic_SOFTSIGN ] ,
|
||||||
|
[Cyrillic_softsign,Cyrillic_SOFTSIGN ] };
|
||||||
|
key <AB08> { [ comma, less ],
|
||||||
|
[ Cyrillic_be, Cyrillic_BE ] ,
|
||||||
|
[ Cyrillic_be, Cyrillic_BE ] };
|
||||||
|
key <AB09> { [ period, greater ],
|
||||||
|
[ Cyrillic_yu, Cyrillic_YU ] ,
|
||||||
|
[ Cyrillic_yu, Cyrillic_YU ] };
|
||||||
|
|
||||||
|
key.type[group2]="TWO_LEVEL";
|
||||||
|
key.type[group3]="TWO_LEVEL";
|
||||||
|
|
||||||
|
// End alphanumeric section
|
||||||
|
|
||||||
|
// Begin modifier mappings
|
||||||
|
|
||||||
|
modifier_map Shift { Shift_L };
|
||||||
|
modifier_map Lock { Caps_Lock, ISO_Lock };
|
||||||
|
modifier_map Control{ Control_L };
|
||||||
|
modifier_map Mod3 { Mode_switch };
|
||||||
|
};
|
||||||
|
|
||||||
|
partial alphanumeric_keys
|
||||||
|
xkb_symbols "winkeys" {
|
||||||
|
include "ru_ua(basic)"
|
||||||
|
key <AE03> { [ 3, numbersign ],
|
||||||
|
[ 3, numerosign ] ,
|
||||||
|
[ 3, numerosign ] };
|
||||||
|
key <AE04> { [ 4, dollar ],
|
||||||
|
[ 4, semicolon ] ,
|
||||||
|
[ 4, semicolon ] };
|
||||||
|
key <AE05> { [ 5, percent ],
|
||||||
|
[ 5, percent ] ,
|
||||||
|
[ 5, percent ] };
|
||||||
|
key <AE06> { [ 6, asciicircum ],
|
||||||
|
[ 6, colon ] ,
|
||||||
|
[ 6, colon ] };
|
||||||
|
key <AE07> { [ 7, ampersand ],
|
||||||
|
[ 7, question ] ,
|
||||||
|
[ 7, question ] };
|
||||||
|
key <AE08> { [ 8, asterisk ],
|
||||||
|
[ 8, asterisk ] ,
|
||||||
|
[ 8, asterisk ] };
|
||||||
|
key <AB10> { [ slash, question ],
|
||||||
|
[ period, comma ] ,
|
||||||
|
[ period, comma ] };
|
||||||
|
};
|
||||||
|
|
||||||
|
partial alphanumeric_keys
|
||||||
|
xkb_symbols "typewriter" {
|
||||||
|
include "ru_ua(basic)"
|
||||||
|
key <TLDE> { [ grave, asciitilde ],
|
||||||
|
[ apostrophe, quotedbl ] ,
|
||||||
|
[ apostrophe, quotedbl ] };
|
||||||
|
key <AE01> { [ 1, exclam ],
|
||||||
|
[ exclam, 1 ] ,
|
||||||
|
[ exclam, 1 ] };
|
||||||
|
key <AE02> { [ 2, at ],
|
||||||
|
[ numerosign, 2 ] ,
|
||||||
|
[ numerosign, 2 ] };
|
||||||
|
key <AE03> { [ 3, numbersign ],
|
||||||
|
[ slash, 3 ] ,
|
||||||
|
[ slash, 3 ] };
|
||||||
|
key <AE04> { [ 4, dollar ],
|
||||||
|
[ semicolon, 4 ] ,
|
||||||
|
[ semicolon, 4 ] };
|
||||||
|
key <AE05> { [ 5, percent ],
|
||||||
|
[ colon, 5 ] ,
|
||||||
|
[ colon, 5 ] };
|
||||||
|
key <AE06> { [ 6, asciicircum ],
|
||||||
|
[ comma, 6 ] ,
|
||||||
|
[ comma, 6 ] };
|
||||||
|
key <AE07> { [ 7, ampersand ],
|
||||||
|
[ period, 7 ] ,
|
||||||
|
[ period, 7 ] };
|
||||||
|
key <AE08> { [ 8, asterisk ],
|
||||||
|
[ underscore, 8 ] ,
|
||||||
|
[ underscore, 8 ] };
|
||||||
|
key <AE09> { [ 9, parenleft ],
|
||||||
|
[ question, 9 ] ,
|
||||||
|
[ question, 9 ] };
|
||||||
|
key <AE10> { [ 0, parenright ],
|
||||||
|
[ percent, 0 ] ,
|
||||||
|
[ percent, 0 ] };
|
||||||
|
key <BKSL> { [ backslash, bar ],
|
||||||
|
[ parenleft, parenright ] ,
|
||||||
|
[ parenleft, parenright ] };
|
||||||
|
|
||||||
|
key.type[group2]="ALPHABETIC";
|
||||||
|
key.type[group3]="ALPHABETIC";
|
||||||
|
|
||||||
|
key <AD12> { [ bracketright, braceright ],
|
||||||
|
[Cyrillic_hardsign,Cyrillic_HARDSIGN ] ,
|
||||||
|
[Ukrainian_yi, Ukrainian_YI ] };
|
||||||
|
key <AB05> { [ b, B ],
|
||||||
|
[ Cyrillic_i, Cyrillic_I ] ,
|
||||||
|
[ Cyrillic_i, Cyrillic_I ] };
|
||||||
|
key <AB10> { [ slash, question ],
|
||||||
|
[ Cyrillic_io, Cyrillic_IO ] ,
|
||||||
|
[ Cyrillic_io, Cyrillic_IO ] };
|
||||||
|
};
|
||||||
|
|
||||||
|
partial alphanumeric_keys
|
||||||
|
xkb_symbols "phonetic" {
|
||||||
|
include "ru_ua(basic)"
|
||||||
|
|
||||||
|
key <AE01> { [ 1, exclam ],
|
||||||
|
[ 1, exclam ] ,
|
||||||
|
[ 1, exclam ] };
|
||||||
|
key <AE02> { [ 2, at ],
|
||||||
|
[ 2, at ] ,
|
||||||
|
[ 2, at ] };
|
||||||
|
key <AE03> { [ 3, numbersign ],
|
||||||
|
[ 3, Cyrillic_io ] ,
|
||||||
|
[ 3, Cyrillic_io ] };
|
||||||
|
key <AE04> { [ 4, dollar ],
|
||||||
|
[ 4, Cyrillic_IO ] ,
|
||||||
|
[ 4, Cyrillic_IO ] };
|
||||||
|
key <AE05> { [ 5, percent ],
|
||||||
|
[ 5, percent ] ,
|
||||||
|
[ 5, percent ] };
|
||||||
|
key <AE06> { [ 6, asciicircum ],
|
||||||
|
[ 6, asciicircum ] ,
|
||||||
|
[ 6, asciicircum ] };
|
||||||
|
key <AE07> { [ 7, ampersand ],
|
||||||
|
[ 7, ampersand ] ,
|
||||||
|
[ 7, ampersand ] };
|
||||||
|
key <AE08> { [ 8, asterisk ],
|
||||||
|
[ 8, asterisk ] ,
|
||||||
|
[ 8, asterisk ] };
|
||||||
|
key <AE09> { [ 9, parenleft ],
|
||||||
|
[ 9, parenleft ] ,
|
||||||
|
[ 9, parenleft ] };
|
||||||
|
key <AE10> { [ 0, parenright ],
|
||||||
|
[ 0, parenright ] ,
|
||||||
|
[ 0, parenright ] };
|
||||||
|
|
||||||
|
key <AB09> { [ period, greater ],
|
||||||
|
[ period, greater ] ,
|
||||||
|
[ period, greater ] };
|
||||||
|
key <AB10> { [ slash, question ],
|
||||||
|
[ slash, question ] ,
|
||||||
|
[ slash, question ] };
|
||||||
|
key <AB08> { [ comma, less ],
|
||||||
|
[ comma, less ] ,
|
||||||
|
[ comma, less ] };
|
||||||
|
key <AC10> { [ semicolon, colon ],
|
||||||
|
[ semicolon, colon ] ,
|
||||||
|
[ semicolon, colon ] };
|
||||||
|
key <AC11> { [ apostrophe, quotedbl ],
|
||||||
|
[ apostrophe, quotedbl ] ,
|
||||||
|
[ apostrophe, quotedbl ] };
|
||||||
|
key <LSGT> { [ less, greater ],
|
||||||
|
[ bar, brokenbar ] ,
|
||||||
|
[ bar, brokenbar ] };
|
||||||
|
|
||||||
|
key.type[group2]="ALPHABETIC";
|
||||||
|
key.type[group2]="ALPHABETIC";
|
||||||
|
|
||||||
|
key <TLDE> { [ grave, asciitilde ],
|
||||||
|
[ Cyrillic_yu, Cyrillic_YU ] ,
|
||||||
|
[ Cyrillic_yu, Cyrillic_YU ] };
|
||||||
|
key <AD01> { [ q, Q ],
|
||||||
|
[ Cyrillic_ya, Cyrillic_YA ] ,
|
||||||
|
[ Cyrillic_ya, Cyrillic_YA ] };
|
||||||
|
key <AB01> { [ z, Z ],
|
||||||
|
[ Cyrillic_ze, Cyrillic_ZE ] ,
|
||||||
|
[ Cyrillic_ze, Cyrillic_ZE ] };
|
||||||
|
key <AC02> { [ s, S ],
|
||||||
|
[ Cyrillic_es, Cyrillic_ES ] ,
|
||||||
|
[ Cyrillic_es, Cyrillic_ES ] };
|
||||||
|
key <AC01> { [ a, A ],
|
||||||
|
[ Cyrillic_a, Cyrillic_A ] ,
|
||||||
|
[ Cyrillic_a, Cyrillic_A ] };
|
||||||
|
key <AD02> { [ w, W ],
|
||||||
|
[ Cyrillic_ve, Cyrillic_VE ] ,
|
||||||
|
[ Cyrillic_ve, Cyrillic_VE ] };
|
||||||
|
key <AB03> { [ c, C ],
|
||||||
|
[ Cyrillic_tse, Cyrillic_TSE ] ,
|
||||||
|
[ Cyrillic_tse, Cyrillic_TSE ] };
|
||||||
|
key <AB02> { [ x, X ],
|
||||||
|
[Cyrillic_softsign,Cyrillic_SOFTSIGN ] ,
|
||||||
|
[Cyrillic_softsign,Cyrillic_SOFTSIGN ] };
|
||||||
|
key <AC03> { [ d, D ],
|
||||||
|
[ Cyrillic_de, Cyrillic_DE ] ,
|
||||||
|
[ Cyrillic_de, Cyrillic_DE ] };
|
||||||
|
key <AD03> { [ e, E ],
|
||||||
|
[ Cyrillic_ie, Cyrillic_IE ] ,
|
||||||
|
[ Cyrillic_ie, Cyrillic_IE ] };
|
||||||
|
key <AB04> { [ v, V ],
|
||||||
|
[ Cyrillic_zhe, Cyrillic_ZHE ] ,
|
||||||
|
[ Cyrillic_zhe, Cyrillic_ZHE ] };
|
||||||
|
key <AC04> { [ f, F ],
|
||||||
|
[ Cyrillic_ef, Cyrillic_EF ] ,
|
||||||
|
[ Cyrillic_ef, Cyrillic_EF ] };
|
||||||
|
key <AD05> { [ t, T ],
|
||||||
|
[ Cyrillic_te, Cyrillic_TE ] ,
|
||||||
|
[ Cyrillic_te, Cyrillic_TE ] };
|
||||||
|
key <AD04> { [ r, R ],
|
||||||
|
[ Cyrillic_er, Cyrillic_ER ] ,
|
||||||
|
[ Cyrillic_er, Cyrillic_ER ] };
|
||||||
|
key <AB06> { [ n, N ],
|
||||||
|
[ Cyrillic_en, Cyrillic_EN ] ,
|
||||||
|
[ Cyrillic_en, Cyrillic_EN ] };
|
||||||
|
key <AB05> { [ b, B ],
|
||||||
|
[ Cyrillic_be, Cyrillic_BE ] ,
|
||||||
|
[ Cyrillic_be, Cyrillic_BE ] };
|
||||||
|
key <AC06> { [ h, H ],
|
||||||
|
[ Cyrillic_ha, Cyrillic_HA ] ,
|
||||||
|
[ Cyrillic_ha, Cyrillic_HA ] };
|
||||||
|
key <AC05> { [ g, G ],
|
||||||
|
[ Cyrillic_ghe, Cyrillic_GHE ] ,
|
||||||
|
[ Cyrillic_ghe, Cyrillic_GHE ] };
|
||||||
|
key <AD06> { [ y, Y ],
|
||||||
|
[ Cyrillic_yeru, Cyrillic_YERU ] ,
|
||||||
|
[ Cyrillic_yeru, Cyrillic_YERU ] };
|
||||||
|
key <AB07> { [ m, M ],
|
||||||
|
[ Cyrillic_em, Cyrillic_EM ] ,
|
||||||
|
[ Cyrillic_em, Cyrillic_EM ] };
|
||||||
|
key <AC07> { [ j, J ],
|
||||||
|
[ Cyrillic_shorti, Cyrillic_SHORTI ] ,
|
||||||
|
[ Cyrillic_shorti, Cyrillic_SHORTI ] };
|
||||||
|
key <AD07> { [ u, U ],
|
||||||
|
[ Cyrillic_u, Cyrillic_U ] ,
|
||||||
|
[ Cyrillic_u, Cyrillic_U ] };
|
||||||
|
key <AC08> { [ k, K ],
|
||||||
|
[ Cyrillic_ka, Cyrillic_KA ] ,
|
||||||
|
[ Cyrillic_ka, Cyrillic_KA ] };
|
||||||
|
key <AD08> { [ i, I ],
|
||||||
|
[ Cyrillic_i, Cyrillic_I ] ,
|
||||||
|
[ Cyrillic_i, Cyrillic_I ] };
|
||||||
|
key <AD09> { [ o, O ],
|
||||||
|
[ Cyrillic_o, Cyrillic_O ] ,
|
||||||
|
[ Cyrillic_o, Cyrillic_O ] };
|
||||||
|
key <AC09> { [ l, L ],
|
||||||
|
[ Cyrillic_el, Cyrillic_EL ] ,
|
||||||
|
[ Cyrillic_el, Cyrillic_EL ] };
|
||||||
|
key <AD10> { [ p, P ],
|
||||||
|
[ Cyrillic_pe, Cyrillic_PE ] ,
|
||||||
|
[ Cyrillic_pe, Cyrillic_PE ] };
|
||||||
|
key <AE11> { [ minus, underscore ],
|
||||||
|
[ minus, Cyrillic_hardsign ] ,
|
||||||
|
[ minus, Cyrillic_hardsign ] };
|
||||||
|
key <AD11> { [ bracketleft, braceleft ],
|
||||||
|
[ Cyrillic_sha, Cyrillic_SHA ] ,
|
||||||
|
[ Cyrillic_sha, Cyrillic_SHA ] };
|
||||||
|
key <AE12> { [ equal, plus ],
|
||||||
|
[ Cyrillic_che, Cyrillic_CHE ] ,
|
||||||
|
[ Cyrillic_che, Cyrillic_CHE ] };
|
||||||
|
key <AD12> { [ bracketright, braceright ],
|
||||||
|
[ Cyrillic_shcha, Cyrillic_SHCHA ] ,
|
||||||
|
[ Cyrillic_shcha, Cyrillic_SHCHA ] };
|
||||||
|
key <BKSL> { [ backslash, bar ],
|
||||||
|
[ Cyrillic_e, Cyrillic_E ] ,
|
||||||
|
[ Cyrillic_e, Cyrillic_E ] };
|
||||||
|
|
||||||
|
modifier_map Shift { Shift_L };
|
||||||
|
modifier_map Lock { Caps_Lock, ISO_Lock };
|
||||||
|
modifier_map Control{ Control_L };
|
||||||
|
modifier_map Mod3 { Mode_switch };
|
||||||
|
};
|
@ -0,0 +1,73 @@
|
|||||||
|
/***************************************************************************
|
||||||
|
* Copyright (C) 2004 by Leonid Zeitlin *
|
||||||
|
* lz@europe.com *
|
||||||
|
* *
|
||||||
|
* This program is free software; you can redistribute it and/or modify *
|
||||||
|
* it under the terms of the GNU General Public License as published by *
|
||||||
|
* the Free Software Foundation; either version 2 of the License, or *
|
||||||
|
* (at your option) any later version. *
|
||||||
|
* *
|
||||||
|
* This program is distributed in the hope that it will be useful, *
|
||||||
|
* but WITHOUT ANY WARRANTY; without even the implied warranty of *
|
||||||
|
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the *
|
||||||
|
* GNU General Public License for more details. *
|
||||||
|
* *
|
||||||
|
* You should have received a copy of the GNU General Public License *
|
||||||
|
* along with this program; if not, write to the *
|
||||||
|
* Free Software Foundation, Inc., *
|
||||||
|
* 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. *
|
||||||
|
***************************************************************************/
|
||||||
|
#include "singlewindowwatcher.h"
|
||||||
|
#include "kbconfig.h"
|
||||||
|
|
||||||
|
#include <kwinmodule.h>
|
||||||
|
#include <kdebug.h>
|
||||||
|
|
||||||
|
SingleWindowWatcher::SingleWindowWatcher(KBConfig *kbconf, QObject *parent, const char *name)
|
||||||
|
: WindowWatcher(kbconf, parent, name)
|
||||||
|
{
|
||||||
|
reset();
|
||||||
|
}
|
||||||
|
|
||||||
|
SingleWindowWatcher::~SingleWindowWatcher()
|
||||||
|
{
|
||||||
|
}
|
||||||
|
|
||||||
|
void SingleWindowWatcher::windowRemoved(WId id)
|
||||||
|
{
|
||||||
|
m_window_map.remove(id);
|
||||||
|
}
|
||||||
|
|
||||||
|
void SingleWindowWatcher::activeWindowChanged(WId id)
|
||||||
|
{
|
||||||
|
if (id == 0) return; // no window is active
|
||||||
|
m_active_window = m_window_map.find(id);
|
||||||
|
if (m_active_window == m_window_map.end())
|
||||||
|
addWindowToMap(id);
|
||||||
|
emit windowChanged(m_active_window.data().groupno, m_active_window.data().next_groupno);
|
||||||
|
}
|
||||||
|
|
||||||
|
void SingleWindowWatcher::addWindowToMap(WId window_id)
|
||||||
|
{
|
||||||
|
KBWinInfo wininfo = { m_kbconf->default_groupno(),
|
||||||
|
m_kbconf->getNextGroup(m_kbconf->default_groupno()) };
|
||||||
|
|
||||||
|
m_active_window = m_window_map.insert(window_id, wininfo);
|
||||||
|
}
|
||||||
|
|
||||||
|
void SingleWindowWatcher::changeGroup(int groupno, int next_groupno)
|
||||||
|
{
|
||||||
|
if (m_active_window != m_window_map.end()) {
|
||||||
|
m_active_window.data().groupno = groupno;
|
||||||
|
m_active_window.data().next_groupno = next_groupno;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
void SingleWindowWatcher::reset()
|
||||||
|
{
|
||||||
|
m_window_map.clear();
|
||||||
|
WId active_window = m_kwin_module->activeWindow();
|
||||||
|
if (active_window)
|
||||||
|
addWindowToMap(active_window);
|
||||||
|
else m_active_window = m_window_map.end();
|
||||||
|
}
|
@ -0,0 +1,53 @@
|
|||||||
|
/***************************************************************************
|
||||||
|
* Copyright (C) 2004 by Leonid Zeitlin *
|
||||||
|
* lz@europe.com *
|
||||||
|
* *
|
||||||
|
* This program is free software; you can redistribute it and/or modify *
|
||||||
|
* it under the terms of the GNU General Public License as published by *
|
||||||
|
* the Free Software Foundation; either version 2 of the License, or *
|
||||||
|
* (at your option) any later version. *
|
||||||
|
* *
|
||||||
|
* This program is distributed in the hope that it will be useful, *
|
||||||
|
* but WITHOUT ANY WARRANTY; without even the implied warranty of *
|
||||||
|
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the *
|
||||||
|
* GNU General Public License for more details. *
|
||||||
|
* *
|
||||||
|
* You should have received a copy of the GNU General Public License *
|
||||||
|
* along with this program; if not, write to the *
|
||||||
|
* Free Software Foundation, Inc., *
|
||||||
|
* 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. *
|
||||||
|
***************************************************************************/
|
||||||
|
#ifndef SINGLEWINDOWWATCHER_H
|
||||||
|
#define SINGLEWINDOWWATCHER_H
|
||||||
|
|
||||||
|
#include "windowwatcher.h"
|
||||||
|
#include <qmap.h>
|
||||||
|
|
||||||
|
/**
|
||||||
|
Watches for changes of active window and keep a group per each window
|
||||||
|
|
||||||
|
@author Leonid Zeitlin
|
||||||
|
*/
|
||||||
|
class SingleWindowWatcher : public WindowWatcher {
|
||||||
|
Q_OBJECT
|
||||||
|
private:
|
||||||
|
struct KBWinInfo {
|
||||||
|
int groupno;
|
||||||
|
int next_groupno;
|
||||||
|
};
|
||||||
|
typedef QMap<WId, KBWinInfo> KBWindowMap;
|
||||||
|
KBWindowMap m_window_map;
|
||||||
|
KBWindowMap::iterator m_active_window;
|
||||||
|
void addWindowToMap(WId window_id);
|
||||||
|
protected:
|
||||||
|
virtual void windowAdded(WId /* id */) { /* do nothing */ }
|
||||||
|
virtual void windowRemoved(WId id);
|
||||||
|
virtual void activeWindowChanged(WId id);
|
||||||
|
public:
|
||||||
|
SingleWindowWatcher(KBConfig *kbconf, QObject *parent = 0, const char *name = 0);
|
||||||
|
~SingleWindowWatcher();
|
||||||
|
virtual void changeGroup(int groupno, int next_groupno);
|
||||||
|
virtual void reset();
|
||||||
|
};
|
||||||
|
|
||||||
|
#endif
|
@ -0,0 +1,106 @@
|
|||||||
|
/***************************************************************************
|
||||||
|
* Copyright (C) 2004 by Leonid Zeitlin *
|
||||||
|
* lz@europe.com *
|
||||||
|
* *
|
||||||
|
* This program is free software; you can redistribute it and/or modify *
|
||||||
|
* it under the terms of the GNU General Public License as published by *
|
||||||
|
* the Free Software Foundation; either version 2 of the License, or *
|
||||||
|
* (at your option) any later version. *
|
||||||
|
* *
|
||||||
|
* This program is distributed in the hope that it will be useful, *
|
||||||
|
* but WITHOUT ANY WARRANTY; without even the implied warranty of *
|
||||||
|
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the *
|
||||||
|
* GNU General Public License for more details. *
|
||||||
|
* *
|
||||||
|
* You should have received a copy of the GNU General Public License *
|
||||||
|
* along with this program; if not, write to the *
|
||||||
|
* Free Software Foundation, Inc., *
|
||||||
|
* 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. *
|
||||||
|
***************************************************************************/
|
||||||
|
#include "windowclasswatcher.h"
|
||||||
|
#include "kbconfig.h"
|
||||||
|
|
||||||
|
#include <kwinmodule.h>
|
||||||
|
#include <kdebug.h>
|
||||||
|
|
||||||
|
#include <X11/Xutil.h>
|
||||||
|
|
||||||
|
WindowClassWatcher::WindowClassWatcher(KBConfig *kbconf, QObject *parent, const char *name)
|
||||||
|
: WindowWatcher(kbconf, parent, name)
|
||||||
|
{
|
||||||
|
reset();
|
||||||
|
}
|
||||||
|
|
||||||
|
WindowClassWatcher::~WindowClassWatcher()
|
||||||
|
{
|
||||||
|
}
|
||||||
|
|
||||||
|
QString WindowClassWatcher::getWindowClass(WId id)
|
||||||
|
{
|
||||||
|
XClassHint hint;
|
||||||
|
QString ret = QString::null;
|
||||||
|
|
||||||
|
if (XGetClassHint(qt_xdisplay(), id, &hint)) {
|
||||||
|
ret = hint.res_class;
|
||||||
|
XFree(hint.res_name);
|
||||||
|
XFree(hint.res_class);
|
||||||
|
}
|
||||||
|
return ret;
|
||||||
|
}
|
||||||
|
|
||||||
|
void WindowClassWatcher::windowAdded(WId id)
|
||||||
|
{
|
||||||
|
QString wclass = getWindowClass(id);
|
||||||
|
KBClassInfo &info = m_class_group_map[wclass];
|
||||||
|
if (info.refcount == 0) {
|
||||||
|
// new class
|
||||||
|
info.groupno = m_kbconf->default_groupno();
|
||||||
|
info.next_groupno = m_kbconf->getNextGroup(m_kbconf->default_groupno());
|
||||||
|
}
|
||||||
|
info.refcount++;
|
||||||
|
m_win_class_map.insert(id, wclass);
|
||||||
|
}
|
||||||
|
|
||||||
|
void WindowClassWatcher::windowRemoved(WId id)
|
||||||
|
{
|
||||||
|
ClassGroupMap::Iterator iter = m_class_group_map.find(m_win_class_map[id]);
|
||||||
|
if (iter != m_class_group_map.end()) {
|
||||||
|
iter.data().refcount--;
|
||||||
|
if (iter.data().refcount <= 0) m_class_group_map.remove(iter);
|
||||||
|
}
|
||||||
|
m_win_class_map.remove(id);
|
||||||
|
}
|
||||||
|
|
||||||
|
void WindowClassWatcher::activeWindowChanged(WId id)
|
||||||
|
{
|
||||||
|
if (id == 0) return; // no window is active
|
||||||
|
m_active_class = m_class_group_map.find(m_win_class_map[id]);
|
||||||
|
if (m_active_class != m_class_group_map.end())
|
||||||
|
emit windowChanged(m_active_class.data().groupno, m_active_class.data().next_groupno);
|
||||||
|
}
|
||||||
|
|
||||||
|
void WindowClassWatcher::changeGroup(int groupno, int next_groupno)
|
||||||
|
{
|
||||||
|
if (m_active_class != m_class_group_map.end()) {
|
||||||
|
m_active_class.data().groupno = groupno;
|
||||||
|
m_active_class.data().next_groupno = next_groupno;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
void WindowClassWatcher::reset()
|
||||||
|
{
|
||||||
|
m_win_class_map.clear();
|
||||||
|
m_class_group_map.clear();
|
||||||
|
|
||||||
|
// fill the map with existing windows
|
||||||
|
const QValueList<WId> windows = m_kwin_module->windows();
|
||||||
|
const QValueList<WId>::ConstIterator end = windows.end();
|
||||||
|
for (QValueList<WId>::ConstIterator it = windows.begin(); it != end; ++it)
|
||||||
|
windowAdded(*it);
|
||||||
|
|
||||||
|
WId active_window = m_kwin_module->activeWindow();
|
||||||
|
if (active_window)
|
||||||
|
m_active_class = m_class_group_map.find(m_win_class_map[active_window]);
|
||||||
|
else m_active_class = m_class_group_map.end();
|
||||||
|
}
|
||||||
|
|
@ -0,0 +1,59 @@
|
|||||||
|
/***************************************************************************
|
||||||
|
* Copyright (C) 2004 by Leonid Zeitlin *
|
||||||
|
* lz@europe.com *
|
||||||
|
* *
|
||||||
|
* This program is free software; you can redistribute it and/or modify *
|
||||||
|
* it under the terms of the GNU General Public License as published by *
|
||||||
|
* the Free Software Foundation; either version 2 of the License, or *
|
||||||
|
* (at your option) any later version. *
|
||||||
|
* *
|
||||||
|
* This program is distributed in the hope that it will be useful, *
|
||||||
|
* but WITHOUT ANY WARRANTY; without even the implied warranty of *
|
||||||
|
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the *
|
||||||
|
* GNU General Public License for more details. *
|
||||||
|
* *
|
||||||
|
* You should have received a copy of the GNU General Public License *
|
||||||
|
* along with this program; if not, write to the *
|
||||||
|
* Free Software Foundation, Inc., *
|
||||||
|
* 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. *
|
||||||
|
***************************************************************************/
|
||||||
|
#ifndef WINDOWCLASSWATCHER_H
|
||||||
|
#define WINDOWCLASSWATCHER_H
|
||||||
|
|
||||||
|
#include "windowwatcher.h"
|
||||||
|
#include <qmap.h>
|
||||||
|
|
||||||
|
class QString;
|
||||||
|
|
||||||
|
/**
|
||||||
|
This class watcher for active window changes and keeps a group per window class
|
||||||
|
|
||||||
|
@author Leonid Zeitlin
|
||||||
|
*/
|
||||||
|
class WindowClassWatcher : public WindowWatcher {
|
||||||
|
Q_OBJECT
|
||||||
|
private:
|
||||||
|
typedef QMap<WId, QString> WinClassMap;
|
||||||
|
WinClassMap m_win_class_map;
|
||||||
|
struct KBClassInfo {
|
||||||
|
int groupno;
|
||||||
|
int next_groupno;
|
||||||
|
int refcount;
|
||||||
|
KBClassInfo() : refcount(0) {}
|
||||||
|
};
|
||||||
|
typedef QMap<QString, KBClassInfo> ClassGroupMap;
|
||||||
|
ClassGroupMap m_class_group_map;
|
||||||
|
ClassGroupMap::Iterator m_active_class;
|
||||||
|
QString getWindowClass(WId id);
|
||||||
|
protected:
|
||||||
|
virtual void windowAdded(WId id);
|
||||||
|
virtual void windowRemoved(WId id);
|
||||||
|
virtual void activeWindowChanged(WId id);
|
||||||
|
public:
|
||||||
|
WindowClassWatcher(KBConfig *kbconf, QObject *parent = 0, const char *name = 0);
|
||||||
|
~WindowClassWatcher();
|
||||||
|
virtual void changeGroup(int groupno, int next_groupno);
|
||||||
|
virtual void reset();
|
||||||
|
};
|
||||||
|
|
||||||
|
#endif
|
@ -0,0 +1,37 @@
|
|||||||
|
/***************************************************************************
|
||||||
|
* Copyright (C) 2004 by Leonid Zeitlin *
|
||||||
|
* lz@europe.com *
|
||||||
|
* *
|
||||||
|
* This program is free software; you can redistribute it and/or modify *
|
||||||
|
* it under the terms of the GNU General Public License as published by *
|
||||||
|
* the Free Software Foundation; either version 2 of the License, or *
|
||||||
|
* (at your option) any later version. *
|
||||||
|
* *
|
||||||
|
* This program is distributed in the hope that it will be useful, *
|
||||||
|
* but WITHOUT ANY WARRANTY; without even the implied warranty of *
|
||||||
|
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the *
|
||||||
|
* GNU General Public License for more details. *
|
||||||
|
* *
|
||||||
|
* You should have received a copy of the GNU General Public License *
|
||||||
|
* along with this program; if not, write to the *
|
||||||
|
* Free Software Foundation, Inc., *
|
||||||
|
* 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. *
|
||||||
|
***************************************************************************/
|
||||||
|
#include "windowwatcher.h"
|
||||||
|
|
||||||
|
#include <kwinmodule.h>
|
||||||
|
|
||||||
|
WindowWatcher::WindowWatcher(KBConfig *kbconf, QObject *parent, const char *name)
|
||||||
|
: QObject(parent, name)
|
||||||
|
{
|
||||||
|
m_kbconf = kbconf;
|
||||||
|
m_kwin_module = new KWinModule(this);
|
||||||
|
connect(m_kwin_module, SIGNAL(windowAdded(WId)), SLOT(windowAdded(WId)));
|
||||||
|
connect(m_kwin_module, SIGNAL(windowRemoved(WId)), SLOT(windowRemoved(WId)));
|
||||||
|
connect(m_kwin_module, SIGNAL(activeWindowChanged(WId)), SLOT(activeWindowChanged(WId)));
|
||||||
|
}
|
||||||
|
|
||||||
|
WindowWatcher::~WindowWatcher()
|
||||||
|
{
|
||||||
|
}
|
||||||
|
|
@ -0,0 +1,53 @@
|
|||||||
|
/***************************************************************************
|
||||||
|
* Copyright (C) 2004 by Leonid Zeitlin *
|
||||||
|
* lz@europe.com *
|
||||||
|
* *
|
||||||
|
* This program is free software; you can redistribute it and/or modify *
|
||||||
|
* it under the terms of the GNU General Public License as published by *
|
||||||
|
* the Free Software Foundation; either version 2 of the License, or *
|
||||||
|
* (at your option) any later version. *
|
||||||
|
* *
|
||||||
|
* This program is distributed in the hope that it will be useful, *
|
||||||
|
* but WITHOUT ANY WARRANTY; without even the implied warranty of *
|
||||||
|
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the *
|
||||||
|
* GNU General Public License for more details. *
|
||||||
|
* *
|
||||||
|
* You should have received a copy of the GNU General Public License *
|
||||||
|
* along with this program; if not, write to the *
|
||||||
|
* Free Software Foundation, Inc., *
|
||||||
|
* 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. *
|
||||||
|
***************************************************************************/
|
||||||
|
/* Created 04.05.2004 */
|
||||||
|
|
||||||
|
#ifndef WINDOWWATCHER_H
|
||||||
|
#define WINDOWWATCHER_H
|
||||||
|
|
||||||
|
#include <qobject.h>
|
||||||
|
|
||||||
|
class KBConfig;
|
||||||
|
class KWinModule;
|
||||||
|
|
||||||
|
/**
|
||||||
|
@author Leonid Zeitlin
|
||||||
|
This class watches for active window changes and notifies KKBSwitch
|
||||||
|
that the keyboard group needs to be canged
|
||||||
|
*/
|
||||||
|
class WindowWatcher : public QObject {
|
||||||
|
Q_OBJECT
|
||||||
|
protected:
|
||||||
|
KBConfig *m_kbconf;
|
||||||
|
KWinModule *m_kwin_module;
|
||||||
|
protected slots:
|
||||||
|
virtual void windowAdded(WId id) = 0;
|
||||||
|
virtual void windowRemoved(WId id) = 0;
|
||||||
|
virtual void activeWindowChanged(WId id) = 0;
|
||||||
|
public:
|
||||||
|
WindowWatcher(KBConfig *kbconf, QObject *parent = 0, const char *name = 0);
|
||||||
|
~WindowWatcher();
|
||||||
|
virtual void changeGroup(int groupno, int next_groupno) = 0;
|
||||||
|
virtual void reset() = 0;
|
||||||
|
signals:
|
||||||
|
void windowChanged(int groupno, int next_groupno);
|
||||||
|
};
|
||||||
|
|
||||||
|
#endif
|
@ -0,0 +1,246 @@
|
|||||||
|
/***************************************************************************
|
||||||
|
xkeyboard.cpp - description
|
||||||
|
-------------------
|
||||||
|
begin : Sun Jul 8 2001
|
||||||
|
copyright : (C) 2001 by Leonid Zeitlin
|
||||||
|
email : lz@europe.com
|
||||||
|
***************************************************************************/
|
||||||
|
|
||||||
|
/***************************************************************************
|
||||||
|
* *
|
||||||
|
* 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. *
|
||||||
|
* *
|
||||||
|
***************************************************************************/
|
||||||
|
|
||||||
|
#include "xkeyboard.h"
|
||||||
|
|
||||||
|
#include <qwindowdefs.h>
|
||||||
|
#include <qstringlist.h>
|
||||||
|
|
||||||
|
#include <kdebug.h>
|
||||||
|
#include <klocale.h>
|
||||||
|
|
||||||
|
XKeyboard *XKeyboard::m_self = 0;
|
||||||
|
|
||||||
|
XKeyboard::XKeyboard()
|
||||||
|
{
|
||||||
|
Display *display = qt_xdisplay();
|
||||||
|
#ifdef HAVE_LIBXKLAVIER
|
||||||
|
// XklSetDebugLevel(0);
|
||||||
|
XklSetLogAppender(XklLogAppender);
|
||||||
|
XklInit(display);
|
||||||
|
XklRegisterStateCallback(XklStateCallback, this);
|
||||||
|
XklRegisterConfigCallback(XklConfigCallback, this);
|
||||||
|
#else
|
||||||
|
int opcode, errorBase, major = XkbMajorVersion, minor = XkbMinorVersion;
|
||||||
|
|
||||||
|
// check the library version
|
||||||
|
if (!XkbLibraryVersion(&major, &minor)) {
|
||||||
|
kdWarning() << i18n("This program was built against XKB extension library\n"
|
||||||
|
"version %1.%2, but is run with the library version %3.%4.\n"
|
||||||
|
"This may cause various problems and even result in a complete\n"
|
||||||
|
"failure to function\n").arg(XkbMajorVersion).arg(XkbMinorVersion).arg(major).arg(minor);
|
||||||
|
}
|
||||||
|
|
||||||
|
// initialize the extension
|
||||||
|
m_xkb_available = XkbQueryExtension(display, &opcode, &m_event_code, &errorBase, &major, &minor);
|
||||||
|
if (!m_xkb_available) {
|
||||||
|
kdError() << i18n("The X Server does not support a compatible XKB extension.\n"
|
||||||
|
"Either the server is not XKB-capable or the extension was disabled.\n"
|
||||||
|
"This program would not work with this server, so it will exit now\n");
|
||||||
|
}
|
||||||
|
else {
|
||||||
|
// register for XKB events
|
||||||
|
//// group state change, i.e. the current group changed:
|
||||||
|
XkbSelectEventDetails(display, XkbUseCoreKbd, XkbStateNotify,
|
||||||
|
XkbAllStateComponentsMask, XkbGroupStateMask);
|
||||||
|
//// keyboard mapping change:
|
||||||
|
XkbSelectEventDetails(display, XkbUseCoreKbd, XkbMapNotify,
|
||||||
|
XkbAllMapComponentsMask, XkbKeySymsMask);
|
||||||
|
//// group names change:
|
||||||
|
XkbSelectEventDetails(display, XkbUseCoreKbd, XkbNamesNotify,
|
||||||
|
XkbAllNamesMask, XkbGroupNamesMask);
|
||||||
|
//// new keyboard:
|
||||||
|
XkbSelectEventDetails(display, XkbUseCoreKbd, XkbNewKeyboardNotify,
|
||||||
|
XkbAllNewKeyboardEventsMask, XkbAllNewKeyboardEventsMask);
|
||||||
|
// retrieve the number of keyboard groups
|
||||||
|
retrieveNumKbdGroups();
|
||||||
|
}
|
||||||
|
#endif
|
||||||
|
m_self = this;
|
||||||
|
}
|
||||||
|
|
||||||
|
XKeyboard::~XKeyboard(){
|
||||||
|
#ifdef HAVE_LIBXKLAVIER
|
||||||
|
XklStopListen();
|
||||||
|
XklTerm();
|
||||||
|
#endif
|
||||||
|
}
|
||||||
|
|
||||||
|
/** Determine if the given XEvent e is an XKB event with type XkbStateNotify.
|
||||||
|
* If so, newgroupno will return the new keyboard group #.
|
||||||
|
* In other words, return value of true means that this XEvent tells us
|
||||||
|
* that the user just switched the keyboard group to the new value
|
||||||
|
* newgroupno */
|
||||||
|
/*bool XKeyboard::isXkbStateNotifyEvent(XEvent *e, int *newgroupno){
|
||||||
|
bool ret = false;
|
||||||
|
if (e->type == m_event_code) {
|
||||||
|
XkbEvent *kb_ev = (XkbEvent *) e;
|
||||||
|
if (kb_ev->any.xkb_type == XkbStateNotify) {
|
||||||
|
ret = true;
|
||||||
|
*newgroupno = kb_ev->state.group;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
return ret;
|
||||||
|
}*/
|
||||||
|
|
||||||
|
/** Set the current keyboard group to the given groupno */
|
||||||
|
void XKeyboard::setGroupNo(int groupno){
|
||||||
|
#ifdef HAVE_LIBXKLAVIER
|
||||||
|
XklLockGroup(groupno);
|
||||||
|
#else
|
||||||
|
XkbLockGroup(qt_xdisplay(), XkbUseCoreKbd, groupno);
|
||||||
|
#endif
|
||||||
|
}
|
||||||
|
|
||||||
|
#ifndef HAVE_LIBXKLAVIER
|
||||||
|
extern "C" {
|
||||||
|
static int IgnoreXError(Display *, XErrorEvent *) {
|
||||||
|
return 0;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
#endif
|
||||||
|
|
||||||
|
/** Get the names of the currently configured keyboard groups */
|
||||||
|
void XKeyboard::getGroupNames(QStringList &list){
|
||||||
|
#ifdef HAVE_LIBXKLAVIER
|
||||||
|
const char** groupnames = XklGetGroupNames();
|
||||||
|
int numgroups = XklGetNumGroups();
|
||||||
|
for (int i = 0; i < numgroups; i++)
|
||||||
|
list.append(groupnames[i]);
|
||||||
|
#else
|
||||||
|
XkbDescRec xkb;
|
||||||
|
Display *display = qt_xdisplay();
|
||||||
|
char *names[XkbNumKbdGroups];
|
||||||
|
|
||||||
|
memset(&xkb, 0, sizeof(xkb));
|
||||||
|
xkb.device_spec = XkbUseCoreKbd;
|
||||||
|
XkbGetNames(display, XkbGroupNamesMask, &xkb);
|
||||||
|
memset(names, 0, sizeof(char *) * XkbNumKbdGroups);
|
||||||
|
// XGetAtomNames below may generate BadAtom error, which is not a problem.
|
||||||
|
// (it may happen if the name for a group was not defined)
|
||||||
|
// Thus we temporarily ignore X errors
|
||||||
|
XErrorHandler old_handler = XSetErrorHandler(IgnoreXError);
|
||||||
|
XGetAtomNames(display, xkb.names->groups, m_numgroups, names);
|
||||||
|
// resume normal X error processing
|
||||||
|
XSetErrorHandler(old_handler);
|
||||||
|
for (int i = 0; i < m_numgroups; i++) {
|
||||||
|
if (names[i]) {
|
||||||
|
list.append(names[i]);
|
||||||
|
XFree(names[i]);
|
||||||
|
}
|
||||||
|
else list.append(QString::null);
|
||||||
|
}
|
||||||
|
XkbFreeNames(&xkb, XkbGroupNamesMask, 1);
|
||||||
|
#endif
|
||||||
|
}
|
||||||
|
|
||||||
|
XKeyboard * XKeyboard::self()
|
||||||
|
{
|
||||||
|
return m_self;
|
||||||
|
}
|
||||||
|
|
||||||
|
/** return the current keyboard group index */
|
||||||
|
int XKeyboard::getGroupNo(){
|
||||||
|
#ifdef HAVE_LIBXKLAVIER
|
||||||
|
return XklGetCurrentState()->group;
|
||||||
|
#else
|
||||||
|
XkbStateRec rec;
|
||||||
|
XkbGetState(qt_xdisplay(), XkbUseCoreKbd, &rec);
|
||||||
|
return (int) rec.group;
|
||||||
|
#endif
|
||||||
|
}
|
||||||
|
|
||||||
|
/** Returns if the given event notifies us of a keyboard layout change that requires a
|
||||||
|
* reconfiguration
|
||||||
|
* (e.g. new group added, group names changed, etc.) */
|
||||||
|
/*bool XKeyboard::isLayoutChangeEvent(XEvent *e){
|
||||||
|
if (e->type == m_event_code) {
|
||||||
|
XkbEvent *xkb_ev = (XkbEvent *) e;
|
||||||
|
if ((xkb_ev->any.xkb_type == XkbMapNotify) && (xkb_ev->map.changed & XkbKeySymsMask)
|
||||||
|
|| (xkb_ev->any.xkb_type == XkbNamesNotify) && (xkb_ev->names.changed & XkbGroupNamesMask)
|
||||||
|
|| (xkb_ev->any.xkb_type == XkbNewKeyboardNotify)) {
|
||||||
|
retrieveNumKbdGroups();
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
return false;
|
||||||
|
}*/
|
||||||
|
|
||||||
|
#ifndef HAVE_LIBXKLAVIER
|
||||||
|
/** No descriptions */
|
||||||
|
void XKeyboard::retrieveNumKbdGroups(){
|
||||||
|
XkbDescRec xkb;
|
||||||
|
|
||||||
|
memset(&xkb, 0, sizeof(xkb));
|
||||||
|
/* Interestingly, in RedHat 6.0 (XFree86 3.3.3.1) the XkbGetControls call
|
||||||
|
below works even if xkb.device_spec is not set. But in RedHat 7.1 (XFree86 4.0.3)
|
||||||
|
it returns BadImplementation status code, and you have to specify
|
||||||
|
xkb.device_spec = XkbUseCoreKbd. */
|
||||||
|
xkb.device_spec = XkbUseCoreKbd;
|
||||||
|
XkbGetControls(qt_xdisplay(), XkbGroupsWrapMask, &xkb);
|
||||||
|
m_numgroups = xkb.ctrls->num_groups;
|
||||||
|
XkbFreeControls(&xkb, XkbGroupsWrapMask, 1);
|
||||||
|
}
|
||||||
|
#endif
|
||||||
|
|
||||||
|
/** Examines an X Event passed to it and takes actions if the event is of
|
||||||
|
* interest to XKeyboard */
|
||||||
|
void XKeyboard::processEvent(XEvent *ev) {
|
||||||
|
#ifdef HAVE_LIBXKLAVIER
|
||||||
|
XklFilterEvents(ev);
|
||||||
|
#else
|
||||||
|
if (ev->type == m_event_code) {
|
||||||
|
// This an XKB event
|
||||||
|
XkbEvent *xkb_ev = (XkbEvent *) ev;
|
||||||
|
if (xkb_ev->any.xkb_type == XkbStateNotify) {
|
||||||
|
// state notify event, the current group has changed
|
||||||
|
emit groupChanged(xkb_ev->state.group);
|
||||||
|
}
|
||||||
|
else if ((xkb_ev->any.xkb_type == XkbMapNotify) && (xkb_ev->map.changed & XkbKeySymsMask)
|
||||||
|
|| (xkb_ev->any.xkb_type == XkbNamesNotify) && (xkb_ev->names.changed & XkbGroupNamesMask)
|
||||||
|
|| (xkb_ev->any.xkb_type == XkbNewKeyboardNotify)) {
|
||||||
|
// keyboard layout has changed
|
||||||
|
retrieveNumKbdGroups();
|
||||||
|
emit layoutChanged();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
#endif
|
||||||
|
}
|
||||||
|
|
||||||
|
#ifdef HAVE_LIBXKLAVIER
|
||||||
|
void XKeyboard::XklStateCallback(XklStateChange changeType, int group,
|
||||||
|
Bool /*restore*/, void */*userData*/)
|
||||||
|
{
|
||||||
|
if (changeType == GROUP_CHANGED)
|
||||||
|
emit XKeyboard::self()->groupChanged(group);
|
||||||
|
}
|
||||||
|
|
||||||
|
void XKeyboard::XklConfigCallback(void */*userData*/)
|
||||||
|
{
|
||||||
|
emit XKeyboard::self()->layoutChanged();
|
||||||
|
}
|
||||||
|
|
||||||
|
void XKeyboard::XklLogAppender(const char file[], const char function[],
|
||||||
|
int level, const char format[], va_list args)
|
||||||
|
{
|
||||||
|
int size = vsnprintf(NULL, 0, format, args);
|
||||||
|
char *str = new char[size + 1];
|
||||||
|
vsnprintf(str, size, format, args);
|
||||||
|
kdDebug() << file << "/" << function << ": " << str << endl;
|
||||||
|
delete[] str;
|
||||||
|
}
|
||||||
|
#endif
|
@ -0,0 +1,86 @@
|
|||||||
|
/***************************************************************************
|
||||||
|
xkeyboard.h - description
|
||||||
|
-------------------
|
||||||
|
begin : Sun Jul 8 2001
|
||||||
|
copyright : (C) 2001 by Leonid Zeitlin
|
||||||
|
email : lz@europe.com
|
||||||
|
***************************************************************************/
|
||||||
|
|
||||||
|
/***************************************************************************
|
||||||
|
* *
|
||||||
|
* 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. *
|
||||||
|
* *
|
||||||
|
***************************************************************************/
|
||||||
|
|
||||||
|
#ifndef XKEYBOARD_H
|
||||||
|
#define XKEYBOARD_H
|
||||||
|
|
||||||
|
#include "config.h"
|
||||||
|
|
||||||
|
#include <qobject.h>
|
||||||
|
|
||||||
|
#include <X11/Xlib.h>
|
||||||
|
#include <X11/XKBlib.h>
|
||||||
|
|
||||||
|
#ifdef HAVE_LIBXKLAVIER
|
||||||
|
#include <libxklavier/xklavier.h>
|
||||||
|
#endif
|
||||||
|
|
||||||
|
class QStringList;
|
||||||
|
|
||||||
|
/**This class incapsulates XKeyboard Extension interface
|
||||||
|
*@author Leonid Zeitlin
|
||||||
|
*/
|
||||||
|
|
||||||
|
class XKeyboard : public QObject {
|
||||||
|
Q_OBJECT
|
||||||
|
private:
|
||||||
|
#ifndef HAVE_LIBXKLAVIER
|
||||||
|
int m_event_code;
|
||||||
|
int m_numgroups;
|
||||||
|
#endif
|
||||||
|
static XKeyboard *m_self;
|
||||||
|
bool m_xkb_available;
|
||||||
|
public:
|
||||||
|
static const int MaxNumKbdGroups = XkbNumKbdGroups;
|
||||||
|
XKeyboard();
|
||||||
|
~XKeyboard();
|
||||||
|
/** Set the current keyboard group to the given groupno */
|
||||||
|
void setGroupNo(int groupno);
|
||||||
|
/** Get the names of the currently configured keyboard groups */
|
||||||
|
void getGroupNames(QStringList &list);
|
||||||
|
static XKeyboard* self();
|
||||||
|
/** return the current keyboard group index */
|
||||||
|
int getGroupNo();
|
||||||
|
/** return if XKEYBOARD extension is available in the X server */
|
||||||
|
bool xkbAvailable() { return m_xkb_available; }
|
||||||
|
#ifdef HAVE_LIBXKLAVIER
|
||||||
|
int getNumKbdGroups() { return XklGetNumGroups(); };
|
||||||
|
#else
|
||||||
|
int getNumKbdGroups() { return m_numgroups; };
|
||||||
|
#endif
|
||||||
|
/** Examines an X Event passed to it and takes actions if the event is of
|
||||||
|
* interest to XKeyboard */
|
||||||
|
void processEvent(XEvent *ev);
|
||||||
|
private: // Private methods
|
||||||
|
#ifdef HAVE_LIBXKLAVIER
|
||||||
|
static void XklStateCallback(XklStateChange changeType, int group,
|
||||||
|
Bool /*restore*/, void* /*userData*/);
|
||||||
|
static void XklConfigCallback(void */*userData*/);
|
||||||
|
static void XklLogAppender(const char file[], const char function[],
|
||||||
|
int level, const char format[], va_list args);
|
||||||
|
#else
|
||||||
|
/** No descriptions */
|
||||||
|
void retrieveNumKbdGroups();
|
||||||
|
#endif
|
||||||
|
signals: // Signals
|
||||||
|
/** Signals that new keyboard group is selected */
|
||||||
|
void groupChanged(int groupno);
|
||||||
|
/** Signals that keyboard layout has changed and thus we need to reconfigure */
|
||||||
|
void layoutChanged();
|
||||||
|
};
|
||||||
|
|
||||||
|
#endif
|
@ -0,0 +1 @@
|
|||||||
|
POFILES = AUTO
|
@ -0,0 +1,362 @@
|
|||||||
|
# translation of kkbswitch-he.po to
|
||||||
|
# translation of kkbswitch.po to
|
||||||
|
# translation of kkbswitch.po to
|
||||||
|
# translation of kkbswitch.po to
|
||||||
|
# This file is distributed under the same license as the PACKAGE package.
|
||||||
|
# Copyright (C) YEAR THE PACKAGE'S COPYRIGHT HOLDER.
|
||||||
|
# Igal <koala@linux.net>, 2004.
|
||||||
|
#
|
||||||
|
msgid ""
|
||||||
|
msgstr ""
|
||||||
|
"Project-Id-Version: kkbswitch-he\n"
|
||||||
|
"POT-Creation-Date: 2004-06-15 23:49+0300\n"
|
||||||
|
"PO-Revision-Date: 2004-09-28 22:09+0200\n"
|
||||||
|
"Last-Translator: Igal <koala@linux.net>\n"
|
||||||
|
"Language-Team: <en@li.org>\n"
|
||||||
|
"MIME-Version: 1.0\n"
|
||||||
|
"Content-Type: text/plain; charset=UTF-8\n"
|
||||||
|
"Content-Transfer-Encoding: 8bit\n"
|
||||||
|
"X-Generator: KBabel 1.9\n"
|
||||||
|
|
||||||
|
#: kbconfig.cpp:85
|
||||||
|
msgid "<Unnamed>"
|
||||||
|
msgstr "<ללא שם>"
|
||||||
|
|
||||||
|
#: kbconfig.cpp:101
|
||||||
|
msgid "Activate %1 keyboard layout"
|
||||||
|
msgstr "הפעל פריסת מקלדת %1"
|
||||||
|
|
||||||
|
#: kbconfigdlg.cpp:116
|
||||||
|
msgid "&General"
|
||||||
|
msgstr "&ראשי"
|
||||||
|
|
||||||
|
#: kbconfigdlg.cpp:120
|
||||||
|
msgid "Available &keyboard layouts:"
|
||||||
|
msgstr "פריסות מקלדת זמינות:"
|
||||||
|
|
||||||
|
#: kbconfigdlg.cpp:132
|
||||||
|
msgid ""
|
||||||
|
"This list box shows keyboard layouts available in your system.\n"
|
||||||
|
"Select a layout and click \"Change Icon...\" button to change the icon for a "
|
||||||
|
"layout.\n"
|
||||||
|
"If you have configured a non-default icon, you can reset the icon to default "
|
||||||
|
"with \"Use Default Icon\" button.\n"
|
||||||
|
"The layout shown is bold is the default layout. Use \"Set as default\" "
|
||||||
|
"button to set the default layout."
|
||||||
|
msgstr ""
|
||||||
|
"רשימה זו מציגה את פריסות המקלדת הזמינות במערכת שלך.\n"
|
||||||
|
"בחר פריסה ולחץ על כפתור \"שנה סמל...\" לשינוי הסמל לפריסה.\n"
|
||||||
|
"אם הגדרת סמל שלא מברירת המחדל, באפשרותך להגדיר מחדש את סמל ברירת המחדל בעזרת הכפתור \"השתמש בסמל ברירת המחדל\".\n"
|
||||||
|
"הפריסה שמודגשת היא ברירת המחדל. השתמש בכפתור \"קבע כברירת המחדל\" לקביעת ברירת המחדל."
|
||||||
|
|
||||||
|
#: kbconfigdlg.cpp:141
|
||||||
|
msgid "Cha&nge Icon..."
|
||||||
|
msgstr "שנ&ה סמל..."
|
||||||
|
|
||||||
|
#: kbconfigdlg.cpp:144
|
||||||
|
msgid ""
|
||||||
|
"Click this button to change the icon for the layout selected in the list box "
|
||||||
|
"to the left."
|
||||||
|
msgstr "לחץ על הכפתור הזה לשינוי סמל הפריסה שסומנה ברשימה מימין."
|
||||||
|
|
||||||
|
#: kbconfigdlg.cpp:147
|
||||||
|
msgid "Use &Default Icon"
|
||||||
|
msgstr "השתמש בסמל &ברירת המחדל"
|
||||||
|
|
||||||
|
#: kbconfigdlg.cpp:150
|
||||||
|
msgid ""
|
||||||
|
"Click this button to use default icon for the layout selected in the list "
|
||||||
|
"box to the left."
|
||||||
|
msgstr "לחץ על הכפתור הזה כדי להשתמש בסמל ברירת המחדל לפריסה שסומנה ברשימה מימין."
|
||||||
|
|
||||||
|
#: kbconfigdlg.cpp:153
|
||||||
|
msgid "&Set as Default"
|
||||||
|
msgstr "&קבע כברירת המחדל"
|
||||||
|
|
||||||
|
#: kbconfigdlg.cpp:156
|
||||||
|
msgid ""
|
||||||
|
"Cick this button to set the layout selected in the list box to the left as "
|
||||||
|
"the default"
|
||||||
|
msgstr "לחץ על הכפתור הזה כדי לקבוע את הפריסה שסומנה ברשימה מימין כברירת מחדל"
|
||||||
|
|
||||||
|
#: kbconfigdlg.cpp:162
|
||||||
|
msgid "Layout &icon style:"
|
||||||
|
msgstr "סגנון &סמל הפריסה:"
|
||||||
|
|
||||||
|
#: kbconfigdlg.cpp:167
|
||||||
|
msgid "Country flag"
|
||||||
|
msgstr "דגל מדינה"
|
||||||
|
|
||||||
|
#: kbconfigdlg.cpp:168
|
||||||
|
msgid "Language code"
|
||||||
|
msgstr "קוד שפה"
|
||||||
|
|
||||||
|
#: kbconfigdlg.cpp:169
|
||||||
|
msgid "Flag and code"
|
||||||
|
msgstr "דגל וקוד"
|
||||||
|
|
||||||
|
#: kbconfigdlg.cpp:173
|
||||||
|
msgid ""
|
||||||
|
"<p>Select the style of icons representing the current keyboard layout.\n"
|
||||||
|
"You can choose from the following styles:<ul><li><b>Country flag</b> - "
|
||||||
|
"displays the corresponding contry flag<li><b>Language code</b> - displays "
|
||||||
|
"the language ISO 2-letter code<li><b>Flag and code</b> - displays the "
|
||||||
|
"language code superimposed over the country flag.</ul></p>"
|
||||||
|
msgstr ""
|
||||||
|
"<p dir=rtl>בחר את סגנון הסמלים המציגים את פריסת המקלדת הנוכחית.\n"
|
||||||
|
"באפשרותך לבחור מהסגנונות הבאים:<li><b>דגל מדינה</b> - "
|
||||||
|
"מציג את דגל המדינה המתאימה<li><b>קוד שפה</b> - "
|
||||||
|
"מציג את קוד האותיות של השפה לפי התקן ISO 2<li><b>דגל וקוד</b> - מציג את קוד האותיות מלווה בדגל המדינה.</ul></p>"
|
||||||
|
|
||||||
|
#: kbconfigdlg.cpp:181
|
||||||
|
msgid "&Layout applies to:"
|
||||||
|
msgstr "&הפריסה חלה על:"
|
||||||
|
|
||||||
|
#: kbconfigdlg.cpp:186
|
||||||
|
msgid "All windows"
|
||||||
|
msgstr "כל החלונות"
|
||||||
|
|
||||||
|
#: kbconfigdlg.cpp:187
|
||||||
|
msgid "Windows of one application"
|
||||||
|
msgstr "חלונות של תוכנה אחת"
|
||||||
|
|
||||||
|
#: kbconfigdlg.cpp:188
|
||||||
|
msgid "One window"
|
||||||
|
msgstr "חלון אחד"
|
||||||
|
|
||||||
|
#: kbconfigdlg.cpp:191
|
||||||
|
msgid ""
|
||||||
|
"<p>Select what windows the currently selected keyboard layout applies to:\n"
|
||||||
|
"<ul><li><b>All windows</b> - one layout applies to all windows on your "
|
||||||
|
"desktop\n"
|
||||||
|
"<li><b>Windows of one application</b> - layout applies to one application; "
|
||||||
|
"each application can have its own layout. When you switch between "
|
||||||
|
"applications, layout follows the active application\n"
|
||||||
|
"<li><b>One window</b> - layout applies to one window only; each window can "
|
||||||
|
"have its own layout. When you switch between windows, layout follows the "
|
||||||
|
"active window.</ul></p>"
|
||||||
|
msgstr ""
|
||||||
|
"<p dir=rtl>בחר על אילו חלונות חלה פריסת המקלדת הנוכחית:\n"
|
||||||
|
"<ul><li><b>כל החלונות "
|
||||||
|
"</b> - פריסה אחת חלה על כל החלונות על שולחן העבודה שלך "
|
||||||
|
"\n"
|
||||||
|
"<li><b>חלונות של תכנה אחת "
|
||||||
|
"</b> - הפריסה חלה על תכנה אחת, לכל תכנה תהיה פריסה משלה. כאשר הנך עובר בין התכנות, הפריסה תעקוב אחר התכנה הפעילה "
|
||||||
|
"\n"
|
||||||
|
"<li><b>חלון אחד "
|
||||||
|
"</b> - הפריסה חלה על חלון אחד בלבד, לכל חלון תהיה פריסה משלו. כאשר הנך עובר בין החלונות, הפריסה תעקוב אחר החלון הפעיל. "
|
||||||
|
"</ul></p>"
|
||||||
|
|
||||||
|
#: kbconfigdlg.cpp:199
|
||||||
|
msgid "Use \"&Toggle Mode\""
|
||||||
|
msgstr "השתמש ב-\"&מצב חלופי\""
|
||||||
|
|
||||||
|
#: kbconfigdlg.cpp:201
|
||||||
|
msgid ""
|
||||||
|
"Toggle mode is useful when you have more than two keyboard layouts defined. "
|
||||||
|
"When toggle mode is on your normal layout switch key toggles between two "
|
||||||
|
"most frequently used layouts. To activate other layouts use KKBSwitch's tray "
|
||||||
|
"popup menu"
|
||||||
|
msgstr ""
|
||||||
|
"מצב חלופי שימושי כאשר מוגדרות יותר משתי פריסות מקלדת. "
|
||||||
|
"כאשר המצב החלופי מופעל הפריסה הרגילה מעבירה בין שתי הפריסות התכופות ביותר. להפעלת פריסות אחרות השתמש בתפריט קופץ של KKBSwitch במגש המערכת"
|
||||||
|
|
||||||
|
#: kbconfigdlg.cpp:211
|
||||||
|
msgid "A&utostart"
|
||||||
|
msgstr "הפעלה או&טומטית"
|
||||||
|
|
||||||
|
#: kbconfigdlg.cpp:213
|
||||||
|
msgid ""
|
||||||
|
"When this checkbox is checked, KKBSwitch will start automatically when you "
|
||||||
|
"log in"
|
||||||
|
msgstr "כאשר תיבת סימון זו מסומנת, KKBSwitch תפעל אוטומטית כאשר הנך נכנס למערכת"
|
||||||
|
|
||||||
|
#: kbconfigdlg.cpp:219
|
||||||
|
msgid "Sho&rtcuts"
|
||||||
|
msgstr "קיצורי מ&קשים"
|
||||||
|
|
||||||
|
#: kbconfigdlg.cpp:220
|
||||||
|
msgid "Use shortcuts to &activate keyboard layouts"
|
||||||
|
msgstr "השתמש בקיצורי מקשים ל&הפעלת פריסות מקלדת"
|
||||||
|
|
||||||
|
#: kbconfigdlg.cpp:222
|
||||||
|
msgid ""
|
||||||
|
"Check this checkbox to be able to quickly activate any keyboard layout with "
|
||||||
|
"keyboard shorcuts. Once this checkbox is checked, you can adjust the "
|
||||||
|
"shortcuts at the key chooser pane below. Especially useful if you have three "
|
||||||
|
"or four keyboard layouts configured"
|
||||||
|
msgstr ""
|
||||||
|
"סמן תיבת סימון זו כדי להפעיל במהירות פריסת מקלדת בעזרת קיצורי מקשים. "
|
||||||
|
"לאחר שתיבת הסימון סומנה, הנך יכול להסדיר את קיצורי המקשים בשדה בחירה למטה. שימושי במיוחד במידה והגדרת שלוש או ארבע פריסות מקלדת."
|
||||||
|
|
||||||
|
#: kbconfigdlg.moc.cpp:34 kbconfigdlg.moc.cpp:42
|
||||||
|
msgid "KBConfigDlg"
|
||||||
|
msgstr "KBConfigDlg"
|
||||||
|
|
||||||
|
#: kbconfig.moc.cpp:42 kbconfig.moc.cpp:47
|
||||||
|
msgid "KBConfig"
|
||||||
|
msgstr "KBConfig"
|
||||||
|
|
||||||
|
#: kbpickicondlg.cpp:42
|
||||||
|
msgid "Pick an icon"
|
||||||
|
msgstr "בחר סמל"
|
||||||
|
|
||||||
|
#: kbpickicondlg.cpp:50
|
||||||
|
msgid "Select one of the icons"
|
||||||
|
msgstr "בחר אחד הסמלים"
|
||||||
|
|
||||||
|
#: kbpickicondlg.cpp:52
|
||||||
|
msgid "&Browse..."
|
||||||
|
msgstr "&עיין..."
|
||||||
|
|
||||||
|
#: kbpickicondlg.cpp:54
|
||||||
|
msgid "Browse for an image file to use as an icon"
|
||||||
|
msgstr "חפש תמונה לשימוש כסמל"
|
||||||
|
|
||||||
|
#: kbpickicondlg.cpp:90
|
||||||
|
msgid ""
|
||||||
|
"*.png *.jpg *.gif *.xpm|Icon files (*.png, *.jpg, *.gif, *.xpm)\n"
|
||||||
|
"*.*|All files (*.*)"
|
||||||
|
msgstr ""
|
||||||
|
"*.png *.jpg *.gif *.xpm|Icon files (*.png, *.jpg, *.gif, *.xpm)\n"
|
||||||
|
"*.*|כל הקבצים (*.*)"
|
||||||
|
|
||||||
|
#: kbpickicondlg.cpp:101
|
||||||
|
msgid ""
|
||||||
|
"The size of this image (%1 by %2) is not good.\n"
|
||||||
|
"Preferred size for the layout icons is %3 by %4.\n"
|
||||||
|
msgstr ""
|
||||||
|
"גודל התמונה (%1 על %2) אינו מתאים.\n"
|
||||||
|
"הגודל המועדף לסמלי הפריסה הוא %3 על %4.\n"
|
||||||
|
|
||||||
|
#: kbpickicondlg.cpp:106
|
||||||
|
msgid " and also too wide"
|
||||||
|
msgstr " ובנוסף רחב מדי"
|
||||||
|
|
||||||
|
#: kbpickicondlg.cpp:107
|
||||||
|
msgid " and also too narrow"
|
||||||
|
msgstr " ובנוסף צר מדי"
|
||||||
|
|
||||||
|
#: kbpickicondlg.cpp:108
|
||||||
|
msgid "This image is too big%1."
|
||||||
|
msgstr "תמונה זו גדולה מדי%1."
|
||||||
|
|
||||||
|
#: kbpickicondlg.cpp:110
|
||||||
|
msgid "This image is too wide."
|
||||||
|
msgstr "תמונה זו רחבה מדי."
|
||||||
|
|
||||||
|
#: kbpickicondlg.cpp:111
|
||||||
|
msgid "This image is too narrow."
|
||||||
|
msgstr "תמונה זו צרה מדי."
|
||||||
|
|
||||||
|
#: kbpickicondlg.cpp:113
|
||||||
|
msgid ""
|
||||||
|
"KKBSwitch will scale it to appropriate size, but the result may not look "
|
||||||
|
"very good.\n"
|
||||||
|
"Are you sure you want to use this image?"
|
||||||
|
msgstr ""
|
||||||
|
"כעת KKBSwitch תשנה את זה לגודל המתאים, אך התוצאה עלולה לא להיראות טוב.\n"
|
||||||
|
"האם הנך בטוח שברצונך להשתמש בתמונה זו?"
|
||||||
|
|
||||||
|
#: kbpickicondlg.cpp:126
|
||||||
|
msgid ""
|
||||||
|
"Cannot read icon from file %1. Either it is not an image file or it is "
|
||||||
|
"corrupt."
|
||||||
|
msgstr "אין אפשרות לקרוא סמל מתוך הקובץ %1. ככל הנראה זהו אינו קובץ תמונה או פגום."
|
||||||
|
|
||||||
|
#: kbpickicondlg.moc.cpp:34 kbpickicondlg.moc.cpp:42
|
||||||
|
msgid "KBPickIconDlg"
|
||||||
|
msgstr "KBPickIconDlg"
|
||||||
|
|
||||||
|
#: kbswitchapp.moc.cpp:34 kbswitchapp.moc.cpp:42
|
||||||
|
msgid "KBSwitchApp"
|
||||||
|
msgstr "KBSwitchApp"
|
||||||
|
|
||||||
|
#: kbswitchintf.moc.cpp:34 kbswitchintf.moc.cpp:42
|
||||||
|
msgid "KBSwitchIntf"
|
||||||
|
msgstr "KBSwitchIntf"
|
||||||
|
|
||||||
|
#: kbswitchtrayicon.cpp:91 main.cpp:27 main.cpp:41
|
||||||
|
msgid "Keyboard Switch"
|
||||||
|
msgstr "Keyboard Switch"
|
||||||
|
|
||||||
|
#: kbswitchtrayicon.moc.cpp:34 kbswitchtrayicon.moc.cpp:42
|
||||||
|
msgid "KBSwitchTrayIcon"
|
||||||
|
msgstr "סמל מגש המערכת של KBSwitch"
|
||||||
|
|
||||||
|
#: main.cpp:44
|
||||||
|
msgid "Creator and maintainer"
|
||||||
|
msgstr "יוצר ומתחזק"
|
||||||
|
|
||||||
|
#: main.cpp:45
|
||||||
|
msgid "Default group config and per-window groups"
|
||||||
|
msgstr ""
|
||||||
|
|
||||||
|
#: main.cpp:47
|
||||||
|
msgid "FreeBSD port, feature suggestions"
|
||||||
|
msgstr "הסבה ל-FreeBSD, הצעות של תכונות"
|
||||||
|
|
||||||
|
#: main.cpp:48
|
||||||
|
msgid "Feature suggestions, Ukrainian translation"
|
||||||
|
msgstr "הצעות של תכונות, תרגום אוקראיני"
|
||||||
|
|
||||||
|
#: main.cpp:50
|
||||||
|
msgid "Autostart patch"
|
||||||
|
msgstr "תוסף הפעלה אוטומטית"
|
||||||
|
|
||||||
|
#: main.cpp:51
|
||||||
|
msgid "Greek translation"
|
||||||
|
msgstr "תרגום יווני"
|
||||||
|
|
||||||
|
#: main.cpp:52
|
||||||
|
msgid "Slovak translation"
|
||||||
|
msgstr "תרגום סלובקי"
|
||||||
|
|
||||||
|
#: singlewindowwatcher.moc.cpp:34 singlewindowwatcher.moc.cpp:42
|
||||||
|
msgid "SingleWindowWatcher"
|
||||||
|
msgstr ""
|
||||||
|
|
||||||
|
#: _translatorinfo.cpp:1
|
||||||
|
msgid ""
|
||||||
|
"_: NAME OF TRANSLATORS\n"
|
||||||
|
"Your names"
|
||||||
|
msgstr "Koala"
|
||||||
|
|
||||||
|
#: _translatorinfo.cpp:3
|
||||||
|
msgid ""
|
||||||
|
"_: EMAIL OF TRANSLATORS\n"
|
||||||
|
"Your emails"
|
||||||
|
msgstr "igalfr@gmail.com"
|
||||||
|
|
||||||
|
#: windowclasswatcher.moc.cpp:34 windowclasswatcher.moc.cpp:42
|
||||||
|
msgid "WindowClassWatcher"
|
||||||
|
msgstr ""
|
||||||
|
|
||||||
|
#: windowwatcher.moc.cpp:34 windowwatcher.moc.cpp:42
|
||||||
|
msgid "WindowWatcher"
|
||||||
|
msgstr ""
|
||||||
|
|
||||||
|
#: xkeyboard.cpp:42
|
||||||
|
#, c-format
|
||||||
|
msgid ""
|
||||||
|
"This program was built against XKB extension library\n"
|
||||||
|
"version %1.%2, but is run with the library version %3.%4.\n"
|
||||||
|
"This may cause various problems and even result in a complete\n"
|
||||||
|
"failure to function\n"
|
||||||
|
msgstr ""
|
||||||
|
"תכנה זו נבנתה מול ספריית XKB\n"
|
||||||
|
"גירסה %1.%2, אך פועלת גם עם גירסה %3.%4.\n"
|
||||||
|
"זה יכול לגרום למספר בעיות ואפילו\n"
|
||||||
|
"לכשל תפקוד\n"
|
||||||
|
|
||||||
|
#: xkeyboard.cpp:51
|
||||||
|
msgid ""
|
||||||
|
"The X Server does not support a compatible XKB extension.\n"
|
||||||
|
"Either the server is not XKB-capable or the extension was disabled.\n"
|
||||||
|
"This program would not work with this server, so it will exit now\n"
|
||||||
|
msgstr ""
|
||||||
|
|
||||||
|
#: xkeyboard.moc.cpp:34 xkeyboard.moc.cpp:42
|
||||||
|
msgid "XKeyboard"
|
||||||
|
msgstr "XKeyboard"
|
||||||
|
|
@ -0,0 +1,326 @@
|
|||||||
|
# SOME DESCRIPTIVE TITLE.
|
||||||
|
# Copyright (C) YEAR THE PACKAGE'S COPYRIGHT HOLDER
|
||||||
|
# This file is distributed under the same license as the PACKAGE package.
|
||||||
|
# FIRST AUTHOR <EMAIL@ADDRESS>, YEAR.
|
||||||
|
#
|
||||||
|
#, fuzzy
|
||||||
|
msgid ""
|
||||||
|
msgstr ""
|
||||||
|
"Project-Id-Version: PACKAGE VERSION\n"
|
||||||
|
"POT-Creation-Date: 2004-06-15 23:49+0300\n"
|
||||||
|
"PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n"
|
||||||
|
"Last-Translator: FULL NAME <EMAIL@ADDRESS>\n"
|
||||||
|
"Language-Team: LANGUAGE <LL@li.org>\n"
|
||||||
|
"MIME-Version: 1.0\n"
|
||||||
|
"Content-Type: text/plain; charset=CHARSET\n"
|
||||||
|
"Content-Transfer-Encoding: 8bit\n"
|
||||||
|
|
||||||
|
#: kbconfig.cpp:85
|
||||||
|
msgid "<Unnamed>"
|
||||||
|
msgstr ""
|
||||||
|
|
||||||
|
#: kbconfig.cpp:101
|
||||||
|
msgid "Activate %1 keyboard layout"
|
||||||
|
msgstr ""
|
||||||
|
|
||||||
|
#: kbconfigdlg.cpp:116
|
||||||
|
msgid "&General"
|
||||||
|
msgstr ""
|
||||||
|
|
||||||
|
#: kbconfigdlg.cpp:120
|
||||||
|
msgid "Available &keyboard layouts:"
|
||||||
|
msgstr ""
|
||||||
|
|
||||||
|
#: kbconfigdlg.cpp:132
|
||||||
|
msgid ""
|
||||||
|
"This list box shows keyboard layouts available in your system.\n"
|
||||||
|
"Select a layout and click \"Change Icon...\" button to change the icon for a "
|
||||||
|
"layout.\n"
|
||||||
|
"If you have configured a non-default icon, you can reset the icon to default "
|
||||||
|
"with \"Use Default Icon\" button.\n"
|
||||||
|
"The layout shown is bold is the default layout. Use \"Set as default\" "
|
||||||
|
"button to set the default layout."
|
||||||
|
msgstr ""
|
||||||
|
|
||||||
|
#: kbconfigdlg.cpp:141
|
||||||
|
msgid "Cha&nge Icon..."
|
||||||
|
msgstr ""
|
||||||
|
|
||||||
|
#: kbconfigdlg.cpp:144
|
||||||
|
msgid ""
|
||||||
|
"Click this button to change the icon for the layout selected in the list box "
|
||||||
|
"to the left."
|
||||||
|
msgstr ""
|
||||||
|
|
||||||
|
#: kbconfigdlg.cpp:147
|
||||||
|
msgid "Use &Default Icon"
|
||||||
|
msgstr ""
|
||||||
|
|
||||||
|
#: kbconfigdlg.cpp:150
|
||||||
|
msgid ""
|
||||||
|
"Click this button to use default icon for the layout selected in the list "
|
||||||
|
"box to the left."
|
||||||
|
msgstr ""
|
||||||
|
|
||||||
|
#: kbconfigdlg.cpp:153
|
||||||
|
msgid "&Set as Default"
|
||||||
|
msgstr ""
|
||||||
|
|
||||||
|
#: kbconfigdlg.cpp:156
|
||||||
|
msgid ""
|
||||||
|
"Cick this button to set the layout selected in the list box to the left as "
|
||||||
|
"the default"
|
||||||
|
msgstr ""
|
||||||
|
|
||||||
|
#: kbconfigdlg.cpp:162
|
||||||
|
msgid "Layout &icon style:"
|
||||||
|
msgstr ""
|
||||||
|
|
||||||
|
#: kbconfigdlg.cpp:167
|
||||||
|
msgid "Country flag"
|
||||||
|
msgstr ""
|
||||||
|
|
||||||
|
#: kbconfigdlg.cpp:168
|
||||||
|
msgid "Language code"
|
||||||
|
msgstr ""
|
||||||
|
|
||||||
|
#: kbconfigdlg.cpp:169
|
||||||
|
msgid "Flag and code"
|
||||||
|
msgstr ""
|
||||||
|
|
||||||
|
#: kbconfigdlg.cpp:173
|
||||||
|
msgid ""
|
||||||
|
"<p>Select the style of icons representing the current keyboard layout.\n"
|
||||||
|
"You can choose from the following styles:<ul><li><b>Country flag</b> - "
|
||||||
|
"displays the corresponding contry flag<li><b>Language code</b> - displays "
|
||||||
|
"the language ISO 2-letter code<li><b>Flag and code</b> - displays the "
|
||||||
|
"language code superimposed over the country flag.</ul></p>"
|
||||||
|
msgstr ""
|
||||||
|
|
||||||
|
#: kbconfigdlg.cpp:181
|
||||||
|
msgid "&Layout applies to:"
|
||||||
|
msgstr ""
|
||||||
|
|
||||||
|
#: kbconfigdlg.cpp:186
|
||||||
|
msgid "All windows"
|
||||||
|
msgstr ""
|
||||||
|
|
||||||
|
#: kbconfigdlg.cpp:187
|
||||||
|
msgid "Windows of one application"
|
||||||
|
msgstr ""
|
||||||
|
|
||||||
|
#: kbconfigdlg.cpp:188
|
||||||
|
msgid "One window"
|
||||||
|
msgstr ""
|
||||||
|
|
||||||
|
#: kbconfigdlg.cpp:191
|
||||||
|
msgid ""
|
||||||
|
"<p>Select what windows the currently selected keyboard layout applies to:\n"
|
||||||
|
"<ul><li><b>All windows</b> - one layout applies to all windows on your "
|
||||||
|
"desktop\n"
|
||||||
|
"<li><b>Windows of one application</b> - layout applies to one application; "
|
||||||
|
"each application can have its own layout. When you switch between "
|
||||||
|
"applications, layout follows the active application\n"
|
||||||
|
"<li><b>One window</b> - layout applies to one window only; each window can "
|
||||||
|
"have its own layout. When you switch between windows, layout follows the "
|
||||||
|
"active window.</ul></p>"
|
||||||
|
msgstr ""
|
||||||
|
|
||||||
|
#: kbconfigdlg.cpp:199
|
||||||
|
msgid "Use \"&Toggle Mode\""
|
||||||
|
msgstr ""
|
||||||
|
|
||||||
|
#: kbconfigdlg.cpp:201
|
||||||
|
msgid ""
|
||||||
|
"Toggle mode is useful when you have more than two keyboard layouts defined. "
|
||||||
|
"When toggle mode is on your normal layout switch key toggles between two "
|
||||||
|
"most frequently used layouts. To activate other layouts use KKBSwitch's tray "
|
||||||
|
"popup menu"
|
||||||
|
msgstr ""
|
||||||
|
|
||||||
|
#: kbconfigdlg.cpp:211
|
||||||
|
msgid "A&utostart"
|
||||||
|
msgstr ""
|
||||||
|
|
||||||
|
#: kbconfigdlg.cpp:213
|
||||||
|
msgid ""
|
||||||
|
"When this checkbox is checked, KKBSwitch will start automatically when you "
|
||||||
|
"log in"
|
||||||
|
msgstr ""
|
||||||
|
|
||||||
|
#: kbconfigdlg.cpp:219
|
||||||
|
msgid "Sho&rtcuts"
|
||||||
|
msgstr ""
|
||||||
|
|
||||||
|
#: kbconfigdlg.cpp:220
|
||||||
|
msgid "Use shortcuts to &activate keyboard layouts"
|
||||||
|
msgstr ""
|
||||||
|
|
||||||
|
#: kbconfigdlg.cpp:222
|
||||||
|
msgid ""
|
||||||
|
"Check this checkbox to be able to quickly activate any keyboard layout with "
|
||||||
|
"keyboard shorcuts. Once this checkbox is checked, you can adjust the "
|
||||||
|
"shortcuts at the key chooser pane below. Especially useful if you have three "
|
||||||
|
"or four keyboard layouts configured"
|
||||||
|
msgstr ""
|
||||||
|
|
||||||
|
#: kbconfigdlg.moc.cpp:34 kbconfigdlg.moc.cpp:42
|
||||||
|
msgid "KBConfigDlg"
|
||||||
|
msgstr ""
|
||||||
|
|
||||||
|
#: kbconfig.moc.cpp:42 kbconfig.moc.cpp:47
|
||||||
|
msgid "KBConfig"
|
||||||
|
msgstr ""
|
||||||
|
|
||||||
|
#: kbpickicondlg.cpp:42
|
||||||
|
msgid "Pick an icon"
|
||||||
|
msgstr ""
|
||||||
|
|
||||||
|
#: kbpickicondlg.cpp:50
|
||||||
|
msgid "Select one of the icons"
|
||||||
|
msgstr ""
|
||||||
|
|
||||||
|
#: kbpickicondlg.cpp:52
|
||||||
|
msgid "&Browse..."
|
||||||
|
msgstr ""
|
||||||
|
|
||||||
|
#: kbpickicondlg.cpp:54
|
||||||
|
msgid "Browse for an image file to use as an icon"
|
||||||
|
msgstr ""
|
||||||
|
|
||||||
|
#: kbpickicondlg.cpp:90
|
||||||
|
msgid ""
|
||||||
|
"*.png *.jpg *.gif *.xpm|Icon files (*.png, *.jpg, *.gif, *.xpm)\n"
|
||||||
|
"*.*|All files (*.*)"
|
||||||
|
msgstr ""
|
||||||
|
|
||||||
|
#: kbpickicondlg.cpp:101
|
||||||
|
msgid ""
|
||||||
|
"The size of this image (%1 by %2) is not good.\n"
|
||||||
|
"Preferred size for the layout icons is %3 by %4.\n"
|
||||||
|
msgstr ""
|
||||||
|
|
||||||
|
#: kbpickicondlg.cpp:106
|
||||||
|
msgid " and also too wide"
|
||||||
|
msgstr ""
|
||||||
|
|
||||||
|
#: kbpickicondlg.cpp:107
|
||||||
|
msgid " and also too narrow"
|
||||||
|
msgstr ""
|
||||||
|
|
||||||
|
#: kbpickicondlg.cpp:108
|
||||||
|
msgid "This image is too big%1."
|
||||||
|
msgstr ""
|
||||||
|
|
||||||
|
#: kbpickicondlg.cpp:110
|
||||||
|
msgid "This image is too wide."
|
||||||
|
msgstr ""
|
||||||
|
|
||||||
|
#: kbpickicondlg.cpp:111
|
||||||
|
msgid "This image is too narrow."
|
||||||
|
msgstr ""
|
||||||
|
|
||||||
|
#: kbpickicondlg.cpp:113
|
||||||
|
msgid ""
|
||||||
|
"KKBSwitch will scale it to appropriate size, but the result may not look "
|
||||||
|
"very good.\n"
|
||||||
|
"Are you sure you want to use this image?"
|
||||||
|
msgstr ""
|
||||||
|
|
||||||
|
#: kbpickicondlg.cpp:126
|
||||||
|
msgid ""
|
||||||
|
"Cannot read icon from file %1. Either it is not an image file or it is "
|
||||||
|
"corrupt."
|
||||||
|
msgstr ""
|
||||||
|
|
||||||
|
#: kbpickicondlg.moc.cpp:34 kbpickicondlg.moc.cpp:42
|
||||||
|
msgid "KBPickIconDlg"
|
||||||
|
msgstr ""
|
||||||
|
|
||||||
|
#: kbswitchapp.moc.cpp:34 kbswitchapp.moc.cpp:42
|
||||||
|
msgid "KBSwitchApp"
|
||||||
|
msgstr ""
|
||||||
|
|
||||||
|
#: kbswitchintf.moc.cpp:34 kbswitchintf.moc.cpp:42
|
||||||
|
msgid "KBSwitchIntf"
|
||||||
|
msgstr ""
|
||||||
|
|
||||||
|
#: kbswitchtrayicon.cpp:91 main.cpp:27 main.cpp:41
|
||||||
|
msgid "Keyboard Switch"
|
||||||
|
msgstr ""
|
||||||
|
|
||||||
|
#: kbswitchtrayicon.moc.cpp:34 kbswitchtrayicon.moc.cpp:42
|
||||||
|
msgid "KBSwitchTrayIcon"
|
||||||
|
msgstr ""
|
||||||
|
|
||||||
|
#: main.cpp:44
|
||||||
|
msgid "Creator and maintainer"
|
||||||
|
msgstr ""
|
||||||
|
|
||||||
|
#: main.cpp:45
|
||||||
|
msgid "Default group config and per-window groups"
|
||||||
|
msgstr ""
|
||||||
|
|
||||||
|
#: main.cpp:47
|
||||||
|
msgid "FreeBSD port, feature suggestions"
|
||||||
|
msgstr ""
|
||||||
|
|
||||||
|
#: main.cpp:48
|
||||||
|
msgid "Feature suggestions, Ukrainian translation"
|
||||||
|
msgstr ""
|
||||||
|
|
||||||
|
#: main.cpp:50
|
||||||
|
msgid "Autostart patch"
|
||||||
|
msgstr ""
|
||||||
|
|
||||||
|
#: main.cpp:51
|
||||||
|
msgid "Greek translation"
|
||||||
|
msgstr ""
|
||||||
|
|
||||||
|
#: main.cpp:52
|
||||||
|
msgid "Slovak translation"
|
||||||
|
msgstr ""
|
||||||
|
|
||||||
|
#: singlewindowwatcher.moc.cpp:34 singlewindowwatcher.moc.cpp:42
|
||||||
|
msgid "SingleWindowWatcher"
|
||||||
|
msgstr ""
|
||||||
|
|
||||||
|
#: _translatorinfo.cpp:1
|
||||||
|
msgid ""
|
||||||
|
"_: NAME OF TRANSLATORS\n"
|
||||||
|
"Your names"
|
||||||
|
msgstr ""
|
||||||
|
|
||||||
|
#: _translatorinfo.cpp:3
|
||||||
|
msgid ""
|
||||||
|
"_: EMAIL OF TRANSLATORS\n"
|
||||||
|
"Your emails"
|
||||||
|
msgstr ""
|
||||||
|
|
||||||
|
#: windowclasswatcher.moc.cpp:34 windowclasswatcher.moc.cpp:42
|
||||||
|
msgid "WindowClassWatcher"
|
||||||
|
msgstr ""
|
||||||
|
|
||||||
|
#: windowwatcher.moc.cpp:34 windowwatcher.moc.cpp:42
|
||||||
|
msgid "WindowWatcher"
|
||||||
|
msgstr ""
|
||||||
|
|
||||||
|
#: xkeyboard.cpp:42
|
||||||
|
#, c-format
|
||||||
|
msgid ""
|
||||||
|
"This program was built against XKB extension library\n"
|
||||||
|
"version %1.%2, but is run with the library version %3.%4.\n"
|
||||||
|
"This may cause various problems and even result in a complete\n"
|
||||||
|
"failure to function\n"
|
||||||
|
msgstr ""
|
||||||
|
|
||||||
|
#: xkeyboard.cpp:51
|
||||||
|
msgid ""
|
||||||
|
"The X Server does not support a compatible XKB extension.\n"
|
||||||
|
"Either the server is not XKB-capable or the extension was disabled.\n"
|
||||||
|
"This program would not work with this server, so it will exit now\n"
|
||||||
|
msgstr ""
|
||||||
|
|
||||||
|
#: xkeyboard.moc.cpp:34 xkeyboard.moc.cpp:42
|
||||||
|
msgid "XKeyboard"
|
||||||
|
msgstr ""
|
Loading…
Reference in new issue