added cdk to deps and building fileapprove

This commit is contained in:
Andrew Pamment
2017-03-20 21:40:32 +10:00
parent 071df70e4c
commit 71858e4583
265 changed files with 99585 additions and 18 deletions

View File

@@ -0,0 +1,242 @@
/*
* $Id: alphalist.h,v 1.25 2014/01/19 01:58:40 tom Exp $
*/
#ifndef CDKINCLUDES
#ifndef CDKALPHALIST_H
#define CDKALPHALIST_H 1
#ifdef __cplusplus
extern "C" {
#endif
#ifndef CDK_H
#define CDKINCLUDES
#include <cdk.h>
#undef CDKINCLUDES
#include <binding.h>
#include <cdkscreen.h>
#include <cdk_objs.h>
#endif
/*
* Changes 1999-2012,2014 copyright Thomas E. Dickey
*
* Copyright 1999, Mike Glover
* All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions
* are met:
* 1. Redistributions of source code must retain the above copyright
* notice, this list of conditions and the following disclaimer.
* 2. Redistributions in binary form must reproduce the above copyright
* notice, this list of conditions and the following disclaimer in the
* documentation and/or other materials provided with the distribution.
* 3. All advertising materials mentioning features or use of this software
* must display the following acknowledgment:
* This product includes software developed by Mike Glover
* and contributors.
* 4. Neither the name of Mike Glover, nor the names of contributors
* may be used to endorse or promote products derived from this software
* without specific prior written permission.
*
* THIS SOFTWARE IS PROVIDED BY MIKE GLOVER AND CONTRIBUTORS ``AS IS'' AND
* ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
* IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
* ARE DISCLAIMED. IN NO EVENT SHALL MIKE GLOVER OR CONTRIBUTORS BE LIABLE
* FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
* DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
* OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
* HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
* LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
* OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
* SUCH DAMAGE.
*/
#include <entry.h>
#include <scroll.h>
/*
* Define the CDK alphalist widget structure.
*/
struct SAlphalist {
CDKOBJS obj;
WINDOW * parent;
WINDOW * win;
WINDOW * shadowWin;
CDKENTRY * entryField;
CDKSCROLL * scrollField;
char ** list;
int listSize;
int xpos;
int ypos;
int height;
int width;
int boxHeight;
int boxWidth;
chtype highlight;
chtype fillerChar;
boolean shadow;
EExitType exitType;
};
typedef struct SAlphalist CDKALPHALIST;
/*
* This creates a pointer to a new CDK alphalist widget.
*/
CDKALPHALIST *newCDKAlphalist (
CDKSCREEN * /* cdkscreen */,
int /* xpos */,
int /* ypos */,
int /* height */,
int /* width */,
const char * /* title */,
const char * /* label */,
CDK_CSTRING * /* list */,
int /* listSize */,
chtype /* fillerChar */,
chtype /* highlight */,
boolean /* Box */,
boolean /* shadow */);
/*
* This allows the user to interact with the widget.
*/
char *activateCDKAlphalist (
CDKALPHALIST * /* alphalist */,
chtype * /* actions */);
/*
* This injects a single character into the widget.
*/
#define injectCDKAlphalist(obj,input) injectCDKObject(obj,input,String)
/*
* This sets multiple attributes of the alphalist widget.
*/
void setCDKAlphalist (
CDKALPHALIST * /* alphalist */,
CDK_CSTRING * /* list */,
int /* listSize */,
chtype /* fillerChar */,
chtype /* highlight */,
boolean /* Box */);
/*
* This sets the contents of the alpha list.
*/
void setCDKAlphalistContents (
CDKALPHALIST * /* alphalist */,
CDK_CSTRING * /* list */,
int /* listSize */);
char **getCDKAlphalistContents (
CDKALPHALIST * /* alphalist */,
int * /* size */);
/*
* Get/set the current position in the scroll-widget.
*/
int getCDKAlphalistCurrentItem(
CDKALPHALIST * /* widget */);
void setCDKAlphalistCurrentItem(
CDKALPHALIST * /* widget */,
int /* item */);
/*
* This sets the filler character of the entry field of the alphalist.
*/
void setCDKAlphalistFillerChar (
CDKALPHALIST * /* alphalist */,
chtype /* fillerCharacter */);
chtype getCDKAlphalistFillerChar (
CDKALPHALIST * /* alphalist */);
/*
* This sets the highlight bar attributes.
*/
void setCDKAlphalistHighlight (
CDKALPHALIST * /* alphalist */,
chtype /* highlight */);
chtype getCDKAlphalistHighlight (
CDKALPHALIST * /* alphalist */);
/*
* This sets the box attribute of the widget.
*/
void setCDKAlphalistBox (
CDKALPHALIST * /* alphalist */,
boolean /* Box */);
boolean getCDKAlphalistBox (
CDKALPHALIST * /* alphalist */);
/*
* These functions set the drawing characters of the widget.
*/
#define setCDKAlphalistULChar(w,c) setULCharOf(w,c)
#define setCDKAlphalistURChar(w,c) setURCharOf(w,c)
#define setCDKAlphalistLLChar(w,c) setLLCharOf(w,c)
#define setCDKAlphalistLRChar(w,c) setLRCharOf(w,c)
#define setCDKAlphalistVerticalChar(w,c) setVTCharOf(w,c)
#define setCDKAlphalistHorizontalChar(w,c) setHZCharOf(w,c)
#define setCDKAlphalistBoxAttribute(w,c) setBXAttrOf(w,c)
/*
* This sets the background color of the widget.
*/
#define setCDKAlphalistBackgroundColor(w,c) setCDKObjectBackgroundColor(ObjOf(w),c)
/*
* This sets the background attribute of the widget.
*/
#define setCDKAlphalistBackgroundAttrib(w,c) setBKAttrOf(w,c)
/*
* This draws the widget on the screen.
*/
#define drawCDKAlphalist(obj,box) drawCDKObject(obj,box)
/*
* This removes the widget from the screen.
*/
#define eraseCDKAlphalist(obj) eraseCDKObject(obj)
/*
* This moves the widget to the location specified.
*/
#define moveCDKAlphalist(obj,xpos,ypos,relative,refresh) moveCDKObject(obj,xpos,ypos,relative,refresh)
/*
* This allows the user to interactively position the widget.
*/
#define positionCDKAlphalist(widget) positionCDKObject(ObjOf(widget),widget->win)
/*
* This destroys the widget and all the memory associated with it.
*/
#define destroyCDKAlphalist(obj) destroyCDKObject(obj)
/*
* These functions set the pre and post process functions for the widget.
*/
void setCDKAlphalistPreProcess (
CDKALPHALIST * /* alphalist */,
PROCESSFN /* callback */,
void * /* data */);
void setCDKAlphalistPostProcess (
CDKALPHALIST * /* alphalist */,
PROCESSFN /* callback */,
void * /* data */);
#ifdef __cplusplus
}
#endif
#endif /* CDKALPHALIST_H */
#endif /* CDKINCLUDES */

132
deps/cdk-5.0-20161210/include/binding.h vendored Normal file
View File

@@ -0,0 +1,132 @@
/*
* $Id: binding.h,v 1.14 2005/03/08 23:44:25 tom Exp $
*/
#ifndef CDKINCLUDES
#ifndef CDKBINDING_H
#define CDKBINDING_H 1
#ifdef __cplusplus
extern "C" {
#endif
#ifndef CDK_H
#define CDKINCLUDES
#include <cdk.h>
#undef CDKINCLUDES
#endif
/*
* Changes 1999-2004,2005 copyright Thomas E. Dickey
*
* Copyright 1999, Mike Glover
* All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions
* are met:
* 1. Redistributions of source code must retain the above copyright
* notice, this list of conditions and the following disclaimer.
* 2. Redistributions in binary form must reproduce the above copyright
* notice, this list of conditions and the following disclaimer in the
* documentation and/or other materials provided with the distribution.
* 3. All advertising materials mentioning features or use of this software
* must display the following acknowledgment:
* This product includes software developed by Mike Glover
* and contributors.
* 4. Neither the name of Mike Glover, nor the names of contributors
* may be used to endorse or promote products derived from this software
* without specific prior written permission.
*
* THIS SOFTWARE IS PROVIDED BY MIKE GLOVER AND CONTRIBUTORS ``AS IS'' AND
* ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
* IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
* ARE DISCLAIMED. IN NO EVENT SHALL MIKE GLOVER OR CONTRIBUTORS BE LIABLE
* FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
* DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
* OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
* HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
* LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
* OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
* SUCH DAMAGE.
*/
/*
* Create definitions for the key bindings.
*/
/*
* This is the key binding prototype, typed for use with Perl.
*/
#define BINDFN_PROTO(func) \
int (func) ( \
EObjectType /* cdktype */, \
void * /* object */, \
void * /* clientData */, \
chtype /* input */)
typedef BINDFN_PROTO(*BINDFN);
/*
* Bind to this function to simply translate keys without doing anything else,
* in getcCDKObject().
*/
extern BINDFN_PROTO(getcCDKBind);
/*
* This is the prototype for the process callback functions.
*/
typedef int (*PROCESSFN) (
EObjectType /* cdktype */,
void * /* object */,
void * /* clientData */,
chtype /* input */);
/*
* This binds the key to the event.
*/
void bindCDKObject (
EObjectType /* cdktype */,
void * /* object */,
chtype /* key */,
BINDFN /* function */,
void * /* data */);
/*
* This unbinds the key from the event.
*/
void unbindCDKObject (
EObjectType /* cdktype */,
void * /* object */,
chtype /* key */);
/*
* This checks if the given key has an event 'attached' to it, executes the
* bound function if so.
*/
int checkCDKObjectBind (
EObjectType /* cdktype */,
void * /* object */,
chtype /* key */);
/*
* This checks if the given key has an event 'attached' to it.
*/
bool isCDKObjectBind (
EObjectType /* cdktype */,
void * /* object */,
chtype /* key */);
/*
* This cleans out all of the key bindings.
*/
void cleanCDKObjectBindings (
EObjectType /* cdktype */,
void * /* object */);
#ifdef __cplusplus
}
#endif
#endif /* CDKBINDING_H */
#endif /* CDKINCLUDES */

208
deps/cdk-5.0-20161210/include/button.h vendored Normal file
View File

@@ -0,0 +1,208 @@
/*
* $Id: button.h,v 1.13 2016/01/31 21:08:37 tom Exp $
*/
#ifndef CDKINCLUDES
#ifndef CDKBUTTON_H
#define CDKBUTTON_H 1
#include "cdk.h"
#ifndef CDK_H
#define CDKINCLUDES
#include <cdk.h>
#undef CDKINCLUDES
#include <binding.h>
#include <cdkscreen.h>
#include <cdk_objs.h>
#endif
/*
* Changes 2002-2012,2016 copyright Thomas E. Dickey
*
* Copyright 1999, Grant Edwards
* All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions
* are met:
* 1. Redistributions of source code must retain the above copyright
* notice, this list of conditions and the following disclaimer.
* 2. Redistributions in binary form must reproduce the above copyright
* notice, this list of conditions and the following disclaimer in the
* documentation and/or other materials provided with the distribution.
* 3. All advertising materials mentioning features or use of this software
* must display the following acknowledgment:
* This product includes software developed by Grant Edwards
* and contributors.
* 4. Neither the name of Grant Edwards, nor the names of contributors
* may be used to endorse or promote products derived from this software
* without specific prior written permission.
*
* THIS SOFTWARE IS PROVIDED BY GRANT EDWARDS AND CONTRIBUTORS ``AS IS'' AND
* ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
* IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
* ARE DISCLAIMED. IN NO EVENT SHALL GRANT EDWARDS OR CONTRIBUTORS BE LIABLE
* FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
* DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
* OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
* HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
* LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
* OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
* SUCH DAMAGE.
*/
/*
* Declare any definitions you need to make.
*/
typedef struct SButton CDKBUTTON;
typedef void (*tButtonCallback)(struct SButton *button);
/*
* Declare the CDK label structure.
*/
struct SButton {
CDKOBJS obj;
WINDOW * parent;
WINDOW * win;
WINDOW * shadowWin;
chtype * info;
tButtonCallback callback;
int infoLen;
int infoPos;
int boxWidth;
int boxHeight;
int xpos;
int ypos;
int rows;
EExitType exitType;
boolean shadow;
chtype highlight;
void * callbackData;
};
/*
* This sets the callback function of the button's argument.
*/
#define setCDKButtonCBArgs(button, argPtr) \
((button)->callbackData = (void*)(argPtr))
#define getCDKButtonCBArgs(button, argType) \
((argType) ((button)->callbackData))
/*
* This sets the button's highlight mode.
*/
#define CDKButtonHighlightOf(button) \
((button)->highlight)
#define setCDKButtonHighlight(button, highlightMode) \
(CDKButtonHighlightOf(button) = (highlightMode))
#define getCDKButtonHighlight(button) \
CDKButtonHighlightOf(button)
/*
* This creates a new CDK button widget.
*/
CDKBUTTON *newCDKButton (
CDKSCREEN * /* screen */,
int /* xPos */,
int /* yPos */,
const char * /* button text */,
tButtonCallback /* callback function */,
boolean /* Box */,
boolean /* shadow */);
/*
* This was added to make the builder simpler. All this will
* do is call drawCDKLabel.
*/
int activateCDKButton (
CDKBUTTON * /* button */,
chtype * /* actions */);
/*
* This injects a single character into the widget.
*/
#define injectCDKButton(obj,input) injectCDKObject(obj,input,Int)
/*
* This sets multiple attributes of the widget.
*/
void setCDKButton (
CDKBUTTON * /* button */,
const char * /* text */,
boolean /* Box */);
/*
* This sets the contents of the button.
*/
void setCDKButtonMessage (
CDKBUTTON * /* button */,
const char * /* mesg */);
chtype *getCDKButtonMessage (
CDKBUTTON *);
/*
* This sets the box attribute of the widget.
*/
void setCDKButtonBox (
CDKBUTTON * /* button */,
boolean /* Box */);
boolean getCDKButtonBox (
CDKBUTTON * /* button */);
/*
* This draws the button.
*/
#define drawCDKButton(obj,Box) drawCDKObject(obj,Box)
/*
* These set the drawing characters of the widget.
*/
#define setCDKButtonULChar(w,c) setULCharOf(w,c)
#define setCDKButtonURChar(w,c) setURCharOf(w,c)
#define setCDKButtonLLChar(w,c) setLLCharOf(w,c)
#define setCDKButtonLRChar(w,c) setLRCharOf(w,c)
#define setCDKButtonVerticalChar(w,c) setVTCharOf(w,c)
#define setCDKButtonHorizontalChar(w,c) setHZCharOf(w,c)
#define setCDKButtonBoxAttribute(w,c) setBXAttrOf(w,c)
/*
* This sets the background color of the widget.
*/
#define setCDKButtonBackgroundColor(w,c) setCDKObjectBackgroundColor(ObjOf(w),c)
/*
* This sets the background attribute of the widget.
*/
#define setCDKButtonBackgroundAttrib(w,c) setBKAttrOf(w,c)
/*
* This erases the button.
*/
#define eraseCDKButton(obj) eraseCDKObject(obj)
/*
* This destroys the button and the memory used by it.
*/
#define destroyCDKButton(obj) destroyCDKObject(obj)
/*
* This moves the button to a new screen location.
*/
#define moveCDKButton(obj,xpos,ypos,relative,refresh) moveCDKObject(obj,xpos,ypos,relative,refresh)
/*
* This allows the user to interactively position the button.
*/
void positionCDKButton (CDKBUTTON *);
#endif /* CDKBUTTON_H */
#endif /* CDKINCLUDES */

View File

@@ -0,0 +1,220 @@
/*
* $Id: buttonbox.h,v 1.27 2012/03/21 21:15:30 tom Exp $
*/
#ifndef CDKINCLUDES
#ifndef CDKBUTTONBOX_H
#define CDKBUTTONBOX_H 1
#ifdef __cplusplus
extern "C" {
#endif
#ifndef CDK_H
#define CDKINCLUDES
#include <cdk.h>
#undef CDKINCLUDES
#include <binding.h>
#include <cdkscreen.h>
#include <cdk_objs.h>
#endif
/*
* Changes 1999-2005,2012 copyright Thomas E. Dickey
*
* Copyright 1999, Mike Glover
* All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions
* are met:
* 1. Redistributions of source code must retain the above copyright
* notice, this list of conditions and the following disclaimer.
* 2. Redistributions in binary form must reproduce the above copyright
* notice, this list of conditions and the following disclaimer in the
* documentation and/or other materials provided with the distribution.
* 3. All advertising materials mentioning features or use of this software
* must display the following acknowledgment:
* This product includes software developed by Mike Glover
* and contributors.
* 4. Neither the name of Mike Glover, nor the names of contributors
* may be used to endorse or promote products derived from this software
* without specific prior written permission.
*
* THIS SOFTWARE IS PROVIDED BY MIKE GLOVER AND CONTRIBUTORS ``AS IS'' AND
* ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
* IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
* ARE DISCLAIMED. IN NO EVENT SHALL MIKE GLOVER OR CONTRIBUTORS BE LIABLE
* FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
* DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
* OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
* HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
* LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
* OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
* SUCH DAMAGE.
*/
/*
* Define the CDK buttonbox structure.
*/
struct SButtonBox {
CDKOBJS obj;
WINDOW * parent;
WINDOW * win;
WINDOW * shadowWin;
int titleAdj;
chtype ** button;
int * buttonLen;
int * buttonPos;
int * columnWidths;
int buttonCount;
int buttonWidth;
int currentButton;
int rows;
int cols;
int colAdjust;
int rowAdjust;
int boxWidth;
int boxHeight;
chtype ButtonAttrib;
EExitType exitType;
boolean shadow;
chtype highlight;
};
typedef struct SButtonBox CDKBUTTONBOX;
/*
* This returns a CDK buttonbox widget pointer.
*/
CDKBUTTONBOX *newCDKButtonbox (
CDKSCREEN * /* cdkscreen */,
int /* xPos */,
int /* yPos */,
int /* height */,
int /* width */,
const char * /* title */,
int /* rows */,
int /* cols */,
CDK_CSTRING2 /* buttons */,
int /* buttonCount */,
chtype /* highlight */,
boolean /* Box */,
boolean /* shadow */);
/*
* This activates the widget.
*/
int activateCDKButtonbox (
CDKBUTTONBOX * /* buttonbox */,
chtype * /* actions */);
/*
* This injects a single character into the widget.
*/
#define injectCDKButtonbox(obj,input) injectCDKObject(obj,input,Int)
/*
* This sets multiple attributes of the widget.
*/
void setCDKButtonbox (
CDKBUTTONBOX * /* buttonbox */,
chtype /* highlight */,
boolean /* Box */);
void setCDKButtonboxCurrentButton (
CDKBUTTONBOX * /* buttonbox */,
int /* button */);
int getCDKButtonboxCurrentButton (
CDKBUTTONBOX * /* buttonbox */);
int getCDKButtonboxButtonCount (
CDKBUTTONBOX * /* buttonbox */);
/*
* This sets the highlight attribute for the buttonbox.
*/
void setCDKButtonboxHighlight (
CDKBUTTONBOX * /* buttonbox */,
chtype /* highlight */);
chtype getCDKButtonboxHighlight (
CDKBUTTONBOX * /* buttonbox */);
/*
* This sets the box attribute of the widget.
*/
void setCDKButtonboxBox (
CDKBUTTONBOX * /* buttonbox */,
boolean /* Box */);
boolean getCDKButtonboxBox (
CDKBUTTONBOX * /* buttonbox */);
/*
* These set the drawing characters of the widget.
*/
#define setCDKButtonboxULChar(w,c) setULCharOf(w,c)
#define setCDKButtonboxURChar(w,c) setURCharOf(w,c)
#define setCDKButtonboxLLChar(w,c) setLLCharOf(w,c)
#define setCDKButtonboxLRChar(w,c) setLRCharOf(w,c)
#define setCDKButtonboxVerticalChar(w,c) setVTCharOf(w,c)
#define setCDKButtonboxHorizontalChar(w,c) setHZCharOf(w,c)
#define setCDKButtonboxBoxAttribute(w,c) setBXAttrOf(w,c)
/*
* This sets the background color of the widget.
*/
#define setCDKButtonboxBackgroundColor(w,c) setCDKObjectBackgroundColor(ObjOf(w),c)
/*
* This sets the background attribute of the widget.
*/
#define setCDKButtonboxBackgroundAttrib(w,c) setBKAttrOf(w,c)
/*
* This draws the buttonbox box widget.
*/
#define drawCDKButtonbox(obj,box) drawCDKObject(obj,box)
void drawCDKButtonboxButtons (
CDKBUTTONBOX * /* buttonbox */);
/*
* This erases the buttonbox box from the screen.
*/
#define eraseCDKButtonbox(obj) eraseCDKObject(obj)
/*
* This moves the buttonbox box to a new screen location.
*/
#define moveCDKButtonbox(obj,xpos,ypos,relative,refresh) moveCDKObject(obj,xpos,ypos,relative,refresh)
/*
* This allows the user to position the widget on the screen interactively.
*/
#define positionCDKButtonbox(widget) positionCDKObject(ObjOf(widget),widget->win)
/*
* This destroys the widget and all the memory associated with it.
*/
#define destroyCDKButtonbox(obj) destroyCDKObject(obj)
/*
* This redraws the buttonbox box buttonboxs.
*/
void redrawCDKButtonboxButtonboxs (
CDKBUTTONBOX * /* buttonbox */);
/*
* These set the pre/post process functions of the buttonbox widget.
*/
#define setCDKButtonboxPreProcess(w,f,d) setCDKObjectPreProcess(ObjOf(w),f,d)
#define setCDKButtonboxPostProcess(w,f,d) setCDKObjectPostProcess(ObjOf(w),f,d)
#ifdef __cplusplus
}
#endif
#endif /* CDKBUTTONBOX_H */
#endif /* CDKINCLUDES */

310
deps/cdk-5.0-20161210/include/calendar.h vendored Normal file
View File

@@ -0,0 +1,310 @@
/*
* $Id: calendar.h,v 1.31 2012/03/21 21:15:30 tom Exp $
*/
#ifndef CDKINCLUDES
#ifndef CDKCALENDAR_H
#define CDKCALENDAR_H 1
#ifdef __cplusplus
extern "C" {
#endif
#ifndef CDK_H
#define CDKINCLUDES
#include <cdk.h>
#undef CDKINCLUDES
#include <binding.h>
#include <cdkscreen.h>
#include <cdk_objs.h>
#endif
/*
* Changes 2000-2011,2012 copyright Thomas E. Dickey
*
* Copyright 1999, Mike Glover
* All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions
* are met:
* 1. Redistributions of source code must retain the above copyright
* notice, this list of conditions and the following disclaimer.
* 2. Redistributions in binary form must reproduce the above copyright
* notice, this list of conditions and the following disclaimer in the
* documentation and/or other materials provided with the distribution.
* 3. All advertising materials mentioning features or use of this software
* must display the following acknowledgment:
* This product includes software developed by Mike Glover
* and contributors.
* 4. Neither the name of Mike Glover, nor the names of contributors
* may be used to endorse or promote products derived from this software
* without specific prior written permission.
*
* THIS SOFTWARE IS PROVIDED BY MIKE GLOVER AND CONTRIBUTORS ``AS IS'' AND
* ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
* IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
* ARE DISCLAIMED. IN NO EVENT SHALL MIKE GLOVER OR CONTRIBUTORS BE LIABLE
* FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
* DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
* OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
* HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
* LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
* OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
* SUCH DAMAGE.
*/
/*
* Declare some definitions needed for this widget.
*/
#define MAX_DAYS 32 /* maximum number of days in any month */
#define MAX_MONTHS 13 /* month[0] is unused */
#define MAX_YEARS 140 /* years [1901..2140] */
#define CALENDAR_LIMIT (MAX_DAYS * MAX_MONTHS * MAX_YEARS)
#define CALENDAR_INDEX(d,m,y) ((((y) * MAX_MONTHS) + (m)) * MAX_DAYS + (d))
#define CALENDAR_CELL(c,d,m,y) ((c)->marker[CALENDAR_INDEX(d,m,y)])
/*
* Define the CDK calendar widget structure.
*/
struct SCalendar {
CDKOBJS obj;
WINDOW * parent;
WINDOW * win;
WINDOW * labelWin;
WINDOW * fieldWin;
WINDOW * shadowWin;
int titleAdj;
int xpos;
int ypos;
int height;
int width;
int fieldWidth;
int labelLen;
chtype yearAttrib;
chtype monthAttrib;
chtype dayAttrib;
chtype highlight;
chtype * marker;
int day;
int month;
int year;
int weekDay;
int boxWidth;
int boxHeight;
int xOffset;
EExitType exitType;
boolean shadow;
char * DayName;
char * MonthName[MAX_MONTHS];
int weekBase; /* starting day of week (Sunday=0, Monday=1) */
};
typedef struct SCalendar CDKCALENDAR;
/*
* This creates a pointer to a new calendar widget.
*/
CDKCALENDAR *newCDKCalendar (
CDKSCREEN * /* screen */,
int /* xPos */,
int /* yPos */,
const char * /* title */,
int /* day */,
int /* month */,
int /* year */,
chtype /* dayAttrib */,
chtype /* monthAttrib */,
chtype /* yearAttrib */,
chtype /* highlight */,
boolean /* Box */,
boolean /* shadow */);
/*
* This activates the calendar widget.
*/
time_t activateCDKCalendar (
CDKCALENDAR * /* calendar */,
chtype * /* actions */);
/*
* This injects a single character into the widget.
*/
#define injectCDKCalendar(obj,input) injectCDKObject(obj,input,Int)
/*
* This sets multiple attributes of the widget.
*/
void setCDKCalendar (
CDKCALENDAR * /* calendar */,
int /* day */,
int /* month */,
int /* year */,
chtype /* dayAttrib */,
chtype /* monthAttrib */,
chtype /* yearAttrib */,
chtype /* highlight */,
boolean /* Box */);
/*
* This sets the date of the calendar.
*/
void setCDKCalendarDate (
CDKCALENDAR * /* calendar */,
int /* day */,
int /* month */,
int /* year */);
void getCDKCalendarDate (
CDKCALENDAR * /* calendar */,
int * /* day */,
int * /* month */,
int * /* year */);
/*
* This sets the attribute of the days in the calendar.
*/
void setCDKCalendarDayAttribute (
CDKCALENDAR * /* calendar */,
chtype /* attribute */);
chtype getCDKCalendarDayAttribute (
CDKCALENDAR * /* calendar */);
/*
* This sets the attribute of the month names in the calendar.
*/
void setCDKCalendarMonthAttribute (
CDKCALENDAR * /* calendar */,
chtype /* attribute */);
chtype getCDKCalendarMonthAttribute (
CDKCALENDAR * /* calendar */);
/*
* This sets the attribute of the year in the calendar.
*/
void setCDKCalendarYearAttribute (
CDKCALENDAR * /* calendar */,
chtype /* attribute */);
chtype getCDKCalendarYearAttribute (
CDKCALENDAR * /* calendar */);
/*
* This sets the attribute of the highlight bar.
*/
void setCDKCalendarHighlight (
CDKCALENDAR * /* calendar */,
chtype /* highlight */);
chtype getCDKCalendarHighlight (
CDKCALENDAR * /* calendar */);
/*
* This sets the box attribute of the widget.
*/
void setCDKCalendarBox (
CDKCALENDAR * /* calendar */,
boolean /* Box */);
boolean getCDKCalendarBox (
CDKCALENDAR * /* calendar */);
/*
* These set the drawing characters of the widget.
*/
#define setCDKCalendarULChar(w,c) setULCharOf(w,c)
#define setCDKCalendarURChar(w,c) setURCharOf(w,c)
#define setCDKCalendarLLChar(w,c) setLLCharOf(w,c)
#define setCDKCalendarLRChar(w,c) setLRCharOf(w,c)
#define setCDKCalendarVerticalChar(w,c) setVTCharOf(w,c)
#define setCDKCalendarHorizontalChar(w,c) setHZCharOf(w,c)
#define setCDKCalendarBoxAttribute(w,c) setBXAttrOf(w,c)
/*
* This sets the background color of the widget.
*/
#define setCDKCalendarBackgroundColor(w,c) setCDKObjectBackgroundColor(ObjOf(w),c)
/*
* This sets the background attribute of the widget.
*/
#define setCDKCalendarBackgroundAttrib(w,c) setBKAttrOf(w,c)
/*
* This sets a marker on the calendar.
*/
void setCDKCalendarMarker (
CDKCALENDAR * /* calendar */,
int /* day */,
int /* month */,
int /* year */,
chtype /* markerChar */);
/*
* Return the marker set on the calendar.
*/
chtype getCDKCalendarMarker (
CDKCALENDAR * /* calendar */,
int /* day */,
int /* month */,
int /* year */);
/*
* This removes a marker from the calendar.
*/
void removeCDKCalendarMarker (
CDKCALENDAR * /* calendar */,
int /* day */,
int /* month */,
int /* year */);
/*
* This draws the widget on the screen.
*/
#define drawCDKCalendar(obj,box) drawCDKObject(obj,box)
/*
* This removes the widget from the screen.
*/
#define eraseCDKCalendar(obj) eraseCDKObject(obj)
/*
* This moves the widget to the given location.
*/
#define moveCDKCalendar(obj,xpos,ypos,relative,refresh) moveCDKObject(obj,xpos,ypos,relative,refresh)
/*
* This is an interactive method of moving the widget.
*/
#define positionCDKCalendar(widget) positionCDKObject(ObjOf(widget),widget->win)
/*
* This destroys the calendar widget and all associated memory.
*/
#define destroyCDKCalendar(obj) destroyCDKObject(obj)
/*
* This sets the pre and post process functions.
*/
#define setCDKCalendarPreProcess(w,f,d) setCDKObjectPreProcess(ObjOf(w),f,d)
#define setCDKCalendarPostProcess(w,f,d) setCDKObjectPostProcess(ObjOf(w),f,d)
/*
* This sets days and months names
*/
void setCDKCalendarMonthsNames (
CDKCALENDAR * /* calendar */,
CDK_CSTRING2 /* months */);
void setCDKCalendarDaysNames (
CDKCALENDAR * /* calendar */,
const char * /* days - 1st is Sunday */);
#ifdef __cplusplus
}
#endif
#endif /* CDKCALENDAR_H */
#endif /* CDKINCLUDES */

336
deps/cdk-5.0-20161210/include/cdk.h vendored Normal file
View File

@@ -0,0 +1,336 @@
/*
* $Id: cdk.h,v 1.37 2012/03/20 22:01:57 tom Exp $
*/
#ifndef CDK_H
#define CDK_H
#ifdef __cplusplus
extern "C" {
#endif
/*
* Changes 2000-2009,2012 copyright Thomas E. Dickey
*
* Copyright 1999, Mike Glover
* All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions
* are met:
* 1. Redistributions of source code must retain the above copyright
* notice, this list of conditions and the following disclaimer.
* 2. Redistributions in binary form must reproduce the above copyright
* notice, this list of conditions and the following disclaimer in the
* documentation and/or other materials provided with the distribution.
* 3. All advertising materials mentioning features or use of this software
* must display the following acknowledgment:
* This product includes software developed by Mike Glover
* and contributors.
* 4. Neither the name of Mike Glover, nor the names of contributors
* may be used to endorse or promote products derived from this software
* without specific prior written permission.
*
* THIS SOFTWARE IS PROVIDED BY MIKE GLOVER AND CONTRIBUTORS ``AS IS'' AND
* ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
* IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
* ARE DISCLAIMED. IN NO EVENT SHALL MIKE GLOVER OR CONTRIBUTORS BE LIABLE
* FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
* DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
* OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
* HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
* LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
* OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
* SUCH DAMAGE.
*/
#include <cdk_config.h>
#include <cdk_version.h>
#ifdef CDK_PERL_EXT
#undef instr
#endif
#ifdef HAVE_XCURSES
#include <xcurses.h>
#ifndef mvwhline
#define mvwhline(win,y,x,c,n) (wmove(win,y,x) == ERR ? ERR : whline(win,c,n))
#endif
#ifndef mvwvline
#define mvwvline(win,y,x,c,n) (wmove(win,y,x) == ERR ? ERR : wvline(win,c,n))
#endif
#elif defined(HAVE_NCURSESW_NCURSES_H)
#include <ncursesw/ncurses.h>
#elif defined(HAVE_NCURSES_NCURSES_H)
#include <ncurses/ncurses.h>
#elif defined(HAVE_NCURSES_H)
#include <ncurses.h>
#else
#include <curses.h>
#endif
#include <sys/types.h>
#include <sys/stat.h>
#include <stdlib.h>
#include <string.h>
#include <ctype.h>
#ifdef HAVE_UNISTD_H
#include <unistd.h>
#endif
#ifdef HAVE_DIRENT_H
#include <dirent.h>
#endif
#include <time.h>
#include <errno.h>
#ifdef HAVE_PWD_H
#include <pwd.h>
#endif
#ifdef HAVE_GRP_H
#include <grp.h>
#endif
#ifdef HAVE_LIMITS_H
#include <limits.h>
#endif
#ifdef HAVE_GETOPT_HEADER
#ifdef HAVE_GETOPT_H
#include <getopt.h>
#endif
#else
extern int optind;
extern char * optarg;
#endif
/*
* Definitions that we do not want if term.h does
*/
#ifdef buttons
#undef buttons
#endif
#ifdef lines
#undef lines
#endif
#ifdef newline
#undef newline
#endif
/*
* Values we normally get from limits.h (assume 32-bits)
*/
#ifndef INT_MIN
#define INT_MIN (-INT_MAX - 1)
#endif
#ifndef INT_MAX
#define INT_MAX 2147483647
#endif
#ifndef GCC_UNUSED
#define GCC_UNUSED /*nothing*/
#endif
#ifdef HAVE_LIBDMALLOC
#include <dmalloc.h> /* Gray Watson's library */
#else
#undef HAVE_LIBDMALLOC
#define HAVE_LIBDMALLOC 0
#endif
#ifdef HAVE_LIBDBMALLOC
#include <dbmalloc.h> /* Conor Cahill's library */
#else
#undef HAVE_LIBDBMALLOC
#define HAVE_LIBDBMALLOC 0
#endif
/*
* This enumerated typedef lists all of the CDK widget types.
*/
typedef enum { vNULL = 0
,vALPHALIST
,vBUTTON
,vBUTTONBOX
,vCALENDAR
,vDIALOG
,vDSCALE
,vENTRY
,vFSCALE
,vFSELECT
,vFSLIDER
,vGRAPH
,vHISTOGRAM
,vITEMLIST
,vLABEL
,vMARQUEE
,vMATRIX
,vMENTRY
,vMENU
,vRADIO
,vSCALE
,vSCROLL
,vSELECTION
,vSLIDER
,vSWINDOW
,vTEMPLATE
,vTRAVERSE
,vUSCALE
,vUSLIDER
,vVIEWER
} EObjectType;
/*
* This enumerated typedef lists all the valid display types for
* the entry, mentry, and template widgets.
*/
typedef enum { vINVALID = 0
,vCHAR
,vHCHAR
,vINT
,vHINT
,vMIXED
,vHMIXED
,vUCHAR
,vLCHAR
,vUHCHAR
,vLHCHAR
,vUMIXED
,vLMIXED
,vUHMIXED
,vLHMIXED
,vVIEWONLY
} EDisplayType;
/*
* This enumerated typedef lists all the display types for
* the histogram widget.
*/
typedef enum {vNONE, vPERCENT, vFRACTION, vREAL} EHistogramDisplayType;
/*
* This enumerated typedef defines the display types for the graph.
*/
typedef enum {vPLOT, vLINE} EGraphDisplayType;
/*
* This enumerated typedef defines where white space is to be
* stripped from in the function stripWhiteSpace.
*/
typedef enum {vFRONT, vBACK, vBOTH} EStripType;
/*
* This enumerated typedef defines the type of exits the widgets
* recognize.
*/
typedef enum {vEARLY_EXIT, vESCAPE_HIT, vNORMAL, vNEVER_ACTIVATED, vERROR} EExitType;
/*
* This defines a boolean type.
*/
typedef int boolean;
/*
* Declare miscellaneous defines.
*/
#define LEFT 9000
#define RIGHT 9001
#define CENTER 9002
#define TOP 9003
#define BOTTOM 9004
#define HORIZONTAL 9005
#define VERTICAL 9006
#define FULL 9007
#define NONE 0
#define ROW 1
#define COL 2
#define MAX_BINDINGS 300 /* unused by widgets */
#define MAX_ITEMS 2000 /* unused by widgets */
#define MAX_BUTTONS 200 /* unused by widgets */
#define MAXIMUM(a,b) ((a) > (b) ? (a) : (b))
#define MINIMUM(a,b) ((a) < (b) ? (a) : (b))
#define HALF(a) ((a) >> 1)
#ifndef COLOR_PAIR
#define COLOR_PAIR(a) A_NORMAL
#endif
#define CONTROL(c) ((c) & 0x1f) /* obsolete: use CTRL() */
/* Define the 'GLOBAL DEBUG FILEHANDLE' */
extern FILE *CDKDEBUG;
/*
* =========================================================
* Declare Debugging Routines.
* =========================================================
*/
#define START_DEBUG(a) (CDKDEBUG=startCDKDebug(a))
#define WRITE_DEBUGMESG(a,b) (writeCDKDebugMessage (CDKDEBUG,__FILE__,a,__LINE__,b))
#define END_DEBUG (stopCDKDebug(CDKDEBUG)
FILE *startCDKDebug(const char *filename);
void writeCDKDebugMessage (FILE *fd, const char *filename, const char *function, int line, const char *message);
void stopCDKDebug (FILE *fd);
/*
* These header files define miscellaneous values and prototypes.
*/
#include <cdkscreen.h>
#include <curdefs.h>
#include <binding.h>
#include <cdk_util.h>
#include <cdk_objs.h>
#include <cdk_params.h>
/*
* Include the CDK widget header files.
*/
#include <alphalist.h>
#include <buttonbox.h>
#include <calendar.h>
#include <dialog.h>
#include <entry.h>
#include <fselect.h>
#include <graph.h>
#include <histogram.h>
#include <itemlist.h>
#include <label.h>
#include <marquee.h>
#include <matrix.h>
#include <mentry.h>
#include <menu.h>
#include <radio.h>
#include <scroll.h>
#include <selection.h>
#include <swindow.h>
#include <template.h>
#include <viewer.h>
#include <traverse.h>
#include <button.h>
/*
* Generated headers:
*/
#include <dscale.h>
#include <fscale.h>
#include <scale.h>
#include <uscale.h>
#include <fslider.h>
#include <slider.h>
#include <uslider.h>
/*
* Low-level object drawing
*/
#include <draw.h>
#ifdef __cplusplus
}
#endif
#endif /* CDK_H */

View File

@@ -0,0 +1,98 @@
/*
* $Id: cdk_compat.h,v 1.2 2005/12/28 21:45:45 tom Exp $
*/
#ifndef CDKINCLUDES
#ifndef CDK_COMPAT_H
#define CDK_COMPAT_H
#ifdef __cplusplus
extern "C" {
#endif
/*
* Copyright 2004,2005 Thomas E. Dickey
* All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions
* are met:
* 1. Redistributions of source code must retain the above copyright
* notice, this list of conditions and the following disclaimer.
* 2. Redistributions in binary form must reproduce the above copyright
* notice, this list of conditions and the following disclaimer in the
* documentation and/or other materials provided with the distribution.
* 3. All advertising materials mentioning features or use of this software
* must display the following acknowledgment:
* This product includes software developed by Thomas Dickey
* and contributors.
* 4. Neither the name of Thomas Dickey, nor the names of contributors
* may be used to endorse or promote products derived from this software
* without specific prior written permission.
*
* THIS SOFTWARE IS PROVIDED BY THOMAS DICKEY AND CONTRIBUTORS ``AS IS'' AND
* ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
* IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
* ARE DISCLAIMED. IN NO EVENT SHALL THOMAS DICKEY OR CONTRIBUTORS BE LIABLE
* FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
* DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
* OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
* HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
* LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
* OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
* SUCH DAMAGE.
*/
/*
* Renaming of struct members was done for consistency. Making old/new
* versions compatible with renaming is awkward (there may be inadvertant
* naming collisions), but this is mainly for demonstration purposes.
*/
#define info list
#define infoSize listSize
#define itemCount listSize
#define boxMatrix box
/*
* Include the Cdk header file, which includes everything except for this file.
*/
#include <cdk.h>
/*
* This is defined via the new header file:
*/
#ifdef CDK_VERSION_PATCH
/*
* If we included the new Cdk header file, provide definitions for things
* which have been made obsolete.
*/
#define MAX_LINES 5000
#define WIN_WIDTH(a) getmaxx(a)
#define WIN_HEIGHT(a) getmaxy(a)
#define WIN_XPOS(a) getbegx(a)
#define WIN_YPOS(a) getbegy(a)
extern int getDirectoryContents (char *directory, char **list, int maxListSize);
extern int readFile (char *filename, char **info, int maxlines);
extern int splitString (char *string, char **items, char splitChar);
#else
/*
* Provide definitions to allow the applications using the old header to
* compile using the new header's macros:
*/
#define ObjOf(a) (a)
#define ScreenOf(a) (a)
#endif /* CDK_VERSION_PATCH */
#ifdef __cplusplus
}
#endif
#endif /* CDK_COMPAT_H */
#endif /* CDKINCLUDES */

106
deps/cdk-5.0-20161210/include/cdk_int.h vendored Normal file
View File

@@ -0,0 +1,106 @@
/*
* $Id: cdk_int.h,v 1.27 2016/12/04 19:43:43 tom Exp $
*/
#ifndef CDKINCLUDES
#ifndef CDK_INT_H
#define CDK_INT_H
#ifdef __cplusplus
extern "C" {
#endif
#include <cdk.h>
/*
* Copyright 2003-2013,2016 Thomas E. Dickey
* All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions
* are met:
* 1. Redistributions of source code must retain the above copyright
* notice, this list of conditions and the following disclaimer.
* 2. Redistributions in binary form must reproduce the above copyright
* notice, this list of conditions and the following disclaimer in the
* documentation and/or other materials provided with the distribution.
* 3. All advertising materials mentioning features or use of this software
* must display the following acknowledgment:
* This product includes software developed by Thomas Dickey
* and contributors.
* 4. Neither the name of Thomas Dickey, nor the names of contributors
* may be used to endorse or promote products derived from this software
* without specific prior written permission.
*
* THIS SOFTWARE IS PROVIDED BY THOMAS DICKEY AND CONTRIBUTORS ``AS IS'' AND
* ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
* IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
* ARE DISCLAIMED. IN NO EVENT SHALL THOMAS DICKEY OR CONTRIBUTORS BE LIABLE
* FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
* DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
* OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
* HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
* LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
* OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
* SUCH DAMAGE.
*/
#define typeCallocN(type,n) (type*)calloc((size_t)(n), sizeof(type))
#define typeCalloc(type) typeCallocN(type,1)
#define typeReallocN(type,p,n) (type*)realloc(p, (size_t)(n) * sizeof(type))
#define typeMallocN(type,n) (type*)malloc((size_t)(n) * sizeof(type))
#define typeMalloc(type) typeMallocN(type,1)
#define freeChecked(p) if ((p) != 0) free (p)
#define freeAndNull(p) if ((p) != 0) { free (p); p = 0; }
#define isChar(c) ((int)(c) >= 0 && (int)(c) < KEY_MIN)
#define CharOf(c) ((unsigned char)(c))
#define SIZEOF(v) (sizeof(v)/sizeof((v)[0]))
#define MAX_COLORS 8
/*
* Macros to check if caller is attempting to make the widget as high (or wide)
* as the screen.
*/
#define isFullWidth(n) ((n) == FULL || (COLS != 0 && ((n) >= COLS)))
#define isFullHeight(n) ((n) == FULL || (LINES != 0 && ((n) >= LINES)))
/*
* Hide details of modifying widget->exitType
*/
#define storeExitType(d) ObjOf(d)->exitType = (d)->exitType
#define initExitType(d) storeExitType(d) = vNEVER_ACTIVATED
#define setExitType(w,c) setCdkExitType(ObjOf(w), &((w)->exitType), c)
#define copyExitType(d,s) storeExitType(d) = ExitTypeOf(s)
/*
* Use this if checkCDKObjectBind() returns true, use this function to
* decide if the exitType should be set as a side-effect.
*/
#define checkEarlyExit(w) if (EarlyExitOf(w) != vNEVER_ACTIVATED) \
storeExitType(w) = EarlyExitOf(w)
/*
* Position within the data area of a widget, accounting for border and title.
*/
#define SCREEN_XPOS(w,n) ((n) + BorderOf(w))
#define SCREEN_YPOS(w,n) ((n) + BorderOf(w) + TitleLinesOf(w))
/*
* Miscellaneous definitions.
*/
#define CDK_PATHMAX 256
extern char *GPasteBuffer;
#ifdef __cplusplus
}
#endif
#endif /* CDK_INT_H */
#endif /* CDKINCLUDES */

373
deps/cdk-5.0-20161210/include/cdk_objs.h vendored Normal file
View File

@@ -0,0 +1,373 @@
/*
* $Id: cdk_objs.h,v 1.40 2012/03/21 20:49:54 tom Exp $
*/
#ifndef CDKINCLUDES
#ifndef CDK_OBJS_H
#define CDK_OBJS_H
#ifdef __cplusplus
extern "C" {
#endif
#ifndef CDK_H
#define CDKINCLUDES
#include <cdk.h>
#undef CDKINCLUDES
#include <binding.h>
#include <cdkscreen.h>
#endif
/*
* Copyright 1999-2005,2012 Thomas E. Dickey
* All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions
* are met:
* 1. Redistributions of source code must retain the above copyright
* notice, this list of conditions and the following disclaimer.
* 2. Redistributions in binary form must reproduce the above copyright
* notice, this list of conditions and the following disclaimer in the
* documentation and/or other materials provided with the distribution.
* 3. All advertising materials mentioning features or use of this software
* must display the following acknowledgment:
* This product includes software developed by Thomas Dickey
* and contributors.
* 4. Neither the name of Thomas Dickey, nor the names of contributors
* may be used to endorse or promote products derived from this software
* without specific prior written permission.
*
* THIS SOFTWARE IS PROVIDED BY THOMAS DICKEY AND CONTRIBUTORS ``AS IS'' AND
* ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
* IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
* ARE DISCLAIMED. IN NO EVENT SHALL THOMAS DICKEY OR CONTRIBUTORS BE LIABLE
* FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
* DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
* OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
* HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
* LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
* OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
* SUCH DAMAGE.
*/
typedef struct CDKBINDING {
BINDFN bindFunction;
void * bindData;
PROCESSFN callbackfn;
} CDKBINDING;
struct CDKOBJS;
/*
* Types for CDKFUNCS.returnType
*/
typedef enum {
DataTypeUnknown = 0
, DataTypeString
, DataTypeInt
, DataTypeFloat
, DataTypeDouble
, DataTypeUnsigned
} CDKDataType;
typedef union {
char * valueString;
int valueInt;
float valueFloat;
double valueDouble;
unsigned valueUnsigned;
} CDKDataUnion;
#define unknownString (char *)0
#define unknownInt (-1)
#define unknownFloat (0.0)
#define unknownDouble (0.0)
#define unknownUnsigned (0)
/*
* Methods common to all widgets.
*/
typedef struct CDKFUNCS {
EObjectType objectType;
CDKDataType returnType;
void (*drawObj) (struct CDKOBJS *, boolean);
void (*eraseObj) (struct CDKOBJS *);
void (*moveObj) (struct CDKOBJS *, int, int, boolean, boolean);
int (*injectObj) (struct CDKOBJS *, chtype);
void (*focusObj) (struct CDKOBJS *);
void (*unfocusObj) (struct CDKOBJS *);
void (*saveDataObj) (struct CDKOBJS *);
void (*refreshDataObj) (struct CDKOBJS *);
void (*destroyObj) (struct CDKOBJS *);
/* line-drawing */
void (*setULcharObj) (struct CDKOBJS *, chtype);
void (*setURcharObj) (struct CDKOBJS *, chtype);
void (*setLLcharObj) (struct CDKOBJS *, chtype);
void (*setLRcharObj) (struct CDKOBJS *, chtype);
void (*setVTcharObj) (struct CDKOBJS *, chtype);
void (*setHZcharObj) (struct CDKOBJS *, chtype);
void (*setBXattrObj) (struct CDKOBJS *, chtype);
/* background attribute */
void (*setBKattrObj) (struct CDKOBJS *, chtype);
} CDKFUNCS;
/* The cast is needed because traverse.c wants to use CDKOBJS pointers */
#define ObjPtr(p) ((CDKOBJS*)(p))
#define MethodPtr(p,m) ((ObjPtr(p))->fn->m)
/* Use these when we're certain it is a CDKOBJS pointer */
#define ObjTypeOf(p) MethodPtr(p,objectType)
#define DataTypeOf(p) MethodPtr(p,returnType)
#define DrawObj(p) MethodPtr(p,drawObj) (p,p->box)
#define EraseObj(p) MethodPtr(p,eraseObj) (p)
#define DestroyObj(p) MethodPtr(p,destroyObj) (p)
#define InjectObj(p,k) MethodPtr(p,injectObj) (p,(k))
#define InputWindowObj(p) MethodPtr(p,inputWindowObj) (p)
#define FocusObj(p) MethodPtr(p,focusObj) (p)
#define UnfocusObj(p) MethodPtr(p,unfocusObj) (p)
#define SaveDataObj(p) MethodPtr(p,saveDataObj) (p)
#define RefreshDataObj(p) MethodPtr(p,refreshDataObj) (p)
#define SetBackAttrObj(p,c) MethodPtr(p,setBKattrObj) (p,c)
#define AcceptsFocusObj(p) (ObjPtr(p)->acceptsFocus)
#define HasFocusObj(p) (ObjPtr(p)->hasFocus)
#define IsVisibleObj(p) (ObjPtr(p)->isVisible)
#define InputWindowOf(p) (ObjPtr(p)->inputWindow)
/*
* Data common to all objects (widget instances). This appears first in
* each widget's struct to allow us to use generic functions in binding.c,
* cdkscreen.c, position.c, etc.
*/
typedef struct CDKOBJS {
int screenIndex;
CDKSCREEN * screen;
const CDKFUNCS * fn;
boolean box;
int borderSize;
boolean acceptsFocus;
boolean hasFocus;
boolean isVisible;
WINDOW * inputWindow;
void * dataPtr;
CDKDataUnion resultData;
unsigned bindingCount;
CDKBINDING * bindingList;
/* title-drawing */
chtype ** title;
int * titlePos;
int * titleLen;
int titleLines;
/* line-drawing (see 'box') */
chtype ULChar; /* lines: upper-left */
chtype URChar; /* lines: upper-right */
chtype LLChar; /* lines: lower-left */
chtype LRChar; /* lines: lower-right */
chtype VTChar; /* lines: vertical */
chtype HZChar; /* lines: horizontal */
chtype BXAttr;
/* events */
EExitType exitType;
EExitType earlyExit;
/* pre/post-processing */
PROCESSFN preProcessFunction;
void * preProcessData;
PROCESSFN postProcessFunction;
void * postProcessData;
} CDKOBJS;
#define ObjOf(ptr) (&(ptr)->obj)
#define MethodOf(ptr) (ObjOf(ptr)->fn)
#define ScreenOf(ptr) (ObjOf(ptr)->screen)
#define WindowOf(ptr) (ScreenOf(ptr)->window)
#define BorderOf(p) (ObjOf(p)->borderSize)
#define ResultOf(p) (ObjOf(p)->resultData)
#define ExitTypeOf(p) (ObjOf(p)->exitType)
#define EarlyExitOf(p) (ObjOf(p)->earlyExit)
/* titles */
#define TitleOf(w) ObjOf(w)->title
#define TitlePosOf(w) ObjOf(w)->titlePos
#define TitleLenOf(w) ObjOf(w)->titleLen
#define TitleLinesOf(w) ObjOf(w)->titleLines
/* line-drawing characters */
#define ULCharOf(w) ObjOf(w)->ULChar
#define URCharOf(w) ObjOf(w)->URChar
#define LLCharOf(w) ObjOf(w)->LLChar
#define LRCharOf(w) ObjOf(w)->LRChar
#define VTCharOf(w) ObjOf(w)->VTChar
#define HZCharOf(w) ObjOf(w)->HZChar
#define BXAttrOf(w) ObjOf(w)->BXAttr
#define setULCharOf(o,c) MethodOf(o)->setULcharObj(ObjOf(o),c)
#define setURCharOf(o,c) MethodOf(o)->setURcharObj(ObjOf(o),c)
#define setLLCharOf(o,c) MethodOf(o)->setLLcharObj(ObjOf(o),c)
#define setLRCharOf(o,c) MethodOf(o)->setLRcharObj(ObjOf(o),c)
#define setVTCharOf(o,c) MethodOf(o)->setVTcharObj(ObjOf(o),c)
#define setHZCharOf(o,c) MethodOf(o)->setHZcharObj(ObjOf(o),c)
#define setBXAttrOf(o,c) MethodOf(o)->setBXattrObj(ObjOf(o),c)
#define setBKAttrOf(o,c) MethodOf(o)->setBKattrObj(ObjOf(o),c)
/* pre/post-processing */
#define PreProcessFuncOf(w) (ObjOf(w)->preProcessFunction)
#define PreProcessDataOf(w) (ObjOf(w)->preProcessData)
#define PostProcessFuncOf(w) (ObjOf(w)->postProcessFunction)
#define PostProcessDataOf(w) (ObjOf(w)->postProcessData)
/* FIXME - remove this */
#define ReturnOf(p) (ObjPtr(p)->dataPtr)
bool validCDKObject (CDKOBJS *);
void * _newCDKObject(unsigned, const CDKFUNCS *);
#define newCDKObject(type,funcs) (type *)_newCDKObject(sizeof(type),funcs)
void _destroyCDKObject (CDKOBJS *);
#define destroyCDKObject(o) _destroyCDKObject(ObjOf(o))
/* Use these for widgets that have an obj member which is a CDKOBJS struct */
#define drawCDKObject(o,box) MethodOf(o)->drawObj (ObjOf(o),box)
#define eraseCDKObject(o) MethodOf(o)->eraseObj (ObjOf(o))
#define moveCDKObject(o,x,y,rel,ref) MethodOf(o)->moveObj (ObjOf(o),x,y,rel,ref)
#define injectCDKObject(o,c,type) (MethodOf(o)->injectObj (ObjOf(o),c) ? ResultOf(o).value ## type : unknown ## type)
/* functions to set line-drawing are bound to cdk_objs.c if the widget is
* simple, but are built into the widget for complex widgets.
*/
#define DeclareSetXXchar(storage,line) \
storage void line ## ULchar(struct CDKOBJS *, chtype); \
storage void line ## URchar(struct CDKOBJS *, chtype); \
storage void line ## LLchar(struct CDKOBJS *, chtype); \
storage void line ## LRchar(struct CDKOBJS *, chtype); \
storage void line ## VTchar(struct CDKOBJS *, chtype); \
storage void line ## HZchar(struct CDKOBJS *, chtype); \
storage void line ## BXattr(struct CDKOBJS *, chtype)
DeclareSetXXchar(extern,setCdk);
#define DeclareCDKObjects(upper, mixed, line, type) \
static int _injectCDK ## mixed (struct CDKOBJS *, chtype); \
static void _destroyCDK ## mixed (struct CDKOBJS *); \
static void _drawCDK ## mixed (struct CDKOBJS *, boolean); \
static void _eraseCDK ## mixed (struct CDKOBJS *); \
static void _focusCDK ## mixed (struct CDKOBJS *); \
static void _moveCDK ## mixed (struct CDKOBJS *, int, int, boolean, boolean); \
static void _refreshDataCDK ## mixed (struct CDKOBJS *); \
static void _saveDataCDK ## mixed (struct CDKOBJS *); \
static void _unfocusCDK ## mixed (struct CDKOBJS *); \
static void _setBKattr ## mixed (struct CDKOBJS *, chtype); \
static const CDKFUNCS my_funcs = { \
v ## upper, \
DataType ## type, \
_drawCDK ## mixed, \
_eraseCDK ## mixed, \
_moveCDK ## mixed, \
_injectCDK ## mixed, \
_focusCDK ## mixed, \
_unfocusCDK ## mixed, \
_saveDataCDK ## mixed, \
_refreshDataCDK ## mixed, \
_destroyCDK ## mixed, \
line ## ULchar, \
line ## URchar, \
line ## LLchar, \
line ## LRchar, \
line ## VTchar, \
line ## HZchar, \
line ## BXattr, \
_setBKattr ## mixed, \
}
/*
* Some methods are unused. Define macros to represent dummy methods
* to make it simple to maintain them.
*/
#define dummyInject(mixed) \
static int _injectCDK ## mixed (CDKOBJS * object GCC_UNUSED, chtype input GCC_UNUSED) \
{ \
return 0; \
}
#define dummyFocus(mixed) \
static void _focusCDK ## mixed (CDKOBJS * object GCC_UNUSED) \
{ \
}
#define dummyUnfocus(mixed) \
static void _unfocusCDK ## mixed (CDKOBJS * object GCC_UNUSED) \
{ \
}
#define dummySaveData(mixed) \
static void _saveDataCDK ## mixed (CDKOBJS * object GCC_UNUSED) \
{ \
}
#define dummyRefreshData(mixed) \
static void _refreshDataCDK ## mixed (CDKOBJS * object GCC_UNUSED) \
{ \
}
/*
* Read keycode from object, optionally translating bindings.
* Depcrecated: use getchCDKObject().
*/
extern int getcCDKObject (
CDKOBJS * /* object */);
/*
* Read keycode from object, optionally translating bindings. Set a flag to
* tell if the keycode is a function key.
*/
extern int getchCDKObject (
CDKOBJS * /* object */,
boolean * /* functionKey */);
/*
* Interactively reposition an object within a window.
*/
extern void positionCDKObject (
CDKOBJS * /* object */,
WINDOW * /* win */);
/*
* Pre/postprocessing.
*/
extern void setCDKObjectPreProcess (
CDKOBJS * /* object */,
PROCESSFN /* func */,
void * /* data */);
extern void setCDKObjectPostProcess (
CDKOBJS * /* object */,
PROCESSFN /* func */,
void * /* data */);
/*
* Background color.
*/
extern void setCDKObjectBackgroundColor (
CDKOBJS * /* object */,
const char * /* color */);
/* title-storage is implemented identically with all widgets */
extern int setCdkTitle (CDKOBJS *, const char *, int);
extern void drawCdkTitle (WINDOW *, CDKOBJS *);
extern void cleanCdkTitle (CDKOBJS *);
#define setCdkEarlyExit(p,q) EarlyExitOf(p) = q
extern void setCdkExitType(
CDKOBJS * /* obj */,
EExitType * /* type */,
chtype /* ch */);
#ifdef __cplusplus
}
#endif
#endif /* CDK_OBJS_H */
#endif /* CDKINCLUDES */

View File

@@ -0,0 +1,143 @@
/*
* $Id: cdk_params.h,v 1.7 2012/03/21 21:15:30 tom Exp $
*/
#ifndef CDKINCLUDES
#ifndef CDK_PARAMS_H
#define CDK_PARAMS_H
#ifdef __cplusplus
extern "C" {
#endif
#ifndef CDK_H
#define CDKINCLUDES
#include <cdk.h>
#undef CDKINCLUDES
#endif
/*
* Copyright 2003-2005,2012 Thomas E. Dickey
* All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions
* are met:
* 1. Redistributions of source code must retain the above copyright
* notice, this list of conditions and the following disclaimer.
* 2. Redistributions in binary form must reproduce the above copyright
* notice, this list of conditions and the following disclaimer in the
* documentation and/or other materials provided with the distribution.
* 3. All advertising materials mentioning features or use of this software
* must display the following acknowledgment:
* This product includes software developed by Thomas Dickey
* and contributors.
* 4. Neither the name of Thomas Dickey, nor the names of contributors
* may be used to endorse or promote products derived from this software
* without specific prior written permission.
*
* THIS SOFTWARE IS PROVIDED BY THOMAS DICKEY AND CONTRIBUTORS ``AS IS'' AND
* ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
* IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
* ARE DISCLAIMED. IN NO EVENT SHALL THOMAS DICKEY OR CONTRIBUTORS BE LIABLE
* FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
* DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
* OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
* HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
* LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
* OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
* SUCH DAMAGE.
*/
#define MAX_CDK_PARAMS 256
/*
* CDKparseParams() knows about these options and will decode them into
* the CDK_PARAMS struct. They are the most generally useful for positioning
* a widget.
*/
#define CDK_MIN_PARAMS "NSX:Y:"
#define CDK_CLI_PARAMS "NSX:Y:H:W:"
/*
* Use this exit code rather than -1 for cli programs which have reported an
* error. Actually EXIT_FAILURE would be better, but the shell script samples
* all are written to assume that the exit code can be used to indicate a
* button number, etc.
*/
#define CLI_ERROR 255
/*
* This records the values that CDKparseParams() decodes using getopt():
*/
typedef struct CDK_PARAMS {
char * allParams[MAX_CDK_PARAMS];
bool Box;
bool Shadow;
int hValue;
int wValue;
int xValue;
int yValue;
} CDK_PARAMS;
/*
* Parse the given argc/argv command-line, with the options passed to
* getopt()'s 3rd parameter.
*/
void CDKparseParams (
int /* argc */,
char ** /* argv */,
CDK_PARAMS * /* params */,
const char * /* options */);
/*
* Parse the string as one of CDK's positioning keywords, or an actual
* position.
*/
int CDKparsePosition (
const char * /* string */);
/*
* Retrieve an integer (or boolean) option value from the parsed command-line.
*/
int CDKparamNumber (
CDK_PARAMS * /* params */,
int /* option */);
/*
* Retrieve an optional integer (or boolean) value from the parsed command-line.
*/
int CDKparamNumber2 (
CDK_PARAMS * /* params */,
int /* option */,
int /* missing */);
/*
* Retrieve a string option value from the parsed command-line.
*/
char * CDKparamString (
CDK_PARAMS * /* params */,
int /* option */);
/*
* Retrieve an optional string option value from the parsed command-line.
*/
char * CDKparamString2 (
CDK_PARAMS * /* params */,
int /* option */,
const char * /* missing */);
/*
* Retrieve an integer (or boolean) option value from the parsed command-line.
*/
int CDKparamValue (
CDK_PARAMS * /* params */,
int /* option */,
int /* missing */);
#ifdef __cplusplus
}
#endif
#endif /* CDK_PARAMS_H */
#endif /* CDKINCLUDES */

View File

@@ -0,0 +1,89 @@
/*
* $Id: cdk_test.h,v 1.5 2008/11/01 17:07:37 tom Exp $
*/
#ifndef CDKINCLUDES
#ifndef CDK_TEST_H
#define CDK_TEST_H
#ifdef __cplusplus
extern "C" {
#endif
#include <cdk.h>
/*
* Copyright 2005,2008 Thomas E. Dickey
* All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions
* are met:
* 1. Redistributions of source code must retain the above copyright
* notice, this list of conditions and the following disclaimer.
* 2. Redistributions in binary form must reproduce the above copyright
* notice, this list of conditions and the following disclaimer in the
* documentation and/or other materials provided with the distribution.
* 3. All advertising materials mentioning features or use of this software
* must display the following acknowledgment:
* This product includes software developed by Thomas Dickey
* and contributors.
* 4. Neither the name of Thomas Dickey, nor the names of contributors
* may be used to endorse or promote products derived from this software
* without specific prior written permission.
*
* THIS SOFTWARE IS PROVIDED BY THOMAS DICKEY AND CONTRIBUTORS ``AS IS'' AND
* ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
* IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
* ARE DISCLAIMED. IN NO EVENT SHALL THOMAS DICKEY OR CONTRIBUTORS BE LIABLE
* FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
* DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
* OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
* HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
* LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
* OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
* SUCH DAMAGE.
*/
/*
* The whole point of this header is to define ExitProgram(), which is used for
* leak-checking when ncurses's _nc_free_and_exit() function is available.
* Invoking that rather than 'exit()' tells ncurses to free all of the
* "permanent" memory leaks, making analysis much simpler.
*/
#ifdef HAVE_NC_ALLOC_H
#ifndef HAVE_LIBDBMALLOC
#define HAVE_LIBDBMALLOC 0
#endif
#ifndef HAVE_LIBDMALLOC
#define HAVE_LIBDMALLOC 0
#endif
#ifndef HAVE_LIBMPATROL
#define HAVE_LIBMPATROL 0
#endif
#include <nc_alloc.h>
#else
#if defined(NCURSES_VERSION) && defined(HAVE__NC_FREE_AND_EXIT)
/* nc_alloc.h normally not installed */
extern void _nc_free_and_exit(int) GCC_NORETURN;
#define ExitProgram(code) _nc_free_and_exit(code)
#endif
#endif /* HAVE_NC_ALLOC_H */
#ifndef ExitProgram
#define ExitProgram(code) exit(code)
#endif
#ifdef __cplusplus
}
#endif
#endif /* CDK_TEST_H */
#endif /* CDKINCLUDES */

442
deps/cdk-5.0-20161210/include/cdk_util.h vendored Normal file
View File

@@ -0,0 +1,442 @@
/*
* $Id: cdk_util.h,v 1.35 2014/01/19 01:58:31 tom Exp $
*/
#ifndef CDKINCLUDES
#ifndef CDKUTIL_H
#define CDKUTIL_H 1
#ifdef __cplusplus
extern "C" {
#endif
#ifndef CDK_H
#define CDKINCLUDES
#include <cdk.h>
#undef CDKINCLUDES
#include <binding.h>
#include <cdkscreen.h>
#endif
/*
* Changes 1999-2012,2014 copyright Thomas E. Dickey
*
* Copyright 1999, Mike Glover
* All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions
* are met:
* 1. Redistributions of source code must retain the above copyright
* notice, this list of conditions and the following disclaimer.
* 2. Redistributions in binary form must reproduce the above copyright
* notice, this list of conditions and the following disclaimer in the
* documentation and/or other materials provided with the distribution.
* 3. All advertising materials mentioning features or use of this software
* must display the following acknowledgment:
* This product includes software developed by Mike Glover
* and contributors.
* 4. Neither the name of Mike Glover, nor the names of contributors
* may be used to endorse or promote products derived from this software
* without specific prior written permission.
*
* THIS SOFTWARE IS PROVIDED BY MIKE GLOVER AND CONTRIBUTORS ``AS IS'' AND
* ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
* IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
* ARE DISCLAIMED. IN NO EVENT SHALL MIKE GLOVER OR CONTRIBUTORS BE LIABLE
* FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
* DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
* OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
* HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
* LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
* OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
* SUCH DAMAGE.
*/
/*
* This beeps at the user. The standard curses beep() does not
* flush the stream, so it will only beep until a force is made.
* This forces a flush after issuing the beep command.
*/
void Beep(void);
/*
* This aligns a 'box' on the given window with the height and
* width given.
*/
void alignxy (
WINDOW * /* window */,
int * /* xpos */,
int * /* ypos */,
int /* boxWidth */,
int /* boxHeight */);
/*
* This takes a string, a field width and a justification type and returns the
* justification adjustment to make, to fill the justification requirement.
*/
int justifyString (
int /* fieldWidth */,
int /* mesglen */,
int /* justify */);
/*
* This is a quick little popup label widget.
*/
void popupLabel (
CDKSCREEN * /* win */,
CDK_CSTRING2 /* mesg */,
int /* count */);
/*
* This is a quick little popup label widget.
*/
void popupLabelAttrib (
CDKSCREEN * /* win */,
CDK_CSTRING2 /* mesg */,
int /* count */,
chtype /* attribute */);
/*
* This is a quick little popup dialog box.
*/
int popupDialog (
CDKSCREEN * /* screen */,
CDK_CSTRING2 /* mesg */,
int /* mesgCount */,
CDK_CSTRING2 /* buttons */,
int /* buttonCount */);
/*
* This pops up a scrolling list and returns the value selected.
*/
int getListIndex (
CDKSCREEN * /* screen */,
const char * /* title */,
CDK_CSTRING2 /* list */,
int /* listSize */,
boolean /* numbers */);
/*
* This gets a simple string value from a user.
*/
char *getString (
CDKSCREEN * /* screen */,
const char * /* title */,
const char * /* label */,
const char * /* init */);
/*
* This allows a user to view a file.
*/
int viewFile (
CDKSCREEN * /* screen */,
const char * /* title */,
const char * /* filename */,
CDK_CSTRING2 /* buttons */,
int /* buttonCount */);
/*
* This allows a person to select a file.
*/
char *selectFile (
CDKSCREEN * /* screen */,
const char * /* title */);
/*
* This allows people to view information in an array.
*/
int viewInfo (
CDKSCREEN * /* screen */,
const char * /* title */,
CDK_CSTRING2 /* info */,
int /* size */,
CDK_CSTRING2 /* buttons */,
int /* buttonCount */,
boolean /* interpret */);
/*
* This is a wrapper for qsort.
*/
void sortList (
CDK_CSTRING * /* list */,
int /* length */);
/*
* This reads a file, loads the contents into info and
* returns the number of lines read.
*/
int CDKreadFile (
const char * /* filename */,
char *** /* info */);
/*
* This strips white space from the front/back of the given
* string. The stripType is one of: vFRONT, vBACK, vBOTH.
*/
void stripWhiteSpace (
EStripType /* stripType */,
char * /* string */);
/*
* These functions are used to manage a string which is split into parts, e.g.,
* a file which is read into memory.
*/
char **CDKsplitString(
const char * /* string */,
int /* separator */);
unsigned CDKallocStrings(
char *** /* list */,
char * /* item */,
unsigned /* length */,
unsigned /* used */);
unsigned CDKcountStrings(
CDK_CSTRING2 /* list */);
void CDKfreeStrings(
char ** /* list */);
/*
* Free a list of chtype-strings, terminated by a null pointer.
*/
void CDKfreeChtypes(
chtype ** /* list */);
/*
* This returns the length of an integer.
*/
int intlen (
int /* value */);
/*
* This opens the given directory and reads in the contents. It stores
* the results in 'list' and returns the number of elements found.
*/
int CDKgetDirectoryContents (
const char * /* directory */,
char *** /* list */);
/*
* This looks for the given pattern in the given list.
*/
int searchList (
CDK_CSTRING2 /* list */,
int /* listSize */,
const char * /* pattern */);
/*
* This returns the basename of a file.
*/
char *baseName (
char * /* filename */);
/*
* This returns the directory name of a file.
*/
char *dirName (
char * /* filename */);
/*
* This frees the memory used by the given string.
*/
void freeChar (
char * /* string */);
/*
* This frees the memory used by the given string.
*/
void freeChtype (
chtype * /* string */);
/*
* This frees the memory used by the given list of strings.
*/
void freeCharList (
char ** /* list */,
unsigned /* size */);
/*
* This frees the memory used by the given list of strings.
*/
void freeChtypeList (
chtype ** /* list */,
unsigned /* size */);
/*
* This sets the elements of the given string to 'character'
*/
void cleanChar (
char * /* string */,
int /* length */,
char /* character */);
/*
* This sets the elements of the given string to 'character'
*/
void cleanChtype (
chtype * /* string */,
int /* length */,
chtype /* character */);
/*
* This takes a chtype pointer and returns a char pointer.
*/
char *chtype2Char (
const chtype * /* string */);
/*
* This takes a chtype pointer and returns a char pointer with embedded
* formatting information.
*/
char *chtype2String (
const chtype * /* string */);
/*
* This takes a char pointer and returns a chtype pointer.
*/
chtype *char2Chtype (
const char * /* string */,
int * /* length */,
int * /* align */);
/*
* Compare a char string to a chtype string
*/
int cmpStrChstr(const char * /* str */,
const chtype * /* chstr */);
/*
* Copy from a chtype string to a char string
*/
void chstrncpy(char * /* dest */,
const chtype * /* src */,
int /* maxcount */);
/*
* Given a character pointer, returns the equivalent display type.
*/
EDisplayType char2DisplayType (
const char * /* string */);
/*
* Tell if a display type is "hidden"
*/
boolean isHiddenDisplayType (
EDisplayType /* type */);
/*
* Filter an input character according to the display type.
*/
int filterByDisplayType(
EDisplayType /* type */,
chtype /* input */);
/*
* Copy the given string.
*/
chtype *copyChtype (
const chtype * /* string */);
/*
* Copy the given string.
*/
char *copyChar (
const char * /* string */);
/*
* Copy the given list.
*/
char **copyCharList (
const char ** /* list */);
/*
* Copy the given list.
*/
chtype **copyChtypeList (
const chtype ** /* list */);
/*
* Return the length of the given string.
*/
int chlen (
const chtype * /* string */);
/*
* Return the length of the given list.
*/
int lenCharList (
const char ** /* list */);
int lenChtypeList (
const chtype ** /* list */);
/*
* This takes a file mode and returns the first character of the file
* permissions string.
*/
int mode2Filetype (
mode_t /* fileMode */);
/*
* This takes a file mode and stores the character representation
* of the mode in 'string'. This also returns the octal value
* of the file mode.
*/
int mode2Char (
char * /* string */,
mode_t /* fileMode */);
/*
* This looks for a link. (used by the </L> pattern)
*/
int checkForLink (
const char * /* line */,
char * /* filename */);
/*
* This function help set the height/width values of a widget.
*/
int setWidgetDimension (
int /* parentDim */,
int /* proposedDim */,
int /* adjustment */);
/*
* This safely erases a given window.
*/
void eraseCursesWindow (
WINDOW * /* window */);
/*
* This safely deletes a given window.
*/
void deleteCursesWindow (
WINDOW * /* window */);
/*
* This moves a given window
*/
void moveCursesWindow (
WINDOW * /* window */,
int /* xdiff */,
int /* ydiff */);
/*
* Return an integer like 'floor()', which returns a double.
*/
int floorCDK(double);
/*
* Return an integer like 'ceil()', which returns a double.
*/
int ceilCDK(double);
#ifdef __cplusplus
}
#endif
#endif /* CDKUTIL_H */
#endif /* CDKINCLUDES */

View File

@@ -0,0 +1,56 @@
/*
* $Id: cdk_version.hin,v 1.2 2012/03/20 22:10:36 tom Exp $
*/
#ifndef CDK_VERSION_H
#define CDK_VERSION_H
#ifdef __cplusplus
extern "C" {
#endif
/*
* Copyright 2002,2012 Thomas E. Dickey
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions
* are met:
* 1. Redistributions of source code must retain the above copyright
* notice, this list of conditions and the following disclaimer.
* 2. Redistributions in binary form must reproduce the above copyright
* notice, this list of conditions and the following disclaimer in the
* documentation and/or other materials provided with the distribution.
* 3. All advertising materials mentioning features or use of this software
* must display the following acknowledgment:
* This product includes software developed by Thomas E. Dickey
* and contributors.
* 4. Neither the name of Thomas E. Dickey, nor the names of contributors
* may be used to endorse or promote products derived from this software
* without specific prior written permission.
*
* THIS SOFTWARE IS PROVIDED BY THOMAS E. DICKEY AND CONTRIBUTORS ``AS IS''
* AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
* IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
* ARE DISCLAIMED. IN NO EVENT SHALL THOMAS E. DICKEY OR CONTRIBUTORS BE
* LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
* CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
* SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
* INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
* CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
* ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
* POSSIBILITY OF SUCH DAMAGE.
*/
#define CDK_VERSION_MAJOR "@VERSION_MAJOR@"
#define CDK_VERSION_MINOR "@VERSION_MINOR@"
#define CDK_VERSION_PATCH "@VERSION_PATCH@"
/*
* Runtime to return the same version information.
*/
const char *CDKVersion (void);
#ifdef __cplusplus
}
#endif
#endif /* CDK_VERSION_H */

View File

@@ -0,0 +1,188 @@
/*
* $Id: cdkscreen.h,v 1.18 2016/11/20 14:42:21 tom Exp $
*/
#ifndef CDKINCLUDES
#ifndef CDKSCREEN_H
#define CDKSCREEN_H 1
#ifdef __cplusplus
extern "C" {
#endif
#ifndef CDK_H
#define CDKINCLUDES
#include <cdk.h>
#undef CDKINCLUDES
#endif
/*
* Changes 1999-2015,2016 copyright Thomas E. Dickey
*
* Copyright 1999, Mike Glover
* All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions
* are met:
* 1. Redistributions of source code must retain the above copyright
* notice, this list of conditions and the following disclaimer.
* 2. Redistributions in binary form must reproduce the above copyright
* notice, this list of conditions and the following disclaimer in the
* documentation and/or other materials provided with the distribution.
* 3. All advertising materials mentioning features or use of this software
* must display the following acknowledgment:
* This product includes software developed by Mike Glover
* and contributors.
* 4. Neither the name of Mike Glover, nor the names of contributors
* may be used to endorse or promote products derived from this software
* without specific prior written permission.
*
* THIS SOFTWARE IS PROVIDED BY MIKE GLOVER AND CONTRIBUTORS ``AS IS'' AND
* ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
* IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
* ARE DISCLAIMED. IN NO EVENT SHALL MIKE GLOVER OR CONTRIBUTORS BE LIABLE
* FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
* DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
* OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
* HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
* LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
* OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
* SUCH DAMAGE.
*/
/*
* Declare and definitions needed for the widget.
*/
#define MAX_OBJECTS 1000 /* not used by widgets */
struct CDKOBJS;
typedef enum {
CDKSCREEN_NOEXIT = 0
, CDKSCREEN_EXITOK
, CDKSCREEN_EXITCANCEL
} EExitStatus;
/*
* Define the CDK screen structure.
*/
struct SScreen {
WINDOW * window;
struct CDKOBJS ** object;
int objectCount; /* last-used index in object[] */
int objectLimit; /* sizeof(object[]) */
EExitStatus exitStatus;
int objectFocus; /* focus index in object[] */
};
typedef struct SScreen CDKSCREEN;
/*
* This function creates a CDKSCREEN pointer.
*/
CDKSCREEN *initCDKScreen (
WINDOW * /* window */);
/*
* This sets which CDKSCREEN pointer will be the default screen
* in the list of managed screen.
*/
CDKSCREEN *setDefaultCDKScreen (
int /* screenNumber */);
/*
* This function registers a CDK widget with a given screen.
*/
void registerCDKObject (
CDKSCREEN * /* screen */,
EObjectType /* cdktype */,
void * /* object */);
/*
* This function registers a CDK widget with it's former screen.
*/
void reRegisterCDKObject (
EObjectType /* cdktype */,
void * /* object */);
/*
* This unregisters a CDK widget from a screen.
*/
void unregisterCDKObject (
EObjectType /* cdktype */,
void * /* object */);
/*
* This function raises a widget on a screen to the top of the widget
* stack of the screen the widget is associated with. The side effect
* of doing this is the widget will be on 'top' of all the other
* widgets on their screens.
*/
void raiseCDKObject (
EObjectType /* cdktype */,
void * /* object */);
/*
* This function lowers a widget on a screen to the bottom of the widget
* stack of the screen the widget is associated with. The side effect
* of doing this is that all the other widgets will be on 'top' of the
* widget on their screens.
*/
void lowerCDKObject (
EObjectType /* cdktype */,
void * /* object */);
/*
* This redraws a window, forcing it to the top of the stack.
*/
void refreshCDKWindow (
WINDOW * /* win */);
/*
* This redraws all the widgets associated with the given screen.
*/
void refreshCDKScreen (
CDKSCREEN * /* screen */);
/*
* This calls refreshCDKScreen. (it is here to try to be consistent
* with the drawCDKXXX functions associated with the widgets)
*/
void drawCDKScreen (
CDKSCREEN * /* screen */);
/*
* This removes all the widgets from the screen.
*/
void eraseCDKScreen (
CDKSCREEN * /* screen */);
/*
* Destroy all of the widgets on a screen
*/
void destroyCDKScreenObjects (CDKSCREEN *cdkscreen);
/*
* This frees up any memory the CDKSCREEN pointer used.
*/
void destroyCDKScreen (
CDKSCREEN * /* screen */);
/*
* This shuts down curses and everything else needed to
* exit cleanly.
*/
void endCDK(void);
/*
* This creates all the color pairs.
*/
void initCDKColor(void);
#ifdef __cplusplus
}
#endif
#endif /* CDKSCREEN_H */
#endif /* CDKINCLUDES */

View File

@@ -0,0 +1,14 @@
/*
* $Id: config.hin,v 1.2 2000/01/17 14:48:19 tom Exp $
*/
#ifndef CDK_CONFIG_H
#define CDK_CONFIG_H 1
@DEFS@
#if !defined(HAVE_LSTAT) && !defined(lstat)
#define lstat(f,b) stat(f,b)
#endif
#endif /* CDK_CONFIG_H */

152
deps/cdk-5.0-20161210/include/curdefs.h vendored Normal file
View File

@@ -0,0 +1,152 @@
#ifndef CDKINCLUDES
#ifndef CURDEF_H
#define CURDEF_H
#ifndef CDK_H
#define CDKINCLUDES
#include <cdk.h>
#undef CDKINCLUDES
#endif
/*
* $Id: curdefs.h,v 1.16 2009/02/16 00:33:50 tom Exp $
*
* Changes 1999-2004,2009 copyright Thomas E. Dickey
* Copyright 1999, Mike Glover
* All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions
* are met:
* 1. Redistributions of source code must retain the above copyright
* notice, this list of conditions and the following disclaimer.
* 2. Redistributions in binary form must reproduce the above copyright
* notice, this list of conditions and the following disclaimer in the
* documentation and/or other materials provided with the distribution.
* 3. All advertising materials mentioning features or use of this software
* must display the following acknowledgment:
* This product includes software developed by Mike Glover
* and contributors.
* 4. Neither the name of Mike Glover, nor the names of contributors
* may be used to endorse or promote products derived from this software
* without specific prior written permission.
*
* THIS SOFTWARE IS PROVIDED BY MIKE GLOVER AND CONTRIBUTORS ``AS IS'' AND
* ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
* IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
* ARE DISCLAIMED. IN NO EVENT SHALL MIKE GLOVER OR CONTRIBUTORS BE LIABLE
* FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
* DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
* OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
* HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
* LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
* OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
* SUCH DAMAGE.
*/
/*
* This header file adds some useful curses-style definitions.
*/
#undef CTRL
#define CTRL(c) ((c)&0x1f)
#undef CDK_REFRESH
#define CDK_REFRESH CTRL('L')
#undef CDK_PASTE
#define CDK_PASTE CTRL('V')
#undef CDK_COPY
#define CDK_COPY CTRL('Y')
#undef CDK_ERASE
#define CDK_ERASE CTRL('U')
#undef CDK_CUT
#define CDK_CUT CTRL('X')
#undef CDK_BEGOFLINE
#define CDK_BEGOFLINE CTRL('A')
#undef CDK_ENDOFLINE
#define CDK_ENDOFLINE CTRL('E')
#undef CDK_BACKCHAR
#define CDK_BACKCHAR CTRL('B')
#undef CDK_FORCHAR
#define CDK_FORCHAR CTRL('F')
#undef CDK_TRANSPOSE
#define CDK_TRANSPOSE CTRL('T')
#undef CDK_NEXT
#define CDK_NEXT CTRL('N')
#undef CDK_PREV
#define CDK_PREV CTRL('P')
#undef SPACE
#define SPACE ' '
#undef DELETE
#define DELETE '\177' /* Delete key */
#undef TAB
#define TAB '\t' /* Tab key. */
#undef KEY_ESC
#define KEY_ESC '\033' /* Escape Key. */
#undef KEY_RETURN
#define KEY_RETURN '\012' /* Return key */
#undef KEY_TAB
#define KEY_TAB '\t' /* Tab key */
#undef KEY_F1
#define KEY_F1 KEY_F(1)
#undef KEY_F2
#define KEY_F2 KEY_F(2)
#undef KEY_F3
#define KEY_F3 KEY_F(3)
#undef KEY_F4
#define KEY_F4 KEY_F(4)
#undef KEY_F5
#define KEY_F5 KEY_F(5)
#undef KEY_F6
#define KEY_F6 KEY_F(6)
#undef KEY_F7
#define KEY_F7 KEY_F(7)
#undef KEY_F8
#define KEY_F8 KEY_F(8)
#undef KEY_F9
#define KEY_F9 KEY_F(9)
#undef KEY_F10
#define KEY_F10 KEY_F(10)
#undef KEY_F11
#define KEY_F11 KEY_F(11)
#undef KEY_F12
#define KEY_F12 KEY_F(12)
#define KEY_ERROR ((chtype)ERR)
/* these definitions may work for antique versions of curses */
#if !defined(HAVE_GETBEGYX) && !defined(getbegyx)
#define getbegyx(win,y,x) (y = (win)?(win)->_begy:ERR, x = (win)?(win)->_begx:ERR)
#endif
#if !defined(HAVE_GETMAXYX) && !defined(getmaxyx)
#define getmaxyx(win,y,x) (y = (win)?(win)->_maxy:ERR, x = (win)?(win)->_maxx:ERR)
#endif
/* these definitions may be needed for bleeding-edge curses implementations */
#if !(defined(HAVE_GETBEGX) && defined(HAVE_GETBEGY))
#undef getbegx
#undef getbegy
#define getbegx(win) cdk_getbegx(win)
#define getbegy(win) cdk_getbegy(win)
extern int cdk_getbegx(WINDOW *);
extern int cdk_getbegy(WINDOW *);
#endif
#if !(defined(HAVE_GETMAXX) && defined(HAVE_GETMAXY))
#undef getmaxx
#undef getmaxy
#define getmaxx(win) cdk_getmaxx(win)
#define getmaxy(win) cdk_getmaxy(win)
extern int cdk_getmaxx(WINDOW *);
extern int cdk_getmaxy(WINDOW *);
#endif
/*
* Derived macros
*/
#define getendx(a) (getbegx(a) + getmaxx(a))
#define getendy(a) (getbegy(a) + getmaxy(a))
#endif /* CURDEF_H */
#endif /* CDKINCLUDES */

220
deps/cdk-5.0-20161210/include/dialog.h vendored Normal file
View File

@@ -0,0 +1,220 @@
/*
* $Id: dialog.h,v 1.26 2012/03/21 21:15:30 tom Exp $
*/
#ifndef CDKINCLUDES
#ifndef CDKDIALOG_H
#define CDKDIALOG_H 1
#ifdef __cplusplus
extern "C" {
#endif
#ifndef CDK_H
#define CDKINCLUDES
#include <cdk.h>
#undef CDKINCLUDES
#include <binding.h>
#include <cdkscreen.h>
#include <cdk_objs.h>
#endif
/*
* Changes 1999-2003,2012 copyright Thomas E. Dickey
*
* Copyright 1999, Mike Glover
* All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions
* are met:
* 1. Redistributions of source code must retain the above copyright
* notice, this list of conditions and the following disclaimer.
* 2. Redistributions in binary form must reproduce the above copyright
* notice, this list of conditions and the following disclaimer in the
* documentation and/or other materials provided with the distribution.
* 3. All advertising materials mentioning features or use of this software
* must display the following acknowledgment:
* This product includes software developed by Mike Glover
* and contributors.
* 4. Neither the name of Mike Glover, nor the names of contributors
* may be used to endorse or promote products derived from this software
* without specific prior written permission.
*
* THIS SOFTWARE IS PROVIDED BY MIKE GLOVER AND CONTRIBUTORS ``AS IS'' AND
* ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
* IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
* ARE DISCLAIMED. IN NO EVENT SHALL MIKE GLOVER OR CONTRIBUTORS BE LIABLE
* FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
* DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
* OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
* HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
* LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
* OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
* SUCH DAMAGE.
*/
/*
* Declare definitions the dialog box may need.
*/
#define MAX_DIALOG_ROWS 50 /* unused by widgets */
#define MAX_DIALOG_BUTTONS 25 /* unused by widgets */
#define MIN_DIALOG_WIDTH 10
/*
* Define the CDK dialog structure.
*/
struct SDialogBox {
CDKOBJS obj;
WINDOW * parent;
WINDOW * win;
WINDOW * shadowWin;
chtype ** info;
int * infoLen;
int * infoPos;
chtype ** buttonLabel;
int * buttonLen;
int * buttonPos;
int messageRows;
int buttonCount;
int currentButton;
int boxWidth;
int boxHeight;
EExitType exitType;
boolean separator;
boolean shadow;
chtype highlight;
};
typedef struct SDialogBox CDKDIALOG;
/*
* This returns a CDK dialog widget pointer.
*/
CDKDIALOG *newCDKDialog (
CDKSCREEN * /* cdkscreen */,
int /* xPos */,
int /* yPos */,
CDK_CSTRING2 /* message */,
int /* Rows */,
CDK_CSTRING2 /* buttons */,
int /* buttonCount */,
chtype /* highlight */,
boolean /* separator */,
boolean /* Box */,
boolean /* shadow */);
/*
* This activates the widget.
*/
int activateCDKDialog (
CDKDIALOG * /* dialog */,
chtype * /* actions */);
/*
* This injects a single character into the widget.
*/
#define injectCDKDialog(obj,input) injectCDKObject(obj,input,Int)
/*
* This sets multiple attributes of the widget.
*/
void setCDKDialog (
CDKDIALOG * /* dialog */,
chtype /* highlight */,
boolean /* separator */,
boolean /* Box */);
/*
* This sets the highlight attribute for the buttons.
*/
void setCDKDialogHighlight (
CDKDIALOG * /* dialog */,
chtype /* highlight */);
chtype getCDKDialogHighlight (
CDKDIALOG * /* dialog */);
/*
* This sets whether or not the dialog box will have a separator line.
*/
void setCDKDialogSeparator (
CDKDIALOG * /* dialog */,
boolean /* separator */);
boolean getCDKDialogSeparator (
CDKDIALOG * /* dialog */);
/*
* This sets the box attribute of the widget.
*/
void setCDKDialogBox (
CDKDIALOG * /* dialog */,
boolean /* Box */);
boolean getCDKDialogBox (
CDKDIALOG * /* dialog */);
/*
* These set the drawing characters of the widget.
*/
#define setCDKDialogULChar(w,c) setULCharOf(w,c)
#define setCDKDialogURChar(w,c) setURCharOf(w,c)
#define setCDKDialogLLChar(w,c) setLLCharOf(w,c)
#define setCDKDialogLRChar(w,c) setLRCharOf(w,c)
#define setCDKDialogVerticalChar(w,c) setVTCharOf(w,c)
#define setCDKDialogHorizontalChar(w,c) setHZCharOf(w,c)
#define setCDKDialogBoxAttribute(w,c) setBXAttrOf(w,c)
/*
* This sets the background color of the widget.
*/
#define setCDKDialogBackgroundColor(w,c) setCDKObjectBackgroundColor(ObjOf(w),c)
/*
* This sets the background attribute of the widget.
*/
#define setCDKDialogBackgroundAttrib(w,c) setBKAttrOf(w,c)
/*
* This draws the dialog box widget.
*/
#define drawCDKDialog(obj,box) drawCDKObject(obj,box)
/*
* This erases the dialog box from the screen.
*/
#define eraseCDKDialog(obj) eraseCDKObject(obj)
/*
* This moves the dialog box to a new screen location.
*/
#define moveCDKDialog(obj,xpos,ypos,relative,refresh) moveCDKObject(obj,xpos,ypos,relative,refresh)
/*
* This allows the user to position the widget on the screen interactively.
*/
#define positionCDKDialog(widget) positionCDKObject(ObjOf(widget),widget->win)
/*
* This destroys the widget and all the memory associated with it.
*/
#define destroyCDKDialog(obj) destroyCDKObject(obj)
/*
* This draws the dialog box buttons.
*/
void drawCDKDialogButtons (
CDKDIALOG * /* dialog */);
/*
* These set the pre/post process functions of the dialog widget.
*/
#define setCDKDialogPreProcess(w,f,d) setCDKObjectPreProcess(ObjOf(w),f,d)
#define setCDKDialogPostProcess(w,f,d) setCDKObjectPostProcess(ObjOf(w),f,d)
#ifdef __cplusplus
}
#endif
#endif /* CDKDIALOG_H */
#endif /* CDKINCLUDES */

167
deps/cdk-5.0-20161210/include/draw.h vendored Normal file
View File

@@ -0,0 +1,167 @@
/*
* $Id: draw.h,v 1.10 2004/10/05 00:05:32 tom Exp $
*/
#ifndef CDKINCLUDES
#ifndef CDKDRAW_H
#define CDKDRAW_H 1
#ifdef __cplusplus
extern "C" {
#endif
#ifndef CDK_H
#define CDKINCLUDES
#include <cdk.h>
#undef CDKINCLUDES
#include <binding.h>
#include <cdkscreen.h>
#include <cdk_objs.h>
#endif
/*
* Changes 1999-2003,2004 copyright Thomas E. Dickey
*
* Copyright 1999, Mike Glover
* All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions
* are met:
* 1. Redistributions of source code must retain the above copyright
* notice, this list of conditions and the following disclaimer.
* 2. Redistributions in binary form must reproduce the above copyright
* notice, this list of conditions and the following disclaimer in the
* documentation and/or other materials provided with the distribution.
* 3. All advertising materials mentioning features or use of this software
* must display the following acknowledgment:
* This product includes software developed by Mike Glover
* and contributors.
* 4. Neither the name of Mike Glover, nor the names of contributors
* may be used to endorse or promote products derived from this software
* without specific prior written permission.
*
* THIS SOFTWARE IS PROVIDED BY MIKE GLOVER AND CONTRIBUTORS ``AS IS'' AND
* ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
* IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
* ARE DISCLAIMED. IN NO EVENT SHALL MIKE GLOVER OR CONTRIBUTORS BE LIABLE
* FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
* DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
* OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
* HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
* LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
* OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
* SUCH DAMAGE.
*/
/*
* This boxes a window.
*/
void boxWindow (
WINDOW * /* window */,
chtype /* attr */);
/*
* This draws a single line with the character supplied by 'character'
*/
void drawLine (
WINDOW * /* window */,
int /* startx */,
int /* starty */,
int /* endx */,
int /* endy */,
chtype /* character */);
/*
* This writes a blank string segment on the given window.
*/
void writeBlanks (
WINDOW * /* window */,
int /* xpos */,
int /* ypos */,
int /* align */,
int /* start */,
int /* end */);
/*
* This writes a string segment on the given window.
*/
void writeChar (
WINDOW * /* window */,
int /* xpos */,
int /* ypos */,
char * /* string */,
int /* align */,
int /* start */,
int /* end */);
/*
* This writes a string segment on the given window.
*/
void writeCharAttrib (
WINDOW * /* window */,
int /* xpos */,
int /* ypos */,
char * /* string */,
chtype /* attr */,
int /* align */,
int /* start */,
int /* end */);
/*
* This writes a string segment on the given window.
*/
void writeChtype (
WINDOW * /* window */,
int /* xpos */,
int /* ypos */,
chtype * /* string */,
int /* align */,
int /* start */,
int /* end */);
/*
* This writes a string segment on the given window.
*/
void writeChtypeAttrib (
WINDOW * /* window */,
int /* xpos */,
int /* ypos */,
chtype * /* string */,
chtype /* attr */,
int /* align */,
int /* start */,
int /* end */);
/*
* This boxes a window using the given characters.
*/
void attrbox (
WINDOW * /* window */,
chtype /* tlc */,
chtype /* trc */,
chtype /* blc */,
chtype /* brc */,
chtype /* hor */,
chtype /* vert */,
chtype /* type */);
/*
* This boxes a window using the object's characters.
*/
void drawObjBox (
WINDOW * /* win */,
CDKOBJS * /* object */);
/*
* This draws the shadow window of the widget.
*/
void drawShadow (
WINDOW * /* window */);
#ifdef __cplusplus
}
#endif
#endif /* CDKDRAW_H */
#endif /* CDKINCLUDES */

273
deps/cdk-5.0-20161210/include/entry.h vendored Normal file
View File

@@ -0,0 +1,273 @@
/*
* $Id: entry.h,v 1.29 2016/11/20 14:41:44 tom Exp $
*/
#ifndef CDKINCLUDES
#ifndef CDKENTRY_H
#define CDKENTRY_H 1
#ifdef __cplusplus
extern "C" {
#endif
#ifndef CDK_H
#define CDKINCLUDES
#include <cdk.h>
#undef CDKINCLUDES
#include <binding.h>
#include <cdkscreen.h>
#include <cdk_objs.h>
#endif
/*
* Changes 1999-2015,2016 copyright Thomas E. Dickey
*
* Copyright 1999, Mike Glover
* All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions
* are met:
* 1. Redistributions of source code must retain the above copyright
* notice, this list of conditions and the following disclaimer.
* 2. Redistributions in binary form must reproduce the above copyright
* notice, this list of conditions and the following disclaimer in the
* documentation and/or other materials provided with the distribution.
* 3. All advertising materials mentioning features or use of this software
* must display the following acknowledgment:
* This product includes software developed by Mike Glover
* and contributors.
* 4. Neither the name of Mike Glover, nor the names of contributors
* may be used to endorse or promote products derived from this software
* without specific prior written permission.
*
* THIS SOFTWARE IS PROVIDED BY MIKE GLOVER AND CONTRIBUTORS ``AS IS'' AND
* ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
* IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
* ARE DISCLAIMED. IN NO EVENT SHALL MIKE GLOVER OR CONTRIBUTORS BE LIABLE
* FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
* DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
* OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
* HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
* LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
* OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
* SUCH DAMAGE.
*/
/*
* Define the CDK entry widget structure.
*/
typedef struct SEntry CDKENTRY;
typedef void (*ENTRYCB) (struct SEntry *entry, chtype character);
struct SEntry {
CDKOBJS obj;
WINDOW * parent;
WINDOW * win;
WINDOW * shadowWin;
WINDOW * labelWin;
WINDOW * fieldWin;
chtype * label;
int labelLen;
int titleAdj;
chtype fieldAttr;
int fieldWidth;
char * info;
int infoWidth;
int screenCol;
int leftChar;
int min;
int max;
int boxWidth;
int boxHeight;
EExitType exitType;
EDisplayType dispType;
boolean shadow;
chtype filler;
chtype hidden;
ENTRYCB callbackfn;
void *callbackData;
};
/*
* This sets the callback function of the button's argument.
*/
#define setCDKEntryCBArgs(entry, argPtr) ((entry)->callbackData = (void*)(argPtr))
#define getCDKEntryCBArgs(entry, argType) ((argType) ((entry)->callbackData))
/*
* This creates a pointer to a new CDK entry widget.
*/
CDKENTRY *newCDKEntry (
CDKSCREEN * /* cdkscreen */,
int /* xpos */,
int /* ypos */,
const char * /* title */,
const char * /* label */,
chtype /* fieldAttrib */,
chtype /* filler */,
EDisplayType /* disptype */,
int /* fieldWidth */,
int /* min */,
int /* max */,
boolean /* Box */,
boolean /* shadow */);
/*
* This activates the entry widget.
*/
char *activateCDKEntry (
CDKENTRY * /* entry */,
chtype * /* actions */);
/*
* This injects a single character into the widget.
*/
#define injectCDKEntry(obj,input) injectCDKObject(obj,input,String)
/*
* This sets various attributes of the entry field.
*/
void setCDKEntry (
CDKENTRY * /* entry */,
const char * /* value */,
int /* min */,
int /* max */,
boolean /* Box */);
/*
* This sets the value of the entry field.
*/
void setCDKEntryValue (
CDKENTRY * /* entry */,
const char * /* value */);
char *getCDKEntryValue (
CDKENTRY * /* entry */);
/*
* This sets the maximum length of a string allowable for
* the given widget.
*/
void setCDKEntryMax (
CDKENTRY * /* entry */,
int /* max */);
int getCDKEntryMax (
CDKENTRY * /* entry */);
/*
* This sets the minimum length of a string allowable for
* the given widget.
*/
void setCDKEntryMin (
CDKENTRY * /* entry */,
int /* min */);
int getCDKEntryMin (
CDKENTRY * /* entry */);
/*
* This sets the filler character of the entry field.
*/
void setCDKEntryFillerChar (
CDKENTRY * /* entry */,
chtype /* fillerCharacter */);
chtype getCDKEntryFillerChar (
CDKENTRY * /* entry */);
/*
* This sets the character to use when a hidden type is used.
*/
void setCDKEntryHiddenChar (
CDKENTRY * /* entry */,
chtype /* hiddenCharacter */);
chtype getCDKEntryHiddenChar (
CDKENTRY * /* entry */);
/*
* This sets the box attribute of the widget.
*/
void setCDKEntryBox (
CDKENTRY * /* entry */,
boolean /* Box */);
boolean getCDKEntryBox (
CDKENTRY * /* entry */);
/*
* These set the drawing characters of the widget.
*/
#define setCDKEntryULChar(w,c) setULCharOf(w,c)
#define setCDKEntryURChar(w,c) setURCharOf(w,c)
#define setCDKEntryLLChar(w,c) setLLCharOf(w,c)
#define setCDKEntryLRChar(w,c) setLRCharOf(w,c)
#define setCDKEntryVerticalChar(w,c) setVTCharOf(w,c)
#define setCDKEntryHorizontalChar(w,c) setHZCharOf(w,c)
#define setCDKEntryBoxAttribute(w,c) setBXAttrOf(w,c)
/*
* This sets the background color of the widget.
*/
#define setCDKEntryBackgroundColor(w,c) setCDKObjectBackgroundColor(ObjOf(w),c)
/*
* This sets the background attribute of the widget.
*/
#define setCDKEntryBackgroundAttrib(w,c) setBKAttrOf(w,c)
/*
* This sets the attribute of the entry field.
*/
void setCDKEntryHighlight (
CDKENTRY * /* entry */,
chtype /* highlight */,
boolean /* cursor */);
/*
* This draws the entry field.
*/
#define drawCDKEntry(obj,box) drawCDKObject(obj,box)
/*
* This erases the widget from the screen.
*/
#define eraseCDKEntry(obj) eraseCDKObject(obj)
/*
* This cleans out the value of the entry field.
*/
void cleanCDKEntry (
CDKENTRY * /* entry */);
/*
* This moves the widget to the given location.
*/
#define moveCDKEntry(obj,xpos,ypos,relative,refresh) moveCDKObject(obj,xpos,ypos,relative,refresh)
/*
* This is an interactive method of moving the widget.
*/
#define positionCDKEntry(widget) positionCDKObject(ObjOf(widget),widget->win)
/*
* This destroys the widget and all the memory associated with the widget.
*/
#define destroyCDKEntry(obj) destroyCDKObject(obj)
/*
* This sets the callback to the entry fields main handler
*/
void setCDKEntryCB (
CDKENTRY * /* entry */,
ENTRYCB /* callback */);
/*
* These set the callbacks to the pre and post process functions.
*/
#define setCDKEntryPreProcess(w,f,d) setCDKObjectPreProcess(ObjOf(w),f,d)
#define setCDKEntryPostProcess(w,f,d) setCDKObjectPostProcess(ObjOf(w),f,d)
#ifdef __cplusplus
}
#endif
#endif /* CDKENTRY_H */
#endif /* CDKINCLUDES */

324
deps/cdk-5.0-20161210/include/fselect.h vendored Normal file
View File

@@ -0,0 +1,324 @@
/*
* $Id: fselect.h,v 1.25 2012/03/21 21:15:30 tom Exp $
*/
#ifndef CDKINCLUDES
#ifndef CDKFSELECT_H
#define CDKFSELECT_H 1
#ifdef __cplusplus
extern "C" {
#endif
#ifndef CDK_H
#define CDKINCLUDES
#include <cdk.h>
#undef CDKINCLUDES
#include <binding.h>
#include <cdkscreen.h>
#include <cdk_objs.h>
#include <entry.h>
#include <scroll.h>
#endif
/*
* Changes 1999-2006,2012 copyright Thomas E. Dickey
*
* Copyright 1999, Mike Glover
* All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions
* are met:
* 1. Redistributions of source code must retain the above copyright
* notice, this list of conditions and the following disclaimer.
* 2. Redistributions in binary form must reproduce the above copyright
* notice, this list of conditions and the following disclaimer in the
* documentation and/or other materials provided with the distribution.
* 3. All advertising materials mentioning features or use of this software
* must display the following acknowledgment:
* This product includes software developed by Mike Glover
* and contributors.
* 4. Neither the name of Mike Glover, nor the names of contributors
* may be used to endorse or promote products derived from this software
* without specific prior written permission.
*
* THIS SOFTWARE IS PROVIDED BY MIKE GLOVER AND CONTRIBUTORS ``AS IS'' AND
* ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
* IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
* ARE DISCLAIMED. IN NO EVENT SHALL MIKE GLOVER OR CONTRIBUTORS BE LIABLE
* FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
* DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
* OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
* HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
* LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
* OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
* SUCH DAMAGE.
*/
/*
* Define the CDK file selector widget structure.
*/
struct SFileSelector {
CDKOBJS obj;
WINDOW * parent;
WINDOW * win;
WINDOW * shadowWin;
CDKENTRY * entryField;
CDKSCROLL * scrollField;
char ** dirContents;
int fileCounter;
char * pwd;
char * pathname;
int xpos;
int ypos;
int boxHeight;
int boxWidth;
chtype fieldAttribute;
chtype fillerCharacter;
chtype highlight;
char * dirAttribute;
char * fileAttribute;
char * linkAttribute;
char * sockAttribute;
EExitType exitType;
boolean shadow;
};
typedef struct SFileSelector CDKFSELECT;
/*
* This creates a new CDK file selector widget.
*/
CDKFSELECT *newCDKFselect (
CDKSCREEN * /* cdkscreen */,
int /* xpos */,
int /* ypos */,
int /* height */,
int /* width */,
const char * /* title */,
const char * /* label */,
chtype /* fieldAttribute */,
chtype /* fillerChar */,
chtype /* highlight */,
const char * /* dirAttributes */,
const char * /* fileAttributes */,
const char * /* linkAttribute */,
const char * /* sockAttribute */,
boolean /* Box */,
boolean /* shadow */);
/*
* This activates the file selector.
*/
char *activateCDKFselect (
CDKFSELECT * /* fselect */,
chtype * /* actions */);
/*
* This injects a single character into the widget.
*/
#define injectCDKFselect(obj,input) injectCDKObject(obj,input,String)
/*
* This sets various attributes of the file selector.
*/
void setCDKFselect (
CDKFSELECT * /* fselect */,
const char * /* directory */,
chtype /* fieldAttrib */,
chtype /* filler */,
chtype /* highlight */,
const char * /* dirAttribute */,
const char * /* fileAttribute */,
const char * /* linkAttribute */,
const char * /* sockAttribute */,
boolean /* Box */);
/*
* This sets the current directory of the file selector.
*/
int setCDKFselectDirectory (
CDKFSELECT * /* fselect */,
const char * /* directory */);
char *getCDKFselectDirectory (
CDKFSELECT * /* fselect */);
/*
* This sets the filler character of the entry field.
*/
void setCDKFselectFillerChar (
CDKFSELECT * /* fselect */,
chtype /* fillerCharacter */);
chtype getCDKFselectFillerChar (
CDKFSELECT * /* fselect */);
/*
* This sets the highlight bar of the scrolling list.
*/
void setCDKFselectHighlight (
CDKFSELECT * /* fselect */,
chtype /* highlight */);
chtype getCDKFselectHighlight (
CDKFSELECT * /* fselect */);
/*
* These functions set the attribute of the directories, links,
* files, and sockets in the scrolling list portion of the file
* selector widget.
*/
void setCDKFselectDirAttribute (
CDKFSELECT * /* fselect */,
const char * /* attribute */);
void setCDKFselectLinkAttribute (
CDKFSELECT * /* fselect */,
const char * /* attribute */);
void setCDKFselectFileAttribute (
CDKFSELECT * /* fselect */,
const char * /* attribute */);
void setCDKFselectSocketAttribute (
CDKFSELECT * /* fselect */,
const char * /* attribute */);
/*
* These functions return the attribute of the directories, links,
* files, and sockets in the scrolling list portion of the file
* selector widget.
*/
char *getCDKFselectDirAttribute (
CDKFSELECT * /* fselect */);
char *getCDKFselectLinkAttribute (
CDKFSELECT * /* fselect */);
char *getCDKFselectFileAttribute (
CDKFSELECT * /* fselect */);
char *getCDKFselectSocketAttribute (
CDKFSELECT * /* fselect */);
/*
* This sets the box attribute of the widget.
*/
void setCDKFselectBox (
CDKFSELECT * /* fselect */,
boolean /* Box */);
boolean getCDKFselectBox (
CDKFSELECT * /* fselect */);
/*
* This sets the contents of the file selector.
*/
int setCDKFselectDirContents (
CDKFSELECT * /* fselect */);
char **getCDKFselectDirContents (
CDKFSELECT * /* fselect */,
int * /* count */);
/*
* This sets the contents of the file selector.
*/
void setCDKFselectContents (
CDKFSELECT * /* fselect */,
CDK_CSTRING2 /* list */,
int /* listSize */);
char **getCDKFselectContents (
CDKFSELECT * /* fselect */,
int * /* size */);
/*
* Get/set the current position in the scroll-widget.
*/
int getCDKFselectCurrentItem(
CDKFSELECT * /* widget */);
void setCDKFselectCurrentItem(
CDKFSELECT * /* widget */,
int /* item */);
/*
* These functions set the drawing characters of the widget.
*/
#define setCDKFselectULChar(w,c) setULCharOf(w,c)
#define setCDKFselectURChar(w,c) setURCharOf(w,c)
#define setCDKFselectLLChar(w,c) setLLCharOf(w,c)
#define setCDKFselectLRChar(w,c) setLRCharOf(w,c)
#define setCDKFselectVerticalChar(w,c) setVTCharOf(w,c)
#define setCDKFselectHorizontalChar(w,c) setHZCharOf(w,c)
#define setCDKFselectBoxAttribute(w,c) setBXAttrOf(w,c)
/*
* This sets the background color of the widget.
*/
#define setCDKFselectBackgroundColor(w,c) setCDKObjectBackgroundColor(ObjOf(w),c)
/*
* This sets the background attribute of the widget.
*/
#define setCDKFselectBackgroundAttrib(w,c) setBKAttrOf(w,c)
/*
* This draws the widget.
*/
#define drawCDKFselect(obj,Box) drawCDKObject(obj,Box)
/*
* This erases the widget.
*/
#define eraseCDKFselect(obj) eraseCDKObject(obj)
/*
* This moves the widget to the given location.
*/
#define moveCDKFselect(obj,xpos,ypos,relative,refresh) moveCDKObject(obj,xpos,ypos,relative,refresh)
/*
* This allows the user to interactively position the widget.
*/
#define positionCDKFselect(widget) positionCDKObject(ObjOf(widget),widget->win)
/*
* This destroys the widget and all the associated memory.
*/
#define destroyCDKFselect(obj) destroyCDKObject(obj)
/*
* This is a callback which allows you to delete files from within the
* file selector. It is NOT an active default: it MUST be set by the
* user.
*/
void deleteFileCB (
EObjectType /* objectType */,
void * /* object */,
void * /* clientData */);
/*
* This function sets the pre-process function.
*/
void setCDKFselectPreProcess (
CDKFSELECT * /* fselect */,
PROCESSFN /* callback */,
void * /* data */);
/*
* This function sets the post-process function.
*/
void setCDKFselectPostProcess (
CDKFSELECT * /* fselect */,
PROCESSFN /* callback */,
void * /* data */);
#ifdef __cplusplus
}
#endif
#endif /* CDKFSELECT_H */
#endif /* CDKINCLUDES */

View File

@@ -0,0 +1,233 @@
/*
* $Id: gen-scale.h,v 1.8 2012/03/20 21:59:39 tom Exp $
*/
#ifndef CDKINCLUDES
#ifndef CDK<UPPER>_H
#define CDK<UPPER>_H 1
#ifdef __cplusplus
extern "C" {
#endif
#ifndef CDK_H
#define CDKINCLUDES
#include <cdk.h>
#undef CDKINCLUDES
#include <binding.h>
#include <cdkscreen.h>
#include <cdk_objs.h>
#endif
/*
* Copyright 2004,2012 Thomas E. Dickey
* All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions
* are met:
* 1. Redistributions of source code must retain the above copyright
* notice, this list of conditions and the following disclaimer.
* 2. Redistributions in binary form must reproduce the above copyright
* notice, this list of conditions and the following disclaimer in the
* documentation and/or other materials provided with the distribution.
* 3. All advertising materials mentioning features or use of this software
* must display the following acknowledgment:
* This product includes software developed by Thomas Dickey
* and contributors.
* 4. Neither the name of Thomas Dickey, nor the names of contributors
* may be used to endorse or promote products derived from this software
* without specific prior written permission.
*
* THIS SOFTWARE IS PROVIDED BY THOMAS DICKEY AND CONTRIBUTORS ``AS IS'' AND
* ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
* IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
* ARE DISCLAIMED. IN NO EVENT SHALL THOMAS DICKEY OR CONTRIBUTORS BE LIABLE
* FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
* DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
* OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
* HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
* LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
* OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
* SUCH DAMAGE.
*/
/*
* Define the CDK widget <MIXED> structure.
*/
struct S<MIXED> {
CDKOBJS obj;
WINDOW * parent;
WINDOW * win;
WINDOW * shadowWin;
WINDOW * fieldWin;
WINDOW * labelWin;
int titleAdj;
chtype * label;
int labelLen;
int boxHeight;
int boxWidth;
int fieldWidth;
int fieldEdit; /* offset from right-margin of field */
chtype fieldAttr;
<CTYPE> low;
<CTYPE> high;
<CTYPE> inc;
<CTYPE> fastinc;
<CTYPE> current;
#if <FLOAT>
int digits;
#endif <FLOAT>
EExitType exitType;
boolean shadow;
};
typedef struct S<MIXED> CDK<UPPER>;
/*
* This creates a new pointer to a CDK <CTYPE>-<MIXED> widget.
*/
CDK<UPPER> *newCDK<MIXED> (
CDKSCREEN * /* cdkscreen */,
int /* xpos */,
int /* ypos */,
const char * /* title */,
const char * /* label */,
chtype /* fieldAttr */,
int /* fieldWidth */,
<CTYPE> /* start */,
<CTYPE> /* low */,
<CTYPE> /* high */,
<CTYPE> /* inc */,
<CTYPE> /* fastInc */,
#if <FLOAT>
int /* digits */,
#endif <FLOAT>
boolean /* Box */,
boolean /* shadow */);
/*
* This activates the widget.
*/
<CTYPE> activateCDK<MIXED> (
CDK<UPPER> * /* widget */,
chtype * /* actions */);
/*
* This injects a single character into the widget.
*/
#define injectCDK<MIXED>(obj,input) injectCDKObject(obj,input,<DTYPE>)
/*
* This sets various attributes of the widget.
*/
void setCDK<MIXED> (
CDK<UPPER> * /* widget */,
<CTYPE> /* low */,
<CTYPE> /* high */,
<CTYPE> /* value */,
boolean /* Box */);
/*
* These set/get the low and high values.
*/
void setCDK<MIXED>LowHigh (
CDK<UPPER> * /* widget */,
<CTYPE> /* low */,
<CTYPE> /* high */);
<CTYPE> getCDK<MIXED>LowValue (
CDK<UPPER> * /* widget */);
<CTYPE> getCDK<MIXED>HighValue (
CDK<UPPER> * /* widget */);
/*
* These set/get the digits.
*/
#if <FLOAT>
void setCDK<MIXED>Digits (
CDK<UPPER> * /* widget */,
int /* digits */);
int getCDK<MIXED>Digits (
CDK<UPPER> * /* widget */);
#endif <FLOAT>
/*
* These set/get the current value.
*/
void setCDK<MIXED>Value (
CDK<UPPER> * /* widget */,
<CTYPE> /* value */);
<CTYPE> getCDK<MIXED>Value (
CDK<UPPER> * /* widget */);
/*
* This sets the box attribute of the widget.
*/
void setCDK<MIXED>Box (
CDK<UPPER> * /* widget */,
boolean /* Box */);
boolean getCDK<MIXED>Box (
CDK<UPPER> * /* widget */);
/*
* These set the drawing characters of the widget.
*/
#define setCDK<MIXED>ULChar(w,c) setULCharOf(w,c)
#define setCDK<MIXED>URChar(w,c) setURCharOf(w,c)
#define setCDK<MIXED>LLChar(w,c) setLLCharOf(w,c)
#define setCDK<MIXED>LRChar(w,c) setLRCharOf(w,c)
#define setCDK<MIXED>VerticalChar(w,c) setVTCharOf(w,c)
#define setCDK<MIXED>HorizontalChar(w,c) setHZCharOf(w,c)
#define setCDK<MIXED>BoxAttribute(w,c) setBXAttrOf(w,c)
/*
* This sets the background color of the widget.
*/
#define setCDK<MIXED>BackgroundColor(w,c) setCDKObjectBackgroundColor(ObjOf(w),c)
/*
* This sets the background attribute of the widget.
*/
#define setCDK<MIXED>BackgroundAttrib(w,c) setBKAttrOf(w,c)
/*
* This draws the widget on the screen.
*/
#define drawCDK<MIXED>(obj,Box) drawCDKObject(obj,Box)
/*
* This erases the widget from the screen.
*/
#define eraseCDK<MIXED>(obj) eraseCDKObject(obj)
/*
* This moves the widget to the given location on the screen.
*/
#define moveCDK<MIXED>(obj,xpos,ypos,relative,refresh) moveCDKObject(obj,xpos,ypos,relative,refresh)
/*
* This allows the user to interactively position the widget on the screen.
*/
#define positionCDK<MIXED>(widget) positionCDKObject(ObjOf(widget),widget->win)
/*
* This destroys the widget and associated memory.
*/
#define destroyCDK<MIXED>(obj) destroyCDKObject(obj)
/*
* These set the pre/post process callback functions.
*/
#define setCDK<MIXED>PreProcess(w,f,d) setCDKObjectPreProcess(ObjOf(w),f,d)
#define setCDK<MIXED>PostProcess(w,f,d) setCDKObjectPostProcess(ObjOf(w),f,d)
#ifdef __cplusplus
}
#endif
#endif /* CDK<UPPER>_H */
#endif /* CDKINCLUDES */

View File

@@ -0,0 +1,233 @@
/*
* $Id: gen-slider.h,v 1.8 2012/03/20 21:59:30 tom Exp $
*/
#ifndef CDKINCLUDES
#ifndef CDK<UPPER>_H
#define CDK<UPPER>_H 1
#ifdef __cplusplus
extern "C" {
#endif
#ifndef CDK_H
#define CDKINCLUDES
#include <cdk.h>
#undef CDKINCLUDES
#include <binding.h>
#include <cdkscreen.h>
#include <cdk_objs.h>
#endif
/*
* Copyright 2004,2012 Thomas E. Dickey
* All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions
* are met:
* 1. Redistributions of source code must retain the above copyright
* notice, this list of conditions and the following disclaimer.
* 2. Redistributions in binary form must reproduce the above copyright
* notice, this list of conditions and the following disclaimer in the
* documentation and/or other materials provided with the distribution.
* 3. All advertising materials mentioning features or use of this software
* must display the following acknowledgment:
* This product includes software developed by Thomas Dickey
* and contributors.
* 4. Neither the name of Thomas Dickey, nor the names of contributors
* may be used to endorse or promote products derived from this software
* without specific prior written permission.
*
* THIS SOFTWARE IS PROVIDED BY THOMAS DICKEY AND CONTRIBUTORS ``AS IS'' AND
* ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
* IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
* ARE DISCLAIMED. IN NO EVENT SHALL THOMAS DICKEY OR CONTRIBUTORS BE LIABLE
* FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
* DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
* OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
* HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
* LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
* OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
* SUCH DAMAGE.
*/
/*
* Define the CDK widget <MIXED> structure.
*/
struct S<MIXED> {
CDKOBJS obj;
WINDOW * parent;
WINDOW * win;
WINDOW * shadowWin;
WINDOW * fieldWin;
WINDOW * labelWin;
int titleAdj;
chtype * label;
int labelLen;
int boxHeight;
int boxWidth;
int fieldWidth;
int fieldEdit; /* offset from right-margin of field */
chtype filler;
<CTYPE> low;
<CTYPE> high;
<CTYPE> inc;
<CTYPE> fastinc;
<CTYPE> current;
#if <FLOAT>
int digits;
#endif <FLOAT>
EExitType exitType;
boolean shadow;
};
typedef struct S<MIXED> CDK<UPPER>;
/*
* This creates a new pointer to a CDK <CTYPE>-<MIXED> widget.
*/
CDK<UPPER> *newCDK<MIXED> (
CDKSCREEN * /* cdkscreen */,
int /* xpos */,
int /* ypos */,
const char * /* title */,
const char * /* label */,
chtype /* fieldAttr */,
int /* fieldWidth */,
<CTYPE> /* start */,
<CTYPE> /* low */,
<CTYPE> /* high */,
<CTYPE> /* inc */,
<CTYPE> /* fastInc */,
#if <FLOAT>
int /* digits */,
#endif <FLOAT>
boolean /* Box */,
boolean /* shadow */);
/*
* This activates the widget.
*/
<CTYPE> activateCDK<MIXED> (
CDK<UPPER> * /* widget */,
chtype * /* actions */);
/*
* This injects a single character into the widget.
*/
#define injectCDK<MIXED>(obj,input) injectCDKObject(obj,input,<DTYPE>)
/*
* This sets various attributes of the widget.
*/
void setCDK<MIXED> (
CDK<UPPER> * /* widget */,
<CTYPE> /* low */,
<CTYPE> /* high */,
<CTYPE> /* value */,
boolean /* Box */);
/*
* These set/get the low and high values.
*/
void setCDK<MIXED>LowHigh (
CDK<UPPER> * /* widget */,
<CTYPE> /* low */,
<CTYPE> /* high */);
<CTYPE> getCDK<MIXED>LowValue (
CDK<UPPER> * /* widget */);
<CTYPE> getCDK<MIXED>HighValue (
CDK<UPPER> * /* widget */);
/*
* These set/get the digits.
*/
#if <FLOAT>
void setCDK<MIXED>Digits (
CDK<UPPER> * /* widget */,
int /* digits */);
int getCDK<MIXED>Digits (
CDK<UPPER> * /* widget */);
#endif <FLOAT>
/*
* These set/get the current value.
*/
void setCDK<MIXED>Value (
CDK<UPPER> * /* widget */,
<CTYPE> /* value */);
<CTYPE> getCDK<MIXED>Value (
CDK<UPPER> * /* widget */);
/*
* This sets the box attribute of the widget.
*/
void setCDK<MIXED>Box (
CDK<UPPER> * /* widget */,
boolean /* Box */);
boolean getCDK<MIXED>Box (
CDK<UPPER> * /* widget */);
/*
* These set the drawing characters of the widget.
*/
#define setCDK<MIXED>ULChar(w,c) setULCharOf(w,c)
#define setCDK<MIXED>URChar(w,c) setURCharOf(w,c)
#define setCDK<MIXED>LLChar(w,c) setLLCharOf(w,c)
#define setCDK<MIXED>LRChar(w,c) setLRCharOf(w,c)
#define setCDK<MIXED>VerticalChar(w,c) setVTCharOf(w,c)
#define setCDK<MIXED>HorizontalChar(w,c) setHZCharOf(w,c)
#define setCDK<MIXED>BoxAttribute(w,c) setBXAttrOf(w,c)
/*
* This sets the background color of the widget.
*/
#define setCDK<MIXED>BackgroundColor(w,c) setCDKObjectBackgroundColor(ObjOf(w),c)
/*
* This sets the background attribute of the widget.
*/
#define setCDK<MIXED>BackgroundAttrib(w,c) setBKAttrOf(w,c)
/*
* This draws the widget on the screen.
*/
#define drawCDK<MIXED>(obj,Box) drawCDKObject(obj,Box)
/*
* This erases the widget from the screen.
*/
#define eraseCDK<MIXED>(obj) eraseCDKObject(obj)
/*
* This moves the widget to the given location on the screen.
*/
#define moveCDK<MIXED>(obj,xpos,ypos,relative,refresh) moveCDKObject(obj,xpos,ypos,relative,refresh)
/*
* This allows the user to interactively position the widget on the screen.
*/
#define positionCDK<MIXED>(widget) positionCDKObject(ObjOf(widget),widget->win)
/*
* This destroys the widget and associated memory.
*/
#define destroyCDK<MIXED>(obj) destroyCDKObject(obj)
/*
* These set the pre/post process callback functions.
*/
#define setCDK<MIXED>PreProcess(w,f,d) setCDKObjectPreProcess(ObjOf(w),f,d)
#define setCDK<MIXED>PostProcess(w,f,d) setCDKObjectPostProcess(ObjOf(w),f,d)
#ifdef __cplusplus
}
#endif
#endif /* CDK<UPPER>_H */
#endif /* CDKINCLUDES */

233
deps/cdk-5.0-20161210/include/graph.h vendored Normal file
View File

@@ -0,0 +1,233 @@
/*
* $Id: graph.h,v 1.22 2012/03/21 21:15:30 tom Exp $
*/
#ifndef CDKINCLUDES
#ifndef CDKGRAPH_H
#define CDKGRAPH_H 1
#ifdef __cplusplus
extern "C" {
#endif
#ifndef CDK_H
#define CDKINCLUDES
#include <cdk.h>
#undef CDKINCLUDES
#include <binding.h>
#include <cdkscreen.h>
#include <cdk_objs.h>
#endif
/*
* Changes 2000-2004,2012 copyright Thomas E. Dickey
*
* Copyright 1999, Mike Glover
* All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions
* are met:
* 1. Redistributions of source code must retain the above copyright
* notice, this list of conditions and the following disclaimer.
* 2. Redistributions in binary form must reproduce the above copyright
* notice, this list of conditions and the following disclaimer in the
* documentation and/or other materials provided with the distribution.
* 3. All advertising materials mentioning features or use of this software
* must display the following acknowledgment:
* This product includes software developed by Mike Glover
* and contributors.
* 4. Neither the name of Mike Glover, nor the names of contributors
* may be used to endorse or promote products derived from this software
* without specific prior written permission.
*
* THIS SOFTWARE IS PROVIDED BY MIKE GLOVER AND CONTRIBUTORS ``AS IS'' AND
* ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
* IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
* ARE DISCLAIMED. IN NO EVENT SHALL MIKE GLOVER OR CONTRIBUTORS BE LIABLE
* FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
* DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
* OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
* HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
* LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
* OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
* SUCH DAMAGE.
*/
/*
* Define the CDK graph structure.
*/
struct SGraph {
CDKOBJS obj;
WINDOW * parent;
WINDOW * win;
WINDOW * shadowWin;
int titleAdj;
chtype * graphChar;
boolean shadow;
int boxHeight;
int boxWidth;
chtype * xtitle;
int xtitlePos;
int xtitleLen;
int * values;
int count;
int minx;
int maxx;
int xscale;
int txpos;
chtype * ytitle;
int ytitlePos;
int ytitleLen;
int yscale;
int typos;
EGraphDisplayType displayType;
};
typedef struct SGraph CDKGRAPH;
/*
* This creates a new CDK graph pointer.
*/
CDKGRAPH *newCDKGraph (
CDKSCREEN * /* cdkscreen */,
int /* xpos */,
int /* ypos */,
int /* height */,
int /* width */,
const char * /* title */,
const char * /* xtitle */,
const char * /* ytitle */);
/*
* This was added to make the builder simpler. All this will
* do is call drawCDKGraph.
*/
void activateCDKGraph (
CDKGRAPH * /* graph */,
chtype * /* actions */);
/*
* This sets multiple attributes of the widget.
*/
int setCDKGraph (
CDKGRAPH * /* graph */,
int * /* values */,
int /* count */,
const char * /* graphChar */,
boolean /* startAtZero */,
EGraphDisplayType /* displayType */);
/*
* This sets the values of the graph widget.
*/
int setCDKGraphValues (
CDKGRAPH * /* graph */,
int * /* values */,
int /* count */,
boolean /* startAtZero */);
int setCDKGraphValue (
CDKGRAPH * /* graph */,
int /* index */,
int /* value */,
boolean /* startAtZero */);
int *getCDKGraphValues (
CDKGRAPH * /* graph */,
int * /* size */);
int getCDKGraphValue (
CDKGRAPH * /* graph */,
int /* index */);
/*
* This sets the characters of the graph widget.
*/
int setCDKGraphCharacters (
CDKGRAPH * /* graph */,
const char * /* characters */);
int setCDKGraphCharacter (
CDKGRAPH * /* graph */,
int /* index */,
const char * /* character */);
chtype *getCDKGraphCharacters (
CDKGRAPH * /* graph */);
chtype getCDKGraphCharacter (
CDKGRAPH * /* graph */,
int /* index */);
/*
* This sets the display type of the graph.
*/
void setCDKGraphDisplayType (
CDKGRAPH * /* graph */,
EGraphDisplayType /* type */);
EGraphDisplayType getCDKGraphDisplayType (
CDKGRAPH * /* graph */);
/*
* This sets the box attribute of the widget.
*/
void setCDKGraphBox (
CDKGRAPH * /* graph */,
boolean /* Box */);
boolean getCDKGraphBox (
CDKGRAPH * /* graph */);
/*
* These set the drawing characters of the widget.
*/
#define setCDKGraphULChar(w,c) setULCharOf(w,c)
#define setCDKGraphURChar(w,c) setURCharOf(w,c)
#define setCDKGraphLLChar(w,c) setLLCharOf(w,c)
#define setCDKGraphLRChar(w,c) setLRCharOf(w,c)
#define setCDKGraphVerticalChar(w,c) setVTCharOf(w,c)
#define setCDKGraphHorizontalChar(w,c) setHZCharOf(w,c)
#define setCDKGraphBoxAttribute(w,c) setBXAttrOf(w,c)
/*
* This sets the background color of the widget.
*/
#define setCDKGraphBackgroundColor(w,c) setCDKObjectBackgroundColor(ObjOf(w),c)
/*
* This sets the background attribute of the widget.
*/
#define setCDKGraphBackgroundAttrib(w,c) setBKAttrOf(w,c)
/*
* This draws the graph on the screen.
*/
#define drawCDKGraph(obj,Box) drawCDKObject(obj,Box)
/*
* This removes the graph from the screen.
*/
#define eraseCDKGraph(obj) eraseCDKObject(obj)
/*
* This moves the widget to the given location.
*/
#define moveCDKGraph(obj,xpos,ypos,relative,refresh) moveCDKObject(obj,xpos,ypos,relative,refresh)
/*
* This allows the user to interactively move the widget.
*/
#define positionCDKGraph(widget) positionCDKObject(ObjOf(widget),widget->win)
/*
* This destroys the graph and all the associated memory.
*/
#define destroyCDKGraph(obj) destroyCDKObject(obj)
#ifdef __cplusplus
}
#endif
#endif /* CDKGRAPH_H */
#endif /* CDKINCLUDES */

View File

@@ -0,0 +1,248 @@
/*
* $Id: histogram.h,v 1.19 2012/03/21 21:15:30 tom Exp $
*/
#ifndef CDKINCLUDES
#ifndef CDKHISTOGRAM_H
#define CDKHISTOGRAM_H 1
#ifdef __cplusplus
extern "C" {
#endif
#ifndef CDK_H
#define CDKINCLUDES
#include <cdk.h>
#undef CDKINCLUDES
#include <binding.h>
#include <cdkscreen.h>
#include <cdk_objs.h>
#endif
/*
* Changes 1999-2004,2012 copyright Thomas E. Dickey
*
* Copyright 1999, Mike Glover
* All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions
* are met:
* 1. Redistributions of source code must retain the above copyright
* notice, this list of conditions and the following disclaimer.
* 2. Redistributions in binary form must reproduce the above copyright
* notice, this list of conditions and the following disclaimer in the
* documentation and/or other materials provided with the distribution.
* 3. All advertising materials mentioning features or use of this software
* must display the following acknowledgment:
* This product includes software developed by Mike Glover
* and contributors.
* 4. Neither the name of Mike Glover, nor the names of contributors
* may be used to endorse or promote products derived from this software
* without specific prior written permission.
*
* THIS SOFTWARE IS PROVIDED BY MIKE GLOVER AND CONTRIBUTORS ``AS IS'' AND
* ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
* IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
* ARE DISCLAIMED. IN NO EVENT SHALL MIKE GLOVER OR CONTRIBUTORS BE LIABLE
* FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
* DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
* OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
* HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
* LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
* OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
* SUCH DAMAGE.
*/
/*
* Declare the histogram structure.
*/
struct SHistogram {
CDKOBJS obj;
WINDOW * parent;
WINDOW * win;
WINDOW * shadowWin;
int titleAdj;
char * curString;
char * lowString;
char * highString;
chtype filler;
float percent;
int fieldHeight;
int fieldWidth;
int barSize;
int orient;
int statsPos;
chtype statsAttr;
EHistogramDisplayType viewType;
int high;
int low;
int value;
int lowx;
int lowy;
int curx;
int cury;
int highx;
int highy;
int boxWidth;
int boxHeight;
boolean shadow;
};
typedef struct SHistogram CDKHISTOGRAM;
/*
* This returns a new pointer to a histogram pointer.
*/
CDKHISTOGRAM *newCDKHistogram (
CDKSCREEN * /* cdkscreen */,
int /* xpos */,
int /* ypos */,
int /* height */,
int /* width */,
int /* orient */,
const char * /* title */,
boolean /* Box */,
boolean /* shadow */);
/*
* This was added to make the build simpler. All this will
* do is call drawCDKHistogram.
*/
void activateCDKHistogram (
CDKHISTOGRAM * /* histogram */,
chtype * /* actions */);
/*
* These set specific attributes of the histogram.
*/
void setCDKHistogram (
CDKHISTOGRAM * /* histogram */,
EHistogramDisplayType /* viewtype */,
int /* statsPos */,
chtype /* statsAttr */,
int /* low */,
int /* high */,
int /* value */,
chtype /* filler */,
boolean /* Box */);
/*
* This sets the low/high/current value of the histogram.
*/
void setCDKHistogramValue (
CDKHISTOGRAM * /* histogram */,
int /* low */,
int /* high */,
int /* value */);
int getCDKHistogramValue (
CDKHISTOGRAM * /* histogram */);
int getCDKHistogramLowValue (
CDKHISTOGRAM * /* histogram */);
int getCDKHistogramHighValue (
CDKHISTOGRAM * /* histogram */);
/*
* This sets the view type of the histogram.
*/
void setCDKHistogramDisplayType (
CDKHISTOGRAM * /* histogram */,
EHistogramDisplayType /* viewtype */);
EHistogramDisplayType getCDKHistogramViewType (
CDKHISTOGRAM * /* histogram */);
/*
* This returns the filler character used to draw the histogram.
*/
void setCDKHistogramFillerChar (
CDKHISTOGRAM * /* histogram */,
chtype /* character */);
chtype getCDKHistogramFillerChar (
CDKHISTOGRAM * /* histogram */);
/*
* This states where the statistics value is to be located on the histogram.
*/
void setCDKHistogramStatsPos (
CDKHISTOGRAM * /* histogram */,
int /* statsPos */);
int getCDKHistogramStatsPos (
CDKHISTOGRAM * /* histogram */);
/*
* This sets the attribute of the statistics.
*/
void setCDKHistogramStatsAttr (
CDKHISTOGRAM * /* histogram */,
chtype /* statsAttr */);
chtype getCDKHistogramStatsAttr (
CDKHISTOGRAM * /* histogram */);
/*
* This sets the box attribute of the widget.
*/
void setCDKHistogramBox (
CDKHISTOGRAM * /* histogram */,
boolean /* Box */);
boolean getCDKHistogramBox (
CDKHISTOGRAM * /* histogram */);
/*
* These set the drawing characters of the widget.
*/
#define setCDKHistogramULChar(w,c) setULCharOf(w,c)
#define setCDKHistogramURChar(w,c) setURCharOf(w,c)
#define setCDKHistogramLLChar(w,c) setLLCharOf(w,c)
#define setCDKHistogramLRChar(w,c) setLRCharOf(w,c)
#define setCDKHistogramVerticalChar(w,c) setVTCharOf(w,c)
#define setCDKHistogramHorizontalChar(w,c) setHZCharOf(w,c)
#define setCDKHistogramBoxAttribute(w,c) setBXAttrOf(w,c)
/*
* This sets the background color of the widget.
*/
#define setCDKHistogramBackgroundColor(w,c) setCDKObjectBackgroundColor(ObjOf(w),c)
/*
* This sets the background attribute of the widget.
*/
#define setCDKHistogramBackgroundAttrib(w,c) setBKAttrOf(w,c)
/*
* This draws the widget on the screen.
*/
#define drawCDKHistogram(obj,Box) drawCDKObject(obj,Box)
/*
* This removes the widget from the screen.
*/
#define eraseCDKHistogram(obj) eraseCDKObject(obj)
/*
* This moves the widget to the given location.
*/
#define moveCDKHistogram(obj,xpos,ypos,relative,refresh) moveCDKObject(obj,xpos,ypos,relative,refresh)
/*
* This allows the user to interactively position the widget on the screen.
*/
#define positionCDKHistogram(widget) positionCDKObject(ObjOf(widget),widget->win)
/*
* This destroys the histogram and all related pointers.
*/
#define destroyCDKHistogram(obj) destroyCDKObject(obj)
#ifdef __cplusplus
}
#endif
#endif /* CDKHISTOGRAM_H */
#endif /* CDKINCLUDES */

228
deps/cdk-5.0-20161210/include/itemlist.h vendored Normal file
View File

@@ -0,0 +1,228 @@
/*
* $Id: itemlist.h,v 1.24 2012/03/21 21:15:30 tom Exp $
*/
#ifndef CDKINCLUDES
#ifndef CDKITEMLIST_H
#define CDKITEMLIST_H 1
#ifdef __cplusplus
extern "C" {
#endif
#ifndef CDK_H
#define CDKINCLUDES
#include <cdk.h>
#undef CDKINCLUDES
#include <binding.h>
#include <cdkscreen.h>
#include <cdk_objs.h>
#endif
/*
* Changes 1999-2004,2012 copyright Thomas E. Dickey
*
* Copyright 1999, Mike Glover
* All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions
* are met:
* 1. Redistributions of source code must retain the above copyright
* notice, this list of conditions and the following disclaimer.
* 2. Redistributions in binary form must reproduce the above copyright
* notice, this list of conditions and the following disclaimer in the
* documentation and/or other materials provided with the distribution.
* 3. All advertising materials mentioning features or use of this software
* must display the following acknowledgment:
* This product includes software developed by Mike Glover
* and contributors.
* 4. Neither the name of Mike Glover, nor the names of contributors
* may be used to endorse or promote products derived from this software
* without specific prior written permission.
*
* THIS SOFTWARE IS PROVIDED BY MIKE GLOVER AND CONTRIBUTORS ``AS IS'' AND
* ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
* IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
* ARE DISCLAIMED. IN NO EVENT SHALL MIKE GLOVER OR CONTRIBUTORS BE LIABLE
* FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
* DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
* OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
* HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
* LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
* OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
* SUCH DAMAGE.
*/
/*
* Define the CDK itemlist widget structure.
*/
struct SItemList {
CDKOBJS obj;
WINDOW * parent;
WINDOW * win;
WINDOW * shadowWin;
WINDOW * labelWin;
WINDOW * fieldWin;
int titleAdj;
chtype * label;
int labelLen;
int fieldWidth;
chtype ** item;
int * itemPos;
int * itemLen;
int listSize;
int currentItem;
int defaultItem;
int boxWidth;
int boxHeight;
EExitType exitType;
boolean shadow;
};
typedef struct SItemList CDKITEMLIST;
/*
* This creates a pointer to a CDK itemlist widget.
*/
CDKITEMLIST *newCDKItemlist (
CDKSCREEN * /* cdkscreen */,
int /* xpos */,
int /* ypos */,
const char * /* title */,
const char * /* label */,
CDK_CSTRING2 /* itemlist */,
int /* count */,
int /* defaultItem */,
boolean /* Box */,
boolean /* shadow */);
/*
* This activates the itemlist widget.
*/
int activateCDKItemlist (
CDKITEMLIST * /* itemlist */,
chtype * /* actions */);
/*
* This injects a single character into the itemlist widget.
*/
#define injectCDKItemlist(obj,input) injectCDKObject(obj,input,Int)
/*
* These functions set specific elements of the itemlist widget.
*/
void setCDKItemlist (
CDKITEMLIST * /* itemlist */,
CDK_CSTRING2 /* list */,
int /* count */,
int /* current */,
boolean /* Box */);
/*
* This function sets the values of the item list widget.
*/
void setCDKItemlistValues (
CDKITEMLIST * /* itemlist */,
CDK_CSTRING2 /* list */,
int /* count */,
int /* defaultItem */);
chtype **getCDKItemlistValues (
CDKITEMLIST * /* itemlist */,
int * /* size */);
/*
* This sets the default item in the list.
*/
void setCDKItemlistDefaultItem (
CDKITEMLIST * /* itemlist */,
int /* defaultItem */);
int getCDKItemlistDefaultItem (
CDKITEMLIST * /* itemlist */);
/*
* This returns an index to the current item in the list.
*/
void setCDKItemlistCurrentItem (
CDKITEMLIST * /* itemlist */,
int /* currentItem */);
int getCDKItemlistCurrentItem (
CDKITEMLIST * /* itemlist */);
/*
* This sets the box attribute of the widget.
*/
void setCDKItemlistBox (
CDKITEMLIST * /* itemlist */,
boolean /* Box */);
boolean getCDKItemlistBox (
CDKITEMLIST * /* itemlist */);
/*
* These set the drawing characters of the widget.
*/
#define setCDKItemlistULChar(w,c) setULCharOf(w,c)
#define setCDKItemlistURChar(w,c) setURCharOf(w,c)
#define setCDKItemlistLLChar(w,c) setLLCharOf(w,c)
#define setCDKItemlistLRChar(w,c) setLRCharOf(w,c)
#define setCDKItemlistVerticalChar(w,c) setVTCharOf(w,c)
#define setCDKItemlistHorizontalChar(w,c) setHZCharOf(w,c)
#define setCDKItemlistBoxAttribute(w,c) setBXAttrOf(w,c)
/*
* This sets the background color of the widget.
*/
#define setCDKItemlistBackgroundColor(w,c) setCDKObjectBackgroundColor(ObjOf(w),c)
/*
* This sets the background attribute of the widget.
*/
#define setCDKItemlistBackgroundAttrib(w,c) setBKAttrOf(w,c)
/*
* This draws the itemlist widget.
*/
#define drawCDKItemlist(obj,Box) drawCDKObject(obj,Box)
/*
* This draws the itemlist field.
*/
void drawCDKItemlistField (
CDKITEMLIST * /* itemlist */,
boolean /* highlight */);
/*
* This removes the widget from the screen.
*/
#define eraseCDKItemlist(obj) eraseCDKObject(obj)
/*
* This moves the widget to the given position.
*/
#define moveCDKItemlist(obj,xpos,ypos,relative,refresh) moveCDKObject(obj,xpos,ypos,relative,refresh)
/*
* This allows the user to interactively move the widget.
*/
#define positionCDKItemlist(widget) positionCDKObject(ObjOf(widget),widget->win)
/*
* This destroys the widget and all the associated memory.
*/
#define destroyCDKItemlist(obj) destroyCDKObject(obj)
/*
* These functions set the pre/post process functions.
*/
#define setCDKItemlistPreProcess(w,f,d) setCDKObjectPreProcess(ObjOf(w),f,d)
#define setCDKItemlistPostProcess(w,f,d) setCDKObjectPostProcess(ObjOf(w),f,d)
#ifdef __cplusplus
}
#endif
#endif /* CDKITEMLIST_H */
#endif /* CDKINCLUDES */

190
deps/cdk-5.0-20161210/include/label.h vendored Normal file
View File

@@ -0,0 +1,190 @@
/*
* $Id: label.h,v 1.20 2012/03/21 21:15:30 tom Exp $
*/
#ifndef CDKINCLUDES
#ifndef CDKLABEL_H
#define CDKLABEL_H 1
#ifdef __cplusplus
extern "C" {
#endif
#ifndef CDK_H
#define CDKINCLUDES
#include <cdk.h>
#undef CDKINCLUDES
#include <binding.h>
#include <cdkscreen.h>
#include <cdk_objs.h>
#endif
/*
* Changes 2000-2003,2012 copyright Thomas E. Dickey
*
* Copyright 1999, Mike Glover
* All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions
* are met:
* 1. Redistributions of source code must retain the above copyright
* notice, this list of conditions and the following disclaimer.
* 2. Redistributions in binary form must reproduce the above copyright
* notice, this list of conditions and the following disclaimer in the
* documentation and/or other materials provided with the distribution.
* 3. All advertising materials mentioning features or use of this software
* must display the following acknowledgment:
* This product includes software developed by Mike Glover
* and contributors.
* 4. Neither the name of Mike Glover, nor the names of contributors
* may be used to endorse or promote products derived from this software
* without specific prior written permission.
*
* THIS SOFTWARE IS PROVIDED BY MIKE GLOVER AND CONTRIBUTORS ``AS IS'' AND
* ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
* IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
* ARE DISCLAIMED. IN NO EVENT SHALL MIKE GLOVER OR CONTRIBUTORS BE LIABLE
* FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
* DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
* OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
* HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
* LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
* OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
* SUCH DAMAGE.
*/
/*
* Declare any definitions you need to make.
*/
#define MAX_LABEL_ROWS 300 /* unused by widgets */
/*
* Declare the CDK label structure.
*/
struct SLabel {
CDKOBJS obj;
WINDOW * parent;
WINDOW * win;
WINDOW * shadowWin;
chtype ** info;
int * infoLen;
int * infoPos;
int boxWidth;
int boxHeight;
int xpos;
int ypos;
int rows;
boolean shadow;
};
typedef struct SLabel CDKLABEL;
/*
* This creates a new CDK label widget.
*/
CDKLABEL *newCDKLabel (
CDKSCREEN * /* screen */,
int /* xPos */,
int /* yPos */,
CDK_CSTRING2 /* mesg */,
int /* rows */,
boolean /* Box */,
boolean /* shadow */);
/*
* This was added to make the builder simpler. All this will
* do is call drawCDKLabel.
*/
void activateCDKLabel (
CDKLABEL * /* label */,
chtype * /* actions */);
/*
* This sets multiple attributes of the widget.
*/
void setCDKLabel (
CDKLABEL * /* label */,
CDK_CSTRING2 /* message */,
int /* lines */,
boolean /* Box */);
/*
* This sets the contents of the label.
*/
void setCDKLabelMessage (
CDKLABEL * /* label */,
CDK_CSTRING2 /* mesg */,
int /* lines */);
chtype **getCDKLabelMessage (
CDKLABEL * /* label */,
int * /* size */);
/*
* This sets the box attribute of the widget.
*/
void setCDKLabelBox (
CDKLABEL * /* label */,
boolean /* Box */);
boolean getCDKLabelBox (
CDKLABEL * /* label */);
/*
* This draws the label.
*/
#define drawCDKLabel(obj,Box) drawCDKObject(obj,Box)
/*
* These set the drawing characters of the widget.
*/
#define setCDKLabelULChar(w,c) setULCharOf(w,c)
#define setCDKLabelURChar(w,c) setURCharOf(w,c)
#define setCDKLabelLLChar(w,c) setLLCharOf(w,c)
#define setCDKLabelLRChar(w,c) setLRCharOf(w,c)
#define setCDKLabelVerticalChar(w,c) setVTCharOf(w,c)
#define setCDKLabelHorizontalChar(w,c) setHZCharOf(w,c)
#define setCDKLabelBoxAttribute(w,c) setBXAttrOf(w,c)
/*
* This sets the background color of the widget.
*/
#define setCDKLabelBackgroundColor(w,c) setCDKObjectBackgroundColor(ObjOf(w),c)
/*
* This sets the background attribute of the widget.
*/
#define setCDKLabelBackgroundAttrib(w,c) setBKAttrOf(w,c)
/*
* This erases the label.
*/
#define eraseCDKLabel(obj) eraseCDKObject(obj)
/*
* This destroys the label and the memory used by it.
*/
#define destroyCDKLabel(obj) destroyCDKObject(obj)
/*
* This draws the label then waits for the user to press
* the key defined by the 'key' parameter.
*/
char waitCDKLabel (
CDKLABEL * /* label */,
char /* key */);
/*
* This moves the label.
*/
#define moveCDKLabel(obj,xpos,ypos,relative,refresh) moveCDKObject(obj,xpos,ypos,relative,refresh)
/*
* This allows the user to interactively position the label.
*/
#define positionCDKLabel(widget) positionCDKObject(ObjOf(widget),widget->win)
#ifdef __cplusplus
}
#endif
#endif /* CDKLABEL_H */
#endif /* CDKINCLUDES */

161
deps/cdk-5.0-20161210/include/marquee.h vendored Normal file
View File

@@ -0,0 +1,161 @@
/*
* $Id: marquee.h,v 1.19 2012/03/21 21:15:30 tom Exp $
*/
#ifndef CDKINCLUDES
#ifndef CDKMARQUEE_H
#define CDKMARQUEE_H 1
#ifdef __cplusplus
extern "C" {
#endif
#ifndef CDK_H
#define CDKINCLUDES
#include <cdk.h>
#undef CDKINCLUDES
#include <binding.h>
#include <cdkscreen.h>
#include <cdk_objs.h>
#endif
/*
* Changes 1999-2004,2012 copyright Thomas E. Dickey
*
* Copyright 1999, Mike Glover
* All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions
* are met:
* 1. Redistributions of source code must retain the above copyright
* notice, this list of conditions and the following disclaimer.
* 2. Redistributions in binary form must reproduce the above copyright
* notice, this list of conditions and the following disclaimer in the
* documentation and/or other materials provided with the distribution.
* 3. All advertising materials mentioning features or use of this software
* must display the following acknowledgment:
* This product includes software developed by Mike Glover
* and contributors.
* 4. Neither the name of Mike Glover, nor the names of contributors
* may be used to endorse or promote products derived from this software
* without specific prior written permission.
*
* THIS SOFTWARE IS PROVIDED BY MIKE GLOVER AND CONTRIBUTORS ``AS IS'' AND
* ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
* IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
* ARE DISCLAIMED. IN NO EVENT SHALL MIKE GLOVER OR CONTRIBUTORS BE LIABLE
* FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
* DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
* OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
* HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
* LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
* OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
* SUCH DAMAGE.
*/
/*
* Define the CDK marquee widget structure.
*/
struct SMarquee {
CDKOBJS obj;
WINDOW * parent;
WINDOW * win;
WINDOW * shadowWin;
int active;
int width;
int boxWidth;
int boxHeight;
boolean shadow;
};
typedef struct SMarquee CDKMARQUEE;
/*
* This creates a new marquee widget pointer.
*/
CDKMARQUEE *newCDKMarquee (
CDKSCREEN * /* cdkscreen */,
int /* xpos */,
int /* ypos */,
int /* width */,
boolean /* Box */,
boolean /* shadow */);
/*
* This turns the marquee 'on'.
*/
int activateCDKMarquee (
CDKMARQUEE * /* marquee */,
const char * /* message */,
int /* delay */,
int /* repeat */,
boolean /* Box */);
/*
* This turns 'off' the marquee.
*/
void deactivateCDKMarquee (
CDKMARQUEE * /* marquee */);
/*
* This draws the marquee on the screen.
*/
#define drawCDKMarquee(obj,Box) drawCDKObject(obj,Box)
/*
* This removes the widget from the screen.
*/
#define eraseCDKMarquee(obj) eraseCDKObject(obj)
/*
* This moves the widget to the given location.
*/
#define moveCDKMarquee(obj,xpos,ypos,relative,refresh) moveCDKObject(obj,xpos,ypos,relative,refresh)
/*
* This interactively positions the widget on the screen.
*/
#define positionCDKMarquee(widget) positionCDKObject(ObjOf(widget),widget->win)
/*
* This destroys the marquee widget.
*/
#define destroyCDKMarquee(obj) destroyCDKObject(obj)
/*
* These set the drawing characters of the widget.
*/
#define setCDKMarqueeULChar(w,c) setULCharOf(w,c)
#define setCDKMarqueeURChar(w,c) setURCharOf(w,c)
#define setCDKMarqueeLLChar(w,c) setLLCharOf(w,c)
#define setCDKMarqueeLRChar(w,c) setLRCharOf(w,c)
#define setCDKMarqueeVerticalChar(w,c) setVTCharOf(w,c)
#define setCDKMarqueeHorizontalChar(w,c) setHZCharOf(w,c)
#define setCDKMarqueeBoxAttribute(w,c) setBXAttrOf(w,c)
/*
* This sets the box attribute of the widget.
*/
void setCDKMarqueeBox (
CDKMARQUEE * /* marquee */,
boolean /* Box */);
boolean getCDKMarqueeBox (
CDKMARQUEE * /* marquee */);
/*
* This sets the background color of the widget.
*/
#define setCDKMarqueeBackgroundColor(w,c) setCDKObjectBackgroundColor(ObjOf(w),c)
/*
* This sets the background attribute of the widget.
*/
#define setCDKMarqueeBackgroundAttrib(w,c) setBKAttrOf(w,c)
#ifdef __cplusplus
}
#endif
#endif /* CDKMARQUEE_H */
#endif /* CDKINCLUDES */

317
deps/cdk-5.0-20161210/include/matrix.h vendored Normal file
View File

@@ -0,0 +1,317 @@
/*
* $Id: matrix.h,v 1.30 2012/03/21 21:15:30 tom Exp $
*/
#ifndef CDKINCLUDES
#ifndef CDKMATRIX_H
#define CDKMATRIX_H 1
#ifdef __cplusplus
extern "C" {
#endif
#ifndef CDK_H
#define CDKINCLUDES
#include <cdk.h>
#undef CDKINCLUDES
#include <binding.h>
#include <cdkscreen.h>
#include <cdk_objs.h>
#endif
/*
* Changes 1999-2008,2012 copyright Thomas E. Dickey
*
* Copyright 1999, Mike Glover
* All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions
* are met:
* 1. Redistributions of source code must retain the above copyright
* notice, this list of conditions and the following disclaimer.
* 2. Redistributions in binary form must reproduce the above copyright
* notice, this list of conditions and the following disclaimer in the
* documentation and/or other materials provided with the distribution.
* 3. All advertising materials mentioning features or use of this software
* must display the following acknowledgment:
* This product includes software developed by Mike Glover
* and contributors.
* 4. Neither the name of Mike Glover, nor the names of contributors
* may be used to endorse or promote products derived from this software
* without specific prior written permission.
*
* THIS SOFTWARE IS PROVIDED BY MIKE GLOVER AND CONTRIBUTORS ``AS IS'' AND
* ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
* IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
* ARE DISCLAIMED. IN NO EVENT SHALL MIKE GLOVER OR CONTRIBUTORS BE LIABLE
* FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
* DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
* OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
* HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
* LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
* OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
* SUCH DAMAGE.
*/
/*
* Declare some matrix definitions.
*/
#define MAX_MATRIX_ROWS 1000
#define MAX_MATRIX_COLS 1000
/*
* Define the CDK matrix widget structure.
*/
typedef struct SMatrix CDKMATRIX;
typedef void (*MATRIXCB) (CDKMATRIX *matrix, chtype input);
#define CELL_LIMIT MAX_MATRIX_ROWS][MAX_MATRIX_COLS
#define NEW_CDKMATRIX 1
#if NEW_CDKMATRIX
#define CELL_INDEX(matrix, row,col) (((row) * ((matrix)->cols + 1)) + (col))
#else
#define CELL_INDEX(matrix, row,col) (row)][(col)
#endif
#define MATRIX_CELL(matrix,row,col) ((matrix)->cell[CELL_INDEX(matrix, row, col)])
#define MATRIX_INFO(matrix,row,col) ((matrix)->info[CELL_INDEX(matrix, row, col)])
struct SMatrix {
CDKOBJS obj;
WINDOW * parent;
WINDOW * win;
WINDOW * shadowWin;
#if NEW_CDKMATRIX
WINDOW ** cell;
char ** info;
#else
WINDOW * cell[CELL_LIMIT];
char * info[CELL_LIMIT];
#endif
int titleAdj;
int rows;
int cols;
int vrows;
int vcols;
int * colwidths;
int * colvalues;
chtype ** coltitle;
int * coltitleLen;
int * coltitlePos;
int maxct;
chtype ** rowtitle;
int * rowtitleLen;
int * rowtitlePos;
int maxrt;
int boxHeight;
int boxWidth;
int rowSpace;
int colSpace;
int row;
int col;
int crow; /* current row */
int ccol; /* current column */
int trow; /* topmost row shown in screen */
int lcol; /* leftmost column shown in screen */
int oldcrow;
int oldccol;
int oldvrow;
int oldvcol;
EExitType exitType;
boolean boxCell;
boolean shadow;
chtype highlight;
int dominant;
chtype filler;
MATRIXCB callbackfn;
};
/*
* This creates a new pointer to a matrix widget.
*/
CDKMATRIX *newCDKMatrix (
CDKSCREEN * /* cdkscreen */,
int /* xpos */,
int /* ypos */,
int /* rows */,
int /* cols */,
int /* vrows */,
int /* vcols */,
const char * /* title */,
CDK_CSTRING2 /* rowtitles */,
CDK_CSTRING2 /* coltitles */,
int * /* colwidths */,
int * /* coltypes */,
int /* rowspace */,
int /* colspace */,
chtype /* filler */,
int /* dominantAttrib */,
boolean /* boxMatrix */,
boolean /* boxCell */,
boolean /* shadow */);
/*
* This activates the matrix.
*/
int activateCDKMatrix (
CDKMATRIX * /* matrix */,
chtype * /* actions */);
/*
* This injects a single character into the matrix widget.
*/
#define injectCDKMatrix(obj,input) injectCDKObject(obj,input,Int)
/*
* This sets the contents of the matrix widget from a fixed-size 2d array.
* The predefined array limits are very large.
* Use setCDKMatrixCells() instead.
*/
#define setCDKMatrix(matrix, info, rows, subSize) \
setCDKMatrixCells(matrix, &info[0][0], rows, MAX_MATRIX_COLS, subSize)
/*
* This sets the contents of the matrix widget from an array defined by the
* caller. It may be any size. For compatibility with setCDKMatrix(), the
* info[][] array's subscripts start at 1.
*/
void setCDKMatrixCells (
CDKMATRIX * /* matrix */,
CDK_CSTRING2 /* info */,
int /* rows */,
int /* cols */,
int * /* subSize */);
/*
* This sets the value of a given cell.
*/
int setCDKMatrixCell (
CDKMATRIX * /* matrix */,
int /* row */,
int /* col */,
const char * /* value */);
char *getCDKMatrixCell (
CDKMATRIX * /* matrix */,
int /* row */,
int /* col */);
/*
* This returns the row/col of the matrix.
*/
int getCDKMatrixCol (
CDKMATRIX * /* matrix */);
int getCDKMatrixRow (
CDKMATRIX * /* matrix */);
/*
* These set the drawing characters of the widget.
*/
#define setCDKMatrixULChar(w,c) setULCharOf(w,c)
#define setCDKMatrixURChar(w,c) setURCharOf(w,c)
#define setCDKMatrixLLChar(w,c) setLLCharOf(w,c)
#define setCDKMatrixLRChar(w,c) setLRCharOf(w,c)
#define setCDKMatrixVerticalChar(w,c) setVTCharOf(w,c)
#define setCDKMatrixHorizontalChar(w,c) setHZCharOf(w,c)
#define setCDKMatrixBoxAttribute(w,c) setBXAttrOf(w,c)
/*
* This sets the background color of the widget.
*/
#define setCDKMatrixBackgroundColor(w,c) setCDKObjectBackgroundColor(ObjOf(w),c)
/*
* This sets the background attribute of the widget.
*/
#define setCDKMatrixBackgroundAttrib(w,c) setBKAttrOf(w,c)
/*
* This draws the matrix on the screen.
*/
#define drawCDKMatrix(obj,Box) drawCDKObject(obj,Box)
/*
* This removes the matrix from the screen.
*/
#define eraseCDKMatrix(obj) eraseCDKObject(obj)
/*
* This cleans out all the cells from the matrix.
*/
void cleanCDKMatrix (
CDKMATRIX * /* matrix */);
/*
* This cleans one cell in the matrix.
*/
void cleanCDKMatrixCell (
CDKMATRIX * /* matrix */,
int /* row */,
int /* col */);
/*
* This sets the main callback in the matrix.
*/
void setCDKMatrixCB (
CDKMATRIX * /* matrix */,
MATRIXCB /* callback */);
/*
* This moves the matrix to the given cell.
*/
int moveToCDKMatrixCell (
CDKMATRIX * /* matrix */,
int /* newrow */,
int /* newcol */);
/*
* This sets the box attribute of the matrix widget.
*/
void setCDKMatrixBox (
CDKMATRIX * /* matrix */,
boolean /* Box */);
boolean getCDKMatrixBox (
CDKMATRIX * /* matrix */);
/*
* This moves the matrix on the screen to the given location.
*/
#define moveCDKMatrix(obj,xpos,ypos,relative,refresh) moveCDKObject(obj,xpos,ypos,relative,refresh)
/*
* This allows the user to interactively position the matrix.
*/
#define positionCDKMatrix(widget) positionCDKObject(ObjOf(widget),widget->win)
/*
* This destroys the matrix widget and associated memory.
*/
#define destroyCDKMatrix(obj) destroyCDKObject(obj)
/*
* This jumps to the given matrix cell. You can pass in
* -1 for both the row/col if you want to interactively
* pick the cell.
*/
int jumpToCell (
CDKMATRIX * /* matrix */,
int /* row */,
int /* col */);
/*
* These set the pre/post process callback functions.
*/
#define setCDKMatrixPreProcess(w,f,d) setCDKObjectPreProcess(ObjOf(w),f,d)
#define setCDKMatrixPostProcess(w,f,d) setCDKObjectPostProcess(ObjOf(w),f,d)
#ifdef __cplusplus
}
#endif
#endif /* CDKMATRIX_H */
#endif /* CDKINCLUDES */

260
deps/cdk-5.0-20161210/include/mentry.h vendored Normal file
View File

@@ -0,0 +1,260 @@
/*
* $Id: mentry.h,v 1.23 2012/03/21 21:15:30 tom Exp $
*/
#ifndef CDKINCLUDES
#ifndef CDKMENTRY_H
#define CDKMENTRY_H 1
#ifdef __cplusplus
extern "C" {
#endif
#ifndef CDK_H
#define CDKINCLUDES
#include <cdk.h>
#undef CDKINCLUDES
#include <binding.h>
#include <cdkscreen.h>
#include <cdk_objs.h>
#endif
/*
* Changes 1999-2004,2012 copyright Thomas E. Dickey
*
* Copyright 1999, Mike Glover
* All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions
* are met:
* 1. Redistributions of source code must retain the above copyright
* notice, this list of conditions and the following disclaimer.
* 2. Redistributions in binary form must reproduce the above copyright
* notice, this list of conditions and the following disclaimer in the
* documentation and/or other materials provided with the distribution.
* 3. All advertising materials mentioning features or use of this software
* must display the following acknowledgment:
* This product includes software developed by Mike Glover
* and contributors.
* 4. Neither the name of Mike Glover, nor the names of contributors
* may be used to endorse or promote products derived from this software
* without specific prior written permission.
*
* THIS SOFTWARE IS PROVIDED BY MIKE GLOVER AND CONTRIBUTORS ``AS IS'' AND
* ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
* IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
* ARE DISCLAIMED. IN NO EVENT SHALL MIKE GLOVER OR CONTRIBUTORS BE LIABLE
* FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
* DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
* OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
* HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
* LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
* OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
* SUCH DAMAGE.
*/
/*
* Define the CDK multiple line entry field widget.
*/
typedef struct SMentry CDKMENTRY;
typedef void (*MENTRYCB) (CDKMENTRY *mentry, chtype character);
struct SMentry {
CDKOBJS obj;
WINDOW * parent;
WINDOW * win;
WINDOW * shadowWin;
WINDOW * labelWin;
WINDOW * fieldWin;
int titleAdj;
chtype * label;
int labelLen;
int labelPos;
chtype fieldAttr;
int fieldWidth;
int boxHeight;
int boxWidth;
char * info;
int totalWidth;
int rows;
int currentRow;
int currentCol;
int topRow;
EDisplayType dispType;
int min;
int logicalRows;
EExitType exitType;
boolean shadow;
chtype filler;
chtype hidden;
MENTRYCB callbackfn;
};
/*
* This creates a new CDK mentry field pointer.
*/
CDKMENTRY *newCDKMentry (
CDKSCREEN * /* cdkscreen */,
int /* xpos */,
int /* ypos */,
const char * /* title */,
const char * /* label */,
chtype /* fieldAttr */,
chtype /* filler */,
EDisplayType /* disptype */,
int /* fieldWidth */,
int /* fieldrows */,
int /* logicalRows */,
int /* min */,
boolean /* Box */,
boolean /* shadow */);
/*
* This activates the widget.
*/
char *activateCDKMentry (
CDKMENTRY * /* mentry */,
chtype * /* input */);
/*
* This injects a single character into the widget.
*/
#define injectCDKMentry(obj,input) injectCDKObject(obj,input,String)
/*
* These set specific attributes of the widget.
*/
void setCDKMentry (
CDKMENTRY * /* mentry */,
const char * /* value */,
int /* min */,
boolean /* Box */);
/*
* This sets the value of the widget.
*/
void setCDKMentryValue (
CDKMENTRY * /* mentry */,
const char * /* value */);
char *getCDKMentryValue (
CDKMENTRY * /* mentry */);
/*
* This sets the minimum length of the value for the widget.
*/
void setCDKMentryMin (
CDKMENTRY * /* mentry */,
int /* min */);
int getCDKMentryMin (
CDKMENTRY * /* mentry */);
/*
* This sets the filler character to use when drawing the widget.
*/
void setCDKMentryFillerChar (
CDKMENTRY * /* mentry */,
chtype /* filler */);
chtype getCDKMentryFillerChar (
CDKMENTRY * /* mentry */);
/*
* This sets the character to use when a hidden character type is used.
*/
void setCDKMentryHiddenChar (
CDKMENTRY * /* mentry */,
chtype /* character */);
chtype getCDKMentryHiddenChar (
CDKMENTRY * /* mentry */);
/*
* This sets the box attribute of the mentry widget.
*/
void setCDKMentryBox (
CDKMENTRY * /* mentry */,
boolean /* Box */);
boolean getCDKMentryBox (
CDKMENTRY * /* mentry */);
/*
* These set the drawing characters of the widget.
*/
#define setCDKMentryULChar(w,c) setULCharOf(w,c)
#define setCDKMentryURChar(w,c) setURCharOf(w,c)
#define setCDKMentryLLChar(w,c) setLLCharOf(w,c)
#define setCDKMentryLRChar(w,c) setLRCharOf(w,c)
#define setCDKMentryVerticalChar(w,c) setVTCharOf(w,c)
#define setCDKMentryHorizontalChar(w,c) setHZCharOf(w,c)
#define setCDKMentryBoxAttribute(w,c) setBXAttrOf(w,c)
/*
* This sets the background color of the widget.
*/
#define setCDKMentryBackgroundColor(w,c) setCDKObjectBackgroundColor(ObjOf(w),c)
/*
* This sets the background attribute of the widget.
*/
#define setCDKMentryBackgroundAttrib(w,c) setBKAttrOf(w,c)
/*
* This draws the widget on the screen.
*/
#define drawCDKMentry(obj,Box) drawCDKObject(obj,Box)
/*
* This erases the widget from the screen.
*/
#define eraseCDKMentry(obj) eraseCDKObject(obj)
/*
* This cleans out the information in the widget.
*/
void cleanCDKMentry (
CDKMENTRY * /* mentry */);
/*
* This moves the widget to the given location.
*/
#define moveCDKMentry(obj,xpos,ypos,relative,refresh) moveCDKObject(obj,xpos,ypos,relative,refresh)
/*
* This interactively moves the widget on the screen.
*/
#define positionCDKMentry(widget) positionCDKObject(ObjOf(widget),widget->win)
/*
* This destroys the widget pointer.
*/
#define destroyCDKMentry(obj) destroyCDKObject(obj)
/*
* This draws the field of the widget.
*/
void drawCDKMentryField (
CDKMENTRY * /* mentry */);
/*
* This sets the widgets main callback.
*/
void setCDKMentryCB (
CDKMENTRY * /* mentry */,
MENTRYCB /* callback */);
/*
* These set the pre/post process callback functions.
*/
#define setCDKMentryPreProcess(w,f,d) setCDKObjectPreProcess(ObjOf(w),f,d)
#define setCDKMentryPostProcess(w,f,d) setCDKObjectPostProcess(ObjOf(w),f,d)
#ifdef __cplusplus
}
#endif
#endif /* CDKMENTRY_H */
#endif /* CDKINCLUDES */

199
deps/cdk-5.0-20161210/include/menu.h vendored Normal file
View File

@@ -0,0 +1,199 @@
/*
* $Id: menu.h,v 1.22 2012/03/21 21:15:30 tom Exp $
*/
#ifndef CDKINCLUDES
#ifndef CDKMENU_H
#define CDKMENU_H 1
#ifdef __cplusplus
extern "C" {
#endif
#ifndef CDK_H
#define CDKINCLUDES
#include <cdk.h>
#undef CDKINCLUDES
#include <binding.h>
#include <cdkscreen.h>
#include <cdk_objs.h>
#endif
/*
* Changes 1999-2005,2012 copyright Thomas E. Dickey
*
* Copyright 1999, Mike Glover
* All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions
* are met:
* 1. Redistributions of source code must retain the above copyright
* notice, this list of conditions and the following disclaimer.
* 2. Redistributions in binary form must reproduce the above copyright
* notice, this list of conditions and the following disclaimer in the
* documentation and/or other materials provided with the distribution.
* 3. All advertising materials mentioning features or use of this software
* must display the following acknowledgment:
* This product includes software developed by Mike Glover
* and contributors.
* 4. Neither the name of Mike Glover, nor the names of contributors
* may be used to endorse or promote products derived from this software
* without specific prior written permission.
*
* THIS SOFTWARE IS PROVIDED BY MIKE GLOVER AND CONTRIBUTORS ``AS IS'' AND
* ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
* IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
* ARE DISCLAIMED. IN NO EVENT SHALL MIKE GLOVER OR CONTRIBUTORS BE LIABLE
* FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
* DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
* OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
* HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
* LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
* OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
* SUCH DAMAGE.
*/
/*
* Define menu specific values.
*/
#define MAX_MENU_ITEMS 30
#define MAX_SUB_ITEMS 98
/*
* Define the CDK menu widget structure.
*/
struct SMenu {
CDKOBJS obj;
WINDOW * parent;
WINDOW * pullWin[MAX_MENU_ITEMS];
WINDOW * titleWin[MAX_MENU_ITEMS];
chtype * title[MAX_MENU_ITEMS];
int titleLen[MAX_MENU_ITEMS];
chtype * sublist[MAX_MENU_ITEMS][MAX_SUB_ITEMS];
int sublistLen[MAX_MENU_ITEMS][MAX_SUB_ITEMS];
int subsize[MAX_MENU_ITEMS];
int menuPos;
int menuItems;
chtype titleAttr;
chtype subtitleAttr;
int currentTitle;
int currentSubtitle;
int lastTitle;
int lastSubtitle;
EExitType exitType;
int lastSelection;
};
typedef struct SMenu CDKMENU;
/*
* This creates a new CDK menu widget pointer.
*/
CDKMENU *newCDKMenu (
CDKSCREEN * /* cdkscreen */,
const char * /* menulist */ [MAX_MENU_ITEMS][MAX_SUB_ITEMS],
int /* menuitems */,
int * /* subsize */,
int * /* menuloc */,
int /* menuPos */,
chtype /* titleattr */,
chtype /* subtitleattr */);
/*
* This activates the menu.
*/
int activateCDKMenu (
CDKMENU * /* menu */,
chtype * /* actions */);
/*
* This injects a single character into the menu widget.
*/
#define injectCDKMenu(obj,input) injectCDKObject(obj,input,Int)
/*
* These set specific attributes of the menu.
*/
void setCDKMenu (
CDKMENU * /* menu */,
int /* menuItem */,
int /* subMenuItem */,
chtype /* titleHighlight */,
chtype /* subTitleHighlight */);
/*
* This returns the current item the menu is on.
*/
void setCDKMenuCurrentItem (
CDKMENU * /* menu */,
int /* menuItem */,
int /* subMenuItem */);
void getCDKMenuCurrentItem (
CDKMENU * /* menu */,
int * /* menuItem */,
int * /* subMenuItem */);
/*
* This sets the highlight of the title.
*/
void setCDKMenuTitleHighlight (
CDKMENU * /* menu */,
chtype /* highlight */);
chtype getCDKMenuTitleHighlight (
CDKMENU * /* menu */);
/*
* This sets the sub-menu title highlight.
*/
void setCDKMenuSubTitleHighlight (
CDKMENU * /* menu */,
chtype /* highlight */);
chtype getCDKMenuSubTitleHighlight (
CDKMENU * /* menu */);
/*
* This draws the menu on the screen.
*/
#define drawCDKMenu(obj,box) drawCDKObject(obj,box)
void drawCDKMenuSubwin (
CDKMENU * /* menu */);
/*
* This erases the complere menu widget from the screen.
*/
#define eraseCDKMenu(obj) eraseCDKObject(obj)
void eraseCDKMenuSubwin (
CDKMENU * /* menu */);
/*
* This sets the background color of the widget.
*/
#define setCDKMenuBackgroundColor(w,c) setCDKObjectBackgroundColor(ObjOf(w),c)
/*
* This sets the background attribute of the widget.
*/
#define setCDKMenuBackgroundAttrib(w,c) setBKAttrOf(w,c)
/*
* This destroys the menu widget.
*/
#define destroyCDKMenu(obj) destroyCDKObject(obj)
/*
* These set the pre/post process callback functions.
*/
#define setCDKMenuPreProcess(w,f,d) setCDKObjectPreProcess(ObjOf(w),f,d)
#define setCDKMenuPostProcess(w,f,d) setCDKObjectPostProcess(ObjOf(w),f,d)
#ifdef __cplusplus
}
#endif
#endif /* CDKMENU_H */
#endif /* CDKINCLUDES */

253
deps/cdk-5.0-20161210/include/radio.h vendored Normal file
View File

@@ -0,0 +1,253 @@
/*
* $Id: radio.h,v 1.30 2013/09/01 18:06:41 tom Exp $
*/
#ifndef CDKINCLUDES
#ifndef CDKRADIO_H
#define CDKRADIO_H 1
#ifdef __cplusplus
extern "C" {
#endif
#ifndef CDK_H
#define CDKINCLUDES
#include <cdk.h>
#undef CDKINCLUDES
#include <binding.h>
#include <cdkscreen.h>
#include <cdk_objs.h>
#endif
#include <scroller.h>
/*
* Changes 1999-2012,2013 copyright Thomas E. Dickey
*
* Copyright 1999, Mike Glover
* All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions
* are met:
* 1. Redistributions of source code must retain the above copyright
* notice, this list of conditions and the following disclaimer.
* 2. Redistributions in binary form must reproduce the above copyright
* notice, this list of conditions and the following disclaimer in the
* documentation and/or other materials provided with the distribution.
* 3. All advertising materials mentioning features or use of this software
* must display the following acknowledgment:
* This product includes software developed by Mike Glover
* and contributors.
* 4. Neither the name of Mike Glover, nor the names of contributors
* may be used to endorse or promote products derived from this software
* without specific prior written permission.
*
* THIS SOFTWARE IS PROVIDED BY MIKE GLOVER AND CONTRIBUTORS ``AS IS'' AND
* ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
* IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
* ARE DISCLAIMED. IN NO EVENT SHALL MIKE GLOVER OR CONTRIBUTORS BE LIABLE
* FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
* DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
* OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
* HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
* LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
* OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
* SUCH DAMAGE.
*/
/*
* Define the CDK radio list widget structure.
*/
struct SRadio {
/* This field must stay on top */
SCROLLER_FIELDS;
chtype choiceChar;
chtype leftBoxChar;
chtype rightBoxChar;
int widestItem;
int selectedItem;
int defItem;
};
typedef struct SRadio CDKRADIO;
/*
* This creates a new radio widget pointer.
*/
CDKRADIO *newCDKRadio (
CDKSCREEN * /* cdkscreen */,
int /* xpos */,
int /* ypos */,
int /* spos */,
int /* height */,
int /* width */,
const char * /* title */,
CDK_CSTRING2 /* mesg */,
int /* items */,
chtype /* choiceChar */,
int /* defItem */,
chtype /* highlight */,
boolean /* Box */,
boolean /* shadow */);
/*
* This activates the widget.
*/
int activateCDKRadio (
CDKRADIO * /* radio */,
chtype * /* actions */);
/*
* This injects a single character into the widget.
*/
#define injectCDKRadio(obj,input) injectCDKObject(obj,input,Int)
/*
* These set various attributes of the widget.
*/
void setCDKRadio (
CDKRADIO * /* radio */,
chtype /* highlight */,
chtype /* character */,
boolean /* Box */);
/*
* This sets the contents of the radio list.
*/
void setCDKRadioItems (
CDKRADIO * /* radio */,
CDK_CSTRING2 /* list */,
int /* listSize */);
int getCDKRadioItems (
CDKRADIO * /* radio */,
char ** /* list */);
/*
* This sets the highlight bar attribute.
*/
void setCDKRadioHighlight (
CDKRADIO * /* radio */,
chtype /* highlight */);
chtype getCDKRadioHighlight (
CDKRADIO * /* radio */);
/*
* This sets the 'selected' character.
*/
void setCDKRadioChoiceCharacter (
CDKRADIO * /* radio */,
chtype /* character */);
chtype getCDKRadioChoiceCharacter (
CDKRADIO * /* radio */);
/*
* This sets the character to draw on the left/right side of
* the choice box.
*/
void setCDKRadioLeftBrace (
CDKRADIO * /* radio */,
chtype /* character */);
chtype getCDKRadioLeftBrace (
CDKRADIO * /* radio */);
void setCDKRadioRightBrace (
CDKRADIO * /* radio */,
chtype /* character */);
chtype getCDKRadioRightBrace (
CDKRADIO * /* radio */);
/*
* This sets the box attribute of the widget.
*/
void setCDKRadioBox (
CDKRADIO * /* radio */,
boolean /* Box */);
boolean getCDKRadioBox (
CDKRADIO * /* radio */);
/*
* This sets the current high lighted item of the widget
*/
void setCDKRadioCurrentItem (
CDKRADIO * /* radio */,
int /* current item */);
int getCDKRadioCurrentItem (
CDKRADIO * /* radio */);
/*
* This sets the current selected item of the widget
*/
void setCDKRadioSelectedItem (
CDKRADIO * /* radio */,
int /* current item */);
int getCDKRadioSelectedItem (
CDKRADIO * /* radio */);
/*
* These set the drawing characters of the widget.
*/
#define setCDKRadioULChar(w,c) setULCharOf(w,c)
#define setCDKRadioURChar(w,c) setURCharOf(w,c)
#define setCDKRadioLLChar(w,c) setLLCharOf(w,c)
#define setCDKRadioLRChar(w,c) setLRCharOf(w,c)
#define setCDKRadioVerticalChar(w,c) setVTCharOf(w,c)
#define setCDKRadioHorizontalChar(w,c) setHZCharOf(w,c)
#define setCDKRadioBoxAttribute(w,c) setBXAttrOf(w,c)
/*
* This sets the background color of the widget.
*/
#define setCDKRadioBackgroundColor(w,c) setCDKObjectBackgroundColor(ObjOf(w),c)
/*
* This sets the background attribute of the widget.
*/
#define setCDKRadioBackgroundAttrib(w,c) setBKAttrOf(w,c)
/*
* This draws the widget on the screen.
*/
#define drawCDKRadio(obj,Box) drawCDKObject(obj,Box)
/*
* This erases the widget from the screen.
*/
#define eraseCDKRadio(obj) eraseCDKObject(obj)
/*
* This moves the widget to the given screen location.
*/
#define moveCDKRadio(obj,xpos,ypos,relative,refresh) moveCDKObject(obj,xpos,ypos,relative,refresh)
/*
* This interactively moves the widget to a new location on the screen.
*/
#define positionCDKRadio(widget) positionCDKObject(ObjOf(widget),widget->win)
/*
* This destroys a widget pointer.
*/
#define destroyCDKRadio(obj) destroyCDKObject(obj)
/*
* These set the pre/post process callback functions.
*/
#define setCDKRadioPreProcess(w,f,d) setCDKObjectPreProcess(ObjOf(w),f,d)
#define setCDKRadioPostProcess(w,f,d) setCDKObjectPostProcess(ObjOf(w),f,d)
#ifdef __cplusplus
}
#endif
#endif /* CDKRADIO_H */
#endif /* CDKINCLUDES */

256
deps/cdk-5.0-20161210/include/scroll.h vendored Normal file
View File

@@ -0,0 +1,256 @@
/*
* $Id: scroll.h,v 1.33 2013/09/01 18:06:41 tom Exp $
*/
#ifndef CDKINCLUDES
#ifndef CDKSCROLL_H
#define CDKSCROLL_H 1
#ifdef __cplusplus
extern "C" {
#endif
#ifndef CDK_H
#define CDKINCLUDES
#include <cdk.h>
#undef CDKINCLUDES
#include <binding.h>
#include <cdkscreen.h>
#include <cdk_objs.h>
#endif
#include <scroller.h>
/*
* Changes 1999-2012,2013 copyright Thomas E. Dickey
*
* Copyright 1999, Mike Glover
* All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions
* are met:
* 1. Redistributions of source code must retain the above copyright
* notice, this list of conditions and the following disclaimer.
* 2. Redistributions in binary form must reproduce the above copyright
* notice, this list of conditions and the following disclaimer in the
* documentation and/or other materials provided with the distribution.
* 3. All advertising materials mentioning features or use of this software
* must display the following acknowledgment:
* This product includes software developed by Mike Glover
* and contributors.
* 4. Neither the name of Mike Glover, nor the names of contributors
* may be used to endorse or promote products derived from this software
* without specific prior written permission.
*
* THIS SOFTWARE IS PROVIDED BY MIKE GLOVER AND CONTRIBUTORS ``AS IS'' AND
* ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
* IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
* ARE DISCLAIMED. IN NO EVENT SHALL MIKE GLOVER OR CONTRIBUTORS BE LIABLE
* FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
* DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
* OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
* HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
* LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
* OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
* SUCH DAMAGE.
*/
/*
* Declare scrolling list definitions.
*/
#define NUMBERS TRUE
#define NONUMBERS FALSE
/*
* Declare scrolling list definitions.
*/
struct SScroll {
/* This field must stay on top */
SCROLLER_FIELDS;
boolean numbers; /* */
chtype titlehighlight; /* */
WINDOW *listWin;
};
typedef struct SScroll CDKSCROLL;
/*
* This creates a new CDK scrolling list pointer.
*/
CDKSCROLL *newCDKScroll (
CDKSCREEN * /* cdkscreen */,
int /* xpos */,
int /* ypos */,
int /* spos */,
int /* height */,
int /* width */,
const char * /* title */,
CDK_CSTRING2 /* itemList */,
int /* items */,
boolean /* numbers */,
chtype /* highlight */,
boolean /* Box */,
boolean /* shadow */);
/*
* This activates the scrolling list.
*/
int activateCDKScroll (
CDKSCROLL * /* scroll */,
chtype * /* actions */);
/*
* This injects a single character into the scrolling list.
*/
#define injectCDKScroll(obj,input) injectCDKObject(obj,input,Int)
/*
* This sets various attributes of the scrolling list.
*/
void setCDKScroll (
CDKSCROLL * /* scroll */,
CDK_CSTRING2 /* itemList */,
int /* items */,
boolean /* numbers */,
chtype /* highlight */,
boolean /* Box */);
void setCDKScrollPosition (
CDKSCROLL * /* scroll */,
int /* item */);
int getCDKScrollCurrent(
CDKSCROLL * /* scroll */);
void setCDKScrollCurrent(
CDKSCROLL * /* scroll */,
int /* i */);
int getCDKScrollCurrentTop(
CDKSCROLL * /* scroll */);
void setCDKScrollCurrentTop(
CDKSCROLL * /* scroll */,
int /* i */);
int getCDKScrollCurrentItem(
CDKSCROLL * /* scroll */);
void setCDKScrollCurrentItem(
CDKSCROLL * /* scroll */,
int /* i */);
/*
* This sets the contents of the scrolling list.
*/
void setCDKScrollItems (
CDKSCROLL * /* scroll */,
CDK_CSTRING2 /* itemList */,
int /* items */,
boolean /* numbers */);
int getCDKScrollItems (
CDKSCROLL * /* scroll */,
char ** /* itemList */);
/*
* This sets the highlight bar of the scrolling list.
*/
void setCDKScrollHighlight (
CDKSCROLL * /* scroll */,
chtype /* highlight */);
chtype getCDKScrollHighlight (
CDKSCROLL * /* scroll */,
chtype /* highlight */);
/*
* This sets the box attribute of the widget.
*/
void setCDKScrollBox (
CDKSCROLL * /* scroll */,
boolean /* Box */);
boolean getCDKScrollBox (
CDKSCROLL * /* scroll */);
/*
* These set the drawing characters of the widget.
*/
#define setCDKScrollULChar(w,c) setULCharOf(w,c)
#define setCDKScrollURChar(w,c) setURCharOf(w,c)
#define setCDKScrollLLChar(w,c) setLLCharOf(w,c)
#define setCDKScrollLRChar(w,c) setLRCharOf(w,c)
#define setCDKScrollVerticalChar(w,c) setVTCharOf(w,c)
#define setCDKScrollHorizontalChar(w,c) setHZCharOf(w,c)
#define setCDKScrollBoxAttribute(w,c) setBXAttrOf(w,c)
/*
* This sets the background color of the widget.
*/
#define setCDKScrollBackgroundColor(w,c) setCDKObjectBackgroundColor(ObjOf(w),c)
/*
* This sets the background attribute of the widget.
*/
#define setCDKScrollBackgroundAttrib(w,c) setBKAttrOf(w,c)
/*
* This adds a single item to the end of scrolling list.
*/
void addCDKScrollItem (
CDKSCROLL * /* scroll */,
const char * /* item */);
/*
* This adds a single item into the scrolling list.
*/
void insertCDKScrollItem (
CDKSCROLL * /* scroll */,
const char * /* item */);
/*
* This deletes a single item from the scrolling list.
*/
void deleteCDKScrollItem (
CDKSCROLL * /* scroll */,
int /* position */);
/*
* This draws the scrolling list on the screen.
*/
#define drawCDKScroll(obj,Box) drawCDKObject(obj,Box)
/*
* This removes the scrolling list from the screen.
*/
#define eraseCDKScroll(obj) eraseCDKObject(obj)
/*
* This moves the widget to the given location.
*/
#define moveCDKScroll(obj,xpos,ypos,relative,refresh) moveCDKObject(obj,xpos,ypos,relative,refresh)
/*
* This allows the user to interactively position the widget on the screen.
*/
#define positionCDKScroll(widget) positionCDKObject(ObjOf(widget),widget->win)
/*
* This destroys the widget and all associated memory.
*/
#define destroyCDKScroll(obj) destroyCDKObject(obj)
/*
* These set the scrolling list pre/post process functions.
*/
#define setCDKScrollPreProcess(w,f,d) setCDKObjectPreProcess(ObjOf(w),f,d)
#define setCDKScrollPostProcess(w,f,d) setCDKObjectPostProcess(ObjOf(w),f,d)
#ifdef __cplusplus
}
#endif
#endif /* CDKSCROLL_H */
#endif /* CDKINCLUDES */

117
deps/cdk-5.0-20161210/include/scroller.h vendored Normal file
View File

@@ -0,0 +1,117 @@
/*
* $Id: scroller.h,v 1.3 2013/09/01 21:56:04 tom Exp $
*/
#ifndef CDKINCLUDES
#ifndef SCROLLER_H
#define SCROLLER_H
#ifdef __cplusplus
extern "C" {
#endif
/*
* Copyright 2013 Thomas E.Dickey and Corentin Delorme
* All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions
* are met:
* 1. Redistributions of source code must retain the above copyright
* notice, this list of conditions and the following disclaimer.
* 2. Redistributions in binary form must reproduce the above copyright
* notice, this list of conditions and the following disclaimer in the
* documentation and/or other materials provided with the distribution.
* 3. All advertising materials mentioning features or use of this software
* must display the following acknowledgment:
* This product includes software developed by Thomas E. Dickey
* and contributors.
* 4. Neither the name of Thomas E. Dickey, nor the names of contributors
* may be used to endorse or promote products derived from this software
* without specific prior written permission.
*
* THIS SOFTWARE IS PROVIDED BY THOMAS DICKEY AND CONTRIBUTORS ``AS IS'' AND
* ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
* IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
* ARE DISCLAIMED. IN NO EVENT SHALL THOMAS DICKEY OR CONTRIBUTORS BE LIABLE
* FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
* DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
* OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
* HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
* LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
* OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
* SUCH DAMAGE.
*/
#define SCROLLER_FIELDS \
CDKOBJS obj; \
WINDOW * parent; \
WINDOW * win; \
WINDOW * scrollbarWin; \
WINDOW * shadowWin; \
int titleAdj; /* unused */ \
chtype ** item; \
int * itemLen; \
int * itemPos; \
\
int currentTop; \
int currentItem; \
int currentHigh; \
\
int maxTopItem; \
int maxLeftChar; \
int maxchoicelen; \
int leftChar; \
int lastItem; \
int listSize; \
int boxWidth; \
int boxHeight; \
int viewSize; \
\
int scrollbarPlacement; \
boolean scrollbar; \
int toggleSize; /* size of scrollbar thumb/toggle */ \
int togglePos; /* position of scrollbar thumb/toggle */ \
float step; /* increment for scrollbar */ \
\
EExitType exitType; \
boolean shadow; \
chtype highlight
struct SScroller {
/* This field must stay on top */
SCROLLER_FIELDS;
};
typedef struct SScroller CDKSCROLLER;
void scroller_KEY_UP (CDKSCROLLER * /* scroller */);
void scroller_KEY_DOWN (CDKSCROLLER * /* scroller */);
void scroller_KEY_LEFT (CDKSCROLLER * /* scroller */);
void scroller_KEY_RIGHT (CDKSCROLLER * /* scroller */);
void scroller_KEY_PPAGE (CDKSCROLLER * /* scroller */);
void scroller_KEY_NPAGE (CDKSCROLLER * /* scroller */);
void scroller_KEY_HOME (CDKSCROLLER * /* scroller */);
void scroller_KEY_END (CDKSCROLLER * /* scroller */);
void scroller_FixCursorPosition (CDKSCROLLER * /* scroller */);
void scroller_SetPosition (CDKSCROLLER * /* scroller */, int /* item */);
int scroller_MaxViewSize (CDKSCROLLER * /* scroller */);
void scroller_SetViewSize (CDKSCROLLER * /* scroller */, int /* size */);
#ifdef __cplusplus
}
#endif
#endif /* SCROLLER_H */
#endif /* CDKINCLUDES */

View File

@@ -0,0 +1,265 @@
/*
* $Id: selection.h,v 1.28 2013/09/01 18:06:41 tom Exp $
*/
#ifndef CDKINCLUDES
#ifndef CDKSELECTION_H
#define CDKSELECTION_H 1
#ifdef __cplusplus
extern "C" {
#endif
#ifndef CDK_H
#define CDKINCLUDES
#include <cdk.h>
#undef CDKINCLUDES
#include <binding.h>
#include <cdkscreen.h>
#include <cdk_objs.h>
#endif
/*
* Changes 1999-2012,2013 copyright Thomas E. Dickey
*
* Copyright 1999, Mike Glover
* All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions
* are met:
* 1. Redistributions of source code must retain the above copyright
* notice, this list of conditions and the following disclaimer.
* 2. Redistributions in binary form must reproduce the above copyright
* notice, this list of conditions and the following disclaimer in the
* documentation and/or other materials provided with the distribution.
* 3. All advertising materials mentioning features or use of this software
* must display the following acknowledgment:
* This product includes software developed by Mike Glover
* and contributors.
* 4. Neither the name of Mike Glover, nor the names of contributors
* may be used to endorse or promote products derived from this software
* without specific prior written permission.
*
* THIS SOFTWARE IS PROVIDED BY MIKE GLOVER AND CONTRIBUTORS ``AS IS'' AND
* ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
* IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
* ARE DISCLAIMED. IN NO EVENT SHALL MIKE GLOVER OR CONTRIBUTORS BE LIABLE
* FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
* DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
* OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
* HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
* LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
* OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
* SUCH DAMAGE.
*/
/*
* Declare selection list definitions.
*/
#define MAX_CHOICES 100 /* unused by widgets */
/*
* Define the CDK selection widget structure.
*/
struct SSelection {
/* This field must stay on top */
SCROLLER_FIELDS;
chtype ** choice;
int * choicelen;
int choiceCount;
int * selections;
int * mode;
};
typedef struct SSelection CDKSELECTION;
/*
* This creates a new pointer to a selection widget.
*/
CDKSELECTION *newCDKSelection (
CDKSCREEN * /* cdkscreen */,
int /* xpos */,
int /* ypos */,
int /* spos */,
int /* height */,
int /* width */,
const char * /* title */,
CDK_CSTRING2 /* list */,
int /* listSize */,
CDK_CSTRING2 /* choices */,
int /* choiceSize */,
chtype /* highlight */,
boolean /* Box */,
boolean /* shadow */);
/*
* This activates the selection widget.
*/
int activateCDKSelection (
CDKSELECTION * /* selection */,
chtype * /* actions */);
/*
* This injects a single character into the widget.
*/
#define injectCDKSelection(obj,input) injectCDKObject(obj,input,Int)
/*
* This draws the selection widget.
*/
#define drawCDKSelection(obj,Box) drawCDKObject(obj,Box)
/*
* This erases the selection widget from the screen.
*/
#define eraseCDKSelection(obj) eraseCDKObject(obj)
/*
* This moves the widget to the given location.
*/
#define moveCDKSelection(obj,xpos,ypos,relative,refresh) moveCDKObject(obj,xpos,ypos,relative,refresh)
/*
* This interactively moves the widget on the screen.
*/
#define positionCDKSelection(widget) positionCDKObject(ObjOf(widget),widget->win)
/*
* This destroys the widget and all associated memory.
*/
#define destroyCDKSelection(obj) destroyCDKObject(obj)
/*
* This sets various attributes of the selection widget.
*/
void setCDKSelection (
CDKSELECTION * /* selection */,
chtype /* highlight */,
int * /* defChoices */,
boolean /* Box */);
/*
* This sets the contents of the selection list.
*/
void setCDKSelectionItems (
CDKSELECTION * /* selection */,
CDK_CSTRING2 /* list */,
int /* listSize */);
int getCDKSelectionItems (
CDKSELECTION * /* selection */,
char ** /* list */);
/*
*
*/
void setCDKSelectionTitle (
CDKSELECTION * /* selection */,
const char * /* title */);
char *getCDKSelectionTitle (
CDKSELECTION * /* selection */);
/*
* This sets the selection list highlight bar.
*/
void setCDKSelectionHighlight (
CDKSELECTION * /* selection */,
chtype /* highlight */);
chtype getCDKSelectionHighlight (
CDKSELECTION * /* selection */);
/*
* set/get the current item index
*/
void setCDKSelectionCurrent (
CDKSELECTION * /* selection */,
int /* index */);
int getCDKSelectionCurrent (
CDKSELECTION * /* selection */);
/*
* This sets the choices of the selection list.
*/
void setCDKSelectionChoices (
CDKSELECTION * /* selection */,
int * /* choices */);
int *getCDKSelectionChoices (
CDKSELECTION * /* selection */);
void setCDKSelectionChoice (
CDKSELECTION * /* selection */,
int /* index */,
int /* choice */);
int getCDKSelectionChoice (
CDKSELECTION * /* selection */,
int /* index */);
/*
* This sets the modes of the items in the selection list. Currently
* there are only two: editable=0 and read-only=1
*/
void setCDKSelectionModes (
CDKSELECTION * /* selection */,
int * /* modes */);
int *getCDKSelectionModes (
CDKSELECTION * /* selection */);
void setCDKSelectionMode (
CDKSELECTION * /* selection */,
int /* index */,
int /* mode */);
int getCDKSelectionMode (
CDKSELECTION * /* selection */,
int /* index */);
/*
* This sets the box attribute of the widget.
*/
void setCDKSelectionBox (
CDKSELECTION * /* selection */,
boolean /* Box */);
boolean getCDKSelectionBox (
CDKSELECTION * /* selection */);
/*
* These set the drawing characters of the widget.
*/
#define setCDKSelectionULChar(w,c) setULCharOf(w,c)
#define setCDKSelectionURChar(w,c) setURCharOf(w,c)
#define setCDKSelectionLLChar(w,c) setLLCharOf(w,c)
#define setCDKSelectionLRChar(w,c) setLRCharOf(w,c)
#define setCDKSelectionVerticalChar(w,c) setVTCharOf(w,c)
#define setCDKSelectionHorizontalChar(w,c) setHZCharOf(w,c)
#define setCDKSelectionBoxAttribute(w,c) setBXAttrOf(w,c)
/*
* This sets the background color of the widget.
*/
#define setCDKSelectionBackgroundColor(w,c) setCDKObjectBackgroundColor(ObjOf(w),c)
/*
* This sets the background attribute of the widget.
*/
#define setCDKSelectionBackgroundAttrib(w,c) setBKAttrOf(w,c)
/*
* These set the pre/post process callback functions.
*/
#define setCDKSelectionPreProcess(w,f,d) setCDKObjectPreProcess(ObjOf(w),f,d)
#define setCDKSelectionPostProcess(w,f,d) setCDKObjectPostProcess(ObjOf(w),f,d)
#ifdef __cplusplus
}
#endif
#endif /* CDKSELECTION_H */
#endif /* CDKINCLUDES */

259
deps/cdk-5.0-20161210/include/swindow.h vendored Normal file
View File

@@ -0,0 +1,259 @@
/*
* $Id: swindow.h,v 1.24 2012/03/21 21:15:30 tom Exp $
*/
#ifndef CDKINCLUDES
#ifndef CDKSWINDOW_H
#define CDKSWINDOW_H 1
#ifdef __cplusplus
extern "C" {
#endif
#ifndef CDK_H
#define CDKINCLUDES
#include <cdk.h>
#undef CDKINCLUDES
#include <binding.h>
#include <cdkscreen.h>
#include <cdk_objs.h>
#endif
/*
* Changes 1999-2004,2012 copyright Thomas E. Dickey
*
* Copyright 1999, Mike Glover
* All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions
* are met:
* 1. Redistributions of source code must retain the above copyright
* notice, this list of conditions and the following disclaimer.
* 2. Redistributions in binary form must reproduce the above copyright
* notice, this list of conditions and the following disclaimer in the
* documentation and/or other materials provided with the distribution.
* 3. All advertising materials mentioning features or use of this software
* must display the following acknowledgment:
* This product includes software developed by Mike Glover
* and contributors.
* 4. Neither the name of Mike Glover, nor the names of contributors
* may be used to endorse or promote products derived from this software
* without specific prior written permission.
*
* THIS SOFTWARE IS PROVIDED BY MIKE GLOVER AND CONTRIBUTORS ``AS IS'' AND
* ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
* IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
* ARE DISCLAIMED. IN NO EVENT SHALL MIKE GLOVER OR CONTRIBUTORS BE LIABLE
* FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
* DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
* OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
* HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
* LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
* OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
* SUCH DAMAGE.
*/
/*
* Define the CDK scrolling window widget structure.
*/
struct SSwindow {
CDKOBJS obj;
WINDOW * parent;
WINDOW * win;
WINDOW * fieldWin;
WINDOW * shadowWin;
chtype ** list;
int * listPos;
int * listLen;
int titleAdj;
int listSize;
int boxHeight;
int boxWidth;
int viewSize;
int maxTopLine;
int currentTop;
int leftChar;
int maxLeftChar;
int widestLine;
int saveLines;
EExitType exitType;
boolean shadow;
};
typedef struct SSwindow CDKSWINDOW;
typedef void (*SWINDOWCB) (CDKSWINDOW *swindow, chtype input);
/*
* This creates a new pointer to a scrolling window widget.
*/
CDKSWINDOW *newCDKSwindow (
CDKSCREEN * /* cdkscreen */,
int /* xpos */,
int /* ypos */,
int /* height */,
int /* width */,
const char * /* title */,
int /* saveLines */,
boolean /* Box */,
boolean /* shadow */);
/*
* This activates the scrolling window.
*/
void activateCDKSwindow (
CDKSWINDOW * /* swindow */,
chtype * /* actions */);
/*
* This injects a single character into the scrolling window.
*/
#define injectCDKSwindow(obj,input) injectCDKObject(obj,input,Int)
/*
* This executes the given command and puts the output of the
* command into the scrolling window.
*/
int execCDKSwindow (
CDKSWINDOW * /* swindow */,
const char * /* command */,
int /* insertPos */);
/*
* This dumps the contents of the scrolling window to the given filename.
*/
int dumpCDKSwindow (
CDKSWINDOW * /* swindow */,
const char * /* filename */);
/*
* This jumps to the given line in the window.
*/
void jumpToLineCDKSwindow (
CDKSWINDOW * /* swindow */,
int /* line */);
/*
* This saves the contents of the scrolling window via an
* interactive window.
*/
void saveCDKSwindowInformation (
CDKSWINDOW * /* swindow */);
/*
* This loads the window up with information from a filename
* interactively provided.
*/
void loadCDKSwindowInformation (
CDKSWINDOW * /* swindow */);
/*
* These functions set the attributes of the scrolling window.
*/
void setCDKSwindow (
CDKSWINDOW * /* swindow */,
CDK_CSTRING2 /* info */,
int /* lines */,
boolean /* Box */);
/*
* This sets the contents of the scrolling window.
*/
void setCDKSwindowContents (
CDKSWINDOW * /* swindow */,
CDK_CSTRING2 /* info */,
int /* lines */);
chtype **getCDKSwindowContents (
CDKSWINDOW * /* swindow */,
int * /* size */);
/*
* This sets the box attribute of the scrolling window.
*/
void setCDKSwindowBox (
CDKSWINDOW * /* swindow */,
boolean /* Box */);
boolean getCDKSwindowBox (
CDKSWINDOW * /* swindow */);
/*
* These set the drawing characters of the widget.
*/
#define setCDKSwindowULChar(w,c) setULCharOf(w,c)
#define setCDKSwindowURChar(w,c) setURCharOf(w,c)
#define setCDKSwindowLLChar(w,c) setLLCharOf(w,c)
#define setCDKSwindowLRChar(w,c) setLRCharOf(w,c)
#define setCDKSwindowVerticalChar(w,c) setVTCharOf(w,c)
#define setCDKSwindowHorizontalChar(w,c) setHZCharOf(w,c)
#define setCDKSwindowBoxAttribute(w,c) setBXAttrOf(w,c)
/*
* This sets the background color of the widget.
*/
#define setCDKSwindowBackgroundColor(w,c) setCDKObjectBackgroundColor(ObjOf(w),c)
/*
* This sets the background attribute of the widget.
*/
#define setCDKSwindowBackgroundAttrib(w,c) setBKAttrOf(w,c)
/*
* This draws the scrolling window on the screen.
*/
#define drawCDKSwindow(obj,Box) drawCDKObject(obj,Box)
/*
* This removes the widget from the screen.
*/
#define eraseCDKSwindow(obj) eraseCDKObject(obj)
/*
* This cleans out all of the information from the window.
*/
void cleanCDKSwindow (
CDKSWINDOW * /* swindow */);
/*
* This adds a line to the window.
*/
void addCDKSwindow (
CDKSWINDOW * /* swindow */,
const char * /* info */,
int /* insertPos */);
/*
* This trims lines from the window.
*/
void trimCDKSwindow (
CDKSWINDOW * /* swindow */,
int /* start */,
int /* finish */);
/*
* This moves the window to the given location.
*/
#define moveCDKSwindow(obj,xpos,ypos,relative,refresh) moveCDKObject(obj,xpos,ypos,relative,refresh)
/*
* This interactively positions the widget on the screen.
*/
#define positionCDKSwindow(widget) positionCDKObject(ObjOf(widget),widget->win)
/*
* This destroys the widget and all associated memory.
*/
#define destroyCDKSwindow(obj) destroyCDKObject(obj)
/*
* These set the pre/post process callback functions.
*/
#define setCDKSwindowPreProcess(w,f,d) setCDKObjectPreProcess(ObjOf(w),f,d)
#define setCDKSwindowPostProcess(w,f,d) setCDKObjectPostProcess(ObjOf(w),f,d)
#ifdef __cplusplus
}
#endif
#endif /* CDKSWINDOW_H */
#endif /* CDKINCLUDES */

243
deps/cdk-5.0-20161210/include/template.h vendored Normal file
View File

@@ -0,0 +1,243 @@
/*
* $Id: template.h,v 1.24 2012/03/21 21:15:30 tom Exp $
*/
#ifndef CDKINCLUDES
#ifndef CDKTEMPLATE_H
#define CDKTEMPLATE_H 1
#ifdef __cplusplus
extern "C" {
#endif
#ifndef CDK_H
#define CDKINCLUDES
#include <cdk.h>
#undef CDKINCLUDES
#include <binding.h>
#include <cdkscreen.h>
#include <cdk_objs.h>
#endif
/*
* Changes 1999-2004,2012 copyright Thomas E. Dickey
*
* Copyright 1999, Mike Glover
* All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions
* are met:
* 1. Redistributions of source code must retain the above copyright
* notice, this list of conditions and the following disclaimer.
* 2. Redistributions in binary form must reproduce the above copyright
* notice, this list of conditions and the following disclaimer in the
* documentation and/or other materials provided with the distribution.
* 3. All advertising materials mentioning features or use of this software
* must display the following acknowledgment:
* This product includes software developed by Mike Glover
* and contributors.
* 4. Neither the name of Mike Glover, nor the names of contributors
* may be used to endorse or promote products derived from this software
* without specific prior written permission.
*
* THIS SOFTWARE IS PROVIDED BY MIKE GLOVER AND CONTRIBUTORS ``AS IS'' AND
* ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
* IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
* ARE DISCLAIMED. IN NO EVENT SHALL MIKE GLOVER OR CONTRIBUTORS BE LIABLE
* FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
* DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
* OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
* HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
* LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
* OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
* SUCH DAMAGE.
*/
/*
* Define the CDK cdktemplate widget structure.
*/
typedef struct STemplate CDKTEMPLATE;
typedef void (*TEMPLATECB) (CDKTEMPLATE *cdktemplate, chtype input);
struct STemplate {
CDKOBJS obj;
WINDOW * parent;
WINDOW * win;
WINDOW * shadowWin;
WINDOW * labelWin;
WINDOW * fieldWin;
int titleAdj;
chtype * label;
chtype * overlay;
chtype overlayAttr;
char * plate;
char * info;
int labelLen;
int overlayLen;
int labelPos;
int fieldWidth;
int boxWidth;
int boxHeight;
int platePos;
int plateLen;
int screenPos;
int infoPos;
int min;
chtype labelAttr;
chtype fieldAttr;
EExitType exitType;
boolean shadow;
TEMPLATECB callbackfn;
};
/*
* This creates a pointer to a new CDK cdktemplate widget.
*/
CDKTEMPLATE *newCDKTemplate (
CDKSCREEN * /* cdkscreen */,
int /* xpos */,
int /* ypos */,
const char * /* title */,
const char * /* label */,
const char * /* plate */,
const char * /* overlay */,
boolean /* Box */,
boolean /* shadow */);
/*
* This activates the cdktemplate widget.
*/
char *activateCDKTemplate (
CDKTEMPLATE * /* cdktemplate */,
chtype * /* actions */);
/*
* This injects a single character into the widget.
*/
#define injectCDKTemplate(obj,input) injectCDKObject(obj,input,String)
/*
* This sets various attributes of the widget.
*/
void setCDKTemplate (
CDKTEMPLATE * /* cdktemplate */,
const char * /* value */,
boolean /* Box */);
/*
* This sets the value in the cdktemplate widget.
*/
void setCDKTemplateValue (
CDKTEMPLATE * /* cdktemplate */,
const char * /* value */);
char *getCDKTemplateValue (
CDKTEMPLATE * /* cdktemplate */);
/*
* This sets the minimum number of characters to enter.
*/
void setCDKTemplateMin (
CDKTEMPLATE * /* cdktemplate */,
int /* min */);
int getCDKTemplateMin (
CDKTEMPLATE * /* cdktemplate */);
/*
* This sets the box attribute of the widget.
*/
void setCDKTemplateBox (
CDKTEMPLATE * /* cdktemplate */,
boolean /* Box */);
boolean getCDKTemplateBox (
CDKTEMPLATE * /* cdktemplate */);
/*
* These set the drawing characters of the widget.
*/
#define setCDKTemplateULChar(w,c) setULCharOf(w,c)
#define setCDKTemplateURChar(w,c) setURCharOf(w,c)
#define setCDKTemplateLLChar(w,c) setLLCharOf(w,c)
#define setCDKTemplateLRChar(w,c) setLRCharOf(w,c)
#define setCDKTemplateVerticalChar(w,c) setVTCharOf(w,c)
#define setCDKTemplateHorizontalChar(w,c) setHZCharOf(w,c)
#define setCDKTemplateBoxAttribute(w,c) setBXAttrOf(w,c)
/*
* This sets the background color of the widget.
*/
#define setCDKTemplateBackgroundColor(w,c) setCDKObjectBackgroundColor(ObjOf(w),c)
/*
* This sets the background attribute of the widget.
*/
#define setCDKTemplateBackgroundAttrib(w,c) setBKAttrOf(w,c)
/*
* This draws the cdktemplate on the screen.
*/
#define drawCDKTemplate(obj,Box) drawCDKObject(obj,Box)
/*
* This erases the widget from the screen.
*/
#define eraseCDKTemplate(obj) eraseCDKObject(obj)
/*
* This erases the cdktemplates contents.
*/
void cleanCDKTemplate (
CDKTEMPLATE * /* cdktemplate */);
/*
* This moves the widget to the given location on the screen.
*/
#define moveCDKTemplate(obj,xpos,ypos,relative,refresh) moveCDKObject(obj,xpos,ypos,relative,refresh)
/*
* This interactively positions the widget on the screen.
*/
#define positionCDKTemplate(widget) positionCDKObject(ObjOf(widget),widget->win)
/*
* This destroys the widget and all associated memory.
*/
#define destroyCDKTemplate(obj) destroyCDKObject(obj)
/*
* This sets the main callback function.
*/
void setCDKTemplateCB (
CDKTEMPLATE * /* cdktemplate */,
TEMPLATECB /* callback */);
/*
* This returns a character pointer to the contents of the cdktemplate
* mixed with the plate.
*/
char *mixCDKTemplate (
CDKTEMPLATE * /* cdktemplate */);
/*
* This returns a character pointer to the cdktemplate with the plate
* stripped out.
*/
char *unmixCDKTemplate (
CDKTEMPLATE * /* cdktemplate */,
const char * /* string */);
/*
* These set the pre/post callback functions.
*/
#define setCDKTemplatePreProcess(w,f,d) setCDKObjectPreProcess(ObjOf(w),f,d)
#define setCDKTemplatePostProcess(w,f,d) setCDKObjectPostProcess(ObjOf(w),f,d)
#ifdef __cplusplus
}
#endif
#endif /* CDKTEMPLATE_H */
#endif /* CDKINCLUDES */

View File

@@ -0,0 +1,73 @@
/*
* $Id: traverse.h,v 1.9 2005/12/30 01:09:09 tom Exp $
*/
#ifndef CDKINCLUDES
#ifndef CDKTRAVERSE_H
#define CDKTRAVERSE_H 1
#include "cdk.h"
#ifndef CDK_H
#define CDKINCLUDES
#include <cdk.h>
#undef CDKINCLUDES
#include <binding.h>
#include <cdkscreen.h>
#include <cdk_objs.h>
#endif
/*
* Copyright 1999-2004,2005 Thomas E. Dickey
* All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions
* are met:
* 1. Redistributions of source code must retain the above copyright
* notice, this list of conditions and the following disclaimer.
* 2. Redistributions in binary form must reproduce the above copyright
* notice, this list of conditions and the following disclaimer in the
* documentation and/or other materials provided with the distribution.
* 3. All advertising materials mentioning features or use of this software
* must display the following acknowledgment:
* This product includes software developed by Thomas Dickey
* and contributors.
* 4. Neither the name of Thomas Dickey, nor the names of contributors
* may be used to endorse or promote products derived from this software
* without specific prior written permission.
*
* THIS SOFTWARE IS PROVIDED BY THOMAS DICKEY AND CONTRIBUTORS ``AS IS'' AND
* ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
* IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
* ARE DISCLAIMED. IN NO EVENT SHALL THOMAS DICKEY OR CONTRIBUTORS BE LIABLE
* FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
* DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
* OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
* HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
* LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
* OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
* SUCH DAMAGE.
*/
typedef boolean (*CHECK_KEYCODE)(int /* keyCode */, int /* functionKey */);
extern CDKOBJS *getCDKFocusCurrent (CDKSCREEN * /* screen */);
extern CDKOBJS *setCDKFocusCurrent (CDKSCREEN * /*screen */, CDKOBJS * /* obj */);
extern CDKOBJS *setCDKFocusNext (CDKSCREEN * /* screen */);
extern CDKOBJS *setCDKFocusPrevious (CDKSCREEN * /* screen */);
extern CDKOBJS *setCDKFocusFirst (CDKSCREEN * /* screen */);
extern CDKOBJS *setCDKFocusLast (CDKSCREEN * /* screen */);
extern int traverseCDKScreen (CDKSCREEN * /* screen */);
extern void exitCancelCDKScreen (CDKSCREEN * /* screen */);
extern void exitCancelCDKScreenOf (CDKOBJS * /* obj */);
extern void exitOKCDKScreen (CDKSCREEN * /* screen */);
extern void exitOKCDKScreenOf (CDKOBJS * /* obj */);
extern void resetCDKScreen (CDKSCREEN * /* screen */);
extern void resetCDKScreenOf (CDKOBJS * /* obj */);
extern void traverseCDKOnce (CDKSCREEN * /*screen */, CDKOBJS * /*curobj */, int /* keyCode */, boolean /* functionKey */, CHECK_KEYCODE /*funcMenuKey */);
#endif /* CDKTRAVERSE_H */
#endif /* CDKINCLUDES */

240
deps/cdk-5.0-20161210/include/viewer.h vendored Normal file
View File

@@ -0,0 +1,240 @@
/*
* $Id: viewer.h,v 1.22 2012/03/21 21:15:30 tom Exp $
*/
#ifndef CDKINCLUDES
#ifndef CDKVIEWER_H
#define CDKVIEWER_H 1
#ifdef __cplusplus
extern "C" {
#endif
#ifndef CDK_H
#define CDKINCLUDES
#include <cdk.h>
#undef CDKINCLUDES
#include <binding.h>
#include <cdkscreen.h>
#include <cdk_objs.h>
#endif
/*
* Changes 1999-2004,2012 copyright Thomas E. Dickey
*
* Copyright 1999, Mike Glover
* All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions
* are met:
* 1. Redistributions of source code must retain the above copyright
* notice, this list of conditions and the following disclaimer.
* 2. Redistributions in binary form must reproduce the above copyright
* notice, this list of conditions and the following disclaimer in the
* documentation and/or other materials provided with the distribution.
* 3. All advertising materials mentioning features or use of this software
* must display the following acknowledgment:
* This product includes software developed by Mike Glover
* and contributors.
* 4. Neither the name of Mike Glover, nor the names of contributors
* may be used to endorse or promote products derived from this software
* without specific prior written permission.
*
* THIS SOFTWARE IS PROVIDED BY MIKE GLOVER AND CONTRIBUTORS ``AS IS'' AND
* ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
* IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
* ARE DISCLAIMED. IN NO EVENT SHALL MIKE GLOVER OR CONTRIBUTORS BE LIABLE
* FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
* DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
* OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
* HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
* LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
* OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
* SUCH DAMAGE.
*/
/*
* Define the CDK viewer widget structure.
*/
struct SViewer {
CDKOBJS obj;
WINDOW * parent;
WINDOW * win;
WINDOW * shadowWin;
chtype ** button;
int * buttonLen;
int * buttonPos;
int buttonCount;
chtype buttonHighlight;
chtype ** list;
int * listLen;
int * listPos;
int titleAdj;
int listSize;
int boxHeight;
int boxWidth;
int viewSize;
int currentTop;
int currentButton;
int leftChar;
int length;
int maxLeftChar;
int maxTopLine;
int widestLine;
long characters;
boolean inProgress;
boolean showLineInfo;
boolean interpret;
EExitType exitType;
boolean shadow;
};
typedef struct SViewer CDKVIEWER;
/*
* This creates a pointer to a new CDK viewer widget.
*/
CDKVIEWER *newCDKViewer (
CDKSCREEN * /* cdkscreen */,
int /* xpos */,
int /* ypos */,
int /* height */,
int /* width */,
CDK_CSTRING2 /* buttons */,
int /* buttonCount */,
chtype /* buttonHighlight */,
boolean /* Box */,
boolean /* shadow */);
/*
* This activates the viewer widget.
*/
int activateCDKViewer (
CDKVIEWER * /* viewer */,
chtype * /* actions */);
/*
* This sets various attributes of the viewer widget.
*/
int setCDKViewer (
CDKVIEWER * /* viewer */,
const char * /* title */,
CDK_CSTRING2 /* info */,
int /* infoSize */,
chtype /* buttonHighlight */,
boolean /* interpret */,
boolean /* showLineInfo */,
boolean /* Box */);
/*
* This sets the contents of the viewer widget.
*/
int setCDKViewerInfo (
CDKVIEWER * /* viewer */,
CDK_CSTRING2 /* info */,
int /* infoSize */,
boolean /* interpret */);
chtype **getCDKViewerInfo (
CDKVIEWER * /* viewer */,
int * /* size */);
/*
* This sets the title of the viewer widget.
*/
void setCDKViewerTitle (
CDKVIEWER * /* viewer */,
const char * /* title */);
chtype **getCDKViewerTitle (
CDKVIEWER * /* viewer */);
/*
* This sets the highlight bar attribute.
*/
void setCDKViewerHighlight (
CDKVIEWER * /* viewer */,
chtype /* buttonHighlight */);
chtype getCDKViewerHighlight (
CDKVIEWER * /* viewer */);
/*
* This sets the boolean flag dictating whether a information line
* will be displayed in the top left corner of the viewer.
*/
void setCDKViewerInfoLine (
CDKVIEWER * /* viewer */,
boolean /* showLineInfo */);
boolean getCDKViewerInfoLine (
CDKVIEWER * /* viewer */);
/*
* This sets the box attribute of the widget.
*/
void setCDKViewerBox (
CDKVIEWER * /* viewer */,
boolean /* Box */);
boolean getCDKViewerBox (
CDKVIEWER * /* viewer */);
/*
* These set the drawing characters of the widget.
*/
#define setCDKViewerULChar(w,c) setULCharOf(w,c)
#define setCDKViewerURChar(w,c) setURCharOf(w,c)
#define setCDKViewerLLChar(w,c) setLLCharOf(w,c)
#define setCDKViewerLRChar(w,c) setLRCharOf(w,c)
#define setCDKViewerVerticalChar(w,c) setVTCharOf(w,c)
#define setCDKViewerHorizontalChar(w,c) setHZCharOf(w,c)
#define setCDKViewerBoxAttribute(w,c) setBXAttrOf(w,c)
/*
* This sets the background color of the widget.
*/
#define setCDKViewerBackgroundColor(w,c) setCDKObjectBackgroundColor(ObjOf(w),c)
/*
* This sets the background attribute of the widget.
*/
#define setCDKViewerBackgroundAttrib(w,c) setBKAttrOf(w,c)
/*
* This draws the viewer field on the screen.
*/
#define drawCDKViewer(obj,box) drawCDKObject(obj,box)
/*
* This erases the widget from the screen.
*/
#define eraseCDKViewer(obj) eraseCDKObject(obj)
/*
* This cleans out all of the information from the viewer.
*/
void cleanCDKViewer (
CDKVIEWER * /* viewer */);
/*
* This moves the widget to the given location.
*/
#define moveCDKViewer(obj,xpos,ypos,relative,refresh) moveCDKObject(obj,xpos,ypos,relative,refresh)
/*
* This is an interactive method of moving the widget.
*/
#define positionCDKViewer(widget) positionCDKObject(ObjOf(widget),widget->win)
/*
* This destroys the widget and all the memory associated with the widget.
*/
#define destroyCDKViewer(obj) destroyCDKObject(obj)
#ifdef __cplusplus
}
#endif
#endif /* CDKVIEWER_H */
#endif /* CDKINCLUDES */