Ignore:
Timestamp:
10/06/2007 04:36:54 AM (19 years ago)
Author:
David Owen <dsowen@…>
branch-nick:
tui
revision id:
dsowen@fugue88.ws-20071006043654-b0woemey9plbmi1w
Message:

Added more C constants.
Added the chtype for character/attribute combos.
Ability to work with exit codes.

Location:
tag/last-working
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • tag/last-working/cdk.lisp

    r5 r6  
    1111(use-foreign-library cdk)
    1212
     13
     14
     15;;; Global constants.
     16
     17(defctype chtype :uint64)
     18
     19(defcvar ("cdk_exit_early" +cdk-exit-early+) :int :read-only t)
     20(defcvar ("cdk_exit_escape" +cdk-exit-escape+) :int :read-only t)
     21(defcvar ("cdk_exit_normal" +cdk-exit-normal+) :int :read-only t)
     22(defcvar ("cdk_exit_never" +cdk-exit-never+) :int :read-only t)
    1323
    1424;;; Screen-wide, initialization, and finalization routines.
     
    4555(defcfun ("box" c-box) :int
    4656  (window :pointer)
    47   (vertical-ch :int)
    48   (horizontal-ch :int))
     57  (vertical-ch chtype)
     58  (horizontal-ch chtype))
    4959
    5060
    5161
    5262;;; Generic functions.
     63
     64(defcfun ("bindCDKObject" c-bind-key) :void
     65  (object-type :int)
     66  (object :pointer)
     67  (key chtype)
     68  (function :pointer)
     69  (user-data :pointer))
     70
     71(defcfun ("cleanCDKObjectBindings" c-clear-bindings) :void
     72  (object-type :int)
     73  (object :pointer))
    5374
    5475(defcfun ("setCDKObjectBackgroundColor" c-set-background-color) :void
     
    112133(defcfun ("setCDKEntryHighlight" c-set-entry-highlight) :void
    113134  (entry :pointer)
    114   (highlight :unsigned-long)
     135  (highlight :unsigned-int)             ; Still not sure about this.
    115136  (cursor :boolean))
     137
     138(defcfun ("getCDKEntryExitType" c-entry-exit-type) :int
     139  (entry :pointer))
     140
     141(defcfun ("getCDKEntryValue" c-get-entry-value) :string
     142  (entry :pointer))
     143
     144(defcfun ("setCDKEntryValue" c-set-entry-value) :void
     145  (entry :pointer)
     146  (new-value :string))
     147
     148(defcfun ("setCDKEntryExitType" c-set-entry-exit-type) :void
     149  (entry :pointer)
     150  (ch chtype))
  • tag/last-working/cdk_wrapper.c

    r5 r6  
    33
    44
     5#define DC(name, dconst) const int name = dconst;
     6
     7DC(cdk_exit_early, vEARLY_EXIT)
     8DC(cdk_exit_escape, vESCAPE_HIT)
     9DC(cdk_exit_normal, vNORMAL)
     10DC(cdk_exit_never, vNEVER_ACTIVATED)
     11
     12
     13
     14void freeCDKLabel(CDKLABEL *label)
     15{
     16        destroyCDKLabel(label);
     17}
     18
    519#define D(type, name) \
    620        void freeCDK##name(CDK##type *object) \
    7         { destroyCDK##name(object); }
     21        { destroyCDK##name(object); } \
     22        int getCDK##name##ExitType(CDK##type *object) \
     23        { return ExitTypeOf(object); } \
     24        void setCDK##name##ExitType(CDK##type *object, chtype ch) \
     25        { setCdkExitType(ObjOf(object), &((object)->exitType), ch); }
    826
    9 D(LABEL, Label)
    1027D(ENTRY, Entry)
Note: See TracChangeset for help on using the changeset viewer.