Some of the work is done on getting the window title thing working

This commit is contained in:
Allen Webster 2017-11-30 11:50:39 -05:00
parent 6c13041dee
commit a1c79c5313
5 changed files with 18 additions and 12 deletions

11
4ed.cpp
View File

@ -193,7 +193,11 @@ struct Command_Data{
System_Functions *system;
Live_Views *live_set;
i32 screen_width, screen_height;
i32 screen_width;
i32 screen_height;
Application_Step_Result *step_result;
Key_Event_Data key;
};
@ -1423,6 +1427,8 @@ App_Init_Sig(app_init){
cmd->system = system;
cmd->live_set = &models->live_set;
cmd->step_result = &app_result;
cmd->screen_width = target->width;
cmd->screen_height = target->height;
@ -1704,11 +1710,14 @@ App_Step_Sig(app_step){
cmd->system = system;
cmd->live_set = &models->live_set;
cmd->step_result = &app_result;
cmd->screen_width = target->width;
cmd->screen_height = target->height;
cmd->key = null_key_event_data;
// NOTE(allen): First frame initialization
if (input->first_step){
// Open command line files.
char space[512];

2
4ed.h
View File

@ -94,6 +94,8 @@ struct Application_Step_Result{
b32 trying_to_kill;
b32 perform_kill;
b32 animating;
b32 has_new_title;
char *title_string;
};
struct Application_Step_Input{

View File

@ -2833,8 +2833,7 @@ DOC_PARAM(title, A null terminated string indicating the new title for the 4code
DOC(Sets 4coder's window title to the specified title string.)
*/{
Command_Data *cmd = (Command_Data*)app->cmd_context;
System_Functions *system = cmd->system;
system->set_title(title);
}
// BOTTOM

View File

@ -212,9 +212,6 @@ typedef Sys_Is_Fullscreen_Sig(System_Is_Fullscreen);
#define Sys_Send_Exit_Signal_Sig(name) void name()
typedef Sys_Send_Exit_Signal_Sig(System_Send_Exit_Signal);
#define Sys_Set_Title_Sig(n,t) void n(char *t)
typedef Sys_Set_Title_Sig(System_Set_Title, title);
// debug
#define Sys_Log_Sig(name) void name(char *message, u32 length)
typedef Sys_Log_Sig(System_Log);
@ -277,7 +274,6 @@ struct System_Functions{
System_Set_Fullscreen *set_fullscreen;
System_Is_Fullscreen *is_fullscreen;
System_Send_Exit_Signal *send_exit_signal;
System_Set_Title *set_title;
// debug: 1
System_Log *log;

View File

@ -191,11 +191,6 @@ Sys_Send_Exit_Signal_Sig(system_send_exit_signal){
osxvars.keep_running = false;
}
internal
Sys_Set_Title_Sig(system_set_title, title){
osx_change_title(title);
}
#include "4ed_coroutine_functions.cpp"
#include "4ed_system_shared.cpp"
@ -642,6 +637,11 @@ osx_step(void){
osxvars.keep_running = true;
}
// NOTE(allen): Switch to New Title
if (result.has_new_title){
osx_change_title(result.title_string);
}
// NOTE(allen): Switch to New Cursor
osx_show_cursor(0, result.mouse_cursor_type);