~israeldahl/jwm-settings-manager/trunk

« back to all changes in this revision

Viewing changes to fltk/jwm-settings.fld

  • Committer: Israel Dahl
  • Date: 2014-07-06 02:48:28 UTC
  • Revision ID: israeldahl@gmail.com-20140706024828-1bt17riyy2ep06bt
actually added the themes, buttons, etc...
* Alpha Version update
 * Desktop
 - Added Rox checkers, and getters and setters, but haven't finished/enabled it
 - Finished gradient support
 - finished Single color support
 - moved the image setting code to flDesktop(h/cpp)
 * Window
 - fixed Window icon code to reliably open the directory containing icons
 - added 'BoxShaped' window buttons

Show diffs side-by-side

added added

removed removed

Lines of Context:
1
1
# data file for the Fltk User Interface Designer (fluid)
2
 
version 1.0303 
 
2
version 1.0302 
3
3
i18n_type 1 
4
4
i18n_include <libintl.h> 
5
5
i18n_function gettext 
7
7
code_name {.cxx}
8
8
comment {/*                 Joe's Window Manager Configuration
9
9
 *
10
 
 * This program configures JWM using pugixml and FLTK
 
10
 * This program configures JWM using tinyxml2 and FLTK
11
11
 *
12
 
 *         Copyright (C) 2016  Israel <israeldahl@gmail.com>
 
12
 *         Copyright (C) 2014  Israel <israel@torios.org>
13
13
 * This program is free software: you can redistribute it and/or modify
14
14
 * it under the terms of the GNU General Public License as published by
15
15
 * the Free Software Foundation, either version 3 of the License, or
23
23
 * You should have received a copy of the GNU General Public License
24
24
 * along with this program.  If not, see <http://www.gnu.org/licenses/>.
25
25
 * This has been developed as a part of the ToriOS Project
 
26
 * This has been developed by Israel<israel@torios.org>
26
27
 *
27
28
 *
28
29
 * You may redistribute this, but you must keep this comment in place
33
34
decl {\#include <libintl.h>} {public global
34
35
35
36
 
36
 
decl {\#include "../include/ui.hpp"} {public global
37
 
38
 
 
39
 
decl {\#include "../include/common.hpp"} {public global
40
 
41
 
 
42
 
decl {\#include "../data/icons/jwm-settings-manager.xpm"} {public global
43
 
44
 
 
45
 
class SettingsUI {open : {public FLTK_FUNCTIONS}
 
37
decl {\#include "../include/flDesktop.h"} {public global
 
38
 
39
 
 
40
decl {\#include "../include/flPanel.h"} {public global
 
41
 
42
 
 
43
decl {\#include "../include/flWindow.h"} {public global
 
44
 
45
 
 
46
decl {\#include "../include/flFont.h"} {public global
 
47
 
48
 
 
49
decl {\#include "../include/flAutostart.h"} {public global
 
50
 
51
 
 
52
decl {\#include "../include/flKeyboard.h"} {public global
 
53
 
54
 
 
55
decl {\#include "../include/flMouse.h"} {public global
 
56
 
57
 
 
58
decl {\#include "../include/flThemes.h"} {public global
 
59
 
60
 
 
61
decl {\#include "../include/flIcons.h"} {selected public global
 
62
 
63
 
 
64
decl {\#include "../include/ui.h"} {public global
 
65
 
66
 
 
67
decl {\#include "../include/tinyxml2.h"} {public global
 
68
 
69
 
 
70
class SettingsUI {open
46
71
} {
47
 
  decl {JSM_UI ui;} {private local
48
 
  }
49
72
  Function {make_window()} {open
50
73
  } {
51
 
    code {printf("Hello, World!\\n");} {}
52
 
    Fl_Window settings_window {
 
74
    Fl_Window {} {
53
75
      label {Settings Manager} open
54
 
      xywh {948 119 260 345} type Double color 45 labelcolor 7 hide
55
 
      code1 {startup(o,jwm_settings_manager);} xclass {jwm-settings-manager}
 
76
      xywh {641 139 395 375} type Double color 45 labelcolor 7 visible
56
77
    } {
 
78
      Fl_Box {} {
 
79
        label {Settings Manager}
 
80
        xywh {80 10 245 40} labelfont 1 labelsize 24 labelcolor 35
 
81
      }
57
82
      Fl_Button {} {
58
83
        label Panel
59
 
        callback {settings_window->hide();
60
 
ui.showPanel();}
61
 
        image {../data/img/jsm-panel.png} xywh {5 5 80 80} box FLAT_BOX color 23
 
84
        callback {UI ui;ui.showPanel();}
 
85
        image {../data/img/jsm-panel.png} xywh {30 65 95 85} box GTK_UP_BOX color 39 labelcolor 55
62
86
      }
63
87
      Fl_Button {} {
64
88
        label Keyboard
65
 
        callback {settings_window->hide();
66
 
ui.showKeyboard();}
67
 
        image {../data/img/jsm-keyboard.png} xywh {90 5 80 80} box FLAT_BOX color 23
68
 
      }
69
 
      Fl_Button {} {
70
 
        label Icons
71
 
        callback {settings_window->hide();
72
 
ui.showIcons();}
73
 
        image {../data/img/jsm-icons.png} xywh {175 5 80 80} box FLAT_BOX color 23
 
89
        callback {UI ui;ui.showKeyboard();}
 
90
        image {../data/img/jsm-keyboard.png} xywh {147 65 95 85} box GTK_UP_BOX color 39 labelcolor 55
74
91
      }
75
92
      Fl_Button {} {
76
93
        label Desktop
77
 
        callback {settings_window->hide();
78
 
ui.showDesktop();}
79
 
        image {../data/img/jsm-desktop.png} xywh {5 90 80 80} box FLAT_BOX color 23
80
 
      }
81
 
      Fl_Button {} {
82
 
        label Touchpad
83
 
        callback {settings_window->hide();
84
 
ui.showMouse();}
85
 
        image {../data/img/jsm-mouse.png} xywh {90 90 80 80} box FLAT_BOX color 23
86
 
      }
87
 
      Fl_Button {} {
88
 
        label Fonts
89
 
        callback {settings_window->hide();
90
 
ui.showFonts();}
91
 
        image {../data/img/jsm-fonts.png} xywh {175 90 80 80} box FLAT_BOX color 23
 
94
        callback {UI ui;ui.showDesktop();}
 
95
        image {../data/img/jsm-desktop.png} xywh {30 165 95 85} box GTK_UP_BOX color 39 labelcolor 55
 
96
      }
 
97
      Fl_Button {} {
 
98
        label Mouse
 
99
        callback {UI ui;ui.showMouse();}
 
100
        image {../data/img/jsm-mouse.png} xywh {147 165 95 85} box GTK_UP_BOX color 39 labelcolor 55
92
101
      }
93
102
      Fl_Button {} {
94
103
        label Windows
95
 
        callback {settings_window->hide();
96
 
ui.showWindow();}
97
 
        image {../data/img/jsm-windows.png} xywh {5 175 80 80} box FLAT_BOX color 23
 
104
        callback {UI ui;ui.showWindow();}
 
105
        image {../data/img/jsm-windows.png} xywh {30 265 95 85} box GTK_UP_BOX color 39 labelcolor 55
98
106
      }
99
107
      Fl_Button {} {
100
108
        label Themes
101
 
        callback {settings_window->hide();
102
 
ui.showThemes();} selected
103
 
        tooltip {This is for Predefined Themes} image {../data/img/jsm-theme.png} xywh {90 175 80 80} box FLAT_BOX color 23
 
109
        callback {UI ui;ui.showThemes();}
 
110
        tooltip {This is for Predefined Thems} image {../data/img/jsm-theme.png} xywh {147 265 95 85} box GTK_UP_BOX color 39 labelcolor 55
 
111
      }
 
112
      Fl_Button {} {
 
113
        label Icons
 
114
        callback {UI ui;ui.showIcons();}
 
115
        image {../data/img/jsm-icons.png} xywh {265 65 95 85} box GTK_UP_BOX color 39 labelcolor 55
 
116
      }
 
117
      Fl_Button {} {
 
118
        label Fonts
 
119
        callback {UI ui;ui.showFonts();}
 
120
        image {../data/img/jsm-fonts.png} xywh {265 165 95 85} box GTK_UP_BOX color 39 labelcolor 55
104
121
      }
105
122
      Fl_Button {} {
106
123
        label Autostart
107
 
        callback {settings_window->hide();
108
 
ui.showAutostart();}
109
 
        image {../data/img/jsm-autostart.png} xywh {175 175 80 80} box FLAT_BOX color 23
110
 
      }
111
 
      Fl_Button {} {
112
 
        label {Users and Groups}
113
 
        callback {adduser();}
114
 
        xywh {5 260 80 80} box FLAT_BOX color 23 align 128
115
 
        code0 {if(isAdduser(o))makeWidgetIcon("config-users",o,48);}
116
 
      }
117
 
      Fl_Button {} {
118
 
        label {System Details}
119
 
        callback {addinfo();}
120
 
        xywh {90 260 80 80} box FLAT_BOX color 23 align 128
121
 
        code0 {if(isInfo(o))makeWidgetIcon("help-browser",o,48);}
122
 
      }
123
 
      Fl_Button {} {
124
 
        label Popups
125
 
        callback {settings_window->hide();
126
 
ui.showPopus();}
127
 
        xywh {175 260 80 80} box FLAT_BOX color 23 align 128
128
 
        code0 {makeWidgetIcon("preferences-system-notifications",o,48);}
 
124
        callback {UI ui;ui.showAutostart();}
 
125
        image {../data/img/jsm-autostart.png} xywh {265 265 95 85} box GTK_UP_BOX color 39 labelcolor 55
129
126
      }
130
127
    }
131
128
  }
132
 
  Function {isAdduser(Fl_Button *o)} {open return_type bool
133
 
  } {
134
 
    code {bool isfladduser = testExec("fladduser");
135
 
if(isfladduser){o->activate();}
136
 
else{o->deactivate();}
137
 
return isfladduser;} {}
138
 
  }
139
 
  Function {adduser()} {open
140
 
  } {
141
 
    code {settings_window->hide();
142
 
int retval = linuxcommon::run_a_program_in_background("fladduser");
143
 
if(retval !=0){errorOUT("Could not run the user adding program");}} {}
144
 
  }
145
 
  Function {isInfo(Fl_Button *o)} {open return_type bool
146
 
  } {
147
 
    code {bool isexec = testExec("torios-info");
148
 
if(isexec){
149
 
  o->activate();
150
 
}
151
 
else{
152
 
  o->deactivate();
153
 
}
154
 
return isexec;} {}
155
 
  }
156
 
  Function {addinfo()} {open
157
 
  } {
158
 
    code {settings_window->hide();
159
 
int retval = linuxcommon::run_a_program_in_background("torios-info");
160
 
if(retval !=0){
161
 
  std::cerr<<"system(\\"bash -c 'torios-info &disown'\\") did not return 0"<<std::endl;
162
 
}} {}
163
 
  }
164
 
  Function {showSettings()} {open return_type int
165
 
  } {
166
 
    code {make_window()->show();
167
 
return Fl::run();} {}
168
 
  }
169
129