Zrythm
a highly automated and intuitive digital audio workstation
Loading...
Searching...
No Matches
generic_progress_dialog.h
Go to the documentation of this file.
1// SPDX-FileCopyrightText: © 2019-2022 Alexandros Theodotou <alex@zrythm.org>
2// SPDX-License-Identifier: LicenseRef-ZrythmLicense
3
10#ifndef __GUI_WIDGETS_GENERIC_PROGRESS_DIALOG_H__
11#define __GUI_WIDGETS_GENERIC_PROGRESS_DIALOG_H__
12
13#include <adwaita.h>
14
15#define GENERIC_PROGRESS_DIALOG_WIDGET_TYPE \
16 (generic_progress_dialog_widget_get_type ())
17G_DECLARE_DERIVABLE_TYPE (
18 GenericProgressDialogWidget,
19 generic_progress_dialog_widget,
20 Z,
21 GENERIC_PROGRESS_DIALOG_WIDGET,
22 AdwAlertDialog)
23
24typedef struct ProgressInfo ProgressInfo;
25
33{
34 char response[200];
35
40
43
45 void * cb_obj;
47
51typedef struct
52{
53 GtkProgressBar * progress_bar;
54
61
68
69 ProgressInfo * progress_info;
70
74 GenericProgressDialogButton extra_buttons[10];
75 size_t num_extra_buttons;
76
79
82
84
85typedef struct _GenericProgressDialogWidgetClass
86{
87 AdwAlertDialogClass parent_class;
89
93void
95 GenericProgressDialogWidget * self,
96 const char * title,
97 ProgressInfo * progress_info,
98 const char * initial_label,
99 bool autoclose,
100 GenericCallback close_callback,
101 void * close_callback_object,
102 bool cancelable);
103
107void
109 GenericProgressDialogWidget * self,
110 const char * response,
111 const char * response_label,
112 GenericCallback callback,
113 void * callback_object,
114 bool only_on_finish);
115
116GenericProgressDialogWidget *
117generic_progress_dialog_widget_new (void);
118
123#endif
void(* GenericCallback)(void *object)
Generic callback.
Definition types.h:103
void generic_progress_dialog_widget_setup(GenericProgressDialogWidget *self, const char *title, ProgressInfo *progress_info, const char *initial_label, bool autoclose, GenericCallback close_callback, void *close_callback_object, bool cancelable)
Sets up a progress dialog widget.
void generic_progress_dialog_add_response(GenericProgressDialogWidget *self, const char *response, const char *response_label, GenericCallback callback, void *callback_object, bool only_on_finish)
Adds a response to the dialog.
bool only_on_finish
Only show the button when the action is finished.
GenericCallback cb
Callback when this response is made.
bool autoclose
Whether to automatically close the progress dialog when finished.
bool cancelable
Whether to allow canceling the action.
GenericCallback close_cb
Optional callback when autoclose is requested.