UNIXworkcode

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