Changeset 36221

Show
Ignore:
Timestamp:
12/21/09 03:12:38 (5 years ago)
Author:
saturday06
Message:

moutukaretao

Location:
lang/objective-cplusplus/i3/trunk
Files:
11 modified

Legend:

Unmodified
Added
Removed
  • lang/objective-cplusplus/i3/trunk/configure.ac

    r36217 r36221  
    188188            ]])], 
    189189        [], 
    190         [AC_MSG_FAILURE([Objective program does not work])], 
     190        [AC_MSG_FAILURE([Objective-C program does not work])], 
    191191        []) 
    192192 
  • lang/objective-cplusplus/i3/trunk/po/POTFILES.in

    r36216 r36221  
    3535src/mil/include/mil/Synchronize.h 
    3636src/mil/include/mil/Thread.h 
    37 src/mil/include/mil/Thread2.h 
    3837src/mil/include/mil/gui-cocoa/CocoaThread.h 
    3938src/mil/include/mil/gui-cocoa/Gui.h 
  • lang/objective-cplusplus/i3/trunk/src/Mediator.cpp

    r36210 r36221  
    2121#if !defined(MIL_GUI_COCOA) || defined(__APPLE__) 
    2222    // threaded 
    23     inputWindow.createUI(); 
    24     //completionWindow.start(); 
    25     //outputWindow.start(); 
    26     //shellManager.start(); 
    27     //delegate.start(); 
     23    //inputWindow.createUI(); 
     24    completionWindow.start(); 
     25    outputWindow.start(); 
     26    shellManager.start(); 
     27    delegate.start(); 
    2828#ifdef I3_TEST 
    2929    inputWindow.start(); 
  • lang/objective-cplusplus/i3/trunk/src/Test2.cpp

    r35623 r36221  
    1212    int argc = 0; 
    1313    char** argv = NULL; 
    14     init_os_global_data(argc, argv); 
    15     init_gui_global_data(argc, argv); 
    1614 
    1715    TCHAR temp[STACKABLE_MAX_PATH] = {}; 
  • lang/objective-cplusplus/i3/trunk/src/Test4.cpp

    r36088 r36221  
    1818        int argc = _countof(argv); 
    1919 
    20     exit_status exit_status; 
     20    int exit_status; 
     21 
     22    exit_status = init_common_global_data(argc, argv); 
     23    QT_CHECK(!exit_status); 
    2124 
    2225    exit_status = init_os_global_data(argc, argv); 
  • lang/objective-cplusplus/i3/trunk/src/Tester.cpp

    r36214 r36221  
    88Tester* tester_ptr = NULL; 
    99 
    10 #define CHECK_VALID { if (!valid) { throw std::logic_error("Tester"); } } 
     10#define CHECK_VALID { if (!valid) { throw std::logic_error("Tester"); }} 
    1111 
    1212Tester::Tester() : mediator(*(std::auto_ptr<Mediator>(new Mediator()))), valid(false), passed(true), index(0) { 
     
    3131        CHECK_VALID; 
    3232 
    33     std::cout << "Test [" << getName() << "] passed" << std::endl; 
     33    //std::cout << "Test [" << getName() << "] passed" << std::endl; 
    3434        synchronized (mutex) { 
    3535                passed = true; 
     
    5858            } 
    5959            if (!startNext()) { 
    60                                 debug << "run() return"; 
     60                                //debug << "run() return"; 
    6161                return; 
    6262            } 
     
    9292} 
    9393 
     94struct Focus { 
     95}; 
     96 
     97template <> 
     98void InputWindow::execute(Focus&) { 
     99        SetForegroundWindow(hLocalWnd); 
     100        SetFocus(hEdit); 
     101} 
     102 
     103void simple_input(Tester& t) { 
     104    t.next("simple input"); 
     105    Focus f; 
     106    t.mediator.getInputWindow().post(f, t); 
     107        sleep(1); 
     108 
     109    keybd_event('F', 0, 0, 0 ); 
     110        keybd_event('F', 0, KEYEVENTF_KEYUP, 0); 
     111    keybd_event('O', 0, 0, 0 ); 
     112        keybd_event('O', 0, KEYEVENTF_KEYUP, 0); 
     113    keybd_event('O', 0, 0, 0 ); 
     114        keybd_event('O', 0, KEYEVENTF_KEYUP, 0); 
     115     
     116        keybd_event(VK_RETURN, 0, 0, 0 ); 
     117    keybd_event(VK_RETURN, 0, KEYEVENTF_KEYUP, 0); 
     118} 
     119 
    94120static void (*tester_tests[])(Tester&) = { 
    95121    simple_ping, 
    96122    simple_ping2, 
    97123    simple_ping, 
     124        simple_input, 
    98125}; 
    99126 
  • lang/objective-cplusplus/i3/trunk/src/gui-windows/InputWindowPlatform.cpp

    r36130 r36221  
    1414    TCHAR* command; 
    1515}; 
     16 
     17template <> 
     18void ShellManager::beforeExecute(ExecuteEvent& e) { 
     19        if (tester.getName() == "simple input") { 
     20                QT_CHECK(i3::string(e.command) == _T("foo")); 
     21                tester.pass(); 
     22        } 
     23} 
    1624 
    1725template <> 
     
    466474void InputWindowPlatform<InputWindow>::createUI() { 
    467475    if (hLocalWnd) { 
     476                debug << "createUI re-called"; 
     477                if (!IsWindow(hLocalWnd)) { 
     478                        debug << "hLocalWnd is not window"; 
     479                } 
    468480        return; 
    469481    } 
     
    740752    createUI(); 
    741753    UpdateWindow(hLocalWnd); 
    742     ShowWindow(hLocalWnd, SW_SHOW); 
     754    ShowWindowAsync(hLocalWnd, SW_SHOW); 
    743755    loop(); 
    744756} 
  • lang/objective-cplusplus/i3/trunk/src/mil/include/mil/gui-windows/GuiModule.h

    r35976 r36221  
    153153        } 
    154154 
     155                assert(GetWindowThreadProcessId(this->hLocalWnd, NULL) == GetCurrentThreadId()); 
     156                 
    155157        MSG msg = {}; 
    156158        //while (__builtin_expect(!breakLoopRequest, true)) 
  • lang/objective-cplusplus/i3/trunk/src/mil/include/mil/os-windows/Debug.h

    r36216 r36221  
    175175        cout << data.str() << "," << file << ":" << line << ",last_error=" << last_error << flush; 
    176176 
    177         LPVOID buf = NULL; 
     177        char* buf = NULL; 
    178178        if (FormatMessageA( 
    179179                FORMAT_MESSAGE_ALLOCATE_BUFFER | 
    180180                FORMAT_MESSAGE_FROM_SYSTEM | 
    181                 FORMAT_MESSAGE_IGNORE_INSERTS|FORMAT_MESSAGE_MAX_WIDTH_MASK, 
     181                FORMAT_MESSAGE_IGNORE_INSERTS| 
     182                                FORMAT_MESSAGE_MAX_WIDTH_MASK, 
    182183                NULL, 
    183184                last_error, 
  • lang/objective-cplusplus/i3/trunk/src/mil/src/test/Main.cpp

    r36214 r36221  
    1010}  
    1111 
    12 int start(int argc, char** argv) {  
     12int start(int argc, char** argv) { 
     13 
    1314#ifdef MIL_GUI_COCOA 
    1415    [NSApplication sharedApplication]; 
  • lang/objective-cplusplus/i3/trunk/src/os-windows/Os.h

    r35906 r36221  
    1919namespace i3 { 
    2020//typedef ::TCHAR TCHAR; 
    21 exit_status check_args(); 
     21int check_args(); 
    2222 
    2323struct Os {