7
mirror of https://gitlab.com/kicad/code/kicad.git synced 2025-04-18 17:19:17 +00:00

Move bitmaps.h out of base_struct.h

bitmaps.h was included in nearly every file in the project due to it
being included by base_struct.h

Only about 130 files actually use the XPM definitions defined there, and
many of those already included bitmaps.h themselves, or via
menu_helpers.h. However, touching bitmaps.h would result in over 400
rebuilt files for pcbnew alone.

This commit moves the bitmap-related types like BITMAT_DEF out to a new
header, which is still included by base_struct.h, which is less
avoidable for now, it's it's used in the interface.

The icon list is still in bitmaps.h. This has the side effect that's
it's now easier to automatically generate this file.

Many classes in pcbnew and eeschema needed some functions moved
to the implementaitons from the headers too.
This commit is contained in:
John Beard 2017-02-20 20:20:39 +08:00 committed by Wayne Stambaugh
parent 45cf772833
commit a8eea6155a
91 changed files with 353 additions and 76 deletions
3d-viewer
cvpcb
eeschema
gerbview
include
kicad
pagelayout_editor
pcbnew

View File

@ -32,6 +32,7 @@
#include <common_ogl/cogl_att_list.h>
#include <cstdlib>
#include <limits.h>
#include <bitmaps.h>
#include <wx/valnum.h>
#include <wx/tglbtn.h>

View File

@ -40,6 +40,7 @@
#include "status_text_reporter.h"
#include <gl_context_mgr.h>
#include <profile.h> // To use GetRunningMicroSecs or an other profiling utility
#include <bitmaps.h>
/**
* Trace mask used to enable or disable the trace output of this class.

View File

@ -25,6 +25,7 @@
#include "dialog_3D_view_option_base.h"
#include <3d_viewer/eda_3d_viewer.h>
#include <3d_canvas/cinfo3d_visu.h>
#include <bitmaps.h>
class DIALOG_3D_VIEW_OPTIONS : public DIALOG_3D_VIEW_OPTIONS_BASE
{

View File

@ -37,6 +37,7 @@
#include "../common_ogl/cogl_att_list.h"
#include <hotkeys_basic.h>
#include <wx/toolbar.h>
#include <bitmaps.h>
/**
* Trace mask used to enable or disable the trace output of this class.

View File

@ -41,6 +41,7 @@
#include <wildcards_and_files_ext.h>
#include <fp_lib_table.h>
#include <netlist_reader.h>
#include <bitmaps.h>
#include <cvpcb_mainframe.h>
#include <cvpcb.h>

View File

@ -34,6 +34,7 @@
#include <schframe.h>
#include <menus_helpers.h>
#include <msgpanel.h>
#include <bitmaps.h>
#include <eeschema_id.h>
#include <general.h>

View File

@ -31,6 +31,7 @@
#include <fctsys.h>
#include <schframe.h>
#include <class_drawpanel.h>
#include <bitmaps.h>
#include <invoke_sch_dialog.h>
#include <dialog_annotate_base.h>

View File

@ -38,6 +38,7 @@
#include <invoke_sch_dialog.h>
#include <project.h>
#include <kiface_i.h>
#include <bitmaps.h>
#include <netlist.h>
#include <class_netlist_object.h>

View File

@ -26,6 +26,7 @@
#include <macros.h>
#include <gr_basic.h>
#include <base_units.h>
#include <bitmaps.h>
#include <libeditframe.h>
#include <class_libentry.h>

View File

@ -32,6 +32,7 @@
#include <confirm.h>
#include <id.h>
#include <schframe.h>
#include <bitmaps.h>
#include <general.h>
#include <sch_sheet.h>

View File

@ -36,6 +36,7 @@
#include <richio.h>
#include <base_units.h>
#include <msgpanel.h>
#include <bitmaps.h>
#include <general.h>
#include <lib_arc.h>
@ -580,6 +581,12 @@ wxString LIB_ARC::GetSelectMenuText() const
}
BITMAP_DEF LIB_ARC::GetMenuImage() const
{
return add_arc_xpm;
}
void LIB_ARC::BeginEdit( STATUS_FLAGS aEditMode, const wxPoint aPosition )
{
wxCHECK_RET( ( aEditMode & ( IS_NEW | IS_MOVED | IS_RESIZED ) ) != 0,

View File

@ -155,7 +155,7 @@ public:
wxString GetSelectMenuText() const override;
BITMAP_DEF GetMenuImage() const override { return add_arc_xpm; }
BITMAP_DEF GetMenuImage() const override;
EDA_ITEM* Clone() const override;

View File

@ -37,6 +37,7 @@
#include <richio.h>
#include <base_units.h>
#include <msgpanel.h>
#include <bitmaps.h>
#include <general.h>
#include <lib_circle.h>
@ -297,6 +298,12 @@ wxString LIB_CIRCLE::GetSelectMenuText() const
}
BITMAP_DEF LIB_CIRCLE::GetMenuImage() const
{
return add_circle_xpm;
}
void LIB_CIRCLE::BeginEdit( STATUS_FLAGS aEditMode, const wxPoint aPosition )
{
wxCHECK_RET( ( aEditMode & ( IS_NEW | IS_MOVED | IS_RESIZED ) ) != 0,

View File

@ -104,7 +104,7 @@ public:
wxString GetSelectMenuText() const override;
BITMAP_DEF GetMenuImage() const override { return add_circle_xpm; }
BITMAP_DEF GetMenuImage() const override;
EDA_ITEM* Clone() const override;

View File

@ -38,6 +38,7 @@
#include <trigo.h>
#include <base_units.h>
#include <msgpanel.h>
#include <bitmaps.h>
#include <general.h>
#include <class_libentry.h>
@ -800,3 +801,9 @@ void LIB_FIELD::GetMsgPanelInfo( MSG_PANEL_ITEMS& aList )
// Display field text:
aList.push_back( MSG_PANEL_ITEM( _( "Value" ), GetShownText(), BROWN ) );
}
BITMAP_DEF LIB_FIELD::GetMenuImage() const
{
return move_field_xpm;
}

View File

@ -237,7 +237,7 @@ public:
wxString GetSelectMenuText() const override;
BITMAP_DEF GetMenuImage() const override { return move_field_xpm; }
BITMAP_DEF GetMenuImage() const override;
EDA_ITEM* Clone() const override;

View File

@ -36,6 +36,7 @@
#include <richio.h>
#include <base_units.h>
#include <msgpanel.h>
#include <bitmaps.h>
#include <general.h>
#include <lib_polyline.h>
@ -420,6 +421,12 @@ wxString LIB_POLYLINE::GetSelectMenuText() const
}
BITMAP_DEF LIB_POLYLINE::GetMenuImage() const
{
return add_polygon_xpm;
}
void LIB_POLYLINE::BeginEdit( STATUS_FLAGS aEditMode, const wxPoint aPosition )
{
wxCHECK_RET( ( aEditMode & ( IS_NEW | IS_MOVED | IS_RESIZED ) ) != 0,

View File

@ -113,7 +113,7 @@ public:
wxString GetSelectMenuText() const override;
BITMAP_DEF GetMenuImage() const override { return add_polygon_xpm; }
BITMAP_DEF GetMenuImage() const override;
EDA_ITEM* Clone() const override;

View File

@ -36,6 +36,7 @@
#include <richio.h>
#include <base_units.h>
#include <msgpanel.h>
#include <bitmaps.h>
#include <general.h>
#include <lib_rectangle.h>
@ -337,6 +338,12 @@ wxString LIB_RECTANGLE::GetSelectMenuText() const
}
BITMAP_DEF LIB_RECTANGLE::GetMenuImage() const
{
return add_rectangle_xpm;
}
void LIB_RECTANGLE::BeginEdit( STATUS_FLAGS aEditMode, const wxPoint aPosition )
{
wxCHECK_RET( ( aEditMode & ( IS_NEW | IS_MOVED | IS_RESIZED ) ) != 0,

View File

@ -108,7 +108,7 @@ public:
wxString GetSelectMenuText() const override;
BITMAP_DEF GetMenuImage() const override { return add_rectangle_xpm; }
BITMAP_DEF GetMenuImage() const override;
EDA_ITEM* Clone() const override;

View File

@ -36,6 +36,7 @@
#include <richio.h>
#include <base_units.h>
#include <msgpanel.h>
#include <bitmaps.h>
#include <lib_draw_item.h>
#include <general.h>
@ -509,6 +510,12 @@ wxString LIB_TEXT::GetSelectMenuText() const
}
BITMAP_DEF LIB_TEXT::GetMenuImage() const
{
return add_text_xpm;
}
void LIB_TEXT::BeginEdit( STATUS_FLAGS aEditMode, const wxPoint aPosition )
{
wxCHECK_RET( ( aEditMode & ( IS_NEW | IS_MOVED ) ) != 0,

View File

@ -129,7 +129,7 @@ public:
wxString GetSelectMenuText() const override;
BITMAP_DEF GetMenuImage() const override { return add_text_xpm; }
BITMAP_DEF GetMenuImage() const override;
EDA_ITEM* Clone() const override;

View File

@ -30,6 +30,8 @@
#include <class_drawpanel.h>
#include <trigo.h>
#include <macros.h>
#include <bitmaps.h>
#include <sch_bitmap.h>
#include <wx/mstream.h>
@ -309,3 +311,9 @@ void SCH_BITMAP::Plot( PLOTTER* aPlotter )
{
m_image->PlotImage( aPlotter, m_pos, GetLayerColor( GetLayer() ), GetPenSize() );
}
BITMAP_DEF SCH_BITMAP::GetMenuImage() const
{
return image_xpm;
}

View File

@ -130,7 +130,7 @@ public:
wxString GetSelectMenuText() const override { return wxString( _( "Image" ) ); }
BITMAP_DEF GetMenuImage() const override { return image_xpm; }
BITMAP_DEF GetMenuImage() const override;
wxPoint GetPosition() const override { return m_pos; }

View File

@ -35,6 +35,7 @@
#include <common.h>
#include <richio.h>
#include <plot_common.h>
#include <bitmaps.h>
#include <eeschema_config.h>
#include <general.h>
@ -340,6 +341,11 @@ wxString SCH_BUS_BUS_ENTRY::GetSelectMenuText() const
return wxString( _( "Bus to Bus Entry" ) );
}
BITMAP_DEF SCH_BUS_ENTRY_BASE::GetMenuImage() const
{
return add_entry_xpm;
}
bool SCH_BUS_ENTRY_BASE::HitTest( const wxPoint& aPosition, int aAccuracy ) const
{

Some files were not shown because too many files have changed in this diff Show More