Commit Graph
231 Commits
Author SHA1 Message Date
James Turner 45ac758cc9 Expose position on SGPropertyNode. 2016-12-27 11:09:07 +00:00
Stuart Buchanan da13bd9f04 Fix minor compiler warnings 2016-12-10 16:00:28 +00:00
James Turner 801d8c4af5 Revert recursive listeners for the moment.
Want to verify this is the cause of crashes inside the property code,
since if it's not we have a much bigger problem.

This means all listeners are recursive, with a parent-chain walk on each
setValue call, as has been the case since 'forever'.
2016-12-05 12:57:29 +00:00
Florent Rougon e655d41817 Rename the COMPARE, COMPARE_EP, COMPARE_EP2 and VERIFY test macros
COMPARE     -> SG_CHECK_EQUAL
COMPARE_EP  -> SG_CHECK_EQUAL_EP
COMPARE_EP2 -> SG_CHECK_EQUAL_EP2
VERIFY      -> SG_VERIFY

Also remove duplicate private definitions of these macros in test
modules, using instead those defined in simgear/misc/test_macros.hxx.
2016-12-04 21:04:40 +01:00
James Turner b5c1902a2d Tweaks to recursive listener behaviour 2016-12-03 14:09:56 +00:00
James Turner d088259739 Add aliased listener test, disabled for now. 2016-12-02 17:15:11 +00:00
James Turner d8acf44a3a Revert unintended change in listener refactoring. 2016-12-02 17:14:27 +00:00
Florent Rougon 9e0bb33d58 Fix missing include in simgear/props/props_test.cxx 2016-11-26 01:12:34 +01:00
James Turner bd88bf1126 Explicit handling of recursive listeners.
Use a different strategy for recursive listeners, and make them opt-in.
2016-11-25 16:07:18 +00:00
James Turner ea9da65b7c Expanded property unit-tests. 2016-11-25 16:07:18 +00:00
James Turner 5681fcbdc5 Unit-tests for property listener. 2016-11-22 00:19:18 +00:00
James Turner 7755f8e094 Override changes for atomic listener. 2016-11-22 00:15:14 +00:00
James Turner dd52b6af50 Remove some archaic code. 2016-10-09 11:08:17 +02:00
James Turner a636da6959 SGPath in easyXML API 2016-07-03 23:41:07 +01:00
James Turner 38c8931950 Fix debug runtime assert 2016-06-29 16:26:42 +01:00
James Turner bd896096cc Changing SGPath APIs, using SGPath in more places.
Change most places we control (i.e not helper libs) to use SGPath
to represent a path, instead of using std::string. Extend SGPath
API to explicitly expose the path in either UTF-8 or the
system 8-bit encoding.
2016-06-22 17:15:32 +01:00
Erik Hofman 1f23fb89c0 Remove the dependency on boost for STANDALONE mode 2015-12-24 14:18:53 +01:00
Torsten Dreyer e64902ae8c Amend previous patch also for PropertyObject<string> 2015-05-28 12:03:48 +02:00
Torsten Dreyer 0b1399479a PropertyObject: enable creation of property
add a create-flag to the node() method of a PropertyObject,
defaulting to false to maintain existing behaviour.
This could be used to add a listener to a non-existing property
without having to write a dummy-value beforehand.

Usage:
myPropertyObject->node() returns the corresponding node or NULL if
does not exist or has not been accessed before.
myPropertyObject->node(true) returns the corresponding node, never NULL.
If the property does not exist, it will gets created.
2015-05-27 20:18:22 +02:00
Thomas Geymayer 3bcd0bafd5 Lots of (mostly) doxygen fixes/cleanup. 2014-08-01 00:13:25 +02:00
Thomas Geymayer f41b18f064 Improve (mostly Canvas event related) documentation. 2014-07-29 23:57:59 +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 645cae184b SGConditionRef typedef. No functional changes. 2014-06-22 15:35:31 +02:00
Thomas Geymayer 820a315cbe Canvas: fix possible crash with destroyed canvasses 2014-06-01 12:12:28 +02:00
Thomas Geymayer b36cdebe8b Canvas: basic layouting system.
Support for vertical and horizontal layouts. More layouts and
widgets can be created using Nasal.
2014-05-31 02:40:59 +02:00
Thomas Geymayer 6db07373ee PropertyBasedElement: extend HTML5 (Canvas) data props interface
Allow check if property exists and removing properties.
2014-05-29 01:22:35 +02:00
Thomas Geymayer d77ba7d2db canvas::Element: setter/getter for HTML5 style data-* properties. 2014-05-28 18:11:32 +02:00
Thomas Geymayer efbec8b367 Canvas: base Elements/Canvas on SGWeakReferenced. 2014-05-06 18:10:42 +02:00
James Turner f40efe66fa Simplify copyProperties
- with initial-state save/restore gone, all uses of
copyProperties are now simple. For selective copying, use
copyPropertiesWithAttribute.
2014-03-11 08:32:33 +00:00
Thomas Geymayer 5560479665 SGPropertyNode: do not keep list of deleted children.
Get rid of the possibilty to keep delted children. This was not
used actively, required unnecessary memory for each property node
and lead to subtile bugs, as creating a node after a node with
the same path has been deleted resulted in getting the old node
back instead of a cleanly initialized one.
2014-03-06 00:39:23 +01:00
Thomas Geymayer 6b9ce935cd Write back additional attributes to PropertyList 2014-02-13 18:27:34 +01:00
Thomas Geymayer 781682f4ee Minor formatting... 2014-02-08 19:15:46 +01:00
Thomas Geymayer 13ae2f08ee Put unused attributes in the property tree while parsing.
Store unhandled xml attributes in a subnode named _attr_ for each
node on parsing propertylist files. This allows retrieving them at
a later stage where there is no access to the source xml file any
more.
2014-02-08 19:12:17 +01:00
James Turner d1942da317 Remove some debug log messages
- two uninformative ones in TextureBuilder
- very noisy one in tied-property-list
2014-01-23 13:51:18 +00:00
James Turner 16fa4d1d17 Security: fix 0777 directory permissions to 0755. 2013-12-19 14:56:23 +00:00
James Turner 890cc46825 Reset: alternate property copying strategy.
Search the tree for leaves / sub-trees with a particular attribute set.
This permits both sparse selection as well as selection by sub-tree.

(This is needed for PRESERVE attribute, and once new reset is switched
on, will enable 'normal' copyProperties to revert to ignoring
attributes completely)
2013-12-10 17:37:37 +00:00
Thomas Geymayer 42b50bd7f7 SGPropertyNode: add removeAllChildren() method 2013-12-07 13:42:15 +01:00
Thomas Geymayer 2c3f44ae11 Canvas: ensure all canvasses are destroyed
- For shutdown/reset make sure all properties describing a canvas
   are removed and also not restored after the reset.
2013-12-07 13:40:22 +01:00
James Turner 3ec9c7ae6e Canvas: clear elements in shutdown()
- without this change, elements aren't un-ref-ed and hence destroyed
until the actual dtor runs, which is too late (other systems may be
destroyed already)
2013-12-06 18:14:48 +00:00
bcoconni 8e01acaa12 Added more explicit error messages to the property lists parser.
More specifically, each time an error or a warning is issued the location of the corresponding XML tag (file name an line number) is reported.
2013-11-24 12:20:26 +01:00
Thomas Geymayer 353b7e4438 SGPropertyNode: extract enum value with getValue 2013-11-03 20:11:06 +01:00
James Turner ea49a1a07b Fix GPS activation on Windows.
Bug 1190, fix route-manager -> GPS activation on Windows
(and probably a couple of unrelated issues).
SGPropertyChangeCallback was missing a suitable copy-constructor,
leading to incorrect behaviour on compilers where the operation
is not elided. Such as MSVC.
2013-10-22 00:42:31 +01:00
Thomas Geymayer 0b197501e1 Add SGPropertyNode::setValueReadOnly.
Helper to set value of relative node and mark
read only. Use eg. for exposing configuration
and build values to the property tree.
2013-10-20 12:03:41 +02:00
Tom Paoletti 15e3e92ec2 Performance optimization: empty() instead of size()>0
empty() is guaranteed to be constant complexity for both vectors and lists, while size() has linear complexity for lists.
2013-08-16 16:48:35 +01:00
Thomas Geymayer 948db69cc9 interpolate without values is used to abort interpolating -> no warning 2013-07-04 19:46:27 +02:00
James Turner e5bca74b9d std::string namespace fixes. 2013-06-27 10:14:08 +01:00
Thomas Geymayer 9bfa6ac1a1 Restructure Canvas/PropertyBasedElement
Nodes inside the osg scenegraph now hold a strong reference to
the according canvas element. Canvas elements in turn now only
hold a weak reference to the according node. This simplifies
for example the canvas::Group as it does not need to keep a
list of children on its own anymore. This is now stored inside
the scenegraph (as it was already before).

The restructuring will also allow to use a canvas::Group for
the canvas gui inside FlightGear and share for example the
handling of stacking based on z-index.
2013-06-08 11:28:49 +02:00
Thomas Geymayer 2a6c50c893 More helper methods for Canvas and PropertyBasedElement. 2013-06-02 21:19:37 +02:00