25 #include "pips_config.h"
34 #include <sys/resource.h>
35 #include <xview/xview.h>
36 #include <xview/panel.h>
37 #include <xview/text.h>
38 #include <xview/textsw.h>
39 #include <xview/notice.h>
40 #include <xview/xv_error.h>
48 #if (defined(TEXT_TYPE))
73 va_list some_arguments;
76 va_start(some_arguments, a_printf_format);
78 (void) vsprintf(message_buffer, a_printf_format, some_arguments);
82 (void) notice_prompt(xv_find(
main_frame, WINDOW, 0),
84 NOTICE_MESSAGE_STRINGS,
87 NOTICE_BUTTON_YES,
"Press Here",
96 int message_length = strlen(a_message);
101 TEXTSW_INSERTION_POINT, old_length,
103 textsw_insert(
log_textsw, a_message, message_length);
106 if (new_length != old_length + message_length)
114 TEXTSW_INSERTION_POINT, 0,
117 textsw_insert(
log_textsw, a_message, message_length);
120 "you saw the log window was full :-) ...\n"
121 "It is now cut down to 0 byte again...\n\n"
122 "Anyway, you can retrieve all the log content "
123 "in the file \"%s/LOGFILE\"\n",
128 (Textsw_index) xv_get(
log_textsw, TEXTSW_INSERTION_POINT));
130 XFlush((Display *) xv_get(
main_frame, XV_DISPLAY));
131 XFlush((Display *) xv_get(
log_frame, XV_DISPLAY));
133 xv_set(
clear, MENU_INACTIVE, FALSE, 0);
187 (void) vsprintf(log_buffer, fmt, args);
209 xv_set(
close, MENU_INACTIVE, FALSE, 0);
220 xv_set(
clear, MENU_INACTIVE, TRUE, 0);
230 xv_set(
close, MENU_INACTIVE, TRUE, 0);
238 Panel_item log_button;
246 clear = xv_create(NULL, MENUITEM,
247 MENU_STRING,
"Clear",
253 close = xv_create(NULL, MENUITEM,
254 MENU_STRING,
"Close",
260 menu = xv_create(XV_NULL, MENU_COMMAND_MENU,
262 MENU_APPEND_ITEM,
clear,
263 MENU_APPEND_ITEM,
close,
266 log_button = xv_create(
main_panel, PANEL_BUTTON,
267 PANEL_LABEL_STRING,
"Log ",
268 PANEL_ITEM_MENU, menu,
274 xv_set(log_button, PANEL_INACTIVE, TRUE,
void log_on_file(const char *desc)
void const char const char const int
void show_message(char *fmt,...)
ARARGS0.
void send_user_error_to_emacs(char *some_text)
void send_prompt_user_to_emacs(char *some_text)
void send_user_warning_to_emacs(char *some_text)
bool wpips_emacs_mode
Here are all the stuff to interface Pips with Emacs.
void send_user_log_to_emacs(char *some_text)
bool get_bool_property(const string)
FC 2015-07-20: yuk, moved out to prevent an include cycle dependency include "properties....
#define SMALL_BUFFER_LENGTH
GtkWidget * main_frame
If we are in the Emacs mode, the log_frame is no longer really used:
gint hide_window(GtkWidget *window, GdkEvent *ev __attribute__((unused)), gpointer data __attribute__((unused)))
string db_get_current_workspace_directory(void)
void wpips_user_warning_message(char warning_buffer[])
void open_log_subwindow(Menu menu, Menu_item menu_item)
void wpips_user_log(string fmt, va_list args)
void prompt_user(string a_printf_format,...)
static Textsw log_textsw
xview/newgen interaction
static void insert_something_in_the_wpips_log_window(char *a_message)
void wpips_user_error_message(char error_buffer[])
void clear_log_subwindow(Menu menu, Menu_item menu_item)
void create_log_window()
This works but it is cleaner to use textsw_reset() instead...
void close_log_subwindow(Menu menu, Menu_item menu_item)
static Menu_item open_front
void unhide_window(Frame frame)
map a frame on the screen