1 /*
2  * $Id: playw.h,v 1.2 2010-07-19 07:39:13 thiebaut Exp $
3  * MS Windows-private portability layer declarations
4  */
5 /* Copyright (c) 2005, The Regents of the University of California.
6  * All rights reserved.
7  * This file is part of yorick (http://yorick.sourceforge.net).
8  * Read the accompanying LICENSE file for details.
9  */
10 
11 #include "playwin.h"
12 
13 #if defined(__cplusplus) || defined(c_plusplus)
14 extern "C" {
15 #endif
16 
17 extern void w_initialize(HINSTANCE i, HWND w,  void (*wquit)(void),
18                          int (*wstdinit)(void(**)(char*,long),
19                                          void(**)(char*,long)),
20                          HWND (*wparent)(int, int, char *, int));
21 extern int w_on_quit(void);
22 
23 extern void w_caught(void);
24 extern int w_sigint(int delay);
25 extern void w_siginit(void);
26 extern void w_fpu_setup(void);
27 extern int w_protect(int (*run)(void));
28 
29 extern DWORD w_id_worker;  /* required for PostThreadMessage */
30 extern HANDLE w_worker;
31 extern int w_work_idle(void);
32 extern void w_pollinit(void);
33 extern UINT w_add_msg(void (*on_msg)(MSG *));
34 extern int w_app_msg(MSG *msg);
35 extern int (*w_msg_hook)(MSG *msg);
36 extern int w_add_input(HANDLE wait_obj, void (*on_input)(void *),
37                        void *context);
38 extern void w_prepoll(void (*on_prepoll)(void *), void *context, int remove);
39 
40 extern int w_no_mdi;
41 extern int con_stdinit(void(**)(char*,long), void(**)(char*,long));
42 extern int (*w_stdinit)(void (**wout)(char*,long),
43                         void (**werr)(char*,long));
44 extern void con_stdout(char *output_line, long len);
45 extern void con_stderr(char *output_line, long len);
46 extern void w_deliver(char *buf);   /* calls on_stdin */
47 extern char *w_sendbuf(long len);
48 
49 extern int w_nwins;  /* count of graphics windows */
50 
51 extern HINSTANCE w_app_instance;
52 extern HWND w_main_window;
53 extern HWND (*w_parent)(int width, int height, char *title, int hints);
54 extern LRESULT CALLBACK w_winproc(HWND hwnd, UINT uMsg,
55                                   WPARAM wParam, LPARAM lParam);
56 
57 extern char *w_pathname(const char *name);
58 extern char *w_unixpath(const char *wname);
59 
60 /* if set non-zero, p_abort will call this */
61 extern void (*w_abort_hook)(void);
62 
63 /* ------------------------------------------------------------------------ */
64 
65 extern p_scr w_screen;
66 extern HCURSOR w_cursor(int cursor);
67 extern LPCTSTR w_win_class;
68 extern LPCTSTR w_menu_class;
69 
70 extern COLORREF w_color(p_win *w, unsigned long color);
71 extern HDC w_getdc(p_win *w, int flags);
72 
73 /* all bitmap functions seem to get colors backwards?? */
74 #define W_SWAPRGB(c) (((c)&0xff00)|(((c)>>16)&0xff)|(((c)&0xff)<<16))
75 
76 extern POINT w_pt_list[2050];
77 extern int w_pt_count;
78 
79 #if defined(__cplusplus) || defined(c_plusplus)
80 }
81 #endif
82