File: MacMainIf.h

package info (click to toggle)
pwlib 1.10.10-2
  • links: PTS, VCS
  • area: main
  • in suites: lenny
  • size: 15,068 kB
  • ctags: 15,167
  • sloc: cpp: 112,149; ansic: 6,061; sh: 2,920; makefile: 1,062; yacc: 861; asm: 161
file content (43 lines) | stat: -rw-r--r-- 1,317 bytes parent folder | download | duplicates (11)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
//
//
// Upper interface declarations for MacMain functions
//
#ifndef MACMAINIF_H_
#define MACMAINIF_H 1

// This embarassing hack exists purely because EMACS' electric-c indentation
// mode is too clever by half...
#ifdef __cplusplus
#define BEGIN_EXTERN_C extern "C" {
#define END_EXTERN_C };
#else
#define BEGIN_EXTERN_C
#define END_EXTERN_C
#endif

#include <CoreServices/CoreServices.h>

BEGIN_EXTERN_C

long MacInitialisePWLibEvents(void);
long MacTeardownPWLibEvents(void);
// technically, CALLBACK_API_C returns OSStatus, but that's a long
typedef long(*callback_api_c)(void*);
int SpawnProcessInContext( callback_api_c trampoline );
// The shutdown dance is long and complicated.
// Actually, it's not.  When (or shortly after) the PProcess terminates,
// three things happen:
// The extern variable pwlibAppQueueID gets set to zero;
// the main application event loop receives a special event call;
// and the main application receives a Quit event.
// Here's the special event:
#define kEventClassPwlib    'PWLB'
#define kEventPwlibPProcExit    0
// Here's the variable:
extern MPQueueID pwlibAppQueueID;
// And here's a function you can call to wait for the application PProcess
// to exit (assuming you've already suggested to it that it should).
long MacWaitForPProcess(Duration);

END_EXTERN_C
#endif