From 90bf7269de06b9b1398de7eb387d52cffda72694 Mon Sep 17 00:00:00 2001 From: Manusheel Date: Tue, 24 Jul 2007 15:10:45 +0000 Subject: Bugs fixed, new functions added, existing functions changed --- (limited to 'OficinaActivity.py') diff --git a/OficinaActivity.py b/OficinaActivity.py index add4fca..cbb3ce6 100644 --- a/OficinaActivity.py +++ b/OficinaActivity.py @@ -1,3 +1,58 @@ +# -*- coding: utf-8 -*- +""" +Desenho.py + +Create Oficina Activity + + +Copyright 2007, NATE-LSI-EPUSP + +Oficina is developed in Brazil at Escola Politécnica of +Universidade de São Paulo. NATE is part of LSI (Integrable +Systems Laboratory) and stands for Learning, Work and Entertainment +Research Group. Visit our web page: +www.nate.lsi.usp.br +Suggestions, bugs and doubts, please email oficina@lsi.usp.br + +Oficina 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 version 2 of +the License. + +Oficina 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 Oficina; if not, write to the +Free Software Foundation, Inc., 51 Franklin St, Fifth Floor, +Boston, MA 02110-1301 USA. +The copy of the GNU General Public License is found in the +COPYING file included in the source distribution. + + +Authors: + +Joyce Alessandra Saul (joycealess@gmail.com) +Andre Mossinato (andremossinato@gmail.com) +Nathalia Sautchuk Patrício (nathalia.sautchuk@gmail.com) +Pedro Kayatt (pekayatt@gmail.com) +Rafael Barbolo Lopes (barbolo@gmail.com) +Alexandre A. Gonçalves Martinazzo (alexandremartinazzo@gmail.com) + +Colaborators: +Bruno Gola (brunogola@gmail.com) + +Group Manager: +Irene Karaguilla Ficheman (irene@lsi.usp.br) + +Cientific Coordinator: +Roseli de Deus Lopes (roseli@lsi.usp.br) + +""" + + import os from gettext import gettext as _ @@ -8,7 +63,6 @@ from sugar.activity import activity #from Oficina import Oficina from toolbox import Toolbox from Area import Area -from Cursors import Cursors # DRAW_WIDTH = 1195 # DRAW_HEIGHT = 800 @@ -41,8 +95,8 @@ class OficinaActivity(activity.Activity): color = gtk.gdk.color_parse("white") self._fixed.modify_bg(gtk.STATE_NORMAL, color) - self.bg = gtk.Image() - self.bg.set_from_file('./icons/bg.svg') + self.bg = gtk.Image() + self.bg.set_from_file('./icons/bg.svg') self._fixed.put(self.bg, 200, 100) self.bg.show() @@ -75,8 +129,10 @@ class OficinaActivity(activity.Activity): print 'read file...' print file_path #self._area.d.limpatudo() - #self._area.d.clear() - self._area.d.loadImage(file_path) + #self._area.d.clear() + self._area.d.loadImage(file_path, self._area) + self._area.undo_times = 1 + self._area.redo_times = 0 def write_file(self, file_path): @@ -88,7 +144,7 @@ class OficinaActivity(activity.Activity): ''' print file_path width, height = self._area.window.get_size() - pixbuf = gtk.gdk.Pixbuf(gtk.gdk.COLORSPACE_RGB, False, 8, width, height) - pixbuf.get_from_drawable(self._area.pixmap, gtk.gdk.colormap_get_system(), 0, 0, 0, 0, -1, -1) + pixbuf = gtk.gdk.Pixbuf(gtk.gdk.COLORSPACE_RGB, False, 8, width, height) + pixbuf.get_from_drawable(self._area.pixmap, gtk.gdk.colormap_get_system(), 0, 0, 0, 0, -1, -1) pixbuf.save(file_path, 'png', {}) -- cgit v0.9.1