~kdub/mir/devel-to-0.1.7

« back to all changes in this revision

Viewing changes to src/server/graphics/offscreen/display_configuration.cpp

Eliminate "configure_output()" and its long parameter list that has caused us
so much grief recently.

Replaced by a mutable version of for_each_output(), where you can observe
and modify fields of each DisplayConfigurationOutput directly.
This not only eliminates the coupling problem, but simplifies typical
display config changes that only touch a small number of fields (as
demonstrated in examples/*).

Validation checking that used to exist in some configure_output()
implementations has been reimplemented as common to all platforms now, and
moved to the Display::configure() stage.

Approved by PS Jenkins bot, Alberto Aguirre.

Show diffs side-by-side

added added

removed removed

Lines of Context:
69
69
    f(output);
70
70
}
71
71
 
72
 
void mgo::DisplayConfiguration::configure_output(
73
 
    mg::DisplayConfigurationOutputId, bool, geom::Point, size_t,
74
 
    MirPixelFormat, MirPowerMode, MirOrientation)
 
72
void mgo::DisplayConfiguration::for_each_output(
 
73
    std::function<void(mg::UserDisplayConfigurationOutput&)> f)
75
74
{
 
75
    mg::UserDisplayConfigurationOutput user(output);
 
76
    f(user);
76
77
}
 
78