Widget #include cleanup



Hi,

As wtools.h requires Dlg_head and WListbox defined in widget.h it's much
easier to #include "widget.h" than to redefine them. This makes it
possible to get rid of a load of unnecessary #include's of widget.h and
dialog.h.

Patch is against HEAD. Any reason not to commit it?

Leonard.

-- 
mount -t life -o ro /dev/dna /genetic/research

diff -pruN mc/src/wtools.h mc.include_widget/src/wtools.h
--- mc/src/wtools.h	2005-06-22 23:09:09.000000000 +0200
+++ mc.include_widget/src/wtools.h	2005-07-09 14:22:01.000000000 +0200
@@ -1,8 +1,7 @@
 #ifndef MC_WTOOLS_H
 #define MC_WTOOLS_H
 
-struct Dlg_head;
-struct WListbox;
+#include "widget.h"
 
 typedef struct {
     struct Dlg_head *dlg;
diff -pruN mc/src/achown.c mc.include_widget/src/achown.c
--- mc/src/achown.c	2005-07-06 13:13:35.000000000 +0200
+++ mc.include_widget/src/achown.c	2005-07-09 14:07:14.000000000 +0200
@@ -30,8 +30,6 @@
 #include "tty.h"
 #include "win.h"
 #include "color.h"
-#include "dialog.h"
-#include "widget.h"
 #include "wtools.h"		/* For init_box_colors() */
 #include "key.h"		/* XCTRL and ALT macros */
 
diff -pruN mc/src/background.c mc.include_widget/src/background.c
--- mc/src/background.c	2005-05-29 13:47:21.000000000 +0200
+++ mc.include_widget/src/background.c	2005-07-09 13:52:09.000000000 +0200
@@ -38,7 +38,6 @@
 #include "global.h"
 #include "background.h"
 #include "tty.h"	/* doupdate() */
-#include "dialog.h"	/* do_refresh() */
 #include "wtools.h"
 #include "fileopctx.h"	/* FileOpContext */
 #include "key.h"	/* add_select_channel(), delete_select_channel() */
diff -pruN mc/src/boxes.c mc.include_widget/src/boxes.c
--- mc/src/boxes.c	2005-06-22 23:09:08.000000000 +0200
+++ mc.include_widget/src/boxes.c	2005-07-09 13:53:27.000000000 +0200
@@ -34,9 +34,7 @@
 #include "tty.h"
 #include "win.h"		/* Our window tools */
 #include "color.h"		/* Color definitions */
-#include "dialog.h"		/* The nice dialog manager */
-#include "widget.h"		/* The widgets for the nice dialog manager */
-#include "wtools.h"
+#include "wtools.h"		/* Includes widgets and dialog manager */
 #include "setup.h"		/* For profile_name */
 #include "profile.h"		/* Load/save user formats */
 #include "key.h"		/* XCTRL and ALT macros  */
diff -pruN mc/src/chmod.c mc.include_widget/src/chmod.c
--- mc/src/chmod.c	2005-07-06 13:13:35.000000000 +0200
+++ mc.include_widget/src/chmod.c	2005-07-09 13:54:33.000000000 +0200
@@ -29,9 +29,7 @@
 #include "global.h"
 #include "tty.h"	/* A_REVERSE */
 #include "color.h"	/* dialog_colors */
-#include "dialog.h"	/* add_widget() */
-#include "widget.h"	/* NORMAL_BUTTON */
-#include "wtools.h"	/* message() */
+#include "wtools.h"	/* message() NORMAL_BUTTON add_widget()*/
 #include "panel.h"	/* do_file_mark() */
 #include "main.h"	/* update_panels() */
 #include "chmod.h"
diff -pruN mc/src/chown.c mc.include_widget/src/chown.c
--- mc/src/chown.c	2005-05-29 13:47:21.000000000 +0200
+++ mc.include_widget/src/chown.c	2005-07-09 13:54:54.000000000 +0200
@@ -30,8 +30,6 @@
 #include "tty.h"
 #include "win.h"
 #include "color.h"
-#include "dialog.h"
-#include "widget.h"
 
 /* Needed for the extern declarations of integer parameters */
 #include "dir.h"
diff -pruN mc/src/cmd.c mc.include_widget/src/cmd.c
--- mc/src/cmd.c	2005-05-29 13:47:21.000000000 +0200
+++ mc.include_widget/src/cmd.c	2005-07-09 13:56:20.000000000 +0200
@@ -44,10 +44,8 @@
 #include "subshell.h"		/* use_subshell */
 #include "cons.saver.h"		/* console_flag */
 #include "tty.h"		/* LINES */
-#include "dialog.h"		/* Widget */
 #include "view.h"		/* view() */
-#include "wtools.h"		/* message() */
-#include "widget.h"		/* push_history() */
+#include "wtools.h"		/* message() push_history() Widget */
 #include "key.h"		/* application_keypad_mode() */
 #include "win.h"		/* do_enter_ca_mode() */
 #include "main.h"		/* change_panel() */
diff -pruN mc/src/command.c mc.include_widget/src/command.c
--- mc/src/command.c	2005-06-07 22:53:13.000000000 +0200
+++ mc.include_widget/src/command.c	2005-07-09 13:57:02.000000000 +0200
@@ -28,10 +28,9 @@
 
 #include "global.h"		/* home_dir */
 #include "tty.h"
-#include "widget.h"		/* WInput */
 #include "command.h"
 #include "complete.h"		/* completion constants */
-#include "wtools.h"		/* message () */
+#include "wtools.h"		/* message () WInput */
 #include "panel.h"		/* view_tree enum. Also, needed by main.h */
 #include "main.h"		/* do_cd */
 #include "layout.h"		/* for command_prompt variable */
diff -pruN mc/src/complete.c mc.include_widget/src/complete.c
--- mc/src/complete.c	2005-07-06 13:15:12.000000000 +0200
+++ mc.include_widget/src/complete.c	2005-07-09 13:57:10.000000000 +0200
@@ -34,8 +34,6 @@
 #include "tty.h"
 #include "win.h"
 #include "color.h"
-#include "dialog.h"
-#include "widget.h"
 #include "wtools.h"
 #include "complete.h"
 #include "main.h"
diff -pruN mc/src/execute.c mc.include_widget/src/execute.c
--- mc/src/execute.c	2005-05-29 13:47:21.000000000 +0200
+++ mc.include_widget/src/execute.c	2005-07-09 13:57:42.000000000 +0200
@@ -27,7 +27,6 @@
 #include "cons.saver.h"
 #include "subshell.h"
 #include "layout.h"
-#include "dialog.h"
 #include "wtools.h"
 #include "execute.h"
 
diff -pruN mc/src/file.c mc.include_widget/src/file.c
--- mc/src/file.c	2005-07-06 13:13:35.000000000 +0200
+++ mc.include_widget/src/file.c	2005-07-09 13:58:46.000000000 +0200
@@ -55,11 +55,8 @@
 #include "setup.h"
 #include "color.h"
 #include "win.h"
-#include "dialog.h"
-#include "widget.h"
 #include "main.h"		/* cmd_buf */
 #include "layout.h"
-#include "widget.h"
 #include "wtools.h"
 #include "background.h"		/* we_are_background */
 
diff -pruN mc/src/filegui.c mc.include_widget/src/filegui.c
--- mc/src/filegui.c	2005-05-29 13:47:21.000000000 +0200
+++ mc.include_widget/src/filegui.c	2005-07-09 13:59:57.000000000 +0200
@@ -54,12 +54,10 @@
 
 #include "global.h"
 #include "setup.h"		/* verbose */
-#include "dialog.h"		/* do_refresh() */
 #include "color.h"		/* dialog_colors */
-#include "widget.h"		/* WLabel */
 #define WANT_WIDGETS
 #include "main.h"		/* the_hint */
-#include "wtools.h"		/* QuickDialog */
+#include "wtools.h"		/* WLabel do_refresh() QuickDialog */
 #include "panel.h"		/* current_panel */
 #include "fileopctx.h"		/* FILE_CONT */
 #include "filegui.h"
diff -pruN mc/src/find.c mc.include_widget/src/find.c
--- mc/src/find.c	2005-07-08 16:05:39.000000000 +0200
+++ mc.include_widget/src/find.c	2005-07-09 14:01:37.000000000 +0200
@@ -34,14 +34,10 @@
 #include "setup.h"
 #include "find.h"
 
-/* Dialog manager and widgets */
-#include "dialog.h"
-#include "widget.h"
-
+#include "wtools.h"		/* Dialog manager and widgets */
 #include "dir.h"
 #include "panel.h"		/* current_panel */
 #include "main.h"		/* do_cd, try_to_select */
-#include "wtools.h"
 #include "cmd.h"		/* view_file_at_line */
 #include "boxes.h"
 #include "key.h"
diff -pruN mc/src/help.c mc.include_widget/src/help.c
--- mc/src/help.c	2005-06-22 23:09:08.000000000 +0200
+++ mc.include_widget/src/help.c	2005-07-09 14:02:21.000000000 +0200
@@ -53,9 +53,7 @@
 #include "mouse.h"
 #include "key.h"		/* For mi_getch() */
 #include "help.h"
-#include "dialog.h"		/* For Dlg_head */
-#include "widget.h"		/* For Widget */
-#include "wtools.h"		/* For common_dialog_repaint() */
+#include "wtools.h"		/* For common_dialog_repaint(), Widget, Dlg_head */
 
 #define MAXLINKNAME 80
 #define HISTORY_SIZE 20
diff -pruN mc/src/hotlist.c mc.include_widget/src/hotlist.c
--- mc/src/hotlist.c	2005-05-29 13:47:21.000000000 +0200
+++ mc.include_widget/src/hotlist.c	2005-07-09 14:02:38.000000000 +0200
@@ -39,8 +39,6 @@
 #include "global.h"
 #include "tty.h"		/* COLS */
 #include "color.h"		/* dialog_colors */
-#include "dialog.h"
-#include "widget.h"
 #include "setup.h"		/* For profile_bname */
 #include "profile.h"		/* Load/save directories hotlist */
 #include "wtools.h"		/* QuickDialog */
diff -pruN mc/src/layout.c mc.include_widget/src/layout.c
--- mc/src/layout.c	2005-06-22 23:09:08.000000000 +0200
+++ mc.include_widget/src/layout.c	2005-07-09 14:09:42.000000000 +0200
@@ -45,7 +45,6 @@
 #include "win.h"
 #include "color.h"
 #include "key.h"
-#include "dialog.h"
 #include "widget.h"
 #include "command.h"
 #include "profile.h"		/* For sync_profiles() */
diff -pruN mc/src/learn.c mc.include_widget/src/learn.c
--- mc/src/learn.c	2005-05-29 13:47:21.000000000 +0200
+++ mc.include_widget/src/learn.c	2005-07-09 14:02:47.000000000 +0200
@@ -33,8 +33,6 @@
 #include "tty.h"
 #include "win.h"
 #include "color.h"
-#include "dialog.h"
-#include "widget.h"
 #include "profile.h"		/* Save profile */
 #include "key.h"
 #include "setup.h"
diff -pruN mc/src/listmode.c mc.include_widget/src/listmode.c
--- mc/src/listmode.c	2005-05-29 13:47:21.000000000 +0200
+++ mc.include_widget/src/listmode.c	2005-07-09 14:02:53.000000000 +0200
@@ -34,8 +34,6 @@
 #include "tty.h"
 #include "win.h"
 #include "color.h"
-#include "dialog.h"
-#include "widget.h"
 #include "wtools.h"
 
 /* Needed for the extern declarations of integer parameters */
diff -pruN mc/src/main.c mc.include_widget/src/main.c
--- mc/src/main.c	2005-06-22 23:36:50.000000000 +0200
+++ mc.include_widget/src/main.c	2005-07-09 14:03:28.000000000 +0200
@@ -37,7 +37,6 @@
 #include "tty.h"
 #include "dir.h"
 #include "color.h"
-#include "dialog.h"
 #include "menu.h"
 #include "panel.h"
 #include "main.h"
@@ -62,7 +61,6 @@
 #include "ext.h"		/* For flush_extension_file() */
 
 /* Listbox for the command history feature */
-#include "widget.h"
 #include "command.h"
 #include "wtools.h"
 #include "complete.h"		/* For the free_completion */
diff -pruN mc/src/option.c mc.include_widget/src/option.c
--- mc/src/option.c	2005-05-29 13:47:21.000000000 +0200
+++ mc.include_widget/src/option.c	2005-07-09 14:10:00.000000000 +0200
@@ -29,7 +29,6 @@
 #include "tty.h"
 #include "win.h"
 #include "color.h"
-#include "dialog.h"
 #include "widget.h"
 #include "setup.h"		/* For save_setup() */
 #include "main.h"
diff -pruN mc/src/panelize.c mc.include_widget/src/panelize.c
--- mc/src/panelize.c	2005-05-29 13:47:21.000000000 +0200
+++ mc.include_widget/src/panelize.c	2005-07-09 14:03:35.000000000 +0200
@@ -33,8 +33,6 @@
 #include "tty.h"		/* attrset() */
 #include "win.h"
 #include "color.h"
-#include "dialog.h"
-#include "widget.h"
 #include "wtools.h"		/* For common_dialog_repaint() */
 #include "setup.h"		/* For profile_bname */
 #include "profile.h"		/* Load/save directories panelize */
diff -pruN mc/src/screen.c mc.include_widget/src/screen.c
--- mc/src/screen.c	2005-05-29 13:47:21.000000000 +0200
+++ mc.include_widget/src/screen.c	2005-07-09 14:04:01.000000000 +0200
@@ -44,7 +44,6 @@
 #include "user.h"
 #include "profile.h"
 #include "execute.h"
-#include "widget.h"
 #include "menu.h"		/* menubar_visible */
 #define WANT_WIDGETS
 #include "main.h"		/* the_menubar */
diff -pruN mc/src/selcodepage.c mc.include_widget/src/selcodepage.c
--- mc/src/selcodepage.c	2005-05-29 13:47:21.000000000 +0200
+++ mc.include_widget/src/selcodepage.c	2005-07-09 14:04:16.000000000 +0200
@@ -25,8 +25,6 @@
 #include <stdlib.h>
 
 #include "global.h"
-#include "dialog.h"
-#include "widget.h"
 #include "wtools.h"
 #include "charsets.h"
 #include "selcodepage.h"
diff -pruN mc/src/tree.c mc.include_widget/src/tree.c
--- mc/src/tree.c	2005-07-08 16:05:39.000000000 +0200
+++ mc.include_widget/src/tree.c	2005-07-09 14:04:56.000000000 +0200
@@ -37,8 +37,6 @@
 #include "color.h"
 #include "wtools.h"	/* message() */
 #include "dir.h"
-#include "dialog.h"
-#include "widget.h"
 #include "panel.h"
 #include "mouse.h"
 #include "main.h"
diff -pruN mc/src/user.c mc.include_widget/src/user.c
--- mc/src/user.c	2005-06-22 23:36:50.000000000 +0200
+++ mc.include_widget/src/user.c	2005-07-09 14:05:07.000000000 +0200
@@ -38,8 +38,6 @@
 #include "../edit/edit-widget.h"	/* WEdit */
 
 /* For the simple listbox manager */
-#include "dialog.h"
-#include "widget.h"
 #include "wtools.h"
 
 #include "view.h" /* for default_* externs */
diff -pruN mc/src/view.c mc.include_widget/src/view.c
--- mc/src/view.c	2005-07-08 16:05:39.000000000 +0200
+++ mc.include_widget/src/view.c	2005-07-09 14:06:14.000000000 +0200
@@ -46,15 +46,13 @@
 #include "global.h"
 #include "tty.h"
 #include "cmd.h"		/* For view_other_cmd */
-#include "dialog.h"		/* Needed by widget.h */
-#include "widget.h"		/* Needed for buttonbar_new */
 #include "color.h"
 #include "mouse.h"
 #include "help.h"
 #include "key.h"		/* For mi_getch() */
 #include "layout.h"
 #include "setup.h"
-#include "wtools.h"		/* For query_set_sel() */
+#include "wtools.h"		/* For query_set_sel(), buttonbar_new */
 #include "dir.h"
 #include "panel.h"		/* Needed for current_panel and other_panel */
 #include "win.h"
diff -pruN mc/src/widget.c mc.include_widget/src/widget.c
--- mc/src/widget.c	2005-07-08 16:05:39.000000000 +0200
+++ mc.include_widget/src/widget.c	2005-07-09 14:06:30.000000000 +0200
@@ -37,8 +37,6 @@
 #include "tty.h"
 #include "color.h"
 #include "mouse.h"
-#include "dialog.h"
-#include "widget.h"
 #include "win.h"
 #include "complete.h"
 #include "key.h"	/* XCTRL and ALT macros  */
diff -pruN mc/src/win.c mc.include_widget/src/win.c
--- mc/src/win.c	2005-05-29 13:47:24.000000000 +0200
+++ mc.include_widget/src/win.c	2005-07-09 14:10:06.000000000 +0200
@@ -28,7 +28,6 @@
 #include "tty.h"
 #include "color.h"
 #include "mouse.h"
-#include "dialog.h"
 #include "widget.h"
 #include "win.h"
 #include "key.h"		/* XCTRL and ALT macros  */
diff -pruN mc/src/wtools.c mc.include_widget/src/wtools.c
--- mc/src/wtools.c	2005-05-29 13:47:24.000000000 +0200
+++ mc.include_widget/src/wtools.c	2005-07-09 14:06:35.000000000 +0200
@@ -31,8 +31,6 @@
 #include "global.h"
 #include "tty.h"
 #include "color.h"		/* dialog_colors */
-#include "dialog.h"
-#include "widget.h"
 #include "wtools.h"
 #include "key.h"		/* mi_getch() */
 #include "complete.h"		/* INPUT_COMPLETE_CD */


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]