Logo Search packages:      
Sourcecode: waimea version File versions  Download package

char* param_eval ( char *  action,
char *  param,
WaScreen *  wascreen 
)

Evaluate parameter string.

Replaces special parameter characters and returns new parameter string.

Parameters:
action Action name for parameter
param Parameter string
wascreen WaScreen object pointer
Returns:
New parameter

Definition at line 2999 of file Resources.cc.

                                                                {
    char *tmp, *p;
    int i;
    char *__m_wastrdup_tmp;

    if (! param) return param;
    
    p = __m_wastrdup(param);
    if ((! strncasecmp(action, "viewport", 8)) ||
        (! strncasecmp(action, "moveresize", 10))) {
        for (i = 0; p[i] != '\0'; i++) {
            if (p[i] == 'W' || p[i] == 'w') {
                tmp = new char[strlen(p) + 5];
                p[i] = '\0';
                sprintf(tmp, "%s%d%s", p, wascreen->width, &p[i + 1]);
                delete [] p;
                p = tmp;
            }
            else if (p[i] == 'H' || p[i] == 'h') {
                tmp = new char[strlen(p) + 5];
                p[i] = '\0';
                sprintf(tmp, "%s%d%s", p, wascreen->height, &p[i + 1]);
                delete [] p;
                p = tmp;
            }
        }
    }
    return p;
}


Generated by  Doxygen 1.6.0   Back to index