Commit Graph

838 Commits (3cd9c28ebc9ad20c891fe06b6c2e496492c62a0e)

Author SHA1 Message Date
Jonathan Westhues 403d3c04d2 Improve relative paths for file import.
Don't break on case-sensitive filesystems, and don't require an explicit
regen after initial save of the assembly.
2015-05-21 05:26:29 -07:00
Jonathan Westhues 044a4ea8fc Don't offset SVG width and height by one. 2015-04-12 14:24:55 -07:00
Jonathan Westhues 9c9a0d8c28 Merge commit 'refs/merge-requests/16' of https://gitorious.org/solvespace/solvespace 2015-03-10 22:50:31 -07:00
Marc Britten 3b587d022a Updated Freeze to be multi monitor friendly 2015-03-10 22:05:29 -05:00
Roland Lutz 48880f6fe9 Apply automake option `subdir-objects' globally 2015-03-02 21:46:11 +01:00
Roland Lutz 6c4eacf237 Add files generated by autotools to `.gitignore' 2015-03-02 21:46:11 +01:00
Roland Lutz 8401dbd84a Use separate directories for macros and auxiliary build tools 2015-03-02 21:46:11 +01:00
Roland Lutz f2cbdd36a9 Don't remove autoconf cache/backup files automatically 2015-03-02 21:46:11 +01:00
Roland Lutz a9590dc271 Treat automake warnings as errors 2015-03-02 21:46:11 +01:00
Roland Lutz 790b241f56 Fix automake warning about missing `AM_PROG_AR' 2015-03-02 21:46:11 +01:00
Roland Lutz 40552a0066 Always enable warnings, even when not using `autogen.sh' 2015-03-02 21:46:11 +01:00
Roland Lutz 8d0c2f77ec Don't try to distribute files that don't exist 2015-03-02 21:46:11 +01:00
Roland Lutz f5e4e02bac Remove duplicate entries from list of distributed files 2015-03-02 21:46:11 +01:00
Roland Lutz f5de3faedb Remove missing script from list of distributed files 2015-03-02 21:46:11 +01:00
Roland Lutz 9b68bf8f7b Move library source to src/ directory 2015-03-02 21:46:11 +01:00
Roland Lutz ae37fb783e Control libslvs compilation from src/Makefile.am 2015-03-02 21:46:11 +01:00
Roland Lutz 413ab5f578 Move library header to include/ directory 2015-03-02 21:46:11 +01:00
Roland Lutz 2622684ed5 Force object renaming to avoid constraint.o being overwritten
The GUI application and library share some object files but don't
enable object renaming resulting in the second compilation overwriting
the results of the first compilation.  This can be fixed by setting
explicit preprocessor flags for one compilation.  The actual problem,
however, is that recursive make is used in an inappropriate way; two
Makefiles shouldn't refer to the same source files.  In this case,
libslvs should be under src/ and handled by the same Makefile, in
which case the issue would have been obvious when the Makefile was
written in the first place.
2015-03-02 21:46:11 +01:00
Roland Lutz 3b4897c833 Add check for GL/GLU library
Requested by yugami:
> might I suggest explicitly including libGL as well as libpng.
> One of the previous builders errors needed that explicitly added in
2015-03-02 21:46:11 +01:00
Roland Lutz afdf3145b2 Add missing check for PNG library
As Peter Stuge pointed out, it works anyway if fltk is built with png
support because solvespace uses the flags returned by fltk-config.
If fltk was built with png support enabled, these include -lpng.
2015-03-02 21:46:11 +01:00
Andrew Downing 6cfa884406 fix GraphicsEditControlWindow placement, and fix error due to cmath being included instead of math.h 2015-02-26 12:22:42 -05:00
Andrew Downing 252f4128b7 add includes to dsc.h to fix errors in it's own context (not real errors since dsc.h isnt compiled by itself, just screws up the code model in QtCreator without them) 2015-02-26 09:19:15 -05:00
Andrew Downing 023f404475 add LDFLAGS for FLTK to exposed/Makefile.am and src/Makefile.am 2015-02-25 22:47:35 -05:00
Andrew Downing ce77197dac display GraphicsEditControl in its own tooltip window avoiding the need to hack FLTKs internals 2015-02-25 12:43:01 -05:00
Andrew Downing 396b1c63a4 fix fltk code 2015-02-24 16:07:32 -05:00
Andrew Downing 1bfba0df5f fix fltk code 2015-02-24 15:54:27 -05:00
Marc Britten 0f334cc040 Added updated header information for surfaces 2015-02-08 10:43:19 -06:00
Petteri Aimonen 12a29ddce0 FLTK: Don't oops() when unknown mouse button is pressed.
For example forward/backward buttons are present on many mouses
but are not used by solvespace. This oops() caused solvespace to
crash whenever those buttons were (accidentally) pressed.
2014-12-29 22:33:19 +02:00
Petteri Aimonen 8996833989 Fix crash on Ubuntu when opening assembly files.
Ubuntu enables GCC's buffer overflow checks by default. In SAVEDptr
union, the path was declared as 'char', even though MAX_PATH memory
was actually allocated. The buffer overflow check mistakenly thought
that the buffer size was only 1 and aborted the program whenever it
tried to read a path from a file.
2014-12-29 22:16:21 +02:00
Jonathan Westhues e587d0ebee Fix GUI bugs in FLTK port, per Xavier Thomas's forum post:
"There was some small but annoying bugs with the FLTK port:
-cursor disappear sometimes
-not all the area of the windows (graphic and text windows) is accessible
by the mouse after a re-size
-input widget for editing constraints value are not correctly placed"
2014-05-11 15:43:03 -07:00
Ilya Novoselov f5297093c0 Fix automake "option 'subdir-objects' is disabled" warning 2014-04-10 23:05:17 +06:00
Ilya Novoselov 01213bcafb Rest of code assumes that allocated memory is filled with zeroes 2014-04-08 07:56:57 +06:00
Jonathan Westhues f4916f9ee4 Compare ((char *)p)[0] against '\0', not (char *)p.
Also make the library example compile again under MSVC, and make the
perl scripts to build the image tables work.
2013-12-08 00:32:50 -08:00
Daniel Richard G 1bc73c4a75 Renamed the RGB() macro to RGBi() to avoid collisions with Microsoft
Microsoft defines an RGB() macro that at one point was compatible with our
version (returning a packed integer containing 8-bit red, green and blue
channels), but is no longer, and the incompatibility led to an awkward
situation in w32main.cpp where we had to restore Microsoft's form of the
macro in order for the commctrl.h header to compile. By renaming the macro
to RGBi()---analogous to the RGBf() macro we already define---we avoid the
hassle entirely.
2013-12-02 04:27:34 -05:00
Daniel Richard G f9f321ca84 Warning fixes 2013-12-02 04:27:33 -05:00
Daniel Richard G 3cc520e98c Overhauled the exposed/ Makefile for MSVC++ 2013-12-02 04:27:33 -05:00
Daniel Richard G fd9dc19a34 Added the exposed/ library and demo program to the Autotools build
The libslvs library and CDemo program can now be built by Autotools. A few
code changes were needed for this: C++ comments in C code had to be
converted, constraint.cpp required some massaging, and fltkutil.cpp needed
a stub for InitHeaps().
2013-12-02 04:27:33 -05:00
Daniel Richard G 6c68294249 Improved handling of generated files
Place a pre-built copy of generated source files in src/built/, so that
users building SolveSpace from Git without the tools or setup necessary to
generate these can still complete the process.

Makefile.msvc: Use slashes consistently, and added rules to copy files from
src/built/ if needed

configure.ac: Check for presence of src/built/ at configure time

src/Makefile.am: Handle the generated *.table.h files together with
icon*.h; updated the source-generation rules so that the files are created
in builddir, not srcdir; added rules to copy files from src/built/ if
needed
2013-11-20 01:25:48 -05:00
Daniel Richard G 174ed76ef9 Added libspnav configure option and support to the Autotools build system 2013-11-19 18:17:55 -05:00
Daniel Richard G 4dffdb20e2 Added a .gitattributes file
This will allow checkouts of the SolveSpace source tree on Unix and Windows
to use the system's native line endings (i.e. LF vs. CRLF), while keeping
Unix line endings in the repository.

Created using the template at

	https://help.github.com/articles/dealing-with-line-endings
2013-11-19 18:17:55 -05:00
Daniel Richard G bb3e5e9bb1 Minor follow-up changes
solvespace.h: Need to #define MAX_PATH on POSIX systems

resource.rc: icon.ico now lives in the same directory as this file
2013-11-19 18:17:55 -05:00
Daniel Richard G 0a24cf40f0 Moved most of the source into a src/ subdirectory
The SolveSpace top-level directory was getting a bit cluttered, so
following the example of numerous other free-software projects, we move the
main application source into a subdirectory and adjust the build systems
accordingly.

Also, got rid of the obj/ directory in favor of creating it on the fly in
Makefile.msvc.
2013-11-19 18:17:32 -05:00
Daniel Richard G 5429295492 Use a union for pointer polymorphism in the .slvs file I/O routines
The .slvs file I/O code was using "*((type *)pointer) = value" type-punning
dereferences, which are syntactically unwieldy and prone to annoying modern
compilers. A union pointer is more elegant, and better expresses the
polymorphism at issue.
2013-11-13 00:46:40 -05:00
Daniel Richard G 442197c907 Updated the bundled LibPNG/zlib, and polished the MSVC makefile further
The bundled copies of LibPNG and zlib have been updated to the versions
shipped with FLTK (as these were convenient to build), and I've put in new
static libraries compiled with Visual Studio 2003 .NET. These libraries
link cleanly even with Visual Studio 2013 Express, so they should work for
just about every version of MSVC out there that can compile SolveSpace.

The MSVC makefile is also now a little nicer, and the SpaceWare Input
library header #includes have been adjusted to drop the si/ prefix (for
consistency with how LibPNG/zlib are handled).
2013-11-13 00:33:23 -05:00
Daniel Richard G 3a46c97fd0 Reorganized the extlib/ subdirectory
LibPNG and zlib have been moved into their own subdirectories, consistent
with the SpaceWare Input library
2013-11-13 00:23:06 -05:00
Jonathan Westhues 511c513035 Oops, fix Style.fillColor export/import too. 2013-11-03 15:41:11 -08:00
Jonathan Westhues f09ae15586 Fix broken colors in file import/export.
The move to RgbColor() missed the code that reads and writes Style.color
and Group.color. Also clarify redefinition of RGB() in w32main.cpp.
2013-11-03 15:09:17 -08:00
Daniel Richard G c60e3dd34e Initial Autotools and FLTK support
With this commit, SolveSpace gains an Autotools build system and a new
platform-dependent backend implemented using the FLTK GUI toolkit. These
will allow the application to be built and run on Linux and other Unix-like
operating systems, and prospectively, MacOS X.

A number of new files have been added:

* Makefile.am: Automake makefile template; this contains some experimental
  support for MinGW and MSVC++ builds that needs further development

* ac-aux/ax_fltk.m4: Autoconf M4 macro to locate and query the system's
  installation of FLTK; this will eventually be contributed to the GNU
  Autoconf Archive

* autogen.sh: Script to bootstrap the Autotools build system, usually for a
  tree just checked out from source control

* configure.ac: Source for the Autoconf configure script; note that this
  file specifies a version of 2.1, near the top

* fltk/fltkmain.cpp: Main FLTK backend implementation

* fltk/fltkutil.cpp: Utility functions for the FLTK backend

* fltk/xFl_Gl_Window_Group.{H,cxx}: Implementation of a new
  Fl_Gl_Window_Group widget for FLTK, needed to facilitate drawing FLTK
  widgets on top of OpenGL graphics as SolveSpace does. This has been
  submitted to the FLTK project for (hopefully) eventual upstream
  inclusion:

    http://www.fltk.org/str.php?L2992

The following minor changes are also a part of this commit:

* Makefile.msvc: Define PACKAGE_VERSION=2.1 for the benefit of
  solvespace.cpp in MSVC++ builds

* solvespace.cpp: In the About dialog text, use PACKAGE_VERSION rather than
  hard-coding the version of the program

* solvespace.h: Don't define the C99 integer types if
  HAVE_C99_INTEGER_TYPES is defined, to facilitate MinGW builds
2013-10-28 01:28:42 -04:00
Daniel Richard G 7ca137f5fe Changed GetMilliseconds() to return a 64-bit value
This function previously returned an int32_t. Presuming that it measures
the length of time since the application was started, the 32-bit type would
cause the returned value to wrap from 2^31-1 to -2^31 after a little less
than twenty-five days.
2013-10-28 00:43:38 -04:00
Daniel Richard G 873811d865 Preliminary changes for FLTK support
* Added "Show Menu Bar" and "Full Screen" menu items, which will be
  implemented in the FLTK interface. These are currently prevented from
  appearing in the Win32 interface by the HAVE_FLTK and
  HAVE_FLTK_FULLSCREEN macros.

* Moved the "Show Text Window" down below the "Show Toolbar" item, so that
  "Show Menu Bar", "Show Toolbar" and "Show Text Window" are in the same
  vertical order as their corresponding UI elements typically take on

* Added new platform-dependent routines to back the new menu items:

    void ToggleMenuBar(void);
    bool MenuBarIsVisible(void);
    void ToggleFullScreen(void);
    bool FullScreenIsActive(void);

  These are stubs in the Win32 code.

* Fleshed out the system header #includes in solvespace.h, and moved them
  to the top of the file per convention

* Rewrote the file dialog selection patterns in terms of macros that allow
  them to expand to either the FLTK or Windows formats

* Don't use __stdcall in SSGL_CALLBACK, and make SSGL_CALLBACK 'extern "C"'
  as OpenGL usually expects function pointers to point to C functions
2013-10-28 00:43:38 -04:00