File: menu_wrap.h

package info (click to toggle)
ruby-ncurses 1.4.9-1
  • links: PTS, VCS
  • area: main
  • in suites: bullseye, buster, sid, stretch
  • size: 484 kB
  • ctags: 784
  • sloc: ansic: 4,949; ruby: 1,095; makefile: 2
file content (55 lines) | stat: -rw-r--r-- 1,833 bytes parent folder | download | duplicates (3)
1
2
3
4
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
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
/*
 * This is a curses menu wrapper as part of ncurses-ruby.
 * It borrows heavily from form_wrap.h. 
 * Contributed by Earle Clubb <eclubb@valcom.com>
 * Valcom Inc. <http://www.valcom.com>
 * Copyright 2007
 * 
 *  This module is free software; you can redistribute it and/or
 *  modify it under the terms of the GNU Lesser General Public
 *  License as published by the Free Software Foundation; either
 *  version 2 of the License, or (at your option) any later version.
 *
 *  This module is distributed in the hope that it will be useful,
 *  but WITHOUT ANY WARRANTY; without even the implied warranty of
 *  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
 *  Lesser General Public License for more details.
 *
 *  You should have received a copy of the GNU Lesser General Public
 *  License along with this module; if not, write to the Free Software
 *  Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307  USA
 *
 * Changes
 * (C) 2011 Tobias Herzke
 */

#if !defined(MENU_HH) && (defined(HAVE_MENU_H) || defined(HAVE_NCURSESW_MENU_H))
#define MENU_HH

#ifdef HAVE_MENU_H
#include <menu.h>
#else
#include <ncursesw/menu.h>
#endif
#include <ruby.h>

extern VALUE mMenu;
extern VALUE cITEM;
extern VALUE cMENU;

#define MENU_DEF_CONST(name) \
 rb_define_const(mMenu, #name, INT2NUM(name));

#define MENU_SNG_FUNC(name, nargs) \
  rb_define_singleton_method(mMenu, #name, &rbncurs_m_ ## name, nargs)

#define RB_CLASS_METH(class, alt_name, name, nargs)                  \
  rb_define_method(class, #name, (&rbncurs_c_ ## name), nargs);      \
  if (alt_name != NULL)                                              \
  	rb_define_method(class, alt_name, (&rbncurs_c_ ## name), nargs); \

//void init_menu_req_constants(void);
//void init_menu_opts_constants(void);
void init_menu(void);

#endif