Commit Graph
100 Commits
Author SHA1 Message Date
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
Thomas Geymayer 2d23c5351f Canvas: Improve checks to mark events as handled. 2013-06-29 14:16:39 +02:00
Thomas Geymayer b5dfaf170a Canvas: Ensure events are dispatched to canvas with no element hit. 2013-06-29 14:14:12 +02:00
Thomas Geymayer c372591f36 Canvas: Ignore hidden element on event traversal. 2013-06-29 14:12:59 +02:00
Thomas Geymayer 36d1308aa6 Canvas: fix distance check for click events. 2013-06-29 14:11:19 +02:00
Thomas Geymayer b0d6ed3844 Canvas: trigger missing events on mouseup.
On mouseup send mouseout/mouseleave to old element and
mouseenter/mouseover to new element. This fixes hover
actions after dragging.
2013-06-29 11:33:44 +02:00
Thomas Geymayer 82dd1e4be9 Set binding after color array (required by OSG 3.1.8) 2013-06-27 00:38:44 +02:00
Thomas Geymayer c6093430ae Canvas: Fix creating/forwarding of mouseenter/mouseleave events. 2013-06-20 23:13:47 +02:00
Thomas Geymayer c391fcd345 Canvas: fix updating placements after non matching placements 2013-06-18 23:07:20 +02:00
Thomas Geymayer ece743342a canvas::Text: Make font resolution user configurable 2013-06-16 10:49:46 +02:00
Thomas Geymayer 02babbe340 canvas::Text: set font resolution to actual texel size. 2013-06-14 23:33:26 +02:00
Thomas Geymayer e27b6d050c CanvasGroup: Do not try to remove already removed children. 2013-06-14 19:47:09 +02:00
Thomas Geymayer 86e2de8d10 Fix #1139
Always set TEST_LIBS as applications/tools also need to link
them, even if tests are disabled. Also allow disabling building
of sg_pkgutil.
2013-06-12 23:56:04 +02:00
Thomas Geymayer 14f04878d1 CanvasGroup: allow derived classes to provide more/other child factories 2013-06-11 22:09:57 +02:00
Thomas Geymayer 830fb3b752 Use TEST_LIBS to include all libraries needed (on Mac) 2013-06-11 20:26:07 +02:00
Thomas Geymayer 9a336da359 Use global TEST_LIBS... 2013-06-11 19:41:29 +02:00
Thomas Geymayer 6cec49ce7e Missing library for Apple 2013-06-11 18:04:06 +02:00
Thomas Geymayer 6c28edea55 SGPath: new helpers and static members for home and desktop path 2013-06-10 21:37:00 +02:00
Thomas Geymayer d7870d672e strutils: move unescape and simplify starts_with/ends_with 2013-06-10 21:36:13 +02: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 c8af817eeb CSSBorder: Do not return unitialized data. 2013-06-07 18:54:41 +02:00
Thomas Geymayer d24d3ce487 Canvas: More helper functions and cleanup. 2013-06-07 16:45:34 +02:00
Thomas Geymayer 60a81dfbd8 CanvasGroup: Fix handling z-index while moving child to front. 2013-06-07 16:23:44 +02:00
Thomas Geymayer 8896a59dff Helper functions for SGRect and canvas::Element 2013-06-06 22:28:00 +02:00
Thomas Geymayer 7fe16d99be Canvas: clear event listeners on destroy
Removing all event listeneres on destroying a canvas
prevents circular references due to Nasal event listeners
keeping a reference to the canvas in their closure.

Also fix event handling with direct children of the root
group and add some more helpers to the Canvas.
2013-06-03 23:39:27 +02:00
Thomas Geymayer c3af88dfc1 Canvas: set blend function for elements and prevent autoresize 2013-06-02 23:32:53 +02:00
Thomas Geymayer 5c8f0cc966 Make nasal::Ghost usable with weak_ptr 2013-06-02 21:20:47 +02:00
Thomas Geymayer 2a6c50c893 More helper methods for Canvas and PropertyBasedElement. 2013-06-02 21:19:37 +02:00
Thomas Geymayer 7a8d796ac1 Move BlendFunc parsing to separate file for easier reuse. 2013-06-02 20:41:03 +02:00
Thomas Geymayer 8b3b71bce3 Support for parsing basic CSS color keywords. 2013-05-31 19:18:36 +02:00
Thomas Geymayer 83da4e9248 Canvas Image: fix updating while showing nested canvas. 2013-05-31 19:17:30 +02:00
Thomas Geymayer 2c879095d9 Canvas: add chainable helpers to Path for adding segments. 2013-05-31 19:16:42 +02:00
Thomas Geymayer 13344fbb62 Canvas: separate CSSBorder parsing from image. 2013-05-31 19:14:39 +02:00
Thomas Geymayer 2fe9ad595f Canvas: bug fixing and add some helpers. 2013-05-31 19:07:55 +02:00
Thomas Geymayer 01104cc1d3 Canvas: Add local_pos to mouse event and fix transformation of event positions with multi-level nested canvases. 2013-05-13 00:34:09 +02:00
Thomas Geymayer d61b5827fd Canvas: proper forwarding of dirty and visible flags within nested canvases. 2013-05-13 00:26:13 +02:00
Thomas Geymayer c96d7ae226 Use simulation time for spin and timed animations 2013-05-10 01:11:46 +02:00
Thomas Geymayer 9535aef59b Extend SGPickCallback to allow passing more information to callbacks 2013-05-09 21:31:27 +02:00
Thomas Geymayer 82f6fca06f Add (optional) uv coordinates to SGPickCallback 2013-05-09 12:40:59 +02:00
Thomas Geymayer 627b36a53b Prevent timer endless loops 2013-05-06 23:26:45 +02:00