Merge remote-tracking branch 'upstream/master'
This commit is contained in:
25
src/Layout.h
25
src/Layout.h
@@ -23,9 +23,17 @@ static const unsigned long __nan[2] = {0xffffffff, 0x7fffffff};
|
||||
|
||||
#define CSS_UNDEFINED NAN
|
||||
|
||||
typedef enum {
|
||||
CSS_DIRECTION_INHERIT = 0,
|
||||
CSS_DIRECTION_LTR,
|
||||
CSS_DIRECTION_RTL
|
||||
} css_direction_t;
|
||||
|
||||
typedef enum {
|
||||
CSS_FLEX_DIRECTION_COLUMN = 0,
|
||||
CSS_FLEX_DIRECTION_ROW
|
||||
CSS_FLEX_DIRECTION_COLUMN_REVERSE,
|
||||
CSS_FLEX_DIRECTION_ROW,
|
||||
CSS_FLEX_DIRECTION_ROW_REVERSE
|
||||
} css_flex_direction_t;
|
||||
|
||||
typedef enum {
|
||||
@@ -63,6 +71,8 @@ typedef enum {
|
||||
CSS_TOP,
|
||||
CSS_RIGHT,
|
||||
CSS_BOTTOM,
|
||||
CSS_START,
|
||||
CSS_END,
|
||||
CSS_POSITION_COUNT
|
||||
} css_position_t;
|
||||
|
||||
@@ -72,7 +82,7 @@ typedef enum {
|
||||
} css_dimension_t;
|
||||
|
||||
typedef struct {
|
||||
float position[2];
|
||||
float position[4];
|
||||
float dimensions[2];
|
||||
|
||||
// Instead of recomputing the entire layout every single time, we
|
||||
@@ -82,7 +92,7 @@ typedef struct {
|
||||
float last_parent_max_width;
|
||||
float last_dimensions[2];
|
||||
float last_position[2];
|
||||
|
||||
css_direction_t last_direction;
|
||||
} css_layout_t;
|
||||
|
||||
typedef struct {
|
||||
@@ -90,6 +100,7 @@ typedef struct {
|
||||
} css_dim_t;
|
||||
|
||||
typedef struct {
|
||||
css_direction_t direction;
|
||||
css_flex_direction_t flex_direction;
|
||||
css_justify_t justify_content;
|
||||
css_align_t align_content;
|
||||
@@ -98,7 +109,7 @@ typedef struct {
|
||||
css_position_type_t position_type;
|
||||
css_wrap_type_t flex_wrap;
|
||||
float flex;
|
||||
float margin[4];
|
||||
float margin[6];
|
||||
float position[4];
|
||||
/**
|
||||
* You should skip all the rules that contain negative values for the
|
||||
@@ -110,8 +121,8 @@ typedef struct {
|
||||
* {left: -5 ...}
|
||||
* {left: 0 ...}
|
||||
*/
|
||||
float padding[4];
|
||||
float border[4];
|
||||
float padding[6];
|
||||
float border[6];
|
||||
float dimensions[2];
|
||||
float minDimensions[2];
|
||||
float maxDimensions[2];
|
||||
@@ -145,7 +156,7 @@ typedef enum {
|
||||
void print_css_node(css_node_t *node, css_print_options_t options);
|
||||
|
||||
// Function that computes the layout!
|
||||
void layoutNode(css_node_t *node, float maxWidth);
|
||||
void layoutNode(css_node_t *node, float maxWidth, css_direction_t parentDirection);
|
||||
bool isUndefined(float value);
|
||||
|
||||
#endif
|
||||
|
Reference in New Issue
Block a user