1 /* This file is part of Cinaest.
3 * Copyright (C) 2009 Philipp Zabel
5 * Cinaest is free software: you can redistribute it and/or modify
6 * it under the terms of the GNU General Public License as published by
7 * the Free Software Foundation, either version 3 of the License, or
8 * (at your option) any later version.
10 * Cinaest is distributed in the hope that it will be useful,
11 * but WITHOUT ANY WARRANTY; without even the implied warranty of
12 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
13 * GNU General Public License for more details.
15 * You should have received a copy of the GNU General Public License
16 * along with Cinaest. If not, see <http://www.gnu.org/licenses/>.
21 public class CinaestProgram : Hildon.Program {
22 MovieListWindow window;
26 Environment.set_application_name ("Cinæst");
28 window = new MovieListWindow ();
29 window.destroy.connect (Gtk.main_quit);
34 public void register_plugins () {
35 string plugin_path = Environment.get_variable ("PWD");
37 var directory = File.new_for_path (plugin_path);
38 var enumerator = directory.enumerate_children (FILE_ATTRIBUTE_STANDARD_NAME, 0, null);
41 while ((file_info = enumerator.next_file (null)) != null) {
42 string name = file_info.get_name ();
44 if (name.has_suffix (".so")) {
46 string path = Path.build_filename (plugin_path, name, null);
48 var registrar = new PluginRegistrar<Plugin> (path);
51 plugin = registrar.new_object ();
52 plugins.append (plugin);
53 plugin.hello (window);
58 stderr.printf ("Error: %s\n", e.message);
64 // FIXME - always start with the first plugin's first source for now
65 if (plugins != null) {
66 var plugin = plugins.first ().data;
68 window.store.source = plugin.get_sources ().first ().data;
73 static int main (string[] args) {
77 var osso_context = new Osso.Context ("org.maemo.cinaest", "0.0.1", true, null);
78 if (osso_context == null) {
79 return Osso.Status.ERROR;
82 CinaestProgram app = new CinaestProgram ();