Mercurial > vim
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 |
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 | 6 /* |
7 * $XConsortium: ScrollbarP.h,v 1.3 94/04/17 20:12:42 jim Exp $ | |
8 */ | |
9 | |
10 | |
11 /*********************************************************** | |
12 | |
13 Copyright (c) 1987, 1988 X Consortium | |
14 | |
15 Permission is hereby granted, free of charge, to any person obtaining a copy | |
16 of this software and associated documentation files (the "Software"), to deal | |
17 in the Software without restriction, including without limitation the rights | |
18 to use, copy, modify, merge, publish, distribute, sublicense, and/or sell | |
19 copies of the Software, and to permit persons to whom the Software is | |
20 furnished to do so, subject to the following conditions: | |
21 | |
22 The above copyright notice and this permission notice shall be included in | |
23 all copies or substantial portions of the Software. | |
24 | |
25 THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR | |
26 IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, | |
27 FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE | |
28 X CONSORTIUM BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN | |
29 AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN | |
30 CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. | |
31 | |
32 Except as contained in this notice, the name of the X Consortium shall not be | |
33 used in advertising or otherwise to promote the sale, use or other dealings | |
34 in this Software without prior written authorization from the X Consortium. | |
35 | |
36 | |
37 Copyright 1987, 1988 by Digital Equipment Corporation, Maynard, Massachusetts. | |
38 | |
39 All Rights Reserved | |
40 | |
41 Permission to use, copy, modify, and distribute this software and its | |
42 documentation for any purpose and without fee is hereby granted, | |
43 provided that the above copyright notice appear in all copies and that | |
44 both that copyright notice and this permission notice appear in | |
45 supporting documentation, and that the name of Digital not be | |
46 used in advertising or publicity pertaining to distribution of the | |
47 software without specific, written prior permission. | |
48 | |
49 DIGITAL DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE, INCLUDING | |
50 ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS, IN NO EVENT SHALL | |
51 DIGITAL BE LIABLE FOR ANY SPECIAL, INDIRECT OR CONSEQUENTIAL DAMAGES OR | |
52 ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, | |
53 WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, | |
54 ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS | |
55 SOFTWARE. | |
56 | |
57 ******************************************************************/ | |
58 | |
59 #ifndef _Scrollbar_h | |
60 #define _Scrollbar_h | |
61 | |
62 /**************************************************************** | |
63 * | |
64 * Scrollbar Widget | |
65 * | |
66 ****************************************************************/ | |
67 | |
68 #include <X11/IntrinsicP.h> | |
69 #include <X11/Xaw/SimpleP.h> | |
70 #include <X11/Xmu/Converters.h> | |
71 | |
72 /* | |
73 * Most things we need are in StringDefs.h | |
74 */ | |
75 #define XtCMinimumThumb "MinimumThumb" | |
76 #define XtCShown "Shown" | |
77 #define XtCTopOfThumb "TopOfThumb" | |
78 #define XtCMaxOfThumb "MaxOfThumb" | |
79 #define XtCShadowWidth "ShadowWidth" | |
80 #define XtCTopShadowPixel "TopShadowPixel" | |
81 #define XtCBottomShadowPixel "BottomShadowPixel" | |
82 #define XtCLimitThumb "LimitThumb" | |
83 | |
84 #define XtNminimumThumb "minimumThumb" | |
85 #define XtNtopOfThumb "topOfThumb" | |
86 #define XtNmaxOfThumb "maxOfThumb" | |
87 #define XtNshadowWidth "shadowWidth" | |
88 #define XtNtopShadowPixel "topShadowPixel" | |
89 #define XtNbottomShadowPixel "bottomShadowPixel" | |
90 #define XtNlimitThumb "limitThumb" | |
91 | |
92 typedef struct _ScrollbarRec *ScrollbarWidget; | |
93 typedef struct _ScrollbarClassRec *ScrollbarWidgetClass; | |
94 | |
95 extern WidgetClass vim_scrollbarWidgetClass; | |
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 | 98 |
99 typedef struct | |
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 | 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 | 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 | 124 Dimension shadow_width; |
125 Pixel top_shadow_pixel; | |
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 | 128 int top_shadow_contrast; |
129 int bot_shadow_contrast; | |
130 GC top_shadow_GC; | |
131 GC bot_shadow_GC; | |
132 } ScrollbarPart; | |
133 | |
134 #define SMODE_NONE 0 | |
135 #define SMODE_CONT 1 | |
136 #define SMODE_PAGE_UP 2 | |
137 #define SMODE_PAGE_DOWN 3 | |
138 #define SMODE_LINE_UP 4 | |
139 #define SMODE_LINE_DOWN 5 | |
140 | |
141 #define ONE_LINE_DATA 1 | |
142 #define ONE_PAGE_DATA 10 | |
143 #define END_PAGE_DATA 9999 | |
144 | |
145 typedef struct _ScrollbarRec { | |
146 CorePart core; | |
147 SimplePart simple; | |
148 ScrollbarPart scrollbar; | |
149 } ScrollbarRec; | |
150 | |
151 typedef struct {int empty;} ScrollbarClassPart; | |
152 | |
153 typedef struct _ScrollbarClassRec { | |
154 CoreClassPart core_class; | |
155 SimpleClassPart simple_class; | |
156 ScrollbarClassPart scrollbar_class; | |
157 } ScrollbarClassRec; | |
158 | |
159 extern ScrollbarClassRec vim_scrollbarClassRec; | |
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 |