Develop and Download Open Source Software

Browse Subversion Repository

Contents of /view.rb

Parent Directory Parent Directory | Revision Log Revision Log


Revision 3 - (show annotations) (download)
Tue Apr 3 20:38:37 2007 UTC (16 years, 11 months ago) by bluedwarf
File size: 1352 byte(s)
* Separated Action class from action_manager.rb.
* Added exit action.

1
2 module Edmaru
3
4 #Abstract class to implement system specific view.
5 module View
6
7 #Construct the view instance.
8 #
9 #=== Warning
10 #This method *MUST* *NOT* be overrided in derived classes.
11 #
12 #=== Argument
13 #_event_manager_ :: An instance of Edmaru::EventManager to handler
14 #all events raised from this view.
15 #
16 #=== Return
17 #An initialized instance of View.
18 def initialize(event_manager)
19 @event_manager = event_manager
20 init_ui
21 end
22
23 #The system specific initialization for this view.
24 #
25 #=== Warning
26 #This method *MUST* be overrided in derived classes.
27 def init_ui
28 end
29
30 #Main loop to catch all events.
31 #
32 #=== Warning
33 #This method *SHOULD* be overrided in derived classes.
34 def main_loop
35 end
36
37 #Exit the running main loop.
38 #
39 #=== Warning
40 #This method *SHOULD* be overrided in derived classes.
41 #
42 #=== Note
43 #Some UI systems (such as Ncurses) don't exit the main loop as
44 #soon as this method is called.
45 def exit_main_loop
46 end
47
48 #Beep once.
49 #
50 #=== Warning
51 #This method *SHOULD* be overrided in derived classes.
52 def beep
53 false
54 end
55
56 #Terminate this view instance.
57 #
58 #=== Warning
59 #This method *SHOULD* be overrided in derived classes.
60 def terminate
61 end
62 end
63 end

Back to OSDN">Back to OSDN
ViewVC Help
Powered by ViewVC 1.1.26