Вы не можете выбрать более 25 тем Темы должны начинаться с буквы или цифры, могут содержать дефисы(-) и должны содержать не более 35 символов.
 
 
 
 
 
 

100 строки
3.1 KiB

  1. /**************************************************************************
  2. *
  3. * Copyright (c) 2000 Microsoft Corporation
  4. *
  5. * Module Name:
  6. *
  7. * Gdiplus init
  8. *
  9. * Abstract:
  10. *
  11. * GDI+ startup/shutdown API's
  12. *
  13. * Created:
  14. *
  15. * 09/02/2000 agodfrey
  16. * Created it.
  17. *
  18. **************************************************************************/
  19. #ifndef _GDIPLUSINIT_H
  20. #define _GDIPLUSINIT_H
  21. // Used for debug event notification (debug builds only)
  22. enum DebugEventLevel
  23. {
  24. DebugEventLevelFatal,
  25. DebugEventLevelWarning
  26. };
  27. // Callback function that GDI+ can call, on debug builds, for assertions
  28. // and warnings.
  29. typedef VOID (WINAPI *DebugEventProc)(DebugEventLevel level, CHAR *message);
  30. // Notification functions which the user must call appropriately if
  31. // "SuppressBackgroundThread" (below) is set.
  32. typedef Status (WINAPI *NotificationHookProc)(OUT ULONG_PTR *token);
  33. typedef VOID (WINAPI *NotificationUnhookProc)(ULONG_PTR token);
  34. // Input structure for GdiplusStartup()
  35. struct GdiplusStartupInput
  36. {
  37. UINT32 GdiplusVersion; // Must be 1
  38. DebugEventProc DebugEventCallback; // Ignored on free builds
  39. BOOL SuppressBackgroundThread; // FALSE unless you're prepared to call
  40. // the hook/unhook functions properly
  41. BOOL SuppressExternalCodecs; // FALSE unless you want GDI+ only to use
  42. // its internal image codecs.
  43. GdiplusStartupInput(
  44. DebugEventProc debugEventCallback = NULL,
  45. BOOL suppressBackgroundThread = FALSE,
  46. BOOL suppressExternalCodecs = FALSE)
  47. {
  48. GdiplusVersion = 1;
  49. DebugEventCallback = debugEventCallback;
  50. SuppressBackgroundThread = suppressBackgroundThread;
  51. SuppressExternalCodecs = suppressExternalCodecs;
  52. }
  53. };
  54. // Output structure for GdiplusStartup()
  55. struct GdiplusStartupOutput
  56. {
  57. // The following 2 fields are NULL if SuppressBackgroundThread is FALSE.
  58. // Otherwise, they are functions which must be called appropriately to
  59. // replace the background thread.
  60. //
  61. // These should be called on the application's main message loop - i.e.
  62. // a message loop which is active for the lifetime of GDI+.
  63. // "NotificationHook" should be called before starting the loop,
  64. // and "NotificationUnhook" should be called after the loop ends.
  65. NotificationHookProc NotificationHook;
  66. NotificationUnhookProc NotificationUnhook;
  67. };
  68. // GDI+ initialization. Must be called before GDI+ API's are used.
  69. //
  70. // token - may not be NULL - accepts a token to be passed in the corresponding
  71. // GdiplusShutdown call.
  72. // input - may not be NULL
  73. // output - may be NULL only if input->SuppressBackgroundThread is FALSE.
  74. extern "C" Status WINAPI GdiplusStartup(
  75. OUT ULONG_PTR *token,
  76. const GdiplusStartupInput *input,
  77. OUT GdiplusStartupOutput *output);
  78. // GDI+ termination. Must be called before GDI+ is unloaded. GDI+ API's may not
  79. // be called after this.
  80. extern "C" VOID WINAPI GdiplusShutdown(ULONG_PTR token);
  81. #endif