1/* 2 * Copyright (C) 2022 Huawei Device Co., Ltd. 3 * Licensed under the Apache License, Version 2.0 (the "License"); 4 * you may not use this file except in compliance with the License. 5 * You may obtain a copy of the License at 6 * 7 * http://www.apache.org/licenses/LICENSE-2.0 8 * 9 * Unless required by applicable law or agreed to in writing, software 10 * distributed under the License is distributed on an "AS IS" BASIS, 11 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 12 * See the License for the specific language governing permissions and 13 * limitations under the License. 14 */ 15import { BaseStruct } from '../../../bean/BaseStruct'; 16import { Rect } from '../timer-shaft/Rect'; 17import { TraceRow } from './TraceRow'; 18 19export class TraceRowObject<T extends BaseStruct> { 20 public rowId: string | undefined; 21 public rowType: string | undefined; 22 public rowParentId: string | undefined; 23 public rowHidden: boolean = false; 24 public rowHeight: number = 40; 25 public name: string | undefined; 26 public must: boolean = true; 27 public folder: boolean = false; 28 public isLoading: boolean = false; 29 public children: boolean = false; 30 public expansion: boolean = false; 31 public dataList: Array<T> | undefined; 32 public dataListCache: Array<T> = []; 33 public color: string | undefined; 34 public frame: Rect | undefined; 35 public supplier: (() => Promise<Array<T>>) | undefined | null; 36 public onThreadHandler: 37 | (( 38 row: TraceRow<T>, 39 ctx: 40 | ImageBitmapRenderingContext 41 | CanvasRenderingContext2D 42 | WebGLRenderingContext 43 | WebGL2RenderingContext 44 | null 45 | undefined 46 ) => void) 47 | undefined 48 | null; 49 public onDrawHandler: 50 | (( 51 ctx: 52 | ImageBitmapRenderingContext 53 | CanvasRenderingContext2D 54 | WebGLRenderingContext 55 | WebGL2RenderingContext 56 | null 57 | undefined 58 ) => void) 59 | undefined 60 | null; 61 public top: number = 0; 62 public rowIndex: number = 0; 63 public preObject: TraceRowObject<T> | undefined | null; 64 public nextObject: TraceRowObject<T> | undefined | null; 65} 66