Commit Graph
100 Commits
Author SHA1 Message Date
Thomas Geymayer b101f64cd8 cppbind.Ghost: register _set called on setting new properties. 2014-05-05 15:06:09 +02:00
Thomas Geymayer f75d1cbcb1 cppbind: disable special handling of 'parents' for ghost. 2014-05-05 14:48:29 +02:00
Thomas Geymayer ac2e80dc07 Nasal: allow ghost as 'me' for 'call' 2014-05-05 14:47:10 +02:00
Thomas Geymayer 77955e5c3c math/nasal: Add more SGRect members and nasal helper. 2014-04-15 10:07:01 +02:00
Thomas Geymayer 338a748823 Canvas::Path: also restore glBlendFunc. 2014-04-01 12:35:43 +02:00
Thomas Geymayer 8c45796dc8 Canvas::Path: reduce number of OpenGL state changes.
- Do not enable any multisampling as for FBOs it is not
   supported anyhow.
 - Just restore GL_BLEND and GL_STENCIL_TEST manually
   => Getting rid of the huge load of glPushAttrib/glPopAttrib
      gets us a huge performance boost, especially for drivers
      with slow state stack implementations.
2014-04-01 12:03:53 +02:00
Thomas Geymayer a160e176da cppbind: fix testing for naRef identity. 2014-03-31 14:21:21 +02:00
Thomas Geymayer d332da0605 Canvas: do not write bounding box to property tree.
- Prevent writing to property tree in wrong thread.
 - Add Element::getBoundingBox and
   Element::getTightBoundingBox as uniform way to
   retrieve bounding boxes of all canvas elements.
 - Update path bounding boxe in update traversal.
2014-03-31 13:28:03 +02:00
Thomas Geymayer 6ea55c6851 nasal::Ghost: remove bogus warning. 2014-03-27 12:09:05 +01:00
Thomas Geymayer 10ee7a901f ShivaVG: disable paint textures (Fixes #1414)
Currently there is no need for paint textures so just
disable them to prevent releasing OpenGL resources
from the wrong context/thread.
2014-03-27 11:20:38 +01:00
Thomas Geymayer db8b60ec49 Revert "CanvasGroup: return empty bounding box without children."
Returning somehow valid data in case it is used unchecked was
probably not a good idea. Better fix the code using it^^

This fixes #1421.

This reverts commit 3525fff8d0.
2014-03-23 17:27:30 +01:00
Thomas Geymayer 09d47e7f55 cppbind: fix problem with function call without arguments. 2014-03-22 13:23:21 +01:00
Thomas Geymayer 13a3ea3503 cppbind: allow calling methods with 'me' object from C++. 2014-03-22 12:41:47 +01:00
Thomas Geymayer ff53792e4f CanvasImage: rename 'file' to 'src'. 2014-03-20 11:42:02 +01:00
Thomas Geymayer fd51518d92 CanvasImage: improve fetching from http and add mime detection. 2014-03-20 01:44:31 +01:00
Thomas Geymayer 01a43b49a5 Canvas: Respect clipping while event handling. 2014-03-19 18:21:25 +01:00
Thomas Geymayer 3525fff8d0 CanvasGroup: return empty bounding box without children.
Return an invalid bounding box can lead to problems
if used unchecked. Just returning an empty bounding
box (size 0x0 and position at the origin of the
element) is much safer.
2014-03-19 16:31:17 +01:00
Thomas Geymayer 6c75e2fe3c CanvasImage: support for http protocol.
- Download and display images.
2014-03-18 18:33:44 +01:00
Thomas Geymayer f28e3fc9bb Canvas: fix position for drag events and multiclick handling.
- Calculate local/client position for every drag event
   instead of just reporting the position of the initial
   mousedown event.
 - Only pressing the same button multiple times increases
   the mouse clickcount.
2014-03-15 14:53:08 +01:00
Thomas Geymayer 80e77b8372 Canvas: set button for drag events. 2014-03-15 00:40:48 +01:00
Thomas Geymayer c851c449da cppbind: Do not derive from SGReferenced if there is no need 2014-03-12 17:40:21 +01:00
Thomas Geymayer b2d9385f46 cppbind: fix possible usage of expired object from Nasal 2014-03-11 15:40:26 +01: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 aa27a09801 MouseEvent: comply with DOM Level 3 and add some getter. 2014-03-04 17:58:37 +01:00
Thomas Geymayer 91b92c5613 animation: fix for 'textrapezoid' animation outside 'texmultiple'. 2014-02-26 17:48:11 +01:00
Thomas Geymayer b2cedc5332 Canvas: Fix crash on hide/show after detaching element from scenegraph. 2014-02-22 01:51:54 +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 4a10806352 SubsystemMgr: helper to remove all subsystems. 2014-02-08 19:15:14 +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
Thomas Geymayer 3e8aeccc87 New textrapezoid TexTransformAnimation.
Allows trapezoid texture transformations, as needed for example to
correct for the tilt angle of HUD combiners.
2014-02-08 12:39:43 +01:00
Thomas Geymayer de39e0093a Canvas: Fix bounding box calculation for paths with subpaths. 2014-02-08 00:22:36 +01:00
Thomas Geymayer 943f52aedf Canvas::Element: expose combined transformation matrix 2014-02-06 17:55:51 +01:00
Thomas Geymayer c54b1e037a SGPath: typo... 2014-01-28 00:42:20 +01:00
Thomas Geymayer 0d19be2196 SGPath: generalize retrieving standard locations (and add more) 2014-01-28 00:32:08 +01:00
Thomas Geymayer 0428adff03 CanvasMap: Expose property screen-range.
Only allowing a hardcoded screen range of 200 units
is not very flexible...
2014-01-09 19:36:38 +01:00
Thomas Geymayer d82c8eb945 Socket: do not crash on writing to broken pipe.
Writing to a closed socket on all Unix/Linux systems raises
a SIGPIPE signal which immediately closes the program. Disabling
raising of SIGPIPE allows proper error handling by checking the
return values of send/sendto and getting the EPIPE in errno.
2014-01-06 12:17:59 +01:00
Thomas Geymayer 2335796a28 Fix track-to animation basic tracking without slave object 2014-01-05 19:38:03 +01:00
Thomas Geymayer aea71cf0af HTTPFileRequest: only save file if status == 200 2013-12-30 01:31:47 +01:00
Thomas Geymayer 8dccbe8029 SGPath: some tweaks/fixes/typo on permission checker. 2013-12-12 21:27:27 +01:00
Thomas Geymayer 031c833e4d SGPath: add support for custom PermissionChecker
Allow to add permission checks (read/write-access) for
eg. limiting access based on IORules.
2013-12-12 21:04:26 +01:00
Thomas Geymayer 7a220921f0 Canvas: one global SystemAdapter is enough.
This also fixes elements requiring a SystemAdapter without
being assigned to a Canvas (eg. because they are desktop
elements).
2013-12-09 23:07:17 +01:00
Thomas Geymayer 7ef9acda5d Add ListDiff helper (for fast array differences). 2013-12-08 18:48:57 +01:00
Thomas Geymayer 2a6d62e6f7 Fix some unused/uninitialized variables. 2013-12-07 13:43:17 +01: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
Thomas Geymayer 7c5434a99f cppbind: don't leak nasal references for Ghost methods. 2013-12-04 11:15:11 +01:00
Thomas Geymayer 66193d7283 cppbind: Fix detecting derived Ghosts 2013-12-01 12:35:02 +01:00
Thomas Geymayer dfb07f359e cppbind: make ghost_type static to keep same pointer on reset.
Using a static naGhostType ensures that always the same
address is used for the same ghost and prevents ghost_types
from getting invalid (eg. on reset).
2013-12-01 01:18:13 +01:00
Thomas Geymayer 6fe1433497 Canvas: allow removing placement factories. 2013-11-24 15:39:03 +01:00
Thomas Geymayer 743244a69c CanvasElement: ensure parent pointer can not become invalid. 2013-11-10 17:12:50 +01:00
Thomas Geymayer 9f89737986 track-to animation: fix "short" and "long" tracking. 2013-11-10 11:14:50 +01:00
Thomas Geymayer 508a5c5f66 track-to animation: 2dof rotation for slave object.
Slave objects can now rotate around two axis to always track the
target - even when it is outside the plane perpendicular to the
lock-axis of the root object. This allows for example animating
levers with non-parallel axis of rotation connected with a rod.
2013-11-08 00:51:18 +01:00
Thomas Geymayer ec4d3e4f9b Make new gcc happy (include cmath) 2013-11-04 10:48:26 +01:00
Thomas Geymayer 38ddfab1e0 Canvas: improved clipping and new property clip-frame.
- Update clipping rect if canvas view or texture size
   changes.
 - Add new property "clip-frame" to specify coordinate
   frame for "clip" coordinates. Coordinates can be
   global, relative to the parent or relative to the
   element itself.
2013-11-03 20:12:45 +01:00
Thomas Geymayer 353b7e4438 SGPropertyNode: extract enum value with getValue 2013-11-03 20:11:06 +01:00
Thomas Geymayer 7076c9a0ff HTTP: finish core request before calling any callback. 2013-10-28 20:34:11 +01:00
Thomas Geymayer fdf6fc32ff HTTPFileRequest: create directory if it does not exist 2013-10-28 12:38:39 +01:00
Thomas Geymayer f2188b33c6 HTTP: Rename urlretrieve/urlload to save/load. 2013-10-27 23:38:46 +01:00
Thomas Geymayer f93fead8f2 io: refactor and improve HTTP modules.
- refactor code used multiple times spread over sg/fg into
   one single location.
 - allow aborting requests.
 - Provide two common request types:
  * FileRequest: Save response into file
  * MemoryRequest: Keep resonse in memory (std::string)
 - extend HTTP::Client interface:
  * urlretrieve: Save url to file (shortcut for making a
                 FileRequest)
  * urlload: Get respons into memory (shortcut for making
             a MemoryRequest)
2013-10-27 19:05:49 +01:00
Thomas Geymayer 050f3791cc New class simgear::Map extending std::map interface. 2013-10-27 19:05:49 +01:00
Thomas Geymayer 7cbfa76be4 cppbind: automatic conversion of SGReferenced derived pointers. 2013-10-26 01:04:16 +02:00
Thomas Geymayer ca79d99ec4 canvas::Element: add getter for parent element. 2013-10-23 17:11:03 +02: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
Thomas Geymayer 9b68062ba7 Add helper to get osg::Node path as string. 2013-10-17 13:28:54 +02:00
Thomas Geymayer b217019723 Nasal: do not print invalid elements for error backtraces. 2013-10-16 23:33:06 +02:00
Thomas Geymayer a37a254a68 Canvas: simplify code by using new nasal function conversion. 2013-10-15 17:46:42 +02:00
Thomas Geymayer 5258699f20 cppbind: convert Nasal functions to C++ boost::function. 2013-10-15 17:46:31 +02:00
Thomas Geymayer 483bebb003 cppbind: fix bad class hierarchy for bad_nasal_cast. 2013-10-15 16:38:38 +02:00
Thomas Geymayer 8ca8052a8d Nasal: use correct function pointer in naCall (with user data) 2013-10-15 14:21:45 +02:00
Thomas Geymayer d68b1144b8 Nasal: recursive method calling.
New functions naCallMethodCtx and naCallMethod to replace
NasalSystem::callMethod from FlightGear. This has just added an
unneeded level of indirection and fits better directly into Nasal.
naSetErrorHandler can be used to register an error handler/logging
function.
2013-10-15 12:08:42 +02:00
Thomas Geymayer 42c39b6be3 Canvas: use new naGCSave/naGCRelease functions. 2013-10-15 00:49:13 +02:00
Thomas Geymayer bb82b9d168 Nasal: add naGCSave/naGCRelease for preventing objects being garbage collected.
These new functions are meant to replace the gcSave/gcRelease
methods of the NasalSystem class in FlightGear, as passing an
adapter to SimGear from FlightGear is quite a lot of useless work
just for being able to save objects.
2013-10-15 00:19:32 +02:00
Thomas Geymayer b1f865d461 cppbind: add to_nasal_helper for enums. 2013-10-14 23:03:36 +02:00
Thomas Geymayer 8e75c6be50 HTTP: check url for scheme and report instead of failing with assert. 2013-10-13 12:06:17 +02:00
Thomas Geymayer 06a5f9188d Don't let exceptions escape from commands. 2013-10-13 12:00:52 +02:00
Thomas Geymayer 370a991208 cppbind: Catch exceptions before reaching C code. 2013-10-13 11:40:27 +02:00
Thomas Geymayer 6deb77dd4d Canvas: allow also C++ callable entities as event callbacks. 2013-10-12 00:29:37 +02:00
Thomas Geymayer 021cf1a2b4 Remove temporary file and add to .gitignore 2013-09-07 14:28:46 +02:00
Thomas Geymayer b468254d73 Fix #1163 2013-08-17 17:47:23 +02:00
Thomas Geymayer a284107249 Canvas: ensure render order equals order in property tree.
Prevents also changing the render order if changing eg. the size
of a Canvas.
2013-07-26 23:31:46 +02:00
Thomas Geymayer b236821661 Canvas: Ensure all element types are initialized before first usage.
If setting properties on a group a check is performed if
this property exists on any possible child element, and
only if this is the case the property is stored in the
groups style.

Previously elements have been only initialized during
their first usage, leading to ignored styles if they
have been set on a parent element before instantiating
an instance of the actual element type.
2013-07-20 15:45:02 +02:00
Thomas Geymayer fc75b0bd21 Canvas::Text: add line-height property. 2013-07-19 23:38:08 +02:00
Thomas Geymayer a9fc84d568 Canvas: clip region rounding and catch negative size. 2013-07-19 23:37:04 +02:00
Thomas Geymayer b15c6d887d Canvas: don't crash with invalid clip rect 2013-07-18 15:35:44 +02:00
Thomas Geymayer c2f89978ff canvas::Element: Fix bounding box calculation of groups 2013-07-18 14:16:13 +02:00
Thomas Geymayer dde2bbcbe7 nasal::String: add ends_with method 2013-07-15 22:26:11 +02:00
Thomas Geymayer 7bd572f3ec Fix inverted checks... 2013-07-13 14:06:11 +02:00
Thomas Geymayer 486011dceb Fix for OSG without OSG_INIT_SINGLETON_PROXY 2013-07-13 11:37:24 +02:00
Thomas Geymayer 01c45633b7 Canvas::Group: Print warning message if using expired Group instead of crashing 2013-07-12 18:00:53 +02:00
Thomas Geymayer 5320d0ecaa Fix render order of canvas elements 2013-07-12 16:13:06 +02:00
Thomas Geymayer 757ba03918 CSSBorder fix: width/height swapped 2013-07-06 12:05:19 +02:00
Thomas Geymayer 948db69cc9 interpolate without values is used to abort interpolating -> no warning 2013-07-04 19:46:27 +02:00
Thomas Geymayer 92f363926e Replace auto_ptr to prevent possible undefined behavior 2013-07-04 16:09:04 +02:00
Thomas Geymayer d0ff144753 Canvas: Fix removing text elements.
Removing text elements failed due to prefering removing the
style property with the same name. Add a flag to each style
indicating whether it can be inherited. The text property
is only applicable to text elements and can not be inherited.
Now groups can not have a text property, avoiding the name
clash with the text element.
2013-07-04 14:11:54 +02:00
Thomas Geymayer 943efbb3ed Canvas Event System: add missing currentTarget field. 2013-07-04 00:53:49 +02:00
Thomas Geymayer 6962de4b1f Canvas: fix property inheritance.
- Do not override style of children if they have own values set.
 - Retrieve style of parent if own style value has been removed.
2013-07-03 00:05:20 +02:00
Thomas Geymayer 6f7c0c23d1 Canvas: prevent bubbling of mouseenter and mouseleave. 2013-06-30 21:27:03 +02:00
Thomas Geymayer 14eccc70da Restore compatibility with stable OSG (3.0.1) 2013-06-30 21:25:21 +02:00
Thomas Geymayer d4b48cec5d Canvas: clear mousedown/click if mouse leaves canvas. 2013-06-29 14:29:38 +02:00