Commit Graph
243 Commits
Author SHA1 Message Date
Thomas Geymayer 62ae6ca35e Mostly canvas doxygen improvements and C++11 refactoring. 2018-03-02 09:07:01 +01:00
James Turner ed5372f439 Add new PROTECTED property attribute 2018-02-04 17:10:41 +00:00
Thomas Geymayer 087ea4c5f3 canvas: Refactor with C++11 2018-01-28 00:49:05 +01:00
Thomas Geymayer b989f4085d Various doxygen improvements/fixes. 2018-01-12 08:32:04 +01:00
Florent Rougon 6283a515b9 Fix missing headers in simgear/io/DNSClient.cxx and simgear/props/props_test.cxx
<algorithm> is needed for std::sort() and std::find().
2017-11-13 10:04:34 +01:00
Richard Harrison 7be1fcc32e Add method to copy entire properry subtree 2017-10-15 16:54:36 +02:00
Florent Rougon d455f5f445 props_io.cxx: use SG_ORIGIN when throwing exceptions
This will provide more accurate info than the fixed string "SimGear
Property Reader".
2017-10-10 20:15:54 +02:00
James Turner c170f576b6 Ensure <simgear_config.h> is always included.
This is going to become important soon - prep for enabling SIMGEAR_SHARED on Windows.
2017-03-28 09:36:53 +01:00
Szymon Acedański 4e875be0dd Added SGStringValueMethods property implementation
This is to be used in places where SGRawValueMethods returning .c_str()
from local strings were used, causing use-after-free later.
2017-02-25 15:02:37 +01:00
Florent Rougon 79f869a7f3 Move IOStreams-related files to simgear/io/iostreams; rename zfstream.[ch]xx to gzfstream.[ch]xx
- Rename zfstream.cxx (resp. zfstream.hxx) to gzfstream.cxx (resp.
  gzfstream.hxx)

  This is because these files only deal with the gzip format (RFC 1952),
  while zlib can actually read and write two slightly different formats:
  this one and the "ZLIB Compressed Data Format" (RFC 1950). Since I am
  going to add std::streambuf and std::istream subclasses able to deal
  with both formats (and supporting data sources that are general
  std::istream instances, not just files), this renaming will make
  things a bit clearer, I hope.

- Add new folder simgear/io/iostreams and move the following files to
  this folder:

    simgear/misc/gzcontainerfile.cxx
    simgear/misc/gzcontainerfile.hxx
    simgear/misc/gzfstream.cxx
    simgear/misc/gzfstream.hxx
    simgear/misc/sgstream.cxx
    simgear/misc/sgstream.hxx
    simgear/misc/sgstream_test.cxx

- Adapt other files accordingly (mainly #includes and CMakeLists.txt
  files).
2017-02-12 21:18:52 +01:00
James Turner c3f48c7261 Use sg_ofstream in one more place. 2017-02-07 16:05:06 +00:00
James Turner a6437f4e96 More SGPropertyNode::getPositions tests. 2017-01-28 15:37:41 +00:00
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