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 195 196 197 198 199 200 201 202 203 204 205 206 207 208 209 210 211 212 213 214 215 216 217 218 219 220 221 222 223 224 225 226 227 228 229 230 231 232 233 234 235 236 237 238 239 240 241 242 243 244 245 246 247 248 249 250 251 252 253 254 255 256 257 258 259 260 261 262 263 264 265 266 267 268 269 270 271 272 273 274 275 276 277 278 279 280 281 282 283 284 285 286 287 288 289 290 291 292 293 294 295 296 297 298 299 300 301 302 303 304 305 306 307 308 309 310 311 312 313 314 315 316 317 318 319 320 321 322 323 324 325 326 327 328 329 330 331 332 333 334 335 336 337 338 339 340 341 342 343 344 345 346 347 348 349 350 351 352 353 354 355 356 357 358 359 360 361 362 363 364 365 366 367 368 369 370 371 372 373 374 375 376 377 378 379 380 381 382 383 384 385 386 387 388 389 390 391 392 393 394 395 396 397 398 399 400
|
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<title>GwyResourceEditor: Gwyddion Application Library Reference Manual</title>
<meta name="generator" content="DocBook XSL Stylesheets Vsnapshot">
<link rel="home" href="index.html" title="Gwyddion Application Library Reference Manual">
<link rel="up" href="libgwyapp-main-app.html" title="Main Program">
<link rel="prev" href="libgwyapp-funcuse.html" title="funcuse">
<link rel="next" href="libgwyapp-GwyGLMaterialEditor.html" title="GwyGLMaterialEditor">
<meta name="generator" content="GTK-Doc V1.19 (XML mode)">
<link rel="stylesheet" href="style.css" type="text/css">
</head>
<body bgcolor="white" text="black" link="#0000FF" vlink="#840084" alink="#0000FF">
<table class="navigation" id="top" width="100%" summary="Navigation header" cellpadding="2" cellspacing="5"><tr valign="middle">
<td width="100%" align="left" class="shortcuts">
<a href="#" class="shortcut">Top</a><span id="nav_description"> <span class="dim">|</span>
<a href="#GwyResourceEditor.description" class="shortcut">Description</a></span><span id="nav_hierarchy"> <span class="dim">|</span>
<a href="#GwyResourceEditor.object-hierarchy" class="shortcut">Object Hierarchy</a></span><span id="nav_interfaces"> <span class="dim">|</span>
<a href="#GwyResourceEditor.implemented-interfaces" class="shortcut">Implemented Interfaces</a></span>
</td>
<td><a accesskey="h" href="index.html"><img src="home.png" width="16" height="16" border="0" alt="Home"></a></td>
<td><a accesskey="u" href="libgwyapp-main-app.html"><img src="up.png" width="16" height="16" border="0" alt="Up"></a></td>
<td><a accesskey="p" href="libgwyapp-funcuse.html"><img src="left.png" width="16" height="16" border="0" alt="Prev"></a></td>
<td><a accesskey="n" href="libgwyapp-GwyGLMaterialEditor.html"><img src="right.png" width="16" height="16" border="0" alt="Next"></a></td>
</tr></table>
<div class="refentry">
<a name="GwyResourceEditor"></a><div class="titlepage"></div>
<div class="refnamediv"><table width="100%"><tr>
<td valign="top">
<h2><span class="refentrytitle"><a name="GwyResourceEditor.top_of_page"></a>GwyResourceEditor</span></h2>
<p>GwyResourceEditor — Base/helper class for resource editors</p>
</td>
<td class="gallery_image" valign="top" align="right"></td>
</tr></table></div>
<div class="refsect1">
<a name="GwyResourceEditor.functions"></a><h2>Functions</h2>
<div class="informaltable"><table class="informaltable" width="100%" border="0">
<colgroup>
<col width="150px" class="functions_proto_type">
<col class="functions_proto_name">
</colgroup>
<tbody>
<tr>
<td class="function_type">
<a href="../GwyResource.html#GwyResource-struct"><span class="returnvalue">GwyResource</span></a> *
</td>
<td class="function_name">
<a class="link" href="GwyResourceEditor.html#gwy-resource-editor-get-edited" title="gwy_resource_editor_get_edited ()">gwy_resource_editor_get_edited</a> <span class="c_punctuation">()</span>
</td>
</tr>
<tr>
<td class="function_type">
<span class="returnvalue">void</span>
</td>
<td class="function_name">
<a class="link" href="GwyResourceEditor.html#gwy-resource-editor-queue-commit" title="gwy_resource_editor_queue_commit ()">gwy_resource_editor_queue_commit</a> <span class="c_punctuation">()</span>
</td>
</tr>
<tr>
<td class="function_type">
<a href="http://developer.gnome.org/doc/API/2.0/glib/glib-Basic-Types.html#gboolean"><span class="returnvalue">gboolean</span></a>
</td>
<td class="function_name">
<a class="link" href="GwyResourceEditor.html#gwy-resource-editor-commit" title="gwy_resource_editor_commit ()">gwy_resource_editor_commit</a> <span class="c_punctuation">()</span>
</td>
</tr>
<tr>
<td class="function_type">
<span class="returnvalue">void</span>
</td>
<td class="function_name">
<a class="link" href="GwyResourceEditor.html#gwy-resource-editor-setup" title="gwy_resource_editor_setup ()">gwy_resource_editor_setup</a> <span class="c_punctuation">()</span>
</td>
</tr>
<tr>
<td class="function_type">
<span class="returnvalue">void</span>
</td>
<td class="function_name">
<a class="link" href="GwyResourceEditor.html#gwy-resource-editor-class-setup" title="gwy_resource_editor_class_setup ()">gwy_resource_editor_class_setup</a> <span class="c_punctuation">()</span>
</td>
</tr>
</tbody>
</table></div>
</div>
<div class="refsect1">
<a name="GwyResourceEditor.other"></a><h2>Types and Values</h2>
<div class="informaltable"><table class="informaltable" width="100%" border="0">
<colgroup>
<col width="150px" class="other_proto_type">
<col class="other_proto_name">
</colgroup>
<tbody>
<tr>
<td class="datatype_keyword">struct</td>
<td class="function_name"><a class="link" href="GwyResourceEditor.html#GwyResourceEditor-struct" title="struct GwyResourceEditor">GwyResourceEditor</a></td>
</tr>
<tr>
<td class="datatype_keyword">struct</td>
<td class="function_name"><a class="link" href="GwyResourceEditor.html#GwyResourceEditorClass" title="struct GwyResourceEditorClass">GwyResourceEditorClass</a></td>
</tr>
</tbody>
</table></div>
</div>
<div class="refsect1">
<a name="GwyResourceEditor.object-hierarchy"></a><h2>Object Hierarchy</h2>
<pre class="screen"> <a href="http://developer.gnome.org/doc/API/2.0/gobject/gobject-The-Base-Object-Type.html#GObject-struct">GObject</a>
<span class="lineart">╰──</span> <a href="http://developer.gnome.org/doc/API/2.0/gobject/gobject-The-Base-Object-Type.html#GInitiallyUnowned">GInitiallyUnowned</a>
<span class="lineart">╰──</span> <a href="http://developer.gnome.org/doc/API/2.0/gtk/GtkObject.html#GtkObject-struct">GtkObject</a>
<span class="lineart">╰──</span> <a href="http://developer.gnome.org/doc/API/2.0/gtk/GtkWidget.html#GtkWidget-struct">GtkWidget</a>
<span class="lineart">╰──</span> <a href="http://developer.gnome.org/doc/API/2.0/gtk/GtkContainer.html#GtkContainer-struct">GtkContainer</a>
<span class="lineart">╰──</span> <a href="http://developer.gnome.org/doc/API/2.0/gtk/GtkBin.html#GtkBin-struct">GtkBin</a>
<span class="lineart">╰──</span> <a href="http://developer.gnome.org/doc/API/2.0/gtk/GtkWindow.html#GtkWindow-struct">GtkWindow</a>
<span class="lineart">╰──</span> GwyResourceEditor
</pre>
</div>
<div class="refsect1">
<a name="GwyResourceEditor.implemented-interfaces"></a><h2>Implemented Interfaces</h2>
<p>
GwyResourceEditor implements
AtkImplementorIface and <a href="http://developer.gnome.org/doc/API/2.0/gtk/GtkBuildable.html#GtkBuildable-struct">GtkBuildable</a>.</p>
</div>
<div class="refsect1">
<a name="GwyResourceEditor.includes"></a><h2>Includes</h2>
<pre class="synopsis">#include <app/gwyapp.h>
</pre>
</div>
<div class="refsect1">
<a name="GwyResourceEditor.description"></a><h2>Description</h2>
<p>The base class contains all the methods that handle the resource list, set
defaults, or sync resource list with disk. Particular editors (subclasses)
have to override (in fact, to fill, because <a class="link" href="GwyResourceEditor.html" title="GwyResourceEditor"><span class="type">GwyResourceEditor</span></a> does not
define them) the methods and class data in their class init methods. Then
they generally only need to care about widgets inside their edit windows.</p>
</div>
<div class="refsect1">
<a name="GwyResourceEditor.functions_details"></a><h2>Functions</h2>
<div class="refsect2">
<a name="gwy-resource-editor-get-edited"></a><h3>gwy_resource_editor_get_edited ()</h3>
<pre class="programlisting"><a href="../GwyResource.html#GwyResource-struct"><span class="returnvalue">GwyResource</span></a> *
gwy_resource_editor_get_edited (<em class="parameter"><code><a class="link" href="GwyResourceEditor.html" title="GwyResourceEditor"><span class="type">GwyResourceEditor</span></a> *editor</code></em>);</pre>
<p>Gets the currently edited resource.</p>
<p>It is an error to call this method when no resource is being edited.</p>
<div class="refsect3">
<a name="gwy-resource-editor-get-edited.parameters"></a><h4>Parameters</h4>
<div class="informaltable"><table class="informaltable" width="100%" border="0">
<colgroup>
<col width="150px" class="parameters_name">
<col class="parameters_description">
<col width="200px" class="parameters_annotations">
</colgroup>
<tbody><tr>
<td class="parameter_name"><p>editor</p></td>
<td class="parameter_description"><p>A resource editor.</p></td>
<td class="parameter_annotations"> </td>
</tr></tbody>
</table></div>
</div>
<div class="refsect3">
<a name="gwy-resource-editor-get-edited.returns"></a><h4>Returns</h4>
<p> The currently edited resource.</p>
</div>
</div>
<hr>
<div class="refsect2">
<a name="gwy-resource-editor-queue-commit"></a><h3>gwy_resource_editor_queue_commit ()</h3>
<pre class="programlisting"><span class="returnvalue">void</span>
gwy_resource_editor_queue_commit (<em class="parameter"><code><a class="link" href="GwyResourceEditor.html" title="GwyResourceEditor"><span class="type">GwyResourceEditor</span></a> *editor</code></em>);</pre>
<p>Queues commit of resource changes, marking the currently edited resource
`dirty'.</p>
<p>Call this method in particular resource editor subclass whenever user
changes some editor property.</p>
<p>To flush pending commit, call <a class="link" href="GwyResourceEditor.html#gwy-resource-editor-commit" title="gwy_resource_editor_commit ()"><code class="function">gwy_resource_editor_commit()</code></a>. To immediately
commit a change, call this method and then <a class="link" href="GwyResourceEditor.html#gwy-resource-editor-commit" title="gwy_resource_editor_commit ()"><code class="function">gwy_resource_editor_commit()</code></a>.</p>
<div class="refsect3">
<a name="gwy-resource-editor-queue-commit.parameters"></a><h4>Parameters</h4>
<div class="informaltable"><table class="informaltable" width="100%" border="0">
<colgroup>
<col width="150px" class="parameters_name">
<col class="parameters_description">
<col width="200px" class="parameters_annotations">
</colgroup>
<tbody><tr>
<td class="parameter_name"><p>editor</p></td>
<td class="parameter_description"><p>A resource editor.</p></td>
<td class="parameter_annotations"> </td>
</tr></tbody>
</table></div>
</div>
</div>
<hr>
<div class="refsect2">
<a name="gwy-resource-editor-commit"></a><h3>gwy_resource_editor_commit ()</h3>
<pre class="programlisting"><a href="http://developer.gnome.org/doc/API/2.0/glib/glib-Basic-Types.html#gboolean"><span class="returnvalue">gboolean</span></a>
gwy_resource_editor_commit (<em class="parameter"><code><a class="link" href="GwyResourceEditor.html" title="GwyResourceEditor"><span class="type">GwyResourceEditor</span></a> *editor</code></em>);</pre>
<p>Commits pending resource changes, if there are any.</p>
<p>It calls <em class="parameter"><code>apply_changes</code></em>
method first (if it exists), then saves resource to
disk.</p>
<p>Changes are always immediately committed (if there are any pending): before
the editor is destroyed, when a resource stops being edited, before a
resource is deleted, before a resource is renamed. When a resource is newly
created, it is immediately created on disk too.</p>
<div class="refsect3">
<a name="gwy-resource-editor-commit.parameters"></a><h4>Parameters</h4>
<div class="informaltable"><table class="informaltable" width="100%" border="0">
<colgroup>
<col width="150px" class="parameters_name">
<col class="parameters_description">
<col width="200px" class="parameters_annotations">
</colgroup>
<tbody><tr>
<td class="parameter_name"><p>editor</p></td>
<td class="parameter_description"><p>A resource editor.</p></td>
<td class="parameter_annotations"> </td>
</tr></tbody>
</table></div>
</div>
<div class="refsect3">
<a name="gwy-resource-editor-commit.returns"></a><h4>Returns</h4>
<p> Always <a href="http://developer.gnome.org/doc/API/2.0/glib/glib-Standard-Macros.html#FALSE:CAPS"><code class="literal">FALSE</code></a> (to be usable as <a href="http://developer.gnome.org/doc/API/2.0/glib/glib-The-Main-Event-Loop.html#GSourceFunc"><span class="type">GSourceFunc</span></a>).</p>
</div>
</div>
<hr>
<div class="refsect2">
<a name="gwy-resource-editor-setup"></a><h3>gwy_resource_editor_setup ()</h3>
<pre class="programlisting"><span class="returnvalue">void</span>
gwy_resource_editor_setup (<em class="parameter"><code><a class="link" href="GwyResourceEditor.html" title="GwyResourceEditor"><span class="type">GwyResourceEditor</span></a> *editor</code></em>);</pre>
<p>Sets up particular resource editor.</p>
<p>Helper method only intended for resource editor implementation.
To be called in particular resource initialization methods.</p>
<div class="refsect3">
<a name="gwy-resource-editor-setup.parameters"></a><h4>Parameters</h4>
<div class="informaltable"><table class="informaltable" width="100%" border="0">
<colgroup>
<col width="150px" class="parameters_name">
<col class="parameters_description">
<col width="200px" class="parameters_annotations">
</colgroup>
<tbody><tr>
<td class="parameter_name"><p>editor</p></td>
<td class="parameter_description"><p>A resource editor.</p></td>
<td class="parameter_annotations"> </td>
</tr></tbody>
</table></div>
</div>
</div>
<hr>
<div class="refsect2">
<a name="gwy-resource-editor-class-setup"></a><h3>gwy_resource_editor_class_setup ()</h3>
<pre class="programlisting"><span class="returnvalue">void</span>
gwy_resource_editor_class_setup (<em class="parameter"><code><a class="link" href="GwyResourceEditor.html#GwyResourceEditorClass" title="struct GwyResourceEditorClass"><span class="type">GwyResourceEditorClass</span></a> *klass</code></em>);</pre>
<p>Sets up particular resource editor class.</p>
<p>Helper class method only intended for resource editor implementation.
To be called in particular class initialization methods.</p>
<div class="refsect3">
<a name="gwy-resource-editor-class-setup.parameters"></a><h4>Parameters</h4>
<div class="informaltable"><table class="informaltable" width="100%" border="0">
<colgroup>
<col width="150px" class="parameters_name">
<col class="parameters_description">
<col width="200px" class="parameters_annotations">
</colgroup>
<tbody><tr>
<td class="parameter_name"><p>klass</p></td>
<td class="parameter_description"><p>A resource editor class.</p></td>
<td class="parameter_annotations"> </td>
</tr></tbody>
</table></div>
</div>
</div>
</div>
<div class="refsect1">
<a name="GwyResourceEditor.other_details"></a><h2>Types and Values</h2>
<div class="refsect2">
<a name="GwyResourceEditor-struct"></a><h3>struct GwyResourceEditor</h3>
<pre class="programlisting">struct GwyResourceEditor;</pre>
</div>
<hr>
<div class="refsect2">
<a name="GwyResourceEditorClass"></a><h3>struct GwyResourceEditorClass</h3>
<pre class="programlisting">struct GwyResourceEditorClass {
GtkWindowClass parent_class;
GType resource_type;
const gchar *base_resource;
const gchar *window_title;
const gchar *editor_title;
gchar *settings_prefix;
GtkWidget* (*construct_treeview)(GCallback callback,
gpointer cbdata,
const gchar *active);
void (*construct_editor)(GwyResourceEditor *editor);
void (*apply_changes)(GwyResourceEditor *editor);
void (*switch_resource)(GwyResourceEditor *editor);
void (*reserved1)(void);
void (*reserved2)(void);
GwyResourceEditor *instance;
};
</pre>
<p>The resource editor class.</p>
<div class="refsect3">
<a name="GwyResourceEditorClass.members"></a><h4>Members</h4>
<div class="informaltable"><table class="informaltable" width="100%" border="0">
<colgroup>
<col width="300px" class="struct_members_name">
<col class="struct_members_description">
<col width="200px" class="struct_members_annotations">
</colgroup>
<tbody>
<tr>
<td class="struct_member_name"><p><a href="http://developer.gnome.org/doc/API/2.0/gobject/gobject-Type-Information.html#GType"><span class="type">GType</span></a> <em class="structfield"><code><a name="GwyResourceEditorClass.resource-type"></a>resource_type</code></em>;</p></td>
<td class="struct_member_description"><p>The <a href="http://developer.gnome.org/doc/API/2.0/gobject/gobject-Type-Information.html#GType"><span class="type">GType</span></a> of edited resources. It must be a type derived
from <a href="../GwyResource.html#GwyResource-struct"><span class="type">GwyResource</span></a>.</p></td>
<td class="struct_member_annotations"> </td>
</tr>
<tr>
<td class="struct_member_name"><p>const <a href="http://developer.gnome.org/doc/API/2.0/glib/glib-Basic-Types.html#gchar"><span class="type">gchar</span></a> *<em class="structfield"><code><a name="GwyResourceEditorClass.base-resource"></a>base_resource</code></em>;</p></td>
<td class="struct_member_description"><p>The name of vanilla, default resource. The `New' button
creates a new resource as a copy of this one.</p></td>
<td class="struct_member_annotations"> </td>
</tr>
<tr>
<td class="struct_member_name"><p>const <a href="http://developer.gnome.org/doc/API/2.0/glib/glib-Basic-Types.html#gchar"><span class="type">gchar</span></a> *<em class="structfield"><code><a name="GwyResourceEditorClass.window-title"></a>window_title</code></em>;</p></td>
<td class="struct_member_description"><p>Resource list window title. It should be already translated.</p></td>
<td class="struct_member_annotations"> </td>
</tr>
<tr>
<td class="struct_member_name"><p>const <a href="/usr/share/gtk-doc/html/glib/glib-Basic-Types.html#gchar"><span class="type">gchar</span></a> *<em class="structfield"><code><a name="GwyResourceEditorClass.editor-title"></a>editor_title</code></em>;</p></td>
<td class="struct_member_description"><p>Editor window title template. It must contain one
<code class="literal"><code class="literal">s</code></code> that will be replaced with edited
resource name. It should be already translated.</p></td>
<td class="struct_member_annotations"> </td>
</tr>
<tr>
<td class="struct_member_name"><p><a href="/usr/share/gtk-doc/html/glib/glib-Basic-Types.html#gchar"><span class="type">gchar</span></a> *<em class="structfield"><code><a name="GwyResourceEditorClass.settings-prefix"></a>settings_prefix</code></em>;</p></td>
<td class="struct_member_description"><p>Settings prefix for saved state, filled by
<a class="link" href="GwyResourceEditor.html#gwy-resource-editor-class-setup" title="gwy_resource_editor_class_setup ()"><code class="function">gwy_resource_editor_class_setup()</code></a>.</p></td>
<td class="struct_member_annotations"> </td>
</tr>
<tr>
<td class="struct_member_name"><p><em class="structfield"><code><a name="GwyResourceEditorClass.construct-treeview"></a>construct_treeview</code></em> ()</p></td>
<td class="struct_member_description"><p>Method to create the resource list widget, it is
of the <a href="../libgwydgets-gwyoptionmenus.html#gwy-gradient-tree-view-new"><code class="function">gwy_gradient_tree_view_new()</code></a> signature.
There are currently some hardcoded assumptions about
the tree view columns, so it cannot be completely
arbitrary.</p></td>
<td class="struct_member_annotations"> </td>
</tr>
<tr>
<td class="struct_member_name"><p><em class="structfield"><code><a name="GwyResourceEditorClass.construct-editor"></a>construct_editor</code></em> ()</p></td>
<td class="struct_member_description"><p>Method to construct editor window contents (the window
itself is managed by <a class="link" href="GwyResourceEditor.html" title="GwyResourceEditor"><span class="type">GwyResourceEditor</span></a>, its contents
by a particular editor).</p></td>
<td class="struct_member_annotations"> </td>
</tr>
<tr>
<td class="struct_member_name"><p><em class="structfield"><code><a name="GwyResourceEditorClass.apply-changes"></a>apply_changes</code></em> ()</p></td>
<td class="struct_member_description"><p>Method called on commit (before resource is written to
disk). It should obtain values from the editor widgets
and actually update the resource.</p></td>
<td class="struct_member_annotations"> </td>
</tr>
<tr>
<td class="struct_member_name"><p><em class="structfield"><code><a name="GwyResourceEditorClass.switch-resource"></a>switch_resource</code></em> ()</p></td>
<td class="struct_member_description"><p>Method to update editor window widgets to display another
resource.</p></td>
<td class="struct_member_annotations"> </td>
</tr>
<tr>
<td class="struct_member_name"><p><em class="structfield"><code><a name="GwyResourceEditorClass.reserved1"></a>reserved1</code></em> ()</p></td>
<td> </td>
<td> </td>
</tr>
<tr>
<td class="struct_member_name"><p><em class="structfield"><code><a name="GwyResourceEditorClass.reserved2"></a>reserved2</code></em> ()</p></td>
<td> </td>
<td> </td>
</tr>
<tr>
<td class="struct_member_name"><p><a class="link" href="GwyResourceEditor.html" title="GwyResourceEditor"><span class="type">GwyResourceEditor</span></a> *<em class="structfield"><code><a name="GwyResourceEditorClass.instance"></a>instance</code></em>;</p></td>
<td class="struct_member_description"><p>Editor instance. Resource editors are singletons so if an
instance exists, pointer to it is kept here.</p></td>
<td class="struct_member_annotations"> </td>
</tr>
</tbody>
</table></div>
</div>
</div>
</div>
</div>
<div class="footer">
<hr>Generated by GTK-Doc V1.19</div>
</body>
</html>
|