summaryrefslogtreecommitdiffstats
path: root/generic/tk.h
diff options
context:
space:
mode:
authordgp <dgp@users.sourceforge.net>2013-04-01 17:07:10 (GMT)
committerdgp <dgp@users.sourceforge.net>2013-04-01 17:07:10 (GMT)
commitd81f8f7c49270ddc93b4d639c0e7f77767c4fd47 (patch)
tree64da754277b242dc50862f735d5b4ee523971fa6 /generic/tk.h
parente19cf65c7641a093a5c7cf8325c5466e431d7c69 (diff)
parentb8f8082aad49088238582658c22248f9469ad055 (diff)
downloadtk-d81f8f7c49270ddc93b4d639c0e7f77767c4fd47.zip
tk-d81f8f7c49270ddc93b4d639c0e7f77767c4fd47.tar.gz
tk-d81f8f7c49270ddc93b4d639c0e7f77767c4fd47.tar.bz2
Merge 8.5. Bring together the compile time and run time Xkb checks.bug_3607830
Diffstat (limited to 'generic/tk.h')
-rw-r--r--generic/tk.h117
1 files changed, 62 insertions, 55 deletions
diff --git a/generic/tk.h b/generic/tk.h
index 8c13df2..7c686a3 100644
--- a/generic/tk.h
+++ b/generic/tk.h
@@ -17,10 +17,18 @@
#define _TK
#include <tcl.h>
-#if (TCL_MAJOR_VERSION != 8) || (TCL_MINOR_VERSION != 5)
-# error Tk 8.5 must be compiled with tcl.h from Tcl 8.5
+#if (TCL_MAJOR_VERSION != 8) || (TCL_MINOR_VERSION < 5)
+# error Tk 8.5 must be compiled with tcl.h from Tcl 8.5 or better
#endif
+#ifndef _ANSI_ARGS_
+# ifndef NO_PROTOTYPES
+# define _ANSI_ARGS_(x) x
+# else
+# define _ANSI_ARGS_(x) ()
+# endif
+#endif
+
/*
* For C++ compilers, use extern "C"
*/
@@ -69,11 +77,9 @@ extern "C" {
#ifndef RC_INVOKED
#ifndef _XLIB_H
-# if defined(MAC_OSX_TK)
-# include <X11/Xlib.h>
+# include <X11/Xlib.h>
+# ifdef MAC_OSX_TK
# include <X11/X.h>
-# else
-# include <X11/Xlib.h>
# endif
#endif
#ifdef __STDC__
@@ -81,18 +87,20 @@ extern "C" {
#endif
#ifdef BUILD_tk
-# undef TCL_STORAGE_CLASS
-# define TCL_STORAGE_CLASS DLLEXPORT
+#undef TCL_STORAGE_CLASS
+#define TCL_STORAGE_CLASS DLLEXPORT
#endif
-
+
/*
+ *----------------------------------------------------------------------
+ *
* Decide whether or not to use input methods.
*/
#ifdef XNQueryInputStyle
#define TK_USE_INPUT_METHODS
#endif
-
+
/*
* Dummy types that are used by clients:
*/
@@ -118,8 +126,10 @@ typedef struct Tk_StyledElement_ *Tk_StyledElement;
*/
typedef const char *Tk_Uid;
-
+
/*
+ *----------------------------------------------------------------------
+ *
* The enum below defines the valid types for Tk configuration options as
* implemented by Tk_InitOptions, Tk_SetOptions, etc.
*/
@@ -217,7 +227,7 @@ typedef void (Tk_CustomOptionFreeProc) _ANSI_ARGS_((ClientData clientData,
Tk_Window tkwin, char *internalPtr));
typedef struct Tk_ObjCustomOption {
- const char *name; /* Name of the custom option. */
+ const char *name; /* Name of the custom option. */
Tk_CustomOptionSetProc *setProc;
/* Function to use to set a record's option
* value from a Tcl_Obj */
@@ -293,7 +303,7 @@ typedef struct Tk_SavedOptions {
* old values in a single structure. NULL
* means no more structures. */
} Tk_SavedOptions;
-
+
/*
* Structure used to describe application-specific configuration options:
* indicates procedures to call to parse an option and to return a text string
@@ -392,7 +402,7 @@ typedef enum {
#define TK_CONFIG_OPTION_SPECIFIED (1 << 4)
#define TK_CONFIG_USER_BIT 0x100
#endif /* __NO_OLD_CONFIG */
-
+
/*
* Structure used to specify how to handle argv options.
*/
@@ -436,7 +446,7 @@ typedef struct {
#define TK_ARGV_NO_LEFTOVERS 0x2
#define TK_ARGV_NO_ABBREV 0x4
#define TK_ARGV_DONT_SKIP_FIRST_ARG 0x8
-
+
/*
* Enumerated type for describing actions to be taken in response to a
* restrictProc established by Tk_RestrictEvents.
@@ -494,7 +504,7 @@ typedef enum {
TK_ANCHOR_S, TK_ANCHOR_SW, TK_ANCHOR_W, TK_ANCHOR_NW,
TK_ANCHOR_CENTER
} Tk_Anchor;
-
+
/*
* Enumerated type for describing a style of justification:
*/
@@ -538,7 +548,7 @@ typedef struct Tk_FontMetrics {
#define TK_IGNORE_TABS 8
#define TK_IGNORE_NEWLINES 16
-
+
/*
* Widget class procedures used to implement platform specific widget
* behavior.
@@ -582,7 +592,7 @@ typedef struct Tk_ClassProcs {
#define Tk_GetClassProc(procs, which) \
(((procs) == NULL) ? NULL : \
(((procs)->size <= Tk_Offset(Tk_ClassProcs, which)) ? NULL:(procs)->which))
-
+
/*
* Each geometry manager (the packer, the placer, etc.) is represented by a
* structure of the following form, which indicates procedures to invoke in
@@ -616,13 +626,13 @@ typedef struct Tk_GeomMgr {
#define TK_SCROLL_PAGES 2
#define TK_SCROLL_UNITS 3
#define TK_SCROLL_ERROR 4
-
+
/*
- *---------------------------------------------------------------------------
+ *----------------------------------------------------------------------
*
* Extensions to the X event set
*
- *---------------------------------------------------------------------------
+ *----------------------------------------------------------------------
*/
#define VirtualEvent (MappingNotify + 1)
@@ -681,12 +691,12 @@ typedef XActivateDeactivateEvent XActivateEvent;
typedef XActivateDeactivateEvent XDeactivateEvent;
/*
- *--------------------------------------------------------------
+ *----------------------------------------------------------------------
*
* Macros for querying Tk_Window structures. See the manual entries for
* documentation.
*
- *--------------------------------------------------------------
+ *----------------------------------------------------------------------
*/
#define Tk_Display(tkwin) (((Tk_FakeWin *) (tkwin))->display)
@@ -883,11 +893,11 @@ typedef struct Tk_FakeWin {
#define TK_WM_MANAGEABLE 0x80000
/*
- *--------------------------------------------------------------
+ *----------------------------------------------------------------------
*
* Procedure prototypes and structures used for defining new canvas items:
*
- *--------------------------------------------------------------
+ *----------------------------------------------------------------------
*/
typedef enum {
@@ -1124,7 +1134,7 @@ typedef struct Tk_CanvasTextInfo {
* should be displayed in focusItemPtr.
* Read-only to items.*/
} Tk_CanvasTextInfo;
-
+
/*
* Structures used for Dashing and Outline.
*/
@@ -1180,11 +1190,11 @@ typedef struct Tk_Outline {
} Tk_Outline;
/*
- *--------------------------------------------------------------
+ *----------------------------------------------------------------------
*
* Procedure prototypes and structures used for managing images:
*
- *--------------------------------------------------------------
+ *----------------------------------------------------------------------
*/
typedef struct Tk_ImageType Tk_ImageType;
@@ -1247,13 +1257,13 @@ struct Tk_ImageType {
* manager. */
char *reserved; /* reserved for future expansion */
};
-
+
/*
- *--------------------------------------------------------------
+ *----------------------------------------------------------------------
*
* Additional definitions used to manage images of type "photo".
*
- *--------------------------------------------------------------
+ *----------------------------------------------------------------------
*/
/*
@@ -1363,18 +1373,13 @@ struct Tk_PhotoImageFormat {
* currently known. Filled in by Tk, not by
* image format handler. */
};
-
-#ifdef USE_OLD_IMAGE
-#define Tk_CreateImageType Tk_CreateOldImageType
-#define Tk_CreatePhotoImageFormat Tk_CreateOldPhotoImageFormat
-#endif
/*
- *--------------------------------------------------------------
+ *----------------------------------------------------------------------
*
* Procedure prototypes and structures used for managing styles:
*
- *--------------------------------------------------------------
+ *----------------------------------------------------------------------
*/
/*
@@ -1438,13 +1443,13 @@ typedef struct Tk_ElementSpec {
#define TK_ELEMENT_STATE_PRESSED 1<<3
/*
- *--------------------------------------------------------------
+ *----------------------------------------------------------------------
*
* The definitions below provide backward compatibility for functions and
* types related to event handling that used to be in Tk but have moved to
* Tcl.
*
- *--------------------------------------------------------------
+ *----------------------------------------------------------------------
*/
#define TK_READABLE TCL_READABLE
@@ -1491,21 +1496,18 @@ EXTERN const char * Tk_PkgInitStubsCheck _ANSI_ARGS_((Tcl_Interp *interp,
const char *version, int exact));
#ifndef USE_TK_STUBS
-
#define Tk_InitStubs(interp, version, exact) \
Tk_PkgInitStubsCheck(interp, version, exact)
-
-#endif
+#endif /* USE_TK_STUBS */
#define Tk_InitImageArgs(interp, argc, argv) /**/
-
/*
- *--------------------------------------------------------------
+ *----------------------------------------------------------------------
*
* Additional procedure types defined by Tk.
*
- *--------------------------------------------------------------
+ *----------------------------------------------------------------------
*/
typedef int (Tk_ErrorProc) _ANSI_ARGS_((ClientData clientData,
@@ -1523,18 +1525,27 @@ typedef Tk_RestrictAction (Tk_RestrictProc) _ANSI_ARGS_((
ClientData clientData, XEvent *eventPtr));
typedef int (Tk_SelectionProc) _ANSI_ARGS_((ClientData clientData,
int offset, char *buffer, int maxBytes));
-
+
/*
- *--------------------------------------------------------------
+ *----------------------------------------------------------------------
*
- * Platform independant exported procedures and variables.
+ * Platform independent exported procedures and variables.
*
- *--------------------------------------------------------------
+ *----------------------------------------------------------------------
*/
#include "tkDecls.h"
+
+#ifdef USE_OLD_IMAGE
+#undef Tk_CreateImageType
+#define Tk_CreateImageType Tk_CreateOldImageType
+#undef Tk_CreatePhotoImageFormat
+#define Tk_CreatePhotoImageFormat Tk_CreateOldPhotoImageFormat
+#endif /* USE_OLD_IMAGE */
/*
+ *----------------------------------------------------------------------
+ *
* Allow users to say that they don't want to alter their source to add extra
* arguments to Tk_PhotoPutBlock() et al; DO NOT DEFINE THIS WHEN BUILDING TK.
*
@@ -1574,11 +1585,7 @@ typedef int (Tk_SelectionProc) _ANSI_ARGS_((ClientData clientData,
# endif
# define Tk_PhotoSetSize Tk_PhotoSetSize_Panic
#endif /* USE_PANIC_ON_PHOTO_ALLOC_FAILURE */
-
-/*
- * Tcl commands exported by Tk:
- */
-
+
#undef TCL_STORAGE_CLASS
#define TCL_STORAGE_CLASS DLLIMPORT