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
Changes
1
Show 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
(
position
==
2
)
{
/* 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
(
y
>
state
.
visible_area
.
ymax
-
HOTLIST_SCROLL_BOUNDARY_SIZE
)
{
if
(
mouse_shape
!=
Mouse_Shape_Scrolling
)
/* Top */
if
(
state
.
yscroll
<
extent
.
ymax
)
{
mouse_set_pointer_shape
(
Mouse_Shape_Scrolling
)
;
mouse_shape
=
Mouse_Shape_Scrolling
;
scroll_changed
=
1
;
state
.
yscroll
+=
(
y
-
(
state
.
visible_area
.
ymax
-
HOTLIST_SCROLL_BOUNDARY_SIZE
))
;
}
scrolling
=
1
;
}
else
{
if
(
mouse_shape
!=
Mouse_Shape_ToScroll
)
if
(
y
<
state
.
visible_area
.
ymin
+
HOTLIST_SCROLL_BOUNDARY_SIZE
)
{
mouse_shape
=
Mouse_Shape_ToScroll
;
mouse_set_pointer_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
);
}
}
}
if
(
x
>
state
.
visible_area
.
xmax
-
HOTLIST_SCROLL_BOUNDARY_SIZE
)
{
/* 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
));
}
}
else
{
/* Set scroll timer to zero */
RetError
(
_swix
(
OS_ReadMonotonicTime
,
_OUTR
(
0
,
0
),
&
autoscroll_oldtime
));
if
(
mouse_shape
!=
Mouse_Shape_Normal
)
if
(
x
<
state
.
visible_area
.
xmin
+
HOTLIST_SCROLL_BOUNDARY_SIZE
)
{
mouse_set_pointer_shape
(
Mouse_Shape_Normal
);
mouse_shape
=
Mouse_Shape_Normal
;
/* Left */
if
(
state
.
xscroll
>
extent
.
xmin
)
{
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,61 +4422,52 @@ _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
)
{
/* Top */
if
(
state
.
yscroll
<
extent
.
ymax
)
RetError
(
_swix
(
OS_ReadMonotonicTime
,
_OUTR
(
0
,
0
),
&
autoscroll_newtime
));
if
(
(
autoscroll_newtime
-
autoscroll_oldtime
)
>
AUTOSCROLL_DELAY
)
{
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
)
{
/* Bottom */
if
(
state
.
yscroll
>
extent
.
ymin
+
(
state
.
visible_area
.
ymax
-
state
.
visible_area
.
ymin
))
if
(
mouse_shape
!=
Mouse_Shape_ToScroll
)
{
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
(
x
>
state
.
visible_area
.
xmax
-
HOTLIST_SCROLL_BOUNDARY_SIZE
)
if
(
!
scroll_changed
)
{
/* 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
));
RetError
(
_swix
(
OS_ReadMonotonicTime
,
_OUTR
(
0
,
0
),
&
autoscroll_oldtime
));
}
break
;
}
else
if
(
scrolling
)
{
if
(
x
<
state
.
visible_area
.
xmin
+
HOTLIST_SCROLL_BOUNDARY_SIZE
)
if
(
scroll_changed
)
{
/* Left */
if
(
state
.
xscroll
>
extent
.
xmin
)
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
)
{
scroll_changed
=
1
;
state
.
xscroll
-=
((
state
.
visible_area
.
xmin
+
HOTLIST_SCROLL_BOUNDARY_SIZE
)
-
x
);
}
mouse_shape
=
Mouse_Shape_Scrolling
;
mouse_set_pointer_shape
(
Mouse_Shape_Scrolling
);
}
}
else
{
if
(
mouse_shape
!=
Mouse_Shape_Normal
)
{
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