"Fossies" - the Fresh Open Source Software Archive

Member "xfe-1.43.2/src/Preferences.h" (6 Jun 2019, 9528 Bytes) of package /linux/privat/xfe-1.43.2.tar.gz:


As a special service "Fossies" has tried to format the requested source page into HTML format using (guessed) C and C++ source code syntax highlighting (style: standard) with prefixed line numbers and code folding option. Alternatively you can here view or download the uninterpreted source code file. For more information about "Preferences.h" see the Fossies "Dox" file reference documentation and the latest Fossies "Diffs" side-by-side code changes report: 1.43.1_vs_1.43.2.

    1 #ifndef PREFERENCES_H
    2 #define PREFERENCES_H
    3 
    4 #include <string.h>
    5 
    6 #include "DialogBox.h"
    7 #include "Keybindings.h"
    8 
    9 
   10 // Number of modifiable colors
   11 #define NUM_COLORS    12
   12 
   13 // Number of themes
   14 #define NUM_THEMES    10
   15 
   16 
   17 struct Theme
   18 {
   19     //const char *name;
   20     FXString name;
   21     FXColor  color[NUM_COLORS];
   22     Theme()
   23     {
   24         name = "";
   25     }
   26 
   27     Theme(const char* n, FXColor base = 0, FXColor bdr = 0, FXColor bg = 0, FXColor fg = 0,
   28           FXColor selbg = 0, FXColor selfg = 0, FXColor listbg = 0, FXColor listfg = 0, FXColor listhl = 0, FXColor pbarfg = 0, FXColor attenfg = 0, FXColor scrollfg = 0)
   29     {
   30         name = FXString(n);
   31         color[0] = base;
   32         color[1] = bdr;
   33         color[2] = bg;
   34         color[3] = fg;
   35         color[4] = selbg;
   36         color[5] = selfg;
   37         color[6] = listbg;
   38         color[7] = listfg;
   39         color[8] = listhl;
   40         color[9] = pbarfg;
   41         color[10] = attenfg;
   42         color[11] = scrollfg;
   43     }
   44 
   45     FXbool operator !=(const Theme&);
   46 };
   47 
   48 
   49 class PreferencesBox : public DialogBox
   50 {
   51     FXDECLARE(PreferencesBox)
   52 private:
   53     FXComboBox*    colorsBox;
   54     FXComboBox*    themesBox;
   55     FXList*        themesList;
   56     FXTextField*   iconpath;
   57     FXTextField*   txtviewer;
   58     FXTextField*   txteditor;
   59     FXTextField*   filecomparator;
   60     FXTextField*   timeformat;
   61     FXTextField*   imgviewer;
   62     FXTextField*   xterm;
   63     FXTextField*   imgeditor;
   64     FXTextField*   archiver;
   65     FXTextField*   pdfviewer;
   66     FXTextField*   videoplayer;
   67     FXTextField*   audioplayer;
   68     FXTextField*   normalfont;
   69     FXTextField*   textfont;
   70     FXTextField*   mountcmd;
   71     FXTextField*   umountcmd;
   72     FXString       oldiconpath;
   73     FXString       oldtxtviewer;
   74     FXString       oldtxteditor;
   75     FXString       oldfilecomparator;
   76     FXString       oldtimeformat;
   77     FXString       oldimgviewer;
   78     FXString       oldxterm;
   79     FXString       oldnormalfont;
   80     FXString       oldtextfont;
   81     FXString       oldimgeditor;
   82     FXString       oldarchiver;
   83     FXString       oldpdfviewer;
   84     FXString       oldaudioplayer;
   85     FXString       oldvideoplayer;
   86     FXString       oldmountcmd;
   87     FXString       oldumountcmd;
   88     FXCheckButton* autosave;
   89     FXCheckButton* savewinpos;
   90     FXCheckButton* diropen;
   91     FXCheckButton* fileopen;
   92     FXCheckButton* filetooltips;
   93     FXCheckButton* relativeresize;
   94     FXCheckButton* showpathlink;
   95     FXCheckButton* rootmode;
   96     FXCheckButton* trashcan;
   97     FXCheckButton* trashbypass;
   98     FXCheckButton* dnd;
   99     FXCheckButton* trashmv;
  100     FXCheckButton* del;
  101     FXCheckButton* properties;
  102     FXCheckButton* del_emptydir;
  103     FXCheckButton* overwrite;
  104     FXCheckButton* exec;
  105     FXCheckButton* ask;
  106     FXCheckButton* bg;
  107     FXCheckButton* folder_warning;
  108     FXCheckButton* preserve_date_warning;
  109     FXCheckButton* root_warning;
  110     FXCheckButton* mount;
  111     FXCheckButton* show_mount;
  112     FXCheckButton* scroll;
  113     FXCheckButton* controls;
  114     FXDataTarget   startdirtarget;
  115     int            startdirmode;
  116     int            oldstartdirmode;
  117 #ifdef STARTUP_NOTIFICATION
  118     FXCheckButton* usesn;
  119 #endif
  120     FXColorWell* cwell;
  121     Theme        Themes[NUM_THEMES];
  122     Theme        currTheme;
  123     Theme        currTheme_prev;
  124     FXbool       use_sudo;
  125     FXbool       use_sudo_prev;
  126     FXbool       trashcan_prev;
  127     FXbool       trashbypass_prev;
  128     FXbool       autosave_prev;
  129     FXbool       savewinpos_prev;
  130     FXbool       diropen_prev;
  131     FXbool       fileopen_prev;
  132     FXbool       filetooltips_prev;
  133     FXbool       relativeresize_prev;
  134     FXbool       show_pathlink;
  135     FXbool       show_pathlink_prev;
  136     FXuint       wheellines_prev;
  137     FXint        scrollbarsize_prev;
  138     FXbool       ask_prev;
  139     FXbool       dnd_prev;
  140     FXbool       trashmv_prev;
  141     FXbool       del_prev;
  142     FXbool       properties_prev;
  143     FXbool       del_emptydir_prev;
  144     FXbool       overwrite_prev;
  145     FXbool       exec_prev;
  146     FXbool       use_clearlooks;
  147     FXbool       use_clearlooks_prev;
  148     FXbool       rootmode_prev;
  149 #ifdef STARTUP_NOTIFICATION
  150     FXbool usesn_prev;
  151 #endif
  152 #if defined(linux)
  153     FXbool mount_prev;
  154     FXbool show_mount_prev;
  155 #endif
  156     FXbool          root_warning_prev;
  157     FXbool          folder_warning_prev;
  158     FXbool          preserve_date_warning_prev;
  159     FXuint          themelist_prev;
  160     FXbool          smoothscroll_prev;
  161     KeybindingsBox* bindingsbox;
  162     FXStringDict*   glbBindingsDict;
  163     FXStringDict*   xfeBindingsDict;
  164     FXStringDict*   xfiBindingsDict;
  165     FXStringDict*   xfwBindingsDict;
  166 
  167     PreferencesBox() : colorsBox(NULL), themesBox(NULL), themesList(NULL), iconpath(NULL), txtviewer(NULL), txteditor(NULL),
  168                        filecomparator(NULL), timeformat(NULL), imgviewer(NULL), xterm(NULL), imgeditor(NULL), archiver(NULL),
  169                        pdfviewer(NULL), videoplayer(NULL), audioplayer(NULL), normalfont(NULL), textfont(NULL), autosave(NULL), savewinpos(NULL),
  170                        diropen(NULL), fileopen(NULL), filetooltips(NULL), relativeresize(NULL), showpathlink(NULL), rootmode(NULL), trashcan(NULL),
  171                        trashbypass(NULL), dnd(NULL), trashmv(NULL), del(NULL), properties(NULL), del_emptydir(NULL),
  172                        overwrite(NULL), exec(NULL), ask(NULL), bg(NULL), folder_warning(NULL), preserve_date_warning(NULL),
  173                        root_warning(NULL), mount(NULL), show_mount(NULL), scroll(NULL), controls(NULL), startdirmode(0), oldstartdirmode(0),
  174 #ifdef STARTUP_NOTIFICATION
  175                        usesn(NULL),
  176 #endif
  177                        cwell(NULL), use_sudo(false), use_sudo_prev(false), trashcan_prev(false), trashbypass_prev(false),
  178                        autosave_prev(false), savewinpos_prev(false), diropen_prev(false), fileopen_prev(false),
  179                        filetooltips_prev(false), relativeresize_prev(false), show_pathlink(false), show_pathlink_prev(false),
  180                        wheellines_prev(0), scrollbarsize_prev(0), ask_prev(false), dnd_prev(false), trashmv_prev(false), del_prev(false), properties_prev(false),
  181                        del_emptydir_prev(false), overwrite_prev(false), exec_prev(false),
  182                        use_clearlooks(false), use_clearlooks_prev(false), rootmode_prev(false),
  183 #ifdef STARTUP_NOTIFICATION
  184                        usesn_prev(false),
  185 #endif
  186 #if defined(linux)
  187                        mount_prev(false), show_mount_prev(false),
  188 #endif
  189                        root_warning_prev(false), folder_warning_prev(false), preserve_date_warning_prev(false),
  190                        themelist_prev(0), smoothscroll_prev(false), bindingsbox(NULL), glbBindingsDict(NULL),
  191                        xfeBindingsDict(NULL), xfiBindingsDict(NULL), xfwBindingsDict(NULL)
  192     {}
  193 
  194 public:
  195     enum
  196     {
  197         ID_ACCEPT=DialogBox::ID_LAST,
  198         ID_CANCEL,
  199         ID_BROWSE_TXTVIEW,
  200         ID_BROWSE_TXTEDIT,
  201         ID_BROWSE_FILECOMP,
  202         ID_BROWSE_IMGVIEW,
  203         ID_BROWSE_ARCHIVER,
  204         ID_BROWSE_PDFVIEW,
  205         ID_BROWSE_VIDEOPLAY,
  206         ID_BROWSE_AUDIOPLAY,
  207         ID_BROWSE_XTERM,
  208         ID_BROWSE_MOUNTCMD,
  209         ID_BROWSE_UMOUNTCMD,
  210         ID_COLOR,
  211         ID_NORMALFONT,
  212         ID_TEXTFONT,
  213         ID_THEME,
  214         ID_BROWSE_ICON_PATH,
  215         ID_TRASH_BYPASS,
  216         ID_CONFIRM_TRASH,
  217         ID_CONFIRM_DEL_EMPTYDIR,
  218         ID_SU_CMD,
  219         ID_SUDO_CMD,
  220         ID_STANDARD_CONTROLS,
  221         ID_CLEARLOOKS_CONTROLS,
  222         ID_WHEELADJUST,
  223         ID_SCROLLBARSIZE,
  224         ID_SINGLE_CLICK_FILEOPEN,
  225         ID_FILE_TOOLTIPS,
  226         ID_RELATIVE_RESIZE,
  227         ID_SHOW_PATHLINK,
  228         ID_CHANGE_KEYBINDINGS,
  229         ID_RESTORE_KEYBINDINGS,
  230         ID_START_HOMEDIR,
  231         ID_START_CURRENTDIR,
  232         ID_START_LASTDIR,
  233         ID_LAST
  234     };
  235 
  236 public:
  237     PreferencesBox(FXWindow* win, FXColor listbackcolor = FXRGB(255, 255, 255), FXColor listforecolor = FXRGB(0, 0, 0), FXColor highlightcolor = FXRGB(238, 238, 238), FXColor pbarcolor = FXRGB(0, 0, 255), FXColor attentioncolor = FXRGB(255, 0, 0), FXColor scrollbackcolor = FXRGB(237, 233, 227));
  238     long   onCmdAccept(FXObject*, FXSelector, void*);
  239     long   onCmdBrowse(FXObject*, FXSelector, void*);
  240     long   onCmdColor(FXObject*, FXSelector, void*);
  241     long   onUpdColor(FXObject*, FXSelector, void*);
  242     long   onCmdTheme(FXObject*, FXSelector, void*);
  243     long   onCmdBrowsePath(FXObject*, FXSelector, void*);
  244     long   onCmdNormalFont(FXObject*, FXSelector, void*);
  245     long   onCmdTextFont(FXObject*, FXSelector, void*);
  246     long   onUpdTrash(FXObject*, FXSelector, void*);
  247     long   onUpdConfirmDelEmptyDir(FXObject*, FXSelector, void*);
  248     long   onCmdSuMode(FXObject*, FXSelector, void*);
  249     long   onUpdSuMode(FXObject*, FXSelector, void*);
  250     long   onCmdWheelAdjust(FXObject*, FXSelector, void*);
  251     long   onUpdWheelAdjust(FXObject*, FXSelector, void*);
  252     long   onCmdScrollBarSize(FXObject*, FXSelector, void*);
  253     long   onUpdScrollBarSize(FXObject*, FXSelector, void*);
  254     long   onUpdSingleClickFileopen(FXObject*, FXSelector, void*);
  255     FXuint execute(FXuint);
  256     long   onCmdCancel(FXObject*, FXSelector, void*);
  257     long   onCmdControls(FXObject*, FXSelector, void*);
  258     long   onUpdControls(FXObject*, FXSelector, void*);
  259     long   onCmdChangeKeyBindings(FXObject*, FXSelector, void*);
  260     long   onCmdRestoreKeyBindings(FXObject*, FXSelector, void*);
  261     long   onCmdStartDir(FXObject*, FXSelector, void*);
  262     long   onUpdStartDir(FXObject*, FXSelector, void*);
  263 };
  264 #endif