Tidy up and fix bitmap path finding in the playlist editor.
[dcpomatic.git] / src / tools / dcpomatic_playlist.cc
1 /*
2     Copyright (C) 2018-2020 Carl Hetherington <cth@carlh.net>
3
4     This file is part of DCP-o-matic.
5
6     DCP-o-matic is free software; you can redistribute it and/or modify
7     it under the terms of the GNU General Public License as published by
8     the Free Software Foundation; either version 2 of the License, or
9     (at your option) any later version.
10
11     DCP-o-matic is distributed in the hope that it will be useful,
12     but WITHOUT ANY WARRANTY; without even the implied warranty of
13     MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
14     GNU General Public License for more details.
15
16     You should have received a copy of the GNU General Public License
17     along with DCP-o-matic.  If not, see <http://www.gnu.org/licenses/>.
18
19 */
20
21 #include "../wx/wx_util.h"
22 #include "../wx/wx_signal_manager.h"
23 #include "../wx/content_view.h"
24 #include "../wx/dcpomatic_button.h"
25 #include "../wx/about_dialog.h"
26 #include "../wx/playlist_editor_config_dialog.h"
27 #include "../lib/util.h"
28 #include "../lib/config.h"
29 #include "../lib/cross.h"
30 #include "../lib/film.h"
31 #include "../lib/dcp_content.h"
32 #include "../lib/spl_entry.h"
33 #include "../lib/spl.h"
34 #include <wx/wx.h>
35 #include <wx/listctrl.h>
36 #include <wx/imaglist.h>
37 #include <wx/spinctrl.h>
38 #include <wx/preferences.h>
39 #include <boost/foreach.hpp>
40
41 using std::exception;
42 using std::cout;
43 using std::string;
44 using std::map;
45 using std::make_pair;
46 using std::vector;
47 using boost::optional;
48 using boost::shared_ptr;
49 using boost::weak_ptr;
50 using boost::bind;
51 using boost::dynamic_pointer_cast;
52 #if BOOST_VERSION >= 106100
53 using namespace boost::placeholders;
54 #endif
55
56 class ContentDialog : public wxDialog, public ContentStore
57 {
58 public:
59         ContentDialog (wxWindow* parent)
60                 : wxDialog (parent, wxID_ANY, _("Add content"), wxDefaultPosition, wxSize(800, 640))
61                 , _content_view (new ContentView(this))
62         {
63                 _content_view->update ();
64
65                 wxBoxSizer* overall_sizer = new wxBoxSizer (wxVERTICAL);
66                 SetSizer (overall_sizer);
67
68                 overall_sizer->Add (_content_view, 1, wxEXPAND | wxALL, DCPOMATIC_DIALOG_BORDER);
69
70                 wxSizer* buttons = CreateSeparatedButtonSizer (wxOK | wxCANCEL);
71                 if (buttons) {
72                         overall_sizer->Add (buttons, wxSizerFlags().Expand().DoubleBorder());
73                 }
74
75                 overall_sizer->Layout ();
76         }
77
78         shared_ptr<Content> selected () const
79         {
80                 return _content_view->selected ();
81         }
82
83         shared_ptr<Content> get (string digest) const
84         {
85                 return _content_view->get (digest);
86         }
87
88 private:
89         ContentView* _content_view;
90 };
91
92
93
94 class PlaylistList
95 {
96 public:
97         PlaylistList (wxPanel* parent, ContentStore* content_store)
98                 : _sizer (new wxBoxSizer(wxVERTICAL))
99                 , _content_store (content_store)
100         {
101                 wxStaticText* label = new wxStaticText (parent, wxID_ANY, wxEmptyString);
102                 label->SetLabelMarkup (_("<b>Playlists</b>"));
103                 _sizer->Add (label, 0, wxTOP | wxLEFT, DCPOMATIC_SIZER_GAP * 2);
104
105                 _list = new wxListCtrl (
106                         parent, wxID_ANY, wxDefaultPosition, wxDefaultSize, wxLC_REPORT | wxLC_SINGLE_SEL
107                         );
108
109                 _list->AppendColumn (_("Name"), wxLIST_FORMAT_LEFT, 840);
110                 _list->AppendColumn (_("Length"), wxLIST_FORMAT_LEFT, 100);
111
112                 wxBoxSizer* button_sizer = new wxBoxSizer (wxVERTICAL);
113                 _new = new Button (parent, _("New"));
114                 button_sizer->Add (_new, 0, wxEXPAND | wxBOTTOM, DCPOMATIC_BUTTON_STACK_GAP);
115                 _delete = new Button (parent, _("Delete"));
116                 button_sizer->Add (_delete, 0, wxEXPAND | wxBOTTOM, DCPOMATIC_BUTTON_STACK_GAP);
117
118                 wxSizer* list = new wxBoxSizer (wxHORIZONTAL);
119                 list->Add (_list, 1, wxEXPAND | wxALL, DCPOMATIC_SIZER_GAP);
120                 list->Add (button_sizer, 0, wxALL, DCPOMATIC_SIZER_GAP);
121
122                 _sizer->Add (list);
123
124                 load_playlists ();
125
126                 _list->Bind (wxEVT_COMMAND_LIST_ITEM_SELECTED, bind(&PlaylistList::selection_changed, this));
127                 _list->Bind (wxEVT_COMMAND_LIST_ITEM_DESELECTED, bind(&PlaylistList::selection_changed, this));
128                 _new->Bind (wxEVT_BUTTON, bind(&PlaylistList::new_playlist, this));
129                 _delete->Bind (wxEVT_BUTTON, bind(&PlaylistList::delete_playlist, this));
130         }
131
132         wxSizer* sizer ()
133         {
134                 return _sizer;
135         }
136
137         shared_ptr<SignalSPL> first_playlist () const
138         {
139                 if (_playlists.empty()) {
140                         return shared_ptr<SignalSPL>();
141                 }
142
143                 return _playlists.front ();
144         }
145
146         boost::signals2::signal<void (shared_ptr<SignalSPL>)> Edit;
147
148 private:
149         void add_playlist_to_view (shared_ptr<const SignalSPL> playlist)
150         {
151                 wxListItem item;
152                 item.SetId (_list->GetItemCount());
153                 long const N = _list->InsertItem (item);
154                 _list->SetItem (N, 0, std_to_wx(playlist->name()));
155         }
156
157         void add_playlist_to_model (shared_ptr<SignalSPL> playlist)
158         {
159                 _playlists.push_back (playlist);
160                 playlist->NameChanged.connect (bind(&PlaylistList::name_changed, this, weak_ptr<SignalSPL>(playlist)));
161         }
162
163         void name_changed (weak_ptr<SignalSPL> wp)
164         {
165                 shared_ptr<SignalSPL> playlist = wp.lock ();
166                 if (!playlist) {
167                         return;
168                 }
169
170                 int N = 0;
171                 BOOST_FOREACH (shared_ptr<SignalSPL> i, _playlists) {
172                         if (i == playlist) {
173                                 _list->SetItem (N, 0, std_to_wx(i->name()));
174                         }
175                         ++N;
176                 }
177         }
178
179         void load_playlists ()
180         {
181                 optional<boost::filesystem::path> path = Config::instance()->player_playlist_directory();
182                 if (!path) {
183                         return;
184                 }
185
186                 _list->DeleteAllItems ();
187                 _playlists.clear ();
188                 for (boost::filesystem::directory_iterator i(*path); i != boost::filesystem::directory_iterator(); ++i) {
189                         shared_ptr<SignalSPL> spl(new SignalSPL);
190                         try {
191                                 spl->read (*i, _content_store);
192                                 add_playlist_to_model (spl);
193                         } catch (...) {}
194                 }
195
196                 BOOST_FOREACH (shared_ptr<SignalSPL> i, _playlists) {
197                         add_playlist_to_view (i);
198                 }
199         }
200
201         void new_playlist ()
202         {
203                 shared_ptr<SignalSPL> spl (new SignalSPL(wx_to_std(_("New Playlist"))));
204                 add_playlist_to_model (spl);
205                 add_playlist_to_view (spl);
206                 _list->SetItemState (_list->GetItemCount() - 1, wxLIST_STATE_SELECTED, wxLIST_STATE_SELECTED);
207         }
208
209         void delete_playlist ()
210         {
211                 long int selected = _list->GetNextItem (-1, wxLIST_NEXT_ALL, wxLIST_STATE_SELECTED);
212                 if (selected < 0 || selected >= int(_playlists.size())) {
213                         return;
214                 }
215
216                 optional<boost::filesystem::path> dir = Config::instance()->player_playlist_directory();
217                 if (!dir) {
218                         return;
219                 }
220
221                 boost::filesystem::remove (*dir / (_playlists[selected]->id() + ".xml"));
222                 _list->DeleteItem (selected);
223                 _playlists.erase (_playlists.begin() + selected);
224
225                 Edit (shared_ptr<SignalSPL>());
226         }
227
228         void selection_changed ()
229         {
230                 long int selected = _list->GetNextItem (-1, wxLIST_NEXT_ALL, wxLIST_STATE_SELECTED);
231                 if (selected < 0 || selected >= int(_playlists.size())) {
232                         Edit (shared_ptr<SignalSPL>());
233                 } else {
234                         Edit (_playlists[selected]);
235                 }
236         }
237
238         wxBoxSizer* _sizer;
239         wxListCtrl* _list;
240         wxButton* _new;
241         wxButton* _delete;
242         vector<shared_ptr<SignalSPL> > _playlists;
243         ContentStore* _content_store;
244 };
245
246
247 class PlaylistContent
248 {
249 public:
250         PlaylistContent (wxPanel* parent, ContentDialog* content_dialog)
251                 : _content_dialog (content_dialog)
252                 , _sizer (new wxBoxSizer(wxVERTICAL))
253         {
254                 wxBoxSizer* title = new wxBoxSizer (wxHORIZONTAL);
255                 wxStaticText* label = new wxStaticText (parent, wxID_ANY, wxEmptyString);
256                 label->SetLabelMarkup (_("<b>Playlist:</b>"));
257                 title->Add (label, 0, wxALIGN_CENTER_VERTICAL | wxRIGHT, DCPOMATIC_SIZER_GAP);
258                 _name = new wxTextCtrl (parent, wxID_ANY, wxEmptyString, wxDefaultPosition, wxSize(400, -1));
259                 title->Add (_name, 0, wxRIGHT, DCPOMATIC_SIZER_GAP);
260                 _sizer->Add (title, 0, wxTOP | wxLEFT, DCPOMATIC_SIZER_GAP * 2);
261
262                 wxBoxSizer* list = new wxBoxSizer (wxHORIZONTAL);
263
264                 _list = new wxListCtrl (
265                         parent, wxID_ANY, wxDefaultPosition, wxDefaultSize, wxLC_REPORT | wxLC_SINGLE_SEL
266                         );
267
268                 _list->AppendColumn (_("Name"), wxLIST_FORMAT_LEFT, 400);
269                 _list->AppendColumn (_("CPL"), wxLIST_FORMAT_LEFT, 350);
270                 _list->AppendColumn (_("Type"), wxLIST_FORMAT_LEFT, 100);
271                 _list->AppendColumn (_("Encrypted"), wxLIST_FORMAT_CENTRE, 90);
272
273                 wxImageList* images = new wxImageList (16, 16);
274                 wxIcon tick_icon;
275                 wxIcon no_tick_icon;
276                 tick_icon.LoadFile (bitmap_path("tick"), wxBITMAP_TYPE_PNG);
277                 no_tick_icon.LoadFile (bitmap_path("no_tick"), wxBITMAP_TYPE_PNG);
278                 images->Add (tick_icon);
279                 images->Add (no_tick_icon);
280
281                 _list->SetImageList (images, wxIMAGE_LIST_SMALL);
282
283                 list->Add (_list, 1, wxEXPAND | wxALL, DCPOMATIC_SIZER_GAP);
284
285                 wxBoxSizer* button_sizer = new wxBoxSizer (wxVERTICAL);
286                 _up = new Button (parent, _("Up"));
287                 _down = new Button (parent, _("Down"));
288                 _add = new Button (parent, _("Add"));
289                 _remove = new Button (parent, _("Remove"));
290                 button_sizer->Add (_up, 0, wxEXPAND | wxBOTTOM, DCPOMATIC_BUTTON_STACK_GAP);
291                 button_sizer->Add (_down, 0, wxEXPAND | wxBOTTOM, DCPOMATIC_BUTTON_STACK_GAP);
292                 button_sizer->Add (_add, 0, wxEXPAND | wxBOTTOM, DCPOMATIC_BUTTON_STACK_GAP);
293                 button_sizer->Add (_remove, 0, wxEXPAND | wxBOTTOM, DCPOMATIC_BUTTON_STACK_GAP);
294
295                 list->Add (button_sizer, 0, wxALL, DCPOMATIC_SIZER_GAP);
296
297                 _sizer->Add (list);
298
299                 _list->Bind (wxEVT_COMMAND_LIST_ITEM_SELECTED, bind(&PlaylistContent::setup_sensitivity, this));
300                 _list->Bind (wxEVT_COMMAND_LIST_ITEM_DESELECTED, bind(&PlaylistContent::setup_sensitivity, this));
301                 _name->Bind (wxEVT_TEXT, bind(&PlaylistContent::name_changed, this));
302                 _up->Bind (wxEVT_BUTTON, bind(&PlaylistContent::up_clicked, this));
303                 _down->Bind (wxEVT_BUTTON, bind(&PlaylistContent::down_clicked, this));
304                 _add->Bind (wxEVT_BUTTON, bind(&PlaylistContent::add_clicked, this));
305                 _remove->Bind (wxEVT_BUTTON, bind(&PlaylistContent::remove_clicked, this));
306         }
307
308         wxSizer* sizer ()
309         {
310                 return _sizer;
311         }
312
313         void set (shared_ptr<SignalSPL> playlist)
314         {
315                 _playlist = playlist;
316                 _list->DeleteAllItems ();
317                 if (_playlist) {
318                         BOOST_FOREACH (SPLEntry i, _playlist->get()) {
319                                 add (i);
320                         }
321                         _name->SetValue (std_to_wx(_playlist->name()));
322                 } else {
323                         _name->SetValue (wxT(""));
324                 }
325                 setup_sensitivity ();
326         }
327
328         shared_ptr<SignalSPL> playlist () const
329         {
330                 return _playlist;
331         }
332
333
334 private:
335         void name_changed ()
336         {
337                 if (_playlist) {
338                         _playlist->set_name (wx_to_std(_name->GetValue()));
339                 }
340         }
341
342         void add (SPLEntry e)
343         {
344                 wxListItem item;
345                 item.SetId (_list->GetItemCount());
346                 long const N = _list->InsertItem (item);
347                 set_item (N, e);
348         }
349
350         void set_item (long N, SPLEntry e)
351         {
352                 _list->SetItem (N, 0, std_to_wx(e.name));
353                 _list->SetItem (N, 1, std_to_wx(e.id));
354                 _list->SetItem (N, 2, std_to_wx(dcp::content_kind_to_string(e.kind)));
355                 _list->SetItem (N, 3, e.encrypted ? S_("Question|Y") : S_("Question|N"));
356         }
357
358         void setup_sensitivity ()
359         {
360                 bool const have_list = static_cast<bool>(_playlist);
361                 int const num_selected = _list->GetSelectedItemCount ();
362                 long int selected = _list->GetNextItem (-1, wxLIST_NEXT_ALL, wxLIST_STATE_SELECTED);
363                 _name->Enable (have_list);
364                 _list->Enable (have_list);
365                 _up->Enable (have_list && selected > 0);
366                 _down->Enable (have_list && selected != -1 && selected < (_list->GetItemCount() - 1));
367                 _add->Enable (have_list);
368                 _remove->Enable (have_list && num_selected > 0);
369         }
370
371         void add_clicked ()
372         {
373                 int const r = _content_dialog->ShowModal ();
374                 if (r == wxID_OK) {
375                         shared_ptr<Content> content = _content_dialog->selected ();
376                         if (content) {
377                                 SPLEntry e (content);
378                                 add (e);
379                                 DCPOMATIC_ASSERT (_playlist);
380                                 _playlist->add (e);
381                         }
382                 }
383         }
384
385         void up_clicked ()
386         {
387                 long int s = _list->GetNextItem (-1, wxLIST_NEXT_ALL, wxLIST_STATE_SELECTED);
388                 if (s < 1) {
389                         return;
390                 }
391
392                 DCPOMATIC_ASSERT (_playlist);
393
394                 SPLEntry tmp = (*_playlist)[s];
395                 (*_playlist)[s] = (*_playlist)[s-1];
396                 (*_playlist)[s-1] = tmp;
397
398                 set_item (s - 1, (*_playlist)[s-1]);
399                 set_item (s, (*_playlist)[s]);
400         }
401
402         void down_clicked ()
403         {
404                 long int s = _list->GetNextItem (-1, wxLIST_NEXT_ALL, wxLIST_STATE_SELECTED);
405                 if (s > (_list->GetItemCount() - 1)) {
406                         return;
407                 }
408
409                 DCPOMATIC_ASSERT (_playlist);
410
411                 SPLEntry tmp = (*_playlist)[s];
412                 (*_playlist)[s] = (*_playlist)[s+1];
413                 (*_playlist)[s+1] = tmp;
414
415                 set_item (s + 1, (*_playlist)[s+1]);
416                 set_item (s, (*_playlist)[s]);
417         }
418
419         void remove_clicked ()
420         {
421                 long int s = _list->GetNextItem (-1, wxLIST_NEXT_ALL, wxLIST_STATE_SELECTED);
422                 if (s == -1) {
423                         return;
424                 }
425
426                 DCPOMATIC_ASSERT (_playlist);
427                 _playlist->remove (s);
428                 _list->DeleteItem (s);
429         }
430
431         ContentDialog* _content_dialog;
432         wxBoxSizer* _sizer;
433         wxTextCtrl* _name;
434         wxListCtrl* _list;
435         wxButton* _up;
436         wxButton* _down;
437         wxButton* _add;
438         wxButton* _remove;
439         shared_ptr<SignalSPL> _playlist;
440 };
441
442
443 class DOMFrame : public wxFrame
444 {
445 public:
446         explicit DOMFrame (wxString const & title)
447                 : wxFrame (0, -1, title)
448                 , _content_dialog (new ContentDialog(this))
449                 , _config_dialog (0)
450         {
451                 wxMenuBar* bar = new wxMenuBar;
452                 setup_menu (bar);
453                 SetMenuBar (bar);
454
455                 /* Use a panel as the only child of the Frame so that we avoid
456                    the dark-grey background on Windows.
457                 */
458                 wxPanel* overall_panel = new wxPanel (this, wxID_ANY);
459                 wxBoxSizer* sizer = new wxBoxSizer (wxVERTICAL);
460
461                 _playlist_list = new PlaylistList (overall_panel, _content_dialog);
462                 _playlist_content = new PlaylistContent (overall_panel, _content_dialog);
463
464                 sizer->Add (_playlist_list->sizer());
465                 sizer->Add (_playlist_content->sizer());
466
467                 overall_panel->SetSizer (sizer);
468
469                 _playlist_list->Edit.connect (bind(&DOMFrame::change_playlist, this, _1));
470
471                 _playlist_content->set (_playlist_list->first_playlist());
472
473                 Bind (wxEVT_MENU, boost::bind (&DOMFrame::file_exit, this), wxID_EXIT);
474                 Bind (wxEVT_MENU, boost::bind (&DOMFrame::help_about, this), wxID_ABOUT);
475                 Bind (wxEVT_MENU, boost::bind (&DOMFrame::edit_preferences, this), wxID_PREFERENCES);
476         }
477
478 private:
479
480         void file_exit ()
481         {
482                 /* false here allows the close handler to veto the close request */
483                 Close (false);
484         }
485
486         void help_about ()
487         {
488                 AboutDialog* d = new AboutDialog (this);
489                 d->ShowModal ();
490                 d->Destroy ();
491         }
492
493         void edit_preferences ()
494         {
495                 if (!_config_dialog) {
496                         _config_dialog = create_playlist_editor_config_dialog ();
497                 }
498                 _config_dialog->Show (this);
499         }
500
501         void change_playlist (shared_ptr<SignalSPL> playlist)
502         {
503                 shared_ptr<SignalSPL> old = _playlist_content->playlist ();
504                 if (old) {
505                         save_playlist (old);
506                 }
507                 _playlist_content->set (playlist);
508         }
509
510         void save_playlist (shared_ptr<SignalSPL> playlist)
511         {
512                 optional<boost::filesystem::path> dir = Config::instance()->player_playlist_directory();
513                 if (!dir) {
514                         error_dialog (this, _("No playlist folder is specified in preferences.  Please set one and then try again."));
515                         return;
516                 }
517                 playlist->write (*dir / (playlist->id() + ".xml"));
518         }
519
520         void setup_menu (wxMenuBar* m)
521         {
522                 wxMenu* file = new wxMenu;
523 #ifdef __WXOSX__
524                 file->Append (wxID_EXIT, _("&Exit"));
525 #else
526                 file->Append (wxID_EXIT, _("&Quit"));
527 #endif
528
529 #ifndef __WXOSX__
530                 wxMenu* edit = new wxMenu;
531                 edit->Append (wxID_PREFERENCES, _("&Preferences...\tCtrl-P"));
532 #endif
533
534                 wxMenu* help = new wxMenu;
535 #ifdef __WXOSX__
536                 help->Append (wxID_ABOUT, _("About DCP-o-matic"));
537 #else
538                 help->Append (wxID_ABOUT, _("About"));
539 #endif
540
541                 m->Append (file, _("&File"));
542 #ifndef __WXOSX__
543                 m->Append (edit, _("&Edit"));
544 #endif
545                 m->Append (help, _("&Help"));
546         }
547
548         ContentDialog* _content_dialog;
549         PlaylistList* _playlist_list;
550         PlaylistContent* _playlist_content;
551         wxPreferencesEditor* _config_dialog;
552 };
553
554 /** @class App
555  *  @brief The magic App class for wxWidgets.
556  */
557 class App : public wxApp
558 {
559 public:
560         App ()
561                 : wxApp ()
562                 , _frame (0)
563         {}
564
565 private:
566
567         bool OnInit ()
568         try
569         {
570                 wxInitAllImageHandlers ();
571                 SetAppName (_("DCP-o-matic Playlist Editor"));
572
573                 if (!wxApp::OnInit()) {
574                         return false;
575                 }
576
577 #ifdef DCPOMATIC_LINUX
578                 unsetenv ("UBUNTU_MENUPROXY");
579 #endif
580
581 #ifdef DCPOMATIC_OSX
582                 make_foreground_application ();
583 #endif
584
585                 dcpomatic_setup_path_encoding ();
586
587                 /* Enable i18n; this will create a Config object
588                    to look for a force-configured language.  This Config
589                    object will be wrong, however, because dcpomatic_setup
590                    hasn't yet been called and there aren't any filters etc.
591                    set up yet.
592                 */
593                 dcpomatic_setup_i18n ();
594
595                 /* Set things up, including filters etc.
596                    which will now be internationalised correctly.
597                 */
598                 dcpomatic_setup ();
599
600                 /* Force the configuration to be re-loaded correctly next
601                    time it is needed.
602                 */
603                 Config::drop ();
604
605                 _frame = new DOMFrame (_("DCP-o-matic Playlist Editor"));
606                 SetTopWindow (_frame);
607                 _frame->Maximize ();
608                 _frame->Show ();
609
610                 signal_manager = new wxSignalManager (this);
611                 Bind (wxEVT_IDLE, boost::bind (&App::idle, this));
612
613                 return true;
614         }
615         catch (exception& e)
616         {
617                 error_dialog (0, _("DCP-o-matic could not start"), std_to_wx(e.what()));
618                 return true;
619         }
620
621         /* An unhandled exception has occurred inside the main event loop */
622         bool OnExceptionInMainLoop ()
623         {
624                 try {
625                         throw;
626                 } catch (FileError& e) {
627                         error_dialog (
628                                 0,
629                                 wxString::Format (
630                                         _("An exception occurred: %s (%s)\n\n") + REPORT_PROBLEM,
631                                         std_to_wx (e.what()),
632                                         std_to_wx (e.file().string().c_str ())
633                                         )
634                                 );
635                 } catch (exception& e) {
636                         error_dialog (
637                                 0,
638                                 wxString::Format (
639                                         _("An exception occurred: %s.\n\n") + " " + REPORT_PROBLEM,
640                                         std_to_wx (e.what ())
641                                         )
642                                 );
643                 } catch (...) {
644                         error_dialog (0, _("An unknown exception occurred.") + "  " + REPORT_PROBLEM);
645                 }
646
647                 /* This will terminate the program */
648                 return false;
649         }
650
651         void OnUnhandledException ()
652         {
653                 error_dialog (0, _("An unknown exception occurred.") + "  " + REPORT_PROBLEM);
654         }
655
656         void idle ()
657         {
658                 signal_manager->ui_idle ();
659         }
660
661         DOMFrame* _frame;
662 };
663
664 IMPLEMENT_APP (App)