Commit Graph
93 Commits
Author SHA1 Message Date
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
Kovid Goyal d9f90ef077 Make qsort invocations type independent 2019-07-23 10:20:41 +05:30
Kovid Goyal 6a126fa18e Fix a crash when displaying very large number of images
Fixes #1825
2019-07-23 10:18:09 +05:30
Kovid Goyal 14d703f5cc Cleanup 2019-07-23 09:44:58 +05:30
Kovid Goyal 9850025f3a Use image ids instead of pointers when removing images since pointer values are changed by the remove operation 2019-07-23 09:40:41 +05:30
Kovid Goyal 8daab0ba41 Change image internal_id type to id_type 2019-07-23 09:34:04 +05:30
Kovid Goyal c848c3ee0d Use an interrupt-safe close() 2019-07-05 14:39:07 +05:30
Kovid Goyal 6a31909557 Make the MIN and MAX macros typesafe 2019-07-01 17:03:47 +05:30
Kovid Goyal 656916e0fa Use remove_i_from_array in a few more places
Also simplify the REMOVER macro
2019-06-07 14:25:33 +05:30
Kovid Goyal 8b5f02bb0b Fix shader invocation for cells output during resize 2019-03-04 19:54:10 +05:30
Kovid Goyal 11522ccc92 Initial code to show window size in cells while resizing 2019-03-04 19:54:10 +05:30
Kovid Goyal f6b5e54890 Fix failing test 2018-12-11 10:08:52 +05:30
Kovid Goyal d20c65ef80 Graphics protocol: Only delete temporary image-data files if they are in a known temporary file location 2018-12-11 10:00:43 +05:30
Kovid Goyal 2b035739f8 Make the PNG reader code re-useable 2018-07-07 07:46:15 +05:30
Kovid Goyal df9eab279a Implement changing the font size for individual top level (OS) windows 2018-05-27 12:37:49 +05:30
Kovid Goyal 523aadaa3b Refactor font group handling
Allow kitty to manage multiple groups of fonts with different cell
sizes. Will eventually allow kitty to have different font sizes/dpi per
OSWindow
2018-05-27 12:37:05 +05:30
James McCoy 215a7689d9 Correct types for various PyArg_ParseTuple/Py_BuildValue calls
Debian's [mips] build failed one of the font tests:

    FAIL: test_sprite_map (kitty_tests.fonts.Rendering)
    ----------------------------------------------------------------------
    Traceback (most recent call last):
      File "/<<PKGBUILDDIR>>/kitty_tests/fonts.py", line 48, in test_sprite_map
        self.ae(test_sprite_position_for(0, 1), (0, 1, 1))
        self = <kitty_tests.fonts.Rendering testMethod=test_sprite_map>
    AssertionError: Tuples differ: (0, 0, 0) != (0, 1, 1)

    First differing element 1:
    0
    1

    - (0, 0, 0)
    ?     ^  ^

    + (0, 1, 1)
    ?     ^  ^

This was due to test_sprite_position_for() using the "I" code to parse
into an unsigned short.  Since mips is big endian, the "wrong" byte was
stored into extra_glyphs.data.

This commit changes all similar data type mismatches that were found
from auditing calls to PyArg_ParseTuple/Py_BuildValue.

[mips]: https://buildd.debian.org/status/fetch.php?pkg=kitty&arch=mips&ver=0.9.0-1&stamp=1524126606&raw=0
2018-04-20 08:28:26 -04:00
Kovid Goyal 527255e3a1 Fix compilation with gcc 8
Apparently some nitwit Linux distros have made an unreleased compiler
their default compiler. Fixes #376

Fixes various new warnings that GCC 8 issues
2018-03-12 10:38:12 +05:30
Kovid Goyal c7506496da Unify error logging between python and C 2018-03-04 11:55:47 +05:30
Kovid Goyal 1ef010689d Add support for clearing the scrollback buffer
kitty now supports using \E3J to clear the screen and scrollback buffer.
See #268
2018-01-06 23:55:49 +05:30
Kovid Goyal 0fcce6ec58 Remove trailing whitespace from native code files 2017-12-20 08:44:47 +05:30
Kovid Goyal c17c6cae4c Support S8C1T mode
That is, eight bit control codes. When in S8C1T mode, kitty will send
only eight bit control codes to the client.
2017-12-05 20:21:12 +05:30
Kovid Goyal aef8b4ae67 Allow re-use of ensure_space_for macro 2017-11-13 15:29:52 +05:30
Kovid Goyal 8431eef970 Get rid of no longer needed GPU function indirection 2017-11-09 16:45:02 +05:30
Kovid Goyal c1a1b06fe7 Use -Og when building in debug mode 2017-11-08 17:12:35 +05:30
Kovid Goyal 88df0890ae Fix crash when displaying more than 64 images in a single session
Also DRYer
2017-11-07 13:34:31 +05:30
Kovid Goyal 21ed07d7ce Ensure python type objects are declared in onlya single unit 2017-11-01 13:14:50 +05:30
Kovid Goyal 48b98c583e Fix incorrect scrolling of images with specified number of rows 2017-10-16 22:02:55 +05:30
Kovid Goyal 94eaaae4a6 Handle font size changes, rescaling images 2017-10-09 15:15:13 +05:30
Kovid Goyal 3cce238b2b Relayout images on screen resizes
The strategy is very simple, images are not rescaled or re-positioned in
any way.
2017-10-09 12:43:37 +05:30
Kovid Goyal f9b52249d1 Remove unused code 2017-10-09 11:58:25 +05:30
Kovid Goyal f396fe59ca Implement a quota for image data 2017-10-09 11:31:57 +05:30
Kovid Goyal 747f7b076d Implement control code for deleting images 2017-10-08 22:51:00 +05:30
Kovid Goyal d5088a3e5b Do image clipping using OpenGL rather than on the CPU 2017-10-07 10:08:26 +05:30
Kovid Goyal 6a65f23f98 Add a a=q mode for querying without storing image data 2017-10-06 23:43:42 +05:30
Kovid Goyal 31173245f8 Send ACKs to client when displaying images by id 2017-10-06 22:39:17 +05:30
Kovid Goyal d4e493727e Clip all rendered images to screen boundaries 2017-10-06 21:22:52 +05:30
Kovid Goyal a9d31541c1 Implement clipped scrolling of images when in page area mode 2017-10-06 21:08:10 +05:30
Kovid Goyal 600bff73d6 Off-by-one for image visibility testing
Also delete all images that overlap the screen on reset
2017-10-05 22:54:52 +05:30
Kovid Goyal 259e01e879 Add test for deleting images after they scroll off 2017-10-05 21:14:56 +05:30
Kovid Goyal 240c9b5d8b A spot of refactoring 2017-10-05 20:54:45 +05:30
Kovid Goyal 689227dce4 Scroll images with text 2017-10-05 20:23:32 +05:30
Kovid Goyal c3ab6ff780 Fix vertically inverted rendering of PNG 2017-10-04 23:38:36 +05:30
Kovid Goyal 952f0ad98c Accommodate the underpowered Apple lineup
macOS is missing glDrawArraysInstancedBaseInstance
2017-10-04 22:44:03 +05:30
Kovid Goyal 596a392e68 micro optimization 2017-10-04 19:46:19 +05:30
Kovid Goyal 46bb482e96 Fix y-axis mapping incorrect for images 2017-10-04 19:34:34 +05:30
Kovid Goyal 8f05f752af Code to update graphics buffer 2017-10-04 17:41:11 +05:30
Kovid Goyal 1a8d9314fe Fix transmission of chunked compressed data 2017-10-04 10:19:25 +05:30
Kovid Goyal acc43ce9dc Handle T action with chunked transfer correctly 2017-10-03 20:34:48 +05:30