diff options
| author | Alexander Gramiak | 2019-05-09 17:48:55 -0600 |
|---|---|---|
| committer | Alexander Gramiak | 2019-05-19 19:50:32 -0600 |
| commit | 44d577925e0f5679d417028799db47a1f5d0fd03 (patch) | |
| tree | 15abf340cede68d6b867804459cf06999c22b821 /src | |
| parent | 06db2a052fb7335185e8d581d245ce214b3bba7c (diff) | |
| download | emacs-44d577925e0f5679d417028799db47a1f5d0fd03.tar.gz emacs-44d577925e0f5679d417028799db47a1f5d0fd03.zip | |
Introduce Emacs_Pixmap typedef
* src/dispextern.h [HAVE_X_WINDOWS]: Alias Emacs_Pixmap to Pixmap.
(image, x_kill_gs_process): Use Emacs_Pixmap over Pixmap.
* src/image.c:
* src/nsgui.h:
* src/nsterm.m:
* src/termhooks.h:
* src/w32gui.h:
* src/w32term.c:
* src/w32term.h:
* src/xterm.c (x_free_pixmap): Use Emacs_Pixmap over Pixmap.
* src/w32gui.h: Remove unused typedef Bitmap.
Diffstat (limited to 'src')
| -rw-r--r-- | src/dispextern.h | 7 | ||||
| -rw-r--r-- | src/image.c | 20 | ||||
| -rw-r--r-- | src/nsgui.h | 4 | ||||
| -rw-r--r-- | src/nsterm.m | 2 | ||||
| -rw-r--r-- | src/termhooks.h | 2 | ||||
| -rw-r--r-- | src/w32gui.h | 3 | ||||
| -rw-r--r-- | src/w32term.c | 2 | ||||
| -rw-r--r-- | src/w32term.h | 2 | ||||
| -rw-r--r-- | src/xterm.c | 2 |
9 files changed, 23 insertions, 21 deletions
diff --git a/src/dispextern.h b/src/dispextern.h index 0acd03c0490..eecf95b54fb 100644 --- a/src/dispextern.h +++ b/src/dispextern.h | |||
| @@ -38,6 +38,7 @@ along with GNU Emacs. If not, see <https://www.gnu.org/licenses/>. */ | |||
| 38 | typedef XColor Emacs_Color; | 38 | typedef XColor Emacs_Color; |
| 39 | typedef Cursor Emacs_Cursor; | 39 | typedef Cursor Emacs_Cursor; |
| 40 | #define No_Cursor (None) | 40 | #define No_Cursor (None) |
| 41 | typedef Pixmap Emacs_Pixmap; | ||
| 41 | 42 | ||
| 42 | #else /* !HAVE_X_WINDOWS */ | 43 | #else /* !HAVE_X_WINDOWS */ |
| 43 | 44 | ||
| @@ -86,7 +87,7 @@ typedef HDC XImagePtr_or_DC; | |||
| 86 | #define FACE_COLOR_TO_PIXEL(face_color, frame) ns_color_index_to_rgba(face_color, frame) | 87 | #define FACE_COLOR_TO_PIXEL(face_color, frame) ns_color_index_to_rgba(face_color, frame) |
| 87 | /* Following typedef needed to accommodate the MSDOS port, believe it or not. */ | 88 | /* Following typedef needed to accommodate the MSDOS port, believe it or not. */ |
| 88 | typedef struct ns_display_info Display_Info; | 89 | typedef struct ns_display_info Display_Info; |
| 89 | typedef Pixmap XImagePtr; | 90 | typedef Emacs_Pixmap XImagePtr; |
| 90 | typedef XImagePtr XImagePtr_or_DC; | 91 | typedef XImagePtr XImagePtr_or_DC; |
| 91 | #else | 92 | #else |
| 92 | #define FACE_COLOR_TO_PIXEL(face_color, frame) face_color | 93 | #define FACE_COLOR_TO_PIXEL(face_color, frame) face_color |
| @@ -2960,7 +2961,7 @@ struct image | |||
| 2960 | struct timespec timestamp; | 2961 | struct timespec timestamp; |
| 2961 | 2962 | ||
| 2962 | /* Pixmaps of the image. */ | 2963 | /* Pixmaps of the image. */ |
| 2963 | Pixmap pixmap, mask; | 2964 | Emacs_Pixmap pixmap, mask; |
| 2964 | 2965 | ||
| 2965 | #ifdef USE_CAIRO | 2966 | #ifdef USE_CAIRO |
| 2966 | void *cr_data; | 2967 | void *cr_data; |
| @@ -3371,7 +3372,7 @@ extern void x_create_bitmap_mask (struct frame *, ptrdiff_t); | |||
| 3371 | #endif | 3372 | #endif |
| 3372 | extern Lisp_Object image_find_image_file (Lisp_Object); | 3373 | extern Lisp_Object image_find_image_file (Lisp_Object); |
| 3373 | 3374 | ||
| 3374 | void x_kill_gs_process (Pixmap, struct frame *); | 3375 | void x_kill_gs_process (Emacs_Pixmap, struct frame *); |
| 3375 | struct image_cache *make_image_cache (void); | 3376 | struct image_cache *make_image_cache (void); |
| 3376 | void free_image_cache (struct frame *); | 3377 | void free_image_cache (struct frame *); |
| 3377 | void clear_image_caches (Lisp_Object); | 3378 | void clear_image_caches (Lisp_Object); |
diff --git a/src/image.c b/src/image.c index c768ece9786..8e57444bb04 100644 --- a/src/image.c +++ b/src/image.c | |||
| @@ -228,7 +228,7 @@ image_create_bitmap_from_data (struct frame *f, char *bits, | |||
| 228 | 228 | ||
| 229 | #ifdef HAVE_NTGUI | 229 | #ifdef HAVE_NTGUI |
| 230 | Lisp_Object frame UNINIT; /* The value is not used. */ | 230 | Lisp_Object frame UNINIT; /* The value is not used. */ |
| 231 | Pixmap bitmap; | 231 | Emacs_Pixmap bitmap; |
| 232 | bitmap = CreateBitmap (width, height, | 232 | bitmap = CreateBitmap (width, height, |
| 233 | FRAME_DISPLAY_INFO (XFRAME (frame))->n_planes, | 233 | FRAME_DISPLAY_INFO (XFRAME (frame))->n_planes, |
| 234 | FRAME_DISPLAY_INFO (XFRAME (frame))->n_cbits, | 234 | FRAME_DISPLAY_INFO (XFRAME (frame))->n_cbits, |
| @@ -412,7 +412,8 @@ typedef void Picture; | |||
| 412 | #endif | 412 | #endif |
| 413 | 413 | ||
| 414 | static bool image_create_x_image_and_pixmap_1 (struct frame *, int, int, int, | 414 | static bool image_create_x_image_and_pixmap_1 (struct frame *, int, int, int, |
| 415 | XImagePtr *, Pixmap *, Picture *); | 415 | XImagePtr *, Emacs_Pixmap *, |
| 416 | Picture *); | ||
| 416 | static void image_destroy_x_image (XImagePtr ximg); | 417 | static void image_destroy_x_image (XImagePtr ximg); |
| 417 | 418 | ||
| 418 | #ifdef HAVE_NTGUI | 419 | #ifdef HAVE_NTGUI |
| @@ -2036,17 +2037,18 @@ image_check_image_size (XImagePtr ximg, int width, int height) | |||
| 2036 | } | 2037 | } |
| 2037 | 2038 | ||
| 2038 | /* Create an XImage and a pixmap of size WIDTH x HEIGHT for use on | 2039 | /* Create an XImage and a pixmap of size WIDTH x HEIGHT for use on |
| 2039 | frame F. Set *XIMG and *PIXMAP to the XImage and Pixmap created. | 2040 | frame F. Set *XIMG and *PIXMAP to the XImage and Emacs_Pixmap |
| 2040 | Set (*XIMG)->data to a raster of WIDTH x HEIGHT pixels allocated | 2041 | created. Set (*XIMG)->data to a raster of WIDTH x HEIGHT pixels |
| 2041 | via xmalloc. Print error messages via image_error if an error | 2042 | allocated via xmalloc. Print error messages via image_error if an |
| 2042 | occurs. Value is true if successful. | 2043 | error occurs. Value is true if successful. |
| 2043 | 2044 | ||
| 2044 | On W32, a DEPTH of zero signifies a 24 bit image, otherwise DEPTH | 2045 | On W32, a DEPTH of zero signifies a 24 bit image, otherwise DEPTH |
| 2045 | should indicate the bit depth of the image. */ | 2046 | should indicate the bit depth of the image. */ |
| 2046 | 2047 | ||
| 2047 | static bool | 2048 | static bool |
| 2048 | image_create_x_image_and_pixmap_1 (struct frame *f, int width, int height, int depth, | 2049 | image_create_x_image_and_pixmap_1 (struct frame *f, int width, int height, int depth, |
| 2049 | XImagePtr *ximg, Pixmap *pixmap, Picture *picture) | 2050 | XImagePtr *ximg, Emacs_Pixmap *pixmap, |
| 2051 | Picture *picture) | ||
| 2050 | { | 2052 | { |
| 2051 | #ifdef HAVE_X_WINDOWS | 2053 | #ifdef HAVE_X_WINDOWS |
| 2052 | Display *display = FRAME_X_DISPLAY (f); | 2054 | Display *display = FRAME_X_DISPLAY (f); |
| @@ -2256,7 +2258,7 @@ image_destroy_x_image (XImagePtr ximg) | |||
| 2256 | are width and height of both the image and pixmap. */ | 2258 | are width and height of both the image and pixmap. */ |
| 2257 | 2259 | ||
| 2258 | static void | 2260 | static void |
| 2259 | gui_put_x_image (struct frame *f, XImagePtr ximg, Pixmap pixmap, | 2261 | gui_put_x_image (struct frame *f, XImagePtr ximg, Emacs_Pixmap pixmap, |
| 2260 | int width, int height) | 2262 | int width, int height) |
| 2261 | { | 2263 | { |
| 2262 | #ifdef HAVE_X_WINDOWS | 2264 | #ifdef HAVE_X_WINDOWS |
| @@ -9539,7 +9541,7 @@ gs_load (struct frame *f, struct image *img) | |||
| 9539 | telling Emacs that Ghostscript has finished drawing. */ | 9541 | telling Emacs that Ghostscript has finished drawing. */ |
| 9540 | 9542 | ||
| 9541 | void | 9543 | void |
| 9542 | x_kill_gs_process (Pixmap pixmap, struct frame *f) | 9544 | x_kill_gs_process (Emacs_Pixmap pixmap, struct frame *f) |
| 9543 | { | 9545 | { |
| 9544 | struct image_cache *c = FRAME_IMAGE_CACHE (f); | 9546 | struct image_cache *c = FRAME_IMAGE_CACHE (f); |
| 9545 | ptrdiff_t i; | 9547 | ptrdiff_t i; |
diff --git a/src/nsgui.h b/src/nsgui.h index 1a0453fa4a4..c6f0f4b0eae 100644 --- a/src/nsgui.h +++ b/src/nsgui.h | |||
| @@ -96,9 +96,9 @@ typedef XGCValues * GC; | |||
| 96 | #define GCFont 0x03 | 96 | #define GCFont 0x03 |
| 97 | 97 | ||
| 98 | #ifdef __OBJC__ | 98 | #ifdef __OBJC__ |
| 99 | typedef id Pixmap; | 99 | typedef id Emacs_Pixmap; |
| 100 | #else | 100 | #else |
| 101 | typedef void *Pixmap; | 101 | typedef void *Emacs_Pixmap; |
| 102 | #endif | 102 | #endif |
| 103 | 103 | ||
| 104 | #ifdef __OBJC__ | 104 | #ifdef __OBJC__ |
diff --git a/src/nsterm.m b/src/nsterm.m index 82a0d2348ee..a927c5f6463 100644 --- a/src/nsterm.m +++ b/src/nsterm.m | |||
| @@ -4972,7 +4972,7 @@ ns_judge_scroll_bars (struct frame *f) | |||
| 4972 | ========================================================================== */ | 4972 | ========================================================================== */ |
| 4973 | 4973 | ||
| 4974 | static void | 4974 | static void |
| 4975 | ns_free_pixmap (struct frame *_f, Pixmap pixmap) | 4975 | ns_free_pixmap (struct frame *_f, Emacs_Pixmap pixmap) |
| 4976 | { | 4976 | { |
| 4977 | ns_release_object (pixmap); | 4977 | ns_release_object (pixmap); |
| 4978 | } | 4978 | } |
diff --git a/src/termhooks.h b/src/termhooks.h index 410273875a6..f1827128f19 100644 --- a/src/termhooks.h +++ b/src/termhooks.h | |||
| @@ -744,7 +744,7 @@ struct terminal | |||
| 744 | /* Image hooks */ | 744 | /* Image hooks */ |
| 745 | #ifdef HAVE_WINDOW_SYSTEM | 745 | #ifdef HAVE_WINDOW_SYSTEM |
| 746 | /* Free the pixmap PIXMAP on F. */ | 746 | /* Free the pixmap PIXMAP on F. */ |
| 747 | void (*free_pixmap) (struct frame *f, Pixmap pixmap); | 747 | void (*free_pixmap) (struct frame *f, Emacs_Pixmap pixmap); |
| 748 | 748 | ||
| 749 | #endif | 749 | #endif |
| 750 | 750 | ||
diff --git a/src/w32gui.h b/src/w32gui.h index 81b4820becf..c8df7128a76 100644 --- a/src/w32gui.h +++ b/src/w32gui.h | |||
| @@ -39,8 +39,7 @@ typedef struct _XGCValues | |||
| 39 | #define GCBackground 0x02 | 39 | #define GCBackground 0x02 |
| 40 | #define GCFont 0x03 | 40 | #define GCFont 0x03 |
| 41 | 41 | ||
| 42 | typedef HBITMAP Pixmap; | 42 | typedef HBITMAP Emacs_Pixmap; |
| 43 | typedef HBITMAP Bitmap; | ||
| 44 | 43 | ||
| 45 | typedef XGCValues * GC; | 44 | typedef XGCValues * GC; |
| 46 | typedef HWND Window; | 45 | typedef HWND Window; |
diff --git a/src/w32term.c b/src/w32term.c index 2be53cab894..ed881ad3beb 100644 --- a/src/w32term.c +++ b/src/w32term.c | |||
| @@ -6947,7 +6947,7 @@ w32_toggle_invisible_pointer (struct frame *f, bool invisible) | |||
| 6947 | ***********************************************************************/ | 6947 | ***********************************************************************/ |
| 6948 | 6948 | ||
| 6949 | static void | 6949 | static void |
| 6950 | w32_free_pixmap (struct frame *_f, Pixmap pixmap) | 6950 | w32_free_pixmap (struct frame *_f, Emacs_Pixmap pixmap) |
| 6951 | { | 6951 | { |
| 6952 | DeleteObject (pixmap); | 6952 | DeleteObject (pixmap); |
| 6953 | } | 6953 | } |
diff --git a/src/w32term.h b/src/w32term.h index 32c749e4874..f1373beb81c 100644 --- a/src/w32term.h +++ b/src/w32term.h | |||
| @@ -56,7 +56,7 @@ extern BOOL bUseDflt; | |||
| 56 | 56 | ||
| 57 | struct w32_bitmap_record | 57 | struct w32_bitmap_record |
| 58 | { | 58 | { |
| 59 | Pixmap pixmap; | 59 | Emacs_Pixmap pixmap; |
| 60 | char *file; | 60 | char *file; |
| 61 | HINSTANCE hinst; /* Used to load the file */ | 61 | HINSTANCE hinst; /* Used to load the file */ |
| 62 | int refcount; | 62 | int refcount; |
diff --git a/src/xterm.c b/src/xterm.c index c8cddcabf5e..2de6198359c 100644 --- a/src/xterm.c +++ b/src/xterm.c | |||
| @@ -12161,7 +12161,7 @@ x_check_font (struct frame *f, struct font *font) | |||
| 12161 | ***********************************************************************/ | 12161 | ***********************************************************************/ |
| 12162 | 12162 | ||
| 12163 | static void | 12163 | static void |
| 12164 | x_free_pixmap (struct frame *f, Pixmap pixmap) | 12164 | x_free_pixmap (struct frame *f, Emacs_Pixmap pixmap) |
| 12165 | { | 12165 | { |
| 12166 | XFreePixmap (FRAME_X_DISPLAY (f), pixmap); | 12166 | XFreePixmap (FRAME_X_DISPLAY (f), pixmap); |
| 12167 | } | 12167 | } |