X-Git-Url: https://git.creatis.insa-lyon.fr/pubgit/?a=blobdiff_plain;f=appli%2Fexamples%2Fplugins%2FQT%2Fexample_ActorProperties%2Fmain.cxx;fp=appli%2Fexamples%2Fplugins%2FQT%2Fexample_ActorProperties%2Fmain.cxx;h=0000000000000000000000000000000000000000;hb=aa77db36cc1d87ba014c982a235239c3c87224f3;hp=5850dd6eeb9734bf65feedc84f73c39c34f602d8;hpb=733108d258a27799df875ceda2d84c3cafea64d3;p=cpPlugins.git diff --git a/appli/examples/plugins/QT/example_ActorProperties/main.cxx b/appli/examples/plugins/QT/example_ActorProperties/main.cxx deleted file mode 100644 index 5850dd6..0000000 --- a/appli/examples/plugins/QT/example_ActorProperties/main.cxx +++ /dev/null @@ -1,80 +0,0 @@ -#include "example_ActorProperties.h" -#include -#include - -// ------------------------------------------------------------------------- -int main( int argc, char* argv[] ) -{ - QApplication a( argc, argv ); - example_ActorProperties w( argc, argv ); - w.show( ); - return( a.exec( ) ); -} - -// ------------------------------------------------------------------------- -#ifdef _WIN32 - -#include -#include -#include -#include - -/** - */ -class Win32CommandLineConverter -{ -private: - std::unique_ptr< char*[ ] > argv_; - std::vector< std::unique_ptr< char[ ] > > storage_; - -public: - Win32CommandLineConverter( ) - { - LPWSTR cmd_line = GetCommandLineW( ); - int argc; - LPWSTR* w_argv = CommandLineToArgvW( cmd_line, &argc ); - argv_ = std::unique_ptr< char*[ ] >( new char*[ argc ] ); - storage_.reserve( argc ); - for( int i = 0; i < argc; ++i ) - { - storage_.push_back( ConvertWArg( w_argv[ i ] ) ); - argv_[ i ] = storage_.back( ).get( ); - - } // rof - LocalFree( w_argv ); - } - int argc( ) const - { - return( static_cast< int >(storage_.size( ) ) ); - } - char** argv( ) const - { - return( argv_.get( ) ); - } - static std::unique_ptr< char[ ] > ConvertWArg( LPWSTR w_arg ) - { - int size = WideCharToMultiByte( - CP_UTF8, 0, w_arg, -1, nullptr, 0, nullptr, nullptr - ); - std::unique_ptr< char[ ] > ret( new char[ size ] ); - WideCharToMultiByte( - CP_UTF8, 0, w_arg, -1, ret.get( ), size, nullptr, nullptr - ); - return( ret ); - } -}; - -int CALLBACK WinMain( - HINSTANCE hInstance, - HINSTANCE hPrevInstance, - LPSTR lpCmdLine, - int nCmdShow - ) -{ - Win32CommandLineConverter cmd_line; - return( main( cmd_line.argc( ), cmd_line.argv( ) ) ); -} - -#endif - -// eof - $RCSfile$