2 Copyright 1999-2011 ImageMagick Studio LLC, a non-profit organization
3 dedicated to making software imaging solutions freely available.
5 You may not use this file except in compliance with the License.
6 obtain a copy of the License at
8 http://www.imagemagick.org/script/license.php
10 Unless required by applicable law or agreed to in writing, software
11 distributed under the License is distributed on an "AS IS" BASIS,
12 WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13 See the License for the specific language governing permissions and
14 limitations under the License.
16 MagickCore X11 window methods.
18 #ifndef _MAGICKCORE_XWINDOW_PRIVATE_H
19 #define _MAGICKCORE_XWINDOW_PRIVATE_H
21 #if defined(__cplusplus) || defined(c_plusplus)
25 #if defined(MAGICKCORE_X11_DELEGATE)
29 #include <X11/Xatom.h>
30 #include <X11/cursorfont.h>
31 #include <X11/keysym.h>
32 #include <X11/Xresource.h>
33 #include <X11/Xutil.h>
34 #include "MagickCore/exception.h"
35 #include "MagickCore/geometry.h"
36 #include "MagickCore/quantize.h"
37 #include "MagickCore/xwindow.h"
39 #if defined(__cplusplus) || defined(c_plusplus)
40 # define klass c_class
46 Invoke pre-X11R6 ICCCM routines if XlibSpecificationRelease is not 6.
48 #if XlibSpecificationRelease < 6
49 #if !defined(PRE_R6_ICCCM)
54 Invoke pre-X11R5 ICCCM routines if XlibSpecificationRelease is not defined.
56 #if !defined(XlibSpecificationRelease)
60 Invoke pre-X11R4 ICCCM routines if PWinGravity is not defined.
62 #if !defined(PWinGravity)
66 #define MaxIconSize 96
67 #define MaxNumberPens 11
68 #define MaxNumberFonts 11
69 #define MaxXWindows 12
72 #define ThrowXWindowException(severity,tag,context) \
77 GetExceptionInfo(&exception); \
78 (void) ThrowMagickException(&exception,GetMagickModule(),severity, \
79 tag == (const char *) NULL ? "unknown" : tag,"`%s': %s",context, \
81 CatchException(&exception); \
82 (void) DestroyExceptionInfo(&exception); \
84 #define ThrowXWindowFatalException(severity,tag,context) \
86 ThrowXWindowException(severity,tag,context); \
104 FillRectangleElement,
124 typedef struct _XDrawInfo
162 geometry[MaxTextExtent];
177 DefaultState = 0x0000,
178 EscapeState = 0x0001,
180 FormerImageState = 0x0004,
181 ModifierState = 0x0008,
182 MontageImageState = 0x0010,
183 NextImageState = 0x0020,
184 RetainColorsState = 0x0040,
186 UpdateConfigurationState = 0x0080,
187 UpdateRegionState = 0x0100
190 typedef struct _XAnnotateInfo
213 geometry[MaxTextExtent];
215 struct _XAnnotateInfo
220 typedef struct _XPixelInfo
239 pen_colors[MaxNumberPens];
251 struct _XResourceInfo
295 *font_name[MaxNumberFonts],
322 *pen_colors[MaxNumberPens];
354 home_directory[MaxTextExtent];
357 typedef struct _XWindowInfo
462 typedef struct _XWindows
519 extern MagickPrivate Cursor
520 XMakeCursor(Display *,Window,Colormap,char *,char *);
522 extern MagickPrivate int
523 XCheckDefineCursor(Display *,Window,Cursor);
525 extern MagickPrivate MagickBooleanType
526 XAnnotateImage(Display *,const XPixelInfo *,XAnnotateInfo *,Image *),
527 XComponentGenesis(void),
528 XDrawImage(Display *,const XPixelInfo *,XDrawInfo *,Image *),
529 XGetWindowColor(Display *,XWindows *,char *),
530 XMagickProgressMonitor(const char *,const MagickOffsetType,
531 const MagickSizeType,void *),
532 XMakeImage(Display *,const XResourceInfo *,XWindowInfo *,Image *,unsigned int,
533 unsigned int,ExceptionInfo *),
534 XQueryColorDatabase(const char *,XColor *);
536 extern MagickPrivate void
537 XBestIconSize(Display *,XWindowInfo *,Image *),
538 XBestPixel(Display *,const Colormap,XColor *,unsigned int,XColor *),
539 XCheckRefreshWindows(Display *,XWindows *),
540 XClientMessage(Display *,const Window,const Atom,const Atom,const Time),
541 XComponentTerminus(void),
542 XConfigureImageColormap(Display *,XResourceInfo *,XWindows *,Image *),
543 XConstrainWindowPosition(Display *,XWindowInfo *),
544 XDelay(Display *,const size_t),
545 XDisplayImageInfo(Display *,const XResourceInfo *,XWindows *,Image *,Image *),
546 XDestroyWindowColors(Display *,Window),
547 XFreeResources(Display *,XVisualInfo *,XStandardColormap *,XPixelInfo *,
548 XFontStruct *,XResourceInfo *,XWindowInfo *),
549 XFreeStandardColormap(Display *,const XVisualInfo *,XStandardColormap *,
551 XHighlightEllipse(Display *,Window,GC,const RectangleInfo *),
552 XHighlightLine(Display *,Window,GC,const XSegment *),
553 XHighlightRectangle(Display *,Window,GC,const RectangleInfo *),
554 XGetAnnotateInfo(XAnnotateInfo *),
555 XGetPixelInfo(Display *,const XVisualInfo *,const XStandardColormap *,
556 const XResourceInfo *,Image *,XPixelInfo *),
557 XGetMapInfo(const XVisualInfo *,const Colormap,XStandardColormap *),
558 XGetWindowInfo(Display *,XVisualInfo *,XStandardColormap *,XPixelInfo *,
559 XFontStruct *,XResourceInfo *,XWindowInfo *),
560 XMakeMagnifyImage(Display *,XWindows *),
561 XMakeStandardColormap(Display *,XVisualInfo *,XResourceInfo *,Image *,
562 XStandardColormap *,XPixelInfo *),
563 XMakeWindow(Display *,Window,char **,int,XClassHint *,XWMHints *,
565 XQueryPosition(Display *,const Window,int *,int *),
566 XRefreshWindow(Display *,const XWindowInfo *,const XEvent *),
567 XSetCursorState(Display *,XWindows *,const MagickStatusType),
568 XUserPreferences(XResourceInfo *),
569 XWarning(const ExceptionType,const char *,const char *);
571 extern MagickPrivate Window
572 XWindowByID(Display *,const Window,const size_t),
573 XWindowByName(Display *,const Window,const char *),
574 XWindowByProperty(Display *,const Window,const Atom);
576 extern MagickPrivate XFontStruct
577 *XBestFont(Display *,const XResourceInfo *,const MagickBooleanType);
579 extern MagickPrivate XVisualInfo
580 *XBestVisualInfo(Display *,XStandardColormap *,XResourceInfo *);
582 extern MagickPrivate XWindows
583 *XInitializeWindows(Display *,XResourceInfo *),
584 *XSetWindows(XWindows *);
586 static inline MagickRealType XPixelIntensity(const XColor *pixel)
591 intensity=0.299*pixel->red+0.587*pixel->green+0.114*pixel->blue;
597 #if defined(__cplusplus) || defined(c_plusplus)