PIPS
|
#include <stdio.h>
#include <stdlib.h>
#include <unistd.h>
#include <sys/time.h>
#include <sys/resource.h>
#include <xview/xview.h>
#include <xview/panel.h>
#include <xview/notice.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 "pipsmake.h"
#include "top-level.h"
#include "wpips.h"
#include "resources.h"
Go to the source code of this file.
Enumerations | |
enum | { WPIPS_MAX_MODULE_MENU_SIZE = 50 } |
Maximum size of the module menu of the main frame: More... | |
Variables | |
Menu_item | directory_menu_item |
static char * | workspace_name_to_create |
bool | wpips_close_workspace_menu_inactive |
To enable or disable the menu items generated by generate_module_menu(): More... | |
bool | wpips_close_workspace_menu_inactive_old |
bool | wpips_create_workspace_menu_inactive |
bool | wpips_open_workspace_menu_inactive |
bool | wpips_delete_workspace_menu_inactive |
bool | wpips_change_directory_inactive |
bool | wpips_change_directory_inactive_old |
static Menu_item | create_pgm |
static Menu_item | open_pgm |
static Menu_item | close_pgm |
static Menu_item | module_item |
anonymous enum |
Maximum size of the module menu of the main frame:
Enumerator | |
---|---|
WPIPS_MAX_MODULE_MENU_SIZE |
Definition at line 63 of file xv_select.c.
void cancel_create_workspace_notify | ( | Panel_item | item, |
Event * | event | ||
) |
Re'tablit le droit d'ouvrir ou de cre'er un autre worspace :
Definition at line 477 of file xv_select.c.
References cancel_query_notify(), enable_change_directory(), enable_workspace_create_or_open(), enable_workspace_delete_or_open(), and show_workspace().
Referenced by continue_create_workspace_notify(), and start_create_workspace_notify().
void cancel_delete_workspace_notify | ( | ) |
Nothing to do.
Definition at line 408 of file xv_select.c.
References enable_workspace_create_or_open(), enable_workspace_delete_or_open(), restore_enable_change_directory_state(), and restore_enable_workspace_close_state().
Referenced by start_delete_workspace_notify().
void cancel_open_workspace_notify | ( | ) |
Definition at line 656 of file xv_select.c.
References enable_change_directory(), enable_workspace_create_or_open(), and show_workspace().
Referenced by open_workspace_notify().
void cancel_select_module_notify | ( | void | ) |
Definition at line 915 of file xv_select.c.
Referenced by select_module_notify().
success close_workspace_notify | ( | Menu | menu, |
Menu_item | menu_item | ||
) |
The close has been successful:
It is the only place to enable a directory change, after a close workspace:
Tell Emacs the new module list, that is nothing in fact:
Definition at line 702 of file xv_select.c.
References close_workspace(), debug(), disable_module_selection(), disable_workspace_close(), display_memory_usage(), edit_close_notify(), enable_change_directory(), enable_workspace_create_or_open(), hide_window(), initialize_wpips_hpfc_hack_for_fabien_and_from_fabien(), schoose_frame, send_the_names_of_the_available_modules_to_emacs(), show_module(), and show_workspace().
Referenced by create_select_menu(), end_delete_workspace_notify(), generate_workspace_menu(), open_or_create_workspace(), and start_create_workspace_notify().
success continue_create_workspace_notify | ( | char * | name | ) |
Is the name a valid workspace name?
Code added to confirm for a database destruction before opening a database with the same name. RK 18/05/1993.
Send to emacs if we are in the emacs mode:
To avoid passing the name through mchoose():
Only one Fortran program: use it without user confirmation.
Memory leak if mchoose exit...
If it failed, cancel the creation:
Definition at line 490 of file xv_select.c.
References cancel_create_workspace_notify(), disable_workspace_create_or_open(), end_create_workspace_notify(), gen_array_full_free(), gen_array_item(), gen_array_make(), gen_array_nitems(), main_frame, mchoose(), pips_get_fortran_list(), prompt_user(), send_notice_prompt_to_emacs(), user_log(), user_prompt_not_a_valid_workspace_name(), workspace_exists_p(), workspace_name_p(), workspace_name_to_create, and wpips_emacs_mode.
Referenced by open_or_create_workspace(), and start_create_workspace_notify().
void create_select_menu | ( | ) |
Exchange of the order of create_pgm & open_pgm on the screen for ergonomic reasons. :-) RK, 19/02/1993.
Exchange of the order of start_directory_notify & module_item on the screen for ergonomic reasons. :-) RK, 19/02/1993.
Now all the functionality of the select menu are on the status panel but I could reinstall the select menu later. Since I do not want do change the code, put the select menu in a dummy spare frame:
Definition at line 1016 of file xv_select.c.
References close_pgm, close_workspace_notify(), create_pgm, directory_menu_item, main_frame, module_item, open_pgm, open_workspace_notify(), select_module_notify(), start_create_workspace_notify(), and start_directory_notify().
void direct_change_directory | ( | ) |
FC: uses an external wish script I do not know how to activate this function safely...
no cd in this state!
last was
Definition at line 139 of file xv_select.c.
References concatenate(), end_directory_notify(), free(), get_cwd(), MAXPATHLEN, safe_fclose(), safe_fopen(), safe_system(), strdup(), and wpips_change_directory_inactive.
void disable_change_directory | ( | ) |
In order to warn the user as soon as possible that (s)he can't change the directory, notify for whatever character:
Definition at line 218 of file xv_select.c.
References directory_menu_item, directory_name_panel_item, prompt_user_not_allowed_to_change_directory(), wpips_change_directory_inactive, and wpips_change_directory_inactive_old.
Referenced by end_create_workspace_notify(), end_open_workspace_notify(), open_or_create_workspace(), restore_enable_change_directory_state(), start_create_workspace_notify(), and start_delete_workspace_notify().
void disable_module_selection | ( | ) |
Definition at line 330 of file xv_select.c.
References disable_compile_selection(), disable_option_selection(), disable_transform_selection(), disable_view_selection(), module_item, and module_name_panel_item.
Referenced by close_workspace_notify().
void disable_workspace_close | ( | ) |
Definition at line 304 of file xv_select.c.
References close_pgm, wpips_close_workspace_menu_inactive, and wpips_close_workspace_menu_inactive_old.
Referenced by close_workspace_notify(), start_delete_workspace_notify(), and user_prompt_not_a_valid_workspace_name().
void disable_workspace_create_or_open | ( | ) |
Definition at line 248 of file xv_select.c.
References create_pgm, open_pgm, workspace_name_panel_item, and wpips_create_workspace_menu_inactive.
Referenced by continue_create_workspace_notify(), open_workspace_notify(), start_create_workspace_notify(), and start_delete_workspace_notify().
void disable_workspace_delete_or_open | ( | ) |
Avoid also to delete a workspace during a creation in case the name of the workspace is the same...
Definition at line 280 of file xv_select.c.
References workspace_name_panel_item, wpips_delete_workspace_menu_inactive, and wpips_open_workspace_menu_inactive.
Referenced by start_create_workspace_notify(), and start_delete_workspace_notify().
void enable_change_directory | ( | ) |
Enable the normal notify mode: notify when return and so is typed:
Definition at line 201 of file xv_select.c.
References directory_menu_item, directory_name_panel_item, end_directory_text_notify(), wpips_change_directory_inactive, and wpips_change_directory_inactive_old.
Referenced by cancel_create_workspace_notify(), cancel_open_workspace_notify(), close_workspace_notify(), end_create_workspace_notify(), restore_enable_change_directory_state(), and user_prompt_not_a_valid_workspace_name().
void enable_module_selection | ( | ) |
Well, after a workspace creation without automatic module selection successful, there is no module selected and thus the following menus are not very interestiong, except for the option part of the option selection. Anyway, there is a guard in each of these menu, so, just do nothing... :-)
Definition at line 342 of file xv_select.c.
References enable_compile_selection(), enable_option_selection(), enable_transform_selection(), enable_view_selection(), module_item, and module_name_panel_item.
Referenced by end_create_workspace_notify(), and end_open_workspace_notify().
void enable_workspace_close | ( | ) |
Definition at line 314 of file xv_select.c.
References close_pgm, and wpips_close_workspace_menu_inactive.
Referenced by end_create_workspace_notify(), and end_open_workspace_notify().
void enable_workspace_create_or_open | ( | ) |
Definition at line 264 of file xv_select.c.
References create_pgm, open_pgm, workspace_name_panel_item, and wpips_create_workspace_menu_inactive.
Referenced by cancel_create_workspace_notify(), cancel_delete_workspace_notify(), cancel_open_workspace_notify(), close_workspace_notify(), end_create_workspace_notify(), end_delete_workspace_notify(), end_open_workspace_notify(), and user_prompt_not_a_valid_workspace_name().
void enable_workspace_delete_or_open | ( | ) |
Definition at line 293 of file xv_select.c.
References workspace_name_panel_item, wpips_delete_workspace_menu_inactive, and wpips_open_workspace_menu_inactive.
Referenced by cancel_create_workspace_notify(), cancel_delete_workspace_notify(), end_create_workspace_notify(), and end_delete_workspace_notify().
void end_create_workspace_notify | ( | gen_array_t | files | ) |
If the user click quickly on OK, be sure end_create_workspace_notify() is not reentrant by verifying something as not been opened already:
Is the name a valid workspace name?
The create workspace has been successful:
The processing of user files has been successful:
Tell Emacs the new module list:
The creation failed:
Definition at line 583 of file xv_select.c.
References create_workspace(), db_create_workspace(), db_get_current_workspace_name(), disable_change_directory(), display_memory_usage(), enable_change_directory(), enable_module_selection(), enable_workspace_close(), enable_workspace_create_or_open(), enable_workspace_delete_or_open(), select_a_module_by_default(), send_the_names_of_the_available_modules_to_emacs(), show_workspace(), user_prompt_not_a_valid_workspace_name(), workspace_name_p(), and workspace_name_to_create.
Referenced by continue_create_workspace_notify().
void end_delete_workspace_notify | ( | char * | name | ) |
Send to emacs if we are in the emacs mode:
First close the workspace:
Hmm... This may put WPips in a strange state if close fails...
Definition at line 359 of file xv_select.c.
References close_workspace_notify(), db_get_current_workspace_name(), delete_workspace(), display_memory_usage(), enable_workspace_create_or_open(), enable_workspace_delete_or_open(), main_frame, restore_enable_change_directory_state(), restore_enable_workspace_close_state(), schoose_close(), send_notice_prompt_to_emacs(), and wpips_emacs_mode.
Referenced by start_delete_workspace_notify().
success end_directory_notify | ( | char * | dir | ) |
if (dir != NULL) {
Definition at line 109 of file xv_select.c.
References pips_change_directory(), prompt_user(), show_directory(), and user_log().
Referenced by direct_change_directory(), end_directory_text_notify(), and start_directory_notify().
void end_directory_text_notify | ( | Panel_item | text_item, |
Event * | event | ||
) |
Definition at line 129 of file xv_select.c.
References end_directory_notify().
Referenced by enable_change_directory().
void end_open_workspace_notify | ( | string | name | ) |
Tell Emacs the new module list:
Definition at line 634 of file xv_select.c.
References disable_change_directory(), display_memory_usage(), enable_module_selection(), enable_workspace_close(), enable_workspace_create_or_open(), open_workspace(), schoose_close(), select_a_module_by_default(), send_the_names_of_the_available_modules_to_emacs(), and show_workspace().
Referenced by open_or_create_workspace(), and open_workspace_notify().
void end_select_module_notify | ( | string | name | ) |
Definition at line 882 of file xv_select.c.
References db_get_module_list(), display_memory_usage(), gen_array_full_free(), gen_array_item(), gen_array_nitems(), lazy_open_module(), prompt_user(), and show_module().
Referenced by create_status_subwindow(), epips_select_module(), execute_workspace_creation_and_so_on_given_with_options(), select_a_module_by_default(), and select_module_notify().
Menu generate_directory_menu | ( | ) |
Definition at line 167 of file xv_select.c.
References generate_a_directory_menu(), and get_cwd().
Menu generate_module_menu | ( | ) |
To use with schoose_create_abbrev_menu_with_text:
The strdup'ed string will also be freed when the menu is discarded:
Definition at line 947 of file xv_select.c.
References db_get_current_workspace_name(), db_get_module_list(), gen_array_full_free(), gen_array_item(), gen_array_nitems(), select_module_notify(), strdup(), user_warning, and WPIPS_MAX_MODULE_MENU_SIZE.
Menu generate_workspace_menu | ( | ) |
To use with schoose_create_abbrev_menu_with_text:
Replace the Select Workspace menu from the status window with the following items:
Always active since start_create_workspace_notify() does the close if necessary:
On can close only if there is something open:
Now complete with the list of the workspaces:
Well, since there is no workspace, there is nothing to delete...
The strdup'ed string will also be freed when the menu is discarded:
Definition at line 790 of file xv_select.c.
References close_workspace_notify(), gen_array_full_free(), gen_array_item(), gen_array_make(), gen_array_nitems(), pips_get_workspace_list(), start_create_workspace_notify(), start_delete_workspace_notify(), strdup(), wpips_close_workspace_menu_inactive, wpips_create_workspace_menu_inactive, wpips_delete_workspace_menu_inactive, and wpips_open_workspace_menu_inactive.
void open_or_create_workspace | ( | char * | workspace_name_original | ) |
To be used with schoose_create_abbrev_menu_with_text from the main panel:
If close_workspace_notify() is called below, show_workspace() will set the name to "(* none *)" in the panel and workspace_name_original is directly a pointer to it !
Prompt the warning and restore the menu enable state:
There is an open workspace: close it first:
To choose between open or create, look for the an existing workspace with the same name:
OK, the workspace exists, open it:
The workspace does not exist, create it:
Definition at line 741 of file xv_select.c.
References close_workspace_notify(), continue_create_workspace_notify(), db_get_current_workspace_name(), disable_change_directory(), end_open_workspace_notify(), gen_array_full_free(), gen_array_item(), gen_array_make(), gen_array_nitems(), pips_get_workspace_list(), show_workspace(), SMALL_BUFFER_LENGTH, user_prompt_not_a_valid_workspace_name(), and workspace_name_p().
void open_workspace_notify | ( | Menu | menu, |
Menu_item | menu_item | ||
) |
There is only workspace: open it without asking confirmation to the user:
Choix initial sur le workspace courant si possible :
Definition at line 665 of file xv_select.c.
References cancel_open_workspace_notify(), db_get_current_workspace_name(), disable_workspace_create_or_open(), end_open_workspace_notify(), gen_array_full_free(), gen_array_item(), gen_array_make(), gen_array_nitems(), pips_get_workspace_list(), prompt_user(), schoose(), and user_log().
Referenced by create_select_menu().
void prompt_user_not_allowed_to_change_directory | ( | Panel_item | text_item, |
Event * | event | ||
) |
First untype whatever the user typed:
Definition at line 174 of file xv_select.c.
References prompt_user(), and show_directory().
Referenced by disable_change_directory(), and start_directory_notify().
|
static |
Definition at line 235 of file xv_select.c.
References disable_change_directory(), enable_change_directory(), and wpips_change_directory_inactive_old.
Referenced by cancel_delete_workspace_notify(), and end_delete_workspace_notify().
void restore_enable_workspace_close_state | ( | ) |
Definition at line 323 of file xv_select.c.
References wpips_close_workspace_menu_inactive, and wpips_close_workspace_menu_inactive_old.
Referenced by cancel_delete_workspace_notify(), and end_delete_workspace_notify().
void select_a_module_by_default | ( | ) |
Try to select a main module (that is the PROGRAM in the Fortran stuff) if no one is selected:
Ok, no current module, then find a main module (PROGRAM):
Ok, we got it ! Now we select it:
GO: show_module() has already been called so return now
Refresh the module name on the status window:
Definition at line 85 of file xv_select.c.
References db_get_current_module_name(), end_select_module_notify(), get_first_main_module(), module_name(), show_module(), string_undefined_p, and user_log().
Referenced by end_create_workspace_notify(), and end_open_workspace_notify().
void select_module_notify | ( | Menu | menu, |
Menu_item | menu_item | ||
) |
If there is no module... RK, 23/1/1993.
Affiche comme choix courant le module courant (c'est utile si on ferme la fenĂȘtre module entre temps) :
Definition at line 920 of file xv_select.c.
References cancel_select_module_notify(), db_get_current_module_name(), db_get_module_list(), end_select_module_notify(), gen_array_full_free(), gen_array_nitems(), prompt_user(), and schoose().
Referenced by create_select_menu(), and generate_module_menu().
void start_create_workspace_notify | ( | Menu | menu, |
Menu_item | menu_item | ||
) |
There is an open workspace: close it first:
If it fails:
Pas la peine de faire quelque chose si on appuie sur cancel :
Definition at line 451 of file xv_select.c.
References cancel_create_workspace_notify(), close_workspace_notify(), continue_create_workspace_notify(), db_get_current_workspace_name(), disable_change_directory(), disable_workspace_create_or_open(), disable_workspace_delete_or_open(), and start_query().
Referenced by create_select_menu(), and generate_workspace_menu().
void start_delete_workspace_notify | ( | Menu | menu, |
Menu_item | menu_item | ||
) |
Choix initial sur le workspace courant si possible :
Definition at line 419 of file xv_select.c.
References cancel_delete_workspace_notify(), db_get_current_workspace_name(), disable_change_directory(), disable_workspace_close(), disable_workspace_create_or_open(), disable_workspace_delete_or_open(), end_delete_workspace_notify(), gen_array_full_free(), gen_array_make(), gen_array_nitems(), pips_get_workspace_list(), prompt_user(), and schoose().
Referenced by generate_workspace_menu().
void start_directory_notify | ( | Menu | menu, |
Menu_item | menu_item | ||
) |
Definition at line 184 of file xv_select.c.
References cancel_query_notify(), db_get_current_workspace_name(), end_directory_notify(), prompt_user_not_allowed_to_change_directory(), and start_query().
Referenced by create_select_menu().
void user_prompt_not_a_valid_workspace_name | ( | char * | workspace_name | ) |
Definition at line 572 of file xv_select.c.
References disable_workspace_close(), enable_change_directory(), enable_workspace_create_or_open(), and prompt_user().
Referenced by continue_create_workspace_notify(), end_create_workspace_notify(), and open_or_create_workspace().
|
static |
Definition at line 244 of file xv_select.c.
Referenced by create_select_menu(), disable_workspace_close(), and enable_workspace_close().
|
static |
Definition at line 244 of file xv_select.c.
Referenced by create_select_menu(), disable_workspace_create_or_open(), and enable_workspace_create_or_open().
Menu_item directory_menu_item |
Definition at line 68 of file xv_select.c.
Referenced by create_select_menu(), disable_change_directory(), and enable_change_directory().
|
static |
Definition at line 244 of file xv_select.c.
Referenced by create_select_menu(), disable_module_selection(), and enable_module_selection().
|
static |
Definition at line 244 of file xv_select.c.
Referenced by create_select_menu(), disable_workspace_create_or_open(), and enable_workspace_create_or_open().
|
static |
Definition at line 70 of file xv_select.c.
Referenced by continue_create_workspace_notify(), and end_create_workspace_notify().
bool wpips_change_directory_inactive |
Definition at line 78 of file xv_select.c.
Referenced by direct_change_directory(), disable_change_directory(), and enable_change_directory().
bool wpips_change_directory_inactive_old |
Definition at line 79 of file xv_select.c.
Referenced by disable_change_directory(), enable_change_directory(), and restore_enable_change_directory_state().
bool wpips_close_workspace_menu_inactive |
To enable or disable the menu items generated by generate_module_menu():
Definition at line 73 of file xv_select.c.
Referenced by disable_workspace_close(), enable_workspace_close(), generate_workspace_menu(), and restore_enable_workspace_close_state().
bool wpips_close_workspace_menu_inactive_old |
Definition at line 74 of file xv_select.c.
Referenced by disable_workspace_close(), and restore_enable_workspace_close_state().
bool wpips_create_workspace_menu_inactive |
Definition at line 75 of file xv_select.c.
Referenced by disable_workspace_create_or_open(), enable_workspace_create_or_open(), and generate_workspace_menu().
bool wpips_delete_workspace_menu_inactive |
Definition at line 77 of file xv_select.c.
Referenced by disable_workspace_delete_or_open(), enable_workspace_delete_or_open(), and generate_workspace_menu().
bool wpips_open_workspace_menu_inactive |
Definition at line 76 of file xv_select.c.
Referenced by disable_workspace_delete_or_open(), enable_workspace_delete_or_open(), and generate_workspace_menu().