@@ -5,9 +5,12 @@ import type Gio from '@girs/gio-2.0';
5
5
import type GLib from '@girs/glib-2.0' ;
6
6
import type St from '@girs/st-16' ;
7
7
import type Clutter from '@girs/clutter-16' ;
8
+ import type { Notification } from './messageTray' ;
9
+ import type { MprisPlayer , MprisSource } from './mpris' ;
8
10
9
11
/**
10
- * @version 46
12
+ * @see https://gitlab.gnome.org/GNOME/gnome-shell/-/blob/main/js/ui/messageList.js#L33
13
+ * @version 48
11
14
*/
12
15
export class URLHighlighter extends St . Label {
13
16
constructor ( text ?: string , lineWrap ?: boolean , allowMarkup ?: boolean ) ;
@@ -26,6 +29,36 @@ export class URLHighlighter extends St.Label {
26
29
protected _findUrlAtPos ( event : Clutter . Event ) : [ number , number ] ;
27
30
}
28
31
32
+ declare class ScaleLayout extends Clutter . BinLayout {
33
+ _container : Clutter . Actor | null ;
34
+ _scalingEnabled : boolean ;
35
+
36
+ get scalingEnabled ( ) : boolean ;
37
+
38
+ set scalingEnabled ( value : boolean ) ;
39
+
40
+ vfunc_set_container ( container : Clutter . Actor | null ) : void ;
41
+
42
+ vfunc_get_preferred_width ( container : Clutter . Actor , forHeight : number ) : [ number , number ] ;
43
+
44
+ vfunc_get_preferred_height ( container : Clutter . Actor , forWidth : number ) : [ number , number ] ;
45
+ }
46
+
47
+ declare class LabelExpanderLayout extends Clutter . BinLayout {
48
+ _expansion : number ;
49
+ _expandLines : number ;
50
+
51
+ constructor ( params : Clutter . BinLayout . ConstructorProps ) ;
52
+
53
+ get expansion ( ) : number ;
54
+
55
+ set expansion ( v : number ) ;
56
+
57
+ set expandLines ( v : number ) ;
58
+
59
+ vfunc_get_preferred_height ( container : Clutter . Actor , forWidth : number ) : [ number , number ] ;
60
+ }
61
+
29
62
export declare namespace Source {
30
63
interface ObjectProperties {
31
64
title : string ;
@@ -37,7 +70,8 @@ export declare namespace Source {
37
70
}
38
71
39
72
/**
40
- * @version 46
73
+ * @see https://gitlab.gnome.org/GNOME/gnome-shell/-/blob/main/js/ui/messageList.js#L284
74
+ * @version 48
41
75
*/
42
76
export class Source extends GObject . Object implements Source . ObjectProperties {
43
77
constructor ( params ?: Source . ConstructorProps ) ;
@@ -50,8 +84,27 @@ export class Source extends GObject.Object implements Source.ObjectProperties {
50
84
public set iconName ( iconName : string ) ;
51
85
}
52
86
87
+ declare class TimeLabel extends St . Label {
88
+ _datetime : Date ;
89
+
90
+ /** @hidden */
91
+ public _init ( params ?: Partial < St . Label . ConstructorProps > ) : void ;
92
+ public _init ( datetime : Date ) : void ;
93
+
94
+ get datetime ( ) : Date ;
95
+
96
+ set datetime ( datetime : Date ) ;
97
+
98
+ public vfunc_map ( ) : void ;
99
+ }
100
+
101
+ declare class MessageHeader extends St . BoxLayout {
102
+ constructor ( source : Source ) ;
103
+ }
104
+
53
105
/**
54
- * @version 46
106
+ * @see https://gitlab.gnome.org/GNOME/gnome-shell/-/blob/main/js/ui/messageList.js#L421
107
+ * @version 48
55
108
*/
56
109
export class Message extends St . Button {
57
110
constructor ( source : Source ) ;
@@ -77,30 +130,180 @@ export class Message extends St.Button {
77
130
public canClose ( ) : boolean ;
78
131
79
132
public vfunc_key_press_event ( keyEvent : Clutter . KeyEvent ) : boolean ;
133
+ }
134
+
135
+ /**
136
+ * @see https://gitlab.gnome.org/GNOME/gnome-shell/-/blob/main/js/ui/messageList.js#L691
137
+ * @version 48
138
+ */
139
+ export class NotificationMessage extends Message {
140
+ /** @hidden */
141
+ override _init ( params ?: Partial < St . Button . ConstructorProps > ) : void ;
142
+ /** @hidden */
143
+ override _init ( title : string , body : string ) : void ;
144
+ public _init ( notification : Notification ) : void ;
145
+
146
+ public vfunc_clicked ( ) : void ;
147
+ public canClose ( ) : boolean ;
148
+
149
+ protected _getIcon ( ) : St . Icon ;
150
+ protected _onUpdated ( n : Notification , _clear ?: boolean ) : void ;
151
+ }
152
+
153
+ declare class MediaMessage extends Message {
154
+ protected _player : MprisPlayer ;
155
+ protected _icon : St . Icon ;
156
+ protected _secondaryBin : St . Bin ;
157
+ protected _closeButton : St . Button ;
158
+ protected _prevButton : St . Button ;
159
+ protected _playPauseButton : St . Button ;
160
+ protected _nextButton : St . Button ;
161
+
162
+ constructor ( player : MprisPlayer ) ;
163
+
164
+ /** @hidden */
165
+ public override _init ( params ?: Partial < St . Button . ConstructorProps > ) : void ;
166
+ /** @hidden */
167
+ public override _init ( title : string , body : string ) : void ;
168
+ public _init ( player : MprisPlayer ) : void ;
169
+
170
+ public vfunc_clicked ( ) : void ;
171
+
172
+ protected _updateNavButton ( button : St . Button , sensitive ?: boolean ) : void ;
173
+ protected _update ( ) : void ;
174
+ }
175
+
176
+ declare class NotificationMessageGroup extends St . Widget {
177
+ source : Source ;
178
+ _expanded : boolean ;
179
+ _nUrgent : number ;
180
+ _focusChild : null | Clutter . Actor ;
181
+
182
+ constructor ( source : Source ) ;
80
183
81
- protected _onDestroy ( ) : void ;
184
+ get expanded ( ) : boolean ;
185
+
186
+ get hasUrgent ( ) : boolean ;
187
+
188
+ _onKeyFocusIn ( actor : Clutter . Actor ) : void ;
189
+
190
+ get focusChild ( ) : null | Clutter . Actor ;
191
+
192
+ expand ( ) : Promise < void > ;
193
+
194
+ collapse ( ) : Promise < void > ;
195
+
196
+ get expandedHeight ( ) : number ;
197
+
198
+ _ensureCoverPosition ( ) : void ;
199
+
200
+ _updateStackedMessagesFade ( ) : void ;
201
+
202
+ canClose ( ) : boolean ;
203
+
204
+ _addNotification ( notification : Notification ) : void ;
205
+
206
+ _removeNotification ( notification : Notification ) : void ;
207
+
208
+ vfunc_paint ( paintContext : Clutter . PaintContext ) : void ;
209
+
210
+ vfunc_pick ( pickContext : Clutter . PickContext ) : void ;
211
+
212
+ vfunc_map ( ) : void ;
213
+
214
+ vfunc_get_focus_chain ( ) : Clutter . Actor [ ] ;
215
+
216
+ _moveMessage ( message : Message , index : number ) : void ;
217
+
218
+ close ( ) : void ;
219
+ }
220
+
221
+ declare class MessageGroupExpanderLayout extends Clutter . LayoutManager {
222
+ _expansion : number ;
223
+
224
+ constructor ( cover : Clutter . Actor , header : MessageHeader ) ;
225
+
226
+ get expansion ( ) : number ;
227
+
228
+ set expansion ( v : number ) ;
229
+
230
+ getExpandedHeight ( container : Clutter . Actor , forWidth : number ) : [ number , number ] ;
231
+
232
+ vfunc_get_preferred_width ( container : Clutter . Actor , forHeight : number ) : [ number , number ] ;
233
+
234
+ vfunc_get_preferred_height ( container : Clutter . Actor , forWidth : number ) : [ number , number ] ;
235
+
236
+ vfunc_allocate ( container : Clutter . Actor , box : Clutter . ActorBox ) : void ;
237
+ }
238
+ declare class MessageViewLayout extends Clutter . LayoutManager {
239
+ constructor ( overlay : Clutter . Actor ) ;
240
+
241
+ vfunc_get_preferred_width ( container : Clutter . Actor , forHeight : number ) : [ number , number ] ;
242
+
243
+ vfunc_get_preferred_height ( container : Clutter . Actor , forWidth : number ) : [ number , number ] ;
244
+
245
+ vfunc_allocate ( container : Clutter . Actor , box : Clutter . ActorBox ) : void ;
82
246
}
83
247
84
248
/**
85
- * @version 46
249
+ * @see https://gitlab.gnome.org/GNOME/gnome-shell/-/blob/main/js/ui/messageList.js#L1391
250
+ * @version 48
86
251
*/
87
- export class MessageListSection extends St . BoxLayout {
88
- public readonly canClear : boolean ;
89
- public readonly empty : boolean ;
252
+ export class MessageView extends St . Viewport {
253
+ messages : Message [ ] ;
254
+
255
+ _nUrgent : number ;
256
+ _mediaSource : MprisSource ;
257
+ _overlay : Clutter . Actor ;
258
+ _expandedGroup : NotificationMessageGroup | null ;
259
+
260
+ get empty ( ) : boolean ;
261
+
262
+ get canClear ( ) : boolean ;
263
+
264
+ _onKeyFocusIn ( messageActor : Clutter . Actor ) : void ;
265
+
266
+ vfunc_get_focus_chain ( ) : Clutter . Actor [ ] ;
267
+
268
+ _addMessageAtIndex ( message : Message , index : number ) : void ;
269
+
270
+ _moveMessage ( message : Message , index : number ) : void ;
271
+
272
+ _removeMessage ( message : Message ) : void ;
273
+
274
+ clear ( ) : void ;
275
+
276
+ // When a group is expanded the user isn't allowed to scroll outside the expanded group,
277
+ // therefore the adjustment used by the MessageView needs to be different then the external
278
+ // adjustment used by the scrollbar and scrollview.
279
+ vfunc_set_adjustments ( hadjustment : St . Adjustment , vadjustment : St . Adjustment ) : void ;
280
+
281
+ vfunc_allocate ( box : Clutter . ActorBox ) : void ;
282
+
283
+ vfunc_style_changed ( ) : void ;
284
+
285
+ _setupMpris ( ) : void ;
286
+
287
+ _addPlayer ( player : MprisPlayer ) : void ;
288
+
289
+ _removePlayer ( player : MprisPlayer ) : void ;
290
+
291
+ _setupNotifications ( ) : void ;
90
292
91
- public readonly allowed : boolean ;
293
+ _addNotificationSource ( source : Source ) : void ;
92
294
93
- constructor ( ) ;
295
+ _removeNotificationSource ( source : Source ) : void ;
94
296
95
- public addMessage ( message : Message , animate ?: boolean ) : void ;
297
+ // Try to center the expanded group in the available space
298
+ _scrollToExpandedGroup ( ) : void ;
96
299
97
- public addMessageAtIndex ( message : Message , index : number , animate ?: boolean ) : void ;
300
+ get expandedGroup ( ) : NotificationMessageGroup | null ;
98
301
99
- public moveMessage ( message : Message , newIndex : number , animate ?: boolean ) : void ;
302
+ _setExpandedGroup ( group : NotificationMessageGroup | null ) : Promise < void > ;
100
303
101
- public removeMessage ( message : Message , animate ?: boolean ) : void ;
304
+ collapse ( ) : void ;
102
305
103
- public clear ( ) : void ;
306
+ _highlightGroup ( group : NotificationMessageGroup ) : void ;
104
307
105
- protected _onKeyFocusIn ( messageActor : St . Widget ) : void ;
308
+ _unhighlightGroup ( ) : void ;
106
309
}
0 commit comments