aboutsummaryrefslogtreecommitdiff
path: root/osx.m (follow)
Commit message (Collapse)AuthorAge
* Fix a bug introduced by r9495 in which we try to write temporary NULsSimon Tatham2012-06-06
| | | | | | | | | into a string which is usually a read-only string literal. Instead, copy each segment into writable memory as we need it, and free it afterwards. [originally from svn r9558] [r9495 == d0ff371b144d4bfe3cbfb062388347c08e431393]
* GNUstep compatibility: ensure both endpoints are actually drawn bySimon Tatham2012-05-06
| | | | | | | draw_line, by the brute-force method of explicitly plotting them in addition to the GUI's line-drawing operation. [originally from svn r9505]
* GNUstep compatibility: add a missing #include.Simon Tatham2012-05-06
| | | | [originally from svn r9504]
* GNUstep compatibility: avoid attempting blitter_save with a partiallySimon Tatham2012-05-06
| | | | | | | | out-of-bounds rectangle. Instead, take the intersection of the rectangle with the window boundary and do a smaller operation on what's left. [originally from svn r9503]
* GNUstep compatibility: stop using the API feature isFlipped/setFlippedSimon Tatham2012-05-06
| | | | | | | | | | | | | | | to translate y-coordinates from the default of up-from-bottom to the down-from-top expected by these puzzles, because it doesn't work right on GNUstep. Instead, we run the API in its default mode (probably a more robust choice anyway) and translate coordinates manually in the front end. In the process, I've separated the processButton: method into one for mouse buttons and one for keys, since that was the easiest way to ensure the coordinates passed to the mid-end for the latter are -1,-1 _after_ translation rather than before. [originally from svn r9502]
* GNUstep compatibility: remove an unused variable which the compilerSimon Tatham2012-05-06
| | | | | | warned about. [originally from svn r9501]
* GNUstep compatibility: comment out some API calls that GNUstepSimon Tatham2012-05-06
| | | | | | apparently doesn't have. Fortunately they were optional anyway. [originally from svn r9500]
* GNUstep compatibility: spell null selectors "NULL", not "nil".Simon Tatham2012-05-06
| | | | [originally from svn r9499]
* Stop using the deprecated NSString stringWithCString: methods.Simon Tatham2012-05-06
| | | | [originally from svn r9495]
* Introduce, and implement as usefully as I can in all front ends, aSimon Tatham2009-12-27
| | | | | | | | | | new function in the drawing API which permits the display of text from outside basic ASCII. A fallback mechanism is provided so that puzzles can give a list of strings they'd like to display in order of preference and the system will return the best one it can manage; puzzles are required to cope with ASCII-only front ends. [originally from svn r8793]
* Change to the handling of -DCOMBINED in the makefiles. Instead ofSimon Tatham2008-09-13
| | | | | | | | | | | defining it centrally per port, I think it's neater to define it for each puzzle when adding that puzzle to the ALL list - because those front ends which take -DCOMBINED are precisely those which use ALL. In particular, this change opens up the possibility of compiling both individual puzzles _and_ a combined monolith within the same makefile. [originally from svn r8178]
* New infrastructure feature. Games are now permitted to beSimon Tatham2008-09-06
| | | | | | | | | | | | | | | | | | | | | | _conditionally_ able to format the current puzzle as text to be sent to the clipboard. For instance, if a game were to support playing on a square grid and on other kinds of grid such as hexagonal, then it might reasonably feel that only the former could be sensibly rendered in ASCII art; so it can now arrange for the "Copy" menu item to be greyed out depending on the game_params. To do this I've introduced a new backend function (can_format_as_text_now()), and renamed the existing static backend field "can_format_as_text" to "can_format_as_text_ever". The latter will cause compile errors for anyone maintaining a third-party front end; if any such person is reading this, I apologise to them for the inconvenience, but I did do it deliberately so that they'd know to update their front end. As yet, no checked-in game actually uses this feature; all current games can still either copy always or copy never. [originally from svn r8161]
* Implement tick marks in the Type menu on OS X.Simon Tatham2008-04-09
| | | | [originally from svn r7981]
* Syntactic fixes by Zach Wily to make the OS X build work under 10.5.Simon Tatham2008-01-15
| | | | [originally from svn r7836]
* Jesse W points out that I forgot to update the OS X front end inSimon Tatham2006-08-25
| | | | | | | | | r6420, so both drawing.c _and_ the front end were prepending the time to the front of the Mines status bar, leading to a double timestamp. [originally from svn r6796] [r6420 == 240b6cab8ce8729b7270a0411ab39038814058f1]
* OS X frontend was directly calling the backend's wants_statusbar()Simon Tatham2005-10-22
| | | | | | function, whereas it ought to have been calling the midend's one. [originally from svn r6413]
* New puzzle: `Tents'. Requires a potentially shared algorithms moduleSimon Tatham2005-10-13
| | | | | | | maxflow.c. Also in this checkin, fixes to the OS X and GTK back ends to get ALIGN_VNORMAL right. This is the first time I've used it! :-) [originally from svn r6390]
* *blinks* I apparently didn't try _building_ the OS X port since theSimon Tatham2005-08-21
| | | | | | | printing upheaval. I could have sworn I had. Oh well; small errors fixed. [originally from svn r6197]
* Substantial infrastructure upheaval. I've separated the drawing APISimon Tatham2005-08-18
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | as seen by the back ends from the one implemented by the front end, and shoved a piece of middleware (drawing.c) in between to permit interchange of multiple kinds of the latter. I've also added a number of functions to the drawing API to permit printing as well as on-screen drawing, and retired print.py in favour of integrated printing done by means of that API. The immediate visible change is that print.py is dead, and each puzzle now does its own printing: where you would previously have typed `print.py solo 2x3', you now type `solo --print 2x3' and it should work in much the same way. Advantages of the new mechanism available right now: - Map is now printable, because the new print function can make use of the output from the existing game ID decoder rather than me having to replicate all those fiddly algorithms in Python. - the new print functions can cope with non-initial game states, which means each puzzle supporting --print also supports --with-solutions. - there's also a --scale option permitting users to adjust the size of the printed puzzles. Advantages which will be available at some point: - the new API should permit me to implement native printing mechanisms on Windows and OS X. [originally from svn r6190]
* draw_polygon() and draw_circle() have always had a portabilitySimon Tatham2005-07-03
| | | | | | | | | | | | | | | | | | | constraint: because some front ends interpret `draw filled shape' to mean `including its boundary' while others interpret it to mean `not including its boundary' (and X seems to vacillate between the two opinions as it moves around the shape!), you MUST NOT draw a filled shape only. You can fill in one colour and outline in another, you can fill or outline in the same colour, or you can just outline, but just filling is a no-no. This leads to a _lot_ of double calls to these functions, so I've changed the interface. draw_circle() and draw_polygon() now each take two colour arguments, a fill colour (which can be -1 for none) and an outline colour (which must be valid). This should simplify code in the game back ends, while also reducing the possibility for coding error. [originally from svn r6047]
* Load and Save are now supported on all three desktop platforms, andSimon Tatham2005-06-30
| | | | | | | documented. (This means the GTK temporary dependency on an environment variable is now gone.) [originally from svn r6042]
* Introduce a front-end function to draw circles.Simon Tatham2005-06-23
| | | | [originally from svn r5991]
* New front end functions to save and restore a region of the puzzleSimon Tatham2005-06-22
| | | | | | | | bitmap. Can be used to implement sprite-like animations: for example, useful for games that wish to implement a user interface which involves dragging an object around the playing area. [originally from svn r5987]
* All the games in this collection have always defined their graphicsSimon Tatham2005-06-07
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | in terms of a constant TILE_SIZE (or equivalent). Here's a surprisingly small patch which switches this constant into a run-time variable. The only observable behaviour change should be on Windows, which physically does not permit the creation of windows larger than the screen; if you try to create a puzzle (Net makes this plausible) large enough to encounter this restriction, the Windows front end should automatically re-adjust the puzzle's tile size so that it does fit within the available space. On GTK, I haven't done this, on the grounds that X _does_ permit windows larger than the screen, and many X window managers already provide the means to navigate around such a window. Gareth said he'd rather navigate around a huge Net window than have it shrunk to fit on one screen. I'm uncertain that this makes sense for all puzzles - Pattern in particular strikes me as something that might be better off shrunk to fit - so I may have to change policy later or make it configurable. On OS X, I also haven't done automatic shrinkage to fit on one screen, largely because I didn't have the courage to address the question of multiple monitors and what that means for the entire concept :-) [originally from svn r5913]
* First cut at a game timer. Yet another backend function whichSimon Tatham2005-05-30
| | | | | | | | | | | | | | | indicates whether a particular game state should have the timer going (for Mines the initial indeterminate state does not have this property, and neither does a dead or won state); a midend function that optionally (on request from the game) prepends a timer to the front of the status bar text; some complicated midend timing code. It's not great. It's ugly; it's probably slightly inaccurate; it's got no provision for anyone but the game author decreeing whether a game is timed or not. But Mines can't be taken seriously without a timer, so it's a start. [originally from svn r5866]
* Add support for Jacob's new cursor-key modifier flags in the OS X frontend.Simon Tatham2005-05-26
| | | | [originally from svn r5847]
* After much thought, I've decided that `Restart' on r is not aSimon Tatham2005-05-17
| | | | | | | | particularly useful keypress, particularly given how easy it is to confuse it with `Redo'. So both r and ^R are now Redo, and Restart is relegated to being a menu-only option. [originally from svn r5796]
* The game IDs for Net (and Netslide) have always been random seedsSimon Tatham2005-05-16
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | rather than literal grid descriptions, which has always faintly annoyed me because it makes it impossible to type in a grid from another source. However, Gareth pointed out that short random-seed game descriptions are useful, because you can read one out to someone else without having to master the technology of cross- machine cut and paste, or you can have two people enter the same random seed simultaneously in order to race against each other to complete the same puzzle. So both types of game ID seem to have their uses. Therefore, here's a reorganisation of the whole game ID concept. There are now two types of game ID: one has a parameter string then a hash then a piece of arbitrary random seed text, and the other has a parameter string then a colon then a literal game description. For most games, the latter is identical to the game IDs that were previously valid; for Net and Netslide, old game IDs must be translated into new ones by turning the colon into a hash, and there's a new descriptive game ID format. Random seed IDs are not guaranteed to be portable between software versions (this is a major reason why I added version reporting yesterday). Descriptive game IDs have a longer lifespan. As an added bonus, I've removed the sections of documentation dealing with game parameter encodings not shown in the game ID (Rectangles expansion factor, Solo symmetry and difficulty settings etc), because _all_ parameters must be specified in a random seed ID and therefore users can easily find out the appropriate parameter string for any settings they have configured. [originally from svn r5788]
* Introduce a versioning mechanism, and an `About' box in all frontSimon Tatham2005-05-15
| | | | | | | | | ends. Versioning will be done solely by Subversion revision number, since development on these puzzles is very incremental and gradual and there don't tend to be obvious points to place numbered releases. [originally from svn r5781]
* I've had two complaints that Solo ought to recognise the numericSimon Tatham2005-05-12
| | | | | | | | | | | | | | | | keypad. The reason it doesn't is because front ends were carefully translating the numeric keypad into 8-way directional keys for the benefit of Cube. Therefore, a policy change: - front ends process the numeric keypad by sending MOD_NUM_KEYPAD | '3' and similar - front ends running on a platform with Num Lock SHOULD do this _irrespective_ of the state of Num Lock - back ends do whatever they see fit with numeric keypad keys. Result: the numeric keypad now works in Solo, and also works in OS X Cube (which it previously didn't because I forgot to implement that bit of the front end!). [originally from svn r5774]
* Added an automatic `Solve' feature to most games. This is useful forSimon Tatham2005-05-02
| | | | | | | | | | | | | | | | various things: - if you haven't fully understood what a game is about, it gives you an immediate example of a puzzle plus its solution so you can understand it - in some games it's useful to compare your solution with the real one and see where you made a mistake - in the rearrangement games (Fifteen, Sixteen, Twiddle) it's handy to be able to get your hands on a pristine grid quickly so you can practise or experiment with manoeuvres on it - it provides a good way of debugging the games if you think you've encountered an unsolvable grid! [originally from svn r5731]
* It's actually vitally important, it turns out, to have all of theSimon Tatham2005-05-02
| | | | | | | | | `Cut', `Copy' and `Paste' items in the Edit menu of an OS X application - because there's nothing else that enables the keyboard cut/copy/paste shortcuts in an edit box! OS X Puzzles can now have game IDs pasted into it, which it previously couldn't. [originally from svn r5728]
* The addition of a `Copy' menu item on OS X was really beginning toSimon Tatham2005-05-01
| | | | | | | strain my unconventional menu organisation, so I've reverted to having `File' and `Edit' menus like everyone else. [originally from svn r5727]
* Introduced a new function in every game which formats a game_stateSimon Tatham2005-05-01
| | | | | | | | as text. This is used by front ends to implement copy-to-clipboard. Currently the function does nothing (and is disabled) in every game except Solo, but it's a start. [originally from svn r5724]
* I've found NSView's setNeedsDisplayInRect: method, which isSimon Tatham2005-02-05
| | | | | | | obviously better than just calling setNeedsDisplay on the whole thing... [originally from svn r5258]
* Need to impose a _maximum_ width on edit boxes, as well as a minimumSimon Tatham2005-01-25
| | | | | | | | width; if allowed to resize to the text within them, they look terribly silly when containing an entire Rectangles or Pattern game ID. [originally from svn r5210]
* Ahem. Rogue copy and paste was causing preset menu items to go intoSimon Tatham2005-01-24
| | | | | | the Help menu rather than the Type menu. Fixed. [originally from svn r5199]
* Help should have the shortcut Command-?.Simon Tatham2005-01-24
| | | | [originally from svn r5195]
* Improve OS X help: split back up into multiple files (thanks toSimon Tatham2005-01-24
| | | | | | | Halibut's new \cfg{html-local-head} directive), and add some CSS to mimic the font choices of system help files. [originally from svn r5194]
* First cut at online help under OS X. I just built the HTML versionSimon Tatham2005-01-24
| | | | | | | | | of the manual using Halibut (with one additional magic tag in the <HEAD> section), stuck it in the right part of the application bundle, referenced it in Info.plist, and added a Help menu. Everything else was automatic. Not bad! [originally from svn r5190]
* The main grid outline in Pattern was asymmetric between the top/leftSimon Tatham2005-01-24
| | | | | | | | | edges and the bottom/right ones. Fix it. (Also remove it from the todo list in osx.m, where I had entered it in the assumption that it was a bug in my new OS X port! Turns out it's an entirely platform- independent bug.) [originally from svn r5187]
* Fix two window-resizing bugs introduced by the addition of the status bar.Simon Tatham2005-01-24
| | | | [originally from svn r5186]
* Improve fatal error handling.Simon Tatham2005-01-24
| | | | [originally from svn r5185]
* Added a dock menu which makes it more convenient to launch a newSimon Tatham2005-01-24
| | | | | | game window. [originally from svn r5184]
* Status bar support.Simon Tatham2005-01-24
| | | | [originally from svn r5183]
* Implemented the configurable dialog box mechanism, allowing customSimon Tatham2005-01-23
| | | | | | | game sizes and entering of specific game IDs. I think this is now a plausibly usable port, even if still by no means _finished_. [originally from svn r5182]
* Added a framework for putting things other than the binary into aSimon Tatham2005-01-23
Mac OS X application bundle, and provided an icon for Puzzles. Also renamed the OS X source file from macosx.m to osx.m, so that it can sit beside other things such as osx-info.plist and not cause enormously long filenames. [originally from svn r5179]