// This file has been generated by Py++.

#include "boost/python.hpp"

#include "indexing_suite/value_traits.hpp"

#include "indexing_suite/container_suite.hpp"

#include "indexing_suite/vector.hpp"

#include "python_CEGUI.h"

#include "AbsoluteDim.pypp.hpp"

#include "ActivationEventArgs.pypp.hpp"

#include "Affector.pypp.hpp"

#include "Animation.pypp.hpp"

#include "AnimationEventArgs.pypp.hpp"

#include "AnimationInstance.pypp.hpp"

#include "AnimationManager.pypp.hpp"

#include "BaseDim.pypp.hpp"

#include "BasicRenderedStringParser.pypp.hpp"

#include "BiDiVisualMapping.pypp.hpp"

#include "BoundSlot.pypp.hpp"

#include "ButtonBase.pypp.hpp"

#include "CentredRenderedString.pypp.hpp"

#include "Checkbox.pypp.hpp"

#include "ColourRect.pypp.hpp"

#include "ComboDropList.pypp.hpp"

#include "Combobox.pypp.hpp"

#include "ComponentArea.pypp.hpp"

#include "Connection.pypp.hpp"

#include "CoordConverter.pypp.hpp"

#include "DefaultLogger.pypp.hpp"

#include "DefaultResourceProvider.pypp.hpp"

#include "Dimension.pypp.hpp"

#include "DisplayEventArgs.pypp.hpp"

#include "DragContainer.pypp.hpp"

#include "DragDropEventArgs.pypp.hpp"

#include "Editbox.pypp.hpp"

#include "Event.pypp.hpp"

#include "EventArgs.pypp.hpp"

#include "EventIterator.pypp.hpp"

#include "EventSet.pypp.hpp"

#include "FalagardComponentBase.pypp.hpp"

#include "FalagardMappingIterator.pypp.hpp"

#include "FalagardXMLHelper.pypp.hpp"

#include "Font.pypp.hpp"

#include "FontDim.pypp.hpp"

#include "FontGlyph.pypp.hpp"

#include "FontIterator.pypp.hpp"

#include "FontManager.pypp.hpp"

#include "FrameComponent.pypp.hpp"

#include "FrameWindow.pypp.hpp"

#include "GUISheet.pypp.hpp"

#include "GeometryBuffer.pypp.hpp"

#include "GlobalEventSet.pypp.hpp"

#include "GridLayoutContainer.pypp.hpp"

#include "GroupBox.pypp.hpp"

#include "HeaderSequenceEventArgs.pypp.hpp"

#include "HorizontalLayoutContainer.pypp.hpp"

#include "Image.pypp.hpp"

#include "ImageCodec.pypp.hpp"

#include "ImageDim.pypp.hpp"

#include "ImageIterator.pypp.hpp"

#include "ImageryComponent.pypp.hpp"

#include "ImagerySection.pypp.hpp"

#include "Imageset.pypp.hpp"

#include "ImagesetIterator.pypp.hpp"

#include "ImagesetManager.pypp.hpp"

#include "Interpolator.pypp.hpp"

#include "ItemEntry.pypp.hpp"

#include "ItemListBase.pypp.hpp"

#include "ItemListbox.pypp.hpp"

#include "Key.pypp.hpp"

#include "KeyEventArgs.pypp.hpp"

#include "KeyFrame.pypp.hpp"

#include "LBItemList.pypp.hpp"

#include "LayerSpecification.pypp.hpp"

#include "LayoutContainer.pypp.hpp"

#include "LineList.pypp.hpp"

#include "ListHeader.pypp.hpp"

#include "ListHeaderSegment.pypp.hpp"

#include "Listbox.pypp.hpp"

#include "ListboxItem.pypp.hpp"

#include "ListboxTextItem.pypp.hpp"

#include "Logger.pypp.hpp"

#include "MCLGridRef.pypp.hpp"

#include "MenuBase.pypp.hpp"

#include "MenuItem.pypp.hpp"

#include "Menubar.pypp.hpp"

#include "MouseCursor.pypp.hpp"

#include "MouseCursorEventArgs.pypp.hpp"

#include "MouseEventArgs.pypp.hpp"

#include "MultiColumnList.pypp.hpp"

#include "MultiLineEditbox.pypp.hpp"

#include "NamedArea.pypp.hpp"

#include "NamedXMLResourceManagerFont.pypp.hpp"

#include "NamedXMLResourceManagerImageset.pypp.hpp"

#include "NamedXMLResourceManagerScheme.pypp.hpp"

#include "PopupMenu.pypp.hpp"

#include "ProgressBar.pypp.hpp"

#include "Property.pypp.hpp"

#include "PropertyDefinition.pypp.hpp"

#include "PropertyDefinitionBase.pypp.hpp"

#include "PropertyDefinitionList.pypp.hpp"

#include "PropertyDim.pypp.hpp"

#include "PropertyHelper.pypp.hpp"

#include "PropertyInitialiser.pypp.hpp"

#include "PropertyInitialiserVector.pypp.hpp"

#include "PropertyIterator.pypp.hpp"

#include "PropertyLinkDefinition.pypp.hpp"

#include "PropertyLinkDefinitionList.pypp.hpp"

#include "PropertyReceiver.pypp.hpp"

#include "PropertySet.pypp.hpp"

#include "PushButton.pypp.hpp"

#include "PyCEGUI_enumerations.pypp.hpp"

#include "RadioButton.pypp.hpp"

#include "RawDataContainer.pypp.hpp"

#include "Rect.pypp.hpp"

#include "RenderEffect.pypp.hpp"

#include "RenderEffectFactory.pypp.hpp"

#include "RenderEffectManager.pypp.hpp"

#include "RenderQueue.pypp.hpp"

#include "RenderQueueEventArgs.pypp.hpp"

#include "RenderTarget.pypp.hpp"

#include "RenderedString.pypp.hpp"

#include "RenderedStringComponent.pypp.hpp"

#include "RenderedStringImageComponent.pypp.hpp"

#include "RenderedStringParser.pypp.hpp"

#include "RenderedStringTextComponent.pypp.hpp"

#include "RenderedStringWidgetComponent.pypp.hpp"

#include "Renderer.pypp.hpp"

#include "RenderingContext.pypp.hpp"

#include "RenderingRoot.pypp.hpp"

#include "RenderingSurface.pypp.hpp"

#include "RenderingWindow.pypp.hpp"

#include "ResourceEventArgs.pypp.hpp"

#include "ResourceEventSet.pypp.hpp"

#include "ResourceProvider.pypp.hpp"

#include "Scheme.pypp.hpp"

#include "SchemeIterator.pypp.hpp"

#include "SchemeManager.pypp.hpp"

#include "ScriptModule.pypp.hpp"

#include "ScrollablePane.pypp.hpp"

#include "Scrollbar.pypp.hpp"

#include "ScrolledContainer.pypp.hpp"

#include "ScrolledItemListBase.pypp.hpp"

#include "SectionSpecification.pypp.hpp"

#include "SequentialLayoutContainer.pypp.hpp"

#include "SingletonAnimationManager.pypp.hpp"

#include "SingletonFontManager.pypp.hpp"

#include "SingletonGlobalEventSet.pypp.hpp"

#include "SingletonImagesetManager.pypp.hpp"

#include "SingletonLogger.pypp.hpp"

#include "SingletonMouseCursor.pypp.hpp"

#include "SingletonRenderEffectManager.pypp.hpp"

#include "SingletonSchemeManager.pypp.hpp"

#include "SingletonSystem.pypp.hpp"

#include "SingletonWidgetLookManager.pypp.hpp"

#include "SingletonWindowFactoryManager.pypp.hpp"

#include "SingletonWindowManager.pypp.hpp"

#include "SingletonWindowRendererManager.pypp.hpp"

#include "Size.pypp.hpp"

#include "Slider.pypp.hpp"

#include "Spinner.pypp.hpp"

#include "StateImagery.pypp.hpp"

#include "StdPairFloatFloat.pypp.hpp"

#include "StrIndexList.pypp.hpp"

#include "Subscriber.pypp.hpp"

#include "System.pypp.hpp"

#include "TabButton.pypp.hpp"

#include "TabControl.pypp.hpp"

#include "TargetTypeStack.pypp.hpp"

#include "TextComponent.pypp.hpp"

#include "TextUtils.pypp.hpp"

#include "Texture.pypp.hpp"

#include "TextureTarget.pypp.hpp"

#include "Thumb.pypp.hpp"

#include "Titlebar.pypp.hpp"

#include "Tooltip.pypp.hpp"

#include "Tree.pypp.hpp"

#include "TreeEventArgs.pypp.hpp"

#include "TreeItem.pypp.hpp"

#include "TypeAliasIterator.pypp.hpp"

#include "UBox.pypp.hpp"

#include "UDim.pypp.hpp"

#include "URect.pypp.hpp"

#include "UVector2.pypp.hpp"

#include "UnifiedDim.pypp.hpp"

#include "UpdateEventArgs.pypp.hpp"

#include "Vector2.pypp.hpp"

#include "Vector3.pypp.hpp"

#include "Vertex.pypp.hpp"

#include "VerticalLayoutContainer.pypp.hpp"

#include "WidgetComponent.pypp.hpp"

#include "WidgetDim.pypp.hpp"

#include "WidgetLookFeel.pypp.hpp"

#include "WidgetLookManager.pypp.hpp"

#include "Window.pypp.hpp"

#include "WindowEventArgs.pypp.hpp"

#include "WindowFactory.pypp.hpp"

#include "WindowFactoryIterator.pypp.hpp"

#include "WindowFactoryManager.pypp.hpp"

#include "WindowIterator.pypp.hpp"

#include "WindowManager.pypp.hpp"

#include "WindowRenderer.pypp.hpp"

#include "WindowRendererFactory.pypp.hpp"

#include "WindowRendererManager.pypp.hpp"

#include "XMLAttributes.pypp.hpp"

#include "XMLHandler.pypp.hpp"

#include "XMLParser.pypp.hpp"

#include "XMLSerializer.pypp.hpp"

#include "colour.pypp.hpp"

namespace bp = boost::python;

struct CEGUI_String_to_python
{
    static PyObject* convert(const CEGUI::String& s)
    {
		// use native byteorder
		int byteorder = 0;

		// "replace" replaces invalid utf32 chars with "?"
		
		// python wants the size of the buffer, not length of the string,
        // this is the reason for the sizeof
		return boost::python::incref(
			PyUnicode_DecodeUTF32((const char*)(s.ptr()), s.length() * sizeof(CEGUI::utf32), "replace", &byteorder)
		);
    }
};

struct CEGUI_String_from_python
{
    CEGUI_String_from_python()
    {
      boost::python::converter::registry::push_back(
        &convertible,
        &construct,
        boost::python::type_id<CEGUI::String>());
    }
    
    static void* convertible(PyObject* obj_ptr)
    {
        // we allow str() and unicode() objects to be converted to CEGUI::String
        if (PyString_Check(obj_ptr) || PyUnicode_Check(obj_ptr))
        {
            return obj_ptr;
        }
        return 0;
    }
    
    static void construct(
      PyObject* obj_ptr,
      boost::python::converter::rvalue_from_python_stage1_data* data)
    {
        if (PyUnicode_Check(obj_ptr))
        {
            // we have to employ a bit more machinery since this is utf16 coded string
			// we encode given unicode object (ucs2 - utf16) to utf8
			PyObject* utf8 = PyUnicode_AsUTF8String(obj_ptr);
			// then we get the raw bytes of the utf8 python object
            const CEGUI::utf8* value = (CEGUI::utf8*)PyString_AsString(utf8);
            if (value == 0)
                boost::python::throw_error_already_set();
            
            void* storage = ((boost::python::converter::rvalue_from_python_storage<CEGUI::String>*)data)->storage.bytes;
            new (storage) CEGUI::String(value);
            data->convertible = storage;
			// now we don't need utf8 anymore, CEGUI::String holds the data for us now, by decreasing
			// refcount to utf8, we are practically deallocating it
			boost::python::decref(utf8);
        }
        else
        {
            // no need for unicode, this is just plain str()
            const char* value = PyString_AsString(obj_ptr);
            if (value == 0)
                boost::python::throw_error_already_set();
            
            void* storage = ((boost::python::converter::rvalue_from_python_storage<CEGUI::String>*)data)->storage.bytes;
            new (storage) CEGUI::String(value);
            data->convertible = storage;
        }
    }
};

BOOST_PYTHON_MODULE(PyCEGUI){
    register_enumerations();

    boost::python::to_python_converter<
        CEGUI::String,
        CEGUI_String_to_python>();
    
    CEGUI_String_from_python();

    register_StrIndexList_class();

    register_LBItemList_class();

    register_TargetTypeStack_class();

    register_PropertyLinkDefinitionList_class();

    register_PropertyInitialiserVector_class();

    register_PropertyDefinitionList_class();

    register_LineList_class();

    register_BaseDim_class();

    register_AbsoluteDim_class();

    register_EventArgs_class();

    register_WindowEventArgs_class();

    register_ActivationEventArgs_class();

    register_KeyFrame_class();

    register_Affector_class();

    register_Animation_class();

    register_AnimationEventArgs_class();

    register_AnimationInstance_class();

    register_SingletonAnimationManager_class();

    register_AnimationManager_class();

    register_RenderedStringParser_class();

    register_BasicRenderedStringParser_class();

    register_BiDiVisualMapping_class();

    register_BoundSlot_class();

    register_EventSet_class();

    register_PropertyReceiver_class();

    register_PropertySet_class();

    register_Window_class();

    register_ButtonBase_class();

    register_CentredRenderedString_class();

    register_Checkbox_class();

    register_ColourRect_class();

    register_Listbox_class();

    register_ComboDropList_class();

    register_Combobox_class();

    register_ComponentArea_class();

    register_EventIterator_class();

    register_FontIterator_class();

    register_ImageIterator_class();

    register_ImagesetIterator_class();

    register_PropertyIterator_class();

    register_SchemeIterator_class();

    register_WindowIterator_class();

    register_WindowFactoryIterator_class();

    register_TypeAliasIterator_class();

    register_FalagardMappingIterator_class();

    register_CoordConverter_class();

    register_SingletonLogger_class();

    register_Logger_class();

    register_DefaultLogger_class();

    register_ResourceProvider_class();

    register_DefaultResourceProvider_class();

    register_Dimension_class();

    register_DisplayEventArgs_class();

    register_DragContainer_class();

    register_DragDropEventArgs_class();

    register_Editbox_class();

    register_Connection_class();

    register_Event_class();

    register_Rect_class();

    register_FalagardComponentBase_class();

    register_FalagardXMLHelper_class();

    register_Font_class();

    register_FontDim_class();

    register_colour_class();

    bp::implicitly_convertible< CEGUI::colour, CEGUI::argb_t >();

    register_Image_class();

    register_FontGlyph_class();

    register_ResourceEventSet_class();

    register_NamedXMLResourceManagerFont_class();

    register_SingletonFontManager_class();

    register_FontManager_class();

    register_FrameComponent_class();

    register_FrameWindow_class();

    register_GUISheet_class();

    register_GeometryBuffer_class();

    register_SingletonGlobalEventSet_class();

    register_GlobalEventSet_class();

    register_LayoutContainer_class();

    register_GridLayoutContainer_class();

    register_GroupBox_class();

    register_HeaderSequenceEventArgs_class();

    register_SequentialLayoutContainer_class();

    register_HorizontalLayoutContainer_class();

    register_ImageCodec_class();

    register_ImageDim_class();

    register_ImageryComponent_class();

    register_ImagerySection_class();

    register_Imageset_class();

    register_NamedXMLResourceManagerImageset_class();

    register_SingletonImagesetManager_class();

    register_ImagesetManager_class();

    register_Interpolator_class();

    register_ItemEntry_class();

    register_ItemListBase_class();

    register_ScrolledItemListBase_class();

    register_ItemListbox_class();

    register_Key_class();

    register_KeyEventArgs_class();

    register_LayerSpecification_class();

    register_ListHeaderSegment_class();

    register_ListHeader_class();

    register_ListboxItem_class();

    register_ListboxTextItem_class();

    register_MCLGridRef_class();

    register_MenuBase_class();

    register_MenuItem_class();

    register_Menubar_class();

    register_SingletonMouseCursor_class();

    register_MouseCursor_class();

    register_MouseCursorEventArgs_class();

    register_MouseEventArgs_class();

    register_MultiColumnList_class();

    register_MultiLineEditbox_class();

    register_NamedArea_class();

    register_NamedXMLResourceManagerScheme_class();

    register_PopupMenu_class();

    register_ProgressBar_class();

    register_Property_class();

    register_PropertyDefinitionBase_class();

    register_PropertyDefinition_class();

    register_PropertyDim_class();

    register_PropertyHelper_class();

    register_PropertyInitialiser_class();

    register_PropertyLinkDefinition_class();

    register_PushButton_class();

    register_RadioButton_class();

    register_RawDataContainer_class();

    register_RenderEffect_class();

    register_RenderEffectFactory_class();

    register_SingletonRenderEffectManager_class();

    register_RenderEffectManager_class();

    register_RenderQueue_class();

    register_RenderQueueEventArgs_class();

    register_RenderTarget_class();

    register_RenderedString_class();

    register_RenderedStringComponent_class();

    register_RenderedStringImageComponent_class();

    register_RenderedStringTextComponent_class();

    register_RenderedStringWidgetComponent_class();

    register_Renderer_class();

    register_RenderingContext_class();

    register_RenderingSurface_class();

    register_RenderingRoot_class();

    register_RenderingWindow_class();

    register_ResourceEventArgs_class();

    register_Scheme_class();

    register_SingletonSchemeManager_class();

    register_SchemeManager_class();

    register_ScriptModule_class();

    register_ScrollablePane_class();

    register_Scrollbar_class();

    register_ScrolledContainer_class();

    register_SectionSpecification_class();

    register_SingletonSystem_class();

    register_SingletonWidgetLookManager_class();

    register_SingletonWindowFactoryManager_class();

    register_SingletonWindowManager_class();

    register_SingletonWindowRendererManager_class();

    register_Size_class();

    register_Slider_class();

    register_Spinner_class();

    register_StateImagery_class();

    register_Subscriber_class();

    register_XMLParser_class();

    register_System_class();

    register_TabButton_class();

    register_TabControl_class();

    register_TextComponent_class();

    register_TextUtils_class();

    register_Texture_class();

    register_TextureTarget_class();

    register_Thumb_class();

    register_Titlebar_class();

    register_Tooltip_class();

    register_Tree_class();

    register_TreeEventArgs_class();

    register_TreeItem_class();

    register_UBox_class();

    register_UDim_class();

    register_URect_class();

    register_UVector2_class();

    register_UnifiedDim_class();

    register_UpdateEventArgs_class();

    register_Vector2_class();

    register_Vector3_class();

    register_Vertex_class();

    register_VerticalLayoutContainer_class();

    register_WidgetComponent_class();

    register_WidgetDim_class();

    register_WidgetLookFeel_class();

    register_WidgetLookManager_class();

    register_WindowFactory_class();

    register_WindowFactoryManager_class();

    register_WindowManager_class();

    register_WindowRenderer_class();

    register_WindowRendererFactory_class();

    register_WindowRendererManager_class();

    register_XMLAttributes_class();

    register_XMLHandler_class();

    register_XMLSerializer_class();

    bp::implicitly_convertible< CEGUI::XMLSerializer, bool >();

    boost::python::scope().attr("CompileDate__") = __DATE__;

    boost::python::scope().attr("CompileTime__") = __TIME__;

    boost::python::scope().attr("__doc__") = "PyCEGUI - version 0.7.5";

    boost::python::scope().attr("Version__") = "0.7.5";

    register_StdPairFloatFloat_class();
}

