summaryrefslogtreecommitdiff
path: root/gtk/gtkfilechooserutils.c
diff options
context:
space:
mode:
authorOwen Taylor <otaylor@redhat.com>2003-07-23 22:30:32 +0000
committerOwen Taylor <otaylor@src.gnome.org>2003-07-23 22:30:32 +0000
commitd97d7df9475b2edc112402397fc349d46156d741 (patch)
tree89ba88c5b68e1d1158fe92c9efff1a0e974aa49a /gtk/gtkfilechooserutils.c
parenta19781c504970ac6d221b8ec09548d8a635cb2d8 (diff)
downloadgtk+-d97d7df9475b2edc112402397fc349d46156d741.tar.gz
Add over-big test case for preview (much of size from a modified copy of
Wed Jul 23 17:52:01 2003 Owen Taylor <otaylor@redhat.com> * testfilechooser.c: Add over-big test case for preview (much of size from a modified copy of gdk_pixbuf_new_from_file_at_size()) * gtkfilechooserutils.[ch] gtkfilechooser.c gtkfilechooserprivate.h gtkfilechooserimpldefault.c: Add get_preview_path() as a virtual function; implement update-preview signal that was in the header file. * gtkfilechooserimpldefault.c: Finish a simple preview widget implementation.
Diffstat (limited to 'gtk/gtkfilechooserutils.c')
-rw-r--r--gtk/gtkfilechooserutils.c23
1 files changed, 21 insertions, 2 deletions
diff --git a/gtk/gtkfilechooserutils.c b/gtk/gtkfilechooserutils.c
index b6648f21c1..e60c82660d 100644
--- a/gtk/gtkfilechooserutils.c
+++ b/gtk/gtkfilechooserutils.c
@@ -36,6 +36,7 @@ static void delegate_unselect_path (GtkFileChooser *choose
static void delegate_select_all (GtkFileChooser *chooser);
static void delegate_unselect_all (GtkFileChooser *chooser);
static GSList * delegate_get_paths (GtkFileChooser *chooser);
+static GtkFilePath * delegate_get_preview_path (GtkFileChooser *chooser);
static GtkFileSystem *delegate_get_file_system (GtkFileChooser *chooser);
static void delegate_add_filter (GtkFileChooser *chooser,
GtkFileFilter *filter);
@@ -49,6 +50,8 @@ static void delegate_current_folder_changed (GtkFileChooser *choose
gpointer data);
static void delegate_selection_changed (GtkFileChooser *chooser,
gpointer data);
+static void delegate_update_preview (GtkFileChooser *chooser,
+ gpointer data);
/**
* _gtk_file_chooser_install_properties:
@@ -133,6 +136,7 @@ _gtk_file_chooser_delegate_iface_init (GtkFileChooserIface *iface)
iface->select_all = delegate_select_all;
iface->unselect_all = delegate_unselect_all;
iface->get_paths = delegate_get_paths;
+ iface->get_preview_path = delegate_get_preview_path;
iface->get_file_system = delegate_get_file_system;
iface->add_filter = delegate_add_filter;
iface->remove_filter = delegate_remove_filter;
@@ -165,6 +169,8 @@ _gtk_file_chooser_set_delegate (GtkFileChooser *receiver,
G_CALLBACK (delegate_current_folder_changed), receiver);
g_signal_connect (delegate, "selection-changed",
G_CALLBACK (delegate_selection_changed), receiver);
+ g_signal_connect (delegate, "update-preview",
+ G_CALLBACK (delegate_update_preview), receiver);
}
static GtkFileChooser *
@@ -205,6 +211,12 @@ delegate_get_paths (GtkFileChooser *chooser)
return _gtk_file_chooser_get_paths (get_delegate (chooser));
}
+static GtkFilePath *
+delegate_get_preview_path (GtkFileChooser *chooser)
+{
+ return _gtk_file_chooser_get_preview_path (get_delegate (chooser));
+}
+
static GtkFileSystem *
delegate_get_file_system (GtkFileChooser *chooser)
{
@@ -267,12 +279,19 @@ static void
delegate_selection_changed (GtkFileChooser *chooser,
gpointer data)
{
- g_signal_emit_by_name (data, "selection-changed", 0);
+ g_signal_emit_by_name (data, "selection-changed");
}
static void
delegate_current_folder_changed (GtkFileChooser *chooser,
gpointer data)
{
- g_signal_emit_by_name (data, "current-folder-changed", 0);
+ g_signal_emit_by_name (data, "current-folder-changed");
+}
+
+static void
+delegate_update_preview (GtkFileChooser *chooser,
+ gpointer data)
+{
+ g_signal_emit_by_name (data, "update-preview");
}