comparison src/gui_haiku.cc @ 20134:352701a626ed v8.2.0622

patch 8.2.0622: Haiku: GUI does not compile Commit: https://github.com/vim/vim/commit/beae4084fd34c56d43787be73588070ddc474251 Author: Bram Moolenaar <Bram@vim.org> Date: Thu Apr 23 15:41:49 2020 +0200 patch 8.2.0622: Haiku: GUI does not compile Problem: Haiku: GUI does not compile. Solution: Various fixes. (Emir Sari, closes https://github.com/vim/vim/issues/5961)
author Bram Moolenaar <Bram@vim.org>
date Thu, 23 Apr 2020 16:15:04 +0200
parents 22f0dda71638
children bac01efdf059
comparison
equal deleted inserted replaced
20133:fa4ed8427c0c 20134:352701a626ed
2914 if(fButtonsList.RemoveItem(menu->button)) { 2914 if(fButtonsList.RemoveItem(menu->button)) {
2915 delete menu->button; 2915 delete menu->button;
2916 menu->button = NULL; 2916 menu->button = NULL;
2917 } 2917 }
2918 } 2918 }
2919 return true;
2919 } 2920 }
2920 2921
2921 bool 2922 bool
2922 VimToolbar::GrayButton(vimmenu_T *menu, int grey) 2923 VimToolbar::GrayButton(vimmenu_T *menu, int grey)
2923 { 2924 {
2924 if(menu->button) { 2925 if(menu->button) {
2925 int32 index = fButtonsList.IndexOf(menu->button); 2926 int32 index = fButtonsList.IndexOf(menu->button);
2926 if(index >= 0) 2927 if(index >= 0)
2927 menu->button->SetEnabled(grey ? false : true); 2928 menu->button->SetEnabled(grey ? false : true);
2928 } 2929 }
2930 return true;
2929 } 2931 }
2930 2932
2931 void 2933 void
2932 VimToolbar::InvalidateLayout() 2934 VimToolbar::InvalidateLayout()
2933 { 2935 {
3561 3563
3562 if (gui.vimWindow->Lock()) { 3564 if (gui.vimWindow->Lock()) {
3563 gui.vimTextArea->MoveTo(x, y); 3565 gui.vimTextArea->MoveTo(x, y);
3564 gui.vimTextArea->ResizeTo(w - PEN_WIDTH, h - PEN_WIDTH); 3566 gui.vimTextArea->ResizeTo(w - PEN_WIDTH, h - PEN_WIDTH);
3565 3567
3566 /*#ifdef FEAT_GUI_TABLINE 3568 #ifdef FEAT_GUI_TABLINE
3567 if(gui.vimForm->TabLine() != NULL) { 3569 if(gui.vimForm->TabLine() != NULL) {
3568 gui.vimForm->TabLine()->ResizeTo(w, gui.vimForm->TablineHeight()); 3570 gui.vimForm->TabLine()->ResizeTo(w, gui.vimForm->TablineHeight());
3569 } 3571 }
3570 #endif // FEAT_GUI_TABLINE 3572 #endif // FEAT_GUI_TABLINE
3571 3573
3677 gui.vimForm->AddChild(vsb); 3679 gui.vimForm->AddChild(vsb);
3678 gui.vimWindow->Unlock(); 3680 gui.vimWindow->Unlock();
3679 } 3681 }
3680 } 3682 }
3681 3683
3682 #if defined(FEAT_WINDOWS) || defined(PROTO) 3684 #if defined(FEAT_WINDOWS) || defined(FEAT_GUI_HAIKU) || defined(PROTO)
3683 void 3685 void
3684 gui_mch_destroy_scrollbar( 3686 gui_mch_destroy_scrollbar(
3685 scrollbar_T *sb) 3687 scrollbar_T *sb)
3686 { 3688 {
3687 if (gui.vimWindow->Lock()) { 3689 if (gui.vimWindow->Lock()) {
3734 3736
3735 /* 3737 /*
3736 * Stop the cursor blinking. Show the cursor if it wasn't shown. 3738 * Stop the cursor blinking. Show the cursor if it wasn't shown.
3737 */ 3739 */
3738 void 3740 void
3739 gui_mch_stop_blink() 3741 gui_mch_stop_blink(int may_call_gui_update_cursor)
3740 { 3742 {
3741 // TODO 3743 // TODO
3742 if (blink_timer != 0) 3744 if (blink_timer != 0)
3743 { 3745 {
3744 // XtRemoveTimeOut(blink_timer); 3746 // XtRemoveTimeOut(blink_timer);
3868 vim_snprintf(font_name, buff_size, 3870 vim_snprintf(font_name, buff_size,
3869 (char*)"%s/%s/%.0f", family, style, size); 3871 (char*)"%s/%s/%.0f", family, style, size);
3870 hl_set_font_name((char_u*)font_name); 3872 hl_set_font_name((char_u*)font_name);
3871 3873
3872 // Set guifont to the name of the selected font. 3874 // Set guifont to the name of the selected font.
3873 char_u* new_p_guifont = alloc(STRLEN(font_name) + 1); 3875 char_u* new_p_guifont = (char_u*)alloc(STRLEN(font_name) + 1);
3874 if (new_p_guifont != NULL) { 3876 if (new_p_guifont != NULL) {
3875 STRCPY(new_p_guifont, font_name); 3877 STRCPY(new_p_guifont, font_name);
3876 vim_free(p_guifont); 3878 vim_free(p_guifont);
3877 p_guifont = new_p_guifont; 3879 p_guifont = new_p_guifont;
3878 // Replace spaces in the font name with underscores. 3880 // Replace spaces in the font name with underscores.
4486 if (gui.in_focus != focus) 4488 if (gui.in_focus != focus)
4487 { 4489 {
4488 if (gui.in_focus) 4490 if (gui.in_focus)
4489 gui_mch_start_blink(); 4491 gui_mch_start_blink();
4490 else 4492 else
4491 gui_mch_stop_blink(); 4493 gui_mch_stop_blink(TRUE);
4492 focus = gui.in_focus; 4494 focus = gui.in_focus;
4493 } 4495 }
4494 4496
4495 gui_mch_flush(); 4497 gui_mch_flush();
4496 /* 4498 /*