|
| 1 | +// https://gitlab.gnome.org/GNOME/gnome-shell/-/blob/main/js/ui/dash.js |
| 2 | + |
| 3 | +import type Clutter from '@girs/clutter-17'; |
| 4 | +import type Shell from '@girs/shell-17'; |
| 5 | +import type St from '@girs/st-17'; |
| 6 | + |
| 7 | +import { AppIcon } from './appDisplay.js'; |
| 8 | +import { DragEvent, DragMonitor, DragMotionResult } from './dnd.js'; |
| 9 | +import { BaseIcon } from './iconGrid.js'; |
| 10 | + |
| 11 | +/** |
| 12 | + * @see https://gitlab.gnome.org/GNOME/gnome-shell/-/blob/main/js/ui/dash.js#L22 |
| 13 | + * @version 49 |
| 14 | + */ |
| 15 | +export class DashIcon extends AppIcon { |
| 16 | + constructor(app: Shell.App); |
| 17 | + |
| 18 | + _init(params?: Partial<St.Button.ConstructorProps>, isDraggable?: boolean, expandTitleOnHover?: boolean): void; |
| 19 | + _init(app: Shell.App, iconParams?: Partial<AppIcon.ConstructorProps>): void; |
| 20 | + |
| 21 | + scaleAndFade(): void; |
| 22 | + undoScaleAndFade(): void; |
| 23 | + handleDragOver(): DragMotionResult; |
| 24 | + acceptDrop(): boolean; |
| 25 | +} |
| 26 | + |
| 27 | +/** |
| 28 | + * @see https://gitlab.gnome.org/GNOME/gnome-shell/-/blob/main/js/ui/dash.js#L49 |
| 29 | + * @version 49 |
| 30 | + */ |
| 31 | +export class DashItemContainer extends St.Widget { |
| 32 | + label: St.Label; |
| 33 | + child: St.Widget; |
| 34 | + animatingOut: boolean; |
| 35 | + |
| 36 | + _labelText: string; |
| 37 | + |
| 38 | + constructor(params?: Partial<St.Widget.ConstructorProps>); |
| 39 | + _init(): void; |
| 40 | + |
| 41 | + vfunc_get_preferred_height(forWidth: number): [number, number]; |
| 42 | + vfunc_get_preferred_width(forHeight: number): [number, number]; |
| 43 | + |
| 44 | + showLabel(): void; |
| 45 | + setLabelText(text: string): void; |
| 46 | + hideLabel(): void; |
| 47 | + setChild(actor: St.Widget): void; |
| 48 | + show(animate?: boolean): void; |
| 49 | + animateOutAndDestroy(): void; |
| 50 | +} |
| 51 | + |
| 52 | +/** |
| 53 | + * @see https://gitlab.gnome.org/GNOME/gnome-shell/-/blob/main/js/ui/dash.js#L190 |
| 54 | + * @version 49 |
| 55 | + */ |
| 56 | +export class ShowAppsIcon extends DashItemContainer { |
| 57 | + toggleButton: St.Button; |
| 58 | + icon: BaseIcon; |
| 59 | + |
| 60 | + _iconActor: St.Icon; |
| 61 | + |
| 62 | + constructor(); |
| 63 | + _init(): void; |
| 64 | + |
| 65 | + _createIcon(size: number): St.Icon; |
| 66 | + _canRemoveApp(app: Shell.App): boolean; |
| 67 | + |
| 68 | + setDragApp(app: Shell.App): void; |
| 69 | + handleDragOver(source: any, actor: Clutter.Actor, x: number, y: number, time: number): DragMotionResult; |
| 70 | + acceptDrop(source: any, actor: Clutter.Actor, x: number, y: number, time: number): boolean; |
| 71 | +} |
| 72 | + |
| 73 | +/** |
| 74 | + * @see https://gitlab.gnome.org/GNOME/gnome-shell/-/blob/main/js/ui/dash.js#L275 |
| 75 | + * @version 49 |
| 76 | + */ |
| 77 | +declare class DragPlaceholderItem extends DashItemContainer { |
| 78 | + _init(): void; |
| 79 | +} |
| 80 | + |
| 81 | +/** |
| 82 | + * @see https://gitlab.gnome.org/GNOME/gnome-shell/-/blob/main/js/ui/dash.js#L283 |
| 83 | + * @version 49 |
| 84 | + */ |
| 85 | +declare class EmptyDropTargetItem extends DashItemContainer { |
| 86 | + _init(): void; |
| 87 | +} |
| 88 | + |
| 89 | +/** |
| 90 | + * @see https://gitlab.gnome.org/GNOME/gnome-shell/-/blob/main/js/ui/dash.js#L291 |
| 91 | + * @version 49 |
| 92 | + */ |
| 93 | +declare class DashIconsLayout extends Clutter.BoxLayout { |
| 94 | + _init(): void; |
| 95 | + vfunc_get_preferred_width(container: Clutter.Actor, forHeight: number): [number, number]; |
| 96 | +} |
| 97 | + |
| 98 | +/** |
| 99 | + * @see https://gitlab.gnome.org/GNOME/gnome-shell/-/blob/main/js/ui/dash.js#L308 |
| 100 | + * @version 49 |
| 101 | + */ |
| 102 | +export class Dash extends St.Widget { |
| 103 | + constructor(); |
| 104 | + |
| 105 | + static getAppFromSource(source: any): Shell.App; |
| 106 | + |
| 107 | + _maxWidth: number; |
| 108 | + _maxHeight: number; |
| 109 | + iconSize: number; |
| 110 | + _shownInitially: boolean; |
| 111 | + _separator: St.Widget; |
| 112 | + _dragPlaceholder: DragPlaceholderItem; |
| 113 | + _dragPlaceholderPos: number; |
| 114 | + _animatingPlaceholdersCount: number; |
| 115 | + _showLabelTimeoutId: number; |
| 116 | + _resetHoverTimeoutId: number; |
| 117 | + _labelShowing: boolean; |
| 118 | + _dashContainer: St.BoxLayout; |
| 119 | + _box: St.Widget; |
| 120 | + _showAppsIcon: ShowAppsIcon; |
| 121 | + showAppsButton: St.Button; |
| 122 | + _background: St.Widget; |
| 123 | + _workId: string; |
| 124 | + _appSystem: Shell.AppSystem; |
| 125 | + _dragCancelled: boolean; |
| 126 | + _dragMonitor: DragMonitor; |
| 127 | + _emptyDropTarget: EmptyDropTargetItem; |
| 128 | + |
| 129 | + _init(): void; |
| 130 | + _onItemDragBegin(): void; |
| 131 | + _onItemDragCancelled(): void; |
| 132 | + _onItemDragEnd(): void; |
| 133 | + _endItemDrag(): void; |
| 134 | + _onItemDragMotion(dragEvent: DragEvent): DragMotionResult; |
| 135 | + _onWindowDragBegin(): void; |
| 136 | + _onWindowDragEnd(): void; |
| 137 | + _appIdListToHash(apps: Shell.App[]): Record<string, Shell.App>; |
| 138 | + _queueRedisplay(): void; |
| 139 | + _hookUpLabel(item: DashItemContainer, appIcon?: AppIcon): void; |
| 140 | + _createAppItem(app: Shell.App): DashItemContainer; |
| 141 | + _itemMenuStateChanged(item: DashItemContainer, opened: boolean): void; |
| 142 | + _syncLabel(item: DashItemContainer, appIcon?: AppIcon): void; |
| 143 | + _adjustIconSize(): void; |
| 144 | + _redisplay(): void; |
| 145 | + _clearDragPlaceholder(): void; |
| 146 | + _clearEmptyDropTarget(): void; |
| 147 | + |
| 148 | + handleDragOver(source: any, actor: Clutter.Actor, x: number, y: number, time: number): DragMotionResult; |
| 149 | + acceptDrop(source: any, actor: Clutter.Actor, x: number, y: number, time: number): boolean; |
| 150 | + setMaxSize(maxWidth: number, maxHeight: number): void; |
| 151 | +} |
0 commit comments