*Needs Discussion*
Related to this series of MPs is the final design of our "window spec" API. It doesn't *need* to be a direct renaming of our "surface spec" API.
We have functions to:
1. create a surface spec - mir_create_surface_spec(); and, 2. set e.g. the type of the surface - mir_surface_spec_set_type().
We also have:
mir_connection_create_spec_for_normal_surface() mir_connection_create_spec_for_menu() mir_connection_create_spec_for_tooltip() // *deprecated* mir_connection_create_spec_for_tip() mir_connection_create_spec_for_modal_dialog() mir_connection_create_spec_for_dialog() mir_connection_create_spec_for_input_method()
to create surfaces of *most*, but not all of the different types.
But does this redundancy really gain us anything?
Changing:
MirSurfaceSpec *spec = mir_connection_create_spec_for_normal_surface(mcd.connection, 640, 480, pixel_format); mir_surface_spec_set_name(spec, __FILE__);
To: MirSurfaceSpec *spec = mir_create_window_spec(mcd.connection); mir_window_spec_set_type(mir_surface_type_normal); mir_window_spec_set_width(spec, 640); mir_window_spec_set_height(spec, 480); mir_window_spec_set_pixel_format(spec, pixel_format); mir_window_spec_set_name(spec, __FILE__);
May be a few more lines of downstream code, but isn't really a problem for anyone. (Especially when pixel_format ought to be optional as discussed above). And I don't really think width and height are independent. So it could be:
MirSurfaceSpec *spec = mir_create_window_spec(mcd.connection); mir_window_spec_set_type(mir_surface_type_normal); mir_window_spec_set_size(spec, 640, spec, 480); mir_window_spec_set_name(spec, __FILE__);
« Back to merge proposal
*Needs Discussion*
Related to this series of MPs is the final design of our "window spec" API. It doesn't *need* to be a direct renaming of our "surface spec" API.
We have functions to:
1. create a surface spec - mir_create_ surface_ spec(); and, spec_set_ type().
2. set e.g. the type of the surface - mir_surface_
We also have:
mir_ connection_ create_ spec_for_ normal_ surface( ) connection_ create_ spec_for_ menu() connection_ create_ spec_for_ tooltip( ) // *deprecated* connection_ create_ spec_for_ tip() connection_ create_ spec_for_ modal_dialog( ) connection_ create_ spec_for_ dialog( ) connection_ create_ spec_for_ input_method( )
mir_
mir_
mir_
mir_
mir_
mir_
to create surfaces of *most*, but not all of the different types.
But does this redundancy really gain us anything?
Changing:
MirSurfaceSpec *spec =
mir_connection _create_ spec_for_ normal_ surface( mcd.connection, 640, 480, pixel_format); surface_ spec_set_ name(spec, __FILE__);
mir_
To: window_ spec(mcd. connection) ; window_ spec_set_ type(mir_ surface_ type_normal) ; window_ spec_set_ width(spec, 640); window_ spec_set_ height( spec, 480); window_ spec_set_ pixel_format( spec, pixel_format); window_ spec_set_ name(spec, __FILE__);
MirSurfaceSpec *spec = mir_create_
mir_
mir_
mir_
mir_
mir_
May be a few more lines of downstream code, but isn't really a problem for anyone. (Especially when pixel_format ought to be optional as discussed above). And I don't really think width and height are independent. So it could be:
MirSurfaceSpec *spec = mir_create_ window_ spec(mcd. connection) ; window_ spec_set_ type(mir_ surface_ type_normal) ; window_ spec_set_ size(spec, 640, spec, 480); window_ spec_set_ name(spec, __FILE__);
mir_
mir_
mir_