/* 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 background; property color <=> background; 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; property colorize; //-default_size_binding:implicit_size } export { ClippedImage as Image } export Rotate := _ { property angle; property origin-x; property origin-y; property width; property height; //-default_size_binding:expands_to_parent_geometry } export Text := _ { property text; property font_family; property font_size; property font_weight; property color: #000; property horizontal_alignment; property vertical_alignment; property overflow; property wrap; property letter_spacing; property x; property y; property width; property height; //-default_size_binding:implicit_size } export TouchArea := _ { property x; property y; property width; property height; property enabled: true; 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 struct KeyboardModifiers := { //-name:sixtyfps::KeyboardModifiers alt: bool, control: bool, shift: bool, meta: bool, } export struct KeyEvent := { //-name:sixtyfps::KeyEvent text: string, modifiers: KeyboardModifiers, } export FocusScope := _ { property x; property y; property width; property height; property has_focus; callback key_pressed(KeyEvent) -> EventResult; callback key_released(KeyEvent) -> EventResult; //-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 background; // StyleMetrics.window_background set in apply_default_properties_from_style property color <=> background; property title: "SixtyFPS Window"; property default_font_family; property default_font_size; } export BoxShadow := _ { property x; property y; property width; property height; property border_radius; property offset_x; property offset_y; property color; property blur; //-default_size_binding:expands_to_parent_geometry } 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 letter_spacing; property x; property y; property width; property height; property text_cursor_width; // StyleMetrics.text_cursor_width set in apply_default_properties_from_style 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; } MoveTo := _ { property x; property y; //-rust_type_constructor:sixtyfps::re_exports::PathElement::MoveTo(PathMoveTo{{}}) //-cpp_type:sixtyfps::PathMoveTo //-is_non_item_type } 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 } CubicTo := _ { property control_1_x; property control_1_y; property control_2_x; property control_2_y; property x; property y; //-rust_type_constructor:sixtyfps::re_exports::PathElement::CubicTo(PathCubicTo{{}}) //-cpp_type:sixtyfps::PathCubicTo //-is_non_item_type } QuadraticTo := _ { property control_x; property control_y; property x; property y; //-rust_type_constructor:sixtyfps::re_exports::PathElement::QuadraticTo(PathQuadraticTo{{}}) //-cpp_type:sixtyfps::PathQuadraticTo //-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; property fill_color <=> fill; property fill_rule; property stroke; property stroke_color <=> stroke; property stroke_width; property commands; //-disallow_global_types_as_child_elements MoveTo {} LineTo {} ArcTo {} CubicTo {} QuadraticTo {} Close {} //-default_size_binding:expands_to_parent_geometry } export PathLayout := _ { property x; property y; property width; property height; property commands; property offset; MoveTo {} LineTo {} ArcTo {} CubicTo {} QuadraticTo {} 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 }