#ifndef CONTAINER_H
#define CONTAINER_H
#include "../ui/container.h"
#include "toolkit.h"
#include "grid.h"
#ifdef __cplusplus
extern "C" {
#endif
typedef struct UiContainerPrivate UiContainerPrivate;
typedef struct UiGridLayoutContainer UiGridLayoutContainer;
typedef struct UiBoxContainer UiBoxContainer;
typedef struct UiGridWidget UiGridWidget;
enum UiBoxOrientation {
UI_BOX_VERTICAL =
0,
UI_BOX_HORIZONTAL
};
typedef enum UiBoxOrientation UiBoxOrientation;
enum UiContainerType {
UI_CONTAINER_GENERIC =
0,
UI_CONTAINER_TABVIEW
};
typedef enum UiContainerType UiContainerType;
typedef struct UiRect {
int x;
int y;
int width;
int height;
} UiRect;
struct UiContainerPrivate {
UiContainerX container;
HWND (*parent)(UiContainerPrivate*);
void (*add)(UiContainerPrivate*, W32Widget*, UiLayout*);
UiContainerType type;
HWND hwnd;
};
struct UiBoxContainer {
UiContainerPrivate container;
UiGridLayout *layout;
UiBoxOrientation orientation;
int x;
int y;
};
struct UiGridLayoutContainer {
UiContainerPrivate container;
UiGridLayout *layout;
int x;
int y;
UiBool def_hexpand;
UiBool def_vexpand;
UiBool def_hfill;
UiBool def_vfill;
};
struct UiGridWidget {
W32Widget widget;
HBRUSH brush;
};
UiContainerPrivate* ui_obj_container(UiObject *obj);
HWND ui_container_get_parent(UiContainerPrivate *ctn);
void ui_container_add(UiContainerPrivate *ctn, W32Widget *widget, UiLayout *layout);
int ui_grid_widget_event(W32Widget *widget,
HWND hwnd,
UINT uMsg,
WPARAM wParam,
LPARAM lParam);
W32Size ui_grid_layout_get_preferred_size(W32Widget *widget);
UiContainerX* ui_box_container_create(UiObject *obj,
HWND hwnd, UiBoxOrientation orientation,
short spacing, GridEdgeInsets padding);
void ui_box_container_add(UiContainerPrivate *ctn, W32Widget *widget, UiLayout *layout);
UiContainerX* ui_grid_container_create(
UiObject *obj,
HWND hwnd,
short columnspacing,
short rowspacing,
GridEdgeInsets padding);
void ui_grid_container_add(UiContainerPrivate *ctn, W32Widget *widget, UiLayout *layout);
#ifdef __cplusplus
}
#endif
#endif