| 1 | |
| 2 | # Overview |
| 3 | |
| 4 | >See general-class-diagram.dia |
| 5 | |
| 6 | ## The application |
| 7 | |
| 8 | `main.py` defines the application, which has: |
| 9 | |
| 10 | - implementations of CLI handling methods |
| 11 | - some `GioAction`s |
| 12 | - a preferences window (`preferences.py`) |
| 13 | - a menubar (hidden with most layouts) |
| 14 | - an appmenu (for GNOME Shell ≤ 3.30) |
| 15 | - dialogs (about, shortcuts) |
| 16 | - several **windows** |
| 17 | |
| 18 | ## Windows |
| 19 | |
| 20 | `window.py` defines a GtkApplicationWindow: |
| 21 | |
| 22 | - some `GioAction`s |
| 23 | - a window's decorations can change quite a lot, which is mostly handled by |
| 24 | `deco_manager.py`. Three classes are defined in this file: |
| 25 | - **`DrDecoManagerMenubar`** just hides or shows the menubar. Most of its |
| 26 | methods are empty. |
| 27 | - **`DrDecoManagerToolbar`** loads a toolbar from an UI file. This class |
| 28 | extends `DrDecoManagerMenubar`, and will manage a small "hamburger menu" at |
| 29 | the end of the toolbar if the menubar is hidden. |
| 30 | - **`DrDecoManagerHeaderbar`** loads a headerbar from an UI file. This class |
| 31 | extends `DrDecoManagerMenubar` but the menubar will always stay hidden. |
| 32 | It handles how widgets are shown or hidden depending on the size of the |
| 33 | window, and will display various menus depending on the visibility of the |
| 34 | buttons, to ensure all features are always available. |
| 35 | - a window has several **tools**. They're initialized in a dedicated class (see |
| 36 | `tools_initializer.py`) for no good reason. |
| 37 | - a window has several **images** |
| 38 | - `minimap.py` for the minimap, which shows a thumbnail of the currently opened image. |
| 39 | - each window has an **options_manager** (`options_manager.py`). It will display |
| 40 | the correct bottom bar (= the one required by the current **tool**) and manage |
| 41 | tools' options. All bottom options bars can be found in the sub-directories of |
| 42 | `src/optionsbars/`, and are specialized from `src/optionsbars/abstract_optionsbar.py` |
| 43 | - the **saving_manager** encapsulates all various methods to save or export a |
| 44 | `Gdk.Pixbuf` as a file, with modal dialog windows to ask for confirmation, to |
| 45 | replace transparency according to the settings, etc. |
| 46 | |
| 47 | ## Images |
| 48 | |
| 49 | `image.py` defines an image (= a tab), which contains: |
| 50 | |
| 51 | - a `GdkPixbuf.Pixbuf` (as an attribute), named `main_pixbuf`, which corresponds |
| 52 | to the current state of the edited image. |
| 53 | - a file (`Gio.File`) which can be `None` (if it's a new image never saved). |
| 54 | - a history, managed by `history_manager.py` |
| 55 | - a selection, managed by `selection_manager.py` |
| 56 | - methods to manage the zoom and the scroll. |
| 57 | - methods to manage printing. |
| 58 | - methods to receive signals from the mouse, and transmit them to the tools. |
| 59 | |
| 60 | ## Tools |
| 61 | |
| 62 | [See here](./design-tools.md) |
| 63 | |
| 64 | ## Bottom pane |
| 65 | |
| 66 | [See here](./design-optionsbars.md) |
| 67 |