Source code of Windows XP (NT5)
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

84 lines
3.0 KiB

  1. /*++
  2. * File name:
  3. * bmpdb.h
  4. * Contents:
  5. * bmpdb structures
  6. *
  7. * Copyright (C) 1998-1999 Microsoft Corp.
  8. --*/
  9. #define MAX_STRING_LENGTH 128
  10. typedef long FOFFSET;
  11. typedef struct _BMPENTRY {
  12. UINT nDataSize; // Total size of pData (bmpSize+bmiSize)
  13. UINT bmpSize; // Size of bits. Located at pData
  14. // After BITMAPINFO (if any)
  15. UINT bmiSize; // Size of BITMAPINFO header
  16. // if zero -> monocrome bitmap
  17. // BITMAPINFO is located in begining of
  18. // pData
  19. UINT xSize, ySize;
  20. UINT nChkSum;
  21. BOOL bDeleted; // Valuable in DB
  22. char szComment[MAX_STRING_LENGTH];
  23. HBITMAP hBitmap; // Valuable in linked list
  24. FOFFSET FOffsMe; // My pointer in DB
  25. FOFFSET FOffsNext; // DB
  26. struct _BMPENTRY *pNext; // linked list
  27. PVOID pData; // Pointer to BMP data, in DB it is
  28. // immediatly after this structure
  29. } BMPENTRY, *PBMPENTRY;
  30. typedef struct _GROUPENTRY {
  31. WCHAR WText[MAX_STRING_LENGTH];
  32. BOOL bDeleted;
  33. FOFFSET FOffsMe; // My pointer in DB
  34. FOFFSET FOffsBmp; // DB
  35. PBMPENTRY pBitmap; // linked list
  36. FOFFSET FOffsNext; // DB
  37. struct _GROUPENTRY *pNext; // linked list
  38. } GROUPENTRY, *PGROUPENTRY;
  39. typedef BOOL (_cdecl *PFNENUMGROUPS)(FOFFSET nOff,
  40. PGROUPENTRY pGroup,
  41. PVOID pParam);
  42. typedef BOOL (_cdecl *PFNENUMBITMAPS)(FOFFSET nOff,
  43. PBMPENTRY pBitmap,
  44. PVOID pParam);
  45. BOOL OpenDB(BOOL bWrite);
  46. VOID CloseDB(VOID);
  47. BOOL ReadGroup(FOFFSET nOffset, PGROUPENTRY pGroup);
  48. BOOL WriteGroup(FOFFSET nOffset, PGROUPENTRY pGroup);
  49. VOID EnumerateGroups(PFNENUMGROUPS pfnEnumGrpProc, PVOID pParam);
  50. BOOL ReadBitmapHeader(FOFFSET nOffset, PBMPENTRY pBitmap);
  51. BOOL WriteBitmapHeader(FOFFSET nOffset, PBMPENTRY pBitmap);
  52. PBMPENTRY ReadBitmap(FOFFSET nOffset);
  53. VOID FreeBitmap(PBMPENTRY pBmp);
  54. VOID EnumerateBitmaps(FOFFSET nOffset,
  55. PFNENUMBITMAPS pfnEnumProc,
  56. PVOID pParam);
  57. FOFFSET FindGroup(LPWSTR szWText);
  58. FOFFSET FindBitmap(LPWSTR szWText, char *szComment);
  59. UINT CheckSum(PVOID pData, UINT nLen);
  60. BOOL AddBitMap(PBMPENTRY pBitmap, LPCWSTR szWText);
  61. BOOL AddBitMapA(PBMPENTRY pBitmap, LPCSTR szAText);
  62. BOOL DeleteBitmap(LPWSTR szWText, char *szComment);
  63. BOOL DeleteBitmapByPointer(FOFFSET nBmpOffs);
  64. BOOL DeleteGroupByPointer(FOFFSET nGrpOffs);
  65. PGROUPENTRY GetGroupList(VOID);
  66. VOID FreeGroupList(PGROUPENTRY pList);
  67. PBMPENTRY GetBitmapList(HDC hDC, FOFFSET nOffs);
  68. VOID FreeBitmapList(PBMPENTRY pList);