From 456b2e8625f542b61337c78a7c419d2137955b55 Mon Sep 17 00:00:00 2001 From: Luo Jinghua Date: Wed, 20 Oct 2010 05:29:42 +0800 Subject: Initial commit --- app-laptop/pommed/pommed-1.31/.gitignore | 2 + app-laptop/pommed/pommed-1.31/AUTHORS | 75 ++ app-laptop/pommed/pommed-1.31/COPYING | 339 ++++++ app-laptop/pommed/pommed-1.31/ChangeLog | 281 +++++ app-laptop/pommed/pommed-1.31/INSTALL | 80 ++ app-laptop/pommed/pommed-1.31/Makefile | 22 + app-laptop/pommed/pommed-1.31/README | 164 +++ app-laptop/pommed/pommed-1.31/TODO | 10 + .../pommed/pommed-1.31/client-common/dbus-client.c | 419 +++++++ .../pommed/pommed-1.31/client-common/dbus-client.h | 58 + .../pommed-1.31/client-common/video-client.c | 171 +++ .../pommed-1.31/client-common/video-client.h | 19 + app-laptop/pommed/pommed-1.31/dbus-policy.conf | 19 + app-laptop/pommed/pommed-1.31/gpomme/.gitignore | 3 + app-laptop/pommed/pommed-1.31/gpomme/Makefile | 59 + app-laptop/pommed/pommed-1.31/gpomme/TODO | 4 + app-laptop/pommed/pommed-1.31/gpomme/conffile.c | 373 ++++++ app-laptop/pommed/pommed-1.31/gpomme/conffile.h | 20 + .../pommed/pommed-1.31/gpomme/gpomme-c.desktop | 9 + app-laptop/pommed/pommed-1.31/gpomme/gpomme.1 | 40 + app-laptop/pommed/pommed-1.31/gpomme/gpomme.c | 651 +++++++++++ .../pommed/pommed-1.31/gpomme/gpomme.desktop | 9 + app-laptop/pommed/pommed-1.31/gpomme/gpomme.glade | 160 +++ app-laptop/pommed/pommed-1.31/gpomme/gpomme.h | 35 + .../pommed/pommed-1.31/gpomme/inotify-syscalls.h | 98 ++ app-laptop/pommed/pommed-1.31/gpomme/po/de.po | 58 + app-laptop/pommed/pommed-1.31/gpomme/po/es.po | 58 + app-laptop/pommed/pommed-1.31/gpomme/po/fr.po | 56 + app-laptop/pommed/pommed-1.31/gpomme/po/gpomme.pot | 57 + app-laptop/pommed/pommed-1.31/gpomme/po/it.po | 56 + app-laptop/pommed/pommed-1.31/gpomme/po/ja.po | 58 + app-laptop/pommed/pommed-1.31/gpomme/theme.c | 117 ++ app-laptop/pommed/pommed-1.31/gpomme/theme.h | 35 + .../gpomme/themes/CrystalLarge/background.png | Bin 0 -> 1509 bytes .../gpomme/themes/CrystalLarge/brightness.png | Bin 0 -> 19116 bytes .../gpomme/themes/CrystalLarge/cdrom.png | Bin 0 -> 18377 bytes .../gpomme/themes/CrystalLarge/kbdlight.png | Bin 0 -> 13636 bytes .../gpomme/themes/CrystalLarge/mute.png | Bin 0 -> 27733 bytes .../gpomme/themes/CrystalLarge/noaudio.png | Bin 0 -> 14316 bytes .../gpomme/themes/CrystalLarge/src/background.svg | 70 ++ .../gpomme/themes/CrystalLarge/volume.png | Bin 0 -> 32256 bytes .../gpomme/themes/KStyle/background.png | Bin 0 -> 1522 bytes .../gpomme/themes/KStyle/brightness.png | Bin 0 -> 16975 bytes .../pommed-1.31/gpomme/themes/KStyle/cdrom.png | Bin 0 -> 19572 bytes .../pommed-1.31/gpomme/themes/KStyle/kbdlight.png | Bin 0 -> 10812 bytes .../pommed-1.31/gpomme/themes/KStyle/mute.png | Bin 0 -> 14695 bytes .../pommed-1.31/gpomme/themes/KStyle/noaudio.png | Bin 0 -> 14923 bytes .../gpomme/themes/KStyle/src/background.svg | 75 ++ .../pommed-1.31/gpomme/themes/KStyle/volume.png | Bin 0 -> 15049 bytes .../pommed-1.31/gpomme/themes/Tango/background.png | Bin 0 -> 1509 bytes .../pommed-1.31/gpomme/themes/Tango/brightness.png | Bin 0 -> 84567 bytes .../pommed-1.31/gpomme/themes/Tango/cdrom.png | Bin 0 -> 127985 bytes .../pommed-1.31/gpomme/themes/Tango/kbdlight.png | Bin 0 -> 51473 bytes .../pommed-1.31/gpomme/themes/Tango/mute.png | Bin 0 -> 81086 bytes .../pommed-1.31/gpomme/themes/Tango/noaudio.png | Bin 0 -> 81086 bytes .../gpomme/themes/Tango/src/background.svg | 70 ++ .../gpomme/themes/Tango/src/brightness.svg | 487 ++++++++ .../pommed-1.31/gpomme/themes/Tango/src/cdrom.svg | 720 ++++++++++++ .../gpomme/themes/Tango/src/kbdlight.svg | 836 ++++++++++++++ .../pommed-1.31/gpomme/themes/Tango/src/mute.svg | 991 ++++++++++++++++ .../gpomme/themes/Tango/src/noaudio.svg | 991 ++++++++++++++++ .../pommed-1.31/gpomme/themes/Tango/src/volume.svg | 643 +++++++++++ .../pommed-1.31/gpomme/themes/Tango/volume.png | Bin 0 -> 98196 bytes .../gpomme/themes/elegant-bright/background.png | Bin 0 -> 1509 bytes .../gpomme/themes/elegant-bright/brightness.png | Bin 0 -> 10142 bytes .../gpomme/themes/elegant-bright/cdrom.png | Bin 0 -> 4773 bytes .../gpomme/themes/elegant-bright/kbdlight.png | Bin 0 -> 7043 bytes .../gpomme/themes/elegant-bright/mute.png | Bin 0 -> 2741 bytes .../gpomme/themes/elegant-bright/noaudio.png | Bin 0 -> 2741 bytes .../themes/elegant-bright/src/background.svg | 70 ++ .../themes/elegant-bright/src/brightness.svg | 377 ++++++ .../gpomme/themes/elegant-bright/src/cdrom.svg | 165 +++ .../gpomme/themes/elegant-bright/src/kbdlight.svg | 276 +++++ .../gpomme/themes/elegant-bright/src/mute.svg | 219 ++++ .../gpomme/themes/elegant-bright/src/volume.svg | 264 +++++ .../gpomme/themes/elegant-bright/volume.png | Bin 0 -> 8377 bytes .../gpomme/themes/elegant-dark/background.png | Bin 0 -> 1509 bytes .../gpomme/themes/elegant-dark/brightness.png | Bin 0 -> 10118 bytes .../gpomme/themes/elegant-dark/cdrom.png | Bin 0 -> 4772 bytes .../gpomme/themes/elegant-dark/kbdlight.png | Bin 0 -> 7070 bytes .../gpomme/themes/elegant-dark/mute.png | Bin 0 -> 2833 bytes .../gpomme/themes/elegant-dark/noaudio.png | Bin 0 -> 2833 bytes .../gpomme/themes/elegant-dark/src/background.svg | 70 ++ .../gpomme/themes/elegant-dark/src/brightness.svg | 377 ++++++ .../gpomme/themes/elegant-dark/src/cdrom.svg | 165 +++ .../gpomme/themes/elegant-dark/src/kbdlight.svg | 265 +++++ .../gpomme/themes/elegant-dark/src/mute.svg | 219 ++++ .../gpomme/themes/elegant-dark/src/volume.svg | 264 +++++ .../gpomme/themes/elegant-dark/volume.png | Bin 0 -> 8584 bytes app-laptop/pommed/pommed-1.31/icons/gpomme.svg | 330 ++++++ .../pommed/pommed-1.31/icons/gpomme_128x128.png | Bin 0 -> 5046 bytes .../pommed/pommed-1.31/icons/gpomme_128x128.xpm | 215 ++++ .../pommed/pommed-1.31/icons/gpomme_16x16.png | Bin 0 -> 347 bytes .../pommed/pommed-1.31/icons/gpomme_16x16.xpm | 40 + .../pommed/pommed-1.31/icons/gpomme_192x192.png | Bin 0 -> 7390 bytes .../pommed/pommed-1.31/icons/gpomme_192x192.xpm | 282 +++++ .../pommed/pommed-1.31/icons/gpomme_22x22.png | Bin 0 -> 531 bytes .../pommed/pommed-1.31/icons/gpomme_22x22.xpm | 75 ++ .../pommed/pommed-1.31/icons/gpomme_24x24.png | Bin 0 -> 531 bytes .../pommed/pommed-1.31/icons/gpomme_24x24.xpm | 77 ++ .../pommed/pommed-1.31/icons/gpomme_32x32.png | Bin 0 -> 1114 bytes .../pommed/pommed-1.31/icons/gpomme_32x32.xpm | 210 ++++ .../pommed/pommed-1.31/icons/gpomme_36x36.png | Bin 0 -> 1343 bytes .../pommed/pommed-1.31/icons/gpomme_36x36.xpm | 253 +++++ .../pommed/pommed-1.31/icons/gpomme_48x48.png | Bin 0 -> 1821 bytes .../pommed/pommed-1.31/icons/gpomme_48x48.xpm | 123 ++ .../pommed/pommed-1.31/icons/gpomme_64x64.png | Bin 0 -> 2517 bytes .../pommed/pommed-1.31/icons/gpomme_64x64.xpm | 145 +++ .../pommed/pommed-1.31/icons/gpomme_72x72.png | Bin 0 -> 2883 bytes .../pommed/pommed-1.31/icons/gpomme_72x72.xpm | 150 +++ .../pommed/pommed-1.31/icons/gpomme_96x96.png | Bin 0 -> 3680 bytes .../pommed/pommed-1.31/icons/gpomme_96x96.xpm | 181 +++ app-laptop/pommed/pommed-1.31/pommed.1 | 55 + app-laptop/pommed/pommed-1.31/pommed.conf.mactel | 119 ++ app-laptop/pommed/pommed-1.31/pommed.conf.pmac | 82 ++ app-laptop/pommed/pommed-1.31/pommed.init | 83 ++ app-laptop/pommed/pommed-1.31/pommed/.gitignore | 2 + app-laptop/pommed/pommed-1.31/pommed/Makefile | 129 +++ app-laptop/pommed/pommed-1.31/pommed/ambient.h | 46 + app-laptop/pommed/pommed-1.31/pommed/audio.c | 289 +++++ app-laptop/pommed/pommed-1.31/pommed/audio.h | 35 + app-laptop/pommed/pommed-1.31/pommed/beep.c | 601 ++++++++++ app-laptop/pommed/pommed-1.31/pommed/beep.h | 54 + app-laptop/pommed/pommed-1.31/pommed/cd_eject.c | 123 ++ app-laptop/pommed/pommed-1.31/pommed/cd_eject.h | 17 + app-laptop/pommed/pommed-1.31/pommed/conffile.c | 397 +++++++ app-laptop/pommed/pommed-1.31/pommed/conffile.h | 98 ++ .../pommed/pommed-1.31/pommed/data/click.wav | Bin 0 -> 2348 bytes .../pommed/pommed-1.31/pommed/data/goutte.wav | Bin 0 -> 12332 bytes app-laptop/pommed/pommed-1.31/pommed/dbus.c | 1197 ++++++++++++++++++++ app-laptop/pommed/pommed-1.31/pommed/dbus.h | 40 + app-laptop/pommed/pommed-1.31/pommed/evdev.c | 1000 ++++++++++++++++ app-laptop/pommed/pommed-1.31/pommed/evdev.h | 105 ++ app-laptop/pommed/pommed-1.31/pommed/evloop.c | 428 +++++++ app-laptop/pommed/pommed-1.31/pommed/evloop.h | 65 ++ .../pommed/pommed-1.31/pommed/inotify-syscalls.h | 98 ++ app-laptop/pommed/pommed-1.31/pommed/kbd_auto.c | 169 +++ .../pommed/pommed-1.31/pommed/kbd_backlight.h | 108 ++ .../pommed/pommed-1.31/pommed/lcd_backlight.h | 106 ++ app-laptop/pommed/pommed-1.31/pommed/mactel/acpi.c | 71 ++ .../pommed/pommed-1.31/pommed/mactel/ambient.c | 132 +++ .../pommed-1.31/pommed/mactel/gma950_backlight.c | 422 +++++++ .../pommed-1.31/pommed/mactel/kbd_backlight.c | 287 +++++ .../pommed/mactel/nv8600mgt_backlight.c | 294 +++++ .../pommed-1.31/pommed/mactel/x1600_backlight.c | 350 ++++++ .../pommed/pommed-1.31/pommed/pmac/ambient.c | 196 ++++ .../pommed/pommed-1.31/pommed/pmac/kbd_backlight.c | 534 +++++++++ .../pommed/pommed-1.31/pommed/pmac/ofapi/of_api.h | 46 + .../pommed-1.31/pommed/pmac/ofapi/of_externals.c | 229 ++++ .../pommed-1.31/pommed/pmac/ofapi/of_externals.h | 47 + .../pommed-1.31/pommed/pmac/ofapi/of_internals.c | 407 +++++++ .../pommed-1.31/pommed/pmac/ofapi/of_internals.h | 29 + .../pommed-1.31/pommed/pmac/ofapi/of_standard.c | 34 + .../pommed-1.31/pommed/pmac/ofapi/of_standard.h | 16 + app-laptop/pommed/pommed-1.31/pommed/pmac/pmu.c | 80 ++ app-laptop/pommed/pommed-1.31/pommed/pommed.c | 950 ++++++++++++++++ app-laptop/pommed/pommed-1.31/pommed/pommed.h | 92 ++ app-laptop/pommed/pommed-1.31/pommed/power.c | 135 +++ app-laptop/pommed/pommed-1.31/pommed/power.h | 31 + .../pommed/pommed-1.31/pommed/sysfs_backlight.c | 436 +++++++ .../pommed/pommed-1.31/pommed/timerfd-syscalls.h | 47 + app-laptop/pommed/pommed-1.31/pommed/video.c | 88 ++ app-laptop/pommed/pommed-1.31/pommed/video.h | 17 + app-laptop/pommed/pommed-1.31/wmpomme/.gitignore | 2 + app-laptop/pommed/pommed-1.31/wmpomme/Makefile | 29 + .../pommed/pommed-1.31/wmpomme/timerfd-syscalls.h | 47 + app-laptop/pommed/pommed-1.31/wmpomme/wmgeneral.c | 490 ++++++++ app-laptop/pommed/pommed-1.31/wmpomme/wmgeneral.h | 60 + .../pommed/pommed-1.31/wmpomme/wmpomme-master.xpm | 212 ++++ app-laptop/pommed/pommed-1.31/wmpomme/wmpomme.1 | 29 + app-laptop/pommed/pommed-1.31/wmpomme/wmpomme.c | 943 +++++++++++++++ 171 files changed, 25538 insertions(+) create mode 100644 app-laptop/pommed/pommed-1.31/.gitignore create mode 100644 app-laptop/pommed/pommed-1.31/AUTHORS create mode 100644 app-laptop/pommed/pommed-1.31/COPYING create mode 100644 app-laptop/pommed/pommed-1.31/ChangeLog create mode 100644 app-laptop/pommed/pommed-1.31/INSTALL create mode 100644 app-laptop/pommed/pommed-1.31/Makefile create mode 100644 app-laptop/pommed/pommed-1.31/README create mode 100644 app-laptop/pommed/pommed-1.31/TODO create mode 100644 app-laptop/pommed/pommed-1.31/client-common/dbus-client.c create mode 100644 app-laptop/pommed/pommed-1.31/client-common/dbus-client.h create mode 100644 app-laptop/pommed/pommed-1.31/client-common/video-client.c create mode 100644 app-laptop/pommed/pommed-1.31/client-common/video-client.h create mode 100644 app-laptop/pommed/pommed-1.31/dbus-policy.conf create mode 100644 app-laptop/pommed/pommed-1.31/gpomme/.gitignore create mode 100644 app-laptop/pommed/pommed-1.31/gpomme/Makefile create mode 100644 app-laptop/pommed/pommed-1.31/gpomme/TODO create mode 100644 app-laptop/pommed/pommed-1.31/gpomme/conffile.c create mode 100644 app-laptop/pommed/pommed-1.31/gpomme/conffile.h create mode 100644 app-laptop/pommed/pommed-1.31/gpomme/gpomme-c.desktop create mode 100644 app-laptop/pommed/pommed-1.31/gpomme/gpomme.1 create mode 100644 app-laptop/pommed/pommed-1.31/gpomme/gpomme.c create mode 100644 app-laptop/pommed/pommed-1.31/gpomme/gpomme.desktop create mode 100644 app-laptop/pommed/pommed-1.31/gpomme/gpomme.glade create mode 100644 app-laptop/pommed/pommed-1.31/gpomme/gpomme.h create mode 100644 app-laptop/pommed/pommed-1.31/gpomme/inotify-syscalls.h create mode 100644 app-laptop/pommed/pommed-1.31/gpomme/po/de.po create mode 100644 app-laptop/pommed/pommed-1.31/gpomme/po/es.po create mode 100644 app-laptop/pommed/pommed-1.31/gpomme/po/fr.po create mode 100644 app-laptop/pommed/pommed-1.31/gpomme/po/gpomme.pot create mode 100644 app-laptop/pommed/pommed-1.31/gpomme/po/it.po create mode 100644 app-laptop/pommed/pommed-1.31/gpomme/po/ja.po create mode 100644 app-laptop/pommed/pommed-1.31/gpomme/theme.c create mode 100644 app-laptop/pommed/pommed-1.31/gpomme/theme.h create mode 100644 app-laptop/pommed/pommed-1.31/gpomme/themes/CrystalLarge/background.png create mode 100644 app-laptop/pommed/pommed-1.31/gpomme/themes/CrystalLarge/brightness.png create mode 100644 app-laptop/pommed/pommed-1.31/gpomme/themes/CrystalLarge/cdrom.png create mode 100644 app-laptop/pommed/pommed-1.31/gpomme/themes/CrystalLarge/kbdlight.png create mode 100644 app-laptop/pommed/pommed-1.31/gpomme/themes/CrystalLarge/mute.png create mode 100644 app-laptop/pommed/pommed-1.31/gpomme/themes/CrystalLarge/noaudio.png create mode 100644 app-laptop/pommed/pommed-1.31/gpomme/themes/CrystalLarge/src/background.svg create mode 100644 app-laptop/pommed/pommed-1.31/gpomme/themes/CrystalLarge/volume.png create mode 100644 app-laptop/pommed/pommed-1.31/gpomme/themes/KStyle/background.png create mode 100644 app-laptop/pommed/pommed-1.31/gpomme/themes/KStyle/brightness.png create mode 100644 app-laptop/pommed/pommed-1.31/gpomme/themes/KStyle/cdrom.png create mode 100644 app-laptop/pommed/pommed-1.31/gpomme/themes/KStyle/kbdlight.png create mode 100644 app-laptop/pommed/pommed-1.31/gpomme/themes/KStyle/mute.png create mode 100644 app-laptop/pommed/pommed-1.31/gpomme/themes/KStyle/noaudio.png create mode 100644 app-laptop/pommed/pommed-1.31/gpomme/themes/KStyle/src/background.svg create mode 100644 app-laptop/pommed/pommed-1.31/gpomme/themes/KStyle/volume.png create mode 100644 app-laptop/pommed/pommed-1.31/gpomme/themes/Tango/background.png create mode 100644 app-laptop/pommed/pommed-1.31/gpomme/themes/Tango/brightness.png create mode 100644 app-laptop/pommed/pommed-1.31/gpomme/themes/Tango/cdrom.png create mode 100644 app-laptop/pommed/pommed-1.31/gpomme/themes/Tango/kbdlight.png create mode 100644 app-laptop/pommed/pommed-1.31/gpomme/themes/Tango/mute.png create mode 100644 app-laptop/pommed/pommed-1.31/gpomme/themes/Tango/noaudio.png create mode 100644 app-laptop/pommed/pommed-1.31/gpomme/themes/Tango/src/background.svg create mode 100644 app-laptop/pommed/pommed-1.31/gpomme/themes/Tango/src/brightness.svg create mode 100644 app-laptop/pommed/pommed-1.31/gpomme/themes/Tango/src/cdrom.svg create mode 100644 app-laptop/pommed/pommed-1.31/gpomme/themes/Tango/src/kbdlight.svg create mode 100644 app-laptop/pommed/pommed-1.31/gpomme/themes/Tango/src/mute.svg create mode 100644 app-laptop/pommed/pommed-1.31/gpomme/themes/Tango/src/noaudio.svg create mode 100644 app-laptop/pommed/pommed-1.31/gpomme/themes/Tango/src/volume.svg create mode 100644 app-laptop/pommed/pommed-1.31/gpomme/themes/Tango/volume.png create mode 100644 app-laptop/pommed/pommed-1.31/gpomme/themes/elegant-bright/background.png create mode 100644 app-laptop/pommed/pommed-1.31/gpomme/themes/elegant-bright/brightness.png create mode 100644 app-laptop/pommed/pommed-1.31/gpomme/themes/elegant-bright/cdrom.png create mode 100644 app-laptop/pommed/pommed-1.31/gpomme/themes/elegant-bright/kbdlight.png create mode 100644 app-laptop/pommed/pommed-1.31/gpomme/themes/elegant-bright/mute.png create mode 100644 app-laptop/pommed/pommed-1.31/gpomme/themes/elegant-bright/noaudio.png create mode 100644 app-laptop/pommed/pommed-1.31/gpomme/themes/elegant-bright/src/background.svg create mode 100644 app-laptop/pommed/pommed-1.31/gpomme/themes/elegant-bright/src/brightness.svg create mode 100644 app-laptop/pommed/pommed-1.31/gpomme/themes/elegant-bright/src/cdrom.svg create mode 100644 app-laptop/pommed/pommed-1.31/gpomme/themes/elegant-bright/src/kbdlight.svg create mode 100644 app-laptop/pommed/pommed-1.31/gpomme/themes/elegant-bright/src/mute.svg create mode 100644 app-laptop/pommed/pommed-1.31/gpomme/themes/elegant-bright/src/volume.svg create mode 100644 app-laptop/pommed/pommed-1.31/gpomme/themes/elegant-bright/volume.png create mode 100644 app-laptop/pommed/pommed-1.31/gpomme/themes/elegant-dark/background.png create mode 100644 app-laptop/pommed/pommed-1.31/gpomme/themes/elegant-dark/brightness.png create mode 100644 app-laptop/pommed/pommed-1.31/gpomme/themes/elegant-dark/cdrom.png create mode 100644 app-laptop/pommed/pommed-1.31/gpomme/themes/elegant-dark/kbdlight.png create mode 100644 app-laptop/pommed/pommed-1.31/gpomme/themes/elegant-dark/mute.png create mode 100644 app-laptop/pommed/pommed-1.31/gpomme/themes/elegant-dark/noaudio.png create mode 100644 app-laptop/pommed/pommed-1.31/gpomme/themes/elegant-dark/src/background.svg create mode 100644 app-laptop/pommed/pommed-1.31/gpomme/themes/elegant-dark/src/brightness.svg create mode 100644 app-laptop/pommed/pommed-1.31/gpomme/themes/elegant-dark/src/cdrom.svg create mode 100644 app-laptop/pommed/pommed-1.31/gpomme/themes/elegant-dark/src/kbdlight.svg create mode 100644 app-laptop/pommed/pommed-1.31/gpomme/themes/elegant-dark/src/mute.svg create mode 100644 app-laptop/pommed/pommed-1.31/gpomme/themes/elegant-dark/src/volume.svg create mode 100644 app-laptop/pommed/pommed-1.31/gpomme/themes/elegant-dark/volume.png create mode 100644 app-laptop/pommed/pommed-1.31/icons/gpomme.svg create mode 100644 app-laptop/pommed/pommed-1.31/icons/gpomme_128x128.png create mode 100644 app-laptop/pommed/pommed-1.31/icons/gpomme_128x128.xpm create mode 100644 app-laptop/pommed/pommed-1.31/icons/gpomme_16x16.png create mode 100644 app-laptop/pommed/pommed-1.31/icons/gpomme_16x16.xpm create mode 100644 app-laptop/pommed/pommed-1.31/icons/gpomme_192x192.png create mode 100644 app-laptop/pommed/pommed-1.31/icons/gpomme_192x192.xpm create mode 100644 app-laptop/pommed/pommed-1.31/icons/gpomme_22x22.png create mode 100644 app-laptop/pommed/pommed-1.31/icons/gpomme_22x22.xpm create mode 100644 app-laptop/pommed/pommed-1.31/icons/gpomme_24x24.png create mode 100644 app-laptop/pommed/pommed-1.31/icons/gpomme_24x24.xpm create mode 100644 app-laptop/pommed/pommed-1.31/icons/gpomme_32x32.png create mode 100644 app-laptop/pommed/pommed-1.31/icons/gpomme_32x32.xpm create mode 100644 app-laptop/pommed/pommed-1.31/icons/gpomme_36x36.png create mode 100644 app-laptop/pommed/pommed-1.31/icons/gpomme_36x36.xpm create mode 100644 app-laptop/pommed/pommed-1.31/icons/gpomme_48x48.png create mode 100644 app-laptop/pommed/pommed-1.31/icons/gpomme_48x48.xpm create mode 100644 app-laptop/pommed/pommed-1.31/icons/gpomme_64x64.png create mode 100644 app-laptop/pommed/pommed-1.31/icons/gpomme_64x64.xpm create mode 100644 app-laptop/pommed/pommed-1.31/icons/gpomme_72x72.png create mode 100644 app-laptop/pommed/pommed-1.31/icons/gpomme_72x72.xpm create mode 100644 app-laptop/pommed/pommed-1.31/icons/gpomme_96x96.png create mode 100644 app-laptop/pommed/pommed-1.31/icons/gpomme_96x96.xpm create mode 100644 app-laptop/pommed/pommed-1.31/pommed.1 create mode 100644 app-laptop/pommed/pommed-1.31/pommed.conf.mactel create mode 100644 app-laptop/pommed/pommed-1.31/pommed.conf.pmac create mode 100755 app-laptop/pommed/pommed-1.31/pommed.init create mode 100644 app-laptop/pommed/pommed-1.31/pommed/.gitignore create mode 100644 app-laptop/pommed/pommed-1.31/pommed/Makefile create mode 100644 app-laptop/pommed/pommed-1.31/pommed/ambient.h create mode 100644 app-laptop/pommed/pommed-1.31/pommed/audio.c create mode 100644 app-laptop/pommed/pommed-1.31/pommed/audio.h create mode 100644 app-laptop/pommed/pommed-1.31/pommed/beep.c create mode 100644 app-laptop/pommed/pommed-1.31/pommed/beep.h create mode 100644 app-laptop/pommed/pommed-1.31/pommed/cd_eject.c create mode 100644 app-laptop/pommed/pommed-1.31/pommed/cd_eject.h create mode 100644 app-laptop/pommed/pommed-1.31/pommed/conffile.c create mode 100644 app-laptop/pommed/pommed-1.31/pommed/conffile.h create mode 100644 app-laptop/pommed/pommed-1.31/pommed/data/click.wav create mode 100644 app-laptop/pommed/pommed-1.31/pommed/data/goutte.wav create mode 100644 app-laptop/pommed/pommed-1.31/pommed/dbus.c create mode 100644 app-laptop/pommed/pommed-1.31/pommed/dbus.h create mode 100644 app-laptop/pommed/pommed-1.31/pommed/evdev.c create mode 100644 app-laptop/pommed/pommed-1.31/pommed/evdev.h create mode 100644 app-laptop/pommed/pommed-1.31/pommed/evloop.c create mode 100644 app-laptop/pommed/pommed-1.31/pommed/evloop.h create mode 100644 app-laptop/pommed/pommed-1.31/pommed/inotify-syscalls.h create mode 100644 app-laptop/pommed/pommed-1.31/pommed/kbd_auto.c create mode 100644 app-laptop/pommed/pommed-1.31/pommed/kbd_backlight.h create mode 100644 app-laptop/pommed/pommed-1.31/pommed/lcd_backlight.h create mode 100644 app-laptop/pommed/pommed-1.31/pommed/mactel/acpi.c create mode 100644 app-laptop/pommed/pommed-1.31/pommed/mactel/ambient.c create mode 100644 app-laptop/pommed/pommed-1.31/pommed/mactel/gma950_backlight.c create mode 100644 app-laptop/pommed/pommed-1.31/pommed/mactel/kbd_backlight.c create mode 100644 app-laptop/pommed/pommed-1.31/pommed/mactel/nv8600mgt_backlight.c create mode 100644 app-laptop/pommed/pommed-1.31/pommed/mactel/x1600_backlight.c create mode 100644 app-laptop/pommed/pommed-1.31/pommed/pmac/ambient.c create mode 100644 app-laptop/pommed/pommed-1.31/pommed/pmac/kbd_backlight.c create mode 100644 app-laptop/pommed/pommed-1.31/pommed/pmac/ofapi/of_api.h create mode 100644 app-laptop/pommed/pommed-1.31/pommed/pmac/ofapi/of_externals.c create mode 100644 app-laptop/pommed/pommed-1.31/pommed/pmac/ofapi/of_externals.h create mode 100644 app-laptop/pommed/pommed-1.31/pommed/pmac/ofapi/of_internals.c create mode 100644 app-laptop/pommed/pommed-1.31/pommed/pmac/ofapi/of_internals.h create mode 100644 app-laptop/pommed/pommed-1.31/pommed/pmac/ofapi/of_standard.c create mode 100644 app-laptop/pommed/pommed-1.31/pommed/pmac/ofapi/of_standard.h create mode 100644 app-laptop/pommed/pommed-1.31/pommed/pmac/pmu.c create mode 100644 app-laptop/pommed/pommed-1.31/pommed/pommed.c create mode 100644 app-laptop/pommed/pommed-1.31/pommed/pommed.h create mode 100644 app-laptop/pommed/pommed-1.31/pommed/power.c create mode 100644 app-laptop/pommed/pommed-1.31/pommed/power.h create mode 100644 app-laptop/pommed/pommed-1.31/pommed/sysfs_backlight.c create mode 100644 app-laptop/pommed/pommed-1.31/pommed/timerfd-syscalls.h create mode 100644 app-laptop/pommed/pommed-1.31/pommed/video.c create mode 100644 app-laptop/pommed/pommed-1.31/pommed/video.h create mode 100644 app-laptop/pommed/pommed-1.31/wmpomme/.gitignore create mode 100644 app-laptop/pommed/pommed-1.31/wmpomme/Makefile create mode 100644 app-laptop/pommed/pommed-1.31/wmpomme/timerfd-syscalls.h create mode 100644 app-laptop/pommed/pommed-1.31/wmpomme/wmgeneral.c create mode 100644 app-laptop/pommed/pommed-1.31/wmpomme/wmgeneral.h create mode 100644 app-laptop/pommed/pommed-1.31/wmpomme/wmpomme-master.xpm create mode 100644 app-laptop/pommed/pommed-1.31/wmpomme/wmpomme.1 create mode 100644 app-laptop/pommed/pommed-1.31/wmpomme/wmpomme.c (limited to 'app-laptop/pommed/pommed-1.31') diff --git a/app-laptop/pommed/pommed-1.31/.gitignore b/app-laptop/pommed/pommed-1.31/.gitignore new file mode 100644 index 0000000..d6ff91a --- /dev/null +++ b/app-laptop/pommed/pommed-1.31/.gitignore @@ -0,0 +1,2 @@ +*~ +*.o diff --git a/app-laptop/pommed/pommed-1.31/AUTHORS b/app-laptop/pommed/pommed-1.31/AUTHORS new file mode 100644 index 0000000..3570875 --- /dev/null +++ b/app-laptop/pommed/pommed-1.31/AUTHORS @@ -0,0 +1,75 @@ + +pommed +------ + +Written by Julien BLACHE , with code taken from + - Nicolas BOICHAT + for the Radeon X1600 backlight support + - Ryan LORTIE + for the Intel GMA950 backlight support + - pbbuttonsd + for the audio thread code in pommed/beep.c + +The following people contributed to pommed: + - Romain BEAUXIS + base of the ALSA code + - Yves-Alexis PEREZ + pommed PowerBook support + +On PowerBook machines, pommed uses the OFlib written by +Alastair Poole + +The water drop sound goutte.wav included with pommed was contributed by +Romain BEAUXIS under the WTFPL, +Copyright (C) 2007 Yann Beauxis. + +The click.wav sound file shipped with pommed comes from the Classic theme +from PBButtons and is released under the GPLv2+. + + +gpomme +------ + +Soeren SONNENBURG provided the base for gpomme, based +on code taken from gtkpbbuttons. Daniel G. SIEGEL wrote the configuration +GUI. + +Glue added by Julien BLACHE . + + + Themes: + - CrystalLarge: made by Soeren SONNENBURG , based on the + Crystal theme for pbbuttonsd using icons from the Crystal themes by + Everaldo (icons licensed under the LGPL). + + - Tango: made by Daniel G. SIEGEL , based on the Tango + icons available at + + (icons licensed under the Creative Commons Attribution Share-Alike license). + + - KStyle: made by Natanael ARNDT , based on the Crystal SVG + icon theme by Everaldo (LGPL), see + + + - Elegant Bright & Elegant Dark: made by Natanael ARNDT , + icons released under the GPL. + + + i18n: + - french translation by Julien BLACHE + - german translation by Soeren SONNENBURG and Daniel G. SIEGEL + - spanish translation by Eduardo BELLIDO BELLIDO + - italian translation by Daniel G. SIEGEL + - japanese translation by Nobuhiro Iwamatsu + +wmpomme +------- + +Written by Julien BLACHE , based on wmwave. + +Icons +----- + +The icon found in the icons/ directory was contributed under GPLv2 by +Jan Larres . + diff --git a/app-laptop/pommed/pommed-1.31/COPYING b/app-laptop/pommed/pommed-1.31/COPYING new file mode 100644 index 0000000..d511905 --- /dev/null +++ b/app-laptop/pommed/pommed-1.31/COPYING @@ -0,0 +1,339 @@ + GNU GENERAL PUBLIC LICENSE + Version 2, June 1991 + + Copyright (C) 1989, 1991 Free Software Foundation, Inc., + 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA + Everyone is permitted to copy and distribute verbatim copies + of this license document, but changing it is not allowed. + + Preamble + + The licenses for most software are designed to take away your +freedom to share and change it. By contrast, the GNU General Public +License is intended to guarantee your freedom to share and change free +software--to make sure the software is free for all its users. This +General Public License applies to most of the Free Software +Foundation's software and to any other program whose authors commit to +using it. (Some other Free Software Foundation software is covered by +the GNU Lesser General Public License instead.) You can apply it to +your programs, too. + + When we speak of free software, we are referring to freedom, not +price. Our General Public Licenses are designed to make sure that you +have the freedom to distribute copies of free software (and charge for +this service if you wish), that you receive source code or can get it +if you want it, that you can change the software or use pieces of it +in new free programs; and that you know you can do these things. + + To protect your rights, we need to make restrictions that forbid +anyone to deny you these rights or to ask you to surrender the rights. +These restrictions translate to certain responsibilities for you if you +distribute copies of the software, or if you modify it. + + For example, if you distribute copies of such a program, whether +gratis or for a fee, you must give the recipients all the rights that +you have. You must make sure that they, too, receive or can get the +source code. And you must show them these terms so they know their +rights. + + We protect your rights with two steps: (1) copyright the software, and +(2) offer you this license which gives you legal permission to copy, +distribute and/or modify the software. + + Also, for each author's protection and ours, we want to make certain +that everyone understands that there is no warranty for this free +software. If the software is modified by someone else and passed on, we +want its recipients to know that what they have is not the original, so +that any problems introduced by others will not reflect on the original +authors' reputations. + + Finally, any free program is threatened constantly by software +patents. We wish to avoid the danger that redistributors of a free +program will individually obtain patent licenses, in effect making the +program proprietary. To prevent this, we have made it clear that any +patent must be licensed for everyone's free use or not licensed at all. + + The precise terms and conditions for copying, distribution and +modification follow. + + GNU GENERAL PUBLIC LICENSE + TERMS AND CONDITIONS FOR COPYING, DISTRIBUTION AND MODIFICATION + + 0. This License applies to any program or other work which contains +a notice placed by the copyright holder saying it may be distributed +under the terms of this General Public License. The "Program", below, +refers to any such program or work, and a "work based on the Program" +means either the Program or any derivative work under copyright law: +that is to say, a work containing the Program or a portion of it, +either verbatim or with modifications and/or translated into another +language. (Hereinafter, translation is included without limitation in +the term "modification".) Each licensee is addressed as "you". + +Activities other than copying, distribution and modification are not +covered by this License; they are outside its scope. The act of +running the Program is not restricted, and the output from the Program +is covered only if its contents constitute a work based on the +Program (independent of having been made by running the Program). +Whether that is true depends on what the Program does. + + 1. You may copy and distribute verbatim copies of the Program's +source code as you receive it, in any medium, provided that you +conspicuously and appropriately publish on each copy an appropriate +copyright notice and disclaimer of warranty; keep intact all the +notices that refer to this License and to the absence of any warranty; +and give any other recipients of the Program a copy of this License +along with the Program. + +You may charge a fee for the physical act of transferring a copy, and +you may at your option offer warranty protection in exchange for a fee. + + 2. You may modify your copy or copies of the Program or any portion +of it, thus forming a work based on the Program, and copy and +distribute such modifications or work under the terms of Section 1 +above, provided that you also meet all of these conditions: + + a) You must cause the modified files to carry prominent notices + stating that you changed the files and the date of any change. + + b) You must cause any work that you distribute or publish, that in + whole or in part contains or is derived from the Program or any + part thereof, to be licensed as a whole at no charge to all third + parties under the terms of this License. + + c) If the modified program normally reads commands interactively + when run, you must cause it, when started running for such + interactive use in the most ordinary way, to print or display an + announcement including an appropriate copyright notice and a + notice that there is no warranty (or else, saying that you provide + a warranty) and that users may redistribute the program under + these conditions, and telling the user how to view a copy of this + License. (Exception: if the Program itself is interactive but + does not normally print such an announcement, your work based on + the Program is not required to print an announcement.) + +These requirements apply to the modified work as a whole. If +identifiable sections of that work are not derived from the Program, +and can be reasonably considered independent and separate works in +themselves, then this License, and its terms, do not apply to those +sections when you distribute them as separate works. But when you +distribute the same sections as part of a whole which is a work based +on the Program, the distribution of the whole must be on the terms of +this License, whose permissions for other licensees extend to the +entire whole, and thus to each and every part regardless of who wrote it. + +Thus, it is not the intent of this section to claim rights or contest +your rights to work written entirely by you; rather, the intent is to +exercise the right to control the distribution of derivative or +collective works based on the Program. + +In addition, mere aggregation of another work not based on the Program +with the Program (or with a work based on the Program) on a volume of +a storage or distribution medium does not bring the other work under +the scope of this License. + + 3. You may copy and distribute the Program (or a work based on it, +under Section 2) in object code or executable form under the terms of +Sections 1 and 2 above provided that you also do one of the following: + + a) Accompany it with the complete corresponding machine-readable + source code, which must be distributed under the terms of Sections + 1 and 2 above on a medium customarily used for software interchange; or, + + b) Accompany it with a written offer, valid for at least three + years, to give any third party, for a charge no more than your + cost of physically performing source distribution, a complete + machine-readable copy of the corresponding source code, to be + distributed under the terms of Sections 1 and 2 above on a medium + customarily used for software interchange; or, + + c) Accompany it with the information you received as to the offer + to distribute corresponding source code. (This alternative is + allowed only for noncommercial distribution and only if you + received the program in object code or executable form with such + an offer, in accord with Subsection b above.) + +The source code for a work means the preferred form of the work for +making modifications to it. For an executable work, complete source +code means all the source code for all modules it contains, plus any +associated interface definition files, plus the scripts used to +control compilation and installation of the executable. However, as a +special exception, the source code distributed need not include +anything that is normally distributed (in either source or binary +form) with the major components (compiler, kernel, and so on) of the +operating system on which the executable runs, unless that component +itself accompanies the executable. + +If distribution of executable or object code is made by offering +access to copy from a designated place, then offering equivalent +access to copy the source code from the same place counts as +distribution of the source code, even though third parties are not +compelled to copy the source along with the object code. + + 4. You may not copy, modify, sublicense, or distribute the Program +except as expressly provided under this License. Any attempt +otherwise to copy, modify, sublicense or distribute the Program is +void, and will automatically terminate your rights under this License. +However, parties who have received copies, or rights, from you under +this License will not have their licenses terminated so long as such +parties remain in full compliance. + + 5. You are not required to accept this License, since you have not +signed it. However, nothing else grants you permission to modify or +distribute the Program or its derivative works. These actions are +prohibited by law if you do not accept this License. Therefore, by +modifying or distributing the Program (or any work based on the +Program), you indicate your acceptance of this License to do so, and +all its terms and conditions for copying, distributing or modifying +the Program or works based on it. + + 6. Each time you redistribute the Program (or any work based on the +Program), the recipient automatically receives a license from the +original licensor to copy, distribute or modify the Program subject to +these terms and conditions. You may not impose any further +restrictions on the recipients' exercise of the rights granted herein. +You are not responsible for enforcing compliance by third parties to +this License. + + 7. If, as a consequence of a court judgment or allegation of patent +infringement or for any other reason (not limited to patent issues), +conditions are imposed on you (whether by court order, agreement or +otherwise) that contradict the conditions of this License, they do not +excuse you from the conditions of this License. If you cannot +distribute so as to satisfy simultaneously your obligations under this +License and any other pertinent obligations, then as a consequence you +may not distribute the Program at all. For example, if a patent +license would not permit royalty-free redistribution of the Program by +all those who receive copies directly or indirectly through you, then +the only way you could satisfy both it and this License would be to +refrain entirely from distribution of the Program. + +If any portion of this section is held invalid or unenforceable under +any particular circumstance, the balance of the section is intended to +apply and the section as a whole is intended to apply in other +circumstances. + +It is not the purpose of this section to induce you to infringe any +patents or other property right claims or to contest validity of any +such claims; this section has the sole purpose of protecting the +integrity of the free software distribution system, which is +implemented by public license practices. Many people have made +generous contributions to the wide range of software distributed +through that system in reliance on consistent application of that +system; it is up to the author/donor to decide if he or she is willing +to distribute software through any other system and a licensee cannot +impose that choice. + +This section is intended to make thoroughly clear what is believed to +be a consequence of the rest of this License. + + 8. If the distribution and/or use of the Program is restricted in +certain countries either by patents or by copyrighted interfaces, the +original copyright holder who places the Program under this License +may add an explicit geographical distribution limitation excluding +those countries, so that distribution is permitted only in or among +countries not thus excluded. In such case, this License incorporates +the limitation as if written in the body of this License. + + 9. The Free Software Foundation may publish revised and/or new versions +of the General Public License from time to time. Such new versions will +be similar in spirit to the present version, but may differ in detail to +address new problems or concerns. + +Each version is given a distinguishing version number. If the Program +specifies a version number of this License which applies to it and "any +later version", you have the option of following the terms and conditions +either of that version or of any later version published by the Free +Software Foundation. If the Program does not specify a version number of +this License, you may choose any version ever published by the Free Software +Foundation. + + 10. If you wish to incorporate parts of the Program into other free +programs whose distribution conditions are different, write to the author +to ask for permission. For software which is copyrighted by the Free +Software Foundation, write to the Free Software Foundation; we sometimes +make exceptions for this. Our decision will be guided by the two goals +of preserving the free status of all derivatives of our free software and +of promoting the sharing and reuse of software generally. + + NO WARRANTY + + 11. BECAUSE THE PROGRAM IS LICENSED FREE OF CHARGE, THERE IS NO WARRANTY +FOR THE PROGRAM, TO THE EXTENT PERMITTED BY APPLICABLE LAW. EXCEPT WHEN +OTHERWISE STATED IN WRITING THE COPYRIGHT HOLDERS AND/OR OTHER PARTIES +PROVIDE THE PROGRAM "AS IS" WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED +OR IMPLIED, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF +MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. THE ENTIRE RISK AS +TO THE QUALITY AND PERFORMANCE OF THE PROGRAM IS WITH YOU. SHOULD THE +PROGRAM PROVE DEFECTIVE, YOU ASSUME THE COST OF ALL NECESSARY SERVICING, +REPAIR OR CORRECTION. + + 12. IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN WRITING +WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MAY MODIFY AND/OR +REDISTRIBUTE THE PROGRAM AS PERMITTED ABOVE, BE LIABLE TO YOU FOR DAMAGES, +INCLUDING ANY GENERAL, SPECIAL, INCIDENTAL OR CONSEQUENTIAL DAMAGES ARISING +OUT OF THE USE OR INABILITY TO USE THE PROGRAM (INCLUDING BUT NOT LIMITED +TO LOSS OF DATA OR DATA BEING RENDERED INACCURATE OR LOSSES SUSTAINED BY +YOU OR THIRD PARTIES OR A FAILURE OF THE PROGRAM TO OPERATE WITH ANY OTHER +PROGRAMS), EVEN IF SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE +POSSIBILITY OF SUCH DAMAGES. + + END OF TERMS AND CONDITIONS + + How to Apply These Terms to Your New Programs + + If you develop a new program, and you want it to be of the greatest +possible use to the public, the best way to achieve this is to make it +free software which everyone can redistribute and change under these terms. + + To do so, attach the following notices to the program. It is safest +to attach them to the start of each source file to most effectively +convey the exclusion of warranty; and each file should have at least +the "copyright" line and a pointer to where the full notice is found. + + + Copyright (C) + + This program is free software; you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation; either version 2 of the License, or + (at your option) any later version. + + This program is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. + + You should have received a copy of the GNU General Public License along + with this program; if not, write to the Free Software Foundation, Inc., + 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. + +Also add information on how to contact you by electronic and paper mail. + +If the program is interactive, make it output a short notice like this +when it starts in an interactive mode: + + Gnomovision version 69, Copyright (C) year name of author + Gnomovision comes with ABSOLUTELY NO WARRANTY; for details type `show w'. + This is free software, and you are welcome to redistribute it + under certain conditions; type `show c' for details. + +The hypothetical commands `show w' and `show c' should show the appropriate +parts of the General Public License. Of course, the commands you use may +be called something other than `show w' and `show c'; they could even be +mouse-clicks or menu items--whatever suits your program. + +You should also get your employer (if you work as a programmer) or your +school, if any, to sign a "copyright disclaimer" for the program, if +necessary. Here is a sample; alter the names: + + Yoyodyne, Inc., hereby disclaims all copyright interest in the program + `Gnomovision' (which makes passes at compilers) written by James Hacker. + + , 1 April 1989 + Ty Coon, President of Vice + +This General Public License does not permit incorporating your program into +proprietary programs. If your program is a subroutine library, you may +consider it more useful to permit linking proprietary applications with the +library. If this is what you want to do, use the GNU Lesser General +Public License instead of this License. diff --git a/app-laptop/pommed/pommed-1.31/ChangeLog b/app-laptop/pommed/pommed-1.31/ChangeLog new file mode 100644 index 0000000..4b7e275 --- /dev/null +++ b/app-laptop/pommed/pommed-1.31/ChangeLog @@ -0,0 +1,281 @@ +ChangeLog for pommed +-------------------- + +version 1.31: + - pommed: add IDs for newer wireless keyboard. + - pommed: add the MacBookPro5,4 (15" June 2009). + +version 1.30: + - pommed: fix a crasher in the i2c probe routine on pmac. + - pommed: fix sysfs backlight driver to handle > 3-digit values. + +version 1.29: + - pommed: add support for newer nvidia backlight driver which + changed the sysfs layout. + - pommed: move VT state checking to pommed, exposed over DBus. + - gpomme: switch to asking pommed for the state of the VT. + - wmpomme: switch to asking pommed for the state of the VT. + +version 1.28: + - pommed: added support for the MacBookPro5,3 (15" MacBookPro + June 2009) + +version 1.27: + - pommed: added support for the MacBook5,2 (white MacBook). + - pommed: added support for the MacBookPro5,5 (13" MacBookPro June + 2009), MacBookPro5,2 (17" MacBookPro June 2009). + +version 1.26: + - pommed: only keystrokes on the built-in keyboard should reset + the keyboard idle timer. + - pommed: add USB IDs for the Apple external aluminium mini + keyboard. + - pommed: switch to sysfs resource files for PCI memory access + instead of mmaping /dev/mem. + +version 1.25: + - pommed: check current hardware backlight level before setting AC + or battery level. Do not act if the backlight is off. + - pommed: do not reject the Apple Bluetooth keyboard because of + advertised EV_ABS events. + - pommed: fix DBus configuration snippet for newer, stricter + version of DBus (allow clients to send messages). + +version 1.24: + - pommed: add new path for fnmode setting for 2.6.28. + +version 1.23: + - pommed: add backlight support for late 2008 laptops. + - pommed: default to sysfs backlight driver for nVidia machines, + with the mbp_nvidia_bl kernel driver; fall back to native + nv8600mgt if not supported. + - pommed: try to reconnect to DBus if DBus is not available at + startup. Previously we would just drop it and live without DBus. + +version 1.22: + - pommed: do not probe for LMU controller on pmac machines that do + not have a backlit keyboard. Avoids a spurious error message. + - pommed: factor out ADB & LMU write routines, avoids duplicated + code in the kbd_{lmu,pmu}_backlight_set() routines. + - gpomme: add japanese translation for gpomme, courtesy of + Nobuhiro Iwamatsu . + - pommed: use a common sysfs power class routine in power.c, add + sysfs power class support for pmac machines. + - pommed: added partial support for the October 2008 laptops + (MacBook5,1, MacBookPro5,1, MacBookAir2,1), LCD backlight missing. + - wmpomme: turn wmpomme into an event-driven dockapp, eliminating + the fixed update rate (and, thus, wakeups). Thanks to Kalle + A. Sandström for the prodding. + +version 1.21: + - gpomme: use compositing if available, patch by Soeren Sonnenburg. + +version 1.20: + - pommed: fix array boundary check in check_machine_dmi(). + - pommed: use BUS_BLUETOOTH for the Apple wireless keyboard. + +version 1.19: + - pommed: get rid of the libsmbios dependency on Intel machines. + - gpomme: integrate config file monitoring and DBus messaging into + the main loop. Get rid of the 10 times per second polling. + - pommed: new event loop. + - pommed: convert power and kbd to timers integrated into the + event loop. + - pommed: integrate DBus into the event loop. + +version 1.18: + - pommed: add more IDs for Apple external keyboards + - pommed: relax event devices identification for internal keyboard. + +version 1.17: + - pommed: handle path change for the applesmc led interface + starting with kernel 2.6.25. + +version 1.16: + - pommed: add support for the MacBookPro4,1. + - pommed: add support for the MacBook4,1. + - pommed: add support for the WellSpring keyboard+trackpad + assembly ("MultiTouch"), found in the MacBookAir1,1. + - pommed: add support for the WellSpring II keyboard+trackpad + assembly ("MultiTouch"), most likely found in the MacBookPro4,1. + - pommed: fix MacBook Air machine identification string, the real + string is MacBookAir1,1 and not MacBook Air1,1 as the Apple + technote puts it. + +version 1.15: + - pommed: add preliminary support for the MacBook Air1,1; USB IDs + missing. + - pommed: add support for power_supply class to the ACPI code. + +version 1.14: + - pommed: fix error handling in the audio sample loading code to + properly report failure, preventing nasty segfaults later on in + case the sound file is not available. + - pommed: make goutte.wav the default beep sound, add click.wav + and remove the KDE beep sound. + +version 1.13: + - pommed: add an option to disable the beep on volume change. + - pommed: add the videoSwitch DBus notification. + - wmpomme: add video switch support. + - gpomme: add video switch support. + - pommed: add support for LCD backlight control on the Intel 965GM + found in the MacBook3,1. + - pommed: rework the inotify code to handle several events at once + and to handle events with long filenames (longer than + sizeof(struct inotify_event)); pommed could enter a busy-loop when + receiving an inotify event with ie->len > sizeof(struct inotify_event). + +version 1.12: + - pommed: do not expect at least 3 evdevs at startup; there are + only 2 on the MacBook, and possibly only 1 on the pmac machines. + +version 1.11: + - pommed: beep on volume change, now that we have the audio code + in pommed itself. + - gpomme: remove audio-related code. + - pommed: partial support (ie. no LCD backlight yet) for the + MacBook3,1 (MacBook Core2 Duo Santa Rosa, November 2007). + - pommed: rework the event management. Use epoll() for event + polling instead of poll(). Use inotify to watch new event devices + appear in /dev/input. This effectively fixes our disappearing + event devices issues after suspend. YAY. + - pommed: add support for the external Apple USB keyboards, white + & alu. If you have such a keyboard with another USB ID, please + contact me. Patch from Carmine 'earcar' Paolino . + - pommed: add secondary locations for the uinput device + node. Heads up & patch from Carmine 'earcar' Paolino. + +version 1.10: + - pommed: add a beeper feature as a substitute to the missing PC + Speaker. The feature is disabled by default, as not all machines + need it and not everybody wants it ;) + +version 1.9: + - pommed: add an idle timer to automatically switch off the + keyboard backlight. Suggested by Javier Marcet. + - pommed: turn has_kbd_backlight() into an inline function. + - pommed: kill code duplication in the main loop. + +version 1.8: + - pommed: probe for the applesmc sysfs path in the ambient light + handling code. The path has changed in Linux 2.6.22. + - pommed: added automatic LCD backlight dimming when switching + from AC to battery power (and vice-versa). + - pommed: send out DBus notification when the automatic LCD + backlight dimming kicks in (similar to the automatic keyboard + backlight notification). + - gpomme: adjust for the new LCD backlight notification. + - Add the gpomme icon contributed by Jan Larres + under the icons/ directory. + - pommed: add support for the nVidia GeForce 8600M GT found in the + MacBookPro3,1. I don't like that code, if there's something better + that can be used, please mail me. + +version 1.7: + - pommed: add partial support for the MacBookPro3,1 (Core2 Duo, + 15" & 17", June 2007). New Apple IR receiver too. Missing nVidia + backlight control. + +version 1.6: + - pommed: add new "Apple Inc." vendor ID in SMBIOS routine. + +version 1.5: + - pommed: back to using eject(1) for CD ejection. + - pommed: fallback to of_find_node_by_name() for LMU controller + detection; it seems some PowerBooks (5,4) do not have a node type + associated with the node in the device-tree. + +version 1.4: + - pommed: add proper support for the PowerBook5,8 and PowerBook5,9 + (PMU05 machines); add Geyser keyboard identification, PMU05 + ambient light sensors and keyboard backlight. Thanks Gaudenz + Steilin for the report and testing. + - pommed: added a simple backlight toggle mode, used when the + automatic backlight is disabled in the configuration file. + - pommed: enumerate i2c adapters. + +version 1.3: + - gpomme: added configuration GUI, courtesy of Daniel G. SIEGEL. + - gpomme: added elegant-bright and elegant-dark themes, courtesy + of Natanael Arndt . + - pommed: rewrote CD ejection routine; no longer depends on eject, + sends the dbus notification before ejecting the CD. + - pommed: add DBus methods to control pommed over DBus. Original + patch by Alexis ROBERT . + - pommed: add keyboard backlight fading for automatic keyboard + backlight. Based on a patch from Mario Oschwald + . + - pommed: try harder to reopen the event devices when coming back + from suspend. + +version 1.2: + - pommed: PowerBook5,5 has an ADB keyboard, not a USB keyboard. + - Added October 2003 iBook G4 support (PowerBook6,3), patch by + Arthur PETITPIERRE. + - pommed: tell DBus clients who is adjusting the keyboard + backlight, so they can decide to skip the notification if it's not + the user itself. + - gpomme: adapt to the new DBus notification. + - wmpomme: adapt to the new DBus notification. + - pommed: added support for nVidia GPUs. + - pommed: added support for mouseemu users (mouseemu virtual + keyboard) + - pommed: rework keyboard backlight automatic mode, the backlight + off key now works as a toggle for the automatic mode, as it does + on Mac OS X + - pommed: turn off keyboard backlight when lid is closed + - pommed: added UNTESTED support for + + PowerBook3,3: PowerBook G4 Titanium 15" October 2001 + + PowerBook3,4: PowerBook G4 Titanium 15" April 2002 + + PowerBook3,5: PowerBook G4 Titanium 15" + + PowerBook5,1: PowerBook G4 Aluminium 17" + + PowerBook5,2: PowerBook G4 Aluminium 15" September 2003 + + PowerBook5,3: PowerBook G4 Aluminium 17" September 2003 + + PowerBook5,4: PowerBook G4 Aluminium 15" April 2004 + + PowerBook5,8: PowerBook G4 Aluminium 15" + + PowerBook5,9: PowerBook G4 Aluminium 17" + + PowerBook6,1: PowerBook G4 12" January 2003 + + PowerBook6,2: PowerBook G4 12" September 2003 + + PowerBook6,3: iBook G4 October 2003 + + PowerBook6,4: PowerBook G4 12" April 2004 + + PowerBook6,5: iBook G4 October 2004 + + PowerBook6,7: iBook G4 + + PowerBook6,8: PowerBook G4 12" + + If you own one of the machines listed above, please test pommed by + running pommed -d and tell us: + - if it works at all + - if, not running either pommed or pbbuttonsd, pressing the + backlight up/down keys makes the backlight level change + Please send the debug output along with these information; we know + that pommed won't work out of the box on some of these machines. + +version 1.1: + - gpomme: added theme selection; use -t theme_name to select the + theme to use. + - gpomme: added the Tango theme provided by Daniel G. Siegel. + - gpomme: added multiple head support, based on a patch by Eduardo + Bellido Bellido. + +version 1.0: + - Renamed to pommed in anticipation of the PowerBook support + - Added fnmode setting + - Added DBus support: signals and get methods + - Add -d option to pommed, displays debug messages (replaces -DDEBUG) + +version 0.9: + - Added preliminary audio support: increase and decrease PCM, mute and + unmute both Headphone and Front + - Allow disabling the initial backlight level setting + +version 0.8: + - wait for both light sensors to be under the threshold before + lighting up the keyboard backlight; switch it off as soon as one + of the sensors gets past the threshold. + - added a configuration file + - added optional Apple Remote control support + +version 0.7: + - allow MacBook users to switch off the LCD backlight entirely + - fix model identifier string for the Core2 Duo MacBook diff --git a/app-laptop/pommed/pommed-1.31/INSTALL b/app-laptop/pommed/pommed-1.31/INSTALL new file mode 100644 index 0000000..63d39c5 --- /dev/null +++ b/app-laptop/pommed/pommed-1.31/INSTALL @@ -0,0 +1,80 @@ +Installation instructions for pommed +------------------------------------ + +pommed - the daemon +gpomme - GTK+ client +wmpomme - WindowMaker client + + +Building +-------- + +pommed requires: + - pciutils / libpci (on Intel machines only) + - libofapi aka oflib (PowerMac machines only, see below) + - zlib + - libconfuse + - libdbus + - libasound + - libaudiofile + - eject + +gpomme requires: + - libdbus + - libdbus-glib + - GTK+ 2.0 + - glade 2.0 + +wmpomme requires: + - X11 libs + - libdbus + + +To build everything, just run make from the top-level directory, or: + - make pommed, to build pommed + - make gpomme, to build gpomme + - make wmpomme, to build wmpomme + +For PowerPC machines, if you do not have libofapi installed, can't find it or +do not want to install it, run make pommed OFLIB=1 to use the embedded copy +of libofapi. + + +Installing +---------- + +To install pommed: + - copy pommed somewhere in your PATH (/usr/bin) + - copy pommed/data/* to /usr/share/pommed + - copy pommed.conf.(mactel|pmac) as /etc/pommed.conf + - install the pommed.init initscript as /etc/init.d/pommed, make it executable + and perform any additional configuration needed on your system (links to + /etc/rc?.d/ for instance) + - configure DBus for pommed + + if you have a /etc/dbus-1/system.d directory, copy dbus-policy.conf + as /etc/dbus-1/system.d/pommed.conf + + otherwise, copy dbus-policy.conf as /etc/dbus-1/pommed.conf and add + pommed.conf + in /etc/dbus-1/system.conf, between the ... tags + (usually toward the end of the file, before the tag) + - restart dbus + +To install gpomme: + - copy gpomme somewhere in your PATH (/usr/bin) + - install gpomme/themes as /usr/share/gpomme/themes + - install gpomme/po/$lang.mo as /usr/share/locale/$lang/LC_MESSAGES/gpomme.mo + - copy gpomme/gpomme*.desktop to /usr/share/applications + - copy gpomme/gpomme.glade to /usr/share/gpomme + +Icons for gpomme are available in the icons/ directory. For the .desktop files +provided with gpomme to work, the icons should be installed under +/usr/share/icons/hicolor. PNG files go to the appropriate sub-directory +depending on their size, gpomme.svg goes to the scalable/ sub-directory. + + +To install wmpomme: + - copy wmpomme somewhere in your PATH (/usr/bin) + +Pick an icon from the icons/ directory to display in the dock. You can install +gpomme_32x32.xpm to /usr/share/pixmaps/wmpomme.xpm and use that in the dock for +instance. diff --git a/app-laptop/pommed/pommed-1.31/Makefile b/app-laptop/pommed/pommed-1.31/Makefile new file mode 100644 index 0000000..bf51b4e --- /dev/null +++ b/app-laptop/pommed/pommed-1.31/Makefile @@ -0,0 +1,22 @@ +# Top-level Makefile for pommed & tools + +OFLIB ?= + +all: pommed gpomme wmpomme + +pommed: + $(MAKE) -C pommed OFLIB=$(OFLIB) + +gpomme: + $(MAKE) -C gpomme + +wmpomme: + $(MAKE) -C wmpomme + +clean: + $(MAKE) -C pommed clean + $(MAKE) -C gpomme clean + $(MAKE) -C wmpomme clean + rm -f *~ + +.PHONY: pommed gpomme wmpomme diff --git a/app-laptop/pommed/pommed-1.31/README b/app-laptop/pommed/pommed-1.31/README new file mode 100644 index 0000000..1cb076f --- /dev/null +++ b/app-laptop/pommed/pommed-1.31/README @@ -0,0 +1,164 @@ +README for pommed +----------------- + + - Kernel version requirements + - Supported machines + - Using pommed + - Beeper feature + - When things go wrong + - Using gpomme and wmpomme + + +Kernel version requirements: +---------------------------- + + pommed requires at least a 2.6.25 kernel, due to the use of the new timerfd + interface that was released as stable with this version. + + February and October 2008 machines require a 2.6.28 kernel for full support. + + +Supported machines: +------------------- + + - Intel machines + * MacBook Pro Core Duo 15" (January 2006) + * MacBook Pro Core Duo 17" (April 2006) + * MacBook Pro Core2 Duo 15" (October 2006, June 2007, February 2008, October 2008) + * MacBook Pro Core2 Duo 17" (October 2006, June 2007, February 2008, October 2008) + * MacBook Pro 13", 15", 17" (June 2009) + * MacBook Core Duo (May 2006) + * MacBook Core2 Duo (November 2006 & May 2007) + * MacBook Core2 Duo Santa Rosa (November 2007) + * MacBook Core2 Duo (February 2008, October 2008) + * MacBook Air Core2 Duo (January 2008, October 2008) + + + - PowerMac machines + * PowerBook G4 Titanium 15" (December 2000) + * PowerBook G4 Titanium 15" (October 2001) + * PowerBook G4 Titanium 15" (April 2002) + * PowerBook G4 Titanium 15" + * PowerBook G4 Aluminium 17" + * PowerBook G4 Aluminium 15" (September 2003) + * PowerBook G4 Aluminium 17" (September 2003) + * PowerBook G4 Aluminium 15" (April 2004) + * PowerBook G4 Aluminium 17" (April 2004) + * PowerBook G4 Aluminium 15" (February 2005) + * PowerBook G4 Aluminium 17" (February 2005) + * PowerBook G4 Aluminium 15" + * PowerBook G4 Aluminium 17" + * PowerBook G4 12" (January 2003) + * PowerBook G4 12" (September 2003) + * iBook G4 (October 2003) + * PowerBook G4 12" (April 2004) + * iBook G4 (October 2004) + * iBook G4 + * PowerBook G4 12" + + If your PowerBook/iBook is not listed here, please contact us and include + the content of /proc/device-tree/model in your mail. Thanks. + + +Using pommed +------------ + +Launch pommed at startup, a simple init script will do. Your distribution +should take care of this. + + +Keyboard backlight on PowerMac machines +--------------------------------------- + +The keyboard backlight on PowerMac machines (except the very first ones) is +driven through i2c. You need the i2c-dev kernel module loaded on your system +for pommed to work properly; you can add i2c-dev to /etc/modules to have it +loaded automatically at system startup. + + +Beeper feature +-------------- + +The beeper feature relies on the uinput kernel module being loaded. You can +check for its availability by checking for the uinput device node, which is +either one of: + - /dev/input/uinput + - /dev/uinput + - /dev/misc/uinput + +Or by checking the output of + $ lsmod | grep uinput + +If the module is not loaded, load it manually with + # modprobe uinput +then restart pommed. You'll need to ensure the module is loaded before pommed +starts; to achieve that, add uinput to /etc/modules. + +For the curious, as I've been asked a couple times already: pommed uses the +uinput facility to create a userspace input device which handles the console +beep. Once this device is set up, the kernel happily passes down beep events +to pommed through this device, and pommed only needs to ... well, *beep*. + + +When things go wrong +-------------------- + +First and foremost: don't panic! + +If something doesn't work (or so it appears), there's usually a good reason to +that, and pommed should be able to provide some insight as to what is going +wrong if only you ask it. + +By default, pommed uses syslog to log warnings and errors, so check your +system logs. If you can't find anything, running pommed in the foreground +will help a lot; in this mode, pommed will log everything to stderr instead +of syslog, so you'll see every message. + +First, stop pommed. Then run + # pommed -f + +Use Ctrl-C to stop pommed, fix the problem, and restart it. + +If you still can't see what's wrong, ask for more output by running pommed in +debug mode. Be warned: in this mode, pommed is very chatty. + +First, stop pommed. Then run + # pommed -d + +Use Ctrl-C to stop pommed, fix the problem, and restart it. + +If the debug mode doesn't offer any hint as to what's going on, then contact +me with the details of your problem and I'll be able to help. + + +Using gpomme and wmpomme +------------------------ + + - gpomme: launch gpomme at session startup, using whatever interface your + desktop environment provides for that. + + - wmpomme: run wmpomme and add it to your dock. + +Both gpomme and wmpomme are responsible for running a user-provided helper +when the video switch button is pressed. This helper is responsible for +activating/deactivating the external video output. + +The helper can be set system-wide and overriden on a per-user basis: + - if $HOME/.videoswitch exists, is readable and executable by the running + user, it is executed; + - otherwise, if /etc/pommed/videoswitch exists, is readable and executable + by the running user, it is executed. + +The program is invoked without arguments, and argv[0] is "videoswitch". + +The videoswitch helper can be anything you want: shell script, perl/python +script or a plain binary; anything executable. It is up to the script or +program to perform any housekeeping/statekeeping that is necessary. + +If you want to run urandr or grandr, you can just symlink it as +/etc/pommed/videoswitch or $HOME/.videoswitch. + +As different machines require different scripts, pommed can't ship a default +script (there's no one-size-fits-all, unfortunately). If you write a nice +script for your machine and would like to have it shipped with pommed as an +example, mail it to me with a proper license and the machine model. diff --git a/app-laptop/pommed/pommed-1.31/TODO b/app-laptop/pommed/pommed-1.31/TODO new file mode 100644 index 0000000..dd9b0d0 --- /dev/null +++ b/app-laptop/pommed/pommed-1.31/TODO @@ -0,0 +1,10 @@ +TODO for pommed +--------------- + + * General + --------- + - use ambient light sensor + - for automatic LCD backlight tweaking (powersaving) + - for (better) automatic keyboard backlight tweaking + + -- Julien BLACHE , Tue, 27 Nov 2007 17:43:42 +0100 diff --git a/app-laptop/pommed/pommed-1.31/client-common/dbus-client.c b/app-laptop/pommed/pommed-1.31/client-common/dbus-client.c new file mode 100644 index 0000000..8912649 --- /dev/null +++ b/app-laptop/pommed/pommed-1.31/client-common/dbus-client.c @@ -0,0 +1,419 @@ +/* + * dbus-client.c -- shared DBus client routines for pommed clients + * + * Copyright (C) 2006-2007, 2009 Julien BLACHE + * + * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; version 2 of the License. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License along + * with this program; if not, write to the Free Software Foundation, Inc., + * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. + */ + + +#include + +#include + +#include "dbus-client.h" + + +static DBusError *err; +static DBusConnection *conn; + + +/* Method calls */ +/* WARNING: method calls are synchronous for now with a 250ms timeout */ +int +mbp_call_lcd_getlevel(DBusPendingCallNotifyFunction cb, void *userdata) +{ + DBusMessage *msg; + DBusPendingCall *pending; + + int ret; + + msg = dbus_message_new_method_call("org.pommed", "/org/pommed/lcdBacklight", + "org.pommed.lcdBacklight", "getLevel"); + + if (msg == NULL) + { + printf("Failed to create method call message\n"); + + return -1; + } + + ret = dbus_connection_send_with_reply(conn, msg, &pending, 250); + if (ret == FALSE) + { + printf("Could not send method call\n"); + + dbus_message_unref(msg); + + return -1; + } + + dbus_connection_flush(conn); + + dbus_message_unref(msg); + + dbus_pending_call_block(pending); + + cb(pending, userdata); + + return 0; +} + +int +mbp_call_kbd_getlevel(DBusPendingCallNotifyFunction cb, void *userdata) +{ + DBusMessage *msg; + DBusPendingCall *pending; + + int ret; + + msg = dbus_message_new_method_call("org.pommed", "/org/pommed/kbdBacklight", + "org.pommed.kbdBacklight", "getLevel"); + + if (msg == NULL) + { + printf("Failed to create method call message\n"); + + return -1; + } + + ret = dbus_connection_send_with_reply(conn, msg, &pending, 250); + if (ret == FALSE) + { + printf("Could not send method call\n"); + + dbus_message_unref(msg); + + return -1; + } + + dbus_connection_flush(conn); + + dbus_message_unref(msg); + + dbus_pending_call_block(pending); + + cb(pending, userdata); + + return 0; +} + +int +mbp_call_ambient_getlevel(DBusPendingCallNotifyFunction cb, void *userdata) +{ + DBusMessage *msg; + DBusPendingCall *pending; + + int ret; + + msg = dbus_message_new_method_call("org.pommed", "/org/pommed/ambient", + "org.pommed.ambient", "getLevel"); + + if (msg == NULL) + { + printf("Failed to create method call message\n"); + + return -1; + } + + ret = dbus_connection_send_with_reply(conn, msg, &pending, 250); + if (ret == FALSE) + { + printf("Could not send method call\n"); + + dbus_message_unref(msg); + + return -1; + } + +#if 0 /* Needs more work, using dispatch & stuff */ + ret = dbus_pending_call_set_notify(pending, cb, NULL, NULL); + if (!ret) + { + printf("Failed to set callback\n"); + + dbus_pending_call_unref(pending); + + return -1; + } +#endif /* 0 */ + + dbus_connection_flush(conn); + + dbus_message_unref(msg); + + dbus_pending_call_block(pending); + + cb(pending, userdata); + + return 0; +} + +int +mbp_call_audio_getvolume(DBusPendingCallNotifyFunction cb, void *userdata) +{ + DBusMessage *msg; + DBusPendingCall *pending; + + int ret; + + msg = dbus_message_new_method_call("org.pommed", "/org/pommed/audio", + "org.pommed.audio", "getVolume"); + + if (msg == NULL) + { + printf("Failed to create method call message\n"); + + return -1; + } + + ret = dbus_connection_send_with_reply(conn, msg, &pending, 250); + if (ret == FALSE) + { + printf("Could not send method call\n"); + + dbus_message_unref(msg); + + return -1; + } + + dbus_connection_flush(conn); + + dbus_message_unref(msg); + + dbus_pending_call_block(pending); + + cb(pending, userdata); + + return 0; +} + +int +mbp_call_audio_getmute(DBusPendingCallNotifyFunction cb, void *userdata) +{ + DBusMessage *msg; + DBusPendingCall *pending; + + int ret; + + msg = dbus_message_new_method_call("org.pommed", "/org/pommed/audio", + "org.pommed.audio", "getMute"); + + if (msg == NULL) + { + printf("Failed to create method call message\n"); + + return -1; + } + + ret = dbus_connection_send_with_reply(conn, msg, &pending, 250); + if (ret == FALSE) + { + printf("Could not send method call\n"); + + dbus_message_unref(msg); + + return -1; + } + + dbus_connection_flush(conn); + + dbus_message_unref(msg); + + dbus_pending_call_block(pending); + + cb(pending, userdata); + + return 0; +} + +int +mbp_call_video_getvtstate(int vtnum, DBusPendingCallNotifyFunction cb, void *userdata) +{ + DBusMessage *msg; + DBusPendingCall *pending; + + int ret; + + msg = dbus_message_new_method_call("org.pommed", "/org/pommed/video", + "org.pommed.video", "getVTState"); + + if (msg == NULL) + { + printf("Failed to create method call message\n"); + + return -1; + } + + ret = dbus_message_append_args(msg, + DBUS_TYPE_UINT32, &vtnum, + DBUS_TYPE_INVALID); + if (ret == FALSE) + { + printf("Failed to add arguments\n"); + + dbus_message_unref(msg); + + return -1; + } + + ret = dbus_connection_send_with_reply(conn, msg, &pending, 250); + if (ret == FALSE) + { + printf("Could not send method call\n"); + + dbus_message_unref(msg); + + return -1; + } + + dbus_connection_flush(conn); + + dbus_message_unref(msg); + + dbus_pending_call_block(pending); + + cb(pending, userdata); + + return 0; +} + + +/* Error checking, mainly for replies to method calls */ + +int +mbp_dbus_check_error(DBusMessage *msg) +{ + DBusMessageIter iter; + + char *errmsg; + + if (dbus_message_get_type(msg) == DBUS_MESSAGE_TYPE_ERROR) + { + dbus_message_iter_init(msg, &iter); + dbus_message_iter_get_basic(&iter, &errmsg); + + printf("DBus error: %s\n", errmsg); + + return 1; + } + + return 0; +} + + +/* Connection init and cleanup */ + +static int +bus_add_match(DBusConnection *conn, char *match) +{ + dbus_bus_add_match(conn, match, err); + dbus_connection_flush(conn); + + if (dbus_error_is_set(err)) + { + printf("Match error: %s\n", err->message); + + return -1; + } + + return 0; +} + + +void +mbp_dbus_cleanup(void) +{ + if (conn != NULL) + { + dbus_error_free(err); + dbus_connection_unref(conn); + + conn = NULL; + } +} + + +DBusConnection * +mbp_dbus_init(DBusError *error, unsigned int signals) +{ + err = error; + + dbus_error_init(err); + + conn = dbus_bus_get(DBUS_BUS_SYSTEM, err); + if (dbus_error_is_set(err)) + { + printf("DBus system bus connection failed: %s\n", err->message); + + dbus_error_free(err); + + conn = NULL; + + return NULL; + } + + dbus_connection_set_exit_on_disconnect(conn, FALSE); + + if ((signals & MBP_DBUS_SIG_LCD) + && (bus_add_match(conn, "type='signal',path='/org/pommed/notify/lcdBacklight',interface='org.pommed.signal.lcdBacklight'") < 0)) + { + mbp_dbus_cleanup(); + return NULL; + } + + if ((signals & MBP_DBUS_SIG_KBD) + && (bus_add_match(conn, "type='signal',path='/org/pommed/notify/kbdBacklight',interface='org.pommed.signal.kbdBacklight'") < 0)) + { + mbp_dbus_cleanup(); + return NULL; + } + + if ((signals & MBP_DBUS_SIG_VOL) + && (bus_add_match(conn, "type='signal',path='/org/pommed/notify/audioVolume',interface='org.pommed.signal.audioVolume'") < 0)) + { + mbp_dbus_cleanup(); + return NULL; + } + + if ((signals & MBP_DBUS_SIG_MUTE) + && (bus_add_match(conn, "type='signal',path='/org/pommed/notify/audioMute',interface='org.pommed.signal.audioMute'") < 0)) + { + mbp_dbus_cleanup(); + return NULL; + } + + if ((signals & MBP_DBUS_SIG_LIGHT) + && (bus_add_match(conn, "type='signal',path='/org/pommed/notify/ambientLight',interface='org.pommed.signal.ambientLight'") < 0)) + { + mbp_dbus_cleanup(); + return NULL; + } + + if ((signals & MBP_DBUS_SIG_EJECT) + && (bus_add_match(conn, "type='signal',path='/org/pommed/notify/cdEject',interface='org.pommed.signal.cdEject'") < 0)) + { + mbp_dbus_cleanup(); + return NULL; + } + + if ((signals & MBP_DBUS_SIG_VIDEO) + && (bus_add_match(conn, "type='signal',path='/org/pommed/notify/videoSwitch',interface='org.pommed.signal.videoSwitch'") < 0)) + { + mbp_dbus_cleanup(); + return NULL; + } + + return conn; +} diff --git a/app-laptop/pommed/pommed-1.31/client-common/dbus-client.h b/app-laptop/pommed/pommed-1.31/client-common/dbus-client.h new file mode 100644 index 0000000..27a37d6 --- /dev/null +++ b/app-laptop/pommed/pommed-1.31/client-common/dbus-client.h @@ -0,0 +1,58 @@ +/* + * pommed - dbus-client.h + */ +#ifndef __MBP_DBUS_CLIENT_H__ +#define __MBP_DBUS_CLIENT_H__ + +/* Signals to listen to */ +#define MBP_DBUS_SIG_NONE 0 +#define MBP_DBUS_SIG_LCD (1 << 0) +#define MBP_DBUS_SIG_KBD (1 << 1) +#define MBP_DBUS_SIG_VOL (1 << 2) +#define MBP_DBUS_SIG_MUTE (1 << 3) +#define MBP_DBUS_SIG_EJECT (1 << 4) +#define MBP_DBUS_SIG_LIGHT (1 << 5) +#define MBP_DBUS_SIG_VIDEO (1 << 6) + + +#define LCD_USER 0 +#define LCD_AUTO 1 + +#define KBD_USER 0 +#define KBD_AUTO 1 + + +/* Method calls */ +int +mbp_call_lcd_getlevel(DBusPendingCallNotifyFunction cb, void *userdata); + +int +mbp_call_kbd_getlevel(DBusPendingCallNotifyFunction cb, void *userdata); + +int +mbp_call_ambient_getlevel(DBusPendingCallNotifyFunction cb, void *userdata); + +int +mbp_call_audio_getvolume(DBusPendingCallNotifyFunction cb, void *userdata); + +int +mbp_call_audio_getmute(DBusPendingCallNotifyFunction cb, void *userdata); + +int +mbp_call_video_getvtstate(int vtnum, DBusPendingCallNotifyFunction cb, void *userdata); + + +/* Error checking */ +int +mbp_dbus_check_error(DBusMessage *msg); + + +/* Connection init and cleanup */ +DBusConnection * +mbp_dbus_init(DBusError *error, unsigned int signals); + +void +mbp_dbus_cleanup(void); + + +#endif /* !__MBP_DBUS_CLIENT_H__ */ diff --git a/app-laptop/pommed/pommed-1.31/client-common/video-client.c b/app-laptop/pommed/pommed-1.31/client-common/video-client.c new file mode 100644 index 0000000..40175c3 --- /dev/null +++ b/app-laptop/pommed/pommed-1.31/client-common/video-client.c @@ -0,0 +1,171 @@ +/* + * video-client.c -- shared video switch routines for pommed clients + * + * Copyright (C) 2007, 2009 Julien BLACHE + * + * Some code below taken from GDM where noted. + * + * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; version 2 of the License. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License along + * with this program; if not, write to the Free Software Foundation, Inc., + * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. + */ + +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include + +#include + +#include + +#include +#include + +#include "video-client.h" + + +static char *vsw_user = NULL; + + +/* + * Get the VT number X is running on + * (code taken from GDM, daemon/getvt.c, GPLv2+) + */ +int +mbp_get_x_vtnum(Display *dpy) +{ + Atom prop; + Atom actualtype; + int actualformat; + unsigned long nitems; + unsigned long bytes_after; + unsigned char *buf; + int num; + + prop = XInternAtom (dpy, "XFree86_VT", False); + if (prop == None) + return -1; + + if (XGetWindowProperty (dpy, DefaultRootWindow (dpy), prop, 0, 1, + False, AnyPropertyType, &actualtype, &actualformat, + &nitems, &bytes_after, &buf)) + { + return -1; + } + + if (nitems != 1) + { + XFree (buf); + return -1; + } + + switch (actualtype) + { + case XA_CARDINAL: + case XA_INTEGER: + case XA_WINDOW: + switch (actualformat) + { + case 8: + num = (*(uint8_t *)(void *)buf); + break; + case 16: + num = (*(uint16_t *)(void *)buf); + break; + case 32: + num = (*(uint32_t *)(void *)buf); + break; + default: + XFree (buf); + return -1; + } + break; + default: + XFree (buf); + return -1; + } + + XFree (buf); + + return num; +} + + +/* + * NOTE: you MUST install a SIGCHLD handler if you use this function + */ +void +mbp_video_switch(void) +{ + struct passwd *pw; + char *vsw = NULL; + + int ret; + + if (vsw_user == NULL) + { + pw = getpwuid(getuid()); + if (pw == NULL) + { + fprintf(stderr, "Could not get user information\n"); + + return; + } + + vsw_user = (char *) malloc(strlen(pw->pw_dir) + strlen(VIDEO_SWITCH_USER) + 1); + if (vsw_user == NULL) + { + fprintf(stderr, "Could not allocate memory\n"); + + return; + } + + strncpy(vsw_user, pw->pw_dir, strlen(pw->pw_dir) + 1); + strncat(vsw_user, VIDEO_SWITCH_USER, strlen(VIDEO_SWITCH_USER)); + } + + if (access(vsw_user, R_OK | X_OK) == 0) + { + vsw = vsw_user; + } + else if (access(VIDEO_SWITCH_SYSTEM, R_OK | X_OK) == 0) + { + vsw = VIDEO_SWITCH_SYSTEM; + } + else + { + fprintf(stderr, "No video switch script available\n"); + return; + } + + ret = fork(); + if (ret == 0) /* exec video switch script */ + { + execl(vsw, "videoswitch", NULL); + + fprintf(stderr, "Could not execute video switch script: %s", strerror(errno)); + exit(1); + } + else if (ret == -1) + { + fprintf(stderr, "Could not fork: %s\n", strerror(errno)); + return; + } +} + diff --git a/app-laptop/pommed/pommed-1.31/client-common/video-client.h b/app-laptop/pommed/pommed-1.31/client-common/video-client.h new file mode 100644 index 0000000..20bcee3 --- /dev/null +++ b/app-laptop/pommed/pommed-1.31/client-common/video-client.h @@ -0,0 +1,19 @@ +/* + * pommed - video-client.h + */ +#ifndef __MBP_VIDEO_CLIENT_H__ +#define __MBP_VIDEO_CLIENT_H__ + + +#define VIDEO_SWITCH_SYSTEM "/etc/pommed/videoswitch" +#define VIDEO_SWITCH_USER "/.videoswitch" + + +int +mbp_get_x_vtnum(Display *dpy); + +void +mbp_video_switch(void); + + +#endif /* !__MBP_VIDEO_CLIENT_H__ */ diff --git a/app-laptop/pommed/pommed-1.31/dbus-policy.conf b/app-laptop/pommed/pommed-1.31/dbus-policy.conf new file mode 100644 index 0000000..2914a45 --- /dev/null +++ b/app-laptop/pommed/pommed-1.31/dbus-policy.conf @@ -0,0 +1,19 @@ + + + + + + + + + + + + + + + + diff --git a/app-laptop/pommed/pommed-1.31/gpomme/.gitignore b/app-laptop/pommed/pommed-1.31/gpomme/.gitignore new file mode 100644 index 0000000..906c22d --- /dev/null +++ b/app-laptop/pommed/pommed-1.31/gpomme/.gitignore @@ -0,0 +1,3 @@ +gpomme +po/*.mo + diff --git a/app-laptop/pommed/pommed-1.31/gpomme/Makefile b/app-laptop/pommed/pommed-1.31/gpomme/Makefile new file mode 100644 index 0000000..438d152 --- /dev/null +++ b/app-laptop/pommed/pommed-1.31/gpomme/Makefile @@ -0,0 +1,59 @@ +CC = gcc + +GTK_CFLAGS = $(shell pkg-config --cflags gtk+-2.0) +GTK_LIBS = $(shell pkg-config --libs gtk+-2.0) + +GLADE_CFLAGS = $(shell pkg-config --cflags libglade-2.0) +GLADE_LIBS = $(shell pkg-config --libs libglade-2.0) + +DBUS_CFLAGS = $(shell pkg-config dbus-1 --cflags) -DDBUS_API_SUBJECT_TO_CHANGE +DBUS_LIBS = $(shell pkg-config dbus-1 --libs) + +DBUSGLIB_CFLAGS = $(shell pkg-config dbus-glib-1 --cflags) +DBUSGLIB_LIBS = $(shell pkg-config dbus-glib-1 --libs) + +CONFUSE_CFLAGS = $(shell pkg-config libconfuse --cflags) +CONFUSE_LIBS = $(shell pkg-config libconfuse --libs) + +INOTIFY_CFLAGS = $(shell test -e /usr/include/sys/inotify.h || echo -DNO_SYS_INOTIFY_H) + +CFLAGS = -g -O2 -Wall $(DBUS_CFLAGS) $(DBUSGLIB_CFLAGS) $(GTK_CFLAGS) $(CONFUSE_CFLAGS) $(GLADE_CFLAGS) $(INOTIFY_CFLAGS) +LDFLAGS = -lpthread -lX11 $(DBUS_LIBS) $(DBUSGLIB_LIBS) $(GTK_LIBS) $(CONFUSE_LIBS) $(GLADE_LIBS) + +SOURCES = gpomme.c theme.c conffile.c \ + ../client-common/dbus-client.c \ + ../client-common/video-client.c +POFILES = po/fr.po po/de.po po/es.po po/it.po po/ja.po + +OBJS = $(SOURCES:%.c=%.o) +MOFILES = $(POFILES:%.po=%.mo) + +all: gpomme mo + +mo: $(MOFILES) + +gpomme: $(OBJS) $(LIBS) + +gpomme.o: gpomme.c gpomme.h theme.h ../client-common/dbus-client.h ../client-common/video-client.h + +theme.o: theme.c theme.h gpomme.h + +conffile.o: conffile.c conffile.h gpomme.h theme.h + +../client-common/dbus-client.o: ../client-common/dbus-client.c ../client-common/dbus-client.h + +../client-common/video-client.o: ../client-common/video-client.c ../client-common/video-client.h + +%.mo: %.po + @echo Building $@... + @msgfmt --statistics -o $@ $< + +updatepo: + xgettext -L C -k_ -o po/gpomme.pot $(SOURCES) + for po in $(POFILES); do \ + msgmerge -U $$po po/gpomme.pot; \ + done + +clean: + rm -f gpomme $(OBJS) $(MOFILES) + rm -f *~ po/*~ ../client-common/*~ diff --git a/app-laptop/pommed/pommed-1.31/gpomme/TODO b/app-laptop/pommed/pommed-1.31/gpomme/TODO new file mode 100644 index 0000000..f6ee849 --- /dev/null +++ b/app-laptop/pommed/pommed-1.31/gpomme/TODO @@ -0,0 +1,4 @@ +TODO for gpomme +--------------- + - Use compositing when available + diff --git a/app-laptop/pommed/pommed-1.31/gpomme/conffile.c b/app-laptop/pommed/pommed-1.31/gpomme/conffile.c new file mode 100644 index 0000000..052caeb --- /dev/null +++ b/app-laptop/pommed/pommed-1.31/gpomme/conffile.c @@ -0,0 +1,373 @@ +/* + * gpomme - GTK application for use with pommed + * + * Copyright (C) 2007 Julien BLACHE + * Copyright (C) 2007 daniel g. siegel + * + * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; version 2 of the License. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License along + * with this program; if not, write to the Free Software Foundation, Inc., + * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. + */ + +#include +#include +#include + +#include +#include +#include + +#include +#include +#include +#include + +#ifndef NO_SYS_INOTIFY_H +# include +#else +# include +# include "inotify-syscalls.h" +#endif + +#include + +#include "conffile.h" +#include "gpomme.h" +#include "theme.h" + +#include +#include + + +#define _(str) gettext(str) + +#define GLADE_FILE "/usr/share/gpomme/gpomme.glade" // FIXME: check for path +#define CONFFILE "/.gpommerc" + + +static cfg_opt_t cfg_opts[] = + { + CFG_STR("theme", DEFAULT_THEME, CFGF_NONE), + CFG_INT("timeout", 900, CFGF_NONE), + CFG_END() + }; + +GladeXML *gxml; +GtkWidget *app_window; + +void +on_gpomme_window_close_cb (GtkWidget *widget, gpointer user_data); + +void +update_gui_config (void); + + +cfg_t *cfg = NULL; +static char *conffile = NULL; + + +static int +config_validate_positive_integer(cfg_t *cfg, cfg_opt_t *opt) +{ + int value = cfg_opt_getnint(opt, cfg_opt_size(opt) - 1); + + if (value < 0) + { + cfg_error(cfg, "Error: Value for '%s' must be positive", opt->name); + return -1; + } + + return 0; +} + +static int +config_validate_string(cfg_t *cfg, cfg_opt_t *opt) +{ + char *value = cfg_opt_getnstr(opt, cfg_opt_size(opt) - 1); + + if (strlen(value) == 0) + { + cfg_error(cfg, "Error: Value for '%s' must be a non-zero string", opt->name); + return -1; + } + + return 0; +} + + +int +config_load(void) +{ + struct passwd *pw; + + int ret; + + if (conffile == NULL) + { + pw = getpwuid(getuid()); + if (pw == NULL) + { + fprintf(stderr, "Could not get user information\n"); + + return -1; + } + + conffile = (char *) malloc(strlen(pw->pw_dir) + strlen(CONFFILE) + 1); + if (conffile == NULL) + { + fprintf(stderr, "Could not allocate memory\n"); + + return -1; + } + + strncpy(conffile, pw->pw_dir, strlen(pw->pw_dir) + 1); + strncat(conffile, CONFFILE, strlen(CONFFILE)); + } + + if (cfg != NULL) + cfg_free(cfg); + + cfg = cfg_init(cfg_opts, CFGF_NONE); + + if (cfg == NULL) + { + fprintf(stderr, "Failed to initialize configuration parser\n"); + + return -1; + } + + /* Set up config values validation */ + cfg_set_validate_func(cfg, "theme", config_validate_string); + cfg_set_validate_func(cfg, "timeout", config_validate_positive_integer); + + /* + * Do the actual parsing. + * If the file does not exist or cannot be opened, + * we'll be using the default values defined in the cfg_opt_t array. + */ + ret = cfg_parse(cfg, conffile); + if (ret != CFG_SUCCESS) + { + if (ret == CFG_FILE_ERROR) + { + config_write(); + } + else + { + cfg_free(cfg); + + fprintf(stderr, "Failed to parse configuration file\n"); + + return -1; + } + } + + /* Fill up the structs */ + mbp_w.timeout = cfg_getint(cfg, "timeout"); + + ret = theme_load(cfg_getstr(cfg, "theme")); + if (ret < 0) + { + fprintf(stderr, "Failed to load theme '%s', using '%s' instead\n", + cfg_getstr(cfg, "theme"), DEFAULT_THEME); + + ret = theme_load(DEFAULT_THEME); + if (ret < 0) + { + fprintf(stderr, "Failed to load default theme '%s'\n", DEFAULT_THEME); + + return -1; + } + } + + return 0; +} + +int +config_write(void) +{ + FILE *fp; + + fp = fopen(conffile, "w"); + if (fp == NULL) + { + fprintf(stderr, "Could not write to config file: %s\n", strerror(errno)); + + return -1; + } + + fprintf(fp, "# gpomme config file\n"); + fprintf(fp, "# - theme : name of the theme to use\n"); + fprintf(fp, "# - timeout : time before the window hides\n\n"); + + cfg_print(cfg, fp); + + fclose(fp); + + return 0; +} + + +int +config_monitor(void) +{ + int fd; + int ret; + + fd = inotify_init(); + if (fd < 0) + { + fprintf(stderr, "Error: could not initialize inotify instance: %s\n", strerror(errno)); + + return -1; + } + + ret = fcntl(fd, F_GETFL); + if (ret < 0) + { + close(fd); + + fprintf(stderr, "Error: failed to get inotify fd flags: %s\n", strerror(errno)); + + return -1; + } + + ret = fcntl(fd, F_SETFL, ret | O_NONBLOCK); + if (ret < 0) + { + close(fd); + + fprintf(stderr, "Error: failed to set inotify fd flags: %s\n", strerror(errno)); + + return -1; + } + + ret = inotify_add_watch(fd, conffile, IN_CLOSE_WRITE); + if (ret < 0) + { + close(fd); + + fprintf(stderr, "Error: could not add inotify watch: %s\n", strerror(errno)); + + return -1; + } + + return fd; +} + + + +void +config_gui(void) +{ + GtkWidget *cb_theme; + GtkWidget *hs_timeout; + struct dirent **namelist; + int n; + + glade_init(); + + /* initialize glade and the window */ + gxml = glade_xml_new(GLADE_FILE, NULL, NULL); + app_window = glade_xml_get_widget(gxml, "gpomme_window"); + + /* setting the strings (for translation) */ + gtk_window_set_title(GTK_WINDOW(app_window), _("gpomme preferences")); + + GtkWidget *s; + s = glade_xml_get_widget(gxml, "lb_theme"); + gtk_label_set_text(GTK_LABEL(s), _("Theme:")); + + s = glade_xml_get_widget(gxml, "lb_timeout"); + gtk_label_set_text(GTK_LABEL(s), _("Timeout (seconds):")); + + /* set the default settings */ + hs_timeout = glade_xml_get_widget(gxml, "hs_timeout"); + gtk_range_set_value(GTK_RANGE(hs_timeout), (gdouble)cfg_getint(cfg, "timeout") / 1000.0); + + /* TODO: check for theme-previews */ + cb_theme = glade_xml_get_widget(gxml, "cb_theme"); + gtk_combo_box_remove_text(GTK_COMBO_BOX(cb_theme), 0); /* remove dummy-text */ + + gtk_combo_box_append_text(GTK_COMBO_BOX(cb_theme), cfg_getstr(cfg, "theme")); + gtk_combo_box_set_active(GTK_COMBO_BOX(cb_theme), 0); + + n = scandir(THEME_BASE, &namelist, 0, alphasort); + + if (n < 0) + { + fprintf(stderr, "Could not open theme directory: %s\n", strerror(errno)); + + exit(1); + } + + while(n--) + { + if (strcmp(namelist[n]->d_name, cfg_getstr(cfg, "theme")) + && (namelist[n]->d_name[0] != '.')) + { + /* printf("%s\n", namelist[n]->d_name); */ + gtk_combo_box_append_text(GTK_COMBO_BOX(cb_theme), namelist[n]->d_name); + } + } + + /* signals... */ + glade_xml_signal_connect(gxml, "on_bt_close_clicked", + G_CALLBACK(on_gpomme_window_close_cb)); + + glade_xml_signal_connect(gxml, "on_gpomme_window_close", + G_CALLBACK(on_gpomme_window_close_cb)); + + glade_xml_signal_connect(gxml, "on_gpomme_window_destroy", + G_CALLBACK(on_gpomme_window_close_cb)); + + glade_xml_signal_connect(gxml, "on_hs_timeout_value_changed", + G_CALLBACK(update_gui_config)); + + glade_xml_signal_connect(gxml, "on_cb_theme_changed", + G_CALLBACK(update_gui_config)); + + gtk_widget_show(app_window); + + gtk_main(); +} + +/* window is closed, so write the settings to the config-file */ +void +on_gpomme_window_close_cb (GtkWidget *widget, gpointer user_data) +{ + update_gui_config(); + + gtk_widget_hide(app_window); + gtk_main_quit(); +} + +void +update_gui_config(void) +{ + GtkWidget *cb_themes; + GtkWidget *hs_timeout; + + /* get the actual settings */ + hs_timeout = glade_xml_get_widget(gxml, "hs_timeout"); + cb_themes = glade_xml_get_widget(gxml, "cb_theme"); + + gdouble timeout = gtk_range_get_value(GTK_RANGE(hs_timeout)) * 1000.0; + //g_print("setting timeout to %gs\n", timeout); + cfg_setint(cfg, "timeout", timeout); + + //g_print("setting theme to %s\n", gtk_combo_box_get_active_text(GTK_COMBO_BOX(cb_themes))); + cfg_setstr(cfg, "theme", gtk_combo_box_get_active_text(GTK_COMBO_BOX(cb_themes))); + + /* actually write them */ + config_write(); +} diff --git a/app-laptop/pommed/pommed-1.31/gpomme/conffile.h b/app-laptop/pommed/pommed-1.31/gpomme/conffile.h new file mode 100644 index 0000000..b25dc9a --- /dev/null +++ b/app-laptop/pommed/pommed-1.31/gpomme/conffile.h @@ -0,0 +1,20 @@ +/* + * gpomme - conffile.h + */ + +#ifndef __CONFFILE_H__ +#define __CONFFILE_H__ + +int +config_load(void); + +int +config_write(void); + +int +config_monitor(void); + +void +config_gui(void); + +#endif /* !__CONFFILE_H__ */ diff --git a/app-laptop/pommed/pommed-1.31/gpomme/gpomme-c.desktop b/app-laptop/pommed/pommed-1.31/gpomme/gpomme-c.desktop new file mode 100644 index 0000000..89f1b53 --- /dev/null +++ b/app-laptop/pommed/pommed-1.31/gpomme/gpomme-c.desktop @@ -0,0 +1,9 @@ +[Desktop Entry] +Version=1.0 +Name=pommed GTK client configuration GUI +Comment=A graphical client for pommed (configuration GUI) +Icon=gpomme +Exec=gpomme -c +StartupNotify=true +Type=Application +Categories=Utility diff --git a/app-laptop/pommed/pommed-1.31/gpomme/gpomme.1 b/app-laptop/pommed/pommed-1.31/gpomme/gpomme.1 new file mode 100644 index 0000000..3881f94 --- /dev/null +++ b/app-laptop/pommed/pommed-1.31/gpomme/gpomme.1 @@ -0,0 +1,40 @@ +.TH GPOMME 1 "2006-12-31" +.SH NAME +gpomme \- GTK+ graphical client for use with pommed + +.SH SYNOPSIS +.B gpomme +.B [\-v] +.SH DESCRIPTION +.B gpomme +will react to signals sent by +.B pommed +over DBus when a key is pressed, displaying the action taken by +.B pommed +and the current state associated with this action. + +.SH OPTIONS +.B gpomme +accepts the following command-line options. +.TP +.B \-v +Print version information. + +.SH FILES +.TP +.B ~/.gpommerc +User-specific configuration file for +.BR gpomme . +The file is automatically created when +.B gpomme +is run for the first time. Currently the theme and the timeout can +be configured using this configuration file. + +.SH AUTHOR +.B gpomme +was written by Julien BLACHE and Soeren SONNENBURG +based on code taken from +.BR gtkpbbuttons . + +.SH SEE ALSO +pommed(1) diff --git a/app-laptop/pommed/pommed-1.31/gpomme/gpomme.c b/app-laptop/pommed/pommed-1.31/gpomme/gpomme.c new file mode 100644 index 0000000..c0839cd --- /dev/null +++ b/app-laptop/pommed/pommed-1.31/gpomme/gpomme.c @@ -0,0 +1,651 @@ +/* + * gpomme - GTK application for use with pommed + * + * Copyright (C) 2006, 2008 Soeren SONNENBURG + * Copyright (C) 2006-2009 Julien BLACHE + * Copyright (C) 2007 daniel g. siegel + * + * Portions of the GTK code below were shamelessly + * stolen from pbbuttonsd. Thanks ! ;-) + * + * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; version 2 of the License. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License along + * with this program; if not, write to the Free Software Foundation, Inc., + * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. + */ + + +#include +#include +#include +#include + +#include +#include + +#ifndef NO_SYS_INOTIFY_H +# include +#else +# include +# include "inotify-syscalls.h" +#endif + +#include + +#include +#include + +#include + +#include +#include +#include + +#include "gpomme.h" +#include "theme.h" +#include "conffile.h" + +#include "../client-common/dbus-client.h" +#include "../client-common/video-client.h" + + +#define _(str) gettext(str) + + +struct _mbp_w mbp_w; + +struct +{ + int muted; +} mbp; + +DBusError dbus_err; +DBusConnection *conn; + +dbus_uint32_t mute_serial = 0; + + +/* Timer callback */ +static gboolean +hide_window(gpointer userdata) +{ + gtk_widget_hide(mbp_w.window); + + mbp_w.timer = 0; + + return FALSE; +} + +static gboolean +window_expose_event (GtkWidget *widget, GdkEventExpose *event) +{ + GdkRegion *region; + GtkWidget *child; + cairo_t *cr; + + /* get our child (in this case, the event box) */ + child = gtk_bin_get_child (GTK_BIN (widget)); + + /* create a cairo context to draw to the window */ + cr = gdk_cairo_create (widget->window); + + /* the source data is the (composited) event box */ + gdk_cairo_set_source_pixmap (cr, child->window, + child->allocation.x, + child->allocation.y); + + /* draw no more than our expose event intersects our child */ + region = gdk_region_rectangle (&child->allocation); + gdk_region_intersect (region, event->region); + gdk_cairo_region (cr, region); + cairo_clip (cr); + + /* composite, with a 50% opacity */ + cairo_set_operator (cr, CAIRO_OPERATOR_OVER); + cairo_paint_with_alpha (cr, 1.0); + + /* we're done */ + cairo_destroy (cr); + + return FALSE; +} + +static void +draw_window_bg(void) +{ + GtkWidget *window = mbp_w.window; + + GdkWindow *root_win; + GdkScreen *screen; + GdkRectangle mon_size; + GdkPixbuf *pixbuf = NULL; + GdkPixmap *pixmap = NULL; + + int x, y; + int monitor; + + screen = gtk_window_get_screen(GTK_WINDOW(window)); + + /* Find which monitor the mouse cursor is on */ + root_win = gdk_screen_get_root_window(screen); + gdk_window_get_pointer(root_win, &x, &y, NULL); + + monitor = gdk_screen_get_monitor_at_point(screen, x, y); + gdk_screen_get_monitor_geometry(screen, monitor, &mon_size); + + /* Move the window to the bottom center of the screen */ + x = mon_size.x + (mon_size.width - theme.width) / 2; + y = mon_size.y + (mon_size.height - 100 - theme.height); + + gtk_window_move(GTK_WINDOW(window), x, y); + + /* Redraw the window background, compositing the background pixmap with + * the portion of the root window that's beneath the window + */ + pixbuf = gdk_pixbuf_get_from_drawable(NULL, + gdk_get_default_root_window(), gdk_colormap_get_system(), + x, y, 0, 0, theme.width, theme.height); + + /* render the combined pixbuf to a pixmap with alpha control */ + pixmap = gdk_pixmap_new(GTK_WIDGET(window)->window, theme.width, theme.height, -1); + GdkGC *gc = gdk_gc_new(pixmap); + gdk_draw_rectangle(pixmap, gc, TRUE, 0, 0, theme.width, theme.height); + if (!gdk_screen_is_composited(screen)) + { + gdk_draw_pixbuf(pixmap, NULL, pixbuf, 0, 0, 0, 0, + theme.width, theme.height, GDK_RGB_DITHER_NONE, 0, 0); + } + + gdk_draw_pixbuf(pixmap, NULL, theme.background, 0, 0, 0, 0, + theme.width, theme.height, GDK_RGB_DITHER_NONE, 0, 0); + gdk_window_set_back_pixmap(GTK_WIDGET(window)->window, pixmap, FALSE); + + g_object_unref(pixbuf); + g_object_unref(pixmap); +} + +static void +show_window(int img, char *label, double fraction) +{ + char *m_label; + char *u_label; + + GtkWidget *window = mbp_w.window; + + if (img >= IMG_NIMG) + return; + + /* Cancel timer */ + if (mbp_w.timer > 0) + g_source_remove(mbp_w.timer); + + if (!GTK_WIDGET_VISIBLE(window)) + draw_window_bg(); + + /* Put the appropriate image in there */ + if (mbp_w.image != theme.images[img]) + { + if (mbp_w.image != NULL) + gtk_container_remove(GTK_CONTAINER(mbp_w.img_align), mbp_w.image); + + gtk_container_add(GTK_CONTAINER(mbp_w.img_align), theme.images[img]); + } + + mbp_w.image = theme.images[img]; + + /* Set the text label */ + u_label = g_locale_to_utf8(label, -1, NULL, NULL, NULL); + + if (u_label == NULL) + m_label = ""; + else /* accepts only UTF-8 input ... segfaults otherwise */ + m_label = g_markup_printf_escaped("%s", u_label); + + gtk_label_set_markup(GTK_LABEL(mbp_w.label), m_label); + + if (u_label != NULL) + { + g_free(u_label); + g_free(m_label); + } + + /* Set the progress bar */ + if (fraction >= 0.0) + { + gtk_progress_bar_set_fraction(GTK_PROGRESS_BAR(mbp_w.pbar), fraction); + + if (!mbp_w.pbar_state) + { + gtk_container_add(GTK_CONTAINER(mbp_w.pbar_align), mbp_w.pbar); + mbp_w.pbar_state = 1; + } + } + else if (mbp_w.pbar_state) + { + gtk_container_remove(GTK_CONTAINER(mbp_w.pbar_align), mbp_w.pbar); + mbp_w.pbar_state = 0; + } + + gtk_widget_show_all(window); + + mbp_w.timer = g_timeout_add(mbp_w.timeout, hide_window, NULL); +} + + +static void +create_window(void) +{ + GdkScreen *screen; + GdkColormap *rgba; + + GtkWidget *window; + GtkWidget *vbox; + GtkWidget *align; + + window = gtk_window_new(GTK_WINDOW_POPUP); + screen = gtk_widget_get_screen (window); + + if (gdk_screen_is_composited (screen)) + { + rgba = gdk_screen_get_rgba_colormap (screen); + gtk_widget_set_colormap (window, rgba); + } + + gtk_window_set_decorated(GTK_WINDOW(window), FALSE); + gtk_window_set_policy(GTK_WINDOW(window), FALSE, FALSE, FALSE); + gtk_widget_set_app_paintable(GTK_WIDGET(window), TRUE); + + gtk_window_set_default_size(GTK_WINDOW(window), theme.width, theme.height); + gtk_widget_set_size_request(GTK_WIDGET(window), theme.width, theme.height); + + vbox = gtk_vbox_new(FALSE, 0); + gtk_container_add(GTK_CONTAINER(window), vbox); + + /* Image */ + mbp_w.img_align = gtk_alignment_new(0.5, 0.7, 0.0, 0.0); + gtk_box_pack_start(GTK_BOX(vbox), mbp_w.img_align, TRUE, TRUE, 0); + + /* Text message */ + align = gtk_alignment_new(0.5, 0.0, 0.0, 0.0); + gtk_box_pack_start(GTK_BOX(vbox), align, TRUE, TRUE, 0); + + mbp_w.label = gtk_label_new(""); + gtk_container_add(GTK_CONTAINER(align), mbp_w.label); + + /* Progress bar */ + mbp_w.pbar_align = gtk_alignment_new(0.5, 0.0, 0.0, 0.0); + gtk_box_pack_start(GTK_BOX(vbox), mbp_w.pbar_align, TRUE, TRUE, 0); + + mbp_w.pbar = gtk_progress_bar_new(); + /* make it 10px high */ + gtk_widget_set_size_request(mbp_w.pbar, -1, 10); + gtk_container_add(GTK_CONTAINER(mbp_w.pbar_align), mbp_w.pbar); + /* Up the refcount to prevent GTK from freeing the widget */ + gtk_widget_ref(mbp_w.pbar); + + mbp_w.pbar_state = 1; + mbp_w.window = window; + mbp_w.image = NULL; + mbp_w.timer = 0; + + gtk_widget_realize(GTK_WIDGET(window)); + + if (gdk_screen_is_composited(screen)) + { + gdk_window_set_opacity(window->window, 0.8); + g_signal_connect_after(window, "expose-event", G_CALLBACK(window_expose_event), NULL); + } +} + + +static void +mbp_video_getvtstate_cb(DBusPendingCall *pending, void *status) +{ + DBusMessage *msg; + + msg = dbus_pending_call_steal_reply(pending); + + if (msg == NULL) + { + fprintf(stderr, "Could not steal reply\n"); + + dbus_pending_call_unref(pending); + + return; + } + + dbus_pending_call_unref(pending); + + if (!mbp_dbus_check_error(msg)) + { + dbus_message_get_args(msg, &dbus_err, + DBUS_TYPE_BOOLEAN, (int *)status, + DBUS_TYPE_INVALID); + } + else + *(int *)status = -1; + + dbus_message_unref(msg); +} + +static gboolean +mbp_dbus_reconnect(gpointer userdata); + +static DBusHandlerResult +mbp_dbus_listen(DBusConnection *lconn, DBusMessage *msg, gpointer userdata) +{ + int scratch; + int cur; + int max; + int who; + double ratio; + + Display *dpy; + + if (dbus_message_is_signal(msg, "org.pommed.signal.lcdBacklight", "lcdBacklight")) + { + dbus_message_get_args(msg, &dbus_err, + DBUS_TYPE_UINT32, &cur, + DBUS_TYPE_UINT32, &scratch, /* previous */ + DBUS_TYPE_UINT32, &max, + DBUS_TYPE_UINT32, &who, + DBUS_TYPE_INVALID); + + if (who == LCD_USER) + { + ratio = (double)cur / (double)max; + + show_window(IMG_LCD_BCK, _("LCD backlight level"), ratio); + } + } + else if (dbus_message_is_signal(msg, "org.pommed.signal.kbdBacklight", "kbdBacklight")) + { + dbus_message_get_args(msg, &dbus_err, + DBUS_TYPE_UINT32, &cur, + DBUS_TYPE_UINT32, &scratch, /* previous */ + DBUS_TYPE_UINT32, &max, + DBUS_TYPE_UINT32, &who, + DBUS_TYPE_INVALID); + + if (who == KBD_USER) + { + ratio = (double)cur / (double)max; + + show_window(IMG_KBD_BCK, _("Keyboard backlight level"), ratio); + } + } + else if (dbus_message_is_signal(msg, "org.pommed.signal.audioVolume", "audioVolume")) + { + dbus_message_get_args(msg, &dbus_err, + DBUS_TYPE_UINT32, &cur, + DBUS_TYPE_UINT32, &scratch, /* previous */ + DBUS_TYPE_UINT32, &max, + DBUS_TYPE_INVALID); + + ratio = (double)cur / (double)max; + + if (!mbp.muted) + show_window(IMG_AUDIO_VOL_ON, _("Sound volume"), ratio); + else + show_window(IMG_AUDIO_VOL_OFF, _("Sound volume (muted)"), ratio); + } + else if (dbus_message_is_signal(msg, "org.pommed.signal.audioMute", "audioMute")) + { + dbus_message_get_args(msg, &dbus_err, + DBUS_TYPE_BOOLEAN, &mbp.muted, + DBUS_TYPE_INVALID); + + if (mbp.muted) + show_window(IMG_AUDIO_MUTE, _("Sound muted"), -1.0); + else + show_window(IMG_AUDIO_MUTE, _("Sound unmuted"), -1.0); + } + else if (dbus_message_is_signal(msg, "org.pommed.signal.cdEject", "cdEject")) + { + show_window(IMG_CD_EJECT, _("Eject"), -1.0); + } + else if (dbus_message_is_signal(msg, "org.pommed.signal.videoSwitch", "videoSwitch")) + { + int vtnum; + int vtstate; + int ret; + + dpy = GDK_WINDOW_XDISPLAY(GTK_WIDGET(mbp_w.window)->window); + + vtnum = mbp_get_x_vtnum(dpy); + + ret = mbp_call_video_getvtstate(vtnum, mbp_video_getvtstate_cb, &vtstate); + if ((ret < 0) || (vtstate < 0)) + fprintf(stderr, "video getVTState call failed !\n"); + else if (vtstate == 1) + mbp_video_switch(); + } + else if (dbus_message_is_signal(msg, DBUS_INTERFACE_LOCAL, "Disconnected")) + { + printf("DBus disconnected\n"); + + mbp_dbus_cleanup(); + + g_timeout_add(200, mbp_dbus_reconnect, NULL); + } + else + { + if ((dbus_message_get_type(msg) == DBUS_MESSAGE_TYPE_METHOD_RETURN) + && (dbus_message_get_reply_serial(msg) == mute_serial)) + { + dbus_message_get_args(msg, &dbus_err, + DBUS_TYPE_BOOLEAN, &mbp.muted, + DBUS_TYPE_INVALID); + } + else + { + return DBUS_HANDLER_RESULT_NOT_YET_HANDLED; + } + } + + return DBUS_HANDLER_RESULT_HANDLED; +} + +static int +mbp_dbus_connect(void) +{ + unsigned int signals; + + DBusMessage *msg; + + int ret; + + signals = MBP_DBUS_SIG_LCD | MBP_DBUS_SIG_KBD + | MBP_DBUS_SIG_VOL | MBP_DBUS_SIG_MUTE + | MBP_DBUS_SIG_EJECT | MBP_DBUS_SIG_VIDEO; + + conn = mbp_dbus_init(&dbus_err, signals); + + if (conn == NULL) + return -1; + + dbus_connection_setup_with_g_main(conn, NULL); + + dbus_connection_add_filter(conn, mbp_dbus_listen, NULL, NULL); + + /* Get the mute state */ + msg = dbus_message_new_method_call("org.pommed", "/org/pommed/audio", + "org.pommed.audio", "getMute"); + + if (msg == NULL) + { + printf("Failed to create method call message for audio getMute\n"); + + return 0; + } + + ret = dbus_connection_send(conn, msg, &mute_serial); + if (ret == FALSE) + { + printf("Could not send method call for audio getMute\n"); + + dbus_message_unref(msg); + + return 0; + } + + dbus_connection_flush(conn); + + dbus_message_unref(msg); + + return 0; +} + +static gboolean +mbp_dbus_reconnect(gpointer userdata) +{ + if (mbp_dbus_connect() < 0) + return TRUE; + + return FALSE; +} + + +static gboolean +mbp_check_config(GIOChannel *ch, GIOCondition condition, gpointer userdata) +{ + int fd; + int ret; + + fd = g_io_channel_unix_get_fd(ch); + + if (condition & G_IO_IN) + { + ret = config_load(); + if (ret < 0) + { + fprintf(stderr, "Failed to reload config file, exiting\n"); + + gtk_main_quit(); + } + } + + close(fd); + + fd = config_monitor(); + + if (fd > 0) + { + ch = g_io_channel_unix_new(fd); + g_io_channel_set_encoding(ch, NULL, NULL); + g_io_add_watch(ch, G_IO_IN | G_IO_HUP | G_IO_ERR | G_IO_NVAL, mbp_check_config, NULL); + } + + return FALSE; +} + + +static void +usage(void) +{ + printf("gpomme v" M_VERSION " graphical client for pommed\n"); + printf("Copyright (C) 2006-2008 Julien BLACHE and others\n"); + + printf("Usage:\n"); + printf("\tgpomme\t\t-- start gpomme\n"); + printf("\tgpomme -c\t-- open the configuration panel\n"); + printf("\tgpomme -v\t-- print version and exit\n"); +} + + +void +sig_int_term_handler(int signo) +{ + gtk_main_quit(); +} + +void +sig_chld_handler(int signo) +{ + int ret; + + do + { + ret = waitpid(-1, NULL, WNOHANG); + } + while (ret > 0); +} + +int +main(int argc, char **argv) +{ + int c; + int ret; + + GIOChannel *ch; + int fd; + + gtk_init(&argc, &argv); + + bindtextdomain("gpomme", "/usr/share/locale"); + textdomain("gpomme"); + + ret = config_load(); + if (ret < 0) + { + fprintf(stderr, "Failed to load configuration\n"); + + exit(1); + } + + while ((c = getopt(argc, argv, "cv")) != -1) + { + switch (c) + { + case 'c': + config_gui(); + + exit(0); + break; + + case 'v': + printf("gpomme v" M_VERSION " graphical client for pommed\n"); + printf("Copyright (C) 2006-2008 Julien BLACHE and others\n"); + + exit(0); + break; + + default: + usage(); + + exit(-1); + break; + } + } + + mbp_dbus_connect(); + + fd = config_monitor(); + + if (fd > 0) + { + ch = g_io_channel_unix_new(fd); + g_io_channel_set_encoding(ch, NULL, NULL); + g_io_add_watch(ch, G_IO_IN | G_IO_HUP | G_IO_ERR | G_IO_NVAL, mbp_check_config, NULL); + } + + signal(SIGINT, sig_int_term_handler); + signal(SIGTERM, sig_int_term_handler); + signal(SIGCHLD, sig_chld_handler); + + create_window(); + + gtk_main(); + + mbp_dbus_cleanup(); + + return 0; +} diff --git a/app-laptop/pommed/pommed-1.31/gpomme/gpomme.desktop b/app-laptop/pommed/pommed-1.31/gpomme/gpomme.desktop new file mode 100644 index 0000000..5061ce9 --- /dev/null +++ b/app-laptop/pommed/pommed-1.31/gpomme/gpomme.desktop @@ -0,0 +1,9 @@ +[Desktop Entry] +Version=1.0 +Name=pommed GTK client +Comment=A graphical client for pommed +Icon=gpomme +Exec=gpomme +StartupNotify=true +Type=Application +Categories=Utility diff --git a/app-laptop/pommed/pommed-1.31/gpomme/gpomme.glade b/app-laptop/pommed/pommed-1.31/gpomme/gpomme.glade new file mode 100644 index 0000000..5d4918a --- /dev/null +++ b/app-laptop/pommed/pommed-1.31/gpomme/gpomme.glade @@ -0,0 +1,160 @@ + + + + + + 5 + gpomme Configuration + False + GTK_WIN_POS_MOUSE + True + GDK_WINDOW_TYPE_HINT_UTILITY + True + False + + + + + 390 + True + GDK_POINTER_MOTION_MASK | GDK_POINTER_MOTION_HINT_MASK | GDK_BUTTON_PRESS_MASK | GDK_BUTTON_RELEASE_MASK + + + True + 13 + + + True + + + True + 0 + 1 + <b>Theme:</b> + True + + + + + True + 10 + + + True + 6 + gnome-settings-theme + + + False + + + + + True + 0 + + + True + Set the theme of gpomme + <item1> + + + + + + 10 + 1 + + + + + 1 + + + + + False + False + 1 + + + + + True + + + True + 0 + 1 + <b>Timeout (in seconds):</b> + True + + + + + True + 10 + + + True + 6 + appointment + + + False + + + + + True + 0 0 5 0.10000000000000001 0.10000000000000001 0 + GTK_POS_LEFT + + + + 10 + 1 + + + + + False + 1 + 1 + + + + + 1 + + + + + False + 10 + 1 + + + + + True + GDK_POINTER_MOTION_MASK | GDK_POINTER_MOTION_HINT_MASK | GDK_BUTTON_PRESS_MASK | GDK_BUTTON_RELEASE_MASK + GTK_BUTTONBOX_END + + + True + gtk-close + True + + + + + + False + GTK_PACK_END + + + + + + diff --git a/app-laptop/pommed/pommed-1.31/gpomme/gpomme.h b/app-laptop/pommed/pommed-1.31/gpomme/gpomme.h new file mode 100644 index 0000000..659eeb4 --- /dev/null +++ b/app-laptop/pommed/pommed-1.31/gpomme/gpomme.h @@ -0,0 +1,35 @@ +/* + * gpomme - gpomme.h + */ + +#ifndef __GPOMME_H__ +#define __GPOMME_H__ + +#include + +#define THEME_BASE "/usr/share/gpomme/themes" + +#define M_VERSION "0.7" + + +struct _mbp_w +{ + GtkWidget *window; /* The window itself */ + + GtkWidget *img_align; /* Image container */ + GtkWidget *image; /* Current image, if any */ + + GtkWidget *label; /* Text label */ + + GtkWidget *pbar_align; /* Progress bar container */ + GtkWidget *pbar; /* Progress bar */ + int pbar_state; + + int timeout; + guint timer; +}; + +extern struct _mbp_w mbp_w; + + +#endif /* !__GPOMME_H__ */ diff --git a/app-laptop/pommed/pommed-1.31/gpomme/inotify-syscalls.h b/app-laptop/pommed/pommed-1.31/gpomme/inotify-syscalls.h new file mode 100644 index 0000000..a1d5408 --- /dev/null +++ b/app-laptop/pommed/pommed-1.31/gpomme/inotify-syscalls.h @@ -0,0 +1,98 @@ +/* + * Inotify syscall numbers + * Taken from the Linux kernel source tree + * + * Licensed under the terms of the GNU General Public License Version 2. + * + * Copyright (c) 2006 Tobias Klauser + */ + +#ifndef _LINUX_INOTIFY_SYSCALLS_H +#define _LINUX_INOTIFY_SYSCALLS_H + +#include + +#if defined(__i386__) +# define __NR_inotify_init 291 +# define __NR_inotify_add_watch 292 +# define __NR_inotify_rm_watch 293 +#elif defined(__x86_64__) +# define __NR_inotify_init 253 +# define __NR_inotify_add_watch 254 +# define __NR_inotify_rm_watch 255 +#elif defined(__powerpc__) || defined(__powerpc64__) +# define __NR_inotify_init 275 +# define __NR_inotify_add_watch 276 +# define __NR_inotify_rm_watch 277 +#elif defined (__ia64__) +# define __NR_inotify_init 1277 +# define __NR_inotify_add_watch 1278 +# define __NR_inotify_rm_watch 1279 +#elif defined (__s390__) +# define __NR_inotify_init 284 +# define __NR_inotify_add_watch 285 +# define __NR_inotify_rm_watch 286 +#elif defined (__alpha__) +# define __NR_inotify_init 444 +# define __NR_inotify_add_watch 445 +# define __NR_inotify_rm_watch 446 +#elif defined (__sparc__) || defined (__sparc64__) +# define __NR_inotify_init 151 +# define __NR_inotify_add_watch 152 +# define __NR_inotify_rm_watch 156 +#elif defined (__arm__) +# define __NR_OABI_SYSCALL_BASE 0x900000 +# if defined(__thumb__) || defined(__ARM_EABI__) +# define __NR_SYSCALL_BASE 0 +# else +# define __NR_SYSCALL_BASE __NR_OABI_SYSCALL_BASE +# endif +# define __NR_inotify_init (__NR_SYSCALL_BASE + 316) +# define __NR_inotify_add_watch (__NR_SYSCALL_BASE + 317) +# define __NR_inotify_rm_watch (__NR_SYSCALL_BASE + 318) +#elif defined (__sh__) +# define __NR_inotify_init 290 +# define __NR_inotify_add_watch 291 +# define __NR_inotify_rm_watch 292 +#elif defined (__hppa__) +# define __NR_inotify_init 269 +# define __NR_inotify_add_watch 270 +# define __NR_inotify_rm_watch 271 +#elif defined (__mips__) +# include +# if _MIPS_SIM == _MIPS_SIM_ABI32 +# define __NR_Linux 4000 +# define __NR_inotify_init (__NR_Linux + 284) +# define __NR_inotify_add_watch (__NR_Linux + 285) +# define __NR_inotify_rm_watch (__NR_Linux + 286) +# elif _MIPS_SIM == _MIPS_SIM_ABI64 +# define __NR_Linux 5000 +# define __NR_inotify_init (__NR_Linux + 243) +# define __NR_inotify_add_watch (__NR_Linux + 244) +# define __NR_inotify_rm_watch (__NR_Linux + 245) +# elif _MIPS_SIM == _MIPS_SIM_NABI32 +# define __NR_Linux 6000 +# define __NR_inotify_init (__NR_Linux + 247) +# define __NR_inotify_add_watch (__NR_Linux + 248) +# define __NR_inotify_rm_watch (__NR_Linux + 249) +# endif +#else +# error "inotify not supported on this architecture!" +#endif + +static inline int inotify_init (void) +{ + return syscall (__NR_inotify_init); +} + +static inline int inotify_add_watch (int fd, const char *name, __u32 mask) +{ + return syscall (__NR_inotify_add_watch, fd, name, mask); +} + +static inline int inotify_rm_watch (int fd, __u32 wd) +{ + return syscall (__NR_inotify_rm_watch, fd, wd); +} + +#endif /* _LINUX_INOTIFY_SYSCALLS_H */ diff --git a/app-laptop/pommed/pommed-1.31/gpomme/po/de.po b/app-laptop/pommed/pommed-1.31/gpomme/po/de.po new file mode 100644 index 0000000..6850e17 --- /dev/null +++ b/app-laptop/pommed/pommed-1.31/gpomme/po/de.po @@ -0,0 +1,58 @@ +# gpomme - graphical client for pommed +# Copyright (C) 2006 Soeren SONNENBURG +# Copyright (C) 2006, Julien BLACHE +# Copyright (C) 2007, daniel g. siegel +# This file is distributed under the same license as the PACKAGE package. +# Julien BLACHE , 2006. +# +msgid "" +msgstr "" +"Project-Id-Version: gpomme 0.6\n" +"Report-Msgid-Bugs-To: \n" +"POT-Creation-Date: 2007-03-08 18:42+0100\n" +"PO-Revision-Date: 2007-03-08 18:44+0100\n" +"Last-Translator: daniel g. siegel \n" +"Language-Team: german \n" +"MIME-Version: 1.0\n" +"Content-Type: text/plain; charset=UTF-8\n" +"Content-Transfer-Encoding: 8bit\n" + +#: gpomme.c:343 +msgid "LCD backlight level" +msgstr "Helligkeit" + +#: gpomme.c:358 +msgid "Keyboard backlight level" +msgstr "Tastatur Beleuchtung" + +#: gpomme.c:373 +msgid "Sound volume" +msgstr "Lautstärke" + +#: gpomme.c:377 +msgid "Sound volume (muted)" +msgstr "Lautstärke (Ton aus)" + +#: gpomme.c:386 +msgid "Sound muted" +msgstr "Ton aus" + +#: gpomme.c:388 +msgid "Sound unmuted" +msgstr "Ton an" + +#: gpomme.c:392 +msgid "Eject" +msgstr "CD Auswerfen" + +#: conffile.c:282 +msgid "gpomme preferences" +msgstr "gpomme Einstellungen" + +#: conffile.c:286 +msgid "Theme:" +msgstr "Thema:" + +#: conffile.c:289 +msgid "Timeout (seconds):" +msgstr "Timeout (Sekunden):" diff --git a/app-laptop/pommed/pommed-1.31/gpomme/po/es.po b/app-laptop/pommed/pommed-1.31/gpomme/po/es.po new file mode 100644 index 0000000..8da593a --- /dev/null +++ b/app-laptop/pommed/pommed-1.31/gpomme/po/es.po @@ -0,0 +1,58 @@ +# Spanish/Spain translation of gpomme. +# Copyright (C) 2007, Eduardo Bellido Bellido +# This file is distributed under the same license as the gpomme package. +# Eduardo Bellido Bellido , 2007. +# +# +msgid "" +msgstr "" +"Project-Id-Version: gpomme 0.6\n" +"Report-Msgid-Bugs-To: \n" +"POT-Creation-Date: 2007-03-08 18:42+0100\n" +"PO-Revision-Date: 2007-03-21 23:04+0100\n" +"Last-Translator: Eduardo Bellido Bellido \n" +"Language-Team: Spanish/Spain \n" +"MIME-Version: 1.0\n" +"Content-Type: text/plain; charset=UTF-8\n" +"Content-Transfer-Encoding: 8bit" + +#: gpomme.c:343 +msgid "LCD backlight level" +msgstr "Nivel de brillo de la pantalla" + +#: gpomme.c:358 +msgid "Keyboard backlight level" +msgstr "Nivel de brillo del teclado" + +#: gpomme.c:373 +msgid "Sound volume" +msgstr "Control de volumen" + +#: gpomme.c:377 +msgid "Sound volume (muted)" +msgstr "Control de volumen (silenciado)" + +#: gpomme.c:386 +msgid "Sound muted" +msgstr "Sonido silenciado" + +#: gpomme.c:388 +msgid "Sound unmuted" +msgstr "Sonido normal" + +#: gpomme.c:392 +msgid "Eject" +msgstr "Expulsando CD/DVD" + +#: conffile.c:282 +msgid "gpomme preferences" +msgstr "Preferencias de gpomme" + +#: conffile.c:286 +msgid "Theme:" +msgstr "Tema:" + +#: conffile.c:289 +msgid "Timeout (seconds):" +msgstr "Tiempo de espera (segundos):" + diff --git a/app-laptop/pommed/pommed-1.31/gpomme/po/fr.po b/app-laptop/pommed/pommed-1.31/gpomme/po/fr.po new file mode 100644 index 0000000..ea32150 --- /dev/null +++ b/app-laptop/pommed/pommed-1.31/gpomme/po/fr.po @@ -0,0 +1,56 @@ +# gpomme - graphical client for pommed +# Copyright (C) 2006, Julien BLACHE +# This file is distributed under the same license as the PACKAGE package. +# Julien BLACHE , 2006. +# +msgid "" +msgstr "" +"Project-Id-Version: gpomme 0.6\n" +"Report-Msgid-Bugs-To: \n" +"POT-Creation-Date: 2007-03-08 18:42+0100\n" +"PO-Revision-Date: 2007-03-08 18:43+0100\n" +"Last-Translator: Julien BLACHE \n" +"Language-Team: french \n" +"MIME-Version: 1.0\n" +"Content-Type: text/plain; charset=UTF-8\n" +"Content-Transfer-Encoding: 8bit\n" + +#: gpomme.c:343 +msgid "LCD backlight level" +msgstr "Luminosité écran" + +#: gpomme.c:358 +msgid "Keyboard backlight level" +msgstr "Éclairage clavier" + +#: gpomme.c:373 +msgid "Sound volume" +msgstr "Volume sonore" + +#: gpomme.c:377 +msgid "Sound volume (muted)" +msgstr "Volume sonore (muet)" + +#: gpomme.c:386 +msgid "Sound muted" +msgstr "Son désactivé" + +#: gpomme.c:388 +msgid "Sound unmuted" +msgstr "Son activé" + +#: gpomme.c:392 +msgid "Eject" +msgstr "Éjection" + +#: conffile.c:282 +msgid "gpomme preferences" +msgstr "Préférences gpomme" + +#: conffile.c:286 +msgid "Theme:" +msgstr "Thème :" + +#: conffile.c:289 +msgid "Timeout (seconds):" +msgstr "Délai (secondes) :" diff --git a/app-laptop/pommed/pommed-1.31/gpomme/po/gpomme.pot b/app-laptop/pommed/pommed-1.31/gpomme/po/gpomme.pot new file mode 100644 index 0000000..b1208f4 --- /dev/null +++ b/app-laptop/pommed/pommed-1.31/gpomme/po/gpomme.pot @@ -0,0 +1,57 @@ +# SOME DESCRIPTIVE TITLE. +# Copyright (C) YEAR THE PACKAGE'S COPYRIGHT HOLDER +# This file is distributed under the same license as the PACKAGE package. +# FIRST AUTHOR , YEAR. +# +#, fuzzy +msgid "" +msgstr "" +"Project-Id-Version: PACKAGE VERSION\n" +"Report-Msgid-Bugs-To: \n" +"POT-Creation-Date: 2007-03-08 18:42+0100\n" +"PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n" +"Last-Translator: FULL NAME \n" +"Language-Team: LANGUAGE \n" +"MIME-Version: 1.0\n" +"Content-Type: text/plain; charset=CHARSET\n" +"Content-Transfer-Encoding: 8bit\n" + +#: gpomme.c:343 +msgid "LCD backlight level" +msgstr "" + +#: gpomme.c:358 +msgid "Keyboard backlight level" +msgstr "" + +#: gpomme.c:373 +msgid "Sound volume" +msgstr "" + +#: gpomme.c:377 +msgid "Sound volume (muted)" +msgstr "" + +#: gpomme.c:386 +msgid "Sound muted" +msgstr "" + +#: gpomme.c:388 +msgid "Sound unmuted" +msgstr "" + +#: gpomme.c:392 +msgid "Eject" +msgstr "" + +#: conffile.c:282 +msgid "gpomme preferences" +msgstr "" + +#: conffile.c:286 +msgid "Theme:" +msgstr "" + +#: conffile.c:289 +msgid "Timeout (seconds):" +msgstr "" diff --git a/app-laptop/pommed/pommed-1.31/gpomme/po/it.po b/app-laptop/pommed/pommed-1.31/gpomme/po/it.po new file mode 100644 index 0000000..86ec611 --- /dev/null +++ b/app-laptop/pommed/pommed-1.31/gpomme/po/it.po @@ -0,0 +1,56 @@ +# gpomme - graphical client for pommed +# Copyright (C) 2007 daniel g. siegel +# This file is distributed under the same license as the PACKAGE package. +# Julien BLACHE , 2006. +# +msgid "" +msgstr "" +"Project-Id-Version: gpomme 0.6\n" +"Report-Msgid-Bugs-To: \n" +"POT-Creation-Date: 2007-03-08 18:42+0100\n" +"PO-Revision-Date: 2007-03-08 18:44+0100\n" +"Last-Translator: daniel g. siegel \n" +"Language-Team: italian \n" +"MIME-Version: 1.0\n" +"Content-Type: text/plain; charset=UTF-8\n" +"Content-Transfer-Encoding: 8bit\n" + +#: gpomme.c:343 +msgid "LCD backlight level" +msgstr "Illuminazione" + +#: gpomme.c:358 +msgid "Keyboard backlight level" +msgstr "Illuminazione della Tastiera" + +#: gpomme.c:373 +msgid "Sound volume" +msgstr "Volume" + +#: gpomme.c:377 +msgid "Sound volume (muted)" +msgstr "Livello suono (muto)" + +#: gpomme.c:386 +msgid "Sound muted" +msgstr "Suono muto" + +#: gpomme.c:388 +msgid "Sound unmuted" +msgstr "Suono normale" + +#: gpomme.c:392 +msgid "Eject" +msgstr "Espellere CD" + +#: conffile.c:282 +msgid "gpomme preferences" +msgstr "Impostazioni gpomme" + +#: conffile.c:286 +msgid "Theme:" +msgstr "Tema:" + +#: conffile.c:289 +msgid "Timeout (seconds):" +msgstr "Timeout (secondi):" diff --git a/app-laptop/pommed/pommed-1.31/gpomme/po/ja.po b/app-laptop/pommed/pommed-1.31/gpomme/po/ja.po new file mode 100644 index 0000000..598a950 --- /dev/null +++ b/app-laptop/pommed/pommed-1.31/gpomme/po/ja.po @@ -0,0 +1,58 @@ +# gpomme - graphical client for pommed +# Copyright (C) 2006, Julien BLACHE +# Copyright (C) 2008, Nobuhiro Iwamatsu +# This file is distributed under the same license as the PACKAGE package. +# Nobuhiro Iwamatsu , 2008. +# +msgid "" +msgstr "" +"Project-Id-Version: gpommed 1.21\n" +"Report-Msgid-Bugs-To: \n" +"POT-Creation-Date: 2007-03-08 18:42+0100\n" +"PO-Revision-Date: 2008-10-07 21:24+0900\n" +"Last-Translator: Nobuhiro Iwamatsu \n" +"Language-Team: debian-japanese \n" +"MIME-Version: 1.0\n" +"Content-Type: text/plain; charset=utf-8\n" +"Content-Transfer-Encoding: 8bit\n" + +#: gpomme.c:343 +msgid "LCD backlight level" +msgstr "LCD バックライトレベル" + +#: gpomme.c:358 +msgid "Keyboard backlight level" +msgstr "キーボードバックライトレベル" + +#: gpomme.c:373 +msgid "Sound volume" +msgstr "サウンドボリューム" + +#: gpomme.c:377 +msgid "Sound volume (muted)" +msgstr "サウンドボリューム (ミュート)" + +#: gpomme.c:386 +msgid "Sound muted" +msgstr "ミュート" + +#: gpomme.c:388 +msgid "Sound unmuted" +msgstr "ミュート解除" + +#: gpomme.c:392 +msgid "Eject" +msgstr "イジェクト" + +#: conffile.c:282 +msgid "gpomme preferences" +msgstr "gpomme の設定" + +#: conffile.c:286 +msgid "Theme:" +msgstr "テーマ:" + +#: conffile.c:289 +msgid "Timeout (seconds):" +msgstr "タイムアウト (秒):" + diff --git a/app-laptop/pommed/pommed-1.31/gpomme/theme.c b/app-laptop/pommed/pommed-1.31/gpomme/theme.c new file mode 100644 index 0000000..809decc --- /dev/null +++ b/app-laptop/pommed/pommed-1.31/gpomme/theme.c @@ -0,0 +1,117 @@ +/* + * gpomme - GTK application for use with pommed + * + * Copyright (C) 2006 Soeren SONNENBURG + * Copyright (C) 2006-2007 Julien BLACHE + * + * Portions of the GTK code below were shamelessly + * stolen from pbbuttonsd. Thanks ! ;-) + * + * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; version 2 of the License. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License along + * with this program; if not, write to the Free Software Foundation, Inc., + * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. + */ + + +#include +#include + +#include + +#include "gpomme.h" +#include "theme.h" + + +struct gpomme_theme theme; + + +static GtkWidget * +load_image(const char *name, const char *img) +{ + GError *error = NULL; + GdkPixbuf *pixbuf; + + char file[PATH_MAX]; + int ret; + + ret = snprintf(file, PATH_MAX, "%s/%s/%s", THEME_BASE, name, img); + if (ret >= PATH_MAX) + return NULL; + + pixbuf = gdk_pixbuf_new_from_file(file, &error); + + if (error != NULL) + { + printf("Error loading theme file %s: %s\n", name, error->message); + + g_error_free(error); + return NULL; + } + + return gtk_image_new_from_pixbuf(pixbuf); +} + +int +theme_load(const char *name) +{ + GError *error = NULL; + + char file[PATH_MAX]; + int i; + int ret; + + ret = snprintf(file, PATH_MAX, "%s/%s/background.png", THEME_BASE, name); + if (ret >= PATH_MAX) + return -1; + + if (theme.background) + g_object_unref(G_OBJECT(theme.background)); + + theme.background = gdk_pixbuf_new_from_file(file, &error); + + if (error != NULL) + { + printf("Error loading theme background: %s\n", error->message); + + g_error_free(error); + return -1; + } + + theme.width = gdk_pixbuf_get_width (theme.background); + theme.height = gdk_pixbuf_get_height (theme.background); + + /* + * We need to up the refcount to prevent GTK from destroying + * the images by itself when we start adding/removing them + * to/from a GtkContainer. + */ + + for (i = 0; i < IMG_NIMG; i++) + { + if (theme.images[i]) + g_object_unref(G_OBJECT(theme.images[i])); + } + + theme.images[IMG_LCD_BCK] = load_image(name, "brightness.png"); + theme.images[IMG_KBD_BCK] = load_image(name, "kbdlight.png"); + theme.images[IMG_AUDIO_VOL_ON] = load_image(name, "volume.png"); + theme.images[IMG_AUDIO_VOL_OFF] = load_image(name, "mute.png"); + theme.images[IMG_AUDIO_MUTE] = load_image(name, "noaudio.png"); + theme.images[IMG_CD_EJECT] = load_image(name, "cdrom.png"); + + for (i = 0; i < IMG_NIMG; i++) + { + g_object_ref(G_OBJECT(theme.images[i])); + } + + return 0; +} diff --git a/app-laptop/pommed/pommed-1.31/gpomme/theme.h b/app-laptop/pommed/pommed-1.31/gpomme/theme.h new file mode 100644 index 0000000..9e8f340 --- /dev/null +++ b/app-laptop/pommed/pommed-1.31/gpomme/theme.h @@ -0,0 +1,35 @@ +/* + * gpomme - theme.h + */ +#ifndef __THEME_H__ +#define __THEME_H__ + +#define DEFAULT_THEME "CrystalLarge" + +enum + { + IMG_LCD_BCK = 0, + IMG_KBD_BCK, + IMG_AUDIO_VOL_ON, + IMG_AUDIO_VOL_OFF, + IMG_AUDIO_MUTE, + IMG_CD_EJECT, + + IMG_NIMG /* Keep this one last */ + }; + +struct gpomme_theme +{ + int width; + int height; + GdkPixbuf *background; + + GtkWidget *images[IMG_NIMG]; +}; + +extern struct gpomme_theme theme; + + +int theme_load(const char *name); + +#endif /* !__THEME_H__ */ diff --git a/app-laptop/pommed/pommed-1.31/gpomme/themes/CrystalLarge/background.png b/app-laptop/pommed/pommed-1.31/gpomme/themes/CrystalLarge/background.png new file mode 100644 index 0000000..12f1315 Binary files /dev/null and b/app-laptop/pommed/pommed-1.31/gpomme/themes/CrystalLarge/background.png differ diff --git a/app-laptop/pommed/pommed-1.31/gpomme/themes/CrystalLarge/brightness.png b/app-laptop/pommed/pommed-1.31/gpomme/themes/CrystalLarge/brightness.png new file mode 100644 index 0000000..bb04b3d Binary files /dev/null and b/app-laptop/pommed/pommed-1.31/gpomme/themes/CrystalLarge/brightness.png differ diff --git a/app-laptop/pommed/pommed-1.31/gpomme/themes/CrystalLarge/cdrom.png b/app-laptop/pommed/pommed-1.31/gpomme/themes/CrystalLarge/cdrom.png new file mode 100644 index 0000000..b5bc56c Binary files /dev/null and b/app-laptop/pommed/pommed-1.31/gpomme/themes/CrystalLarge/cdrom.png differ diff --git a/app-laptop/pommed/pommed-1.31/gpomme/themes/CrystalLarge/kbdlight.png b/app-laptop/pommed/pommed-1.31/gpomme/themes/CrystalLarge/kbdlight.png new file mode 100644 index 0000000..3decee5 Binary files /dev/null and b/app-laptop/pommed/pommed-1.31/gpomme/themes/CrystalLarge/kbdlight.png differ diff --git a/app-laptop/pommed/pommed-1.31/gpomme/themes/CrystalLarge/mute.png b/app-laptop/pommed/pommed-1.31/gpomme/themes/CrystalLarge/mute.png new file mode 100644 index 0000000..b0d9757 Binary files /dev/null and b/app-laptop/pommed/pommed-1.31/gpomme/themes/CrystalLarge/mute.png differ diff --git a/app-laptop/pommed/pommed-1.31/gpomme/themes/CrystalLarge/noaudio.png b/app-laptop/pommed/pommed-1.31/gpomme/themes/CrystalLarge/noaudio.png new file mode 100644 index 0000000..ee7d490 Binary files /dev/null and b/app-laptop/pommed/pommed-1.31/gpomme/themes/CrystalLarge/noaudio.png differ diff --git a/app-laptop/pommed/pommed-1.31/gpomme/themes/CrystalLarge/src/background.svg b/app-laptop/pommed/pommed-1.31/gpomme/themes/CrystalLarge/src/background.svg new file mode 100644 index 0000000..6560a76 --- /dev/null +++ b/app-laptop/pommed/pommed-1.31/gpomme/themes/CrystalLarge/src/background.svg @@ -0,0 +1,70 @@ + + + + + + + + + image/svg+xml + + + + + + + + diff --git a/app-laptop/pommed/pommed-1.31/gpomme/themes/CrystalLarge/volume.png b/app-laptop/pommed/pommed-1.31/gpomme/themes/CrystalLarge/volume.png new file mode 100644 index 0000000..def750f Binary files /dev/null and b/app-laptop/pommed/pommed-1.31/gpomme/themes/CrystalLarge/volume.png differ diff --git a/app-laptop/pommed/pommed-1.31/gpomme/themes/KStyle/background.png b/app-laptop/pommed/pommed-1.31/gpomme/themes/KStyle/background.png new file mode 100644 index 0000000..b106780 Binary files /dev/null and b/app-laptop/pommed/pommed-1.31/gpomme/themes/KStyle/background.png differ diff --git a/app-laptop/pommed/pommed-1.31/gpomme/themes/KStyle/brightness.png b/app-laptop/pommed/pommed-1.31/gpomme/themes/KStyle/brightness.png new file mode 100644 index 0000000..e730730 Binary files /dev/null and b/app-laptop/pommed/pommed-1.31/gpomme/themes/KStyle/brightness.png differ diff --git a/app-laptop/pommed/pommed-1.31/gpomme/themes/KStyle/cdrom.png b/app-laptop/pommed/pommed-1.31/gpomme/themes/KStyle/cdrom.png new file mode 100644 index 0000000..2e574e0 Binary files /dev/null and b/app-laptop/pommed/pommed-1.31/gpomme/themes/KStyle/cdrom.png differ diff --git a/app-laptop/pommed/pommed-1.31/gpomme/themes/KStyle/kbdlight.png b/app-laptop/pommed/pommed-1.31/gpomme/themes/KStyle/kbdlight.png new file mode 100644 index 0000000..60fcb55 Binary files /dev/null and b/app-laptop/pommed/pommed-1.31/gpomme/themes/KStyle/kbdlight.png differ diff --git a/app-laptop/pommed/pommed-1.31/gpomme/themes/KStyle/mute.png b/app-laptop/pommed/pommed-1.31/gpomme/themes/KStyle/mute.png new file mode 100644 index 0000000..8dc2b1f Binary files /dev/null and b/app-laptop/pommed/pommed-1.31/gpomme/themes/KStyle/mute.png differ diff --git a/app-laptop/pommed/pommed-1.31/gpomme/themes/KStyle/noaudio.png b/app-laptop/pommed/pommed-1.31/gpomme/themes/KStyle/noaudio.png new file mode 100644 index 0000000..0ddff36 Binary files /dev/null and b/app-laptop/pommed/pommed-1.31/gpomme/themes/KStyle/noaudio.png differ diff --git a/app-laptop/pommed/pommed-1.31/gpomme/themes/KStyle/src/background.svg b/app-laptop/pommed/pommed-1.31/gpomme/themes/KStyle/src/background.svg new file mode 100644 index 0000000..d6380d5 --- /dev/null +++ b/app-laptop/pommed/pommed-1.31/gpomme/themes/KStyle/src/background.svg @@ -0,0 +1,75 @@ + + + + + + + + + image/svg+xml + + + + + + + + diff --git a/app-laptop/pommed/pommed-1.31/gpomme/themes/KStyle/volume.png b/app-laptop/pommed/pommed-1.31/gpomme/themes/KStyle/volume.png new file mode 100644 index 0000000..f230b87 Binary files /dev/null and b/app-laptop/pommed/pommed-1.31/gpomme/themes/KStyle/volume.png differ diff --git a/app-laptop/pommed/pommed-1.31/gpomme/themes/Tango/background.png b/app-laptop/pommed/pommed-1.31/gpomme/themes/Tango/background.png new file mode 100644 index 0000000..12f1315 Binary files /dev/null and b/app-laptop/pommed/pommed-1.31/gpomme/themes/Tango/background.png differ diff --git a/app-laptop/pommed/pommed-1.31/gpomme/themes/Tango/brightness.png b/app-laptop/pommed/pommed-1.31/gpomme/themes/Tango/brightness.png new file mode 100644 index 0000000..443a19e Binary files /dev/null and b/app-laptop/pommed/pommed-1.31/gpomme/themes/Tango/brightness.png differ diff --git a/app-laptop/pommed/pommed-1.31/gpomme/themes/Tango/cdrom.png b/app-laptop/pommed/pommed-1.31/gpomme/themes/Tango/cdrom.png new file mode 100644 index 0000000..f92ddbd Binary files /dev/null and b/app-laptop/pommed/pommed-1.31/gpomme/themes/Tango/cdrom.png differ diff --git a/app-laptop/pommed/pommed-1.31/gpomme/themes/Tango/kbdlight.png b/app-laptop/pommed/pommed-1.31/gpomme/themes/Tango/kbdlight.png new file mode 100644 index 0000000..1ea0035 Binary files /dev/null and b/app-laptop/pommed/pommed-1.31/gpomme/themes/Tango/kbdlight.png differ diff --git a/app-laptop/pommed/pommed-1.31/gpomme/themes/Tango/mute.png b/app-laptop/pommed/pommed-1.31/gpomme/themes/Tango/mute.png new file mode 100644 index 0000000..c90750e Binary files /dev/null and b/app-laptop/pommed/pommed-1.31/gpomme/themes/Tango/mute.png differ diff --git a/app-laptop/pommed/pommed-1.31/gpomme/themes/Tango/noaudio.png b/app-laptop/pommed/pommed-1.31/gpomme/themes/Tango/noaudio.png new file mode 100644 index 0000000..c90750e Binary files /dev/null and b/app-laptop/pommed/pommed-1.31/gpomme/themes/Tango/noaudio.png differ diff --git a/app-laptop/pommed/pommed-1.31/gpomme/themes/Tango/src/background.svg b/app-laptop/pommed/pommed-1.31/gpomme/themes/Tango/src/background.svg new file mode 100644 index 0000000..6560a76 --- /dev/null +++ b/app-laptop/pommed/pommed-1.31/gpomme/themes/Tango/src/background.svg @@ -0,0 +1,70 @@ + + + + + + + + + image/svg+xml + + + + + + + + diff --git a/app-laptop/pommed/pommed-1.31/gpomme/themes/Tango/src/brightness.svg b/app-laptop/pommed/pommed-1.31/gpomme/themes/Tango/src/brightness.svg new file mode 100644 index 0000000..97ea133 --- /dev/null +++ b/app-laptop/pommed/pommed-1.31/gpomme/themes/Tango/src/brightness.svg @@ -0,0 +1,487 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + image/svg+xml + + Video Display + + + + Jakub Steiner + + + + + video + display + monitor + LCD + CRT + + + + http://jimmac.musichall.cz/ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/app-laptop/pommed/pommed-1.31/gpomme/themes/Tango/src/cdrom.svg b/app-laptop/pommed/pommed-1.31/gpomme/themes/Tango/src/cdrom.svg new file mode 100644 index 0000000..e21643f --- /dev/null +++ b/app-laptop/pommed/pommed-1.31/gpomme/themes/Tango/src/cdrom.svg @@ -0,0 +1,720 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + image/svg+xml + + Media CD-ROM + + + Jakub Steiner + + + http://jimmac.musichall.cz + + + cdrom + media + removable + cd + audio + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/app-laptop/pommed/pommed-1.31/gpomme/themes/Tango/src/kbdlight.svg b/app-laptop/pommed/pommed-1.31/gpomme/themes/Tango/src/kbdlight.svg new file mode 100644 index 0000000..64774ad --- /dev/null +++ b/app-laptop/pommed/pommed-1.31/gpomme/themes/Tango/src/kbdlight.svg @@ -0,0 +1,836 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + image/svg+xml + + Input - Keyboard + + + + Jakub Steiner + + + + + input + keyboard + keys + peripheral + HID + + + + http://jimmac.musichall.cz/ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/app-laptop/pommed/pommed-1.31/gpomme/themes/Tango/src/mute.svg b/app-laptop/pommed/pommed-1.31/gpomme/themes/Tango/src/mute.svg new file mode 100644 index 0000000..3e8d570 --- /dev/null +++ b/app-laptop/pommed/pommed-1.31/gpomme/themes/Tango/src/mute.svg @@ -0,0 +1,991 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + image/svg+xml + + Volume - Muted + + + Jakub Steiner + + + + + Lapo Calamandrei + + + + + + http://www.tango-project.org + + + + + volume + sound + level + none + mute + muted + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/app-laptop/pommed/pommed-1.31/gpomme/themes/Tango/src/noaudio.svg b/app-laptop/pommed/pommed-1.31/gpomme/themes/Tango/src/noaudio.svg new file mode 100644 index 0000000..3e8d570 --- /dev/null +++ b/app-laptop/pommed/pommed-1.31/gpomme/themes/Tango/src/noaudio.svg @@ -0,0 +1,991 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + image/svg+xml + + Volume - Muted + + + Jakub Steiner + + + + + Lapo Calamandrei + + + + + + http://www.tango-project.org + + + + + volume + sound + level + none + mute + muted + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/app-laptop/pommed/pommed-1.31/gpomme/themes/Tango/src/volume.svg b/app-laptop/pommed/pommed-1.31/gpomme/themes/Tango/src/volume.svg new file mode 100644 index 0000000..c8b4202 --- /dev/null +++ b/app-laptop/pommed/pommed-1.31/gpomme/themes/Tango/src/volume.svg @@ -0,0 +1,643 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + image/svg+xml + + Volume - High + + + Jakub Steiner + + + + + Lapo Calamandrei + + + + + + http://www.tango-project.org + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/app-laptop/pommed/pommed-1.31/gpomme/themes/Tango/volume.png b/app-laptop/pommed/pommed-1.31/gpomme/themes/Tango/volume.png new file mode 100644 index 0000000..add8396 Binary files /dev/null and b/app-laptop/pommed/pommed-1.31/gpomme/themes/Tango/volume.png differ diff --git a/app-laptop/pommed/pommed-1.31/gpomme/themes/elegant-bright/background.png b/app-laptop/pommed/pommed-1.31/gpomme/themes/elegant-bright/background.png new file mode 100644 index 0000000..12f1315 Binary files /dev/null and b/app-laptop/pommed/pommed-1.31/gpomme/themes/elegant-bright/background.png differ diff --git a/app-laptop/pommed/pommed-1.31/gpomme/themes/elegant-bright/brightness.png b/app-laptop/pommed/pommed-1.31/gpomme/themes/elegant-bright/brightness.png new file mode 100644 index 0000000..16ab60c Binary files /dev/null and b/app-laptop/pommed/pommed-1.31/gpomme/themes/elegant-bright/brightness.png differ diff --git a/app-laptop/pommed/pommed-1.31/gpomme/themes/elegant-bright/cdrom.png b/app-laptop/pommed/pommed-1.31/gpomme/themes/elegant-bright/cdrom.png new file mode 100644 index 0000000..8cada42 Binary files /dev/null and b/app-laptop/pommed/pommed-1.31/gpomme/themes/elegant-bright/cdrom.png differ diff --git a/app-laptop/pommed/pommed-1.31/gpomme/themes/elegant-bright/kbdlight.png b/app-laptop/pommed/pommed-1.31/gpomme/themes/elegant-bright/kbdlight.png new file mode 100644 index 0000000..9b9dcb9 Binary files /dev/null and b/app-laptop/pommed/pommed-1.31/gpomme/themes/elegant-bright/kbdlight.png differ diff --git a/app-laptop/pommed/pommed-1.31/gpomme/themes/elegant-bright/mute.png b/app-laptop/pommed/pommed-1.31/gpomme/themes/elegant-bright/mute.png new file mode 100644 index 0000000..34785ed Binary files /dev/null and b/app-laptop/pommed/pommed-1.31/gpomme/themes/elegant-bright/mute.png differ diff --git a/app-laptop/pommed/pommed-1.31/gpomme/themes/elegant-bright/noaudio.png b/app-laptop/pommed/pommed-1.31/gpomme/themes/elegant-bright/noaudio.png new file mode 100644 index 0000000..34785ed Binary files /dev/null and b/app-laptop/pommed/pommed-1.31/gpomme/themes/elegant-bright/noaudio.png differ diff --git a/app-laptop/pommed/pommed-1.31/gpomme/themes/elegant-bright/src/background.svg b/app-laptop/pommed/pommed-1.31/gpomme/themes/elegant-bright/src/background.svg new file mode 100644 index 0000000..6560a76 --- /dev/null +++ b/app-laptop/pommed/pommed-1.31/gpomme/themes/elegant-bright/src/background.svg @@ -0,0 +1,70 @@ + + + + + + + + + image/svg+xml + + + + + + + + diff --git a/app-laptop/pommed/pommed-1.31/gpomme/themes/elegant-bright/src/brightness.svg b/app-laptop/pommed/pommed-1.31/gpomme/themes/elegant-bright/src/brightness.svg new file mode 100644 index 0000000..e09aaa4 --- /dev/null +++ b/app-laptop/pommed/pommed-1.31/gpomme/themes/elegant-bright/src/brightness.svg @@ -0,0 +1,377 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + image/svg+xml + + + + + + + + + + + + + + + + diff --git a/app-laptop/pommed/pommed-1.31/gpomme/themes/elegant-bright/src/cdrom.svg b/app-laptop/pommed/pommed-1.31/gpomme/themes/elegant-bright/src/cdrom.svg new file mode 100644 index 0000000..384ad2c --- /dev/null +++ b/app-laptop/pommed/pommed-1.31/gpomme/themes/elegant-bright/src/cdrom.svg @@ -0,0 +1,165 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + image/svg+xml + + + + + + + + + diff --git a/app-laptop/pommed/pommed-1.31/gpomme/themes/elegant-bright/src/kbdlight.svg b/app-laptop/pommed/pommed-1.31/gpomme/themes/elegant-bright/src/kbdlight.svg new file mode 100644 index 0000000..539cb57 --- /dev/null +++ b/app-laptop/pommed/pommed-1.31/gpomme/themes/elegant-bright/src/kbdlight.svg @@ -0,0 +1,276 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + image/svg+xml + + + + + + + + + + + + + diff --git a/app-laptop/pommed/pommed-1.31/gpomme/themes/elegant-bright/src/mute.svg b/app-laptop/pommed/pommed-1.31/gpomme/themes/elegant-bright/src/mute.svg new file mode 100644 index 0000000..1c63fd3 --- /dev/null +++ b/app-laptop/pommed/pommed-1.31/gpomme/themes/elegant-bright/src/mute.svg @@ -0,0 +1,219 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + image/svg+xml + + + + + + + + diff --git a/app-laptop/pommed/pommed-1.31/gpomme/themes/elegant-bright/src/volume.svg b/app-laptop/pommed/pommed-1.31/gpomme/themes/elegant-bright/src/volume.svg new file mode 100644 index 0000000..84eeeea --- /dev/null +++ b/app-laptop/pommed/pommed-1.31/gpomme/themes/elegant-bright/src/volume.svg @@ -0,0 +1,264 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + image/svg+xml + + + + + + + + + + + + + diff --git a/app-laptop/pommed/pommed-1.31/gpomme/themes/elegant-bright/volume.png b/app-laptop/pommed/pommed-1.31/gpomme/themes/elegant-bright/volume.png new file mode 100644 index 0000000..ca51673 Binary files /dev/null and b/app-laptop/pommed/pommed-1.31/gpomme/themes/elegant-bright/volume.png differ diff --git a/app-laptop/pommed/pommed-1.31/gpomme/themes/elegant-dark/background.png b/app-laptop/pommed/pommed-1.31/gpomme/themes/elegant-dark/background.png new file mode 100644 index 0000000..12f1315 Binary files /dev/null and b/app-laptop/pommed/pommed-1.31/gpomme/themes/elegant-dark/background.png differ diff --git a/app-laptop/pommed/pommed-1.31/gpomme/themes/elegant-dark/brightness.png b/app-laptop/pommed/pommed-1.31/gpomme/themes/elegant-dark/brightness.png new file mode 100644 index 0000000..dd6b110 Binary files /dev/null and b/app-laptop/pommed/pommed-1.31/gpomme/themes/elegant-dark/brightness.png differ diff --git a/app-laptop/pommed/pommed-1.31/gpomme/themes/elegant-dark/cdrom.png b/app-laptop/pommed/pommed-1.31/gpomme/themes/elegant-dark/cdrom.png new file mode 100644 index 0000000..29806b8 Binary files /dev/null and b/app-laptop/pommed/pommed-1.31/gpomme/themes/elegant-dark/cdrom.png differ diff --git a/app-laptop/pommed/pommed-1.31/gpomme/themes/elegant-dark/kbdlight.png b/app-laptop/pommed/pommed-1.31/gpomme/themes/elegant-dark/kbdlight.png new file mode 100644 index 0000000..6fab0fd Binary files /dev/null and b/app-laptop/pommed/pommed-1.31/gpomme/themes/elegant-dark/kbdlight.png differ diff --git a/app-laptop/pommed/pommed-1.31/gpomme/themes/elegant-dark/mute.png b/app-laptop/pommed/pommed-1.31/gpomme/themes/elegant-dark/mute.png new file mode 100644 index 0000000..3572ad8 Binary files /dev/null and b/app-laptop/pommed/pommed-1.31/gpomme/themes/elegant-dark/mute.png differ diff --git a/app-laptop/pommed/pommed-1.31/gpomme/themes/elegant-dark/noaudio.png b/app-laptop/pommed/pommed-1.31/gpomme/themes/elegant-dark/noaudio.png new file mode 100644 index 0000000..3572ad8 Binary files /dev/null and b/app-laptop/pommed/pommed-1.31/gpomme/themes/elegant-dark/noaudio.png differ diff --git a/app-laptop/pommed/pommed-1.31/gpomme/themes/elegant-dark/src/background.svg b/app-laptop/pommed/pommed-1.31/gpomme/themes/elegant-dark/src/background.svg new file mode 100644 index 0000000..6560a76 --- /dev/null +++ b/app-laptop/pommed/pommed-1.31/gpomme/themes/elegant-dark/src/background.svg @@ -0,0 +1,70 @@ + + + + + + + + + image/svg+xml + + + + + + + + diff --git a/app-laptop/pommed/pommed-1.31/gpomme/themes/elegant-dark/src/brightness.svg b/app-laptop/pommed/pommed-1.31/gpomme/themes/elegant-dark/src/brightness.svg new file mode 100644 index 0000000..bd51cd4 --- /dev/null +++ b/app-laptop/pommed/pommed-1.31/gpomme/themes/elegant-dark/src/brightness.svg @@ -0,0 +1,377 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + image/svg+xml + + + + + + + + + + + + + + + + diff --git a/app-laptop/pommed/pommed-1.31/gpomme/themes/elegant-dark/src/cdrom.svg b/app-laptop/pommed/pommed-1.31/gpomme/themes/elegant-dark/src/cdrom.svg new file mode 100644 index 0000000..c97c65d --- /dev/null +++ b/app-laptop/pommed/pommed-1.31/gpomme/themes/elegant-dark/src/cdrom.svg @@ -0,0 +1,165 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + image/svg+xml + + + + + + + + + diff --git a/app-laptop/pommed/pommed-1.31/gpomme/themes/elegant-dark/src/kbdlight.svg b/app-laptop/pommed/pommed-1.31/gpomme/themes/elegant-dark/src/kbdlight.svg new file mode 100644 index 0000000..7b66304 --- /dev/null +++ b/app-laptop/pommed/pommed-1.31/gpomme/themes/elegant-dark/src/kbdlight.svg @@ -0,0 +1,265 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + image/svg+xml + + + + + + + + + + + + + diff --git a/app-laptop/pommed/pommed-1.31/gpomme/themes/elegant-dark/src/mute.svg b/app-laptop/pommed/pommed-1.31/gpomme/themes/elegant-dark/src/mute.svg new file mode 100644 index 0000000..9315da7 --- /dev/null +++ b/app-laptop/pommed/pommed-1.31/gpomme/themes/elegant-dark/src/mute.svg @@ -0,0 +1,219 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + image/svg+xml + + + + + + + + diff --git a/app-laptop/pommed/pommed-1.31/gpomme/themes/elegant-dark/src/volume.svg b/app-laptop/pommed/pommed-1.31/gpomme/themes/elegant-dark/src/volume.svg new file mode 100644 index 0000000..ee437f3 --- /dev/null +++ b/app-laptop/pommed/pommed-1.31/gpomme/themes/elegant-dark/src/volume.svg @@ -0,0 +1,264 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + image/svg+xml + + + + + + + + + + + + + diff --git a/app-laptop/pommed/pommed-1.31/gpomme/themes/elegant-dark/volume.png b/app-laptop/pommed/pommed-1.31/gpomme/themes/elegant-dark/volume.png new file mode 100644 index 0000000..b89d7eb Binary files /dev/null and b/app-laptop/pommed/pommed-1.31/gpomme/themes/elegant-dark/volume.png differ diff --git a/app-laptop/pommed/pommed-1.31/icons/gpomme.svg b/app-laptop/pommed/pommed-1.31/icons/gpomme.svg new file mode 100644 index 0000000..caa9d88 --- /dev/null +++ b/app-laptop/pommed/pommed-1.31/icons/gpomme.svg @@ -0,0 +1,330 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + image/svg+xml + + + + + Jan Larres + + + + + Macbook + Macbook Pro + Apple + Keys + + + gpomme configuration client + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/app-laptop/pommed/pommed-1.31/icons/gpomme_128x128.png b/app-laptop/pommed/pommed-1.31/icons/gpomme_128x128.png new file mode 100644 index 0000000..9b1981b Binary files /dev/null and b/app-laptop/pommed/pommed-1.31/icons/gpomme_128x128.png differ diff --git a/app-laptop/pommed/pommed-1.31/icons/gpomme_128x128.xpm b/app-laptop/pommed/pommed-1.31/icons/gpomme_128x128.xpm new file mode 100644 index 0000000..14e648b --- /dev/null +++ b/app-laptop/pommed/pommed-1.31/icons/gpomme_128x128.xpm @@ -0,0 +1,215 @@ +/* XPM */ +static char *gpomme_128x128[] = { +/* columns rows colors chars-per-pixel */ +"128 128 81 1", +" c #2E3436", +". c #303638", +"X c #33393B", +"o c #383D3E", +"O c #383E40", +"+ c #3D4244", +"@ c #404647", +"# c #424749", +"$ c #454A4B", +"% c #484D4E", +"& c #494E50", +"* c #4C5152", +"= c #545653", +"- c #565854", +"; c #565A5A", +": c #595B57", +"> c #5A5D5D", +", c #5A5E60", +"< c #5C605D", +"1 c #5C6161", +"2 c #60625E", +"3 c #626461", +"4 c #666864", +"5 c #666A6A", +"6 c #686B66", +"7 c #696D6D", +"8 c #6F726D", +"9 c #6E7271", +"0 c #717574", +"q c #767873", +"w c #777B7B", +"e c #7A7C7A", +"r c #7F817E", +"t c #7E8281", +"y c #81837F", +"u c #838684", +"i c #848886", +"p c #868988", +"a c #898B86", +"s c #8A8D89", +"d c #8E9190", +"f c #91938E", +"g c #919492", +"h c #979A97", +"j c #989A98", +"k c #9DA09D", +"l c #A0A09B", +"z c #A4A5A0", +"x c #A7A8A4", +"c c #AAAAA5", +"v c #ACADA9", +"b c #AEB0AD", +"n c #B1B2AD", +"m c #B4B5B1", +"M c #B6B9B3", +"N c #B9BCB5", +"B c #BCBDB9", +"V c #BEC0BC", +"C c #C0C2BC", +"Z c #C4C5C2", +"A c #C6C8C3", +"S c #C8CBC5", +"D c #CCCDC9", +"F c #CED0CB", +"G c #D3D3CE", +"H c #D5D6D0", +"J c #D6D8D4", +"K c #D9D9D4", +"L c #DDDDD9", +"P c #DEE0DC", +"I c #E1E1DD", +"U c #E5E5E2", +"Y c #E6E8E5", +"T c #E8E8E6", +"R c #EBEBE9", +"E c #EFF0EE", +"W c #F0F1EF", +"Q c #F5F6F4", +"! c #F8F8F7", +"~ c gray100", +"^ c None", +/* pixels */ +"^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^", +"^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^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+"^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^", +"^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^", +"^^^^^^^^^^^^^^^^^==============================================================================================^^^^^^^^^^^^^^^^^", +"^^^^^^^^^^^^===============-============================-======================================================-===^^^^^^^^^^^^^", +"^^^^^^^^^^^====-====--=====-====--=================-====--=====-===-===-===-===-======--===========-=====-=====-=====^^^^^^^^^^^", +"^^^^^^^^^=====--2qusssssssssssssssssssssssssssssssssssaafssssssssssssssssssssssssssssssasssssssssssssssssssssy8:=-====^^^^^^^^^^", +"^^^^^^^^=====6lSPKGDSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSACADDDZZDSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSDFGPHCf:=====^^^^^^^^", +"^^^^^^^==== +KKKKKLKKKKJJJAMJZ===^^^^", +"^^^^==3LCNGKHKKKKKKKKKKK: yKKKKKKKKKKKKKKKKKKG2 .yKKKKKKKKKKKKKKKKKKKKKKKKKKKCX. 8KKKKKKKKKKKKKKK: @KKKKKKKKKJJJJANGZ===^^^^", +"^^^^==6IDBHKKKKKKKKKKKKKN+ yKKKKKKKKZ88qKKKKKKKKG2 2CKKKKKKKKKKKKKKKKKKKKKKKKKKKCo .8KKKKKKKKKKKKKKK2 .+KKKKKKKKKKJJJANJZ===^^^^", +"^^^^==3LCNHKKKHKKKKKKKKKKNyKKKKKKKKKn XHKKKKKKKGGqCIKKKKKKHKKKKKKKKKKKGKKKKKKKKHyyyzKKKKKKKKKKKKKKKjyyfKKKKHKKKKKJJJAMJZ===^^^^", +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!QEERNNNNNNNNNMNNNNNNNBNNNNNNNNNNNBNNNVMNNNNNNNNNNNNNNCNNNNNNNCNNNNNNNCCNNNNNNCVMMNNNNNNNNNNNNNNNNNNNNSEEQQQU:===^^^^^", +"^^^^^===;MQ!!QJNNNNNNNNNBNNNNNNNNNNNNNNNNNNNBMNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNCMNNNNNNnVVMNNNNNNNNNNNNNNNNNNNNNEQQQQe===^^^^^^", +"^^^^^^==*;LQQQYSNNNNNNNNMBNNNNNNNNNNNNNNNNNNNNNNVNNNNNNNNNNNNNNMNNNNNNNNNNNNNNNNnCMNNNNNVVnVNNNNNNNNNNNNNNNNNNMVFEQQQv====^^^^^^", +"^^^^^^^=--;MQQPLLGSZCCCCCCVVCCCCCCCCCCCCCCCCCCCCCCCVCCCCCCCVCCVVCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCZDHLPYQEs====^^^^^^^", +"^^^^^^^=====uJLPPPPPPPLPLPPPPPPPLPLPLPPPKPPKLPLPLPPPKPPPLPLPLPPPPLPPLPPPPPPPLPPPPKPPLPPPPPPPPPPPPPPPPKPPLPLKPPPPPPF2====^^^^^^^^", +"^^^^^^^^=====-evSHPLLLPLPLPPKPPKPPPLPLPPPPPPPPPLPLPPPPPKPPPLPLPPKPLPPLPPPPKPPLPPPPPPPLPPPKPPPKPPPPPPPPPPPPPPPPHCj6--===^^^^^^^^^", +"^^^^^^^^^^========-<3323<33233<32332<32323<33223<33233<32332<23233232222<223<2222322<222<3232222<22222<22322<-====--==^^^^^^^^^^", +"^^^^^^^^^^^=======--==-=====-=====-===-=-=====-===-=-=====-===--====--==--=---==--=---==--==--====--:====--=========^^^^^^^^^^^^", +"^^^^^^^^^^^^^===========================================================-===========================-=============^^^^^^^^^^^^^^", +"^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^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^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^", +"^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^", +"^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^" +}; diff --git a/app-laptop/pommed/pommed-1.31/icons/gpomme_16x16.png b/app-laptop/pommed/pommed-1.31/icons/gpomme_16x16.png new file mode 100644 index 0000000..9eb9040 Binary files /dev/null and b/app-laptop/pommed/pommed-1.31/icons/gpomme_16x16.png differ diff --git a/app-laptop/pommed/pommed-1.31/icons/gpomme_16x16.xpm b/app-laptop/pommed/pommed-1.31/icons/gpomme_16x16.xpm new file mode 100644 index 0000000..021547d --- /dev/null +++ b/app-laptop/pommed/pommed-1.31/icons/gpomme_16x16.xpm @@ -0,0 +1,40 @@ +/* XPM */ +static char *gpomme_16x16[] = { +/* columns rows colors chars-per-pixel */ +"16 16 18 1", +" c black", +". c #2E3436", +"X c #555753", +"o c #70726D", +"O c #888A85", +"+ c #BABDB6", +"@ c #C0C2BD", +"# c #D5D5CF", +"$ c #D8D8D2", +"% c #DADAD6", +"& c #DDDDD9", +"* c #E0E0DC", +"= c #E3E3E0", +"- c #E6E6E3", +"; c #E9E9E6", +": c #ECECE9", +"> c #EEEEEC", +", c None", +/* pixels */ +",,,,,,,,,,,,,,,,", +"oOOOOOOOOOOOOOOo", +"O@@@@@@@@@@@@@@O", +"O@::::::::::::@O", +"O@;;;;;;;;;;;;@O", +"O@>----..-..->@O", +"O@>=.==.===.=>@O", +"O@>.*.*..**.*>@O", +"O@>&.&&.&&&.&>@O", +"O@>%%%%.%%%.%>@O", +"O@>$$$$$$$$$$>@O", +"O@>##########>@O", +"O@>>>>>>>>>>>>@O", +"O@++++++++++++@O", +"oOOOOOOOOOOOOOOo", +",,,,,,,,,,,,,,,," +}; diff --git a/app-laptop/pommed/pommed-1.31/icons/gpomme_192x192.png b/app-laptop/pommed/pommed-1.31/icons/gpomme_192x192.png new file mode 100644 index 0000000..0c874f0 Binary files /dev/null and b/app-laptop/pommed/pommed-1.31/icons/gpomme_192x192.png differ diff --git a/app-laptop/pommed/pommed-1.31/icons/gpomme_192x192.xpm b/app-laptop/pommed/pommed-1.31/icons/gpomme_192x192.xpm new file mode 100644 index 0000000..4608bac --- /dev/null +++ b/app-laptop/pommed/pommed-1.31/icons/gpomme_192x192.xpm @@ -0,0 +1,282 @@ +/* XPM */ +static char *gpomme_192x192[] = { +/* columns rows colors chars-per-pixel */ +"192 192 84 1", +" c #2E3436", +". c #303638", +"X c #353B3C", +"o c #383E3F", +"O c #383E40", +"+ c #3D4244", +"@ c #404547", +"# c #424748", +"$ c #454A4B", +"% c #484D4E", +"& c #494E50", +"* c #4D5153", +"= c #545653", +"- c #525758", +"; c #565854", +": c #555A5A", +"> c #585A56", +", c #595D5C", +"< c #5B5F60", +"1 c #5F615D", +"2 c #5E6363", +"3 c #60625E", +"4 c #636562", +"5 c #666864", +"6 c #666A6A", +"7 c #686A66", +"8 c #6A6D69", +"9 c #6C706F", +"0 c #6D7171", +"q c #70726E", +"w c #717574", +"e c #757978", +"r c #787B76", +"t c #797D7C", +"y c #7D807E", +"u c #7E8180", +"i c #80837E", +"p c #828483", +"a c #858882", +"s c #858888", +"d c #8A8C8B", +"f c #8E908E", +"g c #8E9190", +"h c #939593", +"j c #969896", +"k c #999A96", +"l c #9A9C9A", +"z c #9EA09D", +"x c #A0A09B", +"c c #A4A5A1", +"v c #A6A8A3", +"b c #A7A9A8", +"n c #A9A9A5", +"m c #ACADA9", +"M c #AEB0AB", +"N c #B1B1AD", +"B c #B4B5B1", +"V c #B6B8B3", +"C c #B9BCB5", +"Z c #BCBDB9", +"A c #BEC0BA", +"S c #C1C3BD", +"D c #C6C6C2", +"F c #C6C8C3", +"G c #C9C9C5", +"H c #CCCDC9", +"J c #CED0CB", +"K c #D3D3CD", +"L c #D5D5D0", +"P c #D6D8D4", +"I c #D9D9D4", +"U c #DDDED9", +"Y c #DFE0DD", +"T c #E1E1DD", +"R c #E5E5E2", +"E c #E7E8E6", +"W c #E8E8E6", +"Q c #EBEBE9", +"! c #EFF0EE", +"~ c #F0F0EF", +"^ c #F5F5F4", +"/ c #F8F8F7", +"( c gray100", +") c None", +/* pixels */ +"))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))", +"))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))", +"))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))", +"))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))", +"))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))", +"))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))", +"))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))", +"))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))", +"))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))", +"))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))", +"))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))", +"))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))", +"))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))", +"))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))", +"))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))", +"))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))", +"))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))", +"))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))", +"))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))", +"))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))", +"))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))", +"))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))", +"))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))", +"))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))", +"))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))", +"))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))", +"))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))", +"))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))", +"))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))", +"))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))", +"))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))", +"))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))", +"))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))", +"))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))", +"))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))", +"))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))", +"))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))", +"))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))", +"))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))", +"))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))", +"))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))", +")))))))))))))))))))))))))=====================================>===========================>=================================================>=>=======================))))))))))))))))))))))))))", +"))))))))))))))))))))========================================================================================================================;==============================)))))))))))))))))))))", +"))))))))))))))))))============================================================================================================================================================))))))))))))))))))", +"))))))))))))))))===============================================================================>================================================================================))))))))))))))))", +"))))))))))))))===============>==============================>>===========================>=====>===========================-================>>===================================)))))))))))))))", +")))))))))))))=========7fMAGLTTIIUUIUUUIYUUYIIYIIUUUYUUYIIYIIIIIIUIUUUYIIYUUYIUYUUUYIIYIIIUIIIIIIIUIUUUUUUUUUUUUUUUUUUUUUUUUUUUUIIYYYIYYIYYIIIIIIIYIYYIYIIIUUUUUUUIUPJSVzr1========))))))))))))))", +"))))))))))))=======1iAJYYYLJSSSSASAAASAAAASAASASAAAAAAASAASSSSSSAAAAAASAAAAAAAAAAASAASASSSSSSSSSASASAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAASAASSSSAAAAASAASSASAAAASSFJLIYYIGx5=======)))))))))))))", +")))))))))))=======rCPYUPSSCCNmvvvvxnxmnxvvvvvvvvvvvxvvvvvvvvvvvvvvvvmxmxmnxmxmxmnvvvvvvvvvvvnnvvvvvvvvnnvvvvvvvnvvvcnxnnnxnnxnnxnvvvvvvvvvvvnvvvvvvvvvvnvvvvvvnvnmMVSCSJITYJk3>>====))))))))))))", +"))))))))))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W- .ORRWWRWRWRWRWRWZo>IWRRWRWRWWWRWRWRWRWWRRWRWRWRWRWRWWWRWRWWRWRWRWRWRWRRWRWRWEEWRWRRWRWWRWRWRWWWRWWRWREWRRWRWRWRWRWBNNNAAAYI8====))))))", +"))))))====BUHZZNNBBKRRRRRRRRRRRRRWRRR0 .bWRWRRRRRWRRRRu666wRRRRRWRWRRRRRCo >URRRRRRRRRWRRWRRRRRRWRRWRWRRWRRRWRWRWRRRRRRnrttttttettettttteDRRRRsuuuuuttuttdRRRRRRRRRRRRRRRRBNBNCCAYY3====))))))", +"))))))====BTHZZBNBBLRRRRRRRRRWRWRRRR0 .bWRRRRRRRRRWWRRRWRRWRWRRRRWRRRZo 1TWRRWRWRWRRRRRRWRRRRRRRRRRRRRRRRRRRRRRWRRWi bRWRRO &REERRRRRRRRRRWRRBBNBVCAYY8====))))))", +"))))))==;=BTKBZBBBBLRRRWRRRRRRRRRRWRh .bRRRWWRRRRRRRRWRRRRRRRRRRRRRZo iRRRRRRRRRRRRRWRRRRRWRRRRRRRWRRRRRRRRRRWRRRi nRWRRO &RRRRWRRRRRRRRRRWZBBBCCAYY8====))))))", +"))))))==;;BIKZZBBBBLRRRRRRRRRRRRRRRRRh ..bWRRRRRRRRRRRRRTRRRRRRRRRRZX iRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRi nRRRRO &RRRRRRRRRRRRRRRRBBBBVCAYI8====))))))", +"))))))====BTHZZBBBBLRRRRRRRRRRRRRRRTRRh .ZTRTRRRRRRRRRRRRRRRRRRRRGX uRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRu . bRRRRO &RRRRRRRRRRRRRRRRZBBBCCAII8====))))))", +"))))))====BTKZZBBZBLRRRRRRRRRRRRRRRRRREh 6TRRRRRRRRRRRRRRRRRRRRRRRRi yRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRu XIIIIIIIIIIIITRRRRUIIYYY0 &RRRRRRRRRRRRRRRRZBBZCCAYY8====))))))", +"))))))==;=BIHZZBZBZLRRRRTRTRRRRTRRRRRRRRh 6RRRRRRRRRRRHbgbHTRRRRRRRRRRu yRRRRRTRTRRRRRRRRRRRRRRRRRRRRRRRRRTRTRRRRRRRRRRu ORRRRRRRRTRRRRRRRRRRRRTRw &RRRRRRRRRRRRTRRRZBZBCCAIY8====))))))", +"))))))==;>BTHZZZBZBLRRTRRRRRRTRRRTRRTRTRRh0TRRRRRTRId4+ O===))))))", +"))))))====VUJCCKLLLLIIIIIIIIIIIIIIIIBX rIIIIIIIIIIUIUIIIIIIIIIIIIIIf .cIIIIIIIIIIIITIIIIIIITIIITIIIIIIIIIIIIIIIIIr OIIITIIIIIIIIIIIIIIUIIII8 %IIIIIIIIIIIIIIIIPKPLAAAYY7====))))))", +"))))))====VUJCCKILIIIIIIIIIIIIIIIIII= rIIIIIIIIIIIIIIIIIIUIIIIIIIIIIk #KIIIIIIIIIIIIIIIIIIIIIIIIITIIIIIIIIIIIIIIIt OIIIIIIIIIIIIIIIIIIIIIIIq %IIIIIIIIIIIIPIIIPPLLAAAUY7====))))))", +"))))))====VUJACJLLLIIIIIIIIIIIIIIIIIG% iIIIIIIIIIUIIIxggghIIIIIIIIIIIITi +SIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIt OIIIIIIIIIIIIIIIIIIIIIII8 %IIIIIIIIIIIIUIIPPLLKAAAYY7====))))))", +"))))))====BUJZZKIIILILIIILLIIIIIIIIIKD= rIIIILIIIIKIKIK% oIKIIIIIILIIILIf +ZIIKIIIIKIIIKIIIIIIKIIIIIIIIIIIIIIIIIIIIIIIIr .OIIILIILIIIIIIIIIIIILIII8 %IIILIIIIIIIIIILILIIIAAAIY8====))))))", +"))))))====VYJBZLIIIIIIIIIIIIILLIIKIIIIGaLIILIIIIIIIIIII= oIIIIIIILIIIIIILkZIIIIIIIIIIKIIIIIIKIIIIIIKIIIKIIIIKIIIIIILILLDNNNBNIIIIIIIIILIILILLILIIILIDBNBBBIIIIIIIIIILIILIIIILIAAAYU8====))))))", +"))))))====BYJZZKIIIIIIIIIILIIIIIIIIIIIKIIIIIIIIIIIIIIIK= oIIIIIIIIIIIIIILIIIIIIIIIIIIIIIIIIIKIIIIKIIIIIIIIIIIIIIIIIILIIIIILIIIILIIIIIIIIIIIIIIIIIIIIIILIIIIIIIIIIIILIIIIIIIIIISAAIY8====))))))", +"))))))====BYJZZLIIIILILLLIILLLILIIKIIIIIKIIKIKILIKIIKIK= oIKKIILILLILLLIILLLILIKIIIKIIKIIKKIIIKIIIIKKIIKKIIKIKLILLILIILILIIIIIILILLILLLLILILLIILILILLLILLIILILLILLIILLLILITIIIAAAYU8====))))))", +"))))))====VUKZVLYIIPLIIIILILIILIIIKLIIIIIIKIILLIIIIKILI= oIKIILIILILLILILIIILIIKIKIKIKIIIKIIIIIIIIIIIIIIIKIIKIILILILLIILLILIILLILIILILIILIILILLILILILLIILIILIILIILILLILILIIIIUSAAYY8====))))))", +"))))))====VUHZZLIYYPILLIIILIILILLIIIKIKIIKIIIIIIKIIILII= oIIILILLIIIIIILILILILIIIIIIIIIKIIKIKIIKIKKIKIIKIIKIIILIILLIILLIILILLIILILIILIILILLILIILLLIIILIIILLIILLILILIIIILIIUUUUAAAIY8====))))))", +"))))))===-VUKZZIYIYPLLLLLLLILILLKIKIIKIKIKILKIKLIIKIILK= oIKIKLLLLLLILLLLILILLIKIIKIKIKKIKIIKIIKIKKIIKIKKIKIIKLLIIILIILILILLLILILLLLLLLILILLLLLLLLLLLIILLLILLLLLLLLLILLLLLIUUUSAAYY3====))))))", +"))))))===-VUHZBIYYYLLIILILLILLLIIKIIKIKIKIKIIKILKKIKLLK= oKILILIILLLLLLILILLLIKIKKIKIIIIKIKIIKIIKIIKIIKIIKIIKIILLLLLLLLLLILILLLILILLILLLLLLILILILLLILLLLLILLILLILIILLLLILLTUTUAAAYY8====))))))", +"))))))====BYHZZLUTTILLLLLLLLILLLLLILLIIKLIIKKIILIKLLILLmxnxnLLIKKIKIILLLLLILLLLIIKIKKIIKKKIKKIKIKKKIKIKKLLLLIIIKKIIKKIKILLLLLLLILLLLILLLLILLLLLLILIKLILLILLLLLLLLILILLLLLLLLTTTISAAYY7====))))))", +"))))))====BTHZZITTTILLLLLLLLLLLLLLLLLKKILKKIILKLIKLKLLLLLLLLLLLLKKILLLLLLLLLLLLLKKKIIKKKIIKIKKIKKIIKIKKILLLLKIKILLKIIKIKILLLLLLLLLLLLLLLLLLLLLLLLLLKLLLLLLLLLILLLLLLLLLLLLLLTTTTACAYY7====))))))", +"))))))====BUKZZLTTTILLLLLLLLLLLLLLLLLKLKLLIKKLLLKIKILLLLLLLLLLLLIKIKLLLLLLLLLLLLKIIKKKIIKIIKIKIKIIKIIKIKLLLLKIKKLLLLKLKILLLLIKLLLLLLLLLLLLLLLLLLLKIILLLLLLLLLLLLLLLLLLLLLLLITTTTACAYY8>===))))))", +"))))))===:BUHZBKTTTTLLLLLLLLLLLLLLLLKIKILLKKIKKLIKKLLLLLLLLKLLIKLLKLLLKILLLLLLKLIKKKKIKKKKKKIKKIKKKKKKIKLKLLIKKILLLLLLKILLLKKKIILKLLLLLLLLLLLLLKIIKKLLLLLKLLLLLLLLLLLLLLLLLIRTTTCCAUY3;===))))))", +"))))))====BYHZBHTYRYKLLLLKLKLKLLLLKKLLKLKLLKLLKLKLLLKLKLKLLLLKKLLLKLKKKKIKKILLKLKKIIKKKIKKIKKKIKKIKIKKKILKLLKLKLKLLKLLKKKKKKKKKKLKLLLLLKLLLKLLKLLKKLKKLLLLKKKLLKLLKLLHLLLLHYRYRYCCAUY8====))))))", +"))))))====BTHZZZRRRRILKLLLLLLLKLKLLLKKLLLKKLKLLLLLKLLLKLLLKLLLLLKLLLIKIKKLKKKLKLKIKKKIKKIKKKIKKKKKKKIKKKLLLKLLLLLKKLKLIKKKIKKIKILLLKKKLLLKLLKLLLLLLLLLLKLLLLLKLLLLKLLLLLLLLYYRRHCCAYU6====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KJKKKJKKKKPJPJKKKLKKKJKJLLLJJKKKKKPKJFPKKFKKKKKKKPKKKKKPKKKJKKKKKFKKKJKKKKPKPKJJKKKKKFPJKSKKKSKKKSKKKKKJPJKKJJKJKKKKKFKJKSKKKSJHAAMAAAA!!!!!//^^^t====))))))))", +")))))))=====y^/^/^!!!QJAAAAAAAAAZVZZCCCCCCCCCCCCCCCCCCCCZVCCCCZZCCCCAAAAAAMAAAANMAAAANAMMAAACCCCAAAAAACCAMAMABAACCCCAAAAAAMAAAAAAAAAAAANACCCAVAACCCCAAAAAAMAAAAAAAAAMAAAA!Q!!^/^//G=====))))))))", +"))))))))=====F^////~!!AAMAANAAANVZZVCCCCCCCCACCCCCCCCCCCZZCCCCCVCCCCAAMAAAAAAAAMAABAANAAAAAACCCCAAMAAACCAAAAAAABCCCCAAMAAAAAAAANAAMAAAANCCCCVAVACCCCAAMAAAAAAAAANBAAAAMAAI!!^^///Q8=====))))))))", +"))))))))=====;U~///^!WAAAAAMAVAACCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCVAAAAMAAAAAAAMAAMAAAAAMACCAAAMNAACAMMAAAAACCCCAAAAAAAAANAAAAAMMAAAAAAAAABACCCCAAAMAMAAAANNAAAAMAAAAS~//^/^^f=====)))))))))", +")))))))))=====9Q//^/^WSAAMAAVANACCACCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCVAAMAAAAAMAAMAAMAAAAMAMVACAAMAAAACCAAAAAMAMCACCMAMAAMAMAAANAMAAAANAMANAVANACACCNMAAAAAMNAAAMAAAAAAAAP^^^//~M=====))))))))))", +"))))))))))=====qT//^^YUIKAMAAACCCVCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCACAACCAAAAMAAAAAAAAAAAAAAAAAVAAAAAVAAAAAMAAAAAAAAAAAAAAAAAAMAAAAAAMAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAASKYY!^//^M======))))))))))", +"))))))))))====;;3Y^^~YUUUUUSJGSADDDASDAFSFSSFSSSSSSFFSSFADFAFADDFAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAASKSIYYYYW~^!z======)))))))))))", +")))))))))))=======mQQTYYUYUUUUUYYYYIYYYYYYYPYUUUYYUUYPYYYYIYYYIYYUUYPYYYPPYYYIYIYYYIIYYYYYIYYUUUPUUUUUUUYIYYYIYYIYYUYYYIYYUUUUIYUUUUUUUUYYYYYYYYIYYIYIYYUYUUYPYYYYYUUUUYUYT^Pq======))))))))))))", +"))))))))))))======;3kSIYYUUUUUUYYIYYPYPYIYYYUYUUYYYUYYYPYPYYIYIYUUYUYYYYYYIYYIYYIIYYYYPYIYYYUYUUUUUUUUUUYIYYYYYYIYYIUIYYIYUUYUYYUUUUUUUUIYIYIYYYIYYIYYYIUUUYYYYYYUUUUUUUUPnp=======)))))))))))))", +")))))))))))))=========7zCJPYUUUYIYYYYYYYYYYYUYUUYYPYYYYYYYYYYYYYYUUUYYYYYYYYYYIYYYYYYYYYYYYYYPYYUPIPPJUUYYYTYYYYYYYYYYIYYYYYUYYYUIUPPJUUYYYYYTYYYYYYYYYIYYUUYYYYYYUUILDMy>========))))))))))))))", +"))))))))))))))=============>46667555547571655555666277774545575565553755555577755555547571777773y1y>yy1y777333385755577755555555y>y>yy1y7735337757555777555537775251;-===========)))))))))))))))", +"))))))))))))))))========================;===============================================;===========@===============================@===========================================))))))))))))))))", +"))))))))))))))))))======================;===========================================================%===============================%=========================================))))))))))))))))))", +"))))))))))))))))))))=======================================================================================================================================================)))))))))))))))))))))", +")))))))))))))))))))))))))=============================================================================================================================================))))))))))))))))))))))))))", +"))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))", +"))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))", +"))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))", +"))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))", +"))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))", +"))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))", +"))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))", +"))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))", +"))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))", +"))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))", +"))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))", +"))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))", +"))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))", +"))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))", +"))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))", +"))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))", +"))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))", +"))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))", +"))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))", +"))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))", +"))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))", +"))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))", +"))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))", +"))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))", +"))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))", +"))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))", +"))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))", +"))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))", +"))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))", +"))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))", +"))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))", +"))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))", +"))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))", +"))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))", +"))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))", +"))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))", +"))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))", +"))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))", +"))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))", +"))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))" +}; diff --git a/app-laptop/pommed/pommed-1.31/icons/gpomme_22x22.png b/app-laptop/pommed/pommed-1.31/icons/gpomme_22x22.png new file mode 100644 index 0000000..42770fb Binary files /dev/null and b/app-laptop/pommed/pommed-1.31/icons/gpomme_22x22.png differ diff --git a/app-laptop/pommed/pommed-1.31/icons/gpomme_22x22.xpm b/app-laptop/pommed/pommed-1.31/icons/gpomme_22x22.xpm new file mode 100644 index 0000000..91b8988 --- /dev/null +++ b/app-laptop/pommed/pommed-1.31/icons/gpomme_22x22.xpm @@ -0,0 +1,75 @@ +/* XPM */ +static char *gpomme_22x22[] = { +/* columns rows colors chars-per-pixel */ +"22 22 47 1", +" c black", +". c #2E3436", +"X c #303537", +"o c #313738", +"O c #353A3C", +"+ c #363B3D", +"@ c #525756", +"# c #575C5B", +"$ c #5B605F", +"% c #70726D", +"& c #888A85", +"* c #90938D", +"= c #91948E", +"- c #92958F", +"; c #B3B4B0", +": c #B4B6B1", +"> c #BABDB6", +", c #C0C2BD", +"< c #C1C3BE", +"1 c #C2C3BE", +"2 c #C8CAC7", +"3 c #C9CBC7", +"4 c #CACBC7", +"5 c #CACAC8", +"6 c #D3D7CF", +"7 c #D5D5CF", +"8 c #D8D8D2", +"9 c #DADAD5", +"0 c #DADAD6", +"q c #DADAD7", +"w c #DBDBD7", +"e c #DBDBD8", +"r c #DCDCD9", +"t c #DDDDD9", +"y c #DCDDDA", +"u c #DDDDDA", +"i c #DEDEDB", +"p c #DFDFDC", +"a c #E0E0DC", +"s c #E3E3E0", +"d c #E6E6E3", +"f c #E9E9E6", +"g c #E8EAE6", +"h c #EAEBE8", +"j c #ECECE9", +"k c #EEEEEC", +"l c None", +/* pixels */ +"llllllllllllllllllllll", +"llllllllllllllllllllll", +"llllllllllllllllllllll", +"llllllllllllllllllllll", +"llo&&&&&&&&&&&&&&&&.ll", +"l#:<<<<<,<<<<<,,<<<;@l", +"&&4>fjjjfjjjjjfjjj>5&l", +"*&u>ffffffffffffff>q&l", +"-&u>kdd.ddf..sX.sk>u&l", +"-&u>kssassa.sss.sk>u&l", +"-&u>k.a.a.a..aa.ik>w&l", +"-&u>kuuuuuu.uuu.uk>w&l", +"-&w>kww.w99.999.wk>w&l", +"-&w>k888888888888k>w&l", +"=&u>k777777777777k>p&l", +"&&f>kkkkkkkkkkkkkk>g&l", +"&&f>>>>>>>>>>>>>>>>g&l", +" $366666666666666664# ", +" +%%%%%%%%%%%%%%%%+ ", +" ", +"llllllllllllllllllllll", +"llllllllllllllllllllll" +}; diff --git a/app-laptop/pommed/pommed-1.31/icons/gpomme_24x24.png b/app-laptop/pommed/pommed-1.31/icons/gpomme_24x24.png new file mode 100644 index 0000000..c9a1d54 Binary files /dev/null and b/app-laptop/pommed/pommed-1.31/icons/gpomme_24x24.png differ diff --git a/app-laptop/pommed/pommed-1.31/icons/gpomme_24x24.xpm b/app-laptop/pommed/pommed-1.31/icons/gpomme_24x24.xpm new file mode 100644 index 0000000..0cff544 --- /dev/null +++ b/app-laptop/pommed/pommed-1.31/icons/gpomme_24x24.xpm @@ -0,0 +1,77 @@ +/* XPM */ +static char *gpomme_24x24[] = { +/* columns rows colors chars-per-pixel */ +"24 24 47 1", +" c black", +". c #2E3436", +"X c #303537", +"o c #313738", +"O c #353A3C", +"+ c #363B3D", +"@ c #525756", +"# c #575C5B", +"$ c #5B605F", +"% c #70726D", +"& c #888A85", +"* c #90938D", +"= c #91948E", +"- c #92958F", +"; c #B3B4B0", +": c #B4B6B1", +"> c #BABDB6", +", c #C0C2BD", +"< c #C1C3BE", +"1 c #C2C3BE", +"2 c #C8CAC7", +"3 c #C9CBC7", +"4 c #CACBC7", +"5 c #CACAC8", +"6 c #D3D7CF", +"7 c #D5D5CF", +"8 c #D8D8D2", +"9 c #DADAD5", +"0 c #DADAD6", +"q c #DADAD7", +"w c #DBDBD7", +"e c #DBDBD8", +"r c #DCDCD9", +"t c #DDDDD9", +"y c #DCDDDA", +"u c #DDDDDA", +"i c #DEDEDB", +"p c #DFDFDC", +"a c #E0E0DC", +"s c #E3E3E0", +"d c #E6E6E3", +"f c #E9E9E6", +"g c #E8EAE6", +"h c #EAEBE8", +"j c #ECECE9", +"k c #EEEEEC", +"l c None", +/* pixels */ +"llllllllllllllllllllllll", +"llllllllllllllllllllllll", +"llllllllllllllllllllllll", +"llllllllllllllllllllllll", +"llllllllllllllllllllllll", +"lllo&&&&&&&&&&&&&&&&Xlll", +"ll#:<<<<<<<,<<<<<<<<;@ll", +"l&&4>jfjjfjjjjjfjjj>3&ll", +"l=&t>ffffffffffffff>e&ll", +"l-&i>kdd.ddd..d..dk>t&ll", +"l-&i>kssssss.sss.sk>e&ll", +"l-&t>k.a.a.a..aa.ak>e&ll", +"l-&e>ktttttt.ttt.tk>0&ll", +"l-&e>k00.000.000.0k>e&ll", +"l-&0>k888888888888k>0&ll", +"l=&t>k777777777777k>t&ll", +"l&&f>kkkkkkkkkkkkkk>h&ll", +"l&&f>>>>>>>>>>>>>>>>h&ll", +"l $366666666666666663# l", +"l +%%%%%%%%%%%%%%%%+ l", +"l l", +"llllllllllllllllllllllll", +"llllllllllllllllllllllll", +"llllllllllllllllllllllll" +}; diff --git a/app-laptop/pommed/pommed-1.31/icons/gpomme_32x32.png b/app-laptop/pommed/pommed-1.31/icons/gpomme_32x32.png new file mode 100644 index 0000000..e7ba5ea Binary files /dev/null and b/app-laptop/pommed/pommed-1.31/icons/gpomme_32x32.png differ diff --git a/app-laptop/pommed/pommed-1.31/icons/gpomme_32x32.xpm b/app-laptop/pommed/pommed-1.31/icons/gpomme_32x32.xpm new file mode 100644 index 0000000..94ce6a0 --- /dev/null +++ b/app-laptop/pommed/pommed-1.31/icons/gpomme_32x32.xpm @@ -0,0 +1,210 @@ +/* XPM */ +static char *gpomme_32x32[] = { +/* columns rows colors chars-per-pixel */ +"32 32 172 2", +" c #3E4345", +". c #3E4445", +"X c gray25", +"o c #404547", +"O c #4D5253", +"+ c #505556", +"@ c #515656", +"# c #515657", +"$ c #575751", +"% c #555555", +"& c #575B57", +"* c #535858", +"= c #565A5B", +"- c #5B5B57", +"; c #585C58", +": c #5A5D5A", +"> c #595E5E", +", c #5A5E5F", +"< c #5C5C59", +"1 c #5A5F60", +"2 c #5B5F60", +"3 c #5E605B", +"4 c #5F615D", +"5 c #60625E", +"6 c #606060", +"7 c #636460", +"8 c #636560", +"9 c #646561", +"0 c #646562", +"q c #646661", +"w c #646869", +"e c #656969", +"r c #666A6A", +"t c #696D6C", +"y c #6C6E6A", +"u c #6D706B", +"i c #6D7171", +"p c #6E7272", +"a c #70726E", +"s c #727470", +"d c #747777", +"f c #757874", +"g c #777B7A", +"h c #797B76", +"j c #797B77", +"k c #7A7D78", +"l c #7B7E7E", +"z c #7C7E7A", +"x c #7D807F", +"c c #7E817C", +"v c #7F817D", +"b c #7E8180", +"n c #80827E", +"m c #808383", +"M c #838581", +"N c #868988", +"B c #8B8E8D", +"V c #8E918E", +"C c #979994", +"Z c #969997", +"A c #979997", +"S c #9A9C98", +"D c #A1A3A1", +"F c #A5A7A5", +"G c #A6A8A4", +"H c #A7A9A7", +"J c #A8A9A6", +"K c #ACADAA", +"L c #ACAEAB", +"P c #AEB0AE", +"I c #B0B0AB", +"U c #B0B0AC", +"Y c #B0B1AC", +"T c #B1B1AC", +"R c #B2B2AD", +"E c #B2B2AE", +"W c #B2B3B1", +"Q c #B2B4B1", +"! c #B6B7B6", +"~ c #B7B9B5", +"^ c #B8B9B6", +"/ c #B9BAB6", +"( c #BABBB6", +") c #BABBB7", +"_ c #BBBCB7", +"` c #BBBDB7", +"' c #BBBEB7", +"] c #BABCB9", +"[ c #BCBDB9", +"{ c #BCBEB8", +"} c #BCBFB8", +"| c #BDBEB9", +" . c #BDBEBB", +".. c #BFC0BB", +"X. c #BFC1BB", +"o. c #BEC1BC", +"O. c #C0C1BC", +"+. c #C1C2BE", +"@. c #C2C3BF", +"#. c #C3C5C0", +"$. c #C4C5C0", +"%. c #C4C6C1", +"&. c #C5C7C2", +"*. c #C6C7C3", +"=. c #C6C7C4", +"-. c #C5C8C2", +";. c #C6C8C3", +":. c #C6C9C3", +">. c #C7C8C5", +",. c #C8C9C4", +"<. c #C9C9C4", +"1. c #C9C9C5", +"2. c #C8C9C6", +"3. c #C9CAC6", +"4. c #CACBC6", +"5. c #CACCC6", +"6. c #CACCC8", +"7. c #CBCCC8", +"8. c #CBCCC9", +"9. c #CBCDC8", +"0. c #CCCDC8", +"q. c #CCCDC9", +"w. c #CDCEC8", +"e. c #CDCFCB", +"r. c #D0D0CC", +"t. c #D1D2CE", +"y. c #D2D3CF", +"u. c #D4D4CE", +"i. c #D4D4CF", +"p. c #D3D3D1", +"a. c #D3D4D0", +"s. c #D4D5D2", +"d. c #D6D6D0", +"f. c #D7D7D1", +"g. c #D6D6D3", +"h. c #D7D7D2", +"j. c #D7D7D3", +"k. c #D7D7D4", +"l. c #D8D8D3", +"z. c #D8D8D4", +"x. c #D8D8D5", +"c. c #D9D9D4", +"v. c #D9D9D5", +"b. c #DADAD5", +"n. c #DADAD7", +"m. c #DBDBD7", +"M. c #DCDCD7", +"N. c #DBDCD8", +"B. c #DCDCD8", +"V. c #DCDDD9", +"C. c #DCDDDA", +"Z. c #DEDED9", +"A. c #DFE0DD", +"S. c #E0E0DC", +"D. c #E0E0DD", +"F. c #E1E1DD", +"G. c #E0E0DE", +"H. c #E2E2DE", +"J. c #E2E2DF", +"K. c #E3E5E2", +"L. c #E4E4E0", +"P. c #E4E4E1", +"I. c #E4E5E3", +"U. c #E6E6E2", +"Y. c #E7E8E5", +"T. c #E8E8E5", +"R. c #E8E9E7", +"E. c #EAEAE7", +"W. c #E9EAE8", +"Q. c #ECECE9", +"!. c gray100", +"~. c None", +/* pixels */ +"~.~.~.~.~.~.~.~.~.~.~.~.~.~.~.~.~.~.~.~.~.~.~.~.~.~.~.~.~.~.~.~.", +"~.~.~.~.~.~.~.~.~.~.~.~.~.~.~.~.~.~.~.~.~.~.~.~.~.~.~.~.~.~.~.~.", +"~.~.~.~.~.~.~.~.~.~.~.~.~.~.~.~.~.~.~.~.~.~.~.~.~.~.~.~.~.~.~.~.", +"~.~.~.~.~.~.~.~.~.~.~.~.~.~.~.~.~.~.~.~.~.~.~.~.~.~.~.~.~.~.~.~.", +"~.~.~.~.~.~.~.~.~.~.~.~.~.~.~.~.~.~.~.~.~.~.~.~.~.~.~.~.~.~.~.~.", +"~.~.~.~.~.~.~.~.~.~.~.~.~.~.~.~.~.~.~.~.~.~.~.~.~.~.~.~.~.~.~.~.", +"~.~.~.~.X 6 6 6 5 6 6 6 6 6 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A.A.H.Z.Z.x.Y.U.8 ~.", +"~.: ~ Y.:.' ' ' ' ' ` ` ' ' o.` ' ' ' ' ' ' ' ' ' ' ' *.Q.H : ~.", +"~.~.5 a S G G G G G G G G G G G G G G G G G G G G G G C y 4 ~.~.", +"~.~.~.X $ % % % % % % % % % % % % % % % % % % % % % % % % ~.~.~.", +"~.~.~.~.~.~.~.~.~.~.~.~.~.~.~.~.~.~.~.~.~.~.~.~.~.~.~.~.~.~.~.~.", +"~.~.~.~.~.~.~.~.~.~.~.~.~.~.~.~.~.~.~.~.~.~.~.~.~.~.~.~.~.~.~.~.", +"~.~.~.~.~.~.~.~.~.~.~.~.~.~.~.~.~.~.~.~.~.~.~.~.~.~.~.~.~.~.~.~.", +"~.~.~.~.~.~.~.~.~.~.~.~.~.~.~.~.~.~.~.~.~.~.~.~.~.~.~.~.~.~.~.~.", +"~.~.~.~.~.~.~.~.~.~.~.~.~.~.~.~.~.~.~.~.~.~.~.~.~.~.~.~.~.~.~.~.", +"~.~.~.~.~.~.~.~.~.~.~.~.~.~.~.~.~.~.~.~.~.~.~.~.~.~.~.~.~.~.~.~." +}; diff --git a/app-laptop/pommed/pommed-1.31/icons/gpomme_36x36.png b/app-laptop/pommed/pommed-1.31/icons/gpomme_36x36.png new file mode 100644 index 0000000..8d9436e Binary files /dev/null and b/app-laptop/pommed/pommed-1.31/icons/gpomme_36x36.png differ diff --git a/app-laptop/pommed/pommed-1.31/icons/gpomme_36x36.xpm b/app-laptop/pommed/pommed-1.31/icons/gpomme_36x36.xpm new file mode 100644 index 0000000..c6b052a --- /dev/null +++ b/app-laptop/pommed/pommed-1.31/icons/gpomme_36x36.xpm @@ -0,0 +1,253 @@ +/* XPM */ +static char *gpomme_36x36[] = { +/* columns rows colors chars-per-pixel */ +"36 36 211 2", +" c #3C4143", +". c #414648", +"X c #464B4C", +"o c #474C4D", +"O c gray30", +"+ c #4E4E4E", +"@ c #4E5353", +"# c #4E5354", +"$ c #4F5455", +"% c #58584F", +"& c #575751", +"* c #565652", +"= c #555555", +"- c #545754", +"; c #535953", +": c #515D51", +"> c #525C52", +", c #555852", +"< c #555955", +"1 c #585C58", +"2 c #5C5E58", +"3 c #5D5F5B", +"4 c #5E605C", +"5 c #5E605D", +"6 c #5E615D", +"7 c #5F625D", +"8 c #5F625E", +"9 c #60615D", +"0 c #60625E", +"q c #60635E", +"w c #626460", +"e c #606464", +"r c #626666", +"t c #656763", +"y c #656764", +"u c #676865", +"i c #676B6B", +"p c #676C6C", +"a c #6A6C67", +"s c #686C6C", +"d c #6B6F6F", +"f c #6E706B", +"g c #6D7172", +"h c #6F7273", +"j c #727570", +"k c #727676", +"l c #737777", +"z c #777975", +"x c #797B78", +"c c #787C7B", +"v c #7A7D7C", +"b c #7A7E7D", +"n c #7B7F7E", +"m c #7D8180", +"M c #818484", +"N c #858883", +"B c #878A8A", +"V c #8A8C86", +"C c #898B88", +"Z c #8B8E8E", +"A c #8D908F", +"S c #8E9190", +"D c #8F9291", +"F c #949693", +"G c #959796", +"H c #969898", +"J c #999A97", +"K c #989B99", +"L c #999B98", +"P c #989A9A", +"I c #9B9D9C", +"U c #A0A2A0", +"Y c #A3A5A3", +"T c #A9ABA6", +"R c #ABACA7", +"E c #ACACA7", +"W c #ABADAA", +"Q c #AEB0AC", +"! c #AEB0AD", +"~ c #AEB0AF", +"^ c #B1B1AD", +"/ c #B0B2AE", +"( c #B2B3AE", +") c #B3B4B0", +"_ c #B3B5B3", +"` c #B5B6B0", +"' c #B5B7B1", +"] c #B4B6B3", +"[ c #B5B7B4", +"{ c #B6B7B4", +"} c #B7B9B3", +"| c #B7B9B6", +" . c #B8B8B4", +".. c #B8B9B6", +"X. c #BBBEB7", +"o. c #B8BAB8", +"O. c #B9BAB8", +"+. c #B9BBBA", +"@. c #BABBB9", +"#. c #BABBBA", +"$. c #BBBCB8", +"%. c #BBBDBB", +"&. c #BCBCB8", +"*. c #BCBCB9", +"=. c #BFBFBB", +"-. c #BDBEBC", +";. c #BEC0BA", +":. c #BEC1BB", +">. c #BFC0BC", +",. c #BFC0BE", +"<. c #C2C2BF", +"1. c #C2C3BF", +"2. c #C3C5BF", +"3. c #C2C3C0", +"4. c #C3C4C0", +"5. c #C5C5C1", +"6. c #C4C6C0", +"7. c #C4C6C1", +"8. c #C5C7C1", +"9. c #C6C6C2", +"0. c #C6C7C3", +"q. c #C7C7C4", +"w. c #C5C8C2", +"e. c #C6C8C2", +"r. c #C6C8C3", +"t. c #C6C9C3", +"y. c #C7C8C4", +"u. c #C7C9C4", +"i. c #C7C8C6", +"p. c #C8C9C4", +"a. c #C8C9C5", +"s. c #C9C9C6", +"d. c #C8CAC5", +"f. c #C8CBC5", +"g. c #C8CBC6", +"h. c #C9CAC6", +"j. c #CACAC6", +"k. c #C9CCC6", +"l. c #CACCC6", +"z. c #CACCC7", +"x. c #CACBC9", +"c. c #CACDC8", +"v. c #CCCCC9", +"b. c #CDCDC9", +"n. c #CCCDCA", +"m. c #CDCFCA", +"M. c #CFCFCB", +"N. c #CECFCC", +"B. c #CFCFCC", +"V. c #CED1CC", +"C. c #CFD0CC", +"Z. c #CFD0CD", +"A. c #D0D0CD", +"S. c #D1D1CD", +"D. c #D0D1CE", +"F. c #D1D1CE", +"G. c #D1D2CE", +"H. c #D3D3CE", +"J. c #D3D4D1", +"K. c #D3D5D1", +"L. c #D4D4D0", +"P. c #D4D4D1", +"I. c #D5D5D0", +"U. c #D6D6D1", +"Y. c #D6D6D2", +"T. c #D7D7D2", +"R. c #D7D7D3", +"E. c #D6D6D4", +"W. c #D6D7D5", +"Q. c #D7D7D4", +"!. c #D6D8D4", +"~. c #D8D8D3", +"^. c #D8D8D4", +"/. c #D8D9D5", +"(. c #D9D9D4", +"). c #D9D9D5", +"_. c #D9D9D7", +"`. c #DADAD6", +"'. c #DADBD7", +"]. c #DADAD9", +"[. c #DADBD9", +"{. c #DBDBD9", +"}. c #DADCD9", +"|. c #DBDCD9", +" X c #DBDCDA", +".X c #DCDCD8", +"XX c #DCDCD9", +"oX c #DDDDD9", +"OX c #DDDDDA", +"+X c #DDDDDB", +"@X c #DEDEDA", +"#X c #DFDFDC", +"$X c #E0E0DC", +"%X c #E0E0DE", +"&X c #E1E1DE", +"*X c #E1E2E0", +"=X c #E2E2E0", +"-X c #E3E3E0", +";X c #E4E4E1", +":X c #E5E5E2", +">X c #E5E5E3", +",X c #E7E7E4", +".w.4 8X", +"8Xy w.q.-X-X&X-XK.p M h S &X&X>X-X-X-X-X>X*X-.= &X&X-X&X- %.-X-X4.u.4 8X", +"8Xu 0.0.$XH.%.OXZ +.$X$Xk U.N.<.#X$X$X&X$X$X-.X W +.$X$X- +.$X$Xu.0.9 8X", +"8Xu f.j.#XU r M.d _.$X$XZ [ P w _.$X$X$X$X$X+. n F $X$X# +.$X$X0.u.4 8X", +"8Xy f.H.OXOX@X@XW m _.8.r OX@X@XOXOX+X$XOX@X| # OXOXOX@X# | #X@XM.u.4 8X", +"8Xy 0.H.'.OX'.8.M.Y i n 4.| '.'.'.'.OXOX'.OX{ @ `.OX'.OX# ` OXOXH.0.4 8X", +"8Xy f.U.'.`.S.o { _.S.U.'.c v '.'.`.`.`.`.`.` @ `.'.`.`.# ) _._.U.f.4 8X", +"8Xy g.E.~.~.~.0._.~.s W _.T.f.~.(.(.(.`.(.(.H.&.(.~.~._.-.H.~.~.W.0.8 8X", +"8Xy g.].~.U.~.~.~.~.L <.T.T.T.T.~.~.~.~.~.(.~.~.~.~.~.U.U.~.~.U. Xu.4 8X", +"8Xy f.+X~.U.H.H.H.~.H.H.H.U.U.H.H.U.H.H.H.H.H.U.H.H.U.H.U.U.H.~. Xf.4 8X", +"8X9 m. X$XT.H.H.K.K.H.U.H.H.H.H.H.K.H.H.H.U.H.K.H.H.H.H.H.K._.$XW.0.w 8X", +"8X4 X4XH.].;X&X&X&X&X&X&X&X;X;X&X&X;X&X&X&X&X&X&X:X$X;X;X&X_.K.4XH.4 8X", +"8X& x 4Xg.:.X.X.X.X.X.X.X.;.&.X.X.X.;.;.X.X.;.X.&.X.X.;.X.;.;.V.3Xf : 8X", +"8X8X1 a L W ) W ( ) W ( ~ ~ ( ! ) W W ( ( ~ W ( ( ( ( W ! ) W F y < 8X8X", +"8X8X8X= & , = < - - - - - - - - < - - - - - - - - - - - ; - , = = 8X8X8X", +"8X8X8X8X8X8X8X8X8X8X8X8X8X8X8X8X8X8X8X8X8X8X8X8X8X8X8X8X8X8X8X8X8X8X8X8X", +"8X8X8X8X8X8X8X8X8X8X8X8X8X8X8X8X8X8X8X8X8X8X8X8X8X8X8X8X8X8X8X8X8X8X8X8X", +"8X8X8X8X8X8X8X8X8X8X8X8X8X8X8X8X8X8X8X8X8X8X8X8X8X8X8X8X8X8X8X8X8X8X8X8X", +"8X8X8X8X8X8X8X8X8X8X8X8X8X8X8X8X8X8X8X8X8X8X8X8X8X8X8X8X8X8X8X8X8X8X8X8X", +"8X8X8X8X8X8X8X8X8X8X8X8X8X8X8X8X8X8X8X8X8X8X8X8X8X8X8X8X8X8X8X8X8X8X8X8X", +"8X8X8X8X8X8X8X8X8X8X8X8X8X8X8X8X8X8X8X8X8X8X8X8X8X8X8X8X8X8X8X8X8X8X8X8X", +"8X8X8X8X8X8X8X8X8X8X8X8X8X8X8X8X8X8X8X8X8X8X8X8X8X8X8X8X8X8X8X8X8X8X8X8X" +}; diff --git a/app-laptop/pommed/pommed-1.31/icons/gpomme_48x48.png b/app-laptop/pommed/pommed-1.31/icons/gpomme_48x48.png new file mode 100644 index 0000000..3d58ad7 Binary files /dev/null and b/app-laptop/pommed/pommed-1.31/icons/gpomme_48x48.png differ diff --git a/app-laptop/pommed/pommed-1.31/icons/gpomme_48x48.xpm b/app-laptop/pommed/pommed-1.31/icons/gpomme_48x48.xpm new file mode 100644 index 0000000..4de3931 --- /dev/null +++ b/app-laptop/pommed/pommed-1.31/icons/gpomme_48x48.xpm @@ -0,0 +1,123 @@ +/* XPM */ +static char *gpomme_48x48[] = { +/* columns rows colors chars-per-pixel */ +"48 48 69 1", +" c #2E3436", +". c #33393A", +"X c #3E4345", +"o c #454A4B", +"O c #4A4F50", +"+ c #4D5253", +"@ c #545653", +"# c #555853", +"$ c #545859", +"% c #585A55", +"& c #5A5D59", +"* c #5A5F60", +"= c #5E605C", +"- c #5B6060", +"; c #61645F", +": c #616464", +"> c #656969", +", c #686A66", +"< c #6A6E6D", +"1 c #6E706C", +"2 c #6D7170", +"3 c #707473", +"4 c #757978", +"5 c #797A77", +"6 c #7A7D7C", +"7 c #7E8181", +"8 c #838581", +"9 c #858887", +"0 c #878A89", +"q c #8C8F8D", +"w c #8E918C", +"e c #8F9291", +"r c #90928E", +"t c #939593", +"y c #969896", +"u c #979998", +"i c #989A96", +"p c #9A9C99", +"a c #9EA19E", +"s c #A3A39E", +"d c #A5A6A3", +"f c #AAAAA5", +"g c #ACADA9", +"h c #AEB0AC", +"j c #B1B2AE", +"k c #B5B6B3", +"l c #B7B8B5", +"z c #B8B9B6", +"x c #BCBEB8", +"c c #BEC0BB", +"v c #C1C2BD", +"b c #C4C5C1", +"n c #C6C8C3", +"m c #C8C9C5", +"M c #CCCDC9", +"N c #CFD0CC", +"B c #D4D4CE", +"V c #D5D5D1", +"C c #D7D8D4", +"Z c #D9D9D4", +"A c #DDDDD9", +"S c #DFE0DD", +"D c #E1E1DE", +"F c #E4E4E1", +"G c #E9E9E6", +"H c #EBEBE9", +"J c #F3F3F2", +"K c gray100", +"L c None", +/* pixels */ +"LLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLL", +"LLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLL", +"LLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLL", +"LLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLL", +"LLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLL", +"LLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLL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omme_64x64.png new file mode 100644 index 0000000..176cc6d Binary files /dev/null and b/app-laptop/pommed/pommed-1.31/icons/gpomme_64x64.png differ diff --git a/app-laptop/pommed/pommed-1.31/icons/gpomme_64x64.xpm b/app-laptop/pommed/pommed-1.31/icons/gpomme_64x64.xpm new file mode 100644 index 0000000..5a398e7 --- /dev/null +++ b/app-laptop/pommed/pommed-1.31/icons/gpomme_64x64.xpm @@ -0,0 +1,145 @@ +/* XPM */ +static char *gpomme_64x64[] = { +/* columns rows colors chars-per-pixel */ +"64 64 75 1", +" c black", +". c #2E3436", +"X c #313739", +"o c #33393B", +"O c #383E3F", +"+ c #383E40", +"@ c #3C4143", +"# c gray25", +"$ c #414648", +"% c #43494A", +"& c #4A4C4C", +"* c #4D5253", +"= c #535452", +"- c #565854", +"; c #565A5B", +": c #585954", +"> c #595C59", +", c #5E6263", +"< c #60625E", +"1 c #606565", +"2 c #636768", +"3 c #666A6A", +"4 c #696D6C", +"5 c #6C7071", +"6 c #727573", +"7 c #757875", +"8 c #767979", +"9 c #797D7B", +"0 c #7D807D", +"q c #7E8181", +"w c #80837E", +"e c #828483", +"r c #858887", +"t c #868988", +"y c #8B8D8B", +"u c #8D908F", +"i c #8F9291", +"p c #90938E", +"a c #939592", +"s c #9A9D9B", +"d c #9EA09D", +"f c #9FA2A1", +"g c #A2A39E", +"h c #A4A5A2", +"j c #A6A8A6", +"k c #A7A9A8", +"l c #A8A9A4", +"z c #AAACA8", +"x c #AEB0AD", +"c c #B0B1AD", +"v c #B3B4B1", +"b c #B7B9B5", +"n c #B9BCB6", +"m c #BDBDBA", +"M c #BDC0B9", +"N c #C1C3BE", +"B c #C6C6C2", +"V c #C6C9C4", +"C c #C9CAC6", +"Z c #CCCDC9", +"A c #CED0CB", +"S c #D3D3CE", +"D c #D5D5D1", +"F c #D7D8D4", +"G c #D9D9D4", +"H c #DDDDD9", +"J c #DEE0DC", +"K c #E0E0DD", +"L c #E4E4E2", +"P c #E7E8E6", +"I c #E8E8E5", +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RRRRRRRRRRRRRRRRRRRRR", +"RRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRR" +}; diff --git a/app-laptop/pommed/pommed-1.31/icons/gpomme_72x72.png b/app-laptop/pommed/pommed-1.31/icons/gpomme_72x72.png new file mode 100644 index 0000000..5f75b8f Binary files /dev/null and b/app-laptop/pommed/pommed-1.31/icons/gpomme_72x72.png differ diff --git a/app-laptop/pommed/pommed-1.31/icons/gpomme_72x72.xpm b/app-laptop/pommed/pommed-1.31/icons/gpomme_72x72.xpm new file mode 100644 index 0000000..2017312 --- /dev/null +++ b/app-laptop/pommed/pommed-1.31/icons/gpomme_72x72.xpm @@ -0,0 +1,150 @@ +/* XPM */ +static char *gpomme_72x72[] = { +/* columns rows colors chars-per-pixel */ +"72 72 72 1", +" c black", +". c #2E3436", +"X c #303638", +"o c #353A3C", +"O c #3D4244", +"+ c #404243", +"@ c #424749", +"# c #454A4B", +"$ c #4B4B4B", +"% c #4A4F50", +"& c #4C5152", +"* c #545653", +"= c #525758", +"- c #555853", +"; c #595B57", +": c #5A5C5C", +"> c #5C6061", +", c #62645F", +"< c #636666", +"1 c #666864", +"2 c #666A6B", +"3 c #696B67", +"4 c #696C69", +"5 c #6C706F", +"6 c #6F7272", +"7 c #727470", +"8 c #747877", +"9 c #757978", +"0 c #797B7B", +"q c #7E8281", +"w c #828583", +"e c #868989", +"r c #8A8C8B", +"t c #8D908E", +"y c #8E9190", +"u c #90918D", +"i c #919493", +"p c #9B9D9C", +"a c #9FA09E", +"s c #A2A29D", +"d c #A3A5A2", +"f c #A6A8A5", +"g c #AAABA6", +"h c #ACADA9", +"j c #AEB0AD", +"k c #B2B3AE", +"l c #B4B5B1", +"z c #B6B9B3", +"x c #B9BBB5", +"c c #BCBDB8", +"v c #BDC0BA", +"b c #C1C2BD", +"n c #C4C5C1", +"m c #C6C8C3", +"M c #C9CAC6", +"N c #CCCDC9", +"B c #CED0CB", +"V c #D3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UUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUU", +"UUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUU", +"UUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUU", +"UUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUU", +"UUUUUUUU<************&****&**************&********-&*********** UUUUUUUU", +"UUUUUU*********************************-******--*******-*****-*---UUUUUU", +"UUUU#*-:ugczlllllllllllllllllllllllllllllllkkkxkllllllllllllxxsw;-- UUUU", +"UUUU*-sBNkgssssssssssssssssssssssssssssssssssssssssssssssssssgxVmr--UUUU", +"UUU**rPAgsskzzxxxxlxxxlxxxxxxxxllxxlxxxxxxxxxxxczzzzlxxxxxlxkssgKK8-*UUU", +"UU;-1VbhsMKKKKKKKKKKKKKKKKKKKKKKKKKKJLJKKKKKKKKKKKKKKKKKLKKKKJvskMM;*UUU", +"UU-*kBkdVKKKKKKKKKKKKKKKKKKKKKKKKKKKLJKKKKKKKKKKKKKKKKKKKKKKKKKbskAi*$UU", +"UU**MbdcKKKKKKKKKKKKKKKKKJKKKKKKKKKKLJKKKLKKKKJKKKKKKKKKKJKJKKKKhhml**UU", +"UU-;AxgNJKJKJKKJKJJKJFJKKJJJKKJKJJJKKJJJJKFKJKJJKJKJKKKKKJKJJJJKbgbN**UU", +"UU*3ZlhAHJJJHJJJJJJJj.iHKHJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJKJJNhzZ**UU", +"UU*3CzhAHHHHHGHHJJJJj.yHHHHHHJJGJJFJJJJJHJGJJJHJGHHJHHJJJJJJFKFJNhxV**UU", +"UU*3CzjAGHHHHHzSJJJJj.yHHHGGjJHGJJJJJJJFGJGHGJGHJGHHGHJJJJFJJKKJNjxC**UU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3XuAAAAAAAAAAAAAAAu.7AAAAAAAA6.uAAAAAZZvC**UU", +"UU*4CnZAAAAAAAsNAAAAs.rAAAAViAAAAAAAAAAAAAAAAkugAAAAAAAAfelAAAAAZScV**UU", +"UU*3CnSCVAAVAVAVAZVAs.eAAVAAAAVAVAAAAVAAVAAVAVVAAAAVAAAVAAAACACAZSvV**UU", +"UU*4CnSAAAVAAAAAVACAd.eAACAACAACAVAAVAAVAVVAAVVAVVAAAAVAACACCCACAScC*-UU", +"UU*4BnDZVAAVVVVVCCCCBbMVCCVVVCVCAVVAAVVAAVAVAVAVVAVVVAVAVCCCCCCCADcC*-UU", +"UU-4CcGAVVVVVVVAVACCVAAVAVCCCCVCVAVVVVAVVAVVVAVAAVVAVVVVCVCCCCCCFSxC*-UU", +"UU-2ZxDGAVVAVVVVVVCVVVVVVVVVCVVVVVVVVVVVVVVAVVVVVVVVVAVVAVCVVVVCFZcC*-UU", +"UU*,AxNHSCVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVCCFJbbV--UU", +"UU**CmHHHHZCCVVVVVVVVVVVVBVVVVVVBVVVVVVVVBVVVVVVVVVVVVVVVVVVCAGJFFBv--UU", +"UU**cPPKSJKKKKHJKJJGJJKJJJJKKKJJKKKJJJJKJKHKJJKJKKJJKKKKJKKJKJGHLLLs-*UU", +"UU**dPPKZvMCCCCZCCCBCZZZZZZVCCVBZZVZZZVVZCZZZZCCVCCACCCCVCCCVncGLPPq-UUU", +"UUU**SPPbvxxxcxxvxvvxxxxvxvvlvvvxxxxvvvkxxvxxxxxcxcxcxxxcxxxcczCPPb-*UUU", +"UUU**4FPDBbvccvvvvvvvvvvvvvvvvvvvvvvvvvvvcvcvvvvcbcccbvvvvvcbnNFPN;-UUUU", +"UUUU***abDDSDDSSSSSSSSFDDDDSADDDDDDDDADDDSDDSSSSSSSSSSSSDDSSSSZbu-**UUUU", +"UUUUU:**--556776777777745757774777557777577577777777777755777<**--oUUUUU", +"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UUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUU", +"UUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUU" +}; diff --git a/app-laptop/pommed/pommed-1.31/icons/gpomme_96x96.png b/app-laptop/pommed/pommed-1.31/icons/gpomme_96x96.png new file mode 100644 index 0000000..9a4009b Binary files /dev/null and b/app-laptop/pommed/pommed-1.31/icons/gpomme_96x96.png differ diff --git a/app-laptop/pommed/pommed-1.31/icons/gpomme_96x96.xpm b/app-laptop/pommed/pommed-1.31/icons/gpomme_96x96.xpm new file mode 100644 index 0000000..0136cef --- /dev/null +++ b/app-laptop/pommed/pommed-1.31/icons/gpomme_96x96.xpm @@ -0,0 +1,181 @@ +/* XPM */ +static char *gpomme_96x96[] = { +/* columns rows colors chars-per-pixel */ +"96 96 79 1", +" c #2E3436", +". c #303638", +"X c #33393B", +"o c #383E40", +"O c #3D4344", +"+ c #404646", +"@ c #424749", +"# c #43494A", +"$ c #4A4F50", +"% c #4E5253", +"& c #545653", +"* c #515658", +"= c #565854", +"- c #55595A", +"; c #595B57", +": c #5A5E5C", +"> c #5E605C", +", c #5C6061", +"< c #616464", +"1 c #666864", +"2 c #666A6A", +"3 c #696C6A", +"4 c #6B6F70", +"5 c #6E706C", +"6 c #6E7271", +"7 c #727472", +"8 c #757876", +"9 c #757979", +"0 c #7A7D7B", +"q c #7E807C", +"w c #7F8282", +"e c #81837F", +"r c #828584", +"t c #868989", +"y c #898B87", +"u c #8A8D8B", +"i c #8E908E", +"p c #8E9190", +"a c #929493", +"s c #969895", +"d c #989A96", +"f c #9B9D9C", +"g c #9DA09C", +"h c #A1A29C", +"j c #A5A6A2", +"k c #A6A8A5", +"l c #A7A9A8", +"z c #A9AAA5", +"x c #ABADA9", +"c c #AEB0AC", +"v c #AFB1B0", +"b c #B1B2AD", +"n c #B3B4B1", +"m c #B6B8B2", +"M c #B9BCB6", +"N c #BCBEB9", +"B c #BEC0BB", +"V c #C0C2BD", +"C c #C4C5C1", +"Z c #C5C8C2", +"A c #C8C9C5", +"S c #CCCCC9", +"D c #CED0CB", +"F c #D3D3CE", +"G c #D6D6D0", +"H c #D6D8D3", +"J c #D9DAD5", +"K c #DDDDDA", +"L c #DEE0DD", +"P c #E1E1DD", +"I c #E5E5E2", +"U c #E7E8E6", +"Y c #E8E8E6", +"T c #EBEBE9", +"R c #EFF0EE", +"E c #F0F0EF", +"W c #F4F5F4", +"Q c gray100", +"! c None", +/* pixels */ +"!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!", +"!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!", +"!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!", +"!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!", +"!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!", +"!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!", +"!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!", +"!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!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!!!!!!!!!!!!", +"!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!", +"!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!", +"!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!", +"!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!", +"!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!", +"!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!", +"!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!", +"!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!", +"!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!" +}; diff --git a/app-laptop/pommed/pommed-1.31/pommed.1 b/app-laptop/pommed/pommed-1.31/pommed.1 new file mode 100644 index 0000000..1e47aa4 --- /dev/null +++ b/app-laptop/pommed/pommed-1.31/pommed.1 @@ -0,0 +1,55 @@ +.\" Hey, EMACS: -*- nroff -*- +.TH POMMED 1 "2007-01-09" + +.SH NAME +pommed \- Apple laptops hotkeys event handler + +.SH SYNOPSIS +.B pommed +.RI [ options ] +.SH DESCRIPTION +This manual page documents briefly the +.B pommed +daemon. +.PP +.B pommed +is a daemon handling the hotkeys found on the Apple laptops, like the +MacBook Pro, MacBook and PowerBook laptops. These hotkeys control, +through +.BR pommed , +the LCD backlight level, the audio volume, the keyboard backlight +level (only on the MacBook Pro and the latest PowerBook) and the +CD/DVD drive ejection. Additionally, +.B pommed +monitors the ambient light sensors found on the MacBook Pro and the +latest PowerBook to automatically light up the keyboard backlight when +the ambient light level gets too low. +.PP +.B pommed +can optionally support the Apple Remote Control, too (this option is +disabled by default and only available for the MacBook Pro and +MacBook). + +.SH OPTIONS +.B pommed +accepts the following command-line options. +.TP +.B \-v +Print version information. +.TP +.B \-f +Run in the foreground, printing log messages to stdout. +.TP +.B \-d +Run in the foreground, printing log messages to stdout and debug +messages to stderr. + +.SH FILES +.TP +.B /etc/pommed.conf +The configuration file for \fBpommed\fP. See the comments in the +file for the structure of the file and the available options. + +.SH AUTHOR +.B pommed +was written by Julien BLACHE . diff --git a/app-laptop/pommed/pommed-1.31/pommed.conf.mactel b/app-laptop/pommed/pommed-1.31/pommed.conf.mactel new file mode 100644 index 0000000..97d2c6d --- /dev/null +++ b/app-laptop/pommed/pommed-1.31/pommed.conf.mactel @@ -0,0 +1,119 @@ +# +# Configuration file for pommed +# + +# General configuration +general { + # fnmode: functions keys first (no need to use fn) or last + # Value is either 1 or 2, effect is hardware-dependent + fnmode = 1 +} + +# sysfs backlight control +# nVidia machines, will fall back to nv8600gmt if not supported by the kernel +lcd_sysfs { + # The sysfs backlight control is a generic interface provided + # by the Linux kernel for backlight control on most graphic cards. + # The brightness range can differ depending on the hardware. + + # initial backlight level [12] (0 - 15, -1 to disable) + init = -1 + # step value (1 - 2) + step = 1 + # backlight level when on battery [6] (1 - 15, 0 to disable) + on_batt = 6 +} + +# ATI X1600 backlight control (MacBook Pro v1 & v2) +lcd_x1600 { + # initial backlight level [200] (0 - 255, -1 to disable) + init = -1 + # step value (1 - 127) + step = 10 + # backlight level when on battery [80] (1 - 255, 0 to disable) + on_batt = 80 +} + +# Intel 945GM, 965GM backlight control (MacBook v1-v4, MacBook Air v1) +lcd_gma950 { + # initial backlight level [0x6f] (0x1f - 0x94 usually, -1 to disable) + init = -1 + # step value (0x01 - 0x20) + step = 0x0f + # backlight level when on battery [0x40] (0x1f - 0x94 usually, 0 to disable) + on_batt = 0x40 +} + +# nVidia GeForce 8600M GT/9400M/9600M GT backlight control +# (MacBook Pro v3-v5, MacBook v5, MacBook v2) +lcd_nv8600mgt { + # initial backlight level [12] (0 - 15, -1 to disable) + init = -1 + # step value (1 - 2) + step = 1 + # backlight level when on battery [6] (1 - 15, 0 to disable) + on_batt = 6 +} + +# Audio support +audio { + # Use amixer or alsamixer/alsamixergui to determine the sound card + # and the mixer elements to use here. + + # sound card to use + card = "default" + # initial volume [80] (0 - 100%, -1 to disable) + init = -1 + # step value (1 - 50%) + step = 10 + # beep on volume change + beep = yes + # mixer element for volume adjustment + volume = "PCM" + # mixer element for muting the speakers + speakers = "Front" + # mixer element for muting the headphones + headphones = "Headphone" +} + +# Keyboard backlight control +kbd { + # default value for automatic backlight (0 - 255) + default = 100 + # step value (1 - 127) + step = 10 + # ambient light thresholds for automatic backlight (0 - 255) + on_threshold = 20 + off_threshold = 40 + # enable/disable automatic backlight + auto = yes + # idle timer - switches off keyboard backlight automatically (timeout in seconds, -1 to disable) + idle_timer = 60 +} + +# CD/DVD drive ejection +eject { + # enable/disable eject key + enabled = yes + # CD/DVD device + device = "/dev/dvd" +} + +# Beeper +beep { + # enable/disable beeper + enabled = no + # WAV file to use (from pommed: goutte.wav or click.wav in /usr/share/pommed) + beepfile = "/usr/share/pommed/goutte.wav" +} + +# Apple Remote - deprecated +# Note: the appleir driver is required for this to work; this driver has been +# obsoleted with Linux 2.6.22, so unless you are running a kernel < 2.6.22 or +# use the appleir driver on a newer kernel, this won't work. +# You should use LIRC instead. +appleir { + # enable/disable the appleir support + enabled = no +} + diff --git a/app-laptop/pommed/pommed-1.31/pommed.conf.pmac b/app-laptop/pommed/pommed-1.31/pommed.conf.pmac new file mode 100644 index 0000000..dac961e --- /dev/null +++ b/app-laptop/pommed/pommed-1.31/pommed.conf.pmac @@ -0,0 +1,82 @@ +# +# Configuration file for pommed +# + +# General configuration +general { + # fnmode: functions keys first (no need to use fn) or last + # Value is either 1 or 2, effect is hardware-dependent + fnmode = 1 +} + +# sysfs backlight control +lcd_sysfs { + # The sysfs backlight control is a generic interface provided + # by the Linux kernel for backlight control on most graphic cards. + # The brightness range can differ depending on the hardware. + + # initial backlight level [100] (0 - 127, -1 to disable) + init = -1 + # step value (1 - 63) + step = 8 + # backlight level when on battery [40] (1 - 127, 0 to disable) + on_batt = 40 + + # WARNING + # On some machines, the backlight is handled by the kernel, so + # the "step" and "on_batt" configuration values are useless, as + # pommed doesn't get to set the backlight level when you press + # on the keys. +} + +# Audio support +audio { + # Use amixer or alsamixer/alsamixergui to determine the sound card + # and the mixer elements to use here. + + # sound card to use + card = "default" + # initial volume [80] (0 - 100%, -1 to disable) + init = -1 + # step value (1 - 50%) + step = 10 + # beep on volume change + beep = yes + # mixer element for volume adjustment + volume = "Master" + # mixer element for muting the speakers + speakers = "Master" + # mixer element for muting the headphones + headphones = "Headphone" +} + +# Keyboard backlight control +kbd { + # default value for automatic backlight (0 - 255) + default = 100 + # step value (1 - 127) + step = 16 + # ambient light thresholds for automatic backlight (0 - 255) + on_threshold = 20 + off_threshold = 40 + # enable/disable automatic backlight + auto = yes + # idle timer - switches off keyboard backlight automatically (timeout in seconds, -1 to disable) + idle_timer = 60 +} + +# CD/DVD drive ejection +eject { + # enable/disable eject key + enabled = yes + # CD/DVD device + device = "/dev/dvd" +} + +# Beeper +beep { + # enable/disable beeper + enabled = no + # WAV file to use (from pommed: goutte.wav or click.wav in /usr/share/pommed) + beepfile = "/usr/share/pommed/goutte.wav" +} diff --git a/app-laptop/pommed/pommed-1.31/pommed.init b/app-laptop/pommed/pommed-1.31/pommed.init new file mode 100755 index 0000000..38aea60 --- /dev/null +++ b/app-laptop/pommed/pommed-1.31/pommed.init @@ -0,0 +1,83 @@ +#! /bin/sh +# +### BEGIN INIT INFO +# Provides: pommed +# Required-Start: $syslog $local_fs +# Required-Stop: $syslog $local_fs +# Should-Start: dbus +# Should-Stop: +# Default-Start: 2 3 4 5 +# Default-Stop: 0 1 6 +# Short-Description: Apple laptops hotkeys event handler +# Description: pommed handles the hotkeys found on the Apple MacBook Pro +# and MacBook laptops and adjusts the LCD backlight, sound +# volume, keyboard backlight or ejects the CD-ROM drive +# accordingly. +### END INIT INFO + +PATH=/usr/local/sbin:/usr/local/bin:/sbin:/bin:/usr/sbin:/usr/bin +DAEMON=/usr/sbin/pommed +NAME=pommed +DESC="Apple laptops hotkeys events handler" + +test -x $DAEMON || exit 0 + +set -e + +pommed_start() +{ + $DAEMON +} + +pommed_stop() +{ + pid=$(cat /var/run/pommed.pid) + kill $pid + rm -f /var/run/pommed.pid +} + + +case "$1" in + start) + echo -n "Starting $DESC: " + pommed_start + echo "$NAME." + ;; + stop) + echo -n "Stopping $DESC: " + if [ -f /var/run/pommed.pid ]; then + pommed_stop + echo "$NAME." + else + echo "no PID file found; $NAME not running?" + fi + ;; + force-reload) + # check wether $DAEMON is running. If so, restart + if [ -f /var/run/pommed.pid ]; then + $0 restart + else + echo "Reloading $DESC: $NAME not running." + exit 0 + fi + ;; + restart) + echo -n "Restarting $DESC: " + if [ -f /var/run/pommed.pid ]; then + pommed_stop + else + echo "no PID file found; $NAME not running?" + exit 0 + fi + sleep 1 + pommed_start + echo "$NAME." + ;; + *) + N=/etc/init.d/$NAME + echo "Usage: $N {start|stop|restart|force-reload}" >&2 + exit 1 + ;; +esac + +exit 0 diff --git a/app-laptop/pommed/pommed-1.31/pommed/.gitignore b/app-laptop/pommed/pommed-1.31/pommed/.gitignore new file mode 100644 index 0000000..ff6f41d --- /dev/null +++ b/app-laptop/pommed/pommed-1.31/pommed/.gitignore @@ -0,0 +1,2 @@ +pommed + diff --git a/app-laptop/pommed/pommed-1.31/pommed/Makefile b/app-laptop/pommed/pommed-1.31/pommed/Makefile new file mode 100644 index 0000000..b99636f --- /dev/null +++ b/app-laptop/pommed/pommed-1.31/pommed/Makefile @@ -0,0 +1,129 @@ +ARCH ?= $(shell uname -m) + +CC = gcc + +DBUS_CFLAGS = $(shell pkg-config dbus-1 --cflags) -DDBUS_API_SUBJECT_TO_CHANGE +DBUS_LIBS = $(shell pkg-config dbus-1 --libs) + +ALSA_CFLAGS = $(shell pkg-config alsa --cflags) +ALSA_LIBS = $(shell pkg-config alsa --libs) + +AUDIOFILE_CFLAGS = $(shell pkg-config audiofile --cflags) +AUDIOFILE_LIBS = $(shell pkg-config audiofile --libs) + +CONFUSE_CFLAGS = $(shell pkg-config libconfuse --cflags) +CONFUSE_LIBS = $(shell pkg-config libconfuse --libs) + +INOTIFY_CFLAGS = $(shell test -e /usr/include/sys/inotify.h || echo -DNO_SYS_INOTIFY_H) + +TIMERFD_CFLAGS = $(shell test -e /usr/include/sys/timerfd.h || echo -DNO_SYS_TIMERFD_H) + +CFLAGS = -g -O2 -Wall $(DBUS_CFLAGS) $(ALSA_CFLAGS) $(AUDIOFILE_CFLAGS) $(CONFUSE_CFLAGS) $(INOTIFY_CFLAGS) $(TIMERFD_CFLAGS) + +LDFLAGS = -pthread -lrt $(DBUS_LIBS) $(ALSA_LIBS) $(AUDIOFILE_LIBS) $(CONFUSE_LIBS) + +ifneq (, $(findstring ppc, $(ARCH))) +OFLIB ?= + +SOURCES = pommed.c cd_eject.c evdev.c conffile.c audio.c \ + evloop.c dbus.c power.c beep.c video.c \ + sysfs_backlight.c pmac/pmu.c \ + pmac/kbd_backlight.c pmac/ambient.c + +OF_SOURCES = pmac/ofapi/of_externals.c pmac/ofapi/of_internals.c \ + pmac/ofapi/of_standard.c + +OF_OBJS = $(OF_SOURCES:%.c=%.o) + +ifneq ($(OFLIB),) +CFLAGS += -Ipmac +LIBS = pmac/ofapi/oflib.a +else +LDFLAGS += -lofapi +endif + +else + +LIBPCI_SHARED = $(shell pkg-config libpci && echo true || echo false) + +ifeq ($(LIBPCI_SHARED), true) + LIBPCI_CFLAGS = $(shell pkg-config libpci --cflags) + LIBPCI_LIBS = $(shell pkg-config libpci --libs) + + CFLAGS += $(LIBPCI_CFLAGS) + LDFLAGS += $(LIBPCI_LIBS) +else + LIBS = /usr/lib/libpci.a + LDFLAGS += -lz +endif + +SOURCES = pommed.c cd_eject.c evdev.c conffile.c audio.c \ + evloop.c dbus.c power.c beep.c video.c \ + sysfs_backlight.c \ + mactel/x1600_backlight.c mactel/gma950_backlight.c \ + mactel/nv8600mgt_backlight.c \ + mactel/kbd_backlight.c mactel/ambient.c mactel/acpi.c +endif + +OBJS = $(SOURCES:%.c=%.o) + + +pommed: $(OBJS) $(LIBS) + +pommed.o: pommed.c pommed.h evloop.h kbd_backlight.h lcd_backlight.h cd_eject.h evdev.h conffile.h audio.h dbus.h beep.h + +cd_eject.o: cd_eject.c cd_eject.h pommed.h conffile.h dbus.h + +evdev.o: evdev.c evdev.h evloop.h pommed.h kbd_backlight.h lcd_backlight.h cd_eject.h conffile.h audio.h video.h beep.h + +evloop.o: evloop.c evloop.h pommed.h + +conffile.o: conffile.c conffile.h pommed.h lcd_backlight.h kbd_backlight.h cd_eject.h audio.h beep.h + +audio.o: audio.c audio.h pommed.h conffile.h dbus.h + +dbus.o: dbus.c dbus.h evloop.h pommed.h lcd_backlight.h kbd_backlight.h ambient.h audio.h + +power.o: power.c power.h evloop.h pommed.h lcd_backlight.h + +beep.o: beep.c beep.h pommed.h evloop.h audio.h + +video.o: video.c video.h pommed.h dbus.h + +sysfs_backlight.o: sysfs_backlight.c pommed.h lcd_backlight.h conffile.h dbus.h + +# PowerMac-specific files +pmac/kbd_backlight.o: pmac/kbd_backlight.c kbd_auto.c kbd_backlight.h evloop.h pommed.h ambient.h conffile.h dbus.h + +pmac/ambient.o: pmac/ambient.c ambient.h pommed.h dbus.h + +pmac/pmu.o: pmac/pmu.c power.h + +# OFlib +pmac/ofapi/oflib.a: $(OF_OBJS) + ar cru $@ $^ + +pmac/ofapi/of_externals.o: pmac/ofapi/of_externals.c pmac/ofapi/of_api.h + +pmac/ofapi/of_internals.o: pmac/ofapi/of_internals.c pmac/ofapi/of_api.h + +pmac/ofapi/of_standard.o: pmac/ofapi/of_standard.c pmac/ofapi/of_api.h + + +# Mactel-specific files +mactel/x1600_backlight.o: mactel/x1600_backlight.c pommed.h lcd_backlight.h conffile.h dbus.h + +mactel/gma950_backlight.o: mactel/gma950_backlight.c pommed.h lcd_backlight.h conffile.h dbus.h + +mactel/nv8600mgt_backlight.o: mactel/nv8600mgt_backlight.c pommed.h lcd_backlight.h conffile.h dbus.h + +mactel/kbd_backlight.o: mactel/kbd_backlight.c kbd_auto.c kbd_backlight.h evloop.h pommed.h ambient.h conffile.h dbus.h + +mactel/ambient.o: mactel/ambient.c ambient.h pommed.h dbus.h + +mactel/acpi.o: mactel/acpi.c power.h + + +clean: + rm -f pommed $(OBJS) $(OF_OBJS) pmac/ofapi/oflib.a + rm -f *~ mactel/*~ pmac/*~ pmac/ofapi/*~ diff --git a/app-laptop/pommed/pommed-1.31/pommed/ambient.h b/app-laptop/pommed/pommed-1.31/pommed/ambient.h new file mode 100644 index 0000000..a4e2b93 --- /dev/null +++ b/app-laptop/pommed/pommed-1.31/pommed/ambient.h @@ -0,0 +1,46 @@ +/* + * pommed - ambient.h + */ + +#ifndef __AMBIENT_H__ +#define __AMBIENT_H__ + +#define KBD_AMBIENT_MIN 0 +#define KBD_AMBIENT_MAX 255 + +#ifdef __powerpc__ +/* I2C ioctl */ +# define I2C_SLAVE 0x0703 + +# define ADB_DEVICE "/dev/adb" +# define ADB_BUFFER_SIZE 32 + +struct _lmu_info +{ + unsigned int lmuaddr; /* i2c bus address */ + char i2cdev[16]; /* i2c bus device */ +}; + +extern struct _lmu_info lmu_info; + +#endif /* !__powerpc__ */ + + +struct _ambient_info +{ + int left; + int right; + int max; +}; + +extern struct _ambient_info ambient_info; + + +void +ambient_get(int *r, int *l); + +void +ambient_init(int *r, int *l); + + +#endif /* !__AMBIENT_H__ */ diff --git a/app-laptop/pommed/pommed-1.31/pommed/audio.c b/app-laptop/pommed/pommed-1.31/pommed/audio.c new file mode 100644 index 0000000..fb20867 --- /dev/null +++ b/app-laptop/pommed/pommed-1.31/pommed/audio.c @@ -0,0 +1,289 @@ +/* + * pommed - Apple laptops hotkeys handler daemon + * + * Copyright (C) 2006 Romain Beauxis + * Copyright (C) 2006-2007 Julien BLACHE + * + * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; version 2 of the License. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License along + * with this program; if not, write to the Free Software Foundation, Inc., + * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. + */ + +#include +#include + +#define NDEBUG +#include + +#include "pommed.h" +#include "conffile.h" +#include "audio.h" +#include "beep.h" +#include "dbus.h" + + +struct _audio_info audio_info; + +static snd_mixer_t *mixer_hdl; +static snd_mixer_elem_t *vol_elem; +static snd_mixer_elem_t *spkr_elem; +static snd_mixer_elem_t *head_elem; + +static long vol_min; +static long vol_max; +static long vol_step; +static int play; + + +void +audio_step(int dir) +{ + long vol; + long newvol; + + if (mixer_hdl == NULL) + return; + + if (vol_elem == NULL) + return; + + snd_mixer_handle_events(mixer_hdl); + + if (!snd_mixer_selem_is_active(vol_elem)) + return; + + snd_mixer_selem_get_playback_volume(vol_elem, 0, &vol); + + logdebug("Mixer volume: %ld\n", vol); + + if (dir == STEP_UP) + { + newvol = vol + vol_step; + + if (newvol > vol_max) + newvol = vol_max; + + logdebug("Audio stepping +%ld -> %ld\n", vol_step, newvol); + } + else if (dir == STEP_DOWN) + { + newvol = vol - vol_step; + + if (newvol < vol_min) + newvol = vol_min; + + logdebug("Audio stepping -%ld -> %ld\n", vol_step, newvol); + } + else + return; + + snd_mixer_selem_set_playback_volume(vol_elem, 0, newvol); + + if (snd_mixer_selem_is_playback_mono(vol_elem) == 0) + snd_mixer_selem_set_playback_volume(vol_elem, 1, newvol); + + if (audio_cfg.beep) + beep_audio(); + + mbpdbus_send_audio_volume(newvol, vol); + + audio_info.level = newvol; +} + + +static void +audio_set_mute_elem(snd_mixer_elem_t *elem) +{ + if (snd_mixer_selem_is_active(elem) + && snd_mixer_selem_has_playback_switch(elem)) + { + snd_mixer_selem_set_playback_switch(elem, 0, play); + + if (snd_mixer_selem_is_playback_mono(elem) == 0) + snd_mixer_selem_set_playback_switch(elem, 1, play); + } +} + +void +audio_toggle_mute(void) +{ + if (mixer_hdl == NULL) + return; + + snd_mixer_handle_events(mixer_hdl); + + play = !play; + + if (spkr_elem != NULL) + audio_set_mute_elem(spkr_elem); + + if (head_elem != NULL) + audio_set_mute_elem(head_elem); + + mbpdbus_send_audio_mute(!play); + + audio_info.muted = !play; +} + + +int +audio_init(void) +{ + snd_mixer_elem_t *elem; + snd_mixer_selem_id_t *sid; + + double dvol; + long vol; + + int ret; + + vol_elem = NULL; + spkr_elem = NULL; + head_elem = NULL; + + play = 1; + + ret = snd_mixer_open(&mixer_hdl, 0); + if (ret < 0) + { + logdebug("Failed to open mixer: %s\n", snd_strerror(ret)); + + mixer_hdl = NULL; + + return -1; + } + + ret = snd_mixer_attach(mixer_hdl, audio_cfg.card); + if (ret < 0) + { + logdebug("Failed to attach mixer: %s\n", snd_strerror(ret)); + + snd_mixer_close(mixer_hdl); + + return -1; + } + + ret = snd_mixer_selem_register(mixer_hdl, NULL, NULL); + if (ret < 0) + { + logdebug("Failed to register mixer: %s\n", snd_strerror(ret)); + + snd_mixer_detach(mixer_hdl, audio_cfg.card); + snd_mixer_close(mixer_hdl); + + return -1; + } + + ret = snd_mixer_load(mixer_hdl); + if (ret < 0) + { + logdebug("Failed to load mixer: %s\n", snd_strerror(ret)); + + snd_mixer_detach(mixer_hdl, audio_cfg.card); + snd_mixer_close(mixer_hdl); + + return -1; + } + + + /* Grab interesting elements */ + snd_mixer_selem_id_alloca(&sid); + + for (elem = snd_mixer_first_elem(mixer_hdl); elem; elem = snd_mixer_elem_next(elem)) + { + snd_mixer_selem_get_id(elem, sid); + + if (strcmp(snd_mixer_selem_id_get_name(sid), audio_cfg.vol) == 0) + vol_elem = elem; + + if (strcmp(snd_mixer_selem_id_get_name(sid), audio_cfg.spkr) == 0) + spkr_elem = elem; + + if (strcmp(snd_mixer_selem_id_get_name(sid), audio_cfg.head) == 0) + head_elem = elem; + } + + logdebug("Audio init: volume %s, speakers %s, headphones %s\n", + (vol_elem == NULL) ? "NOK" : "OK", + (spkr_elem == NULL) ? "NOK" : "OK", + (head_elem == NULL) ? "NOK" : "OK"); + + if ((vol_elem == NULL) || ((spkr_elem == NULL) && (head_elem == NULL))) + { + logdebug("Failed to open required mixer elements\n"); + + audio_cleanup(); + + return -1; + } + + /* Get min & max volume */ + snd_mixer_selem_get_playback_volume_range(vol_elem, &vol_min, &vol_max); + + dvol = (double)(vol_max - vol_min) / 100.0; + vol_step = (long)(dvol * (double)audio_cfg.step); + + logdebug("Audio init: min %ld, max %ld, step %ld\n", vol_min, vol_max, vol_step); + + /* Set initial volume if enabled */ + if (audio_cfg.init > -1) + { + dvol *= (double)audio_cfg.init; + vol = (long)dvol; + + if (vol > vol_max) + vol = vol_max; + + snd_mixer_selem_set_playback_volume(vol_elem, 0, vol); + + if (snd_mixer_selem_is_playback_mono(vol_elem) == 0) + snd_mixer_selem_set_playback_volume(vol_elem, 1, vol); + } + + snd_mixer_handle_events(mixer_hdl); + snd_mixer_selem_get_playback_volume(vol_elem, 0, &vol); + + audio_info.level = vol; + audio_info.max = vol_max; + audio_info.muted = !play; + + return 0; +} + +void +audio_cleanup(void) +{ + if (mixer_hdl != NULL) + { + snd_mixer_detach(mixer_hdl, audio_cfg.card); + snd_mixer_close(mixer_hdl); + + mixer_hdl = NULL; + } +} + + +void +audio_fix_config(void) +{ + if (audio_cfg.init < 0) + audio_cfg.init = -1; + + if (audio_cfg.init > 100) + audio_cfg.init = 100; + + if (audio_cfg.step < 1) + audio_cfg.step = 1; + + if (audio_cfg.step > 50) + audio_cfg.step = 50; +} diff --git a/app-laptop/pommed/pommed-1.31/pommed/audio.h b/app-laptop/pommed/pommed-1.31/pommed/audio.h new file mode 100644 index 0000000..2a8881e --- /dev/null +++ b/app-laptop/pommed/pommed-1.31/pommed/audio.h @@ -0,0 +1,35 @@ +/* + * pommed - audio.h + */ + +#ifndef __AUDIO_H__ +#define __AUDIO_H__ + + +struct _audio_info +{ + int level; + int max; + int muted; +}; + +extern struct _audio_info audio_info; + + +void +audio_step(int dir); + +void +audio_toggle_mute(void); + +int +audio_init(void); + +void +audio_cleanup(void); + +void +audio_fix_config(void); + + +#endif /* !__AUDIO_H__ */ diff --git a/app-laptop/pommed/pommed-1.31/pommed/beep.c b/app-laptop/pommed/pommed-1.31/pommed/beep.c new file mode 100644 index 0000000..44a10d7 --- /dev/null +++ b/app-laptop/pommed/pommed-1.31/pommed/beep.c @@ -0,0 +1,601 @@ +/* + * pommed - Apple laptops hotkeys handler daemon + * + * Copyright (C) 2006-2008 Julien BLACHE + * Copyright (C) 2006 Soeren SONNENBURG + * + * Portions of the code below dealing with the audio thread were shamelessly + * stolen from pbbuttonsd. Thanks ! ;-) + * + * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; version 2 of the License. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License along + * with this program; if not, write to the Free Software Foundation, Inc., + * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. + */ + +#include +#include +#include +#include +#include + +#include + +#include + +#include + +#include +#include + +#include + +#define NDEBUG +#include + +#include + +#include "pommed.h" +#include "evloop.h" +#include "conffile.h" +#include "audio.h" +#include "beep.h" + + + +/* Added to linux/input.h after Linux 2.6.18 */ +#ifndef BUS_VIRTUAL +# define BUS_VIRTUAL 0x06 +#endif + + +static int beep_fd; +static int beep_thread_running = 0; + + +/* Beep thread */ +static void +beep_thread_command(int command); + +static void +beep_thread_cleanup(void); + +static int +beep_thread_init(void); + + +static void +beep_beep(void) +{ + if (!beep_cfg.enabled) + return; + + if (audio_info.muted) + return; + + beep_thread_command(AUDIO_CLICK); +} + +void +beep_audio(void) +{ + if (audio_info.muted) + return; + + beep_thread_command(AUDIO_CLICK); +} + + +static int +beep_open_device(void) +{ + char *uinput_dev[3] = + { + "/dev/input/uinput", + "/dev/uinput", + "/dev/misc/uinput" + }; + struct uinput_user_dev dv; + int fd; + int i; + int ret; + + if (beep_cfg.enabled == 0) + return -1; + + for (i = 0; i < (sizeof(uinput_dev) / sizeof(uinput_dev[0])); i++) + { + fd = open(uinput_dev[i], O_RDWR, 0); + + if (fd >= 0) + break; + } + + if (fd < 0) + { + logmsg(LOG_ERR, "beep: could not open uinput: %s", strerror(errno)); + logmsg(LOG_ERR, "beep: Do you have the uinput module loaded?"); + + return -1; + } + + memset(&dv, 0, sizeof(dv)); + strcpy(dv.name, BEEP_DEVICE_NAME); + dv.id.bustype = BUS_VIRTUAL; + dv.id.vendor = 0; + dv.id.product = 0; + dv.id.version = 1; + + ret = write(fd, &dv, sizeof(dv)); + if (ret != sizeof(dv)) + { + logmsg(LOG_ERR, "beep: could not set device name: %s", strerror(errno)); + + close(fd); + return -1; + } + + ret = ioctl(fd, UI_SET_EVBIT, EV_SND); + if (ret != 0) + { + logmsg(LOG_ERR, "beep: could not request EV_SND: %s", strerror(errno)); + + close(fd); + return -1; + } + + ret = ioctl(fd, UI_SET_SNDBIT, SND_BELL); + if (ret != 0) + { + logmsg(LOG_ERR, "beep: could not request SND_BELL: %s", strerror(errno)); + + close(fd); + return -1; + } + + ret = ioctl(fd, UI_SET_SNDBIT, SND_TONE); + if (ret != 0) + { + logmsg(LOG_ERR, "beep: could not request SND_TONE: %s", strerror(errno)); + + close(fd); + return -1; + } + + ret = ioctl(fd, UI_DEV_CREATE, NULL); + if (ret != 0) + { + logmsg(LOG_ERR, "beep: could not create uinput device: %s", strerror(errno)); + + close(fd); + return -1; + } + + beep_fd = fd; + + return 0; +} + +static void +beep_close_device(void) +{ + if (!beep_cfg.enabled || (beep_fd == -1)) + return; + + evloop_remove(beep_fd); + + ioctl(beep_fd, UI_DEV_DESTROY, NULL); + + close(beep_fd); + + beep_fd = -1; +} + + +void +beep_process_events(int fd, uint32_t events) +{ + int ret; + + struct input_event ev; + + if (events & (EPOLLERR | EPOLLHUP)) + { + logmsg(LOG_WARNING, "Beeper device lost; this should not happen"); + + ret = evloop_remove(fd); + if (ret < 0) + logmsg(LOG_ERR, "Could not remove beeper device from event loop"); + + beep_close_device(); + + return; + } + + ret = read(fd, &ev, sizeof(struct input_event)); + + if (ret != sizeof(struct input_event)) + return; + + if (ev.type == EV_SND) + { + if ((ev.code == SND_TONE) && (ev.value > 0)) + { + logdebug("\nBEEP: BEEP!\n"); + + beep_beep(); /* Catch that, Coyote */ + } + } +} + + +int +beep_init(void) +{ + int ret; + + beep_fd = -1; + + ret = beep_thread_init(); + if (ret < 0) + { + logmsg(LOG_ERR, "beep: thread init failed, disabling"); + + beep_cfg.enabled = 0; + + return -1; + } + + beep_thread_running = 1; + + ret = beep_open_device(); + if (ret < 0) + return -1; + + ret = evloop_add(beep_fd, EPOLLIN, beep_process_events); + if (ret < 0) + { + logmsg(LOG_ERR, "Could not add device to event loop"); + + beep_cfg.enabled = 0; + + beep_close_device(); + + return -1; + } + + return 0; +} + +void +beep_cleanup(void) +{ + if (beep_thread_running) + { + beep_thread_command(AUDIO_COMMAND_QUIT); + beep_thread_cleanup(); + } + + beep_close_device(); +} + +void +beep_fix_config(void) +{ + if (beep_cfg.enabled == 0) + return; + + if (beep_cfg.beepfile == NULL) + beep_cfg.beepfile = strdup(BEEP_DEFAULT_FILE); + + if (access(beep_cfg.beepfile, R_OK) != 0) + { + logmsg(LOG_WARNING, "beep: cannot access WAV file %s: %s", beep_cfg.beepfile, strerror(errno)); + + if (access(BEEP_DEFAULT_FILE, R_OK) == 0) + { + logmsg(LOG_WARNING, "beep: falling back to default file %s", BEEP_DEFAULT_FILE); + + free(beep_cfg.beepfile); + beep_cfg.beepfile = strdup(BEEP_DEFAULT_FILE); + } + else + { + logmsg(LOG_ERR, "beep: cannot access default file %s: %s", BEEP_DEFAULT_FILE, strerror(errno)); + logmsg(LOG_ERR, "beep: disabling beeper"); + + beep_cfg.enabled = 0; + } + } +} + + +/* + * Beep thread + */ + +struct dspdata _dsp; + +/* Called from the main thread */ +static struct sample * +beep_load_sample(char *filename) +{ + AFfilehandle affd; /* filehandle for soundfile from libaudiofile */ + AFframecount framecount; + int dummy, channels, byteorder, framesize, precision; + struct sample *sample; + + int ret; + + sample = (struct sample *) malloc(sizeof(struct sample)); + if (sample == NULL) + return NULL; + + affd = afOpenFile(filename, "r", 0); + if (!affd) + { + free(sample); + return NULL; + } + + afGetSampleFormat(affd, AF_DEFAULT_TRACK, &dummy, &precision); + channels = afGetChannels(affd, AF_DEFAULT_TRACK); + byteorder = afGetVirtualByteOrder(affd, AF_DEFAULT_TRACK); + framesize = (int) afGetFrameSize(affd, AF_DEFAULT_TRACK, 0); + framecount = afGetFrameCount(affd, AF_DEFAULT_TRACK); + sample->speed = (int) afGetRate(affd, AF_DEFAULT_TRACK); + + if (channels <= 2) + sample->channels = channels; + else + goto error_out; + + switch (precision) + { + case 8: + sample->format = SND_PCM_FORMAT_S8; + break; + case 16: + if (byteorder == AF_BYTEORDER_LITTLEENDIAN) + sample->format = SND_PCM_FORMAT_S16_LE; + else + sample->format = SND_PCM_FORMAT_S16_BE; + break; + default: + goto error_out; + break; + } + + sample->framesize = framesize; + sample->periods = sample->framesize; + sample->buffersize = (sample->periods * 8192) >> 2; + sample->framecount = framecount; + sample->audiodatalen = framecount * framesize; + + sample->audiodata = (char *) malloc(sample->audiodatalen); + if (sample->audiodata != NULL) + { + ret = afReadFrames(affd, AF_DEFAULT_TRACK, sample->audiodata, framecount); + if (ret != framecount) + { + free(sample->audiodata); + goto error_out; + } + } + else + goto error_out; + + afCloseFile(affd); + + return sample; + + error_out: /* something bad happened */ + afCloseFile(affd); + free(sample); + return NULL; +} + + +/* Called from the audio thread */ +static void +beep_play_sample(struct dspdata *dsp, int cmd) +{ + snd_pcm_t *pcm_handle; + snd_pcm_hw_params_t *hwparams; + + char *pcm_name = "default"; + + struct sample *s = dsp->sample[cmd]; + + snd_pcm_hw_params_alloca(&hwparams); + + if (snd_pcm_open(&pcm_handle, pcm_name, SND_PCM_STREAM_PLAYBACK, 0) < 0) + { + logmsg(LOG_WARNING, "beep: error opening PCM device %s", pcm_name); + return; + } + + if (snd_pcm_hw_params_any(pcm_handle, hwparams) < 0) + { + logmsg(LOG_WARNING, "beep: cannot configure PCM device"); + return; + } + + if (snd_pcm_hw_params_set_access(pcm_handle, hwparams, SND_PCM_ACCESS_RW_INTERLEAVED) < 0) + { + logmsg(LOG_WARNING, "beep: error setting access"); + return; + } + + if (snd_pcm_hw_params_set_format(pcm_handle, hwparams, s->format) < 0) + { + logmsg(LOG_WARNING, "beep: error setting format"); + return; + } + + if (snd_pcm_hw_params_set_rate_near(pcm_handle, hwparams, &s->speed, 0) < 0) + { + logmsg(LOG_WARNING, "beep: error setting rate"); + return; + } + + /* Set number of channels */ + if (snd_pcm_hw_params_set_channels_near(pcm_handle, hwparams, &s->channels) < 0) + { + logmsg(LOG_WARNING, "beep: error setting channels"); + return; + } + + /* Set number of periods. Periods used to be called fragments. */ + if (snd_pcm_hw_params_set_periods_near(pcm_handle, hwparams, &s->periods, 0) < 0) + { + logmsg(LOG_WARNING, "beep: error setting periods"); + return; + } + + /* Set buffer size (in frames). The resulting latency is given by */ + /* latency = periodsize * periods / (rate * bytes_per_frame) */ + if (snd_pcm_hw_params_set_buffer_size_near(pcm_handle, hwparams, &s->buffersize) < 0) + { + logmsg(LOG_WARNING, "beep: error setting buffersize"); + return; + } + + /* Apply HW parameter settings to */ + /* PCM device and prepare device */ + if (snd_pcm_hw_params(pcm_handle, hwparams) < 0) + { + logmsg(LOG_WARNING, "beep: error setting HW params"); + return; + } + + int pcmreturn; + /* Write num_frames frames from buffer data to */ + /* the PCM device pointed to by pcm_handle. */ + /* Returns the number of frames actually written. */ + while ((pcmreturn = snd_pcm_writei(pcm_handle, s->audiodata, s->framecount)) < 0) + { + snd_pcm_prepare(pcm_handle); + } + + /* Stop PCM device and drop pending frames */ + snd_pcm_drop(pcm_handle); + + /* Stop PCM device after pending frames have been played */ + snd_pcm_close(pcm_handle); +} + + +/* Called from the audio thread + * Audio thread main loop + */ +void * +beep_thread (void *arg) +{ + struct dspdata *dsp = (struct dspdata *) arg; + for (;;) + { + pthread_mutex_lock(&dsp->mutex); + pthread_cond_wait(&dsp->cond, &dsp->mutex); + pthread_mutex_unlock(&dsp->mutex); + + switch (dsp->command) + { + case AUDIO_CLICK: + dsp->command = AUDIO_COMMAND_NONE; + + beep_play_sample(dsp, AUDIO_CLICK); + break; + case AUDIO_COMMAND_QUIT: + pthread_exit(NULL); + break; + case AUDIO_COMMAND_NONE: + break; + } + } + + return NULL; +} + + +/* Called from the main thread + * This function wakes the audio thread + */ +static void +beep_thread_command(int command) +{ + if (!beep_thread_running) + return; + + pthread_mutex_lock(&(_dsp.mutex)); + + _dsp.command = command; + + pthread_cond_signal(&(_dsp.cond)); + pthread_mutex_unlock(&(_dsp.mutex)); +} + + +/* Called from the main thread */ +static void +beep_thread_cleanup(void) +{ + int i; + + for (i = 0; i < AUDIO_N; i++) + { + if (_dsp.sample[i] == NULL) + continue; + + if (_dsp.sample[i]->audiodata != NULL) + free(_dsp.sample[i]->audiodata); + + free(_dsp.sample[i]); + } + + pthread_mutex_destroy(&(_dsp.mutex)); + pthread_cond_destroy(&(_dsp.cond)); +} + +/* Called from the main thread + * This function sets up the sound playing thread. + * It starts the thread or if an error occur cleans + * up all the audio stuff + */ +static int +beep_thread_init(void) +{ + pthread_attr_t attr; + int ret; + + _dsp.sample[AUDIO_CLICK] = beep_load_sample(beep_cfg.beepfile); + + if (_dsp.sample[AUDIO_CLICK] == NULL) + return -1; + + _dsp.thread = 0; + + pthread_mutex_init(&(_dsp.mutex), NULL); + pthread_cond_init (&(_dsp.cond), NULL); + pthread_attr_init(&attr); + pthread_attr_setdetachstate(&attr, PTHREAD_CREATE_JOINABLE); + + ret = pthread_create(&(_dsp.thread), &attr, beep_thread, (void *) &_dsp); + if (ret != 0) + { + beep_thread_cleanup(); + ret = -1; + } + + pthread_attr_destroy(&attr); + + return ret; +} diff --git a/app-laptop/pommed/pommed-1.31/pommed/beep.h b/app-laptop/pommed/pommed-1.31/pommed/beep.h new file mode 100644 index 0000000..0166445 --- /dev/null +++ b/app-laptop/pommed/pommed-1.31/pommed/beep.h @@ -0,0 +1,54 @@ +/* + * pommed - beep.h + */ + +#ifndef __BEEP_H__ +#define __BEEP_H__ + + +#define BEEP_DEFAULT_FILE "/usr/share/pommed/goutte.wav" +#define BEEP_DEVICE_NAME "Pommed beeper device" + +void +beep_audio(void); + +int +beep_init(void); + +void +beep_cleanup(void); + +void +beep_fix_config(void); + + +/* Beep thread data definitions */ +struct sample { + char *audiodata; + int audiodatalen; + int format; + unsigned int channels; + unsigned int speed; + unsigned int framesize; + int framecount; + unsigned int periods; + unsigned long buffersize; +}; + +enum { + AUDIO_COMMAND_NONE = -2, + AUDIO_COMMAND_QUIT = -1, + AUDIO_CLICK = 0, + AUDIO_N /* keep this one last */ +}; + +struct dspdata { + int command; + pthread_mutex_t mutex; + pthread_cond_t cond; + pthread_t thread; + struct sample *sample[AUDIO_N]; /* sound to play */ +}; + + +#endif /* !__BEEP_H__ */ diff --git a/app-laptop/pommed/pommed-1.31/pommed/cd_eject.c b/app-laptop/pommed/pommed-1.31/pommed/cd_eject.c new file mode 100644 index 0000000..bb1f53e --- /dev/null +++ b/app-laptop/pommed/pommed-1.31/pommed/cd_eject.c @@ -0,0 +1,123 @@ +/* + * pommed - Apple laptops hotkeys handler daemon + * + * Copyright (C) 2006-2007 Julien BLACHE + * + * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; version 2 of the License. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License along + * with this program; if not, write to the Free Software Foundation, Inc., + * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. + */ + +#include +#include +#include +#include +#include +#include +#include +#include + +#include + +#include + +#include +#include + +#include "pommed.h" +#include "conffile.h" +#include "cd_eject.h" +#include "dbus.h" + + +void +cd_eject(void) +{ + int fd; + int ret; + + if (!eject_cfg.enabled) + return; + + fd = open(eject_cfg.device, O_RDONLY | O_NONBLOCK); + if (fd < 0) + { + logmsg(LOG_ERR, "Could not open CD/DVD device: %s", strerror(errno)); + + return; + } + + /* Check drive status */ + ret = ioctl(fd, CDROM_DRIVE_STATUS); + close(fd); + + switch (ret) + { + case CDS_NO_INFO: /* fall through to CDS_DISC_OK */ + logmsg(LOG_INFO, "Driver does not support CDROM_DRIVE_STATUS, trying to eject anyway"); + + case CDS_DISC_OK: + break; + + case CDS_NO_DISC: + logmsg(LOG_INFO, "No disc in CD/DVD drive"); + return; + + case CDS_DRIVE_NOT_READY: + logmsg(LOG_INFO, "Drive not ready, please retry later"); + return; + + case CDS_TRAY_OPEN: + logmsg(LOG_INFO, "Drive tray already open"); + return; + + default: + logmsg(LOG_INFO, "CDROM_DRIVE_STATUS returned %d (%s)", ret, strerror(errno)); + return; + } + + ret = fork(); + if (ret == 0) /* exec eject */ + { + execl("/usr/bin/eject", "eject", eject_cfg.device, NULL); + + logmsg(LOG_ERR, "Could not execute eject: %s", strerror(errno)); + exit(1); + } + else if (ret == -1) + { + logmsg(LOG_ERR, "Could not fork: %s", strerror(errno)); + return; + } + else + { + mbpdbus_send_cd_eject(); + + waitpid(ret, &ret, 0); + if ((WIFEXITED(ret) == 0) || (WEXITSTATUS(ret) != 0)) + { + logmsg(LOG_INFO, "eject failed"); + return; + } + } +} + + +void +cd_eject_fix_config(void) +{ + if (eject_cfg.device == NULL) + { + eject_cfg.enabled = 0; + return; + } +} diff --git a/app-laptop/pommed/pommed-1.31/pommed/cd_eject.h b/app-laptop/pommed/pommed-1.31/pommed/cd_eject.h new file mode 100644 index 0000000..d923906 --- /dev/null +++ b/app-laptop/pommed/pommed-1.31/pommed/cd_eject.h @@ -0,0 +1,17 @@ +/* + * pommed - cd_eject.h + */ + +#ifndef __CD_EJECT_H__ +#define __CD_EJECT_H__ + + +void +cd_eject(void); + +void +cd_eject_fix_config(void); + + +#endif /* !__CD_EJECT_H__ */ + diff --git a/app-laptop/pommed/pommed-1.31/pommed/conffile.c b/app-laptop/pommed/pommed-1.31/pommed/conffile.c new file mode 100644 index 0000000..d54b9e2 --- /dev/null +++ b/app-laptop/pommed/pommed-1.31/pommed/conffile.c @@ -0,0 +1,397 @@ +/* + * pommed - Apple laptops hotkeys handler daemon + * + * Copyright (C) 2006-2008 Julien BLACHE + * + * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; version 2 of the License. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License along + * with this program; if not, write to the Free Software Foundation, Inc., + * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. + */ + +#include +#include +#include + +#include + +#include + +#include "pommed.h" +#include "conffile.h" +#include "lcd_backlight.h" +#include "kbd_backlight.h" +#include "cd_eject.h" +#include "beep.h" +#include "audio.h" + + +struct _general_cfg general_cfg; +struct _lcd_sysfs_cfg lcd_sysfs_cfg; +#ifndef __powerpc__ +struct _lcd_x1600_cfg lcd_x1600_cfg; +struct _lcd_gma950_cfg lcd_gma950_cfg; +struct _lcd_nv8600mgt_cfg lcd_nv8600mgt_cfg; +#endif +struct _audio_cfg audio_cfg; +struct _kbd_cfg kbd_cfg; +struct _eject_cfg eject_cfg; +struct _beep_cfg beep_cfg; +#ifndef __powerpc__ +struct _appleir_cfg appleir_cfg; +#endif + + +/* Config file structure */ +static cfg_opt_t general_opts[] = + { + CFG_INT("fnmode", 1, CFGF_NONE), + CFG_END() + }; + +static cfg_opt_t lcd_sysfs_opts[] = + { + CFG_INT("init", -1, CFGF_NONE), + CFG_INT("step", 8, CFGF_NONE), + CFG_INT("on_batt", 0, CFGF_NONE), + CFG_END() + }; + + +#ifndef __powerpc__ +static cfg_opt_t lcd_x1600_opts[] = + { + CFG_INT("init", -1, CFGF_NONE), + CFG_INT("step", 10, CFGF_NONE), + CFG_INT("on_batt", 0, CFGF_NONE), + CFG_END() + }; + +static cfg_opt_t lcd_gma950_opts[] = + { + CFG_INT("init", -1, CFGF_NONE), + CFG_INT("step", 0x0f, CFGF_NONE), + CFG_INT("on_batt", 0, CFGF_NONE), + CFG_END() + }; + +static cfg_opt_t lcd_nv8600mgt_opts[] = + { + CFG_INT("init", -1, CFGF_NONE), + CFG_INT("step", 1, CFGF_NONE), + CFG_INT("on_batt", 0, CFGF_NONE), + CFG_END() + }; +#endif /* !__powerpc__ */ + + +static cfg_opt_t audio_opts[] = + { + CFG_STR("card", "default", CFGF_NONE), + CFG_INT("init", -1, CFGF_NONE), + CFG_INT("step", 10, CFGF_NONE), + CFG_BOOL("beep", 1, CFGF_NONE), + CFG_STR("volume", "PCM", CFGF_NONE), + CFG_STR("speakers", "Front", CFGF_NONE), + CFG_STR("headphones", "Headphone", CFGF_NONE), + CFG_END() + }; + +static cfg_opt_t kbd_opts[] = + { + CFG_INT("default", 100, CFGF_NONE), + CFG_INT("step", 10, CFGF_NONE), + CFG_INT("on_threshold", 20, CFGF_NONE), + CFG_INT("off_threshold", 40, CFGF_NONE), + CFG_BOOL("auto", 1, CFGF_NONE), + CFG_INT("idle_timer", 60, CFGF_NONE), + CFG_END() + }; + +static cfg_opt_t eject_opts[] = + { + CFG_BOOL("enabled", 1, CFGF_NONE), + CFG_STR("device", "/dev/dvd", CFGF_NONE), + CFG_END() + }; + +static cfg_opt_t beep_opts[] = + { + CFG_BOOL("enabled", 0, CFGF_NONE), + CFG_STR("beepfile", BEEP_DEFAULT_FILE, CFGF_NONE), + CFG_END() + }; + +#ifndef __powerpc__ +static cfg_opt_t appleir_opts[] = + { + CFG_BOOL("enabled", 0, CFGF_NONE), + CFG_END() + }; +#endif /* !__powerpc__ */ + +static cfg_opt_t opts[] = + { + CFG_SEC("general", general_opts, CFGF_NONE), + CFG_SEC("lcd_sysfs", lcd_sysfs_opts, CFGF_NONE), +#ifndef __powerpc__ + CFG_SEC("lcd_x1600", lcd_x1600_opts, CFGF_NONE), + CFG_SEC("lcd_gma950", lcd_gma950_opts, CFGF_NONE), + CFG_SEC("lcd_nv8600mgt", lcd_nv8600mgt_opts, CFGF_NONE), +#endif + CFG_SEC("audio", audio_opts, CFGF_NONE), + CFG_SEC("kbd", kbd_opts, CFGF_NONE), + CFG_SEC("eject", eject_opts, CFGF_NONE), + CFG_SEC("beep", beep_opts, CFGF_NONE), +#ifndef __powerpc__ + CFG_SEC("appleir", appleir_opts, CFGF_NONE), +#endif + CFG_END() + }; + + +static int +config_validate_positive_integer(cfg_t *cfg, cfg_opt_t *opt) +{ + int value = cfg_opt_getnint(opt, cfg_opt_size(opt) - 1); + + if (value < 0) + { + cfg_error(cfg, "Error: Value for '%s/%s' must be positive", cfg->name, opt->name); + return -1; + } + + return 0; +} + +static int +config_validate_string(cfg_t *cfg, cfg_opt_t *opt) +{ + char *value = cfg_opt_getnstr(opt, cfg_opt_size(opt) - 1); + + if (strlen(value) == 0) + { + cfg_error(cfg, "Error: Value for '%s/%s' must be a non-zero string", cfg->name, opt->name); + return -1; + } + + return 0; +} + + +static void +config_print(void) +{ + printf("pommed configuration:\n"); + printf(" + General settings:\n"); + printf(" fnmode: %d\n", general_cfg.fnmode); + printf(" + sysfs backlight control:\n"); + printf(" initial level: %d\n", lcd_sysfs_cfg.init); + printf(" step: %d\n", lcd_sysfs_cfg.step); + printf(" on_batt: %d\n", lcd_sysfs_cfg.on_batt); +#ifndef __powerpc__ + printf(" + ATI X1600 backlight control:\n"); + printf(" initial level: %d\n", lcd_x1600_cfg.init); + printf(" step: %d\n", lcd_x1600_cfg.step); + printf(" on_batt: %d\n", lcd_x1600_cfg.on_batt); + printf(" + Intel GMA950 backlight control:\n"); + printf(" initial level: 0x%x\n", lcd_gma950_cfg.init); + printf(" step: 0x%x\n", lcd_gma950_cfg.step); + printf(" on_batt: 0x%x\n", lcd_gma950_cfg.on_batt); + printf(" + nVidia GeForce 8600M GT backlight control:\n"); + printf(" initial level: %d\n", lcd_nv8600mgt_cfg.init); + printf(" step: %d\n", lcd_nv8600mgt_cfg.step); + printf(" on_batt: %d\n", lcd_nv8600mgt_cfg.on_batt); +#endif /* !__powerpc__ */ + printf(" + Audio volume control:\n"); + printf(" card: %s\n", audio_cfg.card); + printf(" initial volume: %d%s\n", audio_cfg.init, (audio_cfg.init > -1) ? "%" : ""); + printf(" step: %d%%\n", audio_cfg.step); + printf(" beep: %s\n", (audio_cfg.beep) ? "yes" : "no"); + printf(" volume element: %s\n", audio_cfg.vol); + printf(" speaker element: %s\n", audio_cfg.spkr); + printf(" headphones element: %s\n", audio_cfg.head); + printf(" + Keyboard backlight control:\n"); + printf(" default level: %d\n", kbd_cfg.auto_lvl); + printf(" step: %d\n", kbd_cfg.step); + printf(" auto on threshold: %d\n", kbd_cfg.on_thresh); + printf(" auto off threshold: %d\n", kbd_cfg.off_thresh); + printf(" auto enable: %s\n", (kbd_cfg.auto_on) ? "yes" : "no"); + printf(" idle timer: %d%s\n", kbd_cfg.idle, (kbd_cfg.idle > 0) ? "s" : ""); + printf(" + CD eject:\n"); + printf(" enabled: %s\n", (eject_cfg.enabled) ? "yes" : "no"); + printf(" device: %s\n", eject_cfg.device); + printf(" + Beep:\n"); + printf(" enabled: %s\n", (beep_cfg.enabled) ? "yes" : "no"); + printf(" beepfile: %s\n", beep_cfg.beepfile); +#ifndef __powerpc__ + printf(" + Apple Remote IR Receiver:\n"); + printf(" enabled: %s\n", (appleir_cfg.enabled) ? "yes" : "no"); +#endif /* !__powerpc__ */ +} + + +int +config_load(void) +{ + cfg_t *cfg; + cfg_t *sec; + + int ret; + + cfg = cfg_init(opts, CFGF_NONE); + + if (cfg == NULL) + { + logmsg(LOG_ERR, "Failed to initialize configuration parser"); + + return -1; + } + + /* Set up config values validation */ + /* general */ + cfg_set_validate_func(cfg, "general|fnmode", config_validate_positive_integer); + /* lcd_sysfs */ + cfg_set_validate_func(cfg, "lcd_sysfs|step", config_validate_positive_integer); + cfg_set_validate_func(cfg, "lcd_sysfs|on_batt", config_validate_positive_integer); +#ifndef __powerpc__ + /* lcd_x1600 */ + cfg_set_validate_func(cfg, "lcd_x1600|step", config_validate_positive_integer); + cfg_set_validate_func(cfg, "lcd_x1600|on_batt", config_validate_positive_integer); + /* lcd_gma950 */ + cfg_set_validate_func(cfg, "lcd_gma950|step", config_validate_positive_integer); + cfg_set_validate_func(cfg, "lcd_gma950|on_batt", config_validate_positive_integer); + /* lcd_nv8600mgt */ + cfg_set_validate_func(cfg, "lcd_nv8600mgt|step", config_validate_positive_integer); + cfg_set_validate_func(cfg, "lcd_nv8600mgt|on_batt", config_validate_positive_integer); +#endif /* !__powerpc__ */ + /* audio */ + cfg_set_validate_func(cfg, "audio|card", config_validate_string); + cfg_set_validate_func(cfg, "audio|step", config_validate_positive_integer); + cfg_set_validate_func(cfg, "audio|volume", config_validate_string); + cfg_set_validate_func(cfg, "audio|speakers", config_validate_string); + cfg_set_validate_func(cfg, "audio|headphones", config_validate_string); + /* kbd */ + cfg_set_validate_func(cfg, "kbd|default", config_validate_positive_integer); + cfg_set_validate_func(cfg, "kbd|step", config_validate_positive_integer); + cfg_set_validate_func(cfg, "kbd|on_threshold", config_validate_positive_integer); + cfg_set_validate_func(cfg, "kbd|off_threshold", config_validate_positive_integer); + /* CD eject */ + cfg_set_validate_func(cfg, "eject|device", config_validate_string); + /* beep */ + cfg_set_validate_func(cfg, "beep|beepfile", config_validate_string); + + /* + * Do the actual parsing. + * If the file does not exist or cannot be opened, + * we'll be using the default values defined in the cfg_opt_t arrays. + */ + ret = cfg_parse(cfg, CONFFILE); + if (ret != CFG_SUCCESS) + { + if (ret == CFG_FILE_ERROR) + { + logmsg(LOG_INFO, "Configuration file not found, using defaults"); + } + else + { + cfg_free(cfg); + + logmsg(LOG_ERR, "Failed to parse configuration file"); + + return -1; + } + } + + /* Fill up the structs */ + sec = cfg_getsec(cfg, "general"); + general_cfg.fnmode = cfg_getint(sec, "fnmode"); + + sec = cfg_getsec(cfg, "lcd_sysfs"); + lcd_sysfs_cfg.init = cfg_getint(sec, "init"); + lcd_sysfs_cfg.step = cfg_getint(sec, "step"); + lcd_sysfs_cfg.on_batt = cfg_getint(sec, "on_batt"); + /* No _fix_config() call here, it's done at probe time */ +#ifndef __powerpc__ + sec = cfg_getsec(cfg, "lcd_x1600"); + lcd_x1600_cfg.init = cfg_getint(sec, "init"); + lcd_x1600_cfg.step = cfg_getint(sec, "step"); + lcd_x1600_cfg.on_batt = cfg_getint(sec, "on_batt"); + x1600_backlight_fix_config(); + + sec = cfg_getsec(cfg, "lcd_gma950"); + lcd_gma950_cfg.init = cfg_getint(sec, "init"); + lcd_gma950_cfg.step = cfg_getint(sec, "step"); + lcd_gma950_cfg.on_batt = cfg_getint(sec, "on_batt"); + /* No _fix_config() call here, as we're hardware-dependent + * for the max backlight value */ + + sec = cfg_getsec(cfg, "lcd_nv8600mgt"); + lcd_nv8600mgt_cfg.init = cfg_getint(sec, "init"); + lcd_nv8600mgt_cfg.step = cfg_getint(sec, "step"); + lcd_nv8600mgt_cfg.on_batt = cfg_getint(sec, "on_batt"); + nv8600mgt_backlight_fix_config(); +#endif /* !__powerpc__ */ + + sec = cfg_getsec(cfg, "audio"); + audio_cfg.card = strdup(cfg_getstr(sec, "card")); + audio_cfg.init = cfg_getint(sec, "init"); + audio_cfg.step = cfg_getint(sec, "step"); + audio_cfg.beep = cfg_getbool(sec, "beep"); + audio_cfg.vol = strdup(cfg_getstr(sec, "volume")); + audio_cfg.spkr = strdup(cfg_getstr(sec, "speakers")); + audio_cfg.head = strdup(cfg_getstr(sec, "headphones")); + audio_fix_config(); + + sec = cfg_getsec(cfg, "kbd"); + kbd_cfg.auto_lvl = cfg_getint(sec, "default"); + kbd_cfg.step = cfg_getint(sec, "step"); + kbd_cfg.on_thresh = cfg_getint(sec, "on_threshold"); + kbd_cfg.off_thresh = cfg_getint(sec, "off_threshold"); + kbd_cfg.auto_on = cfg_getbool(sec, "auto"); + kbd_cfg.idle = cfg_getint(sec, "idle_timer"); + kbd_backlight_fix_config(); + + sec = cfg_getsec(cfg, "eject"); + eject_cfg.enabled = cfg_getbool(sec, "enabled"); + eject_cfg.device = strdup(cfg_getstr(sec, "device")); + cd_eject_fix_config(); + + sec = cfg_getsec(cfg, "beep"); + beep_cfg.enabled = cfg_getbool(sec, "enabled"); + beep_cfg.beepfile = strdup(cfg_getstr(sec, "beepfile")); + beep_fix_config(); + +#ifndef __powerpc__ + sec = cfg_getsec(cfg, "appleir"); + appleir_cfg.enabled = cfg_getbool(sec, "enabled"); +#endif + + cfg_free(cfg); + + if (console) + config_print(); + + return 0; +} + +void +config_cleanup(void) +{ + free(audio_cfg.card); + free(audio_cfg.vol); + free(audio_cfg.spkr); + free(audio_cfg.head); + + free(eject_cfg.device); + + free(beep_cfg.beepfile); +} diff --git a/app-laptop/pommed/pommed-1.31/pommed/conffile.h b/app-laptop/pommed/pommed-1.31/pommed/conffile.h new file mode 100644 index 0000000..5b4a26a --- /dev/null +++ b/app-laptop/pommed/pommed-1.31/pommed/conffile.h @@ -0,0 +1,98 @@ +/* + * pommed - conffile.h + */ + +#ifndef __CONFFILE_H__ +#define __CONFFILE_H__ + +struct _general_cfg { + int fnmode; +}; + +struct _lcd_sysfs_cfg { + int init; + int step; + int on_batt; +}; + + +#ifndef __powerpc__ +struct _lcd_x1600_cfg { + int init; + int step; + int on_batt; +}; + +struct _lcd_gma950_cfg { + unsigned int init; + unsigned int step; + unsigned int on_batt; +}; + +struct _lcd_nv8600mgt_cfg { + int init; + int step; + int on_batt; +}; +#endif /* !__powerpc__ */ + +struct _audio_cfg { + char *card; + int init; + int step; + int beep; + char *vol; + char *spkr; + char *head; +}; + +struct _kbd_cfg { + int auto_lvl; + int step; + int on_thresh; + int off_thresh; + int auto_on; + int idle; +}; + +struct _eject_cfg { + int enabled; + char *device; +}; + +struct _beep_cfg { + int enabled; + char *beepfile; +}; + +#ifndef __powerpc__ +struct _appleir_cfg { + int enabled; +}; +#endif + + +extern struct _general_cfg general_cfg; +extern struct _lcd_sysfs_cfg lcd_sysfs_cfg; +#ifndef __powerpc__ +extern struct _lcd_x1600_cfg lcd_x1600_cfg; +extern struct _lcd_gma950_cfg lcd_gma950_cfg; +extern struct _lcd_nv8600mgt_cfg lcd_nv8600mgt_cfg; +#endif +extern struct _audio_cfg audio_cfg; +extern struct _kbd_cfg kbd_cfg; +extern struct _eject_cfg eject_cfg; +extern struct _beep_cfg beep_cfg; +#ifndef __powerpc__ +extern struct _appleir_cfg appleir_cfg; +#endif + + +int +config_load(void); + +void +config_cleanup(void); + + +#endif /* !__CONFFILE_H__ */ diff --git a/app-laptop/pommed/pommed-1.31/pommed/data/click.wav b/app-laptop/pommed/pommed-1.31/pommed/data/click.wav new file mode 100644 index 0000000..c45e474 Binary files /dev/null and b/app-laptop/pommed/pommed-1.31/pommed/data/click.wav differ diff --git a/app-laptop/pommed/pommed-1.31/pommed/data/goutte.wav b/app-laptop/pommed/pommed-1.31/pommed/data/goutte.wav new file mode 100644 index 0000000..0b54f7f Binary files /dev/null and b/app-laptop/pommed/pommed-1.31/pommed/data/goutte.wav differ diff --git a/app-laptop/pommed/pommed-1.31/pommed/dbus.c b/app-laptop/pommed/pommed-1.31/pommed/dbus.c new file mode 100644 index 0000000..26dc9c9 --- /dev/null +++ b/app-laptop/pommed/pommed-1.31/pommed/dbus.c @@ -0,0 +1,1197 @@ +/* + * pommed - Apple laptops hotkeys handler daemon + * + * Copyright (C) 2006-2007, 2009 Julien BLACHE + * + * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; version 2 of the License. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License along + * with this program; if not, write to the Free Software Foundation, Inc., + * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. + */ + +#include +#include +#include +#include + +#include + +#include + +#include + +#include "pommed.h" +#include "evloop.h" +#include "dbus.h" +#include "lcd_backlight.h" +#include "kbd_backlight.h" +#include "ambient.h" +#include "audio.h" +#include "video.h" +#include "cd_eject.h" + + +static DBusError err; +static DBusConnection *conn; + +static int dbus_timer; + + +void +mbpdbus_send_lcd_backlight(int cur, int prev, int who) +{ + DBusMessage *msg; + + int ret; + + if (conn == NULL) + return; + + logdebug("DBus lcdBacklight: %d %d\n", cur, prev); + + msg = dbus_message_new_signal("/org/pommed/notify/lcdBacklight", + "org.pommed.signal.lcdBacklight", + "lcdBacklight"); + if (msg == NULL) + { + logdebug("Failed to create DBus message\n"); + + return; + } + + ret = dbus_message_append_args(msg, + DBUS_TYPE_UINT32, &cur, + DBUS_TYPE_UINT32, &prev, + DBUS_TYPE_UINT32, &lcd_bck_info.max, + DBUS_TYPE_UINT32, &who, + DBUS_TYPE_INVALID); + if (ret == FALSE) + { + logdebug("Failed to add arguments\n"); + + dbus_message_unref(msg); + + return; + } + + ret = dbus_connection_send(conn, msg, NULL); + if (ret == FALSE) + { + logdebug("Could not send lcdBacklight signal\n"); + + dbus_message_unref(msg); + + return; + } + + dbus_connection_flush(conn); + + dbus_message_unref(msg); +} + +void +mbpdbus_send_kbd_backlight(int cur, int prev, int who) +{ + DBusMessage *msg; + + int ret; + + if (conn == NULL) + return; + + logdebug("DBus kbdBacklight: %d %d\n", cur, prev); + + msg = dbus_message_new_signal("/org/pommed/notify/kbdBacklight", + "org.pommed.signal.kbdBacklight", + "kbdBacklight"); + if (msg == NULL) + { + logdebug("Failed to create DBus message\n"); + + return; + } + + ret = dbus_message_append_args(msg, + DBUS_TYPE_UINT32, &cur, + DBUS_TYPE_UINT32, &prev, + DBUS_TYPE_UINT32, &kbd_bck_info.max, + DBUS_TYPE_UINT32, &who, + DBUS_TYPE_INVALID); + if (ret == FALSE) + { + logdebug("Failed to add arguments\n"); + + dbus_message_unref(msg); + + return; + } + + ret = dbus_connection_send(conn, msg, NULL); + if (ret == FALSE) + { + logdebug("Could not send kbdBacklight signal\n"); + + dbus_message_unref(msg); + + return; + } + + dbus_connection_flush(conn); + + dbus_message_unref(msg); +} + +void +mbpdbus_send_ambient_light(int l, int l_prev, int r, int r_prev) +{ + DBusMessage *msg; + + int ret; + + if (conn == NULL) + return; + + logdebug("DBus ambientLight: %d %d %d %d\n", l, l_prev, r, r_prev); + + msg = dbus_message_new_signal("/org/pommed/notify/ambientLight", + "org.pommed.signal.ambientLight", + "ambientLight"); + if (msg == NULL) + { + logdebug("Failed to create DBus message\n"); + + return; + } + + ret = dbus_message_append_args(msg, + DBUS_TYPE_UINT32, &l, + DBUS_TYPE_UINT32, &l_prev, + DBUS_TYPE_UINT32, &r, + DBUS_TYPE_UINT32, &r_prev, + DBUS_TYPE_UINT32, &ambient_info.max, + DBUS_TYPE_INVALID); + if (ret == FALSE) + { + logdebug("Failed to add arguments\n"); + + dbus_message_unref(msg); + + return; + } + + ret = dbus_connection_send(conn, msg, NULL); + if (ret == FALSE) + { + logdebug("Could not send kbdBacklight signal\n"); + + dbus_message_unref(msg); + + return; + } + + dbus_connection_flush(conn); + + dbus_message_unref(msg); +} + +void +mbpdbus_send_audio_volume(int cur, int prev) +{ + DBusMessage *msg; + + int ret; + + if (conn == NULL) + return; + + logdebug("DBus audioVolume: %d %d\n", cur, prev); + + msg = dbus_message_new_signal("/org/pommed/notify/audioVolume", + "org.pommed.signal.audioVolume", + "audioVolume"); + if (msg == NULL) + { + logdebug("Failed to create DBus message\n"); + + return; + } + + ret = dbus_message_append_args(msg, + DBUS_TYPE_UINT32, &cur, + DBUS_TYPE_UINT32, &prev, + DBUS_TYPE_UINT32, &audio_info.max, + DBUS_TYPE_INVALID); + if (ret == FALSE) + { + logdebug("Failed to add arguments\n"); + + dbus_message_unref(msg); + + return; + } + + ret = dbus_connection_send(conn, msg, NULL); + if (ret == FALSE) + { + logdebug("Could not send audioVolume signal\n"); + + dbus_message_unref(msg); + + return; + } + + dbus_connection_flush(conn); + + dbus_message_unref(msg); +} + +void +mbpdbus_send_audio_mute(int mute) +{ + DBusMessage *msg; + + int ret; + + if (conn == NULL) + return; + + logdebug("DBus audioMute: %d\n", mute); + + msg = dbus_message_new_signal("/org/pommed/notify/audioMute", + "org.pommed.signal.audioMute", + "audioMute"); + if (msg == NULL) + { + logdebug("Failed to create DBus message\n"); + + return; + } + + ret = dbus_message_append_args(msg, + DBUS_TYPE_BOOLEAN, &mute, + DBUS_TYPE_INVALID); + if (ret == FALSE) + { + logdebug("Failed to add arguments\n"); + + dbus_message_unref(msg); + + return; + } + + ret = dbus_connection_send(conn, msg, NULL); + if (ret == FALSE) + { + logdebug("Could not send audioMute signal\n"); + + dbus_message_unref(msg); + + return; + } + + dbus_connection_flush(conn); + + dbus_message_unref(msg); +} + +void +mbpdbus_send_cd_eject(void) +{ + DBusMessage *msg; + + int ret; + + if (conn == NULL) + return; + + logdebug("DBus CD eject\n"); + + msg = dbus_message_new_signal("/org/pommed/notify/cdEject", + "org.pommed.signal.cdEject", + "cdEject"); + if (msg == NULL) + { + logdebug("Failed to create DBus message\n"); + + return; + } + + ret = dbus_connection_send(conn, msg, NULL); + if (ret == FALSE) + { + logdebug("Could not send cdEject signal\n"); + + dbus_message_unref(msg); + + return; + } + + dbus_connection_flush(conn); + + dbus_message_unref(msg); +} + +void +mbpdbus_send_video_switch(void) +{ + DBusMessage *msg; + + int ret; + + if (conn == NULL) + return; + + logdebug("DBus video switch\n"); + + msg = dbus_message_new_signal("/org/pommed/notify/videoSwitch", + "org.pommed.signal.videoSwitch", + "videoSwitch"); + if (msg == NULL) + { + logdebug("Failed to create DBus message\n"); + + return; + } + + ret = dbus_connection_send(conn, msg, NULL); + if (ret == FALSE) + { + logdebug("Could not send videoSwitch signal\n"); + + dbus_message_unref(msg); + + return; + } + + dbus_connection_flush(conn); + + dbus_message_unref(msg); +} + + +static void +process_lcd_getlevel_call(DBusMessage *req) +{ + DBusMessage *msg; + DBusMessageIter args; + + int ret; + + logdebug("Got lcdBacklight getLevel call\n"); + + if (dbus_message_iter_init(req, &args)) + { + logdebug("lcdBacklight getLevel call with arguments ?!\n"); + + return; + } + + msg = dbus_message_new_method_return(req); + + ret = dbus_message_append_args(msg, + DBUS_TYPE_UINT32, &lcd_bck_info.level, + DBUS_TYPE_UINT32, &lcd_bck_info.max, + DBUS_TYPE_INVALID); + if (ret == FALSE) + { + logdebug("Failed to add arguments\n"); + + dbus_message_unref(msg); + + return; + } + + ret = dbus_connection_send(conn, msg, NULL); + if (ret == FALSE) + { + logdebug("Could not send lcdBacklight getLevel reply\n"); + + dbus_message_unref(msg); + + return; + } + + dbus_message_unref(msg); +} + + +static void +process_kbd_getlevel_call(DBusMessage *req) +{ + DBusMessage *msg; + DBusMessageIter args; + + int ret; + + logdebug("Got kbdBacklight getLevel call\n"); + + if (dbus_message_iter_init(req, &args)) + { + logdebug("kbdBacklight getLevel call with arguments ?!\n"); + + return; + } + + msg = dbus_message_new_method_return(req); + + ret = dbus_message_append_args(msg, + DBUS_TYPE_UINT32, &kbd_bck_info.level, + DBUS_TYPE_UINT32, &kbd_bck_info.max, + DBUS_TYPE_INVALID); + if (ret == FALSE) + { + logdebug("Failed to add arguments\n"); + + dbus_message_unref(msg); + + return; + } + + ret = dbus_connection_send(conn, msg, NULL); + if (ret == FALSE) + { + logdebug("Could not send kbdBacklight getLevel reply\n"); + + dbus_message_unref(msg); + + return; + } + + dbus_message_unref(msg); +} + + +static void +process_ambient_getlevel_call(DBusMessage *req) +{ + DBusMessage *msg; + DBusMessageIter args; + + int ret; + + logdebug("Got ambient getLevel call\n"); + + if (dbus_message_iter_init(req, &args)) + { + logdebug("ambient getLevel call with arguments ?!\n"); + + return; + } + + msg = dbus_message_new_method_return(req); + + ret = dbus_message_append_args(msg, + DBUS_TYPE_UINT32, &ambient_info.left, + DBUS_TYPE_UINT32, &ambient_info.right, + DBUS_TYPE_UINT32, &ambient_info.max, + DBUS_TYPE_INVALID); + if (ret == FALSE) + { + logdebug("Failed to add arguments\n"); + + dbus_message_unref(msg); + + return; + } + + ret = dbus_connection_send(conn, msg, NULL); + if (ret == FALSE) + { + logdebug("Could not send ambient getLevel reply\n"); + + dbus_message_unref(msg); + + return; + } + + dbus_message_unref(msg); +} + +static void +process_audio_getvolume_call(DBusMessage *req) +{ + DBusMessage *msg; + DBusMessageIter args; + + int ret; + + logdebug("Got audio getVolume call\n"); + + if (dbus_message_iter_init(req, &args)) + { + logdebug("audio getVolume call with arguments ?!\n"); + + return; + } + + msg = dbus_message_new_method_return(req); + + ret = dbus_message_append_args(msg, + DBUS_TYPE_UINT32, &audio_info.level, + DBUS_TYPE_UINT32, &audio_info.max, + DBUS_TYPE_INVALID); + if (ret == FALSE) + { + logdebug("Failed to add arguments\n"); + + dbus_message_unref(msg); + + return; + } + + ret = dbus_connection_send(conn, msg, NULL); + if (ret == FALSE) + { + logdebug("Could not send audio getVolume reply\n"); + + dbus_message_unref(msg); + + return; + } + + dbus_message_unref(msg); +} + +static void +process_audio_getmute_call(DBusMessage *req) +{ + DBusMessage *msg; + DBusMessageIter args; + + int ret; + + logdebug("Got audio getMute call\n"); + + if (dbus_message_iter_init(req, &args)) + { + logdebug("audio getMute call with arguments ?!\n"); + + return; + } + + msg = dbus_message_new_method_return(req); + + ret = dbus_message_append_args(msg, + DBUS_TYPE_BOOLEAN, &audio_info.muted, + DBUS_TYPE_INVALID); + if (ret == FALSE) + { + logdebug("Failed to add arguments\n"); + + dbus_message_unref(msg); + + return; + } + + ret = dbus_connection_send(conn, msg, NULL); + if (ret == FALSE) + { + logdebug("Could not send audio getMute reply\n"); + + dbus_message_unref(msg); + + return; + } + + dbus_message_unref(msg); +} + +static void +process_video_getvtstate_call(DBusMessage *req) +{ + DBusMessage *msg; + + int vtnum; + int vtstate; + int ret; + + logdebug("Got video getVTState call\n"); + + ret = dbus_message_get_args(req, &err, DBUS_TYPE_UINT32, &vtnum, DBUS_TYPE_INVALID); + if (ret == FALSE) + { + logdebug("video getVTState call with no/inappropriate arguments ?!\n"); + + return; + } + + /* Check VT state */ + vtstate = video_vt_active(vtnum); + + msg = dbus_message_new_method_return(req); + + ret = dbus_message_append_args(msg, + DBUS_TYPE_BOOLEAN, &vtstate, + DBUS_TYPE_INVALID); + if (ret == FALSE) + { + logdebug("Failed to add arguments\n"); + + dbus_message_unref(msg); + + return; + } + + ret = dbus_connection_send(conn, msg, NULL); + if (ret == FALSE) + { + logdebug("Could not send video getVTState reply\n"); + + dbus_message_unref(msg); + + return; + } + + dbus_message_unref(msg); +} + + +static void +process_lcd_backlight_step_call(DBusMessage *req, int dir) +{ + DBusMessage *msg; + + int ret; + + logdebug("Got lcdBacklight levelUp/levelDown call\n"); + + mops->lcd_backlight_step(dir); + + msg = dbus_message_new_method_return(req); + + ret = dbus_connection_send(conn, msg, NULL); + if (ret == FALSE) + { + logdebug("Could not send lcdBacklight levelUp/levelDown reply\n"); + + dbus_message_unref(msg); + + return; + } + + dbus_message_unref(msg); +} + +static void +process_kbd_backlight_inhibit_call(DBusMessage *req, int inhibit) +{ + DBusMessage *msg; + + int ret; + + logdebug("Got kbdBacklight inhibit call\n"); + + if (inhibit) + kbd_backlight_inhibit_set(KBD_INHIBIT_USER); + else + kbd_backlight_inhibit_clear(KBD_INHIBIT_USER); + + msg = dbus_message_new_method_return(req); + + ret = dbus_connection_send(conn, msg, NULL); + if (ret == FALSE) + { + logdebug("Could not send kbdBacklight inhibit reply\n"); + + dbus_message_unref(msg); + + return; + } + + dbus_message_unref(msg); +} + +static void +process_audio_volume_step_call(DBusMessage *req, int dir) +{ + DBusMessage *msg; + + int ret; + + logdebug("Got audio volumeUp/volumeDown call\n"); + + audio_step(dir); + + msg = dbus_message_new_method_return(req); + + ret = dbus_connection_send(conn, msg, NULL); + if (ret == FALSE) + { + logdebug("Could not send audio volumeUp/volumeDown reply\n"); + + dbus_message_unref(msg); + + return; + } + + dbus_message_unref(msg); +} + +static void +process_audio_toggle_mute_call(DBusMessage *req) +{ + DBusMessage *msg; + + int ret; + + logdebug("Got audio toggleMute call\n"); + + audio_toggle_mute(); + + msg = dbus_message_new_method_return(req); + + ret = dbus_connection_send(conn, msg, NULL); + if (ret == FALSE) + { + logdebug("Could not send audio toggleMute reply\n"); + + dbus_message_unref(msg); + + return; + } + + dbus_message_unref(msg); +} + +static void +process_cd_eject_call(DBusMessage *req) +{ + DBusMessage *msg; + + int ret; + + logdebug("Got cd eject call\n"); + + cd_eject(); + + msg = dbus_message_new_method_return(req); + + ret = dbus_connection_send(conn, msg, NULL); + if (ret == FALSE) + { + logdebug("Could not send cd eject reply\n"); + + dbus_message_unref(msg); + + return; + } + + dbus_message_unref(msg); +} + + +static void +mbpdbus_reconnect(int id, uint64_t ticks) +{ + int ret; + + ret = mbpdbus_init(); + if (ret == 0) + { + evloop_remove_timer(id); + dbus_timer = -1; + } +} + +static DBusHandlerResult +mbpdbus_process_requests(DBusConnection *lconn, DBusMessage *msg, void *data) +{ + // Get methods + if (dbus_message_is_method_call(msg, "org.pommed.lcdBacklight", "getLevel")) + process_lcd_getlevel_call(msg); + else if (dbus_message_is_method_call(msg, "org.pommed.kbdBacklight", "getLevel")) + process_kbd_getlevel_call(msg); + else if (dbus_message_is_method_call(msg, "org.pommed.ambient", "getLevel")) + process_ambient_getlevel_call(msg); + else if (dbus_message_is_method_call(msg, "org.pommed.audio", "getVolume")) + process_audio_getvolume_call(msg); + else if (dbus_message_is_method_call(msg, "org.pommed.audio", "getMute")) + process_audio_getmute_call(msg); + else if (dbus_message_is_method_call(msg, "org.pommed.video", "getVTState")) + process_video_getvtstate_call(msg); + // Set methods + else if (dbus_message_is_method_call(msg, "org.pommed.lcdBacklight", "levelUp")) + process_lcd_backlight_step_call(msg, STEP_UP); + else if (dbus_message_is_method_call(msg, "org.pommed.lcdBacklight", "levelDown")) + process_lcd_backlight_step_call(msg, STEP_DOWN); + else if (dbus_message_is_method_call(msg, "org.pommed.kbdBacklight", "inhibit")) + process_kbd_backlight_inhibit_call(msg, 1); + else if (dbus_message_is_method_call(msg, "org.pommed.kbdBacklight", "disinhibit")) + process_kbd_backlight_inhibit_call(msg, 0); + else if (dbus_message_is_method_call(msg, "org.pommed.audio", "volumeUp")) + process_audio_volume_step_call(msg, STEP_UP); + else if (dbus_message_is_method_call(msg, "org.pommed.audio", "volumeDown")) + process_audio_volume_step_call(msg, STEP_DOWN); + else if (dbus_message_is_method_call(msg, "org.pommed.audio", "toggleMute")) + process_audio_toggle_mute_call(msg); + else if (dbus_message_is_method_call(msg, "org.pommed.cd", "eject")) + process_cd_eject_call(msg); + else if (dbus_message_is_signal(msg, DBUS_INTERFACE_LOCAL, "Disconnected")) + { + logmsg(LOG_INFO, "DBus disconnected"); + + mbpdbus_cleanup(); + + dbus_timer = evloop_add_timer(DBUS_TIMEOUT, mbpdbus_reconnect); + if (dbus_timer < 0) + logmsg(LOG_WARNING, "Could not set up timer for DBus reconnection"); + } + else + return DBUS_HANDLER_RESULT_NOT_YET_HANDLED; + + return DBUS_HANDLER_RESULT_HANDLED; +} + + +/* DBusWatch functions */ +struct pommed_watch +{ + DBusWatch *watch; + int fd; + uint32_t events; + int enabled; + + struct pommed_watch *next; +}; + + +static struct pommed_watch *watches; + + +static uint32_t +dbus_to_epoll(int flags) +{ + uint32_t events; + + events = 0; + + if (flags & DBUS_WATCH_READABLE) + events |= EPOLLIN; + + if (flags & DBUS_WATCH_WRITABLE) + events |= EPOLLOUT | EPOLLET; + + return events; +} + +static int +epoll_to_dbus(uint32_t events) +{ + int flags; + + flags = 0; + + if (events & EPOLLIN) + flags |= DBUS_WATCH_READABLE; + + if (events & EPOLLOUT) + flags |= DBUS_WATCH_WRITABLE; + + if (events & EPOLLHUP) + flags |= DBUS_WATCH_HANGUP; + + if (events & EPOLLERR) + flags |= DBUS_WATCH_ERROR; + + return flags; +} + +static void +mbpdbus_process_watch(int fd, uint32_t events) +{ + int flags; + uint32_t wanted; + + DBusDispatchStatus ds; + + struct pommed_watch *w; + + logdebug("DBus process watch\n"); + + for (w = watches; w != NULL; w = w->next) + { + if (!w->enabled) + continue; + + if (w->fd == fd) + { + wanted = events & w->events; + + if (wanted != 0) + { + flags = epoll_to_dbus(wanted); + + dbus_watch_handle(w->watch, flags); + + do + { + ds = dbus_connection_dispatch(conn); + } + while (ds == DBUS_DISPATCH_DATA_REMAINS); + + /* Get out of the loop, as DBus will remove the watches + * and our linked list can become invalid under our feet + */ + if (events & (EPOLLERR | EPOLLHUP)) + break; + } + } + } +} + +static dbus_bool_t +mbpdbus_add_watch(DBusWatch *watch, void *data) +{ + uint32_t events; + int fd; + int ret; + + struct pommed_watch *w; + + logdebug("DBus add watch\n"); + + fd = dbus_watch_get_unix_fd(watch); + + events = 0; + for (w = watches; w != NULL; w = w->next) + { + if (w->enabled && (w->fd == fd)) + events |= w->events; + } + + if (events != 0) + { + ret = evloop_remove(fd); + if (ret < 0) + { + logmsg(LOG_ERR, "Could not remove previous watch on same fd"); + + return FALSE; + } + } + + w = (struct pommed_watch *)malloc(sizeof(struct pommed_watch)); + if (w == NULL) + { + logmsg(LOG_ERR, "Could not allocate memory for a new DBus watch"); + + return FALSE; + } + + w->watch = watch; + w->fd = fd; + w->enabled = 1; + + w->events = dbus_to_epoll(dbus_watch_get_flags(watch)); + w->events |= EPOLLERR | EPOLLHUP; + + events |= w->events; + + ret = evloop_add(fd, events, mbpdbus_process_watch); + if (ret < 0) + { + free(w); + + return FALSE; + } + + w->next = watches; + watches = w; + + return TRUE; +} + +static void +mbpdbus_remove_watch(DBusWatch *watch, void *data) +{ + uint32_t events; + int fd; + int ret; + + struct pommed_watch *w; + struct pommed_watch *p; + + logdebug("DBus remove watch %p\n", watch); + + fd = dbus_watch_get_unix_fd(watch); + events = 0; + + for (p = NULL, w = watches; w != NULL; p = w, w = w->next) + { + if (w->watch == watch) + { + if (p != NULL) + p->next = w->next; + else + watches = w->next; + + free(w); + + continue; + } + + if (w->enabled && (w->fd == fd)) + events |= w->events; + } + + ret = evloop_remove(fd); + if (ret < 0) + return; + + if (events == 0) + return; + + ret = evloop_add(fd, events, mbpdbus_process_watch); + if (ret < 0) + logmsg(LOG_WARNING, "Could not re-add watch"); +} + +static void +mbpdbus_toggle_watch(DBusWatch *watch, void *data) +{ + uint32_t events; + int fd; + int ret; + + struct pommed_watch *w; + + logdebug("DBus toggle watch\n"); + + fd = dbus_watch_get_unix_fd(watch); + events = 0; + + for (w = watches; w != NULL; w = w->next) + { + if (w->watch == watch) + { + if (!dbus_watch_get_enabled(watch)) + w->enabled = 0; + else + { + w->enabled = 1; + events |= w->events; + } + + continue; + } + + if (w->enabled && (w->fd == fd)) + events |= events; + } + + ret = evloop_remove(fd); + if (ret < 0) + return; + + if (events == 0) + return; + + ret = evloop_add(fd, events, mbpdbus_process_watch); + if (ret < 0) + logmsg(LOG_WARNING, "Could not re-add watch"); +} + +static void +mbpdbus_data_free(void *data) +{ + /* NOTHING */ +} + + +int +mbpdbus_init(void) +{ + int ret; + + watches = NULL; + dbus_timer = -1; + + dbus_error_init(&err); + + conn = dbus_bus_get(DBUS_BUS_SYSTEM, &err); + if (dbus_error_is_set(&err)) + { + logmsg(LOG_ERR, "DBus system bus connection failed: %s", err.message); + + dbus_error_free(&err); + + conn = NULL; + + goto init_reconnect; + } + + dbus_connection_set_exit_on_disconnect(conn, FALSE); + + ret = dbus_bus_request_name(conn, "org.pommed", 0, &err); + + if (dbus_error_is_set(&err)) + { + logmsg(LOG_ERR, "Failed to request DBus name: %s", err.message); + + mbpdbus_cleanup(); + + goto init_reconnect; + } + + if (ret != DBUS_REQUEST_NAME_REPLY_PRIMARY_OWNER) + { + logmsg(LOG_ERR, "Not primary DBus name owner"); + + mbpdbus_cleanup(); + + goto init_reconnect; + } + + ret = dbus_connection_set_watch_functions(conn, mbpdbus_add_watch, mbpdbus_remove_watch, + mbpdbus_toggle_watch, NULL, mbpdbus_data_free); + if (!ret) + { + mbpdbus_cleanup(); + + goto init_reconnect; + } + + dbus_connection_add_filter(conn, mbpdbus_process_requests, NULL, NULL); + + return 0; + + init_reconnect: + if (dbus_timer > 0) /* Trying to reconnect already, called from mbpdbus_reconnect() */ + return -1; + + dbus_timer = evloop_add_timer(DBUS_TIMEOUT, mbpdbus_reconnect); + if (dbus_timer < 0) + { + logmsg(LOG_ERR, "Could not set up timer for DBus reconnection"); + + return -1; + } + + return 0; +} + +void +mbpdbus_cleanup(void) +{ + if (dbus_timer > 0) + evloop_remove_timer(dbus_timer); + + if (conn == NULL) + return; + + dbus_error_free(&err); + + /* This is a shared connection owned by libdbus + * Do not close it, only unref + */ + dbus_connection_unref(conn); + conn = NULL; +} diff --git a/app-laptop/pommed/pommed-1.31/pommed/dbus.h b/app-laptop/pommed/pommed-1.31/pommed/dbus.h new file mode 100644 index 0000000..d6c42a9 --- /dev/null +++ b/app-laptop/pommed/pommed-1.31/pommed/dbus.h @@ -0,0 +1,40 @@ +/* + * pommed - dbus.h + */ + +#ifndef __MBPDBUS_H__ +#define __MBPDBUS_H__ + +#define DBUS_TIMEOUT 200 + + +void +mbpdbus_send_lcd_backlight(int cur, int prev, int who); + +void +mbpdbus_send_kbd_backlight(int cur, int prev, int who); + +void +mbpdbus_send_ambient_light(int l, int l_prev, int r, int r_prev); + +void +mbpdbus_send_audio_volume(int cur, int prev); + +void +mbpdbus_send_audio_mute(int mute); + +void +mbpdbus_send_cd_eject(void); + +void +mbpdbus_send_video_switch(void); + + +int +mbpdbus_init(void); + +void +mbpdbus_cleanup(void); + + +#endif /* !__MBPDBUS_H__ */ diff --git a/app-laptop/pommed/pommed-1.31/pommed/evdev.c b/app-laptop/pommed/pommed-1.31/pommed/evdev.c new file mode 100644 index 0000000..05bc109 --- /dev/null +++ b/app-laptop/pommed/pommed-1.31/pommed/evdev.c @@ -0,0 +1,1000 @@ +/* + * pommed - Apple laptops hotkeys handler daemon + * + * Copyright (C) 2006-2009 Julien BLACHE + * + * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; version 2 of the License. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License along + * with this program; if not, write to the Free Software Foundation, Inc., + * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. + */ + +#include +#include +#include +#include +#include +#include +#include + +#include + +#include + +#include + +#ifndef NO_SYS_INOTIFY_H +# include +#else +# include +# include "inotify-syscalls.h" +#endif + +#include + +#include "pommed.h" +#include "conffile.h" +#include "evdev.h" +#include "evloop.h" +#include "kbd_backlight.h" +#include "lcd_backlight.h" +#include "cd_eject.h" +#include "audio.h" +#include "video.h" +#include "beep.h" + + +#define BITS_PER_LONG (sizeof(long) * 8) +#define NBITS(x) ((((x)-1)/BITS_PER_LONG)+1) +#define OFF(x) ((x)%BITS_PER_LONG) +#define BIT(x) (1UL<> OFF(bit)) & 1) + +/* Added to linux/input.h after Linux 2.6.18 */ +#ifndef BUS_VIRTUAL +# define BUS_VIRTUAL 0x06 +#endif + + +static int +evdev_try_add(int fd); + + +static int internal_kbd_fd; + +void +evdev_process_events(int fd, uint32_t events) +{ + int ret; + + struct input_event ev; + + /* some of the event devices cease to exist when suspending */ + if (events & (EPOLLERR | EPOLLHUP)) + { + logmsg(LOG_INFO, "Error condition signaled on event device"); + + ret = evloop_remove(fd); + if (ret < 0) + logmsg(LOG_ERR, "Could not remove device from event loop"); + + if (fd == internal_kbd_fd) + internal_kbd_fd = -1; + + close(fd); + + return; + } + + ret = read(fd, &ev, sizeof(struct input_event)); + + if (ret != sizeof(struct input_event)) + return; + + if (ev.type == EV_KEY) + { + /* key released - we don't care */ + if (ev.value == 0) + return; + + /* Reset keyboard backlight idle timer */ + if (fd == internal_kbd_fd) + { + kbd_bck_info.idle = 0; + kbd_backlight_inhibit_clear(KBD_INHIBIT_IDLE); + } + + switch (ev.code) + { + case KEY_BRIGHTNESSDOWN: + logdebug("\nKEY: LCD backlight down\n"); + + mops->lcd_backlight_step(STEP_DOWN); + break; + + case KEY_BRIGHTNESSUP: + logdebug("\nKEY: LCD backlight up\n"); + + mops->lcd_backlight_step(STEP_UP); + break; + + case KEY_MUTE: + logdebug("\nKEY: audio mute\n"); + + audio_toggle_mute(); + break; + + case KEY_VOLUMEDOWN: + logdebug("\nKEY: audio down\n"); + + audio_step(STEP_DOWN); + break; + + case KEY_VOLUMEUP: + logdebug("\nKEY: audio up\n"); + + audio_step(STEP_UP); + break; + + case KEY_SWITCHVIDEOMODE: + logdebug("\nKEY: video toggle\n"); + + video_switch(); + break; + + case KEY_KBDILLUMTOGGLE: + logdebug("\nKEY: keyboard backlight off\n"); + + if (!has_kbd_backlight()) + break; + + if (kbd_cfg.auto_on) + kbd_backlight_inhibit_toggle(KBD_INHIBIT_USER); + else + kbd_backlight_toggle(); + break; + + case KEY_KBDILLUMDOWN: + logdebug("\nKEY: keyboard backlight down\n"); + + if (!has_kbd_backlight()) + break; + + kbd_backlight_step(STEP_DOWN); + break; + + case KEY_KBDILLUMUP: + logdebug("\nKEY: keyboard backlight up\n"); + + if (!has_kbd_backlight()) + break; + + kbd_backlight_step(STEP_UP); + break; + + case KEY_EJECTCD: + logdebug("\nKEY: CD eject\n"); + + cd_eject(); + break; + + case KEY_NEXTSONG: + logdebug("\nKEY: IR fast forward\n"); + break; + + case KEY_PREVIOUSSONG: + logdebug("\nKEY: IR rewind\n"); + break; + + case KEY_PLAYPAUSE: + logdebug("\nKEY: IR play/pause\n"); + break; + + case KEY_MENU: + logdebug("\nKEY: IR menu\n"); + break; + + default: +#if 0 + logdebug("\nKEY: %x\n", ev.code); +#endif /* 0 */ + break; + } + } + else if (ev.type == EV_SW) + { + /* Lid switch */ + if (ev.code == SW_LID) + { + if (ev.value) + { + logdebug("\nLID: closed\n"); + + kbd_backlight_inhibit_set(KBD_INHIBIT_LID); + } + else + { + logdebug("\nLID: open\n"); + + kbd_backlight_inhibit_clear(KBD_INHIBIT_LID); + } + } + } +} + + +void +evdev_inotify_process(int fd, uint32_t events) +{ + int ret; + int efd; + int qsize; + + struct inotify_event *all_ie; + struct inotify_event *ie; + char evdev[32]; + + if (events & (EPOLLERR | EPOLLHUP)) + { + logmsg(LOG_WARNING, "inotify fd lost; this should not happen"); + + ret = evloop_remove(fd); + if (ret < 0) + logmsg(LOG_ERR, "Could not remove inotify from event loop"); + + close(fd); + + return; + } + + /* Determine the size of the inotify queue */ + ret = ioctl(fd, FIONREAD, &qsize); + if (ret < 0) + { + logmsg(LOG_ERR, "Could not determine inotify queue size: %s", strerror(errno)); + + return; + } + + all_ie = (struct inotify_event *) malloc(qsize); + if (all_ie == NULL) + { + logmsg(LOG_ERR, "Could not allocate %d bytes for inotify events", qsize); + + return; + } + + ret = read(fd, all_ie, qsize); + if (ret < 0) + { + logmsg(LOG_WARNING, "inotify read failed: %s", strerror(errno)); + + free(all_ie); + return; + } + + /* ioctl(FIONREAD) returns the number of bytes, now we need the number of elements */ + qsize /= sizeof(struct inotify_event); + + /* Loop through all the events we got */ + for (ie = all_ie; (ie - all_ie) < qsize; ie += (1 + (ie->len / sizeof(struct inotify_event)))) + { + /* ie[0] contains the inotify event information + * the memory space for ie[1+] contains the name of the file + * see the inotify documentation + */ + + if ((ie->len == 0) || (ie->name == NULL)) + { + logdebug("inotify event with no name\n"); + + continue; + } + + logdebug("Found new event device %s/%s\n", EVDEV_DIR, ie->name); + + if (strncmp("event", ie->name, 5)) + { + logdebug("Discarding %s/%s\n", EVDEV_DIR, ie->name); + + continue; + } + + ret = snprintf(evdev, sizeof(evdev), "%s/%s", EVDEV_DIR, ie->name); + + if ((ret <= 0) || (ret >= sizeof(evdev))) + continue; + + efd = open(evdev, O_RDWR); + if (efd < 0) + { + if (errno != ENOENT) + logmsg(LOG_WARNING, "Could not open %s: %s", evdev, strerror(errno)); + + continue; + } + + evdev_try_add(efd); + } + + free(all_ie); +} + + +#ifdef __powerpc__ +/* PowerBook G4 Titanium */ +static int +evdev_is_adb(unsigned short *id) +{ + unsigned short product = id[ID_PRODUCT]; + + if (id[ID_BUS] != BUS_ADB) + return 0; + + if (id[ID_VENDOR] != 0x0001) + return 0; + + if (product == ADB_PRODUCT_ID_KEYBOARD) + { + logdebug(" -> ADB keyboard\n"); + + return 1; + } + + if (product == ADB_PRODUCT_ID_PBBUTTONS) + { + logdebug(" -> ADB PowerBook buttons\n"); + + return 1; + } + + return 0; +} + +/* PowerBook G4 */ +static int +evdev_is_fountain(unsigned short *id) +{ + unsigned short product = id[ID_PRODUCT]; + + if (id[ID_BUS] != BUS_USB) + return 0; + + if (id[ID_VENDOR] != USB_VENDOR_ID_APPLE) + return 0; + + if ((product == USB_PRODUCT_ID_FOUNTAIN_ANSI) + || (product == USB_PRODUCT_ID_FOUNTAIN_ISO) + || (product == USB_PRODUCT_ID_FOUNTAIN_JIS)) + { + logdebug(" -> Fountain USB assembly\n"); + + return 1; + } + + return 0; +} + +static int +evdev_is_geyser(unsigned short *id) +{ + unsigned short product = id[ID_PRODUCT]; + + if (id[ID_BUS] != BUS_USB) + return 0; + + if (id[ID_VENDOR] != USB_VENDOR_ID_APPLE) + return 0; + + if ((product == USB_PRODUCT_ID_GEYSER_ANSI) + || (product == USB_PRODUCT_ID_GEYSER_ISO) + || (product == USB_PRODUCT_ID_GEYSER_JIS)) + { + logdebug(" -> Geyser USB assembly\n"); + + kbd_set_fnmode(); + + return 1; + } + + return 0; +} + +/* Any internal keyboard */ +static int +evdev_is_internal(unsigned short *id) +{ + return (evdev_is_adb(id) + || evdev_is_fountain(id) + || evdev_is_geyser(id)); +} + + +/* PMU Lid switch */ +static int +evdev_is_lidswitch(unsigned short *id) +{ + unsigned short product = id[ID_PRODUCT]; + + if (id[ID_BUS] != BUS_HOST) + return 0; + + if (id[ID_VENDOR] != 0x0001) + return 0; + + if (id[ID_VERSION] != 0x0100) + return 0; + + if (product == 0x0001) + { + logdebug(" -> PMU LID switch\n"); + + return 1; + } + + return 0; +} + +#else + +/* Core Duo MacBook & MacBook Pro */ +static int +evdev_is_geyser3(unsigned short *id) +{ + unsigned short product = id[ID_PRODUCT]; + + if (id[ID_BUS] != BUS_USB) + return 0; + + if (id[ID_VENDOR] != USB_VENDOR_ID_APPLE) + return 0; + + if ((product == USB_PRODUCT_ID_GEYSER3_ANSI) + || (product == USB_PRODUCT_ID_GEYSER3_ISO) + || (product == USB_PRODUCT_ID_GEYSER3_JIS)) + { + logdebug(" -> Geyser III USB assembly\n"); + + kbd_set_fnmode(); + + return 1; + } + + return 0; +} + +/* Core2 Duo MacBook & MacBook Pro */ +static int +evdev_is_geyser4(unsigned short *id) +{ + unsigned short product = id[ID_PRODUCT]; + + if (id[ID_BUS] != BUS_USB) + return 0; + + if (id[ID_VENDOR] != USB_VENDOR_ID_APPLE) + return 0; + + if ((product == USB_PRODUCT_ID_GEYSER4_ANSI) + || (product == USB_PRODUCT_ID_GEYSER4_ISO) + || (product == USB_PRODUCT_ID_GEYSER4_JIS)) + { + logdebug(" -> Geyser IV USB assembly\n"); + + kbd_set_fnmode(); + + return 1; + } + + return 0; +} + +/* Core2 Duo Santa Rosa MacBook (MacBook3,1) + Core2 Duo MacBook (MacBook4,1, February 2008) */ +static int +evdev_is_geyser4hf(unsigned short *id) +{ + unsigned short product = id[ID_PRODUCT]; + + if (id[ID_BUS] != BUS_USB) + return 0; + + if (id[ID_VENDOR] != USB_VENDOR_ID_APPLE) + return 0; + + if ((product == USB_PRODUCT_ID_GEYSER4HF_ANSI) + || (product == USB_PRODUCT_ID_GEYSER4HF_ISO) + || (product == USB_PRODUCT_ID_GEYSER4HF_JIS)) + { + logdebug(" -> Geyser IV-HF USB assembly\n"); + + kbd_set_fnmode(); + + return 1; + } + + return 0; +} + +/* MacBook Air (MacBookAir1,1, January 2008) */ +static int +evdev_is_wellspring(unsigned short *id) +{ + unsigned short product = id[ID_PRODUCT]; + + if (id[ID_BUS] != BUS_USB) + return 0; + + if (id[ID_VENDOR] != USB_VENDOR_ID_APPLE) + return 0; + + if ((product == USB_PRODUCT_ID_WELLSPRING_ANSI) + || (product == USB_PRODUCT_ID_WELLSPRING_ISO) + || (product == USB_PRODUCT_ID_WELLSPRING_JIS)) + { + logdebug(" -> WellSpring USB assembly\n"); + + kbd_set_fnmode(); + + return 1; + } + + return 0; +} + +/* Core2 Duo MacBook Pro (MacBookPro4,1, February 2008) */ +static int +evdev_is_wellspring2(unsigned short *id) +{ + unsigned short product = id[ID_PRODUCT]; + + if (id[ID_BUS] != BUS_USB) + return 0; + + if (id[ID_VENDOR] != USB_VENDOR_ID_APPLE) + return 0; + + if ((product == USB_PRODUCT_ID_WELLSPRING2_ANSI) + || (product == USB_PRODUCT_ID_WELLSPRING2_ISO) + || (product == USB_PRODUCT_ID_WELLSPRING2_JIS)) + { + logdebug(" -> WellSpring II USB assembly\n"); + + kbd_set_fnmode(); + + return 1; + } + + return 0; +} + +/* Core2 Duo MacBook Pro (MacBookPro5,1, October 2008) + * Core2 Duo MacBook (MacBook5,1, October 2008) + * MacBook Air (MacBookAir2,1, October 2008) */ +static int +evdev_is_wellspring3(unsigned short *id) +{ + unsigned short product = id[ID_PRODUCT]; + + if (id[ID_BUS] != BUS_USB) + return 0; + + if (id[ID_VENDOR] != USB_VENDOR_ID_APPLE) + return 0; + + if ((product == USB_PRODUCT_ID_WELLSPRING3_ANSI) + || (product == USB_PRODUCT_ID_WELLSPRING3_ISO) + || (product == USB_PRODUCT_ID_WELLSPRING3_JIS)) + { + logdebug(" -> WellSpring III USB assembly\n"); + + kbd_set_fnmode(); + + return 1; + } + + return 0; +} + +/* Any internal keyboard */ +static int +evdev_is_internal(unsigned short *id) +{ + return (evdev_is_geyser3(id) + || evdev_is_geyser4(id) + || evdev_is_geyser4hf(id) + || evdev_is_wellspring(id) + || evdev_is_wellspring2(id) + || evdev_is_wellspring3(id)); +} + + +/* Apple Remote IR Receiver */ +static int +evdev_is_appleir(unsigned short *id) +{ + unsigned short product = id[ID_PRODUCT]; + + if (id[ID_BUS] != BUS_USB) + return 0; + + if (id[ID_VENDOR] != USB_VENDOR_ID_APPLE) + return 0; + + if ((product == USB_PRODUCT_ID_APPLEIR) + || (product == USB_PRODUCT_ID_APPLEIR_2)) + { + logdebug(" -> Apple IR receiver\n"); + + return 1; + } + + return 0; +} + +/* ACPI Lid switch */ +static int +evdev_is_lidswitch(unsigned short *id) +{ + unsigned short product = id[ID_PRODUCT]; + + if (id[ID_BUS] != BUS_HOST) + return 0; + + if (id[ID_VENDOR] != 0) + return 0; + + if (product == 0x0005) + { + logdebug(" -> ACPI LID switch\n"); + + return 1; + } + + return 0; +} +#endif /* !__powerpc__ */ + +/* Apple external USB keyboard, white */ +static int +evdev_is_extkbd_white(unsigned short *id) +{ + unsigned short product = id[ID_PRODUCT]; + + if (id[ID_BUS] != BUS_USB) + return 0; + + if (id[ID_VENDOR] != USB_VENDOR_ID_APPLE) + return 0; + + if (product == USB_PRODUCT_ID_APPLE_EXTKBD_WHITE) + { + logdebug(" -> External Apple USB keyboard (white)\n"); + + kbd_set_fnmode(); + + return 1; + } + + return 0; +} + +/* Apple external USB mini keyboard, aluminium */ +static int +evdev_is_extkbd_mini_alu(unsigned short *id) +{ + unsigned short product = id[ID_PRODUCT]; + + if (id[ID_BUS] != BUS_USB) + return 0; + + if (id[ID_VENDOR] != USB_VENDOR_ID_APPLE) + return 0; + + if ((product == USB_PRODUCT_ID_APPLE_EXTKBD_MINI_ALU_ANSI) + || (product == USB_PRODUCT_ID_APPLE_EXTKBD_MINI_ALU_ISO) + || (product == USB_PRODUCT_ID_APPLE_EXTKBD_MINI_ALU_JIS)) + { + logdebug(" -> External Apple USB mini keyboard (aluminium)\n"); + + kbd_set_fnmode(); + + return 1; + } + + return 0; +} + +/* Apple external USB keyboard, aluminium */ +static int +evdev_is_extkbd_alu(unsigned short *id) +{ + unsigned short product = id[ID_PRODUCT]; + + if (id[ID_BUS] != BUS_USB) + return 0; + + if (id[ID_VENDOR] != USB_VENDOR_ID_APPLE) + return 0; + + if ((product == USB_PRODUCT_ID_APPLE_EXTKBD_ALU_ANSI) + || (product == USB_PRODUCT_ID_APPLE_EXTKBD_ALU_ISO) + || (product == USB_PRODUCT_ID_APPLE_EXTKBD_ALU_JIS)) + { + logdebug(" -> External Apple USB keyboard (aluminium)\n"); + + kbd_set_fnmode(); + + return 1; + } + + return 0; +} + +/* Apple external wireless keyboard, aluminium */ +static int +evdev_is_extkbd_alu_wl(unsigned short *id) +{ + unsigned short product = id[ID_PRODUCT]; + + if (id[ID_BUS] != BUS_BLUETOOTH) + return 0; + + if (id[ID_VENDOR] != USB_VENDOR_ID_APPLE) + return 0; + + if ((product == USB_PRODUCT_ID_APPLE_EXTKBD_ALU_WL_ANSI) + || (product == USB_PRODUCT_ID_APPLE_EXTKBD_ALU_WL_ISO) + || (product == USB_PRODUCT_ID_APPLE_EXTKBD_ALU_WL_JIS)) + { + logdebug(" -> External Apple wireless keyboard (aluminium)\n"); + + kbd_set_fnmode(); + + return 1; + } + + return 0; +} + +/* Apple external wireless keyboard, aluminium, newer model */ +static int +evdev_is_extkbd_alu_wl_2(unsigned short *id) +{ + unsigned short product = id[ID_PRODUCT]; + + if (id[ID_BUS] != BUS_BLUETOOTH) + return 0; + + if (id[ID_VENDOR] != USB_VENDOR_ID_APPLE) + return 0; + + if ((product == USB_PRODUCT_ID_APPLE_EXTKBD_ALU_WL_2_ANSI) + || (product == USB_PRODUCT_ID_APPLE_EXTKBD_ALU_WL_2_ISO) + || (product == USB_PRODUCT_ID_APPLE_EXTKBD_ALU_WL_2_JIS)) + { + logdebug(" -> External Apple wireless keyboard 2 (aluminium)\n"); + + kbd_set_fnmode(); + + return 1; + } + + return 0; +} + +/* Any external Apple USB keyboard */ +static int +evdev_is_extkbd(unsigned short *id) +{ + return (evdev_is_extkbd_white(id) + || evdev_is_extkbd_mini_alu(id) + || evdev_is_extkbd_alu(id) + || evdev_is_extkbd_alu_wl(id) + || evdev_is_extkbd_alu_wl_2(id)); +} + +/* Mouseemu virtual keyboard */ +static int +evdev_is_mouseemu(unsigned short *id) +{ + unsigned short product = id[ID_PRODUCT]; + + if (id[ID_BUS] != BUS_VIRTUAL) + return 0; + + if (id[ID_VENDOR] != 0x001f) + return 0; + + if (product == 0x001f) + { + logdebug(" -> Mouseemu virtual keyboard\n"); + + return 1; + } + + return 0; +} + + +static int +evdev_try_add(int fd) +{ + unsigned short id[4]; + unsigned long bit[EV_MAX][NBITS(KEY_MAX)]; + char devname[256]; + + int ret; + + devname[0] = '\0'; + ioctl(fd, EVIOCGNAME(sizeof(devname)), devname); + + logdebug("\nInvestigating evdev [%s]\n", devname); + + ioctl(fd, EVIOCGID, id); + + if ((!evdev_is_internal(id)) +#ifndef __powerpc__ + && !(appleir_cfg.enabled && evdev_is_appleir(id)) +#endif + && !(has_kbd_backlight() && evdev_is_lidswitch(id)) + && !(evdev_is_mouseemu(id)) + && !(evdev_is_extkbd(id))) + { + logdebug("Discarding evdev: bus 0x%04x, vid 0x%04x, pid 0x%04x\n", id[ID_BUS], id[ID_VENDOR], id[ID_PRODUCT]); + + close(fd); + + return -1; + } + + memset(bit, 0, sizeof(bit)); + + ioctl(fd, EVIOCGBIT(0, EV_MAX), bit[0]); + + if (!test_bit(EV_KEY, bit[0])) + { + logdebug("evdev: no EV_KEY event type (not a keyboard)\n"); + + if (!test_bit(EV_SW, bit[0])) + { + logdebug("Discarding evdev: no EV_SW event type (not a switch)\n"); + + close(fd); + + return -1; + } + } + /* Wireless keyboards advertise EV_ABS events, single them out */ + else if (test_bit(EV_ABS, bit[0]) && !(evdev_is_extkbd_alu_wl(id))) + { + logdebug("Discarding evdev with EV_ABS event type (mouse/trackpad)\n"); + + close(fd); + + return -1; + } + + /* There are 2 keyboards, but one of them only has the eject key; + the real keyboard has all the keys and the LEDs. Checking for + the LEDs is a quick way of identifying the keyboard we want. + */ + if (test_bit(EV_LED, bit[0]) && evdev_is_internal(id)) + { + logdebug(" -> Internal keyboard\n"); + + internal_kbd_fd = fd; + } + + ret = evloop_add(fd, EPOLLIN, evdev_process_events); + if (ret < 0) + { + logmsg(LOG_ERR, "Could not add device to event loop"); + + if (fd == internal_kbd_fd) + internal_kbd_fd = -1; + + close(fd); + + return -1; + } + + return 0; +} + + +static int +evdev_inotify_init(void) +{ + int ret; + int fd; + + fd = inotify_init(); + if (fd < 0) + { + logmsg(LOG_ERR, "Failed to initialize inotify: %s", strerror(errno)); + + return -1; + } + + ret = inotify_add_watch(fd, EVDEV_DIR, IN_CREATE | IN_ONLYDIR); + if (ret < 0) + { + logmsg(LOG_ERR, "Failed to add inotify watch for %s: %s", EVDEV_DIR, strerror(errno)); + + close(fd); + fd = -1; + + return -1; + } + + ret = evloop_add(fd, EPOLLIN, evdev_inotify_process); + if (ret < 0) + { + logmsg(LOG_ERR, "Failed to add inotify fd to event loop"); + + close(fd); + + return -1; + } + + return 0; +} + + +int +evdev_init(void) +{ + int ret; + int i; + + char evdev[32]; + + int ndevs; + int fd; + + internal_kbd_fd = -1; + + ndevs = 0; + for (i = 0; i < EVDEV_MAX; i++) + { + ret = snprintf(evdev, 32, "%s%d", EVDEV_BASE, i); + + if ((ret <= 0) || (ret > 31)) + return -1; + + fd = open(evdev, O_RDWR); + if (fd < 0) + { + if (errno != ENOENT) + logmsg(LOG_WARNING, "Could not open %s: %s", evdev, strerror(errno)); + + continue; + } + + if (evdev_try_add(fd) == 0) + ndevs++; + } + + logdebug("\nFound %d devices\n", ndevs); + + /* Initialize inotify */ + evdev_inotify_init(); + + return ndevs; +} + +void +evdev_cleanup(void) +{ + /* evloop_cleanup() takes care of closing the devices */ +} diff --git a/app-laptop/pommed/pommed-1.31/pommed/evdev.h b/app-laptop/pommed/pommed-1.31/pommed/evdev.h new file mode 100644 index 0000000..43ee863 --- /dev/null +++ b/app-laptop/pommed/pommed-1.31/pommed/evdev.h @@ -0,0 +1,105 @@ +/* + * pommed - evdev.h + */ + +#ifndef __EVDEV_H__ +#define __EVDEV_H__ + + +/****** ADB Devices ******/ + +/* Keyboard as found on the PowerBook3,2 */ +#define ADB_PRODUCT_ID_KEYBOARD 0x22c4 +/* Special PowerBook buttons as found on the PowerBook3,2 */ +#define ADB_PRODUCT_ID_PBBUTTONS 0x771f + + +/****** USB Devices ******/ + +#define USB_VENDOR_ID_APPLE 0x05ac + +/* Fountain & Geyser devices : AppleUSBTopCase.kext/Contents/PlugIns/AppleUSBTrackpad.kext */ + +/* Apple Fountain keyboard + trackpad */ +#define USB_PRODUCT_ID_FOUNTAIN_ANSI 0x020e +#define USB_PRODUCT_ID_FOUNTAIN_ISO 0x020f +#define USB_PRODUCT_ID_FOUNTAIN_JIS 0x0210 + +/* Apple Geyser keyboard + trackpad */ +#define USB_PRODUCT_ID_GEYSER_ANSI 0x0214 +#define USB_PRODUCT_ID_GEYSER_ISO 0x0215 +#define USB_PRODUCT_ID_GEYSER_JIS 0x0216 + +/* Apple Geyser III keyboard + trackpad */ +#define USB_PRODUCT_ID_GEYSER3_ANSI 0x0217 +#define USB_PRODUCT_ID_GEYSER3_ISO 0x0218 +#define USB_PRODUCT_ID_GEYSER3_JIS 0x0219 + +/* Apple Geyser IV keyboard + trackpad */ +#define USB_PRODUCT_ID_GEYSER4_ANSI 0x021a +#define USB_PRODUCT_ID_GEYSER4_ISO 0x021b +#define USB_PRODUCT_ID_GEYSER4_JIS 0x021c + +/* Apple Geyser IV-HF keyboard + trackpad */ +#define USB_PRODUCT_ID_GEYSER4HF_ANSI 0x0229 +#define USB_PRODUCT_ID_GEYSER4HF_ISO 0x022a +#define USB_PRODUCT_ID_GEYSER4HF_JIS 0x022b + +/* WellSpring devices : AppleUSBMultitouch.kext */ + +/* Apple WellSpring keyboard + trackpad */ +#define USB_PRODUCT_ID_WELLSPRING_ANSI 0x0223 +#define USB_PRODUCT_ID_WELLSPRING_ISO 0x0224 +#define USB_PRODUCT_ID_WELLSPRING_JIS 0x0225 + +/* Apple WellSpring II keyboard + trackpad */ +#define USB_PRODUCT_ID_WELLSPRING2_ANSI 0x0230 +#define USB_PRODUCT_ID_WELLSPRING2_ISO 0x0231 +#define USB_PRODUCT_ID_WELLSPRING2_JIS 0x0232 + +/* Apple WellSpring III keyboard + trackpad */ +#define USB_PRODUCT_ID_WELLSPRING3_ANSI 0x0236 +#define USB_PRODUCT_ID_WELLSPRING3_ISO 0x0237 +#define USB_PRODUCT_ID_WELLSPRING3_JIS 0x0238 + + +/* Apple external USB keyboard, white */ +#define USB_PRODUCT_ID_APPLE_EXTKBD_WHITE 0x020c + +/* Apple external USB mini keyboard, aluminium */ +#define USB_PRODUCT_ID_APPLE_EXTKBD_MINI_ALU_ANSI 0x021d +#define USB_PRODUCT_ID_APPLE_EXTKBD_MINI_ALU_ISO 0x021e +#define USB_PRODUCT_ID_APPLE_EXTKBD_MINI_ALU_JIS 0x021f + +/* Apple external USB keyboard, aluminium */ +#define USB_PRODUCT_ID_APPLE_EXTKBD_ALU_ANSI 0x0220 +#define USB_PRODUCT_ID_APPLE_EXTKBD_ALU_ISO 0x0221 +#define USB_PRODUCT_ID_APPLE_EXTKBD_ALU_JIS 0x0222 + +/* Apple external wireless keyboard, aluminium */ +#define USB_PRODUCT_ID_APPLE_EXTKBD_ALU_WL_ANSI 0x022c +#define USB_PRODUCT_ID_APPLE_EXTKBD_ALU_WL_ISO 0x022d +#define USB_PRODUCT_ID_APPLE_EXTKBD_ALU_WL_JIS 0x022e + +/* Apple external wireless keyboard, aluminium, newer model */ +#define USB_PRODUCT_ID_APPLE_EXTKBD_ALU_WL_2_ANSI 0x0239 +#define USB_PRODUCT_ID_APPLE_EXTKBD_ALU_WL_2_ISO 0x023a +#define USB_PRODUCT_ID_APPLE_EXTKBD_ALU_WL_2_JIS 0x023b + +/* Apple Remote IR Receiver */ +#define USB_PRODUCT_ID_APPLEIR 0x8240 +#define USB_PRODUCT_ID_APPLEIR_2 0x8242 + + +#define EVDEV_DIR "/dev/input" +#define EVDEV_BASE "/dev/input/event" +#define EVDEV_MAX 32 + + +int +evdev_init(void); + +void +evdev_cleanup(void); + +#endif /* !__EVDEV_H__ */ diff --git a/app-laptop/pommed/pommed-1.31/pommed/evloop.c b/app-laptop/pommed/pommed-1.31/pommed/evloop.c new file mode 100644 index 0000000..dcd29a2 --- /dev/null +++ b/app-laptop/pommed/pommed-1.31/pommed/evloop.c @@ -0,0 +1,428 @@ +/* + * pommed - Apple laptops hotkeys handler daemon + * + * Copyright (C) 2006-2008 Julien BLACHE + * + * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; version 2 of the License. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License along + * with this program; if not, write to the Free Software Foundation, Inc., + * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. + */ + +#include +#include +#include +#include +#include +#include +#include + +#include + +#include + +#include + +#ifndef NO_SYS_TIMERFD_H +# include +#else +# include "timerfd-syscalls.h" +#endif + +#include "pommed.h" +#include "evloop.h" + + +/* epoll fd */ +static int epfd; + +/* event sources registered on the main loop */ +static struct pommed_event *sources; + +/* timers */ +static struct pommed_timer *timers; +static int timer_job_id; + +static int running; + + +int +evloop_add(int fd, uint32_t events, pommed_event_cb cb) +{ + int ret; + + struct epoll_event epoll_ev; + struct pommed_event *pommed_ev; + + pommed_ev = (struct pommed_event *)malloc(sizeof(*pommed_ev)); + + if (pommed_ev == NULL) + { + logmsg(LOG_ERR, "Could not allocate memory for new source"); + + return -1; + } + + pommed_ev->fd = fd; + pommed_ev->cb = cb; + pommed_ev->next = sources; + + epoll_ev.events = events; + epoll_ev.data.ptr = pommed_ev; + + ret = epoll_ctl(epfd, EPOLL_CTL_ADD, fd, &epoll_ev); + + if (ret < 0) + { + logmsg(LOG_ERR, "Could not add source to epoll: %s", strerror(errno)); + + free(pommed_ev); + return -1; + } + + sources = pommed_ev; + + return 0; +} + +int +evloop_remove(int fd) +{ + int ret; + + struct pommed_event *p; + struct pommed_event *e; + + ret = epoll_ctl(epfd, EPOLL_CTL_DEL, fd, NULL); + + if (ret < 0) + { + logmsg(LOG_ERR, "Could not remove source from epoll: %s", strerror(errno)); + + return -1; + } + + for (p = NULL, e = sources; e != NULL; p = e, e = e->next) + { + if (e->fd != fd) + continue; + + if (p != NULL) + p->next = e->next; + else + sources = e->next; + + free(e); + + break; + } + + return 0; +} + + +static void +evloop_timer_callback(int fd, uint32_t events) +{ + uint64_t ticks; + + struct pommed_timer *t; + struct pommed_timer_job *j; + + /* Acknowledge timer */ + read(fd, &ticks, sizeof(ticks)); + + j = NULL; + for (t = timers; t != NULL; t = t->next) + { + if (t->fd == fd) + { + j = t->jobs; + + break; + } + } + + while (j != NULL) + { + j->cb(j->id, ticks); + + j = j->next; + } +} + +static int +evloop_create_timer(int timeout) +{ + int fd; + int ret; + + struct itimerspec timing; + + fd = timerfd_create(CLOCK_MONOTONIC, 0); + if (fd < 0) + { + logmsg(LOG_ERR, "Could not create timer: %s", strerror(errno)); + + return -1; + } + + timing.it_interval.tv_sec = (timeout >= 1000) ? timeout / 1000 : 0; + timing.it_interval.tv_nsec = (timeout - (timing.it_interval.tv_sec * 1000)) * 1000000; + + ret = clock_gettime(CLOCK_MONOTONIC, &timing.it_value); + if (ret < 0) + { + logmsg(LOG_ERR, "Could not get current time: %s", strerror(errno)); + + close(fd); + return -1; + } + + timing.it_value.tv_sec += timing.it_interval.tv_sec; + timing.it_value.tv_nsec += timing.it_interval.tv_nsec; + if (timing.it_value.tv_nsec > 1000000000) + { + timing.it_value.tv_sec++; + timing.it_value.tv_nsec -= 1000000000; + } + + ret = timerfd_settime(fd, TFD_TIMER_ABSTIME, &timing, NULL); + if (ret < 0) + { + logmsg(LOG_ERR, "Could not setup timer: %s", strerror(errno)); + + close(fd); + return -1; + } + + ret = evloop_add(fd, EPOLLIN, evloop_timer_callback); + if (ret < 0) + { + close(fd); + return -1; + } + + return fd; +} + +int +evloop_add_timer(int timeout, pommed_timer_cb cb) +{ + int fd; + + struct pommed_timer *t; + struct pommed_timer_job *j; + + j = (struct pommed_timer_job *)malloc(sizeof(struct pommed_timer_job)); + if (j == NULL) + { + logmsg(LOG_ERR, "Could not allocate memory for timer job"); + return -1; + } + + j->cb = cb; + j->id = timer_job_id; + timer_job_id++; + + for (t = timers; t != NULL; t = t->next) + { + if (t->timeout == timeout) + break; + } + + if (t == NULL) + { + t = (struct pommed_timer *)malloc(sizeof(struct pommed_timer)); + if (t == NULL) + { + logmsg(LOG_ERR, "Could not allocate memory for timer"); + return -1; + } + + fd = evloop_create_timer(timeout); + if (fd < 0) + { + free(t); + return -1; + } + + t->fd = fd; + t->timeout = timeout; + t->jobs = NULL; + t->next = timers; + timers = t; + } + + j->next = t->jobs; + t->jobs = j; + + return 0; +} + +int +evloop_remove_timer(int id) +{ + int found; + int ret; + + struct pommed_timer *t; + struct pommed_timer *pt; + struct pommed_timer_job *j; + struct pommed_timer_job *pj; + + found = 0; + for (pt = NULL, t = timers; t != NULL; pt = t, t = t->next) + { + for (pj = NULL, j = t->jobs; j != NULL; pj = j, j = j->next) + { + if (j->id == id) + { + if (pj != NULL) + pj->next = j->next; + else + t->jobs = j->next; + + free(j); + + found = 1; + + break; + } + } + + if (found) + break; + } + + if (t == NULL) + return 0; + + if (t->jobs == NULL) + { + ret = evloop_remove(t->fd); + if (ret < 0) + return ret; + + close(t->fd); + + if (pt != NULL) + pt->next = t->next; + else + timers = t->next; + + free(t); + } + + return 0; +} + + +int +evloop_iteration(void) +{ + int i; + int nfds; + + struct epoll_event epoll_ev[MAX_EPOLL_EVENTS]; + struct pommed_event *pommed_ev; + + if (!running) + return -1; + + nfds = epoll_wait(epfd, epoll_ev, MAX_EPOLL_EVENTS, -1); + + if (nfds < 0) + { + if (errno == EINTR) + return 0; /* pommed.c will continue */ + else + { + logmsg(LOG_ERR, "epoll_wait() error: %s", strerror(errno)); + + return -1; /* pommed.c will exit */ + } + } + + for (i = 0; i < nfds; i++) + { + pommed_ev = epoll_ev[i].data.ptr; + pommed_ev->cb(pommed_ev->fd, epoll_ev[i].events); + } + + return nfds; +} + +void +evloop_stop(void) +{ + running = 0; +} + + +int +evloop_init(void) +{ + sources = NULL; + + timers = NULL; + timer_job_id = 0; + + running = 1; + + epfd = epoll_create(MAX_EPOLL_EVENTS); + if (epfd < 0) + { + logmsg(LOG_ERR, "Could not create epoll fd: %s", strerror(errno)); + + return -1; + } + + return 0; +} + +void +evloop_cleanup(void) +{ + struct pommed_event *p; + struct pommed_timer *t; + struct pommed_timer_job *j; + struct pommed_timer_job *jobs; + + close(epfd); + + while (sources != NULL) + { + p = sources; + sources = sources->next; + + close(p->fd); + + free(p); + } + + while (timers != NULL) + { + t = timers; + timers = timers->next; + + jobs = t->jobs; + while (jobs != NULL) + { + j = jobs; + jobs = jobs->next; + + free(j); + } + + free(t); + } +} diff --git a/app-laptop/pommed/pommed-1.31/pommed/evloop.h b/app-laptop/pommed/pommed-1.31/pommed/evloop.h new file mode 100644 index 0000000..855ce58 --- /dev/null +++ b/app-laptop/pommed/pommed-1.31/pommed/evloop.h @@ -0,0 +1,65 @@ +/* + * pommed - evloop.h + */ + +#ifndef __EVLOOP_H__ +#define __EVLOOP_H__ + + +#define MAX_EPOLL_EVENTS 8 + +typedef void(*pommed_event_cb)(int fd, uint32_t events); + +struct pommed_event +{ + int fd; + pommed_event_cb cb; + struct pommed_event *next; +}; + +typedef void(*pommed_timer_cb)(int id, uint64_t ticks); + +struct pommed_timer_job +{ + int id; + pommed_timer_cb cb; + + struct pommed_timer_job *next; +}; + +struct pommed_timer +{ + int fd; + int timeout; + struct pommed_timer_job *jobs; + + struct pommed_timer *next; +}; + + +int +evloop_add(int fd, uint32_t events, pommed_event_cb cb); + +int +evloop_remove(int fd); + +int +evloop_add_timer(int timeout, pommed_timer_cb cb); + +int +evloop_remove_timer(int id); + +int +evloop_iteration(void); + +void +evloop_stop(void); + +int +evloop_init(void); + +void +evloop_cleanup(void); + + +#endif /* __EVLOOP_H__ */ diff --git a/app-laptop/pommed/pommed-1.31/pommed/inotify-syscalls.h b/app-laptop/pommed/pommed-1.31/pommed/inotify-syscalls.h new file mode 100644 index 0000000..a1d5408 --- /dev/null +++ b/app-laptop/pommed/pommed-1.31/pommed/inotify-syscalls.h @@ -0,0 +1,98 @@ +/* + * Inotify syscall numbers + * Taken from the Linux kernel source tree + * + * Licensed under the terms of the GNU General Public License Version 2. + * + * Copyright (c) 2006 Tobias Klauser + */ + +#ifndef _LINUX_INOTIFY_SYSCALLS_H +#define _LINUX_INOTIFY_SYSCALLS_H + +#include + +#if defined(__i386__) +# define __NR_inotify_init 291 +# define __NR_inotify_add_watch 292 +# define __NR_inotify_rm_watch 293 +#elif defined(__x86_64__) +# define __NR_inotify_init 253 +# define __NR_inotify_add_watch 254 +# define __NR_inotify_rm_watch 255 +#elif defined(__powerpc__) || defined(__powerpc64__) +# define __NR_inotify_init 275 +# define __NR_inotify_add_watch 276 +# define __NR_inotify_rm_watch 277 +#elif defined (__ia64__) +# define __NR_inotify_init 1277 +# define __NR_inotify_add_watch 1278 +# define __NR_inotify_rm_watch 1279 +#elif defined (__s390__) +# define __NR_inotify_init 284 +# define __NR_inotify_add_watch 285 +# define __NR_inotify_rm_watch 286 +#elif defined (__alpha__) +# define __NR_inotify_init 444 +# define __NR_inotify_add_watch 445 +# define __NR_inotify_rm_watch 446 +#elif defined (__sparc__) || defined (__sparc64__) +# define __NR_inotify_init 151 +# define __NR_inotify_add_watch 152 +# define __NR_inotify_rm_watch 156 +#elif defined (__arm__) +# define __NR_OABI_SYSCALL_BASE 0x900000 +# if defined(__thumb__) || defined(__ARM_EABI__) +# define __NR_SYSCALL_BASE 0 +# else +# define __NR_SYSCALL_BASE __NR_OABI_SYSCALL_BASE +# endif +# define __NR_inotify_init (__NR_SYSCALL_BASE + 316) +# define __NR_inotify_add_watch (__NR_SYSCALL_BASE + 317) +# define __NR_inotify_rm_watch (__NR_SYSCALL_BASE + 318) +#elif defined (__sh__) +# define __NR_inotify_init 290 +# define __NR_inotify_add_watch 291 +# define __NR_inotify_rm_watch 292 +#elif defined (__hppa__) +# define __NR_inotify_init 269 +# define __NR_inotify_add_watch 270 +# define __NR_inotify_rm_watch 271 +#elif defined (__mips__) +# include +# if _MIPS_SIM == _MIPS_SIM_ABI32 +# define __NR_Linux 4000 +# define __NR_inotify_init (__NR_Linux + 284) +# define __NR_inotify_add_watch (__NR_Linux + 285) +# define __NR_inotify_rm_watch (__NR_Linux + 286) +# elif _MIPS_SIM == _MIPS_SIM_ABI64 +# define __NR_Linux 5000 +# define __NR_inotify_init (__NR_Linux + 243) +# define __NR_inotify_add_watch (__NR_Linux + 244) +# define __NR_inotify_rm_watch (__NR_Linux + 245) +# elif _MIPS_SIM == _MIPS_SIM_NABI32 +# define __NR_Linux 6000 +# define __NR_inotify_init (__NR_Linux + 247) +# define __NR_inotify_add_watch (__NR_Linux + 248) +# define __NR_inotify_rm_watch (__NR_Linux + 249) +# endif +#else +# error "inotify not supported on this architecture!" +#endif + +static inline int inotify_init (void) +{ + return syscall (__NR_inotify_init); +} + +static inline int inotify_add_watch (int fd, const char *name, __u32 mask) +{ + return syscall (__NR_inotify_add_watch, fd, name, mask); +} + +static inline int inotify_rm_watch (int fd, __u32 wd) +{ + return syscall (__NR_inotify_rm_watch, fd, wd); +} + +#endif /* _LINUX_INOTIFY_SYSCALLS_H */ diff --git a/app-laptop/pommed/pommed-1.31/pommed/kbd_auto.c b/app-laptop/pommed/pommed-1.31/pommed/kbd_auto.c new file mode 100644 index 0000000..d513262 --- /dev/null +++ b/app-laptop/pommed/pommed-1.31/pommed/kbd_auto.c @@ -0,0 +1,169 @@ +/* + * pommed - Apple laptops hotkeys handler daemon + * + * Copyright (C) 2006-2008 Julien BLACHE + * + * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; version 2 of the License. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License along + * with this program; if not, write to the Free Software Foundation, Inc., + * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. + */ + + +static int kbd_timer; + + +/* simple backlight toggle */ +void +kbd_backlight_toggle(void) +{ + int curval; + + curval = kbd_backlight_get(); + + if (curval != KBD_BACKLIGHT_OFF) + { + kbd_bck_info.toggle_lvl = curval; + kbd_backlight_set(KBD_BACKLIGHT_OFF, KBD_USER); + } + else + { + if (kbd_bck_info.toggle_lvl < kbd_cfg.auto_lvl) + kbd_bck_info.toggle_lvl = kbd_cfg.auto_lvl; + + kbd_backlight_set(kbd_bck_info.toggle_lvl, KBD_USER); + } +} + + +/* Automatic backlight */ +void +kbd_backlight_inhibit_set(int mask) +{ + if (!kbd_bck_info.inhibit) + kbd_bck_info.inhibit_lvl = kbd_bck_info.level; + + kbd_backlight_set(KBD_BACKLIGHT_OFF, + (mask & KBD_MASK_AUTO) ? (KBD_AUTO) : (KBD_USER)); + + kbd_bck_info.inhibit |= mask; + + logdebug("KBD: inhibit set 0x%02x -> 0x%02x\n", mask, kbd_bck_info.inhibit); +} + +void +kbd_backlight_inhibit_clear(int mask) +{ + int flag; + + flag = kbd_bck_info.inhibit & mask; + + kbd_bck_info.inhibit &= ~mask; + + logdebug("KBD: inhibit clear 0x%02x -> 0x%02x\n", mask, kbd_bck_info.inhibit); + + if (kbd_bck_info.inhibit || !flag) + return; + + if (kbd_bck_info.auto_on) + { + kbd_bck_info.auto_on = 0; + kbd_bck_info.inhibit_lvl = 0; + } + + kbd_backlight_set(kbd_bck_info.inhibit_lvl, + (mask & KBD_MASK_AUTO) ? (KBD_AUTO) : (KBD_USER)); +} + +void +kbd_backlight_inhibit_toggle(int mask) +{ + if (kbd_bck_info.inhibit & mask) + kbd_backlight_inhibit_clear(mask); + else + kbd_backlight_inhibit_set(mask); +} + + +void +kbd_backlight_ambient_check(void) +{ + int amb_r, amb_l; + + ambient_get(&amb_r, &amb_l); + + if ((amb_r < 0) || (amb_l < 0)) + return; + + mbpdbus_send_ambient_light(amb_l, kbd_bck_info.l_sens, amb_r, kbd_bck_info.r_sens); + + kbd_bck_info.r_sens = amb_r; + kbd_bck_info.l_sens = amb_l; + + /* Inhibited */ + if (kbd_bck_info.inhibit) + return; + + if ((amb_r < kbd_cfg.on_thresh) && (amb_l < kbd_cfg.on_thresh)) + { + logdebug("Ambient light lower threshold reached\n"); + + /* backlight already on */ + if (kbd_backlight_get() > KBD_BACKLIGHT_OFF) + return; + + /* turn on backlight */ + kbd_bck_info.auto_on = 1; + + kbd_backlight_set(kbd_cfg.auto_lvl, KBD_AUTO); + } + else if (kbd_bck_info.auto_on) + { + if ((amb_r > kbd_cfg.off_thresh) || (amb_l > kbd_cfg.off_thresh)) + { + logdebug("Ambient light upper threshold reached\n"); + + kbd_bck_info.auto_on = 0; + + kbd_backlight_set(KBD_BACKLIGHT_OFF, KBD_AUTO); + } + } +} + + +static void +kbd_auto_process(int id, uint64_t ticks) +{ + /* Increment keyboard backlight idle timer */ + kbd_bck_info.idle += KBD_TIMEOUT; + if ((kbd_cfg.idle > 0) && (kbd_bck_info.idle > 1000 * kbd_cfg.idle)) + kbd_backlight_inhibit_set(KBD_INHIBIT_IDLE); + + kbd_backlight_ambient_check(); +} + + +static int +kbd_auto_init(void) +{ + kbd_timer = evloop_add_timer(KBD_TIMEOUT, kbd_auto_process); + if (kbd_timer < 0) + return -1; + + return 0; +} + +static void +kbd_auto_cleanup(void) +{ + if (kbd_timer > 0) + evloop_remove_timer(kbd_timer); +} diff --git a/app-laptop/pommed/pommed-1.31/pommed/kbd_backlight.h b/app-laptop/pommed/pommed-1.31/pommed/kbd_backlight.h new file mode 100644 index 0000000..f0fa40b --- /dev/null +++ b/app-laptop/pommed/pommed-1.31/pommed/kbd_backlight.h @@ -0,0 +1,108 @@ +/* + * pommed - kbd_backlight.h + */ + +#ifndef __KBD_BACKLIGHT_H__ +#define __KBD_BACKLIGHT_H__ + +#define KBD_BACKLIGHT_OFF 0 +#define KBD_BACKLIGHT_MAX 255 + +/* fading duration in milliseconds */ +#define KBD_BACKLIGHT_FADE_LENGTH 350 +#define KBD_BACKLIGHT_FADE_STEPS 20 + +#define KBD_INHIBIT_USER (1 << 0) +#define KBD_INHIBIT_LID (1 << 1) +#define KBD_INHIBIT_CFG (1 << 2) +#define KBD_INHIBIT_IDLE (1 << 3) + +#define KBD_MASK_AUTO (KBD_INHIBIT_LID | KBD_INHIBIT_IDLE) + +#define KBD_USER 0 +#define KBD_AUTO 1 + +#define KBD_TIMEOUT 200 + + +struct _kbd_bck_info +{ + int level; + int max; + + int inhibit; + int inhibit_lvl; + + int toggle_lvl; /* backlight level for simple toggle */ + + int auto_on; /* automatic */ + int idle; /* idle timer */ + int r_sens; /* right sensor */ + int l_sens; /* left sensor */ +}; + +extern struct _kbd_bck_info kbd_bck_info; + +#ifdef __powerpc__ +static inline int +has_kbd_backlight(void) +{ + return ((mops->type == MACHINE_POWERBOOK_51) + || (mops->type == MACHINE_POWERBOOK_52) + || (mops->type == MACHINE_POWERBOOK_53) + || (mops->type == MACHINE_POWERBOOK_54) + || (mops->type == MACHINE_POWERBOOK_55) + || (mops->type == MACHINE_POWERBOOK_56) + || (mops->type == MACHINE_POWERBOOK_57) + || (mops->type == MACHINE_POWERBOOK_58) + || (mops->type == MACHINE_POWERBOOK_59)); +} + +#else + +static inline int +has_kbd_backlight(void) +{ + return ((mops->type == MACHINE_MACBOOKPRO_1) + || (mops->type == MACHINE_MACBOOKPRO_2) + || (mops->type == MACHINE_MACBOOKPRO_3) + || (mops->type == MACHINE_MACBOOKPRO_4) + || (mops->type == MACHINE_MACBOOKPRO_5) + || (mops->type == MACHINE_MACBOOK_5) + || (mops->type == MACHINE_MACBOOKAIR_1) + || (mops->type == MACHINE_MACBOOKAIR_2)); +} +#endif /* __powerpc__ */ + + +void +kbd_backlight_step(int dir); + +void +kbd_backlight_init(void); + +void +kbd_backlight_cleanup(void); + +void +kbd_backlight_fix_config(void); + + +/* In kbd_auto.c */ +void +kbd_backlight_toggle(void); + +void +kbd_backlight_inhibit_set(int mask); + +void +kbd_backlight_inhibit_clear(int mask); + +void +kbd_backlight_inhibit_toggle(int mask); + +void +kbd_backlight_ambient_check(void); + + +#endif /* !__KBD_BACKLIGHT_H__ */ diff --git a/app-laptop/pommed/pommed-1.31/pommed/lcd_backlight.h b/app-laptop/pommed/pommed-1.31/pommed/lcd_backlight.h new file mode 100644 index 0000000..20feecc --- /dev/null +++ b/app-laptop/pommed/pommed-1.31/pommed/lcd_backlight.h @@ -0,0 +1,106 @@ +/* + * pommed - lcd_backlight.h + */ + +#ifndef __LCD_BACKLIGHT_H__ +#define __LCD_BACKLIGHT_H__ + + +struct _lcd_bck_info +{ + int level; + int ac_lvl; + int max; +}; + +extern struct _lcd_bck_info lcd_bck_info; + + +#define LCD_USER 0 +#define LCD_AUTO 1 + +#define LCD_ON_AC_LEVEL 0 +#define LCD_ON_BATT_LEVEL 1 + + +#ifndef __powerpc__ +/* x1600_backlight.c */ +#define X1600_BACKLIGHT_OFF 0 +#define X1600_BACKLIGHT_MAX 255 + +void +x1600_backlight_step(int dir); + +void +x1600_backlight_toggle(int lvl); + +int +x1600_backlight_probe(void); + +void +x1600_backlight_fix_config(void); + + +/* gma950_backlight.c */ +#define GMA950_BACKLIGHT_MIN 0x1f +/* Beware, GMA950_BACKLIGHT_MAX is dynamic, see source */ + +void +gma950_backlight_step(int dir); + +void +gma950_backlight_toggle(int lvl); + +int +gma950_backlight_probe(void); + + +/* nv8600mgt_backlight.c */ +#define NV8600MGT_BACKLIGHT_OFF 0 +#define NV8600MGT_BACKLIGHT_MAX 15 + +void +nv8600mgt_backlight_step(int dir); + +void +nv8600mgt_backlight_toggle(int lvl); + +int +nv8600mgt_backlight_probe(void); + +void +nv8600mgt_backlight_fix_config(void); +#endif /* !__powerpc__ */ + + +/* sysfs_backlight.c */ +#define SYSFS_BACKLIGHT_OFF 0 + +void +sysfs_backlight_step(int dir); + +void +sysfs_backlight_toggle(int lvl); + +#ifdef __powerpc__ +void +sysfs_backlight_step_kernel(int dir); + +void +sysfs_backlight_toggle_kernel(int lvl); + +int +aty128_sysfs_backlight_probe(void); + +int +r9x00_sysfs_backlight_probe(void); + +int +nvidia_sysfs_backlight_probe(void); +#else +int +mbp_sysfs_backlight_probe(void); +#endif + + +#endif /* !__LCD_BACKLIGHT_H__ */ diff --git a/app-laptop/pommed/pommed-1.31/pommed/mactel/acpi.c b/app-laptop/pommed/pommed-1.31/pommed/mactel/acpi.c new file mode 100644 index 0000000..8a5f520 --- /dev/null +++ b/app-laptop/pommed/pommed-1.31/pommed/mactel/acpi.c @@ -0,0 +1,71 @@ +/* + * pommed - Apple laptops hotkeys handler daemon + * + * Copyright (C) 2006-2008 Julien BLACHE + * + * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; version 2 of the License. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License along + * with this program; if not, write to the Free Software Foundation, Inc., + * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. + */ + +#include +#include +#include +#include + +#include "../pommed.h" +#include "../power.h" + + +#define PROC_ACPI_AC_STATE "/proc/acpi/ac_adapter/ADP1/state" +#define PROC_ACPI_AC_ONLINE "on-line\n" +#define PROC_ACPI_AC_OFFLINE "off-line\n" + + +/* Internal API - procfs ACPI */ +int +procfs_check_ac_state(void) +{ + FILE *fp; + char buf[128]; + int ret; + + fp = fopen(PROC_ACPI_AC_STATE, "r"); + if (fp == NULL) + return AC_STATE_ERROR; + + ret = fread(buf, 1, 127, fp); + + if (ferror(fp) != 0) + { + logdebug("acpi: Error reading proc AC state: %s\n", strerror(errno)); + return AC_STATE_ERROR; + } + + if (feof(fp) == 0) + { + logdebug("acpi: Error reading proc AC state: buffer too small\n"); + return AC_STATE_ERROR; + } + + fclose(fp); + + buf[ret] = '\0'; + + if (strstr(buf, PROC_ACPI_AC_ONLINE) != NULL) + return AC_STATE_ONLINE; + + if (strstr(buf, PROC_ACPI_AC_OFFLINE) != NULL) + return AC_STATE_OFFLINE; + + return AC_STATE_UNKNOWN; +} diff --git a/app-laptop/pommed/pommed-1.31/pommed/mactel/ambient.c b/app-laptop/pommed/pommed-1.31/pommed/mactel/ambient.c new file mode 100644 index 0000000..9243ffc --- /dev/null +++ b/app-laptop/pommed/pommed-1.31/pommed/mactel/ambient.c @@ -0,0 +1,132 @@ +/* + * pommed - Apple laptops hotkeys handler daemon + * + * Copyright (C) 2006-2007 Julien BLACHE + * + * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; version 2 of the License. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License along + * with this program; if not, write to the Free Software Foundation, Inc., + * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. + */ + +#include +#include +#include +#include +#include +#include +#include +#include + +#include + +#include "../pommed.h" +#include "../ambient.h" + + +#define APPLESMC_SYSFS_BASE "/sys/devices/platform" +static char smcpath[64]; + + +struct _ambient_info ambient_info; + + +void +ambient_get(int *r, int *l) +{ + int fd; + int ret; + char buf[16]; + char *p; + + fd = open(smcpath, O_RDONLY); + if (fd < 0) + { + *r = -1; + *l = -1; + + ambient_info.right = 0; + ambient_info.left = 0; + + return; + } + + ret = read(fd, buf, 16); + + close(fd); + + if ((ret <= 0) || (ret > 15)) + { + *r = -1; + *l = -1; + + ambient_info.right = 0; + ambient_info.left = 0; + + return; + } + + buf[strlen(buf)] = '\0'; + + p = strchr(buf, ','); + *p++ = '\0'; + *r = atoi(p); + + p = buf + 1; + *l = atoi(p); + + logdebug("Ambient light: right %d, left %d\n", *r, *l); + + ambient_info.right = *r; + ambient_info.left = *l; +} + + +void +ambient_init(int *r, int *l) +{ + DIR *pdev; + struct dirent *pdevent; + + int ret; + + /* Probe for the applesmc sysfs path */ + pdev = opendir(APPLESMC_SYSFS_BASE); + if (pdev != NULL) + { + while ((pdevent = readdir(pdev))) + { + if (pdevent->d_type != DT_DIR) + continue; + + if (strstr(pdevent->d_name, "applesmc") == pdevent->d_name) + { + ret = snprintf(smcpath, sizeof(smcpath), "%s/%s/light", + APPLESMC_SYSFS_BASE, pdevent->d_name); + + if ((ret < 0) || (ret >= sizeof(smcpath))) + logmsg(LOG_ERR, "Failed to build applesmc sysfs path"); + else + logmsg(LOG_INFO, "Found applesmc at %s", smcpath); + + break; + } + } + + closedir(pdev); + } + + ambient_get(r, l); + + ambient_info.max = KBD_AMBIENT_MAX; + ambient_info.left = *l; + ambient_info.right = *r; +} diff --git a/app-laptop/pommed/pommed-1.31/pommed/mactel/gma950_backlight.c b/app-laptop/pommed/pommed-1.31/pommed/mactel/gma950_backlight.c new file mode 100644 index 0000000..ee5ef27 --- /dev/null +++ b/app-laptop/pommed/pommed-1.31/pommed/mactel/gma950_backlight.c @@ -0,0 +1,422 @@ +/* + * pommed - Apple laptops hotkeys handler daemon + * + * MacBook Backlight Control (Intel GMA950 & GMA965) + * + * Copyright (C) 2006-2007 Ryan Lortie + * Copyright (C) 2006-2007 Julien BLACHE + * + Adapted for pommed + * + * This program is free software; you can redistribute it and/or modify + * it under the terms of version 2 of the GNU General Public License as + * published by the Free Software Foundation. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License along + * with this program; if not, write to the Free Software Foundation, Inc., + * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. + * + * + * The GMA950 has a backlight control register at offset 0x00061254 in its + * PCI memory space (512K region): + * - bits 0-15 represent the backlight value + * - bits 16 indicates legacy mode is in use when set + * - bits 17-31 hold the max backlight value << 1 + * + * Bit 16 indicates whether the backlight control should be used in legacy + * mode or not. This bit is 0 on MacBooks, indicating native mode should be + * used. This is the only method supported here. + * + * + * The GMA965 is slightly different; the backlight control register is at + * offset 0x00061250 in its PCI memory space (first 512K in the 1M region): + * - bits 0-15 represent the backlight value + * - bits 16-31 hold the max backlight value + * - bit 30 indicates legacy mode is in use when set + * + * + * For BOTH cards, the register for the backlight value is at offset 0x00061254. + * + * + * For both cards, in the code below, max value and current value are expressed + * on 15 bits; the values are shifted as appropriate when appropriate. + */ + +#include +#include +#include +#include +#include +#include +#include +#include +#include + +#include + +#include + +#include + +#include "../pommed.h" +#include "../conffile.h" +#include "../lcd_backlight.h" +#include "../dbus.h" + + +static unsigned int GMA950_BACKLIGHT_MAX; + +static int fd = -1; +static char *memory = NULL; +static char sysfs_resource[64]; +static long length = 0; + +#define REGISTER_OFFSET 0x00061254 + +#define GMA950_LEGACY_MODE (1 << 16) +#define GMA950_CONTROL_REGISTER 0x00061254 + +#define GMA965_LEGACY_MODE (1 << 30) +#define GMA965_CONTROL_REGISTER 0x00061250 + +static inline unsigned int +readl(const volatile void *addr) +{ + return *(volatile unsigned int*) addr; +} + +static inline void +writel(unsigned int b, volatile void *addr) +{ + *(volatile unsigned int*) addr = b; +} + +#define INREG(addr) readl(memory+addr) +#define OUTREG(addr,val) writel(val, memory+addr) + + +static unsigned int +gma950_backlight_get(void) +{ + return (INREG(REGISTER_OFFSET) >> 1) & 0x7fff; +} + +static unsigned int +gma950_backlight_get_max(void) +{ + return (INREG(REGISTER_OFFSET) >> 17); +} + +static void +gma950_backlight_set(unsigned int value) +{ + OUTREG(REGISTER_OFFSET, (GMA950_BACKLIGHT_MAX << 17) | (value << 1)); +} + + +static int +gma950_backlight_map(void) +{ + if (length == 0) + { + logdebug("No probing done !\n"); + return -1; + } + + fd = open(sysfs_resource, O_RDWR); + + if (fd < 0) + { + logmsg(LOG_WARNING, "Cannot open %s: %s", sysfs_resource, strerror(errno)); + return -1; + } + + memory = mmap(NULL, length, PROT_READ|PROT_WRITE, MAP_SHARED, fd, 0); + + if (memory == MAP_FAILED) + { + logmsg(LOG_ERR, "mmap failed: %s", strerror(errno)); + + close(fd); + fd = -1; + + return -1; + } + + return 0; +} + +static void +gma950_backlight_unmap(void) +{ + munmap(memory, length); + memory = NULL; + + close(fd); + fd = -1; +} + + +void +gma950_backlight_step(int dir) +{ + int ret; + + unsigned int val; + unsigned int newval = 0; + + ret = gma950_backlight_map(); + if (ret < 0) + return; + + val = gma950_backlight_get(); + + if (dir == STEP_UP) + { + newval = val + lcd_gma950_cfg.step; + + if (newval < GMA950_BACKLIGHT_MIN) + newval = GMA950_BACKLIGHT_MIN; + + if (newval > GMA950_BACKLIGHT_MAX) + newval = GMA950_BACKLIGHT_MAX; + + logdebug("LCD stepping +%d -> %d\n", lcd_gma950_cfg.step, newval); + } + else if (dir == STEP_DOWN) + { + /* val is unsigned */ + if (val > lcd_gma950_cfg.step) + newval = val - lcd_gma950_cfg.step; + + if (newval < GMA950_BACKLIGHT_MIN) + newval = 0x00; + + logdebug("LCD stepping -%d -> %d\n", lcd_gma950_cfg.step, newval); + } + else + return; + + gma950_backlight_set(newval); + + gma950_backlight_unmap(); + + mbpdbus_send_lcd_backlight(newval, val, LCD_USER); + + lcd_bck_info.level = newval; +} + + +void +gma950_backlight_toggle(int lvl) +{ + int val; + int ret; + + if (lcd_gma950_cfg.on_batt == 0) + return; + + ret = gma950_backlight_map(); + if (ret < 0) + return; + + val = gma950_backlight_get(); + if (val != lcd_bck_info.level) + { + mbpdbus_send_lcd_backlight(val, lcd_bck_info.level, LCD_AUTO); + lcd_bck_info.level = val; + } + + if (lcd_bck_info.level == 0) + { + gma950_backlight_unmap(); + return; + } + + switch (lvl) + { + case LCD_ON_AC_LEVEL: + if (lcd_bck_info.level >= lcd_bck_info.ac_lvl) + break; + + logdebug("LCD switching to AC level\n"); + + gma950_backlight_set(lcd_bck_info.ac_lvl); + + mbpdbus_send_lcd_backlight(lcd_bck_info.ac_lvl, lcd_bck_info.level, LCD_AUTO); + + lcd_bck_info.level = lcd_bck_info.ac_lvl; + break; + + case LCD_ON_BATT_LEVEL: + if (lcd_bck_info.level <= lcd_gma950_cfg.on_batt) + break; + + logdebug("LCD switching to battery level\n"); + + lcd_bck_info.ac_lvl = lcd_bck_info.level; + + gma950_backlight_set(lcd_gma950_cfg.on_batt); + + mbpdbus_send_lcd_backlight(lcd_gma950_cfg.on_batt, lcd_bck_info.level, LCD_AUTO); + + lcd_bck_info.level = lcd_gma950_cfg.on_batt; + break; + } + + gma950_backlight_unmap(); +} + + +/* + * We are hardware-dependent for GMA950_BACKLIGHT_MAX, + * so here _fix_config() is static and called at probe time. + */ +static void +gma950_backlight_fix_config(void) +{ + if (lcd_gma950_cfg.init < 0) + lcd_gma950_cfg.init = -1; + + if (lcd_gma950_cfg.init > GMA950_BACKLIGHT_MAX) + lcd_gma950_cfg.init = GMA950_BACKLIGHT_MAX; + + if ((lcd_gma950_cfg.init < GMA950_BACKLIGHT_MIN) + && (lcd_gma950_cfg.init > 0)) + lcd_gma950_cfg.init = 0x00; + + if (lcd_gma950_cfg.step < 1) + lcd_gma950_cfg.step = 1; + + if (lcd_gma950_cfg.step > 0x20) + lcd_gma950_cfg.step = 0x20; + + if ((lcd_gma950_cfg.on_batt > GMA950_BACKLIGHT_MAX) + || (lcd_gma950_cfg.on_batt < GMA950_BACKLIGHT_MIN)) + lcd_gma950_cfg.on_batt = 0; +} + + +#define PCI_ID_VENDOR_INTEL 0x8086 +#define PCI_ID_PRODUCT_GMA950 0x27A2 +#define PCI_ID_PRODUCT_GMA965 0x2A02 + +/* Look for an Intel GMA950 or GMA965 */ +int +gma950_backlight_probe(void) +{ + struct pci_access *pacc; + struct pci_dev *dev; + struct stat stbuf; + + int card; + int ret; + + pacc = pci_alloc(); + if (pacc == NULL) + { + logmsg(LOG_ERR, "Could not allocate PCI structs"); + return -1; + } + + pci_init(pacc); + pci_scan_bus(pacc); + + card = 0; + /* Iterate over all devices */ + for(dev = pacc->devices; dev; dev = dev->next) + { + pci_fill_info(dev, PCI_FILL_IDENT); + /* GMA950 or GMA965 */ + if ((dev->vendor_id == PCI_ID_VENDOR_INTEL) + && ((dev->device_id == PCI_ID_PRODUCT_GMA950) + || (dev->device_id == PCI_ID_PRODUCT_GMA965))) + { + card = dev->device_id; + + ret = snprintf(sysfs_resource, sizeof(sysfs_resource), + "/sys/bus/pci/devices/%04x:%02x:%02x.%1x/resource0", + dev->domain, dev->bus, dev->dev, dev->func); + + break; + } + } + + pci_cleanup(pacc); + + if (!dev) + { + logdebug("Failed to detect Intel GMA950 or GMA965, aborting...\n"); + return -1; + } + + /* Check snprintf() return value */ + if (ret >= sizeof(sysfs_resource)) + { + logmsg(LOG_ERR, "Could not build sysfs PCI resource path"); + return -1; + } + + ret = stat(sysfs_resource, &stbuf); + if (ret < 0) + { + logmsg(LOG_ERR, "Could not determine PCI resource length: %s", strerror(errno)); + return -1; + } + + length = stbuf.st_size; + + logdebug("GMA950/GMA965 PCI resource: [%s], length %ldK\n", sysfs_resource, (length / 1024)); + + ret = gma950_backlight_map(); + if (ret < 0) + { + logmsg(LOG_ERR, "Could not map GMA950/GMA965 memory"); + return -1; + } + + if (card == PCI_ID_PRODUCT_GMA950) + { + if (INREG(GMA950_CONTROL_REGISTER) & GMA950_LEGACY_MODE) + { + logdebug("GMA950 is in legacy backlight control mode, unsupported\n"); + + gma950_backlight_unmap(); + return -1; + } + } + else if (card == PCI_ID_PRODUCT_GMA965) + { + if (INREG(GMA965_CONTROL_REGISTER) & GMA965_LEGACY_MODE) + { + logdebug("GMA965 is in legacy backlight control mode, unsupported\n"); + + gma950_backlight_unmap(); + return -1; + } + } + + /* Get the maximum backlight value */ + GMA950_BACKLIGHT_MAX = gma950_backlight_get_max(); + + logdebug("Max LCD backlight value is 0x%x\n", GMA950_BACKLIGHT_MAX); + + /* Now, check the config and fix it if needed */ + gma950_backlight_fix_config(); + + /* Set the initial backlight level */ + if (lcd_gma950_cfg.init > -1) + gma950_backlight_set(lcd_gma950_cfg.init); + + lcd_bck_info.max = GMA950_BACKLIGHT_MAX; + lcd_bck_info.level = gma950_backlight_get(); + lcd_bck_info.ac_lvl = lcd_bck_info.level; + + gma950_backlight_unmap(); + + return 0; +} diff --git a/app-laptop/pommed/pommed-1.31/pommed/mactel/kbd_backlight.c b/app-laptop/pommed/pommed-1.31/pommed/mactel/kbd_backlight.c new file mode 100644 index 0000000..e9af5d9 --- /dev/null +++ b/app-laptop/pommed/pommed-1.31/pommed/mactel/kbd_backlight.c @@ -0,0 +1,287 @@ +/* + * pommed - Apple laptops hotkeys handler daemon + * + * Copyright (C) 2006-2008 Julien BLACHE + * + * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; version 2 of the License. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License along + * with this program; if not, write to the Free Software Foundation, Inc., + * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. + */ + +#include +#include +#include +#include +#include +#include +#include +#include +#include + +#include + +#include + +#include "../pommed.h" +#include "../evloop.h" +#include "../conffile.h" +#include "../kbd_backlight.h" +#include "../ambient.h" +#include "../dbus.h" + + +struct _kbd_bck_info kbd_bck_info; + + +static int +kbd_backlight_open(int flags) +{ + char *kbdbck_node[] = + { + "/sys/class/leds/smc::kbd_backlight/brightness", /* 2.6.25 & up */ + "/sys/class/leds/smc:kbd_backlight/brightness" + }; + int fd; + int i; + + for (i = 0; i < sizeof(kbdbck_node) / sizeof(*kbdbck_node); i++) + { + logdebug("Trying %s\n", kbdbck_node[i]); + + fd = open(kbdbck_node[i], flags); + if (fd >= 0) + return fd; + + if (errno == ENOENT) + continue; + + logmsg(LOG_WARNING, "Could not open %s: %s", kbdbck_node[i], strerror(errno)); + return -1; + } + + return -1; +} + + +static int +kbd_backlight_get(void) +{ + int fd; + int ret; + char buf[8]; + + fd = kbd_backlight_open(O_RDONLY); + if (fd < 0) + return -1; + + memset(buf, 0, 8); + + ret = read(fd, buf, 8); + + close(fd); + + if ((ret < 1) || (ret > 7)) + return -1; + + ret = atoi(buf); + + logdebug("KBD backlight value is %d\n", ret); + + if ((ret < KBD_BACKLIGHT_OFF) || (ret > KBD_BACKLIGHT_MAX)) + ret = -1; + + return ret; +} + +static void +kbd_backlight_set(int val, int who) +{ + int curval; + + int i; + float fadeval; + float step; + struct timespec fade_step; + + int fd; + FILE *fp; + + if (kbd_bck_info.inhibit & ~KBD_INHIBIT_CFG) + return; + + curval = kbd_backlight_get(); + + if (val == curval) + return; + + if ((val < KBD_BACKLIGHT_OFF) || (val > KBD_BACKLIGHT_MAX)) + return; + + if (who == KBD_AUTO) + { + fade_step.tv_sec = 0; + fade_step.tv_nsec = (KBD_BACKLIGHT_FADE_LENGTH / KBD_BACKLIGHT_FADE_STEPS) * 1000000; + + fadeval = (float)curval; + step = (float)(val - curval) / (float)KBD_BACKLIGHT_FADE_STEPS; + + for (i = 0; i < KBD_BACKLIGHT_FADE_STEPS; i++) + { + fadeval += step; + + fd = kbd_backlight_open(O_WRONLY); + if (fd < 0) + continue; + + fp = fdopen(fd, "a"); + if (fp == NULL) + { + logmsg(LOG_WARNING, "Could not fdopen backlight fd: %s", strerror(errno)); + close(fd); + continue; + } + + fprintf(fp, "%d", (int)fadeval); + + fclose(fp); + + logdebug("KBD backlight value faded to %d\n", (int)fadeval); + + nanosleep(&fade_step, NULL); + } + } + + fd = kbd_backlight_open(O_WRONLY); + if (fd < 0) + return; + + fp = fdopen(fd, "a"); + if (fp == NULL) + { + logmsg(LOG_WARNING, "Could not fdopen backlight fd %d: %s", fd, strerror(errno)); + close(fd); + return; + } + + fprintf(fp, "%d", val); + + fclose(fp); + + logdebug("KBD backlight value set to %d\n", val); + + mbpdbus_send_kbd_backlight(val, curval, who); + + kbd_bck_info.level = val; +} + +void +kbd_backlight_step(int dir) +{ + int val; + int newval; + + if (kbd_bck_info.inhibit & ~KBD_INHIBIT_CFG) + return; + + val = kbd_backlight_get(); + + if (val < 0) + return; + + if (dir == STEP_UP) + { + newval = val + kbd_cfg.step; + + if (newval > KBD_BACKLIGHT_MAX) + newval = KBD_BACKLIGHT_MAX; + + logdebug("KBD stepping +%d -> %d\n", kbd_cfg.step, newval); + } + else if (dir == STEP_DOWN) + { + newval = val - kbd_cfg.step; + + if (newval < KBD_BACKLIGHT_OFF) + newval = KBD_BACKLIGHT_OFF; + + logdebug("KBD stepping -%d -> %d\n", kbd_cfg.step, newval); + } + else + return; + + kbd_backlight_set(newval, KBD_USER); +} + + +/* Include automatic backlight routines */ +#include "../kbd_auto.c" + + +void +kbd_backlight_init(void) +{ + if (kbd_cfg.auto_on) + kbd_bck_info.inhibit = 0; + else + kbd_bck_info.inhibit = KBD_INHIBIT_CFG; + + kbd_bck_info.toggle_lvl = kbd_cfg.auto_lvl; + + kbd_bck_info.inhibit_lvl = 0; + + kbd_bck_info.auto_on = 0; + + if (!has_kbd_backlight()) + { + kbd_bck_info.r_sens = 0; + kbd_bck_info.l_sens = 0; + + kbd_bck_info.level = 0; + + ambient_info.left = 0; + ambient_info.right = 0; + ambient_info.max = 0; + + return; + } + + kbd_bck_info.level = kbd_backlight_get(); + if (kbd_bck_info.level < 0) + kbd_bck_info.level = 0; + + kbd_bck_info.max = KBD_BACKLIGHT_MAX; + + ambient_init(&kbd_bck_info.r_sens, &kbd_bck_info.l_sens); + + kbd_auto_init(); +} + +void +kbd_backlight_cleanup(void) +{ + if (has_kbd_backlight()) + kbd_auto_cleanup(); +} + + +void +kbd_backlight_fix_config(void) +{ + if (kbd_cfg.auto_lvl > KBD_BACKLIGHT_MAX) + kbd_cfg.auto_lvl = KBD_BACKLIGHT_MAX; + + if (kbd_cfg.step < 1) + kbd_cfg.step = 1; + + if (kbd_cfg.step > (KBD_BACKLIGHT_MAX / 2)) + kbd_cfg.step = KBD_BACKLIGHT_MAX / 2; +} diff --git a/app-laptop/pommed/pommed-1.31/pommed/mactel/nv8600mgt_backlight.c b/app-laptop/pommed/pommed-1.31/pommed/mactel/nv8600mgt_backlight.c new file mode 100644 index 0000000..79373f4 --- /dev/null +++ b/app-laptop/pommed/pommed-1.31/pommed/mactel/nv8600mgt_backlight.c @@ -0,0 +1,294 @@ +/* + * pommed - Apple laptops hotkeys handler daemon + * + * Apple Macbook Pro LCD backlight control, nVidia 8600M GT + * + * Copyright (C) 2006 Nicolas Boichat + * Copyright (C) 2006 Felipe Alfaro Solana + * Copyright (C) 2007-2008 Julien BLACHE + * + Adapted for pommed + * + * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 2 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License along + * with this program; if not, write to the Free Software Foundation, Inc., + * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. + * + * + * This driver triggers SMIs which cause the firmware to change the + * backlight brightness. This is icky in many ways, but it's impractical to + * get at the firmware code in order to figure out what it's actually doing. + */ + +#include +#include +#include +#include +#include +#include +#include +#include +#include + +#include + +#include + +#include + +#include "../pommed.h" +#include "../conffile.h" +#include "../lcd_backlight.h" +#include "../dbus.h" + + +struct _lcd_bck_info lcd_bck_info; + + +static int nv8600mgt_inited = 0; +static unsigned int bl_port; + + +static unsigned char +nv8600mgt_backlight_get() +{ + unsigned char value; + + if (nv8600mgt_inited == 0) + return 0; + + outb(0x03, bl_port + 1); + outb(0xbf, bl_port); + + value = inb(bl_port + 1) >> 4; + + return value; +} + +static void +nv8600mgt_backlight_set(unsigned char value) +{ + if (nv8600mgt_inited == 0) + return; + + outb(0x04 | (value << 4), bl_port + 1); + outb(0xbf, bl_port); +} + + +void +nv8600mgt_backlight_step(int dir) +{ + int val; + int newval; + + if (nv8600mgt_inited == 0) + return; + + val = nv8600mgt_backlight_get(); + + if (dir == STEP_UP) + { + newval = val + lcd_nv8600mgt_cfg.step; + + if (newval > NV8600MGT_BACKLIGHT_MAX) + newval = NV8600MGT_BACKLIGHT_MAX; + + logdebug("LCD stepping +%d -> %d\n", lcd_nv8600mgt_cfg.step, newval); + } + else if (dir == STEP_DOWN) + { + newval = val - lcd_nv8600mgt_cfg.step; + + if (newval < NV8600MGT_BACKLIGHT_OFF) + newval = NV8600MGT_BACKLIGHT_OFF; + + logdebug("LCD stepping -%d -> %d\n", lcd_nv8600mgt_cfg.step, newval); + } + else + return; + + nv8600mgt_backlight_set((unsigned char)newval); + + mbpdbus_send_lcd_backlight(newval, val, LCD_USER); + + lcd_bck_info.level = newval; +} + +void +nv8600mgt_backlight_toggle(int lvl) +{ + int val; + + if (lcd_nv8600mgt_cfg.on_batt == 0) + return; + + if (nv8600mgt_inited == 0) + return; + + val = nv8600mgt_backlight_get(); + if (val != lcd_bck_info.level) + { + mbpdbus_send_lcd_backlight(val, lcd_bck_info.level, LCD_AUTO); + lcd_bck_info.level = val; + } + + if (lcd_bck_info.level == 0) + return; + + switch (lvl) + { + case LCD_ON_AC_LEVEL: + if (lcd_bck_info.level >= lcd_bck_info.ac_lvl) + break; + + logdebug("LCD switching to AC level\n"); + + nv8600mgt_backlight_set(lcd_bck_info.ac_lvl); + + mbpdbus_send_lcd_backlight(lcd_bck_info.ac_lvl, lcd_bck_info.level, LCD_AUTO); + + lcd_bck_info.level = lcd_bck_info.ac_lvl; + break; + + case LCD_ON_BATT_LEVEL: + if (lcd_bck_info.level <= lcd_nv8600mgt_cfg.on_batt) + break; + + logdebug("LCD switching to battery level\n"); + + lcd_bck_info.ac_lvl = lcd_bck_info.level; + + nv8600mgt_backlight_set(lcd_nv8600mgt_cfg.on_batt); + + mbpdbus_send_lcd_backlight(lcd_nv8600mgt_cfg.on_batt, lcd_bck_info.level, LCD_AUTO); + + lcd_bck_info.level = lcd_nv8600mgt_cfg.on_batt; + break; + } +} + + +#define PCI_ID_VENDOR_NVIDIA 0x10de +#define PCI_ID_PRODUCT_8600MGT 0x0407 +#define PCI_ID_PRODUCT_9400M 0x0863 +#define PCI_ID_PRODUCT_9400M_G 0x0866 +#define PCI_ID_PRODUCT_9600MGT 0x0647 + +/* Look for an nVidia GeForce 8600M GT, 9400M or 9600M GT */ +int +nv8600mgt_backlight_probe(void) +{ + struct pci_access *pacc; + struct pci_dev *dev; + int ret; + + pacc = pci_alloc(); + if (pacc == NULL) + { + logmsg(LOG_ERR, "Could not allocate PCI structs"); + return -1; + } + + pci_init(pacc); + pci_scan_bus(pacc); + + /* Iterate over all devices */ + for (dev = pacc->devices; dev; dev = dev->next) + { + pci_fill_info(dev, PCI_FILL_IDENT); + /* nVidia GeForce 8600M GT */ + if ((dev->vendor_id == PCI_ID_VENDOR_NVIDIA) + && ((dev->device_id == PCI_ID_PRODUCT_8600MGT) + || (dev->device_id == PCI_ID_PRODUCT_9400M) + || (dev->device_id == PCI_ID_PRODUCT_9400M_G) + || (dev->device_id == PCI_ID_PRODUCT_9600MGT))) + { + break; + } + } + + pci_cleanup(pacc); + + if (!dev) + { + logdebug("Failed to detect nVidia GeForce 8600M GT/9400M/9600M GT, aborting...\n"); + return -1; + } + + /* Determine backlight I/O port */ + switch (mops->type) + { + case MACHINE_MACBOOKPRO_3: + case MACHINE_MACBOOKPRO_4: + bl_port = 0xb2; /* 0xb2 - 0xb3 */ + break; + + case MACHINE_MACBOOKPRO_5: + case MACHINE_MACBOOK_5: + case MACHINE_MACBOOKAIR_2: + bl_port = 0x52e; /* 0x52e - 0x52f */ + break; + + default: + logmsg(LOG_ERR, "nv8600mgt LCD backlight support not supported on this hardware"); + return -1; + } + + lcd_bck_info.max = NV8600MGT_BACKLIGHT_MAX; + + ret = iopl(3); + if (ret < 0) + { + logmsg(LOG_ERR, "iopl() failed: %s", strerror(errno)); + + lcd_bck_info.level = 0; + + return -1; + } + + nv8600mgt_inited = 1; + + /* + * Set the initial backlight level + * The value has been sanity checked already + */ + if (lcd_nv8600mgt_cfg.init > -1) + { + nv8600mgt_backlight_set((unsigned char)lcd_nv8600mgt_cfg.init); + } + + lcd_bck_info.level = nv8600mgt_backlight_get(); + lcd_bck_info.ac_lvl = lcd_bck_info.level; + + return 0; +} + + +void +nv8600mgt_backlight_fix_config(void) +{ + if (lcd_nv8600mgt_cfg.init < 0) + lcd_nv8600mgt_cfg.init = -1; + + if (lcd_nv8600mgt_cfg.init > NV8600MGT_BACKLIGHT_MAX) + lcd_nv8600mgt_cfg.init = NV8600MGT_BACKLIGHT_MAX; + + if (lcd_nv8600mgt_cfg.step < 1) + lcd_nv8600mgt_cfg.step = 1; + + if (lcd_nv8600mgt_cfg.step > (NV8600MGT_BACKLIGHT_MAX / 4)) + lcd_nv8600mgt_cfg.step = NV8600MGT_BACKLIGHT_MAX / 4; + + if ((lcd_nv8600mgt_cfg.on_batt > NV8600MGT_BACKLIGHT_MAX) + || (lcd_nv8600mgt_cfg.on_batt < NV8600MGT_BACKLIGHT_OFF)) + lcd_nv8600mgt_cfg.on_batt = 0; +} diff --git a/app-laptop/pommed/pommed-1.31/pommed/mactel/x1600_backlight.c b/app-laptop/pommed/pommed-1.31/pommed/mactel/x1600_backlight.c new file mode 100644 index 0000000..ef1c720 --- /dev/null +++ b/app-laptop/pommed/pommed-1.31/pommed/mactel/x1600_backlight.c @@ -0,0 +1,350 @@ +/* + * pommed - Apple laptops hotkeys handler daemon + * + * Apple Macbook Pro LCD backlight control + * + * Copyright (C) 2006 Nicolas Boichat + * Copyright (C) 2006-2007 Julien BLACHE + * + Adapted for pommed + * + * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 2 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License along + * with this program; if not, write to the Free Software Foundation, Inc., + * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. + * + */ + +#include +#include +#include +#include +#include +#include +#include +#include +#include + +#include + +#include + +#include + +#include "../pommed.h" +#include "../conffile.h" +#include "../lcd_backlight.h" +#include "../dbus.h" + + +struct _lcd_bck_info lcd_bck_info; + +static int fd = -1; +static char *memory = NULL; +static char sysfs_resource[64]; +static long length = 0; + +static inline unsigned int +readl(const volatile void *addr) +{ + return *(volatile unsigned int*) addr; +} + +static inline void +writel(unsigned int b, volatile void *addr) +{ + *(volatile unsigned int*) addr = b; +} + +#define INREG(addr) readl(memory+addr) +#define OUTREG(addr,val) writel(val, memory+addr) + + +static unsigned char +x1600_backlight_get() +{ + return INREG(0x7af8) >> 8; +} + +static void +x1600_backlight_set(unsigned char value) +{ + OUTREG(0x7af8, 0x00000001 | ((unsigned int)value << 8)); +} + + +static int +x1600_backlight_map(void) +{ + unsigned int state; + + if (length == 0) + { + logdebug("No probing done!\n"); + return -1; + } + + fd = open(sysfs_resource, O_RDWR); + + if (fd < 0) + { + logmsg(LOG_WARNING, "Cannot open %s: %s", sysfs_resource, strerror(errno)); + + close(fd); + fd = -1; + + return -1; + } + + memory = mmap(NULL, length, PROT_READ|PROT_WRITE, MAP_SHARED, fd, 0); + + if (memory == MAP_FAILED) + { + logmsg(LOG_ERR, "mmap failed: %s", strerror(errno)); + return -1; + } + + /* Is it really necessary ? */ + OUTREG(0x4dc, 0x00000005); + state = INREG(0x7ae4); + OUTREG(0x7ae4, state); + + return 0; +} + +static void +x1600_backlight_unmap(void) +{ + munmap(memory, length); + memory = NULL; + + close(fd); + fd = -1; +} + + +void +x1600_backlight_step(int dir) +{ + int ret; + + int val; + int newval; + + ret = x1600_backlight_map(); + if (ret < 0) + return; + + val = x1600_backlight_get(); + + if (dir == STEP_UP) + { + newval = val + lcd_x1600_cfg.step; + + if (newval > X1600_BACKLIGHT_MAX) + newval = X1600_BACKLIGHT_MAX; + + logdebug("LCD stepping +%d -> %d\n", lcd_x1600_cfg.step, newval); + } + else if (dir == STEP_DOWN) + { + newval = val - lcd_x1600_cfg.step; + + if (newval < X1600_BACKLIGHT_OFF) + newval = X1600_BACKLIGHT_OFF; + + logdebug("LCD stepping -%d -> %d\n", lcd_x1600_cfg.step, newval); + } + else + return; + + x1600_backlight_set((unsigned char)newval); + + x1600_backlight_unmap(); + + mbpdbus_send_lcd_backlight(newval, val, LCD_USER); + + lcd_bck_info.level = newval; +} + +void +x1600_backlight_toggle(int lvl) +{ + int val; + int ret; + + if (lcd_x1600_cfg.on_batt == 0) + return; + + ret = x1600_backlight_map(); + if (ret < 0) + return; + + val = x1600_backlight_get(); + if (val != lcd_bck_info.level) + { + mbpdbus_send_lcd_backlight(val, lcd_bck_info.level, LCD_AUTO); + lcd_bck_info.level = val; + } + + if (lcd_bck_info.level == 0) + { + x1600_backlight_unmap(); + return; + } + + switch (lvl) + { + case LCD_ON_AC_LEVEL: + if (lcd_bck_info.level >= lcd_bck_info.ac_lvl) + break; + + logdebug("LCD switching to AC level\n"); + + x1600_backlight_set(lcd_bck_info.ac_lvl); + + mbpdbus_send_lcd_backlight(lcd_bck_info.ac_lvl, lcd_bck_info.level, LCD_AUTO); + + lcd_bck_info.level = lcd_bck_info.ac_lvl; + break; + + case LCD_ON_BATT_LEVEL: + if (lcd_bck_info.level <= lcd_x1600_cfg.on_batt) + break; + + logdebug("LCD switching to battery level\n"); + + lcd_bck_info.ac_lvl = lcd_bck_info.level; + + x1600_backlight_set(lcd_x1600_cfg.on_batt); + + mbpdbus_send_lcd_backlight(lcd_x1600_cfg.on_batt, lcd_bck_info.level, LCD_AUTO); + + lcd_bck_info.level = lcd_x1600_cfg.on_batt; + break; + } + + x1600_backlight_unmap(); +} + + +#define PCI_ID_VENDOR_ATI 0x1002 +#define PCI_ID_PRODUCT_X1600 0x71c5 + +/* Look for an ATI Radeon Mobility X1600 */ +int +x1600_backlight_probe(void) +{ + struct pci_access *pacc; + struct pci_dev *dev; + struct stat stbuf; + + int ret; + + pacc = pci_alloc(); + if (pacc == NULL) + { + logmsg(LOG_ERR, "Could not allocate PCI structs"); + return -1; + } + + pci_init(pacc); + pci_scan_bus(pacc); + + /* Iterate over all devices */ + for(dev = pacc->devices; dev; dev = dev->next) + { + pci_fill_info(dev, PCI_FILL_IDENT); + /* ATI X1600 */ + if ((dev->vendor_id == PCI_ID_VENDOR_ATI) + && (dev->device_id == PCI_ID_PRODUCT_X1600)) + { + ret = snprintf(sysfs_resource, sizeof(sysfs_resource), + "/sys/bus/pci/devices/%04x:%02x:%02x.%1x/resource2", + dev->domain, dev->bus, dev->dev, dev->func); + + break; + } + } + + pci_cleanup(pacc); + + if (!dev) + { + logdebug("Failed to detect ATI X1600, aborting...\n"); + return -1; + } + + /* Check snprintf() return value */ + if (ret >= sizeof(sysfs_resource)) + { + logmsg(LOG_ERR, "Could not build sysfs PCI resource path"); + return -1; + } + + ret = stat(sysfs_resource, &stbuf); + if (ret < 0) + { + logmsg(LOG_ERR, "Could not determine PCI resource length: %s", strerror(errno)); + return -1; + } + + length = stbuf.st_size; + + logdebug("ATI X1600 PCI resource: [%s], length %ldK\n", sysfs_resource, (length / 1024)); + + lcd_bck_info.max = X1600_BACKLIGHT_MAX; + + ret = x1600_backlight_map(); + if (ret < 0) + { + lcd_bck_info.level = 0; + + return 0; + } + + /* + * Set the initial backlight level + * The value has been sanity checked already + */ + if (lcd_x1600_cfg.init > -1) + { + x1600_backlight_set((unsigned char)lcd_x1600_cfg.init); + } + + lcd_bck_info.level = x1600_backlight_get(); + lcd_bck_info.ac_lvl = lcd_bck_info.level; + + x1600_backlight_unmap(); + + return 0; +} + + +void +x1600_backlight_fix_config(void) +{ + if (lcd_x1600_cfg.init < 0) + lcd_x1600_cfg.init = -1; + + if (lcd_x1600_cfg.init > X1600_BACKLIGHT_MAX) + lcd_x1600_cfg.init = X1600_BACKLIGHT_MAX; + + if (lcd_x1600_cfg.step < 1) + lcd_x1600_cfg.step = 1; + + if (lcd_x1600_cfg.step > (X1600_BACKLIGHT_MAX / 2)) + lcd_x1600_cfg.step = X1600_BACKLIGHT_MAX / 2; + + if ((lcd_x1600_cfg.on_batt > X1600_BACKLIGHT_MAX) + || (lcd_x1600_cfg.on_batt < X1600_BACKLIGHT_OFF)) + lcd_x1600_cfg.on_batt = 0; +} diff --git a/app-laptop/pommed/pommed-1.31/pommed/pmac/ambient.c b/app-laptop/pommed/pommed-1.31/pommed/pmac/ambient.c new file mode 100644 index 0000000..ba67040 --- /dev/null +++ b/app-laptop/pommed/pommed-1.31/pommed/pmac/ambient.c @@ -0,0 +1,196 @@ +/* + * pommed - Apple laptops hotkeys handler daemon + * + * Copyright (C) 2006-2007 Julien BLACHE + * Copyright (C) 2006 Yves-Alexis Perez + * + * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; version 2 of the License. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License along + * with this program; if not, write to the Free Software Foundation, Inc., + * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. + */ + +#include +#include +#include +#include +#include +#include +#include + +#include +#include +#include + +#include + +#include "../pommed.h" +#include "../ambient.h" +#include "../dbus.h" + + +struct _ambient_info ambient_info; + + +#define LMU_AMBIENT_MAX_RAW 1600 + +#define PMU_AMBIENT_MAX_RAW 2048 + + +static void +lmu_ambient_get(int *r, int *l) +{ + int fd; + int ret; + char buf[4]; + + fd = open(lmu_info.i2cdev, O_RDONLY); + if (fd < 0) + { + *r = -1; + *l = -1; + + ambient_info.right = 0; + ambient_info.left = 0; + + logmsg(LOG_ERR, "Could not open i2c device %s: %s", lmu_info.i2cdev, strerror(errno)); + return; + } + + ret = ioctl(fd, I2C_SLAVE, lmu_info.lmuaddr); + if (ret < 0) + { + close(fd); + + *r = -1; + *l = -1; + + ambient_info.right = 0; + ambient_info.left = 0; + + logmsg(LOG_ERR, "ioctl failed on %s: %s", lmu_info.i2cdev, strerror(errno)); + + return; + } + + ret = read(fd, buf, 4); + if (ret != 4) + { + close(fd); + + *r = -1; + *l = -1; + + ambient_info.right = 0; + ambient_info.left = 0; + + return; + } + close(fd); + + /* found in pbbuttonsd.conf */ + *r = (int) (((buf[0] << 8) | buf[1]) * KBD_AMBIENT_MAX) / LMU_AMBIENT_MAX_RAW; + *l = (int) (((buf[2] << 8) | buf[3]) * KBD_AMBIENT_MAX) / LMU_AMBIENT_MAX_RAW; + + logdebug("Ambient light: right %d, left %d\n", *r, *l); + + ambient_info.right = *r; + ambient_info.left = *l; +} + +static void +pmu_ambient_get(int *r, int *l) +{ + int fd; + int ret; + char buf[ADB_BUFFER_SIZE]; + + fd = open(ADB_DEVICE, O_RDWR); + if (fd < 0) + { + *r = -1; + *l = -1; + + ambient_info.right = 0; + ambient_info.left = 0; + + logmsg(LOG_ERR, "Could not open ADB device %s: %s", ADB_DEVICE, strerror(errno)); + return; + } + + buf[0] = PMU_PACKET; + buf[1] = 0x4f; /* PMU command */ + buf[2] = 1; + + ret = write(fd, buf, 3); + if (ret != 3) + { + *r = -1; + *l = -1; + + ambient_info.right = 0; + ambient_info.left = 0; + + logmsg(LOG_ERR, "Could not send PMU command: %s", strerror(errno)); + close(fd); + return; + } + + ret = read(fd, buf, ADB_BUFFER_SIZE); + if (ret != 5) + { + *r = -1; + *l = -1; + + ambient_info.right = 0; + ambient_info.left = 0; + + logmsg(LOG_ERR, "Could not read PMU reply: %s", strerror(errno)); + close(fd); + return; + } + + close(fd); + + /* Taken from pbbuttonsd */ + *l = (int) (((buf[2] << 8) | buf[1]) * KBD_AMBIENT_MAX) / PMU_AMBIENT_MAX_RAW; + *r = (int) (((buf[4] << 8) | buf[3]) * KBD_AMBIENT_MAX) / PMU_AMBIENT_MAX_RAW; + + logdebug("Ambient light: right %d, left %d\n", *r, *l); + + ambient_info.right = *r; + ambient_info.left = *l; +} + +void +ambient_get(int *r, int *l) +{ + if ((mops->type == MACHINE_POWERBOOK_58) + || (mops->type == MACHINE_POWERBOOK_59)) + { + pmu_ambient_get(r, l); + } + else + { + lmu_ambient_get(r, l); + } +} + + +void +ambient_init(int *r, int *l) +{ + ambient_get(r, l); + + ambient_info.max = KBD_AMBIENT_MAX; + ambient_info.left = *l; + ambient_info.right = *r; +} diff --git a/app-laptop/pommed/pommed-1.31/pommed/pmac/kbd_backlight.c b/app-laptop/pommed/pommed-1.31/pommed/pmac/kbd_backlight.c new file mode 100644 index 0000000..0ff0ea6 --- /dev/null +++ b/app-laptop/pommed/pommed-1.31/pommed/pmac/kbd_backlight.c @@ -0,0 +1,534 @@ +/* + * pommed - Apple laptops hotkeys handler daemon + * + * Copyright (C) 2006-2008 Julien BLACHE + * Copyright (C) 2006 Yves-Alexis Perez + * + * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; version 2 of the License. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License along + * with this program; if not, write to the Free Software Foundation, Inc., + * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. + */ + + +#include +#include +#include +#include +#include +#include +#include +#include +#include + +#include + +#include +#include +#include + +#include + +#include + +#include "../pommed.h" +#include "../evloop.h" +#include "../conffile.h" +#include "../kbd_backlight.h" +#include "../ambient.h" +#include "../dbus.h" + + +#define SYSFS_I2C_BASE "/sys/class/i2c-dev" +#define I2C_ADAPTER_NAME "uni-n 0" + + +struct _lmu_info lmu_info; +struct _kbd_bck_info kbd_bck_info; + + +static int +kbd_backlight_get(void) +{ + return kbd_bck_info.level; +} + + +/* Helper for LMU-controlled keyboards */ +static void +lmu_write_kbd_value(int fd, unsigned char val) +{ + unsigned char buf[3]; + + buf[0] = 0x01; /* i2c register */ + + /* The format appears to be: (taken from pbbuttonsd) + * byte 1 byte 2 + * |<---->| |<---->| + * xxxx7654 3210xxxx + * |<----->| + * ^-- brightness + */ + + buf[1] = val >> 4; + buf[2] = val << 4; + + if (write (fd, buf, 3) < 0) + logmsg(LOG_ERR, "Could not set LMU kbd brightness: %s", strerror(errno)); +} + +static void +kbd_lmu_backlight_set(int val, int who) +{ + int curval; + + int i; + float fadeval; + float step; + struct timespec fade_step; + + int fd; + int ret; + + if (kbd_bck_info.inhibit & ~KBD_INHIBIT_CFG) + return; + + if (lmu_info.lmuaddr == 0) + return; + + curval = kbd_backlight_get(); + + if (val == curval) + return; + + if ((val < KBD_BACKLIGHT_OFF) || (val > KBD_BACKLIGHT_MAX)) + return; + + fd = open(lmu_info.i2cdev, O_RDWR); + if (fd < 0) + { + logmsg(LOG_ERR, "Could not open %s: %s", lmu_info.i2cdev, strerror(errno)); + + return; + } + + ret = ioctl(fd, I2C_SLAVE, lmu_info.lmuaddr); + if (ret < 0) + { + logmsg(LOG_ERR, "Could not ioctl the i2c bus: %s", strerror(errno)); + + close(fd); + return; + } + + if (who == KBD_AUTO) + { + fade_step.tv_sec = 0; + fade_step.tv_nsec = (KBD_BACKLIGHT_FADE_LENGTH / KBD_BACKLIGHT_FADE_STEPS) * 1000000; + + fadeval = (float)curval; + step = (float)(val - curval) / (float)KBD_BACKLIGHT_FADE_STEPS; + + for (i = 0; i < KBD_BACKLIGHT_FADE_STEPS; i++) + { + fadeval += step; + + lmu_write_kbd_value(fd, (unsigned char)fadeval); + + logdebug("KBD backlight value faded to %d\n", (int)fadeval); + + nanosleep(&fade_step, NULL); + } + } + + lmu_write_kbd_value(fd, val); + + close(fd); + + mbpdbus_send_kbd_backlight(val, kbd_bck_info.level, who); + + kbd_bck_info.level = val; +} + + +/* Helper for ADB keyboards */ +static void +adb_write_kbd_value(int fd, unsigned char val) +{ + int ret; + unsigned char buf[ADB_BUFFER_SIZE]; + + buf[0] = PMU_PACKET; + buf[1] = 0x4f; /* PMU command */ + buf[2] = 0; + buf[3] = 0; + buf[4] = val; + + ret = write(fd, buf, 5); + if (ret != 5) + { + logmsg(LOG_ERR, "Could not set PMU kbd brightness: %s", strerror(errno)); + } + else + { + ret = read(fd, buf, ADB_BUFFER_SIZE); + if (ret < 0) + logmsg(LOG_ERR, "Could not read PMU reply: %s", strerror(errno)); + } +} + +static void +kbd_pmu_backlight_set(int val, int who) +{ + int curval; + + int i; + float fadeval; + float step; + struct timespec fade_step; + + int fd; + + if (kbd_bck_info.inhibit & ~KBD_INHIBIT_CFG) + return; + + curval = kbd_backlight_get(); + + if (val == curval) + return; + + if ((val < KBD_BACKLIGHT_OFF) || (val > KBD_BACKLIGHT_MAX)) + return; + + fd = open(ADB_DEVICE, O_RDWR); + if (fd < 0) + { + logmsg(LOG_ERR, "Could not open %s: %s", ADB_DEVICE, strerror(errno)); + + return; + } + + if (who == KBD_AUTO) + { + fade_step.tv_sec = 0; + fade_step.tv_nsec = (KBD_BACKLIGHT_FADE_LENGTH / KBD_BACKLIGHT_FADE_STEPS) * 1000000; + + fadeval = (float)curval; + step = (float)(val - curval) / (float)KBD_BACKLIGHT_FADE_STEPS; + + for (i = 0; i < KBD_BACKLIGHT_FADE_STEPS; i++) + { + fadeval += step; + + adb_write_kbd_value(fd, (unsigned char)val); + + logdebug("KBD backlight value faded to %d\n", (int)fadeval); + + nanosleep(&fade_step, NULL); + } + } + + adb_write_kbd_value(fd, val); + + close(fd); + + mbpdbus_send_kbd_backlight(val, kbd_bck_info.level, who); + + kbd_bck_info.level = val; +} + +static void +kbd_backlight_set(int val, int who) +{ + if ((mops->type == MACHINE_POWERBOOK_58) + || (mops->type == MACHINE_POWERBOOK_59)) + { + kbd_pmu_backlight_set(val, who); + } + else + { + kbd_lmu_backlight_set(val, who); + } +} + + +void +kbd_backlight_step(int dir) +{ + int val; + int newval; + + if (kbd_bck_info.inhibit & ~KBD_INHIBIT_CFG) + return; + + val = kbd_backlight_get(); + + if (val < 0) + return; + + if (dir == STEP_UP) + { + newval = val + kbd_cfg.step; + + if (newval > KBD_BACKLIGHT_MAX) + newval = KBD_BACKLIGHT_MAX; + + logdebug("KBD stepping +%d -> %d\n", kbd_cfg.step, newval); + } + else if (dir == STEP_DOWN) + { + newval = val - kbd_cfg.step; + + if (newval < KBD_BACKLIGHT_OFF) + newval = KBD_BACKLIGHT_OFF; + + logdebug("KBD stepping -%d -> %d\n", kbd_cfg.step, newval); + } + else + return; + + kbd_backlight_set(newval, KBD_USER); +} + + +/* Include automatic backlight routines */ +#include "../kbd_auto.c" + + +static int +kbd_probe_lmu(void); + +void +kbd_backlight_init(void) +{ + int ret; + + if (kbd_cfg.auto_on) + kbd_bck_info.inhibit = 0; + else + kbd_bck_info.inhibit = KBD_INHIBIT_CFG; + + kbd_bck_info.toggle_lvl = kbd_cfg.auto_lvl; + + kbd_bck_info.inhibit_lvl = 0; + + kbd_bck_info.auto_on = 0; + + if (!has_kbd_backlight() + || (mops->type == MACHINE_POWERBOOK_58) + || (mops->type == MACHINE_POWERBOOK_59)) + { + /* Nothing to probe for the PMU05 machines */ + ret = 0; + } + else + ret = kbd_probe_lmu(); + + if (!has_kbd_backlight() || (ret < 0)) + { + lmu_info.lmuaddr = 0; + + kbd_bck_info.r_sens = 0; + kbd_bck_info.l_sens = 0; + + kbd_bck_info.level = 0; + + ambient_info.left = 0; + ambient_info.right = 0; + ambient_info.max = 0; + + return; + } + + kbd_bck_info.level = kbd_backlight_get(); + + if (kbd_bck_info.level < 0) + kbd_bck_info.level = 0; + + kbd_bck_info.max = KBD_BACKLIGHT_MAX; + + ambient_init(&kbd_bck_info.r_sens, &kbd_bck_info.l_sens); + + kbd_auto_init(); +} + +void +kbd_backlight_cleanup(void) +{ + if (has_kbd_backlight()) + kbd_auto_cleanup(); +} + + +void +kbd_backlight_fix_config(void) +{ + if (kbd_cfg.auto_lvl > KBD_BACKLIGHT_MAX) + kbd_cfg.auto_lvl = KBD_BACKLIGHT_MAX; + + if (kbd_cfg.step < 1) + kbd_cfg.step = 1; + + if (kbd_cfg.step > (KBD_BACKLIGHT_MAX / 2)) + kbd_cfg.step = KBD_BACKLIGHT_MAX / 2; +} + + +static int +kbd_get_i2cdev(void) +{ + char buf[PATH_MAX]; + int i2c_bus; + int ret; + + FILE *fp; + + /* All the 256 minors (major 89) are reserved for i2c adapters */ + for (i2c_bus = 0; i2c_bus < 256; i2c_bus++) + { + ret = snprintf(buf, PATH_MAX - 1, "%s/i2c-%d/name", SYSFS_I2C_BASE, i2c_bus); + if ((ret < 0) || (ret >= (PATH_MAX - 1))) + { + logmsg(LOG_WARNING, "Error: i2c device probe: device path too long"); + + i2c_bus = 256; + break; + } + + fp = fopen(buf, "r"); + if (fp == NULL) + { + if (errno != ENOENT) + { + logmsg(LOG_ERR, "Error: i2c device probe: cannot open %s: %s", buf, strerror(errno)); + continue; + } + else + { + logmsg(LOG_ERR, "Error: i2c device probe: i2c device not found, is i2c-dev loaded?"); + + i2c_bus = 256; + break; + } + } + + ret = fread(buf, 1, PATH_MAX - 1, fp); + fclose(fp); + + if (ret < 1) + continue; + + buf[ret - 1] = '\0'; + + logdebug("Found i2c adapter [%s]\n", buf); + + if (ret < strlen(I2C_ADAPTER_NAME)) + continue; + + if (strncmp(buf, I2C_ADAPTER_NAME, strlen(I2C_ADAPTER_NAME)) == 0) + { + logmsg(LOG_INFO, "Found %s i2c adapter at i2c-%d", I2C_ADAPTER_NAME, i2c_bus); + break; + } + } + + if (i2c_bus > 255) + return -1; + + ret = snprintf(lmu_info.i2cdev, sizeof(lmu_info.i2cdev) - 1, "/dev/i2c-%d", i2c_bus); + if ((ret < 0) || (ret >= (sizeof(lmu_info.i2cdev) - 1))) + { + logmsg(LOG_WARNING, "Error: i2c device path too long"); + + return -1; + } + + return 0; +} + +int +kbd_get_lmuaddr(void) +{ + struct device_node *node; + int plen; + unsigned long *reg = NULL; + + of_init(); + + node = of_find_node_by_type("lmu-controller", 0); + if (node == NULL) + { + node = of_find_node_by_name("lmu-controller", 0); + if (node == NULL) + { + logmsg(LOG_ERR, "Error: no lmu-controller found in device-tree"); + + return -1; + } + } + + reg = of_find_property(node, "reg", &plen); + lmu_info.lmuaddr = (unsigned int) (*reg >> 1); + + free(reg); + of_free_node(node); + + logdebug("Found LMU controller at address 0x%x\n", lmu_info.lmuaddr); + + return 0; +} + +static int +kbd_probe_lmu(void) +{ + int fd; + int ret; + char buffer[4]; + + ret = kbd_get_lmuaddr(); + if (ret < 0) + return -1; + + ret = kbd_get_i2cdev(); + if (ret < 0) + return -1; + + fd = open(lmu_info.i2cdev, O_RDWR); + if (fd < 0) + { + logmsg(LOG_WARNING, "Could not open device %s: %s", lmu_info.i2cdev, strerror(errno)); + + return -1; + } + + ret = ioctl(fd, I2C_SLAVE, lmu_info.lmuaddr); + if (ret < 0) + { + logmsg(LOG_ERR, "ioctl failed on %s: %s", lmu_info.i2cdev, strerror(errno)); + + close(fd); + return -1; + } + + ret = read(fd, buffer, 4); + if (ret != 4) + { + logmsg(LOG_WARNING, "Probing failed on %s: %s", lmu_info.i2cdev, strerror(errno)); + + close(fd); + return -1; + } + close(fd); + + logdebug("Probing successful on %s\n", lmu_info.i2cdev); + + return 0; +} diff --git a/app-laptop/pommed/pommed-1.31/pommed/pmac/ofapi/of_api.h b/app-laptop/pommed/pommed-1.31/pommed/pmac/ofapi/of_api.h new file mode 100644 index 0000000..ca82b52 --- /dev/null +++ b/app-laptop/pommed/pommed-1.31/pommed/pmac/ofapi/of_api.h @@ -0,0 +1,46 @@ +/*************************************************************************** + * (C) Copyright 2006 Alastair Poole. netstar@gatheringofgray.com) * + * * + * This program is free software; you can redistribute it and/or modify * + * it under the terms of the GNU General Public License as published by * + * the Free Software Foundation; either version 2 of the License, or * + * (at your option) any later version. * + ***************************************************************************/ + +#ifndef __OF_USERSPACE__ +#define __OF_USERSPACE__ + +#define _GNU_SOURCE + +#include +#include +#include +#include +#include +#include +#include +#include + +char *OF_ROOT; + +struct node_property_t { + uint8_t *data; + uint32_t len; +}; + +struct device_node { + char *name; + char *path; + char *full_path; + char *type; + struct node_property_t linux_phandle; + struct device_node *next; + void *data; + uint32_t len; +}; + +#include "of_standard.h" +#include "of_internals.h" +#include "of_externals.h" + +#endif diff --git a/app-laptop/pommed/pommed-1.31/pommed/pmac/ofapi/of_externals.c b/app-laptop/pommed/pommed-1.31/pommed/pmac/ofapi/of_externals.c new file mode 100644 index 0000000..b1b41ab --- /dev/null +++ b/app-laptop/pommed/pommed-1.31/pommed/pmac/ofapi/of_externals.c @@ -0,0 +1,229 @@ +/*************************************************************************** + * (C) Copyright 2006 Alastair Poole. netstar@gatheringofgray.com) * + * * + * This program is free software; you can redistribute it and/or modify * + * it under the terms of the GNU General Public License as published by * + * the Free Software Foundation; either version 2 of the License, or * + * (at your option) any later version. * + ***************************************************************************/ + +#include "of_api.h" + +void of_init(void) +{ + OF_ROOT="/proc/device-tree"; +} + +void of_init_root(char *path) +{ + uint32_t len; + + if(!path) + of_error("of_init_root() NULL path"); + + len = strlen(path); + if(!len) + of_error("of_init_root() Invalid path"); + + if(path[len-1] == '/') + path[len-1] = '\0'; + + OF_ROOT=path; +} + + +int of_test_property(struct device_node *node, const char *name) +{ + struct stat fstats; + char buf[PATH_MAX]={0}; + + strcat(strcat(buf, node->full_path), name); + + if(stat(buf, &fstats) < 0) + return 0; + else + return 1; +} + +void *of_find_property(struct device_node *node, const char *name, int *plen) +{ + char buf[PATH_MAX]={0}; + uint8_t *property; + uint32_t size; + struct stat fstats; + int fd; + + + strcat(strcat(buf, node->full_path), name); + + if (stat(buf, &fstats) < 0) + return NULL; + + size = fstats.st_size; + + property = malloc(size); + if(!property) + of_error("malloc()"); + + if ((fd = open(buf, O_RDONLY)) < 0) + of_error("open()"); + + if ((*plen = read(fd, property, size)) != size) + of_error("read()"); + + close(fd); + + return property; +} + +int of_property_to_n_uint64(uint64_t *val, void *prop, uint32_t len, int n) +{ + *val = 0; + int i=0; + uint8_t *data = prop; + + if((n*8 > len) || (n == 0)) + return 0; + + for(i=0; i < (n*8)-1; i++); + + *val = ((uint64_t) data[i - 7] << 56) + + ((uint64_t) data[i - 6] << 48) + + ((uint64_t) data[i - 5] << 40) + + ((uint64_t) data[i - 4] << 32) + + ((uint64_t) data[i - 3] << 24) + + ((uint64_t) data[i - 2] << 16) + + ((uint64_t) data[i - 1] << 8) + (uint64_t) data[i]; + + return 1; +} + +int of_property_to_n_uint32(uint32_t *val, void *prop, uint32_t len, int n) +{ + *val = 0; + int i=0; + uint8_t *data = prop; + + if((n*4 > len) || (n == 0)) + return 0; + + for(i=0; i < (n*4)-1; i++); + + *val = (data[i-3] << 24) + (data[i-2] << 16) + + (data[i-1] << 8) + (data[i]); + + return 1; +} + + +int of_property_to_uint32(uint32_t *val, void *prop, uint32_t len) +{ + *val=0; + uint8_t *data = prop; + + if(len != 4) + return 0; + + *val = (data[0] << 24) + (data[1] << 16) + + (data[2] << 8) + data[3]; + + return 1; +} + +struct device_node *of_get_parent(struct device_node *node) +{ + struct device_node *tmp; + char *p; + char *ptr; + + if((!node->path) || (!node) || (strlen(node->path)==1)) + return NULL; + + ptr=strdup(node->path); + + p=strrchr(ptr, '/'); + *p=0; + p=strrchr(ptr, '/'); + *p=0; + + tmp=of_find_node_by_path(ptr); + + free(ptr); + + return tmp; +} + +struct device_node *of_find_node_by_name(const char *name, int type) +{ + if (!_n_sem) + _of_find_node_by_parse(OF_ROOT, name, OF_SEARCH_NAME, type); + + return _of_return_nodes(_n_array, &_n_idx, &_n_sem, type); +} + +struct device_node *of_find_type_devices(const char *device_type) +{ + struct device_node *list = calloc(1, sizeof(struct device_node)); + struct device_node *tmp = NULL; + struct device_node *ptr = list; + + while ((tmp = of_find_node_by_type(device_type, 1)) != NULL) { + ptr->next = tmp; + ptr = ptr->next; + ptr->next = NULL; + } + + return list; +} + +void of_find_type_devices_free(struct device_node *root) +{ + struct device_node *cursor = root; + struct device_node *fwd; + + while (cursor) { + fwd = cursor->next; + of_free_node(cursor); + cursor = fwd; + } +} + +struct device_node *of_find_node_by_path(const char *path) +{ + struct device_node *tmp = NULL; + char buf[PATH_MAX]; + struct stat fstats; + + _of_make_compat_path(path, buf); + + if (stat(buf, &fstats) < 0) + return NULL; + + tmp = _of_populate_node(buf, NULL); + + return tmp; +} + +struct device_node *of_find_node_by_phandle(uint32_t phandle) +{ + uint32_t *ptr = malloc(4); + if(!ptr) + of_error("malloc()"); + + *ptr = phandle; + + _of_find_node_by_parse(OF_ROOT, (void *)ptr, OF_SEARCH_PHDL, 0); + + free(ptr); + + return _of_return_nodes(_p_array, &_p_idx, &_t_sem, 0); +} + +struct device_node *of_find_node_by_type(const char *device_type, int type) +{ + if (!_t_sem) + _of_find_node_by_parse(OF_ROOT, device_type, OF_SEARCH_TYPE, type); + + return _of_return_nodes(_t_array, &_t_idx, &_t_sem, type); +} + diff --git a/app-laptop/pommed/pommed-1.31/pommed/pmac/ofapi/of_externals.h b/app-laptop/pommed/pommed-1.31/pommed/pmac/ofapi/of_externals.h new file mode 100644 index 0000000..81ac689 --- /dev/null +++ b/app-laptop/pommed/pommed-1.31/pommed/pmac/ofapi/of_externals.h @@ -0,0 +1,47 @@ +/*************************************************************************** + * (C) Copyright 2006 Alastair Poole. netstar@gatheringofgray.com) * + * * + * This program is free software; you can redistribute it and/or modify * + * it under the terms of the GNU General Public License as published by * + * the Free Software Foundation; either version 2 of the License, or * + * (at your option) any later version. * + ***************************************************************************/ + +#ifndef __OF_DEVICE_BY__ +#define __OF_DEVICE_BY__ + +#define OF_SEARCH_NAME 0x01 +#define OF_SEARCH_TYPE 0x02 +#define OF_SEARCH_PHDL 0x03 + +struct device_node *_n_array[256]; +int _n_idx; +int _n_sem; + +struct device_node *_t_array[256]; +int _t_idx; +int _t_sem; + +struct device_node *_p_array[2]; +int _p_sem; +int _p_idx; + +void of_init(void); +void of_init_root(char *path); + +struct device_node *of_find_node_by_type(const char *device_type, int type); +struct device_node *of_find_node_by_name(const char *name, int type); +struct device_node *of_find_node_by_path(const char *path); +struct device_node *of_find_node_by_phandle(uint32_t phandle); +struct device_node *of_get_parent(struct device_node *node); + +void *of_find_property(struct device_node *node, const char *name, int *plen); +int of_test_property(struct device_node *node, const char *name); +int of_property_to_uint32(uint32_t *val, void *prop, uint32_t len); +int of_property_to_n_uint32(uint32_t *val, void *prop, uint32_t len, int n); +int of_property_to_n_uint64(uint64_t *val, void *prop, uint32_t len, int n); + +struct device_node *of_find_type_devices(const char *device_type); +void of_find_type_devices_free(struct device_node *root); + +#endif diff --git a/app-laptop/pommed/pommed-1.31/pommed/pmac/ofapi/of_internals.c b/app-laptop/pommed/pommed-1.31/pommed/pmac/ofapi/of_internals.c new file mode 100644 index 0000000..60c74cf --- /dev/null +++ b/app-laptop/pommed/pommed-1.31/pommed/pmac/ofapi/of_internals.c @@ -0,0 +1,407 @@ +/*************************************************************************** + * (C) Copyright 2006 Alastair Poole. netstar@gatheringofgray.com) * + * * + * This program is free software; you can redistribute it and/or modify * + * it under the terms of the GNU General Public License as published by * + * the Free Software Foundation; either version 2 of the License, or * + * (at your option) any later version. * + ***************************************************************************/ + +#include "of_api.h" + +#include + +struct device_node *_of_return_nodes(struct device_node **array, int *idx, + int *sem, int type) +{ + while (*idx >= 0) { + + if (*idx == 0 || type == 0) + *sem = 0; + + return *idx > 0 ? array[(*idx)--] : NULL; + } + + return NULL; +} + +char *_of_read_name(const char *path, struct device_node *node) +{ + int fd; + char *tmp; + char buf[PATH_MAX]; + struct stat fstats; + uint32_t size; + + snprintf(buf, sizeof(buf), "%s%s", path, "name"); + + if (stat(buf, &fstats) < 0) + return NULL; + + size = fstats.st_size; + + if ((fd = open(buf, O_RDONLY)) < 0) + return NULL; + + if (node) { + node->name = calloc(1, size); + if(!node->name) + of_error("calloc()"); + + tmp = node->name; + } else { + tmp = calloc(1, size); + if(!tmp) + of_error("calloc()"); + } + + if (read(fd, tmp, size) != size) + of_error("read()"); + + close(fd); + + return tmp; +} + +void _of_read_type(const char *path, struct device_node *node) +{ + int fd; + char buf[PATH_MAX]; + struct stat fstats; + uint32_t size; + + snprintf(buf, sizeof(buf),"%s%s", path, "device_type"); + + if (stat(buf, &fstats) < 0) + return; + + size = fstats.st_size; + + if ((fd = open(buf, O_RDONLY)) < 0) + return; + + node->type = calloc(1, size); + if(!node->type) + of_error("calloc()"); + + if (read(fd, node->type, size) != size) + of_error("read()"); + + close(fd); +} + +void _of_read_linux_phandle(const char *path, struct device_node *node) +{ + int fd; + char buf[PATH_MAX]; + struct stat fstats; + uint32_t size; + + snprintf(buf, sizeof(buf), "%s%s", path, "linux,phandle"); + + if (stat(buf, &fstats) < 0) + return; + + size = fstats.st_size; + if(!size) + return; + + if ((fd = open(buf, O_RDONLY)) < 0) + return; + + node->linux_phandle.len = size; + node->linux_phandle.data = calloc(1, size); + + if (read(fd, node->linux_phandle.data, size) != size) + of_error("read()"); + + close(fd); +} + +void _of_get_path(char *path) +{ + char *ptr; + char *p; + int i; + + i = strlen(OF_ROOT); + ptr = strdup(path); + p = &ptr[i]; + + sprintf(path, "%s", p); + + free(ptr); +} + +struct device_node *_of_populate_node(const char *path, const char *name) +{ + struct device_node *tmp = calloc(1, sizeof(struct device_node)); + char *p = strdup(path); + + _of_remove_filename(p); + + tmp->full_path = strdup(p); + + if (name) + tmp->name = strdup(name); + else + _of_read_name(path, tmp); + + _of_get_path(p); + + tmp->path = strdup(p); + free(p); + + _of_read_linux_phandle(tmp->full_path, tmp); + _of_read_type(tmp->full_path, tmp); + + return tmp; +} + +struct device_node *_of_get_type(const char *path, const char *type) +{ + int fd; + char buf[PATH_MAX]; + char *name; + char *ptr; + struct device_node *tmp = NULL; + struct stat fstats; + uint32_t size; + + if (stat(path, &fstats) < 0) { + exit(EXIT_FAILURE); + } + + size = fstats.st_size; + if(!size) + return NULL; + + if ((fd = open(path, O_RDONLY)) < 0) + of_error("open()"); + + if (read(fd, buf, size) != size) + of_error("read()"); + + if (memcmp(buf, type, size)) + goto out; + + ptr = strdup(path); + + _of_remove_filename(ptr); + + name = _of_read_name(ptr, NULL); + + tmp = _of_populate_node(path, name); + + free(ptr); + free(name); + + out: + + close(fd); + + return tmp; +} + +void _of_remove_filename(char *path) +{ + char *ptr; + ptr = strrchr(path, '/'); + *(ptr + 1) = '\0'; +} + +uint32_t _of_phandle_to_int(struct node_property_t phandle) +{ + uint32_t tmp = 0; + + if (phandle.len == 4) + tmp = + (phandle.data[0] << 24) + (phandle.data[1] << 16) + + (phandle.data[2] << 8) + phandle.data[3]; + + return tmp; +} + +void _of_make_compat_path(const char *path, char *buf) +{ + size_t slen = strlen(path); + int changed = 0; + + if (*path != '/') + changed = 1; + + if(!strlen(path)) { + snprintf(buf, PATH_MAX, "%s/", OF_ROOT); + return; + } + + if (path[slen - 1] != '/') { + if (changed) + snprintf(buf, PATH_MAX, "%s/%s/", OF_ROOT, path); + else + snprintf(buf, PATH_MAX, "%s%s/", OF_ROOT, path); + } else + snprintf(buf, PATH_MAX, "%s%s", OF_ROOT, path); +} + +struct device_node *_of_get_phandle(const char *path, const uint32_t * phandle) +{ + struct node_property_t props; + struct device_node *tmp = NULL; + uint32_t size, val = 0; + struct stat fstats; + int fd; + char *ptr; + char *name; + + if (stat(path, &fstats) < 0) + return NULL; + + size = fstats.st_size; + if(!size) + return NULL; + + props.data = malloc(size); + if(!props.data) + of_error("calloc()"); + + props.len = size; + + if ((fd = open(path, O_RDONLY)) < 0) + of_error("open()"); + + if (read(fd, props.data, size) != size) + of_error("read()"); + + close(fd); + + val = _of_phandle_to_int(props); + free(props.data); + + if (val == *phandle) { + ptr = strdup(path); + _of_remove_filename(ptr); + name = _of_read_name(ptr, NULL); + tmp = _of_populate_node(path, name); + free(ptr); + free(name); + } + + return tmp; +} +struct device_node *_of_get_name(const char *path, const char *name) +{ + int fd; + uint32_t size; + char buf[PATH_MAX]; + struct device_node *tmp = NULL; + struct stat fstats; + + if (stat(path, &fstats) < 0) + return NULL; + + size = fstats.st_size; + if(!size) + return NULL; + + if ((fd = open(path, O_RDONLY)) < 0) + of_error("open()"); + + if (read(fd, buf, size) != size) + of_error("read()"); + + if (memcmp(buf, name, size)) + goto out; + + tmp = _of_populate_node(path, name); + + out: + + close(fd); + + return tmp; +} + +void _of_find_node_by_parse(char *path, const void *search, uint16_t type, int full) +{ + DIR *dir; + struct dirent *tmp = NULL; + char *directories[8192] = { NULL }; + char fullpath[PATH_MAX]; + int x = 0; + struct stat fstats; + struct device_node *node = NULL; + + lstat(path, &fstats); + + if (S_ISLNK(fstats.st_mode)) + return; + + if ((dir = opendir(path)) == NULL) + return; + + while ((tmp = readdir(dir)) != NULL) { + + if ((strcmp(tmp->d_name, ".")) && (strcmp(tmp->d_name, ".."))) { + + if (!strcmp(path, "/")) + strcat(strcpy(fullpath, "/"), tmp->d_name); + else + strcat(strcat(strcpy(fullpath, path), "/"), + tmp->d_name); + + if (type == OF_SEARCH_NAME) { + if (!strcmp(tmp->d_name, "name")) { + if ((node = + _of_get_name(fullpath, + search)) != NULL) { + _n_array[++_n_idx] = node; + _n_sem = 1; + if(full==0) + goto out; + } + } + } + + if (type == OF_SEARCH_TYPE) { + if (!strcmp(tmp->d_name, "device_type")) { + if ((node = + _of_get_type(fullpath, + search)) != NULL) { + _t_array[++_t_idx] = node; + _t_sem = 1; + if(full==0) + goto out; + } + } + } + + if (type == OF_SEARCH_PHDL) { + if (!strcmp(tmp->d_name, "linux,phandle")) { + if ((node = + _of_get_phandle(fullpath, + search)) != NULL) { + _p_array[++_p_idx] = node; + _p_sem = 1; + goto out; + } + } + } + + lstat(fullpath, &fstats); + if (S_ISDIR(fstats.st_mode)) + directories[x++] = strdup(fullpath); + } + } + + x = 0; + + while (directories[x] != NULL) { + _of_find_node_by_parse(directories[x], search, type, full); + out: + free(directories[x++]); + } + + closedir(dir); +} + diff --git a/app-laptop/pommed/pommed-1.31/pommed/pmac/ofapi/of_internals.h b/app-laptop/pommed/pommed-1.31/pommed/pmac/ofapi/of_internals.h new file mode 100644 index 0000000..40f1fbf --- /dev/null +++ b/app-laptop/pommed/pommed-1.31/pommed/pmac/ofapi/of_internals.h @@ -0,0 +1,29 @@ +/*************************************************************************** + * (C) Copyright 2006 Alastair Poole. netstar@gatheringofgray.com) * + * * + * This program is free software; you can redistribute it and/or modify * + * it under the terms of the GNU General Public License as published by * + * the Free Software Foundation; either version 2 of the License, or * + * (at your option) any later version. * + ***************************************************************************/ + +#ifndef __OF_INTERNALS__ +#define __OF_INTERNALS__ +#include "of_api.h" + +void _of_find_node_by_parse(char *path, const void *search, uint16_t type, int full); +struct device_node *_of_return_nodes(struct device_node **array, int *idx, + int *sem, int type); +struct device_node *_of_get_name(const char *path, const char *name); +struct device_node *_of_get_type(const char *path, const char *type); +struct device_node *_of_populate_node(const char *path, const char *name); +struct device_node *_of_get_phandle(const char *path, const uint32_t * phandle); + +void _of_read_linux_phandle(const char *path, struct device_node *node); +void _of_read_type(const char *path, struct device_node *node); + +void _of_remove_filename(char *path); +void _of_get_path(char *path); +void _of_make_compat_path(const char *path, char *buf); + +#endif diff --git a/app-laptop/pommed/pommed-1.31/pommed/pmac/ofapi/of_standard.c b/app-laptop/pommed/pommed-1.31/pommed/pmac/ofapi/of_standard.c new file mode 100644 index 0000000..a3e9980 --- /dev/null +++ b/app-laptop/pommed/pommed-1.31/pommed/pmac/ofapi/of_standard.c @@ -0,0 +1,34 @@ +/*************************************************************************** + * (C) Copyright 2006 Alastair Poole. netstar@gatheringofgray.com) * + * * + * This program is free software; you can redistribute it and/or modify * + * it under the terms of the GNU General Public License as published by * + * the Free Software Foundation; either version 2 of the License, or * + * (at your option) any later version. * + ***************************************************************************/ + +#include "of_api.h" + +void of_error(char *error) +{ + fprintf(stderr, "Error: %s\n", error); + exit(EXIT_FAILURE); +} + +void of_free_node(struct device_node *node) +{ + if (node->name) + free(node->name); + if (node->path) + free(node->path); + if (node->full_path) + free(node->full_path); + if (node->type) + free(node->type); + if (node->linux_phandle.data) + free(node->linux_phandle.data); + if (node->data) + free(node->data); + if (node) + free(node); +} diff --git a/app-laptop/pommed/pommed-1.31/pommed/pmac/ofapi/of_standard.h b/app-laptop/pommed/pommed-1.31/pommed/pmac/ofapi/of_standard.h new file mode 100644 index 0000000..931b8e4 --- /dev/null +++ b/app-laptop/pommed/pommed-1.31/pommed/pmac/ofapi/of_standard.h @@ -0,0 +1,16 @@ +/*************************************************************************** + * (C) Copyright 2006 Alastair Poole. netstar@gatheringofgray.com) * + * * + * This program is free software; you can redistribute it and/or modify * + * it under the terms of the GNU General Public License as published by * + * the Free Software Foundation; either version 2 of the License, or * + * (at your option) any later version. * + ***************************************************************************/ + +#ifndef __OF_STANDARD__ +#define __OF_STANDARD__ + +void of_error(char *error); +void of_free_node(struct device_node *node); + +#endif diff --git a/app-laptop/pommed/pommed-1.31/pommed/pmac/pmu.c b/app-laptop/pommed/pommed-1.31/pommed/pmac/pmu.c new file mode 100644 index 0000000..e817515 --- /dev/null +++ b/app-laptop/pommed/pommed-1.31/pommed/pmac/pmu.c @@ -0,0 +1,80 @@ +/* + * pommed - Apple laptops hotkeys handler daemon + * + * Copyright (C) 2006-2008 Julien BLACHE + * + * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; version 2 of the License. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License along + * with this program; if not, write to the Free Software Foundation, Inc., + * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. + */ + +#include +#include +#include + +#include "../pommed.h" +#include "../power.h" + + +#define PROC_PMU_AC_STATE_FILE "/proc/pmu/info" +#define PROC_PMU_AC_STATE "AC Power" +#define PROC_PMU_AC_ONLINE '1' +#define PROC_PMU_AC_OFFLINE '0' + + +/* Internal API - procfs PMU */ +int +procfs_check_ac_state(void) +{ + FILE *fp; + char buf[128]; + char *ac_state; + int ret; + + fp = fopen(PROC_PMU_AC_STATE_FILE, "r"); + if (fp == NULL) + return AC_STATE_ERROR; + + ret = fread(buf, 1, 127, fp); + + if (ferror(fp) != 0) + { + logdebug("pmu: Error reading AC state: %s\n", strerror(errno)); + return AC_STATE_ERROR; + } + + if (feof(fp) == 0) + { + logdebug("pmu: Error reading AC state: buffer too small\n"); + return AC_STATE_ERROR; + } + + fclose(fp); + + buf[ret] = '\0'; + + ac_state = strstr(buf, PROC_PMU_AC_STATE); + if (ac_state == NULL) + return AC_STATE_ERROR; + + ac_state = strchr(ac_state, '\n'); + if ((ac_state == NULL) || (ac_state == buf)) + return AC_STATE_ERROR; + + if (ac_state[-1] == PROC_PMU_AC_ONLINE) + return AC_STATE_ONLINE; + + if (ac_state[-1] == PROC_PMU_AC_OFFLINE) + return AC_STATE_OFFLINE; + + return AC_STATE_UNKNOWN; +} diff --git a/app-laptop/pommed/pommed-1.31/pommed/pommed.c b/app-laptop/pommed/pommed-1.31/pommed/pommed.c new file mode 100644 index 0000000..20cd174 --- /dev/null +++ b/app-laptop/pommed/pommed-1.31/pommed/pommed.c @@ -0,0 +1,950 @@ +/* + * pommed - Apple laptops hotkeys handler daemon + * + * Copyright (C) 2006-2008 Julien BLACHE + * + * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; version 2 of the License. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License along + * with this program; if not, write to the Free Software Foundation, Inc., + * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. + */ + +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include + +#include + +#include +#include + +#include + +#ifndef __powerpc__ +# define check_machine() check_machine_dmi() +#else +# define check_machine() check_machine_pmu() +#endif /* __powerpc__ */ + +#include + +#include "pommed.h" +#include "kbd_backlight.h" +#include "lcd_backlight.h" +#include "cd_eject.h" +#include "evdev.h" +#include "evloop.h" +#include "conffile.h" +#include "audio.h" +#include "dbus.h" +#include "power.h" +#include "beep.h" + + +/* Machine-specific operations */ +struct machine_ops *mops; + + +/* --- WARNING --- + * + * Be extra-careful here, the list below must come in the same + * order as the machine_type enum in pommed.h ! + */ +#ifdef __powerpc__ +/* PowerBook machines */ + +struct machine_ops pb_mops[] = { + /* PowerBook3,1 is a G3-based PowerBook */ + + { /* PowerBook3,2 */ + .type = MACHINE_POWERBOOK_32, + .lcd_backlight_probe = aty128_sysfs_backlight_probe, + .lcd_backlight_step = sysfs_backlight_step_kernel, + .lcd_backlight_toggle = sysfs_backlight_toggle_kernel, + /* .evdev_identify = evdev_is_adb, */ + }, + + { /* PowerBook3,3 */ + .type = MACHINE_POWERBOOK_33, + .lcd_backlight_probe = r9x00_sysfs_backlight_probe, + .lcd_backlight_step = sysfs_backlight_step, + .lcd_backlight_toggle = sysfs_backlight_toggle, + /* .evdev_identify = evdev_is_adb, */ + }, + + { /* PowerBook3,4 */ + .type = MACHINE_POWERBOOK_34, + .lcd_backlight_probe = r9x00_sysfs_backlight_probe, + .lcd_backlight_step = sysfs_backlight_step, + .lcd_backlight_toggle = sysfs_backlight_toggle, + /* .evdev_identify = evdev_is_adb, */ + }, + + { /* PowerBook3,5 */ + .type = MACHINE_POWERBOOK_35, + .lcd_backlight_probe = r9x00_sysfs_backlight_probe, + .lcd_backlight_step = sysfs_backlight_step, + .lcd_backlight_toggle = sysfs_backlight_toggle, + /* .evdev_identify = evdev_is_adb, */ + }, + + /* PowerBook4,* -> G3 iBooks */ + + { /* PowerBook5,1 */ + .type = MACHINE_POWERBOOK_51, + .lcd_backlight_probe = nvidia_sysfs_backlight_probe, + .lcd_backlight_step = sysfs_backlight_step, + .lcd_backlight_toggle = sysfs_backlight_toggle, + /* .evdev_identify = evdev_is_adb, */ + }, + + { /* PowerBook5,2 */ + .type = MACHINE_POWERBOOK_52, + .lcd_backlight_probe = r9x00_sysfs_backlight_probe, + .lcd_backlight_step = sysfs_backlight_step, + .lcd_backlight_toggle = sysfs_backlight_toggle, + /* .evdev_identify = evdev_is_adb, */ + }, + + { /* PowerBook5,3 */ + .type = MACHINE_POWERBOOK_53, + .lcd_backlight_probe = r9x00_sysfs_backlight_probe, + .lcd_backlight_step = sysfs_backlight_step, + .lcd_backlight_toggle = sysfs_backlight_toggle, + /* .evdev_identify = evdev_is_adb, */ + }, + + { /* PowerBook5,4 */ + .type = MACHINE_POWERBOOK_54, + .lcd_backlight_probe = r9x00_sysfs_backlight_probe, + .lcd_backlight_step = sysfs_backlight_step, + .lcd_backlight_toggle = sysfs_backlight_toggle, + /* .evdev_identify = evdev_is_adb, */ + }, + + { /* PowerBook5,5 */ + .type = MACHINE_POWERBOOK_55, + .lcd_backlight_probe = r9x00_sysfs_backlight_probe, + .lcd_backlight_step = sysfs_backlight_step, + .lcd_backlight_toggle = sysfs_backlight_toggle, + /* .evdev_identify = evdev_is_adb, */ + }, + + { /* PowerBook5,6 */ + .type = MACHINE_POWERBOOK_56, + .lcd_backlight_probe = r9x00_sysfs_backlight_probe, + .lcd_backlight_step = sysfs_backlight_step, + .lcd_backlight_toggle = sysfs_backlight_toggle, + /* .evdev_identify = evdev_is_fountain, */ + }, + + { /* PowerBook5,7 */ + .type = MACHINE_POWERBOOK_57, + .lcd_backlight_probe = r9x00_sysfs_backlight_probe, + .lcd_backlight_step = sysfs_backlight_step, + .lcd_backlight_toggle = sysfs_backlight_toggle, + /* .evdev_identify = evdev_is_fountain, */ + }, + + { /* PowerBook5,8 */ + .type = MACHINE_POWERBOOK_58, + .lcd_backlight_probe = r9x00_sysfs_backlight_probe, + .lcd_backlight_step = sysfs_backlight_step, + .lcd_backlight_toggle = sysfs_backlight_toggle, + /* .evdev_identify = evdev_is_geyser, */ + }, + + { /* PowerBook5,9 */ + .type = MACHINE_POWERBOOK_59, + .lcd_backlight_probe = r9x00_sysfs_backlight_probe, + .lcd_backlight_step = sysfs_backlight_step, + .lcd_backlight_toggle = sysfs_backlight_toggle, + /* .evdev_identify = evdev_is_geyser, */ + }, + + /* G4 iBooks & 12" PowerBooks */ + + { /* PowerBook6,1 */ + .type = MACHINE_POWERBOOK_61, + .lcd_backlight_probe = nvidia_sysfs_backlight_probe, + .lcd_backlight_step = sysfs_backlight_step, + .lcd_backlight_toggle = sysfs_backlight_toggle, + /* .evdev_identify = evdev_is_adb, */ + }, + + { /* PowerBook6,2 */ + .type = MACHINE_POWERBOOK_62, + .lcd_backlight_probe = nvidia_sysfs_backlight_probe, + .lcd_backlight_step = sysfs_backlight_step, + .lcd_backlight_toggle = sysfs_backlight_toggle, + /* .evdev_identify = evdev_is_adb, */ + }, + + { /* PowerBook6,3 */ + .type = MACHINE_POWERBOOK_63, + .lcd_backlight_probe = r9x00_sysfs_backlight_probe, + .lcd_backlight_step = sysfs_backlight_step, + .lcd_backlight_toggle = sysfs_backlight_toggle, + /* .evdev_identify = evdev_is_adb, */ + }, + + { /* PowerBook6,4 */ + .type = MACHINE_POWERBOOK_64, + .lcd_backlight_probe = nvidia_sysfs_backlight_probe, + .lcd_backlight_step = sysfs_backlight_step, + .lcd_backlight_toggle = sysfs_backlight_toggle, + /* .evdev_identify = evdev_is_adb, */ + }, + + { /* PowerBook6,5 */ + .type = MACHINE_POWERBOOK_65, + .lcd_backlight_probe = r9x00_sysfs_backlight_probe, + .lcd_backlight_step = sysfs_backlight_step, + .lcd_backlight_toggle = sysfs_backlight_toggle, + /* .evdev_identify = evdev_is_adb, */ + }, + + /* Looks like PowerBook6,6 never made it to the market ? */ + + { /* PowerBook6,7 */ + .type = MACHINE_POWERBOOK_67, + .lcd_backlight_probe = r9x00_sysfs_backlight_probe, + .lcd_backlight_step = sysfs_backlight_step, + .lcd_backlight_toggle = sysfs_backlight_toggle, + /* .evdev_identify = evdev_is_adb, */ + }, + + { /* PowerBook6,8 */ + .type = MACHINE_POWERBOOK_68, + .lcd_backlight_probe = nvidia_sysfs_backlight_probe, + .lcd_backlight_step = sysfs_backlight_step, + .lcd_backlight_toggle = sysfs_backlight_toggle, + /* .evdev_identify = evdev_is_adb, */ + } +}; + +#else + +struct machine_ops mb_mops[] = { + /* MacBook Pro machines */ + + { /* MacBookPro1,1 / MacBookPro1,2 (Core Duo) */ + .type = MACHINE_MACBOOKPRO_1, + .lcd_backlight_probe = x1600_backlight_probe, + .lcd_backlight_step = x1600_backlight_step, + .lcd_backlight_toggle = x1600_backlight_toggle, + /* .evdev_identify = evdev_is_geyser3, */ + }, + + { /* MacBookPro2,1 / MacBookPro2,2 (Core2 Duo) */ + .type = MACHINE_MACBOOKPRO_2, + .lcd_backlight_probe = x1600_backlight_probe, + .lcd_backlight_step = x1600_backlight_step, + .lcd_backlight_toggle = x1600_backlight_toggle, + /* .evdev_identify = evdev_is_geyser4, */ + }, + + { /* MacBookPro3,1 (15" & 17", Core2 Duo, June 2007) */ + .type = MACHINE_MACBOOKPRO_3, + .lcd_backlight_probe = mbp_sysfs_backlight_probe, + .lcd_backlight_step = sysfs_backlight_step, + .lcd_backlight_toggle = sysfs_backlight_toggle, + /* .evdev_identify = evdev_is_geyser4, */ + }, + + { /* MacBookPro4,1 (15" & 17", Core2 Duo, February 2008) */ + .type = MACHINE_MACBOOKPRO_4, + .lcd_backlight_probe = mbp_sysfs_backlight_probe, + .lcd_backlight_step = sysfs_backlight_step, + .lcd_backlight_toggle = sysfs_backlight_toggle, + /* .evdev_identify = evdev_is_wellspring2, */ + }, + + { /* MacBookPro5,1 (15" & 17", Core2 Duo, October 2008) + * MacBookPro5,2 (17" June 2009) + * MacBookPro5,3 (15" June 2009) + * MacBookPro5,4 (15" June 2009) + * MacBookPro5,5 (13" June 2009) */ + .type = MACHINE_MACBOOKPRO_5, + .lcd_backlight_probe = mbp_sysfs_backlight_probe, + .lcd_backlight_step = sysfs_backlight_step, + .lcd_backlight_toggle = sysfs_backlight_toggle, + /* .evdev_identify = evdev_is_wellspring3, */ + }, + + /* MacBook machines */ + + { /* MacBook1,1 (Core Duo) */ + .type = MACHINE_MACBOOK_1, + .lcd_backlight_probe = gma950_backlight_probe, + .lcd_backlight_step = gma950_backlight_step, + .lcd_backlight_toggle = gma950_backlight_toggle, + /* .evdev_identify = evdev_is_geyser3, */ + }, + + { /* MacBook2,1 (Core2 Duo) */ + .type = MACHINE_MACBOOK_2, + .lcd_backlight_probe = gma950_backlight_probe, + .lcd_backlight_step = gma950_backlight_step, + .lcd_backlight_toggle = gma950_backlight_toggle, + /* .evdev_identify = evdev_is_geyser4, */ + }, + + { /* MacBook3,1 (Core2 Duo Santa Rosa, November 2007) */ + .type = MACHINE_MACBOOK_3, + .lcd_backlight_probe = gma950_backlight_probe, /* gma950 supports the gma965 */ + .lcd_backlight_step = gma950_backlight_step, + .lcd_backlight_toggle = gma950_backlight_toggle, + /* .evdev_identify = evdev_is_geyser4hf, */ + }, + + { /* MacBook4,1 (Core2 Duo, February 2008) */ + .type = MACHINE_MACBOOK_4, + .lcd_backlight_probe = gma950_backlight_probe, /* gma950 supports the gma965 */ + .lcd_backlight_step = gma950_backlight_step, + .lcd_backlight_toggle = gma950_backlight_toggle, + /* .evdev_identify = evdev_is_geyser4hf, */ + }, + + { /* MacBook5,1 (Core2 Duo, October 2008) */ + .type = MACHINE_MACBOOK_5, + .lcd_backlight_probe = mbp_sysfs_backlight_probe, + .lcd_backlight_step = sysfs_backlight_step, + .lcd_backlight_toggle = sysfs_backlight_toggle, + /* .evdev_identify = evdev_is_wellspring3, */ + }, + + /* MacBook Air machines */ + + { /* MacBookAir1,1 (January 2008) */ + .type = MACHINE_MACBOOKAIR_1, + .lcd_backlight_probe = gma950_backlight_probe, /* gma950 supports the gma965 */ + .lcd_backlight_step = gma950_backlight_step, + .lcd_backlight_toggle = gma950_backlight_toggle, + /* .evdev_identify = evdev_is_wellspring, */ + }, + + { /* MacBookAir2,1 (October 2008) */ + .type = MACHINE_MACBOOKAIR_2, + .lcd_backlight_probe = mbp_sysfs_backlight_probe, + .lcd_backlight_step = sysfs_backlight_step, + .lcd_backlight_toggle = sysfs_backlight_toggle, + /* .evdev_identify = evdev_is_wellspring3, */ + } +}; +#endif /* __powerpc__ */ + + +/* debug mode */ +int debug = 0; +int console = 0; + + +void +logmsg(int level, char *fmt, ...) +{ + va_list ap; + FILE *where = stdout; + + va_start(ap, fmt); + + if (console) + { + switch (level) + { + case LOG_INFO: + fprintf(where, "I: "); + break; + + case LOG_WARNING: + fprintf(where, "W: "); + break; + + case LOG_ERR: + where = stderr; + fprintf(where, "E: "); + break; + + default: + break; + } + vfprintf(where, fmt, ap); + fprintf(where, "\n"); + } + else + { + vsyslog(level | LOG_DAEMON, fmt, ap); + } + + va_end(ap); +} + +void +logdebug(char *fmt, ...) +{ + va_list ap; + + va_start(ap, fmt); + + if (debug) + vfprintf(stderr, fmt, ap); + + va_end(ap); +} + + +void +kbd_set_fnmode(void) +{ + char *fnmode_node[] = + { + "/sys/module/hid_apple/parameters/fnmode", /* 2.6.28 & up */ + "/sys/module/hid/parameters/pb_fnmode", /* 2.6.20 & up */ + "/sys/module/usbhid/parameters/pb_fnmode" + }; + FILE *fp; + int i; + + if ((general_cfg.fnmode < 1) || (general_cfg.fnmode > 2)) + general_cfg.fnmode = 1; + + for (i = 0; i < sizeof(fnmode_node) / sizeof(*fnmode_node); i++) + { + logdebug("Trying %s\n", fnmode_node[i]); + + fp = fopen(fnmode_node[i], "a"); + if (fp != NULL) + break; + + if (errno == ENOENT) + continue; + + logmsg(LOG_INFO, "Could not open %s: %s", fnmode_node[i], strerror(errno)); + return; + } + + fprintf(fp, "%d", general_cfg.fnmode); + + fclose(fp); +} + +#ifdef __powerpc__ +static machine_type +check_machine_pmu(void) +{ + int fd; + int n; + int ret = MACHINE_UNKNOWN; + + char buffer[128]; + + /* Check copyright node, look for "Apple Computer, Inc." */ + fd = open("/proc/device-tree/copyright", O_RDONLY); + if (fd < 0) + { + logmsg(LOG_ERR, "Could not open /proc/device-tree/copyright"); + + return ret; + } + + n = read(fd, buffer, sizeof(buffer) - 1); + if (n < 1) + { + logmsg(LOG_ERR, "Error reading /proc/device-tree/copyright"); + + close(fd); + return ret; + } + close(fd); + buffer[n] = '\0'; + + logdebug("device-tree copyright node: [%s]\n", buffer); + + if (strstr(buffer, "Apple Computer, Inc.") == NULL) + return ret; + + + ret = MACHINE_MAC_UNKNOWN; + + /* Grab machine identifier string */ + fd = open("/proc/device-tree/model", O_RDONLY); + if (fd < 0) + { + logmsg(LOG_ERR, "Could not open /proc/device-tree/model"); + + return ret; + } + + n = read(fd, buffer, sizeof(buffer) - 1); + if (n < 1) + { + logmsg(LOG_ERR, "Error reading /proc/device-tree/model"); + + close(fd); + return ret; + } + close(fd); + buffer[n] = '\0'; + + logdebug("device-tree model node: [%s]\n", buffer); + + /* PowerBook G4 Titanium 15" (December 2000) */ + if (strncmp(buffer, "PowerBook3,2", 12) == 0) + ret = MACHINE_POWERBOOK_32; + /* PowerBook G4 Titanium 15" (October 2001) */ + else if (strncmp(buffer, "PowerBook3,3", 12) == 0) + ret = MACHINE_POWERBOOK_33; + /* PowerBook G4 Titanium 15" (April 2002) */ + else if (strncmp(buffer, "PowerBook3,4", 12) == 0) + ret = MACHINE_POWERBOOK_34; + /* PowerBook G4 Titanium 15" */ + else if (strncmp(buffer, "PowerBook3,5", 12) == 0) + ret = MACHINE_POWERBOOK_35; + + /* PowerBook G4 Aluminium 17" */ + else if (strncmp(buffer, "PowerBook5,1", 12) == 0) + ret = MACHINE_POWERBOOK_51; + /* PowerBook G4 Aluminium 15" (September 2003) */ + else if (strncmp(buffer, "PowerBook5,2", 12) == 0) + ret = MACHINE_POWERBOOK_52; + /* PowerBook G4 Aluminium 17" (September 2003) */ + else if (strncmp(buffer, "PowerBook5,3", 12) == 0) + ret = MACHINE_POWERBOOK_53; + /* PowerBook G4 Aluminium 15" (April 2004) */ + else if (strncmp(buffer, "PowerBook5,4", 12) == 0) + ret = MACHINE_POWERBOOK_54; + /* PowerBook G4 Aluminium 17" (April 2004) */ + else if (strncmp(buffer, "PowerBook5,5", 12) == 0) + ret = MACHINE_POWERBOOK_55; + /* PowerBook G4 Aluminium 15" (February 2005) */ + else if (strncmp(buffer, "PowerBook5,6", 12) == 0) + ret = MACHINE_POWERBOOK_56; + /* PowerBook G4 Aluminium 17" (February 2005) */ + else if (strncmp(buffer, "PowerBook5,7", 12) == 0) + ret = MACHINE_POWERBOOK_57; + /* PowerBook G4 Aluminium 15" */ + else if (strncmp(buffer, "PowerBook5,8", 12) == 0) + ret = MACHINE_POWERBOOK_58; + /* PowerBook G4 Aluminium 17" */ + else if (strncmp(buffer, "PowerBook5,9", 12) == 0) + ret = MACHINE_POWERBOOK_59; + + /* PowerBook G4 12" (January 2003) */ + else if (strncmp(buffer, "PowerBook6,1", 12) == 0) + ret = MACHINE_POWERBOOK_61; + /* PowerBook G4 12" (September 2003) */ + else if (strncmp(buffer, "PowerBook6,2", 12) == 0) + ret = MACHINE_POWERBOOK_61; + /* iBook G4 (October 2003) */ + else if (strncmp(buffer, "PowerBook6,3", 12) == 0) + ret = MACHINE_POWERBOOK_63; + /* PowerBook G4 12" (April 2004) */ + else if (strncmp(buffer, "PowerBook6,4", 12) == 0) + ret = MACHINE_POWERBOOK_64; + /* iBook G4 (October 2004) */ + else if (strncmp(buffer, "PowerBook6,5", 12) == 0) + ret = MACHINE_POWERBOOK_65; + /* iBook G4 */ + else if (strncmp(buffer, "PowerBook6,7", 12) == 0) + ret = MACHINE_POWERBOOK_67; + /* PowerBook G4 12" */ + else if (strncmp(buffer, "PowerBook6,8", 12) == 0) + ret = MACHINE_POWERBOOK_68; + + else + logmsg(LOG_ERR, "Unknown Apple machine: %s", buffer); + + if (ret != MACHINE_MAC_UNKNOWN) + logmsg(LOG_INFO, "PMU machine check: running on a %s", buffer); + + return ret; +} + +#else + +static machine_type +check_machine_dmi(void) +{ + int ret; + + int fd; + char buf[32]; + int i; + + char *vendor_node[] = + { + "/sys/class/dmi/id/sys_vendor", + "/sys/class/dmi/id/board_vendor", + "/sys/class/dmi/id/chassis_vendor", + "/sys/class/dmi/id/bios_vendor" + }; + + /* Check vendor name */ + for (i = 0; i < sizeof(vendor_node) / sizeof(vendor_node[0]); i++) + { + fd = open(vendor_node[i], O_RDONLY); + if (fd > 0) + break; + + logmsg(LOG_INFO, "Could not open %s: %s", vendor_node[i], strerror(errno)); + } + + if (fd < 0) + { + logmsg(LOG_ERR, "Could not determine vendor name"); + + return MACHINE_ERROR; + } + + memset(buf, 0, sizeof(buf)); + + ret = read(fd, buf, sizeof(buf) - 1); + if (ret < 0) + { + logmsg(LOG_ERR, "Could not read from %s: %s", vendor_node[i], strerror(errno)); + + close(fd); + return MACHINE_ERROR; + } + + close(fd); + + if (buf[ret - 1] == '\n') + buf[ret - 1] = '\0'; + + logdebug("DMI vendor name: [%s]\n", buf); + + if ((strcmp(buf, "Apple Computer, Inc.") != 0) + && (strcmp(buf, "Apple Inc.") != 0)) + return MACHINE_UNKNOWN; + + /* Check product name */ + fd = open("/sys/class/dmi/id/product_name", O_RDONLY); + if (fd < 0) + { + logmsg(LOG_INFO, "Could not open /sys/class/dmi/id/product_name: %s", strerror(errno)); + + return MACHINE_MAC_UNKNOWN; + } + + memset(buf, 0, sizeof(buf)); + + ret = read(fd, buf, sizeof(buf) - 1); + if (ret < 0) + { + logmsg(LOG_ERR, "Could not read from /sys/class/dmi/id/product_name: %s", strerror(errno)); + + close(fd); + return MACHINE_MAC_UNKNOWN; + } + + close(fd); + + if (buf[ret - 1] == '\n') + buf[ret - 1] = '\0'; + + logdebug("DMI product name: [%s]\n", buf); + + ret = MACHINE_MAC_UNKNOWN; + + /* Core Duo MacBook Pro 15" (January 2006) & 17" (April 2006) */ + if ((strcmp(buf, "MacBookPro1,1") == 0) || (strcmp(buf, "MacBookPro1,2") == 0)) + ret = MACHINE_MACBOOKPRO_1; + /* Core2 Duo MacBook Pro 17" & 15" (October 2006) */ + else if ((strcmp(buf, "MacBookPro2,1") == 0) || (strcmp(buf, "MacBookPro2,2") == 0)) + ret = MACHINE_MACBOOKPRO_2; + /* Core2 Duo MacBook Pro 15" & 17" (June 2007) */ + else if (strcmp(buf, "MacBookPro3,1") == 0) + ret = MACHINE_MACBOOKPRO_3; + /* Core2 Duo MacBook Pro 15" & 17" (February 2008) */ + else if (strcmp(buf, "MacBookPro4,1") == 0) + ret = MACHINE_MACBOOKPRO_4; + /* Core2 Duo MacBook Pro 15" & 17" (October 2008) + * MacBook Pro 17" (June 2009) + * MacBook Pro 13" (June 2009) */ + else if ((strcmp(buf, "MacBookPro5,1") == 0) + || (strcmp(buf, "MacBookPro5,2") == 0) + || (strcmp(buf, "MacBookPro5,3") == 0) + || (strcmp(buf, "MacBookPro5,4") == 0) + || (strcmp(buf, "MacBookPro5,5") == 0)) + ret = MACHINE_MACBOOKPRO_5; + /* Core Duo MacBook (May 2006) */ + else if (strcmp(buf, "MacBook1,1") == 0) + ret = MACHINE_MACBOOK_1; + /* Core2 Duo MacBook (November 2006) */ + else if (strcmp(buf, "MacBook2,1") == 0) + ret = MACHINE_MACBOOK_2; + /* Core2 Duo Santa Rosa MacBook (November 2007) */ + else if (strcmp(buf, "MacBook3,1") == 0) + ret = MACHINE_MACBOOK_3; + /* Core2 Duo MacBook (February 2008) */ + else if (strcmp(buf, "MacBook4,1") == 0) + ret = MACHINE_MACBOOK_4; + /* Core2 Duo MacBook (October 2008) (5,2 white MacBook) */ + else if ((strcmp(buf, "MacBook5,1") == 0) || (strcmp(buf, "MacBook5,2") == 0)) + ret = MACHINE_MACBOOK_5; + /* MacBook Air (January 2008) */ + else if (strcmp(buf, "MacBookAir1,1") == 0) + ret = MACHINE_MACBOOKAIR_1; + /* MacBook Air (October 2008) */ + else if (strcmp(buf, "MacBookAir2,1") == 0) + ret = MACHINE_MACBOOKAIR_2; + else + logmsg(LOG_ERR, "Unknown Apple machine: %s", buf); + + if (ret != MACHINE_MAC_UNKNOWN) + logmsg(LOG_INFO, "DMI machine check: running on a %s", buf); + + return ret; +} +#endif /* __powerpc__ */ + + +static void +usage(void) +{ + printf("pommed v" M_VERSION " Apple laptops hotkeys handler\n"); + printf("Copyright (C) 2006-2009 Julien BLACHE \n"); + + printf("Usage:\n"); + printf("\tpommed\t-- start pommed as a daemon\n"); + printf("\tpommed -v\t-- print version and exit\n"); + printf("\tpommed -f\t-- run in the foreground with log messages\n"); + printf("\tpommed -d\t-- run in the foreground with debug messages\n"); +} + + +void +sig_int_term_handler(int signal) +{ + evloop_stop(); +} + +int +main (int argc, char **argv) +{ + int ret; + int c; + + FILE *pidfile; + struct utsname sysinfo; + + machine_type machine; + + while ((c = getopt(argc, argv, "fdv")) != -1) + { + switch (c) + { + case 'f': + console = 1; + break; + + case 'd': + debug = 1; + console = 1; + break; + + case 'v': + printf("pommed v" M_VERSION " Apple laptops hotkeys handler\n"); + printf("Copyright (C) 2006-2009 Julien BLACHE \n"); + + exit(0); + break; + + default: + usage(); + + exit(1); + break; + } + } + + if (geteuid() != 0) + { + logmsg(LOG_ERR, "pommed needs root privileges to operate"); + + exit(1); + } + + if (!console) + { + openlog("pommed", LOG_PID, LOG_DAEMON); + } + + logmsg(LOG_INFO, "pommed v" M_VERSION " Apple laptops hotkeys handler"); + logmsg(LOG_INFO, "Copyright (C) 2006-2009 Julien BLACHE "); + + /* Load our configuration */ + ret = config_load(); + if (ret < 0) + { + exit(1); + } + + /* Identify the machine we're running on */ + machine = check_machine(); + switch (machine) + { + case MACHINE_MAC_UNKNOWN: + logmsg(LOG_ERR, "Unknown Apple machine"); + + exit(1); + break; + + case MACHINE_UNKNOWN: + logmsg(LOG_ERR, "Unknown non-Apple machine"); + + exit(1); + break; + + case MACHINE_ERROR: + exit(1); + break; + + default: + if (machine < MACHINE_LAST) + { +#ifdef __powerpc__ + mops = &pb_mops[machine]; +#else + mops = &mb_mops[machine]; +#endif /* __powerpc__ */ + } + break; + } + + /* Runtime sanity check: catch errors in the mb_mops and pb_mops arrays */ + if (mops->type != machine) + { + logmsg(LOG_ERR, "machine_ops mismatch: expected %d, found %d", machine, mops->type); + + exit(1); + } + + if (debug) + { + ret = uname(&sysinfo); + + if (ret < 0) + logmsg(LOG_ERR, "uname() failed: %s", strerror(errno)); + else + logdebug("System: %s %s %s\n", sysinfo.sysname, sysinfo.release, sysinfo.machine); + } + + ret = evloop_init(); + if (ret < 0) + { + logmsg(LOG_ERR, "Event loop initialization failed"); + exit (1); + } + + ret = mops->lcd_backlight_probe(); + if (ret < 0) + { + logmsg(LOG_ERR, "LCD backlight probe failed, check debug output"); + + exit(1); + } + + ret = evdev_init(); + if (ret < 1) + { + logmsg(LOG_ERR, "No suitable event devices found"); + + exit(1); + } + + kbd_backlight_init(); + + ret = audio_init(); + if (ret < 0) + { + logmsg(LOG_WARNING, "Audio initialization failed, audio support disabled"); + } + + ret = mbpdbus_init(); + if (ret < 0) + { + logmsg(LOG_WARNING, "Could not connect to DBus system bus"); + } + + power_init(); + + if (!console) + { + /* + * Detach from the console + */ + if (daemon(0, 0) != 0) + { + logmsg(LOG_ERR, "daemon() failed: %s", strerror(errno)); + + evdev_cleanup(); + + exit(1); + } + } + + pidfile = fopen(PIDFILE, "w"); + if (pidfile == NULL) + { + logmsg(LOG_WARNING, "Could not open pidfile %s: %s", PIDFILE, strerror(errno)); + + evdev_cleanup(); + + exit(1); + } + fprintf(pidfile, "%d\n", getpid()); + fclose(pidfile); + + /* Spawn the beep thread */ + beep_init(); + + signal(SIGINT, sig_int_term_handler); + signal(SIGTERM, sig_int_term_handler); + + + do + { + ret = evloop_iteration(); + } + while (ret >= 0); + + evdev_cleanup(); + + beep_cleanup(); + + mbpdbus_cleanup(); + + kbd_backlight_cleanup(); + + power_cleanup(); + + evloop_cleanup(); + + config_cleanup(); + + logmsg(LOG_INFO, "Exiting"); + + if (!console) + closelog(); + + unlink(PIDFILE); + + return 0; +} diff --git a/app-laptop/pommed/pommed-1.31/pommed/pommed.h b/app-laptop/pommed/pommed-1.31/pommed/pommed.h new file mode 100644 index 0000000..68c6f31 --- /dev/null +++ b/app-laptop/pommed/pommed-1.31/pommed/pommed.h @@ -0,0 +1,92 @@ +/* + * pommed - pommed.h + */ + +#ifndef __POMMED_H__ +#define __POMMED_H__ + + +#define M_VERSION "1.31" + + +extern int debug; +extern int console; + + +void +logmsg(int level, char *fmt, ...); + +void +logdebug(char *fmt, ...); + + +void +kbd_set_fnmode(void); + + +typedef enum + { + MACHINE_ERROR = -3, + MACHINE_UNKNOWN = -2, + MACHINE_MAC_UNKNOWN = -1, +#ifndef __powerpc__ + MACHINE_MACBOOKPRO_1, + MACHINE_MACBOOKPRO_2, + MACHINE_MACBOOKPRO_3, + MACHINE_MACBOOKPRO_4, + MACHINE_MACBOOKPRO_5, + + MACHINE_MACBOOK_1, + MACHINE_MACBOOK_2, + MACHINE_MACBOOK_3, + MACHINE_MACBOOK_4, + MACHINE_MACBOOK_5, + + MACHINE_MACBOOKAIR_1, + MACHINE_MACBOOKAIR_2, +#else + MACHINE_POWERBOOK_32, + MACHINE_POWERBOOK_33, + MACHINE_POWERBOOK_34, + MACHINE_POWERBOOK_35, + + MACHINE_POWERBOOK_51, + MACHINE_POWERBOOK_52, + MACHINE_POWERBOOK_53, + MACHINE_POWERBOOK_54, + MACHINE_POWERBOOK_55, + MACHINE_POWERBOOK_56, + MACHINE_POWERBOOK_57, + MACHINE_POWERBOOK_58, + MACHINE_POWERBOOK_59, + + MACHINE_POWERBOOK_61, + MACHINE_POWERBOOK_62, + MACHINE_POWERBOOK_63, + MACHINE_POWERBOOK_64, + MACHINE_POWERBOOK_65, + MACHINE_POWERBOOK_67, + MACHINE_POWERBOOK_68, +#endif /* !__powerpc__ */ + MACHINE_LAST + } machine_type; + +struct machine_ops +{ + machine_type type; + int (*lcd_backlight_probe) (void); + void (*lcd_backlight_step) (int dir); + void (*lcd_backlight_toggle) (int lvl); +}; + +extern struct machine_ops *mops; + + +#define PIDFILE "/var/run/pommed.pid" +#define CONFFILE "/etc/pommed.conf" + +#define STEP_UP 1 +#define STEP_DOWN -1 + + +#endif /* !__POMMED_H__ */ diff --git a/app-laptop/pommed/pommed-1.31/pommed/power.c b/app-laptop/pommed/pommed-1.31/pommed/power.c new file mode 100644 index 0000000..8bab752 --- /dev/null +++ b/app-laptop/pommed/pommed-1.31/pommed/power.c @@ -0,0 +1,135 @@ +/* + * pommed - Apple laptops hotkeys handler daemon + * + * Copyright (C) 2006-2008 Julien BLACHE + * + * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; version 2 of the License. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License along + * with this program; if not, write to the Free Software Foundation, Inc., + * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. + */ + +#include +#include +#include +#include +#include + +#include + +#include "pommed.h" +#include "evloop.h" +#include "lcd_backlight.h" +#include "power.h" + + +/* Internal API - legacy procfs interface, ACPI or PMU */ +int +procfs_check_ac_state(void); + + +static int prev_state; +static int power_timer; + + +/* sysfs power_supply class */ +static int +sysfs_check_ac_state(void) +{ + FILE *fp; + char ac_state; + int ret; + + fp = fopen(SYSFS_POWER_AC_STATE, "r"); + if (fp == NULL) + return AC_STATE_ERROR; + + ret = fread(&ac_state, 1, 1, fp); + + if (ferror(fp) != 0) + { + logdebug("power: Error reading sysfs AC state: %s\n", strerror(errno)); + return AC_STATE_ERROR; + } + + fclose(fp); + + if (ac_state == '1') + return AC_STATE_ONLINE; + + if (ac_state == '0') + return AC_STATE_OFFLINE; + + return AC_STATE_UNKNOWN; +} + +static int +check_ac_state(void) +{ + int ret; + + ret = sysfs_check_ac_state(); + if (ret == AC_STATE_ERROR) + return procfs_check_ac_state(); + + return ret; +} + + +static void +power_check_ac_state(int id, uint64_t ticks) +{ + int ac_state; + + ac_state = check_ac_state(); + + if (ac_state == prev_state) + return; + else + prev_state = ac_state; + + switch (ac_state) + { + case AC_STATE_ONLINE: + logdebug("power: switched to AC\n"); + mops->lcd_backlight_toggle(LCD_ON_AC_LEVEL); + break; + + case AC_STATE_OFFLINE: + logdebug("power: switched to battery\n"); + mops->lcd_backlight_toggle(LCD_ON_BATT_LEVEL); + break; + + case AC_STATE_ERROR: + logmsg(LOG_ERR, "power: error reading AC state"); + break; + + case AC_STATE_UNKNOWN: + logmsg(LOG_INFO, "power: unknown AC state"); + break; + } +} + + +void +power_init(void) +{ + prev_state = check_ac_state(); + + power_timer = evloop_add_timer(POWER_TIMEOUT, power_check_ac_state); +} + +void +power_cleanup(void) +{ + if (power_timer > 0) + evloop_remove_timer(power_timer); +} diff --git a/app-laptop/pommed/pommed-1.31/pommed/power.h b/app-laptop/pommed/pommed-1.31/pommed/power.h new file mode 100644 index 0000000..765e10f --- /dev/null +++ b/app-laptop/pommed/pommed-1.31/pommed/power.h @@ -0,0 +1,31 @@ +/* + * pommed - power.h + */ + +#ifndef __POWER_H__ +#define __POWER_H__ + + +#define AC_STATE_ERROR -1 +#define AC_STATE_UNKNOWN -2 + +#define AC_STATE_ONLINE 1 +#define AC_STATE_OFFLINE 0 + +#define POWER_TIMEOUT 200 + +#ifdef __powerpc__ +# define SYSFS_POWER_AC_STATE "/sys/class/power_supply/pmu-ac/online" +#else +# define SYSFS_POWER_AC_STATE "/sys/class/power_supply/ADP1/online" +#endif + + +void +power_init(void); + +void +power_cleanup(void); + +#endif /* !__POWER_H__ */ + diff --git a/app-laptop/pommed/pommed-1.31/pommed/sysfs_backlight.c b/app-laptop/pommed/pommed-1.31/pommed/sysfs_backlight.c new file mode 100644 index 0000000..52d641a --- /dev/null +++ b/app-laptop/pommed/pommed-1.31/pommed/sysfs_backlight.c @@ -0,0 +1,436 @@ +/* + * pommed - Apple laptops hotkeys handler daemon + * + * Copyright (C) 2006-2008 Julien BLACHE + * Copyright (C) 2006 Yves-Alexis Perez + * + * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; version 2 of the License. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License along + * with this program; if not, write to the Free Software Foundation, Inc., + * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. + */ + +#include +#include +#include +#include +#include +#include +#include +#include +#include + +#include "pommed.h" +#include "conffile.h" +#include "lcd_backlight.h" +#include "dbus.h" + + +enum { + SYSFS_DRIVER_NONE, +#ifdef __powerpc__ + SYSFS_DRIVER_ATY128, + SYSFS_DRIVER_RADEON, + SYSFS_DRIVER_NVIDIA, +#else + SYSFS_DRIVER_MBP, + SYSFS_DRIVER_NVIDIA, +#endif +}; + + +/* sysfs backlight driver in use */ +static int bck_driver = SYSFS_DRIVER_NONE; + +/* sysfs actual_brightness node path */ +static char *actual_brightness[] = + { + "/dev/null", +#ifdef __powerpc__ + "/sys/class/backlight/aty128bl0/actual_brightness", + "/sys/class/backlight/radeonbl0/actual_brightness", + "/sys/class/backlight/nvidiabl0/actual_brightness", +#else + "/sys/class/backlight/mbp_backlight/actual_brightness", + "/sys/class/backlight/nvidia_backlight/actual_brightness", +#endif + }; + +/* sysfs brightness node path */ +static char *brightness[] = + { + "/dev/null", +#ifdef __powerpc__ + "/sys/class/backlight/aty128bl0/brightness", + "/sys/class/backlight/radeonbl0/brightness", + "/sys/class/backlight/nvidiabl0/brightness", +#else + "/sys/class/backlight/mbp_backlight/brightness", + "/sys/class/backlight/nvidia_backlight/brightness", +#endif + }; + +/* sysfs max_brightness node path */ +static char *max_brightness[] = + { + "/dev/null", +#ifdef __powerpc__ + "/sys/class/backlight/aty128bl0/max_brightness", + "/sys/class/backlight/radeonbl0/max_brightness", + "/sys/class/backlight/nvidiabl0/max_brightness", +#else + "/sys/class/backlight/mbp_backlight/max_brightness", + "/sys/class/backlight/nvidia_backlight/max_brightness", +#endif + }; + + +struct _lcd_bck_info lcd_bck_info; + + +static int +sysfs_backlight_get(void) +{ + int fd; + int n; + char buffer[8]; + + if (bck_driver == SYSFS_DRIVER_NONE) + return 0; + + fd = open(actual_brightness[bck_driver], O_RDONLY); + if (fd < 0) + { + logmsg(LOG_WARNING, "Could not open sysfs actual_brightness node: %s", strerror(errno)); + + return 0; + } + + memset(buffer, 0, sizeof(buffer)); + n = read(fd, buffer, sizeof(buffer) - 1); + if (n < 1) + { + logmsg(LOG_WARNING, "Could not read sysfs actual_brightness node"); + + close(fd); + return 0; + } + close(fd); + + return atoi(buffer); +} + +static int +sysfs_backlight_get_max(void) +{ + int fd; + int n; + char buffer[8]; + + if (bck_driver == SYSFS_DRIVER_NONE) + return 0; + + fd = open(max_brightness[bck_driver], O_RDONLY); + if (fd < 0) + { + logmsg(LOG_WARNING, "Could not open sysfs max_brightness node: %s", strerror(errno)); + + return 0; + } + + memset(buffer, 0, sizeof(buffer)); + n = read(fd, buffer, sizeof(buffer) - 1); + if (n < 1) + { + logmsg(LOG_WARNING, "Could not read sysfs max_brightness node"); + + close(fd); + return 0; + } + close(fd); + + return atoi(buffer); +} + + +static void +sysfs_backlight_set(int value) +{ + FILE *fp; + + if (bck_driver == SYSFS_DRIVER_NONE) + return; + + fp = fopen(brightness[bck_driver], "a"); + if (fp == NULL) + { + logmsg(LOG_WARNING, "Could not open sysfs brightness node: %s", strerror(errno)); + + return; + } + + fprintf(fp, "%d", value); + + fclose(fp); +} + +void +sysfs_backlight_step(int dir) +{ + int val; + int newval; + + if (bck_driver == SYSFS_DRIVER_NONE) + return; + + val = sysfs_backlight_get(); + + if (dir == STEP_UP) + { + newval = val + lcd_sysfs_cfg.step; + + if (newval > lcd_bck_info.max) + newval = lcd_bck_info.max; + + logdebug("LCD stepping +%d -> %d\n", lcd_sysfs_cfg.step, newval); + } + else if (dir == STEP_DOWN) + { + newval = val - lcd_sysfs_cfg.step; + + if (newval < SYSFS_BACKLIGHT_OFF) + newval = SYSFS_BACKLIGHT_OFF; + + logdebug("LCD stepping -%d -> %d\n", lcd_sysfs_cfg.step, newval); + } + else + return; + + sysfs_backlight_set(newval); + + mbpdbus_send_lcd_backlight(newval, val, LCD_USER); + + lcd_bck_info.level = newval; +} + + +void +sysfs_backlight_toggle(int lvl) +{ + int val; + + if (bck_driver == SYSFS_DRIVER_NONE) + return; + + if (lcd_sysfs_cfg.on_batt == 0) + return; + + val = sysfs_backlight_get(); + if (val != lcd_bck_info.level) + { + mbpdbus_send_lcd_backlight(val, lcd_bck_info.level, LCD_AUTO); + lcd_bck_info.level = val; + } + + if (lcd_bck_info.level == 0) + return; + + switch (lvl) + { + case LCD_ON_AC_LEVEL: + if (lcd_bck_info.level >= lcd_bck_info.ac_lvl) + break; + + logdebug("LCD switching to AC level\n"); + + sysfs_backlight_set(lcd_bck_info.ac_lvl); + + mbpdbus_send_lcd_backlight(lcd_bck_info.ac_lvl, lcd_bck_info.level, LCD_AUTO); + + lcd_bck_info.level = lcd_bck_info.ac_lvl; + break; + + case LCD_ON_BATT_LEVEL: + if (lcd_bck_info.level <= lcd_sysfs_cfg.on_batt) + break; + + logdebug("LCD switching to battery level\n"); + + lcd_bck_info.ac_lvl = lcd_bck_info.level; + + sysfs_backlight_set(lcd_sysfs_cfg.on_batt); + + mbpdbus_send_lcd_backlight(lcd_sysfs_cfg.on_batt, lcd_bck_info.level, LCD_AUTO); + + lcd_bck_info.level = lcd_sysfs_cfg.on_batt; + break; + } +} + + +#ifdef __powerpc__ +/* When brightness keys are handled by the kernel itself, + * we're only updating our internal buffers + */ +void +sysfs_backlight_step_kernel(int dir) +{ + int val; + + val = sysfs_backlight_get(); + + logdebug("LCD stepping: %d -> %d\n", lcd_bck_info.level, val); + + mbpdbus_send_lcd_backlight(val, lcd_bck_info.level, LCD_USER); + + lcd_bck_info.level = val; +} + +void +sysfs_backlight_toggle_kernel(int lvl) +{ + return; +} +#endif /* __powerpc__ */ + + +/* We can't fix the config until we know the max backlight value, + * so, here, fix_config() is static and called at probe time + */ +static void +sysfs_backlight_fix_config(void) +{ + if (lcd_sysfs_cfg.init < 0) + lcd_sysfs_cfg.init = -1; + + if (lcd_sysfs_cfg.init > lcd_bck_info.max) + lcd_sysfs_cfg.init = lcd_bck_info.max; + + if (lcd_sysfs_cfg.step < 1) + lcd_sysfs_cfg.step = 1; + + if (lcd_sysfs_cfg.step > (lcd_bck_info.max / 2)) + lcd_sysfs_cfg.step = lcd_bck_info.max / 2; + + if ((lcd_sysfs_cfg.on_batt > lcd_bck_info.max) + || (lcd_sysfs_cfg.on_batt < SYSFS_BACKLIGHT_OFF)) + lcd_sysfs_cfg.on_batt = 0; +} + + +/* Look for the backlight driver */ +static int +sysfs_backlight_probe(int driver) +{ + if (access(brightness[driver], W_OK) != 0) + { + logdebug("Failed to access brightness node: %s\n", strerror(errno)); + return -1; + } + + if (access(actual_brightness[driver], R_OK) != 0) + { + logdebug("Failed to access actual_brightness node: %s\n", strerror(errno)); + return -1; + } + + if (access(max_brightness[driver], R_OK) != 0) + { + logdebug("Failed to access max_brightness node: %s\n", strerror(errno)); + return -1; + } + + bck_driver = driver; + + lcd_bck_info.max = sysfs_backlight_get_max(); + + /* Now we can fix the config */ + sysfs_backlight_fix_config(); + + /* + * Set the initial backlight level + * The value has been sanity checked already + */ + if (lcd_sysfs_cfg.init > -1) + { + sysfs_backlight_set(lcd_sysfs_cfg.init); + } + + lcd_bck_info.level = sysfs_backlight_get(); + lcd_bck_info.ac_lvl = lcd_bck_info.level; + + return 0; +} + + +#ifdef __powerpc__ +int +aty128_sysfs_backlight_probe(void) +{ + return sysfs_backlight_probe(SYSFS_DRIVER_ATY128); +} + +int +r9x00_sysfs_backlight_probe(void) +{ + return sysfs_backlight_probe(SYSFS_DRIVER_RADEON); +} + +int +nvidia_sysfs_backlight_probe(void) +{ + return sysfs_backlight_probe(SYSFS_DRIVER_NVIDIA); +} + +#else + +int +mbp_sysfs_backlight_probe(void) +{ + int ret; + + ret = sysfs_backlight_probe(SYSFS_DRIVER_MBP); + + if (ret == 0) + return 0; + + ret = sysfs_backlight_probe(SYSFS_DRIVER_NVIDIA); + + if (ret == 0) + return 0; + + /* Probe failed, wire up native driver instead */ + switch (mops->type) + { + case MACHINE_MACBOOKPRO_3: + case MACHINE_MACBOOKPRO_4: + case MACHINE_MACBOOKPRO_5: + case MACHINE_MACBOOK_5: + case MACHINE_MACBOOKAIR_2: + logmsg(LOG_INFO, "sysfs backlight probe failed, falling back to nv8600mgt"); + + ret = nv8600mgt_backlight_probe(); + if (ret == 0) + { + /* Wire up fallback native driver */ + mops->lcd_backlight_step = nv8600mgt_backlight_step; + mops->lcd_backlight_toggle = nv8600mgt_backlight_toggle; + } + return ret; + + default: + logmsg(LOG_ERR, "sysfs backlight probe failed, no fallback for this machine"); + return -1; + } + + return -1; +} +#endif diff --git a/app-laptop/pommed/pommed-1.31/pommed/timerfd-syscalls.h b/app-laptop/pommed/pommed-1.31/pommed/timerfd-syscalls.h new file mode 100644 index 0000000..71c04a3 --- /dev/null +++ b/app-laptop/pommed/pommed-1.31/pommed/timerfd-syscalls.h @@ -0,0 +1,47 @@ +/* + * timerfd syscall numbers and definitions + */ + +#ifndef _LINUX_TIMERFD_SYSCALLS_H_ +#define _LINUX_TIMERFD_SYSCALLS_H_ + +#ifndef __NR_timerfd_create +# if defined(__x86_64__) +# define __NR_timerfd_create 283 +# define __NR_timerfd_settime 286 +# define __NR_timerfd_gettime 287 +# elif defined(__i386__) +# define __NR_timerfd_create 322 +# define __NR_timerfd_settime 325 +# define __NR_timerfd_gettime 326 +# elif defined(__powerpc__) +# define __NR_timerfd_create 306 +# define __NR_timerfd_settime 311 +# define __NR_timerfd_gettime 312 +# else +# error Unsupported architecture +# endif +#endif + +/* Defined in include/linux/timerfd.h */ +#define TFD_TIMER_ABSTIME (1 << 0) + +static inline int +timerfd_create(int clockid, int flags) +{ + return syscall(__NR_timerfd_create, clockid, flags); +} + +static inline int +timerfd_settime(int fd, int flags, const struct itimerspec *new_value, struct itimerspec *curr_value) +{ + return syscall(__NR_timerfd_settime, fd, flags, new_value, curr_value); +} + +static inline int +timerfd_gettime(int fd, struct itimerspec *curr_value) +{ + return syscall(__NR_timerfd_gettime, fd, curr_value); +} + +#endif /* _LINUX_TIMERFD_SYSCALLS_H_ */ diff --git a/app-laptop/pommed/pommed-1.31/pommed/video.c b/app-laptop/pommed/pommed-1.31/pommed/video.c new file mode 100644 index 0000000..0d256f0 --- /dev/null +++ b/app-laptop/pommed/pommed-1.31/pommed/video.c @@ -0,0 +1,88 @@ +/* + * pommed - Apple laptops hotkeys handler daemon + * + * Copyright (C) 2007, 2009 Julien BLACHE + * + * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; version 2 of the License. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License along + * with this program; if not, write to the Free Software Foundation, Inc., + * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. + */ + +#include + +#include +#include +#include +#include +#include +#include +#include + +#include + +#include + +#include + +#include "pommed.h" +#include "dbus.h" +#include "video.h" + + +void +video_switch(void) +{ + mbpdbus_send_video_switch(); +} + +int +video_vt_active(int vt) +{ + int fd; + char buf[16]; + struct vt_stat vtstat; + + int ret; + + ret = snprintf(buf, sizeof(buf), "/dev/tty%d", vt); + if ((ret < 0) || (ret >= sizeof(buf))) + return 1; + + /* Try to open the VT the client's X session is running on */ + fd = open(buf, O_RDWR); + + if ((fd < 0) && (errno == EACCES)) + fd = open(buf, O_RDONLY); + + if ((fd < 0) && (errno == EACCES)) + fd = open(buf, O_WRONLY); + + /* Can't open the VT, this shouldn't happen; maybe X is remote? */ + if (fd < 0) + return 0; + + /* The VT isn't a tty, WTF?! */ + if (!isatty(fd)) + { + close(fd); + return 0; + } + + /* Get VT state, includes currently-active VT number */ + ret = ioctl(fd, VT_GETSTATE, &vtstat); + close(fd); + + if (ret < 0) + return 1; + + return (vt == vtstat.v_active); +} diff --git a/app-laptop/pommed/pommed-1.31/pommed/video.h b/app-laptop/pommed/pommed-1.31/pommed/video.h new file mode 100644 index 0000000..f711fc2 --- /dev/null +++ b/app-laptop/pommed/pommed-1.31/pommed/video.h @@ -0,0 +1,17 @@ +/* + * pommed - video.h + */ + +#ifndef __VIDEO_H__ +#define __VIDEO_H__ + + +void +video_switch(void); + +int +video_vt_active(int vt); + + +#endif /* !__VIDEO_H__ */ + diff --git a/app-laptop/pommed/pommed-1.31/wmpomme/.gitignore b/app-laptop/pommed/pommed-1.31/wmpomme/.gitignore new file mode 100644 index 0000000..d47029d --- /dev/null +++ b/app-laptop/pommed/pommed-1.31/wmpomme/.gitignore @@ -0,0 +1,2 @@ +wmpomme + diff --git a/app-laptop/pommed/pommed-1.31/wmpomme/Makefile b/app-laptop/pommed/pommed-1.31/wmpomme/Makefile new file mode 100644 index 0000000..4139cc0 --- /dev/null +++ b/app-laptop/pommed/pommed-1.31/wmpomme/Makefile @@ -0,0 +1,29 @@ +CC = gcc + +DBUS_CFLAGS = $(shell pkg-config dbus-1 --cflags) -DDBUS_API_SUBJECT_TO_CHANGE +DBUS_LIBS = $(shell pkg-config dbus-1 --libs) + +TIMERFD_CFLAGS = $(shell test -e /usr/include/sys/timerfd.h || echo -DNO_SYS_TIMERFD_H) + +CFLAGS = -g -O2 -Wall $(DBUS_CFLAGS) $(TIMERFD_CFLAGS) +LDFLAGS = -lrt -lXpm -lXext -lX11 $(DBUS_LIBS) + +SOURCES = wmgeneral.c wmpomme.c \ + ../client-common/dbus-client.c \ + ../client-common/video-client.c + +OBJS = $(SOURCES:%.c=%.o) + +wmpomme: $(OBJS) + +wmpomme.o: wmpomme.c wmgeneral.h wmpomme-master.xpm ../client-common/dbus-client.h + +wmgeneral.o: wmgeneral.c wmgeneral.h + +../client-common/dbus-client.o: ../client-common/dbus-client.c ../client-common/dbus-client.h + +../client-common/dbus-video.o: ../client-common/video-client.c ../client-common/video-client.h + +clean: + rm -f wmpomme $(OBJS) + rm -f *~ ../client-common/*~ diff --git a/app-laptop/pommed/pommed-1.31/wmpomme/timerfd-syscalls.h b/app-laptop/pommed/pommed-1.31/wmpomme/timerfd-syscalls.h new file mode 100644 index 0000000..71c04a3 --- /dev/null +++ b/app-laptop/pommed/pommed-1.31/wmpomme/timerfd-syscalls.h @@ -0,0 +1,47 @@ +/* + * timerfd syscall numbers and definitions + */ + +#ifndef _LINUX_TIMERFD_SYSCALLS_H_ +#define _LINUX_TIMERFD_SYSCALLS_H_ + +#ifndef __NR_timerfd_create +# if defined(__x86_64__) +# define __NR_timerfd_create 283 +# define __NR_timerfd_settime 286 +# define __NR_timerfd_gettime 287 +# elif defined(__i386__) +# define __NR_timerfd_create 322 +# define __NR_timerfd_settime 325 +# define __NR_timerfd_gettime 326 +# elif defined(__powerpc__) +# define __NR_timerfd_create 306 +# define __NR_timerfd_settime 311 +# define __NR_timerfd_gettime 312 +# else +# error Unsupported architecture +# endif +#endif + +/* Defined in include/linux/timerfd.h */ +#define TFD_TIMER_ABSTIME (1 << 0) + +static inline int +timerfd_create(int clockid, int flags) +{ + return syscall(__NR_timerfd_create, clockid, flags); +} + +static inline int +timerfd_settime(int fd, int flags, const struct itimerspec *new_value, struct itimerspec *curr_value) +{ + return syscall(__NR_timerfd_settime, fd, flags, new_value, curr_value); +} + +static inline int +timerfd_gettime(int fd, struct itimerspec *curr_value) +{ + return syscall(__NR_timerfd_gettime, fd, curr_value); +} + +#endif /* _LINUX_TIMERFD_SYSCALLS_H_ */ diff --git a/app-laptop/pommed/pommed-1.31/wmpomme/wmgeneral.c b/app-laptop/pommed/pommed-1.31/wmpomme/wmgeneral.c new file mode 100644 index 0000000..18d276e --- /dev/null +++ b/app-laptop/pommed/pommed-1.31/wmpomme/wmgeneral.c @@ -0,0 +1,490 @@ +/* + * $Log: wmgeneral.c,v $ + * Revision 1.1 1999/08/15 15:38:38 carsten + * Added wmwave project to repository + * + * Revision 1.3 1999/07/19 21:31:46 dan + * Added -c option + * + * Revision 1.2 1999/06/16 01:29:24 dan + * Changed the logs to include changes made by me + * + Best viewed with vim5, using ts=4 + + wmgeneral was taken from wmppp. + + It has a lot of routines which most of the wm* programs use. + + ------------------------------------------------------------ + + Author: Martijn Pieterse (pieterse@xs4all.nl) + + --- + CHANGES: + --- + 14/09/1998 (Dave Clark, clarkd@skyia.com) + * Updated createXBMfromXPM routine + * Now supports >256 colors + 11/09/1998 (Martijn Pieterse, pieterse@xs4all.nl) + * Removed a bug from parse_rcfile. You could + not use "start" in a command if a label was + also start. + * Changed the needed geometry string. + We don't use window size, and don't support + negative positions. + 03/09/1998 (Martijn Pieterse, pieterse@xs4all.nl) + * Added parse_rcfile2 + 02/09/1998 (Martijn Pieterse, pieterse@xs4all.nl) + * Added -geometry support (untested) + 28/08/1998 (Martijn Pieterse, pieterse@xs4all.nl) + * Added createXBMfromXPM routine + * Saves a lot of work with changing xpm's. + 02/05/1998 (Martijn Pieterse, pieterse@xs4all.nl) + * changed the read_rc_file to parse_rcfile, as suggested by Marcelo E. Magallon + * debugged the parse_rc file. + 30/04/1998 (Martijn Pieterse, pieterse@xs4all.nl) + * Ripped similar code from all the wm* programs, + and put them in a single file. + +*/ + +#include +#include +#include +#include +#include +#include + +#include +#include +#include + +#include "wmgeneral.h" + +/*****************/ +/* X11 Variables */ +/*****************/ + +Display *display; +Window Root; +int screen; +int x_fd; +int d_depth; +XSizeHints mysizehints; +XWMHints mywmhints; +Pixel back_pix, fore_pix; +char *Geometry = ""; +Window iconwin, win; +GC NormalGC; +XpmIcon wmgen; +Pixmap pixmask; + +/*****************/ +/* Mouse Regions */ +/*****************/ + +typedef struct { + int enable; + int top; + int bottom; + int left; + int right; +} MOUSE_REGION; + +MOUSE_REGION mouse_region[MAX_MOUSE_REGION]; + +/***********************/ +/* Function Prototypes */ +/***********************/ + +static void GetXPM(XpmIcon *, char **); +static Pixel GetColor(char *); +void RedrawWindow(void); +void AddMouseRegion(int, int, int, int, int); +int CheckMouseRegion(int, int); + +/*******************************************************************************\ +|* parse_rcfile +\*******************************************************************************/ + +void parse_rcfile(const char *filename, rckeys *keys) { + + char *p,*q; + char temp[128]; + char *tokens = " :\t\n"; + FILE *fp; + int i,key; + + fp = fopen(filename, "r"); + if (fp) { + while (fgets(temp, 128, fp)) { + key = 0; + q = strdup(temp); + q = strtok(q, tokens); + while (key >= 0 && keys[key].label) { + if ((!strcmp(q, keys[key].label))) { + p = strstr(temp, keys[key].label); + p += strlen(keys[key].label); + p += strspn(p, tokens); + if ((i = strcspn(p, "#\n"))) p[i] = 0; + free(*keys[key].var); + *keys[key].var = strdup(p); + key = -1; + } else key++; + } + free(q); + } + fclose(fp); + } +} + +/*******************************************************************************\ +|* parse_rcfile2 +\*******************************************************************************/ + +void parse_rcfile2(const char *filename, rckeys2 *keys) { + + char *p; + char temp[128]; + char *tokens = " :\t\n"; + FILE *fp; + int i,key; + char *family = NULL; + + fp = fopen(filename, "r"); + if (fp) { + while (fgets(temp, 128, fp)) { + key = 0; + while (key >= 0 && keys[key].label) { + if ((p = strstr(temp, keys[key].label))) { + p += strlen(keys[key].label); + p += strspn(p, tokens); + if ((i = strcspn(p, "#\n"))) p[i] = 0; + free(*keys[key].var); + *keys[key].var = strdup(p); + key = -1; + } else key++; + } + } + fclose(fp); + } + free(family); +} + + +/*******************************************************************************\ +|* GetXPM +\*******************************************************************************/ + +static void GetXPM(XpmIcon *wmgen, char *pixmap_bytes[]) { + + XWindowAttributes attributes; + int err; + + /* For the colormap */ + XGetWindowAttributes(display, Root, &attributes); + + wmgen->attributes.valuemask |= (XpmReturnPixels | XpmReturnExtensions); + + err = XpmCreatePixmapFromData(display, Root, pixmap_bytes, &(wmgen->pixmap), + &(wmgen->mask), &(wmgen->attributes)); + + if (err != XpmSuccess) { + fprintf(stderr, "Not enough free colorcells.\n"); + exit(1); + } +} + +/*******************************************************************************\ +|* GetColor +\*******************************************************************************/ + +static Pixel GetColor(char *name) { + + XColor color; + XWindowAttributes attributes; + + XGetWindowAttributes(display, Root, &attributes); + + color.pixel = 0; + if (!XParseColor(display, attributes.colormap, name, &color)) { + fprintf(stderr, "wm.app: can't parse %s.\n", name); + } else if (!XAllocColor(display, attributes.colormap, &color)) { + fprintf(stderr, "wm.app: can't allocate %s.\n", name); + } + return color.pixel; +} + +/*******************************************************************************\ +|* flush_expose +\*******************************************************************************/ + +static int flush_expose(Window w) { + + XEvent dummy; + int i=0; + + while (XCheckTypedWindowEvent(display, w, Expose, &dummy)) + i++; + + return i; +} + +/*******************************************************************************\ +|* RedrawWindow +\*******************************************************************************/ + +void RedrawWindow(void) { + + flush_expose(iconwin); + XCopyArea(display, wmgen.pixmap, iconwin, NormalGC, + 0,0, wmgen.attributes.width, wmgen.attributes.height, 0,0); + flush_expose(win); + XCopyArea(display, wmgen.pixmap, win, NormalGC, + 0,0, wmgen.attributes.width, wmgen.attributes.height, 0,0); +} + +/*******************************************************************************\ +|* RedrawWindowXY +\*******************************************************************************/ + +void RedrawWindowXY(int x, int y) { + + flush_expose(iconwin); + XCopyArea(display, wmgen.pixmap, iconwin, NormalGC, + x,y, wmgen.attributes.width, wmgen.attributes.height, 0,0); + flush_expose(win); + XCopyArea(display, wmgen.pixmap, win, NormalGC, + x,y, wmgen.attributes.width, wmgen.attributes.height, 0,0); +} + +/*******************************************************************************\ +|* AddMouseRegion +\*******************************************************************************/ + +void AddMouseRegion(int index, int left, int top, int right, int bottom) { + + if (index < MAX_MOUSE_REGION) { + mouse_region[index].enable = 1; + mouse_region[index].top = top; + mouse_region[index].left = left; + mouse_region[index].bottom = bottom; + mouse_region[index].right = right; + } +} + +/*******************************************************************************\ +|* CheckMouseRegion +\*******************************************************************************/ + +int CheckMouseRegion(int x, int y) { + + int i; + int found; + + found = 0; + + for (i=0; i= mouse_region[i].left && + y <= mouse_region[i].bottom && + y >= mouse_region[i].top) + found = 1; + } + if (!found) return -1; + return (i-1); +} + +/*******************************************************************************\ +|* createXBMfromXPM +\*******************************************************************************/ +void createXBMfromXPM(char *xbm, char **xpm, int sx, int sy) { + + int i,j,k; + int width, height, numcol, depth; + int zero=0; + unsigned char bwrite; + int bcount; + int curpixel; + + sscanf(*xpm, "%d %d %d %d", &width, &height, &numcol, &depth); + + + for (k=0; k!=depth; k++) { + zero <<=8; + zero |= xpm[1][k]; + } + + for (i=numcol+1; i < numcol+sy+1; i++) { + bcount = 0; + bwrite = 0; + for (j=0; j>= 1; + + curpixel=0; + for (k=0; k!=depth; k++) { + curpixel <<=8; + curpixel |= xpm[i][j+k]; + } + + if ( curpixel != zero ) { + bwrite += 128; + } + bcount++; + if (bcount == 8) { + *xbm = bwrite; + xbm++; + bcount = 0; + bwrite = 0; + } + } + } +} + +/*******************************************************************************\ +|* copyXPMArea *| +\*******************************************************************************/ + +void copyXPMArea(int x, int y, int sx, int sy, int dx, int dy) { + + XCopyArea(display, wmgen.pixmap, wmgen.pixmap, NormalGC, x, y, sx, sy, dx, dy); + +} + +/*******************************************************************************\ +|* copyXBMArea *| +\*******************************************************************************/ + +void copyXBMArea(int x, int y, int sx, int sy, int dx, int dy) { + + XCopyArea(display, wmgen.mask, wmgen.pixmap, NormalGC, x, y, sx, sy, dx, dy); +} + + +/*******************************************************************************\ +|* setMaskXY *| +\*******************************************************************************/ + +void setMaskXY(int x, int y) { + + XShapeCombineMask(display, win, ShapeBounding, x, y, pixmask, ShapeSet); + XShapeCombineMask(display, iconwin, ShapeBounding, x, y, pixmask, ShapeSet); +} + +/*******************************************************************************\ +|* openXwindow *| +\*******************************************************************************/ +void openXwindow(int argc, char *argv[], char *pixmap_bytes[], char *pixmask_bits, int pixmask_width, int pixmask_height) { + + unsigned int borderwidth = 1; + XClassHint classHint; + char *display_name = NULL; + char *wname = argv[0]; + XTextProperty name; + + XGCValues gcv; + unsigned long gcm; + + char *geometry = NULL; + + int dummy=0; + int i, wx, wy; + + for (i=1; argv[i]; i++) { + if (!strcmp(argv[i], "-display")) { + display_name = argv[i+1]; + i++; + } + if (!strcmp(argv[i], "-geometry")) { + geometry = argv[i+1]; + i++; + } + } + + if (!(display = XOpenDisplay(display_name))) { + fprintf(stderr, "%s: can't open display %s\n", + wname, XDisplayName(display_name)); + exit(1); + } + screen = DefaultScreen(display); + Root = RootWindow(display, screen); + d_depth = DefaultDepth(display, screen); + x_fd = XConnectionNumber(display); + + /* Convert XPM to XImage */ + GetXPM(&wmgen, pixmap_bytes); + + /* Create a window to hold the stuff */ + mysizehints.flags = USSize | USPosition; + mysizehints.x = 0; + mysizehints.y = 0; + + back_pix = GetColor("white"); + fore_pix = GetColor("black"); + + XWMGeometry(display, screen, Geometry, NULL, borderwidth, &mysizehints, + &mysizehints.x, &mysizehints.y,&mysizehints.width,&mysizehints.height, &dummy); + + mysizehints.width = 64; + mysizehints.height = 64; + + win = XCreateSimpleWindow(display, Root, mysizehints.x, mysizehints.y, + mysizehints.width, mysizehints.height, borderwidth, fore_pix, back_pix); + + iconwin = XCreateSimpleWindow(display, win, mysizehints.x, mysizehints.y, + mysizehints.width, mysizehints.height, borderwidth, fore_pix, back_pix); + + /* Activate hints */ + XSetWMNormalHints(display, win, &mysizehints); + classHint.res_name = wname; + classHint.res_class = wname; + XSetClassHint(display, win, &classHint); + + XSelectInput(display, win, ButtonPressMask | ExposureMask | ButtonReleaseMask | PointerMotionMask | StructureNotifyMask); + XSelectInput(display, iconwin, ButtonPressMask | ExposureMask | ButtonReleaseMask | PointerMotionMask | StructureNotifyMask); + + if (XStringListToTextProperty(&wname, 1, &name) == 0) { + fprintf(stderr, "%s: can't allocate window name\n", wname); + exit(1); + } + + XSetWMName(display, win, &name); + + /* Create GC for drawing */ + + gcm = GCForeground | GCBackground | GCGraphicsExposures; + gcv.foreground = fore_pix; + gcv.background = back_pix; + gcv.graphics_exposures = 0; + NormalGC = XCreateGC(display, Root, gcm, &gcv); + + /* ONLYSHAPE ON */ + + pixmask = XCreateBitmapFromData(display, win, pixmask_bits, pixmask_width, pixmask_height); + + XShapeCombineMask(display, win, ShapeBounding, 0, 0, pixmask, ShapeSet); + XShapeCombineMask(display, iconwin, ShapeBounding, 0, 0, pixmask, ShapeSet); + + /* ONLYSHAPE OFF */ + + mywmhints.initial_state = WithdrawnState; + mywmhints.icon_window = iconwin; + mywmhints.icon_x = mysizehints.x; + mywmhints.icon_y = mysizehints.y; + mywmhints.window_group = win; + mywmhints.flags = StateHint | IconWindowHint | IconPositionHint | WindowGroupHint; + + XSetWMHints(display, win, &mywmhints); + + XSetCommand(display, win, argv, argc); + XMapWindow(display, win); + + if (geometry) { + if (sscanf(geometry, "+%d+%d", &wx, &wy) != 2) { + fprintf(stderr, "Bad geometry string.\n"); + exit(1); + } + XMoveWindow(display, win, wx, wy); + } +} diff --git a/app-laptop/pommed/pommed-1.31/wmpomme/wmgeneral.h b/app-laptop/pommed/pommed-1.31/wmpomme/wmgeneral.h new file mode 100644 index 0000000..9bf30d0 --- /dev/null +++ b/app-laptop/pommed/pommed-1.31/wmpomme/wmgeneral.h @@ -0,0 +1,60 @@ +#ifndef WMGENERAL_H_INCLUDED +#define WMGENERAL_H_INCLUDED + + /***********/ + /* Defines */ +/***********/ + +#define MAX_MOUSE_REGION (16) + + /************/ + /* Typedefs */ +/************/ + +typedef struct _rckeys rckeys; + +struct _rckeys { + const char *label; + char **var; +}; + +typedef struct _rckeys2 rckeys2; + +struct _rckeys2 { + const char *family; + const char *label; + char **var; +}; + +typedef struct { + Pixmap pixmap; + Pixmap mask; + XpmAttributes attributes; +} XpmIcon; + + /*******************/ + /* Global variable */ +/*******************/ + +extern Display *display; +extern int x_fd; + + /***********************/ + /* Function Prototypes */ +/***********************/ + +void AddMouseRegion(int index, int left, int top, int right, int bottom); +int CheckMouseRegion(int x, int y); + +void openXwindow(int argc, char *argv[], char **, char *, int, int); +void RedrawWindow(void); +void RedrawWindowXY(int x, int y); + +void createXBMfromXPM(char *, char **, int, int); +void copyXPMArea(int, int, int, int, int, int); +void copyXBMArea(int, int, int, int, int, int); +void setMaskXY(int, int); + +void parse_rcfile(const char *, rckeys *); + +#endif diff --git a/app-laptop/pommed/pommed-1.31/wmpomme/wmpomme-master.xpm b/app-laptop/pommed/pommed-1.31/wmpomme/wmpomme-master.xpm new file mode 100644 index 0000000..1a07975 --- /dev/null +++ b/app-laptop/pommed/pommed-1.31/wmpomme/wmpomme-master.xpm @@ -0,0 +1,212 @@ +/* XPM */ +static char * wmmbp_master_xpm[] = { +"240 100 109 2", +". c #0000FF", +" c None", +"+ c #202020", +"@ c #000000", +"# c #C7C5C8", +"$ c #004941", +"% c #20B2AE", +"& c #107D79", +"* c #188A86", +"= c #B60317", +"- c #B91216", +"; c #BE2813", +"> c #C33D11", +", c #C8530F", +"' c #CD680C", +") c #D27D0A", +"! c #D79308", +"~ c #DCA805", +"{ c #E1BE03", +"] c #E7DC00", +"^ c #D2DD00", +"/ c #BDDE00", +"( c #A8E000", +"_ c #93E100", +": c #7EE200", +"< c #69E400", +"[ c #7EE100", +"} c #7DE200", +"| c #7CE200", +"1 c #7BE200", +"2 c #7AE200", +"3 c #79E200", +"4 c #78E200", +"5 c #77E200", +"6 c #76E200", +"7 c #75E200", +"8 c #74E200", +"9 c #73E200", +"0 c #72E300", +"a c #71E300", +"b c #70E300", +"c c #6FE300", +"d c #6EE300", +"e c #6DE300", +"f c #6CE300", +"g c #6BE300", +"h c #6AE300", +"i c #69E300", +"j c #68E400", +"k c #00EA00", +"l c #B91516", +"m c #BE2A13", +"n c #C33F11", +"o c #C8550E", +"p c #CD6A0C", +"q c #D2800A", +"r c #D79507", +"s c #DCAA05", +"t c #E1C003", +"u c #BA1715", +"v c #BF2C13", +"w c #C44211", +"x c #C9570E", +"y c #CE6C0C", +"z c #D38209", +"A c #D89707", +"B c #DDAC05", +"C c #E2C202", +"D c #BA1915", +"E c #BF2E13", +"F c #C44410", +"G c #C9590E", +"H c #CE6E0C", +"I c #D38409", +"J c #D89907", +"K c #DDAF04", +"L c #E2C402", +"M c #B60617", +"N c #BB1B15", +"O c #C03013", +"P c #C54610", +"Q c #CA5B0E", +"R c #CF710B", +"S c #D48609", +"T c #D99B07", +"U c #DEB104", +"V c #E3C602", +"W c #B60817", +"X c #BB1D15", +"Y c #C03312", +"Z c #C54810", +"` c #CA5D0E", +" . c #CF730B", +".. c #D48809", +"+. c #D99D06", +"@. c #DEB304", +"#. c #E3C802", +"$. c #B71612", +"%. c #7CE100", +"&. c #007D71", +"*. c #B60418", +"=. c #E8DC00", +"-. c #00EB00", +";. c #283C38", +">. c #F7F3FF", +",. c #C7C3C7", +"'. c #494949", +"). c #7A7A7A", +"!. c #BCBCBC", +". . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . + . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . ", +". . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . + . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . ", +". . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . + . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . ", +". . @ @ @ @ @ @ @ @ @ @ @ @ @ @ @ @ @ @ @ @ @ @ @ @ @ @ @ @ @ @ @ @ @ @ @ @ @ @ @ @ @ @ @ @ @ @ . . @ @ @ @ @ @ @ @ @ @ @ . . . + . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . ", +". . @ @ @ @ @ @ @ @ @ @ @ @ @ @ @ @ @ @ @ @ @ @ @ @ @ @ @ @ @ @ @ @ @ @ @ @ @ @ @ @ @ @ @ @ @ # . . @ @ @ @ @ @ @ @ @ @ # . . . + . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . ", +". . @ @ @ @ @ @ @ @ @ @ @ @ @ @ @ @ @ @ @ @ @ @ @ @ @ @ @ @ @ @ @ @ @ @ @ @ @ @ @ @ @ @ @ @ @ # . . @ @ @ @ @ @ @ @ @ @ # . . . + . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . ", +". . @ @ @ @ @ @ @ @ @ @ @ @ @ @ @ @ @ @ @ @ @ @ @ @ @ @ @ @ @ @ @ @ @ @ @ @ @ @ @ @ @ @ @ @ @ # . . @ @ @ @ @ @ @ @ @ @ # . . . + . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . ", +". . @ @ @ @ @ @ @ @ @ @ @ @ @ @ @ @ @ @ @ @ @ @ @ @ @ @ @ @ @ @ @ @ @ @ @ @ @ @ @ @ @ @ @ @ @ # . . @ @ @ @ @ @ @ @ @ @ # . . . + . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . ", +". . @ @ @ @ @ @ @ @ @ @ @ @ @ @ @ @ @ @ @ @ @ @ @ @ @ @ @ @ @ @ @ @ @ @ @ @ @ @ @ @ @ @ @ @ @ # . . @ @ @ @ @ @ @ @ @ @ # . . . + . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . ", +". . @ @ @ @ @ @ @ @ @ @ @ @ @ @ @ @ @ @ @ @ @ @ @ @ @ @ @ @ @ @ @ @ @ @ @ @ @ @ @ @ @ @ @ @ @ # . . @ @ @ @ @ @ @ @ @ @ # . . . + . + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . ", +". . @ @ @ @ @ @ @ @ @ @ @ @ @ @ @ @ @ @ @ @ @ @ @ @ @ @ @ @ @ @ @ @ @ @ @ @ @ @ @ @ @ @ @ @ @ # . . @ @ @ @ @ @ @ @ @ @ # . . . + . + + $ $ $ $ + + + $ $ $ $ + + + + + + + $ $ $ $ + + + $ $ $ $ + + + + + + + $ $ $ $ + + + $ $ $ $ + + . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . ", +". . @ @ @ @ @ @ @ @ @ @ @ @ @ @ @ @ @ @ @ @ @ @ @ @ @ @ @ @ @ @ @ @ @ @ @ @ @ @ @ @ @ @ @ @ @ # . . @ @ @ @ @ @ @ @ @ @ # . . . + . + $ + + + + $ + $ + + + + $ + + $ + + $ + + + + $ + $ + + + + $ + + $ + + $ + + + + $ + $ + + + + $ + . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . ", +". . @ @ @ @ @ @ @ @ @ @ @ @ @ @ @ @ @ @ @ @ @ @ @ @ @ @ @ @ @ @ @ @ @ @ @ @ @ @ @ @ @ @ @ @ @ # . . @ @ @ @ @ @ @ @ @ @ # . . . + . + $ + + + + $ + $ + + + + $ + + $ + + $ + + + + $ + $ + + + + $ + + $ + + $ + + + + $ + $ + + + + $ + . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . ", +". . @ @ @ @ @ @ @ @ @ @ @ @ @ @ @ @ @ @ @ @ @ @ @ @ @ @ @ @ @ @ @ @ @ @ @ @ @ @ @ @ @ @ @ @ @ # . . @ @ @ @ @ @ @ @ @ @ # . . . + . + $ + + + + $ + $ + + + + $ + + + + + $ + + + + $ + $ + + + + $ + + + + + $ + + + + $ + $ + + + + $ + . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . ", +". . # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # . . # # # # # # # # # # # . . . + . + + $ $ $ $ + + + $ $ $ $ + + + + + + + $ $ $ $ + + + $ $ $ $ + + + + + + + $ $ $ $ + + + $ $ $ $ + + . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . ", +". . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . # . . . + . + $ + + + + $ + $ + + + + $ + + + + + $ + + + + $ + $ + + + + $ + + + + + $ + + + + $ + $ + + + + $ + . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . ", +". . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . # . . . + . + $ + + + + $ + $ + + + + $ + + $ + + $ + + + + $ + $ + + + + $ + + $ + + $ + + + + $ + $ + + + + $ + . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . ", +". . @ @ @ @ @ @ @ @ @ @ @ @ @ @ @ @ @ @ @ @ @ @ @ @ @ @ @ @ @ @ @ @ @ @ @ @ @ @ @ @ @ @ @ @ @ @ @ @ @ @ @ @ @ @ @ @ @ @ # . . . + . + $ + + + + $ + $ + + + + $ + + $ + + $ + + + + $ + $ + + + + $ + + $ + + $ + + + + $ + $ + + + + $ + . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . ", +". . @ @ @ @ @ @ @ @ @ @ @ @ @ @ @ @ @ @ @ @ @ @ @ @ @ @ @ @ @ @ @ @ @ @ @ @ @ @ @ @ @ @ @ @ @ @ @ @ @ @ @ @ @ @ @ @ @ @ # . . . + . + + $ $ $ $ + + + $ $ $ $ + + + + + + + $ $ $ $ + + + $ $ $ $ + + + + + + + $ $ $ $ + + + $ $ $ $ + + . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . ", +". . @ @ @ @ @ @ @ @ @ @ @ @ @ @ @ @ @ @ @ @ @ @ @ @ @ @ @ @ @ @ @ @ @ @ @ @ @ @ @ @ @ @ @ @ @ @ @ @ @ @ @ @ @ @ @ @ @ @ # . . . + . + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . ", +". . @ @ @ @ @ @ @ @ @ @ @ @ @ @ @ @ @ @ @ @ @ @ @ @ @ @ @ @ @ @ @ @ @ @ @ @ @ @ @ @ @ @ @ @ @ @ @ @ @ @ @ @ @ @ @ @ @ @ # . . . + . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . ", +". . @ @ @ @ @ @ @ @ @ @ @ @ @ @ @ @ @ @ @ @ @ @ @ @ @ @ @ @ @ @ @ @ @ @ @ @ @ @ @ @ @ @ @ @ @ @ @ @ @ @ @ @ @ @ @ @ @ @ # . . . + . . + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . ", +". . @ @ @ @ @ @ @ @ @ @ @ @ @ @ @ @ @ @ @ @ @ @ @ @ @ @ @ @ @ @ @ @ @ @ @ @ @ @ @ @ @ @ @ @ @ @ @ @ @ @ @ @ @ @ @ @ @ @ # . . . + . . + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . ", +". . @ @ @ @ @ @ @ @ @ @ @ @ @ @ @ @ @ @ @ @ @ @ @ @ @ @ @ @ @ @ @ @ @ @ @ @ @ @ @ @ @ @ @ @ @ @ @ @ @ @ @ @ @ @ @ @ @ @ # . . . + . . + + + % % % % + + + $ $ $ $ & + & % % % % * + & % % % % & + & $ $ $ $ & + & % % % % & + & % % % % * + & % % % % & + & % % % % * + & % % % % * + + + + + + . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . ", +". . @ @ @ @ @ @ @ @ @ @ @ @ @ @ @ @ @ @ @ @ @ @ @ @ @ @ @ @ @ @ @ @ @ @ @ @ @ @ @ @ @ @ @ @ @ @ @ @ @ @ @ @ @ @ @ @ @ @ # . . . + . . + + % + + + + % + $ + + + + % + $ + + + + % + $ + + + + % + % + + + + % + % + + + + $ + % + + + + $ + $ + + + + % + % + + + + % + % + + + + % + + % + + + . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . ", +". . @ @ @ @ @ @ @ @ @ @ @ @ @ @ @ @ @ @ @ @ @ @ @ @ @ @ @ @ @ @ @ @ @ @ @ @ @ @ @ @ @ @ @ @ @ @ @ @ @ @ @ @ @ @ @ @ @ @ # . . . + . . + + % + + + + % + $ + + + + % + $ + + + + % + $ + + + + % + % + + + + % + % + + + + $ + % + + + + $ + $ + + + + % + % + + + + % + % + + + + % + + % + + + . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . ", +". . @ @ @ @ @ @ @ @ @ @ @ @ @ @ @ @ @ @ @ @ @ @ @ @ @ @ @ @ @ @ @ @ @ @ @ @ @ @ @ @ @ @ @ @ @ @ @ @ @ @ @ @ @ @ @ @ @ @ # . . . + . . + + % + + + + % + $ + + + + % + $ + + + + % + $ + + + + % + % + + + + % + % + + + + $ + % + + + + $ + $ + + + + % + % + + + + % + % + + + + % + + + + + + . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . ", +". . @ @ @ @ @ @ @ @ @ @ @ @ @ @ @ @ @ @ @ @ @ @ @ @ @ @ @ @ @ @ @ @ @ @ @ @ @ @ @ @ @ @ @ @ @ @ @ @ @ @ @ @ @ @ @ @ @ @ # . . . + . . + + & $ $ $ $ & + + $ $ $ $ & + & % % % % & + & % % % % & + & % % % % & + & % % % % & + & % % % % & + + $ $ $ $ & + & % % % % & + & % % % % & + + + + + + . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . ", +". . @ @ @ @ @ @ @ @ @ @ @ @ @ @ @ @ @ @ @ @ @ @ @ @ @ @ @ @ @ @ @ @ @ @ @ @ @ @ @ @ @ @ @ @ @ @ @ @ @ @ @ @ @ @ @ @ @ @ # . . . + . . + + % + + + + % + $ + + + + % + % + + + + $ + $ + + + + % + $ + + + + % + $ + + + + % + % + + + + % + $ + + + + % + % + + + + % + $ + + + + % + + + + + + . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . ", +". . @ @ @ @ @ @ @ @ @ @ @ @ @ @ @ @ @ @ @ @ @ @ @ @ @ @ @ @ @ @ @ @ @ @ @ @ @ @ @ @ @ @ @ @ @ @ @ @ @ @ @ @ @ @ @ @ @ @ # . . . + . . + + % + + + + % + $ + + + + % + % + + + + $ + $ + + + + % + $ + + + + % + $ + + + + % + % + + + + % + $ + + + + % + % + + + + % + $ + + + + % + + % + + + . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . ", +". . @ @ @ @ @ @ @ @ @ @ @ @ @ @ @ @ @ @ @ @ @ @ @ @ @ @ @ @ @ @ @ @ @ @ @ @ @ @ @ @ @ @ @ @ @ @ @ @ @ @ @ @ @ @ @ @ @ @ # . . . + . . + + % + + + + % + $ + + + + % + % + + + + $ + $ + + + + % + $ + + + + % + $ + + + + % + % + + + + % + $ + + + + % + % + + + + % + $ + + + + % + + % + + + . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . ", +". . @ @ @ @ @ @ @ @ @ @ @ @ @ @ @ @ @ @ @ @ @ @ @ @ @ @ @ @ @ @ @ @ @ @ @ @ @ @ @ @ @ @ @ @ @ @ @ @ @ @ @ @ @ @ @ @ @ @ # . . . + . . + + + % % % % + + + $ $ $ $ & + & % % % % & + & % % % % & + + $ $ $ $ & + & % % % % & + & % % % % & + + $ $ $ $ & + & % % % % & + & % % % % & + + + + + + . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . ", +". . @ @ @ @ @ @ @ @ @ @ @ @ @ @ @ @ @ @ @ @ @ @ @ @ @ @ @ @ @ @ @ @ @ @ @ @ @ @ @ @ @ @ @ @ @ @ @ @ @ @ @ @ @ @ @ @ @ @ # . . . + . . + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . ", +". . @ @ @ @ @ @ @ @ @ @ @ @ @ @ @ @ @ @ @ @ @ @ @ @ @ @ @ @ @ @ @ @ @ @ @ @ @ @ @ @ @ @ @ @ @ @ @ @ @ @ @ @ @ @ @ @ @ @ # . . . + . . + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . ", +". . @ @ @ @ @ @ @ @ @ @ @ @ @ @ @ @ @ @ @ @ @ @ @ @ @ @ @ @ @ @ @ @ @ @ @ @ @ @ @ @ @ @ @ @ @ @ @ @ @ @ @ @ @ @ @ @ @ @ # . . . + . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . ", +". . @ @ @ @ @ @ @ @ @ @ @ @ @ @ @ @ @ @ @ @ @ @ @ @ @ @ @ @ @ @ @ @ @ @ @ @ @ @ @ @ @ @ @ @ @ @ @ @ @ @ @ @ @ @ @ @ @ @ # . . . + . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . ", +". . @ @ @ @ @ @ @ @ @ @ @ @ @ @ @ @ @ @ @ @ @ @ @ @ @ @ @ @ @ @ @ @ @ @ @ @ @ @ @ @ @ @ @ @ @ @ @ @ @ @ @ @ @ @ @ @ @ @ # . . . + . . = - ; > , ' ) ! ~ { ] ] ] ] ] ] ^ / ( _ : < [ [ [ } | 1 1 2 3 3 4 5 5 6 7 8 8 9 0 0 a b c c d e e f g g h i j j j k . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . ", +". . @ @ @ @ @ @ @ @ @ @ @ @ @ @ @ @ @ @ @ @ @ @ @ @ @ @ @ @ @ @ @ @ @ @ @ @ @ @ @ @ @ @ @ @ @ @ @ @ @ @ @ @ @ @ @ @ @ @ # . . . + . . = l m n o p q r s t ] ] ] ] ] ] ^ / ( _ : < [ [ [ } | 1 1 2 3 3 4 5 5 6 7 8 8 9 0 0 a b c c d e e f g g h i j j j k . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . ", +". . @ @ @ @ @ @ @ @ @ @ @ @ @ @ @ @ @ @ @ @ @ @ @ @ @ @ @ @ @ @ @ @ @ @ @ @ @ @ @ @ @ @ @ @ @ @ @ @ @ @ @ @ @ @ @ @ @ @ # . . . + . . = u v w x y z A B C ] ] ] ] ] ] ^ / ( _ : < [ [ [ } | 1 1 2 3 3 4 5 5 6 7 8 8 9 0 0 a b c c d e e f g g h i j j j k . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . ", +". . @ @ @ @ @ @ @ @ @ @ @ @ @ @ @ @ @ @ @ @ @ @ @ @ @ @ @ @ @ @ @ @ @ @ @ @ @ @ @ @ @ @ @ @ @ @ @ @ @ @ @ @ @ @ @ @ @ @ # . . . + . . = D E F G H I J K L ] ] ] ] ] ] ^ / ( _ : < [ [ [ } | 1 1 2 3 3 4 5 5 6 7 8 8 9 0 0 a b c c d e e f g g h i j j j k . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . ", +". . @ @ @ @ @ @ @ @ @ @ @ @ @ @ @ @ @ @ @ @ @ @ @ @ @ @ @ @ @ @ @ @ @ @ @ @ @ @ @ @ @ @ @ @ @ @ @ @ @ @ @ @ @ @ @ @ @ @ # . . . + . . M N O P Q R S T U V ] ] ] ] ] ] ^ / ( _ : < [ [ [ } | 1 1 2 3 3 4 5 5 6 7 8 8 9 0 0 a b c c d e e f g g h i j j j k . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . ", +". . @ @ @ @ @ @ @ @ @ @ @ @ @ @ @ @ @ @ @ @ @ @ @ @ @ @ @ @ @ @ @ @ @ @ @ @ @ @ @ @ @ @ @ @ @ @ @ @ @ @ @ @ @ @ @ @ @ @ # . . . + . . W X Y Z ` ...+.@.#.] ] ] ] ] ] ^ / ( _ : < [ [ [ } | 1 1 2 3 3 4 5 5 6 7 8 8 9 0 0 a b c c d e e f g g h i j j j k . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . ", +". . @ @ @ @ @ @ @ @ @ @ @ @ @ @ @ @ @ @ @ @ @ @ @ @ @ @ @ @ @ @ @ @ @ @ @ @ @ @ @ @ @ @ @ @ @ @ @ @ @ @ @ @ @ @ @ @ @ @ # . . . + . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . ", +". . @ @ @ @ @ @ @ @ @ @ @ @ @ @ @ @ @ @ @ @ @ @ @ @ @ @ @ @ @ @ @ @ @ @ @ @ @ @ @ @ @ @ @ @ @ @ @ @ @ @ @ @ @ @ @ @ @ @ # . . . + . . + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . ", +". . @ @ @ @ @ @ @ @ @ @ @ @ @ @ @ @ @ @ @ @ @ @ @ @ @ @ @ @ @ @ @ @ @ @ @ @ @ @ @ @ @ @ @ @ @ @ @ @ @ @ @ @ @ @ @ @ @ @ # . . . + . . + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . ", +". . @ @ @ @ @ @ @ @ @ @ @ @ @ @ @ @ @ @ @ @ @ @ @ @ @ @ @ @ @ @ @ @ @ @ @ @ @ @ @ @ @ @ @ @ @ @ @ @ @ @ @ @ @ @ @ @ @ @ # . . . + . . + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . ", +". . @ @ @ @ @ @ @ @ @ @ @ @ @ @ @ @ @ @ @ @ @ @ @ @ @ @ @ @ @ @ @ @ @ @ @ @ @ @ @ @ @ @ @ @ @ @ @ @ @ @ @ @ @ @ @ @ @ @ # . . . + . . + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . ", +". . @ @ @ @ @ @ @ @ @ @ @ @ @ @ @ @ @ @ @ @ @ @ @ @ @ @ @ @ @ @ @ @ @ @ @ @ @ @ @ @ @ @ @ @ @ @ @ @ @ @ @ @ @ @ @ @ @ @ # . . . + . . + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . ", +". . @ @ @ @ @ @ @ @ @ @ @ @ @ @ @ @ @ @ @ @ @ @ @ @ @ @ @ @ @ @ @ @ @ @ @ @ @ @ @ @ @ @ @ @ @ @ @ @ @ @ @ @ @ @ @ @ @ @ # . . . + . . + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . ", +". . @ @ @ @ @ @ @ @ @ @ @ @ @ @ @ @ @ @ @ @ @ @ @ @ @ @ @ @ @ @ @ @ @ @ @ @ @ @ @ @ @ @ @ @ @ @ @ @ @ @ @ @ @ @ @ @ @ @ # . . . + . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . ", +". . @ @ @ @ @ @ @ @ @ @ @ @ @ @ @ @ @ @ @ @ @ @ @ @ @ @ @ @ @ @ @ @ @ @ @ @ @ @ @ @ @ @ @ @ @ @ @ @ @ @ @ @ @ @ @ @ @ @ # . . . + . . $.$.$.$.$.$.$.$.$.$.$.$.$.$.$.$.$.$.$.$.$.$.$.$.$.$.$.$.$.$.$.$.$.$.$.$.$.$.$.$.$.$.$.$.$.$.$.$.$.$.$.$.$.$.$.$.$.$.. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . ", +". . @ @ @ @ @ @ @ @ @ @ @ @ @ @ @ @ @ @ @ @ @ @ @ @ @ @ @ @ @ @ @ @ @ @ @ @ @ @ @ @ @ @ @ @ @ @ @ @ @ @ @ @ @ @ @ @ @ @ # . . . + . . $.$.$.$.$.$.$.$.$.$.$.$.$.$.$.$.$.$.$.$.$.$.$.$.$.$.$.$.$.$.$.$.$.$.$.$.$.$.$.$.$.$.$.$.$.$.$.$.$.$.$.$.$.$.$.$.$.$.. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . ", +". . @ @ @ @ @ @ @ @ @ @ @ @ @ @ @ @ @ @ @ @ @ @ @ @ @ @ @ @ @ @ @ @ @ @ @ @ @ @ @ @ @ @ @ @ @ @ @ @ @ @ @ @ @ @ @ @ @ @ # . . . + . . $.$.$.$.$.$.$.$.$.$.$.$.$.$.$.$.$.$.$.$.$.$.$.$.$.$.$.$.$.$.$.$.$.$.$.$.$.$.$.$.$.$.$.$.$.$.$.$.$.$.$.$.$.$.$.$.$.$.. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . ", +". . @ @ @ @ @ @ @ @ @ @ @ @ @ @ @ @ @ @ @ @ @ @ @ @ @ @ @ @ @ @ @ @ @ @ @ @ @ @ @ @ @ @ @ @ @ @ @ @ @ @ @ @ @ @ @ @ @ @ # . . . + . . $.$.$.$.$.$.$.$.$.$.$.$.$.$.$.$.$.$.$.$.$.$.$.$.$.$.$.$.$.$.$.$.$.$.$.$.$.$.$.$.$.$.$.$.$.$.$.$.$.$.$.$.$.$.$.$.$.$.. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . ", +". . @ @ @ @ @ @ @ @ @ @ @ @ @ @ @ @ @ @ @ @ @ @ @ @ @ @ @ @ @ @ @ @ @ @ @ @ @ @ @ @ @ @ @ @ @ @ @ @ @ @ @ @ @ @ @ @ @ @ # . . . + . . $.$.$.$.$.$.$.$.$.$.$.$.$.$.$.$.$.$.$.$.$.$.$.$.$.$.$.$.$.$.$.$.$.$.$.$.$.$.$.$.$.$.$.$.$.$.$.$.$.$.$.$.$.$.$.$.$.$.. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . ", +". . @ @ @ @ @ @ @ @ @ @ @ @ @ @ @ @ @ @ @ @ @ @ @ @ @ @ @ @ @ @ @ @ @ @ @ @ @ @ @ @ @ @ @ @ @ @ @ @ @ @ @ @ @ @ @ @ @ @ # . . . + . . $.$.$.$.$.$.$.$.$.$.$.$.$.$.$.$.$.$.$.$.$.$.$.$.$.$.$.$.$.$.$.$.$.$.$.$.$.$.$.$.$.$.$.$.$.$.$.$.$.$.$.$.$.$.$.$.$.$.. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . ", +". . @ @ @ @ @ @ @ @ @ @ @ @ @ @ @ @ @ @ @ @ @ @ @ @ @ @ @ @ @ @ @ @ @ @ @ @ @ @ @ @ @ @ @ @ @ @ @ @ @ @ @ @ @ @ @ @ @ @ # . . . + . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . ", +". . @ @ @ @ @ @ @ @ @ @ @ @ @ @ @ @ @ @ @ @ @ @ @ @ @ @ @ @ @ @ @ @ @ @ @ @ @ @ @ @ @ @ @ @ @ @ @ @ @ @ @ @ @ @ @ @ @ @ # . . . + . . %.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . ", +". . @ @ @ @ @ @ @ @ @ @ @ @ @ @ @ @ @ @ @ @ @ @ @ @ @ @ @ @ @ @ @ @ @ @ @ @ @ @ @ @ @ @ @ @ @ @ @ @ @ @ @ @ @ @ @ @ @ @ # . . . + . . %.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . ", +". . @ @ @ @ @ @ @ @ @ @ @ @ @ @ @ @ @ @ @ @ @ @ @ @ @ @ @ @ @ @ @ @ @ @ @ @ @ @ @ @ @ @ @ @ @ @ @ @ @ @ @ @ @ @ @ @ @ @ # . . . + . . %.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . ", +". . # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # . . . + . . %.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . ", +". . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . + . . %.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . ", +". . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . + . . %.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . ", +". . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . + . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . ", +"+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . ", +"+ + % % % + + + $ $ $ &.+ &.% % % &.+ &.% % % &.+ &.$ $ $ &.+ &.% % % &.+ &.% % % &.+ &.% % % &.+ &.% % % &.+ &.% % % &.+ + + + + + + + + + + + + + + + + + + . @ @ @ @ @ @ @ @ @ @ @ @ @ @ @ @ @ @ @ @ @ @ @ @ . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . ", +"+ % + + + % + $ + + + % + $ + + + % + $ + + + % + % + + + % + % + + + $ + % + + + $ + $ + + + % + % + + + % + % + + + % + + + + + + + + + + + + % + + + + + + . @ @ *.*.@ @ @ @ =.=.@ @ @ @ -.-.@ @ @ @ ;.;.@ @ . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . ", +"+ % + + + % + $ + + + % + $ + + + % + $ + + + % + % + + + % + % + + + $ + % + + + $ + $ + + + % + % + + + % + % + + + % + + % + + + + % + + + + % + + + + + + . @ *.>.*.*.@ @ =.>.=.=.@ @ -.>.-.-.@ @ ;.;.;.;.@ . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . ", +"+ &.$ $ $ &.+ + $ $ $ &.+ &.% % % &.+ + % % % &.+ &.% % % &.+ &.% % % &.+ &.% % % &.+ + $ $ $ &.+ $ % % % $ + &.% % % &.+ + &.+ + + + &.+ + + % + + + + + + + . @ *.*.*.*.@ @ =.=.=.=.@ @ -.-.-.-.@ @ ;.;.;.;.@ . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . ", +"+ % + + + % + $ + + + % + % + + + $ + $ + + + % + $ + + + % + $ + + + % + % + + + % + $ + + + % + % + + + % + $ + + + % + + + + + + + + + + + % + + + + + + + . @ @ *.*.@ @ @ @ =.=.@ @ @ @ -.-.@ @ @ @ ;.;.@ @ . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . ", +"+ % + + + % + $ + + + % + % + + + $ + $ + + + % + $ + + + % + $ + + + % + % + + + % + $ + + + % + % + + + % + $ + + + % + + % + + + + % + + % + + + + + + + + . @ @ @ @ @ @ @ @ @ @ @ @ @ @ @ @ @ @ @ @ @ @ @ @ . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . ", +"+ + % % % + + + $ $ $ % + &.% % % &.+ &.% % % &.+ + $ $ $ &.+ &.% % % &.+ &.% % % &.+ + $ $ $ &.+ &.% % % &.+ &.% % % &.+ + &.+ + + + &.+ + % + + + + + + + + . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . ", +"+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . ", +". . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . ", +"+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . ", +"+ $ % % % $ + &.% % % + + &.% % % &.+ &.% % % + + &.% % % &.+ &.% % % &.+ &.% % % &.+ &.$ $ $ &.+ + $ $ $ &.+ + $ $ $ &.+ &.$ $ $ &.+ &.$ $ $ + + % $ $ $ % + &.% % % + + &.% % % &.+ &.% % % &.+ &.% % % &.+ &.% % % &.+ &.% % % &.+ &.% % % &.+ &.$ $ $ &.+ &.$ $ $ &.+ &.$ $ $ &.+ &.$ $ $ &.+ &.$ $ $ &.+ &.% % % &.+ + + + . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . ", +"+ % + + + % + % + + + % + % + + + $ + % + + + % + % + + + $ + % + + + $ + % + + + $ + % + + + % + $ + + + % + $ + + + % + % + + + % + % + + + $ + % % + % % + % + + + % + % + + + % + % + + + % + % + + + % + % + + + % + % + + + $ + $ + % + $ + % + + + % + % + + + % + % + + + % + % + + + % + % + + + % + $ + + + % + + + + . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . ", +"+ % + + + % + % + + + % + % + + + $ + % + + + % + % + + + $ + % + + + $ + % + + + $ + % + + + % + $ + + + % + $ + + + % + % + + % $ + % + + + $ + % + % + % + % + + + % + % + + + % + % + + + % + % + + + % + % + + + % + % + + + $ + $ + % + $ + % + + + % + % + + + % + % + + + % + $ % + % $ + % + + + % + $ + + % $ + + + + . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . ", +"+ &.% % % &.+ &.% % % + + &.$ $ $ + + &.$ $ $ &.+ &.% % % + + &.% % % + + &.$ % % &.+ &.% % % &.+ + $ $ $ &.+ + $ $ $ &.+ &.% % $ + + &.$ $ $ + + &.$ $ $ &.+ &.$ $ $ &.+ &.$ $ $ &.+ &.% % % &.+ &.% $ $ &.+ &.% % % + + &.% % % &.+ + $ &.$ + + &.$ $ $ &.+ &.$ $ $ &.+ &.$ $ $ &.+ + $ % $ + + &.% % % &.+ + $ % $ + + + + + . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . ", +"+ % + + + % + % + + + % + % + + + $ + % + + + % + % + + + $ + % + + + $ + % + + + % + % + + + % + $ + + + % + $ + + + % + % + + % $ + % + + + $ + % + + + % + % + + + % + % + + + % + % + + + $ + % + % + % + % + + + % + $ + + + % + $ + % + $ + % + + + % + % + + + % + % + % + % + $ % + % $ + $ + + + % + $ % + + $ + + + + . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . ", +"+ % + + + % + % + + + % + % + + + $ + % + + + % + % + + + $ + % + + + $ + % + + + % + % + + + % + $ + + + % + $ + + + % + % + + + % + % + + + $ + % + + + % + % + + + % + % + + + % + % + + + $ + % + + % % + % + + + % + $ + + + % + $ + % + $ + % + + + % + % + + + % + % % + % % + % + + + % + $ + + + % + % + + + $ + + + + . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . ", +"+ &.$ $ $ &.+ &.% % % + + &.% % % &.+ % % % % + + &.% % % &.+ % $ $ $ + + &.% % % &.+ &.$ $ $ &.+ + $ $ $ % + &.% % % &.+ &.$ $ $ &.+ &.% % % $ + &.$ $ $ &.+ % $ $ $ % + &.% % % &.+ &.$ $ $ + + &.% % % &.+ &.$ $ $ &.+ &.% % % &.+ + $ &.$ + + $ % % % % + + % % % + + % $ $ $ % + &.$ $ $ % &.&.% % % &.+ &.% % % &.+ + + + . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . ", +"+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . ", +". . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . ", +". . . . @ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + ,.. . . . + . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . ", +". . . . . + + $ $ $ + + + $ $ $ + + + $ $ $ + + + $ $ $ + + + $ $ $ + + + + + + + $ $ $ + + + $ $ $ + + + $ $ $ + + + . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . ", +". . . . . + $ + + + $ + $ + + + $ + $ + + + $ + $ + + + $ + $ + + + $ + + + + + $ + + + $ + $ + + + $ + $ + + + $ + + . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . ", +". . . . . + $ + + + $ + $ + + + $ + $ + + + $ + $ + + + $ + $ + + + $ + + $ + + $ + + + $ + $ + + + $ + $ + + + $ + + . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . ", +". . . . . + + $ $ $ + + + $ $ $ + + + $ $ $ + + + $ $ $ + + + $ $ $ + + + $ + + + $ $ $ + + + $ $ $ + + + $ $ $ + + + . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . ", +". . . . . + $ + + + $ + $ + + + $ + $ + + + $ + $ + + + $ + $ + + + $ + + + + + $ + + + $ + $ + + + $ + $ + + + $ + + . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . ", +". . . . . + $ + + + $ + $ + + + $ + $ + + + $ + $ + + + $ + $ + + + $ + + $ + + $ + + + $ + $ + + + $ + $ + + + $ + + . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . ", +". . . . . + + $ $ $ + + + $ $ $ + + + $ $ $ + + + $ $ $ + + + $ $ $ + + + $ + + + $ $ $ + + + $ $ $ + + + $ $ $ + + + . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . ", +". . . . . + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . ", +". . . . . + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . ", +". . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . ", +". . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . ", +"$ &.% . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . ", +"'.).!.. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . ", +". . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . ", +". . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . "}; diff --git a/app-laptop/pommed/pommed-1.31/wmpomme/wmpomme.1 b/app-laptop/pommed/pommed-1.31/wmpomme/wmpomme.1 new file mode 100644 index 0000000..8a75368 --- /dev/null +++ b/app-laptop/pommed/pommed-1.31/wmpomme/wmpomme.1 @@ -0,0 +1,29 @@ +.TH WMPOMME 1 "2008-11-09" +.SH NAME +wmpomme \- WindowMaker dockapp for use with pommed + +.SH SYNOPSIS +.B wmpomme +.BI [\-r \ time ] +.B [\-v] +.SH DESCRIPTION +.B wmpomme +displays, as a WindowMaker dockapp, the state of the devices controlled by +.B pommed + +.SH OPTIONS +.TP +.BI \-v +Display the version +.TP +.BI \-display \ display +This option specifies the X server to contact; see X(1). + +.SH AUTHOR +.B wmpomme +was written by Julien BLACHE , based on +.B wmwave +by Carsten Schuermann + +.SH SEE ALSO +pommed(1) diff --git a/app-laptop/pommed/pommed-1.31/wmpomme/wmpomme.c b/app-laptop/pommed/pommed-1.31/wmpomme/wmpomme.c new file mode 100644 index 0000000..5b6ebf3 --- /dev/null +++ b/app-laptop/pommed/pommed-1.31/wmpomme/wmpomme.c @@ -0,0 +1,943 @@ +/* + * wmpomme -- WindowMaker dockapp for use with pommed + * + * Copyright (C) 2006-2009 Julien BLACHE + * + * Based on wmwave by Carsten Schuermann + * wmwave derived from: + * Dan Piponi dan@tanelorn.demon.co.uk + * http://www.tanelorn.demon.co.uk + * who derived it from code originally contained + * in wmsysmon by Dave Clark (clarkd@skynet.ca) + * + * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; version 2 of the License. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License along + * with this program; if not, write to the Free Software Foundation, Inc., + * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. + */ + + +#include +#include +#include +#include +#include + +#include +#include +#include + +#include +#include + +#include + +#include + +#include +#include + +#include + +#ifndef NO_SYS_TIMERFD_H +# include +#else +# include "timerfd-syscalls.h" +#endif + +#include "wmgeneral.h" +#include "wmpomme-master.xpm" + +#include "../client-common/dbus-client.h" +#include "../client-common/video-client.h" + + +struct { + int lcd_lvl; + int lcd_max; + int kbd_lvl; + int kbd_max; + int snd_lvl; + int snd_max; + int snd_mute; + + int ambient_l; + int ambient_r; + int ambient_max; +} mbp; + + +#define DISPLAY_TYPE_DBUS_NOK (1 << 0) +#define DISPLAY_TYPE_NO_DATA (1 << 1) +#define DISPLAY_TYPE_MACBOOK (1 << 2) +#define DISPLAY_TYPE_AMBIENT (1 << 3) + +#define DISPLAY_MASK_TYPE (0xffff) +#define DISPLAY_TYPE(d) (d & DISPLAY_MASK_TYPE) + +#define DISPLAY_FLAG_UPDATE (1 << 16) + +#define DISPLAY_MASK_FLAGS (0xffff0000) +#define DISPLAY_FLAGS(d) (d & DISPLAY_MASK_FLAGS) + +unsigned int mbpdisplay = DISPLAY_TYPE_DBUS_NOK; + + +char wmmbp_mask_bits[64*64]; +int wmmbp_mask_width = 64; +int wmmbp_mask_height = 64; + +#define WMPOMME_VERSION "0.2" + +char *ProgName; + + +DBusError dbus_err; +DBusConnection *conn; + +void +wmmbp_get_values(void); + +int +wmmbp_dbus_init(void) +{ + unsigned int signals; + + signals = MBP_DBUS_SIG_LCD | MBP_DBUS_SIG_KBD + | MBP_DBUS_SIG_VOL | MBP_DBUS_SIG_MUTE + | MBP_DBUS_SIG_LIGHT | MBP_DBUS_SIG_VIDEO; + + conn = mbp_dbus_init(&dbus_err, signals); + + if (conn == NULL) + { + mbpdisplay = DISPLAY_FLAG_UPDATE | DISPLAY_TYPE_DBUS_NOK; + + return -1; + } + else + wmmbp_get_values(); + + return 0; +} + +/* Forward */ +void +wmmbp_video_getvtstate_cb(DBusPendingCall *pending, void *status); + +void +mbp_dbus_listen(void) +{ + DBusMessage *msg; + + int scratch; + + if (conn == NULL) + return; + + while (1) + { + dbus_connection_read_write(conn, 0); + + msg = dbus_connection_pop_message(conn); + + if (msg == NULL) + return; + + if (dbus_message_is_signal(msg, "org.pommed.signal.ambientLight", "ambientLight")) + { + dbus_message_get_args(msg, &dbus_err, + DBUS_TYPE_UINT32, &mbp.ambient_l, + DBUS_TYPE_UINT32, &scratch, /* previous left */ + DBUS_TYPE_UINT32, &mbp.ambient_r, + DBUS_TYPE_UINT32, &scratch, /* previous right */ + DBUS_TYPE_UINT32, &mbp.ambient_max, + DBUS_TYPE_INVALID); + + if (mbpdisplay & DISPLAY_TYPE_AMBIENT) + mbpdisplay |= DISPLAY_FLAG_UPDATE; + } + else if (dbus_message_is_signal(msg, "org.pommed.signal.lcdBacklight", "lcdBacklight")) + { + dbus_message_get_args(msg, &dbus_err, + DBUS_TYPE_UINT32, &mbp.lcd_lvl, + DBUS_TYPE_UINT32, &scratch, /* previous */ + DBUS_TYPE_UINT32, &mbp.lcd_max, + DBUS_TYPE_UINT32, &scratch, /* who */ + DBUS_TYPE_INVALID); + + if (mbpdisplay & DISPLAY_TYPE_MACBOOK) + mbpdisplay |= DISPLAY_FLAG_UPDATE; + } + else if (dbus_message_is_signal(msg, "org.pommed.signal.kbdBacklight", "kbdBacklight")) + { + dbus_message_get_args(msg, &dbus_err, + DBUS_TYPE_UINT32, &mbp.kbd_lvl, + DBUS_TYPE_UINT32, &scratch, /* previous */ + DBUS_TYPE_UINT32, &mbp.kbd_max, + DBUS_TYPE_UINT32, &scratch, /* who */ + DBUS_TYPE_INVALID); + + if (mbpdisplay & (DISPLAY_TYPE_MACBOOK | DISPLAY_TYPE_AMBIENT)) + mbpdisplay |= DISPLAY_FLAG_UPDATE; + } + else if (dbus_message_is_signal(msg, "org.pommed.signal.audioVolume", "audioVolume")) + { + dbus_message_get_args(msg, &dbus_err, + DBUS_TYPE_UINT32, &mbp.snd_lvl, + DBUS_TYPE_UINT32, &scratch, /* previous */ + DBUS_TYPE_UINT32, &mbp.snd_max, + DBUS_TYPE_INVALID); + + if (mbpdisplay & DISPLAY_TYPE_MACBOOK) + mbpdisplay |= DISPLAY_FLAG_UPDATE; + } + else if (dbus_message_is_signal(msg, "org.pommed.signal.audioMute", "audioMute")) + { + dbus_message_get_args(msg, &dbus_err, + DBUS_TYPE_BOOLEAN, &mbp.snd_mute, + DBUS_TYPE_INVALID); + + if (mbpdisplay & DISPLAY_TYPE_MACBOOK) + mbpdisplay |= DISPLAY_FLAG_UPDATE; + } + else if (dbus_message_is_signal(msg, "org.pommed.signal.videoSwitch", "videoSwitch")) + { + int vtnum; + int vtstate; + int ret; + + vtnum = mbp_get_x_vtnum(display); + + ret = mbp_call_video_getvtstate(vtnum, wmmbp_video_getvtstate_cb, &vtstate); + if ((ret < 0) || (vtstate < 0)) + fprintf(stderr, "video getVTState call failed !\n"); + else if (vtstate == 1) + mbp_video_switch(); + } + else if (dbus_message_is_signal(msg, DBUS_INTERFACE_LOCAL, "Disconnected")) + { + fprintf(stderr, "DBus disconnected\n"); + + mbpdisplay = DISPLAY_FLAG_UPDATE | DISPLAY_TYPE_DBUS_NOK; + + mbp_dbus_cleanup(); + conn = NULL; + + dbus_message_unref(msg); + + break; + } + + dbus_message_unref(msg); + } +} + + +/* DBus method call callbacks */ +void +wmmbp_lcd_getlevel_cb(DBusPendingCall *pending, void *status) +{ + DBusMessage *msg; + + msg = dbus_pending_call_steal_reply(pending); + + if (msg == NULL) + { + fprintf(stderr, "Could not steal reply\n"); + + dbus_pending_call_unref(pending); + + return; + } + + dbus_pending_call_unref(pending); + + if (!mbp_dbus_check_error(msg)) + { + dbus_message_get_args(msg, &dbus_err, + DBUS_TYPE_UINT32, &mbp.lcd_lvl, + DBUS_TYPE_UINT32, &mbp.lcd_max, + DBUS_TYPE_INVALID); + } + else + *(int *)status = -1; + + dbus_message_unref(msg); +} + +void +wmmbp_kbd_getlevel_cb(DBusPendingCall *pending, void *status) +{ + DBusMessage *msg; + + msg = dbus_pending_call_steal_reply(pending); + + if (msg == NULL) + { + fprintf(stderr, "Could not steal reply\n"); + + dbus_pending_call_unref(pending); + + return; + } + + dbus_pending_call_unref(pending); + + if (!mbp_dbus_check_error(msg)) + { + dbus_message_get_args(msg, &dbus_err, + DBUS_TYPE_UINT32, &mbp.kbd_lvl, + DBUS_TYPE_UINT32, &mbp.kbd_max, + DBUS_TYPE_INVALID); + } + else + *(int *)status = -1; + + dbus_message_unref(msg); +} + +void +wmmbp_ambient_getlevel_cb(DBusPendingCall *pending, void *status) +{ + DBusMessage *msg; + + msg = dbus_pending_call_steal_reply(pending); + + if (msg == NULL) + { + fprintf(stderr, "Could not steal reply\n"); + + dbus_pending_call_unref(pending); + + return; + } + + dbus_pending_call_unref(pending); + + if (!mbp_dbus_check_error(msg)) + { + dbus_message_get_args(msg, &dbus_err, + DBUS_TYPE_UINT32, &mbp.ambient_l, + DBUS_TYPE_UINT32, &mbp.ambient_r, + DBUS_TYPE_UINT32, &mbp.ambient_max, + DBUS_TYPE_INVALID); + } + else + *(int *)status = -1; + + dbus_message_unref(msg); +} + +void +wmmbp_audio_getvolume_cb(DBusPendingCall *pending, void *status) +{ + DBusMessage *msg; + + msg = dbus_pending_call_steal_reply(pending); + + if (msg == NULL) + { + fprintf(stderr, "Could not steal reply\n"); + + dbus_pending_call_unref(pending); + + return; + } + + dbus_pending_call_unref(pending); + + if (!mbp_dbus_check_error(msg)) + { + dbus_message_get_args(msg, &dbus_err, + DBUS_TYPE_UINT32, &mbp.snd_lvl, + DBUS_TYPE_UINT32, &mbp.snd_max, + DBUS_TYPE_INVALID); + } + else + *(int *)status = -1; + + dbus_message_unref(msg); +} + +void +wmmbp_audio_getmute_cb(DBusPendingCall *pending, void *status) +{ + DBusMessage *msg; + + msg = dbus_pending_call_steal_reply(pending); + + if (msg == NULL) + { + fprintf(stderr, "Could not steal reply\n"); + + dbus_pending_call_unref(pending); + + return; + } + + dbus_pending_call_unref(pending); + + if (!mbp_dbus_check_error(msg)) + { + dbus_message_get_args(msg, &dbus_err, + DBUS_TYPE_BOOLEAN, &mbp.snd_mute, + DBUS_TYPE_INVALID); + } + else + *(int *)status = -1; + + dbus_message_unref(msg); +} + +void +wmmbp_video_getvtstate_cb(DBusPendingCall *pending, void *status) +{ + DBusMessage *msg; + + msg = dbus_pending_call_steal_reply(pending); + + if (msg == NULL) + { + fprintf(stderr, "Could not steal reply\n"); + + dbus_pending_call_unref(pending); + + return; + } + + dbus_pending_call_unref(pending); + + if (!mbp_dbus_check_error(msg)) + { + dbus_message_get_args(msg, &dbus_err, + DBUS_TYPE_BOOLEAN, (int *)status, + DBUS_TYPE_INVALID); + } + else + *(int *)status = -1; + + dbus_message_unref(msg); +} + + +void +wmmbp_get_values(void) +{ + int ret; + int cbret; + + ret = mbp_call_lcd_getlevel(wmmbp_lcd_getlevel_cb, &cbret); + if ((ret < 0) || (cbret < 0)) + { + fprintf(stderr, "lcdBacklight getLevel call failed !\n"); + goto mcall_error; + } + + ret = mbp_call_kbd_getlevel(wmmbp_kbd_getlevel_cb, &cbret); + if ((ret < 0) || (cbret < 0)) + { + fprintf(stderr, "kbdBacklight getLevel call failed !\n"); + goto mcall_error; + } + + ret = mbp_call_ambient_getlevel(wmmbp_ambient_getlevel_cb, &cbret); + if ((ret < 0) || (cbret < 0)) + { + fprintf(stderr, "ambient getLevel call failed !\n"); + goto mcall_error; + } + + ret = mbp_call_audio_getvolume(wmmbp_audio_getvolume_cb, &cbret); + if ((ret < 0) || (cbret < 0)) + { + fprintf(stderr, "audio getVolume call failed !\n"); + goto mcall_error; + } + + ret = mbp_call_audio_getmute(wmmbp_audio_getmute_cb, &cbret); + if ((ret < 0) || (cbret < 0)) + { + fprintf(stderr, "audio getMute call failed !\n"); + goto mcall_error; + } + + if (DISPLAY_TYPE(mbpdisplay) <= DISPLAY_TYPE_NO_DATA) + mbpdisplay = DISPLAY_TYPE_MACBOOK; + + mbpdisplay |= DISPLAY_FLAG_UPDATE; + + return; + + mcall_error: + mbpdisplay = DISPLAY_FLAG_UPDATE | DISPLAY_TYPE_NO_DATA; +} + + +void +usage(void); + +void +printversion(void); + +void +BlitString(char *name, int x, int y); + +void +BlitNum(int num, int x, int y); + +void +wmmbp_routine(int argc, char **argv); + + +void +DrawBar(float percent, int dx, int dy) +{ + int tx; + + tx = (int)(54.0 * (percent * 0.01)); + copyXPMArea(67, 36, tx, 4, dx, dy); + copyXPMArea(67, 43, 54-tx, 4, dx+tx, dy); +} + +void +DrawGreenBar(float percent, int dx, int dy) +{ + int tx; + + tx = (int)(54.0 * (percent * 0.01)); + copyXPMArea(67, 58, tx, 4, dx, dy); + copyXPMArea(67, 43, 54-tx, 4, dx+tx, dy); +} + +void +DrawRedDot(void) +{ + copyXPMArea(80, 65, 6, 6, 52, 5); +} + +void +DrawYellowDot(void) +{ + copyXPMArea(86, 65, 6, 6, 52, 5); +} + +void +DrawGreenDot(void) +{ + copyXPMArea(92, 65, 6, 6, 52, 5); +} + +void +DrawEmptyDot(void) +{ + copyXPMArea(98, 65, 6, 6, 52, 5); +} + + +void +DisplayMBPStatus(void) +{ + switch (DISPLAY_TYPE(mbpdisplay)) + { + case DISPLAY_TYPE_MACBOOK: + BlitString("MacBook", 4, 4); + DrawGreenDot(); + + BlitString("LCD level", 4, 18); + DrawBar(((float)mbp.lcd_lvl / (float)mbp.lcd_max) * 100.0, 4, 27); + + BlitString("KBD level", 4, 32); + DrawGreenBar(((float)mbp.kbd_lvl / (float)mbp.kbd_max) * 100.0, 4, 41); + + if (mbp.snd_mute) + BlitString("Audio OFF", 4, 46); + else + BlitString("Audio ", 4, 46); + DrawGreenBar(((float)mbp.snd_lvl / (float)mbp.snd_max) * 100.0, 4, 55); + break; + + case DISPLAY_TYPE_AMBIENT: + BlitString("Ambient", 4, 4); + DrawYellowDot(); + + BlitString("Left ", 4, 18); + DrawBar(((float)mbp.ambient_l / (float)mbp.ambient_max) * 100.0, 4, 27); + + BlitString("Right ", 4, 32); + DrawBar(((float)mbp.ambient_r / (float)mbp.ambient_max) * 100.0, 4, 41); + + BlitString("KBD level", 4, 46); + DrawGreenBar(((float)mbp.kbd_lvl / (float)mbp.kbd_max) * 100.0, 4, 55); + break; + + case DISPLAY_TYPE_DBUS_NOK: + BlitString(" Error ", 4, 4); + DrawRedDot(); + + BlitString("DBus ", 4, 18); + DrawBar(0.0, 4, 27); + + BlitString("Connect ", 4, 32); + DrawGreenBar(0.0, 4, 41); + + BlitString("Failed ", 4, 46); + DrawGreenBar(0.0, 4, 55); + break; + + case DISPLAY_TYPE_NO_DATA: + BlitString("No Data", 4, 4); + DrawRedDot(); + + BlitString("Server ", 4, 18); + DrawBar(0.0, 4, 27); + + BlitString("Not ", 4, 32); + DrawGreenBar(0.0, 4, 41); + + BlitString("Running ?", 4, 46); + DrawGreenBar(0.0, 4, 55); + break; + } + + mbpdisplay = DISPLAY_TYPE(mbpdisplay); +} + + +static int +mbp_create_timer(int timeout) +{ + int fd; + int ret; + + struct itimerspec timing; + + fd = timerfd_create(CLOCK_MONOTONIC, 0); + if (fd < 0) + { + fprintf(stderr, "Could not create timer: %s", strerror(errno)); + + return -1; + } + + timing.it_interval.tv_sec = (timeout >= 1000) ? timeout / 1000 : 0; + timing.it_interval.tv_nsec = (timeout - (timing.it_interval.tv_sec * 1000)) * 1000000; + + ret = clock_gettime(CLOCK_MONOTONIC, &timing.it_value); + if (ret < 0) + { + fprintf(stderr, "Could not get current time: %s", strerror(errno)); + + close(fd); + return -1; + } + + timing.it_value.tv_sec += timing.it_interval.tv_sec; + timing.it_value.tv_nsec += timing.it_interval.tv_nsec; + if (timing.it_value.tv_nsec > 1000000000) + { + timing.it_value.tv_sec++; + timing.it_value.tv_nsec -= 1000000000; + } + + ret = timerfd_settime(fd, TFD_TIMER_ABSTIME, &timing, NULL); + if (ret < 0) + { + fprintf(stderr, "Could not setup timer: %s", strerror(errno)); + + close(fd); + return -1; + } + + return fd; +} + + +int running; + +void +sig_int_term_handler(int signo) +{ + running = 0; +} + +void +sig_chld_handler(int signo) +{ + int ret; + + do + { + ret = waitpid(-1, NULL, WNOHANG); + } + while (ret > 0); +} + +int +main(int argc, char **argv) +{ + int i; + + signal(SIGINT, sig_int_term_handler); + signal(SIGTERM, sig_int_term_handler); + signal(SIGCHLD, sig_chld_handler); + + ProgName = argv[0]; + if (strlen(ProgName) >= 5) + ProgName += (strlen(ProgName) - 5); + + /* Parse Command Line */ + for (i = 1; i < argc; i++) + { + char *arg = argv[i]; + + if (*arg == '-') + { + switch (arg[1]) + { + case 'd': + if (strcmp(arg+1, "display")) + { + usage(); + exit(1); + } + break; + + case 'g': + if (strcmp(arg+1, "geometry")) + { + usage(); + exit(1); + } + break; + + case 'v': + printversion(); + exit(0); + break; + + default: + usage(); + exit(0); + break; + } + } + } + + wmmbp_dbus_init(); + + createXBMfromXPM(wmmbp_mask_bits, wmmbp_master_xpm, wmmbp_mask_width, wmmbp_mask_height); + + openXwindow(argc, argv, wmmbp_master_xpm, wmmbp_mask_bits, wmmbp_mask_width, wmmbp_mask_height); + + wmmbp_routine(argc, argv); + + mbp_dbus_cleanup(); + + return 0; +} + +/* + * Main loop + */ +void +wmmbp_routine(int argc, char **argv) +{ + int nfds; + struct pollfd fds[2]; + + int t_fd; + uint64_t ticks; + + int ret; + + XEvent Event; + + /* X */ + fds[0].fd = x_fd; + fds[0].events = POLLIN; + nfds = 1; + + /* DBus */ + if (conn != NULL) + { + if (dbus_connection_get_unix_fd(conn, &fds[1].fd)) + nfds = 2; + } + fds[1].events = POLLIN; + + t_fd = -1; + + wmmbp_get_values(); + + RedrawWindow(); + + running = 1; + while (running) + { + if ((conn == NULL) && (t_fd == -1)) + { + /* setup reconnect timer */ + t_fd = mbp_create_timer(200); + + if (t_fd != -1) + { + fds[1].fd = t_fd; + nfds = 2; + } + else + nfds = 1; + + fds[1].revents = 0; + } + + ret = poll(fds, nfds, -1); + + if (ret < 0) + continue; + + /* DBus */ + if ((nfds == 2) && (fds[1].revents != 0)) + { + /* reconnection */ + if (conn == NULL) + { + /* handle timer & reconnect, fd */ + read(fds[1].fd, &ticks, sizeof(ticks)); + + if (wmmbp_dbus_init() == 0) + { + close(t_fd); + t_fd = -1; + + if (!dbus_connection_get_unix_fd(conn, &fds[1].fd)) + { + fds[1].fd = -1; + nfds = 1; + } + } + } + else /* events */ + { + mbp_dbus_listen(); + } + } + + if ((mbpdisplay & DISPLAY_TYPE_NO_DATA) && (conn != NULL)) + wmmbp_get_values(); + + /* X Events */ + if (fds[0].revents != 0) + { + while (XPending(display)) + { + XNextEvent(display, &Event); + switch (Event.type) + { + case Expose: + mbpdisplay |= DISPLAY_FLAG_UPDATE; + break; + + case DestroyNotify: + XCloseDisplay(display); + return; + + case ButtonPress: + if (DISPLAY_TYPE(mbpdisplay) > DISPLAY_TYPE_NO_DATA) + { + switch (DISPLAY_TYPE(mbpdisplay)) + { + case DISPLAY_TYPE_MACBOOK: + mbpdisplay = DISPLAY_FLAG_UPDATE | DISPLAY_TYPE_AMBIENT; + break; + + case DISPLAY_TYPE_AMBIENT: + mbpdisplay = DISPLAY_FLAG_UPDATE | DISPLAY_TYPE_MACBOOK; + break; + } + } + break; + } + } + } + + /* Update display */ + if (mbpdisplay & DISPLAY_FLAG_UPDATE) + { + DisplayMBPStatus(); + RedrawWindow(); + } + } +} + +/* + * Blits a string at given co-ordinates + */ +void +BlitString(char *name, int x, int y) +{ + int i; + int c; + int k; + + k = x; + for (i=0; name[i]; i++) + { + + c = toupper(name[i]); + /* A letter */ + if (c >= 'A' && c <= 'Z') + { + c -= 'A'; + copyXPMArea(c * 6, 74, 6, 8, k, y); + k += 6; + } + /* A number or symbol */ + else if (c>='0' && c<='9') + { + c -= '0'; + copyXPMArea(c * 6, 64, 6, 8, k, y); + k += 6; + } + else + { + copyXPMArea(5, 84, 6, 8, k, y); + k += 6; + } + } +} + +void +BlitNum(int num, int x, int y) +{ + char buf[1024]; + + sprintf(buf, "%03i", num); + + BlitString(buf, x, y); +} + +void +usage(void) +{ + fprintf(stderr, "wmpomme v" WMPOMME_VERSION "\n"); + fprintf(stderr, "Copyright (C) 2006-2008 Julien BLACHE \n"); + fprintf(stderr, "Based on wmwave by Carsten Schuermann \n\n"); + fprintf(stderr, "Usage:\n"); + fprintf(stderr, "\t-display \n"); +} + +void +printversion(void) +{ + fprintf(stderr, "wmpomme v%s\n", WMPOMME_VERSION); + fprintf(stderr, "Copyright (C) 2006-2008 Julien BLACHE \n"); +} -- cgit v1.2.3