add existing source
[uwplayer.git] / application / FsbP.h
1 /*
2  * Copyright 2021 Olaf Wintermann
3  *
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:
10  * 
11  * The above copyright notice and this permission notice shall be included in 
12  * all copies or substantial portions of the Software.
13  *
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.
21  */
22
23 #ifndef FSBP_H
24 #define FSBP_H
25
26 #include <X11/CoreP.h>
27 #include <Xm/XmP.h>
28 #include <Xm/PrimitiveP.h>
29 #include <Xm/ManagerP.h>
30 #include <Xm/FormP.h>
31
32 #include "Fsb.h"
33
34 #ifdef __cplusplus
35 extern "C" {
36 #endif
37
38 #define FSB_MAX_VIEWS 8
39     
40
41 typedef struct FSBView FSBView;
42 struct FSBView {
43     Widget widget;
44     Widget focus;
45     FSBViewUpdateProc  update;
46     FSBViewSelectProc  select;
47     FSBViewCleanupProc cleanup;
48     FSBViewDestroyProc destroy;
49     void *userData;
50     Boolean useDirList;
51 };
52
53     
54 typedef struct FSBClassPart {
55     int unused;
56 } FSBClassPart;
57
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;
66 } FSBClassRec;
67
68 typedef struct FSBPart {
69     XtCallbackList okCallback;
70     XtCallbackList cancelCallback;
71     
72     Dimension widgetSpacing;
73     Dimension windowSpacing;
74     
75     Boolean showHiddenButton;
76     
77     Widget path;
78     PathBar *pathBar;
79     Widget filter;
80     Widget filterButton;
81     Widget showHiddenButtonW;
82     
83     FSBFilterFunc filterFunc;
84     
85     char *filterStr;
86     
87     Widget dirUp;
88     Widget home;
89     Widget newFolder;
90     
91     Widget viewSelectorList;
92     Widget viewSelectorDetail;
93     
94     Widget viewMenu;
95     Widget viewOption;
96     Widget detailToggleButton;
97     
98     Widget filterForm;
99     Widget lsDirLabel;
100     Widget lsFileLabel;
101     
102     Widget listContextMenu;
103     Widget gridContextMenu;
104     
105     // icon view
106     
107     // dir/file list view
108     Widget listform;
109     Widget dirlist;
110     
111     FSBView view[FSB_MAX_VIEWS];
112     int numviews;
113     int selectedview;
114     
115     Widget filelist;
116     Widget grid;
117     
118     Widget separator;
119     
120     Widget nameLabel;
121     Widget name;
122     
123     Widget bottom_widget;
124     
125     Widget workarea;
126     
127     Widget okBtn;
128     Widget cancelBtn;
129     Widget helpBtn;
130     
131     FileElm *dirs;
132     FileElm *files;
133     int dircount;
134     int filecount;
135     int maxnamelen;
136     
137     char *homePath;
138     
139     char *currentPath;
140     char *selectedPath;
141     int selIsDir;
142     Boolean showHidden;
143     Boolean showViewMenu;
144       
145     int type;
146     
147     int end;
148     int status;
149     
150     int disable_set_values;
151     int gui_created;
152         
153     char *labelListView;
154     char *labelDetailView;
155     char* labelOpenFileTitle;
156     char* labelSaveFileTitle;
157     XmString labelDirUp;
158     XmString labelHome;
159     XmString labelNewFolder;
160     XmString labelFilterButton;
161     XmString labelShowHiddenFiles;
162     XmString labelDirectories;
163     XmString labelFiles;
164     XmString labelRename;
165     XmString labelDelete;
166     XmString labelOpen;
167     XmString labelSave;
168     XmString labelOk;
169     XmString labelCancel;
170     XmString labelHelp;
171     XmString labelFileName;
172     XmString labelDirectoryName;
173     XmString labelNewFileName;
174     char *labelDeleteFile;
175     
176     char *detailHeadings;
177     
178     char *dateFormatSameYear;
179     char *dateFormatOtherYear;
180     char *suffixBytes;
181     char *suffixKB;
182     char *suffixMB;
183     char *suffixGB;
184     char *suffixTB;
185     
186     char *errorTitle;
187     char *errorIllegalChar;
188     char *errorRename;
189     char *errorFolder;
190     char *errorDelete;
191     char *errorOpenDir;
192 } FSBPart;
193
194 typedef struct FSBRec {
195    CorePart             core;
196    CompositePart        composite;
197    ConstraintPart       constraint;
198    XmManagerPart        manager;
199    XmBulletinBoardPart  bulletin_board;
200    XmFormPart           form;
201    FSBPart              fsb;
202 } FSBRec;
203
204 typedef struct FSBRec *XnFileSelectionBox;
205
206 #ifdef __cplusplus
207 }
208 #endif
209
210 #endif /* FSBP_H */
211