v0.5 kick-off
This commit is contained in:
+38
-39
@@ -6,7 +6,6 @@
|
||||
* COPYING file distributed with this package.
|
||||
*
|
||||
* Copyright (c) 1999, William Ferrell, Scott Scriven
|
||||
* 2001, Joris Robijn
|
||||
*
|
||||
*
|
||||
* All actions that can be performed on the list of screens
|
||||
@@ -108,43 +107,43 @@ screenlist_current ()
|
||||
|
||||
debug( RPT_INFO, "screenlist_current:");
|
||||
|
||||
//LL_dprint(screenlist);
|
||||
/*LL_dprint(screenlist);*/
|
||||
|
||||
s = (screen *) LL_GetFirst (screenlist);
|
||||
|
||||
// FIXME: Make sure the screen/client exists!
|
||||
/* FIXME: Make sure the screen/client exists!*/
|
||||
if (s != old_s) {
|
||||
//debug (RPT_DEBUG, "screenlist_current: new screen");
|
||||
/*debug (RPT_DEBUG, "screenlist_current: new screen");*/
|
||||
timer = 0;
|
||||
|
||||
// Tell the client we're done with the current screen
|
||||
/* Tell the client we're done with the current screen*/
|
||||
if (old_s) {
|
||||
//debug(RPT_DEBUG, "screenlist_current: ignoring old screen");
|
||||
/*debug(RPT_DEBUG, "screenlist_current: ignoring old screen");*/
|
||||
LL_Rewind (screenlist);
|
||||
if (old_s != LL_Find (screenlist, compare_addresses, old_s)) {
|
||||
report (RPT_WARNING, "screenlist: Didn't find screen 0x%8x!", (int) old_s);
|
||||
report (RPT_WARNING, "screenlist: Didn't find screen 0x%8x! Client crashed?", (int) old_s);
|
||||
} else {
|
||||
//debug(RPT_DEBUG, "screenlist_current: ... sending ignore");
|
||||
/*debug(RPT_DEBUG, "screenlist_current: ... sending ignore");*/
|
||||
c = old_s->parent;
|
||||
if (c) // Tell the client we're not listening any more...
|
||||
if (c) /* Tell the client we're not listening any more...*/
|
||||
{
|
||||
snprintf (str, sizeof(str), "ignore %s\n", old_s->id);
|
||||
sock_send_string (c->sock, str);
|
||||
} else // The server has the display, so do nothing
|
||||
} else /* The server has the display, so do nothing*/
|
||||
{
|
||||
;
|
||||
}
|
||||
//debug(RPT_DEBUG, "screenlist_current: ... sent ignore");
|
||||
/*debug(RPT_DEBUG, "screenlist_current: ... sent ignore");*/
|
||||
}
|
||||
}
|
||||
if (s) {
|
||||
//debug(RPT_DEBUG, "screenlist_current: listening to new screen");
|
||||
/*debug(RPT_DEBUG, "screenlist_current: listening to new screen");*/
|
||||
c = s->parent;
|
||||
if (c) // Tell the client we're paying attention...
|
||||
if (c) /* Tell the client we're paying attention...*/
|
||||
{
|
||||
snprintf (str, sizeof(str), "listen %s\n", s->id);
|
||||
sock_send_string (c->sock, str);
|
||||
} else // The server has the display, so do nothing
|
||||
} else /* The server has the display, so do nothing*/
|
||||
{
|
||||
;
|
||||
}
|
||||
@@ -153,7 +152,7 @@ screenlist_current ()
|
||||
|
||||
old_s = s;
|
||||
|
||||
//debug(RPT_DEBUG, "screenlist_current: return %8x", s);
|
||||
/*debug(RPT_DEBUG, "screenlist_current: return %8x", s);*/
|
||||
|
||||
return s;
|
||||
}
|
||||
@@ -161,7 +160,7 @@ screenlist_current ()
|
||||
int
|
||||
screenlist_add (screen * s)
|
||||
{
|
||||
// TODO: Different queueing modes...
|
||||
/* TODO: Different queueing modes...*/
|
||||
return screenlist_add_end (s);
|
||||
}
|
||||
|
||||
@@ -170,27 +169,27 @@ screenlist_next ()
|
||||
{
|
||||
screen *s;
|
||||
|
||||
//debug(RPT_DEBUG, "Screenlist_next()");
|
||||
/*debug(RPT_DEBUG, "Screenlist_next()");*/
|
||||
|
||||
s = screenlist_current ();
|
||||
|
||||
// If we're on hold, don't advance!
|
||||
/* If we're on hold, don't advance!*/
|
||||
if (screenlist_action == SCR_HOLD)
|
||||
return s;
|
||||
if (screenlist_action == RENDER_HOLD)
|
||||
return s;
|
||||
|
||||
// Otherwise, reset it to regular operation
|
||||
/* Otherwise, reset it to regular operation*/
|
||||
screenlist_action = 0;
|
||||
|
||||
//debug(RPT_DEBUG, "Screenlist_next: calling handler...");
|
||||
/*debug(RPT_DEBUG, "Screenlist_next: calling handler...");*/
|
||||
|
||||
// Call the selected queuing function...
|
||||
// TODO: Different queueing modes...
|
||||
/* Call the selected queuing function...*/
|
||||
/* TODO: Different queueing modes...*/
|
||||
s = screenlist_next_priority ();
|
||||
//s = screenlist_next_roll();
|
||||
/*s = screenlist_next_roll();*/
|
||||
|
||||
//debug(RPT_DEBUG, "Screenlist_next() done");
|
||||
/*debug(RPT_DEBUG, "Screenlist_next() done");*/
|
||||
|
||||
return s;
|
||||
}
|
||||
@@ -202,23 +201,23 @@ screenlist_prev ()
|
||||
|
||||
s = screenlist_current ();
|
||||
|
||||
// If we're on hold, don't advance!
|
||||
/* If we're on hold, don't advance!*/
|
||||
if (screenlist_action == SCR_HOLD)
|
||||
return s;
|
||||
if (screenlist_action == RENDER_HOLD)
|
||||
return s;
|
||||
|
||||
// Otherwise, reset it no regular operation
|
||||
/* Otherwise, reset it no regular operation*/
|
||||
screenlist_action = 0;
|
||||
|
||||
// Call the selected queuing function...
|
||||
// TODO: Different queueing modes...
|
||||
/* Call the selected queuing function...*/
|
||||
/* TODO: Different queueing modes...*/
|
||||
s = screenlist_prev_roll ();
|
||||
|
||||
return s;
|
||||
}
|
||||
|
||||
// Adds new screens to the end of the screenlist...
|
||||
/* Adds new screens to the end of the screenlist...*/
|
||||
int
|
||||
screenlist_add_end (screen * screen)
|
||||
{
|
||||
@@ -227,11 +226,11 @@ screenlist_add_end (screen * screen)
|
||||
return LL_Push (screenlist, (void *) screen);
|
||||
}
|
||||
|
||||
// Simple round-robin approach to screen cycling...
|
||||
/* Simple round-robin approach to screen cycling...*/
|
||||
screen *
|
||||
screenlist_next_roll ()
|
||||
{
|
||||
//debug(RPT_DEBUG, "screenlist_next_roll()");
|
||||
/*debug(RPT_DEBUG, "screenlist_next_roll()");*/
|
||||
|
||||
if (LL_UnRoll (screenlist) != 0)
|
||||
return NULL;
|
||||
@@ -239,12 +238,12 @@ screenlist_next_roll ()
|
||||
return screenlist_current ();
|
||||
}
|
||||
|
||||
// Strict priority queue approach...
|
||||
/* Strict priority queue approach...*/
|
||||
screen *
|
||||
screenlist_next_priority ()
|
||||
{
|
||||
//screen *s, *t;
|
||||
//debug(RPT_DEBUG, "screenlist_next_priority");
|
||||
/*screen *s, *t;*/
|
||||
/*debug(RPT_DEBUG, "screenlist_next_priority");*/
|
||||
|
||||
if (LL_UnRoll (screenlist) != 0)
|
||||
return NULL;
|
||||
@@ -254,11 +253,11 @@ screenlist_next_priority ()
|
||||
return screenlist_current ();
|
||||
}
|
||||
|
||||
// Simple round-robin approach to screen cycling...
|
||||
/* Simple round-robin approach to screen cycling...*/
|
||||
screen *
|
||||
screenlist_prev_roll ()
|
||||
{
|
||||
//debug(RPT_DEBUG, "screenlist_prev_roll()");
|
||||
/*debug(RPT_DEBUG, "screenlist_prev_roll()");*/
|
||||
|
||||
if (LL_Roll (screenlist) != 0)
|
||||
return NULL;
|
||||
@@ -271,7 +270,7 @@ compare_priority (void *one, void *two)
|
||||
{
|
||||
screen *a, *b;
|
||||
|
||||
//debug(RPT_DEBUG, "compare_priority: %8x %8x", one, two);
|
||||
/*debug(RPT_DEBUG, "compare_priority: %8x %8x", one, two);*/
|
||||
|
||||
if (!one)
|
||||
return 0;
|
||||
@@ -281,7 +280,7 @@ compare_priority (void *one, void *two)
|
||||
a = (screen *) one;
|
||||
b = (screen *) two;
|
||||
|
||||
//debug(RPT_DEBUG, "compare_priority: done?");
|
||||
/*debug(RPT_DEBUG, "compare_priority: done?");*/
|
||||
|
||||
return (a->priority - b->priority);
|
||||
}
|
||||
@@ -289,6 +288,6 @@ compare_priority (void *one, void *two)
|
||||
int
|
||||
compare_addresses (void *one, void *two)
|
||||
{
|
||||
//printf(RPT_DEBUG, "compare_addresses: %p == %p ???", one, two);
|
||||
/*debug(RPT_DEBUG, "compare_addresses: %p == %p ???", one, two);*/
|
||||
return (one != two);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user