Thomas Geymayer
62ae6ca35e
Mostly canvas doxygen improvements and C++11 refactoring.
2018-03-02 09:07:01 +01:00
Thomas Geymayer
711a4fe0c8
canvas::Map: Preserve default values without new values
...
Ensure default values are used (instead of 0) if no values are
specified.
2018-03-01 09:10:24 +01:00
Thomas Geymayer
a653d67aae
canvas: Event improvements and new events (dragstart, dragend)
2018-02-25 14:50:49 +01:00
Thomas Geymayer
37bc43c7aa
canvas::Path: support for stroke-opacity and fill-opacity
2018-01-29 09:07:04 +01:00
Thomas Geymayer
4edd3f45b7
canvas: Refactor and protect against expired pointers
2018-01-28 15:57:14 +01:00
Thomas Geymayer
087ea4c5f3
canvas: Refactor with C++11
2018-01-28 00:49:05 +01:00
Thomas Geymayer
5cb2360985
cppbind: Use separet Context::to_nasal_vec instead of overload
2018-01-23 16:15:56 +01:00
Thomas Geymayer
b831d2b64a
cppbind: Fix for old g++
2018-01-23 14:02:18 +01:00
Thomas Geymayer
e81597a176
cppbind: Opimize convert fixed size arrays and more type_traits
2018-01-23 09:30:00 +01:00
Thomas Geymayer
db3725880e
cppbind: simplify with 'auto'
2018-01-21 14:39:24 +01:00
Thomas Geymayer
af5833cbc5
cppbind: Refactor to use C++11+ type_traits
2018-01-21 13:21:55 +01:00
Thomas Geymayer
8a128a57cd
cppbind: forward declarations
2018-01-19 10:34:37 +01:00
Thomas Geymayer
3dca9b8a68
cppbind: Make Mac and Windows happy and add forward declaration
2018-01-19 10:24:33 +01:00
Thomas Geymayer
5f8f5a1c33
cppbind: More refactoring and finally getting rid of boost.preprocessor
2018-01-19 09:12:11 +01:00
Thomas Geymayer
5a72a7d9f4
canvas: Refactor Path::addSegment with std::initializer_list
2018-01-16 09:01:55 +01:00
Thomas Geymayer
4cedd0a346
cppbind: refactor Ghost::method to use variadic templates
2018-01-12 08:32:57 +01:00
Thomas Geymayer
b989f4085d
Various doxygen improvements/fixes.
2018-01-12 08:32:04 +01:00
Thomas Geymayer
19cc797c41
cppbind: fix exporting integer_sequence and small codingstyle fixes
2018-01-12 07:57:17 +01:00
Thomas Geymayer
99ee3d9dec
cppbind: nasal::Context refactoring and doxygen improvements.
2018-01-09 22:50:29 +01:00
Thomas Geymayer
ca30d6bb3d
Add missing simgear_config.h include
...
Required for HAVE_STD_INDEX_SEQUENCE to be properly set.
2018-01-02 11:37:46 +01:00
Thomas Geymayer
ebd2cdb7a7
SGPickAnimation: fix member initialization order
2018-01-02 09:13:14 +01:00
Thomas Geymayer
52b8f60953
Add std::index_sequence for C++11
...
Will be required for nasal::Ghost
2018-01-02 08:00:49 +01:00
Thomas Geymayer
68053d64b5
function_list<>: Simplify with C++11
2017-12-04 08:47:51 +01:00
Thomas Geymayer
15d5c878f3
canvas::NasalWidget: don't call unsafe method in destructor
...
Calling a virtual method in a destructor has undefined behaviour.
Furthermore passing 'this' to nasal from within the destructor
is not safe. 'onRemove' is called for widgets within layouts
on destruction anyhow, so no need to call it here again. If widgets
are arranged manually without any layout 'onRemoved' should be
called upon removing them from a dialog.
2017-12-01 08:14:44 +01:00
Thomas Geymayer
4f63c3f8a8
nasal::Object: Simplify with C++11
...
C++11 variadic templates finally allow us to get rid of the
ugly boost preprocessor workaround.
2017-12-01 07:32:49 +01:00
Thomas Geymayer
ce7d463710
Fix wrong argument
...
One more catch by Florent Rougon.
2017-11-13 08:22:14 +01:00
Thomas Geymayer
bd87d3963a
Fix leak in NasalObjectHolder
...
Thanks to Florent Rougon for spotting it.
2017-11-12 22:41:14 +01:00
Thomas Geymayer
1c25d343a0
Fix missing throw.
2016-06-09 13:03:40 +02:00
Thomas Geymayer
10e6bbc2c5
SubsystemMgr: prevent double delete and use shared pointers.
2015-11-20 12:34:46 +01:00
Thomas Geymayer
00a20409f7
Canvas: use weak pointer to protect parent element access.
...
Using a weak pointer is the best way to ensure no invalid
pointer is used. This also fixes a possible crash in
simgear::canvas::Element::getParentStyle on destructing
canvas elements.
2015-09-30 11:54:19 +02:00
Thomas Geymayer
9ea772f938
canvas::Map: remove rotation matrix on removing HDG node.
...
Return to previous rotation if autorotation to HDG is
disabled/removed.
2015-06-02 18:24:31 +02:00
Thomas Geymayer
ca7acb1f2c
canvas::Map: Property to keep children aligned to given hdg.
...
Setting the 'hdg' property on child elements will rotate
them with respect to the heading set on the map projection.
2015-02-26 22:34:21 +01:00
Thomas Geymayer
9537876bba
Nasal: add an naRef to ghosts to allow for proper gc of dependent objects/ghosts.
...
This allows for binding the lifetime of any nasal object to
the lifetime of a ghost. Otherwise circular references from
objects saved within the ghost would prevent the ghost from
being garbage collected.
2014-11-23 23:45:22 +01:00
Thomas Geymayer
deceee8997
Fix compiler warnings.
2014-09-22 18:24:13 +02:00
Thomas Geymayer
b3c7d63809
Let ENABLE_TESTS enable/disable also the new Boost.Tests.
2014-09-22 18:21:52 +02:00
Thomas Geymayer
36fd005bb9
cppbind: check if ghost is of wrong type.
...
- Throw an exception if converting an object
from Nasal fails due to a wrong type (nil
does not throw).
- Update cppbind test cases accordingly (and
refactor another test suite to use Boost.
Test).
2014-09-15 23:42:12 +02:00
Thomas Geymayer
85090180d0
canvas::Text: fix global StateSet and line start cursor pos with empty line.
2014-08-31 19:24:58 +02:00
Thomas Geymayer
088ce31f7c
canvas::KeyboardEvent: C0/C1 control characters are not printable.
2014-08-25 21:49:44 +02:00
Thomas Geymayer
4f94c22241
Canvas: add method clearFocusElement.
2014-08-25 21:49:21 +02:00
Thomas Geymayer
e1791b3006
canvas::Text: clean up and expose character/cursor positions.
2014-08-23 15:54:07 +02:00
Thomas Geymayer
35ebb16215
Canvas: prepare for keypress events.
2014-08-10 19:39:18 +02:00
Thomas Geymayer
68d0891665
Canvas: fix element mouse hit detection with OSG 3.3.2.
2014-08-10 15:37:43 +02:00
Thomas Geymayer
791273c61d
Update for OpenSceneGraph 3.3.2 API changes.
2014-08-09 18:13:45 +02:00
Thomas Geymayer
519326f751
Add simple keyboard event demo application.
2014-08-08 00:59:06 +02:00
Thomas Geymayer
d1f5d92a7b
Move canvas::AlignmentFlag to separate file.
...
Mapping in a separate file allows easier exposing of
values and string representation to Nasal.
2014-08-03 16:39:26 +02:00
Thomas Geymayer
d9b66fc0ef
canvas::Layout: support for alignment.
...
Set alignment inside layouts, taking care of where
excess space is distributed.
2014-08-03 12:02:39 +02:00
Thomas Geymayer
3bcd0bafd5
Lots of (mostly) doxygen fixes/cleanup.
2014-08-01 00:13:25 +02:00
Thomas Geymayer
942181c8ae
Canvas: Support for preventDefault() on Events.
2014-07-30 17:16:26 +02:00
Thomas Geymayer
7df39b9fc8
Fallback for old Boost (also with UTF8-CPP library).
2014-07-30 12:44:21 +02:00
Thomas Geymayer
f41b18f064
Improve (mostly Canvas event related) documentation.
2014-07-29 23:57:59 +02:00
Thomas Geymayer
c5d649aa0b
Canvas: basic Keyboard event support (with input focus).
2014-07-29 22:22:20 +02:00
Thomas Geymayer
64ac22f50c
Canvas: warn for missing tff and png plugins.
2014-07-27 12:11:09 +02:00
Thomas Geymayer
719ee36f5c
Canvas: backdrop/stroke option for text (based on Gijs patch).
2014-07-27 11:05:49 +02:00
Thomas Geymayer
92851135d4
Doxygen: disable (not working) latex output and update version.
2014-07-22 12:51:01 +02:00
Thomas Geymayer
76fc47b24b
canvas::Layout: support for contents margins.
2014-07-22 12:00:24 +02:00
Thomas Geymayer
f25abad9d7
Move overflow protected add helpers to math.
2014-07-22 11:45:28 +02:00
Thomas Geymayer
23413b4781
canvas::Layout: clear parent/canvas after calling onRemove.
2014-07-21 23:56:41 +02:00
Thomas Geymayer
e036dfc5bf
Hopefully final fix for old gcc...
2014-07-21 13:26:09 +02:00
Thomas Geymayer
9260bea850
One more fix for old gcc.
2014-07-21 12:22:33 +02:00
Thomas Geymayer
c1f09034e0
Trying to make old gcc on Jenkins happy.
2014-07-21 10:54:31 +02:00
Thomas Geymayer
557e4f75b5
canvas::Layout: support for hiding items.
2014-07-21 00:25:59 +02:00
Thomas Geymayer
e71d6b24d7
cppbind: helper to call Nasal methods on NasalWidget.
2014-07-21 00:22:15 +02:00
Thomas Geymayer
726a4c6d10
canvas::NasalWidget: check for empty setGeometry callback.
2014-07-20 23:31:32 +02:00
Thomas Geymayer
6af8d32078
cppbind: fix Ghost casting/storage in polymorphic class hierarchies.
2014-07-20 23:17:33 +02:00
Thomas Geymayer
f6b16e2ba8
canvas::Element: floating point scissor coordinates.
...
GL_SCISSOR itself only supports integer coordinates, but
with reference frames different from GLOBAL transforms
influence the position of the clipping frame, possibly
resulting in wrong positions due to too low precision.
2014-07-19 20:52:17 +02:00
Thomas Geymayer
e415b08da4
canvas::BoxLayout: fix parent ref on add/remove.
2014-07-17 15:10:35 +02:00
Thomas Geymayer
9709cfe20d
canvas::BoxLayout: set stretch factor by item.
2014-07-16 19:24:41 +02:00
Thomas Geymayer
a5e99ea996
Nasal: require 0o as prefix for octal numbers.
...
Using just 0 as prefix for octal number can lead to confusion
where numbers could be interpreted the wrong way (oct instead of
dec).
Lets follow the same convention as Python 3 and Ecma 262 level 6
and use '0o' as prefix which can not be confused inadvertently.
2014-07-14 18:51:11 +02:00
Thomas Geymayer
d9df10fe10
canvas::Layout: keep user provided size hints.
...
Don't let size hints layouted or calculated by Nasal widgets
override user provided hints.
2014-07-12 17:30:33 +02:00
Thomas Geymayer
f1677f5546
SGTrackToAnimation: supress wrong warnings.
2014-07-12 11:55:38 +02:00
Thomas Geymayer
cb796e374a
SGPropertyNode: add InterpolationMgr getter.
2014-07-12 01:07:28 +02:00
Thomas Geymayer
7c3491c679
Don't restore old canvasses on reset.
...
No need for this anymore as PRESERVE now works as expected.
Otherwise old canvasses are restored and do not work anymore
as the placements of the new canvasses do not apply.
2014-07-11 19:07:53 +02:00
Thomas Geymayer
6200b160ec
canvas::Element: fix cleanup (and hopefully crash)
2014-07-01 12:09:55 +02:00
Thomas Geymayer
9868fb03a2
pkg::Package: callback for installation start.
...
Allow eg. Aircraft Center to add listeners to packages to
be called if installation starts.
2014-06-30 18:36:15 +02:00
Thomas Geymayer
a69130ff10
pkg: Remove Install from list after uninstall.
2014-06-30 18:34:41 +02:00
Thomas Geymayer
0b60643053
HTTPRequest/pkg::Install: do not replace callbacks.
...
Keep a list of callbacks to allow registering multiple callbacks
to the same event. This is consistent with eg. jQuery.Deferred
and is needed for example to open multiple dialogs showing the
progress of installing a package at the same time.
2014-06-30 18:22:24 +02:00
Thomas Geymayer
dc4644bf3a
canvas::Widget: pass ghost to onRemove handler
2014-06-29 11:57:12 +02:00
Thomas Geymayer
38b766f845
canvas::BoxLayout: fix hfw layouting (fix updating size hint cache).
2014-06-28 13:08:06 +02:00
Thomas Geymayer
10d0be013e
fix g++ 4.4: "warning: suggest parentheses around ‘&&’ within ‘||’"
...
Warning does not make sense, but the old g++ complains...
2014-06-27 01:48:08 +02:00
Thomas Geymayer
5126ae5891
SGPath: fix creating paths with permission checker.
...
Check permission of the whole path and not to individual
directories, as none of the intermediate directories need
to be writeable by IORules.
2014-06-26 16:07:33 +02:00
Thomas Geymayer
49bcf49db1
Nasal: fix parsing octal/hex numbers in strings as well as during lexing.
...
Parse the same number formats (octal, dec, hex) in literals and tokens. Was
previously quite a mess, and is still not the best solution, as lexing and
string parsing uses different implementations, although they are meant to
do exactly the same conversions.
2014-06-26 14:21:18 +02:00
Thomas Geymayer
3bbb272ad5
nasal::Ghost: improve intrusive pointer storage and weak references.
...
- Just increment/decrement reference count for intrusive
smart pointers. No need to create an additional object
on the heap.
- Keep strong reference for weak pointer based ghosts
to prevent destroying objects while beeing used.
2014-06-23 13:14:07 +02:00
Thomas Geymayer
645cae184b
SGConditionRef typedef. No functional changes.
2014-06-22 15:35:31 +02:00
Thomas Geymayer
bd9fa7017f
ShivaVG: fix call to shCopyPixels.
...
It is not used anyhow, but just in case...
2014-06-21 13:09:29 +02:00
Thomas Geymayer
fc9f3abfbb
ShivaVG: check for zero before dividing.
2014-06-21 12:26:58 +02:00
Thomas Geymayer
f2f1b36df9
Nasal: better error message for non-numeric string.
2014-06-21 00:21:36 +02:00
Thomas Geymayer
03d2a166b7
canvas::CustomEvent: init bubbles member.
2014-06-19 13:04:21 +02:00
Thomas Geymayer
f0a76aa918
Use Boost.Test for strutils_test and add some md5/hex tests.
2014-06-18 18:22:31 +02:00
Thomas Geymayer
c144c3562c
Keep md5 inside simgear and use single encodeHex implementation.
2014-06-18 18:07:42 +02:00
Thomas Geymayer
e06f9462ab
Expose md5.h to flightgear for. Will need a better interface...
2014-06-17 22:32:40 +02:00
Thomas Geymayer
9aa5c3b2ae
Nasal: support for standard bitwise operators.
...
This makes bitwise operations a lot easier^^
2014-06-17 16:59:04 +02:00
Thomas Geymayer
2c41c25fcd
canvas::Text: get maximum width (if displayed on a single line).
2014-06-17 16:12:29 +02:00
Thomas Geymayer
9ffc0ae8bc
canvas::NasalWidget: ensure nasal part is destroyed
2014-06-16 23:45:52 +02:00
Thomas Geymayer
5024b62c0a
cppbind: queue Ghosts for deletion and delete outside gc.
2014-06-15 16:34:47 +02:00
Thomas Geymayer
82d5c605e5
canvas::Element: check if element is valid.
2014-06-15 16:30:57 +02:00
Thomas Geymayer
737b1948bf
canvas::Layout: proper cleanup/update on removing items.
2014-06-15 16:30:25 +02:00
Thomas Geymayer
1225e53162
pkg: allow 'installed' as filter criterion.
2014-06-15 13:58:12 +02:00
Thomas Geymayer
b58bf443ff
canvas::Layout: add clear method to remove all items.
2014-06-14 13:19:00 +02:00
Thomas Geymayer
9bef80fbef
Simple Markdown parser.
...
Parse just a tiny subset of Markdown, to basically collapse
multiple whitespace and do paragraphs only after two newlines.
Also one-level, unordered lists are supported. The output can
be eg. directly forwarded to canvas::Text.
2014-06-13 19:12:56 +02:00
Thomas Geymayer
36cb7a752b
canvas::Text: add heightForWidth method.
2014-06-13 00:08:57 +02:00