libs/gui.git
17 months agoInitialize longjmp target before calling jpeg_create_decompress master
Mikko Rasa [Sun, 8 Jan 2017 11:40:46 +0000 (13:40 +0200)]
Initialize longjmp target before calling jpeg_create_decompress

17 months agoUse correct keyword in forward declaration
Mikko Rasa [Fri, 6 Jan 2017 02:55:34 +0000 (04:55 +0200)]
Use correct keyword in forward declaration

18 months agoAlter the starting condition for gestures
Mikko Rasa [Fri, 25 Nov 2016 21:18:05 +0000 (23:18 +0200)]
Alter the starting condition for gestures

This makes pinch and rotate in particular easier to perform.

18 months agoOnly hide and show the window on fullscreen change if it was visible
Mikko Rasa [Fri, 25 Nov 2016 11:21:50 +0000 (13:21 +0200)]
Only hide and show the window on fullscreen change if it was visible

18 months agoFix incorrect comparisons
Mikko Rasa [Fri, 25 Nov 2016 11:21:18 +0000 (13:21 +0200)]
Fix incorrect comparisons

19 months agoCreate a temporary context for calling wglGetProcAddress
Mikko Rasa [Sat, 5 Nov 2016 15:07:59 +0000 (17:07 +0200)]
Create a temporary context for calling wglGetProcAddress

19 months agoAdd a missing include for GLContext on Windows
Mikko Rasa [Sat, 5 Nov 2016 12:28:36 +0000 (14:28 +0200)]
Add a missing include for GLContext on Windows

19 months agoUse the name of the function for the SwapInterval function pointers
Mikko Rasa [Wed, 2 Nov 2016 21:27:10 +0000 (23:27 +0200)]
Use the name of the function for the SwapInterval function pointers

19 months agoSupport forward-compatible OpenGL contexts
Mikko Rasa [Wed, 2 Nov 2016 21:23:35 +0000 (23:23 +0200)]
Support forward-compatible OpenGL contexts

19 months agoImprove cursor hiding logic on Windows
Mikko Rasa [Sat, 29 Oct 2016 12:01:01 +0000 (15:01 +0300)]
Improve cursor hiding logic on Windows

Only hide it when it's in the client area of the window

20 months agoFix a memory leak
Mikko Rasa [Fri, 7 Oct 2016 22:27:56 +0000 (01:27 +0300)]
Fix a memory leak

20 months agoAdd support for swap interval control
Mikko Rasa [Sun, 2 Oct 2016 21:10:01 +0000 (00:10 +0300)]
Add support for swap interval control

21 months agoImplement game controllers on Windows through XInput
Mikko Rasa [Tue, 20 Sep 2016 08:14:07 +0000 (11:14 +0300)]
Implement game controllers on Windows through XInput

21 months agoEnumerate available game controllers
Mikko Rasa [Mon, 19 Sep 2016 20:39:14 +0000 (23:39 +0300)]
Enumerate available game controllers

Assign indices from zero to N-1 internally.  This makes it easier for
applications to use game controllers as the first available controller
will always have index zero.

21 months agoFix GameController multiple inclusion guards
Mikko Rasa [Mon, 19 Sep 2016 20:36:51 +0000 (23:36 +0300)]
Fix GameController multiple inclusion guards

21 months agoImplement three-finger tap and drag gestures
Mikko Rasa [Mon, 19 Sep 2016 20:31:45 +0000 (23:31 +0300)]
Implement three-finger tap and drag gestures

21 months agoRefactor GestureDetector logic
Mikko Rasa [Mon, 19 Sep 2016 20:30:14 +0000 (23:30 +0300)]
Refactor GestureDetector logic

Active_points only ever had the one or two bottom bits set and always
matched current gesture.  It's simpler to just use the number of points
for the gesture.

21 months agoTweak GestureDetector button and axis names
Mikko Rasa [Mon, 19 Sep 2016 17:51:32 +0000 (20:51 +0300)]
Tweak GestureDetector button and axis names

Tap gesture buttons were missing names and the progress axis was outdated.

21 months agoAdd touchscreen and gestures to the event test program
Mikko Rasa [Mon, 19 Sep 2016 17:32:45 +0000 (20:32 +0300)]
Add touchscreen and gestures to the event test program

21 months agoAdd focus events to the event test program
Mikko Rasa [Mon, 19 Sep 2016 17:32:22 +0000 (20:32 +0300)]
Add focus events to the event test program

21 months agoPaint the window in WM_PAINT
Mikko Rasa [Sat, 17 Sep 2016 15:47:36 +0000 (18:47 +0300)]
Paint the window in WM_PAINT

Failing to do so will result the application in getting stuck in the
event loop.

21 months agoImplement additional fullscreen options for Window
Mikko Rasa [Fri, 16 Sep 2016 23:08:45 +0000 (02:08 +0300)]
Implement additional fullscreen options for Window

21 months agoRetain monitor positions when setting non-exclusive modes
Mikko Rasa [Fri, 16 Sep 2016 23:00:36 +0000 (02:00 +0300)]
Retain monitor positions when setting non-exclusive modes

Trying to rearrange the monitors was a stupid idea, as it can easily mess
up the user's configuration.

21 months agoRemove names from unused parameters
Mikko Rasa [Fri, 16 Sep 2016 21:43:15 +0000 (00:43 +0300)]
Remove names from unused parameters

21 months agoRefactor storage of monitor settings
Mikko Rasa [Fri, 16 Sep 2016 21:34:26 +0000 (00:34 +0300)]
Refactor storage of monitor settings

21 months agoRemove glViewport calls from GLContext
Mikko Rasa [Thu, 15 Sep 2016 21:12:26 +0000 (00:12 +0300)]
Remove glViewport calls from GLContext

They've been broken for a long time with mspgl, probably since
framebuffer objects were implemented.  The new GL::View class
takes care of viewport size syncing better.

21 months agoGet monitor names from EDID if available
Mikko Rasa [Thu, 15 Sep 2016 17:22:06 +0000 (20:22 +0300)]
Get monitor names from EDID if available

22 months agoSwap fullscreen mode dimensions if the desktop is rotated
Mikko Rasa [Tue, 2 Aug 2016 21:00:51 +0000 (00:00 +0300)]
Swap fullscreen mode dimensions if the desktop is rotated

22 months agoImplement a loader for BMP images
Mikko Rasa [Mon, 25 Jul 2016 21:51:09 +0000 (00:51 +0300)]
Implement a loader for BMP images

23 months agoDon't leak memory if JsDevice constructor throws
Mikko Rasa [Sat, 23 Jul 2016 15:50:32 +0000 (18:50 +0300)]
Don't leak memory if JsDevice constructor throws

23 months agoAdd support for blocking ticks and EventDispatcher in GameController
Mikko Rasa [Thu, 21 Jul 2016 00:01:03 +0000 (03:01 +0300)]
Add support for blocking ticks and EventDispatcher in GameController

Note: the parameterless tick() method was previously non-blocking but now
blocks until an event is received.

2 years agoTrack the currently focused window in Display
Mikko Rasa [Sun, 7 Feb 2016 13:53:19 +0000 (15:53 +0200)]
Track the currently focused window in Display

On mobile platforms it's important for applications to stop rendering or
otherwise using excessive amounts of CPU power when inactive.

OS X code is a dummy implementation because I need more time to understand
the relevant events on that platform.

2 years agoSupport some additional keys
Mikko Rasa [Sat, 30 Jan 2016 19:31:27 +0000 (21:31 +0200)]
Support some additional keys

In particular, the standard keys on Android devices are now supported.

2 years agoCheck for event type and source in Android touchscreen driver
Mikko Rasa [Sat, 30 Jan 2016 18:36:42 +0000 (20:36 +0200)]
Check for event type and source in Android touchscreen driver

2 years agoAdd missing initializer
Mikko Rasa [Sun, 20 Dec 2015 13:45:53 +0000 (15:45 +0200)]
Add missing initializer

2 years agoCosmetic fixes
Mikko Rasa [Sun, 20 Dec 2015 13:45:40 +0000 (15:45 +0200)]
Cosmetic fixes

2 years agoWindows compilation fixes
Mikko Rasa [Sun, 20 Dec 2015 13:45:12 +0000 (15:45 +0200)]
Windows compilation fixes

2 years agoAllow configuring window positions as well
Mikko Rasa [Sun, 20 Dec 2015 13:44:15 +0000 (15:44 +0200)]
Allow configuring window positions as well

2 years agoTrack window positions
Mikko Rasa [Sun, 20 Dec 2015 13:43:35 +0000 (15:43 +0200)]
Track window positions

2 years agoStore the root window's ID in display private data
Mikko Rasa [Sun, 20 Dec 2015 13:15:15 +0000 (15:15 +0200)]
Store the root window's ID in display private data

2 years agoClose the game controller device when deleting the object
Mikko Rasa [Sun, 20 Dec 2015 11:39:49 +0000 (13:39 +0200)]
Close the game controller device when deleting the object

2 years agoUse libjpeg's boolean type for better compatibility
Mikko Rasa [Wed, 25 Nov 2015 18:05:53 +0000 (20:05 +0200)]
Use libjpeg's boolean type for better compatibility

Libjpeg 9 changed to an enum boolean type.

2 years agoImplement tap gestures
Mikko Rasa [Mon, 23 Nov 2015 17:57:11 +0000 (19:57 +0200)]
Implement tap gestures

2 years agoImplement additional two-finger gestures
Mikko Rasa [Sat, 21 Nov 2015 09:58:39 +0000 (11:58 +0200)]
Implement additional two-finger gestures

2 years agoCombine swipe gestures into a single drag gesture
Mikko Rasa [Sat, 21 Nov 2015 08:34:01 +0000 (10:34 +0200)]
Combine swipe gestures into a single drag gesture

This makes them more versatile for different kinds of control schemes.
Directional swipes can still be approximated through the Control
interface.  Capturing swipe gestures is no longer easily possible, but
the capture interface is due for a rewrite to support activator controls
anyway.

2 years agoImprove detection of the pinch gesture
Mikko Rasa [Sat, 21 Nov 2015 07:18:04 +0000 (09:18 +0200)]
Improve detection of the pinch gesture

Previously it was way too lenient about rotational movement of the points.

2 years agoRefactor GestureDetector and add some comments to it
Mikko Rasa [Thu, 19 Nov 2015 21:12:38 +0000 (23:12 +0200)]
Refactor GestureDetector and add some comments to it

2 years agoStore monitor names
Mikko Rasa [Wed, 21 Oct 2015 10:03:59 +0000 (13:03 +0300)]
Store monitor names

2 years agoUse a tighter threshold when checking for duplicate modes
Mikko Rasa [Wed, 21 Oct 2015 10:02:16 +0000 (13:02 +0300)]
Use a tighter threshold when checking for duplicate modes

Some display devices offer modes with refresh rates very close to each
other, such as 24.00 and 23.97.  These differences may nevertheless be
important for video content.

2 years agoUse float rather than unsigned for refresh rate
Mikko Rasa [Tue, 20 Oct 2015 16:31:41 +0000 (19:31 +0300)]
Use float rather than unsigned for refresh rate

Display::set_mode now accepts a rate which is within +-0.5 Hz of
requested and chooses the closest match if there are more than one.

2 years agoAdd a signal for window exposure
Mikko Rasa [Thu, 15 Oct 2015 23:18:17 +0000 (02:18 +0300)]
Add a signal for window exposure

Windows code is untested.

2 years agoExport the xrandr feature
Mikko Rasa [Tue, 13 Oct 2015 19:59:01 +0000 (22:59 +0300)]
Export the xrandr feature

It's used in display_platform.h to optionally include some memberse in
DisplayPrivate.

2 years agoProper support for copying images
Mikko Rasa [Mon, 13 Jul 2015 09:55:04 +0000 (12:55 +0300)]
Proper support for copying images

2 years agoHandle interlaced PNG images
Mikko Rasa [Mon, 13 Jul 2015 09:54:06 +0000 (12:54 +0300)]
Handle interlaced PNG images

3 years agoFix the Windows version check in Touchscreen::is_available
Mikko Rasa [Mon, 22 Dec 2014 14:38:00 +0000 (16:38 +0200)]
Fix the Windows version check in Touchscreen::is_available

3 years agoAdd a dedicated exception class for unavailable input devices
Mikko Rasa [Fri, 19 Dec 2014 12:05:47 +0000 (14:05 +0200)]
Add a dedicated exception class for unavailable input devices

3 years agoAdd an availability check to Touchscreen
Mikko Rasa [Fri, 19 Dec 2014 12:05:07 +0000 (14:05 +0200)]
Add an availability check to Touchscreen

3 years agoDirty hack to pull the image loaders in when linking statically
Mikko Rasa [Fri, 19 Dec 2014 03:26:04 +0000 (05:26 +0200)]
Dirty hack to pull the image loaders in when linking statically

I can't find any way to add metadata to the symbols to forcibly pull them
in, so this will have to do.

3 years agoAdd a helper class for registering image loaders
Mikko Rasa [Fri, 19 Dec 2014 03:24:52 +0000 (05:24 +0200)]
Add a helper class for registering image loaders

3 years agoAvoid using too much CPU time in the event tester
Mikko Rasa [Fri, 19 Dec 2014 03:07:10 +0000 (05:07 +0200)]
Avoid using too much CPU time in the event tester

3 years agoImprove SmoothControl range API
Mikko Rasa [Fri, 19 Dec 2014 03:04:11 +0000 (05:04 +0200)]
Improve SmoothControl range API

Since gestures can generate axis values greater than one, the ability to
disable the upper threshold becomes necessary.

3 years agoAdd a gesture detector input device
Mikko Rasa [Fri, 19 Dec 2014 02:56:33 +0000 (04:56 +0200)]
Add a gesture detector input device

3 years agoAdd an activator system to Control
Mikko Rasa [Fri, 19 Dec 2014 02:24:55 +0000 (04:24 +0200)]
Add an activator system to Control

3 years agoGenerate and handle WM_CHAR messages on Windows
Mikko Rasa [Fri, 19 Dec 2014 01:55:38 +0000 (03:55 +0200)]
Generate and handle WM_CHAR messages on Windows

3 years agoFix an incorrect all to set_button_state in Touchscreen::touch_up
Mikko Rasa [Fri, 19 Dec 2014 01:38:29 +0000 (03:38 +0200)]
Fix an incorrect all to set_button_state in Touchscreen::touch_up

3 years agoAdd a generic directory for fallback implementations
Mikko Rasa [Fri, 19 Dec 2014 01:37:31 +0000 (03:37 +0200)]
Add a generic directory for fallback implementations

3 years agoAdd touchscreen support on Android
Mikko Rasa [Fri, 19 Dec 2014 01:30:41 +0000 (03:30 +0200)]
Add touchscreen support on Android

3 years agoInherit input devices using Window::signal_input_event from sigc::trackable
Mikko Rasa [Thu, 13 Nov 2014 20:41:09 +0000 (22:41 +0200)]
Inherit input devices using Window::signal_input_event from sigc::trackable

3 years agoTouchscreen input device
Mikko Rasa [Thu, 13 Nov 2014 20:40:25 +0000 (22:40 +0200)]
Touchscreen input device

Currently only implemented for Windows.

3 years agoInitialize Display::primary_monitor to 0
Mikko Rasa [Wed, 12 Nov 2014 20:46:21 +0000 (22:46 +0200)]
Initialize Display::primary_monitor to 0

3 years agoSet window title to application name by default
Mikko Rasa [Wed, 12 Nov 2014 20:45:24 +0000 (22:45 +0200)]
Set window title to application name by default

3 years agoInherit sigc::trackable in Android's PlatformDisplayPrivate
Mikko Rasa [Wed, 12 Nov 2014 20:42:13 +0000 (22:42 +0200)]
Inherit sigc::trackable in Android's PlatformDisplayPrivate

3 years agoAndroid support
Mikko Rasa [Sun, 12 Oct 2014 15:30:32 +0000 (18:30 +0300)]
Android support

Everything should work to some degree at least, though some details are
still missing.

3 years agoCosmetic changes
Mikko Rasa [Sun, 12 Oct 2014 14:22:03 +0000 (17:22 +0300)]
Cosmetic changes

3 years agoDrop the DrawContext class
Mikko Rasa [Sun, 12 Oct 2014 14:18:57 +0000 (17:18 +0300)]
Drop the DrawContext class

I've never actually used it, and 2D graphics are all but dead.  I don't
have any real interest of implementing it on other platforms either.

3 years agoCorrect the offset of function keys in the X11 keymap
Mikko Rasa [Sun, 12 Oct 2014 14:12:40 +0000 (17:12 +0300)]
Correct the offset of function keys in the X11 keymap

3 years agoZero-initialize JsDevice name buffer to avoid valgrind warning
Mikko Rasa [Sun, 12 Oct 2014 14:11:53 +0000 (17:11 +0300)]
Zero-initialize JsDevice name buffer to avoid valgrind warning

3 years agoAvoid compiler warning for a declared but unused function
Mikko Rasa [Sun, 12 Oct 2014 14:11:04 +0000 (17:11 +0300)]
Avoid compiler warning for a declared but unused function

3 years agoCreate GLContext::priv later to avoid memory leaks
Mikko Rasa [Sun, 12 Oct 2014 14:09:13 +0000 (17:09 +0300)]
Create GLContext::priv later to avoid memory leaks

3 years agoLet platform header determine (part of) the contents of Display::Private
Mikko Rasa [Sun, 12 Oct 2014 13:54:29 +0000 (16:54 +0300)]
Let platform header determine (part of) the contents of Display::Private

This simplifies things a bit as there's no need to declare dummy typedefs
for MonitorHandle and ModeHandle if they are not used.  It also makes the
upcoming Android support a lot easier to accomplish.

3 years agoSubclass NSWindow to eat keyDown events so they won't beep
Mikko Rasa [Sat, 11 Oct 2014 13:26:06 +0000 (16:26 +0300)]
Subclass NSWindow to eat keyDown events so they won't beep

3 years agoFix application activation on OS X <10.6
Mikko Rasa [Sat, 11 Oct 2014 13:24:36 +0000 (16:24 +0300)]
Fix application activation on OS X <10.6

3 years agoCompatibility changes for building on OS X 10.5
Mikko Rasa [Sat, 11 Oct 2014 09:45:15 +0000 (12:45 +0300)]
Compatibility changes for building on OS X 10.5

3 years agoCompile OS X .m files in C99 mode
Mikko Rasa [Sat, 11 Oct 2014 09:43:36 +0000 (12:43 +0300)]
Compile OS X .m files in C99 mode

Some features, such as // comments and mixed declarations and code, are
not compatible with ANSI C.

3 years agoAdd a game controller input device
Mikko Rasa [Thu, 11 Sep 2014 09:37:22 +0000 (12:37 +0300)]
Add a game controller input device

Currently only implemented for Linux.

4 years agoFix build with XRandR headers not installed
Mikko Rasa [Tue, 8 Apr 2014 16:03:32 +0000 (19:03 +0300)]
Fix build with XRandR headers not installed

4 years agoFix skipping bytes in JpegLoader
Mikko Rasa [Tue, 8 Apr 2014 15:42:28 +0000 (18:42 +0300)]
Fix skipping bytes in JpegLoader

Bytes in the buffer are not considered as processed yet, and are included
in count.

4 years agoFill in more fields of DEVMODE to avoid a crash
Mikko Rasa [Fri, 24 Jan 2014 17:49:25 +0000 (19:49 +0200)]
Fill in more fields of DEVMODE to avoid a crash

4 years agoSet panning when changing modes with XRandR
Mikko Rasa [Wed, 22 Jan 2014 19:54:28 +0000 (21:54 +0200)]
Set panning when changing modes with XRandR

Apparently, certain sequences can confuse Nvidia drivers at least and
result in weird configurations if this is not done.

4 years agoOnly set resizing flag to true in Window::reconfigure
Mikko Rasa [Wed, 22 Jan 2014 19:52:21 +0000 (21:52 +0200)]
Only set resizing flag to true in Window::reconfigure

This ensures that multiple consecutive reconfigure calls with the same
size won't reset the flag to false and prevent resize signal emission.

4 years agoOnly restore mode if the window is still visible
Mikko Rasa [Sun, 12 Jan 2014 11:45:23 +0000 (13:45 +0200)]
Only restore mode if the window is still visible

4 years agoChange video mode before reconfiguring the window
Mikko Rasa [Sun, 12 Jan 2014 11:43:20 +0000 (13:43 +0200)]
Change video mode before reconfiguring the window

This prevents the window options from getting out of sync if the video
mode can't be set.

4 years agoExpose functions for finding video modes from Display
Mikko Rasa [Sun, 12 Jan 2014 10:58:39 +0000 (12:58 +0200)]
Expose functions for finding video modes from Display

4 years agoClear resizing flag on Windows when resizing completes
Mikko Rasa [Sat, 11 Jan 2014 18:29:18 +0000 (20:29 +0200)]
Clear resizing flag on Windows when resizing completes

4 years agoRemove some leftover XF86VidMode fragments
Mikko Rasa [Sat, 11 Jan 2014 18:28:50 +0000 (20:28 +0200)]
Remove some leftover XF86VidMode fragments

4 years agoRemove an unused global variable
Mikko Rasa [Thu, 17 Oct 2013 07:43:46 +0000 (10:43 +0300)]
Remove an unused global variable

It was a remnant from an early stage of developing the window close
handling.  The design in which it was used was discarded, but this
variable went unnoticed.

4 years agoUse windowShouldClose rather than windowWillClose
Mikko Rasa [Thu, 17 Oct 2013 07:40:01 +0000 (10:40 +0300)]
Use windowShouldClose rather than windowWillClose

This prevents a crash when the autorelease pool is released (no clue what
exactly goes wrong) and allows the application to decide whether to close
the window or not.

4 years agoTighten memory management in ObjC code
Mikko Rasa [Thu, 17 Oct 2013 07:38:15 +0000 (10:38 +0300)]
Tighten memory management in ObjC code

4 years agoReturn true to indicate the error was handled
Mikko Rasa [Thu, 17 Oct 2013 07:13:38 +0000 (10:13 +0300)]
Return true to indicate the error was handled

4 years agoGuard against no image loaders being enabled
Mikko Rasa [Wed, 16 Oct 2013 18:12:44 +0000 (21:12 +0300)]
Guard against no image loaders being enabled