# The default value is: NO.
# This tag requires that the tag ENABLE_PREPROCESSING is set to YES.
-MACRO_EXPANSION = NO
+MACRO_EXPANSION = YES
# If the EXPAND_ONLY_PREDEF and MACRO_EXPANSION tags are both set to YES then
# the macro expansion is limited to the macros specified with the PREDEFINED and
-///@file The canvas for rendering with the 2d API
+///@file
+/// The canvas for rendering with the 2d API
//
// Copyright (C) 2012 Thomas Geymayer <tomgey@gmail.com>
//
class CanvasMgr;
class MouseEvent;
+ /**
+ * Canvas to draw onto (to an off-screen render target).
+ */
class Canvas:
public PropertyBasedElement,
public nasal::Object
if( type_map.empty() )
{
-# define ENUM_MAPPING(type, str)\
+# define ENUM_MAPPING(type, str, class_name)\
type_map.insert(TypeMap::value_type(str, type));
# include "CanvasEventTypes.hxx"
# undef ENUM_MAPPING
-// Canvas Event for event model similar to DOM Level 3 Event Model
+/// @file
+/// Canvas Event for event model similar to DOM Level 3 Event Model
//
// Copyright (C) 2012 Thomas Geymayer <tomgey@gmail.com>
//
namespace canvas
{
+ /**
+ * Base class for all Canvas events.
+ *
+ * The event system is closely following the specification of the DOM Level 3
+ * Event Model.
+ */
class Event:
public SGReferenced
{
public:
+ /// Event type identifier
enum Type
{
UNKNOWN,
-# define ENUM_MAPPING(name, str) name,
+# define ENUM_MAPPING(name, str, class_name)\
+ name, /*!< class_name (type=str) */
# include "CanvasEventTypes.hxx"
# undef ENUM_MAPPING
- CUSTOM_EVENT ///< all user defined event types share the same id. They
- /// are just differentiated by using the type string.
+ CUSTOM_EVENT ///< First event type id available for user defined event
+ /// type.
+ /// @see CustomEvent
};
int type;
# error "Don't include this file directly!"
#endif
-ENUM_MAPPING(MOUSE_DOWN, "mousedown")
-ENUM_MAPPING(MOUSE_UP, "mouseup")
-ENUM_MAPPING(CLICK, "click")
-ENUM_MAPPING(DBL_CLICK, "dblclick")
-ENUM_MAPPING(DRAG, "drag")
-ENUM_MAPPING(WHEEL, "wheel")
-ENUM_MAPPING(MOUSE_MOVE, "mousemove")
-ENUM_MAPPING(MOUSE_OVER, "mouseover")
-ENUM_MAPPING(MOUSE_OUT, "mouseout")
-ENUM_MAPPING(MOUSE_ENTER, "mouseenter")
-ENUM_MAPPING(MOUSE_LEAVE, "mouseleave")
-ENUM_MAPPING(KEY_DOWN, "keydown")
-ENUM_MAPPING(KEY_UP, "keyup")
+ENUM_MAPPING(MOUSE_DOWN, "mousedown", MouseEvent)
+ENUM_MAPPING(MOUSE_UP, "mouseup", MouseEvent)
+ENUM_MAPPING(CLICK, "click", MouseEvent)
+ENUM_MAPPING(DBL_CLICK, "dblclick", MouseEvent)
+ENUM_MAPPING(DRAG, "drag", MouseEvent)
+ENUM_MAPPING(WHEEL, "wheel", MouseEvent)
+ENUM_MAPPING(MOUSE_MOVE, "mousemove", MouseEvent)
+ENUM_MAPPING(MOUSE_OVER, "mouseover", MouseEvent)
+ENUM_MAPPING(MOUSE_OUT, "mouseout", MouseEvent)
+ENUM_MAPPING(MOUSE_ENTER, "mouseenter", MouseEvent)
+ENUM_MAPPING(MOUSE_LEAVE, "mouseleave", MouseEvent)
+ENUM_MAPPING(KEY_DOWN, "keydown", KeyboardEvent)
+ENUM_MAPPING(KEY_UP, "keyup", KeyboardEvent)
-///@file Placement for putting a canvas texture onto OpenSceneGraph objects.
-//
-// It also provides a SGPickCallback for passing mouse events to the canvas and
-// manages emissive lighting of the placed canvas.
+///@file
+/// Placement for putting a canvas texture onto OpenSceneGraph objects.
+///
+/// It also provides a SGPickCallback for passing mouse events to the canvas and
+/// manages emissive lighting of the placed canvas.
//
// Copyright (C) 2013 Thomas Geymayer <tomgey@gmail.com>
//
-///@file Interface for 2D Canvas elements
+///@file
+/// Interface for 2D Canvas elements
//
// Copyright (C) 2012 Thomas Geymayer <tomgey@gmail.com>
//
{
/**
- * Baseclass for Elements displayed inside a Canvas.
+ * Base class for Elements displayed inside a Canvas.
*/
class Element:
public PropertyBasedElement
-///@file Canvas user defined event
+///@file
+/// Canvas user defined event
//
// Copyright (C) 2014 Thomas Geymayer <tomgey@gmail.com>
//
namespace canvas
{
+ /**
+ * User defined event (optionally carrying additional context information or
+ * data).
+ */
class CustomEvent:
public Event
{
-///@file Input device event (keyboard/mouse)
+///@file
+/// Input device event (keyboard/mouse)
//
// Copyright (C) 2014 Thomas Geymayer <tomgey@gmail.com>
//
public Event
{
public:
+ /// Default initialization (no active keyboard modifier).
DeviceEvent();
+
+ /// Initialize from an OpenSceneGraph event.
DeviceEvent(const osgGA::GUIEventAdapter& ea);
+ /// Get mask of active keyboard modifiers at the time of the event.
int getModifiers() const { return modifiers; }
+ /// Get if a Ctrl modifier was active.
bool ctrlKey() const;
+
+ /// Get if a Shift modifier was active.
bool shiftKey() const;
+
+ /// Get if an Alt modifier was active.
bool altKey() const;
+
+ /// Get if a Meta modifier was active.
bool metaKey() const;
protected:
-///@file Keyboard event
+///@file
+/// Keyboard event
//
// Copyright (C) 2014 Thomas Geymayer <tomgey@gmail.com>
//
namespace canvas
{
+ /**
+ * Keyboard (button up/down) event
+ */
class KeyboardEvent:
public DeviceEvent
{
-///@file Mouse event
+///@file
+/// Mouse event
//
// Copyright (C) 2012 Thomas Geymayer <tomgey@gmail.com>
//
namespace canvas
{
+ /**
+ * Mouse (button/move/wheel) event
+ */
class MouseEvent:
public DeviceEvent
{
-// Align items horizontally or vertically in a box
+/// @file
//
// Copyright (C) 2014 Thomas Geymayer <tomgey@gmail.com>
//
namespace canvas
{
+ /**
+ * Align LayoutItems horizontally or vertically in a box.
+ *
+ * @see http://qt-project.org/doc/qt-4.8/qboxlayout.html#details
+ */
class BoxLayout:
public Layout
{
-// Basic class for canvas layouts
+/// @file
//
// Copyright (C) 2014 Thomas Geymayer <tomgey@gmail.com>
//
namespace canvas
{
+ /**
+ * Base class for all Canvas layouts.
+ */
class Layout:
public LayoutItem
{
-///@file Basic element for layouting canvas elements
+///@file
+/// Basic element for layouting canvas elements.
//
// Copyright (C) 2014 Thomas Geymayer <tomgey@gmail.com>
//
-///@file Glue for GUI widgets implemented in Nasal space
+///@file
+/// Glue for GUI widgets implemented in Nasal space.
//
// Copyright (C) 2014 Thomas Geymayer <tomgey@gmail.com>
//
{
/**
- * Baseclass/ghost to create widgets with Nasal.
+ * Base class/ghost to implement gui widgets in Nasal space.
*/
class NasalWidget:
public LayoutItem,
-///@file Element providing blank space in a layout.
+///@file
//
// Copyright (C) 2014 Thomas Geymayer <tomgey@gmail.com>
//
-///@file HTTP request writing response to a file.
+///@file
//
// Copyright (C) 2013 Thomas Geymayer <tomgey@gmail.com>
//
namespace HTTP
{
+ /**
+ * HTTP request writing response to a file.
+ */
class FileRequest:
public Request
{
-///@file HTTP request keeping response in memory.
+///@file
//
// Copyright (C) 2013 Thomas Geymayer <tomgey@gmail.com>
//
namespace HTTP
{
+ /**
+ * HTTP request keeping response in memory.
+ */
class MemoryRequest:
public Request
{
+// Copyright (C) 2011 James Turner <zakalawe@mac.com>
+// Copyright (C) 2013 Thomas Geymayer <tomgey@gmail.com>
+//
+// This library is free software; you can redistribute it and/or
+// modify it under the terms of the GNU Library General Public
+// License as published by the Free Software Foundation; either
+// version 2 of the License, or (at your option) any later version.
+//
+// This library is distributed in the hope that it will be useful,
+// but WITHOUT ANY WARRANTY; without even the implied warranty of
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+// Library General Public License for more details.
+//
+// You should have received a copy of the GNU Library General Public
+// License along with this library; if not, write to the Free Software
+// Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA
+
#include "HTTPRequest.hxx"
#include <simgear/compiler.h>
+///@file
+//
+// Copyright (C) 2011 James Turner <zakalawe@mac.com>
+// Copyright (C) 2013 Thomas Geymayer <tomgey@gmail.com>
+//
+// This library is free software; you can redistribute it and/or
+// modify it under the terms of the GNU Library General Public
+// License as published by the Free Software Foundation; either
+// version 2 of the License, or (at your option) any later version.
+//
+// This library is distributed in the hope that it will be useful,
+// but WITHOUT ANY WARRANTY; without even the implied warranty of
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+// Library General Public License for more details.
+//
+// You should have received a copy of the GNU Library General Public
+// License along with this library; if not, write to the Free Software
+// Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA
+
#ifndef SG_HTTP_REQUEST_HXX
#define SG_HTTP_REQUEST_HXX
namespace HTTP
{
+/**
+ * Base class for HTTP request (and answer).
+ */
class Request:
public SGReferenced
{
-///@file Parse and represent SVG preserveAspectRatio attribute
+///@file
+/// Parse and represent SVG preserveAspectRatio attribute.
//
// Copyright (C) 2014 Thomas Geymayer <tomgey@gmail.com>
//
bool operator==(const SVGpreserveAspectRatio& rhs) const;
+ /// Parse preserveAspectRatio from string.
static SVGpreserveAspectRatio parse(const std::string& str);
private:
-///@file Really simple markdown parser
+///@file
+/// Really simple markdown parser.
//
// Copyright (C) 2014 Thomas Geymayer <tomgey@gmail.com>
//
-///@file Manage lifetime and encapsulate a Nasal context
+///@file
//
// Copyright (C) 2014 Thomas Geymayer <tomgey@gmail.com>
//
namespace nasal
{
+ /**
+ * Manage lifetime and encapsulate a Nasal context.
+ */
class Context
{
public:
-///@file Wrapper class for Nasal hashes
+///@file
//
// Copyright (C) 2012 Thomas Geymayer <tomgey@gmail.com>
//
{
/**
- * A Nasal Hash
+ * Wrapper class for Nasal hashes.
*/
class Hash
{
-///@file Object exposed to Nasal including a Nasal hash for data storage.
+///@file
//
// Copyright (C) 2014 Thomas Geymayer <tomgey@gmail.com>
//
namespace nasal
{
+ /**
+ * Object exposed to Nasal including a Nasal hash for data storage.
+ */
class Object:
public virtual SGVirtualWeakReferenced
{
-///@file Wrapper class for keeping Nasal objects save from the garbage collector
+///@file
+/// Wrapper class for keeping Nasal objects save from the garbage collector.
//
// Copyright (C) 2013 Thomas Geymayer <tomgey@gmail.com>
//
-///@file Wrapper class for Nasal strings
+///@file
//
// Copyright (C) 2013 Thomas Geymayer <tomgey@gmail.com>
//
{
/**
- * A Nasal String
+ * Wrapper class for Nasal strings.
*/
class String
{
return 0.5 + 0.5 * (*easeOut)(t - 1);
}
+ /**
+ * Helper for exponential ease out with integer exponent.
+ *
+ * @tparam N Exponent.
+ * @tparam is_odd If the exponent is odd.
+ */
template<size_t N, bool is_odd>
struct easeOutImpl;
- /// http://easings.net/#easeOutCubic (N = 3)
- /// http://easings.net/#easeOutQuint (N = 5)
+ /**
+ * Ease out with odd integer exponent.
+ *
+ * @tparam N Exponent.
+ * @see http://easings.net/#easeOutCubic (N = 3)
+ * @see http://easings.net/#easeOutQuint (N = 5)
+ */
template<size_t N>
struct easeOutImpl<N, true>
{
}
};
- /// http://easings.net/#easeOutQuad (N = 2)
- /// http://easings.net/#easeOutQuart (N = 4)
+ /**
+ * Ease out with even integer exponent.
+ *
+ * @tparam N Exponent.
+ * @see http://easings.net/#easeOutQuad (N = 2)
+ * @see http://easings.net/#easeOutQuart (N = 4)
+ */
template<size_t N>
struct easeOutImpl<N, false>
{
}
};
- /// http://easings.net/#easeOutQuad (N = 2)
- /// http://easings.net/#easeOutCubic (N = 3)
- /// http://easings.net/#easeOutQuart (N = 4)
- /// http://easings.net/#easeOutQuint (N = 5)
+ /**
+ * Exponential ease out with integer exponent.
+ *
+ * @see http://easings.net/#easeOutQuad (N = 2)
+ * @see http://easings.net/#easeOutCubic (N = 3)
+ * @see http://easings.net/#easeOutQuart (N = 4)
+ * @see http://easings.net/#easeOutQuint (N = 5)
+ * @see easeOutImpl
+ */
template<size_t N>
double easeOutPow(double t)
{
-///@file Handle a list of callbacks like a single boost::function
+///@file
//
// Copyright (C) 2014 Thomas Geymayer <tomgey@gmail.com>
//
# define BOOST_PP_FILENAME_1 <simgear/structure/detail/function_list_template.hxx>
# include BOOST_PP_ITERATE()
+ /**
+ * Handle a list of callbacks like a single boost::function.
+ *
+ * @tparam Sig Function signature.
+ */
template<typename Sig>
class function_list<boost::function<Sig> >:
public function_list<Sig>
-///@file Extended std::map with methods for easier usage.
+///@file
//
// Copyright (C) 2013 Thomas Geymayer <tomgey@gmail.com>
//
namespace simgear
{
+ /**
+ * Extended std::map with methods for easier usage.
+ */
template<class Key, class Value>
class Map:
public std::map<Key, Value>