~fboucault/platform-api/crossbuild_fixes

« back to all changes in this revision

Viewing changes to src/ubuntu/application/common/mirclient/window_properties_mirclient.cpp

  • Committer: CI Train Bot
  • Author(s): Alberto Aguirre, Robert Carr, robert.carr at canonical
  • Date: 2015-07-06 17:52:56 UTC
  • mfrom: (300.1.16 delete-deprecations)
  • Revision ID: ci-train-bot@canonical.com-20150706175256-a7bzbvy0sfifa0fm
Delete deprecated mir functions.

Why now? https://code.launchpad.net/~mir-team/mir/privatize-event/+merge/254149

The old mir-event is being made private and the new event does not have many fields corresponding to legacy in the UbuntuEvent (i.e. "is_system_key"). Thus it seems like rather than update unused code (qtubuntu is already ported) to build but be broken its a good time to delete it all.

Update major version to 3.
Approved by: PS Jenkins bot, Ricardo Mendoza, Gerry Boland, Alberto Aguirre

Show diffs side-by-side

added added

removed removed

Lines of Context:
1
 
/*
2
 
 * Copyright (C) 2013 Canonical Ltd
3
 
 *
4
 
 * This program is free software: you can redistribute it and/or modify
5
 
 * it under the terms of the GNU Lesser General Public License version 3 as
6
 
 * published by the Free Software Foundation.
7
 
 *
8
 
 * This program is distributed in the hope that it will be useful,
9
 
 * but WITHOUT ANY WARRANTY; without even the implied warranty of
10
 
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
11
 
 * GNU Lesser General Public License for more details.
12
 
 *
13
 
 * You should have received a copy of the GNU Lesser General Public License
14
 
 * along with this program.  If not, see <http://www.gnu.org/licenses/>.
15
 
 *
16
 
 * Authored by: Robert Carr <robert.carr@canonical.com>
17
 
 */
18
 
 
19
 
#include "window_properties_mirclient_priv.h"
20
 
 
21
 
namespace uamc = ubuntu::application::mir::client;
22
 
 
23
 
uamc::WindowProperties::WindowProperties()
24
 
    : parameters(),
25
 
      type(mir_surface_type_normal),
26
 
      _input_cb(nullptr),
27
 
      _event_cb(nullptr),
28
 
      _event_cb_ctx(nullptr)
29
 
{
30
 
    parameters.name = nullptr;
31
 
    parameters.width = 0;
32
 
    parameters.height = 0;
33
 
    parameters.buffer_usage = mir_buffer_usage_hardware;
34
 
    parameters.output_id = mir_display_output_id_invalid;
35
 
}
36
 
 
37
 
UAUiWindowProperties* uamc::WindowProperties::as_u_window_properties()
38
 
{
39
 
    return static_cast<UAUiWindowProperties*>(this);
40
 
}
41
 
uamc::WindowProperties* uamc::WindowProperties::from_u_window_properties(UAUiWindowProperties* u_properties)
42
 
{
43
 
    return static_cast<uamc::WindowProperties*>(u_properties);
44
 
}
45
 
 
46
 
void uamc::WindowProperties::set_title(char const* window_title, size_t length)
47
 
{
48
 
    title = std::string(window_title, length);
49
 
    parameters.name = title.c_str();
50
 
}
51
 
 
52
 
void uamc::WindowProperties::set_input_cb_and_ctx(UAUiWindowInputEventCb callback, void* ctx)
53
 
{
54
 
    _input_cb = callback;
55
 
    _event_cb_ctx = ctx;
56
 
}
57
 
 
58
 
void uamc::WindowProperties::set_event_cb_and_ctx(UAUiWindowEventCb callback, void* ctx)
59
 
{
60
 
    _event_cb = callback;
61
 
    _event_cb_ctx = ctx;
62
 
}
63
 
 
64
 
void uamc::WindowProperties::set_dimensions(uint32_t width, uint32_t height)
65
 
{
66
 
    parameters.width = width;
67
 
    parameters.height = height;
68
 
}
69
 
 
70
 
void uamc::WindowProperties::set_role(UAUiWindowRole role)
71
 
{
72
 
    if (role == U_ON_SCREEN_KEYBOARD_ROLE) {
73
 
        type = mir_surface_type_inputmethod;
74
 
    }
75
 
    //TODO implement other surface roles
76
 
}
77
 
 
78
 
MirSurfaceParameters const& uamc::WindowProperties::surface_parameters() const
79
 
{
80
 
    return parameters;
81
 
}
82
 
 
83
 
MirSurfaceType uamc::WindowProperties::surface_type() const
84
 
{
85
 
    return type;
86
 
}
87
 
 
88
 
UAUiWindowInputEventCb uamc::WindowProperties::input_cb() const
89
 
{
90
 
    return _input_cb;
91
 
}
92
 
 
93
 
UAUiWindowEventCb uamc::WindowProperties::event_cb() const
94
 
{
95
 
    return _event_cb;
96
 
}
97
 
 
98
 
void* uamc::WindowProperties::event_cb_context() const
99
 
{
100
 
    return _event_cb_ctx;
101
 
}