From 737920a9203af23d93d9c8352737b93651392776 Mon Sep 17 00:00:00 2001 From: lecoanet Date: Mon, 8 Apr 2002 13:46:42 +0000 Subject: *** empty log message *** --- generic/Field.h | 99 +++++++++++++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 99 insertions(+) create mode 100644 generic/Field.h (limited to 'generic/Field.h') diff --git a/generic/Field.h b/generic/Field.h new file mode 100644 index 0000000..7aaae54 --- /dev/null +++ b/generic/Field.h @@ -0,0 +1,99 @@ +/* + * Field.h -- Header for field item parts. + * + * Authors : Patrick Lecoanet. + * Creation date : + * + * $Id$ + */ + +/* + * Copyright (c) 2002 CENA, Patrick Lecoanet -- + * + * This code is free software; you can redistribute it and/or + * modify it under the terms of the GNU Library General Public + * License as published by the Free Software Foundation; either + * version 2 of the License, or (at your option) any later version. + * + * This code is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * Library General Public License for more details. + * + * You should have received a copy of the GNU Library General Public + * License along with this code; if not, write to the Free + * Software Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. + * + */ + + +#ifndef _Field_h +#define _Field_h + +#include "Attrs.h" +#include "Types.h" +#include "List.h" +#include "Color.h" +#include "Image.h" + + +struct _ItemStruct; +struct _WidgetInfo; + + +/* + * Field array management record. + * + * This structure should be used only for internal + * management by items with fields. The rest of the code + * should use the methods in FIELD. + * + */ +typedef struct _FieldSetStruct { + struct _WidgetInfo *wi; + ZnLabelFormat label_format; + unsigned int num_fields; + struct _FieldStruct *fields; + ZnDim label_width; /* Describe the label size. Access these */ + ZnDim label_height; /* 2 only with GetLabelBBox. -1 means + * not up to date. */ + ZnPoint label_pos; /* Describe the label origin. */ +} FieldSetStruct, *FieldSet; + + + +extern struct _FIELD { + ZnAttrConfig *attr_desc; + + void (*InitFields)(FieldSet fs); + void (*CloneFields)(FieldSet fs); + void (*FreeFields)(FieldSet fs); + int (*ConfigureField)(FieldSet fs, unsigned int field, + int argc, Tcl_Obj *CONST argv[], int *flags); + int (*QueryField)(FieldSet fs, unsigned int field, + int argc, Tcl_Obj *CONST argv[]); + void (*DrawFields)(FieldSet fs, struct _ItemStruct *item); + void (*RenderFields)(FieldSet fs, struct _ItemStruct *item); + int (*FieldsToArea)(FieldSet fs, ZnBBox *area); + ZnBool (*IsFieldSensitive)(FieldSet fs, int part); + double (*FieldsPick)(FieldSet fs, ZnPoint *p, int *part); + int (*FieldIndex)(FieldSet fs, int field, + struct _ItemStruct *item, Tcl_Obj *index_spec, int *index); + void (*FieldInsertChars)(FieldSet fs, int field, int *index, char *chars); + void (*FieldDeleteChars)(FieldSet fs, int field, + int *first, int *last); + void (*FieldCursor)(FieldSet fs, int field, int index); + int (*FieldSelection)(FieldSet fs, int field, int offset, + char *chars, int max_chars); + void (*LeaderToLabel)(FieldSet fs, ZnPoint *start, ZnPoint *end); + void (*GetLabelBBox)(FieldSet fs, ZnDim *w, ZnDim *h); + void (*GetFieldBBox)(FieldSet fs, unsigned int index, + ZnBBox *field_bbox); + void (*SetFieldsAutoAlign)(FieldSet fs, int alignment); + void (*ClearFieldCache)(FieldSet fs, int field); + char *(*GetFieldStruct)(FieldSet fs, int field); + int (*NumFields)(FieldSet fs); +} FIELD; + + +#endif /* _Field_h */ -- cgit v1.1