2 * Copyright (C) 2009 Michael 'Mickey' Lauer <mlauer@vanille-media.de>
4 * This library is free software; you can redistribute it and/or
5 * modify it under the terms of the GNU Lesser General Public
6 * License as published by the Free Software Foundation; either
7 * version 2.1 of the License, or (at your option) any later version.
9 * This library is distributed in the hope that it will be useful,
10 * but WITHOUT ANY WARRANTY; without even the implied warranty of
11 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
12 * Lesser General Public License for more details.
14 * You should have received a copy of the GNU Lesser General Public
15 * License along with this library; if not, write to the Free Software
16 * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
22 public class Delegates
: GLib
.Object
31 public bool idle_callback()
33 assert( magic
== 42 );
34 Ecore
.MainLoop
.quit();
35 return false; // don't call me again
38 public bool idle_enterer()
40 assert( magic
== 42 );
41 Ecore
.MainLoop
.quit();
45 public bool idle_exiter()
47 assert( magic
== 42 );
48 Ecore
.MainLoop
.quit();
54 assert( magic
== 42 );
55 Ecore
.MainLoop
.quit();
61 public void test_mainloop_idler()
64 var delegates
= new
Delegates();
65 var i
= new
Idler( delegates
.idle_callback
);
66 Ecore
.MainLoop
.begin();
70 public void test_mainloop_idle_enterer()
73 var delegates
= new
Delegates();
74 var i
= new
IdleEnterer( delegates
.idle_enterer
);
75 Ecore
.MainLoop
.begin();
79 public void test_mainloop_idle_exiter()
82 var delegates
= new
Delegates();
83 var i
= new
IdleExiter( delegates
.idle_exiter
);
84 Ecore
.MainLoop
.begin();
88 public void test_mainloop_timer_timeout()
91 var delegates
= new
Delegates();
92 var i
= new Ecore
.Timer( 1.0, delegates
.timeout
);
93 Ecore
.MainLoop
.begin();
98 //===========================================================================
99 void main (string[] args
)
103 Test
.add_func("/MainLoop/Idler", test_mainloop_idler
);
104 Test
.add_func("/MainLoop/IdleEnterer", test_mainloop_idle_enterer
);
105 //Test.add_func("/MainLoop/IdleExiter", test_mainloop_idle_exiter);
106 Test
.add_func("/MainLoop/Timer/Timeout", test_mainloop_timer_timeout
);