26 |
#include <string.h> |
#include <string.h> |
27 |
#include <unistd.h> |
#include <unistd.h> |
28 |
#include <stdlib.h> |
#include <stdlib.h> |
29 |
|
#include <X11/extensions/shape.h> |
30 |
|
#include "pixmask.xbm" |
31 |
|
|
32 |
/* This is a debug marking function. */ |
/* This is a debug marking function. */ |
33 |
#define ARBUG \ |
#define ARBUG \ |
87 |
void |
void |
88 |
draw_button(int x, int y, int width, int height, char *text) |
draw_button(int x, int y, int width, int height, char *text) |
89 |
{ |
{ |
|
arshell_set_foreground(215, 215, 215); |
|
|
XFillRectangle(display, iconwin, gc, x, y, width, height); |
|
|
arshell_set_foreground(255, 255, 255); |
|
|
XDrawLine(display, iconwin, gc, x+1, y+1, x+width-1, y+1); |
|
|
XDrawLine(display, iconwin, gc, x+1, y+1, x+1, y+height-1); |
|
|
arshell_set_foreground(0, 0, 0); |
|
|
XDrawRectangle(display, iconwin, gc, x, y, width, height); |
|
90 |
arshell_set_font("5x7"); |
arshell_set_font("5x7"); |
91 |
arshell_set_foreground( 0, 0, 25 ); |
arshell_set_foreground( 250, 150, 150 ); |
92 |
XDrawString(display, iconwin, gc, x+2, y+height-1, text, strlen(text)); |
XDrawString(display, iconwin, gc, x+2, y+height-1, text, strlen(text)); |
93 |
} |
} |
94 |
|
|
97 |
{ |
{ |
98 |
int row_counter, column_counter; |
int row_counter, column_counter; |
99 |
int counter=1; |
int counter=1; |
100 |
|
arshell_set_foreground(0,0,0); |
101 |
|
XFillRectangle(display, iconwin, gc, 0, 0, 64, 64); |
102 |
for(column_counter=0; column_counter < 2; column_counter++) |
for(column_counter=0; column_counter < 2; column_counter++) |
103 |
{ |
{ |
104 |
for(row_counter=0; row_counter < 8; row_counter++, counter++) |
for(row_counter=0; row_counter < 8; row_counter++, counter++) |
129 |
int done=0; |
int done=0; |
130 |
XEvent event; |
XEvent event; |
131 |
unsigned int item_counter, char_counter; |
unsigned int item_counter, char_counter; |
132 |
|
Pixmap pixmask; |
133 |
|
|
134 |
|
|
135 |
for(item_counter=1;item_counter<(unsigned int)argc; item_counter++) |
for(item_counter=1;item_counter<(unsigned int)argc; item_counter++) |
136 |
{ |
{ |
191 |
gcv.background = WhitePixel(display, DefaultScreen(display)); |
gcv.background = WhitePixel(display, DefaultScreen(display)); |
192 |
gcv.graphics_exposures = 0; |
gcv.graphics_exposures = 0; |
193 |
gc = XCreateGC(display, DefaultRootWindow(display), gcm, &gcv); |
gc = XCreateGC(display, DefaultRootWindow(display), gcm, &gcv); |
194 |
|
|
195 |
|
|
196 |
|
pixmask = XCreateBitmapFromData(display, window, |
197 |
|
(const char*)pixmask_bits, |
198 |
|
pixmask_width, pixmask_height); |
199 |
|
XShapeCombineMask(display, window, ShapeBounding, 0, 0, |
200 |
|
pixmask, ShapeSet); |
201 |
|
XShapeCombineMask(display, iconwin, ShapeBounding, 0, 0, |
202 |
|
pixmask, ShapeSet); |
203 |
|
|
204 |
|
|
205 |
mywmhints.initial_state = WithdrawnState; |
mywmhints.initial_state = WithdrawnState; |
206 |
mywmhints.icon_window = iconwin; |
mywmhints.icon_window = iconwin; |
207 |
mywmhints.icon_x = mysizehints.x; |
mywmhints.icon_x = mysizehints.x; |