]> code.delx.au - gnu-emacs/blobdiff - src/widget.c
Clarify the `call-interactively' doc string, and add an example.
[gnu-emacs] / src / widget.c
index 74d13aecf5a2e6eac7043ab9d7394cade841f6ca..6d871ad7cb27a159a7b22bc67d54769095c672d1 100644 (file)
@@ -1,6 +1,5 @@
 /* The emacs frame widget.
-   Copyright (C) 1992, 1993, 2000, 2001, 2002, 2003, 2004,
-                 2005, 2006, 2007, 2008, 2009, 2010, 2011  Free Software Foundation, Inc.
+   Copyright (C) 1992-1993, 2000-2011  Free Software Foundation, Inc.
 
 This file is part of GNU Emacs.
 
@@ -76,14 +75,12 @@ along with GNU Emacs.  If not, see <http://www.gnu.org/licenses/>.  */
 #define DEFAULT_FACE_FONT "-*-courier-medium-r-*-*-*-120-*-*-*-*-iso8859-*"
 
 
-static void EmacsFrameInitialize (/*Widget, Widget, ArgList, Cardinal * */);
-static void EmacsFrameDestroy (/* Widget */);
-static void EmacsFrameRealize (/* Widget, XtValueMask*, XSetWindowAttributes* */);
-void EmacsFrameResize (/* Widget widget */);
-static Boolean EmacsFrameSetValues (/* Widget, Widget, Widget,
-                                    ArgList, Cardinal * */);
-static XtGeometryResult EmacsFrameQueryGeometry (/* Widget, XtWidgetGeometry*,
-                                                 XtWidgetGeometry* */);
+static void EmacsFrameInitialize (Widget request, Widget new, ArgList dum1, Cardinal *dum2);
+static void EmacsFrameDestroy (Widget widget);
+static void EmacsFrameRealize (Widget widget, XtValueMask *mask, XSetWindowAttributes *attrs);
+static void EmacsFrameResize (Widget widget);
+static Boolean EmacsFrameSetValues (Widget cur_widget, Widget req_widget, Widget new_widget, ArgList dum1, Cardinal *dum2);
+static XtGeometryResult EmacsFrameQueryGeometry (Widget widget, XtWidgetGeometry *request, XtWidgetGeometry *result);
 
 
 #undef XtOffset
@@ -140,7 +137,7 @@ emacsFrameTranslations [] = "\
 ";
 */
 
-EmacsFrameClassRec emacsFrameClassRec = {
+static EmacsFrameClassRec emacsFrameClassRec = {
     { /* core fields */
     /* superclass              */      &widgetClassRec,
     /* class_name              */      "EmacsFrame",
@@ -180,10 +177,7 @@ EmacsFrameClassRec emacsFrameClassRec = {
 WidgetClass emacsFrameClass = (WidgetClass) &emacsFrameClassRec;
 
 static void
-get_default_char_pixel_size (ew, pixel_width, pixel_height)
-     EmacsFrame ew;
-     int* pixel_width;
-     int* pixel_height;
+get_default_char_pixel_size (EmacsFrame ew, int *pixel_width, int *pixel_height)
 {
   struct frame* f = ew->emacs_frame.frame;
   *pixel_width = FRAME_COLUMN_WIDTH (f);
@@ -191,12 +185,7 @@ get_default_char_pixel_size (ew, pixel_width, pixel_height)
 }
 
 static void
-pixel_to_char_size (ew, pixel_width, pixel_height, char_width, char_height)
-     EmacsFrame ew;
-     Dimension pixel_width;
-     Dimension pixel_height;
-     int* char_width;
-     int* char_height;
+pixel_to_char_size (EmacsFrame ew, Dimension pixel_width, Dimension pixel_height, int *char_width, int *char_height)
 {
   struct frame* f = ew->emacs_frame.frame;
   *char_width = FRAME_PIXEL_WIDTH_TO_TEXT_COLS (f, (int) pixel_width);
@@ -204,12 +193,7 @@ pixel_to_char_size (ew, pixel_width, pixel_height, char_width, char_height)
 }
 
 static void
-char_to_pixel_size (ew, char_width, char_height, pixel_width, pixel_height)
-     EmacsFrame ew;
-     int char_width;
-     int char_height;
-     Dimension* pixel_width;
-     Dimension* pixel_height;
+char_to_pixel_size (EmacsFrame ew, int char_width, int char_height, Dimension *pixel_width, Dimension *pixel_height)
 {
   struct frame* f = ew->emacs_frame.frame;
   *pixel_width = FRAME_TEXT_COLS_TO_PIXEL_WIDTH (f, char_width);
@@ -217,12 +201,7 @@ char_to_pixel_size (ew, char_width, char_height, pixel_width, pixel_height)
 }
 
 static void
-round_size_to_char (ew, in_width, in_height, out_width, out_height)
-     EmacsFrame ew;
-     Dimension in_width;
-     Dimension in_height;
-     Dimension* out_width;
-     Dimension* out_height;
+round_size_to_char (EmacsFrame ew, Dimension in_width, Dimension in_height, Dimension *out_width, Dimension *out_height)
 {
   int char_width;
   int char_height;
@@ -231,8 +210,7 @@ round_size_to_char (ew, in_width, in_height, out_width, out_height)
 }
 
 static Widget
-get_wm_shell (w)
-     Widget w;
+get_wm_shell (Widget w)
 {
   Widget wmshell;
 
@@ -269,8 +247,7 @@ static Boolean first_frame_p = True;
 #endif
 
 static void
-set_frame_size (ew)
-     EmacsFrame ew;
+set_frame_size (EmacsFrame ew)
 {
   /* The widget hierarchy is
 
@@ -486,13 +463,8 @@ set_frame_size (ew)
   }
 }
 
-/* Nonzero tells update_wm_hints not to do anything
-   (the caller should call update_wm_hints explicitly later.)  */
-int update_hints_inhibit;
-
 static void
-update_wm_hints (ew)
-     EmacsFrame ew;
+update_wm_hints (EmacsFrame ew)
 {
   Widget wmshell = get_wm_shell ((Widget)ew);
   int cw;
@@ -505,9 +477,6 @@ update_wm_hints (ew)
   int base_height;
   int min_rows = 0, min_cols = 0;
 
-  if (update_hints_inhibit)
-    return;
-
 #if 0
   check_frame_size (ew->emacs_frame.frame, &min_rows, &min_cols);
 #endif
@@ -547,14 +516,11 @@ create_frame_gcs (ew)
   struct frame *s = ew->emacs_frame.frame;
 
   s->output_data.x->normal_gc
-    = XCreateGC (XtDisplay (ew), RootWindowOfScreen (XtScreen (ew)),
-                (unsigned long)0, (XGCValues *)0);
+    = XCreateGC (XtDisplay (ew), RootWindowOfScreen (XtScreen (ew)), 0, 0);
   s->output_data.x->reverse_gc
-    = XCreateGC (XtDisplay (ew), RootWindowOfScreen (XtScreen (ew)),
-                (unsigned long)0, (XGCValues *)0);
+    = XCreateGC (XtDisplay (ew), RootWindowOfScreen (XtScreen (ew)), 0, 0);
   s->output_data.x->cursor_gc
-    = XCreateGC (XtDisplay (ew), RootWindowOfScreen (XtScreen (ew)),
-                (unsigned long)0, (XGCValues *)0);
+    = XCreateGC (XtDisplay (ew), RootWindowOfScreen (XtScreen (ew)), 0, 0);
   s->output_data.x->black_relief.gc = 0;
   s->output_data.x->white_relief.gc = 0;
 }
@@ -570,8 +536,7 @@ static char setup_frame_cursor_bits[] =
 };
 
 static void
-setup_frame_gcs (ew)
-     EmacsFrame ew;
+setup_frame_gcs (EmacsFrame ew)
 {
   XGCValues gc_values;
   struct frame* s = ew->emacs_frame.frame;
@@ -585,7 +550,7 @@ setup_frame_gcs (ew)
   if (STRINGP (font))
     {
       XFontStruct *xfont = XLoadQueryFont (FRAME_X_DISPLAY_INFO (s)->display,
-                                          SDATA (font));
+                                          SSDATA (font));
       if (xfont)
        {
          gc_values.font = xfont->fid;
@@ -614,8 +579,7 @@ setup_frame_gcs (ew)
     = XCreatePixmapFromBitmapData (XtDisplay(ew),
                                   RootWindowOfScreen (XtScreen (ew)),
                                   setup_frame_cursor_bits, 2, 2,
-                                  (unsigned long)0, (unsigned long)1,
-                                  ew->core.depth);
+                                  0, 1, ew->core.depth);
 
   /* Normal video */
   gc_values.foreground = ew->emacs_frame.foreground_pixel;
@@ -649,8 +613,7 @@ setup_frame_gcs (ew)
 }
 
 static void
-update_various_frame_slots (ew)
-     EmacsFrame ew;
+update_various_frame_slots (EmacsFrame ew)
 {
   struct frame *f = ew->emacs_frame.frame;
   struct x_output *x = f->output_data.x;
@@ -661,8 +624,7 @@ update_various_frame_slots (ew)
 }
 
 static void
-update_from_various_frame_slots (ew)
-     EmacsFrame ew;
+update_from_various_frame_slots (EmacsFrame ew)
 {
   struct frame *f = ew->emacs_frame.frame;
   struct x_output *x = f->output_data.x;
@@ -677,11 +639,7 @@ update_from_various_frame_slots (ew)
 }
 
 static void
-EmacsFrameInitialize (request, new, dum1, dum2)
-     Widget request;
-     Widget new;
-     ArgList dum1;
-     Cardinal *dum2;
+EmacsFrameInitialize (Widget request, Widget new, ArgList dum1, Cardinal *dum2)
 {
   EmacsFrame ew = (EmacsFrame)new;
 
@@ -698,10 +656,7 @@ EmacsFrameInitialize (request, new, dum1, dum2)
 
 
 static void
-EmacsFrameRealize (widget, mask, attrs)
-     Widget widget;
-     XtValueMask *mask;
-     XSetWindowAttributes *attrs;
+EmacsFrameRealize (Widget widget, XtValueMask *mask, XSetWindowAttributes *attrs)
 {
   EmacsFrame ew = (EmacsFrame)widget;
 
@@ -717,11 +672,10 @@ EmacsFrameRealize (widget, mask, attrs)
   update_wm_hints (ew);
 }
 
-extern void free_frame_faces (/* struct frame * */);
+extern void free_frame_faces (struct frame *);
 
 static void
-EmacsFrameDestroy (widget)
-     Widget widget;
+EmacsFrameDestroy (Widget widget)
 {
   EmacsFrame ew = (EmacsFrame) widget;
   struct frame* s = ew->emacs_frame.frame;
@@ -738,9 +692,8 @@ EmacsFrameDestroy (widget)
   UNBLOCK_INPUT;
 }
 
-void
-EmacsFrameResize (widget)
-     Widget widget;
+static void
+EmacsFrameResize (Widget widget)
 {
   EmacsFrame ew = (EmacsFrame)widget;
   struct frame *f = ew->emacs_frame.frame;
@@ -756,12 +709,7 @@ EmacsFrameResize (widget)
 }
 
 static Boolean
-EmacsFrameSetValues (cur_widget, req_widget, new_widget, dum1, dum2)
-     Widget cur_widget;
-     Widget req_widget;
-     Widget new_widget;
-     ArgList dum1;
-     Cardinal *dum2;
+EmacsFrameSetValues (Widget cur_widget, Widget req_widget, Widget new_widget, ArgList dum1, Cardinal *dum2)
 {
   EmacsFrame cur = (EmacsFrame)cur_widget;
   EmacsFrame new = (EmacsFrame)new_widget;
@@ -834,10 +782,7 @@ EmacsFrameSetValues (cur_widget, req_widget, new_widget, dum1, dum2)
 }
 
 static XtGeometryResult
-EmacsFrameQueryGeometry (widget, request, result)
-     Widget widget;
-     XtWidgetGeometry* request;
-     XtWidgetGeometry* result;
+EmacsFrameQueryGeometry (Widget widget, XtWidgetGeometry *request, XtWidgetGeometry *result)
 {
   EmacsFrame ew = (EmacsFrame)widget;
 
@@ -867,10 +812,7 @@ EmacsFrameQueryGeometry (widget, request, result)
 
 /* Special entrypoints */
 void
-EmacsFrameSetCharSize (widget, columns, rows)
-     Widget widget;
-     int columns;
-     int rows;
+EmacsFrameSetCharSize (Widget widget, int columns, int rows)
 {
   EmacsFrame ew = (EmacsFrame) widget;
   struct frame *f = ew->emacs_frame.frame;
@@ -880,14 +822,10 @@ EmacsFrameSetCharSize (widget, columns, rows)
 
 \f
 void
-widget_store_internal_border (widget)
-     Widget widget;
+widget_store_internal_border (Widget widget)
 {
   EmacsFrame ew = (EmacsFrame) widget;
   FRAME_PTR f = ew->emacs_frame.frame;
 
   ew->emacs_frame.internal_border_width = f->internal_border_width;
 }
-
-/* arch-tag: 931d28e5-0d59-405a-8325-7d475d0a13d9
-   (do not change this comment) */