Some more Motif work; included utils.h in fileconf.cpp (for wxGetHomeDir or something)

git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@768 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
This commit is contained in:
Julian Smart
1998-09-22 21:15:56 +00:00
parent dcf40a56e7
commit 16c1f7f345
37 changed files with 2086 additions and 302 deletions

View File

@@ -3,12 +3,15 @@ src/motif/*.c
src/motif/*.h src/motif/*.h
src/motif/makefile* src/motif/makefile*
src/motif/*.inc src/motif/*.inc
src/motif/*.xbm
src/make.env src/make.env
src/makeprog.env src/makeprog.env
include/wx/motif/*.h include/wx/motif/*.h
docs/motif/*.*
lib/dummy lib/dummy

13
docs/motif/changes.txt Normal file
View File

@@ -0,0 +1,13 @@
wxMotif CHANGES
---------------
21/9/98
-------
Julian:
- Made makefiles for wxMotif source directory and minimal sample.
- First go at wxApp, wxWindow, wxDialog, wxPen, wxBrush, wxFont,
wxColour, wxButton, wxCheckBox, wxTextCtrl, wxStaticText,
wxMenu, wxMenuItem, wxMenuBar

73
docs/motif/todo.txt Normal file
View File

@@ -0,0 +1,73 @@
wxMotif TODO
------------
Updated: 21/9/98
-------------------------------o-------------------------
- wxDCs
- wxBitmap, wxIcon, wxCursor, wxPalette. What about XPMs, can we assume
libxpm exists and use that? What about PNGs? Can we use gdk
as per wxGTK? Probably not.
- wxRegion
- Bitmap versions of widgets (wxBitmapButton etc.)
- wxCheckBoxList
- Remaining common widgets (wxListBox, wxRadioBox, wxRadioButton, wxChoice,
wxGauge, wxComboBox etc.). Use combobox.c code as bundled in wxWin 1.68.
- wxTextCtrl text file loading and saving.
- Scrolling in wxWindow.
- A generic version of wxNotebook that can be used in wxMotif and
other toolkits that don't have a native control. Perhaps use wxTab as a
starting point.
- MDI classes: use existing Motif widgets for this.
- Miscellaneous classes e.g. wxJoystick (identical to GTK's one for
Linux)
- Dialogs e.g. wxFileSelector. Use a native Motif wxMessageBox.
Some others need tidying, such as the colour and font selectors.
- Write generic wxDirDialog (directory selector).
- Use generic wxTreeCtrl, wxListCtrl: enhance these.
- Write a better generic wxToolBar class than wxToolBarSimple.
- Optimize colour management so we don't get clashes when e.g.
Netscape is running.
- Print/preview framework in print.cpp (see wxGTK's).
- Colour and font setting in widgets.
- wxSystemSettings
- wxTimer
- wxThread (hopefully, similar to wxGTK)
- Copy and paste, drag and drop. Use a standard X drag
and drop standard - see http://www.cco.caltech.edu/~jafl/xdnd/
- Optimize screen refresh for non-native widgets, e.g. wxWindow
created with Create(), using technique in flicker patch for 1.68
(see JACS for latest patch).
- Enhance event handling such that you override e.g. left-click
and unless you call the base OnMouseEvent, the click won't be
sent to the button. Required for Dialog Editor.
- Write makefiles for all samples.
- Create some samples for testing.
- Get Dialog Editor working under Motif.

View File

@@ -104,6 +104,10 @@
typedef unsigned int bool; typedef unsigned int bool;
#endif #endif
#if defined(_MSC_VER) && (_MSC_VER == 1020)
#define bool unsigned int
#endif
#if ( defined(_MSC_VER) && (_MSC_VER <= 800) ) || defined(__GNUWIN32__) #if ( defined(_MSC_VER) && (_MSC_VER <= 800) ) || defined(__GNUWIN32__)
#define byte unsigned char #define byte unsigned char
#endif #endif

View File

@@ -311,7 +311,7 @@ public:
bool SetItemState(long item, long state, long stateMask); bool SetItemState(long item, long state, long stateMask);
void AdjustMyScrollbars(); void AdjustMyScrollbars();
void PaintLevel( wxGenericTreeItem *item, wxPaintDC &dc, int level, int &y ); void PaintLevel( wxGenericTreeItem *item, wxDC &dc, int level, int &y );
void OnPaint( const wxPaintEvent &event ); void OnPaint( const wxPaintEvent &event );
void OnSetFocus( const wxFocusEvent &event ); void OnSetFocus( const wxFocusEvent &event );
void OnKillFocus( const wxFocusEvent &event ); void OnKillFocus( const wxFocusEvent &event );
@@ -338,7 +338,7 @@ private:
wxImageList *m_imageList; wxImageList *m_imageList;
wxImageList *m_smallImageList; wxImageList *m_smallImageList;
void CalculateLevel( wxGenericTreeItem *item, wxPaintDC &dc, int level, int &y ); void CalculateLevel( wxGenericTreeItem *item, wxDC &dc, int level, int &y );
void CalculatePositions(); void CalculatePositions();
wxGenericTreeItem *FindItem( long itemId ) const; wxGenericTreeItem *FindItem( long itemId ) const;
void RefreshLine( wxGenericTreeItem *item ); void RefreshLine( wxGenericTreeItem *item );

View File

@@ -57,7 +57,7 @@ void wxDebugFree(void * buf, bool isVect = FALSE);
void * operator new (size_t size, char * fileName, int lineNum); void * operator new (size_t size, char * fileName, int lineNum);
void operator delete (void * buf); void operator delete (void * buf);
#if !( defined (_MSC_VER) && (_MSC_VER <= 1000) ) #if !( defined (_MSC_VER) && (_MSC_VER <= 1020) )
void * operator new[] (size_t size, char * fileName, int lineNum); void * operator new[] (size_t size, char * fileName, int lineNum);
void operator delete[] (void * buf); void operator delete[] (void * buf);
#endif #endif

View File

@@ -54,13 +54,10 @@ public:
bool Create(const wxBitmap& bitmap, int paletteIndex); bool Create(const wxBitmap& bitmap, int paletteIndex);
bool Create(const wxBitmap& bitmap); bool Create(const wxBitmap& bitmap);
/* TODO: platform-specific data access inline WXPixmap GetPixmap() const { return m_pixmap; }
// Implementation
inline WXHBITMAP GetMaskBitmap() const { return m_maskBitmap; }
inline void SetMaskBitmap(WXHBITMAP bmp) { m_maskBitmap = bmp; }
protected: protected:
WXHBITMAP m_maskBitmap; WXPixmap m_pixmap;
*/
}; };
class WXDLLEXPORT wxBitmapRefData: public wxGDIRefData class WXDLLEXPORT wxBitmapRefData: public wxGDIRefData
@@ -81,8 +78,12 @@ public:
wxPalette m_bitmapPalette; wxPalette m_bitmapPalette;
int m_quality; int m_quality;
/* WXHBITMAP m_hBitmap; TODO: platform-specific handle */
wxMask * m_bitmapMask; // Optional mask wxMask * m_bitmapMask; // Optional mask
// Motif implementation
public:
WXPixmap m_pixmap;
WXDisplay* m_display;
}; };
#define M_BITMAPDATA ((wxBitmapRefData *)m_refData) #define M_BITMAPDATA ((wxBitmapRefData *)m_refData)
@@ -182,16 +183,15 @@ public:
static void InitStandardHandlers(); static void InitStandardHandlers();
static void CleanUpHandlers(); static void CleanUpHandlers();
// Motif implementation
public:
inline WXDisplay* GetDisplay() const { return M_BITMAPDATA->m_display; }
inline WXDisplay* GetPixmap() const { return M_BITMAPDATA->m_pixmap; }
protected: protected:
static wxList sm_handlers; static wxList sm_handlers;
/*
// TODO: Implementation
public:
void SetHBITMAP(WXHBITMAP bmp);
inline WXHBITMAP GetHBITMAP() const { return (M_BITMAPDATA ? M_BITMAPDATA->m_hBitmap : 0); }
bool FreeResource(bool force = FALSE);
*/
}; };
#endif #endif

View File

@@ -53,17 +53,17 @@ public:
inline bool operator != (const wxColour& colour) { return (!(m_red == colour.m_red && m_green == colour.m_green && m_blue == colour.m_blue)); } inline bool operator != (const wxColour& colour) { return (!(m_red == colour.m_red && m_green == colour.m_green && m_blue == colour.m_blue)); }
inline int GetPixel() const { return m_pixel; }; inline int GetPixel() const { return m_pixel; };
inline void SetPixel(int pixel) { m_pixel = pixel; }; inline void SetPixel(int pixel) { m_pixel = pixel; m_isInit = TRUE; };
// Allocate a colour, or nearest colour, using the given display. // Allocate a colour, or nearest colour, using the given display.
// If realloc is TRUE, ignore the existing pixel, otherwise just return // If realloc is TRUE, ignore the existing pixel, otherwise just return
// the existing one. // the existing one.
// Returns FALSE if an exact match was not found, TRUE otherwise. // Returns the allocated pixel.
// TODO: can this handle mono displays? If not, we should have an extra // TODO: can this handle mono displays? If not, we should have an extra
// flag to specify whether this should be black or white by default. // flag to specify whether this should be black or white by default.
bool AllocColour(WXDisplay* display, bool realloc); int AllocColour(WXDisplay* display, bool realloc = FALSE);
private: private:
bool m_isInit; bool m_isInit;

View File

@@ -238,7 +238,7 @@ class WXDLLEXPORT wxDC: public wxObject
virtual void SetAxisOrientation( bool xLeftRight, bool yBottomUp ); virtual void SetAxisOrientation( bool xLeftRight, bool yBottomUp );
virtual void SetOptimization( bool WXUNUSED(optimize) ) {}; virtual void SetOptimization( bool optimize ) { m_optimize = optimize; };
virtual bool GetOptimization(void) { return m_optimize; }; virtual bool GetOptimization(void) { return m_optimize; };
virtual long DeviceToLogicalX(long x) const; virtual long DeviceToLogicalX(long x) const;
@@ -293,6 +293,15 @@ class WXDLLEXPORT wxDC: public wxObject
else else
return (long)((double)(new_x) * m_scaleX - 0.5) * m_signX + m_deviceOriginX; return (long)((double)(new_x) * m_scaleX - 0.5) * m_signX + m_deviceOriginX;
} }
// Without device translation, for backing pixmap purposes
long XLOG2DEV_2(long x) const
{
long new_x = x - m_logicalOriginX;
if (new_x > 0)
return (long)((double)(new_x) * m_scaleX + 0.5) * m_signX;
else
return (long)((double)(new_x) * m_scaleX - 0.5) * m_signX;
}
long XLOG2DEVREL(long x) const long XLOG2DEVREL(long x) const
{ {
if (x > 0) if (x > 0)
@@ -308,6 +317,15 @@ class WXDLLEXPORT wxDC: public wxObject
else else
return (long)((double)(new_y) * m_scaleY - 0.5) * m_signY + m_deviceOriginY; return (long)((double)(new_y) * m_scaleY - 0.5) * m_signY + m_deviceOriginY;
} }
// Without device translation, for backing pixmap purposes
long YLOG2DEV_2(long y) const
{
long new_y = y - m_logicalOriginY;
if (new_y > 0)
return (long)((double)(new_y) * m_scaleY + 0.5) * m_signY;
else
return (long)((double)(new_y) * m_scaleY - 0.5) * m_signY;
}
long YLOG2DEVREL(long y) const long YLOG2DEVREL(long y) const
{ {
if (y > 0) if (y > 0)
@@ -326,6 +344,8 @@ class WXDLLEXPORT wxDC: public wxObject
// not sure, what these mean // not sure, what these mean
bool m_clipping; // Is clipping on right now ? bool m_clipping; // Is clipping on right now ?
bool m_optimize; // wxMSW only ? bool m_optimize; // wxMSW only ?
bool m_isInteractive; // For wxPostScriptDC
wxString m_filename; // Ditto
wxPen m_pen; wxPen m_pen;
wxBrush m_brush; wxBrush m_brush;

View File

@@ -28,9 +28,6 @@ class WXDLLEXPORT wxWindow;
// Under Windows, wxClientDC, wxPaintDC and wxWindowDC are implemented differently. // Under Windows, wxClientDC, wxPaintDC and wxWindowDC are implemented differently.
// On many platforms, however, they will be the same. // On many platforms, however, they will be the same.
typedef wxWindowDC wxClientDC;
typedef wxWindowDC wxPaintDC;
//----------------------------------------------------------------------------- //-----------------------------------------------------------------------------
// wxWindowDC // wxWindowDC
//----------------------------------------------------------------------------- //-----------------------------------------------------------------------------
@@ -96,17 +93,22 @@ class WXDLLEXPORT wxWindowDC: public wxDC
virtual void DrawOpenSpline( wxList *points ); virtual void DrawOpenSpline( wxList *points );
// Motif-specific
void SetDCClipping (); // Helper function for setting clipping
protected: protected:
WXGC m_gc; WXGC m_gc;
WXGC m_gcBacking; WXGC m_gcBacking;
WXDisplay* m_display; WXDisplay* m_display;
wxWindow* m_window; wxWindow* m_window;
WXRegion m_clippingRegion; WXRegion m_currentRegion; // Current clipping region (incl. paint clip region)
WXRegion m_userRegion; // User-defined clipping region
WXPixmap m_pixmap; // Pixmap for drawing on
// Not sure if we'll need all of these // Not sure if we'll need all of these
int m_backgroundPixel; int m_backgroundPixel;
wxColour m_currentColour; wxColour m_currentColour;
int m_currentBkMode; // int m_currentBkMode;
int m_currentPenWidth ; int m_currentPenWidth ;
int m_currentPenJoin ; int m_currentPenJoin ;
int m_currentPenCap ; int m_currentPenCap ;
@@ -115,6 +117,23 @@ protected:
wxBitmap m_currentStipple ; wxBitmap m_currentStipple ;
int m_currentStyle ; int m_currentStyle ;
int m_currentFill ; int m_currentFill ;
int m_autoSetting ; // See comment in dcclient.cpp
};
class WXDLLEXPORT wxPaintDC: public wxWindowDC
{
DECLARE_DYNAMIC_CLASS(wxPaintDC)
public:
wxPaintDC() {}
wxPaintDC(wxWindow* win): wxWindowDC(win) {}
};
class WXDLLEXPORT wxClientDC: public wxWindowDC
{
DECLARE_DYNAMIC_CLASS(wxClientDC)
public:
wxClientDC() {}
wxClientDC(wxWindow* win): wxWindowDC(win) {}
}; };
#endif #endif

View File

@@ -18,7 +18,7 @@
#include "wx/dcclient.h" #include "wx/dcclient.h"
class WXDLLEXPORT wxMemoryDC: public wxPaintDC class WXDLLEXPORT wxMemoryDC: public wxWindowDC
{ {
DECLARE_DYNAMIC_CLASS(wxMemoryDC) DECLARE_DYNAMIC_CLASS(wxMemoryDC)
@@ -29,9 +29,11 @@ class WXDLLEXPORT wxMemoryDC: public wxPaintDC
virtual void SelectObject( const wxBitmap& bitmap ); virtual void SelectObject( const wxBitmap& bitmap );
void GetSize( int *width, int *height ) const; void GetSize( int *width, int *height ) const;
inline wxBitmap& GetBitmap() const { return (wxBitmap&) m_bitmap; }
private: private:
friend wxPaintDC; friend wxPaintDC;
wxBitmap m_selected; wxBitmap m_bitmap;
}; };
#endif #endif

View File

@@ -25,11 +25,6 @@ class WXDLLEXPORT wxIconRefData: public wxBitmapRefData
public: public:
wxIconRefData(); wxIconRefData();
~wxIconRefData(); ~wxIconRefData();
public:
/* TODO: whatever your actual icon handle is
WXHICON m_hIcon;
*/
}; };
#define M_ICONDATA ((wxIconRefData *)m_refData) #define M_ICONDATA ((wxIconRefData *)m_refData)
@@ -59,11 +54,6 @@ public:
inline bool operator == (const wxIcon& icon) { return m_refData == icon.m_refData; } inline bool operator == (const wxIcon& icon) { return m_refData == icon.m_refData; }
inline bool operator != (const wxIcon& icon) { return m_refData != icon.m_refData; } inline bool operator != (const wxIcon& icon) { return m_refData != icon.m_refData; }
/* TODO: implementation
void SetHICON(WXHICON ico);
inline WXHICON GetHICON() const { return (M_ICONDATA ? M_ICONDATA->m_hIcon : 0); }
*/
/* TODO */ /* TODO */
virtual bool Ok() const { return (m_refData != NULL) ; } virtual bool Ok() const { return (m_refData != NULL) ; }
}; };

View File

@@ -26,10 +26,9 @@ class WXDLLEXPORT wxPaletteRefData: public wxGDIRefData
public: public:
wxPaletteRefData(); wxPaletteRefData();
~wxPaletteRefData(); ~wxPaletteRefData();
/* TODO: implementation
protected: protected:
WXHPALETTE m_hPalette; WXColormap m_colormap;
*/
}; };
#define M_PALETTEDATA ((wxPaletteRefData *)m_refData) #define M_PALETTEDATA ((wxPaletteRefData *)m_refData)
@@ -55,10 +54,7 @@ public:
inline bool operator == (const wxPalette& palette) { return m_refData == palette.m_refData; } inline bool operator == (const wxPalette& palette) { return m_refData == palette.m_refData; }
inline bool operator != (const wxPalette& palette) { return m_refData != palette.m_refData; } inline bool operator != (const wxPalette& palette) { return m_refData != palette.m_refData; }
/* TODO: implementation WXColormap GetXColormap() const { return (M_PALETTEDATA->m_colormap); }
inline WXHPALETTE GetHPALETTE() const { return (M_PALETTEDATA ? M_PALETTEDATA->m_hPalette : 0); }
void SetHPALETTE(WXHPALETTE pal);
*/
}; };
#endif #endif

View File

@@ -84,6 +84,8 @@ public:
inline int GetDashes(wxDash **ptr) const { inline int GetDashes(wxDash **ptr) const {
*ptr = (M_PENDATA ? M_PENDATA->m_dash : (wxDash*) NULL); return (M_PENDATA ? M_PENDATA->m_nbDash : 0); *ptr = (M_PENDATA ? M_PENDATA->m_dash : (wxDash*) NULL); return (M_PENDATA ? M_PENDATA->m_nbDash : 0);
} }
inline int GetDashCount() const { return (M_PENDATA->m_nbDash); }
inline wxDash* GetDash() const { return (M_PENDATA->m_dash); }
inline wxBitmap *GetStipple() const { return (M_PENDATA ? (& M_PENDATA->m_stipple) : (wxBitmap*) NULL); }; inline wxBitmap *GetStipple() const { return (M_PENDATA ? (& M_PENDATA->m_stipple) : (wxBitmap*) NULL); };

View File

@@ -85,8 +85,8 @@ class WXDLLEXPORT wxWindow: public wxEvtHandler
{ {
DECLARE_ABSTRACT_CLASS(wxWindow) DECLARE_ABSTRACT_CLASS(wxWindow)
friend class wxDC; friend class WXDLLEXPORT wxDC;
friend class wxPaintDC; friend class WXDLLEXPORT wxWindowDC;
public: public:
wxWindow(); wxWindow();
@@ -479,7 +479,11 @@ public:
// Get the underlying X window and display // Get the underlying X window and display
virtual WXWindow GetXWindow() const; virtual WXWindow GetXWindow() const;
virtual WXDisplay *GetXDisplay() const; virtual WXDisplay *GetXDisplay() const;
virtual WXPixmap GetBackingPixmap() const { return m_backingPixmap; } virtual WXPixmap GetBackingPixmap() const { return m_backingPixmap; }
inline int GetPixmapWidth() const { return m_pixmapWidth; }
inline int GetPixmapHeight() const { return m_pixmapHeight; }
virtual WXRegion GetPaintRegion() const { return m_paintRegion; }
// Change properties // Change properties
virtual void ChangeColour(WXWidget widget); virtual void ChangeColour(WXWidget widget);
@@ -548,6 +552,7 @@ public:
int m_lastButton; // last pressed button int m_lastButton; // last pressed button
wxList m_updateRects; // List of wxRectangles representing damaged region wxList m_updateRects; // List of wxRectangles representing damaged region
bool m_isShown; bool m_isShown;
WXRegion m_paintRegion; // Clip region generated by expose event
protected: protected:
WXWidget m_mainWidget; WXWidget m_mainWidget;
WXWidget m_hScrollBar; WXWidget m_hScrollBar;

View File

@@ -37,6 +37,7 @@
#include <wx/log.h> #include <wx/log.h>
#include <wx/textfile.h> #include <wx/textfile.h>
#include <wx/confbase.h> #include <wx/confbase.h>
#include <wx/utils.h>
// we must include (one of) these files for wxConfigBase::Create // we must include (one of) these files for wxConfigBase::Create
#if defined(__WXMSW__) && defined(wxCONFIG_WIN32_NATIVE) #if defined(__WXMSW__) && defined(wxCONFIG_WIN32_NATIVE)
@@ -134,7 +135,7 @@ bool wxConfigBase::Read(const wxString& key, long *pl, long defVal) const
bool wxConfigBase::Read(const wxString& key, double* val) const bool wxConfigBase::Read(const wxString& key, double* val) const
{ {
wxString str; wxString str;
if (Read(key, str)) if (Read(key, & str))
{ {
*val = atof(str); *val = atof(str);
return TRUE; return TRUE;

View File

@@ -39,6 +39,7 @@
#include <wx/textfile.h> #include <wx/textfile.h>
#include <wx/config.h> #include <wx/config.h>
#include <wx/fileconf.h> #include <wx/fileconf.h>
#include <wx/utils.h>
// _WINDOWS_ is defined when windows.h is included, // _WINDOWS_ is defined when windows.h is included,
// __WXMSW__ is defined for MS Windows compilation // __WXMSW__ is defined for MS Windows compilation

View File

@@ -912,7 +912,7 @@ void * operator new (size_t size, char * fileName, int lineNum)
#endif #endif
} }
#if !( defined (_MSC_VER) && (_MSC_VER <= 1000) ) #if !( defined (_MSC_VER) && (_MSC_VER <= 1020) )
void * operator new[] (size_t size, char * fileName, int lineNum) void * operator new[] (size_t size, char * fileName, int lineNum)
{ {
#ifdef NO_DEBUG_ALLOCATION #ifdef NO_DEBUG_ALLOCATION
@@ -932,7 +932,7 @@ void operator delete (void * buf)
#endif #endif
} }
#if !( defined (_MSC_VER) && (_MSC_VER <= 1000) ) #if !( defined (_MSC_VER) && (_MSC_VER <= 1020) )
void operator delete[] (void * buf) void operator delete[] (void * buf)
{ {
#ifdef NO_DEBUG_ALLOCATION #ifdef NO_DEBUG_ALLOCATION

View File

@@ -351,7 +351,7 @@ void wxPostScriptDC::DrawArc (long x1, long y1, long x2, long y2, long xc, long
long dx = x1 - xc; long dx = x1 - xc;
long dy = y1 - yc; long dy = y1 - yc;
long radius = (long) sqrt(dx*dx+dy*dy); long radius = (long) sqrt((double) (dx*dx+dy*dy));
double alpha1, alpha2; double alpha1, alpha2;
if (x1 == x2 && y1 == y2) { if (x1 == x2 && y1 == y2) {
@@ -1214,8 +1214,8 @@ void wxPostScriptDC::EndDoc (void)
// The Adobe specifications call for integers; we round as to make // The Adobe specifications call for integers; we round as to make
// the bounding larger. // the bounding larger.
*m_pstream << "%%BoundingBox: " *m_pstream << "%%BoundingBox: "
<< floor(llx) << " " << floor(lly) << " " << floor((double)llx) << " " << floor((double)lly) << " "
<< ceil(urx) << " " << ceil(ury) << "\n"; << ceil((double)urx) << " " << ceil((double)ury) << "\n";
*m_pstream << "%%Pages: " << wxPageNumber - 1 << "\n"; *m_pstream << "%%Pages: " << wxPageNumber - 1 << "\n";
*m_pstream << "%%EndComments\n\n"; *m_pstream << "%%EndComments\n\n";
@@ -1417,10 +1417,10 @@ Blit (long xdest, long ydest, long fwidth, long fheight,
if (!source->IsKindOf(CLASSINFO(wxPaintDC))) return FALSE; if (!source->IsKindOf(CLASSINFO(wxPaintDC))) return FALSE;
width = (long)floor(fwidth); width = (long)floor((double)fwidth);
height = (long)floor(fheight); height = (long)floor((double)fheight);
x = (long)floor(xsrc); x = (long)floor((double)xsrc);
y = (long)floor(ysrc); y = (long)floor((double)ysrc);
/* PostScript setup: */ /* PostScript setup: */
*m_pstream << "gsave\n"; *m_pstream << "gsave\n";

View File

@@ -318,7 +318,7 @@ void wxStatusBar::InitColours(void)
m_hilightPen = wxPen("WHITE", 1, wxSOLID); m_hilightPen = wxPen("WHITE", 1, wxSOLID);
#endif #endif
m_defaultStatusBarFont = wxSystemSettings::GetSystemFont(wxSYS_DEFAULT_GUI_FONT); m_defaultStatusBarFont = wxSystemSettings::GetSystemFont(wxSYS_DEFAULT_GUI_FONT);
SetBackgroundColour(wxSystemSettings::GetSystemColour(wxSYS_COLOUR_3DFACE)); SetBackgroundColour(wxSystemSettings::GetSystemColour(wxSYS_COLOUR_3DFACE));
} }

View File

@@ -934,7 +934,7 @@ void wxTreeCtrl::AdjustMyScrollbars()
} }
} }
void wxTreeCtrl::PaintLevel( wxGenericTreeItem *item, wxPaintDC &dc, int level, int &y ) void wxTreeCtrl::PaintLevel( wxGenericTreeItem *item, wxDC &dc, int level, int &y )
{ {
int horizX = level*m_indent; int horizX = level*m_indent;
@@ -1088,7 +1088,7 @@ void wxTreeCtrl::OnMouse( const wxMouseEvent &event )
} }
} }
void wxTreeCtrl::CalculateLevel( wxGenericTreeItem *item, wxPaintDC &dc, int level, int &y ) void wxTreeCtrl::CalculateLevel( wxGenericTreeItem *item, wxDC &dc, int level, int &y )
{ {
int horizX = level*m_indent; int horizX = level*m_indent;

6
src/motif/bdiag.xbm Normal file
View File

@@ -0,0 +1,6 @@
#define bdiag_width 16
#define bdiag_height 16
static char bdiag_bits[] = {
0x80, 0x80, 0x40, 0x40, 0x20, 0x20, 0x10, 0x10, 0x08, 0x08, 0x04, 0x04,
0x02, 0x02, 0x01, 0x01, 0x80, 0x80, 0x40, 0x40, 0x20, 0x20, 0x10, 0x10,
0x08, 0x08, 0x04, 0x04, 0x02, 0x02, 0x01, 0x01};

View File

@@ -34,6 +34,9 @@ wxBitmapRefData::wxBitmapRefData()
m_quality = 0; m_quality = 0;
m_numColors = 0; m_numColors = 0;
m_bitmapMask = NULL; m_bitmapMask = NULL;
m_pixmap = (WXPixmap) 0;
m_display = (WXDisplay*) 0;
} }
wxBitmapRefData::~wxBitmapRefData() wxBitmapRefData::~wxBitmapRefData()
@@ -296,18 +299,15 @@ wxBitmapHandler *wxBitmap::FindHandler(long bitmapType)
wxMask::wxMask() wxMask::wxMask()
{ {
/* TODO m_pixmap = (WXPixmap) 0;
m_maskBitmap = 0;
*/
} }
// Construct a mask from a bitmap and a colour indicating // Construct a mask from a bitmap and a colour indicating
// the transparent area // the transparent area
wxMask::wxMask(const wxBitmap& bitmap, const wxColour& colour) wxMask::wxMask(const wxBitmap& bitmap, const wxColour& colour)
{ {
/* TODO m_pixmap = (WXPixmap) 0;
m_maskBitmap = 0;
*/
Create(bitmap, colour); Create(bitmap, colour);
} }
@@ -315,9 +315,7 @@ wxMask::wxMask(const wxBitmap& bitmap, const wxColour& colour)
// the transparent area // the transparent area
wxMask::wxMask(const wxBitmap& bitmap, int paletteIndex) wxMask::wxMask(const wxBitmap& bitmap, int paletteIndex)
{ {
/* TODO m_pixmap = (WXPixmap) 0;
m_maskBitmap = 0;
*/
Create(bitmap, paletteIndex); Create(bitmap, paletteIndex);
} }
@@ -325,9 +323,7 @@ wxMask::wxMask(const wxBitmap& bitmap, int paletteIndex)
// Construct a mask from a mono bitmap (copies the bitmap). // Construct a mask from a mono bitmap (copies the bitmap).
wxMask::wxMask(const wxBitmap& bitmap) wxMask::wxMask(const wxBitmap& bitmap)
{ {
/* TODO m_pixmap = (WXPixmap) 0;
m_maskBitmap = 0;
*/
Create(bitmap); Create(bitmap);
} }

6
src/motif/cdiag.xbm Normal file
View File

@@ -0,0 +1,6 @@
#define cdiag_width 16
#define cdiag_height 16
static char cdiag_bits[] = {
0x81, 0x81, 0x42, 0x42, 0x24, 0x24, 0x18, 0x18, 0x18, 0x18, 0x24, 0x24,
0x42, 0x42, 0x81, 0x81, 0x81, 0x81, 0x42, 0x42, 0x24, 0x24, 0x18, 0x18,
0x18, 0x18, 0x24, 0x24, 0x42, 0x42, 0x81, 0x81};

View File

@@ -128,15 +128,15 @@ void wxColour::Set (unsigned char r, unsigned char g, unsigned char b)
// Allocate a colour, or nearest colour, using the given display. // Allocate a colour, or nearest colour, using the given display.
// If realloc is TRUE, ignore the existing pixel, otherwise just return // If realloc is TRUE, ignore the existing pixel, otherwise just return
// the existing one. // the existing one.
// Returns FALSE if an exact match was not found, TRUE otherwise. // Returns the old or allocated pixel.
// TODO: can this handle mono displays? If not, we should have an extra // TODO: can this handle mono displays? If not, we should have an extra
// flag to specify whether this should be black or white by default. // flag to specify whether this should be black or white by default.
bool wxColour::AllocColour(WXDisplay* display, bool realloc) int wxColour::AllocColour(WXDisplay* display, bool realloc)
{ {
if ((m_pixel != -1) && !realloc) if ((m_pixel != -1) && !realloc)
return TRUE; return m_pixel;
XColor color; XColor color;
color.red = (unsigned short) Red (); color.red = (unsigned short) Red ();
@@ -153,12 +153,12 @@ bool wxColour::AllocColour(WXDisplay* display, bool realloc)
if (!XAllocColor ((Display*) display, (Colormap) cmap, &color)) if (!XAllocColor ((Display*) display, (Colormap) cmap, &color))
{ {
m_pixel = wxGetBestMatchingPixel((Display*) display, &color,(Colormap) cmap); m_pixel = wxGetBestMatchingPixel((Display*) display, &color,(Colormap) cmap);
return FALSE; return m_pixel;
} }
else else
{ {
m_pixel = (int) color.pixel; m_pixel = (int) color.pixel;
return TRUE; return m_pixel;
} }
} }

6
src/motif/cross.xbm Normal file
View File

@@ -0,0 +1,6 @@
#define cross_width 15
#define cross_height 15
static char cross_bits[] = {
0x84, 0x10, 0x84, 0x10, 0xff, 0x7f, 0x84, 0x10, 0x84, 0x10, 0x84, 0x10,
0x84, 0x10, 0xff, 0x7f, 0x84, 0x10, 0x84, 0x10, 0x84, 0x10, 0x84, 0x10,
0xff, 0x7f, 0x84, 0x10, 0x84, 0x10};

View File

@@ -81,6 +81,8 @@ wxDC::wxDC(void)
m_brush = *wxTRANSPARENT_BRUSH; m_brush = *wxTRANSPARENT_BRUSH;
m_backgroundBrush = *wxWHITE_BRUSH; m_backgroundBrush = *wxWHITE_BRUSH;
m_isInteractive = FALSE;
// m_palette = wxAPP_COLOURMAP; // m_palette = wxAPP_COLOURMAP;
}; };

File diff suppressed because it is too large Load Diff

View File

@@ -19,7 +19,7 @@
// wxMemoryDC // wxMemoryDC
//----------------------------------------------------------------------------- //-----------------------------------------------------------------------------
IMPLEMENT_DYNAMIC_CLASS(wxMemoryDC,wxPaintDC) IMPLEMENT_DYNAMIC_CLASS(wxMemoryDC, wxWindowDC)
wxMemoryDC::wxMemoryDC(void) wxMemoryDC::wxMemoryDC(void)
{ {
@@ -37,9 +37,10 @@ wxMemoryDC::~wxMemoryDC(void)
void wxMemoryDC::SelectObject( const wxBitmap& bitmap ) void wxMemoryDC::SelectObject( const wxBitmap& bitmap )
{ {
m_selected = bitmap; m_bitmap = bitmap;
if (m_selected.Ok()) if (m_bitmap.Ok())
{ {
m_pixmap = m_bitmap.GetPixmap();
} }
else else
{ {
@@ -49,10 +50,10 @@ void wxMemoryDC::SelectObject( const wxBitmap& bitmap )
void wxMemoryDC::GetSize( int *width, int *height ) const void wxMemoryDC::GetSize( int *width, int *height ) const
{ {
if (m_selected.Ok()) if (m_bitmap.Ok())
{ {
if (width) (*width) = m_selected.GetWidth(); if (width) (*width) = m_bitmap.GetWidth();
if (height) (*height) = m_selected.GetHeight(); if (height) (*height) = m_bitmap.GetHeight();
} }
else else
{ {

6
src/motif/fdiag.xbm Normal file
View File

@@ -0,0 +1,6 @@
#define fdiag_width 16
#define fdiag_height 16
static char fdiag_bits[] = {
0x01, 0x01, 0x02, 0x02, 0x04, 0x04, 0x08, 0x08, 0x10, 0x10, 0x20, 0x20,
0x40, 0x40, 0x80, 0x80, 0x01, 0x01, 0x02, 0x02, 0x04, 0x04, 0x08, 0x08,
0x10, 0x10, 0x20, 0x20, 0x40, 0x40, 0x80, 0x80};

6
src/motif/horiz.xbm Normal file
View File

@@ -0,0 +1,6 @@
#define horiz_width 15
#define horiz_height 15
static char horiz_bits[] = {
0x00, 0x00, 0x00, 0x00, 0xff, 0x7f, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0xff, 0x7f, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0xff, 0x7f, 0x00, 0x00, 0x00, 0x00};

View File

@@ -26,7 +26,7 @@ IMPLEMENT_DYNAMIC_CLASS(wxPalette, wxGDIObject)
wxPaletteRefData::wxPaletteRefData() wxPaletteRefData::wxPaletteRefData()
{ {
// TODO m_colormap = (WXColormap) 0;
} }
wxPaletteRefData::~wxPaletteRefData() wxPaletteRefData::~wxPaletteRefData()

View File

@@ -9,6 +9,10 @@
// Licence: wxWindows licence // Licence: wxWindows licence
///////////////////////////////////////////////////////////////////////////// /////////////////////////////////////////////////////////////////////////////
// TODO: these settings should probably be configurable from some central or
// per-user file, which can be edited using a Windows-control-panel clone.
// Also they should be documented better. Some are very MS Windows-ish.
#ifdef __GNUG__ #ifdef __GNUG__
#pragma implementation "settings.h" #pragma implementation "settings.h"
#endif #endif
@@ -18,12 +22,37 @@
wxColour wxSystemSettings::GetSystemColour(int index) wxColour wxSystemSettings::GetSystemColour(int index)
{ {
// TODO // TODO
return wxColour(); return wxColour();
} }
wxFont wxSystemSettings::GetSystemFont(int index) wxFont wxSystemSettings::GetSystemFont(int index)
{ {
// TODO // TODO
switch (index)
{
case wxSYS_DEVICE_DEFAULT_FONT:
{
break;
}
case wxSYS_DEFAULT_PALETTE:
{
break;
}
case wxSYS_SYSTEM_FIXED_FONT:
{
break;
}
case wxSYS_SYSTEM_FONT:
{
break;
}
default:
case wxSYS_DEFAULT_GUI_FONT:
{
break;
}
}
return wxFont(); return wxFont();
} }

6
src/motif/verti.xbm Normal file
View File

@@ -0,0 +1,6 @@
#define verti_width 15
#define verti_height 15
static char verti_bits[] = {
0x84, 0x10, 0x84, 0x10, 0x84, 0x10, 0x84, 0x10, 0x84, 0x10, 0x84, 0x10,
0x84, 0x10, 0x84, 0x10, 0x84, 0x10, 0x84, 0x10, 0x84, 0x10, 0x84, 0x10,
0x84, 0x10, 0x84, 0x10, 0x84, 0x10};

View File

@@ -132,6 +132,7 @@ wxWindow::wxWindow()
m_lastTS = 0; m_lastTS = 0;
m_lastButton = 0; m_lastButton = 0;
m_canAddEventHandler = FALSE; m_canAddEventHandler = FALSE;
m_paintRegion = (WXRegion) 0;
} }
// Destructor // Destructor
@@ -139,6 +140,10 @@ wxWindow::~wxWindow()
{ {
//// Motif-specific //// Motif-specific
if (m_paintRegion)
XDestroyRegion ((Region) m_paintRegion);
m_paintRegion = (WXRegion) 0;
if (GetMainWidget()) if (GetMainWidget())
DetachWidget(GetMainWidget()); // Removes event handlers DetachWidget(GetMainWidget()); // Removes event handlers
@@ -299,6 +304,7 @@ bool wxWindow::Create(wxWindow *parent, wxWindowID id,
m_pixmapHeight = 0; m_pixmapHeight = 0;
m_pixmapOffsetX = 0; m_pixmapOffsetX = 0;
m_pixmapOffsetY = 0; m_pixmapOffsetY = 0;
m_paintRegion = (WXRegion) 0;
if (!parent) if (!parent)
return FALSE; return FALSE;

46
src/motif/wxwin.xbm Normal file
View File

@@ -0,0 +1,46 @@
#define wxwin.xbm_width 64
#define wxwin.xbm_height 64
static char wxwin.xbm_bits[] = {
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xc0, 0xff, 0xff, 0xff,
0xff, 0xff, 0x1f, 0x00, 0x40, 0x00, 0x00, 0x00, 0x00, 0x00, 0x10, 0x00,
0x40, 0x00, 0x00, 0x00, 0x00, 0x00, 0x30, 0x00, 0x40, 0x80, 0xc7, 0x19,
0x8e, 0x01, 0x50, 0x00, 0x40, 0x00, 0xc7, 0x39, 0xcf, 0x01, 0x70, 0x00,
0x40, 0x00, 0xc7, 0x31, 0x3c, 0x00, 0x50, 0x00, 0x40, 0x00, 0xc7, 0x21,
0x1c, 0x00, 0x70, 0x00, 0x40, 0x80, 0xe3, 0x20, 0x38, 0x00, 0x50, 0x00,
0x40, 0x80, 0xe3, 0x30, 0x3c, 0x00, 0x70, 0x00, 0x40, 0x80, 0xe3, 0x78,
0x76, 0x01, 0x50, 0x00, 0x40, 0x00, 0xdf, 0xff, 0xf3, 0x20, 0x70, 0x00,
0x40, 0x00, 0x8e, 0xff, 0x61, 0x70, 0x50, 0x00, 0x40, 0x00, 0x00, 0xfc,
0x01, 0xf8, 0x70, 0x00, 0x40, 0x00, 0x00, 0xfc, 0x01, 0xfc, 0x51, 0x00,
0x40, 0x00, 0x00, 0xfe, 0x03, 0xfc, 0x73, 0x00, 0x40, 0x00, 0x00, 0xff,
0x03, 0xf8, 0x51, 0x00, 0x40, 0x00, 0x00, 0xff, 0x07, 0xf0, 0x70, 0x00,
0x40, 0x00, 0x80, 0xff, 0x07, 0x60, 0x50, 0x00, 0x40, 0x00, 0x80, 0xff,
0x0f, 0xfc, 0x70, 0x00, 0x40, 0x00, 0xc0, 0xff, 0x1f, 0xfc, 0x50, 0x00,
0x40, 0x00, 0xe0, 0xff, 0x1f, 0xfc, 0x70, 0x00, 0x40, 0x00, 0xf0, 0x0f,
0x00, 0xfc, 0x50, 0x00, 0x40, 0x00, 0xf0, 0x07, 0x00, 0xfc, 0x70, 0x00,
0x40, 0x00, 0xf8, 0x07, 0x00, 0xfc, 0x50, 0x00, 0x40, 0x00, 0xfc, 0x03,
0x00, 0xfc, 0x70, 0x00, 0x40, 0x00, 0xfc, 0x01, 0x00, 0xfc, 0x50, 0x00,
0x40, 0x00, 0xfe, 0x00, 0x00, 0xfc, 0x70, 0x00, 0x40, 0x00, 0xfe, 0x00,
0x00, 0xfc, 0x50, 0x00, 0x40, 0x00, 0x7f, 0x00, 0x00, 0xfc, 0x70, 0x00,
0x40, 0x80, 0x7f, 0x00, 0x00, 0xfc, 0x50, 0x00, 0x40, 0x80, 0x3f, 0x00,
0x00, 0xfc, 0x70, 0x00, 0x40, 0xc0, 0xff, 0xff, 0xff, 0xff, 0x50, 0x00,
0x40, 0xe0, 0xff, 0xff, 0xff, 0xff, 0x70, 0x00, 0x40, 0xe0, 0xff, 0xff,
0xff, 0xff, 0x50, 0x00, 0x40, 0xf0, 0xff, 0xff, 0xff, 0xff, 0x70, 0x00,
0x40, 0xf0, 0xff, 0xff, 0xff, 0xff, 0x50, 0x00, 0x40, 0xf0, 0xff, 0xff,
0xff, 0xff, 0x70, 0x00, 0x40, 0x00, 0x00, 0x00, 0x00, 0x00, 0x50, 0x00,
0x40, 0x00, 0x00, 0x00, 0x00, 0x00, 0x70, 0x00, 0x40, 0x00, 0x00, 0x00,
0x00, 0x00, 0x50, 0x00, 0x40, 0x00, 0x00, 0x00, 0x00, 0x00, 0x70, 0x00,
0xc0, 0xff, 0xff, 0xff, 0xff, 0xff, 0x5f, 0x00, 0x80, 0xaa, 0xaa, 0xaa,
0xaa, 0xaa, 0x6a, 0x00, 0x00, 0xff, 0xff, 0xff, 0xff, 0xff, 0x7f, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00};

View File

@@ -24,6 +24,31 @@ wxColour wxSystemSettings::GetSystemColour(int index)
wxFont wxSystemSettings::GetSystemFont(int index) wxFont wxSystemSettings::GetSystemFont(int index)
{ {
// TODO // TODO
switch (index)
{
case wxSYS_DEVICE_DEFAULT_FONT:
{
break;
}
case wxSYS_DEFAULT_PALETTE:
{
break;
}
case wxSYS_SYSTEM_FIXED_FONT:
{
break;
}
case wxSYS_SYSTEM_FONT:
{
break;
}
default:
case wxSYS_DEFAULT_GUI_FONT:
{
break;
}
}
return wxFont(); return wxFont();
} }