2016-02-01 05:03:42 +00:00
|
|
|
/*
|
|
|
|
* Mr. 4th Dimention - Allen Webster
|
|
|
|
*
|
|
|
|
* 12.12.2014
|
|
|
|
*
|
|
|
|
* Application Layer for 4coder
|
|
|
|
*
|
|
|
|
*/
|
|
|
|
|
|
|
|
// TOP
|
|
|
|
|
2018-12-18 01:56:21 +00:00
|
|
|
#if !defined(FRED_H)
|
2016-02-01 05:03:42 +00:00
|
|
|
#define FRED_H
|
|
|
|
|
2016-05-19 16:23:12 +00:00
|
|
|
#define MAX_VIEWS 16
|
|
|
|
|
2017-03-29 16:32:06 +00:00
|
|
|
struct Plat_Settings{
|
2016-02-01 05:03:42 +00:00
|
|
|
char *custom_dll;
|
2017-03-29 16:32:06 +00:00
|
|
|
b8 custom_dll_is_strict;
|
|
|
|
b8 fullscreen_window;
|
2016-07-03 22:29:07 +00:00
|
|
|
|
2019-09-28 00:49:59 +00:00
|
|
|
i32 window_w;
|
|
|
|
i32 window_h;
|
|
|
|
i32 window_x;
|
|
|
|
i32 window_y;
|
2016-09-01 03:06:46 +00:00
|
|
|
b8 set_window_pos;
|
|
|
|
b8 set_window_size;
|
2016-02-01 05:03:42 +00:00
|
|
|
b8 maximize_window;
|
2017-03-29 16:32:06 +00:00
|
|
|
|
2016-07-03 22:29:07 +00:00
|
|
|
b8 use_hinting;
|
2017-03-29 16:32:06 +00:00
|
|
|
};
|
2016-02-01 05:03:42 +00:00
|
|
|
|
2019-10-05 02:48:05 +00:00
|
|
|
#define App_Read_Command_Line_Sig(name) \
|
|
|
|
void *name(Thread_Context *tctx,\
|
2019-10-10 00:07:38 +00:00
|
|
|
String_Const_u8 current_directory,\
|
|
|
|
Plat_Settings *plat_settings,\
|
|
|
|
char ***files, \
|
|
|
|
i32 **file_count,\
|
|
|
|
i32 argc, \
|
|
|
|
char **argv)
|
|
|
|
|
2016-02-01 05:03:42 +00:00
|
|
|
typedef App_Read_Command_Line_Sig(App_Read_Command_Line);
|
|
|
|
|
2017-01-23 06:19:43 +00:00
|
|
|
struct Custom_API{
|
2019-10-10 22:57:02 +00:00
|
|
|
_Get_Version_Type *get_version;
|
|
|
|
_Init_APIs_Type *init_apis;
|
2017-01-23 06:19:43 +00:00
|
|
|
};
|
2016-05-29 19:28:29 +00:00
|
|
|
|
2017-01-23 06:19:43 +00:00
|
|
|
#define App_Init_Sig(name) \
|
2019-10-22 04:10:29 +00:00
|
|
|
void name(Thread_Context *tctx, \
|
|
|
|
Render_Target *target, \
|
2019-10-10 00:07:38 +00:00
|
|
|
void *base_ptr, \
|
|
|
|
String_Const_u8 clipboard,\
|
|
|
|
String_Const_u8 current_directory,\
|
|
|
|
Custom_API api)
|
|
|
|
|
2016-02-01 05:03:42 +00:00
|
|
|
typedef App_Init_Sig(App_Init);
|
|
|
|
|
2017-11-08 04:41:45 +00:00
|
|
|
#include "4ed_cursor_codes.h"
|
2016-02-01 05:03:42 +00:00
|
|
|
|
|
|
|
struct Application_Step_Result{
|
2017-01-14 03:01:35 +00:00
|
|
|
Application_Mouse_Cursor mouse_cursor_type;
|
2016-02-01 05:03:42 +00:00
|
|
|
b32 lctrl_lalt_is_altgr;
|
2016-03-16 16:50:26 +00:00
|
|
|
b32 perform_kill;
|
2016-05-03 19:33:22 +00:00
|
|
|
b32 animating;
|
2017-11-30 16:50:39 +00:00
|
|
|
b32 has_new_title;
|
|
|
|
char *title_string;
|
2016-02-01 05:03:42 +00:00
|
|
|
};
|
|
|
|
|
2016-05-29 19:28:29 +00:00
|
|
|
struct Application_Step_Input{
|
|
|
|
b32 first_step;
|
|
|
|
f32 dt;
|
|
|
|
Mouse_State mouse;
|
2019-10-10 18:21:47 +00:00
|
|
|
Input_List events;
|
2019-06-01 23:58:28 +00:00
|
|
|
String_Const_u8 clipboard;
|
2019-03-15 08:38:28 +00:00
|
|
|
b32 clipboard_changed;
|
2018-03-03 07:46:44 +00:00
|
|
|
b32 trying_to_kill;
|
2016-05-29 19:28:29 +00:00
|
|
|
};
|
|
|
|
|
2018-03-03 07:46:44 +00:00
|
|
|
#define App_Step_Sig(name) Application_Step_Result \
|
2019-10-22 04:10:29 +00:00
|
|
|
name(Thread_Context *tctx, \
|
|
|
|
Render_Target *target, \
|
2019-10-01 02:06:21 +00:00
|
|
|
void *base_ptr, \
|
2018-03-03 07:46:44 +00:00
|
|
|
Application_Step_Input *input)
|
2016-02-01 05:03:42 +00:00
|
|
|
|
|
|
|
typedef App_Step_Sig(App_Step);
|
|
|
|
|
2019-08-16 02:54:06 +00:00
|
|
|
typedef b32 Log_Function(String_Const_u8 str);
|
2019-10-03 17:57:44 +00:00
|
|
|
typedef Log_Function *App_Get_Logger(void);
|
|
|
|
typedef void App_Load_VTables(API_VTable_system *vtable_system,
|
|
|
|
API_VTable_font *vtable_font,
|
|
|
|
API_VTable_graphics *vtable_graphics);
|
2016-05-29 19:28:29 +00:00
|
|
|
|
2016-02-01 05:03:42 +00:00
|
|
|
struct App_Functions{
|
2019-10-03 17:57:44 +00:00
|
|
|
App_Load_VTables *load_vtables;
|
2019-08-16 02:54:06 +00:00
|
|
|
App_Get_Logger *get_logger;
|
2016-02-01 05:03:42 +00:00
|
|
|
App_Read_Command_Line *read_command_line;
|
|
|
|
App_Init *init;
|
|
|
|
App_Step *step;
|
|
|
|
};
|
|
|
|
|
|
|
|
#define App_Get_Functions_Sig(name) App_Functions name()
|
|
|
|
typedef App_Get_Functions_Sig(App_Get_Functions);
|
|
|
|
|
|
|
|
#endif
|
|
|
|
|
|
|
|
// BOTTOM
|
|
|
|
|