00001 #ifndef _NANO_X_H
00002 #define _NANO_X_H
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013 #ifdef __cplusplus
00014 extern "C" {
00015 #endif
00016
00017 #include "mwtypes.h"
00018
00019
00020
00021
00022
00023 typedef MWCOORD GR_COORD;
00024 typedef MWCOORD GR_SIZE;
00025 typedef MWCOLORVAL GR_COLOR;
00026 typedef MWPIXELVAL GR_PIXELVAL;
00027 typedef MWIMAGEBITS GR_BITMAP;
00028 typedef MWUCHAR GR_CHAR;
00029 typedef MWTEXTFLAGS GR_TEXTFLAGS;
00030 typedef MWKEY GR_KEY;
00031 typedef MWSCANCODE GR_SCANCODE;
00032 typedef MWKEYMOD GR_KEYMOD;
00033 typedef MWSCREENINFO GR_SCREEN_INFO;
00034 typedef MWWINDOWFBINFO GR_WINDOW_FB_INFO;
00035 typedef MWFONTINFO GR_FONT_INFO;
00036 typedef MWIMAGEINFO GR_IMAGE_INFO;
00037 typedef MWIMAGEHDR GR_IMAGE_HDR;
00038 typedef MWLOGFONT GR_LOGFONT;
00039 typedef MWPALENTRY GR_PALENTRY;
00040 typedef MWPOINT GR_POINT;
00041 typedef MWTIMEOUT GR_TIMEOUT;
00042 typedef MWFONTLIST GR_FONTLIST;
00043 typedef MWKBINFO GR_KBINFO;
00044 typedef MWSTIPPLE GR_STIPPLE;
00045 typedef MWTRANSFORM GR_TRANSFORM;
00046
00047
00048 typedef int GR_COUNT;
00049 typedef unsigned char GR_CHAR_WIDTH;
00050 typedef unsigned int GR_ID;
00051 typedef GR_ID GR_DRAW_ID;
00052 typedef GR_DRAW_ID GR_WINDOW_ID;
00053 typedef GR_ID GR_GC_ID;
00054 typedef GR_ID GR_REGION_ID;
00055 typedef GR_ID GR_FONT_ID;
00056 typedef GR_ID GR_IMAGE_ID;
00057 typedef GR_ID GR_TIMER_ID;
00058 typedef GR_ID GR_CURSOR_ID;
00059 typedef unsigned short GR_BOOL;
00060 typedef int GR_ERROR;
00061 typedef int GR_EVENT_TYPE;
00062 typedef int GR_UPDATE_TYPE;
00063 typedef unsigned long GR_EVENT_MASK;
00064 typedef char GR_FUNC_NAME[25];
00065 typedef unsigned long GR_WM_PROPS;
00066 typedef unsigned long GR_SERIALNO;
00067 typedef unsigned short GR_MIMETYPE;
00068 typedef unsigned long GR_LENGTH;
00069 typedef unsigned int GR_BUTTON;
00070
00071
00072 typedef struct {
00073 GR_COORD x;
00074 GR_COORD y;
00075 GR_SIZE width;
00076 GR_SIZE height;
00077 } GR_RECT;
00078
00079
00080 #define GR_ROOT_WINDOW_ID ((GR_WINDOW_ID) 1)
00081
00082
00083 #define GR_RGB(r,g,b) MWRGB(r,g,b)
00084 #define GR_ARGB(a,r,g,b) MWARGB(a,r,g,b)
00085
00086
00087 #define GR_MODE_COPY MWMODE_COPY
00088 #define GR_MODE_SET MWMODE_COPY
00089 #define GR_MODE_XOR MWMODE_XOR
00090 #define GR_MODE_OR MWMODE_OR
00091 #define GR_MODE_AND MWMODE_AND
00092 #define GR_MODE_CLEAR MWMODE_CLEAR
00093 #define GR_MODE_SETTO1 MWMODE_SETTO1
00094 #define GR_MODE_EQUIV MWMODE_EQUIV
00095 #define GR_MODE_NOR MWMODE_NOR
00096 #define GR_MODE_NAND MWMODE_NAND
00097 #define GR_MODE_INVERT MWMODE_INVERT
00098 #define GR_MODE_COPYINVERTED MWMODE_COPYINVERTED
00099 #define GR_MODE_ORINVERTED MWMODE_ORINVERTED
00100 #define GR_MODE_ANDINVERTED MWMODE_ANDINVERTED
00101 #define GR_MODE_ORREVERSE MWMODE_ORREVERSE
00102 #define GR_MODE_ANDREVERSE MWMODE_ANDREVERSE
00103 #define GR_MODE_NOOP MWMODE_NOOP
00104
00105 #define GR_MODE_DRAWMASK 0x00FF
00106 #define GR_MODE_EXCLUDECHILDREN 0x0100
00107
00108
00109 #define GR_LINE_SOLID MWLINE_SOLID
00110 #define GR_LINE_ONOFF_DASH MWLINE_ONOFF_DASH
00111
00112 #define GR_FILL_SOLID MWFILL_SOLID
00113 #define GR_FILL_STIPPLE MWFILL_STIPPLE
00114 #define GR_FILL_OPAQUE_STIPPLE MWFILL_OPAQUE_STIPPLE
00115 #define GR_FILL_TILE MWFILL_TILE
00116
00117
00118 #define GR_POLY_EVENODD MWPOLY_EVENODD
00119 #define GR_POLY_WINDING MWPOLY_WINDING
00120
00121
00122 #define GR_FONT_SYSTEM_VAR MWFONT_SYSTEM_VAR
00123 #define GR_FONT_SYSTEM_FIXED MWFONT_SYSTEM_FIXED
00124 #define GR_FONT_GUI_VAR MWFONT_GUI_VAR
00125 #define GR_FONT_OEM_FIXED MWFONT_OEM_FIXED
00126
00127
00128 #define GR_TFASCII MWTF_ASCII
00129 #define GR_TFUTF8 MWTF_UTF8
00130 #define GR_TFUC16 MWTF_UC16
00131 #define GR_TFUC32 MWTF_UC32
00132 #define GR_TFXCHAR2B MWTF_XCHAR2B
00133 #define GR_TFPACKMASK MWTF_PACKMASK
00134
00135
00136 #define GR_TFTOP MWTF_TOP
00137 #define GR_TFBASELINE MWTF_BASELINE
00138 #define GR_TFBOTTOM MWTF_BOTTOM
00139
00140
00141 #define GR_TFKERNING MWTF_KERNING
00142 #define GR_TFANTIALIAS MWTF_ANTIALIAS
00143 #define GR_TFUNDERLINE MWTF_UNDERLINE
00144
00145
00146 #define GR_ARC MWARC
00147 #define GR_ARCOUTLINE MWARCOUTLINE
00148 #define GR_PIE MWPIE
00149
00150
00151 #define GR_WINDOW_BOUNDING_MASK 0
00152 #define GR_WINDOW_CLIP_MASK 1
00153
00154
00155 #define GR_FALSE 0
00156 #define GR_TRUE 1
00157
00158
00159 #define GR_IMAGE_MAX_SIZE (-1)
00160
00161
00162 #define GR_BUTTON_R MWBUTTON_R
00163 #define GR_BUTTON_M MWBUTTON_M
00164 #define GR_BUTTON_L MWBUTTON_L
00165 #define GR_BUTTON_ANY (MWBUTTON_R|MWBUTTON_M|MWBUTTON_L)
00166
00167
00168 #define GR_BACKGROUND_TILE 0
00169 #define GR_BACKGROUND_CENTER 1
00170 #define GR_BACKGROUND_TOPLEFT 2
00171 #define GR_BACKGROUND_STRETCH 4
00172 #define GR_BACKGROUND_TRANS 8
00173
00174
00175 #define GR_BMDATA_BYTEREVERSE 01
00176 #define GR_BMDATA_BYTESWAP 02
00177
00178 #if 0
00179
00180 #define GR_WM_PROP_NORESIZE 0x04
00181 #define GR_WM_PROP_NOICONISE 0x08
00182 #define GR_WM_PROP_NOWINMENU 0x10
00183 #define GR_WM_PROP_NOROLLUP 0x20
00184 #define GR_WM_PROP_ONTOP 0x200
00185 #define GR_WM_PROP_STICKY 0x400
00186 #define GR_WM_PROP_DND 0x2000
00187 #endif
00188
00189
00190 #define GR_WM_PROPS_NOBACKGROUND 0x00000001L
00191 #define GR_WM_PROPS_NOFOCUS 0x00000002L
00192 #define GR_WM_PROPS_NOMOVE 0x00000004L
00193 #define GR_WM_PROPS_NORAISE 0x00000008L
00194 #define GR_WM_PROPS_NODECORATE 0x00000010L
00195 #define GR_WM_PROPS_NOAUTOMOVE 0x00000020L
00196 #define GR_WM_PROPS_NOAUTORESIZE 0x00000040L
00197
00198
00199 #define GR_WM_PROPS_APPWINDOW 0x00000000L
00200 #define GR_WM_PROPS_APPMASK 0xF0000000L
00201 #define GR_WM_PROPS_BORDER 0x80000000L
00202 #define GR_WM_PROPS_APPFRAME 0x40000000L
00203 #define GR_WM_PROPS_CAPTION 0x20000000L
00204 #define GR_WM_PROPS_CLOSEBOX 0x10000000L
00205 #define GR_WM_PROPS_MAXIMIZE 0x08000000L
00206
00207
00208 #define GR_WM_FLAGS_PROPS 0x0001
00209 #define GR_WM_FLAGS_TITLE 0x0002
00210 #define GR_WM_FLAGS_BACKGROUND 0x0004
00211 #define GR_WM_FLAGS_BORDERSIZE 0x0008
00212 #define GR_WM_FLAGS_BORDERCOLOR 0x0010
00213
00214
00215
00216
00217
00218 typedef struct {
00219 GR_WM_PROPS flags;
00220 GR_WM_PROPS props;
00221 GR_CHAR *title;
00222 GR_COLOR background;
00223 GR_SIZE bordersize;
00224 GR_COLOR bordercolor;
00225 } GR_WM_PROPERTIES;
00226
00227
00228
00229
00230 typedef struct {
00231 GR_WINDOW_ID wid;
00232 GR_WINDOW_ID parent;
00233 GR_WINDOW_ID child;
00234 GR_WINDOW_ID sibling;
00235 GR_BOOL inputonly;
00236 GR_BOOL mapped;
00237 GR_BOOL realized;
00238 GR_COORD x;
00239 GR_COORD y;
00240 GR_SIZE width;
00241 GR_SIZE height;
00242 GR_SIZE bordersize;
00243 GR_COLOR bordercolor;
00244 GR_COLOR background;
00245 GR_EVENT_MASK eventmask;
00246 GR_WM_PROPS props;
00247 GR_CURSOR_ID cursor;
00248 unsigned long processid;
00249 } GR_WINDOW_INFO;
00250
00251
00252
00253
00254 typedef struct {
00255 GR_GC_ID gcid;
00256 int mode;
00257 GR_REGION_ID region;
00258 int xoff;
00259 int yoff;
00260 GR_FONT_ID font;
00261 GR_COLOR foreground;
00262 GR_COLOR background;
00263 GR_BOOL fgispixelval;
00264 GR_BOOL bgispixelval;
00265 GR_BOOL usebackground;
00266 GR_BOOL exposure;
00267 } GR_GC_INFO;
00268
00269
00270
00271
00272 typedef struct {
00273 GR_COUNT count;
00274 GR_PALENTRY palette[256];
00275 } GR_PALETTE;
00276
00277
00278 typedef struct {
00279 int xres;
00280 int yres;
00281 int minx;
00282 int miny;
00283 int maxx;
00284 int maxy;
00285 GR_BOOL xswap;
00286 GR_BOOL yswap;
00287 } GR_CAL_DATA;
00288
00289
00290 #define GR_ERROR_BAD_WINDOW_ID 1
00291 #define GR_ERROR_BAD_GC_ID 2
00292 #define GR_ERROR_BAD_CURSOR_SIZE 3
00293 #define GR_ERROR_MALLOC_FAILED 4
00294 #define GR_ERROR_BAD_WINDOW_SIZE 5
00295 #define GR_ERROR_KEYBOARD_ERROR 6
00296 #define GR_ERROR_MOUSE_ERROR 7
00297 #define GR_ERROR_INPUT_ONLY_WINDOW 8
00298 #define GR_ERROR_ILLEGAL_ON_ROOT_WINDOW 9
00299 #define GR_ERROR_TOO_MUCH_CLIPPING 10
00300 #define GR_ERROR_SCREEN_ERROR 11
00301 #define GR_ERROR_UNMAPPED_FOCUS_WINDOW 12
00302 #define GR_ERROR_BAD_DRAWING_MODE 13
00303 #define GR_ERROR_BAD_LINE_ATTRIBUTE 14
00304 #define GR_ERROR_BAD_FILL_MODE 15
00305 #define GR_ERROR_BAD_REGION_ID 16
00306
00307
00308
00309
00310
00311
00312
00313
00314 #define GR_EVENT_TYPE_ERROR (-1)
00315 #define GR_EVENT_TYPE_NONE 0
00316 #define GR_EVENT_TYPE_EXPOSURE 1
00317 #define GR_EVENT_TYPE_BUTTON_DOWN 2
00318 #define GR_EVENT_TYPE_BUTTON_UP 3
00319 #define GR_EVENT_TYPE_MOUSE_ENTER 4
00320 #define GR_EVENT_TYPE_MOUSE_EXIT 5
00321 #define GR_EVENT_TYPE_MOUSE_MOTION 6
00322 #define GR_EVENT_TYPE_MOUSE_POSITION 7
00323 #define GR_EVENT_TYPE_KEY_DOWN 8
00324 #define GR_EVENT_TYPE_KEY_UP 9
00325 #define GR_EVENT_TYPE_FOCUS_IN 10
00326 #define GR_EVENT_TYPE_FOCUS_OUT 11
00327 #define GR_EVENT_TYPE_FDINPUT 12
00328 #define GR_EVENT_TYPE_UPDATE 13
00329 #define GR_EVENT_TYPE_CHLD_UPDATE 14
00330 #define GR_EVENT_TYPE_CLOSE_REQ 15
00331 #define GR_EVENT_TYPE_TIMEOUT 16
00332 #define GR_EVENT_TYPE_SCREENSAVER 17
00333 #define GR_EVENT_TYPE_CLIENT_DATA_REQ 18
00334 #define GR_EVENT_TYPE_CLIENT_DATA 19
00335 #define GR_EVENT_TYPE_SELECTION_CHANGED 20
00336 #define GR_EVENT_TYPE_TIMER 21
00337 #define GR_EVENT_TYPE_PORTRAIT_CHANGED 22
00338 #define GR_EVENT_TYPE_HOTKEY_DOWN 23
00339 #define GR_EVENT_TYPE_HOTKEY_UP 24
00340
00341
00342 #define GR_EVENTMASK(n) (((GR_EVENT_MASK) 1) << (n))
00343
00344 #define GR_EVENT_MASK_NONE GR_EVENTMASK(GR_EVENT_TYPE_NONE)
00345 #define GR_EVENT_MASK_ERROR 0x80000000L
00346 #define GR_EVENT_MASK_EXPOSURE GR_EVENTMASK(GR_EVENT_TYPE_EXPOSURE)
00347 #define GR_EVENT_MASK_BUTTON_DOWN GR_EVENTMASK(GR_EVENT_TYPE_BUTTON_DOWN)
00348 #define GR_EVENT_MASK_BUTTON_UP GR_EVENTMASK(GR_EVENT_TYPE_BUTTON_UP)
00349 #define GR_EVENT_MASK_MOUSE_ENTER GR_EVENTMASK(GR_EVENT_TYPE_MOUSE_ENTER)
00350 #define GR_EVENT_MASK_MOUSE_EXIT GR_EVENTMASK(GR_EVENT_TYPE_MOUSE_EXIT)
00351 #define GR_EVENT_MASK_MOUSE_MOTION GR_EVENTMASK(GR_EVENT_TYPE_MOUSE_MOTION)
00352 #define GR_EVENT_MASK_MOUSE_POSITION GR_EVENTMASK(GR_EVENT_TYPE_MOUSE_POSITION)
00353 #define GR_EVENT_MASK_KEY_DOWN GR_EVENTMASK(GR_EVENT_TYPE_KEY_DOWN)
00354 #define GR_EVENT_MASK_KEY_UP GR_EVENTMASK(GR_EVENT_TYPE_KEY_UP)
00355 #define GR_EVENT_MASK_FOCUS_IN GR_EVENTMASK(GR_EVENT_TYPE_FOCUS_IN)
00356 #define GR_EVENT_MASK_FOCUS_OUT GR_EVENTMASK(GR_EVENT_TYPE_FOCUS_OUT)
00357 #define GR_EVENT_MASK_FDINPUT GR_EVENTMASK(GR_EVENT_TYPE_FDINPUT)
00358 #define GR_EVENT_MASK_UPDATE GR_EVENTMASK(GR_EVENT_TYPE_UPDATE)
00359 #define GR_EVENT_MASK_CHLD_UPDATE GR_EVENTMASK(GR_EVENT_TYPE_CHLD_UPDATE)
00360 #define GR_EVENT_MASK_CLOSE_REQ GR_EVENTMASK(GR_EVENT_TYPE_CLOSE_REQ)
00361 #define GR_EVENT_MASK_TIMEOUT GR_EVENTMASK(GR_EVENT_TYPE_TIMEOUT)
00362 #define GR_EVENT_MASK_SCREENSAVER GR_EVENTMASK(GR_EVENT_TYPE_SCREENSAVER)
00363 #define GR_EVENT_MASK_CLIENT_DATA_REQ GR_EVENTMASK(GR_EVENT_TYPE_CLIENT_DATA_REQ)
00364 #define GR_EVENT_MASK_CLIENT_DATA GR_EVENTMASK(GR_EVENT_TYPE_CLIENT_DATA)
00365 #define GR_EVENT_MASK_SELECTION_CHANGED GR_EVENTMASK(GR_EVENT_TYPE_SELECTION_CHANGED)
00366 #define GR_EVENT_MASK_TIMER GR_EVENTMASK(GR_EVENT_TYPE_TIMER)
00367 #define GR_EVENT_MASK_PORTRAIT_CHANGED GR_EVENTMASK(GR_EVENT_TYPE_PORTRAIT_CHANGED)
00368
00369
00370
00371 #define GR_EVENT_MASK_ALL ((GR_EVENT_MASK) -1L)
00372
00373
00374 #define GR_UPDATE_MAP 1
00375 #define GR_UPDATE_UNMAP 2
00376 #define GR_UPDATE_MOVE 3
00377 #define GR_UPDATE_SIZE 4
00378 #define GR_UPDATE_UNMAPTEMP 5
00379 #define GR_UPDATE_ACTIVATE 6
00380 #define GR_UPDATE_DESTROY 7
00381 #define GR_UPDATE_REPARENT 8
00382
00383
00384
00385
00386
00387
00388
00389
00390
00391 typedef struct {
00392 GR_EVENT_TYPE type;
00393 GR_FUNC_NAME name;
00394 GR_ERROR code;
00395 GR_ID id;
00396 } GR_EVENT_ERROR;
00397
00398
00399
00400
00401 typedef struct {
00402 GR_EVENT_TYPE type;
00403 GR_WINDOW_ID wid;
00404 GR_WINDOW_ID subwid;
00405 GR_COORD rootx;
00406 GR_COORD rooty;
00407 GR_COORD x;
00408 GR_COORD y;
00409 GR_BUTTON buttons;
00410 GR_BUTTON changebuttons;
00411 GR_KEYMOD modifiers;
00412 GR_TIMEOUT time;
00413 } GR_EVENT_BUTTON;
00414
00415
00416
00417
00418 typedef struct {
00419 GR_EVENT_TYPE type;
00420 GR_WINDOW_ID wid;
00421 GR_WINDOW_ID subwid;
00422 GR_COORD rootx;
00423 GR_COORD rooty;
00424 GR_COORD x;
00425 GR_COORD y;
00426 GR_BUTTON buttons;
00427 GR_KEYMOD modifiers;
00428 GR_KEY ch;
00429 GR_SCANCODE scancode;
00430 GR_BOOL hotkey;
00431 } GR_EVENT_KEYSTROKE;
00432
00433
00434
00435
00436 typedef struct {
00437 GR_EVENT_TYPE type;
00438 GR_WINDOW_ID wid;
00439 GR_COORD x;
00440 GR_COORD y;
00441 GR_SIZE width;
00442 GR_SIZE height;
00443 } GR_EVENT_EXPOSURE;
00444
00445
00446
00447
00448
00449
00450
00451 typedef struct {
00452 GR_EVENT_TYPE type;
00453 GR_WINDOW_ID wid;
00454 GR_WINDOW_ID otherid;
00455 } GR_EVENT_GENERAL;
00456
00457
00458
00459
00460 typedef struct {
00461 GR_EVENT_TYPE type;
00462 GR_WINDOW_ID wid;
00463 GR_WINDOW_ID subwid;
00464 GR_COORD rootx;
00465 GR_COORD rooty;
00466 GR_COORD x;
00467 GR_COORD y;
00468 GR_BUTTON buttons;
00469 GR_KEYMOD modifiers;
00470 } GR_EVENT_MOUSE;
00471
00472
00473
00474
00475 typedef struct {
00476 GR_EVENT_TYPE type;
00477 int fd;
00478 } GR_EVENT_FDINPUT;
00479
00480
00481
00482
00483 typedef struct {
00484 GR_EVENT_TYPE type;
00485 GR_WINDOW_ID wid;
00486 GR_WINDOW_ID subwid;
00487 GR_COORD x;
00488 GR_COORD y;
00489 GR_SIZE width;
00490 GR_SIZE height;
00491 GR_UPDATE_TYPE utype;
00492 } GR_EVENT_UPDATE;
00493
00494
00495
00496
00497 typedef struct {
00498 GR_EVENT_TYPE type;
00499 GR_BOOL activate;
00500 } GR_EVENT_SCREENSAVER;
00501
00502
00503
00504
00505 typedef struct {
00506 GR_EVENT_TYPE type;
00507 GR_WINDOW_ID wid;
00508 GR_WINDOW_ID rid;
00509 GR_SERIALNO serial;
00510 GR_MIMETYPE mimetype;
00511 } GR_EVENT_CLIENT_DATA_REQ;
00512
00513
00514
00515
00516 typedef struct {
00517 GR_EVENT_TYPE type;
00518 GR_WINDOW_ID wid;
00519 GR_WINDOW_ID rid;
00520 GR_SERIALNO serial;
00521 unsigned long len;
00522 unsigned long datalen;
00523 void *data;
00524 } GR_EVENT_CLIENT_DATA;
00525
00526
00527
00528
00529 typedef struct {
00530 GR_EVENT_TYPE type;
00531 GR_WINDOW_ID new_owner;
00532 } GR_EVENT_SELECTION_CHANGED;
00533
00534
00535
00536
00537 typedef struct {
00538 GR_EVENT_TYPE type;
00539 GR_WINDOW_ID wid;
00540 GR_TIMER_ID tid;
00541 } GR_EVENT_TIMER;
00542
00543
00544
00545
00546
00547 typedef union {
00548 GR_EVENT_TYPE type;
00549 GR_EVENT_ERROR error;
00550 GR_EVENT_GENERAL general;
00551 GR_EVENT_BUTTON button;
00552 GR_EVENT_KEYSTROKE keystroke;
00553 GR_EVENT_EXPOSURE exposure;
00554 GR_EVENT_MOUSE mouse;
00555 GR_EVENT_FDINPUT fdinput;
00556 GR_EVENT_UPDATE update;
00557 GR_EVENT_SCREENSAVER screensaver;
00558 GR_EVENT_CLIENT_DATA_REQ clientdatareq;
00559 GR_EVENT_CLIENT_DATA clientdata;
00560 GR_EVENT_SELECTION_CHANGED selectionchanged;
00561 GR_EVENT_TIMER timer;
00562 } GR_EVENT;
00563
00564 typedef void (*GR_FNCALLBACKEVENT)(GR_EVENT *);
00565
00566
00567
00568 #define GR_BITMAP_SIZE(width, height) MWIMAGE_SIZE(width, height)
00569 #define GR_BITMAPBITS MWIMAGE_BITSPERIMAGE
00570 #define GR_BITVALUE(n) MWIMAGE_BITVALUE(n)
00571 #define GR_FIRSTBIT MWIMAGE_FIRSTBIT
00572 #define GR_NEXTBIT(m) MWIMAGE_NEXTBIT(m)
00573 #define GR_TESTBIT(m) MWIMAGE_TESTBIT(m)
00574 #define GR_SHIFTBIT(m) MWIMAGE_SHIFTBIT(m)
00575
00576
00577
00578
00579
00580
00581
00582
00583
00584
00585
00586
00587
00588
00589
00590
00591
00592
00593
00594 #define GR_GRAB_HOTKEY_EXCLUSIVE 0
00595
00596
00597
00598
00599
00600
00601
00602
00603
00604
00605
00606
00607
00608
00609
00610
00611
00612
00613
00614
00615
00616 #define GR_GRAB_HOTKEY 1
00617
00618
00619
00620
00621
00622
00623
00624
00625
00626
00627
00628
00629
00630
00631
00632
00633
00634
00635
00636 #define GR_GRAB_EXCLUSIVE 2
00637
00638
00639
00640
00641
00642
00643
00644
00645
00646
00647
00648
00649
00650
00651 #define GR_GRAB_EXCLUSIVE_MOUSE 3
00652
00653
00654
00655
00656
00657
00658
00659 #define GR_GRAB_MAX GR_GRAB_EXCLUSIVE_MOUSE
00660
00661
00662
00663 #define GR_COLOR_DESKTOP 0
00664
00665
00666 #define GR_COLOR_ACTIVECAPTION 1
00667 #define GR_COLOR_ACTIVECAPTIONTEXT 2
00668 #define GR_COLOR_INACTIVECAPTION 3
00669 #define GR_COLOR_INACTIVECAPTIONTEXT 4
00670
00671
00672 #define GR_COLOR_WINDOWFRAME 5
00673 #define GR_COLOR_BTNSHADOW 6
00674 #define GR_COLOR_3DLIGHT 7
00675 #define GR_COLOR_BTNHIGHLIGHT 8
00676
00677
00678 #define GR_COLOR_APPWINDOW 9
00679 #define GR_COLOR_APPTEXT 10
00680
00681
00682 #define GR_COLOR_BTNFACE 11
00683 #define GR_COLOR_BTNTEXT 12
00684
00685
00686 #define GR_COLOR_WINDOW 13
00687 #define GR_COLOR_WINDOWTEXT 14
00688 #define GR_COLOR_HIGHLIGHT 15
00689 #define GR_COLOR_HIGHLIGHTTEXT 16
00690 #define GR_COLOR_GRAYTEXT 17
00691
00692
00693 #define GR_COLOR_MENUTEXT 18
00694 #define GR_COLOR_MENU 19
00695
00696
00697
00698
00699 #define GR_ERROR_STRINGS \
00700 "", \
00701 "Bad window id: %d\n", \
00702 "Bad graphics context: %d\n", \
00703 "Bad cursor size\n", \
00704 "Out of server memory\n", \
00705 "Bad window size: %d\n", \
00706 "Keyboard error\n", \
00707 "Mouse error\n", \
00708 "Input only window: %d\n", \
00709 "Illegal on root window: %d\n", \
00710 "Clipping overflow\n", \
00711 "Screen error\n", \
00712 "Unmapped focus window: %d\n", \
00713 "Bad drawing mode gc: %d\n", \
00714 "Bad line attribute gc: %d\n", \
00715 "Bad fill mode gc: %d\n", \
00716 "Bad region id: %d\n",
00717
00718 extern char *nxErrorStrings[];
00719
00720
00721 void GrFlush(void);
00722 int GrOpen(void);
00723 void GrClose(void);
00724 void GrDelay(GR_TIMEOUT msecs);
00725 void GrGetScreenInfo(GR_SCREEN_INFO *sip);
00726 GR_COLOR GrGetSysColor(int index);
00727 GR_WINDOW_ID GrNewWindow(GR_WINDOW_ID parent, GR_COORD x, GR_COORD y,
00728 GR_SIZE width, GR_SIZE height, GR_SIZE bordersize,
00729 GR_COLOR background, GR_COLOR bordercolor);
00730 GR_WINDOW_ID GrNewPixmap(GR_SIZE width, GR_SIZE height, void *pixels);
00731 GR_WINDOW_ID GrNewInputWindow(GR_WINDOW_ID parent, GR_COORD x, GR_COORD y,
00732 GR_SIZE width, GR_SIZE height);
00733 void GrDestroyWindow(GR_WINDOW_ID wid);
00734 GR_GC_ID GrNewGC(void);
00735 GR_GC_ID GrCopyGC(GR_GC_ID gc);
00736 void GrGetGCInfo(GR_GC_ID gc, GR_GC_INFO *gcip);
00737 void GrDestroyGC(GR_GC_ID gc);
00738 GR_REGION_ID GrNewRegion(void);
00739 GR_REGION_ID GrNewBitmapRegion(GR_BITMAP *bitmap, GR_SIZE width,
00740 GR_SIZE height);
00741 GR_REGION_ID GrNewPolygonRegion(int mode, GR_COUNT count, GR_POINT *points);
00742 void GrDestroyRegion(GR_REGION_ID region);
00743 void GrUnionRectWithRegion(GR_REGION_ID region, GR_RECT *rect);
00744 void GrUnionRegion(GR_REGION_ID dst_rgn, GR_REGION_ID src_rgn1,
00745 GR_REGION_ID src_rgn2);
00746 void GrIntersectRegion(GR_REGION_ID dst_rgn, GR_REGION_ID src_rgn1,
00747 GR_REGION_ID src_rgn2);
00748 void GrSubtractRegion(GR_REGION_ID dst_rgn, GR_REGION_ID src_rgn1,
00749 GR_REGION_ID src_rgn2);
00750 void GrXorRegion(GR_REGION_ID dst_rgn, GR_REGION_ID src_rgn1,
00751 GR_REGION_ID src_rgn2);
00752 void GrSetGCRegion(GR_GC_ID gc, GR_REGION_ID region);
00753 void GrSetGCClipOrigin(GR_GC_ID gc, int x, int y);
00754 GR_BOOL GrPointInRegion(GR_REGION_ID region, GR_COORD x, GR_COORD y);
00755 int GrRectInRegion(GR_REGION_ID region, GR_COORD x, GR_COORD y,
00756 GR_COORD w, GR_COORD h);
00757 GR_BOOL GrEmptyRegion(GR_REGION_ID region);
00758 GR_BOOL GrEqualRegion(GR_REGION_ID rgn1, GR_REGION_ID rgn2);
00759 void GrOffsetRegion(GR_REGION_ID region, GR_SIZE dx, GR_SIZE dy);
00760 int GrGetRegionBox(GR_REGION_ID region, GR_RECT *rect);
00761 void GrMapWindow(GR_WINDOW_ID wid);
00762 void GrUnmapWindow(GR_WINDOW_ID wid);
00763 void GrRaiseWindow(GR_WINDOW_ID wid);
00764 void GrLowerWindow(GR_WINDOW_ID wid);
00765 void GrMoveWindow(GR_WINDOW_ID wid, GR_COORD x, GR_COORD y);
00766 void GrResizeWindow(GR_WINDOW_ID wid, GR_SIZE width, GR_SIZE height);
00767 void GrReparentWindow(GR_WINDOW_ID wid, GR_WINDOW_ID pwid,
00768 GR_COORD x, GR_COORD y);
00769 void GrGetWindowInfo(GR_WINDOW_ID wid, GR_WINDOW_INFO *infoptr);
00770 void GrSetWMProperties(GR_WINDOW_ID wid, GR_WM_PROPERTIES *props);
00771 void GrGetWMProperties(GR_WINDOW_ID wid, GR_WM_PROPERTIES *props);
00772 GR_FONT_ID GrCreateFont(GR_CHAR *name, GR_COORD height,
00773 GR_LOGFONT *plogfont);
00774 GR_FONT_ID GrCreateFontFromBuffer(const void *buffer, unsigned length,
00775 const char *format, GR_COORD height);
00776 GR_FONT_ID GrCopyFont(GR_FONT_ID fontid, GR_COORD height);
00777 void GrGetFontList(GR_FONTLIST ***fonts, int *numfonts);
00778 void GrFreeFontList(GR_FONTLIST ***fonts, int numfonts);
00779 void GrSetFontSize(GR_FONT_ID fontid, GR_COORD size);
00780 void GrSetFontRotation(GR_FONT_ID fontid, int tenthsdegrees);
00781 void GrSetFontAttr(GR_FONT_ID fontid, int setflags, int clrflags);
00782 void GrDestroyFont(GR_FONT_ID fontid);
00783 void GrGetFontInfo(GR_FONT_ID font, GR_FONT_INFO *fip);
00784 GR_WINDOW_ID GrGetFocus(void);
00785 void GrSetFocus(GR_WINDOW_ID wid);
00786 void GrClearArea(GR_WINDOW_ID wid, GR_COORD x, GR_COORD y,
00787 GR_SIZE width, GR_SIZE height, GR_BOOL exposeflag);
00788 void GrSelectEvents(GR_WINDOW_ID wid, GR_EVENT_MASK eventmask);
00789 void GrGetNextEvent(GR_EVENT *ep);
00790 int GrGetTypedEvent(GR_WINDOW_ID wid, GR_EVENT_MASK mask,
00791 GR_UPDATE_TYPE update, GR_EVENT *ep, GR_BOOL block);
00792 typedef GR_BOOL (*GR_TYPED_EVENT_CALLBACK)(GR_WINDOW_ID, GR_EVENT_MASK,
00793 GR_UPDATE_TYPE, GR_EVENT *, void *);
00794 int GrGetTypedEventPred(GR_WINDOW_ID wid, GR_EVENT_MASK mask,
00795 GR_UPDATE_TYPE update, GR_EVENT * ep, GR_BOOL block,
00796 GR_TYPED_EVENT_CALLBACK matchfn, void *arg);
00797 void GrGetNextEventTimeout(GR_EVENT *ep, GR_TIMEOUT timeout);
00798 void GrCheckNextEvent(GR_EVENT *ep);
00799 int GrPeekEvent(GR_EVENT *ep);
00800 void GrPeekWaitEvent(GR_EVENT *ep);
00801 void GrLine(GR_DRAW_ID id, GR_GC_ID gc, GR_COORD x1, GR_COORD y1,
00802 GR_COORD x2, GR_COORD y2);
00803 void GrPoint(GR_DRAW_ID id, GR_GC_ID gc, GR_COORD x, GR_COORD y);
00804 void GrPoints(GR_DRAW_ID id, GR_GC_ID gc, GR_COUNT count,
00805 GR_POINT *pointtable);
00806 void GrRect(GR_DRAW_ID id, GR_GC_ID gc, GR_COORD x, GR_COORD y,
00807 GR_SIZE width, GR_SIZE height);
00808 void GrFillRect(GR_DRAW_ID id, GR_GC_ID gc, GR_COORD x, GR_COORD y,
00809 GR_SIZE width, GR_SIZE height);
00810 void GrPoly(GR_DRAW_ID id, GR_GC_ID gc, GR_COUNT count,
00811 GR_POINT *pointtable);
00812 void GrFillPoly(GR_DRAW_ID id, GR_GC_ID gc, GR_COUNT count,
00813 GR_POINT *pointtable);
00814 void GrEllipse(GR_DRAW_ID id, GR_GC_ID gc, GR_COORD x, GR_COORD y,
00815 GR_SIZE rx, GR_SIZE ry);
00816 void GrFillEllipse(GR_DRAW_ID id, GR_GC_ID gc, GR_COORD x,
00817 GR_COORD y, GR_SIZE rx, GR_SIZE ry);
00818 void GrArc(GR_DRAW_ID id, GR_GC_ID gc, GR_COORD x, GR_COORD y,
00819 GR_SIZE rx, GR_SIZE ry, GR_COORD ax, GR_COORD ay,
00820 GR_COORD bx, GR_COORD by, int type);
00821 void GrArcAngle(GR_DRAW_ID id, GR_GC_ID gc, GR_COORD x, GR_COORD y,
00822 GR_SIZE rx, GR_SIZE ry, GR_COORD angle1,
00823 GR_COORD angle2, int type);
00824 void GrSetGCForeground(GR_GC_ID gc, GR_COLOR foreground);
00825 void GrSetGCForegroundPixelVal(GR_GC_ID gc, GR_PIXELVAL foreground);
00826 void GrSetGCBackground(GR_GC_ID gc, GR_COLOR background);
00827 void GrSetGCBackgroundPixelVal(GR_GC_ID gc, GR_PIXELVAL background);
00828 void GrSetGCUseBackground(GR_GC_ID gc, GR_BOOL flag);
00829 void GrSetGCMode(GR_GC_ID gc, int mode);
00830
00831 void GrSetGCLineAttributes(GR_GC_ID, int);
00832 void GrSetGCDash(GR_GC_ID, char *, int);
00833 void GrSetGCFillMode(GR_GC_ID, int);
00834 void GrSetGCStipple(GR_GC_ID, GR_BITMAP *, GR_SIZE, GR_SIZE);
00835 void GrSetGCTile(GR_GC_ID, GR_WINDOW_ID, GR_SIZE, GR_SIZE);
00836 void GrSetGCTSOffset(GR_GC_ID, GR_COORD, GR_COORD);
00837
00838 void GrSetGCGraphicsExposure(GR_GC_ID gc, GR_BOOL exposure);
00839 void GrSetGCFont(GR_GC_ID gc, GR_FONT_ID font);
00840 void GrGetGCTextSize(GR_GC_ID gc, void *str, int count,
00841 GR_TEXTFLAGS flags, GR_SIZE *retwidth,
00842 GR_SIZE *retheight,GR_SIZE *retbase);
00843 void GrReadArea(GR_DRAW_ID id, GR_COORD x, GR_COORD y, GR_SIZE width,
00844 GR_SIZE height, GR_PIXELVAL *pixels);
00845 void GrArea(GR_DRAW_ID id, GR_GC_ID gc, GR_COORD x, GR_COORD y,
00846 GR_SIZE width,GR_SIZE height,void *pixels,int pixtype);
00847 void GrCopyArea(GR_DRAW_ID id, GR_GC_ID gc, GR_COORD x, GR_COORD y,
00848 GR_SIZE width, GR_SIZE height, GR_DRAW_ID srcid,
00849 GR_COORD srcx, GR_COORD srcy, unsigned long op);
00850 void GrStretchArea(GR_DRAW_ID dstid, GR_GC_ID gc, GR_COORD dx1,
00851 GR_COORD dy1, GR_COORD dx2, GR_COORD dy2,
00852 GR_DRAW_ID srcid, GR_COORD sx1, GR_COORD sy1,
00853 GR_COORD sx2, GR_COORD sy2, unsigned long op);
00854 void GrBitmap(GR_DRAW_ID id, GR_GC_ID gc, GR_COORD x, GR_COORD y,
00855 GR_SIZE width, GR_SIZE height, GR_BITMAP *imagebits);
00856 void GrDrawImageBits(GR_DRAW_ID id,GR_GC_ID gc,GR_COORD x,GR_COORD y,
00857 GR_IMAGE_HDR *pimage);
00858 void GrDrawImageFromFile(GR_DRAW_ID id, GR_GC_ID gc, GR_COORD x,
00859 GR_COORD y, GR_SIZE width, GR_SIZE height,
00860 char *path, int flags);
00861 GR_IMAGE_ID GrLoadImageFromFile(char *path, int flags);
00862 void GrDrawImageFromBuffer(GR_DRAW_ID id, GR_GC_ID gc, GR_COORD x,
00863 GR_COORD y, GR_SIZE width, GR_SIZE height,
00864 void *buffer, int size, int flags);
00865 GR_IMAGE_ID GrLoadImageFromBuffer(void *buffer, int size, int flags);
00866 void GrDrawImageToFit(GR_DRAW_ID id, GR_GC_ID gc, GR_COORD x,
00867 GR_COORD y, GR_SIZE width, GR_SIZE height,
00868 GR_IMAGE_ID imageid);
00869 void GrFreeImage(GR_IMAGE_ID id);
00870 void GrGetImageInfo(GR_IMAGE_ID id, GR_IMAGE_INFO *iip);
00871 void GrText(GR_DRAW_ID id, GR_GC_ID gc, GR_COORD x, GR_COORD y,
00872 void *str, GR_COUNT count, GR_TEXTFLAGS flags);
00873 GR_CURSOR_ID GrNewCursor(GR_SIZE width, GR_SIZE height, GR_COORD hotx,
00874 GR_COORD hoty, GR_COLOR foreground, GR_COLOR background,
00875 GR_BITMAP *fgbitmap, GR_BITMAP *bgbitmap);
00876 void GrDestroyCursor(GR_CURSOR_ID cid);
00877 void GrSetWindowCursor(GR_WINDOW_ID wid, GR_CURSOR_ID cid);
00878 void GrSetWindowRegion(GR_WINDOW_ID wid, GR_REGION_ID rid, int type);
00879 void GrMoveCursor(GR_COORD x, GR_COORD y);
00880 void GrGetSystemPalette(GR_PALETTE *pal);
00881 void GrSetSystemPalette(GR_COUNT first, GR_PALETTE *pal);
00882 void GrFindColor(GR_COLOR c, GR_PIXELVAL *retpixel);
00883 void GrReqShmCmds(long shmsize);
00884 void GrInjectPointerEvent(MWCOORD x, MWCOORD y,
00885 int button, int visible);
00886 void GrInjectKeyboardEvent(GR_WINDOW_ID wid, GR_KEY keyvalue,
00887 GR_KEYMOD modifiers, GR_SCANCODE scancode,
00888 GR_BOOL pressed);
00889 void GrCloseWindow(GR_WINDOW_ID wid);
00890 void GrKillWindow(GR_WINDOW_ID wid);
00891 void GrSetScreenSaverTimeout(GR_TIMEOUT timeout);
00892 void GrSetSelectionOwner(GR_WINDOW_ID wid, GR_CHAR *typelist);
00893 GR_WINDOW_ID GrGetSelectionOwner(GR_CHAR **typelist);
00894 void GrRequestClientData(GR_WINDOW_ID wid, GR_WINDOW_ID rid,
00895 GR_SERIALNO serial, GR_MIMETYPE mimetype);
00896 void GrSendClientData(GR_WINDOW_ID wid, GR_WINDOW_ID did,
00897 GR_SERIALNO serial, GR_LENGTH len, GR_LENGTH thislen,
00898 void *data);
00899 void GrBell(void);
00900 void GrSetBackgroundPixmap(GR_WINDOW_ID wid, GR_WINDOW_ID pixmap,
00901 int flags);
00902 void GrQueryPointer(GR_WINDOW_ID *mwin, GR_COORD *x, GR_COORD *y,
00903 GR_BUTTON *bmask);
00904 void GrQueryTree(GR_WINDOW_ID wid, GR_WINDOW_ID *parentid,
00905 GR_WINDOW_ID **children, GR_COUNT *nchildren);
00906 GR_BOOL GrGrabKey(GR_WINDOW_ID wid, GR_KEY key, int type);
00907 void GrUngrabKey(GR_WINDOW_ID wid, GR_KEY key);
00908
00909 GR_TIMER_ID GrCreateTimer(GR_WINDOW_ID wid, GR_TIMEOUT period);
00910 void GrDestroyTimer(GR_TIMER_ID tid);
00911 void GrSetPortraitMode(int portraitmode);
00912
00913 void GrRegisterInput(int fd);
00914 void GrUnregisterInput(int fd);
00915 void GrMainLoop(GR_FNCALLBACKEVENT fncb);
00916 GR_FNCALLBACKEVENT GrSetErrorHandler(GR_FNCALLBACKEVENT fncb);
00917 void GrDefaultErrorHandler(GR_EVENT *ep);
00918
00919
00920 void GrPrepareSelect(int *maxfd,void *rfdset);
00921 void GrServiceSelect(void *rfdset, GR_FNCALLBACKEVENT fncb);
00922
00923
00924 int GrQueueLength(void);
00925
00926 void GrSetTransform(GR_TRANSFORM *);
00927
00928
00929 int GrCalcTransform(GR_CAL_DATA *, GR_TRANSFORM *);
00930 int GrLoadTransformData(char *filename, GR_TRANSFORM *);
00931 int GrSaveTransformData(GR_TRANSFORM *, char *filename);
00932
00933
00934 GR_WINDOW_ID GrNewWindowEx(GR_WM_PROPS props, GR_CHAR *title,
00935 GR_WINDOW_ID parent, GR_COORD x, GR_COORD y,
00936 GR_SIZE width, GR_SIZE height, GR_COLOR background);
00937 void GrDrawLines(GR_DRAW_ID w, GR_GC_ID gc, GR_POINT *points,
00938 GR_COUNT count);
00939 GR_BITMAP * GrNewBitmapFromData(GR_SIZE width, GR_SIZE height, GR_SIZE bits_width,
00940 GR_SIZE bits_height, void *bits, int flags);
00941 GR_WINDOW_ID GrNewPixmapFromData(GR_SIZE width, GR_SIZE height,
00942 GR_COLOR foreground, GR_COLOR background, void * bits,
00943 int flags);
00944 GR_BITMAP * GrNewBitmapFromPixmap(GR_WINDOW_ID pixmap, int x, int y, GR_SIZE width,
00945 GR_SIZE height);
00946 GR_BITMAP * GrNewBitmapFromPixmap(GR_WINDOW_ID pixmap, int x, int y,
00947 GR_SIZE width, GR_SIZE height);
00948 GR_REGION_ID GrNewRegionFromPixmap(GR_WINDOW_ID src, MWCOORD x, MWCOORD y,
00949 GR_SIZE width, GR_SIZE height);
00950
00951
00952 unsigned char * GrOpenClientFramebuffer(void);
00953 void GrCloseClientFramebuffer(void);
00954 void GrGetWindowFBInfo(GR_WINDOW_ID wid, GR_WINDOW_FB_INFO *fbinfo);
00955
00956
00957 GR_CURSOR_ID GrSetCursor(GR_WINDOW_ID wid, GR_SIZE width, GR_SIZE height,
00958 GR_COORD hotx, GR_COORD hoty, GR_COLOR foreground,
00959 GR_COLOR background, GR_BITMAP *fbbitmap,
00960 GR_BITMAP *bgbitmap);
00961 #define GrSetBorderColor GrSetWindowBorderColor
00962 #define GrClearWindow(wid,exposeflag) GrClearArea(wid,0,0,0,0,exposeflag)
00963
00964
00965 #define GrSetWindowBackgroundColor(wid,color) \
00966 { GR_WM_PROPERTIES props; \
00967 props.flags = GR_WM_FLAGS_BACKGROUND; \
00968 props.background = color; \
00969 GrSetWMProperties(wid, &props); \
00970 }
00971 #define GrSetWindowBorderSize(wid,width) \
00972 { GR_WM_PROPERTIES props; \
00973 props.flags = GR_WM_FLAGS_BORDERSIZE; \
00974 props.bordersize = width; \
00975 GrSetWMProperties(wid, &props); \
00976 }
00977 #define GrSetWindowBorderColor(wid,color) \
00978 { GR_WM_PROPERTIES props; \
00979 props.flags = GR_WM_FLAGS_BORDERCOLOR; \
00980 props.bordercolor = color; \
00981 GrSetWMProperties(wid, &props); \
00982 }
00983 #define GrSetWindowTitle(wid,name) \
00984 { GR_WM_PROPERTIES props; \
00985 props.flags = GR_WM_FLAGS_TITLE; \
00986 props.title = (GR_CHAR *)name; \
00987 GrSetWMProperties(wid, &props); \
00988 }
00989
00990 #ifdef __cplusplus
00991 }
00992 #endif
00993
00994
00995 #if __rtems__
00996 #define main rtems_main
00997 #endif
00998
00999
01000 typedef struct event_list EVENT_LIST;
01001 struct event_list {
01002 EVENT_LIST * next;
01003 GR_EVENT event;
01004 };
01005
01006
01007 typedef struct {
01008 unsigned char *bufptr;
01009 unsigned char *bufmax;
01010 unsigned char *buffer;
01011 } REQBUF;
01012
01013 #ifdef __ECOS
01014 #include <sys/select.h>
01015 #include <cyg/kernel/kapi.h>
01016
01017
01018
01019
01020
01021 typedef struct {
01022 int _nxSocket;
01023 MWMUTEX _nxGlobalLock;
01024 int _storedevent;
01025 GR_EVENT _storedevent_data;
01026 int _regfdmax;
01027 fd_set _regfdset;
01028 GR_FNCALLBACKEVENT _GrErrorFunc;
01029 REQBUF _reqbuf;
01030 EVENT_LIST *_evlist;
01031 } ecos_nanox_client_data;
01032
01033 extern int ecos_nanox_client_data_index;
01034
01035 #define ACCESS_PER_THREAD_DATA() \
01036 ecos_nanox_client_data *data = (ecos_nanox_client_data*) \
01037 cyg_thread_get_data((cyg_ucount32)ecos_nanox_client_data_index);
01038
01039 #define INIT_PER_THREAD_DATA() \
01040 { \
01041 ecos_nanox_client_data *dptr = malloc(sizeof(ecos_nanox_client_data)); \
01042 ecos_nanox_client_data_index = data; \
01043 dptr->_nxSocket = -1; \
01044 dptr->nxGlobalLock = 0;
01045 dptr->_storedevent = 0; \
01046 dptr->_regfdmax = -1; \
01047 FD_ZERO(&dptr->_regfdset); \
01048 dptr->_GrErrorFunc = GrDefaultErrorHandler; \
01049 dptr->_reqbuf.bufptr = NULL; \
01050 dptr->_reqbuf.bufmax = NULL; \
01051 dptr->_reqbuf.buffer = NULL; \
01052 dptr->_evlist = NULL; \
01053 cyg_thread_set_data(ecos_nanox_client_data_index,(CYG_ADDRWORD)dptr); \
01054 }
01055
01056 #define nxSocket (data->_nxSocket)
01057 #define nxGlobalLock (data->_nxGlobalLock)
01058 #define storedevent (data->_storedevent)
01059 #define storedevent_data (data->_storedevent_data)
01060 #define regfdmax (data->_regfdmax)
01061 #define regfdset (data->_regfdset)
01062 #define ErrorFunc (data->_GrErrorFunc)
01063 #define reqbuf (data->_reqbuf)
01064 #define evlist (data->_evlist)
01065
01066 #else
01067 #define ACCESS_PER_THREAD_DATA()
01068 #endif
01069
01070 #endif