#include "VideoEnde.h" #include #include #include #include #include // Inhalt der VideoEnde Klasse aus VideoEnde.h // Konstruktor VideoEnde::VideoEnde( Schrift *zSchrift ) { text = new TextFeld(); text->setStyle( TextFeld::Style::Text | TextFeld::Style::Center | TextFeld::Style::Rahmen | TextFeld::Style::Hintergrund | TextFeld::Style::HAlpha ); text->removeStyle( TextFeld::Style::Sichtbar ); text->setSchriftZ( zSchrift->getThis() ); text->setText( "" ); text->setSchriftFarbe( 0xFFFFFFFF ); text->setSize( 220, 70 ); text->setLinienRahmenBreite( 2 ); text->setLinienRahmenFarbe( 0xFFFFFFFF ); text->setHintergrundFarbe( 0xA0000000 ); ref = 1; } // Destruktor VideoEnde::~VideoEnde() { text->release(); } // nicht constant void VideoEnde::setSichtbar( bool b ) { text->setStyle( TextFeld::Style::Sichtbar, b ); } void VideoEnde::setText( const char *txt ) { text->zSchrift()->lock(); text->zSchrift()->setSchriftSize( 12 ); Text t = txt; text->setSize( 10 + text->zSchrift()->getTextBreite( &t ), 10 + text->zSchrift()->getTextHeight( &t ) ); text->zSchrift()->unlock(); text->setText( txt ); } void VideoEnde::render( Bild &zRObj ) { text->setPosition( zRObj.getBreite() / 2 - text->getBreite() / 2, zRObj.getHeight() / 2 - text->getHeight() / 2 ); text->render( zRObj ); } // constant bool VideoEnde::istSichtbar() const { return text->hatStyle( TextFeld::Style::Sichtbar ); } // Reference Counting VideoEnde *VideoEnde::getThis() { ref++; return this; } VideoEnde *VideoEnde::release() { ref--; if( !ref ) delete this; return 0; }