219
220
/* Toplevel widget. */
220
221
Widget _ui_top_level = NULL;
221
222
Widget status_bar = NULL;
223
Widget rec_button = NULL;
224
static Widget event_recording_button = NULL;
225
static int statustext_display_time = 0;
223
227
/* Our colormap. */
224
228
/*static*/ Colormap colormap;
285
290
UI_CALLBACK(enter_window_callback);
286
291
UI_CALLBACK(exposure_callback_shell);
287
292
UI_CALLBACK(exposure_callback_canvas);
293
static UI_CALLBACK(rec_button_callback)
295
screenshot_stop_recording();
296
XtUnrealizeWidget(rec_button);
299
static UI_CALLBACK(event_recording_button_callback)
302
XtUnrealizeWidget(event_recording_button);
289
305
/* ------------------------------------------------------------------------- */
361
377
"*driveCurrentImage3.font: -*-helvetica-medium-r-*-*-12-*",
362
378
"*driveCurrentImage4.font: -*-helvetica-medium-r-*-*-12-*",
363
379
"*speedStatus.font: -*-helvetica-medium-r-*-*-12-*",
380
"*statustext.font: -*-helvetica-medium-r-*-*-8-*",
582
599
int width, int height, int no_autorepeat)
584
601
/* Note: this is correct because we never destroy CanvasWindows. */
585
Widget shell, speed_label;
602
Widget shell, speed_label, statustext_label;
586
603
Widget drive_track_label[NUM_DRIVES], drive_led[NUM_DRIVES];
587
604
Widget drive_current_image[NUM_DRIVES];
588
605
Widget drive_led1[NUM_DRIVES], drive_led2[NUM_DRIVES];
661
678
Dimension height;
662
679
Dimension led_width = 14, led_height = 5;
663
Dimension w1 = width - 2 - led_width * NUM_DRIVES;
665
speed_label = XtVaCreateManagedWidget
681
speed_label = XtVaCreateManagedWidget
667
683
labelWidgetClass, pane,
669
XtNwidth, (w1 - NUM_DRIVES * (w1 / 4)) / 2,
670
686
XtNfromVert, canvas,
671
687
XtNtop, XawChainBottom,
672
688
XtNbottom, XawChainBottom,
687
703
labelWidgetClass, pane,
689
XtNwidth, (w1 / 2) + 13,
705
XtNwidth, (width / 3) - led_width - 2,
690
706
XtNfromVert, i == 0 ? canvas : drive_current_image[i-1],
691
707
XtNfromHoriz, speed_label,
692
708
XtNhorizDistance, 0,
705
721
labelWidgetClass, pane,
707
XtNwidth, w1 / 4 + 4,
723
XtNwidth, (width / 3) - led_width - 2,
708
724
XtNfromVert, canvas,
709
725
XtNfromVert, i == 0 ? canvas : drive_track_label[i-1],
710
726
XtNfromHoriz, drive_current_image[i],
796
statustext_label = XtVaCreateManagedWidget
798
labelWidgetClass, pane,
799
XtNwidth, width / 3 - 2,
800
XtNfromVert, speed_label,
801
XtNjustify, XtJustifyLeft,
805
rec_button = XtVaCreateManagedWidget
807
commandWidgetClass, pane,
808
XtNwidth, width / 3 - 2,
809
XtNfromVert, statustext_label,
810
XtNjustify, XtJustifyLeft,
811
XtNlabel, _("recording..."),
813
XtAddCallback(rec_button, XtNcallback, rec_button_callback, NULL);
814
event_recording_button = XtVaCreateManagedWidget
816
commandWidgetClass, pane,
817
XtNwidth, width / 3 - 2,
818
XtNfromVert, rec_button,
819
XtNjustify, XtJustifyLeft,
820
XtNlabel, _("event recording..."),
822
XtAddCallback(event_recording_button, XtNcallback,
823
event_recording_button_callback, NULL);
782
826
/* Assign proper translations to open the menus, if already
823
867
app_shells[num_app_shells - 1].canvas = canvas;
824
868
app_shells[num_app_shells - 1].title = lib_stralloc(title);
825
869
app_shells[num_app_shells - 1].speed_label = speed_label;
870
app_shells[num_app_shells - 1].statustext_label = statustext_label;
826
871
status_bar = speed_label;
828
873
for (i = 0; i < NUM_DRIVES; i++) {
847
892
drive_widgets[i].current_image);
895
XtUnrealizeWidget(rec_button);
896
XtUnrealizeWidget(event_recording_button);
851
898
XSetWMProtocols(display, XtWindow(shell), &wm_delete_window, 1);
852
899
XtOverrideTranslations(shell,
853
900
XtParseTranslationTable
1135
static void statusbar_setstatustext(const char *t)
1138
for (i = 0; i < num_app_shells; i++)
1139
XtVaSetValues(app_shells[i].statustext_label, XtNlabel, t, NULL);
1088
1142
/* ------------------------------------------------------------------------- */
1090
1144
/* Show the speed index to the user. */
1105
str = lib_msprintf("%d%%, %d fps %s", percent_int, framerate_int,
1158
str = lib_msprintf("%d%%, %dfps %s", percent_int, framerate_int,
1106
1159
warp_flag ? _("(warp)") : "");
1107
1160
XtVaSetValues(app_shells[i].speed_label, XtNlabel, str, NULL);
1164
if (statustext_display_time > 0) {
1165
statustext_display_time--;
1166
if (statustext_display_time == 0)
1167
statusbar_setstatustext("");
1170
if (!screenshot_is_recording())
1171
XtUnrealizeWidget(rec_button);
1112
1173
void ui_enable_drive_status(ui_drive_enable_t enable, int *drive_led_color)
1309
1370
void ui_display_recording(int recording_status)
1372
if (recording_status)
1374
XtRealizeWidget(event_recording_button);
1375
XtManageChild(event_recording_button);
1378
XtUnrealizeWidget(event_recording_button);
1313
1381
void ui_display_playback(int playback_status, char *version)
2172
void ui_display_statustext(const char *text, int fade_out)
2174
log_message(LOG_DEFAULT, text);
2175
statusbar_setstatustext(text);
2177
statustext_display_time = 5;
2179
statustext_display_time = 0;