comparison src/gui.c @ 19526:22f0dda71638 v8.2.0320

patch 8.2.0320: no Haiku support Commit: https://github.com/vim/vim/commit/b3f740695a0199d22cd97aee314f06c7ae32d2ea Author: Bram Moolenaar <Bram@vim.org> Date: Wed Feb 26 16:16:53 2020 +0100 patch 8.2.0320: no Haiku support Problem: No Haiku support. Solution: Add support for Haiku. (Emir Sari, closes https://github.com/vim/vim/issues/5605)
author Bram Moolenaar <Bram@vim.org>
date Wed, 26 Feb 2020 16:30:04 +0100
parents 5512aa74cb62
children 9daed26b788b
comparison
equal deleted inserted replaced
19525:619eb9bc3249 19526:22f0dda71638
444 # ifndef FEAT_GUI_GTK 444 # ifndef FEAT_GUI_GTK
445 gui.menu_height = MENU_DEFAULT_HEIGHT; 445 gui.menu_height = MENU_DEFAULT_HEIGHT;
446 gui.menu_width = 0; 446 gui.menu_width = 0;
447 # endif 447 # endif
448 #endif 448 #endif
449 #if defined(FEAT_TOOLBAR) && (defined(FEAT_GUI_MOTIF) || defined(FEAT_GUI_ATHENA)) 449 #if defined(FEAT_TOOLBAR) && (defined(FEAT_GUI_MOTIF) || defined(FEAT_GUI_ATHENA) \
450 || defined(FEAT_GUI_HAIKU))
450 gui.toolbar_height = 0; 451 gui.toolbar_height = 0;
451 #endif 452 #endif
452 #if defined(FEAT_FOOTER) && defined(FEAT_GUI_MOTIF) 453 #if defined(FEAT_FOOTER) && defined(FEAT_GUI_MOTIF)
453 gui.footer_height = 0; 454 gui.footer_height = 0;
454 #endif 455 #endif
1369 || defined(FEAT_GUI_MOTIF) || defined(FEAT_GUI_MAC)) 1370 || defined(FEAT_GUI_MOTIF) || defined(FEAT_GUI_MAC))
1370 if (gui_has_tabline()) 1371 if (gui_has_tabline())
1371 text_area_y += gui.tabline_height; 1372 text_area_y += gui.tabline_height;
1372 #endif 1373 #endif
1373 1374
1374 #if defined(FEAT_TOOLBAR) && (defined(FEAT_GUI_MOTIF) || defined(FEAT_GUI_ATHENA)) 1375 #if defined(FEAT_TOOLBAR) && (defined(FEAT_GUI_MOTIF) || defined(FEAT_GUI_ATHENA) \
1376 || defined(FEAT_GUI_HAIKU))
1375 if (vim_strchr(p_go, GO_TOOLBAR) != NULL) 1377 if (vim_strchr(p_go, GO_TOOLBAR) != NULL)
1376 { 1378 {
1377 # ifdef FEAT_GUI_ATHENA 1379 # if defined(FEAT_GUI_ATHENA) || defined(FEAT_GUI_HAIKU)
1378 gui_mch_set_toolbar_pos(0, text_area_y, 1380 gui_mch_set_toolbar_pos(0, text_area_y,
1379 gui.menu_width, gui.toolbar_height); 1381 gui.menu_width, gui.toolbar_height);
1380 # endif 1382 # endif
1381 text_area_y += gui.toolbar_height; 1383 text_area_y += gui.toolbar_height;
1382 } 1384 }
1385 #endif
1386
1387 # if defined(FEAT_GUI_TABLINE) && defined(FEAT_GUI_HAIKU)
1388 gui_mch_set_tabline_pos(0, text_area_y,
1389 gui.menu_width, gui.tabline_height);
1390 if (gui_has_tabline())
1391 text_area_y += gui.tabline_height;
1383 #endif 1392 #endif
1384 1393
1385 text_area_width = gui.num_cols * gui.char_width + gui.border_offset * 2; 1394 text_area_width = gui.num_cols * gui.char_width + gui.border_offset * 2;
1386 text_area_height = gui.num_rows * gui.char_height + gui.border_offset * 2; 1395 text_area_height = gui.num_rows * gui.char_height + gui.border_offset * 2;
1387 1396
1451 # else 1460 # else
1452 base_height += gui.toolbar_height; 1461 base_height += gui.toolbar_height;
1453 # endif 1462 # endif
1454 # endif 1463 # endif
1455 # if defined(FEAT_GUI_TABLINE) && (defined(FEAT_GUI_MSWIN) \ 1464 # if defined(FEAT_GUI_TABLINE) && (defined(FEAT_GUI_MSWIN) \
1456 || defined(FEAT_GUI_MOTIF)) 1465 || defined(FEAT_GUI_MOTIF) || defined(FEAT_GUI_HAIKU))
1457 if (gui_has_tabline()) 1466 if (gui_has_tabline())
1458 base_height += gui.tabline_height; 1467 base_height += gui.tabline_height;
1459 # endif 1468 # endif
1460 # ifdef FEAT_FOOTER 1469 # ifdef FEAT_FOOTER
1461 if (vim_strchr(p_go, GO_FOOTER) != NULL) 1470 if (vim_strchr(p_go, GO_FOOTER) != NULL)
1493 1502
1494 again: 1503 again:
1495 new_pixel_width = 0; 1504 new_pixel_width = 0;
1496 new_pixel_height = 0; 1505 new_pixel_height = 0;
1497 busy = TRUE; 1506 busy = TRUE;
1507
1508 #ifdef FEAT_GUI_HAIKU
1509 vim_lock_screen();
1510 #endif
1498 1511
1499 // Flush pending output before redrawing 1512 // Flush pending output before redrawing
1500 out_flush(); 1513 out_flush();
1501 1514
1502 gui.num_cols = (pixel_width - gui_get_base_width()) / gui.char_width; 1515 gui.num_cols = (pixel_width - gui_get_base_width()) / gui.char_width;
1515 // Only comparing Rows and Columns may be sufficient, but let's stay on 1528 // Only comparing Rows and Columns may be sufficient, but let's stay on
1516 // the safe side. 1529 // the safe side.
1517 if (gui.num_rows != screen_Rows || gui.num_cols != screen_Columns 1530 if (gui.num_rows != screen_Rows || gui.num_cols != screen_Columns
1518 || gui.num_rows != Rows || gui.num_cols != Columns) 1531 || gui.num_rows != Rows || gui.num_cols != Columns)
1519 shell_resized(); 1532 shell_resized();
1533
1534 #ifdef FEAT_GUI_HAIKU
1535 vim_unlock_screen();
1536 #endif
1520 1537
1521 gui_update_scrollbars(TRUE); 1538 gui_update_scrollbars(TRUE);
1522 gui_update_cursor(FALSE, TRUE); 1539 gui_update_cursor(FALSE, TRUE);
1523 #if defined(FEAT_XIM) && !defined(FEAT_GUI_GTK) 1540 #if defined(FEAT_XIM) && !defined(FEAT_GUI_GTK)
1524 xim_set_status_area(); 1541 xim_set_status_area();
4252 #if defined(FEAT_MENU) && !defined(FEAT_GUI_GTK) && !defined(FEAT_GUI_MOTIF) && !defined(FEAT_GUI_PHOTON) 4269 #if defined(FEAT_MENU) && !defined(FEAT_GUI_GTK) && !defined(FEAT_GUI_MOTIF) && !defined(FEAT_GUI_PHOTON)
4253 if (gui.menu_is_active) 4270 if (gui.menu_is_active)
4254 y += gui.menu_height; 4271 y += gui.menu_height;
4255 #endif 4272 #endif
4256 4273
4257 #if defined(FEAT_TOOLBAR) && (defined(FEAT_GUI_MSWIN) || defined(FEAT_GUI_ATHENA)) 4274 #if defined(FEAT_TOOLBAR) && (defined(FEAT_GUI_MSWIN) || defined(FEAT_GUI_ATHENA) \
4275 || defined(FEAT_GUI_HAIKU))
4258 if (vim_strchr(p_go, GO_TOOLBAR) != NULL) 4276 if (vim_strchr(p_go, GO_TOOLBAR) != NULL)
4259 # ifdef FEAT_GUI_ATHENA 4277 # if defined(FEAT_GUI_ATHENA) || defined(FEAT_GUI_HAIKU)
4260 y += gui.toolbar_height; 4278 y += gui.toolbar_height;
4261 # else 4279 # else
4262 # ifdef FEAT_GUI_MSWIN 4280 # ifdef FEAT_GUI_MSWIN
4263 y += TOOLBAR_BUTTON_HEIGHT + TOOLBAR_BORDER_HEIGHT; 4281 y += TOOLBAR_BUTTON_HEIGHT + TOOLBAR_BORDER_HEIGHT;
4264 # endif 4282 # endif
4265 # endif 4283 # endif
4266 #endif 4284 #endif
4267 4285
4268 #if defined(FEAT_GUI_TABLINE) && defined(FEAT_GUI_MSWIN) 4286 #if defined(FEAT_GUI_TABLINE) && defined(FEAT_GUI_MSWIN) || defined(FEAT_GUI_HAIKU)
4269 if (gui_has_tabline()) 4287 if (gui_has_tabline())
4270 y += gui.tabline_height; 4288 y += gui.tabline_height;
4271 #endif 4289 #endif
4272 4290
4273 if (wp->w_winrow == 0) 4291 if (wp->w_winrow == 0)
5033 if (!ends_excmd(*eap->arg)) 5051 if (!ends_excmd(*eap->arg))
5034 ex_next(eap); 5052 ex_next(eap);
5035 } 5053 }
5036 5054
5037 #if ((defined(FEAT_GUI_X11) || defined(FEAT_GUI_GTK) \ 5055 #if ((defined(FEAT_GUI_X11) || defined(FEAT_GUI_GTK) \
5038 || defined(FEAT_GUI_MSWIN) || defined(FEAT_GUI_PHOTON)) \ 5056 || defined(FEAT_GUI_MSWIN) || defined(FEAT_GUI_PHOTON) \
5057 || defined(FEAT_GUI_HAIKU)) \
5039 && defined(FEAT_TOOLBAR)) || defined(PROTO) 5058 && defined(FEAT_TOOLBAR)) || defined(PROTO)
5040 /* 5059 /*
5041 * This is shared between Athena, Motif and GTK. 5060 * This is shared between Athena, Haiku, Motif, and GTK.
5042 */ 5061 */
5043 5062
5044 /* 5063 /*
5045 * Callback function for do_in_runtimepath(). 5064 * Callback function for do_in_runtimepath().
5046 */ 5065 */