From 5f331691d426fef30965f9dd802c9a4fc87d785b Mon Sep 17 00:00:00 2001 From: Robin Dunn Date: Fri, 25 Jul 2003 21:20:57 +0000 Subject: [PATCH] Fixes to allow OGL building as a DLL Also removed the hack I put in last week to allow building without the deprecated headers and fixed it the right way. git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@22298 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775 --- contrib/build/ogl/makefile.vc | 2 +- contrib/build/ogl/ogl.bkl | 1 - contrib/include/wx/ogl/basic.h | 15 +++++++------- contrib/include/wx/ogl/basicp.h | 21 ++++++++++--------- contrib/include/wx/ogl/bmpshape.h | 3 +-- contrib/include/wx/ogl/canvas.h | 7 ++++--- contrib/include/wx/ogl/composit.h | 9 ++++---- contrib/include/wx/ogl/constrnt.h | 5 +++-- contrib/include/wx/ogl/divided.h | 5 +++-- contrib/include/wx/ogl/drawn.h | 7 +++---- contrib/include/wx/ogl/drawnp.h | 11 +++++----- contrib/include/wx/ogl/lines.h | 13 ++++++------ contrib/include/wx/ogl/linesp.h | 11 +++++----- contrib/include/wx/ogl/mfutils.h | 5 +++-- contrib/include/wx/ogl/misc.h | 27 ++++++++++++------------ contrib/include/wx/ogl/ogl.h | 34 +++++++++++++++++++++++-------- contrib/include/wx/ogl/ogldiag.h | 10 +++------ contrib/src/ogl/basic.cpp | 11 +++------- contrib/src/ogl/basic2.cpp | 11 +++------- contrib/src/ogl/bmpshape.cpp | 9 +++----- contrib/src/ogl/canvas.cpp | 10 ++------- contrib/src/ogl/composit.cpp | 10 +++------ contrib/src/ogl/constrnt.cpp | 7 +++---- contrib/src/ogl/divided.cpp | 10 +++------ contrib/src/ogl/drawn.cpp | 11 +++------- contrib/src/ogl/lines.cpp | 13 ++++-------- contrib/src/ogl/mfutils.cpp | 3 ++- contrib/src/ogl/ogldiag.cpp | 11 +++------- contrib/src/ogl/oglmisc.cpp | 9 +++----- 29 files changed, 138 insertions(+), 163 deletions(-) diff --git a/contrib/build/ogl/makefile.vc b/contrib/build/ogl/makefile.vc index 9e24180426..c5105e93a2 100644 --- a/contrib/build/ogl/makefile.vc +++ b/contrib/build/ogl/makefile.vc @@ -13,7 +13,7 @@ ### Variables: ### OBJS = vc_$(PORTNAME)$(WXUNIVNAME)$(WXUNICODEFLAG)$(WXDEBUGFLAG)$(WXDLLFLAG)$(CFG) -OGLDLL_CXXFLAGS = $(CPPFLAGS) /M$(__RUNTIME_LIBS)$(__DEBUGFLAG_3) /DWIN32 $(__DEBUGFLAG) /Fd..\..\src\ogl\..\..\..\lib\vc_$(PORTNAME)$(WXUNIVNAME)$(WXUNICODEFLAG)$(WXDEBUGFLAG)$(WXDLLFLAG)$(CFG)\wx$(PORTNAME)$(WXUNIVNAME)250$(WXUNICODEFLAG)$(WXDEBUGFLAG)_ogl_vc$(VENDORTAG).pdb $(____DEBUGFLAG) $(__OPTIMIZEFLAG) /D__WXMSW__ $(__WXUNIV_DEFINE_p) $(__DEBUG_DEFINE_p) $(__UNICODE_DEFINE_p) /I..\..\src\ogl\..\..\..\include /I..\..\src\ogl\..\..\..\lib\vc_$(PORTNAME)$(WXUNIVNAME)$(WXUNICODEFLAG)$(WXDEBUGFLAG)$(WXDLLFLAG)$(CFG) /I..\..\src\ogl\..\..\..\src\tiff /I..\..\src\ogl\..\..\..\src\jpeg /I..\..\src\ogl\..\..\..\src\png /I..\..\src\ogl\..\..\..\src\zlib /I..\..\src\ogl\..\..\..\src\regex /I..\..\src\ogl\..\..\..\src\expat\lib /Fp$(OBJS)\wxprec_ogldll.pch /I..\..\src\ogl\..\..\include /DWXUSINGDLL /DWXMAKINGDLL_OGL /DwxUSE_DEPRECATED=0 $(CXXFLAGS) /Yuwx/wxprec.h +OGLDLL_CXXFLAGS = $(CPPFLAGS) /M$(__RUNTIME_LIBS)$(__DEBUGFLAG_3) /DWIN32 $(__DEBUGFLAG) /Fd..\..\src\ogl\..\..\..\lib\vc_$(PORTNAME)$(WXUNIVNAME)$(WXUNICODEFLAG)$(WXDEBUGFLAG)$(WXDLLFLAG)$(CFG)\wx$(PORTNAME)$(WXUNIVNAME)250$(WXUNICODEFLAG)$(WXDEBUGFLAG)_ogl_vc$(VENDORTAG).pdb $(____DEBUGFLAG) $(__OPTIMIZEFLAG) /D__WXMSW__ $(__WXUNIV_DEFINE_p) $(__DEBUG_DEFINE_p) $(__UNICODE_DEFINE_p) /I..\..\src\ogl\..\..\..\include /I..\..\src\ogl\..\..\..\lib\vc_$(PORTNAME)$(WXUNIVNAME)$(WXUNICODEFLAG)$(WXDEBUGFLAG)$(WXDLLFLAG)$(CFG) /I..\..\src\ogl\..\..\..\src\tiff /I..\..\src\ogl\..\..\..\src\jpeg /I..\..\src\ogl\..\..\..\src\png /I..\..\src\ogl\..\..\..\src\zlib /I..\..\src\ogl\..\..\..\src\regex /I..\..\src\ogl\..\..\..\src\expat\lib /Fp$(OBJS)\wxprec_ogldll.pch /I..\..\src\ogl\..\..\include /DWXUSINGDLL /DWXMAKINGDLL_OGL $(CXXFLAGS) /Yuwx/wxprec.h OGLLIB_CXXFLAGS = $(CPPFLAGS) /M$(__RUNTIME_LIBS)$(__DEBUGFLAG_3) /DWIN32 $(__DEBUGFLAG) /Fd..\..\src\ogl\..\..\..\lib\vc_$(PORTNAME)$(WXUNIVNAME)$(WXUNICODEFLAG)$(WXDEBUGFLAG)$(WXDLLFLAG)$(CFG)\wx$(PORTNAME)$(WXUNIVNAME)25$(WXUNICODEFLAG)$(WXDEBUGFLAG)_ogl.pdb $(____DEBUGFLAG) $(__OPTIMIZEFLAG) /D__WXMSW__ $(__WXUNIV_DEFINE_p) $(__DEBUG_DEFINE_p) $(__UNICODE_DEFINE_p) /I..\..\src\ogl\..\..\..\include /I..\..\src\ogl\..\..\..\lib\vc_$(PORTNAME)$(WXUNIVNAME)$(WXUNICODEFLAG)$(WXDEBUGFLAG)$(WXDLLFLAG)$(CFG) /I..\..\src\ogl\..\..\..\src\tiff /I..\..\src\ogl\..\..\..\src\jpeg /I..\..\src\ogl\..\..\..\src\png /I..\..\src\ogl\..\..\..\src\zlib /I..\..\src\ogl\..\..\..\src\regex /I..\..\src\ogl\..\..\..\src\expat\lib /Fp$(OBJS)\wxprec_ogllib.pch /I..\..\src\ogl\..\..\include $(CXXFLAGS) /Yuwx/wxprec.h ### Conditionally set variables: ### diff --git a/contrib/build/ogl/ogl.bkl b/contrib/build/ogl/ogl.bkl index dc263b4c9a..8d6cd5d8b7 100644 --- a/contrib/build/ogl/ogl.bkl +++ b/contrib/build/ogl/ogl.bkl @@ -43,7 +43,6 @@ WXUSINGDLL WXMAKINGDLL_OGL - wxUSE_DEPRECATED=0 $(OGL_SRC) core base diff --git a/contrib/include/wx/ogl/basic.h b/contrib/include/wx/ogl/basic.h index 588258afd7..47b68d3de1 100644 --- a/contrib/include/wx/ogl/basic.h +++ b/contrib/include/wx/ogl/basic.h @@ -16,6 +16,7 @@ #pragma interface "basic.h" #endif + #define OGL_VERSION 2.0 #ifndef DEFAULT_MOUSE_TOLERANCE @@ -119,7 +120,7 @@ class WXDLLEXPORT wxExprDatabase; -class wxShapeEvtHandler: public wxObject, public wxClientDataContainer +class WXDLLIMPEXP_OGL wxShapeEvtHandler: public wxObject, public wxClientDataContainer { DECLARE_DYNAMIC_CLASS(wxShapeEvtHandler) @@ -184,7 +185,7 @@ class wxShapeEvtHandler: public wxObject, public wxClientDataContainer wxShape* m_handlerShape; }; -class wxShape: public wxShapeEvtHandler +class WXDLLIMPEXP_OGL wxShape: public wxShapeEvtHandler { DECLARE_ABSTRACT_CLASS(wxShape) @@ -561,7 +562,7 @@ class wxShape: public wxShapeEvtHandler long m_branchStyle; }; -class wxPolygonShape: public wxShape +class WXDLLIMPEXP_OGL wxPolygonShape: public wxShape { DECLARE_DYNAMIC_CLASS(wxPolygonShape) public: @@ -634,7 +635,7 @@ class wxPolygonShape: public wxShape double m_originalHeight; }; -class wxRectangleShape: public wxShape +class WXDLLIMPEXP_OGL wxRectangleShape: public wxShape { DECLARE_DYNAMIC_CLASS(wxRectangleShape) public: @@ -669,7 +670,7 @@ protected: double m_cornerRadius; }; -class wxTextShape: public wxRectangleShape +class WXDLLIMPEXP_OGL wxTextShape: public wxRectangleShape { DECLARE_DYNAMIC_CLASS(wxTextShape) public: @@ -685,7 +686,7 @@ class wxTextShape: public wxRectangleShape void Copy(wxShape& copy); }; -class wxEllipseShape: public wxShape +class WXDLLIMPEXP_OGL wxEllipseShape: public wxShape { DECLARE_DYNAMIC_CLASS(wxEllipseShape) public: @@ -722,7 +723,7 @@ protected: double m_height; }; -class wxCircleShape: public wxEllipseShape +class WXDLLIMPEXP_OGL wxCircleShape: public wxEllipseShape { DECLARE_DYNAMIC_CLASS(wxCircleShape) public: diff --git a/contrib/include/wx/ogl/basicp.h b/contrib/include/wx/ogl/basicp.h index c0927c0c17..5c5b40317a 100644 --- a/contrib/include/wx/ogl/basicp.h +++ b/contrib/include/wx/ogl/basicp.h @@ -16,9 +16,10 @@ #pragma interface "basicp.h" #endif + #define CONTROL_POINT_SIZE 6 -class wxShapeTextLine: public wxObject +class WXDLLIMPEXP_OGL wxShapeTextLine: public wxObject { DECLARE_DYNAMIC_CLASS(wxShapeTextLine) public: @@ -40,13 +41,13 @@ protected: double m_y; }; -class wxShape; -class wxControlPoint: public wxRectangleShape +class WXDLLIMPEXP_OGL wxShape; +class WXDLLIMPEXP_OGL wxControlPoint: public wxRectangleShape { DECLARE_DYNAMIC_CLASS(wxControlPoint) - friend class wxShapeEvtHandler; - friend class wxShape; + friend class WXDLLIMPEXP_OGL wxShapeEvtHandler; + friend class WXDLLIMPEXP_OGL wxShape; public: wxControlPoint(wxShapeCanvas *the_canvas = NULL, wxShape *object = NULL, double size = 0.0, double the_xoffset = 0.0, @@ -88,11 +89,11 @@ public: static double sm_controlPointDragPosY; }; -class wxPolygonShape; -class wxPolygonControlPoint: public wxControlPoint +class WXDLLIMPEXP_OGL wxPolygonShape; +class WXDLLIMPEXP_OGL wxPolygonControlPoint: public wxControlPoint { DECLARE_DYNAMIC_CLASS(wxPolygonControlPoint) - friend class wxPolygonShape; + friend class WXDLLIMPEXP_OGL wxPolygonShape; public: wxPolygonControlPoint(wxShapeCanvas *the_canvas = NULL, wxShape *object = NULL, double size = 0.0, wxRealPoint *vertex = NULL, double the_xoffset = 0.0, double the_yoffset = 0.0); @@ -123,7 +124,7 @@ public: * */ -class wxShapeRegion: public wxObject +class WXDLLIMPEXP_OGL wxShapeRegion: public wxObject { DECLARE_DYNAMIC_CLASS(wxShapeRegion) @@ -200,7 +201,7 @@ public: * User-defined attachment point */ -class wxAttachmentPoint: public wxObject +class WXDLLIMPEXP_OGL wxAttachmentPoint: public wxObject { DECLARE_DYNAMIC_CLASS(wxAttachmentPoint) diff --git a/contrib/include/wx/ogl/bmpshape.h b/contrib/include/wx/ogl/bmpshape.h index 5389351fe4..86251e5545 100644 --- a/contrib/include/wx/ogl/bmpshape.h +++ b/contrib/include/wx/ogl/bmpshape.h @@ -16,9 +16,8 @@ #pragma interface "bmpshape.h" #endif -#include -class wxBitmapShape: public wxRectangleShape +class WXDLLIMPEXP_OGL wxBitmapShape: public wxRectangleShape { DECLARE_DYNAMIC_CLASS(wxBitmapShape) public: diff --git a/contrib/include/wx/ogl/canvas.h b/contrib/include/wx/ogl/canvas.h index 7511de9a73..d65589029a 100644 --- a/contrib/include/wx/ogl/canvas.h +++ b/contrib/include/wx/ogl/canvas.h @@ -16,6 +16,7 @@ #pragma interface "canvas.h" #endif + // Drag states #define NoDragging 0 #define StartDraggingLeft 1 @@ -23,13 +24,13 @@ #define StartDraggingRight 3 #define ContinueDraggingRight 4 -extern const wxChar* wxShapeCanvasNameStr; +WXDLLIMPEXP_OGL extern const wxChar* wxShapeCanvasNameStr; // When drag_count reaches 0, process drag message -class wxDiagram; +class WXDLLIMPEXP_OGL wxDiagram; -class wxShapeCanvas: public wxScrolledWindow +class WXDLLIMPEXP_OGL wxShapeCanvas: public wxScrolledWindow { DECLARE_DYNAMIC_CLASS(wxShapeCanvas) public: diff --git a/contrib/include/wx/ogl/composit.h b/contrib/include/wx/ogl/composit.h index 618629d4ff..19afcfffcb 100644 --- a/contrib/include/wx/ogl/composit.h +++ b/contrib/include/wx/ogl/composit.h @@ -16,15 +16,16 @@ #pragma interface "composit.h" #endif -class wxDivisionShape; -class wxOGLConstraint; + +class WXDLLIMPEXP_OGL wxDivisionShape; +class WXDLLIMPEXP_OGL wxOGLConstraint; /* * A composite object is an invisible rectangle surrounding all children * */ -class wxCompositeShape: public wxRectangleShape +class WXDLLIMPEXP_OGL wxCompositeShape: public wxRectangleShape { DECLARE_DYNAMIC_CLASS(wxCompositeShape) public: @@ -122,7 +123,7 @@ protected: #define DIVISION_SIDE_RIGHT 3 #define DIVISION_SIDE_BOTTOM 4 -class wxDivisionShape: public wxCompositeShape +class WXDLLIMPEXP_OGL wxDivisionShape: public wxCompositeShape { DECLARE_DYNAMIC_CLASS(wxDivisionShape) public: diff --git a/contrib/include/wx/ogl/constrnt.h b/contrib/include/wx/ogl/constrnt.h index bd0616e491..338e4dfed2 100644 --- a/contrib/include/wx/ogl/constrnt.h +++ b/contrib/include/wx/ogl/constrnt.h @@ -16,12 +16,13 @@ #pragma interface "constrnt.h" #endif + /* * OGL Constraints * */ -class wxOGLConstraintType: public wxObject +class WXDLLIMPEXP_OGL wxOGLConstraintType: public wxObject { DECLARE_DYNAMIC_CLASS(wxOGLConstraintType) public: @@ -57,7 +58,7 @@ extern wxList* wxOGLConstraintTypes; #define gyCONSTRAINT_MIDALIGNED_LEFT 14 #define gyCONSTRAINT_MIDALIGNED_RIGHT 15 -class wxOGLConstraint: public wxObject +class WXDLLIMPEXP_OGL wxOGLConstraint: public wxObject { DECLARE_DYNAMIC_CLASS(wxOGLConstraint) public: diff --git a/contrib/include/wx/ogl/divided.h b/contrib/include/wx/ogl/divided.h index e307e7dc7e..dea08ce1c3 100644 --- a/contrib/include/wx/ogl/divided.h +++ b/contrib/include/wx/ogl/divided.h @@ -13,9 +13,10 @@ #define _OGL_DIVIDED_H_ #if defined(__GNUG__) && !defined(__APPLE__) -#pragma interface "basic.h" +#pragma interface "divided.h" #endif + /* * Definition of a region * @@ -27,7 +28,7 @@ */ extern wxFont *g_oglNormalFont; -class wxDividedShape: public wxRectangleShape +class WXDLLIMPEXP_OGL wxDividedShape: public wxRectangleShape { DECLARE_DYNAMIC_CLASS(wxDividedShape) diff --git a/contrib/include/wx/ogl/drawn.h b/contrib/include/wx/ogl/drawn.h index 75f3d00a9a..ffe35762a3 100644 --- a/contrib/include/wx/ogl/drawn.h +++ b/contrib/include/wx/ogl/drawn.h @@ -16,13 +16,12 @@ #pragma interface "drawn.h" #endif -#include #define oglMETAFLAGS_OUTLINE 1 #define oglMETAFLAGS_ATTACHMENTS 2 -class wxDrawnShape; -class wxPseudoMetaFile: public wxObject +class WXDLLIMPEXP_OGL wxDrawnShape; +class WXDLLIMPEXP_OGL wxPseudoMetaFile: public wxObject { DECLARE_DYNAMIC_CLASS(wxPseudoMetaFile) public: @@ -130,7 +129,7 @@ public: #define oglDRAWN_ANGLE_180 2 #define oglDRAWN_ANGLE_270 3 -class wxDrawnShape: public wxRectangleShape +class WXDLLIMPEXP_OGL wxDrawnShape: public wxRectangleShape { DECLARE_DYNAMIC_CLASS(wxDrawnShape) public: diff --git a/contrib/include/wx/ogl/drawnp.h b/contrib/include/wx/ogl/drawnp.h index dd083219b8..d80643301b 100644 --- a/contrib/include/wx/ogl/drawnp.h +++ b/contrib/include/wx/ogl/drawnp.h @@ -16,7 +16,6 @@ #pragma interface "drawnp.h" #endif -#include /* * Drawing operations @@ -55,7 +54,7 @@ * */ -class wxDrawOp: public wxObject +class WXDLLIMPEXP_OGL wxDrawOp: public wxObject { public: inline wxDrawOp(int theOp) { m_op = theOp; } @@ -93,7 +92,7 @@ protected: * */ -class wxOpSetGDI: public wxDrawOp +class WXDLLIMPEXP_OGL wxOpSetGDI: public wxDrawOp { public: wxOpSetGDI(int theOp, wxPseudoMetaFile *theImage, int theGdiIndex, int theMode = 0); @@ -118,7 +117,7 @@ public: * */ -class wxOpSetClipping: public wxDrawOp +class WXDLLIMPEXP_OGL wxOpSetClipping: public wxDrawOp { public: wxOpSetClipping(int theOp, double theX1, double theY1, double theX2, double theY2); @@ -143,7 +142,7 @@ public: * */ -class wxOpDraw: public wxDrawOp +class WXDLLIMPEXP_OGL wxOpDraw: public wxDrawOp { public: wxOpDraw(int theOp, double theX1, double theY1, double theX2, double theY2, @@ -176,7 +175,7 @@ public: * */ -class wxOpPolyDraw: public wxDrawOp +class WXDLLIMPEXP_OGL wxOpPolyDraw: public wxDrawOp { public: wxOpPolyDraw(int theOp, int n, wxRealPoint *thePoints); diff --git a/contrib/include/wx/ogl/lines.h b/contrib/include/wx/ogl/lines.h index d274c88f0b..4ecf39fd18 100644 --- a/contrib/include/wx/ogl/lines.h +++ b/contrib/include/wx/ogl/lines.h @@ -16,9 +16,10 @@ #pragma interface "lines.h" #endif -class wxLabelShape; -class wxPseudoMetaFile; -class wxLineControlPoint; + +class WXDLLIMPEXP_OGL wxLabelShape; +class WXDLLIMPEXP_OGL wxPseudoMetaFile; +class WXDLLIMPEXP_OGL wxLineControlPoint; /* * Arcs with multiple arrowheads * @@ -46,7 +47,7 @@ class wxLineControlPoint; #define LINE_ALIGNMENT_TO_NEXT_HANDLE 2 #define LINE_ALIGNMENT_NONE 0 -class wxArrowHead: public wxObject +class WXDLLIMPEXP_OGL wxArrowHead: public wxObject { DECLARE_DYNAMIC_CLASS(wxArrowHead) @@ -88,8 +89,8 @@ class wxArrowHead: public wxObject }; // Line object -class wxLabelShape; -class wxLineShape: public wxShape +class WXDLLIMPEXP_OGL wxLabelShape; +class WXDLLIMPEXP_OGL wxLineShape: public wxShape { DECLARE_DYNAMIC_CLASS(wxLineShape) diff --git a/contrib/include/wx/ogl/linesp.h b/contrib/include/wx/ogl/linesp.h index ffe08df3ce..ebf2c1cbd8 100644 --- a/contrib/include/wx/ogl/linesp.h +++ b/contrib/include/wx/ogl/linesp.h @@ -16,11 +16,12 @@ #pragma interface "linesp.h" #endif -class wxLineShape; -class wxLineControlPoint: public wxControlPoint + +class WXDLLIMPEXP_OGL wxLineShape; +class WXDLLIMPEXP_OGL wxLineControlPoint: public wxControlPoint { DECLARE_DYNAMIC_CLASS(wxLineControlPoint) - friend class wxLineShape; + friend class WXDLLIMPEXP_OGL wxLineShape; public: wxLineControlPoint(wxShapeCanvas *the_canvas = NULL, wxShape *object = NULL, double size = 0.0, @@ -51,8 +52,8 @@ public: /* * Temporary arc label object */ - -class wxLabelShape: public wxRectangleShape + +class WXDLLIMPEXP_OGL wxLabelShape: public wxRectangleShape { DECLARE_DYNAMIC_CLASS(wxLabelShape) diff --git a/contrib/include/wx/ogl/mfutils.h b/contrib/include/wx/ogl/mfutils.h index 7e8a6e6a8a..45a62fe5be 100644 --- a/contrib/include/wx/ogl/mfutils.h +++ b/contrib/include/wx/ogl/mfutils.h @@ -17,6 +17,7 @@ #pragma interface "mfutils.h" #endif + #include #ifndef GetRValue @@ -157,7 +158,7 @@ #endif // metafile functions -class wxMetaRecord: public wxObject +class WXDLLIMPEXP_OGL wxMetaRecord: public wxObject { public: int metaFunction; @@ -180,7 +181,7 @@ class wxMetaRecord: public wxObject ~wxMetaRecord(void); }; -class wxXMetaFile: public wxObject +class WXDLLIMPEXP_OGL wxXMetaFile: public wxObject { public: double lastX; diff --git a/contrib/include/wx/ogl/misc.h b/contrib/include/wx/ogl/misc.h index 2bce6eeec9..70416d30e4 100644 --- a/contrib/include/wx/ogl/misc.h +++ b/contrib/include/wx/ogl/misc.h @@ -16,6 +16,7 @@ #pragma interface "misc.h" #endif + // List to use when copying objects; may need to associate elements of new objects // with elements of old objects, e.g. when copying constraint.s extern wxList oglObjectCopyMapping; @@ -27,51 +28,51 @@ extern wxList oglObjectCopyMapping; // Centres the given list of wxShapeTextLine strings in the given box // (changing the positions in situ). Doesn't actually draw into the DC. -void oglCentreText(wxDC& dc, wxList *text, double m_xpos, double m_ypos, +WXDLLIMPEXP_OGL void oglCentreText(wxDC& dc, wxList *text, double m_xpos, double m_ypos, double width, double height, int formatMode = FORMAT_CENTRE_HORIZ | FORMAT_CENTRE_VERT); // Given a string, returns a list of strings that fit within the given // width of box. Height is ignored. -wxStringList *oglFormatText(wxDC& dc, const wxString& text, double width, double height, int formatMode = 0); +WXDLLIMPEXP_OGL wxStringList* oglFormatText(wxDC& dc, const wxString& text, double width, double height, int formatMode = 0); // Centres the list of wxShapeTextLine strings, doesn't clip. // Doesn't actually draw into the DC. -void oglCentreTextNoClipping(wxDC& dc, wxList *text_list, +WXDLLIMPEXP_OGL void oglCentreTextNoClipping(wxDC& dc, wxList *text_list, double m_xpos, double m_ypos, double width, double height); // Gets the maximum width and height of the given list of wxShapeTextLines. -void oglGetCentredTextExtent(wxDC& dc, wxList *text_list, +WXDLLIMPEXP_OGL void oglGetCentredTextExtent(wxDC& dc, wxList *text_list, double m_xpos, double m_ypos, double width, double height, double *actual_width, double *actual_height); // Actually draw the preformatted list of wxShapeTextLines. -void oglDrawFormattedText(wxDC& context, wxList *text_list, +WXDLLIMPEXP_OGL void oglDrawFormattedText(wxDC& context, wxList *text_list, double m_xpos, double m_ypos, double width, double height, int formatMode = FORMAT_CENTRE_HORIZ | FORMAT_CENTRE_VERT); // Give it a list of points, finds the centre. -void oglFindPolylineCentroid(wxList *points, double *x, double *y); +WXDLLIMPEXP_OGL void oglFindPolylineCentroid(wxList *points, double *x, double *y); -void oglCheckLineIntersection(double x1, double y1, double x2, double y2, +WXDLLIMPEXP_OGL void oglCheckLineIntersection(double x1, double y1, double x2, double y2, double x3, double y3, double x4, double y4, double *ratio1, double *ratio2); -void oglFindEndForPolyline(double n, double xvec[], double yvec[], +WXDLLIMPEXP_OGL void oglFindEndForPolyline(double n, double xvec[], double yvec[], double x1, double y1, double x2, double y2, double *x3, double *y3); -void oglFindEndForBox(double width, double height, +WXDLLIMPEXP_OGL void oglFindEndForBox(double width, double height, double x1, double y1, // Centre of box (possibly) double x2, double y2, // other end of line double *x3, double *y3); // End on box edge -void oglFindEndForCircle(double radius, +WXDLLIMPEXP_OGL void oglFindEndForCircle(double radius, double x1, double y1, // Centre of circle double x2, double y2, // Other end of line double *x3, double *y3); -void oglGetArrowPoints(double x1, double y1, double x2, double y2, +WXDLLIMPEXP_OGL void oglGetArrowPoints(double x1, double y1, double x2, double y2, double length, double width, double *tip_x, double *tip_y, double *side1_x, double *side1_y, @@ -88,10 +89,10 @@ void oglGetArrowPoints(double x1, double y1, double x2, double y2, * Author: Ian Harrison */ -void oglDrawArcToEllipse(double x1, double y1, double a1, double b1, double x2, double y2, double x3, double y3, +WXDLLIMPEXP_OGL void oglDrawArcToEllipse(double x1, double y1, double a1, double b1, double x2, double y2, double x3, double y3, double *x4, double *y4); -bool oglRoughlyEqual(double val1, double val2, double tol = 0.00001); +WXDLLIMPEXP_OGL bool oglRoughlyEqual(double val1, double val2, double tol = 0.00001); extern wxFont* g_oglNormalFont; extern wxPen* g_oglBlackPen; diff --git a/contrib/include/wx/ogl/ogl.h b/contrib/include/wx/ogl/ogl.h index a9eb003abe..f10025a9be 100644 --- a/contrib/include/wx/ogl/ogl.h +++ b/contrib/include/wx/ogl/ogl.h @@ -12,16 +12,34 @@ #ifndef _OGL_OGL_H_ #define _OGL_OGL_H_ -#include // Basic shapes -#include // Lines and splines -#include // Vertically-divided rectangle -#include // Composite images -#include // wxShapeCanvas for displaying objects -#include // wxDiagram +#ifdef WXMAKINGDLL_OGL + #define WXDLLIMPEXP_OGL WXEXPORT +#elif defined(WXUSINGDLL) + #define WXDLLIMPEXP_OGL WXIMPORT +#else // not making nor using DLL + #define WXDLLIMPEXP_OGL +#endif + + +#include "wx/ogl/basic.h" // Basic shapes +#include "wx/ogl/basicp.h" +#include "wx/ogl/lines.h" // Lines and splines +#include "wx/ogl/linesp.h" +#include "wx/ogl/divided.h" // Vertically-divided rectangle +#include "wx/ogl/composit.h" // Composite images +#include "wx/ogl/canvas.h" // wxShapeCanvas for displaying objects +#include "wx/ogl/ogldiag.h" // wxDiagram + +#include "wx/ogl/bmpshape.h" +#include "wx/ogl/constrnt.h" +#include "wx/ogl/drawn.h" +#include "wx/ogl/drawnp.h" +#include "wx/ogl/mfutils.h" +#include "wx/ogl/misc.h" // TODO: replace with wxModule implementation -extern void wxOGLInitialize(); -extern void wxOGLCleanUp(); +extern WXDLLIMPEXP_OGL void wxOGLInitialize(); +extern WXDLLIMPEXP_OGL void wxOGLCleanUp(); #endif // _OGL_OGL_H_ diff --git a/contrib/include/wx/ogl/ogldiag.h b/contrib/include/wx/ogl/ogldiag.h index 0f907a2962..7a1b807b95 100644 --- a/contrib/include/wx/ogl/ogldiag.h +++ b/contrib/include/wx/ogl/ogldiag.h @@ -16,17 +16,13 @@ #pragma interface "ogldiag.h" #endif -#if wxUSE_DEPRECATED -#include -#endif #if wxUSE_PROLOGIO #include #endif -#include -class wxDiagram: public wxObject +class WXDLLIMPEXP_OGL wxDiagram: public wxObject { DECLARE_DYNAMIC_CLASS(wxDiagram) @@ -101,7 +97,7 @@ protected: wxList* m_shapeList; }; -class wxLineCrossing: public wxObject +class WXDLLIMPEXP_OGL wxLineCrossing: public wxObject { public: wxLineCrossing() { m_lineShape1 = NULL; m_lineShape2 = NULL; } @@ -114,7 +110,7 @@ public: wxLineShape* m_lineShape2; }; -class wxLineCrossings: public wxObject +class WXDLLIMPEXP_OGL wxLineCrossings: public wxObject { public: wxLineCrossings(); diff --git a/contrib/src/ogl/basic.cpp b/contrib/src/ogl/basic.cpp index de5d1790c7..2d16def3c1 100644 --- a/contrib/src/ogl/basic.cpp +++ b/contrib/src/ogl/basic.cpp @@ -24,7 +24,7 @@ #include #endif -#if wxUSE_DEPRECATED +#if wxUSE_PROLOGIO #include #endif @@ -36,13 +36,8 @@ #include #include -#include -#include -#include -#include -#include -#include -#include +#include "wx/ogl/ogl.h" + // Control point types // Rectangle and most other shapes diff --git a/contrib/src/ogl/basic2.cpp b/contrib/src/ogl/basic2.cpp index 21aba04dad..19c6bac3c5 100644 --- a/contrib/src/ogl/basic2.cpp +++ b/contrib/src/ogl/basic2.cpp @@ -24,7 +24,7 @@ #include #endif -#if wxUSE_DEPRECATED +#if wxUSE_PROLOGIO #include #endif @@ -36,13 +36,8 @@ #include #include -#include -#include -#include -#include -#include -#include -#include +#include "wx/ogl/ogl.h" + // Control point types // Rectangle and most other shapes diff --git a/contrib/src/ogl/bmpshape.cpp b/contrib/src/ogl/bmpshape.cpp index 058262db6a..a82ff25e9b 100644 --- a/contrib/src/ogl/bmpshape.cpp +++ b/contrib/src/ogl/bmpshape.cpp @@ -24,15 +24,12 @@ #include #endif -#if wxUSE_DEPRECATED +#if wxUSE_PROLOGIO #include #endif -#include -#include -#include -#include -#include +#include "wx/ogl/ogl.h" + /* * Bitmap object diff --git a/contrib/src/ogl/canvas.cpp b/contrib/src/ogl/canvas.cpp index 77fa05b67e..167a09ea6f 100644 --- a/contrib/src/ogl/canvas.cpp +++ b/contrib/src/ogl/canvas.cpp @@ -24,7 +24,7 @@ #include #endif -#if wxUSE_DEPRECATED +#if wxUSE_PROLOGIO #include #endif @@ -36,13 +36,7 @@ #include #include -#include -#include -#include -#include -#include -#include -#include +#include "wx/ogl/ogl.h" #define CONTROL_POINT_SIZE 6 diff --git a/contrib/src/ogl/composit.cpp b/contrib/src/ogl/composit.cpp index 42b2f375c1..96b3684794 100644 --- a/contrib/src/ogl/composit.cpp +++ b/contrib/src/ogl/composit.cpp @@ -24,16 +24,12 @@ #include #endif -#if wxUSE_DEPRECATED +#if wxUSE_PROLOGIO #include #endif -#include -#include -#include -#include -#include -#include +#include "wx/ogl/ogl.h" + #if wxUSE_PROLOGIO // Sometimes, objects need to access the whole database to diff --git a/contrib/src/ogl/constrnt.cpp b/contrib/src/ogl/constrnt.cpp index f62585c931..c5e5650f09 100644 --- a/contrib/src/ogl/constrnt.cpp +++ b/contrib/src/ogl/constrnt.cpp @@ -24,13 +24,12 @@ #include #endif -#if wxUSE_DEPRECATED +#if wxUSE_PROLOGIO #include #endif -#include -#include -#include +#include "wx/ogl/ogl.h" + wxList *wxOGLConstraintTypes = NULL; diff --git a/contrib/src/ogl/divided.cpp b/contrib/src/ogl/divided.cpp index 767bfa69e4..2b16d5749c 100644 --- a/contrib/src/ogl/divided.cpp +++ b/contrib/src/ogl/divided.cpp @@ -24,16 +24,12 @@ #include #endif -#if wxUSE_DEPRECATED +#if wxUSE_PROLOGIO #include #endif -#include -#include -#include -#include -#include -#include +#include "wx/ogl/ogl.h" + class wxDividedShapeControlPoint: public wxControlPoint { diff --git a/contrib/src/ogl/drawn.cpp b/contrib/src/ogl/drawn.cpp index 88bae8f5ca..4801501c5e 100644 --- a/contrib/src/ogl/drawn.cpp +++ b/contrib/src/ogl/drawn.cpp @@ -25,17 +25,12 @@ #include #endif -#if wxUSE_DEPRECATED +#if wxUSE_PROLOGIO #include #endif -#include -#include -#include -#include -#include -#include -#include +#include "wx/ogl/ogl.h" + #include diff --git a/contrib/src/ogl/lines.cpp b/contrib/src/ogl/lines.cpp index 76f10c4aeb..b0f0d6dca2 100644 --- a/contrib/src/ogl/lines.cpp +++ b/contrib/src/ogl/lines.cpp @@ -25,7 +25,7 @@ #include #endif -#if wxUSE_DEPRECATED +#if wxUSE_PROLOGIO #include #endif @@ -36,13 +36,8 @@ #include #include -#include -#include -#include -#include -#include -#include -#include +#include "wx/ogl/ogl.h" + // Line shape IMPLEMENT_DYNAMIC_CLASS(wxLineShape, wxShape) @@ -519,7 +514,7 @@ bool wxLineShape::HitTest(double x, double y, int *attachment, double *distance) seg_len*((x-point1->x)*dy-(y-point1->y)*dx)/(dy*dy+dx*dx); double distance_from_prev = seg_len*((y-point1->y)*dy+(x-point1->x)*dx)/(dy*dy+dx*dx); - + if ((fabs(distance_from_seg) < extra && distance_from_prev >= 0 && distance_from_prev <= seg_len) || inLabelRegion) diff --git a/contrib/src/ogl/mfutils.cpp b/contrib/src/ogl/mfutils.cpp index 27f471e414..0f3e33e2c4 100644 --- a/contrib/src/ogl/mfutils.cpp +++ b/contrib/src/ogl/mfutils.cpp @@ -27,7 +27,8 @@ #include #include -#include +#include "wx/ogl/ogl.h" + #include static char _buf[1024]; // a temp buffer to use inplace of wxBuffer, which is deprecated. diff --git a/contrib/src/ogl/ogldiag.cpp b/contrib/src/ogl/ogldiag.cpp index 503d4cb809..ebebf6b620 100644 --- a/contrib/src/ogl/ogldiag.cpp +++ b/contrib/src/ogl/ogldiag.cpp @@ -24,7 +24,7 @@ #include #endif -#if wxUSE_DEPRECATED +#if wxUSE_PROLOGIO #include #endif @@ -36,13 +36,8 @@ #include #include -#include -#include -#include -#include -#include -#include -#include +#include "wx/ogl/ogl.h" + IMPLEMENT_DYNAMIC_CLASS(wxDiagram, wxObject) diff --git a/contrib/src/ogl/oglmisc.cpp b/contrib/src/ogl/oglmisc.cpp index cd29d7437b..7de32c2c77 100644 --- a/contrib/src/ogl/oglmisc.cpp +++ b/contrib/src/ogl/oglmisc.cpp @@ -24,7 +24,7 @@ #include #endif -#if wxUSE_DEPRECATED +#if wxUSE_PROLOGIO #include #endif @@ -38,11 +38,8 @@ #include #include -#include -#include -#include -#include -#include +#include "wx/ogl/ogl.h" + wxFont* g_oglNormalFont; wxPen* g_oglBlackPen; -- 2.45.2