
2004-05-14 Sven Neumann <sven@gimp.org> * tools/pdbgen/pdb/fileops.pdb: added new PDB function gimp_register_file_handler_mime() that allows to associate a MIME type with a file procecdurre. * app/pdb/fileops_cmds.c * app/pdb/internal_procs.c * libgimp/gimpfileops_pdb.[ch]: regenerated. * app/plug-in/plug-in-proc.[ch] * app/plug-in/plug-in-rc.c * app/plug-in/plug-ins.[ch]: store a mimetype with file procedures. * app/actions/file-commands.c * app/core/gimpdocumentlist.[ch] * app/core/gimpimagefile.[ch] * app/file/file-open.[ch] * app/file/file-save.c: set the thumbnail's mimetype from the file procedure used to load/save the image. * app/xcf/xcf.c * plug-ins/bmp/bmp.c * plug-ins/common/csource.c * plug-ins/common/dicom.c * plug-ins/common/gif.c * plug-ins/common/gifload.c * plug-ins/common/jpeg.c * plug-ins/common/mng.c * plug-ins/common/png.c * plug-ins/common/postscript.c * plug-ins/common/psd.c * plug-ins/common/psd_save.c * plug-ins/common/sunras.c * plug-ins/common/svg.c * plug-ins/common/tga.c * plug-ins/common/tiff.c * plug-ins/common/wmf.c * plug-ins/common/xbm.c * plug-ins/common/xpm.c * plug-ins/common/xwd.c * plug-ins/faxg3/faxg3.c * plug-ins/winicon/main.c: register a mimetype, set a translatable action name (taken from shared-mime-info) and register to the <Load> and <Save> menus using gimp_plugin_menu_register().
69 lines
1.9 KiB
C
69 lines
1.9 KiB
C
/* The GIMP -- an image manipulation program
|
|
* Copyright (C) 1995 Spencer Kimball and Peter Mattis
|
|
*
|
|
* This program is free software; you can redistribute it and/or modify
|
|
* it under the terms of the GNU General Public License as published by
|
|
* the Free Software Foundation; either version 2 of the License, or
|
|
* (at your option) any later version.
|
|
*
|
|
* This program is distributed in the hope that it will be useful,
|
|
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
|
* GNU General Public License for more details.
|
|
*
|
|
* You should have received a copy of the GNU General Public License
|
|
* along with this program; if not, write to the Free Software
|
|
* Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
|
|
*/
|
|
|
|
#include "config.h"
|
|
|
|
#include <gtk/gtk.h>
|
|
|
|
#include "menus-types.h"
|
|
|
|
#include "config/gimpguiconfig.h"
|
|
|
|
#include "core/gimp.h"
|
|
|
|
#include "widgets/gimpuimanager.h"
|
|
|
|
#include "file-menu.h"
|
|
|
|
|
|
void
|
|
file_menu_setup (GimpUIManager *manager,
|
|
const gchar *ui_path)
|
|
{
|
|
GtkUIManager *ui_manager;
|
|
gint n_entries;
|
|
guint merge_id;
|
|
gint i;
|
|
|
|
g_return_if_fail (GIMP_IS_UI_MANAGER (manager));
|
|
g_return_if_fail (ui_path != NULL);
|
|
|
|
ui_manager = GTK_UI_MANAGER (manager);
|
|
|
|
n_entries = GIMP_GUI_CONFIG (manager->gimp->config)->last_opened_size;
|
|
|
|
merge_id = gtk_ui_manager_new_merge_id (ui_manager);
|
|
|
|
for (i = 0; i < n_entries; i++)
|
|
{
|
|
gchar *action_name;
|
|
gchar *action_path;
|
|
|
|
action_name = g_strdup_printf ("file-open-recent-%02d", i + 1);
|
|
action_path = g_strdup_printf ("%s/File/Open Recent/Files", ui_path);
|
|
|
|
gtk_ui_manager_add_ui (ui_manager, merge_id,
|
|
action_path, action_name, action_name,
|
|
GTK_UI_MANAGER_MENUITEM,
|
|
FALSE);
|
|
|
|
g_free (action_name);
|
|
g_free (action_path);
|
|
}
|
|
}
|