annotate src/gui_at_sb.h @ 19219:89931701e033 v8.2.0168

patch 8.2.0168: Coverity warning for assigning NULL to an option Commit: https://github.com/vim/vim/commit/97a2af39cd3249c6cbe5a5c59bc24167632d39ad Author: Bram Moolenaar <Bram@vim.org> Date: Tue Jan 28 22:52:48 2020 +0100 patch 8.2.0168: Coverity warning for assigning NULL to an option Problem: Coverity warning for assigning NULL to an option. Solution: Use empty string instead of NULL.
author Bram Moolenaar <Bram@vim.org>
date Tue, 28 Jan 2020 23:00:04 +0100
parents 6e3dc2d630c2
children
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
rev   line source
18753
6e3dc2d630c2 patch 8.1.2366: using old C style comments
Bram Moolenaar <Bram@vim.org>
parents: 10042
diff changeset
1 // vi:set ts=8 sts=4 sw=4 noet:
6e3dc2d630c2 patch 8.1.2366: using old C style comments
Bram Moolenaar <Bram@vim.org>
parents: 10042
diff changeset
2 // MODIFIED ATHENA SCROLLBAR (USING ARROWHEADS AT ENDS OF TRAVEL)
6e3dc2d630c2 patch 8.1.2366: using old C style comments
Bram Moolenaar <Bram@vim.org>
parents: 10042
diff changeset
3 // Modifications Copyright 1992 by Mitch Trachtenberg
6e3dc2d630c2 patch 8.1.2366: using old C style comments
Bram Moolenaar <Bram@vim.org>
parents: 10042
diff changeset
4 // Rights, permissions, and disclaimer of warranty are as in the
6e3dc2d630c2 patch 8.1.2366: using old C style comments
Bram Moolenaar <Bram@vim.org>
parents: 10042
diff changeset
5 // DEC and MIT notice below. See usage warning in .c file.
7
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
6 /*
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
7 * $XConsortium: ScrollbarP.h,v 1.3 94/04/17 20:12:42 jim Exp $
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
8 */
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
9
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
10
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
11 /***********************************************************
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
12
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
13 Copyright (c) 1987, 1988 X Consortium
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
14
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
15 Permission is hereby granted, free of charge, to any person obtaining a copy
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
16 of this software and associated documentation files (the "Software"), to deal
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
17 in the Software without restriction, including without limitation the rights
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
18 to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
19 copies of the Software, and to permit persons to whom the Software is
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
20 furnished to do so, subject to the following conditions:
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
21
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
22 The above copyright notice and this permission notice shall be included in
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
23 all copies or substantial portions of the Software.
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
24
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
25 THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
26 IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
27 FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
28 X CONSORTIUM BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
29 AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
30 CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
31
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
32 Except as contained in this notice, the name of the X Consortium shall not be
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
33 used in advertising or otherwise to promote the sale, use or other dealings
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
34 in this Software without prior written authorization from the X Consortium.
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
35
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
36
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
37 Copyright 1987, 1988 by Digital Equipment Corporation, Maynard, Massachusetts.
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
38
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
39 All Rights Reserved
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
40
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
41 Permission to use, copy, modify, and distribute this software and its
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
42 documentation for any purpose and without fee is hereby granted,
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
43 provided that the above copyright notice appear in all copies and that
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
44 both that copyright notice and this permission notice appear in
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
45 supporting documentation, and that the name of Digital not be
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
46 used in advertising or publicity pertaining to distribution of the
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
47 software without specific, written prior permission.
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
48
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
49 DIGITAL DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE, INCLUDING
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
50 ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS, IN NO EVENT SHALL
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
51 DIGITAL BE LIABLE FOR ANY SPECIAL, INDIRECT OR CONSEQUENTIAL DAMAGES OR
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
52 ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS,
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
53 WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION,
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
54 ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
55 SOFTWARE.
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
56
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
57 ******************************************************************/
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
58
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
59 #ifndef _Scrollbar_h
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
60 #define _Scrollbar_h
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
61
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
62 /****************************************************************
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
63 *
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
64 * Scrollbar Widget
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
65 *
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
66 ****************************************************************/
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
67
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
68 #include <X11/IntrinsicP.h>
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
69 #include <X11/Xaw/SimpleP.h>
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
70 #include <X11/Xmu/Converters.h>
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
71
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
72 /*
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
73 * Most things we need are in StringDefs.h
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
74 */
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
75 #define XtCMinimumThumb "MinimumThumb"
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
76 #define XtCShown "Shown"
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
77 #define XtCTopOfThumb "TopOfThumb"
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
78 #define XtCMaxOfThumb "MaxOfThumb"
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
79 #define XtCShadowWidth "ShadowWidth"
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
80 #define XtCTopShadowPixel "TopShadowPixel"
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
81 #define XtCBottomShadowPixel "BottomShadowPixel"
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
82 #define XtCLimitThumb "LimitThumb"
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
83
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
84 #define XtNminimumThumb "minimumThumb"
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
85 #define XtNtopOfThumb "topOfThumb"
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
86 #define XtNmaxOfThumb "maxOfThumb"
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
87 #define XtNshadowWidth "shadowWidth"
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
88 #define XtNtopShadowPixel "topShadowPixel"
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
89 #define XtNbottomShadowPixel "bottomShadowPixel"
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
90 #define XtNlimitThumb "limitThumb"
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
91
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
92 typedef struct _ScrollbarRec *ScrollbarWidget;
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
93 typedef struct _ScrollbarClassRec *ScrollbarWidgetClass;
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
94
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
95 extern WidgetClass vim_scrollbarWidgetClass;
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
96
7807
1a5d34492798 commit https://github.com/vim/vim/commit/d99df423c559d85c17779b3685426c489554908c
Christian Brabandt <cb@256bit.org>
parents: 1226
diff changeset
97 extern void vim_XawScrollbarSetThumb(Widget, double, double, double);
7
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
98
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
99 typedef struct
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
100 {
18753
6e3dc2d630c2 patch 8.1.2366: using old C style comments
Bram Moolenaar <Bram@vim.org>
parents: 10042
diff changeset
101 // public
6e3dc2d630c2 patch 8.1.2366: using old C style comments
Bram Moolenaar <Bram@vim.org>
parents: 10042
diff changeset
102 Pixel foreground; // thumb foreground color
6e3dc2d630c2 patch 8.1.2366: using old C style comments
Bram Moolenaar <Bram@vim.org>
parents: 10042
diff changeset
103 XtOrientation orientation; // horizontal or vertical
6e3dc2d630c2 patch 8.1.2366: using old C style comments
Bram Moolenaar <Bram@vim.org>
parents: 10042
diff changeset
104 XtCallbackList scrollProc; // proportional scroll
6e3dc2d630c2 patch 8.1.2366: using old C style comments
Bram Moolenaar <Bram@vim.org>
parents: 10042
diff changeset
105 XtCallbackList thumbProc; // jump (to position) scroll
6e3dc2d630c2 patch 8.1.2366: using old C style comments
Bram Moolenaar <Bram@vim.org>
parents: 10042
diff changeset
106 XtCallbackList jumpProc; // same as thumbProc but pass data by ref
6e3dc2d630c2 patch 8.1.2366: using old C style comments
Bram Moolenaar <Bram@vim.org>
parents: 10042
diff changeset
107 Pixmap thumb; // thumb color
6e3dc2d630c2 patch 8.1.2366: using old C style comments
Bram Moolenaar <Bram@vim.org>
parents: 10042
diff changeset
108 float top; // What percent is above the win's top
6e3dc2d630c2 patch 8.1.2366: using old C style comments
Bram Moolenaar <Bram@vim.org>
parents: 10042
diff changeset
109 float shown; // What percent is shown in the win
6e3dc2d630c2 patch 8.1.2366: using old C style comments
Bram Moolenaar <Bram@vim.org>
parents: 10042
diff changeset
110 float max; // Maximum value for top
6e3dc2d630c2 patch 8.1.2366: using old C style comments
Bram Moolenaar <Bram@vim.org>
parents: 10042
diff changeset
111 Dimension length; // either height or width
6e3dc2d630c2 patch 8.1.2366: using old C style comments
Bram Moolenaar <Bram@vim.org>
parents: 10042
diff changeset
112 Dimension thickness; // either width or height
6e3dc2d630c2 patch 8.1.2366: using old C style comments
Bram Moolenaar <Bram@vim.org>
parents: 10042
diff changeset
113 Dimension min_thumb; // minimum size for the thumb.
7
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
114
18753
6e3dc2d630c2 patch 8.1.2366: using old C style comments
Bram Moolenaar <Bram@vim.org>
parents: 10042
diff changeset
115 // private
6e3dc2d630c2 patch 8.1.2366: using old C style comments
Bram Moolenaar <Bram@vim.org>
parents: 10042
diff changeset
116 XtIntervalId timer_id; // autorepeat timer; remove on destruction
6e3dc2d630c2 patch 8.1.2366: using old C style comments
Bram Moolenaar <Bram@vim.org>
parents: 10042
diff changeset
117 char scroll_mode; // see below
6e3dc2d630c2 patch 8.1.2366: using old C style comments
Bram Moolenaar <Bram@vim.org>
parents: 10042
diff changeset
118 float scroll_off; // offset from event to top of thumb
6e3dc2d630c2 patch 8.1.2366: using old C style comments
Bram Moolenaar <Bram@vim.org>
parents: 10042
diff changeset
119 GC gc; // a (shared) gc
6e3dc2d630c2 patch 8.1.2366: using old C style comments
Bram Moolenaar <Bram@vim.org>
parents: 10042
diff changeset
120 Position topLoc; // Pixel that corresponds to top
6e3dc2d630c2 patch 8.1.2366: using old C style comments
Bram Moolenaar <Bram@vim.org>
parents: 10042
diff changeset
121 Dimension shownLength; // Num pixels corresponding to shown
7
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
122
18753
6e3dc2d630c2 patch 8.1.2366: using old C style comments
Bram Moolenaar <Bram@vim.org>
parents: 10042
diff changeset
123 // From 3d widget
7
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
124 Dimension shadow_width;
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
125 Pixel top_shadow_pixel;
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
126 Pixel bot_shadow_pixel;
18753
6e3dc2d630c2 patch 8.1.2366: using old C style comments
Bram Moolenaar <Bram@vim.org>
parents: 10042
diff changeset
127 Bool limit_thumb; // limit thumb to inside scrollbar
7
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
128 int top_shadow_contrast;
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
129 int bot_shadow_contrast;
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
130 GC top_shadow_GC;
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
131 GC bot_shadow_GC;
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
132 } ScrollbarPart;
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
133
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
134 #define SMODE_NONE 0
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
135 #define SMODE_CONT 1
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
136 #define SMODE_PAGE_UP 2
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
137 #define SMODE_PAGE_DOWN 3
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
138 #define SMODE_LINE_UP 4
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
139 #define SMODE_LINE_DOWN 5
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
140
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
141 #define ONE_LINE_DATA 1
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
142 #define ONE_PAGE_DATA 10
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
143 #define END_PAGE_DATA 9999
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
144
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
145 typedef struct _ScrollbarRec {
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
146 CorePart core;
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
147 SimplePart simple;
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
148 ScrollbarPart scrollbar;
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
149 } ScrollbarRec;
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
150
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
151 typedef struct {int empty;} ScrollbarClassPart;
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
152
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
153 typedef struct _ScrollbarClassRec {
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
154 CoreClassPart core_class;
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
155 SimpleClassPart simple_class;
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
156 ScrollbarClassPart scrollbar_class;
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
157 } ScrollbarClassRec;
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
158
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
159 extern ScrollbarClassRec vim_scrollbarClassRec;
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
160
18753
6e3dc2d630c2 patch 8.1.2366: using old C style comments
Bram Moolenaar <Bram@vim.org>
parents: 10042
diff changeset
161 #endif // _Scrollbar_h