/* Copyright (c) 2022 Alex Diener This software is provided 'as-is', without any express or implied warranty. In no event will the authors be held liable for any damages arising from the use of this software. Permission is granted to anyone to use this software for any purpose, including commercial applications, and to alter it and redistribute it freely, subject to the following restrictions: 1. The origin of this software must not be misrepresented; you must not claim that you wrote the original software. If you use this software in a product, an acknowledgment in the product documentation would be appreciated but is not required. 2. Altered source versions must be plainly marked as such, and must not be misrepresented as being the original software. 3. This notice may not be removed or altered from any source distribution. Alex Diener alex@ludobloom.com */ #ifndef __UIWindowRoot_H__ #define __UIWindowRoot_H__ #ifdef __cplusplus extern "C" { #endif typedef struct UIWindowRoot UIWindowRoot; #define UIWindowRoot_superclass UIContainer #include "uitoolkit/UIContainer.h" #include "uitoolkit/UIWindowView.h" #define UIWindowRoot_ivars \ UIContainer_ivars \ \ UIWindowView ** windows; \ unsigned int windowCount; \ unsigned int private_ivar(windowAllocatedCount); #define UIWindowRoot_vtable(self_type) \ UIContainer_vtable(self_type) stemobject_declare(UIWindowRoot) UIWindowRoot * UIWindowRoot_create(void); bool UIWindowRoot_init(UIWindowRoot * self); void UIWindowRoot_dispose(UIWindowRoot * self); void UIWindowRoot_hitTestList(UIWindowRoot * self, float x, float y, UIHitTestType type, int priorityOffset, UIHitTestResultIO * resultIO); void UIWindowRoot_addWindow(UIWindowRoot * self, compat_type(UIWindowView *) window, bool takeOwnership); void UIWindowRoot_removeWindow(UIWindowRoot * self, compat_type(UIWindowView *) window); unsigned int UIWindowRoot_getWindowIndex(UIWindowRoot * self, compat_type(UIWindowView *) window); bool UIWindowRoot_isFrontWindow(UIWindowRoot * self, compat_type(UIWindowView *) window); void UIWindowRoot_bringWindowToFront(UIWindowRoot * self, compat_type(UIWindowView *) window); bool UIWindowRoot_hasModalDialog(UIWindowRoot * self); UIWindowView * UIWindowRoot_hitTestWindow(UIWindowRoot * self, float x, float y); UIWindowView * UIWindowRoot_getFrontVisibleWindow(UIWindowRoot * self); UIWindowView * UIWindowRoot_getFocusedWindow(UIWindowRoot * self); void UIWindowRoot_focusFrontWindow(UIWindowRoot * self); #ifdef __cplusplus } #endif #endif