home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Carousel Volume 2 #1
/
carousel.iso
/
mactosh
/
lang
/
listmana.sha
/
list.h
< prev
next >
Wrap
C/C++ Source or Header
|
1986-07-10
|
5KB
|
118 lines
#include <quickdraw.h>
#include <control.h>
#include <window.h>
typedef Point Cell;
typedef char DataArray[32000];
typedef DataArray *DataPtr;
typedef DataPtr *DataHandle;
typedef struct
{
Rect rView;
GrafPtr port;
Point indent,
cellSize;
Rect visible;
ControlHandle vScroll,
hScroll;
Byte selFlags;
Boolean LActive;
Byte LReserved,
listFlags;
long clikTime;
Point clikLoc,
mouseLoc;
Ptr LClikLoop;
Cell lastClick;
long refCon;
Handle listDefProc,
userHandle;
Rect dataBounds;
DataHandle cells;
short maxIndex;
int cellArray[1];
} ListRec;
typedef ListRec *ListPtr;
typedef ListPtr *ListHandle;
#define LDoVAutoScroll 2
#define LDoHAutoScroll 1
#define LOnlyOne 128
#define LExtendDrag 64
#define LNoDisjoint 32
#define LNoExtend 16
#define LNoRect 8
#define LUseSense 4
#define LNoNilHilite 2
pascal void Pack0_v() = 0xa9e7;
pascal short Pack0_w() = 0xa9e7;
pascal long Pack0_l() = 0xa9e7;
/* Note -- Aztec C is supposed to know Booleans are 0x0100, but that
* seems to be enforced only through .h files. So here it is
* enforced by "(256 == Pack0_w(...))".
* A similar technique is used in LActivate to make the Boolean
* argument there be either 0x100 or 0, "a ? 256 : 0".
*/
/* Creating and Disposing Lists */
#define LNew(a,b,c,d,e,f,g,h,i) ((ListHandle) Pack0_l(a,b,c,d,e,f,g,h,i,68))
#define LDispose(a) (Pack0_v(a, 40))
/* Operations on Rows and Columns */
#define LAddColumn(a,b,c) (Pack0_w(a,b,c,4))
#define LAddRow(a,b,c) (Pack0_w(a,b,c,8))
#define LDelColumn(a,b,c) (Pack0_v(a,b,c,32))
#define LDelRow(a,b,c) (Pack0_v(a,b,c,36))
/* Operations on Cells */
#define LAddToCell(a,b,c,d) (Pack0_v(a,b,c,d,12))
#define LClrCell(a,b) (Pack0_v(a,b,28))
#define LGetCell(a,b,c,d) (Pack0_v(a,b,c,d,56))
#define LSetCell(a,b,c,d) (Pack0_v(a,b,c,d,88))
#define LCellSize(a,b) (Pack0_v(a,b,20))
#define LGetSelect(a,b,c) (256 == Pack0_w(a,b,c,60))
#define LSetSelect(a,b,c) (Pack0_v(a,b,c,92))
/* Mouse Location */
#define LClick(a,b,c) (256 == Pack0_w(a,b,c,24))
#define LLastClick(a) ((long) Pack0_l(a,64))
/* Aztec C can't return structure, (long) means (Cell) */
/* Accessing Cells */
#define LFind(a,b,c,d) (Pack0_v(a,b,c,d,52))
#define LNextCell(a,b,c,d) (256 == Pack0_w(a,b,c,d,72))
#define LRect(a,b,c) (Pack0_v(a,b,c,76))
#define LSearch(a,b,c,d,e) (256 == Pack0_w(a,b,c,d,e,84))
#define LSize(a,b,c) (Pack0_v(a,b,c,96))
/* List Display */
#define LDraw(a,b) (Pack0_v(a,b,48))
#define LDoDraw(a,b) (Pack0_v(a,b,44))
#define LScroll(a,b,c) (Pack0_v(a,b,c,80))
#define LAutoScroll(a) (Pack0_v(a,16))
#defi
ne LUpdate(a,b) (Pack0_v(a,b,100))
/* picky LActivate wants Boolean argument to be 0 for deactivate
* or 0x0100 for activate!!
* If we just send 0 or 1, there is interaction with the drawIt
* that is used in the preceding LDoDraw call. The 1 for activate,
* accompanied by TRUE for drawIt, will *clear* the LActive byte
* in the ListRec structure, and LClick will not call the LDEF
* LHilite routine to invert a cell when it is clicked to select it.
* If drawIt is FALSE, then LActivate handles a 1 for activate OK!!
*/
#define LActivate(a,b) (Pack0_v(a ? 256 : 0,b,0))
#undef Pascal
#define LInitMsg 0
#define LDrawMsg 1
#define LHiliteMsg 2
#define LCloseMsg 3