Mercurial > hg > xemacs-beta
annotate src/gutter.h @ 5294:bbff29a01820
Add compiler macros and compilation sanity-checks for functions with keywords.
2010-10-25 Aidan Kehoe <kehoea@parhasard.net>
Add compiler macros and compilation sanity-checking for various
functions that take keywords.
* byte-optimize.el (side-effect-free-fns): #'symbol-value is
side-effect free and not error free.
* bytecomp.el (byte-compile-normal-call): Check keyword argument
lists for sanity; store information about the positions where
keyword arguments start using the new byte-compile-keyword-start
property.
* cl-macs.el (cl-const-expr-val): Take a new optional argument,
cl-not-constant, defaulting to nil, in this function; return it if
the expression is not constant.
(cl-non-fixnum-number-p): Make this into a separate function, we
want to pass it to #'every.
(eql): Use it.
(define-star-compiler-macros): Use the same code to generate the
member*, assoc* and rassoc* compiler macros; special-case some
code in #'add-to-list in subr.el.
(remove, remq): Add compiler macros for these two functions, in
preparation for #'remove being in C.
(define-foo-if-compiler-macros): Transform (remove-if-not ...) calls to
(remove ... :if-not) at compile time, which will be a real win
once the latter is in C.
(define-substitute-if-compiler-macros)
(define-subst-if-compiler-macros): Similarly for these functions.
(delete-duplicates): Change this compiler macro to use
#'plists-equal; if we don't have information about the type of
SEQUENCE at compile time, don't bother attempting to inline the
call, the function will be in C soon enough.
(equalp): Remove an old commented-out compiler macro for this, if
we want to see it it's in version control.
(subst-char-in-string): Transform this to a call to nsubstitute or
nsubstitute, if that is appropriate.
* cl.el (ldiff): Don't call setf here, this makes for a load-time
dependency problem in cl-macs.el
| author | Aidan Kehoe <kehoea@parhasard.net> |
|---|---|
| date | Mon, 25 Oct 2010 13:04:04 +0100 |
| parents | 0ca81354c4c7 |
| children | 308d34e9f07d |
| rev | line source |
|---|---|
| 428 | 1 /* Define general gutter support. |
| 2 Copyright (C) 1999 Andy Piper. | |
|
5077
d372b17f63ce
clean up toolbar/gutter edge geometry
Ben Wing <ben@xemacs.org>
parents:
826
diff
changeset
|
3 Copyright (C) 2010 Ben Wing. |
| 428 | 4 |
| 5 This file is part of XEmacs. | |
| 6 | |
| 7 XEmacs is free software; you can redistribute it and/or modify it | |
| 8 under the terms of the GNU General Public License as published by the | |
| 9 Free Software Foundation; either version 2, or (at your option) any | |
| 10 later version. | |
| 11 | |
| 12 XEmacs is distributed in the hope that it will be useful, but WITHOUT | |
| 13 ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or | |
| 14 FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License | |
| 15 for more details. | |
| 16 | |
| 17 You should have received a copy of the GNU General Public License | |
| 18 along with XEmacs; see the file COPYING. If not, write to | |
| 19 the Free Software Foundation, Inc., 59 Temple Place - Suite 330, | |
| 20 Boston, MA 02111-1307, USA. */ | |
| 21 | |
| 22 /* Synched up with: Not in FSF. */ | |
| 23 | |
| 440 | 24 #ifndef INCLUDED_gutter_h_ |
| 25 #define INCLUDED_gutter_h_ | |
| 428 | 26 |
| 27 #include "specifier.h" | |
| 28 | |
| 434 | 29 #define DEVICE_SUPPORTS_GUTTERS_P(d) HAS_DEVMETH_P (d, output_frame_gutters) |
| 428 | 30 |
| 31 DECLARE_SPECIFIER_TYPE (gutter); | |
| 32 #define XGUTTER_SPECIFIER(x) XSPECIFIER_TYPE (x, gutter) | |
| 33 #define GUTTER_SPECIFIERP(x) SPECIFIER_TYPEP (x, gutter) | |
| 34 #define CHECK_GUTTER_SPECIFIER(x) CHECK_SPECIFIER_TYPE (x, gutter) | |
| 35 #define CONCHECK_GUTTER_SPECIFIER(x) CONCHECK_SPECIFIER_TYPE (x, gutter) | |
| 36 | |
| 37 #define DEFAULT_GUTTER_WIDTH 40 | |
| 38 #define DEFAULT_GUTTER_BORDER_WIDTH 2 | |
| 39 | |
| 40 extern Lisp_Object Qgutter; | |
| 41 | |
| 42 extern Lisp_Object Vgutter_size[4]; | |
| 43 extern Lisp_Object Vgutter_border_width[4]; | |
| 44 void update_frame_gutters (struct frame *f); | |
| 442 | 45 void update_frame_gutter_geometry (struct frame *f); |
| 46 void mark_gutters (struct frame* f); | |
| 428 | 47 void init_frame_gutters (struct frame *f); |
| 48 void init_device_gutters (struct device *d); | |
| 49 void init_global_gutters (struct device *d); | |
| 50 void free_frame_gutters (struct frame *f); | |
| 51 void redraw_exposed_gutters (struct frame *f, int x, int y, int width, | |
| 52 int height); | |
| 53 void reset_gutter_display_lines (struct frame* f); | |
| 442 | 54 void gutter_extent_signal_changed_region_maybe (Lisp_Object obj, |
| 665 | 55 Charbpos start, Charbpos end); |
| 446 | 56 int display_boxes_in_gutter_p (struct frame *f, struct display_box* db, |
| 57 struct display_glyph_area* dga); | |
| 428 | 58 |
| 59 #define WINDOW_GUTTER_BORDER_WIDTH(w, pos) \ | |
| 442 | 60 (INTP ((w)->gutter_border_width[pos]) ? XINT ((w)->gutter_border_width[pos]) : 0) |
| 428 | 61 #define WINDOW_GUTTER_SIZE(w, pos) \ |
| 442 | 62 (INTP ((w)->gutter_size[pos]) ? XINT ((w)->gutter_size[pos]) : 0) |
| 428 | 63 #define WINDOW_GUTTER_SIZE_INTERNAL(w, pos) \ |
| 442 | 64 (INTP ((w)->real_gutter_size[pos]) ? XINT ((w)->real_gutter_size[pos]) : 0) |
| 428 | 65 #define WINDOW_GUTTER_VISIBLE(w, pos) \ |
| 442 | 66 ((w)->gutter_visible_p[pos]) |
| 428 | 67 #define WINDOW_GUTTER(w, pos) \ |
| 442 | 68 ((w)->real_gutter[pos]) |
| 69 #define RAW_WINDOW_GUTTER(w, pos) \ | |
| 70 ((w)->gutter[pos]) | |
| 428 | 71 |
| 72 #define WINDOW_REAL_GUTTER_SIZE(w, pos) \ | |
| 73 (!NILP (WINDOW_GUTTER_VISIBLE (w, pos)) \ | |
| 74 ? WINDOW_GUTTER_SIZE_INTERNAL (w, pos) \ | |
| 75 : 0) | |
| 76 #define WINDOW_REAL_GUTTER_VISIBLE(f, pos) \ | |
| 77 (WINDOW_REAL_GUTTER_SIZE (f, pos) > 0) | |
| 78 #define WINDOW_REAL_GUTTER_BORDER_WIDTH(f, pos) \ | |
| 79 ((!NILP (WINDOW_GUTTER_VISIBLE (f, pos)) \ | |
| 80 && WINDOW_GUTTER_SIZE_INTERNAL (f,pos) > 0) \ | |
| 81 ? WINDOW_GUTTER_BORDER_WIDTH (f, pos) \ | |
| 82 : 0) | |
| 83 #define WINDOW_REAL_GUTTER_BOUNDS(f, pos) \ | |
| 84 (WINDOW_REAL_GUTTER_SIZE (f,pos) + \ | |
| 85 2 * WINDOW_REAL_GUTTER_BORDER_WIDTH (f,pos)) | |
| 86 | |
| 87 /* these macros predicate size on position and type of window */ | |
| 88 #define WINDOW_REAL_TOP_GUTTER_BOUNDS(w) \ | |
| 5090 | 89 WINDOW_REAL_GUTTER_BOUNDS (w, TOP_EDGE) |
| 428 | 90 #define WINDOW_REAL_BOTTOM_GUTTER_BOUNDS(w) \ |
| 5090 | 91 WINDOW_REAL_GUTTER_BOUNDS (w, BOTTOM_EDGE) |
| 428 | 92 #define WINDOW_REAL_LEFT_GUTTER_BOUNDS(w) \ |
| 5090 | 93 WINDOW_REAL_GUTTER_BOUNDS (w, LEFT_EDGE) |
| 428 | 94 #define WINDOW_REAL_RIGHT_GUTTER_BOUNDS(w) \ |
| 5090 | 95 WINDOW_REAL_GUTTER_BOUNDS (w, RIGHT_EDGE) |
| 428 | 96 |
| 97 #define FRAME_GUTTER_VISIBLE(f, pos) \ | |
| 98 WINDOW_REAL_GUTTER_VISIBLE (XWINDOW (FRAME_LAST_NONMINIBUF_WINDOW (f)), pos) | |
| 99 #define FRAME_GUTTER_SIZE(f, pos) \ | |
| 100 WINDOW_REAL_GUTTER_SIZE (XWINDOW (FRAME_LAST_NONMINIBUF_WINDOW (f)), pos) | |
| 101 #define FRAME_GUTTER_BOUNDS(f, pos) \ | |
| 102 WINDOW_REAL_GUTTER_BOUNDS (XWINDOW (FRAME_LAST_NONMINIBUF_WINDOW (f)), pos) | |
| 103 #define FRAME_GUTTER_BORDER_WIDTH(f, pos) \ | |
| 104 WINDOW_REAL_GUTTER_BORDER_WIDTH (XWINDOW (FRAME_LAST_NONMINIBUF_WINDOW (f)), pos) | |
| 105 | |
| 106 #define FRAME_GUTTER(f, pos) \ | |
| 107 WINDOW_GUTTER (XWINDOW (FRAME_LAST_NONMINIBUF_WINDOW (f)), pos) | |
| 108 | |
| 109 /* these macros predicate size on position and type of window */ | |
| 5090 | 110 #define FRAME_TOP_GUTTER_BOUNDS(f) FRAME_GUTTER_BOUNDS (f, TOP_EDGE) |
| 111 #define FRAME_BOTTOM_GUTTER_BOUNDS(f) FRAME_GUTTER_BOUNDS (f, BOTTOM_EDGE) | |
| 112 #define FRAME_LEFT_GUTTER_BOUNDS(f) FRAME_GUTTER_BOUNDS (f, LEFT_EDGE) | |
| 113 #define FRAME_RIGHT_GUTTER_BOUNDS(f) FRAME_GUTTER_BOUNDS (f, RIGHT_EDGE) | |
| 428 | 114 |
| 440 | 115 #endif /* INCLUDED_gutter_h_ */ |
