summaryrefslogtreecommitdiffstats
path: root/docs/reference/pygio-applaunchcontext.xml
blob: 66bb229ff092196ada5941a985da63146223478f (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
<?xml version="1.0" standalone="no"?>
<!DOCTYPE refentry PUBLIC "-//OASIS//DTD DocBook XML V4.1.2//EN"
    "http://www.oasis-open.org/docbook/xml/4.1.2/docbookx.dtd">

<refentry id="class-gioapplaunchcontext">
    <refnamediv>
        <refname>gio.AppLaunchContext</refname>
        <refpurpose>Application launch context.</refpurpose>
    </refnamediv>

    <refsect1>
        <title>Synopsis</title>

    <classsynopsis language="python">
        <ooclass><classname>gio.AppLaunchContext</classname></ooclass>
        <ooclass><classname><link linkend="class-gobject">gobject.GObject</link></classname></ooclass>
    
    <constructorsynopsis language="python">
	<methodname><link linkend="constructor-gioapplaunchcontext">gio.AppLaunchContext</link></methodname>
	<methodparam></methodparam>
    </constructorsynopsis>
    
    <methodsynopsis language="python">
        <methodname><link linkend="method-gioapplaunchcontext--get-display">get_display</link></methodname>
        <methodparam><parameter role="keyword">info</parameter></methodparam>
        <methodparam><parameter role="keyword">files</parameter></methodparam>
    </methodsynopsis>
    <methodsynopsis language="python">
        <methodname><link linkend="method-gioapplaunchcontext--get-startup-notify-id">get_startup_notify_id</link></methodname>
        <methodparam><parameter role="keyword">info</parameter></methodparam>
        <methodparam><parameter role="keyword">files</parameter></methodparam>
    </methodsynopsis>
    <methodsynopsis language="python">
        <methodname><link linkend="method-gioapplaunchcontext--launch-failed">launch_failed</link></methodname>
        <methodparam><parameter role="keyword">startup_notify_id</parameter></methodparam>
    </methodsynopsis>
    
    </classsynopsis>
    </refsect1>

    <refsect1>
        <title>Ancestry</title>

<synopsis>+-- <link linkend="class-gobject">gobject.GObject</link>
  +-- <link linkend="class-gioapplaunchcontext">gio.AppLaunchContext</link>
</synopsis>

    </refsect1>

    <refsect1>
        <title>Description</title>

        <para>
            The <link linkend="class-gioapplaunchcontext"><classname>gio.AppLaunchContext</classname></link>
            is used for integrating the launch with the launching application. This is used to handle for
            instance startup notification and launching the new application on the same screen as the launching window.
        </para>
    </refsect1>

    <refsect1 id="constructor-gioapplaunchcontext">
        <title>Constructor</title>
  
        <programlisting><constructorsynopsis language="python">
            <methodname>gio.AppLaunchContext</methodname>
            <methodparam></methodparam>
        </constructorsynopsis></programlisting>
        <variablelist>
            <varlistentry>
                <term><emphasis>Returns</emphasis>&nbsp;:</term>
                <listitem><simpara>a new
                <link linkend="class-gioapplaunchcontext"><classname>gio.AppLaunchContext</classname></link>.
                </simpara></listitem>
            </varlistentry>
        </variablelist>
    
        <para>
            Creates a new application launch context. This is not normally used, instead
            you instantiate a subclass of this, such as
            <link linkend="class-gdkapplaunchcontext"><classname>gtk.gdk.AppLaunchContext</classname></link>.
        </para>
  
    </refsect1>

    <refsect1>
        <title>Methods</title>

        <refsect2 id="method-gioapplaunchcontext--get-display">
            <title>gio.AppLaunchContext.get_display</title>

            <programlisting><methodsynopsis language="python">
                <methodname>get_display</methodname>
                <methodparam><parameter role="keyword">info</parameter></methodparam>
                <methodparam><parameter role="keyword">files</parameter></methodparam>
            </methodsynopsis></programlisting>
            
            <variablelist>
                <varlistentry>
                    <term><parameter>info</parameter>&nbsp;:</term>
                    <listitem><simpara>a
                    <link linkend="class-gioappinfo"><classname>gio.AppInfo</classname></link>
                    </simpara></listitem>
                </varlistentry>
                <varlistentry>
                    <term><parameter>files</parameter>&nbsp;:</term>
                    <listitem><simpara>a list of
                    <link linkend="class-giofile"><classname>gio.File</classname></link>
                    objects.</simpara></listitem>
                </varlistentry>
                <varlistentry>
                    <term><emphasis>Returns</emphasis>&nbsp;:</term>
                    <listitem><simpara>a display string for the display. 
                    </simpara></listitem>
                </varlistentry>
            </variablelist>
    
            <para>
                The <methodname>get_display</methodname>() method gets the display
                string for the display. This is used to ensure new applications
                are started on the same display as the launching application.
            </para>
        </refsect2>

        <refsect2 id="method-gioapplaunchcontext--get-startup-notify-id">
            <title>gio.AppLaunchContext.get_startup_notify_id</title>

            <programlisting><methodsynopsis language="python">
                <methodname>get_startup_notify_id</methodname>
                <methodparam><parameter role="keyword">info</parameter></methodparam>
                <methodparam><parameter role="keyword">files</parameter></methodparam>
            </methodsynopsis></programlisting>
            
            <variablelist>
                <varlistentry>
                    <term><parameter>info</parameter>&nbsp;:</term>
                    <listitem><simpara>a
                    <link linkend="class-gioappinfo"><classname>gio.AppInfo</classname></link>
                    </simpara></listitem>
                </varlistentry>
                <varlistentry>
                    <term><parameter>files</parameter>&nbsp;:</term>
                    <listitem><simpara>a list of
                    <link linkend="class-giofile"><classname>gio.File</classname></link>
                    objects.</simpara></listitem>
                </varlistentry>
                <varlistentry>
                    <term><emphasis>Returns</emphasis>&nbsp;:</term>
                    <listitem><simpara>a startup notification ID for the application,
                    or <literal>None</literal> if not supported. 
                    </simpara></listitem>
                </varlistentry>
            </variablelist>
    
            <para>
                The <methodname>get_startup_notify_id</methodname>() method initiates
                startup notification for the application and returns the DESKTOP_STARTUP_ID
                for the launched operation, if supported. 
            </para>
            <para>
                Startup notification IDs are defined in the FreeDesktop.Org Startup Notifications standard.
            </para>
        </refsect2>

        <refsect2 id="method-gioapplaunchcontext--launch-failed">
            <title>gio.AppLaunchContext.launch_failed</title>

            <programlisting><methodsynopsis language="python">
                <methodname>launch_failed</methodname>
                <methodparam><parameter role="keyword">startup_notify_id</parameter></methodparam>
            </methodsynopsis></programlisting>
            
            <variablelist>
                <varlistentry>
                    <term><parameter>startup_notify_id</parameter>&nbsp;:</term>
                    <listitem><simpara>the startup notification id that was returned by
                    <methodname><link linkend="method-gioapplaunchcontext--get-startup-notify-id">get_startup_notify_id</link></methodname>.
                    </simpara></listitem>
                </varlistentry>
                <varlistentry>
                    <term><emphasis>Returns</emphasis>&nbsp;:</term>
                    <listitem><simpara>a startup notification ID for the application,
                    or <literal>None</literal> if not supported. 
                    </simpara></listitem>
                </varlistentry>
            </variablelist>
    
            <para>
                The <methodname>get_startup_notify_id</methodname>() method is called
                when an application has failed to launch, so that it can cancel the application
                startup notification started in
                <methodname><link linkend="method-gioapplaunchcontext--get-startup-notify-id">get_startup_notify_id</link></methodname>
            </para>
        </refsect2>
    </refsect1>
</refentry>