Diffstat (limited to 'gammu/emb/common/service/gsmlogo.h') (more/less context) (ignore whitespace changes)
-rw-r--r-- | gammu/emb/common/service/gsmlogo.h | 28 |
1 files changed, 27 insertions, 1 deletions
diff --git a/gammu/emb/common/service/gsmlogo.h b/gammu/emb/common/service/gsmlogo.h index b1b579d..6c6e2d8 100644 --- a/gammu/emb/common/service/gsmlogo.h +++ b/gammu/emb/common/service/gsmlogo.h | |||
@@ -1,165 +1,191 @@ | |||
1 | /* (c) 2002-2004 by Marcin Wiacek */ | 1 | /* (c) 2002-2004 by Marcin Wiacek */ |
2 | 2 | ||
3 | #ifndef __gsm_bitmaps_h | 3 | #ifndef __gsm_bitmaps_h |
4 | #define __gsm_bitmaps_h | 4 | #define __gsm_bitmaps_h |
5 | 5 | ||
6 | #include "../gsmcomon.h" | 6 | #include "../gsmcomon.h" |
7 | 7 | ||
8 | typedef enum { | ||
9 | PICTURE_BMP = 1, | ||
10 | PICTURE_GIF, | ||
11 | PICTURE_JPG, | ||
12 | PICTURE_ICN, | ||
13 | PICTURE_PNG | ||
14 | } GSM_BinaryPicture_Types; | ||
15 | |||
16 | typedef struct { | ||
17 | GSM_BinaryPicture_Types Type; | ||
18 | unsigned char *Buffer; | ||
19 | int Length; | ||
20 | } GSM_BinaryPicture; | ||
21 | |||
8 | /** | 22 | /** |
9 | * Enum to handle all possible bitmaps, which are not saved in various filesystems. | 23 | * Enum to handle all possible bitmaps, which are not saved in various filesystems. |
10 | */ | 24 | */ |
11 | typedef enum { | 25 | typedef enum { |
12 | GSM_None = 1, | 26 | GSM_None = 1, |
13 | /** | 27 | /** |
14 | * ID of static file in filesystem displayed during startup | 28 | * ID of static file in filesystem displayed during startup |
15 | */ | 29 | */ |
16 | GSM_ColourStartupLogo_ID, | 30 | GSM_ColourStartupLogo_ID, |
17 | /** | 31 | /** |
18 | * Static mono bitmap/ID of animated mono bitmap displayed during startup | 32 | * Static mono bitmap/ID of animated mono bitmap displayed during startup |
19 | */ | 33 | */ |
20 | GSM_StartupLogo, | 34 | GSM_StartupLogo, |
21 | /** | 35 | /** |
22 | * ID of static file in filesystem displayed instead of operator name | 36 | * ID of static file in filesystem displayed instead of operator name |
23 | */ | 37 | */ |
24 | GSM_ColourOperatorLogo_ID, | 38 | GSM_ColourOperatorLogo_ID, |
25 | /** | 39 | /** |
26 | * Mono bitmap displayed instead of operator name | 40 | * Mono bitmap displayed instead of operator name |
27 | */ | 41 | */ |
28 | GSM_OperatorLogo, | 42 | GSM_OperatorLogo, |
29 | /** | 43 | /** |
30 | * ID of static file in filesystem displayed as wallpaper | 44 | * ID of static file in filesystem displayed as wallpaper |
31 | */ | 45 | */ |
32 | GSM_ColourWallPaper_ID, | 46 | GSM_ColourWallPaper_ID, |
33 | /** | 47 | /** |
34 | * Mono bitmap assigned to caller group | 48 | * Mono bitmap assigned to caller group |
35 | */ | 49 | */ |
36 | GSM_CallerGroupLogo, | 50 | GSM_CallerGroupLogo, |
37 | /** | 51 | /** |
38 | * Text displayed during startup, which can't be removed from phone menu | 52 | * Text displayed during startup, which can't be removed from phone menu |
39 | */ | 53 | */ |
40 | GSM_DealerNote_Text, | 54 | GSM_DealerNote_Text, |
41 | /** | 55 | /** |
42 | * Text displayed during startup | 56 | * Text displayed during startup |
43 | */ | 57 | */ |
44 | GSM_WelcomeNote_Text, | 58 | GSM_WelcomeNote_Text, |
45 | /** | 59 | /** |
46 | * Image defined in Smart Messaging specification | 60 | * Image defined in Smart Messaging specification |
47 | */ | 61 | */ |
48 | GSM_PictureImage | 62 | GSM_PictureImage, |
63 | /** | ||
64 | * Binary picture (BMP, GIF, etc.) | ||
65 | */ | ||
66 | GSM_PictureBinary | ||
49 | } GSM_Bitmap_Types; | 67 | } GSM_Bitmap_Types; |
50 | 68 | ||
51 | #define GSM_BITMAP_SIZE(65+7)/8*96 | 69 | #define GSM_BITMAP_SIZE(65+7)/8*96 |
52 | #define GSM_BITMAP_TEXT_LENGTH 128 | 70 | #define GSM_BITMAP_TEXT_LENGTH 128 |
53 | 71 | ||
54 | /** | 72 | /** |
55 | * Structure for all possible bitmaps, which are not saved in various filesystems | 73 | * Structure for all possible bitmaps, which are not saved in various filesystems |
56 | */ | 74 | */ |
57 | typedef struct { | 75 | typedef struct { |
58 | /** | 76 | /** |
59 | * For all: bitmap type | 77 | * For all: bitmap type |
60 | */ | 78 | */ |
61 | GSM_Bitmap_Types Type; | 79 | GSM_Bitmap_Types Type; |
62 | /** | 80 | /** |
63 | * For caller group logos: number of group | 81 | * For caller group logos: number of group |
64 | * For startup logos: number of animated bitmap | 82 | * For startup logos: number of animated bitmap |
65 | */ | 83 | */ |
66 | unsigned char Location; | 84 | unsigned char Location; |
67 | /** | 85 | /** |
68 | * For dealer/welcome note text: text | 86 | * For dealer/welcome note text: text |
69 | * For caller group logo: name of group | 87 | * For caller group logo: name of group |
70 | * For picture images: text assigned to it | 88 | * For picture images: text assigned to it |
71 | */ | 89 | */ |
72 | unsigned char Text[2 * (GSM_BITMAP_TEXT_LENGTH + 1)]; | 90 | unsigned char Text[2 * (GSM_BITMAP_TEXT_LENGTH + 1)]; |
73 | /** | 91 | /** |
74 | * For caller group logo: true, when logo is enabled in group | 92 | * For caller group logo: true, when logo is enabled in group |
75 | */ | 93 | */ |
76 | bool BitmapEnabled; | 94 | bool BitmapEnabled; |
77 | /** | 95 | /** |
78 | * For caller group logo: true, when group has default name | 96 | * For caller group logo: true, when group has default name |
79 | */ | 97 | */ |
80 | bool DefaultName; | 98 | bool DefaultName; |
81 | /** | 99 | /** |
82 | * For caller group logo: true, when group has default bitmap | 100 | * For caller group logo: true, when group has default bitmap |
83 | */ | 101 | */ |
84 | bool DefaultBitmap; | 102 | bool DefaultBitmap; |
85 | /** | 103 | /** |
86 | * For caller group logo: true, when group has default ringtone | 104 | * For caller group logo: true, when group has default ringtone |
87 | */ | 105 | */ |
88 | bool DefaultRingtone; | 106 | bool DefaultRingtone; |
89 | /** | 107 | /** |
90 | * For caller group logo: ringtone ID. Phone model specific | 108 | * For caller group logo: ringtone ID. Phone model specific |
91 | */ | 109 | */ |
92 | unsigned char RingtoneID; | 110 | unsigned char RingtoneID; |
93 | bool FileSystemRingtone; | 111 | bool FileSystemRingtone; |
94 | /** | 112 | /** |
95 | * For mono bitmaps: body of bitmap | 113 | * For mono bitmaps: body of bitmap |
96 | */ | 114 | */ |
97 | unsigned char BitmapPoints[GSM_BITMAP_SIZE]; | 115 | unsigned char BitmapPoints[GSM_BITMAP_SIZE]; |
98 | /** | 116 | /** |
99 | * For mono bitmaps: height specified in pixels | 117 | * For mono bitmaps: height specified in pixels |
100 | */ | 118 | */ |
101 | unsigned char BitmapHeight; | 119 | unsigned char BitmapHeight; |
102 | /** | 120 | /** |
103 | * For mono bitmaps: width specified in pixels | 121 | * For mono bitmaps: width specified in pixels |
104 | */ | 122 | */ |
105 | unsigned char BitmapWidth; | 123 | unsigned char BitmapWidth; |
106 | /** | 124 | /** |
107 | * For operator logos: Network operator code | 125 | * For operator logos: Network operator code |
108 | */ | 126 | */ |
109 | char NetworkCode[7]; | 127 | char NetworkCode[7]; |
110 | /** | 128 | /** |
111 | * For picture images: number of sender | 129 | * For picture images: number of sender |
112 | */ | 130 | */ |
113 | unsigned char Sender[2 * (GSM_MAX_NUMBER_LENGTH + 1)]; | 131 | unsigned char Sender[2 * (GSM_MAX_NUMBER_LENGTH + 1)]; |
114 | /** | 132 | /** |
115 | * For colour bitmaps: ID | 133 | * For colour bitmaps: ID |
116 | */ | 134 | */ |
117 | unsigned char ID; | 135 | unsigned char ID; |
136 | /** | ||
137 | * For binary pictures (GIF, BMP, etc.): frame and length | ||
138 | */ | ||
139 | GSM_BinaryPicture BinaryPic; | ||
140 | /** | ||
141 | * Bitmap name | ||
142 | */ | ||
143 | char *Name; | ||
118 | } GSM_Bitmap; | 144 | } GSM_Bitmap; |
119 | 145 | ||
120 | #define MAX_MULTI_BITMAP 6 | 146 | #define MAX_MULTI_BITMAP 6 |
121 | 147 | ||
122 | /** | 148 | /** |
123 | * Structure to handle more than one bitmap | 149 | * Structure to handle more than one bitmap |
124 | */ | 150 | */ |
125 | typedef struct { | 151 | typedef struct { |
126 | /** | 152 | /** |
127 | * Number of bitmaps | 153 | * Number of bitmaps |
128 | */ | 154 | */ |
129 | unsigned char Number; | 155 | unsigned char Number; |
130 | /** | 156 | /** |
131 | * All bitmaps | 157 | * All bitmaps |
132 | */ | 158 | */ |
133 | GSM_Bitmap Bitmap[MAX_MULTI_BITMAP]; | 159 | GSM_Bitmap Bitmap[MAX_MULTI_BITMAP]; |
134 | } GSM_MultiBitmap; | 160 | } GSM_MultiBitmap; |
135 | 161 | ||
136 | typedef enum { | 162 | typedef enum { |
137 | GSM_NokiaStartupLogo = 1,/*size 84*48*/ | 163 | GSM_NokiaStartupLogo = 1,/*size 84*48*/ |
138 | GSM_NokiaOperatorLogo, /*size 72*14*/ | 164 | GSM_NokiaOperatorLogo, /*size 72*14*/ |
139 | GSM_Nokia7110OperatorLogo,/*size 78*21*/ | 165 | GSM_Nokia7110OperatorLogo,/*size 78*21*/ |
140 | GSM_Nokia6510OperatorLogo,/*size 78*21*/ | 166 | GSM_Nokia6510OperatorLogo,/*size 78*21*/ |
141 | GSM_NokiaCallerLogo, /*size 72*14*/ | 167 | GSM_NokiaCallerLogo, /*size 72*14*/ |
142 | GSM_NokiaPictureImage, /*size 72*28*/ | 168 | GSM_NokiaPictureImage, /*size 72*28*/ |
143 | GSM_Nokia7110StartupLogo,/*size 96*65*/ | 169 | GSM_Nokia7110StartupLogo,/*size 96*65*/ |
144 | GSM_Nokia6210StartupLogo,/*size 96*60*/ | 170 | GSM_Nokia6210StartupLogo,/*size 96*60*/ |
145 | GSM_AlcatelBMMIPicture, | 171 | GSM_AlcatelBMMIPicture, |
146 | GSM_EMSSmallPicture, /*size 8* 8*/ | 172 | GSM_EMSSmallPicture, /*size 8* 8*/ |
147 | GSM_EMSMediumPicture, /*size 16*16*/ | 173 | GSM_EMSMediumPicture, /*size 16*16*/ |
148 | GSM_EMSBigPicture, /*size 32*32*/ | 174 | GSM_EMSBigPicture, /*size 32*32*/ |
149 | GSM_EMSVariablePicture | 175 | GSM_EMSVariablePicture |
150 | } GSM_Phone_Bitmap_Types; | 176 | } GSM_Phone_Bitmap_Types; |
151 | 177 | ||
152 | bool GSM_IsPointBitmap (GSM_Bitmap *bmp, int x, int y); | 178 | bool GSM_IsPointBitmap (GSM_Bitmap *bmp, int x, int y); |
153 | void GSM_SetPointBitmap (GSM_Bitmap *bmp, int x, int y); | 179 | void GSM_SetPointBitmap (GSM_Bitmap *bmp, int x, int y); |
154 | void GSM_ClearPointBitmap (GSM_Bitmap *bmp, int x, int y); | 180 | void GSM_ClearPointBitmap (GSM_Bitmap *bmp, int x, int y); |
155 | void GSM_ClearBitmap (GSM_Bitmap *bmp); | 181 | void GSM_ClearBitmap (GSM_Bitmap *bmp); |
156 | void GSM_ResizeBitmap (GSM_Bitmap *dest, GSM_Bitmap *src, int width, int height); | 182 | void GSM_ResizeBitmap (GSM_Bitmap *dest, GSM_Bitmap *src, int width, int height); |
157 | void GSM_ReverseBitmap (GSM_Bitmap *Bitmap); | 183 | void GSM_ReverseBitmap (GSM_Bitmap *Bitmap); |
158 | void GSM_GetMaxBitmapWidthHeight(GSM_Bitmap_Types Type, unsigned char *width, unsigned char *height); | 184 | void GSM_GetMaxBitmapWidthHeight(GSM_Bitmap_Types Type, unsigned char *width, unsigned char *height); |
159 | int GSM_GetBitmapSize (GSM_Bitmap *bmp); | 185 | int GSM_GetBitmapSize (GSM_Bitmap *bmp); |
160 | void GSM_PrintBitmap (FILE *file, GSM_Bitmap *bitmap); | 186 | void GSM_PrintBitmap (FILE *file, GSM_Bitmap *bitmap); |
161 | 187 | ||
162 | GSM_Error GSM_SaveBitmapFile(char *FileName, GSM_MultiBitmap *bitmap); | 188 | GSM_Error GSM_SaveBitmapFile(char *FileName, GSM_MultiBitmap *bitmap); |
163 | GSM_Error GSM_ReadBitmapFile(char *FileName, GSM_MultiBitmap *bitmap); | 189 | GSM_Error GSM_ReadBitmapFile(char *FileName, GSM_MultiBitmap *bitmap); |
164 | 190 | ||
165 | GSM_Error BMP2Bitmap (unsigned char *buffer, FILE *file,GSM_Bitmap *bitmap); | 191 | GSM_Error BMP2Bitmap (unsigned char *buffer, FILE *file,GSM_Bitmap *bitmap); |