5 * Bitmap data and functions.
7 #ifndef __gammu_bitmap_h
8 #define __gammu_bitmap_h
11 * \defgroup Bitmap Bitmap
12 * Bitmaps manipulations.
15 #include <gammu-limits.h>
16 #include <gammu-types.h>
17 #include <gammu-error.h>
18 #include <gammu-statemachine.h>
22 * Binary picture types.
32 } GSM_BinaryPicture_Types
;
35 * Binary picture data.
40 GSM_BinaryPicture_Types Type
;
41 unsigned char *Buffer
;
46 * Enum to handle all possible bitmaps, which are not saved in various filesystems.
53 * ID of static file in filesystem displayed during startup
55 GSM_ColourStartupLogo_ID
,
57 * Static mono bitmap/ID of animated mono bitmap displayed during startup
61 * ID of static file in filesystem displayed instead of operator name
63 GSM_ColourOperatorLogo_ID
,
65 * Mono bitmap displayed instead of operator name
69 * ID of static file in filesystem displayed as wallpaper
71 GSM_ColourWallPaper_ID
,
73 * Mono bitmap assigned to caller group
77 * Text displayed during startup, which can't be removed from phone menu
81 * Text displayed during startup
85 * Image defined in Smart Messaging specification
89 * Binary picture (BMP, GIF, etc.)
95 * Structure for all possible bitmaps, which are not saved in various filesystems
101 * For all: bitmap type
103 GSM_Bitmap_Types Type
;
105 * For caller group logos: number of group
106 * For startup logos: number of animated bitmap
108 unsigned char Location
;
110 * For dealer/welcome note text: text
111 * For caller group logo: name of group
112 * For picture images: text assigned to it
114 unsigned char Text
[2 * (GSM_BITMAP_TEXT_LENGTH
+ 1)];
116 * For caller group logo: TRUE, when logo is enabled in group
118 gboolean BitmapEnabled
;
120 * For caller group logo: TRUE, when group has default name
122 gboolean DefaultName
;
124 * For caller group logo: TRUE, when group has default bitmap
126 gboolean DefaultBitmap
;
128 * For caller group logo: TRUE, when group has default ringtone
130 gboolean DefaultRingtone
;
132 * For caller group logo: ringtone ID. Phone model specific
134 unsigned char RingtoneID
;
135 gboolean FileSystemRingtone
;
137 * For caller group logo: picture ID. Phone model specific
140 gboolean FileSystemPicture
;
142 * For mono bitmaps: body of bitmap
144 unsigned char BitmapPoints
[GSM_BITMAP_SIZE
];
146 * For mono bitmaps: height specified in pixels
150 * For mono bitmaps: width specified in pixels
154 * For operator logos: Network operator code
158 * For picture images: number of sender
160 unsigned char Sender
[2 * (GSM_MAX_NUMBER_LENGTH
+ 1)];
162 * For colour bitmaps: ID
166 * For binary pictures (GIF, BMP, etc.): frame and length
168 GSM_BinaryPicture BinaryPic
;
172 unsigned char Name
[2 * (GSM_BITMAP_TEXT_LENGTH
+ 1)];
176 * Structure to handle more than one bitmap
184 unsigned char Number
;
188 GSM_Bitmap Bitmap
[GSM_MAX_MULTI_BITMAP
];
192 * Gets bitmap from phone.
196 GSM_Error
GSM_GetBitmap(GSM_StateMachine
* s
, GSM_Bitmap
* Bitmap
);
199 * Sets bitmap in phone.
203 GSM_Error
GSM_SetBitmap(GSM_StateMachine
* s
, GSM_Bitmap
* Bitmap
);
206 * Prints bitmap to file descriptor.
208 * \param file Where to print.
209 * \param bitmap Bitmap to print.
213 void GSM_PrintBitmap(FILE * file
, GSM_Bitmap
* bitmap
);
216 * Saves bitmap to file.
218 * \param FileName Where to save.
219 * \param bitmap Bitmap to save.
225 GSM_Error
GSM_SaveBitmapFile(char *FileName
, GSM_MultiBitmap
* bitmap
);
228 * Reads bitmap from file.
230 * \param FileName Where to load from.
231 * \param bitmap Pointer where to load bitmap.
237 GSM_Error
GSM_ReadBitmapFile(char *FileName
, GSM_MultiBitmap
* bitmap
);
240 * Checks whether point is set in bitmap.
243 * \param x Horizontal coordinate.
244 * \param y Vertical coordinate.
245 * \return True if point is set.
249 gboolean
GSM_IsPointBitmap(GSM_Bitmap
* bmp
, int x
, int y
);
252 * Sets point in bitmap.
255 * \param x Horizontal coordinate.
256 * \param y Vertical coordinate.
260 void GSM_SetPointBitmap(GSM_Bitmap
* bmp
, int x
, int y
);
263 * Clears point in bitmap.
266 * \param x Horizontal coordinate.
267 * \param y Vertical coordinate.
271 void GSM_ClearPointBitmap(GSM_Bitmap
* bmp
, int x
, int y
);
280 void GSM_ClearBitmap(GSM_Bitmap
* bmp
);
283 * Gets phone screenshot.
285 * \param s State machine pointer.
286 * \param picture Structure which will hold data.
290 GSM_Error
GSM_GetScreenshot(GSM_StateMachine
*s
, GSM_BinaryPicture
*picture
);
294 /* Editor configuration
295 * vim: noexpandtab sw=8 ts=8 sts=8 tw=72: