#include <list>
#include <stdexcept>
#include "layout.h"
+#include "mspgltk_api.h"
namespace Msp {
namespace GLtk {
class Widget;
-class arrangement_error: public std::logic_error
+class MSPGLTK_API arrangement_error: public std::logic_error
{
public:
arrangement_error(const std::string &w): std::logic_error(w) { }
virtual ~arrangement_error() throw() { }
};
-class Arrangement
+class MSPGLTK_API Arrangement
{
protected:
enum Side
#include <sigc++/sigc++.h>
#include <msp/gl/texture2d.h>
+#include "mspgltk_api.h"
#include "text.h"
#include "widget.h"
A clickable button widget. Buttons can have a text label, which is displayed
in a spacial part "text".
*/
-class Button: public Widget
+class MSPGLTK_API Button: public Widget
{
public:
- class Loader: public DataFile::DerivedObjectLoader<Button, Widget::Loader>
+ class MSPGLTK_API Loader: public DataFile::DerivedObjectLoader<Button, Widget::Loader>
{
public:
Loader(Button &);
#define MSP_GLTK_COLUMN_H_
#include "lineararrangement.h"
+#include "mspgltk_api.h"
namespace Msp {
namespace GLtk {
-class Column: public LinearArrangement
+class MSPGLTK_API Column: public LinearArrangement
{
public:
Column(Layout &);
#include <list>
#include <stdexcept>
#include <sigc++/trackable.h>
+#include "mspgltk_api.h"
#include "widget.h"
namespace Msp {
namespace GLtk {
-class hierarchy_error: public std::logic_error
+class MSPGLTK_API hierarchy_error: public std::logic_error
{
public:
hierarchy_error(const std::string &);
};
-class Container: virtual public Widget
+class MSPGLTK_API Container: virtual public Widget
{
protected:
struct Child: public sigc::trackable
#ifndef MSP_GLTK_DIALOG_H_
#define MSP_GLTK_DIALOG_H_
+#include "mspgltk_api.h"
#include "panel.h"
namespace Msp {
A Dialog is used for temporary interaction with the user. When any of the
Dialog's action buttons are clicked, it will emit a signal and delete itself.
*/
-class Dialog: public Panel
+class MSPGLTK_API Dialog: public Panel
{
public:
- class Loader: public DataFile::DerivedObjectLoader<Dialog, Panel::Loader>
+ class MSPGLTK_API Loader: public DataFile::DerivedObjectLoader<Dialog, Panel::Loader>
{
public:
Loader(Dialog &, WidgetMap &);
#ifndef MSP_GLTK_DRAGHANDLE_H_
#define MSP_GLTK_DRAGHANDLE_H_
+#include "mspgltk_api.h"
#include "widget.h"
namespace Msp {
Moves its parent widget when dragged. This allows turning a Panel or Dialog
into a movable window.
*/
-class DragHandle: public Widget
+class MSPGLTK_API DragHandle: public Widget
{
private:
bool dragging;
#include <sigc++/signal.h>
#include "list.h"
+#include "mspgltk_api.h"
#include "text.h"
#include "widget.h"
class List;
-class Dropdown: virtual public Widget, private Container
+class MSPGLTK_API Dropdown: virtual public Widget, private Container
{
public:
- class Loader: public DataFile::DerivedObjectLoader<Dropdown, Widget::Loader>
+ class MSPGLTK_API Loader: public DataFile::DerivedObjectLoader<Dropdown, Widget::Loader>
{
public:
Loader(Dropdown &);
#define MSP_GLTK_ENTRY_H_
#include "container.h"
+#include "mspgltk_api.h"
#include "text.h"
#include "widget.h"
cursor Indicates the current input position. Fill_x is ignored.
slider A vertical slider for multiline entries.
*/
-class Entry: virtual public Widget, private Container
+class MSPGLTK_API Entry: virtual public Widget, private Container
{
public:
- class Loader: public DataFile::DerivedObjectLoader<Entry, Widget::Loader>
+ class MSPGLTK_API Loader: public DataFile::DerivedObjectLoader<Entry, Widget::Loader>
{
public:
Loader(Entry &);
#define FLOATINGARRANGEMENT_H_
#include "arrangement.h"
+#include "mspgltk_api.h"
namespace Msp {
namespace GLtk {
-class FloatingArrangement: public Arrangement
+class MSPGLTK_API FloatingArrangement: public Arrangement
{
public:
FloatingArrangement(Layout &);
#define MSP_GLTK_GEOMETRY_H_
#include <msp/datafile/objectloader.h>
+#include "mspgltk_api.h"
namespace Msp {
namespace GLtk {
/**
Specifies the position and size of a widget or graphic.
*/
-struct Geometry
+struct MSPGLTK_API Geometry
{
int x, y;
unsigned w, h;
/**
Specifies margins on the sides of an element.
*/
-struct Sides
+struct MSPGLTK_API Sides
{
class Loader: public DataFile::ObjectLoader<Sides>
{
/**
Performs alignment of nested geometries, such as widgets and their parts.
*/
-struct Alignment
+struct MSPGLTK_API Alignment
{
float x, y;
float w, h;
#include <msp/gl/texture2d.h>
#include <msp/datafile/objectloader.h>
#include "geometry.h"
+#include "mspgltk_api.h"
namespace Msp {
namespace GLtk {
/**
Stores a single graphical element. Graphics are used as parts of widgets.
*/
-class Graphic
+class MSPGLTK_API Graphic
{
public:
class Loader: public DataFile::CollectionObjectLoader<Graphic, Resources>
#include <msp/datafile/objectloader.h>
#include "arrangement.h"
+#include "mspgltk_api.h"
namespace Msp {
namespace GLtk {
-class Grid: public Arrangement
+class MSPGLTK_API Grid: public Arrangement
{
public:
class Loader: public DataFile::ObjectLoader<Grid>
#define MSP_GLTK_IMAGE_H_
#include <msp/gl/texture2d.h>
+#include "mspgltk_api.h"
#include "widget.h"
namespace Msp {
/**
A widget for displaying images.
*/
-class Image: public Widget
+class MSPGLTK_API Image: public Widget
{
public:
class Loader: public Msp::DataFile::DerivedObjectLoader<Image, Widget::Loader>
#ifndef MSP_GLTK_INDICATOR_H_
#define MSP_GLTK_INDICATOR_H_
+#include "mspgltk_api.h"
#include "widget.h"
namespace Msp {
/**
An Indicator visualizes a boolean state. It can be either active or inactive.
*/
-class Indicator: public Widget
+class MSPGLTK_API Indicator: public Widget
{
public:
virtual const char *get_class() const { return "indicator"; }
#ifndef INPUTMETHOD_H_
#define INPUTMETHOD_H_
+#include "mspgltk_api.h"
+
namespace Msp {
namespace GLtk {
NAV_CANCEL
};
-class InputMethod
+class MSPGLTK_API InputMethod
{
protected:
Root &root;
#ifndef MSP_GLTK_LABEL_H_
#define MSP_GLTK_LABEL_H_
+#include "mspgltk_api.h"
#include "text.h"
#include "widget.h"
/**
Labels display static text. There is one special part: "text".
*/
-class Label: public Widget
+class MSPGLTK_API Label: public Widget
{
public:
class Loader: public DataFile::DerivedObjectLoader<Label, Widget::Loader>
#include <sigc++/trackable.h>
#include <msp/strings/lexicalcast.h>
#include "geometry.h"
+#include "mspgltk_api.h"
namespace Msp {
namespace GLtk {
interface is provided to automatically arrange widgets. See classes Row,
Column and Grid for some commonly used arrangements.
*/
-class Layout
+class MSPGLTK_API Layout
{
private:
enum
void solve_constraints(int, SolveMode);
};
-void operator>>(const LexicalConverter &, Layout::ConstraintType &);
+MSPGLTK_API void operator>>(const LexicalConverter &, Layout::ConstraintType &);
} // namespace GLtk
} // namespace Msp
#include <msp/datafile/objectloader.h>
#include "arrangement.h"
+#include "mspgltk_api.h"
namespace Msp {
namespace GLtk {
-class LinearArrangement: public Arrangement
+class MSPGLTK_API LinearArrangement: public Arrangement
{
public:
- class Loader: public DataFile::ObjectLoader<LinearArrangement>
+ class MSPGLTK_API Loader: public DataFile::ObjectLoader<LinearArrangement>
{
public:
Loader(LinearArrangement &);
#include "container.h"
#include "label.h"
#include "listdata.h"
+#include "mspgltk_api.h"
#include "slider.h"
namespace Msp {
/**
Thrown if a list's item type is incompatible with its data.
*/
-class incompatible_data: public std::logic_error
+class MSPGLTK_API incompatible_data: public std::logic_error
{
public:
incompatible_data(const std::type_info &);
Shows a list of items, allowing the user to select one. A slider is included
to allow scrolling through a long list.
*/
-class List: virtual public Widget, private Container
+class MSPGLTK_API List: virtual public Widget, private Container
{
public:
enum ViewMode
static void adjust_index(int &, int, int);
};
-void operator>>(const LexicalConverter &, List::ViewMode &);
+MSPGLTK_API void operator>>(const LexicalConverter &, List::ViewMode &);
} // namespace GLtk
} // namespace Msp
#include <vector>
#include <sigc++/signal.h>
#include <msp/strings/lexicalcast.h>
+#include "mspgltk_api.h"
namespace Msp {
namespace GLtk {
-class ListData
+class MSPGLTK_API ListData
{
public:
sigc::signal<void, unsigned> signal_item_added;
--- /dev/null
+#ifndef MSP_GLTK_API_H_
+#define MSP_GLTK_API_H_
+
+#if defined(_WIN32)
+#if defined(MSPGLTK_BUILD)
+#define MSPGLTK_API __declspec(dllexport)
+#elif defined(MSPGLTK_IMPORT)
+#define MSPGLTK_API __declspec(dllimport)
+#else
+#define MSPGLTK_API
+#endif
+#elif defined(__GNUC__)
+#define MSPGLTK_API __attribute__((visibility("default")))
+#else
+#define MSPGLTK_API
+#endif
+
+#endif
#include <msp/core/typeregistry.h>
#include "container.h"
#include "layout.h"
+#include "mspgltk_api.h"
namespace Msp {
namespace GLtk {
part "children" to render the child widgets. All properties of this part are
ignored.
*/
-class Panel: public Container
+class MSPGLTK_API Panel: public Container
{
public:
class Loader: public DataFile::DerivedObjectLoader<Panel, Widget::Loader>
#include <string>
#include <msp/datafile/objectloader.h>
#include "geometry.h"
+#include "mspgltk_api.h"
#include "state.h"
namespace Msp {
/**
Defines a single graphical element of a widget style.
*/
-class Part
+class MSPGLTK_API Part
{
public:
class Loader: public DataFile::CollectionObjectLoader<Part>
#include <msp/gl/mesh.h>
#include <msp/gl/texture2d.h>
+#include "mspgltk_api.h"
namespace Msp {
namespace GLtk {
~CachedPart();
};
-class PartCache
+class MSPGLTK_API PartCache
{
public:
class Rebuild
#ifndef MSP_GLTK_PROGRESSBAR_H_
#define MSP_GLTK_PROGRESSBAR_H_
+#include "mspgltk_api.h"
#include "widget.h"
namespace Msp {
namespace GLtk {
-class ProgressBar: public Widget
+class MSPGLTK_API ProgressBar: public Widget
{
private:
float range;
#include <msp/datafile/directorysource.h>
#include <msp/fs/path.h>
#include "graphic.h"
+#include "mspgltk_api.h"
#include "style.h"
namespace Msp {
Stores resources such as styles and graphics. All widgets require a Resources
instance in constructor.
*/
-class Resources: public DataFile::Collection
+class MSPGLTK_API Resources: public DataFile::Collection
{
public:
class Loader: public Collection::Loader
#include <msp/input/mouse.h>
#include <msp/input/touchscreen.h>
#include <msp/time/timestamp.h>
+#include "mspgltk_api.h"
#include "panel.h"
namespace Msp {
Due to its specialized nature it's recommended to not use it with Scenes or
other containers.
*/
-class Root: public Panel, public GL::Renderable, public sigc::trackable
+class MSPGLTK_API Root: public Panel, public GL::Renderable, public sigc::trackable
{
public:
sigc::signal<std::string, int, int> signal_tooltip;
#define MSP_GLTK_ROW_H_
#include "lineararrangement.h"
+#include "mspgltk_api.h"
namespace Msp {
namespace GLtk {
-class Row: public LinearArrangement
+class MSPGLTK_API Row: public LinearArrangement
{
public:
Row(Layout &);
#define MSP_GLTK_SLIDER_H_
#include <sigc++/sigc++.h>
+#include "mspgltk_api.h"
#include "widget.h"
namespace Msp {
common interface and logic for sliders but can't be instantiated. Use HSlider
or VSlider depending on which direction you want the slider to be in.
*/
-class Slider: public Widget
+class MSPGLTK_API Slider: public Widget
{
public:
- class Loader: public DataFile::DerivedObjectLoader<Slider, Widget::Loader>
+ class MSPGLTK_API Loader: public DataFile::DerivedObjectLoader<Slider, Widget::Loader>
{
public:
Loader(Slider &);
};
-class VSlider: public Slider
+class MSPGLTK_API VSlider: public Slider
{
public:
VSlider(): Slider(VERTICAL) { }
virtual const char *get_class() const { return "vslider"; }
};
-class HSlider: public Slider
+class MSPGLTK_API HSlider: public Slider
{
public:
HSlider(): Slider(HORIZONTAL) { }
#include <msp/datafile/objectloader.h>
#include "arrangement.h"
+#include "mspgltk_api.h"
namespace Msp {
namespace GLtk {
Arranges widgets on top of one another. This can be useful in implementing a
tabbed view where only one tab is visible at a time.
*/
-class Stack: public Arrangement
+class MSPGLTK_API Stack: public Arrangement
{
public:
class Loader: public DataFile::ObjectLoader<Stack>
#include <istream>
#include <msp/datafile/value.h>
+#include "mspgltk_api.h"
namespace Msp {
namespace GLtk {
inline State operator~(State a)
{ return static_cast<State>(~static_cast<int>(a)); }
-extern std::istream &operator>>(std::istream &, State &);
+MSPGLTK_API std::istream &operator>>(std::istream &, State &);
} // namespace GLtk
} // namespace Msp
#include <msp/gl/font.h>
#include <msp/gl/sampler.h>
#include <msp/datafile/objectloader.h>
+#include "mspgltk_api.h"
#include "part.h"
namespace Msp {
Styles define what wigets look like. They are made up of Parts and some
generic properties.
*/
-class Style
+class MSPGLTK_API Style
{
public:
class Loader: public DataFile::CollectionObjectLoader<Style, Resources>
#include <msp/input/keyboard.h>
#include "inputmethod.h"
+#include "mspgltk_api.h"
namespace Msp {
namespace GLtk {
-class SystemKeyboardInput: public InputMethod, public sigc::trackable
+class MSPGLTK_API SystemKeyboardInput: public InputMethod, public sigc::trackable
{
private:
Input::Keyboard &keyboard;
#include <string>
#include <vector>
+#include "mspgltk_api.h"
#include "state.h"
namespace Msp {
/**
Stores and renders text. Supports multiline text.
*/
-class Text
+class MSPGLTK_API Text
{
private:
struct Line
#define MSP_GLTK_TOGGLE_H_
#include <sigc++/signal.h>
+#include "mspgltk_api.h"
#include "text.h"
#include "widget.h"
/**
Allows toggling a value between two states.
*/
-class Toggle: public Widget
+class MSPGLTK_API Toggle: public Widget
{
public:
- class Loader: public DataFile::DerivedObjectLoader<Toggle, Widget::Loader>
+ class MSPGLTK_API Loader: public DataFile::DerivedObjectLoader<Toggle, Widget::Loader>
{
public:
Loader(Toggle &);
#include <msp/gl/renderer.h>
#include "geometry.h"
#include "inputmethod.h"
+#include "mspgltk_api.h"
#include "partcache.h"
#include "state.h"
/**
Base class for all widgets.
*/
-class Widget
+class MSPGLTK_API Widget
{
friend class Container;