Commit Graph
6575 Commits
Author SHA1 Message Date
Alexander Tkachev 17eb5f9143 CLOUD: Add complex callbacks
Originally, I intended to add Storage API, StorageFile and StorageInfo
stubs. When I tried to implement a simple info() call, I ended up fixing
Request to contain some pointer field and all callbacks to have Request*
parameter. And, now I have to place callback pointer into Request. which
calls another callback.

And, eventually, these "simple" callbacks would again require another
pointer (to some caller class).
2016-08-24 16:07:55 +06:00
Alexander Tkachev f913675c43 CLOUD: Add ConnectionManager hotfix
Tried to compile these two last commits with GCC and found a few minor
problems.
2016-08-24 16:07:55 +06:00
Alexander Tkachev 0a947618fb CLOUD: Make ConnectionManager singleton
With ConnectionManager singleton one can start their Requests without
creating Storage instance. Moreover, Storage instance should contain
cloud API, not Requests-related handling and timer starting methods.
Thus, these methods were moved into ConnectionManager itself.
2016-08-24 16:07:55 +06:00
Alexander Tkachev e743a65636 CLOUD: Add Dropbox into CloudManager's configs
This commit adds:
* ConfMan's new "cloud" domain;
* CloudManager's init() method, where it loads keys from "cloud" configs
domain;
* CurlJsonRequest's addHeader() and addPostField() methods;
* temporary Storage's printInfo() method;
* DropboxStorage's implementation of printInfo(), which is using access
token and user id;
* DropboxStorage's loadFromConfig() static method to load access token
and user id from configs and create a Storage instance with those;
* temporary DropboxStorage's authThroughConsole() static method, which
guides user through auth process from the console.

So, in CloudManager's init() implementation ScummVM checks that there is
"current_storage_type" key in "cloud" domain of configs, and loads
corresponding storage if there is such key.

If there is no such key, ScummVM offers user to auth with Dropbox.
That's done through console, and thus it's temporary (it also requires
restarting ScummVM twice and manually editing config.ini file).
2016-08-24 16:07:55 +06:00
Alexander Tkachev 5df8c51402 CLOUD: Fix CurlJsonRequest
It's using MemoryWriteStreamDynamic instead of String and it prepares
raw byte contents of this stream for JSON::parse().
2016-08-24 16:07:55 +06:00
Alexander Tkachev 03217cd5c3 CLOUD: Add CurlJsonRequest
Now we can do REST API request by creating CurlJsonRequest and waiting
for it to call our callback. Passed pointer is Common::JSONValue.

This commit also does some minor variable renaming fixes.
2016-08-24 16:07:55 +06:00
Alexander Tkachev 9c22b7cc64 CLOUD: Rewrite NetworkReadStream
Now it is based on MemoryReadWriteStream, which is introduced by this
commit. This stream is using ring buffer and is dynamically increasing
its size when necessary.
2016-08-24 16:07:55 +06:00
Alexander Tkachev 01abba4f1d CLOUD: Add ConnectionManager and NetworkReadStream
NetworkReadStream actually saves whole response in the memory now.

There is a pause mechanism in libcurl, but if libcurl is requesting
something compressed, it would have to uncompress data as it goes even
if we paused the request. Even though our own stream won't be notified
about this data when when "pause" the request, libcurl's own buffer
wound be expanding.
2016-08-24 16:07:55 +06:00
Alexander Tkachev 8b585d631b CLOUD: Add CurlRequest
CurlRequest uses own multi_handle, in which it creates an easy_handle to
make a request.

Every time `handle()` is called it checks whether request is complete
and, if it is, stops.
2016-08-24 16:07:55 +06:00
Alexander Tkachev 6ad983bb72 CLOUD: Fix GCC static cloudThread compile error
It's not static anymore.
2016-08-24 16:07:55 +06:00
Alexander Tkachev 1b89e25580 CLOUD: Add first Request
Just fooling around with the example Request, but the idea works well.
2016-08-24 16:07:55 +06:00
Alexander Tkachev b272bba751 CLOUD: Do minor fixes 2016-08-24 16:07:55 +06:00
Alexander Tkachev fade746f37 CLOUD: Add USE_CLOUD feature
Adds USE_CLOUD in both configure and create_project.
2016-08-24 16:07:55 +06:00
Alexander Tkachev ca2eeb2214 CLOUD: Add Cloud::Manager and Cloud::Storage
This commit introduces Common::CloudManager, which can be accessed from
OSystem.

The backend for this manager is Cloud::Manager (defined in
backends/cloud/manager.h). It should load all users storages from
configs and provide access to current Storage instance. For now it just
creates a new one.

Cloud::Storage (backends/cloud/storage.h) provides an API to interact
with cloud storage, for example, create new directory or sync files.
Right now it's not ready and has only two dummy methods: listDirectory()
and syncSaves().

There is Cloud::Dropbox::DropboxStorage backend
(backends/cloud/dropbox/dropboxstorage.h) for Cloud::Storage. Right now
it implements both listDirectory() and syncSaves() with starting timer
task and handling it by printing out some JSON examples.
2016-08-24 16:05:07 +06:00
Alexander Tkachev 7446ffd73b CLOUD: Integrate CloudThread into OSystem
Would be changed soon.
2016-08-24 16:05:07 +06:00
Alexander Tkachev 2ac2816d68 CLOUD: Refactor SimpleJSON 2016-08-24 16:05:07 +06:00
Alexander Tkachev a7fb8c72ab CLOUD: SimpleJSON refactor
Resharper + manual methods & fields renaming.
2016-08-24 16:05:07 +06:00
Alexander Tkachev 79e6368b42 CLOUD: Add SimpleJSON library (module.mk hotfix)
Forgot to edit those.
2016-08-24 16:05:07 +06:00
Alexander Tkachev 8429c40362 CLOUD: Add SimpleJSON library as Common::JSON
This commit also adds CloudThread class, which work() method is called
every second by TimerManager.

Right now it prints JSON examples on the console, so that's why it's
introduced with SimpleJSON library.
2016-08-24 16:05:07 +06:00
Tarek Soliman ad8cd2e52d SDL: Fix build with MacPorts SDL2 2016-08-20 22:33:51 -05:00
Willem Jan Palenstijn 68a15c10be Merge pull request #790 from salty-horse/clang_fixes
ALL: Don't use 'defined' in macro definitions
2016-08-13 11:57:39 +02:00
Alyssa Milburn 13d0ec9bea POSIX: Add #ifdef guards for DATA_PATH.
Thanks to snover for pointing out they should be there.
2016-08-04 16:19:13 +02:00
Eugene Sandulenko cb195a813b DC: Fix compilation 2016-08-04 13:08:25 +02:00
Eugene Sandulenko a4d39b2385 N64: Added pos() method to another save class 2016-08-04 13:05:15 +02:00
Eugene Sandulenko d111b16adc N64: Fix warning 2016-08-04 12:49:44 +02:00
Eugene Sandulenko eedd1286ff N64: Fix build adter WriteStream::pos() addition 2016-08-04 12:48:52 +02:00
Alexander Tkachev 2597be210d BACKENDS: Fix DC's OutVMSave to have pos() 2016-08-04 17:45:49 +06:00
Eugene Sandulenko 45e82b55fc Merge pull request #795 from fuzzie/snap
POSIX: Add $SNAP to search path if available.
2016-08-02 00:06:41 +03:00
Alyssa Milburn 87818fe63a POSIX: Add $SNAP to search path if available.
This allows ScummVM to find data files while running in a snap (e.g.
from the new Ubuntu store).
2016-07-29 11:45:14 +02:00
Bastien Bouclet ad3ab61241 COMMON: Remove the EventRecorder dependency from OSystem
EventRecorder is in the gui lib which is not linked in the cxxtest suite.
2016-07-28 18:23:46 +02:00
Bastien Bouclet a6efdf6422 SDL: Disable keycode remapping when building for WinCE
WinCE does not have MapVirtualKey.
2016-07-25 23:09:32 +02:00
Filippos Karapetis c11cf08745 Merge pull request #782 from bgK/sdl-win32-keycode
SDL: Fix Windows SDL1 keycodes to use the active keyboard layout
2016-07-25 23:06:10 +03:00
Bastien Bouclet 914996b5a6 SDL: Fix Windows SDL1 keycodes to use the active keyboard layout 2016-07-25 13:10:51 +02:00
Ori Avtalion 4d120800fa ALL: Don't use 'defined' in macro definitions
This is undefined behavior and clang warns about it.
See <http://lists.llvm.org/pipermail/cfe-commits/Week-of-Mon-20160118/147239.html>.
2016-07-23 16:18:51 +03:00
Colin Snover 1c0c540fa7 MACOS: Use 'unsigned int' instead of NSUInteger
NSUInteger apparently does not exist until macOS 10.5, but
buildbot targets 10.4.
2016-07-10 11:46:32 -05:00
Colin Snover c294e4fbf8 MACOS: Fix sign comparison 2016-07-10 10:50:05 -05:00
Martin Kiewitz f5ed14e93d SDL: Fix keyboard on macOS, when using SDL2, fix directional keypad
This will hopefully fully fix keyboard issues for macOS / SDL2,
for example when pressing "alt-x".

Also reset .ascii to 0, when Num-Lock is NOT enabled and keypad
directional keys are pressed. This was fixed inside AGI+SCI
previously.

The latter shouldn't cause issues, but in case it does, the
affected engine should get fixed and use keycodes instead.
2016-07-03 20:36:27 +02:00
Martin Kiewitz 29c31f8308 Revert "SDL: Fix keyboard on macOS, fix directional keypad"
This reverts commit 9aa7174218.

For now.
2016-07-03 19:43:56 +02:00
Martin Kiewitz 9aa7174218 SDL: Fix keyboard on macOS, when using SDL2, fix directional keypad
This will hopefully fully fix keyboard issues for macOS / SDL2,
for example when pressing "alt-x".

Also reset .ascii to 0, when Num-Lock is NOT enabled and keypad
directional keys are pressed. This was fixed inside AGI+SCI
previously.

The latter shouldn't cause issues, but in case it does, the
affected engine should get fixed and use keycodes instead.
2016-07-03 19:08:24 +02:00
Ben Castricum da55658a80 SDL: Fix mouse trailing part of bug #7141
Overlays are shown with _currentShakePos offset too, so no need to
compensate the mousepointer position for overlays. This compensation
was done inconsistently in draw/undraw mouse causing the mouse trails.
2016-07-01 08:26:03 +02:00
Kirben 5181b50cea WIN32: Fix taskbar detection under Windows 10 onwards. 2016-06-08 10:06:57 +10:00
Kirben 9925851670 WIN32: Fix taskbar detection under Windows 10 onwards. 2016-06-08 09:56:18 +10:00
Eugene Sandulenko b01aa4141e ANDROID: Set version code to 16. 15 was 1.8.1 2016-05-31 17:13:33 +02:00
Eugene Sandulenko 4dba5f5604 Merge pull request #763 from bluegr/winsparkle
UPDATES: Add support for WinSparkle
2016-05-29 14:46:56 +02:00
Torbjörn Andersson 85e55d0c6e JANITORIAL: Remove unnecessary semicolons 2016-05-25 05:37:07 +02:00
Alyssa Milburn a32c53f936 ANDROID: Build against android-23 platform.
We seem to need this for the new manifest elements.
2016-05-23 09:33:11 +02:00
Filippos Karapetis 8d78615ac8 UPDATES: Fix indentation 2016-05-23 10:13:17 +03:00
Matthew Garrett 832d7bb289 ANDROID: Add support for ScummVM menu on Android TV devices
Android TV devices don't have menu buttons. Remotes should have a play/pause
button (which may send individual play and pause events rather than a
combined event) and gamepads should have a Y button. Use these to open the
menu.
2016-05-22 15:23:44 -07:00
Matthew Garrett 497859ad90 ANDROID: Add support for Leanback Launcher on Android TV
Android TV needs some modifications to the manifest and a new icon in order
for apps to appear in the launcher.
2016-05-22 15:23:44 -07:00
Filippos Karapetis 8b3a08047c UPDATES: Add support for WinSparkle 2016-05-22 18:52:33 +03:00