← Back to team overview

kicad-developers team mailing list archive

[PATCH] wxWidgets 2.8 under Graphics Abstraction Layer Lib (GAL)

 

Wayne and Torsten,

Here is a patch that allows the GAL to compile and run on Ubuntu Lucid x86_64

with *version wxWidgets 2.8.x*

The key thing is the wxWidgets version.  The repo seems to be dependent on 2.9.


Moving forward, we're going to need write access to a branch holding this stuff.  I
think we should keep it a separate branch.  Kicad's Cmake can be told to do a checkout
later.

Thanks again to Torsten for what looks to be:

1) great work,
2) conforming to the coding standards, and
3) for patience in the supreme.


Regards,


Dick

=== modified file 'gal/cairo_gal.cpp'
--- gal/cairo_gal.cpp	2010-10-17 22:57:11 +0000
+++ gal/cairo_gal.cpp	2010-12-13 19:39:57 +0000
@@ -149,15 +149,26 @@
 #if defined( __WXGTK__ )
     // Create a new wxClientDC and get the native implementation
     m_clientDC = new wxClientDC( this );
+
+#if wxCHECK_VERSION( 2, 9, 0 )
+
     m_clientDCimpl = new wxClientDCImpl( m_bufferedDC, this );
     m_drawable = m_clientDCimpl -> m_gdkwindow;
+
+#elif wxCHECK_VERSION( 2,8,0 )
+    m_clientDCimpl = new wxClientDC( this );
+    m_drawable = m_clientDCimpl -> m_window;
+#else
+#error "need wx widgets 2.8 as a minimum"
+#endif
+
     m_cairoImage = gdk_cairo_create( m_buffer );
 #endif
 
 #if defined(__WXMSW__)
     // Get the handle of the current window
     m_clientDC = new wxClientDC( this );
-    m_hdc = ( ( HDC )( m_clientDC->GetHDC() ) );
+    m_hdc = (HDC) m_clientDC->GetHDC();
 
     // Create a buffer
     m_dcBuffer = CreateCompatibleDC( m_hdc );

=== modified file 'gal/cairo_gal.h'
--- gal/cairo_gal.h	2010-10-17 22:57:11 +0000
+++ gal/cairo_gal.h	2010-12-03 08:50:29 +0000
@@ -217,7 +217,7 @@
     wxClientDC* m_clientDC; //!< Client device context; required because drawing outside the paint event
     wxBufferedDC* m_bufferedDC; //!< The buffered drawing context
     GdkPixmap* m_buffer; //!< The GDK pixmap
-    wxClientDCImpl* m_clientDCimpl; //< The system dependent implementation of a ClientDC
+    wxClientDC* m_clientDCimpl; //< The system dependent implementation of a ClientDC
     GdkDrawable* m_drawable; //!< Gdk Drawable (Drawables are either GdkWindow or GdkPixmap objects)
 #endif
 

=== modified file 'gal/opengl_gal.cpp'
--- gal/opengl_gal.cpp	2010-10-17 22:57:11 +0000
+++ gal/opengl_gal.cpp	2010-12-03 09:31:29 +0000
@@ -44,7 +44,7 @@
 #endif
 
 OPENGL_GAL::OPENGL_GAL( wxFrame* aParent, wxSize aScreenSize ) :
-    wxGLCanvas( aParent, wxID_ANY, glAttributes, wxDefaultPosition, wxDefaultSize, 0, wxT(
+    wxGLCanvas( aParent, wxID_ANY, (int*) glAttributes, wxDefaultPosition, wxDefaultSize, 0, wxT(
             "GLCanvas" ) )
 
 {

=== modified file 'gal/test/test_gal.cpp'
--- gal/test/test_gal.cpp	2010-10-17 22:57:11 +0000
+++ gal/test/test_gal.cpp	2010-12-03 09:32:41 +0000
@@ -618,7 +618,7 @@
                                 wxCMD_LINE_PARAM,
                                 NULL,
                                 NULL,
-                                "[testline | testpolyline | testrectangle | testcircle | testarc | testpolygon | testgroup | testfont | testtextalignment ]",
+                                wxT("[testline | testpolyline | testrectangle | testcircle | testarc | testpolygon | testgroup | testfont | testtextalignment ]"),
                                 wxCMD_LINE_VAL_STRING, wxCMD_LINE_PARAM_MULTIPLE },
                         { wxCMD_LINE_NONE } };
 


Follow ups