GameApi 28
Library used by GameApi Builder tool
Loading...
Searching...
No Matches
test.cpp File Reference
#include "GameApi.hh"
#include <sstream>
#include <math.h>
#include <cassert>
#include <ctime>
#include <dlfcn.h>
#include <fstream>
#include <iostream>
#include <algorithm>
#include <filesystem>
#include <pthread.h>
#include <stdio.h>
#include <string.h>
#include "GameApi_low.hh"
#include <atomic>
#include <string>
#include <wayland-client.h>
#include "Tasks.hh"
#include <cstdlib>
#include <unistd.h>
#include <fcntl.h>
#include "GameApi_http.hh"
Include dependency graph for test.cpp:

Classes

class  CachedFileService
struct  ArrayType
class  Path
class  PathHandler
struct  PathHandler::PathConfig
struct  PathHandler::SituationConfig
class  Item
struct  GameApiParam
class  GameApiItem
struct  DllData
struct  Envi
struct  ASyncData
class  BuilderIter
class  MainIter
class  ItemConvert
class  ASyncTask
class  StartMainTask
struct  Envi_tabs
class  Tabs_Gui
class  TabsUpdateTask
class  DownloadUpdateTask
struct  IterData
class  IterTab

Macros

#define WAYLAND   1
#define HTML_RUN_HTTP_SERVER_IMPL   1

Functions

void reset_process_script_num ()
std::string use_path3 (GameApi::Env &e, GameApi::PAT val, PathHandler::Situation s)
std::string use_path4 (GameApi::PAT pat)
void render_cb (Envi *env)
void refresh ()
void ClearProgress ()
IMPORT std::string remove_prefix (std::string url)
int find_str (std::string s, std::string el)
IMPORT std::string get_zip_license_file (GameApi::Env &e, std::string s)
IMPORT bool enum_editor_callback (GameApi::Env &env, GameApi::GuiApi &gui, GameApi::W click_widget, std::string type, int mouse_x, int mouse_y, GameApi::FtA atlas, GameApi::BM atlas_bm, int x_gap, std::vector< GameApi::W > &areas, int button, int type2)
IMPORT void enum_editor_draw (GameApi::EveryApi &ev, GameApi::GuiApi &gui)
IMPORT void enum_editor_handle_event (GameApi::GuiApi &gui, std::vector< GameApi::W > vec, int button)
IMPORT void enum_set_value (GameApi::Env &e, GameApi::W enum_click, int value)
IMPORT ArrayType * find_array (GameApi::Env &e, GameApi::ARR arr)
IMPORT std::string replace_string (std::string str, char ch, char ch2)
IMPORT void send_post_request (std::string url, std::string headers, std::string data)
IMPORT std::string replace_str (std::string ste, std::string repl, std::string subst)
IMPORT void clear_all_caches ()
void mem_summary ()
IMPORT void clear_codegen ()
IMPORT void InstallProgress (int num, std::string label, int max=15)
IMPORT void ProgressBar (int num, int val, int max, std::string label)
IMPORT void set_codegen_values (GameApi::WM mod2, int id, std::string line_uid, int level)
IMPORT void pthread_system (std::string str)
IMPORT std::string find_html2 (GameApi::HML ml, GameApi::Env &env)
IMPORT std::string find_homepage2 (GameApi::HML ml, GameApi::Env &env)
IMPORT std::vector< unsigned char > load_from_url (std::string url)
IMPORT std::string remove_last_line (std::string s)
IMPORT std::string get_last_line (std::string file, char ch)
std::string hexify2 (std::string s)
std::string unhexify2 (std::string s)
void load_library (DllData &data, std::string lib_name)
std::vector< DllData > load_dlls (std::string filename)
IMPORT std::vector< std::string > find_additional_urls (GameApi::Env &e, GameApi::EveryApi &ev, std::string url)
void add_to_canvas (GuiApi &gui, W canvas, W item)
void add_to_canvas (GuiApi &gui, W canvas, std::vector< W > items)
void print_connect_targets (std::string ss, Envi *envi)
void connect_target (int x, int y, Envi *envi)
void callback_func (int x, int y, Envi *envi)
template<class T>
std::ostream & operator<< (std::ostream &o, const std::vector< T > &vec)
IMPORT void save_dd (GameApi::Env &e, GameApi::EveryApi &ev, std::string filename, std::string script, std::vector< std::string > urls)
void FinishProgress ()
uint64_t get_time_us ()
std::string create_tmp_filename (std::string prefix, std::string suffix)
float f (float w)
W functions_widget (GameApi::GuiApi &gui, std::string label, std::vector< GameApiItem * > vec, GameApi::FtA atlas, GameApi::BM atlas_bm, GameApi::FtA atlas2, GameApi::BM atlas_bm2, GameApi::W insert)
void print_stack_trace ()
void terminate_handler ()
IMPORT void clear_counters ()
IMPORT void print_counters ()
IMPORT bool file_exists (std::string s)
void update_progress_dialog_cb_impl (volatile GameApi::W &w, int x, int y, GameApi::FtA f, GameApi::BM b, std::vector< std::string >, int val, int max, int process)
void MoveCB (void *data)
void IterAlgo (Env &ee, std::vector< BuilderIter * > vec, std::vector< void * > args, EveryApi *ev)
void save_mod_txt_from_script_file2 (GameApi::EveryApi &ev, std::string input_script_filename, std::string output_mod_txt_filename)
IMPORT const char * get_html_directory2 ()
int main (int argc, char *argv[])

Variables

IMPORT CachedFileService * g_cached_serv
IMPORT GameApi::PAT gameapi_temp_dir
IMPORT bool g_reload_edit_dialog
bool g_edit_dialog_available =false
std::vector< std::string > g_edit_labels
std::vector< GameApi::GuiApi::EditTypes * > g_edit_vec
std::vector< std::string > g_edit_types
W * g_edit_cancel_button
W * g_edit_ok_button
std::vector< W * > g_edit_enum_click_targets
std::vector< W > g_edit_enum_click_targets2
std::string g_gpu_vendor
bool g_progress_lock_assets
IMPORT PathHandler * g_path_handler
bool refresh_done = false
IMPORT Low_SDL_Window * sdl_window
std::vector< std::string > async_labels
std::vector< std::string > async_infos
std::string g_mod_path
std::vector< void(*)(void *)> g_transparent_callback_objs
std::vector< void * > g_transparent_callback_params
std::vector< int > g_transparent_callback_ids
std::vector< float > g_transparent_pos
const char * g_videodriver
std::vector< std::vector< std::string > > g_collect_authors
std::vector< std::vector< std::string > > g_collect_licenses
std::vector< std::string > g_license_filenames
std::vector< std::string > g_license_urls
std::vector< std::string > g_license_authors
bool event_lock =true
uint64_t event_lock_time =0
GameApi::W enum_popup
GameApi::W enum_click
bool g_update_download_bar
std::vector< std::string > g_registered_urls
int g_event_screen_x
int g_event_screen_y
IMPORT int g_display_width
IMPORT int g_display_height
int g_window_pos_x
int g_window_pos_y
std::string gameapi_homepageurl
int g_has_wayland
volatile GameApi::W g_progress_dialog
std::vector< std::string > g_prog_labels
GameApi::EveryApi * g_everyapi2 =0
GameApi::FtA g_atlas
GameApi::BM g_atlas_bm
GameApi::GuiApi * g_everyapi_gui =0
IMPORT pthread_t g_main_thread_id
wl_display * g_wl_display
wl_surface * g_wl_surface
wl_shell_surface * g_wl_shell_surface
int current_mem_usage
int max_mem_usage
std::vector< GameApiItem * > global_functions
const int num_alternatives = 2
const char * k_api_name [] = { "_Z8api_namev", "_Z8api_nameB5cxx11v" }
const char * k_functions [] = { "_Z9functionsv", "_Z9functionsv" }
const char * k_num_displays [] = { "_Z12num_displaysv", "_Z12num_displaysv" }
const char * k_display [] = { "_Z7displayii", "_Z7displayii" }
const char * k_type_symbol [] = { "_Z11type_symbolv", "_Z11type_symbolB5cxx11v" }
ASyncData * g_async_ptr2
int g_async_count2
int async_pending_count = 0
PT old_cursor_pos
Envi * g_env
IMPORT bool g_progress_halt
IterTab * g_start2
bool g_dragdrop_enabled
std::string g_dragdrop_filename
IMPORT std::string g_original_title
IMPORT bool g_vr_enable
IMPORT int g_vr_device_id
IMPORT bool g_progress_callback_set =false
IMPORT void(* g_progress_callback )()
void(* update_progress_dialog_cb )(volatile GameApi::W &, int, int, GameApi::FtA, GameApi::BM, std::vector< std::string >, int val, int max, int process)
Low_SDL_Cursor * cursor0
Low_SDL_Cursor * cursor1
Tabs_Gui * g_start
Envi_tabs * g_start_tab
IMPORT const char * g_html_dir
IMPORT std::string g_http_server_ip = "127.0.0.1"
IMPORT int g_http_server_port =50200

Macro Definition Documentation

◆ HTML_RUN_HTTP_SERVER_IMPL

#define HTML_RUN_HTTP_SERVER_IMPL   1

◆ WAYLAND

#define WAYLAND   1

Function Documentation

◆ add_to_canvas() [1/2]

void add_to_canvas ( GuiApi & gui,
W canvas,
std::vector< W > items )

◆ add_to_canvas() [2/2]

void add_to_canvas ( GuiApi & gui,
W canvas,
W item )
Here is the caller graph for this function:

◆ callback_func()

void callback_func ( int x,
int y,
Envi * envi )
Here is the caller graph for this function:

◆ clear_all_caches()

IMPORT void clear_all_caches ( )
Here is the caller graph for this function:

◆ clear_codegen()

IMPORT void clear_codegen ( )
Here is the caller graph for this function:

◆ clear_counters()

IMPORT void clear_counters ( )

◆ ClearProgress()

void ClearProgress ( )
Here is the caller graph for this function:

◆ connect_target()

void connect_target ( int x,
int y,
Envi * envi )
Here is the caller graph for this function:

◆ create_tmp_filename()

std::string create_tmp_filename ( std::string prefix,
std::string suffix )
Here is the caller graph for this function:

◆ enum_editor_callback()

IMPORT bool enum_editor_callback ( GameApi::Env & env,
GameApi::GuiApi & gui,
GameApi::W click_widget,
std::string type,
int mouse_x,
int mouse_y,
GameApi::FtA atlas,
GameApi::BM atlas_bm,
int x_gap,
std::vector< GameApi::W > & areas,
int button,
int type2 )
Here is the caller graph for this function:

◆ enum_editor_draw()

IMPORT void enum_editor_draw ( GameApi::EveryApi & ev,
GameApi::GuiApi & gui )
Here is the caller graph for this function:

◆ enum_editor_handle_event()

IMPORT void enum_editor_handle_event ( GameApi::GuiApi & gui,
std::vector< GameApi::W > vec,
int button )
Here is the caller graph for this function:

◆ enum_set_value()

IMPORT void enum_set_value ( GameApi::Env & e,
GameApi::W enum_click,
int value )
Here is the caller graph for this function:

◆ f()

float f ( float w)

◆ file_exists()

IMPORT bool file_exists ( std::string s)
Here is the caller graph for this function:

◆ find_additional_urls()

IMPORT std::vector< std::string > find_additional_urls ( GameApi::Env & e,
GameApi::EveryApi & ev,
std::string url )
Here is the caller graph for this function:

◆ find_array()

IMPORT ArrayType * find_array ( GameApi::Env & e,
GameApi::ARR arr )
Here is the caller graph for this function:

◆ find_homepage2()

IMPORT std::string find_homepage2 ( GameApi::HML ml,
GameApi::Env & env )
Here is the caller graph for this function:

◆ find_html2()

IMPORT std::string find_html2 ( GameApi::HML ml,
GameApi::Env & env )
Here is the caller graph for this function:

◆ find_str()

int find_str ( std::string s,
std::string el )
Here is the caller graph for this function:

◆ FinishProgress()

void FinishProgress ( )
Here is the caller graph for this function:

◆ functions_widget()

W functions_widget ( GameApi::GuiApi & gui,
std::string label,
std::vector< GameApiItem * > vec,
GameApi::FtA atlas,
GameApi::BM atlas_bm,
GameApi::FtA atlas2,
GameApi::BM atlas_bm2,
GameApi::W insert )
Here is the caller graph for this function:

◆ get_html_directory2()

IMPORT const char * get_html_directory2 ( )
Here is the caller graph for this function:

◆ get_last_line()

IMPORT std::string get_last_line ( std::string file,
char ch )
Here is the caller graph for this function:

◆ get_time_us()

uint64_t get_time_us ( )
Here is the caller graph for this function:

◆ get_zip_license_file()

IMPORT std::string get_zip_license_file ( GameApi::Env & e,
std::string s )
Here is the caller graph for this function:

◆ hexify2()

std::string hexify2 ( std::string s)

◆ InstallProgress()

IMPORT void InstallProgress ( int num,
std::string label,
int max = 15 )
Here is the caller graph for this function:

◆ IterAlgo()

void IterAlgo ( Env & ee,
std::vector< BuilderIter * > vec,
std::vector< void * > args,
EveryApi * ev )
Here is the caller graph for this function:

◆ load_dlls()

std::vector< DllData > load_dlls ( std::string filename)

◆ load_from_url()

IMPORT std::vector< unsigned char > load_from_url ( std::string url)
Here is the caller graph for this function:

◆ load_library()

void load_library ( DllData & data,
std::string lib_name )
Here is the caller graph for this function:

◆ main()

int main ( int argc,
char * argv[] )

◆ mem_summary()

void mem_summary ( )
Here is the caller graph for this function:

◆ MoveCB()

void MoveCB ( void * data)
Here is the caller graph for this function:

◆ operator<<()

template<class T>
std::ostream & operator<< ( std::ostream & o,
const std::vector< T > & vec )

◆ print_connect_targets()

void print_connect_targets ( std::string ss,
Envi * envi )

◆ print_counters()

IMPORT void print_counters ( )

◆ print_stack_trace()

void print_stack_trace ( )
Here is the caller graph for this function:

◆ ProgressBar()

IMPORT void ProgressBar ( int num,
int val,
int max,
std::string label )

std::cout << "ProgressBar: '" << num << " " << label << " " << val << " " << max << "'" << std::endl;

Here is the caller graph for this function:

◆ pthread_system()

IMPORT void pthread_system ( std::string str)
Here is the caller graph for this function:

◆ refresh()

void refresh ( )
Here is the caller graph for this function:

◆ remove_last_line()

IMPORT std::string remove_last_line ( std::string s)
Here is the caller graph for this function:

◆ remove_prefix()

std::string remove_prefix ( std::string url)
Here is the caller graph for this function:

◆ render_cb()

void render_cb ( Envi * env)
Here is the caller graph for this function:

◆ replace_str()

IMPORT std::string replace_str ( std::string ste,
std::string repl,
std::string subst )
Here is the caller graph for this function:

◆ replace_string()

IMPORT std::string replace_string ( std::string str,
char ch,
char ch2 )
Here is the caller graph for this function:

◆ reset_process_script_num()

void reset_process_script_num ( )
Here is the caller graph for this function:

◆ save_dd()

IMPORT void save_dd ( GameApi::Env & e,
GameApi::EveryApi & ev,
std::string filename,
std::string script,
std::vector< std::string > urls )
Here is the caller graph for this function:

◆ save_mod_txt_from_script_file2()

void save_mod_txt_from_script_file2 ( GameApi::EveryApi & ev,
std::string input_script_filename,
std::string output_mod_txt_filename )
Here is the caller graph for this function:

◆ send_post_request()

IMPORT void send_post_request ( std::string url,
std::string headers,
std::string data )
Here is the caller graph for this function:

◆ set_codegen_values()

IMPORT void set_codegen_values ( GameApi::WM mod2,
int id,
std::string line_uid,
int level )
Here is the caller graph for this function:

◆ terminate_handler()

void terminate_handler ( )
Here is the caller graph for this function:

◆ unhexify2()

std::string unhexify2 ( std::string s)

◆ update_progress_dialog_cb_impl()

void update_progress_dialog_cb_impl ( volatile GameApi::W & w,
int x,
int y,
GameApi::FtA f,
GameApi::BM b,
std::vector< std::string > v,
int val,
int max,
int process )
Here is the caller graph for this function:

◆ use_path3()

std::string use_path3 ( GameApi::Env & e,
GameApi::PAT val,
PathHandler::Situation s )
inline
Here is the caller graph for this function:

◆ use_path4()

std::string use_path4 ( GameApi::PAT pat)
Here is the caller graph for this function:

Variable Documentation

◆ async_infos

IMPORT std::vector< std::string > async_infos
extern

◆ async_labels

IMPORT std::vector< std::string > async_labels
extern

◆ async_pending_count

IMPORT int async_pending_count = 0
extern

◆ current_mem_usage

int current_mem_usage
extern

◆ cursor0

Low_SDL_Cursor* cursor0

◆ cursor1

Low_SDL_Cursor * cursor1

◆ enum_click

GameApi::W enum_click
extern

◆ enum_popup

GameApi::W enum_popup
extern

◆ event_lock

bool event_lock =true

◆ event_lock_time

uint64_t event_lock_time =0

◆ g_async_count2

int g_async_count2
extern

◆ g_async_ptr2

ASyncData* g_async_ptr2
extern

◆ g_atlas

IMPORT GameApi::FtA g_atlas
extern

◆ g_atlas_bm

IMPORT GameApi::BM g_atlas_bm
extern

◆ g_cached_serv

IMPORT CachedFileService* g_cached_serv
extern

◆ g_collect_authors

std::vector<std::vector<std::string> > g_collect_authors
extern

◆ g_collect_licenses

std::vector<std::vector<std::string> > g_collect_licenses
extern

◆ g_display_height

IMPORT int g_display_height
extern

◆ g_display_width

IMPORT int g_display_width
extern

◆ g_dragdrop_enabled

bool g_dragdrop_enabled
extern

◆ g_dragdrop_filename

std::string g_dragdrop_filename
extern

◆ g_edit_cancel_button

W* g_edit_cancel_button

◆ g_edit_dialog_available

bool g_edit_dialog_available =false

◆ g_edit_enum_click_targets

std::vector<W*> g_edit_enum_click_targets

◆ g_edit_enum_click_targets2

std::vector<W> g_edit_enum_click_targets2

◆ g_edit_labels

std::vector<std::string> g_edit_labels

◆ g_edit_ok_button

W* g_edit_ok_button

◆ g_edit_types

std::vector<std::string> g_edit_types

◆ g_edit_vec

std::vector<GameApi::GuiApi::EditTypes*> g_edit_vec

◆ g_env

Envi* g_env

◆ g_event_screen_x

int g_event_screen_x
extern

◆ g_event_screen_y

int g_event_screen_y
extern

◆ g_everyapi2

IMPORT GameApi::EveryApi * g_everyapi2 =0
extern

◆ g_everyapi_gui

IMPORT GameApi::GuiApi * g_everyapi_gui =0
extern

◆ g_gpu_vendor

std::string g_gpu_vendor
extern

◆ g_has_wayland

int g_has_wayland
extern

◆ g_html_dir

IMPORT const char* g_html_dir
extern

◆ g_http_server_ip

EXPORT std::string g_http_server_ip = "127.0.0.1"
extern

◆ g_http_server_port

EXPORT int g_http_server_port =50200
extern

◆ g_license_authors

std::vector<std::string> g_license_authors

◆ g_license_filenames

std::vector<std::string> g_license_filenames

◆ g_license_urls

std::vector<std::string> g_license_urls

◆ g_main_thread_id

IMPORT pthread_t g_main_thread_id
extern

◆ g_mod_path

std::string g_mod_path
extern

◆ g_original_title

IMPORT std::string g_original_title
extern

◆ g_path_handler

IMPORT PathHandler* g_path_handler
extern

◆ g_prog_labels

IMPORT std::vector< std::string > g_prog_labels
extern

◆ g_progress_callback

IMPORT void(* g_progress_callback)() ( )
extern

◆ g_progress_callback_set

IMPORT bool g_progress_callback_set =false
extern

◆ g_progress_dialog

IMPORT volatile GameApi::W g_progress_dialog
extern

◆ g_progress_halt

IMPORT bool g_progress_halt
extern

◆ g_progress_lock_assets

bool g_progress_lock_assets
extern

◆ g_registered_urls

std::vector<std::string> g_registered_urls
extern

◆ g_reload_edit_dialog

bool g_reload_edit_dialog
extern

◆ g_start

Tabs_Gui* g_start

◆ g_start2

IterTab * g_start2

◆ g_start_tab

Envi_tabs* g_start_tab

◆ g_transparent_callback_ids

std::vector< int > g_transparent_callback_ids
extern

◆ g_transparent_callback_objs

std::vector< void(*)(void *)> g_transparent_callback_objs
extern

◆ g_transparent_callback_params

std::vector< void * > g_transparent_callback_params
extern

◆ g_transparent_pos

std::vector< float > g_transparent_pos
extern

◆ g_update_download_bar

bool g_update_download_bar
extern

◆ g_videodriver

const char* g_videodriver
extern

◆ g_vr_device_id

IMPORT int g_vr_device_id
extern

◆ g_vr_enable

IMPORT bool g_vr_enable
extern

◆ g_window_pos_x

int g_window_pos_x
extern

◆ g_window_pos_y

int g_window_pos_y
extern

◆ g_wl_display

wl_display* g_wl_display
extern

◆ g_wl_shell_surface

wl_shell_surface* g_wl_shell_surface
extern

◆ g_wl_surface

wl_surface* g_wl_surface
extern

◆ gameapi_homepageurl

std::string gameapi_homepageurl
extern

◆ gameapi_temp_dir

IMPORT GameApi::PAT gameapi_temp_dir
extern

◆ global_functions

std::vector<GameApiItem*> global_functions
extern

◆ k_api_name

const char* k_api_name[] = { "_Z8api_namev", "_Z8api_nameB5cxx11v" }

◆ k_display

const char* k_display[] = { "_Z7displayii", "_Z7displayii" }

◆ k_functions

const char* k_functions[] = { "_Z9functionsv", "_Z9functionsv" }

◆ k_num_displays

const char* k_num_displays[] = { "_Z12num_displaysv", "_Z12num_displaysv" }

◆ k_type_symbol

const char* k_type_symbol[] = { "_Z11type_symbolv", "_Z11type_symbolB5cxx11v" }

◆ max_mem_usage

int max_mem_usage
extern

◆ num_alternatives

const int num_alternatives = 2

◆ old_cursor_pos

PT old_cursor_pos

◆ refresh_done

bool refresh_done = false

◆ sdl_window

IMPORT Low_SDL_Window* sdl_window
extern

◆ update_progress_dialog_cb

IMPORT void(* update_progress_dialog_cb)(volatile GameApi::W &w, int, int, GameApi::FtA, GameApi::BM, std::vector< std::string >, int val, int max, int process) ( volatile GameApi::W & w,
int ,
int ,
GameApi::FtA ,
GameApi::BM ,
std::vector< std::string > ,
int val,
int max,
int process )
extern