Importing EDE2 code to svn... NOTE: It doesn't compile! Stuff thats broken: edewm, eworkpanel, eiconman,

emenueditor
This commit is contained in:
Vedran Ljubovic
2006-08-20 18:43:09 +00:00
commit 65018f75b7
1004 changed files with 88271 additions and 0 deletions

22
epanelconf/Makefile Executable file
View File

@@ -0,0 +1,22 @@
CPPFILES = epanelconf.cpp util.cpp ../edelib2/Util.cpp ../edelib2/Config.cpp
TARGET = epanelconf
POFILES = locale/ru.po\
locale/sr.po\
locale/sk.po\
locale/hu.po\
include ../makeinclude
install:
$(INSTALL_PROGRAM) $(TARGET) $(bindir)
$(INSTALL_LOCALE)
uninstall:
$(RM) $(bindir)/$(TARGET)
clean:
$(RM) $(TARGET)
$(RM) *.o

253
epanelconf/epanelconf.cpp Executable file
View File

@@ -0,0 +1,253 @@
/*
* $Id$
*
* Configure window for eworkpanel
* Part of Equinox Desktop Environment (EDE).
* Copyright (c) 2000-2006 EDE Authors.
*
* This program is licenced under terms of the
* GNU General Public Licence version 2 or newer.
* See COPYING for details.
*/
#include "epanelconf.h"
#include "util.h"
#include <fltk/run.h>
#include <stdlib.h>
using namespace fltk;
// Widgets accessed from util.cpp
Input *workspaces[8];
Input* vcProgram;
Input* tdProgram;
Input* browserProgram;
Input* terminalProgram;
CheckButton* autohide_check;
ValueSlider* ws_slider;
Window* panelWindow;
// Callbacks
static void cb_Apply(Button*, void*) {
write_config();
send_workspaces();
}
static void cb_Close(Button*, void*) {
exit(0);
}
static void cb_Browse(Button*, void*) {
// char *file_types = _("Executables (*.*), *, All files (*.*), *");
// const char *fileName = fl_select_file(0, file_types, _("File selection..."));
const char *fileName = file_chooser(_("Choose volume control program"), "*.*", vcProgram->value());
if (fileName)
vcProgram->value(fileName);
}
static void cb_Br(Button*, void*) {
// char *file_types = _("Executables (*.*), *, All files (*.*), *");
// const char *fileName = fl_select_file(0, file_types, _("File selection..."));
const char *fileName = file_chooser(_("Choose time&date program"), "*.*", tdProgram->value());
if (fileName)
tdProgram->value(fileName);
}
static void cb_Browse1(Button*, void*) {
// char *file_types = _("Executables (*.*), *, All files (*.*), *");
// const char *fileName = fl_select_file(0, file_types, _("File selection..."));
const char *fileName = file_chooser(_("Choose web browser program"), "*.*", browserProgram->value());
if (fileName)
browserProgram->value(fileName);
}
static void cb_Br1(Button*, void*) {
// char *file_types = _("Executables (*.*), *, All files (*.*), *");
// const char *fileName = fl_select_file(0, file_types, _("File selection..."));
const char *fileName = file_chooser(_("Choose file manager program"), "*.*", terminalProgram->value());
if (fileName)
terminalProgram->value(fileName);
}
static void cb_ws_slider(ValueSlider*, void*) {
int val = int(ws_slider->value());
for(int n=0; n<8; n++) {
if(n<val)
workspaces[n]->activate();
else
workspaces[n]->deactivate();
}
}
// Main window
int main (int argc, char **argv)
{
Window* w;
//fl_init_locale_support("epanelconf", PREFIX"/share/locale");
{
Window* o = panelWindow = new Window(405, 270, _("Panel settings"));
w = o;
o->begin();
{
Button* o = new Button(205, 235, 90, 25, _("&Apply"));
o->callback((Callback*)cb_Apply);
}
{
Button* o = new Button(305, 235, 90, 25, _("&Close"));
o->callback((Callback*)cb_Close);
}
{
TabGroup* o = new TabGroup(10, 10, 385, 215);
o->selection_color(o->color());
o->selection_textcolor(o->textcolor());
o->begin();
{
Group* o = new Group(0, 25, 385, 190, _("Utilities"));
o->begin();
{
Group* o = new Group(10, 20, 365, 100, "Panel utilities");
o->box(ENGRAVED_BOX);
o->align(ALIGN_TOP|ALIGN_LEFT);
o->begin();
{
Input* o = vcProgram = new Input(10, 20, 245, 25, _("Volume control program:"));
o->align(ALIGN_TOP|ALIGN_LEFT);
}
{
Button* o = new Button(265, 20, 90, 25, _("&Browse..."));
o->callback((Callback*)cb_Browse);
}
{
Input* o = tdProgram = new Input(10, 65, 245, 25, _("Time and date program:"));
o->align(ALIGN_TOP|ALIGN_LEFT);
}
{
Button* o = new Button(265, 65, 90, 25, _("Br&owse..."));
o->callback((Callback*)cb_Br);
}
o->end();
}
{
Group* o = new Group(10, 140, 365, 35, _("Autohide"));
o->box(ENGRAVED_BOX);
o->align(ALIGN_TOP|ALIGN_LEFT);
o->begin();
autohide_check = new CheckButton(10, 5, 345, 25, _("Automaticaly hide panel"));
o->end();
}
o->end();
}
{
Group* o = new Group(0, 25, 385, 190, _("Workspaces"));
o->hide();
o->begin();
{
ValueSlider* o = ws_slider = new ValueSlider(120, 10, 255, 25, _("Number of workspaces: "));
o->type(ValueSlider::TICK_BELOW);
o->box(THIN_DOWN_BOX);
o->buttonbox(THIN_UP_BOX);
o->step(1);
o->callback((Callback*)cb_ws_slider);
o->align(ALIGN_LEFT|ALIGN_WRAP);
o->step(1); ;
o->range(1,8);
}
{
Group* o = new Group(10, 60, 370, 120, _("Workspace names:"));
o->box(ENGRAVED_BOX);
o->align(ALIGN_TOP|ALIGN_LEFT);
o->begin();
{
Input* o = new Input(50, 5, 115, 20, _("WS 1:"));
o->deactivate();
workspaces[0] = o; ;
}
{
Input* o = new Input(50, 35, 115, 20, _("WS 2:"));
o->deactivate();
workspaces[1] = o; ;
}
{
Input* o = new Input(50, 65, 115, 20, _("WS 3:"));
o->deactivate();
workspaces[2] = o; ;
}
{
Input* o = new Input(50, 95, 115, 20, _("WS 4:"));
o->deactivate();
workspaces[3] = o; ;
}
{
Input* o = new Input(250, 5, 115, 20, _("WS 5:"));
o->deactivate();
workspaces[4] = o; ;
}
{
Input* o = new Input(250, 35, 115, 20, _("WS 6:"));
o->deactivate();
workspaces[5] = o; ;
}
{
Input* o = new Input(250, 65, 115, 20, _("WS 7:"));
o->deactivate();
workspaces[6] = o; ;
}
{
Input* o = new Input(250, 95, 115, 20, _("WS 8:"));
o->deactivate();
workspaces[7] = o; ;
}
o->end();
}
o->end();
}
{
Group* o = new Group(0, 25, 385, 190, _("Handlers"));
o->hide();
o->begin();
{
Group* o = new Group(10, 20, 365, 110, _("Handlers programs"));
o->box(ENGRAVED_BOX);
o->align(ALIGN_TOP|ALIGN_LEFT);
o->begin();
{
Input* o = browserProgram = new Input(10, 20, 245, 25, _("Internet browser:"));
o->align(ALIGN_TOP|ALIGN_LEFT);
}
{
Button* o = new Button(265, 20, 90, 25, _("&Browse..."));
o->callback((Callback*)cb_Browse1);
}
{
Input* o = terminalProgram = new Input(10, 65, 245, 25, _("Terminal:"));
o->align(ALIGN_TOP|ALIGN_LEFT);
}
{
Button* o = new Button(265, 65, 90, 25, _("Br&owse..."));
o->callback((Callback*)cb_Br1);
}
o->end();
}
o->end();
}
o->end();
} // TabGroup
o->end();
}
read_config();
update_workspaces();
w->show(argc, argv);
return run();
}

189
epanelconf/epanelconf.fl Executable file
View File

@@ -0,0 +1,189 @@
# 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 {// Panel config for EDE is (C) Copyright 2001-2002 by Martin Pekar, this program is provided under the terms of GNU GPL v.2, see file COPYING for more information.} {selected
}
decl {\#include "util.h"} {}
decl {extern fltk::Input *workspaces[8];} {}
Function {} {open
} {
code {//fl_init_locale_support("epanelconf", PREFIX"/share/locale");} {}
{fltk::Window} panelWindow {
label {Panel settings} open
xywh {347 187 405 270} visible
} {
{fltk::Button} {} {
label {&Apply}
callback {write_config();
send_workspaces();}
xywh {205 235 90 25}
}
{fltk::Button} {} {
label {&Close}
callback {Fl::first_window()->hide();}
private xywh {305 235 90 25}
}
{fltk::TabGroup} {} {open
xywh {10 10 385 215}
} {
{fltk::Group} {} {
label Utilities open
xywh {0 25 385 190}
} {
{fltk::Group} {} {
label {Panel utilities} open
xywh {10 20 365 100} align 5 box ENGRAVED_BOX
} {
{fltk::Input} vcProgram {
label {Volume control program:}
xywh {10 20 245 25} align 5
}
{fltk::Button} {} {
label {&Browse...}
callback {char *file_types = _("Executables (*.*), *, All files (*.*), *");
const char *fileName = fl_select_file(0, file_types, _("File selection..."));
if (fileName) {
vcProgram->value(fileName);
}}
private xywh {265 20 90 25}
}
{fltk::Input} tdProgram {
label {Time and date program:}
xywh {10 65 245 25} align 5
}
{fltk::Button} {} {
label {Br&owse...}
callback {char *file_types = _("Executables (*.*), *, All files (*.*), *");
const char *fileName = fl_select_file(0, file_types, _("File selection..."));
if (fileName)
{
tdProgram->value(fileName);
}}
private xywh {265 65 90 25}
}
}
{fltk::Group} {} {
label Autohide open
xywh {10 140 365 35} align 5 box ENGRAVED_BOX
extra_code {;}
} {
{fltk::CheckButton} autohide_check {
label {Automaticaly hide panel}
xywh {10 5 345 25}
}
}
}
{fltk::Group} {} {
label Workspaces open
xywh {0 25 385 190} hide
} {
{fltk::ValueSlider} ws_slider {
label {Number of workspaces: }
callback {int val = int(ws_slider->value());
for(int n=0; n<8; n++) {
if(n<val)
workspaces[n]->activate();
else
workspaces[n]->deactivate();
}}
xywh {120 10 255 25} type TICK_BELOW align 132 box THIN_DOWN_BOX buttonbox THIN_UP_BOX step 1
extra_code {o->step(1); ;
o->range(1,8);}
}
{fltk::Group} {} {
label {Workspace names:} open
xywh {10 60 370 120} align 5 box ENGRAVED_BOX
extra_code {;}
} {
{fltk::Input} {} {
label {WS 1:}
xywh {50 5 115 20} deactivate
extra_code {workspaces[0] = o; ;}
}
{fltk::Input} {} {
label {WS 2:}
xywh {50 35 115 20} deactivate
extra_code {workspaces[1] = o; ;}
}
{fltk::Input} {} {
label {WS 3:}
xywh {50 65 115 20} deactivate
extra_code {workspaces[2] = o; ;}
}
{fltk::Input} {} {
label {WS 4:}
xywh {50 95 115 20} deactivate
extra_code {workspaces[3] = o; ;}
}
{fltk::Input} {} {
label {WS 5:}
xywh {250 5 115 20} deactivate
extra_code {workspaces[4] = o; ;}
}
{fltk::Input} {} {
label {WS 6:}
xywh {250 35 115 20} deactivate
extra_code {workspaces[5] = o; ;}
}
{fltk::Input} {} {
label {WS 7:}
xywh {250 65 115 20} deactivate
extra_code {workspaces[6] = o; ;}
}
{fltk::Input} {} {
label {WS 8:}
xywh {250 95 115 20} deactivate
extra_code {workspaces[7] = o; ;}
}
}
}
{fltk::Group} {} {
label Handlers open
xywh {0 25 385 190} hide
} {
{fltk::Group} {} {
label {Handlers programs} open
xywh {10 20 365 110} align 5 box ENGRAVED_BOX
extra_code {;}
} {
{fltk::Input} browserProgram {
label {Internet browser:}
xywh {10 20 245 25} align 5
}
{fltk::Button} {} {
label {&Browse...}
callback {char *file_types = _("Executables (*.*), *, All files (*.*), *");
const char *fileName = fl_select_file(0, file_types, _("File selection..."));
if (fileName) {
browserProgram->value(fileName);
}}
private xywh {265 20 90 25}
}
{fltk::Input} terminalProgram {
label {Terminal:}
xywh {10 65 245 25} align 5
}
{fltk::Button} {} {
label {Br&owse...}
callback {char *file_types = _("Executables (*.*), *, All files (*.*), *");
const char *fileName = fl_select_file(0, file_types, _("File selection..."));
if (fileName) {
terminalProgram->value(fileName);
}}
private xywh {265 65 90 25}
}
}
}
}
}
code {read_config();} {}
code {update_workspaces();} {}
}

195
epanelconf/epanelconf.fld Executable file
View File

@@ -0,0 +1,195 @@
# data file for the FLTK User Interface Designer (FLUID)
version 2,0003
images_dir ./
i18n
header_name {.h}
code_name {.cpp}
gridx 5
gridy 5
snap 3
decl {// Panel config for EDE is (C) Copyright 2001-2002 by Martin Pekar, this program is provided under the terms of GNU GPL v.2, see file COPYING for more information.} {}
decl {\#include <efltk/Fl_File_Dialog.h>} {}
decl {\#include <efltk/Fl_Config.h>} {}
decl {\#include <efltk/Fl_Locale.h>} {}
decl {\#include "util.h"} {}
decl {extern Fl_Input *workspaces[8];} {}
Function {} {open
} {
code {fl_init_locale_support("epanelconf", PREFIX"/share/locale");} {}
Fl_Window panelWindow {
label {Panel settings} open
xywh {118 179 405 264} hide
} {
Fl_Button {} {
label {&Apply}
callback {write_config();
send_workspaces();}
xywh {237 235 80 25}
}
Fl_Button {} {
label {&Close}
callback {Fl::first_window()->hide();}
private xywh {323 235 80 25}
}
Fl_Tabs {} {open
xywh {0 2 403 230}
} {
Fl_Group {} {
label Utilities open
xywh {0 22 403 208}
} {
Fl_Group {} {
label {Panel utilities} open
xywh {5 20 395 110} align 5 box ENGRAVED_BOX
} {
Fl_Input vcProgram {
label {Volume control program:}
xywh {10 22 285 23} align 5
}
Fl_Button {} {
label {&Browse...}
callback {char *file_types = _("Executables (*.*), *, All files (*.*), *");
const char *fileName = fl_select_file(0, file_types, _("File selection..."));
if (fileName) {
vcProgram->value(fileName);
}} selected
private xywh {305 20 80 25}
}
Fl_Input tdProgram {
label {Time and date program:}
xywh {10 67 285 23} align 5
}
Fl_Button {} {
label {Br&owse...}
callback {char *file_types = _("Executables (*.*), *, All files (*.*), *");
const char *fileName = fl_select_file(0, file_types, _("File selection..."));
if (fileName)
{
tdProgram->value(fileName);
}}
private xywh {305 65 80 25}
}
}
Fl_Group {} {
label Autohide open
xywh {5 150 395 35} align 5 box ENGRAVED_BOX
extra_code {;}
} {
Fl_Check_Button autohide_check {
label {Automaticaly hide panel}
xywh {5 5 385 25}
}
}
}
Fl_Group {} {
label Workspaces open
xywh {0 22 403 208} hide
} {
Fl_Value_Slider ws_slider {
label {Number of workspaces: }
callback {int val = int(ws_slider->value());
for(int n=0; n<8; n++) {
if(n<val)
workspaces[n]->activate();
else
workspaces[n]->deactivate();
}}
xywh {145 10 255 20} type {HORIZONTAL|Fl_Slider::TICK_BELOW} align 132 box THIN_DOWN_BOX button_box THIN_UP_BOX step 1
extra_code {o->step(1); ;
o->range(1,8);}
}
Fl_Group {} {
label {Workspace names:} open
xywh {5 60 395 130} align 5 box ENGRAVED_BOX
extra_code {;}
} {
Fl_Input {} {
label {WS 1:}
xywh {55 10 115 20} deactivate
extra_code {workspaces[0] = o; ;}
}
Fl_Input {} {
label {WS 2:}
xywh {55 40 115 20} deactivate
extra_code {workspaces[1] = o; ;}
}
Fl_Input {} {
label {WS 3:}
xywh {55 70 115 20} deactivate
extra_code {workspaces[2] = o; ;}
}
Fl_Input {} {
label {WS 4:}
xywh {55 100 115 20} deactivate
extra_code {workspaces[3] = o; ;}
}
Fl_Input {} {
label {WS 5:}
xywh {260 10 115 20} deactivate
extra_code {workspaces[4] = o; ;}
}
Fl_Input {} {
label {WS 6:}
xywh {260 40 115 20} deactivate
extra_code {workspaces[5] = o; ;}
}
Fl_Input {} {
label {WS 7:}
xywh {260 70 115 20} deactivate
extra_code {workspaces[6] = o; ;}
}
Fl_Input {} {
label {WS 8:}
xywh {260 100 115 20} deactivate
extra_code {workspaces[7] = o; ;}
}
}
}
Fl_Group {} {
label Handlers open
xywh {0 22 403 208} hide
} {
Fl_Group {} {
label {Handlers programs} open
xywh {5 20 395 110} align 5 box ENGRAVED_BOX
extra_code {;}
} {
Fl_Input browserProgram {
label {Internet browser:}
xywh {10 22 285 23} align 5
}
Fl_Button {} {
label {&Browse...}
callback {char *file_types = _("Executables (*.*), *, All files (*.*), *");
const char *fileName = fl_select_file(0, file_types, _("File selection..."));
if (fileName) {
browserProgram->value(fileName);
}}
private xywh {300 20 80 25}
}
Fl_Input terminalProgram {
label {Terminal:}
xywh {10 67 285 23} align 5
}
Fl_Button {} {
label {Br&owse...}
callback {char *file_types = _("Executables (*.*), *, All files (*.*), *");
const char *fileName = fl_select_file(0, file_types, _("File selection..."));
if (fileName) {
terminalProgram->value(fileName);
}}
private xywh {300 65 80 25}
}
}
}
}
}
code {read_config();} {}
code {update_workspaces();} {}
}

35
epanelconf/epanelconf.h Executable file
View File

@@ -0,0 +1,35 @@
/*
* $Id$
*
* Configure window for eworkpanel
* Part of Equinox Desktop Environment (EDE).
* Copyright (c) 2000-2006 EDE Authors.
*
* This program is licenced under terms of the
* GNU General Public Licence version 2 or newer.
* See COPYING for details.
*/
#ifndef epanelconf_h
#define epanelconf_h
#include <fltk/Window.h>
#include <fltk/Button.h>
#include <fltk/TabGroup.h>
#include <fltk/Group.h>
#include <fltk/Input.h>
#include <fltk/CheckButton.h>
#include <fltk/ValueSlider.h>
#include <fltk/file_chooser.h>
#include "../edelib2/NLS.h"
// Widgets accessed from util.cpp
extern fltk::Input *workspaces[8];
extern fltk::Input* vcProgram;
extern fltk::Input* tdProgram;
extern fltk::Input* browserProgram;
extern fltk::Input* terminalProgram;
extern fltk::CheckButton* autohide_check;
extern fltk::ValueSlider* ws_slider;
#endif

131
epanelconf/locale/hu.po Executable file
View File

@@ -0,0 +1,131 @@
msgid ""
msgstr ""
"Project-Id-Version: \n"
"POT-Creation-Date: \n"
"PO-Revision-Date: 2005-02-09 11:22+0100\n"
"Last-Translator: Nemeth Otto <otto_nemeth@freemail.hu>\n"
"Language-Team: \n"
"MIME-Version: 1.0\n"
"Content-Type: text/plain; charset=utf-8\n"
"Content-Transfer-Encoding: 8bit\n"
#: epanelconf.cpp:25
#: epanelconf.cpp:35
#: epanelconf.cpp:60
#: epanelconf.cpp:70
msgid "Executables (*.*), *, All files (*.*), *"
msgstr "Futtatható fájlok (*.*), *, Minden fájl (*.*), *"
#: epanelconf.cpp:26
#: epanelconf.cpp:36
#: epanelconf.cpp:61
#: epanelconf.cpp:71
msgid "File selection..."
msgstr "Fájl kiválasztása..."
#: epanelconf.cpp:81
msgid "Panel settings"
msgstr "Panel beállítások"
#: epanelconf.cpp:83
msgid "&Apply"
msgstr "&Alkalmaz"
#: epanelconf.cpp:86
msgid "&Close"
msgstr "Be&zár"
#: epanelconf.cpp:90
msgid "Utilities"
msgstr "Alkalmazások"
#: epanelconf.cpp:91
msgid "Panel utilities"
msgstr "Panel alkalmazások"
#: epanelconf.cpp:94
msgid "Volume control program:"
msgstr "Hangerőszabályzó program:"
#: epanelconf.cpp:97
#: epanelconf.cpp:177
msgid "&Browse..."
msgstr "&Tallóz..."
#: epanelconf.cpp:100
msgid "Time and date program:"
msgstr "Dátum/idő program:"
#: epanelconf.cpp:103
#: epanelconf.cpp:183
msgid "Br&owse..."
msgstr "Ta&llóz..."
#: epanelconf.cpp:108
msgid "Autohide"
msgstr "Elrejtés"
#: epanelconf.cpp:111
msgid "Automaticaly hide panel"
msgstr "Panel automatikus elrejtése"
#: epanelconf.cpp:117
msgid "Workspaces"
msgstr "Munkaterületek"
#: epanelconf.cpp:119
msgid "Number of workspaces: "
msgstr "Munkaterületek száma:"
#: epanelconf.cpp:129
msgid "Workspace names:"
msgstr "Munkaterület nevek:"
#: epanelconf.cpp:132
msgid "WS 1:"
msgstr "MT 1:"
#: epanelconf.cpp:136
msgid "WS 2:"
msgstr "MT 2:"
#: epanelconf.cpp:140
msgid "WS 3:"
msgstr "MT 3:"
#: epanelconf.cpp:144
msgid "WS 4:"
msgstr "MT 4:"
#: epanelconf.cpp:148
msgid "WS 5:"
msgstr "MT 5:"
#: epanelconf.cpp:152
msgid "WS 6:"
msgstr "MT 6:"
#: epanelconf.cpp:156
msgid "WS 7:"
msgstr "MT 7:"
#: epanelconf.cpp:160
msgid "WS 8:"
msgstr "MT 8:"
#: epanelconf.cpp:169
msgid "Handlers"
msgstr "Alapértelmezések"
#: epanelconf.cpp:171
msgid "Handlers programs"
msgstr "Alapértelmezett programok"
#: epanelconf.cpp:174
msgid "Internet browser:"
msgstr "Böngésző:"
#: epanelconf.cpp:180
msgid "Terminal:"
msgstr "Terminál:"

126
epanelconf/locale/id.po Executable file
View File

@@ -0,0 +1,126 @@
# SOME DESCRIPTIVE TITLE.
# Copyright (C) YEAR Free Software Foundation, Inc.
# FIRST AUTHOR <EMAIL@ADDRESS>, YEAR.
#
msgid ""
msgstr ""
"Project-Id-Version: epanelconf\n"
"POT-Creation-Date: 2002-10-17 18:15+0000\n"
"PO-Revision-Date: 2002-11-29 15:30+0700\n"
"Last-Translator: Bambang Purnomosidi D. P. <i-am-the-boss@bpdp.org>\n"
"Language-Team: id <i-am-the-boss@bpdp.org>\n"
"MIME-Version: 1.0\n"
"Content-Type: text/plain; charset=iso-8859-2\n"
"Content-Transfer-Encoding: 8bit\n"
#: epanelconf.cpp:25 epanelconf.cpp:35 epanelconf.cpp:60 epanelconf.cpp:70
msgid "Executables (*.*), *, All files (*.*), *"
msgstr "Dapat dieksekusi (*.*), *, Semua file (*.*), *"
#: epanelconf.cpp:26 epanelconf.cpp:36 epanelconf.cpp:61 epanelconf.cpp:71
msgid "File selection..."
msgstr "Pemilihan file"
#: epanelconf.cpp:81
msgid "Panel settings"
msgstr "Seting panel"
#: epanelconf.cpp:83
msgid "&Apply"
msgstr "Ter&apkan"
#: epanelconf.cpp:86
msgid "&Close"
msgstr "&Tutup"
#: epanelconf.cpp:90
msgid "Utilities"
msgstr "Utilitas"
#: epanelconf.cpp:91
msgid "Panel utilities"
msgstr "Utilitas panel"
#: epanelconf.cpp:94
msgid "Volume control program:"
msgstr "Program pengendali volumen"
#: epanelconf.cpp:97 epanelconf.cpp:177
msgid "&Browse..."
msgstr "&Browse..."
#: epanelconf.cpp:100
msgid "Time and date program:"
msgstr "Program jam dan tanggal:"
#: epanelconf.cpp:103 epanelconf.cpp:183
msgid "Br&owse..."
msgstr "Br&owse..."
#: epanelconf.cpp:108
msgid "Autohide"
msgstr "Sembunyikan otomatis"
#: epanelconf.cpp:111
msgid "Automaticaly hide panel"
msgstr "Sembunyikan panel otomatis"
#: epanelconf.cpp:117
msgid "Workspaces"
msgstr "Ruangkerja"
#: epanelconf.cpp:119
msgid "Number of workspaces: "
msgstr "Jumlah ruangkerja:"
#: epanelconf.cpp:129
msgid "Workspace names:"
msgstr "Nama ruangkerja:"
#: epanelconf.cpp:132
msgid "WS 1:"
msgstr "RK 1:"
#: epanelconf.cpp:136
msgid "WS 2:"
msgstr "RK 2:"
#: epanelconf.cpp:140
msgid "WS 3:"
msgstr "RK 3:"
#: epanelconf.cpp:144
msgid "WS 4:"
msgstr "RK 4:"
#: epanelconf.cpp:148
msgid "WS 5:"
msgstr "RK 5:"
#: epanelconf.cpp:152
msgid "WS 6:"
msgstr "RK 6:"
#: epanelconf.cpp:156
msgid "WS 7:"
msgstr "RK 7:"
#: epanelconf.cpp:160
msgid "WS 8:"
msgstr "RK 8:"
#: epanelconf.cpp:169
msgid "Handlers"
msgstr "Handler"
#: epanelconf.cpp:171
msgid "Handlers programs"
msgstr "Program handler"
#: epanelconf.cpp:174
msgid "Internet browser:"
msgstr "Browser internet:"
#: epanelconf.cpp:180
msgid "Terminal:"
msgstr "Terminal:"

127
epanelconf/locale/messages.pot Executable file
View File

@@ -0,0 +1,127 @@
# SOME DESCRIPTIVE TITLE.
# Copyright (C) YEAR Free Software Foundation, Inc.
# FIRST AUTHOR <EMAIL@ADDRESS>, YEAR.
#
#, fuzzy
msgid ""
msgstr ""
"Project-Id-Version: PACKAGE VERSION\n"
"POT-Creation-Date: 2002-10-17 18:15+0000\n"
"PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n"
"Last-Translator: FULL NAME <EMAIL@ADDRESS>\n"
"Language-Team: LANGUAGE <LL@li.org>\n"
"MIME-Version: 1.0\n"
"Content-Type: text/plain; charset=CHARSET\n"
"Content-Transfer-Encoding: 8bit\n"
#: epanelconf.cpp:25 epanelconf.cpp:35 epanelconf.cpp:60 epanelconf.cpp:70
msgid "Executables (*.*), *, All files (*.*), *"
msgstr ""
#: epanelconf.cpp:26 epanelconf.cpp:36 epanelconf.cpp:61 epanelconf.cpp:71
msgid "File selection..."
msgstr ""
#: epanelconf.cpp:81
msgid "Panel settings"
msgstr ""
#: epanelconf.cpp:83
msgid "&Apply"
msgstr ""
#: epanelconf.cpp:86
msgid "&Close"
msgstr ""
#: epanelconf.cpp:90
msgid "Utilities"
msgstr ""
#: epanelconf.cpp:91
msgid "Panel utilities"
msgstr ""
#: epanelconf.cpp:94
msgid "Volume control program:"
msgstr ""
#: epanelconf.cpp:97 epanelconf.cpp:177
msgid "&Browse..."
msgstr ""
#: epanelconf.cpp:100
msgid "Time and date program:"
msgstr ""
#: epanelconf.cpp:103 epanelconf.cpp:183
msgid "Br&owse..."
msgstr ""
#: epanelconf.cpp:108
msgid "Autohide"
msgstr ""
#: epanelconf.cpp:111
msgid "Automaticaly hide panel"
msgstr ""
#: epanelconf.cpp:117
msgid "Workspaces"
msgstr ""
#: epanelconf.cpp:119
msgid "Number of workspaces: "
msgstr ""
#: epanelconf.cpp:129
msgid "Workspace names:"
msgstr ""
#: epanelconf.cpp:132
msgid "WS 1:"
msgstr ""
#: epanelconf.cpp:136
msgid "WS 2:"
msgstr ""
#: epanelconf.cpp:140
msgid "WS 3:"
msgstr ""
#: epanelconf.cpp:144
msgid "WS 4:"
msgstr ""
#: epanelconf.cpp:148
msgid "WS 5:"
msgstr ""
#: epanelconf.cpp:152
msgid "WS 6:"
msgstr ""
#: epanelconf.cpp:156
msgid "WS 7:"
msgstr ""
#: epanelconf.cpp:160
msgid "WS 8:"
msgstr ""
#: epanelconf.cpp:169
msgid "Handlers"
msgstr ""
#: epanelconf.cpp:171
msgid "Handlers programs"
msgstr ""
#: epanelconf.cpp:174
msgid "Internet browser:"
msgstr ""
#: epanelconf.cpp:180
msgid "Terminal:"
msgstr ""

127
epanelconf/locale/ru.po Executable file
View File

@@ -0,0 +1,127 @@
# SOME DESCRIPTIVE TITLE.
# Copyright (C) YEAR Free Software Foundation, Inc.
# FIRST AUTHOR <EMAIL@ADDRESS>, YEAR.
#
#, fuzzy
msgid ""
msgstr ""
"Project-Id-Version: PACKAGE VERSION\n"
"POT-Creation-Date: 2002-04-21 14:09+0200\n"
"PO-Revision-Date: 2002-11-28 HO:MI+ZONE\n"
"Last-Translator: aabbvv <null@list.ru>\n"
"Language-Team: RUSSIAN <LL@li.org>\n"
"MIME-Version: 1.0\n"
"Content-Type: text/plain; charset=koi8-r\n"
"Content-Transfer-Encoding: 8bit\n"
#: epanelconf.cpp:25 epanelconf.cpp:35 epanelconf.cpp:60 epanelconf.cpp:70
msgid "Executables (*.*), *, All files (*.*), *"
msgstr "<22><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> (*.*), *, <20><><EFBFBD> <20><><EFBFBD><EFBFBD><EFBFBD> (*.*), *"
#: epanelconf.cpp:26 epanelconf.cpp:36 epanelconf.cpp:61 epanelconf.cpp:71
msgid "File selection..."
msgstr "<22><><EFBFBD><EFBFBD><EFBFBD> <20><><EFBFBD><EFBFBD><EFBFBD>..."
#: epanelconf.cpp:81
msgid "Panel settings"
msgstr "<22><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD>"
#: epanelconf.cpp:83
msgid "&Apply"
msgstr "<22><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>"
#: epanelconf.cpp:86
msgid "&Close"
msgstr "<22><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>"
#: epanelconf.cpp:90
msgid "Utilities"
msgstr "<22><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>"
#: epanelconf.cpp:91
msgid "Panel utilities"
msgstr "<22><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD>"
#: epanelconf.cpp:94
msgid "Volume control program:"
msgstr "<22><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD>:"
#: epanelconf.cpp:97 epanelconf.cpp:177
msgid "&Browse..."
msgstr "<22><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>..."
#: epanelconf.cpp:100
msgid "Time and date program:"
msgstr "<22><><EFBFBD><EFBFBD>:"
#: epanelconf.cpp:103 epanelconf.cpp:183
msgid "Br&owse..."
msgstr "<22><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>..."
#: epanelconf.cpp:108
msgid "Autohide"
msgstr "<22><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>"
#: epanelconf.cpp:111
msgid "Automaticaly hide panel"
msgstr "<22><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD>"
#: epanelconf.cpp:117
msgid "Workspaces"
msgstr "<22><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <20><><EFBFBD><EFBFBD><EFBFBD>"
#: epanelconf.cpp:119
msgid "Number of workspaces: "
msgstr "<22><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>:"
#: epanelconf.cpp:129
msgid "Workspace names:"
msgstr "<22><><EFBFBD><EFBFBD><EFBFBD>:"
#: epanelconf.cpp:132
msgid "WS 1:"
msgstr ""
#: epanelconf.cpp:136
msgid "WS 2:"
msgstr ""
#: epanelconf.cpp:140
msgid "WS 3:"
msgstr ""
#: epanelconf.cpp:144
msgid "WS 4:"
msgstr ""
#: epanelconf.cpp:148
msgid "WS 5:"
msgstr ""
#: epanelconf.cpp:152
msgid "WS 6:"
msgstr ""
#: epanelconf.cpp:156
msgid "WS 7:"
msgstr ""
#: epanelconf.cpp:160
msgid "WS 8:"
msgstr ""
#: epanelconf.cpp:169
msgid "Handlers"
msgstr "<22><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>"
#: epanelconf.cpp:171
msgid "Handlers programs"
msgstr "<22><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD>"
#: epanelconf.cpp:174
msgid "Internet browser:"
msgstr "<22><><EFBFBD> <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>:"
#: epanelconf.cpp:180
msgid "Terminal:"
msgstr "<22><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>:"

127
epanelconf/locale/sk.po Executable file
View File

@@ -0,0 +1,127 @@
# SOME DESCRIPTIVE TITLE.
# Copyright (C) YEAR Free Software Foundation, Inc.
# FIRST AUTHOR <EMAIL@ADDRESS>, YEAR.
#
msgid ""
msgstr ""
"Project-Id-Version: epanelconf 1.0\n"
"POT-Creation-Date: 2002-04-21 14:09+0200\n"
"PO-Revision-Date: 2002-04-21 14:50+0200\n"
"Last-Translator: Martin Pekar <cortex@nextra.sk>\n"
"Language-Team: Slovak <LL@li.org>\n"
"MIME-Version: 1.0\n"
"Content-Type: text/plain; charset=utf-8\n"
"Content-Transfer-Encoding: 8bit\n"
#: epanelconf.cpp:26 epanelconf.cpp:36
msgid "File selection..."
msgstr "Výber súboru..."
#: epanelconf.cpp:60
msgid "Panel settings"
msgstr "Nastavenia panelu"
#: epanelconf.cpp:62
msgid "&Apply"
msgstr "&Použiť"
#: epanelconf.cpp:66
msgid "&Close"
msgstr "&Zavrieť"
#: epanelconf.cpp:71
msgid "Utilities"
msgstr "Pomôcky"
#: epanelconf.cpp:72
msgid "Panel utilities"
msgstr "Pomôcky panelu"
#: epanelconf.cpp:75
msgid "Volume control program:"
msgstr "Program nastavenia hlasitosti:"
#: epanelconf.cpp:79
msgid "&Browse..."
msgstr "&Zvoliť..."
#: epanelconf.cpp:83
msgid "Time and date program:"
msgstr "Program nastavenia času a dátumu:"
#: epanelconf.cpp:87
msgid "Br&owse..."
msgstr "Zv&oliť..."
#: epanelconf.cpp:94
msgid "Autohide"
msgstr "Automatické skrytie"
#: epanelconf.cpp:97
msgid "Automaticaly hide panel"
msgstr "Automaticky skryť panel"
#: epanelconf.cpp:106
msgid "Workspaces"
msgstr "Pracovné plochy"
#: epanelconf.cpp:108
msgid "Number of workspaces: "
msgstr "Počet pracovných plôch: "
#: epanelconf.cpp:118
msgid "Workspace names:"
msgstr "Názvy pracovných plôch:"
#: epanelconf.cpp:121
msgid "WS 1:"
msgstr "PP 1:"
#: epanelconf.cpp:125
msgid "WS 2:"
msgstr "PP 2:"
#: epanelconf.cpp:129
msgid "WS 3:"
msgstr "PP 3:"
#: epanelconf.cpp:133
msgid "WS 4:"
msgstr "PP 4:"
#: epanelconf.cpp:137
msgid "WS 5:"
msgstr "PP 5:"
#: epanelconf.cpp:141
msgid "WS 6:"
msgstr "PP 6:"
#: epanelconf.cpp:145
msgid "WS 7:"
msgstr "PP 7:"
#: epanelconf.cpp:149
msgid "WS 8:"
msgstr "PP 8:"
#: epanelconf.cpp:169
msgid "Handlers"
msgstr "Správcovia"
#: epanelconf.cpp:171
msgid "Handlers programs"
msgstr "Programy správy"
#: epanelconf.cpp:174
msgid "Internet browser:"
msgstr "Internetový prehliadač:"
#: epanelconf.cpp:180
msgid "Terminal:"
msgstr "Terminál:"
#: epanelconf.cpp:25 epanelconf.cpp:35 epanelconf.cpp:60 epanelconf.cpp:70
msgid "Executables (*.*), *, All files (*.*), *"
msgstr "Spustiteľné (*.*), *, Všetky súbory (*.*), *"

135
epanelconf/locale/sr.po Executable file
View File

@@ -0,0 +1,135 @@
# SOME DESCRIPTIVE TITLE.
# Copyright (C) YEAR Free Software Foundation, Inc.
# FIRST AUTHOR <EMAIL@ADDRESS>, YEAR.
#
msgid ""
msgstr ""
"Project-Id-Version: epanelconf 1.0\n"
"POT-Creation-Date: 2002-10-17 18:15+0000\n"
"PO-Revision-Date: 2002-11-30 02:04+0100\n"
"Last-Translator: Dejan Lekic <dejan@nu6.org>\n"
"Language-Team: LINUKS.org T.T. <i18n@linuks.org>\n"
"MIME-Version: 1.0\n"
"Content-Type: text/plain; charset=utf-8\n"
"Content-Transfer-Encoding: 8bit\n"
#: epanelconf.cpp:25
#: epanelconf.cpp:35
#: epanelconf.cpp:60
#: epanelconf.cpp:70
msgid "Executables (*.*), *, All files (*.*), *"
msgstr "Извршни фајлови (*.*), *, Сви фајлови (*.*), *"
#: epanelconf.cpp:26
#: epanelconf.cpp:36
#: epanelconf.cpp:61
#: epanelconf.cpp:71
msgid "File selection..."
msgstr "Селектовање фајла..."
#: epanelconf.cpp:81
msgid "Panel settings"
msgstr "Особине панела"
#: epanelconf.cpp:83
msgid "&Apply"
msgstr "&Примени"
#: epanelconf.cpp:86
msgid "&Close"
msgstr "&Затвори"
#: epanelconf.cpp:90
msgid "Utilities"
msgstr "Помоћни алати"
#: epanelconf.cpp:91
msgid "Panel utilities"
msgstr "Помоћни алати за панел"
#: epanelconf.cpp:94
msgid "Volume control program:"
msgstr "Програм за контролу јачине звука:"
#: epanelconf.cpp:97
#: epanelconf.cpp:177
msgid "&Browse..."
msgstr "&Нађи..."
#: epanelconf.cpp:100
msgid "Time and date program:"
msgstr "Време и датум - програм:"
#: epanelconf.cpp:103
#: epanelconf.cpp:183
msgid "Br&owse..."
msgstr "&Нађи..."
#: epanelconf.cpp:108
msgid "Autohide"
msgstr "Аутоскривање"
#: epanelconf.cpp:111
msgid "Automaticaly hide panel"
msgstr "Аутоматски сакриј панел"
#: epanelconf.cpp:117
msgid "Workspaces"
msgstr "Радне површине"
#: epanelconf.cpp:119
msgid "Number of workspaces: "
msgstr "Број радних површина:"
#: epanelconf.cpp:129
msgid "Workspace names:"
msgstr "Имена радних површина:"
#: epanelconf.cpp:132
msgid "WS 1:"
msgstr "РП 1:"
#: epanelconf.cpp:136
msgid "WS 2:"
msgstr "РП 2:"
#: epanelconf.cpp:140
msgid "WS 3:"
msgstr "РП 3:"
#: epanelconf.cpp:144
msgid "WS 4:"
msgstr "РП 4:"
#: epanelconf.cpp:148
msgid "WS 5:"
msgstr "РП 5:"
#: epanelconf.cpp:152
msgid "WS 6:"
msgstr "РП 6:"
#: epanelconf.cpp:156
msgid "WS 7:"
msgstr "РП 7:"
#: epanelconf.cpp:160
msgid "WS 8:"
msgstr "РП 8:"
#: epanelconf.cpp:169
msgid "Handlers"
msgstr "Хендлери"
#: epanelconf.cpp:171
msgid "Handlers programs"
msgstr "Програми-хендлери"
#: epanelconf.cpp:174
msgid "Internet browser:"
msgstr "Интернет браузер:"
#: epanelconf.cpp:180
msgid "Terminal:"
msgstr "Терминал:"

347
epanelconf/util.cpp Executable file
View File

@@ -0,0 +1,347 @@
/*
* $Id$
*
* Configure window for eworkpanel
* Part of Equinox Desktop Environment (EDE).
* Copyright (c) 2000-2006 EDE Authors.
*
* This program is licenced under terms of the
* GNU General Public Licence version 2 or newer.
* See COPYING for details.
*/
#include "epanelconf.h"
#include <fltk/Input.h>
#include <fltk/x.h>
//#include <efltk/Fl_WM.h>
#include "../edelib2/Config.h"
//#include <efltk/Fl_String_List.h>
using namespace fltk;
using namespace edelib;
extern Input *workspaces[8];
void read_config()
{
char temp_value[128];
bool temp_bool=0;
Config cfg(Config::find_file("ede.conf", 0));
cfg.set_section("Panel");
if(!cfg.read("Volume Control", temp_value, 0, sizeof(temp_value))) {
vcProgram->value(temp_value);
}
if(!cfg.read("Time and date", temp_value, 0, sizeof(temp_value))) {
tdProgram->value(temp_value);
}
cfg.read("AutoHide", temp_bool, false);
autohide_check->value(temp_bool);
cfg.set_section("Web");
if(!cfg.read("Browser", temp_value, 0, sizeof(temp_value))) {
browserProgram->value(temp_value);
}
cfg.set_section("Terminal");
if(!cfg.read("Terminal", temp_value, 0, sizeof(temp_value))) {
terminalProgram->value(temp_value);
}
}
void write_config()
{
Config cfg(Config::find_file("ede.conf", 0));
cfg.set_section("Panel");
cfg.write("Volume Control", vcProgram->value());
cfg.write("Time and date", tdProgram->value());
cfg.write("AutoHide", autohide_check->value());
cfg.set_section("Web");
cfg.write("Browser", browserProgram->value());
cfg.set_section("Terminal");
cfg.write("Terminal", terminalProgram->value());
// Write workspace names to file, edewm will read and set on startup
cfg.set_section("Workspaces");
cfg.write("Count", int(ws_slider->value()));
for(int n=0; n<8; n++) {
char tmp[128]; snprintf(tmp, sizeof(tmp)-1, "Workspace%d", n+1);
cfg.write(tmp, workspaces[n]->value());
}
}
/*
// This was an attempt to separate code into Fl_WM class
// For the moment, we abandon this attempt
void get_workspaces(Fl_CString_List &desktops, int &count);
void update_workspaces()
{
Fl_CString_List desktops;
desktops.auto_delete(true);
int count;
get_workspaces(desktops, count);
if(count>8) count=8;
for(int n=0; n<8; n++) {
const char *name = desktops.item(n);
Fl_Input *i = workspaces[n];
if(n<count) i->activate();
if(name) {
i->value(name);
} else {
char tmp[128];
snprintf(tmp, sizeof(tmp)-1, "%s %d", "Workspace" ,n+1);
i->value(tmp);
}
}
ws_slider->value(count);
desktops.clear();
}*/
/////////////////////////////////////
/////////////////////////////////////
// Code for setting desktop names using NET-WM
static bool atoms_inited=false;
// NET-WM spec desktop atoms
static Atom _XA_NET_NUM_DESKTOPS;
static Atom _XA_NET_DESKTOP_NAMES;
// GNOME atoms:
static Atom _XA_WIN_WORKSPACE_COUNT;
static Atom _XA_WIN_WORKSPACE_NAMES;
static void init_atoms()
{
if(atoms_inited) return;
open_display();
#define A(name) XInternAtom(xdisplay, name, False)
_XA_NET_NUM_DESKTOPS = A("_NET_NUMBER_OF_DESKTOPS");
_XA_NET_DESKTOP_NAMES = A("_NET_DESKTOP_NAMES");
_XA_WIN_WORKSPACE_COUNT = A("_WIN_WORKSPACE_COUNT");
_XA_WIN_WORKSPACE_NAMES = A("_WIN_WORKSPACE_NAMES");
atoms_inited=true;
}
void* getProperty(XWindow w, Atom a, Atom type, unsigned long* np=0)
{
Atom realType;
int format;
unsigned long n, extra;
int status;
void* prop;
status = XGetWindowProperty(xdisplay, w,
a, 0L, 256L, False, type, &realType,
&format, &n, &extra, (uchar**)&prop);
if (status != Success) return 0;
if (!prop) return 0;
if (!n) {XFree(prop); return 0;}
if (np) *np = n;
return prop;
}
int getIntProperty(XWindow w, Atom a, Atom type, int deflt) {
void* prop = getProperty(w, a, type);
if(!prop) return deflt;
int r = int(*(long*)prop);
XFree(prop);
return r;
}
void setProperty(XWindow w, Atom a, Atom type, int v) {
long prop = v;
XChangeProperty(xdisplay, w, a, type, 32, PropModeReplace, (uchar*)&prop,1);
}
//void get_workspaces(Fl_CString_List &desktops, int &count)
void update_workspaces()
{
init_atoms();
int count = 0;
int current = 0;
// desktops.clear();
// desktops.auto_delete(true);
int length=0;
char *buffer=0;
XTextProperty names;
// First try to get NET desktop names
XGetTextProperty(xdisplay, RootWindow(xdisplay, xscreen), &names, _XA_NET_DESKTOP_NAMES);
// If not found, look for GNOME ones
if(!names.value) XGetTextProperty(xdisplay, RootWindow(xdisplay, xscreen), &names, _XA_WIN_WORKSPACE_NAMES);
buffer = (char *)names.value;
length = names.nitems;
if(buffer) {
char* c = buffer;
for (int i = 1; c < buffer+length; i++) {
char* d = c;
while(*d) d++;
if(*c != '<') {
if(strcmp(c, "") != 0) {
Input *i = workspaces[current];
i->activate();
i->value(strdup(c));
current++;
}
}
c = d+1;
}
XFree(names.value);
}
count = getIntProperty(RootWindow(xdisplay, xscreen), _XA_NET_NUM_DESKTOPS, XA_CARDINAL, -1);
if(count<0) count = getIntProperty(RootWindow(xdisplay, xscreen), _XA_WIN_WORKSPACE_COUNT, XA_CARDINAL, -1);
// FIXME: What to do with count now?
}
// Code taken from FL_WM.cpp
Atom _XA_NET_SUPPORTED = 0;
Atom _XA_NET_SUPPORTING_WM_CHECK = 0;
XWindow fl_wmspec_check_window = None;
bool fl_netwm_supports(Atom &xproperty)
{
// Vedran: -manual atoms initing:
_XA_NET_SUPPORTING_WM_CHECK = A("_NET_SUPPORTING_WM_CHECK");
_XA_NET_SUPPORTED = A("_NET_SUPPORTED");
static Atom *atoms = NULL;
static int natoms = 0;
Atom type;
int format;
ulong nitems;
ulong bytes_after;
XWindow *xwindow;
if(fl_wmspec_check_window != None) {
if(atoms == NULL)
return false;
for(int i=0; i<natoms; i++) {
if (atoms[i] == xproperty)
return true;
}
return false;
}
if(atoms) XFree(atoms);
atoms = NULL;
natoms = 0;
/* This function is very slow on every call if you are not running a
* spec-supporting WM. For now not optimized, because it isn't in
* any critical code paths, but if you used it somewhere that had to
* be fast you want to avoid "GTK is slow with old WMs" complaints.
* Probably at that point the function should be changed to query
* _NET_SUPPORTING_WM_CHECK only once every 10 seconds or something.
*/
XGetWindowProperty (xdisplay, RootWindow(xdisplay, xscreen),
_XA_NET_SUPPORTING_WM_CHECK, 0, ~0L,
False, XA_WINDOW, &type, &format, &nitems,
&bytes_after, (uchar **)&xwindow);
if(type != XA_WINDOW)
return false;
// Find out if this WM goes away, so we can reset everything.
XSelectInput(xdisplay, *xwindow, StructureNotifyMask);
XFlush(xdisplay);
XGetWindowProperty (xdisplay, RootWindow(xdisplay, xscreen),
_XA_NET_SUPPORTED, 0, ~0L,
False, XA_ATOM, &type, &format, (ulong*)&natoms,
&bytes_after, (uchar **)&atoms);
if(type != XA_ATOM)
return false;
fl_wmspec_check_window = *xwindow;
XFree(xwindow);
// since wmspec_check_window != None this isn't infinite. ;-)
return fl_netwm_supports(xproperty);
}
int sendClientMessage(XWindow w, Atom a, long x)
{
XEvent xev;
memset(&xev, 0, sizeof(xev));
xev.xclient.type = ClientMessage;
xev.xclient.serial = 0;
xev.xclient.send_event = True;
xev.xclient.window = w;
xev.xclient.display = xdisplay;
xev.xclient.message_type = a;
xev.xclient.format = 32;
xev.xclient.data.l[0] = x;
xev.xclient.data.l[1] = CurrentTime;
int ret = XSendEvent (xdisplay, RootWindow(xdisplay, xscreen), False,
SubstructureRedirectMask | SubstructureNotifyMask,
&xev);
XSync(xdisplay, True);
return ret;
}
bool fl_set_workspace_count(int count)
{
//init_atom(&_XA_NET_NUM_DESKTOPS);
// Vedran: - use existing init_atoms() fn
init_atoms();
if(fl_netwm_supports(_XA_NET_NUM_DESKTOPS)) {
sendClientMessage(RootWindow(xdisplay, xscreen), _XA_NET_NUM_DESKTOPS, count);
return true;
}
return false;
}
// End code from FL_WM.cpp
void send_workspaces()
{
init_atoms();
int cnt = int(ws_slider->value());
// Tell windowmanager to update its internal desktop count
//Fl_WM::set_workspace_count(cnt);
fl_set_workspace_count(cnt);
char *ws_names[8];
for(int n=0; n<cnt; n++)
{
if(!strcmp(workspaces[n]->value(), "")) {
char tmp[128];
snprintf(tmp, sizeof(tmp)-1, "%s %d", "Workspace", n+1);
ws_names[n] = strdup(tmp);
} else
ws_names[n] = strdup(workspaces[n]->value());
}
XTextProperty names;
if(XStringListToTextProperty((char **)ws_names, cnt, &names)) {
XSetTextProperty(xdisplay, RootWindow(xdisplay, xscreen), &names, _XA_NET_DESKTOP_NAMES);
XSetTextProperty(xdisplay, RootWindow(xdisplay, xscreen), &names, _XA_WIN_WORKSPACE_NAMES);
XFree(names.value);
}
}

22
epanelconf/util.h Executable file
View File

@@ -0,0 +1,22 @@
/*
* $Id$
*
* Configure window for eworkpanel
* Part of Equinox Desktop Environment (EDE).
* Copyright (c) 2000-2006 EDE Authors.
*
* This program is licenced under terms of the
* GNU General Public Licence version 2 or newer.
* See COPYING for details.
*/
#ifndef util_h
#define util_h
extern void read_config();
extern void write_config();
extern void update_workspaces();
extern void send_workspaces();
#endif