tkPlatDecls.h 6.7 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206
  1. /*
  2. * tkPlatDecls.h --
  3. *
  4. * Declarations of functions in the platform-specific public Tcl API.
  5. *
  6. * Copyright (c) 1998-1999 by Scriptics Corporation.
  7. *
  8. * See the file "license.terms" for information on usage and redistribution
  9. * of this file, and for a DISCLAIMER OF ALL WARRANTIES.
  10. */
  11. #ifndef _TKPLATDECLS
  12. #define _TKPLATDECLS
  13. #ifdef BUILD_tk
  14. #undef TCL_STORAGE_CLASS
  15. #define TCL_STORAGE_CLASS DLLEXPORT
  16. #endif
  17. /*
  18. * WARNING: This file is automatically generated by the tools/genStubs.tcl
  19. * script. Any modifications to the function declarations below should be made
  20. * in the generic/tk.decls script.
  21. */
  22. #ifdef __cplusplus
  23. extern "C" {
  24. #endif
  25. /* !BEGIN!: Do not edit below this line. */
  26. #ifdef __cplusplus
  27. extern "C" {
  28. #endif
  29. /*
  30. * Exported function declarations:
  31. */
  32. #if defined(_WIN32) || defined(__CYGWIN__) /* WIN */
  33. /* 0 */
  34. EXTERN Window Tk_AttachHWND(Tk_Window tkwin, HWND hwnd);
  35. /* 1 */
  36. EXTERN HINSTANCE Tk_GetHINSTANCE(void);
  37. /* 2 */
  38. EXTERN HWND Tk_GetHWND(Window window);
  39. /* 3 */
  40. EXTERN Tk_Window Tk_HWNDToWindow(HWND hwnd);
  41. /* 4 */
  42. EXTERN void Tk_PointerEvent(HWND hwnd, int x, int y);
  43. /* 5 */
  44. EXTERN int Tk_TranslateWinEvent(HWND hwnd, UINT message,
  45. WPARAM wParam, LPARAM lParam,
  46. LRESULT *result);
  47. #endif /* WIN */
  48. #ifdef MAC_OSX_TK /* AQUA */
  49. /* 0 */
  50. EXTERN void Tk_MacOSXSetEmbedHandler(
  51. Tk_MacOSXEmbedRegisterWinProc *registerWinProcPtr,
  52. Tk_MacOSXEmbedGetGrafPortProc *getPortProcPtr,
  53. Tk_MacOSXEmbedMakeContainerExistProc *containerExistProcPtr,
  54. Tk_MacOSXEmbedGetClipProc *getClipProc,
  55. Tk_MacOSXEmbedGetOffsetInParentProc *getOffsetProc);
  56. /* 1 */
  57. EXTERN void Tk_MacOSXTurnOffMenus(void);
  58. /* 2 */
  59. EXTERN void Tk_MacOSXTkOwnsCursor(int tkOwnsIt);
  60. /* 3 */
  61. EXTERN void TkMacOSXInitMenus(Tcl_Interp *interp);
  62. /* 4 */
  63. EXTERN void TkMacOSXInitAppleEvents(Tcl_Interp *interp);
  64. /* 5 */
  65. EXTERN void TkGenWMConfigureEvent(Tk_Window tkwin, int x, int y,
  66. int width, int height, int flags);
  67. /* 6 */
  68. EXTERN void TkMacOSXInvalClipRgns(Tk_Window tkwin);
  69. /* 7 */
  70. EXTERN void * TkMacOSXGetDrawablePort(Drawable drawable);
  71. /* 8 */
  72. EXTERN void * TkMacOSXGetRootControl(Drawable drawable);
  73. /* 9 */
  74. EXTERN void Tk_MacOSXSetupTkNotifier(void);
  75. /* 10 */
  76. EXTERN int Tk_MacOSXIsAppInFront(void);
  77. /* 11 */
  78. EXTERN Tk_Window Tk_MacOSXGetTkWindow(void *w);
  79. /* 12 */
  80. EXTERN void * Tk_MacOSXGetCGContextForDrawable(Drawable drawable);
  81. /* 13 */
  82. EXTERN void * Tk_MacOSXGetNSWindowForDrawable(Drawable drawable);
  83. /* Slot 14 is reserved */
  84. /* Slot 15 is reserved */
  85. /* 16 */
  86. EXTERN void TkGenWMConfigureEvent_(Tk_Window tkwin, int x, int y,
  87. int width, int height, int flags);
  88. #endif /* AQUA */
  89. typedef struct TkPlatStubs {
  90. int magic;
  91. void *hooks;
  92. #if defined(_WIN32) || defined(__CYGWIN__) /* WIN */
  93. Window (*tk_AttachHWND) (Tk_Window tkwin, HWND hwnd); /* 0 */
  94. HINSTANCE (*tk_GetHINSTANCE) (void); /* 1 */
  95. HWND (*tk_GetHWND) (Window window); /* 2 */
  96. Tk_Window (*tk_HWNDToWindow) (HWND hwnd); /* 3 */
  97. void (*tk_PointerEvent) (HWND hwnd, int x, int y); /* 4 */
  98. int (*tk_TranslateWinEvent) (HWND hwnd, UINT message, WPARAM wParam, LPARAM lParam, LRESULT *result); /* 5 */
  99. #endif /* WIN */
  100. #ifdef MAC_OSX_TK /* AQUA */
  101. void (*tk_MacOSXSetEmbedHandler) (Tk_MacOSXEmbedRegisterWinProc *registerWinProcPtr, Tk_MacOSXEmbedGetGrafPortProc *getPortProcPtr, Tk_MacOSXEmbedMakeContainerExistProc *containerExistProcPtr, Tk_MacOSXEmbedGetClipProc *getClipProc, Tk_MacOSXEmbedGetOffsetInParentProc *getOffsetProc); /* 0 */
  102. void (*tk_MacOSXTurnOffMenus) (void); /* 1 */
  103. void (*tk_MacOSXTkOwnsCursor) (int tkOwnsIt); /* 2 */
  104. void (*tkMacOSXInitMenus) (Tcl_Interp *interp); /* 3 */
  105. void (*tkMacOSXInitAppleEvents) (Tcl_Interp *interp); /* 4 */
  106. void (*tkGenWMConfigureEvent) (Tk_Window tkwin, int x, int y, int width, int height, int flags); /* 5 */
  107. void (*tkMacOSXInvalClipRgns) (Tk_Window tkwin); /* 6 */
  108. void * (*tkMacOSXGetDrawablePort) (Drawable drawable); /* 7 */
  109. void * (*tkMacOSXGetRootControl) (Drawable drawable); /* 8 */
  110. void (*tk_MacOSXSetupTkNotifier) (void); /* 9 */
  111. int (*tk_MacOSXIsAppInFront) (void); /* 10 */
  112. Tk_Window (*tk_MacOSXGetTkWindow) (void *w); /* 11 */
  113. void * (*tk_MacOSXGetCGContextForDrawable) (Drawable drawable); /* 12 */
  114. void * (*tk_MacOSXGetNSWindowForDrawable) (Drawable drawable); /* 13 */
  115. void (*reserved14)(void);
  116. void (*reserved15)(void);
  117. void (*tkGenWMConfigureEvent_) (Tk_Window tkwin, int x, int y, int width, int height, int flags); /* 16 */
  118. #endif /* AQUA */
  119. } TkPlatStubs;
  120. extern const TkPlatStubs *tkPlatStubsPtr;
  121. #ifdef __cplusplus
  122. }
  123. #endif
  124. #if defined(USE_TK_STUBS)
  125. /*
  126. * Inline function declarations:
  127. */
  128. #if defined(_WIN32) || defined(__CYGWIN__) /* WIN */
  129. #define Tk_AttachHWND \
  130. (tkPlatStubsPtr->tk_AttachHWND) /* 0 */
  131. #define Tk_GetHINSTANCE \
  132. (tkPlatStubsPtr->tk_GetHINSTANCE) /* 1 */
  133. #define Tk_GetHWND \
  134. (tkPlatStubsPtr->tk_GetHWND) /* 2 */
  135. #define Tk_HWNDToWindow \
  136. (tkPlatStubsPtr->tk_HWNDToWindow) /* 3 */
  137. #define Tk_PointerEvent \
  138. (tkPlatStubsPtr->tk_PointerEvent) /* 4 */
  139. #define Tk_TranslateWinEvent \
  140. (tkPlatStubsPtr->tk_TranslateWinEvent) /* 5 */
  141. #endif /* WIN */
  142. #ifdef MAC_OSX_TK /* AQUA */
  143. #define Tk_MacOSXSetEmbedHandler \
  144. (tkPlatStubsPtr->tk_MacOSXSetEmbedHandler) /* 0 */
  145. #define Tk_MacOSXTurnOffMenus \
  146. (tkPlatStubsPtr->tk_MacOSXTurnOffMenus) /* 1 */
  147. #define Tk_MacOSXTkOwnsCursor \
  148. (tkPlatStubsPtr->tk_MacOSXTkOwnsCursor) /* 2 */
  149. #define TkMacOSXInitMenus \
  150. (tkPlatStubsPtr->tkMacOSXInitMenus) /* 3 */
  151. #define TkMacOSXInitAppleEvents \
  152. (tkPlatStubsPtr->tkMacOSXInitAppleEvents) /* 4 */
  153. #define TkGenWMConfigureEvent \
  154. (tkPlatStubsPtr->tkGenWMConfigureEvent) /* 5 */
  155. #define TkMacOSXInvalClipRgns \
  156. (tkPlatStubsPtr->tkMacOSXInvalClipRgns) /* 6 */
  157. #define TkMacOSXGetDrawablePort \
  158. (tkPlatStubsPtr->tkMacOSXGetDrawablePort) /* 7 */
  159. #define TkMacOSXGetRootControl \
  160. (tkPlatStubsPtr->tkMacOSXGetRootControl) /* 8 */
  161. #define Tk_MacOSXSetupTkNotifier \
  162. (tkPlatStubsPtr->tk_MacOSXSetupTkNotifier) /* 9 */
  163. #define Tk_MacOSXIsAppInFront \
  164. (tkPlatStubsPtr->tk_MacOSXIsAppInFront) /* 10 */
  165. #define Tk_MacOSXGetTkWindow \
  166. (tkPlatStubsPtr->tk_MacOSXGetTkWindow) /* 11 */
  167. #define Tk_MacOSXGetCGContextForDrawable \
  168. (tkPlatStubsPtr->tk_MacOSXGetCGContextForDrawable) /* 12 */
  169. #define Tk_MacOSXGetNSWindowForDrawable \
  170. (tkPlatStubsPtr->tk_MacOSXGetNSWindowForDrawable) /* 13 */
  171. /* Slot 14 is reserved */
  172. /* Slot 15 is reserved */
  173. #define TkGenWMConfigureEvent_ \
  174. (tkPlatStubsPtr->tkGenWMConfigureEvent_) /* 16 */
  175. #endif /* AQUA */
  176. #endif /* defined(USE_TK_STUBS) */
  177. /* !END!: Do not edit above this line. */
  178. #ifdef __cplusplus
  179. }
  180. #endif
  181. #undef TCL_STORAGE_CLASS
  182. #define TCL_STORAGE_CLASS DLLIMPORT
  183. #undef TkGenWMConfigureEvent_
  184. #define Tk_MacOSXGetNSViewForDrawable TkMacOSXGetRootControl
  185. #endif /* _TKPLATDECLS */