2 * zavai - simple interface to the OpenMoko (or to the FSO stack)
4 * Copyright (C) 2009 Enrico Zini <enrico@enricozini.org>
6 * This program 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.
11 * This program 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.
16 * You should have received a copy of the GNU General Public License
17 * along with this program; if not, write to the Free Software
18 * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
23 //string VERSION = "0.1";
27 stderr.printf("RETURNED\n");
30 static int main (string[] args) {
33 // parser = Parser(usage="usage: %prog [options]",
34 // version="%prog "+ VERSION,
35 // description="Simple interactive interface for the OpenMoko")
36 // parser.add_option("-v", "--verbose", action="store_true", help="verbose mode")
38 // (opts, args) = parser.parse_args()
40 // if not opts.verbose:
43 // # Read configuration
44 // zavai.info("Loading configuration")
45 // conf = zavai.Config()
49 // Core infrastructure
50 zavai.config = new zavai.Config();
51 zavai.registry = new zavai.Registry();
52 zavai.app = new zavai.Zavai();
54 zavai.registry.register_resource("zavai", zavai.app);
56 // Additional infrastructure
61 zavai.clock.clock.schedule(new zavai.clock.Alarm(123456, "Second"));
62 zavai.clock.clock.schedule(new zavai.clock.Alarm(1234567, "Third"));
63 zavai.clock.clock.schedule(new zavai.clock.Alarm(12345, "First"));
64 zavai.clock.clock.check_alarms();
66 zavai.registry.register_menu("menu.main", new zavai.Menu("Main menu"));
71 zavai.ui.power.init();
74 zavai.ui.polygen.init();
75 zavai.ui.debug.init();
77 //zavai.app.show_applet("menu.main");
78 zavai.app.show_applet("zavai.status");
80 //zavai.ui.power.power_menu.toggle();
82 // # Shutdown the main loop on SIGINT
83 // def on_kill(signum, frame):
85 // signal.signal(signal.SIGINT, on_kill)
86 // signal.signal(signal.SIGTERM, on_kill)
88 // zavai.info("Starting")
89 // app = registry.resource("app")
90 // app.connect("destroy", gtk.main_quit)
94 dynamic DBus.Object otime = zavai.registry.sbus.get_object(
95 "org.freesmartphone.otimed",
96 "/org/freesmartphone/Time/Alarm",
97 "org.freesmartphone.Time.Alarm");
100 otime.SetAlarm(time_t() + 10);
102 dynamic DBus.Object notification = zavai.registry.sbus.get_object(
103 "org.freesmartphone",
104 "org/freesmartphone/Notification",
105 "org.freesmartphone.Notification");
106 notification.Alarm += on_alarm;
112 // zavai.info("Shutting down")
113 zavai.registry.shutdown();