Module: FFI::NCurses::Darwin

Included in:
FFI::NCurses
Defined in:
lib/ffi-ncurses/darwin.rb

Defined Under Namespace

Classes: PDat, WinSt

Constant Summary collapse

NCURSES_SIZE_T =
:short
NCURSES_ATTR_T =
:int
NCURSES_COLOR_T =
:short
NCURSES_CH_T =
:short
CHTYPE =
:ulong
CCHARW_MAX =
5
BOOLEAN =

sizeof(bool) == 1

:uchar
WCHAR_T =
:ushort

Instance Method Summary collapse

Instance Method Details

#getattrs(win) ⇒ Object

translated from Mac OSX 10.4 (‘Tiger’) /usr/include/ncurses.h



73
74
75
76
# File 'lib/ffi-ncurses/darwin.rb', line 73

def getattrs(win)
  win_st = WinSt.new(win)
  win ? win_st[:_attrs] : A_NORMAL
end

#getbegx(win) ⇒ Object



85
86
87
88
# File 'lib/ffi-ncurses/darwin.rb', line 85

def getbegx(win)
  win_st = WinSt.new(win)
  win ? win_st[:_begx] : ERR
end

#getbegy(win) ⇒ Object



89
90
91
92
# File 'lib/ffi-ncurses/darwin.rb', line 89

def getbegy(win)
  win_st = WinSt.new(win)
  win ? win_st[:_begy] : ERR
end

#getcurx(win) ⇒ Object



77
78
79
80
# File 'lib/ffi-ncurses/darwin.rb', line 77

def getcurx(win)
  win_st = WinSt.new(win)
  win ? win_st[:_curx] : ERR
end

#getcury(win) ⇒ Object



81
82
83
84
# File 'lib/ffi-ncurses/darwin.rb', line 81

def getcury(win)
  win_st = WinSt.new(win)
  win ? win_st[:_cury] : ERR
end

#getmaxx(win) ⇒ Object



93
94
95
96
# File 'lib/ffi-ncurses/darwin.rb', line 93

def getmaxx(win)
  win_st = WinSt.new(win)
  win ? win_st[:_maxx] + 1 : ERR
end

#getmaxy(win) ⇒ Object



97
98
99
100
# File 'lib/ffi-ncurses/darwin.rb', line 97

def getmaxy(win)
  win_st = WinSt.new(win)
  win ? win_st[:_maxy] + 1 : ERR
end

#getparx(win) ⇒ Object



101
102
103
104
# File 'lib/ffi-ncurses/darwin.rb', line 101

def getparx(win)
  win_st = WinSt.new(win)
  win ? win_st[:_parx] : ERR
end

#getpary(win) ⇒ Object



105
106
107
108
# File 'lib/ffi-ncurses/darwin.rb', line 105

def getpary(win)
  win_st = WinSt.new(win)
  win ? win_st[:_pary] : ERR
end

#is_cleared(win) ⇒ Object

extensions - not in X/Open



116
117
118
# File 'lib/ffi-ncurses/darwin.rb', line 116

def is_cleared(win)
  _win(win, :_clear)
end

#is_idcok(win) ⇒ Object



119
120
121
# File 'lib/ffi-ncurses/darwin.rb', line 119

def is_idcok(win)
  _win(win, :_idcok)
end

#is_idlok(win) ⇒ Object



122
123
124
# File 'lib/ffi-ncurses/darwin.rb', line 122

def is_idlok(win)
  _win(:win, :_idlok)
end

#is_immedok(win) ⇒ Object



125
126
127
# File 'lib/ffi-ncurses/darwin.rb', line 125

def is_immedok(win)
  _win(win, :_immed)
end

#is_keypad(win) ⇒ Object



128
129
130
# File 'lib/ffi-ncurses/darwin.rb', line 128

def is_keypad(win)
  _win(win, :_use_keypad)
end

#is_leaveok(win) ⇒ Object



131
132
133
# File 'lib/ffi-ncurses/darwin.rb', line 131

def is_leaveok(win)
  _win(win, :_leaveok) || ERR
end

#is_nodelay(win) ⇒ Object



134
135
136
# File 'lib/ffi-ncurses/darwin.rb', line 134

def is_nodelay(win)
  _win(win, :_delay) == 0 ? FFI::NCurses::TRUE : FFI::NCurses::FALSE
end

#is_notimeout(win) ⇒ Object



137
138
139
# File 'lib/ffi-ncurses/darwin.rb', line 137

def is_notimeout(win)
  _win(win, :_notimeout)
end

#is_scrollok(win) ⇒ Object



140
141
142
# File 'lib/ffi-ncurses/darwin.rb', line 140

def is_scrollok(win)
  _win(win, :_scroll)
end

#is_syncok(win) ⇒ Object



143
144
145
# File 'lib/ffi-ncurses/darwin.rb', line 143

def is_syncok(win)
  _win(win, :_sync)
end

#wgetparent(win) ⇒ Object



146
147
148
# File 'lib/ffi-ncurses/darwin.rb', line 146

def wgetparent(win)
  _win(win, :_parent)
end

#wgetscrreg(win, t, b) ⇒ Object



149
150
151
152
153
154
155
156
157
158
159
160
# File 'lib/ffi-ncurses/darwin.rb', line 149

def wgetscrreg(win, t, b)
  # ((win) ? (*(t) = (win)->_regtop, *(b) = (win)->_regbottom, OK) : ERR)
  # not entirely satisfactory - no error return
  # should I raise an exception?
  if win
    win_st = WinSt.new(win)
    [win_st[:_regtop], win_st[:_regbottom]]
  else
    #raise ArgumentError, "win is nil"
    nil
  end
end