diff options
| author | Carl Hetherington <cth@carlh.net> | 2012-07-25 03:22:16 +0100 |
|---|---|---|
| committer | Carl Hetherington <cth@carlh.net> | 2012-07-25 03:22:16 +0100 |
| commit | 3d4faebe28da789a9083e6a2cc0b345df6c17306 (patch) | |
| tree | 0cb0cd06c838a541ae0261a3efa6caa9e4f2b919 /src/tools | |
| parent | 26b9ae1e7700b545df4b5445a7efba412c2cbb68 (diff) | |
Some vague sort of progress.
Diffstat (limited to 'src/tools')
| -rw-r--r-- | src/tools/dvdomatic.cc | 167 | ||||
| -rw-r--r-- | src/tools/wscript | 7 |
2 files changed, 102 insertions, 72 deletions
diff --git a/src/tools/dvdomatic.cc b/src/tools/dvdomatic.cc index 9cca61eff..8fe447da5 100644 --- a/src/tools/dvdomatic.cc +++ b/src/tools/dvdomatic.cc @@ -19,17 +19,17 @@ #include <iostream> #include <boost/filesystem.hpp> -#include "gtk/film_viewer.h" -#include "gtk/film_editor.h" +#include "wx/film_viewer.h" +#include "wx/film_editor.h" #ifndef DVDOMATIC_DISABLE_PLAYER -#include "gtk/film_player.h" +#include "wx/film_player.h" #endif -#include "gtk/job_manager_view.h" -#include "gtk/config_dialog.h" -#include "gtk/gpl.h" -#include "gtk/job_wrapper.h" -#include "gtk/dvd_title_dialog.h" -#include "gtk/gtk_util.h" +//#include "gtk/job_manager_view.h" +//#include "gtk/config_dialog.h" +//#include "gtk/gpl.h" +//#include "gtk/job_wrapper.h" +//#include "gtk/dvd_title_dialog.h" +//#include "gtk/gtk_util.h" #include "lib/film.h" #include "lib/format.h" #include "lib/config.h" @@ -41,9 +41,12 @@ using namespace std; using namespace boost; -static Gtk::Window* window = 0; -static FilmViewer* film_viewer = 0; static FilmEditor* film_editor = 0; +static FilmViewer* film_viewer = 0; + +#if 0 + +static Gtk::Window* window = 0; #ifndef DVDOMATIC_DISABLE_PLAYER static FilmPlayer* film_player = 0; #endif @@ -312,76 +315,102 @@ file_changed (string f) window->set_title (s.str ()); } -int -main (int argc, char* argv[]) -{ - dvdomatic_setup (); - - Gtk::Main kit (argc, argv); +#endif - if (argc == 2 && boost::filesystem::is_directory (argv[1])) { - film = new Film (argv[1]); - } - window = new Gtk::Window (); - window->signal_delete_event().connect (sigc::ptr_fun (window_closed)); - - film_viewer = new FilmViewer (film); - film_editor = new FilmEditor (film); -#ifndef DVDOMATIC_DISABLE_PLAYER - film_player = new FilmPlayer (film); -#endif - JobManagerView jobs_view; +enum { + ID_Quit = 1, +}; - window->set_title ("DVD-o-matic"); +class Frame : public wxFrame +{ +public: + Frame (wxString const & title) + : wxFrame (NULL, -1, title) + { + wxMenuBar* bar = new wxMenuBar; + bar->Show (true); + + wxMenu *menu_file = new wxMenu; + menu_file->Append (ID_Quit, _("&Quit")); - Gtk::VBox vbox; + bar->Append (menu_file, _("&File")); - Gtk::MenuBar menu_bar; - vbox.pack_start (menu_bar, false, false); - setup_menu (menu_bar); - set_menu_sensitivity (); + SetMenuBar (bar); - Gtk::HBox hbox; - hbox.set_spacing (12); + CreateStatusBar (); + SetStatusText (_("Welcome to DVD-o-matic!")); + } + + void quit (wxCommandEvent& event) + { + Close (true); + } +}; - Gtk::VBox left_vbox; - left_vbox.set_spacing (12); - left_vbox.pack_start (film_editor->widget (), false, false); -#ifndef DVDOMATIC_DISABLE_PLAYER - left_vbox.pack_start (film_player->widget (), false, false); -#endif - hbox.pack_start (left_vbox, false, false); +class App : public wxApp +{ + bool OnInit () + { + if (!wxApp::OnInit ()) { + return false; + } - Gtk::VBox right_vbox; - right_vbox.pack_start (film_viewer->widget (), true, true); - right_vbox.pack_start (jobs_view.widget(), false, false); - hbox.pack_start (right_vbox, true, true); + wxInitAllImageHandlers (); + + dvdomatic_setup (); + +// if (argc == 2 && boost::filesystem::is_directory (argv[1])) { +// film = new Film (argv[1]); +// } + + Film* film = new Film ("/home/carl/DCP/BitHarvest"); + + Frame* frame = new Frame (_("DVD-o-matic")); + frame->Show (true); + + frame->Connect ( + ID_Quit, wxEVT_COMMAND_MENU_SELECTED, + (wxObjectEventFunction) &Frame::quit + ); + + film_editor = new FilmEditor (film, frame); + film_editor->Show (true); + film_viewer = new FilmViewer (film, frame); + film_viewer->Show (true); +#ifndef DVDOMATIC_DISABLE_PLAYER + film_player = new FilmPlayer (film, frame); +#endif - vbox.pack_start (hbox, true, true); + wxBoxSizer* main_sizer = new wxBoxSizer (wxHORIZONTAL); + main_sizer->Add (film_editor, 0); + main_sizer->Add (film_viewer, 1, wxEXPAND); + frame->SetSizer (main_sizer); - window->add (vbox); - window->show_all (); + SetTopWindow (frame); + frame->Maximize (); - /* XXX: calling these here is a bit of a hack */ - film_editor->setup_visibility (); +#if 0 + /* XXX: calling these here is a bit of a hack */ + film_editor->setup_visibility (); #ifndef DVDOMATIC_DISABLE_PLAYER - film_player->setup_visibility (); + film_player->setup_visibility (); #endif - film_viewer->setup_visibility (); - - film_editor->FileChanged.connect (ptr_fun (file_changed)); - if (film) { - file_changed (film->directory ()); - } else { - file_changed (""); + film_viewer->setup_visibility (); + + film_editor->FileChanged.connect (ptr_fun (file_changed)); + if (film) { + file_changed (film->directory ()); + } else { + file_changed (""); + } +#endif + + /* XXX this should be in JobManagerView, shouldn't it? */ +//XXX Glib::signal_timeout().connect (sigc::bind_return (sigc::mem_fun (jobs_view, &JobManagerView::update), true), 1000); + + return true; } +}; - /* XXX this should be in JobManagerView, shouldn't it? */ - Glib::signal_timeout().connect (sigc::bind_return (sigc::mem_fun (jobs_view, &JobManagerView::update), true), 1000); - - window->maximize (); - Gtk::Main::run (*window); - - return 0; -} +IMPLEMENT_APP (App) diff --git a/src/tools/wscript b/src/tools/wscript index b3e523ba5..4c4979190 100644 --- a/src/tools/wscript +++ b/src/tools/wscript @@ -8,14 +8,15 @@ def build(bld): obj.target = t if not bld.env.DISABLE_GUI: - p = ['dvdomatic', 'alignomatic'] +# p = ['dvdomatic', 'alignomatic'] + p = ['dvdomatic'] if not bld.env.DISABLE_PLAYER: p.append('playomatic') for t in p: obj = bld(features = 'cxx cxxprogram') - obj.uselib = 'BOOST_THREAD GTKMM' + obj.uselib = 'BOOST_THREAD WXWIDGETS' obj.includes = ['..'] - obj.use = ['libdvdomatic', 'libdvdomatic-gtk'] + obj.use = ['libdvdomatic', 'libdvdomatic-wx'] obj.source = '%s.cc' % t if bld.env.TARGET_WINDOWS: obj.source += ' ../../windows/icon.rc' |
