Herramienta de dibujado de monigote (no funcional)
authordanigm <danigm>
Thu, 11 Feb 2010 00:09:01 +0000 (00:09 +0000)
committerdanigm <danigm@aa302d1f-72b1-406a-902b-8593ca2b2744>
Thu, 11 Feb 2010 00:09:01 +0000 (00:09 +0000)
He añadido el botón de la herramienta de dibujado de figuras y
monigotes, sólo es seleccionable en el modo viñeta.

También he adaptado un poco la arquitectura para soportar estas
herramientas.

He actualizado las traducciones.

git-svn-id: https://forja.rediris.es/svn/cusl4-tbo@41 aa302d1f-72b1-406a-902b-8593ca2b2744

17 files changed:
.gitignore
ChangeLog
HACKING [new file with mode: 0644]
data/icons/doodle.svg [new file with mode: 0644]
data/ui/tbo-toolbar-ui.xml
po/es.po
src/Makefile.am
src/custom-stock.c
src/custom-stock.h
src/doodle-tool.c [new file with mode: 0644]
src/doodle-tool.h [new file with mode: 0644]
src/selector-tool.c
src/tbo-window.c
src/tbo-window.h
src/ui-drawing.c
src/ui-toolbar.c
src/ui-toolbar.h

index 903f42c..57050e8 100644 (file)
@@ -1,2 +1,5 @@
 *.o
 *.log
+Makefile
+Makefile.in
+*~
index e69de29..354768b 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -0,0 +1,12 @@
+2010-02-11  gettextize  <bug-gnu-gettext@gnu.org>
+
+       * m4/gettext.m4: New file, from gettext-0.17.
+       * m4/iconv.m4: New file, from gettext-0.17.
+       * m4/lib-ld.m4: New file, from gettext-0.17.
+       * m4/lib-link.m4: New file, from gettext-0.17.
+       * m4/lib-prefix.m4: New file, from gettext-0.17.
+       * m4/nls.m4: New file, from gettext-0.17.
+       * m4/po.m4: New file, from gettext-0.17.
+       * m4/progtest.m4: New file, from gettext-0.17.
+       * Makefile.am (EXTRA_DIST): Add build/config.rpath.
+
diff --git a/HACKING b/HACKING
new file mode 100644 (file)
index 0000000..ab90391
--- /dev/null
+++ b/HACKING
@@ -0,0 +1,7 @@
+Translations
+------------
+
+To generate translations file .po exec:
+
+$ cd po
+$ intool-update es
diff --git a/data/icons/doodle.svg b/data/icons/doodle.svg
new file mode 100644 (file)
index 0000000..6504ea3
--- /dev/null
@@ -0,0 +1,164 @@
+<?xml version="1.0" encoding="UTF-8" standalone="no"?>
+<!-- Created with Inkscape (http://www.inkscape.org/) -->
+
+<svg
+   xmlns:dc="http://purl.org/dc/elements/1.1/"
+   xmlns:cc="http://creativecommons.org/ns#"
+   xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#"
+   xmlns:svg="http://www.w3.org/2000/svg"
+   xmlns="http://www.w3.org/2000/svg"
+   xmlns:xlink="http://www.w3.org/1999/xlink"
+   xmlns:sodipodi="http://sodipodi.sourceforge.net/DTD/sodipodi-0.dtd"
+   xmlns:inkscape="http://www.inkscape.org/namespaces/inkscape"
+   width="24"
+   height="24"
+   id="svg6003"
+   sodipodi:version="0.32"
+   inkscape:version="0.47 r22583"
+   version="1.0"
+   sodipodi:docname="doodle.svg"
+   inkscape:output_extension="org.inkscape.output.svg.inkscape">
+  <defs
+     id="defs6005">
+    <linearGradient
+       id="linearGradient5740">
+      <stop
+         id="stop5742"
+         offset="0.0000000"
+         style="stop-color:#ffffff;stop-opacity:1.0000000;" />
+      <stop
+         id="stop5744"
+         offset="1.0000000"
+         style="stop-color:#98b6d3;stop-opacity:1.0000000;" />
+    </linearGradient>
+    <inkscape:perspective
+       sodipodi:type="inkscape:persp3d"
+       inkscape:vp_x="0 : 526.18109 : 1"
+       inkscape:vp_y="0 : 1000 : 0"
+       inkscape:vp_z="744.09448 : 526.18109 : 1"
+       inkscape:persp3d-origin="372.04724 : 350.78739 : 1"
+       id="perspective6011" />
+    <linearGradient
+       inkscape:collect="always"
+       xlink:href="#linearGradient5740"
+       id="linearGradient2832"
+       gradientUnits="userSpaceOnUse"
+       gradientTransform="matrix(1.13356,0,0,1.133368,320.43084,96.81233)"
+       x1="101.09393"
+       y1="221.06877"
+       x2="112.20101"
+       y2="234.00311" />
+    <linearGradient
+       inkscape:collect="always"
+       xlink:href="#linearGradient5740"
+       id="linearGradient2834"
+       gradientUnits="userSpaceOnUse"
+       gradientTransform="matrix(0.809546,0,0,0.809417,323.85544,224.09401)"
+       x1="144.08243"
+       y1="157.82079"
+       x2="176.86269"
+       y2="188.41277" />
+  </defs>
+  <sodipodi:namedview
+     id="base"
+     pagecolor="#ffffff"
+     bordercolor="#666666"
+     borderopacity="1.0"
+     inkscape:pageopacity="0.0"
+     inkscape:pageshadow="2"
+     inkscape:zoom="15.416667"
+     inkscape:cx="12"
+     inkscape:cy="12"
+     inkscape:document-units="px"
+     inkscape:current-layer="layer1"
+     showgrid="false"
+     inkscape:window-width="1024"
+     inkscape:window-height="575"
+     inkscape:window-x="0"
+     inkscape:window-y="25"
+     inkscape:window-maximized="1" />
+  <metadata
+     id="metadata6008">
+    <rdf:RDF>
+      <cc:Work
+         rdf:about="">
+        <dc:format>image/svg+xml</dc:format>
+        <dc:type
+           rdf:resource="http://purl.org/dc/dcmitype/StillImage" />
+        <dc:title></dc:title>
+      </cc:Work>
+    </rdf:RDF>
+  </metadata>
+  <g
+     inkscape:label="Capa 1"
+     inkscape:groupmode="layer"
+     id="layer1"
+     transform="translate(-430.85714,-343.21933)">
+    <rect
+       style="fill:none;stroke:none;stroke-width:1.00000012;marker:none;display:inline"
+       id="rect4167"
+       width="24"
+       height="24"
+       x="430.85715"
+       y="343.21933" />
+    <rect
+       style="fill:none;stroke:#000000;stroke-width:1;stroke-linecap:butt;stroke-linejoin:round;stroke-miterlimit:0;stroke-opacity:1;stroke-dasharray:none;stroke-dashoffset:0;marker:none;display:inline"
+       id="draw_rect1"
+       width="18.991671"
+       height="18.991779"
+       x="433.36545"
+       y="345.72754" />
+    <rect
+       style="fill:url(#linearGradient2832);fill-opacity:1;fill-rule:evenodd;stroke:url(#linearGradient2834);stroke-width:0.99999982;stroke-linecap:butt;stroke-linejoin:round;stroke-miterlimit:0;stroke-opacity:1;stroke-dasharray:none;stroke-dashoffset:0;marker:none;display:inline"
+       id="rect5872"
+       width="17"
+       height="17"
+       x="434.35715"
+       y="346.71933" />
+    <path
+       sodipodi:type="arc"
+       style="fill:none;stroke:#000000;stroke-width:1.13364673;stroke-miterlimit:4;stroke-opacity:1;stroke-dasharray:none"
+       id="path5205"
+       sodipodi:cx="463.37561"
+       sodipodi:cy="126.02927"
+       sodipodi:rx="4.2146339"
+       sodipodi:ry="4.2146339"
+       d="m 467.59024,126.02927 a 4.2146339,4.2146339 0 1 1 -8.42926,0 4.2146339,4.2146339 0 1 1 8.42926,0 z"
+       transform="matrix(0.88210908,0,0,0.88210908,35.841631,241.36337)" />
+    <path
+       style="fill:none;stroke:#000000;stroke-width:1;stroke-opacity:1"
+       d="m 444.84227,355.95286 c 0.85512,3.34921 0.49881,8.69741 0.49881,8.69741"
+       id="path2859"
+       sodipodi:nodetypes="cc" />
+    <path
+       style="fill:none;stroke:#000000;stroke-width:1;stroke-opacity:1"
+       d="m 445.26982,358.73198 -3.84803,2.35159 -3.63426,-5.27324"
+       id="path2861" />
+    <path
+       style="fill:none;stroke:#000000;stroke-width:1;stroke-opacity:1"
+       d="m 445.34108,358.37569 3.77978,6.35113"
+       id="path2863"
+       sodipodi:nodetypes="cc" />
+    <path
+       style="fill:none;stroke:#000000;stroke-opacity:1"
+       d="M 5.4636935,13.155393 7.2021414,13.072613 6.0431761,11.251382"
+       id="path2873"
+       transform="translate(430.85714,343.21933)" />
+    <path
+       style="fill:none;stroke:#000000;stroke-opacity:1"
+       d="M 7.5332743,13.072613 7.781624,11.416948"
+       id="path2875"
+       transform="translate(430.85714,343.21933)" />
+    <path
+       style="fill:none;stroke:#000000;stroke-opacity:1"
+       d="m 10.76182,5.0426393 8.44389,3.890812"
+       id="path2877"
+       transform="translate(430.85714,343.21933)" />
+    <path
+       style="fill:#000000;stroke:#000000;stroke-opacity:1;fill-opacity:1"
+       d="M 12.914185,5.6221219 13.907583,3.6353243 18.460662,5.7049052 17.384479,8.0228357 12.914185,5.6221219 z"
+       id="path2879"
+       transform="translate(430.85714,343.21933)"
+       sodipodi:nodetypes="ccccc" />
+  </g>
+</svg>
index 9054acd..ed8b960 100644 (file)
@@ -13,6 +13,8 @@
        <separator/>
        <toolitem name="selector" action="Selector"/>
        <toolitem name="newframe" action="NewFrame"/>
+       <separator/>
+       <toolitem name="doodle" action="Doodle"/>
      </placeholder>
     </toolbar>
 </ui>
index bc3b731..2c51b0e 100644 (file)
--- a/po/es.po
+++ b/po/es.po
@@ -7,7 +7,7 @@ msgid ""
 msgstr ""
 "Project-Id-Version: PACKAGE 0.1\n"
 "Report-Msgid-Bugs-To: dani@danigm.net\n"
-"POT-Creation-Date: 2010-01-25 21:50+0100\n"
+"POT-Creation-Date: 2010-02-11 00:41+0100\n"
 "PO-Revision-Date: 2010-01-24 20:48+0100\n"
 "Last-Translator: Daniel Garcia <dani@danigm.net>\n"
 "Language-Team: \n"
@@ -15,81 +15,87 @@ msgstr ""
 "Content-Type: text/plain; charset=utf-8\n"
 "Content-Transfer-Encoding: 8bit\n"
 
-#: ../src/ui-toolbar.c:69
+#: ../src/ui-toolbar.c:88
 #, c-format
 msgid "toolbar: %s\n"
 msgstr "barra de herramientas: %s\n"
 
 #. File menu
-#: ../src/ui-toolbar.c:113 ../src/ui-menu.c:28
+#: ../src/ui-toolbar.c:132 ../src/ui-menu.c:28
 msgid "_New"
 msgstr "_Nuevo"
 
-#: ../src/ui-toolbar.c:114 ../src/comic-new-dialog.c:22
+#: ../src/ui-toolbar.c:133 ../src/comic-new-dialog.c:22
 msgid "New Comic"
 msgstr "Nuevo Comic"
 
-#: ../src/ui-toolbar.c:117 ../src/ui-menu.c:32
+#: ../src/ui-toolbar.c:136 ../src/ui-menu.c:32
 msgid "_Open"
 msgstr "_Abrir"
 
-#: ../src/ui-toolbar.c:118
+#: ../src/ui-toolbar.c:137
 msgid "Open comic"
 msgstr "Abrir comic"
 
-#: ../src/ui-toolbar.c:121 ../src/ui-menu.c:36
+#: ../src/ui-toolbar.c:140 ../src/ui-menu.c:36
 msgid "_Save"
 msgstr "_Guardar"
 
-#: ../src/ui-toolbar.c:122 ../src/ui-menu.c:37
+#: ../src/ui-toolbar.c:141 ../src/ui-menu.c:37
 msgid "Save current document"
 msgstr "Guardar el documento actual"
 
 #. Page tools
-#: ../src/ui-toolbar.c:126
+#: ../src/ui-toolbar.c:145
 msgid "New Page"
 msgstr "Nueva Página"
 
-#: ../src/ui-toolbar.c:127
+#: ../src/ui-toolbar.c:146
 msgid "New page"
 msgstr "Nueva página"
 
-#: ../src/ui-toolbar.c:130
+#: ../src/ui-toolbar.c:149
 msgid "Delete Page"
 msgstr "Borrar Página"
 
-#: ../src/ui-toolbar.c:131
+#: ../src/ui-toolbar.c:150
 msgid "Delete current page"
 msgstr "Borrar la página actual"
 
-#: ../src/ui-toolbar.c:134
+#: ../src/ui-toolbar.c:153
 msgid "Prev Page"
 msgstr "Página anterior"
 
-#: ../src/ui-toolbar.c:135
+#: ../src/ui-toolbar.c:154
 msgid "Prev page"
 msgstr "Página anterior"
 
-#: ../src/ui-toolbar.c:138
+#: ../src/ui-toolbar.c:157
 msgid "Next Page"
 msgstr "Página siguiente"
 
-#: ../src/ui-toolbar.c:139
+#: ../src/ui-toolbar.c:158
 msgid "Next page"
 msgstr "Página siguiente"
 
-#: ../src/ui-toolbar.c:144
+#. Page view tools
+#: ../src/ui-toolbar.c:164
 msgid "New _Frame"
 msgstr "Nueva _Vieta"
 
-#: ../src/ui-toolbar.c:145
+#: ../src/ui-toolbar.c:165
 msgid "New Frame"
 msgstr "Nueva Vieta"
 
-#: ../src/ui-toolbar.c:148 ../src/ui-toolbar.c:149
+#: ../src/ui-toolbar.c:168 ../src/ui-toolbar.c:169
 msgid "Selector"
 msgstr "Selector"
 
+#. Frame view tools
+#: ../src/ui-toolbar.c:173 ../src/ui-toolbar.c:174
+msgid "Doodle"
+msgstr "Monigote"
+
 #: ../src/comic-new-dialog.c:34
 msgid "width: "
 msgstr "ancho: "
@@ -98,16 +104,16 @@ msgstr "ancho: "
 msgid "height: "
 msgstr "alto: "
 
-#: ../src/custom-stock.c:34
+#: ../src/custom-stock.c:35
 #, c-format
 msgid "error loading image %s\n"
 msgstr "error cargando imagen %s\n"
 
-#: ../src/tbo-window.c:90
+#: ../src/tbo-window.c:93
 msgid "Untitled"
 msgstr "Sintitulo"
 
-#: ../src/tbo-window.c:128
+#: ../src/tbo-window.c:138
 #, c-format
 msgid "page: %d of %d [ %5d,%5d ] | frames: %d"
 msgstr "página: %d de %d [ %5d,%5d ] | viñetas: %d"
index 5b948a4..867f405 100644 (file)
@@ -20,6 +20,7 @@ tbo_SOURCES = \
        ui-toolbar.c \
        frame-tool.c \
        selector-tool.c \
+       doodle-tool.c \
        custom-stock.c \
        tbo-window.h \
        comic.h \
@@ -32,6 +33,7 @@ tbo_SOURCES = \
        ui-toolbar.h \
        frame-tool.h \
        selector-tool.h \
+       doodle-tool.h \
        custom-stock.h
 
 tbo_CFLAGS = @GTK_CFLAGS@ \
index 2fe1def..92dce2f 100644 (file)
@@ -19,7 +19,8 @@ void load_custom_stock ()
 
     icon icons[] = {
         {DATA_DIR ICONDIR "frame.svg", TBO_STOCK_FRAME},
-        {DATA_DIR ICONDIR "selector.svg", TBO_STOCK_SELECTOR}
+        {DATA_DIR ICONDIR "selector.svg", TBO_STOCK_SELECTOR},
+        {DATA_DIR ICONDIR "doodle.svg", TBO_STOCK_DOODLE}
     };
 
     int i;
index b726c53..108c72f 100644 (file)
@@ -3,6 +3,7 @@
 
 #define TBO_STOCK_FRAME "tbo-newframe"
 #define TBO_STOCK_SELECTOR "tbo-selector"
+#define TBO_STOCK_DOODLE "tbo-doodle"
 
 void load_custom_stock ();
 
diff --git a/src/doodle-tool.c b/src/doodle-tool.c
new file mode 100644 (file)
index 0000000..dc4eced
--- /dev/null
@@ -0,0 +1,15 @@
+#include <gtk/gtk.h>
+#include <gdk/gdkkeysyms.h>
+#include <cairo.h>
+#include "selector-tool.h"
+#include "tbo-window.h"
+#include "page.h"
+#include "frame.h"
+#include "comic.h"
+#include "ui-drawing.h"
+
+void doodle_tool_on_move (GtkWidget *widget, GdkEventMotion *event, TboWindow *tbo){}
+void doodle_tool_on_click (GtkWidget *widget, GdkEventButton *event, TboWindow *tbo){}
+void doodle_tool_on_release (GtkWidget *widget, GdkEventButton *event, TboWindow *tbo){}
+void doodle_tool_on_key (GtkWidget *widget, GdkEventKey *event, TboWindow *tbo){}
+void doodle_tool_drawing (cairo_t *cr){}
diff --git a/src/doodle-tool.h b/src/doodle-tool.h
new file mode 100644 (file)
index 0000000..f03f8de
--- /dev/null
@@ -0,0 +1,14 @@
+#ifndef __TBO_DOODLE_TOOL__
+#define __TBO_DOODLE_TOOL__
+
+#include <gtk/gtk.h>
+#include <cairo.h>
+#include "tbo-window.h"
+
+void doodle_tool_on_move (GtkWidget *widget, GdkEventMotion *event, TboWindow *tbo);
+void doodle_tool_on_click (GtkWidget *widget, GdkEventButton *event, TboWindow *tbo);
+void doodle_tool_on_release (GtkWidget *widget, GdkEventButton *event, TboWindow *tbo);
+void doodle_tool_on_key (GtkWidget *widget, GdkEventKey *event, TboWindow *tbo);
+void doodle_tool_drawing (cairo_t *cr);
+
+#endif
index b9dbf97..bfbe31b 100644 (file)
@@ -46,13 +46,6 @@ update_selected_cb (GtkSpinButton *widget, TboWindow *tbo)
     return FALSE;
 }
 
-gboolean
-remove_cb (GtkWidget *widget, gpointer data)
-{
-    gtk_widget_destroy(widget);
-    return FALSE;
-}
-
 GtkWidget *add_spin_with_label (GtkWidget *toolarea, const char *string, int value)
 {
         GtkWidget *label;
@@ -73,9 +66,9 @@ GtkWidget *add_spin_with_label (GtkWidget *toolarea, const char *string, int val
 }
 
 void
-empty_tool_area (GtkWidget *toolarea)
+empty_tool_area (TboWindow *tbo)
 {
-    gtk_container_foreach (GTK_CONTAINER (toolarea), (GtkCallback)remove_cb, NULL);
+    tbo_empty_tool_area (tbo);
     SPIN_X = NULL;
     SPIN_Y = NULL;
     SPIN_H = NULL;
@@ -89,7 +82,7 @@ update_tool_area (TboWindow *tbo)
 
     if (!SPIN_X)
     {
-        empty_tool_area (toolarea);
+        empty_tool_area (tbo);
         SPIN_X = add_spin_with_label (toolarea, "x: ", SELECTED->x);
         SPIN_Y = add_spin_with_label (toolarea, "y: ", SELECTED->y);
         SPIN_W = add_spin_with_label (toolarea, "w: ", SELECTED->width);
@@ -113,7 +106,7 @@ void
 set_selected (Frame *frame, TboWindow *tbo)
 {
     SELECTED = frame;
-    empty_tool_area (tbo->toolarea);
+    empty_tool_area (tbo);
     if (SELECTED != NULL)
         update_tool_area (tbo);
 }
@@ -237,7 +230,7 @@ page_view_on_click (GtkWidget *widget, GdkEventButton *event, TboWindow *tbo)
     if (SELECTED && event->type == GDK_2BUTTON_PRESS)
     {
         set_frame_view (SELECTED);
-        empty_tool_area (tbo->toolarea);
+        empty_tool_area (tbo);
     }
 
     START_X = x;
index 402a2b0..74fa930 100644 (file)
@@ -142,5 +142,18 @@ tbo_window_update_status (TboWindow *tbo, int x, int y)
                     tbo_page_len (tbo_comic_get_current_page (tbo->comic)));
     gtk_statusbar_push (GTK_STATUSBAR (tbo->status), 0, buffer);
     update_drawing (tbo);
+    update_toolbar (tbo);
 }
 
+gboolean
+remove_cb (GtkWidget *widget, gpointer data)
+{
+    gtk_widget_destroy(widget);
+    return FALSE;
+}
+
+void
+tbo_empty_tool_area (TboWindow *tbo)
+{
+    gtk_container_foreach (GTK_CONTAINER (tbo->toolarea), (GtkCallback)remove_cb, NULL);
+}
index 1bd3888..e11c3a7 100644 (file)
@@ -22,5 +22,6 @@ gboolean tbo_window_free_cb (GtkWidget *widget, GdkEventExpose *event, TboWindow
 GdkPixbuf *create_pixbuf (const gchar * filename);
 TboWindow * tbo_new_tbo (int width, int height);
 void tbo_window_update_status (TboWindow *tbo, int x, int y);
+void tbo_empty_tool_area (TboWindow *tbo);
 
 #endif
index 8c70133..2181f20 100644 (file)
@@ -14,6 +14,7 @@
 
 #include "frame-tool.h"
 #include "selector-tool.h"
+#include "doodle-tool.h"
 
 
 Frame *FRAME_VIEW = NULL;
@@ -34,6 +35,13 @@ on_key_cb (GtkWidget    *widget,
             update_drawing (tbo);
             tbo_window_update_status (tbo, 0, 0);
             break;
+
+        case DOODLE:
+            doodle_tool_on_key (widget, event, tbo);
+            update_drawing (tbo);
+            tbo_window_update_status (tbo, 0, 0);
+            break;
+
         case NONE:
         default:
             break;
@@ -100,6 +108,10 @@ on_expose_cb(GtkWidget      *widget,
             selector_tool_drawing (cr);
             break;
 
+        case DOODLE:
+            doodle_tool_drawing (cr);
+            break;
+
         case NONE:
         default:
             break;
@@ -145,6 +157,11 @@ on_move_cb (GtkWidget     *widget,
             update_drawing (tbo);
             break;
 
+        case DOODLE:
+            doodle_tool_on_move (widget, event, tbo);
+            update_drawing (tbo);
+            break;
+
         case NONE:
         default:
             break;
@@ -175,6 +192,11 @@ on_click_cb (GtkWidget    *widget,
             update_drawing (tbo);
             break;
 
+        case DOODLE:
+            doodle_tool_on_click (widget, event, tbo);
+            update_drawing (tbo);
+            break;
+
         case NONE:
         default:
             break;
@@ -205,6 +227,11 @@ on_release_cb (GtkWidget    *widget,
             update_drawing (tbo);
             break;
 
+        case DOODLE:
+            doodle_tool_on_release (widget, event, tbo);
+            update_drawing (tbo);
+            break;
+
         case NONE:
         default:
             break;
index 244e5f5..195db3e 100644 (file)
@@ -9,6 +9,7 @@
 #include "tbo-window.h"
 #include "comic.h"
 #include "custom-stock.h"
+#include "ui-drawing.h"
 
 static int SELECTED_TOOL = NONE;
 static GtkActionGroup *ACTION_GROUP;
@@ -43,6 +44,9 @@ update_toolbar (TboWindow *tbo)
     GtkAction *next;
     GtkAction *delete;
 
+    GtkAction *doodle;
+    GtkAction *new_frame;
+
     // Page next, prev and delete button sensitive
     prev = gtk_action_group_get_action (ACTION_GROUP, "PrevPage");
     next = gtk_action_group_get_action (ACTION_GROUP, "NextPage");
@@ -61,6 +65,21 @@ update_toolbar (TboWindow *tbo)
         gtk_action_set_sensitive (delete, TRUE);
     else
         gtk_action_set_sensitive (delete, FALSE);
+
+    // Frame view disabled in page view
+    doodle = gtk_action_group_get_action (ACTION_GROUP, "Doodle");
+    new_frame = gtk_action_group_get_action (ACTION_GROUP, "NewFrame");
+
+    if (get_frame_view() == NULL)
+    {
+        gtk_action_set_sensitive (doodle, FALSE);
+        gtk_action_set_sensitive (new_frame, TRUE);
+    }
+    else
+    {
+        gtk_action_set_sensitive (doodle, TRUE);
+        gtk_action_set_sensitive (new_frame, FALSE);
+    }
 }
 
 gboolean 
@@ -141,6 +160,7 @@ static const GtkActionEntry tbo_tools_entries [] = {
 };
 
 static const GtkToggleActionEntry tbo_tools_toogle_entries [] = {
+    // Page view tools
     { "NewFrame", TBO_STOCK_FRAME, N_("New _Frame"), "<control>F",
       N_("New Frame"),
       G_CALLBACK (select_tool), FALSE },
@@ -148,11 +168,17 @@ static const GtkToggleActionEntry tbo_tools_toogle_entries [] = {
     { "Selector", TBO_STOCK_SELECTOR, N_("Selector"), "",
       N_("Selector"),
       G_CALLBACK (select_tool), FALSE },
+
+    // Frame view tools
+    { "Doodle", TBO_STOCK_DOODLE, N_("Doodle"), "",
+      N_("Doodle"),
+      G_CALLBACK (select_tool), FALSE },
 };
 
 static const tool_and_action tools_actions [] = {
     {FRAME, "NewFrame"},
     {SELECTOR, "Selector"},
+    {DOODLE, "Doodle"},
 };
 
 void
index af1e61f..9a53aa9 100644 (file)
@@ -9,6 +9,7 @@ enum Tool
     NONE,
     SELECTOR,
     FRAME,
+    DOODLE,
 };
 
 enum Tool get_selected_tool ();