]> granicus.if.org Git - imagemagick/blobdiff - MagickCore/xwindow-private.h
(no commit message)
[imagemagick] / MagickCore / xwindow-private.h
index 36cb842deea7c24669ed837e8c9c9025fada4e2e..b1c8b7d48cfd4f1ad38bac29b27822757dbe8c4c 100644 (file)
@@ -1,5 +1,5 @@
 /*
-  Copyright 1999-2011 ImageMagick Studio LLC, a non-profit organization
+  Copyright 1999-2012 ImageMagick Studio LLC, a non-profit organization
   dedicated to making software imaging solutions freely available.
   
   You may not use this file except in compliance with the License.
@@ -33,6 +33,7 @@ extern "C" {
 #include <X11/Xutil.h>
 #include "MagickCore/exception.h"
 #include "MagickCore/geometry.h"
+#include "MagickCore/pixel-accessor.h"
 #include "MagickCore/quantize.h"
 
 #if defined(__cplusplus) || defined(c_plusplus)
@@ -75,7 +76,7 @@ extern "C" {
  \
   GetExceptionInfo(&exception); \
   (void) ThrowMagickException(&exception,GetMagickModule(),severity, \
-    tag == (const char *) NULL ? "unknown" : tag,"`%s': %s",context, \
+    tag == (const char *) NULL ? "unknown" : tag,"'%s': %s",context, \
     strerror(errno)); \
   CatchException(&exception); \
   (void) DestroyExceptionInfo(&exception); \
@@ -161,16 +162,6 @@ typedef struct _XDrawInfo
     geometry[MaxTextExtent];
 } XDrawInfo;
 
-struct _XImportInfo
-{
-  MagickBooleanType
-    frame,
-    borders,
-    screen,
-    descend,
-    silent;
-};
-
 typedef enum
 {
   DefaultState = 0x0000,
@@ -247,7 +238,7 @@ typedef struct _XPixelInfo
     pen_index;
 } XPixelInfo;
 
-struct _XResourceInfo
+typedef struct _XResourceInfo
 {
   XrmDatabase
     resource_database;
@@ -351,7 +342,7 @@ struct _XResourceInfo
 
   char
     home_directory[MaxTextExtent];
-};
+} XResourceInfo;
 
 typedef struct _XWindowInfo
 {
@@ -522,15 +513,16 @@ extern MagickPrivate int
   XCheckDefineCursor(Display *,Window,Cursor);
 
 extern MagickPrivate MagickBooleanType
-  XAnnotateImage(Display *,const XPixelInfo *,XAnnotateInfo *,Image *),
+  XAnnotateImage(Display *,const XPixelInfo *,XAnnotateInfo *,Image *,
+    ExceptionInfo *),
   XComponentGenesis(void),
-  XDrawImage(Display *,const XPixelInfo *,XDrawInfo *,Image *),
-  XGetWindowColor(Display *,XWindows *,char *),
+  XDrawImage(Display *,const XPixelInfo *,XDrawInfo *,Image *,ExceptionInfo *),
+  XGetWindowColor(Display *,XWindows *,char *,ExceptionInfo *),
   XMagickProgressMonitor(const char *,const MagickOffsetType,
     const MagickSizeType,void *),
   XMakeImage(Display *,const XResourceInfo *,XWindowInfo *,Image *,unsigned int,
     unsigned int,ExceptionInfo *),
-  XQueryColorDatabase(const char *,XColor *);
+  XQueryColorCompliance(const char *,XColor *);
 
 extern MagickPrivate void
   XBestIconSize(Display *,XWindowInfo *,Image *),
@@ -538,10 +530,12 @@ extern MagickPrivate void
   XCheckRefreshWindows(Display *,XWindows *),
   XClientMessage(Display *,const Window,const Atom,const Atom,const Time),
   XComponentTerminus(void),
-  XConfigureImageColormap(Display *,XResourceInfo *,XWindows *,Image *),
+  XConfigureImageColormap(Display *,XResourceInfo *,XWindows *,Image *,
+    ExceptionInfo *),
   XConstrainWindowPosition(Display *,XWindowInfo *),
   XDelay(Display *,const size_t),
-  XDisplayImageInfo(Display *,const XResourceInfo *,XWindows *,Image *,Image *),
+  XDisplayImageInfo(Display *,const XResourceInfo *,XWindows *,Image *,Image *,
+    ExceptionInfo *),
   XDestroyWindowColors(Display *,Window),
   XFreeResources(Display *,XVisualInfo *,XStandardColormap *,XPixelInfo *,
     XFontStruct *,XResourceInfo *,XWindowInfo *),
@@ -556,9 +550,9 @@ extern MagickPrivate void
   XGetMapInfo(const XVisualInfo *,const Colormap,XStandardColormap *),
   XGetWindowInfo(Display *,XVisualInfo *,XStandardColormap *,XPixelInfo *,
     XFontStruct *,XResourceInfo *,XWindowInfo *),
-  XMakeMagnifyImage(Display *,XWindows *),
+  XMakeMagnifyImage(Display *,XWindows *,ExceptionInfo *),
   XMakeStandardColormap(Display *,XVisualInfo *,XResourceInfo *,Image *,
-    XStandardColormap *,XPixelInfo *),
+    XStandardColormap *,XPixelInfo *,ExceptionInfo *),
   XMakeWindow(Display *,Window,char **,int,XClassHint *,XWMHints *,
     XWindowInfo *),
   XQueryPosition(Display *,const Window,int *,int *),
@@ -582,13 +576,37 @@ extern MagickPrivate XWindows
   *XInitializeWindows(Display *,XResourceInfo *),
   *XSetWindows(XWindows *);
 
-static inline MagickRealType XPixelIntensity(const XColor *pixel)
-{
-  MagickRealType
-    intensity;
+extern MagickExport char
+  *XGetResourceClass(XrmDatabase,const char *,const char *,char *),
+  *XGetResourceInstance(XrmDatabase,const char *,const char *,const char *),
+  *XGetScreenDensity(Display *);
+
+extern MagickExport int
+  XError(Display *,XErrorEvent *);
 
-  intensity=0.299*pixel->red+0.587*pixel->green+0.114*pixel->blue;
-  return(intensity);
+extern MagickExport MagickBooleanType
+  XRemoteCommand(Display *,const char *,const char *);
+
+extern MagickExport void
+  DestroyXResources(void),
+  XDestroyResourceInfo(XResourceInfo *),
+  XGetResourceInfo(const ImageInfo *,XrmDatabase,const char *,XResourceInfo *),
+  XRetainWindowColors(Display *,const Window);
+
+extern MagickExport XrmDatabase
+  XGetResourceDatabase(Display *,const char *);
+
+static inline double XPixelIntensity(const XColor *pixel)
+{
+  double
+    blue,
+    green,
+    red;
+
+  red=InversesRGBCompandor((double) pixel->red);
+  green=InversesRGBCompandor((double) pixel->green);
+  blue=InversesRGBCompandor((double) pixel->blue);
+  return(0.298839*red+0.586811*green+0.114350*blue);
 }
 
 #endif