1. 09 Jul, 2019 2 commits
    • Mattias Engdegård's avatar
      Rename font_driver member close -> close_font · a9d6ba49
      Mattias Engdegård authored
      * src/alloc.c (cleanup_vector):
      * src/xftfont.c (xftfont_driver):
      * src/xfont.c (xfont_driver):
      * src/nsfont.m (nsfont_driver):
      * src/macfont.m (macfont_driver):
      * src/ftxfont.c (ftxfont_driver):
      * src/ftfont.c (ftfont_driver):
      * src/ftcrfont.c (ftcrfont_driver):
      * src/font.h (struct font_driver):
      * src/font.c (font_clear_cache, font_close_object):
      Rename `close' member to `close_font', to avoid clash with preprocessor
      define of `close' in nt/inc/ms-w32.h and for consistency with `open_font'.
      a9d6ba49
    • Mattias Engdegård's avatar
      Rename font_driver member open -> open_font · ec723406
      Mattias Engdegård authored
      * src/xftfont.c (xftfont_driver):
      * src/xfont.c (xfont_driver):
      * src/nsfont.m (nsfont_driver):
      * src/macfont.m (macfont_driver):
      * src/ftxfont.c (ftxfont_driver):
      * src/ftfont.c (ftfont_driver):
      * src/ftcrfont.c (ftcrfont_driver):
      * src/font.h (struct font_driver):
      * src/font.c (font_open_entity):
      Rename `open' member to `open_font', to avoid clash with preprocessor
      define of `open' in lib/fcntl.h and nt/inc/ms-w32.h.  Remove earlier
      #undef hack.
      ec723406
  2. 01 Jul, 2019 1 commit
    • YAMAMOTO Mitsuharu's avatar
      Implement the otf_capability method for HarfBuzz · 6cabb698
      YAMAMOTO Mitsuharu authored
      * src/hbfont.c: Include hb-ot.h.
      [HAVE_NTGUI]: Add DEF_DLL_FN and #define for hb_tag_to_string,
      hb_font_get_face, hb_ot_layout_table_get_script_tags,
      hb_ot_layout_table_get_feature_tags, hb_ot_layout_script_get_language_tags,
      and hb_ot_layout_language_get_feature_tags.
      (hbfont_init_w32_funcs) [HAVE_NTGUI]: Add LOAD_DLL_FN for them.
      (hbfont_otf_features, hbfont_otf_capability): New functions.
      
      * src/font.h (hbfont_otf_capability) [HAVE_HARFBUZZ]: Add extern.
      
      * src/ftcrfont.c (syms_of_ftcrfont_for_pdumper) [HAVE_HARFBUZZ]:
      * src/ftfont.c (syms_of_ftfont_for_pdumper) [HAVE_HARFBUZZ]:
      * src/w32uniscribe.c (syms_of_w32uniscribe_for_pdumper) [HAVE_HARFBUZZ]:
      * src/xftfont.c (syms_of_xftfont_for_pdumper) [HAVE_HARFBUZZ]: Populate
      otf_capability method with hbfont_otf_capability.
      6cabb698
  3. 02 Jun, 2019 1 commit
    • YAMAMOTO Mitsuharu's avatar
      Make fthbfont and derivatives use common HarfBuzz code in hbfont.c · ab1d5d40
      YAMAMOTO Mitsuharu authored
      * src/font.h (fthbfont_shape, fthbfont_combining_capability)
      [HAVE_HARFBUZZ]: Remove prototypes.
      
      * src/ftfont.c: Don't include math.h.
      (uni_combining, uni_general, uni_mirroring, get_hb_unicode_funcs)
      (fthbfont_shape_by_hb, fthbfont_combining_capability, fthbfont_shape)
      [HAVE_HARFBUZZ]: Remove functions.
      
      * src/ftfont.c (syms_of_ftfont_for_pdumper) [HAVE_HARFBUZZ]:
      * src/xftfont.c (syms_of_xftfont_for_pdumper) [HAVE_HARFBUZZ]:
      * src/ftcrfont.c (syms_of_ftcrfont_for_pdumper) [HAVE_HARFBUZZ]: Use
      hbfont_shape and hbfont_combining_capability instead of fthbfont_shape
      and fthbfont_combining_capability, respectively.
      ab1d5d40
  4. 01 Jun, 2019 1 commit
    • Eli Zaretskii's avatar
      Move common HarfBuzz code to a common file hbfont.c · 4363777d
      Eli Zaretskii authored
      * src/hbfont.c: New file, with code moved from w32uniscribe.c
      and renamed/modified as appropriate.
      * src/w32uniscribe.c: Move to hbfont.c DEF_DLL_FN and macro
      definitions for HarfBuzz functions used in hbfont.c
      (load_harfbuzz_funcs): Move loading of HarfBuzz functions used
      by hbfont.c to hbfont.c:hbfont_init_w32_funcs, and call that
      function from here.
      (syms_of_w32uniscribe_for_pdumper): Fill the 'shape' and
      'combining_capability' members with hbfont.c function names.
      * src/w32common.h (hbfont_init_w32_funcs) [HAVE_HARFBUZZ]: Add
      prototype.
      * src/font.h (hbfont_shape, hbfont_combining_capability)
      [HAVE_HARFBUZZ]: Add prototypes.
      * src/Makefile.in (SOME_MACHINE_OBJECTS): Add hbfont.o.
      
      * configure.ac (FONT_OBJ): Add hbfont.o if HAVE_HARFBUZZ.
      4363777d
  5. 31 May, 2019 1 commit
    • Eli Zaretskii's avatar
      Add HarfBuzz font backend for MS-Windows · fba3687d
      Eli Zaretskii authored
      * src/w32uniscribe.c [HAVE_HARFBUZZ]: Include math.h and
      hb.h.
      (bswap_32): Define for GCC 4.3.0 and later; else include
      <byteswap.h> from Gnulib.
      (struct uniscribe_font_info): Extend for HarfBuzz; 'cache' is
      now a 'void *' (all users changed).
      [HAVE_HARFBUZZ]: Define typedefs for HarfBuzz functions to be
      loaded dynamically from the HarfBuzz DLL.  Define macros to
      call those functions via function pointers.
      (uniscribe_open) [HAVE_HARFBUZZ]: Use the HarfBuzz font driver
      if the type of the font entity is 'harfbuzz'.
      (uniscribe_close) [HAVE_HARFBUZZ]: For fonts using the
      HarfBuzz backend, call hb_font_destroy to free memory used for
      the cached hb_font data.
      (uniscribe_shape): Fix assignment of character codepoints to
      glyphs from a single cluster.
      (w32hb_list, w32hb_match, free_cb, w32hb_get_font_table)
      (w32hb_get_font, w32hb_encode_char, w32hb_begin_font)
      (w32uni_combining, w32uni_general, w32uni_mirroring)
      (get_hb_unicode_funcs, w32hb_shape)
      (w32hb_combining_capability, load_harfbuzz_funcs)
      [HAVE_HARFBUZZ]: New functions.
      (syms_of_w32uniscribe_for_pdumper) [HAVE_HARFBUZZ]: Load the
      HarfBuzz DLL and register the HarfBuzz backend with its
      functions.
      * src/w32font.c (syms_of_w32font) <Qharfbuzz>: New DEFSYM.
      * src/w32fns.c (Fx_create_frame, w32_create_tip_frame)
      [HAVE_HARFBUZZ]: Register the harfbuzz font backend.
      * src/lisp.h (get_unicode_property): Declare prototype.
      * src/font.h (harfbuzz_font_driver) [HAVE_NTGUI]: Declare.
      * src/chartab.c (get_unicode_property): New function, body
      taken from get-unicode-property-internal.
      (Fget_unicode_property_internal): Call get_unicode_property
      after validating input.
      
      * doc/lispref/frames.texi (Font and Color Parameters):
      * doc/emacs/msdos.texi (Windows Fonts): Document support for
      HarfBuzz text shaping on MS-Windows.
      
      * configure.ac (HAVE_HARFBUZZ): Move out of the X-specific
      part, and consider HarfBuzz also for HAVE_W32 systems.
      Require HarfBuzz v1.2.3 for w32.
      fba3687d
  6. 20 May, 2019 1 commit
    • Alexander Gramiak's avatar
      Replace XChar2b with unsigned in all font backends · a4fe9c70
      Alexander Gramiak authored
      The xfont backend using XChar2b in its API doesn't mean that we should
      use it everywhere else.
      
      * src/dispextern.h (glyph_string):
      * src/ftcrfont.c (ftcrfont_draw):
      * src/ftxfont.c (ftxfont_draw):
      * src/w32term.c (w32_draw_glyphless_glyph_string_foreground):
      * src/xdisp.c (init_glyph_string, get_char_face_and_encoding)
      (get_glyph_face_and_encoding, get_char_glyph_code)
      (fill_gstring_glyph_string, fill_stretch_glyph_string)
      (normal_char_ascent_descent, gui_get_glyph_overhangs)
      (compute_overhangs_and_x, gui_produce_glyphs):
      * src/xfont.c (xfont_get_pcm, xfont_chars_supported, xfont_open)
      (xfont_encode_char, xfont_text_extents, xfont_draw)
      * src/xftfont.c (xftfont_draw):
      * src/xterm.c (x_compute_glyph_string_overhangs)
      (x_draw_glyphless_glyph_string_foreground): Use unsigned over XChar2b.
      
      * src/nsgui.h:
      * src/w32gui.h:
      * src/xterm.h: Remove XChar2b, STORE_XCHAR2B, XCHAR2B_BYTE1, and
      XCHAR2B_BYTE2 typedefs and macros.
      
      * src/font.h (font_driver):
      (ftfont_text_extents)
      * src/ftcrfont.c (ftcrfont_text_extents):
      * src/ftfont.c (ftfont_text_extents):
      * src/macfont.m (macfont_text_extents):
      * src/nsfont.m (nsfont_text_extents):
      * src/w32font.h (w32_font_text_extents):
      * src/font.c (xfont_text_extents):
      * src/xftfont.c (xftfont_text_extents): Make code parameter const.
      a4fe9c70
  7. 04 May, 2019 1 commit
    • YAMAMOTO Mitsuharu's avatar
      Add new font backend drivers for text shaping by HarfBuzz · f208d5ae
      YAMAMOTO Mitsuharu authored
      * etc/NEWS: Mention new font backend drivers xfthb and ftcrhb.
      
      * src/font.h [HAVE_HARFBUZZ]: Include hb.h.
      (struct font_driver) [HAVE_HARFBUZZ]: New members begin_hb_font and
      end_hb_font.
      (ftfont_match, ftfont_list): Remove externs.
      (ftfont_match2, ftfont_list2):
      (fthbfont_combining_capability, fthbfont_begin_hb_font)
      (fthbfont_shape) [HAVE_HARFBUZZ]:
      (xfthbfont_driver) [HAVE_XFT && HAVE_HARFBUZZ]:
      (ftcrhbfont_driver) [USE_CAIRO && HAVE_HARFBUZZ]: Add externs.
      
      * src/ftcrfont.c (ftcrfont_list): Use ftfont_list2.
      (ftcrfont_match): Use ftfont_match2.
      (ftcrfont_open): Get font type from entity.
      (ftcrfont_open) [HAVE_HARFBUZZ]: Use HarfBuzz version of driver if specified.
      (ftcrfont_shape) [HAVE_HARFBUZZ]: Make shaping fail.
      (ftcrhbfont_list, ftcrhbfont_match)
      (ftcrhbfont_begin_hb_font) [HAVE_HARFBUZZ]: New functions.
      (ftcrhbfont_driver) [HAVE_HARFBUZZ]: New variable.
      (syms_of_ftcrfont_for_pdumper) [HAVE_HARFBUZZ]: Initialize and register it.
      (syms_of_ftcrfont) [HAVE_HARFBUZZ]: New symbol Qftcrhb.
      
      * src/ftfont.c: Include math.h for lround.
      (fthbfont_driver) [HAVE_HARFBUZZ]: New variable.
      (ftfont_get_hb_font) [HAVE_HARFBUZZ]: Remove function.
      (ftfont_list, ftfont_match): Make static.
      (ftfont_list2, ftfont_match2): New functions.
      (ftfont_open2) [HAVE_HARFBUZZ]: Use HarfBuzz version of driver if specified.
      (ftfont_open): Get font type from entity.
      (ftfont_shape, ftfont_combining_capability, ftfont_driver) [HAVE_HARFBUZZ]:
      Move HarfBuzz specific part from here ...
      (fthbfont_shape, fthbfont_combining_capability)
      (fthbfont_driver) [HAVE_HARFBUZZ]: ... to here.   New functions and variable.
      (fthbfont_begin_hb_font) [HAVE_HARFBUZZ]: New function.
      (fthbfont_shape_by_hb) [HAVE_HARFBUZZ]: Rename from ftfont_shape_by_hb.
      Don't take FreeType specific arguments ft_face and matrix.  Use begin_hb_font
      and end_hb_font font driver functions.  Use text_extents font driver functions
      instead of ftfont_glyph_metrics.
      (syms_of_ftfont) [HAVE_HARFBUZZ]: New symbol Qfreetypehb.
      (syms_of_ftfont_for_pdumper) [HAVE_HARFBUZZ]: Initialize and register
      fthbfont_drivert.
      
      * src/ftxfont.c (ftxfont_list): Use ftfont_list2.
      (ftxfont_match): Use ftfont_match2.
      (ftxfont_driver) [HAVE_HARFBUZZ]: Don't initialize shape member explicitly.
      
      * src/xfns.c (Fx_create_frame) [USE_CAIRO && HAVE_HARFBUZZ]:
      (Fx_create_frame) [HAVE_XFT && HAVE_HARFBUZZ]: Register HarfBuzz versions of
      font drivers.
      
      * src/xftfont.c (xftfont_list): Use ftfont_list2.
      (xftfont_match): Use ftfont_match2.
      (xftfont_open): Get font type from entity.
      (xftfont_open) [HAVE_HARFBUZZ]: Use HarfBuzz version of driver if specified.
      (xftfont_shape) [HAVE_HARFBUZZ]: Make shaping fail.
      (xfthbfont_list, xfthbfont_match, xfthbfont_begin_hb_font)
      (xfthbfont_end_hb_font) [HAVE_HARFBUZZ]: New functions.
      (xftfont_driver) [HAVE_HARFBUZZ]: Don't initialize shape member explicitly.
      (xfthbfont_driver) [HAVE_HARFBUZZ]: New variable.
      (syms_of_xftfont_for_pdumper) [HAVE_HARFBUZZ]: Initialize and register it.
      (syms_of_xftfont) [HAVE_HARFBUZZ]: New symbol Qxfthb.
      f208d5ae
  8. 04 Mar, 2019 1 commit
  9. 05 Jan, 2019 2 commits
    • Paul Eggert's avatar
      Improve GC+Cairo workaround · 99e2ad9e
      Paul Eggert authored
      Suggested by Eli Zaretskii (Bug#20890#31).
      * src/font.h (font_data_structures_may_be_ill_formed): New function.
      * src/ftfont.c (ftfont_close):
      * src/ftcrfont.c (ftcrfont_close): Use it.
      
      (cherry picked from commit d02fd482)
      99e2ad9e
    • Eli Zaretskii's avatar
      Improve commentary in font.h · 0ecff00b
      Eli Zaretskii authored
      * src/font.h (struct font, struct font_driver): Fix typos and
      wording in comments.  Document all driver methods.
      0ecff00b
  10. 01 Jan, 2019 1 commit
  11. 29 Dec, 2018 1 commit
    • Eli Zaretskii's avatar
      Provide text directionality and language to HarfBuzz shaper · 48776b70
      Eli Zaretskii authored
      * lisp/language/tv-util.el (tai-viet-composition-function):
      * lisp/language/ethio-util.el (ethio-composition-function):
      * lisp/language/japanese.el (compose-gstring-for-variation-glyph):
      * lisp/language/thai-util.el (thai-composition-function):
      * lisp/language/misc-lang.el (arabic-shape-gstring):
      * lisp/language/lao-util.el (lao-composition-function):
      * lisp/language/hebrew.el (hebrew-shape-gstring):
      * lisp/composite.el (compose-gstring-for-graphic)
      (compose-gstring-for-dotted-circle, auto-compose-chars)
      (compose-gstring-for-terminal): Accept 2nd argument DIRECTION; all
      callers changed.
      
      * src/composite.c (composition_reseat_it): Call
      auto-composition-function with one more argument DIRECTION.
      (syms_of_composite) <auto-composition-function>: Update the doc
      string.
      * src/ftfont.c (ftfont_shape_by_hb): Compute language and
      direction, and set buffer properties accordingly.
      * src/composite.c (autocmp_chars):
      * src/w32uniscribe.c (uniscribe_shape):
      * src/xftfont.c (xftfont_shape):
      * src/ftfont.c (ftfont_shape, ftfont_shape_by_hb):
      * src/font.c (Ffont_shape_gstring): Accept an additional argument
      DIRECTION.
      * src/macfont.m (lgstring_direction): New enum.
      (mac_font_shape_1, mac_screen_font_shape, mac_font_shape):
      Accept an additional argument specifying text direction.  All
      callers changed.
      * src/font.c (syms_of_font): New symbols QL2R and QR2L.
      * src/font.h (shape): Accept new argument DIRECTION.  All
      implementations changed.  (Bug#33729)
      (ftfont_shape): Update prototype.
      48776b70
  12. 08 Aug, 2018 1 commit
    • Tom Tromey's avatar
      More macro renamings for bignum · d1ec3a0a
      Tom Tromey authored
      * src/alloc.c, src/bidi.c, src/buffer.c, src/buffer.h, src/bytecode.c,
      src/callint.c, src/callproc.c, src/casefiddle.c, src/casetab.c,
      src/category.c, src/ccl.c, src/character.c, src/character.h,
      src/charset.c, src/charset.h, src/chartab.c, src/cmds.c, src/coding.c,
      src/composite.c, src/composite.h, src/data.c, src/dbusbind.c,
      src/decompress.c, src/dired.c, src/dispextern.h, src/dispnew.c,
      src/disptab.h, src/doc.c, src/dosfns.c, src/editfns.c,
      src/emacs-module.c, src/emacs.c, src/eval.c, src/fileio.c,
      src/floatfns.c, src/fns.c, src/font.c, src/font.h, src/fontset.c,
      src/frame.c, src/frame.h, src/fringe.c, src/ftcrfont.c, src/ftfont.c,
      src/gfilenotify.c, src/gnutls.c, src/gtkutil.c, src/image.c,
      src/indent.c, src/insdel.c, src/intervals.c, src/json.c,
      src/keyboard.c, src/keymap.c, src/kqueue.c, src/lcms.c, src/lisp.h,
      src/lread.c, src/macros.c, src/marker.c, src/menu.c, src/minibuf.c,
      src/msdos.c, src/print.c, src/process.c, src/profiler.c, src/search.c,
      src/sound.c, src/syntax.c, src/syntax.h, src/sysdep.c, src/term.c,
      src/termhooks.h, src/textprop.c, src/undo.c, src/w32.c,
      src/w32console.c, src/w32fns.c, src/w32font.c, src/w32inevt.c,
      src/w32proc.c, src/w32select.c, src/w32term.c, src/w32term.h,
      src/w32uniscribe.c, src/window.c, src/xdisp.c, src/xfaces.c,
      src/xfns.c, src/xfont.c, src/xftfont.c, src/xmenu.c, src/xml.c,
      src/xrdb.c, src/xselect.c, src/xsettings.c, src/xterm.c, src/xwidget.c
      Rename XINT->XFIXNUM, XFASTINT->XFIXNAT, XUINT->XUFIXNUM.
      d1ec3a0a
  13. 13 Jul, 2018 1 commit
    • Tom Tromey's avatar
      Rename integerp->fixnum, etc, in preparation for bignums · 42fe787b
      Tom Tromey authored
      * src/json.c, src/keyboard.c, src/keyboard.h, src/keymap.c,
      src/kqueue.c, src/lcms.c, src/lisp.h, src/lread.c, src/macros.c,
      src/marker.c, src/menu.c, src/minibuf.c, src/msdos.c, src/print.c,
      src/process.c, src/profiler.c, src/search.c, src/sound.c,
      src/syntax.c, src/sysdep.c, src/term.c, src/terminal.c,
      src/textprop.c, src/undo.c, src/w16select.c, src/w32.c,
      src/w32console.c, src/w32cygwinx.c, src/w32fns.c, src/w32font.c,
      src/w32inevt.c, src/w32proc.c, src/w32select.c, src/w32term.c,
      src/w32uniscribe.c, src/widget.c, src/window.c, src/xdisp.c,
      src/xfaces.c, src/xfns.c, src/xfont.c, src/xftfont.c, src/xmenu.c,
      src/xrdb.c, src/xselect.c, src/xterm.c, src/xwidget.c: Rename
      INTEGERP->FIXNUM, make_number->make_fixnum, CHECK_NUMBER->CHECK_FIXNUM,
      make_natnum->make_fixed_natum, NUMBERP->FIXED_OR_FLOATP,
      NATNUMP->FIXNATP, CHECK_NATNUM->CHECK_FIXNAT.
      42fe787b
  14. 15 Jun, 2018 1 commit
    • Paul Eggert's avatar
      New type Lisp_Misc_Ptr · f8ad6b31
      Paul Eggert authored
      This is a streamlined version of Lisp_Save_Value, which contains just
      a pointer, as that is all Lisp_Save_Values are used for any more.
      With the previous changes, these objects are not primarily used as
      save values, so just call them "Misc" rather than "Save".
      * src/alloc.c (make_misc_ptr): New function.
      (mark_object): Mark Lisp_Misc_Ptr too.
      * src/lisp.h (Lisp_Misc_Ptr): New constant.
      (struct Lisp_Misc_Ptr): New type.
      (make_mint_ptr, mint_ptrp, xmint_pointer):
      Use Lisp_Misc_Ptr, not Lisp_Save_Value.
      (union Lisp_Misc): Add Lisp_Misc_Ptr.
      * src/print.c (print_object): Print Lisp_Misc_Ptr.
      f8ad6b31
  15. 10 Jun, 2018 1 commit
    • Paul Eggert's avatar
      Use native alignment to access Lisp object data · 0303fab3
      Paul Eggert authored
      Instead of using __builtin_assume_aligned (P, GCALIGNMENT) to
      tell GCC that P has alignment 8, use (T *) P where T is the
      type of the pointed-to object, to tell GCC that P has native
      alignment.  This is simpler, matches the intent better, and
      should help simplify future improvements.  Some of these
      changes are to pacify gcc -Wnull-dereference, since GCC is
      smarter about pointers now that Emacs no longer uses
      __builtin_assume_aligned; these minor changes should improve
      code efficiency slightly.  On Fedora 28 x86-64 with default
      optimization this patch shrinks the size of the Emacs text
      segment by 0.36%.
      * src/conf_post.h (__has_builtin, __builtin_assume_aligned):
      Remove; no longer used.
      * src/dbusbind.c (XD_OBJECT_TO_DBUS_TYPE):
      Pacify -Wnull-dereference by using XCAR instead of CAR_SAFE
      and XCDR instead of CDR_SAFE when this is safe.
      * src/fileio.c (Fexpand_file_name):
      * src/font.c (clear_font_cache):
      Pacify -Wnull-dereference by removing unnecessary NILP test.
      * src/keyboard.c (xevent_start): New function.
      (read_char, read_key_sequence): Pacify -Wnull-dereference by
      using xevent_start instead of EVENT_START.
      * src/lisp.h (lisp_h_XUNTAG): Remove; XUNTAG is always a macro
      now, since it can no longer be implemented as a function.
      (XUNTAG): New third argument CTYPE.  All uses changed.
      Cast result to CTYPE * instead of using __builtin_assume_aligned.
      Simplify by using LISP_WORD_TAG.
      (LISP_WORD_TAG): New macro.
      (TAG_PTR): Use it.
      * src/menu.c (x_popup_menu_1):
      Pacify -Wnull-dereference by using XCAR instead of Fcar and
      XCDR instead of Fcdr where this is safe.
      0303fab3
  16. 04 Apr, 2018 1 commit
    • Paul Eggert's avatar
      Improve GC+Cairo workaround · d02fd482
      Paul Eggert authored
      Suggested by Eli Zaretskii (Bug#20890#31).
      * src/font.h (font_data_structures_may_be_ill_formed): New function.
      * src/ftfont.c (ftfont_close):
      * src/ftcrfont.c (ftcrfont_close): Use it.
      d02fd482
  17. 01 Jan, 2018 1 commit
  18. 13 Nov, 2017 1 commit
    • Paul Eggert's avatar
      Change vectorlike from struct to union · 5d68dc9a
      Paul Eggert authored
      * src/lisp.h (vectorlike_headed): Change from struct to union.
      All uses changed.  Since it has only one member, this does not
      change semantics.  This is designed to simplify future changes
      needed to fix bugs like Bug#29040.  All uses changed.
      5d68dc9a
  19. 13 Sep, 2017 1 commit
    • Paul Eggert's avatar
      Prefer HTTPS to FTP and HTTP in documentation · bc511a64
      Paul Eggert authored
      Most of this change is to boilerplate commentary such as license URLs.
      This change was prompted by ftp://ftp.gnu.org's going-away party,
      planned for November.  Change these FTP URLs to https://ftp.gnu.org
      instead.  Make similar changes for URLs to other organizations moving
      away from FTP.  Also, change HTTP to HTTPS for URLs to gnu.org and
      fsf.org when this works, as this will further help defend against
      man-in-the-middle attacks (for this part I omitted the MS-DOS and
      MS-Windows sources and the test tarballs to keep the workload down).
      HTTPS is not fully working to lists.gnu.org so I left those URLs alone
      for now.
      bc511a64
  20. 10 Apr, 2017 1 commit
    • Lars Brinkhoff's avatar
      Add PVSIZE function to return the size of a pseudovector. · 3ccd0ff1
      Lars Brinkhoff authored
      * src/lisp.h (PVSIZE): New function.
      
      * src/chartab.c (copy_char_table):
      * src/data.c (Ftype_of, Finteractive_form, Faref, Faset):
      * src/doc.c (Fdocumentation, store_function_docstring):
      * src/eval.c (Fcommandp, funcall_lambda, lambda_arity, Ffetch_bytecode):
      * src/fns.c (Flength, Fcopy_sequence):
      * src/font.h (FONT_SPEC_P, FONT_ENTITY_P, FONT_OBJECT_P):
      * src/lread.c (substitute_object_recurse):
      * src/src/print.c (print_object):
        Use it.
      3ccd0ff1
  21. 01 Jan, 2017 1 commit
  22. 02 Dec, 2016 1 commit
    • Paul Eggert's avatar
      Make struct font_drivers read-only · ebb96114
      Paul Eggert authored
      This simplifies the code a bit, and makes the structs more
      shareable and less likely to become corrupt.
      * src/alloc.c (cleanup_vector):
      * src/font.c (valid_font_driver, font_prepare_cache)
      (font_finish_cache, font_get_cache, font_clear_cache)
      (register_font_driver, font_update_drivers):
      * src/font.h (struct font, struct font_driver_list)
      (valid_font_driver):
      struct font_drivers are now const.
      * src/font.c, src/ftcrfont.c, src/ftfont.c, src/nsfont.m, src/xfont.c:
      Omit no-longer-necessary decls.
      * src/ftcrfont.c (syms_of_ftcrfont):
      * src/ftxfont.c (syms_of_ftxfont):
      * src/xftfont.c (syms_of_xftfont):
      Omit no-longer-necessary initialization code.
      * src/ftcrfont.c (ftcrfont_driver):
      * src/ftfont.c (ftfont_driver):
      * src/ftxfont.c (ftxfont_driver):
      * src/macfont.m (macfont_driver):
      * src/nsfont.m (nsfont_driver):
      * src/xfont.c (xfont_driver):
      * src/xftfont.c (xftfont_driver):
      Use C99-style initializer for ease of maintenance, and make it const.
      * src/ftcrfont.c, src/ftxfont.c, src/xftfont.c:
      Refer to functions like ftfont_text_extents directly.
      * src/ftfont.c (ftfont_get_cache, ftfont_list, ftfont_list_family)
      (ftfont_has_char, ftfont_encode_char, ftfont_text_extents)
      (ftfont_get_bitmap, ftfont_anchor_point, ftfont_otf_capability)
      (ftfont_variation_glyphs, ftfont_filter_properties)
      (ftfont_combining_capability):
      * src/xfont.c (xfont_get_cache):
      Now extern, so that other modules’ struct font_drivers can use
      them directly.
      * src/macfont.m (macfont_descriptor_entity):
      * src/nsfont.m (nsfont_open):
      Use constant directly; this is clearer.
      ebb96114
  23. 29 Oct, 2016 1 commit
    • Daniel Colascione's avatar
      Add double-buffering support to reduce flicker · c2907158
      Daniel Colascione authored
      * src/dispextern.h (struct glyph_string): Remove window member
      (block_buffer_flips, unblock_buffer_flips)
      (buffer_flipping_blocked_p): Declare.
      
      * src/xterm.h (struct x_display_info): New member supports_xdbe.
      (struct x_output): New members draw_desc and need_buffer_flip.
      (FRAME_X_DRAWABLE, FRAME_X_RAW_DRAWABLE)
      (FRAME_X_DOUBLE_BUFFERED_P)
      (FRAME_X_NEED_BUFFER_FLIP): New macros.
      (set_up_x_back_buffer, tear_down_x_back_buffer)
      (initial_set_up_x_back_buffer): Declare.
      
      * src/xterm.c: Include Xdbe.h.
      (x_begin_cr_clip, x_fill_rectangle, x_draw_rectangle)
      (x_draw_vertical_window_border, x_update_end)
      (x_setup_relief_color, x_draw_relief_rect)
      (x_draw_fringe_bitmap, x_shift_glyphs_for_insert)
      (x_scroll_run, x_draw_hollow_cursor, x_draw_bar_cursor): Use
      FRAME_X_DRAWABLE instead of FRAME_X_WINDOW; rename local
      variables appropriately; substitute calls to XClearArea with
      x_clear_area, which DTRT for double buffering.
      (x_clear_window, x_clear_area): In double-buffering mode, use
      rect-drawing X functions instead of XClearWindow and
      XClearArea, which always operate on the front buffer.
      (show_back_buffer): New function.
      (XTframe_up_to_date): Call show_back_buffer when done.
      (x_clear_frame, x_clear_frame_area): Remove obsolete calls to
      gtk_widget_queue_draw to refresh scroll bars; scroll bars are
      now independent X windows.
      (handle_one_xevent): Call font_drop_xrender_surfaces when
      XftDraw might need regenerating; perform buffer flip when
      responding to Expose events; issue front-buffer clearing
      commands as stopgap while we wait for redisplay.
      Call flush_dirty_back_buffers.
      (x_make_frame_visible): Un-bitrot comment; move XSETFRAME
      earlier in function.
      (x_free_frame_resources): Call tear_down_x_back_buffer when
      destroying frame.
      (x_term_init): Attempt to initialize double buffer extension.
      (x_flip_and_flush): New function.
      (x_redisplay_interface): Point to x_flip_and_flush instead of
      x_flip directly.
      (flush_dirty_back_buffers): New function.
      (x_create_terminal): Register buffer_flipping_unblocked_hook.
      
      * src/xftfont.c (xftfont_drop_xrender_surfaces): Use
      FRAME_X_DRAWABLE instead of FRAME_X_WINDOW.
      (xftfont_draw): Call x_mark_frame_dirty.
      (xftfont_drop_xrender_surfaces): New function.
      (syms_of_xftfont): Register it.
      
      * src/xfont.c (xfont_draw): Use FRAME_X_DRAWABLE instead of
      FRAME_X_WINDOW.
      
      * src/xfns.c: Include Xdbe.h.
      (x_set_inhibit_double_buffering, set_up_x_back_buffer)
      (Fx_double_buffered_p): New functions.
      (x_window): Call initial_set_up_x_back_buffer.
      (x_make_gc): Use FRAME_X_DRAWABLE instead of FRAME_X_WINDOW.
      (Fx_create_frame): Configure `inhibit-double-buffering'
      frame parameter.
      (x_create_tip_frame): Call initial_set_up_x_back_buffer.
      (x_frame_parm_handlers): Register
      x_set_inhibit_double_buffering.
      (syms_of_xfns): Register Sx_double_buffered_p.
      (x_mark_frame_dirty): Define.
      
      * src/xfaces.c (x_create_gc): Use FRAME_X_DRAWABLE instead of
      FRAME_X_WINDOW.
      
      * src/xdisp.c (remember_mouse_glyph, init_glyph_string): Use
      FRAME_X_DRAWABLE instead of FRAME_X_WINDOW.
      (redisplay_internal): Restart redisplay if a frame is garbaged
      during updating; explain why. Block buffer flips
      during redisplay.
      (redisplay_preserve_echo_area): Block buffer flip during call
      to redisplay_internal.
      (buffer_flip_blocked_depth): New variable.
      (block_buffer_flips, unblock_buffer_flips)
      (buffer_flipping_blocked_p): New functions.
      (init_glyph_string): Stop setting window member of struct
      glyph_string.
      
      * src/w32fns.c (w32_frame_parm_handlers): Add placeholder for
      x_set_inhibit_double_buffering.
      
      * src/termhooks.h (struct terminal): Add
      buffer_flipping_unblocked_hook.
      
      * src/nsfns.m (ns_frame_parm_handlers): Add placeholder for
      x_set_inhibit_double_buffering.
      
      * src/image.c (x_create_bitmap_from_data)
      (x_create_bitmap_from_file, x_create_x_image_and_pixmap)
      (Create_Pixmap_From_Bitmap_Data)
      (x_create_bitmap_from_xpm_data, xpm_load, gs_load): Use
      FRAME_X_DRAWABLE instead of FRAME_X_WINDOW; rename local
      variables appropriately.
      
      * src/gtkutil.c: Include Xdbe.h.
      (xg_get_widget_from_map): Forward declare.
      (xg_clear_under_internal_border): Remove obsolete calls to
      refresh scroll bars.
      (xg_create_frame_widgets): Call initial_set_up_x_back_buffer.
      (xg_free_frame_widgets): Call tear_down_x_back_buffer; reset
      FRAME_X_DRAWABLE as well as FRAME_X_WINDOW and for the
      same reason.
      (xg_set_background_color): Set scroll bar background colors.
      (xg_finish_scroll_bar_creation): New function with common
      logic of xg_create_scroll_bar, xg_create_horizontal_scroll_bar. Force
      scroll bars to be real X11 windows.
      (xg_create_scroll_bar, xg_create_horizontal_scroll_bar): Call
      xg_finish_scroll_bar_creation.
      (xg_update_scrollbar_pos, xg_update_horizontal_scrollbar_pos):
      Remove obsolete calls to refresh scroll bars; fix comments.
      
      * src/ftxfont.c (ftxfont_get_gcs, ftxfont_draw_bitmap,
      (ftxfont_draw_background): Use FRAME_X_DRAWABLE instead of
      FRAME_X_WINDOW.
      
      * src/frame.c (frame_parms): Add table entry for new
      `inhibit-double-buffering' frame parameter
      (syms_of_frame): Register Qinhibit_double_buffering.
      
      * src/font.h (struct font_driver): Add new `flush_frame_caches' hook.
      (font_drop_xrender_surfaces): Declare.
      
      * src/font.c (font_drop_xrender_surfaces): New function.
      
      * src/Makefile.in (XDBE_LIBS, XDBE_CFLAGS): Substitute.
      
      * etc/NEWS: Mention use of double buffering
      
      * doc/lispref/frames.texi (Management Parameters): Document
      `inhibit-double-buffering' frame parameters.
      (Visibility of Frames): Document `x-double-buffered-p'.
      
      * configure.ac: Check for the X double buffer extension
      c2907158
  24. 10 Mar, 2016 1 commit
    • Paul Eggert's avatar
      Rework C source files to avoid ^( · 7352c6c6
      Paul Eggert authored
      Work around Bug#22884 by rewording comments and strings to avoid ‘(’
      at the start of a line unless it starts a function.  This change
      is a short-term hack; in the longer run we plan to fix cc-mode’s
      performance for C files that have ‘(’ at the start of a line in a
      comment or string.
      7352c6c6
  25. 26 Jan, 2016 1 commit
    • K. Handa's avatar
      support rendering of wider range of combinging characters by ftfont backend · 4a3db0f7
      K. Handa authored
      * lisp/language/hebrew.el (hebrew-shape-gstring): If the font backend
      supports rendering of combining characters, call
      font-shape-gstring.
      
      * src/font.c (Ffont_get): Handle `combining-capability' property.
      (syms_of_font): New symbol ":combining-capability'.
      
      * src/font.h (struct font_driver): New member combining_capability.
      
      * src/ftfont.c: Include "category.h".
      (ftfont_driver): Initialize combining_capability to
      ftfont_combining_capability.
      (ftfont_shape_by_flt): If OTF is null, try to find a suitable
      FLT in advance.
      (ftfont_combining_capability): New function.
      
      (cherry picked from commit 536f48e9)
      4a3db0f7
  26. 02 Jan, 2016 1 commit
    • K. Handa's avatar
      support rendering of wider range of combinging characters by ftfont backend · 536f48e9
      K. Handa authored
      * lisp/language/hebrew.el (hebrew-shape-gstring): If the font backend
      supports rendering of combining characters, call
      font-shape-gstring.
      
      * src/font.c (Ffont_get): Handle `combining-capability' property.
      (syms_of_font): New symbol ":combining-capability'.
      
      * src/font.h (struct font_driver): New member combining_capability.
      
      * src/ftfont.c: Include "category.h".
      (ftfont_driver): Initialize combining_capability to
      ftfont_combining_capability.
      (ftfont_shape_by_flt): If OTF is null, try to find a suitable
      FLT in advance.
      (ftfont_combining_capability): New function.
      536f48e9
  27. 01 Jan, 2016 1 commit
  28. 24 Nov, 2015 1 commit
    • Eli Zaretskii's avatar
      Fix crash at startup related to GC of font entities · d5fdffec
      Eli Zaretskii authored
      * src/font.h (GC_FONT_SPEC_P, GC_FONT_ENTITY_P)
      (GC_FONT_OBJECT_P, GC_XFONT_SPEC, GC_XFONT_ENTITY)
      (GC_XFONT_OBJECT): New macros, for use in garbage collector.
      * src/alloc.c (compact_font_cache_entry, compact_font_caches):
      Don't ifdef away font cache compaction on NT_GUI, as the problems
      which led to that seem to have been solved.
      (compact_font_cache_entry): Use GC_FONT_SPEC_P, GC_XFONT_SPEC,
      GC_XFONT_ENTITY, and GC_XFONT_OBJECT, instead of their non-GC_
      cousins.  (Bug#21999)
      d5fdffec
  29. 21 Oct, 2015 1 commit
    • Paul Eggert's avatar
      Include-file cleanup for src directory · 63cfb75f
      Paul Eggert authored
      Omit ‘#include "foo.h"’ unless the file needs foo.h (Bug#21707).
      In a few cases, add ‘#include "foo.h"’ if the file needs foo.h
      but does not include it directly.  As a general rule, a source
      file should include foo.h if it needs the interfaces that foo.h
      defines.
      * src/alloc.c: Don’t include process.h.  Include dispextern.h,
      systime.h.
      * src/atimer.c: Don’t include blockinput.h.
      * src/buffer.c: Include coding.h, systime.h.  Don’t include
      keyboard.h, coding.h.
      * src/callint.c: Don’t include commands.h, keymap.h.
      * src/callproc.c: Don’t include character.h, ccl.h, composite.h,
      systty.h, termhooks.h.
      * src/casetab.c: Don’t include character.h.
      * src/category.c: Don’t include charset.h, keymap.h.
      * src/ccl.h: Don’t include character.h.
      * src/character.c: Don’t include charset.h.
      * src/charset.c: Don’t include disptab.h.
      * src/chartab.c: Don’t include ccl.h.
      * src/cm.c: Don’t include frame.h, termhooks.h.
      * src/cmds.c: Don’t include window.h, dispextern.h.
      * src/coding.c: Don’t include window.h, frame.h.
      * src/composite.c: Include composite.h.  Don’t include window.h,
      font.h.
      * src/data.c: Don’t include syssignal.h, termhooks.h, font.h.
      * src/dbusbind.c: Don’t include frame.h.
      * src/decompress.c: Don’t include character.h.
      * src/dired.c: Don’t include character.h, commands.h, charset.h.
      * src/dispnew.c: Don’t include character.h, indent.h, intervals.h,
      process.h, timespec.h.  Include systime.h.
      * src/doc.c: Include coding.h.  Don’t include keyboard.h.
      * src/editfns.c: Include composite.h.  Don’t include frame.h.
      * src/emacs.c: Include fcntl.h, coding.h.  Don’t include
      commands.h, systty.h..
      * src/fileio.c: Don’t include intervals.h, dispextern.h.
      Include composite.h.
      * src/filelock.c: Don’t include character.h, systime.h.
      * src/fns.c: Don’t include time.h, commands.h, keyboard.h,
      keymap.h, frame.h, blockinput.h, xterm.h.  Include composite.h.
      * src/font.c: Include termhooks.h.
      * src/font.h: Don’t include ccl.h, frame.h.  Add forward decls of
      struct composition_it, struct face, struct glyph_string.
      * src/fontset.c: Don’t include buffer.h, ccl.h, keyboard.h,
      intervals.h, window.h, termhooks.h.
      * src/frame.c: Don’t include character.h, commands.h, font.h.
      * src/frame.h: Don’t include dispextern.h.
      * src/fringe.c: Don’t include character.h.
      * src/ftcrfont.c: Don’t include dispextern.h, frame.h,
      character.h, charset.h, fontset.h.
      * src/ftfont.c: Don’t include frame.h, blockinput.h, coding.h,
      fontset.h.
      * src/ftxfont.c: Don’t include dispextern.h, character.h,
      charset.h, fontset.h.
      * src/gfilenotify.c: Don’t include frame.h, process.h.
      * src/gtkutil.c: Include dispextern.h, frame.h, systime.h.
      Don’t include syssignal.h, buffer.h, charset.h, font.h.
      * src/gtkutil.h: Don’t include frame.h.
      * src/image.c: Include fcntl.h and stdio.h instead of sysstdio.h.
      Don’t include character.h.
      * src/indent.c: Don’t include keyboard.h, termchar.h.
      * src/inotify.c: Don’t include character.h, frame.h.
      * src/insdel.c: Include composite.h.  Don’t include blockinput.h.
      * src/intervals.c: Don’t include character.h, keyboard.h.
      * src/intervals.h: Don’t include dispextern.h, composite.h.
      * src/keyboard.c: Don’t include sysstdio.h, disptab.h, puresize.h.
      Include coding.h.
      * src/keyboard.h: Don’t incldue systime.h.
      * src/keymap.c: Don’t include charset.h, frame.h.
      * src/lread.c: Include dispextern.h and systime.h.
      Don’t include frame.h.  Include systime.h.
      * src/macros.c: Don’t include commands.h, character.h, buffer.h.
      * src/menu.c: Include character.h, coding.h.  Don’t include
      dispextern.h.
      * src/menu.h: Don’t include systime.h.
      * src/minibuf.c: Don’t include commands.h, dispextern.h, syntax.h,
      intervals.h, termhooks.h.
      * src/print.c: Include coding.h.  Don’t include keyboard.h,
      window.h, dispextern.h, termchar.h, termhooks.h, font.h.
      Add forward decl of struct terminal.
      * src/process.c: Don’t include termhooks.h, commands.h,
      dispextern.h, composite.h.
      * src/region-cache.c: Don’t include character.h.
      * src/scroll.c: Don’t include keyboard.h, window.h.
      * src/search.c: Don’t include category.h, commands.h.
      * src/sound.c: Don’t include dispextern.h.
      * src/syntax.c: Don’t include command.h, keymap.h.
      * src/sysdep.c: Don’t include window.h, dispextern.h.
      * src/systime.h: Use ‘#ifdef emacs’, not ‘#ifdef EMACS_LISP_H’,
      * src/term.c: Don’t include systty.h, intervals.h, xterm.h.
      * src/terminal.c: Include character.h.
      Don’t include charset.h, coding.h.
      * src/textprop.c: Don’t include character.h.
      * src/undo.c: Don’t include character.h, commands.h, window.h.
      * src/unexsol.c: Don’t include character.h, charset.h.
      * src/widget.c: Include widget.h.  Don’t include keyboard.h,
      window.h, dispextern.h, blockinput.h, character.h, font.h.
      * src/widgetprv.h: Don’t include widget.h.
      * src/window.c: Don’t include character.h, menu.h, intervals.h.
      * src/xdisp.c: Include composite.h, systime.h.  Don’t include
      macros.h, process.h.
      * src/xfaces.c: Don’t include charset.h, keyboard.h, termhooks.h,
      intervals.h.
      * src/xfns.c: Don’t include menu.h, character.h, intervals.h,
      epaths.h, fontset.h, systime.h, atimer.h, termchar.h.
      * src/xfont.c: Don’t include dispextern.h, fontset.h, ccl.h.
      * src/xftfont.c: Don’t include dispextern.h, character.h, fontset.h.
      * src/xgselect.c: Don’t include timespec.h, frame.h.
      Include systime.h.
      * src/xgselect.h: Don’t include time.h.
      Use a forward decl to struct timespec instead.
      * src/xmenu.c: Don’t include keymap.h, character.h, charset.h,
      dispextern.h.  Include systime.h.
      * src/xml.c: Don’t include character.h.
      * src/xrdb.c [USE_MOTIF]: Don’t include keyboard.h.
      * src/xselect.c: Don’t include dispextern.h, character.h,
      buffer.h, process.h.
      * src/xsmfns.c: Don’t include systime.h, sysselect.h.
      * src/xterm.c: Don’t include syssignal.h, charset.h, disptab.h,
      intervals.h process.h, keymap.h, xgselect.h.  Include composite.h.
      63cfb75f
  30. 11 Feb, 2015 1 commit
    • Jan D's avatar
      Add cairo drawing. · dddcc0e7
      Jan D authored
      * configure.ac (with-cairo): New option.
      (USE_CAIRO): Default to yes for Gtk+ 3.  Add code to test for cairo,
      set CAIRO_CFLAGS, CAIRO_LIBS.  Add ftcrfonto to FONT_OBJ if cairo.
      Output "Does Emacs use cairo?".
      
      * lisp/version.el (emacs-version): Add cairo version.
      
      * src/Makefile.in (CAIRO_CFLAGS, CAIRO_LIBS): New variables.
      (FONT_OBJ): Add comment about ftcrfont.
      (ALL_CFLAGS): Add CAIRO_CFLAGS.
      (LIBES): Add CAIRO_LIBS.
      
      * src/dispextern.h (struct image): Add cr_data for cairo.
      (x_cr_init_fringe): Declare.
      
      * src/font.c (syms_of_font): Call syms_of_ftcrfont for cairo.
      
      * src/font.h (ftcrfont_driver, syms_of_ftcrfont): Declare
      
      * src/fringe.c (x_cr_init_fringe): New function name that shares code
      with w32_init_fringe.
      
      * src/ftcrfont.c: New font driver for cairo, based on the ftfont driver.
      
      * src/ftfont.c (ftfont_info_size); New global variable.
      (ftfont_open2): New extern function almost the same as old ftfont_open,
      but takes the font_object as argument.
      (ftfont_open): Build font object and call ftfont_open2.
      
      * src/ftfont.h (ftfont_open2, ftfont_info_size): Declare.
      
      * src/gtkutil.c (xg_clear_under_internal_border)
      (xg_update_scrollbar_pos, xg_update_horizontal_scrollbar_pos): Only
      queue_draw if not cairo.  Change args to x_clear_area.
      (xg_get_font): Use Qftcr when using cairo, Qxft otherwise.
      (xg_page_setup_dialog, xg_get_page_setup, draw_page)
      (xg_print_frames_dialog): New functions for printing.
      
      * src/gtkutil.h (xg_page_setup_dialog, xg_get_page_setup)
      (xg_print_frames_dialog): Declare.
      
      * src/image.c: Add defined (USE_CAIRO) for PNG.
      Add !defined USE_CAIRO for W32 PNG code.
      (x_clear_image): If cairo, destroy the surface in cr_data.
      (png_load): Add new cairo compatible implementation.
      (lookup_image_type): Add defined (USE_CAIRO) for define png_type.
      
      * src/xfns.c: New section Printing.
      (x-export-frames, x-page-setup-dialog, x-get-page-setup)
      (x-print-frames-dialog): New printing functions.
      (Fx_create_frame, x_create_tip_frame): Register ftcrfont if
      cairo.
      (syms_of_xfns): Defsym Qorientation, Qtop_margin, Qbottom_margin,
      Qportrait, Qlandscape, Qreverse_portrait, Qreverse_landscape).
      (syms_of_xfns): Provide cairo and defvar cairo-version-string.
      defsubr Sx_page_setup_dialog, Sx_get_page_setup, Sx_print_frames_dialog.
      
      * src/xterm.c (x_clear_area1, x_prepare_for_xlibdraw)
      (x_set_clip_rectangles, x_reset_clip_rectangles, x_fill_rectangle)
      (x_draw_rectangle, x_fill_trapezoid_for_relief, x_clear_window)
      (x_gc_get_ext_data, x_extension_initialize, x_cr_accumulate_data):
      Declare.
      (FRAME_CR_CONTEXT, FRAME_CR_SURFACE): New macros.
      (max_fringe_bmp, fringe_bmp): New variables.
      (x_gc_get_ext_data, x_extension_initialize)
      (x_cr_destroy_surface, x_begin_cr_clip, x_end_cr_clip)
      (x_set_cr_source_with_gc_foreground)
      (x_set_cr_source_with_gc_background, x_cr_define_fringe_bitmap)
      (x_cr_destroy_fringe_bitmap, x_cr_draw_image, x_cr_draw_frame)
      (x_cr_accumulate_data, x_cr_destroy, x_cr_export_frames)
      (x_prepare_for_xlibdraw, x_set_clip_rectangles)
      (x_reset_clip_rectangles, x_fill_rectangle, x_draw_rectangle)
      (x_clear_window, x_fill_trapezoid_for_relief): New functions.
      (x_update_begin): Create cairo surface if needed.
      (x_draw_vertical_window_border): Call x_fill_rectangle for cairo.
      (x_update_end): Paint cairo drawing surface to xlib surface.
      (x_clear_under_internal_border, x_after_update_window_line): Adjust
      arguments to x_clear_area.
      (x_draw_fringe_bitmap): Call x_fill_rectangle.  Get GC values and
      call x_cr_draw_image for cairo.  Call x_reset_clip_rectangles instead
      of XSetClipMask.
      (x_set_glyph_string_clipping)
      (x_set_glyph_string_clipping_exactly): Use x_set_clip_rectangles
      instead of XSetClipRectangles.
      (x_clear_glyph_string_rect, x_draw_glyph_string_background): Use
      x_fill_rectangle instead of XFillRectangle.
      (x_draw_glyph_string_foreground)
      (x_draw_composite_glyph_string_foreground)
      (x_draw_glyphless_glyph_string_foreground): Use x_draw_rectangle instead
      of XDrawRectangle.
      (x_draw_relief_rect): Add code for USE_CAIRO.
      Call x_reset_clip_rectangles instead of XSetClipMask.
      (x_draw_box_rect): x_set_clip_rectangles instead of XSetClipRectangles,
      x_fill_rectangle instead of XFillRectangle, x_reset_clip_rectangles
      instead of XSetClipMask.
      (x_draw_image_foreground, x_draw_image_foreground_1):
      x_draw_rectangle instead of XDrawRectangle.
      (x_draw_glyph_string_bg_rect): x_fill_rectangle instead of
      XFillRectangle.
      (x_draw_image_glyph_string): If img has cr_data, use it as
      a cairo surface.
      (x_draw_stretch_glyph_string): x_set_clip_rectangles instead of
      XSetClipRectangles, x_fill_rectangle instead of XFillRectangle.
      (x_draw_glyph_string): x_fill_rectangle instead of XFillRectangle.,
      x_reset_clip_rectangles instead of XSetClipMask.
      (x_shift_glyphs_for_insert): Call x_prepare_for_xlibdraw.
      (x_clear_area1): New function that calls XClearArea.
      (x_clear_area): Takes frame as parameter, calls x_clear_area1 for
      non-cairo.
      (x_clear_frame): x_clear_window instead of XClearWindow.
      (x_scroll_run): Set frame garbaged if cairo.
      (XTmouse_position): Initialize *part to 0.
      (x_scroll_bar_create): Adjust arguments to x_clear_area.
      (x_scroll_bar_set_handle): x_clear_area1 instead of x_clear_area,
      x_fill_rectangle instead of XFillRectangle.
      (XTset_vertical_scroll_bar, XTset_horizontal_scroll_bar): Adjust
      arguments to x_clear_area.
      (x_scroll_bar_expose): x_draw_rectangle instead of XDrawRectangle.
      (handle_one_xevent): Adjust arguments to x_clear_area.
      Destroy cairo surface for frame if ConfigureNotify.
      (x_clip_to_row): x_set_clip_rectangles instead of XSetClipRectangles.
      (x_draw_hollow_cursor): x_draw_rectangle instead of XDrawRectangle,
      x_reset_clip_rectangles instead of XSetClipMask.
      (x_draw_bar_cursor): x_fill_rectangle instead of XFillRectangle,
      x_reset_clip_rectangles instead of XSetClipMask.
      (x_clear_frame_area): Adjust arguments to x_clear_area.
      (x_free_frame_resources): Call x_prepare_for_xlibdraw.
      (x_term_init): Call x_extension_initialize if cairo.
      (x_redisplay_interface): Add x_cr_define_fringe_bitmap,
      x_cr_destroy_fringe_bitmap for cairo.
      (x_initialize): Call x_cr_init_fringe for cairo.
      
      * src/xterm.h: Add include of cairo header files.
      (x_bitmap_record): Add img if cairo.
      (x_gc_ext_data): New struct for cairo.
      (x_display_info): Add ext_codes for cairo.
      (x_output): Add cr_context and cr_surface for cairo.
      (x_clear_area): Change arguments from Display*/Window to frame pointer.
      (x_query_color, x_begin_cr_clip, x_end_cr_clip)
      (x_set_cr_source_with_gc_foreground, x_set_cr_source_with_gc_background)
      (x_cr_draw_frame, x_cr_export_frames): Declare.
      dddcc0e7
  31. 16 Jan, 2015 1 commit
    • Dmitry Antipov's avatar
      Prefer INLINE functions in font.h to match style used in lisp.h · 4303d110
      Dmitry Antipov authored
      * font.h (FONTP, FONT_SPEC_P, FONT_ENTITY_P, FONT_OBJECT_P)
      (CHECK_FONT, CHECK_FONT_SPEC, CHECK_FONT_ENTITY, CHECK_FONT_OBJECT)
      (XFONT_SPEC, XFONT_ENTITY, XFONT_OBJECT, CHECK_FONT_GET_OBJECT):
      Now functions.
      * font.c (Ffont_otf_alternates, Fquery_font, Ffont_get_glyphs):
      * ftfont.c (ftfont_shape):
      * macfont.m (macfont_shape):
      * w32uniscribe.c (uniscribe_shape):
      * xftfont.c (xftfont_shape): Adjust CHECK_FONT_GET_OBJECT users.
      4303d110
  32. 10 Jan, 2015 1 commit
    • Paul Eggert's avatar
      Port to HAVE_FREETYPE && !HAVE_XFT · 64993792
      Paul Eggert authored
      * dispextern.h (struct face.extra) [HAVE_FREETYPE && !HAVE_XFT]:
      * font.h (syms_of_xftfont) [HAVE_FREETYPE && !HAVE_XFT]:
      Declare in this case too.
      64993792
  33. 05 Jan, 2015 1 commit
    • Paul Eggert's avatar
      Compute C decls for DEFSYMs automatically · 58f2d6ef
      Paul Eggert authored
      Fixes Bug#15880.
      This patch also makes Q constants (e.g., Qnil) constant addresses
      from the C point of view.
      * make-docfile.c: Revamp to generate table of symbols, too.
      Include <stdbool.h>.
      (xstrdup): New function.
      (main): Don't process the same file twice.
      (SYMBOL): New constant in enum global_type.
      (struct symbol): Turn 'value' member into a union, either v.value
      for int or v.svalue for string.  All uses changed.
      (add_global): New arg svalue, which overrides value, so that globals
      can have a string value.
      (close_emacs_global): New arg num_symbols; all uses changed.
      Output lispsym decl.
      (write_globals): Output symbol globals too.  Output more
      ATTRIBUTE_CONST, now that Qnil etc. are C constants.
      Output defsym_name table.
      (scan_c_file): Move most of guts into ...
      (scan_c_stream): ... new function.  Scan for DEFSYMs and
      record symbols found.  Don't read past EOF if file doesn't
      end in newline.
      * alloc.c, bidi.c, buffer.c, bytecode.c, callint.c, casefiddle:
      * casetab.c, category.c, ccl.c, charset.c, chartab.c, cmds.c, coding.c:
      * composite.c, data.c, dbusbind.c, decompress.c, dired.c, dispnew.c:
      * doc.c, editfns.c, emacs.c, eval.c, fileio.c, fns.c, font.c, fontset.c:
      * frame.c, fringe.c, ftfont.c, ftxfont.c, gfilenotify.c, gnutls.c:
      * image.c, inotify.c, insdel.c, keyboard.c, keymap.c, lread.c:
      * macfont.m, macros.c, minibuf.c, nsfns.m, nsfont.m, nsimage.m:
      * nsmenu.m, nsselect.m, nsterm.m, print.c, process.c, profiler.c:
      * search.c, sound.c, syntax.c, term.c, terminal.c, textprop.c, undo.c:
      * window.c, xdisp.c, xfaces.c, xfns.c, xftfont.c, xmenu.c, xml.c:
      * xselect.c, xsettings.c, xterm.c:
      Remove Q vars that represent symbols (e.g., Qnil, Qt, Qemacs).
      These names are now defined automatically by make-docfile.
      * alloc.c (init_symbol): New function.
      (Fmake_symbol): Use it.
      (c_symbol_p): New function.
      (valid_lisp_object_p, purecopy): Use it.
      * alloc.c (marked_pinned_symbols):
      Use make_lisp_symbol instead of make_lisp_ptr.
      (garbage_collect_1): Mark lispsym symbols.
      (CHECK_ALLOCATED_AND_LIVE_SYMBOL): New macro.
      (mark_object): Use it.
      (sweep_symbols): Sweep lispsym symbols.
      (symbol_uses_obj): New function.
      (which_symbols): Use it.  Work for lispsym symbols, too.
      (init_alloc_once): Initialize Vpurify_flag here; no need to wait,
      since Qt's address is already known now.
      (syms_of_alloc): Add lispsym count to symbols_consed.
      * buffer.c (init_buffer_once): Compare to Qnil, not to make_number (0),
      when testing whether storage is all bits zero.
      * dispextern (struct image_type):
      * font.c (font_property_table):
      * frame.c (struct frame_parm_table, frame_parms):
      * keyboard.c (scroll_bar_parts, struct event_head):
      * xdisp.c (struct props):
      Use XSYMBOL_INIT (Qfoo) and struct Lisp_Symbol * rather than &Qfoo and
      Lisp_Object *, since Qfoo is no longer an object whose address can be
      taken.  All uses changed.
      * eval.c (run_hook): New function.  Most uses of Frun_hooks changed to
      use it, so that they no longer need to take the address of a Lisp sym.
      (syms_of_eval): Don't use DEFSYM on Vrun_hooks, as it's a variable.
      * frame.c (syms_of_frame): Add defsyms for the frame_parms table.
      * keyboard.c (syms_of_keyboard): Don't DEFSYM Qmenu_bar here.
      DEFSYM Qdeactivate_mark before the corresponding var.
      * keymap.c (syms_of_keymap): Use DEFSYM for Qmenu_bar and Qmode_line
      instead of interning their symbols; this avoids duplicates.
      (LISP_INITIALLY, TAG_PTR)
      (DEFINE_LISP_SYMBOL_BEGIN, DEFINE_LISP_SYMBOL_END, XSYMBOL_INIT):
      New macros.
      (LISP_INITIALLY_ZERO): Use it.
      (enum symbol_interned, enum symbol_redirect, struct Lisp_Symbol)
      (EXFUN, DEFUN_ARGS_MANY, DEFUN_ARGS_UNEVALLED, DEFUN_ARGS_*):
      Move decls up, to avoid forward uses.  Include globals.h earlier, too.
      (make_lisp_symbol): New function.
      (XSETSYMBOL): Use it.
      (DEFSYM): Now just a placeholder for make-docfile.
      * lread.c (DEFINE_SYMBOLS): Define, for globals.h.
      (intern_sym): New function, with body taken from old intern_driver.
      (intern_driver): Use it.  Last arg is now Lisp integer, not ptrdiff_t.
      All uses changed.
      (define_symbol): New function.
      (init_obarray): Define the C symbols taken from lispsym.
      Use plain DEFSYM for Qt and Qnil.
      * syntax.c (init_syntax_once): No need to worry about
      Qchar_table_extra_slots.
      58f2d6ef
  34. 01 Jan, 2015 2 commits
  35. 25 Aug, 2014 1 commit
    • Dmitry Antipov's avatar
      One more minor cleanup of font subsystem. · 8661ebaa
      Dmitry Antipov authored
      * font.h (struct font_driver): Convert text_extents to
      return void because returned value is never actually used.
      * macfont.c (macfont_text_extents):
      * w32font.c (w32font_text_extents):
      * xftfont.c (xftfont_text_extents): Adjust to return void
      and assume that 'metrics' argument is always non-NULL.
      * ftfont.c (ftfont_text_extents):
      * xfont.c (xfont_text_extents): Likewise.  Avoid redundant memset.
      8661ebaa
  36. 09 Jul, 2014 2 commits
    • Paul Eggert's avatar
      * font.c, font.h (font_unparse_fcname): Now static. · f5075377
      Paul Eggert authored
      Define only if HAVE_XFT || HAVE_FREETYPE || HAVE_NS.
      f5075377
    • Dmitry Antipov's avatar
      Next minor cleanup of font subsystem. · 876d043f
      Dmitry Antipov authored
      * font.h (enum font_property_index): Remove FONT_ENTITY_INDEX (no
      users) and FONT_FORMAT_INDEX (set by a few font drivers but never
      really used).
      (FONT_ENTITY_NOT_LOADABLE, FONT_ENTITY_SET_NOT_LOADABLE): Remove;
      unused.
      * ftfont.h (ftfont_font_format): Remove prototype.
      * ftfont.c (ftfont_font_format): Remove; now unused.
      (ftfont_open):
      * nsfont.m (nsfont_open):
      * w32font.c (w32font_open_internal):
      * w32uniscribe.c (uniscribe_open):
      * xfont.c (xfont_open):
      * xftfont.c (xftfont_open): All users changed.
      876d043f