Files
lcdproc/server/widget.h
T

74 lines
1.8 KiB
C
Raw Normal View History

2008-11-30 22:31:20 +00:00
/** \file server/widget.h
* Public interface to the widget methods.
2008-11-30 22:31:20 +00:00
*/
/* This file is part of LCDd, the lcdproc server.
*
2008-11-30 22:31:20 +00:00
* This file is released under the GNU General Public License.
* Refer to the COPYING file distributed with this package.
*
2011-01-05 23:34:37 +00:00
* Copyright (c) 1999, William Ferrell, Selene 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;
/** Widget structure */
typedef struct Widget {
char *id; /**< the widget's name */
WidgetType type; /**< the widget's type */
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 */
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