PIPS
|
#include <stdlib.h>
#include <stdio.h>
#include <string.h>
#include <sys/time.h>
#include <sys/resource.h>
#include "genC.h"
#include "linear.h"
#include "ri.h"
#include "top-level.h"
#include "database.h"
#include "misc.h"
#include "ri-util.h"
#include "pipsdbm.h"
#include "pipsmake.h"
#include "complexity_ri.h"
#include "constants.h"
#include "resources.h"
#include "properties.h"
#include <gtk/gtk.h>
#include "gpips.h"
Go to the source code of this file.
Data Structures | |
struct | option_type |
lint More... | |
struct | LabelAndVbox |
Enumerations | |
enum | { BSIZE_HERE = 256 } |
Functions | |
string | hash_get_key_by_value (hash_table htp, string svp) |
returns the first key which value is svp. More... | |
void | apply_on_each_options_menu_item (GtkWidget *widget, gpointer _func) |
void | apply_on_each_options_frame_choice (GtkWidget *widget, gpointer _func) |
void | apply_on_each_option_item (void(*function_to_apply_on_each_menu_item)(GtkWidget *), void(*function_to_apply_on_each_frame_choice)(GtkWidget *)) |
void | disable_option_selection () |
void | enable_option_selection () |
void | update_options () |
void | options_select (const char *aliased_phase) |
void | options_combo_box_change_callback (GtkWidget *item, gpointer data __attribute__((unused))) |
"value" is already used for a typedef... More... | |
void | options_frame_to_view_menu_gateway (GtkWidget *widget, gpointer data __attribute__((unused))) |
void | options_menu_callback (GtkWidget *widget, gpointer data __attribute__((unused))) |
static int | compare_option_type_for_qsort (const void *x, const void *y) |
The function used by qsort to compare 2 option_type structures according to their name string: More... | |
static void | synch_viewmenu_and_opframe_search_in_view (GtkWidget *widget, gpointer data) |
static void | synch_viewmenu_and_opframe (GtkWidget *widget, gpointer data) |
void | build_options_menu_and_panel (GtkWidget *menu_options, GtkWidget *frame_vbox) |
Build the option menu by looking at the pipsmake.rc file and searching if there are several way to build a ressource: More... | |
void | build_aliases () |
Construct a table linking PIPS phase name to more human names, the aliases defined in pipsmake-rc.tex. More... | |
void | display_or_hide_options_frame (GtkWidget *menu_item, gpointer data) |
static void | options_window_done_procedure (GtkWidget *window, gpointer data) |
Hide and restore the menu item to reopen the option panel: More... | |
void | create_options_menu_and_window () |
Variables | |
char | vcid_xv_props [] = "$Id: gtk_props.c 23065 2016-03-02 09:05:50Z coelho $" |
static GtkWidget * | smenu_options |
static GtkWidget * | options_menu |
static GtkWidget * | options_menu_item |
static GtkWidget * | options_frame_menu_item |
GtkWidget * | options_frame |
static hash_table | aliases |
static hash_table | menu_item_to_combo_box |
static char | display_options_panel [] = "Options panel..." |
static char | hide_options_panel [] = "Hide options panel" |
int | verbose_update_options = 1 |
Flag allowing update_options also to select a option : More... | |
anonymous enum |
Enumerator | |
---|---|
BSIZE_HERE |
Definition at line 75 of file gtk_props.c.
void apply_on_each_option_item | ( | void(*)(GtkWidget *) | function_to_apply_on_each_menu_item, |
void(*)(GtkWidget *) | function_to_apply_on_each_frame_choice | ||
) |
Walk through items of options_menu
Now walk through the options frame:
Definition at line 116 of file gtk_props.c.
References apply_on_each_options_frame_choice(), apply_on_each_options_menu_item(), options_frame, and options_menu.
Referenced by disable_option_selection(), and enable_option_selection().
void apply_on_each_options_frame_choice | ( | GtkWidget * | widget, |
gpointer | _func | ||
) |
Definition at line 109 of file gtk_props.c.
Referenced by apply_on_each_option_item().
void apply_on_each_options_menu_item | ( | GtkWidget * | widget, |
gpointer | _func | ||
) |
Definition at line 98 of file gtk_props.c.
References display_options_panel, gpips_gtk_menu_item_get_label(), and hide_options_panel.
Referenced by apply_on_each_option_item().
void build_aliases | ( | ) |
Construct a table linking PIPS phase name to more human names, the aliases defined in pipsmake-rc.tex.
Definition at line 461 of file gtk_props.c.
References aliases, BSIZE_HERE, buffer, fopen_config(), hash_get(), hash_put(), hash_string, hash_table_make(), HASH_UNDEFINED_VALUE, pips_internal_error, safe_fclose(), strdup(), and strupper().
Referenced by create_options_menu_and_window().
void build_options_menu_and_panel | ( | GtkWidget * | menu_options, |
GtkWidget * | frame_vbox | ||
) |
Build the option menu by looking at the pipsmake.rc file and searching if there are several way to build a ressource:
The option panel use the definition of the edit menu and so needs to be created after it:
walking thru rules
walking thru resources made by this particular rule
walking thru phase_by_made_htp
First, try to do some measurements on the options item to be able to sort and align menu items later:
Now generate an array of the Options:
Sort the Options:
Create the Options in the Option menu and option panel:
Create the sub-menu entry of an option:
PANEL_CLIENT_DATA is used to link the PANEL_CHOICE_STACK to its dual MENU_PULLRIGHT. RK, 11/06/1993.
Add a sub-option entry in the menu:
Attach the sub-menu to an Option menu:
... And in the Option panel:
According to a suggestion from Guillaume Oget, it should be nice to be able to select a view also from the Option panel:
Definition at line 324 of file gtk_props.c.
References aliases, CAR, option_type::choices, compare_option_type_for_qsort(), CONS, gen_length(), gen_nconc(), hash_get(), hash_get_key_by_value(), HASH_MAP, hash_pointer, hash_put(), hash_string, hash_table_make(), HASH_UNDEFINED_VALUE, makefile_rules, malloc(), MAPL, menu_item_to_combo_box, option_type::name, NIL, options_combo_box_change_callback(), options_frame, options_menu_callback(), parse_makefile(), RULE, rule_phase, rule_produced, smenu_options, STRING, synch_viewmenu_and_opframe(), LabelAndVbox::vbox, VIRTUAL_RESOURCE, and virtual_resource_name.
Referenced by create_options_menu_and_window().
|
static |
The function used by qsort to compare 2 option_type structures according to their name string:
Definition at line 284 of file gtk_props.c.
References x.
Referenced by build_options_menu_and_panel().
void create_options_menu_and_window | ( | ) |
Trap the FRAME_DONE event:
Definition at line 516 of file gtk_props.c.
References build_aliases(), build_options_menu_and_panel(), display_options_panel, display_or_hide_options_frame(), main_window_menu_bar, options_frame, options_frame_menu_item, options_menu, options_menu_item, options_window, and options_window_done_procedure().
Referenced by create_menus().
void disable_option_selection | ( | ) |
Definition at line 130 of file gtk_props.c.
References apply_on_each_option_item(), and disable_item().
Referenced by disable_module_selection(), gpips_main(), and wpips_main().
void display_or_hide_options_frame | ( | GtkWidget * | menu_item, |
gpointer | data | ||
) |
Should be added : when the options panel is destroyed by the window manager, toggle the menu. RK, 7/6/93.
Definition at line 492 of file gtk_props.c.
References display_options_panel, gpips_gtk_menu_item_get_label(), gpips_gtk_menu_item_set_label(), hide_options_panel, hide_window(), and options_window.
Referenced by create_options_menu_and_window().
void enable_option_selection | ( | ) |
Definition at line 134 of file gtk_props.c.
References apply_on_each_option_item(), and enable_item().
Referenced by enable_module_selection().
string hash_get_key_by_value | ( | hash_table | htp, |
string | svp | ||
) |
returns the first key which value is svp.
when not found, returns NULL
Definition at line 89 of file gtk_props.c.
References HASH_MAP, and HASH_UNDEFINED_VALUE.
Referenced by build_options_menu_and_panel(), and update_options().
void options_combo_box_change_callback | ( | GtkWidget * | item, |
gpointer data | __attribute__(unused) | ||
) |
"value" is already used for a typedef...
:-) RK, 11/06/1993.
Definition at line 265 of file gtk_props.c.
References options_select().
Referenced by build_options_menu_and_panel().
void options_frame_to_view_menu_gateway | ( | GtkWidget * | widget, |
gpointer data | __attribute__(unused) | ||
) |
Definition at line 272 of file gtk_props.c.
References gpips_execute_and_display_something_from_alias().
Referenced by synch_viewmenu_and_opframe_search_in_view().
void options_menu_callback | ( | GtkWidget * | widget, |
gpointer data | __attribute__(unused) | ||
) |
Definition at line 277 of file gtk_props.c.
References gpips_gtk_menu_item_get_label(), and options_select().
Referenced by build_options_menu_and_panel().
void options_select | ( | const char * | aliased_phase | ) |
To have the options panel consistent with the real phase set : RK, 05/07/1993.
Definition at line 243 of file gtk_props.c.
References activate(), aliases, db_get_current_workspace_name(), debug_off, debug_on, hash_get(), HASH_UNDEFINED_VALUE, pips_internal_error, prompt_user(), update_options(), user_log(), and verbose_update_options.
Referenced by options_combo_box_change_callback(), and options_menu_callback().
|
static |
Hide and restore the menu item to reopen the option panel:
Definition at line 510 of file gtk_props.c.
References display_options_panel, gpips_gtk_menu_item_set_label(), hide_window(), options_frame_menu_item, and options_window.
Referenced by create_options_menu_and_window().
|
static |
Definition at line 304 of file gtk_props.c.
References LabelAndVbox::label, LabelAndVbox::position, synch_viewmenu_and_opframe_search_in_view(), LabelAndVbox::vbox, and view_menu.
Referenced by build_options_menu_and_panel().
|
static |
Definition at line 288 of file gtk_props.c.
References gpips_gtk_menu_item_get_label(), LabelAndVbox::label, options_frame_to_view_menu_gateway(), LabelAndVbox::position, and LabelAndVbox::vbox.
Referenced by synch_viewmenu_and_opframe().
void update_options | ( | ) |
walk through items of menu_options
It must be the pin item, or the item controlling the options panel. RK, 4/06/1993.
find special prop menu containing item corresponding to active phase
find active phase which produces resource res_true_n
There is no alias for currently selected phase: phase_true_n We have to activate another phase
walk through items of special_prop_m to select the activated one
Update the dual options panel entry :
Definition at line 138 of file gtk_props.c.
References activate(), aliases, debug(), debug_off, debug_on, display_memory_usage(), display_options_panel, find_rule_by_resource(), gpips_gtk_menu_item_get_label(), hash_get(), hash_get_key_by_value(), HASH_UNDEFINED_VALUE, hide_options_panel, menu_item_to_combo_box, pips_internal_error, rule_phase, smenu_options, user_log(), user_warning, and verbose_update_options.
Referenced by gpips_main(), options_select(), and wpips_main().
|
static |
Definition at line 69 of file gtk_props.c.
Referenced by bsd_rewrite(), build_aliases(), build_options_menu_and_panel(), options_select(), and update_options().
|
static |
Definition at line 72 of file gtk_props.c.
Referenced by apply_on_each_options_menu_item(), create_options_menu_and_window(), display_or_hide_options_frame(), options_window_done_procedure(), and update_options().
|
static |
Definition at line 73 of file gtk_props.c.
Referenced by apply_on_each_options_menu_item(), display_or_hide_options_frame(), and update_options().
|
static |
Definition at line 70 of file gtk_props.c.
Referenced by build_options_menu_and_panel(), and update_options().
GtkWidget* options_frame |
Definition at line 67 of file gtk_props.c.
Referenced by apply_on_each_option_item(), apply_on_each_view_item(), build_options_menu_and_panel(), create_frames(), create_options_menu_and_window(), display_or_hide_options_panel(), options_frame_done_procedure(), and place_frames().
|
static |
Definition at line 66 of file gtk_props.c.
Referenced by create_options_menu_and_window(), and options_window_done_procedure().
|
static |
Definition at line 65 of file gtk_props.c.
Referenced by apply_on_each_option_item(), and create_options_menu_and_window().
|
static |
Definition at line 65 of file gtk_props.c.
Referenced by create_options_menu_and_window().
|
static |
Definition at line 64 of file gtk_props.c.
Referenced by build_options_menu_and_panel(), and update_options().
char vcid_xv_props[] = "$Id: gtk_props.c 23065 2016-03-02 09:05:50Z coelho $" |
Definition at line 29 of file gtk_props.c.
int verbose_update_options = 1 |
Flag allowing update_options also to select a option :
Definition at line 86 of file gtk_props.c.
Referenced by options_select(), and update_options().