Requires Mono"The interface is largely based off of Paint.NET, but most of the code is original. The only code directly used by Pinta is for the adjustments and effects, which is basically a straight copy from Paint.NET 3.0.
Regardless, we are very grateful that Paint.NET 3.36 was open sourced under the MIT license so we could use some of their awesome code."
Anyone care to make a Pinta.pet?
Anyone care to make a Pinta.pet?
Is the Paint.Net clone: Pinta a possibility for PET packaging?. I think it is less than 2mb. http://github.com/jpobst/Pinta
Dear omskates,
From what I have read on the pinta site and http://www.murga-linux.com/puppy/viewtopic.php?t=40567, pinta requires Mono runtime, which weighs in at about 35 MB in an sfs. That is more than twice the size of Gimp, which is more powerful. So, not much bang for the buck, unfortunately, when dependencies are taken into account. Of course, I may be wrong, but that is my understanding.
With kind regards,
vovchik
From what I have read on the pinta site and http://www.murga-linux.com/puppy/viewtopic.php?t=40567, pinta requires Mono runtime, which weighs in at about 35 MB in an sfs. That is more than twice the size of Gimp, which is more powerful. So, not much bang for the buck, unfortunately, when dependencies are taken into account. Of course, I may be wrong, but that is my understanding.
With kind regards,
vovchik
gnome-paint
@jemimah
What version of Gtk2 does puppy use?
Maybe gnome-paint can be modified.
What version of Gtk2 does puppy use?
Maybe gnome-paint can be modified.
Dear Jemimah,
Gpaint-2 (gnome-paint) compiles on puppy 3.10 (with GTK 2.10) just fine and the menus work. The window dimensions are controlled by HEIGHT and WIDTH vars in lines 38 and 39 of main.c:
The main problem with this app is that it does not support high bit depth and does not recognize layers and the alpha channel - which means no transparency. Of course, we could hack it.
With kind regards,
vovchik
Gpaint-2 (gnome-paint) compiles on puppy 3.10 (with GTK 2.10) just fine and the menus work. The window dimensions are controlled by HEIGHT and WIDTH vars in lines 38 and 39 of main.c:
Code: Select all
#define WIDTH 740
#define HEIGHT 680
With kind regards,
vovchik
Did you get this one? http://code.google.com/p/gnome-paint/
Gpaint2 and gnome-paint are different projects I think.
Gpaint2 and gnome-paint are different projects I think.
Dear Jemimah,
You're right. I got gpaint from gnu.org http://www.gnu.org/software/gpaint/, and it is old as the hills (2004 or 2005). Gnome-paint is 2009 or 2010. And the sources are different. Thanks for putting me on the right track. I wish the MTPaint gui had been done in Glade, because changing that would have been a breeze. I agree with you that we are missing an "intuitively obvious" paint prog that has the functions of MTPaint. Sumo.org once gave away a standalone sumopaint (version 1.0) via a German computer magazine, but I have not been able to locate it. It runs in flash. I, too, am still looking for a GTK-based simple paint that has undo, layers and the alpha channel. I'll certainly holler when or if I find something. M$ seems to have a lot of that type of thing available, but not my cup of tea.
With kind regards,
vovchik
You're right. I got gpaint from gnu.org http://www.gnu.org/software/gpaint/, and it is old as the hills (2004 or 2005). Gnome-paint is 2009 or 2010. And the sources are different. Thanks for putting me on the right track. I wish the MTPaint gui had been done in Glade, because changing that would have been a breeze. I agree with you that we are missing an "intuitively obvious" paint prog that has the functions of MTPaint. Sumo.org once gave away a standalone sumopaint (version 1.0) via a German computer magazine, but I have not been able to locate it. It runs in flash. I, too, am still looking for a GTK-based simple paint that has undo, layers and the alpha channel. I'll certainly holler when or if I find something. M$ seems to have a lot of that type of thing available, but not my cup of tea.
With kind regards,
vovchik
"I didn't mess with it further because the window was not resizable, making it useless for netbooks."
Was there no resizing grip or statusbar?
"It might be worth a second look though if someone wants to fix it."
According to http://www.mail-archive.com/gtk-app-dev ... 12493.html all one has to do is "hand define some uimanagers", as far as the menus are concerned. I could do it if someone has an example/link.
Was there no resizing grip or statusbar?
"It might be worth a second look though if someone wants to fix it."
According to http://www.mail-archive.com/gtk-app-dev ... 12493.html all one has to do is "hand define some uimanagers", as far as the menus are concerned. I could do it if someone has an example/link.
gnome-paint patch for gtk2 >= 2.14
@jemimah
I have a patch for using gnome-paint with gtk2 >= 2.14 (2.14.7 I tested on).
Can you test it?
diff -uNr gnome-paint-0.3/data/ui/gnome_paint.ui gnome-paint-0.3p/data/ui/gnome_paint.ui
--- gnome-paint-0.3/data/ui/gnome_paint.ui 2010-05-30 11:42:06.000000000 -0500
+++ gnome-paint-0.3p/data/ui/gnome_paint.ui 2010-05-31 23:27:29.000000000 -0500
@@ -1,6 +1,6 @@
<?xml version="1.0"?>
<interface>
- <requires lib="gtk+" version="2.16"/>
+ <requires lib="gtk+" version="2.14"/>
<!-- interface-naming-policy toplevel-contextual -->
<object class="GtkWindow" id="window">
<property name="visible">True</property>
@@ -12,196 +12,11 @@
<object class="GtkVBox" id="vbox1">
<property name="visible">True</property>
<child>
- <object class="GtkMenuBar" id="menu">
+ <object class="GtkVBox" id="vbox_for_menu">
<property name="visible">True</property>
+ <property name="orientation">vertical</property>
<child>
- <object class="GtkMenuItem" id="menuitem-file">
- <property name="visible">True</property>
- <property name="label" translatable="yes">_File</property>
- <property name="use_underline">True</property>
- <child type="submenu">
- <object class="GtkMenu" id="menu-file">
- <property name="visible">True</property>
- <property name="tearoff_title">File</property>
- <child>
- <object class="GtkImageMenuItem" id="menu-new">
- <property name="label">gtk-new</property>
- <property name="visible">True</property>
- <property name="use_underline">True</property>
- <property name="use_stock">True</property>
- <accelerator key="n" signal="activate" modifiers="GDK_CONTROL_MASK"/>
- <signal name="activate" handler="on_menu_new_activate"/>
- </object>
- </child>
- <child>
- <object class="GtkImageMenuItem" id="menu-open">
- <property name="label">gtk-open</property>
- <property name="visible">True</property>
- <property name="use_underline">True</property>
- <property name="use_stock">True</property>
- <accelerator key="o" signal="activate" modifiers="GDK_CONTROL_MASK"/>
- <signal name="activate" handler="on_menu_open_activate"/>
- </object>
- </child>
- <child>
- <object class="GtkImageMenuItem" id="menu-save">
- <property name="label">gtk-save</property>
- <property name="visible">True</property>
- <property name="use_underline">True</property>
- <property name="use_stock">True</property>
- <accelerator key="s" signal="activate" modifiers="GDK_CONTROL_MASK"/>
- <signal name="activate" handler="on_menu_save_activate"/>
- </object>
- </child>
- <child>
- <object class="GtkImageMenuItem" id="menu-save-as">
- <property name="label">gtk-save-as</property>
- <property name="visible">True</property>
- <property name="use_underline">True</property>
- <property name="use_stock">True</property>
- <accelerator key="s" signal="activate" modifiers="GDK_SHIFT_MASK | GDK_CONTROL_MASK"/>
- <signal name="activate" handler="on_menu_save_as_activate"/>
- </object>
- </child>
- <child>
- <object class="GtkSeparatorMenuItem" id="separatormenuitem1">
- <property name="visible">True</property>
- </object>
- </child>
- <child>
- <object class="GtkImageMenuItem" id="menu-quit">
- <property name="label">gtk-quit</property>
- <property name="visible">True</property>
- <property name="events"></property>
- <property name="extension_events">all</property>
- <property name="has_tooltip">True</property>
- <property name="border_width">2</property>
- <property name="use_underline">True</property>
- <property name="use_stock">True</property>
- <accelerator key="q" signal="activate" modifiers="GDK_CONTROL_MASK"/>
- <signal name="activate" handler="on_window_destroy"/>
- </object>
- </child>
- </object>
- </child>
- </object>
- </child>
- <child>
- <object class="GtkMenuItem" id="menuitem-edit">
- <property name="visible">True</property>
- <property name="label" translatable="yes">_Edit</property>
- <property name="use_underline">True</property>
- <child type="submenu">
- <object class="GtkMenu" id="menu2">
- <property name="visible">True</property>
- <child>
- <object class="GtkImageMenuItem" id="menu-undo">
- <property name="label">gtk-undo</property>
- <property name="visible">True</property>
- <property name="use_underline">True</property>
- <property name="use_stock">True</property>
- <accelerator key="z" signal="activate" modifiers="GDK_CONTROL_MASK"/>
- <signal name="activate" handler="on_menu_undo_activate"/>
- </object>
- </child>
- <child>
- <object class="GtkImageMenuItem" id="menu-redo">
- <property name="label">gtk-redo</property>
- <property name="visible">True</property>
- <property name="use_underline">True</property>
- <property name="use_stock">True</property>
- <accelerator key="z" signal="activate" modifiers="GDK_SHIFT_MASK | GDK_CONTROL_MASK"/>
- <signal name="activate" handler="on_menu_redo_activate"/>
- </object>
- </child>
- <child>
- <object class="GtkSeparatorMenuItem" id="separator">
- <property name="visible">True</property>
- </object>
- </child>
- <child>
- <object class="GtkImageMenuItem" id="menu-cut">
- <property name="label">gtk-cut</property>
- <property name="visible">True</property>
- <property name="use_underline">True</property>
- <property name="use_stock">True</property>
- <accelerator key="x" signal="activate" modifiers="GDK_CONTROL_MASK"/>
- </object>
- </child>
- <child>
- <object class="GtkImageMenuItem" id="menu-copy">
- <property name="label">gtk-copy</property>
- <property name="visible">True</property>
- <property name="use_underline">True</property>
- <property name="use_stock">True</property>
- <accelerator key="c" signal="activate" modifiers="GDK_CONTROL_MASK"/>
- <signal name="activate" handler="on_menu_copy_activate"/>
- </object>
- </child>
- <child>
- <object class="GtkImageMenuItem" id="menu-paste">
- <property name="label">gtk-paste</property>
- <property name="visible">True</property>
- <property name="use_underline">True</property>
- <property name="use_stock">True</property>
- <accelerator key="v" signal="activate" modifiers="GDK_CONTROL_MASK"/>
- <signal name="activate" handler="on_menu_paste_activate"/>
- </object>
- </child>
- <child>
- <object class="GtkImageMenuItem" id="menu-delete">
- <property name="label">gtk-delete</property>
- <property name="visible">True</property>
- <property name="use_underline">True</property>
- <property name="use_stock">True</property>
- <accelerator key="Delete" signal="activate"/>
- </object>
- </child>
- </object>
- </child>
- </object>
- </child>
- <child>
- <object class="GtkMenuItem" id="menuitem3">
- <property name="visible">True</property>
- <property name="label" translatable="yes">_View</property>
- <property name="use_underline">True</property>
- </object>
- </child>
- <child>
- <object class="GtkMenuItem" id="menuitem5">
- <property name="visible">True</property>
- <property name="label" translatable="yes">_Image</property>
- <property name="use_underline">True</property>
- </object>
- </child>
- <child>
- <object class="GtkMenuItem" id="menuitem6">
- <property name="visible">True</property>
- <property name="label" translatable="yes">_Color</property>
- <property name="use_underline">True</property>
- </object>
- </child>
- <child>
- <object class="GtkMenuItem" id="menuitem_help">
- <property name="visible">True</property>
- <property name="label" translatable="yes">_Help</property>
- <property name="use_underline">True</property>
- <child type="submenu">
- <object class="GtkMenu" id="menu_help">
- <property name="visible">True</property>
- <child>
- <object class="GtkImageMenuItem" id="menu_about">
- <property name="label">gtk-about</property>
- <property name="visible">True</property>
- <property name="use_underline">True</property>
- <property name="use_stock">True</property>
- <signal name="activate" handler="on_menu_about_activate"/>
- </object>
- </child>
- </object>
- </child>
- </object>
+ <placeholder/>
</child>
</object>
<packing>
diff -uNr gnome-paint-0.3/src/cv_drawing.c gnome-paint-0.3p/src/cv_drawing.c
--- gnome-paint-0.3/src/cv_drawing.c 2010-05-30 11:42:03.000000000 -0500
+++ gnome-paint-0.3p/src/cv_drawing.c 2010-06-01 15:52:13.000000000 -0500
@@ -358,7 +358,7 @@
gpointer user_data )
{
gdk_draw_drawable ( widget->window,
- widget->style->fg_gc[gtk_widget_get_state(widget)],
+ widget->style->fg_gc[GTK_WIDGET_STATE(widget)],
cv.pixmap,
event->area.x, event->area.y,
event->area.x, event->area.y,
diff -uNr gnome-paint-0.3/src/cv_resize.c gnome-paint-0.3p/src/cv_resize.c
--- gnome-paint-0.3/src/cv_resize.c 2010-05-30 11:42:03.000000000 -0500
+++ gnome-paint-0.3p/src/cv_resize.c 2010-06-01 15:55:20.000000000 -0500
@@ -195,10 +195,10 @@
gpointer user_data )
{
gdk_draw_line ( widget->window,
- widget->style->fg_gc[gtk_widget_get_state(widget)],
+ widget->style->fg_gc[GTK_WIDGET_STATE(widget)],
0,0,0,widget->allocation.height);
gdk_draw_line ( widget->window,
- widget->style->fg_gc[gtk_widget_get_state(widget)],
+ widget->style->fg_gc[GTK_WIDGET_STATE(widget)],
0,0,widget->allocation.width,0);
return TRUE;
}
diff -uNr gnome-paint-0.3/src/main.c gnome-paint-0.3p/src/main.c
--- gnome-paint-0.3/src/main.c 2010-05-30 11:42:03.000000000 -0500
+++ gnome-paint-0.3p/src/main.c 2010-06-01 15:49:28.000000000 -0500
@@ -28,10 +28,11 @@
#include "file.h"
#include "undo.h"
#include "color-picker.h"
-
+#include "clipboard.h"
#include <glib/gi18n.h>
#include <gtk/gtk.h>
+#include <gdk/gdkkeysyms.h>
#define UI_FILE PACKAGE_DATA_DIR G_DIR_SEPARATOR_S "gnome-paint" G_DIR_SEPARATOR_S "ui" G_DIR_SEPARATOR_S "gnome_paint.ui"
#define ICON_DIR PACKAGE_DATA_DIR G_DIR_SEPARATOR_S "gnome-paint" G_DIR_SEPARATOR_S "icons"
@@ -41,8 +42,13 @@
void gnome_paint_init ( int argc, char *argv[] );
void on_window_destroy ( GtkObject *object, gpointer user_data );
void on_menu_about_activate ( GtkMenuItem *menuitem, gpointer user_data );
-
-
+static GtkWidget *create_the_menu(GtkWidget *window, GtkWidget *vbox);
+static void create_sub_menu(GtkWidget *parent, gchar *mnemonic,
+ GtkAccelGroup *accel_group,
+ const gchar *stock_id,
+ guint accel_key,
+ GdkModifierType accel_mods,
+ GCallback callback, gpointer data);
void
on_menu_new_activate( GtkMenuItem *menuitem, gpointer user_data)
@@ -67,7 +73,7 @@
main (int argc, char *argv[])
{
- GtkWidget *window;
+ GtkWidget *window, *menubar, *menu, *menuitem;
ColorPicker *color_picker;
// g_mem_set_vtable (glib_mem_profiler_table);
@@ -83,6 +89,7 @@
gtk_icon_theme_append_search_path (gtk_icon_theme_get_default (), ICON_DIR);
gtk_window_set_default_icon_name ("gp");
window = create_window ();
+
gnome_paint_init (argc, argv);
gtk_widget_show (window);
@@ -150,15 +157,21 @@
GtkWidget *window;
GtkWidget *widget;
GtkBuilder *builder;
+ GtkWidget *vbox;
builder = gtk_builder_new ();
gtk_builder_add_from_file (builder, UI_FILE, NULL);
window = GTK_WIDGET (gtk_builder_get_object (builder, "window"));
+ vbox = GTK_WIDGET (gtk_builder_get_object (builder, "vbox_for_menu"));
+
g_assert ( window );
file_set_parent_window ( GTK_WINDOW(window) );
gtk_builder_connect_signals (builder, NULL);
g_object_unref (G_OBJECT (builder));
+ /**** Create the menu ****/
+ create_the_menu(window, vbox);
+
/* To show all widget that is set invisible on Glade */
/* and call realize event */
gtk_widget_show_all(window);
@@ -173,7 +186,7 @@
"Juan Balderas",
NULL };
GtkAboutDialog *dlg;
-
+
dlg = GTK_ABOUT_DIALOG ( gtk_about_dialog_new () );
gtk_about_dialog_set_name ( dlg, "gnome-paint" );
gtk_about_dialog_set_version ( dlg, "0.3");
@@ -196,5 +209,126 @@
gtk_widget_destroy (dlg);
}
+static GtkWidget *create_the_menu(GtkWidget *window, GtkWidget *vbox)
+{
+ GtkWidget *menubar, *menu, *menudropdown, *menuitem;
+ GtkAccelGroup *accel_group = NULL;
+
+ accel_group = gtk_accel_group_new();
+ gtk_window_add_accel_group(GTK_WINDOW(window), accel_group);
+
+ menubar = gtk_menu_bar_new();
+
+ /* File Menu */
+ menu = gtk_menu_item_new_with_mnemonic("_File");
+ gtk_menu_shell_append(GTK_MENU_SHELL(menubar), menu);
+
+ menudropdown = gtk_menu_new();
+ gtk_menu_item_set_submenu(GTK_MENU_ITEM(menu), menudropdown);
+
+ create_sub_menu(menudropdown, "_New",
+ accel_group, GTK_STOCK_NEW, GDK_n, GDK_CONTROL_MASK,
+ G_CALLBACK(on_menu_new_activate), NULL);
+ create_sub_menu(menudropdown, "_Open",
+ accel_group, GTK_STOCK_OPEN, GDK_o, GDK_CONTROL_MASK,
+ G_CALLBACK(on_menu_open_activate), NULL);
+ create_sub_menu(menudropdown, "_Save",
+ accel_group, GTK_STOCK_SAVE, GDK_s, GDK_CONTROL_MASK,
+ G_CALLBACK(on_menu_save_activate), NULL);
+ create_sub_menu(menudropdown, "Save _As",
+ accel_group, GTK_STOCK_SAVE_AS, GDK_s, GDK_SHIFT_MASK | GDK_CONTROL_MASK,
+ G_CALLBACK(on_menu_save_as_activate), NULL);
+ /* Seperator */
+ create_sub_menu(menudropdown, NULL,
+ accel_group, "", 0, 0,
+ NULL, NULL);
+ create_sub_menu(menudropdown, "_Quit",
+ accel_group, GTK_STOCK_QUIT, GDK_q, GDK_CONTROL_MASK,
+ G_CALLBACK(on_window_destroy), NULL);
+
+ /* Edit Menu */
+ menu = gtk_menu_item_new_with_mnemonic("_Edit");
+ gtk_menu_shell_append(GTK_MENU_SHELL(menubar), menu);
+
+ menudropdown = gtk_menu_new();
+ gtk_menu_item_set_submenu(GTK_MENU_ITEM(menu), menudropdown);
+
+ create_sub_menu(menudropdown, "_Undo",
+ accel_group, GTK_STOCK_UNDO, GDK_z, GDK_CONTROL_MASK,
+ G_CALLBACK(on_menu_undo_activate), NULL);
+ create_sub_menu(menudropdown, "_Redo",
+ accel_group, GTK_STOCK_REDO, GDK_z, GDK_SHIFT_MASK | GDK_CONTROL_MASK,
+ G_CALLBACK(on_menu_redo_activate), NULL);
+ /* Seperator */
+ create_sub_menu(menudropdown, NULL,
+ accel_group, "", 0, 0,
+ NULL, NULL);
+ create_sub_menu(menudropdown, "Cu_t",
+ accel_group, GTK_STOCK_CUT, GDK_x, GDK_CONTROL_MASK,
+ NULL, NULL);
+ create_sub_menu(menudropdown, "_Copy",
+ accel_group, GTK_STOCK_COPY, GDK_c, GDK_CONTROL_MASK,
+ G_CALLBACK(on_menu_copy_activate), NULL);
+ create_sub_menu(menudropdown, "_Paste",
+ accel_group, GTK_STOCK_PASTE, GDK_v, GDK_CONTROL_MASK,
+ G_CALLBACK(on_menu_paste_activate), NULL);
+
+ create_sub_menu(menudropdown, "_Delete",
+ accel_group, GTK_STOCK_DELETE, GDK_Delete, 0,/* <-Should use 0 here? */
+ NULL, NULL);
+
+ /* View Menu */
+ menu = gtk_menu_item_new_with_mnemonic("_View");
+ gtk_menu_shell_append(GTK_MENU_SHELL(menubar), menu);
+
+ /* Image Menu */
+ menu = gtk_menu_item_new_with_mnemonic("_Image");
+ gtk_menu_shell_append(GTK_MENU_SHELL(menubar), menu);
+
+ /* Color Menu */
+ menu = gtk_menu_item_new_with_mnemonic("_Color");
+ gtk_menu_shell_append(GTK_MENU_SHELL(menubar), menu);
+
+ /* Help Menu */
+ menu = gtk_menu_item_new_with_mnemonic("_Help");
+ gtk_menu_shell_append(GTK_MENU_SHELL(menubar), menu);
+
+ menudropdown = gtk_menu_new();
+ gtk_menu_item_set_submenu(GTK_MENU_ITEM(menu), menudropdown);
+
+ create_sub_menu(menudropdown, "_About",
+ accel_group, GTK_STOCK_ABOUT, 0, 0,
+ G_CALLBACK(on_menu_about_activate), NULL);
+
+ /* Add menu bar to app */
+ gtk_container_add(GTK_CONTAINER(vbox), menubar);
+
+ return menubar;
+}
+
+static void create_sub_menu(GtkWidget *parent, gchar *mnemonic,
+ GtkAccelGroup *accel_group,
+ const gchar *stock_id,
+ guint accel_key,
+ GdkModifierType accel_mods,
+ GCallback callback, gpointer data)
+{
+ GtkWidget *menuitem;
+ if(NULL == mnemonic){
+ GtkWidget *separator_menu_item = gtk_separator_menu_item_new();
+ gtk_menu_shell_append(GTK_MENU_SHELL(parent), separator_menu_item);
+ }
+ else{
+ //printf("Debug %d %s\n", accel_key, mnemonic);
+ menuitem = gtk_image_menu_item_new_from_stock(stock_id, accel_group);
+ gtk_widget_add_accelerator(menuitem, "activate", accel_group,
+ accel_key, accel_mods, GTK_ACCEL_VISIBLE);
+ gtk_menu_shell_append(GTK_MENU_SHELL(parent), menuitem);
+ if(callback){
+ g_signal_connect(G_OBJECT(menuitem), "activate",
+ callback, data);
+ }
+ }
+}
I have a patch for using gnome-paint with gtk2 >= 2.14 (2.14.7 I tested on).
Can you test it?
diff -uNr gnome-paint-0.3/data/ui/gnome_paint.ui gnome-paint-0.3p/data/ui/gnome_paint.ui
--- gnome-paint-0.3/data/ui/gnome_paint.ui 2010-05-30 11:42:06.000000000 -0500
+++ gnome-paint-0.3p/data/ui/gnome_paint.ui 2010-05-31 23:27:29.000000000 -0500
@@ -1,6 +1,6 @@
<?xml version="1.0"?>
<interface>
- <requires lib="gtk+" version="2.16"/>
+ <requires lib="gtk+" version="2.14"/>
<!-- interface-naming-policy toplevel-contextual -->
<object class="GtkWindow" id="window">
<property name="visible">True</property>
@@ -12,196 +12,11 @@
<object class="GtkVBox" id="vbox1">
<property name="visible">True</property>
<child>
- <object class="GtkMenuBar" id="menu">
+ <object class="GtkVBox" id="vbox_for_menu">
<property name="visible">True</property>
+ <property name="orientation">vertical</property>
<child>
- <object class="GtkMenuItem" id="menuitem-file">
- <property name="visible">True</property>
- <property name="label" translatable="yes">_File</property>
- <property name="use_underline">True</property>
- <child type="submenu">
- <object class="GtkMenu" id="menu-file">
- <property name="visible">True</property>
- <property name="tearoff_title">File</property>
- <child>
- <object class="GtkImageMenuItem" id="menu-new">
- <property name="label">gtk-new</property>
- <property name="visible">True</property>
- <property name="use_underline">True</property>
- <property name="use_stock">True</property>
- <accelerator key="n" signal="activate" modifiers="GDK_CONTROL_MASK"/>
- <signal name="activate" handler="on_menu_new_activate"/>
- </object>
- </child>
- <child>
- <object class="GtkImageMenuItem" id="menu-open">
- <property name="label">gtk-open</property>
- <property name="visible">True</property>
- <property name="use_underline">True</property>
- <property name="use_stock">True</property>
- <accelerator key="o" signal="activate" modifiers="GDK_CONTROL_MASK"/>
- <signal name="activate" handler="on_menu_open_activate"/>
- </object>
- </child>
- <child>
- <object class="GtkImageMenuItem" id="menu-save">
- <property name="label">gtk-save</property>
- <property name="visible">True</property>
- <property name="use_underline">True</property>
- <property name="use_stock">True</property>
- <accelerator key="s" signal="activate" modifiers="GDK_CONTROL_MASK"/>
- <signal name="activate" handler="on_menu_save_activate"/>
- </object>
- </child>
- <child>
- <object class="GtkImageMenuItem" id="menu-save-as">
- <property name="label">gtk-save-as</property>
- <property name="visible">True</property>
- <property name="use_underline">True</property>
- <property name="use_stock">True</property>
- <accelerator key="s" signal="activate" modifiers="GDK_SHIFT_MASK | GDK_CONTROL_MASK"/>
- <signal name="activate" handler="on_menu_save_as_activate"/>
- </object>
- </child>
- <child>
- <object class="GtkSeparatorMenuItem" id="separatormenuitem1">
- <property name="visible">True</property>
- </object>
- </child>
- <child>
- <object class="GtkImageMenuItem" id="menu-quit">
- <property name="label">gtk-quit</property>
- <property name="visible">True</property>
- <property name="events"></property>
- <property name="extension_events">all</property>
- <property name="has_tooltip">True</property>
- <property name="border_width">2</property>
- <property name="use_underline">True</property>
- <property name="use_stock">True</property>
- <accelerator key="q" signal="activate" modifiers="GDK_CONTROL_MASK"/>
- <signal name="activate" handler="on_window_destroy"/>
- </object>
- </child>
- </object>
- </child>
- </object>
- </child>
- <child>
- <object class="GtkMenuItem" id="menuitem-edit">
- <property name="visible">True</property>
- <property name="label" translatable="yes">_Edit</property>
- <property name="use_underline">True</property>
- <child type="submenu">
- <object class="GtkMenu" id="menu2">
- <property name="visible">True</property>
- <child>
- <object class="GtkImageMenuItem" id="menu-undo">
- <property name="label">gtk-undo</property>
- <property name="visible">True</property>
- <property name="use_underline">True</property>
- <property name="use_stock">True</property>
- <accelerator key="z" signal="activate" modifiers="GDK_CONTROL_MASK"/>
- <signal name="activate" handler="on_menu_undo_activate"/>
- </object>
- </child>
- <child>
- <object class="GtkImageMenuItem" id="menu-redo">
- <property name="label">gtk-redo</property>
- <property name="visible">True</property>
- <property name="use_underline">True</property>
- <property name="use_stock">True</property>
- <accelerator key="z" signal="activate" modifiers="GDK_SHIFT_MASK | GDK_CONTROL_MASK"/>
- <signal name="activate" handler="on_menu_redo_activate"/>
- </object>
- </child>
- <child>
- <object class="GtkSeparatorMenuItem" id="separator">
- <property name="visible">True</property>
- </object>
- </child>
- <child>
- <object class="GtkImageMenuItem" id="menu-cut">
- <property name="label">gtk-cut</property>
- <property name="visible">True</property>
- <property name="use_underline">True</property>
- <property name="use_stock">True</property>
- <accelerator key="x" signal="activate" modifiers="GDK_CONTROL_MASK"/>
- </object>
- </child>
- <child>
- <object class="GtkImageMenuItem" id="menu-copy">
- <property name="label">gtk-copy</property>
- <property name="visible">True</property>
- <property name="use_underline">True</property>
- <property name="use_stock">True</property>
- <accelerator key="c" signal="activate" modifiers="GDK_CONTROL_MASK"/>
- <signal name="activate" handler="on_menu_copy_activate"/>
- </object>
- </child>
- <child>
- <object class="GtkImageMenuItem" id="menu-paste">
- <property name="label">gtk-paste</property>
- <property name="visible">True</property>
- <property name="use_underline">True</property>
- <property name="use_stock">True</property>
- <accelerator key="v" signal="activate" modifiers="GDK_CONTROL_MASK"/>
- <signal name="activate" handler="on_menu_paste_activate"/>
- </object>
- </child>
- <child>
- <object class="GtkImageMenuItem" id="menu-delete">
- <property name="label">gtk-delete</property>
- <property name="visible">True</property>
- <property name="use_underline">True</property>
- <property name="use_stock">True</property>
- <accelerator key="Delete" signal="activate"/>
- </object>
- </child>
- </object>
- </child>
- </object>
- </child>
- <child>
- <object class="GtkMenuItem" id="menuitem3">
- <property name="visible">True</property>
- <property name="label" translatable="yes">_View</property>
- <property name="use_underline">True</property>
- </object>
- </child>
- <child>
- <object class="GtkMenuItem" id="menuitem5">
- <property name="visible">True</property>
- <property name="label" translatable="yes">_Image</property>
- <property name="use_underline">True</property>
- </object>
- </child>
- <child>
- <object class="GtkMenuItem" id="menuitem6">
- <property name="visible">True</property>
- <property name="label" translatable="yes">_Color</property>
- <property name="use_underline">True</property>
- </object>
- </child>
- <child>
- <object class="GtkMenuItem" id="menuitem_help">
- <property name="visible">True</property>
- <property name="label" translatable="yes">_Help</property>
- <property name="use_underline">True</property>
- <child type="submenu">
- <object class="GtkMenu" id="menu_help">
- <property name="visible">True</property>
- <child>
- <object class="GtkImageMenuItem" id="menu_about">
- <property name="label">gtk-about</property>
- <property name="visible">True</property>
- <property name="use_underline">True</property>
- <property name="use_stock">True</property>
- <signal name="activate" handler="on_menu_about_activate"/>
- </object>
- </child>
- </object>
- </child>
- </object>
+ <placeholder/>
</child>
</object>
<packing>
diff -uNr gnome-paint-0.3/src/cv_drawing.c gnome-paint-0.3p/src/cv_drawing.c
--- gnome-paint-0.3/src/cv_drawing.c 2010-05-30 11:42:03.000000000 -0500
+++ gnome-paint-0.3p/src/cv_drawing.c 2010-06-01 15:52:13.000000000 -0500
@@ -358,7 +358,7 @@
gpointer user_data )
{
gdk_draw_drawable ( widget->window,
- widget->style->fg_gc[gtk_widget_get_state(widget)],
+ widget->style->fg_gc[GTK_WIDGET_STATE(widget)],
cv.pixmap,
event->area.x, event->area.y,
event->area.x, event->area.y,
diff -uNr gnome-paint-0.3/src/cv_resize.c gnome-paint-0.3p/src/cv_resize.c
--- gnome-paint-0.3/src/cv_resize.c 2010-05-30 11:42:03.000000000 -0500
+++ gnome-paint-0.3p/src/cv_resize.c 2010-06-01 15:55:20.000000000 -0500
@@ -195,10 +195,10 @@
gpointer user_data )
{
gdk_draw_line ( widget->window,
- widget->style->fg_gc[gtk_widget_get_state(widget)],
+ widget->style->fg_gc[GTK_WIDGET_STATE(widget)],
0,0,0,widget->allocation.height);
gdk_draw_line ( widget->window,
- widget->style->fg_gc[gtk_widget_get_state(widget)],
+ widget->style->fg_gc[GTK_WIDGET_STATE(widget)],
0,0,widget->allocation.width,0);
return TRUE;
}
diff -uNr gnome-paint-0.3/src/main.c gnome-paint-0.3p/src/main.c
--- gnome-paint-0.3/src/main.c 2010-05-30 11:42:03.000000000 -0500
+++ gnome-paint-0.3p/src/main.c 2010-06-01 15:49:28.000000000 -0500
@@ -28,10 +28,11 @@
#include "file.h"
#include "undo.h"
#include "color-picker.h"
-
+#include "clipboard.h"
#include <glib/gi18n.h>
#include <gtk/gtk.h>
+#include <gdk/gdkkeysyms.h>
#define UI_FILE PACKAGE_DATA_DIR G_DIR_SEPARATOR_S "gnome-paint" G_DIR_SEPARATOR_S "ui" G_DIR_SEPARATOR_S "gnome_paint.ui"
#define ICON_DIR PACKAGE_DATA_DIR G_DIR_SEPARATOR_S "gnome-paint" G_DIR_SEPARATOR_S "icons"
@@ -41,8 +42,13 @@
void gnome_paint_init ( int argc, char *argv[] );
void on_window_destroy ( GtkObject *object, gpointer user_data );
void on_menu_about_activate ( GtkMenuItem *menuitem, gpointer user_data );
-
-
+static GtkWidget *create_the_menu(GtkWidget *window, GtkWidget *vbox);
+static void create_sub_menu(GtkWidget *parent, gchar *mnemonic,
+ GtkAccelGroup *accel_group,
+ const gchar *stock_id,
+ guint accel_key,
+ GdkModifierType accel_mods,
+ GCallback callback, gpointer data);
void
on_menu_new_activate( GtkMenuItem *menuitem, gpointer user_data)
@@ -67,7 +73,7 @@
main (int argc, char *argv[])
{
- GtkWidget *window;
+ GtkWidget *window, *menubar, *menu, *menuitem;
ColorPicker *color_picker;
// g_mem_set_vtable (glib_mem_profiler_table);
@@ -83,6 +89,7 @@
gtk_icon_theme_append_search_path (gtk_icon_theme_get_default (), ICON_DIR);
gtk_window_set_default_icon_name ("gp");
window = create_window ();
+
gnome_paint_init (argc, argv);
gtk_widget_show (window);
@@ -150,15 +157,21 @@
GtkWidget *window;
GtkWidget *widget;
GtkBuilder *builder;
+ GtkWidget *vbox;
builder = gtk_builder_new ();
gtk_builder_add_from_file (builder, UI_FILE, NULL);
window = GTK_WIDGET (gtk_builder_get_object (builder, "window"));
+ vbox = GTK_WIDGET (gtk_builder_get_object (builder, "vbox_for_menu"));
+
g_assert ( window );
file_set_parent_window ( GTK_WINDOW(window) );
gtk_builder_connect_signals (builder, NULL);
g_object_unref (G_OBJECT (builder));
+ /**** Create the menu ****/
+ create_the_menu(window, vbox);
+
/* To show all widget that is set invisible on Glade */
/* and call realize event */
gtk_widget_show_all(window);
@@ -173,7 +186,7 @@
"Juan Balderas",
NULL };
GtkAboutDialog *dlg;
-
+
dlg = GTK_ABOUT_DIALOG ( gtk_about_dialog_new () );
gtk_about_dialog_set_name ( dlg, "gnome-paint" );
gtk_about_dialog_set_version ( dlg, "0.3");
@@ -196,5 +209,126 @@
gtk_widget_destroy (dlg);
}
+static GtkWidget *create_the_menu(GtkWidget *window, GtkWidget *vbox)
+{
+ GtkWidget *menubar, *menu, *menudropdown, *menuitem;
+ GtkAccelGroup *accel_group = NULL;
+
+ accel_group = gtk_accel_group_new();
+ gtk_window_add_accel_group(GTK_WINDOW(window), accel_group);
+
+ menubar = gtk_menu_bar_new();
+
+ /* File Menu */
+ menu = gtk_menu_item_new_with_mnemonic("_File");
+ gtk_menu_shell_append(GTK_MENU_SHELL(menubar), menu);
+
+ menudropdown = gtk_menu_new();
+ gtk_menu_item_set_submenu(GTK_MENU_ITEM(menu), menudropdown);
+
+ create_sub_menu(menudropdown, "_New",
+ accel_group, GTK_STOCK_NEW, GDK_n, GDK_CONTROL_MASK,
+ G_CALLBACK(on_menu_new_activate), NULL);
+ create_sub_menu(menudropdown, "_Open",
+ accel_group, GTK_STOCK_OPEN, GDK_o, GDK_CONTROL_MASK,
+ G_CALLBACK(on_menu_open_activate), NULL);
+ create_sub_menu(menudropdown, "_Save",
+ accel_group, GTK_STOCK_SAVE, GDK_s, GDK_CONTROL_MASK,
+ G_CALLBACK(on_menu_save_activate), NULL);
+ create_sub_menu(menudropdown, "Save _As",
+ accel_group, GTK_STOCK_SAVE_AS, GDK_s, GDK_SHIFT_MASK | GDK_CONTROL_MASK,
+ G_CALLBACK(on_menu_save_as_activate), NULL);
+ /* Seperator */
+ create_sub_menu(menudropdown, NULL,
+ accel_group, "", 0, 0,
+ NULL, NULL);
+ create_sub_menu(menudropdown, "_Quit",
+ accel_group, GTK_STOCK_QUIT, GDK_q, GDK_CONTROL_MASK,
+ G_CALLBACK(on_window_destroy), NULL);
+
+ /* Edit Menu */
+ menu = gtk_menu_item_new_with_mnemonic("_Edit");
+ gtk_menu_shell_append(GTK_MENU_SHELL(menubar), menu);
+
+ menudropdown = gtk_menu_new();
+ gtk_menu_item_set_submenu(GTK_MENU_ITEM(menu), menudropdown);
+
+ create_sub_menu(menudropdown, "_Undo",
+ accel_group, GTK_STOCK_UNDO, GDK_z, GDK_CONTROL_MASK,
+ G_CALLBACK(on_menu_undo_activate), NULL);
+ create_sub_menu(menudropdown, "_Redo",
+ accel_group, GTK_STOCK_REDO, GDK_z, GDK_SHIFT_MASK | GDK_CONTROL_MASK,
+ G_CALLBACK(on_menu_redo_activate), NULL);
+ /* Seperator */
+ create_sub_menu(menudropdown, NULL,
+ accel_group, "", 0, 0,
+ NULL, NULL);
+ create_sub_menu(menudropdown, "Cu_t",
+ accel_group, GTK_STOCK_CUT, GDK_x, GDK_CONTROL_MASK,
+ NULL, NULL);
+ create_sub_menu(menudropdown, "_Copy",
+ accel_group, GTK_STOCK_COPY, GDK_c, GDK_CONTROL_MASK,
+ G_CALLBACK(on_menu_copy_activate), NULL);
+ create_sub_menu(menudropdown, "_Paste",
+ accel_group, GTK_STOCK_PASTE, GDK_v, GDK_CONTROL_MASK,
+ G_CALLBACK(on_menu_paste_activate), NULL);
+
+ create_sub_menu(menudropdown, "_Delete",
+ accel_group, GTK_STOCK_DELETE, GDK_Delete, 0,/* <-Should use 0 here? */
+ NULL, NULL);
+
+ /* View Menu */
+ menu = gtk_menu_item_new_with_mnemonic("_View");
+ gtk_menu_shell_append(GTK_MENU_SHELL(menubar), menu);
+
+ /* Image Menu */
+ menu = gtk_menu_item_new_with_mnemonic("_Image");
+ gtk_menu_shell_append(GTK_MENU_SHELL(menubar), menu);
+
+ /* Color Menu */
+ menu = gtk_menu_item_new_with_mnemonic("_Color");
+ gtk_menu_shell_append(GTK_MENU_SHELL(menubar), menu);
+
+ /* Help Menu */
+ menu = gtk_menu_item_new_with_mnemonic("_Help");
+ gtk_menu_shell_append(GTK_MENU_SHELL(menubar), menu);
+
+ menudropdown = gtk_menu_new();
+ gtk_menu_item_set_submenu(GTK_MENU_ITEM(menu), menudropdown);
+
+ create_sub_menu(menudropdown, "_About",
+ accel_group, GTK_STOCK_ABOUT, 0, 0,
+ G_CALLBACK(on_menu_about_activate), NULL);
+
+ /* Add menu bar to app */
+ gtk_container_add(GTK_CONTAINER(vbox), menubar);
+
+ return menubar;
+}
+
+static void create_sub_menu(GtkWidget *parent, gchar *mnemonic,
+ GtkAccelGroup *accel_group,
+ const gchar *stock_id,
+ guint accel_key,
+ GdkModifierType accel_mods,
+ GCallback callback, gpointer data)
+{
+ GtkWidget *menuitem;
+ if(NULL == mnemonic){
+ GtkWidget *separator_menu_item = gtk_separator_menu_item_new();
+ gtk_menu_shell_append(GTK_MENU_SHELL(parent), separator_menu_item);
+ }
+ else{
+ //printf("Debug %d %s\n", accel_key, mnemonic);
+ menuitem = gtk_image_menu_item_new_from_stock(stock_id, accel_group);
+ gtk_widget_add_accelerator(menuitem, "activate", accel_group,
+ accel_key, accel_mods, GTK_ACCEL_VISIBLE);
+ gtk_menu_shell_append(GTK_MENU_SHELL(parent), menuitem);
+ if(callback){
+ g_signal_connect(G_OBJECT(menuitem), "activate",
+ callback, data);
+ }
+ }
+}
I opened the .ui file in glade3, then deleted the menu bar
and added a vbox in its place. The menubar/menus are created on startup in the vbox. Fixed a couple of other things too.
edit: For new version 0.3
and added a vbox in its place. The menubar/menus are created on startup in the vbox. Fixed a couple of other things too.
edit: For new version 0.3
- Attachments
-
- gnome-paint4puppy-patch.tar.gz
- (3.22 KiB) Downloaded 837 times
- Lobster
- Official Crustacean
- Posts: 15522
- Joined: Wed 04 May 2005, 06:06
- Location: Paradox Realm
- Contact:
http://pinta-project.com/
is working as a 7MB download from here on Puppy Lucid 5.2
http://portablelinuxapps.org/
Don't know if it will work on other Puppy versions
but the portable apps are tested on Ubuntu
and we have a high degree of compatibility with Lucid
Gimp in Quickpet is 23MB
Pinta is smaller and simpler and easier to use
more portable linux apps working in Puppy 5.2
http://www.murga-linux.com/puppy/viewto ... 862#489862
is working as a 7MB download from here on Puppy Lucid 5.2
http://portablelinuxapps.org/
Don't know if it will work on other Puppy versions
but the portable apps are tested on Ubuntu
and we have a high degree of compatibility with Lucid
Gimp in Quickpet is 23MB
Pinta is smaller and simpler and easier to use
more portable linux apps working in Puppy 5.2
http://www.murga-linux.com/puppy/viewto ... 862#489862