libxputty 0.1
Loading...
Searching...
No Matches
xfile-dialog.h
Go to the documentation of this file.
1/*
2 * 0BSD
3 *
4 * BSD Zero Clause License
5 *
6 * Copyright (c) 2019 Hermann Meyer
7 *
8 * Permission to use, copy, modify, and/or distribute this software for any
9 * purpose with or without fee is hereby granted.
10
11 * THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES WITH
12 * REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY
13 * AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT,
14 * INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM
15 * LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR
16 * OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
17 * PERFORMANCE OF THIS SOFTWARE.
18 *
19 */
20
21#pragma once
22
23#ifndef XFILE_DIALOG_H_
24#define XFILE_DIALOG_H_
25
26#include "xwidgets.h"
27#ifdef __linux__
28#include "xdgmime.h"
29#endif
30#include "xasprintf.h"
31#include "xfilepicker.h"
32
33#ifdef __cplusplus
34extern "C" {
35#endif
36
60
61typedef struct {
63 char *last_path;
64 const char *path;
65 const char *filter;
67 char pad[7];
69
70Widget_t *open_directory_dialog(Widget_t *w, const char *path);
71
80Widget_t *open_file_dialog(Widget_t *w, const char *path, const char *filter);
81
90Widget_t *save_file_dialog(Widget_t *w, const char *path, const char *filter);
91
98Widget_t *add_file_button(Widget_t *parent, int x, int y, int width, int height,
99 const char *path, const char *filter);
100
107Widget_t *add_save_file_button(Widget_t *parent, int x, int y, int width, int height,
108 const char *path, const char *filter);
109
110#ifdef __cplusplus
111}
112#endif
113
114#endif //XFILE_DIALOG_H_
const char * path
Widget_t * w
char * last_path
const char * filter
const char * home_dir
Widget_t * ft
Widget_t * w_quit
FilePicker * fp
bool send_clear_func
Widget_t * sel_dir
Widget_t * ct
Widget_t * w
unsigned int xdg_dir_counter
Widget_t * scale_size
Widget_t * w_okay
Widget_t * view
Widget_t * text_entry
char ** xdg_user_dirs
char ** xdg_user_dirs_path
Widget_t * xdg_dirs
Widget_t * w_hidden
Widget_t * set_filter
Widget_t * parent
Widget_t - struct to hold the basic Widget_t info.
Definition xwidget.h:457
Multiplatform implementation of asprintf() from: https://stackoverflow.com/questions/40159892/using-a...
Widget_t * save_file_dialog(Widget_t *w, const char *path, const char *filter)
save_file_dialog - open a non blocking dialog window, to select a file. The path to open the file-sel...
Widget_t * open_directory_dialog(Widget_t *w, const char *path)
Widget_t * add_file_button(Widget_t *parent, int x, int y, int width, int height, const char *path, const char *filter)
add_file_button - add a pre-defined button which will pop-up a file dialog when pressed....
Widget_t * open_file_dialog(Widget_t *w, const char *path, const char *filter)
open_file_dialog - open a non blocking dialog window, to select a file. The path to open the file-sel...
Widget_t * add_save_file_button(Widget_t *parent, int x, int y, int width, int height, const char *path, const char *filter)
add_save_file_button - add a pre-defined button which will pop-up a file dialog when pressed....
xwidgets.h include some predefined widgets for libxputty, include this to use them if you would only ...