Made the classes that is non-copyable in the C++ library also non-copyable in rbSFML.

git-svn-id: https://sfml.svn.sourceforge.net/svnroot/sfml/branches/sfml2@1738 4e206d99-4929-0410-ac5d-dfc041789085
This commit is contained in:
groogy 2010-12-03 14:12:16 +00:00
parent cd04d29584
commit 30865b6ef9
10 changed files with 27 additions and 1 deletions

View file

@ -26,6 +26,9 @@
VALUE globalContextClass;
/* External classes */
extern VALUE globalNonCopyableModule;
/* Free a heap allocated object
* Not accessible trough ruby directly!
*/
@ -109,6 +112,7 @@ void Init_Context( void )
* the attached resources.
*/
globalContextClass = rb_define_class_under( sfml, "Context", rb_cObject );
rb_include_module( globalContextClass, globalNonCopyableModule );
// Class methods
rb_define_singleton_method( globalContextClass, "new", Context_New, 0 );

View file

@ -26,6 +26,9 @@
VALUE globalInputClass;
/* External classes */
extern VALUE globalNonCopyableModule;
/* Free a heap allocated object
* Not accessible trough ruby directly!
*/
@ -178,6 +181,7 @@ void Init_Input( void )
* entity.move( 0, offset ) if input.keyDown?( SFML::Key::Down )
*/
globalInputClass = rb_define_class_under( sfml, "Input", rb_cObject );
rb_include_module( globalInputClass, globalNonCopyableModule );
// Class methods
rb_define_singleton_method( globalInputClass, "new", Input_New, -1 );

View file

@ -34,6 +34,7 @@ extern VALUE globalContextSettingsClass;
extern VALUE globalEventClass;
extern VALUE globalInputClass;
extern VALUE globalVector2Class;
extern VALUE globalNonCopyableModule;
/* Free a heap allocated object
* Not accessible trough ruby directly!
@ -676,6 +677,7 @@ void Init_Window( void )
* end
*/
globalWindowClass = rb_define_class_under( sfml, "Window", rb_cObject );
rb_include_module( globalWindowClass, globalNonCopyableModule );
// Class methods
rb_define_singleton_method( globalWindowClass, "new", Window_New , -1 );

View file

@ -41,6 +41,7 @@ VALUE globalStyleNamespace;
/* External classes */
VALUE globalVector2Class;
VALUE globalNonCopyableModule;
static const char * keyNamesMisc[] =
{
@ -162,6 +163,7 @@ void Init_window( void )
}
globalVector2Class = RetrieveSFMLClass( "Vector2" );
globalNonCopyableModule = RetrieveSFMLClass( "NonCopyable" );
rb_define_const( globalSFMLNamespace, "WindowLoaded", Qtrue );