mirror of
https://github.com/amiwm/amiwm.git
synced 2026-04-14 11:04:18 +00:00
[libami] add button, textbox and textinput from requestchoice/executecmd
Marcus had written up workbench style widgets inside the two external helper programs requestchoice and executecmd. This ports the code over to libami. Note that there isn't a generic gadget or collection of gadgets yet - this is purely a refactor of the code, and the upcoming commit that migrates requestchoice/executecmd over to use them just handles them directly via xlib like they have always done.
This commit is contained in:
35
libami/gadget_button.h
Normal file
35
libami/gadget_button.h
Normal file
@@ -0,0 +1,35 @@
|
||||
#ifndef __LIBAMI__GADGET_BUTTON_H__
|
||||
#define __LIBAMI__GADGET_BUTTON_H__
|
||||
|
||||
#define BOT_SPACE 4
|
||||
#define TEXT_SIDE 8
|
||||
#define BUT_SIDE 12
|
||||
#define TOP_SPACE 4
|
||||
#define INT_SPACE 7
|
||||
#define BUT_VSPACE 2
|
||||
#define BUT_HSPACE 8
|
||||
|
||||
struct gadget_button {
|
||||
Display *dpy;
|
||||
struct DrawInfo *dri;
|
||||
Window w;
|
||||
GC gc;
|
||||
int x;
|
||||
int y;
|
||||
int buth;
|
||||
int butw;
|
||||
char *txt;
|
||||
int depressed;
|
||||
};
|
||||
|
||||
extern struct gadget_button * gadget_button_init(Display *dpy,
|
||||
struct DrawInfo *dri, GC gc, Window mainwin,
|
||||
int x, int y, int butw, int buth);
|
||||
extern void gadget_button_set_text(struct gadget_button *b, const char *txt);
|
||||
extern void gadget_button_refresh(struct gadget_button *b);
|
||||
extern void gadget_button_set_depressed(struct gadget_button *b,
|
||||
int depressed);
|
||||
extern void gadget_button_toggle(struct gadget_button *b);
|
||||
extern void gadget_button_free(struct gadget_button *b);
|
||||
|
||||
#endif /* __LIBAMI__GADGET_BUTTON_H__ */
|
||||
Reference in New Issue
Block a user