[gimp/export-dialog-cleanup-tmp: 2/3] libgimp: Add export dialog API
- From: Martin Nordholts <martinn src gnome org>
- To: svn-commits-list gnome org
- Subject: [gimp/export-dialog-cleanup-tmp: 2/3] libgimp: Add export dialog API
- Date: Wed, 15 Jul 2009 10:49:58 +0000 (UTC)
commit 19bed942b1c2e7a888900a25fc11728cf171bbc4
Author: Martin Nordholts <martinn src gnome org>
Date: Wed Jul 15 12:12:13 2009 +0200
libgimp: Add export dialog API
Add gimp_export_dialog_new() for creating a export dialog and
gimp_export_dialog_get_vbox() for accessing the vbox where clients can
put widgets.
libgimp/gimpexport.c | 35 +++++++++++++++++++++++++++++++++++
libgimp/gimpexport.h | 20 ++++++++++++--------
2 files changed, 47 insertions(+), 8 deletions(-)
---
diff --git a/libgimp/gimpexport.c b/libgimp/gimpexport.c
index 218b52f..7333106 100644
--- a/libgimp/gimpexport.c
+++ b/libgimp/gimpexport.c
@@ -981,3 +981,38 @@ gimp_export_image_internal (gint32 *image_ID,
return retval;
}
+
+GtkWidget *
+gimp_export_dialog_new (const gchar *format_name,
+ const gchar *role,
+ const gchar *help_id)
+{
+ GtkWidget *dialog = NULL;
+ gchar *title = g_strconcat (_("Export Image as "), format_name, NULL);
+
+ dialog = gimp_dialog_new (title, role,
+ NULL, 0,
+ gimp_standard_help_func, help_id,
+
+ GTK_STOCK_CANCEL, GTK_RESPONSE_CANCEL,
+ _("_Export"), GTK_RESPONSE_OK,
+
+ NULL);
+
+ gtk_dialog_set_alternative_button_order (GTK_DIALOG (dialog),
+ GTK_RESPONSE_OK,
+ GTK_RESPONSE_CANCEL,
+ -1);
+
+ gimp_window_set_transient (GTK_WINDOW (dialog));
+
+ g_free (title);
+
+ return dialog;
+}
+
+GtkWidget *
+gimp_export_dialog_get_vbox (GtkWidget *export_dialog)
+{
+ return GTK_DIALOG (export_dialog)->vbox;
+}
diff --git a/libgimp/gimpexport.h b/libgimp/gimpexport.h
index d2dffee..7d91de1 100644
--- a/libgimp/gimpexport.h
+++ b/libgimp/gimpexport.h
@@ -47,14 +47,18 @@ typedef enum
GIMP_EXPORT_EXPORT
} GimpExportReturn;
-GimpExportReturn gimp_export_image (gint32 *image_ID,
- gint32 *drawable_ID,
- const gchar *format_name,
- GimpExportCapabilities capabilities);
-
-GimpExportReturn gimp_export_prepare_image (gint32 *image_ID,
- gint32 *drawable_ID,
- GimpExportCapabilities capabilities);
+
+GimpExportReturn gimp_export_image (gint32 *image_ID,
+ gint32 *drawable_ID,
+ const gchar *format_name,
+ GimpExportCapabilities capabilities);
+GimpExportReturn gimp_export_prepare_image (gint32 *image_ID,
+ gint32 *drawable_ID,
+ GimpExportCapabilities capabilities);
+GtkWidget * gimp_export_dialog_new (const gchar *format_name,
+ const gchar *role,
+ const gchar *help_id);
+GtkWidget * gimp_export_dialog_get_vbox (GtkWidget *dialog);
G_END_DECLS
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]