Changeset 30283 for lang/cplusplus

Show
Ignore:
Timestamp:
02/19/09 21:12:06 (4 years ago)
Author:
saturday06
Message:

mjk

Location:
lang/cplusplus/i3/trunk
Files:
4 modified

Legend:

Unmodified
Added
Removed
  • lang/cplusplus/i3/trunk/am/i3.am

    r30282 r30283  
    6262#i3_LDFLAGS_DEFAULT  += /mingw/lib/binmode.o -mwindows 
    6363i3_LDFLAGS_DEFAULT  += -mwindows 
     64i3_LDADD_DEFAULT    += -lgdi32 -luser32 -lpsapi -lshlwapi 
    6465else 
    6566if WITH_GUI_WINDOWS 
  • lang/cplusplus/i3/trunk/src/Initial.h

    r30276 r30283  
    1313#define _WIN32_WINNT 0x0400 // NT4.0 
    1414#define WINVER       0x0400 // Windows 95 
    15  
    16 // ! 
    17 #include <mol/os-windows/PrecompiledHeaders.h> 
    1815#endif 
    1916 
    20 // !!! 
    21 #define COCOA_NO_CAST_FROM_ASCII 
    22  
  • lang/cplusplus/i3/trunk/src/gui-gnustep/CompletionWindowCore.h

    r20479 r30283  
    44 
    55#pragma once 
     6#include <mol/GuiModule.h> 
    67#include "Common.h" 
    7 #include "CompletionWindowCore.h" 
    88 
    99namespace i3 
  • lang/cplusplus/i3/trunk/src/gui-gnustep/Gui.cpp

    r30276 r30283  
    11#include <PrecompiledHeaders.h> 
    22#include "Common.h" 
     3 
     4@interface MyDelegate : NSObject 
     5{ 
     6    NSWindow *myWindow; 
     7} 
     8- (void) createMenu; 
     9- (void) createWindow; 
     10- (void) applicationWillFinishLaunching: (NSNotification *)not; 
     11- (void) applicationDidFinishLaunching: (NSNotification *)not; 
     12@end 
     13 
     14@implementation MyDelegate : NSObject  
     15- (void) dealloc 
     16{ 
     17    RELEASE (myWindow); 
     18} 
     19 
     20- (void) createMenu 
     21{ 
     22    NSMenu *menu; 
     23 
     24    menu = AUTORELEASE ([NSMenu new]); 
     25 
     26    [menu addItemWithTitle: @"Quit"   
     27          action: @selector (terminate:)   
     28          keyEquivalent: @"q"]; 
     29 
     30    [NSApp setMainMenu: menu]; 
     31} 
     32 
     33- (void) createWindow 
     34{ 
     35    NSRect rect = NSMakeRect (100, 100, 200, 200); 
     36    unsigned int styleMask = NSTitledWindowMask  
     37        | NSMiniaturizableWindowMask; 
     38 
     39 
     40    myWindow = [NSWindow alloc]; 
     41    myWindow = [myWindow initWithContentRect: rect 
     42                         styleMask: styleMask 
     43                         backing: NSBackingStoreBuffered 
     44                         defer: NO]; 
     45    [myWindow setTitle: @"This is a test window"]; 
     46} 
     47 
     48- (void) applicationWillFinishLaunching: (NSNotification *)not 
     49{ 
     50    [self createMenu]; 
     51    [self createWindow]; 
     52} 
     53 
     54- (void) applicationDidFinishLaunching: (NSNotification *)not; 
     55{ 
     56    [myWindow makeKeyAndOrderFront: nil]; 
     57} 
     58@end 
    359 
    460namespace i3 
    561{ 
    662 
    7 const char* COCOA_CODESET = "UTF-16LE"; 
     63    void alert(string message) 
     64    { 
     65    } 
    866 
    9 void alert(string message) 
    10 { 
     67    exit_status init_gui_global_data(int argc, const char** argv) 
     68    { 
     69        using namespace std; 
     70#ifdef MOL_OS_UNIX 
     71        if (setlocale(LC_ALL, "") != NULL) 
     72        { 
     73            bindtextdomain(PACKAGE_NAME, LOCALEDIR); 
     74            textdomain(PACKAGE_NAME); 
     75            bind_textdomain_codeset(PACKAGE_NAME, COCOA_CODESET); 
     76        } 
     77#else 
     78        init_windows_gettext(); 
     79#endif 
     80 
     81        [NSApplication sharedApplication]; 
     82        [NSApp setDelegate: [MyDelegate new]]; 
     83 
     84        return 0; 
     85    } 
    1186} 
    1287 
    13 exit_status init_gui_global_data(int& argc,char**& argv) 
    14 { 
    15     using namespace std; 
    16 #ifdef MOL_OS_UNIX 
    17     if (setlocale(LC_ALL, "") != NULL) 
    18     { 
    19         bindtextdomain(PACKAGE_NAME, LOCALEDIR); 
    20         textdomain(PACKAGE_NAME); 
    21         bind_textdomain_codeset(PACKAGE_NAME, COCOA_CODESET); 
    22     } 
    23 #else 
    24     init_windows_gettext(); 
    25 #endif 
    26     QApplication app(argc, argv); 
    27     QString qs = _("Hello, world!"); 
    28     QLabel* label(new QLabel(qs)); 
    29     label->show(); 
    30     int r = app.exec(); 
    31     return 0; 
    32 } 
    33 } 
    34