4
4
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
5
5
<title>McpRequestPolicy</title>
6
<meta name="generator" content="DocBook XSL Stylesheets V1.76.1">
6
<meta name="generator" content="DocBook XSL Stylesheets V1.75.2">
7
7
<link rel="home" href="index.html" title="Mission Control Plugins Reference Manual">
8
8
<link rel="up" href="ch03.html" title="Channel requests">
9
9
<link rel="prev" href="ch03.html" title="Channel requests">
72
72
<div class="example">
73
<a name="idp10246528"></a><p class="title"><b>Example 2. </b></p>
74
<div class="example-contents">
75
<table class="listing_frame" border="0" cellpadding="0" cellspacing="0">
78
<td class="listing_lines" align="right"><pre>1
91
<td class="listing_code"><pre class="programlisting"><span class="function"><a href="http://library.gnome.org/devel/gobject/unstable/gobject-Type-Information.html#G-DEFINE-TYPE-WITH-CODE:CAPS">G_DEFINE_TYPE_WITH_CODE</a></span> <span class="gtkdoc opt">(</span>MyPlugin<span class="gtkdoc opt">,</span> my_plugin<span class="gtkdoc opt">,</span>
92
G_TYPE_OBJECT<span class="gtkdoc opt">,</span>
93
<span class="function"><a href="http://library.gnome.org/devel/gobject/unstable/gobject-Type-Information.html#G-IMPLEMENT-INTERFACE:CAPS">G_IMPLEMENT_INTERFACE</a></span> <span class="gtkdoc opt">(...);</span>
94
<span class="function"><a href="http://library.gnome.org/devel/gobject/unstable/gobject-Type-Information.html#G-IMPLEMENT-INTERFACE:CAPS">G_IMPLEMENT_INTERFACE</a></span> <span class="gtkdoc opt">(</span>MCP_TYPE_REQUEST_POLICY<span class="gtkdoc opt">,</span>
95
request_policy_iface_init<span class="gtkdoc opt">);</span>
96
<span class="function"><a href="http://library.gnome.org/devel/gobject/unstable/gobject-Type-Information.html#G-IMPLEMENT-INTERFACE:CAPS">G_IMPLEMENT_INTERFACE</a></span> <span class="gtkdoc opt">(...))</span>
97
<span class="comment">/* ... */</span>
98
<span class="gtkdoc kwb">static void</span>
99
<span class="function">request_policy_iface_init</span> <span class="gtkdoc opt">(</span>McpRequestPolicyIface <span class="gtkdoc opt">*</span>iface<span class="gtkdoc opt">,</span>
100
gpointer unused G_GNUC_UNUSED<span class="gtkdoc opt">)</span>
101
<span class="gtkdoc opt">{</span>
102
iface<span class="gtkdoc opt">-></span>check <span class="gtkdoc opt">=</span> my_plugin_check_request<span class="gtkdoc opt">;</span>
103
<span class="gtkdoc opt">}</span></pre></td>
73
<a name="idp7231808"></a><p class="title"><b>Example 2. </b></p>
74
<div class="example-contents"><pre class="programlisting">
75
G_DEFINE_TYPE_WITH_CODE (MyPlugin, my_plugin,
77
G_IMPLEMENT_INTERFACE (...);
78
G_IMPLEMENT_INTERFACE (MCP_TYPE_REQUEST_POLICY,
79
request_policy_iface_init);
80
G_IMPLEMENT_INTERFACE (...))
83
request_policy_iface_init (McpRequestPolicyIface *iface,
84
gpointer unused G_GNUC_UNUSED)
86
iface->check = my_plugin_check_request;
110
90
<p><br class="example-break">