PIPS
gtk_props.c
Go to the documentation of this file.
1 /*
2 
3  $Id: gtk_props.c 23065 2016-03-02 09:05:50Z coelho $
4 
5  Copyright 1989-2016 MINES ParisTech
6 
7  This file is part of PIPS.
8 
9  PIPS is free software: you can redistribute it and/or modify it
10  under the terms of the GNU General Public License as published by
11  the Free Software Foundation, either version 3 of the License, or
12  any later version.
13 
14  PIPS is distributed in the hope that it will be useful, but WITHOUT ANY
15  WARRANTY; without even the implied warranty of MERCHANTABILITY or
16  FITNESS FOR A PARTICULAR PURPOSE.
17 
18  See the GNU General Public License for more details.
19 
20  You should have received a copy of the GNU General Public License
21  along with PIPS. If not, see <http://www.gnu.org/licenses/>.
22 
23 */
24 #ifdef HAVE_CONFIG_H
25  #include "pips_config.h"
26 #endif
27 
28 #ifndef lint
29 char vcid_xv_props[] = "$Id: gtk_props.c 23065 2016-03-02 09:05:50Z coelho $";
30 #endif /* lint */
31 
32 #include <stdlib.h>
33 #include <stdio.h>
34 #include <string.h>
35 
36 #include <sys/time.h>
37 #include <sys/resource.h>
38 
39 #include "genC.h"
40 #include "linear.h"
41 #include "ri.h"
42 #include "top-level.h"
43 #include "database.h"
44 
45 #include "misc.h"
46 #include "ri-util.h"
47 #include "pipsdbm.h"
48 #include "pipsmake.h"
49 #include "complexity_ri.h"
50 
51 #include "constants.h"
52 #include "resources.h"
53 #include "properties.h"
54 
55 #undef test_undefined // also defined in glib included from gtk
56 #include <gtk/gtk.h>
57 #include "gpips.h"
58 
59 typedef struct {
60  char *name;
62 } option_type;
63 
64 static GtkWidget * smenu_options;
65 static GtkWidget * options_menu, *options_menu_item;
66 static GtkWidget * options_frame_menu_item;
67 GtkWidget * options_frame;
68 
71 
72 static char display_options_panel[] = "Options panel...";
73 static char hide_options_panel[] = "Hide options panel";
74 
75 enum {
76  BSIZE_HERE = 256
77 };
78 
79 typedef struct {
80  const char * label; // label en court de traitement ds le frame option
81  int position; // position du dit label dans la vbox du frame option
82  GtkWidget * vbox; // Vbox du frame options
83 } LabelAndVbox;
84 
85 /* Flag allowing update_options also to select a option : */
87 
88 /* returns the first key which value is svp. when not found, returns NULL */
89 string hash_get_key_by_value(hash_table htp, string svp) {
90  HASH_MAP(kp, vp, {
91  if (strcmp(vp, svp) == 0)
92  return kp;
93  }, htp);
94 
95  return HASH_UNDEFINED_VALUE;
96 }
97 
98 void apply_on_each_options_menu_item(GtkWidget * widget, gpointer _func) {
99  void (*func)(GtkWidget *);
100  func = (void(*)(GtkWidget *)) _func;
101  const char * label;
102  label = gpips_gtk_menu_item_get_label(widget);
103  if (label == NULL || strcmp(label, display_options_panel) == 0 || strcmp(
104  label, hide_options_panel) == 0)
105  return;
106  func(widget);
107 }
108 
109 void apply_on_each_options_frame_choice(GtkWidget * widget, gpointer _func) {
110  void (*func)(GtkWidget *);
111  func = (void(*)(GtkWidget *)) _func;
112  if (GTK_IS_COMBO_BOX(widget))
113  func(widget);
114 }
115 
116 void apply_on_each_option_item(void(* function_to_apply_on_each_menu_item)(
117  GtkWidget *), void(* function_to_apply_on_each_frame_choice)(
118  GtkWidget *)) {
119  /* Walk through items of options_menu */
120  gtk_container_foreach(GTK_CONTAINER(options_menu), (GtkCallback)
122  function_to_apply_on_each_menu_item);
123 
124  /* Now walk through the options frame: */
125  gtk_container_foreach(GTK_CONTAINER(options_frame), (GtkCallback)
127  function_to_apply_on_each_frame_choice);
128 }
129 
132 }
133 
136 }
137 
139  gint i, j;
140  const char * child_resource_alias;
141  const char * phase_alias_n;
142  string res_true_n, phase_true_n;
143  GtkWidget * menu_options, *special_prop_menu;
144  GtkWidget *spm_item;
145 
146  debug_on("GPIPS_DEBUG_LEVEL");
147 
148  menu_options = smenu_options;
149 
150  /* walk through items of menu_options */
151  GtkWidget * child;
152  GList * menu_options_children = gtk_container_get_children(GTK_CONTAINER(
153  menu_options));
154  for (i = 0; i < g_list_length(menu_options_children); i++) {
155  child = (GtkWidget *) g_list_nth_data(menu_options_children, i);
156  if (!GTK_IS_MENU_ITEM(child))
157  continue;
158  if (GTK_IS_SEPARATOR(child))
159  continue;
160 
161  child_resource_alias = gpips_gtk_menu_item_get_label(child);
162  if (child_resource_alias == NULL || strcmp(child_resource_alias,
163  display_options_panel) == 0 || strcmp(child_resource_alias,
164  hide_options_panel) == 0)
165  /* It must be the pin item, or the item controlling the
166  options panel. RK, 4/06/1993. */
167  continue;
168 
169  if ((res_true_n = (string) hash_get(aliases, child_resource_alias))
171  pips_internal_error("Hash table aliases no more consistent\n");
172  // -------------
173 
174  /* find special prop menu containing item corresponding to active
175  phase*/
176  special_prop_menu = gtk_menu_item_get_submenu(GTK_MENU_ITEM(child));
177  // (Menu) xv_get(child, MENU_PULLRIGHT);
178 
179  GList * spm_children = gtk_container_get_children(GTK_CONTAINER(
180  special_prop_menu));
181  /* find active phase which produces resource res_true_n */
182  phase_true_n = rule_phase(find_rule_by_resource(res_true_n));
183  if ((phase_alias_n = hash_get_key_by_value(aliases, phase_true_n))
185  /* There is no alias for currently selected phase: phase_true_n
186  We have to activate another phase
187  */
188  gtk_menu_set_active(GTK_MENU(special_prop_menu), 0);
189  spm_item = (GtkWidget *) g_list_nth_data(spm_children, 0);
190  phase_alias_n = gpips_gtk_menu_item_get_label(spm_item);
191  user_warning(
192  "update_options",
193  "No alias available for selected phase `%s'; selecting `%s'\n",
194  phase_true_n, phase_alias_n);
195  phase_true_n = hash_get(aliases, phase_alias_n);
196  activate(phase_true_n);
197  // /* It does not seem to work (the doc does not talk about
198  // xv_set for MENU_SELECTED by the way...): */
199  // xv_set(special_prop_menu_item, MENU_SELECTED, TRUE, NULL);
200  // /* Then, try harder : */
201  // xv_set(special_prop_menu, MENU_DEFAULT_ITEM,
202  // special_prop_menu_item, NULL);
203  debug(2, "update_options",
204  "Rule `%s' selected to produce resource `%s'\n",
205  phase_alias_n, child_resource_alias);
206  } else {
207  /* walk through items of special_prop_m to select the activated
208  one */
209  for (j = g_list_length(spm_children) - 1; j >= 0; j--) {
210  const char * spm_item_label;
211  spm_item = (GtkWidget *) g_list_nth_data(spm_children, j);
212  if (!GTK_IS_MENU_ITEM(spm_item))
213  continue;
214  if (GTK_IS_SEPARATOR(spm_item))
215  continue;
216  spm_item_label = gpips_gtk_menu_item_get_label(spm_item);
217  debug(9, "update_options", "Menu item tested:\"%s\"\n",
218  spm_item_label);
219  if (strcmp(spm_item_label, phase_alias_n) == 0) {
220  gtk_menu_set_active(GTK_MENU(special_prop_menu), j);
221  /* Update the dual options panel entry : */
222  GtkWidget * combobox = hash_get(menu_item_to_combo_box,
223  special_prop_menu);
224  if (GTK_IS_COMBO_BOX(combobox))
225  gtk_combo_box_set_active(GTK_COMBO_BOX(combobox), j);
226 
228  user_log("Options: phase %s set on.\n", phase_alias_n);
229  debug(2, "update_options",
230  "Rule `%s' selected to produce resource `%s'\n",
231  phase_alias_n, child_resource_alias);
232  }
233  }
234  }
235  g_list_free(spm_children);
236  }
237  g_list_free(menu_options_children);
239 
240  debug_off();
241 }
242 
243 void options_select(const char * aliased_phase) {
244  string phase = hash_get(aliases, aliased_phase);
245 
246  if (phase == (string) HASH_UNDEFINED_VALUE) {
247  pips_internal_error("aliases badly managed !!!\n");
248  } else {
250  prompt_user("No workspace opened. Options not accounted.\n");
251  } else {
252  debug_on("GPIPS_DEBUG_LEVEL");
253  activate(phase);
254  debug_off();
255  user_log("Options: phase %s (%s) set on.\n", aliased_phase, phase);
256  }
257  }
258  /* To have the options panel consistent with the real phase set :
259  RK, 05/07/1993. */
261  update_options();
263 }
264 
265 void options_combo_box_change_callback(GtkWidget * item, gpointer data __attribute__((unused)))
266 /* "value" is already used for a typedef... :-) RK, 11/06/1993. */
267 {
268  char * aliased_phase = gtk_combo_box_get_active_text(GTK_COMBO_BOX(item));
269  options_select(aliased_phase);
270 }
271 
272 void options_frame_to_view_menu_gateway(GtkWidget * widget, gpointer data __attribute__((unused))) {
273  const gchar * label = gtk_button_get_label(GTK_BUTTON(widget));
275 }
276 
277 void options_menu_callback(GtkWidget * widget, gpointer data __attribute__((unused))) {
278  const char* aliased_phase = gpips_gtk_menu_item_get_label(widget);
279  options_select(aliased_phase);
280 }
281 
282 /* The function used by qsort to compare 2 option_type structures
283  according to their name string: */
284 static int compare_option_type_for_qsort(const void *x, const void *y) {
285  return strcmp(((option_type *) x)->name, ((option_type *) y)->name);
286 }
287 
288 static void synch_viewmenu_and_opframe_search_in_view(GtkWidget * widget,
289  gpointer data) {
290  LabelAndVbox * lav = (LabelAndVbox *) data;
291  GtkWidget * button;
292  if (GTK_IS_MENU_ITEM(widget)) {
293  // if the currently processed menu_item has got the same label than the currently processed option
294  if (strcmp(data, gpips_gtk_menu_item_get_label(widget)) == 0) {
295  button = gtk_button_new_with_label(lav->label); // creating a "link-button" toward View
296  gtk_box_pack_start(GTK_BOX(lav->vbox), button, FALSE, FALSE, 5); // packing
297  gtk_box_reorder_child(GTK_BOX(lav->vbox), button, lav->position + 1); // positioning
298  gtk_signal_connect(GTK_OBJECT(button), "clicked", GTK_SIGNAL_FUNC( // connecting
300  }
301  }
302 }
303 
304 static void synch_viewmenu_and_opframe(GtkWidget * widget, gpointer data) {
305  const char * label;
306  LabelAndVbox * lav = (LabelAndVbox *) data;
307 
308  if (GTK_IS_LABEL(widget)) {
309  label = gtk_label_get_text(GTK_LABEL(widget));
310  // on cherche ds le viewmenu un menu_item avec le même label
311  // si yen a un on rajoute un bouton
312  lav->label = label;
313  gtk_container_child_get_property(GTK_CONTAINER(lav->vbox), widget,
314  "position", (GValue*)&(lav->position));
315  gtk_container_foreach(GTK_CONTAINER(view_menu), (GtkCallback)
317  }
318 }
319 
320 /* Build the option menu by looking at the pipsmake.rc file and
321  searching if there are several way to build a ressource: */
322 /* The option panel use the definition of the edit menu and so needs
323  to be created after it: */
324 void build_options_menu_and_panel(GtkWidget * menu_options,
325  GtkWidget * frame_vbox) {
326  int i;
327  option_type *all_the_options;
328  makefile m = parse_makefile();
329  //int max_item_width = 0;
330 
331  int number_of_options = 0;
332  hash_table phase_by_made_htp = hash_table_make(hash_string, 0);
333  // attention on libÚre jamais la mémoire de la hash_table ci dessous
335 
336  smenu_options = menu_options;
337 
338  /* walking thru rules */
339  MAPL(pr, {
340  rule r = RULE(CAR(pr));
341 
342  /* walking thru resources made by this particular rule */
343  MAPL(pvr, {
345  string vrn = virtual_resource_name(vr);
346  list p = CONS(STRING, rule_phase(r), NIL);
347  list l = (list) hash_get(phase_by_made_htp, vrn);
348 
349  if ( l == (list) HASH_UNDEFINED_VALUE ) {
350  hash_put(phase_by_made_htp, vrn, (char *)p);
351  }
352  else {
353  (void) gen_nconc(l, p);
354  }
355  }, rule_produced(r));
356 
357  }, makefile_rules(m));
358 
359  /* walking thru phase_by_made_htp */
360 
361  /* First, try to do some measurements on the options item to be
362  able to sort and align menu items later: */
363  HASH_MAP(k, v, {
364  string alias1 = hash_get_key_by_value(aliases, k);
365  list l = (list) v;
366 
367  if ((alias1 != HASH_UNDEFINED_VALUE) && (gen_length(l) >= 2))
368  number_of_options++;
369  }, phase_by_made_htp);
370 
371  all_the_options = (option_type *) malloc(number_of_options
372  * sizeof(option_type));
373 
374  /* Now generate an array of the Options: */
375  i = 0;
376  HASH_MAP(k, v, {
377  string alias1 = hash_get_key_by_value(aliases, k);
378  list l = (list) v;
379 
380  if ((alias1 != HASH_UNDEFINED_VALUE) && (gen_length(l) >= 2)) {
381  all_the_options[i].name = alias1;
382  all_the_options[i].choices = l;
383  i++;
384  }
385  }, phase_by_made_htp);
386 
387  /* Sort the Options: */
388  qsort((char *) all_the_options, number_of_options, sizeof(option_type),
390 
391  /* Create the Options in the Option menu and option panel: */
392  GtkWidget * table = gtk_table_new(number_of_options, 2, TRUE);
393  gtk_box_pack_start(GTK_BOX(frame_vbox), table, TRUE, FALSE, 0);
394  for (i = 0; i < number_of_options; i++) {
395  GtkWidget * sub_menu_option, *sub_menu_option_item;
396  //GtkWidget * menu_options_item;
397  GtkWidget * choices_combobox;
398 
399  /* Create the sub-menu entry of an option: */
400  sub_menu_option = gtk_menu_new();
401  sub_menu_option_item = gtk_menu_item_new_with_label(
402  all_the_options[i].name);
403  gtk_menu_item_set_submenu(GTK_MENU_ITEM(sub_menu_option_item),
404  sub_menu_option);
405 
406 // g_signal_connect(GTK_OBJECT(sub_menu_option_item), "activate",
407 // G_CALLBACK(options_menu_callback), NULL);
408  gtk_menu_append(GTK_MENU(menu_options), sub_menu_option_item);
409 
410  /* PANEL_CLIENT_DATA is used to link the PANEL_CHOICE_STACK
411  to its dual MENU_PULLRIGHT. RK, 11/06/1993. */
412  choices_combobox = gtk_combo_box_new_text();
413  gtk_signal_connect(GTK_OBJECT(choices_combobox), "changed",
414  GTK_SIGNAL_FUNC(options_combo_box_change_callback), NULL);
415  gtk_table_attach_defaults(GTK_TABLE(table), gtk_label_new(
416  all_the_options[i].name), 0, 1, i, i + 1);
417  gtk_table_attach_defaults(GTK_TABLE(table), choices_combobox, 1, 2, i,
418  i + 1);
419 
420  GtkWidget * subsubmenu_option_item;
421  MAPL(vrn, {
422  string alias2 = hash_get_key_by_value(aliases,
423  STRING(CAR(vrn)));
424 
425  if (alias2 != HASH_UNDEFINED_VALUE) {
426  /* Add a sub-option entry in the menu: */
427  /* Attach the sub-menu to an Option menu: */
428  subsubmenu_option_item = gtk_menu_item_new_with_label(alias2);
429  gtk_menu_append(GTK_MENU(sub_menu_option), subsubmenu_option_item);
430  g_signal_connect(GTK_OBJECT(subsubmenu_option_item), "activate",
431  G_CALLBACK(options_menu_callback), NULL);
432 
433  /* ... And in the Option panel: */
434  gtk_combo_box_append_text(GTK_COMBO_BOX(choices_combobox), alias2);
435  }
436  }, all_the_options[i].choices);
437 
438  // on indique la combobox associée à sub_menu_option menu dans une hash_table dédiée
439  hash_put(menu_item_to_combo_box, sub_menu_option, choices_combobox);
440 
441  gtk_widget_show(sub_menu_option_item);
442  gtk_widget_show_all(sub_menu_option);
443  gtk_widget_show_all(choices_combobox);
444  }
445  gtk_widget_show_all(table);
446 
447  /* According to a suggestion from Guillaume Oget, it should be nice
448  to be able to select a view also from the Option panel: */
449 
450  //char * option_item_label;
451 
452  LabelAndVbox lav;
453  lav.vbox = frame_vbox;
454  gtk_container_foreach(GTK_CONTAINER(options_frame), (GtkCallback)
456 }
457 
458 /* Construct a table linking PIPS phase name to more human names, the
459  aliases defined in pipsmake-rc.tex.
460  */
462  static int runs = 0;
463  runs++;
464  char buffer[BSIZE_HERE];
465  char true_name[BSIZE_HERE], alias_name[BSIZE_HERE];
466  FILE *fd;
467 
469 
470  fd = fopen_config(WPIPS_RC, NULL,NULL);
471 
472  while (fgets(buffer, BSIZE_HERE, fd) != NULL) {
473  if (buffer[0] == '-')
474  continue;
475 
476  sscanf(buffer, "alias%s '%[^']", true_name, alias_name);
477 
478  string stored_name;
479  if ((stored_name = hash_get(aliases, alias_name))
481  pips_internal_error("Aliases must not be ambiguous\n"
482  "\talias '%s' seems ambiguous "
483  "because of previous '%s'!\n", true_name, stored_name);
484  } else {
485  char * upper = strdup(true_name);
486  hash_put(aliases, strdup(alias_name), strupper(upper, upper));
487  }
488  }
489  safe_fclose(fd, WPIPS_RC);
490 }
491 
492 void display_or_hide_options_frame(GtkWidget * menu_item, gpointer data) {
493  const char *message_string;
494 
495  /* Should be added : when the options panel is destroyed by the
496  window manager, toggle the menu. RK, 7/6/93. */
497 
498  message_string = gpips_gtk_menu_item_get_label(menu_item);
499  if (message_string != NULL && strcmp(message_string, display_options_panel)
500  == 0) {
501  gtk_widget_show_all(options_window);
503  } else {
504  hide_window(options_window, NULL, NULL);
506  }
507 }
508 
509 /* Hide and restore the menu item to reopen the option panel: */
510 void static options_window_done_procedure(GtkWidget * window, gpointer data) {
511  hide_window(options_window, NULL, NULL);
514 }
515 
517  GtkWidget * vbox;
518  options_frame = gtk_frame_new(NULL);
519  vbox = gtk_vbox_new(FALSE, 0);
520  gtk_container_add(GTK_CONTAINER(options_frame), vbox);
521  gtk_container_add(GTK_CONTAINER(options_window), options_frame);
522 
523  /* Trap the FRAME_DONE event: */
524  gtk_signal_connect(GTK_OBJECT(options_window), "delete-event",
525  GTK_SIGNAL_FUNC(options_window_done_procedure), NULL);
526 
527  options_frame_menu_item = gtk_menu_item_new_with_label(
529  g_signal_connect(G_OBJECT(options_frame_menu_item), "activate", G_CALLBACK(
531 
532  options_menu = gtk_menu_new();
533  gtk_menu_append(GTK_MENU(options_menu), options_frame_menu_item);
534 
535  build_aliases();
537  gtk_widget_show_all(options_frame);
538 
539  options_menu_item = gtk_menu_item_new_with_label("Options");
540  gtk_menu_item_set_submenu(GTK_MENU_ITEM(options_menu_item), options_menu);
541 
542  gtk_menu_bar_append(GTK_MENU_BAR(main_window_menu_bar), options_menu_item);
543 }
float a2sf[2] __attribute__((aligned(16)))
USER generates a user error (i.e., non fatal) by printing the given MSG according to the FMT.
Definition: 3dnow.h:3
void user_log(const char *format,...)
Definition: message.c:234
const char * activate(const char *phase)
Definition: activate.c:214
int safe_fclose(FILE *stream, const char *filename)
Definition: file.c:77
FILE * fopen_config(const char *canonical_name, const char *cproperty, const char *cenv)
Definition: file.c:952
#define STRING(x)
Definition: genC.h:87
void * malloc(YYSIZE_T)
GtkWidget * options_window
Definition: gpips-local.h:38
GtkWidget * main_window_menu_bar
Definition: gpips.c:62
#define NIL
The empty list (nil in Lisp)
Definition: newgen_list.h:47
size_t gen_length(const list l)
Definition: list.c:150
#define CONS(_t_, _i_, _l_)
List element cell constructor (insert an element at the beginning of a list)
Definition: newgen_list.h:150
list gen_nconc(list cp1, list cp2)
physically concatenates CP1 and CP2 but do not duplicates the elements
Definition: list.c:344
#define CAR(pcons)
Get the value of the first element of a list.
Definition: newgen_list.h:92
#define MAPL(_map_list_cp, _code, _l)
Apply some code on the addresses of all the elements of a list.
Definition: newgen_list.h:203
GtkWidget * view_menu
The menu "View" on the main panel:
Definition: gtk_edit2.c:93
void disable_item(GtkWidget *item)
Definition: gtk_edit2.c:461
void gpips_execute_and_display_something_from_alias(const char *alias_name)
To execute something and display some Pips output with gpips by knowing its alias:
Definition: gtk_edit2.c:410
void enable_item(GtkWidget *item)
Definition: gtk_edit2.c:465
void prompt_user(string a_printf_format,...)
Definition: gtk_log.c:66
static hash_table menu_item_to_combo_box
Definition: gtk_props.c:70
void enable_option_selection()
Definition: gtk_props.c:134
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:
Definition: gtk_props.c:284
static GtkWidget * options_menu
Definition: gtk_props.c:65
void apply_on_each_options_frame_choice(GtkWidget *widget, gpointer _func)
Definition: gtk_props.c:109
static void options_window_done_procedure(GtkWidget *window, gpointer data)
Hide and restore the menu item to reopen the option panel:
Definition: gtk_props.c:510
void options_combo_box_change_callback(GtkWidget *item, gpointer data __attribute__((unused)))
"value" is already used for a typedef...
Definition: gtk_props.c:265
void apply_on_each_option_item(void(*function_to_apply_on_each_menu_item)(GtkWidget *), void(*function_to_apply_on_each_frame_choice)(GtkWidget *))
Definition: gtk_props.c:116
void apply_on_each_options_menu_item(GtkWidget *widget, gpointer _func)
Definition: gtk_props.c:98
int verbose_update_options
Flag allowing update_options also to select a option :
Definition: gtk_props.c:86
@ BSIZE_HERE
Definition: gtk_props.c:76
void create_options_menu_and_window()
Definition: gtk_props.c:516
static GtkWidget * smenu_options
Definition: gtk_props.c:64
static void synch_viewmenu_and_opframe_search_in_view(GtkWidget *widget, gpointer data)
Definition: gtk_props.c:288
void options_frame_to_view_menu_gateway(GtkWidget *widget, gpointer data __attribute__((unused)))
Definition: gtk_props.c:272
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 bu...
Definition: gtk_props.c:324
void update_options()
Definition: gtk_props.c:138
static char hide_options_panel[]
Definition: gtk_props.c:73
static char display_options_panel[]
Definition: gtk_props.c:72
char vcid_xv_props[]
Definition: gtk_props.c:29
GtkWidget * options_frame
Definition: gtk_props.c:67
void disable_option_selection()
Definition: gtk_props.c:130
void options_menu_callback(GtkWidget *widget, gpointer data __attribute__((unused)))
Definition: gtk_props.c:277
void display_or_hide_options_frame(GtkWidget *menu_item, gpointer data)
Definition: gtk_props.c:492
static GtkWidget * options_frame_menu_item
Definition: gtk_props.c:66
void options_select(const char *aliased_phase)
Definition: gtk_props.c:243
static void synch_viewmenu_and_opframe(GtkWidget *widget, gpointer data)
Definition: gtk_props.c:304
static hash_table aliases
Definition: gtk_props.c:69
static GtkWidget * options_menu_item
Definition: gtk_props.c:65
string hash_get_key_by_value(hash_table htp, string svp)
returns the first key which value is svp.
Definition: gtk_props.c:89
void build_aliases()
Construct a table linking PIPS phase name to more human names, the aliases defined in pipsmake-rc....
Definition: gtk_props.c:461
void display_memory_usage()
Definition: gtk_status.c:84
const char * gpips_gtk_menu_item_get_label(GtkWidget *w)
Definition: gtk_utils.c:43
gint hide_window(GtkWidget *window, GdkEvent *ev __attribute__((unused)), gpointer data __attribute__((unused)))
Definition: gtk_utils.c:89
void gpips_gtk_menu_item_set_label(GtkWidget *w, gchar *text)
Definition: gtk_utils.c:64
hash_table hash_table_make(hash_key_type key_type, size_t size)
Definition: hash.c:294
void * hash_get(const hash_table htp, const void *key)
this function retrieves in the hash table pointed to by htp the couple whose key is equal to key.
Definition: hash.c:449
void hash_put(hash_table htp, const void *key, const void *val)
This functions stores a couple (key,val) in the hash table pointed to by htp.
Definition: hash.c:364
#define rule_phase(x)
Definition: makefile.h:244
#define RULE(x)
RULE.
Definition: makefile.h:209
#define virtual_resource_name(x)
Definition: makefile.h:290
#define rule_produced(x)
Definition: makefile.h:248
#define VIRTUAL_RESOURCE(x)
VIRTUAL_RESOURCE.
Definition: makefile.h:260
#define makefile_rules(x)
Definition: makefile.h:82
#define debug_on(env)
Definition: misc-local.h:157
#define pips_internal_error
Definition: misc-local.h:149
#define debug_off()
Definition: misc-local.h:160
#define user_warning(fn,...)
Definition: misc-local.h:262
void debug(const int the_expected_debug_level, const char *calling_function_name, const char *a_message_format,...)
ARARGS0.
Definition: debug.c:189
string strupper(string, const char *)
Definition: string.c:213
#define HASH_MAP(k, v, code, ht)
Definition: newgen_hash.h:60
@ hash_string
Definition: newgen_hash.h:32
@ hash_pointer
Definition: newgen_hash.h:32
#define HASH_UNDEFINED_VALUE
value returned by hash_get() when the key is not found; could also be called HASH_KEY_NOT_FOUND,...
Definition: newgen_hash.h:56
struct cons * list
Definition: newgen_types.h:106
string db_get_current_workspace_name(void)
the function is used to check that there is some current workspace...
Definition: workspace.c:82
makefile parse_makefile(void)
rule find_rule_by_resource(const char *rname)
This function returns the active rule to produce resource rname.
Definition: pipsmake.c:694
char * strdup()
static char * x
Definition: split_file.c:159
static string buffer
Definition: string.c:113
GtkWidget * vbox
Definition: gtk_props.c:82
int position
Definition: gtk_props.c:81
const char * label
Definition: gtk_props.c:80
The structure used to build lists in NewGen.
Definition: newgen_list.h:41
list choices
Definition: gtk_props.c:61
char * name
Definition: gtk_props.c:60