Clapkit
Loading...
Searching...
No Matches
ckPlatform.h
Go to the documentation of this file.
1/*
2 *
3 * Clapkit
4 * ----------------------------------------------------------------------
5 * A wrapper for creating a 'generalized' app for Classic MacOS
6 * that (hopefully) can be ported easily to other platforms.
7 *
8 * CKPlatform
9 * ----------------------------------------------------------------------
10 * OS-specific aliases, macros and definitions.
11 *
12 */
13
14#pragma once
15#include <Controls.h>
16#include <MacWindows.h>
17#include <Quickdraw.h>
18
19#define kCKAppleMenuID 128
20#define kCKUserMenuStartID 200
21
26#define kCKButtonHeight 20
27
32#define kCKCheckboxHeight 16
33
38#define kCKRadioboxHeight kCKCheckboxHeight
39
44#define kCKTextFieldHeight 20
45
50#define kCKDropdownHeight 20
51
52#define kControlProcIDButton 0
53#define kControlProcIDCheckbox 1
54#define kControlProcIDRadio 2
55#define kControlProcIDScrollbar 16
56#define kControlProcPopup 1008
57
58#define QD_BOLD 1
59#define QD_ITALIC 2
60#define QD_UNDERLINE 4
61
62using CKWindowPtr = WindowPtr;
63using CKControlPtr = ControlRef;
64
71static inline int CKFindFreeMenuID(void) {
72 int mid = 500;
73 while (GetMenuHandle(mid) != nullptr) {
74 ++mid;
75 }
76 return mid;
77}
ControlRef CKControlPtr
Definition ckPlatform.h:63
WindowPtr CKWindowPtr
Definition ckPlatform.h:62