Commit Graph

138 Commits

Author SHA1 Message Date
app4soft
39c18a70b2 Update uk_UA.po 2021-03-20 18:04:05 -04:00
phkahler
e75f6b3647 Add Turkish translation by mhalil (Mustafa Halil). 2021-03-20 12:37:05 -04:00
phkahler
83dfcf44e2 Add new symbols to the vector font. unicode 2334, 2335, 21A7 counterbore, countersink, depth 2021-03-17 10:00:22 -04:00
ruevs
2a3f598ce0 Remove res/icons/graphics-window/Clipboard01.png added by mistake 2021-03-06 23:26:18 +02:00
ruevs
a14d8410e6 Icons: Fix non transparent pixels in line.png and pointonx.png 2021-03-06 16:04:00 -05:00
ruevs
20b0677f6c UI: Update the "Nearest isometric view" icon to a more typical view 2021-03-06 16:04:00 -05:00
ruevs
aa075259f1 UI: Update non anti aliased icons to match original ones better
Discussion here #857
2021-03-06 16:04:00 -05:00
ruevs
d3a6e96281 UI: Non anti aliased icons for the graphics and text windows
Created by jkrei0 here https://github.com/jkrei0/solvespace

Optimized for size.

Merged all but `shaded.png` since in my opinion the current
one is better.

Discussion here https://github.com/solvespace/solvespace/issues/857
2021-03-06 16:04:00 -05:00
ruevs
02aa9ea827 Update translations
Including de_DE and ru_RU strings.
2021-02-03 18:14:29 -05:00
phkahler
2e1f5324c8 Update ru_RU translation 2021-01-23 11:45:33 -05:00
Ryan Pavlik
d16e33ac48 Update to THREE.js revision 111 as found in Debian Testing
Required some small JavaScript changes to replace deprecated usage.
2021-01-23 11:38:36 -05:00
Reini Urban
36719c6234 Improved de_DE
See #890 and its changed menu item
2021-01-17 14:27:54 -05:00
ruevs
1817816b4a Update translations 2021-01-17 13:47:14 -05:00
Reini Urban
422bb0cb35 Translations: update de_DE for 3.0
See #890
make -C src translate_solvespace to update all line numbers
2021-01-17 11:45:40 -05:00
Ryan Pavlik
d6c2983c72 Update messages 2021-01-15 16:05:50 -05:00
ruevs
3abfd91e9d Win32: Update the year in the Windows version resource
Visible in right-click on solvespace.exe | Properties | Details | Copyright
2021-01-09 23:37:31 +02:00
phkahler
d45e2c4c2e
Add toolbar icons for Revolve and Helix created by jkrei0 in issue #857. (#878) 2021-01-09 12:27:27 -05:00
Reini Urban
fac093a8b3 Translations: update de_DE
for the solvespace.cpp changes.
Run make -C src translate_solvespace for updated line numbers for the rest.
2020-11-23 11:25:37 +02:00
ruevs
bdd2be6041 Translations: Add solvespace.cpp to the translations...
...since it currently contains many relevant strings.
2020-11-22 17:34:14 -05:00
phkahler
5a3f45ed2a ran make translate_solvespace. cleaned out some obsolete strings in en_US.po 2020-11-17 22:31:56 -05:00
phkahler
6b5936b2f6 remove zh_CN.mo 2020-10-20 11:46:16 -04:00
ZHOU You
2be2e428d3 Chinese translation added. 2020-10-20 11:08:34 -04:00
Reini Urban
7c766c72f4 translate_solvespace updates
for all languages. See PR #705

my russian is not good enough to fix the remaining ru and uk strings.
german and french are now complete.
2020-09-22 15:45:00 -04:00
Reini Urban
2adf5decb5 de_DE: missing translations 2020-09-18 16:39:09 -04:00
whitequark
69baf52432 Linux: fix Z-order in scalable icon. 2019-12-04 13:57:10 +00:00
Maximilian Federle
219df31c53 Linux: add support for building snap packages. 2019-09-11 10:12:53 +00:00
Maximilian Federle
cb0fdb1c28 Freedesktop: add scalable SVG icon. 2019-06-14 20:59:36 +00:00
whitequark
50c004b679 Add a button to hide construction entities.
Also, mark not just curves, but also points and normals derived from
construction requests as construction.

Also, don't always mark arc center point as construction just to
exclude it from chord tolerance bounding box calculation; instead,
special-case it there.
2019-05-23 16:29:00 +00:00
nabijaczleweli
e243396c6f Three.js: with a window-sized canvas, resize canvas with the window. 2019-05-23 14:28:10 +00:00
whitequark
e9b9dca2ca Win32: use native OpenGL drivers, if available.
After this commit, if the target system does have modern OpenGL
drivers installed, ANGLE is configured to use them, bypassing most
translation (shaders still have to be translated from ESSL to GLSL).

If there are no OpenGL drivers, such as if the graphics drivers were
installed via Windows Update, DirectX translation is still used. This
results in a very noticeable startup delay and minor performance
degradation.

In addition it is no longer necessary to build with -DOPENGL=1 to be
able to run the binary in wine; everything works out of the box.
Before, wine's incomplete HLSL translator would crash.

This change required renaming the variable `texture` in shaders,
since it shadows the Core GLSL function with the same name, and ANGLE
translates texture2D() calls to texture() calls.
2019-05-23 10:58:31 +00:00
William D. Jones
201e15e68a Three.js: update inaccurate comment. NFC. 2019-05-13 16:02:09 +00:00
whitequark
b97a80b6ed Three.js: style fixes. NFCI. 2019-05-13 16:02:09 +00:00
William D. Jones
6f9358ae95 Three.js: fix rotate and pan on HiDPI devices. 2019-05-13 16:02:09 +00:00
William D. Jones
26c8cdcb37 Three.js: fix mousemove event listener.
The mousemove event does not return button press information;
refactor into two handlers based on button press.
2019-05-13 16:02:09 +00:00
whitequark
0b7b8a40e2 Linux: add Flatpak integration.
To test it, use:
  $ ./pkg/flatpak/build.sh
  $ flatpak install ./pkg/flatpak/solvespace.flatpak
  $ flatpak run com.solvespace.SolveSpace
2019-05-11 17:04:25 +00:00
whitequark
94b26ddfac Add a built-in Bitstream Vera Sans Roman font.
Before this commit, the default font chosen for TTF text is Arial
(chosen by the basename of arial.ttf), which isn't present on most
Linux systems, and cannot be redistributed. After this commit, it is
replaced with Bitstream Vera Sans, which can be. Existing files
are not affected.

The font name in the TTF file was artificially modified to add
the (built-in) suffix, which will need to be done if more built-in
fonts are added.
2019-02-11 11:03:47 +00:00
luz.paz
258545a334 Misc. typos
Found via `codespell -q 3 --skip="./res/locales,./extlib"`
2018-09-19 18:52:11 +00:00
Alexander Meißner
bc6a923c4c macOS: fix crash on startup.
Added missing @synthesize acceptsFirstResponder;
Replaced generic ApplicationDelegate in MainMenu.xib
2018-07-31 15:55:11 +00:00
whitequark
2b4c484dcb Discard fragments with zero texture alpha in imesh_tex.frag.
This makes image requests that have an image with a hole in it
actually transparent, since otherwise the depth test would prevent
any geometry behind the request from being drawn.
2018-07-28 12:33:32 +00:00
whitequark
70177166d7 I18n: add de-DE locale. 2018-07-20 04:40:19 +00:00
whitequark
6b5db58971 Add a platform abstraction for file dialogs.
This commit merges all ad-hoc file dialog code, such as the feature
where dialogs remember last location and format, and exposes it
through a common interface.

This commit also significantly improves Gtk dialog handling code.
2018-07-17 22:33:45 +00:00
whitequark
26f3751ce8 macOS: rename application bundle to SolveSpace.
This changes the capitalization shown in GUI.
2018-07-17 15:01:58 +00:00
whitequark
f324477dd0 Implement a platform abstraction for windows.
This commit removes a large amount of code partially duplicated
between the text and the graphics windows, and opens the path to
having more than one model window on screen at any given time,
as well as simplifies platform work.

This commit also adds complete support for High-DPI device pixel
ratio. It adds support for font scale factor (a fractional factor
on top of integral device pixel ratio) on the platform side, but not
on the application side.

This commit also adds error checking to all Windows API calls
(within the abstracted code) and fixes a significant number of
misuses and non-future-proof uses of Windows API.

This commit also makes uses of Windows API idiomatic, e.g. using
the built-in vertical scroll bar, native tooltips, control
subclassing instead of hooks in the global dispatch loop, and so on.

It reinstates tooltip support and removes menu-related hacks.
2018-07-17 13:31:17 +00:00
Pierre Delore
501a4829c7 I18n: add fr_FR locale. 2018-07-14 18:21:31 +00:00
whitequark
595ae86b29 I18n: update translations. 2018-07-12 23:06:07 +00:00
whitequark
9c99f69da5 Clean up unused shader variables. 2018-07-12 11:43:25 +00:00
whitequark
20a4a2b23f Avoid using tan as identifier in shaders.
This conflicts with the tan() function, currently only on macOS.
2018-07-12 11:40:51 +00:00
luzpaz
771b415a12 Fix various comment and UI string typos. 2018-07-12 05:05:43 +00:00
Kevin Zheng
572869dd48 GTK: install MIME type specification. 2018-07-12 05:03:37 +00:00
whitequark
5078907957 I18n: regenerate. 2017-04-21 23:13:20 +00:00
EvilSpirit
ab7cdea375 I18n: add a ru_RU translation. 2017-04-21 23:09:34 +00:00
EvilSpirit
5744d1d599 Implement an image request. 2017-03-12 00:13:56 +00:00
whitequark
80c7296316 Win32: do not redefine VOS_NT_WINDOWS32/VFT_APP. 2017-02-06 11:23:06 +00:00
whitequark
5b2ad9b5f1 Fix 2d stippling of hovered and selected faces.
This was broken in ec07516.
2017-01-17 11:26:04 +00:00
whitequark
6b67cfe63f Except when using OpenGL ES 2, use OpenGL 3.2+ Core profile.
This is primarily done to lower the GTK version dependency below
GTK 3.22, since GTK 3.22 is unlikely to be widely availale any
time soon.
2017-01-13 23:43:02 +00:00
whitequark
96476ca2e5 GTK: respect the scale factor when computing coordinates.
This doesn't bring true HiDPI support yet, since there are no HiDPI
assets anyway, but it makes the interface usable.
2017-01-11 03:41:06 +00:00
whitequark
33c9ffb5ca Gettext: automatically update all translations. 2017-01-11 03:08:58 +00:00
whitequark
c12672be66 Internationalize platform-specific code. 2017-01-11 03:02:04 +00:00
whitequark
0eb33decd1 Fix typo: ua-UA → uk-UA. 2017-01-07 16:37:36 +00:00
whitequark
984f74d271 Internationalize all messages without substitutions. 2017-01-07 06:47:40 +00:00
AppSoft4
4fda1e4361 Add ua-UA translation. 2017-01-07 03:28:10 +00:00
whitequark
00dda08917 Internationalize the context menu. 2017-01-05 12:35:50 +00:00
whitequark
27ac3c7b5f Internationalize the toolbar. 2017-01-05 12:27:28 +00:00
whitequark
529e1bfd63 Internationalize the main menu. 2017-01-05 12:17:09 +00:00
Elvira Khabirova
4f04406121 Implement a gettext .po file parser. 2017-01-05 12:14:40 +00:00
whitequark
d1ddc6ee07 Win32: fix inclusion of manifest, to get back visual styles.
This commit fixes four issues:
  * Instead of WRITE,APPEND, resource.rc was generated using
    WRITE,WRITE, which erased #include <windows.h> and prevented
    any symbolic definitions (like RT_MANIFEST) from working.
    This silently included them using a string type instead,
    which did nothing.
  * WINVER is bumped to Win7, since that's what we target now.
  * Index of RT_MANIFEST is changed to 2, since that's what
    it has to be when ISOLATION_AWARE_ENABLED is defined.
  * Platform is not restricted to X86 in manifest, since there
    is no point in doing so.
2016-12-04 20:33:46 +00:00
whitequark
9301dec98d Use the same code for loading resources in all executables.
All of our executables need resources; e.g. the vector font is
a resource and it is necessary for generation. Before this commit,
the GUI executable loaded the resources in a nice way, and everything
else did it in a very ad-hoc, fragile way.

After this commit, all executables are placed in <build>/bin and
follow the same algorithm:
  * On Windows, resources are compiled and linked into every
    executable.
  * On Linux, resources are copied into <build>/res (which is
    tried first) and <prefix>/share/solvespace (which is tried
    second).
  * On macOS, resources are copied into <build>/res (which is
    tried first) and <build>/bin/solvespace.app/Contents/Resources
    (which is tried second).

In practice this means that we can add as many executables as we want
without duplicating lots of code. In addition, on macOS, we can
place supplementary executables into the bundle, and they can use
resources from the bundle transparently.
2016-11-28 06:18:42 +00:00
whitequark
c8ff17f4a2 Add OpenGL 2 support on Windows using ANGLE.
This commit performs two main changes:
  * Alters the shaders to use only strictly conformant GLSL 2.0.
  * Alters the Windows UI to use ANGLE via GL ES 2.0 and EGL 1.4.

This commit also drops official support for Windows XP, since ANGLE
requires a non-XP toolset to build. It is still possible to build
SolveSpace for Windows XP using:

  cmake -T v120_xp -DOPENGL=1
2016-11-18 11:38:45 +00:00
EvilSpirit
6d2c2aecff Implement an OpenGL 2 renderer.
There are two main reasons to desire an OpenGL 2 renderer:
 1. Compatibility. The compatibility profile, ironically, does not
    offer a lot of compatibility, and our OpenGL 1 renderer will not
    run on Android, iOS, or WebGL.
 2. Performance. The immediate mode does not scale, and in fact
    becomes very slow with only a moderate amount of lines on screen,
    and only a somewhat large amount of triangles.

This commit implements a basic OpenGL 2 renderer that uses only
features from the (OpenGL 3.2) core profile. It is not yet faster
than the OpenGL 1 renderer, primarily because it uses a lot of small
draw calls.

This commit uses OpenGL 2 on Linux and Mac OS X directly (i.e. links
to the GL symbols from version 2+); on Windows this is impossible
with the default drivers, so for now OpenGL 1 is still used there.
2016-11-18 04:04:29 +00:00
whitequark
6e860fb148 Make "Show/hide hidden lines" a tri-state button instead.
The states are:
  * Draw all lines (on top of shaded mesh).
  * Draw occluded (by shaded mesh) lines as stippled.
  * Do not draw occluded (by shaded mesh) lines.

As usual, the export output follows the screen output.
2016-08-13 09:44:08 +00:00
whitequark
8e7d2eaa84 Implement "view → set to full scale" text window command. 2016-08-01 14:03:16 +00:00
whitequark
c83421a2b5 Win32: unbreak window icon. 2016-08-01 00:46:56 +00:00
whitequark
5c754bd994 Freedesktop: don't hardcode binary path in .desktop file. 2016-06-23 11:25:57 +00:00
whitequark
a98cdeeb16 Unix: also install the SolveSpace desktop icon in the xpm format.
This is required by e.g. Debian guidelines.
2016-06-16 02:57:24 +00:00
whitequark
afafa5ec2e Three.js: allow to configure projRight/projUp.
Also, use a more appealing isometric projection if none specified,
instead of orthographic.

Also, use the scale, offset and projection from the viewport at
the time of export.
2016-06-11 23:13:59 +00:00
whitequark
44223ea332 Three.js: correctly handle browser zoom.
Before this commit, controls went wild on zoom ratios other than 1:1,
and the rendering wasn't too good either.
2016-06-11 23:13:59 +00:00
whitequark
14cbd0bbee Cocoa, Win32: embed version info into distributable application.
This shows up in crash dumps, etc, and helps track them back to
a git commit.
2016-06-03 00:07:30 +00:00
whitequark
9c08398f51 Fix glyph for U+0454 є in vector font. 2016-05-20 21:42:49 +00:00
whitequark
193477e2da GTK: set application icon. 2016-05-18 17:27:37 +00:00
whitequark
432e7680a4 Three.js: put all resources into res/threejs/ and embed on export.
This means that our exported viewer is independent of internet
connection as well as any CDNs that will eventually die.
2016-05-18 11:44:32 +00:00
whitequark
4b0dc5819b CMake: correctly define and use the add_resource function. 2016-05-18 11:24:24 +00:00
whitequark
fc79642788 Move vector font to res/fonts/; remove lff2c.
This commit integrates the vector font in the resource system, so
that cross-compilation would be easier and a custom font could be
used without recompilation.

The font handling code was carefully written to lazily load glyphs;
as possible; in practice this means that startup is less than 15ms
slower after this commit, most of it spent in inflate().

This also reduces executable size and makes compilation of
glhelper.cpp much faster.
2016-05-18 11:24:24 +00:00
whitequark
645c2d90ac Move bitmap font to res/fonts/; remove unifont2c.
This commit integrates the bitmap font in the resource system, so
that cross-compilation would be easier.

The font handling code was carefully written to do glyph parsing
lazily; in practice this means that after this commit, startup
is less than 25ms slower, most of it spent in inflate().

This should also result in faster rendering, since there is no
rampant plane switching anymore; instead, all characters that are
actually used are stashed into same one texture.
2016-05-18 11:24:24 +00:00
whitequark
a525f03371 Move icons to res/icons/; remove png2c.
This commit integrates icons in the resource system so that they
can be loaded (or reloaded, without restarting) in @2x mode, which
will be added in a future commit. png2c is no longer necessary.

png2c used to perform the following transformation:
  if(r + g + b < 11) r = g = b = 11;

This is now achieved by switching the icons to RGBA mode and adding
alpha channel with the following imagemagick invocation, which is
equivalent to the transformation above:
  for i in *.png; do
    convert -fuzz 4% -channel rgba -matte \
            -fill "rgba(255,255,255,0)" -opaque black \
            $i $i
  done

The Debian package solvespace now includes /usr/share/solvespace;
this should be split out into solvespace-data later.
2016-05-18 11:24:24 +00:00
whitequark
4c01461316 OS X: move resources to res/. 2016-05-18 11:24:23 +00:00
whitequark
e36ee32def freedesktop: move resources to res/. 2016-05-18 11:24:23 +00:00
whitequark
a6b6d98a94 Win32: move resources to res/. 2016-05-18 11:24:23 +00:00
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