AmendHub

Download:

jcs

/

amend

/

amendments

/

86

window_rect: Add function to get rect of a window including title bar


jcs made amendment 86 over 2 years ago
--- util.c Wed Jun 15 11:34:45 2022 +++ util.c Tue Aug 16 21:45:41 2022 @@ -452,9 +452,20 @@ progress(char *format, ...) DrawDialog(progress_dialog); } +void +window_rect(WindowPtr win, Rect *ret) +{ + *ret = (*(((WindowPeek)win)->strucRgn))->rgnBBox; + ret->left += 1; + ret->right -= 2; + ret->top -= 1; + ret->bottom -= 1; +} + /* * General Mac-specific non-GUI functions */ + static unsigned long _xorshift_state = 0; unsigned long xorshift32(void) --- util.h Thu Jun 2 15:58:55 2022 +++ util.h Tue Aug 16 21:24:22 2022 @@ -97,6 +97,7 @@ short ask(const char *format, ...); #define ASK_YES 1 #define ASK_NO 2 void progress(char *format, ...); +void window_rect(WindowPtr win, Rect *ret); Handle xNewHandle(size_t size); Handle xGetResource(ResType type, short id);