ObjectivelyMVC 0.1.0
Object oriented MVC framework for OpenGL, SDL2 and GNU C
Macros | Functions
TableCellView.c File Reference
#include <assert.h>
#include "TableCellView.h"

Go to the source code of this file.

Macros

#define _Class   _TableCellView
 

Functions

Class * _TableCellView (void)
 
static void dealloc (Object *self)
 
static void initialize (Class *clazz)
 
static TableCellViewinitWithFrame (TableCellView *self, const SDL_Rect *frame)
 

Macro Definition Documentation

◆ _Class

#define _Class   _TableCellView

Definition at line 28 of file TableCellView.c.

Function Documentation

◆ _TableCellView()

Class * _TableCellView ( void  )

Definition at line 79 of file TableCellView.c.

79 {
80 static Class *clazz;
81 static Once once;
82
83 do_once(&once, {
84 clazz = _initialize(&(const ClassDef) {
85 .name = "TableCellView",
86 .superclass = _View(),
87 .instanceSize = sizeof(TableCellView),
88 .interfaceOffset = offsetof(TableCellView, interface),
89 .interfaceSize = sizeof(TableCellViewInterface),
91 });
92 });
93
94 return clazz;
95}
static void initialize(Class *clazz)
Definition: TableCellView.c:68
Each row in a TableView is comprised of TableCellViews.
Definition: TableCellView.h:41
Class * _View(void)
The View archetype.
Definition: View.c:1769

◆ dealloc()

static void dealloc ( Object *  self)
static
See also
Object::dealloc(Object *)

Definition at line 35 of file TableCellView.c.

35 {
36
37 TableCellView *this = (TableCellView *) self;
38
39 release(this->text);
40
41 super(Object, self, dealloc);
42}
static void dealloc(Object *self)
Definition: TableCellView.c:35

◆ initialize()

static void initialize ( Class *  clazz)
static
See also
Class::initialize(Class *)

Definition at line 68 of file TableCellView.c.

68 {
69
70 ((ObjectInterface *) clazz->interface)->dealloc = dealloc;
71
72 ((TableCellViewInterface *) clazz->interface)->initWithFrame = initWithFrame;
73}
Box * initWithFrame(Box *self, const SDL_Rect *frame)
Initializes this Box with the given frame.
Definition: Box.c:92

◆ initWithFrame()

static TableCellView * initWithFrame ( TableCellView self,
const SDL_Rect *  frame 
)
static

Definition at line 50 of file TableCellView.c.

50 {
51
52 self = (TableCellView *) super(View, self, initWithFrame, frame);
53 if (self) {
54 self->text = $(alloc(Text), initWithText, NULL, NULL);
55 assert(self->text);
56
57 $((View *) self, addSubview, (View *) self->text);
58 }
59
60 return self;
61}
Label * initWithText(Label *self, const char *text, Font *font)
Initializes this Label with the given text and Font.
Definition: Label.c:96
Text * text
The text.
Definition: TableCellView.h:57
Text rendered with TrueType fonts.
Definition: Text.h:41
Views are the fundamental building blocks of ObjectivelyMVC user interfaces.
Definition: View.h:133
void addSubview(View *self, View *subview)
Adds a subview to this view, to be drawn above its siblings.
Definition: PageView.c:35