[recipes] Create separate cooking page



commit bfaf36e300076b56700504a4b5694d4c2ed94e1e
Author: Matthias Clasen <mclasen redhat com>
Date:   Fri Feb 3 07:25:47 2017 +0100

    Create separate cooking page
    
    This will be a fullscreen view.

 src/Makefile.am                             |    2 +
 src/gr-cooking-page.c                       |  396 +++++++++++++++++++++++++++
 src/gr-cooking-page.h                       |   42 +++
 src/gr-cooking-page.ui                      |  260 ++++++++++++++++++
 src/icons/48x48/apps/press-any-key.png      |  Bin 0 -> 1065 bytes
 src/icons/48x48/apps/press-escape-key.png   |  Bin 0 -> 1272 bytes
 src/icons/48x48/apps/press-left-button.png  |  Bin 0 -> 1775 bytes
 src/icons/48x48/apps/press-right-button.png |  Bin 0 -> 1787 bytes
 src/main.c                                  |    2 +
 src/recipes-images.gresource.xml            |    4 +
 src/recipes-ui.gresource.xml                |    1 +
 11 files changed, 707 insertions(+), 0 deletions(-)
---
diff --git a/src/Makefile.am b/src/Makefile.am
index 733db5a..e6dafec 100644
--- a/src/Makefile.am
+++ b/src/Makefile.am
@@ -40,6 +40,8 @@ recipes_SOURCES = \
        gr-chef-tile.c          \
        gr-cooking-view.h       \
        gr-cooking-view.c       \
+       gr-cooking-page.h       \
+       gr-cooking-page.c       \
        gr-cuisine.h            \
        gr-cuisine.c            \
        gr-cuisine-page.h       \
diff --git a/src/gr-cooking-page.c b/src/gr-cooking-page.c
new file mode 100644
index 0000000..7a55464
--- /dev/null
+++ b/src/gr-cooking-page.c
@@ -0,0 +1,396 @@
+/* gr-cooking-page.c:
+ *
+ * Copyright (C) 2017 Matthias Clasen <mclasen redhat com>
+ *
+ * Licensed under the GNU General Public License Version 3.
+ *
+ * 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 3 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, see <http://www.gnu.org/licenses/>.
+ */
+
+#include "config.h"
+
+#include <glib/gi18n.h>
+
+#include <stdlib.h>
+
+#include "gr-cooking-page.h"
+#include "gr-cooking-view.h"
+#include "gr-utils.h"
+#include "gr-window.h"
+#include "gr-recipe.h"
+
+
+struct _GrCookingPage
+{
+        GtkBox parent_instance;
+
+        GtkWidget *cooking_overlay;
+        GtkWidget *event_box;
+        GtkWidget *next_revealer;
+        GtkWidget *prev_revealer;
+        GtkWidget *close_revealer;
+        GtkWidget *cooking_view;
+
+        GrRecipe *recipe;
+
+        guint inhibit_cookie;
+        guint keyval_seen;
+        guint button_seen;
+
+        guint hide_timeout;
+};
+
+
+G_DEFINE_TYPE (GrCookingPage, gr_cooking_page, GTK_TYPE_BOX)
+
+
+GrCookingPage *
+gr_cooking_page_new (void)
+{
+        return g_object_new (GR_TYPE_COOKING_PAGE, NULL);
+}
+
+static void
+gr_cooking_page_finalize (GObject *object)
+{
+        GrCookingPage *self = GR_COOKING_PAGE (object);
+
+        g_clear_object (&self->recipe);
+        if (self->hide_timeout)
+                g_source_remove (self->hide_timeout);
+
+        G_OBJECT_CLASS (gr_cooking_page_parent_class)->finalize (object);
+}
+
+static void
+gr_cooking_page_init (GrCookingPage *self)
+{
+        gtk_widget_init_template (GTK_WIDGET (self));
+
+        gtk_widget_add_events (GTK_WIDGET (self->event_box), GDK_POINTER_MOTION_MASK);
+        gtk_widget_add_events (GTK_WIDGET (self->event_box), GDK_BUTTON_PRESS_MASK);
+}
+
+static int
+get_cooking_overlay_count (void)
+{
+        g_autofree char *path = NULL;
+        g_autoptr(GKeyFile) keyfile = NULL;
+        g_autoptr(GError) error = NULL;
+        int count;
+
+        keyfile = g_key_file_new ();
+
+        path = g_build_filename (g_get_user_data_dir (), "recipes", "cooking", NULL);
+        if (!g_key_file_load_from_file (keyfile, path, G_KEY_FILE_NONE, &error)) {
+                if (!g_error_matches (error, G_FILE_ERROR, G_FILE_ERROR_NOENT))
+                        g_error ("Failed to load cooking overlay count: %s", error->message);
+                return 0;
+        }
+
+        count = g_key_file_get_integer (keyfile, "Cooking", "OverlayShown", &error);
+        if (error) {
+                g_error ("Failed to load cooking overlay count: %s", error->message);
+                return 0;
+        }
+
+        return count;
+}
+
+static void
+set_cooking_overlay_count (int count)
+{
+        g_autofree char *path = NULL;
+        g_autoptr(GKeyFile) keyfile = NULL;
+        g_autoptr(GError) error = NULL;
+
+        keyfile = g_key_file_new ();
+
+        path = g_build_filename (g_get_user_data_dir (), "recipes", "cooking", NULL);
+
+        g_key_file_set_integer (keyfile, "Cooking", "OverlayShown", count);
+
+        if (!g_key_file_save_to_file (keyfile, path, &error)) {
+                g_error ("Failed to save cooking overlay count: %s", error->message);
+        }
+}
+
+static void
+set_cooking (GrCookingPage *page,
+             gboolean       cooking)
+{
+        int count;
+        GtkWidget *window;
+        GtkApplication *app;
+
+        window = gtk_widget_get_ancestor (GTK_WIDGET (page), GTK_TYPE_APPLICATION_WINDOW);
+        app = gtk_window_get_application (GTK_WINDOW (window));
+
+        if (cooking) {
+                count = get_cooking_overlay_count ();
+                if (count < 3)
+                        gtk_widget_show (page->cooking_overlay);
+                else
+                        gtk_widget_hide (page->cooking_overlay);
+                set_cooking_overlay_count (count + 1);
+
+                if (page->inhibit_cookie == 0) {
+                        page->inhibit_cookie = gtk_application_inhibit (app,
+                                                                        GTK_WINDOW (window),
+                                                                        GTK_APPLICATION_INHIBIT_SUSPEND |
+                                                                        GTK_APPLICATION_INHIBIT_IDLE,
+                                                                        _("Cooking"));
+                }
+
+                gr_cooking_view_set_step (GR_COOKING_VIEW (page->cooking_view), 0);
+
+                gr_window_set_fullscreen (GR_WINDOW (window), TRUE);
+        }
+        else {
+                if (page->inhibit_cookie != 0) {
+                        gtk_application_uninhibit (app, page->inhibit_cookie);
+                        page->inhibit_cookie = 0;
+                }
+
+                gr_window_show_recipe (GR_WINDOW (window), page->recipe);
+
+                gr_window_set_fullscreen (GR_WINDOW (window), FALSE);
+        }
+}
+
+static void
+stop_cooking (GrCookingPage *page)
+{
+        set_cooking (page, FALSE);
+}
+
+static void
+prev_step (GrCookingPage *page)
+{
+        int step;
+
+        step = gr_cooking_view_get_step (GR_COOKING_VIEW (page->cooking_view));
+        gr_cooking_view_set_step (GR_COOKING_VIEW (page->cooking_view), step - 1);
+}
+
+static void
+next_step (GrCookingPage *page)
+{
+        int step;
+
+        step = gr_cooking_view_get_step (GR_COOKING_VIEW (page->cooking_view));
+        gr_cooking_view_set_step (GR_COOKING_VIEW (page->cooking_view), step + 1);
+}
+
+
+static gboolean
+doubletap_timeout (gpointer data)
+{
+        GrCookingPage *page = data;
+
+        if (page->keyval_seen) {
+                page->keyval_seen = 0;
+                next_step (page);
+        }
+        else if (page->button_seen) {
+                page->button_seen = 0;
+                next_step (page);
+        }
+
+        return G_SOURCE_REMOVE;
+}
+
+void
+gr_cooking_page_start_cooking (GrCookingPage *page)
+{
+        set_cooking (page, TRUE);
+}
+
+static void
+show_buttons (GrCookingPage *page)
+{
+        if (!gtk_revealer_get_child_revealed (GTK_REVEALER (page->close_revealer)))
+                gtk_revealer_set_reveal_child (GTK_REVEALER (page->close_revealer), TRUE);
+
+        if (gr_cooking_view_get_n_steps (GR_COOKING_VIEW (page->cooking_view)) < 2)
+                return;
+
+        if (!gtk_revealer_get_child_revealed (GTK_REVEALER (page->next_revealer)))
+                gtk_revealer_set_reveal_child (GTK_REVEALER (page->next_revealer), TRUE);
+
+        if (!gtk_revealer_get_child_revealed (GTK_REVEALER (page->prev_revealer)))
+                        gtk_revealer_set_reveal_child (GTK_REVEALER (page->prev_revealer), TRUE);
+}
+
+static void
+hide_buttons (GrCookingPage *page)
+{
+        if (gtk_revealer_get_child_revealed (GTK_REVEALER (page->close_revealer)))
+                gtk_revealer_set_reveal_child (GTK_REVEALER (page->close_revealer), FALSE);
+
+        if (gtk_revealer_get_child_revealed (GTK_REVEALER (page->next_revealer)))
+                gtk_revealer_set_reveal_child (GTK_REVEALER (page->next_revealer), FALSE);
+
+        if (gtk_revealer_get_child_revealed (GTK_REVEALER (page->prev_revealer)))
+                        gtk_revealer_set_reveal_child (GTK_REVEALER (page->prev_revealer), FALSE);
+}
+
+static gboolean
+hide_timeout (gpointer data)
+{
+        GrCookingPage *page = data;
+
+        hide_buttons (page);
+
+        page->hide_timeout = 0;
+
+        return G_SOURCE_REMOVE;
+}
+
+static void
+reset_hide_timeout (GrCookingPage *page)
+{
+        if (page->hide_timeout != 0) {
+                g_source_remove (page->hide_timeout);
+                page->hide_timeout = 0;
+        }
+        page->hide_timeout = g_timeout_add (5000, hide_timeout, page);
+}
+
+static gboolean
+motion_notify (GtkWidget   *widget,
+               GdkEvent    *event,
+               GrCookingPage *page)
+{
+        show_buttons (page);
+        reset_hide_timeout (page);
+
+        return FALSE;
+}
+
+gboolean
+gr_cooking_page_handle_event (GrCookingPage *page,
+                              GdkEvent      *event)
+{
+        if (gtk_widget_get_visible (page->cooking_overlay)) {
+                gtk_widget_hide (page->cooking_overlay);
+
+                return GDK_EVENT_STOP;
+        }
+        else if (event->type == GDK_KEY_PRESS) {
+                GdkEventKey *e = (GdkEventKey *)event;
+
+                if (e->keyval == GDK_KEY_Escape) {
+                        stop_cooking (page);
+
+                        return GDK_EVENT_STOP;
+                }
+                else if (e->keyval == GDK_KEY_Left) {
+                        prev_step (page);
+
+                        return GDK_EVENT_STOP;
+                }
+                else if (e->keyval == GDK_KEY_Right) {
+                        next_step (page);
+
+                        return GDK_EVENT_STOP;
+                }
+                else if (e->keyval == page->keyval_seen) {
+                        page->keyval_seen = 0;
+                        prev_step (page);
+
+                        return GDK_EVENT_STOP;
+                }
+                else {
+                        GtkSettings *settings;
+                        int time;
+
+                        settings = gtk_widget_get_settings (GTK_WIDGET (page));
+                        g_object_get (settings, "gtk-double-click-time", &time, NULL);
+                        page->keyval_seen = e->keyval;
+                        g_timeout_add (time, doubletap_timeout, page);
+
+                        return GDK_EVENT_STOP;
+                }
+        }
+        else if (event->type == GDK_BUTTON_PRESS) {
+                GdkEventButton *e = (GdkEventButton *)event;
+
+                if (e->button == GDK_BUTTON_SECONDARY) {
+                        stop_cooking (page);
+
+                        return GDK_EVENT_STOP;
+                }
+                else if (e->button == page->button_seen) {
+                        page->button_seen = 0;
+                        prev_step (page);
+
+                        return GDK_EVENT_STOP;
+                }
+                else {
+                        GtkSettings *settings;
+                        int time;
+
+                        settings = gtk_widget_get_settings (GTK_WIDGET (page));
+                        g_object_get (settings, "gtk-double-click-time", &time, NULL);
+                        page->button_seen = e->button;
+                        g_timeout_add (time, doubletap_timeout, page);
+
+                        return GDK_EVENT_STOP;
+                }
+        }
+
+        return GDK_EVENT_PROPAGATE;
+}
+
+static void
+gr_cooking_page_class_init (GrCookingPageClass *klass)
+{
+        GObjectClass *object_class = G_OBJECT_CLASS (klass);
+        GtkWidgetClass *widget_class = GTK_WIDGET_CLASS (klass);
+
+        object_class->finalize = gr_cooking_page_finalize;
+
+        gtk_widget_class_set_template_from_resource (widget_class, "/org/gnome/Recipes/gr-cooking-page.ui");
+
+        gtk_widget_class_bind_template_child (widget_class, GrCookingPage, cooking_overlay);
+
+        gtk_widget_class_bind_template_child (widget_class, GrCookingPage, cooking_view);
+        gtk_widget_class_bind_template_child (widget_class, GrCookingPage, prev_revealer);
+        gtk_widget_class_bind_template_child (widget_class, GrCookingPage, next_revealer);
+        gtk_widget_class_bind_template_child (widget_class, GrCookingPage, close_revealer);
+        gtk_widget_class_bind_template_child (widget_class, GrCookingPage, event_box);
+
+        gtk_widget_class_bind_template_callback (widget_class, prev_step);
+        gtk_widget_class_bind_template_callback (widget_class, next_step);
+        gtk_widget_class_bind_template_callback (widget_class, stop_cooking);
+        gtk_widget_class_bind_template_callback (widget_class, motion_notify);
+}
+
+void
+gr_cooking_page_set_recipe (GrCookingPage *page,
+                            GrRecipe      *recipe)
+{
+        if (g_set_object (&page->recipe, recipe)) {
+                g_autoptr(GArray) images = NULL;
+                const char *instructions = NULL;
+
+                g_object_get (recipe, "images", &images, NULL);
+                instructions = gr_recipe_get_translated_instructions (recipe);
+
+                gr_cooking_view_set_images (GR_COOKING_VIEW (page->cooking_view), images);
+                gr_cooking_view_set_instructions (GR_COOKING_VIEW (page->cooking_view), instructions);
+        }
+}
+
diff --git a/src/gr-cooking-page.h b/src/gr-cooking-page.h
new file mode 100644
index 0000000..264c243
--- /dev/null
+++ b/src/gr-cooking-page.h
@@ -0,0 +1,42 @@
+/* gr-cooking-page.h
+ *
+ * Copyright (C) 2017 Matthias Clasen <mclasen redhat com>
+ *
+ * Licensed under the GNU General Public License Version 3.
+ *
+ * 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 3 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, see <http://www.gnu.org/licenses/>.
+ */
+
+#pragma once
+
+#include <gtk/gtk.h>
+
+#include "gr-recipe.h"
+
+G_BEGIN_DECLS
+
+#define GR_TYPE_COOKING_PAGE (gr_cooking_page_get_type())
+
+G_DECLARE_FINAL_TYPE (GrCookingPage, gr_cooking_page, GR, COOKING_PAGE, GtkBox)
+
+GrCookingPage *gr_cooking_page_new        (void);
+void           gr_cooking_page_set_recipe (GrCookingPage *page,
+                                           GrRecipe      *recipe);
+void           gr_cooking_page_start_cooking (GrCookingPage *page);
+
+gboolean       gr_cooking_page_handle_event (GrCookingPage *page,
+                                             GdkEvent      *event);
+
+G_END_DECLS
+
diff --git a/src/gr-cooking-page.ui b/src/gr-cooking-page.ui
new file mode 100644
index 0000000..12ba9d9
--- /dev/null
+++ b/src/gr-cooking-page.ui
@@ -0,0 +1,260 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<interface domain="recipes">
+  <!-- interface-requires gtk+ 3.8 -->
+  <template class="GrCookingPage" parent="GtkBox">
+    <property name="visible">True</property>
+    <property name="orientation">vertical</property>
+    <child>
+      <object class="GtkOverlay">
+        <property name="visible">1</property>
+        <child type="overlay">
+          <object class="GtkRevealer" id="prev_revealer">
+            <property name="visible">1</property>
+            <property name="halign">start</property>
+            <property name="valign">center</property>
+            <property name="transition-type">crossfade</property>
+            <style>
+              <class name="osd"/>
+            </style>
+            <child>
+              <object class="GtkButton">
+                <property name="visible">1</property>
+                <signal name="clicked" handler="prev_step" swapped="yes"/>
+                <style>
+                  <class name="image-button"/>
+                  <class name="osd"/>
+                </style>
+                <child>
+                  <object class="GtkImage">
+                    <property name="visible">1</property>
+                    <property name="icon-name">pan-start-symbolic</property>
+                    <property name="pixel-size">32</property>
+                  </object>
+                </child>
+              </object>
+            </child>
+          </object>
+        </child>
+        <child type="overlay">
+          <object class="GtkRevealer" id="close_revealer">
+            <property name="visible">1</property>
+            <property name="halign">end</property>
+            <property name="valign">start</property>
+            <property name="transition-type">crossfade</property>
+            <child>
+              <object class="GtkButton">
+                <property name="visible">1</property>
+                <signal name="clicked" handler="stop_cooking" swapped="yes"/>
+                <style>
+                  <class name="image-button"/>
+                  <class name="osd"/>
+                </style>
+                <child>
+                  <object class="GtkImage">
+                    <property name="visible">1</property>
+                    <property name="icon-name">window-close-symbolic</property>
+                    <property name="pixel-size">32</property>
+                  </object>
+                </child>
+              </object>
+            </child>
+          </object>
+        </child>
+        <child type="overlay">
+          <object class="GtkRevealer" id="next_revealer">
+            <property name="visible">1</property>
+            <property name="halign">end</property>
+            <property name="valign">center</property>
+            <property name="transition-type">crossfade</property>
+            <child>
+              <object class="GtkButton">
+                <property name="visible">1</property>
+                <signal name="clicked" handler="next_step" swapped="yes"/>
+                <style>
+                  <class name="image-button"/>
+                  <class name="osd"/>
+                </style>
+                <child>
+                  <object class="GtkImage">
+                    <property name="visible">1</property>
+                    <property name="icon-name">pan-end-symbolic</property>
+                    <property name="pixel-size">32</property>
+                  </object>
+                </child>
+              </object>
+            </child>
+          </object>
+        </child>
+        <child type="overlay">
+          <object class="GtkGrid" id="cooking_overlay">
+            <property name="visible">1</property>
+            <property name="halign">center</property>
+            <property name="valign">center</property>
+            <property name="row-spacing">20</property>
+            <property name="column-spacing">6</property>
+            <style>
+              <class name="cooking"/>
+              <class name="overlay"/>
+            </style>
+            <child>
+              <object class="GtkLabel">
+                <property name="visible">1</property>
+                <property name="label" translatable="yes">Cook Now</property>
+                <style>
+                  <class name="heading"/>
+                </style>
+              </object>
+              <packing>
+                <property name="left-attach">0</property>
+                <property name="top-attach">0</property>
+                <property name="width">5</property>
+              </packing>
+            </child>
+            <child>
+              <object class="GtkImage">
+                <property name="visible">1</property>
+                <property name="halign">start</property>
+                <property name="icon-name">press-any-key</property>
+                <property name="pixel-size">48</property>
+              </object>
+              <packing>
+                <property name="left-attach">0</property>
+                <property name="top-attach">1</property>
+              </packing>
+            </child>
+            <child>
+              <object class="GtkImage">
+                <property name="visible">1</property>
+                <property name="halign">start</property>
+                <property name="icon-name">press-left-button</property>
+                <property name="pixel-size">48</property>
+              </object>
+              <packing>
+                <property name="left-attach">2</property>
+                <property name="top-attach">1</property>
+              </packing>
+            </child>
+            <child>
+              <object class="GtkLabel">
+                <property name="visible">1</property>
+                <property name="xalign">0</property>
+                <property name="label" translatable="yes">To advance to the next step, press any key on the
+keyboard or click the left mouse button.</property>
+              </object>
+              <packing>
+                <property name="left-attach">4</property>
+                <property name="top-attach">1</property>
+              </packing>
+            </child>
+            <child>
+              <object class="GtkImage">
+                <property name="visible">1</property>
+                <property name="halign">start</property>
+                <property name="icon-name">press-any-key</property>
+                <property name="pixel-size">48</property>
+              </object>
+              <packing>
+                <property name="left-attach">0</property>
+                <property name="top-attach">2</property>
+              </packing>
+            </child>
+            <child>
+              <object class="GtkImage">
+                <property name="visible">1</property>
+                <property name="halign">start</property>
+                <property name="icon-name">press-any-key</property>
+                <property name="pixel-size">48</property>
+              </object>
+              <packing>
+                <property name="left-attach">1</property>
+                <property name="top-attach">2</property>
+              </packing>
+            </child>
+            <child>
+              <object class="GtkImage">
+                <property name="visible">1</property>
+                <property name="halign">start</property>
+                <property name="icon-name">press-left-button</property>
+                <property name="pixel-size">48</property>
+              </object>
+              <packing>
+                <property name="left-attach">2</property>
+                <property name="top-attach">2</property>
+              </packing>
+            </child>
+            <child>
+              <object class="GtkImage">
+                <property name="visible">1</property>
+                <property name="halign">start</property>
+                <property name="icon-name">press-left-button</property>
+                <property name="pixel-size">48</property>
+              </object>
+              <packing>
+                <property name="left-attach">3</property>
+                <property name="top-attach">2</property>
+              </packing>
+            </child>
+            <child>
+              <object class="GtkLabel">
+                <property name="visible">1</property>
+                <property name="xalign">0</property>
+                <property name="label" translatable="yes">To go back to the previous step, doubletap any key
+or double click the left mouse button.</property>
+              </object>
+              <packing>
+                <property name="left-attach">4</property>
+                <property name="top-attach">2</property>
+              </packing>
+            </child>
+            <child>
+              <object class="GtkImage">
+                <property name="visible">1</property>
+                <property name="halign">start</property>
+                <property name="icon-name">press-escape-key</property>
+                <property name="pixel-size">48</property>
+              </object>
+              <packing>
+                <property name="left-attach">0</property>
+                <property name="top-attach">3</property>
+              </packing>
+            </child>
+            <child>
+              <object class="GtkImage">
+                <property name="visible">1</property>
+                <property name="halign">start</property>
+                <property name="icon-name">press-right-button</property>
+                <property name="pixel-size">48</property>
+              </object>
+              <packing>
+                <property name="left-attach">2</property>
+                <property name="top-attach">3</property>
+              </packing>
+            </child>
+            <child>
+              <object class="GtkLabel">
+                <property name="visible">1</property>
+                <property name="xalign">0</property>
+                <property name="label" translatable="yes">To exit the process, press the Escape key or click
+the right mouse button.</property>
+              </object>
+              <packing>
+                <property name="left-attach">4</property>
+                <property name="top-attach">3</property>
+              </packing>
+            </child>
+          </object>
+        </child>
+        <child>
+          <object class="GtkEventBox" id="event_box">
+            <property name="visible">1</property>
+            <property name="can-focus">1</property>
+            <signal name="motion-notify-event" handler="motion_notify"/>
+            <child>
+              <object class="GrCookingView" id="cooking_view"/>
+            </child>
+          </object>
+        </child>
+      </object>
+    </child>
+  </template>
+</interface>
diff --git a/src/icons/48x48/apps/press-any-key.png b/src/icons/48x48/apps/press-any-key.png
new file mode 100644
index 0000000..97baad7
Binary files /dev/null and b/src/icons/48x48/apps/press-any-key.png differ
diff --git a/src/icons/48x48/apps/press-escape-key.png b/src/icons/48x48/apps/press-escape-key.png
new file mode 100644
index 0000000..053268f
Binary files /dev/null and b/src/icons/48x48/apps/press-escape-key.png differ
diff --git a/src/icons/48x48/apps/press-left-button.png b/src/icons/48x48/apps/press-left-button.png
new file mode 100644
index 0000000..a4ce2d8
Binary files /dev/null and b/src/icons/48x48/apps/press-left-button.png differ
diff --git a/src/icons/48x48/apps/press-right-button.png b/src/icons/48x48/apps/press-right-button.png
new file mode 100644
index 0000000..9271bcf
Binary files /dev/null and b/src/icons/48x48/apps/press-right-button.png differ
diff --git a/src/main.c b/src/main.c
index 88f4224..e13d1e7 100644
--- a/src/main.c
+++ b/src/main.c
@@ -35,6 +35,7 @@
 #include "gr-search-page.h"
 #include "gr-shopping-page.h"
 #include "gr-cooking-view.h"
+#include "gr-cooking-page.h"
 #include "gr-timer-widget.h"
 #include "gr-time-widget.h"
 #include "gr-toggle-button.h"
@@ -49,6 +50,7 @@ main (int argc, char *argv[])
         int status;
 
         g_type_ensure (GR_TYPE_COOKING_VIEW);
+        g_type_ensure (GR_TYPE_COOKING_PAGE);
         g_type_ensure (GR_TYPE_CUISINE_PAGE);
         g_type_ensure (GR_TYPE_CUISINES_PAGE);
         g_type_ensure (GR_TYPE_DETAILS_PAGE);
diff --git a/src/recipes-images.gresource.xml b/src/recipes-images.gresource.xml
index 741efe8..bf36103 100644
--- a/src/recipes-images.gresource.xml
+++ b/src/recipes-images.gresource.xml
@@ -46,5 +46,9 @@
     <file>icons/24x24/apps/shoppingcart.png</file>
     <file>icons/24x24/apps/shoppingcart-symbolic.symbolic.png</file>
     <file>built-with-builder-symbolic.symbolic.png</file>
+    <file>icons/48x48/apps/press-any-key.png</file>
+    <file>icons/48x48/apps/press-escape-key.png</file>
+    <file>icons/48x48/apps/press-left-button.png</file>
+    <file>icons/48x48/apps/press-right-button.png</file>
   </gresource>
 </gresources>
diff --git a/src/recipes-ui.gresource.xml b/src/recipes-ui.gresource.xml
index ccf4819..53c555c 100644
--- a/src/recipes-ui.gresource.xml
+++ b/src/recipes-ui.gresource.xml
@@ -5,6 +5,7 @@
     <file preprocess="xml-stripblanks">gr-chef-dialog.ui</file>
     <file preprocess="xml-stripblanks">gr-chef-tile.ui</file>
     <file preprocess="xml-stripblanks">gr-cooking-view.ui</file>
+    <file preprocess="xml-stripblanks">gr-cooking-page.ui</file>
     <file preprocess="xml-stripblanks">gr-cuisine-tile.ui</file>
     <file preprocess="xml-stripblanks">gr-cuisine-page.ui</file>
     <file preprocess="xml-stripblanks">gr-cuisines-page.ui</file>


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