/* LICENSE BEGIN This file is part of the SixtyFPS Project -- https://sixtyfps.io Copyright (c) 2020 Olivier Goffart Copyright (c) 2020 Simon Hausmann SPDX-License-Identifier: GPL-3.0-only This file is also available under commercial licensing terms. Please contact info@sixtyfps.io for more information. LICENSE END */ /** This file contains the definition off all builtin items It is parsed with the normal .60 parser, but the semantic. `_` means that that this is a langtype::NativeClass with no parent. Note that only the exported components are added to the type registers. comments starting by `//-` have some meanings */ Rectangle := _ { property color; property x; property y; property width; property height; } BorderRectangle := Rectangle { property border_width; property border_radius; property border_color; //-default_size_binding:expands_to_parent_geometry } export { BorderRectangle as Rectangle } Image := _ { property source; property x; property y; property width; property height; property image_fit; } export ClippedImage := Image { property source-clip-x; property source-clip-y; property source-clip-width; property source-clip-height; //-default_size_binding:implicit_size } export { ClippedImage as Image } export Text := _ { property text; property font_family; property font_size; property font_weight; property color: #000; property horizontal_alignment; property vertical_alignment; property x; property y; property width; property height; //-default_size_binding:implicit_size } export TouchArea := _ { property x; property y; property width; property height; property pressed; property has_hover; property mouse_x; property mouse_y; property pressed_x; property pressed_y; callback clicked; //-default_size_binding:expands_to_parent_geometry } export FocusScope := _ { property x; property y; property width; property height; property has_focus; callback key_pressed(string); callback key_released(string); //-default_size_binding:expands_to_parent_geometry //-accepts_focus } export Flickable := _ { property x; property y; property width; property height; // These properties are actually going to be forwarded to the viewport by the // code generator property viewport_height; property viewport_width; property viewport_x; property viewport_y; property interactive: true; //-default_size_binding:expands_to_parent_geometry } export Window := _ { property width; property height; property color: #fff; property title: "SixtyFPS Window"; } export TextInput := _ { property text; property font_family; property font_size; property font_weight; property color: #000; property selection_foreground_color: #000; property selection_background_color: #808080; property horizontal_alignment; property vertical_alignment; property x; property y; property width; property height; property text_cursor_width /*: StyleMetrics.text_cursor_width */; property cursor_position; property anchor_position; property has_focus; callback accepted; callback edited; property enabled: true; //-default_size_binding:expands_to_parent_geometry //-accepts_focus } export Clip := _ { property x; property y; property width; property height; //-default_size_binding:expands_to_parent_geometry } Row := _ { //-is_non_item_type } // Note: layouts are not NativeClass, but this is lowerd in lower_layout export GridLayout := _ { property spacing; // Additional accepted child Row { } } export VerticalLayout := _ { property spacing; property alignment; } export HorizontalLayout := _ { property spacing; property alignment; } LineTo := _ { property x; property y; //-rust_type_constructor:sixtyfps::re_exports::PathElement::LineTo(PathLineTo{{}}) //-cpp_type:sixtyfps::PathLineTo //-is_non_item_type } ArcTo := _ { property x; property y; property radius_x; property radius_y; property x_rotation; property large_arc; property sweep; //-rust_type_constructor:sixtyfps::re_exports::PathElement::ArcTo(PathArcTo{{}}) //-cpp_type:sixtyfps::PathArcTo //-is_non_item_type } Close := _ { //-rust_type_constructor:sixtyfps::re_exports::PathElement::Close //-is_non_item_type //-is_non_item_type } export Path := _ { property x; property y; property width; property height; property fill_color; property stroke_color; property stroke_width; property commands; //-disallow_global_types_as_child_elements LineTo {} ArcTo {} Close {} //-default_size_binding:expands_to_parent_geometry } export PathLayout := _ { property x; property y; property width; property height; property commands; property offset; LineTo {} ArcTo {} Close {} } // Note: not a a native class, handled in the lower_popups pass export PopupWindow := _ { //property x; //property y; property width; property height; /*property anchor_x; property anchor_y; property anchor_height; property anchor_width;*/ //show() is hardcoded in typeregister.rs } PropertyAnimation := _ { property duration; property easing; property loop_count; //-is_non_item_type } export struct StandardListViewItem := { //-name:sixtyfps::StandardListViewItem text: string } export struct StateInfo := { //-name:sixtyfps::StateInfo current_state: int, previous_state: int, //change_time: duration, } export NativeButton := _ { property x; property y; property width; property height; property text; property pressed; callback clicked; property enabled: true; } export NativeCheckBox := _ { property x; property y; property width; property height; property enabled: true; property text; property checked; callback toggled; } export NativeSpinBox := _ { property x; property y; property width; property height; property enabled: true; property value; property minimum; property maximum: 100; } export NativeSlider := _ { property x; property y; property width; property height; property enabled: true; property value; property minimum; property maximum: 100; } export NativeGroupBox := _ { property x; property y; property width; property height; property enabled: true; property title; property native_padding_left; property native_padding_right; property native_padding_top; property native_padding_bottom; } export NativeLineEdit := _ { property x; property y; property width; property height; property native_padding_left; property native_padding_right; property native_padding_top; property native_padding_bottom; property focused; property enabled: true; } export NativeScrollView := _ { property x; property y; property width; property height; property horizontal_max; property horizontal_page_size; property horizontal_value; property vertical_max; property vertical_page_size; property vertical_value; property native_padding_left; property native_padding_right; property native_padding_top; property native_padding_bottom; } export NativeStandardListViewItem := _ { property x; property y; property width; property height; property index; property item; property is_selected; } export NativeComboBox := _ { property x; property y; property width; property height; property current_value; property is_open; property enabled: true; callback open_popup; } export global NativeStyleMetrics := { property layout_spacing; property layout_padding; property text_cursor_width; //-is_non_item_type }