Module: Ncurses

Extended by:
Ncurses, NCX
Includes:
NCX
Included in:
Ncurses
Defined in:
lib/ver/panel.rb,
lib/ver/ncurses.rb

Overview

changed on 2011-09-8

Defined Under Namespace

Modules: NCX Classes: FFIWINDOW, Panel

Constant Summary

FALSE =
0
TRUE =
1

Constants included from NCX

NCX::A_BLINK, NCX::A_BOLD, NCX::A_NORMAL, NCX::A_REVERSE, NCX::A_STANDOUT, NCX::A_UNDERLINE, NCX::KEY_F1

Class Method Summary (collapse)

Instance Method Summary (collapse)

Methods included from NCX

COLORS, COLS, LINES, _stdscr

Dynamic Method Handling

This class handles dynamic methods through the method_missing method

- (Object) method_missing(meth, *args)

i think we can knock this off



155
156
157
158
159
# File 'lib/ver/ncurses.rb', line 155

def method_missing meth, *args
  if (FFI::NCurses.respond_to?(meth))
    FFI::NCurses.send meth, *args
  end
end

Class Method Details

+ (Object) initscr

if ffi-ncurses returns a pointer wrap it. or we can check for whether it responds_to? refresh and getch



207
208
209
210
211
212
213
214
215
# File 'lib/ver/ncurses.rb', line 207

def self.initscr
  #@stdscr = Ncurses::FFIWINDOW.new(FFI::NCurses.initscr) { }
  stdscr = FFI::NCurses.initscr
  if stdscr.is_a? FFI::Pointer
    @stdscr = Ncurses::FFIWINDOW.new(stdscr) { }
  else
    @stdscr = stdscr
  end
end

+ (Object) stdscr



216
217
218
# File 'lib/ver/ncurses.rb', line 216

def self.stdscr
  @stdscr
end

Instance Method Details

- (Object) const_missing(name)

FFINC.constants.each { |e| Ncurses.const_set(e, FFINC.const_get(e) ) }



161
162
163
164
165
# File 'lib/ver/ncurses.rb', line 161

def const_missing name
  val = FFI::NCurses.const_get(name)
  const_set(name, val)
  return val
end