141 Commits

Author SHA1 Message Date
Kovid Goyal
f16e22fbec
Forgot to convert gaps to monotonic_t 2021-01-31 20:58:43 +05:30
Kovid Goyal
19e0406459
Wire up animation state tracking 2021-01-31 20:58:43 +05:30
Kovid Goyal
354d7c2740
... 2021-01-31 20:58:42 +05:30
Kovid Goyal
00edb6058e
Start work on implementing frame transitions
Also ensure that the correct OS Window is current when uploading images
to GPU.
2021-01-31 20:58:42 +05:30
Kovid Goyal
597267d1d0
root frame gap should be set to the gap of the first received frame 2021-01-31 20:58:42 +05:30
Kovid Goyal
b21850dd15
Implement updating of current frame on GPU 2021-01-31 20:58:42 +05:30
Kovid Goyal
5eba754c60
Implement animation control escape codes 2021-01-31 20:58:42 +05:30
Kovid Goyal
b35084062d
Remove old data from cache when re-using image objects 2021-01-31 20:58:42 +05:30
Kovid Goyal
1d20472759
Avoid a cache move when deleting frames 2021-01-31 20:58:42 +05:30
Kovid Goyal
c0e336a971
DRYer 2021-01-31 20:58:42 +05:30
Kovid Goyal
d76e757d53
Implement delete for frames 2021-01-31 20:58:42 +05:30
Kovid Goyal
43ea58ef48
Start work on delete for frames 2021-01-31 20:58:42 +05:30
Kovid Goyal
17f485d614
Basic frame loading works 2021-01-31 20:58:41 +05:30
Kovid Goyal
35f3312a1e
Use shorter cache keys 2021-01-31 20:58:41 +05:30
Kovid Goyal
ca3c49099f
Start work on tests for frame loading 2021-01-31 20:58:41 +05:30
Kovid Goyal
6631bb0eac
Make the image dict more complete 2021-01-31 20:58:41 +05:30
Kovid Goyal
0adbbc6d62
Implement loading of frame animation data 2021-01-31 20:58:41 +05:30
Kovid Goyal
cc4f9ddad8
More work an animation handling 2021-01-31 20:58:41 +05:30
Kovid Goyal
5a182d3d13
Store image data in a disk cache 2021-01-31 20:58:41 +05:30
Kovid Goyal
d55fde9eea
Use EINTR safe wrappers for open() and shm_open() 2021-01-31 07:02:11 +05:30
Kovid Goyal
d08ae5466d
Dont use a function 2021-01-24 12:57:39 +05:30
Kovid Goyal
dfe41217f8
Start work on allowing images to have multiple frames 2021-01-24 12:37:21 +05:30
Kovid Goyal
4870d07cbb
Refactor handle_add_command to make it more readable 2021-01-24 12:00:35 +05:30
Kovid Goyal
ca65ad6fa3
Inline qsort
Cleaner, more local code and faster sorting by virtue of inlining the
comparisons. What's not to like.
2021-01-04 14:14:15 +05:30
Kovid Goyal
3ac70042c1
Expose grman disk cache to python 2021-01-01 14:19:10 +05:30
Kovid Goyal
3162d391cc
Start work on disk cache 2020-12-29 19:16:21 +05:30
Kovid Goyal
e82a6dedd9
Fix deletion with image numbers 2020-12-16 18:57:46 +05:30
Kovid Goyal
2fd6bf7442
Fix failing test
Error responses must be sent for put commands that refer
non-existent images
2020-12-16 18:41:47 +05:30
Kovid Goyal
d10681f27f
Send responses when only a number and no id is specified 2020-12-16 18:31:30 +05:30
Kovid Goyal
e96ff19a7a
Graphics protocol: Add support for having the terminal emulator assign image ids
Useful when multiple non co-operating programs want to share the screen.
Fixes #3163
2020-12-16 17:31:15 +05:30
Kovid Goyal
23420adfa6
Graphics protocol: Allow suppressing responses from the terminal to graphics commands 2020-12-03 20:42:03 +05:30
Kovid Goyal
c9828dfece
Removed unused parameter 2020-12-03 20:02:16 +05:30
Kovid Goyal
b5e704a934
Graphics protocol: Add support for giving individual image placements their
Fixes #3133
2020-12-02 05:25:19 +05:30
Kovid Goyal
82c137878c
Graphics protocol: Dont return filename in the error message when opening file fails, since filenames can contain control characters
Fixes #3128
2020-11-29 12:02:14 +05:30
Kovid Goyal
c7eb63d4ff
Avoid extra layer update if clearing images has no effect 2020-08-07 09:36:28 +05:30
Kovid Goyal
7f48a927de
Fix image leaving behind a black rectangle when switching away and back to alternate screen
layer_dirty was being reset if remove_images was called more than once
without an intervening call to update_layers.

Fixes #2901
2020-08-06 19:33:28 +05:30
Kovid Goyal
392f576d07
Instrument safe_close() to make it easy to see where an fd is closed from 2020-07-14 20:18:04 +05:30
Kovid Goyal
e678c41f56
More code scanning warning fixes 2020-07-07 10:24:57 +05:30
Kovid Goyal
521f921424
Fix a bunch of code scanning warnings 2020-07-07 09:52:59 +05:30
James McCoy
a94e208db3 Use T_PYSSIZET for GraphicsManager.image_count
GraphicsManager.image_count is declared as a size_t, so the Python type
needs to be the same width.  On 64-bit big-endian architectures, this
mismatch was showing up as test failures:

    ======================================================================
    FAIL: test_gr_delete (kitty_tests.graphics.TestGraphics)
    ----------------------------------------------------------------------
    Traceback (most recent call last):
      File "/<<PKGBUILDDIR>>/kitty_tests/graphics.py", line 319, in test_gr_delete
        self.ae(len(layers(s)), 0), self.ae(s.grman.image_count, 1)
        ch = 20
        cw = 10
        delete = <function TestGraphics.test_gr_delete.<locals>.delete at 0x3ffb7fc38b0>
        dx = 0.2
        dy = 0.4
        layers = <function put_helpers.<locals>.layers at 0x3ffb77709d0>
        put_image = <function put_helpers.<locals>.put_image at 0x3ffb77708b0>
        put_ref = <function put_helpers.<locals>.put_ref at 0x3ffb7770940>
        rect_eq = <function put_helpers.<locals>.rect_eq at 0x3ffb7770a60>
        s = <fast_data_types.Screen object at 0x1b60df0>
        self = <kitty_tests.graphics.TestGraphics testMethod=test_gr_delete>
    AssertionError: 0 != 1
2020-04-25 23:25:18 -04:00
Kovid Goyal
e2339697b9
Fix #2449 2020-03-19 17:22:58 +05:30
Luflosi
5c83f45bc6
Fix memory leak when realloc() fails 2020-02-20 10:54:10 +01:00
Kovid Goyal
9bf24bdff5
Cleanup png_path_to_bitmap() 2020-01-31 09:46:16 +05:30
Fredrick Brennan
8a6b8b415c More stylistic fixes 2020-01-31 09:48:28 +08:00
Fredrick Brennan
aaaa34e119 Move a bunch of unneeded stuff 2020-01-30 18:08:25 +08:00
Fredrick Brennan
6627586d6e Fix pedantic compiler test 2020-01-30 17:31:37 +08:00
Fredrick Brennan
9f364209af Add background_image 2020-01-30 17:23:42 +08:00
Fredrick Brennan
8020657d8c
Allow drawing images below cells w/background 2020-01-11 16:56:59 +05:30
Luflosi
f3b9ff5f9f
Use datatype monotonic_t instead of double to keep track of time
The time is stored in a signed 64 bit integer with nanosecond accuracy. This eliminates the possibility of floating-point inaccuracies.
`monotonic_t` can currently hold values large enough to work correctly for more than 200 years into the future.
Using a typedef instead of directly using `int64_t` everywhere will also allow easily changing the datatype in the future should the need arise for more precise or bigger time values.
2019-09-25 17:43:11 +02:00
Kovid Goyal
49429b5f49
When zeroing memory, use type independent code
Reduces the potential for bugs
2019-07-23 10:54:10 +05:30