Changeset tag,last-working,5


Ignore:
Timestamp:
09/27/2007 10:46:25 PM (19 years ago)
Author:
David Owen <dsowen@…>
branch-nick:
tui
revision id:
dsowen@fugue88.ws-20070927224625-s9k87snjmjfo33lv
Message:

Added a few more things to the curses/forms wrapper.
Added very light CDK wrapper and adjusted Makefile.

Location:
tag/last-working
Files:
2 added
4 edited

Legend:

Unmodified
Added
Removed
  • tag/last-working/Makefile

    r4 r5  
    1 all: menu2.so form2.so
     1all: menu2.so form2.so cdk_wrapper.so
    22
    33menu2.so: LIBS := -lmenu
     
    55form2.so: LIBS := -lform
    66
     7cdk_wrapper.so: LIBS := -lcdk
     8
    79%.so: %.c
    810        rm -f $@
    911        gcc -shared -fPIC -o $@ $< $(LIBS) -Wall -pedantic
     12
     13clean:
     14        rm -f *.so *.fasl
  • tag/last-working/curses.lisp

    r4 r5  
    1414
    1515(defcfun initscr window*)
     16(defcfun clear :int)
    1617(defcfun endwin :int)
    1718(defcfun refresh :int)
     
    2223(defcfun start-color :int)
    2324
    24 (defcvar stdscr :pointer :read-only t)
     25(defcfun mvwaddstr :int (win :pointer) (y :int) (x :int) (str :string))
     26
     27(defcvar *stdscr* :pointer :read-only t)
    2528
    2629
     
    5861(defcdef req-left-char)
    5962(defcdef req-right-char)
     63(defcdef o-active)
     64(defcdef o-autoskip)
    6065
    6166(defcfun form2-create :int)
    6267(defcfun form2-add-field :int (form :int) (row :int) (col :int) (width :int)
    63          (height :int) (data-height :int))
     68         (height :int) (data-height :int) (opts-mask :int))
    6469(defcfun form2-destroy :int (form :int))
    6570(defcfun form2-post :int (form :int))
     
    6873(defcfun form2-field-len :int (form :int) (i :int))
    6974(defcfun form2-copy-field :int (form :int) (i :int) (buff :pointer) (len :int))
     75(defcfun form2-set-field :int (form :int) (i :int) (buff :string))
    7076
    7177(defun form2-get-value (form i)
     
    8187  (initscr)
    8288  (start-color)
    83   (keypad stdscr 1)
     89  (keypad *stdscr* 1)
    8490  (cbreak)
    85   (noecho))
     91  (noecho)
     92  (clear))
    8693
    8794(defmacro ncase (keyform &rest clauses)
  • tag/last-working/form2.c

    r4 r5  
    2626DC(req_left_char, REQ_LEFT_CHAR);
    2727DC(req_right_char, REQ_RIGHT_CHAR);
     28DC(o_active, O_ACTIVE);
     29DC(o_autoskip, O_AUTOSKIP);
    2830
    2931
     
    9395
    9496int form2_add_field(form2_h form, int row, int col, int width, int height,
    95                 int data_height)
     97                int data_height, int opts_mask)
    9698{
    9799        struct form2_t *f = _check(form);
     
    107109        f->fields[*i] = new_field(height, width, row, col, data_height, 0);
    108110        set_field_back(f->fields[*i], A_UNDERLINE | COLOR_PAIR(1));
    109         field_opts_off(f->fields[*i], O_AUTOSKIP);
     111        field_opts_off(f->fields[*i], opts_mask);
    110112
    111113        ++(*i);
     
    193195        return 1;
    194196}
     197
     198int form2_set_field(form2_h form, int i, const char *str)
     199{
     200        struct form2_t *f = _check(form);
     201
     202        if(!f) return 0;
     203        if(!f->form_struct) return 0;
     204
     205        set_field_buffer(f->fields[i], 0, str);
     206
     207        return 1;
     208}
  • tag/last-working/tui.asd

    r1 r5  
    33(asdf:defsystem #:tui
    44  :depends-on (#:cffi)
    5   :components ((:file "curses")))
     5  :components (#|(:file "curses")|#
     6               (:file "cdk")))
Note: See TracChangeset for help on using the changeset viewer.