clipboard change hook fully integrated

master
Allen Webster 2019-03-30 15:36:31 -07:00
parent b3d043ea23
commit 362c3cea86
3 changed files with 8 additions and 7 deletions

View File

@ -1155,11 +1155,11 @@ STRUCT Color_Table{
TYPEDEF_FUNC Color_Table Modify_Color_Table_Function(struct Application_Links *app, Frame_Info frame); TYPEDEF_FUNC Color_Table Modify_Color_Table_Function(struct Application_Links *app, Frame_Info frame);
#define MODIFY_COLOR_TABLE_SIG(name) Color_Table name(struct Application_Links *app, Frame_Info frame) #define MODIFY_COLOR_TABLE_SIG(name) Color_Table name(struct Application_Links *app, Frame_Info frame)
ENUM(i32, Clipboard_Change_Flag){ ENUM(u32, Clipboard_Change_Flag){
clipboard_from_os = 0x1, ClipboardFlag_FromOS = 0x1,
}; };
TYPEDEF_FUNC void Clipboard_Change_Hook_Function(struct Application_Links *app, String contents, u32 flags); TYPEDEF_FUNC void Clipboard_Change_Hook_Function(struct Application_Links *app, String contents, Clipboard_Change_Flag flags);
#define CLIPBOARD_CHANGE_HOOK_SIG(name) void name(struct Application_Links *app, String contents, u32 flags) #define CLIPBOARD_CHANGE_HOOK_SIG(name) void name(struct Application_Links *app, String contents, Clipboard_Change_Flag flags)
TYPEDEF_FUNC Rect_i32 Get_View_Buffer_Region_Function(struct Application_Links *app, View_ID view_id, Rect_i32 sub_region); TYPEDEF_FUNC Rect_i32 Get_View_Buffer_Region_Function(struct Application_Links *app, View_ID view_id, Rect_i32 sub_region);
#define GET_VIEW_BUFFER_REGION_SIG(name) Rect_i32 name(struct Application_Links *app, View_ID view_id, Rect_i32 sub_region) #define GET_VIEW_BUFFER_REGION_SIG(name) Rect_i32 name(struct Application_Links *app, View_ID view_id, Rect_i32 sub_region)

View File

@ -963,8 +963,8 @@ App_Step_Sig(app_step){
if (clipboard.str != 0){ if (clipboard.str != 0){
String *dest = working_set_next_clipboard_string(&models->mem.heap, &models->working_set, clipboard.size); String *dest = working_set_next_clipboard_string(&models->mem.heap, &models->working_set, clipboard.size);
dest->size = eol_convert_in(dest->str, clipboard.str, clipboard.size); dest->size = eol_convert_in(dest->str, clipboard.str, clipboard.size);
if(input->clipboard_changed && models->clipboard_change) { if (input->clipboard_changed && models->clipboard_change != 0){
models->clipboard_change(&models->app_links, *dest, clipboard_from_os); models->clipboard_change(&models->app_links, *dest, ClipboardFlag_FromOS);
} }
} }

View File

@ -24,4 +24,5 @@ IF NOT DEFINED LIB (IF EXIST "%VC_PATH%" (call "%VC_PATH%\VC\vcvarsall.bat" %1))
SET VC_PATH=C:\Program Files (x86)\Microsoft Visual Studio\2017\Community SET VC_PATH=C:\Program Files (x86)\Microsoft Visual Studio\2017\Community
IF NOT DEFINED LIB (IF EXIST "%VC_PATH%" (call "%VC_PATH%\VC\Auxiliary\Build\vcvarsall.bat" %1)) IF NOT DEFINED LIB (IF EXIST "%VC_PATH%" (call "%VC_PATH%\VC\Auxiliary\Build\vcvarsall.bat" %1))
SET VC_PATH=C:\Program Files (x86)\Microsoft Visual Studio\2017\Professional
IF NOT DEFINED LIB (IF EXIST "%VC_PATH%" (call "%VC_PATH%\VC\Auxiliary\Build\vcvarsall.bat" %1))