File: Hyper.h

package info (click to toggle)
axe 6.1.2-6.4
  • links: PTS
  • area: non-free
  • in suites: potato
  • size: 1,460 kB
  • ctags: 2,249
  • sloc: ansic: 20,650; sed: 361; tcl: 72; makefile: 44; sh: 20
file content (116 lines) | stat: -rw-r--r-- 3,249 bytes parent folder | download | duplicates (7)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
/*==================================================================*/
/*                                                                  */
/* HyperWidget                                                      */
/*                                                                  */
/* B.Raoult (mab@ecmwf.co.uk)                              Oct.91   */
/*                                                                  */
/* Hyper text like widget.                                          */
/*                                                                  */
/*==================================================================*/

#ifndef  HYPER_H
#define  HYPER_H

/* 
    If you define MOTIF, the widget will inherit proprieties 
   from the XmPrimitive class : Help Callback, user data, ...
*/

/*
#define MOTIF
*/

/*
   If your machine got regexp.h
*/
/*#define USE_REGEXP*/

extern WidgetClass hyperWidgetClass;
typedef struct _HyperClassRec * HyperWidgetClass;
typedef struct _HyperRec      * HyperWidget;

/*
 * Define resource strings for the Hyper widget.
 */

#define XtNhighlightFont     "highlightFont"
#define XtNnormalFont        "normalFont"
#define XtNhighlightColor    "highlightColor"
#define XtNselectColor       "selectColor"
#define XtNnormalColor       "normalColor"
#define XtNactivateCallback  "activateCallback"
#define XtNhyperCallback     "hyperCallback"
#define XtNzoomEffect        "zoomEffect"
#define XtCZoom              "Zoom"
#define XtNstartHighlight    "startHighlight"
#define XtNendHighlight      "endHighlight"
#define XtCTagChar           "TagChar"
#define XtNzoomSpeed         "zoomSpeed"
#define XtCZoomSpeed         "ZoomSpeed"
/* Same as in StringDfs.h, so expect to get it form there (JKW)
#define XtCMargin            "Margin"
*/
#define XtNmargin            "margin"

/*
  Callback structure
*/

#define HYPER_REASON 1

typedef struct {
    int     reason;   /* always = HYPER_REASON                            */
    XEvent *event;    /* event                                            */
    char     *text;     /* pointer on highlighted text selected (read only) */
    int  length;    /* length of selected text                          */
}  hyperCallbackStruct;

#ifdef _NO_PROTO

extern Widget CreateHyper();
extern void HyperLoadFile();
extern void HyperSetText();
extern void HyperSetTags();
extern Boolean HyperFind();
extern char    *HyperGetText();

#else

#if defined(__cplusplus) || defined(c_plusplus)
extern "C" {
#endif

    extern Widget CreateHyper(Widget parent,
        char *name,
        ArgList al,
        int ac);

    extern void HyperLoadFile(HyperWidget widget,
        char *fname);

    extern void HyperSetText(HyperWidget widget,
        char *text);

    extern void HyperSetTags (HyperWidget widget,
        unsigned char start_highlight,
        unsigned char end_highlight);

    Boolean HyperGrep(HyperWidget  widget,
        char    *word,
        Boolean ignore_case,
        Boolean from_start,
        Boolean wrap);

    char *HyperGetText(HyperWidget widget,
	Boolean include_tags);


#if defined(__cplusplus) || defined(c_plusplus)
}
#endif

#endif /* _NO_PROTO */

#define XtIsHyper(w)     XtIsSubclass(w,hyperWidgetClass)

#endif /* HYPER_H */