solvespace/src
whitequark f4c01f670c Implement a resource system.
Currently, icons, fonts, etc are converted to C structures at compile
time and are hardcoded to the binary. This presents several problems:

  * Cross-compilation is complicated. Right now, it is necessary
    to be able to run executables for the target platform; this
    happens to work with wine-binfmt installed, but is rather ugly.

  * Icons can only have one resolution. On OS X, modern software is
    expected to take advantage of high-DPI ("Retina") screens and
    use so-called @2x assets when ran in high-DPI mode.

  * Localization is complicated. Win32 and OS X provide built-in
    support for loading the resource appropriate for the user's
    locale.

  * Embedding strings can only be done as raw strings, using C++'s
    R"(...)" literals. This precludes embedding sizable strings,
    e.g. JavaScript libraries as used in Three.js export, and makes
    git history less useful. Not embedding the libraries means we
    have to rely on external CDNs, which requires an Internet
    connection and adds a glaring point of failure.

  * Linux distribution guidelines are violated. All architecture-
    independent data, especially large data such as fonts, is
    expected to be in /usr/share, not in the binary.

  * Customization is impossible without recompilation. Minor
    modifications like adding a few missing vector font characters
    or adjusting localization require a complete development
    environment, which is unreasonable to expect from users of
    a mechanical CAD.

As such, this commit adds a resource system that bundles (and
sometimes builds) resources with the executable. Where they go is
platform-dependent:

  * on Win32: into resources of the executable, which allows us to
    keep distributing one file;
  * on OS X: into the app bundle;
  * on other *nix: into /usr/share/solvespace/ or ../res/ (relative
    to the executable path), the latter allowing us to run freshly
    built executables without installation.

It also subsides the platform-specific resources that are in src/.

The resource system is not yet used for anything; this will be added
in later commits.
2016-05-18 11:24:23 +00:00
..
cocoa Implement a resource system. 2016-05-18 11:24:23 +00:00
fonts Add the Ukrainian letters [ЄІЇєіїҐґ] to builtin vector font. 2016-04-08 11:01:29 +00:00
gtk Implement a resource system. 2016-05-18 11:24:23 +00:00
icons Allow rendering solid outlines using a distinct style. 2016-04-15 21:53:08 +00:00
srf Enable -Wall -Wextra -Wno-unused-parameter on GCC/Clang. 2016-05-08 00:01:35 +00:00
unix Only #include "config.h" when we need something from it. 2016-04-23 23:06:31 +00:00
win32 Implement a resource system. 2016-05-18 11:24:23 +00:00
bsp.cpp Get rid of if(!this). 2016-04-15 06:11:03 +00:00
clipboard.cpp Don't create multiple undo steps when pasting. 2016-04-08 09:54:46 +00:00
CMakeLists.txt Implement a resource system. 2016-05-18 11:24:23 +00:00
config.h.in Implement a resource system. 2016-05-18 11:24:23 +00:00
confscreen.cpp Use relative chord tolerance instead of absolute. 2016-02-13 16:16:56 +00:00
constraint.cpp DXF: create certain constraints during import. 2016-05-07 04:02:34 +00:00
constrainteq.cpp Enable and mollify -Wunused-variable. 2016-02-14 14:29:47 +00:00
describescreen.cpp Display point-circle or point-arc distance, when selected. 2016-04-08 11:21:51 +00:00
draw.cpp Rename the old "Import / Assemble" feature to "Link / Assemble". 2016-05-07 05:27:54 +00:00
drawconstraint.cpp DXF: export color as indexed, not RGB. 2016-05-17 11:47:49 +00:00
drawentity.cpp Properly fix workplane name overlapping workplane border. 2016-05-18 11:24:23 +00:00
dsc.h DXF: implement import. 2016-05-07 04:02:34 +00:00
entity.cpp DXF: export constraints with labels as DXF constraints, not pwl. 2016-02-19 23:16:36 +00:00
export.cpp Three.js: various control improvements. 2016-05-06 17:42:01 +00:00
exportstep.cpp Use a separate value of chord tolerance for exporting. 2016-02-13 16:16:47 +00:00
exportvector.cpp DXF: export the right supplementary angle. 2016-05-17 12:34:35 +00:00
expr.cpp Get rid of if(!this). 2016-04-15 06:11:03 +00:00
expr.h Remove unused Expr operations ENTITY and POINT. 2016-01-13 06:45:17 +00:00
file.cpp When opening imported files, first try relative path. 2016-05-17 14:44:33 +00:00
generate.cpp In GenerateAll, accept explicitly permitted redundant sketches as OK. 2016-05-07 05:43:16 +00:00
glhelper.cpp Enable -Wall -Wextra -Wno-unused-parameter on GCC/Clang. 2016-05-08 00:01:35 +00:00
graphicswin.cpp Rename the old "Import / Assemble" feature to "Link / Assemble". 2016-05-07 05:27:54 +00:00
group.cpp Rename the old "Import / Assemble" feature to "Link / Assemble". 2016-05-07 05:27:54 +00:00
groupmesh.cpp Rename the old "Import / Assemble" feature to "Link / Assemble". 2016-05-07 05:27:54 +00:00
importdxf.cpp DXF: import "actual measurement" for dimensions. 2016-05-17 12:34:35 +00:00
lib.cpp Enable -Wall -Wextra -Wno-unused-parameter on GCC/Clang. 2016-05-08 00:01:35 +00:00
mesh.cpp Fix incorrect condition ordering that causes a crash. 2016-05-04 04:34:03 +00:00
modify.cpp Allow adding spline points. 2016-04-15 06:11:03 +00:00
mouse.cpp DXF: export color as indexed, not RGB. 2016-05-17 11:47:49 +00:00
polygon.cpp Enable -Wall -Wextra -Wno-unused-parameter on GCC/Clang. 2016-05-08 00:01:35 +00:00
polygon.h Allow rendering solid outlines using a distinct style. 2016-04-15 21:53:08 +00:00
request.cpp Allow removing spline points. 2016-04-15 06:11:03 +00:00
resource.cpp Implement a resource system. 2016-05-18 11:24:23 +00:00
resource.h Implement a resource system. 2016-05-18 11:24:23 +00:00
sketch.h DXF: export color as indexed, not RGB. 2016-05-17 11:47:49 +00:00
solvespace.cpp Implement a resource system. 2016-05-18 11:24:23 +00:00
solvespace.h Implement a resource system. 2016-05-18 11:24:23 +00:00
style.cpp DXF: implement import. 2016-05-07 04:02:34 +00:00
system.cpp Enable and mollify -Wunused-variable. 2016-02-14 14:29:47 +00:00
textscreens.cpp Enable -Wall -Wextra -Wno-unused-parameter on GCC/Clang. 2016-05-08 00:01:35 +00:00
textwin.cpp Fix empty space at the end of the tooltips. 2016-04-23 04:38:32 +00:00
toolbar.cpp Rename the old "Import / Assemble" feature to "Link / Assemble". 2016-05-07 05:27:54 +00:00
ttf.cpp Don't hold all existing system fonts open. 2016-05-07 04:20:06 +00:00
ttf.h Don't hold all existing system fonts open. 2016-05-07 04:20:06 +00:00
ui.h Rename the old "Import / Assemble" feature to "Link / Assemble". 2016-05-07 05:27:54 +00:00
undoredo.cpp Allow rendering solid outlines using a distinct style. 2016-04-15 21:53:08 +00:00
util.cpp Check entity bounding box before hit testing edges. 2016-03-05 16:48:56 +00:00
view.cpp Don't calculate halfRow for ShowEditControl manually. 2016-01-27 09:09:18 +00:00