Package dtk :: Package ui :: Module talk_view

Source Code for Module dtk.ui.talk_view

 1  #! /usr/bin/env python 
 2  # -*- coding: utf-8 -*- 
 3   
 4  # Copyright (C) 2011 ~ 2012 Deepin, Inc. 
 5  #               2011 ~ 2012 Wang Yong 
 6  #  
 7  # Author:     Wang Yong <lazycat.manatee@gmail.com> 
 8  # Maintainer: Wang Yong <lazycat.manatee@gmail.com> 
 9  #  
10  # This program is free software: you can redistribute it and/or modify 
11  # it under the terms of the GNU General Public License as published by 
12  # the Free Software Foundation, either version 3 of the License, or 
13  # any later version. 
14  #  
15  # This program is distributed in the hope that it will be useful, 
16  # but WITHOUT ANY WARRANTY; without even the implied warranty of 
17  # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the 
18  # GNU General Public License for more details. 
19  #  
20  # You should have received a copy of the GNU General Public License 
21  # along with this program.  If not, see <http://www.gnu.org/licenses/>. 
22   
23  import gtk 
24  import gobject 
25  from scrolled_window import ScrolledWindow 
26   
27 -class TalkView(ScrolledWindow):
28 ''' 29 View widget for Deepin Talk. 30 ''' 31
32 - def __init__(self, 33 right_space=2, 34 top_bottom_space=3):
35 ''' 36 Initialize TalkView class. 37 ''' 38 # Init. 39 ScrolledWindow.__init__(self, right_space, top_bottom_space) 40 self.draw_area = gtk.DrawingArea() 41 self.draw_align = gtk.Alignment() 42 self.draw_align.set(0.5, 0.5, 1, 1) 43 44 self.draw_align.add(self.draw_area) 45 self.add_child(self.draw_align)
46 47 gobject.type_register(TalkView) 48
49 -class TalkItem(gobject.GObject):
50 ''' 51 Talk item for L{ I{TalkView} <TalkView>}. 52 ''' 53
54 - def __init__(self):
55 ''' 56 Initialize TalkItem class. 57 ''' 58 gobject.GObject.__init__(self)
59
60 - def get_size(self):
61 ''' 62 Get size of talk item. 63 ''' 64 print "TalkItem.get_size: Your should implement this interface in your own class!"
65
66 - def render(self, cr, rect):
67 ''' 68 Render talk item. 69 ''' 70 print "TalkItem.render: Your should implement this interface in your own class!"
71 72 73 gobject.type_register(TalkItem) 74