Mercurial > vim
comparison src/vim.h @ 14786:11978f68a8c3 v8.1.0405
patch 8.1.0405: too many #ifdefs for GTK
commit https://github.com/vim/vim/commit/664323e7c82c35eabb9056efca0df6cc8d6cfd60
Author: Bram Moolenaar <Bram@vim.org>
Date: Tue Sep 18 22:30:07 2018 +0200
patch 8.1.0405: too many #ifdefs for GTK
Problem: Too many #ifdefs for GTK.
Solution: Define macros instead of using #ifdef. (Ken Takata, closes https://github.com/vim/vim/issues/3436)
author | Christian Brabandt <cb@256bit.org> |
---|---|
date | Tue, 18 Sep 2018 22:45:05 +0200 |
parents | 27055ad9276b |
children | c97b4b537572 |
comparison
equal
deleted
inserted
replaced
14785:7f365a30fe7c | 14786:11978f68a8c3 |
---|---|
2328 #endif | 2328 #endif |
2329 | 2329 |
2330 #ifdef FEAT_GUI_GTK | 2330 #ifdef FEAT_GUI_GTK |
2331 # if !GTK_CHECK_VERSION(2,14,0) | 2331 # if !GTK_CHECK_VERSION(2,14,0) |
2332 # define gtk_widget_get_window(wid) ((wid)->window) | 2332 # define gtk_widget_get_window(wid) ((wid)->window) |
2333 # define gtk_plug_get_socket_window(wid) ((wid)->socket_window) | |
2334 # define gtk_selection_data_get_data(sel) ((sel)->data) | |
2335 # define gtk_selection_data_get_data_type(sel) ((sel)->type) | |
2336 # define gtk_selection_data_get_format(sel) ((sel)->format) | |
2337 # define gtk_selection_data_get_length(sel) ((sel)->length) | |
2338 # define gtk_adjustment_set_lower(adj, low) \ | |
2339 do { (adj)->lower = low; } while (0) | |
2340 # define gtk_adjustment_set_upper(adj, up) \ | |
2341 do { (adj)->upper = up; } while (0) | |
2342 # define gtk_adjustment_set_page_size(adj, size) \ | |
2343 do { (adj)->page_size = size; } while (0) | |
2344 # define gtk_adjustment_set_page_increment(adj, inc) \ | |
2345 do { (adj)->page_increment = inc; } while (0) | |
2346 # define gtk_adjustment_set_step_increment(adj, inc) \ | |
2347 do { (adj)->step_increment = inc; } while (0) | |
2348 # endif | |
2349 # if !GTK_CHECK_VERSION(2,16,0) | |
2350 # define gtk_selection_data_get_selection(sel) ((sel)->selection) | |
2351 # endif | |
2352 # if !GTK_CHECK_VERSION(2,18,0) | |
2353 # define gtk_widget_get_allocation(wid, alloc) \ | |
2354 do { *(alloc) = (wid)->allocation; } while (0) | |
2355 # define gtk_widget_set_allocation(wid, alloc) \ | |
2356 do { (wid)->allocation = *(alloc); } while (0) | |
2357 # define gtk_widget_get_has_window(wid) !GTK_WIDGET_NO_WINDOW(wid) | |
2358 # define gtk_widget_get_sensitive(wid) GTK_WIDGET_SENSITIVE(wid) | |
2359 # define gtk_widget_get_visible(wid) GTK_WIDGET_VISIBLE(wid) | |
2360 # define gtk_widget_has_focus(wid) GTK_WIDGET_HAS_FOCUS(wid) | |
2361 # define gtk_widget_set_window(wid, win) \ | |
2362 do { (wid)->window = (win); } while (0) | |
2363 # define gtk_widget_set_can_default(wid, can) \ | |
2364 do { if (can) { GTK_WIDGET_SET_FLAGS(wid, GTK_CAN_DEFAULT); } \ | |
2365 else { GTK_WIDGET_UNSET_FLAGS(wid, GTK_CAN_DEFAULT); } } while (0) | |
2366 # define gtk_widget_set_can_focus(wid, can) \ | |
2367 do { if (can) { GTK_WIDGET_SET_FLAGS(wid, GTK_CAN_FOCUS); } \ | |
2368 else { GTK_WIDGET_UNSET_FLAGS(wid, GTK_CAN_FOCUS); } } while (0) | |
2369 # define gtk_widget_set_visible(wid, vis) \ | |
2370 do { if (vis) { gtk_widget_show(wid); } \ | |
2371 else { gtk_widget_hide(wid); } } while (0) | |
2372 # endif | |
2373 # if !GTK_CHECK_VERSION(2,20,0) | |
2374 # define gtk_widget_get_mapped(wid) GTK_WIDGET_MAPPED(wid) | |
2375 # define gtk_widget_get_realized(wid) GTK_WIDGET_REALIZED(wid) | |
2376 # define gtk_widget_set_mapped(wid, map) \ | |
2377 do { if (map) { GTK_WIDGET_SET_FLAGS(wid, GTK_MAPPED); } \ | |
2378 else { GTK_WIDGET_UNSET_FLAGS(wid, GTK_MAPPED); } } while (0) | |
2379 # define gtk_widget_set_realized(wid, rea) \ | |
2380 do { if (rea) { GTK_WIDGET_SET_FLAGS(wid, GTK_REALIZED); } \ | |
2381 else { GTK_WIDGET_UNSET_FLAGS(wid, GTK_REALIZED); } } while (0) | |
2333 # endif | 2382 # endif |
2334 #endif | 2383 #endif |
2335 | 2384 |
2336 #ifndef FEAT_NETBEANS_INTG | 2385 #ifndef FEAT_NETBEANS_INTG |
2337 # undef NBDEBUG | 2386 # undef NBDEBUG |