commit - 6fe77315ff1cd8c27265b1597b5d8192337868d8
commit + c3628d8176854d6bdc1cb7e104626478162bb09f
blob - c52ab9fae4608dd3cfc0d746b7daac487c1a7ca7
blob + 997759160218ddf2ff55d1e9695a54804b4cb3a6
--- layout.c
+++ layout.c
#include "aui.h"
#include "widget.h"
+static struct aui_placepar default_place = {
+ .x = 0,
+ .y = 0,
+ .relx = 0,
+ .rely = 0,
+ .width = 0,
+ .height = 0,
+ .relwidth = 0,
+ .relheight = 0,
+ .anchor = AUI_ANCHOR_NW,
+};
+
+static struct aui_packpar default_pack = {
+ .anchor = AUI_ANCHOR_NW,
+ .fill = AUI_FILL_NONE,
+ .side = AUI_SIDE_TOP,
+ .expand = 0,
+};
+
+static struct aui_gridpar default_grid = {
+ .column = 0,
+ .row = 0,
+};
+
static int
can_add(struct aui_widget *widget, enum aui_layout_type type)
{
if (check == -1)
return -1;
+ if (par == NULL)
+ par = &default_place;
+
con = (struct aui_container *)widget->parent;
parent = (struct aui_widget *)widget->parent;
con->layout_type = AUI_LAYOUT_PLACE;
if (check == -1)
return - 1;
+ if (par == NULL)
+ par = &default_pack;
+
con = (struct aui_container *)widget->parent;
parent = widget->parent;
con->layout_type = AUI_LAYOUT_PACK;
if (check == -1)
return -1;
+ if (par == NULL)
+ par = &default_grid;
+
con = (struct aui_container *)widget->parent;
parent = widget->parent;
con->layout_type = AUI_LAYOUT_GRID;