/* 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 __UIModalDialog_H__ #define __UIModalDialog_H__ #ifdef __cplusplus extern "C" { #endif typedef struct UIModalDialog UIModalDialog; #define UIModalDialog_superclass UIWindowView #include "uitoolkit/UIWindowView.h" #define MODAL_DIALOG_HIT_TEST_PRIORITY 2000 #define UIModalDialog_ivars \ UIWindowView_ivars #define UIModalDialog_vtable(self_type) \ UIWindowView_vtable(self_type) \ \ void (* drawScreenOverlay)(self_type * self, UIDrawingInterface * drawingInterface, VertexIO * vertexIO); \ bool (* dialogKeyDown)(self_type * self, unsigned int charCode, unsigned int keyCode, unsigned int modifiers, bool isRepeat, double referenceTime); stemobject_declare(UIModalDialog) bool UIModalDialog_init(UIModalDialog * self, Vector2f size, String title, UIWindowView_callback closeCallback, UIWindowView_resizeCallback resizeCallback, void * callbackContext, UIWindowRoot * windowRoot, UIAppearance appearance); void UIModalDialog_dispose(UIModalDialog * self); bool UIModalDialog_hitTest(UIModalDialog * self, float x, float y, UIHitTestType type, int * outPriority, bool * outForwardNext); void UIModalDialog_hitTestList(UIModalDialog * self, float x, float y, UIHitTestType type, int priorityOffset, UIHitTestResultIO * resultIO); UIEventResponse UIModalDialog_mouseDown(UIModalDialog * self, unsigned int buttonNumber, unsigned int buttonMask, float x, float y, unsigned int modifiers, bool isFinalTarget, double referenceTime); UIEventResponse UIModalDialog_keyDown(UIModalDialog * self, unsigned int charCode, unsigned int keyCode, unsigned int modifiers, bool isRepeat, bool isFinalTarget, double referenceTime); UIEventResponse UIModalDialog_scrollWheel(UIModalDialog * self, float x, float y, int deltaX, int deltaY, unsigned int modifiers, bool isFinalTarget, double referenceTime); void UIModalDialog_draw(UIModalDialog * self, Vector2f offset, UIDrawingInterface * drawingInterface, VertexIO * vertexIO); void UIModalDialog_listRenderables(UIModalDialog * self, RenderableIO * renderableIO, int drawOrderOffset, Rect4i clipBounds); bool UIModalDialog_isModal(UIModalDialog * self); void UIModalDialog_drawScreenOverlay(UIModalDialog * self, UIDrawingInterface * drawingInterface, VertexIO * vertexIO); bool UIModalDialog_dialogKeyDown(UIModalDialog * self, unsigned int charCode, unsigned int keyCode, unsigned int modifiers, bool isRepeat, double referenceTime); #ifdef __cplusplus } #endif #endif