Commit d08628bc authored by Daniel Bratell's avatar Daniel Bratell Committed by Commit Bot

Remove the last X11 includes in //ui outside ui/gfx/x/*

X11 header files are infamous for creating macros with common
names such as None, True, False, Status, Bool, ...

To save oursaves the mess that creates, they are now wrapped
in a header, ui/gfx/x/x11.h, which puts those symbols in the
x11 namespace and removes the global macros.

This means we can remove various undefs in files that have had
problems in the past.

Bug: 782184
Change-Id: Ie48fe619e3101344d53ea837b0b21570516185ca
Reviewed-on: https://chromium-review.googlesource.com/814676Reviewed-by: default avatarSadrul Chowdhury <sadrul@chromium.org>
Commit-Queue: Daniel Bratell <bratell@opera.com>
Cr-Commit-Position: refs/heads/master@{#523149}
parent 0180ee64
......@@ -51,7 +51,7 @@ dangerous macros inside the x11 namespace."""
source_file_filter = lambda x: input_api.FilterSourceFile(
x,
white_list=tuple([r'.*ui.(aura|events|gfx|gl|views)..*\.(cc|h)$']))
white_list=tuple([r'.*ui[\\/].*\.(cc|h)$']))
errors = []
x11_include_pattern = input_api.re.compile(r'#include\s+<X11/.*\.h>')
for f in input_api.AffectedSourceFiles(source_file_filter):
......
......@@ -4,10 +4,6 @@
#include "ui/base/dragdrop/os_exchange_data_provider_aurax11.h"
// Clean up X11 header polution
#undef None
#undef Bool
#include "base/strings/string16.h"
#include "base/strings/utf_string_conversions.h"
#include "base/test/scoped_task_environment.h"
......
......@@ -4,8 +4,6 @@
#include "ui/compositor/test/test_compositor_host.h"
#include <X11/Xlib.h>
#include <memory>
#include "base/bind.h"
......@@ -17,6 +15,7 @@
#include "ui/base/x/x11_window_event_manager.h"
#include "ui/compositor/compositor.h"
#include "ui/gfx/geometry/rect.h"
#include "ui/gfx/x/x11.h"
#include "ui/gfx/x/x11_types.h"
namespace ui {
......@@ -66,10 +65,9 @@ TestCompositorHostX11::~TestCompositorHostX11() {}
void TestCompositorHostX11::Show() {
XDisplay* display = gfx::GetXDisplay();
XSetWindowAttributes swa;
swa.override_redirect = True;
swa.override_redirect = x11::True;
window_ = XCreateWindow(
display,
RootWindow(display, DefaultScreen(display)), // parent
display, XRootWindow(display, DefaultScreen(display)), // parent
bounds_.x(), bounds_.y(), bounds_.width(), bounds_.height(),
0, // border width
CopyFromParent, // depth
......
......@@ -4,12 +4,9 @@
#include "ui/display/util/x11/edid_parser_x11.h"
#include <X11/extensions/Xrandr.h>
#include <X11/Xatom.h>
#include <X11/Xlib.h>
#include "base/strings/string_util.h"
#include "ui/display/util/edid_parser.h"
#include "ui/gfx/x/x11.h"
#include "ui/gfx/x/x11_atom_cache.h"
#include "ui/gfx/x/x11_types.h"
......
......@@ -6,10 +6,6 @@
#include <vector>
// Generically-named #defines from Xlib that conflict with symbols in GTest.
#undef Bool
#undef None
#include "base/macros.h"
#include "testing/gtest/include/gtest/gtest.h"
#include "ui/events/devices/device_hotplug_event_observer.h"
......
......@@ -4,14 +4,11 @@
#include "ui/gfx/path_x11.h"
#include <X11/Xlib.h>
#include <X11/Xregion.h>
#include <X11/Xutil.h>
#include <memory>
#include "third_party/skia/include/core/SkRegion.h"
#include "ui/gfx/path.h"
#include "ui/gfx/x/x11.h"
namespace gfx {
......
......@@ -24,9 +24,6 @@
#include "ui/views/controls/scrollbar/base_scroll_bar_thumb.h"
#include "ui/views/widget/widget.h"
#undef min
#undef max
namespace views {
///////////////////////////////////////////////////////////////////////////////
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment