|
ObjectivelyMVC
Object oriented MVC framework for SDL3 and GNU C
|
#include <assert.h>#include <stdlib.h>#include <string.h>#include <Objectively.h>#include "Style.h"Go to the source code of this file.
Data Structures | |
| struct | StyleShorthand |
| A shorthand attribute, and the longhands it stands for. More... | |
Macros | |
| #define | _Class _Style |
Functions | |
| Class * | _Style (void) |
| static void | addAttribute (Style *self, const char *attr, ident value) |
| static void | addAttributes (Style *self, const Dictionary *attributes) |
| static void | addAttributes_enumerate (const Dictionary *dictionary, ident obj, ident key, ident data) |
| DictionaryEnumerator for addAttributes. | |
| static void | addBoolAttribute (Style *self, const char *attr, bool value) |
| static void | addCharactersAttribute (Style *self, const char *attr, const char *value) |
| static void | addColorAttribute (Style *self, const char *attr, const SDL_Color *color) |
| static void | addDoubleAttribute (Style *self, const char *attr, double value) |
| static void | addEnumAttribute (Style *self, const char *attr, const EnumName *names, int value) |
| static void | addFloatAttribute (Style *self, const char *attr, float value) |
| static void | addIntegerAttribute (Style *self, const char *attr, int value) |
| static void | addPointAttribute (Style *self, const char *attr, const SDL_Point *value) |
| static void | addRectangleAttribute (Style *self, const char *attr, const SDL_Rect *value) |
| static void | addSelector (Style *self, Selector *selector) |
| static bool | addShorthandAttribute (Style *self, const StyleShorthand *shorthand, ident value) |
Stores value as the longhands of shorthand, if it can be split into them. | |
| static void | addSizeAttribute (Style *self, const char *attr, const SDL_Size *value) |
| static ident | attributeValue (const Style *self, const char *attr) |
| static void | dealloc (Object *self) |
| static String * | description (const Object *self) |
| static int | hash (const Object *self) |
| static void | initialize (Class *clazz) |
| static Style * | initWithAttributes (Style *self, const Dictionary *attributes) |
| static Style * | initWithRules (Style *self, const char *rules) |
| static bool | isComputedEqual (const Style *self, const Style *other) |
| static bool | isEqual (const Object *self, const Object *other) |
| static Array * | parse (const char *css) |
| static ident | parseValue (String *string) |
| static void | removeAllAttributes (Style *self) |
| static void | removeAttribute (Style *self, const char *attr) |
| static void | setAttribute (Style *self, const char *key, ident value) |
Stores value under key, expanding it into longhands if key is a shorthand. | |
| static char * | stripComments (const char *css) |
Returns a newly allocated copy of css with all / * ... * / comments removed. The tokenizer below splits on { : ; } and has no notion of comments, so a comment absorbed into a selector or declaration silently corrupts the rule. Each comment is replaced by a single space so it still separates adjacent tokens. The caller must free the returned buffer. | |
| static size_t | styleShorthandCount (const StyleShorthand *shorthand) |
| static const StyleShorthand * | styleShorthandForKey (const char *key) |
Variables | |
| static const StyleShorthand | styleShorthands [] |
| Class * _Style | ( | void | ) |
Definition at line 676 of file Style.c.
|
static |
Definition at line 196 of file Style.c.
|
static |
Definition at line 221 of file Style.c.
|
static |
DictionaryEnumerator for addAttributes.
|
static |
Definition at line 232 of file Style.c.
|
static |
|
static |
Definition at line 253 of file Style.c.
|
static |
Definition at line 275 of file Style.c.
|
static |
|
static |
Definition at line 301 of file Style.c.
|
static |
|
static |
Definition at line 317 of file Style.c.
|
static |
Definition at line 335 of file Style.c.
|
static |
Stores value as the longhands of shorthand, if it can be split into them.
padding: 2 still means all four sides. A value of any other shape is left to the Inlet binding to reject, rather than being silently dropped here. Definition at line 156 of file Style.c.
|
static |
Definition at line 368 of file Style.c.
|
static |
|
static |
|
static |
|
static |
|
static |
Definition at line 643 of file Style.c.
Definition at line 394 of file Style.c.
Definition at line 410 of file Style.c.
|
static |
|
static |
Definition at line 556 of file Style.c.
|
static |
Definition at line 458 of file Style.c.
|
static |
|
static |
|
static |
Stores value under key, expanding it into longhands if key is a shorthand.
Definition at line 184 of file Style.c.
|
static |
Returns a newly allocated copy of css with all / * ... * / comments removed. The tokenizer below splits on { : ; } and has no notion of comments, so a comment absorbed into a selector or declaration silently corrupts the rule. Each comment is replaced by a single space so it still separates adjacent tokens. The caller must free the returned buffer.
Definition at line 527 of file Style.c.
|
static |
|
static |
key names, or NULL if it is already a longhand. Definition at line 138 of file Style.c.
|
static |
padding is top right bottom left, frame is x y w h. Definition at line 114 of file Style.c.