Little fix.
[lxde/lxpanel.git] / src / plugins / separator.c
CommitLineData
a52c2257
HJYP
1#include "panel.h"
2#include "misc.h"
3#include "plugin.h"
4
5
6//#define DEBUG
7#include "dbg.h"
8
9
10static int
db449f6e 11separator_constructor(plugin *p, char **fp)
a52c2257
HJYP
12{
13 GtkWidget *sep, *eb;
14 line s;
ae44728f 15
a52c2257
HJYP
16 ENTER;
17 s.len = 256;
db449f6e
HJYP
18 if( fp )
19 {
20 while (lxpanel_get_line(fp, &s) != LINE_BLOCK_END) {
21 ERR( "separator: illegal in this context %s\n", s.str);
22 RET(0);
23 }
a52c2257
HJYP
24 }
25 eb = gtk_event_box_new();
26 gtk_container_set_border_width(GTK_CONTAINER(eb), 1);
27 gtk_widget_show(eb);
28 /*
29 g_signal_connect(G_OBJECT(eb), "expose_event",
30 G_CALLBACK(gtk_widget_queue_draw), NULL);
31 */
32 sep = p->panel->my_separator_new();
33 gtk_widget_show(sep);
34 gtk_container_add (GTK_CONTAINER (eb), sep);
35 gtk_container_add(GTK_CONTAINER(p->pwid), eb);
36 p->priv = g_new0(int, 1); /* just to alloc smth */
37
38 RET(1);
39}
40
41static void
42separator_destructor(plugin *p)
43{
ae44728f 44 ENTER;
a52c2257
HJYP
45 g_free(p->priv);
46 RET();
47}
48
49
50plugin_class separator_plugin_class = {
51 fname: NULL,
52 count: 0,
53
54 type : "separator",
ce522551 55 name : "Separator",
a52c2257
HJYP
56 version: "1.0",
57 description : "Simple separator plugin",
58
59 constructor : separator_constructor,
60 destructor : separator_destructor,
9c97f69e
HJYP
61 config : NULL,
62 save : NULL
a52c2257 63};