From f885296fb2caff3bb9784feb2817cb3ede88ec76 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Maciej=20Sumi=C5=84ski?= Date: Sun, 7 Jul 2013 02:30:28 +0200 Subject: [PATCH] Removed KICAD_GAL CMake option. --- CMakeLists.txt | 10 ---------- common/CMakeLists.txt | 6 ------ common/drawframe.cpp | 9 +-------- common/zoom.cpp | 2 -- cvpcb/CMakeLists.txt | 2 -- include/base_struct.h | 4 ---- pcbnew/CMakeLists.txt | 2 -- pcbnew/basepcbframe.cpp | 10 ---------- pcbnew/class_pcb_layer_widget.cpp | 13 +------------ pcbnew/dialogs/dialog_general_options.cpp | 13 +------------ pcbnew/hotkeys.cpp | 3 +-- pcbnew/hotkeys.h | 2 -- pcbnew/menubar_pcbframe.cpp | 2 -- pcbnew/pcbframe.cpp | 4 ---- 14 files changed, 4 insertions(+), 78 deletions(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index 61c061db0a..2466e06c10 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -51,10 +51,6 @@ option(KICAD_SCRIPTING_WXPYTHON "set this option ON to build wxpython implementation for wx interface building in python and py.shell" ) -option(KICAD_GAL - "set this option ON to build KICAD using Graphics Abstraction Layer as a rendering backend" - ) - # when option KICAD_SCRIPTING OR KICAD_SCRIPTING_MODULES is enabled: # PYTHON_EXECUTABLE can be defined when invoking cmake # ( use -DPYTHON_EXECUTABLE=/python.exe or python2 ) @@ -187,10 +183,6 @@ if(USE_WX_GRAPHICS_CONTEXT) add_definitions(-DUSE_WX_GRAPHICS_CONTEXT) endif() -if(KICAD_GAL) - add_definitions(-DKICAD_GAL) -endif() - # Allow user to override the default settings for adding images to menu items. By default # images in menu items are enabled on all platforms except OSX. This can be over ridden by # defining -DUSE_IMAGES_IN_MENUS=ON/OFF to force the preferred behavior. @@ -265,7 +257,6 @@ add_definitions(-DWX_COMPATIBILITY) find_package(OpenGL QUIET) check_find_package_result(OPENGL_FOUND "OpenGL") -if(KICAD_GAL) ##################### # Find GLEW library # ##################### @@ -277,7 +268,6 @@ check_find_package_result(GLEW_FOUND "GLEW") ###################### find_package(Cairo 1.8.1 QUIET) check_find_package_result(CAIRO_FOUND "Cairo") -endif(KICAD_GAL) ########################## # Download Boost library # diff --git a/common/CMakeLists.txt b/common/CMakeLists.txt index 67bacb0530..95047eb3b0 100644 --- a/common/CMakeLists.txt +++ b/common/CMakeLists.txt @@ -11,7 +11,6 @@ include_directories( ${INC_AFTER} ) -if(KICAD_GAL) # Generate files containing shader programs add_custom_command ( OUTPUT gal/opengl/shader_src.h @@ -46,7 +45,6 @@ add_dependencies(gal ShaderHeader) if(WIN32) add_definitions(-DGLEW_STATIC) endif(WIN32) -endif(KICAD_GAL) set(COMMON_ABOUT_DLG_SRCS dialog_about/AboutDialog_main.cpp @@ -129,13 +127,11 @@ set(COMMON_SRCS zoom.cpp ) -if(KICAD_GAL) set(COMMON_SRCS ${COMMON_SRCS} view/view.cpp view/view_item.cpp ) -endif(KICAD_GAL) add_library(common STATIC ${COMMON_SRCS}) @@ -188,12 +184,10 @@ set(PCB_COMMON_SRCS fp_lib_table.cpp ) -if(KICAD_GAL) set(PCB_COMMON_SRCS ${PCB_COMMON_SRCS} ../pcbnew/pcb_painter.cpp ) -endif(KICAD_GAL) # add -DPCBNEW to compilation of these PCBNEW sources set_source_files_properties( ${PCB_COMMON_SRCS} PROPERTIES diff --git a/common/drawframe.cpp b/common/drawframe.cpp index 58df3c1766..a07399ab97 100644 --- a/common/drawframe.cpp +++ b/common/drawframe.cpp @@ -46,10 +46,8 @@ #include #include -#ifdef KICAD_GAL #include #include -#endif /* KICAD_GAL */ /** * Definition for enabling and disabling scroll bar setting trace output. See the @@ -236,14 +234,12 @@ void EDA_DRAW_FRAME::SkipNextLeftButtonReleaseEvent() void EDA_DRAW_FRAME::OnToggleGridState( wxCommandEvent& aEvent ) { SetGridVisibility( !IsGridVisible() ); -#ifdef KICAD_GAL if( m_galCanvasActive ) { m_galCanvas->GetGAL()->SetGridVisibility( IsGridVisible() ); m_galCanvas->Refresh(); } else -#endif /* KICAD_GAL */ m_canvas->Refresh(); } @@ -396,13 +392,12 @@ void EDA_DRAW_FRAME::OnSelectGrid( wxCommandEvent& event ) m_LastGridSizeId = id - ID_POPUP_GRID_LEVEL_1000; screen->SetGrid( id ); screen->SetCrossHairPosition( screen->RefPos( true ) ); -#ifdef KICAD_GAL + if( m_galCanvasActive ) { KiGfx::GAL* gal = m_galCanvas->GetGAL(); gal->SetGridSize( VECTOR2D( screen->GetGrid().m_Size ) ); } -#endif /* KICAD_GAL */ Refresh(); } @@ -957,7 +952,6 @@ void EDA_DRAW_FRAME::AdjustScrollBars( const wxPoint& aCenterPositionIU ) void EDA_DRAW_FRAME::UseGalCanvas( bool aEnable ) { -#ifdef KICAD_GAL KiGfx::VIEW* view = m_galCanvas->GetView(); KiGfx::GAL* gal = m_galCanvas->GetGAL(); @@ -1010,5 +1004,4 @@ void EDA_DRAW_FRAME::UseGalCanvas( bool aEnable ) m_auimgr.Update(); m_galCanvasActive = aEnable; -#endif /* KICAD_GAL */ } diff --git a/common/zoom.cpp b/common/zoom.cpp index e23e718a73..a537256eea 100644 --- a/common/zoom.cpp +++ b/common/zoom.cpp @@ -84,9 +84,7 @@ void EDA_DRAW_FRAME::Zoom_Automatique( bool aWarpPointer ) if( screen->m_FirstRedraw ) screen->SetCrossHairPosition( screen->GetScrollCenterPosition() ); -#ifdef KICAD_GAL if( !m_galCanvasActive ) -#endif /* KICAD_GAL */ RedrawScreen( screen->GetScrollCenterPosition(), aWarpPointer ); } diff --git a/cvpcb/CMakeLists.txt b/cvpcb/CMakeLists.txt index c1563d7da5..5310be69a3 100644 --- a/cvpcb/CMakeLists.txt +++ b/cvpcb/CMakeLists.txt @@ -99,7 +99,6 @@ target_link_libraries(cvpcb ${GDI_PLUS_LIBRARIES} ) -if(KICAD_GAL) target_link_libraries(cvpcb gal ${GLEW_LIBRARIES} @@ -116,7 +115,6 @@ target_link_libraries(cvpcb bz2 ) endif(WIN32) -endif(KICAD_GAL) ### # Add cvpcb as install target diff --git a/include/base_struct.h b/include/base_struct.h index ef4c299914..9948f5b4d3 100644 --- a/include/base_struct.h +++ b/include/base_struct.h @@ -298,11 +298,7 @@ typedef unsigned STATUS_FLAGS; * is a base class for most all the KiCad significant classes, used in * schematics and boards. */ -#ifdef KICAD_GAL class EDA_ITEM : public KiGfx::VIEW_ITEM -#else -class EDA_ITEM -#endif { private: diff --git a/pcbnew/CMakeLists.txt b/pcbnew/CMakeLists.txt index 08858bc2bd..94a2f03ad8 100644 --- a/pcbnew/CMakeLists.txt +++ b/pcbnew/CMakeLists.txt @@ -426,7 +426,6 @@ target_link_libraries(pcbnew ${PCBNEW_EXTRA_LIBS} ) -if(KICAD_GAL) target_link_libraries(pcbnew gal ${GLEW_LIBRARIES} @@ -443,7 +442,6 @@ target_link_libraries(pcbnew bz2 ) endif(WIN32) -endif(KICAD_GAL) ### # Add pcbnew as install target diff --git a/pcbnew/basepcbframe.cpp b/pcbnew/basepcbframe.cpp index 28d5a7a35e..8c6cfb0018 100644 --- a/pcbnew/basepcbframe.cpp +++ b/pcbnew/basepcbframe.cpp @@ -52,9 +52,7 @@ #include #include #include -#ifdef KICAD_GAL #include -#endif // Configuration entry names. @@ -132,10 +130,8 @@ PCB_BASE_FRAME::PCB_BASE_FRAME( wxWindow* aParent, ID_DRAWFRAME_TYPE aFrameType, m_FastGrid1 = 0; m_FastGrid2 = 0; -#ifdef KICAD_GAL m_galCanvas = new EDA_DRAW_PANEL_GAL( this, -1, wxPoint( 0, 0 ), m_FrameSize, EDA_DRAW_PANEL_GAL::GAL_TYPE_OPENGL ); -#endif /* KICAD_GAL */ m_auxiliaryToolBar = NULL; } @@ -146,9 +142,7 @@ PCB_BASE_FRAME::~PCB_BASE_FRAME() delete m_Collector; delete m_Pcb; // is already NULL for FOOTPRINT_EDIT_FRAME -#ifdef KICAD_GAL delete m_galCanvas; -#endif /* KICAD_GAL */ } @@ -157,7 +151,6 @@ void PCB_BASE_FRAME::SetBoard( BOARD* aBoard ) delete m_Pcb; m_Pcb = aBoard; -#ifdef KICAD_GAL if( m_galCanvas ) { KiGfx::VIEW* view = m_galCanvas->GetView(); @@ -249,7 +242,6 @@ void PCB_BASE_FRAME::SetBoard( BOARD* aBoard ) m_galCanvas->Refresh(); } } -#endif } @@ -499,7 +491,6 @@ void PCB_BASE_FRAME::OnTogglePadDrawMode( wxCommandEvent& aEvent ) { m_DisplayPadFill = DisplayOpt.DisplayPadFill = !m_DisplayPadFill; -#ifdef KICAD_GAL // Apply new display options to the GAL canvas KiGfx::PCB_PAINTER* painter = static_cast ( m_galCanvas->GetView()->GetPainter() ); @@ -511,7 +502,6 @@ void PCB_BASE_FRAME::OnTogglePadDrawMode( wxCommandEvent& aEvent ) if( IsGalCanvasActive() ) m_galCanvas->Refresh(); else -#endif m_canvas->Refresh(); } diff --git a/pcbnew/class_pcb_layer_widget.cpp b/pcbnew/class_pcb_layer_widget.cpp index d928e0ee76..dbc070d3df 100644 --- a/pcbnew/class_pcb_layer_widget.cpp +++ b/pcbnew/class_pcb_layer_widget.cpp @@ -31,11 +31,10 @@ #include #include #include -#ifdef KICAD_GAL #include #include #include -#endif + #include #include #include // enum PCB_VISIBLE @@ -357,23 +356,19 @@ bool PCB_LAYER_WIDGET::OnLayerSelect( LAYER_NUM aLayer ) // false from this function. myframe->setActiveLayer( aLayer, false ); -#ifdef KICAD_GAL // Set display settings for high contrast mode KiGfx::VIEW* view = myframe->GetGalCanvas()->GetView(); view->GetPainter()->GetSettings()->SetActiveLayer( aLayer ); view->UpdateAllLayersColor(); view->SetTopLayer( aLayer ); -#endif /* KICAD_GAL */ if( m_alwaysShowActiveCopperLayer ) OnLayerSelected(); else if(DisplayOpt.ContrastModeDisplay) { -#ifdef KICAD_GAL if( myframe->IsGalCanvasActive() ) myframe->GetGalCanvas()->Refresh(); else -#endif /* KICAD_GAL */ myframe->GetCanvas()->Refresh(); } @@ -409,22 +404,18 @@ void PCB_LAYER_WIDGET::OnLayerVisible( LAYER_NUM aLayer, bool isVisible, bool is brd->SetVisibleLayers( visibleLayers ); -#ifdef KICAD_GAL EDA_DRAW_PANEL_GAL *galCanvas = myframe->GetGalCanvas(); if( galCanvas ) { KiGfx::VIEW* view = galCanvas->GetView(); view->SetLayerVisible( aLayer, isVisible ); } -#endif /* KICAD_GAL */ if( isFinal ) { -#ifdef KICAD_GAL if( myframe->IsGalCanvasActive() ) galCanvas->Refresh(); else -#endif /* KICAD_GAL */ myframe->GetCanvas()->Refresh(); } } @@ -440,7 +431,6 @@ void PCB_LAYER_WIDGET::OnRenderEnable( int aId, bool isEnabled ) BOARD* brd = myframe->GetBoard(); brd->SetElementVisibility( aId, isEnabled ); -#ifdef KICAD_GAL EDA_DRAW_PANEL_GAL *galCanvas = myframe->GetGalCanvas(); if( galCanvas ) { @@ -451,7 +441,6 @@ void PCB_LAYER_WIDGET::OnRenderEnable( int aId, bool isEnabled ) if( myframe->IsGalCanvasActive() ) galCanvas->Refresh(); else -#endif /* KICAD_GAL */ myframe->GetCanvas()->Refresh(); } diff --git a/pcbnew/dialogs/dialog_general_options.cpp b/pcbnew/dialogs/dialog_general_options.cpp index 63bb4960df..6509399218 100644 --- a/pcbnew/dialogs/dialog_general_options.cpp +++ b/pcbnew/dialogs/dialog_general_options.cpp @@ -42,11 +42,9 @@ #include #include -#ifdef KICAD_GAL #include #include #include -#endif /* KICAD_GAL */ DIALOG_GENERALOPTIONS::DIALOG_GENERALOPTIONS( PCB_EDIT_FRAME* parent ) : DIALOG_GENERALOPTIONS_BOARDEDITOR_BASE( parent ) @@ -161,13 +159,11 @@ void PCB_EDIT_FRAME::OnSelectOptionToolbar( wxCommandEvent& event ) { int id = event.GetId(); bool state = event.IsChecked(); -#ifdef KICAD_GAL KiGfx::PCB_PAINTER* painter = static_cast ( m_galCanvas->GetView()->GetPainter() ); KiGfx::PCB_RENDER_SETTINGS* settings = static_cast ( painter->GetSettings() ); bool recache = false; -#endif /* KICAD_GAL */ switch( id ) { @@ -229,32 +225,27 @@ void PCB_EDIT_FRAME::OnSelectOptionToolbar( wxCommandEvent& event ) case ID_TB_OPTIONS_SHOW_VIAS_SKETCH: m_DisplayViaFill = DisplayOpt.DisplayViaFill = !state; -#ifdef KICAD_GAL recache = true; if( !IsGalCanvasActive() ) -#endif /* KICAD_GAL */ m_canvas->Refresh(); break; case ID_TB_OPTIONS_SHOW_TRACKS_SKETCH: m_DisplayPcbTrackFill = DisplayOpt.DisplayPcbTrackFill = !state; -#ifdef KICAD_GAL recache = true; if( !IsGalCanvasActive() ) -#endif /* KICAD_GAL */ m_canvas->Refresh(); break; case ID_TB_OPTIONS_SHOW_HIGH_CONTRAST_MODE: DisplayOpt.ContrastModeDisplay = state; -#ifdef KICAD_GAL + // Apply new display options to the GAL canvas (this is faster than recaching) settings->LoadDisplayOptions( DisplayOpt ); m_galCanvas->GetView()->EnableTopLayer( state ); m_galCanvas->GetView()->UpdateAllLayersColor(); if( !IsGalCanvasActive() ) -#endif /* KICAD_GAL */ m_canvas->Refresh(); break; @@ -281,7 +272,6 @@ void PCB_EDIT_FRAME::OnSelectOptionToolbar( wxCommandEvent& event ) break; } -#ifdef KICAD_GAL if( recache ) { // Apply new display options to the GAL canvas @@ -291,5 +281,4 @@ void PCB_EDIT_FRAME::OnSelectOptionToolbar( wxCommandEvent& event ) if( IsGalCanvasActive() ) m_galCanvas->Refresh(); -#endif /* KICAD_GAL */ } diff --git a/pcbnew/hotkeys.cpp b/pcbnew/hotkeys.cpp index 5cc75c4eb9..f4b338a7f1 100644 --- a/pcbnew/hotkeys.cpp +++ b/pcbnew/hotkeys.cpp @@ -82,7 +82,6 @@ static EDA_HOTKEY HkResetLocalCoord( wxT( "Reset Local Coordinates" ), HK_RESET_LOCAL_COORD, ' ' ); static EDA_HOTKEY HkSwitchHighContrastMode( wxT("Switch Highcontrast mode"), HK_SWITCH_HIGHCONTRAST_MODE,'H'); -#ifdef KICAD_GAL static EDA_HOTKEY HkCanvasDefault( wxT( "Switch to default canvas" ), HK_CANVAS_DEFAULT, GR_KB_ALT + WXK_F9 ); static EDA_HOTKEY HkCanvasOpenGL( wxT( "Switch to OpenGL canvas" ), @@ -91,7 +90,7 @@ static EDA_HOTKEY HkCanvasOpenGLShaders( wxT( "Switch to OpenGL canvas with shad HK_CANVAS_OPENGL_SHADERS, GR_KB_ALT + WXK_F11 ); static EDA_HOTKEY HkCanvasCairo( wxT( "Switch to Cairo canvas" ), HK_CANVAS_CAIRO, GR_KB_ALT + WXK_F12 ); -#endif + /* Fit on Screen */ #if !defined( __WXMAC__ ) static EDA_HOTKEY HkZoomAuto( wxT( "Zoom Auto" ), HK_ZOOM_AUTO, WXK_HOME ); diff --git a/pcbnew/hotkeys.h b/pcbnew/hotkeys.h index 277f7e95eb..c96855c2a2 100644 --- a/pcbnew/hotkeys.h +++ b/pcbnew/hotkeys.h @@ -82,12 +82,10 @@ enum hotkey_id_commnand { HK_CALL_MACROS_9, HK_MACRO_ID_END, HK_SWITCH_HIGHCONTRAST_MODE, -#ifdef KICAD_GAL HK_CANVAS_DEFAULT, HK_CANVAS_OPENGL, HK_CANVAS_OPENGL_SHADERS, HK_CANVAS_CAIRO, -#endif }; // Full list of hotkey descriptors for board editor and footprint editor diff --git a/pcbnew/menubar_pcbframe.cpp b/pcbnew/menubar_pcbframe.cpp index c38c397dac..5f87f1d8cb 100644 --- a/pcbnew/menubar_pcbframe.cpp +++ b/pcbnew/menubar_pcbframe.cpp @@ -348,7 +348,6 @@ void PCB_EDIT_FRAME::ReCreateMenuBar() _( "&List Nets" ), _( "View a list of nets with names and id's" ), KiBitmap( tools_xpm ) ); -#ifdef KICAD_GAL // Switching GAL-based canvas on/off viewMenu->AppendSeparator(); @@ -379,7 +378,6 @@ void PCB_EDIT_FRAME::ReCreateMenuBar() AddMenuItem( viewMenu, ID_MENU_CANVAS_CAIRO, text, _( "Switch the canvas implementation to Cairo" ), KiBitmap( tools_xpm ) ); -#endif /** Create Place Menu **/ wxMenu* placeMenu = new wxMenu; diff --git a/pcbnew/pcbframe.cpp b/pcbnew/pcbframe.cpp index 0582e1a070..53014d1dcb 100644 --- a/pcbnew/pcbframe.cpp +++ b/pcbnew/pcbframe.cpp @@ -62,9 +62,7 @@ #include #endif -#if defined(KICAD_GAL) #include -#endif // Keys used in read/write config #define OPTKEY_DEFAULT_LINEWIDTH_VALUE wxT( "PlotLineWidth_mm" ) @@ -598,7 +596,6 @@ void PCB_EDIT_FRAME::Show3D_Frame( wxCommandEvent& event ) void PCB_EDIT_FRAME::SwitchCanvas( wxCommandEvent& aEvent ) { -#ifdef KICAD_GAL int id = aEvent.GetId(); switch( id ) @@ -622,7 +619,6 @@ void PCB_EDIT_FRAME::SwitchCanvas( wxCommandEvent& aEvent ) UseGalCanvas( true ); break; } -#endif }