[recipes] Add some query APIs to GrWindow



commit bdad9acee31b6bfc7a3fac2ec3a83c1d413acf61
Author: Matthias Clasen <mclasen redhat com>
Date:   Sat Mar 11 20:19:39 2017 -0500

    Add some query APIs to GrWindow
    
    We need to know if the window is fullscreen or shows
    a search button, in order to properly handle global
    actions at the application level.

 src/gr-window.c |   16 ++++++++++++++++
 src/gr-window.h |    4 ++++
 2 files changed, 20 insertions(+), 0 deletions(-)
---
diff --git a/src/gr-window.c b/src/gr-window.c
index 3437681..89be706 100644
--- a/src/gr-window.c
+++ b/src/gr-window.c
@@ -255,6 +255,22 @@ gr_window_set_fullscreen (GrWindow *window,
         window->is_fullscreen = fullscreen;
 }
 
+gboolean
+gr_window_is_fullscreen (GrWindow *window)
+{
+        return window->is_fullscreen;
+}
+
+gboolean
+gr_window_can_search (GrWindow *window)
+{
+        const char *visible;
+
+        visible = gtk_stack_get_visible_child_name (GTK_STACK (window->header_end_stack));
+
+        return strcmp (visible, "search") == 0;
+}
+
 static void
 stop_search (GrWindow *window)
 {
diff --git a/src/gr-window.h b/src/gr-window.h
index 0af7193..6c29e82 100644
--- a/src/gr-window.h
+++ b/src/gr-window.h
@@ -47,6 +47,8 @@ void            gr_window_load_recipe                (GrWindow   *window,
 void            gr_window_save_all                   (GrWindow   *window);
 void            gr_window_show_search                (GrWindow   *window,
                                                       const char *terms);
+gboolean        gr_window_can_search                 (GrWindow   *window);
+
 void            gr_window_go_back                    (GrWindow   *window);
 void            gr_window_show_diet                  (GrWindow   *window,
                                                       const char *title,
@@ -73,8 +75,10 @@ void            gr_window_offer_undelete             (GrWindow   *window,
                                                       GrRecipe   *recipe);
 void            gr_window_offer_contribute           (GrWindow   *window,
                                                       GrRecipe   *recipe);
+
 void            gr_window_set_fullscreen             (GrWindow   *window,
                                                       gboolean    fullscreen);
+gboolean        gr_window_is_fullscreen              (GrWindow   *window);
 
 void            gr_window_show_image                 (GrWindow   *window,
                                                       GArray     *images,


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