File: skeleton-plugin.c

package info (click to toggle)
mousepad 0.7.0-1
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid
  • size: 4,560 kB
  • sloc: ansic: 17,039; xml: 661; sh: 535; makefile: 6
file content (142 lines) | stat: -rw-r--r-- 3,341 bytes parent folder | download
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
/*
 * This program is free software; you can redistribute it and/or modify it
 * under the terms of the GNU General Public License as published by the Free
 * Software Foundation; either version 2 of the License, or (at your option)
 * any later version.
 *
 * This program is distributed in the hope that it will be useful, but WITHOUT
 * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
 * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License for
 * more details.
 *
 * You should have received a copy of the GNU General Public License along with
 * this program; if not, write to the Free Software Foundation, Inc., 59 Temple
 * Place, Suite 330, Boston, MA  02111-1307  USA
 */

#include "mousepad/mousepad-private.h"
#include "skeleton-plugin.h"

#include "mousepad/mousepad-application.h"



/* GObject virtual functions */
static void
skeleton_plugin_constructed (GObject *object);
static void
skeleton_plugin_finalize (GObject *object);

/* MousepadPlugin virtual functions */
static void
skeleton_plugin_enable (MousepadPlugin *mplugin);
static void
skeleton_plugin_disable (MousepadPlugin *mplugin);

/* SkeletonPlugin own functions */



struct _SkeletonPlugin
{
  MousepadPlugin __parent__;
};



G_DEFINE_DYNAMIC_TYPE (SkeletonPlugin, skeleton_plugin, MOUSEPAD_TYPE_PLUGIN);



void
skeleton_plugin_register (MousepadPluginProvider *plugin)
{
  skeleton_plugin_register_type (G_TYPE_MODULE (plugin));
}



static void
skeleton_plugin_class_init (SkeletonPluginClass *klass)
{
  GObjectClass *gobject_class = G_OBJECT_CLASS (klass);
  MousepadPluginClass *mplugin_class = MOUSEPAD_PLUGIN_CLASS (klass);

  gobject_class->constructed = skeleton_plugin_constructed;
  gobject_class->finalize = skeleton_plugin_finalize;

  mplugin_class->enable = skeleton_plugin_enable;
  mplugin_class->disable = skeleton_plugin_disable;
}



static void
skeleton_plugin_class_finalize (SkeletonPluginClass *klass)
{
}



static void
skeleton_plugin_init (SkeletonPlugin *plugin)
{
  /* initialization */

  skeleton_plugin_enable (MOUSEPAD_PLUGIN (plugin));
}



static void
skeleton_plugin_constructed (GObject *object)
{
  MousepadPluginProvider *provider;
  GtkWidget *vbox;

  /* request the creation of the plugin setting box */
  g_object_get (object, "provider", &provider, NULL);
  vbox = mousepad_plugin_provider_create_setting_box (provider);

  /* show all widgets in the setting box */
  gtk_widget_show_all (vbox);

  /* chain-up to MousepadPlugin */
  G_OBJECT_CLASS (skeleton_plugin_parent_class)->constructed (object);
}



static void
skeleton_plugin_finalize (GObject *object)
{
  SkeletonPlugin *plugin = SKELETON_PLUGIN (object);

  skeleton_plugin_disable (MOUSEPAD_PLUGIN (plugin));

  G_OBJECT_CLASS (skeleton_plugin_parent_class)->finalize (object);
}



static void
skeleton_plugin_enable (MousepadPlugin *mplugin)
{
  SkeletonPlugin *plugin = SKELETON_PLUGIN (mplugin);
  MousepadApplication *application;

  /* get the mousepad application */
  application = MOUSEPAD_APPLICATION (g_application_get_default ());
}



static void
skeleton_plugin_disable (MousepadPlugin *mplugin)
{
  SkeletonPlugin *plugin = SKELETON_PLUGIN (mplugin);
  MousepadApplication *application;

  /* get the mousepad application */
  application = MOUSEPAD_APPLICATION (g_application_get_default ());
}