Crazy Eddie's GUI System  ${CEGUI_VERSION}
SampleData.h
1 /***********************************************************************
2 created: 2/6/2012
3 author: Lukas E Meindl
4 *************************************************************************/
5 /***************************************************************************
6 * Copyright (C) 2004 - 2012 Paul D Turner & The CEGUI Development Team
7 *
8 * Permission is hereby granted, free of charge, to any person obtaining
9 * a copy of this software and associated documentation files (the
10 * "Software"), to deal in the Software without restriction, including
11 * without limitation the rights to use, copy, modify, merge, publish,
12 * distribute, sublicense, and/or sell copies of the Software, and to
13 * permit persons to whom the Software is furnished to do so, subject to
14 * the following conditions:
15 *
16 * The above copyright notice and this permission notice shall be
17 * included in all copies or substantial portions of the Software.
18 *
19 * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
20 * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
21 * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.
22 * IN NO EVENT SHALL THE AUTHORS BE LIABLE FOR ANY CLAIM, DAMAGES OR
23 * OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE,
24 * ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR
25 * OTHER DEALINGS IN THE SOFTWARE.
26 ***************************************************************************/
27 #ifndef _Sample_Data_h_
28 #define _Sample_Data_h_
29 
30 #include "CEGUI/String.h"
31 
32 // forward declarations
33 #include "CEGUI/ForwardRefs.h"
34 
35 namespace CEGUI
36 {
37  class BasicImage;
38 }
39 
40 enum SampleType
41 {
42  ST_Module,
43  ST_Lua,
44  ST_Python,
45 
46  ST_Count
47 };
48 
49 class Sample;
50 
52 {
53 public:
54  SampleData(CEGUI::String sampleName, CEGUI::String summary,
55  CEGUI::String description, SampleType sampleTypeEnum, CEGUI::String credits);
56  virtual ~SampleData();
57 
58  virtual void initialise(int width, int height);
59  virtual void deinitialise();
60 
61  virtual CEGUI::GUIContext* getGuiContext();
62  virtual void handleNewWindowSize(float width, float height);
63 
64  void setTextureTargetImageArea(float height, float width);
65  virtual CEGUI::Image& getRTTImage();
66 
67  virtual void setGUIContextRTT();
68  virtual void clearRTTTexture();
69 
70  virtual void onEnteringSample() = 0;
71  virtual void update(float /*timeSinceLastUpdate*/) {}
72 
73  void setSampleWindow(CEGUI::Window* sampleWindow);
74  CEGUI::Window* getSampleWindow();
75 
76  CEGUI::String getName();
77  CEGUI::String getSummary();
78  CEGUI::String getSampleTypeString();
79  CEGUI::String getDescription();
80  CEGUI::String getUsedFilesString();
81  CEGUI::String getCredits();
82 
83 protected:
84  CEGUI::String d_name;
85  CEGUI::String d_summary;
86  CEGUI::String d_description;
87  SampleType d_type;
88  CEGUI::String d_usedFilesString;
89  CEGUI::String d_credits;
90 
91  CEGUI::Window* d_sampleWindow;
92 
93  CEGUI::GUIContext* d_guiContext;
94  CEGUI::TextureTarget* d_textureTarget;
95  CEGUI::BasicImage* d_textureTargetImage;
96 };
97 
99 {
100 public:
101  SampleDataModule(CEGUI::String sampleName, CEGUI::String summary,
102  CEGUI::String description, SampleType sampleTypeEnum, CEGUI::String credits);
103  virtual ~SampleDataModule();
104 
105  virtual void getSampleInstanceFromDLL();
106 
107  virtual void initialise(int width, int height);
108  virtual void deinitialise();
109 
110  virtual void onEnteringSample();
111 
112  virtual void update(float timeSinceLastUpdate);
113 
114 private:
115  CEGUI::DynamicModule* d_dynamicModule;
116  Sample* d_sample;
117 };
118 
119 #endif
120 
Definition: cegui/include/CEGUI/GUIContext.h:68
Class that wraps and gives access to a dynamically linked module (.dll, .so, etc...)
Definition: cegui/include/CEGUI/DynamicModule.h:41
Interface for Image.
Definition: cegui/include/CEGUI/Image.h:158
Main namespace for Crazy Eddie's GUI Library.
Definition: cegui/include/CEGUI/Affector.h:42
Specialisation of RenderTarget interface that should be used as the base class for RenderTargets that...
Definition: cegui/include/CEGUI/TextureTarget.h:40
Definition: cegui/include/CEGUI/BasicImage.h:42
An abstract base class providing common functionality and specifying the required interface for deriv...
Definition: cegui/include/CEGUI/Window.h:149
Definition: SampleData.h:51
Definition: SampleData.h:98
String class used within the GUI system.
Definition: cegui/include/CEGUI/String.h:62
Definition: Sample.h:36