├── .gitignore ├── CMakeLists.txt ├── LICENCE.txt ├── LICENSE ├── README.md ├── demo └── AguiCalc │ ├── AguiCalc.sln │ └── AguiCalc │ ├── AguiCalc.vcproj │ ├── BorderLayout.cpp │ ├── BorderLayout.hpp │ ├── Button.cpp │ ├── Button.hpp │ ├── Calculator.cpp │ ├── Calculator.hpp │ ├── CalculatorMain.cpp │ ├── CalculatorManager.cpp │ ├── CalculatorManager.hpp │ ├── File.cpp │ ├── File.hpp │ ├── FlowLayout.cpp │ ├── FlowLayout.hpp │ ├── Frame.cpp │ ├── Frame.hpp │ ├── GridLayout.cpp │ ├── GridLayout.hpp │ ├── GuiFactory.cpp │ ├── GuiFactory.hpp │ ├── GuiFontManager.cpp │ ├── GuiFontManager.hpp │ ├── GuiImageManager.cpp │ ├── GuiImageManager.hpp │ ├── PopUpMenu.cpp │ ├── PopUpMenu.hpp │ ├── TextField.cpp │ ├── TextField.hpp │ ├── ToolTip.cpp │ ├── ToolTip.hpp │ └── data │ ├── DejaVuSans.ttf │ ├── button.click.png │ ├── button.default.png │ ├── button.disabled.png │ ├── button.focus.png │ ├── button.hover.png │ ├── frame.bg.png │ ├── gui_image_mapping.conf │ ├── popup.bg.png │ ├── popup.highlight.png │ ├── textbox.focus.png │ ├── textfield.bg.png │ ├── textfield.focus.png │ ├── textfield.png │ ├── tooltip.bg.png │ ├── whitebutton.click.png │ ├── whitebutton.click_alt.png │ ├── whitebutton.default.png │ └── whitebutton.hover.png ├── example ├── agui_example_a5.cpp ├── agui_example_sfml2.cpp └── data │ ├── DejaVuSans.LICENSE │ └── DejaVuSans.ttf ├── include └── Agui │ ├── ActionEvent.hpp │ ├── ActionListener.hpp │ ├── Agui.hpp │ ├── Backends │ ├── Allegro5 │ │ ├── Allegro5.hpp │ │ ├── Allegro5CursorProvider.hpp │ │ ├── Allegro5Font.hpp │ │ ├── Allegro5FontLoader.hpp │ │ ├── Allegro5Graphics.hpp │ │ ├── Allegro5Image.hpp │ │ ├── Allegro5ImageLoader.hpp │ │ └── Allegro5Input.hpp │ └── SFML2 │ │ ├── SFML2.hpp │ │ ├── SFML2Font.hpp │ │ ├── SFML2FontLoader.hpp │ │ ├── SFML2Graphics.hpp │ │ ├── SFML2Image.hpp │ │ ├── SFML2ImageLoader.hpp │ │ └── SFML2Input.hpp │ ├── BaseTypes.hpp │ ├── BlinkingEvent.hpp │ ├── BorderLayout.hpp │ ├── Clipboard │ ├── Clipboard.hpp │ ├── OSXClipboard.hpp │ └── WinClipboard.hpp │ ├── Color.hpp │ ├── CursorProvider.hpp │ ├── Dimension.hpp │ ├── EmptyWidget.hpp │ ├── Enumerations.hpp │ ├── EventArgs.hpp │ ├── FlowLayout.hpp │ ├── FocusListener.hpp │ ├── FocusManager.hpp │ ├── Font.hpp │ ├── FontLoader.hpp │ ├── Graphics.hpp │ ├── GridLayout.hpp │ ├── Gui.hpp │ ├── Image.hpp │ ├── ImageLoader.hpp │ ├── Input.hpp │ ├── KeyboardListener.hpp │ ├── Layout.hpp │ ├── MouseListener.hpp │ ├── Platform.hpp │ ├── Point.hpp │ ├── Rectangle.hpp │ ├── ResizableBorderLayout.hpp │ ├── ResizableText.hpp │ ├── SelectionListener.hpp │ ├── TableLayout.hpp │ ├── TapListener.hpp │ ├── TopContainer.hpp │ ├── Transform.hpp │ ├── UTF8.hpp │ ├── Widget.hpp │ ├── WidgetListener.hpp │ └── Widgets │ ├── Button │ ├── Button.hpp │ ├── ButtonGroup.hpp │ └── ButtonListener.hpp │ ├── CheckBox │ ├── CheckBox.hpp │ └── CheckBoxListener.hpp │ ├── DropDown │ ├── DropDown.hpp │ └── DropDownListener.hpp │ ├── Frame │ ├── Frame.hpp │ └── FrameListener.hpp │ ├── ImageWidget │ └── ImageWidget.hpp │ ├── Label │ ├── Label.hpp │ └── LabelListener.hpp │ ├── ListBox │ ├── ListBox.hpp │ └── ListBoxListener.hpp │ ├── PopUp │ ├── PopUpMenu.hpp │ └── PopUpMenuItem.hpp │ ├── RadioButton │ ├── RadioButton.hpp │ ├── RadioButtonGroup.hpp │ └── RadioButtonListener.hpp │ ├── ScrollBar │ ├── HScrollBar.hpp │ ├── HScrollBarListener.hpp │ ├── VScrollBar.hpp │ └── VScrollBarListener.hpp │ ├── ScrollPane │ └── ScrollPane.hpp │ ├── Slider │ ├── Slider.hpp │ └── SliderListener.hpp │ ├── Tab │ ├── Tab.hpp │ ├── TabbedPane.hpp │ └── TabbedPaneListener.hpp │ ├── TextBox │ ├── ExtendedTextBox.hpp │ ├── TextBox.hpp │ └── TextBoxListener.hpp │ ├── TextField │ ├── TextField.hpp │ └── TextFieldListener.hpp │ └── ToolTip │ └── ToolTip.hpp └── src └── Agui ├── ActionEvent.cpp ├── ActionListener.cpp ├── Backends ├── Allegro5 │ ├── Allegro5CursorProvider.cpp │ ├── Allegro5Font.cpp │ ├── Allegro5FontLoader.cpp │ ├── Allegro5Graphics.cpp │ ├── Allegro5Image.cpp │ ├── Allegro5ImageLoader.cpp │ └── Allegro5Input.cpp └── SFML2 │ ├── SFML2Font.cpp │ ├── SFML2FontLoader.cpp │ ├── SFML2Graphics.cpp │ ├── SFML2Image.cpp │ ├── SFML2ImageLoader.cpp │ └── SFML2Input.cpp ├── BaseTypes.cpp ├── BlinkingEvent.cpp ├── BorderLayout.cpp ├── Clipboard ├── Clipboard.cpp ├── OSXClipboard.mm └── WinClipboard.cpp ├── Color.cpp ├── CursorProvider.cpp ├── Dimension.cpp ├── EmptyWidget.cpp ├── EventArgs.cpp ├── FlowLayout.cpp ├── FocusListener.cpp ├── FocusManager.cpp ├── Font.cpp ├── Graphics.cpp ├── GridLayout.cpp ├── Gui.cpp ├── Image.cpp ├── Input.cpp ├── KeyboardListener.cpp ├── Layout.cpp ├── MouseListener.cpp ├── Point.cpp ├── Rectangle.cpp ├── ResizableBorderLayout.cpp ├── ResizableText.cpp ├── SelectionListener.cpp ├── TableLayout.cpp ├── TapListener.cpp ├── TopContainer.cpp ├── Transform.cpp ├── Widget.cpp ├── WidgetListener.cpp └── Widgets ├── Button ├── Button.cpp ├── ButtonGroup.cpp └── ButtonListener.cpp ├── CheckBox ├── CheckBox.cpp └── CheckBoxListener.cpp ├── DropDown ├── DropDown.cpp └── DropDownListener.cpp ├── Frame ├── Frame.cpp └── FrameListener.cpp ├── ImageWidget └── ImageWidget.cpp ├── Label ├── Label.cpp └── LabelListener.cpp ├── ListBox ├── ListBox.cpp └── ListBoxListener.cpp ├── PopUp ├── PopUpMenu.cpp └── PopUpMenuItem.cpp ├── RadioButton ├── RadioButton.cpp ├── RadioButtonGroup.cpp └── RadioButtonListener.cpp ├── ScrollBar ├── HScrollBar.cpp ├── HScrollBarListener.cpp ├── VScrollBar.cpp └── VScrollBarListener.cpp ├── ScrollPane └── ScrollPane.cpp ├── Slider ├── Slider.cpp └── SliderListener.cpp ├── Tab ├── Tab.cpp ├── TabbedPane.cpp └── TabbedPaneListener.cpp ├── TextBox ├── ExtendedTextBox.cpp ├── TextBox.cpp └── TextBoxListener.cpp ├── TextField ├── TextField.cpp └── TextFieldListener.cpp └── ToolTip └── ToolTip.cpp /.gitignore: -------------------------------------------------------------------------------- 1 | # Compiled Object files 2 | *.slo 3 | *.lo 4 | *.o 5 | *.obj 6 | 7 | # Compiled Dynamic libraries 8 | *.so 9 | *.dylib 10 | *.dll 11 | 12 | # Compiled Static libraries 13 | *.lai 14 | *.la 15 | *.a 16 | *.lib 17 | 18 | # Executables 19 | *.exe 20 | *.out 21 | *.app 22 | -------------------------------------------------------------------------------- /LICENCE.txt: -------------------------------------------------------------------------------- 1 | Copyright (c) 2011 Joshua Larouche 2 | 3 | License: (BSD) 4 | Redistribution and use in source and binary forms, with or without 5 | modification, are permitted provided that the following conditions 6 | are met: 7 | 1. Redistributions of source code must retain the above copyright 8 | notice, this list of conditions and the following disclaimer. 9 | 2. Redistributions in binary form must reproduce the above copyright 10 | notice, this list of conditions and the following disclaimer in 11 | the documentation and/or other materials provided with the distribution. 12 | 3. Neither the name of Agui nor the names of its contributors may 13 | be used to endorse or promote products derived from this software 14 | without specific prior written permission. 15 | 16 | THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS 17 | "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT 18 | LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR 19 | A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT 20 | OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, 21 | SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED 22 | TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR 23 | PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF 24 | LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING 25 | NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS 26 | SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 27 | -------------------------------------------------------------------------------- /LICENSE: -------------------------------------------------------------------------------- 1 | Copyright (c) 2014, jmasterx 2 | All rights reserved. 3 | 4 | Redistribution and use in source and binary forms, with or without 5 | modification, are permitted provided that the following conditions are met: 6 | 7 | * Redistributions of source code must retain the above copyright notice, this 8 | list of conditions and the following disclaimer. 9 | 10 | * Redistributions in binary form must reproduce the above copyright notice, 11 | this list of conditions and the following disclaimer in the documentation 12 | and/or other materials provided with the distribution. 13 | 14 | * Neither the name of the {organization} nor the names of its 15 | contributors may be used to endorse or promote products derived from 16 | this software without specific prior written permission. 17 | 18 | THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" 19 | AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE 20 | IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE 21 | DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE 22 | FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL 23 | DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR 24 | SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER 25 | CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, 26 | OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE 27 | OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | Agui 2 | ==== 3 | 4 | C++ GUI API Aimed at Games 5 | 6 | Agui is an Object Oriented Graphical User Interface library for games written in C++. It has full UTF8 Unicode support and is back end independent. Comes with many widgets by default. 7 | 8 | Agui uses the CMAKE build system. 9 | 10 | Currently Allegro5 and SFML2 backends are implemented and supported. 11 | 12 | Agui is used in Stemwater Spades https://github.com/jmasterx/StemwaterSpades and the popular commercial game Factorio: [Factorio Credits](https://www.factorio.com/game/about) 13 | -------------------------------------------------------------------------------- /demo/AguiCalc/AguiCalc.sln: -------------------------------------------------------------------------------- 1 |  2 | Microsoft Visual Studio Solution File, Format Version 10.00 3 | # Visual Studio 2008 4 | Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "AguiCalc", "AguiCalc\AguiCalc.vcproj", "{A15CB1C9-7884-4B1B-BB3C-0F97B6DDCE67}" 5 | EndProject 6 | Global 7 | GlobalSection(SolutionConfigurationPlatforms) = preSolution 8 | Debug|Win32 = Debug|Win32 9 | Release|Win32 = Release|Win32 10 | EndGlobalSection 11 | GlobalSection(ProjectConfigurationPlatforms) = postSolution 12 | {A15CB1C9-7884-4B1B-BB3C-0F97B6DDCE67}.Debug|Win32.ActiveCfg = Debug|Win32 13 | {A15CB1C9-7884-4B1B-BB3C-0F97B6DDCE67}.Debug|Win32.Build.0 = Debug|Win32 14 | {A15CB1C9-7884-4B1B-BB3C-0F97B6DDCE67}.Release|Win32.ActiveCfg = Release|Win32 15 | {A15CB1C9-7884-4B1B-BB3C-0F97B6DDCE67}.Release|Win32.Build.0 = Release|Win32 16 | EndGlobalSection 17 | GlobalSection(SolutionProperties) = preSolution 18 | HideSolutionNode = FALSE 19 | EndGlobalSection 20 | EndGlobal 21 | -------------------------------------------------------------------------------- /demo/AguiCalc/AguiCalc/BorderLayout.hpp: -------------------------------------------------------------------------------- 1 | /* _____ 2 | * /\ _ \ __ 3 | * \ \ \_\ \ __ __ __ /\_\ 4 | * \ \ __ \ /'_ `\ /\ \/\ \\/\ \ 5 | * \ \ \/\ \ /\ \_\ \\ \ \_\ \\ \ \ 6 | * \ \_\ \_\\ \____ \\ \____/ \ \_\ 7 | * \/_/\/_/ \/____\ \\/___/ \/_/ 8 | * /\____/ 9 | * \_/__/ 10 | * 11 | * Copyright (c) 2011 Joshua Larouche 12 | * 13 | * 14 | * License: (BSD) 15 | * Redistribution and use in source and binary forms, with or without 16 | * modification, are permitted provided that the following conditions 17 | * are met: 18 | * 1. Redistributions of source code must retain the above copyright 19 | * notice, this list of conditions and the following disclaimer. 20 | * 2. Redistributions in binary form must reproduce the above copyright 21 | * notice, this list of conditions and the following disclaimer in 22 | * the documentation and/or other materials provided with the 23 | * distribution. 24 | * 3. Neither the name of Agui nor the names of its contributors may 25 | * be used to endorse or promote products derived from this software 26 | * without specific prior written permission. 27 | * 28 | * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS 29 | * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT 30 | * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR 31 | * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT 32 | * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, 33 | * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED 34 | * TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR 35 | * PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF 36 | * LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING 37 | * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS 38 | * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 39 | */ 40 | 41 | #ifndef CGE_BORDER_LAYOUT_HPP 42 | #define CGE_BORDER_LAYOUT_HPP 43 | #include "Agui/ResizableBorderLayout.hpp" 44 | 45 | namespace cge 46 | { 47 | class BorderLayout : public agui::ResizableBorderLayout 48 | { 49 | agui::Image* m_horzImg; 50 | agui::Image* m_vertImg; 51 | agui::Image* m_vertFlipImg; 52 | bool m_paint; 53 | public: 54 | BorderLayout(agui::Image* horzImg, 55 | agui::Image* vertImg, agui::Image* vertFlipImg); 56 | virtual void paintBackground(const agui::PaintEvent &paintEvent); 57 | virtual void paintComponent(const agui::PaintEvent &paintEvent); 58 | void setPaintingBorders(bool painting); 59 | virtual ~BorderLayout(void); 60 | }; 61 | } 62 | 63 | #endif 64 | -------------------------------------------------------------------------------- /demo/AguiCalc/AguiCalc/CalculatorManager.hpp: -------------------------------------------------------------------------------- 1 | /* _____ 2 | * /\ _ \ __ 3 | * \ \ \_\ \ __ __ __ /\_\ 4 | * \ \ __ \ /'_ `\ /\ \/\ \\/\ \ 5 | * \ \ \/\ \ /\ \_\ \\ \ \_\ \\ \ \ 6 | * \ \_\ \_\\ \____ \\ \____/ \ \_\ 7 | * \/_/\/_/ \/____\ \\/___/ \/_/ 8 | * /\____/ 9 | * \_/__/ 10 | * 11 | * Copyright (c) 2011 Joshua Larouche 12 | * 13 | * 14 | * License: (BSD) 15 | * Redistribution and use in source and binary forms, with or without 16 | * modification, are permitted provided that the following conditions 17 | * are met: 18 | * 1. Redistributions of source code must retain the above copyright 19 | * notice, this list of conditions and the following disclaimer. 20 | * 2. Redistributions in binary form must reproduce the above copyright 21 | * notice, this list of conditions and the following disclaimer in 22 | * the documentation and/or other materials provided with the 23 | * distribution. 24 | * 3. Neither the name of Agui nor the names of its contributors may 25 | * be used to endorse or promote products derived from this software 26 | * without specific prior written permission. 27 | * 28 | * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS 29 | * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT 30 | * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR 31 | * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT 32 | * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, 33 | * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED 34 | * TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR 35 | * PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF 36 | * LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING 37 | * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS 38 | * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 39 | */ 40 | 41 | #ifndef CGE_CALC_MAN_HPP 42 | #define CGE_CALC_MAN_HPP 43 | #include 44 | #include 45 | #include "Calculator.hpp" 46 | #include "GuiImageManager.hpp" 47 | #include "GuiFontManager.hpp" 48 | #include 49 | #include 50 | #include 51 | namespace cge 52 | { 53 | class CalculatorManager : public agui::ActionListener 54 | { 55 | std::vector m_calcs; 56 | std::queue m_deadCalcs; 57 | public: 58 | CalculatorManager(void); 59 | ~CalculatorManager(void); 60 | 61 | virtual void actionPerformed( const agui::ActionEvent &evt ); 62 | 63 | void createCalc(GuiFontManager* font, GuiImageManager* img, agui::Gui* gui); 64 | 65 | void destroyDeadCalcs(); 66 | 67 | }; 68 | } 69 | #endif -------------------------------------------------------------------------------- /demo/AguiCalc/AguiCalc/File.hpp: -------------------------------------------------------------------------------- 1 | /* _____ 2 | * /\ _ \ __ 3 | * \ \ \_\ \ __ __ __ /\_\ 4 | * \ \ __ \ /'_ `\ /\ \/\ \\/\ \ 5 | * \ \ \/\ \ /\ \_\ \\ \ \_\ \\ \ \ 6 | * \ \_\ \_\\ \____ \\ \____/ \ \_\ 7 | * \/_/\/_/ \/____\ \\/___/ \/_/ 8 | * /\____/ 9 | * \_/__/ 10 | * 11 | * Copyright (c) 2011 Joshua Larouche 12 | * 13 | * 14 | * License: (BSD) 15 | * Redistribution and use in source and binary forms, with or without 16 | * modification, are permitted provided that the following conditions 17 | * are met: 18 | * 1. Redistributions of source code must retain the above copyright 19 | * notice, this list of conditions and the following disclaimer. 20 | * 2. Redistributions in binary form must reproduce the above copyright 21 | * notice, this list of conditions and the following disclaimer in 22 | * the documentation and/or other materials provided with the 23 | * distribution. 24 | * 3. Neither the name of Agui nor the names of its contributors may 25 | * be used to endorse or promote products derived from this software 26 | * without specific prior written permission. 27 | * 28 | * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS 29 | * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT 30 | * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR 31 | * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT 32 | * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, 33 | * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED 34 | * TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR 35 | * PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF 36 | * LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING 37 | * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS 38 | * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 39 | */ 40 | 41 | #ifndef CGE_FILE_HPP 42 | #define CGE_FILE_HPP 43 | #include 44 | #include 45 | #include 46 | #include 47 | namespace cge 48 | { 49 | class File 50 | { 51 | ALLEGRO_FILE* m_file; 52 | public: 53 | File(void); 54 | bool close(); 55 | bool isOpen() const; 56 | bool readLine(std::string& buff); 57 | bool readAll(std::string& buff); 58 | bool open(const std::string& fileName, const std::string& openMode); 59 | File(const std::string& fileName, const std::string& openMode = "r"); 60 | bool eof() const; 61 | ~File(void); 62 | }; 63 | }; 64 | 65 | #endif -------------------------------------------------------------------------------- /demo/AguiCalc/AguiCalc/FlowLayout.cpp: -------------------------------------------------------------------------------- 1 | /* _____ 2 | * /\ _ \ __ 3 | * \ \ \_\ \ __ __ __ /\_\ 4 | * \ \ __ \ /'_ `\ /\ \/\ \\/\ \ 5 | * \ \ \/\ \ /\ \_\ \\ \ \_\ \\ \ \ 6 | * \ \_\ \_\\ \____ \\ \____/ \ \_\ 7 | * \/_/\/_/ \/____\ \\/___/ \/_/ 8 | * /\____/ 9 | * \_/__/ 10 | * 11 | * Copyright (c) 2011 Joshua Larouche 12 | * 13 | * 14 | * License: (BSD) 15 | * Redistribution and use in source and binary forms, with or without 16 | * modification, are permitted provided that the following conditions 17 | * are met: 18 | * 1. Redistributions of source code must retain the above copyright 19 | * notice, this list of conditions and the following disclaimer. 20 | * 2. Redistributions in binary form must reproduce the above copyright 21 | * notice, this list of conditions and the following disclaimer in 22 | * the documentation and/or other materials provided with the 23 | * distribution. 24 | * 3. Neither the name of Agui nor the names of its contributors may 25 | * be used to endorse or promote products derived from this software 26 | * without specific prior written permission. 27 | * 28 | * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS 29 | * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT 30 | * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR 31 | * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT 32 | * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, 33 | * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED 34 | * TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR 35 | * PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF 36 | * LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING 37 | * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS 38 | * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 39 | */ 40 | #include "FlowLayout.hpp" 41 | namespace cge 42 | { 43 | FlowLayout::FlowLayout(void) 44 | { 45 | } 46 | 47 | FlowLayout::~FlowLayout(void) 48 | { 49 | } 50 | 51 | void FlowLayout::layoutChildren() 52 | { 53 | if(getGui()) 54 | { 55 | getGui()->toggleWidgetLocationChanged(false); 56 | } 57 | 58 | agui::FlowLayout::layoutChildren(); 59 | if(getGui()) 60 | { 61 | getGui()->toggleWidgetLocationChanged(true); 62 | getGui()->_widgetLocationChanged(); 63 | } 64 | 65 | } 66 | 67 | } 68 | -------------------------------------------------------------------------------- /demo/AguiCalc/AguiCalc/FlowLayout.hpp: -------------------------------------------------------------------------------- 1 | /* _____ 2 | * /\ _ \ __ 3 | * \ \ \_\ \ __ __ __ /\_\ 4 | * \ \ __ \ /'_ `\ /\ \/\ \\/\ \ 5 | * \ \ \/\ \ /\ \_\ \\ \ \_\ \\ \ \ 6 | * \ \_\ \_\\ \____ \\ \____/ \ \_\ 7 | * \/_/\/_/ \/____\ \\/___/ \/_/ 8 | * /\____/ 9 | * \_/__/ 10 | * 11 | * Copyright (c) 2011 Joshua Larouche 12 | * 13 | * 14 | * License: (BSD) 15 | * Redistribution and use in source and binary forms, with or without 16 | * modification, are permitted provided that the following conditions 17 | * are met: 18 | * 1. Redistributions of source code must retain the above copyright 19 | * notice, this list of conditions and the following disclaimer. 20 | * 2. Redistributions in binary form must reproduce the above copyright 21 | * notice, this list of conditions and the following disclaimer in 22 | * the documentation and/or other materials provided with the 23 | * distribution. 24 | * 3. Neither the name of Agui nor the names of its contributors may 25 | * be used to endorse or promote products derived from this software 26 | * without specific prior written permission. 27 | * 28 | * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS 29 | * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT 30 | * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR 31 | * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT 32 | * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, 33 | * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED 34 | * TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR 35 | * PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF 36 | * LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING 37 | * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS 38 | * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 39 | */ 40 | 41 | #ifndef CGE_FLOW_LAYOUT_HPP 42 | #define CGE_FLOW_LAYOUT_HPP 43 | #include "Agui/FlowLayout.hpp" 44 | namespace cge 45 | { 46 | class FlowLayout : public agui::FlowLayout 47 | { 48 | public: 49 | FlowLayout(void); 50 | virtual ~FlowLayout(void); 51 | virtual void layoutChildren(); 52 | }; 53 | } 54 | 55 | #endif 56 | -------------------------------------------------------------------------------- /demo/AguiCalc/AguiCalc/Frame.hpp: -------------------------------------------------------------------------------- 1 | /* _____ 2 | * /\ _ \ __ 3 | * \ \ \_\ \ __ __ __ /\_\ 4 | * \ \ __ \ /'_ `\ /\ \/\ \\/\ \ 5 | * \ \ \/\ \ /\ \_\ \\ \ \_\ \\ \ \ 6 | * \ \_\ \_\\ \____ \\ \____/ \ \_\ 7 | * \/_/\/_/ \/____\ \\/___/ \/_/ 8 | * /\____/ 9 | * \_/__/ 10 | * 11 | * Copyright (c) 2011 Joshua Larouche 12 | * 13 | * 14 | * License: (BSD) 15 | * Redistribution and use in source and binary forms, with or without 16 | * modification, are permitted provided that the following conditions 17 | * are met: 18 | * 1. Redistributions of source code must retain the above copyright 19 | * notice, this list of conditions and the following disclaimer. 20 | * 2. Redistributions in binary form must reproduce the above copyright 21 | * notice, this list of conditions and the following disclaimer in 22 | * the documentation and/or other materials provided with the 23 | * distribution. 24 | * 3. Neither the name of Agui nor the names of its contributors may 25 | * be used to endorse or promote products derived from this software 26 | * without specific prior written permission. 27 | * 28 | * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS 29 | * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT 30 | * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR 31 | * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT 32 | * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, 33 | * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED 34 | * TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR 35 | * PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF 36 | * LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING 37 | * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS 38 | * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 39 | */ 40 | 41 | #ifndef CGE_FRAME_HPP 42 | #define CGE_FRAME_HPP 43 | #include "Agui/Widgets/Frame/Frame.hpp" 44 | namespace cge 45 | { 46 | class Frame : public agui::Frame 47 | { 48 | agui::Image* m_bg; 49 | protected: 50 | virtual void paintBackground(const agui::PaintEvent &paintEvent); 51 | virtual void paintComponent(const agui::PaintEvent &paintEvent); 52 | public: 53 | Frame(agui::Image* bg, Widget* content); 54 | virtual void setFont(const agui::Font *font); 55 | virtual bool intersectionWithPoint(const agui::Point &p) const; 56 | virtual void setLocation(const agui::Point &location); 57 | virtual void setLocation(int x, int y); 58 | virtual void mouseMove(agui::MouseEvent &mouseEvent); 59 | virtual void mouseDrag(agui::MouseEvent &mouseEvent); 60 | virtual void mouseUp(agui::MouseEvent &mouseEvent); 61 | virtual ~Frame(void); 62 | }; 63 | } 64 | 65 | #endif 66 | -------------------------------------------------------------------------------- /demo/AguiCalc/AguiCalc/GridLayout.cpp: -------------------------------------------------------------------------------- 1 | /* _____ 2 | * /\ _ \ __ 3 | * \ \ \_\ \ __ __ __ /\_\ 4 | * \ \ __ \ /'_ `\ /\ \/\ \\/\ \ 5 | * \ \ \/\ \ /\ \_\ \\ \ \_\ \\ \ \ 6 | * \ \_\ \_\\ \____ \\ \____/ \ \_\ 7 | * \/_/\/_/ \/____\ \\/___/ \/_/ 8 | * /\____/ 9 | * \_/__/ 10 | * 11 | * Copyright (c) 2011 Joshua Larouche 12 | * 13 | * 14 | * License: (BSD) 15 | * Redistribution and use in source and binary forms, with or without 16 | * modification, are permitted provided that the following conditions 17 | * are met: 18 | * 1. Redistributions of source code must retain the above copyright 19 | * notice, this list of conditions and the following disclaimer. 20 | * 2. Redistributions in binary form must reproduce the above copyright 21 | * notice, this list of conditions and the following disclaimer in 22 | * the documentation and/or other materials provided with the 23 | * distribution. 24 | * 3. Neither the name of Agui nor the names of its contributors may 25 | * be used to endorse or promote products derived from this software 26 | * without specific prior written permission. 27 | * 28 | * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS 29 | * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT 30 | * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR 31 | * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT 32 | * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, 33 | * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED 34 | * TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR 35 | * PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF 36 | * LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING 37 | * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS 38 | * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 39 | */ 40 | 41 | #include "GridLayout.hpp" 42 | 43 | namespace cge 44 | { 45 | GridLayout::GridLayout() 46 | { 47 | } 48 | 49 | GridLayout::~GridLayout(void) 50 | { 51 | } 52 | 53 | } 54 | -------------------------------------------------------------------------------- /demo/AguiCalc/AguiCalc/GridLayout.hpp: -------------------------------------------------------------------------------- 1 | /* _____ 2 | * /\ _ \ __ 3 | * \ \ \_\ \ __ __ __ /\_\ 4 | * \ \ __ \ /'_ `\ /\ \/\ \\/\ \ 5 | * \ \ \/\ \ /\ \_\ \\ \ \_\ \\ \ \ 6 | * \ \_\ \_\\ \____ \\ \____/ \ \_\ 7 | * \/_/\/_/ \/____\ \\/___/ \/_/ 8 | * /\____/ 9 | * \_/__/ 10 | * 11 | * Copyright (c) 2011 Joshua Larouche 12 | * 13 | * 14 | * License: (BSD) 15 | * Redistribution and use in source and binary forms, with or without 16 | * modification, are permitted provided that the following conditions 17 | * are met: 18 | * 1. Redistributions of source code must retain the above copyright 19 | * notice, this list of conditions and the following disclaimer. 20 | * 2. Redistributions in binary form must reproduce the above copyright 21 | * notice, this list of conditions and the following disclaimer in 22 | * the documentation and/or other materials provided with the 23 | * distribution. 24 | * 3. Neither the name of Agui nor the names of its contributors may 25 | * be used to endorse or promote products derived from this software 26 | * without specific prior written permission. 27 | * 28 | * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS 29 | * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT 30 | * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR 31 | * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT 32 | * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, 33 | * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED 34 | * TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR 35 | * PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF 36 | * LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING 37 | * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS 38 | * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 39 | */ 40 | 41 | #ifndef CGE_GRID_LAYOUT_HPP 42 | #define CGE_GRID_LAYOUT_HPP 43 | #include "Agui/GridLayout.hpp" 44 | namespace cge 45 | { 46 | class GridLayout : public agui::GridLayout 47 | { 48 | public: 49 | GridLayout(); 50 | virtual ~GridLayout(void); 51 | }; 52 | } 53 | 54 | #endif 55 | -------------------------------------------------------------------------------- /demo/AguiCalc/AguiCalc/GuiFontManager.hpp: -------------------------------------------------------------------------------- 1 | /* _____ 2 | * /\ _ \ __ 3 | * \ \ \_\ \ __ __ __ /\_\ 4 | * \ \ __ \ /'_ `\ /\ \/\ \\/\ \ 5 | * \ \ \/\ \ /\ \_\ \\ \ \_\ \\ \ \ 6 | * \ \_\ \_\\ \____ \\ \____/ \ \_\ 7 | * \/_/\/_/ \/____\ \\/___/ \/_/ 8 | * /\____/ 9 | * \_/__/ 10 | * 11 | * Copyright (c) 2011 Joshua Larouche 12 | * 13 | * 14 | * License: (BSD) 15 | * Redistribution and use in source and binary forms, with or without 16 | * modification, are permitted provided that the following conditions 17 | * are met: 18 | * 1. Redistributions of source code must retain the above copyright 19 | * notice, this list of conditions and the following disclaimer. 20 | * 2. Redistributions in binary form must reproduce the above copyright 21 | * notice, this list of conditions and the following disclaimer in 22 | * the documentation and/or other materials provided with the 23 | * distribution. 24 | * 3. Neither the name of Agui nor the names of its contributors may 25 | * be used to endorse or promote products derived from this software 26 | * without specific prior written permission. 27 | * 28 | * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS 29 | * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT 30 | * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR 31 | * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT 32 | * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, 33 | * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED 34 | * TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR 35 | * PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF 36 | * LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING 37 | * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS 38 | * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 39 | */ 40 | 41 | #ifndef CGE_GUI_FONT_MANAGER_HPP 42 | #define CGE_GUI_FONT_MANAGER_HPP 43 | #include "Agui/Font.hpp" 44 | #include 45 | namespace cge 46 | { 47 | class GuiFontManager 48 | { 49 | std::vector m_fonts; 50 | int m_beginRange; 51 | int m_endRange; 52 | float m_defaultSize; 53 | public: 54 | GuiFontManager(const std::string& fontPath, 55 | int beginRange, int endRange, int defaultSize); 56 | agui::Font* getDefaultFont() const; 57 | agui::Font* getFont(int size) const; 58 | agui::Font* getFont(float scale) const; 59 | agui::Font* getFont(agui::Font* ref, float scale) const; 60 | virtual ~GuiFontManager(void); 61 | }; 62 | } 63 | 64 | #endif 65 | -------------------------------------------------------------------------------- /demo/AguiCalc/AguiCalc/GuiImageManager.hpp: -------------------------------------------------------------------------------- 1 | /* _____ 2 | * /\ _ \ __ 3 | * \ \ \_\ \ __ __ __ /\_\ 4 | * \ \ __ \ /'_ `\ /\ \/\ \\/\ \ 5 | * \ \ \/\ \ /\ \_\ \\ \ \_\ \\ \ \ 6 | * \ \_\ \_\\ \____ \\ \____/ \ \_\ 7 | * \/_/\/_/ \/____\ \\/___/ \/_/ 8 | * /\____/ 9 | * \_/__/ 10 | * 11 | * Copyright (c) 2011 Joshua Larouche 12 | * 13 | * 14 | * License: (BSD) 15 | * Redistribution and use in source and binary forms, with or without 16 | * modification, are permitted provided that the following conditions 17 | * are met: 18 | * 1. Redistributions of source code must retain the above copyright 19 | * notice, this list of conditions and the following disclaimer. 20 | * 2. Redistributions in binary form must reproduce the above copyright 21 | * notice, this list of conditions and the following disclaimer in 22 | * the documentation and/or other materials provided with the 23 | * distribution. 24 | * 3. Neither the name of Agui nor the names of its contributors may 25 | * be used to endorse or promote products derived from this software 26 | * without specific prior written permission. 27 | * 28 | * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS 29 | * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT 30 | * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR 31 | * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT 32 | * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, 33 | * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED 34 | * TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR 35 | * PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF 36 | * LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING 37 | * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS 38 | * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 39 | */ 40 | 41 | #ifndef CGE_GUI_IMAGE_MANAGER_HPP 42 | #define CGE_GUI_IMAGE_MANAGER_HPP 43 | #include "Agui/Agui.hpp" 44 | #include 45 | namespace cge 46 | { 47 | class GuiImageManager 48 | { 49 | std::map m_images; 50 | bool _loadImages(const std::string& path, const std::string& appendPath); 51 | public: 52 | bool mapImage(const std::string& imageName, const std::string& imagePath); 53 | agui::Image* getImage(const std::string& imageName); 54 | GuiImageManager(const std::string& path,const std::string& appendPath); 55 | virtual ~GuiImageManager(void); 56 | }; 57 | } 58 | 59 | #endif 60 | -------------------------------------------------------------------------------- /demo/AguiCalc/AguiCalc/PopUpMenu.hpp: -------------------------------------------------------------------------------- 1 | /* _____ 2 | * /\ _ \ __ 3 | * \ \ \_\ \ __ __ __ /\_\ 4 | * \ \ __ \ /'_ `\ /\ \/\ \\/\ \ 5 | * \ \ \/\ \ /\ \_\ \\ \ \_\ \\ \ \ 6 | * \ \_\ \_\\ \____ \\ \____/ \ \_\ 7 | * \/_/\/_/ \/____\ \\/___/ \/_/ 8 | * /\____/ 9 | * \_/__/ 10 | * 11 | * Copyright (c) 2011 Joshua Larouche 12 | * 13 | * 14 | * License: (BSD) 15 | * Redistribution and use in source and binary forms, with or without 16 | * modification, are permitted provided that the following conditions 17 | * are met: 18 | * 1. Redistributions of source code must retain the above copyright 19 | * notice, this list of conditions and the following disclaimer. 20 | * 2. Redistributions in binary form must reproduce the above copyright 21 | * notice, this list of conditions and the following disclaimer in 22 | * the documentation and/or other materials provided with the 23 | * distribution. 24 | * 3. Neither the name of Agui nor the names of its contributors may 25 | * be used to endorse or promote products derived from this software 26 | * without specific prior written permission. 27 | * 28 | * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS 29 | * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT 30 | * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR 31 | * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT 32 | * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, 33 | * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED 34 | * TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR 35 | * PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF 36 | * LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING 37 | * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS 38 | * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 39 | */ 40 | 41 | #ifndef CGE_POPUP_MENU_HPP 42 | #define CGE_POPUP_MENU_HPP 43 | #include "Agui/Widgets/PopUp/PopUpMenu.hpp" 44 | namespace cge 45 | { 46 | class PopUpMenu : public agui::PopUpMenu 47 | { 48 | agui::Image* m_popUpBg; 49 | agui::Image* m_highlightImg; 50 | agui::Image* m_subArrowImg; 51 | agui::Color m_disabledFontColor; 52 | float m_opacityRate; 53 | protected: 54 | virtual void paintBackground(const agui::PaintEvent &paintEvent); 55 | virtual void paintComponent(const agui::PaintEvent &paintEvent); 56 | public: 57 | PopUpMenu(agui::Image* popUpBg, 58 | agui::Image* highlightImg, 59 | agui::Image* subArrowImg); 60 | virtual void showPopUp(agui::Widget* invoker, int x, int y, 61 | agui::PopUpMenu* parentPopUp = NULL); 62 | virtual void logic(double timeElapsed); 63 | virtual void setDisabledFontColor(const agui::Color& color); 64 | virtual const agui::Color& getDisabledFontColor() const; 65 | virtual ~PopUpMenu(void); 66 | }; 67 | } 68 | #endif -------------------------------------------------------------------------------- /demo/AguiCalc/AguiCalc/TextField.hpp: -------------------------------------------------------------------------------- 1 | /* _____ 2 | * /\ _ \ __ 3 | * \ \ \_\ \ __ __ __ /\_\ 4 | * \ \ __ \ /'_ `\ /\ \/\ \\/\ \ 5 | * \ \ \/\ \ /\ \_\ \\ \ \_\ \\ \ \ 6 | * \ \_\ \_\\ \____ \\ \____/ \ \_\ 7 | * \/_/\/_/ \/____\ \\/___/ \/_/ 8 | * /\____/ 9 | * \_/__/ 10 | * 11 | * Copyright (c) 2011 Joshua Larouche 12 | * 13 | * 14 | * License: (BSD) 15 | * Redistribution and use in source and binary forms, with or without 16 | * modification, are permitted provided that the following conditions 17 | * are met: 18 | * 1. Redistributions of source code must retain the above copyright 19 | * notice, this list of conditions and the following disclaimer. 20 | * 2. Redistributions in binary form must reproduce the above copyright 21 | * notice, this list of conditions and the following disclaimer in 22 | * the documentation and/or other materials provided with the 23 | * distribution. 24 | * 3. Neither the name of Agui nor the names of its contributors may 25 | * be used to endorse or promote products derived from this software 26 | * without specific prior written permission. 27 | * 28 | * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS 29 | * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT 30 | * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR 31 | * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT 32 | * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, 33 | * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED 34 | * TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR 35 | * PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF 36 | * LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING 37 | * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS 38 | * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 39 | */ 40 | 41 | #ifndef CGE_TEXTFIELD_HPP 42 | #define CGE_TEXTFIELD_HPP 43 | #include "Agui/Widgets/TextField/TextField.hpp" 44 | #include "PopUpMenu.hpp" 45 | #include "Agui/ActionListener.hpp" 46 | namespace cge 47 | { 48 | class TextField : public agui::TextField, agui::ActionListener 49 | { 50 | agui::Image* m_bgImage; 51 | agui::Image* m_focusImage; 52 | PopUpMenu* m_menu; 53 | agui::PopUpMenuItem m_cutItem; 54 | agui::PopUpMenuItem m_copyItem; 55 | agui::PopUpMenuItem m_pasteItem; 56 | agui::PopUpMenuItem m_deleteItem; 57 | agui::PopUpMenuItem m_selectAllItem; 58 | agui::PopUpMenuItem m_separatorItem; 59 | public: 60 | TextField( agui::Image* bgImage, 61 | agui::Image* focusImage, 62 | PopUpMenu* menu); 63 | virtual void paintBackground(const agui::PaintEvent &paintEvent); 64 | virtual void paintComponent(const agui::PaintEvent &paintEvent); 65 | virtual void actionPerformed(const agui::ActionEvent &evt); 66 | virtual void mouseDown(agui::MouseEvent &mouseEvent); 67 | virtual ~TextField(void); 68 | }; 69 | } 70 | 71 | #endif 72 | -------------------------------------------------------------------------------- /demo/AguiCalc/AguiCalc/ToolTip.cpp: -------------------------------------------------------------------------------- 1 | /* _____ 2 | * /\ _ \ __ 3 | * \ \ \_\ \ __ __ __ /\_\ 4 | * \ \ __ \ /'_ `\ /\ \/\ \\/\ \ 5 | * \ \ \/\ \ /\ \_\ \\ \ \_\ \\ \ \ 6 | * \ \_\ \_\\ \____ \\ \____/ \ \_\ 7 | * \/_/\/_/ \/____\ \\/___/ \/_/ 8 | * /\____/ 9 | * \_/__/ 10 | * 11 | * Copyright (c) 2011 Joshua Larouche 12 | * 13 | * 14 | * License: (BSD) 15 | * Redistribution and use in source and binary forms, with or without 16 | * modification, are permitted provided that the following conditions 17 | * are met: 18 | * 1. Redistributions of source code must retain the above copyright 19 | * notice, this list of conditions and the following disclaimer. 20 | * 2. Redistributions in binary form must reproduce the above copyright 21 | * notice, this list of conditions and the following disclaimer in 22 | * the documentation and/or other materials provided with the 23 | * distribution. 24 | * 3. Neither the name of Agui nor the names of its contributors may 25 | * be used to endorse or promote products derived from this software 26 | * without specific prior written permission. 27 | * 28 | * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS 29 | * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT 30 | * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR 31 | * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT 32 | * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, 33 | * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED 34 | * TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR 35 | * PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF 36 | * LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING 37 | * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS 38 | * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 39 | */ 40 | 41 | #include "ToolTip.hpp" 42 | 43 | namespace cge 44 | { 45 | ToolTip::~ToolTip(void) 46 | { 47 | } 48 | 49 | ToolTip::ToolTip( agui::Image* tooltipBG ) 50 | :m_tooltipBG(tooltipBG), m_opacityRate(0.1f) 51 | { 52 | } 53 | 54 | void ToolTip::paintBackground( const agui::PaintEvent &paintEvent ) 55 | { 56 | paintEvent.graphics()->drawNinePatchImage( 57 | m_tooltipBG,agui::Point(0,0),getSize(),getOpacity()); 58 | } 59 | 60 | void ToolTip::showToolTip( const std::string& text, int width, int x, int y, Widget* invoker ) 61 | { 62 | agui::ToolTip::showToolTip(text,width,x,y, invoker); 63 | setOpacity(0.0f); 64 | } 65 | 66 | void ToolTip::logic( double timeElapsed ) 67 | { 68 | if(getOpacity() < 1.0f) 69 | { 70 | setOpacity(getOpacity() + m_opacityRate); 71 | } 72 | } 73 | 74 | void ToolTip::paintComponent( const agui::PaintEvent &paintEvent ) 75 | { 76 | agui::Color c = agui::Color( 77 | getFontColor().getR(),getFontColor().getG(), 78 | getFontColor().getB(),getOpacity()); 79 | resizableText.drawTextArea( 80 | paintEvent.graphics(),getFont(),getInnerRectangle(), 81 | c,getAreaText(),getTextAlignment()); 82 | } 83 | 84 | } 85 | -------------------------------------------------------------------------------- /demo/AguiCalc/AguiCalc/ToolTip.hpp: -------------------------------------------------------------------------------- 1 | /* _____ 2 | * /\ _ \ __ 3 | * \ \ \_\ \ __ __ __ /\_\ 4 | * \ \ __ \ /'_ `\ /\ \/\ \\/\ \ 5 | * \ \ \/\ \ /\ \_\ \\ \ \_\ \\ \ \ 6 | * \ \_\ \_\\ \____ \\ \____/ \ \_\ 7 | * \/_/\/_/ \/____\ \\/___/ \/_/ 8 | * /\____/ 9 | * \_/__/ 10 | * 11 | * Copyright (c) 2011 Joshua Larouche 12 | * 13 | * 14 | * License: (BSD) 15 | * Redistribution and use in source and binary forms, with or without 16 | * modification, are permitted provided that the following conditions 17 | * are met: 18 | * 1. Redistributions of source code must retain the above copyright 19 | * notice, this list of conditions and the following disclaimer. 20 | * 2. Redistributions in binary form must reproduce the above copyright 21 | * notice, this list of conditions and the following disclaimer in 22 | * the documentation and/or other materials provided with the 23 | * distribution. 24 | * 3. Neither the name of Agui nor the names of its contributors may 25 | * be used to endorse or promote products derived from this software 26 | * without specific prior written permission. 27 | * 28 | * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS 29 | * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT 30 | * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR 31 | * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT 32 | * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, 33 | * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED 34 | * TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR 35 | * PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF 36 | * LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING 37 | * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS 38 | * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 39 | */ 40 | 41 | #ifndef CGE_TOOLTIP_HPP 42 | #define CGE_TOOLTIP_HPP 43 | #include "Agui/Widgets/ToolTip/ToolTip.hpp" 44 | namespace cge 45 | { 46 | class ToolTip : public agui::ToolTip 47 | { 48 | agui::Image* m_tooltipBG; 49 | float m_opacityRate; 50 | public: 51 | ToolTip(agui::Image* tooltipBG); 52 | virtual void paintBackground(const agui::PaintEvent &paintEvent); 53 | virtual void paintComponent(const agui::PaintEvent &paintEvent); 54 | virtual void showToolTip(const std::string& text, int width, int x, int y, Widget* invoker); 55 | virtual void logic(double timeElapsed); 56 | ~ToolTip(void); 57 | }; 58 | } 59 | 60 | #endif 61 | -------------------------------------------------------------------------------- /demo/AguiCalc/AguiCalc/data/DejaVuSans.ttf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/jmasterx/Agui/d962206bb4b97e6a9f7bd6b2050fbbef493ea66f/demo/AguiCalc/AguiCalc/data/DejaVuSans.ttf -------------------------------------------------------------------------------- /demo/AguiCalc/AguiCalc/data/button.click.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/jmasterx/Agui/d962206bb4b97e6a9f7bd6b2050fbbef493ea66f/demo/AguiCalc/AguiCalc/data/button.click.png -------------------------------------------------------------------------------- /demo/AguiCalc/AguiCalc/data/button.default.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/jmasterx/Agui/d962206bb4b97e6a9f7bd6b2050fbbef493ea66f/demo/AguiCalc/AguiCalc/data/button.default.png -------------------------------------------------------------------------------- /demo/AguiCalc/AguiCalc/data/button.disabled.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/jmasterx/Agui/d962206bb4b97e6a9f7bd6b2050fbbef493ea66f/demo/AguiCalc/AguiCalc/data/button.disabled.png -------------------------------------------------------------------------------- /demo/AguiCalc/AguiCalc/data/button.focus.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/jmasterx/Agui/d962206bb4b97e6a9f7bd6b2050fbbef493ea66f/demo/AguiCalc/AguiCalc/data/button.focus.png -------------------------------------------------------------------------------- /demo/AguiCalc/AguiCalc/data/button.hover.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/jmasterx/Agui/d962206bb4b97e6a9f7bd6b2050fbbef493ea66f/demo/AguiCalc/AguiCalc/data/button.hover.png -------------------------------------------------------------------------------- /demo/AguiCalc/AguiCalc/data/frame.bg.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/jmasterx/Agui/d962206bb4b97e6a9f7bd6b2050fbbef493ea66f/demo/AguiCalc/AguiCalc/data/frame.bg.png -------------------------------------------------------------------------------- /demo/AguiCalc/AguiCalc/data/gui_image_mapping.conf: -------------------------------------------------------------------------------- 1 | #Regular push button 2 | button.default "button.default.png" 7 11 7 11 3 | button.hover "button.hover.png" 7 11 7 11 4 | button.click "button.click.png" 7 11 7 11 5 | button.focus "button.focus.png" 7 11 7 11 6 | button.disabled "button.disabled.png" 7 11 7 11 7 | 8 | #White Button 9 | whitebutton.default "whitebutton.default.png" 8 8 12 12 10 | whitebutton.hover "whitebutton.hover.png" 5 5 12 12 11 | whitebutton.click "whitebutton.click.png" 5 5 12 12 12 | 13 | #TextField 14 | textfield.bg "textfield.bg.png" 10 10 12 10 15 | textfield.focus "textfield.focus.png" 10 10 12 10 16 | 17 | #ToolTip 18 | tooltip.bg "tooltip.bg.png" 4 6 10 8 19 | 20 | #PopUpMenu 21 | popup.bg "popup.bg.png" 4 6 10 8 22 | popup.highlight "popup.highlight.png" 3 4 4 4 23 | 24 | #Frame 25 | frame.bg "frame.bg.png" 30 30 50 50 -------------------------------------------------------------------------------- /demo/AguiCalc/AguiCalc/data/popup.bg.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/jmasterx/Agui/d962206bb4b97e6a9f7bd6b2050fbbef493ea66f/demo/AguiCalc/AguiCalc/data/popup.bg.png -------------------------------------------------------------------------------- /demo/AguiCalc/AguiCalc/data/popup.highlight.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/jmasterx/Agui/d962206bb4b97e6a9f7bd6b2050fbbef493ea66f/demo/AguiCalc/AguiCalc/data/popup.highlight.png -------------------------------------------------------------------------------- /demo/AguiCalc/AguiCalc/data/textbox.focus.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/jmasterx/Agui/d962206bb4b97e6a9f7bd6b2050fbbef493ea66f/demo/AguiCalc/AguiCalc/data/textbox.focus.png -------------------------------------------------------------------------------- /demo/AguiCalc/AguiCalc/data/textfield.bg.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/jmasterx/Agui/d962206bb4b97e6a9f7bd6b2050fbbef493ea66f/demo/AguiCalc/AguiCalc/data/textfield.bg.png -------------------------------------------------------------------------------- /demo/AguiCalc/AguiCalc/data/textfield.focus.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/jmasterx/Agui/d962206bb4b97e6a9f7bd6b2050fbbef493ea66f/demo/AguiCalc/AguiCalc/data/textfield.focus.png -------------------------------------------------------------------------------- /demo/AguiCalc/AguiCalc/data/textfield.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/jmasterx/Agui/d962206bb4b97e6a9f7bd6b2050fbbef493ea66f/demo/AguiCalc/AguiCalc/data/textfield.png -------------------------------------------------------------------------------- /demo/AguiCalc/AguiCalc/data/tooltip.bg.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/jmasterx/Agui/d962206bb4b97e6a9f7bd6b2050fbbef493ea66f/demo/AguiCalc/AguiCalc/data/tooltip.bg.png -------------------------------------------------------------------------------- /demo/AguiCalc/AguiCalc/data/whitebutton.click.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/jmasterx/Agui/d962206bb4b97e6a9f7bd6b2050fbbef493ea66f/demo/AguiCalc/AguiCalc/data/whitebutton.click.png -------------------------------------------------------------------------------- /demo/AguiCalc/AguiCalc/data/whitebutton.click_alt.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/jmasterx/Agui/d962206bb4b97e6a9f7bd6b2050fbbef493ea66f/demo/AguiCalc/AguiCalc/data/whitebutton.click_alt.png -------------------------------------------------------------------------------- /demo/AguiCalc/AguiCalc/data/whitebutton.default.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/jmasterx/Agui/d962206bb4b97e6a9f7bd6b2050fbbef493ea66f/demo/AguiCalc/AguiCalc/data/whitebutton.default.png -------------------------------------------------------------------------------- /demo/AguiCalc/AguiCalc/data/whitebutton.hover.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/jmasterx/Agui/d962206bb4b97e6a9f7bd6b2050fbbef493ea66f/demo/AguiCalc/AguiCalc/data/whitebutton.hover.png -------------------------------------------------------------------------------- /example/data/DejaVuSans.ttf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/jmasterx/Agui/d962206bb4b97e6a9f7bd6b2050fbbef493ea66f/example/data/DejaVuSans.ttf -------------------------------------------------------------------------------- /include/Agui/ActionListener.hpp: -------------------------------------------------------------------------------- 1 | /* _____ 2 | * /\ _ \ __ 3 | * \ \ \_\ \ __ __ __ /\_\ 4 | * \ \ __ \ /'_ `\ /\ \/\ \\/\ \ 5 | * \ \ \/\ \ /\ \_\ \\ \ \_\ \\ \ \ 6 | * \ \_\ \_\\ \____ \\ \____/ \ \_\ 7 | * \/_/\/_/ \/____\ \\/___/ \/_/ 8 | * /\____/ 9 | * \_/__/ 10 | * 11 | * Copyright (c) 2011 Joshua Larouche 12 | * 13 | * 14 | * License: (BSD) 15 | * Redistribution and use in source and binary forms, with or without 16 | * modification, are permitted provided that the following conditions 17 | * are met: 18 | * 1. Redistributions of source code must retain the above copyright 19 | * notice, this list of conditions and the following disclaimer. 20 | * 2. Redistributions in binary form must reproduce the above copyright 21 | * notice, this list of conditions and the following disclaimer in 22 | * the documentation and/or other materials provided with the 23 | * distribution. 24 | * 3. Neither the name of Agui nor the names of its contributors may 25 | * be used to endorse or promote products derived from this software 26 | * without specific prior written permission. 27 | * 28 | * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS 29 | * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT 30 | * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR 31 | * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT 32 | * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, 33 | * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED 34 | * TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR 35 | * PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF 36 | * LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING 37 | * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS 38 | * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 39 | */ 40 | 41 | #ifndef AGUI_ACTION_LISTENER_HPP 42 | #define AGUI_ACTION_LISTENER_HPP 43 | #include "Agui/Platform.hpp" 44 | #include "Agui/BaseTypes.hpp" 45 | namespace agui { 46 | 47 | class AGUI_CORE_DECLSPEC Widget; 48 | 49 | /** 50 | * Abstract class for Action Listeners. 51 | * 52 | * Any derived Action Listeners should inherit from this class. 53 | * 54 | * Must implement: 55 | * 56 | * actionPerformed 57 | * @author Joshua Larouche 58 | * @since 0.1.0 59 | */ 60 | 61 | class AGUI_CORE_DECLSPEC ActionListener 62 | { 63 | public: 64 | ActionListener(void); 65 | /** 66 | * Called when an action has been performed. 67 | * @param evt The ActionEvent associated with this event. 68 | * @since 0.1.0 69 | */ 70 | virtual void actionPerformed(const ActionEvent &evt) = 0; 71 | virtual ~ActionListener(void); 72 | }; 73 | } 74 | #endif 75 | -------------------------------------------------------------------------------- /include/Agui/Agui.hpp: -------------------------------------------------------------------------------- 1 | /* _____ 2 | * /\ _ \ __ 3 | * \ \ \_\ \ __ __ __ /\_\ 4 | * \ \ __ \ /'_ `\ /\ \/\ \\/\ \ 5 | * \ \ \/\ \ /\ \_\ \\ \ \_\ \\ \ \ 6 | * \ \_\ \_\\ \____ \\ \____/ \ \_\ 7 | * \/_/\/_/ \/____\ \\/___/ \/_/ 8 | * /\____/ 9 | * \_/__/ 10 | * 11 | * Copyright (c) 2011 Joshua Larouche 12 | * 13 | * 14 | * License: (BSD) 15 | * Redistribution and use in source and binary forms, with or without 16 | * modification, are permitted provided that the following conditions 17 | * are met: 18 | * 1. Redistributions of source code must retain the above copyright 19 | * notice, this list of conditions and the following disclaimer. 20 | * 2. Redistributions in binary form must reproduce the above copyright 21 | * notice, this list of conditions and the following disclaimer in 22 | * the documentation and/or other materials provided with the 23 | * distribution. 24 | * 3. Neither the name of Agui nor the names of its contributors may 25 | * be used to endorse or promote products derived from this software 26 | * without specific prior written permission. 27 | * 28 | * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS 29 | * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT 30 | * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR 31 | * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT 32 | * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, 33 | * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED 34 | * TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR 35 | * PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF 36 | * LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING 37 | * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS 38 | * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 39 | */ 40 | 41 | #ifndef AGUI_HPP 42 | #define AGUI_HPP 43 | #include "Agui/Widget.hpp" 44 | #include "Agui/Gui.hpp" 45 | #include "Agui/TopContainer.hpp" 46 | #endif -------------------------------------------------------------------------------- /include/Agui/Backends/Allegro5/Allegro5.hpp: -------------------------------------------------------------------------------- 1 | /* _____ 2 | * /\ _ \ __ 3 | * \ \ \_\ \ __ __ __ /\_\ 4 | * \ \ __ \ /'_ `\ /\ \/\ \\/\ \ 5 | * \ \ \/\ \ /\ \_\ \\ \ \_\ \\ \ \ 6 | * \ \_\ \_\\ \____ \\ \____/ \ \_\ 7 | * \/_/\/_/ \/____\ \\/___/ \/_/ 8 | * /\____/ 9 | * \_/__/ 10 | * 11 | * Copyright (c) 2011 Joshua Larouche 12 | * 13 | * 14 | * License: (BSD) 15 | * Redistribution and use in source and binary forms, with or without 16 | * modification, are permitted provided that the following conditions 17 | * are met: 18 | * 1. Redistributions of source code must retain the above copyright 19 | * notice, this list of conditions and the following disclaimer. 20 | * 2. Redistributions in binary form must reproduce the above copyright 21 | * notice, this list of conditions and the following disclaimer in 22 | * the documentation and/or other materials provided with the 23 | * distribution. 24 | * 3. Neither the name of Agui nor the names of its contributors may 25 | * be used to endorse or promote products derived from this software 26 | * without specific prior written permission. 27 | * 28 | * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS 29 | * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT 30 | * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR 31 | * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT 32 | * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, 33 | * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED 34 | * TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR 35 | * PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF 36 | * LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING 37 | * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS 38 | * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 39 | */ 40 | 41 | #ifndef AGUI_ALLEGRO5_HPP 42 | #define AGUI_ALLEGRO5_HPP 43 | 44 | #include "Agui/Backends/Allegro5/Allegro5Graphics.hpp" 45 | #include "Agui/Backends/Allegro5/Allegro5ImageLoader.hpp" 46 | #include "Agui/Backends/Allegro5/Allegro5FontLoader.hpp" 47 | #include "Agui/Backends/Allegro5/Allegro5Input.hpp" 48 | #include "Agui/Backends/Allegro5/Allegro5CursorProvider.hpp" 49 | 50 | #endif -------------------------------------------------------------------------------- /include/Agui/Backends/Allegro5/Allegro5CursorProvider.hpp: -------------------------------------------------------------------------------- 1 | /* _____ 2 | * /\ _ \ __ 3 | * \ \ \_\ \ __ __ __ /\_\ 4 | * \ \ __ \ /'_ `\ /\ \/\ \\/\ \ 5 | * \ \ \/\ \ /\ \_\ \\ \ \_\ \\ \ \ 6 | * \ \_\ \_\\ \____ \\ \____/ \ \_\ 7 | * \/_/\/_/ \/____\ \\/___/ \/_/ 8 | * /\____/ 9 | * \_/__/ 10 | * 11 | * Copyright (c) 2011 Joshua Larouche 12 | * 13 | * 14 | * License: (BSD) 15 | * Redistribution and use in source and binary forms, with or without 16 | * modification, are permitted provided that the following conditions 17 | * are met: 18 | * 1. Redistributions of source code must retain the above copyright 19 | * notice, this list of conditions and the following disclaimer. 20 | * 2. Redistributions in binary form must reproduce the above copyright 21 | * notice, this list of conditions and the following disclaimer in 22 | * the documentation and/or other materials provided with the 23 | * distribution. 24 | * 3. Neither the name of Agui nor the names of its contributors may 25 | * be used to endorse or promote products derived from this software 26 | * without specific prior written permission. 27 | * 28 | * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS 29 | * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT 30 | * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR 31 | * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT 32 | * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, 33 | * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED 34 | * TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR 35 | * PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF 36 | * LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING 37 | * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS 38 | * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 39 | */ 40 | 41 | #ifndef AGUI_ALLEGRO5_CURSOR_PROVIDER 42 | #define AGUI_ALLEGRO5_CURSOR_PROVIDER 43 | #include "Agui/CursorProvider.hpp" 44 | #include 45 | #include 46 | namespace agui 47 | { 48 | class AGUI_BACKEND_DECLSPEC Allegro5CursorProvider : 49 | public CursorProvider 50 | { 51 | public: 52 | virtual bool setCursor(CursorEnum cursor); 53 | Allegro5CursorProvider(void) {} 54 | virtual ~Allegro5CursorProvider(void) {} 55 | }; 56 | } 57 | #endif 58 | -------------------------------------------------------------------------------- /include/Agui/Backends/Allegro5/Allegro5FontLoader.hpp: -------------------------------------------------------------------------------- 1 | /* _____ 2 | * /\ _ \ __ 3 | * \ \ \_\ \ __ __ __ /\_\ 4 | * \ \ __ \ /'_ `\ /\ \/\ \\/\ \ 5 | * \ \ \/\ \ /\ \_\ \\ \ \_\ \\ \ \ 6 | * \ \_\ \_\\ \____ \\ \____/ \ \_\ 7 | * \/_/\/_/ \/____\ \\/___/ \/_/ 8 | * /\____/ 9 | * \_/__/ 10 | * 11 | * Copyright (c) 2011 Joshua Larouche 12 | * 13 | * 14 | * License: (BSD) 15 | * Redistribution and use in source and binary forms, with or without 16 | * modification, are permitted provided that the following conditions 17 | * are met: 18 | * 1. Redistributions of source code must retain the above copyright 19 | * notice, this list of conditions and the following disclaimer. 20 | * 2. Redistributions in binary form must reproduce the above copyright 21 | * notice, this list of conditions and the following disclaimer in 22 | * the documentation and/or other materials provided with the 23 | * distribution. 24 | * 3. Neither the name of Agui nor the names of its contributors may 25 | * be used to endorse or promote products derived from this software 26 | * without specific prior written permission. 27 | * 28 | * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS 29 | * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT 30 | * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR 31 | * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT 32 | * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, 33 | * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED 34 | * TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR 35 | * PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF 36 | * LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING 37 | * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS 38 | * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 39 | */ 40 | 41 | #ifndef AGUI_ALLEGRO5_FONT_MANAGER_HPP 42 | #define AGUI_ALLEGRO5_FONT_MANAGER_HPP 43 | 44 | #include "Agui/FontLoader.hpp" 45 | #include "Agui/Backends/Allegro5/Allegro5Font.hpp" 46 | 47 | //Allegro 5 48 | #include 49 | #include 50 | #include 51 | #include 52 | #include 53 | #include 54 | 55 | namespace agui { 56 | 57 | class AGUI_BACKEND_DECLSPEC Allegro5FontLoader : 58 | public FontLoader 59 | { 60 | public: 61 | Allegro5FontLoader(void) {} 62 | ~Allegro5FontLoader(void) {} 63 | 64 | virtual Font* loadFont(const std::string &fileName, int height, FontFlags fontFlags = FONT_DEFAULT_FLAGS, float borderWidth = 0, agui::Color borderColor = agui::Color()); 65 | virtual Font* loadEmptyFont(); 66 | }; 67 | } 68 | 69 | #endif 70 | -------------------------------------------------------------------------------- /include/Agui/Backends/Allegro5/Allegro5Image.hpp: -------------------------------------------------------------------------------- 1 | /* _____ 2 | * /\ _ \ __ 3 | * \ \ \_\ \ __ __ __ /\_\ 4 | * \ \ __ \ /'_ `\ /\ \/\ \\/\ \ 5 | * \ \ \/\ \ /\ \_\ \\ \ \_\ \\ \ \ 6 | * \ \_\ \_\\ \____ \\ \____/ \ \_\ 7 | * \/_/\/_/ \/____\ \\/___/ \/_/ 8 | * /\____/ 9 | * \_/__/ 10 | * 11 | * Copyright (c) 2011 Joshua Larouche 12 | * 13 | * 14 | * License: (BSD) 15 | * Redistribution and use in source and binary forms, with or without 16 | * modification, are permitted provided that the following conditions 17 | * are met: 18 | * 1. Redistributions of source code must retain the above copyright 19 | * notice, this list of conditions and the following disclaimer. 20 | * 2. Redistributions in binary form must reproduce the above copyright 21 | * notice, this list of conditions and the following disclaimer in 22 | * the documentation and/or other materials provided with the 23 | * distribution. 24 | * 3. Neither the name of Agui nor the names of its contributors may 25 | * be used to endorse or promote products derived from this software 26 | * without specific prior written permission. 27 | * 28 | * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS 29 | * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT 30 | * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR 31 | * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT 32 | * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, 33 | * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED 34 | * TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR 35 | * PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF 36 | * LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING 37 | * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS 38 | * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 39 | */ 40 | 41 | #ifndef AGUI_ALLEGRO5_IMAGE_HPP 42 | #define AGUI_ALLEGRO5_IMAGE_HPP 43 | #include "Agui/BaseTypes.hpp" 44 | 45 | //Allegro 5 46 | #include 47 | #include 48 | #include 49 | #include 50 | #include 51 | #include 52 | 53 | namespace agui 54 | { 55 | class Allegro5Image : 56 | public Image 57 | { 58 | ALLEGRO_BITMAP *bmp; 59 | int width; 60 | int height; 61 | bool autoFree; 62 | public: 63 | Allegro5Image(void); 64 | virtual int getWidth() const; 65 | virtual int getHeight() const; 66 | virtual Color getPixel(int x, int y) const; 67 | virtual void setPixel(int x, int y, const Color& color); 68 | virtual bool isAutoFreeing() const; 69 | ALLEGRO_BITMAP* getBitmap() const; 70 | virtual void free(); 71 | Allegro5Image(const std::string& fileName, 72 | bool convertMask = false); 73 | virtual void setBitmap(ALLEGRO_BITMAP* bitmap, bool autoFree = false); 74 | virtual ~Allegro5Image(void); 75 | }; 76 | } 77 | #endif 78 | -------------------------------------------------------------------------------- /include/Agui/Backends/Allegro5/Allegro5ImageLoader.hpp: -------------------------------------------------------------------------------- 1 | /* _____ 2 | * /\ _ \ __ 3 | * \ \ \_\ \ __ __ __ /\_\ 4 | * \ \ __ \ /'_ `\ /\ \/\ \\/\ \ 5 | * \ \ \/\ \ /\ \_\ \\ \ \_\ \\ \ \ 6 | * \ \_\ \_\\ \____ \\ \____/ \ \_\ 7 | * \/_/\/_/ \/____\ \\/___/ \/_/ 8 | * /\____/ 9 | * \_/__/ 10 | * 11 | * Copyright (c) 2011 Joshua Larouche 12 | * 13 | * 14 | * License: (BSD) 15 | * Redistribution and use in source and binary forms, with or without 16 | * modification, are permitted provided that the following conditions 17 | * are met: 18 | * 1. Redistributions of source code must retain the above copyright 19 | * notice, this list of conditions and the following disclaimer. 20 | * 2. Redistributions in binary form must reproduce the above copyright 21 | * notice, this list of conditions and the following disclaimer in 22 | * the documentation and/or other materials provided with the 23 | * distribution. 24 | * 3. Neither the name of Agui nor the names of its contributors may 25 | * be used to endorse or promote products derived from this software 26 | * without specific prior written permission. 27 | * 28 | * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS 29 | * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT 30 | * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR 31 | * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT 32 | * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, 33 | * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED 34 | * TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR 35 | * PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF 36 | * LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING 37 | * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS 38 | * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 39 | */ 40 | 41 | #ifndef AGUI_ALLEGRO5_IMAGE_MANAGER_HPP 42 | #define AGUI_ALLEGRO5_IMAGE_MANAGER_HPP 43 | 44 | #include "Agui/ImageLoader.hpp" 45 | #include "Agui/Backends/Allegro5/Allegro5Image.hpp" 46 | 47 | 48 | //Allegro 5 49 | #include 50 | #include 51 | #include 52 | #include 53 | #include 54 | #include 55 | 56 | namespace agui { 57 | 58 | class AGUI_BACKEND_DECLSPEC Allegro5ImageLoader : 59 | public ImageLoader 60 | { 61 | public: 62 | Allegro5ImageLoader(void) {} 63 | virtual ~Allegro5ImageLoader(void) {} 64 | virtual Image* loadImage(const std::string &fileName, bool convertMask = false, 65 | bool converToDisplayFormat = false); 66 | }; 67 | } 68 | #endif 69 | -------------------------------------------------------------------------------- /include/Agui/Backends/Allegro5/Allegro5Input.hpp: -------------------------------------------------------------------------------- 1 | /* _____ 2 | * /\ _ \ __ 3 | * \ \ \_\ \ __ __ __ /\_\ 4 | * \ \ __ \ /'_ `\ /\ \/\ \\/\ \ 5 | * \ \ \/\ \ /\ \_\ \\ \ \_\ \\ \ \ 6 | * \ \_\ \_\\ \____ \\ \____/ \ \_\ 7 | * \/_/\/_/ \/____\ \\/___/ \/_/ 8 | * /\____/ 9 | * \_/__/ 10 | * 11 | * Copyright (c) 2011 Joshua Larouche 12 | * 13 | * 14 | * License: (BSD) 15 | * Redistribution and use in source and binary forms, with or without 16 | * modification, are permitted provided that the following conditions 17 | * are met: 18 | * 1. Redistributions of source code must retain the above copyright 19 | * notice, this list of conditions and the following disclaimer. 20 | * 2. Redistributions in binary form must reproduce the above copyright 21 | * notice, this list of conditions and the following disclaimer in 22 | * the documentation and/or other materials provided with the 23 | * distribution. 24 | * 3. Neither the name of Agui nor the names of its contributors may 25 | * be used to endorse or promote products derived from this software 26 | * without specific prior written permission. 27 | * 28 | * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS 29 | * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT 30 | * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR 31 | * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT 32 | * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, 33 | * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED 34 | * TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR 35 | * PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF 36 | * LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING 37 | * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS 38 | * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 39 | */ 40 | 41 | #ifndef AGUI_ALLEGRO5_INPUT 42 | #define AGUI_ALLEGRO5_INPUT 43 | #include "Agui/Input.hpp" 44 | #include 45 | 46 | #include 47 | #include 48 | namespace agui 49 | { 50 | class AGUI_BACKEND_DECLSPEC Allegro5Input : 51 | public Input 52 | { 53 | bool shift; 54 | bool control; 55 | bool alt; 56 | bool meta; 57 | 58 | ALLEGRO_KEYBOARD_EVENT prevEvent; 59 | std::vector keyEvents; 60 | 61 | MouseInput createMouse(const ALLEGRO_EVENT &event); 62 | KeyboardInput createKeyboard(const ALLEGRO_KEYBOARD_EVENT *event, 63 | bool isKeyDown, bool isRepeat ); 64 | 65 | ExtendedKeyEnum getExtendedKey(int key) const; 66 | bool isModifierKey(int key); 67 | KeyEnum getKeyFromKeycode(int keycode) const; 68 | public: 69 | Allegro5Input(void); 70 | virtual double getTime() const; 71 | virtual void processEvent(const ALLEGRO_EVENT &event); 72 | virtual ~Allegro5Input(void); 73 | }; 74 | } 75 | #endif 76 | -------------------------------------------------------------------------------- /include/Agui/Backends/SFML2/SFML2.hpp: -------------------------------------------------------------------------------- 1 | /* _____ 2 | * /\ _ \ __ 3 | * \ \ \_\ \ __ __ __ /\_\ 4 | * \ \ __ \ /'_ `\ /\ \/\ \\/\ \ 5 | * \ \ \/\ \ /\ \_\ \\ \ \_\ \\ \ \ 6 | * \ \_\ \_\\ \____ \\ \____/ \ \_\ 7 | * \/_/\/_/ \/____\ \\/___/ \/_/ 8 | * /\____/ 9 | * \_/__/ 10 | * 11 | * Copyright (c) 2011 Joshua Larouche 12 | * 13 | * 14 | * License: (BSD) 15 | * Redistribution and use in source and binary forms, with or without 16 | * modification, are permitted provided that the following conditions 17 | * are met: 18 | * 1. Redistributions of source code must retain the above copyright 19 | * notice, this list of conditions and the following disclaimer. 20 | * 2. Redistributions in binary form must reproduce the above copyright 21 | * notice, this list of conditions and the following disclaimer in 22 | * the documentation and/or other materials provided with the 23 | * distribution. 24 | * 3. Neither the name of Agui nor the names of its contributors may 25 | * be used to endorse or promote products derived from this software 26 | * without specific prior written permission. 27 | * 28 | * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS 29 | * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT 30 | * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR 31 | * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT 32 | * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, 33 | * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED 34 | * TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR 35 | * PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF 36 | * LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING 37 | * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS 38 | * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 39 | */ 40 | 41 | #ifndef AGUI_SFML2_HPP 42 | #define AGUI_SFML2_HPP 43 | #include "Agui/Backends/SFML2/SFML2Graphics.hpp" 44 | #include "Agui/Backends/SFML2/SFML2ImageLoader.hpp" 45 | #include "Agui/Backends/SFML2/SFML2FontLoader.hpp" 46 | #include "Agui/Backends/SFML2/SFML2Input.hpp" 47 | #include "Agui/Backends/SFML2/SFML2Font.hpp" 48 | #include "Agui/Backends/SFML2/SFML2Image.hpp" 49 | #endif -------------------------------------------------------------------------------- /include/Agui/Backends/SFML2/SFML2Font.hpp: -------------------------------------------------------------------------------- 1 | /* _____ 2 | * /\ _ \ __ 3 | * \ \ \_\ \ __ __ __ /\_\ 4 | * \ \ __ \ /'_ `\ /\ \/\ \\/\ \ 5 | * \ \ \/\ \ /\ \_\ \\ \ \_\ \\ \ \ 6 | * \ \_\ \_\\ \____ \\ \____/ \ \_\ 7 | * \/_/\/_/ \/____\ \\/___/ \/_/ 8 | * /\____/ 9 | * \_/__/ 10 | * 11 | * Copyright (c) 2011 Joshua Larouche 12 | * 13 | * 14 | * License: (BSD) 15 | * Redistribution and use in source and binary forms, with or without 16 | * modification, are permitted provided that the following conditions 17 | * are met: 18 | * 1. Redistributions of source code must retain the above copyright 19 | * notice, this list of conditions and the following disclaimer. 20 | * 2. Redistributions in binary form must reproduce the above copyright 21 | * notice, this list of conditions and the following disclaimer in 22 | * the documentation and/or other materials provided with the 23 | * distribution. 24 | * 3. Neither the name of Agui nor the names of its contributors may 25 | * be used to endorse or promote products derived from this software 26 | * without specific prior written permission. 27 | * 28 | * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS 29 | * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT 30 | * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR 31 | * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT 32 | * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, 33 | * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED 34 | * TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR 35 | * PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF 36 | * LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING 37 | * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS 38 | * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 39 | */ 40 | 41 | #ifndef AGUI_SFML2_FONT_HPP 42 | #define AGUI_SFML2_FONT_HPP 43 | #include "Agui/BaseTypes.hpp" 44 | #include 45 | namespace agui 46 | { 47 | class AGUI_BACKEND_DECLSPEC SFML2Font : public Font 48 | { 49 | sf::Font* sfFont; 50 | bool autoFree; 51 | int characterSize; 52 | std::string path; 53 | public: 54 | SFML2Font(void); 55 | virtual void free(); 56 | sf::Font* getFont() const; 57 | virtual int getLineHeight() const; 58 | virtual int getHeight() const; 59 | void setHeight(int characterSize); 60 | virtual int getTextWidth(const std::string &text) const; 61 | virtual const std::string& getPath() const; 62 | SFML2Font(const std::string &fileName, int height, FontFlags fontFlags = FONT_DEFAULT_FLAGS); 63 | virtual void setFont(sf::Font* font, const std::string &path, int characterSize, bool autoFree = false); 64 | virtual void reload(const std::string &fileName, int height, FontFlags fontFlags = FONT_DEFAULT_FLAGS , float borderWidth = 0, agui::Color borderColor = agui::Color()); 65 | virtual ~SFML2Font(void); 66 | }; 67 | } 68 | #endif 69 | -------------------------------------------------------------------------------- /include/Agui/Backends/SFML2/SFML2FontLoader.hpp: -------------------------------------------------------------------------------- 1 | /* _____ 2 | * /\ _ \ __ 3 | * \ \ \_\ \ __ __ __ /\_\ 4 | * \ \ __ \ /'_ `\ /\ \/\ \\/\ \ 5 | * \ \ \/\ \ /\ \_\ \\ \ \_\ \\ \ \ 6 | * \ \_\ \_\\ \____ \\ \____/ \ \_\ 7 | * \/_/\/_/ \/____\ \\/___/ \/_/ 8 | * /\____/ 9 | * \_/__/ 10 | * 11 | * Copyright (c) 2011 Joshua Larouche 12 | * 13 | * 14 | * License: (BSD) 15 | * Redistribution and use in source and binary forms, with or without 16 | * modification, are permitted provided that the following conditions 17 | * are met: 18 | * 1. Redistributions of source code must retain the above copyright 19 | * notice, this list of conditions and the following disclaimer. 20 | * 2. Redistributions in binary form must reproduce the above copyright 21 | * notice, this list of conditions and the following disclaimer in 22 | * the documentation and/or other materials provided with the 23 | * distribution. 24 | * 3. Neither the name of Agui nor the names of its contributors may 25 | * be used to endorse or promote products derived from this software 26 | * without specific prior written permission. 27 | * 28 | * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS 29 | * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT 30 | * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR 31 | * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT 32 | * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, 33 | * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED 34 | * TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR 35 | * PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF 36 | * LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING 37 | * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS 38 | * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 39 | */ 40 | 41 | #ifndef AGUI_SFML2_FONT_MANAGER_HPP 42 | #define AGUI_SFML2_FONT_MANAGER_HPP 43 | 44 | #include "Agui/FontLoader.hpp" 45 | namespace agui 46 | { 47 | class AGUI_BACKEND_DECLSPEC SFML2FontLoader : public FontLoader 48 | { 49 | public: 50 | SFML2FontLoader(void); 51 | virtual Font* loadFont(const std::string &fileName, int height, FontFlags fontFlags = FONT_DEFAULT_FLAGS, float borderWidth = 0, agui::Color borderColor = agui::Color()); 52 | virtual Font* loadEmptyFont(); 53 | virtual ~SFML2FontLoader(void); 54 | }; 55 | 56 | } 57 | #endif -------------------------------------------------------------------------------- /include/Agui/Backends/SFML2/SFML2Image.hpp: -------------------------------------------------------------------------------- 1 | /* _____ 2 | * /\ _ \ __ 3 | * \ \ \_\ \ __ __ __ /\_\ 4 | * \ \ __ \ /'_ `\ /\ \/\ \\/\ \ 5 | * \ \ \/\ \ /\ \_\ \\ \ \_\ \\ \ \ 6 | * \ \_\ \_\\ \____ \\ \____/ \ \_\ 7 | * \/_/\/_/ \/____\ \\/___/ \/_/ 8 | * /\____/ 9 | * \_/__/ 10 | * 11 | * Copyright (c) 2011 Joshua Larouche 12 | * 13 | * 14 | * License: (BSD) 15 | * Redistribution and use in source and binary forms, with or without 16 | * modification, are permitted provided that the following conditions 17 | * are met: 18 | * 1. Redistributions of source code must retain the above copyright 19 | * notice, this list of conditions and the following disclaimer. 20 | * 2. Redistributions in binary form must reproduce the above copyright 21 | * notice, this list of conditions and the following disclaimer in 22 | * the documentation and/or other materials provided with the 23 | * distribution. 24 | * 3. Neither the name of Agui nor the names of its contributors may 25 | * be used to endorse or promote products derived from this software 26 | * without specific prior written permission. 27 | * 28 | * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS 29 | * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT 30 | * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR 31 | * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT 32 | * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, 33 | * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED 34 | * TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR 35 | * PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF 36 | * LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING 37 | * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS 38 | * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 39 | */ 40 | 41 | #ifndef AGUI_SFML2_IMAGE_HPP 42 | #define AGUI_SFML2_IMAGE_HPP 43 | #include "Agui/BaseTypes.hpp" 44 | #include 45 | namespace agui 46 | { 47 | class AGUI_BACKEND_DECLSPEC SFML2Image : public Image 48 | { 49 | sf::Texture *sfTexture; 50 | bool autoFree; 51 | public: 52 | SFML2Image(void); 53 | virtual int getWidth() const; 54 | virtual int getHeight() const; 55 | virtual Color getPixel(int x, int y) const; 56 | virtual void setPixel(int x, int y, const Color& color); 57 | virtual bool isAutoFreeing() const; 58 | sf::Texture* getBitmap() const; 59 | virtual void free(); 60 | SFML2Image(const std::string& fileName); 61 | virtual void setBitmap(sf::Texture* bitmap, bool autoFree = false); 62 | virtual ~SFML2Image(void); 63 | }; 64 | } 65 | #endif 66 | -------------------------------------------------------------------------------- /include/Agui/Backends/SFML2/SFML2ImageLoader.hpp: -------------------------------------------------------------------------------- 1 | /* _____ 2 | * /\ _ \ __ 3 | * \ \ \_\ \ __ __ __ /\_\ 4 | * \ \ __ \ /'_ `\ /\ \/\ \\/\ \ 5 | * \ \ \/\ \ /\ \_\ \\ \ \_\ \\ \ \ 6 | * \ \_\ \_\\ \____ \\ \____/ \ \_\ 7 | * \/_/\/_/ \/____\ \\/___/ \/_/ 8 | * /\____/ 9 | * \_/__/ 10 | * 11 | * Copyright (c) 2011 Joshua Larouche 12 | * 13 | * 14 | * License: (BSD) 15 | * Redistribution and use in source and binary forms, with or without 16 | * modification, are permitted provided that the following conditions 17 | * are met: 18 | * 1. Redistributions of source code must retain the above copyright 19 | * notice, this list of conditions and the following disclaimer. 20 | * 2. Redistributions in binary form must reproduce the above copyright 21 | * notice, this list of conditions and the following disclaimer in 22 | * the documentation and/or other materials provided with the 23 | * distribution. 24 | * 3. Neither the name of Agui nor the names of its contributors may 25 | * be used to endorse or promote products derived from this software 26 | * without specific prior written permission. 27 | * 28 | * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS 29 | * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT 30 | * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR 31 | * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT 32 | * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, 33 | * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED 34 | * TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR 35 | * PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF 36 | * LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING 37 | * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS 38 | * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 39 | */ 40 | 41 | #ifndef AGUI_SFML2_IMAGE_LOADER_HPP 42 | #define AGUI_SFML2_IMAGE_LOADER_HPP 43 | #include "Agui/BaseTypes.hpp" 44 | #include "Agui/ImageLoader.hpp" 45 | namespace agui 46 | { 47 | class AGUI_BACKEND_DECLSPEC SFML2ImageLoader : public ImageLoader 48 | { 49 | public: 50 | SFML2ImageLoader(void); 51 | virtual Image* loadImage(const std::string &fileName, bool convertMask = false, 52 | bool converToDisplayFormat = false); 53 | virtual ~SFML2ImageLoader(void); 54 | }; 55 | 56 | } 57 | #endif -------------------------------------------------------------------------------- /include/Agui/Backends/SFML2/SFML2Input.hpp: -------------------------------------------------------------------------------- 1 | /* _____ 2 | * /\ _ \ __ 3 | * \ \ \_\ \ __ __ __ /\_\ 4 | * \ \ __ \ /'_ `\ /\ \/\ \\/\ \ 5 | * \ \ \/\ \ /\ \_\ \\ \ \_\ \\ \ \ 6 | * \ \_\ \_\\ \____ \\ \____/ \ \_\ 7 | * \/_/\/_/ \/____\ \\/___/ \/_/ 8 | * /\____/ 9 | * \_/__/ 10 | * 11 | * Copyright (c) 2011 Joshua Larouche 12 | * 13 | * 14 | * License: (BSD) 15 | * Redistribution and use in source and binary forms, with or without 16 | * modification, are permitted provided that the following conditions 17 | * are met: 18 | * 1. Redistributions of source code must retain the above copyright 19 | * notice, this list of conditions and the following disclaimer. 20 | * 2. Redistributions in binary form must reproduce the above copyright 21 | * notice, this list of conditions and the following disclaimer in 22 | * the documentation and/or other materials provided with the 23 | * distribution. 24 | * 3. Neither the name of Agui nor the names of its contributors may 25 | * be used to endorse or promote products derived from this software 26 | * without specific prior written permission. 27 | * 28 | * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS 29 | * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT 30 | * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR 31 | * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT 32 | * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, 33 | * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED 34 | * TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR 35 | * PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF 36 | * LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING 37 | * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS 38 | * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 39 | */ 40 | 41 | #ifndef AGUI_SFML2_INPUT_HPP 42 | #define AGUI_SFML2_INPUT_HPP 43 | #include "Agui/Input.hpp" 44 | #include 45 | #include 46 | namespace agui 47 | { 48 | class AGUI_BACKEND_DECLSPEC SFML2Input : public Input 49 | { 50 | sf::Clock clock; // starts the clock 51 | bool alt; 52 | bool shift; 53 | bool control; 54 | bool meta; 55 | 56 | bool lmbDown; 57 | bool rmbDown; 58 | bool mmbDown; 59 | int lastMouseX; 60 | int lastMouseY; 61 | std::list m_keys; 62 | sf::Keyboard::Key m_prev; 63 | ExtendedKeyEnum getExtendedKey(sf::Keyboard::Key key) const; 64 | bool isModifierKey(sf::Keyboard::Key key); 65 | KeyEnum getKeyFromKeycode(sf::Keyboard::Key key) const; 66 | bool createMouse(const sf::Event &event, MouseInput& input); 67 | KeyboardInput createKeyboard(KeyEnum key,ExtendedKeyEnum extKey,unsigned int unichar, bool down); 68 | void removeKeyFromList(sf::Keyboard::Key key); 69 | public: 70 | SFML2Input(void); 71 | virtual double getTime() const; 72 | virtual void processEvent(const sf::Event &event); 73 | virtual ~SFML2Input(void); 74 | }; 75 | } 76 | #endif 77 | -------------------------------------------------------------------------------- /include/Agui/Clipboard/Clipboard.hpp: -------------------------------------------------------------------------------- 1 | /* _____ 2 | * /\ _ \ __ 3 | * \ \ \_\ \ __ __ __ /\_\ 4 | * \ \ __ \ /'_ `\ /\ \/\ \\/\ \ 5 | * \ \ \/\ \ /\ \_\ \\ \ \_\ \\ \ \ 6 | * \ \_\ \_\\ \____ \\ \____/ \ \_\ 7 | * \/_/\/_/ \/____\ \\/___/ \/_/ 8 | * /\____/ 9 | * \_/__/ 10 | * 11 | * Copyright (c) 2011 Joshua Larouche 12 | * 13 | * 14 | * License: (BSD) 15 | * Redistribution and use in source and binary forms, with or without 16 | * modification, are permitted provided that the following conditions 17 | * are met: 18 | * 1. Redistributions of source code must retain the above copyright 19 | * notice, this list of conditions and the following disclaimer. 20 | * 2. Redistributions in binary form must reproduce the above copyright 21 | * notice, this list of conditions and the following disclaimer in 22 | * the documentation and/or other materials provided with the 23 | * distribution. 24 | * 3. Neither the name of Agui nor the names of its contributors may 25 | * be used to endorse or promote products derived from this software 26 | * without specific prior written permission. 27 | * 28 | * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS 29 | * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT 30 | * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR 31 | * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT 32 | * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, 33 | * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED 34 | * TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR 35 | * PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF 36 | * LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING 37 | * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS 38 | * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 39 | */ 40 | 41 | #ifndef AGUI_CLIPBOARD_HPP 42 | #define AGUI_CLIPBOARD_HPP 43 | #include 44 | #include 45 | #include "Agui/Platform.hpp" 46 | namespace agui 47 | { 48 | class AGUI_CORE_DECLSPEC Clipboard 49 | { 50 | static std::string inClipboard; 51 | static std::string _filter(const std::string& str); 52 | public: 53 | static void copy(const std::string& input); 54 | static std::string paste(); 55 | Clipboard(void); 56 | virtual ~Clipboard(void); 57 | }; 58 | } 59 | 60 | #endif 61 | -------------------------------------------------------------------------------- /include/Agui/Clipboard/OSXClipboard.hpp: -------------------------------------------------------------------------------- 1 | /* _____ 2 | * /\ _ \ __ 3 | * \ \ \_\ \ __ __ __ /\_\ 4 | * \ \ __ \ /'_ `\ /\ \/\ \\/\ \ 5 | * \ \ \/\ \ /\ \_\ \\ \ \_\ \\ \ \ 6 | * \ \_\ \_\\ \____ \\ \____/ \ \_\ 7 | * \/_/\/_/ \/____\ \\/___/ \/_/ 8 | * /\____/ 9 | * \_/__/ 10 | * 11 | * Copyright (c) 2011 Joshua Larouche 12 | * 13 | * 14 | * License: (BSD) 15 | * Redistribution and use in source and binary forms, with or without 16 | * modification, are permitted provided that the following conditions 17 | * are met: 18 | * 1. Redistributions of source code must retain the above copyright 19 | * notice, this list of conditions and the following disclaimer. 20 | * 2. Redistributions in binary form must reproduce the above copyright 21 | * notice, this list of conditions and the following disclaimer in 22 | * the documentation and/or other materials provided with the 23 | * distribution. 24 | * 3. Neither the name of Agui nor the names of its contributors may 25 | * be used to endorse or promote products derived from this software 26 | * without specific prior written permission. 27 | * 28 | * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS 29 | * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT 30 | * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR 31 | * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT 32 | * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, 33 | * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED 34 | * TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR 35 | * PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF 36 | * LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING 37 | * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS 38 | * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 39 | */ 40 | 41 | #ifndef AGUI_OSX_CLIPBOARD_HPP 42 | #define AGUI_OSX_CLIPBOARD_HPP 43 | #include 44 | #include 45 | #import 46 | namespace agui 47 | { 48 | class OSXClipboard 49 | { 50 | public: 51 | static void copy(const std::string& input); 52 | static std::string paste(); 53 | OSXClipboard(void); 54 | virtual ~OSXClipboard(void); 55 | }; 56 | } 57 | #endif 58 | -------------------------------------------------------------------------------- /include/Agui/Clipboard/WinClipboard.hpp: -------------------------------------------------------------------------------- 1 | /* _____ 2 | * /\ _ \ __ 3 | * \ \ \_\ \ __ __ __ /\_\ 4 | * \ \ __ \ /'_ `\ /\ \/\ \\/\ \ 5 | * \ \ \/\ \ /\ \_\ \\ \ \_\ \\ \ \ 6 | * \ \_\ \_\\ \____ \\ \____/ \ \_\ 7 | * \/_/\/_/ \/____\ \\/___/ \/_/ 8 | * /\____/ 9 | * \_/__/ 10 | * 11 | * Copyright (c) 2011 Joshua Larouche 12 | * 13 | * 14 | * License: (BSD) 15 | * Redistribution and use in source and binary forms, with or without 16 | * modification, are permitted provided that the following conditions 17 | * are met: 18 | * 1. Redistributions of source code must retain the above copyright 19 | * notice, this list of conditions and the following disclaimer. 20 | * 2. Redistributions in binary form must reproduce the above copyright 21 | * notice, this list of conditions and the following disclaimer in 22 | * the documentation and/or other materials provided with the 23 | * distribution. 24 | * 3. Neither the name of Agui nor the names of its contributors may 25 | * be used to endorse or promote products derived from this software 26 | * without specific prior written permission. 27 | * 28 | * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS 29 | * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT 30 | * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR 31 | * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT 32 | * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, 33 | * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED 34 | * TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR 35 | * PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF 36 | * LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING 37 | * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS 38 | * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 39 | */ 40 | 41 | #ifndef AGUI_WIN_CLIPBOARD_HPP 42 | #define AGUI_WIN_CLIPBOARD_HPP 43 | #include 44 | #include 45 | #include "Agui/Platform.hpp" 46 | namespace agui 47 | { 48 | class AGUI_CORE_DECLSPEC WinClipboard 49 | { 50 | static std::string _winUTF16ToUTF8(const std::wstring& input); 51 | static std::wstring _winUTF8ToUTF16(const std::string& input); 52 | public: 53 | 54 | static void copy(const std::string& input); 55 | static std::string paste(); 56 | WinClipboard(void); 57 | virtual ~WinClipboard(void); 58 | }; 59 | } 60 | 61 | #endif 62 | -------------------------------------------------------------------------------- /include/Agui/EmptyWidget.hpp: -------------------------------------------------------------------------------- 1 | /* _____ 2 | * /\ _ \ __ 3 | * \ \ \_\ \ __ __ __ /\_\ 4 | * \ \ __ \ /'_ `\ /\ \/\ \\/\ \ 5 | * \ \ \/\ \ /\ \_\ \\ \ \_\ \\ \ \ 6 | * \ \_\ \_\\ \____ \\ \____/ \ \_\ 7 | * \/_/\/_/ \/____\ \\/___/ \/_/ 8 | * /\____/ 9 | * \_/__/ 10 | * 11 | * Copyright (c) 2011 Joshua Larouche 12 | * 13 | * 14 | * License: (BSD) 15 | * Redistribution and use in source and binary forms, with or without 16 | * modification, are permitted provided that the following conditions 17 | * are met: 18 | * 1. Redistributions of source code must retain the above copyright 19 | * notice, this list of conditions and the following disclaimer. 20 | * 2. Redistributions in binary form must reproduce the above copyright 21 | * notice, this list of conditions and the following disclaimer in 22 | * the documentation and/or other materials provided with the 23 | * distribution. 24 | * 3. Neither the name of Agui nor the names of its contributors may 25 | * be used to endorse or promote products derived from this software 26 | * without specific prior written permission. 27 | * 28 | * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS 29 | * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT 30 | * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR 31 | * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT 32 | * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, 33 | * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED 34 | * TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR 35 | * PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF 36 | * LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING 37 | * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS 38 | * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 39 | */ 40 | 41 | #ifndef AGUI_EMPTY_WIDGET_HPP 42 | #define AGUI_EMPTY_WIDGET_HPP 43 | 44 | #include "Agui/Widget.hpp" 45 | namespace agui { 46 | /** 47 | * Simple dummy class for a widget. 48 | * 49 | * Implements the paint events. Used by the default theme. 50 | * @author Joshua Larouche 51 | * @since 0.1.0 52 | */ 53 | class AGUI_CORE_DECLSPEC EmptyWidget : 54 | public Widget 55 | { 56 | protected: 57 | virtual void paintComponent(const PaintEvent &paintEvent); 58 | virtual void paintBackground(const PaintEvent &paintEvent); 59 | public: 60 | EmptyWidget(void); 61 | virtual ~EmptyWidget(void); 62 | }; 63 | } 64 | #endif -------------------------------------------------------------------------------- /include/Agui/FocusListener.hpp: -------------------------------------------------------------------------------- 1 | /* _____ 2 | * /\ _ \ __ 3 | * \ \ \_\ \ __ __ __ /\_\ 4 | * \ \ __ \ /'_ `\ /\ \/\ \\/\ \ 5 | * \ \ \/\ \ /\ \_\ \\ \ \_\ \\ \ \ 6 | * \ \_\ \_\\ \____ \\ \____/ \ \_\ 7 | * \/_/\/_/ \/____\ \\/___/ \/_/ 8 | * /\____/ 9 | * \_/__/ 10 | * 11 | * Copyright (c) 2011 Joshua Larouche 12 | * 13 | * 14 | * License: (BSD) 15 | * Redistribution and use in source and binary forms, with or without 16 | * modification, are permitted provided that the following conditions 17 | * are met: 18 | * 1. Redistributions of source code must retain the above copyright 19 | * notice, this list of conditions and the following disclaimer. 20 | * 2. Redistributions in binary form must reproduce the above copyright 21 | * notice, this list of conditions and the following disclaimer in 22 | * the documentation and/or other materials provided with the 23 | * distribution. 24 | * 3. Neither the name of Agui nor the names of its contributors may 25 | * be used to endorse or promote products derived from this software 26 | * without specific prior written permission. 27 | * 28 | * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS 29 | * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT 30 | * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR 31 | * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT 32 | * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, 33 | * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED 34 | * TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR 35 | * PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF 36 | * LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING 37 | * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS 38 | * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 39 | */ 40 | 41 | #ifndef AGUI_FOCUS_LISTENER_HPP 42 | #define AGUI_FOCUS_LISTENER_HPP 43 | #include "Agui/Platform.hpp" 44 | namespace agui { 45 | class AGUI_CORE_DECLSPEC Widget; 46 | /** 47 | * Abstract class for Focus Listeners. 48 | * 49 | * Any derived Focus Listeners should inherit from this class. 50 | * @author Joshua Larouche 51 | * @since 0.1.0 52 | */ 53 | class AGUI_CORE_DECLSPEC FocusListener 54 | { 55 | public: 56 | FocusListener(void); 57 | virtual void focusGainedCB(Widget*){} 58 | virtual void focusLostCB(Widget*) {} 59 | virtual void modalFocusGainedCB(Widget*) {} 60 | virtual void modalFocusLostCB(Widget*) {} 61 | 62 | virtual ~FocusListener(void); 63 | }; 64 | } 65 | #endif -------------------------------------------------------------------------------- /include/Agui/FontLoader.hpp: -------------------------------------------------------------------------------- 1 | /* _____ 2 | * /\ _ \ __ 3 | * \ \ \_\ \ __ __ __ /\_\ 4 | * \ \ __ \ /'_ `\ /\ \/\ \\/\ \ 5 | * \ \ \/\ \ /\ \_\ \\ \ \_\ \\ \ \ 6 | * \ \_\ \_\\ \____ \\ \____/ \ \_\ 7 | * \/_/\/_/ \/____\ \\/___/ \/_/ 8 | * /\____/ 9 | * \_/__/ 10 | * 11 | * Copyright (c) 2011 Joshua Larouche 12 | * 13 | * 14 | * License: (BSD) 15 | * Redistribution and use in source and binary forms, with or without 16 | * modification, are permitted provided that the following conditions 17 | * are met: 18 | * 1. Redistributions of source code must retain the above copyright 19 | * notice, this list of conditions and the following disclaimer. 20 | * 2. Redistributions in binary form must reproduce the above copyright 21 | * notice, this list of conditions and the following disclaimer in 22 | * the documentation and/or other materials provided with the 23 | * distribution. 24 | * 3. Neither the name of Agui nor the names of its contributors may 25 | * be used to endorse or promote products derived from this software 26 | * without specific prior written permission. 27 | * 28 | * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS 29 | * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT 30 | * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR 31 | * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT 32 | * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, 33 | * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED 34 | * TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR 35 | * PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF 36 | * LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING 37 | * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS 38 | * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 39 | */ 40 | 41 | #ifndef AGUI_FONT_MANAGER_HPP 42 | #define AGUI_FONT_MANAGER_HPP 43 | 44 | #include "Agui/BaseTypes.hpp" 45 | namespace agui { 46 | 47 | /** 48 | * Abstract class to load fonts. 49 | * 50 | * Must implement: 51 | * 52 | * loadFont 53 | * @author Joshua Larouche 54 | * @since 0.1.0 55 | */ 56 | class AGUI_CORE_DECLSPEC FontLoader 57 | { 58 | public: 59 | /** 60 | * Default constructor. 61 | * @since 0.1.0 62 | */ 63 | FontLoader(void) {} 64 | /** 65 | * Default destructor. 66 | * @since 0.1.0 67 | */ 68 | virtual ~FontLoader(void) {} 69 | /** 70 | * @return A pointer to the back end specific font or NULL if failed and no exception was thrown. 71 | * @param fileName The path of the font. Must be compatible with the back end loader. 72 | * @param height The height of the font in pixels. 73 | * @since 0.1.0 74 | */ 75 | virtual Font* loadFont(const std::string &fileName, int height, FontFlags allegroFontFlags, float borderWidth, agui::Color borderColor) = 0; 76 | virtual Font* loadEmptyFont() = 0; 77 | }; 78 | } 79 | #endif 80 | -------------------------------------------------------------------------------- /include/Agui/ImageLoader.hpp: -------------------------------------------------------------------------------- 1 | /* _____ 2 | * /\ _ \ __ 3 | * \ \ \_\ \ __ __ __ /\_\ 4 | * \ \ __ \ /'_ `\ /\ \/\ \\/\ \ 5 | * \ \ \/\ \ /\ \_\ \\ \ \_\ \\ \ \ 6 | * \ \_\ \_\\ \____ \\ \____/ \ \_\ 7 | * \/_/\/_/ \/____\ \\/___/ \/_/ 8 | * /\____/ 9 | * \_/__/ 10 | * 11 | * Copyright (c) 2011 Joshua Larouche 12 | * 13 | * 14 | * License: (BSD) 15 | * Redistribution and use in source and binary forms, with or without 16 | * modification, are permitted provided that the following conditions 17 | * are met: 18 | * 1. Redistributions of source code must retain the above copyright 19 | * notice, this list of conditions and the following disclaimer. 20 | * 2. Redistributions in binary form must reproduce the above copyright 21 | * notice, this list of conditions and the following disclaimer in 22 | * the documentation and/or other materials provided with the 23 | * distribution. 24 | * 3. Neither the name of Agui nor the names of its contributors may 25 | * be used to endorse or promote products derived from this software 26 | * without specific prior written permission. 27 | * 28 | * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS 29 | * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT 30 | * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR 31 | * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT 32 | * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, 33 | * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED 34 | * TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR 35 | * PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF 36 | * LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING 37 | * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS 38 | * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 39 | */ 40 | 41 | #ifndef AGUI_BITMAP_MANAGER 42 | #define AGUI_BITMAP_MANAGER 43 | 44 | #include "Agui/BaseTypes.hpp" 45 | namespace agui { 46 | /** 47 | * Abstract class to load images. 48 | * 49 | * Must implement: 50 | * 51 | * loadImage 52 | * @author Joshua Larouche 53 | * @since 0.1.0 54 | */ 55 | class AGUI_CORE_DECLSPEC ImageLoader 56 | { 57 | public: 58 | /** 59 | * Default constructor. 60 | * @since 0.1.0 61 | */ 62 | ImageLoader(void) {} 63 | /** 64 | * Default destructor. 65 | * @since 0.1.0 66 | */ 67 | virtual ~ImageLoader(void) {} 68 | /** 69 | * @return A back end specific Image or NULL. 70 | * @param fileName The path to the image. 71 | * @param convertMask Determines if the color (255, 0, 255) should be converted to (0,0,0,0). 72 | * @param convertToDisplayFormat Determines if the image should be converted to display format. 73 | * Not applicable in most situations. 74 | * @since 0.1.0 75 | */ 76 | virtual Image* loadImage(const std::string &fileName, bool convertMask = false, 77 | bool converToDisplayFormat = false) = 0; 78 | }; 79 | } 80 | #endif -------------------------------------------------------------------------------- /include/Agui/KeyboardListener.hpp: -------------------------------------------------------------------------------- 1 | /* _____ 2 | * /\ _ \ __ 3 | * \ \ \_\ \ __ __ __ /\_\ 4 | * \ \ __ \ /'_ `\ /\ \/\ \\/\ \ 5 | * \ \ \/\ \ /\ \_\ \\ \ \_\ \\ \ \ 6 | * \ \_\ \_\\ \____ \\ \____/ \ \_\ 7 | * \/_/\/_/ \/____\ \\/___/ \/_/ 8 | * /\____/ 9 | * \_/__/ 10 | * 11 | * Copyright (c) 2011 Joshua Larouche 12 | * 13 | * 14 | * License: (BSD) 15 | * Redistribution and use in source and binary forms, with or without 16 | * modification, are permitted provided that the following conditions 17 | * are met: 18 | * 1. Redistributions of source code must retain the above copyright 19 | * notice, this list of conditions and the following disclaimer. 20 | * 2. Redistributions in binary form must reproduce the above copyright 21 | * notice, this list of conditions and the following disclaimer in 22 | * the documentation and/or other materials provided with the 23 | * distribution. 24 | * 3. Neither the name of Agui nor the names of its contributors may 25 | * be used to endorse or promote products derived from this software 26 | * without specific prior written permission. 27 | * 28 | * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS 29 | * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT 30 | * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR 31 | * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT 32 | * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, 33 | * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED 34 | * TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR 35 | * PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF 36 | * LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING 37 | * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS 38 | * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 39 | */ 40 | 41 | #ifndef AGUI_KEYBOARD_LISTENER_HPP 42 | #define AGUI_KEYBOARD_LISTENER_HPP 43 | 44 | #include "Agui/EventArgs.hpp" 45 | namespace agui { 46 | /** 47 | * Abstract class for Keyboard Listeners. 48 | * 49 | * Any derived Keyboard Listeners should inherit from this class. 50 | * @author Joshua Larouche 51 | * @since 0.1.0 52 | */ 53 | class AGUI_CORE_DECLSPEC KeyboardListener 54 | { 55 | public: 56 | KeyboardListener(void); 57 | virtual void keyDownCB(KeyEvent &){} 58 | virtual void keyUpCB(KeyEvent &){} 59 | virtual void keyRepeatCB(KeyEvent &){} 60 | virtual ~KeyboardListener(void); 61 | }; 62 | } 63 | #endif -------------------------------------------------------------------------------- /include/Agui/MouseListener.hpp: -------------------------------------------------------------------------------- 1 | /* _____ 2 | * /\ _ \ __ 3 | * \ \ \_\ \ __ __ __ /\_\ 4 | * \ \ __ \ /'_ `\ /\ \/\ \\/\ \ 5 | * \ \ \/\ \ /\ \_\ \\ \ \_\ \\ \ \ 6 | * \ \_\ \_\\ \____ \\ \____/ \ \_\ 7 | * \/_/\/_/ \/____\ \\/___/ \/_/ 8 | * /\____/ 9 | * \_/__/ 10 | * 11 | * Copyright (c) 2011 Joshua Larouche 12 | * 13 | * 14 | * License: (BSD) 15 | * Redistribution and use in source and binary forms, with or without 16 | * modification, are permitted provided that the following conditions 17 | * are met: 18 | * 1. Redistributions of source code must retain the above copyright 19 | * notice, this list of conditions and the following disclaimer. 20 | * 2. Redistributions in binary form must reproduce the above copyright 21 | * notice, this list of conditions and the following disclaimer in 22 | * the documentation and/or other materials provided with the 23 | * distribution. 24 | * 3. Neither the name of Agui nor the names of its contributors may 25 | * be used to endorse or promote products derived from this software 26 | * without specific prior written permission. 27 | * 28 | * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS 29 | * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT 30 | * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR 31 | * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT 32 | * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, 33 | * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED 34 | * TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR 35 | * PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF 36 | * LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING 37 | * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS 38 | * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 39 | */ 40 | 41 | #ifndef MOUSE_LISTENER_HPP 42 | #define MOUSE_LISTENER_HPP 43 | 44 | #include "Agui/EventArgs.hpp" 45 | namespace agui { 46 | /** 47 | * Abstract class for Mouse Listeners. 48 | * 49 | * Any derived Mouse Listeners should inherit from this class. 50 | * @author Joshua Larouche 51 | * @since 0.1.0 52 | */ 53 | class AGUI_CORE_DECLSPEC MouseListener 54 | { 55 | protected: 56 | public: 57 | MouseListener(void); 58 | virtual ~MouseListener(void) {}; 59 | 60 | virtual void mouseDownCB(MouseEvent &) {} 61 | virtual void mouseUpCB(MouseEvent &) {} 62 | virtual void mouseMoveCB(MouseEvent &){} 63 | virtual void mouseClickCB(MouseEvent &){} 64 | virtual void mouseDoubleClickCB(MouseEvent &) {} 65 | virtual void mouseWheelUpCB(MouseEvent &) {} 66 | virtual void mouseWheelDownCB(MouseEvent &) {} 67 | virtual void mouseEnterCB(MouseEvent &) {} 68 | virtual void mouseLeaveCB(MouseEvent &) {} 69 | virtual void mouseHoverCB(MouseEvent &) {} 70 | virtual void mouseDragCB(MouseEvent &) {} 71 | virtual void modalMouseDownCB(MouseEvent &) {} 72 | virtual void modalMouseUpCB(MouseEvent &) {} 73 | 74 | }; 75 | } 76 | 77 | #endif -------------------------------------------------------------------------------- /include/Agui/Platform.hpp: -------------------------------------------------------------------------------- 1 | /* _____ 2 | * /\ _ \ __ 3 | * \ \ \_\ \ __ __ __ /\_\ 4 | * \ \ __ \ /'_ `\ /\ \/\ \\/\ \ 5 | * \ \ \/\ \ /\ \_\ \\ \ \_\ \\ \ \ 6 | * \ \_\ \_\\ \____ \\ \____/ \ \_\ 7 | * \/_/\/_/ \/____\ \\/___/ \/_/ 8 | * /\____/ 9 | * \_/__/ 10 | * 11 | * Copyright (c) 2011 Joshua Larouche 12 | * 13 | * 14 | * License: (BSD) 15 | * Redistribution and use in source and binary forms, with or without 16 | * modification, are permitted provided that the following conditions 17 | * are met: 18 | * 1. Redistributions of source code must retain the above copyright 19 | * notice, this list of conditions and the following disclaimer. 20 | * 2. Redistributions in binary form must reproduce the above copyright 21 | * notice, this list of conditions and the following disclaimer in 22 | * the documentation and/or other materials provided with the 23 | * distribution. 24 | * 3. Neither the name of Agui nor the names of its contributors may 25 | * be used to endorse or promote products derived from this software 26 | * without specific prior written permission. 27 | * 28 | * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS 29 | * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT 30 | * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR 31 | * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT 32 | * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, 33 | * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED 34 | * TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR 35 | * PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF 36 | * LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING 37 | * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS 38 | * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 39 | */ 40 | 41 | 42 | #if defined (__MINGW32__) && defined(AGUI_BUILD) 43 | #define AGUI_CORE_DECLSPEC __declspec(dllexport) 44 | 45 | #elif defined (__MINGW32__) && defined(AGUI_BACKEND_BUILD) 46 | #define AGUI_BACKEND_DECLSPEC __declspec(dllexport) 47 | #define AGUI_CORE_DECLSPEC __declspec(dllimport) 48 | 49 | #elif defined (__MINGW32__) && defined(AGUI_DLL_IMPORT) 50 | #define AGUI_CORE_DECLSPEC __declspec(dllimport) 51 | #define AGUI_BACKEND_DECLSPEC __declspec(dllimport) 52 | 53 | #elif defined(_MSC_VER) && defined(AGUI_BUILD) 54 | #define AGUI_CORE_DECLSPEC _declspec(dllexport) 55 | 56 | #elif defined(_MSC_VER) && defined(AGUI_BACKEND_BUILD) 57 | #define AGUI_CORE_DECLSPEC _declspec(dllimport) 58 | #define AGUI_BACKEND_DECLSPEC _declspec(dllexport) 59 | 60 | #endif 61 | 62 | #ifndef AGUI_CORE_DECLSPEC 63 | #define AGUI_CORE_DECLSPEC 64 | #endif 65 | 66 | #ifndef AGUI_BACKEND_DECLSPEC 67 | #define AGUI_BACKEND_DECLSPEC 68 | #endif 69 | 70 | #if defined(_MSC_VER) && _MSC_VER < 1600 71 | #define nullptr 0 72 | #endif 73 | 74 | 75 | -------------------------------------------------------------------------------- /include/Agui/SelectionListener.hpp: -------------------------------------------------------------------------------- 1 | /* _____ 2 | * /\ _ \ __ 3 | * \ \ \_\ \ __ __ __ /\_\ 4 | * \ \ __ \ /'_ `\ /\ \/\ \\/\ \ 5 | * \ \ \/\ \ /\ \_\ \\ \ \_\ \\ \ \ 6 | * \ \_\ \_\\ \____ \\ \____/ \ \_\ 7 | * \/_/\/_/ \/____\ \\/___/ \/_/ 8 | * /\____/ 9 | * \_/__/ 10 | * 11 | * Copyright (c) 2011 Joshua Larouche 12 | * 13 | * 14 | * License: (BSD) 15 | * Redistribution and use in source and binary forms, with or without 16 | * modification, are permitted provided that the following conditions 17 | * are met: 18 | * 1. Redistributions of source code must retain the above copyright 19 | * notice, this list of conditions and the following disclaimer. 20 | * 2. Redistributions in binary form must reproduce the above copyright 21 | * notice, this list of conditions and the following disclaimer in 22 | * the documentation and/or other materials provided with the 23 | * distribution. 24 | * 3. Neither the name of Agui nor the names of its contributors may 25 | * be used to endorse or promote products derived from this software 26 | * without specific prior written permission. 27 | * 28 | * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS 29 | * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT 30 | * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR 31 | * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT 32 | * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, 33 | * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED 34 | * TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR 35 | * PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF 36 | * LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING 37 | * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS 38 | * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 39 | */ 40 | 41 | #ifndef AGUI_SELECTION_LISTENER_HPP 42 | #define AGUI_SELECTION_LISTENER_HPP 43 | 44 | #include "Agui/Widget.hpp" 45 | namespace agui { 46 | /** 47 | * Abstract class for Selection Listeners. 48 | * 49 | * Used by the ListBox and Dropdown widgets. 50 | * 51 | * Any derived Selection Listeners should inherit from this class. 52 | * 53 | * Must implement: 54 | * 55 | * selectionChanged 56 | * @author Joshua Larouche 57 | * @since 0.1.0 58 | */ 59 | class AGUI_CORE_DECLSPEC SelectionListener 60 | { 61 | public: 62 | SelectionListener(void); 63 | virtual void selectionChanged(Widget *source, const std::string &item, int index, bool selected) = 0; 64 | virtual ~SelectionListener(void); 65 | }; 66 | } 67 | 68 | #endif 69 | -------------------------------------------------------------------------------- /include/Agui/TapListener.hpp: -------------------------------------------------------------------------------- 1 | /* _____ 2 | * /\ _ \ __ 3 | * \ \ \_\ \ __ __ __ /\_\ 4 | * \ \ __ \ /'_ `\ /\ \/\ \\/\ \ 5 | * \ \ \/\ \ /\ \_\ \\ \ \_\ \\ \ \ 6 | * \ \_\ \_\\ \____ \\ \____/ \ \_\ 7 | * \/_/\/_/ \/____\ \\/___/ \/_/ 8 | * /\____/ 9 | * \_/__/ 10 | * 11 | * Copyright (c) 2011 Joshua Larouche 12 | * 13 | * 14 | * License: (BSD) 15 | * Redistribution and use in source and binary forms, with or without 16 | * modification, are permitted provided that the following conditions 17 | * are met: 18 | * 1. Redistributions of source code must retain the above copyright 19 | * notice, this list of conditions and the following disclaimer. 20 | * 2. Redistributions in binary form must reproduce the above copyright 21 | * notice, this list of conditions and the following disclaimer in 22 | * the documentation and/or other materials provided with the 23 | * distribution. 24 | * 3. Neither the name of Agui nor the names of its contributors may 25 | * be used to endorse or promote products derived from this software 26 | * without specific prior written permission. 27 | * 28 | * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS 29 | * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT 30 | * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR 31 | * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT 32 | * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, 33 | * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED 34 | * TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR 35 | * PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF 36 | * LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING 37 | * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS 38 | * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 39 | */ 40 | 41 | #ifndef AGUI_TAP_LISTENER_HPP 42 | #define AGUI_TAP_LISTENER_HPP 43 | #include "Agui/Platform.hpp" 44 | #include "Agui/EventArgs.hpp" 45 | namespace agui { 46 | class AGUI_CORE_DECLSPEC Widget; 47 | /** 48 | * Abstract class for Tap Listeners. 49 | * 50 | * Any derived Tap Listeners should inherit from this class. 51 | * @author Joshua Larouche 52 | * @since 0.2.1 53 | */ 54 | class AGUI_CORE_DECLSPEC TapListener 55 | { 56 | public: 57 | TapListener(void); 58 | virtual void widgetTapped(Widget*, MouseEvent& evt){} 59 | 60 | virtual ~TapListener(void); 61 | }; 62 | } 63 | #endif -------------------------------------------------------------------------------- /include/Agui/TopContainer.hpp: -------------------------------------------------------------------------------- 1 | /* _____ 2 | * /\ _ \ __ 3 | * \ \ \_\ \ __ __ __ /\_\ 4 | * \ \ __ \ /'_ `\ /\ \/\ \\/\ \ 5 | * \ \ \/\ \ /\ \_\ \\ \ \_\ \\ \ \ 6 | * \ \_\ \_\\ \____ \\ \____/ \ \_\ 7 | * \/_/\/_/ \/____\ \\/___/ \/_/ 8 | * /\____/ 9 | * \_/__/ 10 | * 11 | * Copyright (c) 2011 Joshua Larouche 12 | * 13 | * 14 | * License: (BSD) 15 | * Redistribution and use in source and binary forms, with or without 16 | * modification, are permitted provided that the following conditions 17 | * are met: 18 | * 1. Redistributions of source code must retain the above copyright 19 | * notice, this list of conditions and the following disclaimer. 20 | * 2. Redistributions in binary form must reproduce the above copyright 21 | * notice, this list of conditions and the following disclaimer in 22 | * the documentation and/or other materials provided with the 23 | * distribution. 24 | * 3. Neither the name of Agui nor the names of its contributors may 25 | * be used to endorse or promote products derived from this software 26 | * without specific prior written permission. 27 | * 28 | * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS 29 | * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT 30 | * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR 31 | * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT 32 | * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, 33 | * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED 34 | * TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR 35 | * PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF 36 | * LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING 37 | * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS 38 | * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 39 | */ 40 | 41 | #ifndef AGUI_TOP_CONTAINER_HPP 42 | #define AGUI_TOP_CONTAINER_HPP 43 | 44 | #include "Agui/Widget.hpp" 45 | namespace agui { 46 | class AGUI_CORE_DECLSPEC Gui; 47 | class AGUI_CORE_DECLSPEC FocusManager; 48 | /** 49 | * Class used as the desktop widget in the Gui class. 50 | * @author Joshua Larouche 51 | * @since 0.1.0 52 | */ 53 | class AGUI_CORE_DECLSPEC TopContainer : public Widget { 54 | protected: 55 | virtual void paintComponent(const PaintEvent &paintEvent); 56 | virtual void paintBackground(const PaintEvent &paintEvent); 57 | public: 58 | /** 59 | * Constructor that requires a Gui and FocusManager. 60 | * @since 0.1.0 61 | */ 62 | TopContainer(Gui* manager, FocusManager* focusMan); 63 | /** 64 | * Default destructor. 65 | * @since 0.1.0 66 | */ 67 | virtual ~TopContainer(); 68 | }; 69 | } 70 | 71 | #endif -------------------------------------------------------------------------------- /include/Agui/Transform.hpp: -------------------------------------------------------------------------------- 1 | /* _____ 2 | * /\ _ \ __ 3 | * \ \ \_\ \ __ __ __ /\_\ 4 | * \ \ __ \ /'_ `\ /\ \/\ \\/\ \ 5 | * \ \ \/\ \ /\ \_\ \\ \ \_\ \\ \ \ 6 | * \ \_\ \_\\ \____ \\ \____/ \ \_\ 7 | * \/_/\/_/ \/____\ \\/___/ \/_/ 8 | * /\____/ 9 | * \_/__/ 10 | * 11 | * Copyright (c) 2011 Joshua Larouche 12 | * 13 | * 14 | * License: (BSD) 15 | * Redistribution and use in source and binary forms, with or without 16 | * modification, are permitted provided that the following conditions 17 | * are met: 18 | * 1. Redistributions of source code must retain the above copyright 19 | * notice, this list of conditions and the following disclaimer. 20 | * 2. Redistributions in binary form must reproduce the above copyright 21 | * notice, this list of conditions and the following disclaimer in 22 | * the documentation and/or other materials provided with the 23 | * distribution. 24 | * 3. Neither the name of Agui nor the names of its contributors may 25 | * be used to endorse or promote products derived from this software 26 | * without specific prior written permission. 27 | * 28 | * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS 29 | * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT 30 | * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR 31 | * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT 32 | * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, 33 | * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED 34 | * TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR 35 | * PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF 36 | * LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING 37 | * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS 38 | * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 39 | */ 40 | 41 | #ifndef AGUI_TRANSFORM_HPP 42 | #define AGUI_TRANSFORM_HPP 43 | #include "Agui/Platform.hpp" 44 | 45 | namespace agui 46 | { 47 | /** 48 | * Class for transformations. Used for transforming mouse coordinates. 49 | * 50 | * @author Joshua Larouche 51 | * @since 0.2.0 52 | */ 53 | class AGUI_CORE_DECLSPEC Transform 54 | { 55 | float m[4][4]; 56 | public: 57 | Transform(); 58 | Transform(float matrix[4][4]); 59 | void identity(); 60 | void invert(); 61 | void compose(const Transform& other); 62 | void translate(float x, float y); 63 | void translate(float x, float y, float z); 64 | void rotate(float theta); 65 | void rotate(float x, float y, float z, float angle); 66 | void scale(float sx, float sy); 67 | void scale(float sx, float sy, float sz); 68 | void transformPoint(float* x, float* y); 69 | }; 70 | } 71 | 72 | #endif 73 | 74 | -------------------------------------------------------------------------------- /include/Agui/Widgets/Button/ButtonListener.hpp: -------------------------------------------------------------------------------- 1 | /* _____ 2 | * /\ _ \ __ 3 | * \ \ \_\ \ __ __ __ /\_\ 4 | * \ \ __ \ /'_ `\ /\ \/\ \\/\ \ 5 | * \ \ \/\ \ /\ \_\ \\ \ \_\ \\ \ \ 6 | * \ \_\ \_\\ \____ \\ \____/ \ \_\ 7 | * \/_/\/_/ \/____\ \\/___/ \/_/ 8 | * /\____/ 9 | * \_/__/ 10 | * 11 | * Copyright (c) 2011 Joshua Larouche 12 | * 13 | * 14 | * License: (BSD) 15 | * Redistribution and use in source and binary forms, with or without 16 | * modification, are permitted provided that the following conditions 17 | * are met: 18 | * 1. Redistributions of source code must retain the above copyright 19 | * notice, this list of conditions and the following disclaimer. 20 | * 2. Redistributions in binary form must reproduce the above copyright 21 | * notice, this list of conditions and the following disclaimer in 22 | * the documentation and/or other materials provided with the 23 | * distribution. 24 | * 3. Neither the name of Agui nor the names of its contributors may 25 | * be used to endorse or promote products derived from this software 26 | * without specific prior written permission. 27 | * 28 | * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS 29 | * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT 30 | * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR 31 | * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT 32 | * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, 33 | * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED 34 | * TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR 35 | * PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF 36 | * LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING 37 | * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS 38 | * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 39 | */ 40 | 41 | #ifndef AGUI_BUTTON_LISTENER_HPP 42 | #define AGUI_BUTTON_LISTENER_HPP 43 | #include "Agui/Widgets/Button/Button.hpp" 44 | namespace agui { 45 | /** 46 | * Abstract class for Button Listeners. 47 | * 48 | * Any derived Button Listeners should inherit from this class. 49 | * @author Joshua Larouche 50 | * @since 0.1.0 51 | */ 52 | class AGUI_CORE_DECLSPEC ButtonListener 53 | { 54 | public: 55 | ButtonListener(void); 56 | 57 | virtual void buttonStateChanged(Button *, 58 | Button::ButtonStateEnum) {} 59 | 60 | virtual void toggleStateChanged(Button *, bool) {} 61 | 62 | virtual void death(Button *) {} 63 | 64 | virtual void isToggleButtonChanged(Button *, 65 | bool) {} 66 | 67 | virtual void textAlignmentChanged(Button *, 68 | AreaAlignmentEnum) {} 69 | 70 | 71 | virtual ~ButtonListener(void); 72 | }; 73 | } 74 | #endif 75 | -------------------------------------------------------------------------------- /include/Agui/Widgets/Frame/FrameListener.hpp: -------------------------------------------------------------------------------- 1 | /* _____ 2 | * /\ _ \ __ 3 | * \ \ \_\ \ __ __ __ /\_\ 4 | * \ \ __ \ /'_ `\ /\ \/\ \\/\ \ 5 | * \ \ \/\ \ /\ \_\ \\ \ \_\ \\ \ \ 6 | * \ \_\ \_\\ \____ \\ \____/ \ \_\ 7 | * \/_/\/_/ \/____\ \\/___/ \/_/ 8 | * /\____/ 9 | * \_/__/ 10 | * 11 | * Copyright (c) 2011 Joshua Larouche 12 | * 13 | * 14 | * License: (BSD) 15 | * Redistribution and use in source and binary forms, with or without 16 | * modification, are permitted provided that the following conditions 17 | * are met: 18 | * 1. Redistributions of source code must retain the above copyright 19 | * notice, this list of conditions and the following disclaimer. 20 | * 2. Redistributions in binary form must reproduce the above copyright 21 | * notice, this list of conditions and the following disclaimer in 22 | * the documentation and/or other materials provided with the 23 | * distribution. 24 | * 3. Neither the name of Agui nor the names of its contributors may 25 | * be used to endorse or promote products derived from this software 26 | * without specific prior written permission. 27 | * 28 | * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS 29 | * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT 30 | * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR 31 | * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT 32 | * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, 33 | * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED 34 | * TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR 35 | * PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF 36 | * LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING 37 | * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS 38 | * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 39 | */ 40 | 41 | #ifndef AGUI_FRAME_LISTENER_HPP 42 | #define AGUI_FRAME_LISTENER_HPP 43 | #include "Agui/Platform.hpp" 44 | namespace agui 45 | { 46 | class AGUI_CORE_DECLSPEC Widget; 47 | class AGUI_CORE_DECLSPEC Frame; 48 | /** 49 | * Abstract class for Frame Listeners. 50 | * 51 | * Any derived Frame Listeners should inherit from this class. 52 | * @author Joshua Larouche 53 | * @since 0.1.0 54 | */ 55 | class AGUI_CORE_DECLSPEC FrameListener 56 | { 57 | public: 58 | virtual void death(Frame*) {} 59 | virtual void contentChildAdded(Frame*, Widget*) {} 60 | virtual void contentChildRemoved(Frame*, Widget*) {} 61 | virtual void topMarginChanged(Frame*, int) {} 62 | virtual void bottomMarginChanged(Frame*, int) {} 63 | virtual void leftMarginChanged(Frame*, int) {} 64 | virtual void rightMarginChanged(Frame*, int) {} 65 | virtual void resizableChanged(Frame*, int) {} 66 | virtual void movableChanged(Frame*, int) {} 67 | FrameListener(void); 68 | virtual ~FrameListener(void); 69 | }; 70 | } 71 | #endif -------------------------------------------------------------------------------- /include/Agui/Widgets/Label/LabelListener.hpp: -------------------------------------------------------------------------------- 1 | /* _____ 2 | * /\ _ \ __ 3 | * \ \ \_\ \ __ __ __ /\_\ 4 | * \ \ __ \ /'_ `\ /\ \/\ \\/\ \ 5 | * \ \ \/\ \ /\ \_\ \\ \ \_\ \\ \ \ 6 | * \ \_\ \_\\ \____ \\ \____/ \ \_\ 7 | * \/_/\/_/ \/____\ \\/___/ \/_/ 8 | * /\____/ 9 | * \_/__/ 10 | * 11 | * Copyright (c) 2011 Joshua Larouche 12 | * 13 | * 14 | * License: (BSD) 15 | * Redistribution and use in source and binary forms, with or without 16 | * modification, are permitted provided that the following conditions 17 | * are met: 18 | * 1. Redistributions of source code must retain the above copyright 19 | * notice, this list of conditions and the following disclaimer. 20 | * 2. Redistributions in binary form must reproduce the above copyright 21 | * notice, this list of conditions and the following disclaimer in 22 | * the documentation and/or other materials provided with the 23 | * distribution. 24 | * 3. Neither the name of Agui nor the names of its contributors may 25 | * be used to endorse or promote products derived from this software 26 | * without specific prior written permission. 27 | * 28 | * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS 29 | * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT 30 | * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR 31 | * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT 32 | * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, 33 | * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED 34 | * TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR 35 | * PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF 36 | * LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING 37 | * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS 38 | * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 39 | */ 40 | 41 | #ifndef AGUI_LABEL_LISTENER_HPP 42 | #define AGUI_LABEL_LISTENER_HPP 43 | 44 | #include "Agui/Widgets/Label/Label.hpp" 45 | namespace agui { 46 | /** 47 | * Abstract class for Label Listeners. 48 | * 49 | * Any derived Label Listeners should inherit from this class. 50 | * @author Joshua Larouche 51 | * @since 0.1.0 52 | */ 53 | class AGUI_CORE_DECLSPEC LabelListener 54 | { 55 | public: 56 | LabelListener(void); 57 | virtual void alignmentChanged(Label *source, AreaAlignmentEnum alignment) { (void)(source); (void)(alignment); }; 58 | virtual void isAutosizingChanged(Label *source,bool autosizing) { (void)(source); (void)(autosizing);} 59 | virtual ~LabelListener(void); 60 | virtual void death(Label *source) { (void)(source); }; 61 | }; 62 | } 63 | 64 | #endif 65 | -------------------------------------------------------------------------------- /include/Agui/Widgets/ScrollBar/HScrollBarListener.hpp: -------------------------------------------------------------------------------- 1 | /* _____ 2 | * /\ _ \ __ 3 | * \ \ \_\ \ __ __ __ /\_\ 4 | * \ \ __ \ /'_ `\ /\ \/\ \\/\ \ 5 | * \ \ \/\ \ /\ \_\ \\ \ \_\ \\ \ \ 6 | * \ \_\ \_\\ \____ \\ \____/ \ \_\ 7 | * \/_/\/_/ \/____\ \\/___/ \/_/ 8 | * /\____/ 9 | * \_/__/ 10 | * 11 | * Copyright (c) 2011 Joshua Larouche 12 | * 13 | * 14 | * License: (BSD) 15 | * Redistribution and use in source and binary forms, with or without 16 | * modification, are permitted provided that the following conditions 17 | * are met: 18 | * 1. Redistributions of source code must retain the above copyright 19 | * notice, this list of conditions and the following disclaimer. 20 | * 2. Redistributions in binary form must reproduce the above copyright 21 | * notice, this list of conditions and the following disclaimer in 22 | * the documentation and/or other materials provided with the 23 | * distribution. 24 | * 3. Neither the name of Agui nor the names of its contributors may 25 | * be used to endorse or promote products derived from this software 26 | * without specific prior written permission. 27 | * 28 | * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS 29 | * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT 30 | * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR 31 | * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT 32 | * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, 33 | * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED 34 | * TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR 35 | * PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF 36 | * LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING 37 | * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS 38 | * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 39 | */ 40 | 41 | #ifndef AGUI_HSCROLLBAR_LISTENER_HPP 42 | #define AGUI_HSCROLLBAR_LISTENER_HPP 43 | #include "Agui/Platform.hpp" 44 | namespace agui { 45 | class AGUI_CORE_DECLSPEC HScrollBar; 46 | /** 47 | * Abstract class for Horizontal Scrollbar Listeners. 48 | * 49 | * Any derived Horizontal Scrollbar Listeners should inherit from this class. 50 | * 51 | * Must implement: 52 | * 53 | * valueChanged 54 | * @author Joshua Larouche 55 | * @since 0.1.0 56 | */ 57 | class AGUI_CORE_DECLSPEC HScrollBarListener 58 | { 59 | public: 60 | HScrollBarListener(void); 61 | virtual void valueChanged(HScrollBar* source, int val) = 0; 62 | virtual void minValueChanged(HScrollBar*, int) {} 63 | virtual void maxValueChanged(HScrollBar*, int) {} 64 | virtual void arrowWidthChanged(HScrollBar*, int) {} 65 | virtual void largeAmountChanged(HScrollBar*, int) {} 66 | virtual void leftAmountChanged(HScrollBar*, int) {} 67 | virtual void rightAmountChanged(HScrollBar*, int) {} 68 | virtual void minThumbWidthChanged(HScrollBar*, int) {} 69 | virtual void death(HScrollBar*) {} 70 | 71 | virtual ~HScrollBarListener(void); 72 | }; 73 | } 74 | #endif 75 | -------------------------------------------------------------------------------- /include/Agui/Widgets/ScrollBar/VScrollBarListener.hpp: -------------------------------------------------------------------------------- 1 | /* _____ 2 | * /\ _ \ __ 3 | * \ \ \_\ \ __ __ __ /\_\ 4 | * \ \ __ \ /'_ `\ /\ \/\ \\/\ \ 5 | * \ \ \/\ \ /\ \_\ \\ \ \_\ \\ \ \ 6 | * \ \_\ \_\\ \____ \\ \____/ \ \_\ 7 | * \/_/\/_/ \/____\ \\/___/ \/_/ 8 | * /\____/ 9 | * \_/__/ 10 | * 11 | * Copyright (c) 2011 Joshua Larouche 12 | * 13 | * 14 | * License: (BSD) 15 | * Redistribution and use in source and binary forms, with or without 16 | * modification, are permitted provided that the following conditions 17 | * are met: 18 | * 1. Redistributions of source code must retain the above copyright 19 | * notice, this list of conditions and the following disclaimer. 20 | * 2. Redistributions in binary form must reproduce the above copyright 21 | * notice, this list of conditions and the following disclaimer in 22 | * the documentation and/or other materials provided with the 23 | * distribution. 24 | * 3. Neither the name of Agui nor the names of its contributors may 25 | * be used to endorse or promote products derived from this software 26 | * without specific prior written permission. 27 | * 28 | * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS 29 | * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT 30 | * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR 31 | * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT 32 | * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, 33 | * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED 34 | * TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR 35 | * PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF 36 | * LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING 37 | * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS 38 | * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 39 | */ 40 | 41 | #ifndef AGUI_VSCROLLBAR_LISTENER_HPP 42 | #define AGUI_VSCROLLBAR_LISTENER_HPP 43 | #include "Agui/Platform.hpp" 44 | namespace agui { 45 | class AGUI_CORE_DECLSPEC VScrollBar; 46 | /** 47 | * Abstract class for Vertical Scrollbar Listeners. 48 | * 49 | * Any derived Vertical Scrollbar Listeners should inherit from this class. 50 | * 51 | * Must implement: 52 | * 53 | * valueChanged 54 | * @author Joshua Larouche 55 | * @since 0.1.0 56 | */ 57 | class AGUI_CORE_DECLSPEC VScrollBarListener 58 | { 59 | public: 60 | VScrollBarListener(void); 61 | virtual void valueChanged(VScrollBar* source, int val) = 0; 62 | virtual void minValueChanged(VScrollBar*, int) {} 63 | virtual void maxValueChanged(VScrollBar*, int) {} 64 | virtual void arrowHeightChanged(VScrollBar*, int) {} 65 | virtual void largeAmountChanged(VScrollBar*, int) {} 66 | virtual void topAmountChanged(VScrollBar*, int) {} 67 | virtual void bottomAmountChanged(VScrollBar*, int) {} 68 | virtual void minThumbHeightChanged(VScrollBar*, int) {} 69 | virtual void death(VScrollBar*) {} 70 | 71 | virtual ~VScrollBarListener(void); 72 | }; 73 | } 74 | 75 | #endif 76 | -------------------------------------------------------------------------------- /include/Agui/Widgets/Slider/SliderListener.hpp: -------------------------------------------------------------------------------- 1 | /* _____ 2 | * /\ _ \ __ 3 | * \ \ \_\ \ __ __ __ /\_\ 4 | * \ \ __ \ /'_ `\ /\ \/\ \\/\ \ 5 | * \ \ \/\ \ /\ \_\ \\ \ \_\ \\ \ \ 6 | * \ \_\ \_\\ \____ \\ \____/ \ \_\ 7 | * \/_/\/_/ \/____\ \\/___/ \/_/ 8 | * /\____/ 9 | * \_/__/ 10 | * 11 | * Copyright (c) 2011 Joshua Larouche 12 | * 13 | * 14 | * License: (BSD) 15 | * Redistribution and use in source and binary forms, with or without 16 | * modification, are permitted provided that the following conditions 17 | * are met: 18 | * 1. Redistributions of source code must retain the above copyright 19 | * notice, this list of conditions and the following disclaimer. 20 | * 2. Redistributions in binary form must reproduce the above copyright 21 | * notice, this list of conditions and the following disclaimer in 22 | * the documentation and/or other materials provided with the 23 | * distribution. 24 | * 3. Neither the name of Agui nor the names of its contributors may 25 | * be used to endorse or promote products derived from this software 26 | * without specific prior written permission. 27 | * 28 | * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS 29 | * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT 30 | * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR 31 | * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT 32 | * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, 33 | * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED 34 | * TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR 35 | * PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF 36 | * LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING 37 | * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS 38 | * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 39 | */ 40 | 41 | #ifndef AGUI_SLIDER_LISTENER_HPP 42 | #define AGUI_SLIDER_LISTENER_HPP 43 | #include "Agui/BaseTypes.hpp" 44 | namespace agui { 45 | class Slider; 46 | /** 47 | * Abstract class for Slider Listeners. 48 | * 49 | * Any derived Slider Listeners should inherit from this class. 50 | * @author Joshua Larouche 51 | * @since 0.1.0 52 | */ 53 | class AGUI_CORE_DECLSPEC SliderListener 54 | { 55 | public: 56 | virtual void valueChanged(Slider*, int) {} 57 | virtual void minValueChanged(Slider*, int) {} 58 | virtual void maxValueChanged(Slider*, int) {} 59 | virtual void stepLengthChanged(Slider*, int) {} 60 | virtual void alignMarkerChanged(Slider*, bool) {} 61 | virtual void orientationChanged(Slider*, OrientationEnum) {} 62 | virtual void death(Slider*) {} 63 | 64 | SliderListener(void); 65 | virtual ~SliderListener(void); 66 | }; 67 | } 68 | 69 | #endif 70 | 71 | -------------------------------------------------------------------------------- /include/Agui/Widgets/Tab/TabbedPaneListener.hpp: -------------------------------------------------------------------------------- 1 | /* _____ 2 | * /\ _ \ __ 3 | * \ \ \_\ \ __ __ __ /\_\ 4 | * \ \ __ \ /'_ `\ /\ \/\ \\/\ \ 5 | * \ \ \/\ \ /\ \_\ \\ \ \_\ \\ \ \ 6 | * \ \_\ \_\\ \____ \\ \____/ \ \_\ 7 | * \/_/\/_/ \/____\ \\/___/ \/_/ 8 | * /\____/ 9 | * \_/__/ 10 | * 11 | * Copyright (c) 2011 Joshua Larouche 12 | * 13 | * 14 | * License: (BSD) 15 | * Redistribution and use in source and binary forms, with or without 16 | * modification, are permitted provided that the following conditions 17 | * are met: 18 | * 1. Redistributions of source code must retain the above copyright 19 | * notice, this list of conditions and the following disclaimer. 20 | * 2. Redistributions in binary form must reproduce the above copyright 21 | * notice, this list of conditions and the following disclaimer in 22 | * the documentation and/or other materials provided with the 23 | * distribution. 24 | * 3. Neither the name of Agui nor the names of its contributors may 25 | * be used to endorse or promote products derived from this software 26 | * without specific prior written permission. 27 | * 28 | * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS 29 | * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT 30 | * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR 31 | * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT 32 | * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, 33 | * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED 34 | * TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR 35 | * PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF 36 | * LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING 37 | * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS 38 | * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 39 | */ 40 | 41 | #ifndef AGUI_TABBED_PANE_LISTENER_HPP 42 | #define AGUI_TABBED_PANE_LISTENER_HPP 43 | 44 | #include "Agui/Platform.hpp" 45 | 46 | namespace agui { 47 | class AGUI_CORE_DECLSPEC Widget; 48 | class AGUI_CORE_DECLSPEC TabbedPane; 49 | class AGUI_CORE_DECLSPEC Tab; 50 | /** 51 | * Abstract class for TabbedPane Listeners. 52 | * 53 | * Any derived TabbedPane Listeners should inherit from this class. 54 | * @author Joshua Larouche 55 | * @since 0.1.0 56 | */ 57 | class AGUI_CORE_DECLSPEC TabbedPaneListener 58 | { 59 | public: 60 | TabbedPaneListener(void); 61 | virtual void selectedTabChanged(TabbedPane* source, Tab *tab) { (void)(source); (void)(tab); } 62 | virtual void resizingTabContentChanged(TabbedPane* source, bool resizing) { (void)(source); (void)(resizing); } 63 | virtual void tabAdded(TabbedPane* source, Tab *tab, Widget* tabContent) { (void)(source); (void)(tab); (void)(tabContent); } 64 | virtual void tabRemoved(TabbedPane* source, Tab* tab) { (void)(source); (void)(tab); } 65 | virtual void death(TabbedPane* source) { (void)(source); } 66 | 67 | 68 | virtual ~TabbedPaneListener(void); 69 | }; 70 | } 71 | #endif 72 | -------------------------------------------------------------------------------- /src/Agui/ActionEvent.cpp: -------------------------------------------------------------------------------- 1 | /* _____ 2 | * /\ _ \ __ 3 | * \ \ \_\ \ __ __ __ /\_\ 4 | * \ \ __ \ /'_ `\ /\ \/\ \\/\ \ 5 | * \ \ \/\ \ /\ \_\ \\ \ \_\ \\ \ \ 6 | * \ \_\ \_\\ \____ \\ \____/ \ \_\ 7 | * \/_/\/_/ \/____\ \\/___/ \/_/ 8 | * /\____/ 9 | * \_/__/ 10 | * 11 | * Copyright (c) 2011 Joshua Larouche 12 | * 13 | * 14 | * License: (BSD) 15 | * Redistribution and use in source and binary forms, with or without 16 | * modification, are permitted provided that the following conditions 17 | * are met: 18 | * 1. Redistributions of source code must retain the above copyright 19 | * notice, this list of conditions and the following disclaimer. 20 | * 2. Redistributions in binary form must reproduce the above copyright 21 | * notice, this list of conditions and the following disclaimer in 22 | * the documentation and/or other materials provided with the 23 | * distribution. 24 | * 3. Neither the name of Agui nor the names of its contributors may 25 | * be used to endorse or promote products derived from this software 26 | * without specific prior written permission. 27 | * 28 | * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS 29 | * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT 30 | * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR 31 | * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT 32 | * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, 33 | * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED 34 | * TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR 35 | * PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF 36 | * LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING 37 | * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS 38 | * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 39 | */ 40 | 41 | #include "Agui/ActionEvent.hpp" 42 | 43 | namespace agui 44 | { 45 | 46 | 47 | const std::string& ActionEvent::getId() const 48 | { 49 | return id; 50 | } 51 | 52 | Widget* ActionEvent::getSource() const 53 | { 54 | return source; 55 | } 56 | 57 | ActionEvent::ActionEvent() 58 | { 59 | source = NULL; 60 | } 61 | 62 | ActionEvent::ActionEvent( Widget* source, 63 | const std::string &id /*= ""*/ ) 64 | { 65 | this->id = id; 66 | this->source = source; 67 | } 68 | 69 | ActionEvent::~ActionEvent() 70 | { 71 | 72 | } 73 | 74 | } -------------------------------------------------------------------------------- /src/Agui/ActionListener.cpp: -------------------------------------------------------------------------------- 1 | /* _____ 2 | * /\ _ \ __ 3 | * \ \ \_\ \ __ __ __ /\_\ 4 | * \ \ __ \ /'_ `\ /\ \/\ \\/\ \ 5 | * \ \ \/\ \ /\ \_\ \\ \ \_\ \\ \ \ 6 | * \ \_\ \_\\ \____ \\ \____/ \ \_\ 7 | * \/_/\/_/ \/____\ \\/___/ \/_/ 8 | * /\____/ 9 | * \_/__/ 10 | * 11 | * Copyright (c) 2011 Joshua Larouche 12 | * 13 | * 14 | * License: (BSD) 15 | * Redistribution and use in source and binary forms, with or without 16 | * modification, are permitted provided that the following conditions 17 | * are met: 18 | * 1. Redistributions of source code must retain the above copyright 19 | * notice, this list of conditions and the following disclaimer. 20 | * 2. Redistributions in binary form must reproduce the above copyright 21 | * notice, this list of conditions and the following disclaimer in 22 | * the documentation and/or other materials provided with the 23 | * distribution. 24 | * 3. Neither the name of Agui nor the names of its contributors may 25 | * be used to endorse or promote products derived from this software 26 | * without specific prior written permission. 27 | * 28 | * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS 29 | * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT 30 | * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR 31 | * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT 32 | * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, 33 | * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED 34 | * TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR 35 | * PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF 36 | * LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING 37 | * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS 38 | * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 39 | */ 40 | 41 | #include "Agui/ActionListener.hpp" 42 | namespace agui { 43 | ActionListener::ActionListener(void) 44 | { 45 | } 46 | 47 | ActionListener::~ActionListener(void) 48 | { 49 | } 50 | } 51 | -------------------------------------------------------------------------------- /src/Agui/Backends/Allegro5/Allegro5FontLoader.cpp: -------------------------------------------------------------------------------- 1 | /* _____ 2 | * /\ _ \ __ 3 | * \ \ \_\ \ __ __ __ /\_\ 4 | * \ \ __ \ /'_ `\ /\ \/\ \\/\ \ 5 | * \ \ \/\ \ /\ \_\ \\ \ \_\ \\ \ \ 6 | * \ \_\ \_\\ \____ \\ \____/ \ \_\ 7 | * \/_/\/_/ \/____\ \\/___/ \/_/ 8 | * /\____/ 9 | * \_/__/ 10 | * 11 | * Copyright (c) 2011 Joshua Larouche 12 | * 13 | * 14 | * License: (BSD) 15 | * Redistribution and use in source and binary forms, with or without 16 | * modification, are permitted provided that the following conditions 17 | * are met: 18 | * 1. Redistributions of source code must retain the above copyright 19 | * notice, this list of conditions and the following disclaimer. 20 | * 2. Redistributions in binary form must reproduce the above copyright 21 | * notice, this list of conditions and the following disclaimer in 22 | * the documentation and/or other materials provided with the 23 | * distribution. 24 | * 3. Neither the name of Agui nor the names of its contributors may 25 | * be used to endorse or promote products derived from this software 26 | * without specific prior written permission. 27 | * 28 | * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS 29 | * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT 30 | * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR 31 | * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT 32 | * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, 33 | * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED 34 | * TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR 35 | * PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF 36 | * LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING 37 | * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS 38 | * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 39 | */ 40 | 41 | #include "Agui/Backends/Allegro5/Allegro5FontLoader.hpp" 42 | namespace agui { 43 | 44 | Font* Allegro5FontLoader::loadFont( const std::string &fileName, int height, FontFlags fontFlags, float borderWidth, agui::Color borderColor ) 45 | { 46 | return new Allegro5Font(fileName,height,fontFlags,borderWidth,borderColor); 47 | } 48 | 49 | Font* Allegro5FontLoader::loadEmptyFont() 50 | { 51 | return new Allegro5Font(); 52 | } 53 | } -------------------------------------------------------------------------------- /src/Agui/Backends/Allegro5/Allegro5ImageLoader.cpp: -------------------------------------------------------------------------------- 1 | /* _____ 2 | * /\ _ \ __ 3 | * \ \ \_\ \ __ __ __ /\_\ 4 | * \ \ __ \ /'_ `\ /\ \/\ \\/\ \ 5 | * \ \ \/\ \ /\ \_\ \\ \ \_\ \\ \ \ 6 | * \ \_\ \_\\ \____ \\ \____/ \ \_\ 7 | * \/_/\/_/ \/____\ \\/___/ \/_/ 8 | * /\____/ 9 | * \_/__/ 10 | * 11 | * Copyright (c) 2011 Joshua Larouche 12 | * 13 | * 14 | * License: (BSD) 15 | * Redistribution and use in source and binary forms, with or without 16 | * modification, are permitted provided that the following conditions 17 | * are met: 18 | * 1. Redistributions of source code must retain the above copyright 19 | * notice, this list of conditions and the following disclaimer. 20 | * 2. Redistributions in binary form must reproduce the above copyright 21 | * notice, this list of conditions and the following disclaimer in 22 | * the documentation and/or other materials provided with the 23 | * distribution. 24 | * 3. Neither the name of Agui nor the names of its contributors may 25 | * be used to endorse or promote products derived from this software 26 | * without specific prior written permission. 27 | * 28 | * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS 29 | * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT 30 | * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR 31 | * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT 32 | * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, 33 | * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED 34 | * TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR 35 | * PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF 36 | * LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING 37 | * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS 38 | * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 39 | */ 40 | 41 | #include "Agui/Backends/Allegro5/Allegro5ImageLoader.hpp" 42 | namespace agui { 43 | 44 | Image* Allegro5ImageLoader::loadImage( const std::string &fileName, 45 | bool convertMask /*= false*/, bool converToDisplayFormat /*= false*/ ) 46 | { 47 | return new Allegro5Image(fileName,convertMask); 48 | } 49 | } -------------------------------------------------------------------------------- /src/Agui/Backends/SFML2/SFML2FontLoader.cpp: -------------------------------------------------------------------------------- 1 | /* _____ 2 | * /\ _ \ __ 3 | * \ \ \_\ \ __ __ __ /\_\ 4 | * \ \ __ \ /'_ `\ /\ \/\ \\/\ \ 5 | * \ \ \/\ \ /\ \_\ \\ \ \_\ \\ \ \ 6 | * \ \_\ \_\\ \____ \\ \____/ \ \_\ 7 | * \/_/\/_/ \/____\ \\/___/ \/_/ 8 | * /\____/ 9 | * \_/__/ 10 | * 11 | * Copyright (c) 2011 Joshua Larouche 12 | * 13 | * 14 | * License: (BSD) 15 | * Redistribution and use in source and binary forms, with or without 16 | * modification, are permitted provided that the following conditions 17 | * are met: 18 | * 1. Redistributions of source code must retain the above copyright 19 | * notice, this list of conditions and the following disclaimer. 20 | * 2. Redistributions in binary form must reproduce the above copyright 21 | * notice, this list of conditions and the following disclaimer in 22 | * the documentation and/or other materials provided with the 23 | * distribution. 24 | * 3. Neither the name of Agui nor the names of its contributors may 25 | * be used to endorse or promote products derived from this software 26 | * without specific prior written permission. 27 | * 28 | * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS 29 | * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT 30 | * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR 31 | * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT 32 | * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, 33 | * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED 34 | * TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR 35 | * PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF 36 | * LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING 37 | * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS 38 | * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 39 | */ 40 | 41 | #include "Agui/Backends/SFML2/SFML2FontLoader.hpp" 42 | #include "Agui/Backends/SFML2/SFML2Font.hpp" 43 | namespace agui 44 | { 45 | SFML2FontLoader::SFML2FontLoader(void) 46 | { 47 | } 48 | 49 | SFML2FontLoader::~SFML2FontLoader(void) 50 | { 51 | } 52 | 53 | Font* SFML2FontLoader::loadFont( const std::string &fileName, int height, FontFlags fontFlags /*= FONT_DEFAULT_FLAGS*/, float borderWidth /*= 0*/, agui::Color borderColor /*= agui::Color()*/ ) 54 | { 55 | return new SFML2Font(fileName,height,fontFlags); 56 | } 57 | 58 | Font* SFML2FontLoader::loadEmptyFont() 59 | { 60 | return new SFML2Font(); 61 | } 62 | 63 | } 64 | -------------------------------------------------------------------------------- /src/Agui/Backends/SFML2/SFML2ImageLoader.cpp: -------------------------------------------------------------------------------- 1 | /* _____ 2 | * /\ _ \ __ 3 | * \ \ \_\ \ __ __ __ /\_\ 4 | * \ \ __ \ /'_ `\ /\ \/\ \\/\ \ 5 | * \ \ \/\ \ /\ \_\ \\ \ \_\ \\ \ \ 6 | * \ \_\ \_\\ \____ \\ \____/ \ \_\ 7 | * \/_/\/_/ \/____\ \\/___/ \/_/ 8 | * /\____/ 9 | * \_/__/ 10 | * 11 | * Copyright (c) 2011 Joshua Larouche 12 | * 13 | * 14 | * License: (BSD) 15 | * Redistribution and use in source and binary forms, with or without 16 | * modification, are permitted provided that the following conditions 17 | * are met: 18 | * 1. Redistributions of source code must retain the above copyright 19 | * notice, this list of conditions and the following disclaimer. 20 | * 2. Redistributions in binary form must reproduce the above copyright 21 | * notice, this list of conditions and the following disclaimer in 22 | * the documentation and/or other materials provided with the 23 | * distribution. 24 | * 3. Neither the name of Agui nor the names of its contributors may 25 | * be used to endorse or promote products derived from this software 26 | * without specific prior written permission. 27 | * 28 | * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS 29 | * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT 30 | * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR 31 | * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT 32 | * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, 33 | * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED 34 | * TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR 35 | * PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF 36 | * LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING 37 | * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS 38 | * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 39 | */ 40 | 41 | #include "Agui/Backends/SFML2/SFML2ImageLoader.hpp" 42 | #include "Agui/Backends/SFML2/SFML2Image.hpp" 43 | namespace agui 44 | { 45 | SFML2ImageLoader::SFML2ImageLoader(void) 46 | { 47 | } 48 | 49 | SFML2ImageLoader::~SFML2ImageLoader(void) 50 | { 51 | } 52 | 53 | Image* SFML2ImageLoader::loadImage( 54 | const std::string &fileName, bool convertMask /*= false*/, bool converToDisplayFormat /*= false*/ ) 55 | { 56 | return new SFML2Image(fileName); 57 | } 58 | 59 | } -------------------------------------------------------------------------------- /src/Agui/BlinkingEvent.cpp: -------------------------------------------------------------------------------- 1 | /* _____ 2 | * /\ _ \ __ 3 | * \ \ \_\ \ __ __ __ /\_\ 4 | * \ \ __ \ /'_ `\ /\ \/\ \\/\ \ 5 | * \ \ \/\ \ /\ \_\ \\ \ \_\ \\ \ \ 6 | * \ \_\ \_\\ \____ \\ \____/ \ \_\ 7 | * \/_/\/_/ \/____\ \\/___/ \/_/ 8 | * /\____/ 9 | * \_/__/ 10 | * 11 | * Copyright (c) 2011 Joshua Larouche 12 | * 13 | * 14 | * License: (BSD) 15 | * Redistribution and use in source and binary forms, with or without 16 | * modification, are permitted provided that the following conditions 17 | * are met: 18 | * 1. Redistributions of source code must retain the above copyright 19 | * notice, this list of conditions and the following disclaimer. 20 | * 2. Redistributions in binary form must reproduce the above copyright 21 | * notice, this list of conditions and the following disclaimer in 22 | * the documentation and/or other materials provided with the 23 | * distribution. 24 | * 3. Neither the name of Agui nor the names of its contributors may 25 | * be used to endorse or promote products derived from this software 26 | * without specific prior written permission. 27 | * 28 | * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS 29 | * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT 30 | * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR 31 | * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT 32 | * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, 33 | * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED 34 | * TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR 35 | * PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF 36 | * LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING 37 | * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS 38 | * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 39 | */ 40 | 41 | #include "Agui/BlinkingEvent.hpp" 42 | 43 | namespace agui 44 | { 45 | BlinkingEvent::BlinkingEvent(void) 46 | : blinkInterval(0.5), lastBlinkTime(0), blinking(true), 47 | blinkNeedsInvalidation(false) 48 | { 49 | } 50 | 51 | BlinkingEvent::~BlinkingEvent(void) 52 | { 53 | } 54 | 55 | void BlinkingEvent::processBlinkEvent( double elapsedTime ) 56 | { 57 | if(elapsedTime > lastBlinkTime) 58 | { 59 | blinking = !blinking; 60 | lastBlinkTime = elapsedTime + blinkInterval; 61 | } 62 | else if(blinkNeedsInvalidation) 63 | { 64 | lastBlinkTime = elapsedTime + blinkInterval; 65 | blinkNeedsInvalidation = false; 66 | } 67 | } 68 | 69 | bool BlinkingEvent::isBlinking() const 70 | { 71 | return blinking; 72 | } 73 | 74 | void BlinkingEvent::invalidateBlink() 75 | { 76 | blinkNeedsInvalidation = true; 77 | } 78 | 79 | void BlinkingEvent::setBlinking( bool blinking ) 80 | { 81 | this->blinking = blinking; 82 | } 83 | 84 | void BlinkingEvent::setBlinkingInverval( double interval ) 85 | { 86 | blinkInterval = interval; 87 | blinkNeedsInvalidation = true; 88 | } 89 | } 90 | -------------------------------------------------------------------------------- /src/Agui/CursorProvider.cpp: -------------------------------------------------------------------------------- 1 | /* _____ 2 | * /\ _ \ __ 3 | * \ \ \_\ \ __ __ __ /\_\ 4 | * \ \ __ \ /'_ `\ /\ \/\ \\/\ \ 5 | * \ \ \/\ \ /\ \_\ \\ \ \_\ \\ \ \ 6 | * \ \_\ \_\\ \____ \\ \____/ \ \_\ 7 | * \/_/\/_/ \/____\ \\/___/ \/_/ 8 | * /\____/ 9 | * \_/__/ 10 | * 11 | * Copyright (c) 2011 Joshua Larouche 12 | * 13 | * 14 | * License: (BSD) 15 | * Redistribution and use in source and binary forms, with or without 16 | * modification, are permitted provided that the following conditions 17 | * are met: 18 | * 1. Redistributions of source code must retain the above copyright 19 | * notice, this list of conditions and the following disclaimer. 20 | * 2. Redistributions in binary form must reproduce the above copyright 21 | * notice, this list of conditions and the following disclaimer in 22 | * the documentation and/or other materials provided with the 23 | * distribution. 24 | * 3. Neither the name of Agui nor the names of its contributors may 25 | * be used to endorse or promote products derived from this software 26 | * without specific prior written permission. 27 | * 28 | * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS 29 | * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT 30 | * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR 31 | * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT 32 | * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, 33 | * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED 34 | * TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR 35 | * PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF 36 | * LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING 37 | * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS 38 | * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 39 | */ 40 | 41 | #include "Agui/CursorProvider.hpp" 42 | namespace agui { 43 | 44 | 45 | } 46 | -------------------------------------------------------------------------------- /src/Agui/EmptyWidget.cpp: -------------------------------------------------------------------------------- 1 | /* _____ 2 | * /\ _ \ __ 3 | * \ \ \_\ \ __ __ __ /\_\ 4 | * \ \ __ \ /'_ `\ /\ \/\ \\/\ \ 5 | * \ \ \/\ \ /\ \_\ \\ \ \_\ \\ \ \ 6 | * \ \_\ \_\\ \____ \\ \____/ \ \_\ 7 | * \/_/\/_/ \/____\ \\/___/ \/_/ 8 | * /\____/ 9 | * \_/__/ 10 | * 11 | * Copyright (c) 2011 Joshua Larouche 12 | * 13 | * 14 | * License: (BSD) 15 | * Redistribution and use in source and binary forms, with or without 16 | * modification, are permitted provided that the following conditions 17 | * are met: 18 | * 1. Redistributions of source code must retain the above copyright 19 | * notice, this list of conditions and the following disclaimer. 20 | * 2. Redistributions in binary form must reproduce the above copyright 21 | * notice, this list of conditions and the following disclaimer in 22 | * the documentation and/or other materials provided with the 23 | * distribution. 24 | * 3. Neither the name of Agui nor the names of its contributors may 25 | * be used to endorse or promote products derived from this software 26 | * without specific prior written permission. 27 | * 28 | * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS 29 | * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT 30 | * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR 31 | * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT 32 | * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, 33 | * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED 34 | * TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR 35 | * PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF 36 | * LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING 37 | * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS 38 | * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 39 | */ 40 | 41 | #include "Agui/EmptyWidget.hpp" 42 | namespace agui { 43 | EmptyWidget::EmptyWidget(void) 44 | { 45 | setMargins(0,0,0,0); 46 | setBackColor(Color(0,0,0,0)); 47 | } 48 | 49 | EmptyWidget::~EmptyWidget(void) 50 | { 51 | } 52 | 53 | void EmptyWidget::paintComponent( const PaintEvent &paintEvent ) 54 | { 55 | (void)paintEvent; 56 | } 57 | 58 | void EmptyWidget::paintBackground( const PaintEvent &paintEvent ) 59 | { 60 | if(getBackColor().getA() > 0.0f) 61 | paintEvent.graphics()->drawFilledRectangle(getSizeRectangle(),getBackColor()); 62 | } 63 | } -------------------------------------------------------------------------------- /src/Agui/FocusListener.cpp: -------------------------------------------------------------------------------- 1 | /* _____ 2 | * /\ _ \ __ 3 | * \ \ \_\ \ __ __ __ /\_\ 4 | * \ \ __ \ /'_ `\ /\ \/\ \\/\ \ 5 | * \ \ \/\ \ /\ \_\ \\ \ \_\ \\ \ \ 6 | * \ \_\ \_\\ \____ \\ \____/ \ \_\ 7 | * \/_/\/_/ \/____\ \\/___/ \/_/ 8 | * /\____/ 9 | * \_/__/ 10 | * 11 | * Copyright (c) 2011 Joshua Larouche 12 | * 13 | * 14 | * License: (BSD) 15 | * Redistribution and use in source and binary forms, with or without 16 | * modification, are permitted provided that the following conditions 17 | * are met: 18 | * 1. Redistributions of source code must retain the above copyright 19 | * notice, this list of conditions and the following disclaimer. 20 | * 2. Redistributions in binary form must reproduce the above copyright 21 | * notice, this list of conditions and the following disclaimer in 22 | * the documentation and/or other materials provided with the 23 | * distribution. 24 | * 3. Neither the name of Agui nor the names of its contributors may 25 | * be used to endorse or promote products derived from this software 26 | * without specific prior written permission. 27 | * 28 | * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS 29 | * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT 30 | * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR 31 | * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT 32 | * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, 33 | * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED 34 | * TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR 35 | * PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF 36 | * LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING 37 | * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS 38 | * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 39 | */ 40 | 41 | #include "Agui/FocusListener.hpp" 42 | #include "Agui/Widget.hpp" 43 | namespace agui { 44 | FocusListener::FocusListener(void) 45 | { 46 | } 47 | 48 | FocusListener::~FocusListener(void) 49 | { 50 | } 51 | } 52 | -------------------------------------------------------------------------------- /src/Agui/KeyboardListener.cpp: -------------------------------------------------------------------------------- 1 | /* _____ 2 | * /\ _ \ __ 3 | * \ \ \_\ \ __ __ __ /\_\ 4 | * \ \ __ \ /'_ `\ /\ \/\ \\/\ \ 5 | * \ \ \/\ \ /\ \_\ \\ \ \_\ \\ \ \ 6 | * \ \_\ \_\\ \____ \\ \____/ \ \_\ 7 | * \/_/\/_/ \/____\ \\/___/ \/_/ 8 | * /\____/ 9 | * \_/__/ 10 | * 11 | * Copyright (c) 2011 Joshua Larouche 12 | * 13 | * 14 | * License: (BSD) 15 | * Redistribution and use in source and binary forms, with or without 16 | * modification, are permitted provided that the following conditions 17 | * are met: 18 | * 1. Redistributions of source code must retain the above copyright 19 | * notice, this list of conditions and the following disclaimer. 20 | * 2. Redistributions in binary form must reproduce the above copyright 21 | * notice, this list of conditions and the following disclaimer in 22 | * the documentation and/or other materials provided with the 23 | * distribution. 24 | * 3. Neither the name of Agui nor the names of its contributors may 25 | * be used to endorse or promote products derived from this software 26 | * without specific prior written permission. 27 | * 28 | * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS 29 | * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT 30 | * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR 31 | * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT 32 | * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, 33 | * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED 34 | * TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR 35 | * PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF 36 | * LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING 37 | * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS 38 | * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 39 | */ 40 | 41 | #include "Agui/KeyboardListener.hpp" 42 | 43 | namespace agui { 44 | KeyboardListener::KeyboardListener(void) 45 | { 46 | } 47 | 48 | KeyboardListener::~KeyboardListener(void) 49 | { 50 | } 51 | } 52 | -------------------------------------------------------------------------------- /src/Agui/MouseListener.cpp: -------------------------------------------------------------------------------- 1 | /* _____ 2 | * /\ _ \ __ 3 | * \ \ \_\ \ __ __ __ /\_\ 4 | * \ \ __ \ /'_ `\ /\ \/\ \\/\ \ 5 | * \ \ \/\ \ /\ \_\ \\ \ \_\ \\ \ \ 6 | * \ \_\ \_\\ \____ \\ \____/ \ \_\ 7 | * \/_/\/_/ \/____\ \\/___/ \/_/ 8 | * /\____/ 9 | * \_/__/ 10 | * 11 | * Copyright (c) 2011 Joshua Larouche 12 | * 13 | * 14 | * License: (BSD) 15 | * Redistribution and use in source and binary forms, with or without 16 | * modification, are permitted provided that the following conditions 17 | * are met: 18 | * 1. Redistributions of source code must retain the above copyright 19 | * notice, this list of conditions and the following disclaimer. 20 | * 2. Redistributions in binary form must reproduce the above copyright 21 | * notice, this list of conditions and the following disclaimer in 22 | * the documentation and/or other materials provided with the 23 | * distribution. 24 | * 3. Neither the name of Agui nor the names of its contributors may 25 | * be used to endorse or promote products derived from this software 26 | * without specific prior written permission. 27 | * 28 | * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS 29 | * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT 30 | * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR 31 | * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT 32 | * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, 33 | * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED 34 | * TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR 35 | * PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF 36 | * LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING 37 | * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS 38 | * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 39 | */ 40 | 41 | #include "Agui/MouseListener.hpp" 42 | namespace agui { 43 | MouseListener::MouseListener(void) 44 | { 45 | } 46 | 47 | } 48 | -------------------------------------------------------------------------------- /src/Agui/SelectionListener.cpp: -------------------------------------------------------------------------------- 1 | /* _____ 2 | * /\ _ \ __ 3 | * \ \ \_\ \ __ __ __ /\_\ 4 | * \ \ __ \ /'_ `\ /\ \/\ \\/\ \ 5 | * \ \ \/\ \ /\ \_\ \\ \ \_\ \\ \ \ 6 | * \ \_\ \_\\ \____ \\ \____/ \ \_\ 7 | * \/_/\/_/ \/____\ \\/___/ \/_/ 8 | * /\____/ 9 | * \_/__/ 10 | * 11 | * Copyright (c) 2011 Joshua Larouche 12 | * 13 | * 14 | * License: (BSD) 15 | * Redistribution and use in source and binary forms, with or without 16 | * modification, are permitted provided that the following conditions 17 | * are met: 18 | * 1. Redistributions of source code must retain the above copyright 19 | * notice, this list of conditions and the following disclaimer. 20 | * 2. Redistributions in binary form must reproduce the above copyright 21 | * notice, this list of conditions and the following disclaimer in 22 | * the documentation and/or other materials provided with the 23 | * distribution. 24 | * 3. Neither the name of Agui nor the names of its contributors may 25 | * be used to endorse or promote products derived from this software 26 | * without specific prior written permission. 27 | * 28 | * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS 29 | * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT 30 | * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR 31 | * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT 32 | * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, 33 | * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED 34 | * TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR 35 | * PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF 36 | * LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING 37 | * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS 38 | * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 39 | */ 40 | 41 | #include "Agui/SelectionListener.hpp" 42 | namespace agui { 43 | SelectionListener::SelectionListener(void) 44 | { 45 | } 46 | 47 | SelectionListener::~SelectionListener(void) 48 | { 49 | } 50 | } 51 | -------------------------------------------------------------------------------- /src/Agui/TapListener.cpp: -------------------------------------------------------------------------------- 1 | /* _____ 2 | * /\ _ \ __ 3 | * \ \ \_\ \ __ __ __ /\_\ 4 | * \ \ __ \ /'_ `\ /\ \/\ \\/\ \ 5 | * \ \ \/\ \ /\ \_\ \\ \ \_\ \\ \ \ 6 | * \ \_\ \_\\ \____ \\ \____/ \ \_\ 7 | * \/_/\/_/ \/____\ \\/___/ \/_/ 8 | * /\____/ 9 | * \_/__/ 10 | * 11 | * Copyright (c) 2011 Joshua Larouche 12 | * 13 | * 14 | * License: (BSD) 15 | * Redistribution and use in source and binary forms, with or without 16 | * modification, are permitted provided that the following conditions 17 | * are met: 18 | * 1. Redistributions of source code must retain the above copyright 19 | * notice, this list of conditions and the following disclaimer. 20 | * 2. Redistributions in binary form must reproduce the above copyright 21 | * notice, this list of conditions and the following disclaimer in 22 | * the documentation and/or other materials provided with the 23 | * distribution. 24 | * 3. Neither the name of Agui nor the names of its contributors may 25 | * be used to endorse or promote products derived from this software 26 | * without specific prior written permission. 27 | * 28 | * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS 29 | * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT 30 | * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR 31 | * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT 32 | * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, 33 | * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED 34 | * TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR 35 | * PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF 36 | * LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING 37 | * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS 38 | * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 39 | */ 40 | 41 | #include "Agui/TapListener.hpp" 42 | #include "Agui/Widget.hpp" 43 | namespace agui { 44 | TapListener::TapListener(void) 45 | { 46 | } 47 | 48 | TapListener::~TapListener(void) 49 | { 50 | } 51 | } 52 | -------------------------------------------------------------------------------- /src/Agui/TopContainer.cpp: -------------------------------------------------------------------------------- 1 | /* _____ 2 | * /\ _ \ __ 3 | * \ \ \_\ \ __ __ __ /\_\ 4 | * \ \ __ \ /'_ `\ /\ \/\ \\/\ \ 5 | * \ \ \/\ \ /\ \_\ \\ \ \_\ \\ \ \ 6 | * \ \_\ \_\\ \____ \\ \____/ \ \_\ 7 | * \/_/\/_/ \/____\ \\/___/ \/_/ 8 | * /\____/ 9 | * \_/__/ 10 | * 11 | * Copyright (c) 2011 Joshua Larouche 12 | * 13 | * 14 | * License: (BSD) 15 | * Redistribution and use in source and binary forms, with or without 16 | * modification, are permitted provided that the following conditions 17 | * are met: 18 | * 1. Redistributions of source code must retain the above copyright 19 | * notice, this list of conditions and the following disclaimer. 20 | * 2. Redistributions in binary form must reproduce the above copyright 21 | * notice, this list of conditions and the following disclaimer in 22 | * the documentation and/or other materials provided with the 23 | * distribution. 24 | * 3. Neither the name of Agui nor the names of its contributors may 25 | * be used to endorse or promote products derived from this software 26 | * without specific prior written permission. 27 | * 28 | * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS 29 | * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT 30 | * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR 31 | * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT 32 | * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, 33 | * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED 34 | * TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR 35 | * PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF 36 | * LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING 37 | * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS 38 | * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 39 | */ 40 | 41 | #include "Agui/TopContainer.hpp" 42 | #include "Agui/Gui.hpp" 43 | namespace agui 44 | { 45 | TopContainer::TopContainer( Gui* manager, FocusManager* focusMan ) 46 | { 47 | _container = manager; 48 | setMargins(0,0,0,0); _focusManager = focusMan; 49 | } 50 | 51 | void TopContainer::paintBackground( const PaintEvent &paintEvent ) 52 | { 53 | 54 | } 55 | 56 | void TopContainer::paintComponent( const PaintEvent &paintEvent ) 57 | { 58 | 59 | } 60 | 61 | TopContainer::~TopContainer() 62 | { 63 | 64 | } 65 | 66 | } 67 | -------------------------------------------------------------------------------- /src/Agui/WidgetListener.cpp: -------------------------------------------------------------------------------- 1 | /* _____ 2 | * /\ _ \ __ 3 | * \ \ \_\ \ __ __ __ /\_\ 4 | * \ \ __ \ /'_ `\ /\ \/\ \\/\ \ 5 | * \ \ \/\ \ /\ \_\ \\ \ \_\ \\ \ \ 6 | * \ \_\ \_\\ \____ \\ \____/ \ \_\ 7 | * \/_/\/_/ \/____\ \\/___/ \/_/ 8 | * /\____/ 9 | * \_/__/ 10 | * 11 | * Copyright (c) 2011 Joshua Larouche 12 | * 13 | * 14 | * License: (BSD) 15 | * Redistribution and use in source and binary forms, with or without 16 | * modification, are permitted provided that the following conditions 17 | * are met: 18 | * 1. Redistributions of source code must retain the above copyright 19 | * notice, this list of conditions and the following disclaimer. 20 | * 2. Redistributions in binary form must reproduce the above copyright 21 | * notice, this list of conditions and the following disclaimer in 22 | * the documentation and/or other materials provided with the 23 | * distribution. 24 | * 3. Neither the name of Agui nor the names of its contributors may 25 | * be used to endorse or promote products derived from this software 26 | * without specific prior written permission. 27 | * 28 | * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS 29 | * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT 30 | * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR 31 | * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT 32 | * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, 33 | * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED 34 | * TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR 35 | * PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF 36 | * LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING 37 | * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS 38 | * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 39 | */ 40 | 41 | #include "Agui/WidgetListener.hpp" 42 | namespace agui { 43 | WidgetListener::WidgetListener(void) 44 | { 45 | } 46 | 47 | } 48 | -------------------------------------------------------------------------------- /src/Agui/Widgets/Button/ButtonListener.cpp: -------------------------------------------------------------------------------- 1 | /* _____ 2 | * /\ _ \ __ 3 | * \ \ \_\ \ __ __ __ /\_\ 4 | * \ \ __ \ /'_ `\ /\ \/\ \\/\ \ 5 | * \ \ \/\ \ /\ \_\ \\ \ \_\ \\ \ \ 6 | * \ \_\ \_\\ \____ \\ \____/ \ \_\ 7 | * \/_/\/_/ \/____\ \\/___/ \/_/ 8 | * /\____/ 9 | * \_/__/ 10 | * 11 | * Copyright (c) 2011 Joshua Larouche 12 | * 13 | * 14 | * License: (BSD) 15 | * Redistribution and use in source and binary forms, with or without 16 | * modification, are permitted provided that the following conditions 17 | * are met: 18 | * 1. Redistributions of source code must retain the above copyright 19 | * notice, this list of conditions and the following disclaimer. 20 | * 2. Redistributions in binary form must reproduce the above copyright 21 | * notice, this list of conditions and the following disclaimer in 22 | * the documentation and/or other materials provided with the 23 | * distribution. 24 | * 3. Neither the name of Agui nor the names of its contributors may 25 | * be used to endorse or promote products derived from this software 26 | * without specific prior written permission. 27 | * 28 | * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS 29 | * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT 30 | * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR 31 | * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT 32 | * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, 33 | * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED 34 | * TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR 35 | * PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF 36 | * LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING 37 | * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS 38 | * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 39 | */ 40 | 41 | #include "Agui/Widgets/Button/ButtonListener.hpp" 42 | namespace agui { 43 | ButtonListener::ButtonListener(void) 44 | { 45 | } 46 | 47 | ButtonListener::~ButtonListener(void) 48 | { 49 | } 50 | } 51 | -------------------------------------------------------------------------------- /src/Agui/Widgets/CheckBox/CheckBoxListener.cpp: -------------------------------------------------------------------------------- 1 | /* _____ 2 | * /\ _ \ __ 3 | * \ \ \_\ \ __ __ __ /\_\ 4 | * \ \ __ \ /'_ `\ /\ \/\ \\/\ \ 5 | * \ \ \/\ \ /\ \_\ \\ \ \_\ \\ \ \ 6 | * \ \_\ \_\\ \____ \\ \____/ \ \_\ 7 | * \/_/\/_/ \/____\ \\/___/ \/_/ 8 | * /\____/ 9 | * \_/__/ 10 | * 11 | * Copyright (c) 2011 Joshua Larouche 12 | * 13 | * 14 | * License: (BSD) 15 | * Redistribution and use in source and binary forms, with or without 16 | * modification, are permitted provided that the following conditions 17 | * are met: 18 | * 1. Redistributions of source code must retain the above copyright 19 | * notice, this list of conditions and the following disclaimer. 20 | * 2. Redistributions in binary form must reproduce the above copyright 21 | * notice, this list of conditions and the following disclaimer in 22 | * the documentation and/or other materials provided with the 23 | * distribution. 24 | * 3. Neither the name of Agui nor the names of its contributors may 25 | * be used to endorse or promote products derived from this software 26 | * without specific prior written permission. 27 | * 28 | * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS 29 | * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT 30 | * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR 31 | * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT 32 | * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, 33 | * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED 34 | * TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR 35 | * PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF 36 | * LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING 37 | * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS 38 | * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 39 | */ 40 | 41 | #include "Agui/Widgets/CheckBox/CheckBoxListener.hpp" 42 | namespace agui { 43 | CheckBoxListener::CheckBoxListener(void) 44 | { 45 | } 46 | 47 | CheckBoxListener::~CheckBoxListener(void) 48 | { 49 | } 50 | } 51 | -------------------------------------------------------------------------------- /src/Agui/Widgets/DropDown/DropDownListener.cpp: -------------------------------------------------------------------------------- 1 | /* _____ 2 | * /\ _ \ __ 3 | * \ \ \_\ \ __ __ __ /\_\ 4 | * \ \ __ \ /'_ `\ /\ \/\ \\/\ \ 5 | * \ \ \/\ \ /\ \_\ \\ \ \_\ \\ \ \ 6 | * \ \_\ \_\\ \____ \\ \____/ \ \_\ 7 | * \/_/\/_/ \/____\ \\/___/ \/_/ 8 | * /\____/ 9 | * \_/__/ 10 | * 11 | * Copyright (c) 2011 Joshua Larouche 12 | * 13 | * 14 | * License: (BSD) 15 | * Redistribution and use in source and binary forms, with or without 16 | * modification, are permitted provided that the following conditions 17 | * are met: 18 | * 1. Redistributions of source code must retain the above copyright 19 | * notice, this list of conditions and the following disclaimer. 20 | * 2. Redistributions in binary form must reproduce the above copyright 21 | * notice, this list of conditions and the following disclaimer in 22 | * the documentation and/or other materials provided with the 23 | * distribution. 24 | * 3. Neither the name of Agui nor the names of its contributors may 25 | * be used to endorse or promote products derived from this software 26 | * without specific prior written permission. 27 | * 28 | * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS 29 | * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT 30 | * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR 31 | * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT 32 | * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, 33 | * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED 34 | * TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR 35 | * PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF 36 | * LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING 37 | * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS 38 | * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 39 | */ 40 | 41 | #include "Agui/Widgets/DropDown/DropDownListener.hpp" 42 | namespace agui 43 | { 44 | DropDownListener::DropDownListener(void) 45 | { 46 | } 47 | 48 | DropDownListener::~DropDownListener(void) 49 | { 50 | } 51 | } 52 | -------------------------------------------------------------------------------- /src/Agui/Widgets/Frame/FrameListener.cpp: -------------------------------------------------------------------------------- 1 | /* _____ 2 | * /\ _ \ __ 3 | * \ \ \_\ \ __ __ __ /\_\ 4 | * \ \ __ \ /'_ `\ /\ \/\ \\/\ \ 5 | * \ \ \/\ \ /\ \_\ \\ \ \_\ \\ \ \ 6 | * \ \_\ \_\\ \____ \\ \____/ \ \_\ 7 | * \/_/\/_/ \/____\ \\/___/ \/_/ 8 | * /\____/ 9 | * \_/__/ 10 | * 11 | * Copyright (c) 2011 Joshua Larouche 12 | * 13 | * 14 | * License: (BSD) 15 | * Redistribution and use in source and binary forms, with or without 16 | * modification, are permitted provided that the following conditions 17 | * are met: 18 | * 1. Redistributions of source code must retain the above copyright 19 | * notice, this list of conditions and the following disclaimer. 20 | * 2. Redistributions in binary form must reproduce the above copyright 21 | * notice, this list of conditions and the following disclaimer in 22 | * the documentation and/or other materials provided with the 23 | * distribution. 24 | * 3. Neither the name of Agui nor the names of its contributors may 25 | * be used to endorse or promote products derived from this software 26 | * without specific prior written permission. 27 | * 28 | * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS 29 | * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT 30 | * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR 31 | * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT 32 | * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, 33 | * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED 34 | * TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR 35 | * PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF 36 | * LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING 37 | * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS 38 | * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 39 | */ 40 | 41 | #include "Agui/Widgets/Frame/FrameListener.hpp" 42 | namespace agui 43 | { 44 | FrameListener::FrameListener(void) 45 | { 46 | } 47 | 48 | FrameListener::~FrameListener(void) 49 | { 50 | } 51 | } 52 | -------------------------------------------------------------------------------- /src/Agui/Widgets/Label/LabelListener.cpp: -------------------------------------------------------------------------------- 1 | /* _____ 2 | * /\ _ \ __ 3 | * \ \ \_\ \ __ __ __ /\_\ 4 | * \ \ __ \ /'_ `\ /\ \/\ \\/\ \ 5 | * \ \ \/\ \ /\ \_\ \\ \ \_\ \\ \ \ 6 | * \ \_\ \_\\ \____ \\ \____/ \ \_\ 7 | * \/_/\/_/ \/____\ \\/___/ \/_/ 8 | * /\____/ 9 | * \_/__/ 10 | * 11 | * Copyright (c) 2011 Joshua Larouche 12 | * 13 | * 14 | * License: (BSD) 15 | * Redistribution and use in source and binary forms, with or without 16 | * modification, are permitted provided that the following conditions 17 | * are met: 18 | * 1. Redistributions of source code must retain the above copyright 19 | * notice, this list of conditions and the following disclaimer. 20 | * 2. Redistributions in binary form must reproduce the above copyright 21 | * notice, this list of conditions and the following disclaimer in 22 | * the documentation and/or other materials provided with the 23 | * distribution. 24 | * 3. Neither the name of Agui nor the names of its contributors may 25 | * be used to endorse or promote products derived from this software 26 | * without specific prior written permission. 27 | * 28 | * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS 29 | * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT 30 | * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR 31 | * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT 32 | * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, 33 | * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED 34 | * TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR 35 | * PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF 36 | * LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING 37 | * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS 38 | * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 39 | */ 40 | 41 | #include "Agui/Widgets/Label/LabelListener.hpp" 42 | namespace agui { 43 | LabelListener::LabelListener(void) 44 | { 45 | } 46 | 47 | LabelListener::~LabelListener(void) 48 | { 49 | } 50 | } -------------------------------------------------------------------------------- /src/Agui/Widgets/ListBox/ListBoxListener.cpp: -------------------------------------------------------------------------------- 1 | /* _____ 2 | * /\ _ \ __ 3 | * \ \ \_\ \ __ __ __ /\_\ 4 | * \ \ __ \ /'_ `\ /\ \/\ \\/\ \ 5 | * \ \ \/\ \ /\ \_\ \\ \ \_\ \\ \ \ 6 | * \ \_\ \_\\ \____ \\ \____/ \ \_\ 7 | * \/_/\/_/ \/____\ \\/___/ \/_/ 8 | * /\____/ 9 | * \_/__/ 10 | * 11 | * Copyright (c) 2011 Joshua Larouche 12 | * 13 | * 14 | * License: (BSD) 15 | * Redistribution and use in source and binary forms, with or without 16 | * modification, are permitted provided that the following conditions 17 | * are met: 18 | * 1. Redistributions of source code must retain the above copyright 19 | * notice, this list of conditions and the following disclaimer. 20 | * 2. Redistributions in binary form must reproduce the above copyright 21 | * notice, this list of conditions and the following disclaimer in 22 | * the documentation and/or other materials provided with the 23 | * distribution. 24 | * 3. Neither the name of Agui nor the names of its contributors may 25 | * be used to endorse or promote products derived from this software 26 | * without specific prior written permission. 27 | * 28 | * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS 29 | * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT 30 | * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR 31 | * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT 32 | * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, 33 | * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED 34 | * TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR 35 | * PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF 36 | * LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING 37 | * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS 38 | * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 39 | */ 40 | 41 | #include "Agui/Widgets/ListBox/ListBoxListener.hpp" 42 | namespace agui { 43 | ListBoxListener::ListBoxListener(void) 44 | { 45 | } 46 | 47 | ListBoxListener::~ListBoxListener(void) 48 | { 49 | } 50 | } 51 | -------------------------------------------------------------------------------- /src/Agui/Widgets/RadioButton/RadioButtonListener.cpp: -------------------------------------------------------------------------------- 1 | /* _____ 2 | * /\ _ \ __ 3 | * \ \ \_\ \ __ __ __ /\_\ 4 | * \ \ __ \ /'_ `\ /\ \/\ \\/\ \ 5 | * \ \ \/\ \ /\ \_\ \\ \ \_\ \\ \ \ 6 | * \ \_\ \_\\ \____ \\ \____/ \ \_\ 7 | * \/_/\/_/ \/____\ \\/___/ \/_/ 8 | * /\____/ 9 | * \_/__/ 10 | * 11 | * Copyright (c) 2011 Joshua Larouche 12 | * 13 | * 14 | * License: (BSD) 15 | * Redistribution and use in source and binary forms, with or without 16 | * modification, are permitted provided that the following conditions 17 | * are met: 18 | * 1. Redistributions of source code must retain the above copyright 19 | * notice, this list of conditions and the following disclaimer. 20 | * 2. Redistributions in binary form must reproduce the above copyright 21 | * notice, this list of conditions and the following disclaimer in 22 | * the documentation and/or other materials provided with the 23 | * distribution. 24 | * 3. Neither the name of Agui nor the names of its contributors may 25 | * be used to endorse or promote products derived from this software 26 | * without specific prior written permission. 27 | * 28 | * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS 29 | * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT 30 | * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR 31 | * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT 32 | * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, 33 | * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED 34 | * TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR 35 | * PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF 36 | * LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING 37 | * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS 38 | * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 39 | */ 40 | 41 | #include "Agui/Widgets/RadioButton/RadioButtonListener.hpp" 42 | namespace agui { 43 | RadioButtonListener::RadioButtonListener(void) 44 | { 45 | } 46 | 47 | RadioButtonListener::~RadioButtonListener(void) 48 | { 49 | } 50 | } 51 | -------------------------------------------------------------------------------- /src/Agui/Widgets/ScrollBar/HScrollBarListener.cpp: -------------------------------------------------------------------------------- 1 | /* _____ 2 | * /\ _ \ __ 3 | * \ \ \_\ \ __ __ __ /\_\ 4 | * \ \ __ \ /'_ `\ /\ \/\ \\/\ \ 5 | * \ \ \/\ \ /\ \_\ \\ \ \_\ \\ \ \ 6 | * \ \_\ \_\\ \____ \\ \____/ \ \_\ 7 | * \/_/\/_/ \/____\ \\/___/ \/_/ 8 | * /\____/ 9 | * \_/__/ 10 | * 11 | * Copyright (c) 2011 Joshua Larouche 12 | * 13 | * 14 | * License: (BSD) 15 | * Redistribution and use in source and binary forms, with or without 16 | * modification, are permitted provided that the following conditions 17 | * are met: 18 | * 1. Redistributions of source code must retain the above copyright 19 | * notice, this list of conditions and the following disclaimer. 20 | * 2. Redistributions in binary form must reproduce the above copyright 21 | * notice, this list of conditions and the following disclaimer in 22 | * the documentation and/or other materials provided with the 23 | * distribution. 24 | * 3. Neither the name of Agui nor the names of its contributors may 25 | * be used to endorse or promote products derived from this software 26 | * without specific prior written permission. 27 | * 28 | * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS 29 | * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT 30 | * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR 31 | * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT 32 | * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, 33 | * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED 34 | * TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR 35 | * PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF 36 | * LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING 37 | * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS 38 | * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 39 | */ 40 | 41 | #include "Agui/Widgets/ScrollBar/HScrollBarListener.hpp" 42 | 43 | namespace agui { 44 | HScrollBarListener::HScrollBarListener(void) 45 | { 46 | } 47 | 48 | HScrollBarListener::~HScrollBarListener(void) 49 | { 50 | } 51 | } 52 | -------------------------------------------------------------------------------- /src/Agui/Widgets/ScrollBar/VScrollBarListener.cpp: -------------------------------------------------------------------------------- 1 | /* _____ 2 | * /\ _ \ __ 3 | * \ \ \_\ \ __ __ __ /\_\ 4 | * \ \ __ \ /'_ `\ /\ \/\ \\/\ \ 5 | * \ \ \/\ \ /\ \_\ \\ \ \_\ \\ \ \ 6 | * \ \_\ \_\\ \____ \\ \____/ \ \_\ 7 | * \/_/\/_/ \/____\ \\/___/ \/_/ 8 | * /\____/ 9 | * \_/__/ 10 | * 11 | * Copyright (c) 2011 Joshua Larouche 12 | * 13 | * 14 | * License: (BSD) 15 | * Redistribution and use in source and binary forms, with or without 16 | * modification, are permitted provided that the following conditions 17 | * are met: 18 | * 1. Redistributions of source code must retain the above copyright 19 | * notice, this list of conditions and the following disclaimer. 20 | * 2. Redistributions in binary form must reproduce the above copyright 21 | * notice, this list of conditions and the following disclaimer in 22 | * the documentation and/or other materials provided with the 23 | * distribution. 24 | * 3. Neither the name of Agui nor the names of its contributors may 25 | * be used to endorse or promote products derived from this software 26 | * without specific prior written permission. 27 | * 28 | * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS 29 | * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT 30 | * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR 31 | * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT 32 | * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, 33 | * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED 34 | * TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR 35 | * PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF 36 | * LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING 37 | * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS 38 | * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 39 | */ 40 | 41 | #include "Agui/Widgets/ScrollBar/VScrollBarListener.hpp" 42 | #include "Agui/Widgets/ScrollBar/VScrollBar.hpp" 43 | namespace agui { 44 | VScrollBarListener::VScrollBarListener(void) 45 | { 46 | } 47 | 48 | VScrollBarListener::~VScrollBarListener(void) 49 | { 50 | } 51 | } 52 | -------------------------------------------------------------------------------- /src/Agui/Widgets/Slider/SliderListener.cpp: -------------------------------------------------------------------------------- 1 | /* _____ 2 | * /\ _ \ __ 3 | * \ \ \_\ \ __ __ __ /\_\ 4 | * \ \ __ \ /'_ `\ /\ \/\ \\/\ \ 5 | * \ \ \/\ \ /\ \_\ \\ \ \_\ \\ \ \ 6 | * \ \_\ \_\\ \____ \\ \____/ \ \_\ 7 | * \/_/\/_/ \/____\ \\/___/ \/_/ 8 | * /\____/ 9 | * \_/__/ 10 | * 11 | * Copyright (c) 2011 Joshua Larouche 12 | * 13 | * 14 | * License: (BSD) 15 | * Redistribution and use in source and binary forms, with or without 16 | * modification, are permitted provided that the following conditions 17 | * are met: 18 | * 1. Redistributions of source code must retain the above copyright 19 | * notice, this list of conditions and the following disclaimer. 20 | * 2. Redistributions in binary form must reproduce the above copyright 21 | * notice, this list of conditions and the following disclaimer in 22 | * the documentation and/or other materials provided with the 23 | * distribution. 24 | * 3. Neither the name of Agui nor the names of its contributors may 25 | * be used to endorse or promote products derived from this software 26 | * without specific prior written permission. 27 | * 28 | * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS 29 | * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT 30 | * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR 31 | * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT 32 | * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, 33 | * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED 34 | * TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR 35 | * PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF 36 | * LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING 37 | * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS 38 | * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 39 | */ 40 | 41 | #include "Agui/Widgets/Slider/SliderListener.hpp" 42 | namespace agui { 43 | SliderListener::SliderListener(void) 44 | { 45 | } 46 | 47 | SliderListener::~SliderListener(void) 48 | { 49 | } 50 | } 51 | -------------------------------------------------------------------------------- /src/Agui/Widgets/Tab/TabbedPaneListener.cpp: -------------------------------------------------------------------------------- 1 | /* _____ 2 | * /\ _ \ __ 3 | * \ \ \_\ \ __ __ __ /\_\ 4 | * \ \ __ \ /'_ `\ /\ \/\ \\/\ \ 5 | * \ \ \/\ \ /\ \_\ \\ \ \_\ \\ \ \ 6 | * \ \_\ \_\\ \____ \\ \____/ \ \_\ 7 | * \/_/\/_/ \/____\ \\/___/ \/_/ 8 | * /\____/ 9 | * \_/__/ 10 | * 11 | * Copyright (c) 2011 Joshua Larouche 12 | * 13 | * 14 | * License: (BSD) 15 | * Redistribution and use in source and binary forms, with or without 16 | * modification, are permitted provided that the following conditions 17 | * are met: 18 | * 1. Redistributions of source code must retain the above copyright 19 | * notice, this list of conditions and the following disclaimer. 20 | * 2. Redistributions in binary form must reproduce the above copyright 21 | * notice, this list of conditions and the following disclaimer in 22 | * the documentation and/or other materials provided with the 23 | * distribution. 24 | * 3. Neither the name of Agui nor the names of its contributors may 25 | * be used to endorse or promote products derived from this software 26 | * without specific prior written permission. 27 | * 28 | * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS 29 | * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT 30 | * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR 31 | * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT 32 | * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, 33 | * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED 34 | * TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR 35 | * PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF 36 | * LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING 37 | * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS 38 | * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 39 | */ 40 | 41 | #include "Agui/Widgets/Tab/TabbedPaneListener.hpp" 42 | namespace agui 43 | { 44 | TabbedPaneListener::TabbedPaneListener(void) 45 | { 46 | } 47 | 48 | TabbedPaneListener::~TabbedPaneListener(void) 49 | { 50 | } 51 | } 52 | -------------------------------------------------------------------------------- /src/Agui/Widgets/TextBox/TextBoxListener.cpp: -------------------------------------------------------------------------------- 1 | /* _____ 2 | * /\ _ \ __ 3 | * \ \ \_\ \ __ __ __ /\_\ 4 | * \ \ __ \ /'_ `\ /\ \/\ \\/\ \ 5 | * \ \ \/\ \ /\ \_\ \\ \ \_\ \\ \ \ 6 | * \ \_\ \_\\ \____ \\ \____/ \ \_\ 7 | * \/_/\/_/ \/____\ \\/___/ \/_/ 8 | * /\____/ 9 | * \_/__/ 10 | * 11 | * Copyright (c) 2011 Joshua Larouche 12 | * 13 | * 14 | * License: (BSD) 15 | * Redistribution and use in source and binary forms, with or without 16 | * modification, are permitted provided that the following conditions 17 | * are met: 18 | * 1. Redistributions of source code must retain the above copyright 19 | * notice, this list of conditions and the following disclaimer. 20 | * 2. Redistributions in binary form must reproduce the above copyright 21 | * notice, this list of conditions and the following disclaimer in 22 | * the documentation and/or other materials provided with the 23 | * distribution. 24 | * 3. Neither the name of Agui nor the names of its contributors may 25 | * be used to endorse or promote products derived from this software 26 | * without specific prior written permission. 27 | * 28 | * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS 29 | * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT 30 | * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR 31 | * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT 32 | * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, 33 | * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED 34 | * TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR 35 | * PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF 36 | * LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING 37 | * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS 38 | * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 39 | */ 40 | 41 | #include "Agui/Widgets/TextBox/TextBoxListener.hpp" 42 | namespace agui 43 | { 44 | TextBoxListener::TextBoxListener(void) 45 | { 46 | } 47 | 48 | TextBoxListener::~TextBoxListener(void) 49 | { 50 | } 51 | } 52 | -------------------------------------------------------------------------------- /src/Agui/Widgets/TextField/TextFieldListener.cpp: -------------------------------------------------------------------------------- 1 | /* _____ 2 | * /\ _ \ __ 3 | * \ \ \_\ \ __ __ __ /\_\ 4 | * \ \ __ \ /'_ `\ /\ \/\ \\/\ \ 5 | * \ \ \/\ \ /\ \_\ \\ \ \_\ \\ \ \ 6 | * \ \_\ \_\\ \____ \\ \____/ \ \_\ 7 | * \/_/\/_/ \/____\ \\/___/ \/_/ 8 | * /\____/ 9 | * \_/__/ 10 | * 11 | * Copyright (c) 2011 Joshua Larouche 12 | * 13 | * 14 | * License: (BSD) 15 | * Redistribution and use in source and binary forms, with or without 16 | * modification, are permitted provided that the following conditions 17 | * are met: 18 | * 1. Redistributions of source code must retain the above copyright 19 | * notice, this list of conditions and the following disclaimer. 20 | * 2. Redistributions in binary form must reproduce the above copyright 21 | * notice, this list of conditions and the following disclaimer in 22 | * the documentation and/or other materials provided with the 23 | * distribution. 24 | * 3. Neither the name of Agui nor the names of its contributors may 25 | * be used to endorse or promote products derived from this software 26 | * without specific prior written permission. 27 | * 28 | * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS 29 | * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT 30 | * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR 31 | * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT 32 | * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, 33 | * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED 34 | * TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR 35 | * PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF 36 | * LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING 37 | * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS 38 | * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 39 | */ 40 | 41 | #include "Agui/Widgets/TextField/TextFieldListener.hpp" 42 | namespace agui { 43 | TextFieldListener::TextFieldListener(void) 44 | { 45 | } 46 | 47 | TextFieldListener::~TextFieldListener(void) 48 | { 49 | } 50 | } --------------------------------------------------------------------------------