Gammu internals
1.38.0
|
#include <string.h>
#include <stdlib.h>
#include <sys/stat.h>
#include <gammu-debug.h>
#include "../misc/coding/coding.h"
#include "../debug.h"
#include "gsmlogo.h"
#include "gsmnet.h"
#include "../../helper/string.h"
Go to the source code of this file.
Macros | |
#define | _GNU_SOURCE |
#define | chk_fwrite(data, size, count, file) if (fwrite(data, size, count, file) != count) goto fail; |
Functions | |
void | PHONE_GetBitmapWidthHeight (GSM_Phone_Bitmap_Types Type, size_t *width, size_t *height) |
size_t | PHONE_GetBitmapSize (GSM_Phone_Bitmap_Types Type, size_t Width, size_t Height) |
static gboolean | PHONE_IsPointBitmap (GSM_Phone_Bitmap_Types Type, char *buffer, int x, int y, int width, int height) |
static void | PHONE_SetPointBitmap (GSM_Phone_Bitmap_Types Type, char *buffer, int x, int y, int width, int height) |
void | PHONE_DecodeBitmap (GSM_Phone_Bitmap_Types Type, char *buffer, GSM_Bitmap *Bitmap) |
void | PHONE_ClearBitmap (GSM_Phone_Bitmap_Types Type, char *buffer, size_t width, size_t height) |
void | PHONE_EncodeBitmap (GSM_Phone_Bitmap_Types Type, char *buffer, GSM_Bitmap *Bitmap) |
void | GSM_GetMaxBitmapWidthHeight (GSM_Bitmap_Types Type, size_t *width, size_t *height) |
void | GSM_SetPointBitmap (GSM_Bitmap *bmp, int x, int y) |
void | GSM_ClearPointBitmap (GSM_Bitmap *bmp, int x, int y) |
gboolean | GSM_IsPointBitmap (GSM_Bitmap *bmp, int x, int y) |
void | GSM_ClearBitmap (GSM_Bitmap *bmp) |
size_t | GSM_GetBitmapSize (GSM_Bitmap *bmp) |
void | GSM_PrintBitmap (FILE *file, GSM_Bitmap *bitmap) |
void | GSM_ReverseBitmap (GSM_Bitmap *Bitmap) |
void | GSM_ResizeBitmap (GSM_Bitmap *dest, GSM_Bitmap *src, size_t width, size_t height) |
GSM_Error | Bitmap2BMP (unsigned char *buffer, FILE *file, GSM_Bitmap *bitmap) |
static GSM_Error | savebmp (FILE *file, GSM_MultiBitmap *bitmap) |
static GSM_Error | PrivSaveNLMWBMP (FILE *file, GSM_Bitmap *Bitmap) |
static GSM_Error | savenlm (FILE *file, GSM_MultiBitmap *bitmap) |
static GSM_Error | PrivSaveNGGNOL (FILE *file, GSM_MultiBitmap *bitmap) |
static GSM_Error | savengg (FILE *file, GSM_MultiBitmap *bitmap) |
static GSM_Error | savenol (FILE *file, GSM_MultiBitmap *bitmap) |
static GSM_Error | savexpm (FILE *file, GSM_MultiBitmap *bitmap) |
static GSM_Error | savensl (FILE *file, GSM_MultiBitmap *bitmap) |
static GSM_Error | savewbmp (FILE *file, GSM_MultiBitmap *bitmap) |
GSM_Error | GSM_SaveBitmapFile (char *FileName, GSM_MultiBitmap *bitmap) |
GSM_Error | BMP2Bitmap (unsigned char *buffer, FILE *file, GSM_Bitmap *bitmap) |
static GSM_Error | loadbmp (FILE *file, GSM_MultiBitmap *bitmap) |
static GSM_Error | loadnlm (FILE *file, GSM_MultiBitmap *bitmap) |
static GSM_Error | loadnolngg (FILE *file, GSM_MultiBitmap *bitmap, gboolean nolformat) |
static GSM_Error | loadnsl (FILE *file, GSM_MultiBitmap *bitmap) |
static GSM_Error | loadwbmp (FILE *file, GSM_MultiBitmap *bitmap) |
static GSM_Error | loadgif (FILE *file, GSM_MultiBitmap *bitmap) |
GSM_Error | GSM_ReadBitmapFile (char *FileName, GSM_MultiBitmap *bitmap) |
void | NOKIA_CopyBitmap (GSM_Phone_Bitmap_Types Type, GSM_Bitmap *Bitmap, char *Buffer, size_t *Length) |
#define chk_fwrite | ( | data, | |
size, | |||
count, | |||
file | |||
) | if (fwrite(data, size, count, file) != count) goto fail; |
Helper define to check error code from fwrite.
Definition at line 20 of file gsmlogo.c.
Referenced by Bitmap2BMP(), PrivSaveNGGNOL(), PrivSaveNLMWBMP(), savengg(), savenlm(), savenol(), savensl(), and savewbmp().
GSM_Error Bitmap2BMP | ( | unsigned char * | buffer, |
FILE * | file, | ||
GSM_Bitmap * | bitmap | ||
) |
Definition at line 321 of file gsmlogo.c.
References GSM_Bitmap::BitmapHeight, GSM_Bitmap::BitmapWidth, chk_fwrite, dbgprintf, ERR_NONE, ERR_WRITING_FILE, FALSE, GSM_IsPointBitmap(), and TRUE.
Referenced by savebmp().
GSM_Error BMP2Bitmap | ( | unsigned char * | buffer, |
FILE * | file, | ||
GSM_Bitmap * | bitmap | ||
) |
Definition at line 705 of file gsmlogo.c.
References GSM_Bitmap::BitmapHeight, GSM_Bitmap::BitmapWidth, dbgprintf, ERR_FILENOTSUPPORTED, ERR_NONE, FALSE, GSM_ClearBitmap(), GSM_GetMaxBitmapWidthHeight(), GSM_None, GSM_SetPointBitmap(), GSM_StartupLogo, TRUE, and GSM_Bitmap::Type.
Referenced by loadbmp().
size_t GSM_GetBitmapSize | ( | GSM_Bitmap * | bmp | ) |
Definition at line 252 of file gsmlogo.c.
References GSM_Bitmap::BitmapHeight, and GSM_Bitmap::BitmapWidth.
Referenced by GSM_ClearBitmap().
void GSM_GetMaxBitmapWidthHeight | ( | GSM_Bitmap_Types | Type, |
size_t * | width, | ||
size_t * | height | ||
) |
Definition at line 217 of file gsmlogo.c.
References GSM_CallerGroupLogo, GSM_OperatorLogo, GSM_PictureImage, and GSM_StartupLogo.
Referenced by BMP2Bitmap(), loadnlm(), and loadnolngg().
void GSM_ResizeBitmap | ( | GSM_Bitmap * | dest, |
GSM_Bitmap * | src, | ||
size_t | width, | ||
size_t | height | ||
) |
Definition at line 288 of file gsmlogo.c.
References GSM_Bitmap::BitmapHeight, GSM_Bitmap::BitmapWidth, GSM_ClearBitmap(), GSM_IsPointBitmap(), and GSM_SetPointBitmap().
Referenced by GSM_EncodeEMSMultiPartSMS(), and PHONE_EncodeBitmap().
void GSM_ReverseBitmap | ( | GSM_Bitmap * | Bitmap | ) |
Definition at line 273 of file gsmlogo.c.
References GSM_Bitmap::BitmapHeight, GSM_Bitmap::BitmapWidth, GSM_ClearPointBitmap(), GSM_IsPointBitmap(), and GSM_SetPointBitmap().
Referenced by loadwbmp().
|
static |
Definition at line 853 of file gsmlogo.c.
References GSM_MultiBitmap::Bitmap, BMP2Bitmap(), and GSM_MultiBitmap::Number.
Referenced by GSM_ReadBitmapFile().
|
static |
Definition at line 1045 of file gsmlogo.c.
References GSM_Bitmap::BinaryPic, GSM_MultiBitmap::Bitmap, GSM_Bitmap::BitmapHeight, GSM_Bitmap::BitmapWidth, GSM_BinaryPicture::Buffer, dbgprintf, DecodeUnicodeString(), ERR_FILENOTSUPPORTED, ERR_MOREMEMORY, ERR_NONE, GSM_PictureBinary, GSM_BinaryPicture::Length, GSM_Bitmap::Name, GSM_MultiBitmap::Number, PICTURE_GIF, GSM_BinaryPicture::Type, and GSM_Bitmap::Type.
Referenced by GSM_ReadBitmapFile().
|
static |
Definition at line 862 of file gsmlogo.c.
References GSM_MultiBitmap::Bitmap, GSM_Bitmap::BitmapHeight, GSM_Bitmap::BitmapWidth, dbgprintf, ERR_FILENOTSUPPORTED, ERR_NONE, ERR_UNKNOWN, GSM_CallerGroupLogo, GSM_ClearBitmap(), GSM_GetMaxBitmapWidthHeight(), GSM_MAX_MULTI_BITMAP, GSM_None, GSM_OperatorLogo, GSM_PictureImage, GSM_SetPointBitmap(), GSM_StartupLogo, GSM_MultiBitmap::Number, and GSM_Bitmap::Type.
Referenced by GSM_ReadBitmapFile().
|
static |
Definition at line 933 of file gsmlogo.c.
References GSM_MultiBitmap::Bitmap, GSM_Bitmap::BitmapHeight, GSM_Bitmap::BitmapWidth, dbgprintf, ERR_FILENOTSUPPORTED, ERR_NONE, GSM_CallerGroupLogo, GSM_ClearBitmap(), GSM_GetMaxBitmapWidthHeight(), GSM_None, GSM_OperatorLogo, GSM_SetPointBitmap(), GSM_Bitmap::NetworkCode, GSM_MultiBitmap::Number, and GSM_Bitmap::Type.
Referenced by GSM_ReadBitmapFile().
|
static |
Definition at line 987 of file gsmlogo.c.
References GSM_MultiBitmap::Bitmap, GSM_Bitmap::BitmapHeight, GSM_Bitmap::BitmapWidth, dbgprintf, ERR_FILENOTSUPPORTED, ERR_NONE, GSM_NokiaStartupLogo, GSM_None, GSM_MultiBitmap::Number, PHONE_DecodeBitmap(), and GSM_Bitmap::Type.
Referenced by GSM_ReadBitmapFile().
|
static |
Definition at line 1026 of file gsmlogo.c.
References GSM_MultiBitmap::Bitmap, GSM_Bitmap::BitmapHeight, GSM_Bitmap::BitmapWidth, ERR_FILENOTSUPPORTED, ERR_NONE, GSM_Nokia7110OperatorLogo, GSM_ReverseBitmap(), GSM_MultiBitmap::Number, and PHONE_DecodeBitmap().
Referenced by GSM_ReadBitmapFile().
void NOKIA_CopyBitmap | ( | GSM_Phone_Bitmap_Types | Type, |
GSM_Bitmap * | Bitmap, | ||
char * | Buffer, | ||
size_t * | Length | ||
) |
Definition at line 1132 of file gsmlogo.c.
References PHONE_EncodeBitmap(), PHONE_GetBitmapSize(), and PHONE_GetBitmapWidthHeight().
Referenced by GSM_EncodeMultiPartSMS(), and GSM_EncodeSMS30MultiPartSMS().
void PHONE_ClearBitmap | ( | GSM_Phone_Bitmap_Types | Type, |
char * | buffer, | ||
size_t | width, | ||
size_t | height | ||
) |
Definition at line 192 of file gsmlogo.c.
References PHONE_GetBitmapSize().
Referenced by PHONE_EncodeBitmap().
void PHONE_DecodeBitmap | ( | GSM_Phone_Bitmap_Types | Type, |
char * | buffer, | ||
GSM_Bitmap * | Bitmap | ||
) |
Definition at line 141 of file gsmlogo.c.
References GSM_Bitmap::BitmapEnabled, GSM_Bitmap::BitmapHeight, GSM_Bitmap::BitmapWidth, GSM_Bitmap::DefaultBitmap, GSM_Bitmap::DefaultName, GSM_Bitmap::DefaultRingtone, FALSE, GSM_Bitmap::FileSystemPicture, GSM_AlcatelBMMIPicture, GSM_CallerGroupLogo, GSM_ClearBitmap(), GSM_EMSBigPicture, GSM_EMSMediumPicture, GSM_EMSSmallPicture, GSM_EMSVariablePicture, GSM_Nokia6210StartupLogo, GSM_Nokia6510OperatorLogo, GSM_Nokia7110OperatorLogo, GSM_Nokia7110StartupLogo, GSM_NokiaCallerLogo, GSM_NokiaOperatorLogo, GSM_NokiaPictureImage, GSM_NokiaStartupLogo, GSM_OperatorLogo, GSM_PictureImage, GSM_SetPointBitmap(), GSM_StartupLogo, GSM_Bitmap::ID, GSM_Bitmap::Location, GSM_Bitmap::Name, GSM_Bitmap::NetworkCode, PHONE_GetBitmapWidthHeight(), PHONE_IsPointBitmap(), GSM_Bitmap::RingtoneID, GSM_Bitmap::Sender, GSM_Bitmap::Text, and GSM_Bitmap::Type.
Referenced by GSM_DecodeEMSMultiPartSMS(), GSM_DecodeMultiPartSMS(), GSM_DecodeNokiaProfile(), loadnsl(), loadwbmp(), and N71_65_DecodePhonebook().
void PHONE_EncodeBitmap | ( | GSM_Phone_Bitmap_Types | Type, |
char * | buffer, | ||
GSM_Bitmap * | Bitmap | ||
) |
Definition at line 197 of file gsmlogo.c.
References GSM_Bitmap::BitmapHeight, GSM_Bitmap::BitmapWidth, GSM_IsPointBitmap(), GSM_ResizeBitmap(), PHONE_ClearBitmap(), PHONE_GetBitmapWidthHeight(), and PHONE_SetPointBitmap().
Referenced by GSM_EncodeEMSMultiPartSMS(), GSM_EncodeMultiPartSMS(), NOKIA_CopyBitmap(), and savensl().
size_t PHONE_GetBitmapSize | ( | GSM_Phone_Bitmap_Types | Type, |
size_t | Width, | ||
size_t | Height | ||
) |
Definition at line 44 of file gsmlogo.c.
References GSM_AlcatelBMMIPicture, GSM_EMSBigPicture, GSM_EMSMediumPicture, GSM_EMSSmallPicture, GSM_EMSVariablePicture, GSM_Nokia6210StartupLogo, GSM_Nokia6510OperatorLogo, GSM_Nokia7110OperatorLogo, GSM_Nokia7110StartupLogo, GSM_NokiaCallerLogo, GSM_NokiaOperatorLogo, GSM_NokiaPictureImage, GSM_NokiaStartupLogo, and PHONE_GetBitmapWidthHeight().
Referenced by GSM_DecodeEMSMultiPartSMS(), GSM_EncodeEMSMultiPartSMS(), GSM_EncodeMultiPartSMS(), NOKIA_CopyBitmap(), PHONE_ClearBitmap(), and savensl().
void PHONE_GetBitmapWidthHeight | ( | GSM_Phone_Bitmap_Types | Type, |
size_t * | width, | ||
size_t * | height | ||
) |
Definition at line 23 of file gsmlogo.c.
References GSM_AlcatelBMMIPicture, GSM_EMSBigPicture, GSM_EMSMediumPicture, GSM_EMSSmallPicture, GSM_EMSVariablePicture, GSM_Nokia6210StartupLogo, GSM_Nokia6510OperatorLogo, GSM_Nokia7110OperatorLogo, GSM_Nokia7110StartupLogo, GSM_NokiaCallerLogo, GSM_NokiaOperatorLogo, GSM_NokiaPictureImage, and GSM_NokiaStartupLogo.
Referenced by GSM_EncodeEMSMultiPartSMS(), NOKIA_CopyBitmap(), PHONE_DecodeBitmap(), PHONE_EncodeBitmap(), and PHONE_GetBitmapSize().
|
static |
Definition at line 77 of file gsmlogo.c.
References FALSE, GSM_AlcatelBMMIPicture, GSM_EMSBigPicture, GSM_EMSMediumPicture, GSM_EMSSmallPicture, GSM_EMSVariablePicture, GSM_Nokia6210StartupLogo, GSM_Nokia6510OperatorLogo, GSM_Nokia7110OperatorLogo, GSM_Nokia7110StartupLogo, GSM_NokiaCallerLogo, GSM_NokiaOperatorLogo, GSM_NokiaPictureImage, GSM_NokiaStartupLogo, and TRUE.
Referenced by PHONE_DecodeBitmap().
|
static |
Definition at line 109 of file gsmlogo.c.
References GSM_AlcatelBMMIPicture, GSM_EMSBigPicture, GSM_EMSMediumPicture, GSM_EMSSmallPicture, GSM_EMSVariablePicture, GSM_Nokia6210StartupLogo, GSM_Nokia6510OperatorLogo, GSM_Nokia7110OperatorLogo, GSM_Nokia7110StartupLogo, GSM_NokiaCallerLogo, GSM_NokiaOperatorLogo, GSM_NokiaPictureImage, and GSM_NokiaStartupLogo.
Referenced by PHONE_EncodeBitmap().
|
static |
Definition at line 530 of file gsmlogo.c.
References GSM_MultiBitmap::Bitmap, GSM_Bitmap::BitmapHeight, GSM_Bitmap::BitmapWidth, chk_fwrite, ERR_MOREMEMORY, ERR_NONE, ERR_WRITING_FILE, and GSM_IsPointBitmap().
|
static |
Definition at line 463 of file gsmlogo.c.
References GSM_Bitmap::BitmapHeight, GSM_Bitmap::BitmapWidth, chk_fwrite, ERR_NONE, ERR_WRITING_FILE, and GSM_IsPointBitmap().
Referenced by savenlm(), and savewbmp().
|
static |
Definition at line 455 of file gsmlogo.c.
References GSM_MultiBitmap::Bitmap, and Bitmap2BMP().
Referenced by GSM_SaveBitmapFile().
|
static |
Definition at line 560 of file gsmlogo.c.
References GSM_MultiBitmap::Bitmap, GSM_Bitmap::BitmapHeight, GSM_Bitmap::BitmapWidth, chk_fwrite, ERR_WRITING_FILE, and PrivSaveNGGNOL().
Referenced by GSM_SaveBitmapFile().
|
static |
Definition at line 493 of file gsmlogo.c.
References GSM_MultiBitmap::Bitmap, GSM_Bitmap::BitmapHeight, GSM_Bitmap::BitmapWidth, chk_fwrite, ERR_NONE, ERR_UNKNOWN, ERR_WRITING_FILE, GSM_CallerGroupLogo, GSM_OperatorLogo, GSM_PictureImage, GSM_StartupLogo, GSM_MultiBitmap::Number, PrivSaveNLMWBMP(), and GSM_Bitmap::Type.
Referenced by GSM_SaveBitmapFile().
|
static |
Definition at line 581 of file gsmlogo.c.
References GSM_MultiBitmap::Bitmap, GSM_Bitmap::BitmapHeight, GSM_Bitmap::BitmapWidth, chk_fwrite, ERR_WRITING_FILE, GSM_OperatorLogo, GSM_Bitmap::NetworkCode, PrivSaveNGGNOL(), and GSM_Bitmap::Type.
Referenced by GSM_SaveBitmapFile().
|
static |
Definition at line 644 of file gsmlogo.c.
References GSM_MultiBitmap::Bitmap, chk_fwrite, ERR_NONE, ERR_WRITING_FILE, GSM_BITMAP_SIZE, GSM_NokiaStartupLogo, PHONE_EncodeBitmap(), and PHONE_GetBitmapSize().
Referenced by GSM_SaveBitmapFile().
|
static |
Definition at line 660 of file gsmlogo.c.
References GSM_MultiBitmap::Bitmap, GSM_Bitmap::BitmapHeight, GSM_Bitmap::BitmapWidth, chk_fwrite, ERR_WRITING_FILE, and PrivSaveNLMWBMP().
Referenced by GSM_SaveBitmapFile().
|
static |
Definition at line 613 of file gsmlogo.c.
References GSM_MultiBitmap::Bitmap, GSM_Bitmap::BitmapHeight, GSM_Bitmap::BitmapWidth, ERR_NONE, and GSM_IsPointBitmap().
Referenced by GSM_SaveBitmapFile().