ObjectivelyMVC 0.1.0
Object oriented MVC framework for OpenGL, SDL2 and GNU C
Public Member Functions | Data Fields | Protected Attributes
Action Struct Reference

Actions bind event-driven behavior to Controls. More...

#include <Action.h>

Inheritance diagram for Action:

Public Member Functions

Class * _Action (void)
 The Action archetype. More...
 
ActioninitWithEventType (Action *self, SDL_EventType eventType, ActionFunction function, ident sender, ident data)
 Initializes this Action with the given function and data. More...
 

Data Fields

ident data
 The user data. More...
 
SDL_EventType eventType
 The event type. More...
 
ActionFunction function
 The function. More...
 
Object object
 The superclass. More...
 
ident sender
 The sender. More...
 

Protected Attributes

ActionInterface * interface
 The interface. More...
 

Detailed Description

Actions bind event-driven behavior to Controls.

Definition at line 50 of file Action.h.

Member Function Documentation

◆ _Action()

Class * _Action ( void  )

The Action archetype.

Returns
The Action Class.

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
ActionInterface * interface
The interface.
Definition: Action.h:61

◆ initWithEventType()

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

Initializes this Action with the given function and data.

Parameters
selfThe Action.
eventTypeThe event type.
functionThe ActionFunction.
senderThe sender.
dataUser data.
Returns
The initialized Action, or NULL on error.

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}
static View * init(View *self)
Definition: Box.c:67
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

Field Documentation

◆ data

ident Action::data

The user data.

Definition at line 66 of file Action.h.

◆ eventType

SDL_EventType Action::eventType

The event type.

Definition at line 71 of file Action.h.

◆ function

ActionFunction Action::function

The function.

Definition at line 76 of file Action.h.

◆ interface

ActionInterface* Action::interface
protected

The interface.

Definition at line 61 of file Action.h.

◆ object

Object Action::object

The superclass.

Definition at line 55 of file Action.h.

◆ sender

ident Action::sender

The sender.

Definition at line 81 of file Action.h.


The documentation for this struct was generated from the following files: