ltpanel-0.2/0000755000175000001440000000000010237151565013626 5ustar nicolasusers00000000000000ltpanel-0.2/src/0000755000175000001440000000000010237151565014415 5ustar nicolasusers00000000000000ltpanel-0.2/src/Makefile0000644000175000001440000000100510237151565016051 0ustar nicolasusers00000000000000CC = gcc C_FLAGS = -g -c -DHAVE_XPM -Wall -pedantic -I/usr/X11R6/include # L_FLAGS = -O3 -s -Xlinker -L/usr/X11R6/lib -lX11 -lXpm L_FLAGS = -g -Xlinker -L/usr/X11R6/lib -lX11 -lXpm PROGNAME = lpanel OBJS = lpanel.o drawing.o $(PROGNAME): Makefile lpanel.o drawing.o $(CC) $(L_FLAGS) $(OBJS) -o $(PROGNAME) @ls -l $(PROGNAME) lpanel.o: lpanel.c lpanel.h ../icon.xpm $(CC) $(C_FLAGS) -o lpanel.o $< drawing.o: drawing.c drawing.h $(CC) $(C_FLAGS) -o drawing.o $< clean: rm -f core *.o $(PROGNAME) nohup.out ltpanel-0.2/src/drawing.h0000644000175000001440000000037610237151565016227 0ustar nicolasusers00000000000000void set_foreground(int index, Display * dd); void fill_rect(taskbar* tb, int x, int y, int a, int b); void scale_icon (task *tk, Display * dd); void gui_draw_vline (taskbar * tb, int x,int row); void draw_line (taskbar *tb, int x, int y, int a, int b); ltpanel-0.2/src/lpanel.h0000644000175000001440000000440610237151565016045 0ustar nicolasusers00000000000000/* Structures */ typedef struct task { struct task *next; Window win; Pixmap icon; Pixmap mask; char *name; int pos_x; int width; int pos_y; unsigned int focused:1; unsigned int iconified:1; unsigned int icon_copied:1; } task; typedef struct taskbar { Window win; Display *dd; task *task_list; int num_tasks; int my_desktop; unsigned int hidden:1; unsigned int at_top:1; int width; int height; int rowheight; } taskbar; typedef struct args { int winheight; int winwidth; int nrows; int wintop; int rowheight; /* winheight/nrows */ } args; /* Misc stuff */ #define MWM_HINTS_DECORATIONS (1L << 1) typedef struct _mwmhints { unsigned long flags; unsigned long functions; unsigned long decorations; long inputMode; unsigned long status; } MWMHints; /* What's all this stuff copied from ? Maybe a #include would have been better*/ #define WIN_STATE_STICKY (1<<0) /* everyone knows sticky */ #define WIN_STATE_MINIMIZED (1<<1) /* ??? */ #define WIN_STATE_MAXIMIZED_VERT (1<<2) /* window in maximized V state */ #define WIN_STATE_MAXIMIZED_HORIZ (1<<3) /* window in maximized H state */ #define WIN_STATE_HIDDEN (1<<4) /* not on taskbar but window visible */ #define WIN_STATE_SHADED (1<<5) /* shaded (NeXT style) */ #define WIN_STATE_HID_WORKSPACE (1<<6) /* not on current desktop */ #define WIN_STATE_HID_TRANSIENT (1<<7) /* owner of transient is hidden */ #define WIN_STATE_FIXED_POSITION (1<<8) /* window is fixed in position even */ #define WIN_STATE_ARRANGE_IGNORE (1<<9) /* ignore for auto arranging */ #define WIN_HINTS_SKIP_FOCUS (1<<0) /* "alt-tab" skips this win */ #define WIN_HINTS_SKIP_WINLIST (1<<1) /* not in win list */ #define WIN_HINTS_SKIP_TASKBAR (1<<2) /* not on taskbar */ #define WIN_HINTS_GROUP_TRANSIENT (1<<3) /* ??????? */ #define WIN_HINTS_FOCUS_ON_CLICK (1<<4) /* app only accepts focus when clicked */ #define WIN_HINTS_DO_NOT_COVER (1<<5) /* attempt to not cover this window */ /* Defines and al. */ /* you can edit these <- don't */ #define ICONWIDTH 16 #define ICONHEIGHT 16 #define FONT_NAME "-*-lucida*-m*-r-*-*-12-*-*" /* Don't edit this unless you want to make the panel look odd. */ #define TASKS_X 8 /* don't edit this (I did not get what it means.) */ #define TEXTPAD 6 ltpanel-0.2/src/drawing.c0000644000175000001440000000347510237151565016225 0ustar nicolasusers00000000000000#include #include "lpanel.h" #include "drawing.h" #define PALETTE_COUNT 6 unsigned long palette[PALETTE_COUNT]; /* FIXME : rip out this horror */ extern GC fore_gc; extern int scr_depth; /* end horror */ void gui_draw_vline (taskbar * tb, int x,int row) { set_foreground (4,tb->dd); draw_line (tb, x, row * tb->rowheight, x,(row + 1) * tb->rowheight); set_foreground (3,tb->dd); draw_line (tb, x + 1, row * tb->rowheight, x + 1,(row + 1) * tb->rowheight); } void draw_line (taskbar *tb, int x, int y, int a, int b) { XDrawLine (tb->dd, tb->win, fore_gc, x, y, a, b); } void set_foreground (int index, Display * dd) { XSetForeground (dd, fore_gc, palette[index]); } void fill_rect (taskbar *tb, int x, int y, int a, int b) { XFillRectangle (tb->dd, tb->win, fore_gc, x, y, a, b); } void scale_icon (task *tk, Display * dd) { int xx, yy, x, y, w, h, d, bw; Pixmap pix, mk = None; XGCValues gcv; GC mgc; XGetGeometry (dd, tk->icon, &pix, &x, &y, &w, &h, &bw, &d); pix = XCreatePixmap (dd, tk->win, ICONWIDTH, ICONHEIGHT, scr_depth); if (tk->mask != None) { mk = XCreatePixmap (dd, tk->win, ICONWIDTH, ICONHEIGHT, 1); gcv.subwindow_mode = IncludeInferiors; gcv.graphics_exposures = False; mgc = XCreateGC (dd, mk, GCGraphicsExposures | GCSubwindowMode, &gcv); } set_foreground (3,dd); /* this is my simple & dirty scaling routine */ for (y = ICONHEIGHT - 1; y >= 0; y--) { yy = (y * h) / ICONHEIGHT; for (x = ICONWIDTH - 1; x >= 0; x--) { xx = (x * w) / ICONWIDTH; if (d != scr_depth) XCopyPlane (dd, tk->icon, pix, fore_gc, xx, yy, 1, 1, x, y, 1); else XCopyArea (dd, tk->icon, pix, fore_gc, xx, yy, 1, 1, x, y); if (mk != None) XCopyArea (dd, tk->mask, mk, mgc, xx, yy, 1, 1, x, y); } } if (mk != None) { XFreeGC (dd, mgc); tk->mask = mk; } tk->icon = pix; } ltpanel-0.2/src/lpanel.c0000644000175000001440000005063110237151565016041 0ustar nicolasusers00000000000000/* lpanel.c: main source file of lpanel Copyright (C) 2003 Nicolas Even 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. */ /******************************************************** ** F***ing Small Panel 0.7 Copyright (c) 2000-2001 By ** ** Peter Zelezny ** ** See file COPYING for license details. ** ********************************************************/ #include #include #include #include #include #include #include #include #include #include #ifdef HAVE_XPM #include #include "../icon.xpm" #endif #include "lpanel.h" #include "drawing.h" Window root_win; Pixmap generic_icon; Pixmap generic_mask; GC fore_gc; XFontStruct *xfs; int scr_screen; int scr_depth; int scr_width; int scr_height; unsigned short cols[] = { 0xd75c, 0xd75c, 0xd75c, /* 0. light gray */ 0xbefb, 0xbaea, 0xbefb, /* 1. mid gray */ 0xaefb, 0xaaea, 0xaefb, /* 2. dark gray */ 0xefbe, 0xefbe, 0xefbe, /* 3. white */ 0x8617, 0x8207, 0x8617, /* 4. darkest gray */ 0x0000, 0x0000, 0x0000 /* 5. black */ }; #define PALETTE_COUNT (sizeof (cols) / sizeof (cols[0]) / 3) extern unsigned long palette[PALETTE_COUNT]; char *atom_names[] = { "KWM_WIN_ICON", "_MOTIF_WM_HINTS", "_WIN_WORKSPACE", "_WIN_HINTS", "_WIN_LAYER", "_NET_CLIENT_LIST", "_WIN_CLIENT_LIST", "_WIN_WORKSPACE_COUNT", "_WIN_STATE", "WM_STATE" }; #define ATOM_COUNT (sizeof (atom_names) / sizeof (atom_names[0])) Atom atoms[ATOM_COUNT]; #define atom_KWM_WIN_ICON atoms[0] #define atom__MOTIF_WM_HINTS atoms[1] #define atom__WIN_WORKSPACE atoms[2] #define atom__WIN_HINTS atoms[3] #define atom__WIN_LAYER atoms[4] #define atom__NET_CLIENT_LIST atoms[5] #define atom__WIN_CLIENT_LIST atoms[6] #define atom__WIN_WORKSPACE_COUNT atoms[7] #define atom__WIN_STATE atoms[8] #define atom_WM_STATE atoms[9] void *get_prop_data(Window win, Atom prop, Atom type, int *items, Display * dd) { Atom type_ret; int format_ret; unsigned long items_ret; unsigned long after_ret; unsigned char *prop_data; prop_data = 0; XGetWindowProperty(dd, win, prop, 0, 0x7fffffff, False, type, &type_ret, &format_ret, &items_ret, &after_ret, &prop_data); if (items) *items = items_ret; return prop_data; } void get_task_hinticon(task * tk, Display * dd) { XWMHints *hin; tk->icon = None; tk->mask = None; hin = (XWMHints *) get_prop_data(tk->win, XA_WM_HINTS, XA_WM_HINTS, 0, dd); if (hin) { if ((hin->flags & IconPixmapHint)) { if ((hin->flags & IconMaskHint)) { tk->mask = hin->icon_mask; } tk->icon = hin->icon_pixmap; tk->icon_copied = 1; scale_icon(tk, dd); } XFree(hin); } if (tk->icon == None) { tk->icon = generic_icon; tk->mask = generic_mask; } } void get_task_kdeicon(task * tk, Display * dd) { unsigned long *data; data = get_prop_data(tk->win, atom_KWM_WIN_ICON, atom_KWM_WIN_ICON, 0, dd); if (data) { tk->icon = data[0]; tk->mask = data[1]; XFree(data); } } int find_desktop(Window win, Display * dd) { int desk = 0; unsigned long *data; data = get_prop_data(win, atom__WIN_WORKSPACE, XA_CARDINAL, 0, dd); if (data) { desk = *data; XFree(data); } return desk; } int is_hidden(Window win, Display * dd) { unsigned long *data; int ret = 0; data = get_prop_data(win, atom__WIN_HINTS, XA_CARDINAL, 0, dd); if (data) { if ((*data) & WIN_HINTS_SKIP_TASKBAR) ret = 1; XFree(data); } return ret; } int is_iconified(Window win, Display * dd) { unsigned long *data; int ret = 0; data = get_prop_data(win, atom_WM_STATE, atom_WM_STATE, 0, dd); if (data) { if (data[0] == IconicState) ret = 1; XFree(data); } return ret; } void add_task(taskbar * tb, Window win, int focus) { task *tk, *list; /* is this window on a different desktop? */ if (tb->my_desktop != find_desktop(win, tb->dd) || is_hidden (win, tb->dd)) return; tk = calloc(1, sizeof(task)); tk->win = win; tk->focused = focus; tk->name = get_prop_data(win, XA_WM_NAME, XA_STRING, 0, tb->dd); tk->iconified = is_iconified(win, tb->dd); get_task_kdeicon(tk, tb->dd); if (tk->icon == None) get_task_hinticon(tk, tb->dd); XSelectInput(tb->dd, win, PropertyChangeMask | FocusChangeMask | StructureNotifyMask); /* now append it to our linked list */ tb->num_tasks++; list = tb->task_list; if (!list) { tb->task_list = tk; return; } while (1) { if (!list->next) { list->next = tk; return; } list = list->next; } } void gui_sync(Display * dd) { XSync(dd, False); } void set_prop(Window win, Atom at, long val, Display * dd) { XChangeProperty(dd, win, at, XA_CARDINAL, 32, PropModeReplace, (unsigned char *) &val, 1); } taskbar *gui_create_taskbar(arg, dd) args arg; Display *dd; { taskbar *tb; Window win; MWMHints mwm; XSizeHints size_hints; XWMHints wmhints; XSetWindowAttributes att; att.background_pixel = palette[0]; att.event_mask = ButtonPressMask | ExposureMask; win = XCreateWindow( /* display */ dd, /* parent */ root_win, /* x */ 0, /* y */ arg.wintop /* scr_height - WINHEIGHT */ , /* width */ arg.winwidth, /* height */ arg.winheight, /* border */ 0, /* depth */ CopyFromParent, /* class */ InputOutput, /* visual */ CopyFromParent, /*value mask */ CWBackPixel | CWEventMask, /* attribs */ &att); /* don't let any windows cover fspanel */ set_prop(win, atom__WIN_LAYER, 10, dd); /* WIN_LAYER_ABOVE_DOCK */ set_prop(win, atom__WIN_STATE, WIN_STATE_STICKY | WIN_STATE_FIXED_POSITION, dd); set_prop(win, atom__WIN_HINTS, WIN_HINTS_SKIP_FOCUS | WIN_HINTS_SKIP_WINLIST | WIN_HINTS_SKIP_TASKBAR | WIN_HINTS_DO_NOT_COVER , dd); /* borderless motif hint */ memset(&mwm, 0, sizeof(mwm)); mwm.flags = MWM_HINTS_DECORATIONS; XChangeProperty(dd, win, atom__MOTIF_WM_HINTS, atom__MOTIF_WM_HINTS, 32, PropModeReplace, (unsigned char *) &mwm, sizeof(MWMHints) / 4); /* make sure the WM obays our window position */ size_hints.flags = PPosition; /*XSetWMNormalHints (dd, win, &size_hints); */ XChangeProperty(dd, win, XA_WM_NORMAL_HINTS, XA_WM_SIZE_HINTS, 32, PropModeReplace, (unsigned char *) &size_hints, sizeof(XSizeHints) / 4); /* make our window unfocusable */ wmhints.flags = InputHint; wmhints.input = 0; /*XSetWMHints (dd, win, &wmhints); */ XChangeProperty(dd, win, XA_WM_HINTS, XA_WM_HINTS, 32, PropModeReplace, (unsigned char *) &wmhints, sizeof(XWMHints) / 4); XMapWindow(dd, win); tb = calloc(1, sizeof(taskbar)); tb->win = win; tb->width = arg.winwidth; tb->height = arg.winheight; tb->rowheight = arg.rowheight; tb->dd = dd; return tb; } void gui_init(Display * dd) { XGCValues gcv; XColor xcl; int i, j; char *fontname; i = j = 0; do { xcl.red = cols[i]; i++; xcl.green = cols[i]; i++; xcl.blue = cols[i]; i++; XAllocColor(dd, DefaultColormap(dd, scr_screen), &xcl); palette[j] = xcl.pixel; j++; } while (j < PALETTE_COUNT); fontname = FONT_NAME; do { xfs = XLoadQueryFont(dd, fontname); fontname = "fixed"; } while (!xfs); gcv.font = xfs->fid; gcv.graphics_exposures = False; fore_gc = XCreateGC(dd, root_win, GCFont | GCGraphicsExposures, &gcv); #ifdef HAVE_XPM XpmCreatePixmapFromData(dd, root_win, icon_xpm, &generic_icon, &generic_mask, NULL); #else generic_icon = 0; #endif } void gui_draw_task(taskbar * tb, task * tk) { int len; int x = tk->pos_x; int y = tk->pos_y; int taskw = tk->width; int text_y; if (!tk->name) return; /* I don't get what this is */ gui_draw_vline(tb, x, y / tb->rowheight); /*REPL*/ /*set_foreground (3); *//* it's already 3 from gui_draw_vline() */ #if 1 /* When disabled, funny marks appear on top and bottom TOFIX */ /* Draw top border */ draw_line(tb, x + 1, y, x + taskw, y); /* Draw bottom border */ set_foreground(1, tb->dd); draw_line(tb, x + 1, y + tb->rowheight - 1, x + taskw, y + tb->rowheight - 1); #endif /* TODO: implement functions to draw buttons or use a toolkit. */ if (tk->focused) { x++; set_foreground(1, tb->dd); /* mid gray */ fill_rect(tb, x + 3, y + 3, taskw - 5, tb->rowheight - 6); set_foreground(3, tb->dd); /* white */ draw_line(tb, x + 2, y + tb->rowheight - 2, x + taskw - 2, y + tb->rowheight - 2); draw_line(tb, x + taskw - 2, y + 2, x + taskw - 2, y + tb->rowheight - 2); set_foreground(0, tb->dd); draw_line(tb, x + 1, y + 2, x + 1, y + tb->rowheight - 2); set_foreground(4, tb->dd); /* darkest gray */ draw_line(tb, x + 2, y + 2, x + taskw - 2, y + 2); draw_line(tb, x + 2, y + 2, x + 2, y + tb->rowheight - 3); } else { set_foreground(0, tb->dd); /* mid gray */ fill_rect(tb, x + 2, y + 1, taskw - 1, tb->rowheight - 2); } { int text_x = x + TEXTPAD * 2 + ICONWIDTH; /* check how many chars can fit */ len = strlen(tk->name); while (XTextWidth(xfs, tk->name, len) >= taskw - (text_x - x) - 2 && len > 0) len--; /* Added this, make text_y local. FIXME*/ text_y = y + xfs->ascent + ((tb->rowheight - xfs->ascent) / 2); if (tk->iconified) { /* draw task's name dark (iconified) */ set_foreground(3, tb->dd); XDrawString(tb->dd, tb->win, fore_gc, text_x, text_y + 1, tk->name, len); set_foreground(4, tb->dd); } else { set_foreground(5, tb->dd); } /* draw task's name here */ XDrawString(tb->dd, tb->win, fore_gc, text_x, text_y, tk->name, len); } #ifndef HAVE_XPM if (!tk->icon) return; #endif /* draw the task's icon */ XSetClipMask(tb->dd, fore_gc, tk->mask); XSetClipOrigin(tb->dd, fore_gc, x + TEXTPAD, y + (tb->rowheight - ICONHEIGHT) / 2); XCopyArea(tb->dd, tk->icon, tb->win, fore_gc, 0, 0, ICONWIDTH, ICONHEIGHT, x + TEXTPAD, y + (tb->rowheight - ICONHEIGHT) / 2); XSetClipMask(tb->dd, fore_gc, None); } void draw_dot(Window win, int x, int y, Display * dd) { set_foreground(4, dd); XDrawPoint(dd, win, fore_gc, x, y); set_foreground(3, dd); XDrawPoint(dd, win, fore_gc, x + 1, y + 1); } void draw_grill(Window win, int x, int h, Display * dd) { int y = 0; while (y < h - 4) { y += 3; draw_dot(win, x + 3, y, dd); draw_dot(win, x, y, dd); } } void gui_draw_taskbar(taskbar * tb) { int xoffset, yoffset; int width, height; int nrows, ncols; int ntasks, ntot; /* ntot = ntasks + empty spaces */ int x, y; /* individual task properties */ task *tk; xoffset = TASKS_X; yoffset = 0; width = tb->width - xoffset; height = tb->height - yoffset; nrows = tb->height / tb->rowheight; ntasks = tb->num_tasks; ntot = ntasks + nrows - (ntasks % nrows); /* no demo ;-) */ /* Allow for full line */ if ((ntot == ntasks + nrows) && ntasks > 0) ntot = ntasks; ncols = ntot / nrows; tk = tb->task_list; for (y = 0; y < nrows; y++) { for (x = 0; x < ncols; x++) { if (ntasks > 0) { tk->pos_x = xoffset + x * width / ncols; tk->pos_y = yoffset + y * height / nrows; tk->width = width / ncols - 1; gui_draw_task(tb, tk); tk = tk->next; --ntasks; } else { /* clear the rest */ set_foreground(0, tb->dd); fill_rect(tb, xoffset + x * width / ncols, yoffset + y * height / nrows, width / ncols - 1, height / nrows); gui_draw_vline(tb, xoffset + x * width / ncols, y); } } } draw_grill(tb->win, 2, tb->height, tb->dd); } task *find_task(taskbar * tb, Window win) { task *list = tb->task_list; while (list) { if (list->win == win) return list; list = list->next; } return 0; } void del_task(taskbar * tb, Window win) { task *next, *prev = 0, *list = tb->task_list; while (list) { next = list->next; if (list->win == win) { /* unlink and free this task */ tb->num_tasks--; if (list->icon_copied) { XFreePixmap(tb->dd, list->icon); if (list->mask != None) XFreePixmap(tb->dd, list->mask); } if (list->name) XFree(list->name); free(list); if (prev == 0) tb->task_list = next; else prev->next = next; return; } prev = list; list = next; } } void taskbar_read_clientlist(taskbar * tb) { Window *win, focus_win; int num, i, rev, desk, new_desk = 0; task *list, *next; desk = find_desktop(root_win, tb->dd); if (desk != tb->my_desktop) { new_desk = 1; tb->my_desktop = desk; } XGetInputFocus(tb->dd, &focus_win, &rev); /* try unified window spec first */ win = get_prop_data(root_win, atom__NET_CLIENT_LIST, XA_WINDOW, &num, tb->dd); if (!win) { /* failed, let's try gnome */ win = get_prop_data(root_win, atom__WIN_CLIENT_LIST, XA_CARDINAL, &num, tb->dd); if (!win) return; } /* remove windows that arn't in the _WIN_CLIENT_LIST anymore */ list = tb->task_list; while (list) { list->focused = (focus_win == list->win); next = list->next; if (!new_desk) for (i = num - 1; i >= 0; i--) if (list->win == win[i]) goto dontdel; /* Argh, another goto */ del_task(tb, list->win); dontdel: list = next; } /* add any new windows */ for (i = 0; i < num; i++) { if (!find_task(tb, win[i])) add_task(tb, win[i], (win[i] == focus_win)); } XFree(win); } void move_taskbar(taskbar * tb) { int x, y; x = y = 0; if (tb->hidden) x = tb->width - TEXTPAD; if (!tb->at_top) y = scr_height - tb->height; XMoveWindow(tb->dd, tb->win, x, y); } void switch_desk(taskbar * tb, int rel) { XClientMessageEvent xev; unsigned long *data; int want = tb->my_desktop + rel; if (want < 0) return; data = get_prop_data(root_win, atom__WIN_WORKSPACE_COUNT, XA_CARDINAL, 0, tb->dd); if (data) { register unsigned long max_desks = *data; XFree(data); if (max_desks <= want) return; } xev.type = ClientMessage; xev.window = root_win; xev.message_type = atom__WIN_WORKSPACE; xev.format = 32; xev.data.l[0] = want; XSendEvent(tb->dd, root_win, False, SubstructureNotifyMask, (XEvent *) & xev); } void handle_press(taskbar * tb, int x, int y) { task *tk; /*if (y > 3 && y < tb->winheight - 3) { if (x >= right_arrow_x && x < right_arrow_x + 9) { switch_desk (tb, +1); return; } if (x >= left_arrow_x && x < left_arrow_x + 9) { switch_desk (tb, -1); return; } } */ /* clicked left grill -- let's implement something good someday. */ /*if (x < 6) { if (tb->hidden) tb->hidden = 0; else tb->at_top = !tb->at_top; move_taskbar (tb); return; } */ /* clicked right grill */ /*if (x + TEXTPAD > tb->winwidth) { tb->hidden = !tb->hidden; move_taskbar (tb); return; } */ tk = tb->task_list; while (tk) { if (x > tk->pos_x && x < tk->pos_x + tk->width && y > tk->pos_y && y < tk->pos_y + tb->rowheight) { if (tk->iconified) { tk->iconified = 0; tk->focused = 1; XMapWindow(tb->dd, tk->win); } else { if (tk->focused) { tk->iconified = 1; tk->focused = 0; XIconifyWindow(tb->dd, tk->win, scr_screen); } else { tk->focused = 1; XRaiseWindow(tb->dd, tk->win); XSetInputFocus(tb->dd, tk->win, RevertToNone, CurrentTime); } } gui_sync(tb->dd); gui_draw_task(tb, tk); } else { if (tk->focused) { tk->focused = 0; gui_draw_task(tb, tk); } } tk = tk->next; } } void handle_focusin(taskbar * tb, Window win) { task *tk; tk = tb->task_list; while (tk) { if (tk->focused) { if (tk->win != win) { tk->focused = 0; gui_draw_task(tb, tk); } } else { if (tk->win == win) { tk->focused = 1; gui_draw_task(tb, tk); } } tk = tk->next; } } void handle_propertynotify(taskbar * tb, Window win, Atom at) { task *tk; if (win == root_win) { if (at == atom__NET_CLIENT_LIST || at == atom__WIN_CLIENT_LIST || at == atom__WIN_WORKSPACE) { taskbar_read_clientlist(tb); gui_draw_taskbar(tb); } return; } tk = find_task(tb, win); if (!tk) return; if (at == XA_WM_NAME) { /* window's title changed */ if (tk->name) XFree(tk->name); tk->name = get_prop_data(tk->win, XA_WM_NAME, XA_STRING, 0, tb->dd); gui_draw_task(tb, tk); } else if (at == atom_WM_STATE) { /* iconified state changed? */ if (is_iconified(tk->win, tb->dd) != tk->iconified) { tk->iconified = !tk->iconified; gui_draw_task(tb, tk); } } else if (at == XA_WM_HINTS) { /* some windows set their WM_HINTS icon after mapping */ if (tk->icon == generic_icon) { get_task_hinticon(tk, tb->dd); gui_draw_task(tb, tk); } } } void handle_error(Display * d, XErrorEvent * ev) { fprintf(stderr, "Unhandled error : %i\n", ev->error_code); } void badargs() { fprintf(stderr, "Unrecognised argument. Please look at man page.\n"); } /* Limitation : pattern should be 3 chars long eg : -n= */ int checkarg(arg, pattern) char *arg; char *pattern; { char matchme[6]; int n; if (!strncmp(arg, pattern, 3)) { sprintf(matchme, "%s%%i", pattern); /* eg: -n=%i */ if (sscanf(arg, matchme, &n) > 0) { /* printf("got %s = %i\n",pattern,n); */ } else { badargs(); return 0; } } else { return 0; } return n; } int manage_args(argc, argv, arg) int argc; char *argv[]; args *arg; { int i; int n = 0; arg->winheight = 48; arg->winwidth = 500; arg->nrows = 2; arg->rowheight = 24; /* keep this ? */ arg->wintop = 0; for (i = 1; i < argc; i++) { if (n = checkarg(argv[i], "-n=")) arg->nrows = n; else if (n = checkarg(argv[i], "-h=")) arg->winheight = n; else if (n = checkarg(argv[i], "-w=")) arg->winwidth = n; else if (n = checkarg(argv[i], "-y=")) arg->wintop = n; else badargs(); } arg->rowheight = (arg->winheight / arg->nrows); return 0; } int main(int argc, char *argv[]) { args arguments; taskbar *tb = (taskbar *) malloc(sizeof(taskbar)); XEvent ev; if (manage_args(argc, argv, &arguments) != 0) { printf("Error w/args\n"); return 1; } tb->dd = XOpenDisplay(NULL); if (!tb->dd) return 0; /* FIXME bleeh, still global vars */ scr_screen = DefaultScreen(tb->dd); scr_depth = DefaultDepth(tb->dd, scr_screen); scr_height = DisplayHeight(tb->dd, scr_screen); scr_width = DisplayWidth(tb->dd, scr_screen); root_win = RootWindow(tb->dd, scr_screen); /* helps us catch windows closing/opening */ XSelectInput(tb->dd, root_win, PropertyChangeMask); XSetErrorHandler((XErrorHandler) handle_error); XInternAtoms(tb->dd, atom_names, ATOM_COUNT, False, atoms); gui_init(tb->dd); tb = gui_create_taskbar(arguments, tb->dd); gui_sync(tb->dd); while (1) { XNextEvent(tb->dd, &ev); switch (ev.type) { case ButtonPress: if (ev.xbutton.button == 1) handle_press(tb, ev.xbutton.x, ev.xbutton.y); break; case DestroyNotify: del_task(tb, ev.xdestroywindow.window); /* fall through */ break; /* added with no understand. */ case Expose: gui_draw_taskbar(tb); break; case PropertyNotify: handle_propertynotify(tb, ev.xproperty.window, ev.xproperty.atom); break; case FocusIn: handle_focusin(tb, ev.xfocus.window); break; /*default: printf ("unknown evt type: %d\n", ev.type); */ } } /* XCloseDisplay (dd); FIXME : get reference to pointer to exit gfully, get here.*/ return 0; } ltpanel-0.2/COPYING0000644000175000001440000004307610237151565014673 0ustar nicolasusers00000000000000 GNU GENERAL PUBLIC LICENSE Version 2, June 1991 Copyright (C) 1989, 1991 Free Software Foundation, Inc. 675 Mass Ave, Cambridge, MA 02139, USA Everyone is permitted to copy and distribute verbatim copies of this license document, but changing it is not allowed. Preamble The licenses for most software are designed to take away your freedom to share and change it. By contrast, the GNU General Public License is intended to guarantee your freedom to share and change free software--to make sure the software is free for all its users. This General Public License applies to most of the Free Software Foundation's software and to any other program whose authors commit to using it. (Some other Free Software Foundation software is covered by the GNU Library General Public License instead.) You can apply it to your programs, too. When we speak of free software, we are referring to freedom, not price. Our General Public Licenses are designed to make sure that you have the freedom to distribute copies of free software (and charge for this service if you wish), that you receive source code or can get it if you want it, that you can change the software or use pieces of it in new free programs; and that you know you can do these things. To protect your rights, we need to make restrictions that forbid anyone to deny you these rights or to ask you to surrender the rights. These restrictions translate to certain responsibilities for you if you distribute copies of the software, or if you modify it. For example, if you distribute copies of such a program, whether gratis or for a fee, you must give the recipients all the rights that you have. You must make sure that they, too, receive or can get the source code. And you must show them these terms so they know their rights. We protect your rights with two steps: (1) copyright the software, and (2) offer you this license which gives you legal permission to copy, distribute and/or modify the software. Also, for each author's protection and ours, we want to make certain that everyone understands that there is no warranty for this free software. If the software is modified by someone else and passed on, we want its recipients to know that what they have is not the original, so that any problems introduced by others will not reflect on the original authors' reputations. Finally, any free program is threatened constantly by software patents. We wish to avoid the danger that redistributors of a free program will individually obtain patent licenses, in effect making the program proprietary. To prevent this, we have made it clear that any patent must be licensed for everyone's free use or not licensed at all. The precise terms and conditions for copying, distribution and modification follow. GNU GENERAL PUBLIC LICENSE TERMS AND CONDITIONS FOR COPYING, DISTRIBUTION AND MODIFICATION 0. This License applies to any program or other work which contains a notice placed by the copyright holder saying it may be distributed under the terms of this General Public License. The "Program", below, refers to any such program or work, and a "work based on the Program" means either the Program or any derivative work under copyright law: that is to say, a work containing the Program or a portion of it, either verbatim or with modifications and/or translated into another language. (Hereinafter, translation is included without limitation in the term "modification".) Each licensee is addressed as "you". Activities other than copying, distribution and modification are not covered by this License; they are outside its scope. The act of running the Program is not restricted, and the output from the Program is covered only if its contents constitute a work based on the Program (independent of having been made by running the Program). Whether that is true depends on what the Program does. 1. You may copy and distribute verbatim copies of the Program's source code as you receive it, in any medium, provided that you conspicuously and appropriately publish on each copy an appropriate copyright notice and disclaimer of warranty; keep intact all the notices that refer to this License and to the absence of any warranty; and give any other recipients of the Program a copy of this License along with the Program. You may charge a fee for the physical act of transferring a copy, and you may at your option offer warranty protection in exchange for a fee. 2. You may modify your copy or copies of the Program or any portion of it, thus forming a work based on the Program, and copy and distribute such modifications or work under the terms of Section 1 above, provided that you also meet all of these conditions: a) You must cause the modified files to carry prominent notices stating that you changed the files and the date of any change. b) You must cause any work that you distribute or publish, that in whole or in part contains or is derived from the Program or any part thereof, to be licensed as a whole at no charge to all third parties under the terms of this License. c) If the modified program normally reads commands interactively when run, you must cause it, when started running for such interactive use in the most ordinary way, to print or display an announcement including an appropriate copyright notice and a notice that there is no warranty (or else, saying that you provide a warranty) and that users may redistribute the program under these conditions, and telling the user how to view a copy of this License. (Exception: if the Program itself is interactive but does not normally print such an announcement, your work based on the Program is not required to print an announcement.) These requirements apply to the modified work as a whole. If identifiable sections of that work are not derived from the Program, and can be reasonably considered independent and separate works in themselves, then this License, and its terms, do not apply to those sections when you distribute them as separate works. But when you distribute the same sections as part of a whole which is a work based on the Program, the distribution of the whole must be on the terms of this License, whose permissions for other licensees extend to the entire whole, and thus to each and every part regardless of who wrote it. Thus, it is not the intent of this section to claim rights or contest your rights to work written entirely by you; rather, the intent is to exercise the right to control the distribution of derivative or collective works based on the Program. In addition, mere aggregation of another work not based on the Program with the Program (or with a work based on the Program) on a volume of a storage or distribution medium does not bring the other work under the scope of this License. 3. You may copy and distribute the Program (or a work based on it, under Section 2) in object code or executable form under the terms of Sections 1 and 2 above provided that you also do one of the following: a) Accompany it with the complete corresponding machine-readable source code, which must be distributed under the terms of Sections 1 and 2 above on a medium customarily used for software interchange; or, b) Accompany it with a written offer, valid for at least three years, to give any third party, for a charge no more than your cost of physically performing source distribution, a complete machine-readable copy of the corresponding source code, to be distributed under the terms of Sections 1 and 2 above on a medium customarily used for software interchange; or, c) Accompany it with the information you received as to the offer to distribute corresponding source code. (This alternative is allowed only for noncommercial distribution and only if you received the program in object code or executable form with such an offer, in accord with Subsection b above.) The source code for a work means the preferred form of the work for making modifications to it. For an executable work, complete source code means all the source code for all modules it contains, plus any associated interface definition files, plus the scripts used to control compilation and installation of the executable. However, as a special exception, the source code distributed need not include anything that is normally distributed (in either source or binary form) with the major components (compiler, kernel, and so on) of the operating system on which the executable runs, unless that component itself accompanies the executable. If distribution of executable or object code is made by offering access to copy from a designated place, then offering equivalent access to copy the source code from the same place counts as distribution of the source code, even though third parties are not compelled to copy the source along with the object code. 4. You may not copy, modify, sublicense, or distribute the Program except as expressly provided under this License. Any attempt otherwise to copy, modify, sublicense or distribute the Program is void, and will automatically terminate your rights under this License. However, parties who have received copies, or rights, from you under this License will not have their licenses terminated so long as such parties remain in full compliance. 5. You are not required to accept this License, since you have not signed it. However, nothing else grants you permission to modify or distribute the Program or its derivative works. These actions are prohibited by law if you do not accept this License. Therefore, by modifying or distributing the Program (or any work based on the Program), you indicate your acceptance of this License to do so, and all its terms and conditions for copying, distributing or modifying the Program or works based on it. 6. Each time you redistribute the Program (or any work based on the Program), the recipient automatically receives a license from the original licensor to copy, distribute or modify the Program subject to these terms and conditions. You may not impose any further restrictions on the recipients' exercise of the rights granted herein. You are not responsible for enforcing compliance by third parties to this License. 7. If, as a consequence of a court judgment or allegation of patent infringement or for any other reason (not limited to patent issues), conditions are imposed on you (whether by court order, agreement or otherwise) that contradict the conditions of this License, they do not excuse you from the conditions of this License. If you cannot distribute so as to satisfy simultaneously your obligations under this License and any other pertinent obligations, then as a consequence you may not distribute the Program at all. For example, if a patent license would not permit royalty-free redistribution of the Program by all those who receive copies directly or indirectly through you, then the only way you could satisfy both it and this License would be to refrain entirely from distribution of the Program. If any portion of this section is held invalid or unenforceable under any particular circumstance, the balance of the section is intended to apply and the section as a whole is intended to apply in other circumstances. It is not the purpose of this section to induce you to infringe any patents or other property right claims or to contest validity of any such claims; this section has the sole purpose of protecting the integrity of the free software distribution system, which is implemented by public license practices. Many people have made generous contributions to the wide range of software distributed through that system in reliance on consistent application of that system; it is up to the author/donor to decide if he or she is willing to distribute software through any other system and a licensee cannot impose that choice. This section is intended to make thoroughly clear what is believed to be a consequence of the rest of this License. 8. If the distribution and/or use of the Program is restricted in certain countries either by patents or by copyrighted interfaces, the original copyright holder who places the Program under this License may add an explicit geographical distribution limitation excluding those countries, so that distribution is permitted only in or among countries not thus excluded. In such case, this License incorporates the limitation as if written in the body of this License. 9. The Free Software Foundation may publish revised and/or new versions of the General Public License from time to time. Such new versions will be similar in spirit to the present version, but may differ in detail to address new problems or concerns. Each version is given a distinguishing version number. If the Program specifies a version number of this License which applies to it and "any later version", you have the option of following the terms and conditions either of that version or of any later version published by the Free Software Foundation. If the Program does not specify a version number of this License, you may choose any version ever published by the Free Software Foundation. 10. If you wish to incorporate parts of the Program into other free programs whose distribution conditions are different, write to the author to ask for permission. For software which is copyrighted by the Free Software Foundation, write to the Free Software Foundation; we sometimes make exceptions for this. Our decision will be guided by the two goals of preserving the free status of all derivatives of our free software and of promoting the sharing and reuse of software generally. NO WARRANTY 11. BECAUSE THE PROGRAM IS LICENSED FREE OF CHARGE, THERE IS NO WARRANTY FOR THE PROGRAM, TO THE EXTENT PERMITTED BY APPLICABLE LAW. EXCEPT WHEN OTHERWISE STATED IN WRITING THE COPYRIGHT HOLDERS AND/OR OTHER PARTIES PROVIDE THE PROGRAM "AS IS" WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. THE ENTIRE RISK AS TO THE QUALITY AND PERFORMANCE OF THE PROGRAM IS WITH YOU. SHOULD THE PROGRAM PROVE DEFECTIVE, YOU ASSUME THE COST OF ALL NECESSARY SERVICING, REPAIR OR CORRECTION. 12. IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN WRITING WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MAY MODIFY AND/OR REDISTRIBUTE THE PROGRAM AS PERMITTED ABOVE, BE LIABLE TO YOU FOR DAMAGES, INCLUDING ANY GENERAL, SPECIAL, INCIDENTAL OR CONSEQUENTIAL DAMAGES ARISING OUT OF THE USE OR INABILITY TO USE THE PROGRAM (INCLUDING BUT NOT LIMITED TO LOSS OF DATA OR DATA BEING RENDERED INACCURATE OR LOSSES SUSTAINED BY YOU OR THIRD PARTIES OR A FAILURE OF THE PROGRAM TO OPERATE WITH ANY OTHER PROGRAMS), EVEN IF SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH DAMAGES. END OF TERMS AND CONDITIONS Appendix: How to Apply These Terms to Your New Programs If you develop a new program, and you want it to be of the greatest possible use to the public, the best way to achieve this is to make it free software which everyone can redistribute and change under these terms. To do so, attach the following notices to the program. It is safest to attach them to the start of each source file to most effectively convey the exclusion of warranty; and each file should have at least the "copyright" line and a pointer to where the full notice is found. Copyright (C) 19yy 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. Also add information on how to contact you by electronic and paper mail. If the program is interactive, make it output a short notice like this when it starts in an interactive mode: Gnomovision version 69, Copyright (C) 19yy name of author Gnomovision comes with ABSOLUTELY NO WARRANTY; for details type `show w'. This is free software, and you are welcome to redistribute it under certain conditions; type `show c' for details. The hypothetical commands `show w' and `show c' should show the appropriate parts of the General Public License. Of course, the commands you use may be called something other than `show w' and `show c'; they could even be mouse-clicks or menu items--whatever suits your program. You should also get your employer (if you work as a programmer) or your school, if any, to sign a "copyright disclaimer" for the program, if necessary. Here is a sample; alter the names: Yoyodyne, Inc., hereby disclaims all copyright interest in the program `Gnomovision' (which makes passes at compilers) written by James Hacker. , 1 April 1989 Ty Coon, President of Vice This General Public License does not permit incorporating your program into proprietary programs. If your program is a subroutine library, you may consider it more useful to permit linking proprietary applications with the library. If this is what you want to do, use the GNU Library General Public License instead of this License. ltpanel-0.2/COPYING.fspanel0000644000175000001440000000202310237151565016305 0ustar nicolasusers00000000000000Copyright (C) 2000 Peter Zelezny Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Soft- ware"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following condi- tions: The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software. THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABIL- ITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. ltpanel-0.2/doc/0000755000175000001440000000000010237151565014373 5ustar nicolasusers00000000000000ltpanel-0.2/doc/lpanel.10000644000175000001440000000136710237151565015737 0ustar nicolasusers00000000000000.\" DO NOT MODIFY THIS FILE! It was generated by help2man 1.012. .TH LPANEL "1" "26/11/2003" "" "" .SH NAME lpanel \- shows a tasklist in X until killed. .SH SYNOPSIS .B lpanel [\fB\-w\fr=\fIwidth\fR] [\fB\-h\fr=\fIheight\fR] [\fB\-n\fr=\fInrows\fR] [\fB\-y\fr=\fIycoord\fR] .SH DESCRIPTION .PP .\" Add any additional description here .PP Displays a tasklist. .TP \fB\-h\fR display this help and exit .TP \fB\-v\fR output version information and exit .SH "REPORTING BUGS" Report bugs to . .SH COPYRIGHT Copyright \(co 2003 Nicolas Even. .br Copyright \(co 2000-2001 Peter Zelzny. .br This is free software; see the source for copying conditions. There is NO warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. ltpanel-0.2/fspanel.c.org0000644000175000001440000004754010237151565016222 0ustar nicolasusers00000000000000 /******************************************************** ** F***ing Small Panel 0.7 Copyright (c) 2000-2001 By ** ** Peter Zelezny ** ** See file COPYING for license details. ** ********************************************************/ #include #include #include #include #include #include #include #include #include #ifdef HAVE_XPM #include #include "icon.xpm" #endif #include "fspanel.h" /* you can edit these */ #define MAX_TASK_WIDTH 145 #define ICONWIDTH 16 #define ICONHEIGHT 16 #define WINHEIGHT 24 #define WINWIDTH (scr_width) #define FONT_NAME "-*-lucida*-m*-r-*-*-12-*-*" /* don't edit these */ #define TEXTPAD 6 #define left_arrow_x 25 #define right_arrow_x 50 Display *dd; Window root_win; Pixmap generic_icon; Pixmap generic_mask; GC fore_gc; XFontStruct *xfs; int scr_screen; int scr_depth; int scr_width; int scr_height; int text_y; /*int time_width;*/ unsigned short cols[] = { 0xd75c, 0xd75c, 0xd75c, /* 0. light gray */ 0xbefb, 0xbaea, 0xbefb, /* 1. mid gray */ 0xaefb, 0xaaea, 0xaefb, /* 2. dark gray */ 0xefbe, 0xefbe, 0xefbe, /* 3. white */ 0x8617, 0x8207, 0x8617, /* 4. darkest gray */ 0x0000, 0x0000, 0x0000 /* 5. black */ }; #define PALETTE_COUNT (sizeof (cols) / sizeof (cols[0]) / 3) unsigned long palette[PALETTE_COUNT]; char *atom_names[] = { "KWM_WIN_ICON", "_MOTIF_WM_HINTS", "_WIN_WORKSPACE", "_WIN_HINTS", "_WIN_LAYER", "_NET_CLIENT_LIST", "_WIN_CLIENT_LIST", "_WIN_WORKSPACE_COUNT", "_WIN_STATE", "WM_STATE" }; #define ATOM_COUNT (sizeof (atom_names) / sizeof (atom_names[0])) Atom atoms[ATOM_COUNT]; #define atom_KWM_WIN_ICON atoms[0] #define atom__MOTIF_WM_HINTS atoms[1] #define atom__WIN_WORKSPACE atoms[2] #define atom__WIN_HINTS atoms[3] #define atom__WIN_LAYER atoms[4] #define atom__NET_CLIENT_LIST atoms[5] #define atom__WIN_CLIENT_LIST atoms[6] #define atom__WIN_WORKSPACE_COUNT atoms[7] #define atom__WIN_STATE atoms[8] #define atom_WM_STATE atoms[9] void * get_prop_data (Window win, Atom prop, Atom type, int *items) { Atom type_ret; int format_ret; unsigned long items_ret; unsigned long after_ret; unsigned char *prop_data; prop_data = 0; XGetWindowProperty (dd, win, prop, 0, 0x7fffffff, False, type, &type_ret, &format_ret, &items_ret, &after_ret, &prop_data); if (items) *items = items_ret; return prop_data; } void set_foreground (int index) { XSetForeground (dd, fore_gc, palette[index]); } void draw_line (taskbar *tb, int x, int y, int a, int b) { XDrawLine (dd, tb->win, fore_gc, x, y, a, b); } void fill_rect (taskbar *tb, int x, int y, int a, int b) { XFillRectangle (dd, tb->win, fore_gc, x, y, a, b); } void scale_icon (task *tk) { int xx, yy, x, y, w, h, d, bw; Pixmap pix, mk = None; XGCValues gcv; GC mgc; XGetGeometry (dd, tk->icon, &pix, &x, &y, &w, &h, &bw, &d); pix = XCreatePixmap (dd, tk->win, ICONWIDTH, ICONHEIGHT, scr_depth); if (tk->mask != None) { mk = XCreatePixmap (dd, tk->win, ICONWIDTH, ICONHEIGHT, 1); gcv.subwindow_mode = IncludeInferiors; gcv.graphics_exposures = False; mgc = XCreateGC (dd, mk, GCGraphicsExposures | GCSubwindowMode, &gcv); } set_foreground (3); /* this is my simple & dirty scaling routine */ for (y = ICONHEIGHT - 1; y >= 0; y--) { yy = (y * h) / ICONHEIGHT; for (x = ICONWIDTH - 1; x >= 0; x--) { xx = (x * w) / ICONWIDTH; if (d != scr_depth) XCopyPlane (dd, tk->icon, pix, fore_gc, xx, yy, 1, 1, x, y, 1); else XCopyArea (dd, tk->icon, pix, fore_gc, xx, yy, 1, 1, x, y); if (mk != None) XCopyArea (dd, tk->mask, mk, mgc, xx, yy, 1, 1, x, y); } } if (mk != None) { XFreeGC (dd, mgc); tk->mask = mk; } tk->icon = pix; } void get_task_hinticon (task *tk) { XWMHints *hin; tk->icon = None; tk->mask = None; hin = (XWMHints *) get_prop_data (tk->win, XA_WM_HINTS, XA_WM_HINTS, 0); if (hin) { if ((hin->flags & IconPixmapHint)) { if ((hin->flags & IconMaskHint)) { tk->mask = hin->icon_mask; } tk->icon = hin->icon_pixmap; tk->icon_copied = 1; scale_icon (tk); } XFree (hin); } if (tk->icon == None) { tk->icon = generic_icon; tk->mask = generic_mask; } } void get_task_kdeicon (task *tk) { unsigned long *data; data = get_prop_data (tk->win, atom_KWM_WIN_ICON, atom_KWM_WIN_ICON, 0); if (data) { tk->icon = data[0]; tk->mask = data[1]; XFree (data); } } int find_desktop (Window win) { int desk = 0; unsigned long *data; data = get_prop_data (win, atom__WIN_WORKSPACE, XA_CARDINAL, 0); if (data) { desk = *data; XFree (data); } return desk; } int is_hidden (Window win) { unsigned long *data; int ret = 0; data = get_prop_data (win, atom__WIN_HINTS, XA_CARDINAL, 0); if (data) { if ((*data) & WIN_HINTS_SKIP_TASKBAR) ret = 1; XFree (data); } return ret; } int is_iconified (Window win) { unsigned long *data; int ret = 0; data = get_prop_data (win, atom_WM_STATE, atom_WM_STATE, 0); if (data) { if (data[0] == IconicState) ret = 1; XFree (data); } return ret; } void add_task (taskbar * tb, Window win, int focus) { task *tk, *list; /* is this window on a different desktop? */ if (tb->my_desktop != find_desktop (win) || is_hidden (win)) return; tk = calloc (1, sizeof (task)); tk->win = win; tk->focused = focus; tk->name = get_prop_data (win, XA_WM_NAME, XA_STRING, 0); tk->iconified = is_iconified (win); get_task_kdeicon (tk); if (tk->icon == None) get_task_hinticon (tk); XSelectInput (dd, win, PropertyChangeMask | FocusChangeMask | StructureNotifyMask); /* now append it to our linked list */ tb->num_tasks++; list = tb->task_list; if (!list) { tb->task_list = tk; return; } while (1) { if (!list->next) { list->next = tk; return; } list = list->next; } } void gui_sync (void) { XSync (dd, False); } void set_prop (Window win, Atom at, long val) { XChangeProperty (dd, win, at, XA_CARDINAL, 32, PropModeReplace, (unsigned char *) &val, 1); } taskbar * gui_create_taskbar (void) { taskbar *tb; Window win; MWMHints mwm; XSizeHints size_hints; XWMHints wmhints; XSetWindowAttributes att; att.background_pixel = palette[0]; att.event_mask = ButtonPressMask | ExposureMask; win = XCreateWindow ( /* display */ dd, /* parent */ root_win, /* x */ 0, /* y */ scr_height - WINHEIGHT, /* width */ WINWIDTH, /* height */ WINHEIGHT, /* border */ 0, /* depth */ CopyFromParent, /* class */ InputOutput, /* visual */ CopyFromParent, /*value mask*/ CWBackPixel | CWEventMask, /* attribs */ &att); /* don't let any windows cover fspanel */ set_prop (win, atom__WIN_LAYER, 10); /* WIN_LAYER_ABOVE_DOCK */ set_prop (win, atom__WIN_STATE, WIN_STATE_STICKY | WIN_STATE_FIXED_POSITION); set_prop (win, atom__WIN_HINTS, WIN_HINTS_SKIP_FOCUS | WIN_HINTS_SKIP_WINLIST | WIN_HINTS_SKIP_TASKBAR | WIN_HINTS_DO_NOT_COVER); /* borderless motif hint */ memset (&mwm, 0, sizeof (mwm)); mwm.flags = MWM_HINTS_DECORATIONS; XChangeProperty (dd, win, atom__MOTIF_WM_HINTS, atom__MOTIF_WM_HINTS, 32, PropModeReplace, (unsigned char *) &mwm, sizeof (MWMHints) / 4); /* make sure the WM obays our window position */ size_hints.flags = PPosition; /*XSetWMNormalHints (dd, win, &size_hints);*/ XChangeProperty (dd, win, XA_WM_NORMAL_HINTS, XA_WM_SIZE_HINTS, 32, PropModeReplace, (unsigned char *) &size_hints, sizeof (XSizeHints) / 4); /* make our window unfocusable */ wmhints.flags = InputHint; wmhints.input = 0; /*XSetWMHints (dd, win, &wmhints);*/ XChangeProperty (dd, win, XA_WM_HINTS, XA_WM_HINTS, 32, PropModeReplace, (unsigned char *) &wmhints, sizeof (XWMHints) / 4); XMapWindow (dd, win); tb = calloc (1, sizeof (taskbar)); tb->win = win; return tb; } void gui_init (void) { XGCValues gcv; XColor xcl; int i, j; char *fontname; i = j = 0; do { xcl.red = cols[i]; i++; xcl.green = cols[i]; i++; xcl.blue = cols[i]; i++; XAllocColor (dd, DefaultColormap (dd, scr_screen), &xcl); palette[j] = xcl.pixel; j++; } while (j < PALETTE_COUNT); fontname = FONT_NAME; do { xfs = XLoadQueryFont (dd, fontname); fontname = "fixed"; } while (!xfs); /*time_width = XTextWidth (xfs, "88:88", 5); */ #define time_width (35) text_y = xfs->ascent + ((WINHEIGHT - xfs->ascent) / 2); gcv.font = xfs->fid; gcv.graphics_exposures = False; fore_gc = XCreateGC (dd, root_win, GCFont | GCGraphicsExposures, &gcv); #ifdef HAVE_XPM XpmCreatePixmapFromData (dd, root_win, icon_xpm, &generic_icon, &generic_mask, NULL); #else generic_icon = 0; #endif } void gui_draw_vline (taskbar * tb, int x) { set_foreground (4); draw_line (tb, x, 0, x, WINHEIGHT); set_foreground (3); draw_line (tb, x + 1, 0, x + 1, WINHEIGHT); } void gui_draw_task (taskbar * tb, task * tk) { int len; int x = tk->pos_x; int taskw = tk->width; if (!tk->name) return; gui_draw_vline (tb, x); /*set_foreground (3); *//* it's already 3 from gui_draw_vline() */ draw_line (tb, x + 1, 0, x + taskw, 0); set_foreground (1); draw_line (tb, x + 1, WINHEIGHT - 1, x + taskw, WINHEIGHT - 1); if (tk->focused) { x++; /*set_foreground (1);*/ /* mid gray */ fill_rect (tb, x + 3, 3, taskw - 5, WINHEIGHT - 6); set_foreground (3); /* white */ draw_line (tb, x + 2, WINHEIGHT - 2, x + taskw - 2, WINHEIGHT - 2); draw_line (tb, x + taskw - 2, 2, x + taskw - 2, WINHEIGHT - 2); set_foreground (0); draw_line (tb, x + 1, 2, x + 1, WINHEIGHT - 2); set_foreground (4); /* darkest gray */ draw_line (tb, x + 2, 2, x + taskw - 2, 2); draw_line (tb, x + 2, 2, x + 2, WINHEIGHT - 3); } else { set_foreground (0); /* mid gray */ fill_rect (tb, x + 2, 1, taskw - 1, WINHEIGHT - 2); } { register int text_x = x + TEXTPAD + TEXTPAD + ICONWIDTH; /* check how many chars can fit */ len = strlen (tk->name); while (XTextWidth (xfs, tk->name, len) >= taskw - (text_x - x) - 2 && len > 0) len--; if (tk->iconified) { /* draw task's name dark (iconified) */ set_foreground (3); XDrawString (dd, tb->win, fore_gc, text_x, text_y + 1, tk->name, len); set_foreground (4); } else { set_foreground (5); } /* draw task's name here */ XDrawString (dd, tb->win, fore_gc, text_x, text_y, tk->name, len); } #ifndef HAVE_XPM if (!tk->icon) return; #endif /* draw the task's icon */ XSetClipMask (dd, fore_gc, tk->mask); XSetClipOrigin (dd, fore_gc, x + TEXTPAD, (WINHEIGHT - ICONHEIGHT) / 2); XCopyArea (dd, tk->icon, tb->win, fore_gc, 0, 0, ICONWIDTH, ICONHEIGHT, x + TEXTPAD, (WINHEIGHT - ICONHEIGHT) / 2); XSetClipMask (dd, fore_gc, None); } void gui_draw_clock (taskbar * tb) { char *time_str; time_t now; int width, old_x, x = WINWIDTH - time_width - (TEXTPAD * 4); old_x = x; width = WINWIDTH - x - 2; now = time (0); time_str = ctime (&now) + 11; gui_draw_vline (tb, x); x += TEXTPAD; /*set_foreground (3); *//* white *//* it's already 3 from gui_draw_vline() */ draw_line (tb, x + 1, WINHEIGHT - 2, old_x + width - TEXTPAD, WINHEIGHT - 2); draw_line (tb, old_x + width - TEXTPAD, 2, old_x + width - TEXTPAD, WINHEIGHT - 2); set_foreground (1); /* mid gray */ fill_rect (tb, x + 1, 2, width - (TEXTPAD * 2) - 1, WINHEIGHT - 4); set_foreground (4); /* darkest gray */ draw_line (tb, x, 2, x + width - (TEXTPAD * 2) - 1, 2); draw_line (tb, x, 2, x, WINHEIGHT - 2); set_foreground (5); XDrawString (dd, tb->win, fore_gc, x + TEXTPAD - 1, text_y, time_str, 5); } void draw_dot (Window win, int x, int y) { set_foreground (4); XDrawPoint (dd, win, fore_gc, x, y); set_foreground (3); XDrawPoint (dd, win, fore_gc, x + 1, y + 1); } void draw_grill (Window win, int x) { int y = 0; while (y < WINHEIGHT - 4) { y += 3; draw_dot (win, x + 3, y); draw_dot (win, x, y); } } void draw_up_triangle (taskbar *tb) { fill_rect (tb, left_arrow_x + 2, (WINHEIGHT - 4) / 2 + 1, 3, 3); draw_line (tb, left_arrow_x, (WINHEIGHT - 4) / 2 + 3, left_arrow_x + 3, (WINHEIGHT - 4) / 2); draw_line (tb, left_arrow_x + 3, (WINHEIGHT - 4) / 2, left_arrow_x + 6, (WINHEIGHT - 4) / 2 + 3); draw_line (tb, left_arrow_x + 1, (WINHEIGHT - 4) / 2 + 3, left_arrow_x + 5, (WINHEIGHT - 4) / 2 + 3); } void draw_down_triangle (taskbar *tb) { draw_line (tb, right_arrow_x, (WINHEIGHT - 4) / 2, right_arrow_x + 3, (WINHEIGHT - 4) / 2 + 3); draw_line (tb, right_arrow_x, (WINHEIGHT - 4) / 2, right_arrow_x + 4, (WINHEIGHT - 4) / 2 + 2); draw_line (tb, right_arrow_x, (WINHEIGHT - 4) / 2, right_arrow_x + 5, (WINHEIGHT - 4) / 2 + 1); draw_line (tb, right_arrow_x, (WINHEIGHT - 4) / 2, right_arrow_x + 6, (WINHEIGHT - 4) / 2); } void gui_draw_taskbar (taskbar * tb) { task *tk; int x, width, taskw; int under = 0; set_foreground (5); /* black */ draw_up_triangle (tb); draw_down_triangle (tb); width = WINWIDTH - 80 - time_width - (TEXTPAD * 4); x = 80; if (tb->num_tasks == 0) goto clear; taskw = width / tb->num_tasks; if (taskw > MAX_TASK_WIDTH) { taskw = MAX_TASK_WIDTH; under = 1; } tk = tb->task_list; while (tk) { tk->pos_x = x; tk->width = taskw - 1; gui_draw_task (tb, tk); x += taskw; tk = tk->next; } if (under) { clear: gui_draw_vline (tb, x); set_foreground (0); fill_rect (tb, x + 2, 0, WINWIDTH, WINHEIGHT); } gui_draw_clock (tb); gui_draw_vline (tb, 8); gui_draw_vline (tb, 74); draw_grill (tb->win, 2); draw_grill (tb->win, WINWIDTH - 6); } task * find_task (taskbar * tb, Window win) { task *list = tb->task_list; while (list) { if (list->win == win) return list; list = list->next; } return 0; } void del_task (taskbar * tb, Window win) { task *next, *prev = 0, *list = tb->task_list; while (list) { next = list->next; if (list->win == win) { /* unlink and free this task */ tb->num_tasks--; if (list->icon_copied) { XFreePixmap (dd, list->icon); if (list->mask != None) XFreePixmap (dd, list->mask); } if (list->name) XFree (list->name); free (list); if (prev == 0) tb->task_list = next; else prev->next = next; return; } prev = list; list = next; } } void taskbar_read_clientlist (taskbar * tb) { Window *win, focus_win; int num, i, rev, desk, new_desk = 0; task *list, *next; desk = find_desktop (root_win); if (desk != tb->my_desktop) { new_desk = 1; tb->my_desktop = desk; } XGetInputFocus (dd, &focus_win, &rev); /* try unified window spec first */ win = get_prop_data (root_win, atom__NET_CLIENT_LIST, XA_WINDOW, &num); if (!win) { /* failed, let's try gnome */ win = get_prop_data (root_win, atom__WIN_CLIENT_LIST, XA_CARDINAL, &num); if (!win) return; } /* remove windows that arn't in the _WIN_CLIENT_LIST anymore */ list = tb->task_list; while (list) { list->focused = (focus_win == list->win); next = list->next; if (!new_desk) for (i = num - 1; i >= 0; i--) if (list->win == win[i]) goto dontdel; del_task (tb, list->win); dontdel: list = next; } /* add any new windows */ for (i = 0; i < num; i++) { if (!find_task (tb, win[i])) add_task (tb, win[i], (win[i] == focus_win)); } XFree (win); } void move_taskbar (taskbar * tb) { int x, y; x = y = 0; if (tb->hidden) x = WINWIDTH - TEXTPAD; if (!tb->at_top) y = scr_height - WINHEIGHT; XMoveWindow (dd, tb->win, x, y); } void switch_desk (taskbar * tb, int rel) { XClientMessageEvent xev; unsigned long *data; int want = tb->my_desktop + rel; if (want < 0) return; data = get_prop_data (root_win, atom__WIN_WORKSPACE_COUNT, XA_CARDINAL, 0); if (data) { register unsigned long max_desks = *data; XFree (data); if (max_desks <= want) return; } xev.type = ClientMessage; xev.window = root_win; xev.message_type = atom__WIN_WORKSPACE; xev.format = 32; xev.data.l[0] = want; XSendEvent (dd, root_win, False, SubstructureNotifyMask, (XEvent *) &xev); } void handle_press (taskbar * tb, int x, int y) { task *tk; if (y > 3 && y < WINHEIGHT - 3) { if (x >= right_arrow_x && x < right_arrow_x + 9) { switch_desk (tb, +1); return; } if (x >= left_arrow_x && x < left_arrow_x + 9) { switch_desk (tb, -1); return; } } /* clicked left grill */ if (x < 6) { if (tb->hidden) tb->hidden = 0; else tb->at_top = !tb->at_top; move_taskbar (tb); return; } /* clicked right grill */ if (x + TEXTPAD > WINWIDTH) { tb->hidden = !tb->hidden; move_taskbar (tb); return; } tk = tb->task_list; while (tk) { if (x > tk->pos_x && x < tk->pos_x + tk->width) { if (tk->iconified) { tk->iconified = 0; tk->focused = 1; XMapWindow (dd, tk->win); } else { if (tk->focused) { tk->iconified = 1; tk->focused = 0; XIconifyWindow (dd, tk->win, scr_screen); } else { tk->focused = 1; XRaiseWindow (dd, tk->win); XSetInputFocus (dd, tk->win, RevertToNone, CurrentTime); } } gui_sync (); gui_draw_task (tb, tk); } else { if (tk->focused) { tk->focused = 0; gui_draw_task (tb, tk); } } tk = tk->next; } } void handle_focusin (taskbar * tb, Window win) { task *tk; tk = tb->task_list; while (tk) { if (tk->focused) { if (tk->win != win) { tk->focused = 0; gui_draw_task (tb, tk); } } else { if (tk->win == win) { tk->focused = 1; gui_draw_task (tb, tk); } } tk = tk->next; } } void handle_propertynotify (taskbar * tb, Window win, Atom at) { task *tk; if (win == root_win) { if (at == atom__NET_CLIENT_LIST || at == atom__WIN_CLIENT_LIST || at == atom__WIN_WORKSPACE) { taskbar_read_clientlist (tb); gui_draw_taskbar (tb); } return; } tk = find_task (tb, win); if (!tk) return; if (at == XA_WM_NAME) { /* window's title changed */ if (tk->name) XFree (tk->name); tk->name = get_prop_data (tk->win, XA_WM_NAME, XA_STRING, 0); gui_draw_task (tb, tk); } else if (at == atom_WM_STATE) { /* iconified state changed? */ if (is_iconified (tk->win) != tk->iconified) { tk->iconified = !tk->iconified; gui_draw_task (tb, tk); } } else if (at == XA_WM_HINTS) { /* some windows set their WM_HINTS icon after mapping */ if (tk->icon == generic_icon) { get_task_hinticon (tk); gui_draw_task (tb, tk); } } } void handle_error (Display * d, XErrorEvent * ev) { } int #ifdef NOSTDLIB _start (void) #else main (int argc, char *argv[]) #endif { taskbar *tb; XEvent ev; fd_set fd; struct timeval tv; int xfd; time_t now; struct tm *lt; dd = XOpenDisplay (NULL); if (!dd) return 0; scr_screen = DefaultScreen (dd); scr_depth = DefaultDepth (dd, scr_screen); scr_height = DisplayHeight (dd, scr_screen); scr_width = DisplayWidth (dd, scr_screen); root_win = RootWindow (dd, scr_screen); /* helps us catch windows closing/opening */ XSelectInput (dd, root_win, PropertyChangeMask); XSetErrorHandler ((XErrorHandler) handle_error); XInternAtoms (dd, atom_names, ATOM_COUNT, False, atoms); gui_init (); tb = gui_create_taskbar (); xfd = ConnectionNumber (dd); gui_sync (); while (1) { now = time (0); lt = gmtime (&now); tv.tv_usec = 0; tv.tv_sec = 60 - lt->tm_sec; FD_ZERO (&fd); FD_SET (xfd, &fd); if (select (xfd + 1, &fd, 0, 0, &tv) == 0) gui_draw_clock (tb); while (XPending (dd)) { XNextEvent (dd, &ev); switch (ev.type) { case ButtonPress: if (ev.xbutton.button == 1) handle_press (tb, ev.xbutton.x, ev.xbutton.y); break; case DestroyNotify: del_task (tb, ev.xdestroywindow.window); /* fall through */ case Expose: gui_draw_taskbar (tb); break; case PropertyNotify: handle_propertynotify (tb, ev.xproperty.window, ev.xproperty.atom); break; case FocusIn: handle_focusin (tb, ev.xfocus.window); break; /*default: printf ("unknown evt type: %d\n", ev.type);*/ } } } /*XCloseDisplay (dd); return 0;*/ } ltpanel-0.2/HISTORY0000644000175000001440000000122010237151565014705 0ustar nicolasusers000000000000000.2 - added -y argument - removed global vars (remnants of macros), cleaned some code - split logic and drawing functions - fixed problem when no window is open. - removed other global vars, cleaned more code, split code in two files 0.1 : First lpanel version - Removed clock, desktop switch - rewritten gui_draw_taskbar - changed code to support multiple rows of tasks. - removed unneeded optimizations - Now links with stdlib (to support easily arguments) - Removed Makefiles for other platforms (painful to maintain as I only have linux, however I won't mind if you give me a comp. :p - Added command line arguments - Added man page ltpanel-0.2/icon.xpm0000644000175000001440000000114310237151565015303 0ustar nicolasusers00000000000000/* XPM */ static char * icon_xpm[] = { "16 16 16 1", " c None", ". c #323232", "+ c #535353", "@ c #4A8A8E", "# c #DEE2E2", "$ c #7E827A", "% c #8A9292", "& c #D6D6D6", "* c #36767E", "= c #9E9E9E", "- c #FAFAFA", "; c #B2B2B2", "> c #DEEEEA", ", c #464646", "' c #5EA2A2", ") c #52969A", " ", " ", " --#>>>>>>#-#-; ", " -&%')))))=&=&+ ", " >;$@*****=;%;+ ", " &$$$$$$$$$$$$, ", " &;;;;;;;;;;;;+ ", " &;;;;;;;;;;;;+ ", " #;;;;;;;;;;;;+ ", " &;;;;;;;;;;;;+ ", " #;;;;;;;;;;;;+ ", " #;;;;;;;;;;;;+ ", " &;;;;;;;;;;;;+ ", " $............. ", " ", " "}; ltpanel-0.2/README0000644000175000001440000000036510237151565014512 0ustar nicolasusers00000000000000Light Panel =========== It is a lightweight panel, looking like the gnome tasklist applet. It is based on Peter Zelzny's fspanel version 0.7. Installing ========== cd src vi Makefile make cp lpanel /usr/bin cd ../doc cp lpanel.1 /usr/man/man1 ltpanel-0.2/README.fspanel0000644000175000001440000000314310237151565016136 0ustar nicolasusers00000000000000F***ing Small Panel ~~~~~~~~~~~~~~~~~~~ What is it and what can it do? It's a panel for Linux that lists all your windows, but the difference is that it's tiny. The binary is about 10k and it takes barely any memory. It works under any gnome compliant window manager (eg. E, SawFish, WindowMaker, IceWM) and supports KDE's mini icons (the KWM_WIN_ICON atom). See http://www.chatjunkies.org/fspanel/ for more information. Changes in 0.7 ~~~~~~~~~~~~~~ * Windows that set their icons after mapping no longer get the generic icon. * A new generic icon (looks better, I think). * Fixed lockup when large amount of windows are open. * Desktop switching arrows look different. * Panel height and width are customizable at the top of fspanel.c. Made the default 24 (previously 22) and font 12. This seems to suite 1024x768 well, change to what suites you. * Now uses the unified window manager spec to find the list of windows. Falls back to gnome spec if unavailable. This might make fspanel work on KDE? Note: this is only partially supported and uses the unified spec only for a client list, everything else still uses the gnome window manager spec. * Optimized more code - i386-linux binary is now 9280 bytes! Changes in 0.6 ~~~~~~~~~~~~~~ * The clock now updates on-the-minute. * Optimized some code - binary is 300 bytes smaller :) * Made it possible to compile without libXpm. * Included some Makefiles for FreeBSD and Solaris. * No crash when display fails to open. Changes in 0.5 ~~~~~~~~~~~~~~ * Fix refresh for XFree86 4. * Fix switching desktops (works in Sawfish now too). * Make windows focus when raising. ltpanel-0.2/.swp0000644000175000001440000003000010237151565014431 0ustar nicolasusers00000000000000b0VIM 6.2)nicolasathlonU3210#"! UtpRadER[=\/ b 1 s C   } i % # X  a U   D9K@YWe&yOwmFExfs lpanel.c /^XFontStruct *xfs;$/;" vtb)$/;" ftaskbar_read_clientlist lpanel.c /^taskbar_read_clientlist (taskbar *fswitch_desk lpanel.c /^switch_desk (taskbar * tb, int rel)$/;"Display * dd)$/;" fset_prop lpanel.c /^set_prop (Window win, Atom at, long val,scr_width lpanel.c /^int scr_width;$/;" vscr_screen lpanel.c /^int scr_screen;$/;" vscr_height lpanel.c /^int scr_height;$/;" vscr_depth lpanel.c /^int scr_depth;$/;" vroot_win lpanel.c /^Window root_win;$/;" vpalette lpanel.c /^unsigned long palette[PALETTE_COUNT];$/;" vmove_taskbar lpanel.c /^move_taskbar (taskbar * tb)$/;" fmanage_args lpanel.c /^int manage_args(argc, argv, arg)$/;" fmain lpanel.c /^main (int argc, char *argv[])$/;" ffis_iconified lpanel.c /^is_iconified (Window win, Display * dd)$/;"fis_hidden lpanel.c /^is_hidden (Window win, Display * dd)$/;"Window win, Atom at)$/;" fhandle_propertynotify lpanel.c /^handle_propertynotify (taskbar * tb,y)$/;" fhandle_press lpanel.c /^handle_press (taskbar * tb, int x, intwin)$/;" fhandle_focusin lpanel.c /^handle_focusin (taskbar * tb, Windowev)$/;" fhandle_error lpanel.c /^handle_error (Display * d, XErrorEvent *gui_sync lpanel.c /^gui_sync (Display * dd)$/;" fgui_init lpanel.c /^gui_init (Display * dd)$/;" frow)$/;" fgui_draw_vline lpanel.c /^gui_draw_vline (taskbar * tb, int x,inttb)$/;" fgui_draw_taskbar lpanel.c /^void gui_draw_taskbar(taskbar *fgui_draw_task lpanel.c /^gui_draw_task (taskbar * tb, task * tk)$/;"fgui_create_taskbar lpanel.c /^gui_create_taskbar (arg, dd)$/;"* dd)$/;" fget_task_kdeicon lpanel.c /^get_task_kdeicon (task *tk, Display* dd)$/;" fget_task_hinticon lpanel.c /^get_task_hinticon (task *tk, Displaytype, int *items, Display* dd)$/;" fget_prop_data lpanel.c /^get_prop_data (Window win, Atom prop, Atomgeneric_mask lpanel.c /^Pixmap generic_mask;$/;" vgeneric_icon lpanel.c /^Pixmap generic_icon;$/;" vfore_gc lpanel.c /^GC fore_gc;$/;" vffind_task lpanel.c /^find_task (taskbar * tb, Window win)$/;"ffind_desktop lpanel.c /^find_desktop (Window win, Display * dd)$/;"Display * dd)$/;" fdraw_grill lpanel.c /^draw_grill (Window win, int x, int h,* dd)$/;" fdraw_dot lpanel.c /^draw_dot (Window win, int x, int y, Displayfdel_task lpanel.c /^del_task (taskbar * tb, Window win)$/;"cols lpanel.c /^unsigned short cols[] = {$/;" vcheckarg lpanel.c /^int checkarg(arg,pattern)$/;" fbadargs lpanel.c /^void badargs()$/;" fatoms lpanel.c /^Atom atoms[ATOM_COUNT];$/;" vatom_names lpanel.c /^char *atom_names[] = {$/;" vatom__WIN_WORKSPACE_COUNT lpanel.c 109;" d file:atom__WIN_WORKSPACE lpanel.c 104;" d file:atom__WIN_STATE lpanel.c 110;" d file:atom__WIN_LAYER lpanel.c 106;" d file:atom__WIN_HINTS lpanel.c 105;" d file:atom__WIN_CLIENT_LIST lpanel.c 108;" d file:atom__NET_CLIENT_LIST lpanel.c 107;" d file:atom__MOTIF_WM_HINTS lpanel.c 103;" d file:atom_WM_STATE lpanel.c 111;" d file:atom_KWM_WIN_ICON lpanel.c 102;" d file:focus)$/;" fadd_task lpanel.c /^add_task (taskbar * tb, Window win, intTEXTPAD lpanel.c 59;" d file:TASKS_X lpanel.c 57;" d file:PALETTE_COUNT lpanel.c 81;" d file:ICONWIDTH lpanel.c 47;" d file:ICONHEIGHT lpanel.c 48;" d file:FONT_NAME lpanel.c 55;" d file:TOM_COUNT lpanel.c 98;" d file: