| 1 |
# mini_window.rb: the module definition of Edmaru::MiniWindow |
| 2 |
# |
| 3 |
# Copyright (C) 2007 Takashi Nakamoto |
| 4 |
# |
| 5 |
# This program is free software; you can redistribute it and/or modify |
| 6 |
# it under the terms of the GNU General Public License version 2 as |
| 7 |
# published by the Free Software Foundation. |
| 8 |
# |
| 9 |
# This program is distributed in the hope that it will be useful, but |
| 10 |
# WITHOUT ANY WARRANTY; without even the implied warranty of |
| 11 |
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU |
| 12 |
# General Public License for more details. |
| 13 |
# |
| 14 |
# You should have received a copy of the GNU General Public License |
| 15 |
# along with this program; if not, write to the Free Software |
| 16 |
# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA |
| 17 |
# 02110-1301 USA. |
| 18 |
# |
| 19 |
|
| 20 |
require "window.rb" |
| 21 |
require "mini_buffer.rb" |
| 22 |
|
| 23 |
module Edmaru |
| 24 |
|
| 25 |
#A special window that doesn't have modeline bar. |
| 26 |
module MiniWindow |
| 27 |
include Window |
| 28 |
|
| 29 |
#Construct a window instance. |
| 30 |
# |
| 31 |
#=== Arguments |
| 32 |
#_view_ :: The parent view. |
| 33 |
#_config_ :: An instance of Edmaru::ConfigurationManager. |
| 34 |
# |
| 35 |
#=== Warning |
| 36 |
#This method *MUST* *NOT* be overrided in derived classes. |
| 37 |
# |
| 38 |
#=== Return |
| 39 |
#An initialized instance of Window. |
| 40 |
def initialize(view, config) |
| 41 |
@buffer = nil |
| 42 |
@view = view |
| 43 |
@config = config |
| 44 |
@cursor = Cursor.new(0, 0) # logical cursor |
| 45 |
@modeline = nil #There is no modeline for mini window. |
| 46 |
|
| 47 |
init_ui |
| 48 |
end |
| 49 |
|
| 50 |
#The system specific initialization for this window. |
| 51 |
# |
| 52 |
#=== Warning |
| 53 |
#This method *SHOULD* be overrided in derived classes. |
| 54 |
def init_ui |
| 55 |
end |
| 56 |
|
| 57 |
#Show alert message tempoarily. |
| 58 |
# |
| 59 |
#=== Argument |
| 60 |
#_message_ :: The message to be shown. |
| 61 |
# |
| 62 |
#=== Warning |
| 63 |
#This method *SHOULD* be overrided in derived classes. |
| 64 |
def show_alert(message) |
| 65 |
end |
| 66 |
|
| 67 |
#Terminate this view instance. |
| 68 |
# |
| 69 |
#=== Warning |
| 70 |
#This method *MUST* *NOT* be overrided in derived classes. |
| 71 |
def terminate |
| 72 |
terminate_ui |
| 73 |
end |
| 74 |
|
| 75 |
#Free system specific resources. |
| 76 |
# |
| 77 |
#=== Warning |
| 78 |
#This method *SHOULD* be overrided in derived classes. |
| 79 |
def terminate_ui |
| 80 |
end |
| 81 |
end |
| 82 |
end |