1998-09-18 06:19:10 -04:00
|
|
|
/////////////////////////////////////////////////////////////////////////////
|
2006-07-25 10:31:55 -04:00
|
|
|
// Name: wx/motif/cursor.h
|
1998-09-18 06:19:10 -04:00
|
|
|
// Purpose: wxCursor class
|
|
|
|
// Author: Julian Smart
|
|
|
|
// Modified by:
|
|
|
|
// Created: 17/09/98
|
|
|
|
// RCS-ID: $Id$
|
|
|
|
// Copyright: (c) Julian Smart
|
2006-07-25 10:31:55 -04:00
|
|
|
// Licence: wxWindows licence
|
1998-09-18 06:19:10 -04:00
|
|
|
/////////////////////////////////////////////////////////////////////////////
|
|
|
|
|
|
|
|
#ifndef _WX_CURSOR_H_
|
|
|
|
#define _WX_CURSOR_H_
|
|
|
|
|
2007-12-15 12:54:20 -05:00
|
|
|
#include "wx/gdiobj.h"
|
2003-03-22 10:46:22 -05:00
|
|
|
#include "wx/gdicmn.h"
|
1998-09-18 06:19:10 -04:00
|
|
|
|
2007-07-09 06:09:52 -04:00
|
|
|
class WXDLLIMPEXP_FWD_CORE wxImage;
|
1998-09-18 06:19:10 -04:00
|
|
|
|
|
|
|
// Cursor
|
2008-03-26 11:06:00 -04:00
|
|
|
class WXDLLIMPEXP_CORE wxCursor : public wxGDIObject
|
1998-09-18 06:19:10 -04:00
|
|
|
{
|
|
|
|
public:
|
2002-02-05 11:34:33 -05:00
|
|
|
wxCursor();
|
2006-02-08 19:51:23 -05:00
|
|
|
|
2003-05-27 16:31:41 -04:00
|
|
|
wxCursor(const char bits[], int width, int height,
|
|
|
|
int hotSpotX = -1, int hotSpotY = -1,
|
2008-09-25 13:56:07 -04:00
|
|
|
const char maskBits[] = NULL,
|
|
|
|
const wxColour* fg = NULL, const wxColour* bg = NULL);
|
2006-07-25 10:31:55 -04:00
|
|
|
|
2008-09-25 13:56:07 -04:00
|
|
|
wxCursor(const wxString& name,
|
|
|
|
wxBitmapType type = wxCURSOR_DEFAULT_TYPE,
|
|
|
|
int hotSpotX = 0, int hotSpotY = 0);
|
2002-07-01 16:34:20 -04:00
|
|
|
|
2006-07-25 10:31:55 -04:00
|
|
|
#if wxUSE_IMAGE
|
2002-07-01 16:34:20 -04:00
|
|
|
wxCursor(const wxImage& image);
|
|
|
|
#endif
|
2006-07-25 10:31:55 -04:00
|
|
|
|
2008-09-25 13:56:07 -04:00
|
|
|
wxCursor(wxStockCursor id) { InitFromStock(id); }
|
|
|
|
#if WXWIN_COMPATIBILITY_2_8
|
|
|
|
wxCursor(int id) { InitFromStock((wxStockCursor)id); }
|
|
|
|
#endif
|
|
|
|
|
2006-09-05 16:47:48 -04:00
|
|
|
virtual ~wxCursor();
|
2006-07-25 10:31:55 -04:00
|
|
|
|
2002-02-05 11:34:33 -05:00
|
|
|
// Motif-specific.
|
|
|
|
// Create/get a cursor for the current display
|
2004-06-28 15:22:48 -04:00
|
|
|
WXCursor GetXCursor(WXDisplay* display) const;
|
2007-12-15 12:54:20 -05:00
|
|
|
|
|
|
|
protected:
|
|
|
|
virtual wxGDIRefData *CreateGDIRefData() const;
|
|
|
|
virtual wxGDIRefData *CloneGDIRefData(const wxGDIRefData *data) const;
|
|
|
|
|
2003-03-22 10:46:22 -05:00
|
|
|
private:
|
2008-09-25 13:56:07 -04:00
|
|
|
void InitFromStock(wxStockCursor);
|
|
|
|
|
2003-05-27 16:31:41 -04:00
|
|
|
void Create(const char bits[], int width, int height,
|
|
|
|
int hotSpotX = -1, int hotSpotY = -1,
|
|
|
|
const char maskBits[] = NULL);
|
|
|
|
void Create(WXPixmap cursor, WXPixmap mask, int hotSpotX, int hotSpotY);
|
|
|
|
|
2002-02-05 11:34:33 -05:00
|
|
|
// Make a cursor from standard id
|
2004-06-28 15:22:48 -04:00
|
|
|
WXCursor MakeCursor(WXDisplay* display, wxStockCursor id) const;
|
2007-12-15 12:54:20 -05:00
|
|
|
|
|
|
|
DECLARE_DYNAMIC_CLASS(wxCursor)
|
1998-09-18 06:19:10 -04:00
|
|
|
};
|
|
|
|
|
2008-03-26 11:06:00 -04:00
|
|
|
extern WXDLLIMPEXP_CORE void wxSetCursor(const wxCursor& cursor);
|
1998-09-18 06:19:10 -04:00
|
|
|
|
|
|
|
#endif
|
2002-02-05 11:34:33 -05:00
|
|
|
// _WX_CURSOR_H_
|