OLD | NEW |
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. |
2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
4 | 4 |
5 // This file defines utility functions for X11 (Linux only). This code has been | 5 // This file defines utility functions for X11 (Linux only). This code has been |
6 // ported from XCB since we can't use XCB on Ubuntu while its 32-bit support | 6 // ported from XCB since we can't use XCB on Ubuntu while its 32-bit support |
7 // remains woefully incomplete. | 7 // remains woefully incomplete. |
8 | 8 |
9 #include "ui/base/x/x11_util.h" | 9 #include "ui/base/x/x11_util.h" |
10 | 10 |
(...skipping 918 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
929 | 929 |
930 bool SetIntArrayProperty(XID window, | 930 bool SetIntArrayProperty(XID window, |
931 const std::string& name, | 931 const std::string& name, |
932 const std::string& type, | 932 const std::string& type, |
933 const std::vector<int>& value) { | 933 const std::vector<int>& value) { |
934 DCHECK(!value.empty()); | 934 DCHECK(!value.empty()); |
935 Atom name_atom = GetAtom(name.c_str()); | 935 Atom name_atom = GetAtom(name.c_str()); |
936 Atom type_atom = GetAtom(type.c_str()); | 936 Atom type_atom = GetAtom(type.c_str()); |
937 | 937 |
938 // XChangeProperty() expects values of type 32 to be longs. | 938 // XChangeProperty() expects values of type 32 to be longs. |
939 scoped_array<long> data(new long[value.size()]); | 939 scoped_ptr<long[]> data(new long[value.size()]); |
940 for (size_t i = 0; i < value.size(); ++i) | 940 for (size_t i = 0; i < value.size(); ++i) |
941 data[i] = value[i]; | 941 data[i] = value[i]; |
942 | 942 |
943 gdk_error_trap_push(); | 943 gdk_error_trap_push(); |
944 XChangeProperty(ui::GetXDisplay(), | 944 XChangeProperty(ui::GetXDisplay(), |
945 window, | 945 window, |
946 name_atom, | 946 name_atom, |
947 type_atom, | 947 type_atom, |
948 32, // size in bits of items in 'value' | 948 32, // size in bits of items in 'value' |
949 PropModeReplace, | 949 PropModeReplace, |
(...skipping 878 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1828 << "request_code " << static_cast<int>(error_event.request_code) << ", " | 1828 << "request_code " << static_cast<int>(error_event.request_code) << ", " |
1829 << "minor_code " << static_cast<int>(error_event.minor_code) | 1829 << "minor_code " << static_cast<int>(error_event.minor_code) |
1830 << " (" << request_str << ")"; | 1830 << " (" << request_str << ")"; |
1831 } | 1831 } |
1832 | 1832 |
1833 // ---------------------------------------------------------------------------- | 1833 // ---------------------------------------------------------------------------- |
1834 // End of x11_util_internal.h | 1834 // End of x11_util_internal.h |
1835 | 1835 |
1836 | 1836 |
1837 } // namespace ui | 1837 } // namespace ui |
OLD | NEW |