refactor(progress_bar): implement clean architecture with widget factory pattern
- commit
- 6b026c87a017963242504af56c541d9773eaf478
- author
- bnema · · 2025-12-17 21:54 UTC
- parent
- 305b057
- signature
- unsigned
7 files · +1337 -51
M .mockery.yaml +7 -6
| @@ -3,8 +3,8 @@ packages: | |||
| 3 | 3 | config: | |
| 4 | 4 | dir: "{{.InterfaceDir}}/mocks" | |
| 5 | 5 | filename: "mock_{{.InterfaceName | snakecase}}.go" | |
| 6 | - | structname: "Mock{{.InterfaceName}}" | |
| 7 | - | pkgname: "mocks" | |
| 6 | + | mockname: "Mock{{.InterfaceName}}" | |
| 7 | + | outpkg: "mocks" | |
| 8 | 8 | interfaces: | |
| 9 | 9 | HistoryRepository: | |
| 10 | 10 | FavoriteRepository: | |
| @@ -16,8 +16,8 @@ packages: | |||
| 16 | 16 | config: | |
| 17 | 17 | dir: "{{.InterfaceDir}}/mocks" | |
| 18 | 18 | filename: "mock_{{.InterfaceName | snakecase}}.go" | |
| 19 | - | structname: "Mock{{.InterfaceName}}" | |
| 20 | - | pkgname: "mocks" | |
| 19 | + | mockname: "Mock{{.InterfaceName}}" | |
| 20 | + | outpkg: "mocks" | |
| 21 | 21 | interfaces: | |
| 22 | 22 | WebView: | |
| 23 | 23 | WebViewPool: | |
| @@ -26,8 +26,8 @@ packages: | |||
| 26 | 26 | config: | |
| 27 | 27 | dir: "{{.InterfaceDir}}/mocks" | |
| 28 | 28 | filename: "mock_{{.InterfaceName | snakecase}}.go" | |
| 29 | - | structname: "Mock{{.InterfaceName}}" | |
| 30 | - | pkgname: "mocks" | |
| 29 | + | mockname: "Mock{{.InterfaceName}}" | |
| 30 | + | outpkg: "mocks" | |
| 31 | 31 | interfaces: | |
| 32 | 32 | Widget: | |
| 33 | 33 | PanedWidget: | |
| @@ -36,6 +36,7 @@ packages: | |||
| 36 | 36 | LabelWidget: | |
| 37 | 37 | ButtonWidget: | |
| 38 | 38 | ImageWidget: | |
| 39 | + | ProgressBarWidget: | |
| 39 | 40 | WidgetFactory: | |
| 40 | 41 | PaneRenderer: | |
| 41 | 42 | PaneViewFactory: | |
| @@ -3,8 +3,8 @@ packages: | |||||
| 3 | config: | 3 | config: | ||
| 4 | dir: "{{.InterfaceDir}}/mocks" | 4 | dir: "{{.InterfaceDir}}/mocks" | ||
| 5 | filename: "mock_{{.InterfaceName | snakecase}}.go" | 5 | filename: "mock_{{.InterfaceName | snakecase}}.go" | ||
| 6 | - | structname: "Mock{{.InterfaceName}}" | 6 | + | mockname: "Mock{{.InterfaceName}}" |
| 7 | - | pkgname: "mocks" | 7 | + | outpkg: "mocks" |
| 8 | interfaces: | 8 | interfaces: | ||
| 9 | HistoryRepository: | 9 | HistoryRepository: | ||
| 10 | FavoriteRepository: | 10 | FavoriteRepository: | ||
| @@ -16,8 +16,8 @@ packages: | |||||
| 16 | config: | 16 | config: | ||
| 17 | dir: "{{.InterfaceDir}}/mocks" | 17 | dir: "{{.InterfaceDir}}/mocks" | ||
| 18 | filename: "mock_{{.InterfaceName | snakecase}}.go" | 18 | filename: "mock_{{.InterfaceName | snakecase}}.go" | ||
| 19 | - | structname: "Mock{{.InterfaceName}}" | 19 | + | mockname: "Mock{{.InterfaceName}}" |
| 20 | - | pkgname: "mocks" | 20 | + | outpkg: "mocks" |
| 21 | interfaces: | 21 | interfaces: | ||
| 22 | WebView: | 22 | WebView: | ||
| 23 | WebViewPool: | 23 | WebViewPool: | ||
| @@ -26,8 +26,8 @@ packages: | |||||
| 26 | config: | 26 | config: | ||
| 27 | dir: "{{.InterfaceDir}}/mocks" | 27 | dir: "{{.InterfaceDir}}/mocks" | ||
| 28 | filename: "mock_{{.InterfaceName | snakecase}}.go" | 28 | filename: "mock_{{.InterfaceName | snakecase}}.go" | ||
| 29 | - | structname: "Mock{{.InterfaceName}}" | 29 | + | mockname: "Mock{{.InterfaceName}}" |
| 30 | - | pkgname: "mocks" | 30 | + | outpkg: "mocks" |
| 31 | interfaces: | 31 | interfaces: | ||
| 32 | Widget: | 32 | Widget: | ||
| 33 | PanedWidget: | 33 | PanedWidget: | ||
| @@ -36,6 +36,7 @@ packages: | |||||
| 36 | LabelWidget: | 36 | LabelWidget: | ||
| 37 | ButtonWidget: | 37 | ButtonWidget: | ||
| 38 | ImageWidget: | 38 | ImageWidget: | ||
| 39 | + | ProgressBarWidget: | |||
| 39 | WidgetFactory: | 40 | WidgetFactory: | ||
| 40 | PaneRenderer: | 41 | PaneRenderer: | ||
| 41 | PaneViewFactory: | 42 | PaneViewFactory: | ||
M internal/ui/component/pane_view_test.go +99 -21
| @@ -3,6 +3,7 @@ package component_test | |||
| 3 | 3 | import ( | |
| 4 | 4 | "testing" | |
| 5 | 5 | ||
| 6 | + | "github.com/jwijenbergh/puregotk/v4/gtk" | |
| 6 | 7 | "github.com/stretchr/testify/assert" | |
| 7 | 8 | "github.com/stretchr/testify/require" | |
| 8 | 9 | ||
| @@ -17,6 +18,7 @@ func TestNewPaneView_CreatesOverlay(t *testing.T) { | |||
| 17 | 18 | mockFactory := mocks.NewMockWidgetFactory(t) | |
| 18 | 19 | mockOverlay := mocks.NewMockOverlayWidget(t) | |
| 19 | 20 | mockBorderBox := mocks.NewMockBoxWidget(t) | |
| 21 | + | mockProgressBar := mocks.NewMockProgressBarWidget(t) | |
| 20 | 22 | mockWebView := mocks.NewMockWidget(t) | |
| 21 | 23 | ||
| 22 | 24 | paneID := entity.PaneID("pane-1") | |
| @@ -38,6 +40,19 @@ func TestNewPaneView_CreatesOverlay(t *testing.T) { | |||
| 38 | 40 | mockOverlay.EXPECT().SetClipOverlay(mockBorderBox, false).Once() | |
| 39 | 41 | mockOverlay.EXPECT().SetMeasureOverlay(mockBorderBox, false).Once() | |
| 40 | 42 | ||
| 43 | + | // Progress bar setup | |
| 44 | + | mockFactory.EXPECT().NewProgressBar().Return(mockProgressBar).Once() | |
| 45 | + | mockProgressBar.EXPECT().AddCssClass("osd").Once() | |
| 46 | + | mockProgressBar.EXPECT().SetValign(gtk.AlignEndValue).Once() | |
| 47 | + | mockProgressBar.EXPECT().SetHalign(gtk.AlignFillValue).Once() | |
| 48 | + | mockProgressBar.EXPECT().SetHexpand(true).Once() | |
| 49 | + | mockProgressBar.EXPECT().SetCanTarget(false).Once() | |
| 50 | + | mockProgressBar.EXPECT().SetCanFocus(false).Once() | |
| 51 | + | mockProgressBar.EXPECT().SetVisible(false).Once() | |
| 52 | + | mockOverlay.EXPECT().AddOverlay(mockProgressBar).Once() | |
| 53 | + | mockOverlay.EXPECT().SetClipOverlay(mockProgressBar, false).Once() | |
| 54 | + | mockOverlay.EXPECT().SetMeasureOverlay(mockProgressBar, false).Once() | |
| 55 | + | ||
| 41 | 56 | // Act | |
| 42 | 57 | pv := component.NewPaneView(mockFactory, paneID, mockWebView) | |
| 43 | 58 | ||
| @@ -52,6 +67,7 @@ func TestNewPaneView_NilWebView(t *testing.T) { | |||
| 52 | 67 | mockFactory := mocks.NewMockWidgetFactory(t) | |
| 53 | 68 | mockOverlay := mocks.NewMockOverlayWidget(t) | |
| 54 | 69 | mockBorderBox := mocks.NewMockBoxWidget(t) | |
| 70 | + | mockProgressBar := mocks.NewMockProgressBarWidget(t) | |
| 55 | 71 | ||
| 56 | 72 | paneID := entity.PaneID("pane-1") | |
| 57 | 73 | ||
| @@ -71,6 +87,19 @@ func TestNewPaneView_NilWebView(t *testing.T) { | |||
| 71 | 87 | mockOverlay.EXPECT().SetClipOverlay(mockBorderBox, false).Once() | |
| 72 | 88 | mockOverlay.EXPECT().SetMeasureOverlay(mockBorderBox, false).Once() | |
| 73 | 89 | ||
| 90 | + | // Progress bar setup | |
| 91 | + | mockFactory.EXPECT().NewProgressBar().Return(mockProgressBar).Once() | |
| 92 | + | mockProgressBar.EXPECT().AddCssClass("osd").Once() | |
| 93 | + | mockProgressBar.EXPECT().SetValign(gtk.AlignEndValue).Once() | |
| 94 | + | mockProgressBar.EXPECT().SetHalign(gtk.AlignFillValue).Once() | |
| 95 | + | mockProgressBar.EXPECT().SetHexpand(true).Once() | |
| 96 | + | mockProgressBar.EXPECT().SetCanTarget(false).Once() | |
| 97 | + | mockProgressBar.EXPECT().SetCanFocus(false).Once() | |
| 98 | + | mockProgressBar.EXPECT().SetVisible(false).Once() | |
| 99 | + | mockOverlay.EXPECT().AddOverlay(mockProgressBar).Once() | |
| 100 | + | mockOverlay.EXPECT().SetClipOverlay(mockProgressBar, false).Once() | |
| 101 | + | mockOverlay.EXPECT().SetMeasureOverlay(mockProgressBar, false).Once() | |
| 102 | + | ||
| 74 | 103 | // Act | |
| 75 | 104 | pv := component.NewPaneView(mockFactory, paneID, nil) | |
| 76 | 105 | ||
| @@ -84,9 +113,10 @@ func TestSetActive_True_AddsCSSClass(t *testing.T) { | |||
| 84 | 113 | mockFactory := mocks.NewMockWidgetFactory(t) | |
| 85 | 114 | mockOverlay := mocks.NewMockOverlayWidget(t) | |
| 86 | 115 | mockBorderBox := mocks.NewMockBoxWidget(t) | |
| 116 | + | mockProgressBar := mocks.NewMockProgressBarWidget(t) | |
| 87 | 117 | mockWebView := mocks.NewMockWidget(t) | |
| 88 | 118 | ||
| 89 | - | setupPaneViewMocks(mockFactory, mockOverlay, mockBorderBox, mockWebView) | |
| 119 | + | setupPaneViewMocks(mockFactory, mockOverlay, mockBorderBox, mockProgressBar, mockWebView) | |
| 90 | 120 | ||
| 91 | 121 | pv := component.NewPaneView(mockFactory, entity.PaneID("pane-1"), mockWebView) | |
| 92 | 122 | ||
| @@ -105,9 +135,10 @@ func TestSetActive_False_RemovesCSSClass(t *testing.T) { | |||
| 105 | 135 | mockFactory := mocks.NewMockWidgetFactory(t) | |
| 106 | 136 | mockOverlay := mocks.NewMockOverlayWidget(t) | |
| 107 | 137 | mockBorderBox := mocks.NewMockBoxWidget(t) | |
| 138 | + | mockProgressBar := mocks.NewMockProgressBarWidget(t) | |
| 108 | 139 | mockWebView := mocks.NewMockWidget(t) | |
| 109 | 140 | ||
| 110 | - | setupPaneViewMocks(mockFactory, mockOverlay, mockBorderBox, mockWebView) | |
| 141 | + | setupPaneViewMocks(mockFactory, mockOverlay, mockBorderBox, mockProgressBar, mockWebView) | |
| 111 | 142 | ||
| 112 | 143 | pv := component.NewPaneView(mockFactory, entity.PaneID("pane-1"), mockWebView) | |
| 113 | 144 | ||
| @@ -130,9 +161,10 @@ func TestSetActive_NoChangeWhenSameState(t *testing.T) { | |||
| 130 | 161 | mockFactory := mocks.NewMockWidgetFactory(t) | |
| 131 | 162 | mockOverlay := mocks.NewMockOverlayWidget(t) | |
| 132 | 163 | mockBorderBox := mocks.NewMockBoxWidget(t) | |
| 164 | + | mockProgressBar := mocks.NewMockProgressBarWidget(t) | |
| 133 | 165 | mockWebView := mocks.NewMockWidget(t) | |
| 134 | 166 | ||
| 135 | - | setupPaneViewMocks(mockFactory, mockOverlay, mockBorderBox, mockWebView) | |
| 167 | + | setupPaneViewMocks(mockFactory, mockOverlay, mockBorderBox, mockProgressBar, mockWebView) | |
| 136 | 168 | ||
| 137 | 169 | pv := component.NewPaneView(mockFactory, entity.PaneID("pane-1"), mockWebView) | |
| 138 | 170 | ||
| @@ -148,10 +180,11 @@ func TestPaneID_ReturnsPaneID(t *testing.T) { | |||
| 148 | 180 | mockFactory := mocks.NewMockWidgetFactory(t) | |
| 149 | 181 | mockOverlay := mocks.NewMockOverlayWidget(t) | |
| 150 | 182 | mockBorderBox := mocks.NewMockBoxWidget(t) | |
| 183 | + | mockProgressBar := mocks.NewMockProgressBarWidget(t) | |
| 151 | 184 | mockWebView := mocks.NewMockWidget(t) | |
| 152 | 185 | ||
| 153 | 186 | paneID := entity.PaneID("test-pane-123") | |
| 154 | - | setupPaneViewMocks(mockFactory, mockOverlay, mockBorderBox, mockWebView) | |
| 187 | + | setupPaneViewMocks(mockFactory, mockOverlay, mockBorderBox, mockProgressBar, mockWebView) | |
| 155 | 188 | ||
| 156 | 189 | pv := component.NewPaneView(mockFactory, paneID, mockWebView) | |
| 157 | 190 | ||
| @@ -167,9 +200,10 @@ func TestWebViewWidget_ReturnsWebView(t *testing.T) { | |||
| 167 | 200 | mockFactory := mocks.NewMockWidgetFactory(t) | |
| 168 | 201 | mockOverlay := mocks.NewMockOverlayWidget(t) | |
| 169 | 202 | mockBorderBox := mocks.NewMockBoxWidget(t) | |
| 203 | + | mockProgressBar := mocks.NewMockProgressBarWidget(t) | |
| 170 | 204 | mockWebView := mocks.NewMockWidget(t) | |
| 171 | 205 | ||
| 172 | - | setupPaneViewMocks(mockFactory, mockOverlay, mockBorderBox, mockWebView) | |
| 206 | + | setupPaneViewMocks(mockFactory, mockOverlay, mockBorderBox, mockProgressBar, mockWebView) | |
| 173 | 207 | ||
| 174 | 208 | pv := component.NewPaneView(mockFactory, entity.PaneID("pane-1"), mockWebView) | |
| 175 | 209 | ||
| @@ -185,10 +219,11 @@ func TestSetWebViewWidget_ReplacesWidget(t *testing.T) { | |||
| 185 | 219 | mockFactory := mocks.NewMockWidgetFactory(t) | |
| 186 | 220 | mockOverlay := mocks.NewMockOverlayWidget(t) | |
| 187 | 221 | mockBorderBox := mocks.NewMockBoxWidget(t) | |
| 222 | + | mockProgressBar := mocks.NewMockProgressBarWidget(t) | |
| 188 | 223 | mockOldWebView := mocks.NewMockWidget(t) | |
| 189 | 224 | mockNewWebView := mocks.NewMockWidget(t) | |
| 190 | 225 | ||
| 191 | - | setupPaneViewMocks(mockFactory, mockOverlay, mockBorderBox, mockOldWebView) | |
| 226 | + | setupPaneViewMocks(mockFactory, mockOverlay, mockBorderBox, mockProgressBar, mockOldWebView) | |
| 192 | 227 | ||
| 193 | 228 | pv := component.NewPaneView(mockFactory, entity.PaneID("pane-1"), mockOldWebView) | |
| 194 | 229 | ||
| @@ -210,9 +245,10 @@ func TestSetWebViewWidget_FromNil(t *testing.T) { | |||
| 210 | 245 | mockFactory := mocks.NewMockWidgetFactory(t) | |
| 211 | 246 | mockOverlay := mocks.NewMockOverlayWidget(t) | |
| 212 | 247 | mockBorderBox := mocks.NewMockBoxWidget(t) | |
| 248 | + | mockProgressBar := mocks.NewMockProgressBarWidget(t) | |
| 213 | 249 | mockNewWebView := mocks.NewMockWidget(t) | |
| 214 | 250 | ||
| 215 | - | setupPaneViewMocksNoWebView(mockFactory, mockOverlay, mockBorderBox) | |
| 251 | + | setupPaneViewMocksNoWebView(mockFactory, mockOverlay, mockBorderBox, mockProgressBar) | |
| 216 | 252 | ||
| 217 | 253 | pv := component.NewPaneView(mockFactory, entity.PaneID("pane-1"), nil) | |
| 218 | 254 | ||
| @@ -233,9 +269,10 @@ func TestGrabFocus_DelegatesToWebView(t *testing.T) { | |||
| 233 | 269 | mockFactory := mocks.NewMockWidgetFactory(t) | |
| 234 | 270 | mockOverlay := mocks.NewMockOverlayWidget(t) | |
| 235 | 271 | mockBorderBox := mocks.NewMockBoxWidget(t) | |
| 272 | + | mockProgressBar := mocks.NewMockProgressBarWidget(t) | |
| 236 | 273 | mockWebView := mocks.NewMockWidget(t) | |
| 237 | 274 | ||
| 238 | - | setupPaneViewMocks(mockFactory, mockOverlay, mockBorderBox, mockWebView) | |
| 275 | + | setupPaneViewMocks(mockFactory, mockOverlay, mockBorderBox, mockProgressBar, mockWebView) | |
| 239 | 276 | ||
| 240 | 277 | pv := component.NewPaneView(mockFactory, entity.PaneID("pane-1"), mockWebView) | |
| 241 | 278 | ||
| @@ -253,8 +290,9 @@ func TestGrabFocus_NilWebView_ReturnsFalse(t *testing.T) { | |||
| 253 | 290 | mockFactory := mocks.NewMockWidgetFactory(t) | |
| 254 | 291 | mockOverlay := mocks.NewMockOverlayWidget(t) | |
| 255 | 292 | mockBorderBox := mocks.NewMockBoxWidget(t) | |
| 293 | + | mockProgressBar := mocks.NewMockProgressBarWidget(t) | |
| 256 | 294 | ||
| 257 | - | setupPaneViewMocksNoWebView(mockFactory, mockOverlay, mockBorderBox) | |
| 295 | + | setupPaneViewMocksNoWebView(mockFactory, mockOverlay, mockBorderBox, mockProgressBar) | |
| 258 | 296 | ||
| 259 | 297 | pv := component.NewPaneView(mockFactory, entity.PaneID("pane-1"), nil) | |
| 260 | 298 | ||
| @@ -270,9 +308,10 @@ func TestHasFocus_DelegatesToWebView(t *testing.T) { | |||
| 270 | 308 | mockFactory := mocks.NewMockWidgetFactory(t) | |
| 271 | 309 | mockOverlay := mocks.NewMockOverlayWidget(t) | |
| 272 | 310 | mockBorderBox := mocks.NewMockBoxWidget(t) | |
| 311 | + | mockProgressBar := mocks.NewMockProgressBarWidget(t) | |
| 273 | 312 | mockWebView := mocks.NewMockWidget(t) | |
| 274 | 313 | ||
| 275 | - | setupPaneViewMocks(mockFactory, mockOverlay, mockBorderBox, mockWebView) | |
| 314 | + | setupPaneViewMocks(mockFactory, mockOverlay, mockBorderBox, mockProgressBar, mockWebView) | |
| 276 | 315 | ||
| 277 | 316 | pv := component.NewPaneView(mockFactory, entity.PaneID("pane-1"), mockWebView) | |
| 278 | 317 | ||
| @@ -290,8 +329,9 @@ func TestHasFocus_NilWebView_ReturnsFalse(t *testing.T) { | |||
| 290 | 329 | mockFactory := mocks.NewMockWidgetFactory(t) | |
| 291 | 330 | mockOverlay := mocks.NewMockOverlayWidget(t) | |
| 292 | 331 | mockBorderBox := mocks.NewMockBoxWidget(t) | |
| 332 | + | mockProgressBar := mocks.NewMockProgressBarWidget(t) | |
| 293 | 333 | ||
| 294 | - | setupPaneViewMocksNoWebView(mockFactory, mockOverlay, mockBorderBox) | |
| 334 | + | setupPaneViewMocksNoWebView(mockFactory, mockOverlay, mockBorderBox, mockProgressBar) | |
| 295 | 335 | ||
| 296 | 336 | pv := component.NewPaneView(mockFactory, entity.PaneID("pane-1"), nil) | |
| 297 | 337 | ||
| @@ -307,9 +347,10 @@ func TestWidget_ReturnsOverlay(t *testing.T) { | |||
| 307 | 347 | mockFactory := mocks.NewMockWidgetFactory(t) | |
| 308 | 348 | mockOverlay := mocks.NewMockOverlayWidget(t) | |
| 309 | 349 | mockBorderBox := mocks.NewMockBoxWidget(t) | |
| 350 | + | mockProgressBar := mocks.NewMockProgressBarWidget(t) | |
| 310 | 351 | mockWebView := mocks.NewMockWidget(t) | |
| 311 | 352 | ||
| 312 | - | setupPaneViewMocks(mockFactory, mockOverlay, mockBorderBox, mockWebView) | |
| 353 | + | setupPaneViewMocks(mockFactory, mockOverlay, mockBorderBox, mockProgressBar, mockWebView) | |
| 313 | 354 | ||
| 314 | 355 | pv := component.NewPaneView(mockFactory, entity.PaneID("pane-1"), mockWebView) | |
| 315 | 356 | ||
| @@ -325,9 +366,10 @@ func TestOverlay_ReturnsOverlayWidget(t *testing.T) { | |||
| 325 | 366 | mockFactory := mocks.NewMockWidgetFactory(t) | |
| 326 | 367 | mockOverlay := mocks.NewMockOverlayWidget(t) | |
| 327 | 368 | mockBorderBox := mocks.NewMockBoxWidget(t) | |
| 369 | + | mockProgressBar := mocks.NewMockProgressBarWidget(t) | |
| 328 | 370 | mockWebView := mocks.NewMockWidget(t) | |
| 329 | 371 | ||
| 330 | - | setupPaneViewMocks(mockFactory, mockOverlay, mockBorderBox, mockWebView) | |
| 372 | + | setupPaneViewMocks(mockFactory, mockOverlay, mockBorderBox, mockProgressBar, mockWebView) | |
| 331 | 373 | ||
| 332 | 374 | pv := component.NewPaneView(mockFactory, entity.PaneID("pane-1"), mockWebView) | |
| 333 | 375 | ||
| @@ -343,9 +385,10 @@ func TestShow_DelegatesToOverlay(t *testing.T) { | |||
| 343 | 385 | mockFactory := mocks.NewMockWidgetFactory(t) | |
| 344 | 386 | mockOverlay := mocks.NewMockOverlayWidget(t) | |
| 345 | 387 | mockBorderBox := mocks.NewMockBoxWidget(t) | |
| 388 | + | mockProgressBar := mocks.NewMockProgressBarWidget(t) | |
| 346 | 389 | mockWebView := mocks.NewMockWidget(t) | |
| 347 | 390 | ||
| 348 | - | setupPaneViewMocks(mockFactory, mockOverlay, mockBorderBox, mockWebView) | |
| 391 | + | setupPaneViewMocks(mockFactory, mockOverlay, mockBorderBox, mockProgressBar, mockWebView) | |
| 349 | 392 | ||
| 350 | 393 | pv := component.NewPaneView(mockFactory, entity.PaneID("pane-1"), mockWebView) | |
| 351 | 394 | ||
| @@ -362,9 +405,10 @@ func TestHide_DelegatesToOverlay(t *testing.T) { | |||
| 362 | 405 | mockFactory := mocks.NewMockWidgetFactory(t) | |
| 363 | 406 | mockOverlay := mocks.NewMockOverlayWidget(t) | |
| 364 | 407 | mockBorderBox := mocks.NewMockBoxWidget(t) | |
| 408 | + | mockProgressBar := mocks.NewMockProgressBarWidget(t) | |
| 365 | 409 | mockWebView := mocks.NewMockWidget(t) | |
| 366 | 410 | ||
| 367 | - | setupPaneViewMocks(mockFactory, mockOverlay, mockBorderBox, mockWebView) | |
| 411 | + | setupPaneViewMocks(mockFactory, mockOverlay, mockBorderBox, mockProgressBar, mockWebView) | |
| 368 | 412 | ||
| 369 | 413 | pv := component.NewPaneView(mockFactory, entity.PaneID("pane-1"), mockWebView) | |
| 370 | 414 | ||
| @@ -381,9 +425,10 @@ func TestSetVisible_DelegatesToOverlay(t *testing.T) { | |||
| 381 | 425 | mockFactory := mocks.NewMockWidgetFactory(t) | |
| 382 | 426 | mockOverlay := mocks.NewMockOverlayWidget(t) | |
| 383 | 427 | mockBorderBox := mocks.NewMockBoxWidget(t) | |
| 428 | + | mockProgressBar := mocks.NewMockProgressBarWidget(t) | |
| 384 | 429 | mockWebView := mocks.NewMockWidget(t) | |
| 385 | 430 | ||
| 386 | - | setupPaneViewMocks(mockFactory, mockOverlay, mockBorderBox, mockWebView) | |
| 431 | + | setupPaneViewMocks(mockFactory, mockOverlay, mockBorderBox, mockProgressBar, mockWebView) | |
| 387 | 432 | ||
| 388 | 433 | pv := component.NewPaneView(mockFactory, entity.PaneID("pane-1"), mockWebView) | |
| 389 | 434 | ||
| @@ -400,9 +445,10 @@ func TestIsVisible_DelegatesToOverlay(t *testing.T) { | |||
| 400 | 445 | mockFactory := mocks.NewMockWidgetFactory(t) | |
| 401 | 446 | mockOverlay := mocks.NewMockOverlayWidget(t) | |
| 402 | 447 | mockBorderBox := mocks.NewMockBoxWidget(t) | |
| 448 | + | mockProgressBar := mocks.NewMockProgressBarWidget(t) | |
| 403 | 449 | mockWebView := mocks.NewMockWidget(t) | |
| 404 | 450 | ||
| 405 | - | setupPaneViewMocks(mockFactory, mockOverlay, mockBorderBox, mockWebView) | |
| 451 | + | setupPaneViewMocks(mockFactory, mockOverlay, mockBorderBox, mockProgressBar, mockWebView) | |
| 406 | 452 | ||
| 407 | 453 | pv := component.NewPaneView(mockFactory, entity.PaneID("pane-1"), mockWebView) | |
| 408 | 454 | ||
| @@ -420,9 +466,10 @@ func TestAddCssClass_DelegatesToOverlay(t *testing.T) { | |||
| 420 | 466 | mockFactory := mocks.NewMockWidgetFactory(t) | |
| 421 | 467 | mockOverlay := mocks.NewMockOverlayWidget(t) | |
| 422 | 468 | mockBorderBox := mocks.NewMockBoxWidget(t) | |
| 469 | + | mockProgressBar := mocks.NewMockProgressBarWidget(t) | |
| 423 | 470 | mockWebView := mocks.NewMockWidget(t) | |
| 424 | 471 | ||
| 425 | - | setupPaneViewMocks(mockFactory, mockOverlay, mockBorderBox, mockWebView) | |
| 472 | + | setupPaneViewMocks(mockFactory, mockOverlay, mockBorderBox, mockProgressBar, mockWebView) | |
| 426 | 473 | ||
| 427 | 474 | pv := component.NewPaneView(mockFactory, entity.PaneID("pane-1"), mockWebView) | |
| 428 | 475 | ||
| @@ -439,9 +486,10 @@ func TestRemoveCssClass_DelegatesToOverlay(t *testing.T) { | |||
| 439 | 486 | mockFactory := mocks.NewMockWidgetFactory(t) | |
| 440 | 487 | mockOverlay := mocks.NewMockOverlayWidget(t) | |
| 441 | 488 | mockBorderBox := mocks.NewMockBoxWidget(t) | |
| 489 | + | mockProgressBar := mocks.NewMockProgressBarWidget(t) | |
| 442 | 490 | mockWebView := mocks.NewMockWidget(t) | |
| 443 | 491 | ||
| 444 | - | setupPaneViewMocks(mockFactory, mockOverlay, mockBorderBox, mockWebView) | |
| 492 | + | setupPaneViewMocks(mockFactory, mockOverlay, mockBorderBox, mockProgressBar, mockWebView) | |
| 445 | 493 | ||
| 446 | 494 | pv := component.NewPaneView(mockFactory, entity.PaneID("pane-1"), mockWebView) | |
| 447 | 495 | ||
| @@ -458,9 +506,10 @@ func TestSetOnFocusIn_SetsCallback(t *testing.T) { | |||
| 458 | 506 | mockFactory := mocks.NewMockWidgetFactory(t) | |
| 459 | 507 | mockOverlay := mocks.NewMockOverlayWidget(t) | |
| 460 | 508 | mockBorderBox := mocks.NewMockBoxWidget(t) | |
| 509 | + | mockProgressBar := mocks.NewMockProgressBarWidget(t) | |
| 461 | 510 | mockWebView := mocks.NewMockWidget(t) | |
| 462 | 511 | ||
| 463 | - | setupPaneViewMocks(mockFactory, mockOverlay, mockBorderBox, mockWebView) | |
| 512 | + | setupPaneViewMocks(mockFactory, mockOverlay, mockBorderBox, mockProgressBar, mockWebView) | |
| 464 | 513 | ||
| 465 | 514 | pv := component.NewPaneView(mockFactory, entity.PaneID("pane-1"), mockWebView) | |
| 466 | 515 | ||
| @@ -478,9 +527,10 @@ func TestSetOnFocusOut_SetsCallback(t *testing.T) { | |||
| 478 | 527 | mockFactory := mocks.NewMockWidgetFactory(t) | |
| 479 | 528 | mockOverlay := mocks.NewMockOverlayWidget(t) | |
| 480 | 529 | mockBorderBox := mocks.NewMockBoxWidget(t) | |
| 530 | + | mockProgressBar := mocks.NewMockProgressBarWidget(t) | |
| 481 | 531 | mockWebView := mocks.NewMockWidget(t) | |
| 482 | 532 | ||
| 483 | - | setupPaneViewMocks(mockFactory, mockOverlay, mockBorderBox, mockWebView) | |
| 533 | + | setupPaneViewMocks(mockFactory, mockOverlay, mockBorderBox, mockProgressBar, mockWebView) | |
| 484 | 534 | ||
| 485 | 535 | pv := component.NewPaneView(mockFactory, entity.PaneID("pane-1"), mockWebView) | |
| 486 | 536 | ||
| @@ -498,6 +548,7 @@ func setupPaneViewMocks( | |||
| 498 | 548 | mockFactory *mocks.MockWidgetFactory, | |
| 499 | 549 | mockOverlay *mocks.MockOverlayWidget, | |
| 500 | 550 | mockBorderBox *mocks.MockBoxWidget, | |
| 551 | + | mockProgressBar *mocks.MockProgressBarWidget, | |
| 501 | 552 | mockWebView *mocks.MockWidget, | |
| 502 | 553 | ) { | |
| 503 | 554 | mockFactory.EXPECT().NewOverlay().Return(mockOverlay).Once() | |
| @@ -516,12 +567,26 @@ func setupPaneViewMocks( | |||
| 516 | 567 | mockOverlay.EXPECT().AddOverlay(mockBorderBox).Once() | |
| 517 | 568 | mockOverlay.EXPECT().SetClipOverlay(mockBorderBox, false).Once() | |
| 518 | 569 | mockOverlay.EXPECT().SetMeasureOverlay(mockBorderBox, false).Once() | |
| 570 | + | ||
| 571 | + | // Progress bar setup | |
| 572 | + | mockFactory.EXPECT().NewProgressBar().Return(mockProgressBar).Once() | |
| 573 | + | mockProgressBar.EXPECT().AddCssClass("osd").Once() | |
| 574 | + | mockProgressBar.EXPECT().SetValign(gtk.AlignEndValue).Once() | |
| 575 | + | mockProgressBar.EXPECT().SetHalign(gtk.AlignFillValue).Once() | |
| 576 | + | mockProgressBar.EXPECT().SetHexpand(true).Once() | |
| 577 | + | mockProgressBar.EXPECT().SetCanTarget(false).Once() | |
| 578 | + | mockProgressBar.EXPECT().SetCanFocus(false).Once() | |
| 579 | + | mockProgressBar.EXPECT().SetVisible(false).Once() | |
| 580 | + | mockOverlay.EXPECT().AddOverlay(mockProgressBar).Once() | |
| 581 | + | mockOverlay.EXPECT().SetClipOverlay(mockProgressBar, false).Once() | |
| 582 | + | mockOverlay.EXPECT().SetMeasureOverlay(mockProgressBar, false).Once() | |
| 519 | 583 | } | |
| 520 | 584 | ||
| 521 | 585 | func setupPaneViewMocksNoWebView( | |
| 522 | 586 | mockFactory *mocks.MockWidgetFactory, | |
| 523 | 587 | mockOverlay *mocks.MockOverlayWidget, | |
| 524 | 588 | mockBorderBox *mocks.MockBoxWidget, | |
| 589 | + | mockProgressBar *mocks.MockProgressBarWidget, | |
| 525 | 590 | ) { | |
| 526 | 591 | mockFactory.EXPECT().NewOverlay().Return(mockOverlay).Once() | |
| 527 | 592 | mockOverlay.EXPECT().SetHexpand(true).Once() | |
| @@ -537,4 +602,17 @@ func setupPaneViewMocksNoWebView( | |||
| 537 | 602 | mockOverlay.EXPECT().AddOverlay(mockBorderBox).Once() | |
| 538 | 603 | mockOverlay.EXPECT().SetClipOverlay(mockBorderBox, false).Once() | |
| 539 | 604 | mockOverlay.EXPECT().SetMeasureOverlay(mockBorderBox, false).Once() | |
| 605 | + | ||
| 606 | + | // Progress bar setup | |
| 607 | + | mockFactory.EXPECT().NewProgressBar().Return(mockProgressBar).Once() | |
| 608 | + | mockProgressBar.EXPECT().AddCssClass("osd").Once() | |
| 609 | + | mockProgressBar.EXPECT().SetValign(gtk.AlignEndValue).Once() | |
| 610 | + | mockProgressBar.EXPECT().SetHalign(gtk.AlignFillValue).Once() | |
| 611 | + | mockProgressBar.EXPECT().SetHexpand(true).Once() | |
| 612 | + | mockProgressBar.EXPECT().SetCanTarget(false).Once() | |
| 613 | + | mockProgressBar.EXPECT().SetCanFocus(false).Once() | |
| 614 | + | mockProgressBar.EXPECT().SetVisible(false).Once() | |
| 615 | + | mockOverlay.EXPECT().AddOverlay(mockProgressBar).Once() | |
| 616 | + | mockOverlay.EXPECT().SetClipOverlay(mockProgressBar, false).Once() | |
| 617 | + | mockOverlay.EXPECT().SetMeasureOverlay(mockProgressBar, false).Once() | |
| 540 | 618 | } | |
| @@ -3,6 +3,7 @@ package component_test | |||||
| 3 | import ( | 3 | import ( | ||
| 4 | "testing" | 4 | "testing" | ||
| 5 | 5 | ||||
| 6 | + | "github.com/jwijenbergh/puregotk/v4/gtk" | |||
| 6 | "github.com/stretchr/testify/assert" | 7 | "github.com/stretchr/testify/assert" | ||
| 7 | "github.com/stretchr/testify/require" | 8 | "github.com/stretchr/testify/require" | ||
| 8 | 9 | ||||
| @@ -17,6 +18,7 @@ func TestNewPaneView_CreatesOverlay(t *testing.T) { | |||||
| 17 | mockFactory := mocks.NewMockWidgetFactory(t) | 18 | mockFactory := mocks.NewMockWidgetFactory(t) | ||
| 18 | mockOverlay := mocks.NewMockOverlayWidget(t) | 19 | mockOverlay := mocks.NewMockOverlayWidget(t) | ||
| 19 | mockBorderBox := mocks.NewMockBoxWidget(t) | 20 | mockBorderBox := mocks.NewMockBoxWidget(t) | ||
| 21 | + | mockProgressBar := mocks.NewMockProgressBarWidget(t) | |||
| 20 | mockWebView := mocks.NewMockWidget(t) | 22 | mockWebView := mocks.NewMockWidget(t) | ||
| 21 | 23 | ||||
| 22 | paneID := entity.PaneID("pane-1") | 24 | paneID := entity.PaneID("pane-1") | ||
| @@ -38,6 +40,19 @@ func TestNewPaneView_CreatesOverlay(t *testing.T) { | |||||
| 38 | mockOverlay.EXPECT().SetClipOverlay(mockBorderBox, false).Once() | 40 | mockOverlay.EXPECT().SetClipOverlay(mockBorderBox, false).Once() | ||
| 39 | mockOverlay.EXPECT().SetMeasureOverlay(mockBorderBox, false).Once() | 41 | mockOverlay.EXPECT().SetMeasureOverlay(mockBorderBox, false).Once() | ||
| 40 | 42 | ||||
| 43 | + | // Progress bar setup | |||
| 44 | + | mockFactory.EXPECT().NewProgressBar().Return(mockProgressBar).Once() | |||
| 45 | + | mockProgressBar.EXPECT().AddCssClass("osd").Once() | |||
| 46 | + | mockProgressBar.EXPECT().SetValign(gtk.AlignEndValue).Once() | |||
| 47 | + | mockProgressBar.EXPECT().SetHalign(gtk.AlignFillValue).Once() | |||
| 48 | + | mockProgressBar.EXPECT().SetHexpand(true).Once() | |||
| 49 | + | mockProgressBar.EXPECT().SetCanTarget(false).Once() | |||
| 50 | + | mockProgressBar.EXPECT().SetCanFocus(false).Once() | |||
| 51 | + | mockProgressBar.EXPECT().SetVisible(false).Once() | |||
| 52 | + | mockOverlay.EXPECT().AddOverlay(mockProgressBar).Once() | |||
| 53 | + | mockOverlay.EXPECT().SetClipOverlay(mockProgressBar, false).Once() | |||
| 54 | + | mockOverlay.EXPECT().SetMeasureOverlay(mockProgressBar, false).Once() | |||
| 55 | + | ||||
| 41 | // Act | 56 | // Act | ||
| 42 | pv := component.NewPaneView(mockFactory, paneID, mockWebView) | 57 | pv := component.NewPaneView(mockFactory, paneID, mockWebView) | ||
| 43 | 58 | ||||
| @@ -52,6 +67,7 @@ func TestNewPaneView_NilWebView(t *testing.T) { | |||||
| 52 | mockFactory := mocks.NewMockWidgetFactory(t) | 67 | mockFactory := mocks.NewMockWidgetFactory(t) | ||
| 53 | mockOverlay := mocks.NewMockOverlayWidget(t) | 68 | mockOverlay := mocks.NewMockOverlayWidget(t) | ||
| 54 | mockBorderBox := mocks.NewMockBoxWidget(t) | 69 | mockBorderBox := mocks.NewMockBoxWidget(t) | ||
| 70 | + | mockProgressBar := mocks.NewMockProgressBarWidget(t) | |||
| 55 | 71 | ||||
| 56 | paneID := entity.PaneID("pane-1") | 72 | paneID := entity.PaneID("pane-1") | ||
| 57 | 73 | ||||
| @@ -71,6 +87,19 @@ func TestNewPaneView_NilWebView(t *testing.T) { | |||||
| 71 | mockOverlay.EXPECT().SetClipOverlay(mockBorderBox, false).Once() | 87 | mockOverlay.EXPECT().SetClipOverlay(mockBorderBox, false).Once() | ||
| 72 | mockOverlay.EXPECT().SetMeasureOverlay(mockBorderBox, false).Once() | 88 | mockOverlay.EXPECT().SetMeasureOverlay(mockBorderBox, false).Once() | ||
| 73 | 89 | ||||
| 90 | + | // Progress bar setup | |||
| 91 | + | mockFactory.EXPECT().NewProgressBar().Return(mockProgressBar).Once() | |||
| 92 | + | mockProgressBar.EXPECT().AddCssClass("osd").Once() | |||
| 93 | + | mockProgressBar.EXPECT().SetValign(gtk.AlignEndValue).Once() | |||
| 94 | + | mockProgressBar.EXPECT().SetHalign(gtk.AlignFillValue).Once() | |||
| 95 | + | mockProgressBar.EXPECT().SetHexpand(true).Once() | |||
| 96 | + | mockProgressBar.EXPECT().SetCanTarget(false).Once() | |||
| 97 | + | mockProgressBar.EXPECT().SetCanFocus(false).Once() | |||
| 98 | + | mockProgressBar.EXPECT().SetVisible(false).Once() | |||
| 99 | + | mockOverlay.EXPECT().AddOverlay(mockProgressBar).Once() | |||
| 100 | + | mockOverlay.EXPECT().SetClipOverlay(mockProgressBar, false).Once() | |||
| 101 | + | mockOverlay.EXPECT().SetMeasureOverlay(mockProgressBar, false).Once() | |||
| 102 | + | ||||
| 74 | // Act | 103 | // Act | ||
| 75 | pv := component.NewPaneView(mockFactory, paneID, nil) | 104 | pv := component.NewPaneView(mockFactory, paneID, nil) | ||
| 76 | 105 | ||||
| @@ -84,9 +113,10 @@ func TestSetActive_True_AddsCSSClass(t *testing.T) { | |||||
| 84 | mockFactory := mocks.NewMockWidgetFactory(t) | 113 | mockFactory := mocks.NewMockWidgetFactory(t) | ||
| 85 | mockOverlay := mocks.NewMockOverlayWidget(t) | 114 | mockOverlay := mocks.NewMockOverlayWidget(t) | ||
| 86 | mockBorderBox := mocks.NewMockBoxWidget(t) | 115 | mockBorderBox := mocks.NewMockBoxWidget(t) | ||
| 116 | + | mockProgressBar := mocks.NewMockProgressBarWidget(t) | |||
| 87 | mockWebView := mocks.NewMockWidget(t) | 117 | mockWebView := mocks.NewMockWidget(t) | ||
| 88 | 118 | ||||
| 89 | - | setupPaneViewMocks(mockFactory, mockOverlay, mockBorderBox, mockWebView) | 119 | + | setupPaneViewMocks(mockFactory, mockOverlay, mockBorderBox, mockProgressBar, mockWebView) |
| 90 | 120 | ||||
| 91 | pv := component.NewPaneView(mockFactory, entity.PaneID("pane-1"), mockWebView) | 121 | pv := component.NewPaneView(mockFactory, entity.PaneID("pane-1"), mockWebView) | ||
| 92 | 122 | ||||
| @@ -105,9 +135,10 @@ func TestSetActive_False_RemovesCSSClass(t *testing.T) { | |||||
| 105 | mockFactory := mocks.NewMockWidgetFactory(t) | 135 | mockFactory := mocks.NewMockWidgetFactory(t) | ||
| 106 | mockOverlay := mocks.NewMockOverlayWidget(t) | 136 | mockOverlay := mocks.NewMockOverlayWidget(t) | ||
| 107 | mockBorderBox := mocks.NewMockBoxWidget(t) | 137 | mockBorderBox := mocks.NewMockBoxWidget(t) | ||
| 138 | + | mockProgressBar := mocks.NewMockProgressBarWidget(t) | |||
| 108 | mockWebView := mocks.NewMockWidget(t) | 139 | mockWebView := mocks.NewMockWidget(t) | ||
| 109 | 140 | ||||
| 110 | - | setupPaneViewMocks(mockFactory, mockOverlay, mockBorderBox, mockWebView) | 141 | + | setupPaneViewMocks(mockFactory, mockOverlay, mockBorderBox, mockProgressBar, mockWebView) |
| 111 | 142 | ||||
| 112 | pv := component.NewPaneView(mockFactory, entity.PaneID("pane-1"), mockWebView) | 143 | pv := component.NewPaneView(mockFactory, entity.PaneID("pane-1"), mockWebView) | ||
| 113 | 144 | ||||
| @@ -130,9 +161,10 @@ func TestSetActive_NoChangeWhenSameState(t *testing.T) { | |||||
| 130 | mockFactory := mocks.NewMockWidgetFactory(t) | 161 | mockFactory := mocks.NewMockWidgetFactory(t) | ||
| 131 | mockOverlay := mocks.NewMockOverlayWidget(t) | 162 | mockOverlay := mocks.NewMockOverlayWidget(t) | ||
| 132 | mockBorderBox := mocks.NewMockBoxWidget(t) | 163 | mockBorderBox := mocks.NewMockBoxWidget(t) | ||
| 164 | + | mockProgressBar := mocks.NewMockProgressBarWidget(t) | |||
| 133 | mockWebView := mocks.NewMockWidget(t) | 165 | mockWebView := mocks.NewMockWidget(t) | ||
| 134 | 166 | ||||
| 135 | - | setupPaneViewMocks(mockFactory, mockOverlay, mockBorderBox, mockWebView) | 167 | + | setupPaneViewMocks(mockFactory, mockOverlay, mockBorderBox, mockProgressBar, mockWebView) |
| 136 | 168 | ||||
| 137 | pv := component.NewPaneView(mockFactory, entity.PaneID("pane-1"), mockWebView) | 169 | pv := component.NewPaneView(mockFactory, entity.PaneID("pane-1"), mockWebView) | ||
| 138 | 170 | ||||
| @@ -148,10 +180,11 @@ func TestPaneID_ReturnsPaneID(t *testing.T) { | |||||
| 148 | mockFactory := mocks.NewMockWidgetFactory(t) | 180 | mockFactory := mocks.NewMockWidgetFactory(t) | ||
| 149 | mockOverlay := mocks.NewMockOverlayWidget(t) | 181 | mockOverlay := mocks.NewMockOverlayWidget(t) | ||
| 150 | mockBorderBox := mocks.NewMockBoxWidget(t) | 182 | mockBorderBox := mocks.NewMockBoxWidget(t) | ||
| 183 | + | mockProgressBar := mocks.NewMockProgressBarWidget(t) | |||
| 151 | mockWebView := mocks.NewMockWidget(t) | 184 | mockWebView := mocks.NewMockWidget(t) | ||
| 152 | 185 | ||||
| 153 | paneID := entity.PaneID("test-pane-123") | 186 | paneID := entity.PaneID("test-pane-123") | ||
| 154 | - | setupPaneViewMocks(mockFactory, mockOverlay, mockBorderBox, mockWebView) | 187 | + | setupPaneViewMocks(mockFactory, mockOverlay, mockBorderBox, mockProgressBar, mockWebView) |
| 155 | 188 | ||||
| 156 | pv := component.NewPaneView(mockFactory, paneID, mockWebView) | 189 | pv := component.NewPaneView(mockFactory, paneID, mockWebView) | ||
| 157 | 190 | ||||
| @@ -167,9 +200,10 @@ func TestWebViewWidget_ReturnsWebView(t *testing.T) { | |||||
| 167 | mockFactory := mocks.NewMockWidgetFactory(t) | 200 | mockFactory := mocks.NewMockWidgetFactory(t) | ||
| 168 | mockOverlay := mocks.NewMockOverlayWidget(t) | 201 | mockOverlay := mocks.NewMockOverlayWidget(t) | ||
| 169 | mockBorderBox := mocks.NewMockBoxWidget(t) | 202 | mockBorderBox := mocks.NewMockBoxWidget(t) | ||
| 203 | + | mockProgressBar := mocks.NewMockProgressBarWidget(t) | |||
| 170 | mockWebView := mocks.NewMockWidget(t) | 204 | mockWebView := mocks.NewMockWidget(t) | ||
| 171 | 205 | ||||
| 172 | - | setupPaneViewMocks(mockFactory, mockOverlay, mockBorderBox, mockWebView) | 206 | + | setupPaneViewMocks(mockFactory, mockOverlay, mockBorderBox, mockProgressBar, mockWebView) |
| 173 | 207 | ||||
| 174 | pv := component.NewPaneView(mockFactory, entity.PaneID("pane-1"), mockWebView) | 208 | pv := component.NewPaneView(mockFactory, entity.PaneID("pane-1"), mockWebView) | ||
| 175 | 209 | ||||
| @@ -185,10 +219,11 @@ func TestSetWebViewWidget_ReplacesWidget(t *testing.T) { | |||||
| 185 | mockFactory := mocks.NewMockWidgetFactory(t) | 219 | mockFactory := mocks.NewMockWidgetFactory(t) | ||
| 186 | mockOverlay := mocks.NewMockOverlayWidget(t) | 220 | mockOverlay := mocks.NewMockOverlayWidget(t) | ||
| 187 | mockBorderBox := mocks.NewMockBoxWidget(t) | 221 | mockBorderBox := mocks.NewMockBoxWidget(t) | ||
| 222 | + | mockProgressBar := mocks.NewMockProgressBarWidget(t) | |||
| 188 | mockOldWebView := mocks.NewMockWidget(t) | 223 | mockOldWebView := mocks.NewMockWidget(t) | ||
| 189 | mockNewWebView := mocks.NewMockWidget(t) | 224 | mockNewWebView := mocks.NewMockWidget(t) | ||
| 190 | 225 | ||||
| 191 | - | setupPaneViewMocks(mockFactory, mockOverlay, mockBorderBox, mockOldWebView) | 226 | + | setupPaneViewMocks(mockFactory, mockOverlay, mockBorderBox, mockProgressBar, mockOldWebView) |
| 192 | 227 | ||||
| 193 | pv := component.NewPaneView(mockFactory, entity.PaneID("pane-1"), mockOldWebView) | 228 | pv := component.NewPaneView(mockFactory, entity.PaneID("pane-1"), mockOldWebView) | ||
| 194 | 229 | ||||
| @@ -210,9 +245,10 @@ func TestSetWebViewWidget_FromNil(t *testing.T) { | |||||
| 210 | mockFactory := mocks.NewMockWidgetFactory(t) | 245 | mockFactory := mocks.NewMockWidgetFactory(t) | ||
| 211 | mockOverlay := mocks.NewMockOverlayWidget(t) | 246 | mockOverlay := mocks.NewMockOverlayWidget(t) | ||
| 212 | mockBorderBox := mocks.NewMockBoxWidget(t) | 247 | mockBorderBox := mocks.NewMockBoxWidget(t) | ||
| 248 | + | mockProgressBar := mocks.NewMockProgressBarWidget(t) | |||
| 213 | mockNewWebView := mocks.NewMockWidget(t) | 249 | mockNewWebView := mocks.NewMockWidget(t) | ||
| 214 | 250 | ||||
| 215 | - | setupPaneViewMocksNoWebView(mockFactory, mockOverlay, mockBorderBox) | 251 | + | setupPaneViewMocksNoWebView(mockFactory, mockOverlay, mockBorderBox, mockProgressBar) |
| 216 | 252 | ||||
| 217 | pv := component.NewPaneView(mockFactory, entity.PaneID("pane-1"), nil) | 253 | pv := component.NewPaneView(mockFactory, entity.PaneID("pane-1"), nil) | ||
| 218 | 254 | ||||
| @@ -233,9 +269,10 @@ func TestGrabFocus_DelegatesToWebView(t *testing.T) { | |||||
| 233 | mockFactory := mocks.NewMockWidgetFactory(t) | 269 | mockFactory := mocks.NewMockWidgetFactory(t) | ||
| 234 | mockOverlay := mocks.NewMockOverlayWidget(t) | 270 | mockOverlay := mocks.NewMockOverlayWidget(t) | ||
| 235 | mockBorderBox := mocks.NewMockBoxWidget(t) | 271 | mockBorderBox := mocks.NewMockBoxWidget(t) | ||
| 272 | + | mockProgressBar := mocks.NewMockProgressBarWidget(t) | |||
| 236 | mockWebView := mocks.NewMockWidget(t) | 273 | mockWebView := mocks.NewMockWidget(t) | ||
| 237 | 274 | ||||
| 238 | - | setupPaneViewMocks(mockFactory, mockOverlay, mockBorderBox, mockWebView) | 275 | + | setupPaneViewMocks(mockFactory, mockOverlay, mockBorderBox, mockProgressBar, mockWebView) |
| 239 | 276 | ||||
| 240 | pv := component.NewPaneView(mockFactory, entity.PaneID("pane-1"), mockWebView) | 277 | pv := component.NewPaneView(mockFactory, entity.PaneID("pane-1"), mockWebView) | ||
| 241 | 278 | ||||
| @@ -253,8 +290,9 @@ func TestGrabFocus_NilWebView_ReturnsFalse(t *testing.T) { | |||||
| 253 | mockFactory := mocks.NewMockWidgetFactory(t) | 290 | mockFactory := mocks.NewMockWidgetFactory(t) | ||
| 254 | mockOverlay := mocks.NewMockOverlayWidget(t) | 291 | mockOverlay := mocks.NewMockOverlayWidget(t) | ||
| 255 | mockBorderBox := mocks.NewMockBoxWidget(t) | 292 | mockBorderBox := mocks.NewMockBoxWidget(t) | ||
| 293 | + | mockProgressBar := mocks.NewMockProgressBarWidget(t) | |||
| 256 | 294 | ||||
| 257 | - | setupPaneViewMocksNoWebView(mockFactory, mockOverlay, mockBorderBox) | 295 | + | setupPaneViewMocksNoWebView(mockFactory, mockOverlay, mockBorderBox, mockProgressBar) |
| 258 | 296 | ||||
| 259 | pv := component.NewPaneView(mockFactory, entity.PaneID("pane-1"), nil) | 297 | pv := component.NewPaneView(mockFactory, entity.PaneID("pane-1"), nil) | ||
| 260 | 298 | ||||
| @@ -270,9 +308,10 @@ func TestHasFocus_DelegatesToWebView(t *testing.T) { | |||||
| 270 | mockFactory := mocks.NewMockWidgetFactory(t) | 308 | mockFactory := mocks.NewMockWidgetFactory(t) | ||
| 271 | mockOverlay := mocks.NewMockOverlayWidget(t) | 309 | mockOverlay := mocks.NewMockOverlayWidget(t) | ||
| 272 | mockBorderBox := mocks.NewMockBoxWidget(t) | 310 | mockBorderBox := mocks.NewMockBoxWidget(t) | ||
| 311 | + | mockProgressBar := mocks.NewMockProgressBarWidget(t) | |||
| 273 | mockWebView := mocks.NewMockWidget(t) | 312 | mockWebView := mocks.NewMockWidget(t) | ||
| 274 | 313 | ||||
| 275 | - | setupPaneViewMocks(mockFactory, mockOverlay, mockBorderBox, mockWebView) | 314 | + | setupPaneViewMocks(mockFactory, mockOverlay, mockBorderBox, mockProgressBar, mockWebView) |
| 276 | 315 | ||||
| 277 | pv := component.NewPaneView(mockFactory, entity.PaneID("pane-1"), mockWebView) | 316 | pv := component.NewPaneView(mockFactory, entity.PaneID("pane-1"), mockWebView) | ||
| 278 | 317 | ||||
| @@ -290,8 +329,9 @@ func TestHasFocus_NilWebView_ReturnsFalse(t *testing.T) { | |||||
| 290 | mockFactory := mocks.NewMockWidgetFactory(t) | 329 | mockFactory := mocks.NewMockWidgetFactory(t) | ||
| 291 | mockOverlay := mocks.NewMockOverlayWidget(t) | 330 | mockOverlay := mocks.NewMockOverlayWidget(t) | ||
| 292 | mockBorderBox := mocks.NewMockBoxWidget(t) | 331 | mockBorderBox := mocks.NewMockBoxWidget(t) | ||
| 332 | + | mockProgressBar := mocks.NewMockProgressBarWidget(t) | |||
| 293 | 333 | ||||
| 294 | - | setupPaneViewMocksNoWebView(mockFactory, mockOverlay, mockBorderBox) | 334 | + | setupPaneViewMocksNoWebView(mockFactory, mockOverlay, mockBorderBox, mockProgressBar) |
| 295 | 335 | ||||
| 296 | pv := component.NewPaneView(mockFactory, entity.PaneID("pane-1"), nil) | 336 | pv := component.NewPaneView(mockFactory, entity.PaneID("pane-1"), nil) | ||
| 297 | 337 | ||||
| @@ -307,9 +347,10 @@ func TestWidget_ReturnsOverlay(t *testing.T) { | |||||
| 307 | mockFactory := mocks.NewMockWidgetFactory(t) | 347 | mockFactory := mocks.NewMockWidgetFactory(t) | ||
| 308 | mockOverlay := mocks.NewMockOverlayWidget(t) | 348 | mockOverlay := mocks.NewMockOverlayWidget(t) | ||
| 309 | mockBorderBox := mocks.NewMockBoxWidget(t) | 349 | mockBorderBox := mocks.NewMockBoxWidget(t) | ||
| 350 | + | mockProgressBar := mocks.NewMockProgressBarWidget(t) | |||
| 310 | mockWebView := mocks.NewMockWidget(t) | 351 | mockWebView := mocks.NewMockWidget(t) | ||
| 311 | 352 | ||||
| 312 | - | setupPaneViewMocks(mockFactory, mockOverlay, mockBorderBox, mockWebView) | 353 | + | setupPaneViewMocks(mockFactory, mockOverlay, mockBorderBox, mockProgressBar, mockWebView) |
| 313 | 354 | ||||
| 314 | pv := component.NewPaneView(mockFactory, entity.PaneID("pane-1"), mockWebView) | 355 | pv := component.NewPaneView(mockFactory, entity.PaneID("pane-1"), mockWebView) | ||
| 315 | 356 | ||||
| @@ -325,9 +366,10 @@ func TestOverlay_ReturnsOverlayWidget(t *testing.T) { | |||||
| 325 | mockFactory := mocks.NewMockWidgetFactory(t) | 366 | mockFactory := mocks.NewMockWidgetFactory(t) | ||
| 326 | mockOverlay := mocks.NewMockOverlayWidget(t) | 367 | mockOverlay := mocks.NewMockOverlayWidget(t) | ||
| 327 | mockBorderBox := mocks.NewMockBoxWidget(t) | 368 | mockBorderBox := mocks.NewMockBoxWidget(t) | ||
| 369 | + | mockProgressBar := mocks.NewMockProgressBarWidget(t) | |||
| 328 | mockWebView := mocks.NewMockWidget(t) | 370 | mockWebView := mocks.NewMockWidget(t) | ||
| 329 | 371 | ||||
| 330 | - | setupPaneViewMocks(mockFactory, mockOverlay, mockBorderBox, mockWebView) | 372 | + | setupPaneViewMocks(mockFactory, mockOverlay, mockBorderBox, mockProgressBar, mockWebView) |
| 331 | 373 | ||||
| 332 | pv := component.NewPaneView(mockFactory, entity.PaneID("pane-1"), mockWebView) | 374 | pv := component.NewPaneView(mockFactory, entity.PaneID("pane-1"), mockWebView) | ||
| 333 | 375 | ||||
| @@ -343,9 +385,10 @@ func TestShow_DelegatesToOverlay(t *testing.T) { | |||||
| 343 | mockFactory := mocks.NewMockWidgetFactory(t) | 385 | mockFactory := mocks.NewMockWidgetFactory(t) | ||
| 344 | mockOverlay := mocks.NewMockOverlayWidget(t) | 386 | mockOverlay := mocks.NewMockOverlayWidget(t) | ||
| 345 | mockBorderBox := mocks.NewMockBoxWidget(t) | 387 | mockBorderBox := mocks.NewMockBoxWidget(t) | ||
| 388 | + | mockProgressBar := mocks.NewMockProgressBarWidget(t) | |||
| 346 | mockWebView := mocks.NewMockWidget(t) | 389 | mockWebView := mocks.NewMockWidget(t) | ||
| 347 | 390 | ||||
| 348 | - | setupPaneViewMocks(mockFactory, mockOverlay, mockBorderBox, mockWebView) | 391 | + | setupPaneViewMocks(mockFactory, mockOverlay, mockBorderBox, mockProgressBar, mockWebView) |
| 349 | 392 | ||||
| 350 | pv := component.NewPaneView(mockFactory, entity.PaneID("pane-1"), mockWebView) | 393 | pv := component.NewPaneView(mockFactory, entity.PaneID("pane-1"), mockWebView) | ||
| 351 | 394 | ||||
| @@ -362,9 +405,10 @@ func TestHide_DelegatesToOverlay(t *testing.T) { | |||||
| 362 | mockFactory := mocks.NewMockWidgetFactory(t) | 405 | mockFactory := mocks.NewMockWidgetFactory(t) | ||
| 363 | mockOverlay := mocks.NewMockOverlayWidget(t) | 406 | mockOverlay := mocks.NewMockOverlayWidget(t) | ||
| 364 | mockBorderBox := mocks.NewMockBoxWidget(t) | 407 | mockBorderBox := mocks.NewMockBoxWidget(t) | ||
| 408 | + | mockProgressBar := mocks.NewMockProgressBarWidget(t) | |||
| 365 | mockWebView := mocks.NewMockWidget(t) | 409 | mockWebView := mocks.NewMockWidget(t) | ||
| 366 | 410 | ||||
| 367 | - | setupPaneViewMocks(mockFactory, mockOverlay, mockBorderBox, mockWebView) | 411 | + | setupPaneViewMocks(mockFactory, mockOverlay, mockBorderBox, mockProgressBar, mockWebView) |
| 368 | 412 | ||||
| 369 | pv := component.NewPaneView(mockFactory, entity.PaneID("pane-1"), mockWebView) | 413 | pv := component.NewPaneView(mockFactory, entity.PaneID("pane-1"), mockWebView) | ||
| 370 | 414 | ||||
| @@ -381,9 +425,10 @@ func TestSetVisible_DelegatesToOverlay(t *testing.T) { | |||||
| 381 | mockFactory := mocks.NewMockWidgetFactory(t) | 425 | mockFactory := mocks.NewMockWidgetFactory(t) | ||
| 382 | mockOverlay := mocks.NewMockOverlayWidget(t) | 426 | mockOverlay := mocks.NewMockOverlayWidget(t) | ||
| 383 | mockBorderBox := mocks.NewMockBoxWidget(t) | 427 | mockBorderBox := mocks.NewMockBoxWidget(t) | ||
| 428 | + | mockProgressBar := mocks.NewMockProgressBarWidget(t) | |||
| 384 | mockWebView := mocks.NewMockWidget(t) | 429 | mockWebView := mocks.NewMockWidget(t) | ||
| 385 | 430 | ||||
| 386 | - | setupPaneViewMocks(mockFactory, mockOverlay, mockBorderBox, mockWebView) | 431 | + | setupPaneViewMocks(mockFactory, mockOverlay, mockBorderBox, mockProgressBar, mockWebView) |
| 387 | 432 | ||||
| 388 | pv := component.NewPaneView(mockFactory, entity.PaneID("pane-1"), mockWebView) | 433 | pv := component.NewPaneView(mockFactory, entity.PaneID("pane-1"), mockWebView) | ||
| 389 | 434 | ||||
| @@ -400,9 +445,10 @@ func TestIsVisible_DelegatesToOverlay(t *testing.T) { | |||||
| 400 | mockFactory := mocks.NewMockWidgetFactory(t) | 445 | mockFactory := mocks.NewMockWidgetFactory(t) | ||
| 401 | mockOverlay := mocks.NewMockOverlayWidget(t) | 446 | mockOverlay := mocks.NewMockOverlayWidget(t) | ||
| 402 | mockBorderBox := mocks.NewMockBoxWidget(t) | 447 | mockBorderBox := mocks.NewMockBoxWidget(t) | ||
| 448 | + | mockProgressBar := mocks.NewMockProgressBarWidget(t) | |||
| 403 | mockWebView := mocks.NewMockWidget(t) | 449 | mockWebView := mocks.NewMockWidget(t) | ||
| 404 | 450 | ||||
| 405 | - | setupPaneViewMocks(mockFactory, mockOverlay, mockBorderBox, mockWebView) | 451 | + | setupPaneViewMocks(mockFactory, mockOverlay, mockBorderBox, mockProgressBar, mockWebView) |
| 406 | 452 | ||||
| 407 | pv := component.NewPaneView(mockFactory, entity.PaneID("pane-1"), mockWebView) | 453 | pv := component.NewPaneView(mockFactory, entity.PaneID("pane-1"), mockWebView) | ||
| 408 | 454 | ||||
| @@ -420,9 +466,10 @@ func TestAddCssClass_DelegatesToOverlay(t *testing.T) { | |||||
| 420 | mockFactory := mocks.NewMockWidgetFactory(t) | 466 | mockFactory := mocks.NewMockWidgetFactory(t) | ||
| 421 | mockOverlay := mocks.NewMockOverlayWidget(t) | 467 | mockOverlay := mocks.NewMockOverlayWidget(t) | ||
| 422 | mockBorderBox := mocks.NewMockBoxWidget(t) | 468 | mockBorderBox := mocks.NewMockBoxWidget(t) | ||
| 469 | + | mockProgressBar := mocks.NewMockProgressBarWidget(t) | |||
| 423 | mockWebView := mocks.NewMockWidget(t) | 470 | mockWebView := mocks.NewMockWidget(t) | ||
| 424 | 471 | ||||
| 425 | - | setupPaneViewMocks(mockFactory, mockOverlay, mockBorderBox, mockWebView) | 472 | + | setupPaneViewMocks(mockFactory, mockOverlay, mockBorderBox, mockProgressBar, mockWebView) |
| 426 | 473 | ||||
| 427 | pv := component.NewPaneView(mockFactory, entity.PaneID("pane-1"), mockWebView) | 474 | pv := component.NewPaneView(mockFactory, entity.PaneID("pane-1"), mockWebView) | ||
| 428 | 475 | ||||
| @@ -439,9 +486,10 @@ func TestRemoveCssClass_DelegatesToOverlay(t *testing.T) { | |||||
| 439 | mockFactory := mocks.NewMockWidgetFactory(t) | 486 | mockFactory := mocks.NewMockWidgetFactory(t) | ||
| 440 | mockOverlay := mocks.NewMockOverlayWidget(t) | 487 | mockOverlay := mocks.NewMockOverlayWidget(t) | ||
| 441 | mockBorderBox := mocks.NewMockBoxWidget(t) | 488 | mockBorderBox := mocks.NewMockBoxWidget(t) | ||
| 489 | + | mockProgressBar := mocks.NewMockProgressBarWidget(t) | |||
| 442 | mockWebView := mocks.NewMockWidget(t) | 490 | mockWebView := mocks.NewMockWidget(t) | ||
| 443 | 491 | ||||
| 444 | - | setupPaneViewMocks(mockFactory, mockOverlay, mockBorderBox, mockWebView) | 492 | + | setupPaneViewMocks(mockFactory, mockOverlay, mockBorderBox, mockProgressBar, mockWebView) |
| 445 | 493 | ||||
| 446 | pv := component.NewPaneView(mockFactory, entity.PaneID("pane-1"), mockWebView) | 494 | pv := component.NewPaneView(mockFactory, entity.PaneID("pane-1"), mockWebView) | ||
| 447 | 495 | ||||
| @@ -458,9 +506,10 @@ func TestSetOnFocusIn_SetsCallback(t *testing.T) { | |||||
| 458 | mockFactory := mocks.NewMockWidgetFactory(t) | 506 | mockFactory := mocks.NewMockWidgetFactory(t) | ||
| 459 | mockOverlay := mocks.NewMockOverlayWidget(t) | 507 | mockOverlay := mocks.NewMockOverlayWidget(t) | ||
| 460 | mockBorderBox := mocks.NewMockBoxWidget(t) | 508 | mockBorderBox := mocks.NewMockBoxWidget(t) | ||
| 509 | + | mockProgressBar := mocks.NewMockProgressBarWidget(t) | |||
| 461 | mockWebView := mocks.NewMockWidget(t) | 510 | mockWebView := mocks.NewMockWidget(t) | ||
| 462 | 511 | ||||
| 463 | - | setupPaneViewMocks(mockFactory, mockOverlay, mockBorderBox, mockWebView) | 512 | + | setupPaneViewMocks(mockFactory, mockOverlay, mockBorderBox, mockProgressBar, mockWebView) |
| 464 | 513 | ||||
| 465 | pv := component.NewPaneView(mockFactory, entity.PaneID("pane-1"), mockWebView) | 514 | pv := component.NewPaneView(mockFactory, entity.PaneID("pane-1"), mockWebView) | ||
| 466 | 515 | ||||
| @@ -478,9 +527,10 @@ func TestSetOnFocusOut_SetsCallback(t *testing.T) { | |||||
| 478 | mockFactory := mocks.NewMockWidgetFactory(t) | 527 | mockFactory := mocks.NewMockWidgetFactory(t) | ||
| 479 | mockOverlay := mocks.NewMockOverlayWidget(t) | 528 | mockOverlay := mocks.NewMockOverlayWidget(t) | ||
| 480 | mockBorderBox := mocks.NewMockBoxWidget(t) | 529 | mockBorderBox := mocks.NewMockBoxWidget(t) | ||
| 530 | + | mockProgressBar := mocks.NewMockProgressBarWidget(t) | |||
| 481 | mockWebView := mocks.NewMockWidget(t) | 531 | mockWebView := mocks.NewMockWidget(t) | ||
| 482 | 532 | ||||
| 483 | - | setupPaneViewMocks(mockFactory, mockOverlay, mockBorderBox, mockWebView) | 533 | + | setupPaneViewMocks(mockFactory, mockOverlay, mockBorderBox, mockProgressBar, mockWebView) |
| 484 | 534 | ||||
| 485 | pv := component.NewPaneView(mockFactory, entity.PaneID("pane-1"), mockWebView) | 535 | pv := component.NewPaneView(mockFactory, entity.PaneID("pane-1"), mockWebView) | ||
| 486 | 536 | ||||
| @@ -498,6 +548,7 @@ func setupPaneViewMocks( | |||||
| 498 | mockFactory *mocks.MockWidgetFactory, | 548 | mockFactory *mocks.MockWidgetFactory, | ||
| 499 | mockOverlay *mocks.MockOverlayWidget, | 549 | mockOverlay *mocks.MockOverlayWidget, | ||
| 500 | mockBorderBox *mocks.MockBoxWidget, | 550 | mockBorderBox *mocks.MockBoxWidget, | ||
| 551 | + | mockProgressBar *mocks.MockProgressBarWidget, | |||
| 501 | mockWebView *mocks.MockWidget, | 552 | mockWebView *mocks.MockWidget, | ||
| 502 | ) { | 553 | ) { | ||
| 503 | mockFactory.EXPECT().NewOverlay().Return(mockOverlay).Once() | 554 | mockFactory.EXPECT().NewOverlay().Return(mockOverlay).Once() | ||
| @@ -516,12 +567,26 @@ func setupPaneViewMocks( | |||||
| 516 | mockOverlay.EXPECT().AddOverlay(mockBorderBox).Once() | 567 | mockOverlay.EXPECT().AddOverlay(mockBorderBox).Once() | ||
| 517 | mockOverlay.EXPECT().SetClipOverlay(mockBorderBox, false).Once() | 568 | mockOverlay.EXPECT().SetClipOverlay(mockBorderBox, false).Once() | ||
| 518 | mockOverlay.EXPECT().SetMeasureOverlay(mockBorderBox, false).Once() | 569 | mockOverlay.EXPECT().SetMeasureOverlay(mockBorderBox, false).Once() | ||
| 570 | + | ||||
| 571 | + | // Progress bar setup | |||
| 572 | + | mockFactory.EXPECT().NewProgressBar().Return(mockProgressBar).Once() | |||
| 573 | + | mockProgressBar.EXPECT().AddCssClass("osd").Once() | |||
| 574 | + | mockProgressBar.EXPECT().SetValign(gtk.AlignEndValue).Once() | |||
| 575 | + | mockProgressBar.EXPECT().SetHalign(gtk.AlignFillValue).Once() | |||
| 576 | + | mockProgressBar.EXPECT().SetHexpand(true).Once() | |||
| 577 | + | mockProgressBar.EXPECT().SetCanTarget(false).Once() | |||
| 578 | + | mockProgressBar.EXPECT().SetCanFocus(false).Once() | |||
| 579 | + | mockProgressBar.EXPECT().SetVisible(false).Once() | |||
| 580 | + | mockOverlay.EXPECT().AddOverlay(mockProgressBar).Once() | |||
| 581 | + | mockOverlay.EXPECT().SetClipOverlay(mockProgressBar, false).Once() | |||
| 582 | + | mockOverlay.EXPECT().SetMeasureOverlay(mockProgressBar, false).Once() | |||
| 519 | } | 583 | } | ||
| 520 | 584 | ||||
| 521 | func setupPaneViewMocksNoWebView( | 585 | func setupPaneViewMocksNoWebView( | ||
| 522 | mockFactory *mocks.MockWidgetFactory, | 586 | mockFactory *mocks.MockWidgetFactory, | ||
| 523 | mockOverlay *mocks.MockOverlayWidget, | 587 | mockOverlay *mocks.MockOverlayWidget, | ||
| 524 | mockBorderBox *mocks.MockBoxWidget, | 588 | mockBorderBox *mocks.MockBoxWidget, | ||
| 589 | + | mockProgressBar *mocks.MockProgressBarWidget, | |||
| 525 | ) { | 590 | ) { | ||
| 526 | mockFactory.EXPECT().NewOverlay().Return(mockOverlay).Once() | 591 | mockFactory.EXPECT().NewOverlay().Return(mockOverlay).Once() | ||
| 527 | mockOverlay.EXPECT().SetHexpand(true).Once() | 592 | mockOverlay.EXPECT().SetHexpand(true).Once() | ||
| @@ -537,4 +602,17 @@ func setupPaneViewMocksNoWebView( | |||||
| 537 | mockOverlay.EXPECT().AddOverlay(mockBorderBox).Once() | 602 | mockOverlay.EXPECT().AddOverlay(mockBorderBox).Once() | ||
| 538 | mockOverlay.EXPECT().SetClipOverlay(mockBorderBox, false).Once() | 603 | mockOverlay.EXPECT().SetClipOverlay(mockBorderBox, false).Once() | ||
| 539 | mockOverlay.EXPECT().SetMeasureOverlay(mockBorderBox, false).Once() | 604 | mockOverlay.EXPECT().SetMeasureOverlay(mockBorderBox, false).Once() | ||
| 605 | + | ||||
| 606 | + | // Progress bar setup | |||
| 607 | + | mockFactory.EXPECT().NewProgressBar().Return(mockProgressBar).Once() | |||
| 608 | + | mockProgressBar.EXPECT().AddCssClass("osd").Once() | |||
| 609 | + | mockProgressBar.EXPECT().SetValign(gtk.AlignEndValue).Once() | |||
| 610 | + | mockProgressBar.EXPECT().SetHalign(gtk.AlignFillValue).Once() | |||
| 611 | + | mockProgressBar.EXPECT().SetHexpand(true).Once() | |||
| 612 | + | mockProgressBar.EXPECT().SetCanTarget(false).Once() | |||
| 613 | + | mockProgressBar.EXPECT().SetCanFocus(false).Once() | |||
| 614 | + | mockProgressBar.EXPECT().SetVisible(false).Once() | |||
| 615 | + | mockOverlay.EXPECT().AddOverlay(mockProgressBar).Once() | |||
| 616 | + | mockOverlay.EXPECT().SetClipOverlay(mockProgressBar, false).Once() | |||
| 617 | + | mockOverlay.EXPECT().SetMeasureOverlay(mockProgressBar, false).Once() | |||
| 540 | } | 618 | } | ||
M internal/ui/component/progress_bar.go +4 -16
| @@ -21,9 +21,7 @@ const ( | |||
| 21 | 21 | // Uses native GtkProgressBar with "osd" styling for overlay appearance. | |
| 22 | 22 | // Implements smooth animation by incrementing towards the target value. | |
| 23 | 23 | type ProgressBar struct { | |
| 24 | - | factory layout.WidgetFactory | |
| 25 | - | progressBar *gtk.ProgressBar | |
| 26 | - | widget layout.Widget // Wrapped widget for layout compatibility | |
| 24 | + | progressBar layout.ProgressBarWidget | |
| 27 | 25 | ||
| 28 | 26 | visible bool | |
| 29 | 27 | currentValue float64 // Current displayed value | |
| @@ -33,9 +31,9 @@ type ProgressBar struct { | |||
| 33 | 31 | mu sync.Mutex | |
| 34 | 32 | } | |
| 35 | 33 | ||
| 36 | - | // NewProgressBar creates a new progress bar component using native GtkProgressBar. | |
| 34 | + | // NewProgressBar creates a new progress bar component using the widget factory. | |
| 37 | 35 | func NewProgressBar(factory layout.WidgetFactory) *ProgressBar { | |
| 38 | - | progressBar := gtk.NewProgressBar() | |
| 36 | + | progressBar := factory.NewProgressBar() | |
| 39 | 37 | ||
| 40 | 38 | // Add "osd" class for on-screen-display overlay styling (like Epiphany) | |
| 41 | 39 | progressBar.AddCssClass("osd") | |
| @@ -52,13 +50,8 @@ func NewProgressBar(factory layout.WidgetFactory) *ProgressBar { | |||
| 52 | 50 | // Hidden by default | |
| 53 | 51 | progressBar.SetVisible(false) | |
| 54 | 52 | ||
| 55 | - | // Wrap for layout compatibility | |
| 56 | - | widget := factory.WrapWidget(&progressBar.Widget) | |
| 57 | - | ||
| 58 | 53 | return &ProgressBar{ | |
| 59 | - | factory: factory, | |
| 60 | 54 | progressBar: progressBar, | |
| 61 | - | widget: widget, | |
| 62 | 55 | visible: false, | |
| 63 | 56 | currentValue: 0, | |
| 64 | 57 | targetValue: 0, | |
| @@ -163,12 +156,7 @@ func (pb *ProgressBar) IsVisible() bool { | |||
| 163 | 156 | return pb.visible | |
| 164 | 157 | } | |
| 165 | 158 | ||
| 166 | - | // Widget returns the underlying GtkProgressBar widget for embedding in overlays. | |
| 159 | + | // Widget returns the underlying widget for embedding in overlays. | |
| 167 | 160 | func (pb *ProgressBar) Widget() layout.Widget { | |
| 168 | - | return pb.widget | |
| 169 | - | } | |
| 170 | - | ||
| 171 | - | // GtkWidget returns the raw GtkProgressBar for direct GTK operations. | |
| 172 | - | func (pb *ProgressBar) GtkWidget() *gtk.ProgressBar { | |
| 173 | 161 | return pb.progressBar | |
| 174 | 162 | } | |
| @@ -21,9 +21,7 @@ const ( | |||||
| 21 | // Uses native GtkProgressBar with "osd" styling for overlay appearance. | 21 | // Uses native GtkProgressBar with "osd" styling for overlay appearance. | ||
| 22 | // Implements smooth animation by incrementing towards the target value. | 22 | // Implements smooth animation by incrementing towards the target value. | ||
| 23 | type ProgressBar struct { | 23 | type ProgressBar struct { | ||
| 24 | - | factory layout.WidgetFactory | 24 | + | progressBar layout.ProgressBarWidget |
| 25 | - | progressBar *gtk.ProgressBar | |||
| 26 | - | widget layout.Widget // Wrapped widget for layout compatibility | |||
| 27 | 25 | ||||
| 28 | visible bool | 26 | visible bool | ||
| 29 | currentValue float64 // Current displayed value | 27 | currentValue float64 // Current displayed value | ||
| @@ -33,9 +31,9 @@ type ProgressBar struct { | |||||
| 33 | mu sync.Mutex | 31 | mu sync.Mutex | ||
| 34 | } | 32 | } | ||
| 35 | 33 | ||||
| 36 | - | // NewProgressBar creates a new progress bar component using native GtkProgressBar. | 34 | + | // NewProgressBar creates a new progress bar component using the widget factory. |
| 37 | func NewProgressBar(factory layout.WidgetFactory) *ProgressBar { | 35 | func NewProgressBar(factory layout.WidgetFactory) *ProgressBar { | ||
| 38 | - | progressBar := gtk.NewProgressBar() | 36 | + | progressBar := factory.NewProgressBar() |
| 39 | 37 | ||||
| 40 | // Add "osd" class for on-screen-display overlay styling (like Epiphany) | 38 | // Add "osd" class for on-screen-display overlay styling (like Epiphany) | ||
| 41 | progressBar.AddCssClass("osd") | 39 | progressBar.AddCssClass("osd") | ||
| @@ -52,13 +50,8 @@ func NewProgressBar(factory layout.WidgetFactory) *ProgressBar { | |||||
| 52 | // Hidden by default | 50 | // Hidden by default | ||
| 53 | progressBar.SetVisible(false) | 51 | progressBar.SetVisible(false) | ||
| 54 | 52 | ||||
| 55 | - | // Wrap for layout compatibility | |||
| 56 | - | widget := factory.WrapWidget(&progressBar.Widget) | |||
| 57 | - | ||||
| 58 | return &ProgressBar{ | 53 | return &ProgressBar{ | ||
| 59 | - | factory: factory, | |||
| 60 | progressBar: progressBar, | 54 | progressBar: progressBar, | ||
| 61 | - | widget: widget, | |||
| 62 | visible: false, | 55 | visible: false, | ||
| 63 | currentValue: 0, | 56 | currentValue: 0, | ||
| 64 | targetValue: 0, | 57 | targetValue: 0, | ||
| @@ -163,12 +156,7 @@ func (pb *ProgressBar) IsVisible() bool { | |||||
| 163 | return pb.visible | 156 | return pb.visible | ||
| 164 | } | 157 | } | ||
| 165 | 158 | ||||
| 166 | - | // Widget returns the underlying GtkProgressBar widget for embedding in overlays. | 159 | + | // Widget returns the underlying widget for embedding in overlays. |
| 167 | func (pb *ProgressBar) Widget() layout.Widget { | 160 | func (pb *ProgressBar) Widget() layout.Widget { | ||
| 168 | - | return pb.widget | |||
| 169 | - | } | |||
| 170 | - | ||||
| 171 | - | // GtkWidget returns the raw GtkProgressBar for direct GTK operations. | |||
| 172 | - | func (pb *ProgressBar) GtkWidget() *gtk.ProgressBar { | |||
| 173 | return pb.progressBar | 161 | return pb.progressBar | ||
| 174 | } | 162 | } | ||
M internal/ui/component/workspace_view_test.go +17 -0
| @@ -36,6 +36,7 @@ func setupWorkspaceViewBase(t *testing.T, mockFactory *mocks.MockWidgetFactory) | |||
| 36 | 36 | func setupWorkspacePaneViewMocks(t *testing.T, mockFactory *mocks.MockWidgetFactory) (*mocks.MockOverlayWidget, *mocks.MockBoxWidget) { | |
| 37 | 37 | mockOverlay := mocks.NewMockOverlayWidget(t) | |
| 38 | 38 | mockBorderBox := mocks.NewMockBoxWidget(t) | |
| 39 | + | mockProgressBar := mocks.NewMockProgressBarWidget(t) | |
| 39 | 40 | ||
| 40 | 41 | mockFactory.EXPECT().NewOverlay().Return(mockOverlay).Once() | |
| 41 | 42 | mockOverlay.EXPECT().SetHexpand(true).Once() | |
| @@ -52,6 +53,22 @@ func setupWorkspacePaneViewMocks(t *testing.T, mockFactory *mocks.MockWidgetFact | |||
| 52 | 53 | mockOverlay.EXPECT().SetClipOverlay(mockBorderBox, false).Once() | |
| 53 | 54 | mockOverlay.EXPECT().SetMeasureOverlay(mockBorderBox, false).Once() | |
| 54 | 55 | ||
| 56 | + | // Progress bar setup | |
| 57 | + | mockFactory.EXPECT().NewProgressBar().Return(mockProgressBar).Once() | |
| 58 | + | mockProgressBar.EXPECT().AddCssClass("osd").Once() | |
| 59 | + | mockProgressBar.EXPECT().SetValign(mock.Anything).Once() | |
| 60 | + | mockProgressBar.EXPECT().SetHalign(mock.Anything).Once() | |
| 61 | + | mockProgressBar.EXPECT().SetHexpand(true).Once() | |
| 62 | + | mockProgressBar.EXPECT().SetCanTarget(false).Once() | |
| 63 | + | mockProgressBar.EXPECT().SetCanFocus(false).Once() | |
| 64 | + | mockProgressBar.EXPECT().SetVisible(false).Once() | |
| 65 | + | mockOverlay.EXPECT().AddOverlay(mockProgressBar).Once() | |
| 66 | + | mockOverlay.EXPECT().SetClipOverlay(mockProgressBar, false).Once() | |
| 67 | + | mockOverlay.EXPECT().SetMeasureOverlay(mockProgressBar, false).Once() | |
| 68 | + | ||
| 69 | + | // GtkWidget is called when attaching hover handler - return nil for tests | |
| 70 | + | mockOverlay.EXPECT().GtkWidget().Return(nil).Once() | |
| 71 | + | ||
| 55 | 72 | return mockOverlay, mockBorderBox | |
| 56 | 73 | } | |
| 57 | 74 | ||
| @@ -36,6 +36,7 @@ func setupWorkspaceViewBase(t *testing.T, mockFactory *mocks.MockWidgetFactory) | |||||
| 36 | func setupWorkspacePaneViewMocks(t *testing.T, mockFactory *mocks.MockWidgetFactory) (*mocks.MockOverlayWidget, *mocks.MockBoxWidget) { | 36 | func setupWorkspacePaneViewMocks(t *testing.T, mockFactory *mocks.MockWidgetFactory) (*mocks.MockOverlayWidget, *mocks.MockBoxWidget) { | ||
| 37 | mockOverlay := mocks.NewMockOverlayWidget(t) | 37 | mockOverlay := mocks.NewMockOverlayWidget(t) | ||
| 38 | mockBorderBox := mocks.NewMockBoxWidget(t) | 38 | mockBorderBox := mocks.NewMockBoxWidget(t) | ||
| 39 | + | mockProgressBar := mocks.NewMockProgressBarWidget(t) | |||
| 39 | 40 | ||||
| 40 | mockFactory.EXPECT().NewOverlay().Return(mockOverlay).Once() | 41 | mockFactory.EXPECT().NewOverlay().Return(mockOverlay).Once() | ||
| 41 | mockOverlay.EXPECT().SetHexpand(true).Once() | 42 | mockOverlay.EXPECT().SetHexpand(true).Once() | ||
| @@ -52,6 +53,22 @@ func setupWorkspacePaneViewMocks(t *testing.T, mockFactory *mocks.MockWidgetFact | |||||
| 52 | mockOverlay.EXPECT().SetClipOverlay(mockBorderBox, false).Once() | 53 | mockOverlay.EXPECT().SetClipOverlay(mockBorderBox, false).Once() | ||
| 53 | mockOverlay.EXPECT().SetMeasureOverlay(mockBorderBox, false).Once() | 54 | mockOverlay.EXPECT().SetMeasureOverlay(mockBorderBox, false).Once() | ||
| 54 | 55 | ||||
| 56 | + | // Progress bar setup | |||
| 57 | + | mockFactory.EXPECT().NewProgressBar().Return(mockProgressBar).Once() | |||
| 58 | + | mockProgressBar.EXPECT().AddCssClass("osd").Once() | |||
| 59 | + | mockProgressBar.EXPECT().SetValign(mock.Anything).Once() | |||
| 60 | + | mockProgressBar.EXPECT().SetHalign(mock.Anything).Once() | |||
| 61 | + | mockProgressBar.EXPECT().SetHexpand(true).Once() | |||
| 62 | + | mockProgressBar.EXPECT().SetCanTarget(false).Once() | |||
| 63 | + | mockProgressBar.EXPECT().SetCanFocus(false).Once() | |||
| 64 | + | mockProgressBar.EXPECT().SetVisible(false).Once() | |||
| 65 | + | mockOverlay.EXPECT().AddOverlay(mockProgressBar).Once() | |||
| 66 | + | mockOverlay.EXPECT().SetClipOverlay(mockProgressBar, false).Once() | |||
| 67 | + | mockOverlay.EXPECT().SetMeasureOverlay(mockProgressBar, false).Once() | |||
| 68 | + | ||||
| 69 | + | // GtkWidget is called when attaching hover handler - return nil for tests | |||
| 70 | + | mockOverlay.EXPECT().GtkWidget().Return(nil).Once() | |||
| 71 | + | ||||
| 55 | return mockOverlay, mockBorderBox | 72 | return mockOverlay, mockBorderBox | ||
| 56 | } | 73 | } | ||
| 57 | 74 | ||||
M internal/ui/layout/gtk_widgets.go +72 -8
| @@ -9,14 +9,15 @@ import ( | |||
| 9 | 9 | ||
| 10 | 10 | // Ensure implementations satisfy interfaces at compile time. | |
| 11 | 11 | var ( | |
| 12 | - | _ Widget = (*gtkWidget)(nil) | |
| 13 | - | _ PanedWidget = (*gtkPaned)(nil) | |
| 14 | - | _ BoxWidget = (*gtkBox)(nil) | |
| 15 | - | _ OverlayWidget = (*gtkOverlay)(nil) | |
| 16 | - | _ LabelWidget = (*gtkLabel)(nil) | |
| 17 | - | _ ButtonWidget = (*gtkButton)(nil) | |
| 18 | - | _ ImageWidget = (*gtkImage)(nil) | |
| 19 | - | _ WidgetFactory = (*GtkWidgetFactory)(nil) | |
| 12 | + | _ Widget = (*gtkWidget)(nil) | |
| 13 | + | _ PanedWidget = (*gtkPaned)(nil) | |
| 14 | + | _ BoxWidget = (*gtkBox)(nil) | |
| 15 | + | _ OverlayWidget = (*gtkOverlay)(nil) | |
| 16 | + | _ LabelWidget = (*gtkLabel)(nil) | |
| 17 | + | _ ButtonWidget = (*gtkButton)(nil) | |
| 18 | + | _ ImageWidget = (*gtkImage)(nil) | |
| 19 | + | _ ProgressBarWidget = (*gtkProgressBar)(nil) | |
| 20 | + | _ WidgetFactory = (*GtkWidgetFactory)(nil) | |
| 20 | 21 | ) | |
| 21 | 22 | ||
| 22 | 23 | // gtkWidget wraps a gtk.Widget to implement the Widget interface. | |
| @@ -620,6 +621,64 @@ func (img *gtkImage) ComputePoint(target Widget) (x, y float64, ok bool) { | |||
| 620 | 621 | return float64(outPoint.X), float64(outPoint.Y), true | |
| 621 | 622 | } | |
| 622 | 623 | ||
| 624 | + | // gtkProgressBar wraps gtk.ProgressBar to implement ProgressBarWidget. | |
| 625 | + | type gtkProgressBar struct { | |
| 626 | + | inner *gtk.ProgressBar | |
| 627 | + | } | |
| 628 | + | ||
| 629 | + | func (p *gtkProgressBar) Show() { p.inner.Show() } | |
| 630 | + | func (p *gtkProgressBar) Hide() { p.inner.Hide() } | |
| 631 | + | func (p *gtkProgressBar) SetVisible(visible bool) { p.inner.SetVisible(visible) } | |
| 632 | + | func (p *gtkProgressBar) IsVisible() bool { return p.inner.GetVisible() } | |
| 633 | + | func (p *gtkProgressBar) GrabFocus() bool { return p.inner.GrabFocus() } | |
| 634 | + | func (p *gtkProgressBar) HasFocus() bool { return p.inner.HasFocus() } | |
| 635 | + | func (p *gtkProgressBar) SetCanFocus(canFocus bool) { p.inner.SetCanFocus(canFocus) } | |
| 636 | + | func (p *gtkProgressBar) SetFocusOnClick(focus bool) { p.inner.SetFocusOnClick(focus) } | |
| 637 | + | func (p *gtkProgressBar) SetCanTarget(canTarget bool) { p.inner.SetCanTarget(canTarget) } | |
| 638 | + | func (p *gtkProgressBar) SetHexpand(expand bool) { p.inner.SetHexpand(expand) } | |
| 639 | + | func (p *gtkProgressBar) SetVexpand(expand bool) { p.inner.SetVexpand(expand) } | |
| 640 | + | func (p *gtkProgressBar) GetHexpand() bool { return p.inner.GetHexpand() } | |
| 641 | + | func (p *gtkProgressBar) GetVexpand() bool { return p.inner.GetVexpand() } | |
| 642 | + | func (p *gtkProgressBar) SetHalign(align gtk.Align) { p.inner.SetHalign(align) } | |
| 643 | + | func (p *gtkProgressBar) SetValign(align gtk.Align) { p.inner.SetValign(align) } | |
| 644 | + | func (p *gtkProgressBar) SetSizeRequest(w, h int) { p.inner.SetSizeRequest(w, h) } | |
| 645 | + | func (p *gtkProgressBar) AddCssClass(class string) { p.inner.AddCssClass(class) } | |
| 646 | + | func (p *gtkProgressBar) RemoveCssClass(class string) { p.inner.RemoveCssClass(class) } | |
| 647 | + | func (p *gtkProgressBar) HasCssClass(class string) bool { return p.inner.HasCssClass(class) } | |
| 648 | + | func (p *gtkProgressBar) Unparent() { p.inner.Unparent() } | |
| 649 | + | func (p *gtkProgressBar) GtkWidget() *gtk.Widget { return &p.inner.Widget } | |
| 650 | + | ||
| 651 | + | func (p *gtkProgressBar) GetParent() Widget { | |
| 652 | + | parent := p.inner.GetParent() | |
| 653 | + | if parent == nil { | |
| 654 | + | return nil | |
| 655 | + | } | |
| 656 | + | return >kWidget{inner: parent} | |
| 657 | + | } | |
| 658 | + | ||
| 659 | + | func (p *gtkProgressBar) GetAllocatedWidth() int { return p.inner.GetAllocatedWidth() } | |
| 660 | + | func (p *gtkProgressBar) GetAllocatedHeight() int { return p.inner.GetAllocatedHeight() } | |
| 661 | + | func (p *gtkProgressBar) AddController(c *gtk.EventController) { p.inner.AddController(c) } | |
| 662 | + | ||
| 663 | + | func (p *gtkProgressBar) ComputePoint(target Widget) (x, y float64, ok bool) { | |
| 664 | + | srcPoint := &graphene.Point{X: 0, Y: 0} | |
| 665 | + | outPoint := &graphene.Point{} | |
| 666 | + | ||
| 667 | + | var targetGtk *gtk.Widget | |
| 668 | + | if target != nil { | |
| 669 | + | targetGtk = target.GtkWidget() | |
| 670 | + | } | |
| 671 | + | ||
| 672 | + | ok = p.inner.ComputePoint(targetGtk, srcPoint, outPoint) | |
| 673 | + | if !ok { | |
| 674 | + | return 0, 0, false | |
| 675 | + | } | |
| 676 | + | return float64(outPoint.X), float64(outPoint.Y), true | |
| 677 | + | } | |
| 678 | + | ||
| 679 | + | func (p *gtkProgressBar) SetFraction(fraction float64) { p.inner.SetFraction(fraction) } | |
| 680 | + | func (p *gtkProgressBar) GetFraction() float64 { return p.inner.GetFraction() } | |
| 681 | + | ||
| 623 | 682 | // GtkWidgetFactory creates real GTK widgets. | |
| 624 | 683 | type GtkWidgetFactory struct{} | |
| 625 | 684 | ||
| @@ -664,6 +723,11 @@ func (f *GtkWidgetFactory) NewImage() ImageWidget { | |||
| 664 | 723 | return >kImage{inner: image} | |
| 665 | 724 | } | |
| 666 | 725 | ||
| 726 | + | func (f *GtkWidgetFactory) NewProgressBar() ProgressBarWidget { | |
| 727 | + | progressBar := gtk.NewProgressBar() | |
| 728 | + | return >kProgressBar{inner: progressBar} | |
| 729 | + | } | |
| 730 | + | ||
| 667 | 731 | func (f *GtkWidgetFactory) WrapWidget(w *gtk.Widget) Widget { | |
| 668 | 732 | if w == nil { | |
| 669 | 733 | return nil | |
| @@ -9,14 +9,15 @@ import ( | |||||
| 9 | 9 | ||||
| 10 | // Ensure implementations satisfy interfaces at compile time. | 10 | // Ensure implementations satisfy interfaces at compile time. | ||
| 11 | var ( | 11 | var ( | ||
| 12 | - | _ Widget = (*gtkWidget)(nil) | 12 | + | _ Widget = (*gtkWidget)(nil) |
| 13 | - | _ PanedWidget = (*gtkPaned)(nil) | 13 | + | _ PanedWidget = (*gtkPaned)(nil) |
| 14 | - | _ BoxWidget = (*gtkBox)(nil) | 14 | + | _ BoxWidget = (*gtkBox)(nil) |
| 15 | - | _ OverlayWidget = (*gtkOverlay)(nil) | 15 | + | _ OverlayWidget = (*gtkOverlay)(nil) |
| 16 | - | _ LabelWidget = (*gtkLabel)(nil) | 16 | + | _ LabelWidget = (*gtkLabel)(nil) |
| 17 | - | _ ButtonWidget = (*gtkButton)(nil) | 17 | + | _ ButtonWidget = (*gtkButton)(nil) |
| 18 | - | _ ImageWidget = (*gtkImage)(nil) | 18 | + | _ ImageWidget = (*gtkImage)(nil) |
| 19 | - | _ WidgetFactory = (*GtkWidgetFactory)(nil) | 19 | + | _ ProgressBarWidget = (*gtkProgressBar)(nil) |
| 20 | + | _ WidgetFactory = (*GtkWidgetFactory)(nil) | |||
| 20 | ) | 21 | ) | ||
| 21 | 22 | ||||
| 22 | // gtkWidget wraps a gtk.Widget to implement the Widget interface. | 23 | // gtkWidget wraps a gtk.Widget to implement the Widget interface. | ||
| @@ -620,6 +621,64 @@ func (img *gtkImage) ComputePoint(target Widget) (x, y float64, ok bool) { | |||||
| 620 | return float64(outPoint.X), float64(outPoint.Y), true | 621 | return float64(outPoint.X), float64(outPoint.Y), true | ||
| 621 | } | 622 | } | ||
| 622 | 623 | ||||
| 624 | + | // gtkProgressBar wraps gtk.ProgressBar to implement ProgressBarWidget. | |||
| 625 | + | type gtkProgressBar struct { | |||
| 626 | + | inner *gtk.ProgressBar | |||
| 627 | + | } | |||
| 628 | + | ||||
| 629 | + | func (p *gtkProgressBar) Show() { p.inner.Show() } | |||
| 630 | + | func (p *gtkProgressBar) Hide() { p.inner.Hide() } | |||
| 631 | + | func (p *gtkProgressBar) SetVisible(visible bool) { p.inner.SetVisible(visible) } | |||
| 632 | + | func (p *gtkProgressBar) IsVisible() bool { return p.inner.GetVisible() } | |||
| 633 | + | func (p *gtkProgressBar) GrabFocus() bool { return p.inner.GrabFocus() } | |||
| 634 | + | func (p *gtkProgressBar) HasFocus() bool { return p.inner.HasFocus() } | |||
| 635 | + | func (p *gtkProgressBar) SetCanFocus(canFocus bool) { p.inner.SetCanFocus(canFocus) } | |||
| 636 | + | func (p *gtkProgressBar) SetFocusOnClick(focus bool) { p.inner.SetFocusOnClick(focus) } | |||
| 637 | + | func (p *gtkProgressBar) SetCanTarget(canTarget bool) { p.inner.SetCanTarget(canTarget) } | |||
| 638 | + | func (p *gtkProgressBar) SetHexpand(expand bool) { p.inner.SetHexpand(expand) } | |||
| 639 | + | func (p *gtkProgressBar) SetVexpand(expand bool) { p.inner.SetVexpand(expand) } | |||
| 640 | + | func (p *gtkProgressBar) GetHexpand() bool { return p.inner.GetHexpand() } | |||
| 641 | + | func (p *gtkProgressBar) GetVexpand() bool { return p.inner.GetVexpand() } | |||
| 642 | + | func (p *gtkProgressBar) SetHalign(align gtk.Align) { p.inner.SetHalign(align) } | |||
| 643 | + | func (p *gtkProgressBar) SetValign(align gtk.Align) { p.inner.SetValign(align) } | |||
| 644 | + | func (p *gtkProgressBar) SetSizeRequest(w, h int) { p.inner.SetSizeRequest(w, h) } | |||
| 645 | + | func (p *gtkProgressBar) AddCssClass(class string) { p.inner.AddCssClass(class) } | |||
| 646 | + | func (p *gtkProgressBar) RemoveCssClass(class string) { p.inner.RemoveCssClass(class) } | |||
| 647 | + | func (p *gtkProgressBar) HasCssClass(class string) bool { return p.inner.HasCssClass(class) } | |||
| 648 | + | func (p *gtkProgressBar) Unparent() { p.inner.Unparent() } | |||
| 649 | + | func (p *gtkProgressBar) GtkWidget() *gtk.Widget { return &p.inner.Widget } | |||
| 650 | + | ||||
| 651 | + | func (p *gtkProgressBar) GetParent() Widget { | |||
| 652 | + | parent := p.inner.GetParent() | |||
| 653 | + | if parent == nil { | |||
| 654 | + | return nil | |||
| 655 | + | } | |||
| 656 | + | return >kWidget{inner: parent} | |||
| 657 | + | } | |||
| 658 | + | ||||
| 659 | + | func (p *gtkProgressBar) GetAllocatedWidth() int { return p.inner.GetAllocatedWidth() } | |||
| 660 | + | func (p *gtkProgressBar) GetAllocatedHeight() int { return p.inner.GetAllocatedHeight() } | |||
| 661 | + | func (p *gtkProgressBar) AddController(c *gtk.EventController) { p.inner.AddController(c) } | |||
| 662 | + | ||||
| 663 | + | func (p *gtkProgressBar) ComputePoint(target Widget) (x, y float64, ok bool) { | |||
| 664 | + | srcPoint := &graphene.Point{X: 0, Y: 0} | |||
| 665 | + | outPoint := &graphene.Point{} | |||
| 666 | + | ||||
| 667 | + | var targetGtk *gtk.Widget | |||
| 668 | + | if target != nil { | |||
| 669 | + | targetGtk = target.GtkWidget() | |||
| 670 | + | } | |||
| 671 | + | ||||
| 672 | + | ok = p.inner.ComputePoint(targetGtk, srcPoint, outPoint) | |||
| 673 | + | if !ok { | |||
| 674 | + | return 0, 0, false | |||
| 675 | + | } | |||
| 676 | + | return float64(outPoint.X), float64(outPoint.Y), true | |||
| 677 | + | } | |||
| 678 | + | ||||
| 679 | + | func (p *gtkProgressBar) SetFraction(fraction float64) { p.inner.SetFraction(fraction) } | |||
| 680 | + | func (p *gtkProgressBar) GetFraction() float64 { return p.inner.GetFraction() } | |||
| 681 | + | ||||
| 623 | // GtkWidgetFactory creates real GTK widgets. | 682 | // GtkWidgetFactory creates real GTK widgets. | ||
| 624 | type GtkWidgetFactory struct{} | 683 | type GtkWidgetFactory struct{} | ||
| 625 | 684 | ||||
| @@ -664,6 +723,11 @@ func (f *GtkWidgetFactory) NewImage() ImageWidget { | |||||
| 664 | return >kImage{inner: image} | 723 | return >kImage{inner: image} | ||
| 665 | } | 724 | } | ||
| 666 | 725 | ||||
| 726 | + | func (f *GtkWidgetFactory) NewProgressBar() ProgressBarWidget { | |||
| 727 | + | progressBar := gtk.NewProgressBar() | |||
| 728 | + | return >kProgressBar{inner: progressBar} | |||
| 729 | + | } | |||
| 730 | + | ||||
| 667 | func (f *GtkWidgetFactory) WrapWidget(w *gtk.Widget) Widget { | 731 | func (f *GtkWidgetFactory) WrapWidget(w *gtk.Widget) Widget { | ||
| 668 | if w == nil { | 732 | if w == nil { | ||
| 669 | return nil | 733 | return nil | ||
A internal/ui/layout/mocks/mock_progress_bar_widget.go +1126 -0
| @@ -0,0 +1,1126 @@ | |||
| 1 | + | // Code generated by mockery v2.53.5. DO NOT EDIT. | |
| 2 | + | ||
| 3 | + | package mocks | |
| 4 | + | ||
| 5 | + | import ( | |
| 6 | + | layout "github.com/bnema/dumber/internal/ui/layout" | |
| 7 | + | gtk "github.com/jwijenbergh/puregotk/v4/gtk" | |
| 8 | + | ||
| 9 | + | mock "github.com/stretchr/testify/mock" | |
| 10 | + | ) | |
| 11 | + | ||
| 12 | + | // MockProgressBarWidget is an autogenerated mock type for the ProgressBarWidget type | |
| 13 | + | type MockProgressBarWidget struct { | |
| 14 | + | mock.Mock | |
| 15 | + | } | |
| 16 | + | ||
| 17 | + | type MockProgressBarWidget_Expecter struct { | |
| 18 | + | mock *mock.Mock | |
| 19 | + | } | |
| 20 | + | ||
| 21 | + | func (_m *MockProgressBarWidget) EXPECT() *MockProgressBarWidget_Expecter { | |
| 22 | + | return &MockProgressBarWidget_Expecter{mock: &_m.Mock} | |
| 23 | + | } | |
| 24 | + | ||
| 25 | + | // AddController provides a mock function with given fields: controller | |
| 26 | + | func (_m *MockProgressBarWidget) AddController(controller *gtk.EventController) { | |
| 27 | + | _m.Called(controller) | |
| 28 | + | } | |
| 29 | + | ||
| 30 | + | // MockProgressBarWidget_AddController_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'AddController' | |
| 31 | + | type MockProgressBarWidget_AddController_Call struct { | |
| 32 | + | *mock.Call | |
| 33 | + | } | |
| 34 | + | ||
| 35 | + | // AddController is a helper method to define mock.On call | |
| 36 | + | // - controller *gtk.EventController | |
| 37 | + | func (_e *MockProgressBarWidget_Expecter) AddController(controller interface{}) *MockProgressBarWidget_AddController_Call { | |
| 38 | + | return &MockProgressBarWidget_AddController_Call{Call: _e.mock.On("AddController", controller)} | |
| 39 | + | } | |
| 40 | + | ||
| 41 | + | func (_c *MockProgressBarWidget_AddController_Call) Run(run func(controller *gtk.EventController)) *MockProgressBarWidget_AddController_Call { | |
| 42 | + | _c.Call.Run(func(args mock.Arguments) { | |
| 43 | + | run(args[0].(*gtk.EventController)) | |
| 44 | + | }) | |
| 45 | + | return _c | |
| 46 | + | } | |
| 47 | + | ||
| 48 | + | func (_c *MockProgressBarWidget_AddController_Call) Return() *MockProgressBarWidget_AddController_Call { | |
| 49 | + | _c.Call.Return() | |
| 50 | + | return _c | |
| 51 | + | } | |
| 52 | + | ||
| 53 | + | func (_c *MockProgressBarWidget_AddController_Call) RunAndReturn(run func(*gtk.EventController)) *MockProgressBarWidget_AddController_Call { | |
| 54 | + | _c.Run(run) | |
| 55 | + | return _c | |
| 56 | + | } | |
| 57 | + | ||
| 58 | + | // AddCssClass provides a mock function with given fields: cssClass | |
| 59 | + | func (_m *MockProgressBarWidget) AddCssClass(cssClass string) { | |
| 60 | + | _m.Called(cssClass) | |
| 61 | + | } | |
| 62 | + | ||
| 63 | + | // MockProgressBarWidget_AddCssClass_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'AddCssClass' | |
| 64 | + | type MockProgressBarWidget_AddCssClass_Call struct { | |
| 65 | + | *mock.Call | |
| 66 | + | } | |
| 67 | + | ||
| 68 | + | // AddCssClass is a helper method to define mock.On call | |
| 69 | + | // - cssClass string | |
| 70 | + | func (_e *MockProgressBarWidget_Expecter) AddCssClass(cssClass interface{}) *MockProgressBarWidget_AddCssClass_Call { | |
| 71 | + | return &MockProgressBarWidget_AddCssClass_Call{Call: _e.mock.On("AddCssClass", cssClass)} | |
| 72 | + | } | |
| 73 | + | ||
| 74 | + | func (_c *MockProgressBarWidget_AddCssClass_Call) Run(run func(cssClass string)) *MockProgressBarWidget_AddCssClass_Call { | |
| 75 | + | _c.Call.Run(func(args mock.Arguments) { | |
| 76 | + | run(args[0].(string)) | |
| 77 | + | }) | |
| 78 | + | return _c | |
| 79 | + | } | |
| 80 | + | ||
| 81 | + | func (_c *MockProgressBarWidget_AddCssClass_Call) Return() *MockProgressBarWidget_AddCssClass_Call { | |
| 82 | + | _c.Call.Return() | |
| 83 | + | return _c | |
| 84 | + | } | |
| 85 | + | ||
| 86 | + | func (_c *MockProgressBarWidget_AddCssClass_Call) RunAndReturn(run func(string)) *MockProgressBarWidget_AddCssClass_Call { | |
| 87 | + | _c.Run(run) | |
| 88 | + | return _c | |
| 89 | + | } | |
| 90 | + | ||
| 91 | + | // ComputePoint provides a mock function with given fields: target | |
| 92 | + | func (_m *MockProgressBarWidget) ComputePoint(target layout.Widget) (float64, float64, bool) { | |
| 93 | + | ret := _m.Called(target) | |
| 94 | + | ||
| 95 | + | if len(ret) == 0 { | |
| 96 | + | panic("no return value specified for ComputePoint") | |
| 97 | + | } | |
| 98 | + | ||
| 99 | + | var r0 float64 | |
| 100 | + | var r1 float64 | |
| 101 | + | var r2 bool | |
| 102 | + | if rf, ok := ret.Get(0).(func(layout.Widget) (float64, float64, bool)); ok { | |
| 103 | + | return rf(target) | |
| 104 | + | } | |
| 105 | + | if rf, ok := ret.Get(0).(func(layout.Widget) float64); ok { | |
| 106 | + | r0 = rf(target) | |
| 107 | + | } else { | |
| 108 | + | r0 = ret.Get(0).(float64) | |
| 109 | + | } | |
| 110 | + | ||
| 111 | + | if rf, ok := ret.Get(1).(func(layout.Widget) float64); ok { | |
| 112 | + | r1 = rf(target) | |
| 113 | + | } else { | |
| 114 | + | r1 = ret.Get(1).(float64) | |
| 115 | + | } | |
| 116 | + | ||
| 117 | + | if rf, ok := ret.Get(2).(func(layout.Widget) bool); ok { | |
| 118 | + | r2 = rf(target) | |
| 119 | + | } else { | |
| 120 | + | r2 = ret.Get(2).(bool) | |
| 121 | + | } | |
| 122 | + | ||
| 123 | + | return r0, r1, r2 | |
| 124 | + | } | |
| 125 | + | ||
| 126 | + | // MockProgressBarWidget_ComputePoint_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'ComputePoint' | |
| 127 | + | type MockProgressBarWidget_ComputePoint_Call struct { | |
| 128 | + | *mock.Call | |
| 129 | + | } | |
| 130 | + | ||
| 131 | + | // ComputePoint is a helper method to define mock.On call | |
| 132 | + | // - target layout.Widget | |
| 133 | + | func (_e *MockProgressBarWidget_Expecter) ComputePoint(target interface{}) *MockProgressBarWidget_ComputePoint_Call { | |
| 134 | + | return &MockProgressBarWidget_ComputePoint_Call{Call: _e.mock.On("ComputePoint", target)} | |
| 135 | + | } | |
| 136 | + | ||
| 137 | + | func (_c *MockProgressBarWidget_ComputePoint_Call) Run(run func(target layout.Widget)) *MockProgressBarWidget_ComputePoint_Call { | |
| 138 | + | _c.Call.Run(func(args mock.Arguments) { | |
| 139 | + | run(args[0].(layout.Widget)) | |
| 140 | + | }) | |
| 141 | + | return _c | |
| 142 | + | } | |
| 143 | + | ||
| 144 | + | func (_c *MockProgressBarWidget_ComputePoint_Call) Return(x float64, y float64, ok bool) *MockProgressBarWidget_ComputePoint_Call { | |
| 145 | + | _c.Call.Return(x, y, ok) | |
| 146 | + | return _c | |
| 147 | + | } | |
| 148 | + | ||
| 149 | + | func (_c *MockProgressBarWidget_ComputePoint_Call) RunAndReturn(run func(layout.Widget) (float64, float64, bool)) *MockProgressBarWidget_ComputePoint_Call { | |
| 150 | + | _c.Call.Return(run) | |
| 151 | + | return _c | |
| 152 | + | } | |
| 153 | + | ||
| 154 | + | // GetAllocatedHeight provides a mock function with no fields | |
| 155 | + | func (_m *MockProgressBarWidget) GetAllocatedHeight() int { | |
| 156 | + | ret := _m.Called() | |
| 157 | + | ||
| 158 | + | if len(ret) == 0 { | |
| 159 | + | panic("no return value specified for GetAllocatedHeight") | |
| 160 | + | } | |
| 161 | + | ||
| 162 | + | var r0 int | |
| 163 | + | if rf, ok := ret.Get(0).(func() int); ok { | |
| 164 | + | r0 = rf() | |
| 165 | + | } else { | |
| 166 | + | r0 = ret.Get(0).(int) | |
| 167 | + | } | |
| 168 | + | ||
| 169 | + | return r0 | |
| 170 | + | } | |
| 171 | + | ||
| 172 | + | // MockProgressBarWidget_GetAllocatedHeight_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'GetAllocatedHeight' | |
| 173 | + | type MockProgressBarWidget_GetAllocatedHeight_Call struct { | |
| 174 | + | *mock.Call | |
| 175 | + | } | |
| 176 | + | ||
| 177 | + | // GetAllocatedHeight is a helper method to define mock.On call | |
| 178 | + | func (_e *MockProgressBarWidget_Expecter) GetAllocatedHeight() *MockProgressBarWidget_GetAllocatedHeight_Call { | |
| 179 | + | return &MockProgressBarWidget_GetAllocatedHeight_Call{Call: _e.mock.On("GetAllocatedHeight")} | |
| 180 | + | } | |
| 181 | + | ||
| 182 | + | func (_c *MockProgressBarWidget_GetAllocatedHeight_Call) Run(run func()) *MockProgressBarWidget_GetAllocatedHeight_Call { | |
| 183 | + | _c.Call.Run(func(args mock.Arguments) { | |
| 184 | + | run() | |
| 185 | + | }) | |
| 186 | + | return _c | |
| 187 | + | } | |
| 188 | + | ||
| 189 | + | func (_c *MockProgressBarWidget_GetAllocatedHeight_Call) Return(_a0 int) *MockProgressBarWidget_GetAllocatedHeight_Call { | |
| 190 | + | _c.Call.Return(_a0) | |
| 191 | + | return _c | |
| 192 | + | } | |
| 193 | + | ||
| 194 | + | func (_c *MockProgressBarWidget_GetAllocatedHeight_Call) RunAndReturn(run func() int) *MockProgressBarWidget_GetAllocatedHeight_Call { | |
| 195 | + | _c.Call.Return(run) | |
| 196 | + | return _c | |
| 197 | + | } | |
| 198 | + | ||
| 199 | + | // GetAllocatedWidth provides a mock function with no fields | |
| 200 | + | func (_m *MockProgressBarWidget) GetAllocatedWidth() int { | |
| 201 | + | ret := _m.Called() | |
| 202 | + | ||
| 203 | + | if len(ret) == 0 { | |
| 204 | + | panic("no return value specified for GetAllocatedWidth") | |
| 205 | + | } | |
| 206 | + | ||
| 207 | + | var r0 int | |
| 208 | + | if rf, ok := ret.Get(0).(func() int); ok { | |
| 209 | + | r0 = rf() | |
| 210 | + | } else { | |
| 211 | + | r0 = ret.Get(0).(int) | |
| 212 | + | } | |
| 213 | + | ||
| 214 | + | return r0 | |
| 215 | + | } | |
| 216 | + | ||
| 217 | + | // MockProgressBarWidget_GetAllocatedWidth_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'GetAllocatedWidth' | |
| 218 | + | type MockProgressBarWidget_GetAllocatedWidth_Call struct { | |
| 219 | + | *mock.Call | |
| 220 | + | } | |
| 221 | + | ||
| 222 | + | // GetAllocatedWidth is a helper method to define mock.On call | |
| 223 | + | func (_e *MockProgressBarWidget_Expecter) GetAllocatedWidth() *MockProgressBarWidget_GetAllocatedWidth_Call { | |
| 224 | + | return &MockProgressBarWidget_GetAllocatedWidth_Call{Call: _e.mock.On("GetAllocatedWidth")} | |
| 225 | + | } | |
| 226 | + | ||
| 227 | + | func (_c *MockProgressBarWidget_GetAllocatedWidth_Call) Run(run func()) *MockProgressBarWidget_GetAllocatedWidth_Call { | |
| 228 | + | _c.Call.Run(func(args mock.Arguments) { | |
| 229 | + | run() | |
| 230 | + | }) | |
| 231 | + | return _c | |
| 232 | + | } | |
| 233 | + | ||
| 234 | + | func (_c *MockProgressBarWidget_GetAllocatedWidth_Call) Return(_a0 int) *MockProgressBarWidget_GetAllocatedWidth_Call { | |
| 235 | + | _c.Call.Return(_a0) | |
| 236 | + | return _c | |
| 237 | + | } | |
| 238 | + | ||
| 239 | + | func (_c *MockProgressBarWidget_GetAllocatedWidth_Call) RunAndReturn(run func() int) *MockProgressBarWidget_GetAllocatedWidth_Call { | |
| 240 | + | _c.Call.Return(run) | |
| 241 | + | return _c | |
| 242 | + | } | |
| 243 | + | ||
| 244 | + | // GetFraction provides a mock function with no fields | |
| 245 | + | func (_m *MockProgressBarWidget) GetFraction() float64 { | |
| 246 | + | ret := _m.Called() | |
| 247 | + | ||
| 248 | + | if len(ret) == 0 { | |
| 249 | + | panic("no return value specified for GetFraction") | |
| 250 | + | } | |
| 251 | + | ||
| 252 | + | var r0 float64 | |
| 253 | + | if rf, ok := ret.Get(0).(func() float64); ok { | |
| 254 | + | r0 = rf() | |
| 255 | + | } else { | |
| 256 | + | r0 = ret.Get(0).(float64) | |
| 257 | + | } | |
| 258 | + | ||
| 259 | + | return r0 | |
| 260 | + | } | |
| 261 | + | ||
| 262 | + | // MockProgressBarWidget_GetFraction_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'GetFraction' | |
| 263 | + | type MockProgressBarWidget_GetFraction_Call struct { | |
| 264 | + | *mock.Call | |
| 265 | + | } | |
| 266 | + | ||
| 267 | + | // GetFraction is a helper method to define mock.On call | |
| 268 | + | func (_e *MockProgressBarWidget_Expecter) GetFraction() *MockProgressBarWidget_GetFraction_Call { | |
| 269 | + | return &MockProgressBarWidget_GetFraction_Call{Call: _e.mock.On("GetFraction")} | |
| 270 | + | } | |
| 271 | + | ||
| 272 | + | func (_c *MockProgressBarWidget_GetFraction_Call) Run(run func()) *MockProgressBarWidget_GetFraction_Call { | |
| 273 | + | _c.Call.Run(func(args mock.Arguments) { | |
| 274 | + | run() | |
| 275 | + | }) | |
| 276 | + | return _c | |
| 277 | + | } | |
| 278 | + | ||
| 279 | + | func (_c *MockProgressBarWidget_GetFraction_Call) Return(_a0 float64) *MockProgressBarWidget_GetFraction_Call { | |
| 280 | + | _c.Call.Return(_a0) | |
| 281 | + | return _c | |
| 282 | + | } | |
| 283 | + | ||
| 284 | + | func (_c *MockProgressBarWidget_GetFraction_Call) RunAndReturn(run func() float64) *MockProgressBarWidget_GetFraction_Call { | |
| 285 | + | _c.Call.Return(run) | |
| 286 | + | return _c | |
| 287 | + | } | |
| 288 | + | ||
| 289 | + | // GetHexpand provides a mock function with no fields | |
| 290 | + | func (_m *MockProgressBarWidget) GetHexpand() bool { | |
| 291 | + | ret := _m.Called() | |
| 292 | + | ||
| 293 | + | if len(ret) == 0 { | |
| 294 | + | panic("no return value specified for GetHexpand") | |
| 295 | + | } | |
| 296 | + | ||
| 297 | + | var r0 bool | |
| 298 | + | if rf, ok := ret.Get(0).(func() bool); ok { | |
| 299 | + | r0 = rf() | |
| 300 | + | } else { | |
| 301 | + | r0 = ret.Get(0).(bool) | |
| 302 | + | } | |
| 303 | + | ||
| 304 | + | return r0 | |
| 305 | + | } | |
| 306 | + | ||
| 307 | + | // MockProgressBarWidget_GetHexpand_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'GetHexpand' | |
| 308 | + | type MockProgressBarWidget_GetHexpand_Call struct { | |
| 309 | + | *mock.Call | |
| 310 | + | } | |
| 311 | + | ||
| 312 | + | // GetHexpand is a helper method to define mock.On call | |
| 313 | + | func (_e *MockProgressBarWidget_Expecter) GetHexpand() *MockProgressBarWidget_GetHexpand_Call { | |
| 314 | + | return &MockProgressBarWidget_GetHexpand_Call{Call: _e.mock.On("GetHexpand")} | |
| 315 | + | } | |
| 316 | + | ||
| 317 | + | func (_c *MockProgressBarWidget_GetHexpand_Call) Run(run func()) *MockProgressBarWidget_GetHexpand_Call { | |
| 318 | + | _c.Call.Run(func(args mock.Arguments) { | |
| 319 | + | run() | |
| 320 | + | }) | |
| 321 | + | return _c | |
| 322 | + | } | |
| 323 | + | ||
| 324 | + | func (_c *MockProgressBarWidget_GetHexpand_Call) Return(_a0 bool) *MockProgressBarWidget_GetHexpand_Call { | |
| 325 | + | _c.Call.Return(_a0) | |
| 326 | + | return _c | |
| 327 | + | } | |
| 328 | + | ||
| 329 | + | func (_c *MockProgressBarWidget_GetHexpand_Call) RunAndReturn(run func() bool) *MockProgressBarWidget_GetHexpand_Call { | |
| 330 | + | _c.Call.Return(run) | |
| 331 | + | return _c | |
| 332 | + | } | |
| 333 | + | ||
| 334 | + | // GetParent provides a mock function with no fields | |
| 335 | + | func (_m *MockProgressBarWidget) GetParent() layout.Widget { | |
| 336 | + | ret := _m.Called() | |
| 337 | + | ||
| 338 | + | if len(ret) == 0 { | |
| 339 | + | panic("no return value specified for GetParent") | |
| 340 | + | } | |
| 341 | + | ||
| 342 | + | var r0 layout.Widget | |
| 343 | + | if rf, ok := ret.Get(0).(func() layout.Widget); ok { | |
| 344 | + | r0 = rf() | |
| 345 | + | } else { | |
| 346 | + | if ret.Get(0) != nil { | |
| 347 | + | r0 = ret.Get(0).(layout.Widget) | |
| 348 | + | } | |
| 349 | + | } | |
| 350 | + | ||
| 351 | + | return r0 | |
| 352 | + | } | |
| 353 | + | ||
| 354 | + | // MockProgressBarWidget_GetParent_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'GetParent' | |
| 355 | + | type MockProgressBarWidget_GetParent_Call struct { | |
| 356 | + | *mock.Call | |
| 357 | + | } | |
| 358 | + | ||
| 359 | + | // GetParent is a helper method to define mock.On call | |
| 360 | + | func (_e *MockProgressBarWidget_Expecter) GetParent() *MockProgressBarWidget_GetParent_Call { | |
| 361 | + | return &MockProgressBarWidget_GetParent_Call{Call: _e.mock.On("GetParent")} | |
| 362 | + | } | |
| 363 | + | ||
| 364 | + | func (_c *MockProgressBarWidget_GetParent_Call) Run(run func()) *MockProgressBarWidget_GetParent_Call { | |
| 365 | + | _c.Call.Run(func(args mock.Arguments) { | |
| 366 | + | run() | |
| 367 | + | }) | |
| 368 | + | return _c | |
| 369 | + | } | |
| 370 | + | ||
| 371 | + | func (_c *MockProgressBarWidget_GetParent_Call) Return(_a0 layout.Widget) *MockProgressBarWidget_GetParent_Call { | |
| 372 | + | _c.Call.Return(_a0) | |
| 373 | + | return _c | |
| 374 | + | } | |
| 375 | + | ||
| 376 | + | func (_c *MockProgressBarWidget_GetParent_Call) RunAndReturn(run func() layout.Widget) *MockProgressBarWidget_GetParent_Call { | |
| 377 | + | _c.Call.Return(run) | |
| 378 | + | return _c | |
| 379 | + | } | |
| 380 | + | ||
| 381 | + | // GetVexpand provides a mock function with no fields | |
| 382 | + | func (_m *MockProgressBarWidget) GetVexpand() bool { | |
| 383 | + | ret := _m.Called() | |
| 384 | + | ||
| 385 | + | if len(ret) == 0 { | |
| 386 | + | panic("no return value specified for GetVexpand") | |
| 387 | + | } | |
| 388 | + | ||
| 389 | + | var r0 bool | |
| 390 | + | if rf, ok := ret.Get(0).(func() bool); ok { | |
| 391 | + | r0 = rf() | |
| 392 | + | } else { | |
| 393 | + | r0 = ret.Get(0).(bool) | |
| 394 | + | } | |
| 395 | + | ||
| 396 | + | return r0 | |
| 397 | + | } | |
| 398 | + | ||
| 399 | + | // MockProgressBarWidget_GetVexpand_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'GetVexpand' | |
| 400 | + | type MockProgressBarWidget_GetVexpand_Call struct { | |
| 401 | + | *mock.Call | |
| 402 | + | } | |
| 403 | + | ||
| 404 | + | // GetVexpand is a helper method to define mock.On call | |
| 405 | + | func (_e *MockProgressBarWidget_Expecter) GetVexpand() *MockProgressBarWidget_GetVexpand_Call { | |
| 406 | + | return &MockProgressBarWidget_GetVexpand_Call{Call: _e.mock.On("GetVexpand")} | |
| 407 | + | } | |
| 408 | + | ||
| 409 | + | func (_c *MockProgressBarWidget_GetVexpand_Call) Run(run func()) *MockProgressBarWidget_GetVexpand_Call { | |
| 410 | + | _c.Call.Run(func(args mock.Arguments) { | |
| 411 | + | run() | |
| 412 | + | }) | |
| 413 | + | return _c | |
| 414 | + | } | |
| 415 | + | ||
| 416 | + | func (_c *MockProgressBarWidget_GetVexpand_Call) Return(_a0 bool) *MockProgressBarWidget_GetVexpand_Call { | |
| 417 | + | _c.Call.Return(_a0) | |
| 418 | + | return _c | |
| 419 | + | } | |
| 420 | + | ||
| 421 | + | func (_c *MockProgressBarWidget_GetVexpand_Call) RunAndReturn(run func() bool) *MockProgressBarWidget_GetVexpand_Call { | |
| 422 | + | _c.Call.Return(run) | |
| 423 | + | return _c | |
| 424 | + | } | |
| 425 | + | ||
| 426 | + | // GrabFocus provides a mock function with no fields | |
| 427 | + | func (_m *MockProgressBarWidget) GrabFocus() bool { | |
| 428 | + | ret := _m.Called() | |
| 429 | + | ||
| 430 | + | if len(ret) == 0 { | |
| 431 | + | panic("no return value specified for GrabFocus") | |
| 432 | + | } | |
| 433 | + | ||
| 434 | + | var r0 bool | |
| 435 | + | if rf, ok := ret.Get(0).(func() bool); ok { | |
| 436 | + | r0 = rf() | |
| 437 | + | } else { | |
| 438 | + | r0 = ret.Get(0).(bool) | |
| 439 | + | } | |
| 440 | + | ||
| 441 | + | return r0 | |
| 442 | + | } | |
| 443 | + | ||
| 444 | + | // MockProgressBarWidget_GrabFocus_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'GrabFocus' | |
| 445 | + | type MockProgressBarWidget_GrabFocus_Call struct { | |
| 446 | + | *mock.Call | |
| 447 | + | } | |
| 448 | + | ||
| 449 | + | // GrabFocus is a helper method to define mock.On call | |
| 450 | + | func (_e *MockProgressBarWidget_Expecter) GrabFocus() *MockProgressBarWidget_GrabFocus_Call { | |
| 451 | + | return &MockProgressBarWidget_GrabFocus_Call{Call: _e.mock.On("GrabFocus")} | |
| 452 | + | } | |
| 453 | + | ||
| 454 | + | func (_c *MockProgressBarWidget_GrabFocus_Call) Run(run func()) *MockProgressBarWidget_GrabFocus_Call { | |
| 455 | + | _c.Call.Run(func(args mock.Arguments) { | |
| 456 | + | run() | |
| 457 | + | }) | |
| 458 | + | return _c | |
| 459 | + | } | |
| 460 | + | ||
| 461 | + | func (_c *MockProgressBarWidget_GrabFocus_Call) Return(_a0 bool) *MockProgressBarWidget_GrabFocus_Call { | |
| 462 | + | _c.Call.Return(_a0) | |
| 463 | + | return _c | |
| 464 | + | } | |
| 465 | + | ||
| 466 | + | func (_c *MockProgressBarWidget_GrabFocus_Call) RunAndReturn(run func() bool) *MockProgressBarWidget_GrabFocus_Call { | |
| 467 | + | _c.Call.Return(run) | |
| 468 | + | return _c | |
| 469 | + | } | |
| 470 | + | ||
| 471 | + | // GtkWidget provides a mock function with no fields | |
| 472 | + | func (_m *MockProgressBarWidget) GtkWidget() *gtk.Widget { | |
| 473 | + | ret := _m.Called() | |
| 474 | + | ||
| 475 | + | if len(ret) == 0 { | |
| 476 | + | panic("no return value specified for GtkWidget") | |
| 477 | + | } | |
| 478 | + | ||
| 479 | + | var r0 *gtk.Widget | |
| 480 | + | if rf, ok := ret.Get(0).(func() *gtk.Widget); ok { | |
| 481 | + | r0 = rf() | |
| 482 | + | } else { | |
| 483 | + | if ret.Get(0) != nil { | |
| 484 | + | r0 = ret.Get(0).(*gtk.Widget) | |
| 485 | + | } | |
| 486 | + | } | |
| 487 | + | ||
| 488 | + | return r0 | |
| 489 | + | } | |
| 490 | + | ||
| 491 | + | // MockProgressBarWidget_GtkWidget_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'GtkWidget' | |
| 492 | + | type MockProgressBarWidget_GtkWidget_Call struct { | |
| 493 | + | *mock.Call | |
| 494 | + | } | |
| 495 | + | ||
| 496 | + | // GtkWidget is a helper method to define mock.On call | |
| 497 | + | func (_e *MockProgressBarWidget_Expecter) GtkWidget() *MockProgressBarWidget_GtkWidget_Call { | |
| 498 | + | return &MockProgressBarWidget_GtkWidget_Call{Call: _e.mock.On("GtkWidget")} | |
| 499 | + | } | |
| 500 | + | ||
| 501 | + | func (_c *MockProgressBarWidget_GtkWidget_Call) Run(run func()) *MockProgressBarWidget_GtkWidget_Call { | |
| 502 | + | _c.Call.Run(func(args mock.Arguments) { | |
| 503 | + | run() | |
| 504 | + | }) | |
| 505 | + | return _c | |
| 506 | + | } | |
| 507 | + | ||
| 508 | + | func (_c *MockProgressBarWidget_GtkWidget_Call) Return(_a0 *gtk.Widget) *MockProgressBarWidget_GtkWidget_Call { | |
| 509 | + | _c.Call.Return(_a0) | |
| 510 | + | return _c | |
| 511 | + | } | |
| 512 | + | ||
| 513 | + | func (_c *MockProgressBarWidget_GtkWidget_Call) RunAndReturn(run func() *gtk.Widget) *MockProgressBarWidget_GtkWidget_Call { | |
| 514 | + | _c.Call.Return(run) | |
| 515 | + | return _c | |
| 516 | + | } | |
| 517 | + | ||
| 518 | + | // HasCssClass provides a mock function with given fields: cssClass | |
| 519 | + | func (_m *MockProgressBarWidget) HasCssClass(cssClass string) bool { | |
| 520 | + | ret := _m.Called(cssClass) | |
| 521 | + | ||
| 522 | + | if len(ret) == 0 { | |
| 523 | + | panic("no return value specified for HasCssClass") | |
| 524 | + | } | |
| 525 | + | ||
| 526 | + | var r0 bool | |
| 527 | + | if rf, ok := ret.Get(0).(func(string) bool); ok { | |
| 528 | + | r0 = rf(cssClass) | |
| 529 | + | } else { | |
| 530 | + | r0 = ret.Get(0).(bool) | |
| 531 | + | } | |
| 532 | + | ||
| 533 | + | return r0 | |
| 534 | + | } | |
| 535 | + | ||
| 536 | + | // MockProgressBarWidget_HasCssClass_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'HasCssClass' | |
| 537 | + | type MockProgressBarWidget_HasCssClass_Call struct { | |
| 538 | + | *mock.Call | |
| 539 | + | } | |
| 540 | + | ||
| 541 | + | // HasCssClass is a helper method to define mock.On call | |
| 542 | + | // - cssClass string | |
| 543 | + | func (_e *MockProgressBarWidget_Expecter) HasCssClass(cssClass interface{}) *MockProgressBarWidget_HasCssClass_Call { | |
| 544 | + | return &MockProgressBarWidget_HasCssClass_Call{Call: _e.mock.On("HasCssClass", cssClass)} | |
| 545 | + | } | |
| 546 | + | ||
| 547 | + | func (_c *MockProgressBarWidget_HasCssClass_Call) Run(run func(cssClass string)) *MockProgressBarWidget_HasCssClass_Call { | |
| 548 | + | _c.Call.Run(func(args mock.Arguments) { | |
| 549 | + | run(args[0].(string)) | |
| 550 | + | }) | |
| 551 | + | return _c | |
| 552 | + | } | |
| 553 | + | ||
| 554 | + | func (_c *MockProgressBarWidget_HasCssClass_Call) Return(_a0 bool) *MockProgressBarWidget_HasCssClass_Call { | |
| 555 | + | _c.Call.Return(_a0) | |
| 556 | + | return _c | |
| 557 | + | } | |
| 558 | + | ||
| 559 | + | func (_c *MockProgressBarWidget_HasCssClass_Call) RunAndReturn(run func(string) bool) *MockProgressBarWidget_HasCssClass_Call { | |
| 560 | + | _c.Call.Return(run) | |
| 561 | + | return _c | |
| 562 | + | } | |
| 563 | + | ||
| 564 | + | // HasFocus provides a mock function with no fields | |
| 565 | + | func (_m *MockProgressBarWidget) HasFocus() bool { | |
| 566 | + | ret := _m.Called() | |
| 567 | + | ||
| 568 | + | if len(ret) == 0 { | |
| 569 | + | panic("no return value specified for HasFocus") | |
| 570 | + | } | |
| 571 | + | ||
| 572 | + | var r0 bool | |
| 573 | + | if rf, ok := ret.Get(0).(func() bool); ok { | |
| 574 | + | r0 = rf() | |
| 575 | + | } else { | |
| 576 | + | r0 = ret.Get(0).(bool) | |
| 577 | + | } | |
| 578 | + | ||
| 579 | + | return r0 | |
| 580 | + | } | |
| 581 | + | ||
| 582 | + | // MockProgressBarWidget_HasFocus_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'HasFocus' | |
| 583 | + | type MockProgressBarWidget_HasFocus_Call struct { | |
| 584 | + | *mock.Call | |
| 585 | + | } | |
| 586 | + | ||
| 587 | + | // HasFocus is a helper method to define mock.On call | |
| 588 | + | func (_e *MockProgressBarWidget_Expecter) HasFocus() *MockProgressBarWidget_HasFocus_Call { | |
| 589 | + | return &MockProgressBarWidget_HasFocus_Call{Call: _e.mock.On("HasFocus")} | |
| 590 | + | } | |
| 591 | + | ||
| 592 | + | func (_c *MockProgressBarWidget_HasFocus_Call) Run(run func()) *MockProgressBarWidget_HasFocus_Call { | |
| 593 | + | _c.Call.Run(func(args mock.Arguments) { | |
| 594 | + | run() | |
| 595 | + | }) | |
| 596 | + | return _c | |
| 597 | + | } | |
| 598 | + | ||
| 599 | + | func (_c *MockProgressBarWidget_HasFocus_Call) Return(_a0 bool) *MockProgressBarWidget_HasFocus_Call { | |
| 600 | + | _c.Call.Return(_a0) | |
| 601 | + | return _c | |
| 602 | + | } | |
| 603 | + | ||
| 604 | + | func (_c *MockProgressBarWidget_HasFocus_Call) RunAndReturn(run func() bool) *MockProgressBarWidget_HasFocus_Call { | |
| 605 | + | _c.Call.Return(run) | |
| 606 | + | return _c | |
| 607 | + | } | |
| 608 | + | ||
| 609 | + | // Hide provides a mock function with no fields | |
| 610 | + | func (_m *MockProgressBarWidget) Hide() { | |
| 611 | + | _m.Called() | |
| 612 | + | } | |
| 613 | + | ||
| 614 | + | // MockProgressBarWidget_Hide_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'Hide' | |
| 615 | + | type MockProgressBarWidget_Hide_Call struct { | |
| 616 | + | *mock.Call | |
| 617 | + | } | |
| 618 | + | ||
| 619 | + | // Hide is a helper method to define mock.On call | |
| 620 | + | func (_e *MockProgressBarWidget_Expecter) Hide() *MockProgressBarWidget_Hide_Call { | |
| 621 | + | return &MockProgressBarWidget_Hide_Call{Call: _e.mock.On("Hide")} | |
| 622 | + | } | |
| 623 | + | ||
| 624 | + | func (_c *MockProgressBarWidget_Hide_Call) Run(run func()) *MockProgressBarWidget_Hide_Call { | |
| 625 | + | _c.Call.Run(func(args mock.Arguments) { | |
| 626 | + | run() | |
| 627 | + | }) | |
| 628 | + | return _c | |
| 629 | + | } | |
| 630 | + | ||
| 631 | + | func (_c *MockProgressBarWidget_Hide_Call) Return() *MockProgressBarWidget_Hide_Call { | |
| 632 | + | _c.Call.Return() | |
| 633 | + | return _c | |
| 634 | + | } | |
| 635 | + | ||
| 636 | + | func (_c *MockProgressBarWidget_Hide_Call) RunAndReturn(run func()) *MockProgressBarWidget_Hide_Call { | |
| 637 | + | _c.Run(run) | |
| 638 | + | return _c | |
| 639 | + | } | |
| 640 | + | ||
| 641 | + | // IsVisible provides a mock function with no fields | |
| 642 | + | func (_m *MockProgressBarWidget) IsVisible() bool { | |
| 643 | + | ret := _m.Called() | |
| 644 | + | ||
| 645 | + | if len(ret) == 0 { | |
| 646 | + | panic("no return value specified for IsVisible") | |
| 647 | + | } | |
| 648 | + | ||
| 649 | + | var r0 bool | |
| 650 | + | if rf, ok := ret.Get(0).(func() bool); ok { | |
| 651 | + | r0 = rf() | |
| 652 | + | } else { | |
| 653 | + | r0 = ret.Get(0).(bool) | |
| 654 | + | } | |
| 655 | + | ||
| 656 | + | return r0 | |
| 657 | + | } | |
| 658 | + | ||
| 659 | + | // MockProgressBarWidget_IsVisible_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'IsVisible' | |
| 660 | + | type MockProgressBarWidget_IsVisible_Call struct { | |
| 661 | + | *mock.Call | |
| 662 | + | } | |
| 663 | + | ||
| 664 | + | // IsVisible is a helper method to define mock.On call | |
| 665 | + | func (_e *MockProgressBarWidget_Expecter) IsVisible() *MockProgressBarWidget_IsVisible_Call { | |
| 666 | + | return &MockProgressBarWidget_IsVisible_Call{Call: _e.mock.On("IsVisible")} | |
| 667 | + | } | |
| 668 | + | ||
| 669 | + | func (_c *MockProgressBarWidget_IsVisible_Call) Run(run func()) *MockProgressBarWidget_IsVisible_Call { | |
| 670 | + | _c.Call.Run(func(args mock.Arguments) { | |
| 671 | + | run() | |
| 672 | + | }) | |
| 673 | + | return _c | |
| 674 | + | } | |
| 675 | + | ||
| 676 | + | func (_c *MockProgressBarWidget_IsVisible_Call) Return(_a0 bool) *MockProgressBarWidget_IsVisible_Call { | |
| 677 | + | _c.Call.Return(_a0) | |
| 678 | + | return _c | |
| 679 | + | } | |
| 680 | + | ||
| 681 | + | func (_c *MockProgressBarWidget_IsVisible_Call) RunAndReturn(run func() bool) *MockProgressBarWidget_IsVisible_Call { | |
| 682 | + | _c.Call.Return(run) | |
| 683 | + | return _c | |
| 684 | + | } | |
| 685 | + | ||
| 686 | + | // RemoveCssClass provides a mock function with given fields: cssClass | |
| 687 | + | func (_m *MockProgressBarWidget) RemoveCssClass(cssClass string) { | |
| 688 | + | _m.Called(cssClass) | |
| 689 | + | } | |
| 690 | + | ||
| 691 | + | // MockProgressBarWidget_RemoveCssClass_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'RemoveCssClass' | |
| 692 | + | type MockProgressBarWidget_RemoveCssClass_Call struct { | |
| 693 | + | *mock.Call | |
| 694 | + | } | |
| 695 | + | ||
| 696 | + | // RemoveCssClass is a helper method to define mock.On call | |
| 697 | + | // - cssClass string | |
| 698 | + | func (_e *MockProgressBarWidget_Expecter) RemoveCssClass(cssClass interface{}) *MockProgressBarWidget_RemoveCssClass_Call { | |
| 699 | + | return &MockProgressBarWidget_RemoveCssClass_Call{Call: _e.mock.On("RemoveCssClass", cssClass)} | |
| 700 | + | } | |
| 701 | + | ||
| 702 | + | func (_c *MockProgressBarWidget_RemoveCssClass_Call) Run(run func(cssClass string)) *MockProgressBarWidget_RemoveCssClass_Call { | |
| 703 | + | _c.Call.Run(func(args mock.Arguments) { | |
| 704 | + | run(args[0].(string)) | |
| 705 | + | }) | |
| 706 | + | return _c | |
| 707 | + | } | |
| 708 | + | ||
| 709 | + | func (_c *MockProgressBarWidget_RemoveCssClass_Call) Return() *MockProgressBarWidget_RemoveCssClass_Call { | |
| 710 | + | _c.Call.Return() | |
| 711 | + | return _c | |
| 712 | + | } | |
| 713 | + | ||
| 714 | + | func (_c *MockProgressBarWidget_RemoveCssClass_Call) RunAndReturn(run func(string)) *MockProgressBarWidget_RemoveCssClass_Call { | |
| 715 | + | _c.Run(run) | |
| 716 | + | return _c | |
| 717 | + | } | |
| 718 | + | ||
| 719 | + | // SetCanFocus provides a mock function with given fields: canFocus | |
| 720 | + | func (_m *MockProgressBarWidget) SetCanFocus(canFocus bool) { | |
| 721 | + | _m.Called(canFocus) | |
| 722 | + | } | |
| 723 | + | ||
| 724 | + | // MockProgressBarWidget_SetCanFocus_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'SetCanFocus' | |
| 725 | + | type MockProgressBarWidget_SetCanFocus_Call struct { | |
| 726 | + | *mock.Call | |
| 727 | + | } | |
| 728 | + | ||
| 729 | + | // SetCanFocus is a helper method to define mock.On call | |
| 730 | + | // - canFocus bool | |
| 731 | + | func (_e *MockProgressBarWidget_Expecter) SetCanFocus(canFocus interface{}) *MockProgressBarWidget_SetCanFocus_Call { | |
| 732 | + | return &MockProgressBarWidget_SetCanFocus_Call{Call: _e.mock.On("SetCanFocus", canFocus)} | |
| 733 | + | } | |
| 734 | + | ||
| 735 | + | func (_c *MockProgressBarWidget_SetCanFocus_Call) Run(run func(canFocus bool)) *MockProgressBarWidget_SetCanFocus_Call { | |
| 736 | + | _c.Call.Run(func(args mock.Arguments) { | |
| 737 | + | run(args[0].(bool)) | |
| 738 | + | }) | |
| 739 | + | return _c | |
| 740 | + | } | |
| 741 | + | ||
| 742 | + | func (_c *MockProgressBarWidget_SetCanFocus_Call) Return() *MockProgressBarWidget_SetCanFocus_Call { | |
| 743 | + | _c.Call.Return() | |
| 744 | + | return _c | |
| 745 | + | } | |
| 746 | + | ||
| 747 | + | func (_c *MockProgressBarWidget_SetCanFocus_Call) RunAndReturn(run func(bool)) *MockProgressBarWidget_SetCanFocus_Call { | |
| 748 | + | _c.Run(run) | |
| 749 | + | return _c | |
| 750 | + | } | |
| 751 | + | ||
| 752 | + | // SetCanTarget provides a mock function with given fields: canTarget | |
| 753 | + | func (_m *MockProgressBarWidget) SetCanTarget(canTarget bool) { | |
| 754 | + | _m.Called(canTarget) | |
| 755 | + | } | |
| 756 | + | ||
| 757 | + | // MockProgressBarWidget_SetCanTarget_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'SetCanTarget' | |
| 758 | + | type MockProgressBarWidget_SetCanTarget_Call struct { | |
| 759 | + | *mock.Call | |
| 760 | + | } | |
| 761 | + | ||
| 762 | + | // SetCanTarget is a helper method to define mock.On call | |
| 763 | + | // - canTarget bool | |
| 764 | + | func (_e *MockProgressBarWidget_Expecter) SetCanTarget(canTarget interface{}) *MockProgressBarWidget_SetCanTarget_Call { | |
| 765 | + | return &MockProgressBarWidget_SetCanTarget_Call{Call: _e.mock.On("SetCanTarget", canTarget)} | |
| 766 | + | } | |
| 767 | + | ||
| 768 | + | func (_c *MockProgressBarWidget_SetCanTarget_Call) Run(run func(canTarget bool)) *MockProgressBarWidget_SetCanTarget_Call { | |
| 769 | + | _c.Call.Run(func(args mock.Arguments) { | |
| 770 | + | run(args[0].(bool)) | |
| 771 | + | }) | |
| 772 | + | return _c | |
| 773 | + | } | |
| 774 | + | ||
| 775 | + | func (_c *MockProgressBarWidget_SetCanTarget_Call) Return() *MockProgressBarWidget_SetCanTarget_Call { | |
| 776 | + | _c.Call.Return() | |
| 777 | + | return _c | |
| 778 | + | } | |
| 779 | + | ||
| 780 | + | func (_c *MockProgressBarWidget_SetCanTarget_Call) RunAndReturn(run func(bool)) *MockProgressBarWidget_SetCanTarget_Call { | |
| 781 | + | _c.Run(run) | |
| 782 | + | return _c | |
| 783 | + | } | |
| 784 | + | ||
| 785 | + | // SetFocusOnClick provides a mock function with given fields: focusOnClick | |
| 786 | + | func (_m *MockProgressBarWidget) SetFocusOnClick(focusOnClick bool) { | |
| 787 | + | _m.Called(focusOnClick) | |
| 788 | + | } | |
| 789 | + | ||
| 790 | + | // MockProgressBarWidget_SetFocusOnClick_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'SetFocusOnClick' | |
| 791 | + | type MockProgressBarWidget_SetFocusOnClick_Call struct { | |
| 792 | + | *mock.Call | |
| 793 | + | } | |
| 794 | + | ||
| 795 | + | // SetFocusOnClick is a helper method to define mock.On call | |
| 796 | + | // - focusOnClick bool | |
| 797 | + | func (_e *MockProgressBarWidget_Expecter) SetFocusOnClick(focusOnClick interface{}) *MockProgressBarWidget_SetFocusOnClick_Call { | |
| 798 | + | return &MockProgressBarWidget_SetFocusOnClick_Call{Call: _e.mock.On("SetFocusOnClick", focusOnClick)} | |
| 799 | + | } | |
| 800 | + | ||
| 801 | + | func (_c *MockProgressBarWidget_SetFocusOnClick_Call) Run(run func(focusOnClick bool)) *MockProgressBarWidget_SetFocusOnClick_Call { | |
| 802 | + | _c.Call.Run(func(args mock.Arguments) { | |
| 803 | + | run(args[0].(bool)) | |
| 804 | + | }) | |
| 805 | + | return _c | |
| 806 | + | } | |
| 807 | + | ||
| 808 | + | func (_c *MockProgressBarWidget_SetFocusOnClick_Call) Return() *MockProgressBarWidget_SetFocusOnClick_Call { | |
| 809 | + | _c.Call.Return() | |
| 810 | + | return _c | |
| 811 | + | } | |
| 812 | + | ||
| 813 | + | func (_c *MockProgressBarWidget_SetFocusOnClick_Call) RunAndReturn(run func(bool)) *MockProgressBarWidget_SetFocusOnClick_Call { | |
| 814 | + | _c.Run(run) | |
| 815 | + | return _c | |
| 816 | + | } | |
| 817 | + | ||
| 818 | + | // SetFraction provides a mock function with given fields: fraction | |
| 819 | + | func (_m *MockProgressBarWidget) SetFraction(fraction float64) { | |
| 820 | + | _m.Called(fraction) | |
| 821 | + | } | |
| 822 | + | ||
| 823 | + | // MockProgressBarWidget_SetFraction_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'SetFraction' | |
| 824 | + | type MockProgressBarWidget_SetFraction_Call struct { | |
| 825 | + | *mock.Call | |
| 826 | + | } | |
| 827 | + | ||
| 828 | + | // SetFraction is a helper method to define mock.On call | |
| 829 | + | // - fraction float64 | |
| 830 | + | func (_e *MockProgressBarWidget_Expecter) SetFraction(fraction interface{}) *MockProgressBarWidget_SetFraction_Call { | |
| 831 | + | return &MockProgressBarWidget_SetFraction_Call{Call: _e.mock.On("SetFraction", fraction)} | |
| 832 | + | } | |
| 833 | + | ||
| 834 | + | func (_c *MockProgressBarWidget_SetFraction_Call) Run(run func(fraction float64)) *MockProgressBarWidget_SetFraction_Call { | |
| 835 | + | _c.Call.Run(func(args mock.Arguments) { | |
| 836 | + | run(args[0].(float64)) | |
| 837 | + | }) | |
| 838 | + | return _c | |
| 839 | + | } | |
| 840 | + | ||
| 841 | + | func (_c *MockProgressBarWidget_SetFraction_Call) Return() *MockProgressBarWidget_SetFraction_Call { | |
| 842 | + | _c.Call.Return() | |
| 843 | + | return _c | |
| 844 | + | } | |
| 845 | + | ||
| 846 | + | func (_c *MockProgressBarWidget_SetFraction_Call) RunAndReturn(run func(float64)) *MockProgressBarWidget_SetFraction_Call { | |
| 847 | + | _c.Run(run) | |
| 848 | + | return _c | |
| 849 | + | } | |
| 850 | + | ||
| 851 | + | // SetHalign provides a mock function with given fields: align | |
| 852 | + | func (_m *MockProgressBarWidget) SetHalign(align gtk.Align) { | |
| 853 | + | _m.Called(align) | |
| 854 | + | } | |
| 855 | + | ||
| 856 | + | // MockProgressBarWidget_SetHalign_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'SetHalign' | |
| 857 | + | type MockProgressBarWidget_SetHalign_Call struct { | |
| 858 | + | *mock.Call | |
| 859 | + | } | |
| 860 | + | ||
| 861 | + | // SetHalign is a helper method to define mock.On call | |
| 862 | + | // - align gtk.Align | |
| 863 | + | func (_e *MockProgressBarWidget_Expecter) SetHalign(align interface{}) *MockProgressBarWidget_SetHalign_Call { | |
| 864 | + | return &MockProgressBarWidget_SetHalign_Call{Call: _e.mock.On("SetHalign", align)} | |
| 865 | + | } | |
| 866 | + | ||
| 867 | + | func (_c *MockProgressBarWidget_SetHalign_Call) Run(run func(align gtk.Align)) *MockProgressBarWidget_SetHalign_Call { | |
| 868 | + | _c.Call.Run(func(args mock.Arguments) { | |
| 869 | + | run(args[0].(gtk.Align)) | |
| 870 | + | }) | |
| 871 | + | return _c | |
| 872 | + | } | |
| 873 | + | ||
| 874 | + | func (_c *MockProgressBarWidget_SetHalign_Call) Return() *MockProgressBarWidget_SetHalign_Call { | |
| 875 | + | _c.Call.Return() | |
| 876 | + | return _c | |
| 877 | + | } | |
| 878 | + | ||
| 879 | + | func (_c *MockProgressBarWidget_SetHalign_Call) RunAndReturn(run func(gtk.Align)) *MockProgressBarWidget_SetHalign_Call { | |
| 880 | + | _c.Run(run) | |
| 881 | + | return _c | |
| 882 | + | } | |
| 883 | + | ||
| 884 | + | // SetHexpand provides a mock function with given fields: expand | |
| 885 | + | func (_m *MockProgressBarWidget) SetHexpand(expand bool) { | |
| 886 | + | _m.Called(expand) | |
| 887 | + | } | |
| 888 | + | ||
| 889 | + | // MockProgressBarWidget_SetHexpand_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'SetHexpand' | |
| 890 | + | type MockProgressBarWidget_SetHexpand_Call struct { | |
| 891 | + | *mock.Call | |
| 892 | + | } | |
| 893 | + | ||
| 894 | + | // SetHexpand is a helper method to define mock.On call | |
| 895 | + | // - expand bool | |
| 896 | + | func (_e *MockProgressBarWidget_Expecter) SetHexpand(expand interface{}) *MockProgressBarWidget_SetHexpand_Call { | |
| 897 | + | return &MockProgressBarWidget_SetHexpand_Call{Call: _e.mock.On("SetHexpand", expand)} | |
| 898 | + | } | |
| 899 | + | ||
| 900 | + | func (_c *MockProgressBarWidget_SetHexpand_Call) Run(run func(expand bool)) *MockProgressBarWidget_SetHexpand_Call { | |
| 901 | + | _c.Call.Run(func(args mock.Arguments) { | |
| 902 | + | run(args[0].(bool)) | |
| 903 | + | }) | |
| 904 | + | return _c | |
| 905 | + | } | |
| 906 | + | ||
| 907 | + | func (_c *MockProgressBarWidget_SetHexpand_Call) Return() *MockProgressBarWidget_SetHexpand_Call { | |
| 908 | + | _c.Call.Return() | |
| 909 | + | return _c | |
| 910 | + | } | |
| 911 | + | ||
| 912 | + | func (_c *MockProgressBarWidget_SetHexpand_Call) RunAndReturn(run func(bool)) *MockProgressBarWidget_SetHexpand_Call { | |
| 913 | + | _c.Run(run) | |
| 914 | + | return _c | |
| 915 | + | } | |
| 916 | + | ||
| 917 | + | // SetSizeRequest provides a mock function with given fields: width, height | |
| 918 | + | func (_m *MockProgressBarWidget) SetSizeRequest(width int, height int) { | |
| 919 | + | _m.Called(width, height) | |
| 920 | + | } | |
| 921 | + | ||
| 922 | + | // MockProgressBarWidget_SetSizeRequest_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'SetSizeRequest' | |
| 923 | + | type MockProgressBarWidget_SetSizeRequest_Call struct { | |
| 924 | + | *mock.Call | |
| 925 | + | } | |
| 926 | + | ||
| 927 | + | // SetSizeRequest is a helper method to define mock.On call | |
| 928 | + | // - width int | |
| 929 | + | // - height int | |
| 930 | + | func (_e *MockProgressBarWidget_Expecter) SetSizeRequest(width interface{}, height interface{}) *MockProgressBarWidget_SetSizeRequest_Call { | |
| 931 | + | return &MockProgressBarWidget_SetSizeRequest_Call{Call: _e.mock.On("SetSizeRequest", width, height)} | |
| 932 | + | } | |
| 933 | + | ||
| 934 | + | func (_c *MockProgressBarWidget_SetSizeRequest_Call) Run(run func(width int, height int)) *MockProgressBarWidget_SetSizeRequest_Call { | |
| 935 | + | _c.Call.Run(func(args mock.Arguments) { | |
| 936 | + | run(args[0].(int), args[1].(int)) | |
| 937 | + | }) | |
| 938 | + | return _c | |
| 939 | + | } | |
| 940 | + | ||
| 941 | + | func (_c *MockProgressBarWidget_SetSizeRequest_Call) Return() *MockProgressBarWidget_SetSizeRequest_Call { | |
| 942 | + | _c.Call.Return() | |
| 943 | + | return _c | |
| 944 | + | } | |
| 945 | + | ||
| 946 | + | func (_c *MockProgressBarWidget_SetSizeRequest_Call) RunAndReturn(run func(int, int)) *MockProgressBarWidget_SetSizeRequest_Call { | |
| 947 | + | _c.Run(run) | |
| 948 | + | return _c | |
| 949 | + | } | |
| 950 | + | ||
| 951 | + | // SetValign provides a mock function with given fields: align | |
| 952 | + | func (_m *MockProgressBarWidget) SetValign(align gtk.Align) { | |
| 953 | + | _m.Called(align) | |
| 954 | + | } | |
| 955 | + | ||
| 956 | + | // MockProgressBarWidget_SetValign_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'SetValign' | |
| 957 | + | type MockProgressBarWidget_SetValign_Call struct { | |
| 958 | + | *mock.Call | |
| 959 | + | } | |
| 960 | + | ||
| 961 | + | // SetValign is a helper method to define mock.On call | |
| 962 | + | // - align gtk.Align | |
| 963 | + | func (_e *MockProgressBarWidget_Expecter) SetValign(align interface{}) *MockProgressBarWidget_SetValign_Call { | |
| 964 | + | return &MockProgressBarWidget_SetValign_Call{Call: _e.mock.On("SetValign", align)} | |
| 965 | + | } | |
| 966 | + | ||
| 967 | + | func (_c *MockProgressBarWidget_SetValign_Call) Run(run func(align gtk.Align)) *MockProgressBarWidget_SetValign_Call { | |
| 968 | + | _c.Call.Run(func(args mock.Arguments) { | |
| 969 | + | run(args[0].(gtk.Align)) | |
| 970 | + | }) | |
| 971 | + | return _c | |
| 972 | + | } | |
| 973 | + | ||
| 974 | + | func (_c *MockProgressBarWidget_SetValign_Call) Return() *MockProgressBarWidget_SetValign_Call { | |
| 975 | + | _c.Call.Return() | |
| 976 | + | return _c | |
| 977 | + | } | |
| 978 | + | ||
| 979 | + | func (_c *MockProgressBarWidget_SetValign_Call) RunAndReturn(run func(gtk.Align)) *MockProgressBarWidget_SetValign_Call { | |
| 980 | + | _c.Run(run) | |
| 981 | + | return _c | |
| 982 | + | } | |
| 983 | + | ||
| 984 | + | // SetVexpand provides a mock function with given fields: expand | |
| 985 | + | func (_m *MockProgressBarWidget) SetVexpand(expand bool) { | |
| 986 | + | _m.Called(expand) | |
| 987 | + | } | |
| 988 | + | ||
| 989 | + | // MockProgressBarWidget_SetVexpand_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'SetVexpand' | |
| 990 | + | type MockProgressBarWidget_SetVexpand_Call struct { | |
| 991 | + | *mock.Call | |
| 992 | + | } | |
| 993 | + | ||
| 994 | + | // SetVexpand is a helper method to define mock.On call | |
| 995 | + | // - expand bool | |
| 996 | + | func (_e *MockProgressBarWidget_Expecter) SetVexpand(expand interface{}) *MockProgressBarWidget_SetVexpand_Call { | |
| 997 | + | return &MockProgressBarWidget_SetVexpand_Call{Call: _e.mock.On("SetVexpand", expand)} | |
| 998 | + | } | |
| 999 | + | ||
| 1000 | + | func (_c *MockProgressBarWidget_SetVexpand_Call) Run(run func(expand bool)) *MockProgressBarWidget_SetVexpand_Call { | |
| 1001 | + | _c.Call.Run(func(args mock.Arguments) { | |
| 1002 | + | run(args[0].(bool)) | |
| 1003 | + | }) | |
| 1004 | + | return _c | |
| 1005 | + | } | |
| 1006 | + | ||
| 1007 | + | func (_c *MockProgressBarWidget_SetVexpand_Call) Return() *MockProgressBarWidget_SetVexpand_Call { | |
| 1008 | + | _c.Call.Return() | |
| 1009 | + | return _c | |
| 1010 | + | } | |
| 1011 | + | ||
| 1012 | + | func (_c *MockProgressBarWidget_SetVexpand_Call) RunAndReturn(run func(bool)) *MockProgressBarWidget_SetVexpand_Call { | |
| 1013 | + | _c.Run(run) | |
| 1014 | + | return _c | |
| 1015 | + | } | |
| 1016 | + | ||
| 1017 | + | // SetVisible provides a mock function with given fields: visible | |
| 1018 | + | func (_m *MockProgressBarWidget) SetVisible(visible bool) { | |
| 1019 | + | _m.Called(visible) | |
| 1020 | + | } | |
| 1021 | + | ||
| 1022 | + | // MockProgressBarWidget_SetVisible_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'SetVisible' | |
| 1023 | + | type MockProgressBarWidget_SetVisible_Call struct { | |
| 1024 | + | *mock.Call | |
| 1025 | + | } | |
| 1026 | + | ||
| 1027 | + | // SetVisible is a helper method to define mock.On call | |
| 1028 | + | // - visible bool | |
| 1029 | + | func (_e *MockProgressBarWidget_Expecter) SetVisible(visible interface{}) *MockProgressBarWidget_SetVisible_Call { | |
| 1030 | + | return &MockProgressBarWidget_SetVisible_Call{Call: _e.mock.On("SetVisible", visible)} | |
| 1031 | + | } | |
| 1032 | + | ||
| 1033 | + | func (_c *MockProgressBarWidget_SetVisible_Call) Run(run func(visible bool)) *MockProgressBarWidget_SetVisible_Call { | |
| 1034 | + | _c.Call.Run(func(args mock.Arguments) { | |
| 1035 | + | run(args[0].(bool)) | |
| 1036 | + | }) | |
| 1037 | + | return _c | |
| 1038 | + | } | |
| 1039 | + | ||
| 1040 | + | func (_c *MockProgressBarWidget_SetVisible_Call) Return() *MockProgressBarWidget_SetVisible_Call { | |
| 1041 | + | _c.Call.Return() | |
| 1042 | + | return _c | |
| 1043 | + | } | |
| 1044 | + | ||
| 1045 | + | func (_c *MockProgressBarWidget_SetVisible_Call) RunAndReturn(run func(bool)) *MockProgressBarWidget_SetVisible_Call { | |
| 1046 | + | _c.Run(run) | |
| 1047 | + | return _c | |
| 1048 | + | } | |
| 1049 | + | ||
| 1050 | + | // Show provides a mock function with no fields | |
| 1051 | + | func (_m *MockProgressBarWidget) Show() { | |
| 1052 | + | _m.Called() | |
| 1053 | + | } | |
| 1054 | + | ||
| 1055 | + | // MockProgressBarWidget_Show_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'Show' | |
| 1056 | + | type MockProgressBarWidget_Show_Call struct { | |
| 1057 | + | *mock.Call | |
| 1058 | + | } | |
| 1059 | + | ||
| 1060 | + | // Show is a helper method to define mock.On call | |
| 1061 | + | func (_e *MockProgressBarWidget_Expecter) Show() *MockProgressBarWidget_Show_Call { | |
| 1062 | + | return &MockProgressBarWidget_Show_Call{Call: _e.mock.On("Show")} | |
| 1063 | + | } | |
| 1064 | + | ||
| 1065 | + | func (_c *MockProgressBarWidget_Show_Call) Run(run func()) *MockProgressBarWidget_Show_Call { | |
| 1066 | + | _c.Call.Run(func(args mock.Arguments) { | |
| 1067 | + | run() | |
| 1068 | + | }) | |
| 1069 | + | return _c | |
| 1070 | + | } | |
| 1071 | + | ||
| 1072 | + | func (_c *MockProgressBarWidget_Show_Call) Return() *MockProgressBarWidget_Show_Call { | |
| 1073 | + | _c.Call.Return() | |
| 1074 | + | return _c | |
| 1075 | + | } | |
| 1076 | + | ||
| 1077 | + | func (_c *MockProgressBarWidget_Show_Call) RunAndReturn(run func()) *MockProgressBarWidget_Show_Call { | |
| 1078 | + | _c.Run(run) | |
| 1079 | + | return _c | |
| 1080 | + | } | |
| 1081 | + | ||
| 1082 | + | // Unparent provides a mock function with no fields | |
| 1083 | + | func (_m *MockProgressBarWidget) Unparent() { | |
| 1084 | + | _m.Called() | |
| 1085 | + | } | |
| 1086 | + | ||
| 1087 | + | // MockProgressBarWidget_Unparent_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'Unparent' | |
| 1088 | + | type MockProgressBarWidget_Unparent_Call struct { | |
| 1089 | + | *mock.Call | |
| 1090 | + | } | |
| 1091 | + | ||
| 1092 | + | // Unparent is a helper method to define mock.On call | |
| 1093 | + | func (_e *MockProgressBarWidget_Expecter) Unparent() *MockProgressBarWidget_Unparent_Call { | |
| 1094 | + | return &MockProgressBarWidget_Unparent_Call{Call: _e.mock.On("Unparent")} | |
| 1095 | + | } | |
| 1096 | + | ||
| 1097 | + | func (_c *MockProgressBarWidget_Unparent_Call) Run(run func()) *MockProgressBarWidget_Unparent_Call { | |
| 1098 | + | _c.Call.Run(func(args mock.Arguments) { | |
| 1099 | + | run() | |
| 1100 | + | }) | |
| 1101 | + | return _c | |
| 1102 | + | } | |
| 1103 | + | ||
| 1104 | + | func (_c *MockProgressBarWidget_Unparent_Call) Return() *MockProgressBarWidget_Unparent_Call { | |
| 1105 | + | _c.Call.Return() | |
| 1106 | + | return _c | |
| 1107 | + | } | |
| 1108 | + | ||
| 1109 | + | func (_c *MockProgressBarWidget_Unparent_Call) RunAndReturn(run func()) *MockProgressBarWidget_Unparent_Call { | |
| 1110 | + | _c.Run(run) | |
| 1111 | + | return _c | |
| 1112 | + | } | |
| 1113 | + | ||
| 1114 | + | // NewMockProgressBarWidget creates a new instance of MockProgressBarWidget. It also registers a testing interface on the mock and a cleanup function to assert the mocks expectations. | |
| 1115 | + | // The first argument is typically a *testing.T value. | |
| 1116 | + | func NewMockProgressBarWidget(t interface { | |
| 1117 | + | mock.TestingT | |
| 1118 | + | Cleanup(func()) | |
| 1119 | + | }) *MockProgressBarWidget { | |
| 1120 | + | mock := &MockProgressBarWidget{} | |
| 1121 | + | mock.Mock.Test(t) | |
| 1122 | + | ||
| 1123 | + | t.Cleanup(func() { mock.AssertExpectations(t) }) | |
| 1124 | + | ||
| 1125 | + | return mock | |
| 1126 | + | } | |
| @@ -0,0 +1,1126 @@ | |||||
| 1 | + | // Code generated by mockery v2.53.5. DO NOT EDIT. | |||
| 2 | + | ||||
| 3 | + | package mocks | |||
| 4 | + | ||||
| 5 | + | import ( | |||
| 6 | + | layout "github.com/bnema/dumber/internal/ui/layout" | |||
| 7 | + | gtk "github.com/jwijenbergh/puregotk/v4/gtk" | |||
| 8 | + | ||||
| 9 | + | mock "github.com/stretchr/testify/mock" | |||
| 10 | + | ) | |||
| 11 | + | ||||
| 12 | + | // MockProgressBarWidget is an autogenerated mock type for the ProgressBarWidget type | |||
| 13 | + | type MockProgressBarWidget struct { | |||
| 14 | + | mock.Mock | |||
| 15 | + | } | |||
| 16 | + | ||||
| 17 | + | type MockProgressBarWidget_Expecter struct { | |||
| 18 | + | mock *mock.Mock | |||
| 19 | + | } | |||
| 20 | + | ||||
| 21 | + | func (_m *MockProgressBarWidget) EXPECT() *MockProgressBarWidget_Expecter { | |||
| 22 | + | return &MockProgressBarWidget_Expecter{mock: &_m.Mock} | |||
| 23 | + | } | |||
| 24 | + | ||||
| 25 | + | // AddController provides a mock function with given fields: controller | |||
| 26 | + | func (_m *MockProgressBarWidget) AddController(controller *gtk.EventController) { | |||
| 27 | + | _m.Called(controller) | |||
| 28 | + | } | |||
| 29 | + | ||||
| 30 | + | // MockProgressBarWidget_AddController_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'AddController' | |||
| 31 | + | type MockProgressBarWidget_AddController_Call struct { | |||
| 32 | + | *mock.Call | |||
| 33 | + | } | |||
| 34 | + | ||||
| 35 | + | // AddController is a helper method to define mock.On call | |||
| 36 | + | // - controller *gtk.EventController | |||
| 37 | + | func (_e *MockProgressBarWidget_Expecter) AddController(controller interface{}) *MockProgressBarWidget_AddController_Call { | |||
| 38 | + | return &MockProgressBarWidget_AddController_Call{Call: _e.mock.On("AddController", controller)} | |||
| 39 | + | } | |||
| 40 | + | ||||
| 41 | + | func (_c *MockProgressBarWidget_AddController_Call) Run(run func(controller *gtk.EventController)) *MockProgressBarWidget_AddController_Call { | |||
| 42 | + | _c.Call.Run(func(args mock.Arguments) { | |||
| 43 | + | run(args[0].(*gtk.EventController)) | |||
| 44 | + | }) | |||
| 45 | + | return _c | |||
| 46 | + | } | |||
| 47 | + | ||||
| 48 | + | func (_c *MockProgressBarWidget_AddController_Call) Return() *MockProgressBarWidget_AddController_Call { | |||
| 49 | + | _c.Call.Return() | |||
| 50 | + | return _c | |||
| 51 | + | } | |||
| 52 | + | ||||
| 53 | + | func (_c *MockProgressBarWidget_AddController_Call) RunAndReturn(run func(*gtk.EventController)) *MockProgressBarWidget_AddController_Call { | |||
| 54 | + | _c.Run(run) | |||
| 55 | + | return _c | |||
| 56 | + | } | |||
| 57 | + | ||||
| 58 | + | // AddCssClass provides a mock function with given fields: cssClass | |||
| 59 | + | func (_m *MockProgressBarWidget) AddCssClass(cssClass string) { | |||
| 60 | + | _m.Called(cssClass) | |||
| 61 | + | } | |||
| 62 | + | ||||
| 63 | + | // MockProgressBarWidget_AddCssClass_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'AddCssClass' | |||
| 64 | + | type MockProgressBarWidget_AddCssClass_Call struct { | |||
| 65 | + | *mock.Call | |||
| 66 | + | } | |||
| 67 | + | ||||
| 68 | + | // AddCssClass is a helper method to define mock.On call | |||
| 69 | + | // - cssClass string | |||
| 70 | + | func (_e *MockProgressBarWidget_Expecter) AddCssClass(cssClass interface{}) *MockProgressBarWidget_AddCssClass_Call { | |||
| 71 | + | return &MockProgressBarWidget_AddCssClass_Call{Call: _e.mock.On("AddCssClass", cssClass)} | |||
| 72 | + | } | |||
| 73 | + | ||||
| 74 | + | func (_c *MockProgressBarWidget_AddCssClass_Call) Run(run func(cssClass string)) *MockProgressBarWidget_AddCssClass_Call { | |||
| 75 | + | _c.Call.Run(func(args mock.Arguments) { | |||
| 76 | + | run(args[0].(string)) | |||
| 77 | + | }) | |||
| 78 | + | return _c | |||
| 79 | + | } | |||
| 80 | + | ||||
| 81 | + | func (_c *MockProgressBarWidget_AddCssClass_Call) Return() *MockProgressBarWidget_AddCssClass_Call { | |||
| 82 | + | _c.Call.Return() | |||
| 83 | + | return _c | |||
| 84 | + | } | |||
| 85 | + | ||||
| 86 | + | func (_c *MockProgressBarWidget_AddCssClass_Call) RunAndReturn(run func(string)) *MockProgressBarWidget_AddCssClass_Call { | |||
| 87 | + | _c.Run(run) | |||
| 88 | + | return _c | |||
| 89 | + | } | |||
| 90 | + | ||||
| 91 | + | // ComputePoint provides a mock function with given fields: target | |||
| 92 | + | func (_m *MockProgressBarWidget) ComputePoint(target layout.Widget) (float64, float64, bool) { | |||
| 93 | + | ret := _m.Called(target) | |||
| 94 | + | ||||
| 95 | + | if len(ret) == 0 { | |||
| 96 | + | panic("no return value specified for ComputePoint") | |||
| 97 | + | } | |||
| 98 | + | ||||
| 99 | + | var r0 float64 | |||
| 100 | + | var r1 float64 | |||
| 101 | + | var r2 bool | |||
| 102 | + | if rf, ok := ret.Get(0).(func(layout.Widget) (float64, float64, bool)); ok { | |||
| 103 | + | return rf(target) | |||
| 104 | + | } | |||
| 105 | + | if rf, ok := ret.Get(0).(func(layout.Widget) float64); ok { | |||
| 106 | + | r0 = rf(target) | |||
| 107 | + | } else { | |||
| 108 | + | r0 = ret.Get(0).(float64) | |||
| 109 | + | } | |||
| 110 | + | ||||
| 111 | + | if rf, ok := ret.Get(1).(func(layout.Widget) float64); ok { | |||
| 112 | + | r1 = rf(target) | |||
| 113 | + | } else { | |||
| 114 | + | r1 = ret.Get(1).(float64) | |||
| 115 | + | } | |||
| 116 | + | ||||
| 117 | + | if rf, ok := ret.Get(2).(func(layout.Widget) bool); ok { | |||
| 118 | + | r2 = rf(target) | |||
| 119 | + | } else { | |||
| 120 | + | r2 = ret.Get(2).(bool) | |||
| 121 | + | } | |||
| 122 | + | ||||
| 123 | + | return r0, r1, r2 | |||
| 124 | + | } | |||
| 125 | + | ||||
| 126 | + | // MockProgressBarWidget_ComputePoint_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'ComputePoint' | |||
| 127 | + | type MockProgressBarWidget_ComputePoint_Call struct { | |||
| 128 | + | *mock.Call | |||
| 129 | + | } | |||
| 130 | + | ||||
| 131 | + | // ComputePoint is a helper method to define mock.On call | |||
| 132 | + | // - target layout.Widget | |||
| 133 | + | func (_e *MockProgressBarWidget_Expecter) ComputePoint(target interface{}) *MockProgressBarWidget_ComputePoint_Call { | |||
| 134 | + | return &MockProgressBarWidget_ComputePoint_Call{Call: _e.mock.On("ComputePoint", target)} | |||
| 135 | + | } | |||
| 136 | + | ||||
| 137 | + | func (_c *MockProgressBarWidget_ComputePoint_Call) Run(run func(target layout.Widget)) *MockProgressBarWidget_ComputePoint_Call { | |||
| 138 | + | _c.Call.Run(func(args mock.Arguments) { | |||
| 139 | + | run(args[0].(layout.Widget)) | |||
| 140 | + | }) | |||
| 141 | + | return _c | |||
| 142 | + | } | |||
| 143 | + | ||||
| 144 | + | func (_c *MockProgressBarWidget_ComputePoint_Call) Return(x float64, y float64, ok bool) *MockProgressBarWidget_ComputePoint_Call { | |||
| 145 | + | _c.Call.Return(x, y, ok) | |||
| 146 | + | return _c | |||
| 147 | + | } | |||
| 148 | + | ||||
| 149 | + | func (_c *MockProgressBarWidget_ComputePoint_Call) RunAndReturn(run func(layout.Widget) (float64, float64, bool)) *MockProgressBarWidget_ComputePoint_Call { | |||
| 150 | + | _c.Call.Return(run) | |||
| 151 | + | return _c | |||
| 152 | + | } | |||
| 153 | + | ||||
| 154 | + | // GetAllocatedHeight provides a mock function with no fields | |||
| 155 | + | func (_m *MockProgressBarWidget) GetAllocatedHeight() int { | |||
| 156 | + | ret := _m.Called() | |||
| 157 | + | ||||
| 158 | + | if len(ret) == 0 { | |||
| 159 | + | panic("no return value specified for GetAllocatedHeight") | |||
| 160 | + | } | |||
| 161 | + | ||||
| 162 | + | var r0 int | |||
| 163 | + | if rf, ok := ret.Get(0).(func() int); ok { | |||
| 164 | + | r0 = rf() | |||
| 165 | + | } else { | |||
| 166 | + | r0 = ret.Get(0).(int) | |||
| 167 | + | } | |||
| 168 | + | ||||
| 169 | + | return r0 | |||
| 170 | + | } | |||
| 171 | + | ||||
| 172 | + | // MockProgressBarWidget_GetAllocatedHeight_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'GetAllocatedHeight' | |||
| 173 | + | type MockProgressBarWidget_GetAllocatedHeight_Call struct { | |||
| 174 | + | *mock.Call | |||
| 175 | + | } | |||
| 176 | + | ||||
| 177 | + | // GetAllocatedHeight is a helper method to define mock.On call | |||
| 178 | + | func (_e *MockProgressBarWidget_Expecter) GetAllocatedHeight() *MockProgressBarWidget_GetAllocatedHeight_Call { | |||
| 179 | + | return &MockProgressBarWidget_GetAllocatedHeight_Call{Call: _e.mock.On("GetAllocatedHeight")} | |||
| 180 | + | } | |||
| 181 | + | ||||
| 182 | + | func (_c *MockProgressBarWidget_GetAllocatedHeight_Call) Run(run func()) *MockProgressBarWidget_GetAllocatedHeight_Call { | |||
| 183 | + | _c.Call.Run(func(args mock.Arguments) { | |||
| 184 | + | run() | |||
| 185 | + | }) | |||
| 186 | + | return _c | |||
| 187 | + | } | |||
| 188 | + | ||||
| 189 | + | func (_c *MockProgressBarWidget_GetAllocatedHeight_Call) Return(_a0 int) *MockProgressBarWidget_GetAllocatedHeight_Call { | |||
| 190 | + | _c.Call.Return(_a0) | |||
| 191 | + | return _c | |||
| 192 | + | } | |||
| 193 | + | ||||
| 194 | + | func (_c *MockProgressBarWidget_GetAllocatedHeight_Call) RunAndReturn(run func() int) *MockProgressBarWidget_GetAllocatedHeight_Call { | |||
| 195 | + | _c.Call.Return(run) | |||
| 196 | + | return _c | |||
| 197 | + | } | |||
| 198 | + | ||||
| 199 | + | // GetAllocatedWidth provides a mock function with no fields | |||
| 200 | + | func (_m *MockProgressBarWidget) GetAllocatedWidth() int { | |||
| 201 | + | ret := _m.Called() | |||
| 202 | + | ||||
| 203 | + | if len(ret) == 0 { | |||
| 204 | + | panic("no return value specified for GetAllocatedWidth") | |||
| 205 | + | } | |||
| 206 | + | ||||
| 207 | + | var r0 int | |||
| 208 | + | if rf, ok := ret.Get(0).(func() int); ok { | |||
| 209 | + | r0 = rf() | |||
| 210 | + | } else { | |||
| 211 | + | r0 = ret.Get(0).(int) | |||
| 212 | + | } | |||
| 213 | + | ||||
| 214 | + | return r0 | |||
| 215 | + | } | |||
| 216 | + | ||||
| 217 | + | // MockProgressBarWidget_GetAllocatedWidth_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'GetAllocatedWidth' | |||
| 218 | + | type MockProgressBarWidget_GetAllocatedWidth_Call struct { | |||
| 219 | + | *mock.Call | |||
| 220 | + | } | |||
| 221 | + | ||||
| 222 | + | // GetAllocatedWidth is a helper method to define mock.On call | |||
| 223 | + | func (_e *MockProgressBarWidget_Expecter) GetAllocatedWidth() *MockProgressBarWidget_GetAllocatedWidth_Call { | |||
| 224 | + | return &MockProgressBarWidget_GetAllocatedWidth_Call{Call: _e.mock.On("GetAllocatedWidth")} | |||
| 225 | + | } | |||
| 226 | + | ||||
| 227 | + | func (_c *MockProgressBarWidget_GetAllocatedWidth_Call) Run(run func()) *MockProgressBarWidget_GetAllocatedWidth_Call { | |||
| 228 | + | _c.Call.Run(func(args mock.Arguments) { | |||
| 229 | + | run() | |||
| 230 | + | }) | |||
| 231 | + | return _c | |||
| 232 | + | } | |||
| 233 | + | ||||
| 234 | + | func (_c *MockProgressBarWidget_GetAllocatedWidth_Call) Return(_a0 int) *MockProgressBarWidget_GetAllocatedWidth_Call { | |||
| 235 | + | _c.Call.Return(_a0) | |||
| 236 | + | return _c | |||
| 237 | + | } | |||
| 238 | + | ||||
| 239 | + | func (_c *MockProgressBarWidget_GetAllocatedWidth_Call) RunAndReturn(run func() int) *MockProgressBarWidget_GetAllocatedWidth_Call { | |||
| 240 | + | _c.Call.Return(run) | |||
| 241 | + | return _c | |||
| 242 | + | } | |||
| 243 | + | ||||
| 244 | + | // GetFraction provides a mock function with no fields | |||
| 245 | + | func (_m *MockProgressBarWidget) GetFraction() float64 { | |||
| 246 | + | ret := _m.Called() | |||
| 247 | + | ||||
| 248 | + | if len(ret) == 0 { | |||
| 249 | + | panic("no return value specified for GetFraction") | |||
| 250 | + | } | |||
| 251 | + | ||||
| 252 | + | var r0 float64 | |||
| 253 | + | if rf, ok := ret.Get(0).(func() float64); ok { | |||
| 254 | + | r0 = rf() | |||
| 255 | + | } else { | |||
| 256 | + | r0 = ret.Get(0).(float64) | |||
| 257 | + | } | |||
| 258 | + | ||||
| 259 | + | return r0 | |||
| 260 | + | } | |||
| 261 | + | ||||
| 262 | + | // MockProgressBarWidget_GetFraction_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'GetFraction' | |||
| 263 | + | type MockProgressBarWidget_GetFraction_Call struct { | |||
| 264 | + | *mock.Call | |||
| 265 | + | } | |||
| 266 | + | ||||
| 267 | + | // GetFraction is a helper method to define mock.On call | |||
| 268 | + | func (_e *MockProgressBarWidget_Expecter) GetFraction() *MockProgressBarWidget_GetFraction_Call { | |||
| 269 | + | return &MockProgressBarWidget_GetFraction_Call{Call: _e.mock.On("GetFraction")} | |||
| 270 | + | } | |||
| 271 | + | ||||
| 272 | + | func (_c *MockProgressBarWidget_GetFraction_Call) Run(run func()) *MockProgressBarWidget_GetFraction_Call { | |||
| 273 | + | _c.Call.Run(func(args mock.Arguments) { | |||
| 274 | + | run() | |||
| 275 | + | }) | |||
| 276 | + | return _c | |||
| 277 | + | } | |||
| 278 | + | ||||
| 279 | + | func (_c *MockProgressBarWidget_GetFraction_Call) Return(_a0 float64) *MockProgressBarWidget_GetFraction_Call { | |||
| 280 | + | _c.Call.Return(_a0) | |||
| 281 | + | return _c | |||
| 282 | + | } | |||
| 283 | + | ||||
| 284 | + | func (_c *MockProgressBarWidget_GetFraction_Call) RunAndReturn(run func() float64) *MockProgressBarWidget_GetFraction_Call { | |||
| 285 | + | _c.Call.Return(run) | |||
| 286 | + | return _c | |||
| 287 | + | } | |||
| 288 | + | ||||
| 289 | + | // GetHexpand provides a mock function with no fields | |||
| 290 | + | func (_m *MockProgressBarWidget) GetHexpand() bool { | |||
| 291 | + | ret := _m.Called() | |||
| 292 | + | ||||
| 293 | + | if len(ret) == 0 { | |||
| 294 | + | panic("no return value specified for GetHexpand") | |||
| 295 | + | } | |||
| 296 | + | ||||
| 297 | + | var r0 bool | |||
| 298 | + | if rf, ok := ret.Get(0).(func() bool); ok { | |||
| 299 | + | r0 = rf() | |||
| 300 | + | } else { | |||
| 301 | + | r0 = ret.Get(0).(bool) | |||
| 302 | + | } | |||
| 303 | + | ||||
| 304 | + | return r0 | |||
| 305 | + | } | |||
| 306 | + | ||||
| 307 | + | // MockProgressBarWidget_GetHexpand_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'GetHexpand' | |||
| 308 | + | type MockProgressBarWidget_GetHexpand_Call struct { | |||
| 309 | + | *mock.Call | |||
| 310 | + | } | |||
| 311 | + | ||||
| 312 | + | // GetHexpand is a helper method to define mock.On call | |||
| 313 | + | func (_e *MockProgressBarWidget_Expecter) GetHexpand() *MockProgressBarWidget_GetHexpand_Call { | |||
| 314 | + | return &MockProgressBarWidget_GetHexpand_Call{Call: _e.mock.On("GetHexpand")} | |||
| 315 | + | } | |||
| 316 | + | ||||
| 317 | + | func (_c *MockProgressBarWidget_GetHexpand_Call) Run(run func()) *MockProgressBarWidget_GetHexpand_Call { | |||
| 318 | + | _c.Call.Run(func(args mock.Arguments) { | |||
| 319 | + | run() | |||
| 320 | + | }) | |||
| 321 | + | return _c | |||
| 322 | + | } | |||
| 323 | + | ||||
| 324 | + | func (_c *MockProgressBarWidget_GetHexpand_Call) Return(_a0 bool) *MockProgressBarWidget_GetHexpand_Call { | |||
| 325 | + | _c.Call.Return(_a0) | |||
| 326 | + | return _c | |||
| 327 | + | } | |||
| 328 | + | ||||
| 329 | + | func (_c *MockProgressBarWidget_GetHexpand_Call) RunAndReturn(run func() bool) *MockProgressBarWidget_GetHexpand_Call { | |||
| 330 | + | _c.Call.Return(run) | |||
| 331 | + | return _c | |||
| 332 | + | } | |||
| 333 | + | ||||
| 334 | + | // GetParent provides a mock function with no fields | |||
| 335 | + | func (_m *MockProgressBarWidget) GetParent() layout.Widget { | |||
| 336 | + | ret := _m.Called() | |||
| 337 | + | ||||
| 338 | + | if len(ret) == 0 { | |||
| 339 | + | panic("no return value specified for GetParent") | |||
| 340 | + | } | |||
| 341 | + | ||||
| 342 | + | var r0 layout.Widget | |||
| 343 | + | if rf, ok := ret.Get(0).(func() layout.Widget); ok { | |||
| 344 | + | r0 = rf() | |||
| 345 | + | } else { | |||
| 346 | + | if ret.Get(0) != nil { | |||
| 347 | + | r0 = ret.Get(0).(layout.Widget) | |||
| 348 | + | } | |||
| 349 | + | } | |||
| 350 | + | ||||
| 351 | + | return r0 | |||
| 352 | + | } | |||
| 353 | + | ||||
| 354 | + | // MockProgressBarWidget_GetParent_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'GetParent' | |||
| 355 | + | type MockProgressBarWidget_GetParent_Call struct { | |||
| 356 | + | *mock.Call | |||
| 357 | + | } | |||
| 358 | + | ||||
| 359 | + | // GetParent is a helper method to define mock.On call | |||
| 360 | + | func (_e *MockProgressBarWidget_Expecter) GetParent() *MockProgressBarWidget_GetParent_Call { | |||
| 361 | + | return &MockProgressBarWidget_GetParent_Call{Call: _e.mock.On("GetParent")} | |||
| 362 | + | } | |||
| 363 | + | ||||
| 364 | + | func (_c *MockProgressBarWidget_GetParent_Call) Run(run func()) *MockProgressBarWidget_GetParent_Call { | |||
| 365 | + | _c.Call.Run(func(args mock.Arguments) { | |||
| 366 | + | run() | |||
| 367 | + | }) | |||
| 368 | + | return _c | |||
| 369 | + | } | |||
| 370 | + | ||||
| 371 | + | func (_c *MockProgressBarWidget_GetParent_Call) Return(_a0 layout.Widget) *MockProgressBarWidget_GetParent_Call { | |||
| 372 | + | _c.Call.Return(_a0) | |||
| 373 | + | return _c | |||
| 374 | + | } | |||
| 375 | + | ||||
| 376 | + | func (_c *MockProgressBarWidget_GetParent_Call) RunAndReturn(run func() layout.Widget) *MockProgressBarWidget_GetParent_Call { | |||
| 377 | + | _c.Call.Return(run) | |||
| 378 | + | return _c | |||
| 379 | + | } | |||
| 380 | + | ||||
| 381 | + | // GetVexpand provides a mock function with no fields | |||
| 382 | + | func (_m *MockProgressBarWidget) GetVexpand() bool { | |||
| 383 | + | ret := _m.Called() | |||
| 384 | + | ||||
| 385 | + | if len(ret) == 0 { | |||
| 386 | + | panic("no return value specified for GetVexpand") | |||
| 387 | + | } | |||
| 388 | + | ||||
| 389 | + | var r0 bool | |||
| 390 | + | if rf, ok := ret.Get(0).(func() bool); ok { | |||
| 391 | + | r0 = rf() | |||
| 392 | + | } else { | |||
| 393 | + | r0 = ret.Get(0).(bool) | |||
| 394 | + | } | |||
| 395 | + | ||||
| 396 | + | return r0 | |||
| 397 | + | } | |||
| 398 | + | ||||
| 399 | + | // MockProgressBarWidget_GetVexpand_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'GetVexpand' | |||
| 400 | + | type MockProgressBarWidget_GetVexpand_Call struct { | |||
| 401 | + | *mock.Call | |||
| 402 | + | } | |||
| 403 | + | ||||
| 404 | + | // GetVexpand is a helper method to define mock.On call | |||
| 405 | + | func (_e *MockProgressBarWidget_Expecter) GetVexpand() *MockProgressBarWidget_GetVexpand_Call { | |||
| 406 | + | return &MockProgressBarWidget_GetVexpand_Call{Call: _e.mock.On("GetVexpand")} | |||
| 407 | + | } | |||
| 408 | + | ||||
| 409 | + | func (_c *MockProgressBarWidget_GetVexpand_Call) Run(run func()) *MockProgressBarWidget_GetVexpand_Call { | |||
| 410 | + | _c.Call.Run(func(args mock.Arguments) { | |||
| 411 | + | run() | |||
| 412 | + | }) | |||
| 413 | + | return _c | |||
| 414 | + | } | |||
| 415 | + | ||||
| 416 | + | func (_c *MockProgressBarWidget_GetVexpand_Call) Return(_a0 bool) *MockProgressBarWidget_GetVexpand_Call { | |||
| 417 | + | _c.Call.Return(_a0) | |||
| 418 | + | return _c | |||
| 419 | + | } | |||
| 420 | + | ||||
| 421 | + | func (_c *MockProgressBarWidget_GetVexpand_Call) RunAndReturn(run func() bool) *MockProgressBarWidget_GetVexpand_Call { | |||
| 422 | + | _c.Call.Return(run) | |||
| 423 | + | return _c | |||
| 424 | + | } | |||
| 425 | + | ||||
| 426 | + | // GrabFocus provides a mock function with no fields | |||
| 427 | + | func (_m *MockProgressBarWidget) GrabFocus() bool { | |||
| 428 | + | ret := _m.Called() | |||
| 429 | + | ||||
| 430 | + | if len(ret) == 0 { | |||
| 431 | + | panic("no return value specified for GrabFocus") | |||
| 432 | + | } | |||
| 433 | + | ||||
| 434 | + | var r0 bool | |||
| 435 | + | if rf, ok := ret.Get(0).(func() bool); ok { | |||
| 436 | + | r0 = rf() | |||
| 437 | + | } else { | |||
| 438 | + | r0 = ret.Get(0).(bool) | |||
| 439 | + | } | |||
| 440 | + | ||||
| 441 | + | return r0 | |||
| 442 | + | } | |||
| 443 | + | ||||
| 444 | + | // MockProgressBarWidget_GrabFocus_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'GrabFocus' | |||
| 445 | + | type MockProgressBarWidget_GrabFocus_Call struct { | |||
| 446 | + | *mock.Call | |||
| 447 | + | } | |||
| 448 | + | ||||
| 449 | + | // GrabFocus is a helper method to define mock.On call | |||
| 450 | + | func (_e *MockProgressBarWidget_Expecter) GrabFocus() *MockProgressBarWidget_GrabFocus_Call { | |||
| 451 | + | return &MockProgressBarWidget_GrabFocus_Call{Call: _e.mock.On("GrabFocus")} | |||
| 452 | + | } | |||
| 453 | + | ||||
| 454 | + | func (_c *MockProgressBarWidget_GrabFocus_Call) Run(run func()) *MockProgressBarWidget_GrabFocus_Call { | |||
| 455 | + | _c.Call.Run(func(args mock.Arguments) { | |||
| 456 | + | run() | |||
| 457 | + | }) | |||
| 458 | + | return _c | |||
| 459 | + | } | |||
| 460 | + | ||||
| 461 | + | func (_c *MockProgressBarWidget_GrabFocus_Call) Return(_a0 bool) *MockProgressBarWidget_GrabFocus_Call { | |||
| 462 | + | _c.Call.Return(_a0) | |||
| 463 | + | return _c | |||
| 464 | + | } | |||
| 465 | + | ||||
| 466 | + | func (_c *MockProgressBarWidget_GrabFocus_Call) RunAndReturn(run func() bool) *MockProgressBarWidget_GrabFocus_Call { | |||
| 467 | + | _c.Call.Return(run) | |||
| 468 | + | return _c | |||
| 469 | + | } | |||
| 470 | + | ||||
| 471 | + | // GtkWidget provides a mock function with no fields | |||
| 472 | + | func (_m *MockProgressBarWidget) GtkWidget() *gtk.Widget { | |||
| 473 | + | ret := _m.Called() | |||
| 474 | + | ||||
| 475 | + | if len(ret) == 0 { | |||
| 476 | + | panic("no return value specified for GtkWidget") | |||
| 477 | + | } | |||
| 478 | + | ||||
| 479 | + | var r0 *gtk.Widget | |||
| 480 | + | if rf, ok := ret.Get(0).(func() *gtk.Widget); ok { | |||
| 481 | + | r0 = rf() | |||
| 482 | + | } else { | |||
| 483 | + | if ret.Get(0) != nil { | |||
| 484 | + | r0 = ret.Get(0).(*gtk.Widget) | |||
| 485 | + | } | |||
| 486 | + | } | |||
| 487 | + | ||||
| 488 | + | return r0 | |||
| 489 | + | } | |||
| 490 | + | ||||
| 491 | + | // MockProgressBarWidget_GtkWidget_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'GtkWidget' | |||
| 492 | + | type MockProgressBarWidget_GtkWidget_Call struct { | |||
| 493 | + | *mock.Call | |||
| 494 | + | } | |||
| 495 | + | ||||
| 496 | + | // GtkWidget is a helper method to define mock.On call | |||
| 497 | + | func (_e *MockProgressBarWidget_Expecter) GtkWidget() *MockProgressBarWidget_GtkWidget_Call { | |||
| 498 | + | return &MockProgressBarWidget_GtkWidget_Call{Call: _e.mock.On("GtkWidget")} | |||
| 499 | + | } | |||
| 500 | + | ||||
| 501 | + | func (_c *MockProgressBarWidget_GtkWidget_Call) Run(run func()) *MockProgressBarWidget_GtkWidget_Call { | |||
| 502 | + | _c.Call.Run(func(args mock.Arguments) { | |||
| 503 | + | run() | |||
| 504 | + | }) | |||
| 505 | + | return _c | |||
| 506 | + | } | |||
| 507 | + | ||||
| 508 | + | func (_c *MockProgressBarWidget_GtkWidget_Call) Return(_a0 *gtk.Widget) *MockProgressBarWidget_GtkWidget_Call { | |||
| 509 | + | _c.Call.Return(_a0) | |||
| 510 | + | return _c | |||
| 511 | + | } | |||
| 512 | + | ||||
| 513 | + | func (_c *MockProgressBarWidget_GtkWidget_Call) RunAndReturn(run func() *gtk.Widget) *MockProgressBarWidget_GtkWidget_Call { | |||
| 514 | + | _c.Call.Return(run) | |||
| 515 | + | return _c | |||
| 516 | + | } | |||
| 517 | + | ||||
| 518 | + | // HasCssClass provides a mock function with given fields: cssClass | |||
| 519 | + | func (_m *MockProgressBarWidget) HasCssClass(cssClass string) bool { | |||
| 520 | + | ret := _m.Called(cssClass) | |||
| 521 | + | ||||
| 522 | + | if len(ret) == 0 { | |||
| 523 | + | panic("no return value specified for HasCssClass") | |||
| 524 | + | } | |||
| 525 | + | ||||
| 526 | + | var r0 bool | |||
| 527 | + | if rf, ok := ret.Get(0).(func(string) bool); ok { | |||
| 528 | + | r0 = rf(cssClass) | |||
| 529 | + | } else { | |||
| 530 | + | r0 = ret.Get(0).(bool) | |||
| 531 | + | } | |||
| 532 | + | ||||
| 533 | + | return r0 | |||
| 534 | + | } | |||
| 535 | + | ||||
| 536 | + | // MockProgressBarWidget_HasCssClass_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'HasCssClass' | |||
| 537 | + | type MockProgressBarWidget_HasCssClass_Call struct { | |||
| 538 | + | *mock.Call | |||
| 539 | + | } | |||
| 540 | + | ||||
| 541 | + | // HasCssClass is a helper method to define mock.On call | |||
| 542 | + | // - cssClass string | |||
| 543 | + | func (_e *MockProgressBarWidget_Expecter) HasCssClass(cssClass interface{}) *MockProgressBarWidget_HasCssClass_Call { | |||
| 544 | + | return &MockProgressBarWidget_HasCssClass_Call{Call: _e.mock.On("HasCssClass", cssClass)} | |||
| 545 | + | } | |||
| 546 | + | ||||
| 547 | + | func (_c *MockProgressBarWidget_HasCssClass_Call) Run(run func(cssClass string)) *MockProgressBarWidget_HasCssClass_Call { | |||
| 548 | + | _c.Call.Run(func(args mock.Arguments) { | |||
| 549 | + | run(args[0].(string)) | |||
| 550 | + | }) | |||
| 551 | + | return _c | |||
| 552 | + | } | |||
| 553 | + | ||||
| 554 | + | func (_c *MockProgressBarWidget_HasCssClass_Call) Return(_a0 bool) *MockProgressBarWidget_HasCssClass_Call { | |||
| 555 | + | _c.Call.Return(_a0) | |||
| 556 | + | return _c | |||
| 557 | + | } | |||
| 558 | + | ||||
| 559 | + | func (_c *MockProgressBarWidget_HasCssClass_Call) RunAndReturn(run func(string) bool) *MockProgressBarWidget_HasCssClass_Call { | |||
| 560 | + | _c.Call.Return(run) | |||
| 561 | + | return _c | |||
| 562 | + | } | |||
| 563 | + | ||||
| 564 | + | // HasFocus provides a mock function with no fields | |||
| 565 | + | func (_m *MockProgressBarWidget) HasFocus() bool { | |||
| 566 | + | ret := _m.Called() | |||
| 567 | + | ||||
| 568 | + | if len(ret) == 0 { | |||
| 569 | + | panic("no return value specified for HasFocus") | |||
| 570 | + | } | |||
| 571 | + | ||||
| 572 | + | var r0 bool | |||
| 573 | + | if rf, ok := ret.Get(0).(func() bool); ok { | |||
| 574 | + | r0 = rf() | |||
| 575 | + | } else { | |||
| 576 | + | r0 = ret.Get(0).(bool) | |||
| 577 | + | } | |||
| 578 | + | ||||
| 579 | + | return r0 | |||
| 580 | + | } | |||
| 581 | + | ||||
| 582 | + | // MockProgressBarWidget_HasFocus_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'HasFocus' | |||
| 583 | + | type MockProgressBarWidget_HasFocus_Call struct { | |||
| 584 | + | *mock.Call | |||
| 585 | + | } | |||
| 586 | + | ||||
| 587 | + | // HasFocus is a helper method to define mock.On call | |||
| 588 | + | func (_e *MockProgressBarWidget_Expecter) HasFocus() *MockProgressBarWidget_HasFocus_Call { | |||
| 589 | + | return &MockProgressBarWidget_HasFocus_Call{Call: _e.mock.On("HasFocus")} | |||
| 590 | + | } | |||
| 591 | + | ||||
| 592 | + | func (_c *MockProgressBarWidget_HasFocus_Call) Run(run func()) *MockProgressBarWidget_HasFocus_Call { | |||
| 593 | + | _c.Call.Run(func(args mock.Arguments) { | |||
| 594 | + | run() | |||
| 595 | + | }) | |||
| 596 | + | return _c | |||
| 597 | + | } | |||
| 598 | + | ||||
| 599 | + | func (_c *MockProgressBarWidget_HasFocus_Call) Return(_a0 bool) *MockProgressBarWidget_HasFocus_Call { | |||
| 600 | + | _c.Call.Return(_a0) | |||
| 601 | + | return _c | |||
| 602 | + | } | |||
| 603 | + | ||||
| 604 | + | func (_c *MockProgressBarWidget_HasFocus_Call) RunAndReturn(run func() bool) *MockProgressBarWidget_HasFocus_Call { | |||
| 605 | + | _c.Call.Return(run) | |||
| 606 | + | return _c | |||
| 607 | + | } | |||
| 608 | + | ||||
| 609 | + | // Hide provides a mock function with no fields | |||
| 610 | + | func (_m *MockProgressBarWidget) Hide() { | |||
| 611 | + | _m.Called() | |||
| 612 | + | } | |||
| 613 | + | ||||
| 614 | + | // MockProgressBarWidget_Hide_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'Hide' | |||
| 615 | + | type MockProgressBarWidget_Hide_Call struct { | |||
| 616 | + | *mock.Call | |||
| 617 | + | } | |||
| 618 | + | ||||
| 619 | + | // Hide is a helper method to define mock.On call | |||
| 620 | + | func (_e *MockProgressBarWidget_Expecter) Hide() *MockProgressBarWidget_Hide_Call { | |||
| 621 | + | return &MockProgressBarWidget_Hide_Call{Call: _e.mock.On("Hide")} | |||
| 622 | + | } | |||
| 623 | + | ||||
| 624 | + | func (_c *MockProgressBarWidget_Hide_Call) Run(run func()) *MockProgressBarWidget_Hide_Call { | |||
| 625 | + | _c.Call.Run(func(args mock.Arguments) { | |||
| 626 | + | run() | |||
| 627 | + | }) | |||
| 628 | + | return _c | |||
| 629 | + | } | |||
| 630 | + | ||||
| 631 | + | func (_c *MockProgressBarWidget_Hide_Call) Return() *MockProgressBarWidget_Hide_Call { | |||
| 632 | + | _c.Call.Return() | |||
| 633 | + | return _c | |||
| 634 | + | } | |||
| 635 | + | ||||
| 636 | + | func (_c *MockProgressBarWidget_Hide_Call) RunAndReturn(run func()) *MockProgressBarWidget_Hide_Call { | |||
| 637 | + | _c.Run(run) | |||
| 638 | + | return _c | |||
| 639 | + | } | |||
| 640 | + | ||||
| 641 | + | // IsVisible provides a mock function with no fields | |||
| 642 | + | func (_m *MockProgressBarWidget) IsVisible() bool { | |||
| 643 | + | ret := _m.Called() | |||
| 644 | + | ||||
| 645 | + | if len(ret) == 0 { | |||
| 646 | + | panic("no return value specified for IsVisible") | |||
| 647 | + | } | |||
| 648 | + | ||||
| 649 | + | var r0 bool | |||
| 650 | + | if rf, ok := ret.Get(0).(func() bool); ok { | |||
| 651 | + | r0 = rf() | |||
| 652 | + | } else { | |||
| 653 | + | r0 = ret.Get(0).(bool) | |||
| 654 | + | } | |||
| 655 | + | ||||
| 656 | + | return r0 | |||
| 657 | + | } | |||
| 658 | + | ||||
| 659 | + | // MockProgressBarWidget_IsVisible_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'IsVisible' | |||
| 660 | + | type MockProgressBarWidget_IsVisible_Call struct { | |||
| 661 | + | *mock.Call | |||
| 662 | + | } | |||
| 663 | + | ||||
| 664 | + | // IsVisible is a helper method to define mock.On call | |||
| 665 | + | func (_e *MockProgressBarWidget_Expecter) IsVisible() *MockProgressBarWidget_IsVisible_Call { | |||
| 666 | + | return &MockProgressBarWidget_IsVisible_Call{Call: _e.mock.On("IsVisible")} | |||
| 667 | + | } | |||
| 668 | + | ||||
| 669 | + | func (_c *MockProgressBarWidget_IsVisible_Call) Run(run func()) *MockProgressBarWidget_IsVisible_Call { | |||
| 670 | + | _c.Call.Run(func(args mock.Arguments) { | |||
| 671 | + | run() | |||
| 672 | + | }) | |||
| 673 | + | return _c | |||
| 674 | + | } | |||
| 675 | + | ||||
| 676 | + | func (_c *MockProgressBarWidget_IsVisible_Call) Return(_a0 bool) *MockProgressBarWidget_IsVisible_Call { | |||
| 677 | + | _c.Call.Return(_a0) | |||
| 678 | + | return _c | |||
| 679 | + | } | |||
| 680 | + | ||||
| 681 | + | func (_c *MockProgressBarWidget_IsVisible_Call) RunAndReturn(run func() bool) *MockProgressBarWidget_IsVisible_Call { | |||
| 682 | + | _c.Call.Return(run) | |||
| 683 | + | return _c | |||
| 684 | + | } | |||
| 685 | + | ||||
| 686 | + | // RemoveCssClass provides a mock function with given fields: cssClass | |||
| 687 | + | func (_m *MockProgressBarWidget) RemoveCssClass(cssClass string) { | |||
| 688 | + | _m.Called(cssClass) | |||
| 689 | + | } | |||
| 690 | + | ||||
| 691 | + | // MockProgressBarWidget_RemoveCssClass_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'RemoveCssClass' | |||
| 692 | + | type MockProgressBarWidget_RemoveCssClass_Call struct { | |||
| 693 | + | *mock.Call | |||
| 694 | + | } | |||
| 695 | + | ||||
| 696 | + | // RemoveCssClass is a helper method to define mock.On call | |||
| 697 | + | // - cssClass string | |||
| 698 | + | func (_e *MockProgressBarWidget_Expecter) RemoveCssClass(cssClass interface{}) *MockProgressBarWidget_RemoveCssClass_Call { | |||
| 699 | + | return &MockProgressBarWidget_RemoveCssClass_Call{Call: _e.mock.On("RemoveCssClass", cssClass)} | |||
| 700 | + | } | |||
| 701 | + | ||||
| 702 | + | func (_c *MockProgressBarWidget_RemoveCssClass_Call) Run(run func(cssClass string)) *MockProgressBarWidget_RemoveCssClass_Call { | |||
| 703 | + | _c.Call.Run(func(args mock.Arguments) { | |||
| 704 | + | run(args[0].(string)) | |||
| 705 | + | }) | |||
| 706 | + | return _c | |||
| 707 | + | } | |||
| 708 | + | ||||
| 709 | + | func (_c *MockProgressBarWidget_RemoveCssClass_Call) Return() *MockProgressBarWidget_RemoveCssClass_Call { | |||
| 710 | + | _c.Call.Return() | |||
| 711 | + | return _c | |||
| 712 | + | } | |||
| 713 | + | ||||
| 714 | + | func (_c *MockProgressBarWidget_RemoveCssClass_Call) RunAndReturn(run func(string)) *MockProgressBarWidget_RemoveCssClass_Call { | |||
| 715 | + | _c.Run(run) | |||
| 716 | + | return _c | |||
| 717 | + | } | |||
| 718 | + | ||||
| 719 | + | // SetCanFocus provides a mock function with given fields: canFocus | |||
| 720 | + | func (_m *MockProgressBarWidget) SetCanFocus(canFocus bool) { | |||
| 721 | + | _m.Called(canFocus) | |||
| 722 | + | } | |||
| 723 | + | ||||
| 724 | + | // MockProgressBarWidget_SetCanFocus_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'SetCanFocus' | |||
| 725 | + | type MockProgressBarWidget_SetCanFocus_Call struct { | |||
| 726 | + | *mock.Call | |||
| 727 | + | } | |||
| 728 | + | ||||
| 729 | + | // SetCanFocus is a helper method to define mock.On call | |||
| 730 | + | // - canFocus bool | |||
| 731 | + | func (_e *MockProgressBarWidget_Expecter) SetCanFocus(canFocus interface{}) *MockProgressBarWidget_SetCanFocus_Call { | |||
| 732 | + | return &MockProgressBarWidget_SetCanFocus_Call{Call: _e.mock.On("SetCanFocus", canFocus)} | |||
| 733 | + | } | |||
| 734 | + | ||||
| 735 | + | func (_c *MockProgressBarWidget_SetCanFocus_Call) Run(run func(canFocus bool)) *MockProgressBarWidget_SetCanFocus_Call { | |||
| 736 | + | _c.Call.Run(func(args mock.Arguments) { | |||
| 737 | + | run(args[0].(bool)) | |||
| 738 | + | }) | |||
| 739 | + | return _c | |||
| 740 | + | } | |||
| 741 | + | ||||
| 742 | + | func (_c *MockProgressBarWidget_SetCanFocus_Call) Return() *MockProgressBarWidget_SetCanFocus_Call { | |||
| 743 | + | _c.Call.Return() | |||
| 744 | + | return _c | |||
| 745 | + | } | |||
| 746 | + | ||||
| 747 | + | func (_c *MockProgressBarWidget_SetCanFocus_Call) RunAndReturn(run func(bool)) *MockProgressBarWidget_SetCanFocus_Call { | |||
| 748 | + | _c.Run(run) | |||
| 749 | + | return _c | |||
| 750 | + | } | |||
| 751 | + | ||||
| 752 | + | // SetCanTarget provides a mock function with given fields: canTarget | |||
| 753 | + | func (_m *MockProgressBarWidget) SetCanTarget(canTarget bool) { | |||
| 754 | + | _m.Called(canTarget) | |||
| 755 | + | } | |||
| 756 | + | ||||
| 757 | + | // MockProgressBarWidget_SetCanTarget_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'SetCanTarget' | |||
| 758 | + | type MockProgressBarWidget_SetCanTarget_Call struct { | |||
| 759 | + | *mock.Call | |||
| 760 | + | } | |||
| 761 | + | ||||
| 762 | + | // SetCanTarget is a helper method to define mock.On call | |||
| 763 | + | // - canTarget bool | |||
| 764 | + | func (_e *MockProgressBarWidget_Expecter) SetCanTarget(canTarget interface{}) *MockProgressBarWidget_SetCanTarget_Call { | |||
| 765 | + | return &MockProgressBarWidget_SetCanTarget_Call{Call: _e.mock.On("SetCanTarget", canTarget)} | |||
| 766 | + | } | |||
| 767 | + | ||||
| 768 | + | func (_c *MockProgressBarWidget_SetCanTarget_Call) Run(run func(canTarget bool)) *MockProgressBarWidget_SetCanTarget_Call { | |||
| 769 | + | _c.Call.Run(func(args mock.Arguments) { | |||
| 770 | + | run(args[0].(bool)) | |||
| 771 | + | }) | |||
| 772 | + | return _c | |||
| 773 | + | } | |||
| 774 | + | ||||
| 775 | + | func (_c *MockProgressBarWidget_SetCanTarget_Call) Return() *MockProgressBarWidget_SetCanTarget_Call { | |||
| 776 | + | _c.Call.Return() | |||
| 777 | + | return _c | |||
| 778 | + | } | |||
| 779 | + | ||||
| 780 | + | func (_c *MockProgressBarWidget_SetCanTarget_Call) RunAndReturn(run func(bool)) *MockProgressBarWidget_SetCanTarget_Call { | |||
| 781 | + | _c.Run(run) | |||
| 782 | + | return _c | |||
| 783 | + | } | |||
| 784 | + | ||||
| 785 | + | // SetFocusOnClick provides a mock function with given fields: focusOnClick | |||
| 786 | + | func (_m *MockProgressBarWidget) SetFocusOnClick(focusOnClick bool) { | |||
| 787 | + | _m.Called(focusOnClick) | |||
| 788 | + | } | |||
| 789 | + | ||||
| 790 | + | // MockProgressBarWidget_SetFocusOnClick_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'SetFocusOnClick' | |||
| 791 | + | type MockProgressBarWidget_SetFocusOnClick_Call struct { | |||
| 792 | + | *mock.Call | |||
| 793 | + | } | |||
| 794 | + | ||||
| 795 | + | // SetFocusOnClick is a helper method to define mock.On call | |||
| 796 | + | // - focusOnClick bool | |||
| 797 | + | func (_e *MockProgressBarWidget_Expecter) SetFocusOnClick(focusOnClick interface{}) *MockProgressBarWidget_SetFocusOnClick_Call { | |||
| 798 | + | return &MockProgressBarWidget_SetFocusOnClick_Call{Call: _e.mock.On("SetFocusOnClick", focusOnClick)} | |||
| 799 | + | } | |||
| 800 | + | ||||
| 801 | + | func (_c *MockProgressBarWidget_SetFocusOnClick_Call) Run(run func(focusOnClick bool)) *MockProgressBarWidget_SetFocusOnClick_Call { | |||
| 802 | + | _c.Call.Run(func(args mock.Arguments) { | |||
| 803 | + | run(args[0].(bool)) | |||
| 804 | + | }) | |||
| 805 | + | return _c | |||
| 806 | + | } | |||
| 807 | + | ||||
| 808 | + | func (_c *MockProgressBarWidget_SetFocusOnClick_Call) Return() *MockProgressBarWidget_SetFocusOnClick_Call { | |||
| 809 | + | _c.Call.Return() | |||
| 810 | + | return _c | |||
| 811 | + | } | |||
| 812 | + | ||||
| 813 | + | func (_c *MockProgressBarWidget_SetFocusOnClick_Call) RunAndReturn(run func(bool)) *MockProgressBarWidget_SetFocusOnClick_Call { | |||
| 814 | + | _c.Run(run) | |||
| 815 | + | return _c | |||
| 816 | + | } | |||
| 817 | + | ||||
| 818 | + | // SetFraction provides a mock function with given fields: fraction | |||
| 819 | + | func (_m *MockProgressBarWidget) SetFraction(fraction float64) { | |||
| 820 | + | _m.Called(fraction) | |||
| 821 | + | } | |||
| 822 | + | ||||
| 823 | + | // MockProgressBarWidget_SetFraction_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'SetFraction' | |||
| 824 | + | type MockProgressBarWidget_SetFraction_Call struct { | |||
| 825 | + | *mock.Call | |||
| 826 | + | } | |||
| 827 | + | ||||
| 828 | + | // SetFraction is a helper method to define mock.On call | |||
| 829 | + | // - fraction float64 | |||
| 830 | + | func (_e *MockProgressBarWidget_Expecter) SetFraction(fraction interface{}) *MockProgressBarWidget_SetFraction_Call { | |||
| 831 | + | return &MockProgressBarWidget_SetFraction_Call{Call: _e.mock.On("SetFraction", fraction)} | |||
| 832 | + | } | |||
| 833 | + | ||||
| 834 | + | func (_c *MockProgressBarWidget_SetFraction_Call) Run(run func(fraction float64)) *MockProgressBarWidget_SetFraction_Call { | |||
| 835 | + | _c.Call.Run(func(args mock.Arguments) { | |||
| 836 | + | run(args[0].(float64)) | |||
| 837 | + | }) | |||
| 838 | + | return _c | |||
| 839 | + | } | |||
| 840 | + | ||||
| 841 | + | func (_c *MockProgressBarWidget_SetFraction_Call) Return() *MockProgressBarWidget_SetFraction_Call { | |||
| 842 | + | _c.Call.Return() | |||
| 843 | + | return _c | |||
| 844 | + | } | |||
| 845 | + | ||||
| 846 | + | func (_c *MockProgressBarWidget_SetFraction_Call) RunAndReturn(run func(float64)) *MockProgressBarWidget_SetFraction_Call { | |||
| 847 | + | _c.Run(run) | |||
| 848 | + | return _c | |||
| 849 | + | } | |||
| 850 | + | ||||
| 851 | + | // SetHalign provides a mock function with given fields: align | |||
| 852 | + | func (_m *MockProgressBarWidget) SetHalign(align gtk.Align) { | |||
| 853 | + | _m.Called(align) | |||
| 854 | + | } | |||
| 855 | + | ||||
| 856 | + | // MockProgressBarWidget_SetHalign_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'SetHalign' | |||
| 857 | + | type MockProgressBarWidget_SetHalign_Call struct { | |||
| 858 | + | *mock.Call | |||
| 859 | + | } | |||
| 860 | + | ||||
| 861 | + | // SetHalign is a helper method to define mock.On call | |||
| 862 | + | // - align gtk.Align | |||
| 863 | + | func (_e *MockProgressBarWidget_Expecter) SetHalign(align interface{}) *MockProgressBarWidget_SetHalign_Call { | |||
| 864 | + | return &MockProgressBarWidget_SetHalign_Call{Call: _e.mock.On("SetHalign", align)} | |||
| 865 | + | } | |||
| 866 | + | ||||
| 867 | + | func (_c *MockProgressBarWidget_SetHalign_Call) Run(run func(align gtk.Align)) *MockProgressBarWidget_SetHalign_Call { | |||
| 868 | + | _c.Call.Run(func(args mock.Arguments) { | |||
| 869 | + | run(args[0].(gtk.Align)) | |||
| 870 | + | }) | |||
| 871 | + | return _c | |||
| 872 | + | } | |||
| 873 | + | ||||
| 874 | + | func (_c *MockProgressBarWidget_SetHalign_Call) Return() *MockProgressBarWidget_SetHalign_Call { | |||
| 875 | + | _c.Call.Return() | |||
| 876 | + | return _c | |||
| 877 | + | } | |||
| 878 | + | ||||
| 879 | + | func (_c *MockProgressBarWidget_SetHalign_Call) RunAndReturn(run func(gtk.Align)) *MockProgressBarWidget_SetHalign_Call { | |||
| 880 | + | _c.Run(run) | |||
| 881 | + | return _c | |||
| 882 | + | } | |||
| 883 | + | ||||
| 884 | + | // SetHexpand provides a mock function with given fields: expand | |||
| 885 | + | func (_m *MockProgressBarWidget) SetHexpand(expand bool) { | |||
| 886 | + | _m.Called(expand) | |||
| 887 | + | } | |||
| 888 | + | ||||
| 889 | + | // MockProgressBarWidget_SetHexpand_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'SetHexpand' | |||
| 890 | + | type MockProgressBarWidget_SetHexpand_Call struct { | |||
| 891 | + | *mock.Call | |||
| 892 | + | } | |||
| 893 | + | ||||
| 894 | + | // SetHexpand is a helper method to define mock.On call | |||
| 895 | + | // - expand bool | |||
| 896 | + | func (_e *MockProgressBarWidget_Expecter) SetHexpand(expand interface{}) *MockProgressBarWidget_SetHexpand_Call { | |||
| 897 | + | return &MockProgressBarWidget_SetHexpand_Call{Call: _e.mock.On("SetHexpand", expand)} | |||
| 898 | + | } | |||
| 899 | + | ||||
| 900 | + | func (_c *MockProgressBarWidget_SetHexpand_Call) Run(run func(expand bool)) *MockProgressBarWidget_SetHexpand_Call { | |||
| 901 | + | _c.Call.Run(func(args mock.Arguments) { | |||
| 902 | + | run(args[0].(bool)) | |||
| 903 | + | }) | |||
| 904 | + | return _c | |||
| 905 | + | } | |||
| 906 | + | ||||
| 907 | + | func (_c *MockProgressBarWidget_SetHexpand_Call) Return() *MockProgressBarWidget_SetHexpand_Call { | |||
| 908 | + | _c.Call.Return() | |||
| 909 | + | return _c | |||
| 910 | + | } | |||
| 911 | + | ||||
| 912 | + | func (_c *MockProgressBarWidget_SetHexpand_Call) RunAndReturn(run func(bool)) *MockProgressBarWidget_SetHexpand_Call { | |||
| 913 | + | _c.Run(run) | |||
| 914 | + | return _c | |||
| 915 | + | } | |||
| 916 | + | ||||
| 917 | + | // SetSizeRequest provides a mock function with given fields: width, height | |||
| 918 | + | func (_m *MockProgressBarWidget) SetSizeRequest(width int, height int) { | |||
| 919 | + | _m.Called(width, height) | |||
| 920 | + | } | |||
| 921 | + | ||||
| 922 | + | // MockProgressBarWidget_SetSizeRequest_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'SetSizeRequest' | |||
| 923 | + | type MockProgressBarWidget_SetSizeRequest_Call struct { | |||
| 924 | + | *mock.Call | |||
| 925 | + | } | |||
| 926 | + | ||||
| 927 | + | // SetSizeRequest is a helper method to define mock.On call | |||
| 928 | + | // - width int | |||
| 929 | + | // - height int | |||
| 930 | + | func (_e *MockProgressBarWidget_Expecter) SetSizeRequest(width interface{}, height interface{}) *MockProgressBarWidget_SetSizeRequest_Call { | |||
| 931 | + | return &MockProgressBarWidget_SetSizeRequest_Call{Call: _e.mock.On("SetSizeRequest", width, height)} | |||
| 932 | + | } | |||
| 933 | + | ||||
| 934 | + | func (_c *MockProgressBarWidget_SetSizeRequest_Call) Run(run func(width int, height int)) *MockProgressBarWidget_SetSizeRequest_Call { | |||
| 935 | + | _c.Call.Run(func(args mock.Arguments) { | |||
| 936 | + | run(args[0].(int), args[1].(int)) | |||
| 937 | + | }) | |||
| 938 | + | return _c | |||
| 939 | + | } | |||
| 940 | + | ||||
| 941 | + | func (_c *MockProgressBarWidget_SetSizeRequest_Call) Return() *MockProgressBarWidget_SetSizeRequest_Call { | |||
| 942 | + | _c.Call.Return() | |||
| 943 | + | return _c | |||
| 944 | + | } | |||
| 945 | + | ||||
| 946 | + | func (_c *MockProgressBarWidget_SetSizeRequest_Call) RunAndReturn(run func(int, int)) *MockProgressBarWidget_SetSizeRequest_Call { | |||
| 947 | + | _c.Run(run) | |||
| 948 | + | return _c | |||
| 949 | + | } | |||
| 950 | + | ||||
| 951 | + | // SetValign provides a mock function with given fields: align | |||
| 952 | + | func (_m *MockProgressBarWidget) SetValign(align gtk.Align) { | |||
| 953 | + | _m.Called(align) | |||
| 954 | + | } | |||
| 955 | + | ||||
| 956 | + | // MockProgressBarWidget_SetValign_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'SetValign' | |||
| 957 | + | type MockProgressBarWidget_SetValign_Call struct { | |||
| 958 | + | *mock.Call | |||
| 959 | + | } | |||
| 960 | + | ||||
| 961 | + | // SetValign is a helper method to define mock.On call | |||
| 962 | + | // - align gtk.Align | |||
| 963 | + | func (_e *MockProgressBarWidget_Expecter) SetValign(align interface{}) *MockProgressBarWidget_SetValign_Call { | |||
| 964 | + | return &MockProgressBarWidget_SetValign_Call{Call: _e.mock.On("SetValign", align)} | |||
| 965 | + | } | |||
| 966 | + | ||||
| 967 | + | func (_c *MockProgressBarWidget_SetValign_Call) Run(run func(align gtk.Align)) *MockProgressBarWidget_SetValign_Call { | |||
| 968 | + | _c.Call.Run(func(args mock.Arguments) { | |||
| 969 | + | run(args[0].(gtk.Align)) | |||
| 970 | + | }) | |||
| 971 | + | return _c | |||
| 972 | + | } | |||
| 973 | + | ||||
| 974 | + | func (_c *MockProgressBarWidget_SetValign_Call) Return() *MockProgressBarWidget_SetValign_Call { | |||
| 975 | + | _c.Call.Return() | |||
| 976 | + | return _c | |||
| 977 | + | } | |||
| 978 | + | ||||
| 979 | + | func (_c *MockProgressBarWidget_SetValign_Call) RunAndReturn(run func(gtk.Align)) *MockProgressBarWidget_SetValign_Call { | |||
| 980 | + | _c.Run(run) | |||
| 981 | + | return _c | |||
| 982 | + | } | |||
| 983 | + | ||||
| 984 | + | // SetVexpand provides a mock function with given fields: expand | |||
| 985 | + | func (_m *MockProgressBarWidget) SetVexpand(expand bool) { | |||
| 986 | + | _m.Called(expand) | |||
| 987 | + | } | |||
| 988 | + | ||||
| 989 | + | // MockProgressBarWidget_SetVexpand_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'SetVexpand' | |||
| 990 | + | type MockProgressBarWidget_SetVexpand_Call struct { | |||
| 991 | + | *mock.Call | |||
| 992 | + | } | |||
| 993 | + | ||||
| 994 | + | // SetVexpand is a helper method to define mock.On call | |||
| 995 | + | // - expand bool | |||
| 996 | + | func (_e *MockProgressBarWidget_Expecter) SetVexpand(expand interface{}) *MockProgressBarWidget_SetVexpand_Call { | |||
| 997 | + | return &MockProgressBarWidget_SetVexpand_Call{Call: _e.mock.On("SetVexpand", expand)} | |||
| 998 | + | } | |||
| 999 | + | ||||
| 1000 | + | func (_c *MockProgressBarWidget_SetVexpand_Call) Run(run func(expand bool)) *MockProgressBarWidget_SetVexpand_Call { | |||
| 1001 | + | _c.Call.Run(func(args mock.Arguments) { | |||
| 1002 | + | run(args[0].(bool)) | |||
| 1003 | + | }) | |||
| 1004 | + | return _c | |||
| 1005 | + | } | |||
| 1006 | + | ||||
| 1007 | + | func (_c *MockProgressBarWidget_SetVexpand_Call) Return() *MockProgressBarWidget_SetVexpand_Call { | |||
| 1008 | + | _c.Call.Return() | |||
| 1009 | + | return _c | |||
| 1010 | + | } | |||
| 1011 | + | ||||
| 1012 | + | func (_c *MockProgressBarWidget_SetVexpand_Call) RunAndReturn(run func(bool)) *MockProgressBarWidget_SetVexpand_Call { | |||
| 1013 | + | _c.Run(run) | |||
| 1014 | + | return _c | |||
| 1015 | + | } | |||
| 1016 | + | ||||
| 1017 | + | // SetVisible provides a mock function with given fields: visible | |||
| 1018 | + | func (_m *MockProgressBarWidget) SetVisible(visible bool) { | |||
| 1019 | + | _m.Called(visible) | |||
| 1020 | + | } | |||
| 1021 | + | ||||
| 1022 | + | // MockProgressBarWidget_SetVisible_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'SetVisible' | |||
| 1023 | + | type MockProgressBarWidget_SetVisible_Call struct { | |||
| 1024 | + | *mock.Call | |||
| 1025 | + | } | |||
| 1026 | + | ||||
| 1027 | + | // SetVisible is a helper method to define mock.On call | |||
| 1028 | + | // - visible bool | |||
| 1029 | + | func (_e *MockProgressBarWidget_Expecter) SetVisible(visible interface{}) *MockProgressBarWidget_SetVisible_Call { | |||
| 1030 | + | return &MockProgressBarWidget_SetVisible_Call{Call: _e.mock.On("SetVisible", visible)} | |||
| 1031 | + | } | |||
| 1032 | + | ||||
| 1033 | + | func (_c *MockProgressBarWidget_SetVisible_Call) Run(run func(visible bool)) *MockProgressBarWidget_SetVisible_Call { | |||
| 1034 | + | _c.Call.Run(func(args mock.Arguments) { | |||
| 1035 | + | run(args[0].(bool)) | |||
| 1036 | + | }) | |||
| 1037 | + | return _c | |||
| 1038 | + | } | |||
| 1039 | + | ||||
| 1040 | + | func (_c *MockProgressBarWidget_SetVisible_Call) Return() *MockProgressBarWidget_SetVisible_Call { | |||
| 1041 | + | _c.Call.Return() | |||
| 1042 | + | return _c | |||
| 1043 | + | } | |||
| 1044 | + | ||||
| 1045 | + | func (_c *MockProgressBarWidget_SetVisible_Call) RunAndReturn(run func(bool)) *MockProgressBarWidget_SetVisible_Call { | |||
| 1046 | + | _c.Run(run) | |||
| 1047 | + | return _c | |||
| 1048 | + | } | |||
| 1049 | + | ||||
| 1050 | + | // Show provides a mock function with no fields | |||
| 1051 | + | func (_m *MockProgressBarWidget) Show() { | |||
| 1052 | + | _m.Called() | |||
| 1053 | + | } | |||
| 1054 | + | ||||
| 1055 | + | // MockProgressBarWidget_Show_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'Show' | |||
| 1056 | + | type MockProgressBarWidget_Show_Call struct { | |||
| 1057 | + | *mock.Call | |||
| 1058 | + | } | |||
| 1059 | + | ||||
| 1060 | + | // Show is a helper method to define mock.On call | |||
| 1061 | + | func (_e *MockProgressBarWidget_Expecter) Show() *MockProgressBarWidget_Show_Call { | |||
| 1062 | + | return &MockProgressBarWidget_Show_Call{Call: _e.mock.On("Show")} | |||
| 1063 | + | } | |||
| 1064 | + | ||||
| 1065 | + | func (_c *MockProgressBarWidget_Show_Call) Run(run func()) *MockProgressBarWidget_Show_Call { | |||
| 1066 | + | _c.Call.Run(func(args mock.Arguments) { | |||
| 1067 | + | run() | |||
| 1068 | + | }) | |||
| 1069 | + | return _c | |||
| 1070 | + | } | |||
| 1071 | + | ||||
| 1072 | + | func (_c *MockProgressBarWidget_Show_Call) Return() *MockProgressBarWidget_Show_Call { | |||
| 1073 | + | _c.Call.Return() | |||
| 1074 | + | return _c | |||
| 1075 | + | } | |||
| 1076 | + | ||||
| 1077 | + | func (_c *MockProgressBarWidget_Show_Call) RunAndReturn(run func()) *MockProgressBarWidget_Show_Call { | |||
| 1078 | + | _c.Run(run) | |||
| 1079 | + | return _c | |||
| 1080 | + | } | |||
| 1081 | + | ||||
| 1082 | + | // Unparent provides a mock function with no fields | |||
| 1083 | + | func (_m *MockProgressBarWidget) Unparent() { | |||
| 1084 | + | _m.Called() | |||
| 1085 | + | } | |||
| 1086 | + | ||||
| 1087 | + | // MockProgressBarWidget_Unparent_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'Unparent' | |||
| 1088 | + | type MockProgressBarWidget_Unparent_Call struct { | |||
| 1089 | + | *mock.Call | |||
| 1090 | + | } | |||
| 1091 | + | ||||
| 1092 | + | // Unparent is a helper method to define mock.On call | |||
| 1093 | + | func (_e *MockProgressBarWidget_Expecter) Unparent() *MockProgressBarWidget_Unparent_Call { | |||
| 1094 | + | return &MockProgressBarWidget_Unparent_Call{Call: _e.mock.On("Unparent")} | |||
| 1095 | + | } | |||
| 1096 | + | ||||
| 1097 | + | func (_c *MockProgressBarWidget_Unparent_Call) Run(run func()) *MockProgressBarWidget_Unparent_Call { | |||
| 1098 | + | _c.Call.Run(func(args mock.Arguments) { | |||
| 1099 | + | run() | |||
| 1100 | + | }) | |||
| 1101 | + | return _c | |||
| 1102 | + | } | |||
| 1103 | + | ||||
| 1104 | + | func (_c *MockProgressBarWidget_Unparent_Call) Return() *MockProgressBarWidget_Unparent_Call { | |||
| 1105 | + | _c.Call.Return() | |||
| 1106 | + | return _c | |||
| 1107 | + | } | |||
| 1108 | + | ||||
| 1109 | + | func (_c *MockProgressBarWidget_Unparent_Call) RunAndReturn(run func()) *MockProgressBarWidget_Unparent_Call { | |||
| 1110 | + | _c.Run(run) | |||
| 1111 | + | return _c | |||
| 1112 | + | } | |||
| 1113 | + | ||||
| 1114 | + | // NewMockProgressBarWidget creates a new instance of MockProgressBarWidget. It also registers a testing interface on the mock and a cleanup function to assert the mocks expectations. | |||
| 1115 | + | // The first argument is typically a *testing.T value. | |||
| 1116 | + | func NewMockProgressBarWidget(t interface { | |||
| 1117 | + | mock.TestingT | |||
| 1118 | + | Cleanup(func()) | |||
| 1119 | + | }) *MockProgressBarWidget { | |||
| 1120 | + | mock := &MockProgressBarWidget{} | |||
| 1121 | + | mock.Mock.Test(t) | |||
| 1122 | + | ||||
| 1123 | + | t.Cleanup(func() { mock.AssertExpectations(t) }) | |||
| 1124 | + | ||||
| 1125 | + | return mock | |||
| 1126 | + | } | |||
M internal/ui/layout/widgets.go +12 -0
| @@ -199,6 +199,17 @@ type ImageWidget interface { | |||
| 199 | 199 | Clear() | |
| 200 | 200 | } | |
| 201 | 201 | ||
| 202 | + | // ProgressBarWidget wraps gtk.ProgressBar for displaying loading progress. | |
| 203 | + | // Implementations may include smooth animation behavior. | |
| 204 | + | type ProgressBarWidget interface { | |
| 205 | + | Widget | |
| 206 | + | ||
| 207 | + | // SetFraction sets the progress value (0.0 to 1.0). | |
| 208 | + | SetFraction(fraction float64) | |
| 209 | + | // GetFraction returns the current progress value. | |
| 210 | + | GetFraction() float64 | |
| 211 | + | } | |
| 212 | + | ||
| 202 | 213 | // WidgetFactory creates widget instances. | |
| 203 | 214 | // This abstraction allows tests to inject mock factories. | |
| 204 | 215 | type WidgetFactory interface { | |
| @@ -211,6 +222,7 @@ type WidgetFactory interface { | |||
| 211 | 222 | NewLabel(text string) LabelWidget | |
| 212 | 223 | NewButton() ButtonWidget | |
| 213 | 224 | NewImage() ImageWidget | |
| 225 | + | NewProgressBar() ProgressBarWidget | |
| 214 | 226 | ||
| 215 | 227 | // Wrap existing GTK widget | |
| 216 | 228 | WrapWidget(w *gtk.Widget) Widget | |
| @@ -199,6 +199,17 @@ type ImageWidget interface { | |||||
| 199 | Clear() | 199 | Clear() | ||
| 200 | } | 200 | } | ||
| 201 | 201 | ||||
| 202 | + | // ProgressBarWidget wraps gtk.ProgressBar for displaying loading progress. | |||
| 203 | + | // Implementations may include smooth animation behavior. | |||
| 204 | + | type ProgressBarWidget interface { | |||
| 205 | + | Widget | |||
| 206 | + | ||||
| 207 | + | // SetFraction sets the progress value (0.0 to 1.0). | |||
| 208 | + | SetFraction(fraction float64) | |||
| 209 | + | // GetFraction returns the current progress value. | |||
| 210 | + | GetFraction() float64 | |||
| 211 | + | } | |||
| 212 | + | ||||
| 202 | // WidgetFactory creates widget instances. | 213 | // WidgetFactory creates widget instances. | ||
| 203 | // This abstraction allows tests to inject mock factories. | 214 | // This abstraction allows tests to inject mock factories. | ||
| 204 | type WidgetFactory interface { | 215 | type WidgetFactory interface { | ||
| @@ -211,6 +222,7 @@ type WidgetFactory interface { | |||||
| 211 | NewLabel(text string) LabelWidget | 222 | NewLabel(text string) LabelWidget | ||
| 212 | NewButton() ButtonWidget | 223 | NewButton() ButtonWidget | ||
| 213 | NewImage() ImageWidget | 224 | NewImage() ImageWidget | ||
| 225 | + | NewProgressBar() ProgressBarWidget | |||
| 214 | 226 | ||||
| 215 | // Wrap existing GTK widget | 227 | // Wrap existing GTK widget | ||
| 216 | WrapWidget(w *gtk.Widget) Widget | 228 | WrapWidget(w *gtk.Widget) Widget | ||