1. 16 Sep, 2013 1 commit
    • Dmitry Antipov's avatar
      Fix X event waiting to handle multiple frames. · f8eb1572
      Dmitry Antipov authored
      * frame.h (struct frame) [HAVE_X_WINDOWS]: New member wait_event_type.
      * xterm.c (pending_event_wait): Remove.  Adjust users.
      (x_detect_focus_change): Pass frame arg.
      (handle_one_xevent): Find related frame early and clear per-frame
      wait_event_type only if this is an event for the relevant frame.
      (x_wait_for_event): Use per-frame wait_event_type.
      f8eb1572
  2. 15 Sep, 2013 2 commits
  3. 13 Sep, 2013 2 commits
    • Dmitry Antipov's avatar
      Unify FRAME_window_system_DISPLAY_INFO macros between all ports. · aad3612f
      Dmitry Antipov authored
      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.
      aad3612f
    • Dmitry Antipov's avatar
      * xterm.h (x_window_to_frame, x_any_window_to_frame) · 9a650e62
      Dmitry Antipov authored
      (x_menubar_window_to_frame): Remove prototypes.
      * xfns.c (x_window_to_frame, x_any_window_to_frame)
      (x_menubar_window_to_frame, x_top_window_to_frame):
      Move from here...
      * xterm.c (x_window_to_frame, x_any_window_to_frame)
      (x_menubar_window_to_frame, x_top_window_to_frame):
      ...to here and convert all but the last to static.
      9a650e62
  4. 12 Sep, 2013 2 commits
  5. 11 Sep, 2013 2 commits
    • Dmitry Antipov's avatar
      Cleaning up a few X scroll bar bits. · 927eec55
      Dmitry Antipov authored
      * termhooks.h (enum scroll_bar_part): Add scroll_bar_nowhere member.
      * xterm.h (struct scroll_bar) [USE_TOOLKIT_SCROLL_BARS && USE_LUCID]:
      New member last_seen_part, going to replace...
      * xterm.c [USE_TOOLKIT_SCROLL_BARS]: ...global last_scroll_bar_part.
      (xt_action_hook) [USE_LUCID]: Adjust user.
      (xm_scroll_callback, xg_scroll_callback): Do not bloat with
      Lucid-specific scroll bar support.
      (xaw_jump_callback, xaw_scroll_callback): Prefer enum scroll_par_part
      to int and adjust to use last_seen_part member.
      (x_set_toolkit_scroll_bar_thumb) [USE_LUCID]: Adjust user.
      (x_scroll_bar_create) [USE_TOOLKIT_SCROLL_BARS && USE_LUCID]:
      Initialize last_seen_part.
      927eec55
    • Dmitry Antipov's avatar
      Ifdef away frame tool bar code when it is not really used. · 742516e0
      Dmitry Antipov authored
      * frame.h (struct frame) [HAVE_WINDOW_SYSTEM && !USE_GTK && !HAVE_NS]:
      Move tool_bar_window, desired_tool_bar_string, current_tool_bar_string
      and minimize_tool_bar_window_p under the above.
      (fset_current_tool_bar_string, fset_desired_tool_bar_string)
      (fset_tool_bar_window): Likewise.
      * dispnew.c (clear_current_matrices, clear_desired_matrices)
      (adjust_frame_glyphs_for_window_redisplay, free_glyphs, update_frame)
      (change_frame_size_1):
      * window.c (window_from_coordinates, Frecenter): Adjust users.
      * window.h (WINDOW_TOOL_BAR_P): Define to zero when frame tool bar
      code is not really used.
      * xdisp.c (build_desired_tool_bar_string, display_tool_bar_line)
      (tool_bar_lines_needed, MAX_FRAME_TOOL_BAR_HEIGHT, tool_bar_item_info)
      (get_tool_bar_item, handle_tool_bar_click, note_tool_bar_highlight)
      [!USE_GTK && !HAVE_NS]: Define as such.
      (Ftool_bar_lines_needed, redisplay_tool_bar, show_mouse_face)
      (note_mouse_highlight, expose_frame):
      * xfns.c (x_set_tool_bar_lines):
      * xterm.c (handle_one_xevent): Adjust users.
      742516e0
  6. 09 Sep, 2013 1 commit
    • Dmitry Antipov's avatar
      Cleanup frame flushing. · fd462129
      Dmitry Antipov authored
      * dispextern.h (struct redisplay_interface): Drop
      flush_display_optional because flush_display is enough
      for X and flushing via RIF is just a no-op for others.
      * frame.h (flush_frame): New function.
      * dispnew.c (update_frame):
      * minibuf.c (read_minibuf):
      * xdisp.c (echo_area_display, redisplay_preserve_echo_area):
      Use it.
      * keyboard.c (detect_input_pending_run_timers): Do not flush
      all frames but selected one in redisplay_preserve_echo_area.
      * nsterm.m (ns_flush): Remove no-op.
      (ns_redisplay_interface): Adjust user.
      * w32term.h (x_flush): Remove no-op.
      (w32_redisplay_interface): Adjust user.
      * xterm.c (x_flush): Simplify because we do not flush all
      frames at once any more.  Adjust comment.
      (x_redisplay_interface): Adjust user.
      fd462129
  7. 05 Sep, 2013 1 commit
  8. 04 Sep, 2013 1 commit
  9. 03 Sep, 2013 2 commits
    • Dmitry Antipov's avatar
      * xterm.h (struct x_output): Remove set-but-unused · d1ae6a0b
      Dmitry Antipov authored
      leftovers 'left_before_move' and 'top_before_move'.
      * xterm.c (x_set_offset): User changed.
      d1ae6a0b
    • Dmitry Antipov's avatar
      * xterm.h (struct scroll_bar): Prefer int to Lisp_Object · d1fc6c21
      Dmitry Antipov authored
      for 'dragging' member.
      * gtkutil.c (xg_set_toolkit_scroll_bar_thumb):
      * xterm.c (xt_action_hook, xm_scroll_callback, xg_scroll_callback)
      (xg_end_scroll_callback, xaw_jump_callback, xaw_scroll_callback)
      (x_set_toolkit_scroll_bar_thumb, x_scroll_bar_create)
      (x_scroll_bar_set_handle, XTset_vertical_scroll_bar)
      (x_scroll_bar_handle_click, x_scroll_bar_note_movement)
      (x_scroll_bar_report_motion): Related users changed.
      d1fc6c21
  10. 02 Sep, 2013 7 commits
  11. 01 Sep, 2013 1 commit
    • Dmitry Antipov's avatar
      * nsterm.m (ns_set_terminal_modes, ns_reset_terminal_modes): · a892a94c
      Dmitry Antipov authored
      Remove no-ops.
      (ns_create_terminal): Adjust terminal setup.
      * w32term.c (w32_set_terminal_modes, w32_reset_terminal_modes):
      Remove no-ops.
      (w32_create_terminal): Adjust terminal setup.
      * xterm.c (XTset_terminal_modes, XTreset_terminal_modes):
      Remove no-ops.
      (x_create_terminal): Adjust terminal setup.
      a892a94c
  12. 29 Aug, 2013 1 commit
    • Dmitry Antipov's avatar
      * xterm.c (x_clear_area): Lost 7th arg because it is always False. · 1f5cf200
      Dmitry Antipov authored
      (x_after_update_window_line, x_scroll_bar_create):
      (x_scroll_bar_set_handle, XTset_vertical_scroll_bar):
      (handle_one_xevent, x_clear_frame_area):
      * gtkutil.c (xg_clear_under_internal_border, xg_update_scrollbar_pos):
      * xfns.c (x_set_menu_bar_lines, x_set_tool_bar_lines): Adjust users.
      * xterm.h (x_clear_area): Adjust prototype.
      1f5cf200
  13. 28 Aug, 2013 2 commits
    • Dmitry Antipov's avatar
      Prefer enum glyph_row_area to int where appropriate. · c3c4768d
      Dmitry Antipov authored
      * dispextern.h (enum glyph_row_area): Add ANY_AREA member.
      Fix comment.
      (window_box, window_box_width, window_box_left, window_box_left_offset)
      (window_box_right, window_box_right_offset): Adjust prototypes.
      * xdisp.c (window_box, window_box_width, window_box_left)
      (window_box_left_offset, window_box_right, window_box_right_offset):
      Use enum glyph_row_area.  Adjust users and tweak comment where needed.
      (window_box_edges): Likewise.  Lost 2nd arg since it is always ANY_AREA.
      * nsterm.m (ns_clip_to_row):
      * w32term.c (w32_clip_to_row):
      * xterm.c (x_clip_to_row): Likewise.
      c3c4768d
    • Dmitry Antipov's avatar
      Redesign redisplay interface to drop global output_cursor. · f60e429a
      Dmitry Antipov authored
      * dispextern.h (struct redisplay_interface): Remove cursor_to member.
      (toplevel): Remove declaration of output_cursor.
      (set_output_cursor, x_cursor_to): Remove prototype.
      * window.h (struct window): New member output_cursor.
      (output_cursor_to): New function to replace RIF member.
      * dispnew.c (redraw_overlapped_rows, update_marginal_area)
      (update_text_area, set_window_cursor_after_update): Use it.
      * xdisp.c (output_cursor, set_output_cursor, x_cursor_to): Remove.
      (x_write_glyphs, x_insert_glyphs, x_clear_end_of_line):
      * nsterm.m (ns_update_window_begin, ns_update_window_end):
      * w32term.c (x_update_window_begin, x_update_window_end):
      * xterm.c (x_update_window_begin, x_update_window_end):
      Adjust to use per-window output cursor.
      f60e429a
  14. 27 Aug, 2013 3 commits
    • Paul Eggert's avatar
      Simplify SELECT_TYPE-related code. · d486344e
      Paul Eggert authored
      Like EMACS_TIME, this portability layer is no longer needed, since
      Emacs has been using fd_set as a portability layer for some time.
      * sysselect.h (FD_SETSIZE): Rename from MAXDESC.  All uses changed.
      (SELECT_TYPE): Remove.  All uses changed to fd_set.
      (fd_set) [!FD_SET]: New typedef.
      d486344e
    • Paul Eggert's avatar
      Simplify EMACS_TIME-related code. · 43aac990
      Paul Eggert authored
      This portability layer is no longer needed, since Emacs has been
      using struct timespec as a portability layer for some time.
      Merge from gnulib, incorporating:
      2013-08-27 timespec: new convenience constants and function
      * src/atimer.h, src/buffer.h, src/dispextern.h, src/xgselect.h:
      Include <time.h> rather than "systime.h"; that's all that's needed now.
      * src/dispnew.c: Include <timespec.h> rather than "systime.h";
      that's all that's needed now.
      * src/systime.h (EMACS_TIME): Remove.  All uses changed to struct timespec.
      (EMACS_TIME_RESOLUTION): Remove.  All uses changed to
      TIMESPEC_RESOLUTION.
      (LOG10_EMACS_TIME_RESOLUTION): Remove.  All uses changed to
      LOG10_TIMESPEC_RESOLUTION.
      (EMACS_SECS, emacs_secs_addr): Remove.  All uses changed to tv_sec.
      (EMACS_NSECS): Remove.  All uses changed to tv_nsec.
      (make_emacs_time): Remove.  All used changed to make_timespec.
      (invalid_timespec): Rename from invalid_emacs_time.  All uses changed.
      (current_timespec): Rename from current_emacs_time.  All uses changed.
      (add_emacs_time): Remove.  All uses changed to timespec_add.
      (sub_emacs_time): Remove.  All uses change dot timespec_sub.
      (EMACS_TIME_SIGN): Remove.  All uses changed to timespec_sign.
      (timespec_valid_p): Rename from EMACS_TIME_VALID_P.  All uses changed.
      (EMACS_TIME_FROM_DOUBLE): Remove.  All uses changed to dtotimespec.
      (EMACS_TIME_TO_DOUBLE): Remove.  All uses changed to timespectod.
      (current_timespec): Rename from current_emacs_time.  All uses changed.
      (EMACS_TIME_EQ, EMACS_TIME_LT, EMACS_TIME_LE): Remove.  All uses
      changed to timespec_cmp.
      * src/xgselect.c: Include <timespec.h>, since our .h files don't.
      43aac990
    • Dmitry Antipov's avatar
      * lisp.h (Mouse_HLInfo): Move from here... · 9fed9729
      Dmitry Antipov authored
      * dispextern.h (Mouse_HLInfo): ...to here and offload lisp.h.
      (reset_mouse_highlight): New function.
      * msdos.c (dos_set_window_size, IT_update_begin)
      (internal_terminal_init):
      * nsterm.m (ns_update_window_end, x_free_frame_resources)
      (ns_initialize_display_info):
      * w32console.c (initialize_w32_display):
      * w32term.c (x_update_window_end, x_free_frame_resources)
      (w32_initialize_display_info):
      * xterm.c (x_update_window_end, x_free_frame_resources, x_term_init):
      * window.c (Fdelete_other_windows_internal):
      * xdisp.c (clear_mouse_face, cancel_mouse_face): Use it.
      * termchar.h (toplevel):
      * xterm.h (toplevel): Include dispextern.h.
      9fed9729
  15. 23 Aug, 2013 1 commit
    • Dmitry Antipov's avatar
      Minor cleanup for redisplay interface and few related functions. · 9997ec56
      Dmitry Antipov authored
      * frame.h (enum text_cursor_kinds): Move from here...
      * dispextern.h (enum text_cursor_kinds): ...to here.
      (toplevel): Drop unnecessary declarations.
      (struct redisplay_interface): Use bool and enum text_cursor_kinds
      in update_window_end_hook and draw_window_cursor functions.
      (display_and_set_cursor, x_update_cursor): Adjust prototypes.
      * nsterm.m (ns_update_window_end, ns_draw_window_cursor):
      * w32term.c (x_update_window_end,w32_draw_window_cursor):
      * xterm.c (x_update_window_end, x_draw_window_cursor):
      * xdisp.c (display_and_set_cursor, update_window_cursor)
      (update_cursor_in_window_tree, x_update_cursor): Use bool and
      enum text_cursor_kinds where appropriate.
      9997ec56
  16. 15 Aug, 2013 1 commit
    • Dmitry Antipov's avatar
      * term.c (get_named_tty, create_tty_output, tty_free_frame_resources) · 9c253307
      Dmitry Antipov authored
      (tty_free_frame_resources, delete_tty): Prefer eassert to emacs_abort.
      * image.c (make_image_cache): For struct image_cache, prefer xmalloc
      to xzalloc and so avoid redundant call to memset.
      * xterm.c (x_term_init): Avoid unnecessary initializations of dpyinfo
      members because it is allocated with xzalloc and so already zeroed.
      9c253307
  17. 14 Aug, 2013 1 commit
    • Dmitry Antipov's avatar
      Utility function and macro to copy Lisp string to C string. · 5b71542d
      Dmitry Antipov authored
      * lisp.h (xlispstrdupa): New macro.
      (xlispstrdup): New prototype.
      * alloc.c (xlispstrdup): New function.
      * callint.c (Fcall_interactively):
      * fileio.c (Ffile_name_directory, Fexpand_file_name)
      (Fsubstitute_in_file_name):
      * frame.c (Fmake_terminal_frame): Use xlispstrdupa.
      * image.c (x_create_bitmap_from_file):
      * w32term.c (w32_term_init):
      * xterm.c (x_term_init): Use xlispstrdup.
      5b71542d
  18. 13 Aug, 2013 1 commit
    • Dmitry Antipov's avatar
      * window.h (WINDOW_FRINGE_EXTENDED_P): New macro. · c8ae93b0
      Dmitry Antipov authored
      * nsterm.m (ns_set_vertical_scroll_bar): Use it.  Use convenient
      bool instead of BOOL.
      * w32term.h (struct scroll_bar): Convert fringe_extended_p
      from Lisp_Object to bitfield.  Adjust comment.
      * w32term.c (x_scroll_bar_create): Adjust user.
      Use WINDOW_FRINGE_EXTENDED_P and bool for boolean.
      * xterm.c (XTset_vertical_scroll_bar): Likewise.
      Use bool for boolean.
      * xterm.h (struct scroll_bar): Prefer commonly used `unsigned'
      to `unsigned int' when defining a bitfield.
      c8ae93b0
  19. 11 Aug, 2013 1 commit
    • Paul Eggert's avatar
      Omit some unnecessary casts. · 7d652d97
      Paul Eggert authored
      Many of these go back to the old pre-C89 days, when they may have
      been needed, but we've been assuming C89 or later for a while now.
      * alloc.c (live_string_p, live_cons_p, live_symbol_p)
      (live_float_p, live_misc_p, live_vector_p):
      * buffer.c (compare_overlays, cmp_for_strings, mmap_find)
      (mmap_alloc, alloc_buffer_text, enlarge_buffer_text)
      (defvar_per_buffer):
      * callint.c (Fcall_interactively):
      * doc.c (Fsubstitute_command_keys):
      * filelock.c (get_boot_time):
      * frame.c (xrdb_get_resource):
      * gtkutil.c (hierarchy_ch_cb, qttip_cb, style_changed_cb)
      (delete_cb, xg_dialog_response_cb, xg_maybe_add_timer)
      (xg_get_file_name_from_selector, menuitem_destroy_callback)
      (menuitem_highlight_callback, menu_destroy_callback)
      (xg_update_menu_item, xg_modify_menubar_widgets, menubar_map_cb)
      (xg_tool_bar_callback, xg_get_tool_bar_widgets)
      (xg_tool_bar_detach_callback, xg_tool_bar_attach_callback)
      (xg_tool_bar_help_callback, tb_size_cb):
      * image.c (xpm_alloc_color, png_read_from_memory)
      (png_read_from_file, png_load_body, our_memory_skip_input_data)
      (jpeg_memory_src, jpeg_file_src, imagemagick_load_image)
      (syms_of_image):
      * keymap.c (describe_map):
      * nsfns.m (Fns_display_monitor_attributes_list):
      * nsmenu.m (process_dialog:):
      * nsterm.m (hold_event):
      * process.c (wait_reading_process_output):
      * regex.c (REGEX_REALLOCATE, re_set_registers, re_exec, regexec):
      * scroll.c (do_direct_scrolling, scrolling_1):
      * termcap.c (tgetent):
      * window.c (check_window_containing, add_window_to_list)
      (freeze_window_starts):
      * xdisp.c (compare_overlay_entries, vmessage):
      * xfns.c (x_window, x_get_monitor_attributes_xinerama)
      (x_get_monitor_attributes_xrandr)
      (Fx_display_monitor_attributes_list, x_display_info_for_name)
      (Fx_open_connection, file_dialog_cb, file_dialog_unmap_cb):
      * xfont.c (xfont_match, xfont_open):
      * xmenu.c (x_menu_wait_for_event, menu_highlight_callback)
      (menubar_selection_callback, menu_position_func)
      (popup_selection_callback, create_and_show_popup_menu)
      (dialog_selection_callback, create_and_show_dialog):
      * xrdb.c (x_get_string_resource):
      (main) [TESTRM]:
      * xsmfns.c (x_session_check_input):
      * xterm.c (x_draw_glyphless_glyph_string_foreground)
      (xm_scroll_callback, xg_scroll_callback, xg_end_scroll_callback)
      (xaw_jump_callback, xaw_scroll_callback):
      Omit unnecessary casts.
      7d652d97
  20. 10 Aug, 2013 1 commit
  21. 09 Aug, 2013 1 commit
    • Dmitry Antipov's avatar
      Use xstrdup and build_unibyte_string where applicable. · 309f24d1
      Dmitry Antipov authored
      * alloc.c (xstrdup): Tiny cleanup.  Add eassert.
      * xfns.c (x_window):
      * xrdb.c (x_get_customization_string):
      * xterm.c (xim_initialize):
      * w32fns.c (w32_window): Use xstrdup.
      (w32_display_monitor_attributes_list):
      * emacs.c (init_cmdargs):
      * keyboard.c (PUSH_C_STR):
      * nsfont.m (nsfont_open):
      * sysdep.c (system_process_attributes):
      * w32.c (system_process_attributes):
      * xdisp.c (message1, message1_nolog): Use build_unibyte_string.
      309f24d1
  22. 08 Aug, 2013 1 commit
    • Dmitry Antipov's avatar
      Redesign redisplay interface to drop global variable updated_window. · 65620264
      Dmitry Antipov authored
      Always pass currently updated window as a parameter to update routines.
      * dispextern.h (updated_window): Remove declaration.
      (struct redisplay_interface): Pass window parameter to
      write_glyphs, insert_glyphs, clear_end_of_line, cursor_to
      and after_update_window_hook.
      (x_write_glyphs, x_insert_glyphs, x_clear_end_of_line, x_cursor_to):
      Adjust prototypes.
      * dispnew.c (updated_window): Remove.
      (redraw_overlapped_rows, update_marginal_area, update_text_area)
      (update_window_line): Adjust to match redisplay interface changes.
      * nsterm.m (ns_update_window_begin, ns_update_window_end)
      (ns_scroll_run, ns_after_update_window_line):
      * w32term.c (x_update_window_begin, x_update_window_end)
      (x_after_update_window_line, x_scroll_run):
      * xterm.c (x_update_window_begin, x_update_window_end)
      (x_after_update_window_line, x_scroll_run):
      * xdisp.c (x_write_glyphs, x_insert_glyphs, x_clear_end_of_line):
      Likewise.  Adjust comments where appropriate.
      (x_cursor_to): Simplify because this is always called during window
      update (but install debugging check anyway).
      (expose_window): Check must_be_updated_p flag to see whether this
      function is called during window update.
      65620264
  23. 03 Aug, 2013 1 commit
    • Dmitry Antipov's avatar
      Drop FRAME_PTR typedef. · a10c8269
      Dmitry Antipov authored
      * composite.c, font.c, font.h, fontset.c, fontset.h, frame.c, frame.h:
      * ftfont.c, ftxfont.c, gtkutil.c, gtkutil.h, image.c, keyboard.c:
      * menu.c, menu.h, msdos.c, nsfns.m, nsfont.m, nsmenu.m, nsterm.h:
      * nsterm.m, scroll.c, term.c, w32fns.c, w32font.c, w32font.h:
      * w32inevt.c, w32inevt.h, w32menu.c, w32notify.c, w32term.c, w32term.h:
      * w32uniscribe.c, w32xfns.c, widget.c, window.c, xdisp.c, xfaces.c:
      * xfns.c, xfont.c, xftfont.c, xmenu.c, xselect.c, xterm.c:
      All related users changed.
      a10c8269
  24. 02 Aug, 2013 1 commit
    • Dmitry Antipov's avatar
      Fix X GC leak in GTK and raw (no toolkit) X ports. · 4b5c9326
      Dmitry Antipov authored
      * xterm.c (x_free_frame_resources): If white and black relief
      GCs are allocated, always free them here.
      * xfns.c (x_make_gc): Omit redundant initialization.
      * widget.c (create_frame_gcs): Remove the leftover.
      (EmacsFrameDestroy): Do nothing because all GCs are now freed
      in x_free_frame_resources.
      4b5c9326
  25. 01 Aug, 2013 2 commits