]> code.delx.au - gnu-emacs/blobdiff - src/sunfns.c
(ad-make-single-advice-docstring): Treat case with no doctring specially.
[gnu-emacs] / src / sunfns.c
index c96fbf47275d0c045c97f8e39a9efc4643b43ee0..efc4e970119325478e3ac1450de0afe0800fddd0 100644 (file)
@@ -1,23 +1,34 @@
 /* Functions for Sun Windows menus and selection buffer.
    Copyright (C) 1987 Free Software Foundation, Inc.
 
+This file is probably totally obsolete.  In any case, the FSF is
+unwilling to support it.  We agreed to include it in our distribution
+only on the understanding that we would spend no time at all on it.
+
+If you have complaints about this file, send them to peck@sun.com.
+If no one at Sun wants to maintain this, then consider it not
+maintained at all.  It would be a bad thing for the GNU project if
+this file took our effort away from higher-priority things.
+
+
 This file is part of GNU Emacs.
 
+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 2, or (at your option)
+any later version.
+
 GNU Emacs is distributed in the hope that it will be useful,
-but without any warranty.  No author or distributor
-accepts responsibility to anyone for the consequences of using it
-or for whether it serves any particular purpose or works at all,
-unless he says so in writing.
-
-Everyone is granted permission to copy, modify and redistribute
-GNU Emacs, but only under the conditions described in the
-document "GNU Emacs copying permission notice".   An exact copy
-of the document is supposed to have been given to you along with
-GNU Emacs so that you can know how you may redistribute it all.
-It should be in a file named COPYING.  Among other things, the
-copyright notice and this notice must be preserved on all copies.
-
-Author: Jeff Peck, Sun Microsystems, Inc. <peck@sun.com>
+but WITHOUT ANY WARRANTY; without even the implied warranty of
+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., 59 Temple Place - Suite 330,
+Boston, MA 02111-1307, USA.  */
+
+/* Author: Jeff Peck, Sun Microsystems, Inc. <peck@sun.com>
 Original ideas by David Kastan and Eric Negaard, SRI International
 Major help from: Steve Greenbaum, Reasoning Systems, Inc.
                    <froud@kestrel.arpa>
@@ -27,7 +38,7 @@ who first discovered the Menu_Base_Kludge.
 /*
  *     Emacs Lisp-Callable functions for sunwindows
  */
-#include "config.h"
+#include <config.h>
 
 #include <stdio.h>
 #include <errno.h>
@@ -46,14 +57,14 @@ who first discovered the Menu_Base_Kludge.
 #include "buffer.h"
 #include "termhooks.h"
 
-/* conversion to/from character & screen coordinates */
+/* conversion to/from character & frame coordinates */
 /* From Gosling Emacs SunWindow driver by Chris Torek */
 
-/* Chars to screen coords.  Note that we speak in zero origin. */
+/* Chars to frame coords.  Note that we speak in zero origin. */
 #define CtoSX(cx) ((cx) * Sun_Font_Xsize)
 #define CtoSY(cy) ((cy) * Sun_Font_Ysize)
 
-/* Screen coords to chars */
+/* Frame coords to chars */
 #define StoCX(sx) ((sx) / Sun_Font_Xsize)
 #define StoCY(sy) ((sy) / Sun_Font_Ysize)
 
@@ -85,7 +96,7 @@ static mpr_static(ArrowCursorMpr, 16, 16, 1, ArrowCursorData);
 struct cursor DefaultCursor = {15, 0, PIX_SRC ^ PIX_DST, &ArrowCursorMpr};
 
 #else
-/* The default left-arror cursor, with XOR drawing. */
+/* The default left-arrow cursor, with XOR drawing. */
 static short ArrowCursorData[16] = {
        0x8000,0xC000,0xE000,0xF000,0xF800,0xFC00,0xFE00,0xF000,
        0xD800,0x9800,0x0C00,0x0C00,0x0600,0x0600,0x0300,0x0300};
@@ -107,7 +118,7 @@ or -1 if can not open it.")
   char *cp;
   static int already_initialized = 0;
 
-  if ((! already_initialized) || (!NULL(force))) {
+  if ((! already_initialized) || (!NILP(force))) {
     cp = getenv("WINDOW_GFX");
     if (cp != 0) win_fd = open(cp, 2);
     if (win_fd > 0)
@@ -153,7 +164,7 @@ Redisplay does not happen if input is available before it starts.")
   Timeout.tv_usec = (XINT(n) - (Timeout.tv_sec * 1000)) * 1000;
 
   if (detect_input_pending()) return(Qnil);
-  DoDsp(1);
+  redisplay_preserve_echo_area ();
   /*
    *   Check for queued keyboard input/mouse hits again
    *   (A bit screen update can take some time!)
@@ -186,7 +197,7 @@ DEFUN ("update-display", Fupdate_display, Supdate_display, 0, 0, 0,
        "Perform redisplay.")
      ()
 {
-  DoDsp(1);
+  redisplay_preserve_echo_area ();
   return(Qt);
 }
 
@@ -213,7 +224,7 @@ expressed as a string.  If ICON is nil then the original arrow cursor is used")
   /*
    *   If the icon is null, we just restore the DefaultCursor
    */
-  if (NULL(Icon)) 
+  if (NILP(Icon)) 
     CurrentCursor = DefaultCursor;
   else {
     /*
@@ -291,7 +302,7 @@ sel_read (sel, file)
     return(-1);
   }
   /*
-   * The shelltool select saves newlines as carrige returns,
+   * The shelltool select saves newlines as carriage returns,
    * but emacs wants newlines.
    */
   for (i = 0; i < n; i++) 
@@ -354,9 +365,9 @@ sun_item_create (Pair)
   String = Fcar(Pair);
   CHECK_STRING(String, 0);
   Value = Fcdr(Pair);
-  if(XTYPE(Value) == Lisp_Symbol)
+  if (SYMBOLP (Value))
     Value = XSYMBOL(Value)->value;
-  if(XTYPE(Value) == Lisp_Vector) {
+  if (VECTORP (Value)) {
     submenu = sun_menu_create (Value);
     menu_item = menu_create_item
       (MENU_RELEASE, MENU_PULLRIGHT_ITEM, XSTRING(String)->data, submenu, 0);
@@ -436,13 +447,13 @@ as a menu label.")
   
   CHECK_NUMBER(X_Position, 0);
   CHECK_NUMBER(Y_Position, 1);
-  CHECK_WINDOW(window, 2);
+  CHECK_LIVE_WINDOW(window, 2);
   CHECK_NUMBER(Button, 3);
   CHECK_VECTOR(MEnu, 4);
 
   CHECK_GFX (Qnil);
 
-  xpos = CtoSX (XWINDOW(window)->left + XINT(X_Position));
+  xpos = CtoSX (WINDOW_LEFT_MARGIN (XWINDOW (window)) + XINT(X_Position));
   ypos = CtoSY (XWINDOW(window)->top  + XINT(Y_Position));
 #ifdef  Menu_Base_Kludge
   {static Lisp_Object symbol[2];
@@ -487,7 +498,7 @@ syms_of_sunfns()
 #ifdef  Menu_Base_Kludge
   /* i'm just too lazy to re-write this into C code */
   /* so we will call this elisp function from C */
-  sm_kludge_string = make_pure_string ("sm::menu-kludge", 15);
+  sm_kludge_string = make_pure_string ("sm::menu-kludge", 15, 15, 0);
 #endif /* Menu_Base_Kludge */
 
   defsubr(&Ssun_window_init);