Class: Notcurses::NcmselectorItem
- Inherits:
-
Object
- Object
- Notcurses::NcmselectorItem
- Defined in:
- ext/notcurses/src/notcurses_wrap.c,
ext/notcurses/src/notcurses_wrap.c
Overview
Proxy of C Notcurses::NcmselectorItem struct
Instance Method Summary collapse
-
#desc(*args) ⇒ Object
call-seq: desc -> char const *.
-
#desc=(*args) ⇒ Object
call-seq: desc=(x) -> char const *.
-
#initialize(*args) ⇒ Object
constructor
call-seq: NcmselectorItem.new.
-
#option(*args) ⇒ Object
call-seq: option -> char const *.
-
#option=(*args) ⇒ Object
call-seq: option=(x) -> char const *.
-
#selected(*args) ⇒ Object
call-seq: selected -> bool.
-
#selected=(*args) ⇒ Object
call-seq: selected=(x) -> bool.
Constructor Details
#initialize(*args) ⇒ Object
53189 53190 53191 53192 53193 53194 53195 53196 53197 53198 53199 53200 53201 |
# File 'ext/notcurses/src/notcurses_wrap.c', line 53189
SWIGINTERN VALUE
_wrap_new_NcmselectorItem(int argc, VALUE *argv, VALUE self) {
struct ncmselector_item *result = 0 ;
if ((argc < 0) || (argc > 0)) {
rb_raise(rb_eArgError, "wrong # of arguments(%d for 0)",argc); SWIG_fail;
}
result = (struct ncmselector_item *)calloc(1, sizeof(struct ncmselector_item));
DATA_PTR(self) = result;
return self;
fail:
return Qnil;
}
|
Instance Method Details
#desc(*args) ⇒ Object
call-seq:
desc -> char const *
Get value of attribute.
53008 53009 53010 53011 53012 53013 53014 53015 53016 53017 53018 53019 53020 53021 53022 53023 53024 53025 53026 53027 53028 53029 53030 53031 53032 53033 53034 53035 53036 53037 53038 53039 53040 53041 53042 53043 53044 53045 53046 53047 53048 53049 53050 53051 53052 53053 53054 53055 53056 53057 53058 |
# File 'ext/notcurses/src/notcurses_wrap.c', line 53008
SWIGINTERN VALUE
_wrap_NcmselectorItem_desc_get(int argc, VALUE *argv, VALUE self) {
struct ncmselector_item *arg1 = (struct ncmselector_item *) 0 ;
void *argp1 = 0 ;
int res1 = 0 ;
char *result = 0 ;
VALUE vresult = Qnil;
if ((argc < 0) || (argc > 0)) {
rb_raise(rb_eArgError, "wrong # of arguments(%d for 0)",argc); SWIG_fail;
}
res1 = SWIG_ConvertPtr(self, &argp1,SWIGTYPE_p_ncmselector_item, 0 | 0 );
if (!SWIG_IsOK(res1)) {
SWIG_exception_fail(SWIG_ArgError(res1), Ruby_Format_TypeError( "", "struct ncmselector_item *","desc", 1, self ));
}
arg1 = (struct ncmselector_item *)(argp1);
result = (char *) ((arg1)->desc);
{
VALUE hash = rb_hash_new();
VALUE obj;
if (result == NULL) {
obj = Qnil;
} else {
// Convert C string to Ruby string
obj = rb_str_new2(result);
}
rb_hash_aset(hash, ID2SYM(rb_intern("return")), obj);
vresult = hash;
}
{
if (vresult == Qnil) {
vresult = rb_hash_new();
}
if (!RB_TYPE_P(vresult, T_HASH)) {
VALUE temp = rb_hash_new();
rb_hash_aset(temp, ID2SYM(rb_intern("return")), vresult);
vresult = temp;
}
swig_type_info *ty = SWIG_TypeQuery("struct ncmselector_item *");
if (!ty) ty = SWIGTYPE_p_ncmselector_item;
VALUE obj = SWIG_NewPointerObj((void *)arg1, ty, 0);
rb_hash_aset(vresult, ID2SYM(rb_intern("self")), obj);
}
return vresult;
fail:
return Qnil;
}
|
#desc=(*args) ⇒ Object
call-seq:
desc=(x) -> char const *
Set new value for attribute.
52940 52941 52942 52943 52944 52945 52946 52947 52948 52949 52950 52951 52952 52953 52954 52955 52956 52957 52958 52959 52960 52961 52962 52963 52964 52965 52966 52967 52968 52969 52970 52971 52972 52973 52974 52975 52976 52977 52978 52979 52980 52981 52982 52983 52984 52985 52986 52987 52988 52989 52990 52991 52992 52993 52994 52995 52996 52997 52998 52999 53000 53001 53002 53003 53004 53005 |
# File 'ext/notcurses/src/notcurses_wrap.c', line 52940
SWIGINTERN VALUE
_wrap_NcmselectorItem_desc_set(int argc, VALUE *argv, VALUE self) {
struct ncmselector_item *arg1 = (struct ncmselector_item *) 0 ;
char *arg2 = (char *) 0 ;
void *argp1 = 0 ;
int res1 = 0 ;
int res2 ;
char *buf2 = 0 ;
int alloc2 = 0 ;
VALUE vresult = Qnil;
if ((argc < 1) || (argc > 1)) {
rb_raise(rb_eArgError, "wrong # of arguments(%d for 1)",argc); SWIG_fail;
}
res1 = SWIG_ConvertPtr(self, &argp1,SWIGTYPE_p_ncmselector_item, 0 | 0 );
if (!SWIG_IsOK(res1)) {
SWIG_exception_fail(SWIG_ArgError(res1), Ruby_Format_TypeError( "", "struct ncmselector_item *","desc", 1, self ));
}
arg1 = (struct ncmselector_item *)(argp1);
res2 = SWIG_AsCharPtrAndSize(argv[0], &buf2, NULL, &alloc2);
if (!SWIG_IsOK(res2)) {
SWIG_exception_fail(SWIG_ArgError(res2), Ruby_Format_TypeError( "", "char const *","desc", 2, argv[0] ));
}
arg2 = (char *)(buf2);
if (arg2) {
size_t size = strlen((const char *)((const char *)(arg2))) + 1;
arg1->desc = (char const *)(char *)memcpy(malloc((size)*sizeof(char)), arg2, sizeof(char)*(size));
} else {
arg1->desc = 0;
}
vresult = rb_ary_new();
{
if (vresult == Qnil) {
vresult = rb_hash_new();
}
if (!RB_TYPE_P(vresult, T_HASH)) {
VALUE temp = rb_hash_new();
rb_hash_aset(temp, ID2SYM(rb_intern("return")), vresult);
vresult = temp;
}
swig_type_info *ty = SWIG_TypeQuery("struct ncmselector_item *");
if (!ty) ty = SWIGTYPE_p_ncmselector_item;
VALUE obj = SWIG_NewPointerObj((void *)arg1, ty, 0);
rb_hash_aset(vresult, ID2SYM(rb_intern("self")), obj);
}
{
if (vresult == Qnil) {
vresult = rb_hash_new();
}
if (!RB_TYPE_P(vresult, T_HASH)) {
VALUE temp = rb_hash_new();
rb_hash_aset(temp, ID2SYM(rb_intern("return")), vresult);
vresult = temp;
}
VALUE obj = arg2 ? rb_str_new2(arg2) : Qnil;
rb_hash_aset(vresult, ID2SYM(rb_intern("desc")), obj);
}
if (alloc2 == SWIG_NEWOBJ) free((char*)buf2);
return vresult;
fail:
if (alloc2 == SWIG_NEWOBJ) free((char*)buf2);
return Qnil;
}
|
#option(*args) ⇒ Object
call-seq:
option -> char const *
Get value of attribute.
52869 52870 52871 52872 52873 52874 52875 52876 52877 52878 52879 52880 52881 52882 52883 52884 52885 52886 52887 52888 52889 52890 52891 52892 52893 52894 52895 52896 52897 52898 52899 52900 52901 52902 52903 52904 52905 52906 52907 52908 52909 52910 52911 52912 52913 52914 52915 52916 52917 52918 52919 |
# File 'ext/notcurses/src/notcurses_wrap.c', line 52869
SWIGINTERN VALUE
_wrap_NcmselectorItem_option_get(int argc, VALUE *argv, VALUE self) {
struct ncmselector_item *arg1 = (struct ncmselector_item *) 0 ;
void *argp1 = 0 ;
int res1 = 0 ;
char *result = 0 ;
VALUE vresult = Qnil;
if ((argc < 0) || (argc > 0)) {
rb_raise(rb_eArgError, "wrong # of arguments(%d for 0)",argc); SWIG_fail;
}
res1 = SWIG_ConvertPtr(self, &argp1,SWIGTYPE_p_ncmselector_item, 0 | 0 );
if (!SWIG_IsOK(res1)) {
SWIG_exception_fail(SWIG_ArgError(res1), Ruby_Format_TypeError( "", "struct ncmselector_item *","option", 1, self ));
}
arg1 = (struct ncmselector_item *)(argp1);
result = (char *) ((arg1)->option);
{
VALUE hash = rb_hash_new();
VALUE obj;
if (result == NULL) {
obj = Qnil;
} else {
// Convert C string to Ruby string
obj = rb_str_new2(result);
}
rb_hash_aset(hash, ID2SYM(rb_intern("return")), obj);
vresult = hash;
}
{
if (vresult == Qnil) {
vresult = rb_hash_new();
}
if (!RB_TYPE_P(vresult, T_HASH)) {
VALUE temp = rb_hash_new();
rb_hash_aset(temp, ID2SYM(rb_intern("return")), vresult);
vresult = temp;
}
swig_type_info *ty = SWIG_TypeQuery("struct ncmselector_item *");
if (!ty) ty = SWIGTYPE_p_ncmselector_item;
VALUE obj = SWIG_NewPointerObj((void *)arg1, ty, 0);
rb_hash_aset(vresult, ID2SYM(rb_intern("self")), obj);
}
return vresult;
fail:
return Qnil;
}
|
#option=(*args) ⇒ Object
call-seq:
option=(x) -> char const *
Set new value for attribute.
52801 52802 52803 52804 52805 52806 52807 52808 52809 52810 52811 52812 52813 52814 52815 52816 52817 52818 52819 52820 52821 52822 52823 52824 52825 52826 52827 52828 52829 52830 52831 52832 52833 52834 52835 52836 52837 52838 52839 52840 52841 52842 52843 52844 52845 52846 52847 52848 52849 52850 52851 52852 52853 52854 52855 52856 52857 52858 52859 52860 52861 52862 52863 52864 52865 52866 |
# File 'ext/notcurses/src/notcurses_wrap.c', line 52801
SWIGINTERN VALUE
_wrap_NcmselectorItem_option_set(int argc, VALUE *argv, VALUE self) {
struct ncmselector_item *arg1 = (struct ncmselector_item *) 0 ;
char *arg2 = (char *) 0 ;
void *argp1 = 0 ;
int res1 = 0 ;
int res2 ;
char *buf2 = 0 ;
int alloc2 = 0 ;
VALUE vresult = Qnil;
if ((argc < 1) || (argc > 1)) {
rb_raise(rb_eArgError, "wrong # of arguments(%d for 1)",argc); SWIG_fail;
}
res1 = SWIG_ConvertPtr(self, &argp1,SWIGTYPE_p_ncmselector_item, 0 | 0 );
if (!SWIG_IsOK(res1)) {
SWIG_exception_fail(SWIG_ArgError(res1), Ruby_Format_TypeError( "", "struct ncmselector_item *","option", 1, self ));
}
arg1 = (struct ncmselector_item *)(argp1);
res2 = SWIG_AsCharPtrAndSize(argv[0], &buf2, NULL, &alloc2);
if (!SWIG_IsOK(res2)) {
SWIG_exception_fail(SWIG_ArgError(res2), Ruby_Format_TypeError( "", "char const *","option", 2, argv[0] ));
}
arg2 = (char *)(buf2);
if (arg2) {
size_t size = strlen((const char *)((const char *)(arg2))) + 1;
arg1->option = (char const *)(char *)memcpy(malloc((size)*sizeof(char)), arg2, sizeof(char)*(size));
} else {
arg1->option = 0;
}
vresult = rb_ary_new();
{
if (vresult == Qnil) {
vresult = rb_hash_new();
}
if (!RB_TYPE_P(vresult, T_HASH)) {
VALUE temp = rb_hash_new();
rb_hash_aset(temp, ID2SYM(rb_intern("return")), vresult);
vresult = temp;
}
swig_type_info *ty = SWIG_TypeQuery("struct ncmselector_item *");
if (!ty) ty = SWIGTYPE_p_ncmselector_item;
VALUE obj = SWIG_NewPointerObj((void *)arg1, ty, 0);
rb_hash_aset(vresult, ID2SYM(rb_intern("self")), obj);
}
{
if (vresult == Qnil) {
vresult = rb_hash_new();
}
if (!RB_TYPE_P(vresult, T_HASH)) {
VALUE temp = rb_hash_new();
rb_hash_aset(temp, ID2SYM(rb_intern("return")), vresult);
vresult = temp;
}
VALUE obj = arg2 ? rb_str_new2(arg2) : Qnil;
rb_hash_aset(vresult, ID2SYM(rb_intern("option")), obj);
}
if (alloc2 == SWIG_NEWOBJ) free((char*)buf2);
return vresult;
fail:
if (alloc2 == SWIG_NEWOBJ) free((char*)buf2);
return Qnil;
}
|
#selected(*args) ⇒ Object
call-seq:
selected -> bool
Get value of attribute.
53125 53126 53127 53128 53129 53130 53131 53132 53133 53134 53135 53136 53137 53138 53139 53140 53141 53142 53143 53144 53145 53146 53147 53148 53149 53150 53151 53152 53153 53154 53155 53156 53157 53158 53159 53160 53161 53162 |
# File 'ext/notcurses/src/notcurses_wrap.c', line 53125
SWIGINTERN VALUE
_wrap_NcmselectorItem_selected_get(int argc, VALUE *argv, VALUE self) {
struct ncmselector_item *arg1 = (struct ncmselector_item *) 0 ;
void *argp1 = 0 ;
int res1 = 0 ;
bool result;
VALUE vresult = Qnil;
if ((argc < 0) || (argc > 0)) {
rb_raise(rb_eArgError, "wrong # of arguments(%d for 0)",argc); SWIG_fail;
}
res1 = SWIG_ConvertPtr(self, &argp1,SWIGTYPE_p_ncmselector_item, 0 | 0 );
if (!SWIG_IsOK(res1)) {
SWIG_exception_fail(SWIG_ArgError(res1), Ruby_Format_TypeError( "", "struct ncmselector_item *","selected", 1, self ));
}
arg1 = (struct ncmselector_item *)(argp1);
result = (bool) ((arg1)->selected);
vresult = SWIG_From_bool((bool)(result));
{
if (vresult == Qnil) {
vresult = rb_hash_new();
}
if (!RB_TYPE_P(vresult, T_HASH)) {
VALUE temp = rb_hash_new();
rb_hash_aset(temp, ID2SYM(rb_intern("return")), vresult);
vresult = temp;
}
swig_type_info *ty = SWIG_TypeQuery("struct ncmselector_item *");
if (!ty) ty = SWIGTYPE_p_ncmselector_item;
VALUE obj = SWIG_NewPointerObj((void *)arg1, ty, 0);
rb_hash_aset(vresult, ID2SYM(rb_intern("self")), obj);
}
return vresult;
fail:
return Qnil;
}
|
#selected=(*args) ⇒ Object
call-seq:
selected=(x) -> bool
Set new value for attribute.
53079 53080 53081 53082 53083 53084 53085 53086 53087 53088 53089 53090 53091 53092 53093 53094 53095 53096 53097 53098 53099 53100 53101 53102 53103 53104 53105 53106 53107 53108 53109 53110 53111 53112 53113 53114 53115 53116 53117 53118 53119 53120 53121 53122 |
# File 'ext/notcurses/src/notcurses_wrap.c', line 53079
SWIGINTERN VALUE
_wrap_NcmselectorItem_selected_set(int argc, VALUE *argv, VALUE self) {
struct ncmselector_item *arg1 = (struct ncmselector_item *) 0 ;
bool arg2 ;
void *argp1 = 0 ;
int res1 = 0 ;
bool val2 ;
int ecode2 = 0 ;
VALUE vresult = Qnil;
if ((argc < 1) || (argc > 1)) {
rb_raise(rb_eArgError, "wrong # of arguments(%d for 1)",argc); SWIG_fail;
}
res1 = SWIG_ConvertPtr(self, &argp1,SWIGTYPE_p_ncmselector_item, 0 | 0 );
if (!SWIG_IsOK(res1)) {
SWIG_exception_fail(SWIG_ArgError(res1), Ruby_Format_TypeError( "", "struct ncmselector_item *","selected", 1, self ));
}
arg1 = (struct ncmselector_item *)(argp1);
ecode2 = SWIG_AsVal_bool(argv[0], &val2);
if (!SWIG_IsOK(ecode2)) {
SWIG_exception_fail(SWIG_ArgError(ecode2), Ruby_Format_TypeError( "", "bool","selected", 2, argv[0] ));
}
arg2 = (bool)(val2);
if (arg1) (arg1)->selected = arg2;
{
if (vresult == Qnil) {
vresult = rb_hash_new();
}
if (!RB_TYPE_P(vresult, T_HASH)) {
VALUE temp = rb_hash_new();
rb_hash_aset(temp, ID2SYM(rb_intern("return")), vresult);
vresult = temp;
}
swig_type_info *ty = SWIG_TypeQuery("struct ncmselector_item *");
if (!ty) ty = SWIGTYPE_p_ncmselector_item;
VALUE obj = SWIG_NewPointerObj((void *)arg1, ty, 0);
rb_hash_aset(vresult, ID2SYM(rb_intern("self")), obj);
}
return vresult;
fail:
return Qnil;
}
|