Leaked source code of windows server 2003
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.

97 lines
3.2 KiB

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