BASIC Developer & Support Resources > Scripting Languages

iCALL

(1/12) > >>

JRS:
I mentioned in the Basic OpenGL thread that I was going to try and use GTK-Server as a generic IFF/Dynacall interface to shared libraries. I converted the calls needed in the curses library and used a combination of Basic code that Armando and I were using on the BCX forum. I'm almost there with my proof of concept example but I still have a couple issues. (background, positioning and color)



Attached is what it should look like. (using standard SB curses extension module)

curses.cfg - Custom GTK-Server .cfg file. (# lines are remarks showing the declares in the curses.h file)

--- Code: ---LIB_NAME = libcurses.so

FUNCTION_NAME = gtk_server_cfg,NONE,STRING,1,STRING

# extern NCURSES_EXPORT(WINDOW *) initscr (void);
FUNCTION_NAME = initscr,NONE,POINTER,0

# extern NCURSES_EXPORT(int) noecho (void);
FUNCTION_NAME = noecho,NONE,INT,0

# extern NCURSES_EXPORT(int) cbreak (void);
FUNCTION_NAME = cbreak,NONE,INT,0

# extern NCURSES_EXPORT(int) start_color (void);
FUNCTION_NAME = start_color,NONE,INT,0

# extern NCURSES_EXPORT(int) wresize (WINDOW *, int, int);
FUNCTION_NAME = wresize,NONE,INT,3,LONG,INT,INT

# extern NCURSES_EXPORT(int) curs_set (int);
FUNCTION_NAME = curs_set,NONE,INT,1,INT

# extern NCURSES_EXPORT(int) move (int, int);
FUNCTION_NAME = move,NONE,INT,2,INT,INT

# extern NCURSES_EXPORT(int) printw (const char *,...)
FUNCTION_NAME = printw,NONE,INT,2,STRING,STRING

# extern NCURSES_EXPORT(int) init_pair (short,short,short);
FUNCTION_NAME = init_pair,NONE,INT,3,INT,INT,INT

# extern NCURSES_EXPORT(int) COLOR_PAIR (int);
FUNCTION_NAME = COLOR_PAIR,NONE,INT,1,INT

# extern NCURSES_EXPORT(int) attrset (NCURSES_ATTR_T);
FUNCTION_NAME = attrset,NONE,INT,1,INT

# extern NCURSES_EXPORT(int) getch (void);
FUNCTION_NAME = getch,NONE,INT,0

# extern NCURSES_EXPORT(int) endwin (void);
FUNCTION_NAME = endwin,NONE,INT,0

--- End code ---

Here is my ScriptBasic program using GTK-Server to access the libcurses.so shared library.

icurses.sb

--- Code: ---' Curses Demo

DECLARE SUB DLL ALIAS "_gtk" LIB "gtk-server"

DLL("gtk_server_cfg " & "curses.cfg")

main_win = DLL("initscr")
DLL("noecho")
DLL("cbreak")
DLL("start_color")
DLL("wresize " & main_win & " 24 86")
DLL("curs_set 0")
DLL("move 0 22")
DLL("printw %s \"ScriptBasic iCALL color demo\"")

display_line = 1
FOR color = 0 TO 255
  DLL("init_pair " & color & " " & STR(256 - color) & " " & color)
  DLL("attrset " & DLL("COLOR_PAIR " & color))  
  IF color % 16 = 0 THEN
    display_line += 1
    DLL("move " & display_line & " 3")
  END IF
  DLL("printw %s \"" & FORMAT("%~ 000 ~", color) & "\"")
NEXT
DLL("move 22 0")
DLL("getch")
DLL("endwin")

--- End code ---

[*]GTK-Server
[*]GTK-Server Manual
[*]GTK-Server Tutorial
[*]GTK-Server Configuration
[*]gtk-server.cfg
[*]GTK-Server.org
[/list]

I'm still hoping Santa will bring a C library .h to .cfg converter for Christmas.  :o

JRS:
Here is my first attempt at debugging the code.


--- Code: ---' Curses Demo

DECLARE SUB DLL ALIAS "_gtk" LIB "gtk-server"

OPEN "trace.out" FOR OUTPUT AS #1
DLL("gtk_server_cfg " & "curses.cfg")

main_win = DLL("initscr")
PRINT #1,"main_win = ",main_win,"\n"
debug_1 = DLL("noecho")
PRINT #1,"noecho = ",debug_1,"\n"
debug_2 = DLL("cbreak")
PRINT #1,"cbreak = ",debug_2,"\n"
debug_3 = DLL("start_color")
PRINT #1,"start_color = ",debug_3,"\n"
debug_4 = DLL("wresize " & main_win & " 24 86")
PRINT #1,"wresize = ",debug_4,"\n"
debug_5 = DLL("curs_set 0")
PRINT #1,"curs_set = ",debug_5,"\n"
debug_6 = DLL("move 0 22")
PRINT #1,"move = ",debug_6,"\n"
debug_7 = DLL("printw %s \"ScriptBasic iCALL color demo\"")
PRINT #1,"printw = ",debug_7,"\n"
display_line = 1
FOR color = 0 TO 255
  debug_8 = DLL("init_pair " & color & " " & STR(256 - color) & " " & color)
  IF color = 0 THEN PRINT #1,"init_pair = ",debug_8,"\n"
  debug_9 = DLL("attrset " & DLL("COLOR_PAIR " & color))  
  IF color = 0 THEN PRINT #1,"attrset = ",debug_9,"\n"
  IF color % 16 = 0 THEN
    display_line += 1
    DLL("move " & display_line & " 3")
  END IF
  DLL("printw %s \"" & FORMAT("%~ 000 ~", color) & "\"")
NEXT
DLL("move 22 0")
DLL("getch")
DLL("endwin")
CLOSE(1)
END

--- End code ---

trace.out

main_win = 158090296
noecho = -1
cbreak = -1
start_color = -1
wresize = -1
curs_set = -1
move = -1
printw = 0
init_pair = -1
attrset = -1

I may have a problem passing INTEGER(4-byte) to a SHORT(2-byte) required parameter. I don't think GTK-Server allows that type as an argument. It's also interesting I'm not getting error messages/dialogs from GTK-Server that it doesn't like what I'm passing.

JRS:

--- Quote from: AIR ---BTW, COLOR_PAIR is not a function, it's a macro.
--- End quote ---

Based on curses.h and nm, COLOR_PAIR() is an exported function.


--- Code: ---000388ac B BC
00038510 B COLORS
0000d5b0 T COLOR_PAIR
0003850c B COLOR_PAIRS
000388a4 B COLS
00038144 D ESCDELAY
000388a0 B LINES
0000d5d0 T PAIR_NUMBER
000388b4 B PC
0003889c B SP
000384e0 D TABSIZE
000388a8 B UP
         U _IO_putc
         w _Jv_RegisterClasses
000384ec A __bss_start
         U __ctype_b_loc
         w __cxa_finalize
         U __errno_location
         U __fprintf_chk
         w __gmon_start__
         U __sprintf_chk
         U __stack_chk_fail
         U __strcpy_chk
         U __strdup
         U __vfprintf_chk
         U __vsnprintf_chk
         U __xstat64
000384ec A _edata
000388d0 A _end
0002b788 T _fini
00008fb8 T _init
000201f0 T _nc_access
000202d0 T _nc_add_to_try
00021340 T _nc_align_termtype
00020190 T _nc_basename
00022c20 T _nc_baudrate
00020460 T _nc_copy_termtype
00038670 B _nc_curr_col
0003866c B _nc_curr_line
000223b0 T _nc_delink_entry
0000c450 T _nc_do_color
00022340 T _nc_doalloc
00021c10 T _nc_err_abort
0002a790 T _nc_expand_try
0001f0b0 T _nc_expanded
000224b0 T _nc_fallback
00021f40 T _nc_find_entry
00021e90 T _nc_find_type_entry
00022000 T _nc_first_db
00029490 T _nc_first_name
00028840 T _nc_flush
00017460 T _nc_format_slks
0001f060 T _nc_free_and_exit
00022430 T _nc_free_entries
00022470 T _nc_free_entry
000224e0 T _nc_free_termtype
0001f050 T _nc_freeall
00014ab0 T _nc_freewin
00021830 T _nc_get_alias_table
000216d0 T _nc_get_hash_info
000215f0 T _nc_get_hash_table
00024800 T _nc_get_locale
00024830 T _nc_get_screensize
000219c0 T _nc_get_source
00021960 T _nc_get_table
00028ee0 T _nc_get_tty_mode
00021b60 T _nc_get_type
00022590 T _nc_getenv_num
00038340 D _nc_globals
00024450 T _nc_handle_sigwinch
00011770 T _nc_has_mouse
0000a1c0 T _nc_hash_map
0002b450 T _nc_hashed_db
00038674 B _nc_head
00022600 T _nc_home_terminfo
000227e0 T _nc_init_acs
000226b0 T _nc_init_keytry
00010c40 T _nc_insert_ch
00020080 T _nc_is_abs_path
000200f0 T _nc_is_dir_path
000200a0 T _nc_is_file_path
00022090 T _nc_keep_tic_dir
00023030 T _nc_keyname
000235f0 T _nc_keypad
000220c0 T _nc_last_db
00022420 T _nc_leaks_tinfo
00024640 T _nc_locale_breaks_acs
00009760 T _nc_make_oldhash
00014690 T _nc_makenew
0001f030 T _nc_memmove
00012490 T _nc_msec_cost
000126e0 T _nc_mvcur_init
000123d0 T _nc_mvcur_resume
00014060 T _nc_mvcur_wrap
000293b0 T _nc_name_match
00022200 T _nc_next_db
000388b8 B _nc_nulls_sent
00038508 B _nc_oldnums
00022ca0 T _nc_ospeed
00028790 T _nc_outch
00019c40 T _nc_panelhook
00020140 T _nc_pathlast
00038160 D _nc_prescreen
00019c70 T _nc_printf_string
00028c30 T _nc_putp
000235b0 T _nc_putp_flush
0002a240 T _nc_read_entry
0002a150 T _nc_read_file_entry
0002a3e0 T _nc_read_termcap
000296f0 T _nc_read_termtype
0002a6f0 T _nc_remove_key
0002a670 T _nc_remove_string
0000a720 T _nc_render
0000ca40 T _nc_reset_colors
000168a0 T _nc_ripoffline
000201c0 T _nc_rootname
0002a5f0 T _nc_safe_strcat
0002a570 T _nc_safe_strcpy
00038898 B _nc_screen_chain
0001a060 T _nc_screen_init
00022e70 T _nc_screen_of
00019f00 T _nc_screen_resume
0001b420 T _nc_screen_wrap
000097d0 T _nc_scroll_oldhash
00009550 T _nc_scroll_optimize
00016490 T _nc_scroll_window
0001c290 T _nc_scrolln
0002a3f0 T _nc_set_buffer
00028c60 T _nc_set_no_padding
000219e0 T _nc_set_source
00028cc0 T _nc_set_tty_mode
00021ba0 T _nc_set_type
00016940 T _nc_setupscreen
00024a80 T _nc_setupterm
00018900 T _nc_signal_handler
00017620 T _nc_slk_initialize
0002a540 T _nc_str_copy
0002a4d0 T _nc_str_init
0002a500 T _nc_str_null
00038668 B _nc_suppress_warnings
00019bf0 T _nc_synchook
00021d50 T _nc_syserr_abort
00038678 B _nc_tail
00022020 T _nc_tic_dir
00029130 T _nc_timed_wait
000244d0 T _nc_tinfo_cmdch
000310e0 R _nc_tinfo_fkeys
00025b90 T _nc_tparm_analyze
000388b0 B _nc_tparm_err
000388bc B _nc_tracing
0002ab40 T _nc_trim_sgr0
0002aef0 T _nc_unctrl
00018a70 T _nc_ungetch
000247b0 T _nc_unicode_locale
000249e0 T _nc_update_screensize
0003815c D _nc_user_definable
0001f020 T _nc_varargs
0002b310 T _nc_visbuf
0002b2f0 T _nc_visbuf2
0002b2d0 T _nc_visbufn
0001f040 T _nc_vsscanf
0000afd0 T _nc_waddch_nosync
00021a00 T _nc_warning
0000f9a0 T _nc_wgetch
         U access
00038680 B acs_map
0000f570 T addch
0000e0d0 T addchnstr
0000e090 T addchstr
0000e010 T addnstr
0000dfd0 T addstr
0001f100 T assume_default_colors
0000d540 T attr_get
0000de50 T attr_off
0000df10 T attr_on
0000d580 T attr_set
0000de90 T attroff
0000df50 T attron
0000d510 T attrset
00022cf0 T baudrate
0000b8f0 T beep
0000f7c0 T bkgd
0000f790 T bkgdset
000366c0 D boolcodes
00036f80 D boolfnames
00036ec0 D boolnames
0000f730 T border
0000f6d0 T box
         U calloc
0000c100 T can_change_color
00024130 T cbreak
         U cfgetospeed
0000f460 T chgat
0000f6a0 T clear
         U clearerr
0000bf40 T clearok
         U close
0000f670 T clrtobot
0000f640 T clrtoeol
0000c1b0 T color_content
0000f600 T color_set
00014db0 T copywin
00038888 B cur_term
000236a0 T curs_set
00038890 B curscr
0002b710 T curses_version
00028fe0 T def_prog_mode
00029030 T def_shell_mode
0002b340 T define_key
00022dd0 T del_curterm
00028890 T delay_output
0000f330 T delch
0000dc60 T deleteln
00017060 T delscreen
0000d250 T delwin
00014900 T derwin
         U dlclose
         U dlopen
         U dlsym
0001e5b0 T doupdate
000199a0 T dupwin
0000d340 T echo
0000f5d0 T echochar
0000d3a0 T endwin
0000f5a0 T erase
00022f60 T erasechar
         U exit
         U fclose
         U ferror
         U fflush
         U fileno
000141c0 T filter
0000d4b0 T flash
00022fc0 T flushinp
         U fopen64
         U fputc
         U fread
         U free
         U fwrite
0000f810 T get_escdelay
0000d6f0 T getattrs
0000d750 T getbegx
0000d770 T getbegy
0000d5c0 T getbkgd
0000f250 T getch
0000d710 T getcurx
0000d730 T getcury
         U getenv
0000d790 T getmaxx
0000d7b0 T getmaxy
00011610 T getmouse
0000ddd0 T getnstr
0000d7d0 T getparx
0000d7f0 T getpary
         U getpgrp
         U getpid
0000dd90 T getstr
         U gettimeofday
00016050 T getwin
000238c0 T halfdelay
0000c130 T has_colors
00022e90 T has_ic
00022f00 T has_il
00023570 T has_key
00011790 T has_mouse
0000f160 T hline
00023920 T idcok
00023990 T idlok
00010ac0 T immedok
0000f060 T inch
0000dd10 T inchnstr
0000dcd0 T inchstr
0000c6e0 T init_color
0000caa0 T init_pair
00010b70 T initscr
0000daa0 T innstr
0000ef80 T insch
0000dc30 T insdelln
0000dc00 T insertln
0000db60 T insnstr
0000db20 T insstr
0000da60 T instr
00023a20 T intrflush
         U ioctl
0000d830 T is_cleared
0000d850 T is_idcok
0000d870 T is_idlok
0000d890 T is_immedok
0000d8b0 T is_keypad
0000d8d0 T is_leaveok
000183c0 T is_linetouched
0000d8f0 T is_nodelay
0000d910 T is_notimeout
0000d930 T is_pad
0000d950 T is_scrollok
0000d970 T is_subwin
0000d990 T is_syncok
0001f410 T is_term_resized
00018400 T is_wintouched
         U isatty
000110f0 T isendwin
0002b4f0 T key_defined
0002b530 T keybound
00023340 T keyname
0002b590 T keyok
00023870 T keypad
         U kill
00022f90 T killchar
00011120 T leaveok
00023370 T longname
         U malloc
0001f270 T mcprint
         U memcpy
         U memmove
         U memset
000237b0 T meta
0000d9e0 T mouse_trafo
00011730 T mouseinterval
00011f40 T mousemask
0000ee80 T move
0000f510 T mvaddch
0000ee10 T mvaddchnstr
0000eda0 T mvaddchstr
0000ed30 T mvaddnstr
0000ecc0 T mvaddstr
0000f3e0 T mvchgat
00013e40 T mvcur
0000f2d0 T mvdelch
000197d0 T mvderwin
0000f1f0 T mvgetch
0000ec50 T mvgetnstr
0000ebe0 T mvgetstr
0000f0f0 T mvhline
0000f000 T mvinch
0000eb70 T mvinchnstr
0000eb00 T mvinchstr
0000ea90 T mvinnstr
0000ef20 T mvinsch
0000ea20 T mvinsnstr
0000e9b0 T mvinsstr
0000e940 T mvinstr
000156d0 T mvprintw
00015df0 T mvscanw
0000e8d0 T mvvline
0000f4b0 T mvwaddch
0000e870 T mvwaddchnstr
0000e810 T mvwaddchstr
0000e7b0 T mvwaddnstr
0000e750 T mvwaddstr
0000f360 T mvwchgat
0000f280 T mvwdelch
0000f1a0 T mvwgetch
0000e6f0 T mvwgetnstr
0000e690 T mvwgetstr
0000f090 T mvwhline
00014110 T mvwin
0000efb0 T mvwinch
0000e630 T mvwinchnstr
0000e5d0 T mvwinchstr
0000e570 T mvwinnstr
0000eec0 T mvwinsch
0000e510 T mvwinsnstr
0000e4b0 T mvwinsstr
0000e450 T mvwinstr
00015670 T mvwprintw
00015d80 T mvwscanw
0000e3f0 T mvwvline
         U nanosleep
000233d0 T napms
00015520 T newpad
00038894 B newscr
00014200 T newterm
00014c30 T newwin
00014d50 T nl
         U nl_langinfo
00023cf0 T nocbreak
00023450 T nodelay
0000d370 T noecho
000141e0 T nofilter
00014d80 T nonl
00023ba0 T noqiflush
00023e60 T noraw
00023490 T notimeout
00036780 D numcodes
000370e0 D numfnames
00037040 D numnames
         U open64
000388b6 B ospeed
000150e0 T overlay
000150c0 T overwrite
0000c270 T pair_content
00015430 T pechochar
00015100 T pnoutrefresh
000153c0 T prefresh
00015770 T printw
00028bf0 T putp
00015ee0 T putwin
00023fe0 T qiflush
000242b0 T raw
         U read
         U realloc
0000e3b0 T redrawwin
0000e380 T refresh
00028e50 T reset_prog_mode
00028dd0 T reset_shell_mode
00028d60 T resetty
0001f6a0 T resize_term
0001f920 T resizeterm
00015bb0 T restartterm
00016910 T ripoffline
00028f70 T savetty
00015ea0 T scanw
00015fd0 T scr_dump
000162a0 T scr_init
000163f0 T scr_restore
00016370 T scr_set
0000e350 T scrl
0000e320 T scroll
000167e0 T scrollok
         U select
00022d50 T set_curterm
0000f7f0 T set_escdelay
00024430 T set_tabsize
000172c0 T set_term
         U setlocale
0000e2e0 T setscrreg
00024e50 T setupterm
         U setvbuf
         U sigaction
         U sigaddset
         U sigemptyset
         U sigismember
         U sigprocmask
         U sleep
00017b10 T slk_attr
00017960 T slk_attr_set
000179f0 T slk_attroff
00017a60 T slk_attron
00017ad0 T slk_attrset
00017b50 T slk_clear
00017be0 T slk_color
00017c40 T slk_init
00017ca0 T slk_label
000180c0 T slk_noutrefresh
00018050 T slk_refresh
000173a0 T slk_restore
00018130 T slk_set
00018380 T slk_touch
         U sscanf
0000d610 T standend
0000d5e0 T standout
0000ce80 T start_color
         U stderr
         U stdin
         U stdout
0003888c B stdscr
         U strchr
         U strcmp
00036820 D strcodes
         U strcpy
00037800 D strfnames
         U strlen
00037180 D strnames
         U strncat
         U strncmp
         U strncpy
         U strrchr
         U strstr
         U strtol
000154c0 T subpad
00014a50 T subwin
000196d0 T syncok
         U tcflush
         U tcgetattr
         U tcgetpgrp
         U tcsetattr
00018b70 T termattrs
00025750 T termname
000251a0 T tgetent
00024f70 T tgetflag
00024e90 T tgetnum
00025040 T tgetstr
00025780 T tgoto
00025980 T tigetflag
000258a0 T tigetnum
000257c0 T tigetstr
0000e2b0 T timeout
00027350 T tiparm
0000e270 T touchline
0000e220 T touchwin
00025f10 T tparm
00028950 T tputs
000383e0 D ttytype
000234d0 T typeahead
0002afb0 T unctrl
00018b40 T ungetch
000122e0 T ungetmouse
0000e1d0 T untouchwin
0001f240 T use_default_colors
000244b0 T use_env
000224c0 T use_extended_names
0001f0c0 T use_legacy_coding
0001fa90 T use_screen
0001faf0 T use_window
000194e0 T vidattr
00018c40 T vidputs
0000e190 T vline
         U vsscanf
0000e150 T vw_printw
0000e110 T vw_scanw
00015620 T vwprintw
00015ce0 T vwscanw
0000af80 T waddch
0000b720 T waddchnstr
0000e050 T waddchstr
0000b850 T waddnstr
0000df90 T waddstr
0000d660 T wattr_get
00019630 T wattr_off
00019670 T wattr_on
0000d690 T wattr_set
0000de10 T wattroff
0000ded0 T wattron
0000d640 T wattrset
0000b960 T wbkgd
0000bac0 T wbkgdset
0000bb40 T wborder
0000bdd0 T wchgat
0000bf00 T wclear
0000bf60 T wclrtobot
0000c030 T wclrtoeol
0000d120 T wcolor_set
00019b90 T wcursyncup
0000d180 T wdelch
0000dbd0 T wdeleteln
0000af20 T wechochar
000116c0 T wenclose
0000d3f0 T werase
00010470 T wgetch
000105b0 T wgetnstr
0000d810 T wgetparent
0000d9b0 T wgetscrreg
0000dd50 T wgetstr
000109d0 T whline
000196a0 T winch
00010ae0 T winchnstr
0000dc90 T winchstr
00011000 T winnstr
00010e60 T winsch
00010ed0 T winsdelln
0000dba0 T winsertln
00010f40 T winsnstr
0000dae0 T winsstr
0000da20 T winstr
000117c0 T wmouse_trafo
00012370 T wmove
00015910 T wnoutrefresh
00015730 T wprintw
000157b0 T wredrawln
00015b30 T wrefresh
0001fc80 T wresize
         U write
00015e60 T wscanw
00016770 T wscrl
00016800 T wsetscrreg
0000d6d0 T wstandend
0000d6b0 T wstandout
000198c0 T wsyncdown
000196f0 T wsyncup
000234b0 T wtimeout
00018450 T wtouchln
00019510 T wvline

--- End code ---

As I see it, curses.h is just a reference with shared objects and the constants are already part of the .so. (curses.h was compiled in when the .so was created)

UPDATE

DLL("nodelay " & main_win & " TRUE")
DLL("refresh")

I thought it might be a refresh issue, no joy. :-(

Just noticed AIR's post, will look into it next.

AIR:

--- Quote from: man curs_color --- Overview
       curses  support color attributes on terminals with that capability.  To
       use these routines start_color must  be  called,  usually  right  after
       initscr.  Colors are always used in pairs (referred to as color-pairs).
       A color-pair consists of a foreground  color  (for  characters)  and  a
       background  color (for the blank field on which the characters are dis-
       played).  A  programmer  initializes  a  color-pair  with  the  routine
       init_pair.   After  it has been initialized, COLOR_PAIR(n), a macro de-
       fined in <curses.h>, can be used as a new video attribute.
--- End quote ---

JRS:
Here is my current code and it still isn't working.


--- Code: ---' Curses Demo

DECLARE SUB DLL ALIAS "_gtk" LIB "gtk-server"

DLL("gtk_server_cfg " & "curses.cfg")

main_win = DLL("initscr")
DLL("start_color")
DLL("noecho")
DLL("cbreak")
DLL("nodelay " & main_win & " TRUE")
DLL("refresh")
' DLL("wresize " & main_win & " 24 86")
DLL("curs_set 0")
DLL("move 0 22")
DLL("printw %s \"ScriptBasic iCALL color demo\"")
display_line = 1
FOR color = 0 TO 255
  DLL("init_pair " & color & " " & STR(256 - color) & " " & color)
  DLL("attrset " & color)  
  IF color % 16 = 0 THEN
    display_line += 1
    DLL("move " & display_line & " 3")
  END IF
  DLL("printw %s \"" & FORMAT("%~ 000 ~", color) & "\"")
NEXT
DLL("move 22 0")
DLL("getch")
DLL("endwin")
CLOSE(1)
END

--- End code ---

curses.cfg


--- Code: ---LIB_NAME = libcurses.so

FUNCTION_NAME = gtk_server_cfg,NONE,STRING,1,STRING

# extern NCURSES_EXPORT(WINDOW *) initscr (void);
FUNCTION_NAME = initscr,NONE,POINTER,0

# extern NCURSES_EXPORT(int) noecho (void);
FUNCTION_NAME = noecho,NONE,INT,0

# extern NCURSES_EXPORT(int) cbreak (void);
FUNCTION_NAME = cbreak,NONE,INT,0

# extern NCURSES_EXPORT(int) start_color (void);
FUNCTION_NAME = start_color,NONE,INT,0

# extern NCURSES_EXPORT(int) wresize (WINDOW *, int, int);
FUNCTION_NAME = wresize,NONE,INT,3,LONG,INT,INT

# extern NCURSES_EXPORT(int) curs_set (int);
FUNCTION_NAME = curs_set,NONE,INT,1,INT

# extern NCURSES_EXPORT(int) move (int, int);
FUNCTION_NAME = move,NONE,INT,2,INT,INT

# extern NCURSES_EXPORT(int) printw (const char *,...)
FUNCTION_NAME = printw,NONE,INT,2,STRING,STRING

# extern NCURSES_EXPORT(int) init_pair (short,short,short);
FUNCTION_NAME = init_pair,NONE,INT,3,SHORT,SHORT,SHORT

# extern NCURSES_EXPORT(int) COLOR_PAIR (int);
FUNCTION_NAME = COLOR_PAIR,NONE,INT,1,INT

# extern NCURSES_EXPORT(int) attrset (NCURSES_ATTR_T);
FUNCTION_NAME = attrset,NONE,INT,1,INT

# extern NCURSES_EXPORT(int) getch (void);
FUNCTION_NAME = getch,NONE,INT,0

# extern NCURSES_EXPORT(int) endwin (void);
FUNCTION_NAME = endwin,NONE,INT,0

# extern NCURSES_EXPORT(int) nodelay (WINDOW *,bool);
FUNCTION_NAME = nodelay,NONE,INT,2,POINTER,BOOL

# extern NCURSES_EXPORT(int) refresh (void);
FUNCTION_NAME = refresh,NONE,INT,0

--- End code ---

NCurses Programming

I have tried the following for the windows pointer reference.

POINTER
LONG
WIDGET
PTR_LONG
PTR_WIDGET

From what I read, clearing to a black background is not always the norm. I can understand why my color isn't working but move should work if printw is working. The screen returns back to normal terminal mode after the getch function. (like with BCX and SB ext. module) It must be something weird with the .so version of libcurses that is giving me fits. What we know works has always been static linked libs.

@AIR - I would be interested to know if your example on the BCX forum would work calling libcurses.so rather than just static linking. I have hit the wall with ideas. Maybe Peter can chime in with a GTK-Server solution that is preventing this from working.

I leaning towards stdscr and SB's STDOUT not reacting the same way as if SB was calling it's curses extension module which uses stdscr.


--- Quote ---initscr() initializes the curses session. (If successful, it returns a pointer to stdscr).
--- End quote ---

Navigation

[0] Message Index

[#] Next page

Go to full version