annotate src/scrollbar-msw.c @ 225:12579d965149 r20-4b11

Import from CVS: tag r20-4b11
author cvs
date Mon, 13 Aug 2007 10:11:40 +0200
parents
children 0e522484dd2a
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.
12579d965149 Import from CVS: tag r20-4b11
cvs
parents:
diff changeset
3 Copyright (C) 1994 Amdhal Corporation.
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>
12579d965149 Import from CVS: tag r20-4b11
cvs
parents:
diff changeset
27 #include "lisp.h"
12579d965149 Import from CVS: tag r20-4b11
cvs
parents:
diff changeset
28
12579d965149 Import from CVS: tag r20-4b11
cvs
parents:
diff changeset
29 #include "console-msw.h"
12579d965149 Import from CVS: tag r20-4b11
cvs
parents:
diff changeset
30 #include "frame.h"
12579d965149 Import from CVS: tag r20-4b11
cvs
parents:
diff changeset
31 #include "window.h"
12579d965149 Import from CVS: tag r20-4b11
cvs
parents:
diff changeset
32 #include "scrollbar-msw.h"
12579d965149 Import from CVS: tag r20-4b11
cvs
parents:
diff changeset
33 #include "events.h"
12579d965149 Import from CVS: tag r20-4b11
cvs
parents:
diff changeset
34 #include "event-msw.h"
12579d965149 Import from CVS: tag r20-4b11
cvs
parents:
diff changeset
35
12579d965149 Import from CVS: tag r20-4b11
cvs
parents:
diff changeset
36 static void
12579d965149 Import from CVS: tag r20-4b11
cvs
parents:
diff changeset
37 mswindows_create_scrollbar_instance (struct frame *f, int vertical,
12579d965149 Import from CVS: tag r20-4b11
cvs
parents:
diff changeset
38 struct scrollbar_instance *sb)
12579d965149 Import from CVS: tag r20-4b11
cvs
parents:
diff changeset
39 {
12579d965149 Import from CVS: tag r20-4b11
cvs
parents:
diff changeset
40 int orientation;
12579d965149 Import from CVS: tag r20-4b11
cvs
parents:
diff changeset
41
12579d965149 Import from CVS: tag r20-4b11
cvs
parents:
diff changeset
42 sb->scrollbar_data = xnew_and_zero (struct mswindows_scrollbar_data);
12579d965149 Import from CVS: tag r20-4b11
cvs
parents:
diff changeset
43
12579d965149 Import from CVS: tag r20-4b11
cvs
parents:
diff changeset
44 if (vertical)
12579d965149 Import from CVS: tag r20-4b11
cvs
parents:
diff changeset
45 orientation = SBS_VERT;
12579d965149 Import from CVS: tag r20-4b11
cvs
parents:
diff changeset
46 else
12579d965149 Import from CVS: tag r20-4b11
cvs
parents:
diff changeset
47 orientation = SBS_HORZ;
12579d965149 Import from CVS: tag r20-4b11
cvs
parents:
diff changeset
48
12579d965149 Import from CVS: tag r20-4b11
cvs
parents:
diff changeset
49 SCROLLBAR_MSW_HANDLE (sb) =
12579d965149 Import from CVS: tag r20-4b11
cvs
parents:
diff changeset
50 CreateWindowEx(0, "SCROLLBAR", 0, orientation|WS_CHILD,
12579d965149 Import from CVS: tag r20-4b11
cvs
parents:
diff changeset
51 CW_USEDEFAULT, CW_USEDEFAULT,
12579d965149 Import from CVS: tag r20-4b11
cvs
parents:
diff changeset
52 CW_USEDEFAULT, CW_USEDEFAULT,
12579d965149 Import from CVS: tag r20-4b11
cvs
parents:
diff changeset
53 FRAME_MSWINDOWS_HANDLE (f),
12579d965149 Import from CVS: tag r20-4b11
cvs
parents:
diff changeset
54 NULL, NULL, NULL);
12579d965149 Import from CVS: tag r20-4b11
cvs
parents:
diff changeset
55 SCROLLBAR_MSW_INFO (sb).fMask = SIF_ALL;
12579d965149 Import from CVS: tag r20-4b11
cvs
parents:
diff changeset
56 GetScrollInfo(SCROLLBAR_MSW_HANDLE (sb), SB_CTL,
12579d965149 Import from CVS: tag r20-4b11
cvs
parents:
diff changeset
57 &SCROLLBAR_MSW_INFO (sb));
12579d965149 Import from CVS: tag r20-4b11
cvs
parents:
diff changeset
58 SetWindowLong (SCROLLBAR_MSW_HANDLE(sb), GWL_USERDATA, (LONG)sb);
12579d965149 Import from CVS: tag r20-4b11
cvs
parents:
diff changeset
59
12579d965149 Import from CVS: tag r20-4b11
cvs
parents:
diff changeset
60 #if 0
12579d965149 Import from CVS: tag r20-4b11
cvs
parents:
diff changeset
61 {
12579d965149 Import from CVS: tag r20-4b11
cvs
parents:
diff changeset
62 HWND h = SCROLLBAR_MSW_HANDLE (sb);
12579d965149 Import from CVS: tag r20-4b11
cvs
parents:
diff changeset
63 int x = SetWindowLong (SCROLLBAR_MSW_HANDLE(sb), GWL_USERDATA, (LONG)sb);
12579d965149 Import from CVS: tag r20-4b11
cvs
parents:
diff changeset
64 int y = GetLastError();
12579d965149 Import from CVS: tag r20-4b11
cvs
parents:
diff changeset
65 struct scrollbar_instance *z = (struct scrollbar_instance *)GetWindowLong (SCROLLBAR_MSW_HANDLE(sb),
12579d965149 Import from CVS: tag r20-4b11
cvs
parents:
diff changeset
66 GWL_USERDATA);
12579d965149 Import from CVS: tag r20-4b11
cvs
parents:
diff changeset
67 *z = *z;
12579d965149 Import from CVS: tag r20-4b11
cvs
parents:
diff changeset
68 }
12579d965149 Import from CVS: tag r20-4b11
cvs
parents:
diff changeset
69 #endif
12579d965149 Import from CVS: tag r20-4b11
cvs
parents:
diff changeset
70 }
12579d965149 Import from CVS: tag r20-4b11
cvs
parents:
diff changeset
71
12579d965149 Import from CVS: tag r20-4b11
cvs
parents:
diff changeset
72 static void
12579d965149 Import from CVS: tag r20-4b11
cvs
parents:
diff changeset
73 mswindows_free_scrollbar_instance (struct scrollbar_instance *sb)
12579d965149 Import from CVS: tag r20-4b11
cvs
parents:
diff changeset
74 {
12579d965149 Import from CVS: tag r20-4b11
cvs
parents:
diff changeset
75 DestroyWindow (SCROLLBAR_MSW_HANDLE (sb));
12579d965149 Import from CVS: tag r20-4b11
cvs
parents:
diff changeset
76 if (sb->scrollbar_data)
12579d965149 Import from CVS: tag r20-4b11
cvs
parents:
diff changeset
77 xfree (sb->scrollbar_data);
12579d965149 Import from CVS: tag r20-4b11
cvs
parents:
diff changeset
78 }
12579d965149 Import from CVS: tag r20-4b11
cvs
parents:
diff changeset
79
12579d965149 Import from CVS: tag r20-4b11
cvs
parents:
diff changeset
80 static void
12579d965149 Import from CVS: tag r20-4b11
cvs
parents:
diff changeset
81 mswindows_release_scrollbar_instance (struct scrollbar_instance *sb)
12579d965149 Import from CVS: tag r20-4b11
cvs
parents:
diff changeset
82 {
12579d965149 Import from CVS: tag r20-4b11
cvs
parents:
diff changeset
83 ShowScrollBar (SCROLLBAR_MSW_HANDLE (sb), SB_CTL, 0);
12579d965149 Import from CVS: tag r20-4b11
cvs
parents:
diff changeset
84 SCROLLBAR_MSW_SIZE (sb) = 0;
12579d965149 Import from CVS: tag r20-4b11
cvs
parents:
diff changeset
85 }
12579d965149 Import from CVS: tag r20-4b11
cvs
parents:
diff changeset
86
12579d965149 Import from CVS: tag r20-4b11
cvs
parents:
diff changeset
87 #define UPDATE_POS_FIELD(field) \
12579d965149 Import from CVS: tag r20-4b11
cvs
parents:
diff changeset
88 if (new_##field >= 0 && SCROLLBAR_MSW_DATA (sb)->field != new_##field) { \
12579d965149 Import from CVS: tag r20-4b11
cvs
parents:
diff changeset
89 SCROLLBAR_MSW_DATA (sb)->field = new_##field; \
12579d965149 Import from CVS: tag r20-4b11
cvs
parents:
diff changeset
90 pos_changed = 1; \
12579d965149 Import from CVS: tag r20-4b11
cvs
parents:
diff changeset
91 }
12579d965149 Import from CVS: tag r20-4b11
cvs
parents:
diff changeset
92
12579d965149 Import from CVS: tag r20-4b11
cvs
parents:
diff changeset
93 static void
12579d965149 Import from CVS: tag r20-4b11
cvs
parents:
diff changeset
94 mswindows_update_scrollbar_instance_values (struct window *w,
12579d965149 Import from CVS: tag r20-4b11
cvs
parents:
diff changeset
95 struct scrollbar_instance *sb,
12579d965149 Import from CVS: tag r20-4b11
cvs
parents:
diff changeset
96 int new_line_increment,
12579d965149 Import from CVS: tag r20-4b11
cvs
parents:
diff changeset
97 int new_page_increment,
12579d965149 Import from CVS: tag r20-4b11
cvs
parents:
diff changeset
98 int new_minimum, int new_maximum,
12579d965149 Import from CVS: tag r20-4b11
cvs
parents:
diff changeset
99 int new_slider_size,
12579d965149 Import from CVS: tag r20-4b11
cvs
parents:
diff changeset
100 int new_slider_position,
12579d965149 Import from CVS: tag r20-4b11
cvs
parents:
diff changeset
101 int new_scrollbar_width,
12579d965149 Import from CVS: tag r20-4b11
cvs
parents:
diff changeset
102 int new_scrollbar_height,
12579d965149 Import from CVS: tag r20-4b11
cvs
parents:
diff changeset
103 int new_scrollbar_x,
12579d965149 Import from CVS: tag r20-4b11
cvs
parents:
diff changeset
104 int new_scrollbar_y)
12579d965149 Import from CVS: tag r20-4b11
cvs
parents:
diff changeset
105 {
12579d965149 Import from CVS: tag r20-4b11
cvs
parents:
diff changeset
106 struct frame *f;
12579d965149 Import from CVS: tag r20-4b11
cvs
parents:
diff changeset
107 int pos_changed = 0;
12579d965149 Import from CVS: tag r20-4b11
cvs
parents:
diff changeset
108
12579d965149 Import from CVS: tag r20-4b11
cvs
parents:
diff changeset
109 f = XFRAME (w->frame);
12579d965149 Import from CVS: tag r20-4b11
cvs
parents:
diff changeset
110
12579d965149 Import from CVS: tag r20-4b11
cvs
parents:
diff changeset
111 /* These might be optimized, but since at least one will change at each
12579d965149 Import from CVS: tag r20-4b11
cvs
parents:
diff changeset
112 call, it's probably not worth it. */
12579d965149 Import from CVS: tag r20-4b11
cvs
parents:
diff changeset
113 SCROLLBAR_MSW_INFO (sb).nMin = new_minimum - 1;
12579d965149 Import from CVS: tag r20-4b11
cvs
parents:
diff changeset
114 SCROLLBAR_MSW_INFO (sb).nMax = new_maximum - 1;
12579d965149 Import from CVS: tag r20-4b11
cvs
parents:
diff changeset
115 SCROLLBAR_MSW_INFO (sb).nPage = new_slider_size;
12579d965149 Import from CVS: tag r20-4b11
cvs
parents:
diff changeset
116 SCROLLBAR_MSW_INFO (sb).nPos = new_slider_position;
12579d965149 Import from CVS: tag r20-4b11
cvs
parents:
diff changeset
117 SCROLLBAR_MSW_INFO (sb).fMask = SIF_ALL;
12579d965149 Import from CVS: tag r20-4b11
cvs
parents:
diff changeset
118
12579d965149 Import from CVS: tag r20-4b11
cvs
parents:
diff changeset
119 SetScrollInfo(SCROLLBAR_MSW_HANDLE (sb), SB_CTL, &SCROLLBAR_MSW_INFO (sb),
12579d965149 Import from CVS: tag r20-4b11
cvs
parents:
diff changeset
120 TRUE);
12579d965149 Import from CVS: tag r20-4b11
cvs
parents:
diff changeset
121
12579d965149 Import from CVS: tag r20-4b11
cvs
parents:
diff changeset
122 UPDATE_POS_FIELD (scrollbar_x);
12579d965149 Import from CVS: tag r20-4b11
cvs
parents:
diff changeset
123 UPDATE_POS_FIELD (scrollbar_y);
12579d965149 Import from CVS: tag r20-4b11
cvs
parents:
diff changeset
124 UPDATE_POS_FIELD (scrollbar_width);
12579d965149 Import from CVS: tag r20-4b11
cvs
parents:
diff changeset
125 UPDATE_POS_FIELD (scrollbar_height);
12579d965149 Import from CVS: tag r20-4b11
cvs
parents:
diff changeset
126
12579d965149 Import from CVS: tag r20-4b11
cvs
parents:
diff changeset
127 if (pos_changed)
12579d965149 Import from CVS: tag r20-4b11
cvs
parents:
diff changeset
128 {
12579d965149 Import from CVS: tag r20-4b11
cvs
parents:
diff changeset
129 MoveWindow(SCROLLBAR_MSW_HANDLE (sb),
12579d965149 Import from CVS: tag r20-4b11
cvs
parents:
diff changeset
130 new_scrollbar_x, new_scrollbar_y,
12579d965149 Import from CVS: tag r20-4b11
cvs
parents:
diff changeset
131 new_scrollbar_width, new_scrollbar_height,
12579d965149 Import from CVS: tag r20-4b11
cvs
parents:
diff changeset
132 TRUE);
12579d965149 Import from CVS: tag r20-4b11
cvs
parents:
diff changeset
133 }
12579d965149 Import from CVS: tag r20-4b11
cvs
parents:
diff changeset
134 }
12579d965149 Import from CVS: tag r20-4b11
cvs
parents:
diff changeset
135
12579d965149 Import from CVS: tag r20-4b11
cvs
parents:
diff changeset
136 static void
12579d965149 Import from CVS: tag r20-4b11
cvs
parents:
diff changeset
137 mswindows_update_scrollbar_instance_status (struct window *w,
12579d965149 Import from CVS: tag r20-4b11
cvs
parents:
diff changeset
138 int active, int size,
12579d965149 Import from CVS: tag r20-4b11
cvs
parents:
diff changeset
139 struct scrollbar_instance *sb)
12579d965149 Import from CVS: tag r20-4b11
cvs
parents:
diff changeset
140 {
12579d965149 Import from CVS: tag r20-4b11
cvs
parents:
diff changeset
141 struct frame *f = XFRAME (w->frame);
12579d965149 Import from CVS: tag r20-4b11
cvs
parents:
diff changeset
142
12579d965149 Import from CVS: tag r20-4b11
cvs
parents:
diff changeset
143 if (SCROLLBAR_MSW_SIZE (sb) != size) {
12579d965149 Import from CVS: tag r20-4b11
cvs
parents:
diff changeset
144 SCROLLBAR_MSW_SIZE (sb) = size;
12579d965149 Import from CVS: tag r20-4b11
cvs
parents:
diff changeset
145 ShowScrollBar (SCROLLBAR_MSW_HANDLE (sb), SB_CTL,
12579d965149 Import from CVS: tag r20-4b11
cvs
parents:
diff changeset
146 SCROLLBAR_MSW_SIZE (sb));
12579d965149 Import from CVS: tag r20-4b11
cvs
parents:
diff changeset
147 FRAMEMETH (f, set_frame_size, (f, FRAME_WIDTH (f), FRAME_HEIGHT (f)));
12579d965149 Import from CVS: tag r20-4b11
cvs
parents:
diff changeset
148 }
12579d965149 Import from CVS: tag r20-4b11
cvs
parents:
diff changeset
149 }
12579d965149 Import from CVS: tag r20-4b11
cvs
parents:
diff changeset
150
12579d965149 Import from CVS: tag r20-4b11
cvs
parents:
diff changeset
151 void
12579d965149 Import from CVS: tag r20-4b11
cvs
parents:
diff changeset
152 mswindows_handle_scrollbar_event (HWND hwnd, int code, int pos)
12579d965149 Import from CVS: tag r20-4b11
cvs
parents:
diff changeset
153 {
12579d965149 Import from CVS: tag r20-4b11
cvs
parents:
diff changeset
154 struct frame *f;
12579d965149 Import from CVS: tag r20-4b11
cvs
parents:
diff changeset
155 Lisp_Object win;
12579d965149 Import from CVS: tag r20-4b11
cvs
parents:
diff changeset
156 struct scrollbar_instance *sb;
12579d965149 Import from CVS: tag r20-4b11
cvs
parents:
diff changeset
157 SCROLLINFO scrollinfo;
12579d965149 Import from CVS: tag r20-4b11
cvs
parents:
diff changeset
158
12579d965149 Import from CVS: tag r20-4b11
cvs
parents:
diff changeset
159 sb = (struct scrollbar_instance *)GetWindowLong (hwnd, GWL_USERDATA);
12579d965149 Import from CVS: tag r20-4b11
cvs
parents:
diff changeset
160 win = real_window (sb->mirror, 1);
12579d965149 Import from CVS: tag r20-4b11
cvs
parents:
diff changeset
161 f = XFRAME (XWINDOW (win)->frame);
12579d965149 Import from CVS: tag r20-4b11
cvs
parents:
diff changeset
162
12579d965149 Import from CVS: tag r20-4b11
cvs
parents:
diff changeset
163 switch (code)
12579d965149 Import from CVS: tag r20-4b11
cvs
parents:
diff changeset
164 {
12579d965149 Import from CVS: tag r20-4b11
cvs
parents:
diff changeset
165 case SB_LINEDOWN:
12579d965149 Import from CVS: tag r20-4b11
cvs
parents:
diff changeset
166 enqueue_misc_user_event(win, Qscrollbar_line_down, win);
12579d965149 Import from CVS: tag r20-4b11
cvs
parents:
diff changeset
167 break;
12579d965149 Import from CVS: tag r20-4b11
cvs
parents:
diff changeset
168
12579d965149 Import from CVS: tag r20-4b11
cvs
parents:
diff changeset
169 case SB_LINEUP:
12579d965149 Import from CVS: tag r20-4b11
cvs
parents:
diff changeset
170 enqueue_misc_user_event(win, Qscrollbar_line_up, win);
12579d965149 Import from CVS: tag r20-4b11
cvs
parents:
diff changeset
171 break;
12579d965149 Import from CVS: tag r20-4b11
cvs
parents:
diff changeset
172
12579d965149 Import from CVS: tag r20-4b11
cvs
parents:
diff changeset
173 case SB_PAGEDOWN:
12579d965149 Import from CVS: tag r20-4b11
cvs
parents:
diff changeset
174 enqueue_misc_user_event(win, Qscrollbar_page_down, Fcons (win, Qnil));
12579d965149 Import from CVS: tag r20-4b11
cvs
parents:
diff changeset
175 break;
12579d965149 Import from CVS: tag r20-4b11
cvs
parents:
diff changeset
176
12579d965149 Import from CVS: tag r20-4b11
cvs
parents:
diff changeset
177 case SB_PAGEUP:
12579d965149 Import from CVS: tag r20-4b11
cvs
parents:
diff changeset
178 enqueue_misc_user_event(win, Qscrollbar_page_up, Fcons (win, Qnil));
12579d965149 Import from CVS: tag r20-4b11
cvs
parents:
diff changeset
179 break;
12579d965149 Import from CVS: tag r20-4b11
cvs
parents:
diff changeset
180
12579d965149 Import from CVS: tag r20-4b11
cvs
parents:
diff changeset
181 case SB_BOTTOM:
12579d965149 Import from CVS: tag r20-4b11
cvs
parents:
diff changeset
182 enqueue_misc_user_event(win, Qscrollbar_to_bottom, win);
12579d965149 Import from CVS: tag r20-4b11
cvs
parents:
diff changeset
183 break;
12579d965149 Import from CVS: tag r20-4b11
cvs
parents:
diff changeset
184
12579d965149 Import from CVS: tag r20-4b11
cvs
parents:
diff changeset
185 case SB_TOP:
12579d965149 Import from CVS: tag r20-4b11
cvs
parents:
diff changeset
186 enqueue_misc_user_event(win, Qscrollbar_to_top, win);
12579d965149 Import from CVS: tag r20-4b11
cvs
parents:
diff changeset
187 break;
12579d965149 Import from CVS: tag r20-4b11
cvs
parents:
diff changeset
188
12579d965149 Import from CVS: tag r20-4b11
cvs
parents:
diff changeset
189 case SB_THUMBTRACK:
12579d965149 Import from CVS: tag r20-4b11
cvs
parents:
diff changeset
190 case SB_THUMBPOSITION:
12579d965149 Import from CVS: tag r20-4b11
cvs
parents:
diff changeset
191 enqueue_misc_user_event (win, Qscrollbar_vertical_drag,
12579d965149 Import from CVS: tag r20-4b11
cvs
parents:
diff changeset
192 Fcons (win, make_int (pos)));
12579d965149 Import from CVS: tag r20-4b11
cvs
parents:
diff changeset
193 break;
12579d965149 Import from CVS: tag r20-4b11
cvs
parents:
diff changeset
194 }
12579d965149 Import from CVS: tag r20-4b11
cvs
parents:
diff changeset
195 }
12579d965149 Import from CVS: tag r20-4b11
cvs
parents:
diff changeset
196
12579d965149 Import from CVS: tag r20-4b11
cvs
parents:
diff changeset
197 #ifdef MEMORY_USAGE_STATS
12579d965149 Import from CVS: tag r20-4b11
cvs
parents:
diff changeset
198
12579d965149 Import from CVS: tag r20-4b11
cvs
parents:
diff changeset
199 static int
12579d965149 Import from CVS: tag r20-4b11
cvs
parents:
diff changeset
200 mswindows_compute_scrollbar_instance_usage (struct device *d,
12579d965149 Import from CVS: tag r20-4b11
cvs
parents:
diff changeset
201 struct scrollbar_instance *inst,
12579d965149 Import from CVS: tag r20-4b11
cvs
parents:
diff changeset
202 struct overhead_stats *ovstats)
12579d965149 Import from CVS: tag r20-4b11
cvs
parents:
diff changeset
203 {
12579d965149 Import from CVS: tag r20-4b11
cvs
parents:
diff changeset
204 int total = 0;
12579d965149 Import from CVS: tag r20-4b11
cvs
parents:
diff changeset
205
12579d965149 Import from CVS: tag r20-4b11
cvs
parents:
diff changeset
206 while (inst)
12579d965149 Import from CVS: tag r20-4b11
cvs
parents:
diff changeset
207 {
12579d965149 Import from CVS: tag r20-4b11
cvs
parents:
diff changeset
208 struct mswindows_scrollbar_data *data =
12579d965149 Import from CVS: tag r20-4b11
cvs
parents:
diff changeset
209 (struct mswindows_scrollbar_data *) inst->scrollbar_data;
12579d965149 Import from CVS: tag r20-4b11
cvs
parents:
diff changeset
210
12579d965149 Import from CVS: tag r20-4b11
cvs
parents:
diff changeset
211 total += malloced_storage_size (data, sizeof (*data), ovstats);
12579d965149 Import from CVS: tag r20-4b11
cvs
parents:
diff changeset
212 inst = inst->next;
12579d965149 Import from CVS: tag r20-4b11
cvs
parents:
diff changeset
213 }
12579d965149 Import from CVS: tag r20-4b11
cvs
parents:
diff changeset
214
12579d965149 Import from CVS: tag r20-4b11
cvs
parents:
diff changeset
215 return total;
12579d965149 Import from CVS: tag r20-4b11
cvs
parents:
diff changeset
216 }
12579d965149 Import from CVS: tag r20-4b11
cvs
parents:
diff changeset
217
12579d965149 Import from CVS: tag r20-4b11
cvs
parents:
diff changeset
218 #endif /* MEMORY_USAGE_STATS */
12579d965149 Import from CVS: tag r20-4b11
cvs
parents:
diff changeset
219
12579d965149 Import from CVS: tag r20-4b11
cvs
parents:
diff changeset
220 /************************************************************************/
12579d965149 Import from CVS: tag r20-4b11
cvs
parents:
diff changeset
221 /* initialization */
12579d965149 Import from CVS: tag r20-4b11
cvs
parents:
diff changeset
222 /************************************************************************/
12579d965149 Import from CVS: tag r20-4b11
cvs
parents:
diff changeset
223
12579d965149 Import from CVS: tag r20-4b11
cvs
parents:
diff changeset
224 void
12579d965149 Import from CVS: tag r20-4b11
cvs
parents:
diff changeset
225 console_type_create_scrollbar_mswindows (void)
12579d965149 Import from CVS: tag r20-4b11
cvs
parents:
diff changeset
226 {
12579d965149 Import from CVS: tag r20-4b11
cvs
parents:
diff changeset
227 CONSOLE_HAS_METHOD (mswindows, create_scrollbar_instance);
12579d965149 Import from CVS: tag r20-4b11
cvs
parents:
diff changeset
228 CONSOLE_HAS_METHOD (mswindows, free_scrollbar_instance);
12579d965149 Import from CVS: tag r20-4b11
cvs
parents:
diff changeset
229 CONSOLE_HAS_METHOD (mswindows, release_scrollbar_instance);
12579d965149 Import from CVS: tag r20-4b11
cvs
parents:
diff changeset
230 CONSOLE_HAS_METHOD (mswindows, update_scrollbar_instance_values);
12579d965149 Import from CVS: tag r20-4b11
cvs
parents:
diff changeset
231 CONSOLE_HAS_METHOD (mswindows, update_scrollbar_instance_status);
12579d965149 Import from CVS: tag r20-4b11
cvs
parents:
diff changeset
232 /* CONSOLE_HAS_METHOD (mswindows, scrollbar_width_changed_in_frame); */
12579d965149 Import from CVS: tag r20-4b11
cvs
parents:
diff changeset
233 #ifdef MEMORY_USAGE_STATS
12579d965149 Import from CVS: tag r20-4b11
cvs
parents:
diff changeset
234 CONSOLE_HAS_METHOD (mswindows, compute_scrollbar_instance_usage);
12579d965149 Import from CVS: tag r20-4b11
cvs
parents:
diff changeset
235 #endif
12579d965149 Import from CVS: tag r20-4b11
cvs
parents:
diff changeset
236 }
12579d965149 Import from CVS: tag r20-4b11
cvs
parents:
diff changeset
237
12579d965149 Import from CVS: tag r20-4b11
cvs
parents:
diff changeset
238 void
12579d965149 Import from CVS: tag r20-4b11
cvs
parents:
diff changeset
239 vars_of_scrollbar_mswindows(void)
12579d965149 Import from CVS: tag r20-4b11
cvs
parents:
diff changeset
240 {
12579d965149 Import from CVS: tag r20-4b11
cvs
parents:
diff changeset
241 Fprovide (intern ("mswindows-scrollbars"));
12579d965149 Import from CVS: tag r20-4b11
cvs
parents:
diff changeset
242 }
12579d965149 Import from CVS: tag r20-4b11
cvs
parents:
diff changeset
243