The "glx" prefix on the names of SolveSpace's various GL helper routines
was confusingly similar to those used by official OpenGL-associated
libraries (e.g. "glu" used by the GL Utility library, and "glX" used by
GLX), and could thus give the erroneous impression that it represented a
system API rather than ordinary application logic. We thus rename these
routines to have an "ssgl" prefix, clearly identifying them with SolveSpace
while retaining some visual kinship to GL function names.
This commit consists of numerous small changes, none significant enough to
merit a commit on their own:
* Added extra braces to quash for-loop variable scoping issues for older
compilers (or "g++ -fno-for-scope")
* Appeased "unreachable code" warnings, spurious or otherwise
* Added casts to fix integer-variable signedness warnings
* Added a dummy virtual method to the VectorFileWriter class to silence the
-Wweak-vtables warning from Clang++
* Renamed some parameters in the Expr and GraphicsWindow classes to
eliminate "parameter shadows a field" warnings
* Removed an inert "0 ||" from a conditional, and changed a "&& 0" into an
"#if 0"
* Added missing elements to array/struct/class initializers to zap further
warnings
* Indented some cpp conditionals where appropriate
* Qualified some variables and functions as static to quiet "no previous
declaration" warnings
* toolbar.cpp needed to #include<icons-proto.h> to fix those same "no
previous declaration" warnings from icons.h
* Added some casts and const qualifiers to the Win32 code to address
warnings produced by g++ when compiling under MinGW
* Rewrote Cnf{Freeze,Thaw}Float() to use a union rather than pointer
aliasing; this makes g++ a lot happier
* Removed redundant #includes from win32/w32util.cpp
* With Jonathan's blessing, shortened the last line of the About dialog
text to better match the preceding lines
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
GraphicsWindow::menu[] previously recorded both item names (e.g. "Open...")
and accelerator labels ("Ctrl+O") in .label, and accelerator key/mask
values in .accel. Not only were the accelerator labels redundant given the
latter, they are not needed by GUI toolkits like FLTK, which generate them
from key/mask values.
So we remove the accelerator portion from each menu-item label, and define
a new MakeAcceleratorLabel() routine which takes a key/mask value and
returns the appropriate label. We make use of this new routine in
CreateGraphicsWindowMenus() and GraphicsWindow::ToolbarDrawOrHitTest().
* Generate icons.h and icons-proto.h in the source directory instead of
obj/, so that pre-generated copies of these files can be distributed
without being blown away by "make clean"; also updated the source files
that #include these to reflect the new location
* Compilation rules rewritten as batch-mode inference rules
* Use Windows commands instead of Unix ones ("del" instead of "rm", "move"
instead of "mv", etc.)
* Sorted the object lists
* Use tabs to indent rule bodies
The compiler gets nervous when we (for example) pass in a size_t as an int
parameter, or assign an int to a char, or assign -1 to an unsigned type. By
adding appropriate casts, we inform the compiler that, yes, we know what
we're doing.
This change also upgrades a va_arg() type from char to int, as char is
always promoted to int when passed through '...'.
String literals in C++ are implicitly typed as 'const char *', and with
this change, their const-ness is maintained when assigning them to
variables or passing them as arguments. This significantly cuts down the
number of warnings generated by the compiler.
for the tangent arc thing.
And update the version number to 1.7, in preparation for the next
release.
[git-p4: depot-paths = "//depot/solvespace/": change = 2147]
to draw those, and hit test with the mouse, and display tool tips
when the user hovers with the mouse. Also, underline links only
when they're hovered, and not otherwise.
And add a separate menu option to align the view to the active
workplane, vs. activating the active group's workplane, and
remap the bottom two graphics window toolbar icons to that and
"nearest iso view" instead of draw in 2d/3d, since people tended
to click on those without understanding and cause trouble.
And by default, we force a parallel projection; so the factory
default camera tangent is now 0.3, not 0.
[git-p4: depot-paths = "//depot/solvespace/": change = 2131]
code. This is now drawn using gl, and the bitmap font (both there
and in the graphics window) is drawn from a texture from a static
table, not from the Win32 functions, since that's ~1000x faster.
So this adds a tool to generate that table. With luck that will
also fix my font issues under WINE, which won't have to render the
TTF itself.
Still needs some cleanup, and to make all the cosmetic improvements
that I want.
[git-p4: depot-paths = "//depot/solvespace/": change = 2130]
that to the constraints.
And fix two crashing bugs, embarrassing, both chasing null pointers.
[git-p4: depot-paths = "//depot/solvespace/": change = 2031]
or lines against lines. The constraints get rather screwed up
afterwards, of course.
So make arcs with the endpoints coincident into circles, instead
of nothings; since the first split of a circle produces that.
And don't warn after deleting just point-coincident or horiz/vert
constraints as a dependency; that's just a nuisance, because it
happens too often.
[git-p4: depot-paths = "//depot/solvespace/": change = 1884]
tables in the code, which I have written in perl and am checking
in.
Also get WM_MOUSELEAVE events from win32, so that I can de-hover
everything when the mouse leaves the graphics window. And fix one
of the icons, which was 23x24 instead of 24x24.
[git-p4: depot-paths = "//depot/solvespace/": change = 1883]