Files
lcdproc/server/screen.h
T

85 lines
1.7 KiB
C
Raw Normal View History

/*
* screen.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
* 2003, Joris Robijn
*
*/
2002-06-28 23:35:55 +00:00
#include "menu.h"
#include "menuitem.h"
#include "client.h"
/* These headers are placed here on purpose ! (circular references) */
1999-12-09 23:15:14 +00:00
#ifndef SCREEN_H
#define SCREEN_H
#include "shared/LL.h"
2002-06-28 23:35:55 +00:00
#include "client.h"
1999-12-09 23:15:14 +00:00
typedef enum { PRI_HIDDEN, PRI_BACKGROUND, PRI_INFO, PRI_FOREGROUND,
PRI_ALERT, PRI_INPUT
} Priority;
typedef struct Screen {
2000-04-03 22:13:57 +00:00
char *id;
char *name;
int width, height;
2000-04-03 22:13:57 +00:00
int duration;
int timeout;
Priority priority;
short int heartbeat;
short int backlight;
short int cursor;
short int cursor_x;
short int cursor_y;
char *keys;
LinkedList *widgetlist;
struct Client *client;
} Screen;
#include "widget.h"
1999-12-09 23:15:14 +00:00
extern int default_duration ;
extern int default_priority ;
2002-06-28 23:35:55 +00:00
#include "client.h"
1999-12-09 23:15:14 +00:00
/* Creates a new screen */
Screen * screen_create (char * id, Client * client);
1999-12-09 23:15:14 +00:00
/* Destroys a screen */
int screen_destroy (Screen * s);
/* Add a widget to a screen */
int screen_add_widget (Screen * s, Widget * w);
/* Remove a widget from a screen (does not destroy it) */
int screen_remove_widget (Screen * s, Widget * w);
/* List functions */
static inline Widget * screen_getfirst_widget (Screen * s)
{
return LL_GetFirst(s->widgetlist);
}
static inline Widget * screen_getnext_widget (Screen * s)
{
return LL_GetNext(s->widgetlist);
}
/* Find a widget in a screen */
Widget *screen_find_widget (Screen * s, char *id);
1999-12-09 23:15:14 +00:00
/* Convert priority names to priority and vv */
Priority screen_pri_name_to_pri (char * pri_name);
char * screen_pri_to_pri_name (Priority pri);
1999-12-09 23:15:14 +00:00
#endif