@@ -188,19 +188,38 @@ new work easier to reason about.
188188`ViewerState `
189189-------------
190190
191- `ViewerState ` in `src/imiv/imiv_viewer.h ` is the runtime model for the loaded
192- image and its current interaction state. It owns:
191+ `ViewerState ` in `src/imiv/imiv_viewer.h ` is the per-view runtime model for the
192+ currently displayed image and its interaction state. It owns:
193193
194194* the current `LoadedImage `;
195195* status and error text;
196196* zoom, scroll, zoom pivot, and fit behavior;
197197* selection and area-probe state;
198- * the loaded-image list and recent-image list ;
198+ * the current loaded-image index within the shared library ;
199199* windowed/fullscreen placement;
200200* the current `RendererTexture `.
201201
202- If state is tied to the currently loaded image or to navigation through that
203- image, it usually belongs here.
202+ If state is tied to one image pane and its navigation state, it usually
203+ belongs here.
204+
205+ `ImageLibraryState ` and `MultiViewWorkspace `
206+ --------------------------------------------
207+
208+ The first multi-view slice introduces two more shared state buckets in
209+ `src/imiv/imiv_viewer.h `:
210+
211+ * `ImageLibraryState `
212+ owns the shared loaded-image queue, recent-image history, and sort mode;
213+ * `MultiViewWorkspace `
214+ owns the open image windows, the active view id, and Image List visibility.
215+
216+ Each `ImageViewWindow ` owns one `ViewerState `. The main `Image ` window is the
217+ primary view. Additional `Image N ` windows are created from
218+ `File -> New view from current image ` or by double-clicking entries in the
219+ Image List window.
220+
221+ This split matters: queue history is now global to the workspace, but image
222+ interaction state remains per view.
204223
205224`PlaceholderUiState `
206225--------------------
@@ -217,6 +236,12 @@ image, it usually belongs here.
217236If state describes how the UI should look or how preview rendering should be
218237configured across launches, it usually belongs here.
219238
239+ At the moment, this also means preview controls are still shared across all
240+ open image views. Exposure, gamma, offset, interpolation, and OCIO selection
241+ remain global UI state rather than per-view state. Splitting those controls
242+ into per-view state is a follow-up task, not part of the first multi-view
243+ milestone.
244+
220245`DeveloperUiState `
221246------------------
222247
@@ -241,8 +266,8 @@ layout state together in a single `imiv.inf` file.
241266
242267* the Dear ImGui `.ini ` text first, straight from
243268 `ImGui::SaveIniSettingsToMemory() `;
244- * then an `ImivApp ` settings section with `PlaceholderUiState ` and a small
245- amount of `ViewerState `.
269+ * then an `ImivApp ` settings section with `PlaceholderUiState `,
270+ ` ImageLibraryState `, and a small amount of `ViewerState `.
246271
247272This is worth preserving. It gives :program: `imiv ` one file for:
248273
@@ -273,10 +298,11 @@ The current order is:
2732986. execute queued state mutations with `execute_viewer_frame_actions() `;
2742997. process drag and drop and auto-subimage work;
2753008. clamp UI state;
276- 9. update the renderer preview texture from the current preview controls;
301+ 9. update the renderer preview texture for the active view from the current
302+ preview controls;
27730310. build the dockspace host window;
278- 11. draw the main image window;
279- 12. draw auxiliary windows and popups;
304+ 11. draw the main image window and any secondary ` Image N ` windows ;
305+ 12. draw the Image List window, auxiliary windows, and popups;
28030613. draw developer-mode Dear ImGui diagnostic windows and the drag overlay.
281307
282308Two design choices here are important:
@@ -309,6 +335,14 @@ The main image window:
309335* is assigned to the dockspace with `ImGui::SetNextWindowDockID() `;
310336* uses `ImGuiWindowClass ` to request `ImGuiDockNodeFlags_AutoHideTabBar `.
311337
338+ Secondary image windows:
339+
340+ * are named `Image N `;
341+ * are created as ordinary Dear ImGui windows with the same image-window class;
342+ * are forced into the main dockspace on first creation;
343+ * currently use `ImGuiDockNodeFlags_NoUndocking `;
344+ * inherit the same shared preview/renderer policy as the primary view.
345+
312346Why there is no `DockBuilder `
313347-----------------------------
314348
@@ -331,6 +365,8 @@ The main windows are:
331365
332366* the dockspace host window;
333367* the `Image ` window;
368+ * zero or more `Image N ` windows;
369+ * `Image List `;
334370* `iv Info `;
335371* `iv Preferences `;
336372* `Preview `;
0 commit comments