From b96b32af8fd81a4564e967babaaf5c9b21c61c3a Mon Sep 17 00:00:00 2001 From: Sanel Zukan Date: Fri, 9 Oct 2009 16:07:21 +0000 Subject: [PATCH] Unused code --- ekeyconf/Jamfile | 16 -- ekeyconf/Shortcut_Button.cpp | 54 ------- ekeyconf/Shortcut_Button.h | 43 ------ ekeyconf/ekeyconf.cpp | 154 ------------------- ekeyconf/ekeyconf.fl | 135 ----------------- ekeyconf/ekeyconf.h | 19 --- ekeyconf/ekeys.cpp | 285 ----------------------------------- ekeyconf/ekeys.h | 36 ----- ekeyconf/locale/messages.pot | 55 ------- 9 files changed, 797 deletions(-) delete mode 100644 ekeyconf/Jamfile delete mode 100644 ekeyconf/Shortcut_Button.cpp delete mode 100644 ekeyconf/Shortcut_Button.h delete mode 100644 ekeyconf/ekeyconf.cpp delete mode 100644 ekeyconf/ekeyconf.fl delete mode 100644 ekeyconf/ekeyconf.h delete mode 100644 ekeyconf/ekeys.cpp delete mode 100644 ekeyconf/ekeys.h delete mode 100644 ekeyconf/locale/messages.pot diff --git a/ekeyconf/Jamfile b/ekeyconf/Jamfile deleted file mode 100644 index 8eda0f0..0000000 --- a/ekeyconf/Jamfile +++ /dev/null @@ -1,16 +0,0 @@ -# -# $Id$ -# -# Part of Equinox Desktop Environment (EDE). -# Copyright (c) 2000-2007 EDE Authors. -# -# This program is licenced under terms of the -# GNU General Public Licence version 2 or newer. -# See COPYING for details. - -SubDir TOP ekeyconf ; - -SOURCE = ekeys.cpp ekeyconf.cpp Shortcut_Button.cpp ; - -MakeProgram ekeyconf : $(SOURCE) ; -ExtractStrings locale : $(SOURCE) ; diff --git a/ekeyconf/Shortcut_Button.cpp b/ekeyconf/Shortcut_Button.cpp deleted file mode 100644 index 4530e77..0000000 --- a/ekeyconf/Shortcut_Button.cpp +++ /dev/null @@ -1,54 +0,0 @@ -// -- copyied over from fluid (Fl_Menu_Type.cpp) -// This program is licenced under terms of the -// GNU General Public Licence version 2 or newer. -// See COPYING for details. - -#include "Shortcut_Button.h" - -#include //#include -#include //#include -//#include -#include - - -void Shortcut_Button::draw() { - label(fltk::key_name(svalue)); - color(value() ? default_style->selection_color() : default_style->color()); - textcolor(value() ? default_style->selection_textcolor() : default_style->textcolor()); -#ifdef _WIN32 - Button::draw(); -#else - fltk::Button::draw(); -#endif -} - - -#include -int Shortcut_Button::handle(int e) { - when(0); type(TOGGLE); - if (e == fltk::KEY) { - if (!value()) return 0; - int v = fltk::event_text()[0]; - if (v > 32 && v < 0x7f || v > 0xa0 && v <= 0xff) { - v = v | fltk::event_state()&(fltk::META|fltk::ALT|fltk::CTRL); - } else { - v = fltk::event_state()&(fltk::META|fltk::ALT|fltk::CTRL|fltk::SHIFT) | fltk::event_key(); - if (v == fltk::BackSpaceKey && svalue) v = 0; - } - if (v != svalue) {svalue = v; do_callback(); redraw();} - return 1; - } else if (e == fltk::UNFOCUS) { - int c = changed(); value(0); if (c) set_changed(); - return 1; - } else if (e == fltk::FOCUS) { - return value(); - } else { -#ifdef _WIN32 - int r = Button::handle(e); -#else - int r = fltk::Button::handle(e); -#endif - if (e == fltk::RELEASE && value() && fltk::focus() != this) take_focus(); - return r; - } -} diff --git a/ekeyconf/Shortcut_Button.h b/ekeyconf/Shortcut_Button.h deleted file mode 100644 index 4ee9f13..0000000 --- a/ekeyconf/Shortcut_Button.h +++ /dev/null @@ -1,43 +0,0 @@ -// -// "$Id: Shortcut_Button.h 4886 2006-03-30 09:55:32Z fabien $" -// -// Shortcut header file for the Fast Light Tool Kit (FLTK). -// -// Copyright 1998-2006 by Bill Spitzak and others. -// -// This library is free software; you can redistribute it and/or -// modify it under the terms of the GNU Library General Public -// License as published by the Free Software Foundation; either -// version 2 of the License, or (at your option) any later version. -// -// This library 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 -// Library General Public License for more details. -// -// You should have received a copy of the GNU Library General Public -// License along with this library; if not, write to the Free Software -// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 -// USA. -// -// Please report all bugs and problems to "fltk-bugs@fltk.org". -// - -#ifndef Shortcut_Button_H -#define Shortcut_Button_H - -#include - -class Shortcut_Button : public fltk::Button { -public: - int svalue; - int handle(int); - void draw(); - Shortcut_Button(int x, int y, int w, int h, const char* l = 0) : - fltk::Button(x,y,w,h,l) {svalue = 0;} -}; - -// -// End of "$Id: Shortcut_Button.h 4886 2006-03-30 09:55:32Z fabien $". -// -#endif diff --git a/ekeyconf/ekeyconf.cpp b/ekeyconf/ekeyconf.cpp deleted file mode 100644 index 226a5b5..0000000 --- a/ekeyconf/ekeyconf.cpp +++ /dev/null @@ -1,154 +0,0 @@ -// generated by Fast Light User Interface Designer (fluid) version 2.0100 - -#include "ekeyconf.h" -/* - * $Id$ - * - * Keyboard shortcuts applet - * Part of Equinox Desktop Environment (EDE). - * Copyright (c) 2005-2006 EDE Authors. - * - * This program is licenced under terms of the - * GNU General Public Licence version 2 or newer. - * See COPYING for details. - */ -#include "../edelib2/NLS.h" -#include "../edeconf.h" -#include "ekeys.h" - -fltk::Window *iconsConfWindow=(fltk::Window *)0; - -static void cb_OK(fltk::Button*, void*) { - writeKeysConfiguration(); - sendUpdateInfo(); - exit(0); -} - -static void cb_Cancel(fltk::Button*, void*) { - exit(0); -} - -static void cb_Apply(fltk::Button*, void*) { - writeKeysConfiguration(); - sendUpdateInfo(); -} - -Shortcut_Button *shortcut=(Shortcut_Button *)0; - -static void cb_shortcut(Shortcut_Button*, void*) { - setshortcutfor(action->text(),shortcut->svalue); -} - -fltk::InputBrowser *action=(fltk::InputBrowser *)0; - -static void cb_action(fltk::InputBrowser*, void*) { - shortcut->svalue = getshortcutfor(action->text()); - shortcut->redraw(); -} - -static void cb_New(fltk::Button*, void*) { - newShortcutWindow->show(); -} - -static void cb_Remove(fltk::Button*, void*) { - removeShortcut(action->text()); - populatelist(action); - action->text(action->child(0)->label()); - action->do_callback(); -} - -fltk::Window *newShortcutWindow=(fltk::Window *)0; - -fltk::Input *shortcutName=(fltk::Input *)0; - -fltk::Input *shortcutCommand=(fltk::Input *)0; - -static void cb_Ok(fltk::Button*, void*) { - addShortcut(shortcutName->value(),shortcutCommand->value()); - populatelist(action); - action->text(shortcutName->value()); - action->do_callback(); - newShortcutWindow->hide(); -} - -static void cb_Cancel1(fltk::Button*, void*) { - newShortcutWindow->hide(); -} - -#include - -int main (int argc, char **argv) { - - fltk::Window* w; - //fl_init_locale_support("ekeyconf", PREFIX"/share/locale"); - readKeysConfiguration(); - {fltk::Window* o = iconsConfWindow = new fltk::Window(275, 265, "Keyboard settings"); - o->begin(); - {fltk::Button* o = new fltk::Button(20, 237, 80, 25, "&OK"); - o->callback((fltk::Callback*)cb_OK); - } - {fltk::Button* o = new fltk::Button(190, 237, 80, 24, "&Cancel"); - o->callback((fltk::Callback*)cb_Cancel); - } - {fltk::Button* o = new fltk::Button(105, 237, 80, 24, "&Apply"); - o->callback((fltk::Callback*)cb_Apply); - } - {fltk::TabGroup* o = new fltk::TabGroup(1, 5, 267, 226); - o->color((fltk::Color)0xfffffffe); - o->begin(); - {fltk::Group* o = new fltk::Group(0, 23, 263, 200, "Shortcuts"); - o->align(fltk::ALIGN_TOP|fltk::ALIGN_LEFT); - o->begin(); - {fltk::InvisibleBox* o = new fltk::InvisibleBox(20, 52, 140, 20, "Keyboard shortcut:"); - o->align(fltk::ALIGN_LEFT|fltk::ALIGN_INSIDE); - } - {Shortcut_Button* o = shortcut = new Shortcut_Button(20, 72, 140, 20, "Keyboard shortcut:"); - o->color((fltk::Color)7); - o->callback((fltk::Callback*)cb_shortcut); - o->align(fltk::ALIGN_LEFT|fltk::ALIGN_INSIDE); - o->tooltip("To set a shortcut:\n Click here, then type the key combination you want.\nT\ -o delete the shortcut:\n Click here, then type backspace.\nTo get out of sho\ -rtcut-setting mode:\n Click the mouse on this again, or on some other field."); - } - {fltk::InputBrowser* o = action = new fltk::InputBrowser(20, 26, 165, 21, "Action:"); - o->callback((fltk::Callback*)cb_action); - o->align(fltk::ALIGN_TOP|fltk::ALIGN_LEFT); - action->text("Next window"); - } - {fltk::Button* o = new fltk::Button(20, 127, 110, 25, "&New shortcut..."); - o->callback((fltk::Callback*)cb_New); - } - {fltk::Button* o = new fltk::Button(140, 127, 110, 25, "&Remove shortcut"); - o->callback((fltk::Callback*)cb_Remove); - } - o->end(); - } - o->end(); - } - o->end(); - o->resizable(o); - } - {fltk::Window* o = newShortcutWindow = new fltk::Window(285, 114, "Define new shortcut"); - w = o; - o->begin(); - shortcutName = new fltk::Input(104, 15, 170, 24, "&Shortcut name:"); - shortcutCommand = new fltk::Input(104, 49, 170, 24, "C&ommand"); - {fltk::Button* o = new fltk::Button(49, 83, 88, 24, "&Ok"); - o->callback((fltk::Callback*)cb_Ok); - } - {fltk::Button* o = new fltk::Button(158, 83, 88, 24, "&Cancel"); - o->callback((fltk::Callback*)cb_Cancel1); - } - o->end(); - o->set_modal(); - o->resizable(o); - } - populatelist(action); - shortcut->svalue = getshortcutfor("Next window"); - shortcut->redraw(); - - // Grab all keyboard events from window manager - iconsConfWindow->show(argc, argv); - XGrabKey(fltk::xdisplay, AnyKey, AnyModifier, fltk::xid(iconsConfWindow), true, GrabModeAsync, GrabModeAsync); - return fltk::run(); -} diff --git a/ekeyconf/ekeyconf.fl b/ekeyconf/ekeyconf.fl deleted file mode 100644 index b65d58f..0000000 --- a/ekeyconf/ekeyconf.fl +++ /dev/null @@ -1,135 +0,0 @@ -# data file for the FLTK User Interface Designer (FLUID) -version 2.0100 -images_dir ./ -header_name {.h} -code_name {.cpp} -gridx 5 -gridy 5 -snap 3 -decl {/* - * $Id$ - * - * Keyboard shortcuts applet - * Part of Equinox Desktop Environment (EDE). - * Copyright (c) 2005-2006 EDE Authors. - * - * This program is licenced under terms of the - * GNU General Public Licence version 2 or newer. - * See COPYING for details. - */} {} - -decl {\#include "../edelib2/NLS.h"} {} - -decl {\#include "../edeconf.h"} {} - -decl {\#include "Shortcut_Button.h"} {public -} - -decl {\#include "ekeys.h"} {} - -Function {} {open -} { - code {//fl_init_locale_support("ekeyconf", PREFIX"/share/locale"); -readKeysConfiguration();} {} - {fltk::Window} iconsConfWindow { - label {Keyboard settings} open - xywh {471 199 275 265} resizable visible - } { - {fltk::Button} {} { - label {&OK} - callback {writeKeysConfiguration(); -sendUpdateInfo(); -exit(0);} - xywh {20 237 80 25} - } - {fltk::Button} {} { - label {&Cancel} - callback {exit(0);} - xywh {190 237 80 24} - } - {fltk::Button} {} { - label {&Apply} - callback {writeKeysConfiguration(); -sendUpdateInfo();} - xywh {105 237 80 24} - } - {fltk::TabGroup} {} {open - xywh {1 5 267 226} color 0xfffffffe - } { - {fltk::Group} {} { - label Shortcuts open - xywh {0 23 263 200} align 5 - } { - {fltk::InvisibleBox} {} { - label {Keyboard shortcut:} - xywh {20 52 140 20} align 36 - } - {fltk::Button} shortcut { - label {Keyboard shortcut:} - callback {setshortcutfor(action->text(),shortcut->svalue);} selected - tooltip {To set a shortcut: - Click here, then type the key combination you want. -To delete the shortcut: - Click here, then type backspace. -To get out of shortcut-setting mode: - Click the mouse on this again, or on some other field.} - xywh {20 72 140 20} align 36 color 7 - class Shortcut_Button - } - {fltk::InputBrowser} action { - label {Action:} - callback {shortcut->svalue = getshortcutfor(action->text()); -shortcut->redraw();} - xywh {20 26 165 21} align 5 - extra_code {action->text("Next window");} - } {} - {fltk::Button} {} { - label {&New shortcut...} - callback {newShortcutWindow->show();} - xywh {20 127 110 25} - } - {fltk::Button} {} { - label {&Remove shortcut} - callback {removeShortcut(action->text()); -populatelist(action); -action->text(action->child(0)->label()); -action->do_callback();} - xywh {140 127 110 25} - } - } - } - } - {fltk::Window} newShortcutWindow { - label {Define new shortcut} open - xywh {601 395 285 114} hide resizable modal - } { - {fltk::Input} shortcutName { - label {&Shortcut name:} - xywh {104 15 170 24} - } - {fltk::Input} shortcutCommand { - label {C&ommand} - xywh {104 49 170 24} - } - {fltk::Button} {} { - label {&Ok} - callback {addShortcut(shortcutName->value(),shortcutCommand->value()); -populatelist(action); -action->text(shortcutName->value()); -action->do_callback(); -newShortcutWindow->hide();} - xywh {49 83 88 24} - } - {fltk::Button} {} { - label {&Cancel} - callback {newShortcutWindow->hide();} - xywh {158 83 88 24} - } - } - code {populatelist(action); -shortcut->svalue = getshortcutfor("Next window"); -shortcut->redraw(); - -// Grab all keyboard events from window manager -XGrabKey(fltk::xdisplay, AnyKey, AnyModifier, fltk::xid(w), true, GrabModeAsync, GrabModeAsync);} {} -} diff --git a/ekeyconf/ekeyconf.h b/ekeyconf/ekeyconf.h deleted file mode 100644 index 2a24c4e..0000000 --- a/ekeyconf/ekeyconf.h +++ /dev/null @@ -1,19 +0,0 @@ -// generated by Fast Light User Interface Designer (fluid) version 2.0100 - -#ifndef ekeyconf_h -#define ekeyconf_h -#include "Shortcut_Button.h" -#include -extern fltk::Window* iconsConfWindow; -#include -#include -#include -#include -extern Shortcut_Button* shortcut; -#include -extern fltk::InputBrowser* action; -extern fltk::Window* newShortcutWindow; -#include -extern fltk::Input* shortcutName; -extern fltk::Input* shortcutCommand; -#endif diff --git a/ekeyconf/ekeys.cpp b/ekeyconf/ekeys.cpp deleted file mode 100644 index 059baca..0000000 --- a/ekeyconf/ekeys.cpp +++ /dev/null @@ -1,285 +0,0 @@ -/* - * $Id$ - * - * Keyboard shortcuts applet - * Part of Equinox Desktop Environment (EDE). - * Copyright (c) 2005-2006 EDE Authors. - * - * This program is licenced under terms of the - * GNU General Public Licence version 2 or newer. - * See COPYING for details. - */ - -#include "ekeys.h" - - -using namespace fltk; -using namespace edelib; - - -#define NR_HOTKEYS 30 - - -static struct { - char systemname[20]; - char uiname[50]; - char command[50]; -} hotkeys[] = { - {"NextWindow", "Next window", ""}, - {"PreviousWindow", "Previous window", ""}, - {"NextDesktop", "Next workspace", ""}, - {"PreviousDesktop", "Previous workspace", ""}, - {"FastRun", "Run program", ""}, - {"FindUtil", "Find file", ""}, - {"CloseWindow", "Close window", ""}, - {"MinimizeWindow", "Minimize window", ""}, - {"MaximizeWindow", "Maximize window", ""}, - {"Desktop1", "Workspace 1", ""}, - {"Desktop2", "Workspace 2", ""}, - {"Desktop3", "Workspace 3", ""}, - {"Desktop4", "Workspace 4", ""}, - {"Desktop5", "Workspace 5", ""}, - {"Desktop6", "Workspace 6", ""}, - {"Desktop7", "Workspace 7", ""}, - {"Desktop8", "Workspace 8", ""}, - {"App1", "", ""}, - {"App2", "", ""}, - {"App3", "", ""}, - {"App4", "", ""}, - {"App5", "", ""}, - {"App6", "", ""}, - {"App7", "", ""}, - {"App8", "", ""}, - {"App9", "", ""}, - {"App10", "", ""}, - {"App11", "", ""}, - {"App12", "", ""}, - -}; - - - -int keycodes[NR_HOTKEYS]; - - - - -static void sendClientMessage(XWindow w, Atom a, long x) -{ - XEvent ev; - long mask; - - memset(&ev, 0, sizeof(ev)); - ev.xclient.type = ClientMessage; - ev.xclient.window = w; - ev.xclient.message_type = a; - ev.xclient.format = 32; - ev.xclient.data.l[0] = x; - ev.xclient.data.l[1] = CurrentTime; - mask = 0L; - if (w == RootWindow(xdisplay, xscreen)) - mask = SubstructureRedirectMask; - XSendEvent(xdisplay, w, False, mask, &ev); -} - -void sendUpdateInfo() -{ -// No worky -/* unsigned int i, nrootwins; - XWindow dw1, dw2, *rootwins = 0; - int screen_count = ScreenCount(fltk::xdisplay); - extern Atom FLTKChangeSettings; - for (int s = 0; s < screen_count; s++) { - XWindow root = RootWindow(fltk::xdisplay, s); - XQueryTree(fltk::xdisplay, root, &dw1, &dw2, &rootwins, &nrootwins); - for (i = 0; i < nrootwins; i++) { - if (rootwins[i]!=RootWindow(fltk::xdisplay, fltk::xscreen)) { - sendClientMessage(rootwins[i], FLTKChangeSettings, 0); - } - } - } - XFlush(fltk::xdisplay);*/ -} - -int getshortcutfor(const char* action) -{ - for (int i=0; i= 'a') && (key[0] <= 'z')) { - parsed += key[0]; - } else if ((key[0] >= 'A') && (key[0] <= 'Z')) { - parsed += (key[0] - 'A' + 'a'); - } - } - } - - return parsed; -} - -void readKeysConfiguration() -{ - Config globalConfig(Config::find_file("wmanager.conf", 0), true, false); - globalConfig.set_section("Hotkeys"); - - for (int i=0; i0 && tmp != "") strncpy(hotkeys[i].uiname, hotkeys[i].systemname, 20); - } - } - - globalConfig.set_section("ApplicationNames"); - for (int i=0; iclear(); // Rewrite? - for (int i=0; iadd ( hotkeys[i].uiname); -} - -void addShortcut(const char *name, const char *cmd) -{ - if ((strcmp(name,"") !=0) && (strcmp(cmd,"") != 0)) { - for (int i=0; i -#include //#include -#include //#include -//#include -#include //#include -#include "../edelib2/Config.h" //#include -#include "../edelib2/NLS.h" //#include -#include //#include - - -int getshortcutfor(const char*); -void setshortcutfor(const char*, int); -void readKeysConfiguration(); -void writeKeysConfiguration(); -void sendUpdateInfo(); -void populatelist(fltk::InputBrowser *); -void addShortcut(const char*,const char*); -void removeShortcut(const char*); - -#endif - diff --git a/ekeyconf/locale/messages.pot b/ekeyconf/locale/messages.pot deleted file mode 100644 index 131dfcc..0000000 --- a/ekeyconf/locale/messages.pot +++ /dev/null @@ -1,55 +0,0 @@ -# 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: 2005-04-03 13:14+0200\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" - -#: ekeyconf.cpp:47 -msgid "Keyboard settings" -msgstr "" - -#: ekeyconf.cpp:50 -msgid "&OK" -msgstr "" - -#: ekeyconf.cpp:53 -msgid "&Cancel" -msgstr "" - -#: ekeyconf.cpp:56 -msgid "&Apply" -msgstr "" - -#: ekeyconf.cpp:61 -msgid "Shortcuts" -msgstr "" - -#: ekeyconf.cpp:63 -msgid "Keyboard shortcut:" -msgstr "" - -#: ekeyconf.cpp:68 -msgid "" -"To set a shortcut:\n" -" Click here, then type the key combination you want.\n" -"To delete the shortcut:\n" -" Click here, then type backspace.\n" -"To get out of shortcut-setting mode:\n" -" Click the mouse on this again, or on some other field." -msgstr "" - -#: ekeyconf.cpp:72 -msgid "Action:" -msgstr ""