Server IP : 111.118.215.189 / Your IP : 18.191.235.214 Web Server : Apache System : Linux md-in-83.webhostbox.net 4.19.286-203.ELK.el7.x86_64 #1 SMP Wed Jun 14 04:33:55 CDT 2023 x86_64 User : a1673wkz ( 2475) PHP Version : 8.2.25 Disable Function : NONE MySQL : OFF | cURL : ON | WGET : ON | Perl : ON | Python : ON Directory (0755) : /usr/share/emacs/24.3/lisp/ |
[ Home ] | [ C0mmand ] | [ Upload File ] |
---|
;ELC ;;; Compiled by mockbuild@buildfarm06-new.corp.cloudlinux.com on Fri Oct 11 10:06:31 2024 ;;; from file /builddir/build/BUILD/emacs-24.3/lisp/strokes.el ;;; in Emacs version 24.3.1 ;;; with all optimizations. ;;; This file uses dynamic docstrings, first added in Emacs 19.29. ;;; This file does not contain utf-8 non-ASCII characters, ;;; and so can be loaded in Emacs versions earlier than 23. ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; (autoload 'mail-position-on-field "sendmail") #@130 Symbol representing a stroke lift event for complex strokes. Complex strokes are those which contain two or more simple strokes. (defconst strokes-lift :strokes-lift (#$ . 597)) #@51 The header to all xpm buffers created by strokes. (defconst strokes-xpm-header "/* XPM */\nstatic char * stroke_xpm[] = {\n/* width height ncolors cpp [x_hot y_hot] */\n\"33 33 9 1 26 23\",\n/* colors */\n\" c none s none\",\n\"* c #000000 s foreground\",\n\"R c #FFFF00000000\",\n\"O c #FFFF80000000\",\n\"Y c #FFFFFFFF0000\",\n\"G c #0000FFFF0000\",\n\"B c #00000000FFFF\",\n\"P c #FFFF0000FFFF\",\n\". c #45458B8B0000\",\n/* pixels */\n" (#$ . 781)) (byte-code "\302\303\304\305\306\307\310\311&\210\312\313\314\304#\210\315\304\211\2037 @\313N\2030 \314N\2040 \316\314\313N#\210 A\211\204 *\317\313\314\320#\210\321\314\322\323\324\325\310\303&\210\321\326\327\330\324\331\310\303&\210\321\332\333\334\324\335\310\303&\210\321\336\337\340\324\335\310\303&\210\321\341\342\343\324\344\310\303&\207" [prop --dolist-tail-- custom-declare-group strokes nil "Control Emacs through mouse strokes." :link (emacs-commentary-link "strokes") :group mouse defvaralias strokes-modeline-string strokes-lighter (saved-value saved-variable-comment) put make-obsolete-variable "24.3" custom-declare-variable " Strokes" "Mode line identifier for Strokes mode." :type string strokes-character 64 "Character used when drawing strokes in the strokes buffer.\n(The default is `@', which works well.)" character strokes-minimum-match-score 1000 "Minimum score for a stroke to be considered a possible match.\nSetting this variable to 0 would require a perfectly precise match.\nThe default value is 1000, but it's mostly dependent on how precisely\nyou manage to replicate your user-defined strokes. It also depends on\nthe value of `strokes-grid-resolution', since a higher grid resolution\nwill correspond to more sample points, and thus more distance\nmeasurements. Usually, this is not a problem since you first set\n`strokes-grid-resolution' based on what your computer seems to be able\nto handle (though the defaults are usually more than sufficient), and\nthen you can set `strokes-minimum-match-score' to something that works\nfor you. The only purpose of this variable is to insure that if you\ndo a bogus stroke that really doesn't match any of the predefined\nones, then strokes should NOT pick the one that came closest." integer strokes-grid-resolution 9 "Integer defining dimensions of the stroke grid.\nThe grid is a square grid, where `strokes-grid-resolution' defaults to\n`9', making a 9x9 grid whose coordinates go from (0 . 0) on the top\nleft to ((strokes-grid-resolution - 1) . (strokes-grid-resolution - 1))\non the bottom right. The greater the resolution, the more intricate\nyour strokes can be.\nNOTE: This variable should be odd and MUST NOT be less than 3 and need\n not be greater than 33, which is the resolution of the pixmaps.\nWARNING: Changing the value of this variable will gravely affect the\n strokes you have already programmed in. You should try to\n figure out what it should be based on your needs and on how\n quick the particular platform(s) you're operating on, and\n only then start programming in your custom strokes." strokes-file (convert-standard-filename "~/.strokes") "File containing saved strokes for Strokes mode (default is ~/.strokes)." file] 9) #@56 The name of the buffer that the strokes take place in. (defvar strokes-buffer-name " *strokes*" (#$ . 4033)) #@249 If non-nil, the strokes buffer is used and strokes are displayed. If nil, strokes will be read the same, however the user will not be able to see the strokes. This be helpful for people who don't like the delay in switching to the strokes buffer. (custom-declare-variable 'strokes-use-strokes-buffer t '(#$ . 4149) :type 'boolean :group 'strokes) #@138 The special window configuration used when entering strokes. This is set properly in the function `strokes-update-window-configuration'. (defvar strokes-window-configuration nil (#$ . 4504)) #@161 Last stroke entered by the user. Its value gets set every time the function `strokes-fill-stroke' gets called, since that is the best time to set the variable. (defvar strokes-last-stroke nil (#$ . 4702)) #@288 Association list of strokes and their definitions. Each entry is (STROKE . COMMAND) where STROKE is itself a list of coordinates (X . Y) where X and Y are lists of positions on the normalized stroke grid, with the top left at (0 . 0). COMMAND is the corresponding interactive function. (defvar strokes-global-map nil (#$ . 4914)) #@48 Functions to be called when Strokes is loaded. (defvar strokes-load-hook nil (#$ . 5251)) #@36 Non-nil if STROKE is really click. (defalias 'strokes-click-p #[(stroke) "G\301W\207" [stroke 2] 2 (#$ . 5347)]) (put 'strokes-click-p 'byte-optimizer 'byte-compile-inline-expand) (defalias 'strokes-remassoc #[(key list) "\303\304 \n\"\211\203 \305\n\"\202 )\n\207" [elt key list nil assoc delete] 3]) (put 'strokes-remassoc 'byte-optimizer 'byte-compile-inline-expand) #@56 Add STROKE to STROKE-MAP alist with given command DEF. (defalias 'strokes-define-stroke '(macro . #[(stroke-map stroke def) "\303\304D\305\306 \307\211\nE\310 EEEF\207" [stroke stroke-map def if strokes-click-p (error "That's a click, not a stroke") setq cons strokes-remassoc] 10 (#$ . 5730)])) #@36 Return the square of the number X. (defalias 'strokes-square #[(x) "\211_\207" [x] 2 (#$ . 6035)]) (put 'strokes-square 'byte-optimizer 'byte-compile-inline-expand) #@104 Gets the distance (squared) between to points P1 and P2. P1 and P2 are cons cells in the form (X . Y). (defalias 'strokes-distance-squared #[(p1 p2) "@A @ A Z\211\211_)\n\fZ\211\211_)\\,\207" [p1 p2 y2 x2 y1 x1 x] 5 (#$ . 6208)]) (put 'strokes-distance-squared 'byte-optimizer 'byte-compile-inline-expand) (defalias 'strokes-mouse-event-p #[(event) ":\205* @9\205* @\301=\206* \302@\303N>\206* \304@\303N>\206* \305@\303N>\207" [event mouse-movement click event-symbol-elements down drag] 3]) (put 'strokes-mouse-event-p 'byte-optimizer 'byte-compile-inline-expand) (defalias 'strokes-button-press-event-p #[(event) ":\205 @9\205 \301@\302N>\207" [event down event-symbol-elements] 3]) (put 'strokes-button-press-event-p 'byte-optimizer 'byte-compile-inline-expand) (defalias 'strokes-button-release-event-p #[(event) ":\205 @9\205 \301@\302N>\206 \303@\302N>\207" [event click event-symbol-elements drag] 3]) (put 'strokes-button-release-event-p 'byte-optimizer 'byte-compile-inline-expand) #@110 Return position of start of line LINE in WINDOW. If LINE is nil, return the last position visible in WINDOW. (defalias 'strokes-event-closest-point-1 #[(window &optional line) "\304!\305!\203 \306\202 \307Z\n\206 \212\310!b\210\311!U\203+ \n\204+ \312u\210`+\207" [window total line distance window-height window-minibuffer-p 0 1 window-start vertical-motion -1] 3 (#$ . 7236)]) #@173 Return the nearest position to where EVENT ended its motion. This is computed for the window where EVENT's motion started, or for window START-WINDOW if that is specified. (defalias 'strokes-event-closest-point #[(event &optional start-window) "\204\f \306 !\211@)\307 !\211@)=\203\205 \307 !\310\n8\2063 \nA@:\2030 \nA@@\2023 \nA@)\311=\203C \312\313\307 !!A\"\207\307 !\310\n8\206^ \nA@:\203[ \nA@@\202^ \nA@)\314=\203h \312!\207\307 !\310\n8\206\203 \nA@:\203\200 \nA@@\202\203 \nA@)\207\307 !\211@)\315\316!A@\317!\203\243 \316!A@\202\260 \307 !\320\n8)A\321!\245\211 Y\203\275 \312!\202\300 \322!+\207" [start-window event position end-w end-w-top w-top event-start event-end 5 vertical-line strokes-event-closest-point-1 posn-col-row mode-line nil window-edges windowp 2 frame-char-height window-start] 6 (#$ . 7633)]) #@44 Return non-nil if OBJECT is a stroke-lift. (defalias 'strokes-lift-p #[(object) " =\207" [object strokes-lift] 2 (#$ . 8486)]) #@34 Undo the last stroke definition. (defalias 'strokes-unset-last-stroke #[nil "\211@A)\303\304\305\n\"!\203 A\306\307!\202 \306\310!)\207" [strokes-global-map x command y-or-n-p format "Really delete last stroke definition, defined to `%s'? " message "That stroke has been deleted" "Nothing done"] 5 (#$ . 8620) nil]) #@358 Interactively give STROKE the global binding as COMMAND. Operated just like `global-set-key', except for strokes. COMMAND is a symbol naming an interactively-callable function. STROKE is a list of sampled positions on the stroke grid as described in the documentation for the `strokes-define-stroke' function. See also `strokes-global-set-stroke-string'. (defalias 'strokes-global-set-stroke #[(stroke command) "\211G\306W)\203 \307\310!\207 B\n\311\312\f\"\211\203( \313 \"\202 )*B\211\207" [stroke command strokes-global-map list key elt 2 error "That's a click, not a stroke" nil assoc delete] 5 (#$ . 8950) (list (and (or strokes-mode (strokes-mode t)) (strokes-read-complex-stroke "Draw with mouse button 1 (or 2). End with button 3...")) (read-command "Command to map stroke to: "))]) #@336 Interactively give STROKE the global binding as STRING. Operated just like `global-set-key', except for strokes. STRING is a string to be inserted by the stroke. STROKE is a list of sampled positions on the stroke grid as described in the documentation for the `strokes-define-stroke' function. Compare `strokes-global-set-stroke'. (defalias 'strokes-global-set-stroke-string #[(stroke string) "\211G\306W)\203 \307\310!\207 B\n\311\312\f\"\211\203( \313 \"\202 )*B\211\207" [stroke string strokes-global-map list key elt 2 error "That's a click, not a stroke" nil assoc delete] 5 (#$ . 9766) (list (and (or strokes-mode (strokes-mode t)) (strokes-read-complex-stroke "Draw with mouse button 1 (or 2). End with button 3...")) (read-string "String to map stroke to: "))]) #@345 Map POSITION to a new grid position. Do so based on its STROKE-EXTENT and GRID-RESOLUTION. STROKE-EXTENT as a list ((XMIN . YMIN) (XMAX . YMAX)). If POSITION is a `strokes-lift', then it is itself returned. Optional GRID-RESOLUTION may be used in place of `strokes-grid-resolution'. The grid is a square whose dimension is [0,GRID-RESOLUTION). (defalias 'strokes-get-grid-position #[(stroke-extent position &optional grid-resolution) ":\203Y \206\n \n@A\211@@)\211@A)\211A@)@T\211A@)AT \n\f\306 \307\fZ! Z\245_!\306 \307\f\nZ! \nZ\245_!.B\207\310!\205a \207" [position grid-resolution strokes-grid-resolution stroke-extent x ymax floor float strokes-lift-p xmax ymin xmin y strokes-lift] 8 (#$ . 10563)]) #@132 From a list of absolute PIXEL-POSITIONS, return absolute spatial extent. The return value is a list ((XMIN . YMIN) (XMAX . YMAX)). (defalias 'strokes-get-stroke-extent #[(pixel-positions) "\205\264 \211@@)\211@@)\211@A)\211@A)A\n\203k \n@:\203d \n\211@@)\n\211@A)\211W\203G V\203O \fW\203Y V\203c *\nA\211\204( Z\fZ \211\n V\203\224 \f\n Z\306\245Z\n Z\306\245\\\202\252 \nZ\306\245Z \nZ\306\245\\\fB .BD\207" [pixel-positions x rest ymax ymin xmax 2 xmin y delta-y delta-x] 6 (#$ . 11307)]) #@54 Return a list with no consecutive redundant entries. (defalias 'strokes-eliminate-consecutive-redundancies #[(entries) "\304 :\203! @ \211A@)\232\204 @\nB A\211\202 \n\237*\207" [entries element #1=#:--cl-var-- x nil] 3 (#$ . 11876)]) #@264 Map POSITIONS to a new grid whose dimensions are based on GRID-RESOLUTION. POSITIONS is a list of positions and stroke-lifts. Optional GRID-RESOLUTION may be used in place of `strokes-grid-resolution'. The grid is a square whose dimension is [0,GRID-RESOLUTION). (defalias 'strokes-renormalize-to-grid #[(positions &optional grid-resolution) "\204 \304\n!\305\306\n\")\207" [grid-resolution strokes-grid-resolution positions stroke-extent strokes-get-stroke-extent mapcar #[(pos) "\303 \n#\207" [stroke-extent pos grid-resolution strokes-get-grid-position] 4]] 3 (#$ . 12128)]) #@205 Fill in missing grid locations in the list of UNFILLED-STROKE. If FORCE is non-nil, then fill the stroke even if it's `stroke-click'. NOTE: This is where the global variable `strokes-last-stroke' is set. (defalias 'strokes-fill-stroke #[(unfilled-stroke &optional force) "\211G\306W)\203 \n\204 \202k\307:\203h@\211: \211A@)\211: \2056 \205? @ \205H A\205R @\205\\ A\205h Z\205t Z\205\212 \310!?\205\212 \311!\245\204\226 C\202[\204\374 \312Y\203\317 \307W\203\310 BBT\211\202\257 \237+\202[\307V\203\365 BBS\211\202\334 \237+\202[\310!\203d\312Y\2037\307W\2030BBT\211\202\237+\202[ \307! V\203]B!B!S\211\202D!\237+\202[\313!\313!Y\203\347\312V\203\257\"\307#\"W\203\250\314Z_!\\B#B#T\211\202\204#\237+\202[$\307%$V\203\340\314Z_!\\B%B%S\211\202\274%\237+\202[\312V\203&&\307'&W\203\314Z\245!\\B'B'T\211\202\373'\237+\202[(\307)(V\203W\314Z\245!\\B)B)S\211\2023)\237+.\f\237\f\244A\211\202 \f\237*\211*\207" [unfilled-stroke stroke force grid-locs #1=#:--cl-var-- current 2 nil zerop float 0 abs round current-is-a-point-p x next next-is-a-point-p both-are-points-p x1 y1 x2 y2 delta-x delta-y slope y #2=#:--cl-var-- #3=#:--cl-var-- #4=#:--cl-var-- #5=#:--cl-var-- #6=#:--cl-var-- #7=#:--cl-var-- #8=#:--cl-var-- #9=#:--cl-var-- #10=#:--cl-var-- #11=#:--cl-var-- #12=#:--cl-var-- #13=#:--cl-var-- #14=#:--cl-var-- #15=#:--cl-var-- #16=#:--cl-var-- #17=#:--cl-var-- strokes-last-stroke] 7 (#$ . 12719)]) #@265 Rates STROKE1 with STROKE2 and return a score based on a distance metric. Note: the rating is an error rating, and therefore, a return of 0 represents a perfect match. Also note that the order of stroke arguments is order-independent for the algorithm used here. (defalias 'strokes-rate-stroke #[(stroke1 stroke2) "\205\355 \205\355A A@ @\211@A\n@\nA Z\211\n\211_)\fZ\211\n\211_)\\.\f \203G\f\203G @:\203\230 \f@:\203\230 @\f@\211@A\n@\nA Z\211\n\211_)\fZ\211\n\211_)\\.\\ \fA A\f\202G \306 @!\203\265 \306\f@!\203\265 A \fA\f\202= \306\f@!\203\376 @:\203= @ @\211@A\n@\nA Z\211\n\211_)\fZ\211\n\211_)\\.\\ A\211 \202\277 \306 @!\203= \f@:\203= @\f@\211@A\n@\nA Z\211\n\211_)\fZ\211\n\211_)\\.\\\fA\211\f\202\f\204\215 @:\203\215 @ @\211@A\n@\nA Z\211\n\211_)\fZ\211\n\211_)\\.\\ A\211 \202N \204\323\f@:\203\323@\f@\211@A\n@\nA Z\211\n\211_)\fZ\211\n\211_)\\.\\\fA\211\f\202\224\306 @!\204\343\306\f@!\203\352\307\211\202\354+\207" [stroke1 stroke2 p2 p1 y2 x2 strokes-lift-p nil y1 x1 x err rest2 rest1] 7 (#$ . 14472)]) #@111 Find the best matching command of STROKE in STROKE-MAP. Returns the corresponding match as (COMMAND . SCORE). (defalias 'strokes-match-stroke #[(stroke stroke-map) "\205\\ \205\\ \306 \211@@)\" \211@A) A\203T \306\211@@)\"\211\203: \203: W\204C \203M \204M \211@A)A)\202 \205[ \f B+\207" [stroke stroke-map x map command score strokes-rate-stroke newscore] 4 (#$ . 15694)]) #@71 Erase the contents of the current buffer and fill it with whitespace. (defalias 'strokes-fill-current-buffer-with-whitespace #[nil "\301 \210\302 S\211\303Y\203 \304\305\306 S\"\210\307 \210\202 )eb\207" [#1=#:--cl-var-- erase-buffer frame-height 0 insert-char 32 frame-width newline] 3 (#$ . 16105)]) (put 'strokes-fill-current-buffer-with-whitespace 'byte-optimizer 'byte-compile-inline-expand) #@354 Read a simple stroke (interactively) and return the stroke. Optional PROMPT in minibuffer displays before and during stroke reading. This function will display the stroke interactively as it is being entered in the strokes buffer if the variable `strokes-use-strokes-buffer' is non-nil. Optional EVENT is acceptable as the starting event of the stroke. (defalias 'strokes-read-stroke #[(&optional prompt event) "\212\306\211\211\203\216 \307 \310\216\311 !\210\312\313\314 \315 Z!V\204C \316 \210\317 %%S\211%\320Y\203? \321\322\323 S\"\210\324 \210\202'