[gcr] ui: Add gcr_viewer_window_get_viewer() function



commit 3e38ac1ab5b72e90a30bddae2b12d4168435d40b
Author: Stef Walter <stefw gnome org>
Date:   Wed Sep 25 10:56:02 2013 +0200

    ui: Add gcr_viewer_window_get_viewer() function
    
    This allows frob-unlock tool to start working again.

 docs/reference/gcr/gcr-sections.txt |    1 +
 ui/gcr-ui.symbols                   |    2 ++
 ui/gcr-viewer-widget.c              |   15 +++++++++++++++
 ui/gcr-viewer-widget.h              |    2 ++
 ui/gcr-viewer-window.c              |   15 +++++++++++++++
 ui/gcr-viewer-window.h              |    2 ++
 ui/tests/frob-unlock.c              |    2 +-
 7 files changed, 38 insertions(+), 1 deletions(-)
---
diff --git a/docs/reference/gcr/gcr-sections.txt b/docs/reference/gcr/gcr-sections.txt
index 5f9d08e..ed2a764 100644
--- a/docs/reference/gcr/gcr-sections.txt
+++ b/docs/reference/gcr/gcr-sections.txt
@@ -608,6 +608,7 @@ gcr_viewer_widget_new
 gcr_viewer_widget_load_data
 gcr_viewer_widget_load_file
 gcr_viewer_widget_get_parser
+gcr_viewer_widget_get_viewer
 gcr_viewer_widget_show_error
 gcr_viewer_widget_clear_error
 gcr_viewer_widget_get_display_name
diff --git a/ui/gcr-ui.symbols b/ui/gcr-ui.symbols
index cde2d44..7211397 100644
--- a/ui/gcr-ui.symbols
+++ b/ui/gcr-ui.symbols
@@ -100,12 +100,14 @@ gcr_viewer_new
 gcr_viewer_new_scrolled
 gcr_viewer_remove_renderer
 gcr_viewer_window_get_type
+gcr_viewer_window_get_viewer
 gcr_viewer_window_load
 gcr_viewer_window_new
 gcr_viewer_widget_clear_error
 gcr_viewer_widget_get_parser
 gcr_viewer_widget_get_display_name
 gcr_viewer_widget_get_type
+gcr_viewer_widget_get_viewer
 gcr_viewer_widget_load_data
 gcr_viewer_widget_load_file
 gcr_viewer_widget_new
diff --git a/ui/gcr-viewer-widget.c b/ui/gcr-viewer-widget.c
index b594dc1..32ddd6d 100644
--- a/ui/gcr-viewer-widget.c
+++ b/ui/gcr-viewer-widget.c
@@ -560,6 +560,21 @@ gcr_viewer_widget_load_data (GcrViewerWidget *self,
 }
 
 /**
+ * gcr_viewer_widget_get_viewer:
+ * @self: a viewer widget
+ *
+ * Get the viewer used to display the viewable items.
+ *
+ * Returns: (transfer none): the viewer
+ */
+GcrViewer *
+gcr_viewer_widget_get_viewer (GcrViewerWidget *self)
+{
+       g_return_val_if_fail (GCR_IS_VIEWER_WIDGET (self), NULL);
+       return self->pv->viewer;
+}
+
+/**
  * gcr_viewer_widget_get_parser:
  * @self: a viewer widget
  *
diff --git a/ui/gcr-viewer-widget.h b/ui/gcr-viewer-widget.h
index 1d213f4..11980f2 100644
--- a/ui/gcr-viewer-widget.h
+++ b/ui/gcr-viewer-widget.h
@@ -45,6 +45,8 @@ void               gcr_viewer_widget_load_data        (GcrViewerWidget *self,
                                                        const guchar *data,
                                                        gsize n_data);
 
+GcrViewer *        gcr_viewer_widget_get_viewer       (GcrViewerWidget *self);
+
 GcrParser *        gcr_viewer_widget_get_parser       (GcrViewerWidget *self);
 
 void               gcr_viewer_widget_show_error       (GcrViewerWidget *self,
diff --git a/ui/gcr-viewer-window.c b/ui/gcr-viewer-window.c
index 0b2e78f..0df5e78 100644
--- a/ui/gcr-viewer-window.c
+++ b/ui/gcr-viewer-window.c
@@ -186,3 +186,18 @@ gcr_viewer_window_load (GcrViewerWindow *self,
 
        return gcr_viewer_widget_load_file (self->pv->viewer, file);
 }
+
+/**
+ * gcr_viewer_window_get_viewer:
+ * @self: a viewer window
+ *
+ * Get the actual viewer showing information in the window.
+ *
+ * Returns: the viewer
+ */
+GcrViewer *
+gcr_viewer_window_get_viewer (GcrViewerWindow *self)
+{
+       g_return_val_if_fail (GCR_IS_VIEWER_WINDOW (self), NULL);
+       return gcr_viewer_widget_get_viewer (self->pv->viewer);
+}
diff --git a/ui/gcr-viewer-window.h b/ui/gcr-viewer-window.h
index 4ec2420..3cabb54 100644
--- a/ui/gcr-viewer-window.h
+++ b/ui/gcr-viewer-window.h
@@ -59,6 +59,8 @@ GtkWindow *        gcr_viewer_window_new              (void);
 void               gcr_viewer_window_load             (GcrViewerWindow *self,
                                                        GFile *file);
 
+GcrViewer *        gcr_viewer_window_get_viewer       (GcrViewerWindow *self);
+
 #endif /* GCR_DISABLE_DEPRECATED */
 
 #endif /* GCR_VIEWER_WINDOW_H */
diff --git a/ui/tests/frob-unlock.c b/ui/tests/frob-unlock.c
index 5a0bf19..5a654ca 100644
--- a/ui/tests/frob-unlock.c
+++ b/ui/tests/frob-unlock.c
@@ -61,7 +61,7 @@ on_parser_authenticate (GcrParser *parser,
        g_object_ref_sink (window);
 
        renderer = _gcr_unlock_renderer_new_for_parsed (parser);
-       gcr_viewer_add_renderer (GCR_VIEWER (window), GCR_RENDERER (renderer));
+       gcr_viewer_add_renderer (gcr_viewer_window_get_viewer (GCR_VIEWER_WINDOW (window)), GCR_RENDERER 
(renderer));
        g_object_unref (renderer);
 
        gtk_window_set_default_size (window, 550, 400);


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]