|
1 /* |
|
2 * Copyright (c) 2002 Nokia Corporation and/or its subsidiary(-ies). |
|
3 * All rights reserved. |
|
4 * This component and the accompanying materials are made available |
|
5 * under the terms of "Eclipse Public License v1.0" |
|
6 * which accompanies this distribution, and is available |
|
7 * at the URL "http://www.eclipse.org/legal/epl-v10.html". |
|
8 * |
|
9 * Initial Contributors: |
|
10 * Nokia Corporation - initial contribution. |
|
11 * |
|
12 * Contributors: |
|
13 * |
|
14 * Description: Device specific constants for palette storage. |
|
15 * |
|
16 */ |
|
17 |
|
18 |
|
19 #ifndef __PALETTECONSTANTS_H__ |
|
20 #define __PALETTECONSTANTS_H__ |
|
21 |
|
22 /** |
|
23 * Palette switching support is not required in S60 3.x. |
|
24 * This switch disables palette switching. The code will be removed later. |
|
25 * You may ignore the rest of this header while this macro is defined. |
|
26 */ |
|
27 #define DISABLE_256_COLOR_PALETTE_SWITCHING |
|
28 |
|
29 #ifndef DISABLE_256_COLOR_PALETTE_SWITCHING |
|
30 /** |
|
31 * The palette code supports two modes of operation, configured with the feature flag |
|
32 * __PALETTE_INDEX_ADDRESS_FIXED. |
|
33 * |
|
34 * If the feature is defined (call it "fast" mode), |
|
35 * the palette index is stored in video memory and the video memory |
|
36 * address is hard coded. |
|
37 * |
|
38 * If the feature is undefined (call it "slow" mode) the palette index is stored in |
|
39 * video memory, but the video memory address is stored in TLS. |
|
40 * |
|
41 * This palette index is accessed a lot, so fast mode can have a positive |
|
42 * effect on performance. |
|
43 */ |
|
44 |
|
45 #ifdef __WINS__ |
|
46 // always turn __PALETTE_INDEX_ADDRESS_FIXED on in __WINS__ |
|
47 #undef __PALETTE_INDEX_ADDRESS_FIXED |
|
48 #define __PALETTE_INDEX_ADDRESS_FIXED |
|
49 #endif __WINS__ |
|
50 |
|
51 |
|
52 #ifdef __PALETTE_INDEX_ADDRESS_FIXED |
|
53 #ifndef __WINS__ |
|
54 |
|
55 /** |
|
56 * This is the base address of the video memory for the screen. |
|
57 * This value is only used if the macro __PALETTE_INDEX_ADDRESS_FIXED is defined and |
|
58 * __WINS__ macro is undefined. |
|
59 */ |
|
60 #include <lcdbaseaddress.h> |
|
61 #define DEVICE_VIDEO_ADDR KLCDBaseAddress |
|
62 |
|
63 |
|
64 /** |
|
65 * This is the maximum width of the screen. |
|
66 * This value is only used if the macro __PALETTE_INDEX_ADDRESS_FIXED is defined and |
|
67 * __WINS__ macro is undefined. |
|
68 * Otherwise, the width is retrieved from the screen driver. |
|
69 */ |
|
70 #define DEVICE_SCREEN_WIDTH 176 |
|
71 |
|
72 /** |
|
73 * This is the maximum height of the screen. |
|
74 * This value is only used if the macro __PALETTE_INDEX_ADDRESS_FIXED is defined and |
|
75 * __WINS__ macro is undefined. |
|
76 * Otherwise, the height is retrieved from the screen driver. |
|
77 */ |
|
78 #define DEVICE_SCREEN_HEIGHT 208 |
|
79 |
|
80 #endif |
|
81 #endif // __PALETTE_INDEX_ADDRESS_FIXED |
|
82 |
|
83 /** |
|
84 * The number of bytes used for each pixel of the screen. |
|
85 */ |
|
86 #define DEVICE_BYTES_PER_PIXEL 2 |
|
87 |
|
88 /** |
|
89 * The number of bytes of video memory reserved by the screen driver for other purposes. |
|
90 */ |
|
91 #define DEVICE_VIDEO_PALETTE_SIZE 32 |
|
92 |
|
93 #endif // DISABLE_256_COLOR_PALETTE_SWITCHING |
|
94 |
|
95 #endif // __PALETTECONSTANTS_H__ |
|
96 |
|
97 // End of File |