This repository has been archived by the owner on Jul 3, 2023. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 224
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
89 changed files
with
10,824 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
[ | ||
{"ver":"0.1.0.0","url":"","brief":"initial version"} | ||
] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,72 @@ | ||
|
||
#include "sciter-x-window.hpp" | ||
|
||
#include <functional> | ||
#include "version.h" | ||
|
||
#ifdef WINDOWS | ||
#include <VersionHelpers.h> | ||
#endif | ||
|
||
class frame: public sciter::window | ||
{ | ||
public: | ||
|
||
frame(bool needs_debugger) : window(SW_TITLEBAR | SW_RESIZEABLE | SW_CONTROLS | SW_MAIN | SW_GLASSY | (needs_debugger ? SW_ENABLE_DEBUG:0)) | ||
{ | ||
} | ||
|
||
BEGIN_FUNCTION_MAP | ||
FUNCTION_0("argv", get_argv); | ||
FUNCTION_0("version", get_version); | ||
END_FUNCTION_MAP | ||
|
||
sciter::value get_argv() { | ||
std::vector<sciter::value> vargs; | ||
for (auto& arg : sciter::application::argv()) | ||
vargs.push_back(sciter::value(arg)); | ||
return sciter::value::make_array(UINT(vargs.size()), &vargs[0]); | ||
} | ||
|
||
sciter::value get_version() { | ||
return sciter::value(WSTR(APP_VERSION)); | ||
} | ||
|
||
}; | ||
|
||
#include "resources.cpp" | ||
|
||
int uimain(std::function<int()> run ) { | ||
|
||
SciterSetOption(NULL, SCITER_SET_SCRIPT_RUNTIME_FEATURES, | ||
ALLOW_FILE_IO | | ||
ALLOW_SOCKET_IO | | ||
ALLOW_EVAL | | ||
ALLOW_SYSINFO); | ||
|
||
#ifdef WINDOWS | ||
SciterSetOption(NULL, SCITER_SET_GFX_LAYER, GFX_LAYER_D2D); | ||
#endif // WINDOWS | ||
|
||
sciter::archive::instance().open(aux::elements_of(resources)); // bind resources[] (defined in "resources.cpp") with the archive | ||
|
||
auto args = sciter::application::argv(); | ||
bool needs_debugger = std::find(args.cbegin(), args.cend(), WSTR("-debug")) != args.cend(); | ||
|
||
aux::asset_ptr<frame> pwin = new frame(needs_debugger); | ||
|
||
// note: this:://app URL is dedicated to the sciter::archive content associated with the application | ||
|
||
#ifdef WINDOWS | ||
if(IsWindows8OrGreater()) | ||
pwin->load( WSTR("this://app/frame-windows.htm") ); | ||
else | ||
pwin->load(WSTR("this://app/frame-else.htm")); | ||
#else | ||
pwin->load( WSTR("this://app/frame-else.htm") ); | ||
#endif | ||
pwin->expand(); | ||
|
||
return run(); | ||
|
||
} |
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Oops, something went wrong.