Core.h 6.1 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152
  1. /*
  2. * This source file is part of libRocket, the HTML/CSS Interface Middleware
  3. *
  4. * For the latest information, see http://www.librocket.com
  5. *
  6. * Copyright (c) 2008-2010 CodePoint Ltd, Shift Technology Ltd
  7. *
  8. * Permission is hereby granted, free of charge, to any person obtaining a copy
  9. * of this software and associated documentation files (the "Software"), to deal
  10. * in the Software without restriction, including without limitation the rights
  11. * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
  12. * copies of the Software, and to permit persons to whom the Software is
  13. * furnished to do so, subject to the following conditions:
  14. *
  15. * The above copyright notice and this permission notice shall be included in
  16. * all copies or substantial portions of the Software.
  17. *
  18. * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
  19. * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
  20. * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
  21. * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
  22. * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
  23. * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
  24. * THE SOFTWARE.
  25. *
  26. */
  27. #ifndef ROCKETCORECORE_H
  28. #define ROCKETCORECORE_H
  29. #include <Rocket/Core/Types.h>
  30. #include <Rocket/Core/Math.h>
  31. #include <Rocket/Core/Header.h>
  32. #include <Rocket/Core/Box.h>
  33. #include <Rocket/Core/Context.h>
  34. #include <Rocket/Core/ContextInstancer.h>
  35. #include <Rocket/Core/Decorator.h>
  36. #include <Rocket/Core/DecoratorInstancer.h>
  37. #include <Rocket/Core/Element.h>
  38. #include <Rocket/Core/ElementDocument.h>
  39. #include <Rocket/Core/ElementInstancer.h>
  40. #include <Rocket/Core/ElementInstancerGeneric.h>
  41. #include <Rocket/Core/ElementReference.h>
  42. #include <Rocket/Core/ElementScroll.h>
  43. #include <Rocket/Core/ElementText.h>
  44. #include <Rocket/Core/ElementUtilities.h>
  45. #include <Rocket/Core/Event.h>
  46. #include <Rocket/Core/EventInstancer.h>
  47. #include <Rocket/Core/EventListener.h>
  48. #include <Rocket/Core/EventListenerInstancer.h>
  49. #include <Rocket/Core/Factory.h>
  50. #include <Rocket/Core/FileInterface.h>
  51. #include <Rocket/Core/Font.h>
  52. #include <Rocket/Core/FontDatabase.h>
  53. #include <Rocket/Core/FontEffect.h>
  54. #include <Rocket/Core/FontGlyph.h>
  55. #include <Rocket/Core/Geometry.h>
  56. #include <Rocket/Core/GeometryUtilities.h>
  57. #include <Rocket/Core/Input.h>
  58. #include <Rocket/Core/Log.h>
  59. #include <Rocket/Core/Plugin.h>
  60. #include <Rocket/Core/Property.h>
  61. #include <Rocket/Core/PropertyDefinition.h>
  62. #include <Rocket/Core/PropertyDictionary.h>
  63. #include <Rocket/Core/PropertyParser.h>
  64. #include <Rocket/Core/PropertySpecification.h>
  65. #include <Rocket/Core/RenderInterface.h>
  66. #include <Rocket/Core/String.h>
  67. #include <Rocket/Core/StyleSheet.h>
  68. #include <Rocket/Core/StyleSheetKeywords.h>
  69. #include <Rocket/Core/StyleSheetSpecification.h>
  70. #include <Rocket/Core/SystemInterface.h>
  71. #include <Rocket/Core/Texture.h>
  72. #include <Rocket/Core/Types.h>
  73. #include <Rocket/Core/Vertex.h>
  74. #include <Rocket/Core/XMLNodeHandler.h>
  75. #include <Rocket/Core/XMLParser.h>
  76. namespace Rocket {
  77. namespace Core {
  78. class Plugin;
  79. /**
  80. Rocket library core API.
  81. @author Peter Curry
  82. */
  83. /// Initialises Rocket.
  84. ROCKETCORE_API bool Initialise();
  85. /// Shutdown Rocket.
  86. ROCKETCORE_API void Shutdown();
  87. /// Returns the version of this Rocket library.
  88. /// @return The version number.
  89. ROCKETCORE_API String GetVersion();
  90. /// Sets the interface through which all system requests are made. This must be called before Initialise().
  91. /// @param[in] system_interface The application-specified logging interface.
  92. ROCKETCORE_API void SetSystemInterface(SystemInterface* system_interface);
  93. /// Returns Rocket's system interface.
  94. /// @return Rocket's system interface.
  95. ROCKETCORE_API SystemInterface* GetSystemInterface();
  96. /// Sets the interface through which all rendering requests are made. This is not required to be called, but if it is
  97. /// it must be called before Initialise(). If no render interface is specified, then all contexts must have a custom
  98. /// render interface.
  99. /// @param[in] render_interface Render interface implementation.
  100. ROCKETCORE_API void SetRenderInterface(RenderInterface* render_interface);
  101. /// Returns Rocket's default's render interface.
  102. /// @return Rocket's render interface.
  103. ROCKETCORE_API RenderInterface* GetRenderInterface();
  104. /// Sets the interface through which all file I/O requests are made. This is not required to be called, but if it is it
  105. /// must be called before Initialise().
  106. /// @param[in] file_interface The application-specified file interface
  107. ROCKETCORE_API void SetFileInterface(FileInterface* file_interface);
  108. /// Returns Rocket's file interface.
  109. /// @return Rocket's file interface.
  110. ROCKETCORE_API FileInterface* GetFileInterface();
  111. /// Creates a new element context.
  112. /// @param[in] name The new name of the context. This must be unique.
  113. /// @param[in] dimensions The initial dimensions of the new context.
  114. /// @param[in] render_interface The custom render interface to use, or NULL to use the default.
  115. /// @return The new context, or NULL if the context could not be created.
  116. ROCKETCORE_API Context* CreateContext(const String& name, const Vector2i& dimensions, RenderInterface* render_interface = NULL);
  117. /// Fetches a previously constructed context by name.
  118. /// @param[in] name The name of the desired context.
  119. /// @return The desired context, or NULL if no context exists with the given name.
  120. ROCKETCORE_API Context* GetContext(const String& name);
  121. /// Fetches a context by index.
  122. /// @param[in] index The index of the desired context. If this is outside of the valid range of contexts, it will be clamped.
  123. /// @return The requested context, or NULL if no contexts exist.
  124. ROCKETCORE_API Context* GetContext(int index);
  125. /// Returns the number of active contexts.
  126. /// @return The total number of active Rocket contexts.
  127. ROCKETCORE_API int GetNumContexts();
  128. /// Registers a generic Rocket plugin.
  129. ROCKETCORE_API void RegisterPlugin(Plugin* plugin);
  130. /// Forces all compiled geometry handles generated by libRocket to be released.
  131. ROCKETCORE_API void ReleaseCompiledGeometries();
  132. /// Forces all texture handles loaded and generated by libRocket to be released.
  133. ROCKETCORE_API void ReleaseTextures();
  134. }
  135. }
  136. #endif