Kivy-examples 2.3.1.dev0__py3-none-any.whl
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- Kivy_examples-2.3.1.dev0.data/data/share/kivy-examples/3Drendering/main.py +77 -0
- Kivy_examples-2.3.1.dev0.data/data/share/kivy-examples/3Drendering/monkey.obj +7966 -0
- Kivy_examples-2.3.1.dev0.data/data/share/kivy-examples/3Drendering/objloader.py +147 -0
- Kivy_examples-2.3.1.dev0.data/data/share/kivy-examples/3Drendering/simple.glsl +47 -0
- Kivy_examples-2.3.1.dev0.data/data/share/kivy-examples/RST_Editor/editor.kv +72 -0
- Kivy_examples-2.3.1.dev0.data/data/share/kivy-examples/RST_Editor/main.py +64 -0
- Kivy_examples-2.3.1.dev0.data/data/share/kivy-examples/android/compass/android.txt +3 -0
- Kivy_examples-2.3.1.dev0.data/data/share/kivy-examples/android/compass/compass.kv +25 -0
- Kivy_examples-2.3.1.dev0.data/data/share/kivy-examples/android/compass/main.py +77 -0
- Kivy_examples-2.3.1.dev0.data/data/share/kivy-examples/android/compass/needle.png +0 -0
- Kivy_examples-2.3.1.dev0.data/data/share/kivy-examples/android/compass/rose.png +0 -0
- Kivy_examples-2.3.1.dev0.data/data/share/kivy-examples/android/takepicture/android.txt +3 -0
- Kivy_examples-2.3.1.dev0.data/data/share/kivy-examples/android/takepicture/main.py +80 -0
- Kivy_examples-2.3.1.dev0.data/data/share/kivy-examples/android/takepicture/shadow32.png +0 -0
- Kivy_examples-2.3.1.dev0.data/data/share/kivy-examples/android/takepicture/takepicture.kv +40 -0
- Kivy_examples-2.3.1.dev0.data/data/share/kivy-examples/animation/animate.py +42 -0
- Kivy_examples-2.3.1.dev0.data/data/share/kivy-examples/application/app_suite.py +152 -0
- Kivy_examples-2.3.1.dev0.data/data/share/kivy-examples/application/app_suite_data/testkvdir.kv +4 -0
- Kivy_examples-2.3.1.dev0.data/data/share/kivy-examples/application/app_with_build.py +24 -0
- Kivy_examples-2.3.1.dev0.data/data/share/kivy-examples/application/app_with_config.py +49 -0
- Kivy_examples-2.3.1.dev0.data/data/share/kivy-examples/application/app_with_kv.py +25 -0
- Kivy_examples-2.3.1.dev0.data/data/share/kivy-examples/application/app_with_kv_in_template1.py +27 -0
- Kivy_examples-2.3.1.dev0.data/data/share/kivy-examples/application/template1/test.kv +4 -0
- Kivy_examples-2.3.1.dev0.data/data/share/kivy-examples/application/test.kv +4 -0
- Kivy_examples-2.3.1.dev0.data/data/share/kivy-examples/application/testkvfile.kv +4 -0
- Kivy_examples-2.3.1.dev0.data/data/share/kivy-examples/async/asyncio_advanced.py +90 -0
- Kivy_examples-2.3.1.dev0.data/data/share/kivy-examples/async/asyncio_basic.py +59 -0
- Kivy_examples-2.3.1.dev0.data/data/share/kivy-examples/async/trio_advanced.py +93 -0
- Kivy_examples-2.3.1.dev0.data/data/share/kivy-examples/async/trio_basic.py +58 -0
- Kivy_examples-2.3.1.dev0.data/data/share/kivy-examples/audio/12908_sweet_trip_mm_clap_hi.wav +0 -0
- Kivy_examples-2.3.1.dev0.data/data/share/kivy-examples/audio/12909_sweet_trip_mm_clap_lo.wav +0 -0
- Kivy_examples-2.3.1.dev0.data/data/share/kivy-examples/audio/12910_sweet_trip_mm_clap_mid.wav +0 -0
- Kivy_examples-2.3.1.dev0.data/data/share/kivy-examples/audio/12911_sweet_trip_mm_hat_cl.wav +0 -0
- Kivy_examples-2.3.1.dev0.data/data/share/kivy-examples/audio/12913_sweet_trip_mm_kick_hi.wav +0 -0
- Kivy_examples-2.3.1.dev0.data/data/share/kivy-examples/audio/12914_sweet_trip_mm_kick_lo.wav +0 -0
- Kivy_examples-2.3.1.dev0.data/data/share/kivy-examples/audio/12915_sweet_trip_mm_kick_mid.wav +0 -0
- Kivy_examples-2.3.1.dev0.data/data/share/kivy-examples/audio/12916_sweet_trip_mm_kwik_mod_01.wav +0 -0
- Kivy_examples-2.3.1.dev0.data/data/share/kivy-examples/audio/12917_sweet_trip_mm_kwik_mod_02.wav +0 -0
- Kivy_examples-2.3.1.dev0.data/data/share/kivy-examples/audio/12918_sweet_trip_mm_kwik_mod_03.wav +0 -0
- Kivy_examples-2.3.1.dev0.data/data/share/kivy-examples/audio/12919_sweet_trip_mm_kwik_mod_04.wav +0 -0
- Kivy_examples-2.3.1.dev0.data/data/share/kivy-examples/audio/12920_sweet_trip_mm_kwik_mod_05.wav +0 -0
- Kivy_examples-2.3.1.dev0.data/data/share/kivy-examples/audio/12921_sweet_trip_mm_kwik_mod_06.wav +0 -0
- Kivy_examples-2.3.1.dev0.data/data/share/kivy-examples/audio/12922_sweet_trip_mm_kwik_mod_07.wav +0 -0
- Kivy_examples-2.3.1.dev0.data/data/share/kivy-examples/audio/12923_sweet_trip_mm_metal_clave.wav +0 -0
- Kivy_examples-2.3.1.dev0.data/data/share/kivy-examples/audio/12925_sweet_trip_mm_sweep_x.wav +0 -0
- Kivy_examples-2.3.1.dev0.data/data/share/kivy-examples/audio/12926_sweet_trip_mm_sweep_y.wav +0 -0
- Kivy_examples-2.3.1.dev0.data/data/share/kivy-examples/audio/12927_sweet_trip_mm_sweep_z.wav +0 -0
- Kivy_examples-2.3.1.dev0.data/data/share/kivy-examples/audio/audio.kv +59 -0
- Kivy_examples-2.3.1.dev0.data/data/share/kivy-examples/audio/main.py +81 -0
- Kivy_examples-2.3.1.dev0.data/data/share/kivy-examples/audio/pitch.py +42 -0
- Kivy_examples-2.3.1.dev0.data/data/share/kivy-examples/camera/main.py +59 -0
- Kivy_examples-2.3.1.dev0.data/data/share/kivy-examples/canvas/bezier.py +105 -0
- Kivy_examples-2.3.1.dev0.data/data/share/kivy-examples/canvas/canvas_stress.py +72 -0
- Kivy_examples-2.3.1.dev0.data/data/share/kivy-examples/canvas/circle.py +84 -0
- Kivy_examples-2.3.1.dev0.data/data/share/kivy-examples/canvas/fbo_canvas.py +91 -0
- Kivy_examples-2.3.1.dev0.data/data/share/kivy-examples/canvas/kiwi.jpg +0 -0
- Kivy_examples-2.3.1.dev0.data/data/share/kivy-examples/canvas/lines.py +296 -0
- Kivy_examples-2.3.1.dev0.data/data/share/kivy-examples/canvas/lines_extended.py +183 -0
- Kivy_examples-2.3.1.dev0.data/data/share/kivy-examples/canvas/mesh.py +57 -0
- Kivy_examples-2.3.1.dev0.data/data/share/kivy-examples/canvas/mesh_manipulation.py +101 -0
- Kivy_examples-2.3.1.dev0.data/data/share/kivy-examples/canvas/mtexture1.png +0 -0
- Kivy_examples-2.3.1.dev0.data/data/share/kivy-examples/canvas/mtexture2.png +0 -0
- Kivy_examples-2.3.1.dev0.data/data/share/kivy-examples/canvas/multitexture.py +110 -0
- Kivy_examples-2.3.1.dev0.data/data/share/kivy-examples/canvas/repeat_texture.py +65 -0
- Kivy_examples-2.3.1.dev0.data/data/share/kivy-examples/canvas/rotation.py +35 -0
- Kivy_examples-2.3.1.dev0.data/data/share/kivy-examples/canvas/rounded_rectangle.py +153 -0
- Kivy_examples-2.3.1.dev0.data/data/share/kivy-examples/canvas/scale.py +37 -0
- Kivy_examples-2.3.1.dev0.data/data/share/kivy-examples/canvas/stencil_canvas.py +85 -0
- Kivy_examples-2.3.1.dev0.data/data/share/kivy-examples/canvas/tesselate.py +146 -0
- Kivy_examples-2.3.1.dev0.data/data/share/kivy-examples/canvas/texture.py +143 -0
- Kivy_examples-2.3.1.dev0.data/data/share/kivy-examples/canvas/texture_example_image.png +0 -0
- Kivy_examples-2.3.1.dev0.data/data/share/kivy-examples/container/kv/1.kv +28 -0
- Kivy_examples-2.3.1.dev0.data/data/share/kivy-examples/container/kv/2.kv +28 -0
- Kivy_examples-2.3.1.dev0.data/data/share/kivy-examples/container/kv/3.kv +28 -0
- Kivy_examples-2.3.1.dev0.data/data/share/kivy-examples/container/kv/root.kv +32 -0
- Kivy_examples-2.3.1.dev0.data/data/share/kivy-examples/container/main.py +63 -0
- Kivy_examples-2.3.1.dev0.data/data/share/kivy-examples/cover/cover_image.py +25 -0
- Kivy_examples-2.3.1.dev0.data/data/share/kivy-examples/cover/cover_video.py +31 -0
- Kivy_examples-2.3.1.dev0.data/data/share/kivy-examples/demo/camera_puzzle.py +98 -0
- Kivy_examples-2.3.1.dev0.data/data/share/kivy-examples/demo/kivycatalog/container_kvs/AnchorLayoutContainer.kv +15 -0
- Kivy_examples-2.3.1.dev0.data/data/share/kivy-examples/demo/kivycatalog/container_kvs/BoxLayoutContainer.kv +14 -0
- Kivy_examples-2.3.1.dev0.data/data/share/kivy-examples/demo/kivycatalog/container_kvs/ButtonContainer.kv +27 -0
- Kivy_examples-2.3.1.dev0.data/data/share/kivy-examples/demo/kivycatalog/container_kvs/CheckBoxContainer.kv +28 -0
- Kivy_examples-2.3.1.dev0.data/data/share/kivy-examples/demo/kivycatalog/container_kvs/FileChooserContainer.kv +19 -0
- Kivy_examples-2.3.1.dev0.data/data/share/kivy-examples/demo/kivycatalog/container_kvs/FloatLayoutContainer.kv +16 -0
- Kivy_examples-2.3.1.dev0.data/data/share/kivy-examples/demo/kivycatalog/container_kvs/GridLayoutContainer.kv +20 -0
- Kivy_examples-2.3.1.dev0.data/data/share/kivy-examples/demo/kivycatalog/container_kvs/LabelContainer.kv +62 -0
- Kivy_examples-2.3.1.dev0.data/data/share/kivy-examples/demo/kivycatalog/container_kvs/MediaContainer.kv +9 -0
- Kivy_examples-2.3.1.dev0.data/data/share/kivy-examples/demo/kivycatalog/container_kvs/PlaygroundContainer.kv +4 -0
- Kivy_examples-2.3.1.dev0.data/data/share/kivy-examples/demo/kivycatalog/container_kvs/PopupContainer.kv +39 -0
- Kivy_examples-2.3.1.dev0.data/data/share/kivy-examples/demo/kivycatalog/container_kvs/ProgressBarContainer.kv +17 -0
- Kivy_examples-2.3.1.dev0.data/data/share/kivy-examples/demo/kivycatalog/container_kvs/RestContainer.kv +5 -0
- Kivy_examples-2.3.1.dev0.data/data/share/kivy-examples/demo/kivycatalog/container_kvs/ScatterContainer.kv +16 -0
- Kivy_examples-2.3.1.dev0.data/data/share/kivy-examples/demo/kivycatalog/container_kvs/SelectorsContainer.kv +10 -0
- Kivy_examples-2.3.1.dev0.data/data/share/kivy-examples/demo/kivycatalog/container_kvs/StackLayoutContainer.kv +25 -0
- Kivy_examples-2.3.1.dev0.data/data/share/kivy-examples/demo/kivycatalog/container_kvs/TextContainer.kv +20 -0
- Kivy_examples-2.3.1.dev0.data/data/share/kivy-examples/demo/kivycatalog/kivycatalog.kv +144 -0
- Kivy_examples-2.3.1.dev0.data/data/share/kivy-examples/demo/kivycatalog/main.py +192 -0
- Kivy_examples-2.3.1.dev0.data/data/share/kivy-examples/demo/multistroke/gesturedatabase.kv +117 -0
- Kivy_examples-2.3.1.dev0.data/data/share/kivy-examples/demo/multistroke/gesturedatabase.py +180 -0
- Kivy_examples-2.3.1.dev0.data/data/share/kivy-examples/demo/multistroke/helpers.py +30 -0
- Kivy_examples-2.3.1.dev0.data/data/share/kivy-examples/demo/multistroke/historymanager.kv +164 -0
- Kivy_examples-2.3.1.dev0.data/data/share/kivy-examples/demo/multistroke/historymanager.py +276 -0
- Kivy_examples-2.3.1.dev0.data/data/share/kivy-examples/demo/multistroke/main.py +144 -0
- Kivy_examples-2.3.1.dev0.data/data/share/kivy-examples/demo/multistroke/multistroke.kv +101 -0
- Kivy_examples-2.3.1.dev0.data/data/share/kivy-examples/demo/multistroke/settings.kv +110 -0
- Kivy_examples-2.3.1.dev0.data/data/share/kivy-examples/demo/multistroke/settings.py +97 -0
- Kivy_examples-2.3.1.dev0.data/data/share/kivy-examples/demo/pictures/android.txt +3 -0
- Kivy_examples-2.3.1.dev0.data/data/share/kivy-examples/demo/pictures/images/Bubbles.jpg +0 -0
- Kivy_examples-2.3.1.dev0.data/data/share/kivy-examples/demo/pictures/images/Ill1.jpg +0 -0
- Kivy_examples-2.3.1.dev0.data/data/share/kivy-examples/demo/pictures/images/Wall.jpg +0 -0
- Kivy_examples-2.3.1.dev0.data/data/share/kivy-examples/demo/pictures/images/faust_github.jpg +0 -0
- Kivy_examples-2.3.1.dev0.data/data/share/kivy-examples/demo/pictures/main.py +73 -0
- Kivy_examples-2.3.1.dev0.data/data/share/kivy-examples/demo/pictures/pictures.kv +57 -0
- Kivy_examples-2.3.1.dev0.data/data/share/kivy-examples/demo/pictures/shadow32.png +0 -0
- Kivy_examples-2.3.1.dev0.data/data/share/kivy-examples/demo/shadereditor/main.py +147 -0
- Kivy_examples-2.3.1.dev0.data/data/share/kivy-examples/demo/shadereditor/shadereditor.kv +39 -0
- Kivy_examples-2.3.1.dev0.data/data/share/kivy-examples/demo/showcase/README.txt +11 -0
- Kivy_examples-2.3.1.dev0.data/data/share/kivy-examples/demo/showcase/android.txt +3 -0
- Kivy_examples-2.3.1.dev0.data/data/share/kivy-examples/demo/showcase/data/background.png +0 -0
- Kivy_examples-2.3.1.dev0.data/data/share/kivy-examples/demo/showcase/data/faust_github.jpg +0 -0
- Kivy_examples-2.3.1.dev0.data/data/share/kivy-examples/demo/showcase/data/icons/README +4 -0
- Kivy_examples-2.3.1.dev0.data/data/share/kivy-examples/demo/showcase/data/icons/bug.png +0 -0
- Kivy_examples-2.3.1.dev0.data/data/share/kivy-examples/demo/showcase/data/icons/chevron-left.png +0 -0
- Kivy_examples-2.3.1.dev0.data/data/share/kivy-examples/demo/showcase/data/icons/chevron-right.png +0 -0
- Kivy_examples-2.3.1.dev0.data/data/share/kivy-examples/demo/showcase/data/screens/accordions.kv +39 -0
- Kivy_examples-2.3.1.dev0.data/data/share/kivy-examples/demo/showcase/data/screens/bubbles.kv +33 -0
- Kivy_examples-2.3.1.dev0.data/data/share/kivy-examples/demo/showcase/data/screens/buttons.kv +26 -0
- Kivy_examples-2.3.1.dev0.data/data/share/kivy-examples/demo/showcase/data/screens/carousel.kv +51 -0
- Kivy_examples-2.3.1.dev0.data/data/share/kivy-examples/demo/showcase/data/screens/checkboxes.kv +33 -0
- Kivy_examples-2.3.1.dev0.data/data/share/kivy-examples/demo/showcase/data/screens/codeinput.kv +9 -0
- Kivy_examples-2.3.1.dev0.data/data/share/kivy-examples/demo/showcase/data/screens/dropdown.kv +40 -0
- Kivy_examples-2.3.1.dev0.data/data/share/kivy-examples/demo/showcase/data/screens/filechoosers.kv +24 -0
- Kivy_examples-2.3.1.dev0.data/data/share/kivy-examples/demo/showcase/data/screens/popups.kv +17 -0
- Kivy_examples-2.3.1.dev0.data/data/share/kivy-examples/demo/showcase/data/screens/progressbar.kv +15 -0
- Kivy_examples-2.3.1.dev0.data/data/share/kivy-examples/demo/showcase/data/screens/rstdocument.kv +24 -0
- Kivy_examples-2.3.1.dev0.data/data/share/kivy-examples/demo/showcase/data/screens/scatter.kv +14 -0
- Kivy_examples-2.3.1.dev0.data/data/share/kivy-examples/demo/showcase/data/screens/screenmanager.kv +46 -0
- Kivy_examples-2.3.1.dev0.data/data/share/kivy-examples/demo/showcase/data/screens/sliders.kv +55 -0
- Kivy_examples-2.3.1.dev0.data/data/share/kivy-examples/demo/showcase/data/screens/spinner.kv +11 -0
- Kivy_examples-2.3.1.dev0.data/data/share/kivy-examples/demo/showcase/data/screens/splitter.kv +13 -0
- Kivy_examples-2.3.1.dev0.data/data/share/kivy-examples/demo/showcase/data/screens/switches.kv +39 -0
- Kivy_examples-2.3.1.dev0.data/data/share/kivy-examples/demo/showcase/data/screens/tabbedpanel + layouts.kv +69 -0
- Kivy_examples-2.3.1.dev0.data/data/share/kivy-examples/demo/showcase/data/screens/textinputs.kv +48 -0
- Kivy_examples-2.3.1.dev0.data/data/share/kivy-examples/demo/showcase/data/screens/togglebutton.kv +39 -0
- Kivy_examples-2.3.1.dev0.data/data/share/kivy-examples/demo/showcase/main.py +243 -0
- Kivy_examples-2.3.1.dev0.data/data/share/kivy-examples/demo/showcase/showcase.kv +100 -0
- Kivy_examples-2.3.1.dev0.data/data/share/kivy-examples/demo/touchtracer/README.txt +12 -0
- Kivy_examples-2.3.1.dev0.data/data/share/kivy-examples/demo/touchtracer/android.txt +3 -0
- Kivy_examples-2.3.1.dev0.data/data/share/kivy-examples/demo/touchtracer/icon.png +0 -0
- Kivy_examples-2.3.1.dev0.data/data/share/kivy-examples/demo/touchtracer/main.py +170 -0
- Kivy_examples-2.3.1.dev0.data/data/share/kivy-examples/demo/touchtracer/particle.png +0 -0
- Kivy_examples-2.3.1.dev0.data/data/share/kivy-examples/demo/touchtracer/touchtracer.kv +29 -0
- Kivy_examples-2.3.1.dev0.data/data/share/kivy-examples/frameworks/twisted/echo_client_app.py +82 -0
- Kivy_examples-2.3.1.dev0.data/data/share/kivy-examples/frameworks/twisted/echo_server_app.py +49 -0
- Kivy_examples-2.3.1.dev0.data/data/share/kivy-examples/frameworks/twisted/twistd_app.py +66 -0
- Kivy_examples-2.3.1.dev0.data/data/share/kivy-examples/gestures/gesture_board.py +95 -0
- Kivy_examples-2.3.1.dev0.data/data/share/kivy-examples/gestures/my_gestures.py +90 -0
- Kivy_examples-2.3.1.dev0.data/data/share/kivy-examples/guide/designwithkv/controller.kv +16 -0
- Kivy_examples-2.3.1.dev0.data/data/share/kivy-examples/guide/designwithkv/main.py +29 -0
- Kivy_examples-2.3.1.dev0.data/data/share/kivy-examples/guide/firstwidget/1_skeleton.py +15 -0
- Kivy_examples-2.3.1.dev0.data/data/share/kivy-examples/guide/firstwidget/2_print_touch.py +16 -0
- Kivy_examples-2.3.1.dev0.data/data/share/kivy-examples/guide/firstwidget/3_draw_ellipse.py +22 -0
- Kivy_examples-2.3.1.dev0.data/data/share/kivy-examples/guide/firstwidget/4_draw_line.py +26 -0
- Kivy_examples-2.3.1.dev0.data/data/share/kivy-examples/guide/firstwidget/5_random_colors.py +28 -0
- Kivy_examples-2.3.1.dev0.data/data/share/kivy-examples/guide/firstwidget/6_button.py +38 -0
- Kivy_examples-2.3.1.dev0.data/data/share/kivy-examples/guide/quickstart/main.py +15 -0
- Kivy_examples-2.3.1.dev0.data/data/share/kivy-examples/includes/button.kv +9 -0
- Kivy_examples-2.3.1.dev0.data/data/share/kivy-examples/includes/layout.kv +6 -0
- Kivy_examples-2.3.1.dev0.data/data/share/kivy-examples/includes/main.py +19 -0
- Kivy_examples-2.3.1.dev0.data/data/share/kivy-examples/includes/test.kv +5 -0
- Kivy_examples-2.3.1.dev0.data/data/share/kivy-examples/keyboard/android.txt +3 -0
- Kivy_examples-2.3.1.dev0.data/data/share/kivy-examples/keyboard/main.py +226 -0
- Kivy_examples-2.3.1.dev0.data/data/share/kivy-examples/keyboard/numeric.json +38 -0
- Kivy_examples-2.3.1.dev0.data/data/share/kivy-examples/kinect/README.txt +13 -0
- Kivy_examples-2.3.1.dev0.data/data/share/kivy-examples/kinect/kinectviewer.py +283 -0
- Kivy_examples-2.3.1.dev0.data/data/share/kivy-examples/kv/app_button.kv +9 -0
- Kivy_examples-2.3.1.dev0.data/data/share/kivy-examples/kv/app_camera.kv +25 -0
- Kivy_examples-2.3.1.dev0.data/data/share/kivy-examples/kv/app_fbo.kv +11 -0
- Kivy_examples-2.3.1.dev0.data/data/share/kivy-examples/kv/app_layout.kv +23 -0
- Kivy_examples-2.3.1.dev0.data/data/share/kivy-examples/kv/app_logo.kv +36 -0
- Kivy_examples-2.3.1.dev0.data/data/share/kivy-examples/kv/app_scatter.kv +6 -0
- Kivy_examples-2.3.1.dev0.data/data/share/kivy-examples/kv/app_stencil.kv +27 -0
- Kivy_examples-2.3.1.dev0.data/data/share/kivy-examples/kv/app_video.kv +42 -0
- Kivy_examples-2.3.1.dev0.data/data/share/kivy-examples/kv/builder_template.py +28 -0
- Kivy_examples-2.3.1.dev0.data/data/share/kivy-examples/kv/ids/id_in_kv/id_in_kv.py +20 -0
- Kivy_examples-2.3.1.dev0.data/data/share/kivy-examples/kv/ids/id_in_kv/test.kv +11 -0
- Kivy_examples-2.3.1.dev0.data/data/share/kivy-examples/kv/ids/kv_and_py/kv_and_py.py +34 -0
- Kivy_examples-2.3.1.dev0.data/data/share/kivy-examples/kv/ids/kv_and_py/test.kv +11 -0
- Kivy_examples-2.3.1.dev0.data/data/share/kivy-examples/kv/kivy.jpg +0 -0
- Kivy_examples-2.3.1.dev0.data/data/share/kivy-examples/kv/kvrun.py +38 -0
- Kivy_examples-2.3.1.dev0.data/data/share/kivy-examples/miscellaneous/clipboard.py +63 -0
- Kivy_examples-2.3.1.dev0.data/data/share/kivy-examples/miscellaneous/custom_titlebar.py +56 -0
- Kivy_examples-2.3.1.dev0.data/data/share/kivy-examples/miscellaneous/imagesave.py +14 -0
- Kivy_examples-2.3.1.dev0.data/data/share/kivy-examples/miscellaneous/joystick.py +83 -0
- Kivy_examples-2.3.1.dev0.data/data/share/kivy-examples/miscellaneous/multiple_dropfile.py +51 -0
- Kivy_examples-2.3.1.dev0.data/data/share/kivy-examples/miscellaneous/on_textedit_event.py +104 -0
- Kivy_examples-2.3.1.dev0.data/data/share/kivy-examples/miscellaneous/opacitywindow.py +28 -0
- Kivy_examples-2.3.1.dev0.data/data/share/kivy-examples/miscellaneous/shapecollisions.py +397 -0
- Kivy_examples-2.3.1.dev0.data/data/share/kivy-examples/miscellaneous/shapedwindow.py +98 -0
- Kivy_examples-2.3.1.dev0.data/data/share/kivy-examples/miscellaneous/two_panes.py +47 -0
- Kivy_examples-2.3.1.dev0.data/data/share/kivy-examples/miscellaneous/urlrequest.py +128 -0
- Kivy_examples-2.3.1.dev0.data/data/share/kivy-examples/settings/android.txt +3 -0
- Kivy_examples-2.3.1.dev0.data/data/share/kivy-examples/settings/main.py +122 -0
- Kivy_examples-2.3.1.dev0.data/data/share/kivy-examples/shader/plasma.kv +9 -0
- Kivy_examples-2.3.1.dev0.data/data/share/kivy-examples/shader/plasma.py +86 -0
- Kivy_examples-2.3.1.dev0.data/data/share/kivy-examples/shader/rotated.kv +91 -0
- Kivy_examples-2.3.1.dev0.data/data/share/kivy-examples/shader/rotated.py +102 -0
- Kivy_examples-2.3.1.dev0.data/data/share/kivy-examples/shader/shadertree.kv +29 -0
- Kivy_examples-2.3.1.dev0.data/data/share/kivy-examples/shader/shadertree.py +193 -0
- Kivy_examples-2.3.1.dev0.data/data/share/kivy-examples/shader/tex3.jpg +0 -0
- Kivy_examples-2.3.1.dev0.data/data/share/kivy-examples/svg/benchmark.py +19 -0
- Kivy_examples-2.3.1.dev0.data/data/share/kivy-examples/svg/cloud.svg +25 -0
- Kivy_examples-2.3.1.dev0.data/data/share/kivy-examples/svg/main-smaa.py +155 -0
- Kivy_examples-2.3.1.dev0.data/data/share/kivy-examples/svg/main.py +50 -0
- Kivy_examples-2.3.1.dev0.data/data/share/kivy-examples/svg/music.svg +68 -0
- Kivy_examples-2.3.1.dev0.data/data/share/kivy-examples/svg/rotated.svg +23 -0
- Kivy_examples-2.3.1.dev0.data/data/share/kivy-examples/svg/ship.svg +181 -0
- Kivy_examples-2.3.1.dev0.data/data/share/kivy-examples/svg/sun.svg +35 -0
- Kivy_examples-2.3.1.dev0.data/data/share/kivy-examples/svg/tiger.svg +813 -0
- Kivy_examples-2.3.1.dev0.data/data/share/kivy-examples/text/pango_demo.py +296 -0
- Kivy_examples-2.3.1.dev0.data/data/share/kivy-examples/tutorials/notes/final/data/icon.png +0 -0
- Kivy_examples-2.3.1.dev0.data/data/share/kivy-examples/tutorials/notes/final/main.py +163 -0
- Kivy_examples-2.3.1.dev0.data/data/share/kivy-examples/tutorials/notes/final/note.kv +154 -0
- Kivy_examples-2.3.1.dev0.data/data/share/kivy-examples/tutorials/pong/main.py +82 -0
- Kivy_examples-2.3.1.dev0.data/data/share/kivy-examples/tutorials/pong/pong.kv +53 -0
- Kivy_examples-2.3.1.dev0.data/data/share/kivy-examples/tutorials/pong/steps/step1/main.py +15 -0
- Kivy_examples-2.3.1.dev0.data/data/share/kivy-examples/tutorials/pong/steps/step1/pong.kv +2 -0
- Kivy_examples-2.3.1.dev0.data/data/share/kivy-examples/tutorials/pong/steps/step2/main.py +15 -0
- Kivy_examples-2.3.1.dev0.data/data/share/kivy-examples/tutorials/pong/steps/step2/pong.kv +21 -0
- Kivy_examples-2.3.1.dev0.data/data/share/kivy-examples/tutorials/pong/steps/step3/main.py +26 -0
- Kivy_examples-2.3.1.dev0.data/data/share/kivy-examples/tutorials/pong/steps/step3/pong.kv +31 -0
- Kivy_examples-2.3.1.dev0.data/data/share/kivy-examples/tutorials/pong/steps/step4/main.py +48 -0
- Kivy_examples-2.3.1.dev0.data/data/share/kivy-examples/tutorials/pong/steps/step4/pong.kv +34 -0
- Kivy_examples-2.3.1.dev0.data/data/share/kivy-examples/tutorials/pong/steps/step5/main.py +75 -0
- Kivy_examples-2.3.1.dev0.data/data/share/kivy-examples/tutorials/pong/steps/step5/pong.kv +53 -0
- Kivy_examples-2.3.1.dev0.data/data/share/kivy-examples/widgets/accordion_1.py +17 -0
- Kivy_examples-2.3.1.dev0.data/data/share/kivy-examples/widgets/actionbar.py +32 -0
- Kivy_examples-2.3.1.dev0.data/data/share/kivy-examples/widgets/asyncimage.py +35 -0
- Kivy_examples-2.3.1.dev0.data/data/share/kivy-examples/widgets/boxlayout_poshint.py +54 -0
- Kivy_examples-2.3.1.dev0.data/data/share/kivy-examples/widgets/bubble_test.py +63 -0
- Kivy_examples-2.3.1.dev0.data/data/share/kivy-examples/widgets/camera.py +33 -0
- Kivy_examples-2.3.1.dev0.data/data/share/kivy-examples/widgets/carousel_buttons.py +50 -0
- Kivy_examples-2.3.1.dev0.data/data/share/kivy-examples/widgets/cityCC0.mpg +0 -0
- Kivy_examples-2.3.1.dev0.data/data/share/kivy-examples/widgets/cityCC0.png +0 -0
- Kivy_examples-2.3.1.dev0.data/data/share/kivy-examples/widgets/codeinput.py +225 -0
- Kivy_examples-2.3.1.dev0.data/data/share/kivy-examples/widgets/codeinputtest.kv +53 -0
- Kivy_examples-2.3.1.dev0.data/data/share/kivy-examples/widgets/colorpicker.py +234 -0
- Kivy_examples-2.3.1.dev0.data/data/share/kivy-examples/widgets/colorusage.py +62 -0
- Kivy_examples-2.3.1.dev0.data/data/share/kivy-examples/widgets/compound_selection.py +83 -0
- Kivy_examples-2.3.1.dev0.data/data/share/kivy-examples/widgets/customcollide.py +82 -0
- Kivy_examples-2.3.1.dev0.data/data/share/kivy-examples/widgets/effectwidget.py +193 -0
- Kivy_examples-2.3.1.dev0.data/data/share/kivy-examples/widgets/effectwidget2.py +47 -0
- Kivy_examples-2.3.1.dev0.data/data/share/kivy-examples/widgets/effectwidget3_advanced.py +62 -0
- Kivy_examples-2.3.1.dev0.data/data/share/kivy-examples/widgets/fbowidget.py +111 -0
- Kivy_examples-2.3.1.dev0.data/data/share/kivy-examples/widgets/focus_behavior.py +98 -0
- Kivy_examples-2.3.1.dev0.data/data/share/kivy-examples/widgets/image_mipmap.py +31 -0
- Kivy_examples-2.3.1.dev0.data/data/share/kivy-examples/widgets/keyboardlistener.py +42 -0
- Kivy_examples-2.3.1.dev0.data/data/share/kivy-examples/widgets/label_mipmap.py +28 -0
- Kivy_examples-2.3.1.dev0.data/data/share/kivy-examples/widgets/label_sizing.py +193 -0
- Kivy_examples-2.3.1.dev0.data/data/share/kivy-examples/widgets/label_text_size.py +49 -0
- Kivy_examples-2.3.1.dev0.data/data/share/kivy-examples/widgets/label_with_markup.py +21 -0
- Kivy_examples-2.3.1.dev0.data/data/share/kivy-examples/widgets/lang_dynamic_classes.py +18 -0
- Kivy_examples-2.3.1.dev0.data/data/share/kivy-examples/widgets/pagelayout.py +64 -0
- Kivy_examples-2.3.1.dev0.data/data/share/kivy-examples/widgets/popup_with_kv.py +35 -0
- Kivy_examples-2.3.1.dev0.data/data/share/kivy-examples/widgets/recycleview/basic_data.py +124 -0
- Kivy_examples-2.3.1.dev0.data/data/share/kivy-examples/widgets/recycleview/infinite_scrolling.py +143 -0
- Kivy_examples-2.3.1.dev0.data/data/share/kivy-examples/widgets/recycleview/key_viewclass.py +149 -0
- Kivy_examples-2.3.1.dev0.data/data/share/kivy-examples/widgets/recycleview/messenger.py +196 -0
- Kivy_examples-2.3.1.dev0.data/data/share/kivy-examples/widgets/recycleview/pull_to_refresh.py +95 -0
- Kivy_examples-2.3.1.dev0.data/data/share/kivy-examples/widgets/recycleview/rv_animate_items.py +109 -0
- Kivy_examples-2.3.1.dev0.data/data/share/kivy-examples/widgets/rstexample.py +128 -0
- Kivy_examples-2.3.1.dev0.data/data/share/kivy-examples/widgets/scatter.kv +53 -0
- Kivy_examples-2.3.1.dev0.data/data/share/kivy-examples/widgets/scatter.py +16 -0
- Kivy_examples-2.3.1.dev0.data/data/share/kivy-examples/widgets/screenmanager.py +106 -0
- Kivy_examples-2.3.1.dev0.data/data/share/kivy-examples/widgets/scrollview.kv +16 -0
- Kivy_examples-2.3.1.dev0.data/data/share/kivy-examples/widgets/scrollview.py +40 -0
- Kivy_examples-2.3.1.dev0.data/data/share/kivy-examples/widgets/sequenced_images/android.txt +3 -0
- Kivy_examples-2.3.1.dev0.data/data/share/kivy-examples/widgets/sequenced_images/data/images/bird.zip +0 -0
- Kivy_examples-2.3.1.dev0.data/data/share/kivy-examples/widgets/sequenced_images/data/images/button_white.png +0 -0
- Kivy_examples-2.3.1.dev0.data/data/share/kivy-examples/widgets/sequenced_images/data/images/button_white_animated.zip +0 -0
- Kivy_examples-2.3.1.dev0.data/data/share/kivy-examples/widgets/sequenced_images/data/images/cube.zip +0 -0
- Kivy_examples-2.3.1.dev0.data/data/share/kivy-examples/widgets/sequenced_images/data/images/info.png +0 -0
- Kivy_examples-2.3.1.dev0.data/data/share/kivy-examples/widgets/sequenced_images/data/images/info.zip +0 -0
- Kivy_examples-2.3.1.dev0.data/data/share/kivy-examples/widgets/sequenced_images/data/images/simple_cv_joint_animated.gif +0 -0
- Kivy_examples-2.3.1.dev0.data/data/share/kivy-examples/widgets/sequenced_images/main.kv +63 -0
- Kivy_examples-2.3.1.dev0.data/data/share/kivy-examples/widgets/sequenced_images/main.py +150 -0
- Kivy_examples-2.3.1.dev0.data/data/share/kivy-examples/widgets/sequenced_images/uix/__init__.py +7 -0
- Kivy_examples-2.3.1.dev0.data/data/share/kivy-examples/widgets/sequenced_images/uix/custom_button.py +98 -0
- Kivy_examples-2.3.1.dev0.data/data/share/kivy-examples/widgets/settings.py +93 -0
- Kivy_examples-2.3.1.dev0.data/data/share/kivy-examples/widgets/shorten_text.py +80 -0
- Kivy_examples-2.3.1.dev0.data/data/share/kivy-examples/widgets/spinner.py +17 -0
- Kivy_examples-2.3.1.dev0.data/data/share/kivy-examples/widgets/splitter.py +74 -0
- Kivy_examples-2.3.1.dev0.data/data/share/kivy-examples/widgets/tabbed_panel_showcase.py +316 -0
- Kivy_examples-2.3.1.dev0.data/data/share/kivy-examples/widgets/tabbedpanel.py +50 -0
- Kivy_examples-2.3.1.dev0.data/data/share/kivy-examples/widgets/textalign.kv +49 -0
- Kivy_examples-2.3.1.dev0.data/data/share/kivy-examples/widgets/textalign.py +48 -0
- Kivy_examples-2.3.1.dev0.data/data/share/kivy-examples/widgets/textinput.py +59 -0
- Kivy_examples-2.3.1.dev0.data/data/share/kivy-examples/widgets/unicode_textinput.py +244 -0
- Kivy_examples-2.3.1.dev0.data/data/share/kivy-examples/widgets/videoplayer.py +26 -0
- Kivy_examples-2.3.1.dev0.dist-info/AUTHORS +66 -0
- Kivy_examples-2.3.1.dev0.dist-info/LICENSE +21 -0
- Kivy_examples-2.3.1.dev0.dist-info/METADATA +382 -0
- Kivy_examples-2.3.1.dev0.dist-info/RECORD +624 -0
- Kivy_examples-2.3.1.dev0.dist-info/WHEEL +5 -0
- Kivy_examples-2.3.1.dev0.dist-info/dependency_links.txt +1 -0
- Kivy_examples-2.3.1.dev0.dist-info/top_level.txt +1 -0
- kivy/__init__.py +519 -0
- kivy/_version.py +18 -0
- kivy/animation.py +831 -0
- kivy/app.py +1213 -0
- kivy/atlas.py +456 -0
- kivy/base.py +617 -0
- kivy/cache.py +262 -0
- kivy/clock.py +1172 -0
- kivy/compat.py +82 -0
- kivy/config.py +1004 -0
- kivy/context.py +102 -0
- kivy/core/__init__.py +247 -0
- kivy/core/audio/__init__.py +223 -0
- kivy/core/audio/audio_android.py +104 -0
- kivy/core/audio/audio_avplayer.py +82 -0
- kivy/core/audio/audio_ffpyplayer.py +185 -0
- kivy/core/audio/audio_gstplayer.py +101 -0
- kivy/core/audio/audio_pygame.py +127 -0
- kivy/core/camera/__init__.py +151 -0
- kivy/core/camera/camera_android.py +206 -0
- kivy/core/camera/camera_gi.py +170 -0
- kivy/core/camera/camera_opencv.py +163 -0
- kivy/core/camera/camera_picamera.py +96 -0
- kivy/core/clipboard/__init__.py +157 -0
- kivy/core/clipboard/_clipboard_ext.py +36 -0
- kivy/core/clipboard/clipboard_android.py +91 -0
- kivy/core/clipboard/clipboard_dbusklipper.py +41 -0
- kivy/core/clipboard/clipboard_dummy.py +26 -0
- kivy/core/clipboard/clipboard_gtk3.py +47 -0
- kivy/core/clipboard/clipboard_nspaste.py +44 -0
- kivy/core/clipboard/clipboard_pygame.py +67 -0
- kivy/core/clipboard/clipboard_sdl2.py +36 -0
- kivy/core/clipboard/clipboard_winctypes.py +107 -0
- kivy/core/clipboard/clipboard_xclip.py +29 -0
- kivy/core/clipboard/clipboard_xsel.py +26 -0
- kivy/core/gl/__init__.py +90 -0
- kivy/core/image/__init__.py +996 -0
- kivy/core/image/img_dds.py +40 -0
- kivy/core/image/img_ffpyplayer.py +87 -0
- kivy/core/image/img_pil.py +123 -0
- kivy/core/image/img_pygame.py +119 -0
- kivy/core/image/img_sdl2.py +66 -0
- kivy/core/image/img_tex.py +58 -0
- kivy/core/spelling/__init__.py +135 -0
- kivy/core/spelling/spelling_enchant.py +50 -0
- kivy/core/spelling/spelling_osxappkit.py +64 -0
- kivy/core/text/__init__.py +1090 -0
- kivy/core/text/markup.py +893 -0
- kivy/core/text/text_pango.py +145 -0
- kivy/core/text/text_pil.py +84 -0
- kivy/core/text/text_pygame.py +117 -0
- kivy/core/text/text_sdl2.py +50 -0
- kivy/core/video/__init__.py +219 -0
- kivy/core/video/video_ffmpeg.py +106 -0
- kivy/core/video/video_ffpyplayer.py +449 -0
- kivy/core/video/video_gstplayer.py +140 -0
- kivy/core/video/video_null.py +12 -0
- kivy/core/window/__init__.py +2515 -0
- kivy/core/window/window_egl_rpi.py +86 -0
- kivy/core/window/window_pygame.py +441 -0
- kivy/core/window/window_sdl2.py +999 -0
- kivy/deps/__init__.py +6 -0
- kivy/effects/__init__.py +23 -0
- kivy/effects/dampedscroll.py +114 -0
- kivy/effects/kinetic.py +193 -0
- kivy/effects/opacityscroll.py +27 -0
- kivy/effects/scroll.py +126 -0
- kivy/event.py +12 -0
- kivy/eventmanager/__init__.py +185 -0
- kivy/extras/__init__.py +0 -0
- kivy/extras/highlight.py +52 -0
- kivy/factory.py +190 -0
- kivy/factory_registers.py +201 -0
- kivy/garden/__init__.py +186 -0
- kivy/geometry.py +121 -0
- kivy/gesture.py +424 -0
- kivy/graphics/__init__.py +126 -0
- kivy/graphics/cgl_backend/__init__.py +0 -0
- kivy/input/__init__.py +39 -0
- kivy/input/factory.py +35 -0
- kivy/input/motionevent.py +587 -0
- kivy/input/postproc/__init__.py +27 -0
- kivy/input/postproc/calibration.py +200 -0
- kivy/input/postproc/dejitter.py +74 -0
- kivy/input/postproc/doubletap.py +101 -0
- kivy/input/postproc/ignorelist.py +47 -0
- kivy/input/postproc/retaintouch.py +93 -0
- kivy/input/postproc/tripletap.py +106 -0
- kivy/input/provider.py +40 -0
- kivy/input/providers/__init__.py +68 -0
- kivy/input/providers/androidjoystick.py +117 -0
- kivy/input/providers/hidinput.py +778 -0
- kivy/input/providers/leapfinger.py +113 -0
- kivy/input/providers/linuxwacom.py +396 -0
- kivy/input/providers/mactouch.py +220 -0
- kivy/input/providers/mouse.py +424 -0
- kivy/input/providers/mtdev.py +380 -0
- kivy/input/providers/probesysfs.py +254 -0
- kivy/input/providers/tuio.py +326 -0
- kivy/input/providers/wm_common.py +162 -0
- kivy/input/providers/wm_pen.py +121 -0
- kivy/input/providers/wm_touch.py +157 -0
- kivy/input/recorder.py +335 -0
- kivy/input/shape.py +27 -0
- kivy/interactive.py +335 -0
- kivy/lang/__init__.py +883 -0
- kivy/lang/builder.py +1004 -0
- kivy/lang/parser.py +822 -0
- kivy/lib/__init__.py +21 -0
- kivy/lib/ddsfile.py +419 -0
- kivy/lib/gstplayer/__init__.py +27 -0
- kivy/lib/mtdev.py +254 -0
- kivy/lib/vidcore_lite/__init__.py +0 -0
- kivy/loader.py +579 -0
- kivy/logger.py +646 -0
- kivy/metrics.py +421 -0
- kivy/modules/__init__.py +300 -0
- kivy/modules/_webdebugger.py +200 -0
- kivy/modules/console.py +1059 -0
- kivy/modules/cursor.py +75 -0
- kivy/modules/inspector.py +755 -0
- kivy/modules/joycursor.py +299 -0
- kivy/modules/keybinding.py +64 -0
- kivy/modules/monitor.py +90 -0
- kivy/modules/recorder.py +94 -0
- kivy/modules/screen.py +183 -0
- kivy/modules/showborder.py +33 -0
- kivy/modules/touchring.py +97 -0
- kivy/modules/webdebugger.py +30 -0
- kivy/multistroke.py +1477 -0
- kivy/network/__init__.py +7 -0
- kivy/network/urlrequest.py +794 -0
- kivy/parser.py +154 -0
- kivy/resources.py +102 -0
- kivy/storage/__init__.py +405 -0
- kivy/storage/dictstore.py +98 -0
- kivy/storage/jsonstore.py +92 -0
- kivy/storage/redisstore.py +103 -0
- kivy/support.py +267 -0
- kivy/tests/__init__.py +11 -0
- kivy/tests/async_common.py +568 -0
- kivy/tests/common.py +524 -0
- kivy/tests/conftest.py +33 -0
- kivy/tests/fixtures.py +169 -0
- kivy/tests/perf_test_textinput.py +195 -0
- kivy/tests/pyinstaller/simple_widget/main.py +12 -0
- kivy/tests/pyinstaller/simple_widget/project/__init__.py +0 -0
- kivy/tests/pyinstaller/simple_widget/project/widget.py +12 -0
- kivy/tests/pyinstaller/test_pyinstaller.py +115 -0
- kivy/tests/pyinstaller/video_widget/main.py +6 -0
- kivy/tests/pyinstaller/video_widget/project/__init__.py +38 -0
- kivy/tests/test_animations.py +415 -0
- kivy/tests/test_app.py +216 -0
- kivy/tests/test_audio.py +69 -0
- kivy/tests/test_benchmark.py +292 -0
- kivy/tests/test_clipboard.py +48 -0
- kivy/tests/test_clock.py +292 -0
- kivy/tests/test_compat.py +6 -0
- kivy/tests/test_config.py +35 -0
- kivy/tests/test_coverage.py +83 -0
- kivy/tests/test_doc_gallery.py +38 -0
- kivy/tests/test_environ_cli.py +50 -0
- kivy/tests/test_fbo_py2py3.py +74 -0
- kivy/tests/test_filechooser.py +11 -0
- kivy/tests/test_filechooser_unicode.py +82 -0
- kivy/tests/test_fonts.py +42 -0
- kivy/tests/test_garden.py +23 -0
- kivy/tests/test_graphics.py +1149 -0
- kivy/tests/test_graphics_svg.py +84 -0
- kivy/tests/test_image.py +74 -0
- kivy/tests/test_imageloader.py +485 -0
- kivy/tests/test_invalid_lang.py +42 -0
- kivy/tests/test_issues/test_6315.py +55 -0
- kivy/tests/test_issues/test_issue_1084.py +47 -0
- kivy/tests/test_issues/test_issue_1091.py +19 -0
- kivy/tests/test_issues/test_issue_599.py +21 -0
- kivy/tests/test_issues/test_issue_609.py +19 -0
- kivy/tests/test_issues/test_issue_6909.py +28 -0
- kivy/tests/test_issues/test_issue_883.py +12 -0
- kivy/tests/test_kivy_init.py +30 -0
- kivy/tests/test_knspace.py +247 -0
- kivy/tests/test_lang.py +431 -0
- kivy/tests/test_lang_complex.py +87 -0
- kivy/tests/test_lang_pre_process_and_post_process.py +394 -0
- kivy/tests/test_logger.py +516 -0
- kivy/tests/test_metrics.py +30 -0
- kivy/tests/test_module_inspector.py +382 -0
- kivy/tests/test_motion_event.py +44 -0
- kivy/tests/test_mouse_hover_event.py +249 -0
- kivy/tests/test_mouse_multitouchsim.py +554 -0
- kivy/tests/test_multistroke.py +389 -0
- kivy/tests/test_properties.py +1332 -0
- kivy/tests/test_resources.py +79 -0
- kivy/tests/test_rst_replace.py +63 -0
- kivy/tests/test_screen.py +38 -0
- kivy/tests/test_storage.py +135 -0
- kivy/tests/test_uix_actionbar.py +363 -0
- kivy/tests/test_uix_anchorlayout.py +79 -0
- kivy/tests/test_uix_asyncimage.py +133 -0
- kivy/tests/test_uix_boxlayout.py +94 -0
- kivy/tests/test_uix_bubble.py +425 -0
- kivy/tests/test_uix_carousel.py +93 -0
- kivy/tests/test_uix_colorpicker.py +77 -0
- kivy/tests/test_uix_dropdown.py +91 -0
- kivy/tests/test_uix_gridlayout.py +244 -0
- kivy/tests/test_uix_layout.py +16 -0
- kivy/tests/test_uix_modal.py +101 -0
- kivy/tests/test_uix_recyclegridlayout.py +383 -0
- kivy/tests/test_uix_relativelayout.py +30 -0
- kivy/tests/test_uix_scrollview.py +358 -0
- kivy/tests/test_uix_settings.py +33 -0
- kivy/tests/test_uix_slider.py +156 -0
- kivy/tests/test_uix_stacklayout.py +120 -0
- kivy/tests/test_uix_textinput.py +577 -0
- kivy/tests/test_uix_translate_coordinates.py +72 -0
- kivy/tests/test_uix_videoplayer.py +112 -0
- kivy/tests/test_uix_widget.py +137 -0
- kivy/tests/test_urlrequest/test_urlrequest_requests.py +378 -0
- kivy/tests/test_urlrequest/test_urlrequest_urllib.py +155 -0
- kivy/tests/test_utils.py +237 -0
- kivy/tests/test_vector.py +256 -0
- kivy/tests/test_video.py +25 -0
- kivy/tests/test_weakmethod.py +44 -0
- kivy/tests/test_widget.py +127 -0
- kivy/tests/test_widget_walk.py +70 -0
- kivy/tests/test_window_base.py +60 -0
- kivy/tests/test_window_info.py +29 -0
- kivy/tests/visual_test_label.py +291 -0
- kivy/tools/__init__.py +44 -0
- kivy/tools/benchmark.py +286 -0
- kivy/tools/changelog_parser.py +120 -0
- kivy/tools/coverage.py +135 -0
- kivy/tools/gallery.py +323 -0
- kivy/tools/generate-icons.py +117 -0
- kivy/tools/gles_compat/subset_gles.py +125 -0
- kivy/tools/highlight/__init__.py +9 -0
- kivy/tools/kviewer.py +80 -0
- kivy/tools/packaging/__init__.py +12 -0
- kivy/tools/packaging/cython_cfg.py +82 -0
- kivy/tools/packaging/factory.py +105 -0
- kivy/tools/packaging/pyinstaller_hooks/__init__.py +381 -0
- kivy/tools/packaging/pyinstaller_hooks/__main__.py +29 -0
- kivy/tools/packaging/pyinstaller_hooks/hook-kivy.py +9 -0
- kivy/tools/packaging/pyinstaller_hooks/pyi_rth_kivy.py +17 -0
- kivy/tools/pep8checker/pep8.py +2316 -0
- kivy/tools/pep8checker/pep8kivy.py +109 -0
- kivy/tools/report.py +223 -0
- kivy/tools/stub-gl-debug.py +201 -0
- kivy/tools/texturecompress.py +233 -0
- kivy/uix/__init__.py +56 -0
- kivy/uix/accordion.py +484 -0
- kivy/uix/actionbar.py +934 -0
- kivy/uix/anchorlayout.py +122 -0
- kivy/uix/behaviors/__init__.py +95 -0
- kivy/uix/behaviors/button.py +212 -0
- kivy/uix/behaviors/codenavigation.py +167 -0
- kivy/uix/behaviors/compoundselection.py +688 -0
- kivy/uix/behaviors/cover.py +160 -0
- kivy/uix/behaviors/drag.py +234 -0
- kivy/uix/behaviors/emacs.py +140 -0
- kivy/uix/behaviors/focus.py +595 -0
- kivy/uix/behaviors/knspace.py +590 -0
- kivy/uix/behaviors/togglebutton.py +156 -0
- kivy/uix/behaviors/touchripple.py +318 -0
- kivy/uix/boxlayout.py +331 -0
- kivy/uix/bubble.py +576 -0
- kivy/uix/button.py +137 -0
- kivy/uix/camera.py +118 -0
- kivy/uix/carousel.py +695 -0
- kivy/uix/checkbox.py +197 -0
- kivy/uix/codeinput.py +238 -0
- kivy/uix/colorpicker.py +486 -0
- kivy/uix/dropdown.py +391 -0
- kivy/uix/effectwidget.py +772 -0
- kivy/uix/filechooser.py +1134 -0
- kivy/uix/floatlayout.py +148 -0
- kivy/uix/gesturesurface.py +625 -0
- kivy/uix/gridlayout.py +629 -0
- kivy/uix/image.py +528 -0
- kivy/uix/label.py +1200 -0
- kivy/uix/layout.py +322 -0
- kivy/uix/modalview.py +339 -0
- kivy/uix/pagelayout.py +233 -0
- kivy/uix/popup.py +266 -0
- kivy/uix/progressbar.py +95 -0
- kivy/uix/recycleboxlayout.py +183 -0
- kivy/uix/recyclegridlayout.py +255 -0
- kivy/uix/recyclelayout.py +446 -0
- kivy/uix/recycleview/__init__.py +624 -0
- kivy/uix/recycleview/datamodel.py +194 -0
- kivy/uix/recycleview/layout.py +253 -0
- kivy/uix/recycleview/views.py +423 -0
- kivy/uix/relativelayout.py +324 -0
- kivy/uix/rst.py +1492 -0
- kivy/uix/sandbox.py +198 -0
- kivy/uix/scatter.py +645 -0
- kivy/uix/scatterlayout.py +93 -0
- kivy/uix/screenmanager.py +1275 -0
- kivy/uix/scrollview.py +1288 -0
- kivy/uix/settings.py +1343 -0
- kivy/uix/slider.py +421 -0
- kivy/uix/spinner.py +221 -0
- kivy/uix/splitter.py +430 -0
- kivy/uix/stacklayout.py +331 -0
- kivy/uix/stencilview.py +40 -0
- kivy/uix/switch.py +122 -0
- kivy/uix/tabbedpanel.py +880 -0
- kivy/uix/textinput.py +4049 -0
- kivy/uix/togglebutton.py +37 -0
- kivy/uix/treeview.py +665 -0
- kivy/uix/video.py +302 -0
- kivy/uix/videoplayer.py +697 -0
- kivy/uix/vkeyboard.py +879 -0
- kivy/uix/widget.py +1629 -0
- kivy/utils.py +550 -0
- kivy/vector.py +412 -0
- kivy/weakmethod.py +72 -0
|
@@ -0,0 +1,1149 @@
|
|
|
1
|
+
'''
|
|
2
|
+
Graphics tests
|
|
3
|
+
==============
|
|
4
|
+
|
|
5
|
+
Testing the simple vertex instructions
|
|
6
|
+
'''
|
|
7
|
+
|
|
8
|
+
import sys
|
|
9
|
+
import pytest
|
|
10
|
+
import itertools
|
|
11
|
+
from threading import Thread
|
|
12
|
+
from kivy.tests.common import GraphicUnitTest, requires_graphics
|
|
13
|
+
|
|
14
|
+
|
|
15
|
+
class BoxShadowTest(GraphicUnitTest):
|
|
16
|
+
|
|
17
|
+
def test_create(self):
|
|
18
|
+
from kivy.graphics.boxshadow import BoxShadow
|
|
19
|
+
from kivy.uix.widget import Widget
|
|
20
|
+
from kivy.graphics import Color
|
|
21
|
+
|
|
22
|
+
r = self.render
|
|
23
|
+
|
|
24
|
+
# with initial arguments
|
|
25
|
+
wid = Widget()
|
|
26
|
+
with wid.canvas:
|
|
27
|
+
Color(1, 0, 0, 1)
|
|
28
|
+
bs = BoxShadow(
|
|
29
|
+
pos=(50, 50),
|
|
30
|
+
size=(150, 150),
|
|
31
|
+
offset=(0, 10),
|
|
32
|
+
spread_radius=(10, -10),
|
|
33
|
+
border_radius=(10, 10, 10, 10),
|
|
34
|
+
blur_radius=80,
|
|
35
|
+
)
|
|
36
|
+
r(wid)
|
|
37
|
+
|
|
38
|
+
wid = Widget()
|
|
39
|
+
with wid.canvas:
|
|
40
|
+
Color(0, 1, 0, 1)
|
|
41
|
+
bs = BoxShadow(
|
|
42
|
+
inset=True,
|
|
43
|
+
pos=(50, 50),
|
|
44
|
+
size=(150, 150),
|
|
45
|
+
offset=(0, 10),
|
|
46
|
+
spread_radius=(10, -10),
|
|
47
|
+
border_radius=(10, 10, 10, 10),
|
|
48
|
+
blur_radius=80,
|
|
49
|
+
)
|
|
50
|
+
r(wid)
|
|
51
|
+
|
|
52
|
+
# changing properties later
|
|
53
|
+
wid = Widget()
|
|
54
|
+
with wid.canvas:
|
|
55
|
+
Color(0, 0, 1, 1)
|
|
56
|
+
bs = BoxShadow()
|
|
57
|
+
bs.inset = True
|
|
58
|
+
bs.pos = [50, 50]
|
|
59
|
+
bs.size = [150, 150]
|
|
60
|
+
bs.offset = [0, 10]
|
|
61
|
+
bs.spread_radius = [10, -10]
|
|
62
|
+
bs.border_radius = [10, 10, 10, 10]
|
|
63
|
+
bs.blur_radius = 40
|
|
64
|
+
r(wid)
|
|
65
|
+
|
|
66
|
+
def test_adjusted_size(self):
|
|
67
|
+
from kivy.graphics.boxshadow import BoxShadow
|
|
68
|
+
|
|
69
|
+
raw_size = 150, 150
|
|
70
|
+
|
|
71
|
+
bs = BoxShadow()
|
|
72
|
+
bs.pos = 50, 50
|
|
73
|
+
bs.size = raw_size
|
|
74
|
+
bs.blur_radius = 80
|
|
75
|
+
bs.spread_radius = -10, 10
|
|
76
|
+
|
|
77
|
+
# The size of the rectangle containing the FBO texture (shadow) needs
|
|
78
|
+
# to be adjusted according to the size of the shadow, otherwise there
|
|
79
|
+
# will be an unwanted cropping behavior.
|
|
80
|
+
adjusted_size = (
|
|
81
|
+
max(
|
|
82
|
+
0,
|
|
83
|
+
raw_size[0] + bs.blur_radius * 3 + bs.spread_radius[0] * 2,
|
|
84
|
+
),
|
|
85
|
+
max(
|
|
86
|
+
0,
|
|
87
|
+
raw_size[1] + bs.blur_radius * 3 + bs.spread_radius[1] * 2,
|
|
88
|
+
),
|
|
89
|
+
)
|
|
90
|
+
|
|
91
|
+
assert bs.size == adjusted_size
|
|
92
|
+
|
|
93
|
+
# Now we will turn on the inset mode, it is expected that
|
|
94
|
+
# there will be no size adjustments.
|
|
95
|
+
bs.inset = True
|
|
96
|
+
assert bs.size == raw_size
|
|
97
|
+
|
|
98
|
+
# Now turning off, and reverting back to the default mode.
|
|
99
|
+
bs.inset = False
|
|
100
|
+
assert bs.size == adjusted_size
|
|
101
|
+
|
|
102
|
+
# Testing with initial arguments
|
|
103
|
+
bs = BoxShadow(
|
|
104
|
+
inset=True,
|
|
105
|
+
pos=(50, 50),
|
|
106
|
+
size=raw_size,
|
|
107
|
+
blur_radius=80,
|
|
108
|
+
spread_radius=(10, -10)
|
|
109
|
+
)
|
|
110
|
+
adjusted_size = (
|
|
111
|
+
max(
|
|
112
|
+
0,
|
|
113
|
+
raw_size[0] + bs.blur_radius * 3 + bs.spread_radius[0] * 2,
|
|
114
|
+
),
|
|
115
|
+
max(
|
|
116
|
+
0,
|
|
117
|
+
raw_size[1] + bs.blur_radius * 3 + bs.spread_radius[1] * 2,
|
|
118
|
+
),
|
|
119
|
+
)
|
|
120
|
+
|
|
121
|
+
assert bs.size == raw_size
|
|
122
|
+
|
|
123
|
+
# Now turning off, and reverting back to the default mode.
|
|
124
|
+
bs.inset = False
|
|
125
|
+
assert bs.size == adjusted_size
|
|
126
|
+
|
|
127
|
+
# Now we will turn on the inset mode, it is expected that
|
|
128
|
+
# there will be no size adjustments.
|
|
129
|
+
bs.inset = True
|
|
130
|
+
assert bs.size == raw_size
|
|
131
|
+
|
|
132
|
+
def test_adjusted_pos(self):
|
|
133
|
+
from kivy.graphics.boxshadow import BoxShadow
|
|
134
|
+
|
|
135
|
+
raw_pos = 50, 50
|
|
136
|
+
raw_size = 150, 150
|
|
137
|
+
offset = 10, -100
|
|
138
|
+
|
|
139
|
+
bs = BoxShadow()
|
|
140
|
+
bs.pos = raw_pos
|
|
141
|
+
bs.size = raw_size
|
|
142
|
+
bs.offset = offset
|
|
143
|
+
bs.blur_radius = 80
|
|
144
|
+
bs.spread_radius = -10, 10
|
|
145
|
+
|
|
146
|
+
# If the size of the rectangle containing the FBO texture (shadow)
|
|
147
|
+
# changes, its position will need to be adjusted.
|
|
148
|
+
adjusted_pos = (
|
|
149
|
+
raw_pos[0]
|
|
150
|
+
- bs.blur_radius * 1.5
|
|
151
|
+
- bs.spread_radius[0]
|
|
152
|
+
+ bs.offset[0],
|
|
153
|
+
raw_pos[0]
|
|
154
|
+
- bs.blur_radius * 1.5
|
|
155
|
+
- bs.spread_radius[1]
|
|
156
|
+
+ bs.offset[1],
|
|
157
|
+
)
|
|
158
|
+
|
|
159
|
+
assert bs.pos == adjusted_pos
|
|
160
|
+
|
|
161
|
+
# Now we will turn on the inset mode, it is expected that
|
|
162
|
+
# there will be no position adjustments.
|
|
163
|
+
bs.inset = True
|
|
164
|
+
assert bs.pos == raw_pos
|
|
165
|
+
|
|
166
|
+
# Now turning off, and reverting back to the default mode.
|
|
167
|
+
bs.inset = False
|
|
168
|
+
assert bs.pos == adjusted_pos
|
|
169
|
+
|
|
170
|
+
# Testing with initial arguments
|
|
171
|
+
bs = BoxShadow(
|
|
172
|
+
inset=True,
|
|
173
|
+
pos=raw_pos,
|
|
174
|
+
size=raw_size,
|
|
175
|
+
offset=offset,
|
|
176
|
+
blur_radius=80,
|
|
177
|
+
spread_radius=(10, -10)
|
|
178
|
+
)
|
|
179
|
+
adjusted_pos = (
|
|
180
|
+
raw_pos[0]
|
|
181
|
+
- bs.blur_radius * 1.5
|
|
182
|
+
- bs.spread_radius[0]
|
|
183
|
+
+ bs.offset[0],
|
|
184
|
+
raw_pos[0]
|
|
185
|
+
- bs.blur_radius * 1.5
|
|
186
|
+
- bs.spread_radius[1]
|
|
187
|
+
+ bs.offset[1],
|
|
188
|
+
)
|
|
189
|
+
|
|
190
|
+
assert bs.pos == raw_pos
|
|
191
|
+
|
|
192
|
+
# Now turning off, and reverting back to the default mode.
|
|
193
|
+
bs.inset = False
|
|
194
|
+
assert bs.pos == adjusted_pos
|
|
195
|
+
|
|
196
|
+
# Now we will turn on the inset mode, it is expected that
|
|
197
|
+
# there will be no position adjustments.
|
|
198
|
+
bs.inset = True
|
|
199
|
+
assert bs.pos == raw_pos
|
|
200
|
+
|
|
201
|
+
def test_bounded_properties(self):
|
|
202
|
+
from kivy.graphics.boxshadow import BoxShadow
|
|
203
|
+
|
|
204
|
+
bs = BoxShadow()
|
|
205
|
+
bs.pos = 50, 50
|
|
206
|
+
bs.size = 150, 150
|
|
207
|
+
bs.offset = 10, -100
|
|
208
|
+
bs.blur_radius = -80
|
|
209
|
+
bs.spread_radius = -200, -100
|
|
210
|
+
bs.border_radius = 0, 0, 100, 0
|
|
211
|
+
|
|
212
|
+
assert bs.size == (0, 0)
|
|
213
|
+
assert bs.blur_radius == 0
|
|
214
|
+
|
|
215
|
+
# There is a bug in RoundedRectangle that distorts the texture if the
|
|
216
|
+
# radius value is less than 1. Otherwise, it could be 0.
|
|
217
|
+
assert bs.border_radius == tuple(
|
|
218
|
+
map(
|
|
219
|
+
lambda value: max(1.0, min(value, min(bs.size) / 2)),
|
|
220
|
+
bs.border_radius,
|
|
221
|
+
)
|
|
222
|
+
)
|
|
223
|
+
|
|
224
|
+
# Testing with initial arguments
|
|
225
|
+
bs = BoxShadow(
|
|
226
|
+
pos=(50, 50),
|
|
227
|
+
size=(150, 150),
|
|
228
|
+
offset=(10, -100),
|
|
229
|
+
blur_radius=-80,
|
|
230
|
+
spread_radius=(-200, -100),
|
|
231
|
+
border_radius=(0, 0, 100, 0),
|
|
232
|
+
)
|
|
233
|
+
|
|
234
|
+
assert bs.size == (0, 0)
|
|
235
|
+
assert bs.blur_radius == 0
|
|
236
|
+
assert bs.border_radius == tuple(
|
|
237
|
+
map(
|
|
238
|
+
lambda value: max(1.0, min(value, min(bs.size) / 2)),
|
|
239
|
+
bs.border_radius,
|
|
240
|
+
)
|
|
241
|
+
)
|
|
242
|
+
|
|
243
|
+
def test_canvas_management(self):
|
|
244
|
+
from kivy.graphics.boxshadow import BoxShadow
|
|
245
|
+
from kivy.uix.widget import Widget
|
|
246
|
+
from kivy.graphics import Color
|
|
247
|
+
|
|
248
|
+
r = self.render
|
|
249
|
+
|
|
250
|
+
wid = Widget()
|
|
251
|
+
with wid.canvas:
|
|
252
|
+
bs = BoxShadow()
|
|
253
|
+
r(wid)
|
|
254
|
+
assert bs in wid.canvas.children
|
|
255
|
+
|
|
256
|
+
wid = Widget()
|
|
257
|
+
bs = BoxShadow()
|
|
258
|
+
wid.canvas.add(Color(1, 0, 0, 1))
|
|
259
|
+
wid.canvas.add(bs)
|
|
260
|
+
r(wid)
|
|
261
|
+
assert bs in wid.canvas.children
|
|
262
|
+
|
|
263
|
+
wid.canvas.remove(bs)
|
|
264
|
+
assert bs not in wid.canvas.children
|
|
265
|
+
|
|
266
|
+
wid.canvas.insert(1, bs)
|
|
267
|
+
assert bs in wid.canvas.children
|
|
268
|
+
assert wid.canvas.children.index(bs) == 1
|
|
269
|
+
|
|
270
|
+
|
|
271
|
+
class VertexInstructionTest(GraphicUnitTest):
|
|
272
|
+
|
|
273
|
+
def test_circle(self):
|
|
274
|
+
from kivy.uix.widget import Widget
|
|
275
|
+
from kivy.graphics import Ellipse, Color
|
|
276
|
+
|
|
277
|
+
r = self.render
|
|
278
|
+
|
|
279
|
+
# basic circle
|
|
280
|
+
wid = Widget()
|
|
281
|
+
with wid.canvas:
|
|
282
|
+
Color(1, 1, 1)
|
|
283
|
+
Ellipse(pos=(100, 100), size=(100, 100))
|
|
284
|
+
r(wid)
|
|
285
|
+
|
|
286
|
+
# reduced circle
|
|
287
|
+
wid = Widget()
|
|
288
|
+
with wid.canvas:
|
|
289
|
+
Color(1, 1, 1)
|
|
290
|
+
Ellipse(pos=(100, 100), size=(100, 100), segments=10)
|
|
291
|
+
r(wid)
|
|
292
|
+
|
|
293
|
+
# moving circle
|
|
294
|
+
wid = Widget()
|
|
295
|
+
with wid.canvas:
|
|
296
|
+
Color(1, 1, 1)
|
|
297
|
+
self.e = Ellipse(pos=(100, 100), size=(100, 100))
|
|
298
|
+
self.e.pos = (10, 10)
|
|
299
|
+
r(wid)
|
|
300
|
+
|
|
301
|
+
def test_ellipse(self):
|
|
302
|
+
from kivy.uix.widget import Widget
|
|
303
|
+
from kivy.graphics import Ellipse, Color
|
|
304
|
+
|
|
305
|
+
r = self.render
|
|
306
|
+
|
|
307
|
+
# ellipse
|
|
308
|
+
wid = Widget()
|
|
309
|
+
with wid.canvas:
|
|
310
|
+
Color(1, 1, 1)
|
|
311
|
+
self.e = Ellipse(pos=(100, 100), size=(200, 100))
|
|
312
|
+
r(wid)
|
|
313
|
+
|
|
314
|
+
def test_point(self):
|
|
315
|
+
from kivy.uix.widget import Widget
|
|
316
|
+
from kivy.graphics import Point, Color
|
|
317
|
+
|
|
318
|
+
r = self.render
|
|
319
|
+
|
|
320
|
+
# 1 point
|
|
321
|
+
wid = Widget()
|
|
322
|
+
with wid.canvas:
|
|
323
|
+
Color(1, 1, 1)
|
|
324
|
+
Point(points=(10, 10))
|
|
325
|
+
r(wid)
|
|
326
|
+
|
|
327
|
+
# 25 points
|
|
328
|
+
wid = Widget()
|
|
329
|
+
with wid.canvas:
|
|
330
|
+
Color(1, 1, 1)
|
|
331
|
+
Point(points=[x * 5 for x in range(50)])
|
|
332
|
+
r(wid)
|
|
333
|
+
|
|
334
|
+
def test_point_add(self):
|
|
335
|
+
from kivy.uix.widget import Widget
|
|
336
|
+
from kivy.graphics import Point, Color
|
|
337
|
+
|
|
338
|
+
r = self.render
|
|
339
|
+
|
|
340
|
+
wid = Widget()
|
|
341
|
+
with wid.canvas:
|
|
342
|
+
Color(1, 1, 1)
|
|
343
|
+
p = Point(pointsize=10)
|
|
344
|
+
|
|
345
|
+
p.add_point(10, 10)
|
|
346
|
+
p.add_point(90, 10)
|
|
347
|
+
p.add_point(10, 90)
|
|
348
|
+
p.add_point(50, 50)
|
|
349
|
+
p.add_point(10, 50)
|
|
350
|
+
p.add_point(50, 10)
|
|
351
|
+
|
|
352
|
+
r(wid)
|
|
353
|
+
|
|
354
|
+
def test_line_rounded_rectangle(self):
|
|
355
|
+
from kivy.uix.widget import Widget
|
|
356
|
+
from kivy.graphics import Line, Color
|
|
357
|
+
r = self.render
|
|
358
|
+
|
|
359
|
+
# basic rounded_rectangle
|
|
360
|
+
wid = Widget()
|
|
361
|
+
with wid.canvas:
|
|
362
|
+
Color(1, 1, 1)
|
|
363
|
+
line = Line(
|
|
364
|
+
rounded_rectangle=(100, 100, 100, 100, 10, 20, 30, 40, 100)
|
|
365
|
+
)
|
|
366
|
+
r(wid)
|
|
367
|
+
assert line.rounded_rectangle == (
|
|
368
|
+
100, 100, 100, 100, 10, 20, 30, 40, 100
|
|
369
|
+
)
|
|
370
|
+
|
|
371
|
+
# The largest angle allowed is equal to the smallest dimension (width
|
|
372
|
+
# or height) minus the largest angle value between the anterior angle
|
|
373
|
+
# and the posterior angle.
|
|
374
|
+
wid = Widget()
|
|
375
|
+
with wid.canvas:
|
|
376
|
+
Color(1, 1, 1)
|
|
377
|
+
line = Line(
|
|
378
|
+
rounded_rectangle=(
|
|
379
|
+
100, 100, 100, 100, 100, 20, 10, 30, 100
|
|
380
|
+
)
|
|
381
|
+
)
|
|
382
|
+
r(wid)
|
|
383
|
+
assert line.rounded_rectangle == (
|
|
384
|
+
100, 100, 100, 100, 70, 20, 10, 30, 100
|
|
385
|
+
)
|
|
386
|
+
|
|
387
|
+
# Same approach as above
|
|
388
|
+
wid = Widget()
|
|
389
|
+
with wid.canvas:
|
|
390
|
+
Color(1, 1, 1)
|
|
391
|
+
line = Line(
|
|
392
|
+
rounded_rectangle=(
|
|
393
|
+
100, 100, 100, 100, 100, 25, 100, 50, 100
|
|
394
|
+
)
|
|
395
|
+
)
|
|
396
|
+
r(wid)
|
|
397
|
+
assert line.rounded_rectangle == (
|
|
398
|
+
100, 100, 100, 100, 50, 25, 50, 50, 100
|
|
399
|
+
)
|
|
400
|
+
|
|
401
|
+
# A circle should be generated if width and height are equal, and all
|
|
402
|
+
# angles passed are greater than or equal to the smallest dimension.
|
|
403
|
+
wid = Widget()
|
|
404
|
+
with wid.canvas:
|
|
405
|
+
Color(1, 1, 1)
|
|
406
|
+
line = Line(
|
|
407
|
+
rounded_rectangle=(
|
|
408
|
+
100, 100, 100, 100, 150, 50, 50.001, 51, 100
|
|
409
|
+
)
|
|
410
|
+
)
|
|
411
|
+
r(wid)
|
|
412
|
+
assert line.rounded_rectangle == (
|
|
413
|
+
100, 100, 100, 100, 50, 50, 50, 50, 100
|
|
414
|
+
)
|
|
415
|
+
|
|
416
|
+
# Currently the minimum radius should be 1, to avoid rendering issues
|
|
417
|
+
wid = Widget()
|
|
418
|
+
with wid.canvas:
|
|
419
|
+
Color(1, 1, 1)
|
|
420
|
+
line = Line(
|
|
421
|
+
rounded_rectangle=(
|
|
422
|
+
100, 100, 100, 100, 0, 0, 0, 0, 100
|
|
423
|
+
)
|
|
424
|
+
)
|
|
425
|
+
r(wid)
|
|
426
|
+
assert line.rounded_rectangle == (
|
|
427
|
+
100, 100, 100, 100, 1, 1, 1, 1, 100
|
|
428
|
+
)
|
|
429
|
+
|
|
430
|
+
# Angles adjustment + avoid issue if radius is less than 1
|
|
431
|
+
wid = Widget()
|
|
432
|
+
with wid.canvas:
|
|
433
|
+
Color(1, 1, 1)
|
|
434
|
+
line = Line(
|
|
435
|
+
rounded_rectangle=(
|
|
436
|
+
100, 100, 100, 100, 100, 0, 0, 0, 100
|
|
437
|
+
)
|
|
438
|
+
)
|
|
439
|
+
r(wid)
|
|
440
|
+
assert line.rounded_rectangle == (
|
|
441
|
+
100, 100, 100, 100, 99, 1, 1, 1, 100
|
|
442
|
+
)
|
|
443
|
+
|
|
444
|
+
def test_smoothline_rounded_rectangle(self):
|
|
445
|
+
from kivy.uix.widget import Widget
|
|
446
|
+
from kivy.graphics import SmoothLine, Color
|
|
447
|
+
r = self.render
|
|
448
|
+
|
|
449
|
+
# If width and/or height < 2px, the figure should not be rendered.
|
|
450
|
+
# This avoids some known SmoothLine rendering issues.
|
|
451
|
+
wid = Widget()
|
|
452
|
+
with wid.canvas:
|
|
453
|
+
Color(1, 1, 1)
|
|
454
|
+
line = SmoothLine(
|
|
455
|
+
rounded_rectangle=(100, 100, 0.5, 1.99, 30, 30, 30, 30, 100)
|
|
456
|
+
)
|
|
457
|
+
r(wid)
|
|
458
|
+
assert line.rounded_rectangle is None
|
|
459
|
+
|
|
460
|
+
def test_enlarged_line(self):
|
|
461
|
+
from kivy.uix.widget import Widget
|
|
462
|
+
from kivy.graphics import Line, Color, PushMatrix, PopMatrix, Scale, \
|
|
463
|
+
Translate
|
|
464
|
+
r = self.render
|
|
465
|
+
wid = Widget()
|
|
466
|
+
with wid.canvas:
|
|
467
|
+
Color(1, 1, 1)
|
|
468
|
+
|
|
469
|
+
# Normal line with width 1
|
|
470
|
+
Line(
|
|
471
|
+
points=(10, 10, 10, 90),
|
|
472
|
+
width=1
|
|
473
|
+
)
|
|
474
|
+
|
|
475
|
+
# Normal line with width 3
|
|
476
|
+
Line(
|
|
477
|
+
points=(20, 10, 20, 90),
|
|
478
|
+
width=3
|
|
479
|
+
)
|
|
480
|
+
|
|
481
|
+
# Enlarged line that should look width 3
|
|
482
|
+
PushMatrix()
|
|
483
|
+
Translate(30, 10, 1) # So the enlargement goes around 0, 0, 0
|
|
484
|
+
Scale(3, 1, 1) # X scaled by 3 so the line width should become 3
|
|
485
|
+
Line(
|
|
486
|
+
points=(0, 0, 0, 80),
|
|
487
|
+
width=1,
|
|
488
|
+
force_custom_drawing_method=True
|
|
489
|
+
)
|
|
490
|
+
PopMatrix()
|
|
491
|
+
|
|
492
|
+
r(wid)
|
|
493
|
+
|
|
494
|
+
|
|
495
|
+
class SmoothVertexInstructionTest(GraphicUnitTest):
|
|
496
|
+
|
|
497
|
+
# Code defined in the points setter of AntiAliasingLine class.
|
|
498
|
+
def _convert_points(self, points):
|
|
499
|
+
if points and isinstance(points[0], (list, tuple)):
|
|
500
|
+
return list(itertools.chain(*points))
|
|
501
|
+
else:
|
|
502
|
+
return list(points)
|
|
503
|
+
|
|
504
|
+
# The same function present in the AntiAliasingLine code,
|
|
505
|
+
# externalized for testing.
|
|
506
|
+
def _filtered_points(self, points):
|
|
507
|
+
index = 0
|
|
508
|
+
p = self._convert_points(points)
|
|
509
|
+
|
|
510
|
+
# At least 3 points are required, otherwise we will return an empty
|
|
511
|
+
# list, which means there are no valid points.
|
|
512
|
+
if len(p) < 6:
|
|
513
|
+
return []
|
|
514
|
+
|
|
515
|
+
while index < len(p) - 2:
|
|
516
|
+
x1, y1 = p[index], p[index + 1]
|
|
517
|
+
x2, y2 = p[index + 2], p[index + 3]
|
|
518
|
+
if abs(x2 - x1) < 1.0 and abs(y2 - y1) < 1.0:
|
|
519
|
+
del p[index + 2: index + 4]
|
|
520
|
+
else:
|
|
521
|
+
index += 2
|
|
522
|
+
if abs(p[0] - p[-2]) < 1.0 and abs(p[1] - p[-1]) < 1.0:
|
|
523
|
+
del p[:2]
|
|
524
|
+
return p
|
|
525
|
+
|
|
526
|
+
def _get_texture(self):
|
|
527
|
+
from kivy.graphics.texture import Texture
|
|
528
|
+
return Texture.create()
|
|
529
|
+
|
|
530
|
+
def test_antialiasing_line(self):
|
|
531
|
+
from kivy.uix.widget import Widget
|
|
532
|
+
from kivy.graphics import Color, Rectangle, Instruction
|
|
533
|
+
from kivy.graphics.vertex_instructions import AntiAliasingLine
|
|
534
|
+
|
|
535
|
+
r = self.render
|
|
536
|
+
|
|
537
|
+
# We expect a type error to be thrown if stencil_mask is not an object
|
|
538
|
+
# of type Instruction.
|
|
539
|
+
with pytest.raises(TypeError):
|
|
540
|
+
AntiAliasingLine(None, points=[10, 20, 30, 20, 30, 10])
|
|
541
|
+
|
|
542
|
+
# No TypeError here.
|
|
543
|
+
target_rect = Rectangle()
|
|
544
|
+
AntiAliasingLine(target_rect, points=[10, 20, 30, 40, 50, 60])
|
|
545
|
+
|
|
546
|
+
# Test the gradient responsible for the "smooth line" effect.
|
|
547
|
+
pixels = b"\xff\xff\xff\x00\xff\xff\xff\xff\xff\xff\xff\x00"
|
|
548
|
+
instruction = Instruction()
|
|
549
|
+
aa_line = AntiAliasingLine(instruction)
|
|
550
|
+
assert aa_line.texture.pixels == pixels
|
|
551
|
+
# check the width, defined through tests with the custom texture.
|
|
552
|
+
assert aa_line.width == 2.5
|
|
553
|
+
|
|
554
|
+
# This set of points must remain unchanged.
|
|
555
|
+
points_1 = [51.0, 649.0, 199.0, 649.0, 199.0, 501.0, 51.0, 501.0]
|
|
556
|
+
|
|
557
|
+
# This set of points should be reduced from 16 to 8.
|
|
558
|
+
points_2 = [
|
|
559
|
+
261.0, 275.0,
|
|
560
|
+
335.0, 349.0,
|
|
561
|
+
335.0, 349.0,
|
|
562
|
+
409.0, 275.0,
|
|
563
|
+
409.0, 275.0,
|
|
564
|
+
335.0, 201.0,
|
|
565
|
+
335.0, 201.0,
|
|
566
|
+
261.0, 275.0
|
|
567
|
+
]
|
|
568
|
+
|
|
569
|
+
# This set of points should be reduced from 72 to 50.
|
|
570
|
+
points_3 = [
|
|
571
|
+
260.0, 275.0,
|
|
572
|
+
261.0, 275.0,
|
|
573
|
+
261.0, 275.0,
|
|
574
|
+
261.999999999999, 275.99999999,
|
|
575
|
+
261.06667650085353, 278.14064903651496,
|
|
576
|
+
261.26658584785304, 281.2756384111877,
|
|
577
|
+
261.56658584785305, 281.3756384111877,
|
|
578
|
+
261.5993677908431, 284.39931866126904,
|
|
579
|
+
262.0644226342696, 287.50606070381684,
|
|
580
|
+
262.0644226342696, 287.50606070381684,
|
|
581
|
+
262.6609123178712, 290.59026597968375,
|
|
582
|
+
263.3877619269211, 293.6463765424993,
|
|
583
|
+
264.2436616292954, 296.66888507446475,
|
|
584
|
+
265.22706903587977, 299.65234481091227,
|
|
585
|
+
265.22706903587977, 299.65234481091227,
|
|
586
|
+
266.3362119800583, 302.59137935574284,
|
|
587
|
+
267.5690917112779, 305.48069237005546,
|
|
588
|
+
268.9234864969319, 308.31507711650784,
|
|
589
|
+
270.39695562607204, 311.089425842209,
|
|
590
|
+
270.89695562607204, 311.589425842209,
|
|
591
|
+
271.98684380773494, 313.7987389832352,
|
|
592
|
+
273.69028595595563, 316.4381341741821,
|
|
593
|
+
275.50421235284637, 319.00285504651725,
|
|
594
|
+
275.50421235284637, 319.00285504651725,
|
|
595
|
+
277.4253541804354, 321.48827979987755,
|
|
596
|
+
279.45024941129833, 323.8899295308661,
|
|
597
|
+
281.57524904736516, 326.20347630433844,
|
|
598
|
+
283.79652369566156, 328.4247509526349,
|
|
599
|
+
283.99652369566156, 328.7247509526349,
|
|
600
|
+
286.1100704691339, 330.54975058870167,
|
|
601
|
+
288.5117202001224, 332.5746458195646,
|
|
602
|
+
288.5117202001224, 332.5746458195646,
|
|
603
|
+
290.99714495348275, 334.4957876471537,
|
|
604
|
+
293.5618658258179, 336.3097140440444,
|
|
605
|
+
293.5618658258179, 336.3097140440444,
|
|
606
|
+
293.2618658258179, 336.1097140440444
|
|
607
|
+
]
|
|
608
|
+
|
|
609
|
+
# This set of points should be reduced to [].
|
|
610
|
+
points_4 = [100, 100, 200, 100]
|
|
611
|
+
|
|
612
|
+
# line closed (default)
|
|
613
|
+
for points in (points_1, points_2, points_3, points_4):
|
|
614
|
+
wid = Widget()
|
|
615
|
+
with wid.canvas:
|
|
616
|
+
Color(1, 1, 1, 0.5)
|
|
617
|
+
inst = Instruction()
|
|
618
|
+
aa_line = AntiAliasingLine(inst, points=points)
|
|
619
|
+
r(wid)
|
|
620
|
+
filtered_points = self._filtered_points(points)
|
|
621
|
+
assert aa_line.points == filtered_points + filtered_points[:2]
|
|
622
|
+
|
|
623
|
+
# without closing the line
|
|
624
|
+
for points in (points_1, points_2, points_3, points_4):
|
|
625
|
+
wid = Widget()
|
|
626
|
+
with wid.canvas:
|
|
627
|
+
Color(1, 1, 1, 0.5)
|
|
628
|
+
inst = Instruction()
|
|
629
|
+
aa_line = AntiAliasingLine(inst, points=points, close=0)
|
|
630
|
+
r(wid)
|
|
631
|
+
assert aa_line.points == self._filtered_points(points)
|
|
632
|
+
|
|
633
|
+
def test_smoothrectangle(self):
|
|
634
|
+
from kivy.uix.widget import Widget
|
|
635
|
+
from kivy.graphics import Color, SmoothRectangle
|
|
636
|
+
|
|
637
|
+
r = self.render
|
|
638
|
+
|
|
639
|
+
wid = Widget()
|
|
640
|
+
with wid.canvas:
|
|
641
|
+
Color(1, 1, 1, 0.5)
|
|
642
|
+
rect = SmoothRectangle(pos=(100, 100), size=(150, 150))
|
|
643
|
+
r(wid)
|
|
644
|
+
filtered_points = self._filtered_points(rect.points)
|
|
645
|
+
assert (
|
|
646
|
+
rect.antialiasing_line_points
|
|
647
|
+
== filtered_points + filtered_points[:2]
|
|
648
|
+
)
|
|
649
|
+
|
|
650
|
+
# test if antialiasing is disabled if the graphic has one of its
|
|
651
|
+
# dimensions decreased to less than 4px.
|
|
652
|
+
rect.size = (150, -2)
|
|
653
|
+
r(wid)
|
|
654
|
+
assert rect.antialiasing_line_points == []
|
|
655
|
+
|
|
656
|
+
rect.size = (150, 2)
|
|
657
|
+
r(wid)
|
|
658
|
+
assert rect.antialiasing_line_points == []
|
|
659
|
+
|
|
660
|
+
# re-enable antialiasing line rendering.
|
|
661
|
+
rect.size = (150, 150)
|
|
662
|
+
r(wid)
|
|
663
|
+
assert (
|
|
664
|
+
rect.antialiasing_line_points
|
|
665
|
+
== filtered_points + filtered_points[:2]
|
|
666
|
+
)
|
|
667
|
+
|
|
668
|
+
# disabling antialiasing.
|
|
669
|
+
rect.texture = self._get_texture()
|
|
670
|
+
r(wid)
|
|
671
|
+
assert rect.antialiasing_line_points == []
|
|
672
|
+
|
|
673
|
+
# re-enable antialiasing.
|
|
674
|
+
rect.source = ""
|
|
675
|
+
r(wid)
|
|
676
|
+
assert (
|
|
677
|
+
rect.antialiasing_line_points
|
|
678
|
+
== filtered_points + filtered_points[:2]
|
|
679
|
+
)
|
|
680
|
+
|
|
681
|
+
# test if antialiasing is disabled if the graphic is initialized with
|
|
682
|
+
# at least one of its dimensions less than 4px.
|
|
683
|
+
wid = Widget()
|
|
684
|
+
with wid.canvas:
|
|
685
|
+
Color(1, 1, 1, 0.5)
|
|
686
|
+
rect = SmoothRectangle(pos=(100, 100), size=(150, -3))
|
|
687
|
+
r(wid)
|
|
688
|
+
assert rect.antialiasing_line_points == []
|
|
689
|
+
|
|
690
|
+
wid = Widget()
|
|
691
|
+
with wid.canvas:
|
|
692
|
+
Color(1, 1, 1, 0.5)
|
|
693
|
+
rect = SmoothRectangle(pos=(100, 100), size=(3.99, 3.99))
|
|
694
|
+
r(wid)
|
|
695
|
+
assert rect.antialiasing_line_points == []
|
|
696
|
+
|
|
697
|
+
def test_smoothroundedrectangle(self):
|
|
698
|
+
from kivy.uix.widget import Widget
|
|
699
|
+
from kivy.graphics import Color, SmoothRoundedRectangle
|
|
700
|
+
|
|
701
|
+
r = self.render
|
|
702
|
+
|
|
703
|
+
wid = Widget()
|
|
704
|
+
with wid.canvas:
|
|
705
|
+
Color(1, 1, 1, 0.5)
|
|
706
|
+
rounded_rect = SmoothRoundedRectangle(
|
|
707
|
+
pos=(100, 100),
|
|
708
|
+
size=(150, 150),
|
|
709
|
+
radius=[(10, 50), (100, 50), (0, 150), (200, 50)],
|
|
710
|
+
segments=60,
|
|
711
|
+
)
|
|
712
|
+
r(wid)
|
|
713
|
+
filtered_points = self._filtered_points(rounded_rect.points)
|
|
714
|
+
assert (
|
|
715
|
+
rounded_rect.antialiasing_line_points
|
|
716
|
+
== filtered_points + filtered_points[:2]
|
|
717
|
+
)
|
|
718
|
+
|
|
719
|
+
# test if antialiasing is disabled if the graphic has one of its
|
|
720
|
+
# dimensions decreased to less than 4px.
|
|
721
|
+
rounded_rect.size = (150, -2)
|
|
722
|
+
r(wid)
|
|
723
|
+
assert rounded_rect.antialiasing_line_points == []
|
|
724
|
+
|
|
725
|
+
rounded_rect.size = (150, 2)
|
|
726
|
+
r(wid)
|
|
727
|
+
assert rounded_rect.antialiasing_line_points == []
|
|
728
|
+
|
|
729
|
+
# re-enable antialiasing line rendering.
|
|
730
|
+
rounded_rect.size = (150, 150)
|
|
731
|
+
r(wid)
|
|
732
|
+
assert (
|
|
733
|
+
rounded_rect.antialiasing_line_points
|
|
734
|
+
== filtered_points + filtered_points[:2]
|
|
735
|
+
)
|
|
736
|
+
|
|
737
|
+
# disabling antialiasing.
|
|
738
|
+
rounded_rect.texture = self._get_texture()
|
|
739
|
+
r(wid)
|
|
740
|
+
assert rounded_rect.antialiasing_line_points == []
|
|
741
|
+
|
|
742
|
+
# re-enable antialiasing.
|
|
743
|
+
rounded_rect.source = ""
|
|
744
|
+
r(wid)
|
|
745
|
+
assert (
|
|
746
|
+
rounded_rect.antialiasing_line_points
|
|
747
|
+
== filtered_points + filtered_points[:2]
|
|
748
|
+
)
|
|
749
|
+
|
|
750
|
+
wid = Widget()
|
|
751
|
+
with wid.canvas:
|
|
752
|
+
Color(1, 1, 1, 0.5)
|
|
753
|
+
rounded_rect = SmoothRoundedRectangle(
|
|
754
|
+
pos=(100, 100), size=(150, 150), segments=0
|
|
755
|
+
)
|
|
756
|
+
r(wid)
|
|
757
|
+
filtered_points = self._filtered_points(rounded_rect.points)
|
|
758
|
+
assert (
|
|
759
|
+
rounded_rect.antialiasing_line_points
|
|
760
|
+
== filtered_points + filtered_points[:2]
|
|
761
|
+
)
|
|
762
|
+
|
|
763
|
+
# test if antialiasing is disabled if the graphic is initialized with
|
|
764
|
+
# at least one of its dimensions less than 4px.
|
|
765
|
+
wid = Widget()
|
|
766
|
+
with wid.canvas:
|
|
767
|
+
Color(1, 1, 1, 0.5)
|
|
768
|
+
rounded_rect = SmoothRoundedRectangle(
|
|
769
|
+
pos=(100, 100), size=(150, -3)
|
|
770
|
+
)
|
|
771
|
+
r(wid)
|
|
772
|
+
assert rounded_rect.antialiasing_line_points == []
|
|
773
|
+
|
|
774
|
+
wid = Widget()
|
|
775
|
+
with wid.canvas:
|
|
776
|
+
Color(1, 1, 1, 0.5)
|
|
777
|
+
rounded_rect = SmoothRoundedRectangle(
|
|
778
|
+
pos=(100, 100), size=(3.99, 3.99)
|
|
779
|
+
)
|
|
780
|
+
r(wid)
|
|
781
|
+
assert rounded_rect.antialiasing_line_points == []
|
|
782
|
+
|
|
783
|
+
def test_smoothellipse(self):
|
|
784
|
+
from kivy.uix.widget import Widget
|
|
785
|
+
from kivy.graphics import Color, SmoothEllipse
|
|
786
|
+
|
|
787
|
+
r = self.render
|
|
788
|
+
|
|
789
|
+
wid = Widget()
|
|
790
|
+
with wid.canvas:
|
|
791
|
+
Color(1, 1, 1, 0.5)
|
|
792
|
+
ellipse = SmoothEllipse(pos=(100, 100), size=(150, 150))
|
|
793
|
+
r(wid)
|
|
794
|
+
ellipse_center = [
|
|
795
|
+
ellipse.pos[0] + ellipse.size[0] / 2,
|
|
796
|
+
ellipse.pos[1] + ellipse.size[1] / 2,
|
|
797
|
+
]
|
|
798
|
+
filtered_points = self._filtered_points(
|
|
799
|
+
ellipse.points + ellipse_center
|
|
800
|
+
)
|
|
801
|
+
assert (
|
|
802
|
+
ellipse.antialiasing_line_points
|
|
803
|
+
== filtered_points + filtered_points[:2]
|
|
804
|
+
)
|
|
805
|
+
|
|
806
|
+
# test if antialiasing is disabled if the graphic has one of its
|
|
807
|
+
# dimensions decreased to less than 4px
|
|
808
|
+
ellipse.size = (150, -2)
|
|
809
|
+
r(wid)
|
|
810
|
+
assert ellipse.antialiasing_line_points == []
|
|
811
|
+
|
|
812
|
+
ellipse.size = (150, 2)
|
|
813
|
+
r(wid)
|
|
814
|
+
assert ellipse.antialiasing_line_points == []
|
|
815
|
+
|
|
816
|
+
# re-enable antialiasing line rendering.
|
|
817
|
+
ellipse.size = (150, 150)
|
|
818
|
+
r(wid)
|
|
819
|
+
assert (
|
|
820
|
+
ellipse.antialiasing_line_points
|
|
821
|
+
== filtered_points + filtered_points[:2]
|
|
822
|
+
)
|
|
823
|
+
|
|
824
|
+
# disabling antialiasing.
|
|
825
|
+
ellipse.texture = self._get_texture()
|
|
826
|
+
r(wid)
|
|
827
|
+
assert ellipse.antialiasing_line_points == []
|
|
828
|
+
|
|
829
|
+
# re-enable antialiasing.
|
|
830
|
+
ellipse.source = ""
|
|
831
|
+
r(wid)
|
|
832
|
+
assert (
|
|
833
|
+
ellipse.antialiasing_line_points
|
|
834
|
+
== filtered_points + filtered_points[:2]
|
|
835
|
+
)
|
|
836
|
+
|
|
837
|
+
wid = Widget()
|
|
838
|
+
with wid.canvas:
|
|
839
|
+
Color(1, 1, 1, 0.5)
|
|
840
|
+
ellipse = SmoothEllipse(
|
|
841
|
+
pos=(100, 100), size=(150, 150), angle_start=90, angle_end=-120
|
|
842
|
+
)
|
|
843
|
+
r(wid)
|
|
844
|
+
ellipse_center = [
|
|
845
|
+
ellipse.pos[0] + ellipse.size[0] / 2,
|
|
846
|
+
ellipse.pos[1] + ellipse.size[1] / 2,
|
|
847
|
+
]
|
|
848
|
+
filtered_points = self._filtered_points(
|
|
849
|
+
ellipse.points + ellipse_center
|
|
850
|
+
)
|
|
851
|
+
assert (
|
|
852
|
+
ellipse.antialiasing_line_points
|
|
853
|
+
== filtered_points + filtered_points[:2]
|
|
854
|
+
)
|
|
855
|
+
|
|
856
|
+
# test if antialiasing is disabled if the graphic is initialized with
|
|
857
|
+
# at least one of its dimensions less than 4px.
|
|
858
|
+
wid = Widget()
|
|
859
|
+
with wid.canvas:
|
|
860
|
+
Color(1, 1, 1, 0.5)
|
|
861
|
+
ellipse = SmoothEllipse(pos=(100, 100), size=(150, -3))
|
|
862
|
+
r(wid)
|
|
863
|
+
assert ellipse.antialiasing_line_points == []
|
|
864
|
+
|
|
865
|
+
wid = Widget()
|
|
866
|
+
with wid.canvas:
|
|
867
|
+
Color(1, 1, 1, 0.5)
|
|
868
|
+
ellipse = SmoothEllipse(pos=(100, 100), size=(3.99, 3.99))
|
|
869
|
+
r(wid)
|
|
870
|
+
assert ellipse.antialiasing_line_points == []
|
|
871
|
+
|
|
872
|
+
def test_smoothtriangle(self):
|
|
873
|
+
from kivy.uix.widget import Widget
|
|
874
|
+
from kivy.graphics import Color, SmoothTriangle
|
|
875
|
+
|
|
876
|
+
r = self.render
|
|
877
|
+
|
|
878
|
+
wid = Widget()
|
|
879
|
+
with wid.canvas:
|
|
880
|
+
Color(1, 0, 0, 0.5)
|
|
881
|
+
triangle = SmoothTriangle(
|
|
882
|
+
points=[
|
|
883
|
+
100, 100,
|
|
884
|
+
200, 100,
|
|
885
|
+
150, 200,
|
|
886
|
+
500, 500, 400, 400 # Irrelevant, just for testing purposes
|
|
887
|
+
]
|
|
888
|
+
)
|
|
889
|
+
r(wid)
|
|
890
|
+
filtered_points = self._filtered_points(triangle.points[:6])
|
|
891
|
+
assert (
|
|
892
|
+
triangle.antialiasing_line_points
|
|
893
|
+
== filtered_points + filtered_points[:2]
|
|
894
|
+
)
|
|
895
|
+
|
|
896
|
+
wid = Widget()
|
|
897
|
+
with wid.canvas:
|
|
898
|
+
Color(0, 0, 1, 0.5)
|
|
899
|
+
triangle = SmoothTriangle(
|
|
900
|
+
points=[
|
|
901
|
+
125, 200,
|
|
902
|
+
200, 100,
|
|
903
|
+
100, 100,
|
|
904
|
+
500, 500, 400, 400 # Irrelevant, just for testing purposes
|
|
905
|
+
]
|
|
906
|
+
)
|
|
907
|
+
r(wid)
|
|
908
|
+
filtered_points = self._filtered_points(triangle.points[:6])
|
|
909
|
+
assert (
|
|
910
|
+
triangle.antialiasing_line_points
|
|
911
|
+
== filtered_points + filtered_points[:2]
|
|
912
|
+
)
|
|
913
|
+
|
|
914
|
+
# Test disabling antialiasing if the points are very close.
|
|
915
|
+
wid = Widget()
|
|
916
|
+
with wid.canvas:
|
|
917
|
+
Color(0, 1, 0, 0.5)
|
|
918
|
+
triangle = SmoothTriangle(
|
|
919
|
+
points=[100, 100, 100.5, 100, 100, 100.5]
|
|
920
|
+
)
|
|
921
|
+
r(wid)
|
|
922
|
+
assert triangle.antialiasing_line_points == []
|
|
923
|
+
|
|
924
|
+
# re-enable antialiasing line rendering.
|
|
925
|
+
triangle.points = [125, 200, 200, 100, 100, 100]
|
|
926
|
+
r(wid)
|
|
927
|
+
assert (
|
|
928
|
+
triangle.antialiasing_line_points
|
|
929
|
+
== filtered_points + filtered_points[:2]
|
|
930
|
+
)
|
|
931
|
+
|
|
932
|
+
# disabling antialiasing.
|
|
933
|
+
triangle.texture = self._get_texture()
|
|
934
|
+
r(wid)
|
|
935
|
+
assert triangle.antialiasing_line_points == []
|
|
936
|
+
|
|
937
|
+
# re-enable antialiasing.
|
|
938
|
+
triangle.source = ""
|
|
939
|
+
r(wid)
|
|
940
|
+
assert (
|
|
941
|
+
triangle.antialiasing_line_points
|
|
942
|
+
== filtered_points + filtered_points[:2]
|
|
943
|
+
)
|
|
944
|
+
|
|
945
|
+
def test_smoothquad(self):
|
|
946
|
+
from kivy.uix.widget import Widget
|
|
947
|
+
from kivy.graphics import Color, SmoothQuad
|
|
948
|
+
|
|
949
|
+
r = self.render
|
|
950
|
+
|
|
951
|
+
wid = Widget()
|
|
952
|
+
with wid.canvas:
|
|
953
|
+
Color(1, 0, 0, 0.5)
|
|
954
|
+
quad = SmoothQuad(points=[100, 100, 100, 200, 200, 200, 200, 100])
|
|
955
|
+
r(wid)
|
|
956
|
+
filtered_points = self._filtered_points(quad.points)
|
|
957
|
+
assert (
|
|
958
|
+
quad.antialiasing_line_points
|
|
959
|
+
== filtered_points + filtered_points[:2]
|
|
960
|
+
)
|
|
961
|
+
|
|
962
|
+
wid = Widget()
|
|
963
|
+
with wid.canvas:
|
|
964
|
+
Color(1, 0, 0, 0.5)
|
|
965
|
+
quad = SmoothQuad(points=[200, 100, 200, 200, 100, 200, 100, 100])
|
|
966
|
+
r(wid)
|
|
967
|
+
filtered_points = self._filtered_points(quad.points)
|
|
968
|
+
assert (
|
|
969
|
+
quad.antialiasing_line_points
|
|
970
|
+
== filtered_points + filtered_points[:2]
|
|
971
|
+
)
|
|
972
|
+
|
|
973
|
+
# Test disabling antialiasing if the points are very close.
|
|
974
|
+
wid = Widget()
|
|
975
|
+
with wid.canvas:
|
|
976
|
+
Color(0, 1, 0, 0.5)
|
|
977
|
+
quad = SmoothQuad(
|
|
978
|
+
points=[200, 100, 200, 100.8, 100, 100.8, 100, 100]
|
|
979
|
+
)
|
|
980
|
+
r(wid)
|
|
981
|
+
assert quad.antialiasing_line_points == []
|
|
982
|
+
|
|
983
|
+
# re-enable antialiasing line rendering.
|
|
984
|
+
quad.points = [200, 100, 200, 200, 100, 200, 100, 100]
|
|
985
|
+
r(wid)
|
|
986
|
+
assert (
|
|
987
|
+
quad.antialiasing_line_points
|
|
988
|
+
== filtered_points + filtered_points[:2]
|
|
989
|
+
)
|
|
990
|
+
|
|
991
|
+
# disabling antialiasing.
|
|
992
|
+
quad.texture = self._get_texture()
|
|
993
|
+
r(wid)
|
|
994
|
+
assert quad.antialiasing_line_points == []
|
|
995
|
+
|
|
996
|
+
# re-enable antialiasing.
|
|
997
|
+
quad.source = ""
|
|
998
|
+
r(wid)
|
|
999
|
+
assert (
|
|
1000
|
+
quad.antialiasing_line_points
|
|
1001
|
+
== filtered_points + filtered_points[:2]
|
|
1002
|
+
)
|
|
1003
|
+
|
|
1004
|
+
|
|
1005
|
+
class FBOInstructionTestCase(GraphicUnitTest):
|
|
1006
|
+
|
|
1007
|
+
def test_fbo_pixels(self):
|
|
1008
|
+
from kivy.graphics import Fbo, ClearColor, ClearBuffers, Ellipse
|
|
1009
|
+
|
|
1010
|
+
fbo = Fbo(size=(512, 512))
|
|
1011
|
+
with fbo:
|
|
1012
|
+
ClearColor(0, 0, 0, 1)
|
|
1013
|
+
ClearBuffers()
|
|
1014
|
+
Ellipse(pos=(100, 100), size=(100, 100))
|
|
1015
|
+
fbo.draw()
|
|
1016
|
+
data = fbo.pixels
|
|
1017
|
+
fbo.texture.save('results.png')
|
|
1018
|
+
|
|
1019
|
+
|
|
1020
|
+
class TransformationsTestCase(GraphicUnitTest):
|
|
1021
|
+
|
|
1022
|
+
def test_identity_creation(self):
|
|
1023
|
+
from kivy.graphics import LoadIdentity
|
|
1024
|
+
|
|
1025
|
+
mat = LoadIdentity()
|
|
1026
|
+
self.assertTrue(mat.stack)
|
|
1027
|
+
|
|
1028
|
+
def check_transform_works(self, transform_type):
|
|
1029
|
+
# Normal args
|
|
1030
|
+
transform = transform_type(0, 1, 2)
|
|
1031
|
+
self.assertEqual(transform.x, 0)
|
|
1032
|
+
self.assertEqual(transform.y, 1)
|
|
1033
|
+
self.assertEqual(transform.z, 2)
|
|
1034
|
+
|
|
1035
|
+
# Key word args
|
|
1036
|
+
transform = transform_type(x=0, y=1)
|
|
1037
|
+
self.assertEqual(transform.x, 0)
|
|
1038
|
+
self.assertEqual(transform.y, 1)
|
|
1039
|
+
|
|
1040
|
+
transform = transform_type(x=0, y=1, z=2)
|
|
1041
|
+
self.assertEqual(transform.x, 0)
|
|
1042
|
+
self.assertEqual(transform.y, 1)
|
|
1043
|
+
self.assertEqual(transform.z, 2)
|
|
1044
|
+
|
|
1045
|
+
def test_translate_creation(self):
|
|
1046
|
+
from kivy.graphics import Translate
|
|
1047
|
+
self.check_transform_works(Translate)
|
|
1048
|
+
|
|
1049
|
+
def test_scale_creation(self):
|
|
1050
|
+
from kivy.graphics import Scale
|
|
1051
|
+
self.check_transform_works(Scale)
|
|
1052
|
+
|
|
1053
|
+
|
|
1054
|
+
class CallbackInstructionTest(GraphicUnitTest):
|
|
1055
|
+
|
|
1056
|
+
def test_from_kv(self):
|
|
1057
|
+
from textwrap import dedent
|
|
1058
|
+
from kivy.lang import Builder
|
|
1059
|
+
|
|
1060
|
+
root = Builder.load_string(dedent("""\
|
|
1061
|
+
Widget:
|
|
1062
|
+
canvas:
|
|
1063
|
+
Callback:
|
|
1064
|
+
callback: lambda __: setattr(self, 'callback_test', 'TEST')
|
|
1065
|
+
"""))
|
|
1066
|
+
r = self.render
|
|
1067
|
+
r(root)
|
|
1068
|
+
self.assertTrue(root.callback_test == 'TEST')
|
|
1069
|
+
|
|
1070
|
+
|
|
1071
|
+
@pytest.fixture
|
|
1072
|
+
def widget_verify_thread(request):
|
|
1073
|
+
from kivy.uix.widget import Widget
|
|
1074
|
+
from kivy.config import Config
|
|
1075
|
+
|
|
1076
|
+
original = Config.get('graphics', 'verify_gl_main_thread')
|
|
1077
|
+
Config.set('graphics', 'verify_gl_main_thread', request.param)
|
|
1078
|
+
|
|
1079
|
+
widget = Widget()
|
|
1080
|
+
yield widget, request.param
|
|
1081
|
+
|
|
1082
|
+
Config.set('graphics', 'verify_gl_main_thread', original)
|
|
1083
|
+
|
|
1084
|
+
|
|
1085
|
+
@requires_graphics
|
|
1086
|
+
@pytest.mark.parametrize('widget_verify_thread', ['0', '1'], indirect=True)
|
|
1087
|
+
def test_graphics_main_thread(widget_verify_thread):
|
|
1088
|
+
from kivy.graphics import Color
|
|
1089
|
+
|
|
1090
|
+
widget, verify_thread = widget_verify_thread
|
|
1091
|
+
with widget.canvas:
|
|
1092
|
+
color = Color()
|
|
1093
|
+
color.rgb = .1, .2, .3
|
|
1094
|
+
|
|
1095
|
+
|
|
1096
|
+
@requires_graphics
|
|
1097
|
+
@pytest.mark.parametrize('widget_verify_thread', ['0', '1'], indirect=True)
|
|
1098
|
+
def test_create_graphics_second_thread(widget_verify_thread):
|
|
1099
|
+
from kivy.graphics import Color
|
|
1100
|
+
widget, verify_thread = widget_verify_thread
|
|
1101
|
+
exception = None
|
|
1102
|
+
|
|
1103
|
+
def callback():
|
|
1104
|
+
nonlocal exception
|
|
1105
|
+
try:
|
|
1106
|
+
with widget.canvas:
|
|
1107
|
+
if verify_thread == '1':
|
|
1108
|
+
with pytest.raises(TypeError):
|
|
1109
|
+
Color()
|
|
1110
|
+
else:
|
|
1111
|
+
Color()
|
|
1112
|
+
except BaseException as e:
|
|
1113
|
+
exception = e, sys.exc_info()[2]
|
|
1114
|
+
raise
|
|
1115
|
+
|
|
1116
|
+
thread = Thread(target=callback)
|
|
1117
|
+
thread.start()
|
|
1118
|
+
thread.join()
|
|
1119
|
+
if exception is not None:
|
|
1120
|
+
raise exception[0].with_traceback(exception[1])
|
|
1121
|
+
|
|
1122
|
+
|
|
1123
|
+
@requires_graphics
|
|
1124
|
+
@pytest.mark.parametrize('widget_verify_thread', ['0', '1'], indirect=True)
|
|
1125
|
+
def test_change_graphics_second_thread(widget_verify_thread):
|
|
1126
|
+
from kivy.graphics import Color
|
|
1127
|
+
widget, verify_thread = widget_verify_thread
|
|
1128
|
+
with widget.canvas:
|
|
1129
|
+
color = Color()
|
|
1130
|
+
|
|
1131
|
+
exception = None
|
|
1132
|
+
|
|
1133
|
+
def callback():
|
|
1134
|
+
nonlocal exception
|
|
1135
|
+
try:
|
|
1136
|
+
if verify_thread == '1':
|
|
1137
|
+
with pytest.raises(TypeError):
|
|
1138
|
+
color.rgb = .1, .2, .3
|
|
1139
|
+
else:
|
|
1140
|
+
color.rgb = .1, .2, .3
|
|
1141
|
+
except BaseException as e:
|
|
1142
|
+
exception = e, sys.exc_info()[2]
|
|
1143
|
+
raise
|
|
1144
|
+
|
|
1145
|
+
thread = Thread(target=callback)
|
|
1146
|
+
thread.start()
|
|
1147
|
+
thread.join()
|
|
1148
|
+
if exception is not None:
|
|
1149
|
+
raise exception[0].with_traceback(exception[1])
|