1999-12-09 23:15:14 +00:00
|
|
|
#ifndef WIDGET_H
|
|
|
|
|
#define WIDGET_H
|
|
|
|
|
|
|
|
|
|
#include "screen.h"
|
|
|
|
|
|
2000-03-30 20:20:41 +00:00
|
|
|
typedef struct widget {
|
2000-04-03 22:13:57 +00:00
|
|
|
char *id;
|
|
|
|
|
int type;
|
|
|
|
|
// some sort of data here...
|
|
|
|
|
int x, y; // Position
|
|
|
|
|
int wid, hgt; // Size
|
|
|
|
|
int left, top, right, bottom; // bounding rectangle
|
|
|
|
|
int length; // size or direction
|
|
|
|
|
int speed; // For scroller...
|
|
|
|
|
char *text; // text or binary data
|
|
|
|
|
LL *kids; // Frames can contain more widgets...
|
1999-12-09 23:15:14 +00:00
|
|
|
} widget;
|
|
|
|
|
|
|
|
|
|
// These correspond to the index into the "types" array...
|
|
|
|
|
#define WID_NONE 0
|
|
|
|
|
#define WID_STRING 1
|
|
|
|
|
#define WID_HBAR 2
|
|
|
|
|
#define WID_VBAR 3
|
|
|
|
|
#define WID_ICON 4
|
|
|
|
|
#define WID_TITLE 5
|
|
|
|
|
#define WID_SCROLLER 6
|
|
|
|
|
#define WID_FRAME 7
|
|
|
|
|
#define WID_NUM 8
|
2001-04-27 02:20:38 +00:00
|
|
|
#define WID_KEYS 9
|
1999-12-09 23:15:14 +00:00
|
|
|
|
|
|
|
|
#define WID_MAX_DIR 4
|
|
|
|
|
|
|
|
|
|
extern char *types[];
|
|
|
|
|
|
2001-04-27 02:20:38 +00:00
|
|
|
// RESERVED widget ID for keys active on a screen
|
|
|
|
|
#define KEYS_WIDGETID "screenkeys"
|
|
|
|
|
|
2000-03-30 20:20:41 +00:00
|
|
|
widget *widget_create ();
|
|
|
|
|
int widget_destroy (widget * w);
|
1999-12-09 23:15:14 +00:00
|
|
|
|
2000-03-30 20:20:41 +00:00
|
|
|
widget *widget_find (screen * s, char *id);
|
1999-12-09 23:15:14 +00:00
|
|
|
|
2000-03-30 20:20:41 +00:00
|
|
|
int widget_add (screen * s, char *id, char *type, char *in, int sock);
|
|
|
|
|
int widget_remove (screen * s, char *id, int sock);
|
1999-12-09 23:15:14 +00:00
|
|
|
|
|
|
|
|
#endif
|