XEmacs 21.2.7
[chise/xemacs-chise.git.1] / src / glyphs-msw.h
1 /* mswindows-specific glyphs and related.
2    Copyright (C) 1998 Andy Piper
3
4 This file is part of XEmacs.
5
6 XEmacs is free software; you can redistribute it and/or modify it
7 under the terms of the GNU General Public License as published by the
8 Free Software Foundation; either version 2, or (at your option) any
9 later version.
10
11 XEmacs is distributed in the hope that it will be useful, but WITHOUT
12 ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
13 FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
14 for more details.
15
16 You should have received a copy of the GNU General Public License
17 along with XEmacs; see the file COPYING.  If not, write to
18 the Free Software Foundation, Inc., 59 Temple Place - Suite 330,
19 Boston, MA 02111-1307, USA.  */
20
21 /* Synched up with:  Not in FSF. */
22
23 #ifndef _XEMACS_GLYPHS_MSW_H_
24 #define _XEMACS_GLYPHS_MSW_H_
25
26 #ifdef HAVE_MS_WINDOWS
27
28 #include <windows.h>
29 #include "glyphs.h"
30
31 /****************************************************************************
32  *                         Image-Instance Object                            *
33  ****************************************************************************/
34
35 struct mswindows_image_instance_data
36 {
37   HBITMAP bitmap;
38   HBITMAP mask;
39   HICON icon;
40 };
41
42 #define MSWINDOWS_IMAGE_INSTANCE_DATA(i) \
43 ((struct mswindows_image_instance_data *) (i)->data)
44
45 #define IMAGE_INSTANCE_MSWINDOWS_BITMAP(i) \
46      (MSWINDOWS_IMAGE_INSTANCE_DATA (i)->bitmap)
47 #define IMAGE_INSTANCE_MSWINDOWS_MASK(i) \
48      (MSWINDOWS_IMAGE_INSTANCE_DATA (i)->mask)
49 #define IMAGE_INSTANCE_MSWINDOWS_ICON(i) \
50      (MSWINDOWS_IMAGE_INSTANCE_DATA (i)->icon)
51
52 #define XIMAGE_INSTANCE_MSWINDOWS_BITMAP(i) \
53   IMAGE_INSTANCE_MSWINDOWS_BITMAP (XIMAGE_INSTANCE (i))
54 #define XIMAGE_INSTANCE_MSWINDOWS_MASK(i) \
55   IMAGE_INSTANCE_MSWINDOWS_MASK (XIMAGE_INSTANCE (i))
56 #define XIMAGE_INSTANCE_MSWINDOWS_ICON(i) \
57   IMAGE_INSTANCE_MSWINDOWS_ICON (XIMAGE_INSTANCE (i))
58
59 int
60 mswindows_resize_dibitmap_instance (struct Lisp_Image_Instance* ii,
61                                     struct frame* f,
62                                     int newx, int newy);
63 HBITMAP
64 mswindows_create_resized_bitmap (struct Lisp_Image_Instance* ii,
65                                  struct frame* f,
66                                  int newx, int newy);
67 HBITMAP
68 mswindows_create_resized_mask (struct Lisp_Image_Instance* ii,
69                                struct frame* f,
70                                int newx, int newy);
71 void
72 mswindows_initialize_image_instance_icon (struct Lisp_Image_Instance* image,
73                                           int cursor);
74
75 #define WIDGET_INSTANCE_MSWINDOWS_HANDLE(i) \
76      (HWND) (IMAGE_INSTANCE_SUBWINDOW_ID (i))
77
78 #define XWIDGET_INSTANCE_MSWINDOWS_HANDLE(i) \
79   WIDGET_INSTANCE_MSWINDOWS_HANDLE (XIMAGE_INSTANCE (i))
80
81 #endif /* HAVE_MS_WINDOWS */
82 #endif /* _XEMACS_GLYPHS_MSW_H_ */