| 1 | #cxx . . $ `<file>/sys/DataGui.h`/ifndef _DataGui_h_ |
| 2 | #define _DataGui_h_cxx . . $ `sys/DataGui.h:2:9`! |
| 3 | /* DataGui.h |
| 4 | * |
| 5 | * Copyright (C) 2022 Paul Boersma |
| 6 | * |
| 7 | * This code is free software; you can redistribute it and/or modify |
| 8 | * it under the terms of the GNU General Public License as published by |
| 9 | * the Free Software Foundation; either version 2 of the License, or (at |
| 10 | * your option) any later version. |
| 11 | * |
| 12 | * This code is distributed in the hope that it will be useful, but |
| 13 | * WITHOUT ANY WARRANTY; without even the implied warranty of |
| 14 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. |
| 15 | * See the GNU General Public License for more details. |
| 16 | * |
| 17 | * You should have received a copy of the GNU General Public License |
| 18 | * along with this work. If not, see <http://www.gnu.org/licenses/>. |
| 19 | */ |
| 20 | |
| 21 | #include "Data.h"cxx . . $ `<file>/sys/Data.h`/ |
| 22 | #include "Preferences.h"cxx . . $ `<file>/sys/Preferences.h`/ |
| 23 | |
| 24 | #include "DataGui_enums.h"cxx . . $ `<file>/sys/DataGui_enums.h`/ |
| 25 | |
| 26 | extern MelderColourcxx . . $ MelderColour# |
| 27 | DataGuiColour_WINDOW_BACKGROUNDcxx . . $ DataGuiColour_WINDOW_BACKGROUND., |
| 28 | DataGuiColour_AREA_BACKGROUNDcxx . . $ DataGuiColour_AREA_BACKGROUND., |
| 29 | DataGuiColour_EDITABLEcxx . . $ DataGuiColour_EDITABLE., |
| 30 | DataGuiColour_EDITABLE_FRAMEcxx . . $ DataGuiColour_EDITABLE_FRAME., |
| 31 | DataGuiColour_EDITABLE_SELECTEDcxx . . $ DataGuiColour_EDITABLE_SELECTED., |
| 32 | DataGuiColour_NONEDITABLEcxx . . $ DataGuiColour_NONEDITABLE., |
| 33 | DataGuiColour_NONEDITABLE_FRAMEcxx . . $ DataGuiColour_NONEDITABLE_FRAME., |
| 34 | DataGuiColour_NONEDITABLE_SELECTEDcxx . . $ DataGuiColour_NONEDITABLE_SELECTED.; |
| 35 | |
| 36 | Thing_declarecxx . . $ classEditor. (Editor); |
| 37 | Thing_declarecxx . . $ classEditorMenu. (EditorMenu); |
| 38 | Thing_declarecxx . . $ classEditorCommand. (EditorCommand); |
| 39 | |
| 40 | Thing_definecxx . . $ structDataGui# (DataGui, Thing) { |
| 41 | /* |
| 42 | Accessors. |
| 43 | */ |
| 44 | public: |
| 45 | Daatacxx . . $ Daata# datacxx . . $ structDataGui#data(e8441e10bf3a9c6e).() const { return _datacxx . . $ structDataGui#_data.; } |
| 46 | bool editablecxx . . $ structDataGui#editable(50ce9a9e25b4a850).() const { return _editablecxx . . $ structDataGui#_editable.; } |
| 47 | Editorcxx . . $ Editor# bosscxx . . $ structDataGui#boss(ebca83c96e4202ef).() const { return _bosscxx . . $ structDataGui#_boss.; } |
| 48 | Graphicscxx . . $ Graphics# pictureGraphicscxx . . $ structDataGui#pictureGraphics(5af6864da672d398).() const { return _pictureGraphicscxx . . $ structDataGui#_pictureGraphics.; } |
| 49 | protected: |
| 50 | void setDatacxx . . $ structDataGui#setData(fde123624714e72). (Daatacxx . . $ Daata# data) { _datacxx . . $ structDataGui#_data. = data; } |
| 51 | private: |
| 52 | Daatacxx . . $ Daata# _datacxx . . $ structDataGui#_data.; // the data that can be displayed and edited |
| 53 | bool _editablecxx . . $ structDataGui#_editable.; |
| 54 | Editorcxx . . $ Editor# _bosscxx . . $ structDataGui#_boss.; |
| 55 | Graphicscxx . . $ Graphics# _pictureGraphicscxx . . $ structDataGui#_pictureGraphics.; |
| 56 | |
| 57 | friend void DataGui_initcxx . . $ DataGui_init(9b97872e44568997). (DataGuicxx . . $ DataGui# me, Daatacxx . . $ Daata# data, bool editable, Editorcxx . . $ Editor# boss) { |
| 58 | mycxx . . $ `melder/melder.h:44:9`! _datacxx . . $ structDataGui#_data. = data; |
| 59 | mycxx . . $ `melder/melder.h:44:9`! _editablecxx . . $ structDataGui#_editable. = editable; |
| 60 | mycxx . . $ `melder/melder.h:44:9`! _bosscxx . . $ structDataGui#_boss. = boss; |
| 61 | mycxx . . $ `melder/melder.h:44:9`! v1_copyPreferencesToInstancecxx . . $ structDataGui#v1_copyPreferencesToInstance(49f6e7a06ebc5aa8). (); |
| 62 | mycxx . . $ `melder/melder.h:44:9`! v9_repairPreferencescxx . . $ structThing#v9_repairPreferences(49f6e7a06ebc5aa8). (); |
| 63 | } |
| 64 | friend void DataGui_openPraatPicturecxx . . $ DataGui_openPraatPicture(4c5cf9f1c6ae526). (DataGuicxx . . $ DataGui# me); |
| 65 | friend void DataGui_closePraatPicturecxx . . $ DataGui_closePraatPicture(4c5cf9f1c6ae526). (DataGuicxx . . $ DataGui# me); |
| 66 | public: |
| 67 | virtual void v_createMenuItems_prefscxx . . $ structDataGui#v_createMenuItems_prefs(6ea9c8c6ea2f58a9). (EditorMenucxx . . $ EditorMenu# /* fileMenu */) { } |
| 68 | virtual void v_createMenuItems_savecxx . . $ structDataGui#v_createMenuItems_save(6ea9c8c6ea2f58a9). (EditorMenucxx . . $ EditorMenu# /* fileMenu */) { } |
| 69 | virtual void v_createMenuItems_editcxx . . $ structDataGui#v_createMenuItems_edit(6ea9c8c6ea2f58a9). (EditorMenucxx . . $ EditorMenu# /* editMenu */) { } |
| 70 | virtual void v_createMenuItems_playcxx . . $ structDataGui#v_createMenuItems_play(6ea9c8c6ea2f58a9). (EditorMenucxx . . $ EditorMenu# /* playMenu */) { } |
| 71 | virtual void v_createMenuItems_helpcxx . . $ structDataGui#v_createMenuItems_help(6ea9c8c6ea2f58a9). (EditorMenucxx . . $ EditorMenu# /* helpMenu */) { } |
| 72 | virtual void v_createMenuscxx . . $ structDataGui#v_createMenus(49f6e7a06ebc5aa8). () { } // all the menus, except File, Edit, Play and Help |
| 73 | virtual void v_updateMenuItemscxx . . $ structDataGui#v_updateMenuItems(49f6e7a06ebc5aa8). () { } |
| 74 | |
| 75 | virtual void v_prefs_addFieldscxx . . $ structDataGui#v_prefs_addFields(2b98fae8e13abb61). (EditorCommandcxx . . $ EditorCommand#) { } |
| 76 | virtual void v_prefs_setValuescxx . . $ structDataGui#v_prefs_setValues(2b98fae8e13abb61). (EditorCommandcxx . . $ EditorCommand#) { } |
| 77 | virtual void v_prefs_getValuescxx . . $ structDataGui#v_prefs_getValues(2b98fae8e13abb61). (EditorCommandcxx . . $ EditorCommand#) { } |
| 78 | |
| 79 | virtual void v_form_pictureWindowcxx . . $ structDataGui#v_form_pictureWindow(2b98fae8e13abb61). (EditorCommandcxx . . $ EditorCommand# cmd); |
| 80 | virtual void v_ok_pictureWindowcxx . . $ structDataGui#v_ok_pictureWindow(2b98fae8e13abb61). (EditorCommandcxx . . $ EditorCommand# cmd); |
| 81 | virtual void v_do_pictureWindowcxx . . $ structDataGui#v_do_pictureWindow(2b98fae8e13abb61). (EditorCommandcxx . . $ EditorCommand# cmd); |
| 82 | virtual void v_form_pictureMarginscxx . . $ structDataGui#v_form_pictureMargins(2b98fae8e13abb61). (EditorCommandcxx . . $ EditorCommand# cmd); |
| 83 | virtual void v_ok_pictureMarginscxx . . $ structDataGui#v_ok_pictureMargins(2b98fae8e13abb61). (EditorCommandcxx . . $ EditorCommand# cmd); |
| 84 | virtual void v_do_pictureMarginscxx . . $ structDataGui#v_do_pictureMargins(2b98fae8e13abb61). (EditorCommandcxx . . $ EditorCommand# cmd); |
| 85 | |
| 86 | #include "DataGui_prefs.h"cxx . . $ `<file>/sys/DataGui_prefs.h`/ |
| 87 | friend MelderColourcxx . . $ MelderColour# DataGui_defaultForegroundColourcxx . . $ DataGui_defaultForegroundColour(7d058e310f398cfa). (DataGuicxx . . $ DataGui# me, bool selected) { |
| 88 | return |
| 89 | mycxx . . $ `melder/melder.h:44:9`! editablecxx . . $ structDataGui#editable(50ce9a9e25b4a850).() ? |
| 90 | selected ? DataGuiColour_EDITABLE_SELECTEDcxx . . $ DataGuiColour_EDITABLE_SELECTED. : DataGuiColour_EDITABLEcxx . . $ DataGuiColour_EDITABLE. |
| 91 | : |
| 92 | selected ? DataGuiColour_NONEDITABLE_SELECTEDcxx . . $ DataGuiColour_NONEDITABLE_SELECTED. : DataGuiColour_NONEDITABLEcxx . . $ DataGuiColour_NONEDITABLE.; |
| 93 | } |
| 94 | }; |
| 95 | |
| 96 | /* |
| 97 | * The following two procedures are in praat_picture.cpp. |
| 98 | * They allow DataGuis to draw into the Picture window. |
| 99 | */ |
| 100 | Graphicscxx . . $ Graphics# praat_picture_datagui_opencxx . . $ praat_picture_datagui_open(fd9aabc8505e6f7b). (bool eraseFirst); |
| 101 | void praat_picture_datagui_closecxx . . $ praat_picture_datagui_close(49f6e7a06ebc5aa8). (); |
| 102 | |
| 103 | /* End of file DataGui.h */ |
| 104 | #endif |