removed kill from the dact system
This commit is contained in:
parent
bc15f0ed3c
commit
37e0b17e7c
36
4ed.cpp
36
4ed.cpp
|
@ -907,8 +907,7 @@ COMMAND_DECL(save){
|
||||||
if (file){
|
if (file){
|
||||||
if (name.str){
|
if (name.str){
|
||||||
if (!file->state.is_dummy && file_is_ready(file)){
|
if (!file->state.is_dummy && file_is_ready(file)){
|
||||||
view_save_file(system, &models->mem, &models->working_set,
|
view_save_file(system, models, file, 0, name, 1);
|
||||||
file, 0, name, 1);
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
else{
|
else{
|
||||||
|
@ -929,13 +928,11 @@ COMMAND_DECL(save){
|
||||||
if (name.size != 0){
|
if (name.size != 0){
|
||||||
if (file){
|
if (file){
|
||||||
if (!file->state.is_dummy && file_is_ready(file)){
|
if (!file->state.is_dummy && file_is_ready(file)){
|
||||||
view_save_file(system, &models->mem, &models->working_set,
|
view_save_file(system, models, file, 0, name, 0);
|
||||||
file, 0, name, 0);
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
else{
|
else{
|
||||||
view_save_file(system, &models->mem, &models->working_set,
|
view_save_file(system, models, 0, 0, name, 0);
|
||||||
0, 0, name, 0);
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -992,7 +989,7 @@ COMMAND_DECL(kill_buffer){
|
||||||
if (buffer_id != 0){
|
if (buffer_id != 0){
|
||||||
file = working_set_get_active_file(&models->working_set, buffer_id);
|
file = working_set_get_active_file(&models->working_set, buffer_id);
|
||||||
if (file){
|
if (file){
|
||||||
delayed_kill(delay, file);
|
kill_file(system, models, file, string_zero());
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
else if (file){
|
else if (file){
|
||||||
|
@ -4381,21 +4378,13 @@ App_Step_Sig(app_step){
|
||||||
view->map = get_map(models, file->settings.base_map_id);
|
view->map = get_map(models, file->settings.base_map_id);
|
||||||
}
|
}
|
||||||
}break;
|
}break;
|
||||||
|
|
||||||
|
#if 0
|
||||||
case DACT_KILL:
|
case DACT_KILL:
|
||||||
{
|
{
|
||||||
if (!file && string.str){
|
|
||||||
file = working_set_lookup_file(working_set, string);
|
|
||||||
if (!file){
|
|
||||||
file = working_set_contains(system, working_set, string);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
if (file && !file->settings.never_kill){
|
|
||||||
working_set_remove(system, working_set, file->name.source_path);
|
|
||||||
kill_file(system, exchange, models, file);
|
|
||||||
}
|
|
||||||
}break;
|
}break;
|
||||||
|
#endif
|
||||||
|
|
||||||
case DACT_TRY_KILL:
|
case DACT_TRY_KILL:
|
||||||
{
|
{
|
||||||
|
@ -4413,16 +4402,17 @@ App_Step_Sig(app_step){
|
||||||
file = working_set_contains(system, working_set, string);
|
file = working_set_contains(system, working_set, string);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
if (file && !file->settings.never_kill){
|
if (file && !file->settings.never_kill){
|
||||||
if (buffer_needs_save(file)){
|
if (buffer_needs_save(file)){
|
||||||
copy(&view->dest, file->name.live_name);
|
|
||||||
view_show_interactive(system, view, &models->map_ui,
|
view_show_interactive(system, view, &models->map_ui,
|
||||||
IAct_Sure_To_Kill, IInt_Sure_To_Kill, make_lit_string("Are you sure?"));
|
IAct_Sure_To_Kill, IInt_Sure_To_Kill,
|
||||||
|
make_lit_string("Are you sure?"));
|
||||||
|
copy(&view->dest, file->name.live_name);
|
||||||
}
|
}
|
||||||
else{
|
else{
|
||||||
working_set_remove(system, working_set, file->name.source_path);
|
working_set_remove(system, working_set, file->name.source_path);
|
||||||
kill_file(system, exchange, models, file);
|
kill_file(system, models, file, string_zero());
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}break;
|
}break;
|
||||||
|
|
|
@ -2,7 +2,6 @@ enum Action_Type{
|
||||||
DACT_SET_LINE,
|
DACT_SET_LINE,
|
||||||
DACT_SWITCH,
|
DACT_SWITCH,
|
||||||
DACT_TRY_KILL,
|
DACT_TRY_KILL,
|
||||||
DACT_KILL,
|
|
||||||
DACT_TOUCH_FILE,
|
DACT_TOUCH_FILE,
|
||||||
DACT_CLOSE,
|
DACT_CLOSE,
|
||||||
};
|
};
|
||||||
|
@ -125,6 +124,5 @@ delayed_action_repush(Delay *delay, Delayed_Action *act){
|
||||||
#define delayed_set_line(delay, ...) delayed_action_(delay, DACT_SET_LINE, ##__VA_ARGS__)
|
#define delayed_set_line(delay, ...) delayed_action_(delay, DACT_SET_LINE, ##__VA_ARGS__)
|
||||||
#define delayed_switch(delay, ...) delayed_action_(delay, DACT_SWITCH, ##__VA_ARGS__)
|
#define delayed_switch(delay, ...) delayed_action_(delay, DACT_SWITCH, ##__VA_ARGS__)
|
||||||
#define delayed_try_kill(delay, ...) delayed_action_(delay, DACT_TRY_KILL, ##__VA_ARGS__)
|
#define delayed_try_kill(delay, ...) delayed_action_(delay, DACT_TRY_KILL, ##__VA_ARGS__)
|
||||||
#define delayed_kill(delay, ...) delayed_action_(delay, DACT_KILL, ##__VA_ARGS__)
|
|
||||||
#define delayed_touch_file(delay, ...) delayed_action_(delay, DACT_TOUCH_FILE, ##__VA_ARGS__)
|
#define delayed_touch_file(delay, ...) delayed_action_(delay, DACT_TOUCH_FILE, ##__VA_ARGS__)
|
||||||
#define delayed_close(delay, ...) delayed_action_(delay, DACT_CLOSE, ##__VA_ARGS__)
|
#define delayed_close(delay, ...) delayed_action_(delay, DACT_CLOSE, ##__VA_ARGS__)
|
||||||
|
|
|
@ -3023,8 +3023,11 @@ view_show_file(View *view){
|
||||||
}
|
}
|
||||||
|
|
||||||
internal void
|
internal void
|
||||||
view_save_file(System_Functions *system, Mem_Options *mem, Working_Set *working_set,
|
view_save_file(System_Functions *system, Models *models,
|
||||||
Editing_File *file, View *view, String filename, b32 save_as){
|
Editing_File *file, View *view, String filename, b32 save_as){
|
||||||
|
Mem_Options *mem = &models->mem;
|
||||||
|
Working_Set *working_set = &models->working_set;
|
||||||
|
|
||||||
if (!file){
|
if (!file){
|
||||||
if (view){
|
if (view){
|
||||||
file = view->file_data.file;
|
file = view->file_data.file;
|
||||||
|
@ -3131,6 +3134,41 @@ view_open_file(System_Functions *system, Models *models,
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
internal void
|
||||||
|
kill_file(System_Functions *system, Models *models,
|
||||||
|
Editing_File *file, String string){
|
||||||
|
Working_Set *working_set = &models->working_set;
|
||||||
|
|
||||||
|
if (!file && string.str){
|
||||||
|
file = working_set_lookup_file(working_set, string);
|
||||||
|
if (!file){
|
||||||
|
file = working_set_contains(system, working_set, string);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
if (file && !file->settings.never_kill){
|
||||||
|
working_set_remove(system, working_set, file->name.source_path);
|
||||||
|
file_close(system, &models->mem.general, file);
|
||||||
|
working_set_free_file(&models->working_set, file);
|
||||||
|
|
||||||
|
File_Node *used = &models->working_set.used_sentinel;
|
||||||
|
File_Node *node = used->next;
|
||||||
|
for (View_Iter iter = file_view_iter_init(&models->layout, file, 0);
|
||||||
|
file_view_iter_good(iter);
|
||||||
|
iter = file_view_iter_next(iter)){
|
||||||
|
if (node != used){
|
||||||
|
iter.view->file_data.file = 0;
|
||||||
|
view_set_file(iter.view, (Editing_File*)node, models);
|
||||||
|
node = node->next;
|
||||||
|
}
|
||||||
|
else{
|
||||||
|
iter.view->file_data.file = 0;
|
||||||
|
view_set_file(iter.view, 0, models);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
internal void
|
internal void
|
||||||
interactive_view_complete(System_Functions *system, View *view, String dest, i32 user_action){
|
interactive_view_complete(System_Functions *system, View *view, String dest, i32 user_action){
|
||||||
Models *models = view->persistent.models;
|
Models *models = view->persistent.models;
|
||||||
|
@ -3144,8 +3182,7 @@ interactive_view_complete(System_Functions *system, View *view, String dest, i32
|
||||||
break;
|
break;
|
||||||
|
|
||||||
case IAct_Save_As:
|
case IAct_Save_As:
|
||||||
view_save_file(system, &models->mem, &models->working_set,
|
view_save_file(system, models, 0, view, dest, 1);
|
||||||
0, view, dest, 1);
|
|
||||||
break;
|
break;
|
||||||
|
|
||||||
case IAct_New:
|
case IAct_New:
|
||||||
|
@ -3182,16 +3219,15 @@ interactive_view_complete(System_Functions *system, View *view, String dest, i32
|
||||||
case IAct_Sure_To_Kill:
|
case IAct_Sure_To_Kill:
|
||||||
switch (user_action){
|
switch (user_action){
|
||||||
case 0:
|
case 0:
|
||||||
delayed_kill(&models->delay1, dest);
|
kill_file(system, models, 0, dest);
|
||||||
break;
|
break;
|
||||||
|
|
||||||
case 1:
|
case 1:
|
||||||
break;
|
break;
|
||||||
|
|
||||||
case 2:
|
case 2:
|
||||||
view_save_file(system, &models->mem, &models->working_set,
|
view_save_file(system, models, 0, 0, dest, 0);
|
||||||
0, 0, dest, 0);
|
kill_file(system, models, 0, dest);;
|
||||||
delayed_kill(&models->delay1, dest);
|
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
|
@ -5055,8 +5091,8 @@ draw_style_preview(GUI_Target *gui_target, Render_Target *target, View *view, i3
|
||||||
|
|
||||||
internal i32
|
internal i32
|
||||||
do_render_file_view(System_Functions *system, Exchange *exchange,
|
do_render_file_view(System_Functions *system, Exchange *exchange,
|
||||||
View *view, View *active, i32_Rect rect, b32 is_active,
|
View *view, View *active, i32_Rect rect, b32 is_active,
|
||||||
Render_Target *target, Input_Summary *user_input){
|
Render_Target *target, Input_Summary *user_input){
|
||||||
|
|
||||||
Editing_File *file = view->file_data.file;
|
Editing_File *file = view->file_data.file;
|
||||||
i32 result = 0;
|
i32 result = 0;
|
||||||
|
@ -5067,233 +5103,208 @@ do_render_file_view(System_Functions *system, Exchange *exchange,
|
||||||
GUI_Interpret_Result interpret_result = {0};
|
GUI_Interpret_Result interpret_result = {0};
|
||||||
|
|
||||||
f32 v;
|
f32 v;
|
||||||
|
|
||||||
if (gui_target->push.pos > 0){
|
if (gui_target->push.pos > 0){
|
||||||
gui_session_init(&gui_session, gui_target, rect, view->font_height);
|
gui_session_init(&gui_session, gui_target, rect, view->font_height);
|
||||||
|
|
||||||
v = view_get_scroll_y(view);
|
|
||||||
|
|
||||||
i32_Rect clip_rect = rect;
|
|
||||||
draw_push_clip(target, clip_rect);
|
|
||||||
|
|
||||||
for (h = (GUI_Header*)gui_target->push.base;
|
|
||||||
h->type;
|
|
||||||
h = NextHeader(h)){
|
|
||||||
interpret_result = gui_interpret(gui_target, &gui_session, h,
|
|
||||||
*view->current_scroll,
|
|
||||||
view->scroll_region);
|
|
||||||
|
|
||||||
if (interpret_result.has_info){
|
v = view_get_scroll_y(view);
|
||||||
if (gui_session.clip_y > clip_rect.y0){
|
|
||||||
clip_rect.y0 = gui_session.clip_y;
|
i32_Rect clip_rect = rect;
|
||||||
draw_change_clip(target, clip_rect);
|
draw_push_clip(target, clip_rect);
|
||||||
}
|
|
||||||
|
for (h = (GUI_Header*)gui_target->push.base;
|
||||||
|
h->type;
|
||||||
|
h = NextHeader(h)){
|
||||||
|
interpret_result = gui_interpret(gui_target, &gui_session, h,
|
||||||
|
*view->current_scroll,
|
||||||
|
view->scroll_region);
|
||||||
|
|
||||||
switch (h->type){
|
if (interpret_result.has_info){
|
||||||
case guicom_top_bar:
|
if (gui_session.clip_y > clip_rect.y0){
|
||||||
{
|
clip_rect.y0 = gui_session.clip_y;
|
||||||
draw_file_bar(target, view, file, gui_session.rect);
|
draw_change_clip(target, clip_rect);
|
||||||
}break;
|
}
|
||||||
|
|
||||||
case guicom_file:
|
|
||||||
{
|
|
||||||
if (view->reinit_scrolling){
|
|
||||||
view_reinit_scrolling(view);
|
|
||||||
}
|
|
||||||
if (file && file_is_ready(file)){
|
|
||||||
result = draw_file_loaded(view, gui_session.rect, is_active, target);
|
|
||||||
}
|
|
||||||
}break;
|
|
||||||
|
|
||||||
case guicom_text_field:
|
switch (h->type){
|
||||||
{
|
case guicom_top_bar:
|
||||||
void *ptr = (h+1);
|
{
|
||||||
String p = gui_read_string(&ptr);
|
draw_file_bar(target, view, file, gui_session.rect);
|
||||||
String t = gui_read_string(&ptr);
|
}break;
|
||||||
draw_text_field(target, view, gui_session.rect, p, t);
|
|
||||||
}break;
|
|
||||||
|
|
||||||
case guicom_text_with_cursor:
|
|
||||||
{
|
|
||||||
void *ptr = (h+1);
|
|
||||||
String s = gui_read_string(&ptr);
|
|
||||||
i32 pos = gui_read_integer(&ptr);
|
|
||||||
|
|
||||||
draw_text_with_cursor(target, view, gui_session.rect, s, pos);
|
case guicom_file:
|
||||||
}break;
|
{
|
||||||
|
if (view->reinit_scrolling){
|
||||||
case guicom_color_button:
|
view_reinit_scrolling(view);
|
||||||
{
|
}
|
||||||
GUI_Interactive *b = (GUI_Interactive*)h;
|
if (file && file_is_ready(file)){
|
||||||
void *ptr = (b + 1);
|
result = draw_file_loaded(view, gui_session.rect, is_active, target);
|
||||||
u32 fore = (u32)gui_read_integer(&ptr);
|
}
|
||||||
u32 back = (u32)gui_read_integer(&ptr);
|
}break;
|
||||||
String t = gui_read_string(&ptr);
|
|
||||||
|
|
||||||
draw_color_button(gui_target, target, view, gui_session.rect, b->id, fore, back, t);
|
case guicom_text_field:
|
||||||
}break;
|
{
|
||||||
|
void *ptr = (h+1);
|
||||||
case guicom_font_button:
|
String p = gui_read_string(&ptr);
|
||||||
{
|
String t = gui_read_string(&ptr);
|
||||||
GUI_Interactive *b = (GUI_Interactive*)h;
|
draw_text_field(target, view, gui_session.rect, p, t);
|
||||||
void *ptr = (b + 1);
|
}break;
|
||||||
i16 font_id = (i16)gui_read_integer(&ptr);
|
|
||||||
String t = gui_read_string(&ptr);
|
|
||||||
|
|
||||||
draw_font_button(gui_target, target, view, gui_session.rect, b->id, font_id, t);
|
case guicom_text_with_cursor:
|
||||||
}break;
|
{
|
||||||
|
void *ptr = (h+1);
|
||||||
case guicom_file_option:
|
String s = gui_read_string(&ptr);
|
||||||
{
|
i32 pos = gui_read_integer(&ptr);
|
||||||
GUI_Interactive *b = (GUI_Interactive*)h;
|
|
||||||
void *ptr = (b + 1);
|
draw_text_with_cursor(target, view, gui_session.rect, s, pos);
|
||||||
b32 folder = gui_read_integer(&ptr);
|
}break;
|
||||||
String f = gui_read_string(&ptr);
|
|
||||||
String m = gui_read_string(&ptr);
|
|
||||||
|
|
||||||
if (folder){
|
case guicom_color_button:
|
||||||
append(&f, system->slash);
|
{
|
||||||
}
|
GUI_Interactive *b = (GUI_Interactive*)h;
|
||||||
|
void *ptr = (b + 1);
|
||||||
|
u32 fore = (u32)gui_read_integer(&ptr);
|
||||||
|
u32 back = (u32)gui_read_integer(&ptr);
|
||||||
|
String t = gui_read_string(&ptr);
|
||||||
|
|
||||||
|
draw_color_button(gui_target, target, view, gui_session.rect, b->id, fore, back, t);
|
||||||
|
}break;
|
||||||
|
|
||||||
draw_fat_option_block(gui_target, target, view, gui_session.rect, b->id, f, m);
|
case guicom_font_button:
|
||||||
}break;
|
{
|
||||||
|
GUI_Interactive *b = (GUI_Interactive*)h;
|
||||||
case guicom_style_preview:
|
void *ptr = (b + 1);
|
||||||
{
|
i16 font_id = (i16)gui_read_integer(&ptr);
|
||||||
GUI_Interactive *b = (GUI_Interactive*)h;
|
String t = gui_read_string(&ptr);
|
||||||
i32 style_index = *(i32*)(b + 1);
|
|
||||||
Style *style = get_style(view->persistent.models, style_index);
|
draw_font_button(gui_target, target, view, gui_session.rect, b->id, font_id, t);
|
||||||
|
}break;
|
||||||
|
|
||||||
draw_style_preview(gui_target, target, view, gui_session.rect, b->id, style);
|
case guicom_file_option:
|
||||||
}break;
|
{
|
||||||
|
GUI_Interactive *b = (GUI_Interactive*)h;
|
||||||
case guicom_fixed_option:
|
void *ptr = (b + 1);
|
||||||
case guicom_fixed_option_checkbox:
|
b32 folder = gui_read_integer(&ptr);
|
||||||
{
|
String f = gui_read_string(&ptr);
|
||||||
GUI_Interactive *b = (GUI_Interactive*)h;
|
String m = gui_read_string(&ptr);
|
||||||
void *ptr = (b + 1);
|
|
||||||
String f = gui_read_string(&ptr);
|
if (folder){
|
||||||
String m = {0};
|
append(&f, system->slash);
|
||||||
i8 status = -1;
|
}
|
||||||
if (h->type == guicom_fixed_option_checkbox){
|
|
||||||
gui_read_byte(&ptr);
|
draw_fat_option_block(gui_target, target, view, gui_session.rect, b->id, f, m);
|
||||||
status = (i8)gui_read_byte(&ptr);
|
}break;
|
||||||
}
|
|
||||||
|
|
||||||
draw_fat_option_block(gui_target, target, view, gui_session.rect, b->id, f, m, status);
|
case guicom_style_preview:
|
||||||
}break;
|
{
|
||||||
|
GUI_Interactive *b = (GUI_Interactive*)h;
|
||||||
case guicom_button:
|
i32 style_index = *(i32*)(b + 1);
|
||||||
{
|
Style *style = get_style(view->persistent.models, style_index);
|
||||||
GUI_Interactive *b = (GUI_Interactive*)h;
|
|
||||||
void *ptr = (b + 1);
|
draw_style_preview(gui_target, target, view, gui_session.rect, b->id, style);
|
||||||
String t = gui_read_string(&ptr);
|
}break;
|
||||||
|
|
||||||
draw_button(gui_target, target, view, gui_session.rect, b->id, t);
|
case guicom_fixed_option:
|
||||||
}break;
|
case guicom_fixed_option_checkbox:
|
||||||
|
{
|
||||||
case guicom_scrollable_bar:
|
GUI_Interactive *b = (GUI_Interactive*)h;
|
||||||
{
|
void *ptr = (b + 1);
|
||||||
Models *models = view->persistent.models;
|
String f = gui_read_string(&ptr);
|
||||||
Style *style = main_style(models);
|
String m = {0};
|
||||||
|
i8 status = -1;
|
||||||
|
if (h->type == guicom_fixed_option_checkbox){
|
||||||
|
gui_read_byte(&ptr);
|
||||||
|
status = (i8)gui_read_byte(&ptr);
|
||||||
|
}
|
||||||
|
|
||||||
|
draw_fat_option_block(gui_target, target, view, gui_session.rect, b->id, f, m, status);
|
||||||
|
}break;
|
||||||
|
|
||||||
u32 back;
|
case guicom_button:
|
||||||
u32 outline;
|
{
|
||||||
|
GUI_Interactive *b = (GUI_Interactive*)h;
|
||||||
|
void *ptr = (b + 1);
|
||||||
|
String t = gui_read_string(&ptr);
|
||||||
|
|
||||||
|
draw_button(gui_target, target, view, gui_session.rect, b->id, t);
|
||||||
|
}break;
|
||||||
|
|
||||||
i32_Rect bar = gui_session.rect;
|
case guicom_scrollable_bar:
|
||||||
|
{
|
||||||
|
Models *models = view->persistent.models;
|
||||||
|
Style *style = main_style(models);
|
||||||
|
|
||||||
|
u32 back;
|
||||||
|
u32 outline;
|
||||||
|
|
||||||
|
i32_Rect bar = gui_session.rect;
|
||||||
|
|
||||||
|
back = style->main.back_color;
|
||||||
|
if (is_active){
|
||||||
|
outline = style->main.margin_active_color;
|
||||||
|
}
|
||||||
|
else{
|
||||||
|
outline = style->main.margin_color;
|
||||||
|
}
|
||||||
|
|
||||||
|
draw_rectangle(target, bar, back);
|
||||||
|
draw_rectangle_outline(target, bar, outline);
|
||||||
|
}break;
|
||||||
|
|
||||||
back = style->main.back_color;
|
case guicom_scrollable_top:
|
||||||
if (is_active){
|
case guicom_scrollable_slider:
|
||||||
outline = style->main.margin_active_color;
|
case guicom_scrollable_bottom:
|
||||||
}
|
{
|
||||||
else{
|
GUI_id id;
|
||||||
outline = style->main.margin_color;
|
Models *models = view->persistent.models;
|
||||||
}
|
Style *style = main_style(models);
|
||||||
|
i32_Rect box = gui_session.rect;
|
||||||
|
|
||||||
|
i32 active_level;
|
||||||
|
|
||||||
|
u32 back;
|
||||||
|
u32 outline;
|
||||||
|
|
||||||
|
switch (h->type){
|
||||||
|
case guicom_scrollable_top: id = gui_id_scrollbar_top(); break;
|
||||||
|
case guicom_scrollable_bottom: id = gui_id_scrollbar_bottom(); break;
|
||||||
|
default: id = gui_id_scrollbar_slider(); break;
|
||||||
|
}
|
||||||
|
|
||||||
|
active_level = gui_active_level(gui_target, id);
|
||||||
|
|
||||||
|
switch (active_level){
|
||||||
|
case 0: back = style->main.back_color; break;
|
||||||
|
case 1: back = style->main.margin_hover_color; break;
|
||||||
|
default: back = style->main.margin_active_color; break;
|
||||||
|
}
|
||||||
|
|
||||||
|
if (is_active){
|
||||||
|
outline = style->main.margin_active_color;
|
||||||
|
}
|
||||||
|
else{
|
||||||
|
outline = style->main.margin_color;
|
||||||
|
}
|
||||||
|
|
||||||
|
draw_rectangle(target, box, back);
|
||||||
|
draw_margin(target, box, get_inner_rect(box, 2), outline);
|
||||||
|
}break;
|
||||||
|
|
||||||
draw_rectangle(target, bar, back);
|
case guicom_begin_scrollable_section:
|
||||||
draw_rectangle_outline(target, bar, outline);
|
clip_rect.x1 = Min(gui_session.scroll_region.x1, clip_rect.x1);
|
||||||
}break;
|
draw_push_clip(target, clip_rect);
|
||||||
|
break;
|
||||||
case guicom_scrollable_top:
|
|
||||||
case guicom_scrollable_slider:
|
|
||||||
case guicom_scrollable_bottom:
|
|
||||||
{
|
|
||||||
GUI_id id;
|
|
||||||
Models *models = view->persistent.models;
|
|
||||||
Style *style = main_style(models);
|
|
||||||
i32_Rect box = gui_session.rect;
|
|
||||||
|
|
||||||
i32 active_level;
|
case guicom_end_scrollable_section:
|
||||||
|
clip_rect = draw_pop_clip(target);
|
||||||
u32 back;
|
break;
|
||||||
u32 outline;
|
}
|
||||||
|
}
|
||||||
switch (h->type){
|
|
||||||
case guicom_scrollable_top: id = gui_id_scrollbar_top(); break;
|
|
||||||
case guicom_scrollable_bottom: id = gui_id_scrollbar_bottom(); break;
|
|
||||||
default: id = gui_id_scrollbar_slider(); break;
|
|
||||||
}
|
|
||||||
|
|
||||||
active_level = gui_active_level(gui_target, id);
|
|
||||||
|
|
||||||
switch (active_level){
|
|
||||||
case 0: back = style->main.back_color; break;
|
|
||||||
case 1: back = style->main.margin_hover_color; break;
|
|
||||||
default: back = style->main.margin_active_color; break;
|
|
||||||
}
|
|
||||||
|
|
||||||
if (is_active){
|
|
||||||
outline = style->main.margin_active_color;
|
|
||||||
}
|
|
||||||
else{
|
|
||||||
outline = style->main.margin_color;
|
|
||||||
}
|
|
||||||
|
|
||||||
draw_rectangle(target, box, back);
|
|
||||||
draw_margin(target, box, get_inner_rect(box, 2), outline);
|
|
||||||
}break;
|
|
||||||
|
|
||||||
case guicom_begin_scrollable_section:
|
|
||||||
clip_rect.x1 = Min(gui_session.scroll_region.x1, clip_rect.x1);
|
|
||||||
draw_push_clip(target, clip_rect);
|
|
||||||
break;
|
|
||||||
|
|
||||||
case guicom_end_scrollable_section:
|
|
||||||
clip_rect = draw_pop_clip(target);
|
|
||||||
break;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
draw_pop_clip(target);
|
|
||||||
}
|
|
||||||
|
|
||||||
return(result);
|
|
||||||
}
|
|
||||||
|
|
||||||
internal void
|
|
||||||
kill_file(System_Functions *system, Exchange *exchange, Models *models, Editing_File *file){
|
|
||||||
File_Node *node, *used;
|
|
||||||
|
|
||||||
file_close(system, &models->mem.general, file);
|
|
||||||
working_set_free_file(&models->working_set, file);
|
|
||||||
|
|
||||||
used = &models->working_set.used_sentinel;
|
|
||||||
node = used->next;
|
|
||||||
|
|
||||||
for (View_Iter iter = file_view_iter_init(&models->layout, file, 0);
|
|
||||||
file_view_iter_good(iter);
|
|
||||||
iter = file_view_iter_next(iter)){
|
|
||||||
if (node != used){
|
|
||||||
iter.view->file_data.file = 0;
|
|
||||||
view_set_file(iter.view, (Editing_File*)node, models);
|
|
||||||
node = node->next;
|
|
||||||
}
|
|
||||||
else{
|
|
||||||
iter.view->file_data.file = 0;
|
|
||||||
view_set_file(iter.view, 0, models);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
draw_pop_clip(target);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
return(result);
|
||||||
}
|
}
|
||||||
|
|
||||||
inline void
|
inline void
|
||||||
|
|
|
@ -158,8 +158,11 @@ char *daction_enum[] = {
|
||||||
#endif
|
#endif
|
||||||
"SWITCH",
|
"SWITCH",
|
||||||
"TRY_KILL",
|
"TRY_KILL",
|
||||||
|
#if 0
|
||||||
"KILL",
|
"KILL",
|
||||||
|
#endif
|
||||||
"TOUCH_FILE",
|
"TOUCH_FILE",
|
||||||
|
|
||||||
"CLOSE",
|
"CLOSE",
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue