Commit Graph

1731 Commits (04e2f5f82b9ca1695959b5a524d69ca446dcc42b)

Author SHA1 Message Date
Freddie Witherden 04e2f5f82b Update the widget animation callback to use widgetReposition as opposed to setting the position directly.
git-svn-id: svn+ssh://svn.gna.org/svn/warzone/trunk@5932 4a71c877-e1ca-e34f-864e-861f7616d084
2008-09-06 12:26:27 +00:00
Giel van Schijndel 906f766b8a * When using a va_list multiple times make sure to va_copy it first
* Make sure to call va_end on all instances of va_list when we're done with it

Similar to r5930 (which fixed ticket:50)

git-svn-id: svn+ssh://svn.gna.org/svn/warzone/trunk@5931 4a71c877-e1ca-e34f-864e-861f7616d084
2008-09-05 20:10:47 +00:00
Giel van Schijndel 37c6b31651 * When using a va_list multiple times make sure to va_copy it first
* Because va_copy is C99 provide a fallback for it on non-C99 systems (which assumes that va_list is just a pointer to the stack)

This fixes ticket:50, thanks to Buginator for finding the cause (though this solution is different from his suggestion)


git-svn-id: svn+ssh://svn.gna.org/svn/warzone/trunk@5930 4a71c877-e1ca-e34f-864e-861f7616d084
2008-09-05 19:38:22 +00:00
Freddie Witherden 548c43e6e3 Add support for resize and reposition events to betawidget.
git-svn-id: svn+ssh://svn.gna.org/svn/warzone/trunk@5929 4a71c877-e1ca-e34f-864e-861f7616d084
2008-09-05 17:05:56 +00:00
Freddie Witherden 9deaad010d Simplify event creation by adding a helper function to generate the base structure.
git-svn-id: svn+ssh://svn.gna.org/svn/warzone/trunk@5927 4a71c877-e1ca-e34f-864e-861f7616d084
2008-09-05 15:03:21 +00:00
Freddie Witherden 4c70b5eb7a Fix a bug similar in ilk to that fixed in r5925, except for vertical as opposed to horizontal window alignment.
git-svn-id: svn+ssh://svn.gna.org/svn/warzone/trunk@5926 4a71c877-e1ca-e34f-864e-861f7616d084
2008-09-03 21:36:28 +00:00
Freddie Witherden ad1a6db74e Fix a bug in the window alignment code, thanks to Elio for reporting it.
git-svn-id: svn+ssh://svn.gna.org/svn/warzone/trunk@5925 4a71c877-e1ca-e34f-864e-861f7616d084
2008-09-03 19:05:29 +00:00
Freddie Witherden 79df709d5b Improve the Doxygen documentation for widget.h
git-svn-id: svn+ssh://svn.gna.org/svn/warzone/trunk@5924 4a71c877-e1ca-e34f-864e-861f7616d084
2008-09-03 19:02:39 +00:00
Freddie Witherden 7453cee5bb Add textEntry class (warning: unfinished) to betawidget.
git-svn-id: svn+ssh://svn.gna.org/svn/warzone/trunk@5920 4a71c877-e1ca-e34f-864e-861f7616d084
2008-09-02 17:53:34 +00:00
Freddie Witherden a31fbb4561 Minor indentation fix to clipboardWin32.c.
git-svn-id: svn+ssh://svn.gna.org/svn/warzone/trunk@5919 4a71c877-e1ca-e34f-864e-861f7616d084
2008-09-02 16:31:42 +00:00
Freddie Witherden 2a8cee26b5 Re-write the Windows clipboard support; Unicode is now supported; add support for setting clipboard text.
git-svn-id: svn+ssh://svn.gna.org/svn/warzone/trunk@5918 4a71c877-e1ca-e34f-864e-861f7616d084
2008-09-02 16:27:00 +00:00
Freddie Witherden bef604763f Add an nbytes parameter to UTF8toUTF16 and UTF16toUTF8 which allow for fetching the number of bytes allocated.
git-svn-id: svn+ssh://svn.gna.org/svn/warzone/trunk@5917 4a71c877-e1ca-e34f-864e-861f7616d084
2008-09-02 14:37:01 +00:00
Freddie Witherden a8709983e0 Commit the final patch of patch #45; this cleans up utf.[ch].
git-svn-id: svn+ssh://svn.gna.org/svn/warzone/trunk@5916 4a71c877-e1ca-e34f-864e-861f7616d084
2008-09-02 11:21:12 +00:00
Giel van Schijndel 99fe22e0a4 Don't accept out-of-range Unicode codepoints in function unicode_utf8_char_length either
git-svn-id: svn+ssh://svn.gna.org/svn/warzone/trunk@5915 4a71c877-e1ca-e34f-864e-861f7616d084
2008-09-01 19:16:00 +00:00
Giel van Schijndel aabf08d6fa Change the UTF-8 encoder and decoder to only accept valid Unicode codepoints, not just every representable 32 bit unsigned integer
git-svn-id: svn+ssh://svn.gna.org/svn/warzone/trunk@5914 4a71c877-e1ca-e34f-864e-861f7616d084
2008-09-01 19:10:03 +00:00
Giel van Schijndel 0e88a86b8e Add two new functions: utf(8|16)_char_at_offset, which return a pointer to the index-th character in the given stream
git-svn-id: svn+ssh://svn.gna.org/svn/warzone/trunk@5911 4a71c877-e1ca-e34f-864e-861f7616d084
2008-08-31 20:39:17 +00:00
Giel van Schijndel f0f68e7386 Rename utf8.[ch] to utf.[ch] because it deals with different UTFs (Unicode Transformation Format) but not just specifically with UTF-8
git-svn-id: svn+ssh://svn.gna.org/svn/warzone/trunk@5910 4a71c877-e1ca-e34f-864e-861f7616d084
2008-08-31 20:06:40 +00:00
Freddie Witherden de59586edf Fix compilation of betawidget on OS X; ensure we correctly restore the layout if a child could not be added.
git-svn-id: svn+ssh://svn.gna.org/svn/warzone/trunk@5905 4a71c877-e1ca-e34f-864e-861f7616d084
2008-08-31 10:17:09 +00:00
Freddie Witherden 8114b1e71f Fix a bug in the window alignment code.
git-svn-id: svn+ssh://svn.gna.org/svn/warzone/trunk@5904 4a71c877-e1ca-e34f-864e-861f7616d084
2008-08-30 18:14:58 +00:00
Freddie Witherden 2f1cb8dcdc Add widgetSDLInit and widgetSDLQuit to initialise and uninitialise the widget system under SDL.
git-svn-id: svn+ssh://svn.gna.org/svn/warzone/trunk@5903 4a71c877-e1ca-e34f-864e-861f7616d084
2008-08-30 17:15:43 +00:00
Giel van Schijndel d3eaf3bbd1 Add several new functions for converting between UTF-8 and UTF-16 to utf8.[ch]
git-svn-id: svn+ssh://svn.gna.org/svn/warzone/trunk@5902 4a71c877-e1ca-e34f-864e-861f7616d084
2008-08-30 15:15:16 +00:00
Giel van Schijndel a0cdfd44ab Rename utf8_(encode|decode) to utf8_(encode|decode)_utf32 because they convert between UTF-8 and UTF-32
git-svn-id: svn+ssh://svn.gna.org/svn/warzone/trunk@5901 4a71c877-e1ca-e34f-864e-861f7616d084
2008-08-30 15:15:09 +00:00
Giel van Schijndel dfa9c2bc01 Rename function unicode_strlen to utf32_strlen because it really determines the length of a UTF-32 encoded string
git-svn-id: svn+ssh://svn.gna.org/svn/warzone/trunk@5900 4a71c877-e1ca-e34f-864e-861f7616d084
2008-08-30 13:49:11 +00:00
Giel van Schijndel 2cb4c71883 * Split out the code that encodes a single Unicode character as UTF-8 into a separate function: encode_utf8_char
* This will allow encoding of Unicode strings to UTF-8 regardless of its current encoding

git-svn-id: svn+ssh://svn.gna.org/svn/warzone/trunk@5899 4a71c877-e1ca-e34f-864e-861f7616d084
2008-08-30 13:47:15 +00:00
Giel van Schijndel ac08ca70b0 * Seperate out the part that determines a single Unicode character's (codepoint actually) length when encoded as UTF-8 into a separate function: unicode_utf8_char_length
* This will allow determining of the length of a string when encoded as UTF-8 regardless of its current encoding

git-svn-id: svn+ssh://svn.gna.org/svn/warzone/trunk@5898 4a71c877-e1ca-e34f-864e-861f7616d084
2008-08-30 13:47:06 +00:00
Giel van Schijndel 5222037799 Move the duplicated UTF-8 decoding code out of functions utf8_character_count and utf8_decode and into new function decode_utf8_char, which only decodes a single UTF-8 character sequence
git-svn-id: svn+ssh://svn.gna.org/svn/warzone/trunk@5897 4a71c877-e1ca-e34f-864e-861f7616d084
2008-08-30 13:24:27 +00:00
Giel van Schijndel b10871a0ab Add utf8.c to the win32 makefile system (which I forgot in r5895)
git-svn-id: svn+ssh://svn.gna.org/svn/warzone/trunk@5896 4a71c877-e1ca-e34f-864e-861f7616d084
2008-08-30 12:38:26 +00:00
Giel van Schijndel d45e64bf55 Reintroduce utf8.{c,h} for encoding and decoding UTF-8 strings
This is meant to be used with betawidget

This is a revert of r2477 (which removed the UTF-8 module)


git-svn-id: svn+ssh://svn.gna.org/svn/warzone/trunk@5895 4a71c877-e1ca-e34f-864e-861f7616d084
2008-08-30 12:34:46 +00:00
Freddie Witherden 0d58106de3 Make tool-tip events irrelevant for child widgets.
git-svn-id: svn+ssh://svn.gna.org/svn/warzone/trunk@5894 4a71c877-e1ca-e34f-864e-861f7616d084
2008-08-30 10:36:52 +00:00
Freddie Witherden cef3ce8060 Improve the Doxygen documentation for clipboard.h; make the return value of widgetSetClipboardText on OS X mean something.
git-svn-id: svn+ssh://svn.gna.org/svn/warzone/trunk@5893 4a71c877-e1ca-e34f-864e-861f7616d084
2008-08-30 10:02:28 +00:00
Freddie Witherden d5b0c12182 Slight refactoring of X11 clipboard code.
git-svn-id: svn+ssh://svn.gna.org/svn/warzone/trunk@5892 4a71c877-e1ca-e34f-864e-861f7616d084
2008-08-29 22:38:26 +00:00
Freddie Witherden e952b616c2 Remove a printline from the X11 clipboard code.
git-svn-id: svn+ssh://svn.gna.org/svn/warzone/trunk@5891 4a71c877-e1ca-e34f-864e-861f7616d084
2008-08-29 18:59:29 +00:00
Freddie Witherden 0f46539a45 Add clipboard support for X11.
git-svn-id: svn+ssh://svn.gna.org/svn/warzone/trunk@5890 4a71c877-e1ca-e34f-864e-861f7616d084
2008-08-29 18:42:54 +00:00
Giel van Schijndel 37c6aa9fd6 Make sure to clean up the sound streams as well in function sound_ShutdownLibrary()
git-svn-id: svn+ssh://svn.gna.org/svn/warzone/trunk@5884 4a71c877-e1ca-e34f-864e-861f7616d084
2008-08-28 20:12:47 +00:00
Freddie Witherden a06bb014df Add partially-finished SDL wrapper code to betawidfet.
git-svn-id: svn+ssh://svn.gna.org/svn/warzone/trunk@5881 4a71c877-e1ca-e34f-864e-861f7616d084
2008-08-28 15:34:21 +00:00
Ari Johnson d5b341334d More changes from #ifdef __APPLE__ to #if defined(WZ_OS_MAC)
git-svn-id: svn+ssh://svn.gna.org/svn/warzone/trunk@5880 4a71c877-e1ca-e34f-864e-861f7616d084
2008-08-27 15:24:21 +00:00
Freddie Witherden 94bbbf4250 Re-organise betawidget as proposed on the mailing list; add paste support for Win32 (needs testing).
git-svn-id: svn+ssh://svn.gna.org/svn/warzone/trunk@5876 4a71c877-e1ca-e34f-864e-861f7616d084
2008-08-26 11:01:17 +00:00
Freddie Witherden 2ea48df684 Fix some more typos in widget.h and correct the indentation.
git-svn-id: svn+ssh://svn.gna.org/svn/warzone/trunk@5875 4a71c877-e1ca-e34f-864e-861f7616d084
2008-08-25 20:37:41 +00:00
Freddie Witherden 9e605318d9 Add font.[ch] which abstract Cairo's internal font setting routines.
git-svn-id: svn+ssh://svn.gna.org/svn/warzone/trunk@5874 4a71c877-e1ca-e34f-864e-861f7616d084
2008-08-25 18:25:13 +00:00
Freddie Witherden 125dc19e04 Fix a typo in clipboard.h.
git-svn-id: svn+ssh://svn.gna.org/svn/warzone/trunk@5873 4a71c877-e1ca-e34f-864e-861f7616d084
2008-08-25 18:19:38 +00:00
Freddie Witherden c699aca070 Include <stdbool.h> in clipboard.h as opposed to clipboardOSX.m; fixing a potential compiler error.
git-svn-id: svn+ssh://svn.gna.org/svn/warzone/trunk@5872 4a71c877-e1ca-e34f-864e-861f7616d084
2008-08-25 18:04:21 +00:00
Freddie Witherden 55be99a19d Add sync-to-vblank support to Warzone; this closes ticket #38.
git-svn-id: svn+ssh://svn.gna.org/svn/warzone/trunk@5871 4a71c877-e1ca-e34f-864e-861f7616d084
2008-08-25 18:01:49 +00:00
Freddie Witherden 4266827565 Add copy/paste (clipboard) interface to betawidget, along with an OS X implementation.
git-svn-id: svn+ssh://svn.gna.org/svn/warzone/trunk@5870 4a71c877-e1ca-e34f-864e-861f7616d084
2008-08-25 17:30:09 +00:00
Freddie Witherden e48b37f6c0 Add tool-tip support to betawidget.
git-svn-id: svn+ssh://svn.gna.org/svn/warzone/trunk@5869 4a71c877-e1ca-e34f-864e-861f7616d084
2008-08-25 15:56:58 +00:00
Freddie Witherden cc94bc2818 Allow for event handlers to have separate (optional) destructors.
git-svn-id: svn+ssh://svn.gna.org/svn/warzone/trunk@5868 4a71c877-e1ca-e34f-864e-861f7616d084
2008-08-24 16:58:27 +00:00
Giel van Schijndel fd0084951e Prevent some infinite recursion
git-svn-id: svn+ssh://svn.gna.org/svn/warzone/trunk@5867 4a71c877-e1ca-e34f-864e-861f7616d084
2008-08-24 16:13:20 +00:00
Giel van Schijndel 173ee31214 * Split ASSERT out into ASSERT_HELPER:
* ASSERT_HELPER can be used by debug functions that wish to alter the location information attached and printed with ASSERTs
 * Add some missing semi-colons (the previous ASSERT macro had a terminating semi-colon)
 * Change an ASSERT that checks calloc's return value into an if() block (we can also run out of memory on non-debug builds...)


git-svn-id: svn+ssh://svn.gna.org/svn/warzone/trunk@5865 4a71c877-e1ca-e34f-864e-861f7616d084
2008-08-24 15:42:59 +00:00
Giel van Schijndel 19b72f1ce5 * Use alGetError() instead of sound_GetError() to clear error codes (the latter will also dump a debug message to LOG_SOUND)
* Remove some redundant debug(LOG_NEVER calls (they're preceded by a sound_GetError() call which will already dump that info)
 * Improve some comments
 * Log sound errors to LOG_SOUND, not to LOG_NEVER
 * In sound_DestroyStream make sure to bail out when we fail to retrieve the buffer count (as that could cause memory over-allocation)


git-svn-id: svn+ssh://svn.gna.org/svn/warzone/trunk@5860 4a71c877-e1ca-e34f-864e-861f7616d084
2008-08-24 12:41:10 +00:00
Buginator 82966293ad Fixes a openAL case where we didn't check if a openAL call failed or not.
(NOTE, this is really a temp fix, so it don't crash/cause more openAL errors. The sound code need a rewrite to correctly fix this problem)

git-svn-id: svn+ssh://svn.gna.org/svn/warzone/trunk@5853 4a71c877-e1ca-e34f-864e-861f7616d084
2008-08-23 19:44:00 +00:00
Freddie Witherden 30712505f1 Add the ability to check if an id is a valid event handler or not.
git-svn-id: svn+ssh://svn.gna.org/svn/warzone/trunk@5844 4a71c877-e1ca-e34f-864e-861f7616d084
2008-08-21 16:19:51 +00:00