1 /*
2 // topwind.c
3 */
4
5 #include "xbook.h"
6
TopWindow(display,x,y,width,height,bitmap_data,bitmap_width,bitmap_height,icon,gc)7 Window TopWindow( display, x, y, width, height,
8 bitmap_data, bitmap_width, bitmap_height, icon, gc )
9 Display *display;
10 int x, y, width, height;
11 char *bitmap_data;
12 int bitmap_width, bitmap_height;
13 Pixmap *icon;
14 GC *gc;
15 {
16 int screen;
17 Window rootwindow, window;
18 unsigned long black, white;
19 Cursor cursor;
20
21 screen = DefaultScreen( display );
22 rootwindow = RootWindow( display, screen );
23 black = BlackPixel( display, screen );
24 white = WhitePixel( display, screen );
25
26 #define BORDER_WIDTH 2
27
28 window = CreateWindow( display,
29 rootwindow,
30 x, y, width, height,
31 BORDER_WIDTH,
32 black, white,
33 EVENT_MASK );
34 *gc = MakeGC( display, window, black, white );
35 *icon = XCreateBitmapFromData( display, window,
36 bitmap_data,
37 bitmap_width, bitmap_height );
38 cursor = MakeCursor( display, window, DEFAULT_CURSOR );
39 XFreeCursor( display, cursor );
40 XFlush( display );
41 return( window );
42 }
43
44