Commit Graph
100 Commits
Author SHA1 Message Date
josh d6b3810a3c Split some PieceTable::Cursor functionality into PieceTable::Iterator 2016-08-27 15:20:08 -04:00
josh f659c14242 add Encoding::decode() 2016-08-15 22:14:47 -04:00
josh b2bed71ee4 add Encoding::beginning_of_code_point() 2016-08-11 23:13:32 -04:00
josh 1aa9fb0c41 add Encoding::num_bytes_in_code_point() 2016-08-11 23:08:21 -04:00
josh 490505faa1 detect file encoding when loading it 2016-08-11 20:11:13 -04:00
josh c4253078a9 add Encoding class 2016-08-11 20:03:53 -04:00
josh 3c5a7b7341 add initial cursor movement support 2016-08-08 22:40:47 -04:00
josh 81e6a53c08 add PieceTable.tabstop attribute 2016-08-04 22:42:27 -04:00
josh f6338da8d0 add PieceTable::Cursor::operator*(), add unit test 2016-08-04 22:38:18 -04:00
josh abf853e1ba link from a piece table cursor object back to the containing piece table 2016-08-04 22:19:13 -04:00
josh 728e389c1e add column to a PieceTable::Cursor 2016-08-01 22:02:42 -04:00
josh 11cac3c8b5 add a PieceTable::Cursor to Window 2016-08-01 22:02:42 -04:00
josh e913c15212 remove number of characters from a Piece 2016-08-01 22:02:42 -04:00
josh b0553fdbd2 adjust font vertical position by baseline offset 2016-07-31 23:11:26 -04:00
josh 5a942a61a9 add FlatShader; draw a cursor 2016-07-31 23:08:26 -04:00
josh 8beea3461c Rework PieceTable cursor management
- rename PieceTable::Position -> PieceTable::Cursor
- remove built-in cursor
- add PieceTable::add_cursor()
2016-07-31 22:11:12 -04:00
josh a5bfcdd3c4 remove PieceTable::ChangeDescriptor 2016-07-31 20:51:06 -04:00
josh 887fb4b980 use scoped enum instead of #define 2016-07-30 09:54:30 -04:00
josh 7064afc1f1 rename PieceDescriptor to just Piece 2016-07-30 09:52:46 -04:00
josh cef49e9e6e rename OpenGL "programs" to "shaders" 2016-07-29 21:27:32 -04:00
josh b61513b97e add PieceTable::get_start_of_line() 2016-07-29 21:19:01 -04:00
josh d043137099 Window: calculate m_rows 2016-07-29 21:12:54 -04:00
josh 862b414c1d Window: rename m_chars_per_line -> m_columns 2016-07-29 21:06:28 -04:00
josh dc71520a88 PieceTable: rename m_cursor_position -> cursor_position 2016-07-29 21:04:48 -04:00
josh 89c0ca0bfa add a cursor position attribute to PieceTable 2016-07-28 21:48:18 -04:00
josh 26f8fb355e allow File::write() to take a Span 2016-07-26 22:40:04 -04:00
josh 382d155e40 add LineEndings module 2016-07-26 22:36:22 -04:00
josh cdae9e51ae add Span class and use it from TextLoader 2016-07-26 21:09:33 -04:00
josh b64b9bed23 begin restructuring keyboard event handling more permanently 2016-07-24 22:45:28 -04:00
josh 31422709e8 Wrap lines 2016-07-24 20:35:01 -04:00
josh 10a0b33dbe Add Buffer unit tests
- test that writing a buffer with no changes results in the identical
  file being written
2016-07-24 17:25:21 -04:00
josh 63b3848424 Preserve whether there is a EOL at EOF when writing the file 2016-07-24 17:24:00 -04:00
josh e66130b603 fix File::open() when opening for writing 2016-07-24 17:16:05 -04:00
josh a416a47b29 add Buffer::write_to_file() 2016-07-24 12:50:27 -04:00
josh 1730838921 add File::write() 2016-07-24 12:37:34 -04:00
josh 0aad4fd779 GUI: avoid segfault when trying to scroll an empty buffer 2016-07-24 12:28:58 -04:00
josh 0780659c8c Buffer: keep track of eol_at_eof flag from TextLoader 2016-07-24 12:27:15 -04:00
josh 7093560a94 Support loading files that do not end with a EOL sequence
- do not drop the last line of such files from TextLoader
- add a flag to TextLoader to indicate if the loaded file ended with a
  EOL sequence
2016-07-24 12:22:03 -04:00
josh 89e8dc5de3 add TextLoader::get_eol_at_eof() 2016-07-24 12:06:50 -04:00
josh 500a6891d4 remove Text module 2016-07-19 22:35:51 -04:00
josh 20a2786755 Render from the piece table! 2016-07-19 22:34:11 -04:00
josh e52710b47c add PieceTable::append_initial_line_piece() 2016-07-19 21:31:06 -04:00
josh 8fcbad02f8 Update PieceDescriptor structure - use direct pointers for list links 2016-07-18 22:32:45 -04:00
josh ebf92f07ac drop const in TextLoader line pointer 2016-07-18 22:07:29 -04:00
josh aa45f6d6dc Add a PieceTable to Buffer 2016-07-18 22:04:57 -04:00
josh 2805ac36d3 add PieceTable::start_descriptor and PieceTable::end_descriptor 2016-07-18 22:02:56 -04:00
josh 793bc46293 add PieceTable::add_piece_descriptor() and set up start/end descriptors 2016-07-18 22:01:33 -04:00
josh b30b6eb202 Start on PieceTable 2016-07-17 23:05:02 -04:00
josh 7e8b5c0b64 Allow PagedBuffer to hold non-power-of-2-sized objects 2016-07-17 21:55:29 -04:00
josh cab874305f add PagedBuffer; use own main() for tests 2016-07-17 20:43:18 -04:00
josh 3be19dbf81 implement TextLoader tests, add TestSupport module 2016-07-16 21:28:29 -04:00
josh 181d3ad64a Avoid signed and unsigned comparison 2016-07-15 19:58:01 -04:00
josh f9b42b4079 add "test" Makefile target 2016-07-15 19:42:48 -04:00
josh a2bd7504b5 replace FileLoader with TextLoader 2016-07-14 21:28:38 -04:00
josh cae0b581a2 Buffer owns the file buffer 2016-07-14 20:09:35 -04:00
josh 5f8bbcfca4 start a Timer when it is created 2016-07-14 19:27:39 -04:00
josh e562f77dab replace FileReader with File class; prepare for removing FileLoader 2016-07-14 18:44:18 -04:00
josh 5a8894498b add System::free_pages() 2016-07-14 18:42:26 -04:00
josh ef6abd8ed7 Add other useful page-size-related fields to System module 2016-07-14 17:51:53 -04:00
josh 48e82a11a3 add initial System module 2016-07-13 21:41:30 -04:00
josh 5bcd55ba97 add custom key repeat handler to allow for user-configurable, mode-dependent key repeats 2016-07-10 21:23:49 -04:00
josh dd7a5de619 add Timer 2016-07-10 20:42:38 -04:00
josh b1684f1341 scroll through file with J/K keys 2016-07-10 20:13:40 -04:00
josh d8fcbcd428 render a file's contents 2016-07-10 17:24:00 -04:00
josh 5da9cde758 Buffer: hold on to the FileLoader for now so the memory is not released 2016-07-10 17:23:30 -04:00
josh f31fac64ba disable scissor test 2016-07-10 17:02:21 -04:00
josh 3fdc113b5f add Font::get_line_height() 2016-07-10 16:31:32 -04:00
josh eacfe407b4 just use plain white for now 2016-07-10 16:31:23 -04:00
josh 4c7934e133 build with -O2 2016-07-10 16:27:31 -04:00
josh 6cf59fa7d7 draw some test text in Window for now 2016-07-10 16:26:37 -04:00
josh d2f39cbddc add TextProgram 2016-07-10 16:21:58 -04:00
josh 54b7e302d0 bind the Glyph texture when rendering the Glyph 2016-07-08 21:04:49 -04:00
josh c147cbad3f add Font::get_advance() 2016-07-08 21:01:20 -04:00
josh f31c1c2532 tweak wscript: avoid define for having header; rename freetype2 uselib_store 2016-07-08 20:45:31 -04:00
josh 207178abba update waf to v1.9.1 2016-07-08 20:42:47 -04:00
josh 5b36a220f7 fix Window::handle_event() comment 2016-07-08 19:44:33 -04:00
josh bd1f1bd655 add APPNAME and VERSION defines 2016-07-08 19:12:52 -04:00
josh 40b6518ea4 remove GL module 2016-07-08 18:44:27 -04:00
josh ea6613a891 change shaders to #version 130 2016-07-07 21:23:47 -04:00
josh a08bc144e2 Add initial Runtime module 2016-07-06 23:09:53 -04:00
josh ff51d17344 add Path::listdir() 2016-07-06 22:41:43 -04:00
josh 5df998661b rename runtime -> share/jes 2016-07-06 22:41:43 -04:00
josh 725a0f22a1 allow Path::join() to take an arbitrary number of arguments 2016-07-06 22:41:42 -04:00
josh 2012591b27 add Path::is_file() and Path::is_dir() 2016-07-06 19:40:35 -04:00
josh 1f9a981e6a add initial Path class 2016-07-06 19:21:35 -04:00
josh b58c344604 rename FileReader::load() -> FileReader::read() 2016-07-05 19:10:32 -04:00
josh 1e140f9229 add "text" shader 2016-07-05 19:06:06 -04:00
josh e9973a53c9 add freefont and dejavu fonts to runtime files 2016-07-05 09:54:50 -04:00
josh 98fcfdbc04 add initial Font class 2016-07-05 08:41:07 -04:00
josh d37ac4494a add Glyph class 2016-07-04 21:10:25 -04:00
josh 761078924a check for and use freetype2 2016-07-04 21:08:19 -04:00
josh 35a2b99970 create a Window on application startup 2016-07-01 19:32:09 -04:00
josh ecc2d3ce35 add initial Window class 2016-07-01 19:21:02 -04:00
josh e9316dfaf7 check for and build with SDL2 2016-07-01 19:20:48 -04:00
josh 1a9cee9e9a minor wscript cleanup 2016-06-30 21:54:06 -04:00
josh 6d6988c027 expose line iteration in Buffer API 2016-06-29 22:03:40 -04:00
josh fdcba81a3d most rudimentary Buffer class imaginable 2016-06-29 20:54:08 -04:00
josh 1636ee1728 add FileLoader::get_line() 2016-06-29 20:18:33 -04:00
josh 9adcd93fd3 get a temporary Text class in place 2016-06-29 20:05:59 -04:00
josh db6fe2b115 add LICENSE 2016-06-21 21:00:02 -04:00