Browse Subversion Repository
Annotation of /cursor.rb
Parent Directory
| Revision Log
Revision 10 -
( hide annotations)
( download)
Thu Apr 5 11:53:35 2007 UTC
(16 years, 11 months ago)
by bluedwarf
File size: 1119 byte(s)
Added Copyright notice.
| 1 |
bluedwarf |
10 |
# |
| 2 |
|
|
# Edmaru: A scalable editor implemented by Ruby. |
| 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 |
bluedwarf |
9 |
|
| 20 |
|
|
module Edmaru |
| 21 |
|
|
|
| 22 |
|
|
#The cursor instance that represents logical location in a specific |
| 23 |
|
|
#buffer. |
| 24 |
|
|
class Cursor |
| 25 |
|
|
|
| 26 |
|
|
def initialize(a_row = 0, a_col = 0) |
| 27 |
|
|
@row = a_row |
| 28 |
|
|
@col = a_col |
| 29 |
|
|
end |
| 30 |
|
|
|
| 31 |
|
|
def row=(new_row) |
| 32 |
|
|
@row = row |
| 33 |
|
|
end |
| 34 |
|
|
|
| 35 |
|
|
def row |
| 36 |
|
|
@row |
| 37 |
|
|
end |
| 38 |
|
|
|
| 39 |
|
|
def column=(new_col) |
| 40 |
|
|
@col = new_col |
| 41 |
|
|
end |
| 42 |
|
|
|
| 43 |
|
|
def column |
| 44 |
|
|
@col |
| 45 |
|
|
end |
| 46 |
|
|
end |
| 47 |
|
|
end |
| |