PIPS
|
#include <stdio.h>
#include <stdlib.h>
#include <sys/time.h>
#include <sys/resource.h>
#include <xview/xview.h>
#include <xview/panel.h>
#include <xview/svrimage.h>
#include "genC.h"
#include "linear.h"
#include "ri.h"
#include "database.h"
#include "misc.h"
#include "ri-util.h"
#include "pipsdbm.h"
#include "constants.h"
#include "resources.h"
#include "pipsmake.h"
#include "top-level.h"
#include "wpips.h"
#include "xv_sizes.h"
#include "pips.icon"
Go to the source code of this file.
Enumerations | |
enum | { WPIPS_NUMBER_OF_EVENT_TO_DEAL_DURING_PIPSMAKE_INTERPHASE = 10 } |
How much to call the notifyer between each pipsmake phase: More... | |
Functions | |
static void | create_menus () |
void | main_event_proc (Xv_Window window, Event *event) |
void | create_main_window () |
void | create_icon () |
static void | wpips_parse_arguments (int argc, char *argv[]) |
Try to parse the WPips arguments. More... | |
static void | execute_workspace_creation_and_so_on_given_with_options (void) |
Execute some actions asked as option after XView initialization: More... | |
static bool | deal_with_wpips_events_during_pipsmake () |
Since XView is not called while pipsmake is running, explicitly run a hook from pipsmake to run the notifyer such as to stop pipsmake: More... | |
void | wpips_interrupt_pipsmake (Panel_item item, Event *event) |
To ask pipsmake to stop as soon as possible: More... | |
static int | wpips_xview_error (Xv_object object, Attr_avlist avlist) |
Try to inform the user about an XView error. More... | |
void | execute_main_loop_command (wpips_main_loop_command_type command) |
Exit the notify loop to execute a WPips command: More... | |
static void | wpips_main_loop (Frame frame_to_map_first) |
The main loop that deals with command outside the XView notifyer: More... | |
int | wpips_main (int argc, char *argv[]) |
Variables | |
Frame | main_frame |
If we are in the Emacs mode, the log_frame is no longer really used: More... | |
Frame | schoose_frame |
Frame | mchoose_frame |
Frame | log_frame |
Frame | edit_frame [MAX_NUMBER_OF_WPIPS_WINDOWS] |
Frame | help_frame |
Frame | query_frame |
Frame | options_frame |
Panel | main_panel |
Panel | status_panel |
Panel | query_panel |
Panel | mchoose_panel |
Panel | schoose_panel |
Panel | help_panel |
static wpips_main_loop_command_type | wpips_main_loop_command = WPIPS_EXIT |
The variables to pass information between inside and outside the XView notifyer: More... | |
static string | workspace_name_given_to_wpips = NULL |
To deal with argument parsing: More... | |
static string | module_name_given_to_wpips = NULL |
static gen_array_t | files_given_to_wpips = NULL |
static int | first_mapping = TRUE |
static unsigned short | pips_bits [] |
anonymous enum |
How much to call the notifyer between each pipsmake phase:
Enumerator | |
---|---|
WPIPS_NUMBER_OF_EVENT_TO_DEAL_DURING_PIPSMAKE_INTERPHASE |
Definition at line 272 of file wpips.c.
void create_icon | ( | ) |
Definition at line 157 of file wpips.c.
References int, main_frame, and pips_bits.
void create_main_window | ( | ) |
Xv_window main_window;
The following mask is necessary to avoid that key events occure twice.
main_window = (Xv_Window) xv_find(main_frame, WINDOW, 0); xv_set(main_window, WIN_IGNORE_EVENT, WIN_UP_ASCII_EVENTS, NULL);
commented out as we shifted to xview.3, 92.04
xv_set(canvas_paint_window(main_panel), WIN_IGNORE_EVENT, WIN_UP_ASCII_EVENTS, WIN_CONSUME_EVENT, 32526, WIN_EVENT_PROC, main_event_proc, NULL);
Definition at line 129 of file wpips.c.
References main_frame, and main_panel.
Referenced by wpips_main().
|
static |
The option panel use the definition of the edit menu and so needs to be create after it:
Gone in create_menus_end(): ...No !
In the Emacs mode, no XView log window:
In fact, create it but disabled to keep the same frame layout:
Definition at line 85 of file wpips.c.
References create_compile_menu(), create_edit_menu(), create_help_menu(), create_log_menu(), create_options_menu_and_window(), create_quit_button(), create_select_menu(), and create_transform_menu().
Referenced by wpips_main().
|
static |
Since XView is not called while pipsmake is running, explicitly run a hook from pipsmake to run the notifyer such as to stop pipsmake:
First, try to show we are working :-)
Ask the XView notifyer to deal with one event.
Refresh the main frame:
pipsmake not interrupted by default:
Definition at line 279 of file wpips.c.
References main_frame, wpips_interrupt_button_blink(), and WPIPS_NUMBER_OF_EVENT_TO_DEAL_DURING_PIPSMAKE_INTERPHASE.
Referenced by wpips_main().
void execute_main_loop_command | ( | wpips_main_loop_command_type | command | ) |
Exit the notify loop to execute a WPips command:
I guess the function above does not return...
Definition at line 333 of file wpips.c.
References wpips_main_loop_command.
|
static |
Execute some actions asked as option after XView initialization:
It fails, Go on with the normal WPips behaviour...
It fails, Go on with the normal WPips behaviour...
It fails, Go on with the normal WPips behaviour...
Definition at line 236 of file wpips.c.
References create_workspace(), db_create_workspace(), disable_change_directory(), display_memory_usage(), enable_module_selection(), enable_workspace_close(), enable_workspace_create_or_open(), end_select_module_notify(), files_given_to_wpips, gen_array_free(), module_name_given_to_wpips, open_workspace(), show_module(), show_workspace(), and workspace_name_given_to_wpips.
Referenced by wpips_main().
void main_event_proc | ( | Xv_Window | window, |
Event * | event | ||
) |
we place all frames
Definition at line 115 of file wpips.c.
References first_mapping, and place_frames().
void wpips_interrupt_pipsmake | ( | Panel_item | item, |
Event * | event | ||
) |
To ask pipsmake to stop as soon as possible:
Definition at line 299 of file wpips.c.
References interrupt_pipsmake_asap(), and user_log().
Referenced by create_status_subwindow().
we parse command line arguments
XV_ERROR_PROC unset as we shifted to xview.3, Apr. 92
we parse remaining command line arguments
we create all frames
Create the edit/view windows only if we are not in the Emacs mode:
In the Emacs mode, no XView log window but we need it to compute the size of some other frames...
create_menus_end();
Call added. RK, 9/06/1993.
If we are in the emacs mode, initialize some things:
Definition at line 378 of file wpips.c.
References cc_version, close_log_file(), create_edit_window(), create_frames(), create_help_window(), create_icons(), create_log_window(), create_main_window(), create_mchoose_window(), create_menus(), create_query_window(), create_schoose_window(), create_status_subwindow(), deal_with_wpips_events_during_pipsmake(), debug_off, debug_on, disable_compile_selection(), disable_module_selection(), disable_option_selection(), disable_transform_selection(), disable_view_selection(), disable_workspace_close(), display_memory_usage(), enable_change_directory(), enable_workspace_create_or_open(), entity_local_name(), execute_workspace_creation_and_so_on_given_with_options(), exit, initialize_emacs_mode(), initialize_newgen(), initialize_sc(), main_frame, pips_checks(), pips_error_handler, pips_log_handler, pips_request_handler, pips_update_props_handler, pips_warning_handler, place_frames(), pop_pips_context(), push_pips_context(), reset_pipsmake_callback(), set_exception_callbacks(), set_pips_meta_informations(), set_pipsmake_callback(), soft_date, soft_revisions, update_options(), wpips_emacs_mode, wpips_main_loop(), wpips_parse_arguments(), wpips_user_error(), wpips_user_log(), wpips_user_request(), wpips_user_warning(), and wpips_xview_error().
|
static |
The main loop that deals with command outside the XView notifyer:
The loop to execute commands:
If the notifyer happen to exit without a specifyed command, just exit:
Restore the initial state of the blinking pips icon:
Wait again for something from X11 and emacs:
Definition at line 343 of file wpips.c.
References debug(), execute_safe_apply_outside_the_notifyer(), execute_wpips_execute_and_display_something_outside_the_notifyer(), pips_assert, WPIPS_EXECUTE_AND_DISPLAY, WPIPS_EXIT, wpips_interrupt_button_restore(), wpips_main_loop_command, and WPIPS_SAFE_APPLY.
Referenced by wpips_main().
|
static |
Try to parse the WPips arguments.
The problem is that the -emacs option need to be known early but the workspace and other typical PIPS options need to be evaluate later...
Should add a help and version option.
the one of getopt (3)
Wpips is called from emacs. RK.
lazy init
Definition at line 192 of file wpips.c.
References exit, files_given_to_wpips, fprintf(), gen_array_append(), gen_array_make(), module_name_given_to_wpips, optind, same_string_p, workspace_name_given_to_wpips, and wpips_emacs_mode.
Referenced by wpips_main().
|
static |
Try to inform the user about an XView error.
For debug, use the WPIPS_DEBUG_LEVEL to have an abort on this kind of error.
Cannot use pips_assert since it uses XView, neither get_bool_property for the same reason:
Definition at line 311 of file wpips.c.
References abort, debug_off, debug_on, fprintf(), and get_debug_level().
Referenced by wpips_main().
Frame edit_frame[MAX_NUMBER_OF_WPIPS_WINDOWS] |
|
static |
Definition at line 80 of file wpips.c.
Referenced by execute_workspace_creation_and_so_on_given_with_options(), and wpips_parse_arguments().
|
static |
Definition at line 113 of file wpips.c.
Referenced by main_event_proc().
Frame main_frame |
If we are in the Emacs mode, the log_frame is no longer really used:
Definition at line 54 of file wpips.c.
Referenced by continue_create_workspace_notify(), create_compile_menu(), create_edit_menu(), create_frames(), create_help_menu(), create_icon(), create_icons(), create_main_window(), create_options_menu_and_window(), create_schoose_window(), create_select_menu(), create_status_subwindow(), create_transform_menu(), deal_with_wpips_events_during_pipsmake(), end_delete_workspace_notify(), insert_something_in_the_wpips_log_window(), place_frames(), pointer_in_center_of_frame(), prompt_user(), quit_notify(), and wpips_main().
Panel main_panel |
Definition at line 63 of file wpips.c.
Referenced by create_analyze_menu(), create_compile_menu(), create_edit_menu(), create_help_menu(), create_log_menu(), create_main_window(), create_options_menu_and_window(), create_quit_button(), create_status_subwindow(), create_transform_menu(), and schoose_create_abbrev_menu_with_text().
|
static |
Definition at line 79 of file wpips.c.
Referenced by execute_workspace_creation_and_so_on_given_with_options(), and wpips_parse_arguments().
|
static |
|
static |
To deal with argument parsing:
Definition at line 78 of file wpips.c.
Referenced by execute_workspace_creation_and_so_on_given_with_options(), and wpips_parse_arguments().
|
static |
The variables to pass information between inside and outside the XView notifyer:
By default, exiting the notifyer is to exit wpips:
Definition at line 75 of file wpips.c.
Referenced by execute_main_loop_command(), and wpips_main_loop().