Ejemplo n.º 1
0
 def ep_init(self):
     _cmd.runwxpymol()
     pymol._swap_buffers = lambda s=self: s.ep_swap_dummy(
     )  # dummy swap function
     self.ep_mod = 0
     self.ep_button = None
     self.ep_swap = None
Ejemplo n.º 2
0
 def ep_special(self, x, y, code, shift, control, meta):
     self.ep_mod = mod_dict.get((shift, control, meta))
     if self.ep_mod == None:
         self.ep_mod = get_mod_value(shift, control, meta)
     code = special_dict.get(code)
     if code != None:
         _cmd.runwxpymol()
         _cmd.p_glut_event(P_GLUT_SPECIAL_EVENT, x, y, code, 0, self.ep_mod)
Ejemplo n.º 3
0
 def ep_wheel(self, x, y, direction, shift, control, meta):
     _cmd.runwxpymol()
     if direction > 0:
         _cmd.p_glut_event(P_GLUT_MOUSE_EVENT, x, y,
                           P_GLUT_BUTTON_SCROLL_FORWARD, 0, self.ep_mod)
     else:
         _cmd.p_glut_event(P_GLUT_MOUSE_EVENT, x, y,
                           P_GLUT_BUTTON_SCROLL_BACKWARD, 0, self.ep_mod)
Ejemplo n.º 4
0
 def ep_special(self, x, y, code, shift, control, meta):
     self.ep_mod = mod_dict.get((shift, control, meta))
     if self.ep_mod == None:
         self.ep_mod = get_mod_value(shift, control, meta)
     code = special_dict.get(code)
     if code != None:
         _cmd.runwxpymol()
         _cmd.p_glut_event(P_GLUT_SPECIAL_EVENT, x, y, code, 0, self.ep_mod)
Ejemplo n.º 5
0
 def ep_motion(self, x, y, left, middle, right, shift, control, meta):
     self.ep_mod = mod_dict.get((shift, control, meta))
     if self.ep_mod == None:
         self.ep_mod = get_mod_value(shift, control, meta)
     if left:
         self.ep_button = P_GLUT_LEFT_BUTTON
     elif middle:
         self.ep_button = P_GLUT_MIDDLE_BUTTON
     elif right:
         self.ep_button = P_GLUT_RIGHT_BUTTON
     _cmd.runwxpymol()
     _cmd.p_glut_event(P_GLUT_MOTION_EVENT, x, y, self.ep_button, 0, self.ep_mod)
Ejemplo n.º 6
0
 def ep_motion(self, x, y, left, middle, right, shift, control, meta):
     self.ep_mod = mod_dict.get((shift, control, meta))
     if self.ep_mod == None:
         self.ep_mod = get_mod_value(shift, control, meta)
     if left:
         self.ep_button = P_GLUT_LEFT_BUTTON
     elif middle:
         self.ep_button = P_GLUT_MIDDLE_BUTTON
     elif right:
         self.ep_button = P_GLUT_RIGHT_BUTTON
     _cmd.runwxpymol()
     _cmd.p_glut_event(P_GLUT_MOTION_EVENT, x, y, self.ep_button, 0,
                       self.ep_mod)
Ejemplo n.º 7
0
 def ep_get_redisplay(self):
     _cmd.runwxpymol()
     result = _cmd.p_glut_get_redisplay()
     return result
Ejemplo n.º 8
0
 def ep_passive_motion(self, x, y, shift, control, meta):
     self.ep_mod = mod_dict.get((shift, control, meta))
     if self.ep_mod == None:
         self.ep_mod = get_mod_value(shift, control, meta)
     _cmd.runwxpymol()
     _cmd.p_glut_event(P_GLUT_PASSIVE_MOTION_EVENT, x, y, 0, 0, self.ep_mod)
Ejemplo n.º 9
0
 def ep_mouse_up(self, x, y):
     if self.ep_button != None:
         _cmd.runwxpymol()
         _cmd.p_glut_event(P_GLUT_MOUSE_EVENT, x, y, self.ep_button,
                           P_GLUT_UP, self.ep_mod)
     self.ep_button = None
Ejemplo n.º 10
0
 def ep_char(self, x, y, code, shift, control, meta):
     self.ep_mod = mod_dict.get((shift, control, meta))
     if self.ep_mod == None:
         self.ep_mod = get_mod_value(shift, control, meta)
     _cmd.runwxpymol()
     _cmd.p_glut_event(P_GLUT_CHAR_EVENT, x, y, code, 0, self.ep_mod)
Ejemplo n.º 11
0
 def ep_char(self, x, y, code, shift, control, meta):
     self.ep_mod = mod_dict.get((shift, control, meta))
     if self.ep_mod == None:
         self.ep_mod = get_mod_value(shift, control, meta)
     _cmd.runwxpymol()
     _cmd.p_glut_event(P_GLUT_CHAR_EVENT, x, y, code, 0, self.ep_mod)
Ejemplo n.º 12
0
 def ep_get_redisplay(self):
     _cmd.runwxpymol()
     result = _cmd.p_glut_get_redisplay()
     return result
Ejemplo n.º 13
0
 def ep_draw(self):
     _cmd.runwxpymol()
     _cmd.p_glut_event(P_GLUT_DISPLAY_EVENT, 0, 0, 0, 0, 0)  # draw event
Ejemplo n.º 14
0
 def ep_idle(self):
     _cmd.runwxpymol()
     _cmd.p_glut_event(0, 0, 0, 0, 0, 0)
Ejemplo n.º 15
0
 def ep_draw(self):
     _cmd.runwxpymol()
     _cmd.p_glut_event(P_GLUT_DISPLAY_EVENT, 0, 0, 0, 0, 0)  # draw event
Ejemplo n.º 16
0
 def ep_wheel(self, x, y, direction, shift, control, meta):
     _cmd.runwxpymol()
     if direction > 0:
         _cmd.p_glut_event(P_GLUT_MOUSE_EVENT, x, y, P_GLUT_BUTTON_SCROLL_FORWARD, 0, self.ep_mod)
     else:
         _cmd.p_glut_event(P_GLUT_MOUSE_EVENT, x, y, P_GLUT_BUTTON_SCROLL_BACKWARD, 0, self.ep_mod)
Ejemplo n.º 17
0
 def ep_passive_motion(self, x, y, shift, control, meta):
     self.ep_mod = mod_dict.get((shift, control, meta))
     if self.ep_mod == None:
         self.ep_mod = get_mod_value(shift, control, meta)
     _cmd.runwxpymol()
     _cmd.p_glut_event(P_GLUT_PASSIVE_MOTION_EVENT, x, y, 0, 0, self.ep_mod)
Ejemplo n.º 18
0
 def ep_mouse_up(self, x, y):
     if self.ep_button != None:
         _cmd.runwxpymol()
         _cmd.p_glut_event(P_GLUT_MOUSE_EVENT, x, y, self.ep_button, P_GLUT_UP, self.ep_mod)
     self.ep_button = None
Ejemplo n.º 19
0
 def ep_idle(self):
     _cmd.runwxpymol()
     _cmd.p_glut_event(0, 0, 0, 0, 0, 0)
Ejemplo n.º 20
0
 def ep_init(self):
     _cmd.runwxpymol()
     pymol._swap_buffers = lambda s=self: s.ep_swap_dummy()  # dummy swap function
     self.ep_mod = 0
     self.ep_button = None
     self.ep_swap = None
Ejemplo n.º 21
0
 def ep_reshape(self, width, height):
     _cmd.runwxpymol()
     _cmd.p_glut_event(P_GLUT_RESHAPE_EVENT, width, height, 0, 0, 0)
Ejemplo n.º 22
0
 def ep_reshape(self, width, height):
     _cmd.runwxpymol()
     _cmd.p_glut_event(P_GLUT_RESHAPE_EVENT, width, height, 0, 0, 0)