#ifndef GRID_H
#define GRID_H
#include "../ui/win32.h"
#include <stdbool.h>
#include <cx/array_list.h>
#include "win32.h"
#define INSETS_ZERO (GridEdgeInsets){
0}
typedef struct GridEdgeInsets {
short top;
short bottom;
short left;
short right;
} GridEdgeInsets;
typedef struct GridLayoutInfo {
GridEdgeInsets margin;
short colspan;
short rowspan;
int preferred_width;
int preferred_height;
bool hexpand;
bool vexpand;
bool hfill;
bool vfill;
} GridLayoutInfo;
typedef struct GridElm {
W32Widget *widget;
short gridx;
short gridy;
GridLayoutInfo layout;
} GridElm;
typedef struct UiGridLayout {
GridEdgeInsets padding;
short columnspacing;
short rowspacing;
int preferred_width;
int preferred_height;
CxList *widgets;
int max_column;
int max_row;
} UiGridLayout;
typedef struct GridDef {
int size;
int pos;
int preferred_size;
BOOLEAN expand;
} GridDef;
UiGridLayout* ui_grid_layout_create(
const CxAllocator *a,
short columnspacing,
short rowspacing);
void ui_grid_add_widget(
UiGridLayout *grid,
short x,
short y,
W32Widget *widget,
GridLayoutInfo *layout);
void ui_grid_layout(UiGridLayout *grid,
int width,
int height);
#endif