Browse Source

* widget.c: Make more functions static.

Pavel Roskin 22 years ago
parent
commit
2f9416892a
3 changed files with 33 additions and 32 deletions
  1. 2 0
      src/ChangeLog
  2. 31 30
      src/widget.c
  3. 0 2
      src/widget.h

+ 2 - 0
src/ChangeLog

@@ -1,5 +1,7 @@
 2002-08-21  Pavel Roskin  <proski@gnu.org>
 2002-08-21  Pavel Roskin  <proski@gnu.org>
 
 
+	* widget.c: Make more functions static.
+
 	* ext.c: (regex_check_type): Further split.  Restore caching
 	* ext.c: (regex_check_type): Further split.  Restore caching
 	broken in the previous commit.
 	broken in the previous commit.
 
 

+ 31 - 30
src/widget.c

@@ -796,7 +796,8 @@ winput_set_origin (WInput *in, int x, int field_len)
 
 
 int num_history_items_recorded = 60;
 int num_history_items_recorded = 60;
 
 
-Hist *history_get (char *input_name)
+Hist *
+history_get (char *input_name)
 {
 {
     int i;
     int i;
     Hist *old, *new;
     Hist *old, *new;
@@ -829,7 +830,8 @@ Hist *history_get (char *input_name)
     return new;			/* return pointer to last entry in list */
     return new;			/* return pointer to last entry in list */
 }
 }
 
 
-void history_put (char *input_name, Hist *h)
+void
+history_put (char *input_name, Hist *h)
 {
 {
     int i;
     int i;
     char *profile;
     char *profile;
@@ -914,7 +916,8 @@ history_callback (Dlg_head * h, int Par, int Msg)
 
 
 static inline int listbox_fwd (WListbox *l);
 static inline int listbox_fwd (WListbox *l);
 
 
-char *show_hist (Hist *history, int widget_x, int widget_y)
+char *
+show_hist (Hist *history, int widget_x, int widget_y)
 {
 {
     Hist *hi, *z;
     Hist *hi, *z;
     size_t maxlen = strlen (i18n_htitle()), i, count = 0;
     size_t maxlen = strlen (i18n_htitle()), i, count = 0;
@@ -1533,8 +1536,6 @@ input_set_point (WInput *in, int pos)
     update_input (in, 1);
     update_input (in, 1);
 }
 }
 
 
-int input_event (Gpm_Event *event, WInput *b);
-
 static int
 static int
 input_callback (Dlg_head *h, WInput *in, int Msg, int Par)
 input_callback (Dlg_head *h, WInput *in, int Msg, int Par)
 {
 {
@@ -1575,15 +1576,14 @@ input_callback (Dlg_head *h, WInput *in, int Msg, int Par)
     return default_proc (h, Msg, Par);
     return default_proc (h, Msg, Par);
 }
 }
 
 
-/* Not declared static, since we check against this value in dlg.c */
-/* FIXME: Declare static again and provide an identification mechanism */
-int 
-input_event (Gpm_Event *event, WInput *in) 
-{ 
-    if (event->type & (GPM_DOWN|GPM_DRAG)){ 
-	dlg_select_widget (in->widget.parent, in); 
+static int
+input_event (Gpm_Event * event, WInput * in)
+{
+    if (event->type & (GPM_DOWN | GPM_DRAG)) {
+	dlg_select_widget (in->widget.parent, in);
 
 
-	if (event->x >= in->field_len - HISTORY_BUTTON_WIDTH + 1 && should_show_history_button (in)) {
+	if (event->x >= in->field_len - HISTORY_BUTTON_WIDTH + 1
+	    && should_show_history_button (in)) {
 	    do_show_hist (in);
 	    do_show_hist (in);
 	} else {
 	} else {
 	    in->point = strlen (in->buffer);
 	    in->point = strlen (in->buffer);
@@ -1593,9 +1593,9 @@ input_event (Gpm_Event *event, WInput *in)
 		in->point = 0;
 		in->point = 0;
 	}
 	}
 	update_input (in, 1);
 	update_input (in, 1);
-    } 
-    return MOU_NORMAL; 
-} 
+    }
+    return MOU_NORMAL;
+}
 
 
 WInput *
 WInput *
 input_new (int y, int x, int color, int len, const char *def_text, char *tkname)
 input_new (int y, int x, int color, int len, const char *def_text, char *tkname)
@@ -2300,26 +2300,26 @@ buttonbar_new (int visible)
     return bb;
     return bb;
 }
 }
 
 
-void
-set_label_text (WButtonBar *bb, int index, char *text)
+static void
+set_label_text (WButtonBar * bb, int index, char *text)
 {
 {
-    if (bb->labels [index-1].text)
-	g_free (bb->labels [index-1].text);
+    if (bb->labels[index - 1].text)
+	g_free (bb->labels[index - 1].text);
 
 
-    bb->labels [index-1].text = g_strdup (text);
+    bb->labels[index - 1].text = g_strdup (text);
 }
 }
 
 
 /* paneletc is either the panel widget, or info or view or tree widget */
 /* paneletc is either the panel widget, or info or view or tree widget */
-WButtonBar *
-find_buttonbar (Dlg_head *h, Widget *paneletc)
+static WButtonBar *
+find_buttonbar (Dlg_head * h, Widget * paneletc)
 {
 {
     WButtonBar *bb;
     WButtonBar *bb;
     Widget_Item *item;
     Widget_Item *item;
     int i;
     int i;
 
 
     bb = 0;
     bb = 0;
-    for (i = 0, item = h->current; i < h->count; i++, item = item->next){
-	if (item->widget->callback == (callback_fn) buttonbar_callback){
+    for (i = 0, item = h->current; i < h->count; i++, item = item->next) {
+	if (item->widget->callback == (callback_fn) buttonbar_callback) {
 	    bb = (WButtonBar *) item->widget;
 	    bb = (WButtonBar *) item->widget;
 	    break;
 	    break;
 	}
 	}
@@ -2328,20 +2328,21 @@ find_buttonbar (Dlg_head *h, Widget *paneletc)
 }
 }
 
 
 void
 void
-define_label_data (Dlg_head *h, Widget *paneletc, int idx, char *text,
+define_label_data (Dlg_head * h, Widget * paneletc, int idx, char *text,
 		   buttonbarfn cback, void *data)
 		   buttonbarfn cback, void *data)
 {
 {
     WButtonBar *bb = find_buttonbar (h, paneletc);
     WButtonBar *bb = find_buttonbar (h, paneletc);
     if (!bb)
     if (!bb)
 	return;
 	return;
-    
+
     set_label_text (bb, idx, text);
     set_label_text (bb, idx, text);
-    bb->labels [idx-1].function = cback;
-    bb->labels [idx-1].data = data;
+    bb->labels[idx - 1].function = cback;
+    bb->labels[idx - 1].data = data;
 }
 }
 
 
 void
 void
-define_label (Dlg_head *h, Widget *paneletc, int idx, char *text, void (*cback)(void))
+define_label (Dlg_head * h, Widget * paneletc, int idx, char *text,
+	      void (*cback) (void))
 {
 {
     define_label_data (h, paneletc, idx, text, (buttonbarfn) cback, 0);
     define_label_data (h, paneletc, idx, text, (buttonbarfn) cback, 0);
 }
 }

+ 0 - 2
src/widget.h

@@ -210,9 +210,7 @@ typedef void (*voidfn)(void);
 void define_label (Dlg_head *, Widget *paneletc, int index, char *text, voidfn);
 void define_label (Dlg_head *, Widget *paneletc, int index, char *text, voidfn);
 void define_label_data (Dlg_head *h, Widget *paneletc, int idx, char *text,
 void define_label_data (Dlg_head *h, Widget *paneletc, int idx, char *text,
 			buttonbarfn cback, void *data);
 			buttonbarfn cback, void *data);
-void set_label_text (WButtonBar *, int, char *);
 void redraw_labels (Dlg_head *h, Widget *paneletc);
 void redraw_labels (Dlg_head *h, Widget *paneletc);
-WButtonBar *find_buttonbar (Dlg_head *h, Widget *paneletc);
 void buttonbar_hint (WButtonBar *bb, char *s);
 void buttonbar_hint (WButtonBar *bb, char *s);
 
 
 #endif	/* __WIDGET_H */
 #endif	/* __WIDGET_H */