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