Mercurial > hg > xemacs-beta
comparison src/glyphs-msw.c @ 5581:56144c8593a8
Mechanically change INT to FIXNUM in our sources.
src/ChangeLog addition:
2011-10-09 Aidan Kehoe <kehoea@parhasard.net>
[...]
Mechanically change INT (where it refers to non-bignum Lisp
integers) to FIXNUM in our sources. Done for the following
functions, enums, and macros: Lisp_Type_Int_Even,
Lisp_Type_Int_Odd, INT_GCBITS, INT_VALBITS, make_int(), INTP(),
XINT(), CHECK_INT(), XREALINT(), INT_PLUS(), INT_MINUS(),
EMACS_INT_MAX (to MOST_POSITIVE_FIXNUM), EMACS_INT_MIN (to
MOST_NEGATIVE_FIXNUM), NUMBER_FITS_IN_AN_EMACS_INT() to
NUMBER_FITS_IN_A_FIXNUM(), XFLOATINT, XCHAR_OR_INT, INT_OR_FLOAT.
The EMACS_INT typedef was not changed, it does not describe
non-bignum Lisp integers.
Script that did the change available in
http://mid.gmane.org/20067.17650.181273.12014@parhasard.net .
modules/ChangeLog addition:
2011-10-09 Aidan Kehoe <kehoea@parhasard.net>
[...]
Mechanically change INT to FIXNUM, where the usage describes non-bignum
Lisp integers. See the src/ChangeLog entry for more details.
man/ChangeLog addition:
2011-10-09 Aidan Kehoe <kehoea@parhasard.net>
* internals/internals.texi (How Lisp Objects Are Represented in C):
* internals/internals.texi (Integers and Characters):
Mechanically change INT to FIXNUM, where the usage describes non-bignum
Lisp integers.
author | Aidan Kehoe <kehoea@parhasard.net> |
---|---|
date | Sun, 09 Oct 2011 09:51:57 +0100 |
parents | 4dee0387b9de |
children | 0f2338afbabf |
comparison
equal
deleted
inserted
replaced
5580:a0e81357194e | 5581:56144c8593a8 |
---|---|
385 IMAGE_INSTANCE_MSWINDOWS_BITMAP_REAL_WIDTH (ii) = | 385 IMAGE_INSTANCE_MSWINDOWS_BITMAP_REAL_WIDTH (ii) = |
386 bmp_info->bmiHeader.biWidth; | 386 bmp_info->bmiHeader.biWidth; |
387 IMAGE_INSTANCE_MSWINDOWS_BITMAP_REAL_HEIGHT (ii) = | 387 IMAGE_INSTANCE_MSWINDOWS_BITMAP_REAL_HEIGHT (ii) = |
388 bmp_info->bmiHeader.biHeight; | 388 bmp_info->bmiHeader.biHeight; |
389 IMAGE_INSTANCE_PIXMAP_DEPTH (ii) = bmp_info->bmiHeader.biBitCount; | 389 IMAGE_INSTANCE_PIXMAP_DEPTH (ii) = bmp_info->bmiHeader.biBitCount; |
390 IMAGE_INSTANCE_PIXMAP_HOTSPOT_X (ii) = make_int (x_hot); | 390 IMAGE_INSTANCE_PIXMAP_HOTSPOT_X (ii) = make_fixnum (x_hot); |
391 IMAGE_INSTANCE_PIXMAP_HOTSPOT_Y (ii) = make_int (y_hot); | 391 IMAGE_INSTANCE_PIXMAP_HOTSPOT_Y (ii) = make_fixnum (y_hot); |
392 init_image_instance_geometry (ii); | 392 init_image_instance_geometry (ii); |
393 | 393 |
394 if (create_mask) | 394 if (create_mask) |
395 { | 395 { |
396 mswindows_initialize_image_instance_mask (ii, hdc); | 396 mswindows_initialize_image_instance_mask (ii, hdc); |
614 { | 614 { |
615 ICONINFO x_icon; | 615 ICONINFO x_icon; |
616 | 616 |
617 /* we rely on windows to do any resizing necessary */ | 617 /* we rely on windows to do any resizing necessary */ |
618 x_icon.fIcon = cursor ? FALSE : TRUE; | 618 x_icon.fIcon = cursor ? FALSE : TRUE; |
619 x_icon.xHotspot = XINT (IMAGE_INSTANCE_PIXMAP_HOTSPOT_X (image)); | 619 x_icon.xHotspot = XFIXNUM (IMAGE_INSTANCE_PIXMAP_HOTSPOT_X (image)); |
620 x_icon.yHotspot = XINT (IMAGE_INSTANCE_PIXMAP_HOTSPOT_Y (image)); | 620 x_icon.yHotspot = XFIXNUM (IMAGE_INSTANCE_PIXMAP_HOTSPOT_Y (image)); |
621 x_icon.hbmMask = IMAGE_INSTANCE_MSWINDOWS_MASK (image); | 621 x_icon.hbmMask = IMAGE_INSTANCE_MSWINDOWS_MASK (image); |
622 x_icon.hbmColor = IMAGE_INSTANCE_MSWINDOWS_BITMAP (image); | 622 x_icon.hbmColor = IMAGE_INSTANCE_MSWINDOWS_BITMAP (image); |
623 | 623 |
624 IMAGE_INSTANCE_MSWINDOWS_ICON (image)= | 624 IMAGE_INSTANCE_MSWINDOWS_ICON (image)= |
625 CreateIconIndirect (&x_icon); | 625 CreateIconIndirect (&x_icon); |
829 } | 829 } |
830 default: | 830 default: |
831 { | 831 { |
832 signal_double_image_error_2 ("Parsing pixmap data", | 832 signal_double_image_error_2 ("Parsing pixmap data", |
833 "unknown error", | 833 "unknown error", |
834 make_int (result), image); | 834 make_fixnum (result), image); |
835 } | 835 } |
836 } | 836 } |
837 | 837 |
838 *width = xpmimage.width; | 838 *width = xpmimage.width; |
839 *height = xpmimage.height; | 839 *height = xpmimage.height; |
1167 { | 1167 { |
1168 const resource_t *res = (type == IMAGE_CURSOR ? cursor_table | 1168 const resource_t *res = (type == IMAGE_CURSOR ? cursor_table |
1169 : type == IMAGE_ICON ? icon_table | 1169 : type == IMAGE_ICON ? icon_table |
1170 : bitmap_table); | 1170 : bitmap_table); |
1171 | 1171 |
1172 if (INTP (name)) | 1172 if (FIXNUMP (name)) |
1173 return XINT (name); | 1173 return XFIXNUM (name); |
1174 else if (!STRINGP (name)) | 1174 else if (!STRINGP (name)) |
1175 invalid_argument ("invalid resource identifier", name); | 1175 invalid_argument ("invalid resource identifier", name); |
1176 | 1176 |
1177 do | 1177 do |
1178 { | 1178 { |
1280 if (type != IMAGE_BITMAP) | 1280 if (type != IMAGE_BITMAP) |
1281 { | 1281 { |
1282 GetIconInfo ((HICON)himage, &iconinfo); | 1282 GetIconInfo ((HICON)himage, &iconinfo); |
1283 IMAGE_INSTANCE_MSWINDOWS_BITMAP (ii) = iconinfo.hbmColor; | 1283 IMAGE_INSTANCE_MSWINDOWS_BITMAP (ii) = iconinfo.hbmColor; |
1284 IMAGE_INSTANCE_MSWINDOWS_MASK (ii) = iconinfo.hbmMask; | 1284 IMAGE_INSTANCE_MSWINDOWS_MASK (ii) = iconinfo.hbmMask; |
1285 IMAGE_INSTANCE_PIXMAP_HOTSPOT_X (ii) = make_int (iconinfo.xHotspot); | 1285 IMAGE_INSTANCE_PIXMAP_HOTSPOT_X (ii) = make_fixnum (iconinfo.xHotspot); |
1286 IMAGE_INSTANCE_PIXMAP_HOTSPOT_Y (ii) = make_int (iconinfo.yHotspot); | 1286 IMAGE_INSTANCE_PIXMAP_HOTSPOT_Y (ii) = make_fixnum (iconinfo.yHotspot); |
1287 IMAGE_INSTANCE_MSWINDOWS_ICON (ii) = (HICON) himage; | 1287 IMAGE_INSTANCE_MSWINDOWS_ICON (ii) = (HICON) himage; |
1288 } | 1288 } |
1289 else | 1289 else |
1290 { | 1290 { |
1291 IMAGE_INSTANCE_MSWINDOWS_ICON (ii) = NULL; | 1291 IMAGE_INSTANCE_MSWINDOWS_ICON (ii) = NULL; |
1292 IMAGE_INSTANCE_MSWINDOWS_BITMAP (ii) = (HBITMAP) himage; | 1292 IMAGE_INSTANCE_MSWINDOWS_BITMAP (ii) = (HBITMAP) himage; |
1293 IMAGE_INSTANCE_MSWINDOWS_MASK (ii) = NULL; | 1293 IMAGE_INSTANCE_MSWINDOWS_MASK (ii) = NULL; |
1294 IMAGE_INSTANCE_PIXMAP_HOTSPOT_X (ii) = make_int (0); | 1294 IMAGE_INSTANCE_PIXMAP_HOTSPOT_X (ii) = make_fixnum (0); |
1295 IMAGE_INSTANCE_PIXMAP_HOTSPOT_Y (ii) = make_int (0); | 1295 IMAGE_INSTANCE_PIXMAP_HOTSPOT_Y (ii) = make_fixnum (0); |
1296 } | 1296 } |
1297 } | 1297 } |
1298 | 1298 |
1299 static void | 1299 static void |
1300 check_valid_resource_symbol (Lisp_Object data) | 1300 check_valid_resource_symbol (Lisp_Object data) |
1471 IMAGE_INSTANCE_PIXMAP_FILENAME (ii) = | 1471 IMAGE_INSTANCE_PIXMAP_FILENAME (ii) = |
1472 find_keyword_in_vector (instantiator, Q_file); | 1472 find_keyword_in_vector (instantiator, Q_file); |
1473 IMAGE_INSTANCE_MSWINDOWS_BITMAP_REAL_WIDTH (ii) = width; | 1473 IMAGE_INSTANCE_MSWINDOWS_BITMAP_REAL_WIDTH (ii) = width; |
1474 IMAGE_INSTANCE_MSWINDOWS_BITMAP_REAL_HEIGHT (ii) = height; | 1474 IMAGE_INSTANCE_MSWINDOWS_BITMAP_REAL_HEIGHT (ii) = height; |
1475 IMAGE_INSTANCE_PIXMAP_DEPTH (ii) = 1; | 1475 IMAGE_INSTANCE_PIXMAP_DEPTH (ii) = 1; |
1476 IMAGE_INSTANCE_PIXMAP_HOTSPOT_X (ii) = make_int (0); | 1476 IMAGE_INSTANCE_PIXMAP_HOTSPOT_X (ii) = make_fixnum (0); |
1477 IMAGE_INSTANCE_PIXMAP_HOTSPOT_Y (ii) = make_int (0); | 1477 IMAGE_INSTANCE_PIXMAP_HOTSPOT_Y (ii) = make_fixnum (0); |
1478 init_image_instance_geometry (ii); | 1478 init_image_instance_geometry (ii); |
1479 | 1479 |
1480 IMAGE_INSTANCE_MSWINDOWS_MASK (ii) = mask ? mask : | 1480 IMAGE_INSTANCE_MSWINDOWS_MASK (ii) = mask ? mask : |
1481 xbm_create_bitmap_from_data (hdc, bits, width, height, TRUE, black, white); | 1481 xbm_create_bitmap_from_data (hdc, bits, width, height, TRUE, black, white); |
1482 | 1482 |
1570 ext_data = | 1570 ext_data = |
1571 (Binbyte *) LISP_STRING_TO_EXTERNAL (XCAR (XCDR (XCDR (mask_data))), | 1571 (Binbyte *) LISP_STRING_TO_EXTERNAL (XCAR (XCDR (XCDR (mask_data))), |
1572 Qbinary); | 1572 Qbinary); |
1573 mask = xbm_create_bitmap_from_data (hdc, | 1573 mask = xbm_create_bitmap_from_data (hdc, |
1574 ext_data, | 1574 ext_data, |
1575 XINT (XCAR (mask_data)), | 1575 XFIXNUM (XCAR (mask_data)), |
1576 XINT (XCAR (XCDR (mask_data))), | 1576 XFIXNUM (XCAR (XCDR (mask_data))), |
1577 FALSE, | 1577 FALSE, |
1578 PALETTERGB (0,0,0), | 1578 PALETTERGB (0,0,0), |
1579 PALETTERGB (255,255,255)); | 1579 PALETTERGB (255,255,255)); |
1580 } | 1580 } |
1581 | 1581 |
1600 ext_data = | 1600 ext_data = |
1601 (const Binbyte *) LISP_STRING_TO_EXTERNAL (XCAR (XCDR (XCDR (data))), | 1601 (const Binbyte *) LISP_STRING_TO_EXTERNAL (XCAR (XCDR (XCDR (data))), |
1602 Qbinary); | 1602 Qbinary); |
1603 | 1603 |
1604 xbm_instantiate_1 (image_instance, instantiator, pointer_fg, | 1604 xbm_instantiate_1 (image_instance, instantiator, pointer_fg, |
1605 pointer_bg, dest_mask, XINT (XCAR (data)), | 1605 pointer_bg, dest_mask, XFIXNUM (XCAR (data)), |
1606 XINT (XCAR (XCDR (data))), ext_data); | 1606 XFIXNUM (XCAR (XCDR (data))), ext_data); |
1607 } | 1607 } |
1608 | 1608 |
1609 #ifdef HAVE_XFACE | 1609 #ifdef HAVE_XFACE |
1610 /********************************************************************** | 1610 /********************************************************************** |
1611 * X-Face * | 1611 * X-Face * |
2067 Lisp_Object frame = DOMAIN_FRAME (domain); | 2067 Lisp_Object frame = DOMAIN_FRAME (domain); |
2068 struct frame *f = XFRAME (frame); | 2068 struct frame *f = XFRAME (frame); |
2069 int id = gui_item_id_hash (FRAME_MSWINDOWS_WIDGET_HASH_TABLE2 (f), | 2069 int id = gui_item_id_hash (FRAME_MSWINDOWS_WIDGET_HASH_TABLE2 (f), |
2070 gui, | 2070 gui, |
2071 WIDGET_GLYPH_SLOT); | 2071 WIDGET_GLYPH_SLOT); |
2072 Fputhash (make_int (id), image_instance, | 2072 Fputhash (make_fixnum (id), image_instance, |
2073 FRAME_MSWINDOWS_WIDGET_HASH_TABLE1 (f)); | 2073 FRAME_MSWINDOWS_WIDGET_HASH_TABLE1 (f)); |
2074 Fputhash (make_int (id), XGUI_ITEM (gui)->callback, | 2074 Fputhash (make_fixnum (id), XGUI_ITEM (gui)->callback, |
2075 FRAME_MSWINDOWS_WIDGET_HASH_TABLE2 (f)); | 2075 FRAME_MSWINDOWS_WIDGET_HASH_TABLE2 (f)); |
2076 Fputhash (make_int (id), XGUI_ITEM (gui)->callback_ex, | 2076 Fputhash (make_fixnum (id), XGUI_ITEM (gui)->callback_ex, |
2077 FRAME_MSWINDOWS_WIDGET_HASH_TABLE3 (f)); | 2077 FRAME_MSWINDOWS_WIDGET_HASH_TABLE3 (f)); |
2078 return id; | 2078 return id; |
2079 } | 2079 } |
2080 | 2080 |
2081 static int | 2081 static int |
2120 FRAME_MSWINDOWS_HANDLE (XFRAME (frame)), | 2120 FRAME_MSWINDOWS_HANDLE (XFRAME (frame)), |
2121 NULL, /* No menu */ | 2121 NULL, /* No menu */ |
2122 NULL, /* must be null for this class */ | 2122 NULL, /* must be null for this class */ |
2123 NULL)) == NULL) | 2123 NULL)) == NULL) |
2124 gui_error ("window creation failed with code", | 2124 gui_error ("window creation failed with code", |
2125 make_int (GetLastError())); | 2125 make_fixnum (GetLastError())); |
2126 | 2126 |
2127 wnd = qxeCreateWindow (XETEXT ("STATIC"), XETEXT (""), | 2127 wnd = qxeCreateWindow (XETEXT ("STATIC"), XETEXT (""), |
2128 WS_CHILD, | 2128 WS_CHILD, |
2129 0, /* starting x position */ | 2129 0, /* starting x position */ |
2130 0, /* starting y position */ | 2130 0, /* starting y position */ |
2260 DOMAIN_MSWINDOWS_HANDLE (domain), | 2260 DOMAIN_MSWINDOWS_HANDLE (domain), |
2261 (HMENU)id, /* No menu */ | 2261 (HMENU)id, /* No menu */ |
2262 NULL, /* must be null for this class */ | 2262 NULL, /* must be null for this class */ |
2263 NULL)) == NULL) | 2263 NULL)) == NULL) |
2264 gui_error ("window creation failed with code", | 2264 gui_error ("window creation failed with code", |
2265 make_int (GetLastError())); | 2265 make_fixnum (GetLastError())); |
2266 | 2266 |
2267 classext = ITEXT_TO_TSTR (class_); | 2267 classext = ITEXT_TO_TSTR (class_); |
2268 | 2268 |
2269 if ((wnd = qxeCreateWindowEx (exflags /* | WS_EX_NOPARENTNOTIFY*/, | 2269 if ((wnd = qxeCreateWindowEx (exflags /* | WS_EX_NOPARENTNOTIFY*/, |
2270 classext, | 2270 classext, |
2281 qxeGetWindowLong | 2281 qxeGetWindowLong |
2282 (FRAME_MSWINDOWS_HANDLE (XFRAME (frame)), | 2282 (FRAME_MSWINDOWS_HANDLE (XFRAME (frame)), |
2283 GWL_HINSTANCE), | 2283 GWL_HINSTANCE), |
2284 NULL)) == NULL) | 2284 NULL)) == NULL) |
2285 gui_error ("window creation failed with code", | 2285 gui_error ("window creation failed with code", |
2286 make_int (GetLastError())); | 2286 make_fixnum (GetLastError())); |
2287 | 2287 |
2288 IMAGE_INSTANCE_SUBWINDOW_ID (ii) = wnd; | 2288 IMAGE_INSTANCE_SUBWINDOW_ID (ii) = wnd; |
2289 qxeSetWindowLong (wnd, GWL_USERDATA, (LONG)STORE_LISP_IN_VOID(image_instance)); | 2289 qxeSetWindowLong (wnd, GWL_USERDATA, (LONG)STORE_LISP_IN_VOID(image_instance)); |
2290 /* set the widget font from the widget face */ | 2290 /* set the widget font from the widget face */ |
2291 if (!NILP (IMAGE_INSTANCE_WIDGET_TEXT (ii))) | 2291 if (!NILP (IMAGE_INSTANCE_WIDGET_TEXT (ii))) |
2453 (FACE_FOREGROUND | 2453 (FACE_FOREGROUND |
2454 (XIMAGE_INSTANCE_WIDGET_FACE (ii), | 2454 (XIMAGE_INSTANCE_WIDGET_FACE (ii), |
2455 XIMAGE_INSTANCE_FRAME (ii)))))); | 2455 XIMAGE_INSTANCE_FRAME (ii)))))); |
2456 #endif | 2456 #endif |
2457 val = XGUI_ITEM (IMAGE_INSTANCE_WIDGET_ITEMS (ii))->value; | 2457 val = XGUI_ITEM (IMAGE_INSTANCE_WIDGET_ITEMS (ii))->value; |
2458 CHECK_INT (val); | 2458 CHECK_FIXNUM (val); |
2459 qxeSendMessage (WIDGET_INSTANCE_MSWINDOWS_HANDLE (ii), | 2459 qxeSendMessage (WIDGET_INSTANCE_MSWINDOWS_HANDLE (ii), |
2460 PBM_SETPOS, (WPARAM)XINT (val), 0); | 2460 PBM_SETPOS, (WPARAM)XFIXNUM (val), 0); |
2461 } | 2461 } |
2462 | 2462 |
2463 /* instantiate a tree view widget */ | 2463 /* instantiate a tree view widget */ |
2464 static HTREEITEM add_tree_item (Lisp_Object image_instance, | 2464 static HTREEITEM add_tree_item (Lisp_Object image_instance, |
2465 HWND wnd, HTREEITEM parent, Lisp_Object item, | 2465 HWND wnd, HTREEITEM parent, Lisp_Object item, |
2877 Lisp_Object val; | 2877 Lisp_Object val; |
2878 val = XGUI_ITEM (IMAGE_INSTANCE_WIDGET_PENDING_ITEMS (ii))->value; | 2878 val = XGUI_ITEM (IMAGE_INSTANCE_WIDGET_PENDING_ITEMS (ii))->value; |
2879 #ifdef DEBUG_WIDGET_OUTPUT | 2879 #ifdef DEBUG_WIDGET_OUTPUT |
2880 stderr_out ("progress gauge displayed value on %p updated to %ld\n", | 2880 stderr_out ("progress gauge displayed value on %p updated to %ld\n", |
2881 WIDGET_INSTANCE_MSWINDOWS_HANDLE (ii), | 2881 WIDGET_INSTANCE_MSWINDOWS_HANDLE (ii), |
2882 XINT(val)); | 2882 XFIXNUM(val)); |
2883 #endif | 2883 #endif |
2884 CHECK_INT (val); | 2884 CHECK_FIXNUM (val); |
2885 qxeSendMessage (WIDGET_INSTANCE_MSWINDOWS_HANDLE (ii), | 2885 qxeSendMessage (WIDGET_INSTANCE_MSWINDOWS_HANDLE (ii), |
2886 PBM_SETPOS, (WPARAM)XINT (val), 0); | 2886 PBM_SETPOS, (WPARAM)XFIXNUM (val), 0); |
2887 } | 2887 } |
2888 } | 2888 } |
2889 | 2889 |
2890 LRESULT WINAPI | 2890 LRESULT WINAPI |
2891 mswindows_control_wnd_proc (HWND hwnd, UINT msg, | 2891 mswindows_control_wnd_proc (HWND hwnd, UINT msg, |