1 /* 2 Copyright (C) 2018-2021, Dirk Krause 3 SPDX-License-Identifier: BSD-3-Clause 4 */ 5 6 /* 7 WARNING: This file was generated by the dkct program (see 8 http://dktools.sourceforge.net/ for details). 9 Changes you make here will be lost if dkct is run again! 10 You should modify the original source and run dkct on it. 11 Original source: Bmpp4Frame.wxc 12 */ 13 14 /** @file Bmpp4Frame.h Header file for the Bmpp4Frame module. 15 */ 16 17 #ifndef BMPP4FRAME_H_INCLUDED 18 /** Avoid multiple inclusions. */ 19 #define BMPP4FRAME_H_INCLUDED 1 20 21 22 23 24 class Bmpp4Frame : public Dk4WxFrame 25 { 26 private: 27 28 /** Event table for frame. 29 */ 30 31 #if wxCHECK_VERSION(3,0,0) 32 wxDECLARE_EVENT_TABLE(); 33 #else 34 DECLARE_EVENT_TABLE() 35 #endif 36 37 private: 38 39 /** Start time. 40 */ 41 dk4_time_t firsttime; 42 43 /** We are already correcting GUI, no recursive attempt. 44 */ 45 bool bIsCorrecting; 46 47 protected: 48 49 /** Auto start controller. 50 */ 51 Dk4WxAutostartController oAsc; 52 53 /** Text color for status text on error. 54 */ 55 wxColour cRed; 56 57 /** Text color for status text on success. 58 */ 59 wxColour cGreen; 60 61 /** Normal text color. 62 */ 63 wxColour cBlack; 64 65 /** Localized texts. 66 */ 67 wxChar const * const *sTexts; 68 69 /** Non-localized texts. 70 */ 71 wxChar const * const *sNlWx; 72 73 /** Non-localized texts. 74 */ 75 dkChar const * const *sNlDk; 76 77 /* __CHANGE__ 011: Add further member variables. 78 */ 79 80 /** Graphics output configuration. 81 */ 82 dk4_gra_conf_t graconf; 83 84 /** Known paper sizes. 85 */ 86 dk4_paper_size_t *pPaperSizes; 87 88 /** Paper sizes. 89 */ 90 wxArrayString asPaperSizes; 91 92 /** Directory name. 93 */ 94 wxString sDirname; 95 96 /** Number of paper sizes in asPaperSizes. 97 */ 98 size_t szPaperSizes; 99 100 /** Restore and save graphics conversion settings. 101 */ 102 bool bRestoreGx; 103 104 /** Restore and save Make mode setting. 105 */ 106 bool bRestoreMake; 107 108 /** Restore and save location to process. 109 */ 110 bool bRestoreLocation; 111 112 /** Make mode setting from options, if not restored. 113 */ 114 bool bMakeMode; 115 116 /** Automatically start. 117 */ 118 bool bAutorun; 119 120 /** Flag: Processing idle events. 121 */ 122 bool bActive; 123 124 /** Flag: GUI ok. 125 */ 126 bool dkctGUILayoutOK; 127 128 /** Contents panel. 129 */ 130 wxPanel *dkctGUIContentsPanel; 131 132 /** GUI element mainSizer. 133 */ 134 wxBoxSizer *mainSizer; 135 136 /** GUI element mbMain. 137 */ 138 wxMenuBar *mbMain; 139 140 /** GUI element tbMain. 141 */ 142 wxToolBar *tbMain; 143 144 /** GUI element menuFile. 145 */ 146 wxMenu *menuFile; 147 148 /** GUI element menuConversion. 149 */ 150 wxMenu *menuConversion; 151 152 /** GUI element menuExtras. 153 */ 154 wxMenu *menuExtras; 155 156 /** GUI element menuHelp. 157 */ 158 wxMenu *menuHelp; 159 160 /** GUI element miFileDirectory. 161 */ 162 wxMenuItem *miFileDirectory; 163 164 /** GUI element miFileExit. 165 */ 166 wxMenuItem *miFileExit; 167 168 /** GUI element miConversionRun. 169 */ 170 wxMenuItem *miConversionRun; 171 172 /** GUI element miExtrasOptionReset. 173 */ 174 wxMenuItem *miExtrasOptionReset; 175 176 /** GUI element miHelpAbout. 177 */ 178 wxMenuItem *miHelpAbout; 179 180 /** GUI element miHelpContents. 181 */ 182 wxMenuItem *miHelpContents; 183 184 /** GUI element bChooseDir. 185 */ 186 wxToolBarToolBase *bChooseDir; 187 188 /** GUI element bRunConversion. 189 */ 190 wxToolBarToolBase *bRunConversion; 191 192 /** GUI element verticalSizer. 193 */ 194 wxBoxSizer *verticalSizer; 195 196 /** GUI element contentsSizer. 197 */ 198 wxGridBagSizer *contentsSizer; 199 200 /** GUI element staticline0. 201 */ 202 wxStaticLine *staticline0; 203 204 /** GUI element lDirectoryName. 205 */ 206 wxStaticText *lDirectoryName; 207 208 /** GUI element staticline1. 209 */ 210 wxStaticLine *staticline1; 211 212 /** GUI element cbMakeMode. 213 */ 214 wxCheckBox *cbMakeMode; 215 216 /** GUI element cbColorOutput. 217 */ 218 wxCheckBox *cbColorOutput; 219 220 /** GUI element lRgbToGray. 221 */ 222 wxStaticText *lRgbToGray; 223 224 /** GUI element chRgbToGray. 225 */ 226 wxChoice *chRgbToGray; 227 228 /** GUI element lOutputMode. 229 */ 230 wxStaticText *lOutputMode; 231 232 /** GUI element chOutputMode. 233 */ 234 wxChoice *chOutputMode; 235 236 /** GUI element cbImgInterpolation. 237 */ 238 wxCheckBox *cbImgInterpolation; 239 240 /** GUI element lPsLevel. 241 */ 242 wxStaticText *lPsLevel; 243 244 /** GUI element chPsLevel. 245 */ 246 wxChoice *chPsLevel; 247 248 /** GUI element cbDsc. 249 */ 250 wxCheckBox *cbDsc; 251 252 /** GUI element cbLzw. 253 */ 254 wxCheckBox *cbLzw; 255 256 /** GUI element cbAnBpc. 257 */ 258 wxCheckBox *cbAnBpc; 259 260 /** GUI element lPaperSize. 261 */ 262 wxStaticText *lPaperSize; 263 264 /** GUI element chPaperSizes. 265 */ 266 wxChoice *chPaperSizes; 267 268 /** GUI element cbRotation. 269 */ 270 wxCheckBox *cbRotation; 271 272 /** GUI element cbAnColor. 273 */ 274 wxCheckBox *cbAnColor; 275 276 /** GUI element lFinishing. 277 */ 278 wxStaticText *lFinishing; 279 280 /** GUI element chFinishing. 281 */ 282 wxChoice *chFinishing; 283 284 /** GUI element cbAnAlpha. 285 */ 286 wxCheckBox *cbAnAlpha; 287 288 /** GUI element lResolution. 289 */ 290 wxStaticText *lResolution; 291 292 /** GUI element chResolution. 293 */ 294 wxChoice *chResolution; 295 296 /** GUI element tfResolution. 297 */ 298 wxTextCtrl *tfResolution; 299 300 /** GUI element cbSizeLaTeX. 301 */ 302 wxCheckBox *cbSizeLaTeX; 303 304 /** GUI element lBackground. 305 */ 306 wxStaticText *lBackground; 307 308 /** GUI element ccBackground. 309 */ 310 Dk4WxColourView *ccBackground; 311 312 /** GUI element cbBackground. 313 */ 314 wxCheckBox *cbBackground; 315 316 /** GUI element cbDct. 317 */ 318 wxCheckBox *cbDct; 319 320 /** GUI element cbDctInterpolation. 321 */ 322 wxCheckBox *cbDctInterpolation; 323 324 325 public: 326 327 /** Constructor. 328 @param wxid Window ID. 329 @param applicationHelper Application helper object. 330 @param hc Help controller for online help. 331 @param localizedTexts Localized wxChar texts. 332 @param nlWx Non-localized wxChar texts. 333 @param nlDk Non-localized dkChar texts. 334 */ 335 Bmpp4Frame( 336 int wxid, 337 Dk4WxApplicationHelper *applicationHelper, 338 Dk4WxHelpController *hc, 339 wxChar const * const *localizedTexts, 340 wxChar const * const *nlWx, 341 dkChar const * const *nlDk, 342 dk4_gra_conf_t *pgc, 343 wxArrayString *pPapSiz, 344 wxChar *pDir, 345 size_t szPap, 346 bool bRGx, 347 bool bRMa, 348 bool bRLo, 349 bool bMak, 350 bool bRun, 351 dk4_paper_size_t *pSizes 352 ); 353 354 /** Destructor. 355 */ 356 ~Bmpp4Frame(); 357 358 /** Check whether we can close the window. 359 @param isLast Flag: Last main window to close. 360 */ 361 bool 362 CanClose(bool isFinal); 363 364 /** Save current settings. 365 */ 366 void 367 SaveSettings(void); 368 369 /** Restore settings from previous session. 370 */ 371 void 372 RestoreSettings(void); 373 374 375 /** Modify enabled or disabled state of GUI components. 376 */ 377 void 378 CorrectGUI(void); 379 380 /** Check for documents whether paper size is usable. 381 @return True on success, false on error. 382 */ 383 bool 384 CheckPaperSizeForDocuments(void); 385 386 /** Run Conversion. 387 @return True on success, false on error. 388 */ 389 bool 390 RunConversion(void); 391 392 /** Handler for File/Exit. 393 @param event Event to process. 394 */ 395 void 396 OnQuit(wxCommandEvent & event); 397 398 /** Handler for Help/About. 399 @param event Event to process. 400 */ 401 void 402 OnAbout(wxCommandEvent & event); 403 404 /** Handler for Help/Contents. 405 @param event Event to process. 406 */ 407 void 408 OnHelpContents(wxCommandEvent & event); 409 410 /* __CHANGE__ 008: Remove OnIdle if no idle processing required. 411 */ 412 /** Handler for idle events. 413 */ 414 void 415 OnIdle(wxIdleEvent & event); 416 417 /* __CHANGE__ 017: Event handlers for further events. 418 */ 419 420 /** Handler for choose directory command. 421 */ 422 void 423 OnChooseDirectory(wxCommandEvent & event); 424 425 /** Handler for reset options command. 426 */ 427 void 428 OnResetOptions(wxCommandEvent & event); 429 430 431 /** Handler for run conversion command. 432 */ 433 void 434 OnRunConversion(wxCommandEvent & event); 435 436 /** Handler for output type change. 437 */ 438 void 439 OnOutputType(wxCommandEvent & event); 440 441 /** Handler for PS level change. 442 */ 443 void 444 OnPSLevel(wxCommandEvent & event); 445 446 /** Handler for resolution setting change. 447 */ 448 void 449 OnResolution(wxCommandEvent & event); 450 451 /** Handler for interpolation checkbox change. 452 */ 453 void 454 OnInterpolationChange(wxCommandEvent & event); 455 456 /** Handler for color output checkbox change. 457 */ 458 void 459 OnColorOutput(wxCommandEvent & event); 460 461 /* __CHANGE__ 014: Add further methods. 462 */ 463 464 /** Place configuration settings from graconf to GUI. 465 */ 466 void 467 ConfigurationToGUI(void); 468 469 /** Fill graconf from GUI. 470 */ 471 void 472 ConfigurationFromGUI(void); 473 474 }; 475 476 477 478 /* vim: set ai sw=4 ts=4 : */ 479 480 #endif 481