Skip to content

Commit

Permalink
Merge branch 'master' of github.com:enthought/enable into ref-kiwi-so…
Browse files Browse the repository at this point in the history
…lver
  • Loading branch information
brett-patterson committed Jun 27, 2014
2 parents c0cc554 + 8cf9217 commit 5720af2
Show file tree
Hide file tree
Showing 36 changed files with 1,280 additions and 210 deletions.
21 changes: 21 additions & 0 deletions .coveragerc
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
[run]
branch = True
source = enable, kiva
omit = */tests/*

[report]
# Regexes for lines to exclude from consideration
exclude_lines =
# Have to re-enable the standard pragma
pragma: no cover

# Don't complain about missing debug-only code:
def __repr__

# Don't complain if tests don't hit defensive assertion code:
raise AssertionError
raise NotImplementedError

if __name__ == .__main__.:

ignore_errors = True
32 changes: 32 additions & 0 deletions .travis.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,32 @@
language: python
python:
- '2.7_with_system_site_packages'
- 2.6
before_install:
# For Python 2.7, install PyQt4
- if [[ $TRAVIS_PYTHON_VERSION == '2.7_with_system_site_packages' ]]; then source .travis_before_install; fi
# PyQt can't be installed on 2.6; run the tests without Qt
- if [[ $TRAVIS_PYTHON_VERSION == '2.6' ]]; then source .travis_before_install_noqt; fi
install:
# nose is already installed
- pip install cython
- sudo apt-get install python-numpy
- sudo apt-get install swig
- pip install PIL --allow-external PIL --allow-unverified PIL
- pip install pyparsing
# Test against the current master of traits and traitsui
- pip install git+http://github.com/enthought/traits.git#egg=traits
- pip install git+http://github.com/enthought/traitsui.git#egg=traitsui
- pip install coverage
- pip install coveralls
- python setup.py develop
script:
- coverage run -m nose.core -v enable/tests
- coverage run -a -m nose.core -v enable/savage/svg/tests
- coverage run -a -m nose.core -v kiva/tests
- coverage run -a -m nose.core -v kiva/agg/tests
notifications:
email:
- travis-ci@enthought.com
after_success:
coveralls
12 changes: 12 additions & 0 deletions .travis_before_install
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
# Set up PyQt4 for potential UI tests.

export DISPLAY=:99.0
sh -e /etc/init.d/xvfb start

sudo apt-get install python-qt4 python-qt4-dev python-sip python-qt4-gl libqt4-scripttools

python -c 'import PyQt4'
python -c 'import PyQt4.QtCore'
python -c 'import PyQt4.QtGui'

export ETS_TOOLKIT=qt4
6 changes: 6 additions & 0 deletions .travis_before_install_noqt
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
# Set up X11 for potential UI tests.

export DISPLAY=:99.0
sh -e /etc/init.d/xvfb start

export ETS_TOOLKIT=null.image
58 changes: 30 additions & 28 deletions docs/CHANGES.txt → CHANGES.txt
Original file line number Diff line number Diff line change
@@ -1,3 +1,29 @@
Enable CHANGELOG
================

Enable 4.4.0 (May 1, 2014)
==========================

Enhancements
------------

* Added a test assistant to aid in writing unit tests for Enable/Chaco code (3cb6d22 & a5b8cb9)
* Added Drag & Drop support for Qt (4196bc8)
* Added a context menu tool (0c27475)

Fixes
-----

* PR #92: Fixed the example support code to allow Chaco demos to run on Qt
* PR #94: Fixed the examples so that they would run on Qt
* PR #102: Fixed a transparency drawing bug in the Qt image backend
* Fixed various bugs which caused test failures in Enable and Chaco (PRs #103,
#105, #110, #113)
* PR #107: Fixed a memory leak in the QPainter kiva backend
* PR #116: Fixed the incomplete implementation of the resize tool
* PR #118: Fixed a gradient rendering bug that sometimes caused segfaults


Enable 3.4.1 (March 3, 2011)
============================

Expand All @@ -17,8 +43,7 @@ Enable 3.4.0 (Jan 26, 2011)
Enhancements
------------

* Major refactor of kiva backends to make setting the desired backend more
resilient and flexible.
* Major refactor of kiva backends to make setting the desired backend more resilient and flexible.
* Added support for PySide
* Qt backend no longer uses Agg internally, instead it uses QPainter.
* Improved gradient support in Quartz backend
Expand Down Expand Up @@ -53,15 +78,9 @@ Enhancements
# Do stuff with gc...

* Stacked layout containers were added.

* qt4_backend: Added Tony Yu's patch to better handling keypresses in Qt4
when modifier keys are pressed (r25644).

* vtk_backend: Added John Wiggins patch which adds key bindings to
EnableVTKWindow (r25796).

* The Kiva backend for the Mac, implemented in ABCGI.pyx, is now processed
with cython instead of pyrex.
* qt4_backend: Added Tony Yu's patch to better handling keypresses in Qt4 when modifier keys are pressed (r25644).
* vtk_backend: Added John Wiggins patch which adds key bindings to EnableVTKWindow (r25796).
* The Kiva backend for the Mac, implemented in ABCGI.pyx, is now processed with cython instead of pyrex.


Fixes
Expand Down Expand Up @@ -136,37 +155,24 @@ enable Enhancements
-----------------------------

* Added Slider and Compass widgets

* Added an OverlayContainer (almost identical to the one in Chaco)

* Added ImageGraphicsContextEnable class so that one can always import a Kiva Image backend-based GraphicsContextEnable

* renaming marker_trait to MarkerTrait (the old name is still permitted forbackwards compatibility, but should be avoided)

* Moved the scatter_markers module from Chaco to Enable, so that Enable components can use MarkerTrait

* Added an experimental VTK backend for Enable, along with an example

* Changed SVGButtonEditor toggle to draw a SVG under the button SVG instead of drawing a plain box

* Added labels for SVGButton

* Improving backbuffering performance on the Mac by creating the layer context from the window context instead of from a bitmap.

* Adding a "fixed_preferred_size" trait to Components, so that relative size preferences can be expressed amongst different components in a container


enable Fixes
----------------------

* Improved the backend selection to match the Traits UI backend unless ETSConfig.enable_toolkit is explicitly set

* Fixed demo_main() in example_support.py so that it doesn't crash IPython

* Fixed RGBAColorTrait so it can be used with the null toolkit

* Changed the "sys_window" color to be the same as the Traits UI "WindowColor" constant

* Fixed backend_cairo's get_text_extent() implementation to match other backends


Expand All @@ -175,14 +181,10 @@ kiva Enhancements

* Added basic gradients to Kiva


kiva Fixes
--------------------

* Fixed Python 2.6 datatype errors

* Fixed memory leak as reported in ticket 1815

* The macport test is only run on Darwin systems

* Removed deprecated calls to old numpy APIs
1 change: 1 addition & 0 deletions MANIFEST.in
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
include kiva/agg/agg.i
7 changes: 7 additions & 0 deletions README.rst
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,13 @@ enable: low-level drawing and interaction

http://github.enthought.com/enable

.. image:: https://api.travis-ci.org/enthought/enable.png?branch=master
:target: https://travis-ci.org/enthought/enable
:alt: Build status

.. image:: https://coveralls.io/repos/enthought/enable/badge.png
:target: https://coveralls.io/r/enthought/enable
:alt: Coverage status

The Enable *project* provides two related multi-platform *packages* for drawing
GUI objects.
Expand Down
2 changes: 1 addition & 1 deletion docs/source/conf.py
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@

# General substitutions.
project = 'enable'
copyright = '2008-2011, Enthought'
copyright = '2008-2014, Enthought'

# The default replacements for |version| and |release|, also used in various
# other places throughout the built documents.
Expand Down
4 changes: 2 additions & 2 deletions enable/__init__.py
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
# Copyright (c) 2007-2013 by Enthought, Inc.
# Copyright (c) 2007-2014 by Enthought, Inc.
# All rights reserved.
""" A multi-platform object drawing library.
Part of the Enable project of the Enthought Tool Suite.
"""
__version__ = '4.3.0'
__version__ = '4.5.0-dev'

__requires__ = [
'traitsui',
Expand Down
47 changes: 47 additions & 0 deletions enable/abstract_window.py
Original file line number Diff line number Diff line change
Expand Up @@ -366,6 +366,53 @@ def _handle_mouse_event(self, event_name, event, set_focus=False):

return mouse_event.handled

#---------------------------------------------------------------------------
# Generic drag event handler:
#---------------------------------------------------------------------------
def _handle_drag_event(self, event_name, event, set_focus=False):
""" **event** should be a toolkit-specific opaque object that will
be passed in to the backend's _create_drag_event() method. It can
be None if the the toolkit lacks a native "drag event" object.
Returns True if the event has been handled within the Enable object
hierarchy, or False otherwise.
"""
if self._size is None:
# PZW: Hack!
# We need to handle the cases when the window hasn't been painted yet, but
# it's gotten a mouse event. In such a case, we just ignore the mouse event.
# If the window has been painted, then _size will have some sensible value.
return False

drag_event = self._create_drag_event(event)
# if no mouse event generated for some reason, return
if drag_event is None:
return False

if self.component is not None:
# Test to see if we need to generate a drag_leave event
if self._prev_event_handler:
if not self._prev_event_handler.is_in(drag_event.x, drag_event.y):
self._prev_event_handler.dispatch(drag_event, "pre_drag_leave")
drag_event.handled = False
self._prev_event_handler.dispatch(drag_event, "drag_leave")
self._prev_event_handler = None

if self.component.is_in(drag_event.x, drag_event.y):
# Test to see if we need to generate a mouse_enter event
if self._prev_event_handler != self.component:
self._prev_event_handler = self.component
self.component.dispatch(drag_event, "pre_drag_enter")
drag_event.handled = False
self.component.dispatch(drag_event, "drag_enter")

# Fire the actual event
self.component.dispatch(drag_event, "pre_" + event_name)
drag_event.handled = False
self.component.dispatch(drag_event, event_name)

return drag_event.handled

def set_tooltip(self, components):
"Set the window's tooltip (if necessary)"
raise NotImplementedError
Expand Down
Loading

0 comments on commit 5720af2

Please sign in to comment.