1 /*
2  *      fm-terminal.h
3  *
4  *      Copyright 2012 Andriy Grytsenko (LStranger) <andrej@rep.kiev.ua>
5  *
6  *      This file is a part of the Libfm library.
7  *
8  *      This library is free software; you can redistribute it and/or
9  *      modify it under the terms of the GNU Lesser General Public
10  *      License as published by the Free Software Foundation; either
11  *      version 2.1 of the License, or (at your option) any later version.
12  *
13  *      This library is distributed in the hope that it will be useful,
14  *      but WITHOUT ANY WARRANTY; without even the implied warranty of
15  *      MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
16  *      Lesser General Public License for more details.
17  *
18  *      You should have received a copy of the GNU Lesser General Public
19  *      License along with this library; if not, write to the Free Software
20  *      Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA  02110-1301  USA
21  */
22 
23 #ifndef __FM_TERMINAL_H__
24 #define __FM_TERMINAL_H__
25 
26 #include <glib-object.h>
27 
28 G_BEGIN_DECLS
29 
30 #define FM_TERMINAL_TYPE               (fm_terminal_get_type())
31 #define FM_IS_TERMINAL(obj)            (G_TYPE_CHECK_INSTANCE_TYPE((obj), FM_TERMINAL_TYPE))
32 
33 typedef struct _FmTerminal              FmTerminal;
34 typedef struct _FmTerminalClass         FmTerminalClass;
35 
36 /**
37  * FmTerminal:
38  * @program: archiver program
39  * @open_arg: options to insert before &lt;cmd&gt; [&lt;args&gt;] to run command in terminal
40  * @noclose_arg: options to insert to run command without closing terminal or %NULL
41  * @launch: options if required to launch in current directory
42  * @desktop_id: desktop ID to search for icon and descriptions
43  * @custom_args: custom arguments (only from libfm.conf)
44  *
45  * A terminal description. If application should be ran in terminal libfm
46  * may do it either default way (closing terminal window after exit):
47  * - @program @custom_args @open_arg &lt;cmd&gt; [&lt;args&gt;]
48  *
49  * or alternate way (not closing terminal window after exit):
50  * - @program @custom_args @noclose_arg &lt;cmd&gt; [&lt;args&gt;]
51  *
52  * If terminal doesn't support not closing terminal window after exit then
53  * default way should be used.
54  */
55 struct _FmTerminal
56 {
57     /*< private >*/
58     GObject parent;
59     /*< public >*/
60     char* program;
61     char* open_arg;
62     char* noclose_arg;
63     char* launch;
64     char* desktop_id;
65     char* custom_args;
66     /*< private >*/
67     gpointer _reserved1;
68     gpointer _reserved2;
69 };
70 
71 GType fm_terminal_get_type(void);
72 
73 void _fm_terminal_init(void);
74 void _fm_terminal_finalize(void);
75 
76 FmTerminal* fm_terminal_dup_default(GError **error);
77 gboolean fm_terminal_launch(const gchar *dir, GError **error);
78 
79 G_END_DECLS
80 
81 #endif /* __FM_TERMINAL_H__ */
82