Commit Graph

650 Commits

Author SHA1 Message Date
Pietro Gagliardi cac4cd9e81 Cleaned up stylistic nits and common branch naming issues on the new uiTimer() code. Also switched the Windows code to use a simple struct instead of the class (and with a uipriv name). 2018-04-18 21:04:12 -04:00
Pietro Gagliardi 85a4c6d35d
Merge pull request #277 from cody271/timer
Adds a function uiTimer() that runs code on the main loop at certain intervals.

Original comment: Add Timer API
2018-04-18 20:52:59 -04:00
Pietro Gagliardi 52dc39a553 Decided to keep attrstr.h for now; removed extern "C" hack from attrstr.hpp on Windows and moved it into attrstr.h. Let's merge back. 2018-04-18 00:54:24 -04:00
cody271 d99549ec18 uiTimer() Use TimerHandler pointers directly as Windows timer IDs 2018-04-16 17:28:13 -07:00
cody271 c9d11a85cc uiTimer() Refactor TimerHandler for Windows timer IDs 2018-04-16 17:28:13 -07:00
cody271 4e6adca08c uiTimer() Ensure Windows timer IDs are unique 2018-04-16 17:28:13 -07:00
cody271 b1210165a0 Implement uiTimer() for Windows 2018-04-16 17:28:13 -07:00
cody271 27b8ce1db3 Add uiTimer() API and example 2018-04-16 17:28:12 -07:00
Pietro Gagliardi fcc26ab9a9 Fixed a serious bug in windows/utf16.cpp that went unnoticed for this long: we wanted utf16UTF8Count(), not utf16RuneCount(), in toUTF8(); any non-ASCII text had the wrong number of bytes, and thus random heap corruption. The string "鎿嶄綔鎴愬姛瀹屾垚銆" (taken from the completely unrelated #337) and the Set Button Text button was enough to trigger this. 2018-04-15 23:10:11 -04:00
Pietro Gagliardi c3992cc647 uipriv-ized utf.c. 2018-04-15 23:08:57 -04:00
Pietro Gagliardi 8e2004cf67 struct graphemes -> uiprivGraphemes. Also deleted OLD_uipriv.h now that that one is settled. 2018-04-15 22:43:14 -04:00
Pietro Gagliardi 01d6422664 Added uipriv prefixes to the matrix functions. 2018-04-15 22:39:34 -04:00
Pietro Gagliardi 24a4b0997c fromScancode() -> uiprivFromScancode(). 2018-04-15 22:31:17 -04:00
Pietro Gagliardi 0dddf4a490 clickCounter -> uiprivClickCounter. 2018-04-15 22:26:51 -04:00
Pietro Gagliardi f5be05f143 shouldQuit() -> uiprivShouldQuit(). 2018-04-15 21:54:46 -04:00
Pietro Gagliardi f93973d3cb Migrated implbug() and userbug() to uipriv forms. 2018-04-15 21:46:08 -04:00
Pietro Gagliardi c6bb463692 uiAlloc() et al -> uiprivAlloc() et al, Windows code. 2018-04-15 18:12:58 -04:00
Pietro Gagliardi 4a57b15d09 Renamed the common options variable to uiprivOptions. 2018-04-15 15:49:45 -04:00
Pietro Gagliardi 93f0eea140 Likewise codified uiprivStricmp(). Honestly this will probably do for the Windows code for now... 2018-03-17 23:22:17 -04:00
Pietro Gagliardi 8709838a8f Added a uiFreeFontButtonFont() function to free resources allocated by uiFontButtonFont(), implemented it on Windows, and integrated it into the drawtext example. I'm going to continue chipping away at the Windows code for a bit longer, so I'll add this to the other platforms later. 2018-03-17 23:07:40 -04:00
Pietro Gagliardi 78e0684435 Cleaned up memory management in windows attrstr.cpp; also got rid of the logHRESULT(HELP) I was using in case DirectWrite doesn't return NULL+S_OK on a nonexistent drawing effect (thankfully it does). 2018-03-17 21:26:34 -04:00
Pietro Gagliardi fa293717af Removed the NumLines and LineByteRange functions for now; I'll count them under extents. 2018-03-17 21:05:05 -04:00
Pietro Gagliardi d358e87583 Moved the old metrics attrstr code out of the way. 2018-03-17 21:00:11 -04:00
Pietro Gagliardi 45d11962b1 Turns out there was only one real runtime bug (a bad castee). It works! Now to clean up. 2018-03-17 16:10:11 -04:00
Pietro Gagliardi a5bbc83359 Fixed build errors. Now to test. 2018-03-17 15:49:00 -04:00
Pietro Gagliardi 2f02836181 Fixed attrstr.cpp. Wow, that unordered_map custom hash and equal_to actually compiles! 2018-03-17 15:29:06 -04:00
Pietro Gagliardi 51952b4599 And fixed the CMakeLists.txt. Now to build. 2018-03-17 14:50:10 -04:00
Pietro Gagliardi cdaf49ec30 And quick and dirty migration of fontdialog.cpp back. Okay, after fixing the CMakeLists.txt, let's see how bad this is. 2018-03-17 14:47:20 -04:00
Pietro Gagliardi e08460adc3 Cleanup from the previous commit. 2018-03-17 14:45:45 -04:00
Pietro Gagliardi 8352cd72b8 "Migrated" dwrite.cpp back. Not much to say here; it'll do for now. 2018-03-17 14:44:38 -04:00
Pietro Gagliardi 1d1b6c3162 Migrated fontbutton.cpp back. 2018-03-16 20:06:23 -04:00
Pietro Gagliardi 1b1d609c88 More migrations of attrstr.cpp and drawtext.cpp. My this is a mess :D 2018-03-14 21:08:19 -04:00
Pietro Gagliardi 5314295e4c Started migrating drawtext.cpp. This is a bigger mess than I was hoping for... 2018-03-13 22:56:30 -04:00
Pietro Gagliardi 5282951681 Oops, self -> this. 2018-03-13 22:06:33 -04:00
Pietro Gagliardi f25b8dce37 Finished migrating attrstr.cpp. 2018-03-13 22:01:15 -04:00
Pietro Gagliardi 12e97a1b29 Started migrating attrstr.cpp, using the same techniques as attrstr.m. 2018-03-13 18:43:32 -04:00
Pietro Gagliardi abc6fd2825 uiDrawFontDescriptor -> uiFontDescriptor. 2018-03-11 22:36:31 -04:00
Pietro Gagliardi 86264d32a0 And migrated the IDWriteFont -> uiFontDescriptor code. 2018-03-11 22:17:16 -04:00
Pietro Gagliardi 1f61fb30de Wrote a fontmatch.cpp. 2018-03-11 22:11:19 -04:00
Pietro Gagliardi 6c95ce849a Migrated graphemes.cpp and opentype.cpp back. 2018-03-11 21:17:39 -04:00
Pietro Gagliardi e020ba465a Moved the old Windows text code out of the way. 2018-03-11 21:04:38 -04:00
Pietro Gagliardi e768293b54 Merge branch 'master' into utflib-and-attrstr 2018-02-17 22:30:01 -05:00
Pietro Gagliardi 6c85f39584 Improved the comment in the previous commit. 2018-02-17 12:56:47 -05:00
Alexander Neumann ee87a9db23 Fix enter/escape crashes on Windows (#202)
* Do not let slip through IDOK and IDCANCEL as menu events, fixes #55

* Add comment about IDOK and IDCANCEL
2018-02-17 12:53:32 -05:00
Pietro Gagliardi 1f33ca14d8 Fixed Windows build issues and resolved a question in libui that I need to enshrine in documentation next. 2017-11-04 21:44:28 -04:00
Pietro Gagliardi b98888a628 More TODOs. 2017-08-20 05:30:36 -04:00
Pietro Gagliardi 5d7128781b And const-corrected uiAttributedStringForEachAttribute(). 2017-06-19 21:45:18 -04:00
Pietro Gagliardi 3e20e4670c Made a decision on const correctness in uiOpenTypeFeatures. 2017-06-19 14:50:03 -04:00
Pietro Gagliardi e6ee2b0dbd Some TODO elminiation (for once). One TODO got reshuffled. 2017-06-18 20:10:42 -04:00
Pietro Gagliardi cc8a412687 More TODOs. 2017-06-17 17:15:32 -04:00