Zrythm
a highly automated and intuitive digital audio workstation
Loading...
Searching...
No Matches
file_chooser_button.h
1// SPDX-FileCopyrightText: © 2021-2022 Alexandros Theodotou <alex@zrythm.org>
2// SPDX-License-Identifier: LicenseRef-ZrythmLicense
3
4#ifndef __GUI_WIDGETS_FILE_CHOOSER_BUTTON_H__
5#define __GUI_WIDGETS_FILE_CHOOSER_BUTTON_H__
6
7#include "gtk_wrapper.h"
8
9#define FILE_CHOOSER_BUTTON_WIDGET_TYPE (file_chooser_button_widget_get_type ())
10G_DECLARE_FINAL_TYPE (
11 FileChooserButtonWidget,
12 file_chooser_button_widget,
13 Z,
14 FILE_CHOOSER_BUTTON_WIDGET,
15 GtkBox)
16
17
23typedef struct _FileChooserButtonWidget
24{
25 GtkBox parent_instance;
26
27 GtkButton * button;
28
29 /* TODO free */
30 char * title;
31
32 char * current_dir;
33 char * path;
34
35 GtkFileChooserAction action;
36 GtkWindow * parent;
37
38 GCallback response_cb;
39 gpointer user_data;
40 GClosureNotify destroy_notify;
41
42 // GtkFileChooserNative * file_chooser_native;
43} FileChooserButtonWidget;
44
45void
46file_chooser_button_widget_setup (
47 FileChooserButtonWidget * self,
48 GtkWindow * parent,
49 const char * title,
50 GtkFileChooserAction action);
51
56void
58 FileChooserButtonWidget * self,
59 GtkNativeDialog * dialog,
60 gint response_id);
61
62void
63file_chooser_button_widget_set_response_callback (
64 FileChooserButtonWidget * self,
65 GCallback callback,
66 gpointer user_data,
67 GClosureNotify destroy_notify);
68
69void
70file_chooser_button_widget_set_current_dir (
71 FileChooserButtonWidget * self,
72 const char * dir);
73
74void
75file_chooser_button_widget_set_path (
76 FileChooserButtonWidget * self,
77 const char * path);
78
79FileChooserButtonWidget *
80file_chooser_button_widget_new (
81 GtkWindow * parent,
82 const char * title,
83 GtkFileChooserAction action);
84
85#if 0
86GtkFileChooser *
87file_chooser_button_widget_get_file_chooser (
88 FileChooserButtonWidget * self);
89#endif
90
95#endif
void file_chooser_button_widget_std_response(FileChooserButtonWidget *self, GtkNativeDialog *dialog, gint response_id)
This must be called at the end of the user-provided response callback.