- Timestamp:
- 06/27/08 20:28:03 (5 months ago)
- Files:
-
- 1 modified
-
lang/c/SDL_textmanager/test/main.c (modified) (8 diffs)
Legend:
- Unmodified
- Added
- Removed
-
lang/c/SDL_textmanager/test/main.c
r238 r14713 422 422 FILE *testFp; 423 423 Uint16 inputedChar; 424 TextManager_DeadChar previousDeadChar;425 424 426 425 if (SDL_Init(SDL_INIT_VIDEO) < 0) { … … 457 456 SDL_FreeSurface(surface); 458 457 459 if (TextManager_Init() != INPUT_METHOD_SUCCESS) {458 if (TextManager_Init() != TEXT_MANAGER_SUCCESS) { 460 459 printf("TextManager_Init(): %d\n", TextManager_Init()); 461 460 printf("%s\n", SDL_GetError()); … … 505 504 inputedString[0] = 0x0000; 506 505 inputedWidth = 0; 507 previousDeadChar = DEAD_CHAR_NON;508 506 while(1) { 509 507 if (SDL_PollEvent(&e) != 0){ … … 523 521 524 522 switch (TextManager_GetCurrentMessage()) { 525 case INPUT_METHOD_MESSAGE_IM_ON:523 case TEXT_MANAGER_MESSAGE_IM_ON: 526 524 rect.x = 0; 527 525 rect.y = 100; … … 535 533 DrawCursor(back, font, inputedWidth); 536 534 break; 537 case INPUT_METHOD_MESSAGE_IM_CHANGE:535 case TEXT_MANAGER_MESSAGE_IM_CHANGE: 538 536 MessageChange(back, font, inputedWidth); 539 537 break; 540 case INPUT_METHOD_MESSAGE_IM_RESULT:538 case TEXT_MANAGER_MESSAGE_IM_RESULT: 541 539 stringLength = 542 540 GetUnicodeStringLength(inputedString) + … … 556 554 DrawCursor(back, font, inputedWidth); 557 555 break; 558 case INPUT_METHOD_MESSAGE_CHAR:556 case TEXT_MANAGER_MESSAGE_CHAR: 559 557 stringLength = 560 558 GetUnicodeStringLength(inputedString) + 1; 561 559 needSize = stringLength * sizeof(Uint16) + sizeof(Uint16); 562 560 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(); 569 562 inputedString[stringLength - 1] = inputedChar; 563 printf("SHIT: %x\n", inputedChar); 570 564 inputedString[stringLength] = 0x0000; 571 565 … … 577 571 DrawCursor(back, font, inputedWidth); 578 572 break; 579 case INPUT_METHOD_MESSAGE_IM_OFF:573 case TEXT_MANAGER_MESSAGE_IM_OFF: 580 574 rect.x = 0; 581 575 rect.y = 100; … … 592 586 } 593 587 switch (TextManager_GetCurrentMessage()) { 594 case INPUT_METHOD_MESSAGE_DEAD_CHAR:595 previousDeadChar = TextManager_GetCurrentDeadChar();596 break;597 588 default: 598 previousDeadChar = DEAD_CHAR_NON;599 589 break; 600 590 }
![(please configure the [header_logo] section in trac.ini)](/share/chrome/site/your_project_logo.png)