diff options
author | Keith Packard <keithp@neko.keithp.com> | 2007-06-19 14:51:57 +0100 |
---|---|---|
committer | Keith Packard <keithp@neko.keithp.com> | 2007-06-19 14:51:57 +0100 |
commit | 7796084baf2dd32b6282d424ca77b0e56b499217 (patch) | |
tree | 7cc7b2e5d6b4a7a316303679c72b6bd081ecab75 |
Import grandr to git
-rw-r--r-- | AUTHORS | 1 | ||||
-rw-r--r-- | COPYING | 19 | ||||
-rw-r--r-- | ChangeLog | 0 | ||||
-rw-r--r-- | INSTALL | 236 | ||||
-rw-r--r-- | Makefile.am | 49 | ||||
-rw-r--r-- | NEWS | 0 | ||||
-rw-r--r-- | README | 39 | ||||
-rwxr-xr-x | autogen.sh | 159 | ||||
-rw-r--r-- | configure.in | 41 | ||||
-rw-r--r-- | grandr.glade | 1303 | ||||
-rw-r--r-- | grandr.gladep | 30 | ||||
-rw-r--r-- | src/Makefile.am | 39 | ||||
-rw-r--r-- | src/callbacks.c | 399 | ||||
-rw-r--r-- | src/callbacks.h | 106 | ||||
-rw-r--r-- | src/constant.h | 88 | ||||
-rw-r--r-- | src/grandr.c | 1435 | ||||
-rw-r--r-- | src/grandr.h | 125 | ||||
-rw-r--r-- | src/interface.c | 620 | ||||
-rw-r--r-- | src/interface.h | 26 | ||||
-rw-r--r-- | src/main.c | 132 | ||||
-rw-r--r-- | src/pixmap.c | 566 | ||||
-rw-r--r-- | src/support.c | 165 | ||||
-rw-r--r-- | src/support.h | 90 |
23 files changed, 5668 insertions, 0 deletions
@@ -0,0 +1 @@ +Ming Lin (ming.m.lin@intel.com) @@ -0,0 +1,19 @@ +Copyright © 2007 Intel Corporation + +Permission is hereby granted, free of charge, to any person obtaining a copy +of this software and associated documentation files (the "Software"), to deal +in the Software without restriction, including without limitation the rights +to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +copies of the Software, and to permit persons to whom the Software is +furnished to do so, subject to the following conditions: + +The above copyright notice and this permission notice shall be included in +all copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN +THE SOFTWARE. diff --git a/ChangeLog b/ChangeLog new file mode 100644 index 0000000..e69de29 --- /dev/null +++ b/ChangeLog @@ -0,0 +1,236 @@ +Installation Instructions +************************* + +Copyright (C) 1994, 1995, 1996, 1999, 2000, 2001, 2002, 2004, 2005 Free +Software Foundation, Inc. + +This file is free documentation; the Free Software Foundation gives +unlimited permission to copy, distribute and modify it. + +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, and a +file `config.log' containing compiler output (useful mainly for +debugging `configure'). + + It can also use an optional file (typically called `config.cache' +and enabled with `--cache-file=config.cache' or simply `-C') that saves +the results of its tests to speed up reconfiguring. (Caching is +disabled by default to prevent problems with accidental use of stale +cache files.) + + 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 you are using the cache, and at +some point `config.cache' contains results you don't want to keep, you +may remove or edit it. + + The file `configure.ac' (or `configure.in') is used to create +`configure' by a program called `autoconf'. You only need +`configure.ac' 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 awhile. While running, it prints some + messages telling which features it is checking for. + + 2. Type `make' to compile the package. + + 3. Optionally, type `make check' to run any self-tests that come with + the package. + + 4. Type `make install' to install the programs and any data files and + documentation. + + 5. You can remove the program binaries and object files from the + source code directory by typing `make clean'. To also remove the + files that `configure' created (so you can compile the package for + a different kind of computer), type `make distclean'. There is + also a `make maintainer-clean' target, but that is intended mainly + for the package's developers. If you use it, you may have to get + all sorts of other programs in order to regenerate files that came + with the distribution. + +Compilers and Options +===================== + +Some systems require unusual options for compilation or linking that the +`configure' script does not know about. Run `./configure --help' for +details on some of the pertinent environment variables. + + You can give `configure' initial values for configuration parameters +by setting variables in the command line or in the environment. Here +is an example: + + ./configure CC=c89 CFLAGS=-O2 LIBS=-lposix + + *Note Defining Variables::, for more details. + +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 support 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' installs the package's commands under +`/usr/local/bin', include files under `/usr/local/include', etc. You +can specify an installation prefix other than `/usr/local' by giving +`configure' the option `--prefix=PREFIX'. + + You can specify separate installation prefixes for +architecture-specific files and architecture-independent files. If you +pass the option `--exec-prefix=PREFIX' to `configure', the package uses +PREFIX as the prefix for installing programs and libraries. +Documentation and other data files still use the regular prefix. + + In addition, if you use an unusual directory layout you can give +options like `--bindir=DIR' to specify different values for particular +kinds of files. Run `configure --help' for a list of the directories +you can set and what kinds of files go in them. + + 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' cannot figure out automatically, +but needs to determine by the type of machine the package will run on. +Usually, assuming the package is built to be run on the _same_ +architectures, `configure' can figure that out, but if it prints a +message saying it cannot guess the machine type, give it the +`--build=TYPE' option. TYPE can either be a short name for the system +type, such as `sun4', or a canonical name which has the form: + + CPU-COMPANY-SYSTEM + +where SYSTEM can have one of these forms: + + OS KERNEL-OS + + 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 machine type. + + If you are _building_ compiler tools for cross-compiling, you should +use the option `--target=TYPE' to select the type of system they will +produce code for. + + If you want to _use_ a cross compiler, that generates code for a +platform different from the build platform, you should specify the +"host" platform (i.e., that on which the generated programs will +eventually be run) with `--host=TYPE'. + +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. + +Defining Variables +================== + +Variables not defined in a site shell script can be set in the +environment passed to `configure'. However, some packages may run +configure again during the build, and the customized values of these +variables may be lost. In order to avoid this problem, you should set +them in the `configure' command line, using `VAR=value'. For example: + + ./configure CC=/usr/local2/bin/gcc + +causes the specified `gcc' to be used as the C compiler (unless it is +overridden in the site shell script). Here is a another example: + + /bin/bash ./configure CONFIG_SHELL=/bin/bash + +Here the `CONFIG_SHELL=/bin/bash' operand causes subsequent +configuration-related scripts to be executed by `/bin/bash'. + +`configure' Invocation +====================== + +`configure' recognizes the following options to control how it operates. + +`--help' +`-h' + Print a summary of the options to `configure', and exit. + +`--version' +`-V' + Print the version of Autoconf used to generate the `configure' + script, and exit. + +`--cache-file=FILE' + Enable the cache: use and save the results of the tests in FILE, + traditionally `config.cache'. FILE defaults to `/dev/null' to + disable caching. + +`--config-cache' +`-C' + Alias for `--cache-file=config.cache'. + +`--quiet' +`--silent' +`-q' + Do not print messages saying which checks are being made. To + suppress all normal output, redirect it to `/dev/null' (any error + messages will still be shown). + +`--srcdir=DIR' + Look for the package's source code in directory DIR. Usually + `configure' can determine that directory automatically. + +`configure' also accepts some other, not widely useful, options. Run +`configure --help' for more details. + diff --git a/Makefile.am b/Makefile.am new file mode 100644 index 0000000..a70d14c --- /dev/null +++ b/Makefile.am @@ -0,0 +1,49 @@ +# Copyright © 2007 Intel Corporation +# +# Permission is hereby granted, free of charge, to any person obtaining a copy +# of this software and associated documentation files (the "Software"), to deal +# in the Software without restriction, including without limitation the rights +# to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +# copies of the Software, and to permit persons to whom the Software is +# furnished to do so, subject to the following conditions: +# +# The above copyright notice and this permission notice shall be included in +# all copies or substantial portions of the Software. +# +# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +# IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +# FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +# AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +# LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +# OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN +# THE SOFTWARE. +## Process this file with automake to produce Makefile.in + +SUBDIRS = src + +EXTRA_DIST = \ + autogen.sh \ + grandr.glade \ + grandr.gladep + +install-data-local: + @$(NORMAL_INSTALL) + if test -d $(srcdir)/pixmaps; then \ + $(mkinstalldirs) $(DESTDIR)$(pkgdatadir)/pixmaps; \ + for pixmap in $(srcdir)/pixmaps/*; do \ + if test -f $$pixmap; then \ + $(INSTALL_DATA) $$pixmap $(DESTDIR)$(pkgdatadir)/pixmaps; \ + fi \ + done \ + fi + +dist-hook: + if test -d pixmaps; then \ + mkdir $(distdir)/pixmaps; \ + for pixmap in pixmaps/*; do \ + if test -f $$pixmap; then \ + cp -p $$pixmap $(distdir)/pixmaps; \ + fi \ + done \ + fi + @@ -0,0 +1,39 @@ +compile enviroment +-------------------- +randproto: master branch +libXrandr: master branch +xserver: server-1.2-branch +xf86-video-intel: modesetting branch + +gtk+-2.0 >= 2.0.0 +gconf-2.0 + + +test enviroment +------------------ +the same branches as above +hardware: i945 + + +compile +-------- +./autogen.sh +or +./autogen.sh --prefix=<THE PATH YOU SPECIFIED> + +make +make install + + +hot key +------------ +GNOME MUST running +if you don't install grandr in the default PATH, please make a link to grandr in the PATH +for example, ln -s <PATH TO YOUR grandr> /usr/bin/grandr + + +There are some sceenshots in the sceenshots dir. +Any feedback is appreciated :) + +ming.m.lin@intel.com + diff --git a/autogen.sh b/autogen.sh new file mode 100755 index 0000000..9bbea2c --- /dev/null +++ b/autogen.sh @@ -0,0 +1,159 @@ +#!/bin/sh +# Run this to generate all the initial makefiles, etc. + +srcdir=`dirname $0` +test -z "$srcdir" && srcdir=. + +DIE=0 + +if [ -n "$GNOME2_DIR" ]; then + ACLOCAL_FLAGS="-I $GNOME2_DIR/share/aclocal $ACLOCAL_FLAGS" + LD_LIBRARY_PATH="$GNOME2_DIR/lib:$LD_LIBRARY_PATH" + PATH="$GNOME2_DIR/bin:$PATH" + export PATH + export LD_LIBRARY_PATH +fi + +(test -f $srcdir/configure.in) || { + echo -n "**Error**: Directory "\`$srcdir\'" does not look like the" + echo " top-level package directory" + exit 1 +} + +(autoconf --version) < /dev/null > /dev/null 2>&1 || { + echo + echo "**Error**: You must have \`autoconf' installed." + echo "Download the appropriate package for your distribution," + echo "or get the source tarball at ftp://ftp.gnu.org/pub/gnu/" + DIE=1 +} + +(grep "^AC_PROG_INTLTOOL" $srcdir/configure.in >/dev/null) && { + (intltoolize --version) < /dev/null > /dev/null 2>&1 || { + echo + echo "**Error**: You must have \`intltool' installed." + echo "You can get it from:" + echo " ftp://ftp.gnome.org/pub/GNOME/" + DIE=1 + } +} + +(grep "^AM_PROG_XML_I18N_TOOLS" $srcdir/configure.in >/dev/null) && { + (xml-i18n-toolize --version) < /dev/null > /dev/null 2>&1 || { + echo + echo "**Error**: You must have \`xml-i18n-toolize' installed." + echo "You can get it from:" + echo " ftp://ftp.gnome.org/pub/GNOME/" + DIE=1 + } +} + +(grep "^AM_PROG_LIBTOOL" $srcdir/configure.in >/dev/null) && { + (libtool --version) < /dev/null > /dev/null 2>&1 || { + echo + echo "**Error**: You must have \`libtool' installed." + echo "You can get it from: ftp://ftp.gnu.org/pub/gnu/" + DIE=1 + } +} + +(grep "^AM_GLIB_GNU_GETTEXT" $srcdir/configure.in >/dev/null) && { + (grep "sed.*POTFILES" $srcdir/configure.in) > /dev/null || \ + (glib-gettextize --version) < /dev/null > /dev/null 2>&1 || { + echo + echo "**Error**: You must have \`glib' installed." + echo "You can get it from: ftp://ftp.gtk.org/pub/gtk" + DIE=1 + } +} + +(automake --version) < /dev/null > /dev/null 2>&1 || { + echo + echo "**Error**: You must have \`automake' installed." + echo "You can get it from: ftp://ftp.gnu.org/pub/gnu/" + DIE=1 + NO_AUTOMAKE=yes +} + + +# if no automake, don't bother testing for aclocal +test -n "$NO_AUTOMAKE" || (aclocal --version) < /dev/null > /dev/null 2>&1 || { + echo + echo "**Error**: Missing \`aclocal'. The version of \`automake'" + echo "installed doesn't appear recent enough." + echo "You can get automake from ftp://ftp.gnu.org/pub/gnu/" + DIE=1 +} + +if test "$DIE" -eq 1; then + exit 1 +fi + +if test -z "$*"; then + echo "**Warning**: I am going to run \`configure' with no arguments." + echo "If you wish to pass any to it, please specify them on the" + echo \`$0\'" command line." + echo +fi + +case $CC in +xlc ) + am_opt=--include-deps;; +esac + +for coin in `find $srcdir -name configure.in -print` +do + dr=`dirname $coin` + if test -f $dr/NO-AUTO-GEN; then + echo skipping $dr -- flagged as no auto-gen + else + echo processing $dr + ( cd $dr + + aclocalinclude="$ACLOCAL_FLAGS" + + if grep "^AM_GLIB_GNU_GETTEXT" configure.in >/dev/null; then + echo "Creating $dr/aclocal.m4 ..." + test -r $dr/aclocal.m4 || touch $dr/aclocal.m4 + echo "Running glib-gettextize... Ignore non-fatal messages." + echo "no" | glib-gettextize --force --copy + echo "Making $dr/aclocal.m4 writable ..." + test -r $dr/aclocal.m4 && chmod u+w $dr/aclocal.m4 + fi + if grep "^AC_PROG_INTLTOOL" configure.in >/dev/null; then + echo "Running intltoolize..." + intltoolize --copy --force --automake + fi + if grep "^AM_PROG_XML_I18N_TOOLS" configure.in >/dev/null; then + echo "Running xml-i18n-toolize..." + xml-i18n-toolize --copy --force --automake + fi + if grep "^AM_PROG_LIBTOOL" configure.in >/dev/null; then + if test -z "$NO_LIBTOOLIZE" ; then + echo "Running libtoolize..." + libtoolize --force --copy + fi + fi + echo "Running aclocal $aclocalinclude ..." + aclocal $aclocalinclude + if grep "^AM_CONFIG_HEADER" configure.in >/dev/null; then + echo "Running autoheader..." + autoheader + fi + echo "Running automake --gnu $am_opt ..." + automake --add-missing --gnu $am_opt + echo "Running autoconf ..." + autoconf + ) + fi +done + +conf_flags="--enable-maintainer-mode" + +if test x$NOCONFIGURE = x; then + echo Running $srcdir/configure $conf_flags "$@" ... + $srcdir/configure $conf_flags "$@" \ + && echo Now type \`make\' to compile. || exit 1 +else + echo Skipping configure process. +fi diff --git a/configure.in b/configure.in new file mode 100644 index 0000000..6ba202d --- /dev/null +++ b/configure.in @@ -0,0 +1,41 @@ +dnl Copyright © 2007 Intel Corporation +dnl +dnl Permission is hereby granted, free of charge, to any person obtaining a copy +dnl of this software and associated documentation files (the "Software"), to deal +dnl in the Software without restriction, including without limitation the rights +dnl to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +dnl copies of the Software, and to permit persons to whom the Software is +dnl furnished to do so, subject to the following conditions: +dnl +dnl The above copyright notice and this permission notice shall be included in +dnl all copies or substantial portions of the Software. +dnl +dnl THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +dnl IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +dnl FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +dnl AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +dnl LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +dnl OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN +dnl THE SOFTWARE. +dnl Process this file with autoconf to produce a configure script. + +AC_INIT(configure.in) +AM_INIT_AUTOMAKE(grandr, 0.1) +AM_CONFIG_HEADER(config.h) +AM_MAINTAINER_MODE + +AC_ISC_POSIX +AC_PROG_CC +AM_PROG_CC_STDC +AC_HEADER_STDC + +pkg_modules="gtk+-2.0 >= 2.0.0 gconf-2.0 xrandr >= 1.2" +PKG_CHECK_MODULES(PACKAGE, [$pkg_modules]) +AC_SUBST(PACKAGE_CFLAGS) +AC_SUBST(PACKAGE_LIBS) + +AC_OUTPUT([ +Makefile +src/Makefile +]) + diff --git a/grandr.glade b/grandr.glade new file mode 100644 index 0000000..f1f0f91 --- /dev/null +++ b/grandr.glade @@ -0,0 +1,1303 @@ +<?xml version="1.0" standalone="no"?> <!--*- mode: xml -*--> +<!DOCTYPE glade-interface SYSTEM "http://glade.gnome.org/glade-2.0.dtd"> + +<!-- +Copyright © 2007 Intel Corporation + +Permission is hereby granted, free of charge, to any person obtaining a copy +of this software and associated documentation files (the "Software"), to deal +in the Software without restriction, including without limitation the rights +to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +copies of the Software, and to permit persons to whom the Software is +furnished to do so, subject to the following conditions: + +The above copyright notice and this permission notice shall be included in +all copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN +THE SOFTWARE. +--> + +<glade-interface> + +<widget class="GtkWindow" id="main_win"> + <property name="width_request">580</property> + <property name="visible">True</property> + <property name="title" translatable="yes">grandr</property> + <property name="type">GTK_WINDOW_TOPLEVEL</property> + <property name="window_position">GTK_WIN_POS_NONE</property> + <property name="modal">False</property> + <property name="resizable">False</property> + <property name="destroy_with_parent">False</property> + <property name="decorated">True</property> + <property name="skip_taskbar_hint">False</property> + <property name="skip_pager_hint">False</property> + <property name="type_hint">GDK_WINDOW_TYPE_HINT_NORMAL</property> + <property name="gravity">GDK_GRAVITY_NORTH_WEST</property> + <property name="focus_on_map">True</property> + <property name="urgency_hint">False</property> + + <child> + <widget class="GtkVBox" id="vbox1"> + <property name="visible">True</property> + <property name="homogeneous">False</property> + <property name="spacing">0</property> + + <child> + <widget class="GtkHBox" id="hbox3"> + <property name="visible">True</property> + <property name="homogeneous">False</property> + <property name="spacing">0</property> + + <child> + <widget class="GtkLabel" id="label15"> + <property name="visible">True</property> + <property name="label" translatable="yes"> X Server </property> + <property name="use_underline">False</property> + <property name="use_markup">False</property> + <property name="justify">GTK_JUSTIFY_LEFT</property> + <property name="wrap">False</property> + <property name="selectable">False</property> + <property name="xalign">0.5</property> + <property name="yalign">0.5</property> + <property name="xpad">0</property> + <property name="ypad">0</property> + <property name="ellipsize">PANGO_ELLIPSIZE_NONE</property> + <property name="width_chars">-1</property> + <property name="single_line_mode">False</property> + <property name="angle">0</property> + </widget> + <packing> + <property name="padding">0</property> + <property name="expand">False</property> + <property name="fill">False</property> + </packing> + </child> + + <child> + <widget class="GtkEntry" id="xserver_entry"> + <property name="visible">True</property> + <property name="sensitive">False</property> + <property name="can_focus">True</property> + <property name="editable">True</property> + <property name="visibility">True</property> + <property name="max_length">0</property> + <property name="text" translatable="yes">:0.0</property> + <property name="has_frame">True</property> + <property name="invisible_char">•</property> + <property name="activates_default">False</property> + </widget> + <packing> + <property name="padding">0</property> + <property name="expand">True</property> + <property name="fill">True</property> + </packing> + </child> + + <child> + <widget class="GtkLabel" id="label34"> + <property name="visible">True</property> + <property name="label" translatable="yes"> </property> + <property name="use_underline">False</property> + <property name="use_markup">False</property> + <property name="justify">GTK_JUSTIFY_LEFT</property> + <property name="wrap">False</property> + <property name="selectable">False</property> + <property name="xalign">0.5</property> + <property name="yalign">0.5</property> + <property name="xpad">0</property> + <property name="ypad">0</property> + <property name="ellipsize">PANGO_ELLIPSIZE_NONE</property> + <property name="width_chars">-1</property> + <property name="single_line_mode">False</property> + <property name="angle">0</property> + </widget> + <packing> + <property name="padding">0</property> + <property name="expand">False</property> + <property name="fill">False</property> + </packing> + </child> + + <child> + <widget class="GtkButton" id="about_btn"> + <property name="visible">True</property> + <property name="can_focus">True</property> + <property name="label" translatable="yes"> About </property> + <property name="use_underline">True</property> + <property name="relief">GTK_RELIEF_NORMAL</property> + <property name="focus_on_click">True</property> + <signal name="clicked" handler="on_about_btn_clicked" last_modification_time="Mon, 02 Apr 2007 02:46:58 GMT"/> + </widget> + <packing> + <property name="padding">0</property> + <property name="expand">False</property> + <property name="fill">False</property> + </packing> + </child> + </widget> + <packing> + <property name="padding">0</property> + <property name="expand">False</property> + <property name="fill">True</property> + </packing> + </child> + + <child> + <widget class="GtkLabel" id="label17"> + <property name="visible">True</property> + <property name="label" translatable="yes"></property> + <property name="use_underline">False</property> + <property name="use_markup">False</property> + <property name="justify">GTK_JUSTIFY_LEFT</property> + <property name="wrap">False</property> + <property name="selectable">False</property> + <property name="xalign">0.5</property> + <property name="yalign">0.5</property> + <property name="xpad">0</property> + <property name="ypad">0</property> + <property name="ellipsize">PANGO_ELLIPSIZE_NONE</property> + <property name="width_chars">-1</property> + <property name="single_line_mode">False</property> + <property name="angle">0</property> + </widget> + <packing> + <property name="padding">0</property> + <property name="expand">False</property> + <property name="fill">False</property> + </packing> + </child> + + <child> + <widget class="GtkHBox" id="hbox1"> + <property name="visible">True</property> + <property name="homogeneous">False</property> + <property name="spacing">0</property> + + <child> + <widget class="GtkScrolledWindow" id="scrolledwindow1"> + <property name="visible">True</property> + <property name="can_focus">True</property> + <property name="hscrollbar_policy">GTK_POLICY_AUTOMATIC</property> + <property name="vscrollbar_policy">GTK_POLICY_AUTOMATIC</property> + <property name="shadow_type">GTK_SHADOW_IN</property> + <property name="window_placement">GTK_CORNER_TOP_LEFT</property> + + <child> + <widget class="GtkViewport" id="viewport1"> + <property name="visible">True</property> + <property name="shadow_type">GTK_SHADOW_IN</property> + + <child> + <widget class="GtkVBox" id="vbox2"> + <property name="visible">True</property> + <property name="homogeneous">False</property> + <property name="spacing">0</property> + + <child> + <widget class="GtkLabel" id="label9"> + <property name="visible">True</property> + <property name="label" translatable="yes">Outpus </property> + <property name="use_underline">False</property> + <property name="use_markup">False</property> + <property name="justify">GTK_JUSTIFY_LEFT</property> + <property name="wrap">False</property> + <property name="selectable">False</property> + <property name="xalign">0.5</property> + <property name="yalign">0.5</property> + <property name="xpad">0</property> + <property name="ypad">0</property> + <property name="ellipsize">PANGO_ELLIPSIZE_NONE</property> + <property name="width_chars">-1</property> + <property name="single_line_mode">False</property> + <property name="angle">0</property> + </widget> + <packing> + <property name="padding">0</property> + <property name="expand">False</property> + <property name="fill">False</property> + </packing> + </child> + + <child> + <widget class="GtkIconView" id="output_iview"> + <property name="visible">True</property> + <property name="can_focus">True</property> + <property name="selection_mode">GTK_SELECTION_SINGLE</property> + <property name="orientation">GTK_ORIENTATION_HORIZONTAL</property> + <property name="reorderable">False</property> + <signal name="selection_changed" handler="on_output_iview_selection_changed" last_modification_time="Tue, 02 Jan 2007 08:36:00 GMT"/> + </widget> + <packing> + <property name="padding">0</property> + <property name="expand">True</property> + <property name="fill">True</property> + </packing> + </child> + </widget> + </child> + </widget> + </child> + </widget> + <packing> + <property name="padding">0</property> + <property name="expand">True</property> + <property name="fill">True</property> + </packing> + </child> + + <child> + <widget class="GtkLabel" id="label16"> + <property name="visible">True</property> + <property name="label" translatable="yes"> </property> + <property name="use_underline">False</property> + <property name="use_markup">False</property> + <property name="justify">GTK_JUSTIFY_LEFT</property> + <property name="wrap">False</property> + <property name="selectable">False</property> + <property name="xalign">0.5</property> + <property name="yalign">0.5</property> + <property name="xpad">0</property> + <property name="ypad">0</property> + <property name="ellipsize">PANGO_ELLIPSIZE_NONE</property> + <property name="width_chars">-1</property> + <property name="single_line_mode">False</property> + <property name="angle">0</property> + </widget> + <packing> + <property name="padding">0</property> + <property name="expand">False</property> + <property name="fill">False</property> + </packing> + </child> + + <child> + <widget class="GtkNotebook" id="setting_notebook"> + <property name="visible">True</property> + <property name="can_focus">True</property> + <property name="show_tabs">True</property> + <property name="show_border">True</property> + <property name="tab_pos">GTK_POS_TOP</property> + <property name="scrollable">False</property> + <property name="enable_popup">False</property> + + <child> + <widget class="GtkFrame" id="frame1"> + <property name="visible">True</property> + <property name="label_xalign">0</property> + <property name="label_yalign">0.5</property> + <property name="shadow_type">GTK_SHADOW_ETCHED_OUT</property> + + <child> + <widget class="GtkHBox" id="hbox5"> + <property name="visible">True</property> + <property name="homogeneous">False</property> + <property name="spacing">0</property> + + <child> + <widget class="GtkTable" id="table3"> + <property name="visible">True</property> + <property name="n_rows">2</property> + <property name="n_columns">2</property> + <property name="homogeneous">False</property> + <property name="row_spacing">0</property> + <property name="column_spacing">0</property> + + <child> + <widget class="GtkLabel" id="label24"> + <property name="visible">True</property> + <property name="label" translatable="yes"> Modes </property> + <property name="use_underline">False</property> + <property name="use_markup">False</property> + <property name="justify">GTK_JUSTIFY_LEFT</property> + <property name="wrap">False</property> + <property name="selectable">False</property> + <property name="xalign">0</property> + <property name="yalign">0.5</property> + <property name="xpad">0</property> + <property name="ypad">0</property> + <property name="ellipsize">PANGO_ELLIPSIZE_NONE</property> + <property name="width_chars">-1</property> + <property name="single_line_mode">False</property> + <property name="angle">0</property> + </widget> + <packing> + <property name="left_attach">0</property> + <property name="right_attach">1</property> + <property name="top_attach">0</property> + <property name="bottom_attach">1</property> + <property name="x_options">fill</property> + <property name="y_options"></property> + </packing> + </child> + + <child> + <widget class="GtkComboBoxEntry" id="modes_combo"> + <property name="visible">True</property> + <property name="add_tearoffs">False</property> + <property name="has_frame">True</property> + <property name="focus_on_click">True</property> + <signal name="changed" handler="on_modes_combo_changed" last_modification_time="Thu, 04 Jan 2007 01:25:16 GMT"/> + </widget> + <packing> + <property name="left_attach">1</property> + <property name="right_attach">2</property> + <property name="top_attach">0</property> + <property name="bottom_attach">1</property> + <property name="y_options">fill</property> + </packing> + </child> + + <child> + <widget class="GtkVBox" id="vbox6"> + <property name="visible">True</property> + <property name="homogeneous">False</property> + <property name="spacing">0</property> + + <child> + <widget class="GtkLabel" id="label32"> + <property name="visible">True</property> + <property name="label" translatable="yes"></property> + <property name="use_underline">False</property> + <property name="use_markup">False</property> + <property name="justify">GTK_JUSTIFY_LEFT</property> + <property name="wrap">False</property> + <property name="selectable">False</property> + <property name="xalign">0.5</property> + <property name="yalign">0.5</property> + <property name="xpad">0</property> + <property name="ypad">0</property> + <property name="ellipsize">PANGO_ELLIPSIZE_NONE</property> + <property name="width_chars">-1</property> + <property name="single_line_mode">False</property> + <property name="angle">0</property> + </widget> + <packing> + <property name="padding">0</property> + <property name="expand">False</property> + <property name="fill">False</property> + </packing> + </child> + + <child> + <widget class="GtkCheckButton" id="auto_cbtn"> + <property name="visible">True</property> + <property name="can_focus">True</property> + <property name="label" translatable="yes">Auto</property> + <property name="use_underline">True</property> + <property name="relief">GTK_RELIEF_NORMAL</property> + <property name="focus_on_click">True</property> + <property name="active">False</property> + <property name="inconsistent">False</property> + <property name="draw_indicator">True</property> + <signal name="toggled" handler="on_auto_cbtn_toggled" last_modification_time="Thu, 11 Jan 2007 04:14:22 GMT"/> + </widget> + <packing> + <property name="padding">0</property> + <property name="expand">False</property> + <property name="fill">False</property> + </packing> + </child> + + <child> + <widget class="GtkLabel" id="label33"> + <property name="visible">True</property> + <property name="label" translatable="yes"></property> + <property name="use_underline">False</property> + <property name="use_markup">False</property> + <property name="justify">GTK_JUSTIFY_LEFT</property> + <property name="wrap">False</property> + <property name="selectable">False</property> + <property name="xalign">0.5</property> + <property name="yalign">0.5</property> + <property name="xpad">0</property> + <property name="ypad">0</property> + <property name="ellipsize">PANGO_ELLIPSIZE_NONE</property> + <property name="width_chars">-1</property> + <property name="single_line_mode">False</property> + <property name="angle">0</property> + </widget> + <packing> + <property name="padding">0</property> + <property name="expand">False</property> + <property name="fill">False</property> + </packing> + </child> + + <child> + <widget class="GtkCheckButton" id="off_cbtn"> + <property name="visible">True</property> + <property name="can_focus">True</property> + <property name="label" translatable="yes">Off</property> + <property name="use_underline">True</property> + <property name="relief">GTK_RELIEF_NORMAL</property> + <property name="focus_on_click">True</property> + <property name="active">False</property> + <property name="inconsistent">False</property> + <property name="draw_indicator">True</property> + <signal name="toggled" handler="on_off_cbtn_toggled" last_modification_time="Thu, 11 Jan 2007 04:20:35 GMT"/> + </widget> + <packing> + <property name="padding">0</property> + <property name="expand">False</property> + <property name="fill">False</property> + </packing> + </child> + </widget> + <packing> + <property name="left_attach">0</property> + <property name="right_attach">1</property> + <property name="top_attach">1</property> + <property name="bottom_attach">2</property> + <property name="x_options">fill</property> + </packing> + </child> + </widget> + <packing> + <property name="padding">0</property> + <property name="expand">True</property> + <property name="fill">True</property> + </packing> + </child> + </widget> + </child> + + <child> + <widget class="GtkLabel" id="label6"> + <property name="visible">True</property> + <property name="label" translatable="yes">Settings</property> + <property name="use_underline">False</property> + <property name="use_markup">True</property> + <property name="justify">GTK_JUSTIFY_LEFT</property> + <property name="wrap">False</property> + <property name="selectable">False</property> + <property name="xalign">0.5</property> + <property name="yalign">0.5</property> + <property name="xpad">0</property> + <property name="ypad">0</property> + <property name="ellipsize">PANGO_ELLIPSIZE_NONE</property> + <property name="width_chars">-1</property> + <property name="single_line_mode">False</property> + <property name="angle">0</property> + </widget> + <packing> + <property name="type">label_item</property> + </packing> + </child> + </widget> + <packing> + <property name="tab_expand">False</property> + <property name="tab_fill">True</property> + </packing> + </child> + + <child> + <widget class="GtkLabel" id="label2"> + <property name="visible">True</property> + <property name="label" translatable="yes">Basic</property> + <property name="use_underline">False</property> + <property name="use_markup">False</property> + <property name="justify">GTK_JUSTIFY_LEFT</property> + <property name="wrap">False</property> + <property name="selectable">False</property> + <property name="xalign">0.5</property> + <property name="yalign">0.5</property> + <property name="xpad">0</property> + <property name="ypad">0</property> + <property name="ellipsize">PANGO_ELLIPSIZE_NONE</property> + <property name="width_chars">-1</property> + <property name="single_line_mode">False</property> + <property name="angle">0</property> + </widget> + <packing> + <property name="type">tab</property> + </packing> + </child> + + <child> + <widget class="GtkFrame" id="frame4"> + <property name="visible">True</property> + <property name="label_xalign">0</property> + <property name="label_yalign">0.5</property> + <property name="shadow_type">GTK_SHADOW_ETCHED_OUT</property> + + <child> + <widget class="GtkAlignment" id="alignment4"> + <property name="visible">True</property> + <property name="xalign">0.5</property> + <property name="yalign">0.5</property> + <property name="xscale">1</property> + <property name="yscale">1</property> + <property name="top_padding">0</property> + <property name="bottom_padding">0</property> + <property name="left_padding">12</property> + <property name="right_padding">0</property> + + <child> + <widget class="GtkHBox" id="hbox2"> + <property name="visible">True</property> + <property name="homogeneous">False</property> + <property name="spacing">0</property> + + <child> + <widget class="GtkImage" id="rotation_img"> + <property name="visible">True</property> + <property name="icon_size">4</property> + <property name="icon_name">gtk-go-up</property> + <property name="xalign">0.5</property> + <property name="yalign">0.5</property> + <property name="xpad">0</property> + <property name="ypad">0</property> + </widget> + <packing> + <property name="padding">0</property> + <property name="expand">True</property> + <property name="fill">True</property> + </packing> + </child> + + <child> + <widget class="GtkVBox" id="vbox3"> + <property name="visible">True</property> + <property name="homogeneous">False</property> + <property name="spacing">0</property> + + <child> + <widget class="GtkRadioButton" id="rotation0_rbtn"> + <property name="visible">True</property> + <property name="sensitive">False</property> + <property name="can_focus">True</property> + <property name="label" translatable="yes">Normal</property> + <property name="use_underline">True</property> + <property name="relief">GTK_RELIEF_NORMAL</property> + <property name="focus_on_click">True</property> + <property name="active">False</property> + <property name="inconsistent">False</property> + <property name="draw_indicator">True</property> + <signal name="pressed" handler="on_rotation0_rbtn_pressed" last_modification_time="Tue, 02 Jan 2007 05:34:04 GMT"/> + </widget> + <packing> + <property name="padding">0</property> + <property name="expand">False</property> + <property name="fill">False</property> + </packing> + </child> + + <child> + <widget class="GtkRadioButton" id="rotation90_rbtn"> + <property name="visible">True</property> + <property name="sensitive">False</property> + <property name="can_focus">True</property> + <property name="label" translatable="yes">left</property> + <property name="use_underline">True</property> + <property name="relief">GTK_RELIEF_NORMAL</property> + <property name="focus_on_click">True</property> + <property name="active">False</property> + <property name="inconsistent">False</property> + <property name="draw_indicator">True</property> + <property name="group">rotation0_rbtn</property> + <signal name="pressed" handler="on_rotation90_rbtn_pressed" last_modification_time="Tue, 02 Jan 2007 05:39:02 GMT"/> + </widget> + <packing> + <property name="padding">0</property> + <property name="expand">False</property> + <property name="fill">False</property> + </packing> + </child> + + <child> + <widget class="GtkRadioButton" id="rotation180_rbtn"> + <property name="visible">True</property> + <property name="sensitive">False</property> + <property name="can_focus">True</property> + <property name="label" translatable="yes">inverted</property> + <property name="use_underline">True</property> + <property name="relief">GTK_RELIEF_NORMAL</property> + <property name="focus_on_click">True</property> + <property name="active">False</property> + <property name="inconsistent">False</property> + <property name="draw_indicator">True</property> + <property name="group">rotation0_rbtn</property> + <signal name="pressed" handler="on_rotation180_rbtn_pressed" last_modification_time="Tue, 02 Jan 2007 05:39:07 GMT"/> + </widget> + <packing> + <property name="padding">0</property> + <property name="expand">False</property> + <property name="fill">False</property> + </packing> + </child> + + <child> + <widget class="GtkRadioButton" id="rotation270_rbtn"> + <property name="visible">True</property> + <property name="sensitive">False</property> + <property name="can_focus">True</property> + <property name="label" translatable="yes">right</property> + <property name="use_underline">True</property> + <property name="relief">GTK_RELIEF_NORMAL</property> + <property name="focus_on_click">True</property> + <property name="active">False</property> + <property name="inconsistent">False</property> + <property name="draw_indicator">True</property> + <property name="group">rotation0_rbtn</property> + <signal name="pressed" handler="on_rotation270_rbtn_pressed" last_modification_time="Tue, 02 Jan 2007 05:39:11 GMT"/> + </widget> + <packing> + <property name="padding">0</property> + <property name="expand">False</property> + <property name="fill">False</property> + </packing> + </child> + </widget> + <packing> + <property name="padding">0</property> + <property name="expand">True</property> + <property name="fill">True</property> + </packing> + </child> + </widget> + </child> + </widget> + </child> + + <child> + <widget class="GtkLabel" id="label13"> + <property name="visible">True</property> + <property name="label" translatable="yes">Rotation Views</property> + <property name="use_underline">False</property> + <property name="use_markup">True</property> + <property name="justify">GTK_JUSTIFY_LEFT</property> + <property name="wrap">False</property> + <property name="selectable">False</property> + <property name="xalign">0.5</property> + <property name="yalign">0.5</property> + <property name="xpad">0</property> + <property name="ypad">0</property> + <property name="ellipsize">PANGO_ELLIPSIZE_NONE</property> + <property name="width_chars">-1</property> + <property name="single_line_mode">False</property> + <property name="angle">0</property> + </widget> + <packing> + <property name="type">label_item</property> + </packing> + </child> + </widget> + <packing> + <property name="tab_expand">False</property> + <property name="tab_fill">True</property> + </packing> + </child> + + <child> + <widget class="GtkLabel" id="label3"> + <property name="visible">True</property> + <property name="label" translatable="yes">Rotation</property> + <property name="use_underline">False</property> + <property name="use_markup">False</property> + <property name="justify">GTK_JUSTIFY_LEFT</property> + <property name="wrap">False</property> + <property name="selectable">False</property> + <property name="xalign">0.5</property> + <property name="yalign">0.5</property> + <property name="xpad">0</property> + <property name="ypad">0</property> + <property name="ellipsize">PANGO_ELLIPSIZE_NONE</property> + <property name="width_chars">-1</property> + <property name="single_line_mode">False</property> + <property name="angle">0</property> + </widget> + <packing> + <property name="type">tab</property> + </packing> + </child> + + <child> + <widget class="GtkFrame" id="frame3"> + <property name="visible">True</property> + <property name="label_xalign">0</property> + <property name="label_yalign">0.5</property> + <property name="shadow_type">GTK_SHADOW_ETCHED_OUT</property> + + <child> + <widget class="GtkAlignment" id="alignment3"> + <property name="visible">True</property> + <property name="xalign">0.5</property> + <property name="yalign">0.5</property> + <property name="xscale">1</property> + <property name="yscale">1</property> + <property name="top_padding">0</property> + <property name="bottom_padding">0</property> + <property name="left_padding">12</property> + <property name="right_padding">0</property> + + <child> + <widget class="GtkVBox" id="vbox5"> + <property name="visible">True</property> + <property name="homogeneous">False</property> + <property name="spacing">0</property> + + <child> + <widget class="GtkHBox" id="hbox4"> + <property name="visible">True</property> + <property name="homogeneous">False</property> + <property name="spacing">0</property> + + <child> + <widget class="GtkRadioButton" id="clone_rbtn"> + <property name="visible">True</property> + <property name="sensitive">False</property> + <property name="can_focus">True</property> + <property name="label" translatable="yes">Clone</property> + <property name="use_underline">True</property> + <property name="relief">GTK_RELIEF_NORMAL</property> + <property name="focus_on_click">True</property> + <property name="active">False</property> + <property name="inconsistent">False</property> + <property name="draw_indicator">True</property> + <signal name="pressed" handler="on_clone_rbtn_pressed" last_modification_time="Thu, 04 Jan 2007 04:06:02 GMT"/> + </widget> + <packing> + <property name="padding">0</property> + <property name="expand">False</property> + <property name="fill">False</property> + </packing> + </child> + + <child> + <widget class="GtkRadioButton" id="panorama_rbtn"> + <property name="visible">True</property> + <property name="sensitive">False</property> + <property name="can_focus">True</property> + <property name="label" translatable="yes">Extend</property> + <property name="use_underline">True</property> + <property name="relief">GTK_RELIEF_NORMAL</property> + <property name="focus_on_click">True</property> + <property name="active">False</property> + <property name="inconsistent">False</property> + <property name="draw_indicator">True</property> + <property name="group">clone_rbtn</property> + <signal name="pressed" handler="on_panorama_rbtn_pressed" last_modification_time="Thu, 04 Jan 2007 04:06:08 GMT"/> + </widget> + <packing> + <property name="padding">0</property> + <property name="expand">False</property> + <property name="fill">False</property> + </packing> + </child> + </widget> + <packing> + <property name="padding">0</property> + <property name="expand">True</property> + <property name="fill">True</property> + </packing> + </child> + + <child> + <widget class="GtkLabel" id="label31"> + <property name="visible">True</property> + <property name="label" translatable="yes">Drag output icon to desired position</property> + <property name="use_underline">False</property> + <property name="use_markup">False</property> + <property name="justify">GTK_JUSTIFY_LEFT</property> + <property name="wrap">False</property> + <property name="selectable">False</property> + <property name="xalign">0.5</property> + <property name="yalign">0.5</property> + <property name="xpad">0</property> + <property name="ypad">0</property> + <property name="ellipsize">PANGO_ELLIPSIZE_NONE</property> + <property name="width_chars">-1</property> + <property name="single_line_mode">False</property> + <property name="angle">0</property> + </widget> + <packing> + <property name="padding">0</property> + <property name="expand">False</property> + <property name="fill">False</property> + </packing> + </child> + + <child> + <widget class="GtkHSeparator" id="hseparator1"> + <property name="visible">True</property> + </widget> + <packing> + <property name="padding">0</property> + <property name="expand">True</property> + <property name="fill">True</property> + </packing> + </child> + + <child> + <widget class="GtkTable" id="table5"> + <property name="visible">True</property> + <property name="n_rows">5</property> + <property name="n_columns">5</property> + <property name="homogeneous">False</property> + <property name="row_spacing">0</property> + <property name="column_spacing">0</property> + + <child> + <widget class="GtkScrolledWindow" id="scrolledwindow2"> + <property name="visible">True</property> + <property name="can_focus">True</property> + <property name="hscrollbar_policy">GTK_POLICY_AUTOMATIC</property> + <property name="vscrollbar_policy">GTK_POLICY_AUTOMATIC</property> + <property name="shadow_type">GTK_SHADOW_IN</property> + <property name="window_placement">GTK_CORNER_TOP_LEFT</property> + + <child> + <widget class="GtkIconView" id="center_iview"> + <property name="visible">True</property> + <property name="can_focus">True</property> + <property name="selection_mode">GTK_SELECTION_SINGLE</property> + <property name="orientation">GTK_ORIENTATION_HORIZONTAL</property> + <property name="reorderable">True</property> + </widget> + </child> + </widget> + <packing> + <property name="left_attach">2</property> + <property name="right_attach">3</property> + <property name="top_attach">2</property> + <property name="bottom_attach">3</property> + </packing> + </child> + + <child> + <widget class="GtkScrolledWindow" id="scrolledwindow3"> + <property name="visible">True</property> + <property name="can_focus">True</property> + <property name="hscrollbar_policy">GTK_POLICY_AUTOMATIC</property> + <property name="vscrollbar_policy">GTK_POLICY_AUTOMATIC</property> + <property name="shadow_type">GTK_SHADOW_IN</property> + <property name="window_placement">GTK_CORNER_TOP_LEFT</property> + + <child> + <widget class="GtkIconView" id="left_iview"> + <property name="visible">True</property> + <property name="can_focus">True</property> + <property name="selection_mode">GTK_SELECTION_SINGLE</property> + <property name="orientation">GTK_ORIENTATION_VERTICAL</property> + <property name="reorderable">True</property> + </widget> + </child> + </widget> + <packing> + <property name="left_attach">0</property> + <property name="right_attach">1</property> + <property name="top_attach">2</property> + <property name="bottom_attach">3</property> + <property name="y_options">fill</property> + </packing> + </child> + + <child> + <widget class="GtkScrolledWindow" id="scrolledwindow4"> + <property name="visible">True</property> + <property name="can_focus">True</property> + <property name="hscrollbar_policy">GTK_POLICY_AUTOMATIC</property> + <property name="vscrollbar_policy">GTK_POLICY_AUTOMATIC</property> + <property name="shadow_type">GTK_SHADOW_IN</property> + <property name="window_placement">GTK_CORNER_TOP_LEFT</property> + + <child> + <widget class="GtkIconView" id="right_iview"> + <property name="visible">True</property> + <property name="can_focus">True</property> + <property name="selection_mode">GTK_SELECTION_SINGLE</property> + <property name="orientation">GTK_ORIENTATION_VERTICAL</property> + <property name="reorderable">True</property> + </widget> + </child> + </widget> + <packing> + <property name="left_attach">4</property> + <property name="right_attach">5</property> + <property name="top_attach">2</property> + <property name="bottom_attach">3</property> + <property name="y_options">fill</property> + </packing> + </child> + + <child> + <widget class="GtkScrolledWindow" id="scrolledwindow5"> + <property name="visible">True</property> + <property name="can_focus">True</property> + <property name="hscrollbar_policy">GTK_POLICY_AUTOMATIC</property> + <property name="vscrollbar_policy">GTK_POLICY_AUTOMATIC</property> + <property name="shadow_type">GTK_SHADOW_IN</property> + <property name="window_placement">GTK_CORNER_TOP_LEFT</property> + + <child> + <widget class="GtkIconView" id="above_iview"> + <property name="visible">True</property> + <property name="can_focus">True</property> + <property name="selection_mode">GTK_SELECTION_SINGLE</property> + <property name="orientation">GTK_ORIENTATION_VERTICAL</property> + <property name="reorderable">True</property> + </widget> + </child> + </widget> + <packing> + <property name="left_attach">2</property> + <property name="right_attach">3</property> + <property name="top_attach">0</property> + <property name="bottom_attach">1</property> + <property name="x_options">fill</property> + </packing> + </child> + + <child> + <widget class="GtkScrolledWindow" id="scrolledwindow6"> + <property name="visible">True</property> + <property name="can_focus">True</property> + <property name="hscrollbar_policy">GTK_POLICY_AUTOMATIC</property> + <property name="vscrollbar_policy">GTK_POLICY_AUTOMATIC</property> + <property name="shadow_type">GTK_SHADOW_IN</property> + <property name="window_placement">GTK_CORNER_TOP_LEFT</property> + + <child> + <widget class="GtkIconView" id="below_iview"> + <property name="visible">True</property> + <property name="can_focus">True</property> + <property name="selection_mode">GTK_SELECTION_SINGLE</property> + <property name="orientation">GTK_ORIENTATION_VERTICAL</property> + <property name="reorderable">True</property> + </widget> + </child> + </widget> + <packing> + <property name="left_attach">2</property> + <property name="right_attach">3</property> + <property name="top_attach">4</property> + <property name="bottom_attach">5</property> + <property name="x_options">fill</property> + </packing> + </child> + + <child> + <widget class="GtkLabel" id="label27"> + <property name="visible">True</property> + <property name="label" translatable="yes"></property> + <property name="use_underline">False</property> + <property name="use_markup">False</property> + <property name="justify">GTK_JUSTIFY_LEFT</property> + <property name="wrap">False</property> + <property name="selectable">False</property> + <property name="xalign">0</property> + <property name="yalign">0.5</property> + <property name="xpad">0</property> + <property name="ypad">0</property> + <property name="ellipsize">PANGO_ELLIPSIZE_NONE</property> + <property name="width_chars">-1</property> + <property name="single_line_mode">False</property> + <property name="angle">0</property> + </widget> + <packing> + <property name="left_attach">2</property> + <property name="right_attach">3</property> + <property name="top_attach">1</property> + <property name="bottom_attach">2</property> + <property name="x_options">fill</property> + <property name="y_options"></property> + </packing> + </child> + + <child> + <widget class="GtkLabel" id="label28"> + <property name="visible">True</property> + <property name="label" translatable="yes"> </property> + <property name="use_underline">False</property> + <property name="use_markup">False</property> + <property name="justify">GTK_JUSTIFY_LEFT</property> + <property name="wrap">False</property> + <property name="selectable">False</property> + <property name="xalign">0</property> + <property name="yalign">0.5</property> + <property name="xpad">0</property> + <property name="ypad">0</property> + <property name="ellipsize">PANGO_ELLIPSIZE_NONE</property> + <property name="width_chars">-1</property> + <property name="single_line_mode">False</property> + <property name="angle">0</property> + </widget> + <packing> + <property name="left_attach">1</property> + <property name="right_attach">2</property> + <property name="top_attach">2</property> + <property name="bottom_attach">3</property> + <property name="x_options">fill</property> + <property name="y_options"></property> + </packing> + </child> + + <child> + <widget class="GtkLabel" id="label29"> + <property name="visible">True</property> + <property name="label" translatable="yes"> </property> + <property name="use_underline">False</property> + <property name="use_markup">False</property> + <property name="justify">GTK_JUSTIFY_LEFT</property> + <property name="wrap">False</property> + <property name="selectable">False</property> + <property name="xalign">0</property> + <property name="yalign">0.5</property> + <property name="xpad">0</property> + <property name="ypad">0</property> + <property name="ellipsize">PANGO_ELLIPSIZE_NONE</property> + <property name="width_chars">-1</property> + <property name="single_line_mode">False</property> + <property name="angle">0</property> + </widget> + <packing> + <property name="left_attach">3</property> + <property name="right_attach">4</property> + <property name="top_attach">2</property> + <property name="bottom_attach">3</property> + <property name="x_options">fill</property> + <property name="y_options"></property> + </packing> + </child> + + <child> + <widget class="GtkLabel" id="label30"> + <property name="visible">True</property> + <property name="label" translatable="yes"></property> + <property name="use_underline">False</property> + <property name="use_markup">False</property> + <property name="justify">GTK_JUSTIFY_LEFT</property> + <property name="wrap">False</property> + <property name="selectable">False</property> + <property name="xalign">0</property> + <property name="yalign">0.5</property> + <property name="xpad">0</property> + <property name="ypad">0</property> + <property name="ellipsize">PANGO_ELLIPSIZE_NONE</property> + <property name="width_chars">-1</property> + <property name="single_line_mode">False</property> + <property name="angle">0</property> + </widget> + <packing> + <property name="left_attach">2</property> + <property name="right_attach">3</property> + <property name="top_attach">3</property> + <property name="bottom_attach">4</property> + <property name="x_options">fill</property> + <property name="y_options"></property> + </packing> + </child> + </widget> + <packing> + <property name="padding">0</property> + <property name="expand">True</property> + <property name="fill">True</property> + </packing> + </child> + </widget> + </child> + </widget> + </child> + + <child> + <widget class="GtkLabel" id="label8"> + <property name="visible">True</property> + <property name="label" translatable="yes">Output Layout</property> + <property name="use_underline">False</property> + <property name="use_markup">True</property> + <property name="justify">GTK_JUSTIFY_LEFT</property> + <property name="wrap">False</property> + <property name="selectable">False</property> + <property name="xalign">0.5</property> + <property name="yalign">0.5</property> + <property name="xpad">0</property> + <property name="ypad">0</property> + <property name="ellipsize">PANGO_ELLIPSIZE_NONE</property> + <property name="width_chars">-1</property> + <property name="single_line_mode">False</property> + <property name="angle">0</property> + </widget> + <packing> + <property name="type">label_item</property> + </packing> + </child> + </widget> + <packing> + <property name="tab_expand">False</property> + <property name="tab_fill">True</property> + </packing> + </child> + + <child> + <widget class="GtkLabel" id="label4"> + <property name="visible">True</property> + <property name="label" translatable="yes">Layout</property> + <property name="use_underline">False</property> + <property name="use_markup">False</property> + <property name="justify">GTK_JUSTIFY_LEFT</property> + <property name="wrap">False</property> + <property name="selectable">False</property> + <property name="xalign">0.5</property> + <property name="yalign">0.5</property> + <property name="xpad">0</property> + <property name="ypad">0</property> + <property name="ellipsize">PANGO_ELLIPSIZE_NONE</property> + <property name="width_chars">-1</property> + <property name="single_line_mode">False</property> + <property name="angle">0</property> + </widget> + <packing> + <property name="type">tab</property> + </packing> + </child> + + <child> + <widget class="GtkVBox" id="vbox4"> + <property name="visible">True</property> + <property name="homogeneous">False</property> + <property name="spacing">0</property> + + <child> + <widget class="GtkCheckButton" id="hotkey_cbtn"> + <property name="visible">True</property> + <property name="can_focus">True</property> + <property name="label" translatable="yes">Enable Hot Keys</property> + <property name="use_underline">True</property> + <property name="relief">GTK_RELIEF_NORMAL</property> + <property name="focus_on_click">True</property> + <property name="active">False</property> + <property name="inconsistent">False</property> + <property name="draw_indicator">True</property> + <signal name="toggled" handler="on_hotkey_cbtn_toggled" last_modification_time="Wed, 17 Jan 2007 01:37:28 GMT"/> + </widget> + <packing> + <property name="padding">0</property> + <property name="expand">False</property> + <property name="fill">False</property> + </packing> + </child> + + <child> + <widget class="GtkTreeView" id="hotkey_tview"> + <property name="visible">True</property> + <property name="can_focus">True</property> + <property name="headers_visible">True</property> + <property name="rules_hint">False</property> + <property name="reorderable">False</property> + <property name="enable_search">True</property> + <property name="fixed_height_mode">False</property> + <property name="hover_selection">False</property> + <property name="hover_expand">False</property> + </widget> + <packing> + <property name="padding">0</property> + <property name="expand">True</property> + <property name="fill">True</property> + </packing> + </child> + </widget> + <packing> + <property name="tab_expand">False</property> + <property name="tab_fill">True</property> + </packing> + </child> + + <child> + <widget class="GtkLabel" id="label5"> + <property name="visible">True</property> + <property name="label" translatable="yes">Hot Keys</property> + <property name="use_underline">False</property> + <property name="use_markup">False</property> + <property name="justify">GTK_JUSTIFY_LEFT</property> + <property name="wrap">False</property> + <property name="selectable">False</property> + <property name="xalign">0.5</property> + <property name="yalign">0.5</property> + <property name="xpad">0</property> + <property name="ypad">0</property> + <property name="ellipsize">PANGO_ELLIPSIZE_NONE</property> + <property name="width_chars">-1</property> + <property name="single_line_mode">False</property> + <property name="angle">0</property> + </widget> + <packing> + <property name="type">tab</property> + </packing> + </child> + </widget> + <packing> + <property name="padding">0</property> + <property name="expand">True</property> + <property name="fill">True</property> + </packing> + </child> + </widget> + <packing> + <property name="padding">0</property> + <property name="expand">True</property> + <property name="fill">True</property> + </packing> + </child> + + <child> + <widget class="GtkHButtonBox" id="hbuttonbox1"> + <property name="visible">True</property> + <property name="layout_style">GTK_BUTTONBOX_END</property> + <property name="spacing">0</property> + + <child> + <widget class="GtkButton" id="ok_btn"> + <property name="visible">True</property> + <property name="can_default">True</property> + <property name="can_focus">True</property> + <property name="label" translatable="yes">OK</property> + <property name="use_underline">True</property> + <property name="relief">GTK_RELIEF_NORMAL</property> + <property name="focus_on_click">True</property> + <signal name="clicked" handler="on_ok_btn_clicked" last_modification_time="Sat, 30 Dec 2006 05:10:45 GMT"/> + </widget> + </child> + + <child> + <widget class="GtkButton" id="cancel_btn"> + <property name="visible">True</property> + <property name="can_default">True</property> + <property name="can_focus">True</property> + <property name="label" translatable="yes">Cancel</property> + <property name="use_underline">True</property> + <property name="relief">GTK_RELIEF_NORMAL</property> + <property name="focus_on_click">True</property> + <signal name="clicked" handler="gtk_main_quit" last_modification_time="Sat, 30 Dec 2006 05:09:16 GMT"/> + </widget> + </child> + + <child> + <widget class="GtkButton" id="apply_btn"> + <property name="visible">True</property> + <property name="can_default">True</property> + <property name="can_focus">True</property> + <property name="label" translatable="yes">Apply</property> + <property name="use_underline">True</property> + <property name="relief">GTK_RELIEF_NORMAL</property> + <property name="focus_on_click">True</property> + <signal name="clicked" handler="on_apply_btn_clicked" last_modification_time="Sun, 31 Dec 2006 06:25:12 GMT"/> + </widget> + </child> + </widget> + <packing> + <property name="padding">0</property> + <property name="expand">False</property> + <property name="fill">True</property> + </packing> + </child> + </widget> + </child> +</widget> + +</glade-interface> diff --git a/grandr.gladep b/grandr.gladep new file mode 100644 index 0000000..28af648 --- /dev/null +++ b/grandr.gladep @@ -0,0 +1,30 @@ +<?xml version="1.0" standalone="no"?> <!--*- mode: xml -*--> +<!DOCTYPE glade-project SYSTEM "http://glade.gnome.org/glade-project-2.0.dtd"> + +<!-- +Copyright © 2007 Intel Corporation + +Permission is hereby granted, free of charge, to any person obtaining a copy +of this software and associated documentation files (the "Software"), to deal +in the Software without restriction, including without limitation the rights +to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +copies of the Software, and to permit persons to whom the Software is +furnished to do so, subject to the following conditions: + +The above copyright notice and this permission notice shall be included in +all copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN +THE SOFTWARE. +--> + +<glade-project> + <name>grandr</name> + <program_name>grandr</program_name> + <gnome_support>FALSE</gnome_support> +</glade-project> diff --git a/src/Makefile.am b/src/Makefile.am new file mode 100644 index 0000000..4b30073 --- /dev/null +++ b/src/Makefile.am @@ -0,0 +1,39 @@ +# Copyright © 2007 Intel Corporation +# +# Permission is hereby granted, free of charge, to any person obtaining a copy +# of this software and associated documentation files (the "Software"), to deal +# in the Software without restriction, including without limitation the rights +# to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +# copies of the Software, and to permit persons to whom the Software is +# furnished to do so, subject to the following conditions: +# +# The above copyright notice and this permission notice shall be included in +# all copies or substantial portions of the Software. +# +# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +# IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +# FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +# AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +# LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +# OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN +# THE SOFTWARE. +## Process this file with automake to produce Makefile.in + +INCLUDES = \ + -DPACKAGE_DATA_DIR=\""$(datadir)"\" \ + -DPACKAGE_LOCALE_DIR=\""$(prefix)/$(DATADIRNAME)/locale"\" \ + @PACKAGE_CFLAGS@ + +bin_PROGRAMS = grandr + +grandr_SOURCES = \ + main.c \ + support.c support.h \ + interface.c interface.h \ + callbacks.c callbacks.h \ + grandr.c grandr.h \ + constant.h \ + pixmap.c + +grandr_LDADD = @PACKAGE_LIBS@ $(INTLLIBS) + diff --git a/src/callbacks.c b/src/callbacks.c new file mode 100644 index 0000000..788ca52 --- /dev/null +++ b/src/callbacks.c @@ -0,0 +1,399 @@ +/* + * Copyright © 2007 Intel Corporation + * + * Permission is hereby granted, free of charge, to any person obtaining a copy + * of this software and associated documentation files (the "Software"), to deal + * in the Software without restriction, including without limitation the rights + * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell + * copies of the Software, and to permit persons to whom the Software is + * furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in + * all copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE + * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, + * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN + * THE SOFTWARE. + */ +#ifdef HAVE_CONFIG_H +# include <config.h> +#endif + +#include <gtk/gtk.h> + +#include "callbacks.h" +#include "interface.h" +#include "support.h" +#include "grandr.h" + +void +on_ok_btn_clicked (GtkButton *button, + gpointer user_data) +{ + set_hotkeys(); + + if (!apply (screen_info)) { + return; + } + + free_screen_info (screen_info); + + gtk_widget_destroy (root_window); + + gtk_main_quit (); +} + + +void +on_apply_btn_clicked (GtkButton *button, + gpointer user_data) +{ + set_hotkeys(); + + if (!apply (screen_info)) { + return; + } + + printf("apply\n"); +} + + +void +on_rotation0_rbtn_pressed (GtkButton *button, + gpointer user_data) +{ + GtkImage *rotation_img = GTK_IMAGE (lookup_widget (root_window, "rotation_img")); + + gtk_image_set_from_icon_name (rotation_img, "gtk-go-up", GTK_ICON_SIZE_BUTTON); + + screen_info->cur_crtc->cur_rotation = RR_Rotate_0; +} + + +void +on_rotation90_rbtn_pressed (GtkButton *button, + gpointer user_data) +{ + GtkImage *rotation_img = GTK_IMAGE (lookup_widget (root_window, "rotation_img")); + + gtk_image_set_from_icon_name (rotation_img, "gtk-go-back", GTK_ICON_SIZE_BUTTON); + + screen_info->cur_crtc->cur_rotation = RR_Rotate_90; +} + + +void +on_rotation180_rbtn_pressed (GtkButton *button, + gpointer user_data) +{ + GtkImage *rotation_img = GTK_IMAGE (lookup_widget (root_window, "rotation_img")); + + gtk_image_set_from_icon_name (rotation_img, "gtk-go-down", GTK_ICON_SIZE_BUTTON); + + screen_info->cur_crtc->cur_rotation = RR_Rotate_180; +} + + +void +on_rotation270_rbtn_pressed (GtkButton *button, + gpointer user_data) +{ + GtkImage *rotation_img = GTK_IMAGE (lookup_widget (root_window, "rotation_img")); + + gtk_image_set_from_icon_name (rotation_img, "gtk-go-forward", GTK_ICON_SIZE_BUTTON); + + screen_info->cur_crtc->cur_rotation = RR_Rotate_270; +} + + + +void +on_output_iview_selection_changed (GtkIconView *iconview, + gpointer user_data) +{ + GtkTreeModel *model; + GtkTreeIter iter; + GList *path_list; + GtkTreePath *tree_path; + int output_id; + int i; + + path_list = gtk_icon_view_get_selected_items (iconview); + if (g_list_length (path_list) == 0) { + return; + } + + tree_path = (GtkTreePath *) path_list[0].data; + + model = gtk_icon_view_get_model (iconview); + + gtk_tree_model_get_iter (model, + &iter, tree_path); + gtk_tree_model_get (model, &iter, + COL_OUTPUT_ID, &output_id, + -1); + + for (i = 0; i < screen_info->n_output; i++) { + if (output_id == screen_info->outputs[i]->id) { + screen_info->cur_crtc = screen_info->outputs[i]->cur_crtc; + screen_info->cur_output = screen_info->outputs[i]; + + set_basic_views (screen_info->cur_output); + set_rotation_views (screen_info->cur_crtc); + + break; + } + } +} + + +void +on_modes_combo_changed (GtkComboBox *combobox, + gpointer user_data) +{ + GtkTreeModel *model; + GtkTreeIter iter; + int mode_id; + + model = gtk_combo_box_get_model (combobox); + gtk_combo_box_get_active_iter (combobox, &iter); + gtk_tree_model_get (model, &iter, + COL_MODE_ID, &mode_id, + -1); + + if (screen_info->cur_crtc) { + screen_info->cur_crtc->cur_mode_id = mode_id; + screen_info->cur_crtc->changed = 1; + } else { + struct CrtcInfo *crtc_info; + + crtc_info = auto_find_crtc (screen_info, screen_info->cur_output); + if (!crtc_info) { +#if RANDR_GUI_DEBUG + fprintf (stderr, "Can not find usable CRTC\n"); +#endif + return; + } else { + screen_info->cur_output->cur_crtc = crtc_info; + screen_info->cur_crtc = crtc_info; + screen_info->cur_crtc->cur_noutput++; + fprintf (stderr, "n output: %d\n", screen_info->cur_crtc->cur_noutput); + screen_info->cur_crtc->cur_mode_id = mode_id; + screen_info->cur_crtc->changed = 1; + } + } +} + + +void +on_clone_rbtn_pressed (GtkButton *button, + gpointer user_data) +{ + screen_info->clone = 1; + //set_output_layout (screen_info); +} + + +void +on_panorama_rbtn_pressed (GtkButton *button, + gpointer user_data) +{ + screen_info->clone = 0; + //set_output_layout (screen_info); +} + + +void +on_output_rbtn_pressed (GtkButton *button, + gpointer user_data) +{ + struct CrtcInfo *crtc_info = (struct CrtcInfo *)user_data; + + screen_info->primary_crtc = crtc_info; + + +} + + +void +on_iview_drag_data_get (GtkWidget *widget, + GdkDragContext *drag_context, + GtkSelectionData *data, + guint info, + guint time, + gpointer user_data) +{ + GtkTreeModel *model; + GtkTreeIter iter; + GList *path_list; + GtkTreePath *tree_path; + int output_id; + int i; + GtkIconView *iconview = (GtkIconView *) widget; + + if (data->format >= 8 && data->format % 8 == 0) { + //return; + } + + path_list = gtk_icon_view_get_selected_items (iconview); + if (g_list_length (path_list) == 0) { + return; + } + + tree_path = (GtkTreePath *) path_list[0].data; + + model = gtk_icon_view_get_model (iconview); + + gtk_tree_model_get_iter (model, + &iter, tree_path); + gtk_tree_model_get (model, &iter, + COL_OUTPUT_ID, &output_id, + -1); + + gtk_selection_data_set( + data, + GDK_SELECTION_TYPE_STRING, + sizeof (int), + &output_id, sizeof (int) + ); + + gtk_list_store_remove (model, &iter); +} + + +void +on_iview_drag_data_received (GtkWidget *widget, + GdkDragContext *drag_context, + gint x, + gint y, + GtkSelectionData *data, + guint info, + guint time, + gpointer user_data) +{ + GtkTreeModel *store; + GtkTreeIter iter; + GdkPixbuf *output_pixbuf; + int output_id; + char *output_name; + + if (data->format >= 8 && data->format % 8 == 0) { + //return; + } + + output_pixbuf = randr_create_pixbuf (small_pixbuf); + output_id = (int) *data->data; + output_name = get_output_name (screen_info, output_id); + + store = gtk_icon_view_get_model (widget); + gtk_list_store_append (store, &iter); + gtk_list_store_set (store, &iter, + COL_OUTPUT_ID, output_id, + COL_OUTPUT_NAME, output_name, + COL_OUTPUT_PIXBUF, output_pixbuf, + -1); +} + + +void +on_auto_cbtn_toggled (GtkToggleButton *togglebutton, + gpointer user_data) +{ + GtkWidget *mode_combo; + GtkWidget *off_cbtn; + + mode_combo = lookup_widget (root_window, MODE_COMBO_NAME); + off_cbtn = lookup_widget (root_window, OFF_CHECKBUTTON_NAME); + + if (gtk_toggle_button_get_active (togglebutton)) { + gtk_widget_set_sensitive (mode_combo, FALSE); + gtk_toggle_button_set_active (off_cbtn, FALSE); + + screen_info->cur_output->auto_set = 1; + screen_info->cur_output->off_set = 0; + + output_auto (screen_info, screen_info->cur_output); + //screen_info->cur_crtc->changed = 1; + + } else { + if (!gtk_toggle_button_get_active (off_cbtn)) { + gtk_widget_set_sensitive (mode_combo, TRUE); + } + } +} + + +void +on_off_cbtn_toggled (GtkToggleButton *togglebutton, + gpointer user_data) +{ + GtkWidget *mode_combo; + GtkWidget *auto_cbtn; + + mode_combo = lookup_widget (root_window, MODE_COMBO_NAME); + auto_cbtn = lookup_widget (root_window, AUTO_CHECKBUTTON_NAME); + + if (gtk_toggle_button_get_active (togglebutton)) { + gtk_widget_set_sensitive (mode_combo, FALSE); + gtk_toggle_button_set_active (auto_cbtn, FALSE); + + screen_info->cur_output->auto_set = 0; + screen_info->cur_output->off_set = 1; + + output_off (screen_info, screen_info->cur_output); + //screen_info->cur_crtc->changed = 1; + + } else { + if (!gtk_toggle_button_get_active (auto_cbtn)) { + gtk_widget_set_sensitive (mode_combo, TRUE); + } + } +} + + +void +on_hotkey_cbtn_toggled (GtkToggleButton *togglebutton, + gpointer user_data) +{ + GtkWidget *hotkey_tview; + + hotkey_tview = lookup_widget (root_window, HOTKEY_TREEVIEW_NAME); + + if (gtk_toggle_button_get_active (togglebutton)) { + gtk_widget_set_sensitive (hotkey_tview, TRUE); + } else { + gtk_widget_set_sensitive (hotkey_tview, FALSE); + } +} + + +void +on_about_btn_clicked (GtkButton *button, + gpointer user_data) +{ + gchar *authors[] = {"Ming Lin (ming.m.lin@intel.com)", NULL}; + gchar *comments = "This GUI is for RandR 1.2 setting\nming.m.lin@intel.com"; + gchar *license = "RandR GUI is free software; you can redistribute it and/or modify\n \ +it under the terms of the GNU General Public License as published by\n \ +the Free Software Foundation; either version 2 of the License, or\n \ +(at your option) any later version.\n\n\ +RandR GUI is distributed in the hope that it will be useful,\n \ +but WITHOUT ANY WARRANTY; without even the implied warranty of\n \ +MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the\n \ +GNU General Public License for more details.\n\n\ +You should have received a copy of the GNU General Public License \n\ +along with RandR GUI; if not, write to the Free Software Foundation, Inc.,\n \ +59 Temple Place, Suite 330, Boston, MA 02111-1307 USA"; + + gtk_show_about_dialog (root_window, + "authors", authors, + "comments", comments, + "name", "RandR GUI", + "license", license, + NULL); +} + diff --git a/src/callbacks.h b/src/callbacks.h new file mode 100644 index 0000000..5cac2ad --- /dev/null +++ b/src/callbacks.h @@ -0,0 +1,106 @@ +/* + * Copyright © 2007 Intel Corporation + * + * Permission is hereby granted, free of charge, to any person obtaining a copy + * of this software and associated documentation files (the "Software"), to deal + * in the Software without restriction, including without limitation the rights + * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell + * copies of the Software, and to permit persons to whom the Software is + * furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in + * all copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE + * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, + * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN + * THE SOFTWARE. + */ +#include <gtk/gtk.h> + + +void +on_ok_btn_clicked (GtkButton *button, + gpointer user_data); + +void +on_apply_btn_clicked (GtkButton *button, + gpointer user_data); + +void +on_rotation0_rbtn_pressed (GtkButton *button, + gpointer user_data); + +void +on_rotation90_rbtn_pressed (GtkButton *button, + gpointer user_data); + +void +on_rotation180_rbtn_pressed (GtkButton *button, + gpointer user_data); + +void +on_rotation270_rbtn_pressed (GtkButton *button, + gpointer user_data); + +void +on_output_iview_selection_changed (GtkIconView *iconview, + gpointer user_data); + +void +on_modes_combo_changed (GtkComboBox *combobox, + gpointer user_data); + +void +on_clone_rbtn_pressed (GtkButton *button, + gpointer user_data); + +void +on_panorama_rbtn_pressed (GtkButton *button, + gpointer user_data); + +void +on_output_rbtn_pressed (GtkButton *button, + gpointer user_data); + +void +on_relation_combo_changed (GtkComboBox *combobox, + gpointer user_data); + +void +on_iview_drag_data_get (GtkWidget *widget, + GdkDragContext *drag_context, + GtkSelectionData *data, + guint info, + guint time, + gpointer user_data); + +void +on_iview_drag_data_received (GtkWidget *widget, + GdkDragContext *drag_context, + gint x, + gint y, + GtkSelectionData *data, + guint info, + guint time, + gpointer user_data); + + +void +on_auto_cbtn_toggled (GtkToggleButton *togglebutton, + gpointer user_data); + +void +on_off_cbtn_toggled (GtkToggleButton *togglebutton, + gpointer user_data); + +void +on_hotkey_cbtn_toggled (GtkToggleButton *togglebutton, + gpointer user_data); + +void +on_about_btn_clicked (GtkButton *button, + gpointer user_data); diff --git a/src/constant.h b/src/constant.h new file mode 100644 index 0000000..74632c2 --- /dev/null +++ b/src/constant.h @@ -0,0 +1,88 @@ +/* + * Copyright © 2007 Intel Corporation + * + * Permission is hereby granted, free of charge, to any person obtaining a copy + * of this software and associated documentation files (the "Software"), to deal + * in the Software without restriction, including without limitation the rights + * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell + * copies of the Software, and to permit persons to whom the Software is + * furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in + * all copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE + * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, + * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN + * THE SOFTWARE. + */ +#ifndef RANDR_GUI_CONSTANT_H +#define RANDR_GUI_CONSTANT_H + +/* widget name */ +#define CENTER_ICONVIEW_NAME "center_iview" +#define LEFT_ICONVIEW_NAME "left_iview" +#define RIGHT_ICONVIEW_NAME "right_iview" +#define ABOVE_ICONVIEW_NAME "above_iview" +#define BELOW_ICONVIEW_NAME "below_iview" +#define MODE_COMBO_NAME "modes_combo" +#define AUTO_CHECKBUTTON_NAME "auto_cbtn" +#define OFF_CHECKBUTTON_NAME "off_cbtn" +#define SETTING_NOTEBOOK_NAME "setting_notebook" +#define HOTKEY_CHECKBUTTON_NAME "hotkey_cbtn" +#define HOTKEY_TREEVIEW_NAME "hotkey_tview" + +#define OUTPUT_CONNECTED (1 << 0) +#define OUTPUT_UNKNOWN (1 << 1) +#define OUTPUT_DISCONNECTED (1 << 2) +#define OUTPUT_ON (1 << 3) +#define OUTPUT_ALL (0xf) + +/*Hot Key*/ +#define APP_NAME "grandr" +#define GCONF_KEY1 "/apps/metacity/global_keybindings/run_command_1" +#define GCONF_KEY2 "/apps/metacity/keybinding_commands/command_1" +#define HOTKEY "<Shift>F19" +#define HOTKEY_STR "<Shift>F7" + +enum { + BASIC_PAGE, + ROTATION_PAGE, + LAYOUT_PAGE, + HOTKEY_PAGE, + N_PAGES +}; + +enum { + LEFT_POS, + RIGHT_POS, + ABOVE_POS, + BELOW_POS, + CENTER_POS, + N_POSITIONS +}; + +enum { + COL_OUTPUT_ID, + COL_OUTPUT_NAME, + COL_OUTPUT_PIXBUF, + N_OUTPUT_COLS +}; + +enum { + COL_MODE_NAME, + COL_MODE_ID, + N_MODE_COLS +}; + +enum +{ + COL_HOTKEY_ACTION, + COL_HOTKEY_COMBINATION, + N_HOTKEY_COLS +}; + +#endif diff --git a/src/grandr.c b/src/grandr.c new file mode 100644 index 0000000..e3e619e --- /dev/null +++ b/src/grandr.c @@ -0,0 +1,1435 @@ +/* + * Copyright © 2007 Intel Corporation + * + * Permission is hereby granted, free of charge, to any person obtaining a copy + * of this software and associated documentation files (the "Software"), to deal + * in the Software without restriction, including without limitation the rights + * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell + * copies of the Software, and to permit persons to whom the Software is + * furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in + * all copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE + * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, + * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN + * THE SOFTWARE. + */ +#include "grandr.h" +#include "support.h" +#include "callbacks.h" +#include <stdlib.h> +#include <gconf/gconf-client.h> + +static Status crtc_disable (struct CrtcInfo *crtc); + +#define RANDR_GUI_DEBUG 1 + +char * +get_output_name (struct ScreenInfo *screen_info, RROutput id) +{ + char *output_name; + int i; + + for (i = 0; i < screen_info->n_output; i++) { + if (id == screen_info->outputs[i]->id) { + output_name = screen_info->outputs[i]->info->name; + } + } + + if (!output_name) { + output_name = "Unknown"; + } + + return output_name; +} + +XRRModeInfo * +find_mode_by_xid (struct ScreenInfo *screen_info, RRMode mode_id) +{ + XRRModeInfo *mode_info; + XRRScreenResources *res; + int i; + + res = screen_info->res; + for (i = 0; i < res->nmode; i++) { + if (mode_id == res->modes[i].id) { + mode_info = &res->modes[i]; + break; + } + } + + return mode_info; +} + +static XRRCrtcInfo * +find_crtc_by_xid (struct ScreenInfo *screen_info, RRCrtc crtc_id) +{ + XRRCrtcInfo *crtc_info; + Display *dpy; + XRRScreenResources *res; + + dpy = screen_info->dpy; + res = screen_info->res; + + crtc_info = XRRGetCrtcInfo (dpy, res, crtc_id); + + return crtc_info; +} + +int +get_width_by_output_id (struct ScreenInfo *screen_info, RROutput output_id) +{ + struct OutputInfo *output_info; + struct CrtcInfo *crtc_info; + RRMode mode_id; + XRRModeInfo *mode_info; + int i; + int width = -1; + + for (i = 0; i < screen_info->n_output; i++) { + if (output_id == screen_info->outputs[i]->id) { + crtc_info = screen_info->outputs[i]->cur_crtc; + if (!crtc_info) { + width = 0; + break; + } + mode_id = crtc_info->cur_mode_id; + mode_info = find_mode_by_xid (screen_info, mode_id); + + width = mode_width (mode_info, crtc_info->cur_rotation); + + break; + } + } + + return width; +} + +int +get_height_by_output_id (struct ScreenInfo *screen_info, RROutput output_id) +{ + struct OutputInfo *output_info; + struct CrtcInfo *crtc_info; + RRMode mode_id; + XRRModeInfo *mode_info; + int i; + int height = -1; + + for (i = 0; i < screen_info->n_output; i++) { + if (output_id == screen_info->outputs[i]->id) { + crtc_info = screen_info->outputs[i]->cur_crtc; + if (!crtc_info) { + height = 0; + break; + } + mode_id = crtc_info->cur_mode_id; + mode_info = find_mode_by_xid (screen_info, mode_id); + + height = mode_height (mode_info, crtc_info->cur_rotation); + + break; + } + } + + return height; +} + +int +mode_height (XRRModeInfo *mode_info, Rotation rotation) +{ + switch (rotation & 0xf) { + case RR_Rotate_0: + case RR_Rotate_180: + return mode_info->height; + case RR_Rotate_90: + case RR_Rotate_270: + return mode_info->width; + default: + return 0; + } +} + +int +mode_width (XRRModeInfo *mode_info, Rotation rotation) +{ + switch (rotation & 0xf) { + case RR_Rotate_0: + case RR_Rotate_180: + return mode_info->width; + case RR_Rotate_90: + case RR_Rotate_270: + return mode_info->height; + default: + return 0; + } +} + + +static struct CrtcInfo * +find_crtc (struct ScreenInfo *screen_info, XRROutputInfo *output) +{ + struct CrtcInfo *crtc_info = NULL; + int i; + + for (i = 0; i < screen_info->n_crtc; i++) { + if (screen_info->crtcs[i]->id == output->crtc) { + crtc_info = screen_info->crtcs[i]; + break; + } + } + + return crtc_info; +} + +struct CrtcInfo * +auto_find_crtc (struct ScreenInfo *screen_info, struct OutputInfo *output_info) +{ + struct CrtcInfo *crtc_info = NULL; + int i; + + for (i = 0; i < screen_info->n_crtc; i++) { + if (0 == screen_info->crtcs[i]->cur_noutput) { + crtc_info = screen_info->crtcs[i]; + break; + } + } + + if (NULL == crtc_info) { + crtc_info = screen_info->crtcs[0]; + } + + return crtc_info; +} + +int +set_screen_size (struct ScreenInfo *screen_info) +{ + Display *dpy; + int screen; + struct CrtcInfo *crtc; + XRRModeInfo *mode_info; + int cur_x, cur_y; + int w, h; + int mmW, mmH; + int max_width = 0, max_height = 0; + int i; + + dpy = screen_info->dpy; + screen = DefaultScreen (dpy); + + for (i = 0; i < screen_info->n_crtc; i++) { + crtc = screen_info->crtcs[i]; + if (!crtc->cur_mode_id) { + continue; + } + mode_info = find_mode_by_xid (screen_info, crtc->cur_mode_id); + cur_x = crtc->cur_x; + cur_y = crtc->cur_y; + + w = mode_width (mode_info, crtc->cur_rotation); + h = mode_height (mode_info, crtc->cur_rotation); + + if (cur_x + w > max_width) { + max_width = cur_x + w; + } + if (cur_y + h > max_height) { + max_height = cur_y + h; + } + } + + if (max_width > screen_info->max_width) { + #if RANDR_GUI_DEBUG + fprintf (stderr, "user set screen width %d, larger than max width %d, set to max width\n", + cur_x + w, screen_info->max_width); + #endif + return 0; + } else if (max_width < screen_info->min_width) { + screen_info->cur_width = screen_info->min_width; + } else { + screen_info->cur_width = max_width; + } + + if (max_height > screen_info->max_height) { + #if RANDR_GUI_DEBUG + fprintf (stderr, "user set screen height %d, larger than max height %d, set to max height\n", + cur_y + h, screen_info->max_height); + #endif + return 0; + } else if (max_height < screen_info->min_height) { + screen_info->cur_height = screen_info->min_height; + } else { + screen_info->cur_height = max_height; + } + + + //calculate mmWidth, mmHeight + if (screen_info->cur_width != DisplayWidth (dpy, screen) || + screen_info->cur_height != DisplayHeight (dpy, screen) ) { + double dpi; + + dpi = (25.4 * DisplayHeight (dpy, screen)) / DisplayHeightMM(dpy, screen); + mmW = (25.4 * screen_info->cur_width) / dpi; + mmH = (25.4 * screen_info->cur_height) / dpi; + } else { + mmW = DisplayWidthMM (dpy, screen); + mmH = DisplayHeightMM (dpy, screen); + } + + screen_info->cur_mmWidth = mmW; + screen_info->cur_mmHeight = mmH; + + return 1; +} + +void +screen_apply (struct ScreenInfo *screen_info) +{ + int width, height; + int mmWidth, mmHeight; + Display *dpy, *cur_dpy; + Window window; + int screen; + static int first = 1; + + width = screen_info->cur_width; + height = screen_info->cur_height; + mmWidth = screen_info->cur_mmWidth; + mmHeight = screen_info->cur_mmHeight; + dpy = screen_info->dpy; + window = screen_info->window; + screen = DefaultScreen (dpy); + + cur_dpy = XOpenDisplay (NULL); + + if (width == DisplayWidth (cur_dpy, screen) && + height == DisplayHeight (cur_dpy, screen) && + mmWidth == DisplayWidthMM (cur_dpy, screen) && + mmHeight == DisplayHeightMM (cur_dpy, screen) ) { + return; + } else { + XRRSetScreenSize (dpy, window, width, height, mmWidth, mmHeight); + } +} + +static Status +crtc_apply (struct CrtcInfo *crtc_info) +{ + struct ScreenInfo *screen_info; + XRRCrtcInfo *rr_crtc_info; + Display *dpy; + XRRScreenResources *res; + RRCrtc crtc_id; + int x, y; + RRMode mode_id; + Rotation rotation; + RROutput *outputs; + int noutput; + Status s; + int i; + + /*if (!crtc_info->changed) { + return RRSetConfigSuccess; + }*/ + + screen_info = crtc_info->screen_info; + dpy = screen_info->dpy; + res = screen_info->res; + crtc_id = crtc_info->id; + x = crtc_info->cur_x; + y = crtc_info->cur_y; + + mode_id = crtc_info->cur_mode_id; + rotation = crtc_info->cur_rotation; + + noutput = crtc_info->cur_noutput; + /*for (i = 0; i < screen_info->n_output; i++) { + struct OutputInfo *output_info = screen_info->outputs[i]; + + if (output_info->cur_crtc && crtc_id == output_info->cur_crtc->id) { + noutput++; + } + }*/ + + if (0 == noutput) { + return crtc_disable (crtc_info); + } + + outputs = malloc (sizeof (RROutput) * noutput); + noutput = 0; + for (i = 0; i < screen_info->n_output; i++) { + struct OutputInfo *output_info = screen_info->outputs[i]; + + if (output_info->cur_crtc && crtc_id == output_info->cur_crtc->id) { + outputs[noutput++] = output_info->id; + } + } + + + s = XRRSetCrtcConfig (dpy, res, crtc_id, CurrentTime, + x, y, mode_id, rotation, + outputs, noutput); + + if (RRSetConfigSuccess == s) { + crtc_info->changed = 0; + } + + free (outputs); + + return s; +} + +static Status +crtc_disable (struct CrtcInfo *crtc) +{ + struct ScreenInfo *screen_info; + + screen_info = crtc->screen_info; + + return XRRSetCrtcConfig (screen_info->dpy, screen_info->res, crtc->id, CurrentTime, + 0, 0, None, RR_Rotate_0, NULL, 0); +} + +int +apply (struct ScreenInfo *screen_info) +{ + int i; + struct CrtcInfo *crtc_info; + GtkWidget *dialog; + + //XGrabServer (screen_info->dpy); + set_positions (screen_info); + + if (!set_screen_size (screen_info)) { + dialog = gtk_message_dialog_new (root_window, + GTK_DIALOG_DESTROY_WITH_PARENT | GTK_DIALOG_MODAL, + GTK_MESSAGE_WARNING, + GTK_BUTTONS_CANCEL, + _("User set screen size larger than max screen size\n") + ); + gtk_dialog_run (GTK_DIALOG (dialog)); + gtk_widget_destroy (dialog); + return 0; + } + + for (i = 0; i < screen_info->n_crtc; i++) { + int old_x, old_y, old_w, old_h; + + XRRCrtcInfo *crtc_info = XRRGetCrtcInfo (screen_info->dpy, screen_info->res, screen_info->crtcs[i]->id); + XRRModeInfo *old_mode = find_mode_by_xid (screen_info, crtc_info->mode); + + if (crtc_info->mode == None) { + continue; + } + + old_x = crtc_info->x; + old_y = crtc_info->y; + old_w = mode_width (old_mode, crtc_info->rotation); + old_h = mode_height (old_mode, crtc_info->rotation); + + if (old_x + old_w <= screen_info->cur_width && + old_y + old_h <= screen_info->cur_height ) { + continue; + } else { + crtc_disable (screen_info->crtcs[i]); + } + } + + screen_apply (screen_info); + + for (i = 0; i < screen_info->n_crtc; i++) { + Status s; + crtc_info = screen_info->crtcs[i]; + + //if (crtc_info->changed) { + s = crtc_apply (crtc_info); + if (RRSetConfigSuccess != s) { + fprintf (stderr, "crtc apply error\n"); + } + //} + } + + return 1; + + //XUngrabServer (screen_info->dpy); +} + +struct ScreenInfo* +read_screen_info (Display *display) +{ + struct ScreenInfo *screen_info; + int screen_num; + Window root_window; + XRRScreenResources *sr; + int i; + + screen_num = DefaultScreen (display); + root_window = RootWindow (display, screen_num); + + sr = XRRGetScreenResources (display, root_window); + + screen_info = malloc (sizeof (struct ScreenInfo)); + screen_info->dpy = display; + screen_info->window = root_window; + screen_info->res = sr; + screen_info->cur_width = DisplayWidth (display, screen_num); + screen_info->cur_height = DisplayHeight (display, screen_num); + screen_info->cur_mmWidth = DisplayWidthMM (display, screen_num); + screen_info->cur_mmHeight = DisplayHeightMM (display, screen_num); + screen_info->n_output = sr->noutput; + screen_info->n_crtc = sr->ncrtc; + screen_info->outputs = malloc (sizeof (struct OutputInfo *) * sr->noutput); + screen_info->crtcs = malloc (sizeof (struct CrtcInfo *) * sr->ncrtc); + screen_info->clone = 0; + + //get min max width height + XRRGetScreenSizeRange (display, root_window, + &screen_info->min_width, &screen_info->min_height, + &screen_info->max_width, &screen_info->max_height); + + //get crtc + for (i = 0; i < sr->ncrtc; i++) { + struct CrtcInfo *crtc_info; + screen_info->crtcs[i] = malloc (sizeof (struct CrtcInfo)); + crtc_info = screen_info->crtcs[i]; + XRRCrtcInfo *xrr_crtc_info = XRRGetCrtcInfo (display, sr, sr->crtcs[i]); + + crtc_info->id = sr->crtcs[i]; + crtc_info->info = xrr_crtc_info; + crtc_info->cur_x = xrr_crtc_info->x; + crtc_info->cur_y = xrr_crtc_info->y; + crtc_info->cur_mode_id = xrr_crtc_info->mode; + crtc_info->cur_rotation = xrr_crtc_info->rotation; + crtc_info->rotations = xrr_crtc_info->rotations; + crtc_info->cur_noutput = xrr_crtc_info->noutput; + + crtc_info->changed = 0; + crtc_info->screen_info = screen_info; + } + + + //get output + for (i = 0; i < sr->noutput; i++) { + struct OutputInfo *output; + screen_info->outputs[i] = malloc (sizeof (struct OutputInfo)); + output = screen_info->outputs[i]; + + output->id = sr->outputs[i]; + output->info = XRRGetOutputInfo (display, sr, sr->outputs[i]); + output->cur_crtc = find_crtc (screen_info, output->info); + output->auto_set = 0; + if (output->cur_crtc) { + output->off_set = 0; + } else { + output->off_set = 1; + } + + } + + //set current crtc + screen_info->cur_crtc = screen_info->outputs[0]->cur_crtc; + screen_info->primary_crtc = screen_info->cur_crtc; + screen_info->cur_output = screen_info->outputs[0]; + + return screen_info; +} + +void +free_screen_info (struct ScreenInfo *screen_info) +{ + free (screen_info->outputs); + free (screen_info->crtcs); + free (screen_info); +} + + + +GdkPixbuf* +randr_create_pixbuf (const guint8 *data) +{ + GdkPixbuf *output_pixbuf; + + output_pixbuf = gdk_pixbuf_new_from_inline(9240, data, TRUE, NULL); + + return output_pixbuf; +} + +GtkListStore * +create_output_store () +{ + GtkListStore *store; + + store = gtk_list_store_new (N_OUTPUT_COLS, G_TYPE_INT, G_TYPE_STRING, GDK_TYPE_PIXBUF); + + return store; +} + +GtkListStore * +create_mode_store () +{ + GtkListStore *store; + + store = gtk_list_store_new (N_MODE_COLS, G_TYPE_STRING, G_TYPE_INT); + + return store; +} + +GtkListStore * +create_hotkey_store () +{ + GtkListStore *store; + + store = gtk_list_store_new (N_HOTKEY_COLS, G_TYPE_STRING, G_TYPE_STRING); + + return store; +} + +void +fill_hotkey_store (GtkListStore *store) +{ + GConfClient *client; + GtkTreeIter iter; + + gtk_list_store_clear (store); + + client = gconf_client_get_default(); + + gtk_list_store_append (store, &iter); + gtk_list_store_set (store, &iter, + COL_HOTKEY_ACTION, "Invoke randr gui", + COL_HOTKEY_COMBINATION, HOTKEY_STR, + -1); +} + +void +fill_output_store (GtkListStore *store, struct ScreenInfo *screen_info, int big_pic, int output_type) +{ + GtkTreeIter iter; + + XRROutputInfo *output_info; + char *output_name; + GdkPixbuf *output_pixbuf; + RROutput output_id; + + int i; + + gtk_list_store_clear (store); + + for (i = 0; i < screen_info->n_output; i++) { + output_info = screen_info->outputs[i]->info; + switch (output_type) { + case OUTPUT_ALL: + break; + case OUTPUT_ON: + if (!screen_info->outputs[i]->cur_crtc) { + continue; + } + case OUTPUT_CONNECTED: + if (RR_Disconnected == screen_info->outputs[i]->info->connection) { + continue; + } + default: + break; + } + + output_name = output_info->name; + output_pixbuf = randr_create_pixbuf (big_pic ? big_pixbuf : small_pixbuf); + output_id = screen_info->outputs[i]->id; + + gtk_list_store_append (store, &iter); + gtk_list_store_set (store, &iter, + COL_OUTPUT_ID, output_id, + COL_OUTPUT_NAME, output_name, + COL_OUTPUT_PIXBUF, output_pixbuf, + -1); + } +} + + +static char * +get_mode_name (struct ScreenInfo *screen_info, RRMode mode_id) +{ + XRRScreenResources *sr; + char *mode_name; + int mode_name_len = 40; + int i; + + sr = screen_info->res; + mode_name = malloc (mode_name_len); + + for (i = 0; i < sr->nmode; i++) { + if (sr->modes[i].id == mode_id) { + break; + } + } + + if (i == sr->nmode) { + snprintf (mode_name, mode_name_len, "%s", "Unknown mode"); + } else { + double rate; + if (sr->modes[i].hTotal && sr->modes[i].vTotal) { + rate = ((double) sr->modes[i].dotClock / + ((double) sr->modes[i].hTotal * (double) sr->modes[i].vTotal)); + } else { + rate = 0; + } + snprintf (mode_name, mode_name_len, "%s%6.1fHz", sr->modes[i].name, rate); + } + + return mode_name; +} + +/*check if other outputs that connected to the same crtc support this mode*/ +static int +check_mode (struct ScreenInfo *screen_info, struct OutputInfo *output, RRMode mode_id) +{ + XRRCrtcInfo *crtc_info; + //XRR + int i, j; + int mode_ok = 1; + + if (!output->cur_crtc) { + return 1; + } + + crtc_info = output->cur_crtc->info; + for (i = 0; i < crtc_info->noutput; i++) { + XRROutputInfo *output_info; + int nmode; + + if (output->id == crtc_info->outputs[i]) { + continue; + } + + mode_ok = 0; + output_info = XRRGetOutputInfo (screen_info->dpy, screen_info->res, crtc_info->outputs[i]); + nmode = output_info->nmode; + for (j = 0; j < nmode; j++) { + if (mode_id == output_info->modes[j]) { + mode_ok = 1; + break; + } + } + if (!mode_ok) { + break; + } + } + + return mode_ok; +} + +void +fill_mode_store (GtkListStore *store, struct OutputInfo *output) +{ + GtkComboBox *modes_combo = GTK_COMBO_BOX (lookup_widget (root_window, "modes_combo")); + int active_num = -1; + + GtkTreeIter iter; + XRROutputInfo *output_info; + char *mode_name; + + int i; + int mode_index = -1; + + gtk_list_store_clear (store); + output_info = output->info; + + for (i = 0; i < output_info->nmode; i++) { + if (!check_mode (screen_info, output, output_info->modes[i])) { + continue; + } + + mode_name = get_mode_name (screen_info, output_info->modes[i]); + gtk_list_store_append (store, &iter); + gtk_list_store_set (store, &iter, + COL_MODE_ID, output_info->modes[i], + COL_MODE_NAME, mode_name, + -1); + mode_index++; + free (mode_name); + + if (output->cur_crtc && output->cur_crtc->cur_mode_id == output_info->modes[i]) { + active_num = mode_index; + } + } + + if (active_num > -1) { + gtk_combo_box_set_active (modes_combo, active_num); + } +} + +void +set_output_store (GtkListStore *store, const char *widget_name) +{ + GtkIconView *output_iview = GTK_ICON_VIEW (lookup_widget (root_window, widget_name)); + + gtk_icon_view_set_model (output_iview, GTK_TREE_MODEL (store)); + + g_object_unref (store); + + gtk_icon_view_set_text_column (output_iview, COL_OUTPUT_NAME); + gtk_icon_view_set_pixbuf_column (output_iview, COL_OUTPUT_PIXBUF); +} + +void +set_mode_store (GtkListStore *store, const char *widget_name) +{ + GtkComboBox *modes_combo = GTK_COMBO_BOX (lookup_widget (root_window, widget_name)); + + gtk_combo_box_set_model (modes_combo, GTK_TREE_MODEL (store)); + + g_object_unref (store); +} + +void +set_hotkey_store (GtkListStore *store, const char *widget_name) +{ + GtkTreeView *hotkeys_tview = GTK_TREE_VIEW (lookup_widget (root_window, widget_name)); + + gtk_tree_view_set_model (hotkeys_tview, GTK_TREE_MODEL (store)); + + g_object_unref (store); +} + +void +set_basic_views (struct OutputInfo *output_info) +{ + int auto_set; + int off_set; + GtkWidget *mode_combo; + GtkWidget *auto_cbtn, *off_cbtn; + + mode_combo = lookup_widget (root_window, MODE_COMBO_NAME); + auto_cbtn = lookup_widget (root_window, AUTO_CHECKBUTTON_NAME); + off_cbtn = lookup_widget (root_window, OFF_CHECKBUTTON_NAME); + + auto_set = output_info->auto_set; + off_set = output_info->off_set; + fill_mode_store (mode_store, output_info); + + gtk_widget_set_sensitive (mode_combo, FALSE); + gtk_toggle_button_set_active (GTK_TOGGLE_BUTTON (auto_cbtn), FALSE); + gtk_toggle_button_set_active (GTK_TOGGLE_BUTTON (off_cbtn), FALSE); + + if (auto_set) { + gtk_toggle_button_set_active (GTK_TOGGLE_BUTTON (auto_cbtn), TRUE); + } else if (off_set) { + gtk_toggle_button_set_active (GTK_TOGGLE_BUTTON (off_cbtn), TRUE); + } else { + gtk_widget_set_sensitive (mode_combo, TRUE); + } + +} + +void +set_rotation_views (struct CrtcInfo* crtc_info) +{ + GtkRadioButton *rotation_rbtn = GTK_RADIO_BUTTON (lookup_widget (root_window, "rotation0_rbtn")); + + GSList *rotation_rbtn_group = gtk_radio_button_get_group (rotation_rbtn); + int len = g_slist_length (rotation_rbtn_group); + Rotation cur_rotation; + Rotation rotations; + GtkRadioButton *cur_rbtn; + GtkWidget *rotation_page; + GtkWidget *setting_notebook; + int i; + + setting_notebook = lookup_widget (root_window, SETTING_NOTEBOOK_NAME); + rotation_page = gtk_notebook_get_nth_page (GTK_NOTEBOOK (setting_notebook), ROTATION_PAGE); + + /* first check crtc_info NULL */ + if (!crtc_info) { + gtk_widget_set_sensitive (rotation_page, FALSE); + return; + } else { + gtk_widget_set_sensitive (rotation_page, TRUE); + } + + cur_rotation = crtc_info->cur_rotation; + rotations = crtc_info->rotations & 0xf; + + for (i = 0; i < len; i++) { + cur_rbtn = GTK_RADIO_BUTTON (g_slist_nth_data (rotation_rbtn_group, len-1-i)); + + if ((cur_rotation >> i) & 1) { + gtk_toggle_button_set_active (GTK_TOGGLE_BUTTON (cur_rbtn), TRUE); + } + + if ((rotations >> i) & 1) { + gtk_widget_set_sensitive (GTK_WIDGET (cur_rbtn), TRUE); + } + } + +} + +void +set_output_layout (struct ScreenInfo *screen_info) +{ + GtkTargetEntry target_table[] = {{ "text/uri-list", 0, 0 }}; + GtkWidget *center_iview, *left_iview, *right_iview, *above_iview, *below_iview; + + fill_output_store (center_store, screen_info, 0, OUTPUT_ON); + + center_iview = lookup_widget (root_window, CENTER_ICONVIEW_NAME); + left_iview = lookup_widget (root_window, LEFT_ICONVIEW_NAME); + right_iview = lookup_widget (root_window, RIGHT_ICONVIEW_NAME); + above_iview = lookup_widget (root_window, ABOVE_ICONVIEW_NAME); + below_iview = lookup_widget (root_window, BELOW_ICONVIEW_NAME); + + gtk_drag_source_set (center_iview, GDK_MODIFIER_MASK, target_table, 1, GDK_ACTION_COPY); + gtk_drag_source_set (left_iview, GDK_MODIFIER_MASK, target_table, 1, GDK_ACTION_COPY); + gtk_drag_source_set (right_iview, GDK_MODIFIER_MASK, target_table, 1, GDK_ACTION_COPY); + gtk_drag_source_set (above_iview, GDK_MODIFIER_MASK, target_table, 1, GDK_ACTION_COPY); + gtk_drag_source_set (below_iview, GDK_MODIFIER_MASK, target_table, 1, GDK_ACTION_COPY); + + gtk_drag_dest_set (center_iview, GTK_DEST_DEFAULT_ALL, target_table, 1, GDK_ACTION_COPY); + gtk_drag_dest_set (left_iview, GTK_DEST_DEFAULT_ALL, target_table, 1, GDK_ACTION_COPY); + gtk_drag_dest_set (right_iview, GTK_DEST_DEFAULT_ALL, target_table, 1, GDK_ACTION_COPY); + gtk_drag_dest_set (above_iview, GTK_DEST_DEFAULT_ALL, target_table, 1, GDK_ACTION_COPY); + gtk_drag_dest_set (below_iview, GTK_DEST_DEFAULT_ALL, target_table, 1, GDK_ACTION_COPY); + + g_signal_connect ((gpointer) center_iview, "drag_data_get", + G_CALLBACK (on_iview_drag_data_get), + root_window); + g_signal_connect ((gpointer) center_iview, "drag_data_received", + G_CALLBACK (on_iview_drag_data_received), + root_window); + + g_signal_connect ((gpointer) left_iview, "drag_data_get", + G_CALLBACK (on_iview_drag_data_get), + root_window); + g_signal_connect ((gpointer) left_iview, "drag_data_received", + G_CALLBACK (on_iview_drag_data_received), + root_window); + + g_signal_connect ((gpointer) right_iview, "drag_data_get", + G_CALLBACK (on_iview_drag_data_get), + root_window); + g_signal_connect ((gpointer) right_iview, "drag_data_received", + G_CALLBACK (on_iview_drag_data_received), + root_window); + + g_signal_connect ((gpointer) above_iview, "drag_data_get", + G_CALLBACK (on_iview_drag_data_get), + root_window); + g_signal_connect ((gpointer) above_iview, "drag_data_received", + G_CALLBACK (on_iview_drag_data_received), + root_window); + + g_signal_connect ((gpointer) below_iview, "drag_data_get", + G_CALLBACK (on_iview_drag_data_get), + root_window); + g_signal_connect ((gpointer) below_iview, "drag_data_received", + G_CALLBACK (on_iview_drag_data_received), + root_window); +} + +int +get_iconview_child_count (GtkIconView *iconview) +{ + GtkTreeModel *model; + GtkTreeIter iter; + int count = 0; + + model = gtk_icon_view_get_model (iconview); + if (NULL == model) { + return -1; + } + + if (gtk_tree_model_get_iter_first (model, &iter)) { + count = 1; + + while (gtk_tree_model_iter_next (model, &iter)) { + count++; + } + } + + return count; +} + +int +get_iconview_child_max_width (GtkIconView *iconview) +{ + GtkTreeModel *model; + GtkTreeIter iter; + RROutput output_id; + int max_width = 0; + int width; + + model = gtk_icon_view_get_model (iconview); + if (NULL == model) { + max_width = 0; + } + + if (gtk_tree_model_get_iter_first (model, &iter)) { + gtk_tree_model_get (model, &iter, COL_OUTPUT_ID, &output_id, -1); + + max_width = get_width_by_output_id (screen_info, output_id); + + while (gtk_tree_model_iter_next (model, &iter)) { + gtk_tree_model_get (model, &iter, COL_OUTPUT_ID, &output_id, -1); + + width = get_width_by_output_id (screen_info, output_id); + if (width > max_width) { + max_width = width; + } + } + } + + return max_width; +} + +int +get_iconview_child_max_height (GtkIconView *iconview) +{ + GtkTreeModel *model; + GtkTreeIter iter; + RROutput output_id; + int max_height = 0; + int height; + + model = gtk_icon_view_get_model (iconview); + if (NULL == model) { + max_height = 0; + } + + if (gtk_tree_model_get_iter_first (model, &iter)) { + gtk_tree_model_get (model, &iter, COL_OUTPUT_ID, &output_id, -1); + + max_height = get_height_by_output_id (screen_info, output_id); + + while (gtk_tree_model_iter_next (model, &iter)) { + gtk_tree_model_get (model, &iter, COL_OUTPUT_ID, &output_id, -1); + + height = get_height_by_output_id (screen_info, output_id); + if (height > max_height) { + max_height = height; + } + } + } + + return max_height; +} + +int +get_x (int position) +{ + int x; + int left_width, above_width, center_width, below_width; + GtkWidget *center_iview, *left_iview, *above_iview, *below_iview; + + center_iview = lookup_widget (root_window, CENTER_ICONVIEW_NAME); + left_iview = lookup_widget (root_window, LEFT_ICONVIEW_NAME); + above_iview = lookup_widget (root_window, ABOVE_ICONVIEW_NAME); + below_iview = lookup_widget (root_window, BELOW_ICONVIEW_NAME); + + left_width = get_iconview_child_max_width (GTK_ICON_VIEW (left_iview)); + above_width = get_iconview_child_max_width (GTK_ICON_VIEW (above_iview)); + center_width = get_iconview_child_max_width (GTK_ICON_VIEW (center_iview)); + below_width = get_iconview_child_max_width (GTK_ICON_VIEW (below_iview)); + + switch (position) { + case LEFT_POS: + x = 0; + break; + case CENTER_POS: + x = left_width; + break; + case RIGHT_POS: + x = above_width; + if (center_width > x) { + x = center_width; + } + if (below_width > x) { + x = below_width; + } + x = x + left_width; + break; + default: +#if RANDR_GUI_DEBUG + fprintf (stderr, "No such x position\n"); +#endif + x = 0; + break; + } + + return x; +} + +int +get_y (int position) +{ + int y; + int left_height, above_height, center_height, right_height; + GtkWidget *center_iview, *left_iview, *above_iview, *right_iview; + + center_iview = lookup_widget (root_window, CENTER_ICONVIEW_NAME); + left_iview = lookup_widget (root_window, LEFT_ICONVIEW_NAME); + above_iview = lookup_widget (root_window, ABOVE_ICONVIEW_NAME); + right_iview = lookup_widget (root_window, RIGHT_ICONVIEW_NAME); + + left_height = get_iconview_child_max_height (GTK_ICON_VIEW (left_iview)); + above_height = get_iconview_child_max_height (GTK_ICON_VIEW (above_iview)); + center_height = get_iconview_child_max_height (GTK_ICON_VIEW (center_iview)); + right_height = get_iconview_child_max_height (GTK_ICON_VIEW (right_iview)); + + switch (position) { + case ABOVE_POS: + y = 0; + break; + case CENTER_POS: + y = above_height; + break; + case BELOW_POS: + y = left_height; + if (center_height > y) { + y = center_height; + } + if (right_height > y) { + y = right_height; + } + y = above_height + y; + break; + default: +#if RANDR_GUI_DEBUG + fprintf (stderr, "No such y position\n"); +#endif + y = 0; + break; + } + + return y; +} + +static RRCrtc +get_crtc_id_by_output_id (struct ScreenInfo *screen_info, RROutput output_id) +{ + int i; + RRCrtc crtc_id = -1; + + for (i = 0; i < screen_info->n_output; i++) { + if (output_id == screen_info->outputs[i]->id) { + if (screen_info->outputs[i]->cur_crtc) { + crtc_id = screen_info->outputs[i]->cur_crtc->id; + } else { + crtc_id = 0; //this output is off + } + break; + } + } + + return crtc_id; +} + +static RRCrtc * +get_crtc_id_list (GtkIconView *iconview, int *list_len) +{ + int count; + RRCrtc *crtc_list; + RRCrtc crtc_id; + RROutput output_id; + GtkTreeModel *model; + GtkTreeIter iter; + int i = 0; + + count = get_iconview_child_count (iconview); + if (0 == count) { + return NULL; + } + + model = gtk_icon_view_get_model (iconview); + crtc_list = malloc (sizeof (RRCrtc) * count); + + if (gtk_tree_model_get_iter_first (model, &iter)) { + gtk_tree_model_get (model, &iter, COL_OUTPUT_ID, &output_id, -1); + + crtc_id = get_crtc_id_by_output_id (screen_info, output_id); + if (crtc_id) { + crtc_list[i++] = crtc_id; + } + + while (gtk_tree_model_iter_next (model, &iter)) { + gtk_tree_model_get (model, &iter, COL_OUTPUT_ID, &output_id, -1); + + crtc_id = get_crtc_id_by_output_id (screen_info, output_id); + if (crtc_id) { + crtc_list[i++] = crtc_id; + } + } + } + + *list_len = i; + + return crtc_list; +} + +static struct CrtcInfo * +get_crtc_info_by_xid (struct ScreenInfo *screen_info, RRCrtc crtc_id) +{ + struct CrtcInfo *crtc_info = NULL; + int i; + + for (i = 0; i < screen_info->n_crtc; i++) { + if (crtc_id == screen_info->crtcs[i]->id) { + crtc_info = screen_info->crtcs[i]; + break; + } + } + + return crtc_info; +} + +void +set_positions (struct ScreenInfo *screen_info) +{ + GtkWidget *pos_iview[N_POSITIONS]; + struct CrtcInfo *crtc_info; + RRCrtc *crtc_list; + int list_len; + int x, y; + int center_x, right_x; + int center_y, below_y; + int i, j; + + pos_iview[CENTER_POS] = lookup_widget (root_window, CENTER_ICONVIEW_NAME); + pos_iview[LEFT_POS] = lookup_widget (root_window, LEFT_ICONVIEW_NAME); + pos_iview[RIGHT_POS] = lookup_widget (root_window, RIGHT_ICONVIEW_NAME); + pos_iview[ABOVE_POS] = lookup_widget (root_window, ABOVE_ICONVIEW_NAME); + pos_iview[BELOW_POS] = lookup_widget (root_window, BELOW_ICONVIEW_NAME); + + center_x = get_x (CENTER_POS); + right_x = get_x (RIGHT_POS); + center_y = get_y (CENTER_POS); + below_y = get_y (BELOW_POS); + + for (i = 0; i < N_POSITIONS; i++) { + if (0 == get_iconview_child_count (GTK_ICON_VIEW (pos_iview[i]))) { + continue; + } + crtc_list = get_crtc_id_list (GTK_ICON_VIEW (pos_iview[i]), &list_len); + if (0 == list_len) { + continue; + } + + for (j = 0; j < list_len; j++) { + crtc_info = get_crtc_info_by_xid (screen_info, crtc_list[j]); + if (NULL == crtc_info) { + continue; + } + + switch (i) { + case LEFT_POS: + x = 0; + y = center_y; + break; + case RIGHT_POS: + x = right_x; + y = center_y; + break; + case CENTER_POS: + x = center_x; + y = center_y; + break; + case ABOVE_POS: + x = center_x; + y = 0; + break; + case BELOW_POS: + x = center_x; + y = below_y; + break; + default: + x = 0; + y = 0; + } + crtc_info->cur_x = x; + crtc_info->cur_y = y; + } + + free (crtc_list); + } +} + +static XRRModeInfo * +preferred_mode (struct ScreenInfo *screen_info, struct OutputInfo *output) +{ + XRROutputInfo *output_info = output->info; + Display *dpy; + int screen; + int m; + XRRModeInfo *best; + int bestDist; + + dpy = screen_info->dpy; + screen = DefaultScreen (dpy); + best = NULL; + bestDist = 0; + for (m = 0; m < output_info->nmode; m++) { + XRRModeInfo *mode_info = find_mode_by_xid (screen_info, output_info->modes[m]); + int dist; + + if (m < output_info->npreferred) + dist = 0; + else if (output_info->mm_height) + dist = (1000 * DisplayHeight(dpy, screen) / DisplayHeightMM(dpy, screen) - + 1000 * mode_info->height / output_info->mm_height); + else + dist = DisplayHeight(dpy, screen) - mode_info->height; + + if (dist < 0) dist = -dist; + if (!best || dist < bestDist) { + best = mode_info; + bestDist = dist; + } + } + return best; +} + + +void +output_auto (struct ScreenInfo *screen_info, struct OutputInfo *output_info) +{ + XRRModeInfo *mode_info; + RRMode mode_id; + struct CrtcInfo *crtc_info; + XRROutputInfo *probe_output_info; + + if (RR_Disconnected == output_info->info->connection) { + XRRScreenResources *cur_res; + + cur_res = XRRGetScreenResources (screen_info->dpy, screen_info->window); + probe_output_info = XRRGetOutputInfo (screen_info->dpy, cur_res, output_info->id); + if (RR_Disconnected != probe_output_info->connection) { + output_info->info = probe_output_info; + output_info->cur_crtc = auto_find_crtc (screen_info, output_info); + } + } + + mode_info = preferred_mode (screen_info, output_info); + if (!mode_info) { + return; + } + mode_id = mode_info->id; + + crtc_info = output_info->cur_crtc; + if (crtc_info) { + crtc_info->cur_mode_id = mode_id; + } else { + crtc_info = auto_find_crtc (screen_info, output_info); + if (!crtc_info) { +#if RANDR_GUI_DEBUG + fprintf (stderr, "Can not find usable CRTC\n"); +#endif + return; + } else { + screen_info->cur_output->cur_crtc = crtc_info; + screen_info->cur_crtc = crtc_info; + screen_info->cur_crtc->cur_noutput++; + fprintf (stderr, "n output: %d\n", screen_info->cur_crtc->cur_noutput); + screen_info->cur_crtc->cur_mode_id = mode_id; + screen_info->cur_crtc->changed = 1; + } + } + +} + +void +output_off (struct ScreenInfo *screen_info, struct OutputInfo *output) +{ + if (output->cur_crtc) { + output->cur_crtc->cur_noutput--; + } + output->cur_crtc = NULL; + screen_info->cur_crtc = NULL; + output->off_set = 1; +} + +void +set_hotkeys_view (GtkListStore *hotkey_store) +{ + GtkTreeView *hotkey_tview; + GtkTreeViewColumn *column; + GtkToggleButton *hotkey_cbtn; + GConfClient *client; + gchar *key, *command; + + hotkey_tview = GTK_TREE_VIEW (lookup_widget (root_window, HOTKEY_TREEVIEW_NAME)); + hotkey_cbtn = GTK_TOGGLE_BUTTON (lookup_widget (root_window, HOTKEY_CHECKBUTTON_NAME)); + + column = gtk_tree_view_column_new_with_attributes (_("Action"), + gtk_cell_renderer_text_new (), + "text", COL_HOTKEY_ACTION, + NULL); + gtk_tree_view_column_set_resizable (column, TRUE); + gtk_tree_view_append_column (hotkey_tview, column); + + + column = gtk_tree_view_column_new_with_attributes (_("Hot Key Combination"), + gtk_cell_renderer_text_new (), + "text", COL_HOTKEY_COMBINATION, + NULL); + gtk_tree_view_column_set_resizable (column, TRUE); + gtk_tree_view_append_column (hotkey_tview, column); + + client = gconf_client_get_default(); + key = gconf_client_get_string(client, GCONF_KEY1, + NULL); + command = gconf_client_get_string(client, GCONF_KEY2, + NULL); + if (strcmp(key, HOTKEY) == 0 && strcmp(command, APP_NAME) == 0) { + gtk_toggle_button_set_active (hotkey_cbtn, TRUE); + } else { + gtk_toggle_button_set_active (hotkey_cbtn, FALSE); + gtk_widget_set_sensitive (GTK_WIDGET (hotkey_tview), FALSE); + } + + if (key) { + g_free(key); + } + if (command) { + g_free(command); + } +} + +static void +enable_hotkeys() +{ + GConfClient *client; + + client = gconf_client_get_default(); + gconf_client_set_string(client, GCONF_KEY1, + HOTKEY, NULL); + gconf_client_set_string(client, GCONF_KEY2, + APP_NAME, NULL); +} + +static void +disable_hotkeys() +{ + GConfClient *client; + + client = gconf_client_get_default(); + gconf_client_set_string(client, GCONF_KEY1, + "disabled", NULL); + gconf_client_set_string(client, GCONF_KEY2, + "", NULL); +} + +void +set_hotkeys() +{ + GtkToggleButton *hotkey_cbtn; + + hotkey_cbtn = GTK_TOGGLE_BUTTON (lookup_widget (root_window, HOTKEY_CHECKBUTTON_NAME)); + if (gtk_toggle_button_get_active (hotkey_cbtn)) { + enable_hotkeys(); + } else { + disable_hotkeys(); + } +} + diff --git a/src/grandr.h b/src/grandr.h new file mode 100644 index 0000000..c00fe1a --- /dev/null +++ b/src/grandr.h @@ -0,0 +1,125 @@ +/* + * Copyright © 2007 Intel Corporation + * + * Permission is hereby granted, free of charge, to any person obtaining a copy + * of this software and associated documentation files (the "Software"), to deal + * in the Software without restriction, including without limitation the rights + * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell + * copies of the Software, and to permit persons to whom the Software is + * furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in + * all copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE + * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, + * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN + * THE SOFTWARE. + */ +#ifndef RANDR_GUI_H +#define RANDR_GUI_H + +#include <X11/Xlib.h> +#include <X11/extensions/Xrandr.h> +#include <gtk/gtk.h> + +#include "constant.h" + +struct SceenInfo; + +struct CrtcInfo { + RRCrtc id; + XRRCrtcInfo *info; + int cur_x; + int cur_y; + RRMode cur_mode_id; + Rotation cur_rotation; + Rotation rotations; + int cur_noutput; + + int changed; + + struct SceenInfo *screen_info; +}; + +struct OutputInfo { + RROutput id; + XRROutputInfo *info; + struct CrtcInfo *cur_crtc; + + int auto_set; + int off_set; +}; + +struct ScreenInfo { + Display *dpy; + Window window; + XRRScreenResources *res; + int min_width, min_height; + int max_width, max_height; + int cur_width; + int cur_height; + int cur_mmWidth; + int cur_mmHeight; + + int n_output; + int n_crtc; + struct OutputInfo **outputs; + struct CrtcInfo **crtcs; + + int clone; + struct CrtcInfo *primary_crtc; + + struct CrtcInfo *cur_crtc; + struct OutputInfo *cur_output; +}; + +extern GtkWidget *root_window; +extern struct ScreenInfo *screen_info; +extern GtkListStore *output_store; +extern GtkListStore *center_store, *left_store, *right_store, *above_store, *below_store; +extern GtkListStore *mode_store; +extern const guint8 big_pixbuf[], small_pixbuf[]; + +GdkPixbuf* randr_create_pixbuf (const guint8 *data); + +struct ScreenInfo* read_screen_info (Display *); + +GtkListStore* create_output_store (); +GtkListStore* create_mode_store (); +GtkListStore* create_hotkey_store (); +void set_output_store (GtkListStore *store, const char *widget_name); +void set_mode_store (GtkListStore *store, const char *widget_name); +void set_hotkey_store (GtkListStore *store, const char *widget_name); +void fill_output_store (GtkListStore *store, struct ScreenInfo *screen_info, int big_pic, int output_type); +void fill_crtc_store (GtkListStore *store, struct ScreenInfo *screen_info, int big_pic); +void fill_mode_store (GtkListStore *store, struct OutputInfo *output); +void fill_hotkey_store (GtkListStore *store); +void set_basic_views (struct OutputInfo *output_info); +void set_rotation_views (struct CrtcInfo* crtc_info); +void set_output_layout (struct ScreenInfo *screen_info); +void set_hotkeys_view (GtkListStore *hotkey_store); +void set_hotkeys (); +void set_positions (struct ScreenInfo *); + +int apply (struct ScreenInfo *screen_info); +int set_screen_size (struct ScreenInfo *screen_info); +void output_auto (struct ScreenInfo *screen_info, struct OutputInfo *output_info); +void output_off (struct ScreenInfo *screen_info, struct OutputInfo *output); +struct CrtcInfo* auto_find_crtc (struct ScreenInfo *screen_info, struct OutputInfo *output_info); + +XRRModeInfo *find_mode_by_xid (struct ScreenInfo *screen_info, RRMode mode_id); +int mode_height (XRRModeInfo *mode_info, Rotation rotation); +int mode_width (XRRModeInfo *mode_info, Rotation rotation); +int get_width_by_output_id (struct ScreenInfo *screen_info, RROutput output_id); +int get_height_by_output_id (struct ScreenInfo *screen_info, RROutput output_id); +char *get_output_name (struct ScreenInfo *screen_info, RROutput id); +int get_iconview_child_count (GtkIconView *iconview); +int get_iconview_child_max_width (GtkIconView *iconview); +int get_iconview_child_max_height (GtkIconView *iconview); +int get_x (int position); +int get_y (int position); +#endif diff --git a/src/interface.c b/src/interface.c new file mode 100644 index 0000000..8cc1427 --- /dev/null +++ b/src/interface.c @@ -0,0 +1,620 @@ +/* + * Copyright © 2007 Intel Corporation + * + * Permission is hereby granted, free of charge, to any person obtaining a copy + * of this software and associated documentation files (the "Software"), to deal + * in the Software without restriction, including without limitation the rights + * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell + * copies of the Software, and to permit persons to whom the Software is + * furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in + * all copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE + * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, + * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN + * THE SOFTWARE. + */ +/* + * DO NOT EDIT THIS FILE - it is generated by Glade. + */ + +#ifdef HAVE_CONFIG_H +# include <config.h> +#endif + +#include <sys/types.h> +#include <sys/stat.h> +#include <unistd.h> +#include <string.h> +#include <stdio.h> + +#include <gdk/gdkkeysyms.h> +#include <gtk/gtk.h> + +#include "callbacks.h" +#include "interface.h" +#include "support.h" + +#define GLADE_HOOKUP_OBJECT(component,widget,name) \ + g_object_set_data_full (G_OBJECT (component), name, \ + gtk_widget_ref (widget), (GDestroyNotify) gtk_widget_unref) + +#define GLADE_HOOKUP_OBJECT_NO_REF(component,widget,name) \ + g_object_set_data (G_OBJECT (component), name, widget) + +GtkWidget* +create_main_win (void) +{ + GtkWidget *main_win; + GtkWidget *vbox1; + GtkWidget *hbox3; + GtkWidget *label15; + GtkWidget *xserver_entry; + GtkWidget *label34; + GtkWidget *about_btn; + GtkWidget *label17; + GtkWidget *hbox1; + GtkWidget *scrolledwindow1; + GtkWidget *viewport1; + GtkWidget *vbox2; + GtkWidget *label9; + GtkWidget *output_iview; + GtkWidget *label16; + GtkWidget *setting_notebook; + GtkWidget *frame1; + GtkWidget *hbox5; + GtkWidget *table3; + GtkWidget *label24; + GtkWidget *modes_combo; + GtkWidget *vbox6; + GtkWidget *label32; + GtkWidget *auto_cbtn; + GtkWidget *label33; + GtkWidget *off_cbtn; + GtkWidget *label6; + GtkWidget *label2; + GtkWidget *frame4; + GtkWidget *alignment4; + GtkWidget *hbox2; + GtkWidget *rotation_img; + GtkWidget *vbox3; + GtkWidget *rotation0_rbtn; + GSList *rotation0_rbtn_group = NULL; + GtkWidget *rotation90_rbtn; + GtkWidget *rotation180_rbtn; + GtkWidget *rotation270_rbtn; + GtkWidget *label13; + GtkWidget *label3; + GtkWidget *frame3; + GtkWidget *alignment3; + GtkWidget *vbox5; + GtkWidget *hbox4; + GtkWidget *clone_rbtn; + GSList *clone_rbtn_group = NULL; + GtkWidget *panorama_rbtn; + GtkWidget *label31; + GtkWidget *hseparator1; + GtkWidget *table5; + GtkWidget *scrolledwindow2; + GtkWidget *center_iview; + GtkWidget *scrolledwindow3; + GtkWidget *left_iview; + GtkWidget *scrolledwindow4; + GtkWidget *right_iview; + GtkWidget *scrolledwindow5; + GtkWidget *above_iview; + GtkWidget *scrolledwindow6; + GtkWidget *below_iview; + GtkWidget *label27; + GtkWidget *label28; + GtkWidget *label29; + GtkWidget *label30; + GtkWidget *label8; + GtkWidget *label4; + GtkWidget *vbox4; + GtkWidget *hotkey_cbtn; + GtkWidget *hotkey_tview; + GtkWidget *label5; + GtkWidget *hbuttonbox1; + GtkWidget *ok_btn; + GtkWidget *cancel_btn; + GtkWidget *apply_btn; + + main_win = gtk_window_new (GTK_WINDOW_TOPLEVEL); + gtk_widget_set_size_request (main_win, 580, -1); + gtk_window_set_title (GTK_WINDOW (main_win), _("grandr")); + gtk_window_set_resizable (GTK_WINDOW (main_win), FALSE); + + vbox1 = gtk_vbox_new (FALSE, 0); + gtk_widget_show (vbox1); + gtk_container_add (GTK_CONTAINER (main_win), vbox1); + + hbox3 = gtk_hbox_new (FALSE, 0); + gtk_widget_show (hbox3); + gtk_box_pack_start (GTK_BOX (vbox1), hbox3, FALSE, TRUE, 0); + + label15 = gtk_label_new (_(" X Server ")); + gtk_widget_show (label15); + gtk_box_pack_start (GTK_BOX (hbox3), label15, FALSE, FALSE, 0); + + xserver_entry = gtk_entry_new (); + gtk_widget_show (xserver_entry); + gtk_box_pack_start (GTK_BOX (hbox3), xserver_entry, TRUE, TRUE, 0); + gtk_widget_set_sensitive (xserver_entry, FALSE); + gtk_entry_set_text (GTK_ENTRY (xserver_entry), _(":0.0")); + gtk_entry_set_invisible_char (GTK_ENTRY (xserver_entry), 8226); + + label34 = gtk_label_new (_(" ")); + gtk_widget_show (label34); + gtk_box_pack_start (GTK_BOX (hbox3), label34, FALSE, FALSE, 0); + + about_btn = gtk_button_new_with_mnemonic (_(" About ")); + gtk_widget_show (about_btn); + gtk_box_pack_start (GTK_BOX (hbox3), about_btn, FALSE, FALSE, 0); + + label17 = gtk_label_new (""); + gtk_widget_show (label17); + gtk_box_pack_start (GTK_BOX (vbox1), label17, FALSE, FALSE, 0); + + hbox1 = gtk_hbox_new (FALSE, 0); + gtk_widget_show (hbox1); + gtk_box_pack_start (GTK_BOX (vbox1), hbox1, TRUE, TRUE, 0); + + scrolledwindow1 = gtk_scrolled_window_new (NULL, NULL); + gtk_widget_show (scrolledwindow1); + gtk_box_pack_start (GTK_BOX (hbox1), scrolledwindow1, TRUE, TRUE, 0); + gtk_scrolled_window_set_policy (GTK_SCROLLED_WINDOW (scrolledwindow1), GTK_POLICY_AUTOMATIC, GTK_POLICY_AUTOMATIC); + gtk_scrolled_window_set_shadow_type (GTK_SCROLLED_WINDOW (scrolledwindow1), GTK_SHADOW_IN); + + viewport1 = gtk_viewport_new (NULL, NULL); + gtk_widget_show (viewport1); + gtk_container_add (GTK_CONTAINER (scrolledwindow1), viewport1); + + vbox2 = gtk_vbox_new (FALSE, 0); + gtk_widget_show (vbox2); + gtk_container_add (GTK_CONTAINER (viewport1), vbox2); + + label9 = gtk_label_new (_("Outpus ")); + gtk_widget_show (label9); + gtk_box_pack_start (GTK_BOX (vbox2), label9, FALSE, FALSE, 0); + + output_iview = gtk_icon_view_new (); + gtk_widget_show (output_iview); + gtk_box_pack_start (GTK_BOX (vbox2), output_iview, TRUE, TRUE, 0); + gtk_icon_view_set_orientation (GTK_ICON_VIEW (output_iview), GTK_ORIENTATION_HORIZONTAL); + + label16 = gtk_label_new (_(" ")); + gtk_widget_show (label16); + gtk_box_pack_start (GTK_BOX (hbox1), label16, FALSE, FALSE, 0); + + setting_notebook = gtk_notebook_new (); + gtk_widget_show (setting_notebook); + gtk_box_pack_start (GTK_BOX (hbox1), setting_notebook, TRUE, TRUE, 0); + + frame1 = gtk_frame_new (NULL); + gtk_widget_show (frame1); + gtk_container_add (GTK_CONTAINER (setting_notebook), frame1); + gtk_frame_set_shadow_type (GTK_FRAME (frame1), GTK_SHADOW_ETCHED_OUT); + + hbox5 = gtk_hbox_new (FALSE, 0); + gtk_widget_show (hbox5); + gtk_container_add (GTK_CONTAINER (frame1), hbox5); + + table3 = gtk_table_new (2, 2, FALSE); + gtk_widget_show (table3); + gtk_box_pack_start (GTK_BOX (hbox5), table3, TRUE, TRUE, 0); + + label24 = gtk_label_new (_(" Modes ")); + gtk_widget_show (label24); + gtk_table_attach (GTK_TABLE (table3), label24, 0, 1, 0, 1, + (GtkAttachOptions) (GTK_FILL), + (GtkAttachOptions) (0), 0, 0); + gtk_misc_set_alignment (GTK_MISC (label24), 0, 0.5); + + modes_combo = gtk_combo_box_entry_new_text (); + gtk_widget_show (modes_combo); + gtk_table_attach (GTK_TABLE (table3), modes_combo, 1, 2, 0, 1, + (GtkAttachOptions) (GTK_EXPAND | GTK_FILL), + (GtkAttachOptions) (GTK_FILL), 0, 0); + + vbox6 = gtk_vbox_new (FALSE, 0); + gtk_widget_show (vbox6); + gtk_table_attach (GTK_TABLE (table3), vbox6, 0, 1, 1, 2, + (GtkAttachOptions) (GTK_FILL), + (GtkAttachOptions) (GTK_EXPAND | GTK_FILL), 0, 0); + + label32 = gtk_label_new (""); + gtk_widget_show (label32); + gtk_box_pack_start (GTK_BOX (vbox6), label32, FALSE, FALSE, 0); + + auto_cbtn = gtk_check_button_new_with_mnemonic (_("Auto")); + gtk_widget_show (auto_cbtn); + gtk_box_pack_start (GTK_BOX (vbox6), auto_cbtn, FALSE, FALSE, 0); + + label33 = gtk_label_new (""); + gtk_widget_show (label33); + gtk_box_pack_start (GTK_BOX (vbox6), label33, FALSE, FALSE, 0); + + off_cbtn = gtk_check_button_new_with_mnemonic (_("Off")); + gtk_widget_show (off_cbtn); + gtk_box_pack_start (GTK_BOX (vbox6), off_cbtn, FALSE, FALSE, 0); + + label6 = gtk_label_new (_("Settings")); + gtk_widget_show (label6); + gtk_frame_set_label_widget (GTK_FRAME (frame1), label6); + gtk_label_set_use_markup (GTK_LABEL (label6), TRUE); + + label2 = gtk_label_new (_("Basic")); + gtk_widget_show (label2); + gtk_notebook_set_tab_label (GTK_NOTEBOOK (setting_notebook), gtk_notebook_get_nth_page (GTK_NOTEBOOK (setting_notebook), 0), label2); + + frame4 = gtk_frame_new (NULL); + gtk_widget_show (frame4); + gtk_container_add (GTK_CONTAINER (setting_notebook), frame4); + gtk_frame_set_shadow_type (GTK_FRAME (frame4), GTK_SHADOW_ETCHED_OUT); + + alignment4 = gtk_alignment_new (0.5, 0.5, 1, 1); + gtk_widget_show (alignment4); + gtk_container_add (GTK_CONTAINER (frame4), alignment4); + gtk_alignment_set_padding (GTK_ALIGNMENT (alignment4), 0, 0, 12, 0); + + hbox2 = gtk_hbox_new (FALSE, 0); + gtk_widget_show (hbox2); + gtk_container_add (GTK_CONTAINER (alignment4), hbox2); + + rotation_img = gtk_image_new_from_icon_name ("gtk-go-up", GTK_ICON_SIZE_BUTTON); + gtk_widget_show (rotation_img); + gtk_box_pack_start (GTK_BOX (hbox2), rotation_img, TRUE, TRUE, 0); + + vbox3 = gtk_vbox_new (FALSE, 0); + gtk_widget_show (vbox3); + gtk_box_pack_start (GTK_BOX (hbox2), vbox3, TRUE, TRUE, 0); + + rotation0_rbtn = gtk_radio_button_new_with_mnemonic (NULL, _("Normal")); + gtk_widget_show (rotation0_rbtn); + gtk_box_pack_start (GTK_BOX (vbox3), rotation0_rbtn, FALSE, FALSE, 0); + gtk_widget_set_sensitive (rotation0_rbtn, FALSE); + gtk_radio_button_set_group (GTK_RADIO_BUTTON (rotation0_rbtn), rotation0_rbtn_group); + rotation0_rbtn_group = gtk_radio_button_get_group (GTK_RADIO_BUTTON (rotation0_rbtn)); + + rotation90_rbtn = gtk_radio_button_new_with_mnemonic (NULL, _("left")); + gtk_widget_show (rotation90_rbtn); + gtk_box_pack_start (GTK_BOX (vbox3), rotation90_rbtn, FALSE, FALSE, 0); + gtk_widget_set_sensitive (rotation90_rbtn, FALSE); + gtk_radio_button_set_group (GTK_RADIO_BUTTON (rotation90_rbtn), rotation0_rbtn_group); + rotation0_rbtn_group = gtk_radio_button_get_group (GTK_RADIO_BUTTON (rotation90_rbtn)); + + rotation180_rbtn = gtk_radio_button_new_with_mnemonic (NULL, _("inverted")); + gtk_widget_show (rotation180_rbtn); + gtk_box_pack_start (GTK_BOX (vbox3), rotation180_rbtn, FALSE, FALSE, 0); + gtk_widget_set_sensitive (rotation180_rbtn, FALSE); + gtk_radio_button_set_group (GTK_RADIO_BUTTON (rotation180_rbtn), rotation0_rbtn_group); + rotation0_rbtn_group = gtk_radio_button_get_group (GTK_RADIO_BUTTON (rotation180_rbtn)); + + rotation270_rbtn = gtk_radio_button_new_with_mnemonic (NULL, _("right")); + gtk_widget_show (rotation270_rbtn); + gtk_box_pack_start (GTK_BOX (vbox3), rotation270_rbtn, FALSE, FALSE, 0); + gtk_widget_set_sensitive (rotation270_rbtn, FALSE); + gtk_radio_button_set_group (GTK_RADIO_BUTTON (rotation270_rbtn), rotation0_rbtn_group); + rotation0_rbtn_group = gtk_radio_button_get_group (GTK_RADIO_BUTTON (rotation270_rbtn)); + + label13 = gtk_label_new (_("Rotation Views")); + gtk_widget_show (label13); + gtk_frame_set_label_widget (GTK_FRAME (frame4), label13); + gtk_label_set_use_markup (GTK_LABEL (label13), TRUE); + + label3 = gtk_label_new (_("Rotation")); + gtk_widget_show (label3); + gtk_notebook_set_tab_label (GTK_NOTEBOOK (setting_notebook), gtk_notebook_get_nth_page (GTK_NOTEBOOK (setting_notebook), 1), label3); + + frame3 = gtk_frame_new (NULL); + gtk_widget_show (frame3); + gtk_container_add (GTK_CONTAINER (setting_notebook), frame3); + gtk_frame_set_shadow_type (GTK_FRAME (frame3), GTK_SHADOW_ETCHED_OUT); + + alignment3 = gtk_alignment_new (0.5, 0.5, 1, 1); + gtk_widget_show (alignment3); + gtk_container_add (GTK_CONTAINER (frame3), alignment3); + gtk_alignment_set_padding (GTK_ALIGNMENT (alignment3), 0, 0, 12, 0); + + vbox5 = gtk_vbox_new (FALSE, 0); + gtk_widget_show (vbox5); + gtk_container_add (GTK_CONTAINER (alignment3), vbox5); + + hbox4 = gtk_hbox_new (FALSE, 0); + gtk_widget_show (hbox4); + gtk_box_pack_start (GTK_BOX (vbox5), hbox4, TRUE, TRUE, 0); + + clone_rbtn = gtk_radio_button_new_with_mnemonic (NULL, _("Clone")); + gtk_widget_show (clone_rbtn); + gtk_box_pack_start (GTK_BOX (hbox4), clone_rbtn, FALSE, FALSE, 0); + gtk_widget_set_sensitive (clone_rbtn, FALSE); + gtk_radio_button_set_group (GTK_RADIO_BUTTON (clone_rbtn), clone_rbtn_group); + clone_rbtn_group = gtk_radio_button_get_group (GTK_RADIO_BUTTON (clone_rbtn)); + + panorama_rbtn = gtk_radio_button_new_with_mnemonic (NULL, _("Extend")); + gtk_widget_show (panorama_rbtn); + gtk_box_pack_start (GTK_BOX (hbox4), panorama_rbtn, FALSE, FALSE, 0); + gtk_widget_set_sensitive (panorama_rbtn, FALSE); + gtk_radio_button_set_group (GTK_RADIO_BUTTON (panorama_rbtn), clone_rbtn_group); + clone_rbtn_group = gtk_radio_button_get_group (GTK_RADIO_BUTTON (panorama_rbtn)); + + label31 = gtk_label_new (_("Drag output icon to desired position")); + gtk_widget_show (label31); + gtk_box_pack_start (GTK_BOX (vbox5), label31, FALSE, FALSE, 0); + + hseparator1 = gtk_hseparator_new (); + gtk_widget_show (hseparator1); + gtk_box_pack_start (GTK_BOX (vbox5), hseparator1, TRUE, TRUE, 0); + + table5 = gtk_table_new (5, 5, FALSE); + gtk_widget_show (table5); + gtk_box_pack_start (GTK_BOX (vbox5), table5, TRUE, TRUE, 0); + + scrolledwindow2 = gtk_scrolled_window_new (NULL, NULL); + gtk_widget_show (scrolledwindow2); + gtk_table_attach (GTK_TABLE (table5), scrolledwindow2, 2, 3, 2, 3, + (GtkAttachOptions) (GTK_EXPAND | GTK_FILL), + (GtkAttachOptions) (GTK_EXPAND | GTK_FILL), 0, 0); + gtk_scrolled_window_set_policy (GTK_SCROLLED_WINDOW (scrolledwindow2), GTK_POLICY_AUTOMATIC, GTK_POLICY_AUTOMATIC); + gtk_scrolled_window_set_shadow_type (GTK_SCROLLED_WINDOW (scrolledwindow2), GTK_SHADOW_IN); + + center_iview = gtk_icon_view_new (); + gtk_widget_show (center_iview); + gtk_container_add (GTK_CONTAINER (scrolledwindow2), center_iview); + gtk_icon_view_set_orientation (GTK_ICON_VIEW (center_iview), GTK_ORIENTATION_HORIZONTAL); + gtk_icon_view_set_reorderable (GTK_ICON_VIEW (center_iview), TRUE); + + scrolledwindow3 = gtk_scrolled_window_new (NULL, NULL); + gtk_widget_show (scrolledwindow3); + gtk_table_attach (GTK_TABLE (table5), scrolledwindow3, 0, 1, 2, 3, + (GtkAttachOptions) (GTK_EXPAND | GTK_FILL), + (GtkAttachOptions) (GTK_FILL), 0, 0); + gtk_scrolled_window_set_policy (GTK_SCROLLED_WINDOW (scrolledwindow3), GTK_POLICY_AUTOMATIC, GTK_POLICY_AUTOMATIC); + gtk_scrolled_window_set_shadow_type (GTK_SCROLLED_WINDOW (scrolledwindow3), GTK_SHADOW_IN); + + left_iview = gtk_icon_view_new (); + gtk_widget_show (left_iview); + gtk_container_add (GTK_CONTAINER (scrolledwindow3), left_iview); + gtk_icon_view_set_reorderable (GTK_ICON_VIEW (left_iview), TRUE); + + scrolledwindow4 = gtk_scrolled_window_new (NULL, NULL); + gtk_widget_show (scrolledwindow4); + gtk_table_attach (GTK_TABLE (table5), scrolledwindow4, 4, 5, 2, 3, + (GtkAttachOptions) (GTK_EXPAND | GTK_FILL), + (GtkAttachOptions) (GTK_FILL), 0, 0); + gtk_scrolled_window_set_policy (GTK_SCROLLED_WINDOW (scrolledwindow4), GTK_POLICY_AUTOMATIC, GTK_POLICY_AUTOMATIC); + gtk_scrolled_window_set_shadow_type (GTK_SCROLLED_WINDOW (scrolledwindow4), GTK_SHADOW_IN); + + right_iview = gtk_icon_view_new (); + gtk_widget_show (right_iview); + gtk_container_add (GTK_CONTAINER (scrolledwindow4), right_iview); + gtk_icon_view_set_reorderable (GTK_ICON_VIEW (right_iview), TRUE); + + scrolledwindow5 = gtk_scrolled_window_new (NULL, NULL); + gtk_widget_show (scrolledwindow5); + gtk_table_attach (GTK_TABLE (table5), scrolledwindow5, 2, 3, 0, 1, + (GtkAttachOptions) (GTK_FILL), + (GtkAttachOptions) (GTK_EXPAND | GTK_FILL), 0, 0); + gtk_scrolled_window_set_policy (GTK_SCROLLED_WINDOW (scrolledwindow5), GTK_POLICY_AUTOMATIC, GTK_POLICY_AUTOMATIC); + gtk_scrolled_window_set_shadow_type (GTK_SCROLLED_WINDOW (scrolledwindow5), GTK_SHADOW_IN); + + above_iview = gtk_icon_view_new (); + gtk_widget_show (above_iview); + gtk_container_add (GTK_CONTAINER (scrolledwindow5), above_iview); + gtk_icon_view_set_reorderable (GTK_ICON_VIEW (above_iview), TRUE); + + scrolledwindow6 = gtk_scrolled_window_new (NULL, NULL); + gtk_widget_show (scrolledwindow6); + gtk_table_attach (GTK_TABLE (table5), scrolledwindow6, 2, 3, 4, 5, + (GtkAttachOptions) (GTK_FILL), + (GtkAttachOptions) (GTK_EXPAND | GTK_FILL), 0, 0); + gtk_scrolled_window_set_policy (GTK_SCROLLED_WINDOW (scrolledwindow6), GTK_POLICY_AUTOMATIC, GTK_POLICY_AUTOMATIC); + gtk_scrolled_window_set_shadow_type (GTK_SCROLLED_WINDOW (scrolledwindow6), GTK_SHADOW_IN); + + below_iview = gtk_icon_view_new (); + gtk_widget_show (below_iview); + gtk_container_add (GTK_CONTAINER (scrolledwindow6), below_iview); + gtk_icon_view_set_reorderable (GTK_ICON_VIEW (below_iview), TRUE); + + label27 = gtk_label_new (""); + gtk_widget_show (label27); + gtk_table_attach (GTK_TABLE (table5), label27, 2, 3, 1, 2, + (GtkAttachOptions) (GTK_FILL), + (GtkAttachOptions) (0), 0, 0); + gtk_misc_set_alignment (GTK_MISC (label27), 0, 0.5); + + label28 = gtk_label_new (_(" ")); + gtk_widget_show (label28); + gtk_table_attach (GTK_TABLE (table5), label28, 1, 2, 2, 3, + (GtkAttachOptions) (GTK_FILL), + (GtkAttachOptions) (0), 0, 0); + gtk_misc_set_alignment (GTK_MISC (label28), 0, 0.5); + + label29 = gtk_label_new (_(" ")); + gtk_widget_show (label29); + gtk_table_attach (GTK_TABLE (table5), label29, 3, 4, 2, 3, + (GtkAttachOptions) (GTK_FILL), + (GtkAttachOptions) (0), 0, 0); + gtk_misc_set_alignment (GTK_MISC (label29), 0, 0.5); + + label30 = gtk_label_new (""); + gtk_widget_show (label30); + gtk_table_attach (GTK_TABLE (table5), label30, 2, 3, 3, 4, + (GtkAttachOptions) (GTK_FILL), + (GtkAttachOptions) (0), 0, 0); + gtk_misc_set_alignment (GTK_MISC (label30), 0, 0.5); + + label8 = gtk_label_new (_("Output Layout")); + gtk_widget_show (label8); + gtk_frame_set_label_widget (GTK_FRAME (frame3), label8); + gtk_label_set_use_markup (GTK_LABEL (label8), TRUE); + + label4 = gtk_label_new (_("Layout")); + gtk_widget_show (label4); + gtk_notebook_set_tab_label (GTK_NOTEBOOK (setting_notebook), gtk_notebook_get_nth_page (GTK_NOTEBOOK (setting_notebook), 2), label4); + + vbox4 = gtk_vbox_new (FALSE, 0); + gtk_widget_show (vbox4); + gtk_container_add (GTK_CONTAINER (setting_notebook), vbox4); + + hotkey_cbtn = gtk_check_button_new_with_mnemonic (_("Enable Hot Keys")); + gtk_widget_show (hotkey_cbtn); + gtk_box_pack_start (GTK_BOX (vbox4), hotkey_cbtn, FALSE, FALSE, 0); + + hotkey_tview = gtk_tree_view_new (); + gtk_widget_show (hotkey_tview); + gtk_box_pack_start (GTK_BOX (vbox4), hotkey_tview, TRUE, TRUE, 0); + + label5 = gtk_label_new (_("Hot Keys")); + gtk_widget_show (label5); + gtk_notebook_set_tab_label (GTK_NOTEBOOK (setting_notebook), gtk_notebook_get_nth_page (GTK_NOTEBOOK (setting_notebook), 3), label5); + + hbuttonbox1 = gtk_hbutton_box_new (); + gtk_widget_show (hbuttonbox1); + gtk_box_pack_start (GTK_BOX (vbox1), hbuttonbox1, FALSE, TRUE, 0); + gtk_button_box_set_layout (GTK_BUTTON_BOX (hbuttonbox1), GTK_BUTTONBOX_END); + + ok_btn = gtk_button_new_with_mnemonic (_("OK")); + gtk_widget_show (ok_btn); + gtk_container_add (GTK_CONTAINER (hbuttonbox1), ok_btn); + GTK_WIDGET_SET_FLAGS (ok_btn, GTK_CAN_DEFAULT); + + cancel_btn = gtk_button_new_with_mnemonic (_("Cancel")); + gtk_widget_show (cancel_btn); + gtk_container_add (GTK_CONTAINER (hbuttonbox1), cancel_btn); + GTK_WIDGET_SET_FLAGS (cancel_btn, GTK_CAN_DEFAULT); + + apply_btn = gtk_button_new_with_mnemonic (_("Apply")); + gtk_widget_show (apply_btn); + gtk_container_add (GTK_CONTAINER (hbuttonbox1), apply_btn); + GTK_WIDGET_SET_FLAGS (apply_btn, GTK_CAN_DEFAULT); + + g_signal_connect ((gpointer) about_btn, "clicked", + G_CALLBACK (on_about_btn_clicked), + NULL); + g_signal_connect ((gpointer) output_iview, "selection_changed", + G_CALLBACK (on_output_iview_selection_changed), + NULL); + g_signal_connect ((gpointer) modes_combo, "changed", + G_CALLBACK (on_modes_combo_changed), + NULL); + g_signal_connect ((gpointer) auto_cbtn, "toggled", + G_CALLBACK (on_auto_cbtn_toggled), + NULL); + g_signal_connect ((gpointer) off_cbtn, "toggled", + G_CALLBACK (on_off_cbtn_toggled), + NULL); + g_signal_connect ((gpointer) rotation0_rbtn, "pressed", + G_CALLBACK (on_rotation0_rbtn_pressed), + NULL); + g_signal_connect ((gpointer) rotation90_rbtn, "pressed", + G_CALLBACK (on_rotation90_rbtn_pressed), + NULL); + g_signal_connect ((gpointer) rotation180_rbtn, "pressed", + G_CALLBACK (on_rotation180_rbtn_pressed), + NULL); + g_signal_connect ((gpointer) rotation270_rbtn, "pressed", + G_CALLBACK (on_rotation270_rbtn_pressed), + NULL); + g_signal_connect ((gpointer) clone_rbtn, "pressed", + G_CALLBACK (on_clone_rbtn_pressed), + NULL); + g_signal_connect ((gpointer) panorama_rbtn, "pressed", + G_CALLBACK (on_panorama_rbtn_pressed), + NULL); + g_signal_connect ((gpointer) hotkey_cbtn, "toggled", + G_CALLBACK (on_hotkey_cbtn_toggled), + NULL); + g_signal_connect ((gpointer) ok_btn, "clicked", + G_CALLBACK (on_ok_btn_clicked), + NULL); + g_signal_connect ((gpointer) cancel_btn, "clicked", + G_CALLBACK (gtk_main_quit), + NULL); + g_signal_connect ((gpointer) apply_btn, "clicked", + G_CALLBACK (on_apply_btn_clicked), + NULL); + + /* Store pointers to all widgets, for use by lookup_widget(). */ + GLADE_HOOKUP_OBJECT_NO_REF (main_win, main_win, "main_win"); + GLADE_HOOKUP_OBJECT (main_win, vbox1, "vbox1"); + GLADE_HOOKUP_OBJECT (main_win, hbox3, "hbox3"); + GLADE_HOOKUP_OBJECT (main_win, label15, "label15"); + GLADE_HOOKUP_OBJECT (main_win, xserver_entry, "xserver_entry"); + GLADE_HOOKUP_OBJECT (main_win, label34, "label34"); + GLADE_HOOKUP_OBJECT (main_win, about_btn, "about_btn"); + GLADE_HOOKUP_OBJECT (main_win, label17, "label17"); + GLADE_HOOKUP_OBJECT (main_win, hbox1, "hbox1"); + GLADE_HOOKUP_OBJECT (main_win, scrolledwindow1, "scrolledwindow1"); + GLADE_HOOKUP_OBJECT (main_win, viewport1, "viewport1"); + GLADE_HOOKUP_OBJECT (main_win, vbox2, "vbox2"); + GLADE_HOOKUP_OBJECT (main_win, label9, "label9"); + GLADE_HOOKUP_OBJECT (main_win, output_iview, "output_iview"); + GLADE_HOOKUP_OBJECT (main_win, label16, "label16"); + GLADE_HOOKUP_OBJECT (main_win, setting_notebook, "setting_notebook"); + GLADE_HOOKUP_OBJECT (main_win, frame1, "frame1"); + GLADE_HOOKUP_OBJECT (main_win, hbox5, "hbox5"); + GLADE_HOOKUP_OBJECT (main_win, table3, "table3"); + GLADE_HOOKUP_OBJECT (main_win, label24, "label24"); + GLADE_HOOKUP_OBJECT (main_win, modes_combo, "modes_combo"); + GLADE_HOOKUP_OBJECT (main_win, vbox6, "vbox6"); + GLADE_HOOKUP_OBJECT (main_win, label32, "label32"); + GLADE_HOOKUP_OBJECT (main_win, auto_cbtn, "auto_cbtn"); + GLADE_HOOKUP_OBJECT (main_win, label33, "label33"); + GLADE_HOOKUP_OBJECT (main_win, off_cbtn, "off_cbtn"); + GLADE_HOOKUP_OBJECT (main_win, label6, "label6"); + GLADE_HOOKUP_OBJECT (main_win, label2, "label2"); + GLADE_HOOKUP_OBJECT (main_win, frame4, "frame4"); + GLADE_HOOKUP_OBJECT (main_win, alignment4, "alignment4"); + GLADE_HOOKUP_OBJECT (main_win, hbox2, "hbox2"); + GLADE_HOOKUP_OBJECT (main_win, rotation_img, "rotation_img"); + GLADE_HOOKUP_OBJECT (main_win, vbox3, "vbox3"); + GLADE_HOOKUP_OBJECT (main_win, rotation0_rbtn, "rotation0_rbtn"); + GLADE_HOOKUP_OBJECT (main_win, rotation90_rbtn, "rotation90_rbtn"); + GLADE_HOOKUP_OBJECT (main_win, rotation180_rbtn, "rotation180_rbtn"); + GLADE_HOOKUP_OBJECT (main_win, rotation270_rbtn, "rotation270_rbtn"); + GLADE_HOOKUP_OBJECT (main_win, label13, "label13"); + GLADE_HOOKUP_OBJECT (main_win, label3, "label3"); + GLADE_HOOKUP_OBJECT (main_win, frame3, "frame3"); + GLADE_HOOKUP_OBJECT (main_win, alignment3, "alignment3"); + GLADE_HOOKUP_OBJECT (main_win, vbox5, "vbox5"); + GLADE_HOOKUP_OBJECT (main_win, hbox4, "hbox4"); + GLADE_HOOKUP_OBJECT (main_win, clone_rbtn, "clone_rbtn"); + GLADE_HOOKUP_OBJECT (main_win, panorama_rbtn, "panorama_rbtn"); + GLADE_HOOKUP_OBJECT (main_win, label31, "label31"); + GLADE_HOOKUP_OBJECT (main_win, hseparator1, "hseparator1"); + GLADE_HOOKUP_OBJECT (main_win, table5, "table5"); + GLADE_HOOKUP_OBJECT (main_win, scrolledwindow2, "scrolledwindow2"); + GLADE_HOOKUP_OBJECT (main_win, center_iview, "center_iview"); + GLADE_HOOKUP_OBJECT (main_win, scrolledwindow3, "scrolledwindow3"); + GLADE_HOOKUP_OBJECT (main_win, left_iview, "left_iview"); + GLADE_HOOKUP_OBJECT (main_win, scrolledwindow4, "scrolledwindow4"); + GLADE_HOOKUP_OBJECT (main_win, right_iview, "right_iview"); + GLADE_HOOKUP_OBJECT (main_win, scrolledwindow5, "scrolledwindow5"); + GLADE_HOOKUP_OBJECT (main_win, above_iview, "above_iview"); + GLADE_HOOKUP_OBJECT (main_win, scrolledwindow6, "scrolledwindow6"); + GLADE_HOOKUP_OBJECT (main_win, below_iview, "below_iview"); + GLADE_HOOKUP_OBJECT (main_win, label27, "label27"); + GLADE_HOOKUP_OBJECT (main_win, label28, "label28"); + GLADE_HOOKUP_OBJECT (main_win, label29, "label29"); + GLADE_HOOKUP_OBJECT (main_win, label30, "label30"); + GLADE_HOOKUP_OBJECT (main_win, label8, "label8"); + GLADE_HOOKUP_OBJECT (main_win, label4, "label4"); + GLADE_HOOKUP_OBJECT (main_win, vbox4, "vbox4"); + GLADE_HOOKUP_OBJECT (main_win, hotkey_cbtn, "hotkey_cbtn"); + GLADE_HOOKUP_OBJECT (main_win, hotkey_tview, "hotkey_tview"); + GLADE_HOOKUP_OBJECT (main_win, label5, "label5"); + GLADE_HOOKUP_OBJECT (main_win, hbuttonbox1, "hbuttonbox1"); + GLADE_HOOKUP_OBJECT (main_win, ok_btn, "ok_btn"); + GLADE_HOOKUP_OBJECT (main_win, cancel_btn, "cancel_btn"); + GLADE_HOOKUP_OBJECT (main_win, apply_btn, "apply_btn"); + + return main_win; +} + diff --git a/src/interface.h b/src/interface.h new file mode 100644 index 0000000..a4a2caa --- /dev/null +++ b/src/interface.h @@ -0,0 +1,26 @@ +/* + * Copyright © 2007 Intel Corporation + * + * Permission is hereby granted, free of charge, to any person obtaining a copy + * of this software and associated documentation files (the "Software"), to deal + * in the Software without restriction, including without limitation the rights + * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell + * copies of the Software, and to permit persons to whom the Software is + * furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in + * all copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE + * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, + * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN + * THE SOFTWARE. + */ +/* + * DO NOT EDIT THIS FILE - it is generated by Glade. + */ + +GtkWidget* create_main_win (void); diff --git a/src/main.c b/src/main.c new file mode 100644 index 0000000..15a83e8 --- /dev/null +++ b/src/main.c @@ -0,0 +1,132 @@ +/* + * Copyright © 2007 Intel Corporation + * + * Permission is hereby granted, free of charge, to any person obtaining a copy + * of this software and associated documentation files (the "Software"), to deal + * in the Software without restriction, including without limitation the rights + * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell + * copies of the Software, and to permit persons to whom the Software is + * furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in + * all copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE + * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, + * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN + * THE SOFTWARE. + */ +/* + * Initial main.c file generated by Glade. Edit as required. + * Glade will not overwrite this file. + */ + +#ifdef HAVE_CONFIG_H +# include <config.h> +#endif + +#include <gtk/gtk.h> +#include <stdlib.h> + +#include "interface.h" +#include "support.h" + +#include "grandr.h" + +GtkWidget *root_window; +struct ScreenInfo *screen_info; +GtkListStore *output_store; +GtkListStore *mode_store; +GtkListStore *center_store, *left_store, *right_store, *above_store, *below_store; +GtkListStore *hotkey_store; + +static void +check_server_randr_version (Display *dpy) +{ + int major, minor; + + if (!XRRQueryVersion (dpy, &major, &minor)) { + fprintf (stderr, "RandR extension missing\n"); + exit (1); + } + + if (major < 1 || (major >= 1 && minor < 2)) { + fprintf (stderr, "Server RandR version before 1.2\n"); + exit (1); + } +} + +int +main (int argc, char *argv[]) +{ + Display *display; + int i; + +#ifdef ENABLE_NLS + bindtextdomain (GETTEXT_PACKAGE, PACKAGE_LOCALE_DIR); + bind_textdomain_codeset (GETTEXT_PACKAGE, "UTF-8"); + textdomain (GETTEXT_PACKAGE); +#endif + + g_thread_init (NULL); + gtk_set_locale (); + gtk_init (&argc, &argv); + + add_pixmap_directory (PACKAGE_DATA_DIR "/" PACKAGE "/pixmaps"); + add_pixmap_directory("pixmaps"); + add_pixmap_directory("../pixmaps"); + /* + * The following code was added by Glade to create one of each component + * (except popup menus), just so that you see something after building + * the project. Delete any components that you don't want shown initially. + */ + root_window = create_main_win (); + gtk_widget_show (root_window); + + display = XOpenDisplay(NULL); + + check_server_randr_version (display); + + screen_info = read_screen_info(display); + + + output_store = create_output_store (); + set_output_store (output_store, "output_iview"); + fill_output_store (output_store, screen_info, 1, OUTPUT_CONNECTED); + + left_store = create_output_store (); + set_output_store (left_store, "left_iview"); + + right_store = create_output_store (); + set_output_store (right_store, "right_iview"); + + above_store = create_output_store (); + set_output_store (above_store, "above_iview"); + + below_store = create_output_store (); + set_output_store (below_store, "below_iview"); + + center_store = create_output_store (); + set_output_store (center_store, "center_iview"); + + mode_store = create_mode_store (); + set_mode_store (mode_store, "modes_combo"); + + set_basic_views (screen_info->outputs[0]); + set_rotation_views (screen_info->outputs[0]->cur_crtc); + set_output_layout (screen_info); + + hotkey_store = create_hotkey_store (); + set_hotkey_store (hotkey_store, HOTKEY_TREEVIEW_NAME); + fill_hotkey_store (hotkey_store); + set_hotkeys_view (hotkey_store); + + //free_screen_info(screen_info); + + gtk_main (); + return 0; +} + diff --git a/src/pixmap.c b/src/pixmap.c new file mode 100644 index 0000000..c67f33f --- /dev/null +++ b/src/pixmap.c @@ -0,0 +1,566 @@ +/* + * Copyright © 2007 Intel Corporation + * + * Permission is hereby granted, free of charge, to any person obtaining a copy + * of this software and associated documentation files (the "Software"), to deal + * in the Software without restriction, including without limitation the rights + * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell + * copies of the Software, and to permit persons to whom the Software is + * furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in + * all copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE + * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, + * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN + * THE SOFTWARE. + */ +/* GdkPixbuf RGBA C-Source image dump */ +#include <gtk/gtk.h> + +#ifdef __SUNPRO_C +#pragma align 4 (big_pixbuf) +#endif +#ifdef __GNUC__ +const guint8 big_pixbuf[] __attribute__ ((__aligned__ (4))) = +#else +const guint8 big_pixbuf[] = +#endif +{ "" + /* Pixbuf magic (0x47646b50) */ + "GdkP" + /* length: header (24) + pixel_data (9216) */ + "\0\0$\30" + /* pixdata_type (0x1010002) */ + "\1\1\0\2" + /* rowstride (192) */ + "\0\0\0\300" + /* width (48) */ + "\0\0\0""0" + /* height (48) */ + "\0\0\0""0" + /* pixel_data: */ + "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" + "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" + "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" + "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" + "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" + "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" + "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" + "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" + "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" + "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" + "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" + "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" + "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" + "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" + "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" + "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" + "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" + "\0\0\0\0\0\0\207\207\207\40\217\221\214\272\222\224\220\366\230\232\225" + "\377\230\232\225\377\230\232\225\377\230\232\225\377\230\232\225\377" + "\230\232\225\377\230\232\225\377\230\232\225\377\230\232\225\377\230" + "\232\225\377\230\232\225\377\230\232\225\377\230\232\225\377\230\232" + "\225\377\230\232\225\377\230\232\225\377\230\232\225\377\230\232\225" + "\377\230\232\225\377\230\232\225\377\230\232\225\377\230\232\225\377" + "\230\232\225\377\230\232\225\377\230\232\225\377\230\232\225\377\230" + "\232\225\377\230\232\225\377\230\232\225\377\230\232\225\377\230\232" + "\225\377\230\232\225\377\230\232\225\377\230\232\225\377\230\232\225" + "\377\230\232\225\377\230\232\225\377\230\232\225\377\224\226\222\366" + "\217\220\214\303\205\213\205,\0\0\0\0\0\0\0\0\0\0\0\0\213\213\200\26" + "\224\226\221\357\355\355\354\376\375\375\375\377\375\375\374\377\375" + "\375\374\377\375\375\374\377\375\375\374\377\375\375\374\377\375\375" + "\374\377\375\375\374\377\375\375\374\377\375\375\374\377\375\375\374" + "\377\375\375\374\377\375\375\374\377\375\375\374\377\375\375\374\377" + "\375\375\374\377\375\375\374\377\375\375\374\377\375\375\374\377\375" + "\375\374\377\375\375\374\377\375\375\374\377\375\375\374\377\375\375" + "\374\377\375\375\374\377\374\374\374\377\374\374\374\377\374\374\374" + "\377\374\374\374\377\374\374\374\377\374\374\374\377\374\374\374\377" + "\374\374\374\377\374\374\374\377\374\374\374\377\374\374\374\377\374" + "\374\374\377\374\374\374\377\374\374\374\377\375\375\375\377\363\364" + "\363\377\234\236\232\363\214\214\204\37\0\0\0\0\0\0\0\0\220\222\215\252" + "\352\352\351\375\367\367\366\377\356\356\354\377\356\356\354\377\356" + "\356\354\377\356\356\354\377\356\356\354\377\356\356\354\377\356\356" + "\354\377\356\356\354\377\356\356\354\377\356\356\354\377\356\356\354" + "\377\356\356\354\377\356\356\354\377\356\356\354\377\356\356\354\377" + "\355\355\353\377\355\355\353\377\355\355\353\377\355\355\353\377\355" + "\355\353\377\355\355\353\377\355\355\353\377\355\355\352\377\354\354" + "\352\377\354\354\352\377\354\354\352\377\354\354\352\377\354\354\352" + "\377\354\354\352\377\354\354\352\377\354\354\351\377\354\354\351\377" + "\353\353\351\377\353\353\351\377\353\353\351\377\353\353\351\377\353" + "\353\351\377\353\353\351\377\353\353\350\377\353\353\350\377\363\363" + "\361\377\361\361\360\376\220\222\216\266\0\0\0\0\0\0\0\0\222\223\217" + "\361\375\375\375\377\356\356\354\377\356\356\354\377\356\356\354\377" + "\356\356\354\377\356\356\354\377\356\356\354\377\356\356\354\377\356" + "\356\354\377\356\356\354\377\356\356\354\377\356\356\354\377\356\356" + "\354\377\356\356\354\377\356\356\354\377\355\355\353\377\355\355\353" + "\377\355\355\353\377\355\355\353\377\355\355\353\377\355\355\353\377" + "\355\355\353\377\355\355\353\377\355\355\352\377\354\354\352\377\354" + "\354\352\377\354\354\352\377\354\354\352\377\354\354\352\377\354\354" + "\352\377\354\354\351\377\354\354\351\377\354\354\351\377\353\353\351" + "\377\353\353\351\377\353\353\351\377\353\353\351\377\353\353\351\377" + "\353\353\350\377\353\353\350\377\353\353\350\377\352\352\350\377\352" + "\352\350\377\375\375\375\377\223\225\220\364\0\0\0\0\0\0\0\0\226\230" + "\223\377\375\375\375\377\356\356\354\377\356\356\354\377\40J\207\377" + "\40J\207\377\40J\207\377\40J\207\377\40J\207\377\40J\207\377\40J\207" + "\377\40J\207\377\40J\207\377\40J\207\377\40J\207\377\40J\207\377\40J" + "\207\377\40J\207\377\40J\207\377\40J\207\377\40J\207\377\40J\207\377" + "\40J\207\377\40J\207\377\40J\207\377\40J\207\377\40J\207\377\40J\207" + "\377\40J\207\377\40J\207\377\40J\207\377\40J\207\377\40J\207\377\40J" + "\207\377\40J\207\377\40J\207\377\40J\207\377\40J\207\377\40J\207\377" + "\40J\207\377\40J\207\377\40J\207\377\352\352\350\377\352\352\350\377" + "\373\373\373\377\235\236\232\377\0\0\0\0\0\0\0\0\226\230\223\377\375" + "\375\375\377\356\356\354\377\356\356\354\377\40J\207\377\263\304\327" + "\377\263\304\327\377\263\304\327\377\263\304\327\377\263\304\327\377" + "\263\304\327\377\263\304\327\377\263\304\327\377\263\304\327\377\263" + "\304\327\377\263\304\327\377\263\304\327\377\263\304\327\377\263\304" + "\327\377\263\304\327\377\263\304\327\377\263\304\327\377\263\304\327" + "\377\263\304\327\377\263\304\327\377\263\304\327\377\263\304\327\377" + "\263\304\327\377\263\304\327\377\263\304\327\377\263\304\327\377\263" + "\304\327\377\263\304\327\377\263\304\327\377\263\304\327\377\263\304" + "\327\377\263\304\327\377\263\304\327\377\263\304\327\377\263\304\327" + "\377\263\304\327\377\40J\207\377\352\352\350\377\352\352\350\377\373" + "\373\373\377\235\237\233\377\0\0\0\0\0\0\0\0\226\230\223\377\375\375" + "\375\377\356\356\354\377\356\356\354\377\40J\207\377\253\277\323\377" + "\253\277\323\377\253\277\323\377\253\277\323\377\253\277\323\377\253" + "\277\323\377\253\277\323\377\253\277\323\377\253\277\323\377\253\277" + "\323\377\253\277\323\377\253\277\323\377\253\277\323\377\253\277\323" + "\377\253\277\323\377\253\277\323\377\253\277\323\377\253\277\323\377" + "\253\277\323\377\253\277\323\377\253\277\323\377\253\277\323\377\253" + "\277\323\377\253\277\323\377\253\277\323\377\253\277\323\377\253\277" + "\323\377\253\277\323\377\253\277\323\377\253\277\323\377\253\277\323" + "\377\253\277\323\377\253\277\323\377\253\277\323\377\253\277\323\377" + "\253\277\323\377\40J\207\377\352\352\350\377\352\352\347\377\373\373" + "\373\377\235\237\233\377\0\0\0\0\0\0\0\0\226\230\223\377\375\375\375" + "\377\356\356\354\377\356\356\354\377\40J\207\377\243\270\317\377\243" + "\270\317\377\243\270\317\377\243\270\317\377\243\270\317\377\243\270" + "\317\377\243\270\317\377\243\270\317\377\243\270\317\377\243\270\317" + "\377\243\270\317\377\243\270\317\377\243\270\317\377\243\270\317\377" + "\243\270\317\377\243\270\317\377\243\270\317\377\243\270\317\377\243" + "\270\317\377\243\270\317\377\243\270\317\377\243\270\317\377\243\270" + "\317\377\243\270\317\377\243\270\317\377\243\270\317\377\243\270\317" + "\377\243\270\317\377\243\270\317\377\243\270\317\377\243\270\317\377" + "\243\270\317\377\243\270\317\377\243\270\317\377\243\270\317\377\243" + "\270\317\377\40J\207\377\352\352\347\377\352\352\347\377\373\373\373" + "\377\235\237\233\377\0\0\0\0\0\0\0\0\226\230\223\377\375\375\375\377" + "\356\356\354\377\356\356\354\377\40J\207\377\234\263\313\377\234\263" + "\313\377\234\263\313\377\234\263\313\377\234\263\313\377\234\263\313" + "\377\234\263\313\377\234\263\313\377\234\263\313\377\234\263\313\377" + "\234\263\313\377\234\263\313\377\234\263\313\377\234\263\313\377\234" + "\263\313\377\234\263\313\377\234\263\313\377\234\263\313\377\234\263" + "\313\377\234\263\313\377\234\263\313\377\234\263\313\377\234\263\313" + "\377\234\263\313\377\234\263\313\377\234\263\313\377\234\263\313\377" + "\234\263\313\377\234\263\313\377\234\263\313\377\234\263\313\377\234" + "\263\313\377\234\263\313\377\234\263\313\377\234\263\313\377\234\263" + "\313\377\40J\207\377\352\352\347\377\352\352\347\377\373\373\373\377" + "\235\237\233\377\0\0\0\0\0\0\0\0\226\230\223\377\375\375\375\377\356" + "\356\354\377\356\356\354\377\40J\207\377\225\255\310\377\225\255\310" + "\377\225\255\310\377\225\255\310\377\225\255\310\377\225\255\310\377" + "\225\255\310\377\225\255\310\377\225\255\310\377\225\255\310\377\225" + "\255\310\377\225\255\310\377\225\255\310\377\225\255\310\377\225\255" + "\310\377\225\255\310\377\225\255\310\377\225\255\310\377\225\255\310" + "\377\225\255\310\377\225\255\310\377\225\255\310\377\225\255\310\377" + "\225\255\310\377\225\255\310\377\225\255\310\377\225\255\310\377\225" + "\255\310\377\225\255\310\377\225\255\310\377\225\255\310\377\225\255" + "\310\377\225\255\310\377\225\255\310\377\225\255\310\377\225\255\310" + "\377\40J\207\377\351\351\347\377\351\351\347\377\373\373\373\377\235" + "\237\233\377\0\0\0\0\0\0\0\0\226\230\223\377\375\375\375\377\356\356" + "\354\377\356\356\354\377\40J\207\377\216\250\304\377\216\250\304\377" + "\216\250\304\377\216\250\304\377\216\250\304\377\216\250\304\377\216" + "\250\304\377\216\250\304\377\216\250\304\377\216\250\304\377\216\250" + "\304\377\216\250\304\377\216\250\304\377\216\250\304\377\216\250\304" + "\377\216\250\304\377\217\250\304\377\217\250\304\377\217\250\304\377" + "\217\250\304\377\216\250\304\377\216\250\304\377\216\250\304\377\216" + "\250\304\377\216\250\304\377\216\250\304\377\216\250\304\377\216\250" + "\304\377\216\250\304\377\216\250\304\377\216\250\304\377\216\250\304" + "\377\216\250\304\377\216\250\304\377\216\250\304\377\216\250\304\377" + "\40J\207\377\351\351\347\377\351\351\347\377\373\373\373\377\235\237" + "\233\377\0\0\0\0\0\0\0\0\226\230\223\377\375\375\375\377\356\356\354" + "\377\356\356\354\377\40J\207\377\206\242\300\377\206\242\300\377\206" + "\242\300\377\206\242\300\377\206\242\300\377\206\242\300\377\206\242" + "\300\377\206\242\300\377\206\242\300\377\210\243\301\377\210\243\301" + "\377\210\244\302\377\211\244\302\377\211\244\302\377\211\245\303\377" + "\212\245\303\377\212\246\303\377\212\246\303\377\212\246\303\377\212" + "\246\303\377\212\245\303\377\211\245\303\377\211\244\302\377\211\244" + "\302\377\210\244\302\377\210\243\301\377\210\243\301\377\206\242\300" + "\377\206\242\300\377\206\242\300\377\206\242\300\377\206\242\300\377" + "\206\242\300\377\206\242\300\377\206\242\300\377\206\242\300\377\40J" + "\207\377\351\351\347\377\351\351\346\377\373\373\373\377\235\237\233" + "\377\0\0\0\0\0\0\0\0\226\230\223\377\375\375\375\377\356\356\354\377" + "\355\355\353\377\40J\207\377\177\234\274\377\177\234\274\377\177\234" + "\274\377\177\234\274\377\177\234\274\377\177\234\274\377\200\236\276" + "\377\201\236\276\377\202\237\277\377\203\240\277\377\204\240\300\377" + "\204\241\301\377\204\241\301\377\205\241\301\377\205\242\302\377\205" + "\242\302\377\205\243\302\377\205\243\302\377\205\243\302\377\205\243" + "\302\377\205\242\302\377\205\242\302\377\205\241\301\377\204\241\301" + "\377\204\241\301\377\204\240\300\377\203\240\277\377\202\237\277\377" + "\201\236\276\377\200\236\276\377y\230\271\377d\207\256\377V}\247\377" + "Ir\240\377\77k\233\3777e\227\377\40J\207\377\351\351\346\377\351\351" + "\346\377\373\373\373\377\235\237\233\377\0\0\0\0\0\0\0\0\226\230\223" + "\377\375\375\375\377\355\355\353\377\355\355\353\377\40J\207\377x\227" + "\271\377x\227\271\377x\227\271\377y\227\271\377y\230\272\377{\232\272" + "\377{\232\274\377}\234\274\377}\234\275\377~\235\276\377\177\235\277" + "\377\200\236\300\377\200\237\300\377\201\237\300\377\201\237\301\377" + "\201\240\301\377\202\240\301\377\202\240\301\377\202\240\301\377\202" + "\240\301\377\201\240\301\377\201\237\301\377\201\237\300\377\200\237" + "\300\377\200\236\300\377\177\235\277\377~\235\276\377o\222\266\377[\202" + "\253\377Eq\240\3777f\227\3774c\226\3773a\224\3772a\224\3772a\224\377" + "2a\224\377\40J\207\377\351\351\346\377\351\351\346\377\373\373\373\377" + "\235\237\233\377\0\0\0\0\0\0\0\0\226\230\223\377\375\375\375\377\355" + "\355\353\377\355\355\353\377\40J\207\377q\221\265\377q\221\265\377r\223" + "\266\377s\224\267\377u\225\270\377v\226\272\377w\230\272\377x\230\274" + "\377y\232\274\377z\232\275\377{\233\276\377|\234\276\377}\234\277\377" + "}\235\300\377}\235\300\377}\236\301\377~\236\301\377~\236\301\377~\236" + "\301\377~\236\301\377}\236\301\377}\235\301\377}\235\300\377}\234\277" + "\377w\230\274\377b\210\261\377Hu\244\377>m\237\377=k\236\377;j\234\377" + "9h\233\3778g\231\3776e\227\3774c\226\3772a\224\3772a\224\377\40J\207" + "\377\351\351\346\377\351\351\346\377\373\373\373\377\235\237\233\377" + "\0\0\0\0\0\0\0\0\226\230\223\377\375\375\375\377\355\355\353\377\355" + "\355\353\377\40J\207\377j\214\262\377l\216\263\377m\217\265\377o\221" + "\265\377p\222\267\377q\223\270\377s\225\271\377t\226\272\377u\227\273" + "\377v\227\275\377w\231\275\377x\232\276\377y\232\277\377z\233\300\377" + "z\233\300\377z\234\300\377z\234\300\377z\235\300\377z\235\300\377z\234" + "\300\377z\234\300\377z\233\300\377p\224\273\377Z\203\260\377Gu\247\377" + "Ds\245\377Cq\244\377Bp\242\377@o\241\377\77m\237\377=k\236\377;j\234" + "\3779h\232\3777f\231\3775d\227\3773b\225\377\40J\207\377\350\350\346" + "\377\350\350\346\377\373\373\373\377\235\237\233\377\0\0\0\0\0\0\0\0" + "\226\230\223\377\375\375\375\377\355\355\353\377\355\355\353\377\40J" + "\207\377e\211\257\377f\212\261\377h\214\262\377i\215\264\377k\217\265" + "\377l\220\267\377n\221\270\377o\223\271\377p\224\273\377r\225\273\377" + "r\226\274\377t\227\276\377u\230\276\377u\231\276\377u\231\277\377v\232" + "\300\377v\232\300\377w\232\300\377w\232\300\377v\232\300\377k\221\273" + "\377W\202\261\377Lz\253\377Ky\253\377Jx\252\377Hw\250\377Gu\247\377E" + "t\246\377Dr\244\377Bp\242\377@o\241\377>m\237\377<k\235\377:i\233\377" + "8g\231\3776e\227\377\40J\207\377\350\350\346\377\350\350\346\377\373" + "\373\372\377\235\237\233\377\0\0\0\0\0\0\0\0\226\230\223\377\375\375" + "\375\377\355\355\353\377\355\355\353\377\40J\207\377_\205\256\377a\206" + "\257\377c\210\261\377e\212\263\377f\214\264\377h\215\266\377i\216\267" + "\377k\220\270\377m\222\272\377m\222\273\377o\224\274\377p\225\275\377" + "r\226\276\377r\227\277\377s\230\277\377s\230\300\377t\231\300\377s\230" + "\300\377h\220\273\377Y\205\264\377Q\177\261\377Q\177\260\377P~\257\377" + "O}\256\377M{\255\377Lz\254\377Jx\252\377Iw\251\377Gu\247\377Es\245\377" + "Cq\244\377Ap\242\377\77m\240\377=k\236\377;i\234\3778g\232\377\40J\207" + "\377\350\350\345\377\350\350\345\377\373\373\372\377\235\237\233\377" + "\0\0\0\0\0\0\0\0\226\230\223\377\375\375\375\377\355\355\352\377\354" + "\354\352\377\40J\207\377[\201\254\377\\\203\256\377^\205\257\377`\207" + "\261\377b\211\263\377d\212\264\377e\214\266\377g\216\270\377i\217\271" + "\377j\221\273\377k\222\274\377m\224\276\377n\224\276\377o\225\277\377" + "p\226\300\377o\226\277\377e\217\274\377Y\206\266\377V\204\265\377V\204" + "\265\377U\203\264\377U\202\264\377T\201\263\377R\200\262\377Q\177\261" + "\377P~\257\377N|\256\377Lz\254\377Jx\252\377Hv\250\377Ft\246\377Dr\244" + "\377Bp\242\377\77n\240\377=k\236\377;i\234\377\40J\207\377\350\350\345" + "\377\350\350\345\377\373\373\372\377\235\237\233\377\0\0\0\0\0\0\0\0" + "\226\230\223\377\375\375\375\377\354\354\352\377\354\354\352\377\40J" + "\207\377U~\252\377W\200\254\377Y\202\256\377[\204\257\377]\205\261\377" + "_\210\263\377b\212\266\377c\214\267\377e\215\270\377g\217\272\377i\221" + "\274\377j\222\275\377k\223\276\377i\221\276\377b\215\273\377[\210\271" + "\377Z\210\271\377[\210\271\377[\210\271\377Z\210\271\377Z\207\270\377" + "Y\207\270\377X\205\267\377V\204\265\377U\202\264\377S\201\262\377Q\177" + "\261\377O}\257\377M{\255\377Ky\253\377Iw\251\377Ft\246\377Dr\244\377" + "Bp\242\377\77n\240\377=k\236\377\40J\207\377\350\350\345\377\350\350" + "\345\377\373\373\372\377\235\237\233\377\0\0\0\0\0\0\0\0\226\230\223" + "\377\375\375\375\377\354\354\352\377\354\354\352\377\40J\207\377Oz\250" + "\377R|\252\377T\177\254\377W\201\256\377Y\203\260\377[\205\263\377]\207" + "\264\377_\211\266\377b\213\270\377c\215\272\377d\216\273\377a\214\273" + "\377]\211\271\377[\211\272\377]\212\273\377^\213\274\377_\214\275\377" + "_\214\275\377_\214\275\377_\214\275\377^\213\274\377]\212\273\377[\211" + "\272\377Z\207\270\377X\206\267\377V\204\265\377T\202\263\377R\200\261" + "\377O}\257\377M{\255\377Ky\253\377Hw\250\377Ft\246\377Cr\244\377Ao\242" + "\377>m\237\377\40J\207\377\350\350\345\377\350\350\345\377\373\373\372" + "\377\235\237\233\377\0\0\0\0\0\0\0\0\226\230\223\377\375\375\375\377" + "\354\354\352\377\354\354\352\377\40J\207\377Jv\246\377Ly\250\377O{\252" + "\377R~\255\377T\177\257\377W\202\261\377Y\204\263\377Y\205\264\377Y\206" + "\265\377X\205\266\377Y\206\267\377[\210\272\377]\212\273\377_\214\275" + "\377`\216\277\377b\217\300\377c\220\301\377c\220\301\377c\220\301\377" + "c\220\301\377b\217\300\377`\216\277\377_\214\275\377]\212\273\377[\210" + "\272\377Y\206\267\377V\204\265\377T\202\263\377R\200\261\377O}\257\377" + "M{\254\377Jx\252\377Hv\250\377Es\245\377Bq\243\377@n\241\377\40J\207" + "\377\347\347\345\377\347\347\345\377\373\373\372\377\235\237\233\377" + "\0\0\0\0\0\0\0\0\226\230\223\377\375\375\375\377\354\354\352\377\354" + "\354\352\377\40J\207\377Er\244\377Gt\245\377Iv\247\377Ky\252\377Lz\254" + "\377O}\256\377Q\177\260\377S\201\263\377V\204\265\377X\206\267\377[\210" + "\272\377]\213\274\377`\215\276\377b\217\300\377d\221\302\377f\223\303" + "\377g\224\305\377h\225\305\377h\225\305\377g\224\305\377f\223\303\377" + "d\221\302\377b\217\300\377`\215\276\377]\213\274\377[\210\272\377X\206" + "\267\377V\204\265\377S\201\263\377Q\177\260\377N|\256\377Lz\253\377I" + "w\251\377Ft\246\377Dr\244\377Ao\242\377\40J\207\377\347\347\345\377\347" + "\347\344\377\373\373\372\377\235\237\233\377\0\0\0\0\0\0\0\0\226\230" + "\223\377\375\375\375\377\354\354\352\377\354\354\351\377\40J\207\377" + "Bp\242\377Ds\245\377Gu\247\377Jx\252\377Lz\254\377O}\257\377R\200\261" + "\377T\202\264\377W\205\266\377Z\207\271\377\\\212\273\377_\215\275\377" + "b\217\300\377d\221\302\377g\224\304\377i\226\306\377k\230\310\377l\231" + "\311\377l\231\311\377k\230\310\377i\226\306\377g\224\304\377d\221\302" + "\377b\217\300\377_\215\275\377\\\212\273\377Z\207\271\377W\205\266\377" + "T\202\264\377R\200\261\377O}\257\377Lz\254\377Jx\252\377Gu\247\377Ds" + "\245\377Bp\242\377\40J\207\377\347\347\344\377\347\347\344\377\373\373" + "\372\377\235\237\233\377\0\0\0\0\0\0\0\0\226\230\223\377\375\375\374" + "\377\354\354\351\377\354\354\351\377\40J\207\377Bp\242\377Es\245\377" + "Gv\250\377Jx\252\377M{\255\377P~\257\377R\200\262\377U\203\264\377X\205" + "\267\377Z\210\271\377]\213\274\377`\215\276\377c\220\301\377e\223\303" + "\377h\225\306\377k\230\310\377m\232\313\377p\235\315\377p\235\315\377" + "m\232\313\377k\230\310\377h\225\306\377e\223\303\377c\220\301\377`\215" + "\276\377]\213\274\377Z\210\271\377X\206\267\377U\203\264\377R\200\262" + "\377P~\257\377M{\255\377Jx\252\377Gv\250\377Es\245\377Bp\242\377\40J" + "\207\377\347\347\344\377\347\347\344\377\373\373\372\377\235\237\233" + "\377\0\0\0\0\0\0\0\0\226\230\223\377\375\375\374\377\353\353\351\377" + "\353\353\351\377\40J\207\377Bp\242\377Es\245\377Gv\250\377Jx\252\377" + "M{\254\377O}\257\377R\200\261\377U\203\264\377X\205\267\377Z\210\271" + "\377]\213\274\377`\215\276\377b\220\300\377e\222\303\377h\225\306\377" + "j\227\310\377m\232\312\377o\234\314\377o\234\314\377m\232\312\377j\227" + "\310\377h\225\306\377e\222\303\377b\220\300\377`\215\276\377]\213\274" + "\377Z\210\271\377X\205\267\377U\203\264\377R\200\261\377O}\257\377M{" + "\255\377Jx\252\377Gv\250\377Es\245\377Bp\242\377\40J\207\377\347\347" + "\344\377\347\347\344\377\373\373\372\377\235\237\233\377\0\0\0\0\0\0" + "\0\0\226\230\223\377\375\375\374\377\353\353\351\377\353\353\351\377" + "\40J\207\377Ap\242\377Dr\245\377Gu\247\377Ix\251\377Lz\254\377O}\256" + "\377Q\177\261\377T\202\263\377W\205\266\377Y\207\270\377\\\212\273\377" + "_\214\275\377a\217\277\377c\221\301\377f\223\304\377h\225\306\377i\227" + "\307\377j\227\310\377j\227\310\377i\227\307\377h\225\306\377f\223\304" + "\377d\221\302\377a\217\277\377_\214\275\377\\\212\273\377Y\207\270\377" + "W\205\266\377T\202\263\377R\200\261\377O}\256\377Lz\254\377Ix\251\377" + "Gu\247\377Dr\245\377Ap\242\377\40J\207\377\347\347\344\377\347\347\344" + "\377\373\373\372\377\235\237\233\377\0\0\0\0\0\0\0\0\226\230\223\377" + "\375\375\374\377\353\353\351\377\353\353\351\377\40J\207\377\40J\207" + "\377\40J\207\377\40J\207\377\40J\207\377\40J\207\377\40J\207\377\40J" + "\207\377\40J\207\377\40J\207\377\40J\207\377\40J\207\377\40J\207\377" + "\40J\207\377\40J\207\377\40J\207\377\40J\207\377\40J\207\377\40J\207" + "\377\40J\207\377\40J\207\377\40J\207\377\40J\207\377\40J\207\377\40J" + "\207\377\40J\207\377\40J\207\377\40J\207\377\40J\207\377\40J\207\377" + "\40J\207\377\40J\207\377\40J\207\377\40J\207\377\40J\207\377\40J\207" + "\377\40J\207\377\40J\207\377\347\347\344\377\346\346\343\377\373\373" + "\372\377\235\237\233\377\0\0\0\0\0\0\0\0\226\230\223\377\375\375\374" + "\377\353\353\351\377\353\353\350\377\353\353\350\377\353\353\350\377" + "\352\352\350\377\352\352\350\377\352\352\350\377\352\352\350\377\352" + "\352\350\377\352\352\347\377\352\352\347\377\352\352\347\377\352\352" + "\347\377\351\351\347\377\351\351\347\377\351\351\347\377\351\351\347" + "\377\351\351\346\377\351\351\346\377\351\351\346\377\351\351\346\377" + "\351\351\346\377\350\350\346\377\350\350\346\377\350\350\345\377\350" + "\350\345\377\350\350\345\377\350\350\345\377\350\350\345\377\350\350" + "\345\377\347\347\345\377\347\347\345\377\347\347\344\377\347\347\344" + "\377\347\347\344\377\347\347\344\377\347\347\344\377\347\347\344\377" + "\347\347\344\377\346\346\344\377\346\346\343\377\346\346\343\377\373" + "\373\372\377\235\237\233\377\0\0\0\0\0\0\0\0\226\230\223\377\375\375" + "\374\377\353\353\350\377\353\353\350\377\353\353\350\377\352\352\350" + "\377\352\352\350\377\352\352\350\377\352\352\350\377\352\352\350\377" + "\352\352\347\377\352\352\347\377\352\352\347\377\352\352\347\377\351" + "\351\347\377\351\351\347\377\351\351\347\377\351\351\346\377\351\351" + "\346\377\351\351\346\377\351\351\346\377\351\351\346\377\350\350\346" + "\377\350\350\346\377\350\350\346\377\350\350\345\377\350\350\345\377" + "\350\350\345\377\350\350\345\377\350\350\345\377\350\350\345\377\347" + "\347\345\377\347\347\345\377\347\347\344\377\347\347\344\377\347\347" + "\344\377\347\347\344\377\347\347\344\377\347\347\344\377\347\347\344" + "\377\346\346\343\377\346\346\343\377\346\346\343\377\346\346\343\377" + "\373\373\372\377\235\237\233\377\0\0\0\0\0\0\0\0\225\227\223\374\376" + "\376\375\377\353\353\350\377\353\353\350\377\352\352\350\377\352\352" + "\350\377\352\352\350\377\352\352\350\377\352\352\347\377\352\352\347" + "\377\352\352\347\377\352\352\347\377\351\351\347\377\351\351\347\377" + "\351\351\347\377\351\351\347\377\351\351\346\377\351\351\346\377\351" + "\351\346\377\351\351\346\377\351\351\346\377\350\350\346\377\350\350" + "\346\377\350\350\346\377\350\350\345\377\350\350\345\377\350\350\345" + "\377\350\350\345\377\350\350\345\377\350\350\345\377\347\347\345\377" + "\347\347\344\377\347\347\344\377\347\347\344\377\347\347\344\377\347" + "\347\344\377\347\347\344\377\347\347\344\377\346\346\344\377\346\346" + "\343\377\346\346\343\377\346\346\343\377\346\346\343\377\346\346\343" + "\377\373\373\373\377\232\234\227\376\0\0\0\0\0\0\0\0\221\222\214\323" + "\364\364\363\377\375\375\374\377\374\374\374\377\374\374\374\377\374" + "\374\374\377\374\374\374\377\374\374\374\377\374\374\374\377\374\374" + "\374\377\374\374\374\377\374\374\374\377\374\374\374\377\374\374\374" + "\377\374\374\374\377\374\374\374\377\374\374\374\377\374\374\374\377" + "\374\374\374\377\374\374\374\377\374\374\374\377\374\374\374\377\374" + "\374\374\377\374\374\374\377\374\374\374\377\374\374\374\377\374\374" + "\374\377\374\374\374\377\374\374\374\377\374\374\374\377\374\374\373" + "\377\374\374\373\377\374\374\373\377\374\374\373\377\374\374\373\377" + "\374\374\373\377\374\374\373\377\374\374\373\377\374\374\373\377\374" + "\374\373\377\374\374\373\377\374\374\373\377\374\374\373\377\374\374" + "\373\377\371\371\371\377\220\223\216\342\0\0\0\0\0\0\0\0\205\213\205" + ",\217\221\214\331\226\230\223\375\230\232\225\377\230\232\225\377\230" + "\232\225\377\230\232\225\377\230\232\225\377\230\232\225\377\230\232" + "\225\377\230\232\225\377\230\232\225\377\230\232\225\377\230\232\225" + "\377\230\232\225\377\230\232\225\377\230\232\225\377\230\232\225\377" + "\230\232\225\377\230\232\225\377\230\232\225\377\230\232\225\377\230" + "\232\225\377\230\232\225\377\230\232\225\377\230\232\225\377\230\232" + "\225\377\230\232\225\377\230\232\225\377\230\232\225\377\230\232\225" + "\377\230\232\225\377\230\232\225\377\230\232\225\377\230\232\225\377" + "\230\232\225\377\230\232\225\377\230\232\225\377\230\232\225\377\230" + "\232\225\377\230\232\225\377\230\232\225\377\230\232\225\377\230\232" + "\225\377\220\222\216\352\213\213\207B\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" + "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" + "\0\0\0\0\0\0\252\252\252\3NPM\376\213\213\212\377\214\214\213\377\215" + "\215\214\377\217\217\216\377\221\221\217\377\223\223\221\377\222\222" + "\220\377\217\217\216\377\221\221\217\377\223\223\221\377\224\224\223" + "\377\225\225\224\377\227\227\226\377\230\230\227\377\232\232\231\377" + "\234\234\233\377\236\236\234\377\240\240\236\377\\]Z\377\0\0\0\0\0\0" + "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" + "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" + "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" + "```\30[\\Y\372\235\235\233\377\236\236\234\377\240\240\236\377\241\241" + "\240\377\243\243\242\377\245\245\244\377\246\246\245\377\250\250\247" + "\377\252\252\250\377\254\254\252\377\256\256\254\377\257\257\255\377" + "\260\260\257\377\262\262\261\377\264\264\263\377\266\266\264\377\267" + "\267\265\377\271\271\267\377mnj\372fff\24\0\0\0\0\0\0\0\0\0\0\0\0\0\0" + "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" + "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" + "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0lnjt~\177}\365\265\265\264" + "\377\266\266\265\377\270\270\266\377\272\272\270\377\274\274\272\377" + "\276\276\274\377\277\277\275\377\300\300\277\377\302\302\301\377\304" + "\304\302\377\305\305\303\377\307\307\305\377\311\311\307\377\313\313" + "\311\377\314\314\313\377\315\315\314\377\317\317\316\377\321\321\317" + "\377\224\225\221\363|~ye\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" + "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" + "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\1\0\0" + "\0\4\32\32\32\12jjd)|~z\202\177\200}\363\306\306\304\377\320\320\316" + "\377\320\320\316\377\320\320\316\377\322\322\317\377\324\324\321\377" + "\325\325\322\377\327\327\324\377\331\331\326\377\332\332\330\377\334" + "\334\331\377\334\334\332\377\336\336\334\377\340\340\336\377\342\342" + "\340\377\344\344\342\377\345\345\343\377\346\346\344\377\350\350\346" + "\377\332\333\330\377\216\220\213\362}\200{rMMM\36\0\0\0\14\0\0\0\11\0" + "\0\0\5\0\0\0\2\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" + "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\3\0\0\0\7\0\0\0\13""5" + "55\30\213\214\210\275\212\214\207\372\217\221\215\364\250\251\244\365" + "\333\334\331\377\352\352\350\377\352\352\350\377\352\352\350\377\352" + "\352\350\377\352\352\350\377\352\352\350\377\352\352\350\377\352\352" + "\350\377\352\352\350\377\352\352\350\377\352\352\350\377\352\352\350" + "\377\352\352\350\377\352\352\350\377\352\352\350\377\352\352\350\377" + "\352\352\350\377\352\352\350\377\352\352\347\377\352\352\347\377\331" + "\331\325\377\241\242\236\364\212\214\210\371\213\215\207\361\206\211" + "\204\246\26\26\26\27\0\0\0\17\0\0\0\14\0\0\0\10\0\0\0\4\0\0\0\1\0\0\0" + "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\3\0\0\0\10\0\0\0\14" + "\0\0\0\20\0\0\0\24\203\205\200\220\247\250\245\371\276\276\276\377\301" + "\301\301\377\301\301\301\377\301\301\301\377\301\301\301\377\301\301" + "\301\377\301\301\300\377\301\301\300\377\301\301\300\377\301\301\300" + "\377\301\301\300\377\301\301\300\377\301\301\300\377\301\301\300\377" + "\301\301\300\377\301\301\300\377\301\301\300\377\301\301\300\377\301" + "\301\300\377\301\301\300\377\301\301\300\377\301\301\300\377\301\301" + "\300\377\301\301\300\377\301\301\300\377\301\301\300\377\301\301\300" + "\377\272\272\272\377\241\243\237\366}}y\201\0\0\0\31\0\0\0\25\0\0\0\21" + "\0\0\0\15\0\0\0\11\0\0\0\5\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\3\0" + "\0\0\7\0\0\0\14\0\0\0\20\0\0\0\25\0\0\0\31\214\217\212\345\363\363\362" + "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377" + "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377" + "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377" + "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377" + "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377" + "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377" + "\377\377\377\377\377\377\377\377\377\377\377\365\365\364\377\212\215" + "\210\341\0\0\0\37\0\0\0\32\0\0\0\26\0\0\0\21\0\0\0\15\0\0\0\11\0\0\0" + "\4\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\3\0\0\0\7\0\0\0\14\0\0\0\20\0\0\0\25" + "\0\0\0\31\212\215\210\365\340\340\334\377\347\347\344\377\347\347\344" + "\377\346\346\344\377\346\346\344\377\346\346\344\377\346\346\343\377" + "\346\346\343\377\346\346\343\377\346\346\343\377\346\346\343\377\346" + "\346\343\377\346\346\343\377\346\346\343\377\346\346\343\377\346\346" + "\343\377\346\346\343\377\346\346\343\377\346\346\343\377\346\346\343" + "\377\346\346\343\377\346\346\343\377\346\346\343\377\346\346\343\377" + "\346\346\343\377\346\346\343\377\346\346\343\377\346\346\343\377\346" + "\346\343\377\336\336\333\377\212\215\207\365\0\0\0\37\0\0\0\32\0\0\0" + "\26\0\0\0\21\0\0\0\15\0\0\0\11\0\0\0\4\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" + "\0\0\0\0\3\0\0\0\7\0\0\0\13\0\0\0\20\0\0\0\24\210\212\205\377\212\214" + "\207\373\213\215\210\370\213\215\210\370\213\215\210\370\213\215\210" + "\370\212\214\207\371\212\214\207\371\212\214\207\371\212\214\207\371" + "\212\214\207\371\212\214\207\371\212\214\207\371\212\214\207\371\212" + "\214\207\371\212\214\207\371\210\212\205\375\210\212\205\377\210\212" + "\205\377\210\212\205\377\210\212\205\377\210\212\205\377\210\212\205" + "\377\210\212\205\377\210\212\205\377\210\212\205\377\210\212\205\377" + "\210\212\205\377\210\212\205\377\210\212\205\377\210\212\205\377\210" + "\212\205\377\0\0\0\31\0\0\0\25\0\0\0\21\0\0\0\15\0\0\0\10\0\0\0\4\0\0" + "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\2\0\0\0\7" + "\0\0\0\12III\34FFF!>>>%999(555+222.///1,,,4+++5)))8(((:&&&<%%%>$$$\77" + "$$$@###A\22\22\22""9\0\0\0""3\0\0\0""2\0\0\0""1\0\0\0""0\0\0\0/\0\0\0" + "-\0\0\0+\0\0\0(\0\0\0%\0\0\0#\0\0\0\40\0\0\0\35\0\0\0\31\0\0\0\26\0\0" + "\0\23\0\0\0\17\0\0\0\13\0\0\0\7\0\0\0\3\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" + "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" + "\0\0\1\0\0\0\3\0\0\0\7\0\0\0\12\0\0\0\15\0\0\0\17\0\0\0\22\0\0\0\24\0" + "\0\0\26\0\0\0\30\0\0\0\32\0\0\0\33\0\0\0\35\0\0\0\35\0\0\0\36\0\0\0\37" + "\0\0\0\37\0\0\0\37\0\0\0\36\0\0\0\36\0\0\0\35\0\0\0\34\0\0\0\32\0\0\0" + "\31\0\0\0\27\0\0\0\25\0\0\0\22\0\0\0\20\0\0\0\15\0\0\0\13\0\0\0\10\0" + "\0\0\4\0\0\0\1\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" + "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" + "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\1\0\0\0" + "\3\0\0\0\4\0\0\0\6\0\0\0\7\0\0\0\11\0\0\0\12\0\0\0\12\0\0\0\13\0\0\0" + "\13\0\0\0\13\0\0\0\12\0\0\0\12\0\0\0\11\0\0\0\7\0\0\0\6\0\0\0\5\0\0\0" + "\3\0\0\0\2\0\0\0\1\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" + "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0"}; + + +/* GdkPixbuf RGBA C-Source image dump */ + +#ifdef __SUNPRO_C +#pragma align 4 (small_pixbuf) +#endif +#ifdef __GNUC__ +const guint8 small_pixbuf[] __attribute__ ((__aligned__ (4))) = +#else +const guint8 small_pixbuf[] = +#endif +{ "" + /* Pixbuf magic (0x47646b50) */ + "GdkP" + /* length: header (24) + pixel_data (1024) */ + "\0\0\4\30" + /* pixdata_type (0x1010002) */ + "\1\1\0\2" + /* rowstride (64) */ + "\0\0\0@" + /* width (16) */ + "\0\0\0\20" + /* height (16) */ + "\0\0\0\20" + /* pixel_data: */ + "\0\0\0\0\201\201\204\254\200\200\203\375\200\200\203\377\200\200\203" + "\377\200\200\203\377\200\200\203\377\200\200\203\377\200\200\203\377" + "\200\200\203\377\200\200\203\377\200\200\203\377\200\200\203\377\200" + "\200\203\375\201\201\204\254\0\0\0\0\0\0\0\0\200\200\203\375\362\362" + "\362\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377" + "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377" + "\377\377\377\377\377\377\377\377\362\362\362\377\200\200\203\375\0\0" + "\0\0\0\0\0\0\200\200\203\377\377\377\377\377\40J\207\377\40J\207\377" + "\40J\207\377\40J\207\377\40J\207\377\40J\207\377\40J\207\377\40J\207" + "\377\40J\207\377\40J\207\377\377\377\377\377\200\200\203\377\0\0\0\0" + "\0\0\0\0\200\200\203\377\377\377\377\377\40J\207\377p\222\277\377q\223" + "\277\377q\223\277\377q\224\277\377q\224\300\377q\224\277\377q\223\277" + "\377q\223\277\377\40J\207\377\377\377\377\377\200\200\203\377\0\0\0\0" + "\0\0\0\0\200\200\203\377\377\377\377\377\40J\207\377j\217\275\377o\223" + "\277\377s\227\302\377w\232\304\377z\233\305\377y\233\305\377u\230\303" + "\377j\217\275\377\40J\207\377\377\377\377\377\200\200\203\377\0\0\0\0" + "\0\0\0\0\200\200\203\377\377\377\377\377\40J\207\377i\216\275\377o\224" + "\301\377t\231\305\377x\233\306\377j\221\301\377T\201\267\377Iy\263\377" + "Eu\260\377\40J\207\377\377\377\377\377\200\200\203\377\0\0\0\0\0\0\0" + "\0\200\200\203\377\377\377\377\377\40J\207\377e\215\276\377g\220\300" + "\377g\221\301\377[\211\275\377Y\207\275\377W\206\274\377T\203\272\377" + "N~\266\377\40J\207\377\377\377\377\377\200\200\203\377\0\0\0\0\0\0\0" + "\0\200\200\203\377\377\377\377\377\40J\207\377N}\266\377V\204\273\377" + "\\\213\300\377b\220\304\377d\222\305\377b\220\304\377\\\213\300\377V" + "\204\273\377\40J\207\377\377\377\377\377\200\200\203\377\0\0\0\0\0\0" + "\0\0\200\200\203\377\377\377\377\377\40J\207\377\40J\207\377\40J\207" + "\377\40J\207\377\40J\207\377\40J\207\377\40J\207\377\40J\207\377\40J" + "\207\377\40J\207\377\377\377\377\377\200\200\203\377\0\0\0\0\0\0\0\0" + "\200\200\203\375\361\361\361\377\377\377\377\377\377\377\377\377\377" + "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377" + "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\361\361\361" + "\377\200\200\203\375\0\0\0\0\0\0\0\0\201\201\204\254\200\200\203\375" + "\200\200\203\377\200\200\203\377\200\200\203\377\200\200\203\377\200" + "\200\203\377\200\200\203\377\200\200\203\377\200\200\203\377\200\200" + "\203\377\200\200\203\377\200\200\203\375\201\201\204\254\0\0\0\0\0\0" + "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\206\210\203\377\311\316\304\377" + "\245\256\235\377\245\256\235\377\311\316\304\377\206\210\203\377\0\0" + "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\210\212\205\4\210\212\205t\251\254" + "\246\377\315\320\311\377\272\275\266\377\315\320\311\377\272\275\266" + "\377\315\320\311\377\272\275\266\377\315\320\311\377\272\275\266\377" + "\315\320\311\377\272\275\266\377\233\236\230\377\210\212\205w\210\212" + "\205\11\210\212\205i\210\212\205\377\304\306\300\377\272\275\266\377" + "\314\317\310\377\272\275\266\377\300\303\275\377\272\275\266\377\276" + "\301\272\377\272\275\266\377\301\304\275\377\272\275\266\377\316\321" + "\312\377\304\306\300\377\210\212\205\377\210\212\205s\210\212\205\377" + "\325\325\323\377\377\377\377\377\377\377\377\377\377\377\377\377\377" + "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377" + "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377" + "\377\325\325\323\377\210\212\205\377\216\217\213\326\210\212\205\377" + "\210\212\205\377\210\212\205\377\210\212\205\377\210\212\205\377\210" + "\212\205\377\210\212\205\377\210\212\205\377\210\212\205\377\210\212" + "\205\377\210\212\205\377\210\212\205\377\210\212\205\377\210\212\205" + "\377\216\217\213\326"}; + + diff --git a/src/support.c b/src/support.c new file mode 100644 index 0000000..6843592 --- /dev/null +++ b/src/support.c @@ -0,0 +1,165 @@ +/* + * Copyright © 2007 Intel Corporation + * + * Permission is hereby granted, free of charge, to any person obtaining a copy + * of this software and associated documentation files (the "Software"), to deal + * in the Software without restriction, including without limitation the rights + * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell + * copies of the Software, and to permit persons to whom the Software is + * furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in + * all copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE + * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, + * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN + * THE SOFTWARE. + */ +/* + * DO NOT EDIT THIS FILE - it is generated by Glade. + */ + +#ifdef HAVE_CONFIG_H +# include <config.h> +#endif + +#include <sys/types.h> +#include <sys/stat.h> +#include <unistd.h> +#include <string.h> +#include <stdio.h> + +#include <gtk/gtk.h> + +#include "support.h" + +GtkWidget* +lookup_widget (GtkWidget *widget, + const gchar *widget_name) +{ + GtkWidget *parent, *found_widget; + + for (;;) + { + if (GTK_IS_MENU (widget)) + parent = gtk_menu_get_attach_widget (GTK_MENU (widget)); + else + parent = widget->parent; + if (!parent) + parent = (GtkWidget*) g_object_get_data (G_OBJECT (widget), "GladeParentKey"); + if (parent == NULL) + break; + widget = parent; + } + + found_widget = (GtkWidget*) g_object_get_data (G_OBJECT (widget), + widget_name); + if (!found_widget) + g_warning ("Widget not found: %s", widget_name); + return found_widget; +} + +static GList *pixmaps_directories = NULL; + +/* Use this function to set the directory containing installed pixmaps. */ +void +add_pixmap_directory (const gchar *directory) +{ + pixmaps_directories = g_list_prepend (pixmaps_directories, + g_strdup (directory)); +} + +/* This is an internally used function to find pixmap files. */ +static gchar* +find_pixmap_file (const gchar *filename) +{ + GList *elem; + + /* We step through each of the pixmaps directory to find it. */ + elem = pixmaps_directories; + while (elem) + { + gchar *pathname = g_strdup_printf ("%s%s%s", (gchar*)elem->data, + G_DIR_SEPARATOR_S, filename); + if (g_file_test (pathname, G_FILE_TEST_EXISTS)) + return pathname; + g_free (pathname); + elem = elem->next; + } + return NULL; +} + +/* This is an internally used function to create pixmaps. */ +GtkWidget* +create_pixmap (GtkWidget *widget, + const gchar *filename) +{ + gchar *pathname = NULL; + GtkWidget *pixmap; + + if (!filename || !filename[0]) + return gtk_image_new (); + + pathname = find_pixmap_file (filename); + + if (!pathname) + { + g_warning (_("Couldn't find pixmap file: %s"), filename); + return gtk_image_new (); + } + + pixmap = gtk_image_new_from_file (pathname); + g_free (pathname); + return pixmap; +} + +/* This is an internally used function to create pixmaps. */ +GdkPixbuf* +create_pixbuf (const gchar *filename) +{ + gchar *pathname = NULL; + GdkPixbuf *pixbuf; + GError *error = NULL; + + if (!filename || !filename[0]) + return NULL; + + pathname = find_pixmap_file (filename); + + if (!pathname) + { + g_warning (_("Couldn't find pixmap file: %s"), filename); + return NULL; + } + + pixbuf = gdk_pixbuf_new_from_file (pathname, &error); + if (!pixbuf) + { + fprintf (stderr, "Failed to load pixbuf file: %s: %s\n", + pathname, error->message); + g_error_free (error); + } + g_free (pathname); + return pixbuf; +} + +/* This is used to set ATK action descriptions. */ +void +glade_set_atk_action_description (AtkAction *action, + const gchar *action_name, + const gchar *description) +{ + gint n_actions, i; + + n_actions = atk_action_get_n_actions (action); + for (i = 0; i < n_actions; i++) + { + if (!strcmp (atk_action_get_name (action, i), action_name)) + atk_action_set_description (action, i, description); + } +} + diff --git a/src/support.h b/src/support.h new file mode 100644 index 0000000..2a95552 --- /dev/null +++ b/src/support.h @@ -0,0 +1,90 @@ +/* + * Copyright © 2007 Intel Corporation + * + * Permission is hereby granted, free of charge, to any person obtaining a copy + * of this software and associated documentation files (the "Software"), to deal + * in the Software without restriction, including without limitation the rights + * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell + * copies of the Software, and to permit persons to whom the Software is + * furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in + * all copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE + * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, + * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN + * THE SOFTWARE. + */ +/* + * DO NOT EDIT THIS FILE - it is generated by Glade. + */ + +#ifdef HAVE_CONFIG_H +# include <config.h> +#endif + +#include <gtk/gtk.h> + +/* + * Standard gettext macros. + */ +#ifdef ENABLE_NLS +# include <libintl.h> +# undef _ +# define _(String) dgettext (PACKAGE, String) +# define Q_(String) g_strip_context ((String), gettext (String)) +# ifdef gettext_noop +# define N_(String) gettext_noop (String) +# else +# define N_(String) (String) +# endif +#else +# define textdomain(String) (String) +# define gettext(String) (String) +# define dgettext(Domain,Message) (Message) +# define dcgettext(Domain,Message,Type) (Message) +# define bindtextdomain(Domain,Directory) (Domain) +# define _(String) (String) +# define Q_(String) g_strip_context ((String), (String)) +# define N_(String) (String) +#endif + + +/* + * Public Functions. + */ + +/* + * This function returns a widget in a component created by Glade. + * Call it with the toplevel widget in the component (i.e. a window/dialog), + * or alternatively any widget in the component, and the name of the widget + * you want returned. + */ +GtkWidget* lookup_widget (GtkWidget *widget, + const gchar *widget_name); + + +/* Use this function to set the directory containing installed pixmaps. */ +void add_pixmap_directory (const gchar *directory); + + +/* + * Private Functions. + */ + +/* This is used to create the pixmaps used in the interface. */ +GtkWidget* create_pixmap (GtkWidget *widget, + const gchar *filename); + +/* This is used to create the pixbufs used in the interface. */ +GdkPixbuf* create_pixbuf (const gchar *filename); + +/* This is used to set ATK action descriptions. */ +void glade_set_atk_action_description (AtkAction *action, + const gchar *action_name, + const gchar *description); + |