git-svn-id: svn://svn.code.sf.net/p/tigervnc/code/trunk@5064 3789f03b-4d11-0410-bbf8-ca57d06f2519tags/v1.2.90
}; | }; | ||||
// -=- ParameterIterator | // -=- ParameterIterator | ||||
// Iterates over all the Parameters in a Configuration group. The | |||||
// current Parameter is accessed via param, the current Configuration | |||||
// via config. The next() method moves on to the next Parameter. | |||||
// Iterates over all enabled parameters (global + server/viewer). | |||||
// Current Parameter is accessed via param, the current Configuration | |||||
// via config. The next() method moves on to the next Parameter. | |||||
struct ParameterIterator { | struct ParameterIterator { | ||||
ParameterIterator(Configuration* c) : config(c), param(c ? c->head : 0) {} | |||||
ParameterIterator() : config(Configuration::global()), param(config->head) {} | |||||
void next() { | void next() { | ||||
param = param->_next; | param = param->_next; | ||||
while (!param) { | while (!param) { |
int nParams = 0; | int nParams = 0; | ||||
int len = 0; | int len = 0; | ||||
for (ParameterIterator i(Configuration::global()); i.param; i.next()) { | |||||
for (ParameterIterator i; i.param; i.next()) { | |||||
int l = strlen(i.param->getName()); | int l = strlen(i.param->getName()); | ||||
if (l <= 255) { | if (l <= 255) { | ||||
nParams++; | nParams++; | ||||
WriteToClient(client, sizeof(xVncExtListParamsReply), (char *)&rep); | WriteToClient(client, sizeof(xVncExtListParamsReply), (char *)&rep); | ||||
rdr::U8* data = new rdr::U8[len]; | rdr::U8* data = new rdr::U8[len]; | ||||
rdr::U8* ptr = data; | rdr::U8* ptr = data; | ||||
for (ParameterIterator i(Configuration::global()); i.param; i.next()) { | |||||
for (ParameterIterator i; i.param; i.next()) { | |||||
int l = strlen(i.param->getName()); | int l = strlen(i.param->getName()); | ||||
if (l <= 255) { | if (l <= 255) { | ||||
*ptr++ = l; | *ptr++ = l; |
for (int scr = 0; scr < screenInfo.numScreens; scr++) { | for (int scr = 0; scr < screenInfo.numScreens; scr++) { | ||||
ScrnInfoPtr pScrn = xf86Screens[scr]; | ScrnInfoPtr pScrn = xf86Screens[scr]; | ||||
for (ParameterIterator i(Configuration::global()); i.param; i.next()) { | |||||
for (ParameterIterator i; i.param; i.next()) { | |||||
const char *val; | const char *val; | ||||
#if XORG < 112 | #if XORG < 112 | ||||
val = xf86FindOptionValue(pScrn->options, i.param->getName()); | val = xf86FindOptionValue(pScrn->options, i.param->getName()); |