/[svn]/gigedit/trunk/src/gigedit/gigedit.cpp
ViewVC logotype

Annotation of /gigedit/trunk/src/gigedit/gigedit.cpp

Parent Directory Parent Directory | Revision Log Revision Log


Revision 1225 - (hide annotations) (download)
Sun Jun 10 10:56:11 2007 UTC (16 years, 10 months ago) by schoenebeck
File size: 1804 byte(s)
moved gigedit sources from src/ -> src/gigedit/

1 schoenebeck 1225 /*
2     * Copyright (C) 2007 Andreas Persson
3     *
4     * This program is free software; you can redistribute it and/or
5     * modify it under the terms of the GNU General Public License as
6     * published by the Free Software Foundation; either version 2, or (at
7     * your option) any later version.
8     *
9     * This program is distributed in the hope that it will be useful, but
10     * WITHOUT ANY WARRANTY; without even the implied warranty of
11     * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
12     * General Public License for more details.
13     *
14     * You should have received a copy of the GNU General Public License
15     * along with program; see the file COPYING. If not, write to the Free
16     * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
17     * 02110-1301 USA.
18     */
19    
20     #include "gigedit.h"
21    
22     #include <gtkmm/main.h>
23     #include "mainwindow.h"
24    
25     #include <libintl.h>
26     #include <config.h>
27    
28     // the app has to work from a DLL as well, so we hard code argv
29     int argc = 1;
30     const char* argv_c[] = { "gigedit" };
31     char** argv = const_cast<char**>(argv_c);
32    
33     static void __init_app() {
34     setlocale(LC_ALL, "");
35     bindtextdomain(GETTEXT_PACKAGE, LOCALEDIR);
36     bind_textdomain_codeset(GETTEXT_PACKAGE, "UTF-8");
37     textdomain(GETTEXT_PACKAGE);
38    
39     Glib::thread_init();
40     }
41    
42     int GigEdit::run() {
43     __init_app();
44     Gtk::Main kit(argc, argv);
45     MainWindow window;
46     kit.run(window);
47     return 0;
48     }
49    
50     int GigEdit::run(const char* pFileName) {
51     __init_app();
52     Gtk::Main kit(argc, argv);
53     MainWindow window;
54     if (pFileName) window.load_file(pFileName);
55     kit.run(window);
56     return 0;
57     }
58    
59     int GigEdit::run(gig::Instrument* pInstrument) {
60     __init_app();
61     Gtk::Main kit(argc, argv);
62     MainWindow window;
63     if (pInstrument) window.load_instrument(pInstrument);
64     kit.run(window);
65     return 0;
66     }

  ViewVC Help
Powered by ViewVC