v0.5 kick-off
This commit is contained in:
+15
-16
@@ -6,7 +6,6 @@
|
||||
* COPYING file distributed with this package.
|
||||
*
|
||||
* Copyright (c) 1999, William Ferrell, Scott Scriven
|
||||
* 2001, Joris Robijn
|
||||
*
|
||||
*
|
||||
* Does screen management
|
||||
@@ -19,7 +18,7 @@
|
||||
|
||||
#include "shared/report.h"
|
||||
|
||||
#include "drivers/lcd.h"
|
||||
#include "drivers.h"
|
||||
|
||||
#include "clients.h"
|
||||
#include "client_data.h"
|
||||
@@ -48,14 +47,14 @@ screen_create ()
|
||||
s->priority = DEFAULT_SCREEN_PRIORITY;
|
||||
s->duration = default_duration;
|
||||
s->heartbeat = DEFAULT_HEARTBEAT;
|
||||
s->wid = lcd_ptr->wid;
|
||||
s->hgt = lcd_ptr->hgt;
|
||||
s->wid = display_props->width;
|
||||
s->hgt = display_props->height;
|
||||
s->keys = NULL;
|
||||
s->parent = NULL;
|
||||
s->widgets = NULL;
|
||||
s->timeout = default_timeout; //ignored unless greater than 0.
|
||||
s->backlight_state = BACKLIGHT_NOTSET; //Lets the screen do it's own
|
||||
//or do what the client says.
|
||||
s->timeout = default_timeout; /*ignored unless greater than 0.*/
|
||||
s->backlight_state = BACKLIGHT_NOTSET; /*Lets the screen do it's own*/
|
||||
/*or do what the client says.*/
|
||||
|
||||
s->widgets = LL_new ();
|
||||
if (!s->widgets) {
|
||||
@@ -76,7 +75,7 @@ screen_destroy (screen * s)
|
||||
|
||||
LL_Rewind (s->widgets);
|
||||
do {
|
||||
// Free a widget...
|
||||
/* Free a widget...*/
|
||||
w = LL_Get (s->widgets);
|
||||
widget_destroy (w);
|
||||
} while (LL_Next (s->widgets) == 0);
|
||||
@@ -128,7 +127,7 @@ screen_add (client * c, char *id)
|
||||
if (!id)
|
||||
return -1;
|
||||
|
||||
// Make sure this screen doesn't already exist...
|
||||
/* Make sure this screen doesn't already exist...*/
|
||||
s = screen_find (c, id);
|
||||
if (s) {
|
||||
return 1;
|
||||
@@ -147,10 +146,10 @@ screen_add (client * c, char *id)
|
||||
report (RPT_ERR, "screen_add: Error allocating name");
|
||||
return -1;
|
||||
}
|
||||
// TODO: Check for errors here?
|
||||
/* TODO: Check for errors here?*/
|
||||
LL_Push (c->data->screenlist, (void *) s);
|
||||
|
||||
// Now, add it to the screenlist...
|
||||
/* Now, add it to the screenlist...*/
|
||||
if (screenlist_add (s) < 0) {
|
||||
report (RPT_ERR, "screen_add: Error queueing new screen");
|
||||
return -1;
|
||||
@@ -169,23 +168,23 @@ screen_remove (client * c, char *id)
|
||||
if (!id)
|
||||
return -1;
|
||||
|
||||
// Make sure this screen *does* exist...
|
||||
/* Make sure this screen *does* exist...*/
|
||||
s = screen_find (c, id);
|
||||
if (!s) {
|
||||
report (RPT_ERR, "screen_remove: Error finding screen %s", id);
|
||||
return 1;
|
||||
}
|
||||
// TODO: Check for errors here?
|
||||
/* TODO: Check for errors here?*/
|
||||
LL_Remove (c->data->screenlist, (void *) s);
|
||||
|
||||
// Now, remove it from the screenlist...
|
||||
/* Now, remove it from the screenlist...*/
|
||||
if (screenlist_remove_all (s) < 0) {
|
||||
// Not a serious error..
|
||||
/* Not a serious error..*/
|
||||
report (RPT_ERR, "screen_remove: Error dequeueing screen");
|
||||
return 0;
|
||||
}
|
||||
|
||||
// TODO: Check for errors here too?
|
||||
/* TODO: Check for errors here too?*/
|
||||
screen_destroy (s);
|
||||
|
||||
return 0;
|
||||
|
||||
Reference in New Issue
Block a user