OSDN Git Service

import 0.9.4
[handbrake-jp/handbrake-jp.git] / macosx / main.mm
1 /* $Id: main.mm,v 1.3 2005/11/25 15:04:35 titer Exp $
2
3    This file is part of the HandBrake source code.
4    Homepage: <http://handbrake.fr/>.
5    It may be used under the terms of the GNU General Public License. */
6
7 #include <Cocoa/Cocoa.h>
8 #import "hb.h"
9
10 void SigHandler( int signal )
11 {
12     [NSApp terminate: NULL];
13
14
15 /****************************************************************************
16  * hb_error_handler
17  * 
18  * Change this to display a dialog box - and maybe move it somewhere else,
19  * this is the only place I could find that looked like C :)
20 ****************************************************************************/
21 extern "C" {
22 void hb_error_handler( const char *errmsg )
23 {
24     fprintf(stderr, "GUI ERROR dialog: %s\n", errmsg );
25 }
26 }
27
28 int main( int argc, const char ** argv )
29 {
30     signal( SIGINT, SigHandler );
31     hb_register_error_handler(&hb_error_handler);
32     return NSApplicationMain( argc, argv );
33 }