Add CLion style.
[SquirrelJME.git] / nanocoat / include / lib / scritchui / scritchuiImpl.h
blob1715da547d65f2a1a42f22091c0c0fc4995e9e9e
1 /* -*- Mode: C; indent-tabs-mode: t; tab-width: 4 -*-
2 // ---------------------------------------------------------------------------
3 // SquirrelJME
4 // Copyright (C) Stephanie Gawroriski <xer@multiphasicapps.net>
5 // ---------------------------------------------------------------------------
6 // SquirrelJME is under the Mozilla Public License Version 2.0.
7 // See license.mkd for licensing and copyright information.
8 // -------------------------------------------------------------------------*/
10 /**
11 * ScritchUI implementation interface.
13 * @since 2024/04/06
16 #ifndef SQUIRRELJME_SCRITCHUIIMPL_H
17 #define SQUIRRELJME_SCRITCHUIIMPL_H
19 #include "lib/scritchui/scritchui.h"
20 #include "lib/scritchui/scritchuiTypesListener.h"
22 /* Anti-C++. */
23 #ifdef __cplusplus
24 #ifndef SJME_CXX_IS_EXTERNED
25 #define SJME_CXX_IS_EXTERNED
26 #define SJME_CXX_SQUIRRELJME_SCRITCHUIIMPL_H
27 extern "C" {
28 #endif /* #ifdef SJME_CXX_IS_EXTERNED */
29 #endif /* #ifdef __cplusplus */
31 /*--------------------------------------------------------------------------*/
33 /**
34 * Obtains the core listener for the given type.
36 * @param item The structure to access.
37 * @param specific The specific listener that is wanted.
38 * @return A pointer to the listener info.
39 * @since 2024/05/01
41 #define SJME_SCRITCHUI_LISTENER_CORE(item, specific) \
42 ((item)->listeners[SJME_SCRITCHUI_LISTENER_CORE].specific)
44 /**
45 * Obtains the user listener for the given type.
47 * @param item The structure to access.
48 * @param specific The specific listener that is wanted.
49 * @return A pointer to the listener info.
50 * @since 2024/05/01
52 #define SJME_SCRITCHUI_LISTENER_USER(item, specific) \
53 ((item)->listeners[SJME_SCRITCHUI_LISTENER_USER].specific)
55 /**
56 * List initialization parameters.
58 * @since 2024/07/24
60 typedef struct sjme_scritchui_impl_initParamList
62 /** The type of choice used. */
63 sjme_scritchui_choiceType type;
64 } sjme_scritchui_impl_initParamList;
66 /**
67 * Initialization parameters for menu items.
69 * @since 2024/08/01
71 typedef struct sjme_scritchui_impl_initParamMenuItem
73 /** The opaque ID to use for the item. */
74 sjme_jint opaqueId;
75 } sjme_scritchui_impl_initParamMenuItem;
77 /**
78 * Implementation specific initialization.
80 * @param inState The state being initialized.
81 * @return Any resultant error, if any.
82 * @since 2024/04/15
84 typedef sjme_errorCode (*sjme_scritchui_impl_apiInitFunc)(
85 sjme_attrInNotNull sjme_scritchui inState);
87 /**
88 * Adds the given component to the specified container.
90 * @param inState The input state.
91 * @param inContainer The container to place the component within.
92 * @param addComponent The component to add to the container.
93 * @return Any error code if applicable.
94 * @since 2024/04/20
96 typedef sjme_errorCode (*sjme_scritchui_impl_containerAddFunc)(
97 sjme_attrInNotNull sjme_scritchui inState,
98 sjme_attrInNotNull sjme_scritchui_uiComponent inContainer,
99 sjme_attrInNotNull sjme_scritchui_uiContainer inContainerData,
100 sjme_attrInNotNull sjme_scritchui_uiComponent addComponent);
103 * Removes the given component from the specified container.
105 * @param inState The input state.
106 * @param inContainer The container to remove the component within.
107 * @param removeComponent The component to remove from the container.
108 * @return Any error code if applicable.
109 * @since 2024/07/15
111 typedef sjme_errorCode (*sjme_scritchui_impl_containerRemoveFunc)(
112 sjme_attrInNotNull sjme_scritchui inState,
113 sjme_attrInNotNull sjme_scritchui_uiComponent inContainer,
114 sjme_attrInNotNull sjme_scritchui_uiContainer inContainerData,
115 sjme_attrInNotNull sjme_scritchui_uiComponent removeComponent);
118 * Creates a new native list.
120 * @param inState The input ScritchUI state.
121 * @param inList The list that was created.
122 * @param init Initializer data for the list.
123 * @return Any error code as per implementation.
124 * @since 2024/04/06
126 typedef sjme_errorCode (*sjme_scritchui_impl_listNewFunc)(
127 sjme_attrInNotNull sjme_scritchui inState,
128 sjme_attrInNotNull sjme_scritchui_uiList inList,
129 sjme_attrInNotNull const sjme_scritchui_impl_initParamList* init);
132 * Creates a new native menu bar.
134 * @param inState The input ScritchUI state.
135 * @param inMenuBar The menu bar that was created.
136 * @param ignored Ignored, not used.
137 * @return Any resultant error, if any.
138 * @since 2024/07/21
140 typedef sjme_errorCode (*sjme_scritchui_impl_menuBarNewFunc)(
141 sjme_attrInNotNull sjme_scritchui inState,
142 sjme_attrInNotNull sjme_scritchui_uiMenuBar inMenuBar,
143 sjme_attrInNullable sjme_pointer ignored);
146 * Creates a new native menu item.
148 * @param inState The input ScritchUI state.
149 * @param inMenuItem The menu item that was created.
150 * @param ignored Ignored, not used.
151 * @return Any resultant error, if any.
152 * @since 2024/07/21
154 typedef sjme_errorCode (*sjme_scritchui_impl_menuItemNewFunc)(
155 sjme_attrInNotNull sjme_scritchui inState,
156 sjme_attrInNotNull sjme_scritchui_uiMenuItem inMenuItem,
157 sjme_attrInValue const sjme_scritchui_impl_initParamMenuItem* init);
160 * Creates a new native menu.
162 * @param inState The input ScritchUI state.
163 * @param inMenu The menu that was created.
164 * @param ignored Ignored, not used.
165 * @return Any resultant error, if any.
166 * @since 2024/07/21
168 typedef sjme_errorCode (*sjme_scritchui_impl_menuNewFunc)(
169 sjme_attrInNotNull sjme_scritchui inState,
170 sjme_attrInNotNull sjme_scritchui_uiMenu inMenu,
171 sjme_attrInNullable sjme_pointer ignored);
174 * Creates a new native panel.
176 * @param inState The input ScritchUI state.
177 * @param inPanel The panel that was created.
178 * @param ignored Ignored, not used.
179 * @return Any error code as per implementation.
180 * @since 2024/04/06
182 typedef sjme_errorCode (*sjme_scritchui_impl_panelNewFunc)(
183 sjme_attrInNotNull sjme_scritchui inState,
184 sjme_attrInNotNull sjme_scritchui_uiPanel inPanel,
185 sjme_attrInNullable sjme_pointer ignored);
188 * Creates a new native scroll panel.
190 * @param inState The input ScritchUI state.
191 * @param inScrollPanel The scroll panel that was created.
192 * @param ignored Ignored, not used.
193 * @return Any error code as per implementation.
194 * @since 2024/07/29
196 typedef sjme_errorCode (*sjme_scritchui_impl_scrollPanelNewFunc)(
197 sjme_attrInNotNull sjme_scritchui inState,
198 sjme_attrInNotNull sjme_scritchui_uiScrollPanel inScrollPanel,
199 sjme_attrInNullable sjme_pointer ignored);
202 * Sets the area that the scroll panel provides a viewport area, this area
203 * may be larger than the viewport and widgets may be placed inside.
205 * @param inState The ScritchUI state.
206 * @param inComponent The viewport.
207 * @param inViewArea The view area to set.
208 * @param inViewPage The viewing page to set.
209 * @return Any resultant error, if any.
210 * @since 2024/07/07
212 typedef sjme_errorCode (*sjme_scritchui_impl_viewSetAreaFunc)(
213 sjme_attrInNotNull sjme_scritchui inState,
214 sjme_attrInNotNull sjme_scritchui_uiComponent inComponent,
215 sjme_attrInNotNull const sjme_scritchui_dim* inViewArea,
216 sjme_attrInNotNull const sjme_scritchui_dim* inViewPage);
219 * Creates a new window.
221 * @param inState The input state.
222 * @param inWindow The window that was created.
223 * @param ignored Ignored, not used at all.
224 * @return Any resultant error, if any.
225 * @since 2024/04/24
227 typedef sjme_errorCode (*sjme_scritchui_impl_windowNewFunc)(
228 sjme_attrInNotNull sjme_scritchui inState,
229 sjme_attrInNotNull sjme_scritchui_uiWindow inWindow,
230 sjme_attrInNullable sjme_pointer ignored);
232 #define SJME_SCRITCHUI_QUICK_IMPL(x) \
233 SJME_TOKEN_PASTE3(sjme_scritchui_impl_, x, Func) x
235 /** Uses the same main implementation. */
236 #define SJME_SCRITCHUI_QUICK_SAME(x) \
237 SJME_TOKEN_PASTE3(sjme_scritchui_, x, Func) x
239 struct sjme_scritchui_implFunctions
241 /** Initialize implementation API instance. */
242 SJME_SCRITCHUI_QUICK_IMPL(apiInit);
244 /** Inserts an item into the given choice. */
245 SJME_SCRITCHUI_QUICK_SAME(choiceItemInsert);
247 /** Removes an item from the given choice. */
248 SJME_SCRITCHUI_QUICK_SAME(choiceItemRemove);
250 /** Sets whether the given choice item is enabled. */
251 SJME_SCRITCHUI_QUICK_SAME(choiceItemSetEnabled);
253 /** Sets the image of the given choice item. */
254 SJME_SCRITCHUI_QUICK_SAME(choiceItemSetImage);
256 /** Sets whether the given choice item is selected. */
257 SJME_SCRITCHUI_QUICK_SAME(choiceItemSetSelected);
259 /** Sets the string of the given choice item. */
260 SJME_SCRITCHUI_QUICK_SAME(choiceItemSetString);
262 /** Grabs the focus for this component. */
263 SJME_SCRITCHUI_QUICK_SAME(componentFocusGrab);
265 /** Checks if this component has focus. */
266 SJME_SCRITCHUI_QUICK_SAME(componentFocusHas);
268 /** Get the position of a component. */
269 SJME_SCRITCHUI_QUICK_SAME(componentPosition);
271 /** Repaint component. */
272 SJME_SCRITCHUI_QUICK_SAME(componentRepaint);
274 /** Revalidate component. */
275 SJME_SCRITCHUI_QUICK_SAME(componentRevalidate);
277 /** Sets the activate listener for a component. */
278 SJME_SCRITCHUI_QUICK_SAME(componentSetActivateListener);
280 /** Sets the input listener for a component. */
281 SJME_SCRITCHUI_QUICK_SAME(componentSetInputListener);
283 /** Set paint listener for component. */
284 SJME_SCRITCHUI_QUICK_SAME(componentSetPaintListener);
286 /** Set size listener for component. */
287 SJME_SCRITCHUI_QUICK_SAME(componentSetSizeListener);
289 /** Sets the listener for component visible events. */
290 SJME_SCRITCHUI_QUICK_SAME(componentSetVisibleListener);
292 /** Get size of component. */
293 SJME_SCRITCHUI_QUICK_SAME(componentSize);
295 /** Add component to container. */
296 SJME_SCRITCHUI_QUICK_IMPL(containerAdd);
298 /** Remove component from container. */
299 SJME_SCRITCHUI_QUICK_IMPL(containerRemove);
301 /** Set bounds of component in container. */
302 SJME_SCRITCHUI_QUICK_SAME(containerSetBounds);
304 /** Hardware graphics support on arbitrary buffers. */
305 SJME_SCRITCHUI_QUICK_SAME(hardwareGraphics);
307 /** Sets the close listener for a window. */
308 SJME_SCRITCHUI_QUICK_SAME(labelSetString);
310 /** Returns the element color for the look and feel. */
311 SJME_SCRITCHUI_QUICK_SAME(lafElementColor);
313 /** Creates a new native list. */
314 SJME_SCRITCHUI_QUICK_IMPL(listNew);
316 /** Execute callback within the event loop or schedule later. */
317 SJME_SCRITCHUI_QUICK_SAME(loopExecute);
319 /** Execute call later in the loop. */
320 sjme_scritchui_loopExecuteFunc loopExecuteLater;
322 /** Execute callback within the event loop and wait until termination. */
323 sjme_scritchui_loopExecuteFunc loopExecuteWait;
325 /** Iterates a single run of the event loop. */
326 SJME_SCRITCHUI_QUICK_SAME(loopIterate);
328 /** Creates a new menu bar. */
329 SJME_SCRITCHUI_QUICK_IMPL(menuBarNew);
331 /** Insert menu into menu. */
332 SJME_SCRITCHUI_QUICK_SAME(menuInsert);
334 /** Creates a new menu item. */
335 SJME_SCRITCHUI_QUICK_IMPL(menuItemNew);
337 /** Removes an item from the menu. */
338 SJME_SCRITCHUI_QUICK_SAME(menuRemove);
340 /** Creates a new menu. */
341 SJME_SCRITCHUI_QUICK_IMPL(menuNew);
343 /** Enable/disable focus on a panel. */
344 SJME_SCRITCHUI_QUICK_SAME(panelEnableFocus);
346 /** Creates a new native panel. */
347 SJME_SCRITCHUI_QUICK_IMPL(panelNew);
349 /** The available screens. */
350 SJME_SCRITCHUI_QUICK_SAME(screens);
352 /** Create a new scroll panel. */
353 SJME_SCRITCHUI_QUICK_IMPL(scrollPanelNew);
355 /** Get the current view rect of a viewport. */
356 SJME_SCRITCHUI_QUICK_SAME(viewGetView);
358 /** Set the area of the viewport's bounds, the entire scrollable area. */
359 SJME_SCRITCHUI_QUICK_IMPL(viewSetArea);
361 /** Sets the view rect of a viewport. */
362 SJME_SCRITCHUI_QUICK_SAME(viewSetView);
364 /** Sets the listener for tracking scrolling and viewport changes. */
365 SJME_SCRITCHUI_QUICK_SAME(viewSetViewListener);
367 /** Set minimum size of content window. */
368 SJME_SCRITCHUI_QUICK_SAME(windowContentMinimumSize);
370 /** Creates a new window. */
371 SJME_SCRITCHUI_QUICK_IMPL(windowNew);
373 /** Set close listener for a window. */
374 SJME_SCRITCHUI_QUICK_SAME(windowSetCloseListener);
376 /** Sets the menu bar for a window. */
377 SJME_SCRITCHUI_QUICK_SAME(windowSetMenuBar);
379 /** Sets visibility of the window. */
380 SJME_SCRITCHUI_QUICK_SAME(windowSetVisible);
383 #undef SJME_SCRITCHUI_QUICK_IMPL
384 #undef SJME_SCRITCHUI_QUICK_SAME
387 * This is called to bind the focus to a parent window.
389 * @param inState The input state.
390 * @param atRover The current roving component.
391 * @param bindComponent The component to bind.
392 * @param isGrabbing Is focus being grabbed?
393 * @return Any resultant error, if any.
394 * @since 2024/08/07
396 typedef sjme_errorCode (*sjme_scritchui_intern_bindFocusFunc)(
397 sjme_attrInNotNull sjme_scritchui inState,
398 sjme_attrInNotNull sjme_scritchui_uiComponent atRover,
399 sjme_attrInNotNull sjme_scritchui_uiComponent bindComponent,
400 sjme_attrInValue sjme_jboolean isGrabbing);
403 * Returns the choice for the given component.
405 * @param inState The input state.
406 * @param inComponent The input component.
407 * @param outChoice The resultant choice.
408 * @return Any error code if applicable, such as the component is not valid.
409 * @since 2024/07/16
411 typedef sjme_errorCode (*sjme_scritchui_intern_getChoiceFunc)(
412 sjme_attrInNotNull sjme_scritchui inState,
413 sjme_attrInNotNull sjme_scritchui_uiComponent inComponent,
414 sjme_attrInOutNotNull sjme_scritchui_uiChoice* outChoice);
417 * Returns the container for the given component.
419 * @param inState The input state.
420 * @param inComponent The input component.
421 * @param outContainer The resultant container.
422 * @return Any error code if applicable, such as the component is not valid.
423 * @since 2024/04/20
425 typedef sjme_errorCode (*sjme_scritchui_intern_getContainerFunc)(
426 sjme_attrInNotNull sjme_scritchui inState,
427 sjme_attrInNotNull sjme_scritchui_uiComponent inComponent,
428 sjme_attrInOutNotNull sjme_scritchui_uiContainer* outContainer);
431 * Returns the labeled item for the given component.
433 * @param inState The input state.
434 * @param inCommon The input common item.
435 * @param outLabeled The resultant labeled item.
436 * @return Any error code if applicable, such as the component is not valid.
437 * @since 2024/07/22
439 typedef sjme_errorCode (*sjme_scritchui_intern_getLabeledFunc)(
440 sjme_attrInNotNull sjme_scritchui inState,
441 sjme_attrInNotNull sjme_scritchui_uiCommon inCommon,
442 sjme_attrInOutNotNull sjme_scritchui_uiLabeled* outLabeled);
445 * Return children information for a given menu kind.
447 * @param inState The input state.
448 * @param inMenuKind The input menu kind.
449 * @param outHasChildren The resultant children information.
450 * @return Any error code if applicable, such as the component is not valid.
451 * @since 2024/07/22
453 typedef sjme_errorCode (*sjme_scritchui_intern_getMenuHasChildrenFunc)(
454 sjme_attrInNotNull sjme_scritchui inState,
455 sjme_attrInNotNull sjme_scritchui_uiMenuKind inMenuKind,
456 sjme_attrInOutNotNull sjme_scritchui_uiMenuHasChildren* outHasChildren);
459 * Return parent information for a given menu kind.
461 * @param inState The input state.
462 * @param inMenuKind The input menu kind.
463 * @param outHasParent The resultant parent information.
464 * @return Any error code if applicable, such as the component is not valid.
465 * @since 2024/07/22
467 typedef sjme_errorCode (*sjme_scritchui_intern_getMenuHasParentFunc)(
468 sjme_attrInNotNull sjme_scritchui inState,
469 sjme_attrInNotNull sjme_scritchui_uiMenuKind inMenuKind,
470 sjme_attrInOutNotNull sjme_scritchui_uiMenuHasParent* outHasParent);
473 * Returns the container for the given component.
475 * @param inState The input state.
476 * @param inComponent The input component.
477 * @param outPaintable The resultant paintable.
478 * @return Any error code if applicable, such as the component is not valid.
479 * @since 2024/04/20
481 typedef sjme_errorCode (*sjme_scritchui_intern_getPaintableFunc)(
482 sjme_attrInNotNull sjme_scritchui inState,
483 sjme_attrInNotNull sjme_scritchui_uiComponent inComponent,
484 sjme_attrInOutNotNull sjme_scritchui_uiPaintable* outPaintable);
487 * Returns the viewport manager for the given component.
489 * @param inState The input state.
490 * @param inComponent The input component.
491 * @param outView The resultant viewport manager.
492 * @return Any error code if applicable, such as the component is not valid.
493 * @since 2024/07/29
495 typedef sjme_errorCode (*sjme_scritchui_intern_getViewFunc)(
496 sjme_attrInNotNull sjme_scritchui inState,
497 sjme_attrInNotNull sjme_scritchui_uiComponent inComponent,
498 sjme_attrInOutNotNull sjme_scritchui_uiView* outView);
501 * Common base common initialization for before and after create.
503 * @param inState The input state.
504 * @param inCommon The input common.
505 * @param postCreate Is this after the create call?
506 * @param uiType The type of common this is.
507 * @return Any resultant error, if any.
508 * @since 2024/07/19
510 typedef sjme_errorCode (*sjme_scritchui_intern_initCommonFunc)(
511 sjme_attrInNotNull sjme_scritchui inState,
512 sjme_attrInNotNull sjme_scritchui_uiCommon inCommon,
513 sjme_attrInValue sjme_jboolean postCreate,
514 sjme_attrInRange(0, SJME_NUM_SCRITCHUI_UI_TYPES)
515 sjme_scritchui_uiType uiType);
518 * Common component initialization function for before and after create.
520 * @param inState The input state.
521 * @param inComponent The input component.
522 * @param postCreate Is this after the create call?
523 * @param uiType The type of component this is.
524 * @return Any resultant error, if any.
525 * @since 2024/04/26
527 typedef sjme_errorCode (*sjme_scritchui_intern_initComponentFunc)(
528 sjme_attrInNotNull sjme_scritchui inState,
529 sjme_attrInNotNull sjme_scritchui_uiComponent inComponent,
530 sjme_attrInValue sjme_jboolean postCreate,
531 sjme_attrInRange(0, SJME_NUM_SCRITCHUI_UI_TYPES)
532 sjme_scritchui_uiType uiType);
535 * Maps the given screen internally.
537 * @param inState The input state.
538 * @param screenId The screen ID to map.
539 * @param outScreen The resultant screen, may be newly created or one that
540 * already exists.
541 * @param updateHandle If not @c NULL then the handle is updated to this.
542 * @return Any resultant error, if any.
543 * @since 2024/04/15
545 typedef sjme_errorCode (*sjme_scritchui_intern_mapScreenFunc)(
546 sjme_attrInNotNull sjme_scritchui inState,
547 sjme_attrInValue sjme_jint screenId,
548 sjme_attrInOutNotNull sjme_scritchui_uiScreen* outScreen,
549 sjme_attrInNullable sjme_scritchui_handle updateHandle);
552 * Activates a menu item by propagating upwards to the bar and owning window,
553 * this is mostly intended for widget systems where menus are individually
554 * activated rather than at the top level.
556 * @param inState The input state.
557 * @param atRover The current menu item, menu, or menu bar.
558 * @param itemActivated The item that was activated, this does not change.
559 * @return Any resultant error, if any.
560 * @since 2024/07/30
562 typedef sjme_errorCode (*sjme_scritchui_intern_menuItemActivateFunc)(
563 sjme_attrInNotNull sjme_scritchui inState,
564 sjme_attrInNotNull sjme_scritchui_uiMenuKind atRover,
565 sjme_attrInNotNull sjme_scritchui_uiMenuKind itemActivated);
568 * Activates a menu item by propagating downwards from the bar.
570 * @param inState The input state.
571 * @param inWindow The window this is starting from.
572 * @param atRover The current menu item, menu, or menu bar.
573 * @param itemActivated The item ID that was activated, this does not change.
574 * @param itemMask The mask that is valid for item IDs.
575 * @return Any resultant error, if any.
576 * @since 2024/08/06
578 typedef sjme_errorCode (*sjme_scritchui_intern_menuItemActivateByIdFunc)(
579 sjme_attrInNotNull sjme_scritchui inState,
580 sjme_attrInNotNull sjme_scritchui_uiWindow inWindow,
581 sjme_attrInNotNull sjme_scritchui_uiMenuKind atRover,
582 sjme_attrInNotNull sjme_jint itemActivated,
583 sjme_attrInValue sjme_jint itemMask);
586 * Sets a simpler listener.
588 * @param inState The ScritchUI state.
589 * @param infoAny The callback information to set.
590 * @param inListener The listener to set or remove.
591 * @param copyFrontEnd The front end to copy.
592 * @return Any resultant error, if any.
593 * @since 2024/07/19
595 typedef sjme_errorCode (*sjme_scritchui_intern_setSimpleListenerFunc)(
596 sjme_attrInNotNull sjme_scritchui inState,
597 sjme_attrInNotNull sjme_scritchui_listener_void* infoAny,
598 SJME_SCRITCHUI_SET_LISTENER_ARGS(void));
601 * Suggests that the parent of a component, if there is one and that it is
602 * a view, that it should have this suggested size.
604 * @param inState The ScritchUI state.
605 * @param inComponent The component making the suggestion.
606 * @param suggestDim The suggested dimension.
607 * @return Any resultant error, if any.
608 * @since 2024/07/19
610 typedef sjme_errorCode (*sjme_scritchui_intern_viewSuggestFunc)(
611 sjme_attrInNotNull sjme_scritchui inState,
612 sjme_attrInNotNull sjme_scritchui_uiComponent inComponent,
613 sjme_attrInNotNull sjme_scritchui_dim* suggestDim);
616 * Updates the visibility state of a container.
618 * @param inState The input state.
619 * @param inContainer The input container.
620 * @param isVisible Is this now visible?
621 * @since 2024/06/28
623 typedef sjme_errorCode (*sjme_scritchui_intern_updateVisibleContainerFunc)(
624 sjme_attrInNotNull sjme_scritchui inState,
625 sjme_attrInNotNull sjme_scritchui_uiComponent inContainer,
626 sjme_attrInValue sjme_jboolean isVisible);
629 * Updates the visibility state of a container.
631 * @param inState The input state.
632 * @param inComponent The input component.
633 * @param isVisible Is this now visible?
634 * @since 2024/06/28
636 typedef sjme_errorCode (*sjme_scritchui_intern_updateVisibleComponentFunc)(
637 sjme_attrInNotNull sjme_scritchui inState,
638 sjme_attrInNotNull sjme_scritchui_uiComponent inComponent,
639 sjme_attrInValue sjme_jboolean isVisible);
642 * Updates the visibility state of a window.
644 * @param inState The input state.
645 * @param inWindow The input window.
646 * @param isVisible Is this now visible?
647 * @since 2024/06/28
649 typedef sjme_errorCode (*sjme_scritchui_intern_updateVisibleWindowFunc)(
650 sjme_attrInNotNull sjme_scritchui inState,
651 sjme_attrInNotNull sjme_scritchui_uiWindow inWindow,
652 sjme_attrInValue sjme_jboolean isVisible);
654 struct sjme_scritchui_internFunctions
656 /** Binds focus to a window. */
657 sjme_scritchui_intern_bindFocusFunc bindFocus;
659 /** Returns the built-in font, this can handle layers. */
660 sjme_scritchui_fontBuiltinFunc fontBuiltin;
662 /** Returns the choice for the given component. */
663 sjme_scritchui_intern_getChoiceFunc getChoice;
665 /** Returns the container for the given component. */
666 sjme_scritchui_intern_getContainerFunc getContainer;
668 /** Returns the labeled item for the given component. */
669 sjme_scritchui_intern_getLabeledFunc getLabeled;
671 /** Return children information for a given menu kind. */
672 sjme_scritchui_intern_getMenuHasChildrenFunc getMenuHasChildren;
674 /** Return parent information for a given menu kind. */
675 sjme_scritchui_intern_getMenuHasParentFunc getMenuHasParent;
677 /** Returns the paintable for the given component. */
678 sjme_scritchui_intern_getPaintableFunc getPaintable;
680 /** Returns the viewport manager for the given component. */
681 sjme_scritchui_intern_getViewFunc getView;
683 /** Common "common" initialization. */
684 sjme_scritchui_intern_initCommonFunc initCommon;
686 /** Common component initialization. */
687 sjme_scritchui_intern_initComponentFunc initComponent;
689 /** Maps the given screen. */
690 sjme_scritchui_intern_mapScreenFunc mapScreen;
692 /** Menu item activation propagation, from bottom up. */
693 sjme_scritchui_intern_menuItemActivateFunc menuItemActivate;
695 /** Menu item activation propagation, from top down. */
696 sjme_scritchui_intern_menuItemActivateByIdFunc menuItemActivateById;
698 /** Set of simple user listener. */
699 sjme_scritchui_intern_setSimpleListenerFunc setSimpleListener;
701 /** Update visibility recursively on container. */
702 sjme_scritchui_intern_updateVisibleContainerFunc updateVisibleContainer;
704 /** Update visibility on component. */
705 sjme_scritchui_intern_updateVisibleComponentFunc updateVisibleComponent;
707 /** Update visibility recursively on window. */
708 sjme_scritchui_intern_updateVisibleWindowFunc updateVisibleWindow;
710 /** Suggest the size and position of a coordinate to a view. */
711 sjme_scritchui_intern_viewSuggestFunc viewSuggest;
714 /*--------------------------------------------------------------------------*/
716 /* Anti-C++. */
717 #ifdef __cplusplus
718 #ifdef SJME_CXX_SQUIRRELJME_SCRITCHUIIMPL_H
720 #undef SJME_CXX_SQUIRRELJME_SCRITCHUIIMPL_H
721 #undef SJME_CXX_IS_EXTERNED
722 #endif /* #ifdef SJME_CXX_SQUIRRELJME_SCRITCHUIIMPL_H */
723 #endif /* #ifdef __cplusplus */
725 #endif /* SQUIRRELJME_SCRITCHUIIMPL_H */