summaryrefslogtreecommitdiff
path: root/redo/xsizing_darwin.m
diff options
context:
space:
mode:
authorPietro Gagliardi <[email protected]>2014-08-09 21:34:56 -0400
committerPietro Gagliardi <[email protected]>2014-08-09 21:34:56 -0400
commit62938635a2a6c5d614a890131483c57e1482d1fd (patch)
tree01fd66f1ff5e3506b7300663fb80690cc71b0c59 /redo/xsizing_darwin.m
parentea3dd093f7941cfc74af085fffc8e3f24b2ce0d5 (diff)
Started splitting apart xsizing_darwin.m and rearranging objc_darwin.h.
Diffstat (limited to 'redo/xsizing_darwin.m')
-rw-r--r--redo/xsizing_darwin.m31
1 files changed, 2 insertions, 29 deletions
diff --git a/redo/xsizing_darwin.m b/redo/xsizing_darwin.m
index 84d83f2..56c55b4 100644
--- a/redo/xsizing_darwin.m
+++ b/redo/xsizing_darwin.m
@@ -8,35 +8,7 @@
#define toNSScrollView(x) ((NSScrollView *) (x))
#define toNSView(x) ((NSView *) (x))
-// TODO merge into control_darwin.m or sizing_darwin.m? really need to figure out what to do about the Go-side container struct...
-
-// also good for NSTableView (TODO might not do what we want) and NSProgressIndicator
-struct xsize controlPreferredSize(id control)
-{
- NSControl *c;
- NSRect r;
- struct xsize s;
-
- c = toNSControl(control);
- [c sizeToFit];
- r = [c frame];
- s.width = (intptr_t) r.size.width;
- s.height = (intptr_t) r.size.height;
- return s;
-}
-
-struct xsize tabPreferredSize(id control)
-{
- NSTabView *tv;
- NSSize s;
- struct xsize t;
-
- tv = toNSTabView(control);
- s = [tv minimumSize];
- t.width = (intptr_t) s.width;
- t.height = (intptr_t) s.height;
- return t;
-}
+// TODO figure out where these should go
// this function is safe to call on Areas; it'll just return the frame and a baseline of 0 since it uses the default NSView implementations
struct xalignment alignmentInfo(id c, struct xrect newrect)
@@ -61,6 +33,7 @@ struct xalignment alignmentInfo(id c, struct xrect newrect)
return a;
}
+// TODO remove?
struct xrect frame(id c)
{
NSRect r;