Commit 5c2ccbaa authored by Marcus Nordenberg's avatar Marcus Nordenberg

rt_xtt: Operator window popup placement + show all available function buttons by default

parent be9d0585
...@@ -99,10 +99,10 @@ SObject pwrb:Class ...@@ -99,10 +99,10 @@ SObject pwrb:Class
EndBody EndBody
EndObject EndObject
!/** !/**
! Specifies on which monitor the operator dialogue will ! Specifies on which display the operator dialogue will
! take place. ! take place.
! If the operator communication is run on the local node ! If the operator communication is run on the local node
! and the display is to be displayed on the own monitor ! and the display is to be displayed on the own display
! ('default display') the Display attribute ought to be ! ('default display') the Display attribute ought to be
! left blank. ! left blank.
!*/ !*/
...@@ -246,7 +246,7 @@ SObject pwrb:Class ...@@ -246,7 +246,7 @@ SObject pwrb:Class
! in respective node. In each node the message handler ! in respective node. In each node the message handler
! has its own skyline of events (also named MaxNoOfEvents) ! has its own skyline of events (also named MaxNoOfEvents)
! defined by a MessageHandler object. In principle, the ! defined by a MessageHandler object. In principle, the
! User object's skyline of events should be selected as å ! User object's skyline of events should be selected as
! MaxNoOfEvents, added up over MaxNoOfEvents in the ! MaxNoOfEvents, added up over MaxNoOfEvents in the
! MessageHandler objects in all nodes throughout the ! MessageHandler objects in all nodes throughout the
! ProviewR system, or make it simple and assign the ! ProviewR system, or make it simple and assign the
...@@ -356,6 +356,17 @@ SObject pwrb:Class ...@@ -356,6 +356,17 @@ SObject pwrb:Class
Body SysBody Body SysBody
Attr TypeRef = "pwrs:Type-$String80" Attr TypeRef = "pwrs:Type-$String80"
EndBody EndBody
EndObject
!/**
! Override on what monitor the operator panel will show up. Default 0
! will use the primary monitor of the system. A value of 1 selects the first
! monitor and so on and so forth.
!*/
Object Monitor $Attribute 53
Body SysBody
Attr TypeRef = "pwrs:Type-$UInt32"
Attr Flags = 0
EndBody
EndObject EndObject
EndObject EndObject
Object Template OpPlace Object Template OpPlace
...@@ -366,6 +377,7 @@ SObject pwrb:Class ...@@ -366,6 +377,7 @@ SObject pwrb:Class
Attr OpWindEventNameSegments = 2 Attr OpWindEventNameSegments = 2
Attr MaxNoOfAlarms = 200 Attr MaxNoOfAlarms = 200
Attr MaxNoOfEvents = 500 Attr MaxNoOfEvents = 500
Attr Monitor = 0
EndBody EndBody
EndObject EndObject
Object FastAvail $ReferenceList Object FastAvail $ReferenceList
......
...@@ -80,9 +80,11 @@ static void cnv_pango_text(char* in, char* out, int size) ...@@ -80,9 +80,11 @@ static void cnv_pango_text(char* in, char* out, int size)
char* s = in; char* s = in;
char* t = out; char* t = out;
for (int i = 0; i < size && *s; i++, s++) { for (int i = 0; i < size && *s; i++, s++)
{
*(t++) = *s; *(t++) = *s;
if (*s == '&') { if (*s == '&')
{
// & -> &amp; // & -> &amp;
if (i + 4 >= size) if (i + 4 >= size)
break; break;
...@@ -98,10 +100,9 @@ static void cnv_pango_text(char* in, char* out, int size) ...@@ -98,10 +100,9 @@ static void cnv_pango_text(char* in, char* out, int size)
OpGtk::OpGtk(void* op_parent_ctx, GtkWidget* op_parent_wid, char* opplace, OpGtk::OpGtk(void* op_parent_ctx, GtkWidget* op_parent_wid, char* opplace,
pwr_tStatus* status) pwr_tStatus* status)
: Op(op_parent_ctx, opplace, status), parent_wid(op_parent_wid), : Op(op_parent_ctx, opplace, status), parent_wid(op_parent_wid),
title_label(0), a_height(2), text_size(12) title_label(0), a_height(5), text_size(12)
{ {
pwr_tStatus sts; pwr_tStatus sts;
GdkRectangle xtt_monitor_geometry;
GdkColor black_color; GdkColor black_color;
memset(a_exist, 0, sizeof(a_exist)); memset(a_exist, 0, sizeof(a_exist));
...@@ -114,15 +115,12 @@ OpGtk::OpGtk(void* op_parent_ctx, GtkWidget* op_parent_wid, char* opplace, ...@@ -114,15 +115,12 @@ OpGtk::OpGtk(void* op_parent_ctx, GtkWidget* op_parent_wid, char* opplace,
gdk_color_parse("Black", &black_color); gdk_color_parse("Black", &black_color);
gdk_color_parse("White", &white_color); gdk_color_parse("White", &white_color);
toplevel = (GtkWidget*)g_object_new(GTK_TYPE_WINDOW, "default-height", toplevel =
OP_HEIGHT_MIN, "default-width", 1100, NULL); (GtkWidget*)g_object_new(GTK_TYPE_WINDOW, "default-height", OP_HEIGHT_MIN,
"default-width", 1100, NULL);
gtk_window_set_decorated(GTK_WINDOW(toplevel), FALSE); gtk_window_set_decorated(GTK_WINDOW(toplevel), FALSE);
CoWowGtk::SetWindowIcon(toplevel); CoWowGtk::SetWindowIcon(toplevel);
GdkScreen* xtt_screen = gtk_widget_get_screen(toplevel);
int xtt_monitor = gdk_screen_get_monitor_at_point(xtt_screen, 0, 0);
gdk_screen_get_monitor_geometry(
xtt_screen, xtt_monitor, &xtt_monitor_geometry);
pwr_tFileName fname; pwr_tFileName fname;
dcli_translate_filename(fname, "$pwr_exe/xtt_alarm_active.png"); dcli_translate_filename(fname, "$pwr_exe/xtt_alarm_active.png");
...@@ -284,8 +282,8 @@ OpGtk::OpGtk(void* op_parent_ctx, GtkWidget* op_parent_wid, char* opplace, ...@@ -284,8 +282,8 @@ OpGtk::OpGtk(void* op_parent_ctx, GtkWidget* op_parent_wid, char* opplace,
gtk_container_add(GTK_CONTAINER(aalarm_ack), gtk_image_new_from_file(fname)); gtk_container_add(GTK_CONTAINER(aalarm_ack), gtk_image_new_from_file(fname));
gtk_widget_set_size_request(aalarm_ack, 30, 20); gtk_widget_set_size_request(aalarm_ack, 30, 20);
gtk_widget_set_size_request(aalarm_mark, -1, 20); gtk_widget_set_size_request(aalarm_mark, -1, 20);
g_signal_connect( g_signal_connect(aalarm_ack, "clicked", G_CALLBACK(activate_aalarm_ack),
aalarm_ack, "clicked", G_CALLBACK(activate_aalarm_ack), this); this);
// Increment size button // Increment size button
GtkWidget* incr_button = gtk_button_new(); GtkWidget* incr_button = gtk_button_new();
...@@ -293,16 +291,16 @@ OpGtk::OpGtk(void* op_parent_ctx, GtkWidget* op_parent_wid, char* opplace, ...@@ -293,16 +291,16 @@ OpGtk::OpGtk(void* op_parent_ctx, GtkWidget* op_parent_wid, char* opplace,
gtk_container_add(GTK_CONTAINER(incr_button), gtk_image_new_from_file(fname)); gtk_container_add(GTK_CONTAINER(incr_button), gtk_image_new_from_file(fname));
gtk_widget_set_size_request(incr_button, 30, 20); gtk_widget_set_size_request(incr_button, 30, 20);
gtk_widget_set_size_request(alarmcnt_label, -1, 20); gtk_widget_set_size_request(alarmcnt_label, -1, 20);
g_signal_connect( g_signal_connect(incr_button, "clicked", G_CALLBACK(activate_aalarm_incr),
incr_button, "clicked", G_CALLBACK(activate_aalarm_incr), this); this);
// Decrement size button // Decrement size button
decr_button = gtk_button_new(); decr_button = gtk_button_new();
dcli_translate_filename(fname, "$pwr_exe/xtt_up.png"); dcli_translate_filename(fname, "$pwr_exe/xtt_up.png");
gtk_container_add(GTK_CONTAINER(decr_button), gtk_image_new_from_file(fname)); gtk_container_add(GTK_CONTAINER(decr_button), gtk_image_new_from_file(fname));
gtk_widget_set_size_request(decr_button, 30, 20); gtk_widget_set_size_request(decr_button, 30, 20);
g_signal_connect( g_signal_connect(decr_button, "clicked", G_CALLBACK(activate_aalarm_decr),
decr_button, "clicked", G_CALLBACK(activate_aalarm_decr), this); this);
// Acknowledge button for b alarms // Acknowledge button for b alarms
GtkWidget* balarm_ack = gtk_button_new(); GtkWidget* balarm_ack = gtk_button_new();
...@@ -310,8 +308,8 @@ OpGtk::OpGtk(void* op_parent_ctx, GtkWidget* op_parent_wid, char* opplace, ...@@ -310,8 +308,8 @@ OpGtk::OpGtk(void* op_parent_ctx, GtkWidget* op_parent_wid, char* opplace,
gtk_container_add(GTK_CONTAINER(balarm_ack), gtk_image_new_from_file(fname)); gtk_container_add(GTK_CONTAINER(balarm_ack), gtk_image_new_from_file(fname));
gtk_widget_set_size_request(balarm_ack, 30, 20); gtk_widget_set_size_request(balarm_ack, 30, 20);
gtk_widget_set_size_request(balarm_mark, -1, 20); gtk_widget_set_size_request(balarm_mark, -1, 20);
g_signal_connect( g_signal_connect(balarm_ack, "clicked", G_CALLBACK(activate_balarm_ack),
balarm_ack, "clicked", G_CALLBACK(activate_balarm_ack), this); this);
GtkWidget* hbox_abutton = gtk_hbox_new(FALSE, 0); GtkWidget* hbox_abutton = gtk_hbox_new(FALSE, 0);
gtk_box_pack_start(GTK_BOX(hbox_abutton), aalarm_ack, FALSE, FALSE, 2); gtk_box_pack_start(GTK_BOX(hbox_abutton), aalarm_ack, FALSE, FALSE, 2);
...@@ -348,8 +346,8 @@ OpGtk::OpGtk(void* op_parent_ctx, GtkWidget* op_parent_wid, char* opplace, ...@@ -348,8 +346,8 @@ OpGtk::OpGtk(void* op_parent_ctx, GtkWidget* op_parent_wid, char* opplace,
// Menu // Menu
// Accelerators // Accelerators
GtkAccelGroup* accel_g GtkAccelGroup* accel_g =
= (GtkAccelGroup*)g_object_new(GTK_TYPE_ACCEL_GROUP, NULL); (GtkAccelGroup*)g_object_new(GTK_TYPE_ACCEL_GROUP, NULL);
gtk_window_add_accel_group(GTK_WINDOW(toplevel), accel_g); gtk_window_add_accel_group(GTK_WINDOW(toplevel), accel_g);
menu_bar = (GtkMenuBar*)g_object_new(GTK_TYPE_MENU_BAR, NULL); menu_bar = (GtkMenuBar*)g_object_new(GTK_TYPE_MENU_BAR, NULL);
...@@ -389,19 +387,19 @@ OpGtk::OpGtk(void* op_parent_ctx, GtkWidget* op_parent_wid, char* opplace, ...@@ -389,19 +387,19 @@ OpGtk::OpGtk(void* op_parent_ctx, GtkWidget* op_parent_wid, char* opplace,
g_signal_connect(functions_alarm_blocklist, "activate", g_signal_connect(functions_alarm_blocklist, "activate",
G_CALLBACK(activate_blocklist), this); G_CALLBACK(activate_blocklist), this);
GtkWidget* functions_alarm GtkWidget* functions_alarm =
= gtk_menu_item_new_with_mnemonic(CoWowGtk::translate_utf8("_Alarm")); gtk_menu_item_new_with_mnemonic(CoWowGtk::translate_utf8("_Alarm"));
GtkMenu* functions_alarm_menu = (GtkMenu*)g_object_new(GTK_TYPE_MENU, NULL); GtkMenu* functions_alarm_menu = (GtkMenu*)g_object_new(GTK_TYPE_MENU, NULL);
gtk_menu_shell_append( gtk_menu_shell_append(GTK_MENU_SHELL(functions_alarm_menu),
GTK_MENU_SHELL(functions_alarm_menu), functions_alarm_alarmlist); functions_alarm_alarmlist);
gtk_menu_shell_append( gtk_menu_shell_append(GTK_MENU_SHELL(functions_alarm_menu),
GTK_MENU_SHELL(functions_alarm_menu), functions_alarm_eventlist); functions_alarm_eventlist);
gtk_menu_shell_append( gtk_menu_shell_append(GTK_MENU_SHELL(functions_alarm_menu),
GTK_MENU_SHELL(functions_alarm_menu), functions_alarm_eventlog); functions_alarm_eventlog);
gtk_menu_shell_append( gtk_menu_shell_append(GTK_MENU_SHELL(functions_alarm_menu),
GTK_MENU_SHELL(functions_alarm_menu), functions_alarm_blocklist); functions_alarm_blocklist);
gtk_menu_item_set_submenu( gtk_menu_item_set_submenu(GTK_MENU_ITEM(functions_alarm),
GTK_MENU_ITEM(functions_alarm), GTK_WIDGET(functions_alarm_menu)); GTK_WIDGET(functions_alarm_menu));
// End Alarm submenu // End Alarm submenu
// Submenu Curves // Submenu Curves
...@@ -410,33 +408,33 @@ OpGtk::OpGtk(void* op_parent_ctx, GtkWidget* op_parent_wid, char* opplace, ...@@ -410,33 +408,33 @@ OpGtk::OpGtk(void* op_parent_ctx, GtkWidget* op_parent_wid, char* opplace,
dcli_translate_filename(fname, "$pwr_exe/xtt_meth_trend.png"); dcli_translate_filename(fname, "$pwr_exe/xtt_meth_trend.png");
gtk_image_menu_item_set_image(GTK_IMAGE_MENU_ITEM(functions_curves_trend), gtk_image_menu_item_set_image(GTK_IMAGE_MENU_ITEM(functions_curves_trend),
gtk_image_new_from_file(fname)); gtk_image_new_from_file(fname));
g_signal_connect( g_signal_connect(functions_curves_trend, "activate",
functions_curves_trend, "activate", G_CALLBACK(activate_trend), this); G_CALLBACK(activate_trend), this);
GtkWidget* functions_curves_fast = gtk_image_menu_item_new_with_mnemonic( GtkWidget* functions_curves_fast =
CoWowGtk::translate_utf8("_Fast")); gtk_image_menu_item_new_with_mnemonic(CoWowGtk::translate_utf8("_Fast"));
dcli_translate_filename(fname, "$pwr_exe/xtt_meth_fast.png"); dcli_translate_filename(fname, "$pwr_exe/xtt_meth_fast.png");
gtk_image_menu_item_set_image(GTK_IMAGE_MENU_ITEM(functions_curves_fast), gtk_image_menu_item_set_image(GTK_IMAGE_MENU_ITEM(functions_curves_fast),
gtk_image_new_from_file(fname)); gtk_image_new_from_file(fname));
g_signal_connect( g_signal_connect(functions_curves_fast, "activate", G_CALLBACK(activate_fast),
functions_curves_fast, "activate", G_CALLBACK(activate_fast), this); this);
GtkWidget* functions_curves_history = gtk_menu_item_new_with_mnemonic( GtkWidget* functions_curves_history = gtk_menu_item_new_with_mnemonic(
CoWowGtk::translate_utf8("_Process History")); CoWowGtk::translate_utf8("_Process History"));
g_signal_connect( g_signal_connect(functions_curves_history, "activate",
functions_curves_history, "activate", G_CALLBACK(activate_history), this); G_CALLBACK(activate_history), this);
GtkWidget* functions_curves GtkWidget* functions_curves =
= gtk_menu_item_new_with_mnemonic(CoWowGtk::translate_utf8("_Curves")); gtk_menu_item_new_with_mnemonic(CoWowGtk::translate_utf8("_Curves"));
GtkMenu* functions_curves_menu = (GtkMenu*)g_object_new(GTK_TYPE_MENU, NULL); GtkMenu* functions_curves_menu = (GtkMenu*)g_object_new(GTK_TYPE_MENU, NULL);
gtk_menu_shell_append( gtk_menu_shell_append(GTK_MENU_SHELL(functions_curves_menu),
GTK_MENU_SHELL(functions_curves_menu), functions_curves_trend); functions_curves_trend);
gtk_menu_shell_append( gtk_menu_shell_append(GTK_MENU_SHELL(functions_curves_menu),
GTK_MENU_SHELL(functions_curves_menu), functions_curves_fast); functions_curves_fast);
gtk_menu_shell_append( gtk_menu_shell_append(GTK_MENU_SHELL(functions_curves_menu),
GTK_MENU_SHELL(functions_curves_menu), functions_curves_history); functions_curves_history);
gtk_menu_item_set_submenu( gtk_menu_item_set_submenu(GTK_MENU_ITEM(functions_curves),
GTK_MENU_ITEM(functions_curves), GTK_WIDGET(functions_curves_menu)); GTK_WIDGET(functions_curves_menu));
// End Curves submenu // End Curves submenu
// Submenu View // Submenu View
...@@ -448,82 +446,82 @@ OpGtk::OpGtk(void* op_parent_ctx, GtkWidget* op_parent_wid, char* opplace, ...@@ -448,82 +446,82 @@ OpGtk::OpGtk(void* op_parent_ctx, GtkWidget* op_parent_wid, char* opplace,
GtkWidget* functions_view_incr = gtk_image_menu_item_new_with_mnemonic( GtkWidget* functions_view_incr = gtk_image_menu_item_new_with_mnemonic(
CoWowGtk::translate_utf8("_Larger Text")); CoWowGtk::translate_utf8("_Larger Text"));
dcli_translate_filename(fname, "$pwr_exe/xtt_zoom_in.png"); dcli_translate_filename(fname, "$pwr_exe/xtt_zoom_in.png");
gtk_image_menu_item_set_image( gtk_image_menu_item_set_image(GTK_IMAGE_MENU_ITEM(functions_view_incr),
GTK_IMAGE_MENU_ITEM(functions_view_incr), gtk_image_new_from_file(fname)); gtk_image_new_from_file(fname));
g_signal_connect( g_signal_connect(functions_view_incr, "activate",
functions_view_incr, "activate", G_CALLBACK(activate_zoom_in), this); G_CALLBACK(activate_zoom_in), this);
GtkWidget* functions_view_decr = gtk_image_menu_item_new_with_mnemonic( GtkWidget* functions_view_decr = gtk_image_menu_item_new_with_mnemonic(
CoWowGtk::translate_utf8("_Smaller Text")); CoWowGtk::translate_utf8("_Smaller Text"));
dcli_translate_filename(fname, "$pwr_exe/xtt_zoom_out.png"); dcli_translate_filename(fname, "$pwr_exe/xtt_zoom_out.png");
gtk_image_menu_item_set_image( gtk_image_menu_item_set_image(GTK_IMAGE_MENU_ITEM(functions_view_decr),
GTK_IMAGE_MENU_ITEM(functions_view_decr), gtk_image_new_from_file(fname)); gtk_image_new_from_file(fname));
g_signal_connect( g_signal_connect(functions_view_decr, "activate",
functions_view_decr, "activate", G_CALLBACK(activate_zoom_out), this); G_CALLBACK(activate_zoom_out), this);
GtkWidget* functions_view GtkWidget* functions_view =
= gtk_menu_item_new_with_mnemonic(CoWowGtk::translate_utf8("_View")); gtk_menu_item_new_with_mnemonic(CoWowGtk::translate_utf8("_View"));
GtkMenu* functions_view_menu = (GtkMenu*)g_object_new(GTK_TYPE_MENU, NULL); GtkMenu* functions_view_menu = (GtkMenu*)g_object_new(GTK_TYPE_MENU, NULL);
gtk_menu_shell_append( gtk_menu_shell_append(GTK_MENU_SHELL(functions_view_menu),
GTK_MENU_SHELL(functions_view_menu), functions_view_colortheme); functions_view_colortheme);
gtk_menu_shell_append( gtk_menu_shell_append(GTK_MENU_SHELL(functions_view_menu),
GTK_MENU_SHELL(functions_view_menu), functions_view_incr); functions_view_incr);
gtk_menu_shell_append( gtk_menu_shell_append(GTK_MENU_SHELL(functions_view_menu),
GTK_MENU_SHELL(functions_view_menu), functions_view_decr); functions_view_decr);
gtk_menu_item_set_submenu( gtk_menu_item_set_submenu(GTK_MENU_ITEM(functions_view),
GTK_MENU_ITEM(functions_view), GTK_WIDGET(functions_view_menu)); GTK_WIDGET(functions_view_menu));
// End View submenu // End View submenu
// Submenu User // Submenu User
GtkWidget* functions_user_switch = gtk_menu_item_new_with_mnemonic( GtkWidget* functions_user_switch =
CoWowGtk::translate_utf8("S_witch User")); gtk_menu_item_new_with_mnemonic(CoWowGtk::translate_utf8("S_witch User"));
g_signal_connect(functions_user_switch, "activate", g_signal_connect(functions_user_switch, "activate",
G_CALLBACK(activate_switch_user), this); G_CALLBACK(activate_switch_user), this);
GtkWidget* functions_user_show GtkWidget* functions_user_show =
= gtk_menu_item_new_with_mnemonic(CoWowGtk::translate_utf8("_Show User")); gtk_menu_item_new_with_mnemonic(CoWowGtk::translate_utf8("_Show User"));
g_signal_connect( g_signal_connect(functions_user_show, "activate",
functions_user_show, "activate", G_CALLBACK(activate_show_user), this); G_CALLBACK(activate_show_user), this);
GtkWidget* functions_user_logout GtkWidget* functions_user_logout =
= gtk_menu_item_new_with_mnemonic(CoWowGtk::translate_utf8("_Return")); gtk_menu_item_new_with_mnemonic(CoWowGtk::translate_utf8("_Return"));
g_signal_connect( g_signal_connect(functions_user_logout, "activate",
functions_user_logout, "activate", G_CALLBACK(activate_logout), this); G_CALLBACK(activate_logout), this);
GtkWidget* functions_user GtkWidget* functions_user =
= gtk_menu_item_new_with_mnemonic(CoWowGtk::translate_utf8("_User")); gtk_menu_item_new_with_mnemonic(CoWowGtk::translate_utf8("_User"));
GtkMenu* functions_user_menu = (GtkMenu*)g_object_new(GTK_TYPE_MENU, NULL); GtkMenu* functions_user_menu = (GtkMenu*)g_object_new(GTK_TYPE_MENU, NULL);
gtk_menu_shell_append( gtk_menu_shell_append(GTK_MENU_SHELL(functions_user_menu),
GTK_MENU_SHELL(functions_user_menu), functions_user_switch); functions_user_switch);
gtk_menu_shell_append( gtk_menu_shell_append(GTK_MENU_SHELL(functions_user_menu),
GTK_MENU_SHELL(functions_user_menu), functions_user_show); functions_user_show);
gtk_menu_shell_append( gtk_menu_shell_append(GTK_MENU_SHELL(functions_user_menu),
GTK_MENU_SHELL(functions_user_menu), functions_user_logout); functions_user_logout);
gtk_menu_item_set_submenu( gtk_menu_item_set_submenu(GTK_MENU_ITEM(functions_user),
GTK_MENU_ITEM(functions_user), GTK_WIDGET(functions_user_menu)); GTK_WIDGET(functions_user_menu));
// End User submenu // End User submenu
GtkWidget* functions_navigator = gtk_image_menu_item_new_with_mnemonic( GtkWidget* functions_navigator = gtk_image_menu_item_new_with_mnemonic(
CoWowGtk::translate_utf8("_Navigator")); CoWowGtk::translate_utf8("_Navigator"));
dcli_translate_filename(fname, "$pwr_exe/xtt_navigator.png"); dcli_translate_filename(fname, "$pwr_exe/xtt_navigator.png");
gtk_image_menu_item_set_image( gtk_image_menu_item_set_image(GTK_IMAGE_MENU_ITEM(functions_navigator),
GTK_IMAGE_MENU_ITEM(functions_navigator), gtk_image_new_from_file(fname)); gtk_image_new_from_file(fname));
g_signal_connect( g_signal_connect(functions_navigator, "activate",
functions_navigator, "activate", G_CALLBACK(activate_navigator), this); G_CALLBACK(activate_navigator), this);
// gtk_widget_add_accelerator( functions_navigator, "activate", accel_g, // gtk_widget_add_accelerator( functions_navigator, "activate", accel_g,
// 'd', GdkModifierType(GDK_CONTROL_MASK), // 'd', GdkModifierType(GDK_CONTROL_MASK),
//GTK_ACCEL_VISIBLE); // GTK_ACCEL_VISIBLE);
GtkWidget* functions_graph = gtk_image_menu_item_new_with_mnemonic( GtkWidget* functions_graph = gtk_image_menu_item_new_with_mnemonic(
CoWowGtk::translate_utf8("_Process Graphics")); CoWowGtk::translate_utf8("_Process Graphics"));
dcli_translate_filename(fname, "$pwr_exe/wtt_ge.png"); // TODO dcli_translate_filename(fname, "$pwr_exe/wtt_ge.png"); // TODO
gtk_image_menu_item_set_image( gtk_image_menu_item_set_image(GTK_IMAGE_MENU_ITEM(functions_graph),
GTK_IMAGE_MENU_ITEM(functions_graph), gtk_image_new_from_file(fname)); gtk_image_new_from_file(fname));
g_signal_connect( g_signal_connect(functions_graph, "activate", G_CALLBACK(activate_graph),
functions_graph, "activate", G_CALLBACK(activate_graph), this); this);
// gtk_widget_add_accelerator( functions_graph, "activate", accel_g, // gtk_widget_add_accelerator( functions_graph, "activate", accel_g,
// 'g', GdkModifierType(GDK_CONTROL_MASK), // 'g', GdkModifierType(GDK_CONTROL_MASK),
//GTK_ACCEL_VISIBLE); // GTK_ACCEL_VISIBLE);
// Submenu Help // Submenu Help
GtkWidget* functions_help_project = gtk_image_menu_item_new_with_mnemonic( GtkWidget* functions_help_project = gtk_image_menu_item_new_with_mnemonic(
...@@ -531,49 +529,50 @@ OpGtk::OpGtk(void* op_parent_ctx, GtkWidget* op_parent_wid, char* opplace, ...@@ -531,49 +529,50 @@ OpGtk::OpGtk(void* op_parent_ctx, GtkWidget* op_parent_wid, char* opplace,
dcli_translate_filename(fname, "$pwr_exe/xtt_help.png"); dcli_translate_filename(fname, "$pwr_exe/xtt_help.png");
gtk_image_menu_item_set_image(GTK_IMAGE_MENU_ITEM(functions_help_project), gtk_image_menu_item_set_image(GTK_IMAGE_MENU_ITEM(functions_help_project),
gtk_image_new_from_file(fname)); gtk_image_new_from_file(fname));
g_signal_connect( g_signal_connect(functions_help_project, "activate",
functions_help_project, "activate", G_CALLBACK(activate_help), this); G_CALLBACK(activate_help), this);
GtkWidget* functions_help_overview GtkWidget* functions_help_overview =
= gtk_menu_item_new_with_mnemonic(CoWowGtk::translate_utf8("_Overview")); gtk_menu_item_new_with_mnemonic(CoWowGtk::translate_utf8("_Overview"));
g_signal_connect(functions_help_overview, "activate", g_signal_connect(functions_help_overview, "activate",
G_CALLBACK(activate_help_overview), this); G_CALLBACK(activate_help_overview), this);
GtkWidget* functions_help_opwin = gtk_menu_item_new_with_mnemonic( GtkWidget* functions_help_opwin = gtk_menu_item_new_with_mnemonic(
CoWowGtk::translate_utf8("_OperatorWindow")); CoWowGtk::translate_utf8("_OperatorWindow"));
g_signal_connect( g_signal_connect(functions_help_opwin, "activate",
functions_help_opwin, "activate", G_CALLBACK(activate_help_opwin), this); G_CALLBACK(activate_help_opwin), this);
GtkWidget* functions_help_proview = gtk_menu_item_new_with_mnemonic( GtkWidget* functions_help_proview = gtk_menu_item_new_with_mnemonic(
CoWowGtk::translate_utf8("_About ProviewR")); CoWowGtk::translate_utf8("_About ProviewR"));
g_signal_connect(functions_help_proview, "activate", g_signal_connect(functions_help_proview, "activate",
G_CALLBACK(activate_help_proview), this); G_CALLBACK(activate_help_proview), this);
GtkWidget* functions_help GtkWidget* functions_help =
= gtk_menu_item_new_with_mnemonic(CoWowGtk::translate_utf8("_Help")); gtk_menu_item_new_with_mnemonic(CoWowGtk::translate_utf8("_Help"));
GtkMenu* functions_help_menu = (GtkMenu*)g_object_new(GTK_TYPE_MENU, NULL); GtkMenu* functions_help_menu = (GtkMenu*)g_object_new(GTK_TYPE_MENU, NULL);
gtk_menu_shell_append( gtk_menu_shell_append(GTK_MENU_SHELL(functions_help_menu),
GTK_MENU_SHELL(functions_help_menu), functions_help_project); functions_help_project);
gtk_menu_shell_append( gtk_menu_shell_append(GTK_MENU_SHELL(functions_help_menu),
GTK_MENU_SHELL(functions_help_menu), functions_help_overview); functions_help_overview);
gtk_menu_shell_append( gtk_menu_shell_append(GTK_MENU_SHELL(functions_help_menu),
GTK_MENU_SHELL(functions_help_menu), functions_help_opwin); functions_help_opwin);
gtk_menu_shell_append( gtk_menu_shell_append(GTK_MENU_SHELL(functions_help_menu),
GTK_MENU_SHELL(functions_help_menu), functions_help_proview); functions_help_proview);
gtk_menu_item_set_submenu( gtk_menu_item_set_submenu(GTK_MENU_ITEM(functions_help),
GTK_MENU_ITEM(functions_help), GTK_WIDGET(functions_help_menu)); GTK_WIDGET(functions_help_menu));
// End Help submenu // End Help submenu
functions_close = gtk_image_menu_item_new_with_mnemonic( functions_close =
CoWowGtk::translate_utf8("_Close")); gtk_image_menu_item_new_with_mnemonic(CoWowGtk::translate_utf8("_Close"));
gtk_image_menu_item_set_image(GTK_IMAGE_MENU_ITEM(functions_close), gtk_image_menu_item_set_image(
GTK_IMAGE_MENU_ITEM(functions_close),
gtk_image_new_from_stock("gtk-close", GTK_ICON_SIZE_MENU)); gtk_image_new_from_stock("gtk-close", GTK_ICON_SIZE_MENU));
g_signal_connect( g_signal_connect(functions_close, "activate", G_CALLBACK(activate_exit),
functions_close, "activate", G_CALLBACK(activate_exit), this); this);
// gtk_widget_add_accelerator( functions_close, "activate", accel_g, // gtk_widget_add_accelerator( functions_close, "activate", accel_g,
// 'w', GdkModifierType(GDK_CONTROL_MASK), // 'w', GdkModifierType(GDK_CONTROL_MASK),
//GTK_ACCEL_VISIBLE); // GTK_ACCEL_VISIBLE);
GtkMenu* functions_menu = (GtkMenu*)g_object_new(GTK_TYPE_MENU, NULL); GtkMenu* functions_menu = (GtkMenu*)g_object_new(GTK_TYPE_MENU, NULL);
gtk_menu_shell_append(GTK_MENU_SHELL(functions_menu), functions_alarm); gtk_menu_shell_append(GTK_MENU_SHELL(functions_menu), functions_alarm);
...@@ -588,12 +587,12 @@ OpGtk::OpGtk(void* op_parent_ctx, GtkWidget* op_parent_wid, char* opplace, ...@@ -588,12 +587,12 @@ OpGtk::OpGtk(void* op_parent_ctx, GtkWidget* op_parent_wid, char* opplace,
GtkWidget* functions = gtk_image_menu_item_new_with_mnemonic( GtkWidget* functions = gtk_image_menu_item_new_with_mnemonic(
CoWowGtk::translate_utf8("_Functions")); CoWowGtk::translate_utf8("_Functions"));
dcli_translate_filename(fname, "$pwr_exe/xtt_down.png"); dcli_translate_filename(fname, "$pwr_exe/xtt_down.png");
gtk_image_menu_item_set_image( gtk_image_menu_item_set_image(GTK_IMAGE_MENU_ITEM(functions),
GTK_IMAGE_MENU_ITEM(functions), gtk_image_new_from_file(fname)); gtk_image_new_from_file(fname));
gtk_menu_shell_append(GTK_MENU_SHELL(menu_bar), functions); gtk_menu_shell_append(GTK_MENU_SHELL(menu_bar), functions);
gtk_menu_item_set_submenu( gtk_menu_item_set_submenu(GTK_MENU_ITEM(functions),
GTK_MENU_ITEM(functions), GTK_WIDGET(functions_menu)); GTK_WIDGET(functions_menu));
// Toolbar // Toolbar
tools = (GtkWidget*)g_object_new(GTK_TYPE_TOOLBAR, NULL); tools = (GtkWidget*)g_object_new(GTK_TYPE_TOOLBAR, NULL);
...@@ -601,19 +600,19 @@ OpGtk::OpGtk(void* op_parent_ctx, GtkWidget* op_parent_wid, char* opplace, ...@@ -601,19 +600,19 @@ OpGtk::OpGtk(void* op_parent_ctx, GtkWidget* op_parent_wid, char* opplace,
GtkWidget* tools_zoom_in = gtk_button_new(); GtkWidget* tools_zoom_in = gtk_button_new();
dcli_translate_filename(fname, "$pwr_exe/xtt_zoom_in.png"); dcli_translate_filename(fname, "$pwr_exe/xtt_zoom_in.png");
gtk_container_add( gtk_container_add(GTK_CONTAINER(tools_zoom_in),
GTK_CONTAINER(tools_zoom_in), gtk_image_new_from_file(fname)); gtk_image_new_from_file(fname));
g_signal_connect( g_signal_connect(tools_zoom_in, "clicked", G_CALLBACK(activate_zoom_in),
tools_zoom_in, "clicked", G_CALLBACK(activate_zoom_in), this); this);
gtk_toolbar_append_widget(GTK_TOOLBAR(tools), tools_zoom_in, gtk_toolbar_append_widget(GTK_TOOLBAR(tools), tools_zoom_in,
CoWowGtk::translate_utf8("Larger Text"), ""); CoWowGtk::translate_utf8("Larger Text"), "");
GtkWidget* tools_zoom_out = gtk_button_new(); GtkWidget* tools_zoom_out = gtk_button_new();
dcli_translate_filename(fname, "$pwr_exe/xtt_zoom_out.png"); dcli_translate_filename(fname, "$pwr_exe/xtt_zoom_out.png");
gtk_container_add( gtk_container_add(GTK_CONTAINER(tools_zoom_out),
GTK_CONTAINER(tools_zoom_out), gtk_image_new_from_file(fname)); gtk_image_new_from_file(fname));
g_signal_connect( g_signal_connect(tools_zoom_out, "clicked", G_CALLBACK(activate_zoom_out),
tools_zoom_out, "clicked", G_CALLBACK(activate_zoom_out), this); this);
gtk_toolbar_append_widget(GTK_TOOLBAR(tools), tools_zoom_out, gtk_toolbar_append_widget(GTK_TOOLBAR(tools), tools_zoom_out,
CoWowGtk::translate_utf8("Smaller Text"), ""); CoWowGtk::translate_utf8("Smaller Text"), "");
...@@ -621,70 +620,70 @@ OpGtk::OpGtk(void* op_parent_ctx, GtkWidget* op_parent_wid, char* opplace, ...@@ -621,70 +620,70 @@ OpGtk::OpGtk(void* op_parent_ctx, GtkWidget* op_parent_wid, char* opplace,
dcli_translate_filename(fname, "$pwr_exe/xtt_help.png"); dcli_translate_filename(fname, "$pwr_exe/xtt_help.png");
gtk_container_add(GTK_CONTAINER(tools_help), gtk_image_new_from_file(fname)); gtk_container_add(GTK_CONTAINER(tools_help), gtk_image_new_from_file(fname));
g_signal_connect(tools_help, "clicked", G_CALLBACK(activate_help), this); g_signal_connect(tools_help, "clicked", G_CALLBACK(activate_help), this);
gtk_toolbar_append_widget( gtk_toolbar_append_widget(GTK_TOOLBAR(tools), tools_help,
GTK_TOOLBAR(tools), tools_help, CoWowGtk::translate_utf8("Help"), ""); CoWowGtk::translate_utf8("Help"), "");
tools_close = gtk_button_new(); tools_close = gtk_button_new();
dcli_translate_filename(fname, "$pwr_exe/xtt_close.png"); dcli_translate_filename(fname, "$pwr_exe/xtt_close.png");
gtk_container_add(GTK_CONTAINER(tools_close), gtk_image_new_from_file(fname)); gtk_container_add(GTK_CONTAINER(tools_close), gtk_image_new_from_file(fname));
g_signal_connect(tools_close, "clicked", G_CALLBACK(activate_exit), this); g_signal_connect(tools_close, "clicked", G_CALLBACK(activate_exit), this);
gtk_toolbar_append_widget( gtk_toolbar_append_widget(GTK_TOOLBAR(tools), tools_close,
GTK_TOOLBAR(tools), tools_close, CoWowGtk::translate_utf8("Close"), ""); CoWowGtk::translate_utf8("Close"), "");
GtkWidget* tools_alarmlist = gtk_button_new(); GtkWidget* tools_alarmlist = gtk_button_new();
dcli_translate_filename(fname, "$pwr_exe/xtt_alarmlist.png"); dcli_translate_filename(fname, "$pwr_exe/xtt_alarmlist.png");
gtk_container_add( gtk_container_add(GTK_CONTAINER(tools_alarmlist),
GTK_CONTAINER(tools_alarmlist), gtk_image_new_from_file(fname)); gtk_image_new_from_file(fname));
g_signal_connect( g_signal_connect(tools_alarmlist, "clicked", G_CALLBACK(activate_alarmlist),
tools_alarmlist, "clicked", G_CALLBACK(activate_alarmlist), this); this);
gtk_toolbar_append_widget(GTK_TOOLBAR(tools2), tools_alarmlist, gtk_toolbar_append_widget(GTK_TOOLBAR(tools2), tools_alarmlist,
CoWowGtk::translate_utf8("Alarm List"), ""); CoWowGtk::translate_utf8("Alarm List"), "");
GtkWidget* tools_eventlist = gtk_button_new(); GtkWidget* tools_eventlist = gtk_button_new();
dcli_translate_filename(fname, "$pwr_exe/xtt_eventlist.png"); dcli_translate_filename(fname, "$pwr_exe/xtt_eventlist.png");
gtk_container_add( gtk_container_add(GTK_CONTAINER(tools_eventlist),
GTK_CONTAINER(tools_eventlist), gtk_image_new_from_file(fname)); gtk_image_new_from_file(fname));
g_signal_connect( g_signal_connect(tools_eventlist, "clicked", G_CALLBACK(activate_eventlist),
tools_eventlist, "clicked", G_CALLBACK(activate_eventlist), this); this);
gtk_toolbar_append_widget(GTK_TOOLBAR(tools2), tools_eventlist, gtk_toolbar_append_widget(GTK_TOOLBAR(tools2), tools_eventlist,
CoWowGtk::translate_utf8("Event List"), ""); CoWowGtk::translate_utf8("Event List"), "");
GtkWidget* tools_eventlog = gtk_button_new(); GtkWidget* tools_eventlog = gtk_button_new();
dcli_translate_filename(fname, "$pwr_exe/xtt_eventlog.png"); dcli_translate_filename(fname, "$pwr_exe/xtt_eventlog.png");
gtk_container_add( gtk_container_add(GTK_CONTAINER(tools_eventlog),
GTK_CONTAINER(tools_eventlog), gtk_image_new_from_file(fname)); gtk_image_new_from_file(fname));
g_signal_connect( g_signal_connect(tools_eventlog, "clicked", G_CALLBACK(activate_eventlog),
tools_eventlog, "clicked", G_CALLBACK(activate_eventlog), this); this);
gtk_toolbar_append_widget(GTK_TOOLBAR(tools2), tools_eventlog, gtk_toolbar_append_widget(GTK_TOOLBAR(tools2), tools_eventlog,
CoWowGtk::translate_utf8("Event Log"), ""); CoWowGtk::translate_utf8("Event Log"), "");
GtkWidget* tools_blocklist = gtk_button_new(); GtkWidget* tools_blocklist = gtk_button_new();
dcli_translate_filename(fname, "$pwr_exe/xtt_blocklist.png"); dcli_translate_filename(fname, "$pwr_exe/xtt_blocklist.png");
gtk_container_add( gtk_container_add(GTK_CONTAINER(tools_blocklist),
GTK_CONTAINER(tools_blocklist), gtk_image_new_from_file(fname)); gtk_image_new_from_file(fname));
g_signal_connect( g_signal_connect(tools_blocklist, "clicked", G_CALLBACK(activate_blocklist),
tools_blocklist, "clicked", G_CALLBACK(activate_blocklist), this); this);
gtk_toolbar_append_widget(GTK_TOOLBAR(tools2), tools_blocklist, gtk_toolbar_append_widget(GTK_TOOLBAR(tools2), tools_blocklist,
CoWowGtk::translate_utf8("Blocked Alarms"), ""); CoWowGtk::translate_utf8("Blocked Alarms"), "");
GtkWidget* tools_navigator = gtk_button_new(); GtkWidget* tools_navigator = gtk_button_new();
dcli_translate_filename(fname, "$pwr_exe/xtt_navigator.png"); dcli_translate_filename(fname, "$pwr_exe/xtt_navigator.png");
gtk_container_add( gtk_container_add(GTK_CONTAINER(tools_navigator),
GTK_CONTAINER(tools_navigator), gtk_image_new_from_file(fname)); gtk_image_new_from_file(fname));
g_signal_connect( g_signal_connect(tools_navigator, "clicked", G_CALLBACK(activate_navigator),
tools_navigator, "clicked", G_CALLBACK(activate_navigator), this); this);
gtk_toolbar_append_widget(GTK_TOOLBAR(tools2), tools_navigator, gtk_toolbar_append_widget(GTK_TOOLBAR(tools2), tools_navigator,
CoWowGtk::translate_utf8("Navigator"), ""); CoWowGtk::translate_utf8("Navigator"), "");
// System pushbuttons // System pushbuttons
GtkWidget* sysbutton_box = gtk_vbox_new(FALSE, 0); GtkWidget* sysbutton_box = gtk_vbox_new(FALSE, 0);
gtk_box_pack_start( gtk_box_pack_start(GTK_BOX(sysbutton_box), GTK_WIDGET(menu_bar), FALSE, FALSE,
GTK_BOX(sysbutton_box), GTK_WIDGET(menu_bar), FALSE, FALSE, 0); 0);
gtk_box_pack_start( gtk_box_pack_start(GTK_BOX(sysbutton_box), GTK_WIDGET(tools), FALSE, FALSE,
GTK_BOX(sysbutton_box), GTK_WIDGET(tools), FALSE, FALSE, 0); 0);
gtk_box_pack_start( gtk_box_pack_start(GTK_BOX(sysbutton_box), GTK_WIDGET(tools2), FALSE, FALSE,
GTK_BOX(sysbutton_box), GTK_WIDGET(tools2), FALSE, FALSE, 0); 0);
gtk_widget_set_size_request(sysbutton_box, 160, -1); gtk_widget_set_size_request(sysbutton_box, 160, -1);
sts = configure(opplace); sts = configure(opplace);
...@@ -693,7 +692,8 @@ OpGtk::OpGtk(void* op_parent_ctx, GtkWidget* op_parent_wid, char* opplace, ...@@ -693,7 +692,8 @@ OpGtk::OpGtk(void* op_parent_ctx, GtkWidget* op_parent_wid, char* opplace,
// Status bar // Status bar
GtkWidget* status_bar = NULL; GtkWidget* status_bar = NULL;
if (!(layout_mask & pwr_mOpWindLayoutMask_HideStatusBar)) { if (!(layout_mask & pwr_mOpWindLayoutMask_HideStatusBar))
{
char text[80]; char text[80];
pwr_tTime time; pwr_tTime time;
...@@ -705,29 +705,35 @@ OpGtk::OpGtk(void* op_parent_ctx, GtkWidget* op_parent_wid, char* opplace, ...@@ -705,29 +705,35 @@ OpGtk::OpGtk(void* op_parent_ctx, GtkWidget* op_parent_wid, char* opplace,
title_label = gtk_label_new(""); title_label = gtk_label_new("");
status_bar = gtk_hbox_new(FALSE, 0); status_bar = gtk_hbox_new(FALSE, 0);
gtk_box_pack_start( gtk_box_pack_start(GTK_BOX(status_bar), GTK_WIDGET(icon_image), FALSE,
GTK_BOX(status_bar), GTK_WIDGET(icon_image), FALSE, FALSE, 5); FALSE, 5);
gtk_box_pack_start( gtk_box_pack_start(GTK_BOX(status_bar), GTK_WIDGET(title_label), FALSE,
GTK_BOX(status_bar), GTK_WIDGET(title_label), FALSE, FALSE, 20); FALSE, 20);
// Add node supervision buttons // Add node supervision buttons
int padding1, padding2, buttonwidth; int padding1, padding2, buttonwidth;
if (sup_vect.size() > 10) { if (sup_vect.size() > 10)
{
padding1 = 0; padding1 = 0;
padding2 = 0; padding2 = 0;
buttonwidth = (xtt_monitor_geometry.width - 350) / sup_vect.size(); buttonwidth = (monitor_geometry.width - 350) / sup_vect.size();
} else if (sup_vect.size() > 6) { }
else if (sup_vect.size() > 6)
{
padding1 = 8; padding1 = 8;
padding2 = 5; padding2 = 5;
buttonwidth buttonwidth =
= (xtt_monitor_geometry.width - 350) / sup_vect.size() - 2 * padding2; (monitor_geometry.width - 350) / sup_vect.size() - 2 * padding2;
} else { }
else
{
padding1 = 8; padding1 = 8;
padding2 = 5; padding2 = 5;
buttonwidth = 0; buttonwidth = 0;
} }
for (unsigned int i = 0; i < sup_vect.size(); i++) { for (unsigned int i = 0; i < sup_vect.size(); i++)
{
GtkWidget* node_label = gtk_label_new(""); GtkWidget* node_label = gtk_label_new("");
snprintf(text, sizeof(text), "<span size=\"%d\">%s</span>", 11 * 1024, snprintf(text, sizeof(text), "<span size=\"%d\">%s</span>", 11 * 1024,
sup_vect[i].node_name); sup_vect[i].node_name);
...@@ -748,8 +754,8 @@ OpGtk::OpGtk(void* op_parent_ctx, GtkWidget* op_parent_wid, char* opplace, ...@@ -748,8 +754,8 @@ OpGtk::OpGtk(void* op_parent_ctx, GtkWidget* op_parent_wid, char* opplace,
gtk_fixed_put(GTK_FIXED(node_ind_frame_box), node_ind, 1, 1); gtk_fixed_put(GTK_FIXED(node_ind_frame_box), node_ind, 1, 1);
gtk_box_pack_start(GTK_BOX(node_hbox), GTK_WIDGET(node_ind_frame_box), gtk_box_pack_start(GTK_BOX(node_hbox), GTK_WIDGET(node_ind_frame_box),
FALSE, FALSE, padding1); FALSE, FALSE, padding1);
gtk_box_pack_start( gtk_box_pack_start(GTK_BOX(node_hbox), GTK_WIDGET(node_label_bg), TRUE,
GTK_BOX(node_hbox), GTK_WIDGET(node_label_bg), TRUE, TRUE, padding1); TRUE, padding1);
GtkWidget* node_image = gtk_vbox_new(FALSE, 0); GtkWidget* node_image = gtk_vbox_new(FALSE, 0);
GtkWidget* node_ind_filler1 = gtk_event_box_new(); GtkWidget* node_ind_filler1 = gtk_event_box_new();
...@@ -760,12 +766,12 @@ OpGtk::OpGtk(void* op_parent_ctx, GtkWidget* op_parent_wid, char* opplace, ...@@ -760,12 +766,12 @@ OpGtk::OpGtk(void* op_parent_ctx, GtkWidget* op_parent_wid, char* opplace,
gtk_widget_modify_bg(GTK_WIDGET(node_ind), GTK_STATE_NORMAL, &gray_color); gtk_widget_modify_bg(GTK_WIDGET(node_ind), GTK_STATE_NORMAL, &gray_color);
gtk_widget_set_size_request(node_ind, 18, 18); gtk_widget_set_size_request(node_ind, 18, 18);
gtk_widget_modify_bg( gtk_widget_modify_bg(GTK_WIDGET(node_ind_frame), GTK_STATE_NORMAL,
GTK_WIDGET(node_ind_frame), GTK_STATE_NORMAL, &black_color); &black_color);
gtk_widget_modify_bg( gtk_widget_modify_bg(GTK_WIDGET(node_ind_frame), GTK_STATE_PRELIGHT,
GTK_WIDGET(node_ind_frame), GTK_STATE_PRELIGHT, &black_color); &black_color);
gtk_widget_modify_bg( gtk_widget_modify_bg(GTK_WIDGET(node_ind_frame), GTK_STATE_ACTIVE,
GTK_WIDGET(node_ind_frame), GTK_STATE_ACTIVE, &black_color); &black_color);
gtk_widget_set_size_request(node_ind_frame, 20, 20); gtk_widget_set_size_request(node_ind_frame, 20, 20);
if (buttonwidth) if (buttonwidth)
...@@ -781,11 +787,11 @@ OpGtk::OpGtk(void* op_parent_ctx, GtkWidget* op_parent_wid, char* opplace, ...@@ -781,11 +787,11 @@ OpGtk::OpGtk(void* op_parent_ctx, GtkWidget* op_parent_wid, char* opplace,
g_signal_connect(node_button, "button_press_event", g_signal_connect(node_button, "button_press_event",
G_CALLBACK(activate_sup_node), this); G_CALLBACK(activate_sup_node), this);
g_object_set(node_button, "can-focus", FALSE, NULL); g_object_set(node_button, "can-focus", FALSE, NULL);
gtk_box_pack_start( gtk_box_pack_start(GTK_BOX(status_bar), GTK_WIDGET(node_button), FALSE,
GTK_BOX(status_bar), GTK_WIDGET(node_button), FALSE, FALSE, padding2); FALSE, padding2);
} }
if (buttonwidth) if (buttonwidth)
gtk_widget_set_size_request(status_bar, xtt_monitor_geometry.width, -1); gtk_widget_set_size_request(status_bar, monitor_geometry.width, -1);
} }
// Main window // Main window
...@@ -800,10 +806,11 @@ OpGtk::OpGtk(void* op_parent_ctx, GtkWidget* op_parent_wid, char* opplace, ...@@ -800,10 +806,11 @@ OpGtk::OpGtk(void* op_parent_ctx, GtkWidget* op_parent_wid, char* opplace,
gtk_paned_pack2(GTK_PANED(pane), hbox_conf, FALSE, TRUE); gtk_paned_pack2(GTK_PANED(pane), hbox_conf, FALSE, TRUE);
GtkWidget* vbox_conf = gtk_vbox_new(FALSE, 0); GtkWidget* vbox_conf = gtk_vbox_new(FALSE, 0);
if (!(layout_mask & pwr_mOpWindLayoutMask_HideStatusBar)) { if (!(layout_mask & pwr_mOpWindLayoutMask_HideStatusBar))
{
gtk_box_pack_start(GTK_BOX(vbox_conf), status_bar, FALSE, FALSE, 0); gtk_box_pack_start(GTK_BOX(vbox_conf), status_bar, FALSE, FALSE, 0);
gtk_box_pack_start( gtk_box_pack_start(GTK_BOX(vbox_conf), gtk_hseparator_new(), FALSE, FALSE,
GTK_BOX(vbox_conf), gtk_hseparator_new(), FALSE, FALSE, 2); 2);
} }
gtk_box_pack_start(GTK_BOX(vbox_conf), pane, FALSE, FALSE, 0); gtk_box_pack_start(GTK_BOX(vbox_conf), pane, FALSE, FALSE, 0);
...@@ -817,7 +824,8 @@ OpGtk::OpGtk(void* op_parent_ctx, GtkWidget* op_parent_wid, char* opplace, ...@@ -817,7 +824,8 @@ OpGtk::OpGtk(void* op_parent_ctx, GtkWidget* op_parent_wid, char* opplace,
gtk_widget_show_all(toplevel); gtk_widget_show_all(toplevel);
if (start_jop) { if (start_jop)
{
jop = new Jop((void*)this); jop = new Jop((void*)this);
jop->command_cb = &jop_command_cb; jop->command_cb = &jop_command_cb;
} }
...@@ -829,23 +837,16 @@ OpGtk::OpGtk(void* op_parent_ctx, GtkWidget* op_parent_wid, char* opplace, ...@@ -829,23 +837,16 @@ OpGtk::OpGtk(void* op_parent_ctx, GtkWidget* op_parent_wid, char* opplace,
g_object_set(aalarm_box[3], "visible", FALSE, NULL); g_object_set(aalarm_box[3], "visible", FALSE, NULL);
g_object_set(aalarm_box[4], "visible", FALSE, NULL); g_object_set(aalarm_box[4], "visible", FALSE, NULL);
g_object_set(balarm_box, "visible", FALSE, NULL); g_object_set(balarm_box, "visible", FALSE, NULL);
g_object_set(decr_button, "visible", FALSE, NULL); g_object_set(decr_button, "visible", TRUE, NULL);
if (layout_mask & pwr_mOpWindLayoutMask_HideCloseButton) { if (layout_mask & pwr_mOpWindLayoutMask_HideCloseButton)
{
g_object_set(tools_close, "visible", FALSE, NULL); g_object_set(tools_close, "visible", FALSE, NULL);
g_object_set(functions_close, "visible", FALSE, NULL); g_object_set(functions_close, "visible", FALSE, NULL);
} }
if (a_height == 5) gtk_window_resize(GTK_WINDOW(toplevel), monitor_geometry.width,
activate_aalarm_decr(0, this); OP_HEIGHT_MIN);
if (a_height == 4) { gtk_window_move(GTK_WINDOW(toplevel), monitor_geometry.x, 0);
// g_object_set( decr_button, "visible", TRUE, NULL);
activate_aalarm_decr(0, this);
activate_aalarm_decr(0, this);
}
gtk_window_resize(
GTK_WINDOW(toplevel), xtt_monitor_geometry.width, OP_HEIGHT_MIN);
gtk_window_move(GTK_WINDOW(toplevel), 0, 0);
wow = new CoWowGtk(toplevel); wow = new CoWowGtk(toplevel);
sup_timerid = wow->timer_new(); sup_timerid = wow->timer_new();
...@@ -864,7 +865,8 @@ OpGtk::~OpGtk() ...@@ -864,7 +865,8 @@ OpGtk::~OpGtk()
{ {
if (jop) if (jop)
delete jop; delete jop;
if (sup_timerid) { if (sup_timerid)
{
sup_timerid->remove(); sup_timerid->remove();
delete sup_timerid; delete sup_timerid;
} }
...@@ -889,8 +891,8 @@ void OpGtk::add_close_button() ...@@ -889,8 +891,8 @@ void OpGtk::add_close_button()
g_object_set(functions_close, "visible", TRUE, NULL); g_object_set(functions_close, "visible", TRUE, NULL);
} }
int OpGtk::create_menu_item( int OpGtk::create_menu_item(const char* name, int pixmap, int append,
const char* name, int pixmap, int append, const char* cmd) const char* cmd)
{ {
GtkWidget* w; GtkWidget* w;
int sts; int sts;
...@@ -924,9 +926,11 @@ void OpGtk::update_alarm_info() ...@@ -924,9 +926,11 @@ void OpGtk::update_alarm_info()
int show_time = 0; int show_time = 0;
time_eFormat time_format = time_eFormat_Time; time_eFormat time_format = time_eFormat_Time;
char* s; char* s;
int backward = layout_mask & pwr_mOpWindLayoutMask_ShowOldestNotAckedAlarm ? 1 : 0; int backward =
layout_mask & pwr_mOpWindLayoutMask_ShowOldestNotAckedAlarm ? 1 : 0;
if (get_alarm_info_cb) { if (get_alarm_info_cb)
{
sts = (get_alarm_info_cb)(parent_ctx, &info, backward, a_height); sts = (get_alarm_info_cb)(parent_ctx, &info, backward, a_height);
if (EVEN(sts)) if (EVEN(sts))
return; return;
...@@ -941,55 +945,71 @@ void OpGtk::update_alarm_info() ...@@ -941,55 +945,71 @@ void OpGtk::update_alarm_info()
snprintf(str, sizeof(str), "%d", info.alarms_total); snprintf(str, sizeof(str), "%d", info.alarms_total);
gtk_label_set_text(GTK_LABEL(alarmcnt_label), str); gtk_label_set_text(GTK_LABEL(alarmcnt_label), str);
if (layout_mask & pwr_mOpWindLayoutMask_ShowAlarmDateAndTime) { if (layout_mask & pwr_mOpWindLayoutMask_ShowAlarmDateAndTime)
{
time_format = time_eFormat_ComprDateAndTime; time_format = time_eFormat_ComprDateAndTime;
show_time = 1; show_time = 1;
} else if (layout_mask & pwr_mOpWindLayoutMask_ShowAlarmTime) { }
else if (layout_mask & pwr_mOpWindLayoutMask_ShowAlarmTime)
{
time_format = time_eFormat_Time; time_format = time_eFormat_Time;
show_time = 1; show_time = 1;
} }
for (i = 0; i < 5; i++) { for (i = 0; i < 5; i++)
{
a_exist[i] = info.a_alarm_exist[i]; a_exist[i] = info.a_alarm_exist[i];
a_active[i] = info.a_alarm_active[i]; a_active[i] = info.a_alarm_active[i];
strcpy(a_alarm_moretext[i], info.a_alarm_moretext[i]); strcpy(a_alarm_moretext[i], info.a_alarm_moretext[i]);
if (info.a_alarm_exist[i]) { if (info.a_alarm_exist[i])
{
cnv_pango_text(info.a_alarm_text[i], ctext, sizeof(ctext)); cnv_pango_text(info.a_alarm_text[i], ctext, sizeof(ctext));
if (show_time) { if (show_time)
sts = time_AtoAscii( {
&info.a_alarm_time[i], time_format, timestr, sizeof(timestr)); sts = time_AtoAscii(&info.a_alarm_time[i], time_format, timestr,
sizeof(timestr));
if ((s = strrchr(timestr, '.'))) if ((s = strrchr(timestr, '.')))
*s = 0; *s = 0;
snprintf(text, sizeof(text), "<span size=\"%d\">%s %s %s</span>", snprintf(text, sizeof(text), "<span size=\"%d\">%s %s %s</span>",
fsize, timestr, info.a_alarm_alias[i], ctext); fsize, timestr, info.a_alarm_alias[i], ctext);
} else }
else
snprintf(text, sizeof(text), "<span size=\"%d\">%s %s</span>", fsize, snprintf(text, sizeof(text), "<span size=\"%d\">%s %s</span>", fsize,
info.a_alarm_alias[i], ctext); info.a_alarm_alias[i], ctext);
gtk_label_set_markup( gtk_label_set_markup(GTK_LABEL(aalarm_label[i]),
GTK_LABEL(aalarm_label[i]), CoWowGtk::convert_utf8(text)); CoWowGtk::convert_utf8(text));
snprintf( snprintf(text, sizeof(text), "<span size=\"%d\">%s</span>", fsize,
text, sizeof(text), "<span size=\"%d\">%s</span>", fsize, timestr); timestr);
// gtk_widget_modify_bg( aalarm_box[i], GTK_STATE_NORMAL, &red_color); // gtk_widget_modify_bg( aalarm_box[i], GTK_STATE_NORMAL, &red_color);
if (i < a_height) { if (i < a_height)
{
g_object_set(aalarm_box[i], "visible", TRUE, NULL); g_object_set(aalarm_box[i], "visible", TRUE, NULL);
if (info.a_alarm_active[i]) { if (info.a_alarm_active[i])
{
g_object_set(aalarm_active[i], "visible", TRUE, NULL); g_object_set(aalarm_active[i], "visible", TRUE, NULL);
} else { }
else
{
g_object_set(aalarm_active[i], "visible", FALSE, NULL); g_object_set(aalarm_active[i], "visible", FALSE, NULL);
} }
if (!streq(info.a_alarm_moretext[i], "")) { if (!streq(info.a_alarm_moretext[i], ""))
{
g_object_set(aalarm_info[i], "visible", TRUE, NULL); g_object_set(aalarm_info[i], "visible", TRUE, NULL);
} else { }
else
{
g_object_set(aalarm_info[i], "visible", FALSE, NULL); g_object_set(aalarm_info[i], "visible", FALSE, NULL);
} }
} }
} else { }
else
{
gtk_label_set_text(GTK_LABEL(aalarm_label[i]), ""); gtk_label_set_text(GTK_LABEL(aalarm_label[i]), "");
// gtk_widget_modify_bg( aalarm_box[i], GTK_STATE_NORMAL, &bg_color); // gtk_widget_modify_bg( aalarm_box[i], GTK_STATE_NORMAL, &bg_color);
g_object_set(aalarm_active[i], "visible", FALSE, NULL); g_object_set(aalarm_active[i], "visible", FALSE, NULL);
...@@ -997,43 +1017,54 @@ void OpGtk::update_alarm_info() ...@@ -997,43 +1017,54 @@ void OpGtk::update_alarm_info()
} }
} }
if (info.b_alarm_exist[0]) { if (info.b_alarm_exist[0])
{
balarm_type = evlist_eEventType_Alarm; balarm_type = evlist_eEventType_Alarm;
balarm_prio = mh_eEventPrio_B; balarm_prio = mh_eEventPrio_B;
strcpy(b_alarm_moretext, info.b_alarm_moretext[0]); strcpy(b_alarm_moretext, info.b_alarm_moretext[0]);
cnv_pango_text(info.b_alarm_text[0], ctext, sizeof(ctext)); cnv_pango_text(info.b_alarm_text[0], ctext, sizeof(ctext));
if (show_time) { if (show_time)
sts = time_AtoAscii( {
&info.b_alarm_time[0], time_format, timestr, sizeof(timestr)); sts = time_AtoAscii(&info.b_alarm_time[0], time_format, timestr,
sizeof(timestr));
if ((s = strrchr(timestr, '.'))) if ((s = strrchr(timestr, '.')))
*s = 0; *s = 0;
snprintf(text, sizeof(text), "<span size=\"%d\">%s %s %s</span>", snprintf(text, sizeof(text), "<span size=\"%d\">%s %s %s</span>",
fsize, timestr, info.b_alarm_alias[0], ctext); fsize, timestr, info.b_alarm_alias[0], ctext);
} else }
else
snprintf(text, sizeof(text), "<span size=\"%d\">%s %s</span>", fsize, snprintf(text, sizeof(text), "<span size=\"%d\">%s %s</span>", fsize,
info.b_alarm_alias[0], ctext); info.b_alarm_alias[0], ctext);
gtk_label_set_markup( gtk_label_set_markup(GTK_LABEL(balarm_label),
GTK_LABEL(balarm_label), CoWowGtk::convert_utf8(text)); CoWowGtk::convert_utf8(text));
gtk_widget_modify_bg(balarm_ebox, GTK_STATE_NORMAL, &yellow_color); gtk_widget_modify_bg(balarm_ebox, GTK_STATE_NORMAL, &yellow_color);
g_object_set(balarm_box, "visible", TRUE, NULL); g_object_set(balarm_box, "visible", TRUE, NULL);
gtk_label_set_text(GTK_LABEL(balarm_mark), "B"); gtk_label_set_text(GTK_LABEL(balarm_mark), "B");
if (info.b_alarm_active[0]) { if (info.b_alarm_active[0])
{
g_object_set(balarm_active, "visible", TRUE, NULL); g_object_set(balarm_active, "visible", TRUE, NULL);
} else { }
else
{
g_object_set(balarm_active, "visible", FALSE, NULL); g_object_set(balarm_active, "visible", FALSE, NULL);
} }
if (!streq(info.b_alarm_moretext[0], "")) { if (!streq(info.b_alarm_moretext[0], ""))
{
g_object_set(balarm_info, "visible", TRUE, NULL); g_object_set(balarm_info, "visible", TRUE, NULL);
} else { }
else
{
g_object_set(balarm_info, "visible", FALSE, NULL); g_object_set(balarm_info, "visible", FALSE, NULL);
} }
} else if (info.c_alarm_exist[0]) { }
else if (info.c_alarm_exist[0])
{
GdkColor blue_color; GdkColor blue_color;
gdk_color_parse("Lightblue", &blue_color); gdk_color_parse("Lightblue", &blue_color);
...@@ -1041,35 +1072,45 @@ void OpGtk::update_alarm_info() ...@@ -1041,35 +1072,45 @@ void OpGtk::update_alarm_info()
balarm_prio = mh_eEventPrio_C; balarm_prio = mh_eEventPrio_C;
strcpy(b_alarm_moretext, info.c_alarm_moretext[0]); strcpy(b_alarm_moretext, info.c_alarm_moretext[0]);
cnv_pango_text(info.c_alarm_text[0], ctext, sizeof(ctext)); cnv_pango_text(info.c_alarm_text[0], ctext, sizeof(ctext));
if (show_time) { if (show_time)
sts = time_AtoAscii( {
&info.c_alarm_time[0], time_format, timestr, sizeof(timestr)); sts = time_AtoAscii(&info.c_alarm_time[0], time_format, timestr,
sizeof(timestr));
if ((s = strrchr(timestr, '.'))) if ((s = strrchr(timestr, '.')))
*s = 0; *s = 0;
snprintf(text, sizeof(text), "<span size=\"%d\">%s %s %s</span>", snprintf(text, sizeof(text), "<span size=\"%d\">%s %s %s</span>",
fsize, timestr, info.c_alarm_alias[i], ctext); fsize, timestr, info.c_alarm_alias[i], ctext);
} else }
else
snprintf(text, sizeof(text), "<span size=\"%d\">%s %s</span>", fsize, snprintf(text, sizeof(text), "<span size=\"%d\">%s %s</span>", fsize,
info.c_alarm_alias[0], ctext); info.c_alarm_alias[0], ctext);
gtk_label_set_markup( gtk_label_set_markup(GTK_LABEL(balarm_label),
GTK_LABEL(balarm_label), CoWowGtk::convert_utf8(text)); CoWowGtk::convert_utf8(text));
gtk_widget_modify_bg(balarm_ebox, GTK_STATE_NORMAL, &blue_color); gtk_widget_modify_bg(balarm_ebox, GTK_STATE_NORMAL, &blue_color);
g_object_set(balarm_box, "visible", TRUE, NULL); g_object_set(balarm_box, "visible", TRUE, NULL);
gtk_label_set_text(GTK_LABEL(balarm_mark), "C"); gtk_label_set_text(GTK_LABEL(balarm_mark), "C");
if (info.c_alarm_active[0]) { if (info.c_alarm_active[0])
{
g_object_set(balarm_active, "visible", TRUE, NULL); g_object_set(balarm_active, "visible", TRUE, NULL);
} else { }
else
{
g_object_set(balarm_active, "visible", FALSE, NULL); g_object_set(balarm_active, "visible", FALSE, NULL);
} }
if (!streq(info.c_alarm_moretext[0], "")) { if (!streq(info.c_alarm_moretext[0], ""))
{
g_object_set(balarm_info, "visible", TRUE, NULL); g_object_set(balarm_info, "visible", TRUE, NULL);
} else { }
else
{
g_object_set(balarm_info, "visible", FALSE, NULL); g_object_set(balarm_info, "visible", FALSE, NULL);
} }
} else if (info.d_alarm_exist[0]) { }
else if (info.d_alarm_exist[0])
{
GdkColor violet_color; GdkColor violet_color;
gdk_color_parse("Violet", &violet_color); gdk_color_parse("Violet", &violet_color);
...@@ -1077,51 +1118,63 @@ void OpGtk::update_alarm_info() ...@@ -1077,51 +1118,63 @@ void OpGtk::update_alarm_info()
balarm_prio = mh_eEventPrio_D; balarm_prio = mh_eEventPrio_D;
strcpy(b_alarm_moretext, info.d_alarm_moretext[0]); strcpy(b_alarm_moretext, info.d_alarm_moretext[0]);
cnv_pango_text(info.d_alarm_text[0], ctext, sizeof(ctext)); cnv_pango_text(info.d_alarm_text[0], ctext, sizeof(ctext));
if (show_time) { if (show_time)
sts = time_AtoAscii( {
&info.d_alarm_time[0], time_format, timestr, sizeof(timestr)); sts = time_AtoAscii(&info.d_alarm_time[0], time_format, timestr,
sizeof(timestr));
if ((s = strrchr(timestr, '.'))) if ((s = strrchr(timestr, '.')))
*s = 0; *s = 0;
snprintf(text, sizeof(text), "<span size=\"%d\">%s %s %s</span>", snprintf(text, sizeof(text), "<span size=\"%d\">%s %s %s</span>",
fsize, timestr, info.d_alarm_alias[0], ctext); fsize, timestr, info.d_alarm_alias[0], ctext);
} else }
else
snprintf(text, sizeof(text), "<span size=\"%d\">%s %s</span>", fsize, snprintf(text, sizeof(text), "<span size=\"%d\">%s %s</span>", fsize,
info.d_alarm_alias[0], ctext); info.d_alarm_alias[0], ctext);
gtk_label_set_markup( gtk_label_set_markup(GTK_LABEL(balarm_label),
GTK_LABEL(balarm_label), CoWowGtk::convert_utf8(text)); CoWowGtk::convert_utf8(text));
gtk_widget_modify_bg(balarm_ebox, GTK_STATE_NORMAL, &violet_color); gtk_widget_modify_bg(balarm_ebox, GTK_STATE_NORMAL, &violet_color);
g_object_set(balarm_box, "visible", TRUE, NULL); g_object_set(balarm_box, "visible", TRUE, NULL);
gtk_label_set_text(GTK_LABEL(balarm_mark), "D"); gtk_label_set_text(GTK_LABEL(balarm_mark), "D");
if (info.b_alarm_active[0]) { if (info.b_alarm_active[0])
{
g_object_set(balarm_active, "visible", TRUE, NULL); g_object_set(balarm_active, "visible", TRUE, NULL);
} else { }
else
{
g_object_set(balarm_active, "visible", FALSE, NULL); g_object_set(balarm_active, "visible", FALSE, NULL);
} }
if (!streq(info.d_alarm_moretext[0], "")) { if (!streq(info.d_alarm_moretext[0], ""))
{
g_object_set(balarm_info, "visible", TRUE, NULL); g_object_set(balarm_info, "visible", TRUE, NULL);
} else { }
else
{
g_object_set(balarm_info, "visible", FALSE, NULL); g_object_set(balarm_info, "visible", FALSE, NULL);
} }
} else if (info.i_alarm_exist[0]) { }
else if (info.i_alarm_exist[0])
{
balarm_type = info.i_alarm_eventtype[0]; balarm_type = info.i_alarm_eventtype[0];
strcpy(b_alarm_moretext, info.i_alarm_moretext[0]); strcpy(b_alarm_moretext, info.i_alarm_moretext[0]);
cnv_pango_text(info.i_alarm_text[0], ctext, sizeof(ctext)); cnv_pango_text(info.i_alarm_text[0], ctext, sizeof(ctext));
if (show_time) { if (show_time)
sts = time_AtoAscii( {
&info.i_alarm_time[0], time_format, timestr, sizeof(timestr)); sts = time_AtoAscii(&info.i_alarm_time[0], time_format, timestr,
sizeof(timestr));
if ((s = strrchr(timestr, '.'))) if ((s = strrchr(timestr, '.')))
*s = 0; *s = 0;
snprintf(text, sizeof(text), "<span size=\"%d\">%s %s %s</span>", snprintf(text, sizeof(text), "<span size=\"%d\">%s %s %s</span>",
fsize, timestr, info.i_alarm_alias[0], ctext); fsize, timestr, info.i_alarm_alias[0], ctext);
} else }
else
snprintf(text, sizeof(text), "<span size=\"%d\">%s %s</span>", fsize, snprintf(text, sizeof(text), "<span size=\"%d\">%s %s</span>", fsize,
info.i_alarm_alias[0], ctext); info.i_alarm_alias[0], ctext);
gtk_label_set_markup( gtk_label_set_markup(GTK_LABEL(balarm_label),
GTK_LABEL(balarm_label), CoWowGtk::convert_utf8(text)); CoWowGtk::convert_utf8(text));
if (balarm_type == evlist_eEventType_InfoSuccess) if (balarm_type == evlist_eEventType_InfoSuccess)
gtk_widget_modify_bg(balarm_ebox, GTK_STATE_NORMAL, &green_color); gtk_widget_modify_bg(balarm_ebox, GTK_STATE_NORMAL, &green_color);
else else
...@@ -1130,17 +1183,25 @@ void OpGtk::update_alarm_info() ...@@ -1130,17 +1183,25 @@ void OpGtk::update_alarm_info()
gtk_label_set_text(GTK_LABEL(balarm_mark), "I"); gtk_label_set_text(GTK_LABEL(balarm_mark), "I");
if (info.i_alarm_active[0]) { if (info.i_alarm_active[0])
{
g_object_set(balarm_active, "visible", TRUE, NULL); g_object_set(balarm_active, "visible", TRUE, NULL);
} else { }
else
{
g_object_set(balarm_active, "visible", FALSE, NULL); g_object_set(balarm_active, "visible", FALSE, NULL);
} }
if (!streq(info.i_alarm_moretext[0], "")) { if (!streq(info.i_alarm_moretext[0], ""))
{
g_object_set(balarm_info, "visible", TRUE, NULL); g_object_set(balarm_info, "visible", TRUE, NULL);
} else { }
else
{
g_object_set(balarm_info, "visible", FALSE, NULL); g_object_set(balarm_info, "visible", FALSE, NULL);
} }
} else { }
else
{
gtk_label_set_text(GTK_LABEL(balarm_label), ""); gtk_label_set_text(GTK_LABEL(balarm_label), "");
gtk_widget_modify_bg(balarm_ebox, GTK_STATE_NORMAL, &bg_color); gtk_widget_modify_bg(balarm_ebox, GTK_STATE_NORMAL, &bg_color);
gtk_label_set_text(GTK_LABEL(balarm_mark), ""); gtk_label_set_text(GTK_LABEL(balarm_mark), "");
...@@ -1173,10 +1234,22 @@ int OpGtk::configure(char* opplace_str) ...@@ -1173,10 +1234,22 @@ int OpGtk::configure(char* opplace_str)
if (opplace_p->StartJavaProcess) if (opplace_p->StartJavaProcess)
start_jop = 1; start_jop = 1;
GdkScreen* xtt_screen = gtk_widget_get_screen(toplevel);
int numberOfMonitors = gdk_screen_get_n_monitors(xtt_screen);
int monitor = opplace_p->Monitor;
if (monitor > numberOfMonitors || monitor < 0) monitor = 0;
if (monitor == 0) monitor = gdk_screen_get_primary_monitor(xtt_screen);
else monitor = opplace_p->Monitor - 1;
gdk_screen_get_monitor_geometry(xtt_screen, monitor,
&monitor_geometry);
// Examine Graph objects // Examine Graph objects
for (i = 0; for (i = 0;
i < sizeof(opplace_p->FastAvail) / sizeof(opplace_p->FastAvail[0]); i < sizeof(opplace_p->FastAvail) / sizeof(opplace_p->FastAvail[0]); i++)
i++) { {
button_aref[i].Objid = pwr_cNOid; button_aref[i].Objid = pwr_cNOid;
if (cdh_ObjidIsNull(opplace_p->FastAvail[i].Objid)) if (cdh_ObjidIsNull(opplace_p->FastAvail[i].Objid))
continue; continue;
...@@ -1186,34 +1259,35 @@ int OpGtk::configure(char* opplace_str) ...@@ -1186,34 +1259,35 @@ int OpGtk::configure(char* opplace_str)
continue; continue;
memset(&attrref, 0, sizeof(attrref)); memset(&attrref, 0, sizeof(attrref));
switch (tid) { switch (tid)
{
case pwr_cClass_XttGraph: case pwr_cClass_XttGraph:
sts = gdh_ClassAttrToAttrref( sts =
pwr_cClass_XttGraph, ".ButtonText", &attrref); gdh_ClassAttrToAttrref(pwr_cClass_XttGraph, ".ButtonText", &attrref);
if (EVEN(sts)) if (EVEN(sts))
return sts; return sts;
break; break;
case pwr_cClass_XttMultiView: case pwr_cClass_XttMultiView:
sts = gdh_ClassAttrToAttrref( sts = gdh_ClassAttrToAttrref(pwr_cClass_XttMultiView, ".ButtonText",
pwr_cClass_XttMultiView, ".ButtonText", &attrref); &attrref);
if (EVEN(sts)) if (EVEN(sts))
return sts; return sts;
break; break;
case pwr_cClass_XttCamera: case pwr_cClass_XttCamera:
sts = gdh_ClassAttrToAttrref( sts =
pwr_cClass_XttCamera, ".ButtonText", &attrref); gdh_ClassAttrToAttrref(pwr_cClass_XttCamera, ".ButtonText", &attrref);
if (EVEN(sts)) if (EVEN(sts))
return sts; return sts;
break; break;
case pwr_cClass_SevPlotGroup: case pwr_cClass_SevPlotGroup:
sts = gdh_ClassAttrToAttrref( sts = gdh_ClassAttrToAttrref(pwr_cClass_SevPlotGroup, ".ButtonText",
pwr_cClass_SevPlotGroup, ".ButtonText", &attrref); &attrref);
if (EVEN(sts)) if (EVEN(sts))
return sts; return sts;
break; break;
case pwr_cClass_PlotGroup: case pwr_cClass_PlotGroup:
sts = gdh_ClassAttrToAttrref( sts =
pwr_cClass_PlotGroup, ".ButtonText", &attrref); gdh_ClassAttrToAttrref(pwr_cClass_PlotGroup, ".ButtonText", &attrref);
if (EVEN(sts)) if (EVEN(sts))
return sts; return sts;
break; break;
...@@ -1222,12 +1296,13 @@ int OpGtk::configure(char* opplace_str) ...@@ -1222,12 +1296,13 @@ int OpGtk::configure(char* opplace_str)
} }
attrref = cdh_ArefAdd(&opplace_p->FastAvail[i], &attrref); attrref = cdh_ArefAdd(&opplace_p->FastAvail[i], &attrref);
sts = gdh_GetObjectInfoAttrref( sts = gdh_GetObjectInfoAttrref(&attrref, (void*)button_title[i],
&attrref, (void*)button_title[i], sizeof(button_title[0])); sizeof(button_title[0]));
if (EVEN(sts)) if (EVEN(sts))
continue; continue;
if (streq(button_title[i], "")) { if (streq(button_title[i], ""))
{
// Take object name instead // Take object name instead
sts = gdh_AttrrefToName(&opplace_p->FastAvail[i], button_title[i], sts = gdh_AttrrefToName(&opplace_p->FastAvail[i], button_title[i],
sizeof(button_title[0]), cdh_mName_object); sizeof(button_title[0]), cdh_mName_object);
...@@ -1240,13 +1315,13 @@ int OpGtk::configure(char* opplace_str) ...@@ -1240,13 +1315,13 @@ int OpGtk::configure(char* opplace_str)
// Create the application buttons // Create the application buttons
for (i = 0; for (i = 0;
i < sizeof(opplace_p->FastAvail) / sizeof(opplace_p->FastAvail[0]); i < sizeof(opplace_p->FastAvail) / sizeof(opplace_p->FastAvail[0]); i++)
i++) { {
if (cdh_ObjidIsNull(button_aref[i].Objid)) if (cdh_ObjidIsNull(button_aref[i].Objid))
continue; continue;
char* textutf8 = g_convert( char* textutf8 =
button_title[i], -1, "UTF-8", "ISO8859-1", NULL, NULL, NULL); g_convert(button_title[i], -1, "UTF-8", "ISO8859-1", NULL, NULL, NULL);
// appl_buttons[i] = gtk_button_new_with_label(textutf8); // appl_buttons[i] = gtk_button_new_with_label(textutf8);
appl_buttons[i] = gtk_event_box_new(); appl_buttons[i] = gtk_event_box_new();
gtk_container_set_border_width(GTK_CONTAINER(appl_buttons[i]), 2); gtk_container_set_border_width(GTK_CONTAINER(appl_buttons[i]), 2);
...@@ -1254,7 +1329,8 @@ int OpGtk::configure(char* opplace_str) ...@@ -1254,7 +1329,8 @@ int OpGtk::configure(char* opplace_str)
g_free(textutf8); g_free(textutf8);
gtk_container_add(GTK_CONTAINER(appl_buttons[i]), label); gtk_container_add(GTK_CONTAINER(appl_buttons[i]), label);
gtk_widget_set_size_request(appl_buttons[i], -1, 28); gtk_widget_set_size_request(appl_buttons[i], -1, 28);
switch (i) { switch (i)
{
case 0: case 0:
g_signal_connect(appl_buttons[i], "button_press_event", g_signal_connect(appl_buttons[i], "button_press_event",
G_CALLBACK(activate_appl1), this); G_CALLBACK(activate_appl1), this);
...@@ -1358,46 +1434,35 @@ int OpGtk::configure(char* opplace_str) ...@@ -1358,46 +1434,35 @@ int OpGtk::configure(char* opplace_str)
} }
} }
int showRow[5] = {1, 1, 1, 0, 0};
appl_form = gtk_vbox_new(FALSE, 0); appl_form = gtk_vbox_new(FALSE, 0);
for (i = 0; for (i = 0;
i < sizeof(opplace_p->FastAvail) / sizeof(opplace_p->FastAvail[0]); i < sizeof(opplace_p->FastAvail) / sizeof(opplace_p->FastAvail[0]); i++)
i++) { {
if (i == 0) { // Create new box every 5th row
funcbox[0] = gtk_hbox_new(FALSE, 0); if (i % 5 == 0)
gtk_box_pack_start(GTK_BOX(appl_form), funcbox[0], FALSE, FALSE, 0); {
} else if (i == 4) { funcbox[i / 5] = gtk_hbox_new(FALSE, 0);
funcbox[1] = gtk_hbox_new(FALSE, 0); gtk_box_pack_start(GTK_BOX(appl_form), funcbox[i / 5], FALSE, FALSE, 0);
gtk_box_pack_start(GTK_BOX(appl_form), funcbox[1], FALSE, FALSE, 0); }
} else if (i == 9) {
funcbox[2] = gtk_hbox_new(FALSE, 0); // Pack everything and set showRow accordingly
gtk_box_pack_start(GTK_BOX(appl_form), funcbox[2], FALSE, FALSE, 0);
} else if (i == 14) {
funcbox[3] = gtk_hbox_new(FALSE, 0);
gtk_box_pack_start(GTK_BOX(appl_form), funcbox[3], FALSE, FALSE, 0);
} else if (i == 19) {
funcbox[4] = gtk_hbox_new(FALSE, 0);
gtk_box_pack_start(GTK_BOX(appl_form), funcbox[4], FALSE, FALSE, 0);
}
if (i < 5) {
if (cdh_ObjidIsNotNull(button_aref[i].Objid))
gtk_box_pack_start(GTK_BOX(funcbox[0]), appl_buttons[i], TRUE, TRUE, 0);
} else if (i < 10) {
if (cdh_ObjidIsNotNull(button_aref[i].Objid))
gtk_box_pack_start(GTK_BOX(funcbox[1]), appl_buttons[i], TRUE, TRUE, 0);
} else if (i < 15) {
if (cdh_ObjidIsNotNull(button_aref[i].Objid)) if (cdh_ObjidIsNotNull(button_aref[i].Objid))
gtk_box_pack_start(GTK_BOX(funcbox[2]), appl_buttons[i], TRUE, TRUE, 0); {
} else if (i < 20) { gtk_box_pack_start(GTK_BOX(funcbox[i / 5]), appl_buttons[i], TRUE, TRUE,
if (cdh_ObjidIsNotNull(button_aref[i].Objid)) { 0);
gtk_box_pack_start(GTK_BOX(funcbox[3]), appl_buttons[i], TRUE, TRUE, 0); showRow[i / 5] = 1;
a_height = 4;
} }
} else if (i < 25) {
if (cdh_ObjidIsNotNull(button_aref[i].Objid)) {
gtk_box_pack_start(GTK_BOX(funcbox[4]), appl_buttons[i], TRUE, TRUE, 0);
a_height = 5;
} }
// Start checking at the last row
for (int row = (sizeof(showRow) / sizeof(showRow[0])) - 1; row >= 0; row--)
{
if (showRow[row])
{
for (int height = a_height - 1; height > row; height--)
activate_aalarm_decr(0, this);
break;
} }
} }
...@@ -1453,7 +1518,8 @@ void OpGtk::activate_colortheme(GtkWidget* w, gpointer data) ...@@ -1453,7 +1518,8 @@ void OpGtk::activate_colortheme(GtkWidget* w, gpointer data)
{ {
OpGtk* op = (OpGtk*)data; OpGtk* op = (OpGtk*)data;
if (op->command_cb) { if (op->command_cb)
{
op->command_cb(op->parent_ctx, (char*)"open colorthemeselector"); op->command_cb(op->parent_ctx, (char*)"open colorthemeselector");
} }
} }
...@@ -1469,24 +1535,35 @@ void OpGtk::activate_aalarm_incr(GtkWidget* w, gpointer data) ...@@ -1469,24 +1535,35 @@ void OpGtk::activate_aalarm_incr(GtkWidget* w, gpointer data)
return; return;
op->a_height++; op->a_height++;
height = OP_HEIGHT_MIN + (op->a_height - 2) * OP_HEIGHT_INC height = OP_HEIGHT_MIN + (op->a_height - 2) * OP_HEIGHT_INC +
+ ((op->layout_mask & pwr_mOpWindLayoutMask_HideStatusBar) ? 0 : 1) ((op->layout_mask & pwr_mOpWindLayoutMask_HideStatusBar) ? 0 : 1) *
* OP_HEIGHT_STATUSBAR; OP_HEIGHT_STATUSBAR;
if (op->a_height == 3) { if (op->a_height == 3)
{
g_object_set(op->decr_button, "visible", TRUE, NULL); g_object_set(op->decr_button, "visible", TRUE, NULL);
} else if (op->a_height == 4) { }
else if (op->a_height == 4)
{
g_object_set(op->funcbox[3], "visible", TRUE, NULL); g_object_set(op->funcbox[3], "visible", TRUE, NULL);
} else if (op->a_height == 5) { }
else if (op->a_height == 5)
{
g_object_set(op->funcbox[4], "visible", TRUE, NULL); g_object_set(op->funcbox[4], "visible", TRUE, NULL);
} }
for (int i = 2; i < 5; i++) { for (int i = 2; i < 5; i++)
if (i < op->a_height) { {
if (op->a_exist[i]) { if (i < op->a_height)
{
if (op->a_exist[i])
{
g_object_set(op->aalarm_box[i], "visible", TRUE, NULL); g_object_set(op->aalarm_box[i], "visible", TRUE, NULL);
if (op->a_active[i]) { if (op->a_active[i])
{
g_object_set(op->aalarm_active[i], "visible", TRUE, NULL); g_object_set(op->aalarm_active[i], "visible", TRUE, NULL);
} else { }
else
{
g_object_set(op->aalarm_active[i], "visible", FALSE, NULL); g_object_set(op->aalarm_active[i], "visible", FALSE, NULL);
} }
} }
...@@ -1506,20 +1583,28 @@ void OpGtk::activate_aalarm_decr(GtkWidget* w, gpointer data) ...@@ -1506,20 +1583,28 @@ void OpGtk::activate_aalarm_decr(GtkWidget* w, gpointer data)
return; return;
op->a_height--; op->a_height--;
height = OP_HEIGHT_MIN + (op->a_height - 2) * OP_HEIGHT_INC height = OP_HEIGHT_MIN + (op->a_height - 2) * OP_HEIGHT_INC +
+ ((op->layout_mask & pwr_mOpWindLayoutMask_HideStatusBar) ? 0 : 1) ((op->layout_mask & pwr_mOpWindLayoutMask_HideStatusBar) ? 0 : 1) *
* OP_HEIGHT_STATUSBAR; OP_HEIGHT_STATUSBAR;
if (op->a_height == 2) { if (op->a_height == 2)
{
g_object_set(op->decr_button, "visible", FALSE, NULL); g_object_set(op->decr_button, "visible", FALSE, NULL);
} else if (op->a_height == 3) { }
else if (op->a_height == 3)
{
g_object_set(op->funcbox[3], "visible", FALSE, NULL); g_object_set(op->funcbox[3], "visible", FALSE, NULL);
} else if (op->a_height == 4) { }
else if (op->a_height == 4)
{
g_object_set(op->funcbox[4], "visible", FALSE, NULL); g_object_set(op->funcbox[4], "visible", FALSE, NULL);
} }
for (int i = 2; i < 5; i++) { for (int i = 2; i < 5; i++)
if (i >= op->a_height) { {
if (op->a_exist[i]) { if (i >= op->a_height)
{
if (op->a_exist[i])
{
g_object_set(op->aalarm_box[i], "visible", FALSE, NULL); g_object_set(op->aalarm_box[i], "visible", FALSE, NULL);
g_object_set(op->aalarm_active[i], "visible", FALSE, NULL); g_object_set(op->aalarm_active[i], "visible", FALSE, NULL);
g_object_set(op->aalarm_info[i], "visible", FALSE, NULL); g_object_set(op->aalarm_info[i], "visible", FALSE, NULL);
...@@ -1648,7 +1733,8 @@ void OpGtk::activate_cmd_menu_item(GtkWidget* w, gpointer data) ...@@ -1648,7 +1733,8 @@ void OpGtk::activate_cmd_menu_item(GtkWidget* w, gpointer data)
int sts; int sts;
sts = ((OpGtk*)op)->get_cmd(w, cmd); sts = ((OpGtk*)op)->get_cmd(w, cmd);
if (ODD(sts)) { if (ODD(sts))
{
op->activate_cmd_menu_item(cmd); op->activate_cmd_menu_item(cmd);
} }
} }
...@@ -1860,8 +1946,10 @@ void OpGtk::activate_info(GtkWidget* w, gpointer data) ...@@ -1860,8 +1946,10 @@ void OpGtk::activate_info(GtkWidget* w, gpointer data)
int OpGtk::get_cmd(GtkWidget* w, char* cmd) int OpGtk::get_cmd(GtkWidget* w, char* cmd)
{ {
for (unsigned int i = 0; i < cmd_vect.size(); i++) { for (unsigned int i = 0; i < cmd_vect.size(); i++)
if (w == cmd_vect[i].w) { {
if (w == cmd_vect[i].w)
{
strcpy(cmd, cmd_vect[i].cmd); strcpy(cmd, cmd_vect[i].cmd);
return 1; return 1;
} }
...@@ -1873,7 +1961,8 @@ void OpGtk::change_sup_color(void* imagew, op_eSupColor color) ...@@ -1873,7 +1961,8 @@ void OpGtk::change_sup_color(void* imagew, op_eSupColor color)
{ {
GdkColor* col; GdkColor* col;
switch (color) { switch (color)
{
case op_eSupColor_Gray: case op_eSupColor_Gray:
col = &gray_color; col = &gray_color;
break; break;
...@@ -1940,129 +2029,155 @@ void OpGtk::set_color_theme(int idx) ...@@ -1940,129 +2029,155 @@ void OpGtk::set_color_theme(int idx)
GdkColor menu_text; GdkColor menu_text;
red_color.pixel = 0; red_color.pixel = 0;
red_color.red = 0xFFFF red_color.red =
* colors[(glow_eCtColor_RedIndicator - glow_eDrawType_CustomColor1) * 3]; 0xFFFF *
red_color.green = 0xFFFF colors[(glow_eCtColor_RedIndicator - glow_eDrawType_CustomColor1) * 3];
* colors[(glow_eCtColor_RedIndicator - glow_eDrawType_CustomColor1) * 3 red_color.green =
+ 1]; 0xFFFF *
red_color.blue = 0xFFFF colors[(glow_eCtColor_RedIndicator - glow_eDrawType_CustomColor1) * 3 +
* colors[(glow_eCtColor_RedIndicator - glow_eDrawType_CustomColor1) * 3 1];
+ 2]; red_color.blue =
0xFFFF *
colors[(glow_eCtColor_RedIndicator - glow_eDrawType_CustomColor1) * 3 +
2];
green_color.pixel = 0; green_color.pixel = 0;
green_color.red = 0xFFFF green_color.red =
* colors[(glow_eCtColor_GreenIndicator - glow_eDrawType_CustomColor1) 0xFFFF *
* 3]; colors[(glow_eCtColor_GreenIndicator - glow_eDrawType_CustomColor1) * 3];
green_color.green = 0xFFFF green_color.green =
* colors[(glow_eCtColor_GreenIndicator - glow_eDrawType_CustomColor1) * 3 0xFFFF *
+ 1]; colors[(glow_eCtColor_GreenIndicator - glow_eDrawType_CustomColor1) * 3 +
green_color.blue = 0xFFFF 1];
* colors[(glow_eCtColor_GreenIndicator - glow_eDrawType_CustomColor1) * 3 green_color.blue =
+ 2]; 0xFFFF *
colors[(glow_eCtColor_GreenIndicator - glow_eDrawType_CustomColor1) * 3 +
2];
yellow_color.pixel = 0; yellow_color.pixel = 0;
yellow_color.red = 0xFFFF yellow_color.red =
* colors[(glow_eCtColor_YellowIndicator - glow_eDrawType_CustomColor1) 0xFFFF *
* 3]; colors[(glow_eCtColor_YellowIndicator - glow_eDrawType_CustomColor1) * 3];
yellow_color.green = 0xFFFF yellow_color.green =
* colors[(glow_eCtColor_YellowIndicator - glow_eDrawType_CustomColor1) * 3 0xFFFF *
+ 1]; colors[(glow_eCtColor_YellowIndicator - glow_eDrawType_CustomColor1) * 3 +
yellow_color.blue = 0xFFFF 1];
* colors[(glow_eCtColor_YellowIndicator - glow_eDrawType_CustomColor1) * 3 yellow_color.blue =
+ 2]; 0xFFFF *
colors[(glow_eCtColor_YellowIndicator - glow_eDrawType_CustomColor1) * 3 +
2];
gray_color.pixel = 0; gray_color.pixel = 0;
gray_color.red = 0xFFFF gray_color.red =
* colors[(glow_eCtColor_IndicatorLowColor - glow_eDrawType_CustomColor1) 0xFFFF *
* 3]; colors[(glow_eCtColor_IndicatorLowColor - glow_eDrawType_CustomColor1) *
gray_color.green = 0xFFFF 3];
* colors[(glow_eCtColor_IndicatorLowColor - glow_eDrawType_CustomColor1) gray_color.green =
* 3 0xFFFF *
+ 1]; colors[(glow_eCtColor_IndicatorLowColor - glow_eDrawType_CustomColor1) *
gray_color.blue = 0xFFFF 3 +
* colors[(glow_eCtColor_IndicatorLowColor - glow_eDrawType_CustomColor1) 1];
* 3 gray_color.blue =
+ 2]; 0xFFFF *
colors[(glow_eCtColor_IndicatorLowColor - glow_eDrawType_CustomColor1) *
3 +
2];
bg.pixel = 0; bg.pixel = 0;
bg.red = 0xFFFF bg.red = 0xFFFF *
* colors[(glow_eCtColor_Background - glow_eDrawType_CustomColor1) * 3]; colors[(glow_eCtColor_Background - glow_eDrawType_CustomColor1) * 3];
bg.green = 0xFFFF bg.green =
* colors[(glow_eCtColor_Background - glow_eDrawType_CustomColor1) * 3 0xFFFF *
+ 1]; colors[(glow_eCtColor_Background - glow_eDrawType_CustomColor1) * 3 + 1];
bg.blue = 0xFFFF bg.blue =
* colors[(glow_eCtColor_Background - glow_eDrawType_CustomColor1) * 3 0xFFFF *
+ 2]; colors[(glow_eCtColor_Background - glow_eDrawType_CustomColor1) * 3 + 2];
bg_text.pixel = 0; bg_text.pixel = 0;
bg_text.red = 0xFFFF * colors[(glow_eCtColor_BackgroundTextAndLines bg_text.red = 0xFFFF * colors[(glow_eCtColor_BackgroundTextAndLines -
- glow_eDrawType_CustomColor1) glow_eDrawType_CustomColor1) *
* 3]; 3];
bg_text.green = 0xFFFF * colors[(glow_eCtColor_BackgroundTextAndLines bg_text.green = 0xFFFF * colors[(glow_eCtColor_BackgroundTextAndLines -
- glow_eDrawType_CustomColor1) glow_eDrawType_CustomColor1) *
* 3 3 +
+ 1]; 1];
bg_text.blue = 0xFFFF * colors[(glow_eCtColor_BackgroundTextAndLines bg_text.blue = 0xFFFF * colors[(glow_eCtColor_BackgroundTextAndLines -
- glow_eDrawType_CustomColor1) glow_eDrawType_CustomColor1) *
* 3 3 +
+ 2]; 2];
button_bg.pixel = 0; button_bg.pixel = 0;
button_bg.red = 0xFFFF button_bg.red =
* colors[(glow_eCtColor_ButtonFillcolor - glow_eDrawType_CustomColor1) 0xFFFF *
* 3]; colors[(glow_eCtColor_ButtonFillcolor - glow_eDrawType_CustomColor1) * 3];
button_bg.green = 0xFFFF button_bg.green =
* colors[(glow_eCtColor_ButtonFillcolor - glow_eDrawType_CustomColor1) * 3 0xFFFF *
+ 1]; colors[(glow_eCtColor_ButtonFillcolor - glow_eDrawType_CustomColor1) * 3 +
button_bg.blue = 0xFFFF 1];
* colors[(glow_eCtColor_ButtonFillcolor - glow_eDrawType_CustomColor1) * 3 button_bg.blue =
+ 2]; 0xFFFF *
colors[(glow_eCtColor_ButtonFillcolor - glow_eDrawType_CustomColor1) * 3 +
2];
button_text.pixel = 0; button_text.pixel = 0;
button_text.red = 0xFFFF button_text.red =
* colors[(glow_eCtColor_ButtonTextcolor - glow_eDrawType_CustomColor1) 0xFFFF *
* 3]; colors[(glow_eCtColor_ButtonTextcolor - glow_eDrawType_CustomColor1) * 3];
button_text.green = 0xFFFF button_text.green =
* colors[(glow_eCtColor_ButtonTextcolor - glow_eDrawType_CustomColor1) * 3 0xFFFF *
+ 1]; colors[(glow_eCtColor_ButtonTextcolor - glow_eDrawType_CustomColor1) * 3 +
button_text.blue = 0xFFFF 1];
* colors[(glow_eCtColor_ButtonTextcolor - glow_eDrawType_CustomColor1) * 3 button_text.blue =
+ 2]; 0xFFFF *
colors[(glow_eCtColor_ButtonTextcolor - glow_eDrawType_CustomColor1) * 3 +
2];
button_prelight.pixel = 0; button_prelight.pixel = 0;
button_prelight.red = 0xFFFF button_prelight.red =
* colors[(glow_eCtColor_ButtonFillcolor - glow_eDrawType_CustomColor1 + 3) 0xFFFF *
* 3]; colors[(glow_eCtColor_ButtonFillcolor - glow_eDrawType_CustomColor1 + 3) *
button_prelight.green = 0xFFFF 3];
* colors[(glow_eCtColor_ButtonFillcolor - glow_eDrawType_CustomColor1 + 3) button_prelight.green =
* 3 0xFFFF *
+ 1]; colors[(glow_eCtColor_ButtonFillcolor - glow_eDrawType_CustomColor1 + 3) *
button_prelight.blue = 0xFFFF 3 +
* colors[(glow_eCtColor_ButtonFillcolor - glow_eDrawType_CustomColor1 + 3) 1];
* 3 button_prelight.blue =
+ 2]; 0xFFFF *
colors[(glow_eCtColor_ButtonFillcolor - glow_eDrawType_CustomColor1 + 3) *
3 +
2];
button_active.pixel = 0; button_active.pixel = 0;
button_active.red = 0xFFFF button_active.red =
* colors[(glow_eCtColor_ButtonFillcolor - glow_eDrawType_CustomColor1 + 2) 0xFFFF *
* 3]; colors[(glow_eCtColor_ButtonFillcolor - glow_eDrawType_CustomColor1 + 2) *
button_active.green = 0xFFFF 3];
* colors[(glow_eCtColor_ButtonFillcolor - glow_eDrawType_CustomColor1 + 2) button_active.green =
* 3 0xFFFF *
+ 1]; colors[(glow_eCtColor_ButtonFillcolor - glow_eDrawType_CustomColor1 + 2) *
button_active.blue = 0xFFFF 3 +
* colors[(glow_eCtColor_ButtonFillcolor - glow_eDrawType_CustomColor1 + 2) 1];
* 3 button_active.blue =
+ 2]; 0xFFFF *
colors[(glow_eCtColor_ButtonFillcolor - glow_eDrawType_CustomColor1 + 2) *
3 +
2];
menu.pixel = 0; menu.pixel = 0;
menu.red = 0xFFFF menu.red =
* colors[(glow_eCtColor_MenuFillcolor - glow_eDrawType_CustomColor1) * 3]; 0xFFFF *
menu.green = 0xFFFF colors[(glow_eCtColor_MenuFillcolor - glow_eDrawType_CustomColor1) * 3];
* colors[(glow_eCtColor_MenuFillcolor - glow_eDrawType_CustomColor1) * 3 menu.green =
+ 1]; 0xFFFF *
menu.blue = 0xFFFF colors[(glow_eCtColor_MenuFillcolor - glow_eDrawType_CustomColor1) * 3 +
* colors[(glow_eCtColor_MenuFillcolor - glow_eDrawType_CustomColor1) * 3 1];
+ 2]; menu.blue =
0xFFFF *
colors[(glow_eCtColor_MenuFillcolor - glow_eDrawType_CustomColor1) * 3 +
2];
menu_text.pixel = 0; menu_text.pixel = 0;
menu_text.red = 0xFFFF menu_text.red =
* colors[(glow_eCtColor_MenuTextcolor - glow_eDrawType_CustomColor1) * 3]; 0xFFFF *
menu_text.green = 0xFFFF colors[(glow_eCtColor_MenuTextcolor - glow_eDrawType_CustomColor1) * 3];
* colors[(glow_eCtColor_MenuTextcolor - glow_eDrawType_CustomColor1) * 3 menu_text.green =
+ 1]; 0xFFFF *
menu_text.blue = 0xFFFF colors[(glow_eCtColor_MenuTextcolor - glow_eDrawType_CustomColor1) * 3 +
* colors[(glow_eCtColor_MenuTextcolor - glow_eDrawType_CustomColor1) * 3 1];
+ 2]; menu_text.blue =
0xFFFF *
colors[(glow_eCtColor_MenuTextcolor - glow_eDrawType_CustomColor1) * 3 +
2];
gtk_widget_modify_bg(toplevel, GTK_STATE_NORMAL, &bg); gtk_widget_modify_bg(toplevel, GTK_STATE_NORMAL, &bg);
gtk_widget_modify_fg(GTK_WIDGET(title_label), GTK_STATE_NORMAL, &bg_text); gtk_widget_modify_fg(GTK_WIDGET(title_label), GTK_STATE_NORMAL, &bg_text);
...@@ -2078,72 +2193,76 @@ void OpGtk::set_color_theme(int idx) ...@@ -2078,72 +2193,76 @@ void OpGtk::set_color_theme(int idx)
gtk_widget_modify_fg(GTK_WIDGET(balarm_mark), GTK_STATE_NORMAL, &bg_text); gtk_widget_modify_fg(GTK_WIDGET(balarm_mark), GTK_STATE_NORMAL, &bg_text);
gtk_widget_modify_bg(GTK_WIDGET(balarm_active_box), GTK_STATE_NORMAL, &bg); gtk_widget_modify_bg(GTK_WIDGET(balarm_active_box), GTK_STATE_NORMAL, &bg);
for (int i = 0; i < 5; i++) for (int i = 0; i < 5; i++)
gtk_widget_modify_bg( gtk_widget_modify_bg(GTK_WIDGET(aalarm_active_box[i]), GTK_STATE_NORMAL,
GTK_WIDGET(aalarm_active_box[i]), GTK_STATE_NORMAL, &bg); &bg);
gtk_widget_modify_bg(GTK_WIDGET(menu_bar), GTK_STATE_NORMAL, &menu); gtk_widget_modify_bg(GTK_WIDGET(menu_bar), GTK_STATE_NORMAL, &menu);
gtk_widget_modify_bg(GTK_WIDGET(menu_bar), GTK_STATE_ACTIVE, &menu); gtk_widget_modify_bg(GTK_WIDGET(menu_bar), GTK_STATE_ACTIVE, &menu);
GList* children = gtk_container_get_children(GTK_CONTAINER(menu_bar)); GList* children = gtk_container_get_children(GTK_CONTAINER(menu_bar));
GList* child; GList* child;
for (child = g_list_first(children); child; child = g_list_next(child)) { for (child = g_list_first(children); child; child = g_list_next(child))
{
gtk_widget_modify_bg(GTK_WIDGET(child->data), GTK_STATE_NORMAL, &menu); gtk_widget_modify_bg(GTK_WIDGET(child->data), GTK_STATE_NORMAL, &menu);
gtk_widget_modify_fg(GTK_WIDGET(child->data), GTK_STATE_NORMAL, &menu_text); gtk_widget_modify_fg(GTK_WIDGET(child->data), GTK_STATE_NORMAL, &menu_text);
GList* children2 = gtk_container_get_children(GTK_CONTAINER(child->data)); GList* children2 = gtk_container_get_children(GTK_CONTAINER(child->data));
GList* child2; GList* child2;
for (child2 = g_list_first(children2); child2; for (child2 = g_list_first(children2); child2; child2 = g_list_next(child2))
child2 = g_list_next(child2)) { {
gtk_widget_modify_bg(GTK_WIDGET(child2->data), GTK_STATE_NORMAL, &menu); gtk_widget_modify_bg(GTK_WIDGET(child2->data), GTK_STATE_NORMAL, &menu);
gtk_widget_modify_fg( gtk_widget_modify_fg(GTK_WIDGET(child2->data), GTK_STATE_NORMAL,
GTK_WIDGET(child2->data), GTK_STATE_NORMAL, &menu_text); &menu_text);
} }
g_list_free(children2); g_list_free(children2);
} }
g_list_free(children); g_list_free(children);
for (unsigned int i = 0; i < sup_vect.size(); i++) { for (unsigned int i = 0; i < sup_vect.size(); i++)
gtk_widget_modify_bg( {
GTK_WIDGET(sup_vect[i].buttonw), GTK_STATE_NORMAL, &button_bg); gtk_widget_modify_bg(GTK_WIDGET(sup_vect[i].buttonw), GTK_STATE_NORMAL,
gtk_widget_modify_bg( &button_bg);
GTK_WIDGET(sup_vect[i].buttonw), GTK_STATE_PRELIGHT, &button_prelight); gtk_widget_modify_bg(GTK_WIDGET(sup_vect[i].buttonw), GTK_STATE_PRELIGHT,
gtk_widget_modify_bg( &button_prelight);
GTK_WIDGET(sup_vect[i].buttonw), GTK_STATE_ACTIVE, &button_active); gtk_widget_modify_bg(GTK_WIDGET(sup_vect[i].buttonw), GTK_STATE_ACTIVE,
gtk_widget_modify_bg( &button_active);
GTK_WIDGET(sup_vect[i].indfiller1w), GTK_STATE_NORMAL, &button_bg); gtk_widget_modify_bg(GTK_WIDGET(sup_vect[i].indfiller1w), GTK_STATE_NORMAL,
&button_bg);
gtk_widget_modify_bg(GTK_WIDGET(sup_vect[i].indfiller1w), gtk_widget_modify_bg(GTK_WIDGET(sup_vect[i].indfiller1w),
GTK_STATE_PRELIGHT, &button_prelight); GTK_STATE_PRELIGHT, &button_prelight);
gtk_widget_modify_bg( gtk_widget_modify_bg(GTK_WIDGET(sup_vect[i].indfiller1w), GTK_STATE_ACTIVE,
GTK_WIDGET(sup_vect[i].indfiller1w), GTK_STATE_ACTIVE, &button_active); &button_active);
gtk_widget_modify_bg( gtk_widget_modify_bg(GTK_WIDGET(sup_vect[i].indfiller2w), GTK_STATE_NORMAL,
GTK_WIDGET(sup_vect[i].indfiller2w), GTK_STATE_NORMAL, &button_bg); &button_bg);
gtk_widget_modify_bg(GTK_WIDGET(sup_vect[i].indfiller2w), gtk_widget_modify_bg(GTK_WIDGET(sup_vect[i].indfiller2w),
GTK_STATE_PRELIGHT, &button_prelight); GTK_STATE_PRELIGHT, &button_prelight);
gtk_widget_modify_bg( gtk_widget_modify_bg(GTK_WIDGET(sup_vect[i].indfiller2w), GTK_STATE_ACTIVE,
GTK_WIDGET(sup_vect[i].indfiller2w), GTK_STATE_ACTIVE, &button_active); &button_active);
gtk_widget_modify_fg( gtk_widget_modify_fg(GTK_WIDGET(sup_vect[i].textw), GTK_STATE_NORMAL,
GTK_WIDGET(sup_vect[i].textw), GTK_STATE_NORMAL, &button_text); &button_text);
gtk_widget_modify_fg( gtk_widget_modify_fg(GTK_WIDGET(sup_vect[i].textw), GTK_STATE_PRELIGHT,
GTK_WIDGET(sup_vect[i].textw), GTK_STATE_PRELIGHT, &button_text); &button_text);
gtk_widget_modify_fg( gtk_widget_modify_fg(GTK_WIDGET(sup_vect[i].textw), GTK_STATE_ACTIVE,
GTK_WIDGET(sup_vect[i].textw), GTK_STATE_ACTIVE, &button_text); &button_text);
gtk_widget_modify_bg( gtk_widget_modify_bg(GTK_WIDGET(sup_vect[i].textbgw), GTK_STATE_NORMAL,
GTK_WIDGET(sup_vect[i].textbgw), GTK_STATE_NORMAL, &button_bg); &button_bg);
gtk_widget_modify_bg( gtk_widget_modify_bg(GTK_WIDGET(sup_vect[i].textbgw), GTK_STATE_PRELIGHT,
GTK_WIDGET(sup_vect[i].textbgw), GTK_STATE_PRELIGHT, &button_prelight); &button_prelight);
gtk_widget_modify_bg( gtk_widget_modify_bg(GTK_WIDGET(sup_vect[i].textbgw), GTK_STATE_ACTIVE,
GTK_WIDGET(sup_vect[i].textbgw), GTK_STATE_ACTIVE, &button_active); &button_active);
sup_vect[i].old_color = op_eSupColor_; sup_vect[i].old_color = op_eSupColor_;
} }
for (unsigned int i = 0; i < 25; i++) { for (unsigned int i = 0; i < 25; i++)
if (appl_buttons[i]) { {
gtk_widget_modify_bg( if (appl_buttons[i])
GTK_WIDGET(appl_buttons[i]), GTK_STATE_NORMAL, &button_bg); {
gtk_widget_modify_bg( gtk_widget_modify_bg(GTK_WIDGET(appl_buttons[i]), GTK_STATE_NORMAL,
GTK_WIDGET(appl_buttons[i]), GTK_STATE_PRELIGHT, &button_prelight); &button_bg);
gtk_widget_modify_bg( gtk_widget_modify_bg(GTK_WIDGET(appl_buttons[i]), GTK_STATE_PRELIGHT,
GTK_WIDGET(appl_buttons[i]), GTK_STATE_ACTIVE, &button_active); &button_prelight);
gtk_widget_modify_bg(GTK_WIDGET(appl_buttons[i]), GTK_STATE_ACTIVE,
&button_active);
gtk_widget_modify_fg( gtk_widget_modify_fg(
GTK_WIDGET(gtk_bin_get_child(GTK_BIN(appl_buttons[i]))), GTK_WIDGET(gtk_bin_get_child(GTK_BIN(appl_buttons[i]))),
GTK_STATE_NORMAL, &button_text); GTK_STATE_NORMAL, &button_text);
...@@ -2165,12 +2284,14 @@ void OpGtk::set_text_size() ...@@ -2165,12 +2284,14 @@ void OpGtk::set_text_size()
char str[80]; char str[80];
char bold_str[10] = ""; char bold_str[10] = "";
sprintf( sprintf(str, "%s %s%f", "Lucida Sans", bold_str,
str, "%s %s%f", "Lucida Sans", bold_str, FONT_SCALE * (text_size + 2)); FONT_SCALE * (text_size + 2));
fd = pango_font_description_from_string(str); fd = pango_font_description_from_string(str);
for (unsigned int i = 0; i < 25; i++) { for (unsigned int i = 0; i < 25; i++)
if (appl_buttons[i]) { {
if (appl_buttons[i])
{
gtk_widget_modify_font( gtk_widget_modify_font(
GTK_WIDGET(gtk_bin_get_child(GTK_BIN(appl_buttons[i]))), fd); GTK_WIDGET(gtk_bin_get_child(GTK_BIN(appl_buttons[i]))), fd);
} }
......
...@@ -93,6 +93,7 @@ public: ...@@ -93,6 +93,7 @@ public:
GdkColor green_color; GdkColor green_color;
GdkColor gray_color; GdkColor gray_color;
GdkColor white_color; GdkColor white_color;
GdkRectangle monitor_geometry;
int a_height; int a_height;
int a_exist[5]; int a_exist[5];
int a_active[5]; int a_active[5];
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment