From ec95a4a2dd8a946d5c98456a24138411a25136e5 Mon Sep 17 00:00:00 2001 From: Pietro Gagliardi Date: Thu, 9 Apr 2015 15:25:18 -0400 Subject: [PATCH] Laid the foundation for padding. --- uipriv.h | 4 ++++ uipriv_darwin.h | 7 +++---- uipriv_unix.h | 7 +++---- uipriv_windows.h | 1 + 4 files changed, 11 insertions(+), 8 deletions(-) diff --git a/uipriv.h b/uipriv.h index 0521bf66..ebb1be40 100644 --- a/uipriv.h +++ b/uipriv.h @@ -10,6 +10,10 @@ struct uiSize { intmax_t height; }; +#define uiSizingCommon \ + intmax_t xPadding; \ + intmax_t yPadding; + struct uiControl { void (*destroy)(uiControl *); uintptr_t (*handle)(uiControl *); diff --git a/uipriv_darwin.h b/uipriv_darwin.h index 5ec8b4c6..52d5b38b 100644 --- a/uipriv_darwin.h +++ b/uipriv_darwin.h @@ -8,10 +8,6 @@ #define toNSString(str) [NSString stringWithUTF8String:(str)] #define fromNSString(str) [(str) UTF8String] -// TODO move this to the right place -struct uiSizing { -}; - // TODO see if we can override alloc instead #ifdef uiLogAllocations #import @@ -36,6 +32,9 @@ struct uiSizing { extern void setStandardControlFont(NSControl *); // container_darwin.m +struct uiSizing { + uiSizingCommon +}; @interface uiContainer : NSView // TODO rename to uiChild @property uiControl *child; diff --git a/uipriv_unix.h b/uipriv_unix.h index 3187c453..b51bda5d 100644 --- a/uipriv_unix.h +++ b/uipriv_unix.h @@ -7,11 +7,10 @@ #include "uipriv.h" #include "ui_unix.h" -// TODO move this to the right place -struct uiSizing { -}; - // container_unix.c +struct uiSizing { + uiSizingCommon +}; #define uiContainerType (uiContainer_get_type()) #define uiContainer(obj) (G_TYPE_CHECK_INSTANCE_CAST((obj), uiContainerType, uiContainer)) #define uiIsContainer(obj) (G_TYPE_CHECK_INSTANCE_TYPE((obj), uiContainerType)) diff --git a/uipriv_windows.h b/uipriv_windows.h index 180937ed..2c545eee 100644 --- a/uipriv_windows.h +++ b/uipriv_windows.h @@ -55,6 +55,7 @@ extern WCHAR *windowText(HWND); // container_windows.c extern BOOL sharedWndProc(HWND, UINT, WPARAM, LPARAM, LRESULT *); struct uiSizing { + uiSizingCommon int baseX; int baseY; LONG internalLeading;