Files
lcdproc/server/widget.h
T

71 lines
1.7 KiB
C
Raw Normal View History

/*
* widget.h
* This file is part of LCDd, the lcdproc server.
*
* This file is released under the GNU General Public License. Refer to the
* COPYING file distributed with this package.
*
* Copyright (c) 1999, William Ferrell, Scott Scriven
*
*/
2002-06-29 16:37:18 +00:00
#include "screen.h"
/* These headers are placed here on purpose ! (circular references) */
1999-12-09 23:15:14 +00:00
#ifndef WIDGET_H
#define WIDGET_H
struct Widget;
1999-12-09 23:15:14 +00:00
2001-12-30 00:15:25 +00:00
/* These correspond to the index into the "types" array...*/
typedef enum WidgetType {
WID_NONE = 0,
WID_STRING,
WID_HBAR,
WID_VBAR,
WID_ICON,
WID_TITLE,
WID_SCROLLER,
WID_FRAME,
WID_NUM
} WidgetType;
typedef struct Widget {
char *id;
WidgetType type;
2007-04-02 21:29:53 +00:00
Screen *screen; /* What screen is this widget in ? */
int x, y; /* Position */
int width, height; /* Visible size */
int left, top, right, bottom; /* bounding rectangle */
int length; /* size or direction */
int speed; /* For scroller... */
char *text; /* text or binary data */
2007-04-02 21:29:53 +00:00
struct Screen *frame_screen; /* frame widget get an associated screen */
//LinkedList *kids; /* Frames can contain more widgets...*/
} Widget;
1999-12-09 23:15:14 +00:00
#define WID_MAX_DIR 4
/* Create new widget */
2007-04-02 21:29:53 +00:00
Widget *widget_create(char *id, WidgetType type, Screen *screen);
1999-12-09 23:15:14 +00:00
/* Destroy a widget */
2007-04-02 21:29:53 +00:00
int widget_destroy(Widget *w);
1999-12-09 23:15:14 +00:00
/* Convert a widget typename to a widget type */
2007-04-02 21:29:53 +00:00
WidgetType widget_typename_to_type(char *typename);
1999-12-09 23:15:14 +00:00
/* Convert a widget typename to a widget type */
2007-04-02 21:29:53 +00:00
char *widget_type_to_typename(WidgetType t);
/* Search subwidgets of a widget */
2007-04-02 21:29:53 +00:00
Widget *widget_search_subs(Widget *w, char *id);
1999-12-09 23:15:14 +00:00
/* Convert icon number to icon name */
2007-04-02 21:29:53 +00:00
char *widget_icon_to_iconname(int icon);
/* Convert iconname to icon number */
2007-04-02 21:29:53 +00:00
int widget_iconname_to_icon(char *iconname);
1999-12-09 23:15:14 +00:00
#endif