2008-11-30 22:31:20 +00:00
|
|
|
/** \file server/screen.h
|
2008-12-14 09:59:34 +00:00
|
|
|
* Public interface to the screen management methods.
|
2008-11-30 22:31:20 +00:00
|
|
|
*/
|
|
|
|
|
|
|
|
|
|
/* This file is part of LCDd, the lcdproc server.
|
2001-12-27 23:30:36 +00:00
|
|
|
*
|
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.
|
2001-12-27 23:30:36 +00:00
|
|
|
*
|
2011-01-05 23:34:37 +00:00
|
|
|
* Copyright (c) 1999, William Ferrell, Selene Scriven
|
2003-02-27 21:20:20 +00:00
|
|
|
* 2003, Joris Robijn
|
2001-12-27 23:30:36 +00:00
|
|
|
*/
|
|
|
|
|
|
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
|
|
|
|
|
|
2001-05-25 03:14:27 +00:00
|
|
|
#include "shared/LL.h"
|
2002-06-28 23:35:55 +00:00
|
|
|
#include "client.h"
|
1999-12-09 23:15:14 +00:00
|
|
|
|
2003-02-27 21:20:20 +00:00
|
|
|
typedef enum { PRI_HIDDEN, PRI_BACKGROUND, PRI_INFO, PRI_FOREGROUND,
|
|
|
|
|
PRI_ALERT, PRI_INPUT
|
|
|
|
|
} Priority;
|
|
|
|
|
|
2002-04-26 00:00:31 +00:00
|
|
|
typedef struct Screen {
|
2000-04-03 22:13:57 +00:00
|
|
|
char *id;
|
|
|
|
|
char *name;
|
2002-04-26 00:00:31 +00:00
|
|
|
int width, height;
|
2000-04-03 22:13:57 +00:00
|
|
|
int duration;
|
2001-11-12 17:35:43 +00:00
|
|
|
int timeout;
|
2003-02-27 21:20:20 +00:00
|
|
|
Priority priority;
|
2002-04-26 00:00:31 +00:00
|
|
|
short int heartbeat;
|
|
|
|
|
short int backlight;
|
|
|
|
|
short int cursor;
|
|
|
|
|
short int cursor_x;
|
|
|
|
|
short int cursor_y;
|
2001-05-25 03:14:27 +00:00
|
|
|
char *keys;
|
2002-04-26 00:00:31 +00:00
|
|
|
LinkedList *widgetlist;
|
|
|
|
|
struct Client *client;
|
|
|
|
|
} Screen;
|
|
|
|
|
|
|
|
|
|
#include "widget.h"
|
|
|
|
|
|
1999-12-09 23:15:14 +00:00
|
|
|
|
2001-07-18 22:30:12 +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
|
|
|
|
2002-04-26 00:00:31 +00:00
|
|
|
/* Creates a new screen */
|
2007-04-02 21:29:53 +00:00
|
|
|
Screen *screen_create(char *id, Client *client);
|
1999-12-09 23:15:14 +00:00
|
|
|
|
2002-04-26 00:00:31 +00:00
|
|
|
/* Destroys a screen */
|
2007-04-02 21:29:53 +00:00
|
|
|
int screen_destroy(Screen *s);
|
2002-04-26 00:00:31 +00:00
|
|
|
|
|
|
|
|
/* Add a widget to a screen */
|
2007-04-02 21:29:53 +00:00
|
|
|
int screen_add_widget(Screen *s, Widget *w);
|
2002-04-26 00:00:31 +00:00
|
|
|
|
|
|
|
|
/* Remove a widget from a screen (does not destroy it) */
|
2007-04-02 21:29:53 +00:00
|
|
|
int screen_remove_widget(Screen *s, Widget *w);
|
2002-04-26 00:00:31 +00:00
|
|
|
|
|
|
|
|
/* List functions */
|
2007-04-02 21:29:53 +00:00
|
|
|
static inline Widget *screen_getfirst_widget(Screen *s)
|
2002-04-26 00:00:31 +00:00
|
|
|
{
|
2005-02-28 20:21:40 +00:00
|
|
|
return (Widget *) ((s != NULL)
|
|
|
|
|
? LL_GetFirst(s->widgetlist)
|
|
|
|
|
: NULL);
|
2002-04-26 00:00:31 +00:00
|
|
|
}
|
|
|
|
|
|
2007-04-02 21:29:53 +00:00
|
|
|
static inline Widget *screen_getnext_widget(Screen *s)
|
2002-04-26 00:00:31 +00:00
|
|
|
{
|
2005-02-28 20:21:40 +00:00
|
|
|
return (Widget *) ((s != NULL)
|
|
|
|
|
? LL_GetNext(s->widgetlist)
|
|
|
|
|
: NULL);
|
2002-04-26 00:00:31 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
/* Find a widget in a screen */
|
2007-04-02 21:29:53 +00:00
|
|
|
Widget *screen_find_widget(Screen *s, char *id);
|
1999-12-09 23:15:14 +00:00
|
|
|
|
2003-02-27 21:20:20 +00:00
|
|
|
/* Convert priority names to priority and vv */
|
2007-04-02 21:29:53 +00:00
|
|
|
Priority screen_pri_name_to_pri(char *pri_name);
|
|
|
|
|
char *screen_pri_to_pri_name(Priority pri);
|
2003-02-27 21:20:20 +00:00
|
|
|
|
1999-12-09 23:15:14 +00:00
|
|
|
#endif
|