Changeset 34483
- Timestamp:
- 07/19/09 21:08:01 (4 years ago)
- Location:
- lang/objective-cplusplus/i3/trunk/src
- Files:
-
- 2 modified
-
Mediator.h (modified) (1 diff)
-
gui-windows/GuiTest1.cpp (modified) (2 diffs)
Legend:
- Unmodified
- Added
- Removed
-
lang/objective-cplusplus/i3/trunk/src/Mediator.h
r34477 r34483 4 4 5 5 #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" 6 12 7 13 namespace 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 }22 14 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 }; 15 class Mediator : public boost::noncopyable { 16 CompletionWindow completionWindow; 17 InputWindow inputWindow; 18 OutputWindow outputWindow; 19 ShellManager shellManager; 20 Delegate delegate; 21 public: 22 CompletionWindow& getCompletionWindow(); 23 OutputWindow& getOutputWindow(); 24 InputWindow& getInputWindow(); 25 ShellManager& getShellManager(); 26 Delegate& getDelegate(); 27 Mediator(); 28 ~Mediator(); 29 exit_status start(); 30 }; 63 31 64 32 } 65 -
lang/objective-cplusplus/i3/trunk/src/gui-windows/GuiTest1.cpp
r34447 r34483 1 1 #include <PrecompiledHeaders.h> 2 2 #include <quicktest/quicktest.h> 3 #include "Common.h" 4 5 using namespace i3; 3 6 4 7 QT_TEST(aaaaaoiesfaio) { … … 24 27 }; 25 28 #endif 26 init_windows_gettext();27 29 30 int argc = 0; 31 char** argv = NULL; 32 init_os_global_data(argc, argv); 33 init_gui_global_data(argc, argv); 34 28 35 basic_string<TCHAR> got; 29 36 30 QT_CHECK(putenv("LANGUAGE=en") == 0); 37 char language_en[] = "LANGUAGE=en"; 38 QT_CHECK_EQUAL(putenv(language_en), 0); 31 39 got = (const TCHAR*)_("Hello, world!"); 32 QT_CHECK (got ==_T("Hello, world!"));40 QT_CHECK_EQUAL(got, _T("Hello, world!")); 33 41 34 QT_CHECK(putenv("LANGUAGE=ja") == 0); 42 char language_ja[] = "LANGUAGE=ja"; 43 QT_CHECK_EQUAL(putenv(language_ja), 0); 35 44 got = (const TCHAR*)_("Hello, world!"); 36 QT_CHECK (got ==hello_world_ja);45 QT_CHECK_EQUAL(got, hello_world_ja); 37 46 38 QT_CHECK(putenv("LANGUAGE=en") == 0); 47 char language_de[] = "LANGUAGE=de"; 48 QT_CHECK_EQUAL(putenv(language_de), 0); 39 49 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!")); 41 63 } 42 64
![(please configure the [header_logo] section in trac.ini)](/share/chrome/site/your_project_logo.png)