]> git.saurik.com Git - wxWidgets.git/blobdiff - src/mac/carbon/colordlgosx.mm
check that the version of __sync_sub_and_fetch that returns a value is supported...
[wxWidgets.git] / src / mac / carbon / colordlgosx.mm
index 13a59e41687b110a0b34a90cb4177fae226c1e7c..ea058c24f73200b10688b6d275fd0d7b7e06ab86 100644 (file)
@@ -1,5 +1,5 @@
 /////////////////////////////////////////////////////////////////////////////
 /////////////////////////////////////////////////////////////////////////////
-// Name:        colordlg.cpp
+// Name:        src/mac/carbon/colordlg.mm
 // Purpose:     wxColourDialog class. NOTE: you can use the generic class
 //              if you wish, instead of implementing this.
 // Author:      Ryan Norton
 // Purpose:     wxColourDialog class. NOTE: you can use the generic class
 //              if you wish, instead of implementing this.
 // Author:      Ryan Norton
@@ -18,9 +18,7 @@
 // headers
 // ---------------------------------------------------------------------------
 
 // headers
 // ---------------------------------------------------------------------------
 
-#ifdef __GNUG__
-#pragma implementation "colordlg.h"
-#endif
+#include "wx/wxprec.h"
 
 #include "wx/mac/colordlg.h"
 #include "wx/fontdlg.h"
 
 #include "wx/mac/colordlg.h"
 #include "wx/fontdlg.h"
@@ -32,9 +30,7 @@
 //Mac OSX 10.2+ only
 #if USE_NATIVE_FONT_DIALOG_FOR_MACOSX
 
 //Mac OSX 10.2+ only
 #if USE_NATIVE_FONT_DIALOG_FOR_MACOSX
 
-#if !USE_SHARED_LIBRARY
 IMPLEMENT_DYNAMIC_CLASS(wxColourDialog, wxDialog)
 IMPLEMENT_DYNAMIC_CLASS(wxColourDialog, wxDialog)
-#endif
 
 // Cocoa headers
 #include "wx/cocoa/autorelease.h"
 
 // Cocoa headers
 #include "wx/cocoa/autorelease.h"
@@ -73,8 +69,10 @@ IMPLEMENT_DYNAMIC_CLASS(wxColourDialog, wxDialog)
 
 - (BOOL)windowShouldClose:(id)sender
 {
 
 - (BOOL)windowShouldClose:(id)sender
 {
+    wxUnusedVar(sender);
+
     m_bIsClosed = true;
     m_bIsClosed = true;
-    
+
     [NSApp abortModal];
     [NSApp stopModal];
     return YES;
     [NSApp abortModal];
     [NSApp stopModal];
     return YES;
@@ -104,7 +102,7 @@ wxColourDialog::wxColourDialog(wxWindow *parent, wxColourData *data)
 bool wxColourDialog::Create(wxWindow *parent, wxColourData *data)
 {
     m_dialogParent = parent;
 bool wxColourDialog::Create(wxWindow *parent, wxColourData *data)
 {
     m_dialogParent = parent;
-  
+
     if (data)
         m_colourData = *data;
 
     if (data)
         m_colourData = *data;
 
@@ -113,7 +111,7 @@ bool wxColourDialog::Create(wxWindow *parent, wxColourData *data)
     // events and window stuff for cocoa for carbon
     // applications.
     //
     // events and window stuff for cocoa for carbon
     // applications.
     //
-    // This is also the only call here that is 
+    // This is also the only call here that is
     // 10.2+ specific (the rest is OSX only),
     // which, ironically, the carbon font
     // panel requires.
     // 10.2+ specific (the rest is OSX only),
     // which, ironically, the carbon font
     // panel requires.
@@ -132,16 +130,16 @@ bool wxColourDialog::Create(wxWindow *parent, wxColourData *data)
                                         alpha:1.0]
         ];
     else
                                         alpha:1.0]
         ];
     else
-        [[NSColorPanel sharedColorPanel] setColor:[NSColor blackColor]];        
-        
+        [[NSColorPanel sharedColorPanel] setColor:[NSColor blackColor]];
+
     //We're done - free up the pool
     [thePool release];
     //We're done - free up the pool
     [thePool release];
-    
+
     return bOK;
 }
 int wxColourDialog::ShowModal()
 {
     return bOK;
 }
 int wxColourDialog::ShowModal()
 {
-    //Start the pool.  Required for carbon interaction 
+    //Start the pool.  Required for carbon interaction
     //(For those curious, the only thing that happens
     //if you don't do this is a bunch of error
     //messages about leaks on the console,
     //(For those curious, the only thing that happens
     //if you don't do this is a bunch of error
     //messages about leaks on the console,
@@ -156,27 +154,27 @@ int wxColourDialog::ShowModal()
     //we can tell if a window has closed/open or not
     wxCPWCDelegate* theCPDelegate = [[wxCPWCDelegate alloc] init];
     [theColorPanel setDelegate:theCPDelegate];
     //we can tell if a window has closed/open or not
     wxCPWCDelegate* theCPDelegate = [[wxCPWCDelegate alloc] init];
     [theColorPanel setDelegate:theCPDelegate];
-      
+
             //
             // Start the color panel modal loop
             //
             NSModalSession session = [NSApp beginModalSessionForWindow:theColorPanel];
             //
             // Start the color panel modal loop
             //
             NSModalSession session = [NSApp beginModalSessionForWindow:theColorPanel];
-            for (;;) 
+            for (;;)
             {
                 [NSApp runModalSession:session];
             {
                 [NSApp runModalSession:session];
-                
+
                 //If the color panel is closed, return the font panel modal loop
                 if ([theCPDelegate isClosed])
                     break;
             }
             [NSApp endModalSession:session];
                 //If the color panel is closed, return the font panel modal loop
                 if ([theCPDelegate isClosed])
                     break;
             }
             [NSApp endModalSession:session];
-    
+
     //free up the memory for the delegates - we don't need them anymore
     [theCPDelegate release];
     //free up the memory for the delegates - we don't need them anymore
     [theCPDelegate release];
-                                            
+
     //Get the shared color panel along with the chosen color and set the chosen color
     NSColor* theColor = [[theColorPanel color] colorUsingColorSpaceName:NSCalibratedRGBColorSpace];
     //Get the shared color panel along with the chosen color and set the chosen color
     NSColor* theColor = [[theColorPanel color] colorUsingColorSpaceName:NSCalibratedRGBColorSpace];
-                                    
+
     m_colourData.m_dataColour.Set(
                                 (unsigned char) ([theColor redComponent] * 255.0),
                                 (unsigned char) ([theColor greenComponent] * 255.0),
     m_colourData.m_dataColour.Set(
                                 (unsigned char) ([theColor redComponent] * 255.0),
                                 (unsigned char) ([theColor greenComponent] * 255.0),