/****************************************************/ /* Fall98: Systems Programming */ /* Assignment 2 */ /* Programmed by : Hesham F. Anan */ /****************************************************/ #include #include #include #include #include #define MAX(A,B) ((A) > (B) ? (A) : (B)) /* Define CheckBox Parameters */ #define CB_WIDTH 20 #define CB_HEIGHT 20 #define CB_CURSOR XC_hand2 #define CB_INPUTMASK ExposureMask |ButtonPressMask | ButtonReleaseMask /* Define Button parameters */ #define SB_WIDTH 80 /* Button Width */ #define SB_HEIGHT 30 /* Button Height */ #define SB_LONGLABEL 50 /* Longest MenuButton label */ #define SB_CURSOR XC_hand1 /* Cursor for inside MenuButton */ #define SB_INPUTMASK ExposureMask | EnterWindowMask | LeaveWindowMask | \ ButtonPressMask | ButtonReleaseMask /* Define Counter Parameters */ #define C_WIDTH 40 #define C_HEIGHT 20 #define C_CURSOR XC_X_cursor #define C_INPUTMASK ExposureMask #define MAXUSERS 6 #define POSX 0 #define POSY 0 #define WIDTH 400 #define HEIGHT 500 #define sendButton 0 #define quitButton 1 /*****************************************************************/ struct CDisp ; struct Button { Window window; GC white_gc,gray_gc,darkgray_gc; int pressed ; /* flag*/ char label[SB_LONGLABEL]; void (*func)(int); }; struct CheckBox { Window window; int flag; /* Checked = 1, Non Checked=0 */ }; struct Count { Window window; int val; /* counter value */ }; struct CDisp { Display *display; Window root, window; GC gc ; struct Button MenuButton[2]; struct CheckBox Topping [4]; struct Count count [5]; int initiator ; int sentflag ; char message [100]; };