emacs-diffs
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Emacs-diffs] scratch/X_Typedefs cc8f824 3/7: Introduce Emacs_Pixmap typ


From: Alexander Gramiak
Subject: [Emacs-diffs] scratch/X_Typedefs cc8f824 3/7: Introduce Emacs_Pixmap typedef
Date: Sat, 11 May 2019 00:17:31 -0400 (EDT)

branch: scratch/X_Typedefs
commit cc8f8244b75129a082b48b7761888e752fd50bc1
Author: Alexander Gramiak <address@hidden>
Commit: Alexander Gramiak <address@hidden>

    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.
---
 src/dispextern.h |  7 ++++---
 src/image.c      | 20 +++++++++++---------
 src/nsgui.h      |  4 ++--
 src/nsterm.m     |  2 +-
 src/termhooks.h  |  2 +-
 src/w32gui.h     |  3 +--
 src/w32term.c    |  2 +-
 src/w32term.h    |  2 +-
 src/xterm.c      |  2 +-
 9 files changed, 23 insertions(+), 21 deletions(-)

diff --git a/src/dispextern.h b/src/dispextern.h
index 5677b7b..3b1d0be 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/>.  */
 typedef XColor Emacs_Color;
 typedef Cursor Emacs_Cursor;
 #define No_Cursor (None)
+typedef Pixmap Emacs_Pixmap;
 
 #else /* !HAVE_X_WINDOWS */
 
@@ -86,7 +87,7 @@ typedef HDC XImagePtr_or_DC;
 #define FACE_COLOR_TO_PIXEL(face_color, frame) 
ns_color_index_to_rgba(face_color, frame)
 /* Following typedef needed to accommodate the MSDOS port, believe it or not.  
*/
 typedef struct ns_display_info Display_Info;
-typedef Pixmap XImagePtr;
+typedef Emacs_Pixmap XImagePtr;
 typedef XImagePtr XImagePtr_or_DC;
 #else
 #define FACE_COLOR_TO_PIXEL(face_color, frame) face_color
@@ -2960,7 +2961,7 @@ struct image
   struct timespec timestamp;
 
   /* Pixmaps of the image.  */
-  Pixmap pixmap, mask;
+  Emacs_Pixmap pixmap, mask;
 
 #ifdef USE_CAIRO
   void *cr_data;
@@ -3371,7 +3372,7 @@ extern void x_create_bitmap_mask (struct frame *, 
ptrdiff_t);
 #endif
 extern Lisp_Object image_find_image_file (Lisp_Object);
 
-void x_kill_gs_process (Pixmap, struct frame *);
+void x_kill_gs_process (Emacs_Pixmap, struct frame *);
 struct image_cache *make_image_cache (void);
 void free_image_cache (struct frame *);
 void clear_image_caches (Lisp_Object);
diff --git a/src/image.c b/src/image.c
index 7ac4484..f34d884 100644
--- a/src/image.c
+++ b/src/image.c
@@ -228,7 +228,7 @@ image_create_bitmap_from_data (struct frame *f, char *bits,
 
 #ifdef HAVE_NTGUI
   Lisp_Object frame UNINIT;    /* The value is not used.  */
-  Pixmap bitmap;
+  Emacs_Pixmap bitmap;
   bitmap = CreateBitmap (width, height,
                         FRAME_DISPLAY_INFO (XFRAME (frame))->n_planes,
                         FRAME_DISPLAY_INFO (XFRAME (frame))->n_cbits,
@@ -412,7 +412,8 @@ typedef void Picture;
 #endif
 
 static bool image_create_x_image_and_pixmap_1 (struct frame *, int, int, int,
-                                               XImagePtr *, Pixmap *, Picture 
*);
+                                               XImagePtr *, Emacs_Pixmap *,
+                                               Picture *);
 static void image_destroy_x_image (XImagePtr ximg);
 
 #ifdef HAVE_NTGUI
@@ -2094,17 +2095,18 @@ image_check_image_size (XImagePtr ximg, int width, int 
height)
 }
 
 /* Create an XImage and a pixmap of size WIDTH x HEIGHT for use on
-   frame F.  Set *XIMG and *PIXMAP to the XImage and Pixmap created.
-   Set (*XIMG)->data to a raster of WIDTH x HEIGHT pixels allocated
-   via xmalloc.  Print error messages via image_error if an error
-   occurs.  Value is true if successful.
+   frame F.  Set *XIMG and *PIXMAP to the XImage and Emacs_Pixmap
+   created.  Set (*XIMG)->data to a raster of WIDTH x HEIGHT pixels
+   allocated via xmalloc.  Print error messages via image_error if an
+   error occurs.  Value is true if successful.
 
    On W32, a DEPTH of zero signifies a 24 bit image, otherwise DEPTH
    should indicate the bit depth of the image.  */
 
 static bool
 image_create_x_image_and_pixmap_1 (struct frame *f, int width, int height, int 
depth,
-                                   XImagePtr *ximg, Pixmap *pixmap, Picture 
*picture)
+                                   XImagePtr *ximg, Emacs_Pixmap *pixmap,
+                                   Picture *picture)
 {
 #ifdef HAVE_X_WINDOWS
   Display *display = FRAME_X_DISPLAY (f);
@@ -2314,7 +2316,7 @@ image_destroy_x_image (XImagePtr ximg)
    are width and height of both the image and pixmap.  */
 
 static void
-gui_put_x_image (struct frame *f, XImagePtr ximg, Pixmap pixmap,
+gui_put_x_image (struct frame *f, XImagePtr ximg, Emacs_Pixmap pixmap,
                  int width, int height)
 {
 #ifdef HAVE_X_WINDOWS
@@ -9812,7 +9814,7 @@ gs_load (struct frame *f, struct image *img)
    telling Emacs that Ghostscript has finished drawing.  */
 
 void
-x_kill_gs_process (Pixmap pixmap, struct frame *f)
+x_kill_gs_process (Emacs_Pixmap pixmap, struct frame *f)
 {
   struct image_cache *c = FRAME_IMAGE_CACHE (f);
   ptrdiff_t i;
diff --git a/src/nsgui.h b/src/nsgui.h
index 1a0453f..c6f0f4b 100644
--- a/src/nsgui.h
+++ b/src/nsgui.h
@@ -96,9 +96,9 @@ typedef XGCValues * GC;
 #define GCFont 0x03
 
 #ifdef __OBJC__
-typedef id Pixmap;
+typedef id Emacs_Pixmap;
 #else
-typedef void *Pixmap;
+typedef void *Emacs_Pixmap;
 #endif
 
 #ifdef __OBJC__
diff --git a/src/nsterm.m b/src/nsterm.m
index 82a0d23..a927c5f 100644
--- a/src/nsterm.m
+++ b/src/nsterm.m
@@ -4972,7 +4972,7 @@ ns_judge_scroll_bars (struct frame *f)
    ========================================================================== 
*/
 
 static void
-ns_free_pixmap (struct frame *_f, Pixmap pixmap)
+ns_free_pixmap (struct frame *_f, Emacs_Pixmap pixmap)
 {
   ns_release_object (pixmap);
 }
diff --git a/src/termhooks.h b/src/termhooks.h
index 4102738..f182712 100644
--- a/src/termhooks.h
+++ b/src/termhooks.h
@@ -744,7 +744,7 @@ struct terminal
   /* Image hooks */
 #ifdef HAVE_WINDOW_SYSTEM
   /* Free the pixmap PIXMAP on F.  */
-  void (*free_pixmap) (struct frame *f, Pixmap pixmap);
+  void (*free_pixmap) (struct frame *f, Emacs_Pixmap pixmap);
 
 #endif
 
diff --git a/src/w32gui.h b/src/w32gui.h
index 81b4820..c8df712 100644
--- a/src/w32gui.h
+++ b/src/w32gui.h
@@ -39,8 +39,7 @@ typedef struct _XGCValues
 #define GCBackground 0x02
 #define GCFont 0x03
 
-typedef HBITMAP Pixmap;
-typedef HBITMAP Bitmap;
+typedef HBITMAP Emacs_Pixmap;
 
 typedef XGCValues * GC;
 typedef HWND Window;
diff --git a/src/w32term.c b/src/w32term.c
index 2be53ca..ed881ad 100644
--- a/src/w32term.c
+++ b/src/w32term.c
@@ -6947,7 +6947,7 @@ w32_toggle_invisible_pointer (struct frame *f, bool 
invisible)
  ***********************************************************************/
 
 static void
-w32_free_pixmap (struct frame *_f, Pixmap pixmap)
+w32_free_pixmap (struct frame *_f, Emacs_Pixmap pixmap)
 {
   DeleteObject (pixmap);
 }
diff --git a/src/w32term.h b/src/w32term.h
index db0ceed..c01e056 100644
--- a/src/w32term.h
+++ b/src/w32term.h
@@ -56,7 +56,7 @@ extern BOOL bUseDflt;
 
 struct w32_bitmap_record
 {
-  Pixmap pixmap;
+  Emacs_Pixmap pixmap;
   char *file;
   HINSTANCE hinst; /* Used to load the file */
   int refcount;
diff --git a/src/xterm.c b/src/xterm.c
index 2053da7..48937dd 100644
--- a/src/xterm.c
+++ b/src/xterm.c
@@ -12186,7 +12186,7 @@ x_check_font (struct frame *f, struct font *font)
  ***********************************************************************/
 
 static void
-x_free_pixmap (struct frame *f, Pixmap pixmap)
+x_free_pixmap (struct frame *f, Emacs_Pixmap pixmap)
 {
   XFreePixmap (FRAME_X_DISPLAY (f), pixmap);
 }



reply via email to

[Prev in Thread] Current Thread [Next in Thread]