25 #include "pips_config.h"
32 #include <sys/resource.h>
35 #include <sys/resource.h>
44 #if (defined(TEXT_TYPE))
85 char memory_string[17];
87 struct rusage an_rusage;
90 debug(6,
"display_memory_usage",
91 "_text %#x, _data %#x, _end %#x, _brk %#x\n", &
etext, &
edata, &
end,
95 / (
double) (1 << 20));
97 gtk_label_set_text(GTK_LABEL(
memory_name), memory_string);
99 if (getrusage(RUSAGE_SELF, &an_rusage) == 0) {
100 double the_cpu_time = an_rusage.ru_utime.tv_sec
101 + an_rusage.ru_stime.tv_sec + (an_rusage.ru_utime.tv_usec
102 + an_rusage.ru_stime.tv_usec) * 1e-6;
124 static char *none =
"(* none *)";
135 static char *none =
"(* none *)";
138 if (module_name_content == NULL)
139 module_name_content = none;
179 GtkWidget * file_chooser_dialog;
181 file_chooser_dialog = gtk_file_chooser_dialog_new(
"Choose Directory",
182 GTK_WINDOW(
main_window), GTK_FILE_CHOOSER_ACTION_SELECT_FOLDER,
183 GTK_STOCK_CANCEL, GTK_RESPONSE_CANCEL, GTK_STOCK_OPEN,
184 GTK_RESPONSE_ACCEPT, NULL);
186 if (gtk_dialog_run(GTK_DIALOG(file_chooser_dialog)) == GTK_RESPONSE_ACCEPT) {
187 char * dirname = gtk_file_chooser_get_filename(GTK_FILE_CHOOSER(
188 file_chooser_dialog));
192 g_signal_emit_by_name(
data,
"activate");
195 gtk_widget_destroy(file_chooser_dialog);
207 GtkWidget * hbox = gtk_hbox_new(FALSE, 0);
211 GtkWidget * cd_button;
213 label = gtk_label_new(
"Directory: ");
214 gtk_box_pack_start(GTK_BOX(hbox), label, FALSE, FALSE, 5);
216 entry = gtk_entry_new();
217 gtk_box_pack_start(GTK_BOX(hbox), entry, TRUE, TRUE, 5);
218 g_signal_connect(GTK_OBJECT(entry),
"activate",
220 gtk_widget_set_sensitive(entry, FALSE);
222 cd_button = gtk_button_new_with_label(
"CD");
223 gtk_box_pack_start(GTK_BOX(hbox), cd_button, FALSE, FALSE, 5);
227 gtk_widget_show_all(hbox);
228 gtk_box_pack_start(GTK_BOX(vbox), hbox, TRUE, FALSE, 5);
233 GdkEventButton * ev, gpointer
data) {
235 GtkWidget * menu = (GtkWidget *)
data;
238 gtk_menu_item_remove_submenu(GTK_MENU_ITEM(w));
241 gtk_menu_item_set_submenu(GTK_MENU_ITEM(w), menu);
247 GdkEventButton * ev, gpointer
data) {
249 GtkWidget * menu = (GtkWidget *)
data;
252 gtk_menu_item_remove_submenu(GTK_MENU_ITEM(w));
255 gtk_menu_item_set_submenu(GTK_MENU_ITEM(w), menu);
264 GtkWidget * hbox = gtk_hbox_new(FALSE, 0);
269 GtkWidget * menu_item;
270 GtkWidget * menu_bar;
272 label = gtk_label_new(
"Workspace: ");
273 gtk_box_pack_start(GTK_BOX(hbox), label, FALSE, FALSE, 5);
275 entry = gtk_entry_new();
276 gtk_box_pack_start(GTK_BOX(hbox), entry, TRUE, TRUE, 5);
277 g_signal_connect(GTK_OBJECT(entry),
"activate",
280 menu_item = gtk_menu_item_new_with_label(
"Workspace list");
283 g_signal_connect(G_OBJECT(menu_item),
"button-press-event",
285 gtk_widget_show(menu_item);
287 menu_bar = gtk_menu_bar_new();
288 gtk_box_pack_start(GTK_BOX(hbox), menu_bar, FALSE, FALSE, 0);
289 gtk_menu_bar_append(GTK_MENU_BAR(menu_bar), menu_item);
290 gtk_widget_show(menu_bar);
292 gtk_widget_show_all(hbox);
293 gtk_box_pack_start(GTK_BOX(vbox), hbox, TRUE, FALSE, 5);
298 GtkWidget * hbox = gtk_hbox_new(FALSE, 0);
303 GtkWidget * menu_item;
304 GtkWidget * menu_bar;
306 label = gtk_label_new(
"Module: ");
307 gtk_box_pack_start(GTK_BOX(hbox), label, FALSE, FALSE, 5);
309 entry = gtk_entry_new();
310 gtk_box_pack_start(GTK_BOX(hbox), entry, TRUE, TRUE, 5);
311 g_signal_connect(GTK_OBJECT(entry),
"activate",
314 menu_item = gtk_menu_item_new_with_label(
"Select module");
317 g_signal_connect(G_OBJECT(menu_item),
"button-press-event",
319 gtk_widget_show(menu_item);
321 menu_bar = gtk_menu_bar_new();
322 gtk_box_pack_start(GTK_BOX(hbox), menu_bar, FALSE, FALSE, 0);
323 gtk_menu_bar_append(GTK_MENU_BAR(menu_bar), menu_item);
324 gtk_widget_show(menu_bar);
326 gtk_widget_show_all(hbox);
327 gtk_box_pack_start(GTK_BOX(vbox), hbox, TRUE, FALSE, 5);
336 GtkWidget * status_frame_vbox = gtk_vbox_new(FALSE, 0);
337 gtk_container_add(GTK_CONTAINER(
status_frame), status_frame_vbox);
339 gmessage = gtk_label_new(
"Message:");
340 gtk_box_pack_start(GTK_BOX(status_frame_vbox),
gmessage, FALSE, FALSE, 5);
348 GtkWidget * data_hbox = gtk_hbox_new(FALSE, 0);
349 gtk_box_pack_start(GTK_BOX(status_frame_vbox), data_hbox, FALSE, FALSE, 5);
350 gtk_box_pack_start(GTK_BOX(data_hbox), gtk_label_new(
"Memory (MB):"),
353 gtk_box_pack_start(GTK_BOX(data_hbox),
memory_name, FALSE, FALSE, 5);
354 gtk_box_pack_start(GTK_BOX(data_hbox), gtk_label_new(
"CPU (s):"), FALSE,
357 gtk_box_pack_start(GTK_BOX(data_hbox),
cpu_usage_item, FALSE, FALSE, 5);
358 gtk_widget_show_all(data_hbox);
float a2sf[2] __attribute__((aligned(16)))
USER generates a user error (i.e., non fatal) by printing the given MSG according to the FMT.
string db_get_current_module_name(void)
Also used to check whether set...
char * get_cwd(void)
returns the current working directory name.
GtkWidget * main_window_vbox
GtkWidget * generate_module_menu()
participe à la génération du menu associés aux modules dans la fenetre principale
GtkWidget * generate_workspace_menu()
To use with schoose_create_abbrev_menu_with_text:
success end_directory_notify(const char *dir)
void end_select_module_callback(const char *name)
void open_or_create_workspace(const char *workspace_name_original)
To be used with schoose_create_abbrev_menu_with_text from the main panel:
static gboolean regenerate_workspace_menu_callback(GtkWidget *w, GdkEventButton *ev, gpointer data)
static gboolean regenerate_module_menu_callback(GtkWidget *w, GdkEventButton *ev, gpointer data)
static GtkWidget * create_module_entry(GtkWidget *vbox)
static GtkWidget * create_dir_choose_entry(GtkWidget *vbox)
GtkWidget * directory_name_entry_button
GtkWidget * module_name_entry
void open_or_create_workspace_callback(GtkWidget *w, gpointer data __attribute__((unused)))
GtkWidget * workspace_name_entry
void gpips_interrupt_button_restore()
static void choose_dir_callback(GtkWidget *w __attribute__((unused)), gpointer data)
static GtkWidget * create_workspace_entry(GtkWidget *vbox)
void display_memory_usage()
void gpips_interrupt_button_blink()
GtkWidget * directory_name_entry
GtkWidget * window_number
static void end_directory_notify_callback(GtkWidget *w, gpointer data __attribute__((unused)))
void show_message(string message_buffer)
GtkWidget * cpu_usage_item
char etext
Strange, "man end" says that end is a function!
void create_status_subwindow()
void debug(const int the_expected_debug_level, const char *calling_function_name, const char *a_message_format,...)
ARARGS0.
string db_get_current_workspace_name(void)
the function is used to check that there is some current workspace...