diff options
author | handbrake <[email protected]> | 2006-01-14 13:05:49 +0000 |
---|---|---|
committer | handbrake <[email protected]> | 2006-01-14 13:05:49 +0000 |
commit | 5824c4979fbc54ae3d3015c07cbf6fa4aea7516d (patch) | |
tree | 49ba3bbe1f8d8166fa4f7f964055d4011d2deca0 /beos/HBApp.cpp | |
parent | f013e3544c0bdf17348d617a467af0e4fde0f545 (diff) |
HandBrake 0.5
git-svn-id: svn://svn.handbrake.fr/HandBrake/trunk@7 b64f7644-9d1e-0410-96f1-a4d463321fa5
Diffstat (limited to 'beos/HBApp.cpp')
-rw-r--r-- | beos/HBApp.cpp | 57 |
1 files changed, 57 insertions, 0 deletions
diff --git a/beos/HBApp.cpp b/beos/HBApp.cpp new file mode 100644 index 000000000..52afce815 --- /dev/null +++ b/beos/HBApp.cpp @@ -0,0 +1,57 @@ +/* $Id: HBApp.cpp,v 1.1.1.1 2003/11/03 12:03:51 titer Exp $ + + This file is part of the HandBrake source code. + Homepage: <http://handbrake.m0k.org/>. + It may be used under the terms of the GNU General Public License. */ + +#include <signal.h> + +#include "HBApp.h" +#include "MainWindow.h" + +void SigHandler( int signal ) +{ + /* Ugly way to exit cleanly when hitting Ctrl-C */ + ((HBApp*) be_app)->fWindow->PostMessage( B_QUIT_REQUESTED ); +} + +int main() +{ + signal( SIGINT, SigHandler ); + signal( SIGHUP, SigHandler ); + signal( SIGQUIT, SigHandler ); + + /* Run the BApplication */ + HBApp * app = new HBApp(); + app->Run(); + delete app; + return 0; +} + +/* Constructor */ +HBApp::HBApp() + : BApplication("application/x-vnd.titer-handbrake" ) +{ + fWindow = new MainWindow(); + fWindow->Show(); +} + +void HBApp::MessageReceived( BMessage * message ) +{ + switch( message->what ) + { + case B_SAVE_REQUESTED: + fWindow->PostMessage( message ); + break; + + default: + BApplication::MessageReceived( message ); + break; + } +} + +void HBApp::RefsReceived( BMessage * message ) +{ + fWindow->PostMessage( message ); +} + |