Handle RawGeckoElement and friends, add support for types which are used in both maybe-null and non-null forms

This commit is contained in:
Manish Goregaokar 2016-08-24 22:29:46 +05:30
parent de90f5fce8
commit 0d4c5674ec
No known key found for this signature in database
GPG key ID: 3BBF4D3E2EF79F98
6 changed files with 260 additions and 256 deletions

View file

@ -24,7 +24,7 @@ use gecko_bindings::bindings::{Gecko_EnsureImageLayersLength, Gecko_CreateGradie
use gecko_bindings::bindings::{Gecko_CopyImageValueFrom, Gecko_CopyFontFamilyFrom};
use gecko_bindings::bindings::{Gecko_FontFamilyList_AppendGeneric, Gecko_FontFamilyList_AppendNamed};
use gecko_bindings::bindings::{Gecko_FontFamilyList_Clear, Gecko_InitializeImageLayer};
use gecko_bindings::bindings::ServoComputedValuesBorrowed;
use gecko_bindings::bindings::ServoComputedValuesMaybeBorrowed;
use gecko_bindings::structs;
use gecko_bindings::sugar::ns_style_coord::{CoordDataValue, CoordData, CoordDataMut};
use gecko_values::{StyleCoordHelpers, GeckoStyleCoordConvertible, convert_nscolor_to_rgba};
@ -1712,8 +1712,8 @@ fn static_assert() {
<%def name="define_ffi_struct_accessor(style_struct)">
#[no_mangle]
#[allow(non_snake_case, unused_variables)]
pub extern "C" fn Servo_GetStyle${style_struct.gecko_name}(computed_values: ServoComputedValuesBorrowed)
-> *const ${style_struct.gecko_ffi_name} {
pub extern "C" fn Servo_GetStyle${style_struct.gecko_name}(computed_values:
ServoComputedValuesMaybeBorrowed) -> *const ${style_struct.gecko_ffi_name} {
computed_values.as_arc::<ComputedValues>().get_${style_struct.name_lower}().get_gecko()
as *const ${style_struct.gecko_ffi_name}
}