Commit Graph

38 Commits

Author SHA1 Message Date
Pietro Gagliardi 9eb9aa82c0 Removed uitask and made the Window creation functions only callable from the main thread. This si the first part in the real major change, which bans all concurrent use of the API and provides a Post() function for communication. I don't like this, but it's the only way. Untested. 2014-07-03 10:02:27 -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 dff7ed3321 Migrated the Mac OS X delegate code to the new API. 2014-06-29 03:09:01 -04:00
Pietro Gagliardi 0b4c6a9228 Finished implementing the new control sizing system on Mac OS X. The new label behavior needs to be reimplemented next. 2014-06-26 03:24:27 -04:00
Pietro Gagliardi 1e66637cd2 More go fmt. 2014-06-10 14:59:39 -04:00
Pietro Gagliardi 946e007e5d Same as previous commit, but for Mac OS X now. The #cgo directives are in uitask_darwin.go. 2014-05-19 22:52:59 -04:00
Pietro Gagliardi 24cac41de6 Decided to unconditionally redraw everything on a window resize on Mac OS X. Now to add TODOs for the other platforms to see if we should do the same. 2014-05-17 17:07:53 -04:00
Pietro Gagliardi ebcbaa129d Combined all the Objective-C headers into objc_darwin.h. 2014-05-16 06:49:29 -04:00
Pietro Gagliardi b7db0e15cd Removed all the objc_getClass() and sel_getUid() calls from the Go code on Mac OS X. Also got rid of a forgotten objc_msgSend(). Now comes the Objective-C half... 2014-05-15 20:14:44 -04:00
Pietro Gagliardi 9d8976abab Migrated everything else to Objective-C native; fixed a few things I missed along the way. 2014-05-15 19:55:16 -04:00
Pietro Gagliardi 62b3c26107 Removed the class creation at runtime stuff and its residue from the Go files. This also cleans up the initialization stuff on the Go side too. 2014-05-13 09:40:19 -04:00
Pietro Gagliardi 3e712db2e0 Moved uitask_darwin.go to be Objective-C-based. Both delegate_darwin.go and uitask_darwin.go will share the same .m file. 2014-05-13 08:14:28 -04:00
Pietro Gagliardi de97125c54 Started conversion of delegate_darwin.go to use Objective-C directly. 2014-05-13 07:56:37 -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 24d40fa12d Fixed AppQuit on Mac OS X (forgot to set the NSApp delegate AND was using the wrong selector). 2014-04-07 12:46:09 -04:00
Pietro Gagliardi f7817f6987 Added (untested; VM issues) code to handle Mac OS X Quit Dock menu items and other related stuff that may happen in the future. Will drop the TODO after I can test it. 2014-04-06 23:33:27 -04:00
Pietro Gagliardi 8eee2a92b7 Changed the way drawRect: was being added to our Mac OS X Area such that we no longer need a separate function to add it to the class. 2014-04-04 22:21:53 -04:00
Pietro Gagliardi 7ea493873c Changed the Area class on Mac OS X to use the new class creation code. This gets rid of ALL the class creation code from delegate_darwin.go. 2014-04-04 21:32:10 -04:00
Pietro Gagliardi dd20d56f25 Created a new, simpler, easier to work with, and consistent way to create the necessary Objective-C classes in our Go code, and converted the appDelegate class to use it. Now for goArea... 2014-04-04 21:06:01 -04:00
Pietro Gagliardi 3a130b756a Removed objc_new(). The idea is to remove all the objc_* functions that aren't prefixed with C. (except objc_getClass()). 2014-04-04 17:50:27 -04:00
Pietro Gagliardi 8f944c7ec6 When we created our delegate and view classes on Mac OS X, it turned out we were accidentally subclassing the metaclass (of NSObject and NSView, respectively), not the actual superclass itself. Fixed tha. This also fixed that mysterious objc_new()/[object init] not working on the delegate class problem. 2014-03-30 13:21:10 -04:00
Pietro Gagliardi f2d6daa9ea Added the beginning of the Mac OS X Area implementation. Also fixed the long-broken Mac OS X build. 2014-03-29 23:57:49 -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 ee80429bb9 More TODO reduction. 2014-03-11 11:54:32 -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 75c34a0789 Fixed incorrect object placement by using the window's content rect, not the window's frame, to define the window size. The coordinate system being flipped is still not fixed. 2014-03-02 19:16:36 -05:00
Pietro Gagliardi 38a1b1b203 Fixed incorrect redrawing of Mac OS X windows after resize. Still need to fix the wrong rect issues... 2014-03-02 19:13:26 -05:00
Pietro Gagliardi bbb37bb2a6 Added Mac OS X Buttons. Code hangs due to a preferredSize() issue... 2014-03-01 21:34:37 -05:00
Pietro Gagliardi d9cf76c1ab Added windowDidResize: to the Mac OS X delegate for resizing windows. Now to figure out why I can't resize windows myself... 2014-03-01 18:01:30 -05:00
Pietro Gagliardi 5caf0fe84a Cleaned up loose ends with the previous commit and got window close events working on Mac OS X. Woo! 2014-03-01 17:15:26 -05:00
Pietro Gagliardi 56eb64429d Fixed most errors. Now I just need to add a sysData pool. 2014-03-01 17:01:28 -05:00
Pietro Gagliardi 9b4e30ccf9 Started to build a single global delegate object; now to fix issues. 2014-03-01 16:56:22 -05:00