]>
git.saurik.com Git - apple/boot.git/blob - i386/boot2/old/scrollbar.c
31d659eeee93ce5dad3dd842396e1ab6e7655ca3
2 * Copyright (c) 1999 Apple Computer, Inc. All rights reserved.
4 * @APPLE_LICENSE_HEADER_START@
6 * Portions Copyright (c) 1999 Apple Computer, Inc. All Rights
7 * Reserved. This file contains Original Code and/or Modifications of
8 * Original Code as defined in and that are subject to the Apple Public
9 * Source License Version 1.1 (the "License"). You may not use this file
10 * except in compliance with the License. Please obtain a copy of the
11 * License at http://www.apple.com/publicsource and read it before using
14 * The Original Code and all software distributed under the License are
15 * distributed on an "AS IS" basis, WITHOUT WARRANTY OF ANY KIND, EITHER
16 * EXPRESS OR IMPLIED, AND APPLE HEREBY DISCLAIMS ALL SUCH WARRANTIES,
17 * INCLUDING WITHOUT LIMITATION, ANY WARRANTIES OF MERCHANTABILITY,
18 * FITNESS FOR A PARTICULAR PURPOSE OR NON- INFRINGEMENT. Please see the
19 * License for the specific language governing rights and limitations
22 * @APPLE_LICENSE_HEADER_END@
25 * Copyright 1993 NeXT, Inc.
26 * All rights reserved.
36 scroll_t
*initScrollbar(
42 int position
, /* 0 - 100 */
43 int percent
/* 0 - 100 */
50 sp
->position
= position
;
51 sp
->percent
= percent
;
56 void destroyScrollbar(
60 (void)zfree((char *)sp
);
68 clearRect(sp
->loc
.x
, sp
->loc
.y
, sp
->loc
.w
, sp
->loc
.h
, SB_BG
);
69 // clearRect(sp->loc.x, sp->loc.y, sp->loc.w, 1, COLOR_BLACK);
70 // clearRect(sp->loc.x, sp->loc.y + sp->loc.h - 1, sp->loc.w, 1, COLOR_BLACK);
71 // clearRect(sp->loc.x, sp->loc.y, 1, sp->loc.h, COLOR_BLACK);
72 clearRect(sp
->loc
.x
+ sp
->loc
.w
- 1, sp
->loc
.y
, 1, sp
->loc
.h
, COLOR_BLACK
);
73 if (sp
->percent
< 100)
74 popupBox(sp
->loc
.x
+ SB_MARGIN
,
75 sp
->loc
.y
+ (sp
->position
* (sp
->loc
.h
- 2 * SB_MARGIN
)) / 100,
76 sp
->loc
.w
- 3 * SB_MARGIN
,
77 (sp
->loc
.h
- 2 * SB_MARGIN
) * sp
->percent
/ 100,
87 clearRect(sp
->loc
.x
, sp
->loc
.y
, sp
->loc
.w
, sp
->loc
.h
, color
);