Changeset 14713 for lang/c

Show
Ignore:
Timestamp:
06/27/08 20:28:03 (5 months ago)
Author:
itkz
Message:

update test

Files:
1 modified

Legend:

Unmodified
Added
Removed
  • lang/c/SDL_textmanager/test/main.c

    r238 r14713  
    422422        FILE *testFp; 
    423423        Uint16 inputedChar; 
    424         TextManager_DeadChar previousDeadChar; 
    425424         
    426425        if (SDL_Init(SDL_INIT_VIDEO) < 0) { 
     
    457456        SDL_FreeSurface(surface); 
    458457         
    459         if (TextManager_Init() != INPUT_METHOD_SUCCESS) { 
     458        if (TextManager_Init() != TEXT_MANAGER_SUCCESS) { 
    460459                printf("TextManager_Init(): %d\n", TextManager_Init()); 
    461460                printf("%s\n", SDL_GetError()); 
     
    505504        inputedString[0] = 0x0000; 
    506505        inputedWidth = 0; 
    507         previousDeadChar = DEAD_CHAR_NON; 
    508506        while(1) { 
    509507                if (SDL_PollEvent(&e) != 0){ 
     
    523521                                 
    524522                                switch (TextManager_GetCurrentMessage()) { 
    525                                 case INPUT_METHOD_MESSAGE_IM_ON: 
     523                                case TEXT_MANAGER_MESSAGE_IM_ON: 
    526524                                        rect.x = 0; 
    527525                                        rect.y = 100; 
     
    535533                                        DrawCursor(back, font, inputedWidth); 
    536534                                        break; 
    537                                 case INPUT_METHOD_MESSAGE_IM_CHANGE: 
     535                                case TEXT_MANAGER_MESSAGE_IM_CHANGE: 
    538536                                        MessageChange(back, font, inputedWidth); 
    539537                                        break; 
    540                                 case INPUT_METHOD_MESSAGE_IM_RESULT: 
     538                                case TEXT_MANAGER_MESSAGE_IM_RESULT: 
    541539                                        stringLength = 
    542540                                                GetUnicodeStringLength(inputedString) + 
     
    556554                                        DrawCursor(back, font, inputedWidth); 
    557555                                        break; 
    558                                 case INPUT_METHOD_MESSAGE_CHAR: 
     556                                case TEXT_MANAGER_MESSAGE_CHAR: 
    559557                                        stringLength = 
    560558                                                GetUnicodeStringLength(inputedString) + 1; 
    561559                                        needSize = stringLength * sizeof(Uint16) + sizeof(Uint16); 
    562560                                        inputedString = realloc(inputedString, needSize); 
    563                                         if (previousDeadChar == DEAD_CHAR_NON) { 
    564                                                 inputedChar = TextManager_GetCurrentChar(); 
    565                                         } else { 
    566                                                 inputedChar = TextManager_CombineDeadKey( 
    567                                                         previousDeadChar, TextManager_GetCurrentChar()); 
    568                                         } 
     561                                        inputedChar = TextManager_GetCurrentChar(); 
    569562                                        inputedString[stringLength - 1] = inputedChar; 
     563printf("SHIT: %x\n", inputedChar); 
    570564                                        inputedString[stringLength] = 0x0000; 
    571565                                         
     
    577571                                        DrawCursor(back, font, inputedWidth); 
    578572                                        break; 
    579                                 case INPUT_METHOD_MESSAGE_IM_OFF: 
     573                                case TEXT_MANAGER_MESSAGE_IM_OFF: 
    580574                                        rect.x = 0; 
    581575                                        rect.y = 100; 
     
    592586                                } 
    593587                                switch (TextManager_GetCurrentMessage()) { 
    594                                 case INPUT_METHOD_MESSAGE_DEAD_CHAR: 
    595                                         previousDeadChar = TextManager_GetCurrentDeadChar(); 
    596                                         break; 
    597588                                default: 
    598                                         previousDeadChar = DEAD_CHAR_NON; 
    599589                                        break; 
    600590                                }