]>
glassweightruler.freedombox.rocks Git - Ventoy.git/blob - LinuxGUI/Ventoy2Disk/GTK/ventoy_gtk.h
1 /******************************************************************************
4 * Copyright (c) 2021, longpanda <admin@ventoy.net>
6 * This program is free software; you can redistribute it and/or
7 * modify it under the terms of the GNU General Public License as
8 * published by the Free Software Foundation; either version 3 of the
9 * License, or (at your option) any later version.
11 * This program is distributed in the hope that it will be useful, but
12 * WITHOUT ANY WARRANTY; without even the implied warranty of
13 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
14 * General Public License for more details.
16 * You should have received a copy of the GNU General Public License
17 * along with this program; if not, see <http://www.gnu.org/licenses/>.
20 #ifndef __VENTOY_GTK_H__
21 #define __VENTOY_GTK_H__
23 int ventoy_disk_init(void);
24 void ventoy_disk_exit(void);
25 int ventoy_http_init(void);
26 void ventoy_http_exit(void);
27 int ventoy_log_init(void);
28 void ventoy_log_exit(void);
29 void *get_refresh_icon_raw_data(int *len
);
30 void *get_secure_icon_raw_data(int *len
);
31 void *get_window_icon_raw_data(int *len
);
32 int ventoy_func_handler(const char *jsonstr
, char *jsonbuf
, int buflen
);
33 const char * ventoy_code_get_cur_language(void);
34 int ventoy_code_get_cur_part_style(void);
35 void ventoy_code_set_cur_part_style(int style
);
36 int ventoy_code_get_cur_show_all(void);
37 void ventoy_code_set_cur_show_all(int show_all
);
38 void ventoy_code_set_cur_language(const char *lang
);
39 void ventoy_code_save_cfg(void);
40 void on_init_window(GtkBuilder
*pBuilder
);
41 int on_exit_window(GtkWidget
*widget
, gpointer data
) ;
42 void ventoy_code_refresh_device(void);
43 int ventoy_code_is_busy(void);
44 int ventoy_code_get_percent(void);
45 int ventoy_code_get_result(void);
46 int msgbox(GtkMessageType type
, GtkButtonsType buttons
, const char *strid
);
48 #define VTOY_VER_FMT "<span weight='bold' foreground='red' size='xx-large'>%s</span>"
50 #define LANG_LABEL_TEXT(id, str) \
51 gtk_label_set_text(BUILDER_ITEM(GtkLabel, id), vtoy_json_get_string_ex(node->pstChild, str))
53 #define LANG_BUTTON_TEXT(id, str) \
54 gtk_button_set_label(BUILDER_ITEM(GtkButton, id), vtoy_json_get_string_ex(node->pstChild, str))
56 #define LANG_MENU_ITEM_TEXT(id, str) \
57 gtk_menu_item_set_label(BUILDER_ITEM(GtkMenuItem, id), vtoy_json_get_string_ex(node->pstChild, str))
59 #define LANG_CHKBTN_TEXT(id, str) \
60 gtk_check_button_set_label(BUILDER_ITEM(GtkCheckButton, id), vtoy_json_get_string_ex(node->pstChild, str))
62 #define BUILDER_ITEM(type, id) (type *)gtk_builder_get_object(g_pXmlBuilder, id)
64 #define SIGNAL(id, act, func) \
65 g_signal_connect(gtk_builder_get_object(g_pXmlBuilder, id), act, G_CALLBACK(func), NULL)
67 #define GTK_MSG_ITERATION() while (gtk_events_pending ()) gtk_main_iteration()
69 #endif /* __VENTOY_GTK_H__ */