Changeset 11112


Ignore:
Timestamp:
11/09/11 18:48:29 (12 years ago)
Author:
nit
Message:

[titan] make textinput thread safe

Location:
titan/titan
Files:
6 edited

Legend:

Unmodified
Added
Removed
  • titan/titan/header.h

    r11011 r11112  
    204204
    205205//skin.h
     206char* savescreen(struct skin* node);
     207void restorescreen(char* buf, struct skin* node);
    206208char* changepicpath(char* picname);
    207209long convertcol(char *value);
     
    262264//rcfunc.h
    263265void inputboxchar(struct skin* screen, struct skin* inputbox, char zeichen, int flag);
    264 void inputboxff(struct skin* screen, struct skin* inputbox);
    265 void inputboxfr(struct skin* screen, struct skin* inputbox);
    266 void inputboxright(struct skin* screen, struct skin* inputbox);
    267 void inputboxleft(struct skin* screen, struct skin* inputbox);
     266void inputboxff(struct skin* screen, struct skin* inputbox, int flag);
     267void inputboxfr(struct skin* screen, struct skin* inputbox, int flag);
     268void inputboxright(struct skin* screen, struct skin* inputbox, int flag);
     269void inputboxleft(struct skin* screen, struct skin* inputbox, int flag);
    268270int addscreenrc(struct skin* screen, struct skin* node);
    269271void checkinputboxnumright(struct skin* inputbox);
  • titan/titan/inputhelp.h

    r10717 r11112  
    22#define INPUTHELP_H
    33
    4 void inputhelpnum(struct skin* inputhelp, struct skin* inputbox, char num)
     4void inputhelpnum(struct skin* inputhelp, struct skin* inputbox, char num, int flag)
    55{
    6         inputboxff(inputhelp, inputbox);
    7         inputboxchar(inputhelp, inputbox, num, 0);
    8         drawscreen(inputhelp, 0);
     6        inputboxff(inputhelp, inputbox, flag);
     7        inputboxchar(inputhelp, inputbox, num, flag);
     8        drawscreen(inputhelp, flag);
    99}
    1010
    11 char* screeninputhelp(char* text)
     11char* screeninputhelp(char* text, int flag)
    1212{
    1313        int rcret = 0, tmpscreencalc = 0;
     
    2929        tmpscreencalc = status.screencalc;
    3030        status.screencalc = 0;
    31         drawscreen(inputhelp, 0);
     31        drawscreen(inputhelp, flag);
    3232        addscreenrc(inputhelp, grid);
    3333
     
    4242                }
    4343                if(rcret == getrcconfigint("rcff", NULL))
    44                         inputboxright(inputhelp, inputbox);
     44                        inputboxright(inputhelp, inputbox, flag);
    4545                if(rcret == getrcconfigint("rcfr", NULL))
    46                         inputboxleft(inputhelp, inputbox);
     46                        inputboxleft(inputhelp, inputbox, flag);
    4747                if(rcret == getrcconfigint("rc0", NULL))
    48                         inputhelpnum(inputhelp, inputbox, '0');
     48                        inputhelpnum(inputhelp, inputbox, '0', flag);
    4949                if(rcret == getrcconfigint("rc1", NULL))
    50                         inputhelpnum(inputhelp, inputbox, '1');
     50                        inputhelpnum(inputhelp, inputbox, '1', flag);
    5151                if(rcret == getrcconfigint("rc2", NULL))
    52                         inputhelpnum(inputhelp, inputbox, '2');
     52                        inputhelpnum(inputhelp, inputbox, '2', flag);
    5353                if(rcret == getrcconfigint("rc3", NULL))
    54                         inputhelpnum(inputhelp, inputbox, '3');
     54                        inputhelpnum(inputhelp, inputbox, '3', flag);
    5555                if(rcret == getrcconfigint("rc4", NULL))
    56                         inputhelpnum(inputhelp, inputbox, '4');
     56                        inputhelpnum(inputhelp, inputbox, '4', flag);
    5757                if(rcret == getrcconfigint("rc5", NULL))
    58                         inputhelpnum(inputhelp, inputbox, '5');
     58                        inputhelpnum(inputhelp, inputbox, '5', flag);
    5959                if(rcret == getrcconfigint("rc6", NULL))
    60                         inputhelpnum(inputhelp, inputbox, '6');
     60                        inputhelpnum(inputhelp, inputbox, '6', flag);
    6161                if(rcret == getrcconfigint("rc7", NULL))
    62                         inputhelpnum(inputhelp, inputbox, '7');
     62                        inputhelpnum(inputhelp, inputbox, '7', flag);
    6363                if(rcret == getrcconfigint("rc8", NULL))
    64                         inputhelpnum(inputhelp, inputbox, '8');
     64                        inputhelpnum(inputhelp, inputbox, '8', flag);
    6565                if(rcret == getrcconfigint("rc9", NULL))
    66                         inputhelpnum(inputhelp, inputbox, '9');
     66                        inputhelpnum(inputhelp, inputbox, '9', flag);
    6767
    6868                if(rcret == getrcconfigint("rcok", NULL) || rcret == getrcconfigint("rcred", NULL) || rcret == getrcconfigint("rcgreen", NULL) || rcret == getrcconfigint("rcyellow", NULL) || rcret == getrcconfigint("rcblue", NULL))
     
    7777                                if(rcret == getrcconfigint("rcred", NULL) || (rcret == getrcconfigint("rcok", NULL) && ostrcmp(grid->select->name, "bs") == 0))
    7878                                {
    79                                         inputboxfr(inputhelp, inputbox);
     79                                        inputboxfr(inputhelp, inputbox, flag);
    8080                                        continue;
    8181                                }
     
    8383                                {
    8484                                        changeinput(inputbox, NULL);
    85                                         drawscreen(inputhelp, 0);
     85                                        drawscreen(inputhelp, flag);
    8686                                        continue;
    8787                                }
    8888                                if(rcret == getrcconfigint("rcok", NULL) && ostrcmp(grid->select->name, "left") == 0)
    8989                                {
    90                                         inputboxleft(inputhelp, inputbox);
    91                                         drawscreen(inputhelp, 0);
     90                                        inputboxleft(inputhelp, inputbox, flag);
     91                                        drawscreen(inputhelp, flag);
    9292                                        continue;
    9393                                }
    9494                                if(rcret == getrcconfigint("rcok", NULL) && ostrcmp(grid->select->name, "right") == 0)
    9595                                {
    96                                         inputboxright(inputhelp, inputbox);
    97                                         drawscreen(inputhelp, 0);
     96                                        inputboxright(inputhelp, inputbox, flag);
     97                                        drawscreen(inputhelp, flag);
    9898                                        continue;
    9999                                }
     
    116116                                                addscreenrc(inputhelp, grid);
    117117                                        }
    118                                         drawscreen(inputhelp, 0);
     118                                        drawscreen(inputhelp, flag);
    119119                                        continue;
    120120                                }
    121121                                if(rcret == getrcconfigint("rcyellow", NULL))
    122122                                {
    123                                         inputboxff(inputhelp, inputbox);
    124                                         inputboxchar(inputhelp, inputbox, ' ', 0);
    125                                         drawscreen(inputhelp, 0);
     123                                        inputboxff(inputhelp, inputbox, flag);
     124                                        inputboxchar(inputhelp, inputbox, ' ', flag);
     125                                        drawscreen(inputhelp, flag);
    126126                                        continue;
    127127                                }
    128128
    129                                 inputboxff(inputhelp, inputbox);
    130                                 inputboxchar(inputhelp, inputbox, grid->select->name[0], 0);
     129                                inputboxff(inputhelp, inputbox, flag);
     130                                inputboxchar(inputhelp, inputbox, grid->select->name[0], flag);
    131131                        }
    132132                }
     
    135135        delownerrc(inputhelp);
    136136        clearscreen(inputhelp);
    137         drawscreen(skin, 0);
     137        drawscreen(skin, flag);
    138138        status.screencalc = tmpscreencalc;
    139139        return tmpstr;
  • titan/titan/rcfunc.h

    r11004 r11112  
    22#define RCFUNC_H
    33
    4 void progressbarright(struct skin* screen, struct skin* progressbar)
     4void progressbarright(struct skin* screen, struct skin* progressbar, int flag)
    55{
    66        debug(1000, "in");
     
    1111                {
    1212                        progressbar->progresssize++;
    13                         drawscreen(screen, 0);
     13                        drawscreen(screen, flag);
    1414                }
    1515                else
     
    2020}
    2121
    22 void progressbarleft(struct skin* screen, struct skin* progressbar)
     22void progressbarleft(struct skin* screen, struct skin* progressbar, int flag)
    2323{
    2424        debug(1000, "in");
     
    2929                {
    3030                        progressbar->progresssize--;
    31                         drawscreen(screen, 0);
     31                        drawscreen(screen, flag);
    3232                }
    3333                else
     
    3838}
    3939
    40 void filelistok(struct skin* screen, struct skin* filelist)
     40void filelistok(struct skin* screen, struct skin* filelist, int flag)
    4141{
    4242        debug(1000, "in");
     
    7979                                setlistboxselection(filelist, plastdir);
    8080                                free(lastdir); lastdir = NULL;
    81                                 drawscreen(screen, 0);
     81                                drawscreen(screen, flag);
    8282                        }
    8383                        else
     
    8888}
    8989
    90 void inputboxhelp(struct skin* screen, struct skin* inputbox)
     90void inputboxhelp(struct skin* screen, struct skin* inputbox, int flag)
    9191{
    9292        char* tmpstr = NULL;
    9393
    94         if(inputbox != NULL && inputbox->type == INPUTBOX)
    95         {
    96                 tmpstr = screeninputhelp(inputbox->input);
     94        if(inputbox != NULL && inputbox->type == INPUTBOX && flag == 0)
     95        {
     96                tmpstr = screeninputhelp(inputbox->input, flag);
    9797                changeinput(inputbox, tmpstr);
    9898                free(tmpstr); tmpstr = NULL;
    99                 drawscreen(screen, 0);
     99                drawscreen(screen, flag);
    100100        }
    101101}
     
    109109                {
    110110                        inputbox->input[inputbox->aktpage - 1] = zeichen;
    111                         if(flag == 0)
    112                                 drawscreen(screen, 0);
    113                 }
    114         }
    115         debug(1000, "out");
    116 }
    117 
    118 void inputboxff(struct skin* screen, struct skin* inputbox)
     111                        if(flag != 1)
     112                                drawscreen(screen, flag);
     113                }
     114        }
     115        debug(1000, "out");
     116}
     117
     118void inputboxff(struct skin* screen, struct skin* inputbox, int flag)
    119119{
    120120        debug(1000, "in");
     
    124124                        changeinput(inputbox, "");
    125125                inputbox->aktpage = insertchar(&inputbox->input, '_', inputbox->aktpage);
    126                 drawscreen(screen, 0);
    127         }
    128         debug(1000, "out");
    129 }
    130 
    131 void inputboxfr(struct skin* screen, struct skin* inputbox)
     126                drawscreen(screen, flag);
     127        }
     128        debug(1000, "out");
     129}
     130
     131void inputboxfr(struct skin* screen, struct skin* inputbox, int flag)
    132132{
    133133        debug(1000, "in");
     
    135135        {
    136136                inputbox->aktpage = delchar(&inputbox->input, inputbox->aktpage);
    137                 drawscreen(screen, 0);
     137                drawscreen(screen, flag);
    138138        }
    139139        debug(1000, "out");
     
    190190}
    191191
    192 void inputboxright(struct skin* screen, struct skin* inputbox)
     192void inputboxright(struct skin* screen, struct skin* inputbox, int flag)
    193193{
    194194        debug(1000, "in");
     
    200200
    201201                checkinputboxnumright(inputbox);
    202                 drawscreen(screen, 0);
    203         }
    204         debug(1000, "out");
    205 }
    206 
    207 void inputboxleft(struct skin* screen, struct skin* inputbox)
     202                drawscreen(screen, flag);
     203        }
     204        debug(1000, "out");
     205}
     206
     207void inputboxleft(struct skin* screen, struct skin* inputbox, int flag)
    208208{
    209209        debug(1000, "in");
     
    215215
    216216                checkinputboxnumleft(inputbox);
    217                 drawscreen(screen, 0);
    218         }
    219         debug(1000, "out");
    220 }
    221 
    222 void inputbox0(struct skin* screen, struct skin* inputbox)
     217                drawscreen(screen, flag);
     218        }
     219        debug(1000, "out");
     220}
     221
     222void inputbox0(struct skin* screen, struct skin* inputbox, int flag)
    223223{
    224224        if(inputbox != NULL && inputbox->input != NULL)
     
    229229                {
    230230                        if(inputbox->input[aktpage] == '0')
    231                                 inputboxchar(screen, inputbox, ' ', 0);
     231                                inputboxchar(screen, inputbox, ' ', flag);
    232232                        else if(inputbox->input[aktpage] == ' ')
    233                                 inputboxchar(screen, inputbox, '#', 0);
     233                                inputboxchar(screen, inputbox, '#', flag);
    234234                        else if(inputbox->input[aktpage] == '#')
    235                                 inputboxchar(screen, inputbox, '*', 0);
     235                                inputboxchar(screen, inputbox, '*', flag);
    236236                        else if(inputbox->input[aktpage] == '*')
    237                                 inputboxchar(screen, inputbox, '_', 0);
     237                                inputboxchar(screen, inputbox, '_', flag);
    238238                        else
    239                                 inputboxchar(screen, inputbox, '0', 0);
     239                                inputboxchar(screen, inputbox, '0', flag);
    240240                }
    241241                else
    242242                {
    243243                        inputboxchar(screen, inputbox, '0', 1);
    244                         inputboxright(screen, inputbox);
    245                 }
    246         }
    247 }
    248 
    249 void inputbox1(struct skin* screen, struct skin* inputbox)
     244                        inputboxright(screen, inputbox, flag);
     245                }
     246        }
     247}
     248
     249void inputbox1(struct skin* screen, struct skin* inputbox, int flag)
    250250{
    251251        if(inputbox != NULL && inputbox->input != NULL)
     
    256256                {
    257257                        if(inputbox->input[aktpage] == '1')
    258                                 inputboxchar(screen, inputbox, '.', 0);
     258                                inputboxchar(screen, inputbox, '.', flag);
    259259                        else if(inputbox->input[aktpage] == '.')
    260                                 inputboxchar(screen, inputbox, ',', 0);
     260                                inputboxchar(screen, inputbox, ',', flag);
    261261                        else if(inputbox->input[aktpage] == ',')
    262                                 inputboxchar(screen, inputbox, '?', 0);
     262                                inputboxchar(screen, inputbox, '?', flag);
    263263                        else if(inputbox->input[aktpage] == '?')
    264                                 inputboxchar(screen, inputbox, '!', 0);
     264                                inputboxchar(screen, inputbox, '!', flag);
    265265                        else if(inputbox->input[aktpage] == '!')
    266                                 inputboxchar(screen, inputbox, '\'', 0);
     266                                inputboxchar(screen, inputbox, '\'', flag);
    267267                        else if(inputbox->input[aktpage] == '\'')
    268                                 inputboxchar(screen, inputbox, '-', 0);
     268                                inputboxchar(screen, inputbox, '-', flag);
    269269                        else if(inputbox->input[aktpage] == '-')
    270                                 inputboxchar(screen, inputbox, '(', 0);
     270                                inputboxchar(screen, inputbox, '(', flag);
    271271                        else if(inputbox->input[aktpage] == '(')
    272                                 inputboxchar(screen, inputbox, ')', 0);
     272                                inputboxchar(screen, inputbox, ')', flag);
    273273                        else if(inputbox->input[aktpage] == ')')
    274                                 inputboxchar(screen, inputbox, '@', 0);
     274                                inputboxchar(screen, inputbox, '@', flag);
    275275                        else if(inputbox->input[aktpage] == '@')
    276                                 inputboxchar(screen, inputbox, '/', 0);
     276                                inputboxchar(screen, inputbox, '/', flag);
    277277                        else if(inputbox->input[aktpage] == '/')
    278                                 inputboxchar(screen, inputbox, ':', 0);
     278                                inputboxchar(screen, inputbox, ':', flag);
    279279                        else
    280                                 inputboxchar(screen, inputbox, '1', 0);
     280                                inputboxchar(screen, inputbox, '1', flag);
    281281                }
    282282                else
    283283                {
    284284                        inputboxchar(screen, inputbox, '1', 1);
    285                         inputboxright(screen, inputbox);
    286                 }
    287         }
    288 }
    289 
    290 void inputbox2(struct skin* screen, struct skin* inputbox)
     285                        inputboxright(screen, inputbox, flag);
     286                }
     287        }
     288}
     289
     290void inputbox2(struct skin* screen, struct skin* inputbox, int flag)
    291291{
    292292        if(inputbox != NULL && inputbox->input != NULL)
     
    297297                {
    298298                        if(inputbox->input[aktpage] == '2')
    299                                 inputboxchar(screen, inputbox, 'a', 0);
     299                                inputboxchar(screen, inputbox, 'a', flag);
    300300                        else if(inputbox->input[aktpage] == 'a')
    301                                 inputboxchar(screen, inputbox, 'b', 0);
     301                                inputboxchar(screen, inputbox, 'b', flag);
    302302                        else if(inputbox->input[aktpage] == 'b')
    303                                 inputboxchar(screen, inputbox, 'c', 0);
     303                                inputboxchar(screen, inputbox, 'c', flag);
    304304                        else if(inputbox->input[aktpage] == 'c')
    305                                 inputboxchar(screen, inputbox, 'A', 0);
     305                                inputboxchar(screen, inputbox, 'A', flag);
    306306                        else if(inputbox->input[aktpage] == 'A')
    307                                 inputboxchar(screen, inputbox, 'B', 0);
     307                                inputboxchar(screen, inputbox, 'B', flag);
    308308                        else if(inputbox->input[aktpage] == 'B')
    309                                 inputboxchar(screen, inputbox, 'C', 0);
     309                                inputboxchar(screen, inputbox, 'C', flag);
    310310                        else
    311                                 inputboxchar(screen, inputbox, '2', 0);
     311                                inputboxchar(screen, inputbox, '2', flag);
    312312                }
    313313                else
    314314                {
    315315                        inputboxchar(screen, inputbox, '2', 1);
    316                         inputboxright(screen, inputbox);
    317                 }
    318         }
    319 }
    320 
    321 void inputbox3(struct skin* screen, struct skin* inputbox)
     316                        inputboxright(screen, inputbox, flag);
     317                }
     318        }
     319}
     320
     321void inputbox3(struct skin* screen, struct skin* inputbox, int flag)
    322322{
    323323        if(inputbox != NULL && inputbox->input != NULL)
     
    328328                {
    329329                        if(inputbox->input[aktpage] == '3')
    330                                 inputboxchar(screen, inputbox, 'd', 0);
     330                                inputboxchar(screen, inputbox, 'd', flag);
    331331                        else if(inputbox->input[aktpage] == 'd')
    332                                 inputboxchar(screen, inputbox, 'e', 0);
     332                                inputboxchar(screen, inputbox, 'e', flag);
    333333                        else if(inputbox->input[aktpage] == 'e')
    334                                 inputboxchar(screen, inputbox, 'f', 0);
     334                                inputboxchar(screen, inputbox, 'f', flag);
    335335                        else if(inputbox->input[aktpage] == 'f')
    336                                 inputboxchar(screen, inputbox, 'D', 0);
     336                                inputboxchar(screen, inputbox, 'D', flag);
    337337                        else if(inputbox->input[aktpage] == 'D')
    338                                 inputboxchar(screen, inputbox, 'E', 0);
     338                                inputboxchar(screen, inputbox, 'E', flag);
    339339                        else if(inputbox->input[aktpage] == 'E')
    340                                 inputboxchar(screen, inputbox, 'F', 0);
     340                                inputboxchar(screen, inputbox, 'F', flag);
    341341                        else
    342                                 inputboxchar(screen, inputbox, '3', 0);
     342                                inputboxchar(screen, inputbox, '3', flag);
    343343                }
    344344                else
    345345                {
    346346                        inputboxchar(screen, inputbox, '3', 1);
    347                         inputboxright(screen, inputbox);
    348                 }
    349         }
    350 }
    351 
    352 void inputbox4(struct skin* screen, struct skin* inputbox)
     347                        inputboxright(screen, inputbox, flag);
     348                }
     349        }
     350}
     351
     352void inputbox4(struct skin* screen, struct skin* inputbox, int flag)
    353353{
    354354        if(inputbox != NULL && inputbox->input != NULL)
     
    359359                {
    360360                        if(inputbox->input[aktpage] == '4')
    361                                 inputboxchar(screen, inputbox, 'g', 0);
     361                                inputboxchar(screen, inputbox, 'g', flag);
    362362                        else if(inputbox->input[aktpage] == 'g')
    363                                 inputboxchar(screen, inputbox, 'h', 0);
     363                                inputboxchar(screen, inputbox, 'h', flag);
    364364                        else if(inputbox->input[aktpage] == 'h')
    365                                 inputboxchar(screen, inputbox, 'i', 0);
     365                                inputboxchar(screen, inputbox, 'i', flag);
    366366                        else if(inputbox->input[aktpage] == 'i')
    367                                 inputboxchar(screen, inputbox, 'G', 0);
     367                                inputboxchar(screen, inputbox, 'G', flag);
    368368                        else if(inputbox->input[aktpage] == 'G')
    369                                 inputboxchar(screen, inputbox, 'H', 0);
     369                                inputboxchar(screen, inputbox, 'H', flag);
    370370                        else if(inputbox->input[aktpage] == 'H')
    371                                 inputboxchar(screen, inputbox, 'I', 0);
     371                                inputboxchar(screen, inputbox, 'I', flag);
    372372                        else
    373                                 inputboxchar(screen, inputbox, '4', 0);
     373                                inputboxchar(screen, inputbox, '4', flag);
    374374                }
    375375                else
    376376                {
    377377                        inputboxchar(screen, inputbox, '4', 1);
    378                         inputboxright(screen, inputbox);
    379                 }
    380         }
    381 }
    382 
    383 void inputbox5(struct skin* screen, struct skin* inputbox)
     378                        inputboxright(screen, inputbox, flag);
     379                }
     380        }
     381}
     382
     383void inputbox5(struct skin* screen, struct skin* inputbox, int flag)
    384384{
    385385        if(inputbox != NULL && inputbox->input != NULL)
     
    390390                {
    391391                        if(inputbox->input[aktpage] == '5')
    392                                 inputboxchar(screen, inputbox, 'j', 0);
     392                                inputboxchar(screen, inputbox, 'j', flag);
    393393                        else if(inputbox->input[aktpage] == 'j')
    394                                 inputboxchar(screen, inputbox, 'k', 0);
     394                                inputboxchar(screen, inputbox, 'k', flag);
    395395                        else if(inputbox->input[aktpage] == 'k')
    396                                 inputboxchar(screen, inputbox, 'l', 0);
     396                                inputboxchar(screen, inputbox, 'l', flag);
    397397                        else if(inputbox->input[aktpage] == 'l')
    398                                 inputboxchar(screen, inputbox, 'J', 0);
     398                                inputboxchar(screen, inputbox, 'J', flag);
    399399                        else if(inputbox->input[aktpage] == 'J')
    400                                 inputboxchar(screen, inputbox, 'K', 0);
     400                                inputboxchar(screen, inputbox, 'K', flag);
    401401                        else if(inputbox->input[aktpage] == 'K')
    402                                 inputboxchar(screen, inputbox, 'L', 0);
     402                                inputboxchar(screen, inputbox, 'L', flag);
    403403                        else
    404                                 inputboxchar(screen, inputbox, '5', 0);
     404                                inputboxchar(screen, inputbox, '5', flag);
    405405                }
    406406                else
    407407                {
    408408                        inputboxchar(screen, inputbox, '5', 1);
    409                         inputboxright(screen, inputbox);
    410                 }
    411 
    412         }
    413 }
    414 
    415 void inputbox6(struct skin* screen, struct skin* inputbox)
     409                        inputboxright(screen, inputbox, flag);
     410                }
     411
     412        }
     413}
     414
     415void inputbox6(struct skin* screen, struct skin* inputbox, int flag)
    416416{
    417417        if(inputbox != NULL && inputbox->input != NULL)
     
    422422                {
    423423                        if(inputbox->input[aktpage] == '6')
    424                                 inputboxchar(screen, inputbox, 'm', 0);
     424                                inputboxchar(screen, inputbox, 'm', flag);
    425425                        else if(inputbox->input[aktpage] == 'm')
    426                                 inputboxchar(screen, inputbox, 'n', 0);
     426                                inputboxchar(screen, inputbox, 'n', flag);
    427427                        else if(inputbox->input[aktpage] == 'n')
    428                                 inputboxchar(screen, inputbox, 'o', 0);
     428                                inputboxchar(screen, inputbox, 'o', flag);
    429429                        else if(inputbox->input[aktpage] == 'o')
    430                                 inputboxchar(screen, inputbox, 'M', 0);
     430                                inputboxchar(screen, inputbox, 'M', flag);
    431431                        else if(inputbox->input[aktpage] == 'M')
    432                                 inputboxchar(screen, inputbox, 'N', 0);
     432                                inputboxchar(screen, inputbox, 'N', flag);
    433433                        else if(inputbox->input[aktpage] == 'N')
    434                                 inputboxchar(screen, inputbox, 'O', 0);
     434                                inputboxchar(screen, inputbox, 'O', flag);
    435435                        else
    436                                 inputboxchar(screen, inputbox, '6', 0);
     436                                inputboxchar(screen, inputbox, '6', flag);
    437437                }
    438438                else
    439439                {
    440440                        inputboxchar(screen, inputbox, '6', 1);
    441                         inputboxright(screen, inputbox);
    442                 }
    443         }
    444 }
    445 
    446 void inputbox7(struct skin* screen, struct skin* inputbox)
     441                        inputboxright(screen, inputbox, flag);
     442                }
     443        }
     444}
     445
     446void inputbox7(struct skin* screen, struct skin* inputbox, int flag)
    447447{
    448448        if(inputbox != NULL && inputbox->input != NULL)
     
    453453                {
    454454                        if(inputbox->input[aktpage] == '7')
    455                                 inputboxchar(screen, inputbox, 'p', 0);
     455                                inputboxchar(screen, inputbox, 'p', flag);
    456456                        else if(inputbox->input[aktpage] == 'p')
    457                                 inputboxchar(screen, inputbox, 'q', 0);
     457                                inputboxchar(screen, inputbox, 'q', flag);
    458458                        else if(inputbox->input[aktpage] == 'q')
    459                                 inputboxchar(screen, inputbox, 'r', 0);
     459                                inputboxchar(screen, inputbox, 'r', flag);
    460460                        else if(inputbox->input[aktpage] == 'r')
    461                                 inputboxchar(screen, inputbox, 's', 0);
     461                                inputboxchar(screen, inputbox, 's', flag);
    462462                        else if(inputbox->input[aktpage] == 's')
    463                                 inputboxchar(screen, inputbox, 'P', 0);
     463                                inputboxchar(screen, inputbox, 'P', flag);
    464464                        else if(inputbox->input[aktpage] == 'P')
    465                                 inputboxchar(screen, inputbox, 'Q', 0);
     465                                inputboxchar(screen, inputbox, 'Q', flag);
    466466                        else if(inputbox->input[aktpage] == 'Q')
    467                                 inputboxchar(screen, inputbox, 'R', 0);
     467                                inputboxchar(screen, inputbox, 'R', flag);
    468468                        else if(inputbox->input[aktpage] == 'R')
    469                                 inputboxchar(screen, inputbox, 'S', 0);
     469                                inputboxchar(screen, inputbox, 'S', flag);
    470470                        else
    471                                 inputboxchar(screen, inputbox, '7', 0);
     471                                inputboxchar(screen, inputbox, '7', flag);
    472472                }
    473473                else
    474474                {
    475475                        inputboxchar(screen, inputbox, '7', 1);
    476                         inputboxright(screen, inputbox);
    477                 }
    478         }
    479 }
    480 
    481 void inputbox8(struct skin* screen, struct skin* inputbox)
     476                        inputboxright(screen, inputbox, flag);
     477                }
     478        }
     479}
     480
     481void inputbox8(struct skin* screen, struct skin* inputbox, int flag)
    482482{
    483483        if(inputbox != NULL && inputbox->input != NULL)
     
    488488                {
    489489                        if(inputbox->input[aktpage] == '8')
    490                                 inputboxchar(screen, inputbox, 't', 0);
     490                                inputboxchar(screen, inputbox, 't', flag);
    491491                        else if(inputbox->input[aktpage] == 't')
    492                                 inputboxchar(screen, inputbox, 'u', 0);
     492                                inputboxchar(screen, inputbox, 'u', flag);
    493493                        else if(inputbox->input[aktpage] == 'u')
    494                                 inputboxchar(screen, inputbox, 'v', 0);
     494                                inputboxchar(screen, inputbox, 'v', flag);
    495495                        else if(inputbox->input[aktpage] == 'v')
    496                                 inputboxchar(screen, inputbox, 'T', 0);
     496                                inputboxchar(screen, inputbox, 'T', flag);
    497497                        else if(inputbox->input[aktpage] == 'T')
    498                                 inputboxchar(screen, inputbox, 'U', 0);
     498                                inputboxchar(screen, inputbox, 'U', flag);
    499499                        else if(inputbox->input[aktpage] == 'U')
    500                                 inputboxchar(screen, inputbox, 'V', 0);
     500                                inputboxchar(screen, inputbox, 'V', flag);
    501501                        else
    502                                 inputboxchar(screen, inputbox, '8', 0);
     502                                inputboxchar(screen, inputbox, '8', flag);
    503503                }
    504504                else
    505505                {
    506506                        inputboxchar(screen, inputbox, '8', 1);
    507                         inputboxright(screen, inputbox);
    508                 }
    509         }
    510 }
    511 
    512 void inputbox9(struct skin* screen, struct skin* inputbox)
     507                        inputboxright(screen, inputbox, flag);
     508                }
     509        }
     510}
     511
     512void inputbox9(struct skin* screen, struct skin* inputbox, int flag)
    513513{
    514514        if(inputbox != NULL && inputbox->input != NULL)
     
    519519                {
    520520                        if(inputbox->input[aktpage] == '9')
    521                                 inputboxchar(screen, inputbox, 'w', 0);
     521                                inputboxchar(screen, inputbox, 'w', flag);
    522522                        else if(inputbox->input[aktpage] == 'w')
    523                                 inputboxchar(screen, inputbox, 'x', 0);
     523                                inputboxchar(screen, inputbox, 'x', flag);
    524524                        else if(inputbox->input[aktpage] == 'x')
    525                                 inputboxchar(screen, inputbox, 'y', 0);
     525                                inputboxchar(screen, inputbox, 'y', flag);
    526526                        else if(inputbox->input[aktpage] == 'y')
    527                                 inputboxchar(screen, inputbox, 'z', 0);
     527                                inputboxchar(screen, inputbox, 'z', flag);
    528528                        else if(inputbox->input[aktpage] == 'z')
    529                                 inputboxchar(screen, inputbox, 'W', 0);
     529                                inputboxchar(screen, inputbox, 'W', flag);
    530530                        else if(inputbox->input[aktpage] == 'W')
    531                                 inputboxchar(screen, inputbox, 'X', 0);
     531                                inputboxchar(screen, inputbox, 'X', flag);
    532532                        else if(inputbox->input[aktpage] == 'X')
    533                                 inputboxchar(screen, inputbox, 'Y', 0);
     533                                inputboxchar(screen, inputbox, 'Y', flag);
    534534                        else if(inputbox->input[aktpage] == 'Y')
    535                                 inputboxchar(screen, inputbox, 'Z', 0);
     535                                inputboxchar(screen, inputbox, 'Z', flag);
    536536                        else
    537                                 inputboxchar(screen, inputbox, '9', 0);
     537                                inputboxchar(screen, inputbox, '9', flag);
    538538                }
    539539                else
    540540                {
    541541                        inputboxchar(screen, inputbox, '9', 1);
    542                         inputboxright(screen, inputbox);
    543                 }
    544         }
    545 }
    546 
    547 void choiceboxleft(struct skin* screen, struct skin* choicebox)
     542                        inputboxright(screen, inputbox, flag);
     543                }
     544        }
     545}
     546
     547void choiceboxleft(struct skin* screen, struct skin* choicebox, int flag)
    548548{
    549549        debug(1000, "in");
     
    554554                else
    555555                        choicebox->aktpage--;
    556                 drawscreen(screen, 0);
    557         }
    558         debug(1000, "out");
    559 }
    560 
    561 void choiceboxright(struct skin* screen, struct skin* choicebox)
     556                drawscreen(screen, flag);
     557        }
     558        debug(1000, "out");
     559}
     560
     561void choiceboxright(struct skin* screen, struct skin* choicebox, int flag)
    562562{
    563563        debug(1000, "in");
     
    571571                        choicebox->aktpage++;
    572572                }
    573                 drawscreen(screen, 0);
    574         }
    575         debug(1000, "out");
    576 }
    577 
    578 void griddown(struct skin* screen, struct skin* grid)
     573                drawscreen(screen, flag);
     574        }
     575        debug(1000, "out");
     576}
     577
     578void griddown(struct skin* screen, struct skin* grid, int flag)
    579579{
    580580        debug(1000, "in");
     
    631631
    632632                if(grid->select != NULL) delscreenrc(screen, grid->select);
    633                 drawscreen(screen, 0);
    634         }
    635 
    636         debug(1000, "out");
    637 }
    638 
    639 void gridup(struct skin* screen, struct skin* grid)
     633                drawscreen(screen, flag);
     634        }
     635
     636        debug(1000, "out");
     637}
     638
     639void gridup(struct skin* screen, struct skin* grid, int flag)
    640640{
    641641        debug(1000, "in");
     
    699699
    700700                if(grid->select != NULL) delscreenrc(screen, grid->select);
    701                 drawscreen(screen, 0);
    702         }
    703 
    704         debug(1000, "out");
    705 }
    706 
    707 void gridleft(struct skin* screen, struct skin* grid)
     701                drawscreen(screen, flag);
     702        }
     703
     704        debug(1000, "out");
     705}
     706
     707void gridleft(struct skin* screen, struct skin* grid, int flag)
    708708{
    709709        debug(1000, "in");
     
    736736
    737737                if(grid->select != NULL) delscreenrc(screen, grid->select);
    738                 drawscreen(screen, 0);
     738                drawscreen(screen, flag);
    739739                if(grid->select != NULL)
    740740                        grid->gridcol = grid->select->posx + (grid->select->width / 2);
     
    743743}
    744744
    745 void gridright(struct skin* screen, struct skin* grid)
     745void gridright(struct skin* screen, struct skin* grid, int flag)
    746746{
    747747        debug(1000, "in");
     
    776776
    777777                if(grid->select != NULL) delscreenrc(screen, grid->select);
    778                 drawscreen(screen, 0);
     778                drawscreen(screen, flag);
    779779                if(grid->select != NULL)
    780780                        grid->gridcol = grid->select->posx + (grid->select->width / 2);
     
    783783}
    784784
    785 void gridchup(struct skin* screen, struct skin* grid)
     785void gridchup(struct skin* screen, struct skin* grid, int flag)
    786786{
    787787        debug(1000, "in");
     
    794794                        grid->aktpage = 1;
    795795
    796                 drawscreen(screen, 0);
     796                drawscreen(screen, flag);
    797797                if(grid->select != NULL)
    798798                        grid->gridcol = grid->select->posx + (grid->select->width / 2);
     
    802802}
    803803
    804 void gridchdown(struct skin* screen, struct skin* grid)
     804void gridchdown(struct skin* screen, struct skin* grid, int flag)
    805805{
    806806        debug(1000, "in");
     
    816816                }
    817817
    818                 drawscreen(screen, 0);
     818                drawscreen(screen, flag);
    819819                if(grid->select != NULL)
    820820                        grid->gridcol = grid->select->posx + (grid->select->width / 2);
     
    825825
    826826
    827 void listboxleft(struct skin* screen, struct skin* listbox)
     827void listboxleft(struct skin* screen, struct skin* listbox, int flag)
    828828{
    829829        debug(1000, "in");
     
    837837
    838838                if(listbox->select != NULL) delscreenrc(screen, listbox->select);
    839                 drawscreen(screen, 0);
    840         }
    841 
    842         debug(1000, "out");
    843 }
    844 
    845 void listboxright(struct skin* screen, struct skin* listbox)
     839                drawscreen(screen, flag);
     840        }
     841
     842        debug(1000, "out");
     843}
     844
     845void listboxright(struct skin* screen, struct skin* listbox, int flag)
    846846{
    847847        debug(1000, "in");
     
    858858
    859859                if(listbox->select != NULL) delscreenrc(screen, listbox->select);
    860                 drawscreen(screen, 0);
    861         }
    862 
    863         debug(1000, "out");
    864 }
    865 
    866 void listboxup(struct skin* screen, struct skin* listbox)
     860                drawscreen(screen, flag);
     861        }
     862
     863        debug(1000, "out");
     864}
     865
     866void listboxup(struct skin* screen, struct skin* listbox, int flag)
    867867{
    868868        debug(1000, "in");
     
    876876
    877877                if(listbox->select != NULL) delscreenrc(screen, listbox->select);
    878                 drawscreen(screen, 0);
    879         }
    880         debug(1000, "out");
    881 }
    882 
    883 void listboxdown(struct skin* screen, struct skin* listbox)
     878                drawscreen(screen, flag);
     879        }
     880        debug(1000, "out");
     881}
     882
     883void listboxdown(struct skin* screen, struct skin* listbox, int flag)
    884884{
    885885        debug(1000, "in");
     
    894894
    895895                if(listbox->select != NULL) delscreenrc(screen, listbox->select);
    896                 drawscreen(screen, 0);
    897         }
    898         debug(1000, "out");
    899 }
    900 
    901 void textboxup(struct skin* screen, struct skin* textbox)
     896                drawscreen(screen, flag);
     897        }
     898        debug(1000, "out");
     899}
     900
     901void textboxup(struct skin* screen, struct skin* textbox, int flag)
    902902{
    903903        debug(1000, "in");
     
    907907                {
    908908                        textbox->aktpage--;
    909                         drawscreen(screen, 0);
    910                 }
    911         }
    912         debug(1000, "out");
    913 }
    914 
    915 void textboxdown(struct skin* screen, struct skin* textbox)
     909                        drawscreen(screen, flag);
     910                }
     911        }
     912        debug(1000, "out");
     913}
     914
     915void textboxdown(struct skin* screen, struct skin* textbox, int flag)
    916916{
    917917        debug(1000, "in");
     
    921921                {
    922922                        textbox->aktpage++;
    923                         drawscreen(screen, 0);
     923                        drawscreen(screen, flag);
    924924                }
    925925        }
  • titan/titan/skin.h

    r11088 r11112  
    676676                {
    677677                        changetitle(newnode, _(ret));
    678                         newnode->titlesize = newnode->fontsize + 6;
    679678                        free(ret);
    680679                }
     
    37193718                free(node->title);
    37203719                if(text != NULL)
     3720                {
    37213721                        node->title = strdup(text);
     3722                        node->titlesize = node->fontsize + 6;
     3723                }
    37223724                else
     3725                {
    37233726                        node->title = text;
     3727                        node->titlesize = 0;
     3728                }
    37243729                ret = 0;
    37253730        }
  • titan/titan/struct.h

    r11108 r11112  
    961961{
    962962        int key;
    963         void (*rcfunc)(struct skin*, struct skin*);
     963        void (*rcfunc)(struct skin*, struct skin*, int flag);
    964964        struct skin *screen;
    965965        struct skin *screennode;
  • titan/titan/textinput.h

    r11108 r11112  
    55{
    66        debug(1000, "in");
    7         int rcret = -1;
     7        int rcret = -1, tmpscreencalc = 0, fromthread = 0, height = 0;
    88        struct skin* textinput = getscreen("textinput");
    99        struct skin* input = getscreennode(textinput, "input");
    10         char* ret = NULL;
     10        struct skin* framebuffer = getscreen("framebuffer");
     11        char* ret = NULL, *bg = NULL;
    1112
    12         changeinput(textinput, title);
     13        if(pthread_self() != status.mainthread)
     14                fromthread = 1;
     15
     16        changetitle(textinput, title);
     17        height = textinput->height;
     18        if(title != NULL)
     19                textinput->height += textinput->fontsize + 6 + (textinput->bordersize * 2);
    1320        changeinput(input, text);
    1421
    15         drawscreen(textinput, 0);
     22        if(fromthread == 1)
     23        {
     24                m_lock(&status.drawingmutex, 0);
     25                m_lock(&status.rcmutex, 10);
     26                status.screencalc = 2;
     27                setnodeattr(textinput, framebuffer);
     28                status.screencalc = 0;
     29                status.rcowner = textinput;
     30                bg = savescreen(textinput);
     31                tmpscreencalc = status.screencalc;
     32                status.screencalc = 0;
     33                drawscreen(textinput, 2);
     34        }
     35        else
     36                drawscreen(textinput, 0);
    1637        addscreenrc(textinput, input);
    1738
     
    2849
    2950        delownerrc(textinput);
    30         clearscreen(textinput);
    31         drawscreen(skin, 0);
    3251
     52        if(fromthread == 1)
     53        {
     54                clearscreennolock(textinput);
     55                restorescreen(bg, textinput);
     56                blitfb();
     57                status.screencalc = tmpscreencalc;
     58                sleep(1);
     59                status.rcowner = NULL;
     60                m_unlock(&status.rcmutex, 3);
     61                m_unlock(&status.drawingmutex, 0);
     62        }
     63        else
     64        {
     65                clearscreen(textinput);
     66                drawscreen(skin, 0);
     67        }
     68
     69        textinput->height = height;
    3370        debug(1000, "out");
    34 
    3571        return ret;
    3672}
Note: See TracChangeset for help on using the changeset viewer.