Files
lcdproc/server/widget.h
T
ppokorny 00cc9fca23 + Changed protocol to 0.3 because we now accept both -foo and foo
as argument introducers.  in 0.4-pre10, these were changed
   from foo to -foo and this broke many clients.  This change
   should fix that and be backward/forward compatible.
 + Added a noop function to the protocol.  This is useful for writing
   shell script clients of LCDproc.
 + Changed the shared sock_send_string function to NOT send the
   ending NUL ('\0') byte with the string.  This was confusing
   in Perl clients which saw NUL's as the first character of
   each reply.  WARNING: The LCDPROC client depended on this
   behavior, your client may too.  Use the newline instead.
   See the code in clients/lcdproc/main.c (look for "switch(buf[i])")
   to see one way to handle this.  This should allow new clients
   to connect to old servers and vice-versa.
 + Messed with include structure in .c files.  It should no longer
   be necessary to specify ../.. to get to shared code headers.
   Also, since we are using automake, the global config.h can be
   found with just #include "config.h" as it's location is included
   in a -I to the compilers.  As a result "make distcheck" now works.
2001-05-25 03:14:27 +00:00

46 lines
1.0 KiB
C

#ifndef WIDGET_H
#define WIDGET_H
#include "screen.h"
typedef struct widget {
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...
} 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
#define WID_MAX_DIR 4
extern char *types[];
// RESERVED widget ID for keys active on a screen
#define KEYS_WIDGETID "screenkeys"
widget *widget_create ();
int widget_destroy (widget * w);
widget *widget_find (screen * s, char *id);
int widget_add (screen * s, char *id, char *type, char *in, int sock);
int widget_remove (screen * s, char *id, int sock);
#endif