26#include <Objectively/String.h>
31#include "../Assets/debug.css.h"
32#include "../Assets/debug.json.h"
34#define _Class _DebugViewController
36#pragma mark - Selectors
45 return this->
debug->computedStyle->selectors->count;
58 return $(this->
debug->computedStyle->selectors, objectAtIndex, row);
78#pragma mark - Computed Style
87 return this->
debug->computedStyle->attributes->count;
104 if (strcmp(
"Attribute", column->
identifier) == 0) {
105 array = $(this->
debug->computedStyle->attributes, allKeys);
107 array = $(this->
debug->computedStyle->attributes, allObjects);
110 value = $(array, objectAtIndex, row);
133#pragma mark - Warnings
142 return this->
debug->warnings->count;
157 value = $((Array *) this->
debug->warnings, objectAtIndex, row);
177#pragma mark - ViewController
193 MakeOutlet(
"computedStyle", &this->computedStyle),
203 this->selectors->dataSource.self = self;
206 this->selectors->delegate.self = self;
209 this->computedStyle->dataSource.self = self;
212 this->computedStyle->delegate.self = self;
215 this->warnings->dataSource.self = self;
218 this->warnings->delegate.self = self;
222#pragma mark - DebugViewController
231 if (view == this->
debug) {
235 $(this->renderer,
drawRectFilled, &frame, &MakeColor(0x22, 0x66, 0x99, 0x88));
239 this->visibleViews++;
250 const Array *warnings = (Array *) view->
warnings;
251 if (warnings->count) {
266 if (view != self->
debug) {
307 if (SDL_GetTicks() - self->
timestamp >= 1000) {
324#pragma mark - Class lifecycle
331 ((ViewControllerInterface *) clazz->interface)->loadView =
loadView;
333 ((DebugViewControllerInterface *) clazz->interface)->debug =
debug;
334 ((DebugViewControllerInterface *) clazz->interface)->init =
init;
346 clazz = _initialize(&(
const ClassDef) {
347 .name =
"DebugViewController",
351 .interfaceSize =
sizeof(DebugViewControllerInterface),
static Box * initWithFrame(Box *self, const SDL_Rect *frame)
static void reloadData(CollectionView *self)
Class * _DebugViewController(void)
static void debugEnumerate(View *view, ident data)
static void loadView(ViewController *self)
static TableCellView * selectors_cellForColumnAndRow(const TableView *tableView, const TableColumn *column, size_t row)
static ident warnings_valueForColumnAndRow(const TableView *tableView, const TableColumn *column, size_t row)
static ident computedStyle_valueForColumnAndRow(const TableView *tableView, const TableColumn *column, size_t row)
static TableCellView * warnings_cellForColumnAndRow(const TableView *tableView, const TableColumn *column, size_t row)
static DebugViewController * init(DebugViewController *self)
static size_t computedStyle_numberOfRows(const TableView *tableView)
static TableCellView * computedStyle_cellForColumnAndRow(const TableView *tableView, const TableColumn *column, size_t row)
static void debug(DebugViewController *self, const View *view, Renderer *renderer)
static size_t selectors_numberOfRows(const TableView *tableView)
static void initialize(Class *clazz)
static ident selectors_valueForColumnAndRow(const TableView *tableView, const TableColumn *column, size_t row)
static size_t warnings_numberOfRows(const TableView *tableView)
The DebugViewController type.
static String * description(const Object *self)
static void setClippingFrame(Renderer *self, const SDL_Rect *clippingFrame)
static void drawRectFilled(const Renderer *self, const SDL_Rect *rect, const SDL_Color *color)
static void drawRect(const Renderer *self, const SDL_Rect *rect, const SDL_Color *color)
static Stylesheet * stylesheetWithCharacters(const char *chars)
static void setTextWithFormat(Text *self, const char *fmt,...)
static void setText(Text *self, const char *text)
#define MakeOutlet(identifier, view)
Creates an Outlet with the specified parameters.
#define MakeOutlets(...)
Creates a NULL-termianted array of Outlets.
static String * path(const View *self)
static void clearWarnings(const View *self, WarningType type)
static bool isVisible(const View *self)
static bool hasOverflow(const View *self)
static SDL_Rect renderFrame(const View *self)
static View * viewWithCharacters(const char *chars, Outlet *outlets)
static void enumerate(View *self, ViewEnumerator enumerator, ident data)
static void sizeToFit(View *self)
Class * _ViewController(void)
static void setView(ViewController *self, View *view)
WarningType
Warning types.
A WindowController manages a ViewController and its descendants within an SDL_Window.
The DebugViewController type.
TableView * selectors
The CSS selectors matching the View.
const View * debug
The View to debug.
TableView * computedStyle
The computed style of the View.
int visibleViews
The count of visibile Views.
Renderer * renderer
A weak referece to the current WindowController's renderer.
TableView * warnings
The warnings generated by the View.
Text * description
The View description.
const View * root
The root ancestor of the debug View.
Text * path
The path to the debug View.
Outlets enable outbound data binding of Views through JSON.
Renderer extends Object with ObjectivelyMVC's UI rendering layer.
Selectors are comprised of one or more SelectorSequences.
char * rule
The rule, as provided by the user.
Stylesheets are comprised of Selectors and Styles.
Each row in a TableView is comprised of TableCellViews.
Columns provide alignment, spacing and sorting hints for TableView instances.
char * identifier
The identifier.
ident self
The data source self-reference.
ident(* valueForColumnAndRow)(const TableView *tableView, const TableColumn *column, size_t row)
Called by the TableView for the associated value of a cell.
TableViews provide sortable, tabular presentations of data.
TableViewDataSource dataSource
The data source.
A ViewController manages a View and its descendants.
Views are the fundamental building blocks of ObjectivelyMVC user interfaces.
Stylesheet * stylesheet
An optional Stylesheet.
View * superview
The super View.
Array * warnings
The Warnings this View generated.
String * message
The message.