Skip to content

Commit

Permalink
refactor(script): allow to change load time and code
Browse files Browse the repository at this point in the history
  • Loading branch information
Curve committed Sep 2, 2024
1 parent 0ea4f79 commit 109ed70
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 0 deletions.
2 changes: 2 additions & 0 deletions include/saucer/script.h
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,9 @@ extern "C"
SAUCER_EXPORT void saucer_script_free(saucer_script *);

SAUCER_EXPORT void saucer_script_set_frame(saucer_script *, SAUCER_WEB_FRAME frame);
SAUCER_EXPORT void saucer_script_set_time(saucer_script *, SAUCER_LOAD_TIME time);
SAUCER_EXPORT void saucer_script_set_permanent(saucer_script *, bool permanent);
SAUCER_EXPORT void saucer_script_set_code(saucer_script *, const char *code);

#ifdef __cplusplus
}
Expand Down
10 changes: 10 additions & 0 deletions src/script.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -18,8 +18,18 @@ extern "C"
handle->value().frame = static_cast<saucer::web_frame>(frame);
}

void saucer_script_set_time(saucer_script *handle, SAUCER_LOAD_TIME time)
{
handle->value().time = static_cast<saucer::load_time>(time);
}

void saucer_script_set_permanent(saucer_script *handle, bool permanent)
{
handle->value().permanent = permanent;
}

void saucer_script_set_code(saucer_script *handle, const char *code)
{
handle->value().code = code;
}
}

0 comments on commit 109ed70

Please sign in to comment.