X-Git-Url: http://git.hcoop.net/bpt/emacs.git/blobdiff_plain/e468b87f91f26e66a8cde087c1a9c89c67b96d12..3c448ab65e5becf76293444d1f90fea03c146a80:/src/cm.h diff --git a/src/cm.h b/src/cm.h index 7c26a9ce66..77001516c2 100644 --- a/src/cm.h +++ b/src/cm.h @@ -1,13 +1,13 @@ /* Cursor motion calculation definitions for GNU Emacs Copyright (C) 1985, 1989, 2001, 2002, 2003, 2004, - 2005, 2006, 2007 Free Software Foundation, Inc. + 2005, 2006, 2007, 2008 Free Software Foundation, Inc. This file is part of GNU Emacs. -GNU Emacs is free software; you can redistribute it and/or modify +GNU Emacs is free software: you can redistribute it and/or modify it under the terms of the GNU General Public License as published by -the Free Software Foundation; either version 3, or (at your option) -any later version. +the Free Software Foundation, either version 3 of the License, or +(at your option) any later version. GNU Emacs is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of @@ -15,9 +15,7 @@ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. You should have received a copy of the GNU General Public License -along with GNU Emacs; see the file COPYING. If not, write to -the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, -Boston, MA 02110-1301, USA. */ +along with GNU Emacs. If not, see . */ /* Holds the minimum and maximum costs for the parametrized capabilities. */ struct parmcap @@ -99,76 +97,78 @@ struct cm int cc_vabs; }; -extern struct cm Wcm; /* Terminal capabilities */ extern char PC; /* Pad character */ /* Shorthand */ #ifndef NoCMShortHand -#define curY Wcm.cm_curY -#define curX Wcm.cm_curX -#define Up Wcm.cm_up -#define Down Wcm.cm_down -#define Left Wcm.cm_left -#define Right Wcm.cm_right -#define Tab Wcm.cm_tab -#define BackTab Wcm.cm_backtab -#define TabWidth Wcm.cm_tabwidth -#define CR Wcm.cm_cr -#define Home Wcm.cm_home -#define LastLine Wcm.cm_ll -#define AbsPosition Wcm.cm_abs -#define ColPosition Wcm.cm_habs -#define RowPosition Wcm.cm_vabs -#define MultiUp Wcm.cm_multiup -#define MultiDown Wcm.cm_multidown -#define MultiLeft Wcm.cm_multileft -#define MultiRight Wcm.cm_multiright -#define AutoWrap Wcm.cm_autowrap -#define MagicWrap Wcm.cm_magicwrap -#define UseTabs Wcm.cm_usetabs -#define FrameRows Wcm.cm_rows -#define FrameCols Wcm.cm_cols - -#define UpCost Wcm.cc_up -#define DownCost Wcm.cc_down -#define LeftCost Wcm.cc_left -#define RightCost Wcm.cc_right -#define HomeCost Wcm.cc_home -#define CRCost Wcm.cc_cr -#define LastLineCost Wcm.cc_ll -#define TabCost Wcm.cc_tab -#define BackTabCost Wcm.cc_backtab -#define AbsPositionCost Wcm.cc_abs -#define ColPositionCost Wcm.cc_habs -#define RowPositionCost Wcm.cc_vabs -#define MultiUpCost Wcm.cc_multiup -#define MultiDownCost Wcm.cc_multidown -#define MultiLeftCost Wcm.cc_multileft -#define MultiRightCost Wcm.cc_multiright +#define curY(tty) (tty)->Wcm->cm_curY +#define curX(tty) (tty)->Wcm->cm_curX +#define Up(tty) (tty)->Wcm->cm_up +#define Down(tty) (tty)->Wcm->cm_down +#define Left(tty) (tty)->Wcm->cm_left +#define Right(tty) (tty)->Wcm->cm_right +#define Tab(tty) (tty)->Wcm->cm_tab +#define BackTab(tty) (tty)->Wcm->cm_backtab +#define TabWidth(tty) (tty)->Wcm->cm_tabwidth +#define CR(tty) (tty)->Wcm->cm_cr +#define Home(tty) (tty)->Wcm->cm_home +#define LastLine(tty) (tty)->Wcm->cm_ll +#define AbsPosition(tty) (tty)->Wcm->cm_abs +#define ColPosition(tty) (tty)->Wcm->cm_habs +#define RowPosition(tty) (tty)->Wcm->cm_vabs +#define MultiUp(tty) (tty)->Wcm->cm_multiup +#define MultiDown(tty) (tty)->Wcm->cm_multidown +#define MultiLeft(tty) (tty)->Wcm->cm_multileft +#define MultiRight(tty) (tty)->Wcm->cm_multiright +#define AutoWrap(tty) (tty)->Wcm->cm_autowrap +#define MagicWrap(tty) (tty)->Wcm->cm_magicwrap +#define UseTabs(tty) (tty)->Wcm->cm_usetabs +#define FrameRows(tty) (tty)->Wcm->cm_rows +#define FrameCols(tty) (tty)->Wcm->cm_cols + +#define UpCost(tty) (tty)->Wcm->cc_up +#define DownCost(tty) (tty)->Wcm->cc_down +#define LeftCost(tty) (tty)->Wcm->cc_left +#define RightCost(tty) (tty)->Wcm->cc_right +#define HomeCost(tty) (tty)->Wcm->cc_home +#define CRCost(tty) (tty)->Wcm->cc_cr +#define LastLineCost(tty) (tty)->Wcm->cc_ll +#define TabCost(tty) (tty)->Wcm->cc_tab +#define BackTabCost(tty) (tty)->Wcm->cc_backtab +#define AbsPositionCost(tty) (tty)->Wcm->cc_abs +#define ColPositionCost(tty) (tty)->Wcm->cc_habs +#define RowPositionCost(tty) (tty)->Wcm->cc_vabs +#define MultiUpCost(tty) (tty)->Wcm->cc_multiup +#define MultiDownCost(tty) (tty)->Wcm->cc_multidown +#define MultiLeftCost(tty) (tty)->Wcm->cc_multileft +#define MultiRightCost(tty) (tty)->Wcm->cc_multiright #endif -#define cmat(row,col) (curY = (row), curX = (col)) -#define cmplus(n) \ - { \ - if ((curX += (n)) >= FrameCols && !MagicWrap) \ - { \ - if (Wcm.cm_losewrap) losecursor (); \ - else if (AutoWrap) curX = 0, curY++; \ - else curX--; \ - } \ +#define cmat(tty,row,col) (curY(tty) = (row), curX(tty) = (col)) +#define cmplus(tty,n) \ + { \ + if ((curX (tty) += (n)) >= FrameCols (tty) && !MagicWrap (tty)) \ + { \ + if ((tty)->Wcm->cm_losewrap) losecursor (tty); \ + else if (AutoWrap (tty)) curX (tty) = 0, curY (tty)++; \ + else curX (tty)--; \ + } \ } -#define losecursor() (curX = -1, curY = -1) +#define losecursor(tty) (curX(tty) = -1, curY(tty) = -1) extern int cost; extern int evalcost (); -extern void cmcheckmagic (); -extern int cmputc (); -extern void cmcostinit (); -extern void cmgoto (); -extern void Wcm_clear (); -extern int Wcm_init (); +#define emacs_tputs(tty, str, affcnt, putc) (current_tty = (tty), tputs (str, affcnt, putc)) + +extern struct tty_display_info *current_tty; +extern void cmcheckmagic P_ ((struct tty_display_info *)); +extern int cmputc P_ ((int)); +extern void cmcostinit P_ ((struct tty_display_info *)); +extern void cmgoto P_ ((struct tty_display_info *, int, int)); +extern void Wcm_clear P_ ((struct tty_display_info *)); +extern int Wcm_init P_ ((struct tty_display_info *)); /* arch-tag: acc1535a-7136-49d6-b22d-9bc85702251b (do not change this comment) */