Commit Graph

50 Commits

Author SHA1 Message Date
Pietro Gagliardi 1238936a16 Added Post() and implemented it on Windows. 2014-07-03 11:04:07 -04:00
Pietro Gagliardi 8a81650b3d Moved it all back; the preemptive multitaksing during an event handler kills us on all platforms. Going to have to restrict ALL GUI accss to happening from one t hread, so going to need to drop uitask entirely and have just a start() callback for startup code and a post() function for posting requests to windows (like channel sends but into a perpetual buffer). 2014-07-02 22:53:03 -04:00
Pietro Gagliardi 5d339e656b Moved everything out of the way pending rewrite. 2014-07-02 17:13:40 -04:00
Pietro Gagliardi 3565889e15 Made Window.Closing a callback closure. 2014-06-30 23:48:08 -04:00
Pietro Gagliardi ffa1bbe0b9 Restored the previous new API. I'm going to change it so that events are callbacks rather than using a window handler, but other than that... yeah. 2014-06-30 22:48:12 -04:00
Pietro Gagliardi 33155f7496 Reverted everything back to the old API. 2014-06-30 09:57:44 -04:00
Pietro Gagliardi 9134189f52 Migrated controlsize_windows.go and stdwndclass_windows.go to the new API. 2014-06-28 07:25:42 -04:00
Pietro Gagliardi 6e170ad1db Made a quick comment clarificaiton in stdwndclass_windows.go. 2014-06-25 23:22:47 -04:00
Pietro Gagliardi 1eeadc000a Made the new sizing system work on Windows. 2014-06-25 23:21:57 -04:00
Pietro Gagliardi 09e3fcd9cb More go fmt. 2014-06-10 11:12:32 -04:00
Pietro Gagliardi d4e06bb4d3 Checked Windows RECT usage and fixed wrong ones. 2014-06-08 00:55:11 -04:00
Pietro Gagliardi 4856790299 Fixed the standard window class focus behavior on Windows from the previous commit to work. Also updated the SetFocus() call in area_windows.go to boot and removed the relevant TODO after checking both wine and Windows XP work fine. 2014-06-06 01:49:23 -04:00
Pietro Gagliardi 00ec85dee6 Implemented code to save and restore control focus on Windows properly when switching away from/back to our program. It's disabled for now though because it doesn't seem to work... 2014-06-05 23:27:17 -04:00
Pietro Gagliardi bb44712fad Changed Checkbox on Windows to use BS_CHECKBOX instead of BS_AUTOCHECKBOX; this will be necessary to fix the focus issue in todo.md (see http://blogs.msdn.com/b/oldnewthing/archive/2014/05/22/10527522.aspx). 2014-06-05 18:28:40 -04:00
Pietro Gagliardi 5027a50845 Resolved a TODO in stdwndclass_windows.go about deferring WM_NCCREATE to DefWindowProc(). 2014-06-04 01:17:59 -04:00
Pietro Gagliardi a46668ca22 Migrated stdwndclass_windows.go to the new string handling. 2014-06-03 10:52:53 -04:00
Pietro Gagliardi b13453ad9e Changed storeSysData() on Windows to write the HWND to the sysData structure there. This will be important for removing some of the TODOs from areaWndProc(). 2014-05-30 23:28:41 -04:00
Pietro Gagliardi a3e27bfbd0 Converted the standard Windows window class (for Window) to be a single class, rather than having a new one for each Window. Now for Area. 2014-05-30 21:49:55 -04:00
Pietro Gagliardi e5ec4bb159 Some quick formatting changes to stdwndclass_windows.go. 2014-05-30 18:03:57 -04:00
Pietro Gagliardi 4a66f1467b Moved the standard window class (for Window) on Windows to get the sysData pointer from CreateWindowEx() and store it in the window memory instead of being given it via a closure. This will lead to having only one window class for all Windows, which will come next. Also fixed an error in windowsconstgen's output related to GetWindowLongPtr()/SetWindowLongPtr(). 2014-05-30 17:59:29 -04:00
Pietro Gagliardi c543f5639b Normalized DefWindowProc() handling across the Windows files; the syscall.LazyProc now has the normalized name _defWindowProc and defWindowProc() is a convenience function that calls _defWindowProc properly. This will also be important for the switch to a single window class per Window/Area. 2014-05-30 14:15:32 -04:00
Pietro Gagliardi 51469fffb5 Removed constants from common_windows.go. Almost done! 2014-05-25 15:09:01 -04:00
Pietro Gagliardi b9c12da838 More TODOs (see previous commit). 2014-05-17 17:10:23 -04:00
Pietro Gagliardi 9ed8d9c816 Consistency change: all Windows API structure field names now match case-wise (some were forcibly exported in the past for historical reasons: I originally started package ui by trying to write a Windows API wrapper, but decided to ditch that and just use the Windows API directly from package ui). Also more TODOs. 2014-05-11 11:11:57 -04:00
Pietro Gagliardi 719cab8742 Migrated cursors_windows.go and icons_windows.go. 2014-04-13 13:11:17 -04:00
Pietro Gagliardi 3bf215ae4e Split out the common resizing code into its own function so that it's all in one place. This will also affect what happens if I switch to DeferWindowPos() on Windows. 2014-04-07 14:32:25 -04:00
Pietro Gagliardi d1a41cd95a Corrected a copy-paste fail in stdwndclass_windows.go that broke compilation (this is why you test builds on all platforms, folks!) and added a TODO about resizing on Windows in the meantime. 2014-03-24 11:36:15 -04:00
Pietro Gagliardi 64d5eb541e Changed the new resizing code so that it uses the same allocated slice per window instead of making a new one to store all the resize requests each time. 2014-03-17 21:09:03 -04:00
Pietro Gagliardi 19227080da Changed window resizes so that the actual Control.setRect() functions appended to an array of requests that the resize() function set all at once instead of having each done individually. This will be necessary for what I think will be a solution to the deadlocks. It doesn't work right now; I'm assuming it's allocating too much memory. I know how to fix this, but I'm committing what I have so far to be safe. 2014-03-17 20:42:36 -04:00
Pietro Gagliardi 34ce16d586 Separated file creation dates from the package comment. 2014-03-12 21:55:45 -04:00
Pietro Gagliardi 962a84e056 Fixed Mac OS X control placement flipping. This is done by passing the height of the window around setRect() calls to avoid polling the content view frame each time. 2014-03-03 17:44:03 -05:00
Pietro Gagliardi e39a5d928c Fixed the unregistered window class error on 64-bit Windows: turns out it was a difference in Go's int vs. what Windows expected (thanks Microsoft for not using your special types here). Fixed all instances of this, even in unmigrated/. Still does not work in wine... 2014-02-21 02:27:59 -05:00
Pietro Gagliardi fb82e651a4 Moved to a proper package; main() is now a test and go test -c is used to build. Once I iron out a bug with Windows event handling, I'll add a README. 2014-02-19 11:41:10 -05:00
Pietro Gagliardi 1f08c874e0 Made event dispatch asynchronous to avoid deadlocks; right now events that cannot be dispatched get dropped. 2014-02-18 09:57:19 -05:00
Pietro Gagliardi 0595135d9a Fixed the GTK+ crashes (I think) by making resizes synchronous. Since all control resizes happen on the UI thread anyway, we don't need to dispatch back; just call the resizing functions directly. Windows gets this fix too for consistency (and also because it gets rid of the only asynchronous oddity in the system). 2014-02-17 01:40:53 -05:00
Pietro Gagliardi a400ec6666 Fixed the resizing deadlock. 2014-02-13 11:42:21 -05:00
Pietro Gagliardi 5626b9e35c Added sizing of windows and the main window control. It presently deadlocks; I'll need to redo my mutexes... 2014-02-13 05:28:26 -05:00
Pietro Gagliardi 3d2df2334e Fixed compiler errors. New code structure success! 2014-02-12 21:33:24 -05:00
Pietro Gagliardi 403ca88316 Whoops, class registration now has to go through the UI task. 2014-02-12 21:11:21 -05:00
Pietro Gagliardi 98d56767a3 Each control may only need one event, so combine them all into a single channel whose use depends on the sysData itself. Also we won't need to save the parentWindow anymore, as the change to the make() function will take care of that for us. 2014-02-12 20:55:05 -05:00
Pietro Gagliardi 4b16716e61 Restructuring the codebase to make things neater. First off: each window now has its own class; the sysData knows about children. This updates the window class to become a generator and rewrites the WndProc as well. 2014-02-12 20:51:07 -05:00
Pietro Gagliardi 5f587fbf47 Added button events. 2014-02-12 11:32:17 -05:00
Pietro Gagliardi 0f373195de Changed the sysData cache so that if we didn't fill it in yet, getSysData() returns nil instead of panicking, and the standard window procedure jumps directly to the default handler. Not what I originally wanted to do, but whatever, it finally works! 2014-02-11 22:41:55 -05:00
Pietro Gagliardi 88363e131c Got rid of the reverse HWND->sysData lookup for now, to see if there's a mistake elsewhere. Now we're up to a panic... with Success... 2014-02-11 20:14:19 -05:00
Pietro Gagliardi cee78198e4 It appears the result of syscall.StringToUTF16Ptr() is only temporary, so removed all that. Now the program just hangs... 2014-02-11 19:52:39 -05:00
Pietro Gagliardi a4182c606b Whoops, copy-paste fail somehow changed init error checks. Now it starts... and hangs before creating a window... 2014-02-11 19:27:58 -05:00
Pietro Gagliardi 73fa611b37 All build errors resolved. Now to test... 2014-02-11 19:18:03 -05:00
Pietro Gagliardi 09a42e0c34 Added the init and testing main functions and started fixing errors. Let's fix the rest and hope it works... 2014-02-11 18:57:03 -05:00
Pietro Gagliardi b918496ae4 Filled in the standard window procedure. 2014-02-11 18:22:39 -05:00
Pietro Gagliardi c6a8a4d2f7 (see previous commit; part 2) 2014-02-11 17:39:41 -05:00