~ubuntu-branches/ubuntu/edgy/xbill/edgy

« back to all changes in this revision

Viewing changes to OS.c

  • Committer: Bazaar Package Importer
  • Author(s): Adrian Bridgett
  • Date: 2004-09-07 09:52:14 UTC
  • mfrom: (2.1.1 warty)
  • Revision ID: james.westby@ubuntu.com-20040907095214-d0m46ojc8f7upuqm
Tags: 2.1-4
maintainer upload of NMU - many thanks Tollef (closes: #268885) 

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
1
#include "types.h"
 
2
#include "util.h"
 
3
 
 
4
#include "OS.h"
 
5
#include "UI.h"
 
6
 
 
7
#define MIN_PC 6                /* OS >= MIN_PC means the OS is a PC OS */
 
8
 
 
9
static const char *osname[] = {"wingdows", "apple", "next", "sgi", "sun",
 
10
                               "palm", "os2", "bsd", "linux", "redhat", "hurd"};
 
11
#define NUM_OS (sizeof(osname) / sizeof(osname[0]))
 
12
 
 
13
static Picture *os[NUM_OS];             /* array of OS pictures*/
 
14
static MCursor *cursor[NUM_OS];         /* array of OS cursors (drag/drop) */
 
15
 
 
16
 
 
17
void
 
18
OS_load_pix() {
 
19
        unsigned int i;
 
20
        for (i = 0; i < NUM_OS; i++) {
 
21
                UI_load_picture(osname[i], 1, &os[i]);
 
22
                if (i != 0)
 
23
                        UI_load_cursor(osname[i], CURSOR_OWN_MASK, &cursor[i]);
 
24
        }
 
25
}
 
26
 
 
27
void
 
28
OS_draw(int index, int x, int y) {
 
29
        UI_draw(os[index], x, y);
 
30
}
 
31
 
 
32
int
 
33
OS_width() {
 
34
        return UI_picture_width(os[0]);
 
35
}
 
36
 
 
37
int
 
38
OS_height() {
 
39
        return UI_picture_height(os[0]);
 
40
}
 
41
 
 
42
void
 
43
OS_set_cursor(int index) {
 
44
        UI_set_cursor(cursor[index]);
 
45
}
 
46
 
 
47
int
 
48
OS_randpc() {
 
49
        return (RAND(MIN_PC, NUM_OS - 1));
 
50
}
 
51
 
 
52
int
 
53
OS_ispc(int index) {
 
54
        return (index >= MIN_PC);
 
55
}