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 <stdbool.h>
14
15#include <adwaita.h>
16
17#define GENERIC_PROGRESS_DIALOG_WIDGET_TYPE \
18 (generic_progress_dialog_widget_get_type ())
19G_DECLARE_DERIVABLE_TYPE (
20 GenericProgressDialogWidget,
21 generic_progress_dialog_widget,
22 Z,
23 GENERIC_PROGRESS_DIALOG_WIDGET,
24 AdwAlertDialog)
25
26typedef struct ProgressInfo ProgressInfo;
27
35{
36 char response[200];
37
42
45
47 void * cb_obj;
49
53typedef struct
54{
55 GtkProgressBar * progress_bar;
56
63
70
71 ProgressInfo * progress_info;
72
76 GenericProgressDialogButton extra_buttons[10];
77 size_t num_extra_buttons;
78
81
84
86
87typedef struct _GenericProgressDialogWidgetClass
88{
89 AdwAlertDialogClass parent_class;
91
95void
97 GenericProgressDialogWidget * self,
98 const char * title,
99 ProgressInfo * progress_info,
100 const char * initial_label,
101 bool autoclose,
102 GenericCallback close_callback,
103 void * close_callback_object,
104 bool cancelable);
105
109void
111 GenericProgressDialogWidget * self,
112 const char * response,
113 const char * response_label,
114 GenericCallback callback,
115 void * callback_object,
116 bool only_on_finish);
117
118GenericProgressDialogWidget *
119generic_progress_dialog_widget_new (void);
120
125#endif
void(* GenericCallback)(void *object)
Generic callback.
Definition types.h:99
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.