Commit Graph
34 Commits
Author SHA1 Message Date
Thomas Geymayer e302ad092e canvas::Image: abort http requests if image is destroyed. 2014-06-05 17:25:12 +02:00
Thomas Geymayer 0b21181f1a Canvas: allow dispatching events to Canavs itself 2014-05-29 16:34:33 +02:00
Thomas Geymayer 9c421d55a9 Canvas: support for custom events and event dispatching. 2014-05-19 00:17:23 +02:00
Thomas Geymayer efbec8b367 Canvas: base Elements/Canvas on SGWeakReferenced. 2014-05-06 18:10:42 +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 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 6c75e2fe3c CanvasImage: support for http protocol.
- Download and display images.
2014-03-18 18:33:44 +01:00
Stuart Buchanan c35243e215 OSG 3.2.0 compatibility and surface light effects. 2014-02-18 21:30:15 +00: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 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 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 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 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 d24d3ce487 Canvas: More helper functions and cleanup. 2013-06-07 16:45:34 +02:00
Thomas Geymayer 8896a59dff Helper functions for SGRect and canvas::Element 2013-06-06 22:28:00 +02:00
Thomas Geymayer c3af88dfc1 Canvas: set blend function for elements and prevent autoresize 2013-06-02 23:32:53 +02:00
Thomas Geymayer 83da4e9248 Canvas Image: fix updating while showing nested canvas. 2013-05-31 19:17:30 +02:00
Thomas Geymayer 13344fbb62 Canvas: separate CSSBorder parsing from image. 2013-05-31 19:14:39 +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 1f43132363 Canvas: rework style setter system.
Style setters are now only setup once for each element type and
not for each element instance as before. A static map holds the
setters for each element type. Also an animation type is stored
which will later allow to animate properties of Canvas elements
without specifying and animation type.
2013-04-20 00:22:37 +02:00
Thomas Geymayer 17369a20de CanvaImage: Enable texture repeat for images 2013-04-15 21:09:41 +02:00
Thomas Geymayer 0a1e920659 Ensure canvas is updated before displaying image containing a canvas 2013-03-11 21:22:43 +01:00
Thomas Geymayer e1302bcf17 CanvasImage: Fix border abs/rel calculations; add slice-width property 2013-02-28 01:09:27 +01:00
Thomas Geymayer 5441db9b18 Support image slice/scale-9 for CanvasImage. 2013-02-24 17:57:19 +01:00
Thomas Geymayer 1784327c47 CanvasImage: Use image/canvas size rather than texture size 2013-02-15 12:32:31 +01:00
Thomas Geymayer a63ec83d5f CanvasImage: Use normalized coordinates by default.
Using absolute sizes by default lead to problems,
as while creating the image the size of the later
texture is not available.
2013-02-14 17:32:19 +01:00
Thomas Geymayer 50688e1159 Rename simgear::Rect to SGRect and make interface more similar to SGBox 2012-12-13 23:37:21 +01:00
Thomas Geymayer 77946585b1 Canvas: Prepare for DOM Level 2 like event model. 2012-11-27 13:51:00 +01:00
Thomas Geymayer 34719da000 Clean up Canvas element creation 2012-11-06 18:48:00 +01:00
Thomas Geymayer 53dea9b069 Move parseColor to scene/util
parseColor is used to parse a CSS color string into an osg::Vec4
which is only available in SimGearScene. If someone needs the
function also in SimGear headless mode we have to think about
where to better place this function.
2012-11-05 17:58:24 +01:00
Thomas Geymayer b99f53fda3 Refactor Canvas and add some helpers.
- Refactor Canvas from FlightGear and fix lazy rendering with
   recursive canvases.
 - New classes PropertyBasedElement and PropertyBasedManager for
   creating subsystems controlled by the property tree.
 - New method parseColor to parse CSS 3 conformant color strings
   (only basic color schemes supported)
 - New Rect class representing a rectangle.
2012-11-04 14:12:05 +01:00