summaryrefslogtreecommitdiff
path: root/src/gui.c
diff options
context:
space:
mode:
authorBram Moolenaar <Bram@vim.org>2020-02-26 16:16:53 +0100
committerBram Moolenaar <Bram@vim.org>2020-02-26 16:16:53 +0100
commitb3f740695a0199d22cd97aee314f06c7ae32d2ea (patch)
tree8221662bb578d80a7a044f8a20aef09394a5a1a8 /src/gui.c
parentd672dde584effd55702ee15efec4cb2a8c77bf85 (diff)
downloadvim-git-b3f740695a0199d22cd97aee314f06c7ae32d2ea.tar.gz
patch 8.2.0320: no Haiku supportv8.2.0320
Problem: No Haiku support. Solution: Add support for Haiku. (Emir Sari, closes #5605)
Diffstat (limited to 'src/gui.c')
-rw-r--r--src/gui.c37
1 files changed, 28 insertions, 9 deletions
diff --git a/src/gui.c b/src/gui.c
index 3f2a84ccb..4733bad6e 100644
--- a/src/gui.c
+++ b/src/gui.c
@@ -446,7 +446,8 @@ gui_init_check(void)
gui.menu_width = 0;
# endif
#endif
-#if defined(FEAT_TOOLBAR) && (defined(FEAT_GUI_MOTIF) || defined(FEAT_GUI_ATHENA))
+#if defined(FEAT_TOOLBAR) && (defined(FEAT_GUI_MOTIF) || defined(FEAT_GUI_ATHENA) \
+ || defined(FEAT_GUI_HAIKU))
gui.toolbar_height = 0;
#endif
#if defined(FEAT_FOOTER) && defined(FEAT_GUI_MOTIF)
@@ -1371,10 +1372,11 @@ gui_position_components(int total_width UNUSED)
text_area_y += gui.tabline_height;
#endif
-#if defined(FEAT_TOOLBAR) && (defined(FEAT_GUI_MOTIF) || defined(FEAT_GUI_ATHENA))
+#if defined(FEAT_TOOLBAR) && (defined(FEAT_GUI_MOTIF) || defined(FEAT_GUI_ATHENA) \
+ || defined(FEAT_GUI_HAIKU))
if (vim_strchr(p_go, GO_TOOLBAR) != NULL)
{
-# ifdef FEAT_GUI_ATHENA
+# if defined(FEAT_GUI_ATHENA) || defined(FEAT_GUI_HAIKU)
gui_mch_set_toolbar_pos(0, text_area_y,
gui.menu_width, gui.toolbar_height);
# endif
@@ -1382,6 +1384,13 @@ gui_position_components(int total_width UNUSED)
}
#endif
+# if defined(FEAT_GUI_TABLINE) && defined(FEAT_GUI_HAIKU)
+ gui_mch_set_tabline_pos(0, text_area_y,
+ gui.menu_width, gui.tabline_height);
+ if (gui_has_tabline())
+ text_area_y += gui.tabline_height;
+#endif
+
text_area_width = gui.num_cols * gui.char_width + gui.border_offset * 2;
text_area_height = gui.num_rows * gui.char_height + gui.border_offset * 2;
@@ -1453,7 +1462,7 @@ gui_get_base_height(void)
# endif
# endif
# if defined(FEAT_GUI_TABLINE) && (defined(FEAT_GUI_MSWIN) \
- || defined(FEAT_GUI_MOTIF))
+ || defined(FEAT_GUI_MOTIF) || defined(FEAT_GUI_HAIKU))
if (gui_has_tabline())
base_height += gui.tabline_height;
# endif
@@ -1496,6 +1505,10 @@ again:
new_pixel_height = 0;
busy = TRUE;
+#ifdef FEAT_GUI_HAIKU
+ vim_lock_screen();
+#endif
+
// Flush pending output before redrawing
out_flush();
@@ -1518,6 +1531,10 @@ again:
|| gui.num_rows != Rows || gui.num_cols != Columns)
shell_resized();
+#ifdef FEAT_GUI_HAIKU
+ vim_unlock_screen();
+#endif
+
gui_update_scrollbars(TRUE);
gui_update_cursor(FALSE, TRUE);
#if defined(FEAT_XIM) && !defined(FEAT_GUI_GTK)
@@ -4254,9 +4271,10 @@ gui_update_scrollbars(
y += gui.menu_height;
#endif
-#if defined(FEAT_TOOLBAR) && (defined(FEAT_GUI_MSWIN) || defined(FEAT_GUI_ATHENA))
+#if defined(FEAT_TOOLBAR) && (defined(FEAT_GUI_MSWIN) || defined(FEAT_GUI_ATHENA) \
+ || defined(FEAT_GUI_HAIKU))
if (vim_strchr(p_go, GO_TOOLBAR) != NULL)
-# ifdef FEAT_GUI_ATHENA
+# if defined(FEAT_GUI_ATHENA) || defined(FEAT_GUI_HAIKU)
y += gui.toolbar_height;
# else
# ifdef FEAT_GUI_MSWIN
@@ -4265,7 +4283,7 @@ gui_update_scrollbars(
# endif
#endif
-#if defined(FEAT_GUI_TABLINE) && defined(FEAT_GUI_MSWIN)
+#if defined(FEAT_GUI_TABLINE) && defined(FEAT_GUI_MSWIN) || defined(FEAT_GUI_HAIKU)
if (gui_has_tabline())
y += gui.tabline_height;
#endif
@@ -5035,10 +5053,11 @@ ex_gui(exarg_T *eap)
}
#if ((defined(FEAT_GUI_X11) || defined(FEAT_GUI_GTK) \
- || defined(FEAT_GUI_MSWIN) || defined(FEAT_GUI_PHOTON)) \
+ || defined(FEAT_GUI_MSWIN) || defined(FEAT_GUI_PHOTON) \
+ || defined(FEAT_GUI_HAIKU)) \
&& defined(FEAT_TOOLBAR)) || defined(PROTO)
/*
- * This is shared between Athena, Motif and GTK.
+ * This is shared between Athena, Haiku, Motif, and GTK.
*/
/*