~vanvugt/mir/log-level

« back to all changes in this revision

Viewing changes to src/client/mir_surface_api.cpp

  • Committer: Daniel van Vugt
  • Date: 2015-01-23 03:08:41 UTC
  • mfrom: (2201.2.50 development-branch)
  • Revision ID: daniel.van.vugt@canonical.com-20150123030841-zn39cao9um2o9x0p
Merge latest trunk

Show diffs side-by-side

added added

removed removed

Lines of Context:
51
51
    return new MirSurfaceSpec{connection, width, height, format};
52
52
}
53
53
 
54
 
MirSurfaceSpec* mir_connection_create_spec_for_menu_surface(MirConnection* connection,
55
 
                                                            int width,
56
 
                                                            int height,
57
 
                                                            MirPixelFormat format,
58
 
                                                            MirSurface* parent,
59
 
                                                            MirRectangle* rect,
60
 
                                                            MirEdgeAttachment edge)
 
54
MirSurfaceSpec* mir_connection_create_spec_for_menu(MirConnection* connection,
 
55
                                                    int width,
 
56
                                                    int height,
 
57
                                                    MirPixelFormat format,
 
58
                                                    MirSurface* parent,
 
59
                                                    MirRectangle* rect,
 
60
                                                    MirEdgeAttachment edge)
61
61
{
62
62
    mir::require(mir_surface_is_valid(parent));
63
63
    mir::require(rect != nullptr);
65
65
    auto spec = new MirSurfaceSpec{connection, width, height, format};
66
66
    spec->type = mir_surface_type_menu;
67
67
    spec->parent = parent;
68
 
    spec->attachment_rect = *rect;
 
68
    spec->aux_rect = *rect;
69
69
    spec->edge_attachment = edge;
70
70
    return spec;
71
71
}
72
72
 
 
73
MirSurfaceSpec* mir_connection_create_spec_for_tooltip(MirConnection* connection,
 
74
                                                       int width,
 
75
                                                       int height,
 
76
                                                       MirPixelFormat format,
 
77
                                                       MirSurface* parent,
 
78
                                                       MirRectangle* rect)
 
79
{
 
80
    mir::require(mir_surface_is_valid(parent));
 
81
    mir::require(rect != nullptr);
 
82
 
 
83
    auto spec = new MirSurfaceSpec{connection, width, height, format};
 
84
    spec->type = mir_surface_type_tip;
 
85
    spec->parent = parent;
 
86
    spec->aux_rect = *rect;
 
87
    return spec;
 
88
}
 
89
 
 
90
MirSurfaceSpec* mir_connection_create_spec_for_dialog(MirConnection* connection,
 
91
                                                      int width,
 
92
                                                      int height,
 
93
                                                      MirPixelFormat format)
 
94
{
 
95
    auto spec = new MirSurfaceSpec{connection, width, height, format};
 
96
    spec->type = mir_surface_type_dialog;
 
97
    return spec;
 
98
}
 
99
 
 
100
MirSurfaceSpec* mir_connection_create_spec_for_modal_dialog(MirConnection* connection,
 
101
                                                           int width,
 
102
                                                           int height,
 
103
                                                           MirPixelFormat format,
 
104
                                                           MirSurface* parent)
 
105
{
 
106
    mir::require(mir_surface_is_valid(parent));
 
107
 
 
108
    auto spec = new MirSurfaceSpec{connection, width, height, format};
 
109
    spec->type = mir_surface_type_dialog;
 
110
    spec->parent = parent;
 
111
 
 
112
    return spec;
 
113
}
 
114
 
73
115
MirSurface* mir_surface_create_sync(MirSurfaceSpec* requested_specification)
74
116
{
75
117
    MirSurface* surface = nullptr;