View | Details | Raw Unified | Return to bug 233752
Collapse All | Expand All

(-)graphics/panoglview/Makefile (-1 / +1 lines)
Lines 20-26 Link Here
20
CXXFLAGS+=	-I${LOCALBASE}/include -ftemplate-depth-64
20
CXXFLAGS+=	-I${LOCALBASE}/include -ftemplate-depth-64
21
LIBS+=		-L${LOCALBASE}/lib -lGLU -lGL
21
LIBS+=		-L${LOCALBASE}/lib -lGLU -lGL
22
22
23
USE_WX=		2.8
23
USE_WX=		2.8 3.0
24
WX_COMPS=	wx
24
WX_COMPS=	wx
25
WX_CONF_ARGS=	relative
25
WX_CONF_ARGS=	relative
26
26
(-)graphics/panoglview/files/patch-src_panocanvas.cpp (+98 lines)
Line 0 Link Here
1
--- src/panocanvas.cpp.orig	2008-07-23 21:09:12 UTC
2
+++ src/panocanvas.cpp
3
@@ -41,12 +41,20 @@
4
     
5
 BEGIN_EVENT_TABLE(panoCanvas, wxGLCanvas)
6
   EVT_PAINT(panoCanvas::OnPaint)
7
+#if wxCHECK_VERSION(3,0,0)
8
+  EVT_SIZE (panoCanvas::resized)
9
+#else //wxCHECK_VERSION(3,0,0)
10
   EVT_SIZE (panoCanvas::OnSize)
11
+#endif //wxCHECK_VERSION(3,0,0)
12
   EVT_ERASE_BACKGROUND(panoCanvas::OnEraseBackground)
13
 END_EVENT_TABLE()
14
 
15
 panoCanvas::panoCanvas(wxWindow *parent, int id, const wxPoint &position, const wxSize &size) :
16
+#if wxCHECK_VERSION(3,0,0)
17
+wxGLCanvas(parent,id,0,position,size),
18
+#else //wxCHECK_VERSION(3,0,0)
19
 wxGLCanvas(parent,id,position,size),
20
+#endif //wxCHECK_VERSION(3,0,0)
21
 m_position(0.0,0.0,50.0),
22
 m_aspectratio(size.GetWidth()/(double) size.GetHeight()),
23
 m_initialized(false),
24
@@ -56,6 +64,9 @@ m_currentboundaries(CPanRange  (-m_position.getFov()*m
25
                     CAngleRange( -m_position.getFov()              / 2.0, m_position.getFov()               / 2.0),
26
                     CAngleRange(                       0.0,                     180.0 )),
27
 m_imageboundaries(CPanRange(-180.0,180.0),CAngleRange(-90.0,90.0),CAngleRange(0.0,180.0)),
28
+#if wxCHECK_VERSION(3,0,0)
29
+m_context(new wxGLContext(this)),
30
+#endif //wxCHECK_VERSION(3,0,0)
31
 m_divisions(128)
32
 {
33
   for(int i=0;i<16;++i)
34
@@ -68,24 +79,40 @@ panoCanvas::~panoCanvas()
35
 {
36
   if(m_hasimage)
37
     deletePanorama();
38
+#if wxCHECK_VERSION(3,0,0)
39
+  delete m_context;
40
+#endif //wxCHECK_VERSION(3,0,0)
41
 }
42
 
43
 void panoCanvas::OnEraseBackground(wxEraseEvent& event)
44
 {
45
 }
46
 
47
+#if wxCHECK_VERSION(3,0,0)
48
+void panoCanvas::resized(wxSizeEvent &event)
49
+#else //wxCHECK_VERSION(3,0,0)
50
 void panoCanvas::OnSize(wxSizeEvent &event)
51
+#endif //wxCHECK_VERSION(3,0,0)
52
 {
53
+#if !wxCHECK_VERSION(3,0,0)
54
   wxGLCanvas::OnSize(event);
55
+#endif //!wxCHECK_VERSION(3,0,0)
56
 
57
   int w,h;
58
   GetClientSize(&w,&h);
59
+#if wxCHECK_VERSION(3,0,0)
60
+  if (GetXWindow()) SetCurrent(*m_context);
61
+#else //wxCHECK_VERSION(3,0,0)
62
   SetCurrent();
63
+#endif //wxCHECK_VERSION(3,0,0)
64
 
65
 
66
   glViewport(0,0,(GLint) w, (GLint) h);
67
   m_aspectratio = (GLdouble) w/(GLdouble) h;
68
   m_winsize = wxSize(w,h);
69
+#if wxCHECK_VERSION(3,0,0)
70
+  Refresh();
71
+#endif //wxCHECK_VERSION(3,0,0)
72
 }
73
 
74
 void panoCanvas::OnPaint(wxPaintEvent &event)
75
@@ -93,7 +120,11 @@ void panoCanvas::OnPaint(wxPaintEvent &event)
76
   /* must always be here */
77
   wxPaintDC dc(this);
78
 
79
+#if wxCHECK_VERSION(3,0,0)
80
+  SetCurrent(*m_context);
81
+#else //wxCHECK_VERSION(3,0,0)
82
   SetCurrent();
83
+#endif //wxCHECK_VERSION(3,0,0)
84
 
85
   if(!m_initialized){
86
     initGL();
87
@@ -125,7 +156,11 @@ void panoCanvas::position()
88
 
89
 void panoCanvas::deletePanorama()
90
 {
91
+#if wxCHECK_VERSION(3,0,0)
92
+  SetCurrent(*m_context);
93
+#else //wxCHECK_VERSION(3,0,0)
94
   SetCurrent();
95
+#endif //wxCHECK_VERSION(3,0,0)
96
   glDeleteTextures(m_numOfTexPatches.x*m_numOfTexPatches.y,m_textures);
97
   m_hasimage = false;
98
   delete [] m_viewableTexPatches;
(-)graphics/panoglview/files/patch-src_panocanvas.h (+24 lines)
Line 0 Link Here
1
--- src/panocanvas.h.orig	2008-07-23 21:09:11 UTC
2
+++ src/panocanvas.h
3
@@ -148,7 +148,11 @@ class panoCanvas : public wxGLCanvas  { (public)
4
   panoCanvas(wxWindow *parent, int id, const wxPoint &position=wxDefaultPosition, const wxSize &size=wxDefaultSize);
5
   virtual ~panoCanvas();
6
   void OnPaint(wxPaintEvent &event);
7
+#if wxCHECK_VERSION(3,0,0)
8
+  void resized(wxSizeEvent &event);
9
+#else //wxCHECK_VERSION(3,0,0)
10
   void OnSize(wxSizeEvent &event);
11
+#endif //wxCHECK_VERSION(3,0,0)
12
   void OnEraseBackground(wxEraseEvent& event);
13
 
14
   CBoundaries calculateViewBoundaries(const CPosition &offset = CPosition());
15
@@ -198,6 +202,9 @@ class panoCanvas : public wxGLCanvas  { (public)
16
   CBoundaries m_currentboundaries;
17
   CBoundaries m_imageboundaries;
18
   bool     m_initialized;
19
+#if wxCHECK_VERSION(3,0,0)
20
+  wxGLContext *m_context;
21
+#endif //wxCHECK_VERSION(3,0,0)
22
   DECLARE_EVENT_TABLE();
23
 };
24
 
(-)graphics/panoglview/files/patch-src_panoframe.cpp (+47 lines)
Line 0 Link Here
1
--- src/panoframe.cpp.orig	2008-07-23 21:09:11 UTC
2
+++ src/panoframe.cpp
3
@@ -136,7 +136,13 @@ PCX files (*.pcx)|*.pcx|\
4
 PNM files (*.pnm)|*.pnm|\
5
 TIFF files (*.tif)|*.tif|\
6
 XPM files (*.xpm)|*.xpm|\
7
-All files (*.*)|*.*"),wxOPEN|wxFILE_MUST_EXIST);
8
+All files (*.*)|*.*"),
9
+#if wxCHECK_VERSION(3,0,0)
10
+    wxFD_OPEN|wxFD_FILE_MUST_EXIST
11
+#else //wxCHECK_VERSION(3,0,0)
12
+    wxOPEN|wxFILE_MUST_EXIST
13
+#endif //wxCHECK_VERSION(3,0,0)
14
+  );
15
   if (imagename !=wxT(""))
16
     openImage(imagename);
17
 }
18
@@ -153,7 +159,13 @@ void panoFrame::OnFullScreen(wxCommandEvent &event)
19
 
20
 void panoFrame::OnOpenProject(wxCommandEvent &event)
21
 {
22
-  wxString filename = wxFileSelector(_("Open Project"),wxEmptyString,wxEmptyString,wxT("paf"),_("Panorama files (*.paf)|*.paf|All files (*.*)|*.*"),wxOPEN|wxFILE_MUST_EXIST);
23
+  wxString filename = wxFileSelector(_("Open Project"),wxEmptyString,wxEmptyString,wxT("paf"),_("Panorama files (*.paf)|*.paf|All files (*.*)|*.*"),
24
+#if wxCHECK_VERSION(3,0,0)
25
+    wxFD_OPEN|wxFD_FILE_MUST_EXIST
26
+#else //wxCHECK_VERSION(3,0,0)
27
+    wxOPEN|wxFILE_MUST_EXIST
28
+#endif //wxCHECK_VERSION(3,0,0)
29
+  );
30
   if (filename !=wxT("")){
31
     openProject(filename);
32
   }
33
@@ -292,7 +304,13 @@ void panoFrame::openArgumentFile(const wxString &filen
34
 
35
 void panoFrame::OnSaveProject(wxCommandEvent &event)
36
 {
37
-  wxString filename = wxFileSelector(_("Save Project"),wxEmptyString,wxEmptyString,wxT("paf"),_("Panorama files (*.paf)|*.paf|All files (*.*)|*.*"),wxOVERWRITE_PROMPT|wxSAVE);
38
+  wxString filename = wxFileSelector(_("Save Project"),wxEmptyString,wxEmptyString,wxT("paf"),_("Panorama files (*.paf)|*.paf|All files (*.*)|*.*"),
39
+#if wxCHECK_VERSION(3,0,0)
40
+    wxFD_OPEN|wxFD_FILE_MUST_EXIST
41
+#else //wxCHECK_VERSION(3,0,0)
42
+    wxOPEN|wxFILE_MUST_EXIST
43
+#endif //wxCHECK_VERSION(3,0,0)
44
+  );
45
   if (filename != wxT("")){
46
     if (wxFileExists(filename))
47
       wxRemoveFile(filename);
(-)graphics/panoglview/files/patch-src_panointeractivecanvas.cpp (+60 lines)
Line 0 Link Here
1
--- src/panointeractivecanvas.cpp.orig	2008-07-23 21:09:12 UTC
2
+++ src/panointeractivecanvas.cpp
3
@@ -62,7 +62,11 @@ BEGIN_EVENT_TABLE(panoInteractiveCanvas, panoCanvas)
4
   EVT_KEY_DOWN    (panoInteractiveCanvas::OnKeyDown       )
5
   EVT_KEY_UP      (panoInteractiveCanvas::OnKeyUp         )
6
   EVT_PAINT       (panoInteractiveCanvas::OnPaint         )
7
+#if wxCHECK_VERSION(3,0,0)
8
+  EVT_SIZE        (panoInteractiveCanvas::resized         )
9
+#else //wxCHECK_VERSION(3,0,0)
10
   EVT_SIZE        (panoInteractiveCanvas::OnSize          )
11
+#endif //wxCHECK_VERSION(3,0,0)
12
 END_EVENT_TABLE()
13
 
14
 panoInteractiveCanvas::panoInteractiveCanvas(wxWindow* parent, int id, const wxPoint& position, const wxSize& size):
15
@@ -96,13 +100,23 @@ panoInteractiveCanvas::~panoInteractiveCanvas()
16
 {
17
 }
18
 
19
+#if wxCHECK_VERSION(3,0,0)
20
+void panoInteractiveCanvas::resized(wxSizeEvent &event)
21
+#else //wxCHECK_VERSION(3,0,0)
22
 void panoInteractiveCanvas::OnSize(wxSizeEvent &event)
23
+#endif //wxCHECK_VERSION(3,0,0)
24
 {
25
+#if !wxCHECK_VERSION(3,0,0)
26
   wxGLCanvas::OnSize(event);
27
+#endif //!wxCHECK_VERSION(3,0,0)
28
 
29
   int w,h;
30
   GetClientSize(&w,&h);
31
+#if wxCHECK_VERSION(3,0,0)
32
+  if (GetXWindow()) SetCurrent(*m_context);
33
+#else //wxCHECK_VERSION(3,0,0)
34
   SetCurrent();
35
+#endif //wxCHECK_VERSION(3,0,0)
36
 
37
   // TODO: opengl needs to be initialized here.
38
   if(m_initialized){
39
@@ -121,6 +135,9 @@ void panoInteractiveCanvas::OnSize(wxSizeEvent &event)
40
 
41
   m_aspectratio = (GLdouble) w/(GLdouble) h;
42
   m_winsize = wxSize(w,h);
43
+#if wxCHECK_VERSION(3,0,0)
44
+  Refresh();
45
+#endif //wxCHECK_VERSION(3,0,0)
46
 }
47
 
48
 void panoInteractiveCanvas::OnPaint(wxPaintEvent &event)
49
@@ -128,7 +145,11 @@ void panoInteractiveCanvas::OnPaint(wxPaintEvent &even
50
   /* must always be here */
51
   wxPaintDC dc(this);
52
 
53
+#if wxCHECK_VERSION(3,0,0)
54
+  SetCurrent(*m_context);
55
+#else //wxCHECK_VERSION(3,0,0)
56
   SetCurrent();
57
+#endif //wxCHECK_VERSION(3,0,0)
58
 
59
   if(!m_initialized){
60
     initGL();
(-)graphics/panoglview/files/patch-src_panointeractivecanvas.h (+14 lines)
Line 0 Link Here
1
--- src/panointeractivecanvas.h.orig	2008-07-23 21:09:11 UTC
2
+++ src/panointeractivecanvas.h
3
@@ -39,7 +39,11 @@ class panoInteractiveCanvas : public panoCanvas (publi
4
   void OnMouse(wxMouseEvent& event);
5
   void OnTimer(wxTimerEvent &event);
6
   void OnPaint(wxPaintEvent &event);
7
+#if wxCHECK_VERSION(3,0,0)
8
+  void resized(wxSizeEvent &event);
9
+#else //wxCHECK_VERSION(3,0,0)
10
   void OnSize(wxSizeEvent &event);
11
+#endif //wxCHECK_VERSION(3,0,0)
12
   void setBoundaryMode(int boundarymode);
13
   void enableShowBoundaries(bool show);
14
   void enableUseBoundaries(bool use);
(-)graphics/panoglview/files/patch-src_smallicon.xpm (+9 lines)
Line 0 Link Here
1
--- src/smallicon.xpm.orig	2008-07-23 21:09:10 UTC
2
+++ src/smallicon.xpm
3
@@ -1,5 +1,5 @@
4
 /* XPM */
5
-static char *smallicon[]={
6
+static char const *smallicon[]={
7
 "16 16 9 1",
8
 ". c None",
9
 "# c #0058c0",

Return to bug 233752