File: util_121.h

package info (click to toggle)
ghc-cvs 20040725-2
  • links: PTS
  • area: main
  • in suites: sarge
  • size: 68,484 kB
  • ctags: 19,658
  • sloc: haskell: 251,945; ansic: 109,709; asm: 24,961; sh: 12,825; perl: 5,786; makefile: 5,334; xml: 3,884; python: 682; yacc: 650; lisp: 477; cpp: 337; ml: 76; fortran: 24; csh: 18
file content (112 lines) | stat: -rw-r--r-- 2,203 bytes parent folder | download | duplicates (2)
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
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
#ifndef _UTILH
#define _UTILH

#include "config.h"

#if defined(mingw32_TARGET_OS)

#include <windows.h>
#include <mmsystem.h>
#include <shlobj.h>

typedef HWND OSWindowPtr;
typedef struct
	{
		HDC hDC;
		HDC hBufferedDC;
		HBITMAP hBufferBitmap;

		HPEN theNormalPen;
		HPEN theBackPen;
		HBRUSH theNormalBrush;
		HBRUSH theBackBrush;
		HFONT theFont;

		int penSize;
		int penPat;
		int penMode;
		COLORREF penColor;
		COLORREF backColor;
		char curFont[LF_FACESIZE];
		int fontstyle;
		int fontsize;

		int lastActivity;
	} *OSPictContext;
typedef HRGN OSRgnHandle;
typedef HBITMAP OSBmpHandle;
typedef POINT *PointsArray;

#else

#include <gtk/gtk.h>
#include <gdk/gdk.h>

typedef GtkWidget   *OSWindowPtr;
typedef GdkDrawable *OSPictContext;
typedef GdkRegion   *OSRgnHandle;
typedef GdkPixbuf   *OSBmpHandle;
typedef GdkPoint    *PointsArray;

typedef gboolean BOOL;

#endif




#define SIGNEDLOWORD(i)  ((short) i)
#define SIGNEDHIWORD(i)  ((short) ((i)>>16))


/*  OS type, threading all calls from Clean.
*/

typedef int HITEM;

typedef struct
{   int  mess;
    int  p1;
    int  p2;
    int  p3;
    int  p4;
    int  p5;
    int  p6;
} CrossCallInfo;

#include "intrface_121.h"

/*  since we don't use the C runtime library, here are some simple
    routines that would normally come from the C runtime lib.
*/
// PA: extern added
extern void rfree(void *ptr);
extern void *rmalloc(unsigned long bytes);

/*  clean_strings don't have to end with 0, so we have to make
    copy the clean string and end it with a 0.
    global variables used for conversion from c strings to clean strings
*/

#if defined(mingw32_TARGET_OS)

//	PA: extern added to the end
extern int nCopyAnsiToWideChar (LPWORD, LPSTR);

/*  The following routines are used to write to the console, or convey runtime errors
    with message boxes.
*/

#ifndef _RPRINTBUFSIZE
#define _RPRINTBUFSIZE 512
#endif

extern void rMessageBox(HWND owner, UINT style, char *title, char *format, ... );
extern void CheckF(BOOL theCheck, char *checkText, char *checkMess, char *filename, int linenum);
extern void ErrorExit(char *format, ...);

#define Check(check,mess) CheckF((check),(#check),(mess),__FILE__,__LINE__)

#endif

#endif