2013-07-28 22:08:34 +00:00
|
|
|
//-----------------------------------------------------------------------------
|
|
|
|
// The text-based browser window, used to view the structure of the model by
|
|
|
|
// groups and for other similar purposes.
|
|
|
|
//
|
|
|
|
// Copyright 2008-2013 Jonathan Westhues.
|
|
|
|
//-----------------------------------------------------------------------------
|
2008-06-23 08:37:12 +00:00
|
|
|
#include "solvespace.h"
|
|
|
|
|
|
|
|
//-----------------------------------------------------------------------------
|
2008-07-10 06:11:56 +00:00
|
|
|
// A navigation bar that always appears at the top of the window, with a
|
|
|
|
// link to bring us back home.
|
2008-06-23 08:37:12 +00:00
|
|
|
//-----------------------------------------------------------------------------
|
Use C99 integer types and C++ boolean types/values
This change comprehensively replaces the use of Microsoft-standard integer
and boolean types with their C99/C++ standard equivalents, as the latter is
more appropriate for a cross-platform application. With matter-of-course
exceptions in the Win32-specific code, the types/values have been converted
as follows:
QWORD --> uint64_t
SQWORD --> int64_t
DWORD --> uint32_t
SDWORD --> int32_t
WORD --> uint16_t
SWORD --> int16_t
BYTE --> uint8_t
BOOL --> bool
TRUE --> true
FALSE --> false
The following related changes are also included:
* Added C99 integer type definitions for Windows, as stdint.h is not
available prior to Visual Studio 2010
* Changed types of some variables in the SolveSpace class from 'int' to
'bool', as they actually represent boolean settings
* Implemented new Cnf{Freeze,Thaw}Bool() functions to support boolean
variables in the Registry
* Cnf{Freeze,Thaw}DWORD() are now Cnf{Freeze,Thaw}Int()
* TtfFont::Get{WORD,DWORD}() are now TtfFont::Get{USHORT,ULONG}() (names
inspired by the OpenType spec)
* RGB colors are packed into an integer of type uint32_t (nee DWORD), but
in a few places, these were represented by an int; these have been
corrected to uint32_t
2013-10-02 05:45:13 +00:00
|
|
|
void TextWindow::ScreenHome(int link, uint32_t v) {
|
Convert all enumerations to use `enum class`.
Specifically, take the old code that looks like this:
class Foo {
enum { X = 1, Y = 2 };
int kind;
}
... foo.kind = Foo::X; ...
and convert it to this:
class Foo {
enum class Kind : uint32_t { X = 1, Y = 2 };
Kind kind;
}
... foo.kind = Foo::Kind::X;
(In some cases the enumeration would not be in the class namespace,
such as when it is generally useful.)
The benefits are as follows:
* The type of the field gives a clear indication of intent, both
to humans and tools (such as binding generators).
* The compiler is able to automatically warn when a switch is not
exhaustive; but this is currently suppressed by the
default: ssassert(false, ...)
idiom.
* Integers and plain enums are weakly type checked: they implicitly
convert into each other. This can hide bugs where type conversion
is performed but not intended. Enum classes are strongly type
checked.
* Plain enums pollute parent namespaces; enum classes do not.
Almost every defined enum we have already has a kind of ad-hoc
namespacing via `NAMESPACE_`, which is now explicit.
* Plain enums do not have a well-defined ABI size, which is
important for bindings. Enum classes can have it, if specified.
We specify the base type for all enums as uint32_t, which is
a safe choice and allows us to not change the numeric values
of any variants.
This commit introduces absolutely no functional change to the code,
just renaming and change of types. It handles almost all cases,
except GraphicsWindow::pending.operation, which needs minor
functional change.
2016-05-20 08:31:20 +00:00
|
|
|
SS.TW.GoToScreen(Screen::LIST_OF_GROUPS);
|
2008-06-23 08:37:12 +00:00
|
|
|
}
|
|
|
|
void TextWindow::ShowHeader(bool withNav) {
|
|
|
|
ClearScreen();
|
|
|
|
|
2015-11-06 08:40:12 +00:00
|
|
|
const char *header;
|
|
|
|
std::string desc;
|
2010-05-03 05:04:42 +00:00
|
|
|
if(SS.GW.LockedInWorkplane()) {
|
2015-11-06 08:40:12 +00:00
|
|
|
header = "in plane: ";
|
|
|
|
desc = SK.GetEntity(SS.GW.ActiveWorkplane())->DescriptionString();
|
2010-05-03 05:04:42 +00:00
|
|
|
} else {
|
2015-11-06 08:40:12 +00:00
|
|
|
header = "drawing / constraining in 3d";
|
|
|
|
desc = "";
|
2010-05-03 05:04:42 +00:00
|
|
|
}
|
2008-06-23 08:37:12 +00:00
|
|
|
|
|
|
|
// Navigation buttons
|
|
|
|
if(withNav) {
|
2010-05-03 05:04:42 +00:00
|
|
|
Printf(false, " %Fl%Lh%fhome%E %Ft%s%E%s",
|
2015-11-06 08:40:12 +00:00
|
|
|
(&TextWindow::ScreenHome), header, desc.c_str());
|
2008-06-23 08:37:12 +00:00
|
|
|
} else {
|
2015-11-06 08:40:12 +00:00
|
|
|
Printf(false, " %Ft%s%E%s", header, desc.c_str());
|
2008-06-23 08:37:12 +00:00
|
|
|
}
|
|
|
|
|
2010-05-03 05:04:42 +00:00
|
|
|
// Leave space for the icons that are painted here.
|
|
|
|
Printf(false, "");
|
|
|
|
Printf(false, "");
|
2008-06-23 08:37:12 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
//-----------------------------------------------------------------------------
|
|
|
|
// The screen that shows a list of every group in the sketch, with options
|
|
|
|
// to hide or show them, and to view them in detail. This is our home page.
|
|
|
|
//-----------------------------------------------------------------------------
|
Use C99 integer types and C++ boolean types/values
This change comprehensively replaces the use of Microsoft-standard integer
and boolean types with their C99/C++ standard equivalents, as the latter is
more appropriate for a cross-platform application. With matter-of-course
exceptions in the Win32-specific code, the types/values have been converted
as follows:
QWORD --> uint64_t
SQWORD --> int64_t
DWORD --> uint32_t
SDWORD --> int32_t
WORD --> uint16_t
SWORD --> int16_t
BYTE --> uint8_t
BOOL --> bool
TRUE --> true
FALSE --> false
The following related changes are also included:
* Added C99 integer type definitions for Windows, as stdint.h is not
available prior to Visual Studio 2010
* Changed types of some variables in the SolveSpace class from 'int' to
'bool', as they actually represent boolean settings
* Implemented new Cnf{Freeze,Thaw}Bool() functions to support boolean
variables in the Registry
* Cnf{Freeze,Thaw}DWORD() are now Cnf{Freeze,Thaw}Int()
* TtfFont::Get{WORD,DWORD}() are now TtfFont::Get{USHORT,ULONG}() (names
inspired by the OpenType spec)
* RGB colors are packed into an integer of type uint32_t (nee DWORD), but
in a few places, these were represented by an int; these have been
corrected to uint32_t
2013-10-02 05:45:13 +00:00
|
|
|
void TextWindow::ScreenSelectGroup(int link, uint32_t v) {
|
Convert all enumerations to use `enum class`.
Specifically, take the old code that looks like this:
class Foo {
enum { X = 1, Y = 2 };
int kind;
}
... foo.kind = Foo::X; ...
and convert it to this:
class Foo {
enum class Kind : uint32_t { X = 1, Y = 2 };
Kind kind;
}
... foo.kind = Foo::Kind::X;
(In some cases the enumeration would not be in the class namespace,
such as when it is generally useful.)
The benefits are as follows:
* The type of the field gives a clear indication of intent, both
to humans and tools (such as binding generators).
* The compiler is able to automatically warn when a switch is not
exhaustive; but this is currently suppressed by the
default: ssassert(false, ...)
idiom.
* Integers and plain enums are weakly type checked: they implicitly
convert into each other. This can hide bugs where type conversion
is performed but not intended. Enum classes are strongly type
checked.
* Plain enums pollute parent namespaces; enum classes do not.
Almost every defined enum we have already has a kind of ad-hoc
namespacing via `NAMESPACE_`, which is now explicit.
* Plain enums do not have a well-defined ABI size, which is
important for bindings. Enum classes can have it, if specified.
We specify the base type for all enums as uint32_t, which is
a safe choice and allows us to not change the numeric values
of any variants.
This commit introduces absolutely no functional change to the code,
just renaming and change of types. It handles almost all cases,
except GraphicsWindow::pending.operation, which needs minor
functional change.
2016-05-20 08:31:20 +00:00
|
|
|
SS.TW.GoToScreen(Screen::GROUP_INFO);
|
2008-07-10 06:11:56 +00:00
|
|
|
SS.TW.shown.group.v = v;
|
2008-06-23 08:37:12 +00:00
|
|
|
}
|
Use C99 integer types and C++ boolean types/values
This change comprehensively replaces the use of Microsoft-standard integer
and boolean types with their C99/C++ standard equivalents, as the latter is
more appropriate for a cross-platform application. With matter-of-course
exceptions in the Win32-specific code, the types/values have been converted
as follows:
QWORD --> uint64_t
SQWORD --> int64_t
DWORD --> uint32_t
SDWORD --> int32_t
WORD --> uint16_t
SWORD --> int16_t
BYTE --> uint8_t
BOOL --> bool
TRUE --> true
FALSE --> false
The following related changes are also included:
* Added C99 integer type definitions for Windows, as stdint.h is not
available prior to Visual Studio 2010
* Changed types of some variables in the SolveSpace class from 'int' to
'bool', as they actually represent boolean settings
* Implemented new Cnf{Freeze,Thaw}Bool() functions to support boolean
variables in the Registry
* Cnf{Freeze,Thaw}DWORD() are now Cnf{Freeze,Thaw}Int()
* TtfFont::Get{WORD,DWORD}() are now TtfFont::Get{USHORT,ULONG}() (names
inspired by the OpenType spec)
* RGB colors are packed into an integer of type uint32_t (nee DWORD), but
in a few places, these were represented by an int; these have been
corrected to uint32_t
2013-10-02 05:45:13 +00:00
|
|
|
void TextWindow::ScreenToggleGroupShown(int link, uint32_t v) {
|
2008-06-23 08:37:12 +00:00
|
|
|
hGroup hg = { v };
|
2009-04-19 05:53:16 +00:00
|
|
|
Group *g = SK.GetGroup(hg);
|
2008-06-23 08:37:12 +00:00
|
|
|
g->visible = !(g->visible);
|
|
|
|
// If a group was just shown, then it might not have been generated
|
|
|
|
// previously, so regenerate.
|
|
|
|
SS.GenerateAll();
|
|
|
|
}
|
Use C99 integer types and C++ boolean types/values
This change comprehensively replaces the use of Microsoft-standard integer
and boolean types with their C99/C++ standard equivalents, as the latter is
more appropriate for a cross-platform application. With matter-of-course
exceptions in the Win32-specific code, the types/values have been converted
as follows:
QWORD --> uint64_t
SQWORD --> int64_t
DWORD --> uint32_t
SDWORD --> int32_t
WORD --> uint16_t
SWORD --> int16_t
BYTE --> uint8_t
BOOL --> bool
TRUE --> true
FALSE --> false
The following related changes are also included:
* Added C99 integer type definitions for Windows, as stdint.h is not
available prior to Visual Studio 2010
* Changed types of some variables in the SolveSpace class from 'int' to
'bool', as they actually represent boolean settings
* Implemented new Cnf{Freeze,Thaw}Bool() functions to support boolean
variables in the Registry
* Cnf{Freeze,Thaw}DWORD() are now Cnf{Freeze,Thaw}Int()
* TtfFont::Get{WORD,DWORD}() are now TtfFont::Get{USHORT,ULONG}() (names
inspired by the OpenType spec)
* RGB colors are packed into an integer of type uint32_t (nee DWORD), but
in a few places, these were represented by an int; these have been
corrected to uint32_t
2013-10-02 05:45:13 +00:00
|
|
|
void TextWindow::ScreenShowGroupsSpecial(int link, uint32_t v) {
|
2016-02-17 10:03:07 +00:00
|
|
|
bool state = link == 's';
|
|
|
|
for(int i = 0; i < SK.groupOrder.n; i++) {
|
|
|
|
Group *g = SK.GetGroup(SK.groupOrder.elem[i]);
|
|
|
|
g->visible = state;
|
2008-06-23 08:37:12 +00:00
|
|
|
}
|
2016-06-30 15:54:35 +00:00
|
|
|
SS.GW.persistentDirty = true;
|
2008-06-23 08:37:12 +00:00
|
|
|
}
|
Use C99 integer types and C++ boolean types/values
This change comprehensively replaces the use of Microsoft-standard integer
and boolean types with their C99/C++ standard equivalents, as the latter is
more appropriate for a cross-platform application. With matter-of-course
exceptions in the Win32-specific code, the types/values have been converted
as follows:
QWORD --> uint64_t
SQWORD --> int64_t
DWORD --> uint32_t
SDWORD --> int32_t
WORD --> uint16_t
SWORD --> int16_t
BYTE --> uint8_t
BOOL --> bool
TRUE --> true
FALSE --> false
The following related changes are also included:
* Added C99 integer type definitions for Windows, as stdint.h is not
available prior to Visual Studio 2010
* Changed types of some variables in the SolveSpace class from 'int' to
'bool', as they actually represent boolean settings
* Implemented new Cnf{Freeze,Thaw}Bool() functions to support boolean
variables in the Registry
* Cnf{Freeze,Thaw}DWORD() are now Cnf{Freeze,Thaw}Int()
* TtfFont::Get{WORD,DWORD}() are now TtfFont::Get{USHORT,ULONG}() (names
inspired by the OpenType spec)
* RGB colors are packed into an integer of type uint32_t (nee DWORD), but
in a few places, these were represented by an int; these have been
corrected to uint32_t
2013-10-02 05:45:13 +00:00
|
|
|
void TextWindow::ScreenActivateGroup(int link, uint32_t v) {
|
2008-06-23 08:37:12 +00:00
|
|
|
SS.GW.activeGroup.v = v;
|
2009-04-19 05:53:16 +00:00
|
|
|
SK.GetGroup(SS.GW.activeGroup)->Activate();
|
2008-06-23 08:37:12 +00:00
|
|
|
SS.GW.ClearSuper();
|
|
|
|
}
|
|
|
|
void TextWindow::ReportHowGroupSolved(hGroup hg) {
|
|
|
|
SS.GW.ClearSuper();
|
Convert all enumerations to use `enum class`.
Specifically, take the old code that looks like this:
class Foo {
enum { X = 1, Y = 2 };
int kind;
}
... foo.kind = Foo::X; ...
and convert it to this:
class Foo {
enum class Kind : uint32_t { X = 1, Y = 2 };
Kind kind;
}
... foo.kind = Foo::Kind::X;
(In some cases the enumeration would not be in the class namespace,
such as when it is generally useful.)
The benefits are as follows:
* The type of the field gives a clear indication of intent, both
to humans and tools (such as binding generators).
* The compiler is able to automatically warn when a switch is not
exhaustive; but this is currently suppressed by the
default: ssassert(false, ...)
idiom.
* Integers and plain enums are weakly type checked: they implicitly
convert into each other. This can hide bugs where type conversion
is performed but not intended. Enum classes are strongly type
checked.
* Plain enums pollute parent namespaces; enum classes do not.
Almost every defined enum we have already has a kind of ad-hoc
namespacing via `NAMESPACE_`, which is now explicit.
* Plain enums do not have a well-defined ABI size, which is
important for bindings. Enum classes can have it, if specified.
We specify the base type for all enums as uint32_t, which is
a safe choice and allows us to not change the numeric values
of any variants.
This commit introduces absolutely no functional change to the code,
just renaming and change of types. It handles almost all cases,
except GraphicsWindow::pending.operation, which needs minor
functional change.
2016-05-20 08:31:20 +00:00
|
|
|
SS.TW.GoToScreen(Screen::GROUP_SOLVE_INFO);
|
2008-07-10 06:11:56 +00:00
|
|
|
SS.TW.shown.group.v = hg.v;
|
2015-03-18 17:02:11 +00:00
|
|
|
SS.ScheduleShowTW();
|
2008-06-23 08:37:12 +00:00
|
|
|
}
|
Use C99 integer types and C++ boolean types/values
This change comprehensively replaces the use of Microsoft-standard integer
and boolean types with their C99/C++ standard equivalents, as the latter is
more appropriate for a cross-platform application. With matter-of-course
exceptions in the Win32-specific code, the types/values have been converted
as follows:
QWORD --> uint64_t
SQWORD --> int64_t
DWORD --> uint32_t
SDWORD --> int32_t
WORD --> uint16_t
SWORD --> int16_t
BYTE --> uint8_t
BOOL --> bool
TRUE --> true
FALSE --> false
The following related changes are also included:
* Added C99 integer type definitions for Windows, as stdint.h is not
available prior to Visual Studio 2010
* Changed types of some variables in the SolveSpace class from 'int' to
'bool', as they actually represent boolean settings
* Implemented new Cnf{Freeze,Thaw}Bool() functions to support boolean
variables in the Registry
* Cnf{Freeze,Thaw}DWORD() are now Cnf{Freeze,Thaw}Int()
* TtfFont::Get{WORD,DWORD}() are now TtfFont::Get{USHORT,ULONG}() (names
inspired by the OpenType spec)
* RGB colors are packed into an integer of type uint32_t (nee DWORD), but
in a few places, these were represented by an int; these have been
corrected to uint32_t
2013-10-02 05:45:13 +00:00
|
|
|
void TextWindow::ScreenHowGroupSolved(int link, uint32_t v) {
|
2008-06-23 08:37:12 +00:00
|
|
|
if(SS.GW.activeGroup.v != v) {
|
|
|
|
ScreenActivateGroup(link, v);
|
|
|
|
}
|
Convert all enumerations to use `enum class`.
Specifically, take the old code that looks like this:
class Foo {
enum { X = 1, Y = 2 };
int kind;
}
... foo.kind = Foo::X; ...
and convert it to this:
class Foo {
enum class Kind : uint32_t { X = 1, Y = 2 };
Kind kind;
}
... foo.kind = Foo::Kind::X;
(In some cases the enumeration would not be in the class namespace,
such as when it is generally useful.)
The benefits are as follows:
* The type of the field gives a clear indication of intent, both
to humans and tools (such as binding generators).
* The compiler is able to automatically warn when a switch is not
exhaustive; but this is currently suppressed by the
default: ssassert(false, ...)
idiom.
* Integers and plain enums are weakly type checked: they implicitly
convert into each other. This can hide bugs where type conversion
is performed but not intended. Enum classes are strongly type
checked.
* Plain enums pollute parent namespaces; enum classes do not.
Almost every defined enum we have already has a kind of ad-hoc
namespacing via `NAMESPACE_`, which is now explicit.
* Plain enums do not have a well-defined ABI size, which is
important for bindings. Enum classes can have it, if specified.
We specify the base type for all enums as uint32_t, which is
a safe choice and allows us to not change the numeric values
of any variants.
This commit introduces absolutely no functional change to the code,
just renaming and change of types. It handles almost all cases,
except GraphicsWindow::pending.operation, which needs minor
functional change.
2016-05-20 08:31:20 +00:00
|
|
|
SS.TW.GoToScreen(Screen::GROUP_SOLVE_INFO);
|
2008-07-10 06:11:56 +00:00
|
|
|
SS.TW.shown.group.v = v;
|
2008-06-23 08:37:12 +00:00
|
|
|
}
|
Use C99 integer types and C++ boolean types/values
This change comprehensively replaces the use of Microsoft-standard integer
and boolean types with their C99/C++ standard equivalents, as the latter is
more appropriate for a cross-platform application. With matter-of-course
exceptions in the Win32-specific code, the types/values have been converted
as follows:
QWORD --> uint64_t
SQWORD --> int64_t
DWORD --> uint32_t
SDWORD --> int32_t
WORD --> uint16_t
SWORD --> int16_t
BYTE --> uint8_t
BOOL --> bool
TRUE --> true
FALSE --> false
The following related changes are also included:
* Added C99 integer type definitions for Windows, as stdint.h is not
available prior to Visual Studio 2010
* Changed types of some variables in the SolveSpace class from 'int' to
'bool', as they actually represent boolean settings
* Implemented new Cnf{Freeze,Thaw}Bool() functions to support boolean
variables in the Registry
* Cnf{Freeze,Thaw}DWORD() are now Cnf{Freeze,Thaw}Int()
* TtfFont::Get{WORD,DWORD}() are now TtfFont::Get{USHORT,ULONG}() (names
inspired by the OpenType spec)
* RGB colors are packed into an integer of type uint32_t (nee DWORD), but
in a few places, these were represented by an int; these have been
corrected to uint32_t
2013-10-02 05:45:13 +00:00
|
|
|
void TextWindow::ScreenShowConfiguration(int link, uint32_t v) {
|
Convert all enumerations to use `enum class`.
Specifically, take the old code that looks like this:
class Foo {
enum { X = 1, Y = 2 };
int kind;
}
... foo.kind = Foo::X; ...
and convert it to this:
class Foo {
enum class Kind : uint32_t { X = 1, Y = 2 };
Kind kind;
}
... foo.kind = Foo::Kind::X;
(In some cases the enumeration would not be in the class namespace,
such as when it is generally useful.)
The benefits are as follows:
* The type of the field gives a clear indication of intent, both
to humans and tools (such as binding generators).
* The compiler is able to automatically warn when a switch is not
exhaustive; but this is currently suppressed by the
default: ssassert(false, ...)
idiom.
* Integers and plain enums are weakly type checked: they implicitly
convert into each other. This can hide bugs where type conversion
is performed but not intended. Enum classes are strongly type
checked.
* Plain enums pollute parent namespaces; enum classes do not.
Almost every defined enum we have already has a kind of ad-hoc
namespacing via `NAMESPACE_`, which is now explicit.
* Plain enums do not have a well-defined ABI size, which is
important for bindings. Enum classes can have it, if specified.
We specify the base type for all enums as uint32_t, which is
a safe choice and allows us to not change the numeric values
of any variants.
This commit introduces absolutely no functional change to the code,
just renaming and change of types. It handles almost all cases,
except GraphicsWindow::pending.operation, which needs minor
functional change.
2016-05-20 08:31:20 +00:00
|
|
|
SS.TW.GoToScreen(Screen::CONFIGURATION);
|
2008-06-23 08:37:12 +00:00
|
|
|
}
|
Use C99 integer types and C++ boolean types/values
This change comprehensively replaces the use of Microsoft-standard integer
and boolean types with their C99/C++ standard equivalents, as the latter is
more appropriate for a cross-platform application. With matter-of-course
exceptions in the Win32-specific code, the types/values have been converted
as follows:
QWORD --> uint64_t
SQWORD --> int64_t
DWORD --> uint32_t
SDWORD --> int32_t
WORD --> uint16_t
SWORD --> int16_t
BYTE --> uint8_t
BOOL --> bool
TRUE --> true
FALSE --> false
The following related changes are also included:
* Added C99 integer type definitions for Windows, as stdint.h is not
available prior to Visual Studio 2010
* Changed types of some variables in the SolveSpace class from 'int' to
'bool', as they actually represent boolean settings
* Implemented new Cnf{Freeze,Thaw}Bool() functions to support boolean
variables in the Registry
* Cnf{Freeze,Thaw}DWORD() are now Cnf{Freeze,Thaw}Int()
* TtfFont::Get{WORD,DWORD}() are now TtfFont::Get{USHORT,ULONG}() (names
inspired by the OpenType spec)
* RGB colors are packed into an integer of type uint32_t (nee DWORD), but
in a few places, these were represented by an int; these have been
corrected to uint32_t
2013-10-02 05:45:13 +00:00
|
|
|
void TextWindow::ScreenShowEditView(int link, uint32_t v) {
|
Convert all enumerations to use `enum class`.
Specifically, take the old code that looks like this:
class Foo {
enum { X = 1, Y = 2 };
int kind;
}
... foo.kind = Foo::X; ...
and convert it to this:
class Foo {
enum class Kind : uint32_t { X = 1, Y = 2 };
Kind kind;
}
... foo.kind = Foo::Kind::X;
(In some cases the enumeration would not be in the class namespace,
such as when it is generally useful.)
The benefits are as follows:
* The type of the field gives a clear indication of intent, both
to humans and tools (such as binding generators).
* The compiler is able to automatically warn when a switch is not
exhaustive; but this is currently suppressed by the
default: ssassert(false, ...)
idiom.
* Integers and plain enums are weakly type checked: they implicitly
convert into each other. This can hide bugs where type conversion
is performed but not intended. Enum classes are strongly type
checked.
* Plain enums pollute parent namespaces; enum classes do not.
Almost every defined enum we have already has a kind of ad-hoc
namespacing via `NAMESPACE_`, which is now explicit.
* Plain enums do not have a well-defined ABI size, which is
important for bindings. Enum classes can have it, if specified.
We specify the base type for all enums as uint32_t, which is
a safe choice and allows us to not change the numeric values
of any variants.
This commit introduces absolutely no functional change to the code,
just renaming and change of types. It handles almost all cases,
except GraphicsWindow::pending.operation, which needs minor
functional change.
2016-05-20 08:31:20 +00:00
|
|
|
SS.TW.GoToScreen(Screen::EDIT_VIEW);
|
2010-01-04 00:35:28 +00:00
|
|
|
}
|
Use C99 integer types and C++ boolean types/values
This change comprehensively replaces the use of Microsoft-standard integer
and boolean types with their C99/C++ standard equivalents, as the latter is
more appropriate for a cross-platform application. With matter-of-course
exceptions in the Win32-specific code, the types/values have been converted
as follows:
QWORD --> uint64_t
SQWORD --> int64_t
DWORD --> uint32_t
SDWORD --> int32_t
WORD --> uint16_t
SWORD --> int16_t
BYTE --> uint8_t
BOOL --> bool
TRUE --> true
FALSE --> false
The following related changes are also included:
* Added C99 integer type definitions for Windows, as stdint.h is not
available prior to Visual Studio 2010
* Changed types of some variables in the SolveSpace class from 'int' to
'bool', as they actually represent boolean settings
* Implemented new Cnf{Freeze,Thaw}Bool() functions to support boolean
variables in the Registry
* Cnf{Freeze,Thaw}DWORD() are now Cnf{Freeze,Thaw}Int()
* TtfFont::Get{WORD,DWORD}() are now TtfFont::Get{USHORT,ULONG}() (names
inspired by the OpenType spec)
* RGB colors are packed into an integer of type uint32_t (nee DWORD), but
in a few places, these were represented by an int; these have been
corrected to uint32_t
2013-10-02 05:45:13 +00:00
|
|
|
void TextWindow::ScreenGoToWebsite(int link, uint32_t v) {
|
2018-07-18 02:20:25 +00:00
|
|
|
Platform::OpenInBrowser("http://solvespace.com/txtlink");
|
2008-02-09 13:52:01 +00:00
|
|
|
}
|
2016-05-05 05:54:05 +00:00
|
|
|
void TextWindow::ShowListOfGroups() {
|
2015-11-05 19:39:27 +00:00
|
|
|
const char *radioTrue = " " RADIO_TRUE " ",
|
|
|
|
*radioFalse = " " RADIO_FALSE " ",
|
|
|
|
*checkTrue = " " CHECK_TRUE " ",
|
|
|
|
*checkFalse = " " CHECK_FALSE " ";
|
2010-05-09 18:25:23 +00:00
|
|
|
|
|
|
|
Printf(true, "%Ft active");
|
2017-09-13 09:39:27 +00:00
|
|
|
Printf(false, "%Ft shown dof group-name%E");
|
2008-06-23 08:37:12 +00:00
|
|
|
int i;
|
|
|
|
bool afterActive = false;
|
2016-02-17 10:03:07 +00:00
|
|
|
for(i = 0; i < SK.groupOrder.n; i++) {
|
|
|
|
Group *g = SK.GetGroup(SK.groupOrder.elem[i]);
|
2015-11-06 08:40:12 +00:00
|
|
|
std::string s = g->DescriptionString();
|
2008-06-23 08:37:12 +00:00
|
|
|
bool active = (g->h.v == SS.GW.activeGroup.v);
|
|
|
|
bool shown = g->visible;
|
2016-01-21 15:01:43 +00:00
|
|
|
bool ok = g->IsSolvedOkay();
|
2017-09-13 09:39:27 +00:00
|
|
|
int dof = g->solved.dof;
|
|
|
|
char sdof[16] = "ok ";
|
|
|
|
if(ok && dof > 0) {
|
|
|
|
if(dof > 999) {
|
|
|
|
strcpy(sdof, "###");
|
|
|
|
} else {
|
|
|
|
sprintf(sdof, "%-3d", dof);
|
|
|
|
}
|
|
|
|
}
|
2008-06-23 08:37:12 +00:00
|
|
|
bool ref = (g->h.v == Group::HGROUP_REFERENCES.v);
|
|
|
|
Printf(false, "%Bp%Fd "
|
2010-05-09 18:25:23 +00:00
|
|
|
"%Ft%s%Fb%D%f%Ll%s%E "
|
|
|
|
"%Fb%s%D%f%Ll%s%E "
|
2017-09-13 09:39:27 +00:00
|
|
|
"%Fp%D%f%s%Ll%s%E "
|
2008-06-23 08:37:12 +00:00
|
|
|
"%Fl%Ll%D%f%s",
|
|
|
|
// Alternate between light and dark backgrounds, for readability
|
2010-05-09 18:25:23 +00:00
|
|
|
(i & 1) ? 'd' : 'a',
|
2008-06-23 08:37:12 +00:00
|
|
|
// Link that activates the group
|
2010-05-09 18:25:23 +00:00
|
|
|
ref ? " " : "",
|
|
|
|
g->h.v, (&TextWindow::ScreenActivateGroup),
|
|
|
|
ref ? "" : (active ? radioTrue : radioFalse),
|
2008-06-23 08:37:12 +00:00
|
|
|
// Link that hides or shows the group
|
2010-05-09 18:25:23 +00:00
|
|
|
afterActive ? " - " : "",
|
|
|
|
g->h.v, (&TextWindow::ScreenToggleGroupShown),
|
|
|
|
afterActive ? "" : (shown ? checkTrue : checkFalse),
|
2018-07-12 05:05:43 +00:00
|
|
|
// Link to the errors, if a problem occurred while solving
|
2017-09-13 09:39:27 +00:00
|
|
|
ok ? (dof > 0 ? 'i' : 's') : 'x', g->h.v, (&TextWindow::ScreenHowGroupSolved),
|
|
|
|
ok ? sdof : "",
|
|
|
|
ok ? "" : "ERR",
|
2008-06-23 08:37:12 +00:00
|
|
|
// Link to a screen that gives more details on the group
|
2015-11-06 08:40:12 +00:00
|
|
|
g->h.v, (&TextWindow::ScreenSelectGroup), s.c_str());
|
2008-06-23 08:37:12 +00:00
|
|
|
|
|
|
|
if(active) afterActive = true;
|
|
|
|
}
|
|
|
|
|
|
|
|
Printf(true, " %Fl%Ls%fshow all%E / %Fl%Lh%fhide all%E",
|
|
|
|
&(TextWindow::ScreenShowGroupsSpecial),
|
|
|
|
&(TextWindow::ScreenShowGroupsSpecial));
|
2010-01-04 00:35:28 +00:00
|
|
|
Printf(true, " %Fl%Ls%fline styles%E /"
|
|
|
|
" %Fl%Ls%fview%E /"
|
|
|
|
" %Fl%Ls%fconfiguration%E",
|
2009-09-18 08:14:15 +00:00
|
|
|
&(TextWindow::ScreenShowListOfStyles),
|
2010-01-04 00:35:28 +00:00
|
|
|
&(TextWindow::ScreenShowEditView),
|
2008-06-23 08:37:12 +00:00
|
|
|
&(TextWindow::ScreenShowConfiguration));
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
//-----------------------------------------------------------------------------
|
|
|
|
// The screen that shows information about a specific group, and allows the
|
|
|
|
// user to edit various things about it.
|
|
|
|
//-----------------------------------------------------------------------------
|
Use C99 integer types and C++ boolean types/values
This change comprehensively replaces the use of Microsoft-standard integer
and boolean types with their C99/C++ standard equivalents, as the latter is
more appropriate for a cross-platform application. With matter-of-course
exceptions in the Win32-specific code, the types/values have been converted
as follows:
QWORD --> uint64_t
SQWORD --> int64_t
DWORD --> uint32_t
SDWORD --> int32_t
WORD --> uint16_t
SWORD --> int16_t
BYTE --> uint8_t
BOOL --> bool
TRUE --> true
FALSE --> false
The following related changes are also included:
* Added C99 integer type definitions for Windows, as stdint.h is not
available prior to Visual Studio 2010
* Changed types of some variables in the SolveSpace class from 'int' to
'bool', as they actually represent boolean settings
* Implemented new Cnf{Freeze,Thaw}Bool() functions to support boolean
variables in the Registry
* Cnf{Freeze,Thaw}DWORD() are now Cnf{Freeze,Thaw}Int()
* TtfFont::Get{WORD,DWORD}() are now TtfFont::Get{USHORT,ULONG}() (names
inspired by the OpenType spec)
* RGB colors are packed into an integer of type uint32_t (nee DWORD), but
in a few places, these were represented by an int; these have been
corrected to uint32_t
2013-10-02 05:45:13 +00:00
|
|
|
void TextWindow::ScreenHoverConstraint(int link, uint32_t v) {
|
2008-06-23 08:37:12 +00:00
|
|
|
if(!SS.GW.showConstraints) return;
|
|
|
|
|
|
|
|
hConstraint hc = { v };
|
|
|
|
SS.GW.hover.Clear();
|
|
|
|
SS.GW.hover.constraint = hc;
|
|
|
|
SS.GW.hover.emphasized = true;
|
|
|
|
}
|
Use C99 integer types and C++ boolean types/values
This change comprehensively replaces the use of Microsoft-standard integer
and boolean types with their C99/C++ standard equivalents, as the latter is
more appropriate for a cross-platform application. With matter-of-course
exceptions in the Win32-specific code, the types/values have been converted
as follows:
QWORD --> uint64_t
SQWORD --> int64_t
DWORD --> uint32_t
SDWORD --> int32_t
WORD --> uint16_t
SWORD --> int16_t
BYTE --> uint8_t
BOOL --> bool
TRUE --> true
FALSE --> false
The following related changes are also included:
* Added C99 integer type definitions for Windows, as stdint.h is not
available prior to Visual Studio 2010
* Changed types of some variables in the SolveSpace class from 'int' to
'bool', as they actually represent boolean settings
* Implemented new Cnf{Freeze,Thaw}Bool() functions to support boolean
variables in the Registry
* Cnf{Freeze,Thaw}DWORD() are now Cnf{Freeze,Thaw}Int()
* TtfFont::Get{WORD,DWORD}() are now TtfFont::Get{USHORT,ULONG}() (names
inspired by the OpenType spec)
* RGB colors are packed into an integer of type uint32_t (nee DWORD), but
in a few places, these were represented by an int; these have been
corrected to uint32_t
2013-10-02 05:45:13 +00:00
|
|
|
void TextWindow::ScreenHoverRequest(int link, uint32_t v) {
|
2008-06-23 08:37:12 +00:00
|
|
|
SS.GW.hover.Clear();
|
|
|
|
hRequest hr = { v };
|
|
|
|
SS.GW.hover.entity = hr.entity(0);
|
|
|
|
SS.GW.hover.emphasized = true;
|
|
|
|
}
|
Use C99 integer types and C++ boolean types/values
This change comprehensively replaces the use of Microsoft-standard integer
and boolean types with their C99/C++ standard equivalents, as the latter is
more appropriate for a cross-platform application. With matter-of-course
exceptions in the Win32-specific code, the types/values have been converted
as follows:
QWORD --> uint64_t
SQWORD --> int64_t
DWORD --> uint32_t
SDWORD --> int32_t
WORD --> uint16_t
SWORD --> int16_t
BYTE --> uint8_t
BOOL --> bool
TRUE --> true
FALSE --> false
The following related changes are also included:
* Added C99 integer type definitions for Windows, as stdint.h is not
available prior to Visual Studio 2010
* Changed types of some variables in the SolveSpace class from 'int' to
'bool', as they actually represent boolean settings
* Implemented new Cnf{Freeze,Thaw}Bool() functions to support boolean
variables in the Registry
* Cnf{Freeze,Thaw}DWORD() are now Cnf{Freeze,Thaw}Int()
* TtfFont::Get{WORD,DWORD}() are now TtfFont::Get{USHORT,ULONG}() (names
inspired by the OpenType spec)
* RGB colors are packed into an integer of type uint32_t (nee DWORD), but
in a few places, these were represented by an int; these have been
corrected to uint32_t
2013-10-02 05:45:13 +00:00
|
|
|
void TextWindow::ScreenSelectConstraint(int link, uint32_t v) {
|
2008-06-23 08:37:12 +00:00
|
|
|
SS.GW.ClearSelection();
|
2015-03-27 15:31:23 +00:00
|
|
|
GraphicsWindow::Selection sel = {};
|
2009-11-03 18:54:49 +00:00
|
|
|
sel.constraint.v = v;
|
|
|
|
SS.GW.selection.Add(&sel);
|
2008-06-23 08:37:12 +00:00
|
|
|
}
|
Use C99 integer types and C++ boolean types/values
This change comprehensively replaces the use of Microsoft-standard integer
and boolean types with their C99/C++ standard equivalents, as the latter is
more appropriate for a cross-platform application. With matter-of-course
exceptions in the Win32-specific code, the types/values have been converted
as follows:
QWORD --> uint64_t
SQWORD --> int64_t
DWORD --> uint32_t
SDWORD --> int32_t
WORD --> uint16_t
SWORD --> int16_t
BYTE --> uint8_t
BOOL --> bool
TRUE --> true
FALSE --> false
The following related changes are also included:
* Added C99 integer type definitions for Windows, as stdint.h is not
available prior to Visual Studio 2010
* Changed types of some variables in the SolveSpace class from 'int' to
'bool', as they actually represent boolean settings
* Implemented new Cnf{Freeze,Thaw}Bool() functions to support boolean
variables in the Registry
* Cnf{Freeze,Thaw}DWORD() are now Cnf{Freeze,Thaw}Int()
* TtfFont::Get{WORD,DWORD}() are now TtfFont::Get{USHORT,ULONG}() (names
inspired by the OpenType spec)
* RGB colors are packed into an integer of type uint32_t (nee DWORD), but
in a few places, these were represented by an int; these have been
corrected to uint32_t
2013-10-02 05:45:13 +00:00
|
|
|
void TextWindow::ScreenSelectRequest(int link, uint32_t v) {
|
2008-06-23 08:37:12 +00:00
|
|
|
SS.GW.ClearSelection();
|
2015-03-27 15:31:23 +00:00
|
|
|
GraphicsWindow::Selection sel = {};
|
2009-11-03 18:54:49 +00:00
|
|
|
hRequest hr = { v };
|
|
|
|
sel.entity = hr.entity(0);
|
|
|
|
SS.GW.selection.Add(&sel);
|
2008-06-23 08:37:12 +00:00
|
|
|
}
|
|
|
|
|
Use C99 integer types and C++ boolean types/values
This change comprehensively replaces the use of Microsoft-standard integer
and boolean types with their C99/C++ standard equivalents, as the latter is
more appropriate for a cross-platform application. With matter-of-course
exceptions in the Win32-specific code, the types/values have been converted
as follows:
QWORD --> uint64_t
SQWORD --> int64_t
DWORD --> uint32_t
SDWORD --> int32_t
WORD --> uint16_t
SWORD --> int16_t
BYTE --> uint8_t
BOOL --> bool
TRUE --> true
FALSE --> false
The following related changes are also included:
* Added C99 integer type definitions for Windows, as stdint.h is not
available prior to Visual Studio 2010
* Changed types of some variables in the SolveSpace class from 'int' to
'bool', as they actually represent boolean settings
* Implemented new Cnf{Freeze,Thaw}Bool() functions to support boolean
variables in the Registry
* Cnf{Freeze,Thaw}DWORD() are now Cnf{Freeze,Thaw}Int()
* TtfFont::Get{WORD,DWORD}() are now TtfFont::Get{USHORT,ULONG}() (names
inspired by the OpenType spec)
* RGB colors are packed into an integer of type uint32_t (nee DWORD), but
in a few places, these were represented by an int; these have been
corrected to uint32_t
2013-10-02 05:45:13 +00:00
|
|
|
void TextWindow::ScreenChangeGroupOption(int link, uint32_t v) {
|
2008-06-23 08:37:12 +00:00
|
|
|
SS.UndoRemember();
|
2009-04-19 05:53:16 +00:00
|
|
|
Group *g = SK.GetGroup(SS.TW.shown.group);
|
2008-06-23 08:37:12 +00:00
|
|
|
|
2009-10-09 12:57:10 +00:00
|
|
|
switch(link) {
|
Convert all enumerations to use `enum class`.
Specifically, take the old code that looks like this:
class Foo {
enum { X = 1, Y = 2 };
int kind;
}
... foo.kind = Foo::X; ...
and convert it to this:
class Foo {
enum class Kind : uint32_t { X = 1, Y = 2 };
Kind kind;
}
... foo.kind = Foo::Kind::X;
(In some cases the enumeration would not be in the class namespace,
such as when it is generally useful.)
The benefits are as follows:
* The type of the field gives a clear indication of intent, both
to humans and tools (such as binding generators).
* The compiler is able to automatically warn when a switch is not
exhaustive; but this is currently suppressed by the
default: ssassert(false, ...)
idiom.
* Integers and plain enums are weakly type checked: they implicitly
convert into each other. This can hide bugs where type conversion
is performed but not intended. Enum classes are strongly type
checked.
* Plain enums pollute parent namespaces; enum classes do not.
Almost every defined enum we have already has a kind of ad-hoc
namespacing via `NAMESPACE_`, which is now explicit.
* Plain enums do not have a well-defined ABI size, which is
important for bindings. Enum classes can have it, if specified.
We specify the base type for all enums as uint32_t, which is
a safe choice and allows us to not change the numeric values
of any variants.
This commit introduces absolutely no functional change to the code,
just renaming and change of types. It handles almost all cases,
except GraphicsWindow::pending.operation, which needs minor
functional change.
2016-05-20 08:31:20 +00:00
|
|
|
case 's': g->subtype = Group::Subtype::ONE_SIDED; break;
|
|
|
|
case 'S': g->subtype = Group::Subtype::TWO_SIDED; break;
|
2009-05-22 10:02:02 +00:00
|
|
|
|
2010-05-09 18:25:23 +00:00
|
|
|
case 'k': g->skipFirst = true; break;
|
|
|
|
case 'K': g->skipFirst = false; break;
|
2009-10-09 12:57:10 +00:00
|
|
|
|
2016-05-04 10:18:13 +00:00
|
|
|
case 'c':
|
2017-04-16 02:12:31 +00:00
|
|
|
if(g->type == Group::Type::EXTRUDE) {
|
|
|
|
// When an extrude group is first created, it's positioned for a union
|
|
|
|
// extrusion. If no constraints were added, flip it when we switch between
|
2018-07-12 05:05:43 +00:00
|
|
|
// union and difference modes to avoid manual work doing the same.
|
2017-04-16 02:12:31 +00:00
|
|
|
if(g->meshCombine != (Group::CombineAs)v && g->GetNumConstraints() == 0 &&
|
|
|
|
((Group::CombineAs)v == Group::CombineAs::DIFFERENCE ||
|
|
|
|
g->meshCombine == Group::CombineAs::DIFFERENCE)) {
|
|
|
|
g->ExtrusionForceVectorTo(g->ExtrusionGetVector().Negated());
|
|
|
|
}
|
2016-05-04 10:18:13 +00:00
|
|
|
}
|
Convert all enumerations to use `enum class`.
Specifically, take the old code that looks like this:
class Foo {
enum { X = 1, Y = 2 };
int kind;
}
... foo.kind = Foo::X; ...
and convert it to this:
class Foo {
enum class Kind : uint32_t { X = 1, Y = 2 };
Kind kind;
}
... foo.kind = Foo::Kind::X;
(In some cases the enumeration would not be in the class namespace,
such as when it is generally useful.)
The benefits are as follows:
* The type of the field gives a clear indication of intent, both
to humans and tools (such as binding generators).
* The compiler is able to automatically warn when a switch is not
exhaustive; but this is currently suppressed by the
default: ssassert(false, ...)
idiom.
* Integers and plain enums are weakly type checked: they implicitly
convert into each other. This can hide bugs where type conversion
is performed but not intended. Enum classes are strongly type
checked.
* Plain enums pollute parent namespaces; enum classes do not.
Almost every defined enum we have already has a kind of ad-hoc
namespacing via `NAMESPACE_`, which is now explicit.
* Plain enums do not have a well-defined ABI size, which is
important for bindings. Enum classes can have it, if specified.
We specify the base type for all enums as uint32_t, which is
a safe choice and allows us to not change the numeric values
of any variants.
This commit introduces absolutely no functional change to the code,
just renaming and change of types. It handles almost all cases,
except GraphicsWindow::pending.operation, which needs minor
functional change.
2016-05-20 08:31:20 +00:00
|
|
|
g->meshCombine = (Group::CombineAs)v;
|
2016-05-04 10:18:13 +00:00
|
|
|
break;
|
2009-10-09 12:57:10 +00:00
|
|
|
|
2010-05-09 18:25:23 +00:00
|
|
|
case 'P': g->suppress = !(g->suppress); break;
|
2009-10-09 12:57:10 +00:00
|
|
|
|
2010-05-09 18:25:23 +00:00
|
|
|
case 'r': g->relaxConstraints = !(g->relaxConstraints); break;
|
2009-10-09 12:57:10 +00:00
|
|
|
|
2016-01-21 15:01:43 +00:00
|
|
|
case 'e': g->allowRedundant = !(g->allowRedundant); break;
|
|
|
|
|
2010-05-12 04:57:41 +00:00
|
|
|
case 'v': g->visible = !(g->visible); break;
|
|
|
|
|
2010-05-10 01:06:09 +00:00
|
|
|
case 'd': g->allDimsReference = !(g->allDimsReference); break;
|
|
|
|
|
2010-05-09 18:25:23 +00:00
|
|
|
case 'f': g->forceToMesh = !(g->forceToMesh); break;
|
2009-10-09 12:57:10 +00:00
|
|
|
}
|
2008-02-15 11:35:15 +00:00
|
|
|
|
|
|
|
SS.MarkGroupDirty(g->h);
|
|
|
|
SS.GW.ClearSuper();
|
|
|
|
}
|
2009-10-01 11:22:56 +00:00
|
|
|
|
Use C99 integer types and C++ boolean types/values
This change comprehensively replaces the use of Microsoft-standard integer
and boolean types with their C99/C++ standard equivalents, as the latter is
more appropriate for a cross-platform application. With matter-of-course
exceptions in the Win32-specific code, the types/values have been converted
as follows:
QWORD --> uint64_t
SQWORD --> int64_t
DWORD --> uint32_t
SDWORD --> int32_t
WORD --> uint16_t
SWORD --> int16_t
BYTE --> uint8_t
BOOL --> bool
TRUE --> true
FALSE --> false
The following related changes are also included:
* Added C99 integer type definitions for Windows, as stdint.h is not
available prior to Visual Studio 2010
* Changed types of some variables in the SolveSpace class from 'int' to
'bool', as they actually represent boolean settings
* Implemented new Cnf{Freeze,Thaw}Bool() functions to support boolean
variables in the Registry
* Cnf{Freeze,Thaw}DWORD() are now Cnf{Freeze,Thaw}Int()
* TtfFont::Get{WORD,DWORD}() are now TtfFont::Get{USHORT,ULONG}() (names
inspired by the OpenType spec)
* RGB colors are packed into an integer of type uint32_t (nee DWORD), but
in a few places, these were represented by an int; these have been
corrected to uint32_t
2013-10-02 05:45:13 +00:00
|
|
|
void TextWindow::ScreenColor(int link, uint32_t v) {
|
2008-06-23 08:37:12 +00:00
|
|
|
SS.UndoRemember();
|
|
|
|
|
2009-04-19 05:53:16 +00:00
|
|
|
Group *g = SK.GetGroup(SS.TW.shown.group);
|
2016-01-26 11:19:52 +00:00
|
|
|
SS.TW.ShowEditControlWithColorPicker(3, g->color);
|
Convert all enumerations to use `enum class`.
Specifically, take the old code that looks like this:
class Foo {
enum { X = 1, Y = 2 };
int kind;
}
... foo.kind = Foo::X; ...
and convert it to this:
class Foo {
enum class Kind : uint32_t { X = 1, Y = 2 };
Kind kind;
}
... foo.kind = Foo::Kind::X;
(In some cases the enumeration would not be in the class namespace,
such as when it is generally useful.)
The benefits are as follows:
* The type of the field gives a clear indication of intent, both
to humans and tools (such as binding generators).
* The compiler is able to automatically warn when a switch is not
exhaustive; but this is currently suppressed by the
default: ssassert(false, ...)
idiom.
* Integers and plain enums are weakly type checked: they implicitly
convert into each other. This can hide bugs where type conversion
is performed but not intended. Enum classes are strongly type
checked.
* Plain enums pollute parent namespaces; enum classes do not.
Almost every defined enum we have already has a kind of ad-hoc
namespacing via `NAMESPACE_`, which is now explicit.
* Plain enums do not have a well-defined ABI size, which is
important for bindings. Enum classes can have it, if specified.
We specify the base type for all enums as uint32_t, which is
a safe choice and allows us to not change the numeric values
of any variants.
This commit introduces absolutely no functional change to the code,
just renaming and change of types. It handles almost all cases,
except GraphicsWindow::pending.operation, which needs minor
functional change.
2016-05-20 08:31:20 +00:00
|
|
|
SS.TW.edit.meaning = Edit::GROUP_COLOR;
|
2008-06-23 08:37:12 +00:00
|
|
|
}
|
2015-03-26 10:30:12 +00:00
|
|
|
void TextWindow::ScreenOpacity(int link, uint32_t v) {
|
|
|
|
Group *g = SK.GetGroup(SS.TW.shown.group);
|
|
|
|
|
2016-01-26 11:19:52 +00:00
|
|
|
SS.TW.ShowEditControl(11, ssprintf("%.2f", g->color.alphaF()));
|
Convert all enumerations to use `enum class`.
Specifically, take the old code that looks like this:
class Foo {
enum { X = 1, Y = 2 };
int kind;
}
... foo.kind = Foo::X; ...
and convert it to this:
class Foo {
enum class Kind : uint32_t { X = 1, Y = 2 };
Kind kind;
}
... foo.kind = Foo::Kind::X;
(In some cases the enumeration would not be in the class namespace,
such as when it is generally useful.)
The benefits are as follows:
* The type of the field gives a clear indication of intent, both
to humans and tools (such as binding generators).
* The compiler is able to automatically warn when a switch is not
exhaustive; but this is currently suppressed by the
default: ssassert(false, ...)
idiom.
* Integers and plain enums are weakly type checked: they implicitly
convert into each other. This can hide bugs where type conversion
is performed but not intended. Enum classes are strongly type
checked.
* Plain enums pollute parent namespaces; enum classes do not.
Almost every defined enum we have already has a kind of ad-hoc
namespacing via `NAMESPACE_`, which is now explicit.
* Plain enums do not have a well-defined ABI size, which is
important for bindings. Enum classes can have it, if specified.
We specify the base type for all enums as uint32_t, which is
a safe choice and allows us to not change the numeric values
of any variants.
This commit introduces absolutely no functional change to the code,
just renaming and change of types. It handles almost all cases,
except GraphicsWindow::pending.operation, which needs minor
functional change.
2016-05-20 08:31:20 +00:00
|
|
|
SS.TW.edit.meaning = Edit::GROUP_OPACITY;
|
2015-03-26 10:30:12 +00:00
|
|
|
SS.TW.edit.group.v = g->h.v;
|
|
|
|
}
|
Use C99 integer types and C++ boolean types/values
This change comprehensively replaces the use of Microsoft-standard integer
and boolean types with their C99/C++ standard equivalents, as the latter is
more appropriate for a cross-platform application. With matter-of-course
exceptions in the Win32-specific code, the types/values have been converted
as follows:
QWORD --> uint64_t
SQWORD --> int64_t
DWORD --> uint32_t
SDWORD --> int32_t
WORD --> uint16_t
SWORD --> int16_t
BYTE --> uint8_t
BOOL --> bool
TRUE --> true
FALSE --> false
The following related changes are also included:
* Added C99 integer type definitions for Windows, as stdint.h is not
available prior to Visual Studio 2010
* Changed types of some variables in the SolveSpace class from 'int' to
'bool', as they actually represent boolean settings
* Implemented new Cnf{Freeze,Thaw}Bool() functions to support boolean
variables in the Registry
* Cnf{Freeze,Thaw}DWORD() are now Cnf{Freeze,Thaw}Int()
* TtfFont::Get{WORD,DWORD}() are now TtfFont::Get{USHORT,ULONG}() (names
inspired by the OpenType spec)
* RGB colors are packed into an integer of type uint32_t (nee DWORD), but
in a few places, these were represented by an int; these have been
corrected to uint32_t
2013-10-02 05:45:13 +00:00
|
|
|
void TextWindow::ScreenChangeExprA(int link, uint32_t v) {
|
2009-04-19 05:53:16 +00:00
|
|
|
Group *g = SK.GetGroup(SS.TW.shown.group);
|
2008-06-23 08:37:12 +00:00
|
|
|
|
2016-01-26 11:19:52 +00:00
|
|
|
SS.TW.ShowEditControl(10, ssprintf("%d", (int)g->valA));
|
Convert all enumerations to use `enum class`.
Specifically, take the old code that looks like this:
class Foo {
enum { X = 1, Y = 2 };
int kind;
}
... foo.kind = Foo::X; ...
and convert it to this:
class Foo {
enum class Kind : uint32_t { X = 1, Y = 2 };
Kind kind;
}
... foo.kind = Foo::Kind::X;
(In some cases the enumeration would not be in the class namespace,
such as when it is generally useful.)
The benefits are as follows:
* The type of the field gives a clear indication of intent, both
to humans and tools (such as binding generators).
* The compiler is able to automatically warn when a switch is not
exhaustive; but this is currently suppressed by the
default: ssassert(false, ...)
idiom.
* Integers and plain enums are weakly type checked: they implicitly
convert into each other. This can hide bugs where type conversion
is performed but not intended. Enum classes are strongly type
checked.
* Plain enums pollute parent namespaces; enum classes do not.
Almost every defined enum we have already has a kind of ad-hoc
namespacing via `NAMESPACE_`, which is now explicit.
* Plain enums do not have a well-defined ABI size, which is
important for bindings. Enum classes can have it, if specified.
We specify the base type for all enums as uint32_t, which is
a safe choice and allows us to not change the numeric values
of any variants.
This commit introduces absolutely no functional change to the code,
just renaming and change of types. It handles almost all cases,
except GraphicsWindow::pending.operation, which needs minor
functional change.
2016-05-20 08:31:20 +00:00
|
|
|
SS.TW.edit.meaning = Edit::TIMES_REPEATED;
|
2008-06-23 08:37:12 +00:00
|
|
|
SS.TW.edit.group.v = v;
|
|
|
|
}
|
Use C99 integer types and C++ boolean types/values
This change comprehensively replaces the use of Microsoft-standard integer
and boolean types with their C99/C++ standard equivalents, as the latter is
more appropriate for a cross-platform application. With matter-of-course
exceptions in the Win32-specific code, the types/values have been converted
as follows:
QWORD --> uint64_t
SQWORD --> int64_t
DWORD --> uint32_t
SDWORD --> int32_t
WORD --> uint16_t
SWORD --> int16_t
BYTE --> uint8_t
BOOL --> bool
TRUE --> true
FALSE --> false
The following related changes are also included:
* Added C99 integer type definitions for Windows, as stdint.h is not
available prior to Visual Studio 2010
* Changed types of some variables in the SolveSpace class from 'int' to
'bool', as they actually represent boolean settings
* Implemented new Cnf{Freeze,Thaw}Bool() functions to support boolean
variables in the Registry
* Cnf{Freeze,Thaw}DWORD() are now Cnf{Freeze,Thaw}Int()
* TtfFont::Get{WORD,DWORD}() are now TtfFont::Get{USHORT,ULONG}() (names
inspired by the OpenType spec)
* RGB colors are packed into an integer of type uint32_t (nee DWORD), but
in a few places, these were represented by an int; these have been
corrected to uint32_t
2013-10-02 05:45:13 +00:00
|
|
|
void TextWindow::ScreenChangeGroupName(int link, uint32_t v) {
|
2009-04-19 05:53:16 +00:00
|
|
|
Group *g = SK.GetGroup(SS.TW.shown.group);
|
2016-01-26 11:19:52 +00:00
|
|
|
SS.TW.ShowEditControl(12, g->DescriptionString().substr(5));
|
Convert all enumerations to use `enum class`.
Specifically, take the old code that looks like this:
class Foo {
enum { X = 1, Y = 2 };
int kind;
}
... foo.kind = Foo::X; ...
and convert it to this:
class Foo {
enum class Kind : uint32_t { X = 1, Y = 2 };
Kind kind;
}
... foo.kind = Foo::Kind::X;
(In some cases the enumeration would not be in the class namespace,
such as when it is generally useful.)
The benefits are as follows:
* The type of the field gives a clear indication of intent, both
to humans and tools (such as binding generators).
* The compiler is able to automatically warn when a switch is not
exhaustive; but this is currently suppressed by the
default: ssassert(false, ...)
idiom.
* Integers and plain enums are weakly type checked: they implicitly
convert into each other. This can hide bugs where type conversion
is performed but not intended. Enum classes are strongly type
checked.
* Plain enums pollute parent namespaces; enum classes do not.
Almost every defined enum we have already has a kind of ad-hoc
namespacing via `NAMESPACE_`, which is now explicit.
* Plain enums do not have a well-defined ABI size, which is
important for bindings. Enum classes can have it, if specified.
We specify the base type for all enums as uint32_t, which is
a safe choice and allows us to not change the numeric values
of any variants.
This commit introduces absolutely no functional change to the code,
just renaming and change of types. It handles almost all cases,
except GraphicsWindow::pending.operation, which needs minor
functional change.
2016-05-20 08:31:20 +00:00
|
|
|
SS.TW.edit.meaning = Edit::GROUP_NAME;
|
2008-06-23 08:37:12 +00:00
|
|
|
SS.TW.edit.group.v = v;
|
|
|
|
}
|
Use C99 integer types and C++ boolean types/values
This change comprehensively replaces the use of Microsoft-standard integer
and boolean types with their C99/C++ standard equivalents, as the latter is
more appropriate for a cross-platform application. With matter-of-course
exceptions in the Win32-specific code, the types/values have been converted
as follows:
QWORD --> uint64_t
SQWORD --> int64_t
DWORD --> uint32_t
SDWORD --> int32_t
WORD --> uint16_t
SWORD --> int16_t
BYTE --> uint8_t
BOOL --> bool
TRUE --> true
FALSE --> false
The following related changes are also included:
* Added C99 integer type definitions for Windows, as stdint.h is not
available prior to Visual Studio 2010
* Changed types of some variables in the SolveSpace class from 'int' to
'bool', as they actually represent boolean settings
* Implemented new Cnf{Freeze,Thaw}Bool() functions to support boolean
variables in the Registry
* Cnf{Freeze,Thaw}DWORD() are now Cnf{Freeze,Thaw}Int()
* TtfFont::Get{WORD,DWORD}() are now TtfFont::Get{USHORT,ULONG}() (names
inspired by the OpenType spec)
* RGB colors are packed into an integer of type uint32_t (nee DWORD), but
in a few places, these were represented by an int; these have been
corrected to uint32_t
2013-10-02 05:45:13 +00:00
|
|
|
void TextWindow::ScreenChangeGroupScale(int link, uint32_t v) {
|
2009-12-15 12:26:22 +00:00
|
|
|
Group *g = SK.GetGroup(SS.TW.shown.group);
|
|
|
|
|
2016-01-26 11:19:52 +00:00
|
|
|
SS.TW.ShowEditControl(13, ssprintf("%.3f", g->scale));
|
Convert all enumerations to use `enum class`.
Specifically, take the old code that looks like this:
class Foo {
enum { X = 1, Y = 2 };
int kind;
}
... foo.kind = Foo::X; ...
and convert it to this:
class Foo {
enum class Kind : uint32_t { X = 1, Y = 2 };
Kind kind;
}
... foo.kind = Foo::Kind::X;
(In some cases the enumeration would not be in the class namespace,
such as when it is generally useful.)
The benefits are as follows:
* The type of the field gives a clear indication of intent, both
to humans and tools (such as binding generators).
* The compiler is able to automatically warn when a switch is not
exhaustive; but this is currently suppressed by the
default: ssassert(false, ...)
idiom.
* Integers and plain enums are weakly type checked: they implicitly
convert into each other. This can hide bugs where type conversion
is performed but not intended. Enum classes are strongly type
checked.
* Plain enums pollute parent namespaces; enum classes do not.
Almost every defined enum we have already has a kind of ad-hoc
namespacing via `NAMESPACE_`, which is now explicit.
* Plain enums do not have a well-defined ABI size, which is
important for bindings. Enum classes can have it, if specified.
We specify the base type for all enums as uint32_t, which is
a safe choice and allows us to not change the numeric values
of any variants.
This commit introduces absolutely no functional change to the code,
just renaming and change of types. It handles almost all cases,
except GraphicsWindow::pending.operation, which needs minor
functional change.
2016-05-20 08:31:20 +00:00
|
|
|
SS.TW.edit.meaning = Edit::GROUP_SCALE;
|
2009-12-15 12:26:22 +00:00
|
|
|
SS.TW.edit.group.v = v;
|
|
|
|
}
|
Use C99 integer types and C++ boolean types/values
This change comprehensively replaces the use of Microsoft-standard integer
and boolean types with their C99/C++ standard equivalents, as the latter is
more appropriate for a cross-platform application. With matter-of-course
exceptions in the Win32-specific code, the types/values have been converted
as follows:
QWORD --> uint64_t
SQWORD --> int64_t
DWORD --> uint32_t
SDWORD --> int32_t
WORD --> uint16_t
SWORD --> int16_t
BYTE --> uint8_t
BOOL --> bool
TRUE --> true
FALSE --> false
The following related changes are also included:
* Added C99 integer type definitions for Windows, as stdint.h is not
available prior to Visual Studio 2010
* Changed types of some variables in the SolveSpace class from 'int' to
'bool', as they actually represent boolean settings
* Implemented new Cnf{Freeze,Thaw}Bool() functions to support boolean
variables in the Registry
* Cnf{Freeze,Thaw}DWORD() are now Cnf{Freeze,Thaw}Int()
* TtfFont::Get{WORD,DWORD}() are now TtfFont::Get{USHORT,ULONG}() (names
inspired by the OpenType spec)
* RGB colors are packed into an integer of type uint32_t (nee DWORD), but
in a few places, these were represented by an int; these have been
corrected to uint32_t
2013-10-02 05:45:13 +00:00
|
|
|
void TextWindow::ScreenDeleteGroup(int link, uint32_t v) {
|
2008-06-23 08:37:12 +00:00
|
|
|
SS.UndoRemember();
|
|
|
|
|
2008-07-10 06:11:56 +00:00
|
|
|
hGroup hg = SS.TW.shown.group;
|
2008-06-23 08:37:12 +00:00
|
|
|
if(hg.v == SS.GW.activeGroup.v) {
|
2016-02-18 11:11:59 +00:00
|
|
|
SS.GW.activeGroup = SK.GetGroup(SS.GW.activeGroup)->PreviousGroup()->h;
|
2008-06-23 08:37:12 +00:00
|
|
|
}
|
2016-02-18 11:11:59 +00:00
|
|
|
|
|
|
|
// Reset the text window, since we're displaying information about
|
|
|
|
// the group that's about to get deleted.
|
2008-06-23 08:37:12 +00:00
|
|
|
SS.TW.ClearSuper();
|
2016-02-18 11:11:59 +00:00
|
|
|
|
|
|
|
// This is a major change, so let's re-solve everything.
|
|
|
|
SK.group.RemoveById(hg);
|
Convert all enumerations to use `enum class`.
Specifically, take the old code that looks like this:
class Foo {
enum { X = 1, Y = 2 };
int kind;
}
... foo.kind = Foo::X; ...
and convert it to this:
class Foo {
enum class Kind : uint32_t { X = 1, Y = 2 };
Kind kind;
}
... foo.kind = Foo::Kind::X;
(In some cases the enumeration would not be in the class namespace,
such as when it is generally useful.)
The benefits are as follows:
* The type of the field gives a clear indication of intent, both
to humans and tools (such as binding generators).
* The compiler is able to automatically warn when a switch is not
exhaustive; but this is currently suppressed by the
default: ssassert(false, ...)
idiom.
* Integers and plain enums are weakly type checked: they implicitly
convert into each other. This can hide bugs where type conversion
is performed but not intended. Enum classes are strongly type
checked.
* Plain enums pollute parent namespaces; enum classes do not.
Almost every defined enum we have already has a kind of ad-hoc
namespacing via `NAMESPACE_`, which is now explicit.
* Plain enums do not have a well-defined ABI size, which is
important for bindings. Enum classes can have it, if specified.
We specify the base type for all enums as uint32_t, which is
a safe choice and allows us to not change the numeric values
of any variants.
This commit introduces absolutely no functional change to the code,
just renaming and change of types. It handles almost all cases,
except GraphicsWindow::pending.operation, which needs minor
functional change.
2016-05-20 08:31:20 +00:00
|
|
|
SS.GenerateAll(SolveSpaceUI::Generate::ALL);
|
2016-02-18 11:11:59 +00:00
|
|
|
|
|
|
|
// Reset the graphics window. This will also recreate the default
|
|
|
|
// group if it was removed.
|
|
|
|
SS.GW.ClearSuper();
|
2008-06-23 08:37:12 +00:00
|
|
|
}
|
2016-05-05 05:54:05 +00:00
|
|
|
void TextWindow::ShowGroupInfo() {
|
2016-02-17 10:03:07 +00:00
|
|
|
Group *g = SK.GetGroup(shown.group);
|
2013-08-26 18:58:35 +00:00
|
|
|
const char *s = "???";
|
2008-06-23 08:37:12 +00:00
|
|
|
|
2008-07-10 06:11:56 +00:00
|
|
|
if(shown.group.v == Group::HGROUP_REFERENCES.v) {
|
2015-11-06 08:40:12 +00:00
|
|
|
Printf(true, "%FtGROUP %E%s", g->DescriptionString().c_str());
|
2010-05-09 18:25:23 +00:00
|
|
|
goto list_items;
|
2008-06-23 08:37:12 +00:00
|
|
|
} else {
|
2010-05-09 18:25:23 +00:00
|
|
|
Printf(true, "%FtGROUP %E%s [%Fl%Ll%D%frename%E/%Fl%Ll%D%fdel%E]",
|
2015-11-06 08:40:12 +00:00
|
|
|
g->DescriptionString().c_str(),
|
2008-06-23 08:37:12 +00:00
|
|
|
g->h.v, &TextWindow::ScreenChangeGroupName,
|
|
|
|
g->h.v, &TextWindow::ScreenDeleteGroup);
|
|
|
|
}
|
|
|
|
|
Convert all enumerations to use `enum class`.
Specifically, take the old code that looks like this:
class Foo {
enum { X = 1, Y = 2 };
int kind;
}
... foo.kind = Foo::X; ...
and convert it to this:
class Foo {
enum class Kind : uint32_t { X = 1, Y = 2 };
Kind kind;
}
... foo.kind = Foo::Kind::X;
(In some cases the enumeration would not be in the class namespace,
such as when it is generally useful.)
The benefits are as follows:
* The type of the field gives a clear indication of intent, both
to humans and tools (such as binding generators).
* The compiler is able to automatically warn when a switch is not
exhaustive; but this is currently suppressed by the
default: ssassert(false, ...)
idiom.
* Integers and plain enums are weakly type checked: they implicitly
convert into each other. This can hide bugs where type conversion
is performed but not intended. Enum classes are strongly type
checked.
* Plain enums pollute parent namespaces; enum classes do not.
Almost every defined enum we have already has a kind of ad-hoc
namespacing via `NAMESPACE_`, which is now explicit.
* Plain enums do not have a well-defined ABI size, which is
important for bindings. Enum classes can have it, if specified.
We specify the base type for all enums as uint32_t, which is
a safe choice and allows us to not change the numeric values
of any variants.
This commit introduces absolutely no functional change to the code,
just renaming and change of types. It handles almost all cases,
except GraphicsWindow::pending.operation, which needs minor
functional change.
2016-05-20 08:31:20 +00:00
|
|
|
if(g->type == Group::Type::LATHE) {
|
2010-05-09 18:25:23 +00:00
|
|
|
Printf(true, " %Ftlathe plane sketch");
|
Convert all enumerations to use `enum class`.
Specifically, take the old code that looks like this:
class Foo {
enum { X = 1, Y = 2 };
int kind;
}
... foo.kind = Foo::X; ...
and convert it to this:
class Foo {
enum class Kind : uint32_t { X = 1, Y = 2 };
Kind kind;
}
... foo.kind = Foo::Kind::X;
(In some cases the enumeration would not be in the class namespace,
such as when it is generally useful.)
The benefits are as follows:
* The type of the field gives a clear indication of intent, both
to humans and tools (such as binding generators).
* The compiler is able to automatically warn when a switch is not
exhaustive; but this is currently suppressed by the
default: ssassert(false, ...)
idiom.
* Integers and plain enums are weakly type checked: they implicitly
convert into each other. This can hide bugs where type conversion
is performed but not intended. Enum classes are strongly type
checked.
* Plain enums pollute parent namespaces; enum classes do not.
Almost every defined enum we have already has a kind of ad-hoc
namespacing via `NAMESPACE_`, which is now explicit.
* Plain enums do not have a well-defined ABI size, which is
important for bindings. Enum classes can have it, if specified.
We specify the base type for all enums as uint32_t, which is
a safe choice and allows us to not change the numeric values
of any variants.
This commit introduces absolutely no functional change to the code,
just renaming and change of types. It handles almost all cases,
except GraphicsWindow::pending.operation, which needs minor
functional change.
2016-05-20 08:31:20 +00:00
|
|
|
} else if(g->type == Group::Type::EXTRUDE || g->type == Group::Type::ROTATE ||
|
|
|
|
g->type == Group::Type::TRANSLATE)
|
2008-06-23 08:37:12 +00:00
|
|
|
{
|
Convert all enumerations to use `enum class`.
Specifically, take the old code that looks like this:
class Foo {
enum { X = 1, Y = 2 };
int kind;
}
... foo.kind = Foo::X; ...
and convert it to this:
class Foo {
enum class Kind : uint32_t { X = 1, Y = 2 };
Kind kind;
}
... foo.kind = Foo::Kind::X;
(In some cases the enumeration would not be in the class namespace,
such as when it is generally useful.)
The benefits are as follows:
* The type of the field gives a clear indication of intent, both
to humans and tools (such as binding generators).
* The compiler is able to automatically warn when a switch is not
exhaustive; but this is currently suppressed by the
default: ssassert(false, ...)
idiom.
* Integers and plain enums are weakly type checked: they implicitly
convert into each other. This can hide bugs where type conversion
is performed but not intended. Enum classes are strongly type
checked.
* Plain enums pollute parent namespaces; enum classes do not.
Almost every defined enum we have already has a kind of ad-hoc
namespacing via `NAMESPACE_`, which is now explicit.
* Plain enums do not have a well-defined ABI size, which is
important for bindings. Enum classes can have it, if specified.
We specify the base type for all enums as uint32_t, which is
a safe choice and allows us to not change the numeric values
of any variants.
This commit introduces absolutely no functional change to the code,
just renaming and change of types. It handles almost all cases,
except GraphicsWindow::pending.operation, which needs minor
functional change.
2016-05-20 08:31:20 +00:00
|
|
|
if(g->type == Group::Type::EXTRUDE) {
|
2010-05-09 18:25:23 +00:00
|
|
|
s = "extrude plane sketch";
|
Convert all enumerations to use `enum class`.
Specifically, take the old code that looks like this:
class Foo {
enum { X = 1, Y = 2 };
int kind;
}
... foo.kind = Foo::X; ...
and convert it to this:
class Foo {
enum class Kind : uint32_t { X = 1, Y = 2 };
Kind kind;
}
... foo.kind = Foo::Kind::X;
(In some cases the enumeration would not be in the class namespace,
such as when it is generally useful.)
The benefits are as follows:
* The type of the field gives a clear indication of intent, both
to humans and tools (such as binding generators).
* The compiler is able to automatically warn when a switch is not
exhaustive; but this is currently suppressed by the
default: ssassert(false, ...)
idiom.
* Integers and plain enums are weakly type checked: they implicitly
convert into each other. This can hide bugs where type conversion
is performed but not intended. Enum classes are strongly type
checked.
* Plain enums pollute parent namespaces; enum classes do not.
Almost every defined enum we have already has a kind of ad-hoc
namespacing via `NAMESPACE_`, which is now explicit.
* Plain enums do not have a well-defined ABI size, which is
important for bindings. Enum classes can have it, if specified.
We specify the base type for all enums as uint32_t, which is
a safe choice and allows us to not change the numeric values
of any variants.
This commit introduces absolutely no functional change to the code,
just renaming and change of types. It handles almost all cases,
except GraphicsWindow::pending.operation, which needs minor
functional change.
2016-05-20 08:31:20 +00:00
|
|
|
} else if(g->type == Group::Type::TRANSLATE) {
|
2010-05-09 18:25:23 +00:00
|
|
|
s = "translate original sketch";
|
Convert all enumerations to use `enum class`.
Specifically, take the old code that looks like this:
class Foo {
enum { X = 1, Y = 2 };
int kind;
}
... foo.kind = Foo::X; ...
and convert it to this:
class Foo {
enum class Kind : uint32_t { X = 1, Y = 2 };
Kind kind;
}
... foo.kind = Foo::Kind::X;
(In some cases the enumeration would not be in the class namespace,
such as when it is generally useful.)
The benefits are as follows:
* The type of the field gives a clear indication of intent, both
to humans and tools (such as binding generators).
* The compiler is able to automatically warn when a switch is not
exhaustive; but this is currently suppressed by the
default: ssassert(false, ...)
idiom.
* Integers and plain enums are weakly type checked: they implicitly
convert into each other. This can hide bugs where type conversion
is performed but not intended. Enum classes are strongly type
checked.
* Plain enums pollute parent namespaces; enum classes do not.
Almost every defined enum we have already has a kind of ad-hoc
namespacing via `NAMESPACE_`, which is now explicit.
* Plain enums do not have a well-defined ABI size, which is
important for bindings. Enum classes can have it, if specified.
We specify the base type for all enums as uint32_t, which is
a safe choice and allows us to not change the numeric values
of any variants.
This commit introduces absolutely no functional change to the code,
just renaming and change of types. It handles almost all cases,
except GraphicsWindow::pending.operation, which needs minor
functional change.
2016-05-20 08:31:20 +00:00
|
|
|
} else if(g->type == Group::Type::ROTATE) {
|
2010-05-09 18:25:23 +00:00
|
|
|
s = "rotate original sketch";
|
|
|
|
}
|
|
|
|
Printf(true, " %Ft%s%E", s);
|
|
|
|
|
Convert all enumerations to use `enum class`.
Specifically, take the old code that looks like this:
class Foo {
enum { X = 1, Y = 2 };
int kind;
}
... foo.kind = Foo::X; ...
and convert it to this:
class Foo {
enum class Kind : uint32_t { X = 1, Y = 2 };
Kind kind;
}
... foo.kind = Foo::Kind::X;
(In some cases the enumeration would not be in the class namespace,
such as when it is generally useful.)
The benefits are as follows:
* The type of the field gives a clear indication of intent, both
to humans and tools (such as binding generators).
* The compiler is able to automatically warn when a switch is not
exhaustive; but this is currently suppressed by the
default: ssassert(false, ...)
idiom.
* Integers and plain enums are weakly type checked: they implicitly
convert into each other. This can hide bugs where type conversion
is performed but not intended. Enum classes are strongly type
checked.
* Plain enums pollute parent namespaces; enum classes do not.
Almost every defined enum we have already has a kind of ad-hoc
namespacing via `NAMESPACE_`, which is now explicit.
* Plain enums do not have a well-defined ABI size, which is
important for bindings. Enum classes can have it, if specified.
We specify the base type for all enums as uint32_t, which is
a safe choice and allows us to not change the numeric values
of any variants.
This commit introduces absolutely no functional change to the code,
just renaming and change of types. It handles almost all cases,
except GraphicsWindow::pending.operation, which needs minor
functional change.
2016-05-20 08:31:20 +00:00
|
|
|
bool one = (g->subtype == Group::Subtype::ONE_SIDED);
|
2010-05-09 18:25:23 +00:00
|
|
|
Printf(false,
|
2015-11-05 19:39:27 +00:00
|
|
|
"%Ba %f%Ls%Fd%s one-sided%E "
|
|
|
|
"%f%LS%Fd%s two-sided%E",
|
2009-10-09 12:57:10 +00:00
|
|
|
&TextWindow::ScreenChangeGroupOption,
|
2010-05-09 18:25:23 +00:00
|
|
|
one ? RADIO_TRUE : RADIO_FALSE,
|
2009-10-09 12:57:10 +00:00
|
|
|
&TextWindow::ScreenChangeGroupOption,
|
2010-05-09 18:25:23 +00:00
|
|
|
!one ? RADIO_TRUE : RADIO_FALSE);
|
2008-06-23 08:37:12 +00:00
|
|
|
|
Convert all enumerations to use `enum class`.
Specifically, take the old code that looks like this:
class Foo {
enum { X = 1, Y = 2 };
int kind;
}
... foo.kind = Foo::X; ...
and convert it to this:
class Foo {
enum class Kind : uint32_t { X = 1, Y = 2 };
Kind kind;
}
... foo.kind = Foo::Kind::X;
(In some cases the enumeration would not be in the class namespace,
such as when it is generally useful.)
The benefits are as follows:
* The type of the field gives a clear indication of intent, both
to humans and tools (such as binding generators).
* The compiler is able to automatically warn when a switch is not
exhaustive; but this is currently suppressed by the
default: ssassert(false, ...)
idiom.
* Integers and plain enums are weakly type checked: they implicitly
convert into each other. This can hide bugs where type conversion
is performed but not intended. Enum classes are strongly type
checked.
* Plain enums pollute parent namespaces; enum classes do not.
Almost every defined enum we have already has a kind of ad-hoc
namespacing via `NAMESPACE_`, which is now explicit.
* Plain enums do not have a well-defined ABI size, which is
important for bindings. Enum classes can have it, if specified.
We specify the base type for all enums as uint32_t, which is
a safe choice and allows us to not change the numeric values
of any variants.
This commit introduces absolutely no functional change to the code,
just renaming and change of types. It handles almost all cases,
except GraphicsWindow::pending.operation, which needs minor
functional change.
2016-05-20 08:31:20 +00:00
|
|
|
if(g->type == Group::Type::ROTATE || g->type == Group::Type::TRANSLATE) {
|
|
|
|
if(g->subtype == Group::Subtype::ONE_SIDED) {
|
2010-05-09 18:25:23 +00:00
|
|
|
bool skip = g->skipFirst;
|
2015-03-29 00:30:52 +00:00
|
|
|
Printf(false,
|
2015-11-05 19:39:27 +00:00
|
|
|
"%Bd %Ftstart %f%LK%Fd%s with original%E "
|
|
|
|
"%f%Lk%Fd%s with copy #1%E",
|
2010-05-09 18:25:23 +00:00
|
|
|
&ScreenChangeGroupOption,
|
|
|
|
!skip ? RADIO_TRUE : RADIO_FALSE,
|
|
|
|
&ScreenChangeGroupOption,
|
|
|
|
skip ? RADIO_TRUE : RADIO_FALSE);
|
|
|
|
}
|
|
|
|
|
|
|
|
int times = (int)(g->valA);
|
|
|
|
Printf(false, "%Bp %Ftrepeat%E %d time%s %Fl%Ll%D%f[change]%E",
|
Convert all enumerations to use `enum class`.
Specifically, take the old code that looks like this:
class Foo {
enum { X = 1, Y = 2 };
int kind;
}
... foo.kind = Foo::X; ...
and convert it to this:
class Foo {
enum class Kind : uint32_t { X = 1, Y = 2 };
Kind kind;
}
... foo.kind = Foo::Kind::X;
(In some cases the enumeration would not be in the class namespace,
such as when it is generally useful.)
The benefits are as follows:
* The type of the field gives a clear indication of intent, both
to humans and tools (such as binding generators).
* The compiler is able to automatically warn when a switch is not
exhaustive; but this is currently suppressed by the
default: ssassert(false, ...)
idiom.
* Integers and plain enums are weakly type checked: they implicitly
convert into each other. This can hide bugs where type conversion
is performed but not intended. Enum classes are strongly type
checked.
* Plain enums pollute parent namespaces; enum classes do not.
Almost every defined enum we have already has a kind of ad-hoc
namespacing via `NAMESPACE_`, which is now explicit.
* Plain enums do not have a well-defined ABI size, which is
important for bindings. Enum classes can have it, if specified.
We specify the base type for all enums as uint32_t, which is
a safe choice and allows us to not change the numeric values
of any variants.
This commit introduces absolutely no functional change to the code,
just renaming and change of types. It handles almost all cases,
except GraphicsWindow::pending.operation, which needs minor
functional change.
2016-05-20 08:31:20 +00:00
|
|
|
(g->subtype == Group::Subtype::ONE_SIDED) ? 'a' : 'd',
|
2010-05-09 18:25:23 +00:00
|
|
|
times, times == 1 ? "" : "s",
|
|
|
|
g->h.v, &TextWindow::ScreenChangeExprA);
|
|
|
|
}
|
Convert all enumerations to use `enum class`.
Specifically, take the old code that looks like this:
class Foo {
enum { X = 1, Y = 2 };
int kind;
}
... foo.kind = Foo::X; ...
and convert it to this:
class Foo {
enum class Kind : uint32_t { X = 1, Y = 2 };
Kind kind;
}
... foo.kind = Foo::Kind::X;
(In some cases the enumeration would not be in the class namespace,
such as when it is generally useful.)
The benefits are as follows:
* The type of the field gives a clear indication of intent, both
to humans and tools (such as binding generators).
* The compiler is able to automatically warn when a switch is not
exhaustive; but this is currently suppressed by the
default: ssassert(false, ...)
idiom.
* Integers and plain enums are weakly type checked: they implicitly
convert into each other. This can hide bugs where type conversion
is performed but not intended. Enum classes are strongly type
checked.
* Plain enums pollute parent namespaces; enum classes do not.
Almost every defined enum we have already has a kind of ad-hoc
namespacing via `NAMESPACE_`, which is now explicit.
* Plain enums do not have a well-defined ABI size, which is
important for bindings. Enum classes can have it, if specified.
We specify the base type for all enums as uint32_t, which is
a safe choice and allows us to not change the numeric values
of any variants.
This commit introduces absolutely no functional change to the code,
just renaming and change of types. It handles almost all cases,
except GraphicsWindow::pending.operation, which needs minor
functional change.
2016-05-20 08:31:20 +00:00
|
|
|
} else if(g->type == Group::Type::LINKED) {
|
2016-05-07 05:27:54 +00:00
|
|
|
Printf(true, " %Ftlink geometry from file%E");
|
2016-11-29 16:49:20 +00:00
|
|
|
Platform::Path relativePath = g->linkFile.RelativeTo(SS.saveFile.Parent());
|
2017-03-11 14:43:21 +00:00
|
|
|
if(relativePath.IsEmpty()) {
|
|
|
|
Printf(false, "%Ba '%s'", g->linkFile.raw.c_str());
|
|
|
|
} else {
|
|
|
|
Printf(false, "%Ba '%s'", relativePath.raw.c_str());
|
|
|
|
}
|
2010-05-09 18:25:23 +00:00
|
|
|
Printf(false, "%Bd %Ftscaled by%E %# %Fl%Ll%f%D[change]%E",
|
|
|
|
g->scale,
|
|
|
|
&TextWindow::ScreenChangeGroupScale, g->h.v);
|
Convert all enumerations to use `enum class`.
Specifically, take the old code that looks like this:
class Foo {
enum { X = 1, Y = 2 };
int kind;
}
... foo.kind = Foo::X; ...
and convert it to this:
class Foo {
enum class Kind : uint32_t { X = 1, Y = 2 };
Kind kind;
}
... foo.kind = Foo::Kind::X;
(In some cases the enumeration would not be in the class namespace,
such as when it is generally useful.)
The benefits are as follows:
* The type of the field gives a clear indication of intent, both
to humans and tools (such as binding generators).
* The compiler is able to automatically warn when a switch is not
exhaustive; but this is currently suppressed by the
default: ssassert(false, ...)
idiom.
* Integers and plain enums are weakly type checked: they implicitly
convert into each other. This can hide bugs where type conversion
is performed but not intended. Enum classes are strongly type
checked.
* Plain enums pollute parent namespaces; enum classes do not.
Almost every defined enum we have already has a kind of ad-hoc
namespacing via `NAMESPACE_`, which is now explicit.
* Plain enums do not have a well-defined ABI size, which is
important for bindings. Enum classes can have it, if specified.
We specify the base type for all enums as uint32_t, which is
a safe choice and allows us to not change the numeric values
of any variants.
This commit introduces absolutely no functional change to the code,
just renaming and change of types. It handles almost all cases,
except GraphicsWindow::pending.operation, which needs minor
functional change.
2016-05-20 08:31:20 +00:00
|
|
|
} else if(g->type == Group::Type::DRAWING_3D) {
|
2010-05-09 18:25:23 +00:00
|
|
|
Printf(true, " %Ftsketch in 3d%E");
|
Convert all enumerations to use `enum class`.
Specifically, take the old code that looks like this:
class Foo {
enum { X = 1, Y = 2 };
int kind;
}
... foo.kind = Foo::X; ...
and convert it to this:
class Foo {
enum class Kind : uint32_t { X = 1, Y = 2 };
Kind kind;
}
... foo.kind = Foo::Kind::X;
(In some cases the enumeration would not be in the class namespace,
such as when it is generally useful.)
The benefits are as follows:
* The type of the field gives a clear indication of intent, both
to humans and tools (such as binding generators).
* The compiler is able to automatically warn when a switch is not
exhaustive; but this is currently suppressed by the
default: ssassert(false, ...)
idiom.
* Integers and plain enums are weakly type checked: they implicitly
convert into each other. This can hide bugs where type conversion
is performed but not intended. Enum classes are strongly type
checked.
* Plain enums pollute parent namespaces; enum classes do not.
Almost every defined enum we have already has a kind of ad-hoc
namespacing via `NAMESPACE_`, which is now explicit.
* Plain enums do not have a well-defined ABI size, which is
important for bindings. Enum classes can have it, if specified.
We specify the base type for all enums as uint32_t, which is
a safe choice and allows us to not change the numeric values
of any variants.
This commit introduces absolutely no functional change to the code,
just renaming and change of types. It handles almost all cases,
except GraphicsWindow::pending.operation, which needs minor
functional change.
2016-05-20 08:31:20 +00:00
|
|
|
} else if(g->type == Group::Type::DRAWING_WORKPLANE) {
|
2010-05-09 18:25:23 +00:00
|
|
|
Printf(true, " %Ftsketch in new workplane%E");
|
|
|
|
} else {
|
|
|
|
Printf(true, "???");
|
2008-06-23 08:37:12 +00:00
|
|
|
}
|
2010-05-09 18:25:23 +00:00
|
|
|
Printf(false, "");
|
2008-06-23 08:37:12 +00:00
|
|
|
|
Convert all enumerations to use `enum class`.
Specifically, take the old code that looks like this:
class Foo {
enum { X = 1, Y = 2 };
int kind;
}
... foo.kind = Foo::X; ...
and convert it to this:
class Foo {
enum class Kind : uint32_t { X = 1, Y = 2 };
Kind kind;
}
... foo.kind = Foo::Kind::X;
(In some cases the enumeration would not be in the class namespace,
such as when it is generally useful.)
The benefits are as follows:
* The type of the field gives a clear indication of intent, both
to humans and tools (such as binding generators).
* The compiler is able to automatically warn when a switch is not
exhaustive; but this is currently suppressed by the
default: ssassert(false, ...)
idiom.
* Integers and plain enums are weakly type checked: they implicitly
convert into each other. This can hide bugs where type conversion
is performed but not intended. Enum classes are strongly type
checked.
* Plain enums pollute parent namespaces; enum classes do not.
Almost every defined enum we have already has a kind of ad-hoc
namespacing via `NAMESPACE_`, which is now explicit.
* Plain enums do not have a well-defined ABI size, which is
important for bindings. Enum classes can have it, if specified.
We specify the base type for all enums as uint32_t, which is
a safe choice and allows us to not change the numeric values
of any variants.
This commit introduces absolutely no functional change to the code,
just renaming and change of types. It handles almost all cases,
except GraphicsWindow::pending.operation, which needs minor
functional change.
2016-05-20 08:31:20 +00:00
|
|
|
if(g->type == Group::Type::EXTRUDE ||
|
|
|
|
g->type == Group::Type::LATHE ||
|
|
|
|
g->type == Group::Type::LINKED)
|
2008-06-23 08:37:12 +00:00
|
|
|
{
|
Convert all enumerations to use `enum class`.
Specifically, take the old code that looks like this:
class Foo {
enum { X = 1, Y = 2 };
int kind;
}
... foo.kind = Foo::X; ...
and convert it to this:
class Foo {
enum class Kind : uint32_t { X = 1, Y = 2 };
Kind kind;
}
... foo.kind = Foo::Kind::X;
(In some cases the enumeration would not be in the class namespace,
such as when it is generally useful.)
The benefits are as follows:
* The type of the field gives a clear indication of intent, both
to humans and tools (such as binding generators).
* The compiler is able to automatically warn when a switch is not
exhaustive; but this is currently suppressed by the
default: ssassert(false, ...)
idiom.
* Integers and plain enums are weakly type checked: they implicitly
convert into each other. This can hide bugs where type conversion
is performed but not intended. Enum classes are strongly type
checked.
* Plain enums pollute parent namespaces; enum classes do not.
Almost every defined enum we have already has a kind of ad-hoc
namespacing via `NAMESPACE_`, which is now explicit.
* Plain enums do not have a well-defined ABI size, which is
important for bindings. Enum classes can have it, if specified.
We specify the base type for all enums as uint32_t, which is
a safe choice and allows us to not change the numeric values
of any variants.
This commit introduces absolutely no functional change to the code,
just renaming and change of types. It handles almost all cases,
except GraphicsWindow::pending.operation, which needs minor
functional change.
2016-05-20 08:31:20 +00:00
|
|
|
bool un = (g->meshCombine == Group::CombineAs::UNION);
|
|
|
|
bool diff = (g->meshCombine == Group::CombineAs::DIFFERENCE);
|
|
|
|
bool asy = (g->meshCombine == Group::CombineAs::ASSEMBLE);
|
2008-06-23 08:37:12 +00:00
|
|
|
|
2010-05-09 18:25:23 +00:00
|
|
|
Printf(false, " %Ftsolid model as");
|
2015-11-05 19:39:27 +00:00
|
|
|
Printf(false, "%Ba %f%D%Lc%Fd%s union%E "
|
|
|
|
"%f%D%Lc%Fd%s difference%E "
|
2016-05-03 07:44:10 +00:00
|
|
|
"%f%D%Lc%Fd%s assemble%E ",
|
2009-10-09 12:57:10 +00:00
|
|
|
&TextWindow::ScreenChangeGroupOption,
|
Convert all enumerations to use `enum class`.
Specifically, take the old code that looks like this:
class Foo {
enum { X = 1, Y = 2 };
int kind;
}
... foo.kind = Foo::X; ...
and convert it to this:
class Foo {
enum class Kind : uint32_t { X = 1, Y = 2 };
Kind kind;
}
... foo.kind = Foo::Kind::X;
(In some cases the enumeration would not be in the class namespace,
such as when it is generally useful.)
The benefits are as follows:
* The type of the field gives a clear indication of intent, both
to humans and tools (such as binding generators).
* The compiler is able to automatically warn when a switch is not
exhaustive; but this is currently suppressed by the
default: ssassert(false, ...)
idiom.
* Integers and plain enums are weakly type checked: they implicitly
convert into each other. This can hide bugs where type conversion
is performed but not intended. Enum classes are strongly type
checked.
* Plain enums pollute parent namespaces; enum classes do not.
Almost every defined enum we have already has a kind of ad-hoc
namespacing via `NAMESPACE_`, which is now explicit.
* Plain enums do not have a well-defined ABI size, which is
important for bindings. Enum classes can have it, if specified.
We specify the base type for all enums as uint32_t, which is
a safe choice and allows us to not change the numeric values
of any variants.
This commit introduces absolutely no functional change to the code,
just renaming and change of types. It handles almost all cases,
except GraphicsWindow::pending.operation, which needs minor
functional change.
2016-05-20 08:31:20 +00:00
|
|
|
Group::CombineAs::UNION,
|
2010-05-09 18:25:23 +00:00
|
|
|
un ? RADIO_TRUE : RADIO_FALSE,
|
2009-10-09 12:57:10 +00:00
|
|
|
&TextWindow::ScreenChangeGroupOption,
|
Convert all enumerations to use `enum class`.
Specifically, take the old code that looks like this:
class Foo {
enum { X = 1, Y = 2 };
int kind;
}
... foo.kind = Foo::X; ...
and convert it to this:
class Foo {
enum class Kind : uint32_t { X = 1, Y = 2 };
Kind kind;
}
... foo.kind = Foo::Kind::X;
(In some cases the enumeration would not be in the class namespace,
such as when it is generally useful.)
The benefits are as follows:
* The type of the field gives a clear indication of intent, both
to humans and tools (such as binding generators).
* The compiler is able to automatically warn when a switch is not
exhaustive; but this is currently suppressed by the
default: ssassert(false, ...)
idiom.
* Integers and plain enums are weakly type checked: they implicitly
convert into each other. This can hide bugs where type conversion
is performed but not intended. Enum classes are strongly type
checked.
* Plain enums pollute parent namespaces; enum classes do not.
Almost every defined enum we have already has a kind of ad-hoc
namespacing via `NAMESPACE_`, which is now explicit.
* Plain enums do not have a well-defined ABI size, which is
important for bindings. Enum classes can have it, if specified.
We specify the base type for all enums as uint32_t, which is
a safe choice and allows us to not change the numeric values
of any variants.
This commit introduces absolutely no functional change to the code,
just renaming and change of types. It handles almost all cases,
except GraphicsWindow::pending.operation, which needs minor
functional change.
2016-05-20 08:31:20 +00:00
|
|
|
Group::CombineAs::DIFFERENCE,
|
2010-05-09 18:25:23 +00:00
|
|
|
diff ? RADIO_TRUE : RADIO_FALSE,
|
2009-10-09 12:57:10 +00:00
|
|
|
&TextWindow::ScreenChangeGroupOption,
|
Convert all enumerations to use `enum class`.
Specifically, take the old code that looks like this:
class Foo {
enum { X = 1, Y = 2 };
int kind;
}
... foo.kind = Foo::X; ...
and convert it to this:
class Foo {
enum class Kind : uint32_t { X = 1, Y = 2 };
Kind kind;
}
... foo.kind = Foo::Kind::X;
(In some cases the enumeration would not be in the class namespace,
such as when it is generally useful.)
The benefits are as follows:
* The type of the field gives a clear indication of intent, both
to humans and tools (such as binding generators).
* The compiler is able to automatically warn when a switch is not
exhaustive; but this is currently suppressed by the
default: ssassert(false, ...)
idiom.
* Integers and plain enums are weakly type checked: they implicitly
convert into each other. This can hide bugs where type conversion
is performed but not intended. Enum classes are strongly type
checked.
* Plain enums pollute parent namespaces; enum classes do not.
Almost every defined enum we have already has a kind of ad-hoc
namespacing via `NAMESPACE_`, which is now explicit.
* Plain enums do not have a well-defined ABI size, which is
important for bindings. Enum classes can have it, if specified.
We specify the base type for all enums as uint32_t, which is
a safe choice and allows us to not change the numeric values
of any variants.
This commit introduces absolutely no functional change to the code,
just renaming and change of types. It handles almost all cases,
except GraphicsWindow::pending.operation, which needs minor
functional change.
2016-05-20 08:31:20 +00:00
|
|
|
Group::CombineAs::ASSEMBLE,
|
2016-05-03 07:44:10 +00:00
|
|
|
(asy ? RADIO_TRUE : RADIO_FALSE));
|
2009-10-01 11:22:56 +00:00
|
|
|
|
Convert all enumerations to use `enum class`.
Specifically, take the old code that looks like this:
class Foo {
enum { X = 1, Y = 2 };
int kind;
}
... foo.kind = Foo::X; ...
and convert it to this:
class Foo {
enum class Kind : uint32_t { X = 1, Y = 2 };
Kind kind;
}
... foo.kind = Foo::Kind::X;
(In some cases the enumeration would not be in the class namespace,
such as when it is generally useful.)
The benefits are as follows:
* The type of the field gives a clear indication of intent, both
to humans and tools (such as binding generators).
* The compiler is able to automatically warn when a switch is not
exhaustive; but this is currently suppressed by the
default: ssassert(false, ...)
idiom.
* Integers and plain enums are weakly type checked: they implicitly
convert into each other. This can hide bugs where type conversion
is performed but not intended. Enum classes are strongly type
checked.
* Plain enums pollute parent namespaces; enum classes do not.
Almost every defined enum we have already has a kind of ad-hoc
namespacing via `NAMESPACE_`, which is now explicit.
* Plain enums do not have a well-defined ABI size, which is
important for bindings. Enum classes can have it, if specified.
We specify the base type for all enums as uint32_t, which is
a safe choice and allows us to not change the numeric values
of any variants.
This commit introduces absolutely no functional change to the code,
just renaming and change of types. It handles almost all cases,
except GraphicsWindow::pending.operation, which needs minor
functional change.
2016-05-20 08:31:20 +00:00
|
|
|
if(g->type == Group::Type::EXTRUDE ||
|
|
|
|
g->type == Group::Type::LATHE)
|
2010-05-09 18:25:23 +00:00
|
|
|
{
|
2010-08-14 19:00:25 +00:00
|
|
|
Printf(false,
|
2015-03-26 10:30:12 +00:00
|
|
|
"%Bd %Ftcolor %E%Bz %Bd (%@, %@, %@) %f%D%Lf%Fl[change]%E",
|
Replaced RGB-color integers with dedicated data structure
RGB colors were represented using a uint32_t with the red, green and blue
values stuffed into the lower three octets (i.e. 0x00BBGGRR), like
Microsoft's COLORREF. This approach did not lend itself to type safety,
however, so this change replaces it with an RgbColor class that provides
the same infomation plus a handful of useful methods to work with it. (Note
that sizeof(RgbColor) == sizeof(uint32_t), so this change should not lead
to memory bloat.)
Some of the new methods/fields replace what were previously macro calls;
e.g. RED(c) is now c.red, REDf(c) is now c.redF(). The .Equals() method is
now used instead of == to compare colors.
RGB colors still need to be represented as packed integers in file I/O and
preferences, so the methods .FromPackedInt() and .ToPackedInt() are
provided. Also implemented are Cnf{Freeze,Thaw}Color(), type-safe wrappers
around Cnf{Freeze,Thaw}Int() that facilitate I/O with preferences.
(Cnf{Freeze,Thaw}Color() are defined outside of the system-dependent code
to minimize the footprint of the latter; because the same can be done with
Cnf{Freeze,Thaw}Bool(), those are also moved out of the system code with
this commit.)
Color integers were being OR'ed with 0x80000000 in some places for two
distinct purposes: One, to indicate use of a default color in
glxFillMesh(); this has been replaced by use of the .UseDefault() method.
Two, to indicate to TextWindow::Printf() that the format argument of a
"%Bp"/"%Fp" specifier is an RGB color rather than a color "code" from
TextWindow::bgColors[] or TextWindow::fgColors[] (as the specifier can
accept either); instead, we define a new flag "z" (as in "%Bz" or "%Fz") to
indicate an RGBcolor pointer, leaving "%Bp"/"%Fp" to indicate a color code
exclusively.
(This also allows TextWindow::meta[][].bg to be a char instead of an int,
partly compensating for the new .bgRgb field added immediately after.)
In array declarations, RGB colors could previously be specified as 0 (often
in a terminating element). As that no longer works, we define NULL_COLOR,
which serves much the same purpose for RgbColor variables as NULL serves
for pointers.
2013-10-16 20:00:58 +00:00
|
|
|
&g->color,
|
|
|
|
g->color.redF(), g->color.greenF(), g->color.blueF(),
|
2010-08-14 19:00:25 +00:00
|
|
|
ScreenColor, top[rows-1] + 2);
|
2015-03-26 10:30:12 +00:00
|
|
|
Printf(false, "%Bd %Ftopacity%E %@ %f%Lf%Fl[change]%E",
|
|
|
|
g->color.alphaF(),
|
|
|
|
&TextWindow::ScreenOpacity);
|
2017-04-05 18:49:18 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
if(g->type == Group::Type::EXTRUDE ||
|
|
|
|
g->type == Group::Type::LATHE ||
|
|
|
|
g->type == Group::Type::LINKED) {
|
2015-11-05 19:39:27 +00:00
|
|
|
Printf(false, " %Fd%f%LP%s suppress this group's solid model",
|
2010-05-09 18:25:23 +00:00
|
|
|
&TextWindow::ScreenChangeGroupOption,
|
|
|
|
g->suppress ? CHECK_TRUE : CHECK_FALSE);
|
2009-05-22 10:02:02 +00:00
|
|
|
}
|
2009-05-30 08:49:09 +00:00
|
|
|
|
2010-05-09 18:25:23 +00:00
|
|
|
Printf(false, "");
|
2009-05-22 10:02:02 +00:00
|
|
|
}
|
|
|
|
|
2015-11-05 19:39:27 +00:00
|
|
|
Printf(false, " %f%Lv%Fd%s show entities from this group",
|
2010-05-12 04:57:41 +00:00
|
|
|
&TextWindow::ScreenChangeGroupOption,
|
|
|
|
g->visible ? CHECK_TRUE : CHECK_FALSE);
|
|
|
|
|
2017-03-21 15:47:59 +00:00
|
|
|
if(!g->IsForcedToMeshBySource()) {
|
2015-11-05 19:39:27 +00:00
|
|
|
Printf(false, " %f%Lf%Fd%s force NURBS surfaces to triangle mesh",
|
2010-05-09 18:25:23 +00:00
|
|
|
&TextWindow::ScreenChangeGroupOption,
|
|
|
|
g->forceToMesh ? CHECK_TRUE : CHECK_FALSE);
|
2008-06-23 08:37:12 +00:00
|
|
|
} else {
|
2010-05-09 18:25:23 +00:00
|
|
|
Printf(false, " (model already forced to triangle mesh)");
|
|
|
|
}
|
|
|
|
|
2015-11-05 19:39:27 +00:00
|
|
|
Printf(true, " %f%Lr%Fd%s relax constraints and dimensions",
|
2010-05-09 18:25:23 +00:00
|
|
|
&TextWindow::ScreenChangeGroupOption,
|
|
|
|
g->relaxConstraints ? CHECK_TRUE : CHECK_FALSE);
|
|
|
|
|
2016-01-21 15:01:43 +00:00
|
|
|
Printf(false, " %f%Le%Fd%s allow redundant constraints",
|
|
|
|
&TextWindow::ScreenChangeGroupOption,
|
|
|
|
g->allowRedundant ? CHECK_TRUE : CHECK_FALSE);
|
|
|
|
|
2015-11-05 19:39:27 +00:00
|
|
|
Printf(false, " %f%Ld%Fd%s treat all dimensions as reference",
|
2010-05-10 01:06:09 +00:00
|
|
|
&TextWindow::ScreenChangeGroupOption,
|
|
|
|
g->allDimsReference ? CHECK_TRUE : CHECK_FALSE);
|
|
|
|
|
2010-05-09 18:25:23 +00:00
|
|
|
if(g->booleanFailed) {
|
2008-06-23 08:37:12 +00:00
|
|
|
Printf(false, "");
|
2010-05-09 18:25:23 +00:00
|
|
|
Printf(false, "The Boolean operation failed. It may be ");
|
|
|
|
Printf(false, "possible to fix the problem by choosing ");
|
|
|
|
Printf(false, "'force NURBS surfaces to triangle mesh'.");
|
2008-06-23 08:37:12 +00:00
|
|
|
}
|
|
|
|
|
2010-05-09 18:25:23 +00:00
|
|
|
list_items:
|
|
|
|
Printf(false, "");
|
|
|
|
Printf(false, "%Ft requests in group");
|
|
|
|
|
2008-06-23 08:37:12 +00:00
|
|
|
int i, a = 0;
|
2009-04-19 05:53:16 +00:00
|
|
|
for(i = 0; i < SK.request.n; i++) {
|
|
|
|
Request *r = &(SK.request.elem[i]);
|
2008-06-23 08:37:12 +00:00
|
|
|
|
2008-07-10 06:11:56 +00:00
|
|
|
if(r->group.v == shown.group.v) {
|
2015-11-06 08:40:12 +00:00
|
|
|
std::string s = r->DescriptionString();
|
2008-06-23 08:37:12 +00:00
|
|
|
Printf(false, "%Bp %Fl%Ll%D%f%h%s%E",
|
|
|
|
(a & 1) ? 'd' : 'a',
|
|
|
|
r->h.v, (&TextWindow::ScreenSelectRequest),
|
2015-11-06 08:40:12 +00:00
|
|
|
&(TextWindow::ScreenHoverRequest), s.c_str());
|
2008-06-23 08:37:12 +00:00
|
|
|
a++;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
if(a == 0) Printf(false, "%Ba (none)");
|
|
|
|
|
|
|
|
a = 0;
|
2010-05-09 18:25:23 +00:00
|
|
|
Printf(false, "");
|
|
|
|
Printf(false, "%Ft constraints in group (%d DOF)", g->solved.dof);
|
2009-04-19 05:53:16 +00:00
|
|
|
for(i = 0; i < SK.constraint.n; i++) {
|
|
|
|
Constraint *c = &(SK.constraint.elem[i]);
|
2008-06-23 08:37:12 +00:00
|
|
|
|
2008-07-10 06:11:56 +00:00
|
|
|
if(c->group.v == shown.group.v) {
|
2015-11-06 08:40:12 +00:00
|
|
|
std::string s = c->DescriptionString();
|
2008-07-02 06:59:49 +00:00
|
|
|
Printf(false, "%Bp %Fl%Ll%D%f%h%s%E %s",
|
2008-06-23 08:37:12 +00:00
|
|
|
(a & 1) ? 'd' : 'a',
|
|
|
|
c->h.v, (&TextWindow::ScreenSelectConstraint),
|
2015-11-06 08:40:12 +00:00
|
|
|
(&TextWindow::ScreenHoverConstraint), s.c_str(),
|
2008-07-02 06:59:49 +00:00
|
|
|
c->reference ? "(ref)" : "");
|
2008-06-23 08:37:12 +00:00
|
|
|
a++;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
if(a == 0) Printf(false, "%Ba (none)");
|
|
|
|
}
|
|
|
|
|
|
|
|
//-----------------------------------------------------------------------------
|
|
|
|
// The screen that's displayed when the sketch fails to solve. A report of
|
|
|
|
// what failed, and (if the problem is a singular Jacobian) a list of
|
|
|
|
// constraints that could be removed to fix it.
|
|
|
|
//-----------------------------------------------------------------------------
|
2016-01-21 15:01:43 +00:00
|
|
|
void TextWindow::ScreenAllowRedundant(int link, uint32_t v) {
|
|
|
|
SS.UndoRemember();
|
|
|
|
|
|
|
|
Group *g = SK.GetGroup(SS.TW.shown.group);
|
|
|
|
g->allowRedundant = true;
|
2016-12-26 02:09:45 +00:00
|
|
|
SS.MarkGroupDirty(SS.TW.shown.group);
|
2016-01-21 15:01:43 +00:00
|
|
|
|
Convert all enumerations to use `enum class`.
Specifically, take the old code that looks like this:
class Foo {
enum { X = 1, Y = 2 };
int kind;
}
... foo.kind = Foo::X; ...
and convert it to this:
class Foo {
enum class Kind : uint32_t { X = 1, Y = 2 };
Kind kind;
}
... foo.kind = Foo::Kind::X;
(In some cases the enumeration would not be in the class namespace,
such as when it is generally useful.)
The benefits are as follows:
* The type of the field gives a clear indication of intent, both
to humans and tools (such as binding generators).
* The compiler is able to automatically warn when a switch is not
exhaustive; but this is currently suppressed by the
default: ssassert(false, ...)
idiom.
* Integers and plain enums are weakly type checked: they implicitly
convert into each other. This can hide bugs where type conversion
is performed but not intended. Enum classes are strongly type
checked.
* Plain enums pollute parent namespaces; enum classes do not.
Almost every defined enum we have already has a kind of ad-hoc
namespacing via `NAMESPACE_`, which is now explicit.
* Plain enums do not have a well-defined ABI size, which is
important for bindings. Enum classes can have it, if specified.
We specify the base type for all enums as uint32_t, which is
a safe choice and allows us to not change the numeric values
of any variants.
This commit introduces absolutely no functional change to the code,
just renaming and change of types. It handles almost all cases,
except GraphicsWindow::pending.operation, which needs minor
functional change.
2016-05-20 08:31:20 +00:00
|
|
|
SS.TW.shown.screen = Screen::GROUP_INFO;
|
2016-01-21 15:01:43 +00:00
|
|
|
SS.TW.Show();
|
|
|
|
}
|
2016-05-05 05:54:05 +00:00
|
|
|
void TextWindow::ShowGroupSolveInfo() {
|
2016-02-17 10:03:07 +00:00
|
|
|
Group *g = SK.GetGroup(shown.group);
|
2016-01-21 15:01:43 +00:00
|
|
|
if(g->IsSolvedOkay()) {
|
2008-06-23 08:37:12 +00:00
|
|
|
// Go back to the default group info screen
|
Convert all enumerations to use `enum class`.
Specifically, take the old code that looks like this:
class Foo {
enum { X = 1, Y = 2 };
int kind;
}
... foo.kind = Foo::X; ...
and convert it to this:
class Foo {
enum class Kind : uint32_t { X = 1, Y = 2 };
Kind kind;
}
... foo.kind = Foo::Kind::X;
(In some cases the enumeration would not be in the class namespace,
such as when it is generally useful.)
The benefits are as follows:
* The type of the field gives a clear indication of intent, both
to humans and tools (such as binding generators).
* The compiler is able to automatically warn when a switch is not
exhaustive; but this is currently suppressed by the
default: ssassert(false, ...)
idiom.
* Integers and plain enums are weakly type checked: they implicitly
convert into each other. This can hide bugs where type conversion
is performed but not intended. Enum classes are strongly type
checked.
* Plain enums pollute parent namespaces; enum classes do not.
Almost every defined enum we have already has a kind of ad-hoc
namespacing via `NAMESPACE_`, which is now explicit.
* Plain enums do not have a well-defined ABI size, which is
important for bindings. Enum classes can have it, if specified.
We specify the base type for all enums as uint32_t, which is
a safe choice and allows us to not change the numeric values
of any variants.
This commit introduces absolutely no functional change to the code,
just renaming and change of types. It handles almost all cases,
except GraphicsWindow::pending.operation, which needs minor
functional change.
2016-05-20 08:31:20 +00:00
|
|
|
shown.screen = Screen::GROUP_INFO;
|
2008-06-23 08:37:12 +00:00
|
|
|
Show();
|
|
|
|
return;
|
|
|
|
}
|
|
|
|
|
2015-11-06 08:40:12 +00:00
|
|
|
Printf(true, "%FtGROUP %E%s", g->DescriptionString().c_str());
|
2008-06-23 08:37:12 +00:00
|
|
|
switch(g->solved.how) {
|
Convert all enumerations to use `enum class`.
Specifically, take the old code that looks like this:
class Foo {
enum { X = 1, Y = 2 };
int kind;
}
... foo.kind = Foo::X; ...
and convert it to this:
class Foo {
enum class Kind : uint32_t { X = 1, Y = 2 };
Kind kind;
}
... foo.kind = Foo::Kind::X;
(In some cases the enumeration would not be in the class namespace,
such as when it is generally useful.)
The benefits are as follows:
* The type of the field gives a clear indication of intent, both
to humans and tools (such as binding generators).
* The compiler is able to automatically warn when a switch is not
exhaustive; but this is currently suppressed by the
default: ssassert(false, ...)
idiom.
* Integers and plain enums are weakly type checked: they implicitly
convert into each other. This can hide bugs where type conversion
is performed but not intended. Enum classes are strongly type
checked.
* Plain enums pollute parent namespaces; enum classes do not.
Almost every defined enum we have already has a kind of ad-hoc
namespacing via `NAMESPACE_`, which is now explicit.
* Plain enums do not have a well-defined ABI size, which is
important for bindings. Enum classes can have it, if specified.
We specify the base type for all enums as uint32_t, which is
a safe choice and allows us to not change the numeric values
of any variants.
This commit introduces absolutely no functional change to the code,
just renaming and change of types. It handles almost all cases,
except GraphicsWindow::pending.operation, which needs minor
functional change.
2016-05-20 08:31:20 +00:00
|
|
|
case SolveResult::DIDNT_CONVERGE:
|
Distinguish overconstrained and redundantly constrained sketches.
When a solver error arises after a change to the sketch, it should
be easy to understand exactly why it happened. Before this change,
two functionally distinct modes of failure were lumped into one:
the same "redundant constraints" message was displayed when all
degrees of freedom were exhausted and the had a solution, but also
when it had not.
To understand why this is problematic, let's examine several ways
in which we can end up with linearly dependent equations in our
system:
0) create a triangle, then constrain two different pairs of edges
to be perpendicular
1) add two distinct distance constraints on the same segment
2) add two identical distance constraints on the same segment
3) create a triangle, then constrain edges to lengths a, b, and c
so that a+b=c
The case (0) is our baseline case: the constraints in it make
the system unsolvable yet they do not remove more degrees of freedom
than the amount we started with. So the displayed error is
"unsolvable constraints".
The constraints in case (1) remove one too many degrees of freedom,
but otherwise are quite like the case (0): the cause of failure that
is useful to the user is that the constraints are mutually
incompatible.
The constraints in cases (2) and (3) however are not like the others:
there is a set of parameters that satisfies all of the constraints,
but the constraints still remove one degree of freedom too many.
It makes sense to display a different error message for cases (2)
and (3) because in practice, cases like this are likely to arise from
adjustment of constraint values on sketches corresponding to systems
that have a small amount of degenerate solutions, and this is very
different from systems arising in cases like (0) where no adjustment
of constraint values will ever result in a successful solution.
So the error message displayed is "redundant constraints".
At last, this commit makes cases (0) and (1) display a message
with only a minor difference in wording. This is deliberate.
The reason is that the facts "the system is unsolvable" and
"the system is unsolvable and also has linearly dependent equations"
present no meaningful, actionable difference to the user, and placing
emphasis on it would only cause confusion.
However, they are still distinguished, because in case (0) we
list all relevant constraints (and thus we say they are "mutually
incompatible") but in case (1) we only list the ones that constrain
the sketch further than some valid solution (and we say they are
"unsatisfied").
2016-01-21 09:28:05 +00:00
|
|
|
Printf(true, "%FxSOLVE FAILED!%Fd unsolvable constraints");
|
|
|
|
Printf(true, "the following constraints are incompatible");
|
|
|
|
break;
|
|
|
|
|
Convert all enumerations to use `enum class`.
Specifically, take the old code that looks like this:
class Foo {
enum { X = 1, Y = 2 };
int kind;
}
... foo.kind = Foo::X; ...
and convert it to this:
class Foo {
enum class Kind : uint32_t { X = 1, Y = 2 };
Kind kind;
}
... foo.kind = Foo::Kind::X;
(In some cases the enumeration would not be in the class namespace,
such as when it is generally useful.)
The benefits are as follows:
* The type of the field gives a clear indication of intent, both
to humans and tools (such as binding generators).
* The compiler is able to automatically warn when a switch is not
exhaustive; but this is currently suppressed by the
default: ssassert(false, ...)
idiom.
* Integers and plain enums are weakly type checked: they implicitly
convert into each other. This can hide bugs where type conversion
is performed but not intended. Enum classes are strongly type
checked.
* Plain enums pollute parent namespaces; enum classes do not.
Almost every defined enum we have already has a kind of ad-hoc
namespacing via `NAMESPACE_`, which is now explicit.
* Plain enums do not have a well-defined ABI size, which is
important for bindings. Enum classes can have it, if specified.
We specify the base type for all enums as uint32_t, which is
a safe choice and allows us to not change the numeric values
of any variants.
This commit introduces absolutely no functional change to the code,
just renaming and change of types. It handles almost all cases,
except GraphicsWindow::pending.operation, which needs minor
functional change.
2016-05-20 08:31:20 +00:00
|
|
|
case SolveResult::REDUNDANT_DIDNT_CONVERGE:
|
2016-01-21 08:05:21 +00:00
|
|
|
Printf(true, "%FxSOLVE FAILED!%Fd unsolvable constraints");
|
2008-09-05 11:25:53 +00:00
|
|
|
Printf(true, "the following constraints are unsatisfied");
|
2008-06-23 08:37:12 +00:00
|
|
|
break;
|
|
|
|
|
Convert all enumerations to use `enum class`.
Specifically, take the old code that looks like this:
class Foo {
enum { X = 1, Y = 2 };
int kind;
}
... foo.kind = Foo::X; ...
and convert it to this:
class Foo {
enum class Kind : uint32_t { X = 1, Y = 2 };
Kind kind;
}
... foo.kind = Foo::Kind::X;
(In some cases the enumeration would not be in the class namespace,
such as when it is generally useful.)
The benefits are as follows:
* The type of the field gives a clear indication of intent, both
to humans and tools (such as binding generators).
* The compiler is able to automatically warn when a switch is not
exhaustive; but this is currently suppressed by the
default: ssassert(false, ...)
idiom.
* Integers and plain enums are weakly type checked: they implicitly
convert into each other. This can hide bugs where type conversion
is performed but not intended. Enum classes are strongly type
checked.
* Plain enums pollute parent namespaces; enum classes do not.
Almost every defined enum we have already has a kind of ad-hoc
namespacing via `NAMESPACE_`, which is now explicit.
* Plain enums do not have a well-defined ABI size, which is
important for bindings. Enum classes can have it, if specified.
We specify the base type for all enums as uint32_t, which is
a safe choice and allows us to not change the numeric values
of any variants.
This commit introduces absolutely no functional change to the code,
just renaming and change of types. It handles almost all cases,
except GraphicsWindow::pending.operation, which needs minor
functional change.
2016-05-20 08:31:20 +00:00
|
|
|
case SolveResult::REDUNDANT_OKAY:
|
2016-01-21 08:05:21 +00:00
|
|
|
Printf(true, "%FxSOLVE FAILED!%Fd redundant constraints");
|
2008-06-23 08:37:12 +00:00
|
|
|
Printf(true, "remove any one of these to fix it");
|
|
|
|
break;
|
2009-04-19 20:37:51 +00:00
|
|
|
|
Convert all enumerations to use `enum class`.
Specifically, take the old code that looks like this:
class Foo {
enum { X = 1, Y = 2 };
int kind;
}
... foo.kind = Foo::X; ...
and convert it to this:
class Foo {
enum class Kind : uint32_t { X = 1, Y = 2 };
Kind kind;
}
... foo.kind = Foo::Kind::X;
(In some cases the enumeration would not be in the class namespace,
such as when it is generally useful.)
The benefits are as follows:
* The type of the field gives a clear indication of intent, both
to humans and tools (such as binding generators).
* The compiler is able to automatically warn when a switch is not
exhaustive; but this is currently suppressed by the
default: ssassert(false, ...)
idiom.
* Integers and plain enums are weakly type checked: they implicitly
convert into each other. This can hide bugs where type conversion
is performed but not intended. Enum classes are strongly type
checked.
* Plain enums pollute parent namespaces; enum classes do not.
Almost every defined enum we have already has a kind of ad-hoc
namespacing via `NAMESPACE_`, which is now explicit.
* Plain enums do not have a well-defined ABI size, which is
important for bindings. Enum classes can have it, if specified.
We specify the base type for all enums as uint32_t, which is
a safe choice and allows us to not change the numeric values
of any variants.
This commit introduces absolutely no functional change to the code,
just renaming and change of types. It handles almost all cases,
except GraphicsWindow::pending.operation, which needs minor
functional change.
2016-05-20 08:31:20 +00:00
|
|
|
case SolveResult::TOO_MANY_UNKNOWNS:
|
2009-04-19 20:37:51 +00:00
|
|
|
Printf(true, "Too many unknowns in a single group!");
|
|
|
|
return;
|
Enable exhaustive switch coverage warnings as an error, and use them.
Specifically, this enables -Wswitch=error on GCC/Clang and its MSVC
equivalent; the exact way it is handled varies slightly, but what
they all have in common is that in a switch statement over an
enumeration, any enumerand that is not explicitly (via case:) or
implicitly (via default:) handled in the switch triggers an error.
Moreover, we also change the switch statements in three ways:
* Switch statements that ought to be extended every time a new
enumerand is added (e.g. Entity::DrawOrGetDistance(), are changed
to explicitly list every single enumerand, and not have a
default: branch.
Note that the assertions are kept because it is legal for
a enumeration to have a value unlike any of its defined
enumerands, and we can e.g. read garbage from a file, or
an uninitialized variable. This requires some rearranging if
a default: branch is undesired.
* Switch statements that ought to only ever see a few select
enumerands, are changed to always assert in the default: branch.
* Switch statements that do something meaningful for a few
enumerands, and ignore everything else, are changed to do nothing
in a default: branch, under the assumption that changing them
every time an enumerand is added or removed would just result
in noise and catch no bugs.
This commit also removes the {Request,Entity,Constraint}::UNKNOWN and
Entity::DATUM_POINT enumerands, as those were just fancy names for
zeroes. They mess up switch exhaustiveness checks and most of the time
were not the best way to implement what they did anyway.
2016-05-25 06:55:50 +00:00
|
|
|
|
|
|
|
default: ssassert(false, "Unexpected solve result");
|
2008-09-05 11:25:53 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
for(int i = 0; i < g->solved.remove.n; i++) {
|
|
|
|
hConstraint hc = g->solved.remove.elem[i];
|
2009-04-19 05:53:16 +00:00
|
|
|
Constraint *c = SK.constraint.FindByIdNoOops(hc);
|
2008-09-05 11:25:53 +00:00
|
|
|
if(!c) continue;
|
|
|
|
|
|
|
|
Printf(false, "%Bp %Fl%Ll%D%f%h%s%E",
|
|
|
|
(i & 1) ? 'd' : 'a',
|
|
|
|
c->h.v, (&TextWindow::ScreenSelectConstraint),
|
|
|
|
(&TextWindow::ScreenHoverConstraint),
|
2015-11-06 08:40:12 +00:00
|
|
|
c->DescriptionString().c_str());
|
2008-06-23 08:37:12 +00:00
|
|
|
}
|
2008-07-10 07:17:35 +00:00
|
|
|
|
|
|
|
Printf(true, "It may be possible to fix the problem ");
|
|
|
|
Printf(false, "by selecting Edit -> Undo.");
|
2016-01-21 15:01:43 +00:00
|
|
|
|
Convert all enumerations to use `enum class`.
Specifically, take the old code that looks like this:
class Foo {
enum { X = 1, Y = 2 };
int kind;
}
... foo.kind = Foo::X; ...
and convert it to this:
class Foo {
enum class Kind : uint32_t { X = 1, Y = 2 };
Kind kind;
}
... foo.kind = Foo::Kind::X;
(In some cases the enumeration would not be in the class namespace,
such as when it is generally useful.)
The benefits are as follows:
* The type of the field gives a clear indication of intent, both
to humans and tools (such as binding generators).
* The compiler is able to automatically warn when a switch is not
exhaustive; but this is currently suppressed by the
default: ssassert(false, ...)
idiom.
* Integers and plain enums are weakly type checked: they implicitly
convert into each other. This can hide bugs where type conversion
is performed but not intended. Enum classes are strongly type
checked.
* Plain enums pollute parent namespaces; enum classes do not.
Almost every defined enum we have already has a kind of ad-hoc
namespacing via `NAMESPACE_`, which is now explicit.
* Plain enums do not have a well-defined ABI size, which is
important for bindings. Enum classes can have it, if specified.
We specify the base type for all enums as uint32_t, which is
a safe choice and allows us to not change the numeric values
of any variants.
This commit introduces absolutely no functional change to the code,
just renaming and change of types. It handles almost all cases,
except GraphicsWindow::pending.operation, which needs minor
functional change.
2016-05-20 08:31:20 +00:00
|
|
|
if(g->solved.how == SolveResult::REDUNDANT_OKAY) {
|
2016-01-21 15:01:43 +00:00
|
|
|
Printf(true, "It is possible to suppress this error ");
|
|
|
|
Printf(false, "by %Fl%f%Llallowing redundant constraints%E in ",
|
|
|
|
&TextWindow::ScreenAllowRedundant);
|
|
|
|
Printf(false, "this group.");
|
|
|
|
}
|
2008-06-23 08:37:12 +00:00
|
|
|
}
|
|
|
|
|
2008-07-20 11:27:22 +00:00
|
|
|
//-----------------------------------------------------------------------------
|
|
|
|
// When we're stepping a dimension. User specifies the finish value, and
|
|
|
|
// how many steps to take in between current and finish, re-solving each
|
|
|
|
// time.
|
|
|
|
//-----------------------------------------------------------------------------
|
Use C99 integer types and C++ boolean types/values
This change comprehensively replaces the use of Microsoft-standard integer
and boolean types with their C99/C++ standard equivalents, as the latter is
more appropriate for a cross-platform application. With matter-of-course
exceptions in the Win32-specific code, the types/values have been converted
as follows:
QWORD --> uint64_t
SQWORD --> int64_t
DWORD --> uint32_t
SDWORD --> int32_t
WORD --> uint16_t
SWORD --> int16_t
BYTE --> uint8_t
BOOL --> bool
TRUE --> true
FALSE --> false
The following related changes are also included:
* Added C99 integer type definitions for Windows, as stdint.h is not
available prior to Visual Studio 2010
* Changed types of some variables in the SolveSpace class from 'int' to
'bool', as they actually represent boolean settings
* Implemented new Cnf{Freeze,Thaw}Bool() functions to support boolean
variables in the Registry
* Cnf{Freeze,Thaw}DWORD() are now Cnf{Freeze,Thaw}Int()
* TtfFont::Get{WORD,DWORD}() are now TtfFont::Get{USHORT,ULONG}() (names
inspired by the OpenType spec)
* RGB colors are packed into an integer of type uint32_t (nee DWORD), but
in a few places, these were represented by an int; these have been
corrected to uint32_t
2013-10-02 05:45:13 +00:00
|
|
|
void TextWindow::ScreenStepDimFinish(int link, uint32_t v) {
|
Convert all enumerations to use `enum class`.
Specifically, take the old code that looks like this:
class Foo {
enum { X = 1, Y = 2 };
int kind;
}
... foo.kind = Foo::X; ...
and convert it to this:
class Foo {
enum class Kind : uint32_t { X = 1, Y = 2 };
Kind kind;
}
... foo.kind = Foo::Kind::X;
(In some cases the enumeration would not be in the class namespace,
such as when it is generally useful.)
The benefits are as follows:
* The type of the field gives a clear indication of intent, both
to humans and tools (such as binding generators).
* The compiler is able to automatically warn when a switch is not
exhaustive; but this is currently suppressed by the
default: ssassert(false, ...)
idiom.
* Integers and plain enums are weakly type checked: they implicitly
convert into each other. This can hide bugs where type conversion
is performed but not intended. Enum classes are strongly type
checked.
* Plain enums pollute parent namespaces; enum classes do not.
Almost every defined enum we have already has a kind of ad-hoc
namespacing via `NAMESPACE_`, which is now explicit.
* Plain enums do not have a well-defined ABI size, which is
important for bindings. Enum classes can have it, if specified.
We specify the base type for all enums as uint32_t, which is
a safe choice and allows us to not change the numeric values
of any variants.
This commit introduces absolutely no functional change to the code,
just renaming and change of types. It handles almost all cases,
except GraphicsWindow::pending.operation, which needs minor
functional change.
2016-05-20 08:31:20 +00:00
|
|
|
SS.TW.edit.meaning = Edit::STEP_DIM_FINISH;
|
2015-11-06 08:40:12 +00:00
|
|
|
std::string edit_value;
|
Eliminate imperative redraws.
This commit removes Platform::Window::Redraw function, and rewrites
its uses to run on timer events. Most UI toolkits have obscure issues
with recursive event handling loops, and Emscripten is purely event-
driven and cannot handle imperative redraws at all.
As a part of this change, the Platform::Timer::WindUp function
is split into three to make the interpretation of its argument
less magical. The new functions are RunAfter (a regular timeout,
setTimeout in browser terms), RunAfterNextFrame (an animation
request, requestAnimationFrame in browser terms), and
RunAfterProcessingEvents (a request to run something after all
events for the current frame are processed, used for coalescing
expensive operations in face of input event queues).
This commit changes two uses of Redraw(): the AnimateOnto() and
ScreenStepDimGo() functions. The latter was actually broken in that
on small sketches, it would run very quickly and not animate
the dimension change at all; this has been fixed.
While we're at it, get rid of unused Platform::Window::NativePtr
function as well.
2018-07-18 23:11:49 +00:00
|
|
|
if(SS.TW.stepDim.isDistance) {
|
|
|
|
edit_value = SS.MmToString(SS.TW.stepDim.finish);
|
2008-07-20 11:27:22 +00:00
|
|
|
} else {
|
Eliminate imperative redraws.
This commit removes Platform::Window::Redraw function, and rewrites
its uses to run on timer events. Most UI toolkits have obscure issues
with recursive event handling loops, and Emscripten is purely event-
driven and cannot handle imperative redraws at all.
As a part of this change, the Platform::Timer::WindUp function
is split into three to make the interpretation of its argument
less magical. The new functions are RunAfter (a regular timeout,
setTimeout in browser terms), RunAfterNextFrame (an animation
request, requestAnimationFrame in browser terms), and
RunAfterProcessingEvents (a request to run something after all
events for the current frame are processed, used for coalescing
expensive operations in face of input event queues).
This commit changes two uses of Redraw(): the AnimateOnto() and
ScreenStepDimGo() functions. The latter was actually broken in that
on small sketches, it would run very quickly and not animate
the dimension change at all; this has been fixed.
While we're at it, get rid of unused Platform::Window::NativePtr
function as well.
2018-07-18 23:11:49 +00:00
|
|
|
edit_value = ssprintf("%.3f", SS.TW.stepDim.finish);
|
2008-07-20 11:27:22 +00:00
|
|
|
}
|
2016-01-26 11:19:52 +00:00
|
|
|
SS.TW.ShowEditControl(12, edit_value);
|
2008-07-20 11:27:22 +00:00
|
|
|
}
|
Use C99 integer types and C++ boolean types/values
This change comprehensively replaces the use of Microsoft-standard integer
and boolean types with their C99/C++ standard equivalents, as the latter is
more appropriate for a cross-platform application. With matter-of-course
exceptions in the Win32-specific code, the types/values have been converted
as follows:
QWORD --> uint64_t
SQWORD --> int64_t
DWORD --> uint32_t
SDWORD --> int32_t
WORD --> uint16_t
SWORD --> int16_t
BYTE --> uint8_t
BOOL --> bool
TRUE --> true
FALSE --> false
The following related changes are also included:
* Added C99 integer type definitions for Windows, as stdint.h is not
available prior to Visual Studio 2010
* Changed types of some variables in the SolveSpace class from 'int' to
'bool', as they actually represent boolean settings
* Implemented new Cnf{Freeze,Thaw}Bool() functions to support boolean
variables in the Registry
* Cnf{Freeze,Thaw}DWORD() are now Cnf{Freeze,Thaw}Int()
* TtfFont::Get{WORD,DWORD}() are now TtfFont::Get{USHORT,ULONG}() (names
inspired by the OpenType spec)
* RGB colors are packed into an integer of type uint32_t (nee DWORD), but
in a few places, these were represented by an int; these have been
corrected to uint32_t
2013-10-02 05:45:13 +00:00
|
|
|
void TextWindow::ScreenStepDimSteps(int link, uint32_t v) {
|
Convert all enumerations to use `enum class`.
Specifically, take the old code that looks like this:
class Foo {
enum { X = 1, Y = 2 };
int kind;
}
... foo.kind = Foo::X; ...
and convert it to this:
class Foo {
enum class Kind : uint32_t { X = 1, Y = 2 };
Kind kind;
}
... foo.kind = Foo::Kind::X;
(In some cases the enumeration would not be in the class namespace,
such as when it is generally useful.)
The benefits are as follows:
* The type of the field gives a clear indication of intent, both
to humans and tools (such as binding generators).
* The compiler is able to automatically warn when a switch is not
exhaustive; but this is currently suppressed by the
default: ssassert(false, ...)
idiom.
* Integers and plain enums are weakly type checked: they implicitly
convert into each other. This can hide bugs where type conversion
is performed but not intended. Enum classes are strongly type
checked.
* Plain enums pollute parent namespaces; enum classes do not.
Almost every defined enum we have already has a kind of ad-hoc
namespacing via `NAMESPACE_`, which is now explicit.
* Plain enums do not have a well-defined ABI size, which is
important for bindings. Enum classes can have it, if specified.
We specify the base type for all enums as uint32_t, which is
a safe choice and allows us to not change the numeric values
of any variants.
This commit introduces absolutely no functional change to the code,
just renaming and change of types. It handles almost all cases,
except GraphicsWindow::pending.operation, which needs minor
functional change.
2016-05-20 08:31:20 +00:00
|
|
|
SS.TW.edit.meaning = Edit::STEP_DIM_STEPS;
|
Eliminate imperative redraws.
This commit removes Platform::Window::Redraw function, and rewrites
its uses to run on timer events. Most UI toolkits have obscure issues
with recursive event handling loops, and Emscripten is purely event-
driven and cannot handle imperative redraws at all.
As a part of this change, the Platform::Timer::WindUp function
is split into three to make the interpretation of its argument
less magical. The new functions are RunAfter (a regular timeout,
setTimeout in browser terms), RunAfterNextFrame (an animation
request, requestAnimationFrame in browser terms), and
RunAfterProcessingEvents (a request to run something after all
events for the current frame are processed, used for coalescing
expensive operations in face of input event queues).
This commit changes two uses of Redraw(): the AnimateOnto() and
ScreenStepDimGo() functions. The latter was actually broken in that
on small sketches, it would run very quickly and not animate
the dimension change at all; this has been fixed.
While we're at it, get rid of unused Platform::Window::NativePtr
function as well.
2018-07-18 23:11:49 +00:00
|
|
|
SS.TW.ShowEditControl(12, ssprintf("%d", SS.TW.stepDim.steps));
|
2008-07-20 11:27:22 +00:00
|
|
|
}
|
Use C99 integer types and C++ boolean types/values
This change comprehensively replaces the use of Microsoft-standard integer
and boolean types with their C99/C++ standard equivalents, as the latter is
more appropriate for a cross-platform application. With matter-of-course
exceptions in the Win32-specific code, the types/values have been converted
as follows:
QWORD --> uint64_t
SQWORD --> int64_t
DWORD --> uint32_t
SDWORD --> int32_t
WORD --> uint16_t
SWORD --> int16_t
BYTE --> uint8_t
BOOL --> bool
TRUE --> true
FALSE --> false
The following related changes are also included:
* Added C99 integer type definitions for Windows, as stdint.h is not
available prior to Visual Studio 2010
* Changed types of some variables in the SolveSpace class from 'int' to
'bool', as they actually represent boolean settings
* Implemented new Cnf{Freeze,Thaw}Bool() functions to support boolean
variables in the Registry
* Cnf{Freeze,Thaw}DWORD() are now Cnf{Freeze,Thaw}Int()
* TtfFont::Get{WORD,DWORD}() are now TtfFont::Get{USHORT,ULONG}() (names
inspired by the OpenType spec)
* RGB colors are packed into an integer of type uint32_t (nee DWORD), but
in a few places, these were represented by an int; these have been
corrected to uint32_t
2013-10-02 05:45:13 +00:00
|
|
|
void TextWindow::ScreenStepDimGo(int link, uint32_t v) {
|
2008-07-20 11:27:22 +00:00
|
|
|
hConstraint hc = SS.TW.shown.constraint;
|
2009-04-19 05:53:16 +00:00
|
|
|
Constraint *c = SK.constraint.FindByIdNoOops(hc);
|
2008-07-20 11:27:22 +00:00
|
|
|
if(c) {
|
|
|
|
SS.UndoRemember();
|
Eliminate imperative redraws.
This commit removes Platform::Window::Redraw function, and rewrites
its uses to run on timer events. Most UI toolkits have obscure issues
with recursive event handling loops, and Emscripten is purely event-
driven and cannot handle imperative redraws at all.
As a part of this change, the Platform::Timer::WindUp function
is split into three to make the interpretation of its argument
less magical. The new functions are RunAfter (a regular timeout,
setTimeout in browser terms), RunAfterNextFrame (an animation
request, requestAnimationFrame in browser terms), and
RunAfterProcessingEvents (a request to run something after all
events for the current frame are processed, used for coalescing
expensive operations in face of input event queues).
This commit changes two uses of Redraw(): the AnimateOnto() and
ScreenStepDimGo() functions. The latter was actually broken in that
on small sketches, it would run very quickly and not animate
the dimension change at all; this has been fixed.
While we're at it, get rid of unused Platform::Window::NativePtr
function as well.
2018-07-18 23:11:49 +00:00
|
|
|
|
|
|
|
double start = c->valA, finish = SS.TW.stepDim.finish;
|
|
|
|
SS.TW.stepDim.time = GetMilliseconds();
|
|
|
|
SS.TW.stepDim.step = 1;
|
|
|
|
|
|
|
|
if(!SS.TW.stepDim.timer) {
|
|
|
|
SS.TW.stepDim.timer = Platform::CreateTimer();
|
2008-07-20 11:27:22 +00:00
|
|
|
}
|
Eliminate imperative redraws.
This commit removes Platform::Window::Redraw function, and rewrites
its uses to run on timer events. Most UI toolkits have obscure issues
with recursive event handling loops, and Emscripten is purely event-
driven and cannot handle imperative redraws at all.
As a part of this change, the Platform::Timer::WindUp function
is split into three to make the interpretation of its argument
less magical. The new functions are RunAfter (a regular timeout,
setTimeout in browser terms), RunAfterNextFrame (an animation
request, requestAnimationFrame in browser terms), and
RunAfterProcessingEvents (a request to run something after all
events for the current frame are processed, used for coalescing
expensive operations in face of input event queues).
This commit changes two uses of Redraw(): the AnimateOnto() and
ScreenStepDimGo() functions. The latter was actually broken in that
on small sketches, it would run very quickly and not animate
the dimension change at all; this has been fixed.
While we're at it, get rid of unused Platform::Window::NativePtr
function as well.
2018-07-18 23:11:49 +00:00
|
|
|
SS.TW.stepDim.timer->onTimeout = [=] {
|
|
|
|
if(SS.TW.stepDim.step <= SS.TW.stepDim.steps) {
|
|
|
|
c->valA = start + ((finish - start)*SS.TW.stepDim.step)/SS.TW.stepDim.steps;
|
|
|
|
SS.MarkGroupDirty(c->group);
|
|
|
|
SS.GenerateAll();
|
|
|
|
if(!SS.ActiveGroupsOkay()) {
|
|
|
|
// Failed to solve, so quit
|
|
|
|
return;
|
|
|
|
}
|
|
|
|
SS.TW.stepDim.step++;
|
|
|
|
|
|
|
|
const int64_t STEP_MILLIS = 50;
|
|
|
|
int64_t time = GetMilliseconds();
|
|
|
|
if(time - SS.TW.stepDim.time < STEP_MILLIS) {
|
|
|
|
SS.TW.stepDim.timer->RunAfterNextFrame();
|
|
|
|
} else {
|
|
|
|
SS.TW.stepDim.timer->RunAfter(time - SS.TW.stepDim.time - STEP_MILLIS);
|
|
|
|
}
|
|
|
|
SS.TW.stepDim.time = time;
|
|
|
|
} else {
|
|
|
|
SS.TW.GoToScreen(Screen::LIST_OF_GROUPS);
|
|
|
|
SS.ScheduleShowTW();
|
|
|
|
}
|
|
|
|
SS.GW.Invalidate();
|
|
|
|
};
|
|
|
|
SS.TW.stepDim.timer->RunAfterNextFrame();
|
2008-07-20 11:27:22 +00:00
|
|
|
}
|
|
|
|
}
|
2016-05-05 05:54:05 +00:00
|
|
|
void TextWindow::ShowStepDimension() {
|
2009-04-19 05:53:16 +00:00
|
|
|
Constraint *c = SK.constraint.FindByIdNoOops(shown.constraint);
|
2008-07-20 11:27:22 +00:00
|
|
|
if(!c) {
|
Convert all enumerations to use `enum class`.
Specifically, take the old code that looks like this:
class Foo {
enum { X = 1, Y = 2 };
int kind;
}
... foo.kind = Foo::X; ...
and convert it to this:
class Foo {
enum class Kind : uint32_t { X = 1, Y = 2 };
Kind kind;
}
... foo.kind = Foo::Kind::X;
(In some cases the enumeration would not be in the class namespace,
such as when it is generally useful.)
The benefits are as follows:
* The type of the field gives a clear indication of intent, both
to humans and tools (such as binding generators).
* The compiler is able to automatically warn when a switch is not
exhaustive; but this is currently suppressed by the
default: ssassert(false, ...)
idiom.
* Integers and plain enums are weakly type checked: they implicitly
convert into each other. This can hide bugs where type conversion
is performed but not intended. Enum classes are strongly type
checked.
* Plain enums pollute parent namespaces; enum classes do not.
Almost every defined enum we have already has a kind of ad-hoc
namespacing via `NAMESPACE_`, which is now explicit.
* Plain enums do not have a well-defined ABI size, which is
important for bindings. Enum classes can have it, if specified.
We specify the base type for all enums as uint32_t, which is
a safe choice and allows us to not change the numeric values
of any variants.
This commit introduces absolutely no functional change to the code,
just renaming and change of types. It handles almost all cases,
except GraphicsWindow::pending.operation, which needs minor
functional change.
2016-05-20 08:31:20 +00:00
|
|
|
shown.screen = Screen::LIST_OF_GROUPS;
|
2008-07-20 11:27:22 +00:00
|
|
|
Show();
|
|
|
|
return;
|
|
|
|
}
|
|
|
|
|
2015-11-06 08:40:12 +00:00
|
|
|
Printf(true, "%FtSTEP DIMENSION%E %s", c->DescriptionString().c_str());
|
2008-07-20 11:27:22 +00:00
|
|
|
|
Eliminate imperative redraws.
This commit removes Platform::Window::Redraw function, and rewrites
its uses to run on timer events. Most UI toolkits have obscure issues
with recursive event handling loops, and Emscripten is purely event-
driven and cannot handle imperative redraws at all.
As a part of this change, the Platform::Timer::WindUp function
is split into three to make the interpretation of its argument
less magical. The new functions are RunAfter (a regular timeout,
setTimeout in browser terms), RunAfterNextFrame (an animation
request, requestAnimationFrame in browser terms), and
RunAfterProcessingEvents (a request to run something after all
events for the current frame are processed, used for coalescing
expensive operations in face of input event queues).
This commit changes two uses of Redraw(): the AnimateOnto() and
ScreenStepDimGo() functions. The latter was actually broken in that
on small sketches, it would run very quickly and not animate
the dimension change at all; this has been fixed.
While we're at it, get rid of unused Platform::Window::NativePtr
function as well.
2018-07-18 23:11:49 +00:00
|
|
|
if(stepDim.isDistance) {
|
2015-11-06 08:40:12 +00:00
|
|
|
Printf(true, "%Ba %Ftstart%E %s", SS.MmToString(c->valA).c_str());
|
2010-05-09 18:25:23 +00:00
|
|
|
Printf(false, "%Bd %Ftfinish%E %s %Fl%Ll%f[change]%E",
|
Eliminate imperative redraws.
This commit removes Platform::Window::Redraw function, and rewrites
its uses to run on timer events. Most UI toolkits have obscure issues
with recursive event handling loops, and Emscripten is purely event-
driven and cannot handle imperative redraws at all.
As a part of this change, the Platform::Timer::WindUp function
is split into three to make the interpretation of its argument
less magical. The new functions are RunAfter (a regular timeout,
setTimeout in browser terms), RunAfterNextFrame (an animation
request, requestAnimationFrame in browser terms), and
RunAfterProcessingEvents (a request to run something after all
events for the current frame are processed, used for coalescing
expensive operations in face of input event queues).
This commit changes two uses of Redraw(): the AnimateOnto() and
ScreenStepDimGo() functions. The latter was actually broken in that
on small sketches, it would run very quickly and not animate
the dimension change at all; this has been fixed.
While we're at it, get rid of unused Platform::Window::NativePtr
function as well.
2018-07-18 23:11:49 +00:00
|
|
|
SS.MmToString(stepDim.finish).c_str(), &ScreenStepDimFinish);
|
2008-07-20 11:27:22 +00:00
|
|
|
} else {
|
2010-05-09 18:25:23 +00:00
|
|
|
Printf(true, "%Ba %Ftstart%E %@", c->valA);
|
|
|
|
Printf(false, "%Bd %Ftfinish%E %@ %Fl%Ll%f[change]%E",
|
Eliminate imperative redraws.
This commit removes Platform::Window::Redraw function, and rewrites
its uses to run on timer events. Most UI toolkits have obscure issues
with recursive event handling loops, and Emscripten is purely event-
driven and cannot handle imperative redraws at all.
As a part of this change, the Platform::Timer::WindUp function
is split into three to make the interpretation of its argument
less magical. The new functions are RunAfter (a regular timeout,
setTimeout in browser terms), RunAfterNextFrame (an animation
request, requestAnimationFrame in browser terms), and
RunAfterProcessingEvents (a request to run something after all
events for the current frame are processed, used for coalescing
expensive operations in face of input event queues).
This commit changes two uses of Redraw(): the AnimateOnto() and
ScreenStepDimGo() functions. The latter was actually broken in that
on small sketches, it would run very quickly and not animate
the dimension change at all; this has been fixed.
While we're at it, get rid of unused Platform::Window::NativePtr
function as well.
2018-07-18 23:11:49 +00:00
|
|
|
stepDim.finish, &ScreenStepDimFinish);
|
2008-07-20 11:27:22 +00:00
|
|
|
}
|
2010-05-09 18:25:23 +00:00
|
|
|
Printf(false, "%Ba %Ftsteps%E %d %Fl%Ll%f%D[change]%E",
|
Eliminate imperative redraws.
This commit removes Platform::Window::Redraw function, and rewrites
its uses to run on timer events. Most UI toolkits have obscure issues
with recursive event handling loops, and Emscripten is purely event-
driven and cannot handle imperative redraws at all.
As a part of this change, the Platform::Timer::WindUp function
is split into three to make the interpretation of its argument
less magical. The new functions are RunAfter (a regular timeout,
setTimeout in browser terms), RunAfterNextFrame (an animation
request, requestAnimationFrame in browser terms), and
RunAfterProcessingEvents (a request to run something after all
events for the current frame are processed, used for coalescing
expensive operations in face of input event queues).
This commit changes two uses of Redraw(): the AnimateOnto() and
ScreenStepDimGo() functions. The latter was actually broken in that
on small sketches, it would run very quickly and not animate
the dimension change at all; this has been fixed.
While we're at it, get rid of unused Platform::Window::NativePtr
function as well.
2018-07-18 23:11:49 +00:00
|
|
|
stepDim.steps, &ScreenStepDimSteps);
|
2008-07-20 11:27:22 +00:00
|
|
|
|
|
|
|
Printf(true, " %Fl%Ll%fstep dimension now%E", &ScreenStepDimGo);
|
|
|
|
|
|
|
|
Printf(true, "(or %Fl%Ll%fcancel operation%E)", &ScreenHome);
|
|
|
|
}
|
|
|
|
|
2010-05-16 16:36:23 +00:00
|
|
|
//-----------------------------------------------------------------------------
|
|
|
|
// When we're creating tangent arcs (as requests, not as some parametric
|
|
|
|
// thing). User gets to specify the radius, and whether the old untrimmed
|
|
|
|
// curves are kept or deleted.
|
|
|
|
//-----------------------------------------------------------------------------
|
Use C99 integer types and C++ boolean types/values
This change comprehensively replaces the use of Microsoft-standard integer
and boolean types with their C99/C++ standard equivalents, as the latter is
more appropriate for a cross-platform application. With matter-of-course
exceptions in the Win32-specific code, the types/values have been converted
as follows:
QWORD --> uint64_t
SQWORD --> int64_t
DWORD --> uint32_t
SDWORD --> int32_t
WORD --> uint16_t
SWORD --> int16_t
BYTE --> uint8_t
BOOL --> bool
TRUE --> true
FALSE --> false
The following related changes are also included:
* Added C99 integer type definitions for Windows, as stdint.h is not
available prior to Visual Studio 2010
* Changed types of some variables in the SolveSpace class from 'int' to
'bool', as they actually represent boolean settings
* Implemented new Cnf{Freeze,Thaw}Bool() functions to support boolean
variables in the Registry
* Cnf{Freeze,Thaw}DWORD() are now Cnf{Freeze,Thaw}Int()
* TtfFont::Get{WORD,DWORD}() are now TtfFont::Get{USHORT,ULONG}() (names
inspired by the OpenType spec)
* RGB colors are packed into an integer of type uint32_t (nee DWORD), but
in a few places, these were represented by an int; these have been
corrected to uint32_t
2013-10-02 05:45:13 +00:00
|
|
|
void TextWindow::ScreenChangeTangentArc(int link, uint32_t v) {
|
2010-05-16 16:36:23 +00:00
|
|
|
switch(link) {
|
|
|
|
case 'r': {
|
Convert all enumerations to use `enum class`.
Specifically, take the old code that looks like this:
class Foo {
enum { X = 1, Y = 2 };
int kind;
}
... foo.kind = Foo::X; ...
and convert it to this:
class Foo {
enum class Kind : uint32_t { X = 1, Y = 2 };
Kind kind;
}
... foo.kind = Foo::Kind::X;
(In some cases the enumeration would not be in the class namespace,
such as when it is generally useful.)
The benefits are as follows:
* The type of the field gives a clear indication of intent, both
to humans and tools (such as binding generators).
* The compiler is able to automatically warn when a switch is not
exhaustive; but this is currently suppressed by the
default: ssassert(false, ...)
idiom.
* Integers and plain enums are weakly type checked: they implicitly
convert into each other. This can hide bugs where type conversion
is performed but not intended. Enum classes are strongly type
checked.
* Plain enums pollute parent namespaces; enum classes do not.
Almost every defined enum we have already has a kind of ad-hoc
namespacing via `NAMESPACE_`, which is now explicit.
* Plain enums do not have a well-defined ABI size, which is
important for bindings. Enum classes can have it, if specified.
We specify the base type for all enums as uint32_t, which is
a safe choice and allows us to not change the numeric values
of any variants.
This commit introduces absolutely no functional change to the code,
just renaming and change of types. It handles almost all cases,
except GraphicsWindow::pending.operation, which needs minor
functional change.
2016-05-20 08:31:20 +00:00
|
|
|
SS.TW.edit.meaning = Edit::TANGENT_ARC_RADIUS;
|
2016-01-26 11:19:52 +00:00
|
|
|
SS.TW.ShowEditControl(3, SS.MmToString(SS.tangentArcRadius));
|
2010-05-16 16:36:23 +00:00
|
|
|
break;
|
|
|
|
}
|
|
|
|
|
|
|
|
case 'a': SS.tangentArcManual = !SS.tangentArcManual; break;
|
2018-07-22 18:56:28 +00:00
|
|
|
case 'm': SS.tangentArcModify = !SS.tangentArcModify; break;
|
2010-05-16 16:36:23 +00:00
|
|
|
}
|
|
|
|
}
|
2016-05-05 05:54:05 +00:00
|
|
|
void TextWindow::ShowTangentArc() {
|
2010-05-16 16:36:23 +00:00
|
|
|
Printf(true, "%FtTANGENT ARC PARAMETERS%E");
|
|
|
|
|
|
|
|
Printf(true, "%Ft radius of created arc%E");
|
|
|
|
if(SS.tangentArcManual) {
|
|
|
|
Printf(false, "%Ba %s %Fl%Lr%f[change]%E",
|
2015-11-06 08:40:12 +00:00
|
|
|
SS.MmToString(SS.tangentArcRadius).c_str(),
|
2010-05-16 16:36:23 +00:00
|
|
|
&(TextWindow::ScreenChangeTangentArc));
|
|
|
|
} else {
|
|
|
|
Printf(false, "%Ba automatic");
|
|
|
|
}
|
|
|
|
|
|
|
|
Printf(false, "");
|
2015-11-05 19:39:27 +00:00
|
|
|
Printf(false, " %Fd%f%La%s choose radius automatically%E",
|
2010-05-16 16:36:23 +00:00
|
|
|
&ScreenChangeTangentArc,
|
|
|
|
!SS.tangentArcManual ? CHECK_TRUE : CHECK_FALSE);
|
2018-07-22 18:56:28 +00:00
|
|
|
Printf(false, " %Fd%f%Lm%s modify original entities%E",
|
2010-05-16 16:36:23 +00:00
|
|
|
&ScreenChangeTangentArc,
|
2018-07-22 18:56:28 +00:00
|
|
|
SS.tangentArcModify ? CHECK_TRUE : CHECK_FALSE);
|
2010-05-16 16:36:23 +00:00
|
|
|
|
|
|
|
Printf(false, "");
|
|
|
|
Printf(false, "To create a tangent arc at a point,");
|
|
|
|
Printf(false, "select that point and then choose");
|
|
|
|
Printf(false, "Sketch -> Tangent Arc at Point.");
|
2010-05-17 01:54:19 +00:00
|
|
|
Printf(true, "(or %Fl%Ll%fback to home screen%E)", &ScreenHome);
|
2010-05-16 16:36:23 +00:00
|
|
|
}
|
|
|
|
|
2008-06-23 08:37:12 +00:00
|
|
|
//-----------------------------------------------------------------------------
|
|
|
|
// The edit control is visible, and the user just pressed enter.
|
|
|
|
//-----------------------------------------------------------------------------
|
2018-07-12 19:29:44 +00:00
|
|
|
void TextWindow::EditControlDone(std::string s) {
|
2010-01-04 00:35:28 +00:00
|
|
|
edit.showAgain = false;
|
|
|
|
|
2008-06-23 08:37:12 +00:00
|
|
|
switch(edit.meaning) {
|
2018-07-12 19:29:44 +00:00
|
|
|
case Edit::TIMES_REPEATED:
|
|
|
|
if(Expr *e = Expr::From(s, /*popUpError=*/true)) {
|
2008-06-23 08:37:12 +00:00
|
|
|
SS.UndoRemember();
|
|
|
|
|
2008-07-09 06:13:49 +00:00
|
|
|
double ev = e->Eval();
|
|
|
|
if((int)ev < 1) {
|
2017-01-07 06:41:13 +00:00
|
|
|
Error(_("Can't repeat fewer than 1 time."));
|
2008-07-09 06:13:49 +00:00
|
|
|
break;
|
|
|
|
}
|
2010-09-18 02:20:08 +00:00
|
|
|
if((int)ev > 999) {
|
2017-01-07 06:41:13 +00:00
|
|
|
Error(_("Can't repeat more than 999 times."));
|
2010-09-18 02:20:08 +00:00
|
|
|
break;
|
|
|
|
}
|
2008-07-09 06:13:49 +00:00
|
|
|
|
2009-04-19 05:53:16 +00:00
|
|
|
Group *g = SK.GetGroup(edit.group);
|
2008-07-09 06:13:49 +00:00
|
|
|
g->valA = ev;
|
|
|
|
|
Convert all enumerations to use `enum class`.
Specifically, take the old code that looks like this:
class Foo {
enum { X = 1, Y = 2 };
int kind;
}
... foo.kind = Foo::X; ...
and convert it to this:
class Foo {
enum class Kind : uint32_t { X = 1, Y = 2 };
Kind kind;
}
... foo.kind = Foo::Kind::X;
(In some cases the enumeration would not be in the class namespace,
such as when it is generally useful.)
The benefits are as follows:
* The type of the field gives a clear indication of intent, both
to humans and tools (such as binding generators).
* The compiler is able to automatically warn when a switch is not
exhaustive; but this is currently suppressed by the
default: ssassert(false, ...)
idiom.
* Integers and plain enums are weakly type checked: they implicitly
convert into each other. This can hide bugs where type conversion
is performed but not intended. Enum classes are strongly type
checked.
* Plain enums pollute parent namespaces; enum classes do not.
Almost every defined enum we have already has a kind of ad-hoc
namespacing via `NAMESPACE_`, which is now explicit.
* Plain enums do not have a well-defined ABI size, which is
important for bindings. Enum classes can have it, if specified.
We specify the base type for all enums as uint32_t, which is
a safe choice and allows us to not change the numeric values
of any variants.
This commit introduces absolutely no functional change to the code,
just renaming and change of types. It handles almost all cases,
except GraphicsWindow::pending.operation, which needs minor
functional change.
2016-05-20 08:31:20 +00:00
|
|
|
if(g->type == Group::Type::ROTATE) {
|
2008-07-09 06:13:49 +00:00
|
|
|
// If the group does not contain any constraints, then
|
|
|
|
// set the numerical guess to space the copies uniformly
|
|
|
|
// over one rotation. Don't touch the guess if we're
|
|
|
|
// already constrained, because that would break
|
|
|
|
// convergence.
|
2018-01-04 01:56:04 +00:00
|
|
|
if(g->GetNumConstraints() == 0) {
|
2009-09-18 08:14:15 +00:00
|
|
|
double copies = (g->skipFirst) ? (ev + 1) : ev;
|
|
|
|
SK.GetParam(g->h.param(3))->val = PI/(2*copies);
|
2008-07-09 06:13:49 +00:00
|
|
|
}
|
|
|
|
}
|
2008-06-23 08:37:12 +00:00
|
|
|
|
|
|
|
SS.MarkGroupDirty(g->h);
|
|
|
|
}
|
|
|
|
break;
|
2018-07-12 19:29:44 +00:00
|
|
|
|
|
|
|
case Edit::GROUP_NAME:
|
|
|
|
if(s.empty()) {
|
2017-01-07 06:41:13 +00:00
|
|
|
Error(_("Group name cannot be empty"));
|
2008-06-23 08:37:12 +00:00
|
|
|
} else {
|
|
|
|
SS.UndoRemember();
|
|
|
|
|
2009-04-19 05:53:16 +00:00
|
|
|
Group *g = SK.GetGroup(edit.group);
|
2015-11-06 08:40:12 +00:00
|
|
|
g->name = s;
|
2008-06-23 08:37:12 +00:00
|
|
|
}
|
|
|
|
break;
|
2018-07-12 19:29:44 +00:00
|
|
|
|
|
|
|
case Edit::GROUP_SCALE:
|
|
|
|
if(Expr *e = Expr::From(s, /*popUpError=*/true)) {
|
2009-12-15 12:26:22 +00:00
|
|
|
double ev = e->Eval();
|
|
|
|
if(fabs(ev) < 1e-6) {
|
2017-01-07 06:41:13 +00:00
|
|
|
Error(_("Scale cannot be zero."));
|
2009-12-15 12:26:22 +00:00
|
|
|
} else {
|
|
|
|
Group *g = SK.GetGroup(edit.group);
|
|
|
|
g->scale = ev;
|
|
|
|
SS.MarkGroupDirty(g->h);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
break;
|
2018-07-12 19:29:44 +00:00
|
|
|
|
Convert all enumerations to use `enum class`.
Specifically, take the old code that looks like this:
class Foo {
enum { X = 1, Y = 2 };
int kind;
}
... foo.kind = Foo::X; ...
and convert it to this:
class Foo {
enum class Kind : uint32_t { X = 1, Y = 2 };
Kind kind;
}
... foo.kind = Foo::Kind::X;
(In some cases the enumeration would not be in the class namespace,
such as when it is generally useful.)
The benefits are as follows:
* The type of the field gives a clear indication of intent, both
to humans and tools (such as binding generators).
* The compiler is able to automatically warn when a switch is not
exhaustive; but this is currently suppressed by the
default: ssassert(false, ...)
idiom.
* Integers and plain enums are weakly type checked: they implicitly
convert into each other. This can hide bugs where type conversion
is performed but not intended. Enum classes are strongly type
checked.
* Plain enums pollute parent namespaces; enum classes do not.
Almost every defined enum we have already has a kind of ad-hoc
namespacing via `NAMESPACE_`, which is now explicit.
* Plain enums do not have a well-defined ABI size, which is
important for bindings. Enum classes can have it, if specified.
We specify the base type for all enums as uint32_t, which is
a safe choice and allows us to not change the numeric values
of any variants.
This commit introduces absolutely no functional change to the code,
just renaming and change of types. It handles almost all cases,
except GraphicsWindow::pending.operation, which needs minor
functional change.
2016-05-20 08:31:20 +00:00
|
|
|
case Edit::GROUP_COLOR: {
|
2010-08-14 19:00:25 +00:00
|
|
|
Vector rgb;
|
2018-07-12 19:29:44 +00:00
|
|
|
if(sscanf(s.c_str(), "%lf, %lf, %lf", &rgb.x, &rgb.y, &rgb.z)==3) {
|
2010-08-14 19:00:25 +00:00
|
|
|
rgb = rgb.ClampWithin(0, 1);
|
|
|
|
|
|
|
|
Group *g = SK.group.FindByIdNoOops(SS.TW.shown.group);
|
|
|
|
if(!g) break;
|
|
|
|
g->color = RGBf(rgb.x, rgb.y, rgb.z);
|
|
|
|
|
|
|
|
SS.MarkGroupDirty(g->h);
|
|
|
|
SS.GW.ClearSuper();
|
|
|
|
} else {
|
2017-01-07 06:41:13 +00:00
|
|
|
Error(_("Bad format: specify color as r, g, b"));
|
2010-08-14 19:00:25 +00:00
|
|
|
}
|
|
|
|
break;
|
|
|
|
}
|
2018-07-12 19:29:44 +00:00
|
|
|
case Edit::GROUP_OPACITY:
|
|
|
|
if(Expr *e = Expr::From(s, /*popUpError=*/true)) {
|
2015-03-26 10:30:12 +00:00
|
|
|
double alpha = e->Eval();
|
|
|
|
if(alpha < 0 || alpha > 1) {
|
2017-01-07 06:41:13 +00:00
|
|
|
Error(_("Opacity must be between zero and one."));
|
2015-03-26 10:30:12 +00:00
|
|
|
} else {
|
|
|
|
Group *g = SK.GetGroup(edit.group);
|
|
|
|
g->color.alpha = (int)(255.1f * alpha);
|
|
|
|
SS.MarkGroupDirty(g->h);
|
|
|
|
SS.GW.ClearSuper();
|
|
|
|
}
|
|
|
|
}
|
|
|
|
break;
|
2018-07-12 19:29:44 +00:00
|
|
|
|
|
|
|
case Edit::TTF_TEXT:
|
2008-06-30 09:09:17 +00:00
|
|
|
SS.UndoRemember();
|
2018-07-12 19:29:44 +00:00
|
|
|
if(Request *r = SK.request.FindByIdNoOops(edit.request)) {
|
2015-11-06 08:40:12 +00:00
|
|
|
r->str = s;
|
2008-06-30 09:09:17 +00:00
|
|
|
SS.MarkGroupDirty(r->group);
|
|
|
|
}
|
|
|
|
break;
|
2018-07-12 19:29:44 +00:00
|
|
|
|
|
|
|
case Edit::STEP_DIM_FINISH:
|
|
|
|
if(Expr *e = Expr::From(s, /*popUpError=*/true)) {
|
Eliminate imperative redraws.
This commit removes Platform::Window::Redraw function, and rewrites
its uses to run on timer events. Most UI toolkits have obscure issues
with recursive event handling loops, and Emscripten is purely event-
driven and cannot handle imperative redraws at all.
As a part of this change, the Platform::Timer::WindUp function
is split into three to make the interpretation of its argument
less magical. The new functions are RunAfter (a regular timeout,
setTimeout in browser terms), RunAfterNextFrame (an animation
request, requestAnimationFrame in browser terms), and
RunAfterProcessingEvents (a request to run something after all
events for the current frame are processed, used for coalescing
expensive operations in face of input event queues).
This commit changes two uses of Redraw(): the AnimateOnto() and
ScreenStepDimGo() functions. The latter was actually broken in that
on small sketches, it would run very quickly and not animate
the dimension change at all; this has been fixed.
While we're at it, get rid of unused Platform::Window::NativePtr
function as well.
2018-07-18 23:11:49 +00:00
|
|
|
if(stepDim.isDistance) {
|
|
|
|
stepDim.finish = SS.ExprToMm(e);
|
2018-07-12 19:29:44 +00:00
|
|
|
} else {
|
Eliminate imperative redraws.
This commit removes Platform::Window::Redraw function, and rewrites
its uses to run on timer events. Most UI toolkits have obscure issues
with recursive event handling loops, and Emscripten is purely event-
driven and cannot handle imperative redraws at all.
As a part of this change, the Platform::Timer::WindUp function
is split into three to make the interpretation of its argument
less magical. The new functions are RunAfter (a regular timeout,
setTimeout in browser terms), RunAfterNextFrame (an animation
request, requestAnimationFrame in browser terms), and
RunAfterProcessingEvents (a request to run something after all
events for the current frame are processed, used for coalescing
expensive operations in face of input event queues).
This commit changes two uses of Redraw(): the AnimateOnto() and
ScreenStepDimGo() functions. The latter was actually broken in that
on small sketches, it would run very quickly and not animate
the dimension change at all; this has been fixed.
While we're at it, get rid of unused Platform::Window::NativePtr
function as well.
2018-07-18 23:11:49 +00:00
|
|
|
stepDim.finish = e->Eval();
|
2018-07-12 19:29:44 +00:00
|
|
|
}
|
2008-07-20 11:27:22 +00:00
|
|
|
}
|
|
|
|
break;
|
2018-07-12 19:29:44 +00:00
|
|
|
|
Convert all enumerations to use `enum class`.
Specifically, take the old code that looks like this:
class Foo {
enum { X = 1, Y = 2 };
int kind;
}
... foo.kind = Foo::X; ...
and convert it to this:
class Foo {
enum class Kind : uint32_t { X = 1, Y = 2 };
Kind kind;
}
... foo.kind = Foo::Kind::X;
(In some cases the enumeration would not be in the class namespace,
such as when it is generally useful.)
The benefits are as follows:
* The type of the field gives a clear indication of intent, both
to humans and tools (such as binding generators).
* The compiler is able to automatically warn when a switch is not
exhaustive; but this is currently suppressed by the
default: ssassert(false, ...)
idiom.
* Integers and plain enums are weakly type checked: they implicitly
convert into each other. This can hide bugs where type conversion
is performed but not intended. Enum classes are strongly type
checked.
* Plain enums pollute parent namespaces; enum classes do not.
Almost every defined enum we have already has a kind of ad-hoc
namespacing via `NAMESPACE_`, which is now explicit.
* Plain enums do not have a well-defined ABI size, which is
important for bindings. Enum classes can have it, if specified.
We specify the base type for all enums as uint32_t, which is
a safe choice and allows us to not change the numeric values
of any variants.
This commit introduces absolutely no functional change to the code,
just renaming and change of types. It handles almost all cases,
except GraphicsWindow::pending.operation, which needs minor
functional change.
2016-05-20 08:31:20 +00:00
|
|
|
case Edit::STEP_DIM_STEPS:
|
Eliminate imperative redraws.
This commit removes Platform::Window::Redraw function, and rewrites
its uses to run on timer events. Most UI toolkits have obscure issues
with recursive event handling loops, and Emscripten is purely event-
driven and cannot handle imperative redraws at all.
As a part of this change, the Platform::Timer::WindUp function
is split into three to make the interpretation of its argument
less magical. The new functions are RunAfter (a regular timeout,
setTimeout in browser terms), RunAfterNextFrame (an animation
request, requestAnimationFrame in browser terms), and
RunAfterProcessingEvents (a request to run something after all
events for the current frame are processed, used for coalescing
expensive operations in face of input event queues).
This commit changes two uses of Redraw(): the AnimateOnto() and
ScreenStepDimGo() functions. The latter was actually broken in that
on small sketches, it would run very quickly and not animate
the dimension change at all; this has been fixed.
While we're at it, get rid of unused Platform::Window::NativePtr
function as well.
2018-07-18 23:11:49 +00:00
|
|
|
stepDim.steps = min(300, max(1, atoi(s.c_str())));
|
2008-07-20 11:27:22 +00:00
|
|
|
break;
|
2009-09-03 08:13:09 +00:00
|
|
|
|
2018-07-12 19:29:44 +00:00
|
|
|
case Edit::TANGENT_ARC_RADIUS:
|
|
|
|
if(Expr *e = Expr::From(s, /*popUpError=*/true)) {
|
|
|
|
if(e->Eval() < LENGTH_EPS) {
|
|
|
|
Error(_("Radius cannot be zero or negative."));
|
|
|
|
break;
|
|
|
|
}
|
|
|
|
SS.tangentArcRadius = SS.ExprToMm(e);
|
2010-05-16 16:36:23 +00:00
|
|
|
}
|
|
|
|
break;
|
|
|
|
|
2009-09-29 13:14:47 +00:00
|
|
|
default: {
|
2009-12-15 12:26:22 +00:00
|
|
|
int cnt = 0;
|
|
|
|
if(EditControlDoneForStyles(s)) cnt++;
|
|
|
|
if(EditControlDoneForConfiguration(s)) cnt++;
|
|
|
|
if(EditControlDoneForPaste(s)) cnt++;
|
2010-01-04 00:35:28 +00:00
|
|
|
if(EditControlDoneForView(s)) cnt++;
|
2016-05-18 22:51:36 +00:00
|
|
|
ssassert(cnt == 1, "Expected exactly one parameter to be edited");
|
2009-09-03 08:13:09 +00:00
|
|
|
break;
|
|
|
|
}
|
2008-06-23 08:37:12 +00:00
|
|
|
}
|
2018-07-12 19:29:44 +00:00
|
|
|
SS.GW.Invalidate();
|
2015-03-18 17:02:11 +00:00
|
|
|
SS.ScheduleShowTW();
|
2010-01-04 00:35:28 +00:00
|
|
|
|
|
|
|
if(!edit.showAgain) {
|
2010-07-12 07:51:12 +00:00
|
|
|
HideEditControl();
|
Convert all enumerations to use `enum class`.
Specifically, take the old code that looks like this:
class Foo {
enum { X = 1, Y = 2 };
int kind;
}
... foo.kind = Foo::X; ...
and convert it to this:
class Foo {
enum class Kind : uint32_t { X = 1, Y = 2 };
Kind kind;
}
... foo.kind = Foo::Kind::X;
(In some cases the enumeration would not be in the class namespace,
such as when it is generally useful.)
The benefits are as follows:
* The type of the field gives a clear indication of intent, both
to humans and tools (such as binding generators).
* The compiler is able to automatically warn when a switch is not
exhaustive; but this is currently suppressed by the
default: ssassert(false, ...)
idiom.
* Integers and plain enums are weakly type checked: they implicitly
convert into each other. This can hide bugs where type conversion
is performed but not intended. Enum classes are strongly type
checked.
* Plain enums pollute parent namespaces; enum classes do not.
Almost every defined enum we have already has a kind of ad-hoc
namespacing via `NAMESPACE_`, which is now explicit.
* Plain enums do not have a well-defined ABI size, which is
important for bindings. Enum classes can have it, if specified.
We specify the base type for all enums as uint32_t, which is
a safe choice and allows us to not change the numeric values
of any variants.
This commit introduces absolutely no functional change to the code,
just renaming and change of types. It handles almost all cases,
except GraphicsWindow::pending.operation, which needs minor
functional change.
2016-05-20 08:31:20 +00:00
|
|
|
edit.meaning = Edit::NOTHING;
|
2010-01-04 00:35:28 +00:00
|
|
|
}
|
2008-06-23 08:37:12 +00:00
|
|
|
}
|
|
|
|
|