ObjectivelyMVC
Object oriented MVC framework for SDL3 and GNU C
Loading...
Searching...
No Matches
WindowController.h
Go to the documentation of this file.
1/*
2 * ObjectivelyMVC: Object oriented MVC framework for SDL3 and C.
3 * Copyright (C) 2014 Jay Dolan <jay@jaydolan.com>
4 *
5 * This software is provided 'as-is', without any express or implied
6 * warranty. In no event will the authors be held liable for any damages
7 * arising from the use of this software.
8 *
9 * Permission is granted to anyone to use this software for any purpose,
10 * including commercial applications, and to alter it and redistribute it
11 * freely, subject to the following restrictions:
12 *
13 * 1. The origin of this software must not be misrepresented; you must not
14 * claim that you wrote the original software. If you use this software
15 * in a product, an acknowledgment in the product documentation would be
16 * appreciated but is not required.
17 *
18 * 2. Altered source versions must be plainly marked as such, and must not be
19 * misrepresented as being the original software.
20 *
21 * 3. This notice may not be removed or altered from any source distribution.
22 */
23
24#pragma once
25
26#include <Objectively/Object.h>
27
31
38typedef struct WindowControllerInterface WindowControllerInterface;
39
46
50 Object object;
51
56 WindowControllerInterface *interface;
57
62
67
72
77
81 SDL_Window *window;
82};
83
87struct WindowControllerInterface {
88
92 ObjectInterface objectInterface;
93
101 void (*debug)(WindowController *self);
102
109 View *(*keyResponder)(const WindowController *self);
110
117 Array *(*keyResponders)(const WindowController *self);
118
127 WindowController *(*initWithDevice)(WindowController *self, RenderDevice *device);
128
137 View *(*nextKeyResponder)(const WindowController *self, View *keyResponder);
138
147 View *(*previousKeyResponder)(const WindowController *self, View *keyResponder);
148
158 void (*render)(WindowController *self);
159
171 void (*renderTo)(WindowController *self, CommandBuffer *commands, Framebuffer *framebuffer);
172
191 void (*respondToEvent)(WindowController * self, const SDL_Event *event);
192
200 void (*setTheme)(WindowController *self, Theme *theme);
201
209 void (*setViewController)(WindowController *self, ViewController *viewController);
210
218 void (*setWindow)(WindowController *self, SDL_Window *window);
219
226 void (*toggleDebugger)(WindowController *self);
227
235 View *(*touchResponder)(const WindowController *self);
236
244 View *(*touchTarget)(const WindowController *self, const SDL_Event *event);
245
253 WindowController *(*windowController)(SDL_Window *window);
254};
255
The DebugViewController type.
Renderer extends Object with ObjectivelyMVC's UI rendering layer.
static Theme * theme(SDL_Window *window)
Definition Theme.c:143
#define OBJECTIVELYMVC_EXPORT
Definition Types.h:40
A ViewController manages a View and its descendants.
OBJECTIVELYMVC_EXPORT Class * _WindowController(void)
The DebugViewController type.
Renderer extends Object with ObjectivelyMVC's UI rendering layer.
Definition Renderer.h:70
The Theme type.
Definition Theme.h:51
A ViewController manages a View and its descendants.
Views are the fundamental building blocks of ObjectivelyMVC user interfaces.
Definition View.h:134
A WindowController manages a ViewController and its descendants within an SDL_Window.
ViewController * viewController
The ViewController.
Object object
The superclass.
Theme * theme
The Theme.
SDL_Window * window
The window.
Renderer * renderer
The Renderer.
DebugViewController * debugViewController
The DebugViewController.
WindowControllerInterface * interface
The interface.