ObjectivelyMVC 0.1.0
Object oriented MVC framework for OpenGL, SDL2 and GNU C
Data Structures | Macros | Enumerations | Functions | Variables
View.h File Reference

Views are the fundamental building blocks of ObjectivelyMVC user interfaces. More...

#include <Objectively/Data.h>
#include <Objectively/Enum.h>
#include <Objectively/MutableDictionary.h>
#include <Objectively/MutableArray.h>
#include <Objectively/MutableSet.h>
#include <Objectively/Resource.h>
#include <ObjectivelyMVC/Colors.h>
#include <ObjectivelyMVC/Renderer.h>
#include <ObjectivelyMVC/Theme.h>
#include <ObjectivelyMVC/View+JSON.h>

Go to the source code of this file.

Data Structures

struct  View
 Views are the fundamental building blocks of ObjectivelyMVC user interfaces. More...
 
struct  ViewPadding
 Spacing applied to the inside of a View's frame. More...
 

Macros

#define AddPadding(a, b)    MakePadding(a.top + b.top, a.right + b.right, a.bottom + b.bottom, a.left + b.left)
 
#define MakePadding(top, right, bottom, left)    (ViewPadding) { (top), (right), (bottom), (left) }
 Creates a ViewPadding with the given dimensions. More...
 
#define ViewAlignmentMaskBottom   0x4
 
#define ViewAlignmentMaskCenter   0x10
 
#define ViewAlignmentMaskHorizontal    (ViewAlignmentMaskLeft | ViewAlignmentMaskCenter | ViewAlignmentMaskRight)
 
#define ViewAlignmentMaskInternal   0x100
 
#define ViewAlignmentMaskLeft   0x8
 
#define ViewAlignmentMaskMiddle   0x2
 
#define ViewAlignmentMaskRight   0x20
 
#define ViewAlignmentMaskTop   0x1
 
#define ViewAlignmentMaskVertical    (ViewAlignmentMaskTop | ViewAlignmentMaskMiddle | ViewAlignmentMaskBottom)
 

Enumerations

enum  ViewAlignment {
  ViewAlignmentNone , ViewAlignmentTop = ViewAlignmentMaskTop , ViewAlignmentMiddle = ViewAlignmentMaskMiddle , ViewAlignmentBottom = ViewAlignmentMaskBottom ,
  ViewAlignmentLeft = ViewAlignmentMaskLeft , ViewAlignmentCenter = ViewAlignmentMaskCenter , ViewAlignmentRight = ViewAlignmentMaskRight , ViewAlignmentTopLeft = (ViewAlignmentMaskTop | ViewAlignmentMaskLeft) ,
  ViewAlignmentTopCenter = (ViewAlignmentMaskTop | ViewAlignmentMaskCenter) , ViewAlignmentTopRight = (ViewAlignmentMaskTop | ViewAlignmentMaskRight) , ViewAlignmentMiddleLeft = (ViewAlignmentMaskMiddle | ViewAlignmentMaskLeft) , ViewAlignmentMiddleCenter = (ViewAlignmentMaskMiddle | ViewAlignmentMaskCenter) ,
  ViewAlignmentMiddleRight = (ViewAlignmentMaskMiddle | ViewAlignmentMaskRight) , ViewAlignmentBottomLeft = (ViewAlignmentMaskBottom | ViewAlignmentMaskLeft) , ViewAlignmentBottomCenter = (ViewAlignmentMaskBottom | ViewAlignmentMaskCenter) , ViewAlignmentBottomRight = (ViewAlignmentMaskBottom | ViewAlignmentMaskRight) ,
  ViewAlignmentInternal = ViewAlignmentMaskInternal
}
 Alignment constants, used to align a View within its superview. More...
 
enum  ViewAutoresizing {
  ViewAutoresizingNone = 0 , ViewAutoresizingWidth = 0x1 , ViewAutoresizingHeight = 0x2 , ViewAutoresizingFill = 0x3 ,
  ViewAutoresizingFit = 0x4 , ViewAutoresizingContain = 0x8
}
 Auto-resizing constants, which are bitmasked. More...
 
enum  ViewPosition { ViewPositionBefore = -1 , ViewPositionAfter = 1 }
 Relative positioning of subviews within their superview. More...
 

Functions

OBJECTIVELYMVC_EXPORT Class * _View (void)
 

Variables

OBJECTIVELYMVC_EXPORT const EnumName ViewAlignmentNames []
 
OBJECTIVELYMVC_EXPORT const EnumName ViewAutoresizingNames []
 

Detailed Description

Views are the fundamental building blocks of ObjectivelyMVC user interfaces.

Definition in file View.h.

Macro Definition Documentation

◆ AddPadding

#define AddPadding (   a,
 
)     MakePadding(a.top + b.top, a.right + b.right, a.bottom + b.bottom, a.left + b.left)
Returns
A ViewPadding that is the sum of a and b.

Definition at line 112 of file View.h.

◆ MakePadding

#define MakePadding (   top,
  right,
  bottom,
  left 
)     (ViewPadding) { (top), (right), (bottom), (left) }

Creates a ViewPadding with the given dimensions.

Definition at line 106 of file View.h.

◆ ViewAlignmentMaskBottom

#define ViewAlignmentMaskBottom   0x4

Definition at line 45 of file View.h.

◆ ViewAlignmentMaskCenter

#define ViewAlignmentMaskCenter   0x10

Definition at line 47 of file View.h.

◆ ViewAlignmentMaskHorizontal

#define ViewAlignmentMaskHorizontal    (ViewAlignmentMaskLeft | ViewAlignmentMaskCenter | ViewAlignmentMaskRight)

Definition at line 54 of file View.h.

◆ ViewAlignmentMaskInternal

#define ViewAlignmentMaskInternal   0x100

Definition at line 49 of file View.h.

◆ ViewAlignmentMaskLeft

#define ViewAlignmentMaskLeft   0x8

Definition at line 46 of file View.h.

◆ ViewAlignmentMaskMiddle

#define ViewAlignmentMaskMiddle   0x2

Definition at line 44 of file View.h.

◆ ViewAlignmentMaskRight

#define ViewAlignmentMaskRight   0x20

Definition at line 48 of file View.h.

◆ ViewAlignmentMaskTop

#define ViewAlignmentMaskTop   0x1

Definition at line 43 of file View.h.

◆ ViewAlignmentMaskVertical

#define ViewAlignmentMaskVertical    (ViewAlignmentMaskTop | ViewAlignmentMaskMiddle | ViewAlignmentMaskBottom)

Definition at line 51 of file View.h.

Enumeration Type Documentation

◆ ViewAlignment

Alignment constants, used to align a View within its superview.

Enumerator
ViewAlignmentNone 
ViewAlignmentTop 
ViewAlignmentMiddle 
ViewAlignmentBottom 
ViewAlignmentLeft 
ViewAlignmentCenter 
ViewAlignmentRight 
ViewAlignmentTopLeft 
ViewAlignmentTopCenter 
ViewAlignmentTopRight 
ViewAlignmentMiddleLeft 
ViewAlignmentMiddleCenter 
ViewAlignmentMiddleRight 
ViewAlignmentBottomLeft 
ViewAlignmentBottomCenter 
ViewAlignmentBottomRight 
ViewAlignmentInternal 

Definition at line 60 of file View.h.

60 {
#define ViewAlignmentMaskInternal
Definition: View.h:49
#define ViewAlignmentMaskCenter
Definition: View.h:47
#define ViewAlignmentMaskLeft
Definition: View.h:46
#define ViewAlignmentMaskBottom
Definition: View.h:45
#define ViewAlignmentMaskTop
Definition: View.h:43
#define ViewAlignmentMaskRight
Definition: View.h:48
#define ViewAlignmentMaskMiddle
Definition: View.h:44
ViewAlignment
Alignment constants, used to align a View within its superview.
Definition: View.h:60
@ ViewAlignmentBottomRight
Definition: View.h:76
@ ViewAlignmentBottomLeft
Definition: View.h:74
@ ViewAlignmentMiddleCenter
Definition: View.h:72
@ ViewAlignmentInternal
Definition: View.h:77
@ ViewAlignmentTopCenter
Definition: View.h:69
@ ViewAlignmentTopRight
Definition: View.h:70
@ ViewAlignmentMiddleRight
Definition: View.h:73
@ ViewAlignmentTopLeft
Definition: View.h:68
@ ViewAlignmentCenter
Definition: View.h:66
@ ViewAlignmentLeft
Definition: View.h:65
@ ViewAlignmentRight
Definition: View.h:67
@ ViewAlignmentTop
Definition: View.h:62
@ ViewAlignmentMiddleLeft
Definition: View.h:71
@ ViewAlignmentBottom
Definition: View.h:64
@ ViewAlignmentMiddle
Definition: View.h:63
@ ViewAlignmentBottomCenter
Definition: View.h:75
@ ViewAlignmentNone
Definition: View.h:61

◆ ViewAutoresizing

Auto-resizing constants, which are bitmasked.

Enumerator
ViewAutoresizingNone 
ViewAutoresizingWidth 
ViewAutoresizingHeight 
ViewAutoresizingFill 
ViewAutoresizingFit 
ViewAutoresizingContain 

Definition at line 85 of file View.h.

85 {
ViewAutoresizing
Auto-resizing constants, which are bitmasked.
Definition: View.h:85
@ ViewAutoresizingNone
Definition: View.h:86
@ ViewAutoresizingFill
Definition: View.h:89
@ ViewAutoresizingContain
Definition: View.h:91
@ ViewAutoresizingWidth
Definition: View.h:87
@ ViewAutoresizingHeight
Definition: View.h:88
@ ViewAutoresizingFit
Definition: View.h:90

◆ ViewPosition

Relative positioning of subviews within their superview.

Enumerator
ViewPositionBefore 
ViewPositionAfter 

Definition at line 118 of file View.h.

118 {
ViewPosition
Relative positioning of subviews within their superview.
Definition: View.h:118
@ ViewPositionBefore
Definition: View.h:119
@ ViewPositionAfter
Definition: View.h:120

Function Documentation

◆ _View()

OBJECTIVELYMVC_EXPORT Class * _View ( void  )

Definition at line 1769 of file View.c.

1769 {
1770 static Class *clazz;
1771 static Once once;
1772
1773 do_once(&once, {
1774 clazz = _initialize(&(const ClassDef) {
1775 .name = "View",
1776 .superclass = _Object(),
1777 .instanceSize = sizeof(View),
1778 .interfaceOffset = offsetof(View, interface),
1779 .interfaceSize = sizeof(ViewInterface),
1781 });
1782 });
1783
1784 return clazz;
1785}
static void initialize(Class *clazz)
Definition: View.c:1677
Views are the fundamental building blocks of ObjectivelyMVC user interfaces.
Definition: View.h:133

Variable Documentation

◆ ViewAlignmentNames

OBJECTIVELYMVC_EXPORT const EnumName ViewAlignmentNames[]

Definition at line 80 of file View.h.

◆ ViewAutoresizingNames

OBJECTIVELYMVC_EXPORT const EnumName ViewAutoresizingNames[]

Definition at line 94 of file View.h.