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
Thomas Geymayer
2af78a3874
Allow adding a contition to locked-track animation
2013-05-02 00:47:51 +02:00
Thomas Geymayer
0fa23b83e6
Extend locked-track animation to support a slave element.
...
This allows tracking elements while at the same time changing the
rotation of both animated elements to fill the available distance
to the target element. This allows for example animating gear
scissors or other connected objects like gear doors and their
actuators/arms (possibly connected to the gear strut).
2013-04-28 23:46:25 +02:00
Thomas Geymayer
e53c71543a
Move and rework pow to math/SGMisc
2013-04-28 15:43:02 +02:00
Thomas Geymayer
fa64f7b6aa
Work around MSVC linker bug with classes derived from i/ofstream
2013-04-27 23:44:32 +02:00
Thomas Geymayer
eaac3a64f8
Fix linker error for test
2013-04-26 23:48:25 +02:00
Thomas Geymayer
4eabc45dfc
Fix animation tests for low precision floating point
2013-04-26 00:19:00 +02:00
Thomas Geymayer
5c5e2a0f2f
Remove debug output (and shorten test names)
2013-04-26 00:13:35 +02:00
Thomas Geymayer
559a5d146a
Add trackTo (locked-track) animation
2013-04-25 23:23:16 +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
c83dae4c70
Comparison operators for SGSharedPtr
2013-04-13 16:21:04 +02:00
Thomas Geymayer
3da44d1215
Nasal: add naVec_removelast. (Thanks to Philosopher)
2013-04-12 12:32:03 +02:00
Thomas Geymayer
198c5d23fd
nasal::Ghost tweaking to allow using with osg::oberser_ptr.
2013-04-01 13:35:41 +02:00
Thomas Geymayer
c41caeaf64
Ensure every scenery model has own SGModelData.
...
This makes Nasal unload hooks of scenery objects working again.
Previously the same SGModelData instance was used for all objects
which never got destroyed and therefore was not able to call any
unload callback.
2013-04-01 13:22:28 +02:00
Thomas Geymayer
b6c542b0e7
nasal::Ghost tweaking and to_nasal_helper for SGGeod.
2013-03-23 12:47:06 +01:00
Thomas Geymayer
2d62275a08
Fix uninitialized member.
...
Thanks to Chris for the catch.
2013-03-20 23:44:26 +01:00
Thomas Geymayer
971ea81861
cppbind: add from_nasal_helper to convert Nasal ghosts to C++ shared pointer
2013-03-19 18:36:55 +01:00
Thomas Geymayer
9e9cc7859c
Interpolation system tweaking and add helpers to SGPropertyNode to interpolate its value
2013-03-17 23:48:01 +01:00
Thomas Geymayer
8898f5fe52
Tweak interpolator and allow passing list of interpolation steps
2013-03-16 16:36:20 +01:00
Thomas Geymayer
40be69ae8e
Remove unecessary dependency from libSimGearCore on libSimGearScene.
2013-03-16 12:19:23 +01:00
Thomas Geymayer
17eec81071
Fix headless build
2013-03-16 10:35:30 +01:00
Thomas Geymayer
c9bbbd18ec
New interpolation/animation system.
...
Inspired by jQuery.animate() properties can be interpolated using
different easing functions and specifying an animation duration.
Additionally animations can be chained to get table-based
animations like with the current SGInterpolator, or also create
looped animations or other more complicated curves.
Currently this system is not used yet, but it is intended to
replace SGInterpolator and allow more advanced animations of
eg. also colors, for example, for the canvas.
2013-03-15 23:37:17 +01:00
Thomas Geymayer
e08eda18d5
CMake: Create list of libs for testing only once
2013-03-15 23:21:38 +01:00
Thomas Geymayer
0a1e920659
Ensure canvas is updated before displaying image containing a canvas
2013-03-11 21:22:43 +01:00
Thomas Geymayer
0dcb64dca3
slider - fix shifted check while dragging
2013-03-10 23:10:26 +01:00
Thomas Geymayer
79ae0da927
Fix some warnings
2013-03-07 00:17:45 +01:00
Thomas Geymayer
e179bda57a
add static_pointer_cast for SGSharedPtr
2013-03-06 23:17:02 +01:00
Thomas Geymayer
8e0c15e32e
cppbind: allow adding free functions accepting nasal::CallContext and do some cleanup
2013-03-06 17:00:38 +01:00
Thomas Geymayer
ff844f6760
May MSVC likes this more...
2013-03-05 18:12:17 +01:00
Thomas Geymayer
bc96ac85f4
cppbind: Add some methods to nasal::CallContext
2013-03-05 17:27:49 +01:00
Thomas Geymayer
2db8859076
cppbind: Tweak from_nasal error reporting
2013-03-04 23:15:13 +01:00
Thomas Geymayer
6eff167a28
Silence MSVC
2013-03-04 18:42:32 +01:00
Thomas Geymayer
9fecb69b84
cppbind: tweaking from_nasal/to_nasal.
2013-03-04 16:26:28 +01:00
Thomas Geymayer
0539aa38e5
cppbind: faster from_nasal for bool and fix VS warning.
2013-03-04 00:30:30 +01:00
Thomas Geymayer
ceae2928aa
cppbind: refactor to_nasal for better name lookup.
...
Using template parameter dependent name lookup it is
now possible to create to_nasal_helper overloads
for custom types and having them used for automatic
type conversion with binding methods/member on
nasal::Ghost objects.
2013-03-03 23:42:40 +01:00
Thomas Geymayer
a2e7c92f99
cppbind: Allow getter without from_nasal defined and setter without to_nasal.
2013-03-03 20:55:57 +01:00
Thomas Geymayer
643a8717b4
Make old gcc happy
2013-03-03 20:16:21 +01:00
Thomas Geymayer
f21127fd4a
cppbind: rework to allow binding nearly everything.
...
It is now possible to register all types of member function
and free functions as methods for nasal::Ghost objects.
The return value and arguments are converte automatically
to the required types.
Also usage is simplified by removing replacing the old
method and method_func with a single method function
which only needs a name for the method and something
callable.
2013-03-03 19:28:39 +01:00
Thomas Geymayer
c414242f13
sg_netChat: let getTerminator return const char* for compatiblity with FlightGear
2013-03-03 01:19:35 +01:00
Thomas Geymayer
33e60725b1
sg_netChat: Use std::string to prevent crash with old strdup.
...
Thanks to Godspeed for noticing this code crashing with MSVC.
Using std::string should fix this.
2013-03-03 01:12:01 +01:00
Thomas Geymayer
530de4d809
cppbind: Prepare for improved bindings.
...
- Improved Nasal/C++ bindings will follow. For now just test if
all compilers are happy with intended approach.
- Add to_nasal overload for std::map<std::string, T>.
2013-03-02 00:13:48 +01:00
Thomas Geymayer
5e45bdeeda
Add optional user_data to Nasal C functions.
...
A user_data pointer and another pointer to an optional
deleter function is stored in unused parts of the naPtr
union. The previous behavior of extension functions does
not change. Only one additional boolean comparison is
required upon each function call to check whether user
data is available.
2013-03-01 12:22:51 +01:00
Thomas Geymayer
081eba903f
Visual Studio fix
2013-03-01 00:33:47 +01:00
Thomas Geymayer
0def045611
cppbind: Fix SGPath from_nasal_helper
2013-02-28 23:46:55 +01:00