annotate src/scrollbar-msw.c @ 398:74fd4e045ea6 r21-2-29

Import from CVS: tag r21-2-29
author cvs
date Mon, 13 Aug 2007 11:13:30 +0200
parents 8626e4521993
children de805c49cfc1
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
rev   line source
225
12579d965149 Import from CVS: tag r20-4b11
cvs
parents:
diff changeset
1 /* scrollbar implementation -- mswindows interface.
12579d965149 Import from CVS: tag r20-4b11
cvs
parents:
diff changeset
2 Copyright (C) 1994, 1995 Board of Trustees, University of Illinois.
380
8626e4521993 Import from CVS: tag r21-2-5
cvs
parents: 375
diff changeset
3 Copyright (C) 1994 Amdahl Corporation.
225
12579d965149 Import from CVS: tag r20-4b11
cvs
parents:
diff changeset
4 Copyright (C) 1995 Sun Microsystems, Inc.
12579d965149 Import from CVS: tag r20-4b11
cvs
parents:
diff changeset
5 Copyright (C) 1995 Darrell Kindred <dkindred+@cmu.edu>.
12579d965149 Import from CVS: tag r20-4b11
cvs
parents:
diff changeset
6
12579d965149 Import from CVS: tag r20-4b11
cvs
parents:
diff changeset
7 This file is part of XEmacs.
12579d965149 Import from CVS: tag r20-4b11
cvs
parents:
diff changeset
8
12579d965149 Import from CVS: tag r20-4b11
cvs
parents:
diff changeset
9 XEmacs is free software; you can redistribute it and/or modify it
12579d965149 Import from CVS: tag r20-4b11
cvs
parents:
diff changeset
10 under the terms of the GNU General Public License as published by the
12579d965149 Import from CVS: tag r20-4b11
cvs
parents:
diff changeset
11 Free Software Foundation; either version 2, or (at your option) any
12579d965149 Import from CVS: tag r20-4b11
cvs
parents:
diff changeset
12 later version.
12579d965149 Import from CVS: tag r20-4b11
cvs
parents:
diff changeset
13
12579d965149 Import from CVS: tag r20-4b11
cvs
parents:
diff changeset
14 XEmacs is distributed in the hope that it will be useful, but WITHOUT
12579d965149 Import from CVS: tag r20-4b11
cvs
parents:
diff changeset
15 ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
12579d965149 Import from CVS: tag r20-4b11
cvs
parents:
diff changeset
16 FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
12579d965149 Import from CVS: tag r20-4b11
cvs
parents:
diff changeset
17 for more details.
12579d965149 Import from CVS: tag r20-4b11
cvs
parents:
diff changeset
18
12579d965149 Import from CVS: tag r20-4b11
cvs
parents:
diff changeset
19 You should have received a copy of the GNU General Public License
12579d965149 Import from CVS: tag r20-4b11
cvs
parents:
diff changeset
20 along with XEmacs; see the file COPYING. If not, write to
12579d965149 Import from CVS: tag r20-4b11
cvs
parents:
diff changeset
21 the Free Software Foundation, Inc., 59 Temple Place - Suite 330,
12579d965149 Import from CVS: tag r20-4b11
cvs
parents:
diff changeset
22 Boston, MA 02111-1307, USA. */
12579d965149 Import from CVS: tag r20-4b11
cvs
parents:
diff changeset
23
12579d965149 Import from CVS: tag r20-4b11
cvs
parents:
diff changeset
24 /* Synched up with: Not in FSF. */
12579d965149 Import from CVS: tag r20-4b11
cvs
parents:
diff changeset
25
12579d965149 Import from CVS: tag r20-4b11
cvs
parents:
diff changeset
26 #include <config.h>
398
74fd4e045ea6 Import from CVS: tag r21-2-29
cvs
parents: 380
diff changeset
27 #include <limits.h>
225
12579d965149 Import from CVS: tag r20-4b11
cvs
parents:
diff changeset
28 #include "lisp.h"
12579d965149 Import from CVS: tag r20-4b11
cvs
parents:
diff changeset
29
12579d965149 Import from CVS: tag r20-4b11
cvs
parents:
diff changeset
30 #include "console-msw.h"
276
6330739388db Import from CVS: tag r21-0b36
cvs
parents: 269
diff changeset
31 #include "events.h"
225
12579d965149 Import from CVS: tag r20-4b11
cvs
parents:
diff changeset
32 #include "frame.h"
276
6330739388db Import from CVS: tag r21-0b36
cvs
parents: 269
diff changeset
33 #include "scrollbar-msw.h"
6330739388db Import from CVS: tag r21-0b36
cvs
parents: 269
diff changeset
34 #include "scrollbar.h"
6330739388db Import from CVS: tag r21-0b36
cvs
parents: 269
diff changeset
35 #include "specifier.h"
225
12579d965149 Import from CVS: tag r20-4b11
cvs
parents:
diff changeset
36 #include "window.h"
12579d965149 Import from CVS: tag r20-4b11
cvs
parents:
diff changeset
37
375
a300bb07d72d Import from CVS: tag r21-2b3
cvs
parents: 371
diff changeset
38 /* We use a similar sort of vertical scrollbar drag hack for mswindows
a300bb07d72d Import from CVS: tag r21-2b3
cvs
parents: 371
diff changeset
39 * scrollbars as is used for Motif or Lucid scrollbars under X.
a300bb07d72d Import from CVS: tag r21-2b3
cvs
parents: 371
diff changeset
40 * We do character-based instead of line-based scrolling, which can mean that
a300bb07d72d Import from CVS: tag r21-2b3
cvs
parents: 371
diff changeset
41 * without the hack it is impossible to drag to the end of a buffer. */
a300bb07d72d Import from CVS: tag r21-2b3
cvs
parents: 371
diff changeset
42 #define VERTICAL_SCROLLBAR_DRAG_HACK
a300bb07d72d Import from CVS: tag r21-2b3
cvs
parents: 371
diff changeset
43
a300bb07d72d Import from CVS: tag r21-2b3
cvs
parents: 371
diff changeset
44 static int vertical_drag_in_progress = 0;
227
0e522484dd2a Import from CVS: tag r20-5b12
cvs
parents: 225
diff changeset
45
225
12579d965149 Import from CVS: tag r20-4b11
cvs
parents:
diff changeset
46 static void
12579d965149 Import from CVS: tag r20-4b11
cvs
parents:
diff changeset
47 mswindows_create_scrollbar_instance (struct frame *f, int vertical,
12579d965149 Import from CVS: tag r20-4b11
cvs
parents:
diff changeset
48 struct scrollbar_instance *sb)
12579d965149 Import from CVS: tag r20-4b11
cvs
parents:
diff changeset
49 {
12579d965149 Import from CVS: tag r20-4b11
cvs
parents:
diff changeset
50 int orientation;
12579d965149 Import from CVS: tag r20-4b11
cvs
parents:
diff changeset
51
12579d965149 Import from CVS: tag r20-4b11
cvs
parents:
diff changeset
52 sb->scrollbar_data = xnew_and_zero (struct mswindows_scrollbar_data);
12579d965149 Import from CVS: tag r20-4b11
cvs
parents:
diff changeset
53
12579d965149 Import from CVS: tag r20-4b11
cvs
parents:
diff changeset
54 if (vertical)
12579d965149 Import from CVS: tag r20-4b11
cvs
parents:
diff changeset
55 orientation = SBS_VERT;
12579d965149 Import from CVS: tag r20-4b11
cvs
parents:
diff changeset
56 else
12579d965149 Import from CVS: tag r20-4b11
cvs
parents:
diff changeset
57 orientation = SBS_HORZ;
12579d965149 Import from CVS: tag r20-4b11
cvs
parents:
diff changeset
58
12579d965149 Import from CVS: tag r20-4b11
cvs
parents:
diff changeset
59 SCROLLBAR_MSW_HANDLE (sb) =
12579d965149 Import from CVS: tag r20-4b11
cvs
parents:
diff changeset
60 CreateWindowEx(0, "SCROLLBAR", 0, orientation|WS_CHILD,
12579d965149 Import from CVS: tag r20-4b11
cvs
parents:
diff changeset
61 CW_USEDEFAULT, CW_USEDEFAULT,
12579d965149 Import from CVS: tag r20-4b11
cvs
parents:
diff changeset
62 CW_USEDEFAULT, CW_USEDEFAULT,
12579d965149 Import from CVS: tag r20-4b11
cvs
parents:
diff changeset
63 FRAME_MSWINDOWS_HANDLE (f),
12579d965149 Import from CVS: tag r20-4b11
cvs
parents:
diff changeset
64 NULL, NULL, NULL);
375
a300bb07d72d Import from CVS: tag r21-2b3
cvs
parents: 371
diff changeset
65 SCROLLBAR_MSW_INFO (sb).cbSize = sizeof(SCROLLINFO);
225
12579d965149 Import from CVS: tag r20-4b11
cvs
parents:
diff changeset
66 SCROLLBAR_MSW_INFO (sb).fMask = SIF_ALL;
12579d965149 Import from CVS: tag r20-4b11
cvs
parents:
diff changeset
67 GetScrollInfo(SCROLLBAR_MSW_HANDLE (sb), SB_CTL,
12579d965149 Import from CVS: tag r20-4b11
cvs
parents:
diff changeset
68 &SCROLLBAR_MSW_INFO (sb));
12579d965149 Import from CVS: tag r20-4b11
cvs
parents:
diff changeset
69 SetWindowLong (SCROLLBAR_MSW_HANDLE(sb), GWL_USERDATA, (LONG)sb);
12579d965149 Import from CVS: tag r20-4b11
cvs
parents:
diff changeset
70
12579d965149 Import from CVS: tag r20-4b11
cvs
parents:
diff changeset
71 #if 0
12579d965149 Import from CVS: tag r20-4b11
cvs
parents:
diff changeset
72 {
12579d965149 Import from CVS: tag r20-4b11
cvs
parents:
diff changeset
73 HWND h = SCROLLBAR_MSW_HANDLE (sb);
12579d965149 Import from CVS: tag r20-4b11
cvs
parents:
diff changeset
74 int x = SetWindowLong (SCROLLBAR_MSW_HANDLE(sb), GWL_USERDATA, (LONG)sb);
12579d965149 Import from CVS: tag r20-4b11
cvs
parents:
diff changeset
75 int y = GetLastError();
12579d965149 Import from CVS: tag r20-4b11
cvs
parents:
diff changeset
76 struct scrollbar_instance *z = (struct scrollbar_instance *)GetWindowLong (SCROLLBAR_MSW_HANDLE(sb),
12579d965149 Import from CVS: tag r20-4b11
cvs
parents:
diff changeset
77 GWL_USERDATA);
12579d965149 Import from CVS: tag r20-4b11
cvs
parents:
diff changeset
78 *z = *z;
12579d965149 Import from CVS: tag r20-4b11
cvs
parents:
diff changeset
79 }
12579d965149 Import from CVS: tag r20-4b11
cvs
parents:
diff changeset
80 #endif
12579d965149 Import from CVS: tag r20-4b11
cvs
parents:
diff changeset
81 }
12579d965149 Import from CVS: tag r20-4b11
cvs
parents:
diff changeset
82
12579d965149 Import from CVS: tag r20-4b11
cvs
parents:
diff changeset
83 static void
12579d965149 Import from CVS: tag r20-4b11
cvs
parents:
diff changeset
84 mswindows_free_scrollbar_instance (struct scrollbar_instance *sb)
12579d965149 Import from CVS: tag r20-4b11
cvs
parents:
diff changeset
85 {
12579d965149 Import from CVS: tag r20-4b11
cvs
parents:
diff changeset
86 DestroyWindow (SCROLLBAR_MSW_HANDLE (sb));
12579d965149 Import from CVS: tag r20-4b11
cvs
parents:
diff changeset
87 if (sb->scrollbar_data)
12579d965149 Import from CVS: tag r20-4b11
cvs
parents:
diff changeset
88 xfree (sb->scrollbar_data);
12579d965149 Import from CVS: tag r20-4b11
cvs
parents:
diff changeset
89 }
12579d965149 Import from CVS: tag r20-4b11
cvs
parents:
diff changeset
90
12579d965149 Import from CVS: tag r20-4b11
cvs
parents:
diff changeset
91 static void
12579d965149 Import from CVS: tag r20-4b11
cvs
parents:
diff changeset
92 mswindows_release_scrollbar_instance (struct scrollbar_instance *sb)
12579d965149 Import from CVS: tag r20-4b11
cvs
parents:
diff changeset
93 {
12579d965149 Import from CVS: tag r20-4b11
cvs
parents:
diff changeset
94 ShowScrollBar (SCROLLBAR_MSW_HANDLE (sb), SB_CTL, 0);
12579d965149 Import from CVS: tag r20-4b11
cvs
parents:
diff changeset
95 SCROLLBAR_MSW_SIZE (sb) = 0;
12579d965149 Import from CVS: tag r20-4b11
cvs
parents:
diff changeset
96 }
12579d965149 Import from CVS: tag r20-4b11
cvs
parents:
diff changeset
97
12579d965149 Import from CVS: tag r20-4b11
cvs
parents:
diff changeset
98 #define UPDATE_POS_FIELD(field) \
12579d965149 Import from CVS: tag r20-4b11
cvs
parents:
diff changeset
99 if (new_##field >= 0 && SCROLLBAR_MSW_DATA (sb)->field != new_##field) { \
12579d965149 Import from CVS: tag r20-4b11
cvs
parents:
diff changeset
100 SCROLLBAR_MSW_DATA (sb)->field = new_##field; \
12579d965149 Import from CVS: tag r20-4b11
cvs
parents:
diff changeset
101 pos_changed = 1; \
12579d965149 Import from CVS: tag r20-4b11
cvs
parents:
diff changeset
102 }
12579d965149 Import from CVS: tag r20-4b11
cvs
parents:
diff changeset
103
12579d965149 Import from CVS: tag r20-4b11
cvs
parents:
diff changeset
104 static void
12579d965149 Import from CVS: tag r20-4b11
cvs
parents:
diff changeset
105 mswindows_update_scrollbar_instance_values (struct window *w,
12579d965149 Import from CVS: tag r20-4b11
cvs
parents:
diff changeset
106 struct scrollbar_instance *sb,
12579d965149 Import from CVS: tag r20-4b11
cvs
parents:
diff changeset
107 int new_line_increment,
12579d965149 Import from CVS: tag r20-4b11
cvs
parents:
diff changeset
108 int new_page_increment,
12579d965149 Import from CVS: tag r20-4b11
cvs
parents:
diff changeset
109 int new_minimum, int new_maximum,
12579d965149 Import from CVS: tag r20-4b11
cvs
parents:
diff changeset
110 int new_slider_size,
12579d965149 Import from CVS: tag r20-4b11
cvs
parents:
diff changeset
111 int new_slider_position,
12579d965149 Import from CVS: tag r20-4b11
cvs
parents:
diff changeset
112 int new_scrollbar_width,
12579d965149 Import from CVS: tag r20-4b11
cvs
parents:
diff changeset
113 int new_scrollbar_height,
12579d965149 Import from CVS: tag r20-4b11
cvs
parents:
diff changeset
114 int new_scrollbar_x,
12579d965149 Import from CVS: tag r20-4b11
cvs
parents:
diff changeset
115 int new_scrollbar_y)
12579d965149 Import from CVS: tag r20-4b11
cvs
parents:
diff changeset
116 {
12579d965149 Import from CVS: tag r20-4b11
cvs
parents:
diff changeset
117 int pos_changed = 0;
375
a300bb07d72d Import from CVS: tag r21-2b3
cvs
parents: 371
diff changeset
118 int vert = GetWindowLong (SCROLLBAR_MSW_HANDLE (sb), GWL_STYLE) & SBS_VERT;
225
12579d965149 Import from CVS: tag r20-4b11
cvs
parents:
diff changeset
119
227
0e522484dd2a Import from CVS: tag r20-5b12
cvs
parents: 225
diff changeset
120 #if 0
0e522484dd2a Import from CVS: tag r20-5b12
cvs
parents: 225
diff changeset
121 stderr_out ("[%d, %d], page = %d, pos = %d, inhibit = %d\n", new_minimum, new_maximum,
0e522484dd2a Import from CVS: tag r20-5b12
cvs
parents: 225
diff changeset
122 new_slider_size, new_slider_position,inhibit_slider_size_change);
0e522484dd2a Import from CVS: tag r20-5b12
cvs
parents: 225
diff changeset
123 #endif
0e522484dd2a Import from CVS: tag r20-5b12
cvs
parents: 225
diff changeset
124
225
12579d965149 Import from CVS: tag r20-4b11
cvs
parents:
diff changeset
125 /* These might be optimized, but since at least one will change at each
12579d965149 Import from CVS: tag r20-4b11
cvs
parents:
diff changeset
126 call, it's probably not worth it. */
227
0e522484dd2a Import from CVS: tag r20-5b12
cvs
parents: 225
diff changeset
127 SCROLLBAR_MSW_INFO (sb).nMin = new_minimum;
0e522484dd2a Import from CVS: tag r20-5b12
cvs
parents: 225
diff changeset
128 SCROLLBAR_MSW_INFO (sb).nMax = new_maximum;
375
a300bb07d72d Import from CVS: tag r21-2b3
cvs
parents: 371
diff changeset
129 SCROLLBAR_MSW_INFO (sb).nPage = new_slider_size + 1; /* +1 for DISABLENOSCROLL */
225
12579d965149 Import from CVS: tag r20-4b11
cvs
parents:
diff changeset
130 SCROLLBAR_MSW_INFO (sb).nPos = new_slider_position;
375
a300bb07d72d Import from CVS: tag r21-2b3
cvs
parents: 371
diff changeset
131 #ifndef VERTICAL_SCROLLBAR_DRAG_HACK
a300bb07d72d Import from CVS: tag r21-2b3
cvs
parents: 371
diff changeset
132 SCROLLBAR_MSW_INFO (sb).fMask = ((vert && vertical_drag_in_progress)
227
0e522484dd2a Import from CVS: tag r20-5b12
cvs
parents: 225
diff changeset
133 ? SIF_RANGE | SIF_POS
0e522484dd2a Import from CVS: tag r20-5b12
cvs
parents: 225
diff changeset
134 : SIF_ALL | SIF_DISABLENOSCROLL);
375
a300bb07d72d Import from CVS: tag r21-2b3
cvs
parents: 371
diff changeset
135 #else
a300bb07d72d Import from CVS: tag r21-2b3
cvs
parents: 371
diff changeset
136 SCROLLBAR_MSW_INFO (sb).fMask = SIF_ALL | SIF_DISABLENOSCROLL;
a300bb07d72d Import from CVS: tag r21-2b3
cvs
parents: 371
diff changeset
137
a300bb07d72d Import from CVS: tag r21-2b3
cvs
parents: 371
diff changeset
138 /* Ignore XEmacs' requests to update the thumb position and size; they don't
a300bb07d72d Import from CVS: tag r21-2b3
cvs
parents: 371
diff changeset
139 * bear any relation to reality because we're reporting made-up positions */
a300bb07d72d Import from CVS: tag r21-2b3
cvs
parents: 371
diff changeset
140 if (!(vert && vertical_drag_in_progress))
a300bb07d72d Import from CVS: tag r21-2b3
cvs
parents: 371
diff changeset
141 #endif
a300bb07d72d Import from CVS: tag r21-2b3
cvs
parents: 371
diff changeset
142 SetScrollInfo (SCROLLBAR_MSW_HANDLE (sb), SB_CTL, &SCROLLBAR_MSW_INFO (sb),
a300bb07d72d Import from CVS: tag r21-2b3
cvs
parents: 371
diff changeset
143 TRUE);
225
12579d965149 Import from CVS: tag r20-4b11
cvs
parents:
diff changeset
144
12579d965149 Import from CVS: tag r20-4b11
cvs
parents:
diff changeset
145 UPDATE_POS_FIELD (scrollbar_x);
12579d965149 Import from CVS: tag r20-4b11
cvs
parents:
diff changeset
146 UPDATE_POS_FIELD (scrollbar_y);
12579d965149 Import from CVS: tag r20-4b11
cvs
parents:
diff changeset
147 UPDATE_POS_FIELD (scrollbar_width);
12579d965149 Import from CVS: tag r20-4b11
cvs
parents:
diff changeset
148 UPDATE_POS_FIELD (scrollbar_height);
12579d965149 Import from CVS: tag r20-4b11
cvs
parents:
diff changeset
149
12579d965149 Import from CVS: tag r20-4b11
cvs
parents:
diff changeset
150 if (pos_changed)
12579d965149 Import from CVS: tag r20-4b11
cvs
parents:
diff changeset
151 {
12579d965149 Import from CVS: tag r20-4b11
cvs
parents:
diff changeset
152 MoveWindow(SCROLLBAR_MSW_HANDLE (sb),
12579d965149 Import from CVS: tag r20-4b11
cvs
parents:
diff changeset
153 new_scrollbar_x, new_scrollbar_y,
12579d965149 Import from CVS: tag r20-4b11
cvs
parents:
diff changeset
154 new_scrollbar_width, new_scrollbar_height,
12579d965149 Import from CVS: tag r20-4b11
cvs
parents:
diff changeset
155 TRUE);
12579d965149 Import from CVS: tag r20-4b11
cvs
parents:
diff changeset
156 }
12579d965149 Import from CVS: tag r20-4b11
cvs
parents:
diff changeset
157 }
12579d965149 Import from CVS: tag r20-4b11
cvs
parents:
diff changeset
158
12579d965149 Import from CVS: tag r20-4b11
cvs
parents:
diff changeset
159 static void
12579d965149 Import from CVS: tag r20-4b11
cvs
parents:
diff changeset
160 mswindows_update_scrollbar_instance_status (struct window *w,
12579d965149 Import from CVS: tag r20-4b11
cvs
parents:
diff changeset
161 int active, int size,
12579d965149 Import from CVS: tag r20-4b11
cvs
parents:
diff changeset
162 struct scrollbar_instance *sb)
12579d965149 Import from CVS: tag r20-4b11
cvs
parents:
diff changeset
163 {
269
b2472a1930f2 Import from CVS: tag r20-5b33
cvs
parents: 249
diff changeset
164 if (SCROLLBAR_MSW_SIZE (sb) != size)
b2472a1930f2 Import from CVS: tag r20-5b33
cvs
parents: 249
diff changeset
165 {
b2472a1930f2 Import from CVS: tag r20-5b33
cvs
parents: 249
diff changeset
166 SCROLLBAR_MSW_SIZE (sb) = size;
b2472a1930f2 Import from CVS: tag r20-5b33
cvs
parents: 249
diff changeset
167 ShowScrollBar (SCROLLBAR_MSW_HANDLE (sb), SB_CTL,
b2472a1930f2 Import from CVS: tag r20-5b33
cvs
parents: 249
diff changeset
168 SCROLLBAR_MSW_SIZE (sb));
b2472a1930f2 Import from CVS: tag r20-5b33
cvs
parents: 249
diff changeset
169 SCROLLBAR_MSW_INFO(sb).fMask |= SIF_DISABLENOSCROLL;
b2472a1930f2 Import from CVS: tag r20-5b33
cvs
parents: 249
diff changeset
170 SetScrollInfo(SCROLLBAR_MSW_HANDLE (sb), SB_CTL, &SCROLLBAR_MSW_INFO (sb), TRUE);
b2472a1930f2 Import from CVS: tag r20-5b33
cvs
parents: 249
diff changeset
171 }
225
12579d965149 Import from CVS: tag r20-4b11
cvs
parents:
diff changeset
172 }
12579d965149 Import from CVS: tag r20-4b11
cvs
parents:
diff changeset
173
12579d965149 Import from CVS: tag r20-4b11
cvs
parents:
diff changeset
174 void
12579d965149 Import from CVS: tag r20-4b11
cvs
parents:
diff changeset
175 mswindows_handle_scrollbar_event (HWND hwnd, int code, int pos)
12579d965149 Import from CVS: tag r20-4b11
cvs
parents:
diff changeset
176 {
12579d965149 Import from CVS: tag r20-4b11
cvs
parents:
diff changeset
177 struct frame *f;
288
e11d67e05968 Import from CVS: tag r21-0b42
cvs
parents: 286
diff changeset
178 Lisp_Object win, frame;
225
12579d965149 Import from CVS: tag r20-4b11
cvs
parents:
diff changeset
179 struct scrollbar_instance *sb;
12579d965149 Import from CVS: tag r20-4b11
cvs
parents:
diff changeset
180 SCROLLINFO scrollinfo;
227
0e522484dd2a Import from CVS: tag r20-5b12
cvs
parents: 225
diff changeset
181 int vert = GetWindowLong (hwnd, GWL_STYLE) & SBS_VERT;
375
a300bb07d72d Import from CVS: tag r21-2b3
cvs
parents: 371
diff changeset
182 int value;
225
12579d965149 Import from CVS: tag r20-4b11
cvs
parents:
diff changeset
183
12579d965149 Import from CVS: tag r20-4b11
cvs
parents:
diff changeset
184 sb = (struct scrollbar_instance *)GetWindowLong (hwnd, GWL_USERDATA);
12579d965149 Import from CVS: tag r20-4b11
cvs
parents:
diff changeset
185 win = real_window (sb->mirror, 1);
288
e11d67e05968 Import from CVS: tag r21-0b42
cvs
parents: 286
diff changeset
186 frame = XWINDOW (win)->frame;
e11d67e05968 Import from CVS: tag r21-0b42
cvs
parents: 286
diff changeset
187 f = XFRAME (frame);
225
12579d965149 Import from CVS: tag r20-4b11
cvs
parents:
diff changeset
188
227
0e522484dd2a Import from CVS: tag r20-5b12
cvs
parents: 225
diff changeset
189 /* SB_LINEDOWN == SB_CHARLEFT etc. This is the way they will
0e522484dd2a Import from CVS: tag r20-5b12
cvs
parents: 225
diff changeset
190 always be - any Windows is binary compatible backward with
0e522484dd2a Import from CVS: tag r20-5b12
cvs
parents: 225
diff changeset
191 old programs */
0e522484dd2a Import from CVS: tag r20-5b12
cvs
parents: 225
diff changeset
192
225
12579d965149 Import from CVS: tag r20-4b11
cvs
parents:
diff changeset
193 switch (code)
12579d965149 Import from CVS: tag r20-4b11
cvs
parents:
diff changeset
194 {
12579d965149 Import from CVS: tag r20-4b11
cvs
parents:
diff changeset
195 case SB_LINEDOWN:
288
e11d67e05968 Import from CVS: tag r21-0b42
cvs
parents: 286
diff changeset
196 mswindows_enqueue_misc_user_event
e11d67e05968 Import from CVS: tag r21-0b42
cvs
parents: 286
diff changeset
197 (frame, vert ? Qscrollbar_line_down : Qscrollbar_char_right, win);
225
12579d965149 Import from CVS: tag r20-4b11
cvs
parents:
diff changeset
198 break;
12579d965149 Import from CVS: tag r20-4b11
cvs
parents:
diff changeset
199
12579d965149 Import from CVS: tag r20-4b11
cvs
parents:
diff changeset
200 case SB_LINEUP:
288
e11d67e05968 Import from CVS: tag r21-0b42
cvs
parents: 286
diff changeset
201 mswindows_enqueue_misc_user_event
e11d67e05968 Import from CVS: tag r21-0b42
cvs
parents: 286
diff changeset
202 (frame, vert ? Qscrollbar_line_up : Qscrollbar_char_left, win);
225
12579d965149 Import from CVS: tag r20-4b11
cvs
parents:
diff changeset
203 break;
12579d965149 Import from CVS: tag r20-4b11
cvs
parents:
diff changeset
204
12579d965149 Import from CVS: tag r20-4b11
cvs
parents:
diff changeset
205 case SB_PAGEDOWN:
288
e11d67e05968 Import from CVS: tag r21-0b42
cvs
parents: 286
diff changeset
206 mswindows_enqueue_misc_user_event
e11d67e05968 Import from CVS: tag r21-0b42
cvs
parents: 286
diff changeset
207 (win, vert ? Qscrollbar_page_down : Qscrollbar_page_right,
e11d67e05968 Import from CVS: tag r21-0b42
cvs
parents: 286
diff changeset
208 vert ? Fcons (win, Qnil) : win);
225
12579d965149 Import from CVS: tag r20-4b11
cvs
parents:
diff changeset
209 break;
12579d965149 Import from CVS: tag r20-4b11
cvs
parents:
diff changeset
210
12579d965149 Import from CVS: tag r20-4b11
cvs
parents:
diff changeset
211 case SB_PAGEUP:
288
e11d67e05968 Import from CVS: tag r21-0b42
cvs
parents: 286
diff changeset
212 mswindows_enqueue_misc_user_event
e11d67e05968 Import from CVS: tag r21-0b42
cvs
parents: 286
diff changeset
213 (frame,
e11d67e05968 Import from CVS: tag r21-0b42
cvs
parents: 286
diff changeset
214 vert ? Qscrollbar_page_up : Qscrollbar_page_left,
e11d67e05968 Import from CVS: tag r21-0b42
cvs
parents: 286
diff changeset
215 vert ? Fcons (win, Qnil) : win);
225
12579d965149 Import from CVS: tag r20-4b11
cvs
parents:
diff changeset
216 break;
12579d965149 Import from CVS: tag r20-4b11
cvs
parents:
diff changeset
217
12579d965149 Import from CVS: tag r20-4b11
cvs
parents:
diff changeset
218 case SB_BOTTOM:
288
e11d67e05968 Import from CVS: tag r21-0b42
cvs
parents: 286
diff changeset
219 mswindows_enqueue_misc_user_event
e11d67e05968 Import from CVS: tag r21-0b42
cvs
parents: 286
diff changeset
220 (frame, vert ? Qscrollbar_to_bottom : Qscrollbar_to_right, win);
225
12579d965149 Import from CVS: tag r20-4b11
cvs
parents:
diff changeset
221 break;
12579d965149 Import from CVS: tag r20-4b11
cvs
parents:
diff changeset
222
12579d965149 Import from CVS: tag r20-4b11
cvs
parents:
diff changeset
223 case SB_TOP:
288
e11d67e05968 Import from CVS: tag r21-0b42
cvs
parents: 286
diff changeset
224 mswindows_enqueue_misc_user_event
e11d67e05968 Import from CVS: tag r21-0b42
cvs
parents: 286
diff changeset
225 (frame, vert ? Qscrollbar_to_top : Qscrollbar_to_left, win);
225
12579d965149 Import from CVS: tag r20-4b11
cvs
parents:
diff changeset
226 break;
12579d965149 Import from CVS: tag r20-4b11
cvs
parents:
diff changeset
227
12579d965149 Import from CVS: tag r20-4b11
cvs
parents:
diff changeset
228 case SB_THUMBTRACK:
12579d965149 Import from CVS: tag r20-4b11
cvs
parents:
diff changeset
229 case SB_THUMBPOSITION:
227
0e522484dd2a Import from CVS: tag r20-5b12
cvs
parents: 225
diff changeset
230 scrollinfo.cbSize = sizeof(SCROLLINFO);
375
a300bb07d72d Import from CVS: tag r21-2b3
cvs
parents: 371
diff changeset
231 scrollinfo.fMask = SIF_ALL;
227
0e522484dd2a Import from CVS: tag r20-5b12
cvs
parents: 225
diff changeset
232 GetScrollInfo (hwnd, SB_CTL, &scrollinfo);
375
a300bb07d72d Import from CVS: tag r21-2b3
cvs
parents: 371
diff changeset
233 vertical_drag_in_progress = vert;
a300bb07d72d Import from CVS: tag r21-2b3
cvs
parents: 371
diff changeset
234 #ifdef VERTICAL_SCROLLBAR_DRAG_HACK
a300bb07d72d Import from CVS: tag r21-2b3
cvs
parents: 371
diff changeset
235 if (vert && (scrollinfo.nTrackPos > scrollinfo.nPos))
a300bb07d72d Import from CVS: tag r21-2b3
cvs
parents: 371
diff changeset
236 /* new buffer position =
a300bb07d72d Import from CVS: tag r21-2b3
cvs
parents: 371
diff changeset
237 * buffer position at start of drag +
a300bb07d72d Import from CVS: tag r21-2b3
cvs
parents: 371
diff changeset
238 * ((text remaining in buffer at start of drag) *
a300bb07d72d Import from CVS: tag r21-2b3
cvs
parents: 371
diff changeset
239 * (amount that the thumb has been moved) /
a300bb07d72d Import from CVS: tag r21-2b3
cvs
parents: 371
diff changeset
240 * (space that remained past end of the thumb at start of drag)) */
a300bb07d72d Import from CVS: tag r21-2b3
cvs
parents: 371
diff changeset
241 value = (int)
a300bb07d72d Import from CVS: tag r21-2b3
cvs
parents: 371
diff changeset
242 (scrollinfo.nPos
a300bb07d72d Import from CVS: tag r21-2b3
cvs
parents: 371
diff changeset
243 + (((double)
a300bb07d72d Import from CVS: tag r21-2b3
cvs
parents: 371
diff changeset
244 (scrollinfo.nMax - scrollinfo.nPos)
a300bb07d72d Import from CVS: tag r21-2b3
cvs
parents: 371
diff changeset
245 * (scrollinfo.nTrackPos - scrollinfo.nPos))
a300bb07d72d Import from CVS: tag r21-2b3
cvs
parents: 371
diff changeset
246 / (scrollinfo.nMax - scrollinfo.nPage - scrollinfo.nPos)))
a300bb07d72d Import from CVS: tag r21-2b3
cvs
parents: 371
diff changeset
247 - 2; /* ensure that the last line doesn't disappear off screen */
a300bb07d72d Import from CVS: tag r21-2b3
cvs
parents: 371
diff changeset
248 else
a300bb07d72d Import from CVS: tag r21-2b3
cvs
parents: 371
diff changeset
249 #endif
a300bb07d72d Import from CVS: tag r21-2b3
cvs
parents: 371
diff changeset
250 value = scrollinfo.nTrackPos;
288
e11d67e05968 Import from CVS: tag r21-0b42
cvs
parents: 286
diff changeset
251 mswindows_enqueue_misc_user_event
e11d67e05968 Import from CVS: tag r21-0b42
cvs
parents: 286
diff changeset
252 (frame,
e11d67e05968 Import from CVS: tag r21-0b42
cvs
parents: 286
diff changeset
253 vert ? Qscrollbar_vertical_drag : Qscrollbar_horizontal_drag,
375
a300bb07d72d Import from CVS: tag r21-2b3
cvs
parents: 371
diff changeset
254 Fcons (win, make_int (value)));
a300bb07d72d Import from CVS: tag r21-2b3
cvs
parents: 371
diff changeset
255 break;
a300bb07d72d Import from CVS: tag r21-2b3
cvs
parents: 371
diff changeset
256
a300bb07d72d Import from CVS: tag r21-2b3
cvs
parents: 371
diff changeset
257 case SB_ENDSCROLL:
a300bb07d72d Import from CVS: tag r21-2b3
cvs
parents: 371
diff changeset
258 #ifdef VERTICAL_SCROLLBAR_DRAG_HACK
a300bb07d72d Import from CVS: tag r21-2b3
cvs
parents: 371
diff changeset
259 if (vertical_drag_in_progress)
a300bb07d72d Import from CVS: tag r21-2b3
cvs
parents: 371
diff changeset
260 /* User has just dropped the thumb - finally update it */
a300bb07d72d Import from CVS: tag r21-2b3
cvs
parents: 371
diff changeset
261 SetScrollInfo (SCROLLBAR_MSW_HANDLE (sb), SB_CTL,
a300bb07d72d Import from CVS: tag r21-2b3
cvs
parents: 371
diff changeset
262 &SCROLLBAR_MSW_INFO (sb), TRUE);
a300bb07d72d Import from CVS: tag r21-2b3
cvs
parents: 371
diff changeset
263 #endif
a300bb07d72d Import from CVS: tag r21-2b3
cvs
parents: 371
diff changeset
264 vertical_drag_in_progress = 0;
225
12579d965149 Import from CVS: tag r20-4b11
cvs
parents:
diff changeset
265 break;
12579d965149 Import from CVS: tag r20-4b11
cvs
parents:
diff changeset
266 }
12579d965149 Import from CVS: tag r20-4b11
cvs
parents:
diff changeset
267 }
12579d965149 Import from CVS: tag r20-4b11
cvs
parents:
diff changeset
268
398
74fd4e045ea6 Import from CVS: tag r21-2-29
cvs
parents: 380
diff changeset
269 static int
74fd4e045ea6 Import from CVS: tag r21-2-29
cvs
parents: 380
diff changeset
270 can_scroll(struct scrollbar_instance* scrollbar)
74fd4e045ea6 Import from CVS: tag r21-2-29
cvs
parents: 380
diff changeset
271 {
74fd4e045ea6 Import from CVS: tag r21-2-29
cvs
parents: 380
diff changeset
272 return scrollbar != NULL
74fd4e045ea6 Import from CVS: tag r21-2-29
cvs
parents: 380
diff changeset
273 && IsWindowVisible (SCROLLBAR_MSW_HANDLE (scrollbar))
74fd4e045ea6 Import from CVS: tag r21-2-29
cvs
parents: 380
diff changeset
274 && IsWindowEnabled (SCROLLBAR_MSW_HANDLE (scrollbar));
74fd4e045ea6 Import from CVS: tag r21-2-29
cvs
parents: 380
diff changeset
275 }
74fd4e045ea6 Import from CVS: tag r21-2-29
cvs
parents: 380
diff changeset
276
74fd4e045ea6 Import from CVS: tag r21-2-29
cvs
parents: 380
diff changeset
277 int
74fd4e045ea6 Import from CVS: tag r21-2-29
cvs
parents: 380
diff changeset
278 mswindows_handle_mousewheel_event (Lisp_Object frame, int keys, int delta)
74fd4e045ea6 Import from CVS: tag r21-2-29
cvs
parents: 380
diff changeset
279 {
74fd4e045ea6 Import from CVS: tag r21-2-29
cvs
parents: 380
diff changeset
280 int hasVertBar, hasHorzBar; /* Indicates prescence of scroll bars */
74fd4e045ea6 Import from CVS: tag r21-2-29
cvs
parents: 380
diff changeset
281 unsigned wheelScrollLines = 0; /* Number of lines per wheel notch */
74fd4e045ea6 Import from CVS: tag r21-2-29
cvs
parents: 380
diff changeset
282
74fd4e045ea6 Import from CVS: tag r21-2-29
cvs
parents: 380
diff changeset
283 /* Find the currently selected window */
74fd4e045ea6 Import from CVS: tag r21-2-29
cvs
parents: 380
diff changeset
284 Lisp_Object win = FRAME_SELECTED_WINDOW (XFRAME (frame));
74fd4e045ea6 Import from CVS: tag r21-2-29
cvs
parents: 380
diff changeset
285 struct window* w = XWINDOW (win);
74fd4e045ea6 Import from CVS: tag r21-2-29
cvs
parents: 380
diff changeset
286 struct window_mirror* mirror = find_window_mirror (w);
74fd4e045ea6 Import from CVS: tag r21-2-29
cvs
parents: 380
diff changeset
287
74fd4e045ea6 Import from CVS: tag r21-2-29
cvs
parents: 380
diff changeset
288 /* Check that there is something to scroll */
74fd4e045ea6 Import from CVS: tag r21-2-29
cvs
parents: 380
diff changeset
289 hasVertBar = can_scroll (mirror->scrollbar_vertical_instance);
74fd4e045ea6 Import from CVS: tag r21-2-29
cvs
parents: 380
diff changeset
290 hasHorzBar = can_scroll (mirror->scrollbar_horizontal_instance);
74fd4e045ea6 Import from CVS: tag r21-2-29
cvs
parents: 380
diff changeset
291 if (!hasVertBar && !hasHorzBar)
74fd4e045ea6 Import from CVS: tag r21-2-29
cvs
parents: 380
diff changeset
292 return FALSE;
74fd4e045ea6 Import from CVS: tag r21-2-29
cvs
parents: 380
diff changeset
293
74fd4e045ea6 Import from CVS: tag r21-2-29
cvs
parents: 380
diff changeset
294 /* No support for panning and zooming, so ignore */
74fd4e045ea6 Import from CVS: tag r21-2-29
cvs
parents: 380
diff changeset
295 if (keys & (MK_SHIFT | MK_CONTROL))
74fd4e045ea6 Import from CVS: tag r21-2-29
cvs
parents: 380
diff changeset
296 return FALSE;
74fd4e045ea6 Import from CVS: tag r21-2-29
cvs
parents: 380
diff changeset
297
74fd4e045ea6 Import from CVS: tag r21-2-29
cvs
parents: 380
diff changeset
298 /* Get the number of lines per wheel delta */
74fd4e045ea6 Import from CVS: tag r21-2-29
cvs
parents: 380
diff changeset
299 SystemParametersInfo (SPI_GETWHEELSCROLLLINES, 0, &wheelScrollLines, 0);
74fd4e045ea6 Import from CVS: tag r21-2-29
cvs
parents: 380
diff changeset
300
74fd4e045ea6 Import from CVS: tag r21-2-29
cvs
parents: 380
diff changeset
301 /* Calculate the amount to scroll */
74fd4e045ea6 Import from CVS: tag r21-2-29
cvs
parents: 380
diff changeset
302 if (wheelScrollLines == WHEEL_PAGESCROLL)
74fd4e045ea6 Import from CVS: tag r21-2-29
cvs
parents: 380
diff changeset
303 {
74fd4e045ea6 Import from CVS: tag r21-2-29
cvs
parents: 380
diff changeset
304 /* Scroll by a page */
74fd4e045ea6 Import from CVS: tag r21-2-29
cvs
parents: 380
diff changeset
305 Lisp_Object function;
74fd4e045ea6 Import from CVS: tag r21-2-29
cvs
parents: 380
diff changeset
306 if (hasVertBar)
74fd4e045ea6 Import from CVS: tag r21-2-29
cvs
parents: 380
diff changeset
307 function = delta > 0 ? Qscrollbar_page_up : Qscrollbar_page_down;
74fd4e045ea6 Import from CVS: tag r21-2-29
cvs
parents: 380
diff changeset
308 else
74fd4e045ea6 Import from CVS: tag r21-2-29
cvs
parents: 380
diff changeset
309 function = delta > 0 ? Qscrollbar_page_left : Qscrollbar_page_right;
74fd4e045ea6 Import from CVS: tag r21-2-29
cvs
parents: 380
diff changeset
310 mswindows_enqueue_misc_user_event (frame, function, Fcons (win, Qnil));
74fd4e045ea6 Import from CVS: tag r21-2-29
cvs
parents: 380
diff changeset
311 }
74fd4e045ea6 Import from CVS: tag r21-2-29
cvs
parents: 380
diff changeset
312 else /* Scroll by a number of lines */
74fd4e045ea6 Import from CVS: tag r21-2-29
cvs
parents: 380
diff changeset
313 {
74fd4e045ea6 Import from CVS: tag r21-2-29
cvs
parents: 380
diff changeset
314 /* Calc the number of lines to scroll */
74fd4e045ea6 Import from CVS: tag r21-2-29
cvs
parents: 380
diff changeset
315 int toScroll = MulDiv (delta, wheelScrollLines, WHEEL_DELTA);
74fd4e045ea6 Import from CVS: tag r21-2-29
cvs
parents: 380
diff changeset
316
74fd4e045ea6 Import from CVS: tag r21-2-29
cvs
parents: 380
diff changeset
317 /* Do the scroll */
74fd4e045ea6 Import from CVS: tag r21-2-29
cvs
parents: 380
diff changeset
318 Lisp_Object function;
74fd4e045ea6 Import from CVS: tag r21-2-29
cvs
parents: 380
diff changeset
319 if (hasVertBar)
74fd4e045ea6 Import from CVS: tag r21-2-29
cvs
parents: 380
diff changeset
320 function = delta > 0 ? Qscrollbar_line_up : Qscrollbar_line_down;
74fd4e045ea6 Import from CVS: tag r21-2-29
cvs
parents: 380
diff changeset
321 else
74fd4e045ea6 Import from CVS: tag r21-2-29
cvs
parents: 380
diff changeset
322 function = delta > 0 ? Qscrollbar_char_left : Qscrollbar_char_right;
74fd4e045ea6 Import from CVS: tag r21-2-29
cvs
parents: 380
diff changeset
323 if (toScroll < 0)
74fd4e045ea6 Import from CVS: tag r21-2-29
cvs
parents: 380
diff changeset
324 toScroll = -toScroll;
74fd4e045ea6 Import from CVS: tag r21-2-29
cvs
parents: 380
diff changeset
325 while (toScroll--)
74fd4e045ea6 Import from CVS: tag r21-2-29
cvs
parents: 380
diff changeset
326 mswindows_enqueue_misc_user_event (frame, function, win);
74fd4e045ea6 Import from CVS: tag r21-2-29
cvs
parents: 380
diff changeset
327 }
74fd4e045ea6 Import from CVS: tag r21-2-29
cvs
parents: 380
diff changeset
328
74fd4e045ea6 Import from CVS: tag r21-2-29
cvs
parents: 380
diff changeset
329 return TRUE;
74fd4e045ea6 Import from CVS: tag r21-2-29
cvs
parents: 380
diff changeset
330 }
74fd4e045ea6 Import from CVS: tag r21-2-29
cvs
parents: 380
diff changeset
331
225
12579d965149 Import from CVS: tag r20-4b11
cvs
parents:
diff changeset
332 #ifdef MEMORY_USAGE_STATS
12579d965149 Import from CVS: tag r20-4b11
cvs
parents:
diff changeset
333
12579d965149 Import from CVS: tag r20-4b11
cvs
parents:
diff changeset
334 static int
12579d965149 Import from CVS: tag r20-4b11
cvs
parents:
diff changeset
335 mswindows_compute_scrollbar_instance_usage (struct device *d,
12579d965149 Import from CVS: tag r20-4b11
cvs
parents:
diff changeset
336 struct scrollbar_instance *inst,
12579d965149 Import from CVS: tag r20-4b11
cvs
parents:
diff changeset
337 struct overhead_stats *ovstats)
12579d965149 Import from CVS: tag r20-4b11
cvs
parents:
diff changeset
338 {
12579d965149 Import from CVS: tag r20-4b11
cvs
parents:
diff changeset
339 int total = 0;
12579d965149 Import from CVS: tag r20-4b11
cvs
parents:
diff changeset
340
12579d965149 Import from CVS: tag r20-4b11
cvs
parents:
diff changeset
341 while (inst)
12579d965149 Import from CVS: tag r20-4b11
cvs
parents:
diff changeset
342 {
12579d965149 Import from CVS: tag r20-4b11
cvs
parents:
diff changeset
343 struct mswindows_scrollbar_data *data =
12579d965149 Import from CVS: tag r20-4b11
cvs
parents:
diff changeset
344 (struct mswindows_scrollbar_data *) inst->scrollbar_data;
12579d965149 Import from CVS: tag r20-4b11
cvs
parents:
diff changeset
345
12579d965149 Import from CVS: tag r20-4b11
cvs
parents:
diff changeset
346 total += malloced_storage_size (data, sizeof (*data), ovstats);
12579d965149 Import from CVS: tag r20-4b11
cvs
parents:
diff changeset
347 inst = inst->next;
12579d965149 Import from CVS: tag r20-4b11
cvs
parents:
diff changeset
348 }
12579d965149 Import from CVS: tag r20-4b11
cvs
parents:
diff changeset
349
12579d965149 Import from CVS: tag r20-4b11
cvs
parents:
diff changeset
350 return total;
12579d965149 Import from CVS: tag r20-4b11
cvs
parents:
diff changeset
351 }
12579d965149 Import from CVS: tag r20-4b11
cvs
parents:
diff changeset
352
12579d965149 Import from CVS: tag r20-4b11
cvs
parents:
diff changeset
353 #endif /* MEMORY_USAGE_STATS */
276
6330739388db Import from CVS: tag r21-0b36
cvs
parents: 269
diff changeset
354
6330739388db Import from CVS: tag r21-0b36
cvs
parents: 269
diff changeset
355 /************************************************************************/
6330739388db Import from CVS: tag r21-0b36
cvs
parents: 269
diff changeset
356 /* Device-specific ghost specifiers initialization */
6330739388db Import from CVS: tag r21-0b36
cvs
parents: 269
diff changeset
357 /************************************************************************/
225
12579d965149 Import from CVS: tag r20-4b11
cvs
parents:
diff changeset
358
276
6330739388db Import from CVS: tag r21-0b36
cvs
parents: 269
diff changeset
359 DEFUN ("mswindows-init-scrollbar-metrics", Fmswindows_init_scrollbar_metrics, 1, 1, 0, /*
6330739388db Import from CVS: tag r21-0b36
cvs
parents: 269
diff changeset
360 */
6330739388db Import from CVS: tag r21-0b36
cvs
parents: 269
diff changeset
361 (locale))
6330739388db Import from CVS: tag r21-0b36
cvs
parents: 269
diff changeset
362 {
6330739388db Import from CVS: tag r21-0b36
cvs
parents: 269
diff changeset
363 if (DEVICEP (locale))
6330739388db Import from CVS: tag r21-0b36
cvs
parents: 269
diff changeset
364 {
6330739388db Import from CVS: tag r21-0b36
cvs
parents: 269
diff changeset
365 add_spec_to_ghost_specifier (Vscrollbar_width,
6330739388db Import from CVS: tag r21-0b36
cvs
parents: 269
diff changeset
366 make_int (GetSystemMetrics (SM_CXVSCROLL)),
6330739388db Import from CVS: tag r21-0b36
cvs
parents: 269
diff changeset
367 locale, Qmswindows, Qnil);
6330739388db Import from CVS: tag r21-0b36
cvs
parents: 269
diff changeset
368 add_spec_to_ghost_specifier (Vscrollbar_height,
6330739388db Import from CVS: tag r21-0b36
cvs
parents: 269
diff changeset
369 make_int (GetSystemMetrics (SM_CYHSCROLL)),
6330739388db Import from CVS: tag r21-0b36
cvs
parents: 269
diff changeset
370 locale, Qmswindows, Qnil);
6330739388db Import from CVS: tag r21-0b36
cvs
parents: 269
diff changeset
371 }
6330739388db Import from CVS: tag r21-0b36
cvs
parents: 269
diff changeset
372 return Qnil;
6330739388db Import from CVS: tag r21-0b36
cvs
parents: 269
diff changeset
373 }
6330739388db Import from CVS: tag r21-0b36
cvs
parents: 269
diff changeset
374
6330739388db Import from CVS: tag r21-0b36
cvs
parents: 269
diff changeset
375
225
12579d965149 Import from CVS: tag r20-4b11
cvs
parents:
diff changeset
376 /************************************************************************/
12579d965149 Import from CVS: tag r20-4b11
cvs
parents:
diff changeset
377 /* initialization */
12579d965149 Import from CVS: tag r20-4b11
cvs
parents:
diff changeset
378 /************************************************************************/
12579d965149 Import from CVS: tag r20-4b11
cvs
parents:
diff changeset
379
12579d965149 Import from CVS: tag r20-4b11
cvs
parents:
diff changeset
380 void
12579d965149 Import from CVS: tag r20-4b11
cvs
parents:
diff changeset
381 console_type_create_scrollbar_mswindows (void)
12579d965149 Import from CVS: tag r20-4b11
cvs
parents:
diff changeset
382 {
12579d965149 Import from CVS: tag r20-4b11
cvs
parents:
diff changeset
383 CONSOLE_HAS_METHOD (mswindows, create_scrollbar_instance);
12579d965149 Import from CVS: tag r20-4b11
cvs
parents:
diff changeset
384 CONSOLE_HAS_METHOD (mswindows, free_scrollbar_instance);
12579d965149 Import from CVS: tag r20-4b11
cvs
parents:
diff changeset
385 CONSOLE_HAS_METHOD (mswindows, release_scrollbar_instance);
12579d965149 Import from CVS: tag r20-4b11
cvs
parents:
diff changeset
386 CONSOLE_HAS_METHOD (mswindows, update_scrollbar_instance_values);
12579d965149 Import from CVS: tag r20-4b11
cvs
parents:
diff changeset
387 CONSOLE_HAS_METHOD (mswindows, update_scrollbar_instance_status);
12579d965149 Import from CVS: tag r20-4b11
cvs
parents:
diff changeset
388 /* CONSOLE_HAS_METHOD (mswindows, scrollbar_width_changed_in_frame); */
12579d965149 Import from CVS: tag r20-4b11
cvs
parents:
diff changeset
389 #ifdef MEMORY_USAGE_STATS
12579d965149 Import from CVS: tag r20-4b11
cvs
parents:
diff changeset
390 CONSOLE_HAS_METHOD (mswindows, compute_scrollbar_instance_usage);
12579d965149 Import from CVS: tag r20-4b11
cvs
parents:
diff changeset
391 #endif
12579d965149 Import from CVS: tag r20-4b11
cvs
parents:
diff changeset
392 }
12579d965149 Import from CVS: tag r20-4b11
cvs
parents:
diff changeset
393
12579d965149 Import from CVS: tag r20-4b11
cvs
parents:
diff changeset
394 void
276
6330739388db Import from CVS: tag r21-0b36
cvs
parents: 269
diff changeset
395 syms_of_scrollbar_mswindows(void)
6330739388db Import from CVS: tag r21-0b36
cvs
parents: 269
diff changeset
396 {
6330739388db Import from CVS: tag r21-0b36
cvs
parents: 269
diff changeset
397 DEFSUBR (Fmswindows_init_scrollbar_metrics);
6330739388db Import from CVS: tag r21-0b36
cvs
parents: 269
diff changeset
398 }
6330739388db Import from CVS: tag r21-0b36
cvs
parents: 269
diff changeset
399
6330739388db Import from CVS: tag r21-0b36
cvs
parents: 269
diff changeset
400 void
225
12579d965149 Import from CVS: tag r20-4b11
cvs
parents:
diff changeset
401 vars_of_scrollbar_mswindows(void)
12579d965149 Import from CVS: tag r20-4b11
cvs
parents:
diff changeset
402 {
12579d965149 Import from CVS: tag r20-4b11
cvs
parents:
diff changeset
403 Fprovide (intern ("mswindows-scrollbars"));
12579d965149 Import from CVS: tag r20-4b11
cvs
parents:
diff changeset
404 }
12579d965149 Import from CVS: tag r20-4b11
cvs
parents:
diff changeset
405