Propagate Layer changes via Style command on-the-fly.
[fvwm.git] / modules / FvwmWinList / ButtonArray.h
blobfaab1fe794d8dc4673c77e6cdbc1e9a20639f7da
1 /* -*-c-*- */
2 /* FvwmWinList Module for Fvwm.
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.
13 * Things to do: use graphics contexts from fvwm
16 #include "libs/Picture.h"
18 #define MAX_COLOUR_SETS 4
20 /* Struct definitions */
21 typedef struct button
23 char *title;
24 char *truncate_title;
25 int up, needsupdate, tw, set, truncatewidth;
26 struct button *next;
27 FvwmPicture p;
28 int reliefwidth;
29 long desk;
30 Bool is_sticky;
31 Bool skip;
32 Bool is_iconified;
33 } Button;
35 typedef struct
37 int count;
38 Button *head,*tail;
39 int x,y,w,h,rw;
40 } ButtonArray;
42 /* Function Prototypes */
43 extern Button *ButtonNew(char *title, FvwmPicture *p, int up);
44 extern void InitArray(ButtonArray *array,int x,int y,int w,int h,int rw);
45 extern void UpdateArray(ButtonArray *array,int w);
46 extern int AddButton(ButtonArray *array, char *title, FvwmPicture *p,int up);
47 extern int UpdateButton(ButtonArray *array, int butnum, char *title, int up);
48 extern void UpdateButtonIconified(
49 ButtonArray *array, int butnum, int iconified);
50 extern void RadioButton(ButtonArray *array, int butnum, int butnumpressed);
51 extern void ReorderButtons(ButtonArray *array, int butnum, int FlipFocus);
52 extern int UpdateButtonDeskFlags(ButtonArray *array, int butnum, long desk,
53 int is_sticky, int skip);
54 extern int UpdateButtonPicture(ButtonArray *array, int butnum, FvwmPicture *p);
55 extern int UpdateButtonSet(ButtonArray *array, int butnum, int set);
56 extern void RemoveButton(ButtonArray *array, int butnum);
57 extern Button *find_n(ButtonArray *array, int n);
58 extern void FreeButton(Button *ptr);
59 extern void FreeAllButtons(ButtonArray *array);
60 extern void DoButton(
61 Button *ptr, int x, int y, int w, int h, Bool clear_bg, XEvent *evp);
62 extern void DrawButtonArray(
63 ButtonArray *array, Bool all, Bool clear_bg, XEvent *evp);
64 void DirtyButtonArray(ButtonArray *barray);
65 extern void DrawTransparentButtonArray(ButtonArray *barray);
66 extern void SwitchButton(ButtonArray *array,int butnum);
67 extern int WhichButton(ButtonArray *array,int x, int y);
68 extern char *ButtonName(ButtonArray *array, int butnum);
69 extern void PrintButtons(ButtonArray *array);
70 extern FvwmPicture *ButtonPicture(ButtonArray *array, int butnum);
71 extern int IsButtonVisible(Button *btn);
72 extern int IsButtonIndexVisible(ButtonArray *array, int butnum);