Move all the canvas code that doesn't depend on goocanvas anymore in graphics.

This commit is contained in:
Marco Pesenti Gritti 2006-10-04 00:55:20 +02:00
parent 717bdd66f4
commit 1f8ff1db1f
24 changed files with 41 additions and 41 deletions

View File

@ -1,14 +1,14 @@
import os import os
from ConfigParser import ConfigParser from ConfigParser import ConfigParser
from sugar.canvas import IconColor from sugar.graphics import iconcolor
from sugar import env from sugar import env
class _Profile: class _Profile:
def __init__(self,): def __init__(self,):
self._path = env.get_profile_path() self._path = env.get_profile_path()
self._nick_name = None self._nick_name = None
self._color = IconColor.IconColor() self._color = iconcolor.IconColor()
self._ensure_dirs() self._ensure_dirs()
@ -19,8 +19,8 @@ class _Profile:
self._nick_name = cp.get('Buddy', 'NickName') self._nick_name = cp.get('Buddy', 'NickName')
if cp.has_option('Buddy', 'Color'): if cp.has_option('Buddy', 'Color'):
color = cp.get('Buddy', 'Color') color = cp.get('Buddy', 'Color')
if IconColor.is_valid(color): if iconcolor.is_valid(color):
self._color = IconColor.IconColor(color) self._color = iconcolor.IconColor(color)
def _ensure_dirs(self): def _ensure_dirs(self):
try: try:

View File

@ -1,5 +1,5 @@
from sugar.presence import PresenceService from sugar.presence import PresenceService
from sugar.canvas.IconColor import IconColor from sugar.graphics.iconcolor import IconColor
import gobject import gobject
_NOT_PRESENT_COLOR = "#888888,#BBBBBB" _NOT_PRESENT_COLOR = "#888888,#BBBBBB"

View File

@ -2,7 +2,7 @@ import gobject
import conf import conf
from sugar.presence import PresenceService from sugar.presence import PresenceService
from sugar.canvas.IconColor import IconColor from sugar.graphics.iconcolor import IconColor
class Invite: class Invite:
def __init__(self, issuer, bundle_id, activity_id): def __init__(self, issuer, bundle_id, activity_id):

View File

@ -1,7 +1,7 @@
import gobject import gobject
import conf import conf
from sugar.canvas.IconItem import IconColor from sugar.graphics.iconcolor import IconColor
from sugar.presence import PresenceService from sugar.presence import PresenceService
from model.BuddyModel import BuddyModel from model.BuddyModel import BuddyModel

View File

@ -4,7 +4,7 @@ import dbus
import conf import conf
from sugar.activity import Activity from sugar.activity import Activity
from sugar.presence import PresenceService from sugar.presence import PresenceService
from sugar.canvas.IconColor import IconColor from sugar.graphics.iconcolor import IconColor
from sugar.p2p import Stream from sugar.p2p import Stream
from sugar.p2p import network from sugar.p2p import network
from sugar.chat import ActivityChat from sugar.chat import ActivityChat

View File

@ -6,8 +6,8 @@ import wnck
from view.frame.ActivitiesBox import ActivitiesBox from view.frame.ActivitiesBox import ActivitiesBox
from view.frame.ZoomBox import ZoomBox from view.frame.ZoomBox import ZoomBox
from view.frame.PanelWindow import PanelWindow from view.frame.PanelWindow import PanelWindow
from sugar.canvas.Timeline import Timeline from sugar.graphics.timeline import Timeline
from sugar.canvas.MenuShell import MenuShell from sugar.graphics.menushell import MenuShell
from sugar.graphics.grid import Grid from sugar.graphics.grid import Grid
class EventFrame(gobject.GObject): class EventFrame(gobject.GObject):

View File

@ -1,7 +1,7 @@
import hippo import hippo
from sugar.graphics.CanvasIcon import CanvasIcon from sugar.graphics.CanvasIcon import CanvasIcon
from sugar.canvas.IconColor import IconColor from sugar.graphics.iconcolor import IconColor
from sugar.presence import PresenceService from sugar.presence import PresenceService
from view.BuddyIcon import BuddyIcon from view.BuddyIcon import BuddyIcon
from model.BuddyModel import BuddyModel from model.BuddyModel import BuddyModel

View File

@ -4,7 +4,7 @@ import hippo
import cairo import cairo
from sugar.canvas.CanvasView import CanvasView from sugar.canvas.CanvasView import CanvasView
from sugar.canvas.MenuShell import MenuShell from sugar.graphics.menushell import MenuShell
from view.home.MeshBox import MeshBox from view.home.MeshBox import MeshBox
from view.home.HomeGroup import HomeGroup from view.home.HomeGroup import HomeGroup
from view.home.FriendsBox import FriendsBox from view.home.FriendsBox import FriendsBox

View File

@ -5,7 +5,7 @@ import hippo
from sugar.graphics.spreadlayout import SpreadLayout from sugar.graphics.spreadlayout import SpreadLayout
from sugar.graphics.canvasicon import CanvasIcon from sugar.graphics.canvasicon import CanvasIcon
from view.BuddyIcon import BuddyIcon from view.BuddyIcon import BuddyIcon
from sugar.canvas.SnowflakeLayout import SnowflakeLayout from sugar.graphics.snowflakelayout import SnowflakeLayout
import conf import conf
class ActivityView(hippo.CanvasBox): class ActivityView(hippo.CanvasBox):

View File

@ -1,6 +1,6 @@
import conf import conf
from sugar.canvas.IconItem import IconItem from sugar.canvas.IconItem import IconItem
from sugar.canvas.IconColor import IconColor from sugar.graphics.iconcolor import IconColor
class MyIcon(IconItem): class MyIcon(IconItem):
def __init__(self, size): def __init__(self, size):

View File

@ -7,7 +7,7 @@ import rsvg
import cairo import cairo
from sugar.util import GObjectSingletonMeta from sugar.util import GObjectSingletonMeta
from sugar.canvas.IconColor import IconColor from sugar.graphics.iconcolor import IconColor
class _IconCache: class _IconCache:
def __init__(self): def __init__(self):

View File

@ -1,7 +1,7 @@
import gtk import gtk
from sugar.graphics import style from sugar.graphics import style
from sugar.canvas.IconColor import IconColor from sugar.graphics.iconcolor import IconColor
if gtk.gdk.screen_width() == 1200: if gtk.gdk.screen_width() == 1200:
_medium_icon_size = 75 _medium_icon_size = 75

View File

@ -6,7 +6,7 @@ import hippo
import rsvg import rsvg
import cairo import cairo
from sugar.canvas.IconColor import IconColor from sugar.graphics.iconcolor import IconColor
class _IconCache: class _IconCache:
def __init__(self): def __init__(self):

View File

@ -1,6 +1,6 @@
import random import random
from sugar.canvas import Colors from sugar.graphics.colors import colors
def _parse_string(color_string): def _parse_string(color_string):
if color_string == 'white': if color_string == 'white':
@ -18,8 +18,8 @@ def is_valid(color_string):
class IconColor: class IconColor:
def __init__(self, color_string=None): def __init__(self, color_string=None):
if color_string == None or not is_valid(color_string): if color_string == None or not is_valid(color_string):
n = int(random.random() * (len(Colors.colors) - 1)) n = int(random.random() * (len(colors) - 1))
[self._stroke, self._fill] = Colors.colors[n] [self._stroke, self._fill] = colors[n]
else: else:
[self._stroke, self._fill] = _parse_string(color_string) [self._stroke, self._fill] = _parse_string(color_string)

View File

@ -2,7 +2,7 @@
from sugar.simulator import Bot from sugar.simulator import Bot
from sugar.simulator import ShareActivityAction from sugar.simulator import ShareActivityAction
from sugar.canvas.IconColor import IconColor from sugar.graphics.iconcolor import IconColor
import os, random, gobject import os, random, gobject
class KiuBot(Bot): class KiuBot(Bot):

View File

@ -10,11 +10,11 @@ session.start()
import gtk import gtk
import goocanvas import goocanvas
from sugar.canvas.IconColor import IconColor from sugar.graphics.iconcolor import IconColor
from sugar.canvas.IconItem import IconItem from sugar.graphics.IconItem import IconItem
from sugar.canvas.CanvasView import CanvasView from sugar.graphics.CanvasView import CanvasView
from sugar.canvas.CanvasBox import CanvasBox from sugar.graphics.CanvasBox import CanvasBox
from sugar.canvas.Grid import Grid from sugar.graphics.Grid import Grid
def _new_icon_clicked_cb(icon): def _new_icon_clicked_cb(icon):
box.remove_child(icon) box.remove_child(icon)

View File

@ -15,10 +15,10 @@ import gtk
import goocanvas import goocanvas
from view.home.IconLayout import IconLayout from view.home.IconLayout import IconLayout
from sugar.canvas import IconColor from sugar.graphics import IconColor
from sugar.canvas.IconItem import IconItem from sugar.graphics.IconItem import IconItem
from sugar.canvas.CanvasView import CanvasView from sugar.graphics.CanvasView import CanvasView
from sugar.canvas.Grid import Grid from sugar.graphics.Grid import Grid
def _create_icon(): def _create_icon():
color = IconColor.IconColor() color = IconColor.IconColor()

View File

@ -13,9 +13,9 @@ import random
import gtk import gtk
import hippo import hippo
from sugar.canvas import IconColor from sugar.graphics import IconColor
from sugar.canvas.CanvasIcon import CanvasIcon from sugar.graphics.CanvasIcon import CanvasIcon
from sugar.canvas.CanvasView import CanvasView from sugar.graphics.CanvasView import CanvasView
window = gtk.Window() window = gtk.Window()
window.connect("destroy", lambda w: gtk.main_quit()) window.connect("destroy", lambda w: gtk.main_quit())

View File

@ -14,11 +14,11 @@ import random
import gtk import gtk
import goocanvas import goocanvas
from sugar.canvas.SnowflakeLayout import SnowflakeLayout from sugar.graphics.snowflakelayout import SnowflakeLayout
from sugar.canvas import IconColor from sugar.graphics import IconColor
from sugar.canvas.IconItem import IconItem from sugar.graphics.IconItem import IconItem
from sugar.canvas.CanvasView import CanvasView from sugar.graphics.CanvasView import CanvasView
from sugar.canvas.Grid import Grid from sugar.graphics.Grid import Grid
def _create_snowflake(group, children): def _create_snowflake(group, children):
color = IconColor.IconColor() color = IconColor.IconColor()

View File

@ -10,9 +10,9 @@ session.start()
import gtk import gtk
import goocanvas import goocanvas
from sugar.canvas import IconColor from sugar.graphics import IconColor
from sugar.canvas.IconItem import IconItem from sugar.graphics.IconItem import IconItem
from sugar.canvas.CanvasView import CanvasView from sugar.graphics.CanvasView import CanvasView
# Main window # Main window
window = gtk.Window() window = gtk.Window()