Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
K
kicad-source-mirror
Project
Project
Details
Activity
Releases
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Commits
Open sidebar
Elphel
kicad-source-mirror
Commits
5a948e98
Commit
5a948e98
authored
Nov 05, 2007
by
CHARRAS
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
made ADD_MENUITEM_xx static inline
parent
67feced1
Changes
15
Show whitespace changes
Inline
Side-by-side
Showing
15 changed files
with
138 additions
and
93 deletions
+138
-93
displlst.cpp
common/displlst.cpp
+1
-1
edaappl.cpp
common/edaappl.cpp
+1
-1
msgpanel.cpp
common/msgpanel.cpp
+1
-1
selcolor.cpp
common/selcolor.cpp
+1
-1
worksheet.cpp
common/worksheet.cpp
+1
-1
annotate.cpp
eeschema/annotate.cpp
+1
-1
component_class.cpp
eeschema/component_class.cpp
+1
-1
libcmp.h
eeschema/libcmp.h
+1
-1
save_schemas.cpp
eeschema/save_schemas.cpp
+1
-1
hotkeys_basic.h
include/hotkeys_basic.h
+1
-1
macros.h
include/macros.h
+120
-69
class_module.cpp
pcbnew/class_module.cpp
+1
-1
class_track.cpp
pcbnew/class_track.cpp
+1
-1
dragsegm.cpp
pcbnew/dragsegm.cpp
+2
-1
todo.txt
todo.txt
+4
-11
No files found.
common/displlst.cpp
View file @
5a948e98
...
@@ -6,8 +6,8 @@
...
@@ -6,8 +6,8 @@
#include "wxstruct.h"
#include "wxstruct.h"
#include "gr_basic.h"
#include "gr_basic.h"
#include "macros.h"
#include "common.h"
#include "common.h"
#include "macros.h"
...
...
common/edaappl.cpp
View file @
5a948e98
...
@@ -20,7 +20,6 @@
...
@@ -20,7 +20,6 @@
#include "wxstruct.h"
#include "wxstruct.h"
#include "macros.h"
#include "gr_basic.h"
#include "gr_basic.h"
#include "common.h"
#include "common.h"
...
@@ -28,6 +27,7 @@
...
@@ -28,6 +27,7 @@
#include "id.h"
#include "id.h"
#include "build_version.h"
#include "build_version.h"
#include "hotkeys_basic.h"
#include "hotkeys_basic.h"
#include "macros.h"
#include "bitmaps.h"
#include "bitmaps.h"
#include "Language.xpm"
#include "Language.xpm"
...
...
common/msgpanel.cpp
View file @
5a948e98
...
@@ -10,8 +10,8 @@
...
@@ -10,8 +10,8 @@
#include "wxstruct.h"
#include "wxstruct.h"
#include "gr_basic.h"
#include "gr_basic.h"
#include "macros.h"
#include "common.h"
#include "common.h"
#include "macros.h"
/* table des evenements captes par un WinEDA_MsgPanel */
/* table des evenements captes par un WinEDA_MsgPanel */
BEGIN_EVENT_TABLE
(
WinEDA_MsgPanel
,
wxPanel
)
BEGIN_EVENT_TABLE
(
WinEDA_MsgPanel
,
wxPanel
)
...
...
common/selcolor.cpp
View file @
5a948e98
...
@@ -7,10 +7,10 @@
...
@@ -7,10 +7,10 @@
#include "fctsys.h"
#include "fctsys.h"
#include "gr_basic.h"
#include "gr_basic.h"
#include "macros.h"
#include "common.h"
#include "common.h"
#include "colors.h"
#include "colors.h"
#include "macros.h"
#include "wx/statline.h"
#include "wx/statline.h"
...
...
common/worksheet.cpp
View file @
5a948e98
...
@@ -4,9 +4,9 @@
...
@@ -4,9 +4,9 @@
#include "fctsys.h"
#include "fctsys.h"
#include "gr_basic.h"
#include "gr_basic.h"
#include "macros.h"
#include "common.h"
#include "common.h"
#include "macros.h"
#include "worksheet.h"
#include "worksheet.h"
...
...
eeschema/annotate.cpp
View file @
5a948e98
...
@@ -443,7 +443,7 @@ static void ComputeReferenceNumber( CmpListStruct* BaseListeCmp, int NbOfCmp )
...
@@ -443,7 +443,7 @@ static void ComputeReferenceNumber( CmpListStruct* BaseListeCmp, int NbOfCmp )
*/
*/
{
{
int
ii
,
jj
,
LastReferenceNumber
,
NumberOfUnits
,
Unit
;
int
ii
,
jj
,
LastReferenceNumber
,
NumberOfUnits
,
Unit
;
char
*
Text
,
*
RefText
,
*
ValText
;
c
onst
c
har
*
Text
,
*
RefText
,
*
ValText
;
CmpListStruct
*
ObjRef
,
*
ObjToTest
;
CmpListStruct
*
ObjRef
,
*
ObjToTest
;
/* Components with an invisible reference (power...) always are re-annotated*/
/* Components with an invisible reference (power...) always are re-annotated*/
...
...
eeschema/component_class.cpp
View file @
5a948e98
...
@@ -4,12 +4,12 @@
...
@@ -4,12 +4,12 @@
#include "fctsys.h"
#include "fctsys.h"
#include "gr_basic.h"
#include "gr_basic.h"
#include "macros.h"
#include "common.h"
#include "common.h"
#include "program.h"
#include "program.h"
#include "libcmp.h"
#include "libcmp.h"
#include "general.h"
#include "general.h"
#include "macros.h"
#include "id.h"
#include "id.h"
#include "protos.h"
#include "protos.h"
...
...
eeschema/libcmp.h
View file @
5a948e98
...
@@ -90,7 +90,7 @@ typedef enum { /* Type des Pins. si modif: modifier tableau des mgs suivant
...
@@ -90,7 +90,7 @@ typedef enum { /* Type des Pins. si modif: modifier tableau des mgs suivant
}
ElectricPinType
;
}
ElectricPinType
;
/* Messages d'affichage du type electrique */
/* Messages d'affichage du type electrique */
eda_global
wxChar
*
MsgPinElectricType
[]
eda_global
const
wxChar
*
MsgPinElectricType
[]
#ifdef MAIN
#ifdef MAIN
=
{
=
{
wxT
(
"input"
),
wxT
(
"input"
),
...
...
eeschema/save_schemas.cpp
View file @
5a948e98
...
@@ -34,7 +34,7 @@ bool WinEDA_SchematicFrame::SaveEEFile(SCH_SCREEN *screen, int FileSave)
...
@@ -34,7 +34,7 @@ bool WinEDA_SchematicFrame::SaveEEFile(SCH_SCREEN *screen, int FileSave)
wxString
msg
;
wxString
msg
;
wxString
Name
,
BakName
;
wxString
Name
,
BakName
;
const
wxChar
**
LibNames
;
const
wxChar
**
LibNames
;
char
*
layer
,
*
width
;
c
onst
c
har
*
layer
,
*
width
;
int
ii
,
shape
;
int
ii
,
shape
;
bool
Failed
=
FALSE
;
bool
Failed
=
FALSE
;
EDA_BaseStruct
*
Phead
;
EDA_BaseStruct
*
Phead
;
...
...
include/hotkeys_basic.h
View file @
5a948e98
...
@@ -51,7 +51,7 @@ struct Ki_HotkeyInfoSectionDescriptor
...
@@ -51,7 +51,7 @@ struct Ki_HotkeyInfoSectionDescriptor
public
:
public
:
wxString
*
m_SectionTag
;
// The section name
wxString
*
m_SectionTag
;
// The section name
Ki_HotkeyInfo
**
m_HK_InfoList
;
// List of Ki_HotkeyInfo pointers
Ki_HotkeyInfo
**
m_HK_InfoList
;
// List of Ki_HotkeyInfo pointers
c
har
*
m_Comment
;
// comment: will be printed in the config file
c
onst
char
*
m_Comment
;
// comment: will be printed in the config file
// Info usage only
// Info usage only
};
};
...
...
include/macros.h
View file @
5a948e98
...
@@ -4,101 +4,152 @@
...
@@ -4,101 +4,152 @@
#define MACROS_H
#define MACROS_H
#if wxUSE_UNICODE
#if wxUSE_UNICODE
#define CONV_TO_UTF8(
wxstring) ((const char*) wxConvCurrent->cWX2MB(wxstring)
)
#define CONV_TO_UTF8(
wxstring ) ( (const char*) wxConvCurrent->cWX2MB( wxstring )
)
#define CONV_FROM_UTF8(
utf8string) ( wxConvCurrent->cMB2WC(utf8string)
)
#define CONV_FROM_UTF8(
utf8string ) ( wxConvCurrent->cMB2WC( utf8string )
)
#else
#else
#define CONV_TO_UTF8(
wxstring) ((const char*)(wxstring.c_str())
)
#define CONV_TO_UTF8(
wxstring ) ( (const char*) ( wxstring.c_str() )
)
#define CONV_FROM_UTF8(
utf8string
) (utf8string)
#define CONV_FROM_UTF8(
utf8string
) (utf8string)
#endif
#endif
/* violation of C++ standard, cannot use min() and max(), i.e. in lowercase
/* violation of C++ standard, cannot use min() and max(), i.e. in lowercase
#ifndef min
#ifndef min
#define min(x, y) ((x) > (y) ? (y) : (x))
#define min(x, y) ((x) > (y) ? (y) : (x))
#endif
#endif
#ifndef max
#ifndef max
#define max(x, y) ((x) > (y) ? (x) : (y))
#define max(x, y) ((x) > (y) ? (x) : (y))
#endif
#endif
*/
*/
#ifndef MIN
#ifndef MIN
#define MIN(
x, y) ((x) > (y) ? (y) : (x)
)
#define MIN(
x, y ) ( (x) > (y) ? (y) : (x)
)
#endif
#endif
#ifndef MAX
#ifndef MAX
#define MAX(
x, y) ((x) > (y) ? (x) : (y)
)
#define MAX(
x, y ) ( (x) > (y) ? (x) : (y)
)
#endif
#endif
#ifndef ABS
#ifndef ABS
#define ABS(
y) ((y) >= 0 ? (y) : (-(y))
)
#define ABS(
y ) ( (y) >= 0 ? (y) : ( -(y) )
)
#endif
#endif
#define DEG2RAD(
Deg) ((Deg) * M_PI / 180.0
)
#define DEG2RAD(
Deg ) ( (Deg) * M_PI / 180.0
)
#define RAD2DEG(
Rad) ((Rad) * 180.0 / M_PI
)
#define RAD2DEG(
Rad ) ( (Rad) * 180.0 / M_PI
)
/* Normalize angle to be in the -360.0 .. 360.0 range or 0 .. 360.0: */
/* Normalize angle to be in the -360.0 .. 360.0 range or 0 .. 360.0: */
#define NORMALIZE_ANGLE(Angle) { while (Angle < 0) Angle += 3600; \
#define NORMALIZE_ANGLE( Angle ) { while( Angle < 0 ) \
while (Angle > 3600) Angle -= 3600; }
Angle += 3600;\
while( Angle > 3600 ) \
Angle -= 3600; }
/* Normalize angle to be in the 0.0 .. 360.0 range: */
/* Normalize angle to be in the 0.0 .. 360.0 range: */
#define NORMALIZE_ANGLE_POS(Angle) { while (Angle < 0) Angle += 3600; while (Angle >= 3600) Angle -= 3600; }
#define NORMALIZE_ANGLE_POS( Angle ) { while( Angle < 0 ) \
#define NEGATE_AND_NORMALIZE_ANGLE_POS(Angle) \
Angle += 3600;while( Angle >= 3600 ) \
{ Angle = - Angle; while (Angle < 0) Angle += 3600; while (Angle >= 3600) Angle -= 3600; }
Angle -= 3600; }
#define NEGATE_AND_NORMALIZE_ANGLE_POS( Angle ) \
{ Angle = -Angle; while( Angle < 0 ) \
Angle += 3600;while( Angle >= 3600 ) \
Angle -= 3600; }
/* Normalize angle to be in the -90.0 .. 90.0 range */
/* Normalize angle to be in the -90.0 .. 90.0 range */
#define NORMALIZE_ANGLE_90(Angle) { while (Angle < -900) Angle += 1800; \
#define NORMALIZE_ANGLE_90( Angle ) { while( Angle < -900 ) \
while (Angle > 900) Angle -= 1800; }
Angle += 1800;\
while( Angle > 900 ) \
Angle -= 1800; }
/* exchange 2 donnees */
#define EXCHG(a,b) { typeof(a) __temp__ = (a); (a) = (b); (b) = __temp__; }
/* exchange 2 items */
/* macro for insert menuitems with a icon: */
#define EXCHG( a, b ) { typeof(a)__temp__ = (a); (a) = (b); (b) = __temp__; }
#define ADD_MENUITEM(menu, id, text, icon) do {\
wxMenuItem * l_item;\
/* inline functions to insert menuitems with a icon: */
l_item = new wxMenuItem(menu, id, text);\
static
inline
void
ADD_MENUITEM
(
wxMenu
*
menu
,
int
id
,
l_item->SetBitmap(icon); (menu)->Append(l_item);} while(0)
const
wxString
&
text
,
const
wxBitmap
&
icon
)
#define ADD_MENUITEM_WITH_HELP(menu, id, text, help, icon) do {\
{
wxMenuItem * l_item;\
wxMenuItem
*
l_item
;
l_item = new wxMenuItem(menu, id, text, help);\
l_item->SetBitmap(icon); (menu)->Append(l_item);} while(0)
l_item
=
new
wxMenuItem
(
menu
,
id
,
text
);
l_item
->
SetBitmap
(
icon
);
menu
->
Append
(
l_item
);
};
static
inline
void
ADD_MENUITEM_WITH_HELP
(
wxMenu
*
menu
,
int
id
,
const
wxString
&
text
,
const
wxString
&
help
,
const
wxBitmap
&
icon
)
{
wxMenuItem
*
l_item
;
l_item
=
new
wxMenuItem
(
menu
,
id
,
text
,
help
);
l_item
->
SetBitmap
(
icon
);
menu
->
Append
(
l_item
);
};
#ifdef __WINDOWS__
#ifdef __WINDOWS__
#define ADD_MENUITEM_WITH_SUBMENU(menu, submenu, id, text, icon) do {\
static
inline
void
ADD_MENUITEM_WITH_SUBMENU
(
wxMenu
*
menu
,
wxMenu
*
submenu
,
wxMenuItem * l_item;\
int
id
,
const
wxString
&
text
,
l_item = new wxMenuItem(menu, id, text);\
const
wxBitmap
&
icon
)
l_item->SetSubMenu(submenu);\
{
l_item->SetBitmap(icon);\
extern
wxFont
*
g_ItalicFont
;
l_item->SetFont(* g_ItalicFont);\
wxMenuItem
*
l_item
;
menu->Append(l_item);} while(0)
l_item
=
new
wxMenuItem
(
menu
,
id
,
text
);
#define ADD_MENUITEM_WITH_HELP_AND_SUBMENU(menu, submenu, id, text, help, icon) do {\
l_item
->
SetSubMenu
(
submenu
);
wxMenuItem * l_item;\
l_item
->
SetBitmap
(
icon
);
l_item = new wxMenuItem(menu, id, text, help);\
l_item
->
SetFont
(
*
g_ItalicFont
);
l_item->SetSubMenu(submenu);\
menu
->
Append
(
l_item
);
l_item->SetBitmap(icon);\
};
l_item->SetFont(*g_ItalicFont);\
menu->Append(l_item);} while(0)
static
inline
void
ADD_MENUITEM_WITH_HELP_AND_SUBMENU
(
wxMenu
*
menu
,
wxMenu
*
submenu
,
int
id
,
const
wxString
&
text
,
const
wxString
&
help
,
const
wxBitmap
&
icon
)
{
extern
wxFont
*
g_ItalicFont
;
wxMenuItem
*
l_item
;
l_item
=
new
wxMenuItem
(
menu
,
id
,
text
,
help
);
l_item
->
SetSubMenu
(
submenu
);
l_item
->
SetBitmap
(
icon
);
l_item
->
SetFont
(
*
g_ItalicFont
);
menu
->
Append
(
l_item
);
};
#else
#else
#define ADD_MENUITEM_WITH_SUBMENU(menu, submenu, id, text, icon) do {\
static
inline
void
ADD_MENUITEM_WITH_SUBMENU
(
wxMenu
*
menu
,
wxMenu
*
submenu
,
wxMenuItem * l_item;\
int
id
,
l_item = new wxMenuItem(menu, id, text);\
const
wxString
&
text
,
l_item->SetSubMenu(submenu);\
const
wxBitmap
&
icon
)
l_item->SetBitmap(icon);\
{
menu->Append(l_item);} while(0)
wxMenuItem
*
l_item
;
#define ADD_MENUITEM_WITH_HELP_AND_SUBMENU(menu, submenu, id, text, help, icon) do {\
l_item
=
new
wxMenuItem
(
menu
,
id
,
text
);
wxMenuItem * l_item;\
l_item
->
SetSubMenu
(
submenu
);
l_item = new wxMenuItem(menu, id, text, help);\
l_item
->
SetBitmap
(
icon
);
l_item->SetSubMenu(submenu);\
menu
->
Append
(
l_item
);
l_item->SetBitmap(icon);\
};
menu->Append(l_item);} while(0)
static
inline
void
ADD_MENUITEM_WITH_HELP_AND_SUBMENU
(
wxMenu
*
menu
,
wxMenu
*
submenu
,
int
id
,
const
wxString
&
text
,
const
wxString
&
help
,
const
wxBitmap
&
icon
)
{
wxMenuItem
*
l_item
;
l_item
=
new
wxMenuItem
(
menu
,
id
,
text
,
help
);
l_item
->
SetSubMenu
(
submenu
);
l_item
->
SetBitmap
(
icon
);
menu
->
Append
(
l_item
);
};
#endif
#endif
#ifdef __WINDOWS__
#ifdef __WINDOWS__
#define SETBITMAPS(
icon) item->SetBitmaps(apply_xpm, (icon)
)
#define SETBITMAPS(
icon ) item->SetBitmaps( apply_xpm, (icon)
)
#else
#else
#define SETBITMAPS(
icon
)
#define SETBITMAPS(
icon
)
#endif
#endif
#endif
/* ifdef MACRO_H */
#endif
/* ifdef MACRO_H */
pcbnew/class_module.cpp
View file @
5a948e98
...
@@ -245,7 +245,7 @@ void MODULE::UnLink()
...
@@ -245,7 +245,7 @@ void MODULE::UnLink()
{
{
if
(
GetState
(
DELETED
)
)
// A REVOIR car Pback = NULL si place en undelete
if
(
GetState
(
DELETED
)
)
// A REVOIR car Pback = NULL si place en undelete
{
{
if
(
g_UnDeleteStack
)
if
(
g_UnDeleteStack
Ptr
)
g_UnDeleteStack
[
g_UnDeleteStackPtr
-
1
]
=
Next
();
g_UnDeleteStack
[
g_UnDeleteStackPtr
-
1
]
=
Next
();
}
}
else
else
...
...
pcbnew/class_track.cpp
View file @
5a948e98
...
@@ -355,7 +355,7 @@ void TRACK::UnLink()
...
@@ -355,7 +355,7 @@ void TRACK::UnLink()
{
{
if
(
GetState
(
DELETED
)
)
// A REVOIR car Pback = NULL si place en undelete
if
(
GetState
(
DELETED
)
)
// A REVOIR car Pback = NULL si place en undelete
{
{
if
(
g_UnDeleteStack
)
if
(
g_UnDeleteStack
Ptr
)
g_UnDeleteStack
[
g_UnDeleteStackPtr
-
1
]
=
(
BOARD_ITEM
*
)
Pnext
;
g_UnDeleteStack
[
g_UnDeleteStackPtr
-
1
]
=
(
BOARD_ITEM
*
)
Pnext
;
}
}
else
else
...
...
pcbnew/dragsegm.cpp
View file @
5a948e98
...
@@ -242,6 +242,7 @@ void EraseDragListe()
...
@@ -242,6 +242,7 @@ void EraseDragListe()
{
{
NextStruct
=
pt_drag
->
Pnext
;
NextStruct
=
pt_drag
->
Pnext
;
pt_drag
->
m_Segm
->
m_Flags
=
0
;
pt_drag
->
m_Segm
->
m_Flags
=
0
;
pt_drag
->
m_Segm
->
m_Flags
=
0
;
delete
pt_drag
;
delete
pt_drag
;
}
}
...
...
todo.txt
View file @
5a948e98
...
@@ -22,16 +22,6 @@ referenced. I think this would be an easier way to manage xpms.
...
@@ -22,16 +22,6 @@ referenced. I think this would be an easier way to manage xpms.
*** use BOARD_ITEM::MenuIcon() in the onrightclick.cpp
*** use BOARD_ITEM::MenuIcon() in the onrightclick.cpp
*** make the ADD_MENUITEM macros in include/macros.h be static inline functions instead
of macros. e.g. w/o argument types:
static inline void ADD_MENUITEM(menu, id, text, icon)
{
wxMenuItem * l_item;
l_item = new wxMenuItem(menu, id, text);
l_item->SetBitmap(icon); menu->Append(l_item);
}
*** rework zones so they are modifiable and so that the user does not
*** rework zones so they are modifiable and so that the user does not
need to enter tracks for thru hole pads or vias which connect to a zone.
need to enter tracks for thru hole pads or vias which connect to a zone.
I propose a two step solution:
I propose a two step solution:
...
@@ -90,4 +80,7 @@ when needed, on the fly.
...
@@ -90,4 +80,7 @@ when needed, on the fly.
2007-Nov-4 Assigned To: nobody
asked by: jp Charras
================================================================================
Use the collector classes in eeschema.
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment