Skip to content
GitLab
Projects
Groups
Snippets
Help
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Open sidebar
Cameron Cawley
Browse
Commits
bd216181
Commit
bd216181
authored
27 years ago
by
David Brown
Browse files
Options
Download
Email Patches
Plain Diff
Pointer now remains normal if autoscrolling will not occur
parent
37aa211c
master
ahodgkin_208_i4_2
ahodgkin_208_i4
ahodgkin_208_i3
ahodgkin_208_i2
ahodgkin_208_i1
ahodgkin_207release
ahodgkin_206release
ahodgkin_205release
ahodgkin_204release
ahodgkin_202release
ahodgkin_201release
ahodgkin_200release
ahodgkin_133beta
ahodgkin_132beta
ahodgkin_131beta
ahodgkin_130beta
ahodgkin_129
ahodgkin_128beta
ahodgkin_128alpha
ahodgkin_127beta2
ahodgkin_127beta
ahodgkin_126beta
ahodgkin_AW97
ahodgkin_AW97patch
Browse-2_19
Browse-2_18
Browse-2_17
Browse-2_16
Browse-2_15
Browse-2_14
Browse-2_13
Browse-2_12
Browse-2_11
Browse-2_10
Browse-2_09
No related merge requests found
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
84 additions
and
98 deletions
+84
-98
c/Hotlist
c/Hotlist
+84
-98
No files found.
c/Hotlist
View file @
bd216181
...
...
@@ -4297,20 +4297,20 @@ _kernel_oserror *hotlist_autoscroll(int window)
ObjectId
parent
;
ComponentId
component
;
int
scroll_changed
;
WimpGetWindowStateBlock
state
;
BBox
extent
;
int
x
,
y
;
int
position
;
int
autoscroll_newtime
;
_kernel_oserror
*
e
;
ObjectId
over_window
;
BBox
extent
;
int
x
,
y
,
position
;
int
autoscroll_newtime
;
WimpGetWindowStateBlock
state
;
static
unsigned
int
scrolling
,
autoscroll_oldtime
,
mouse_shape
=
Mouse_Shape_Normal
;
/* Reset autoscroll handling if requested */
if
(
!
window
)
{
#ifdef TRACE
Printf
(
"hotlist_autoscroll: resetting
\n
"
);
if
(
tl
&
(
1
<<
25
))
Printf
(
"hotlist_autoscroll: resetting
\n
"
);
#endif
scrolling
=
0
;
mouse_set_pointer_shape
(
Mouse_Shape_Normal
);
...
...
@@ -4326,8 +4326,8 @@ _kernel_oserror *hotlist_autoscroll(int window)
RetError
(
wimp_get_window_state
(
&
state
));
RetError
(
window_get_extent
(
0
,
window
,
&
extent
));
scroll_changed
=
0
;
/* Find location of pointer */
if
((
x
<
state
.
visible_area
.
xmin
)
||
(
x
>
state
.
visible_area
.
xmax
)
||
(
y
<
state
.
visible_area
.
ymin
)
||
...
...
@@ -4348,63 +4348,60 @@ _kernel_oserror *hotlist_autoscroll(int window)
position
=
2
;
/* Inside scrolling region */
}
#ifdef TRACE
Printf
(
"Pointer is "
);
switch
(
position
)
{
case
0
:
Printf
(
"Outside visible area"
);
break
;
case
1
:
Printf
(
"inside non scrolling region"
);
break
;
case
2
:
Printf
(
"Inside scrolling region"
);
break
;
}
Printf
(
" of scrolling window
\n
"
);
Printf
(
"scrolling = %d
\n
"
,
scrolling
);
#endif
scroll_changed
=
0
;
if
(
!
scrolling
)
if
(
position
==
0
||
position
==
2
)
{
if
(
window
==
over_window
)
if
(
y
>
state
.
visible_area
.
ymax
-
HOTLIST_SCROLL_BOUNDARY_SIZE
)
{
if
(
position
==
2
)
/* Top */
if
(
state
.
yscroll
<
extent
.
ymax
)
{
/* Check timer, see if it's time to start scrolling */
RetError
(
_swix
(
OS_ReadMonotonicTime
,
_OUTR
(
0
,
0
),
&
autoscroll_newtime
));
if
((
autoscroll_newtime
-
autoscroll_oldtime
)
>
AUTOSCROLL_DELAY
)
{
if
(
mouse_shape
!=
Mouse_Shape_Scrolling
)
{
mouse_set_pointer_shape
(
Mouse_Shape_Scrolling
);
mouse_shape
=
Mouse_Shape_Scrolling
;
}
scrolling
=
1
;
}
else
scroll_changed
=
1
;
state
.
yscroll
+=
(
y
-
(
state
.
visible_area
.
ymax
-
HOTLIST_SCROLL_BOUNDARY_SIZE
));
}
}
else
{
if
(
y
<
state
.
visible_area
.
ymin
+
HOTLIST_SCROLL_BOUNDARY_SIZE
)
{
/* Bottom */
if
(
state
.
yscroll
>
extent
.
ymin
+
(
state
.
visible_area
.
ymax
-
state
.
visible_area
.
ymin
))
{
if
(
mouse_shape
!=
Mouse_Shape_ToScroll
)
{
mouse_shape
=
Mouse_Shape_ToScroll
;
mouse_set_pointer_shape
(
Mouse_Shape_ToScroll
);
}
scroll_changed
=
1
;
state
.
yscroll
-=
((
state
.
visible_area
.
ymin
+
HOTLIST_SCROLL_BOUNDARY_SIZE
)
-
y
);
}
}
else
}
if
(
x
>
state
.
visible_area
.
xmax
-
HOTLIST_SCROLL_BOUNDARY_SIZE
)
{
/* Right */
if
(
state
.
xscroll
<
extent
.
xmax
-
(
state
.
visible_area
.
xmax
-
state
.
visible_area
.
xmin
))
{
/* Set scroll timer to zero */
RetError
(
_swix
(
OS_ReadMonotonicTime
,
_OUTR
(
0
,
0
),
&
autoscroll_oldtime
));
if
(
mouse_shape
!=
Mouse_Shape_Normal
)
scroll_changed
=
1
;
state
.
xscroll
+=
(
x
-
(
state
.
visible_area
.
xmax
-
HOTLIST_SCROLL_BOUNDARY_SIZE
));
}
}
else
{
if
(
x
<
state
.
visible_area
.
xmin
+
HOTLIST_SCROLL_BOUNDARY_SIZE
)
{
/* Left */
if
(
state
.
xscroll
>
extent
.
xmin
)
{
mouse_set_pointer_shape
(
Mouse_Shape_Normal
)
;
mouse_shape
=
Mouse_Shape_Normal
;
scroll_changed
=
1
;
state
.
xscroll
-=
((
state
.
visible_area
.
xmin
+
HOTLIST_SCROLL_BOUNDARY_SIZE
)
-
x
)
;
}
}
}
else
}
switch
(
position
)
{
case
0
:
if
(
!
scrolling
)
{
RetError
(
_swix
(
OS_ReadMonotonicTime
,
_OUTR
(
0
,
0
),
&
autoscroll_oldtime
));
if
(
mouse_shape
!=
Mouse_Shape_Normal
)
...
...
@@ -4413,12 +4410,10 @@ _kernel_oserror *hotlist_autoscroll(int window)
mouse_shape
=
Mouse_Shape_Normal
;
}
}
}
else
{
if
(
position
==
1
)
break
;
case
1
:
{
/* Stop scrolling */
scrolling
=
0
;
RetError
(
_swix
(
OS_ReadMonotonicTime
,
_OUTR
(
0
,
0
),
&
autoscroll_oldtime
));
if
(
mouse_shape
!=
Mouse_Shape_Normal
)
...
...
@@ -4427,63 +4422,54 @@ _kernel_oserror *hotlist_autoscroll(int window)
mouse_shape
=
Mouse_Shape_Normal
;
}
}
else
{
/* Scroll a bit */
break
;
if
(
y
>
state
.
visible_area
.
ymax
-
HOTLIST_SCROLL_BOUNDARY_SIZE
)
case
2
:
if
((
!
scrolling
)
&&
scroll_changed
)
{
RetError
(
_swix
(
OS_ReadMonotonicTime
,
_OUTR
(
0
,
0
),
&
autoscroll_newtime
));
if
((
autoscroll_newtime
-
autoscroll_oldtime
)
>
AUTOSCROLL_DELAY
)
{
/* Top */
if
(
state
.
yscroll
<
extent
.
ymax
)
{
scroll_changed
=
1
;
state
.
yscroll
+=
(
y
-
(
state
.
visible_area
.
ymax
-
HOTLIST_SCROLL_BOUNDARY_SIZE
));
}
scrolling
=
1
;
}
else
{
if
(
y
<
state
.
visible_area
.
ymin
+
HOTLIST_SCROLL_BOUNDARY_SIZE
)
if
(
mouse_shape
!=
Mouse_Shape_ToScroll
)
{
/* Bottom */
if
(
state
.
yscroll
>
extent
.
ymin
+
(
state
.
visible_area
.
ymax
-
state
.
visible_area
.
ymin
))
{
scroll_changed
=
1
;
state
.
yscroll
-=
((
state
.
visible_area
.
ymin
+
HOTLIST_SCROLL_BOUNDARY_SIZE
)
-
y
);
}
mouse_shape
=
Mouse_Shape_ToScroll
;
mouse_set_pointer_shape
(
Mouse_Shape_ToScroll
);
}
}
}
if
(
!
scroll_changed
)
{
RetError
(
_swix
(
OS_ReadMonotonicTime
,
_OUTR
(
0
,
0
),
&
autoscroll_oldtime
));
}
break
;
}
if
(
x
>
state
.
visible_area
.
xmax
-
HOTLIST_SCROLL_BOUNDARY_SIZE
)
if
(
scrolling
)
{
if
(
scroll_changed
)
{
RetError
(
toolbox_get_parent
(
0
,
window
,
&
parent
,
&
component
));
RetError
(
toolbox_show_object
(
0
,
window
,
Toolbox_ShowObject_FullSpec
,
&
(
state
.
visible_area
),
parent
,
component
));
if
(
mouse_shape
!=
Mouse_Shape_Scrolling
)
{
/* Right */
if
(
state
.
xscroll
<
extent
.
xmax
-
(
state
.
visible_area
.
xmax
-
state
.
visible_area
.
xmin
))
{
scroll_changed
=
1
;
state
.
xscroll
+=
(
x
-
(
state
.
visible_area
.
xmax
-
HOTLIST_SCROLL_BOUNDARY_SIZE
));
}
mouse_shape
=
Mouse_Shape_Scrolling
;
mouse_set_pointer_shape
(
Mouse_Shape_Scrolling
);
}
else
}
else
{
if
(
mouse_shape
!=
Mouse_Shape_Normal
)
{
if
(
x
<
state
.
visible_area
.
xmin
+
HOTLIST_SCROLL_BOUNDARY_SIZE
)
{
/* Left */
if
(
state
.
xscroll
>
extent
.
xmin
)
{
scroll_changed
=
1
;
state
.
xscroll
-=
((
state
.
visible_area
.
xmin
+
HOTLIST_SCROLL_BOUNDARY_SIZE
)
-
x
);
}
}
mouse_shape
=
Mouse_Shape_Normal
;
mouse_set_pointer_shape
(
Mouse_Shape_Normal
);
}
}
}
if
(
scroll_changed
)
{
RetError
(
toolbox_get_parent
(
0
,
window
,
&
parent
,
&
component
));
RetError
(
toolbox_show_object
(
0
,
window
,
Toolbox_ShowObject_FullSpec
,
&
(
state
.
visible_area
),
parent
,
component
));
}
return
NULL
;
}
...
...
This diff is collapsed.
Click to expand it.
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment