summaryrefslogtreecommitdiff
path: root/alf/alflayout.h
diff options
context:
space:
mode:
authorJonas Kümmerlin <jonas@kuemmerlin.eu>2019-01-05 22:07:51 +0100
committerJonas Kümmerlin <jonas@kuemmerlin.eu>2019-01-05 22:07:51 +0100
commitdb2f529599cea4c86481ed6ca650a5b069c003b0 (patch)
tree7f7f6c3449d8811fdf68f28f761efcc9fa4e9b9d /alf/alflayout.h
parentcd7552ae1ce7f6c92d03b7d0a83fe4aec073aeff (diff)
move layout into own file, implement expand flag
Diffstat (limited to 'alf/alflayout.h')
-rw-r--r--alf/alflayout.h70
1 files changed, 70 insertions, 0 deletions
diff --git a/alf/alflayout.h b/alf/alflayout.h
new file mode 100644
index 0000000..4787550
--- /dev/null
+++ b/alf/alflayout.h
@@ -0,0 +1,70 @@
+#pragma once
+
+#include "alf.h"
+#include "alflist.h"
+
+typedef struct {
+ ALFListHeader list;
+ HWND hwnd;
+ UINT x;
+ UINT y;
+ UINT cptWidth;
+ UINT cptHeight;
+ UINT cptMarginTop;
+ UINT cptMarginRight;
+ UINT cptMarginBottom;
+ UINT cptMarginLeft;
+ DWORD flags;
+} ALFWidgetPriv;
+
+typedef struct {
+ int minWidth;
+ int allocatedWidth;
+ int allocatedPosition;
+ int expand : 1;
+} ALFLayoutRowOrColumn;
+
+typedef struct {
+ ALFListHeader widgets;
+ ALFLayoutRowOrColumn *columns;
+ ALFLayoutRowOrColumn *rows;
+ int nColumns;
+ int nRows;
+ int totalMinWidth;
+ int totalMinHeight;
+ int expandoColumnCount;
+ int expandoRowCount;
+} ALFLayout;
+
+void
+ALF_Layout_Init(ALFLayout *layout);
+
+void
+ALF_Layout_Clear(ALFLayout *layout);
+
+void
+ALF_Layout_CalcSizes(ALFLayout *layout, HWND window);
+
+void
+ALF_Layout_Apply(ALFLayout *layout, HWND window);
+
+void
+ALF_Layout_AddWidget(ALFLayout *layout, HWND window, const ALFWidgetLayoutParams *params);
+
+BOOL
+ALF_Layout_RemoveWidget(ALFLayout *layout, HWND window, HWND widget, BOOL destroy);
+
+BOOL
+ALF_Layout_SetWidgetParams(ALFLayout *layout, const ALFWidgetLayoutParams *params, HWND widget);
+
+BOOL
+ALF_Layout_GetWidgetParams(ALFLayout *layout, ALFWidgetLayoutParams *params, HWND widget);
+
+BOOL
+ALF_Layout_HandleMessage(ALFLayout *layout, HWND window, WPARAM wparam, LPARAM lparam);
+
+HWND
+ALF_Layout_WidgetAtPos(ALFLayout *layout, UINT x, UINT y);
+
+void
+ALF_Layout_UpdateFonts(ALFLayout *layout, HWND window, const ALFWindowFonts *fonts);