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

Go to the source code of this file.

Macros

#define _Class   _Action
 

Functions

Class * _Action (void)
 
static void initialize (Class *clazz)
 
static ActioninitWithEventType (Action *self, SDL_EventType eventType, ActionFunction function, ident sender, ident data)
 

Macro Definition Documentation

◆ _Class

#define _Class   _Action

Definition at line 28 of file Action.c.

Function Documentation

◆ _Action()

Class * _Action ( void  )

Definition at line 67 of file Action.c.

67 {
68 static Class *clazz;
69 static Once once;
70
71 do_once(&once, {
72 clazz = _initialize(&(const ClassDef) {
73 .name = "Action",
74 .superclass = _Object(),
75 .instanceSize = sizeof(Action),
76 .interfaceOffset = offsetof(Action, interface),
77 .interfaceSize = sizeof(ActionInterface),
79 });
80 });
81
82 return clazz;
83}
static void initialize(Class *clazz)
Definition: Action.c:58
Actions bind event-driven behavior to Controls.
Definition: Action.h:50

◆ initialize()

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

Definition at line 58 of file Action.c.

58 {
59
60 ((ActionInterface *) clazz->interface)->initWithEventType = initWithEventType;
61}
Action * initWithEventType(Action *self, SDL_EventType eventType, ActionFunction function, ident sender, ident data)
Initializes this Action with the given function and data.
Definition: Action.c:36

◆ initWithEventType()

static Action * initWithEventType ( Action self,
SDL_EventType  eventType,
ActionFunction  function,
ident  sender,
ident  data 
)
static

Definition at line 36 of file Action.c.

36 {
37
38 self = (Action *) super(Object, self, init);
39 if (self) {
40 self->eventType = eventType;
41 assert(self->eventType);
42
43 self->function = function;
44 assert(self->function);
45
46 self->sender = sender;
47 self->data = data;
48 }
49
50 return self;
51}
SDL_EventType eventType
The event type.
Definition: Action.h:71
ident data
The user data.
Definition: Action.h:66
ActionFunction function
The function.
Definition: Action.h:76
ident sender
The sender.
Definition: Action.h:81
CollectionView * init(CollectionView *self, const SDL_Rect *frame)
Initializes this CollectionView with the specified frame and style.