Commit Graph

342 Commits

Author SHA1 Message Date
Pietro Gagliardi df190dc368 Templatized this. I feel dirty. 2016-04-21 11:22:34 -04:00
Pietro Gagliardi 87c2c4f3f7 "Moved" events.c to C++. 2016-04-20 22:10:04 -04:00
Pietro Gagliardi b9384c0e32 Quick fixes to the previous commit. 2016-04-20 20:21:57 -04:00
Pietro Gagliardi 6b7b5de743 Migrated alloc.c to C++. This is working already :v 2016-04-20 20:20:10 -04:00
Pietro Gagliardi 55116199ac Pruned, organized, and formatted winapi.hpp. 2016-04-20 19:51:30 -04:00
Pietro Gagliardi a7ff1e7c78 Moved the files that are already C++ out of the way so we can migrate them later and separate them from the already-migrated files. 2016-04-20 19:41:14 -04:00
Pietro Gagliardi 09c1a62a8e Moved most of the headers to C++. 2016-04-20 19:39:20 -04:00
Pietro Gagliardi 655e05463d Implemented the new font button stuff on Windows. 2016-04-20 14:17:55 -04:00
Pietro Gagliardi 721269b3eb Implemented colored text on OS X and Windows. 2016-04-19 18:45:16 -04:00
Pietro Gagliardi 5b74b2752e Decided to use character offsets instead of byte offsets for text layout attributes. This removes the shaky code from the OS X and Windows backends to compute a list of character offsets for byte offsets. The equivalent code for GTK+ to convert chars to bytes will be much more solid; it will be written next. 2016-04-19 14:39:33 -04:00
Pietro Gagliardi a1d0e669c8 Added some helpers for actually returning a font from the font button on Windows. Similar helpers are needed on other platforms. 2016-04-18 19:18:29 -04:00
Pietro Gagliardi 861b5f22df Finished changing the Windows font dialog and uiFontButton to manipulate IDWriteFonts directly. 2016-04-18 17:14:33 -04:00
Pietro Gagliardi b19a8c9c46 Okay, I made a mistake: we want uiFontButton to return uiDrawFonts, not uiDrawFontDescriptors. Started the work to change the Windows one likewise. 2016-04-18 15:31:52 -04:00
Pietro Gagliardi ccfa3d41a3 More work on the initial font and showing styles. I have a feeling my current approach is a mistake. 2016-04-18 13:32:48 -04:00
Pietro Gagliardi 4d025172fe And brought the new font out of the font dialog and into the font button. We should be good now... 2016-04-18 01:12:25 -04:00
Pietro Gagliardi dcbbced23b Implemented loading of the font dialog font. Now to save it too. 2016-04-18 00:56:13 -04:00
Pietro Gagliardi 97aad9a039 Added support routines for migrating DirectWrite attributes. 2016-04-18 00:41:17 -04:00
Pietro Gagliardi 7cf8420682 Hooked the Windows font button and font dialog together at last. More TODOs. Now we just need to actually convert everything to DirectWrite and implement the label. 2016-04-17 22:09:18 -04:00
Pietro Gagliardi 40d673fb01 Implemented the correct behavior for the initial display of the size combobox of the font dialog. At this point we can move straight to manipulating the uiDrawFontDescriptors. 2016-04-17 21:11:55 -04:00
Pietro Gagliardi 0e75a6f950 Properly implemented the size combobox. We're so close! 2016-04-17 20:10:14 -04:00
Pietro Gagliardi 39ea7e269f Implemented nearest style matches when changing families. Wow we're actually almost done here! 2016-04-17 19:37:03 -04:00
Pietro Gagliardi 156fae7bbb Implemented events and type-to-select for the Style combobox. 2016-04-17 19:22:37 -04:00
Pietro Gagliardi aa6778acbe Implemented type-to-search in the font dialog. 2016-04-17 19:03:34 -04:00
Pietro Gagliardi edef521ded Quick TODO resolution. 2016-04-17 16:49:50 -04:00
Pietro Gagliardi d45fdb4a3d Migrated the font dialog from drawing its own sample text to having a D2D scratch control do it. 2016-04-17 13:06:45 -04:00
Pietro Gagliardi 3bb2a0ab21 Added a Direct2D scratch control that will be used by the font and color dialogs we will implement. 2016-04-17 11:53:24 -04:00
Pietro Gagliardi cc7675ab5a More font dialog work: split out all the combobox manipulation functions into their own function, made the current selection part of the structure, made the font families item data to the family combobox, and changed the font face string function to use the dedicated font face string method (thanks Windows 7 ChooseFont sample program). 2016-04-17 01:34:05 -04:00
Pietro Gagliardi 46db0b30ee Oh fixed the font dialog not showing all styles thing; stupid me forgot that a IDWriteFontFamily is also a IDWriteFontList. 2016-04-16 22:46:39 -04:00
Pietro Gagliardi 9a1367c0bc More font dialog work. Ugh if only I could just use the Windows 7 sample code one... 2016-04-16 22:15:19 -04:00
Pietro Gagliardi f3ae17793d Quick compilation fixes. I really don't know what I'm doing right now. 2016-04-16 19:25:21 -04:00
Pietro Gagliardi ecbdddb703 More sample work. Ugh this is a mess I should just use Direct2D after all. 2016-04-16 19:07:17 -04:00
Pietro Gagliardi 351fc59b9f Started work on previewing samples of fonts in the new font dialog. This adds all the boilerplate, including sample positioning. Also tightens up the dialog a bit. Now just to implement the actual drawing. 2016-04-16 17:58:45 -04:00
Pietro Gagliardi 23ec771c86 Removed uiFontDescriptor.SmallCaps; on Windows this has to be applied to layouts. 2016-04-15 14:23:16 -04:00
Pietro Gagliardi cedb5394b4 Removed the small caps checkbox from the new font dialog. It turns out that the small caps in DirectWrite is applied to a text layout, not a part of a font like it is elsewhere. Do we even still need the custom font dialog? 2016-04-15 13:57:26 -04:00
Pietro Gagliardi 0ad767721d More font dialog stuff. 2016-04-15 13:18:06 -04:00
Pietro Gagliardi fa94298015 Split the function to extract the correct string of an IDWriteLocalizedStrings instance out into its own function. I'm not sure if I'll need the informational strings out of a font (need to see what the strings actually say first), but in case I do, this will help. 2016-04-15 10:15:05 -04:00
Pietro Gagliardi 0bc140cd46 Dropped uiDrawTextGravity. That has to do with vertical text, which we can both abstract into a higher level API and can't do yet because DirectWrite simply does not support vertical text on Windows 7 for reasons that escape logical thought. 2016-04-15 00:24:27 -04:00
Pietro Gagliardi 8ac3c53e0f More fontdialog.cpp work. This is gonna kill me... 2016-04-14 22:40:01 -04:00
Pietro Gagliardi d3c4b0cf4d More work on fontdialog.cpp. 2016-04-14 22:25:32 -04:00
Pietro Gagliardi 97d35571c1 Started writing a replacement for the standard ChooseFont() dialog that uses DirectWrite instead of GDI. 2016-04-14 21:35:50 -04:00
Pietro Gagliardi 88e797e2be Split the DirectWrite boilerplate to another C++ file so we can write a new font dialog with it, maybe. 2016-04-14 19:57:58 -04:00
Pietro Gagliardi edd9b2f133 "Implemented" uiFontButton on Windows. 2016-04-14 17:12:13 -04:00
Pietro Gagliardi 7f2194c383 Typo fixes in the previous commit. 2016-01-24 21:50:10 -05:00
Pietro Gagliardi ab0230b428 Added a function for scrolling uiAreas. Implemented on OS X; stubbed elsewhere. 2016-01-24 21:41:34 -05:00
Pietro Gagliardi a3344f0341 Two important changes to the Windows build:
1) cvtres is no longer used directly. MSDN says to send the .res files to link.exe; that runs cvtres for us (at least it seems to, accoring to Google results for error LNK1158). It'll also avoid some of the weird warnings in cvtres, like CVT4001.

2) (and more important, but it depended on 1) Command-line switches are now passed using - instead of /. This is because some versions of MinGW are buggy and treat anything that starts with a / as a MSYS filename that needs to be converted to a Windows pathname.

Update #16.
2016-01-19 16:40:00 -05:00
Pietro Gagliardi cb8323bee6 Decided that yes, for a single line the leading should not be included. 2016-01-16 18:22:27 -05:00
Pietro Gagliardi 32cc648e13 Diagnosed the root cause of an issue in a TODO; still need to fix it. 2016-01-16 16:48:10 -05:00
Pietro Gagliardi eb6e10350d Implemented the multiline stuff on Windows. Oh boy this is so broken everywhere... 2016-01-16 16:42:33 -05:00
Pietro Gagliardi 06fa877058 Updated an error message. 2016-01-14 03:29:08 -05:00
Pietro Gagliardi 454fabaf2b Implemented metrics on Windows and fixed Unicode conversion in uiDrawNewTextLayout(). 2016-01-13 00:54:52 -05:00