dwimg.h 2.2 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475
  1. /* Copyright (C) 1996, 2001, Ghostgum Software Pty Ltd. All rights reserved.
  2. This file is part of AFPL Ghostscript.
  3. AFPL Ghostscript is distributed with NO WARRANTY OF ANY KIND. No author or
  4. distributor accepts any responsibility for the consequences of using it, or
  5. for whether it serves any particular purpose or works at all, unless he or
  6. she says so in writing. Refer to the Aladdin Free Public License (the
  7. "License") for full details.
  8. Every copy of AFPL Ghostscript must include a copy of the License, normally
  9. in a plain ASCII text file named PUBLIC. The License grants you the right
  10. to copy, modify and redistribute AFPL Ghostscript, but only under certain
  11. conditions described in the License. Among other things, the License
  12. requires that the copyright notice and this notice be preserved on all
  13. copies.
  14. */
  15. /* $Id: dwimg.h,v 1.4 2001/08/01 09:50:36 ghostgum Exp $ */
  16. /* Windows Image Window structure */
  17. typedef struct IMAGE_S IMAGE;
  18. struct IMAGE_S {
  19. void *handle;
  20. void *device;
  21. HWND hwnd;
  22. HBRUSH hBrush; /* background */
  23. int raster;
  24. unsigned int format;
  25. unsigned char *image;
  26. BITMAPINFOHEADER bmih;
  27. HPALETTE palette;
  28. int bytewidth;
  29. int sep; /* CMYK separations to display */
  30. /* periodic redrawing */
  31. SYSTEMTIME update_time;
  32. int update_interval;
  33. /* Window scrolling stuff */
  34. int cxClient, cyClient;
  35. int cxAdjust, cyAdjust;
  36. int nVscrollPos, nVscrollMax;
  37. int nHscrollPos, nHscrollMax;
  38. /* thread synchronisation */
  39. HANDLE hmutex;
  40. IMAGE *next;
  41. HWND hwndtext; /* handle to text window */
  42. int x, y, cx, cy; /* window position */
  43. };
  44. extern IMAGE *first_image;
  45. /* Main thread only */
  46. IMAGE *image_find(void *handle, void *device);
  47. IMAGE *image_new(void *handle, void *device);
  48. void image_delete(IMAGE *img);
  49. int image_size(IMAGE *img, int new_width, int new_height, int new_raster,
  50. unsigned int new_format, void *pimage);
  51. /* GUI thread only */
  52. void image_open(IMAGE *img);
  53. void image_close(IMAGE *img);
  54. void image_sync(IMAGE *img);
  55. void image_page(IMAGE *img);
  56. void image_presize(IMAGE *img, int new_width, int new_height, int new_raster,
  57. unsigned int new_format);
  58. void image_poll(IMAGE *img);