]> git.saurik.com Git - wxWidgets.git/commitdiff
Include wx/cursor.h according to precompiled headers of wx/wx.h (with other minor...
authorWłodzimierz Skiba <abx@abx.art.pl>
Mon, 22 May 2006 07:11:26 +0000 (07:11 +0000)
committerWłodzimierz Skiba <abx@abx.art.pl>
Mon, 22 May 2006 07:11:26 +0000 (07:11 +0000)
git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@39264 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775

15 files changed:
src/cocoa/cursor.mm
src/common/gdicmn.cpp
src/gtk/data.cpp
src/gtk/dialog.cpp
src/gtk/popupwin.cpp
src/gtk1/data.cpp
src/gtk1/dialog.cpp
src/gtk1/popupwin.cpp
src/mac/carbon/app.cpp
src/mac/classic/app.cpp
src/mgl/data.cpp
src/msw/cursor.cpp
src/os2/cursor.cpp
src/palmos/cursor.cpp
src/x11/utils.cpp

index 347587794f1456ef7c1e3325b0adb256afe7e200..23d5be6cbbc06aebda179a3e8b196df4239ae8ae 100644 (file)
@@ -1,18 +1,20 @@
 /////////////////////////////////////////////////////////////////////////////
-// Name:        cursor.mm
+// Name:        src/cocoa/cursor.mm
 // Purpose:     wxCursor class for wxCocoa
 // Author:      Ryan Norton
 // Modified by:
 // Created:     2004-10-05
 // RCS-ID:      $Id$
 // Copyright:   (c) Ryan Norton
-// Licence:    wxWidgets licence
+// Licence:     wxWidgets licence
 /////////////////////////////////////////////////////////////////////////////
 
 #include "wx/wxprec.h"
+
+#include "wx/cursor.h"
+
 #ifndef WX_PRECOMP
     #include "wx/icon.h"
-    #include "wx/cursor.h"
 #endif //WX_PRECOMP
 
 #import <AppKit/NSCursor.h>
@@ -174,39 +176,39 @@ NSCursor* wxGetStockCursor( short sIndex )
 {
     ClassicCursor* pCursor = &gMacCursors[sIndex];
 
-    //Classic mac cursors are 1bps 16x16 black and white with a 
+    //Classic mac cursors are 1bps 16x16 black and white with a
     //identical mask that is 1 for on and 0 for off
     NSImage *theImage = [[NSImage alloc] initWithSize:NSMakeSize(16.0,16.0)];
-    
+
     //NSCursor takes an NSImage takes a number of Representations - here
     //we need only one for the raw data
-    NSBitmapImageRep *theRep = 
-    [[NSBitmapImageRep alloc] 
+    NSBitmapImageRep *theRep =
+    [[NSBitmapImageRep alloc]
       initWithBitmapDataPlanes: nil  // Allocate the buffer for us :)
-      pixelsWide: 16 
+      pixelsWide: 16
       pixelsHigh: 16
       bitsPerSample: 1
-      samplesPerPixel: 2  
-      hasAlpha: YES            // Well, more like a mask...
-      isPlanar: NO 
+      samplesPerPixel: 2
+      hasAlpha: YES                  // Well, more like a mask...
+      isPlanar: NO
       colorSpaceName: NSCalibratedWhiteColorSpace // Normal B/W - 0 black 1 white
       bytesPerRow: 0     // I don't care - figure it out for me :)
       bitsPerPixel: 2];  // bitsPerSample * samplesPerPixel
-  
+
     //unsigned int is better to put data in then a void*
     //note that working with bitfields would be a lot better here -
     //but since it breaks some compilers...
-    wxUint32 *data = (wxUint32 *)[theRep bitmapData];  
-    
+    wxUint32 *data = (wxUint32 *)[theRep bitmapData];
+
     //traverse through the bitmap data
     for (int i = 0; i < 16; ++i)
     {
         //bit alpha bit alpha ... :D
-        
-        //Notice the = instead of |= - 
+
+        //Notice the = instead of |= -
         //this is to avoid doing a memset earlier
         data[i] = 0;
-                
+
         //do the rest of those bits and alphas :)
         for (int shift = 0; shift < 32; ++shift)
         {
@@ -217,19 +219,19 @@ NSCursor* wxGetStockCursor( short sIndex )
 
     //add the representation (data) to the image
     [theImage addRepresentation:theRep];
-    
+
     //create the new cursor
-    NSCursor* theCursor =  [[NSCursor alloc]   initWithImage:theImage 
+    NSCursor* theCursor =  [[NSCursor alloc]  initWithImage:theImage
                                     hotSpot:NSMakePoint(pCursor->hotspot[1], pCursor->hotspot[0])
                             ];
-    
+
     //do the usual cleanups
-    [theRep release];    
+    [theRep release];
     [theImage release];
-    
+
     //return the new cursor
     return theCursor;
-}    
+}
 
 wxCursorRefData::wxCursorRefData() :
     m_width(32), m_height(32), m_hCursor(nil)
@@ -250,34 +252,33 @@ wxCursor::wxCursor()
 wxCursor::wxCursor(const char WXUNUSED(bits)[], int WXUNUSED(width), int WXUNUSED(height),
     int WXUNUSED(hotSpotX), int WXUNUSED(hotSpotY), const char WXUNUSED(maskBits)[])
 {
-    
 }
 
 wxCursor::wxCursor(const wxString& cursor_file, long flags, int hotSpotX, int hotSpotY)
 {
     m_refData = new wxCursorRefData;
-    
+
     //TODO:  Not sure if this works or not
     NSImage* theImage;
-    
+
     if (flags & wxBITMAP_TYPE_MACCURSOR_RESOURCE)
     {
         //[NSBundle bundleForClass:[self class]]?
-        theImage = [[NSImage alloc] 
+        theImage = [[NSImage alloc]
                         initWithContentsOfFile:[[NSBundle mainBundle] pathForResource:wxNSStringWithWxString(cursor_file) ofType:nil]
                     ];
-        
+
     }
-    else 
+    else
         theImage = [[NSImage alloc] initByReferencingFile:wxNSStringWithWxString(cursor_file)
                 ];
-    
+
     wxASSERT(theImage);
-    
+
     M_CURSORDATA->m_hCursor = [[NSCursor alloc] initWithImage:theImage
                                         hotSpot:NSMakePoint(hotSpotX, hotSpotY)
                                 ];
-    
+
     [theImage release];
 }
 
@@ -294,7 +295,7 @@ wxCursor::wxCursor(int cursor_type)
     case wxCURSOR_ARROW:
       M_CURSORDATA->m_hCursor = [[NSCursor arrowCursor] retain];
       break;
-/*     TODO:
+/* TODO:
     case wxCURSOR_COPY_ARROW:
         M_CURSORDATA->m_themeCursor = kThemeCopyArrowCursor ;
         break;
@@ -315,7 +316,7 @@ wxCursor::wxCursor(int cursor_type)
             M_CURSORDATA->m_hCursor = wxGetStockCursor(kwxCursorSizeNESW);
         }
         break;
-/*     TODO:
+/* TODO:
     case wxCURSOR_SIZEWE:
         {
             M_CURSORDATA->m_themeCursor = kThemeResizeLeftRightCursor;
@@ -332,7 +333,7 @@ wxCursor::wxCursor(int cursor_type)
             M_CURSORDATA->m_hCursor = wxGetStockCursor(kwxCursorSize);
         }
         break;
-/*     TODO:
+/* TODO:
     case wxCURSOR_HAND:
         {
             M_CURSORDATA->m_themeCursor = kThemePointingHandCursor;
@@ -426,33 +427,32 @@ static int wxBusyCursorCount = 0;
 // Set the cursor to the busy cursor for all windows
 void wxBeginBusyCursor(const wxCursor *cursor)
 {
-  wxBusyCursorCount ++;
-  if (wxBusyCursorCount == 1)
-  {
+    wxBusyCursorCount ++;
+    if (wxBusyCursorCount == 1)
+    {
         // TODO
-  }
-  else
-  {
+    }
+    else
+    {
         // TODO
-  }
+    }
 }
 
 // Restore cursor to normal
 void wxEndBusyCursor()
 {
-  if (wxBusyCursorCount == 0)
-    return;
-    
-  wxBusyCursorCount --;
-  if (wxBusyCursorCount == 0)
-  {
-    // TODO
-  }
+    if (wxBusyCursorCount == 0)
+        return;
+
+    wxBusyCursorCount --;
+    if (wxBusyCursorCount == 0)
+    {
+        // TODO
+    }
 }
 
-// TRUE if we're between the above two calls
+// true if we're between the above two calls
 bool wxIsBusy()
 {
   return (wxBusyCursorCount > 0);
-}    
-
+}
index 7e869fb82e11a6fec62e8e0e26d058e5b9f63c28..a4820ae1470a8e0a622ca17c040ee354d3b92b22 100644 (file)
     #include "wx/brush.h"
     #include "wx/palette.h"
     #include "wx/icon.h"
+    #include "wx/cursor.h"
 #endif
 
 #include "wx/bitmap.h"
-#include "wx/cursor.h"
 #include "wx/font.h"
 #include "wx/settings.h"
 #include "wx/hashmap.h"
index 8e47f28a70607172e21c2a4c4ad911069e0bc009..c4396ae97a10845424470974c0afcf8709b4032b 100644 (file)
     #include "wx/object.h"
     #include "wx/window.h"
     #include "wx/dc.h"
+    #include "wx/cursor.h"
 #endif
 
-#include "wx/cursor.h"
-
 /* Current cursor, in order to hang on to
  * cursor handle when setting the cursor globally */
 wxCursor g_globalCursor;
index 81c8bc62490990d7aed89687866c3698e832d528..ff269131bddc94b530d7a7d3d921eedb0d0abf9c 100644 (file)
@@ -15,9 +15,9 @@
 #ifndef WX_PRECOMP
     #include "wx/app.h"
     #include "wx/frame.h"
+    #include "wx/cursor.h"
 #endif // WX_PRECOMP
 
-#include "wx/cursor.h"
 #include "wx/evtloop.h"
 
 #include <gdk/gdk.h>
index 843144ebaa456534586c1a0d63dc603271f5052b..98bb95953fd2dccc2d12a91fb6602711a75a111f 100644 (file)
 #ifndef WX_PRECOMP
     #include "wx/app.h"
     #include "wx/frame.h"
+    #include "wx/cursor.h"
 #endif // WX_PRECOMP
 
-#include "wx/cursor.h"
-
 #include <gdk/gdk.h>
 #include <gtk/gtk.h>
 #include <gdk/gdkkeysyms.h>
index 7b1409e98b72f2169e2928ba11558be9ec90a783..f1f49656b80444dfe24b1edf0c559ecbc8be271c 100644 (file)
     #include "wx/object.h"
     #include "wx/window.h"
     #include "wx/dc.h"
+    #include "wx/cursor.h"
 #endif
 
-#include "wx/cursor.h"
-
 /* Current cursor, in order to hang on to
  * cursor handle when setting the cursor globally */
 wxCursor g_globalCursor;
index a58dcb55dbf94fa45a902fbb627e0c35bc9f773d..67f0984c0881b327c56f5250ef7359b43c9885e0 100644 (file)
@@ -15,9 +15,9 @@
 #ifndef WX_PRECOMP
     #include "wx/app.h"
     #include "wx/frame.h"
+    #include "wx/cursor.h"
 #endif // WX_PRECOMP
 
-#include "wx/cursor.h"
 #include "wx/evtloop.h"
 
 #include <gdk/gdk.h>
index 65d35e5c2216e54049900530f63c0aae7fca783c..77c40448820dd5f3a2a14c46e166d955eb616031 100644 (file)
 #ifndef WX_PRECOMP
     #include "wx/app.h"
     #include "wx/frame.h"
+    #include "wx/cursor.h"
 #endif // WX_PRECOMP
 
-#include "wx/cursor.h"
-
 #include <gdk/gdk.h>
 #include <gtk/gtk.h>
 #include <gdk/gdkkeysyms.h>
@@ -221,7 +220,7 @@ bool wxPopupWindow::Create( wxWindow *parent, int style )
     gtk_signal_connect (GTK_OBJECT(m_widget), "button_press_event",
         GTK_SIGNAL_FUNC(gtk_popup_button_press), (gpointer)this );
 
-    return TRUE;
+    return true;
 }
 
 void wxPopupWindow::DoMoveWindow(int WXUNUSED(x), int WXUNUSED(y), int WXUNUSED(width), int WXUNUSED(height) )
index ec64c3fb064ef802823ba20c273b35a59d0c67b6..3f0b8919f72e5327dc6b02adcfa0b3c36ff0282f 100644 (file)
     #include "wx/brush.h"
     #include "wx/palette.h"
     #include "wx/icon.h"
+    #include "wx/cursor.h"
 #endif
 
 #include "wx/gdicmn.h"
-#include "wx/cursor.h"
 #include "wx/dialog.h"
 #include "wx/msgdlg.h"
 #include "wx/module.h"
index 6d83aedb22043d4b5c674013ce22b635c60173db..dd8817b49a4e075595fc6fef3479948e3f3d77d2 100644 (file)
     #include "wx/brush.h"
     #include "wx/palette.h"
     #include "wx/icon.h"
+    #include "wx/cursor.h"
 #endif
 
 #include "wx/gdicmn.h"
-#include "wx/cursor.h"
 #include "wx/dialog.h"
 #include "wx/msgdlg.h"
 #include "wx/module.h"
index 1fb6225976e92d9c700333a3528f17f8741650d9..ef34e4118d38a9e70ff177b1be5860dd123c1afe 100644 (file)
@@ -14,7 +14,9 @@
     #pragma hdrstop
 #endif
 
-#include "wx/cursor.h"
+#ifndef WX_PRECOMP
+    #include "wx/cursor.h"
+#endif
 
 /* Current cursor, in order to hang on to
  * cursor handle when setting the cursor globally */
index 3a6a3e9e80849b49cae25b425bf97ef49f171915..b50ffa10523344bcbfb0ea59119bfde7e4930bb5 100644 (file)
     #pragma hdrstop
 #endif
 
+#include "wx/cursor.h"
+
 #ifndef WX_PRECOMP
     #include "wx/utils.h"
     #include "wx/app.h"
     #include "wx/bitmap.h"
     #include "wx/icon.h"
-    #include "wx/cursor.h"
     #include "wx/settings.h"
     #include "wx/intl.h"
 #endif
@@ -217,7 +218,7 @@ wxCursor::wxCursor(const wxImage& image)
     }
 #else
     HCURSOR hcursor = 0;
-#endif                                         
+#endif
 
     m_refData = new wxCursorRefData(hcursor, true /* delete it later */);
 }
@@ -313,7 +314,7 @@ wxCursor::wxCursor(int idCursor)
         { false, _T("WXCURSOR_RIGHT_ARROW")  }, // wxCURSOR_RIGHT_ARROW
         { false, _T("WXCURSOR_BULLSEYE")     }, // wxCURSOR_BULLSEYE
         {  true, IDC_ARROW                   }, // WXCURSOR_CHAR
-        
+
         // Displays as an I-beam on XP, so use a cursor file
 //        {  true, IDC_CROSS                   }, // WXCURSOR_CROSS
         {  false, _T("WXCURSOR_CROSS")       }, // WXCURSOR_CROSS
@@ -321,7 +322,7 @@ wxCursor::wxCursor(int idCursor)
         // See special handling below for wxCURSOR_HAND
 //        { false, _T("WXCURSOR_HAND")         }, // wxCURSOR_HAND
         {  true, IDC_HAND                    }, // wxCURSOR_HAND
-        
+
         {  true, IDC_IBEAM                   }, // WXCURSOR_IBEAM
         {  true, IDC_ARROW                   }, // WXCURSOR_LEFT_BUTTON
         { false, _T("WXCURSOR_MAGNIFIER")    }, // wxCURSOR_MAGNIFIER
@@ -365,7 +366,7 @@ wxCursor::wxCursor(int idCursor)
         hcursor = ::LoadCursor(wxGetInstance(), _T("WXCURSOR_HAND"));
         deleteLater = true;
     }
-    
+
     if ( !hcursor )
     {
         wxLogLastError(_T("LoadCursor"));
index ebbb30b7411a2b29421a07bff0d11b7218cf4a7e..fec983bf6018ea5503968e1969f3be5946c02a1a 100644 (file)
 // For compilers that support precompilation, includes "wx.h".
 #include "wx/wxprec.h"
 
+#include "wx/cursor.h"
+
 #ifndef WX_PRECOMP
     #include <stdio.h>
     #include "wx/list.h"
     #include "wx/utils.h"
     #include "wx/app.h"
-    #include "wx/cursor.h"
     #include "wx/icon.h"
 #endif
 
index 51368d9ab371df8212e04910283899827c5825d5..de3a5ef23173d9b6c18f6baa649c8b35db410bed 100644 (file)
     #pragma hdrstop
 #endif
 
+#include "wx/cursor.h"
+
 #ifndef WX_PRECOMP
     #include "wx/utils.h"
     #include "wx/app.h"
     #include "wx/bitmap.h"
     #include "wx/icon.h"
-    #include "wx/cursor.h"
     #include "wx/settings.h"
     #include "wx/intl.h"
 #endif
@@ -110,7 +111,7 @@ wxCursor::~wxCursor()
 
 bool wxCursor::operator==(const wxCursor& cursor) const
 {
-    return FALSE;
+    return false;
 }
 
 wxGDIImageRefData *wxCursor::CreateData() const
@@ -130,5 +131,3 @@ const wxCursor *wxGetGlobalCursor()
 void wxSetCursor(const wxCursor& cursor)
 {
 }
-
-
index aa03ce8a5b895d0328bead991e3b65783b2a5743..8982ec4c0e817b56a0ed2fc144530ec712d78453 100644 (file)
 #ifndef WX_PRECOMP
     #include "wx/app.h"
     #include "wx/window.h" // for wxTopLevelWindows
+    #include "wx/cursor.h"
 #endif
 
 #include "wx/apptrait.h"
 #include "wx/msgdlg.h"
-#include "wx/cursor.h"
 
 #include <ctype.h>
 #include <stdarg.h>