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_textbox.h
Normal file
35
libami/gadget_textbox.h
Normal file
@@ -0,0 +1,35 @@
|
||||
#ifndef __LIBAMI_GADGET_TEXTBOX_H__
|
||||
#define __LIBAMI_GADGET_TEXTBOX_H__
|
||||
|
||||
// These are for the text box widget
|
||||
#define TXT_HSPACE 48
|
||||
#define TXT_TOPSPACE 4
|
||||
#define TXT_MIDSPACE 3
|
||||
#define TXT_BOTSPACE 4
|
||||
|
||||
struct gadget_textbox_line {
|
||||
struct gadget_textbox_line *next;
|
||||
const char *text;
|
||||
int l, w, h;
|
||||
};
|
||||
|
||||
struct gadget_textbox {
|
||||
Display *dpy;
|
||||
struct DrawInfo *dri;
|
||||
GC gc;
|
||||
Window w;
|
||||
int x, y;
|
||||
int width, height;
|
||||
|
||||
struct gadget_textbox_line *firstline, *lastline;
|
||||
};
|
||||
|
||||
extern struct gadget_textbox *gadget_textbox_create(Display *dpy,
|
||||
struct DrawInfo *dri, GC gc, Window mainwin, int x, int y,
|
||||
int width, int height);
|
||||
extern void gadget_textbox_free(struct gadget_textbox *g);
|
||||
extern struct gadget_textbox_line * gadget_textbox_addline(
|
||||
struct gadget_textbox *g, const char *text);
|
||||
extern void gadget_textbox_refresh(struct gadget_textbox *g);
|
||||
|
||||
#endif /* __LIBAMI_GADGET_TEXTBOX_H__ */
|
||||
Reference in New Issue
Block a user