aboutsummaryrefslogtreecommitdiffstats
path: root/src/image.c
diff options
context:
space:
mode:
authorDmitry Antipov2013-09-13 19:03:51 +0400
committerDmitry Antipov2013-09-13 19:03:51 +0400
commitaad3612f9eb7280bd4db8ee697186e75b1e82765 (patch)
treefd251b7978e9a570a6b66c93a43b0021bac0c7b7 /src/image.c
parent7830899f39515bcb4938715ebf58d1ba855deb41 (diff)
downloademacs-aad3612f9eb7280bd4db8ee697186e75b1e82765.tar.gz
emacs-aad3612f9eb7280bd4db8ee697186e75b1e82765.zip
Unify FRAME_window_system_DISPLAY_INFO macros between all ports.
All of them are replaced with FRAME_DISPLAY_INFO, defined in each port to reference the port-specific window system data. * msdos.h (FRAME_X_DISPLAY_INFO): Remove. (FRAME_DISPLAY_INFO): Define. * w32term.h (FRAME_W32_DISPLAY_INFO, FRAME_X_DISPLAY_INFO): Remove. (FRAME_DISPLAY_INFO): Define. Adjust users. * xterm.h (FRAME_X_DISPLAY_INFO): Remove. (FRAME_DISPLAY_INFO): Define. Adjust users. * frame.h (FRAME_RES_X, FRAME_RES_Y): Unify. * font.c, frame.c, gtkutil.c, image.c, menu.c, msdos.c, nsfns.m: * nsfont.m, nsterm.m, w32fns.c, w32font.c, w32menu.c, w32term.c: * w32xfns.c, widget.c, xdisp.c, xfaces.c, xfns.c, xfont.c, xmenu.c: * xselect.c, xterm.c: All related users changed.
Diffstat (limited to 'src/image.c')
-rw-r--r--src/image.c30
1 files changed, 15 insertions, 15 deletions
diff --git a/src/image.c b/src/image.c
index 1271376bcab..f0f7ff4b01f 100644
--- a/src/image.c
+++ b/src/image.c
@@ -161,13 +161,13 @@ XPutPixel (XImagePtr ximage, int x, int y, unsigned long pixel)
161int 161int
162x_bitmap_height (struct frame *f, ptrdiff_t id) 162x_bitmap_height (struct frame *f, ptrdiff_t id)
163{ 163{
164 return FRAME_X_DISPLAY_INFO (f)->bitmaps[id - 1].height; 164 return FRAME_DISPLAY_INFO (f)->bitmaps[id - 1].height;
165} 165}
166 166
167int 167int
168x_bitmap_width (struct frame *f, ptrdiff_t id) 168x_bitmap_width (struct frame *f, ptrdiff_t id)
169{ 169{
170 return FRAME_X_DISPLAY_INFO (f)->bitmaps[id - 1].width; 170 return FRAME_DISPLAY_INFO (f)->bitmaps[id - 1].width;
171} 171}
172 172
173#if defined (HAVE_X_WINDOWS) || defined (HAVE_NTGUI) 173#if defined (HAVE_X_WINDOWS) || defined (HAVE_NTGUI)
@@ -175,7 +175,7 @@ ptrdiff_t
175x_bitmap_pixmap (struct frame *f, ptrdiff_t id) 175x_bitmap_pixmap (struct frame *f, ptrdiff_t id)
176{ 176{
177 /* HAVE_NTGUI needs the explicit cast here. */ 177 /* HAVE_NTGUI needs the explicit cast here. */
178 return (ptrdiff_t) FRAME_X_DISPLAY_INFO (f)->bitmaps[id - 1].pixmap; 178 return (ptrdiff_t) FRAME_DISPLAY_INFO (f)->bitmaps[id - 1].pixmap;
179} 179}
180#endif 180#endif
181 181
@@ -183,7 +183,7 @@ x_bitmap_pixmap (struct frame *f, ptrdiff_t id)
183int 183int
184x_bitmap_mask (struct frame *f, ptrdiff_t id) 184x_bitmap_mask (struct frame *f, ptrdiff_t id)
185{ 185{
186 return FRAME_X_DISPLAY_INFO (f)->bitmaps[id - 1].mask; 186 return FRAME_DISPLAY_INFO (f)->bitmaps[id - 1].mask;
187} 187}
188#endif 188#endif
189 189
@@ -192,7 +192,7 @@ x_bitmap_mask (struct frame *f, ptrdiff_t id)
192static ptrdiff_t 192static ptrdiff_t
193x_allocate_bitmap_record (struct frame *f) 193x_allocate_bitmap_record (struct frame *f)
194{ 194{
195 Display_Info *dpyinfo = FRAME_X_DISPLAY_INFO (f); 195 Display_Info *dpyinfo = FRAME_DISPLAY_INFO (f);
196 ptrdiff_t i; 196 ptrdiff_t i;
197 197
198 if (dpyinfo->bitmaps_last < dpyinfo->bitmaps_size) 198 if (dpyinfo->bitmaps_last < dpyinfo->bitmaps_size)
@@ -213,7 +213,7 @@ x_allocate_bitmap_record (struct frame *f)
213void 213void
214x_reference_bitmap (struct frame *f, ptrdiff_t id) 214x_reference_bitmap (struct frame *f, ptrdiff_t id)
215{ 215{
216 ++FRAME_X_DISPLAY_INFO (f)->bitmaps[id - 1].refcount; 216 ++FRAME_DISPLAY_INFO (f)->bitmaps[id - 1].refcount;
217} 217}
218 218
219/* Create a bitmap for frame F from a HEIGHT x WIDTH array of bits at BITS. */ 219/* Create a bitmap for frame F from a HEIGHT x WIDTH array of bits at BITS. */
@@ -221,7 +221,7 @@ x_reference_bitmap (struct frame *f, ptrdiff_t id)
221ptrdiff_t 221ptrdiff_t
222x_create_bitmap_from_data (struct frame *f, char *bits, unsigned int width, unsigned int height) 222x_create_bitmap_from_data (struct frame *f, char *bits, unsigned int width, unsigned int height)
223{ 223{
224 Display_Info *dpyinfo = FRAME_X_DISPLAY_INFO (f); 224 Display_Info *dpyinfo = FRAME_DISPLAY_INFO (f);
225 ptrdiff_t id; 225 ptrdiff_t id;
226 226
227#ifdef HAVE_X_WINDOWS 227#ifdef HAVE_X_WINDOWS
@@ -235,8 +235,8 @@ x_create_bitmap_from_data (struct frame *f, char *bits, unsigned int width, unsi
235#ifdef HAVE_NTGUI 235#ifdef HAVE_NTGUI
236 Pixmap bitmap; 236 Pixmap bitmap;
237 bitmap = CreateBitmap (width, height, 237 bitmap = CreateBitmap (width, height,
238 FRAME_X_DISPLAY_INFO (XFRAME (frame))->n_planes, 238 FRAME_DISPLAY_INFO (XFRAME (frame))->n_planes,
239 FRAME_X_DISPLAY_INFO (XFRAME (frame))->n_cbits, 239 FRAME_DISPLAY_INFO (XFRAME (frame))->n_cbits,
240 bits); 240 bits);
241 if (! bitmap) 241 if (! bitmap)
242 return -1; 242 return -1;
@@ -280,7 +280,7 @@ x_create_bitmap_from_data (struct frame *f, char *bits, unsigned int width, unsi
280ptrdiff_t 280ptrdiff_t
281x_create_bitmap_from_file (struct frame *f, Lisp_Object file) 281x_create_bitmap_from_file (struct frame *f, Lisp_Object file)
282{ 282{
283 Display_Info *dpyinfo = FRAME_X_DISPLAY_INFO (f); 283 Display_Info *dpyinfo = FRAME_DISPLAY_INFO (f);
284 284
285#ifdef HAVE_NTGUI 285#ifdef HAVE_NTGUI
286 return -1; /* W32_TODO : bitmap support */ 286 return -1; /* W32_TODO : bitmap support */
@@ -379,7 +379,7 @@ free_bitmap_record (Display_Info *dpyinfo, Bitmap_Record *bm)
379void 379void
380x_destroy_bitmap (struct frame *f, ptrdiff_t id) 380x_destroy_bitmap (struct frame *f, ptrdiff_t id)
381{ 381{
382 Display_Info *dpyinfo = FRAME_X_DISPLAY_INFO (f); 382 Display_Info *dpyinfo = FRAME_DISPLAY_INFO (f);
383 383
384 if (id > 0) 384 if (id > 0)
385 { 385 {
@@ -454,7 +454,7 @@ x_create_bitmap_mask (struct frame *f, ptrdiff_t id)
454 unsigned long x, y, xp, xm, yp, ym; 454 unsigned long x, y, xp, xm, yp, ym;
455 GC gc; 455 GC gc;
456 456
457 Display_Info *dpyinfo = FRAME_X_DISPLAY_INFO (f); 457 Display_Info *dpyinfo = FRAME_DISPLAY_INFO (f);
458 458
459 if (!(id > 0)) 459 if (!(id > 0))
460 return; 460 return;
@@ -3421,7 +3421,7 @@ xpm_image_p (Lisp_Object object)
3421ptrdiff_t 3421ptrdiff_t
3422x_create_bitmap_from_xpm_data (struct frame *f, const char **bits) 3422x_create_bitmap_from_xpm_data (struct frame *f, const char **bits)
3423{ 3423{
3424 Display_Info *dpyinfo = FRAME_X_DISPLAY_INFO (f); 3424 Display_Info *dpyinfo = FRAME_DISPLAY_INFO (f);
3425 ptrdiff_t id; 3425 ptrdiff_t id;
3426 int rc; 3426 int rc;
3427 XpmAttributes attrs; 3427 XpmAttributes attrs;
@@ -4325,7 +4325,7 @@ lookup_rgb_color (struct frame *f, int r, int g, int b)
4325 two orders of magnitude. Freeing colors on TrueColor visuals is 4325 two orders of magnitude. Freeing colors on TrueColor visuals is
4326 a nop, and pixel colors specify RGB values directly. See also 4326 a nop, and pixel colors specify RGB values directly. See also
4327 the Xlib spec, chapter 3.1. */ 4327 the Xlib spec, chapter 3.1. */
4328 dpyinfo = FRAME_X_DISPLAY_INFO (f); 4328 dpyinfo = FRAME_DISPLAY_INFO (f);
4329 if (dpyinfo->red_bits > 0) 4329 if (dpyinfo->red_bits > 0)
4330 { 4330 {
4331 unsigned long pr, pg, pb; 4331 unsigned long pr, pg, pb;
@@ -4820,7 +4820,7 @@ x_edge_detection (struct frame *f, struct image *img, Lisp_Object matrix,
4820static void 4820static void
4821x_disable_image (struct frame *f, struct image *img) 4821x_disable_image (struct frame *f, struct image *img)
4822{ 4822{
4823 Display_Info *dpyinfo = FRAME_X_DISPLAY_INFO (f); 4823 Display_Info *dpyinfo = FRAME_DISPLAY_INFO (f);
4824#ifdef HAVE_NTGUI 4824#ifdef HAVE_NTGUI
4825 int n_planes = dpyinfo->n_planes * dpyinfo->n_cbits; 4825 int n_planes = dpyinfo->n_planes * dpyinfo->n_cbits;
4826#else 4826#else