added more files (unchanged) from wxUniv branch

git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@10674 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
This commit is contained in:
Vadim Zeitlin
2001-06-26 21:05:06 +00:00
parent 1e6feb95a7
commit 32b8ec418a
78 changed files with 14777 additions and 0 deletions

89
include/wx/mgl/app.h Normal file
View File

@@ -0,0 +1,89 @@
/////////////////////////////////////////////////////////////////////////////
// Name: app.h
// Purpose:
// Author: Vaclav Slavik
// Id: $Id$
// Copyright: (c) 2001 Vaclav Slavik
// Licence: wxWindows licence
/////////////////////////////////////////////////////////////////////////////
#ifndef __WX_APP_H__
#define __WX_APP_H__
#ifdef __GNUG__
#pragma interface "app.h"
#endif
#include "wx/frame.h"
#include "wx/icon.h"
//-----------------------------------------------------------------------------
// classes
//-----------------------------------------------------------------------------
class wxApp;
class wxLog;
//-----------------------------------------------------------------------------
// wxApp
//-----------------------------------------------------------------------------
class WXDLLEXPORT wxApp: public wxAppBase
{
public:
wxApp() {}
~wxApp() {}
/* override for altering the way wxGTK intializes the GUI
* (palette/visual/colorcube). under wxMSW, OnInitGui() does nothing by
* default. when overriding this method, the code in it is likely to be
* platform dependent, otherwise use OnInit(). */
virtual bool OnInitGui() {return 0;}
// override base class (pure) virtuals
virtual int MainLoop() {return 0;}
virtual void ExitMainLoop() {}
virtual bool Initialized() {return 0;}
virtual bool Pending() {return 0;}
virtual void Dispatch() {}
virtual wxIcon GetStdIcon(int which) const {return wxNullIcon;}
// implementation only from now on
void OnIdle( wxIdleEvent &event ) {}
bool SendIdleEvents() {return 0;}
bool SendIdleEvents( wxWindow* win ) {return 0;}
static bool Initialize() {return 0;}
static bool InitialzeVisual() {return 0;}
static void CleanUp() {}
bool ProcessIdle() {return 0;}
void DeletePendingObjects() {}
// This can be used to suppress the generation of Idle events.
void SuppressIdleEvents(bool arg = TRUE) { m_suppressIdleEvents = arg; }
bool GetSuppressIdleEvents() const { return m_suppressIdleEvents; }
#if 0 //FIXME MGL
bool m_initialized;
gint m_idleTag;
#if wxUSE_THREADS
gint m_wakeUpTimerTag;
#endif
unsigned char *m_colorCube;
#endif
private:
/// Set to TRUE while we are in wxYield().
bool m_suppressIdleEvents;
private:
DECLARE_DYNAMIC_CLASS(wxApp)
DECLARE_EVENT_TABLE()
};
int WXDLLEXPORT wxEntry( int argc, char *argv[] );
#endif // __WX_APP_H__

139
include/wx/mgl/bitmap.h Normal file
View File

@@ -0,0 +1,139 @@
/////////////////////////////////////////////////////////////////////////////
// Name: bitmap.h
// Author: Vaclav Slavik
// RCS-ID: $Id$
// Copyright: (c) 2001 Vaclav Slavik
// Licence: wxWindows licence
/////////////////////////////////////////////////////////////////////////////
#ifndef __WX_BITMAP_H__
#define __WX_BITMAP_H__
#ifdef __GNUG__
#pragma interface
#endif
#include "wx/defs.h"
#include "wx/object.h"
#include "wx/string.h"
#include "wx/palette.h"
#include "wx/gdiobj.h"
//-----------------------------------------------------------------------------
// classes
//-----------------------------------------------------------------------------
class WXDLLEXPORT wxMask;
class WXDLLEXPORT wxBitmap;
class WXDLLEXPORT wxImage;
class WXDLLEXPORT wxDC;
class WXDLLEXPORT wxMemoryDC;
class MGLDevCtx;
struct bitmap_t;
//-----------------------------------------------------------------------------
// wxMask
//-----------------------------------------------------------------------------
class WXDLLEXPORT wxMask: public wxObject
{
public:
wxMask();
wxMask(const wxBitmap& bitmap, const wxColour& colour);
wxMask(const wxBitmap& bitmap, int paletteIndex);
wxMask(const wxBitmap& bitmap);
~wxMask();
bool Create(const wxBitmap& bitmap, const wxColour& colour);
bool Create(const wxBitmap& bitmap, int paletteIndex);
bool Create(const wxBitmap& bitmap);
// implementation
wxBitmap *m_bitmap;
wxBitmap *GetBitmap() const { return m_bitmap; }
private:
DECLARE_DYNAMIC_CLASS(wxMask)
};
//-----------------------------------------------------------------------------
// wxBitmap
//-----------------------------------------------------------------------------
class WXDLLEXPORT wxBitmapHandler : public wxBitmapHandlerBase
{
public:
wxBitmapHandler() : wxBitmapHandlerBase() {}
private:
DECLARE_DYNAMIC_CLASS(wxBitmapHandler)
};
class WXDLLEXPORT wxBitmap: public wxBitmapBase
{
public:
wxBitmap();
wxBitmap(int width, int height, int depth = -1);
wxBitmap(const char bits[], int width, int height, int depth = 1);
wxBitmap(const char **bits) { CreateFromXpm(bits); }
wxBitmap(char **bits) { CreateFromXpm((const char **)bits); }
wxBitmap(const wxBitmap& bmp);
wxBitmap(const wxString &filename, wxBitmapType type = wxBITMAP_TYPE_RESOURCE);
wxBitmap(const wxImage& image, int depth = -1);
~wxBitmap();
wxBitmap& operator = (const wxBitmap& bmp);
bool operator == (const wxBitmap& bmp) const;
bool operator != (const wxBitmap& bmp) const;
bool Ok() const;
bool Create(int width, int height, int depth = -1);
virtual int GetHeight() const;
virtual int GetWidth() const;
virtual int GetDepth() const;
virtual wxImage ConvertToImage() const;
virtual wxMask *GetMask() const;
virtual void SetMask(wxMask *mask);
virtual wxBitmap GetSubBitmap(const wxRect& rect) const;
virtual bool SaveFile(const wxString &name, wxBitmapType type, const wxPalette *palette = (wxPalette *) NULL) const;
virtual bool LoadFile(const wxString &name, wxBitmapType type = wxBITMAP_TYPE_RESOURCE);
virtual wxPalette *GetPalette() const;
virtual void SetPalette(const wxPalette& palette);
// copies the contents and mask of the given (colour) icon to the bitmap
virtual bool CopyFromIcon(const wxIcon& icon);
static void InitStandardHandlers();
// implementation:
virtual void SetHeight(int height);
virtual void SetWidth(int width);
virtual void SetDepth(int depth);
// get underlying native representation:
bitmap_t *GetMGLbitmap_t() const;
protected:
bool CreateFromXpm(const char **bits);
// creates temporary DC for access to bitmap's data:
MGLDevCtx *CreateTmpDC() const;
// sets fg & bg colours for 1bit bitmaps:
void SetMonoPalette(const wxColour& fg, const wxColour& bg);
private:
DECLARE_DYNAMIC_CLASS(wxBitmap)
friend class wxDC;
friend class wxMemoryDC;
};
#endif // __WX_BITMAP_H__

68
include/wx/mgl/brush.h Normal file
View File

@@ -0,0 +1,68 @@
/////////////////////////////////////////////////////////////////////////////
// Name: brush.h
// Purpose:
// Author: Vaclav Slavik
// Id: $Id$
// Copyright: (c) 2001 Vaclav Slavik
// Licence: wxWindows licence
/////////////////////////////////////////////////////////////////////////////
#ifndef __WX_BRUSH_H__
#define __WX_BRUSH_H__
#ifdef __GNUG__
#pragma interface "brush.h"
#endif
#include "wx/defs.h"
#include "wx/object.h"
#include "wx/string.h"
#include "wx/gdiobj.h"
#include "wx/bitmap.h"
//-----------------------------------------------------------------------------
// classes
//-----------------------------------------------------------------------------
class WXDLLEXPORT wxBitmap;
class WXDLLEXPORT wxBrush;
//-----------------------------------------------------------------------------
// wxBrush
//-----------------------------------------------------------------------------
class WXDLLEXPORT wxBrush: public wxGDIObject
{
public:
wxBrush();
wxBrush(const wxColour &colour, int style);
wxBrush(const wxBitmap &stippleBitmap);
wxBrush(const wxBrush &brush);
~wxBrush();
wxBrush& operator = (const wxBrush& brush);
bool operator == (const wxBrush& brush) const;
bool operator != (const wxBrush& brush) const;
bool Ok() const;
int GetStyle() const;
wxColour &GetColour() const;
wxBitmap *GetStipple() const;
void SetColour(const wxColour& col);
void SetColour(unsigned char r, unsigned char g, unsigned char b);
void SetStyle(int style);
void SetStipple(const wxBitmap& stipple);
// implementation:
void Unshare();
void* GetMaskPattern() const;
void* GetPixPattern() const;
private:
DECLARE_DYNAMIC_CLASS(wxBrush)
};
#endif // __WX_BRUSH_H__

88
include/wx/mgl/clipbrd.h Normal file
View File

@@ -0,0 +1,88 @@
/////////////////////////////////////////////////////////////////////////////
// Name: clipboard.h
// Purpose:
// Author: Vaclav Slavik
// Id: $Id$
// Copyright: (c) 2001 Vaclav Slavik
// Licence: wxWindows licence
/////////////////////////////////////////////////////////////////////////////
#ifndef __WX_CLIPBOARD_H__
#define __WX_CLIPBOARD_H__
#ifdef __GNUG__
#pragma interface "clipbrd.h"
#endif
#if wxUSE_CLIPBOARD
#include "wx/object.h"
#include "wx/list.h"
#include "wx/dataobj.h"
#include "wx/control.h"
#include "wx/module.h"
// ----------------------------------------------------------------------------
// wxClipboard
// ----------------------------------------------------------------------------
class WXDLLEXPORT wxClipboard : public wxClipboardBase
{
public:
wxClipboard() {}
~wxClipboard() {}
// open the clipboard before SetData() and GetData()
virtual bool Open() {}
// close the clipboard after SetData() and GetData()
virtual void Close() {}
// query whether the clipboard is opened
virtual bool IsOpened() const {}
// set the clipboard data. all other formats will be deleted.
virtual bool SetData( wxDataObject *data ) {}
// add to the clipboard data.
virtual bool AddData( wxDataObject *data ) {}
// ask if data in correct format is available
virtual bool IsSupported( const wxDataFormat& format ) {}
// fill data with data on the clipboard (if available)
virtual bool GetData( wxDataObject& data ) {}
// clears wxTheClipboard and the system's clipboard if possible
virtual void Clear() {}
// If primary == TRUE, use primary selection in all further ops,
// primary == FALSE resets it.
virtual void UsePrimarySelection(bool primary = TRUE)
{ m_usePrimary = primary; }
// implementation from now on
bool m_open;
bool m_ownsClipboard;
bool m_ownsPrimarySelection;
wxDataObject *m_data;
GtkWidget *m_clipboardWidget; /* for getting and offering data */
GtkWidget *m_targetsWidget; /* for getting list of supported formats */
bool m_waiting; /* querying data or formats is asynchronous */
bool m_formatSupported;
GdkAtom m_targetRequested;
bool m_usePrimary;
wxDataObject *m_receivedData;
private:
DECLARE_DYNAMIC_CLASS(wxClipboard)
};
#endif
// wxUSE_CLIPBOARD
#endif
// __WX_CLIPBOARD_H__

90
include/wx/mgl/colour.h Normal file
View File

@@ -0,0 +1,90 @@
/////////////////////////////////////////////////////////////////////////////
// Name: colour.h
// Purpose: wxColour class
// Author: Julian Smart
// Modified by:
// Created: 01/02/97
// RCS-ID: $Id$
// Copyright: (c) Julian Smart
// Licence: wxWindows licence
/////////////////////////////////////////////////////////////////////////////
#ifndef _WX_COLOUR_H_
#define _WX_COLOUR_H_
#ifdef __GNUG__
#pragma interface "colour.h"
#endif
#include "wx/object.h"
// Colour
class WXDLLEXPORT wxColour: public wxObject
{
public:
// ctors
// default
wxColour();
// from RGB
wxColour(unsigned char red, unsigned char green, unsigned char blue);
wxColour(unsigned long colRGB) { Set(colRGB); }
// implicit conversion from the colour name
wxColour(const wxString &colourName) { InitFromName(colourName); }
wxColour(const char *colourName) { InitFromName(colourName); }
// copy ctors and assignment operators
wxColour(const wxColour& col);
wxColour& operator = (const wxColour& col);
// dtor
~wxColour();
// Set() functions
void Set(unsigned char red, unsigned char green, unsigned char blue);
void Set(unsigned long colRGB)
{
// we don't need to know sizeof(long) here because we assume that the three
// least significant bytes contain the R, G and B values
Set((unsigned char)colRGB,
(unsigned char)(colRGB >> 8),
(unsigned char)(colRGB >> 16));
}
// accessors
bool Ok() const { return m_isInit; }
// Let's remove this inelegant function
#if WXWIN_COMPATIBILITY
void Get(unsigned char *r, unsigned char *g, unsigned char *b) const;
#endif
unsigned char Red() const { return m_red; }
unsigned char Green() const { return m_green; }
unsigned char Blue() const { return m_blue; }
// comparison
bool operator == (const wxColour& colour) const
{
return (m_red == colour.m_red &&
m_green == colour.m_green &&
m_blue == colour.m_blue &&
m_isInit == colour.m_isInit);
}
bool operator != (const wxColour& colour) const { return !(*this == colour); }
private:
bool m_isInit;
unsigned char m_red;
unsigned char m_blue;
unsigned char m_green;
// helper func
void InitFromName(const wxString& colourName);
private:
DECLARE_DYNAMIC_CLASS(wxColour)
};
#endif
// _WX_COLOUR_H_

54
include/wx/mgl/cursor.h Normal file
View File

@@ -0,0 +1,54 @@
/////////////////////////////////////////////////////////////////////////////
// Name: cursor.h
// Purpose:
// Author: Vaclav Slavik
// Id: $Id$
// Copyright: (c) 2001 Vaclav Slavik
// Licence: wxWindows licence
/////////////////////////////////////////////////////////////////////////////
#ifndef __WX_CURSOR_H__
#define __WX_CURSOR_H__
#ifdef __GNUG__
#pragma interface "cursor.h"
#endif
#include "wx/defs.h"
#include "wx/object.h"
#include "wx/gdicmn.h"
class MGLCursor;
//-----------------------------------------------------------------------------
// wxCursor
//-----------------------------------------------------------------------------
class WXDLLEXPORT wxCursor: public wxObject
{
public:
wxCursor();
wxCursor(int cursorId);
wxCursor(const wxCursor &cursor);
wxCursor(const char bits[], int width, int height,
int hotSpotX=-1, int hotSpotY=-1,
const char maskBits[]=0, wxColour *fg=0, wxColour *bg=0);
wxCursor(const wxString& name,
long flags = wxBITMAP_TYPE_CUR_RESOURCE,
int hotSpotX = 0, int hotSpotY = 0);
~wxCursor();
wxCursor& operator = ( const wxCursor& cursor );
bool operator == (const wxCursor& cursor) const;
bool operator != (const wxCursor& cursor) const;
bool Ok() const;
// implementation
MGLCursor *GetMGLCursor() const;
private:
DECLARE_DYNAMIC_CLASS(wxCursor)
};
#endif // __WX_CURSOR_H__

279
include/wx/mgl/dc.h Normal file
View File

@@ -0,0 +1,279 @@
/////////////////////////////////////////////////////////////////////////////
// Name: dc.h
// Purpose: wxDC class
// Author: Vaclav Slavik
// Created: 2001/03/09
// RCS-ID: $Id$
// Copyright: (c) Vaclav Slavik
// Licence: wxWindows licence
/////////////////////////////////////////////////////////////////////////////
#ifndef _WX_DC_H_
#define _WX_DC_H_
#ifdef __GNUG__
#pragma interface "dc.h"
#endif
#include "wx/defs.h"
#include "wx/dc.h"
#include "wx/region.h"
//-----------------------------------------------------------------------------
// classes
//-----------------------------------------------------------------------------
class WXDLLEXPORT wxDC;
//-----------------------------------------------------------------------------
// constants
//-----------------------------------------------------------------------------
#define MM_TEXT 0
#define MM_ISOTROPIC 1
#define MM_ANISOTROPIC 2
#define MM_LOMETRIC 3
#define MM_HIMETRIC 4
#define MM_TWIPS 5
#define MM_POINTS 6
#define MM_METRIC 7
//-----------------------------------------------------------------------------
// wxDC
//-----------------------------------------------------------------------------
// MGL fwd declarations:
class MGLDevCtx;
struct font_t;
class WXDLLEXPORT wxDC : public wxDCBase
{
DECLARE_DYNAMIC_CLASS(wxDC)
public:
wxDC();
~wxDC();
// implement base class pure virtuals
// ----------------------------------
virtual void Clear();
virtual bool StartDoc(const wxString& message);
virtual void EndDoc();
virtual void StartPage();
virtual void EndPage();
virtual void SetFont(const wxFont& font);
virtual void SetPen(const wxPen& pen);
virtual void SetBrush(const wxBrush& brush);
virtual void SetBackground(const wxBrush& brush);
virtual void SetBackgroundMode(int mode);
virtual void SetPalette(const wxPalette& palette);
virtual void DestroyClippingRegion();
virtual wxCoord GetCharHeight() const;
virtual wxCoord GetCharWidth() const;
virtual void DoGetTextExtent(const wxString& string,
wxCoord *x, wxCoord *y,
wxCoord *descent = NULL,
wxCoord *externalLeading = NULL,
wxFont *theFont = NULL) const;
virtual bool CanDrawBitmap() const;
virtual bool CanGetTextExtent() const;
virtual int GetDepth() const;
virtual wxSize GetPPI() const;
virtual void SetMapMode(int mode);
virtual void SetUserScale(double x, double y);
virtual void SetLogicalScale(double x, double y);
virtual void SetLogicalOrigin(wxCoord x, wxCoord y);
virtual void SetDeviceOrigin(wxCoord x, wxCoord y);
virtual void SetAxisOrientation(bool xLeftRight, bool yBottomUp);
virtual void SetLogicalFunction(int function);
// implementation from now on
// --------------------------
virtual void ComputeScaleAndOrigin();
wxCoord XDEV2LOG(wxCoord x) const
{
wxCoord new_x = x - m_deviceOriginX;
if (new_x > 0)
return (wxCoord)((double)(new_x) / m_scaleX + 0.5) * m_signX + m_logicalOriginX;
else
return (wxCoord)((double)(new_x) / m_scaleX - 0.5) * m_signX + m_logicalOriginX;
}
wxCoord XDEV2LOGREL(wxCoord x) const
{
if (x > 0)
return (wxCoord)((double)(x) / m_scaleX + 0.5);
else
return (wxCoord)((double)(x) / m_scaleX - 0.5);
}
wxCoord YDEV2LOG(wxCoord y) const
{
wxCoord new_y = y - m_deviceOriginY;
if (new_y > 0)
return (wxCoord)((double)(new_y) / m_scaleY + 0.5) * m_signY + m_logicalOriginY;
else
return (wxCoord)((double)(new_y) / m_scaleY - 0.5) * m_signY + m_logicalOriginY;
}
wxCoord YDEV2LOGREL(wxCoord y) const
{
if (y > 0)
return (wxCoord)((double)(y) / m_scaleY + 0.5);
else
return (wxCoord)((double)(y) / m_scaleY - 0.5);
}
wxCoord XLOG2DEV(wxCoord x) const
{
wxCoord new_x = x - m_logicalOriginX;
if (new_x > 0)
return (wxCoord)((double)(new_x) * m_scaleX + 0.5) * m_signX + m_deviceOriginX;
else
return (wxCoord)((double)(new_x) * m_scaleX - 0.5) * m_signX + m_deviceOriginX;
}
wxCoord XLOG2DEVREL(wxCoord x) const
{
if (x > 0)
return (wxCoord)((double)(x) * m_scaleX + 0.5);
else
return (wxCoord)((double)(x) * m_scaleX - 0.5);
}
wxCoord YLOG2DEV(wxCoord y) const
{
wxCoord new_y = y - m_logicalOriginY;
if (new_y > 0)
return (wxCoord)((double)(new_y) * m_scaleY + 0.5) * m_signY + m_deviceOriginY;
else
return (wxCoord)((double)(new_y) * m_scaleY - 0.5) * m_signY + m_deviceOriginY;
}
wxCoord YLOG2DEVREL(wxCoord y) const
{
if (y > 0)
return (wxCoord)((double)(y) * m_scaleY + 0.5);
else
return (wxCoord)((double)(y) * m_scaleY - 0.5);
}
MGLDevCtx *GetMGLDC() const { return m_MGLDC; }
void SetMGLDC(MGLDevCtx *mgldc, bool OwnsMGLDC = FALSE);
protected:
virtual void DoFloodFill(wxCoord x, wxCoord y, const wxColour& col,
int style = wxFLOOD_SURFACE);
virtual bool DoGetPixel(wxCoord x, wxCoord y, wxColour *col) const;
virtual void DoDrawPoint(wxCoord x, wxCoord y);
virtual void DoDrawLine(wxCoord x1, wxCoord y1, wxCoord x2, wxCoord y2);
virtual void DoDrawArc(wxCoord x1, wxCoord y1,
wxCoord x2, wxCoord y2,
wxCoord xc, wxCoord yc);
virtual void DoDrawEllipticArc(wxCoord x, wxCoord y, wxCoord w, wxCoord h,
double sa, double ea);
virtual void DoDrawRectangle(wxCoord x, wxCoord y, wxCoord width, wxCoord height);
virtual void DoDrawRoundedRectangle(wxCoord x, wxCoord y,
wxCoord width, wxCoord height,
double radius);
virtual void DoDrawEllipse(wxCoord x, wxCoord y, wxCoord width, wxCoord height);
virtual void DoCrossHair(wxCoord x, wxCoord y);
virtual void DoDrawIcon(const wxIcon& icon, wxCoord x, wxCoord y);
virtual void DoDrawBitmap(const wxBitmap &bmp, wxCoord x, wxCoord y,
bool useMask = FALSE);
virtual void DoDrawText(const wxString& text, wxCoord x, wxCoord y);
virtual void DoDrawRotatedText(const wxString& text, wxCoord x, wxCoord y,
double angle);
virtual bool DoBlit(wxCoord xdest, wxCoord ydest, wxCoord width, wxCoord height,
wxDC *source, wxCoord xsrc, wxCoord ysrc,
int rop = wxCOPY, bool useMask = FALSE);
// this is gnarly - we can't even call this function DoSetClippingRegion()
// because of virtual function hiding
virtual void DoSetClippingRegionAsRegion(const wxRegion& region);
virtual void DoSetClippingRegion(wxCoord x, wxCoord y,
wxCoord width, wxCoord height);
virtual void DoGetClippingRegion(wxCoord *x, wxCoord *y,
wxCoord *width, wxCoord *height)
{
GetClippingBox(x, y, width, height);
}
virtual void DoGetSize(int *width, int *height) const;
virtual void DoGetSizeMM(int* width, int* height) const;
virtual void DoDrawLines(int n, wxPoint points[],
wxCoord xoffset, wxCoord yoffset);
virtual void DoDrawPolygon(int n, wxPoint points[],
wxCoord xoffset, wxCoord yoffset,
int fillStyle = wxODDEVEN_RULE);
// implementation from now on:
protected:
// setup newly attached MGLDevCtx for wxDC's use
// (does things like setting RGB blending mode for antialiased texts):
void InitializeMGLDC();
// common part of DoDrawText() and DoDrawRotatedText()
void DrawAnyText(const wxString& text, wxCoord x, wxCoord y);
// MGL uses pens as both wxPens and wxBrushes, so we have to
// switch them as needed:
void SelectPen();
void SelectBrush();
void SelectMGLStipplePen(int style);
void SelectMGLFatPen(int style, int flag);
// Select m_font into m_MGLDC:
bool SelectMGLFont();
// Convert wxWin logical function to MGL rop:
int LogicalFunctionToMGLRop(int logFunc) const;
// Unified implementation of DrawIcon, DrawBitmap and Blit:
void DoDrawSubBitmap(const wxBitmap &bmp,
wxCoord x, wxCoord y, wxCoord w, wxCoord h,
wxCoord destx, wxCoord desty, int rop, bool useMask);
// MGL DC class we use:
MGLDevCtx *m_MGLDC;
bool m_OwnsMGLDC:1;
// helper variables for SelectXXXX():
bool m_penSelected;
bool m_brushSelected;
bool m_downloadedPatterns[2];
// MGL does not render lines with width>1 with endings centered
// at given coords but with top left corner of the pen at them,
// these offsets are used to correct it. They are computed by
// SelectPen.
int m_penOfsX, m_penOfsY;
double m_mm_to_pix_x, m_mm_to_pix_y;
wxPalette m_oldPalette;
wxRegion m_currentClippingRegion;
// wxDC::Blit handles memoryDCs as special cases :(
bool m_isMemDC;
font_t *m_mglFont;
};
#endif
// _WX_DC_H_

71
include/wx/mgl/dcclient.h Normal file
View File

@@ -0,0 +1,71 @@
/////////////////////////////////////////////////////////////////////////////
// Name: dcclient.h
// Purpose:
// Author: Vaclav Slavik
// Id: $Id$
// Copyright: (c) 2001 Vaclav Slavik
// Licence: wxWindows licence
/////////////////////////////////////////////////////////////////////////////
#ifndef __WX_DCCLIENT_H__
#define __WX_DCCLIENT_H__
#ifdef __GNUG__
#pragma interface "dcclient.h"
#endif
#include "wx/dc.h"
#include "wx/window.h"
//-----------------------------------------------------------------------------
// classes
//-----------------------------------------------------------------------------
class WXDLLEXPORT wxWindowDC;
class WXDLLEXPORT wxPaintDC;
class WXDLLEXPORT wxClientDC;
//-----------------------------------------------------------------------------
// wxWindowDC
//-----------------------------------------------------------------------------
//FIXME_MGL
class WXDLLEXPORT wxWindowDC : public wxDC
{
public:
wxWindowDC() {}
wxWindowDC( wxWindow *win ) {}
private:
DECLARE_DYNAMIC_CLASS(wxWindowDC)
};
//-----------------------------------------------------------------------------
// wxClientDC
//-----------------------------------------------------------------------------
class WXDLLEXPORT wxClientDC : public wxWindowDC
{
public:
wxClientDC() {}
wxClientDC( wxWindow *win ) {}
private:
DECLARE_DYNAMIC_CLASS(wxClientDC)
};
//-----------------------------------------------------------------------------
// wxPaintDC
//-----------------------------------------------------------------------------
class WXDLLEXPORT wxPaintDC : public wxClientDC
{
public:
wxPaintDC() { }
wxPaintDC( wxWindow *win ) {}
private:
DECLARE_DYNAMIC_CLASS(wxPaintDC)
};
#endif // __WX_DCCLIENT_H__

59
include/wx/mgl/dcmemory.h Normal file
View File

@@ -0,0 +1,59 @@
/////////////////////////////////////////////////////////////////////////////
// Name: dcmemory.h
// Purpose:
// Author: Vaclav Slavik
// RCS-ID: $Id$
// Copyright: (c) 2001 Vaclav Slavik
// Licence: wxWindows licence
/////////////////////////////////////////////////////////////////////////////
#ifndef __WX_DCMEMORY_H__
#define __WX_DCMEMORY_H__
#ifdef __GNUG__
#pragma interface "dcmemory.h"
#endif
#include "wx/defs.h"
#include "wx/dcclient.h"
//-----------------------------------------------------------------------------
// classes
//-----------------------------------------------------------------------------
class WXDLLEXPORT wxMemoryDC;
//-----------------------------------------------------------------------------
// wxMemoryDC
//-----------------------------------------------------------------------------
class WXDLLEXPORT wxMemoryDC : public wxDC
{
public:
wxMemoryDC();
wxMemoryDC(wxDC *dc); // Create compatible DC
~wxMemoryDC();
virtual void SelectObject(const wxBitmap& bitmap);
// these get reimplemented for mono-bitmaps to behave
// more like their Win32 couterparts. They now interpret
// wxWHITE, wxWHITE_BRUSH and wxWHITE_PEN as drawing 0
// and everything else as drawing 1.
virtual void SetPen(const wxPen &pen);
virtual void SetBrush(const wxBrush &brush);
virtual void SetTextForeground(const wxColour &col);
virtual void SetTextBackground(const wxColour &col);
// implementation
wxBitmap m_selected;
wxBitmap GetSelectedObject() const { return m_selected; }
private:
DECLARE_DYNAMIC_CLASS(wxMemoryDC)
};
#endif
// __WX_DCMEMORY_H__

47
include/wx/mgl/dcscreen.h Normal file
View File

@@ -0,0 +1,47 @@
/////////////////////////////////////////////////////////////////////////////
// Name: dcscreen.h
// Purpose:
// Author: Vaclav Slavik
// Id: $Id$
// Copyright: (c) 2001 Vaclav Slavik
// Licence: wxWindows licence
/////////////////////////////////////////////////////////////////////////////
#ifndef __WX_DCSCREEN_H__
#define __WX_DCSCREEN_H__
#ifdef __GNUG__
#pragma interface "dcscreen.h"
#endif
#include "wx/dcclient.h"
//-----------------------------------------------------------------------------
// classes
//-----------------------------------------------------------------------------
class WXDLLEXPORT wxScreenDC;
//-----------------------------------------------------------------------------
// wxScreenDC
//-----------------------------------------------------------------------------
//FIXME_MGL
class WXDLLEXPORT wxScreenDC: public wxPaintDC
{
public:
wxScreenDC() {}
~wxScreenDC() {}
static bool StartDrawingOnTop( wxWindow *window ) {}
static bool StartDrawingOnTop( wxRect *rect = (wxRect *) NULL ) {}
static bool EndDrawingOnTop() {}
private:
DECLARE_DYNAMIC_CLASS(wxScreenDC)
};
#endif
// __WX_DCSCREEN_H__

120
include/wx/mgl/dialog.h Normal file
View File

@@ -0,0 +1,120 @@
/////////////////////////////////////////////////////////////////////////////
// Name: dialog.h
// Purpose:
// Author: Robert Roebling
// Created:
// Id: $Id$
// Copyright: (c) 1998 Robert Roebling
// Licence: wxWindows licence
/////////////////////////////////////////////////////////////////////////////
#ifndef __GTKDIALOGH__
#define __GTKDIALOGH__
#ifdef __GNUG__
#pragma interface "dialog.h"
#endif
#include "wx/defs.h"
#include "wx/panel.h"
#include "wx/icon.h"
//-----------------------------------------------------------------------------
// classes
//-----------------------------------------------------------------------------
class wxDialog;
//-----------------------------------------------------------------------------
// global data
//-----------------------------------------------------------------------------
//FIXME_MGL - belongs to wXUniv
extern const wxChar *wxDialogNameStr;
//-----------------------------------------------------------------------------
// wxDialog
//-----------------------------------------------------------------------------
class wxDialog: public wxDialogBase
{
public:
wxDialog() { Init(); }
wxDialog( wxWindow *parent, wxWindowID id,
const wxString &title,
const wxPoint &pos = wxDefaultPosition,
const wxSize &size = wxDefaultSize,
long style = wxDEFAULT_DIALOG_STYLE,
const wxString &name = wxDialogNameStr ) {}
bool Create( wxWindow *parent, wxWindowID id,
const wxString &title,
const wxPoint &pos = wxDefaultPosition,
const wxSize &size = wxDefaultSize,
long style = wxDEFAULT_DIALOG_STYLE,
const wxString &name = wxDialogNameStr ) {}
~wxDialog() {}
void SetTitle(const wxString& title){}
wxString GetTitle() const {}
void OnApply( wxCommandEvent &event ) {}
void OnCancel( wxCommandEvent &event ) {}
void OnOK( wxCommandEvent &event ) {}
void OnPaint( wxPaintEvent& event ) {}
void OnSize( wxSizeEvent &event ) {}
void OnCloseWindow( wxCloseEvent& event ) {}
/*
void OnCharHook( wxKeyEvent& event );
*/
bool Destroy() {}
virtual bool Show( bool show ) {}
virtual int ShowModal() {}
virtual void EndModal( int retCode ) {}
virtual bool IsModal() const {}
void SetModal( bool modal ) {}
virtual void InitDialog(void) {}
virtual void SetIcon( const wxIcon &icon ) {}
virtual void Iconize( bool WXUNUSED(iconize)) { }
virtual bool IsIconized() const { return FALSE; }
bool Iconized() const { return IsIconized(); }
virtual void Maximize() { }
virtual void Restore() { }
virtual bool IsTopLevel() const { return TRUE; }
// implementation
// --------------
// move the window to the specified location and resize it: this is called
// from both DoSetSize() and DoSetClientSize()
virtual void DoMoveWindow(int x, int y, int width, int height) {}
virtual void GtkOnSize( int x, int y, int width, int height ) {}
virtual void OnInternalIdle() {}
bool m_modalShowing;
wxString m_title;
wxIcon m_icon;
protected:
// common part of all ctors
void Init() {}
// common part of Destroy() and ~wxDialog
void CleanUp() {}
virtual void DoSetSize(int x, int y,
int width, int height,
int sizeFlags = wxSIZE_AUTO) {}
private:
// DECLARE_EVENT_TABLE() FIXME_MGL
DECLARE_DYNAMIC_CLASS(wxDialog)
};
#endif // __GTKDIALOGH__

107
include/wx/mgl/font.h Normal file
View File

@@ -0,0 +1,107 @@
/////////////////////////////////////////////////////////////////////////////
// Name: font.h
// Author: Vaclav Slavik
// Id: $Id$
// Copyright: (c) 2001, Vaclav Slavik
// Licence: wxWindows licence
/////////////////////////////////////////////////////////////////////////////
#ifndef __WX_FONT_H__
#define __WX_FONT_H__
#ifdef __GNUG__
#pragma interface "font.h"
#endif
#include "wx/hash.h"
// ----------------------------------------------------------------------------
// classes
// ----------------------------------------------------------------------------
class WXDLLEXPORT wxDC;
class WXDLLEXPORT wxPaintDC;
class WXDLLEXPORT wxWindow;
class WXDLLEXPORT wxFont;
struct font_t;
// ----------------------------------------------------------------------------
// wxFont
// ----------------------------------------------------------------------------
class WXDLLEXPORT wxFont : public wxFontBase
{
public:
// ctors and such
wxFont() { Init(); }
wxFont(const wxFont& font) { Init(); Ref(font); }
wxFont(const wxNativeFontInfo& info)
{
Init();
(void)Create(info);
}
wxFont(int size,
int family,
int style,
int weight,
bool underlined = FALSE,
const wxString& face = wxEmptyString,
wxFontEncoding encoding = wxFONTENCODING_DEFAULT)
{
Init();
(void)Create(size, family, style, weight, underlined, face, encoding);
}
bool Create(int size,
int family,
int style,
int weight,
bool underlined = FALSE,
const wxString& face = wxEmptyString,
wxFontEncoding encoding = wxFONTENCODING_DEFAULT);
bool Create(const wxNativeFontInfo& fontinfo);
~wxFont();
// assignment
wxFont& operator=(const wxFont& font);
// implement base class pure virtuals
virtual int GetPointSize() const;
virtual int GetFamily() const;
virtual int GetStyle() const;
virtual int GetWeight() const;
virtual wxString GetFaceName() const;
virtual bool GetUnderlined() const;
virtual wxFontEncoding GetEncoding() const;
virtual void SetPointSize(int pointSize);
virtual void SetFamily(int family);
virtual void SetStyle(int style);
virtual void SetWeight(int weight);
virtual void SetFaceName(const wxString& faceName);
virtual void SetUnderlined(bool underlined);
virtual void SetEncoding(wxFontEncoding encoding);
// implementation from now on
void Unshare();
struct font_t *GetMGLfont_t(float scale, bool antialiased);
// no data :-)
protected:
// common part of all ctors
void Init();
private:
DECLARE_DYNAMIC_CLASS(wxFont)
};
#endif // __WX_FONT_H__

126
include/wx/mgl/fontutil.h Normal file
View File

@@ -0,0 +1,126 @@
/////////////////////////////////////////////////////////////////////////////
// Name: wx/nix/fontutil.h
// Purpose: font-related helper functions for MGL
// Author: Vaclav Slavik
// Created: 2001/05/01
// RCS-ID: $Id$
// Copyright: (c) 2001, Vaclav Slavik
// Licence: wxWindows license
/////////////////////////////////////////////////////////////////////////////
#ifndef _WX_MGL_FONTUTIL_H_
#define _WX_MGL_FONTUTIL_H_
#ifdef __WXMGL__
#include "wx/list.h"
struct font_info_t;
struct font_lib_t;
struct font_t;
class wxMGLFontInstance;
class wxMGLFontInstanceList;
class wxMGLFontLibrary;
class wxMGLFontFamily;
enum
{
wxFONTFACE_REGULAR = 0,
wxFONTFACE_ITALIC = 1,
wxFONTFACE_BOLD = 2, // = (regular | bold)
wxFONTFACE_BOLD_ITALIC = 3, // = (italic | bold)
wxFONTFACE_MAX
};
// structure representing particular loaded font instance:
class wxMGLFontInstance
{
public:
wxMGLFontInstance(wxMGLFontLibrary *fontLib, float pt, bool slant, bool aa);
~wxMGLFontInstance();
struct font_t *GetMGLfont_t() const { return m_font; }
float GetPt() const { return m_pt; }
bool GetSlant() const { return m_slant; }
bool GetAA() const { return m_aa; }
private:
wxMGLFontLibrary *m_fontLib;
font_t *m_font;
float m_pt;
bool m_slant;
bool m_aa;
};
// structure representing loaded font library:
class wxMGLFontLibrary
{
public:
wxMGLFontLibrary(const wxString& filename, int type);
~wxMGLFontLibrary();
wxMGLFontInstance *GetFontInstance(wxFont *font, float scale, bool aa);
void IncRef();
void DecRef();
struct font_lib_t *GetMGLfont_lib_t() const { return m_fontLib; }
private:
font_lib_t *m_fontLib;
int m_type;
wxString m_fileName;
size_t m_refs;
wxMGLFontInstanceList *m_instances;
};
// structure representing native MGL font family
class wxMGLFontFamily : public wxObject
{
public:
wxMGLFontFamily(const font_info_t *info);
virtual ~wxMGLFontFamily();
wxString GetName() const { return m_name; }
const font_info_t *GetInfo() const { return m_fontInfo; }
bool HasFace(int type) const;
wxMGLFontLibrary *GetLibrary(int type) const
{ return m_fontLibs[type]; }
private:
wxString m_name;
const font_info_t *m_fontInfo;
wxMGLFontLibrary *m_fontLibs[wxFONTFACE_MAX];
};
WX_DECLARE_LIST(wxMGLFontFamily, wxMGLFontFamilyList);
class wxFontsManager
{
public:
wxFontsManager();
~wxFontsManager();
void AddFamily(const font_info_t *info);
// return info about font with given name:
wxMGLFontFamily *GetFamily(const wxString& name) const;
// return list of all families
wxMGLFontFamilyList *GetFamilyList() { return m_list; }
wxMGLFontLibrary *GetFontLibrary(wxFont *font);
private:
wxHashTable *m_hash;
wxMGLFontFamilyList *m_list;
};
extern wxFontsManager *wxTheFontsManager;
#endif
#endif // _WX_MGL_FONTUTIL_H_

132
include/wx/mgl/frame.h Normal file
View File

@@ -0,0 +1,132 @@
/////////////////////////////////////////////////////////////////////////////
// Name: wx/gtk/frame.h
// Purpose:
// Author: Vaclav Slavik
// Id: $Id$
// Copyright: (c) 2001 Vaclav Slavik
// Licence: wxWindows licence
/////////////////////////////////////////////////////////////////////////////
#ifndef __MGL_FRAME_H__
#define __MGL_FRAME_H__
#ifdef __GNUG__
#pragma interface "frame.h"
#endif
//-----------------------------------------------------------------------------
// classes
//-----------------------------------------------------------------------------
class WXDLLEXPORT wxMDIChildFrame;
class WXDLLEXPORT wxMDIClientWindow;
class WXDLLEXPORT wxMenu;
class WXDLLEXPORT wxMenuBar;
class WXDLLEXPORT wxToolBar;
class WXDLLEXPORT wxStatusBar;
class WXDLLEXPORT wxFrame;
//-----------------------------------------------------------------------------
// wxFrame
//-----------------------------------------------------------------------------
//FIXME_MGL
class WXDLLEXPORT wxFrame : public wxFrameBase
{
public:
// construction
wxFrame() { Init(); }
wxFrame(wxWindow *parent,
wxWindowID id,
const wxString& title,
const wxPoint& pos = wxDefaultPosition,
const wxSize& size = wxDefaultSize,
long style = wxDEFAULT_FRAME_STYLE,
const wxString& name = wxFrameNameStr)
{
Init();
Create(parent, id, title, pos, size, style, name);
}
bool Create(wxWindow *parent,
wxWindowID id,
const wxString& title,
const wxPoint& pos = wxDefaultPosition,
const wxSize& size = wxDefaultSize,
long style = wxDEFAULT_FRAME_STYLE,
const wxString& name = wxFrameNameStr) {}
virtual ~wxFrame() {}
// implement base class pure virtuals
virtual void Maximize(bool maximize = TRUE) {}
virtual bool IsMaximized() const {}
virtual void Iconize(bool iconize = TRUE) {}
virtual bool IsIconized() const {}
virtual void SetIcon(const wxIcon& icon) {}
virtual void MakeModal(bool modal = TRUE) {}
virtual void Restore() {}
#if wxUSE_MENUS
virtual void SetMenuBar( wxMenuBar *menuBar ) {}
#endif // wxUSE_MENUS
#if wxUSE_STATUSBAR
virtual void PositionStatusBar() {}
virtual wxStatusBar* CreateStatusBar(int number = 1,
long style = wxST_SIZEGRIP,
wxWindowID id = 0,
const wxString& name = wxStatusLineNameStr) {}
#endif // wxUSE_STATUSBAR
#if wxUSE_TOOLBAR
virtual wxToolBar* CreateToolBar(long style = wxNO_BORDER | wxTB_HORIZONTAL | wxTB_FLAT,
wxWindowID id = -1,
const wxString& name = wxToolBarNameStr) {}
void SetToolBar(wxToolBar *toolbar) {}
#endif // wxUSE_TOOLBAR
virtual bool Show(bool show = TRUE) {}
virtual void SetTitle( const wxString &title ) {}
virtual wxString GetTitle() const { return m_title; }
// implementation from now on
// --------------------------
// move the window to the specified location and resize it: this is called
// from both DoSetSize() and DoSetClientSize()
virtual void DoMoveWindow(int x, int y, int width, int height) {}
// GTK callbacks
virtual void GtkOnSize( int x, int y, int width, int height ) {}
virtual void OnInternalIdle() {}
wxString m_title;
int m_miniEdge,
m_miniTitle;
bool m_menuBarDetached;
bool m_toolBarDetached;
bool m_insertInClientArea; /* not from within OnCreateXXX */
protected:
// common part of all ctors
void Init() {}
// override wxWindow methods to take into account tool/menu/statusbars
virtual void DoSetSize(int x, int y,
int width, int height,
int sizeFlags = wxSIZE_AUTO) {}
virtual void DoSetClientSize(int width, int height) {}
virtual void DoGetClientSize( int *width, int *height ) const {}
private:
DECLARE_DYNAMIC_CLASS(wxFrame)
};
#endif // __WX_FRAME_H__

55
include/wx/mgl/gdiobj.h Normal file
View File

@@ -0,0 +1,55 @@
/////////////////////////////////////////////////////////////////////////////
// Name: wx/msw/gdiobj.h
// Purpose: wxGDIObject class: base class for other GDI classes
// Author: Julian Smart
// Modified by:
// Created: 01/02/97
// RCS-ID: $Id$
// Copyright: (c) Julian Smart
// Licence: wxWindows licence
/////////////////////////////////////////////////////////////////////////////
#ifndef _WX_GDIOBJ_H_
#define _WX_GDIOBJ_H_
#ifdef __GNUG__
#pragma interface "gdiobj.h"
#endif
#include "wx/object.h" // base class
// ----------------------------------------------------------------------------
// wxGDIRefData is the base class for wxXXXData structures which contain the
// real data for the GDI object and are shared among all wxWin objects sharing
// the same native GDI object
// ----------------------------------------------------------------------------
class WXDLLEXPORT wxGDIRefData : public wxObjectRefData
{
// this class is intentionally left blank
};
// ----------------------------------------------------------------------------
// wxGDIObject
// ----------------------------------------------------------------------------
class WXDLLEXPORT wxGDIObject : public wxObject
{
public:
wxGDIObject() {}
virtual bool GetVisible() { return m_visible; }
virtual void SetVisible( bool visible ) { m_visible = visible; }
bool IsNull() const { return (m_refData == 0); }
protected:
bool m_visible; /* can a pointer to this object be safely taken?
* - only if created within FindOrCreate... */
private:
DECLARE_DYNAMIC_CLASS(wxGDIObject)
};
#endif
// _WX_GDIOBJ_H_

60
include/wx/mgl/icon.h Normal file
View File

@@ -0,0 +1,60 @@
/////////////////////////////////////////////////////////////////////////////
// Name: icon.h
// Purpose:
// Author: Vaclav Slavik
// Id: $Id$
// Copyright: (c) 2001 Vaclav Slavik
// Licence: wxWindows licence
/////////////////////////////////////////////////////////////////////////////
#ifndef __WX_ICON_H__
#define __WX_ICON_H__
#ifdef __GNUG__
#pragma interface "icon.h"
#endif
#include "wx/defs.h"
#include "wx/object.h"
#include "wx/bitmap.h"
//-----------------------------------------------------------------------------
// classes
//-----------------------------------------------------------------------------
class WXDLLEXPORT wxIcon;
//-----------------------------------------------------------------------------
// wxIcon
//-----------------------------------------------------------------------------
class WXDLLEXPORT wxIcon: public wxBitmap
{
public:
wxIcon() : wxBitmap() {}
wxIcon(const wxIcon& icon);
wxIcon(const char **bits, int width=-1, int height=-1);
wxIcon(char **bits, int width=-1, int height=-1);
// For compatibility with wxMSW where desired size is sometimes required to
// distinguish between multiple icons in a resource.
wxIcon(const wxString& filename, wxBitmapType type = wxBITMAP_TYPE_ICO_RESOURCE,
int WXUNUSED(desiredWidth)=-1, int WXUNUSED(desiredHeight)=-1 ) :
wxBitmap(filename, type) {}
wxIcon& operator = (const wxIcon& icon);
inline bool operator == (const wxIcon& icon) { return m_refData == icon.m_refData; }
inline bool operator != (const wxIcon& icon) { return m_refData != icon.m_refData; }
// create from bitmap (which should have a mask unless it's monochrome):
// there shouldn't be any implicit bitmap -> icon conversion (i.e. no
// ctors, assignment operators...), but it's ok to have such function
void CopyFromBitmap(const wxBitmap& bmp);
private:
DECLARE_DYNAMIC_CLASS(wxIcon)
};
#endif // __WX_ICON_H__

64
include/wx/mgl/palette.h Normal file
View File

@@ -0,0 +1,64 @@
/////////////////////////////////////////////////////////////////////////////
// Name: palette.h
// Purpose:
// Author: Vaclav Slavik
// Created: 2001/03/11
// Id: $Id$
// Copyright: (c) 2001 Vaclav Slavik
// Licence: wxWindows licence
/////////////////////////////////////////////////////////////////////////////
#ifndef __WX_PALETTE_H__
#define __WX_PALETTE_H__
#ifdef __GNUG__
#pragma interface "palette.h"
#endif
#include "wx/defs.h"
#include "wx/object.h"
#include "wx/gdiobj.h"
#include "wx/gdicmn.h"
//-----------------------------------------------------------------------------
// classes
//-----------------------------------------------------------------------------
class WXDLLEXPORT wxPalette;
struct palette_t;
//-----------------------------------------------------------------------------
// wxPalette
//-----------------------------------------------------------------------------
class WXDLLEXPORT wxPalette: public wxGDIObject
{
DECLARE_DYNAMIC_CLASS(wxPalette)
public:
wxPalette();
wxPalette(int n, const unsigned char *red, const unsigned char *green, const unsigned char *blue);
wxPalette(const wxPalette& palette);
~wxPalette();
wxPalette& operator = (const wxPalette& palette);
bool operator == (const wxPalette& palette) const;
bool operator != (const wxPalette& palette) const;
bool Ok() const;
bool Create(int n, const unsigned char *red, const unsigned char *green, const unsigned char *blue);
int GetPixel(const unsigned char red, const unsigned char green, const unsigned char blue) const;
bool GetRGB(int pixel, unsigned char *red, unsigned char *green, unsigned char *blue) const;
// implementation
int GetColoursCount() const;
// FIXME_MGL -- make this method standard part of wx API
// FIXME_MGL -- create wxXXXBase classes for all GDI stuff (Vadim wants that)
palette_t *GetMGLpalette_t() const;
};
#define wxColorMap wxPalette
#define wxColourMap wxPalette
#endif // __WX_PALETTE_H__

77
include/wx/mgl/pen.h Normal file
View File

@@ -0,0 +1,77 @@
/////////////////////////////////////////////////////////////////////////////
// Name: pen.h
// Purpose:
// Author: Vaclav Slavik
// Id: $Id$
// Copyright: (c) 2001 Vaclav Slavik
// Licence: wxWindows licence
/////////////////////////////////////////////////////////////////////////////
#ifndef __WX_PEN_H__
#define __WX_PEN_H__
#ifdef __GNUG__
#pragma interface "pen.h"
#endif
#include "wx/defs.h"
#include "wx/object.h"
#include "wx/string.h"
#include "wx/gdiobj.h"
#include "wx/gdicmn.h"
//-----------------------------------------------------------------------------
// classes
//-----------------------------------------------------------------------------
class WXDLLEXPORT wxBitmap;
class WXDLLEXPORT wxPen;
//-----------------------------------------------------------------------------
// wxPen
//-----------------------------------------------------------------------------
class WXDLLEXPORT wxPen: public wxGDIObject
{
public:
wxPen();
wxPen(const wxColour &colour, int width, int style);
wxPen(const wxBitmap& stipple, int width);
wxPen(const wxPen& pen);
~wxPen();
wxPen& operator = (const wxPen& pen);
bool operator == (const wxPen& pen) const;
bool operator != (const wxPen& pen) const;
void SetColour(const wxColour &colour);
void SetColour(int red, int green, int blue);
void SetCap(int capStyle);
void SetJoin(int joinStyle);
void SetStyle(int style);
void SetWidth(int width);
void SetDashes(int number_of_dashes, const wxDash *dash);
void SetStipple(const wxBitmap& stipple);
wxColour &GetColour() const;
int GetCap() const;
int GetJoin() const;
int GetStyle() const;
int GetWidth() const;
int GetDashes(wxDash **ptr) const;
int GetDashCount() const;
wxDash* GetDash() const;
wxBitmap *GetStipple() const;
bool Ok() const;
void Unshare();
// implementation:
void* GetPixPattern() const;
private:
DECLARE_DYNAMIC_CLASS(wxPen)
};
#endif // __WX_PEN_H__

51
include/wx/mgl/private.h Normal file
View File

@@ -0,0 +1,51 @@
/////////////////////////////////////////////////////////////////////////////
// Name: private.h
// Purpose: Private declarations: as this header is only included by
// wxWindows itself, it may contain identifiers which don't start
// with "wx".
// Author: Vaclav Slavik
// Created: 2001/04/07
// RCS-ID: $Id$
// Copyright: (c) 2001 Vaclav Slavik
// Licence: wxWindows licence
/////////////////////////////////////////////////////////////////////////////
#ifndef _WX_PRIVATE_H_
#define _WX_PRIVATE_H_
#include <mgraph.hpp>
class WXDLLEXPORT wxBitmap;
// ---------------------------------------------------------------------------
// private variables
// ---------------------------------------------------------------------------
extern MGLDevCtx *g_displayDC;
// ---------------------------------------------------------------------------
// helper functions
// ---------------------------------------------------------------------------
// This function converts wxBitmap into pixpattern24_t representation
// (used by wxBrush and wxPen)
extern void wxBitmapToPixPattern(const wxBitmap& bitmap,
pixpattern24_t *pix, pattern_t *mask);
// Sets current DC and restores previous one upon destruction:
class wxCurrentDCSwitcher
{
public:
wxCurrentDCSwitcher(MGLDevCtx *dc)
{ m_old = dc->makeCurrent(); }
~wxCurrentDCSwitcher()
{ MGL_makeCurrentDC(m_old); }
MGLDC *m_old;
};
#endif // _WX_PRIVATE_H_

142
include/wx/mgl/region.h Normal file
View File

@@ -0,0 +1,142 @@
/////////////////////////////////////////////////////////////////////////////
// Name: region.h
// Purpose: wxRegion class
// Author: Vaclav Slavik
// Created: 2001/03/12
// RCS-ID: $Id$
// Copyright: (c) 2001 Vaclav Slavik
// Licence: wxWindows licence
/////////////////////////////////////////////////////////////////////////////
#ifndef _WX_REGION_H_
#define _WX_REGION_H_
#ifdef __GNUG__
#pragma interface "region.h"
#endif
#include "wx/list.h"
#include "wx/gdiobj.h"
#include "wx/gdicmn.h"
#include "wx/list.h"
class WXDLLEXPORT wxRect;
class WXDLLEXPORT wxPoint;
class MGLRegion;
enum wxRegionContain
{
wxOutRegion = 0,
wxPartRegion = 1,
wxInRegion = 2
};
class WXDLLEXPORT wxRegion : public wxGDIObject
{
DECLARE_DYNAMIC_CLASS(wxRegion);
friend class WXDLLEXPORT wxRegionIterator;
public:
wxRegion(wxCoord x, wxCoord y, wxCoord w, wxCoord h);
wxRegion(const wxPoint& topLeft, const wxPoint& bottomRight);
wxRegion(const wxRect& rect);
wxRegion(const MGLRegion& region);
wxRegion();
~wxRegion();
//# Copying
inline wxRegion(const wxRegion& r)
{ Ref(r); }
inline wxRegion& operator = (const wxRegion& r)
{ Ref(r); return (*this); }
//# Modify region
// Clear current region
void Clear(void);
// Union rectangle or region with this.
bool Union(wxCoord x, wxCoord y, wxCoord width, wxCoord height);
bool Union(const wxRect& rect) { return Union(rect.x, rect.y, rect.width, rect.height); }
bool Union(const wxRegion& region);
// Intersect rectangle or region with this.
bool Intersect(wxCoord x, wxCoord y, wxCoord width, wxCoord height);
bool Intersect(const wxRect& rect) { return Intersect(rect.x, rect.y, rect.width, rect.height); }
bool Intersect(const wxRegion& region);
// Subtract rectangle or region from this:
// Combines the parts of 'this' that are not part of the second region.
bool Subtract(wxCoord x, wxCoord y, wxCoord width, wxCoord height);
bool Subtract(const wxRect& rect) { return Subtract(rect.x, rect.y, rect.width, rect.height); }
bool Subtract(const wxRegion& region);
// XOR: the union of two combined regions except for any overlapping areas.
bool Xor(wxCoord x, wxCoord y, wxCoord width, wxCoord height);
bool Xor(const wxRect& rect) { return Xor(rect.x, rect.y, rect.width, rect.height); }
bool Xor(const wxRegion& region);
//# Information on region
// Outer bounds of region
void GetBox(wxCoord& x, wxCoord& y, wxCoord&w, wxCoord &h) const;
wxRect GetBox(void) const ;
// Is region empty?
bool Empty(void) const;
inline bool IsEmpty(void) const { return Empty(); }
//# Tests
// Does the region contain the point (x,y)?
wxRegionContain Contains(wxCoord x, wxCoord y) const;
// Does the region contain the point pt?
wxRegionContain Contains(const wxPoint& pt) const;
// Does the region contain the rectangle (x, y, w, h)?
wxRegionContain Contains(wxCoord x, wxCoord y, wxCoord w, wxCoord h) const;
// Does the region contain the rectangle rect?
wxRegionContain Contains(const wxRect& rect) const;
// implementation from now on:
const MGLRegion& GetMGLRegion() const;
private:
void Unshare();
};
WX_DECLARE_EXPORTED_LIST(wxRect, wxRegionRectList);
class WXDLLEXPORT wxRegionIterator : public wxObject
{
DECLARE_DYNAMIC_CLASS(wxRegionIterator);
public:
wxRegionIterator(void);
wxRegionIterator(const wxRegion& region);
~wxRegionIterator(void);
void Reset(void) { m_currentNode = NULL; }
void Reset(const wxRegion& region);
#ifndef __SALFORDC__
operator bool (void) const { return (m_currentNode != NULL); }
#endif
bool HaveRects(void) const { return (m_currentNode != NULL); }
void operator ++ (void);
void operator ++ (int);
wxCoord GetX(void) const;
wxCoord GetY(void) const;
wxCoord GetW(void) const;
wxCoord GetWidth(void) const { return GetW(); }
wxCoord GetH(void) const;
wxCoord GetHeight(void) const { return GetH(); }
wxRect GetRect() const { return wxRect(GetX(), GetY(), GetWidth(), GetHeight()); }
private:
wxRegionRectList m_rects;
wxRegionRectList::Node *m_currentNode;
};
#endif
// _WX_REGION_H_

43
include/wx/mgl/settings.h Normal file
View File

@@ -0,0 +1,43 @@
/////////////////////////////////////////////////////////////////////////////
// Name: settings.h
// Purpose:
// Author: Robert Roebling
// Id: $Id$
// Copyright: (c) 1998 Robert Roebling
// Licence: wxWindows licence
/////////////////////////////////////////////////////////////////////////////
#ifndef __GTKSETTINGSH__
#define __GTKSETTINGSH__
#ifdef __GNUG__
#pragma interface "settings.h"
#endif
#include "wx/defs.h"
#include "wx/gdicmn.h"
#include "wx/pen.h"
#include "wx/font.h"
// FIXME_MGL - probably belongs to wxUniversal
class wxSystemSettings: public wxObject
{
public:
inline wxSystemSettings() {}
inline static void Init() {}
static void Done() {}
// Get a system colour
static wxColour GetSystemColour(int index) {}
// Get a system font
static wxFont GetSystemFont(int index) {}
// Get a system metric, e.g. scrollbar size
static int GetSystemMetric(int index) {}
};
#endif
// __GTKSETTINGSH__

45
include/wx/mgl/timer.h Normal file
View File

@@ -0,0 +1,45 @@
/////////////////////////////////////////////////////////////////////////////
// Name: timer.h
// Purpose:
// Author: Vaclav Slavik
// Id: $Id$
// Copyright: (c) 2001 Vaclav Slavik
// Licence: wxWindows licence
/////////////////////////////////////////////////////////////////////////////
#ifndef __WX_TIMER_H__
#define __WX_TIMER_H__
#ifdef __GNUG__
#pragma interface "timer.h"
#endif
//-----------------------------------------------------------------------------
// wxTimer
//-----------------------------------------------------------------------------
//FIXME_MGL
class WXDLLEXPORT wxTimer : public wxTimerBase
{
public:
wxTimer() { Init(); }
wxTimer(wxEvtHandler *owner, int id = -1) : wxTimerBase(owner, id)
{ Init(); }
~wxTimer() {}
virtual bool Start( int millisecs = -1, bool oneShot = FALSE ) {}
virtual void Stop() {}
virtual bool IsRunning() const { return m_tag != -1; }
protected:
void Init() {}
int m_tag;
private:
DECLARE_ABSTRACT_CLASS(wxTimer)
};
#endif // __GTKTIMERH__

127
include/wx/mgl/window.h Normal file
View File

@@ -0,0 +1,127 @@
/////////////////////////////////////////////////////////////////////////////
// Name: window.h
// Purpose:
// Author: Vaclav Slavik
// Id: $Id$
// Copyright: (c) 2001 Vaclav Slavik
// Licence: wxWindows licence
/////////////////////////////////////////////////////////////////////////////
#ifndef __WX_WINDOW_H__
#define __WX_WINDOW_H__
#ifdef __GNUG__
#pragma interface "window.h"
#endif
//-----------------------------------------------------------------------------
// wxWindow
//-----------------------------------------------------------------------------
class WXDLLEXPORT wxWindowMGL : public wxWindowBase
{
DECLARE_DYNAMIC_CLASS(wxWindowMGL)
public:
// creating the window
// -------------------
wxWindowMGL() {}
wxWindowMGL(wxWindow *parent,
wxWindowID id,
const wxPoint& pos = wxDefaultPosition,
const wxSize& size = wxDefaultSize,
long style = 0,
const wxString& name = wxPanelNameStr) {}
bool Create(wxWindow *parent,
wxWindowID id,
const wxPoint& pos = wxDefaultPosition,
const wxSize& size = wxDefaultSize,
long style = 0,
const wxString& name = wxPanelNameStr) {}
virtual ~wxWindowMGL() {}
// implement base class (pure) virtual methods
// -------------------------------------------
virtual bool Destroy() {return TRUE;}
virtual void Raise() {}
virtual void Lower() {}
virtual bool Show( bool show = TRUE ) {return TRUE;}
virtual bool Enable( bool enable = TRUE ) {return TRUE;}
virtual bool IsRetained() const {return TRUE;}
virtual void SetFocus() {}
virtual bool AcceptsFocus() const {return TRUE;}
virtual bool Reparent( wxWindowBase *newParent ) {return TRUE;}
virtual void WarpPointer(int x, int y) {}
virtual void CaptureMouse() {}
virtual void ReleaseMouse() {}
virtual void Refresh( bool eraseBackground = TRUE,
const wxRect *rect = (const wxRect *) NULL ) {}
virtual void Clear() {}
virtual bool SetBackgroundColour( const wxColour &colour ) {return TRUE;}
virtual bool SetForegroundColour( const wxColour &colour ) {return TRUE;}
virtual bool SetCursor( const wxCursor &cursor ) {return TRUE;}
virtual bool SetFont( const wxFont &font ) {return TRUE;}
virtual int GetCharHeight() const {return 0;}
virtual int GetCharWidth() const {return 0;}
virtual void GetTextExtent(const wxString& string,
int *x, int *y,
int *descent = (int *) NULL,
int *externalLeading = (int *) NULL,
const wxFont *theFont = (const wxFont *) NULL)
const {}
virtual bool DoPopupMenu( wxMenu *menu, int x, int y ) {return TRUE;}
virtual void SetScrollbar( int orient, int pos, int thumbVisible,
int range, bool refresh = TRUE ) {}
virtual void SetScrollPos( int orient, int pos, bool refresh = TRUE ) {}
virtual int GetScrollPos( int orient ) const {return 0;}
virtual int GetScrollThumb( int orient ) const {return 0;}
virtual int GetScrollRange( int orient ) const {return 0;}
virtual void ScrollWindow( int dx, int dy,
const wxRect* rect = (wxRect *) NULL ) {}
#if wxUSE_DRAG_AND_DROP
virtual void SetDropTarget( wxDropTarget *dropTarget ) {}
#endif // wxUSE_DRAG_AND_DROP
virtual WXWidget GetHandle() const { return NULL; }
/* For compatibility across platforms (not in event table) */
void OnIdle(wxIdleEvent& WXUNUSED(event)) {};
// implement the base class pure virtuals
virtual void DoClientToScreen( int *x, int *y ) const {}
virtual void DoScreenToClient( int *x, int *y ) const {}
virtual void DoGetPosition( int *x, int *y ) const {}
virtual void DoGetSize( int *width, int *height ) const {}
virtual void DoGetClientSize( int *width, int *height ) const {}
virtual void DoSetSize(int x, int y,
int width, int height,
int sizeFlags = wxSIZE_AUTO) {}
virtual void DoSetClientSize(int width, int height) {}
virtual void DoMoveWindow(int x, int y, int width, int height) {}
#if wxUSE_TOOLTIPS
virtual void DoSetToolTip( wxToolTip *tip ) {}
#endif // wxUSE_TOOLTIPS
// common part of all ctors (can't be virtual because called from ctor)
void Init() {}
private:
DECLARE_NO_COPY_CLASS(wxWindowMGL);
};
#endif // ___WX_WINDOW_H__