projects
/
debian
/
gnuradio
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
Adding typedef for uint64_t and int64_t so we can use them through SWIG.
[debian/gnuradio]
/
grc
/
gui
/
Port.py
diff --git
a/grc/gui/Port.py
b/grc/gui/Port.py
index 6fc2c4b155aeec04f26cb69131aa3065d0aab628..2896d04c18e0efae889198a503ed1bf99aaeaf52 100644
(file)
--- a/
grc/gui/Port.py
+++ b/
grc/gui/Port.py
@@
-34,7
+34,7
@@
PORT_MARKUP_TMPL="""\
class Port(Element):
"""The graphical port."""
class Port(Element):
"""The graphical port."""
- def __init__(self
, *args, **kwargs
):
+ def __init__(self):
"""
Port contructor.
Create list of connector coordinates.
"""
Port contructor.
Create list of connector coordinates.
@@
-42,9
+42,9
@@
class Port(Element):
Element.__init__(self)
self.connector_coordinates = dict()
Element.__init__(self)
self.connector_coordinates = dict()
- def
update
(self):
+ def
create_shapes
(self):
"""Create new areas and labels for the port."""
"""Create new areas and labels for the port."""
-
self.clear(
)
+
Element.create_shapes(self
)
#get current rotation
rotation = self.get_rotation()
#get all sibling ports
#get current rotation
rotation = self.get_rotation()
#get all sibling ports
@@
-82,8
+82,9
@@
class Port(Element):
#the connector length
self._connector_length = CONNECTOR_EXTENSION_MINIMAL + CONNECTOR_EXTENSION_INCREMENT*index
#the connector length
self._connector_length = CONNECTOR_EXTENSION_MINIMAL + CONNECTOR_EXTENSION_INCREMENT*index
- def
_
create_labels(self):
+ def create_labels(self):
"""Create the labels for the socket."""
"""Create the labels for the socket."""
+ Element.create_labels(self)
self._bg_color = Colors.get_color(self.get_color())
#create the layout
layout = gtk.DrawingArea().create_pango_layout('')
self._bg_color = Colors.get_color(self.get_color())
#create the layout
layout = gtk.DrawingArea().create_pango_layout('')
@@
-96,12
+97,11
@@
class Port(Element):
gc.set_foreground(self._bg_color)
pixmap.draw_rectangle(gc, True, 0, 0, self.w, self.h)
pixmap.draw_layout(gc, 0, 0, layout)
gc.set_foreground(self._bg_color)
pixmap.draw_rectangle(gc, True, 0, 0, self.w, self.h)
pixmap.draw_layout(gc, 0, 0, layout)
- #create
the image
s
- self.horizontal_label =
image = pixmap.get_image(0, 0, self.w, self.h)
+ #create
vertical and horizontal pixmap
s
+ self.horizontal_label =
pixmap
if self.is_vertical():
if self.is_vertical():
- self.vertical_label = vimage = gtk.gdk.Image(gtk.gdk.IMAGE_NORMAL, pixmap.get_visual(), self.h, self.w)
- for i in range(self.w):
- for j in range(self.h): vimage.put_pixel(j, self.w-i-1, image.get_pixel(i, j))
+ self.vertical_label = self.get_parent().get_parent().new_pixmap(self.h, self.w)
+ Utils.rotate_pixmap(gc, self.horizontal_label, self.vertical_label)
def draw(self, gc, window):
"""
def draw(self, gc, window):
"""
@@
-114,11
+114,11
@@
class Port(Element):
border_color=self.is_highlighted() and Colors.HIGHLIGHT_COLOR or Colors.BORDER_COLOR,
)
X,Y = self.get_coordinate()
border_color=self.is_highlighted() and Colors.HIGHLIGHT_COLOR or Colors.BORDER_COLOR,
)
X,Y = self.get_coordinate()
- (x,y),(w,h) = self.
areas_dict[self.get_rotation()]
[0] #use the first area's sizes to place the labels
+ (x,y),(w,h) = self.
_areas_list
[0] #use the first area's sizes to place the labels
if self.is_horizontal():
if self.is_horizontal():
- window.draw_
imag
e(gc, self.horizontal_label, 0, 0, x+X+(self.W-self.w)/2, y+Y+(self.H-self.h)/2, -1, -1)
+ window.draw_
drawabl
e(gc, self.horizontal_label, 0, 0, x+X+(self.W-self.w)/2, y+Y+(self.H-self.h)/2, -1, -1)
elif self.is_vertical():
elif self.is_vertical():
- window.draw_
imag
e(gc, self.vertical_label, 0, 0, x+X+(self.H-self.h)/2, y+Y+(self.W-self.w)/2, -1, -1)
+ window.draw_
drawabl
e(gc, self.vertical_label, 0, 0, x+X+(self.H-self.h)/2, y+Y+(self.W-self.w)/2, -1, -1)
def get_connector_coordinate(self):
"""
def get_connector_coordinate(self):
"""