diff --git a/src/ChangeLog b/src/ChangeLog index cd08dac37..dbf13b293 100644 --- a/src/ChangeLog +++ b/src/ChangeLog @@ -1,5 +1,9 @@ 2003-10-26 Pavel Roskin + * main.c (get_current_panel): Remove. + (get_other_panel): Move ... + * layout.c: ... here. + * info.h: Don't expose WInfo internals. * background.c (tell_parent): Eliminate. diff --git a/src/layout.c b/src/layout.c index 5af65ca3d..72380f3f5 100644 --- a/src/layout.c +++ b/src/layout.c @@ -1109,6 +1109,12 @@ int get_other_index (void) return !get_current_index (); } +struct WPanel * +get_other_panel (void) +{ + return (struct WPanel *) get_panel_widget (get_other_index ()); +} + /* Returns the view type for the current panel/view */ int get_current_type (void) { diff --git a/src/layout.h b/src/layout.h index e7ba4c1db..75c638172 100644 --- a/src/layout.h +++ b/src/layout.h @@ -21,6 +21,9 @@ char *get_nth_panel_name (int num); struct Widget; struct Widget *get_panel_widget (int index); +struct WPanel; +struct WPanel *get_other_panel (void); + void set_hintbar (char *str); /* Clear screen */ diff --git a/src/main.c b/src/main.c index ad20f3658..a07882ac7 100644 --- a/src/main.c +++ b/src/main.c @@ -276,18 +276,6 @@ char *mc_home; char cmd_buf[512]; -WPanel * -get_current_panel (void) -{ - return current_panel; -} - -WPanel * -get_other_panel (void) -{ - return (WPanel *) get_panel_widget (get_other_index ()); -} - static void reload_panelized (WPanel *panel) { diff --git a/src/panel.h b/src/panel.h index 14842b4ed..8d513017a 100644 --- a/src/panel.h +++ b/src/panel.h @@ -5,7 +5,6 @@ #include "dialog.h" /* Widget */ #define selection(p) (&(p->dir.list[p->selected])) -#define other_panel get_other_panel() #define DEFAULT_USER_FORMAT "half type name | size | perm" #define LIST_TYPES 4 @@ -92,12 +91,10 @@ void update_dirty_panels (void); void panel_update_cols (Widget *widget, int frame_size); int set_panel_formats (WPanel *p); -WPanel *get_current_panel (void); -WPanel *get_other_panel (void); - /* Useful macros to avoid too much typing */ -#define cpanel get_current_panel() +#define cpanel current_panel #define opanel get_other_panel() +#define other_panel get_other_panel() extern WPanel *left_panel; extern WPanel *right_panel; diff --git a/src/setup.c b/src/setup.c index 8889451eb..cd5cd51cc 100644 --- a/src/setup.c +++ b/src/setup.c @@ -328,7 +328,7 @@ save_setup (void) save_string ("Dirs", "other_dir", get_other_type () == view_listing ? opanel->cwd : ".", profile); - if (get_current_panel () != NULL) + if (current_panel != NULL) WritePrivateProfileString ("Dirs", "current_is_left", get_current_index () == 0 ? "1" : "0", profile); save_hotlist ();