PIPS
|
#include <stdlib.h>
#include <stdio.h>
#include <sys/param.h>
#include <sys/time.h>
#include <sys/resource.h>
#include <xview/xview.h>
#include <xview/panel.h>
#include <xview/text.h>
#include "genC.h"
#include "linear.h"
#include "ri.h"
#include "ri-util.h"
#include "database.h"
#include "misc.h"
#include "pipsdbm.h"
#include "resources.h"
#include "constants.h"
#include "top-level.h"
#include "wpips.h"
#include "wpips-labels.h"
#include "wpips_view_menu_layout.h"
Go to the source code of this file.
Macros | |
#define | DONT_TOUCH_WINDOW_ADDRESS 0 |
Functions | |
void | edit_notify (Menu menu, Menu_item menu_item) |
void | current_selection_notify (Menu menu, Menu_item menu_item) |
void | dont_touch_window_notify (Panel_item item, int value, Event *event) |
char * | compute_title_string (int window_number) |
int | alloc_first_initialized_window (bool the_same_as_previous) |
Find the first free window if any. More... | |
bool | wpips_view_marked_busy (char *title_module_name, char *title_label, char *icon_name, char *icon_title) |
Mark a wpips or epips window as busy: More... | |
void | wpips_file_view (char *file_name, char *title_module_name, char *title_label, char *icon_name, char *icon_title) |
Display a file in a wpips or epips window: More... | |
void | wpips_display_graph_file_display (wpips_view_menu_layout_line *menu_line) |
Use daVinci to display a graph information: More... | |
void | wpips_display_plain_file (wpips_view_menu_layout_line *menu_line) |
Use some text viewer to display the resource: More... | |
void | wpips_display_WP65_file (wpips_view_menu_layout_line *menu_line) |
Mainly a hack to display 2 files in only one method for WP65... More... | |
void | execute_wpips_execute_and_display_something_outside_the_notifyer () |
To execute something and display some Pips output with wpips or epips, called outside the notifyer: More... | |
void | wpips_execute_and_display_something_outside_the_notifyer (wpips_view_menu_layout_line *menu_line) |
void | wpips_execute_and_display_something (char *resource_name) |
To execute something and display some Pips output with wpips or epips: More... | |
void | wpips_execute_and_display_something_from_alias (char *alias_name) |
To execute something and display some Pips output with wpips or epips by knowing its alias: More... | |
void | view_notify (Menu menu, Menu_item menu_item) |
void | edit_close_notify (Menu menu, Menu_item menu_item) |
void | disable_menu_item (Menu_item item) |
void | enable_menu_item (Menu_item item) |
void | apply_on_each_view_item (void(*function_to_apply_on_each_menu_item)(Menu_item), void(*function_to_apply_on_each_panel_item)(Panel_item)) |
void | disable_view_selection () |
void | enable_view_selection () |
void | create_edit_window () |
void | create_edit_menu () |
Variables | |
static wpips_view_menu_layout_line | wpips_view_menu_layout [] |
Include the label names: More... | |
static Textsw | edit_textsw [MAX_NUMBER_OF_WPIPS_WINDOWS] |
static Panel_item | check_box [MAX_NUMBER_OF_WPIPS_WINDOWS] |
static bool | dont_touch_window [MAX_NUMBER_OF_WPIPS_WINDOWS] |
int | number_of_wpips_windows = INITIAL_NUMBER_OF_WPIPS_WINDOWS |
static Menu_item | current_selection_mi |
static Menu_item | close_menu_item |
static Menu_item | sequential_view_menu_item |
Menu_item | edit_menu_item |
Menu | view_menu |
The menu "View" on the main panel: More... | |
static wpips_view_menu_layout_line * | execute_wpips_execute_and_display_something_outside_the_notifyer_menu_line = NULL |
To pass the view name to execute_wpips_execute_and_display_something_outside_the_notifyer(): More... | |
#define DONT_TOUCH_WINDOW_ADDRESS 0 |
Definition at line 186 of file xv_edit2.c.
Find the first free window if any.
If called with TRUE, giive the same as the previous choosen one.
Skip windows with modified text inside :
Skip windows with a retain attribute :
Definition at line 211 of file xv_edit2.c.
References check_box, edit_textsw, NO_TEXTSW_AVAILABLE, and number_of_wpips_windows.
Referenced by edit_notify(), wpips_file_view(), and wpips_view_marked_busy().
void apply_on_each_view_item | ( | void(*)(Menu_item) | function_to_apply_on_each_menu_item, |
void(*)(Panel_item) | function_to_apply_on_each_panel_item | ||
) |
Skip the "current_selection_mi" and "close" Menu_items:
Skip the title item:
Now walk through the options panel:
Only on the PANEL_CHOICE_STACK:
Definition at line 572 of file xv_edit2.c.
References close_menu_item, current_selection_mi, options_panel, and view_menu.
Referenced by disable_view_selection(), and enable_view_selection().
char* compute_title_string | ( | int | window_number | ) |
xv_set will copy the string.
Definition at line 197 of file xv_edit2.c.
References window_number.
Referenced by wpips_file_view(), and wpips_view_marked_busy().
void create_edit_menu | ( | ) |
Make sense only if we have XView edit windows:
Now add all the view entries:
Just a separator:
Make sense only if we have XView edit windows:
Just a separator:
Definition at line 649 of file xv_edit2.c.
References close_menu_item, current_selection_mi, current_selection_notify(), edit_close_notify(), main_frame, main_panel, wpips_view_menu_layout_line_s::menu_entry_string, SEQUENTIAL_VIEW, sequential_view_menu_item, view_menu, view_notify(), wpips_emacs_mode, WPIPS_MENU_SEPARATOR, WPIPS_MENU_SEPARATOR_ID, and wpips_view_menu_layout.
void create_edit_window | ( | ) |
Xv_Window window;
Definition at line 616 of file xv_edit2.c.
References check_box, dont_touch_window, DONT_TOUCH_WINDOW_ADDRESS, dont_touch_window_notify(), edit_frame, edit_textsw, and MAX_NUMBER_OF_WPIPS_WINDOWS.
void current_selection_notify | ( | Menu | menu, |
Menu_item | menu_item | ||
) |
Definition at line 175 of file xv_edit2.c.
References edit_frame, number_of_wpips_windows, and unhide_window().
Referenced by create_edit_menu().
void disable_menu_item | ( | Menu_item | item | ) |
Definition at line 558 of file xv_edit2.c.
Referenced by disable_compile_selection(), disable_option_selection(), disable_transform_selection(), and disable_view_selection().
void disable_view_selection | ( | ) |
Definition at line 603 of file xv_edit2.c.
References apply_on_each_view_item(), disable_menu_item(), and disable_panel_item().
void dont_touch_window_notify | ( | Panel_item | item, |
int | value, | ||
Event * | event | ||
) |
Definition at line 188 of file xv_edit2.c.
References dont_touch_window, and DONT_TOUCH_WINDOW_ADDRESS.
Referenced by create_edit_window().
void edit_close_notify | ( | Menu | menu, |
Menu_item | menu_item | ||
) |
Definition at line 527 of file xv_edit2.c.
References close_menu_item, current_selection_mi, display_memory_usage(), edit_frame, edit_textsw, hide_window(), MAX_NUMBER_OF_WPIPS_WINDOWS, prompt_user(), unhide_window(), and wpips_emacs_mode.
Referenced by create_edit_menu().
void edit_notify | ( | Menu | menu, |
Menu_item | menu_item | ||
) |
Rely on the standard EPips viewer:
Translate the menu string in a resource name:
Is there an available edit_textsw ?
Display the file name and the module name. RK, 2/06/1993 :
Definition at line 94 of file xv_edit2.c.
References alloc_first_initialized_window(), build_pgmwd, close_menu_item, current_selection_mi, db_get_current_module_name(), db_get_current_workspace_name(), db_get_file_resource, edit_frame, edit_textsw, file_name, MAXPATHLEN, wpips_view_menu_layout_line_s::menu_entry_string, NO_TEXTSW_AVAILABLE, pips_assert, prompt_user(), SMALL_BUFFER_LENGTH, unhide_window(), wpips_emacs_mode, wpips_execute_and_display_something_outside_the_notifyer(), and wpips_view_menu_layout.
void enable_menu_item | ( | Menu_item | item | ) |
Definition at line 565 of file xv_edit2.c.
Referenced by enable_compile_selection(), enable_option_selection(), enable_transform_selection(), and enable_view_selection().
void enable_view_selection | ( | ) |
Definition at line 610 of file xv_edit2.c.
References apply_on_each_view_item(), enable_menu_item(), and enable_panel_item().
void execute_wpips_execute_and_display_something_outside_the_notifyer | ( | ) |
To execute something and display some Pips output with wpips or epips, called outside the notifyer:
Execute the needed method:
The module list may have changed (well not very likely to happen, but...):
Definition at line 438 of file xv_edit2.c.
References display_memory_usage(), execute_wpips_execute_and_display_something_outside_the_notifyer_menu_line, wpips_view_menu_layout_line_s::method_function_to_use, and send_the_names_of_the_available_modules_to_emacs().
Referenced by wpips_main_loop().
void view_notify | ( | Menu | menu, |
Menu_item | menu_item | ||
) |
Translate the menu string in a resource name:
Definition at line 517 of file xv_edit2.c.
References wpips_execute_and_display_something_from_alias().
Referenced by create_edit_menu().
void wpips_display_graph_file_display | ( | wpips_view_menu_layout_line * | menu_line | ) |
Use daVinci to display a graph information:
Exploit some parallelism between daVinci/Emacs and PIPS itself:
Preprocess the graph to be understandable by daVinci :
Since Emacs may be with another current directory, use the full path name:
Definition at line 338 of file xv_edit2.c.
References ask_emacs_to_display_a_graph(), ask_emacs_to_open_a_new_daVinci_context(), build_view_file(), concatenate(), file_name, free(), get_cwd(), wpips_view_menu_layout_line_s::resource_name_to_view, SMALL_BUFFER_LENGTH, user_log(), and wpips_emacs_mode.
void wpips_display_plain_file | ( | wpips_view_menu_layout_line * | menu_line | ) |
Use some text viewer to display the resource:
Definition at line 372 of file xv_edit2.c.
References build_view_file(), db_get_current_module_name(), file_name, free(), wpips_view_menu_layout_line_s::icon_name, wpips_view_menu_layout_line_s::menu_entry_string, print_type(), wpips_view_menu_layout_line_s::resource_name_to_view, SMALL_BUFFER_LENGTH, wpips_file_view(), and wpips_view_marked_busy().
void wpips_display_WP65_file | ( | wpips_view_menu_layout_line * | menu_line | ) |
Mainly a hack to display 2 files in only one method for WP65...
Now display the other file:
Assume the previous build_view_file built the both resources:
Definition at line 396 of file xv_edit2.c.
References build_view_file(), db_get_current_module_name(), file_name, free(), get_dont_build_view_file(), wpips_view_menu_layout_line_s::icon_name, wpips_view_menu_layout_line_s::menu_entry_string, print_type(), wpips_view_menu_layout_line_s::resource_name_to_view, SMALL_BUFFER_LENGTH, wpips_file_view(), and wpips_view_marked_busy().
void wpips_execute_and_display_something | ( | char * | resource_name | ) |
To execute something and display some Pips output with wpips or epips:
Translate the resource name in a menu entry descriptor:
Definition at line 466 of file xv_edit2.c.
References db_get_current_module_name(), wpips_view_menu_layout_line_s::menu_entry_string, module_name(), pips_assert, prompt_user(), resource_name, wpips_view_menu_layout_line_s::resource_name_to_view, wpips_execute_and_display_something_outside_the_notifyer(), and wpips_view_menu_layout.
void wpips_execute_and_display_something_from_alias | ( | char * | alias_name | ) |
To execute something and display some Pips output with wpips or epips by knowing its alias:
Definition at line 493 of file xv_edit2.c.
References db_get_current_module_name(), wpips_view_menu_layout_line_s::menu_entry_string, module_name(), pips_assert, prompt_user(), wpips_execute_and_display_something_outside_the_notifyer(), and wpips_view_menu_layout.
Referenced by epips_execute_and_display_something(), options_panel_to_view_menu_gateway(), and view_notify().
void wpips_execute_and_display_something_outside_the_notifyer | ( | wpips_view_menu_layout_line * | menu_line | ) |
Ask to execute the execute_wpips_execute_and_display_something_outside_the_notifyer():
I guess the function above does not return...
Definition at line 453 of file xv_edit2.c.
References execute_main_loop_command(), execute_wpips_execute_and_display_something_outside_the_notifyer_menu_line, and WPIPS_EXECUTE_AND_DISPLAY.
Referenced by edit_notify(), wpips_execute_and_display_something(), and wpips_execute_and_display_something_from_alias().
void wpips_file_view | ( | char * | file_name, |
char * | title_module_name, | ||
char * | title_label, | ||
char * | icon_name, | ||
char * | icon_title | ||
) |
Display a file in a wpips or epips window:
Well, something got wrong...
Is there an available edit_textsw ? Ask for the same one allocated for wpips_view_marked_busy()
Display the file name and the module name. RK, 2/06/1993 :
The Emacs mode equivalent:
send_icon_name_to_emacs(icon_number);
title_label | The module name for example |
icon_name | "Sequential View" for exemple |
Definition at line 277 of file xv_edit2.c.
References alloc_first_initialized_window(), close_menu_item, compute_title_string(), current_selection_mi, db_get_current_module_name(), display_memory_usage(), edit_frame, edit_textsw, file_name, NO_TEXTSW_AVAILABLE, prompt_user(), send_module_name_to_emacs(), send_view_to_emacs(), set_pips_icon(), unhide_window(), window_number, and wpips_emacs_mode.
Referenced by notify_hpfc_file_view(), wpips_display_plain_file(), and wpips_display_WP65_file().
bool wpips_view_marked_busy | ( | char * | title_module_name, |
char * | title_label, | ||
char * | icon_name, | ||
char * | icon_title | ||
) |
Mark a wpips or epips window as busy:
Is there an available edit_textsw ?
Display the file name and the module name. RK, 2/06/1993 :
title_label | The module name for example |
icon_name | "Sequential View" for exemple |
Definition at line 240 of file xv_edit2.c.
References alloc_first_initialized_window(), compute_title_string(), display_memory_usage(), edit_frame, NO_TEXTSW_AVAILABLE, prompt_user(), set_pips_icon(), SMALL_BUFFER_LENGTH, unhide_window(), window_number, and wpips_emacs_mode.
Referenced by wpips_display_plain_file(), and wpips_display_WP65_file().
|
static |
Definition at line 75 of file xv_edit2.c.
Referenced by alloc_first_initialized_window(), and create_edit_window().
|
static |
Definition at line 80 of file xv_edit2.c.
Referenced by apply_on_each_view_item(), create_edit_menu(), edit_close_notify(), edit_notify(), and wpips_file_view().
|
static |
Definition at line 79 of file xv_edit2.c.
Referenced by apply_on_each_view_item(), create_edit_menu(), edit_close_notify(), edit_notify(), and wpips_file_view().
|
static |
Definition at line 76 of file xv_edit2.c.
Referenced by create_edit_window(), and dont_touch_window_notify().
Menu_item edit_menu_item |
Definition at line 82 of file xv_edit2.c.
|
static |
Definition at line 74 of file xv_edit2.c.
Referenced by alloc_first_initialized_window(), create_edit_window(), edit_close_notify(), edit_notify(), and wpips_file_view().
|
static |
To pass the view name to execute_wpips_execute_and_display_something_outside_the_notifyer():
Definition at line 90 of file xv_edit2.c.
Referenced by execute_wpips_execute_and_display_something_outside_the_notifyer(), and wpips_execute_and_display_something_outside_the_notifyer().
int number_of_wpips_windows = INITIAL_NUMBER_OF_WPIPS_WINDOWS |
Definition at line 77 of file xv_edit2.c.
Referenced by alloc_first_initialized_window(), create_status_subwindow(), current_selection_notify(), quit_notify(), and window_number_notify().
|
static |
Definition at line 81 of file xv_edit2.c.
Referenced by create_edit_menu().
Menu view_menu |
The menu "View" on the main panel:
Definition at line 85 of file xv_edit2.c.
Referenced by apply_on_each_view_item(), and create_edit_menu().
|
static |
Include the label names:
Definition at line 64 of file xv_edit2.c.
Referenced by create_edit_menu(), edit_notify(), wpips_execute_and_display_something(), and wpips_execute_and_display_something_from_alias().