/usr/share/gtk-doc/html/libanjuta/writing-plugins-simple.html is in libanjuta-dev 2:3.22.0-3.
This file is owned by root:root, with mode 0o644.
The actual contents of the file can be viewed below.
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 | <!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<title>Anjuta Developers Reference Manual: Hello world plugin</title>
<meta name="generator" content="DocBook XSL Stylesheets V1.78.1">
<link rel="home" href="index.html" title="Anjuta Developers Reference Manual">
<link rel="up" href="writing-plugins.html" title="Writing plugins">
<link rel="prev" href="writing-plugins.html" title="Writing plugins">
<link rel="next" href="writing-plugins-sources.html" title="Hello world advanced plugin">
<meta name="generator" content="GTK-Doc V1.21 (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"></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="writing-plugins.html"><img src="up.png" width="16" height="16" border="0" alt="Up"></a></td>
<td><a accesskey="p" href="writing-plugins.html"><img src="left.png" width="16" height="16" border="0" alt="Prev"></a></td>
<td><a accesskey="n" href="writing-plugins-sources.html"><img src="right.png" width="16" height="16" border="0" alt="Next"></a></td>
</tr></table>
<div class="sect1">
<div class="titlepage"><div><div><h2 class="title" style="clear: both">
<a name="writing-plugins-simple"></a>Hello world plugin</h2></div></div></div>
<p>
This plugin does nothing other then displaying "Hello World Plugin!!"
widget. The widget is added to Shell and appear as separate window.
You can drag the widget and dock it various ways. This section is
meant to give a quick look at how plugins are derived from
<a class="link" href="AnjutaPlugin.html" title="AnjutaPlugin"><span class="type">AnjutaPlugin</span></a>
base class. Most of the things will be explained in
<a class="xref" href="writing-plugins-sources.html" title="Hello world advanced plugin">the section called “Hello world advanced plugin”</a>. First the plugin
class is derived from the abstract class and two virtual methods
activate() and deactivate() are implemented. In activate() method,
we are create a label and add it to shell. Consequently, we also
remove this widget in deactivate() call.
</p>
<pre class="programlisting">
#include <libanjuta/anjuta-plugin.h>
typedef struct {
AnjutaPlugin parent;
/* Hello world widget */
GtkWidget *widget;
} HelloWorldPlugin;
typedef struct {
AnjutaPluginClass parent_class;
} HelloWorldPluginClass;
static gboolean
activate_plugin (AnjutaPlugin *plugin)
{
HelloWorldPlugin *hello_plugin = (HelloWorldPlugin*) plugin;
/* Create hello plugin widget */
hello_plugin->widget = gtk_label_new ("Hello World Plugin!!");
/* Add widget in Shell. Any number of widgets can be added */
anjuta_shell_add_widget (plugin->shell, hello_plugin->widget,
"AnjutaHelloWorldPlugin",
_("Hello world plugin"),
GTK_STOCK_ABOUT,
ANJUTA_SHELL_PLACEMENT_CENTER,
NULL);
return TRUE; /* FALSE if activation failed */
}
static gboolean
deactivate_plugin (AnjutaPlugin *plugin)
{
HelloWorldPlugin *hello_plugin = (HelloWorldPlugin*) plugin;
/* Remove widgets from Shell */
anjuta_shell_remove_widget (plugin->shell, hello_plugin->widget, NULL);
return TRUE; /* FALSE if plugin doesn't want to deactivate */
}
static void
hello_world_plugin_instance_init (GObject *obj)
{
}
static void
hello_world_plugin_class_init (GObjectClass *klass)
{
AnjutaPluginClass *plugin_class = ANJUTA_PLUGIN_CLASS (klass);
plugin_class->activate = activate_plugin;
plugin_class->deactivate = deactivate_plugin;
}
ANJUTA_PLUGIN_BOILERPLATE (HelloWorldPlugin, hello_world_plugin);
ANJUTA_SIMPLE_PLUGIN (HelloWorldPlugin, hello_world_plugin);
</pre>
<p>
</p>
</div>
<div class="footer">
<hr>
Generated by GTK-Doc V1.21</div>
</body>
</html>
|