Class: Cursor
Constant Summary collapse
- @@remember =
{}
Class Method Summary collapse
- .bar ⇒ Object
- .black ⇒ Object
- .black_box ⇒ Object
- .blue ⇒ Object
- .blue_hollow ⇒ Object
- .blue_underscore ⇒ Object
- .box ⇒ Object
- .color(color) ⇒ Object
- .green ⇒ Object
- .green_underscore ⇒ Object
- .hollow ⇒ Object
- .menu ⇒ Object
- .red ⇒ Object
- .red_bar ⇒ Object
- .remember(symbol = :default) ⇒ Object
- .restore(symbol = :default) ⇒ Object
- .underscore ⇒ Object
- .white ⇒ Object
Class Method Details
.bar ⇒ Object
33 34 35 36 |
# File 'lib/xiki/cursor.rb', line 33 def self. $el.el4r_lisp_eval "(customize-set-variable 'cursor-type '(bar . 2))" nil end |
.black ⇒ Object
71 72 73 74 |
# File 'lib/xiki/cursor.rb', line 71 def self.black $el.set_face_background :cursor, "#000000" nil end |
.black_box ⇒ Object
92 93 94 95 |
# File 'lib/xiki/cursor.rb', line 92 def self.black_box self.black self.box end |
.blue ⇒ Object
55 56 57 58 |
# File 'lib/xiki/cursor.rb', line 55 def self.blue $el.set_face_background :cursor, "#0099ff" nil end |
.blue_hollow ⇒ Object
80 81 82 83 |
# File 'lib/xiki/cursor.rb', line 80 def self.blue_hollow self.blue self.hollow end |
.blue_underscore ⇒ Object
88 89 90 91 |
# File 'lib/xiki/cursor.rb', line 88 def self.blue_underscore self.blue self.underscore end |
.box ⇒ Object
37 38 39 40 |
# File 'lib/xiki/cursor.rb', line 37 def self.box $el.customize_set_variable :cursor_type, :box nil end |
.color(color) ⇒ Object
50 51 52 53 |
# File 'lib/xiki/cursor.rb', line 50 def self.color color $el.set_face_background :cursor, color nil end |
.green ⇒ Object
63 64 65 66 |
# File 'lib/xiki/cursor.rb', line 63 def self.green $el.set_face_background :cursor, "#33bb00" nil end |
.green_underscore ⇒ Object
84 85 86 87 |
# File 'lib/xiki/cursor.rb', line 84 def self.green_underscore self.green self.underscore end |
.hollow ⇒ Object
45 46 47 48 |
# File 'lib/xiki/cursor.rb', line 45 def self.hollow $el.customize_set_variable :cursor_type, :hollow nil end |
.menu ⇒ Object
5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 |
# File 'lib/xiki/cursor.rb', line 5 def self. %` > Summary | Api for changing the cursor | - colors/ @Cursor.white @Cursor.red @Cursor.green @Cursor.blue @Cursor.color "#80f" - shapes/ @Cursor.bar @Cursor.underscore @Cursor.hollow @Cursor.box - colors and shapes/ @Cursor.red_bar @Cursor.green_underscore @Cursor.blue_hollow @Cursor.black_box - remembering and restoring cursor/ @Cursor.remember :a @Cursor.restore :a ` end |
.red ⇒ Object
59 60 61 62 |
# File 'lib/xiki/cursor.rb', line 59 def self.red $el.set_face_background :cursor, "#ff3300" nil end |
.red_bar ⇒ Object
76 77 78 79 |
# File 'lib/xiki/cursor.rb', line 76 def self. self.red self. end |
.remember(symbol = :default) ⇒ Object
97 98 99 100 |
# File 'lib/xiki/cursor.rb', line 97 def self.remember symbol=:default # Save is hash for later restoring (only if not there yet) @@remember[symbol] = [$el.elvar.cursor_type, $el.face_background(:cursor)] end |
.restore(symbol = :default) ⇒ Object
102 103 104 105 106 107 |
# File 'lib/xiki/cursor.rb', line 102 def self.restore symbol=:default before = @@remember[symbol] return Cursor.black_box unless before # Black if not found type, color = before $el.customize_set_variable :cursor_type, type end |
.underscore ⇒ Object
41 42 43 44 |
# File 'lib/xiki/cursor.rb', line 41 def self.underscore $el.el4r_lisp_eval "(customize-set-variable 'cursor-type '(hbar . 3))" nil end |
.white ⇒ Object
67 68 69 70 |
# File 'lib/xiki/cursor.rb', line 67 def self.white $el.set_face_background :cursor, "#ffffff" nil end |