1
Fork 0
mirror of git://git.sv.gnu.org/emacs.git synced 2026-01-12 14:30:42 -08:00
Commit graph

39 commits

Author SHA1 Message Date
YAMAMOTO Mitsuharu
de297941ce [MAC_OS] (image_load_qt_1): Check image size.
Use GraphicsImportGetImageDescription instead of
GraphicsImportGetNaturalBounds.
[MAC_OSX] (image_load_quartz2d): Check image size.
[MAC_OS] (xpm_load_image): Likewise.
2005-10-25 08:12:44 +00:00
Kim F. Storm
7df4765a4c (check_image_size): Handle integer Vmax_image_size value
directly as max pixel value.  Use default frame size for null frame.
(syms_of_image) <max-image-size>: Describe integer value.
2005-10-19 21:52:13 +00:00
Chong Yidong
f1f25b9966 * image.c (Vmax_image_size): New variable.
(check_image_size): New function.
	(xbm_read_bitmap_data, pbm_load, png_load, jpeg_load, tiff_load)
	(gif_load, gs_load): Use it.
	(lookup_image): Try loading again if previous load failed.
	(xbm_read_bitmap_data): Add a new argument, a pointer to the frame
	to display in, NULL if none.
	(xbm_load_image, xbm_file_p): Pass xbm_read_bitmap_data the new
	argument.
2005-10-19 03:54:56 +00:00
Juanma Barranquero
b25a72ab31 (fn_jpeg_stdio_src): Don't define it.
(init_jpeg_functions): Don't initialize `fn_jpeg_stdio_src'.
(our_common_init_source): Rename from `our_init_source'.
(our_common_term_source): Rename from `our_term_source'.
(our_memory_fill_input_buffer): Rename from `our_fill_input_buffer'.
(our_memory_skip_input_data): Rename from `our_skip_input_data'.
(jpeg_memory_src): Use the new names.
(struct jpeg_stdio_mgr): New struct.
(JPEG_STDIO_BUFFER_SIZE): New constant.
(our_stdio_fill_input_buffer, our_stdio_skip_input_data, jpeg_file_src): New
functions.
(jpeg_load): Use `jpeg_file_src' instead of `fn_jpeg_stdio_src'.
2005-10-11 08:25:27 +00:00
Dan Nicolaescu
fa8459a34e * image.c (slurp_file, xbm_read_bitmap_data): Cast to the correct
type.
* xterm.c (handle_one_xevent, handle_one_xevent): Likewise.

* unexelf.c (fatal): Fix prototype.

* term.c (fatal): Implement using varargs.

* regex.c (re_char): Move typedef ...
* regex.h (re_char): ... here.
(re_iswctype, re_wctype, re_set_whitespace_regexp): New
prototypes.

* emacs.c (malloc_set_state): Fix return type.
(endif): Fix type.

* lisp.h (fatal): Add argument types.

* dispextern.h (fatal): Delete prototype.

* systime.h: (make_time): Prototype moved from ...
* editfns.c (make_time): ... here.

* editfns.c: Move systime.h include after lisp.h.
* dired.c:
* xsmfns.c:
* process.c: Likewise.

* alloc.c (old_malloc_hook, old_realloc_hook, old_realloc_hook):
Add parameter types.
(__malloc_hook, __realloc_hook, __free_hook): Fix prototypes.
(emacs_blocked_free): Change definition to match __free_hook.
(emacs_blocked_malloc): Change definition to match __malloc_hook.
(emacs_blocked_realloc): Change definition to match
__realloc_hook.
2005-09-30 22:38:16 +00:00
Kim F. Storm
0f4aca467e (gif_load): Fix size of allocated image buffer
for images where a sub-image may be larger than the image's
total height/width specifications.
2005-09-28 10:48:20 +00:00
YAMAMOTO Mitsuharu
9ecf640371 (PIX_MASK_DRAW, PIX_MASK_RETAIN): Remove argument. All uses changed.
[MAC_OS] (XPutPixel, XGetPixel): Add efficient versions for common
cases.
(x_create_x_image_and_pixmap) [MAC_OS]: Don't call x_destroy_x_image.
[MAC_OS] (find_image_fsspec) [!MAC_OSX]: Don't use FSRef.  Use
posix_pathname_to_fsspec.
[MAC_OS] (xpm_load_image): Fill in background_transparent field
while we have mask.
2005-08-31 08:35:28 +00:00
Richard M. Stallman
7c4e3a3219 (syms_of_image): Init Qxbm, Qpbm before calling define_image_type. 2005-08-15 01:47:01 +00:00
Richard M. Stallman
6e6fc3fd4b (syms_of_image): Init image_types here, and call define_image_type.
(init_image): Not here.
2005-08-11 13:58:12 +00:00
Thien-Thi Nguyen
0b5538bd85 Update years in copyright notice; nfc. 2005-08-07 12:33:19 +00:00
Lute Kamstra
4fc5845fe8 Update FSF's address. 2005-07-04 16:49:24 +00:00
Juanma Barranquero
9a22a004b3 (fn_png_init_io): Don't define it.
(init_png_functions) [HAVE_NTGUI]: Don't initialize fn_png_init_io.
(png_read_from_file): New function, based on png_read_from_memory.
(png_load): Use it, instead of fn_png_init_io.
2005-06-23 07:48:13 +00:00
Eli Zaretskii
2e09fef1ac (x_create_x_image_and_pixmap) [HAVE_NTGUI]: Cast 4th arg
to CreateDIBSection to avoid a compiler warning.
(pbm_load): Cast 3rd arg to IMAGE_BACKGROUND to avoid a compiler
warning.
(png_load): Cast return values of fn_png_create_read_struct and
fn_png_create_info_struct, to avoid compiler warnings on W32.
Cast 3rd arg to IMAGE_BACKGROUND and image_background_transparent
to avoid compiler warnings.
(jpeg_load): Cast return value of fn_jpeg_std_error to avoid a
compiler warning on W32.  Cast 3rd arg to IMAGE_BACKGROUND to
avoid a compiler warning.
(tiff_load): Cast return values of fn_TIFFOpen and
fn_TIFFClientOpen to avoid compiler warning on W32.  Cast 3rd arg
to IMAGE_BACKGROUND to avoid a compiler warning.
(gif_load): Cast return values of fn_DGifOpenFileName and
fn_DGifOpen to avoid compiler warnings on W32.  Cast 3rd arg to
IMAGE_BACKGROUND to avoid a compiler warning.
(DrawText) [HAVE_NTGUI || MAC_OS]: If already defined, undef
before redefining.
2005-06-11 16:25:14 +00:00
Juanma Barranquero
28893db2e7 Update comment. 2005-06-07 13:02:04 +00:00
Juanma Barranquero
2a611c1a4f (Vimage_library_alist): Moved from image.el.
(syms_of_image): Defvar it.
(lookup_image_type): Use it.
2005-05-27 13:16:05 +00:00
Juanma Barranquero
09e8eb5bae (lookup_image, png_read_from_memory): Remove hacks (and misleading comments).
(DEF_IMGLIB_FN): Use C calling convention for image libraries.
2005-05-20 17:51:38 +00:00
Richard M. Stallman
8faf605706 Don't include signal.h. 2005-05-10 09:18:02 +00:00
YAMAMOTO Mitsuharu
a5e700caf2 [MAC_OSX] (image_load_quartz2d): Use cfstring_create_with_string. 2005-04-16 03:07:05 +00:00
YAMAMOTO Mitsuharu
d45b2e9e31 [!MAC_OSX && TARGET_API_MAC_CARBON]: Include QuickTime.h. 2005-03-04 11:07:11 +00:00
Steven Tamm
b15325b22a * dispextern.h: Change HAVE_CARBON to MAC_OS.
(struct glyph_string): Likewise.
* emacs.c (main) [MAC_OS8]: Call mac_term_init instead of
	mac_initialize.
* fileio.c (Fnext_read_file_uses_dialog_p, Fread_file_name):
	Change TARGET_API_MAC_CARBON to HAVE_CARBON.
* fns.c (vector): Change MAC_OSX to MAC_OS.
* frame.c (x_set_frame_parameters, x_report_frame_params)
	(x_set_fullscreen): Remove #ifndef HAVE_CARBON.
	(x_set_border_width, Vdefault_frame_scroll_bars): Change
	HAVE_CARBON to MAC_OS.
* image.c [MAC_OS]: Include sys/stat.h.
	[MAC_OS && !MAC_OSX]: Include sys/param.h, ImageCompression.h, and
	QuickTimeComponents.h.
* mac.c [!MAC_OSX] (mac_wait_next_event): Add extern.
	[!MAC_OSX] (select): Use mac_wait_next_event.
	[!MAC_OSX] (run_mac_command): Change EXEC_SUFFIXES to
	Vexec_suffixes.
	[!MAC_OSX] (select, run_mac_command): Change `#ifdef
	TARGET_API_MAC_CARBON' to `#if TARGET_API_MAC_CARBON'.
	(mac_clear_font_name_table): Add extern.
	(Fmac_clear_font_name_table): New defun.
	(syms_of_mac): Defsubr it.
	[MAC_OSX] (SELECT_POLLING_PERIOD_USEC): New define.
	[MAC_OSX] (select_and_poll_event): New function.
	[MAC_OSX] (sys_select): Use it.
	[MAC_OSX && SELECT_USE_CFSOCKET] (socket_callback): New function.
	[MAC_OSX && SELECT_USE_CFSOCKET]
	(SELECT_TIMEOUT_THRESHOLD_RUNLOOP, EVENT_CLASS_SOCK): New defines.
	[MAC_OSX] (sys_select) [SELECT_USE_CFSOCKET]: Use CFSocket and
	RunLoop for simultaneously monitoring two kinds of inputs, window
	events and process outputs, without periodically polling.
* macfns.c (mac_initialized): Remove extern.
	(stricmp): Put in #if 0.  All callers changed to use xstricmp in
	xfaces.c.
	(strnicmp): Decrement `n' at the end of each loop, not the
	beginning.
	(check_mac): Use the term "Mac native windows" instead of "Mac
	OS".
	(check_x_display_info, x_display_info_for_name): Sync with xfns.c.
	(mac_get_rdb_resource): New function (from w32reg.c).
	(x_get_string_resource): Use it.
	(install_window_handler): Add extern.
	(mac_window): New function.
	(Fx_create_frame): Use it instead of make_mac_frame.  Set
	parameter for Qfullscreen.  Call x_wm_set_size_hint.
	(Fx_open_connection, Fx_close_connection): New defuns.
	(syms_of_macfns): Defsubr them.
	(x_create_tip_frame) [TARGET_API_MAC_CARBON]: Add
	kWindowNoUpdatesAttribute to the window attribute.
	(x_create_tip_frame) [!TARGET_API_MAC_CARBON]: Use NewCWindow.
	(x_create_tip_frame): Don't call ShowWindow.
	(Fx_show_tip): Call ShowWindow.
	(Fx_file_dialog): Change `#ifdef TARGET_API_MAC_CARBON' to `#if
	TARGET_API_MAC_CARBON'.
	(mac_frame_parm_handlers): Set handlers for Qfullscreen.
	(syms_of_macfns) [MAC_OSX]: Initialize mac_in_use to 0.
* macgui.h [!MAC_OSX]: Don't include Controls.h.  Include
	Windows.h.
	(Window): Typedef to WindowPtr and move outside `#if
	TARGET_API_MAC_CARBON'.
	(XSizeHints): New struct.
* macterm.c (x_update_begin, x_update_end)
	[TARGET_API_MAC_CARBON]: Disable screen updates during update of a
	frame.
	(x_draw_glyph_string_background, x_draw_glyph_string_foreground)
	[MAC_OS8]: Use XDrawImageString/XDrawImageString16.
	(construct_mouse_click): Put in #if 0.
	(x_check_fullscreen, x_check_fullscreen_move): Remove decls.
	(x_scroll_bar_create, x_scroll_bar_handle_click): Change `#ifdef
	TARGET_API_MAC_CARBON' to `#if TARGET_API_MAC_CARBON'.
	(activate_scroll_bars, deactivate_scroll_bars)
	[!TARGET_API_MAC_CARBON]: Use ActivateControl/DeactivateControl.
	(x_make_frame_visible) [TARGET_API_MAC_CARBON]: Reposition window
	if the position is neither user-specified nor program-specified.
	(x_free_frame_resources): Free size_hints.
	(x_wm_set_size_hint): Allocate size_hints if needed.  Set
	size_hints.
	(mac_clear_font_name_table): New function.
	(mac_do_list_fonts): Initialize font_name_table if needed.
	(x_list_fonts): Don't initialize font_name_table.  Add BLOCK_INPUT
	around mac_do_list_fonts.
	(mac_unload_font): New function.
	(x_load_font): Add BLOCK_INPUT around XLoadQueryFont.
	(init_mac_drag_n_drop, mac_do_receive_drag): Enclose declarations
	and definitions with #if TARGET_API_MAC_CARBON.
	[USE_CARBON_EVENTS] (mac_handle_window_event): Add decl.
	(install_window_handler): Add decl.
	(do_window_update): Add BeginUpdate/EndUpdate for the tooltip
	window.  Use UpdateControls.  Get the rectangle that should be
	updated and restrict the target of expose_frame to it.
	(do_grow_window): Set minimum height/width according to
	size_hints.
	(do_grow_window) [TARGET_API_MAC_CARBON]: Use ResizeWindow.
	(do_zoom_window): Don't use x_set_window_size.
	[USE_CARBON_EVENTS] (mac_handle_window_event): New function.
	(install_window_handler): New function.
	[!USE_CARBON_EVENTS] (mouse_region): New variable.
	[!USE_CARBON_EVENTS] (mac_wait_next_event): New function.
	(XTread_socket) [USE_CARBON_EVENTS]: Move call to
	GetEventDispatcherTarget inside BLOCK_INPUT.
	(XTread_socket) [!USE_CARBON_EVENTS]: Use mac_wait_next_event.
	Update mouse_region when mouse is moved.
	(make_mac_frame): Remove.
	(make_mac_terminal_frame): Put in #ifdef MAC_OS8.  Initialize
	mouse pointer shapes.  Change values of f->left_pos and
	f->top_pos.  Don't use make_mac_frame.  Use NewCWindow.  Don't
	call ShowWindow.
	(mac_initialize_display_info) [MAC_OSX]: Create mac_id_name from
	Vinvocation_name and Vsystem_name.
	(mac_make_rdb): New function (from w32term.c).
	(mac_term_init): Use it.  Add BLOCK_INPUT.  Error if display has
	already been opened.  Don't pass argument to
	mac_initialize_display_info.  Don't set dpyinfo->height/width.
	Add entries to x_display_list and x_display_name_list.
	(x_delete_display): New function.
	(mac_initialize): Don't call mac_initialize_display_info.
	(syms_of_macterm) [!MAC_OSX]: Don't call Fprovide.
* macterm.h (check_mac): Add extern.
	(struct mac_output): New member size_hints.
	(FRAME_SIZE_HINTS): New macro.
	(mac_unload_font): Add extern.
* xdisp.c (expose_window, expose_frame): Remove kludges for Mac.
* xfaces.c (clear_font_table) [MAC_OS]: call mac_unload_font.
2004-12-27 17:27:30 +00:00
Jason Rumney
66354420ae (__WIN32__) [HAVE_NTGUI]: Define for correct behaviour of JPEG library. 2004-12-23 16:16:14 +00:00
Richard M. Stallman
e0e308237a (our_fill_input_buffer, jpeg_load, CHECK_LIB_AVAILABLE, init_image):
Use 1 rather than TRUE.  TRUE's not always defined.
2004-12-08 17:56:08 +00:00
Steven Tamm
d8f96db8da * macterm.h (cfstring_create_with_utf8_cstring): Added prototype.
* image.c (image_load_quartz2d): Use
cfstring_create_with_utf8_cstring
* macmenu.c (add_menu_item): Use
cfstring_create_with_utf8_cstring
* macfns.c (x_set_name, x_set_title): Use
cfstring_create_with_utf8_cstring
(Fx_file_dialog): Use cfstring_create_with_utf8_cstring and use
constant CFRefs instead of creating them each time for labels.
* mac.c (cfstring_create_with_utf8_cstring): Added to prevent
crashes with invalid characters.
2004-12-03 17:00:11 +00:00
Andreas Schwab
adac86dbb0 (CHECK_LIB_AVAILABLE): Add third parameter LIBRARIES.
(Finit_image_library): Pass LIBRARIES through to
CHECK_LIB_AVAILABLE.  Declare parameters.  Doc fix.
(lookup_image_type): Pass Qnil as second argument to
Finit_image_library.
2004-06-30 13:11:36 +00:00
Miles Bader
803aac3efa Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-410
Make sure image types are initialized for lookup too
2004-06-16 02:45:09 +00:00
Juanma Barranquero
0855eb5219 (Vimage_types): Move from xdisp.c.
(Vimage_type_cache): New variable.
(define_image_type): New argument indicating whether an image library was
loaded; cache loaded status and return t on success, nil otherwise.
(CACHE_IMAGE_TYPE, ADD_IMAGE_TYPE): New macros.
(w32_delayed_load): New function to load an image library from a list of
possible filenames.
(init_xpm_functions, init_png_functions, init_jpeg_functions)
(init_tiff_functions, init_gif_functions): Use `w32_delayed_load'.
(CHECK_LIB_AVAILABLE): Call `define_image_library' with new argument.
(Finit_image_library): New function, extracted from `init_image'.  Try to
initialize an image library on demand and cache whether we were successful
or not.
(syms_of_image): Initialize `Vimage_types' and `Vimage_type_cache'.  Add
recognized image types to Vimage_types. Export `init-image-library'.
(init_image): Remove initialization of all image types, except xbm and pbm.
2004-06-14 20:47:25 +00:00
Andreas Schwab
be8c4ce456 Include <ctype.h>. 2004-06-13 15:04:45 +00:00
Juanma Barranquero
b0da69a77b Work around bugs/problems with MinGW builds of graphics libraries
called from MSVC builds of Emacs.

(lookup_image): Make pointer to img static.
(png_read_from_memory): Disable "global" optimization.
2004-06-02 00:50:09 +00:00
Steven Tamm
ea1aaa6fb8 Support XPM on Carbon Emacs. Does not
depend on libXpm, but only supports XPM version 3 without
extensions.
2004-05-12 02:23:37 +00:00
Steven Tamm
2a316a84d5 macterm.c (mac_check_for_quit_char): Adding BLOCK_INPUT
around call to ReceiveEvent to avoid certain crashes.
(mac_draw_line_to_pixmap, XCreatePixmapFromBitmapData)
(mac_fill_rectangle_to_pixmap, mac_draw_rectangle_to_pixmap)
(mac_copy_area_to_pixmap, mac_copy_area_with_mask_to_pixmap):
Save/restore the current graphics port and device handle when
drawing into an offscreen graphics world.
image.c [MAC_OS] (XPutPixel, XGetPixel, image_load_qt_1)
(gif_load): Likewise.
2004-05-07 17:46:50 +00:00
Jason Rumney
279d3293d3 (Display) [HAVE_NTGUI]: Redefine while loading xpm.h to avoid name clash. 2004-05-05 23:22:41 +00:00
Kim F. Storm
1938bc365d (image_ascent): Add slice arg; calculate ascent for
image slice (or full image).
2004-04-20 22:16:33 +00:00
Kim F. Storm
1f0268990d (PNG_BG_COLOR_SHIFT): Remove.
(png_load): Fix calculation of transparent background color on X
and W32 platforms.
2004-04-16 20:08:15 +00:00
Kim F. Storm
e1dfec150b (Qcenter): Move to xdisp.c. 2004-03-19 00:42:37 +00:00
Kim F. Storm
c640aa9b33 (x_find_image_file): Make extern. 2004-03-14 00:28:35 +00:00
Kim F. Storm
75fd7da16a (XImagePtr, XImagePtr_or_DC): Move typedefs to dispextern.h. 2004-03-11 22:43:06 +00:00
Steven Tamm
5243c06a3a * image.c [MAC_OSX]: Include sys/stat.h
* macfns.c (syms_of_macfns): Remove definitions of things now
	defined in image.c
2004-03-11 05:56:41 +00:00
Miles Bader
1b9f8ceccc Add arch tagline 2004-03-11 05:45:22 +00:00
Kim F. Storm
4ef0d4d03e New file (image.c) for Image consolidation:
(COLOR_TABLE_SUPPORT): New define to control whether
color table support is available (X only).
(Bitmap_Record): Common name for x_bitmap_record,
w32_bitmap_record, and mac_bitmap_record.
(XImagePtr): Common name for pointer to XImage or equivalent.
(XImagePtr_or_DC): New type to simplify code sharing; equivalent
to XImagePtr on X+MAC, and to HDC on W32.
(GET_PIXEL): Wrapper for XGetPixel or equivalent.
(NO_PIXMAP): Common name for "None" or equivalent.
(PNG_BG_COLOR_SHIFT): Bits to shift PNG background colors.
(RGB_PIXEL_COLOR): Common type for an integer "pixel color" value.
(PIX_MASK_RETAIN, PIX_MASK_DRAW): Portability macros (from macfns.c).
(FRAME_X_VISUAL, x_defined_color, DefaultDepthOfScreen): Define
with suitable equivalents on W32 and MAC for code sharing.
(XDrawLine): Define on MAC for code sharing.
(Destroy_Image, Free_Pixmap): Wrappers for code sharing.
(IF_LIB_AVAILABLE): Macro to simplify code sharing.
(Vx_bitmap_file_path, Vimage_cache_eviction_delay)
(x_bitmap_height, x_bitmap_width, x_bitmap_pixmap)
(x_reference_bitmap, x_create_bitmap_from_data)
(x_create_bitmap_from_file, x_destroy_bitmap)
(x_destroy_all_bitmaps, x_create_bitmap_mask)
(XGetImage, XPutPixel, XGetPixel, XDestroyImage)
(QCascent, QCmargin, QCrelief, QCconversion, QCcolor_symbols)
(QCheuristic_mask, QCindex, QCmatrix, QCcolor_adjustment, QCmask)
(Qlaplace, Qemboss, Qedge_detection, Qheuristic, Qcenter)
(define_image_type, lookup_image_type, valid_image_p)
(image_error, enum image_value_type, struct image_keyword)
(parse_image_spec, image_spec_value, Fimage_size, Fimage_mask_p)
(make_image, free_image, prepare_image_for_display, image_ascent)
(four_corners_best, image_background, image_background_transparent)
(x_clear_image_1,  x_clear_image, x_alloc_image_color)
(make_image_cache, free_image_cache, clear_image_cache)
(Fclear_image_cache, postprocess_image, lookup_image, cache_image)
(forall_images_in_image_cache, x_create_x_image_and_pixmap)
(x_destroy_x_image, x_put_x_image, x_find_image_file, slurp_file)
(find_image_fsspec, image_load_qt_1, image_load_quicktime)
(init_image_func_pointer, image_load_quartz2d)
(struct ct_color, init_color_table, free_color_table)
(lookup_rgb_color, lookup_pixel_color, colors_in_color_table)
(cross_disabled_images, x_to_xcolors, x_from_xcolors)
(x_detect_edges, x_emboss, x_laplace, x_edge_detection)
(x_disable_image, x_build_heuristic_mask)
(XBM support, XPM support, PBM support, PNG support, JPEG support)
(TIFF support, GIF support, Ghostscript support): Consolidate image
code from xfns.c, w32fns.c, and macfns.c.
(syms_of_image): Consolidate image related symbol setup here.
(init_image): Consolidate image related initializations here.
2004-03-11 00:28:24 +00:00