Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(77)

Side by Side Diff: ui/ozone/platform/caca/caca_connection.h

Issue 387953004: ozone: caca: Convert to PlatformWindow (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: rebase & nits Created 6 years, 5 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch | Annotate | Revision Log
« no previous file with comments | « ui/ozone/platform/caca/caca.gypi ('k') | ui/ozone/platform/caca/caca_connection.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
(Empty)
1 // Copyright 2014 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file.
4
5 #ifndef UI_OZONE_PLATFORM_CACA_CACA_CONNECTION_H_
6 #define UI_OZONE_PLATFORM_CACA_CACA_CONNECTION_H_
7
8 #include <caca.h>
9
10 #include "base/macros.h"
11 #include "ui/gfx/geometry/size.h"
12 #include "ui/ozone/platform/caca/scoped_caca_types.h"
13
14 namespace ui {
15
16 // Basic initialization of Libcaca. This needs to be shared between SFO and EFO
17 // since both need the |display_| to draw and process events respectively.
18 // Note, |canvas_| needs to be here since it is needed for creating a
19 // |display_|.
20 class CacaConnection {
21 public:
22 CacaConnection();
23 ~CacaConnection();
24
25 bool Initialize();
26
27 // This is the Caca canvas size.
28 gfx::Size physical_size() const { return physical_size_; }
29 gfx::Size bitmap_size() const { return bitmap_size_; }
30 caca_display_t* display() const { return display_.get(); }
31
32 private:
33 // Sync sizes with libcaca.
34 void UpdateDisplaySize();
35
36 ScopedCacaCanvas canvas_;
37 ScopedCacaDisplay display_;
38
39 // Size of the console in characters. This can be changed by setting
40 // CACA_GEOMETRY environment variable.
41 gfx::Size physical_size_;
42
43 // Size of the backing buffer we draw into. Size in pixels.
44 gfx::Size bitmap_size_;
45
46 DISALLOW_COPY_AND_ASSIGN(CacaConnection);
47 };
48
49 } // namespace ui
50
51 #endif // UI_OZONE_PLATFORM_CACA_CACA_CONNECTION_H_
OLDNEW
« no previous file with comments | « ui/ozone/platform/caca/caca.gypi ('k') | ui/ozone/platform/caca/caca_connection.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698