Changeset 34483

Show
Ignore:
Timestamp:
07/19/09 21:08:01 (4 years ago)
Author:
saturday06
Message:

asdf

Location:
lang/objective-cplusplus/i3/trunk/src
Files:
2 modified

Legend:

Unmodified
Added
Removed
  • lang/objective-cplusplus/i3/trunk/src/Mediator.h

    r34477 r34483  
    44 
    55#pragma once 
     6#include "Common.h" 
     7#include "InputWindow.h" 
     8#include "OutputWindow.h" 
     9#include "CompletionWindow.h" 
     10#include "Delegate.h" 
     11#include "ShellManager.h" 
    612 
    713namespace i3 { 
    8     class Mediator : public boost::noncopyable { 
    9         CompletionWindow completionWindow; 
    10         InputWindow inputWindow; 
    11         OutputWindow outputWindow; 
    12         ShellManager shellManager; 
    13         Delegate delegate; 
    14     public: 
    15         Mediator(): 
    16         completionWindow(*this), 
    17             inputWindow(*this), 
    18             outputWindow(*this), 
    19             shellManager(*this), 
    20             delegate(*this) { 
    21         } 
    2214 
    23         exit_status start() { 
    24 #if !defined(MIL_GUI_COCOA) || defined(__APPLE__) 
    25             // threaded 
    26             inputWindow.createGui(); 
    27             completionWindow.start(); 
    28             outputWindow.start(); 
    29             shellManager.start(); 
    30             delegate.start(); 
    31             inputWindow.run(); 
    32 #else 
    33             // no threaded gui 
    34             debug << "no threaded gui"; 
    35             completionWindow.createGui(); 
    36             outputWindow.createGui(); 
    37             inputWindow.createGui(); 
    38             shellManager.start(); 
    39  
    40             debug << "before loop"; 
    41  
    42             global_loop(); 
    43 #endif 
    44             delegate.destroy(); 
    45             return 0; 
    46         } 
    47         CompletionWindow& getCompletionWindow() { 
    48             return completionWindow; 
    49         } 
    50         OutputWindow& getOutputWindow() { 
    51             return outputWindow; 
    52         } 
    53         InputWindow& getInputWindow() { 
    54             return inputWindow; 
    55         } 
    56         ShellManager& getShellManager() { 
    57             return shellManager; 
    58         } 
    59         Delegate& getDelegate() { 
    60             return delegate; 
    61         } 
    62     }; 
     15class Mediator : public boost::noncopyable { 
     16    CompletionWindow completionWindow; 
     17    InputWindow inputWindow; 
     18    OutputWindow outputWindow; 
     19    ShellManager shellManager; 
     20    Delegate delegate; 
     21public: 
     22    CompletionWindow& getCompletionWindow(); 
     23    OutputWindow& getOutputWindow(); 
     24    InputWindow& getInputWindow(); 
     25    ShellManager& getShellManager(); 
     26    Delegate& getDelegate(); 
     27    Mediator(); 
     28    ~Mediator(); 
     29    exit_status start(); 
     30}; 
    6331 
    6432} 
    65  
  • lang/objective-cplusplus/i3/trunk/src/gui-windows/GuiTest1.cpp

    r34447 r34483  
    11#include <PrecompiledHeaders.h> 
    22#include <quicktest/quicktest.h> 
     3#include "Common.h" 
     4 
     5using namespace i3; 
    36 
    47QT_TEST(aaaaaoiesfaio) { 
     
    2427    }; 
    2528#endif 
    26     init_windows_gettext(); 
    2729 
     30    int argc = 0; 
     31    char** argv = NULL; 
     32    init_os_global_data(argc, argv); 
     33    init_gui_global_data(argc, argv); 
     34     
    2835    basic_string<TCHAR> got; 
    2936 
    30     QT_CHECK(putenv("LANGUAGE=en") == 0); 
     37    char language_en[] = "LANGUAGE=en"; 
     38    QT_CHECK_EQUAL(putenv(language_en), 0); 
    3139    got = (const TCHAR*)_("Hello, world!"); 
    32     QT_CHECK(got == _T("Hello, world!")); 
     40    QT_CHECK_EQUAL(got, _T("Hello, world!")); 
    3341 
    34     QT_CHECK(putenv("LANGUAGE=ja") == 0); 
     42    char language_ja[] = "LANGUAGE=ja"; 
     43    QT_CHECK_EQUAL(putenv(language_ja), 0); 
    3544    got = (const TCHAR*)_("Hello, world!"); 
    36     QT_CHECK(got == hello_world_ja); 
     45    QT_CHECK_EQUAL(got, hello_world_ja); 
    3746 
    38     QT_CHECK(putenv("LANGUAGE=en") == 0); 
     47    char language_de[] = "LANGUAGE=de"; 
     48    QT_CHECK_EQUAL(putenv(language_de), 0); 
    3949    got = (const TCHAR*)_("Hello, world!"); 
    40     QT_CHECK(got == _T("Hello, world!")); 
     50    QT_CHECK_EQUAL(got, _T("Hallo, Welt!")); 
     51 
     52    QT_CHECK_EQUAL(putenv(language_ja), 0); 
     53    got = (const TCHAR*)_("Hello, world!"); 
     54    QT_CHECK_EQUAL(got, hello_world_ja); 
     55 
     56    QT_CHECK_EQUAL(putenv(language_en), 0); 
     57    got = (const TCHAR*)_("Hello, world!"); 
     58    QT_CHECK_EQUAL(got, _T("Hello, world!")); 
     59 
     60    QT_CHECK_EQUAL(putenv(language_de), 0); 
     61    got = (const TCHAR*)_("Hello, world!"); 
     62    QT_CHECK_EQUAL(got, _T("Hallo, Welt!")); 
    4163} 
    4264