2 * Copyright 2021 Olaf Wintermann
4 * Permission is hereby granted, free of charge, to any person obtaining a
5 * copy of this software and associated documentation files (the "Software"),
6 * to deal in the Software without restriction, including without limitation
7 * the rights to use, copy, modify, merge, publish, distribute, sublicense,
8 * and/or sell copies of the Software, and to permit persons to whom the
9 * Software is furnished to do so, subject to the following conditions:
11 * The above copyright notice and this permission notice shall be included in
12 * all copies or substantial portions of the Software.
14 * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
15 * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
16 * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL
17 * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
18 * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
19 * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
20 * DEALINGS IN THE SOFTWARE.
26 #include <X11/CoreP.h>
28 #include <Xm/PrimitiveP.h>
29 #include <Xm/ManagerP.h>
38 #define FSB_MAX_VIEWS 8
41 typedef struct FSBView FSBView;
45 FSBViewUpdateProc update;
46 FSBViewSelectProc select;
47 FSBViewCleanupProc cleanup;
48 FSBViewDestroyProc destroy;
54 typedef struct FSBClassPart {
58 typedef struct FSBClassRec {
59 CoreClassPart core_class;
60 CompositeClassPart composite_class;
61 ConstraintClassPart constraint_class;
62 XmManagerClassPart manager_class;
63 XmBulletinBoardClassPart bulletin_board_class;
64 XmFormClassPart form_class;
65 FSBClassPart fsb_class;
68 typedef struct FSBPart {
69 XtCallbackList okCallback;
70 XtCallbackList cancelCallback;
72 Dimension widgetSpacing;
73 Dimension windowSpacing;
75 Boolean showHiddenButton;
81 Widget showHiddenButtonW;
83 FSBFilterFunc filterFunc;
91 Widget viewSelectorList;
92 Widget viewSelectorDetail;
96 Widget detailToggleButton;
102 Widget listContextMenu;
103 Widget gridContextMenu;
107 // dir/file list view
111 FSBView view[FSB_MAX_VIEWS];
123 Widget bottom_widget;
143 Boolean showViewMenu;
150 int disable_set_values;
154 char *labelDetailView;
155 char* labelOpenFileTitle;
156 char* labelSaveFileTitle;
159 XmString labelNewFolder;
160 XmString labelFilterButton;
161 XmString labelShowHiddenFiles;
162 XmString labelDirectories;
164 XmString labelRename;
165 XmString labelDelete;
169 XmString labelCancel;
171 XmString labelFileName;
172 XmString labelDirectoryName;
173 XmString labelNewFileName;
174 char *labelDeleteFile;
176 char *detailHeadings;
178 char *dateFormatSameYear;
179 char *dateFormatOtherYear;
187 char *errorIllegalChar;
194 typedef struct FSBRec {
196 CompositePart composite;
197 ConstraintPart constraint;
198 XmManagerPart manager;
199 XmBulletinBoardPart bulletin_board;
204 typedef struct FSBRec *XnFileSelectionBox;