OSDN Git Service

Add Bluray support
[handbrake-jp/handbrake-jp-git.git] / gtk / src / settings.h
1 /*
2  * This program is free software; you can redistribute it and/or modify
3  * it under the terms of the GNU General Public License as published by
4  * the Free Software Foundation; either version 2 of the License, or
5  * (at your option) any later version.
6  * 
7  * This program is distributed in the hope that it will be useful,
8  * but WITHOUT ANY WARRANTY; without even the implied warranty of
9  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
10  * GNU Library General Public License for more details.
11  * 
12  * You should have received a copy of the GNU General Public License
13  * along with this program; if not, write to the Free Software
14  * Foundation, Inc., 51 Franklin Street, Fifth Floor Boston, MA 02110-1301,  USA
15  */
16 #if !defined(_SETTINGS_H_)
17 #define _SETTINGS_H_
18
19 #include <gtk/gtk.h>
20
21 #define GHB_WIDGET(b,n) GTK_WIDGET(gtk_builder_get_object ((b), (n)))
22 //#define GHB_WIDGET(b,n)       GTK_WIDGET(debug_get_object((b), (n)))
23 #define GHB_ACTION(b,n) GTK_ACTION(gtk_builder_get_object ((b), (n)))
24 #define GHB_OBJECT(b,n) gtk_builder_get_object ((b), (n))
25
26 GObject* debug_get_object(GtkBuilder *b, const gchar *n);
27
28 enum
29 {
30         GHB_STATE_IDLE          = 0x00,
31         GHB_STATE_SCANNING      = 0x02,
32         GHB_STATE_SCANDONE      = 0x04,
33         GHB_STATE_WORKING       = 0x08,
34         GHB_STATE_WORKDONE      = 0x10,
35         GHB_STATE_PAUSED        = 0x20,
36         GHB_STATE_MUXING        = 0x40,
37         GHB_STATE_SEARCHING     = 0x80,
38 };
39
40 enum
41 {
42         GHB_CANCEL_NONE,
43         GHB_CANCEL_ALL,
44         GHB_CANCEL_CURRENT,
45         GHB_CANCEL_FINISH
46 };
47
48 typedef struct preview_s preview_t;
49
50 typedef struct
51 {
52         gchar *current_dvd_device;
53         gboolean debug;
54         gboolean dont_clear_presets;
55         gboolean scale_busy;
56         gint cancel_encode;
57         GtkBuilder *builder;
58         GValue *settings;
59         GValue *queue;
60         GValue *current_job;
61         GIOChannel *activity_log;
62         GIOChannel *job_activity_log;
63         preview_t *preview;
64         gchar *appcast;
65         gint appcast_len;
66         GdkVisibilityState hb_visibility;
67 } signal_user_data_t;
68
69 enum
70 {
71         GHB_QUEUE_PENDING,
72         GHB_QUEUE_RUNNING,
73         GHB_QUEUE_CANCELED,
74         GHB_QUEUE_DONE,
75 };
76
77 GValue* ghb_settings_new(void);
78 void ghb_settings_take_value(
79         GValue *settings, const gchar *key, GValue *value);
80 void ghb_settings_set_value(
81         GValue *settings, const gchar *key, const GValue *value);
82 void ghb_settings_set_string(
83         GValue *settings, const gchar *key, const gchar *sval);
84 void ghb_settings_set_double(GValue *settings, const gchar *key, gdouble dval);
85 void ghb_settings_set_int64(GValue *settings, const gchar *key, gint64 ival);
86 void ghb_settings_set_int(GValue *settings, const gchar *key, gint ival);
87 void ghb_settings_set_boolean(
88         GValue *settings, const gchar *key, gboolean bval);
89 void ghb_settings_copy(
90         GValue *settings, const gchar *key, const GValue *value);
91 GValue* ghb_settings_get_value(const GValue *settings, const gchar *key);
92 gboolean ghb_settings_get_boolean(const GValue *settings, const gchar *key);
93 gint64 ghb_settings_get_int64(const GValue *settings, const gchar *key);
94 gint ghb_settings_get_int(const GValue *settings, const gchar *key);
95 gdouble ghb_settings_get_double(const GValue *settings, const gchar *key);
96 gchar* ghb_settings_get_string(const GValue *settings, const gchar *key);
97 gint ghb_settings_combo_int(const GValue *settings, const gchar *key);
98 gdouble ghb_settings_combo_double(const GValue *settings, const gchar *key);
99 const gchar* ghb_settings_combo_option(const GValue *settings, const gchar *key);
100 const gchar* ghb_settings_combo_string(const GValue *settings, const gchar *key);
101
102 GValue* ghb_widget_value(GtkWidget *widget);
103 gchar* ghb_widget_string(GtkWidget *widget);
104 gdouble ghb_widget_double(GtkWidget *widget);
105 gint64 ghb_widget_int64(GtkWidget *widget);
106 gint ghb_widget_int(GtkWidget *widget);
107 gint ghb_widget_boolean(GtkWidget *widget);
108
109 void ghb_widget_to_setting(GValue *settings, GtkWidget *widget);
110 int ghb_ui_update(
111         signal_user_data_t *ud, const gchar *name, const GValue *value);
112 const gchar* ghb_get_setting_key(GtkWidget *widget);
113
114 #endif // _SETTINGS_H_