comparison src/editors.c @ 60:9c0c402b0ef3

Mon Jun 13 17:31:46 2005 John Ellis <johne@verizon.net> * editors.[ch]: Add "%w" macro to disable full screen deactivation when running an editor command. * img-view.c, layout_image.c, pan-view.c: Honor %w editor flag to prevent exit of full screen. * image-load.c (image_load_begin): Fix to not treat short reads as end of file condition. * README, doc/10_5_editor_commands.html: Document %w macro for editor commands. * po/it.po: Update Italian translation, submitted by Kostantino <inverness1ATvirgilio.it>.
author gqview
date Mon, 13 Jun 2005 21:39:13 +0000
parents d907d608745f
children 3602a4aa7c71
comparison
equal deleted inserted replaced
59:57f6da2510d9 60:9c0c402b0ef3
462 * none if no macro is supplied, the result is equivalent to "command %f" 462 * none if no macro is supplied, the result is equivalent to "command %f"
463 * ([ls] results in [ls "file1" "file2" ... "lastfile"]) 463 * ([ls] results in [ls "file1" "file2" ... "lastfile"])
464 * 464 *
465 * Only one of the macros %f or %p may be used in a given commmand. 465 * Only one of the macros %f or %p may be used in a given commmand.
466 * 466 *
467 * %v must be the first two characters in a command, causes a window to display 467 * %v must be the first two characters[1] in a command, causes a window to display
468 * showing the output of the command(s). 468 * showing the output of the command(s).
469 * %V same as %v except in the case of %p only displays a window for multiple files, 469 * %V same as %v except in the case of %p only displays a window for multiple files,
470 * operating on a single file is suppresses the output dialog. 470 * operating on a single file is suppresses the output dialog.
471 *
472 * %w must be first two characters in a command, presence will disable full screen
473 * from exiting upon invocation.
474 *
475 *
476 * [1] Note: %v,%V may also be preceded by "%w".
471 */ 477 */
472 static void editor_command_run(const gchar *template, const gchar *text, GList *list) 478 static void editor_command_run(const gchar *template, const gchar *text, GList *list)
473 { 479 {
474 gint verbose = FALSE; 480 gint verbose = FALSE;
475 gint for_each = FALSE; 481 gint for_each = FALSE;
476 482
477 if (!template || template[0] == '\0') return; 483 if (!template || template[0] == '\0') return;
478 484
479 for_each = (strstr(template, "%p") != NULL); 485 for_each = (strstr(template, "%p") != NULL);
486
487 /* no window state change flag, skip */
488 if (strncmp(template, "%w", 2) == 0) template += 2;
480 489
481 if (strncmp(template, "%v", 2) == 0) 490 if (strncmp(template, "%v", 2) == 0)
482 { 491 {
483 template += 2; 492 template += 2;
484 verbose = TRUE; 493 verbose = TRUE;
580 589
581 list = g_list_append(NULL, (gchar *)path); 590 list = g_list_append(NULL, (gchar *)path);
582 start_editor_from_path_list(n, list); 591 start_editor_from_path_list(n, list);
583 g_list_free(list); 592 g_list_free(list);
584 } 593 }
594
595 gint editor_window_flag_set(gint n)
596 {
597 if (n < 0 || n >= GQVIEW_EDITOR_SLOTS ||
598 !editor_command[n] ||
599 strlen(editor_command[n]) == 0) return TRUE;
600
601 return (strncmp(editor_command[n], "%w", 2) == 0);
602 }
603
604