Add dialog used to add new plugins to the panel at runtime.
[lxde/lxpanel.git] / src / plugin.h
CommitLineData
16fb8c2e 1/**
a99ee9e1
JH
2 * Copyright (c) 2006 LxDE Developers, see the file AUTHORS for details.
3 *
4 * This program is free software; you can redistribute it and/or modify
5 * it under the terms of the GNU General Public License as published by
6 * the Free Software Foundation; either version 2 of the License, or
7 * (at your option) any later version.
8 *
9 * This program is distributed in the hope that it will be useful,
10 * but WITHOUT ANY WARRANTY; without even the implied warranty of
11 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
12 * GNU General Public License for more details.
13 *
14 * You should have received a copy of the GNU General Public License
15 * along with this program; if not, write to the Free Software Foundation,
16 * Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
17 */
18
a52c2257
HJYP
19#ifndef PLUGIN_H
20#define PLUGIN_H
a52c2257 21
2d29cc96 22#include <gmodule.h>
a52c2257
HJYP
23
24#include <gtk/gtk.h>
25#include <gdk/gdk.h>
26#include <stdio.h>
27#include "panel.h"
28
29struct _plugin *stam;
30
31typedef struct {
32 /* common */
33 char *fname;
34 int count;
35 GModule *gmodule;
36
37 int dynamic : 1;
38 int invisible : 1;
39 /* these fields are pointers to the data within loaded dll */
40 char *type;
41 char *name;
42 char *version;
43 char *description;
ce522551 44
db449f6e 45 int (*constructor)(struct _plugin *this, char **fp);
a52c2257 46 void (*destructor)(struct _plugin *this);
04883e73 47 void (*config)(struct _plugin *this, GtkWindow* parent); /* config UI */
9c97f69e 48 void (*save)(struct _plugin *this, FILE* fp);
a97d06a6 49 void (*orientation)(struct _plugin *this);
a52c2257
HJYP
50} plugin_class;
51
52typedef struct _plugin{
53 plugin_class *class;
54 panel *panel;
a52c2257
HJYP
55 GtkWidget *pwid;
56 int expand;
57 int padding;
58 int border;
59 gpointer priv;
60} plugin;
61
62/* if plugin is external it will load its dll */
63plugin * plugin_load(char *type);
64void plugin_put(plugin *this);
db449f6e 65int plugin_start(plugin *this, char **fp);
a52c2257
HJYP
66void plugin_stop(plugin *this);
67
6a6ad54e
HJYP
68void plugin_class_unref( plugin_class* pc );
69
70/*
71 Get a list of all available plugin classes
16fb8c2e
HJYP
72 Return a newly allocated GList which should be freed with
73 plugin_class_list_free( list );
6a6ad54e
HJYP
74*/
75GList* plugin_get_available_classes();
16fb8c2e 76void plugin_class_list_free( GList* classes );
6a6ad54e 77
2d29cc96 78/* FIXME: optional definitions */
a52c2257
HJYP
79#define STATIC_SEPARATOR
80#define STATIC_IMAGE
81#define STATIC_LAUNCHBAR
82#define STATIC_DCLOCK
83#define STATIC_WINCMD
f9dfb60b 84#define STATIC_DIRMENU
a52c2257
HJYP
85#define STATIC_TASKBAR
86#define STATIC_PAGER
87#define STATIC_TRAY
88#define STATIC_MENU
89#define STATIC_SPACE
90#define STATIC_ICONS
a52c2257
HJYP
91
92#endif