Commit Graph
98 Commits
Author SHA1 Message Date
Thomas Geymayer 82d5c605e5 canvas::Element: check if element is valid. 2014-06-15 16:30:57 +02:00
Thomas Geymayer 36cb7a752b canvas::Text: add heightForWidth method. 2014-06-13 00:08:57 +02:00
Thomas Geymayer c54e3f8101 canvas::Image: allow aspect ratio preserving display. 2014-06-08 02:16:07 +02:00
Thomas Geymayer e302ad092e canvas::Image: abort http requests if image is destroyed. 2014-06-05 17:25:12 +02:00
Thomas Geymayer 7a65d42a4c Canvas: fix transformation of clip rect. 2014-06-05 16:07:09 +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 0b21181f1a Canvas: allow dispatching events to Canavs itself 2014-05-29 16:34:33 +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 36ae8cdce3 Update doxgen config and some comments. 2014-05-29 00:27:50 +02:00
Thomas Geymayer d77ba7d2db canvas::Element: setter/getter for HTML5 style data-* properties. 2014-05-28 18:11:32 +02:00
Thomas Geymayer 6e58fdac85 canvas: exclude data-* properties from triggering an update.
Allows using data-* properties on canvas and elements,
similar to HTML5, without triggering a new rendering of
the canvas.
2014-05-27 17:56:46 +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 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 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 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 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 b2cedc5332 Canvas: Fix crash on hide/show after detaching element from scenegraph. 2014-02-22 01:51:54 +01:00
Stuart Buchanan c35243e215 OSG 3.2.0 compatibility and surface light effects. 2014-02-18 21:30:15 +00: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 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 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 743244a69c CanvasElement: ensure parent pointer can not become invalid. 2013-11-10 17:12:50 +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 ca79d99ec4 canvas::Element: add getter for parent element. 2013-10-23 17:11:03 +02:00
Thomas Geymayer a37a254a68 Canvas: simplify code by using new nasal function conversion. 2013-10-15 17:46:42 +02:00
Thomas Geymayer 6deb77dd4d Canvas: allow also C++ callable entities as event callbacks. 2013-10-12 00:29:37 +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 7bd572f3ec Fix inverted checks... 2013-07-13 14:06:11 +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 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 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 14eccc70da Restore compatibility with stable OSG (3.0.1) 2013-06-30 21:25:21 +02:00
Thomas Geymayer c372591f36 Canvas: Ignore hidden element on event traversal. 2013-06-29 14:12:59 +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 ece743342a canvas::Text: Make font resolution user configurable 2013-06-16 10:49:46 +02:00