Fix segfault setting MenuFace pixmap style for menus.
[fvwm.git] / modules / FvwmTaskBar / ButtonArray.h
blob1eda256179217acdb4a2de8f16e0586d27f2a199
1 /* -*-c-*- */
2 /* FvwmTaskBar Module for Fvwm95, based on the FvwmWinList module
4 * Copyright 1994, Mike Finger (mfinger@mermaid.micro.umn.edu or
5 * Mike_Finger@atk.com)
7 * The functions in this header file that are the original work of Mike Finger.
9 * No guarantees or warantees or anything are provided or implied in any way
10 * whatsoever. Use this program at your own risk. Permission to use this
11 * program for any purpose is given, as long as the copyright is kept intact.
14 #include "libs/PictureBase.h"
16 #define DEFAULT_BTN_WIDTH 180
18 /* Button states */
20 #define BUTTON_UP 0
21 #define BUTTON_DOWN 1
22 #define BUTTON_BRIGHT 2
24 #define DONT_CARE -1
26 /* Struct definitions */
28 typedef struct button
30 char *title;
31 int state, needsupdate, truncate, count, iconified;
32 struct button *next;
33 FvwmPicture p;
34 } Button;
36 typedef struct
38 int count;
39 Button *head, *tail;
40 int x, y;
41 int w, h, tw;
42 } ButtonArray;
44 /* Function Prototypes */
46 void Draw3dRect(
47 Window wn, int x, int y, int w, int h, XRectangle *bounding, int state,
48 Bool iconified);
49 Button *ButtonNew(const char *title, FvwmPicture *p, int state, int count);
50 int ButtonUpdate(Button *button, const char *title, int state);
51 char *ButtonName(Button *button);
52 void InitArray(ButtonArray *array, int x, int y, int w, int h, int tw);
53 void UpdateArray(ButtonArray *array, int x, int y, int w, int h, int tw);
54 void AddButton(ButtonArray *array, const char *title, FvwmPicture *p, int state,
55 int count, int iconified);
56 int UpdateButton(ButtonArray *array, int butnum, const char *title, int state);
57 int UpdateButtonPicture(ButtonArray *array, int butnum, FvwmPicture *p);
58 void RemoveButton(ButtonArray *array, int butnum);
59 Button *find_n(ButtonArray *array, int n);
60 void FreeButton(Button *ptr);
61 void FreeAllButtons(ButtonArray *array);
62 void DoButton(ButtonArray *array, Button *ptr, int x, int y, int w, int h);
63 void DrawButtonArray(ButtonArray *array, int all, XEvent *evp);
64 void RadioButton(ButtonArray *array, int butnum, int state);
65 Bool CheckRootTransparentButtons(ButtonArray *array);
66 int WhichButton(ButtonArray *array, int x, int y);
67 int LocateButton(ButtonArray *array, int xp, int yp,
68 int *xb, int *yb,
69 char **name, int *trunc);
70 void ArrangeButtonArray(ButtonArray *array);
71 void ButtonDraw(Button *button, int x, int y, int w, int h, XEvent *evp);
72 void ButtonCoordinates(ButtonArray *array, int numbut, int *xc, int *yc);
73 void ButtonDimensions(ButtonArray *array, int *width, int *height);