Mercurial > hg > xemacs-beta
annotate src/scrollbar-msw.c @ 2720:6fa9919a9a0b
[xemacs-hg @ 2005-04-08 23:10:01 by crestani]
ChangeLog addition:
2005-04-01 Marcus Crestani <crestani@xemacs.org>
The new allocator.
New configure flag: `MC_ALLOC':
* configure.ac (XE_COMPLEX_ARG_ENABLE): Add `--enable-mc-alloc' as
a new configure flag.
* configure.in (AC_INIT_PARSE_ARGS): Add `--mc-alloc' as a new
configure flag.
* configure.usage: Add description for `mc-alloc'.
DUMP_IN_EXEC:
* Makefile.in.in: Condition the installation of a separate dump
file on !DUMP_ON_EXEC.
* configure.ac (XE_COMPLEX_ARG_ENABLE): Add
`--enable-dump-in-exec' as a new configure flag.
* configure.ac: DUMP_IN_EXEC is define as default for PDUMP but
not default for MC_ALLOC.
* configure.in (AC_INIT_PARSE_ARGS): Add `--dump-in-exec' as a
new configure flag.
* configure.in: DUMP_IN_EXEC is define as default for PDUMP but
not default for MC_ALLOC.
* configure.usage: Add description for `dump-in-exec'.
lib-src/ChangeLog addition:
2005-04-01 Marcus Crestani <crestani@xemacs.org>
The new allocator.
DUMP_IN_EXEC:
* Makefile.in.in: Only compile insert-data-in-exec if
DUMP_IN_EXEC is defined.
lisp/ChangeLog addition:
2005-04-01 Marcus Crestani <crestani@xemacs.org>
The new allocator.
MEMORY_USAGE_STATS
* diagnose.el: Add new lisp function to pretty print statistics
about the new allocator.
* diagnose.el (show-mc-alloc-memory-usage): New.
modules/ChangeLog addition:
2005-04-01 Marcus Crestani <crestani@xemacs.org>
The new allocator.
Remove Lcrecords:
* postgresql/postgresql.c (allocate_pgconn): Allocate with new
allocator.
* postgresql/postgresql.c (allocate_pgresult): Allocate PGresult
with new allocator.
* postgresql/postgresql.h (struct Lisp_PGconn): Add
lrecord_header.
* postgresql/postgresql.h (struct Lisp_PGresult): Add
lrecord_header.
* ldap/eldap.c (allocate_ldap): Allocate with new allocator.
* ldap/eldap.h (struct Lisp_LDAP): Add lrecord_header.
nt/ChangeLog addition:
2005-04-01 Marcus Crestani <crestani@xemacs.org>
The new allocator.
New configure flag: `MC_ALLOC':
* config.inc.samp: Add new flag `MC_ALLOC'.
* xemacs.mak: Add flag and configuration output for `MC_ALLOC'.
New files:
* xemacs.dsp: Add source files mc-alloc.c and mc-alloc.h.
* xemacs.mak: Add new object file mc-alloc.obj to dependencies.
src/ChangeLog addition:
2005-04-01 Marcus Crestani <crestani@xemacs.org>
The new allocator.
New configure flag: `MC_ALLOC':
* config.h.in: Add new flag `MC_ALLOC'.
New files:
* Makefile.in.in: Add new object file mc-alloc.o.
* depend: Add new files to dependencies.
* mc-alloc.c: New.
* mc-alloc.h: New.
Running the new allocator from XEmacs:
* alloc.c (deadbeef_memory): Moved to mc-alloc.c.
* emacs.c (main_1): Initialize the new allocator and add
syms_of_mc_alloc.
* symsinit.h: Add syms_of_mc_alloc.
New lrecord allocation and free functions:
* alloc.c (alloc_lrecord): New. Allocates an lrecord, includes
type checking and initializing of the lrecord_header.
* alloc.c (noseeum_alloc_lrecord): Same as above, but increments
the NOSEEUM cons counter.
* alloc.c (free_lrecord): New. Calls the finalizer and frees the
lrecord.
* lrecord.h: Add lrecord allocation prototypes and comments.
Remove old lrecord FROB block allocation:
* alloc.c (allocate_lisp_storage): Former function to expand
heap. Not needed anymore, remove.
* alloc.c: Completely remove `Fixed-size type macros'
* alloc.c (release_breathing_space): Remove.
* alloc.c (memory_full): Remove release_breathing_space.
* alloc.c (refill_memory_reserve): Remove.
* alloc.c (TYPE_ALLOC_SIZE): Remove.
* alloc.c (DECLARE_FIXED_TYPE_ALLOC): Remove.
* alloc.c (ALLOCATE_FIXED_TYPE_FROM_BLOCK): Remove.
* alloc.c (ALLOCATE_FIXED_TYPE_1): Remove.
* alloc.c (ALLOCATE_FIXED_TYPE): Remove.
* alloc.c (NOSEEUM_ALLOCATE_FIXED_TYPE): Remove.
* alloc.c (struct Lisp_Free): Remove.
* alloc.c (LRECORD_FREE_P): Remove.
* alloc.c (MARK_LRECORD_AS_FREE): Remove.
* alloc.c (MARK_LRECORD_AS_NOT_FREE): Remove.
* alloc.c (PUT_FIXED_TYPE_ON_FREE_LIST): Remove.
* alloc.c (FREE_FIXED_TYPE): Remove.
* alloc.c (FREE_FIXED_TYPE_WHEN_NOT_IN_GC): Remove.
Allocate old lrecords with new allocator:
* alloc.c: DECLARE_FIXED_TYPE_ALLOC removed for all lrecords
defined in alloc.c.
* alloc.c (Fcons): Allocate with new allocator.
* alloc.c (noseeum_cons): Allocate with new allocator.
* alloc.c (make_float): Allocate with new allocator.
* alloc.c (make_bignum): Allocate with new allocator.
* alloc.c (make_bignum_bg): Allocate with new allocator.
* alloc.c (make_ratio): Allocate with new allocator.
* alloc.c (make_ratio_bg): Allocate with new allocator.
* alloc.c (make_ratio_rt): Allocate with new allocator.
* alloc.c (make_bigfloat): Allocate with new allocator.
* alloc.c (make_bigfloat_bf): Allocate with new allocator.
* alloc.c (make_compiled_function): Allocate with new allocator.
* alloc.c (Fmake_symbol): Allocate with new allocator.
* alloc.c (allocate_extent): Allocate with new allocator.
* alloc.c (allocate_event): Allocate with new allocator.
* alloc.c (make_key_data): Allocate with new allocator.
* alloc.c (make_button_data): Allocate with new allocator.
* alloc.c (make_motion_data): Allocate with new allocator.
* alloc.c (make_process_data): Allocate with new allocator.
* alloc.c (make_timeout_data): Allocate with new allocator.
* alloc.c (make_magic_data): Allocate with new allocator.
* alloc.c (make_magic_eval_data): Allocate with new allocator.
* alloc.c (make_eval_data): Allocate with new allocator.
* alloc.c (make_misc_user_data): Allocate with new allocator.
* alloc.c (Fmake_marker): Allocate with new allocator.
* alloc.c (noseeum_make_marker): Allocate with new allocator.
* alloc.c (make_uninit_string): Allocate with new allocator.
* alloc.c (resize_string): Allocate with new allocator.
* alloc.c (make_string_nocopy): Allocate with new allocator.
Garbage Collection:
* alloc.c (GC_CHECK_NOT_FREE): Remove obsolete assertions.
* alloc.c (SWEEP_FIXED_TYPE_BLOCK): Remove.
* alloc.c (SWEEP_FIXED_TYPE_BLOCK_1): Remove.
* alloc.c (sweep_conses): Remove.
* alloc.c (free_cons): Use new allocator to free.
* alloc.c (sweep_compiled_functions): Remove.
* alloc.c (sweep_floats): Remove.
* alloc.c (sweep_bignums): Remove.
* alloc.c (sweep_ratios): Remove.
* alloc.c (sweep_bigfloats): Remove.
* alloc.c (sweep_symbols): Remove.
* alloc.c (sweep_extents): Remove.
* alloc.c (sweep_events): Remove.
* alloc.c (sweep_key_data): Remove.
* alloc.c (free_key_data): Use new allocator to free.
* alloc.c (sweep_button_data): Remove.
* alloc.c (free_button_data): Use new allocator to free.
* alloc.c (sweep_motion_data): Remove.
* alloc.c (free_motion_data): Use new allocator to free.
* alloc.c (sweep_process_data): Remove.
* alloc.c (free_process_data): Use new allocator to free.
* alloc.c (sweep_timeout_data): Remove.
* alloc.c (free_timeout_data): Use new allocator to free.
* alloc.c (sweep_magic_data): Remove.
* alloc.c (free_magic_data): Use new allocator to free.
* alloc.c (sweep_magic_eval_data): Remove.
* alloc.c (free_magic_eval_data): Use new allocator to free.
* alloc.c (sweep_eval_data): Remove.
* alloc.c (free_eval_data): Use new allocator to free.
* alloc.c (sweep_misc_user_data): Remove.
* alloc.c (free_misc_user_data): Use new allocator to free.
* alloc.c (sweep_markers): Remove.
* alloc.c (free_marker): Use new allocator to free.
* alloc.c (garbage_collect_1): Remove release_breathing_space.
* alloc.c (gc_sweep): Remove all the old lcrecord and lrecord
related stuff. Sweeping now works like this: compact string
chars, finalize, sweep.
* alloc.c (common_init_alloc_early): Remove old lrecord
initializations, remove breathing_space.
* emacs.c (Fdump_emacs): Remove release_breathing_space.
* lisp.h: Remove prototype for release_breathing_space.
* lisp.h: Adjust the special cons mark makros.
Lrecord Finalizer:
* alloc.c: Add finalizer to lrecord definition.
* alloc.c (finalize_string): Add finalizer for string.
* bytecode.c: Add finalizer to lrecord definition.
* bytecode.c (finalize_compiled_function): Add finalizer for
compiled function.
* marker.c: Add finalizer to lrecord definition.
* marker.c (finalize_marker): Add finalizer for marker.
These changes build the interface to mc-alloc:
* lrecord.h (MC_ALLOC_CALL_FINALIZER): Tell mc-alloc how to
finalize lrecords.
* lrecord.h (MC_ALLOC_CALL_FINALIZER_FOR_DISKSAVE): Tell
mc-alloc how to finalize for disksave.
Unify lrecords and lcrecords:
* lisp.h (struct Lisp_String): Adjust string union hack to
new lrecord header.
* lrecord.h: Adjust comments.
* lrecord.h (struct lrecord_header): The new lrecord header
includes type, lisp-readonly, free, and uid.
* lrecord.h (set_lheader_implementation): Adjust to new
lrecord_header.
* lrecord.h (struct lrecord_implementation): The field basic_p
for indication of an old lrecord is not needed anymore, remove.
* lrecord.h (MAKE_LRECORD_IMPLEMENTATION): Remove basic_p.
* lrecord.h (MAKE_EXTERNAL_LRECORD_IMPLEMENTATION): Remove
basic_p.
* lrecord.h (copy_sized_lrecord): Remove distinction between
old lrecords and lcrecords.
* lrecord.h (copy_lrecord): Remove distinction between old
lrecords and lcrecords.
* lrecord.h (zero_sized_lrecord): Remove distinction between
old lrecords and lcrecords.
* lrecord.h (zero_lrecord): Remove distinction between old
lrecords and lcrecords.
Remove lcrecords and lcrecord lists:
* alloc.c (basic_alloc_lcrecord): Not needed anymore, remove.
* alloc.c (very_old_free_lcrecord): Not needed anymore, remove.
* alloc.c (copy_lisp_object): No more distinction between
lrecords and lcrecords.
* alloc.c (all_lcrecords): Not needed anymore, remove.
* alloc.c (make_vector_internal): Allocate as lrecord.
* alloc.c (make_bit_vector_internal): Allocate as lrecord.
* alloc.c: Completely remove `lcrecord lists'.
* alloc.c (free_description): Remove.
* alloc.c (lcrecord_list_description): Remove.
* alloc.c (mark_lcrecord_list): Remove.
* alloc.c (make_lcrecord_list): Remove.
* alloc.c (alloc_managed_lcrecord): Remove.
* alloc.c (free_managed_lcrecord): Remove.
* alloc.c (alloc_automanaged_lcrecord): Remove.
* alloc.c (free_lcrecord): Remove.
* alloc.c (lcrecord_stats): Remove.
* alloc.c (tick_lcrecord_stats): Remove.
* alloc.c (disksave_object_finalization_1): Add call to
mc_finalize_for_disksave. Remove the lcrecord way to visit all
objects.
* alloc.c (kkcc_marking): Remove XD_FLAG_FREE_LISP_OBJECT
* alloc.c (sweep_lcrecords_1): Remove.
* alloc.c (common_init_alloc_early): Remove everything related
to lcrecords, remove old lrecord initializations,
* alloc.c (init_lcrecord_lists): Not needed anymore, remove.
* alloc.c (reinit_alloc_early): Remove everything related to
lcrecords.
* alloc.c (init_alloc_once_early): Remove everything related to
lcrecords.
* buffer.c (allocate_buffer): Allocate as lrecord.
* buffer.c (nuke_all_buffer_slots): Use lrecord functions.
* buffer.c (common_init_complex_vars_of_buffer): Allocate as
lrecord.
* buffer.h (struct buffer): Add lrecord_header.
* casetab.c (allocate_case_table): Allocate as lrecord.
* casetab.h (struct Lisp_Case_Table): Add lrecord_header.
* charset.h (struct Lisp_Charset): Add lrecord_header.
* chartab.c (fill_char_table): Use lrecord functions.
* chartab.c (Fmake_char_table): Allocate as lrecord.
* chartab.c (make_char_table_entry): Allocate as lrecord.
* chartab.c (copy_char_table_entry): Allocate as lrecord.
* chartab.c (Fcopy_char_table): Allocate as lrecord.
* chartab.c (put_char_table): Use lrecord functions.
* chartab.h (struct Lisp_Char_Table_Entry): Add lrecord_header.
* chartab.h (struct Lisp_Char_Table): Add lrecord_header.
* console-impl.h (struct console): Add lrecord_header.
* console-msw-impl.h (struct Lisp_Devmode): Add lrecord_header.
* console-msw-impl.h (struct mswindows_dialog_id): Add
lrecord_header.
* console.c (allocate_console): Allocate as lrecord.
* console.c (nuke_all_console_slots): Use lrecord functions.
* console.c (common_init_complex_vars_of_console): Allocate as
lrecord.
* data.c (make_weak_list): Allocate as lrecord.
* data.c (make_weak_box): Allocate as lrecord.
* data.c (make_ephemeron): Allocate as lrecord.
* database.c (struct Lisp_Database): Add lrecord_header.
* database.c (allocate_database): Allocate as lrecord.
* device-impl.h (struct device): Add lrecord_header.
* device-msw.c (allocate_devmode): Allocate as lrecord.
* device.c (nuke_all_device_slots): Use lrecord functions.
* device.c (allocate_device): Allocate as lrecord.
* dialog-msw.c (handle_question_dialog_box): Allocate as lrecord.
* elhash.c (struct Lisp_Hash_Table): Add lrecord_header.
* elhash.c (make_general_lisp_hash_table): Allocate as lrecord.
* elhash.c (Fcopy_hash_table): Allocate as lrecord.
* event-stream.c: Lcrecord lists Vcommand_builder_free_list and
Vtimeout_free_list are no longer needed. Remove.
* event-stream.c (allocate_command_builder): Allocate as lrecord.
* event-stream.c (free_command_builder): Use lrecord functions.
* event-stream.c (event_stream_generate_wakeup): Allocate as
lrecord.
* event-stream.c (event_stream_resignal_wakeup): Use lrecord
functions.
* event-stream.c (event_stream_disable_wakeup): Use lrecord
functions.
* event-stream.c (reinit_vars_of_event_stream): Lcrecord lists
remove.
* events.h (struct Lisp_Timeout): Add lrecord_header.
* events.h (struct command_builder): Add lrecord_header.
* extents-impl.h (struct extent_auxiliary): Add lrecord_header.
* extents-impl.h (struct extent_info): Add lrecord_header.
* extents.c (allocate_extent_auxiliary): Allocate as lrecord.
* extents.c (allocate_extent_info): Allocate as lrecord.
* extents.c (copy_extent): Allocate as lrecord.
* faces.c (allocate_face): Allocate as lrecord.
* faces.h (struct Lisp_Face): Add lrecord_header.
* file-coding.c (allocate_coding_system): Allocate as lrecord.
* file-coding.c (Fcopy_coding_system): Allocate as lrecord.
* file-coding.h (struct Lisp_Coding_System): Add lrecord_header.
* fns.c (Ffillarray): Allocate as lrecord.
* frame-impl.h (struct frame): Add lrecord_header.
* frame.c (nuke_all_frame_slots): Use lrecord functions.
* frame.c (allocate_frame_core): Allocate as lrecord.
* glyphs.c (allocate_image_instance): Allocate as lrecord.
* glyphs.c (Fcolorize_image_instance): Allocate as lrecord.
* glyphs.c (allocate_glyph): Allocate as lrecord.
* glyphs.h (struct Lisp_Image_Instance): Add lrecord_header.
* glyphs.h (struct Lisp_Glyph): Add lrecord_header.
* gui.c (allocate_gui_item): Allocate as lrecord.
* gui.h (struct Lisp_Gui_Item): Add lrecord_header.
* keymap.c (struct Lisp_Keymap): Add lrecord_header.
* keymap.c (make_keymap): Allocate as lrecord.
* lisp.h (struct Lisp_Vector): Add lrecord_header.
* lisp.h (struct Lisp_Bit_Vector): Add lrecord_header.
* lisp.h (struct weak_box): Add lrecord_header.
* lisp.h (struct ephemeron): Add lrecord_header.
* lisp.h (struct weak_list): Add lrecord_header.
* lrecord.h (struct lcrecord_header): Not used, remove.
* lrecord.h (struct free_lcrecord_header): Not used, remove.
* lrecord.h (struct lcrecord_list): Not needed anymore, remove.
* lrecord.h (lcrecord_list): Not needed anymore, remove.
* lrecord.h: (enum data_description_entry_flags): Remove
XD_FLAG_FREE_LISP_OBJECT.
* lstream.c: Lrecord list Vlstream_free_list remove.
* lstream.c (Lstream_new): Allocate as lrecord.
* lstream.c (Lstream_delete): Use lrecod functions.
* lstream.c (reinit_vars_of_lstream): Vlstream_free_list
initialization remove.
* lstream.h (struct lstream): Add lrecord_header.
* emacs.c (main_1): Remove lstream initialization.
* mule-charset.c (make_charset): Allocate as lrecord.
* objects-impl.h (struct Lisp_Color_Instance): Add
lrecord_header.
* objects-impl.h (struct Lisp_Font_Instance): Add lrecord_header.
* objects.c (Fmake_color_instance): Allocate as lrecord.
* objects.c (Fmake_font_instance): Allocate as lrecord.
* objects.c (reinit_vars_of_objects): Allocate as lrecord.
* opaque.c: Lcreord list Vopaque_ptr_list remove.
* opaque.c (make_opaque): Allocate as lrecord.
* opaque.c (make_opaque_ptr): Allocate as lrecord.
* opaque.c (free_opaque_ptr): Use lrecord functions.
* opaque.c (reinit_opaque_early):
* opaque.c (init_opaque_once_early): Vopaque_ptr_list
initialization remove.
* opaque.h (Lisp_Opaque): Add lrecord_header.
* opaque.h (Lisp_Opaque_Ptr): Add lrecord_header.
* emacs.c (main_1): Remove opaque variable initialization.
* print.c (default_object_printer): Use new lrecord_header.
* print.c (print_internal): Use new lrecord_header.
* print.c (debug_p4): Use new lrecord_header.
* process.c (make_process_internal): Allocate as lrecord.
* procimpl.h (struct Lisp_Process): Add lrecord_header.
* rangetab.c (Fmake_range_table): Allocate as lrecord.
* rangetab.c (Fcopy_range_table): Allocate as lrecord.
* rangetab.h (struct Lisp_Range_Table): Add lrecord_header.
* scrollbar.c (create_scrollbar_instance): Allocate as lrecord.
* scrollbar.h (struct scrollbar_instance): Add lrecord_header.
* specifier.c (make_specifier_internal): Allocate as lrecord.
* specifier.h (struct Lisp_Specifier): Add lrecord_header.
* symbols.c:
* symbols.c (Fmake_variable_buffer_local): Allocate as lrecord.
* symbols.c (Fdontusethis_set_symbol_value_handler): Allocate
as lrecord.
* symbols.c (Fdefvaralias): Allocate as lrecord.
* symeval.h (struct symbol_value_magic): Add lrecord_header.
* toolbar.c (update_toolbar_button): Allocate as lrecord.
* toolbar.h (struct toolbar_button): Add lrecord_header.
* tooltalk.c (struct Lisp_Tooltalk_Message): Add lrecord_header.
* tooltalk.c (make_tooltalk_message): Allocate as lrecord.
* tooltalk.c (struct Lisp_Tooltalk_Pattern): Add lrecord_header.
* tooltalk.c (make_tooltalk_pattern): Allocate as lrecord.
* ui-gtk.c (allocate_ffi_data): Allocate as lrecord.
* ui-gtk.c (allocate_emacs_gtk_object_data): Allocate as lrecord.
* ui-gtk.c (allocate_emacs_gtk_boxed_data): Allocate as lrecord.
* ui-gtk.h (structs): Add lrecord_header.
* window-impl.h (struct window): Add lrecord_header.
* window-impl.h (struct window_mirror): Add lrecord_header.
* window.c (allocate_window): Allocate as lrecord.
* window.c (new_window_mirror): Allocate as lrecord.
* window.c (make_dummy_parent): Allocate as lrecord.
MEMORY_USAGE_STATS
* alloc.c (fixed_type_block_overhead): Not used anymore, remove.
* buffer.c (compute_buffer_usage): Get storage size from new
allocator.
* marker.c (compute_buffer_marker_usage): Get storage size from
new allocator.
* mule-charset.c (compute_charset_usage): Get storage size from
new allocator.
* scrollbar-gtk.c (gtk_compute_scrollbar_instance_usage): Get
storage size from new allocator.
* scrollbar-msw.c (mswindows_compute_scrollbar_instance_usage):
Get storage size from new allocator.
* scrollbar-x.c (x_compute_scrollbar_instance_usage): Get
storage size from new allocator.
* scrollbar.c (compute_scrollbar_instance_usage): Get storage
size from new allocator.
* unicode.c (compute_from_unicode_table_size_1): Get storage
size from new allocator.
* unicode.c (compute_to_unicode_table_size_1): Get storage size
from new allocator.
* window.c (compute_window_mirror_usage): Get storage size from
new allocator.
* window.c (compute_window_usage): Get storage size from new
allocator.
MC_ALLOC_TYPE_STATS:
* alloc.c (alloc_lrecord): Bump lrecord count.
* alloc.c (noseeum_alloc_lrecord): Bump lrecord count.
* alloc.c (struct lrecord_stats): Storage for counts.
* alloc.c (init_lrecord_stats): Zero statistics.
* alloc.c (inc_lrecord_stats): Increase the statistic.
* alloc.c (dec_lrecord_stats): Decrease the statistic.
* alloc.c (gc_plist_hack): Used to print the information.
* alloc.c (Fgarbage_collect): Return the collected information.
* mc-alloc.c (remove_cell): Decrease lrecord count.
* mc-alloc.h: Set flag MC_ALLOC_TYPE_STATS.
* emacs.c (main_1): Init lrecord statistics.
* lrecord.h: Add prototypes for *_lrecord_stats.
Strings:
* alloc.c (Fmake_string): Initialize ascii_begin to zero.
* alloc.c (gc_count_num_short_string_in_use): Remove.
* alloc.c (gc_count_string_total_size): Remove.
* alloc.c (gc_count_short_string_total_size): Remove.
* alloc.c (debug_string_purity): Remove.
* alloc.c (debug_string_purity_print): Remove.
* alloc.c (sweep_strings): Remove.
Remove static C-readonly Lisp objects:
* alloc.c (c_readonly): Not needed anymore, remove.
* alloc.c (GC_CHECK_LHEADER_INVARIANTS): Remove some obsolete
lheader invariants assertions.
* buffer.c (DEFVAR_BUFFER_LOCAL_1): Allocate dynamically.
* console.c (DEFVAR_CONSOLE_LOCAL_1): Allocate dynamically.
* gpmevent.c: Indirection via MC_ALLOC_Freceive_gpm_event.
* gpmevent.c (Fgpm_enable): Allocate dynamically.
* gpmevent.c (syms_of_gpmevent): Allocate dynamically.
* lisp.h (C_READONLY): Not needed anymore, remove.
* lisp.h (DEFUN): Allocate dynamically.
* lrecord.h (C_READONLY_RECORD_HEADER_P): Not needed anymore,
remove.
* lrecord.h (SET_C_READONLY_RECORD_HEADER): Not needed anymore,
remove.
* symbols.c (guts_of_unbound_marker):
* symeval.h (defsubr): Allocate dynamically.
* symeval.h (DEFSUBR_MACRO): Allocate dynamically.
* symeval.h (DEFVAR_ SYMVAL_FWD): Allocate dynamically.
* tests.c (TESTS_DEFSUBR): Allocate dynamically.
Definition of mcpro:
* lisp.h: Add mcpro prototypes.
* alloc.c (common_init_alloc_early): Add initialization for
mcpros.
* alloc.c (mcpro_description_1): New.
* alloc.c (mcpro_description): New.
* alloc.c (mcpros_description_1): New.
* alloc.c (mcpros_description): New.
* alloc.c (mcpro_one_name_description_1): New.
* alloc.c (mcpro_one_name_description): New.
* alloc.c (mcpro_names_description_1): New.
* alloc.c (mcpro_names_description): New.
* alloc.c (mcpros): New.
* alloc.c (mcpro_names): New.
* alloc.c (mcpro_1): New.
* alloc.c (mc_pro): New.
* alloc.c (garbage_collect_1): Add mcpros to root set.
Usage of mcpro:
* alloc.c (make_string_nocopy): Add string to root set.
* symbols.c (init_symbols_once_early): Add Qunbound to root set.
Changes to the Portable Dumper:
* alloc.c (FREE_OR_REALLOC_BEGIN): Since dumped objects can be
freed with the new allocator, remove assertion for !DUMPEDP.
* dumper.c: Adjust comments, increase PDUMP_HASHSIZE.
* dumper.c (pdump_make_hash): Shift address only 2 bytes, to
avoid collisions.
* dumper.c (pdump_objects_unmark): No more mark bits within
the object, remove.
* dumper.c (mc_addr_elt): New. Element data structure for mc
hash table.
* dumper.c (pdump_mc_hash): New hash table: `lookup table'.
* dumper.c (pdump_get_mc_addr): New. Lookup for hash table.
* dumper.c (pdump_get_indirect_mc_addr): New. Lookup for
convertibles.
* dumper.c (pdump_put_mc_addr): New. Putter for hash table.
* dumper.c (pdump_dump_mc_data): New. Writes the table for
relocation at load time to the dump file.
* dumper.c (pdump_scan_lisp_objects_by_alignment): New.
Visits all dumped Lisp objects.
* dumper.c (pdump_scan_non_lisp_objects_by_alignment): New.
Visits all other dumped objects.
* dumper.c (pdump_reloc_one_mc): New. Updates all pointers
of an object by using the hash table pdump_mc_hash.
* dumper.c (pdump_reloc_one): Replaced by pdump_reloc_one_mc.
* dumper.c (pdump): Change the structure of the dump file, add
the mc post dump relocation table to dump file.
* dumper.c (pdump_load_finish): Hand all dumped objects to the
new allocator and use the mc post dump relocation table for
relocating the dumped objects at dump file load time, free not
longer used data structures.
* dumper.c (pdump_load): Free the dump file.
* dumper.h: Remove pdump_objects_unmark.
* lrecord.h (DUMPEDP): Dumped objects can be freed, remove.
DUMP_IN_EXEC:
* Makefile.in.in: Linking for and with dump in executable only if
DUMP_IN_EXEC is defined.
* config.h.in: Add new flag `DUMP_IN_EXEC'
* emacs.c: Condition dump-data.h on DUMP_IN_EXEC.
* emacs.c (main_1): Flag `-si' only works if dump image is
written into executable.
Miscellanious
* lrecord.h (enum lrecord_type): Added numbers to all types,
very handy for debugging.
* xemacs.def.in.in: Add mc-alloc functions to make them visible
to the modules.
author | crestani |
---|---|
date | Fri, 08 Apr 2005 23:11:35 +0000 |
parents | 04bc9d2f42c7 |
children | 1e7cc382eb16 |
rev | line source |
---|---|
428 | 1 /* scrollbar implementation -- mswindows interface. |
2 Copyright (C) 1994, 1995 Board of Trustees, University of Illinois. | |
3 Copyright (C) 1994 Amdahl Corporation. | |
4 Copyright (C) 1995 Sun Microsystems, Inc. | |
5 Copyright (C) 1995 Darrell Kindred <dkindred+@cmu.edu>. | |
771 | 6 Copyright (C) 2001, 2002 Ben Wing. |
428 | 7 |
8 This file is part of XEmacs. | |
9 | |
10 XEmacs is free software; you can redistribute it and/or modify it | |
11 under the terms of the GNU General Public License as published by the | |
12 Free Software Foundation; either version 2, or (at your option) any | |
13 later version. | |
14 | |
15 XEmacs is distributed in the hope that it will be useful, but WITHOUT | |
16 ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or | |
17 FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License | |
18 for more details. | |
19 | |
20 You should have received a copy of the GNU General Public License | |
21 along with XEmacs; see the file COPYING. If not, write to | |
22 the Free Software Foundation, Inc., 59 Temple Place - Suite 330, | |
23 Boston, MA 02111-1307, USA. */ | |
24 | |
25 /* Synched up with: Not in FSF. */ | |
26 | |
771 | 27 /* This file essentially Mule-ized (except perhaps some Unicode splitting). |
28 5-2000. */ | |
29 | |
428 | 30 #include <config.h> |
31 #include "lisp.h" | |
32 | |
800 | 33 #include "device.h" |
617 | 34 #include "elhash.h" |
428 | 35 #include "events.h" |
872 | 36 #include "frame-impl.h" |
617 | 37 #include "opaque.h" |
428 | 38 #include "scrollbar.h" |
39 #include "specifier.h" | |
872 | 40 #include "window-impl.h" |
428 | 41 |
872 | 42 #include "console-msw-impl.h" |
800 | 43 #include "scrollbar-msw.h" |
44 | |
428 | 45 /* We use a similar sort of vertical scrollbar drag hack for mswindows |
46 * scrollbars as is used for Motif or Lucid scrollbars under X. | |
47 * We do character-based instead of line-based scrolling, which can mean that | |
48 * without the hack it is impossible to drag to the end of a buffer. */ | |
49 #define VERTICAL_SCROLLBAR_DRAG_HACK | |
50 | |
51 static int vertical_drag_in_progress = 0; | |
673 | 52 extern Lisp_Object mswindows_find_frame (HWND hwnd); |
428 | 53 |
617 | 54 /* As long as the HWND is around, the scrollbar instance must be GC-protected. |
55 We have gotten crashes, apparently from trying to access a dead, freed | |
56 frame inside of a window mirror pointed to by the scrollbar structure. */ | |
57 static Lisp_Object Vmswindows_scrollbar_instance_table; | |
58 | |
428 | 59 static void |
60 mswindows_create_scrollbar_instance (struct frame *f, int vertical, | |
61 struct scrollbar_instance *sb) | |
62 { | |
63 int orientation; | |
617 | 64 Lisp_Object ptr; |
442 | 65 |
428 | 66 sb->scrollbar_data = xnew_and_zero (struct mswindows_scrollbar_data); |
442 | 67 |
428 | 68 if (vertical) |
69 orientation = SBS_VERT; | |
70 else | |
71 orientation = SBS_HORZ; | |
442 | 72 |
428 | 73 SCROLLBAR_MSW_HANDLE (sb) = |
771 | 74 qxeCreateWindowEx (0, XETEXT ("SCROLLBAR"), 0, orientation|WS_CHILD, |
75 CW_USEDEFAULT, CW_USEDEFAULT, | |
76 CW_USEDEFAULT, CW_USEDEFAULT, | |
77 FRAME_MSWINDOWS_HANDLE (f), | |
78 NULL, NULL, NULL); | |
546 | 79 SCROLLBAR_MSW_INFO (sb).cbSize = sizeof (SCROLLINFO); |
428 | 80 SCROLLBAR_MSW_INFO (sb).fMask = SIF_ALL; |
617 | 81 GetScrollInfo (SCROLLBAR_MSW_HANDLE (sb), SB_CTL, |
82 &SCROLLBAR_MSW_INFO (sb)); | |
83 ptr = make_opaque_ptr (SCROLLBAR_MSW_HANDLE (sb)); | |
84 Fputhash (ptr, wrap_scrollbar_instance (sb), | |
85 Vmswindows_scrollbar_instance_table); | |
771 | 86 qxeSetWindowLong (SCROLLBAR_MSW_HANDLE (sb), GWL_USERDATA, |
617 | 87 (LONG) LISP_TO_VOID (ptr)); |
428 | 88 } |
89 | |
90 static void | |
91 mswindows_free_scrollbar_instance (struct scrollbar_instance *sb) | |
92 { | |
617 | 93 void *opaque = |
771 | 94 (void *) qxeGetWindowLong (SCROLLBAR_MSW_HANDLE (sb), GWL_USERDATA); |
617 | 95 Lisp_Object ptr; |
96 | |
826 | 97 ptr = VOID_TO_LISP (opaque); |
617 | 98 assert (OPAQUE_PTRP (ptr)); |
99 ptr = Fremhash (ptr, Vmswindows_scrollbar_instance_table); | |
100 assert (!NILP (ptr)); | |
428 | 101 DestroyWindow (SCROLLBAR_MSW_HANDLE (sb)); |
442 | 102 if (sb->scrollbar_data) |
1726 | 103 xfree (sb->scrollbar_data, void *); |
428 | 104 } |
105 | |
106 static void | |
611 | 107 unshow_that_mofo (void *handle) |
108 { | |
109 ShowScrollBar ((HWND) handle, SB_CTL, 0); | |
110 } | |
111 | |
112 static void | |
428 | 113 mswindows_release_scrollbar_instance (struct scrollbar_instance *sb) |
114 { | |
611 | 115 if (gc_in_progress) |
116 /* #### way bogus! need to remove the offending call. | |
117 see mark_redisplay(). */ | |
118 register_post_gc_action (unshow_that_mofo, | |
119 (void *) SCROLLBAR_MSW_HANDLE (sb)); | |
120 else | |
121 ShowScrollBar (SCROLLBAR_MSW_HANDLE (sb), SB_CTL, 0); | |
428 | 122 SCROLLBAR_MSW_SIZE (sb) = 0; |
123 } | |
124 | |
125 #define UPDATE_POS_FIELD(field) \ | |
126 if (new_##field >= 0 && SCROLLBAR_MSW_DATA (sb)->field != new_##field) { \ | |
127 SCROLLBAR_MSW_DATA (sb)->field = new_##field; \ | |
128 pos_changed = 1; \ | |
129 } | |
130 | |
131 static void | |
2286 | 132 mswindows_update_scrollbar_instance_values (struct window *UNUSED (w), |
428 | 133 struct scrollbar_instance *sb, |
2286 | 134 int UNUSED (new_line_increment), |
135 int UNUSED (new_page_increment), | |
428 | 136 int new_minimum, int new_maximum, |
137 int new_slider_size, | |
138 int new_slider_position, | |
139 int new_scrollbar_width, | |
140 int new_scrollbar_height, | |
141 int new_scrollbar_x, | |
142 int new_scrollbar_y) | |
143 { | |
144 int pos_changed = 0; | |
771 | 145 int vert = qxeGetWindowLong (SCROLLBAR_MSW_HANDLE (sb), GWL_STYLE) & SBS_VERT; |
428 | 146 |
147 #if 0 | |
148 stderr_out ("[%d, %d], page = %d, pos = %d, inhibit = %d\n", new_minimum, new_maximum, | |
149 new_slider_size, new_slider_position,inhibit_slider_size_change); | |
150 #endif | |
151 | |
152 /* These might be optimized, but since at least one will change at each | |
153 call, it's probably not worth it. */ | |
154 SCROLLBAR_MSW_INFO (sb).nMin = new_minimum; | |
155 SCROLLBAR_MSW_INFO (sb).nMax = new_maximum; | |
156 SCROLLBAR_MSW_INFO (sb).nPage = new_slider_size + 1; /* +1 for DISABLENOSCROLL */ | |
157 SCROLLBAR_MSW_INFO (sb).nPos = new_slider_position; | |
158 #ifndef VERTICAL_SCROLLBAR_DRAG_HACK | |
159 SCROLLBAR_MSW_INFO (sb).fMask = ((vert && vertical_drag_in_progress) | |
160 ? SIF_RANGE | SIF_POS | |
161 : SIF_ALL | SIF_DISABLENOSCROLL); | |
162 #else | |
163 SCROLLBAR_MSW_INFO (sb).fMask = SIF_ALL | SIF_DISABLENOSCROLL; | |
164 | |
165 /* Ignore XEmacs' requests to update the thumb position and size; they don't | |
166 * bear any relation to reality because we're reporting made-up positions */ | |
167 if (!(vert && vertical_drag_in_progress)) | |
168 #endif | |
169 SetScrollInfo (SCROLLBAR_MSW_HANDLE (sb), SB_CTL, &SCROLLBAR_MSW_INFO (sb), | |
170 TRUE); | |
171 | |
172 UPDATE_POS_FIELD (scrollbar_x); | |
173 UPDATE_POS_FIELD (scrollbar_y); | |
174 UPDATE_POS_FIELD (scrollbar_width); | |
175 UPDATE_POS_FIELD (scrollbar_height); | |
176 | |
442 | 177 if (pos_changed) |
428 | 178 { |
617 | 179 MoveWindow (SCROLLBAR_MSW_HANDLE (sb), |
180 new_scrollbar_x, new_scrollbar_y, | |
181 new_scrollbar_width, new_scrollbar_height, | |
182 TRUE); | |
428 | 183 } |
184 } | |
185 | |
186 static void | |
2286 | 187 mswindows_update_scrollbar_instance_status (struct window *UNUSED (w), |
188 int UNUSED (active), int size, | |
428 | 189 struct scrollbar_instance *sb) |
190 { | |
191 if (SCROLLBAR_MSW_SIZE (sb) != size) | |
192 { | |
193 SCROLLBAR_MSW_SIZE (sb) = size; | |
194 ShowScrollBar (SCROLLBAR_MSW_HANDLE (sb), SB_CTL, | |
195 SCROLLBAR_MSW_SIZE (sb)); | |
196 SCROLLBAR_MSW_INFO(sb).fMask |= SIF_DISABLENOSCROLL; | |
197 SetScrollInfo(SCROLLBAR_MSW_HANDLE (sb), SB_CTL, &SCROLLBAR_MSW_INFO (sb), TRUE); | |
198 } | |
199 } | |
200 | |
201 void | |
2286 | 202 mswindows_handle_scrollbar_event (HWND hwnd, int code, int UNUSED (pos)) |
428 | 203 { |
204 struct frame *f; | |
205 Lisp_Object win, frame; | |
617 | 206 struct scrollbar_instance *sb = 0; |
207 void *v; | |
428 | 208 SCROLLINFO scrollinfo; |
771 | 209 int vert = qxeGetWindowLong (hwnd, GWL_STYLE) & SBS_VERT; |
428 | 210 int value; |
211 | |
771 | 212 v = (void *) qxeGetWindowLong (hwnd, GWL_USERDATA); |
617 | 213 if (!v) |
546 | 214 { |
617 | 215 /* apparently this can happen, as it was definitely necessary |
216 to put the check in for sb below (VERTICAL_SCROLLBAR_DRAG_HACK) */ | |
546 | 217 frame = mswindows_find_frame (hwnd); |
218 f = XFRAME (frame); | |
219 win = FRAME_SELECTED_WINDOW (f); | |
220 } | |
221 else | |
222 { | |
617 | 223 Lisp_Object ptr; |
826 | 224 ptr = VOID_TO_LISP (v); |
617 | 225 assert (OPAQUE_PTRP (ptr)); |
226 ptr = Fgethash (ptr, Vmswindows_scrollbar_instance_table, Qnil); | |
227 sb = XSCROLLBAR_INSTANCE (ptr); | |
664 | 228 /* #### we're still hitting an abort here with 0 as the second |
229 parameter, although only occasionally. It seems that sometimes we | |
230 receive events for scrollbars that don't exist anymore. I assume | |
231 it must happen like this: The user does something that causes a | |
232 scrollbar to disappear (e.g. Alt-TAB, causing recomputation of | |
233 everything in the new frame) and then immediately uses the mouse | |
234 wheel, generating scrollbar events. Both events get posted before | |
235 we have a chance to process them, and in processing the first, the | |
236 scrollbar mentioned in the second disappears. */ | |
237 win = real_window (sb->mirror, 1); | |
238 if (NILP (win)) | |
239 return; | |
617 | 240 frame = WINDOW_FRAME (XWINDOW (win)); |
546 | 241 f = XFRAME (frame); |
242 } | |
428 | 243 |
673 | 244 /* SB_LINEDOWN == SB_CHARLEFT etc. This is the way they will |
245 always be - any Windows is binary compatible backward with | |
246 old programs */ | |
428 | 247 |
248 switch (code) | |
249 { | |
250 case SB_LINEDOWN: | |
251 mswindows_enqueue_misc_user_event | |
252 (frame, vert ? Qscrollbar_line_down : Qscrollbar_char_right, win); | |
253 break; | |
442 | 254 |
428 | 255 case SB_LINEUP: |
256 mswindows_enqueue_misc_user_event | |
257 (frame, vert ? Qscrollbar_line_up : Qscrollbar_char_left, win); | |
258 break; | |
442 | 259 |
428 | 260 case SB_PAGEDOWN: |
261 mswindows_enqueue_misc_user_event | |
262 (win, vert ? Qscrollbar_page_down : Qscrollbar_page_right, | |
263 vert ? Fcons (win, Qnil) : win); | |
264 break; | |
265 | |
266 case SB_PAGEUP: | |
267 mswindows_enqueue_misc_user_event | |
268 (frame, | |
269 vert ? Qscrollbar_page_up : Qscrollbar_page_left, | |
270 vert ? Fcons (win, Qnil) : win); | |
271 break; | |
442 | 272 |
428 | 273 case SB_BOTTOM: |
274 mswindows_enqueue_misc_user_event | |
275 (frame, vert ? Qscrollbar_to_bottom : Qscrollbar_to_right, win); | |
276 break; | |
277 | |
278 case SB_TOP: | |
279 mswindows_enqueue_misc_user_event | |
280 (frame, vert ? Qscrollbar_to_top : Qscrollbar_to_left, win); | |
281 break; | |
282 | |
283 case SB_THUMBTRACK: | |
284 case SB_THUMBPOSITION: | |
285 scrollinfo.cbSize = sizeof(SCROLLINFO); | |
286 scrollinfo.fMask = SIF_ALL; | |
287 GetScrollInfo (hwnd, SB_CTL, &scrollinfo); | |
288 vertical_drag_in_progress = vert; | |
289 #ifdef VERTICAL_SCROLLBAR_DRAG_HACK | |
290 if (vert && (scrollinfo.nTrackPos > scrollinfo.nPos)) | |
291 /* new buffer position = | |
292 * buffer position at start of drag + | |
293 * ((text remaining in buffer at start of drag) * | |
294 * (amount that the thumb has been moved) / | |
295 * (space that remained past end of the thumb at start of drag)) */ | |
296 value = (int) | |
297 (scrollinfo.nPos | |
298 + (((double) | |
299 (scrollinfo.nMax - scrollinfo.nPos) | |
300 * (scrollinfo.nTrackPos - scrollinfo.nPos)) | |
301 / (scrollinfo.nMax - scrollinfo.nPage - scrollinfo.nPos))) | |
302 - 2; /* ensure that the last line doesn't disappear off screen */ | |
303 else | |
304 #endif | |
305 value = scrollinfo.nTrackPos; | |
306 mswindows_enqueue_misc_user_event | |
307 (frame, | |
308 vert ? Qscrollbar_vertical_drag : Qscrollbar_horizontal_drag, | |
309 Fcons (win, make_int (value))); | |
310 break; | |
311 | |
312 case SB_ENDSCROLL: | |
313 #ifdef VERTICAL_SCROLLBAR_DRAG_HACK | |
546 | 314 if (vertical_drag_in_progress && sb) |
428 | 315 /* User has just dropped the thumb - finally update it */ |
316 SetScrollInfo (SCROLLBAR_MSW_HANDLE (sb), SB_CTL, | |
317 &SCROLLBAR_MSW_INFO (sb), TRUE); | |
318 #endif | |
319 vertical_drag_in_progress = 0; | |
320 break; | |
321 } | |
322 } | |
323 | |
324 static int | |
771 | 325 can_scroll (struct scrollbar_instance *scrollbar) |
428 | 326 { |
327 return scrollbar != NULL | |
328 && IsWindowVisible (SCROLLBAR_MSW_HANDLE (scrollbar)) | |
329 && IsWindowEnabled (SCROLLBAR_MSW_HANDLE (scrollbar)); | |
330 } | |
331 | |
332 int | |
464 | 333 mswindows_handle_mousewheel_event (Lisp_Object frame, int keys, int delta, |
334 POINTS where) | |
428 | 335 { |
442 | 336 int hasVertBar, hasHorzBar; /* Indicates presence of scroll bars */ |
428 | 337 unsigned wheelScrollLines = 0; /* Number of lines per wheel notch */ |
826 | 338 Lisp_Object win = Qnil, corpore, sano; |
464 | 339 struct window_mirror *mirror; |
707 | 340 int mene, _mene, tekel, upharsin; |
341 Charbpos mens, sana; | |
342 Charcount in; | |
343 struct window *needle_in_haystack = 0; | |
464 | 344 POINT donde_esta; |
428 | 345 |
464 | 346 donde_esta.x = where.x; |
347 donde_esta.y = where.y; | |
348 | |
349 /* Find the window to scroll */ | |
350 | |
707 | 351 /* The mouse event could actually occur outside of the emacs |
352 frame. */ | |
353 if (ScreenToClient (FRAME_MSWINDOWS_HANDLE (XFRAME (frame)), | |
354 &donde_esta) != 0) | |
355 { | |
819 | 356 /* stderr_out ("donde_esta: %d %d\n", donde_esta.x, donde_esta.y); */ |
357 pixel_to_glyph_translation (XFRAME (frame), donde_esta.x, donde_esta.y, | |
358 &mene, &_mene, &tekel, &upharsin, | |
359 &needle_in_haystack, | |
360 &mens, &sana, &in, &corpore, &sano); | |
361 | |
362 if (needle_in_haystack) | |
363 { | |
364 win = wrap_window (needle_in_haystack); | |
365 /* stderr_out ("found needle\n"); | |
366 debug_print (win); */ | |
367 } | |
707 | 368 } |
819 | 369 |
370 if (!needle_in_haystack) | |
707 | 371 { |
372 win = FRAME_SELECTED_WINDOW (XFRAME (frame)); | |
373 needle_in_haystack = XWINDOW (win); | |
374 } | |
464 | 375 |
707 | 376 mirror = find_window_mirror (needle_in_haystack); |
428 | 377 |
378 /* Check that there is something to scroll */ | |
379 hasVertBar = can_scroll (mirror->scrollbar_vertical_instance); | |
380 hasHorzBar = can_scroll (mirror->scrollbar_horizontal_instance); | |
381 if (!hasVertBar && !hasHorzBar) | |
382 return FALSE; | |
383 | |
384 /* No support for panning and zooming, so ignore */ | |
385 if (keys & (MK_SHIFT | MK_CONTROL)) | |
386 return FALSE; | |
387 | |
388 /* Get the number of lines per wheel delta */ | |
771 | 389 qxeSystemParametersInfo (SPI_GETWHEELSCROLLLINES, 0, &wheelScrollLines, 0); |
428 | 390 |
391 /* Calculate the amount to scroll */ | |
392 if (wheelScrollLines == WHEEL_PAGESCROLL) | |
393 { | |
394 /* Scroll by a page */ | |
395 Lisp_Object function; | |
396 if (hasVertBar) | |
397 function = delta > 0 ? Qscrollbar_page_up : Qscrollbar_page_down; | |
398 else | |
399 function = delta > 0 ? Qscrollbar_page_left : Qscrollbar_page_right; | |
400 mswindows_enqueue_misc_user_event (frame, function, Fcons (win, Qnil)); | |
401 } | |
402 else /* Scroll by a number of lines */ | |
403 { | |
404 /* Calc the number of lines to scroll */ | |
405 int toScroll = MulDiv (delta, wheelScrollLines, WHEEL_DELTA); | |
406 | |
407 /* Do the scroll */ | |
408 Lisp_Object function; | |
409 if (hasVertBar) | |
410 function = delta > 0 ? Qscrollbar_line_up : Qscrollbar_line_down; | |
411 else | |
412 function = delta > 0 ? Qscrollbar_char_left : Qscrollbar_char_right; | |
413 if (toScroll < 0) | |
414 toScroll = -toScroll; | |
415 while (toScroll--) | |
416 mswindows_enqueue_misc_user_event (frame, function, win); | |
417 } | |
418 | |
419 return TRUE; | |
420 } | |
421 | |
422 #ifdef MEMORY_USAGE_STATS | |
423 | |
424 static int | |
2286 | 425 mswindows_compute_scrollbar_instance_usage (struct device *UNUSED (d), |
426 struct scrollbar_instance *inst, | |
427 struct overhead_stats *ovstats) | |
428 | 428 { |
429 int total = 0; | |
430 | |
431 while (inst) | |
432 { | |
433 struct mswindows_scrollbar_data *data = | |
434 (struct mswindows_scrollbar_data *) inst->scrollbar_data; | |
435 | |
2720 | 436 #ifdef MC_ALLOC |
437 total += mc_alloced_storage_size (sizeof (*data), ovstats); | |
438 #else /* not MC_ALLOC */ | |
428 | 439 total += malloced_storage_size (data, sizeof (*data), ovstats); |
2720 | 440 #endif /* not MC_ALLOC */ |
428 | 441 inst = inst->next; |
442 } | |
443 | |
444 return total; | |
445 } | |
446 | |
447 #endif /* MEMORY_USAGE_STATS */ | |
448 | |
449 /************************************************************************/ | |
450 /* Device-specific ghost specifiers initialization */ | |
451 /************************************************************************/ | |
452 | |
617 | 453 DEFUN ("mswindows-init-scrollbar-metrics", Fmswindows_init_scrollbar_metrics, |
454 1, 1, 0, /* | |
428 | 455 */ |
456 (locale)) | |
457 { | |
458 if (DEVICEP (locale)) | |
459 { | |
460 add_spec_to_ghost_specifier (Vscrollbar_width, | |
461 make_int (GetSystemMetrics (SM_CXVSCROLL)), | |
462 locale, Qmswindows, Qnil); | |
463 add_spec_to_ghost_specifier (Vscrollbar_height, | |
464 make_int (GetSystemMetrics (SM_CYHSCROLL)), | |
465 locale, Qmswindows, Qnil); | |
466 } | |
467 return Qnil; | |
468 } | |
469 | |
470 | |
471 /************************************************************************/ | |
472 /* initialization */ | |
473 /************************************************************************/ | |
474 | |
475 void | |
476 console_type_create_scrollbar_mswindows (void) | |
477 { | |
478 CONSOLE_HAS_METHOD (mswindows, create_scrollbar_instance); | |
479 CONSOLE_HAS_METHOD (mswindows, free_scrollbar_instance); | |
480 CONSOLE_HAS_METHOD (mswindows, release_scrollbar_instance); | |
481 CONSOLE_HAS_METHOD (mswindows, update_scrollbar_instance_values); | |
482 CONSOLE_HAS_METHOD (mswindows, update_scrollbar_instance_status); | |
483 /* CONSOLE_HAS_METHOD (mswindows, scrollbar_width_changed_in_frame); */ | |
484 #ifdef MEMORY_USAGE_STATS | |
485 CONSOLE_HAS_METHOD (mswindows, compute_scrollbar_instance_usage); | |
486 #endif | |
487 } | |
488 | |
489 void | |
617 | 490 syms_of_scrollbar_mswindows (void) |
428 | 491 { |
492 DEFSUBR (Fmswindows_init_scrollbar_metrics); | |
493 } | |
494 | |
495 void | |
617 | 496 vars_of_scrollbar_mswindows (void) |
428 | 497 { |
498 Fprovide (intern ("mswindows-scrollbars")); | |
499 | |
617 | 500 staticpro (&Vmswindows_scrollbar_instance_table); |
501 Vmswindows_scrollbar_instance_table = | |
502 make_lisp_hash_table (100, HASH_TABLE_NON_WEAK, HASH_TABLE_EQ); | |
503 } |