Skip to content
This repository has been archived by the owner on Jul 3, 2023. It is now read-only.

Commit

Permalink
+ html-notepad sources
Browse files Browse the repository at this point in the history
  • Loading branch information
c-smile committed Oct 26, 2018
1 parent 4c6aacf commit 5edaa36
Show file tree
Hide file tree
Showing 89 changed files with 10,824 additions and 0 deletions.
3 changes: 3 additions & 0 deletions notepad/dist/versions.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
[
{"ver":"0.1.0.0","url":"","brief":"initial version"}
]
72 changes: 72 additions & 0 deletions notepad/html-notepad.cpp
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();

}
Binary file added notepad/images/logo128.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added notepad/images/logo16.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added notepad/images/logo32.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added notepad/images/logo48.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added notepad/images/logo64.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading

0 comments on commit 5edaa36

Please sign in to comment.