File: widget.h

package info (click to toggle)
lcdproc 0.4.5-1.1
  • links: PTS
  • area: main
  • in suites: etch, etch-m68k, lenny
  • size: 2,092 kB
  • ctags: 2,047
  • sloc: ansic: 23,436; sh: 3,236; perl: 730; makefile: 118
file content (55 lines) | stat: -rw-r--r-- 1,276 bytes parent folder | download | duplicates (3)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
/*
 * 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, Mike Patnode
 *
 */

#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...*/
	int timer;			/* For scroller...*/
	char *text;			/* text or binary data*/
	LinkedList *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[];

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