PIPS
|
#include <stdio.h>
#include <stdlib.h>
#include <unistd.h>
#include <sys/time.h>
#include <sys/resource.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 "resources.h"
#include "preprocessor.h"
#include <gtk/gtk.h>
#include "gpips.h"
Go to the source code of this file.
Enumerations | |
enum | { GPIPS_MAX_MODULE_MENU_SIZE = 50 } |
Maximum size of the module menu of the main frame: More... | |
Functions | |
success | close_workspace_notify (GtkWidget *widget, gpointer data) |
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: More... | |
success | end_directory_notify (const char *dir) |
void | end_directory_text_notify (GtkWidget *text_item, gpointer data) |
void | direct_change_directory () |
FC: uses an external wish script I do not know how to activate this function safely... More... | |
GtkWidget * | generate_directory_menu () |
void | prompt_user_not_allowed_to_change_directory (GtkWidget *widget, gpointer data) |
void | start_directory_notify (GtkWidget *widget, gpointer data) |
void | enable_change_directory () |
void | disable_change_directory () |
static void | restore_enable_change_directory_state () |
void | disable_workspace_create_or_open () |
void | enable_workspace_create_or_open () |
void | disable_workspace_delete_or_open () |
void | enable_workspace_delete_or_open () |
void | disable_workspace_close () |
void | enable_workspace_close () |
void | restore_enable_workspace_close_state () |
void | disable_module_selection () |
void | enable_module_selection () |
void | end_delete_workspace_notify (const char *name) |
void | cancel_delete_workspace_notify () |
void | start_delete_workspace_notify (GtkWidget *widget, gpointer data) |
void | start_create_workspace_notify (GtkWidget *widget, gpointer data) |
void | cancel_create_workspace_notify (GtkWidget *widget, gpointer data) |
success | continue_create_workspace_notify (const char *name) |
void | user_prompt_not_a_valid_workspace_name (const char *workspace_name) |
void | end_create_workspace_notify (gen_array_t files) |
void | end_open_workspace_notify (const char *name) |
void | cancel_open_workspace_notify () |
void | open_workspace_notify (GtkWidget *widget, gpointer data) |
void | open_or_create_workspace (const char *workspace_name_original) |
To be used with schoose_create_abbrev_menu_with_text from the main panel: More... | |
void | select_workspace_notify (GtkWidget *w, gpointer data __attribute__((unused))) |
GtkWidget * | generate_workspace_menu () |
To use with schoose_create_abbrev_menu_with_text: More... | |
void | end_select_module_callback (const char *name) |
void | cancel_select_module_notify (void) |
void | select_module_from_menubar_callback (GtkWidget *widget, gpointer data) |
static void | select_module_from_status_menu_callback (GtkWidget *widget, gpointer data __attribute__((unused))) |
GtkWidget * | generate_module_menu () |
participe à la génération du menu associés aux modules dans la fenetre principale More... | |
void | create_select_menu () |
Variables | |
GtkWidget * | directory_menu_item |
static GtkWidget * | create_menu_item |
static GtkWidget * | open_menu_item |
static GtkWidget * | close_menu_item |
static GtkWidget * | module_menu_item |
bool | gpips_close_workspace_menu_inactive |
To enable or disable the menu items generated by generate_module_menu(): More... | |
bool | gpips_close_workspace_menu_inactive_old |
bool | gpips_create_workspace_menu_inactive |
bool | gpips_open_workspace_menu_inactive |
bool | gpips_delete_workspace_menu_inactive |
bool | gpips_change_directory_inactive |
bool | gpips_change_directory_inactive_old |
anonymous enum |
Maximum size of the module menu of the main frame:
Enumerator | |
---|---|
GPIPS_MAX_MODULE_MENU_SIZE |
Definition at line 62 of file gtk_select.c.
void cancel_create_workspace_notify | ( | GtkWidget * | widget, |
gpointer | data | ||
) |
enable the rights (in the gui) to create or open a workspace :
Definition at line 357 of file gtk_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 305 of file gtk_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 502 of file gtk_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 720 of file gtk_select.c.
Referenced by select_module_from_menubar_callback().
success close_workspace_notify | ( | GtkWidget * | widget, |
gpointer | data | ||
) |
The close has been successful:
It is the only place to enable a directory change, after a close workspace:
Definition at line 537 of file gtk_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_gpips_hpfc_hack_for_fabien_and_from_fabien(), schoose_window, 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 | ( | const 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.
Only one Fortran program: use it without user confirmation.
Memory leak if mchoose exit...
If it failed, cancel the creation:
Definition at line 366 of file gtk_select.c.
References cancel_create_workspace_notify(), concatenate(), disable_workspace_create_or_open(), end_create_workspace_notify(), gen_array_full_free(), gen_array_item(), gen_array_make(), gen_array_nitems(), log_window, mchoose(), pips_get_fortran_list(), prompt_user(), user_log(), user_prompt_not_a_valid_workspace_name(), workspace_exists_p(), workspace_name_entry, and workspace_name_p().
Referenced by open_or_create_workspace(), and start_create_workspace_notify().
void create_select_menu | ( | ) |
Definition at line 788 of file gtk_select.c.
References close_menu_item, close_workspace_notify(), create_menu_item, directory_menu_item, main_window_menu_bar, module_menu_item, open_menu_item, open_workspace_notify(), select_module_from_menubar_callback(), start_create_workspace_notify(), and start_directory_notify().
Referenced by create_menus().
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 126 of file gtk_select.c.
References concatenate(), end_directory_notify(), free(), get_cwd(), gpips_change_directory_inactive, MAXPATHLEN, safe_fclose(), safe_fopen(), safe_system(), and strdup().
Referenced by cd_notify().
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 186 of file gtk_select.c.
References directory_menu_item, directory_name_entry, gpips_change_directory_inactive, gpips_change_directory_inactive_old, and prompt_user_not_allowed_to_change_directory().
Referenced by end_create_workspace_notify(), end_open_workspace_notify(), execute_workspace_creation_and_so_on_given_with_options(), 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 253 of file gtk_select.c.
References disable_compile_selection(), disable_option_selection(), disable_transform_selection(), disable_view_selection(), module_menu_item, and module_name_entry.
Referenced by close_workspace_notify(), gpips_main(), and wpips_main().
void disable_workspace_close | ( | ) |
Definition at line 234 of file gtk_select.c.
References close_menu_item, gpips_close_workspace_menu_inactive, and gpips_close_workspace_menu_inactive_old.
Referenced by close_workspace_notify(), gpips_main(), start_delete_workspace_notify(), user_prompt_not_a_valid_workspace_name(), and wpips_main().
void disable_workspace_create_or_open | ( | ) |
Definition at line 206 of file gtk_select.c.
References create_menu_item, gpips_create_workspace_menu_inactive, open_menu_item, and workspace_name_entry.
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 220 of file gtk_select.c.
References gpips_delete_workspace_menu_inactive, gpips_open_workspace_menu_inactive, and workspace_name_entry.
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 173 of file gtk_select.c.
References directory_menu_item, directory_name_entry, end_directory_text_notify(), gpips_change_directory_inactive, and gpips_change_directory_inactive_old.
Referenced by cancel_create_workspace_notify(), cancel_open_workspace_notify(), close_workspace_notify(), end_create_workspace_notify(), gpips_main(), restore_enable_change_directory_state(), user_prompt_not_a_valid_workspace_name(), and wpips_main().
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 262 of file gtk_select.c.
References enable_compile_selection(), enable_option_selection(), enable_transform_selection(), enable_view_selection(), module_menu_item, and module_name_entry.
Referenced by end_create_workspace_notify(), end_open_workspace_notify(), and execute_workspace_creation_and_so_on_given_with_options().
void enable_workspace_close | ( | ) |
Definition at line 242 of file gtk_select.c.
References close_menu_item, and gpips_close_workspace_menu_inactive.
Referenced by end_create_workspace_notify(), end_open_workspace_notify(), and execute_workspace_creation_and_so_on_given_with_options().
void enable_workspace_create_or_open | ( | ) |
Definition at line 213 of file gtk_select.c.
References create_menu_item, gpips_create_workspace_menu_inactive, open_menu_item, and workspace_name_entry.
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(), execute_workspace_creation_and_so_on_given_with_options(), gpips_main(), user_prompt_not_a_valid_workspace_name(), and wpips_main().
void enable_workspace_delete_or_open | ( | ) |
Definition at line 228 of file gtk_select.c.
References gpips_delete_workspace_menu_inactive, gpips_open_workspace_menu_inactive, and workspace_name_entry.
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:
The creation failed:
Definition at line 440 of file gtk_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(), show_workspace(), user_prompt_not_a_valid_workspace_name(), workspace_name_entry, workspace_name_p(), and workspace_name_to_create.
Referenced by continue_create_workspace_notify().
void end_delete_workspace_notify | ( | const char * | name | ) |
Definition at line 276 of file gtk_select.c.
References close_workspace_notify(), concatenate(), db_get_current_workspace_name(), delete_workspace(), display_memory_usage(), enable_workspace_create_or_open(), enable_workspace_delete_or_open(), log_window, restore_enable_change_directory_state(), restore_enable_workspace_close_state(), and schoose_close().
Referenced by start_delete_workspace_notify().
success end_directory_notify | ( | const char * | dir | ) |
if (dir != NULL) {
Definition at line 103 of file gtk_select.c.
References pips_change_directory(), prompt_user(), show_directory(), and user_log().
Referenced by create_status_subwindow(), direct_change_directory(), end_directory_notify_callback(), end_directory_text_notify(), generate_a_directory_menu_notify(), and start_directory_notify().
void end_directory_text_notify | ( | GtkWidget * | text_item, |
gpointer | data | ||
) |
Definition at line 119 of file gtk_select.c.
References end_directory_notify().
Referenced by enable_change_directory().
void end_open_workspace_notify | ( | const char * | name | ) |
Definition at line 485 of file gtk_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(), and show_workspace().
Referenced by open_or_create_workspace(), and open_workspace_notify().
void end_select_module_callback | ( | const char * | name | ) |
Definition at line 691 of file gtk_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_module_entry(), execute_workspace_creation_and_so_on_given_with_options(), select_a_module_by_default(), select_module_from_menubar_callback(), and select_module_from_status_menu_callback().
GtkWidget* generate_directory_menu | ( | ) |
Definition at line 153 of file gtk_select.c.
References generate_a_directory_menu(), and get_cwd().
Referenced by create_status_subwindow().
GtkWidget* generate_module_menu | ( | ) |
participe à la génération du menu associés aux modules dans la fenetre principale
Definition at line 749 of file gtk_select.c.
References db_get_current_workspace_name(), db_get_module_list(), gen_array_full_free(), gen_array_item(), gen_array_nitems(), module_menu_item, and select_module_from_status_menu_callback().
Referenced by create_status_subwindow(), and regenerate_module_menu_callback().
GtkWidget* 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:
Now complete with the list of the workspaces:
Well, since there is no workspace, there is nothing to delete...
Definition at line 625 of file gtk_select.c.
References close_workspace_notify(), gen_array_full_free(), gen_array_item(), gen_array_make(), gen_array_nitems(), gpips_close_workspace_menu_inactive, gpips_create_workspace_menu_inactive, gpips_delete_workspace_menu_inactive, gpips_open_workspace_menu_inactive, pips_get_workspace_list(), select_workspace_notify(), start_create_workspace_notify(), and start_delete_workspace_notify().
Referenced by create_status_subwindow(), and regenerate_workspace_menu_callback().
void open_or_create_workspace | ( | const 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 570 of file gtk_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().
Referenced by create_status_subwindow(), and open_or_create_workspace_callback().
void open_workspace_notify | ( | GtkWidget * | widget, |
gpointer | data | ||
) |
There is only workspace: open it without asking confirmation to the user:
Choix initial sur le workspace courant si possible :
Definition at line 508 of file gtk_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 | ( | GtkWidget * | widget, |
gpointer | data | ||
) |
First untype whatever the user typed:
Definition at line 157 of file gtk_select.c.
References prompt_user(), and show_directory().
Referenced by disable_change_directory(), and start_directory_notify().
|
static |
Definition at line 199 of file gtk_select.c.
References disable_change_directory(), enable_change_directory(), and gpips_change_directory_inactive_old.
Referenced by cancel_delete_workspace_notify(), and end_delete_workspace_notify().
void restore_enable_workspace_close_state | ( | ) |
Definition at line 248 of file gtk_select.c.
References gpips_close_workspace_menu_inactive, and gpips_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 83 of file gtk_select.c.
References db_get_current_module_name(), end_select_module_callback(), 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_from_menubar_callback | ( | GtkWidget * | widget, |
gpointer | data | ||
) |
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 723 of file gtk_select.c.
References cancel_select_module_notify(), db_get_current_module_name(), db_get_module_list(), end_select_module_callback(), gen_array_full_free(), gen_array_nitems(), prompt_user(), and schoose().
Referenced by create_select_menu().
|
static |
Definition at line 741 of file gtk_select.c.
References end_select_module_callback(), gpips_gtk_menu_item_get_label(), module_name(), and module_name_entry.
Referenced by generate_module_menu().
void select_workspace_notify | ( | GtkWidget * | w, |
gpointer data | __attribute__(unused) | ||
) |
Definition at line 618 of file gtk_select.c.
References gpips_gtk_menu_item_get_label(), and workspace_name_entry.
Referenced by generate_workspace_menu().
void start_create_workspace_notify | ( | GtkWidget * | widget, |
gpointer | data | ||
) |
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 337 of file gtk_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 | ( | GtkWidget * | widget, |
gpointer | data | ||
) |
current workspace as default choice :
Definition at line 313 of file gtk_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 | ( | GtkWidget * | widget, |
gpointer | data | ||
) |
Definition at line 165 of file gtk_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 | ( | const char * | workspace_name | ) |
Definition at line 432 of file gtk_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 68 of file gtk_select.c.
Referenced by create_select_menu(), disable_workspace_close(), and enable_workspace_close().
|
static |
Definition at line 68 of file gtk_select.c.
Referenced by create_select_menu(), disable_workspace_create_or_open(), and enable_workspace_create_or_open().
GtkWidget* directory_menu_item |
Definition at line 66 of file gtk_select.c.
Referenced by create_select_menu(), disable_change_directory(), and enable_change_directory().
bool gpips_change_directory_inactive |
Definition at line 78 of file gtk_select.c.
Referenced by direct_change_directory(), disable_change_directory(), and enable_change_directory().
bool gpips_change_directory_inactive_old |
Definition at line 79 of file gtk_select.c.
Referenced by disable_change_directory(), enable_change_directory(), and restore_enable_change_directory_state().
bool gpips_close_workspace_menu_inactive |
To enable or disable the menu items generated by generate_module_menu():
Definition at line 74 of file gtk_select.c.
Referenced by disable_workspace_close(), enable_workspace_close(), generate_workspace_menu(), and restore_enable_workspace_close_state().
bool gpips_close_workspace_menu_inactive_old |
Definition at line 75 of file gtk_select.c.
Referenced by disable_workspace_close(), and restore_enable_workspace_close_state().
bool gpips_create_workspace_menu_inactive |
Definition at line 76 of file gtk_select.c.
Referenced by disable_workspace_create_or_open(), enable_workspace_create_or_open(), and generate_workspace_menu().
bool gpips_delete_workspace_menu_inactive |
Definition at line 78 of file gtk_select.c.
Referenced by disable_workspace_delete_or_open(), enable_workspace_delete_or_open(), and generate_workspace_menu().
bool gpips_open_workspace_menu_inactive |
Definition at line 77 of file gtk_select.c.
Referenced by disable_workspace_delete_or_open(), enable_workspace_delete_or_open(), and generate_workspace_menu().
|
static |
Definition at line 69 of file gtk_select.c.
Referenced by create_select_menu(), disable_module_selection(), enable_module_selection(), and generate_module_menu().
|
static |
Definition at line 68 of file gtk_select.c.
Referenced by create_select_menu(), disable_workspace_create_or_open(), and enable_workspace_create_or_open().