cristy | 3ed852e | 2009-09-05 21:47:34 +0000 | [diff] [blame] | 1 | /* |
cristy | 45ef08f | 2012-12-07 13:13:34 +0000 | [diff] [blame] | 2 | Copyright 1999-2013 ImageMagick Studio LLC, a non-profit organization |
cristy | 3ed852e | 2009-09-05 21:47:34 +0000 | [diff] [blame] | 3 | dedicated to making software imaging solutions freely available. |
| 4 | |
| 5 | You may not use this file except in compliance with the License. |
| 6 | obtain a copy of the License at |
| 7 | |
| 8 | http://www.imagemagick.org/script/license.php |
| 9 | |
| 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. |
| 15 | |
| 16 | MagickCore X11 window methods. |
| 17 | */ |
| 18 | #ifndef _MAGICKCORE_XWINDOW_PRIVATE_H |
| 19 | #define _MAGICKCORE_XWINDOW_PRIVATE_H |
| 20 | |
| 21 | #if defined(__cplusplus) || defined(c_plusplus) |
| 22 | extern "C" { |
| 23 | #endif |
| 24 | |
cristy | 1ffe998 | 2013-04-13 16:46:51 +0000 | [diff] [blame^] | 25 | #include "MagickCore/exception.h" |
| 26 | #include "MagickCore/geometry.h" |
| 27 | #include "MagickCore/pixel-accessor.h" |
| 28 | #include "MagickCore/quantize.h" |
| 29 | |
cristy | 3ed852e | 2009-09-05 21:47:34 +0000 | [diff] [blame] | 30 | #if defined(MAGICKCORE_X11_DELEGATE) |
| 31 | |
| 32 | #include <X11/Xos.h> |
| 33 | #include <X11/Xlib.h> |
| 34 | #include <X11/Xatom.h> |
| 35 | #include <X11/cursorfont.h> |
| 36 | #include <X11/keysym.h> |
| 37 | #include <X11/Xresource.h> |
| 38 | #include <X11/Xutil.h> |
cristy | 3ed852e | 2009-09-05 21:47:34 +0000 | [diff] [blame] | 39 | |
| 40 | #if defined(__cplusplus) || defined(c_plusplus) |
| 41 | # define klass c_class |
| 42 | #else |
| 43 | # define klass class |
| 44 | #endif |
| 45 | |
| 46 | /* |
| 47 | Invoke pre-X11R6 ICCCM routines if XlibSpecificationRelease is not 6. |
| 48 | */ |
| 49 | #if XlibSpecificationRelease < 6 |
| 50 | #if !defined(PRE_R6_ICCCM) |
| 51 | #define PRE_R6_ICCCM |
| 52 | #endif |
| 53 | #endif |
| 54 | /* |
| 55 | Invoke pre-X11R5 ICCCM routines if XlibSpecificationRelease is not defined. |
| 56 | */ |
| 57 | #if !defined(XlibSpecificationRelease) |
| 58 | #define PRE_R5_ICCCM |
| 59 | #endif |
| 60 | /* |
| 61 | Invoke pre-X11R4 ICCCM routines if PWinGravity is not defined. |
| 62 | */ |
| 63 | #if !defined(PWinGravity) |
| 64 | #define PRE_R4_ICCCM |
| 65 | #endif |
| 66 | |
| 67 | #define MaxIconSize 96 |
| 68 | #define MaxNumberPens 11 |
| 69 | #define MaxNumberFonts 11 |
| 70 | #define MaxXWindows 12 |
| 71 | #undef index |
| 72 | |
| 73 | #define ThrowXWindowException(severity,tag,context) \ |
| 74 | { \ |
| 75 | ExceptionInfo \ |
| 76 | exception; \ |
| 77 | \ |
| 78 | GetExceptionInfo(&exception); \ |
| 79 | (void) ThrowMagickException(&exception,GetMagickModule(),severity, \ |
anthony | e5b3965 | 2012-04-21 05:37:29 +0000 | [diff] [blame] | 80 | tag == (const char *) NULL ? "unknown" : tag,"'%s': %s",context, \ |
cristy | 3ed852e | 2009-09-05 21:47:34 +0000 | [diff] [blame] | 81 | strerror(errno)); \ |
| 82 | CatchException(&exception); \ |
| 83 | (void) DestroyExceptionInfo(&exception); \ |
| 84 | } |
| 85 | #define ThrowXWindowFatalException(severity,tag,context) \ |
| 86 | { \ |
| 87 | ThrowXWindowException(severity,tag,context); \ |
| 88 | _exit(1); \ |
| 89 | } |
| 90 | |
| 91 | typedef enum |
| 92 | { |
| 93 | ForegroundStencil, |
| 94 | BackgroundStencil, |
| 95 | OpaqueStencil, |
| 96 | TransparentStencil |
| 97 | } AnnotationStencil; |
| 98 | |
| 99 | typedef enum |
| 100 | { |
| 101 | UndefinedElement, |
| 102 | PointElement, |
| 103 | LineElement, |
| 104 | RectangleElement, |
| 105 | FillRectangleElement, |
| 106 | CircleElement, |
| 107 | FillCircleElement, |
| 108 | EllipseElement, |
| 109 | FillEllipseElement, |
| 110 | PolygonElement, |
| 111 | FillPolygonElement, |
| 112 | ColorElement, |
| 113 | MatteElement, |
| 114 | TextElement, |
| 115 | ImageElement |
| 116 | } ElementType; |
| 117 | |
| 118 | typedef enum |
| 119 | { |
| 120 | UndefinedColormap, |
| 121 | PrivateColormap, |
| 122 | SharedColormap |
| 123 | } XColormapType; |
| 124 | |
| 125 | typedef struct _XDrawInfo |
| 126 | { |
| 127 | int |
| 128 | x, |
| 129 | y; |
| 130 | |
| 131 | unsigned int |
| 132 | width, |
| 133 | height; |
| 134 | |
| 135 | double |
| 136 | degrees; |
| 137 | |
| 138 | AnnotationStencil |
| 139 | stencil; |
| 140 | |
| 141 | ElementType |
| 142 | element; |
| 143 | |
| 144 | Pixmap |
| 145 | stipple; |
| 146 | |
| 147 | unsigned int |
| 148 | line_width; |
| 149 | |
| 150 | XSegment |
| 151 | line_info; |
| 152 | |
| 153 | unsigned int |
| 154 | number_coordinates; |
| 155 | |
| 156 | RectangleInfo |
| 157 | rectangle_info; |
| 158 | |
| 159 | XPoint |
| 160 | *coordinate_info; |
| 161 | |
| 162 | char |
| 163 | geometry[MaxTextExtent]; |
| 164 | } XDrawInfo; |
| 165 | |
| 166 | typedef enum |
| 167 | { |
| 168 | DefaultState = 0x0000, |
| 169 | EscapeState = 0x0001, |
| 170 | ExitState = 0x0002, |
| 171 | FormerImageState = 0x0004, |
| 172 | ModifierState = 0x0008, |
| 173 | MontageImageState = 0x0010, |
| 174 | NextImageState = 0x0020, |
| 175 | RetainColorsState = 0x0040, |
| 176 | SuspendTime = 50, |
| 177 | UpdateConfigurationState = 0x0080, |
| 178 | UpdateRegionState = 0x0100 |
| 179 | } XState; |
| 180 | |
| 181 | typedef struct _XAnnotateInfo |
| 182 | { |
| 183 | int |
| 184 | x, |
| 185 | y; |
| 186 | |
| 187 | unsigned int |
| 188 | width, |
| 189 | height; |
| 190 | |
| 191 | double |
| 192 | degrees; |
| 193 | |
| 194 | XFontStruct |
| 195 | *font_info; |
| 196 | |
| 197 | char |
| 198 | *text; |
| 199 | |
| 200 | AnnotationStencil |
| 201 | stencil; |
| 202 | |
| 203 | char |
| 204 | geometry[MaxTextExtent]; |
| 205 | |
| 206 | struct _XAnnotateInfo |
| 207 | *next, |
| 208 | *previous; |
| 209 | } XAnnotateInfo; |
| 210 | |
| 211 | typedef struct _XPixelInfo |
| 212 | { |
cristy | f2faecf | 2010-05-28 19:19:36 +0000 | [diff] [blame] | 213 | ssize_t |
| 214 | colors; |
| 215 | |
| 216 | unsigned long |
cristy | 3ed852e | 2009-09-05 21:47:34 +0000 | [diff] [blame] | 217 | *pixels; |
| 218 | |
| 219 | XColor |
| 220 | foreground_color, |
| 221 | background_color, |
| 222 | border_color, |
| 223 | matte_color, |
| 224 | highlight_color, |
| 225 | shadow_color, |
| 226 | depth_color, |
| 227 | trough_color, |
| 228 | box_color, |
| 229 | pen_color, |
| 230 | pen_colors[MaxNumberPens]; |
| 231 | |
| 232 | GC |
| 233 | annotate_context, |
| 234 | highlight_context, |
| 235 | widget_context; |
| 236 | |
| 237 | unsigned short |
| 238 | box_index, |
| 239 | pen_index; |
| 240 | } XPixelInfo; |
| 241 | |
cristy | e3099b7 | 2011-09-08 18:21:13 +0000 | [diff] [blame] | 242 | typedef struct _XResourceInfo |
cristy | 3ed852e | 2009-09-05 21:47:34 +0000 | [diff] [blame] | 243 | { |
| 244 | XrmDatabase |
| 245 | resource_database; |
| 246 | |
| 247 | ImageInfo |
| 248 | *image_info; |
| 249 | |
| 250 | QuantizeInfo |
| 251 | *quantize_info; |
| 252 | |
cristy | bb50337 | 2010-05-27 20:51:26 +0000 | [diff] [blame] | 253 | size_t |
cristy | 3ed852e | 2009-09-05 21:47:34 +0000 | [diff] [blame] | 254 | colors; |
| 255 | |
| 256 | MagickBooleanType |
| 257 | close_server, |
| 258 | backdrop; |
| 259 | |
| 260 | char |
| 261 | *background_color, |
| 262 | *border_color; |
| 263 | |
| 264 | char |
| 265 | *client_name; |
| 266 | |
| 267 | XColormapType |
| 268 | colormap; |
| 269 | |
| 270 | unsigned int |
| 271 | border_width; |
| 272 | |
cristy | bb50337 | 2010-05-27 20:51:26 +0000 | [diff] [blame] | 273 | size_t |
cristy | 3ed852e | 2009-09-05 21:47:34 +0000 | [diff] [blame] | 274 | delay; |
| 275 | |
| 276 | MagickBooleanType |
| 277 | color_recovery, |
| 278 | confirm_exit, |
| 279 | confirm_edit; |
| 280 | |
| 281 | char |
| 282 | *display_gamma; |
| 283 | |
| 284 | char |
| 285 | *font, |
| 286 | *font_name[MaxNumberFonts], |
| 287 | *foreground_color; |
| 288 | |
| 289 | MagickBooleanType |
| 290 | display_warnings, |
| 291 | gamma_correct; |
| 292 | |
| 293 | char |
| 294 | *icon_geometry; |
| 295 | |
| 296 | MagickBooleanType |
| 297 | iconic, |
| 298 | immutable; |
| 299 | |
| 300 | char |
| 301 | *image_geometry; |
| 302 | |
| 303 | char |
| 304 | *map_type, |
| 305 | *matte_color, |
| 306 | *name; |
| 307 | |
| 308 | unsigned int |
| 309 | magnify, |
| 310 | pause; |
| 311 | |
| 312 | char |
| 313 | *pen_colors[MaxNumberPens]; |
| 314 | |
| 315 | char |
| 316 | *text_font, |
| 317 | *title; |
| 318 | |
| 319 | int |
| 320 | quantum; |
| 321 | |
| 322 | unsigned int |
| 323 | update; |
| 324 | |
| 325 | MagickBooleanType |
| 326 | use_pixmap, |
| 327 | use_shared_memory; |
| 328 | |
cristy | bb50337 | 2010-05-27 20:51:26 +0000 | [diff] [blame] | 329 | size_t |
cristy | 3ed852e | 2009-09-05 21:47:34 +0000 | [diff] [blame] | 330 | undo_cache; |
| 331 | |
| 332 | char |
| 333 | *visual_type, |
| 334 | *window_group, |
| 335 | *window_id, |
| 336 | *write_filename; |
| 337 | |
| 338 | Image |
| 339 | *copy_image; |
| 340 | |
| 341 | int |
| 342 | gravity; |
| 343 | |
| 344 | char |
| 345 | home_directory[MaxTextExtent]; |
cristy | e3099b7 | 2011-09-08 18:21:13 +0000 | [diff] [blame] | 346 | } XResourceInfo; |
cristy | 3ed852e | 2009-09-05 21:47:34 +0000 | [diff] [blame] | 347 | |
| 348 | typedef struct _XWindowInfo |
| 349 | { |
| 350 | Window |
| 351 | id; |
| 352 | |
| 353 | Window |
| 354 | root; |
| 355 | |
| 356 | Visual |
| 357 | *visual; |
| 358 | |
| 359 | unsigned int |
| 360 | storage_class, |
| 361 | depth; |
| 362 | |
| 363 | XVisualInfo |
| 364 | *visual_info; |
| 365 | |
| 366 | XStandardColormap |
| 367 | *map_info; |
| 368 | |
| 369 | XPixelInfo |
| 370 | *pixel_info; |
| 371 | |
| 372 | XFontStruct |
| 373 | *font_info; |
| 374 | |
| 375 | GC |
| 376 | annotate_context, |
| 377 | highlight_context, |
| 378 | widget_context; |
| 379 | |
| 380 | Cursor |
| 381 | cursor, |
| 382 | busy_cursor; |
| 383 | |
| 384 | char |
| 385 | *name, |
| 386 | *geometry, |
| 387 | *icon_name, |
| 388 | *icon_geometry, |
| 389 | *crop_geometry; |
| 390 | |
cristy | bb50337 | 2010-05-27 20:51:26 +0000 | [diff] [blame] | 391 | size_t |
cristy | 3ed852e | 2009-09-05 21:47:34 +0000 | [diff] [blame] | 392 | data, |
| 393 | flags; |
| 394 | |
| 395 | int |
| 396 | x, |
| 397 | y; |
| 398 | |
| 399 | unsigned int |
| 400 | width, |
| 401 | height, |
| 402 | min_width, |
| 403 | min_height, |
| 404 | width_inc, |
| 405 | height_inc, |
| 406 | border_width; |
| 407 | |
| 408 | MagickBooleanType |
| 409 | use_pixmap, |
| 410 | immutable, |
| 411 | shape, |
| 412 | shared_memory; |
| 413 | |
| 414 | int |
| 415 | screen; |
| 416 | |
| 417 | XImage |
| 418 | *ximage, |
| 419 | *matte_image; |
| 420 | |
| 421 | Pixmap |
| 422 | highlight_stipple, |
| 423 | shadow_stipple, |
| 424 | pixmap, |
| 425 | *pixmaps, |
| 426 | matte_pixmap, |
| 427 | *matte_pixmaps; |
| 428 | |
| 429 | XSetWindowAttributes |
| 430 | attributes; |
| 431 | |
| 432 | XWindowChanges |
| 433 | window_changes; |
| 434 | |
| 435 | void |
| 436 | *segment_info; |
| 437 | |
cristy | 8891f9c | 2010-06-04 23:32:17 +0000 | [diff] [blame] | 438 | long |
cristy | 3ed852e | 2009-09-05 21:47:34 +0000 | [diff] [blame] | 439 | mask; |
| 440 | |
| 441 | MagickBooleanType |
| 442 | orphan, |
| 443 | mapped, |
| 444 | stasis; |
| 445 | |
| 446 | Image |
| 447 | *image; |
| 448 | |
| 449 | MagickBooleanType |
| 450 | destroy; |
| 451 | } XWindowInfo; |
| 452 | |
| 453 | typedef struct _XWindows |
| 454 | { |
| 455 | Display |
| 456 | *display; |
| 457 | |
| 458 | XStandardColormap |
| 459 | *map_info, |
| 460 | *icon_map; |
| 461 | |
| 462 | XVisualInfo |
| 463 | *visual_info, |
| 464 | *icon_visual; |
| 465 | |
| 466 | XPixelInfo |
| 467 | *pixel_info, |
| 468 | *icon_pixel; |
| 469 | |
| 470 | XFontStruct |
| 471 | *font_info; |
| 472 | |
| 473 | XResourceInfo |
| 474 | *icon_resources; |
| 475 | |
| 476 | XClassHint |
| 477 | *class_hints; |
| 478 | |
| 479 | XWMHints |
| 480 | *manager_hints; |
| 481 | |
| 482 | XWindowInfo |
| 483 | context, |
| 484 | group_leader, |
| 485 | backdrop, |
| 486 | icon, |
| 487 | image, |
| 488 | info, |
| 489 | magnify, |
| 490 | pan, |
| 491 | command, |
| 492 | widget, |
| 493 | popup; |
| 494 | |
| 495 | Atom |
| 496 | wm_protocols, |
| 497 | wm_delete_window, |
| 498 | wm_take_focus, |
| 499 | im_protocols, |
| 500 | im_remote_command, |
| 501 | im_update_widget, |
| 502 | im_update_colormap, |
| 503 | im_former_image, |
| 504 | im_retain_colors, |
| 505 | im_next_image, |
| 506 | im_exit, |
| 507 | dnd_protocols; |
| 508 | } XWindows; |
| 509 | |
cristy | bcbda3f | 2011-09-03 13:01:22 +0000 | [diff] [blame] | 510 | extern MagickPrivate Cursor |
cristy | 3ed852e | 2009-09-05 21:47:34 +0000 | [diff] [blame] | 511 | XMakeCursor(Display *,Window,Colormap,char *,char *); |
| 512 | |
cristy | bcbda3f | 2011-09-03 13:01:22 +0000 | [diff] [blame] | 513 | extern MagickPrivate int |
| 514 | XCheckDefineCursor(Display *,Window,Cursor); |
cristy | 3ed852e | 2009-09-05 21:47:34 +0000 | [diff] [blame] | 515 | |
cristy | bcbda3f | 2011-09-03 13:01:22 +0000 | [diff] [blame] | 516 | extern MagickPrivate MagickBooleanType |
cristy | 7c3af95 | 2011-10-20 16:04:16 +0000 | [diff] [blame] | 517 | XAnnotateImage(Display *,const XPixelInfo *,XAnnotateInfo *,Image *, |
| 518 | ExceptionInfo *), |
cristy | bcbda3f | 2011-09-03 13:01:22 +0000 | [diff] [blame] | 519 | XComponentGenesis(void), |
cristy | 6710d84 | 2011-10-20 23:23:00 +0000 | [diff] [blame] | 520 | XDrawImage(Display *,const XPixelInfo *,XDrawInfo *,Image *,ExceptionInfo *), |
| 521 | XGetWindowColor(Display *,XWindows *,char *,ExceptionInfo *), |
cristy | 3ed852e | 2009-09-05 21:47:34 +0000 | [diff] [blame] | 522 | XMagickProgressMonitor(const char *,const MagickOffsetType, |
| 523 | const MagickSizeType,void *), |
| 524 | XMakeImage(Display *,const XResourceInfo *,XWindowInfo *,Image *,unsigned int, |
cristy | 051718b | 2011-08-28 22:49:25 +0000 | [diff] [blame] | 525 | unsigned int,ExceptionInfo *), |
cristy | 1ffe998 | 2013-04-13 16:46:51 +0000 | [diff] [blame^] | 526 | XQueryColorCompliance(const char *,XColor *); |
cristy | 3ed852e | 2009-09-05 21:47:34 +0000 | [diff] [blame] | 527 | |
cristy | bcbda3f | 2011-09-03 13:01:22 +0000 | [diff] [blame] | 528 | extern MagickPrivate void |
cristy | 3ed852e | 2009-09-05 21:47:34 +0000 | [diff] [blame] | 529 | XBestIconSize(Display *,XWindowInfo *,Image *), |
| 530 | XBestPixel(Display *,const Colormap,XColor *,unsigned int,XColor *), |
| 531 | XCheckRefreshWindows(Display *,XWindows *), |
| 532 | XClientMessage(Display *,const Window,const Atom,const Atom,const Time), |
cristy | bcbda3f | 2011-09-03 13:01:22 +0000 | [diff] [blame] | 533 | XComponentTerminus(void), |
cristy | 6710d84 | 2011-10-20 23:23:00 +0000 | [diff] [blame] | 534 | XConfigureImageColormap(Display *,XResourceInfo *,XWindows *,Image *, |
| 535 | ExceptionInfo *), |
cristy | 3ed852e | 2009-09-05 21:47:34 +0000 | [diff] [blame] | 536 | XConstrainWindowPosition(Display *,XWindowInfo *), |
cristy | bb50337 | 2010-05-27 20:51:26 +0000 | [diff] [blame] | 537 | XDelay(Display *,const size_t), |
cristy | 6710d84 | 2011-10-20 23:23:00 +0000 | [diff] [blame] | 538 | XDisplayImageInfo(Display *,const XResourceInfo *,XWindows *,Image *,Image *, |
| 539 | ExceptionInfo *), |
cristy | 3ed852e | 2009-09-05 21:47:34 +0000 | [diff] [blame] | 540 | XDestroyWindowColors(Display *,Window), |
cristy | 3ed852e | 2009-09-05 21:47:34 +0000 | [diff] [blame] | 541 | XFreeResources(Display *,XVisualInfo *,XStandardColormap *,XPixelInfo *, |
| 542 | XFontStruct *,XResourceInfo *,XWindowInfo *), |
| 543 | XFreeStandardColormap(Display *,const XVisualInfo *,XStandardColormap *, |
| 544 | XPixelInfo *), |
| 545 | XHighlightEllipse(Display *,Window,GC,const RectangleInfo *), |
| 546 | XHighlightLine(Display *,Window,GC,const XSegment *), |
| 547 | XHighlightRectangle(Display *,Window,GC,const RectangleInfo *), |
| 548 | XGetAnnotateInfo(XAnnotateInfo *), |
cristy | 4c08aed | 2011-07-01 19:47:50 +0000 | [diff] [blame] | 549 | XGetPixelInfo(Display *,const XVisualInfo *,const XStandardColormap *, |
cristy | 3ed852e | 2009-09-05 21:47:34 +0000 | [diff] [blame] | 550 | const XResourceInfo *,Image *,XPixelInfo *), |
| 551 | XGetMapInfo(const XVisualInfo *,const Colormap,XStandardColormap *), |
cristy | 3ed852e | 2009-09-05 21:47:34 +0000 | [diff] [blame] | 552 | XGetWindowInfo(Display *,XVisualInfo *,XStandardColormap *,XPixelInfo *, |
| 553 | XFontStruct *,XResourceInfo *,XWindowInfo *), |
cristy | 6710d84 | 2011-10-20 23:23:00 +0000 | [diff] [blame] | 554 | XMakeMagnifyImage(Display *,XWindows *,ExceptionInfo *), |
cristy | 3ed852e | 2009-09-05 21:47:34 +0000 | [diff] [blame] | 555 | XMakeStandardColormap(Display *,XVisualInfo *,XResourceInfo *,Image *, |
cristy | 6710d84 | 2011-10-20 23:23:00 +0000 | [diff] [blame] | 556 | XStandardColormap *,XPixelInfo *,ExceptionInfo *), |
cristy | 3ed852e | 2009-09-05 21:47:34 +0000 | [diff] [blame] | 557 | XMakeWindow(Display *,Window,char **,int,XClassHint *,XWMHints *, |
| 558 | XWindowInfo *), |
| 559 | XQueryPosition(Display *,const Window,int *,int *), |
| 560 | XRefreshWindow(Display *,const XWindowInfo *,const XEvent *), |
cristy | 3ed852e | 2009-09-05 21:47:34 +0000 | [diff] [blame] | 561 | XSetCursorState(Display *,XWindows *,const MagickStatusType), |
| 562 | XUserPreferences(XResourceInfo *), |
| 563 | XWarning(const ExceptionType,const char *,const char *); |
| 564 | |
cristy | bcbda3f | 2011-09-03 13:01:22 +0000 | [diff] [blame] | 565 | extern MagickPrivate Window |
cristy | bb50337 | 2010-05-27 20:51:26 +0000 | [diff] [blame] | 566 | XWindowByID(Display *,const Window,const size_t), |
cristy | 3ed852e | 2009-09-05 21:47:34 +0000 | [diff] [blame] | 567 | XWindowByName(Display *,const Window,const char *), |
| 568 | XWindowByProperty(Display *,const Window,const Atom); |
| 569 | |
cristy | bcbda3f | 2011-09-03 13:01:22 +0000 | [diff] [blame] | 570 | extern MagickPrivate XFontStruct |
cristy | 3ed852e | 2009-09-05 21:47:34 +0000 | [diff] [blame] | 571 | *XBestFont(Display *,const XResourceInfo *,const MagickBooleanType); |
| 572 | |
cristy | bcbda3f | 2011-09-03 13:01:22 +0000 | [diff] [blame] | 573 | extern MagickPrivate XVisualInfo |
cristy | 3ed852e | 2009-09-05 21:47:34 +0000 | [diff] [blame] | 574 | *XBestVisualInfo(Display *,XStandardColormap *,XResourceInfo *); |
| 575 | |
cristy | bcbda3f | 2011-09-03 13:01:22 +0000 | [diff] [blame] | 576 | extern MagickPrivate XWindows |
cristy | 3ed852e | 2009-09-05 21:47:34 +0000 | [diff] [blame] | 577 | *XInitializeWindows(Display *,XResourceInfo *), |
| 578 | *XSetWindows(XWindows *); |
| 579 | |
cristy | e3099b7 | 2011-09-08 18:21:13 +0000 | [diff] [blame] | 580 | extern MagickExport char |
| 581 | *XGetResourceClass(XrmDatabase,const char *,const char *,char *), |
| 582 | *XGetResourceInstance(XrmDatabase,const char *,const char *,const char *), |
| 583 | *XGetScreenDensity(Display *); |
| 584 | |
| 585 | extern MagickExport int |
| 586 | XError(Display *,XErrorEvent *); |
| 587 | |
| 588 | extern MagickExport MagickBooleanType |
| 589 | XRemoteCommand(Display *,const char *,const char *); |
| 590 | |
| 591 | extern MagickExport void |
| 592 | DestroyXResources(void), |
| 593 | XDestroyResourceInfo(XResourceInfo *), |
| 594 | XGetResourceInfo(const ImageInfo *,XrmDatabase,const char *,XResourceInfo *), |
| 595 | XRetainWindowColors(Display *,const Window); |
| 596 | |
| 597 | extern MagickExport XrmDatabase |
| 598 | XGetResourceDatabase(Display *,const char *); |
| 599 | |
cristy | a19f1d7 | 2012-08-07 18:24:38 +0000 | [diff] [blame] | 600 | static inline double XPixelIntensity(const XColor *pixel) |
cristy | 3ed852e | 2009-09-05 21:47:34 +0000 | [diff] [blame] | 601 | { |
cristy | d7027ca | 2012-06-16 00:41:11 +0000 | [diff] [blame] | 602 | double |
| 603 | blue, |
| 604 | green, |
| 605 | red; |
| 606 | |
cristy | c8aff84 | 2012-12-24 16:59:46 +0000 | [diff] [blame] | 607 | red=DecodePixelGamma((MagickRealType) pixel->red); |
| 608 | green=DecodePixelGamma((MagickRealType) pixel->green); |
| 609 | blue=DecodePixelGamma((MagickRealType) pixel->blue); |
cristy | a86a5cb | 2012-10-14 13:40:33 +0000 | [diff] [blame] | 610 | return(0.298839f*red+0.586811f*green+0.114350f*blue); |
cristy | 3ed852e | 2009-09-05 21:47:34 +0000 | [diff] [blame] | 611 | } |
| 612 | |
| 613 | #endif |
| 614 | |
cristy | 1ffe998 | 2013-04-13 16:46:51 +0000 | [diff] [blame^] | 615 | extern MagickPrivate MagickBooleanType |
| 616 | XRenderImage(Image *,const DrawInfo *,const PointInfo *,TypeMetric *, |
| 617 | ExceptionInfo *); |
| 618 | |
cristy | 3ed852e | 2009-09-05 21:47:34 +0000 | [diff] [blame] | 619 | #if defined(__cplusplus) || defined(c_plusplus) |
| 620 | } |
| 621 | #endif |
| 622 | |
| 623 | #endif |