OSDN Git Service

update on the implementation of TransparentWindow class(5)
authorShyouzou Sugitani <shy@users.sourceforge.jp>
Tue, 26 Feb 2013 14:52:58 +0000 (23:52 +0900)
committerShyouzou Sugitani <shy@users.sourceforge.jp>
Tue, 26 Feb 2013 14:52:58 +0000 (23:52 +0900)
ChangeLog
lib/ninix/balloon.py
lib/ninix/dll/bln.py
lib/ninix/kinoko.py
lib/ninix/nekodorif.py
lib/ninix/pix.py
lib/ninix/surface.py

index fcb635e..faaf2ab 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,7 @@
+Tue February 26 2013   Shyouzou Sugitani <shy@users.sourceforge.jp>
+       * ウインドウ移動後の再描画処理要求をTransparentWindowの方で
+         生成するようにした.
+
 Mon February 25 2013   Shyouzou Sugitani <shy@users.sourceforge.jp>
        * Gtk.DrawingAreaを持たないBaseTransparentWindowクラスを追加し,
          TransparentWindowはこのクラスを継承するようにした.
index 486d00c..15aacc6 100644 (file)
@@ -678,7 +678,6 @@ class BalloonWindow:
     def __move(self):
         x, y = self.get_position()
         self.window.move(x, y)
-        self.darea.queue_draw()
 
     def set_position(self, base_x, base_y):
         if self.balloon_id is None: ## FIXME
@@ -702,8 +701,6 @@ class BalloonWindow:
         return self.position
 
     def destroy(self, finalize=0):
-        self.window.remove(self.darea)
-        self.darea.destroy()
         self.window.destroy()
 
     def is_shown(self):
@@ -715,7 +712,6 @@ class BalloonWindow:
         self.__shown = 1
         # make sure window is in its position (call before showing the window)
         self.__move()
-        self.darea.show()
         self.window.show()
         # make sure window is in its position (call after showing the window)
         self.__move()
@@ -730,7 +726,6 @@ class BalloonWindow:
 
     def raise_(self):
         if self.__shown:
-            ##self.window.get_window().raise_()
             getattr(self.window.get_window(), 'raise')() # XXX
 
     def lower(self):
index 7aedb0c..1e4451a 100644 (file)
@@ -313,7 +313,6 @@ class Balloon:
         new_x = self.base_x + int((self.x + self.action_x + self.vx) * self.scale / 100)
         new_y = self.base_y + int((self.y + self.action_y + self.vy) * self.scale / 100)
         self.window.move(new_x, new_y)
-        self.darea.queue_draw()
 
     def set_skin(self):
         if self.window is None:
@@ -342,7 +341,6 @@ class Balloon:
             return
         self.set_skin()
         self.set_position()
-        self.darea.queue_draw()
 
     @property
     def clickerase(self):
@@ -668,7 +666,6 @@ class Balloon:
                 if self.dragmove_vertical:
                     self.y += y_delta
                 self.set_position()
-                self.darea.queue_draw()
                 self.x_root = event.x_root
                 self.y_root = event.y_root
         if self.move_notify_time is None or \
index 43933d1..957f195 100644 (file)
@@ -284,7 +284,7 @@ class Skin:
         self.darea.connect('motion_notify_event', self.motion_notify)
         self.darea.connect('leave_notify_event', self.leave_notify)
         self.darea.connect('draw', self.redraw)
-        self.darea.set_size_request(self.w, self.h)
+        self.window.update_size(self.w, self.h)
         self.set_position()
         target_window = self.request_parent('GET', 'get_target_window')
         if self.data['ontop']:
@@ -325,7 +325,6 @@ class Skin:
         self.x = base_x - int(self.w * a) + offsetx + xoffset
         self.y = base_y - int(self.h * b) + offsety + yoffset
         self.window.move(self.x, self.y)
-        self.darea.queue_draw()
 
     def set_scale(self, scale):
         self.__scale = scale
index c571f5e..8c97d23 100644 (file)
@@ -370,7 +370,6 @@ class Skin:
             if not self.omni:
                 self.y = top + scrn_h - self.h
         self.window.move(self.x, self.y)
-        self.darea.queue_draw()
 
     def move(self, x_delta, y_delta):
         self.x = self.x + x_delta
@@ -544,7 +543,6 @@ class Katochan:
                  int(self.offset_x * self.__scale / 100)
         self.y = top + int(self.offset_y * self.__scale / 100)
         self.window.move(self.x, self.y)
-        self.darea.queue_draw()
 
     def set_surface(self):
         path = os.path.join(self.data['dir'],
@@ -650,7 +648,6 @@ class Katochan:
             else:
                 pass
         self.window.move(self.x, self.y)
-        self.darea.queue_draw()
 
     def check_collision(self): ## FIXME: check self position
         for side in [0, 1]:
index 3a2ef74..698727f 100644 (file)
@@ -104,6 +104,7 @@ class TransparentWindow(BaseTransparentWindow):
         Gtk.Window.move(self, new_x, new_y)
         self.__position = (new_x, new_y)
         self.__surface_position = (x, y)
+        self.darea.queue_draw()
 
     def get_draw_offset(self):
         window_x, window_y = self.__position
index 521757b..82e74af 100644 (file)
@@ -1099,7 +1099,6 @@ class SurfaceWindow:
     def move_surface(self, xoffset, yoffset):
         x, y = self.get_position()
         self.window.move(x + xoffset, y + yoffset)
-        self.darea.queue_draw()
         if self.side < 2:
             args = (self.side, xoffset, yoffset)
             self.request_parent(
@@ -1171,7 +1170,6 @@ class SurfaceWindow:
         self.position = (x, y)
         new_x, new_y = self.get_position()
         self.window.move(new_x, new_y)
-        self.darea.queue_draw()
         left, top, scrn_w, scrn_h = ninix.pix.get_workarea()
         direction = 0 if x > left + scrn_w // 2 else 1
         self.direction = direction
@@ -1221,8 +1219,6 @@ class SurfaceWindow:
 
     def destroy(self):
         self.seriko.destroy()
-        self.window.remove(self.darea)
-        self.darea.destroy()
         self.window.destroy()
 
     def is_shown(self):
@@ -1234,7 +1230,6 @@ class SurfaceWindow:
         self.__shown = True
         x, y = self.get_position()
         self.window.move(x, y) # XXX: call before showing the window
-        self.darea.show()
         self.window.show()
         self.request_parent('NOTIFY', 'notify_observer', 'show', (self.side))
         self.request_parent('NOTIFY', 'notify_observer', 'raise', (self.side))
@@ -1247,7 +1242,6 @@ class SurfaceWindow:
                 'NOTIFY', 'notify_observer', 'hide', (self.side))
 
     def raise_(self):
-        #self.window.get_window().raise_()
         getattr(self.window.get_window(), 'raise')() # XXX
         self.request_parent('NOTIFY', 'notify_observer', 'raise', (self.side))
 
@@ -1343,7 +1337,6 @@ class SurfaceWindow:
                     y_delta = int(event.y_root - self.y_root)
                     x, y = self.position # XXX: without window_offset
                     self.set_position(x + x_delta, y + y_delta)
-                    self.darea.queue_draw()
                     self.x_root = event.x_root
                     self.y_root = event.y_root
             elif state & Gdk.ModifierType.BUTTON2_MASK or \