/* * zavai - simple interface to the OpenMoko (or to the FSO stack) * * Copyright (C) 2009 Enrico Zini * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by * the Free Software Foundation; either version 2 of the License, or * (at your option) any later version. * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. * * You should have received a copy of the GNU General Public License * along with this program; if not, write to the Free Software * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */ using GLib; //string VERSION = "0.1"; static int main (string[] args) { Gtk.init (ref args); // parser = Parser(usage="usage: %prog [options]", // version="%prog "+ VERSION, // description="Simple interactive interface for the OpenMoko") // parser.add_option("-v", "--verbose", action="store_true", help="verbose mode") // // (opts, args) = parser.parse_args() // // if not opts.verbose: // zavai.set_quiet() // // # Read configuration // zavai.info("Loading configuration") // conf = zavai.Config() // Set up zavai // Core infrastructure zavai.config = new zavai.Config(); zavai.registry = new zavai.Registry(); zavai.app = new zavai.Zavai(); zavai.registry.register_resource("zavai", zavai.app); // Additional infrastructure zavai.input.init(); zavai.gps.init(); zavai.audio.init(); zavai.clock.init(); /* zavai.clock.clock.schedule(new zavai.clock.Alarm(123456, "Second")); zavai.clock.clock.schedule(new zavai.clock.Alarm(1234567, "Third")); zavai.clock.clock.schedule(new zavai.clock.Alarm(12345, "First")); zavai.clock.clock.check_alarms(); */ // Create menus zavai.registry.register_menu("menu.main", new zavai.Menu("Main menu")); var menu_gps = new zavai.Menu("GPS"); zavai.registry.register_menu("menu.gps", menu_gps); zavai.registry.getmenu("menu.main").add_applet("menu.gps"); var menu_misc = new zavai.Menu("Misc"); zavai.registry.register_menu("menu.misc", menu_misc); zavai.registry.getmenu("menu.main").add_applet("menu.misc"); // User interface zavai.ui.main.init(); zavai.ui.gps.init(); zavai.ui.power.init(); zavai.ui.kbd.init(); zavai.ui.wm.init(); zavai.ui.polygen.init(); zavai.ui.debug.init(); //zavai.app.show_applet("menu.main"); zavai.app.show_applet("zavai.status"); /* zavai.clock.clock.schedule(new zavai.clock.Alarm(time_t() + 10, "Test second")); zavai.clock.clock.schedule(new zavai.clock.Alarm(time_t() + 5, "Test first")); zavai.clock.clock.schedule(new zavai.clock.Alarm(time_t() + 300, "Test third")); */ //zavai.ui.power.power_menu.toggle(); // # Shutdown the main loop on SIGINT // def on_kill(signum, frame): // gtk.main_quit() // signal.signal(signal.SIGINT, on_kill) // signal.signal(signal.SIGTERM, on_kill) // zavai.info("Starting") // app = registry.resource("app") // app.connect("destroy", gtk.main_quit) // app.run() /* dynamic DBus.Object otime = zavai.registry.sbus.get_object( "org.freesmartphone.otimed", "/org/freesmartphone/Time/Alarm", "org.freesmartphone.Time.Alarm"); otime.ClearAlarm(); otime.SetAlarm(time_t() + 10); dynamic DBus.Object notification = zavai.registry.sbus.get_object( "org.freesmartphone", "org/freesmartphone/Notification", "org.freesmartphone.Notification"); notification.Alarm += on_alarm; */ zavai.app.run(); Gtk.main(); // zavai.info("Shutting down") zavai.registry.shutdown(); return 0; }