File: ui_none.h

package info (click to toggle)
waba 1.5-3
  • links: PTS
  • area: contrib
  • in suites: woody
  • size: 1,996 kB
  • ctags: 3,231
  • sloc: ansic: 17,303; java: 4,436; sh: 2,345; makefile: 417
file content (131 lines) | stat: -rw-r--r-- 3,279 bytes parent folder | download
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
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
/*
   Copyright (C) 2000, 2001 SMARTDATA, http://www.smartdata.ch/

   This program is free software; you can redistribute it and/or
   modify it under the terms of the GNU General Public License as
   published by the Free Software Foundation; either version 2 of the
   License, or (at your option) any later version.

   This program is distributed in the hope that it will be useful, but
   WITHOUT ANY WARRANTY; without even the implied warranty of
   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
   General Public License for more details.

   You should have received a copy of the GNU General Public License
   along with this program; if not, write to the Free Software
   Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.

*/

/*

    None Port. This mean no graphics.

*/

enum ui_EventType {
  penUpEvent,
  penDownEvent,
  penMoveEvent,
  keyDownEvent,
  keyUpEvent,
  quitEvent,
  timerEvent
};

struct ui_Event {
  enum ui_EventType type;
  long x, y;
  guint code;
};


int handleMainWinEvent(struct ui_Event *event);
void drawMainWin();

void *hwr_init();

/*****************************************************************************/

#define HWR_BPP     32

#define HWR_WIDTH   160
#define HWR_HEIGHT  160

#define TITLE       "Waba"

/* Modifier keys */
#define MOD_LSHIFT  0x0001
#define MOD_RSHIFT  0x0002
#define MOD_SHIFT   0x0003
#define MOD_LCTRL   0x0040
#define MOD_RCTRL   0x0080
#define MOD_CTRL    0x00C0
#define MOD_LALT    0x0100
#define MOD_RALT    0x0200
#define MOD_ALT     0x0300
#define MOD_LMETA   0x0400
#define MOD_RMETA   0x0800
#define MOD_META    0x0C00
#define MOD_NUM     0x1000
#define MOD_CAPS    0x2000
#define MOD_MODE    0x4000


typedef uint32 devcolort;
typedef uint32 * devbmpt;

#define mkcolor(r,g,b) ((devcolort) (((r)<<16) | ((g)<<8) | (b)))
#define mkgray(v,m) mkcolor(v*255/m,v*255/m,v*255/m)

/*****************************************************************************/

typedef struct {
  unsigned char type;   /* Basic type of error */
  const char *msg;   /* Static error message detailing the situation */
} g_error;

/* Error types */
#define ERRT_NONE     0
#define ERRT_MEMORY   1
#define ERRT_IO       2
#define ERRT_NETWORK  3
#define ERRT_BADPARAM 4
#define ERRT_HANDLE   5
#define ERRT_INTERNAL 6
#define ERRT_BUSY     7

#define ERRT_NOREPLY  100    /* This special error type sends
				no reply packet- assumes that
				no reply is needed or that one
				will be sent seperately */

extern g_error sucess;

/****************************************************************************
                                   FONT RELATED
****************************************************************************/

#define ui_FontType int

/****************************************************************************
                                   GRAPHICS RELATED
****************************************************************************/

#define ui_MainWindowType int
#define ui_PixmapType int
#define ui_GraphicsContextType int
typedef struct {
  gint32 x;
  gint32 y;
  gint32 width;
  gint32 height;
} ui_Rectangle;

/*****************************************************************************/

/*
   Local Variables:
   c-file-style: "smartdata"
   End:
*/