Rename Pluma to Xedit
This commit is contained in:
@@ -1,24 +1,24 @@
|
||||
# C plugin loader
|
||||
|
||||
loaderdir = $(libdir)/pluma/plugin-loaders
|
||||
loaderdir = $(libdir)/xedit/plugin-loaders
|
||||
|
||||
AM_CPPFLAGS = \
|
||||
-I$(top_srcdir) \
|
||||
$(PLUMA_CFLAGS) \
|
||||
$(XEDIT_CFLAGS) \
|
||||
$(WARN_CFLAGS) \
|
||||
$(DISABLE_DEPRECATED_CFLAGS) \
|
||||
-DPLUMA_LOCALEDIR=\""$(prefix)/$(DATADIRNAME)/locale"\"
|
||||
-DXEDIT_LOCALEDIR=\""$(prefix)/$(DATADIRNAME)/locale"\"
|
||||
|
||||
loader_LTLIBRARIES = libcloader.la
|
||||
|
||||
NOINST_H_FILES = \
|
||||
pluma-plugin-loader-c.h
|
||||
xedit-plugin-loader-c.h
|
||||
|
||||
libcloader_la_SOURCES = \
|
||||
pluma-plugin-loader-c.c \
|
||||
xedit-plugin-loader-c.c \
|
||||
$(NOINST_H_FILES)
|
||||
|
||||
libcloader_la_LDFLAGS = $(LOADER_LIBTOOL_FLAGS)
|
||||
libcloader_la_LIBADD = $(PLUMA_LIBS)
|
||||
libcloader_la_LIBADD = $(XEDIT_LIBS)
|
||||
|
||||
-include $(top_srcdir)/git.mk
|
||||
|
@@ -1,60 +0,0 @@
|
||||
/*
|
||||
* pluma-plugin-loader-c.h
|
||||
* This file is part of pluma
|
||||
*
|
||||
* Copyright (C) 2008 - Jesse van den Kieboom
|
||||
*
|
||||
* 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., 51 Franklin St, Fifth Floor,
|
||||
* Boston, MA 02110-1301, USA.
|
||||
*/
|
||||
|
||||
#ifndef __PLUMA_PLUGIN_LOADER_C_H__
|
||||
#define __PLUMA_PLUGIN_LOADER_C_H__
|
||||
|
||||
#include <pluma/pluma-plugin-loader.h>
|
||||
|
||||
G_BEGIN_DECLS
|
||||
|
||||
#define PLUMA_TYPE_PLUGIN_LOADER_C (pluma_plugin_loader_c_get_type ())
|
||||
#define PLUMA_PLUGIN_LOADER_C(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), PLUMA_TYPE_PLUGIN_LOADER_C, PlumaPluginLoaderC))
|
||||
#define PLUMA_PLUGIN_LOADER_C_CONST(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), PLUMA_TYPE_PLUGIN_LOADER_C, PlumaPluginLoaderC const))
|
||||
#define PLUMA_PLUGIN_LOADER_C_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), PLUMA_TYPE_PLUGIN_LOADER_C, PlumaPluginLoaderCClass))
|
||||
#define PLUMA_IS_PLUGIN_LOADER_C(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), PLUMA_TYPE_PLUGIN_LOADER_C))
|
||||
#define PLUMA_IS_PLUGIN_LOADER_C_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), PLUMA_TYPE_PLUGIN_LOADER_C))
|
||||
#define PLUMA_PLUGIN_LOADER_C_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), PLUMA_TYPE_PLUGIN_LOADER_C, PlumaPluginLoaderCClass))
|
||||
|
||||
typedef struct _PlumaPluginLoaderC PlumaPluginLoaderC;
|
||||
typedef struct _PlumaPluginLoaderCClass PlumaPluginLoaderCClass;
|
||||
typedef struct _PlumaPluginLoaderCPrivate PlumaPluginLoaderCPrivate;
|
||||
|
||||
struct _PlumaPluginLoaderC {
|
||||
GObject parent;
|
||||
|
||||
PlumaPluginLoaderCPrivate *priv;
|
||||
};
|
||||
|
||||
struct _PlumaPluginLoaderCClass {
|
||||
GObjectClass parent_class;
|
||||
};
|
||||
|
||||
GType pluma_plugin_loader_c_get_type (void) G_GNUC_CONST;
|
||||
PlumaPluginLoaderC *pluma_plugin_loader_c_new(void);
|
||||
|
||||
/* All the loaders must implement this function */
|
||||
G_MODULE_EXPORT GType register_pluma_plugin_loader (GTypeModule * module);
|
||||
|
||||
G_END_DECLS
|
||||
|
||||
#endif /* __PLUMA_PLUGIN_LOADER_C_H__ */
|
@@ -1,6 +1,6 @@
|
||||
/*
|
||||
* pluma-plugin-loader-c.c
|
||||
* This file is part of pluma
|
||||
* xedit-plugin-loader-c.c
|
||||
* This file is part of xedit
|
||||
*
|
||||
* Copyright (C) 2008 - Jesse van den Kieboom
|
||||
*
|
||||
@@ -20,46 +20,46 @@
|
||||
* Boston, MA 02110-1301, USA.
|
||||
*/
|
||||
|
||||
#include "pluma-plugin-loader-c.h"
|
||||
#include <pluma/pluma-object-module.h>
|
||||
#include "xedit-plugin-loader-c.h"
|
||||
#include <xedit/xedit-object-module.h>
|
||||
|
||||
#define PLUMA_PLUGIN_LOADER_C_GET_PRIVATE(object)(G_TYPE_INSTANCE_GET_PRIVATE((object), PLUMA_TYPE_PLUGIN_LOADER_C, PlumaPluginLoaderCPrivate))
|
||||
#define XEDIT_PLUGIN_LOADER_C_GET_PRIVATE(object)(G_TYPE_INSTANCE_GET_PRIVATE((object), XEDIT_TYPE_PLUGIN_LOADER_C, XeditPluginLoaderCPrivate))
|
||||
|
||||
struct _PlumaPluginLoaderCPrivate
|
||||
struct _XeditPluginLoaderCPrivate
|
||||
{
|
||||
GHashTable *loaded_plugins;
|
||||
};
|
||||
|
||||
static void pluma_plugin_loader_iface_init (gpointer g_iface, gpointer iface_data);
|
||||
static void xedit_plugin_loader_iface_init (gpointer g_iface, gpointer iface_data);
|
||||
|
||||
PLUMA_PLUGIN_LOADER_REGISTER_TYPE (PlumaPluginLoaderC, pluma_plugin_loader_c, G_TYPE_OBJECT, pluma_plugin_loader_iface_init);
|
||||
XEDIT_PLUGIN_LOADER_REGISTER_TYPE (XeditPluginLoaderC, xedit_plugin_loader_c, G_TYPE_OBJECT, xedit_plugin_loader_iface_init);
|
||||
|
||||
|
||||
static const gchar *
|
||||
pluma_plugin_loader_iface_get_id (void)
|
||||
xedit_plugin_loader_iface_get_id (void)
|
||||
{
|
||||
return "C";
|
||||
}
|
||||
|
||||
static PlumaPlugin *
|
||||
pluma_plugin_loader_iface_load (PlumaPluginLoader *loader,
|
||||
PlumaPluginInfo *info,
|
||||
static XeditPlugin *
|
||||
xedit_plugin_loader_iface_load (XeditPluginLoader *loader,
|
||||
XeditPluginInfo *info,
|
||||
const gchar *path)
|
||||
{
|
||||
PlumaPluginLoaderC *cloader = PLUMA_PLUGIN_LOADER_C (loader);
|
||||
PlumaObjectModule *module;
|
||||
XeditPluginLoaderC *cloader = XEDIT_PLUGIN_LOADER_C (loader);
|
||||
XeditObjectModule *module;
|
||||
const gchar *module_name;
|
||||
PlumaPlugin *result;
|
||||
XeditPlugin *result;
|
||||
|
||||
module = (PlumaObjectModule *)g_hash_table_lookup (cloader->priv->loaded_plugins, info);
|
||||
module_name = pluma_plugin_info_get_module_name (info);
|
||||
module = (XeditObjectModule *)g_hash_table_lookup (cloader->priv->loaded_plugins, info);
|
||||
module_name = xedit_plugin_info_get_module_name (info);
|
||||
|
||||
if (module == NULL)
|
||||
{
|
||||
/* For now we force all modules to be resident */
|
||||
module = pluma_object_module_new (module_name,
|
||||
module = xedit_object_module_new (module_name,
|
||||
path,
|
||||
"register_pluma_plugin",
|
||||
"register_xedit_plugin",
|
||||
TRUE);
|
||||
|
||||
/* Infos are available for all the lifetime of the loader.
|
||||
@@ -70,7 +70,7 @@ pluma_plugin_loader_iface_load (PlumaPluginLoader *loader,
|
||||
|
||||
if (!g_type_module_use (G_TYPE_MODULE (module)))
|
||||
{
|
||||
g_warning ("Could not load plugin module: %s", pluma_plugin_info_get_name (info));
|
||||
g_warning ("Could not load plugin module: %s", xedit_plugin_info_get_name (info));
|
||||
|
||||
return NULL;
|
||||
}
|
||||
@@ -78,14 +78,14 @@ pluma_plugin_loader_iface_load (PlumaPluginLoader *loader,
|
||||
/* TODO: for now we force data-dir-name = module-name... if needed we can
|
||||
* add a datadir field to the plugin descriptor file.
|
||||
*/
|
||||
result = (PlumaPlugin *)pluma_object_module_new_object (module,
|
||||
result = (XeditPlugin *)xedit_object_module_new_object (module,
|
||||
"install-dir", path,
|
||||
"data-dir-name", module_name,
|
||||
NULL);
|
||||
|
||||
if (!result)
|
||||
{
|
||||
g_warning ("Could not create plugin object: %s", pluma_plugin_info_get_name (info));
|
||||
g_warning ("Could not create plugin object: %s", xedit_plugin_info_get_name (info));
|
||||
g_type_module_unuse (G_TYPE_MODULE (module));
|
||||
|
||||
return NULL;
|
||||
@@ -97,10 +97,10 @@ pluma_plugin_loader_iface_load (PlumaPluginLoader *loader,
|
||||
}
|
||||
|
||||
static void
|
||||
pluma_plugin_loader_iface_unload (PlumaPluginLoader *loader,
|
||||
PlumaPluginInfo *info)
|
||||
xedit_plugin_loader_iface_unload (XeditPluginLoader *loader,
|
||||
XeditPluginInfo *info)
|
||||
{
|
||||
//PlumaPluginLoaderC *cloader = PLUMA_PLUGIN_LOADER_C (loader);
|
||||
//XeditPluginLoaderC *cloader = XEDIT_PLUGIN_LOADER_C (loader);
|
||||
|
||||
/* this is a no-op, since the type module will be properly unused as
|
||||
the last reference to the plugin dies. When the plugin is activated
|
||||
@@ -108,20 +108,20 @@ pluma_plugin_loader_iface_unload (PlumaPluginLoader *loader,
|
||||
}
|
||||
|
||||
static void
|
||||
pluma_plugin_loader_iface_init (gpointer g_iface,
|
||||
xedit_plugin_loader_iface_init (gpointer g_iface,
|
||||
gpointer iface_data)
|
||||
{
|
||||
PlumaPluginLoaderInterface *iface = (PlumaPluginLoaderInterface *)g_iface;
|
||||
XeditPluginLoaderInterface *iface = (XeditPluginLoaderInterface *)g_iface;
|
||||
|
||||
iface->get_id = pluma_plugin_loader_iface_get_id;
|
||||
iface->load = pluma_plugin_loader_iface_load;
|
||||
iface->unload = pluma_plugin_loader_iface_unload;
|
||||
iface->get_id = xedit_plugin_loader_iface_get_id;
|
||||
iface->load = xedit_plugin_loader_iface_load;
|
||||
iface->unload = xedit_plugin_loader_iface_unload;
|
||||
}
|
||||
|
||||
static void
|
||||
pluma_plugin_loader_c_finalize (GObject *object)
|
||||
xedit_plugin_loader_c_finalize (GObject *object)
|
||||
{
|
||||
PlumaPluginLoaderC *cloader = PLUMA_PLUGIN_LOADER_C (object);
|
||||
XeditPluginLoaderC *cloader = XEDIT_PLUGIN_LOADER_C (object);
|
||||
GList *infos;
|
||||
GList *item;
|
||||
|
||||
@@ -132,9 +132,9 @@ pluma_plugin_loader_c_finalize (GObject *object)
|
||||
|
||||
for (item = infos; item; item = item->next)
|
||||
{
|
||||
PlumaPluginInfo *info = (PlumaPluginInfo *)item->data;
|
||||
XeditPluginInfo *info = (XeditPluginInfo *)item->data;
|
||||
|
||||
if (pluma_plugin_info_is_active (info))
|
||||
if (xedit_plugin_info_is_active (info))
|
||||
{
|
||||
g_warning ("There are still C plugins loaded during destruction");
|
||||
break;
|
||||
@@ -145,38 +145,38 @@ pluma_plugin_loader_c_finalize (GObject *object)
|
||||
|
||||
g_hash_table_destroy (cloader->priv->loaded_plugins);
|
||||
|
||||
G_OBJECT_CLASS (pluma_plugin_loader_c_parent_class)->finalize (object);
|
||||
G_OBJECT_CLASS (xedit_plugin_loader_c_parent_class)->finalize (object);
|
||||
}
|
||||
|
||||
static void
|
||||
pluma_plugin_loader_c_class_init (PlumaPluginLoaderCClass *klass)
|
||||
xedit_plugin_loader_c_class_init (XeditPluginLoaderCClass *klass)
|
||||
{
|
||||
GObjectClass *object_class = G_OBJECT_CLASS (klass);
|
||||
|
||||
object_class->finalize = pluma_plugin_loader_c_finalize;
|
||||
object_class->finalize = xedit_plugin_loader_c_finalize;
|
||||
|
||||
g_type_class_add_private (object_class, sizeof (PlumaPluginLoaderCPrivate));
|
||||
g_type_class_add_private (object_class, sizeof (XeditPluginLoaderCPrivate));
|
||||
}
|
||||
|
||||
static void
|
||||
pluma_plugin_loader_c_class_finalize (PlumaPluginLoaderCClass *klass)
|
||||
xedit_plugin_loader_c_class_finalize (XeditPluginLoaderCClass *klass)
|
||||
{
|
||||
}
|
||||
|
||||
static void
|
||||
pluma_plugin_loader_c_init (PlumaPluginLoaderC *self)
|
||||
xedit_plugin_loader_c_init (XeditPluginLoaderC *self)
|
||||
{
|
||||
self->priv = PLUMA_PLUGIN_LOADER_C_GET_PRIVATE (self);
|
||||
self->priv = XEDIT_PLUGIN_LOADER_C_GET_PRIVATE (self);
|
||||
|
||||
/* loaded_plugins maps PlumaPluginInfo to a PlumaObjectModule */
|
||||
/* loaded_plugins maps XeditPluginInfo to a XeditObjectModule */
|
||||
self->priv->loaded_plugins = g_hash_table_new (g_direct_hash,
|
||||
g_direct_equal);
|
||||
}
|
||||
|
||||
PlumaPluginLoaderC *
|
||||
pluma_plugin_loader_c_new ()
|
||||
XeditPluginLoaderC *
|
||||
xedit_plugin_loader_c_new ()
|
||||
{
|
||||
GObject *loader = g_object_new (PLUMA_TYPE_PLUGIN_LOADER_C, NULL);
|
||||
GObject *loader = g_object_new (XEDIT_TYPE_PLUGIN_LOADER_C, NULL);
|
||||
|
||||
return PLUMA_PLUGIN_LOADER_C (loader);
|
||||
return XEDIT_PLUGIN_LOADER_C (loader);
|
||||
}
|
60
plugin-loaders/c/xedit-plugin-loader-c.h
Normal file
60
plugin-loaders/c/xedit-plugin-loader-c.h
Normal file
@@ -0,0 +1,60 @@
|
||||
/*
|
||||
* xedit-plugin-loader-c.h
|
||||
* This file is part of xedit
|
||||
*
|
||||
* Copyright (C) 2008 - Jesse van den Kieboom
|
||||
*
|
||||
* 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., 51 Franklin St, Fifth Floor,
|
||||
* Boston, MA 02110-1301, USA.
|
||||
*/
|
||||
|
||||
#ifndef __XEDIT_PLUGIN_LOADER_C_H__
|
||||
#define __XEDIT_PLUGIN_LOADER_C_H__
|
||||
|
||||
#include <xedit/xedit-plugin-loader.h>
|
||||
|
||||
G_BEGIN_DECLS
|
||||
|
||||
#define XEDIT_TYPE_PLUGIN_LOADER_C (xedit_plugin_loader_c_get_type ())
|
||||
#define XEDIT_PLUGIN_LOADER_C(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), XEDIT_TYPE_PLUGIN_LOADER_C, XeditPluginLoaderC))
|
||||
#define XEDIT_PLUGIN_LOADER_C_CONST(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), XEDIT_TYPE_PLUGIN_LOADER_C, XeditPluginLoaderC const))
|
||||
#define XEDIT_PLUGIN_LOADER_C_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), XEDIT_TYPE_PLUGIN_LOADER_C, XeditPluginLoaderCClass))
|
||||
#define XEDIT_IS_PLUGIN_LOADER_C(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), XEDIT_TYPE_PLUGIN_LOADER_C))
|
||||
#define XEDIT_IS_PLUGIN_LOADER_C_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), XEDIT_TYPE_PLUGIN_LOADER_C))
|
||||
#define XEDIT_PLUGIN_LOADER_C_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), XEDIT_TYPE_PLUGIN_LOADER_C, XeditPluginLoaderCClass))
|
||||
|
||||
typedef struct _XeditPluginLoaderC XeditPluginLoaderC;
|
||||
typedef struct _XeditPluginLoaderCClass XeditPluginLoaderCClass;
|
||||
typedef struct _XeditPluginLoaderCPrivate XeditPluginLoaderCPrivate;
|
||||
|
||||
struct _XeditPluginLoaderC {
|
||||
GObject parent;
|
||||
|
||||
XeditPluginLoaderCPrivate *priv;
|
||||
};
|
||||
|
||||
struct _XeditPluginLoaderCClass {
|
||||
GObjectClass parent_class;
|
||||
};
|
||||
|
||||
GType xedit_plugin_loader_c_get_type (void) G_GNUC_CONST;
|
||||
XeditPluginLoaderC *xedit_plugin_loader_c_new(void);
|
||||
|
||||
/* All the loaders must implement this function */
|
||||
G_MODULE_EXPORT GType register_xedit_plugin_loader (GTypeModule * module);
|
||||
|
||||
G_END_DECLS
|
||||
|
||||
#endif /* __XEDIT_PLUGIN_LOADER_C_H__ */
|
@@ -1,36 +1,36 @@
|
||||
# C plugin loader
|
||||
|
||||
SUBDIRS = bindings
|
||||
loaderdir = $(libdir)/pluma/plugin-loaders
|
||||
loaderdir = $(libdir)/xedit/plugin-loaders
|
||||
|
||||
AM_CPPFLAGS = \
|
||||
-I$(top_srcdir) \
|
||||
-I$(top_builddir) \
|
||||
-I$(top_srcdir)/pluma \
|
||||
-I$(top_builddir)/pluma \
|
||||
$(PLUMA_CFLAGS) \
|
||||
-I$(top_srcdir)/xedit \
|
||||
-I$(top_builddir)/xedit \
|
||||
$(XEDIT_CFLAGS) \
|
||||
$(WARN_CFLAGS) \
|
||||
$(DISABLE_DEPRECATED_CFLAGS) \
|
||||
$(PYGTK_CFLAGS) \
|
||||
$(PYTHON_CFLAGS) \
|
||||
-DPLUMA_PLUGINS_LIBS_DIR=\"$(PLUMA_PLUGINS_LIBS_DIR)\" \
|
||||
-DPLUMA_LOCALEDIR=\""$(prefix)/$(DATADIRNAME)/locale"\"
|
||||
-DXEDIT_PLUGINS_LIBS_DIR=\"$(XEDIT_PLUGINS_LIBS_DIR)\" \
|
||||
-DXEDIT_LOCALEDIR=\""$(prefix)/$(DATADIRNAME)/locale"\"
|
||||
|
||||
loader_LTLIBRARIES = libpythonloader.la
|
||||
|
||||
|
||||
NOINST_H_FILES = \
|
||||
pluma-plugin-loader-python.h \
|
||||
pluma-plugin-python.h
|
||||
xedit-plugin-loader-python.h \
|
||||
xedit-plugin-python.h
|
||||
|
||||
libpythonloader_la_SOURCES = \
|
||||
pluma-plugin-loader-python.c \
|
||||
pluma-plugin-python.c \
|
||||
xedit-plugin-loader-python.c \
|
||||
xedit-plugin-python.c \
|
||||
$(NOINST_H_FILES)
|
||||
|
||||
libpythonloader_la_LDFLAGS = $(LOADER_LIBTOOL_FLAGS)
|
||||
libpythonloader_la_LIBADD = \
|
||||
$(PLUMA_LIBS) \
|
||||
bindings/pluma.la
|
||||
$(XEDIT_LIBS) \
|
||||
bindings/xedit.la
|
||||
|
||||
-include $(top_srcdir)/git.mk
|
||||
|
@@ -1,39 +1,39 @@
|
||||
## Process this file with automake to produce Makefile.in
|
||||
|
||||
noinst_LTLIBRARIES = \
|
||||
pluma.la
|
||||
xedit.la
|
||||
|
||||
nodist_pluma_la_SOURCES = \
|
||||
pluma.c \
|
||||
plumautils.c \
|
||||
plumacommands.c
|
||||
nodist_xedit_la_SOURCES = \
|
||||
xedit.c \
|
||||
xeditutils.c \
|
||||
xeditcommands.c
|
||||
|
||||
pluma_la_LDFLAGS = \
|
||||
xedit_la_LDFLAGS = \
|
||||
-module -avoid-version
|
||||
|
||||
pluma_la_LIBADD = \
|
||||
xedit_la_LIBADD = \
|
||||
$(PYTHON_LIB_LOC) \
|
||||
$(PYTHON_LIBS) \
|
||||
$(PYTHON_EXTRA_LIBS) \
|
||||
$(PYGTK_LIBS)
|
||||
|
||||
pluma_la_CFLAGS = \
|
||||
xedit_la_CFLAGS = \
|
||||
-I$(top_srcdir) \
|
||||
-I$(top_builddir) \
|
||||
-I$(top_srcdir)/pluma \
|
||||
-I$(top_builddir)/pluma \
|
||||
-I$(top_srcdir)/xedit \
|
||||
-I$(top_builddir)/xedit \
|
||||
-I$(top_srcdir)/plugin-loaders/python \
|
||||
-I$(top_builddir)/plugin-loaders/python \
|
||||
$(PLUMA_CFLAGS) \
|
||||
$(XEDIT_CFLAGS) \
|
||||
$(NO_STRICT_ALIASING_CFLAGS) \
|
||||
$(PYGTK_CFLAGS) \
|
||||
$(PYTHON_CFLAGS) \
|
||||
$(AM_CFLAGS)
|
||||
|
||||
$(top_builddir)/pluma/pluma-enum-types.h:
|
||||
cd $(top_builddir)/pluma && $(MAKE) pluma-enum-types.h
|
||||
$(top_builddir)/xedit/xedit-enum-types.h:
|
||||
cd $(top_builddir)/xedit && $(MAKE) xedit-enum-types.h
|
||||
|
||||
pluma.c: pluma.defs pluma.override plumaplugin.override plumamessage.override $(top_builddir)/pluma/pluma-enum-types.h
|
||||
xedit.c: xedit.defs xedit.override xeditplugin.override xeditmessage.override $(top_builddir)/xedit/xedit-enum-types.h
|
||||
( cd $(srcdir) && $(PYGTK_CODEGEN) \
|
||||
--register $(PYGTK_DEFSDIR)/pango-types.defs \
|
||||
--register $(PYGTK_DEFSDIR)/gdk-types.defs \
|
||||
@@ -43,69 +43,69 @@ pluma.c: pluma.defs pluma.override plumaplugin.override plumamessage.override $(
|
||||
--override $*.override \
|
||||
--prefix py$* $(<F) ) > $@
|
||||
|
||||
plumautils.c: plumautils.defs plumautils.override
|
||||
xeditutils.c: xeditutils.defs xeditutils.override
|
||||
( cd $(srcdir) && $(PYGTK_CODEGEN) \
|
||||
--override $*.override \
|
||||
--prefix py$* $(<F) ) > $@
|
||||
|
||||
plumacommands.c: plumacommands.defs plumacommands.override pluma.defs
|
||||
xeditcommands.c: xeditcommands.defs xeditcommands.override xedit.defs
|
||||
( cd $(srcdir) && $(PYGTK_CODEGEN) \
|
||||
--register pluma.defs \
|
||||
--register xedit.defs \
|
||||
--register $(PYGTK_DEFSDIR)/gtk-types.defs \
|
||||
--override $*.override \
|
||||
--prefix py$* $(<F) ) > $@
|
||||
|
||||
BINDING_PLUMA_HEADERS_SRCDIR_IN = \
|
||||
pluma/pluma-app.h \
|
||||
pluma/pluma-document.h \
|
||||
pluma/pluma-encodings.h \
|
||||
pluma/pluma-plugin.h \
|
||||
plugin-loaders/python/pluma-plugin-python.h \
|
||||
pluma/pluma-view.h \
|
||||
pluma/pluma-statusbar.h \
|
||||
pluma/pluma-tab.h \
|
||||
pluma/pluma-panel.h \
|
||||
pluma/pluma-window.h \
|
||||
pluma/pluma-help.h \
|
||||
pluma/pluma-debug.h \
|
||||
pluma/pluma-message-type.h \
|
||||
pluma/pluma-message.h \
|
||||
pluma/pluma-message-bus.h \
|
||||
pluma/pluma-language-manager.h
|
||||
BINDING_XEDIT_HEADERS_SRCDIR_IN = \
|
||||
xedit/xedit-app.h \
|
||||
xedit/xedit-document.h \
|
||||
xedit/xedit-encodings.h \
|
||||
xedit/xedit-plugin.h \
|
||||
plugin-loaders/python/xedit-plugin-python.h \
|
||||
xedit/xedit-view.h \
|
||||
xedit/xedit-statusbar.h \
|
||||
xedit/xedit-tab.h \
|
||||
xedit/xedit-panel.h \
|
||||
xedit/xedit-window.h \
|
||||
xedit/xedit-help.h \
|
||||
xedit/xedit-debug.h \
|
||||
xedit/xedit-message-type.h \
|
||||
xedit/xedit-message.h \
|
||||
xedit/xedit-message-bus.h \
|
||||
xedit/xedit-language-manager.h
|
||||
|
||||
BINDING_UTILS_HEADERS_SRCDIR_IN = \
|
||||
pluma/pluma-utils.h
|
||||
xedit/xedit-utils.h
|
||||
|
||||
BINDING_COMMANDS_HEADERS_SRCDIR_IN = \
|
||||
pluma/pluma-commands.h
|
||||
xedit/xedit-commands.h
|
||||
|
||||
BINDING_HEADERS_BUILDDIR_IN =
|
||||
|
||||
BINDING_PLUMA_HEADERS_SRCDIR := $(addprefix $(top_srcdir)/,$(BINDING_PLUMA_HEADERS_SRCDIR_IN))
|
||||
BINDING_XEDIT_HEADERS_SRCDIR := $(addprefix $(top_srcdir)/,$(BINDING_XEDIT_HEADERS_SRCDIR_IN))
|
||||
BINDING_UTILS_HEADERS_SRCDIR := $(addprefix $(top_srcdir)/,$(BINDING_UTILS_HEADERS_SRCDIR_IN))
|
||||
BINDING_COMMANDS_HEADERS_SRCDIR := $(addprefix $(top_srcdir)/,$(BINDING_COMMANDS_HEADERS_SRCDIR_IN))
|
||||
|
||||
BINDING_HEADERS_BUILDDIR := $(addprefix $(top_builddir)/,$(BINDING_HEADERS_BUILDDIR_IN))
|
||||
|
||||
regenerate-python-binding:
|
||||
$(PYGTK_H2DEF) $(sort $(BINDING_PLUMA_HEADERS_SRCDIR) $(BINDING_HEADERS_BUILDDIR)) > pluma.defs.new
|
||||
$(PYGTK_H2DEF) $(sort $(BINDING_UTILS_HEADERS_SRCDIR) $(BINDING_HEADERS_BUILDDIR)) > plumautils.defs.new
|
||||
$(PYGTK_H2DEF) $(sort $(BINDING_COMMANDS_HEADERS_SRCDIR) $(BINDING_HEADERS_BUILDDIR)) > plumacommands.defs.new
|
||||
$(PYGTK_H2DEF) $(sort $(BINDING_XEDIT_HEADERS_SRCDIR) $(BINDING_HEADERS_BUILDDIR)) > xedit.defs.new
|
||||
$(PYGTK_H2DEF) $(sort $(BINDING_UTILS_HEADERS_SRCDIR) $(BINDING_HEADERS_BUILDDIR)) > xeditutils.defs.new
|
||||
$(PYGTK_H2DEF) $(sort $(BINDING_COMMANDS_HEADERS_SRCDIR) $(BINDING_HEADERS_BUILDDIR)) > xeditcommands.defs.new
|
||||
|
||||
BUILT_SOURCES = \
|
||||
pluma.c \
|
||||
plumautils.c \
|
||||
plumacommands.c
|
||||
xedit.c \
|
||||
xeditutils.c \
|
||||
xeditcommands.c
|
||||
|
||||
EXTRA_DIST = \
|
||||
pluma.override \
|
||||
pluma.defs \
|
||||
plumautils.override \
|
||||
plumautils.defs \
|
||||
plumacommands.override \
|
||||
plumacommands.defs \
|
||||
plumamessage.override \
|
||||
plumaplugin.override
|
||||
xedit.override \
|
||||
xedit.defs \
|
||||
xeditutils.override \
|
||||
xeditutils.defs \
|
||||
xeditcommands.override \
|
||||
xeditcommands.defs \
|
||||
xeditmessage.override \
|
||||
xeditplugin.override
|
||||
|
||||
CLEANFILES = $(BUILT_SOURCES)
|
||||
|
||||
|
File diff suppressed because it is too large
Load Diff
1461
plugin-loaders/python/bindings/xedit.defs
Normal file
1461
plugin-loaders/python/bindings/xedit.defs
Normal file
File diff suppressed because it is too large
Load Diff
@@ -3,19 +3,19 @@ headers
|
||||
#include <pygobject.h>
|
||||
#include <pygtk/pygtk.h>
|
||||
|
||||
#include <pluma/pluma-language-manager.h>
|
||||
#include <pluma/pluma-plugin.h>
|
||||
#include <pluma/pluma-app.h>
|
||||
#include <pluma/pluma-encodings.h>
|
||||
#include <pluma/pluma-enum-types.h>
|
||||
#include <pluma/pluma-statusbar.h>
|
||||
#include <pluma/pluma-debug.h>
|
||||
#include <pluma/pluma-help.h>
|
||||
#include <xedit/xedit-language-manager.h>
|
||||
#include <xedit/xedit-plugin.h>
|
||||
#include <xedit/xedit-app.h>
|
||||
#include <xedit/xedit-encodings.h>
|
||||
#include <xedit/xedit-enum-types.h>
|
||||
#include <xedit/xedit-statusbar.h>
|
||||
#include <xedit/xedit-debug.h>
|
||||
#include <xedit/xedit-help.h>
|
||||
|
||||
#include "pluma-plugin-python.h"
|
||||
#include "xedit-plugin-python.h"
|
||||
|
||||
void pypluma_register_classes (PyObject *d);
|
||||
void pypluma_add_constants (PyObject *module, const gchar *strip_prefix);
|
||||
void pyxedit_register_classes (PyObject *d);
|
||||
void pyxedit_add_constants (PyObject *module, const gchar *strip_prefix);
|
||||
|
||||
static PyObject *
|
||||
_helper_wrap_gobject_glist (const GList *list)
|
||||
@@ -62,10 +62,10 @@ _helper_wrap_gobject_gslist (const GSList *list)
|
||||
}
|
||||
%%
|
||||
include
|
||||
plumaplugin.override
|
||||
plumamessage.override
|
||||
xeditplugin.override
|
||||
xeditmessage.override
|
||||
%%
|
||||
modulename pluma
|
||||
modulename xedit
|
||||
%%
|
||||
import gtk.Widget as PyGtkWidget_Type
|
||||
import gobject.GObject as PyGObject_Type
|
||||
@@ -81,51 +81,51 @@ import gtksourceview2.LanguageManager as PyGtkSourceLanguageManager_Type
|
||||
%%
|
||||
ignore-glob
|
||||
*_get_type
|
||||
pluma_document_error_quark
|
||||
pluma_panel_add_item_with_stock_icon
|
||||
xedit_document_error_quark
|
||||
xedit_panel_add_item_with_stock_icon
|
||||
%%
|
||||
override pluma_app_create_window kwargs
|
||||
override xedit_app_create_window kwargs
|
||||
static PyObject *
|
||||
_wrap_pluma_app_create_window(PyGObject *self, PyObject *args, PyObject *kwargs)
|
||||
_wrap_xedit_app_create_window(PyGObject *self, PyObject *args, PyObject *kwargs)
|
||||
{
|
||||
static char *kwlist[] = { "screen", NULL};
|
||||
PyGObject *screen = NULL;
|
||||
PlumaWindow *ret;
|
||||
XeditWindow *ret;
|
||||
|
||||
if (!PyArg_ParseTupleAndKeywords(args, kwargs,
|
||||
"|O!", kwlist,
|
||||
&PyGdkScreen_Type, &screen))
|
||||
return NULL;
|
||||
|
||||
ret = pluma_app_create_window(PLUMA_APP(self->obj),
|
||||
ret = xedit_app_create_window(XEDIT_APP(self->obj),
|
||||
screen ? GDK_SCREEN(screen->obj) : NULL);
|
||||
|
||||
/* pygobject_new handles NULL checking */
|
||||
return pygobject_new((GObject *)ret);
|
||||
}
|
||||
%%
|
||||
override pluma_app_get_windows
|
||||
override xedit_app_get_windows
|
||||
static PyObject *
|
||||
_wrap_pluma_app_get_windows(PyGObject *self)
|
||||
_wrap_xedit_app_get_windows(PyGObject *self)
|
||||
{
|
||||
const GList *list;
|
||||
PyObject *py_list;
|
||||
|
||||
list = pluma_app_get_windows (PLUMA_APP (self->obj));
|
||||
list = xedit_app_get_windows (XEDIT_APP (self->obj));
|
||||
|
||||
py_list = _helper_wrap_gobject_glist (list);
|
||||
|
||||
return py_list;
|
||||
}
|
||||
%%
|
||||
override pluma_app_get_views
|
||||
override xedit_app_get_views
|
||||
static PyObject *
|
||||
_wrap_pluma_app_get_views(PyGObject *self)
|
||||
_wrap_xedit_app_get_views(PyGObject *self)
|
||||
{
|
||||
GList *list;
|
||||
PyObject *py_list;
|
||||
|
||||
list = pluma_app_get_views (PLUMA_APP (self->obj));
|
||||
list = xedit_app_get_views (XEDIT_APP (self->obj));
|
||||
|
||||
py_list = _helper_wrap_gobject_glist (list);
|
||||
|
||||
@@ -134,14 +134,14 @@ _wrap_pluma_app_get_views(PyGObject *self)
|
||||
return py_list;
|
||||
}
|
||||
%%
|
||||
override pluma_app_get_documents
|
||||
override xedit_app_get_documents
|
||||
static PyObject *
|
||||
_wrap_pluma_app_get_documents(PyGObject *self)
|
||||
_wrap_xedit_app_get_documents(PyGObject *self)
|
||||
{
|
||||
GList *list;
|
||||
PyObject *py_list;
|
||||
|
||||
list = pluma_app_get_documents (PLUMA_APP (self->obj));
|
||||
list = xedit_app_get_documents (XEDIT_APP (self->obj));
|
||||
|
||||
py_list = _helper_wrap_gobject_glist (list);
|
||||
|
||||
@@ -150,14 +150,14 @@ _wrap_pluma_app_get_documents(PyGObject *self)
|
||||
return py_list;
|
||||
}
|
||||
%%
|
||||
override pluma_window_get_documents
|
||||
override xedit_window_get_documents
|
||||
static PyObject *
|
||||
_wrap_pluma_window_get_documents(PyGObject *self)
|
||||
_wrap_xedit_window_get_documents(PyGObject *self)
|
||||
{
|
||||
GList *list;
|
||||
PyObject *py_list;
|
||||
|
||||
list = pluma_window_get_documents (PLUMA_WINDOW (self->obj));
|
||||
list = xedit_window_get_documents (XEDIT_WINDOW (self->obj));
|
||||
|
||||
py_list = _helper_wrap_gobject_glist (list);
|
||||
|
||||
@@ -166,14 +166,14 @@ _wrap_pluma_window_get_documents(PyGObject *self)
|
||||
return py_list;
|
||||
}
|
||||
%%
|
||||
override pluma_window_get_unsaved_documents
|
||||
override xedit_window_get_unsaved_documents
|
||||
static PyObject *
|
||||
_wrap_pluma_window_get_unsaved_documents(PyGObject *self)
|
||||
_wrap_xedit_window_get_unsaved_documents(PyGObject *self)
|
||||
{
|
||||
GList *list;
|
||||
PyObject *py_list;
|
||||
|
||||
list = pluma_window_get_unsaved_documents (PLUMA_WINDOW (self->obj));
|
||||
list = xedit_window_get_unsaved_documents (XEDIT_WINDOW (self->obj));
|
||||
|
||||
py_list = _helper_wrap_gobject_glist (list);
|
||||
|
||||
@@ -182,14 +182,14 @@ _wrap_pluma_window_get_unsaved_documents(PyGObject *self)
|
||||
return py_list;
|
||||
}
|
||||
%%
|
||||
override pluma_window_get_views
|
||||
override xedit_window_get_views
|
||||
static PyObject *
|
||||
_wrap_pluma_window_get_views(PyGObject *self)
|
||||
_wrap_xedit_window_get_views(PyGObject *self)
|
||||
{
|
||||
GList *list;
|
||||
PyObject *py_list;
|
||||
|
||||
list = pluma_window_get_views (PLUMA_WINDOW (self->obj));
|
||||
list = xedit_window_get_views (XEDIT_WINDOW (self->obj));
|
||||
|
||||
py_list = _helper_wrap_gobject_glist (list);
|
||||
|
||||
@@ -198,9 +198,9 @@ _wrap_pluma_window_get_views(PyGObject *self)
|
||||
return py_list;
|
||||
}
|
||||
%%
|
||||
override pluma_window_close_tabs kwargs
|
||||
override xedit_window_close_tabs kwargs
|
||||
static PyObject *
|
||||
_wrap_pluma_window_close_tabs (PyGObject *self,
|
||||
_wrap_xedit_window_close_tabs (PyGObject *self,
|
||||
PyObject *args,
|
||||
PyObject *kwargs)
|
||||
{
|
||||
@@ -210,7 +210,7 @@ _wrap_pluma_window_close_tabs (PyGObject *self,
|
||||
int len, i;
|
||||
|
||||
if (!PyArg_ParseTupleAndKeywords (args, kwargs,
|
||||
"O:PlumaWindow.close_tabs", kwlist,
|
||||
"O:XeditWindow.close_tabs", kwlist,
|
||||
&list))
|
||||
return NULL;
|
||||
|
||||
@@ -228,7 +228,7 @@ _wrap_pluma_window_close_tabs (PyGObject *self,
|
||||
item = PySequence_GetItem (list, i);
|
||||
Py_DECREF(item);
|
||||
|
||||
if (!pygobject_check (item, &PyPlumaTab_Type))
|
||||
if (!pygobject_check (item, &PyXeditTab_Type))
|
||||
{
|
||||
PyErr_SetString (PyExc_TypeError,
|
||||
"sequence item not a Gtkwidget object");
|
||||
@@ -239,22 +239,22 @@ _wrap_pluma_window_close_tabs (PyGObject *self,
|
||||
glist = g_list_append (glist, pygobject_get (item));
|
||||
}
|
||||
|
||||
pluma_window_close_tabs (PLUMA_WINDOW (self->obj), glist);
|
||||
xedit_window_close_tabs (XEDIT_WINDOW (self->obj), glist);
|
||||
|
||||
g_list_free (glist);
|
||||
Py_INCREF (Py_None);
|
||||
return Py_None;
|
||||
}
|
||||
%%
|
||||
override pluma_document_get_search_text
|
||||
override xedit_document_get_search_text
|
||||
static PyObject *
|
||||
_wrap_pluma_document_get_search_text(PyGObject *self)
|
||||
_wrap_xedit_document_get_search_text(PyGObject *self)
|
||||
{
|
||||
PyObject *tuple, *string;
|
||||
guint flags;
|
||||
gchar *ret;
|
||||
|
||||
ret = pluma_document_get_search_text (PLUMA_DOCUMENT (self->obj), &flags);
|
||||
ret = xedit_document_get_search_text (XEDIT_DOCUMENT (self->obj), &flags);
|
||||
|
||||
tuple = PyTuple_New(2);
|
||||
if (ret) {
|
||||
@@ -271,9 +271,9 @@ _wrap_pluma_document_get_search_text(PyGObject *self)
|
||||
return tuple;
|
||||
}
|
||||
%%
|
||||
override pluma_panel_add_item kwargs
|
||||
override xedit_panel_add_item kwargs
|
||||
static PyObject *
|
||||
_wrap_pluma_panel_add_item(PyGObject *self, PyObject *args, PyObject *kwargs)
|
||||
_wrap_xedit_panel_add_item(PyGObject *self, PyObject *args, PyObject *kwargs)
|
||||
{
|
||||
static char *kwlist1[] = { "item", "name", "image", NULL };
|
||||
static char *kwlist2[] = { "item", "name", "stock_id", NULL };
|
||||
@@ -281,16 +281,16 @@ _wrap_pluma_panel_add_item(PyGObject *self, PyObject *args, PyObject *kwargs)
|
||||
char *name = NULL;
|
||||
char *stock_id = NULL;
|
||||
|
||||
if (PyArg_ParseTupleAndKeywords(args, kwargs, "O!sO!:PlumaPanel.add_item", kwlist1, &PyGtkWidget_Type, &item, &name, &PyGtkImage_Type, &image)) {
|
||||
pluma_panel_add_item(PLUMA_PANEL(self->obj), GTK_WIDGET(item->obj), name, GTK_WIDGET(image->obj));
|
||||
if (PyArg_ParseTupleAndKeywords(args, kwargs, "O!sO!:XeditPanel.add_item", kwlist1, &PyGtkWidget_Type, &item, &name, &PyGtkImage_Type, &image)) {
|
||||
xedit_panel_add_item(XEDIT_PANEL(self->obj), GTK_WIDGET(item->obj), name, GTK_WIDGET(image->obj));
|
||||
Py_INCREF(Py_None);
|
||||
return Py_None;
|
||||
}
|
||||
|
||||
PyErr_Clear();
|
||||
|
||||
if (PyArg_ParseTupleAndKeywords(args, kwargs, "O!ss:PlumaPanel.add_item", kwlist2, &PyGtkWidget_Type, &item, &name, &stock_id)) {
|
||||
pluma_panel_add_item_with_stock_icon(PLUMA_PANEL(self->obj), GTK_WIDGET(item->obj), name, stock_id);
|
||||
if (PyArg_ParseTupleAndKeywords(args, kwargs, "O!ss:XeditPanel.add_item", kwlist2, &PyGtkWidget_Type, &item, &name, &stock_id)) {
|
||||
xedit_panel_add_item_with_stock_icon(XEDIT_PANEL(self->obj), GTK_WIDGET(item->obj), name, stock_id);
|
||||
Py_INCREF(Py_None);
|
||||
return Py_None;
|
||||
}
|
||||
@@ -300,64 +300,64 @@ _wrap_pluma_panel_add_item(PyGObject *self, PyObject *args, PyObject *kwargs)
|
||||
return NULL;
|
||||
}
|
||||
%%
|
||||
override pluma_app_get_default_deprecated
|
||||
override xedit_app_get_default_deprecated
|
||||
/* deprecated wrappers */
|
||||
static PyObject *
|
||||
_wrap_pluma_app_get_default_deprecated(PyObject *self)
|
||||
_wrap_xedit_app_get_default_deprecated(PyObject *self)
|
||||
{
|
||||
if (PyErr_Warn(PyExc_DeprecationWarning, "use pluma.app_get_default instead") < 0)
|
||||
if (PyErr_Warn(PyExc_DeprecationWarning, "use xedit.app_get_default instead") < 0)
|
||||
return NULL;
|
||||
return _wrap_pluma_app_get_default(self);
|
||||
return _wrap_xedit_app_get_default(self);
|
||||
}
|
||||
%%
|
||||
override pluma_encoding_get_from_charset_deprecated kwargs
|
||||
override xedit_encoding_get_from_charset_deprecated kwargs
|
||||
static PyObject *
|
||||
_wrap_pluma_encoding_get_from_charset_deprecated(PyObject *self, PyObject *args, PyObject *kwargs)
|
||||
_wrap_xedit_encoding_get_from_charset_deprecated(PyObject *self, PyObject *args, PyObject *kwargs)
|
||||
{
|
||||
if (PyErr_Warn(PyExc_DeprecationWarning, "use pluma.encoding_get_from_charset instead") < 0)
|
||||
if (PyErr_Warn(PyExc_DeprecationWarning, "use xedit.encoding_get_from_charset instead") < 0)
|
||||
return NULL;
|
||||
return _wrap_pluma_encoding_get_from_charset(self, args, kwargs);
|
||||
return _wrap_xedit_encoding_get_from_charset(self, args, kwargs);
|
||||
}
|
||||
%%
|
||||
override pluma_encoding_get_from_index_deprecated kwargs
|
||||
override xedit_encoding_get_from_index_deprecated kwargs
|
||||
static PyObject *
|
||||
_wrap_pluma_encoding_get_from_index_deprecated(PyObject *self, PyObject *args, PyObject *kwargs)
|
||||
_wrap_xedit_encoding_get_from_index_deprecated(PyObject *self, PyObject *args, PyObject *kwargs)
|
||||
{
|
||||
if (PyErr_Warn(PyExc_DeprecationWarning, "use pluma.encoding_get_from_index instead") < 0)
|
||||
if (PyErr_Warn(PyExc_DeprecationWarning, "use xedit.encoding_get_from_index instead") < 0)
|
||||
return NULL;
|
||||
return _wrap_pluma_encoding_get_from_index(self, args, kwargs);
|
||||
return _wrap_xedit_encoding_get_from_index(self, args, kwargs);
|
||||
}
|
||||
%%
|
||||
override pluma_encoding_get_utf8_deprecated
|
||||
override xedit_encoding_get_utf8_deprecated
|
||||
static PyObject *
|
||||
_wrap_pluma_encoding_get_utf8_deprecated(PyObject *self)
|
||||
_wrap_xedit_encoding_get_utf8_deprecated(PyObject *self)
|
||||
{
|
||||
if (PyErr_Warn(PyExc_DeprecationWarning, "use pluma.encoding_get_utf8 instead") < 0)
|
||||
if (PyErr_Warn(PyExc_DeprecationWarning, "use xedit.encoding_get_utf8 instead") < 0)
|
||||
return NULL;
|
||||
return _wrap_pluma_encoding_get_utf8(self);
|
||||
return _wrap_xedit_encoding_get_utf8(self);
|
||||
}
|
||||
%%
|
||||
override pluma_encoding_get_current_deprecated
|
||||
override xedit_encoding_get_current_deprecated
|
||||
static PyObject *
|
||||
_wrap_pluma_encoding_get_current_deprecated(PyObject *self)
|
||||
_wrap_xedit_encoding_get_current_deprecated(PyObject *self)
|
||||
{
|
||||
if (PyErr_Warn(PyExc_DeprecationWarning, "use pluma.encoding_get_current instead") < 0)
|
||||
if (PyErr_Warn(PyExc_DeprecationWarning, "use xedit.encoding_get_current instead") < 0)
|
||||
return NULL;
|
||||
return _wrap_pluma_encoding_get_current(self);
|
||||
return _wrap_xedit_encoding_get_current(self);
|
||||
}
|
||||
%%
|
||||
override pluma_tab_get_from_document_deprecated kwargs
|
||||
override xedit_tab_get_from_document_deprecated kwargs
|
||||
static PyObject *
|
||||
_wrap_pluma_tab_get_from_document_deprecated(PyObject *self, PyObject *args, PyObject *kwargs)
|
||||
_wrap_xedit_tab_get_from_document_deprecated(PyObject *self, PyObject *args, PyObject *kwargs)
|
||||
{
|
||||
if (PyErr_Warn(PyExc_DeprecationWarning, "use pluma.tab_get_from_document instead") < 0)
|
||||
if (PyErr_Warn(PyExc_DeprecationWarning, "use xedit.tab_get_from_document instead") < 0)
|
||||
return NULL;
|
||||
return _wrap_pluma_tab_get_from_document(self, args, kwargs);
|
||||
return _wrap_xedit_tab_get_from_document(self, args, kwargs);
|
||||
}
|
||||
%%
|
||||
override pluma_language_manager_list_languages_sorted kwargs
|
||||
override xedit_language_manager_list_languages_sorted kwargs
|
||||
static PyObject *
|
||||
_wrap_pluma_language_manager_list_languages_sorted(PyObject *self, PyObject *args, PyObject *kwargs)
|
||||
_wrap_xedit_language_manager_list_languages_sorted(PyObject *self, PyObject *args, PyObject *kwargs)
|
||||
{
|
||||
static char *kwlist[] = { "lm", "include_hidden", NULL };
|
||||
PyGObject *lm;
|
||||
@@ -371,7 +371,7 @@ _wrap_pluma_language_manager_list_languages_sorted(PyObject *self, PyObject *arg
|
||||
&include_hidden))
|
||||
return NULL;
|
||||
|
||||
list = pluma_language_manager_list_languages_sorted (GTK_SOURCE_LANGUAGE_MANAGER (lm->obj),
|
||||
list = xedit_language_manager_list_languages_sorted (GTK_SOURCE_LANGUAGE_MANAGER (lm->obj),
|
||||
include_hidden);
|
||||
|
||||
py_list = _helper_wrap_gobject_gslist (list);
|
||||
@@ -381,16 +381,16 @@ _wrap_pluma_language_manager_list_languages_sorted(PyObject *self, PyObject *arg
|
||||
return py_list;
|
||||
}
|
||||
%%
|
||||
override pluma_debug kwargs
|
||||
override xedit_debug kwargs
|
||||
static PyObject *
|
||||
_wrap_pluma_debug(PyObject *self, PyObject *args, PyObject *kwargs)
|
||||
_wrap_xedit_debug(PyObject *self, PyObject *args, PyObject *kwargs)
|
||||
{
|
||||
static char *kwlist[] = { "message", NULL };
|
||||
PyObject *traceback_module, *mdict, *func, *traceback, *tuple;
|
||||
PyObject *filename, *lineno, *funcname;
|
||||
char *message = NULL;
|
||||
|
||||
if (g_getenv ("PLUMA_DEBUG_PLUGINS") == NULL)
|
||||
if (g_getenv ("XEDIT_DEBUG_PLUGINS") == NULL)
|
||||
{
|
||||
Py_INCREF (Py_None);
|
||||
return Py_None;
|
||||
@@ -423,12 +423,12 @@ _wrap_pluma_debug(PyObject *self, PyObject *args, PyObject *kwargs)
|
||||
funcname = PyTuple_GetItem (tuple, 2);
|
||||
|
||||
if (message == NULL)
|
||||
pluma_debug (PLUMA_DEBUG_PLUGINS,
|
||||
xedit_debug (XEDIT_DEBUG_PLUGINS,
|
||||
PyString_AsString (filename),
|
||||
PyInt_AsLong (lineno),
|
||||
PyString_AsString (funcname));
|
||||
else
|
||||
pluma_debug_message (PLUMA_DEBUG_PLUGINS,
|
||||
xedit_debug_message (XEDIT_DEBUG_PLUGINS,
|
||||
PyString_AsString (filename),
|
||||
PyInt_AsLong (lineno),
|
||||
PyString_AsString (funcname),
|
||||
@@ -442,18 +442,18 @@ _wrap_pluma_debug(PyObject *self, PyObject *args, PyObject *kwargs)
|
||||
return Py_None;
|
||||
}
|
||||
%%
|
||||
override pluma_statusbar_flash_message kwargs
|
||||
override xedit_statusbar_flash_message kwargs
|
||||
static PyObject *
|
||||
_wrap_pluma_statusbar_flash_message(PyGObject *self, PyObject *args, PyObject *kwargs)
|
||||
_wrap_xedit_statusbar_flash_message(PyGObject *self, PyObject *args, PyObject *kwargs)
|
||||
{
|
||||
static char *kwlist[] = { "context_id", "message", NULL };
|
||||
int context_id;
|
||||
char *message;
|
||||
|
||||
if (!PyArg_ParseTupleAndKeywords(args, kwargs,"is:PlumaStatusbar.flash_message", kwlist, &context_id, &message))
|
||||
if (!PyArg_ParseTupleAndKeywords(args, kwargs,"is:XeditStatusbar.flash_message", kwlist, &context_id, &message))
|
||||
return NULL;
|
||||
|
||||
pluma_statusbar_flash_message(PLUMA_STATUSBAR(self->obj), context_id, "%s", message);
|
||||
xedit_statusbar_flash_message(XEDIT_STATUSBAR(self->obj), context_id, "%s", message);
|
||||
|
||||
Py_INCREF(Py_None);
|
||||
return Py_None;
|
@@ -3,43 +3,43 @@
|
||||
;; Enumerations and flags ...
|
||||
|
||||
|
||||
;; From ../../pluma/pluma-commands.h
|
||||
;; From ../../xedit/xedit-commands.h
|
||||
|
||||
(define-function load_uri
|
||||
(c-name "pluma_commands_load_uri")
|
||||
(c-name "xedit_commands_load_uri")
|
||||
(return-type "none")
|
||||
(parameters
|
||||
'("PlumaWindow*" "window")
|
||||
'("XeditWindow*" "window")
|
||||
'("const-gchar*" "uri")
|
||||
'("const-PlumaEncoding*" "encoding")
|
||||
'("const-XeditEncoding*" "encoding")
|
||||
'("gint" "line_pos")
|
||||
)
|
||||
)
|
||||
|
||||
(define-function load_uris
|
||||
(c-name "pluma_commands_load_uris")
|
||||
(c-name "xedit_commands_load_uris")
|
||||
(return-type "gint")
|
||||
(parameters
|
||||
'("PlumaWindow*" "window")
|
||||
'("XeditWindow*" "window")
|
||||
'("const-GSList*" "uris")
|
||||
'("const-PlumaEncoding*" "encoding")
|
||||
'("const-XeditEncoding*" "encoding")
|
||||
'("gint" "line_pos")
|
||||
)
|
||||
)
|
||||
|
||||
(define-function save_document
|
||||
(c-name "pluma_commands_save_document")
|
||||
(c-name "xedit_commands_save_document")
|
||||
(return-type "none")
|
||||
(parameters
|
||||
'("PlumaWindow*" "window")
|
||||
'("PlumaDocument*" "document")
|
||||
'("XeditWindow*" "window")
|
||||
'("XeditDocument*" "document")
|
||||
)
|
||||
)
|
||||
|
||||
(define-function save_all_documents
|
||||
(c-name "pluma_commands_save_all_documents")
|
||||
(c-name "xedit_commands_save_all_documents")
|
||||
(return-type "none")
|
||||
(parameters
|
||||
'("PlumaWindow*" "window")
|
||||
'("XeditWindow*" "window")
|
||||
)
|
||||
)
|
@@ -5,59 +5,59 @@ headers
|
||||
#include <pygobject.h>
|
||||
#include <pygtk/pygtk.h>
|
||||
|
||||
#include "pluma-commands.h"
|
||||
#include "pluma-window.h"
|
||||
#include "xedit-commands.h"
|
||||
#include "xedit-window.h"
|
||||
|
||||
void pyplumacommands_register_classes (PyObject *d);
|
||||
void pyplumacommands_add_constants (PyObject *module, const gchar *strip_prefix);
|
||||
void pyxeditcommands_register_classes (PyObject *d);
|
||||
void pyxeditcommands_add_constants (PyObject *module, const gchar *strip_prefix);
|
||||
|
||||
%%
|
||||
modulename pluma.commands
|
||||
modulename xedit.commands
|
||||
%%
|
||||
import pluma.Window as PyPlumaWindow_Type
|
||||
import pluma.Document as PyPlumaDocument_Type
|
||||
import xedit.Window as PyXeditWindow_Type
|
||||
import xedit.Document as PyXeditDocument_Type
|
||||
%%
|
||||
ignore-glob
|
||||
_*
|
||||
%%
|
||||
override pluma_commands_load_uri kwargs
|
||||
override xedit_commands_load_uri kwargs
|
||||
static PyObject *
|
||||
_wrap_pluma_commands_load_uri (PyObject *self, PyObject *args, PyObject *kwargs)
|
||||
_wrap_xedit_commands_load_uri (PyObject *self, PyObject *args, PyObject *kwargs)
|
||||
{
|
||||
static char *kwlist[] = { "window", "uri", "encoding", "line_pos", NULL };
|
||||
PyGObject *window;
|
||||
char *uri;
|
||||
int line_pos = 0;
|
||||
PyObject *py_encoding = NULL;
|
||||
PlumaEncoding *encoding = NULL;
|
||||
XeditEncoding *encoding = NULL;
|
||||
|
||||
if (!PyArg_ParseTupleAndKeywords (args, kwargs, "O!s|Oi:load_uri",
|
||||
kwlist, &PyPlumaWindow_Type,
|
||||
kwlist, &PyXeditWindow_Type,
|
||||
&window, &uri, &py_encoding,
|
||||
&line_pos))
|
||||
return NULL;
|
||||
|
||||
if (py_encoding != NULL && py_encoding != Py_None)
|
||||
{
|
||||
if (pyg_boxed_check (py_encoding, PLUMA_TYPE_ENCODING))
|
||||
encoding = pyg_boxed_get (py_encoding, PlumaEncoding);
|
||||
if (pyg_boxed_check (py_encoding, XEDIT_TYPE_ENCODING))
|
||||
encoding = pyg_boxed_get (py_encoding, XeditEncoding);
|
||||
else
|
||||
{
|
||||
PyErr_SetString (PyExc_TypeError,
|
||||
"encoding should be a PlumaEncoding");
|
||||
"encoding should be a XeditEncoding");
|
||||
return NULL;
|
||||
}
|
||||
}
|
||||
|
||||
pluma_commands_load_uri (PLUMA_WINDOW (window->obj), uri, encoding,
|
||||
xedit_commands_load_uri (XEDIT_WINDOW (window->obj), uri, encoding,
|
||||
line_pos);
|
||||
Py_INCREF (Py_None);
|
||||
return Py_None;
|
||||
}
|
||||
%%
|
||||
override pluma_commands_load_uris kwargs
|
||||
override xedit_commands_load_uris kwargs
|
||||
static PyObject *
|
||||
_wrap_pluma_commands_load_uris (PyObject *self, PyObject *args, PyObject *kwargs)
|
||||
_wrap_xedit_commands_load_uris (PyObject *self, PyObject *args, PyObject *kwargs)
|
||||
{
|
||||
static char *kwlist[] = { "window", "uris", "encoding", "line_pos", NULL };
|
||||
PyGObject *window;
|
||||
@@ -66,23 +66,23 @@ _wrap_pluma_commands_load_uris (PyObject *self, PyObject *args, PyObject *kwargs
|
||||
PyObject *py_encoding = NULL;
|
||||
PyObject *list;
|
||||
PyObject *item;
|
||||
PlumaEncoding *encoding = NULL;
|
||||
XeditEncoding *encoding = NULL;
|
||||
int len;
|
||||
int i;
|
||||
|
||||
if (!PyArg_ParseTupleAndKeywords (args, kwargs, "O!O|Oi:load_uri",
|
||||
kwlist, &PyPlumaWindow_Type,
|
||||
kwlist, &PyXeditWindow_Type,
|
||||
&window, &list, &py_encoding,
|
||||
&line_pos))
|
||||
return NULL;
|
||||
|
||||
if (py_encoding != NULL && py_encoding != Py_None)
|
||||
{
|
||||
if (pyg_boxed_check (py_encoding, PLUMA_TYPE_ENCODING))
|
||||
encoding = pyg_boxed_get (py_encoding, PlumaEncoding);
|
||||
if (pyg_boxed_check (py_encoding, XEDIT_TYPE_ENCODING))
|
||||
encoding = pyg_boxed_get (py_encoding, XeditEncoding);
|
||||
else {
|
||||
PyErr_SetString (PyExc_TypeError,
|
||||
"encoding should be a PlumaEncoding");
|
||||
"encoding should be a XeditEncoding");
|
||||
return NULL;
|
||||
}
|
||||
}
|
||||
@@ -113,7 +113,7 @@ _wrap_pluma_commands_load_uris (PyObject *self, PyObject *args, PyObject *kwargs
|
||||
}
|
||||
|
||||
uris = g_slist_reverse (uris);
|
||||
pluma_commands_load_uris (PLUMA_WINDOW (window->obj), uris,
|
||||
xedit_commands_load_uris (XEDIT_WINDOW (window->obj), uris,
|
||||
encoding, line_pos);
|
||||
g_slist_free (uris);
|
||||
|
@@ -1,8 +1,8 @@
|
||||
%%
|
||||
headers
|
||||
|
||||
#include <pluma/pluma-message-bus.h>
|
||||
#include <pluma/pluma-message.h>
|
||||
#include <xedit/xedit-message-bus.h>
|
||||
#include <xedit/xedit-message.h>
|
||||
|
||||
static GType
|
||||
_helper_wrap_get_gtype_from_pytype (PyObject *pytype)
|
||||
@@ -69,7 +69,7 @@ _helper_wrap_get_gvalue_from_pyobject (GValue *gvalue, PyObject *pyvalue)
|
||||
}
|
||||
|
||||
static int
|
||||
_helper_wrap_message_set_value(PlumaMessage *message, PyObject *pykey, PyObject *pyvalue)
|
||||
_helper_wrap_message_set_value(XeditMessage *message, PyObject *pykey, PyObject *pyvalue)
|
||||
{
|
||||
gchar *key;
|
||||
GType gtype;
|
||||
@@ -80,7 +80,7 @@ _helper_wrap_message_set_value(PlumaMessage *message, PyObject *pykey, PyObject
|
||||
if (key == NULL)
|
||||
return 0;
|
||||
|
||||
gtype = pluma_message_get_key_type(message, key);
|
||||
gtype = xedit_message_get_key_type(message, key);
|
||||
|
||||
if (gtype == 0) {
|
||||
PyErr_SetString(PyExc_TypeError, "invalid key");
|
||||
@@ -97,7 +97,7 @@ _helper_wrap_message_set_value(PlumaMessage *message, PyObject *pykey, PyObject
|
||||
return 0;
|
||||
}
|
||||
|
||||
pluma_message_set_value(message, key, &value);
|
||||
xedit_message_set_value(message, key, &value);
|
||||
g_value_unset(&value);
|
||||
g_free (key);
|
||||
|
||||
@@ -141,34 +141,34 @@ _helper_parse_pairs(PyObject *args, PyObject *kwargs, ParsePairFunc func, gpoint
|
||||
}
|
||||
|
||||
static void
|
||||
_helper_message_set(PyObject *key, PyObject *value, PlumaMessage *message)
|
||||
_helper_message_set(PyObject *key, PyObject *value, XeditMessage *message)
|
||||
{
|
||||
_helper_wrap_message_set_value(message, key, value);
|
||||
}
|
||||
|
||||
static void
|
||||
_helper_message_set_values(PlumaMessage *message, PyObject *args, PyObject *kwargs)
|
||||
_helper_message_set_values(XeditMessage *message, PyObject *args, PyObject *kwargs)
|
||||
{
|
||||
_helper_parse_pairs(args, kwargs, (ParsePairFunc)_helper_message_set, message);
|
||||
}
|
||||
|
||||
static PlumaMessage *
|
||||
_helper_wrap_create_message(PlumaMessageBus *bus, PyObject *args, PyObject *kwargs)
|
||||
static XeditMessage *
|
||||
_helper_wrap_create_message(XeditMessageBus *bus, PyObject *args, PyObject *kwargs)
|
||||
{
|
||||
PyObject *pypath, *pymethod, *pydict;
|
||||
|
||||
if (!PyArg_ParseTuple(args, "OO|O:PlumaMessage.create", &pypath, &pymethod, &pydict))
|
||||
if (!PyArg_ParseTuple(args, "OO|O:XeditMessage.create", &pypath, &pymethod, &pydict))
|
||||
return NULL;
|
||||
|
||||
gchar *object_path = _helper_wrap_get_string(pypath);
|
||||
gchar *method = _helper_wrap_get_string(pymethod);
|
||||
|
||||
PlumaMessageType *message_type = pluma_message_bus_lookup (bus, object_path, method);
|
||||
PlumaMessage *message;
|
||||
XeditMessageType *message_type = xedit_message_bus_lookup (bus, object_path, method);
|
||||
XeditMessage *message;
|
||||
|
||||
if (message_type)
|
||||
{
|
||||
message = pluma_message_type_instantiate(message_type, NULL);
|
||||
message = xedit_message_type_instantiate(message_type, NULL);
|
||||
_helper_message_set_values(message, args, kwargs);
|
||||
}
|
||||
else
|
||||
@@ -186,12 +186,12 @@ _helper_wrap_create_message(PlumaMessageBus *bus, PyObject *args, PyObject *kwar
|
||||
typedef struct {
|
||||
PyObject *func;
|
||||
PyObject *data;
|
||||
} PyPlumaCustomNotify;
|
||||
} PyXeditCustomNotify;
|
||||
|
||||
static void
|
||||
pypluma_custom_destroy_notify(gpointer user_data)
|
||||
pyxedit_custom_destroy_notify(gpointer user_data)
|
||||
{
|
||||
PyPlumaCustomNotify *cunote = user_data;
|
||||
PyXeditCustomNotify *cunote = user_data;
|
||||
PyGILState_STATE state;
|
||||
|
||||
g_return_if_fail(user_data);
|
||||
@@ -205,21 +205,21 @@ pypluma_custom_destroy_notify(gpointer user_data)
|
||||
%%
|
||||
ignore-glob
|
||||
*_get_type
|
||||
pluma_message_type_foreach
|
||||
pluma_message_type_instantiate_valist
|
||||
pluma_message_type_new_valist
|
||||
pluma_message_get_valist
|
||||
pluma_message_set_valist
|
||||
pluma_message_set_valuesv
|
||||
pluma_message_bus_disconnect_by_func
|
||||
pluma_message_bus_block_by_func
|
||||
pluma_message_bus_unblock_by_func
|
||||
xedit_message_type_foreach
|
||||
xedit_message_type_instantiate_valist
|
||||
xedit_message_type_new_valist
|
||||
xedit_message_get_valist
|
||||
xedit_message_set_valist
|
||||
xedit_message_set_valuesv
|
||||
xedit_message_bus_disconnect_by_func
|
||||
xedit_message_bus_block_by_func
|
||||
xedit_message_bus_unblock_by_func
|
||||
%%
|
||||
override pluma_message_type_new kwargs
|
||||
override xedit_message_type_new kwargs
|
||||
|
||||
typedef struct
|
||||
{
|
||||
PlumaMessageType *message_type;
|
||||
XeditMessageType *message_type;
|
||||
PyObject *optional;
|
||||
} MessageTypeSetInfo;
|
||||
|
||||
@@ -237,19 +237,19 @@ _message_type_set(PyObject *key, PyObject *value, MessageTypeSetInfo *info)
|
||||
|
||||
gboolean optional = info->optional && PySequence_Contains(info->optional, key);
|
||||
|
||||
pluma_message_type_set(info->message_type, optional, k, gtype, NULL);
|
||||
xedit_message_type_set(info->message_type, optional, k, gtype, NULL);
|
||||
g_free(k);
|
||||
}
|
||||
|
||||
static int
|
||||
_wrap_pluma_message_type_new(PyGObject *self, PyObject *args, PyObject *kwargs)
|
||||
_wrap_xedit_message_type_new(PyGObject *self, PyObject *args, PyObject *kwargs)
|
||||
{
|
||||
PyObject *pypath, *pymethod, *optional = NULL, *pydict;
|
||||
|
||||
if (!PyArg_ParseTuple(args, "OO|OO:PlumaMessageType.new", &pypath, &pymethod, &optional, &pydict))
|
||||
if (!PyArg_ParseTuple(args, "OO|OO:XeditMessageType.new", &pypath, &pymethod, &optional, &pydict))
|
||||
return -1;
|
||||
|
||||
PlumaMessageType *message_type = PLUMA_MESSAGE_TYPE(g_object_new(pyg_type_from_object((PyObject *) self), NULL));
|
||||
XeditMessageType *message_type = XEDIT_MESSAGE_TYPE(g_object_new(pyg_type_from_object((PyObject *) self), NULL));
|
||||
|
||||
MessageTypeSetInfo info = {message_type, optional && PySequence_Check(optional) ? optional : NULL};
|
||||
_helper_parse_pairs (args, kwargs, (ParsePairFunc)_message_type_set, &info);
|
||||
@@ -260,21 +260,21 @@ _wrap_pluma_message_type_new(PyGObject *self, PyObject *args, PyObject *kwargs)
|
||||
return 0;
|
||||
}
|
||||
%%
|
||||
override pluma_message_type_instantiate kwargs
|
||||
override xedit_message_type_instantiate kwargs
|
||||
static PyObject *
|
||||
_wrap_pluma_message_type_instantiate(PyGObject *self, PyObject *args, PyObject *kwargs)
|
||||
_wrap_xedit_message_type_instantiate(PyGObject *self, PyObject *args, PyObject *kwargs)
|
||||
{
|
||||
PlumaMessageType *message_type = PLUMA_MESSAGE_TYPE (self->obj);
|
||||
PlumaMessage *message = pluma_message_type_instantiate(message_type, NULL);
|
||||
XeditMessageType *message_type = XEDIT_MESSAGE_TYPE (self->obj);
|
||||
XeditMessage *message = xedit_message_type_instantiate(message_type, NULL);
|
||||
|
||||
_helper_message_set_values(message, args, kwargs);
|
||||
|
||||
return pygobject_new((GObject *)message);
|
||||
}
|
||||
%%
|
||||
override pluma_message_get args
|
||||
override xedit_message_get args
|
||||
static PyObject *
|
||||
_wrap_pluma_message_get(PyGObject *self, PyObject *args)
|
||||
_wrap_xedit_message_get(PyGObject *self, PyObject *args)
|
||||
{
|
||||
guint len, i;
|
||||
PyObject *ret;
|
||||
@@ -294,7 +294,7 @@ _wrap_pluma_message_get(PyGObject *self, PyObject *args)
|
||||
return NULL;
|
||||
}
|
||||
|
||||
pluma_message_get_value (PLUMA_MESSAGE (self->obj), key, &value);
|
||||
xedit_message_get_value (XEDIT_MESSAGE (self->obj), key, &value);
|
||||
g_free (key);
|
||||
|
||||
PyTuple_SetItem(ret, i, pyg_value_as_pyobject(&value, TRUE));
|
||||
@@ -304,81 +304,81 @@ _wrap_pluma_message_get(PyGObject *self, PyObject *args)
|
||||
return ret;
|
||||
}
|
||||
%%
|
||||
override pluma_message_get_value kwargs
|
||||
override xedit_message_get_value kwargs
|
||||
static PyObject *
|
||||
_wrap_pluma_message_get_value(PyGObject *self, PyObject *args, PyObject *kwargs)
|
||||
_wrap_xedit_message_get_value(PyGObject *self, PyObject *args, PyObject *kwargs)
|
||||
{
|
||||
static char *kwlist[] = { "key", NULL };
|
||||
const gchar *key;
|
||||
PyObject *ret;
|
||||
GValue value = { 0, };
|
||||
|
||||
if (!PyArg_ParseTupleAndKeywords(args, kwargs, "s:PlumaMessage.get_value", kwlist, &key))
|
||||
if (!PyArg_ParseTupleAndKeywords(args, kwargs, "s:XeditMessage.get_value", kwlist, &key))
|
||||
return NULL;
|
||||
|
||||
pluma_message_get_value(PLUMA_MESSAGE(self->obj), key, &value);
|
||||
xedit_message_get_value(XEDIT_MESSAGE(self->obj), key, &value);
|
||||
ret = pyg_value_as_pyobject(&value, TRUE);
|
||||
g_value_unset(&value);
|
||||
|
||||
return ret;
|
||||
}
|
||||
%%
|
||||
override pluma_message_set_value kwargs
|
||||
override xedit_message_set_value kwargs
|
||||
static PyObject *
|
||||
_wrap_pluma_message_set_value(PyGObject *self, PyObject *args, PyObject *kwargs)
|
||||
_wrap_xedit_message_set_value(PyGObject *self, PyObject *args, PyObject *kwargs)
|
||||
{
|
||||
static char *kwlist[] = { "key", "value", NULL };
|
||||
PyObject *pykey, *pyvalue;
|
||||
|
||||
if (!PyArg_ParseTupleAndKeywords(args, kwargs, "OO:PlumaMessage.set_value", kwlist, &pykey, &pyvalue))
|
||||
if (!PyArg_ParseTupleAndKeywords(args, kwargs, "OO:XeditMessage.set_value", kwlist, &pykey, &pyvalue))
|
||||
return NULL;
|
||||
|
||||
if (!_helper_wrap_message_set_value(PLUMA_MESSAGE(self->obj), pykey, pyvalue))
|
||||
if (!_helper_wrap_message_set_value(XEDIT_MESSAGE(self->obj), pykey, pyvalue))
|
||||
return NULL;
|
||||
|
||||
Py_INCREF(Py_None);
|
||||
return Py_None;
|
||||
}
|
||||
%%
|
||||
override pluma_message_set kwargs
|
||||
override xedit_message_set kwargs
|
||||
static PyObject *
|
||||
_wrap_pluma_message_set (PyGObject *self, PyObject *args, PyObject *kwargs) {
|
||||
_helper_message_set_values(PLUMA_MESSAGE(self->obj), args, kwargs);
|
||||
_wrap_xedit_message_set (PyGObject *self, PyObject *args, PyObject *kwargs) {
|
||||
_helper_message_set_values(XEDIT_MESSAGE(self->obj), args, kwargs);
|
||||
|
||||
Py_INCREF(Py_None);
|
||||
return Py_None;
|
||||
}
|
||||
%%
|
||||
override pluma_message_bus_new
|
||||
override xedit_message_bus_new
|
||||
static int
|
||||
_wrap_pluma_message_bus_new(PyGObject *self)
|
||||
_wrap_xedit_message_bus_new(PyGObject *self)
|
||||
{
|
||||
pygobject_construct (self, NULL);
|
||||
|
||||
if (!self->obj) {
|
||||
PyErr_SetString (PyExc_RuntimeError, "could not create pluma.MessageBus object");
|
||||
PyErr_SetString (PyExc_RuntimeError, "could not create xedit.MessageBus object");
|
||||
return -1;
|
||||
}
|
||||
|
||||
return 0;
|
||||
}
|
||||
%%
|
||||
new-constructor PLUMA_TYPE_MESSAGE_BUS
|
||||
new-constructor XEDIT_TYPE_MESSAGE_BUS
|
||||
%%
|
||||
override pluma_message_bus_register kwargs
|
||||
override xedit_message_bus_register kwargs
|
||||
static PyObject *
|
||||
_wrap_pluma_message_bus_register(PyGObject *self, PyObject *args, PyObject *kwargs)
|
||||
_wrap_xedit_message_bus_register(PyGObject *self, PyObject *args, PyObject *kwargs)
|
||||
{
|
||||
PyObject *pypath, *pymethod, *optional = NULL, *pydict;
|
||||
PlumaMessageBus *bus = PLUMA_MESSAGE_BUS(self->obj);
|
||||
XeditMessageBus *bus = XEDIT_MESSAGE_BUS(self->obj);
|
||||
|
||||
if (!PyArg_ParseTuple(args, "OO|OO:PlumaMessageBus.register", &pypath, &pymethod, &optional, &pydict))
|
||||
if (!PyArg_ParseTuple(args, "OO|OO:XeditMessageBus.register", &pypath, &pymethod, &optional, &pydict))
|
||||
return NULL;
|
||||
|
||||
gchar *object_path = _helper_wrap_get_string(pypath);
|
||||
gchar *method = _helper_wrap_get_string(pymethod);
|
||||
|
||||
PlumaMessageType *message_type = pluma_message_bus_register(bus, object_path, method, 0, NULL);
|
||||
XeditMessageType *message_type = xedit_message_bus_register(bus, object_path, method, 0, NULL);
|
||||
|
||||
g_free(object_path);
|
||||
g_free(method);
|
||||
@@ -392,15 +392,15 @@ _wrap_pluma_message_bus_register(PyGObject *self, PyObject *args, PyObject *kwar
|
||||
MessageTypeSetInfo info = {message_type, optional && PySequence_Check(optional) ? optional : NULL};
|
||||
_helper_parse_pairs (args, kwargs, (ParsePairFunc)_message_type_set, &info);
|
||||
|
||||
return pyg_boxed_new(PLUMA_TYPE_MESSAGE_TYPE, message_type, TRUE, TRUE);
|
||||
return pyg_boxed_new(XEDIT_TYPE_MESSAGE_TYPE, message_type, TRUE, TRUE);
|
||||
}
|
||||
%%
|
||||
override pluma_message_bus_connect kwargs
|
||||
override xedit_message_bus_connect kwargs
|
||||
static void
|
||||
pypluma_message_bus_connect_cb(PlumaMessageBus *bus, PlumaMessage *message, gpointer data)
|
||||
pyxedit_message_bus_connect_cb(XeditMessageBus *bus, XeditMessage *message, gpointer data)
|
||||
{
|
||||
PyGILState_STATE state;
|
||||
PyPlumaCustomNotify *cunote = data;
|
||||
PyXeditCustomNotify *cunote = data;
|
||||
PyObject *pybus, *pymessage, *retobj;
|
||||
|
||||
g_assert(cunote->func);
|
||||
@@ -426,16 +426,16 @@ pypluma_message_bus_connect_cb(PlumaMessageBus *bus, PlumaMessage *message, gpoi
|
||||
}
|
||||
|
||||
static PyObject *
|
||||
_wrap_pluma_message_bus_connect(PyGObject *self, PyObject *args, PyObject *kwargs)
|
||||
_wrap_xedit_message_bus_connect(PyGObject *self, PyObject *args, PyObject *kwargs)
|
||||
{
|
||||
static char *kwlist[] = { "domain", "name", "func", "data", NULL };
|
||||
PyObject *pyfunc, *pyarg = NULL;
|
||||
const gchar *domain;
|
||||
const gchar *name;
|
||||
PyPlumaCustomNotify *cunote;
|
||||
PyXeditCustomNotify *cunote;
|
||||
|
||||
if (!PyArg_ParseTupleAndKeywords(args, kwargs,
|
||||
"ssO|O:PlumaMessageBus.connect",
|
||||
"ssO|O:XeditMessageBus.connect",
|
||||
kwlist, &domain, &name, &pyfunc, &pyarg))
|
||||
return NULL;
|
||||
|
||||
@@ -443,63 +443,63 @@ _wrap_pluma_message_bus_connect(PyGObject *self, PyObject *args, PyObject *kwarg
|
||||
PyErr_SetString(PyExc_TypeError, "func must be a callable object");
|
||||
return NULL;
|
||||
}
|
||||
cunote = g_new(PyPlumaCustomNotify, 1);
|
||||
cunote = g_new(PyXeditCustomNotify, 1);
|
||||
Py_INCREF(pyfunc);
|
||||
cunote->func = pyfunc;
|
||||
Py_XINCREF(pyarg);
|
||||
cunote->data = pyarg;
|
||||
|
||||
guint id = pluma_message_bus_connect(PLUMA_MESSAGE_BUS(self->obj),
|
||||
guint id = xedit_message_bus_connect(XEDIT_MESSAGE_BUS(self->obj),
|
||||
domain,
|
||||
name,
|
||||
pypluma_message_bus_connect_cb,
|
||||
pyxedit_message_bus_connect_cb,
|
||||
(gpointer)cunote,
|
||||
pypluma_custom_destroy_notify);
|
||||
pyxedit_custom_destroy_notify);
|
||||
return PyLong_FromUnsignedLong(id);
|
||||
}
|
||||
%%
|
||||
override pluma_message_bus_send kwargs
|
||||
override xedit_message_bus_send kwargs
|
||||
static PyObject *
|
||||
_wrap_pluma_message_bus_send(PyGObject *self, PyObject *args, PyObject *kwargs)
|
||||
_wrap_xedit_message_bus_send(PyGObject *self, PyObject *args, PyObject *kwargs)
|
||||
{
|
||||
/* create a new message object */
|
||||
PlumaMessage *message;
|
||||
PlumaMessageBus *bus = PLUMA_MESSAGE_BUS(self->obj);
|
||||
XeditMessage *message;
|
||||
XeditMessageBus *bus = XEDIT_MESSAGE_BUS(self->obj);
|
||||
message = _helper_wrap_create_message(bus, args, kwargs);
|
||||
|
||||
if (!message)
|
||||
return NULL;
|
||||
|
||||
pluma_message_bus_send_message(bus, message);
|
||||
xedit_message_bus_send_message(bus, message);
|
||||
g_object_unref (message);
|
||||
|
||||
Py_INCREF(Py_None);
|
||||
return Py_None;
|
||||
}
|
||||
%%
|
||||
override pluma_message_bus_send_sync kwargs
|
||||
override xedit_message_bus_send_sync kwargs
|
||||
static PyObject *
|
||||
_wrap_pluma_message_bus_send_sync(PyGObject *self, PyObject *args, PyObject *kwargs)
|
||||
_wrap_xedit_message_bus_send_sync(PyGObject *self, PyObject *args, PyObject *kwargs)
|
||||
{
|
||||
/* create a new message object */
|
||||
PlumaMessage *message;
|
||||
PlumaMessageBus *bus = PLUMA_MESSAGE_BUS(self->obj);
|
||||
XeditMessage *message;
|
||||
XeditMessageBus *bus = XEDIT_MESSAGE_BUS(self->obj);
|
||||
|
||||
message = _helper_wrap_create_message(bus, args, kwargs);
|
||||
|
||||
if (!message)
|
||||
return NULL;
|
||||
|
||||
pluma_message_bus_send_message_sync(bus, message);
|
||||
xedit_message_bus_send_message_sync(bus, message);
|
||||
return pygobject_new((GObject *)message);
|
||||
}
|
||||
%%
|
||||
override-slot PlumaMessage.tp_getattro
|
||||
override-slot XeditMessage.tp_getattro
|
||||
static PyObject *
|
||||
_wrap_pluma_message_tp_getattro(PyObject *self, PyObject *attrname)
|
||||
_wrap_xedit_message_tp_getattro(PyObject *self, PyObject *attrname)
|
||||
{
|
||||
PlumaMessage *message = PLUMA_MESSAGE(((PyGObject *)self)->obj);
|
||||
PlumaMessageType *type;
|
||||
XeditMessage *message = XEDIT_MESSAGE(((PyGObject *)self)->obj);
|
||||
XeditMessageType *type;
|
||||
|
||||
gchar *name = _helper_wrap_get_string (attrname);
|
||||
gboolean exists;
|
||||
@@ -513,10 +513,10 @@ _wrap_pluma_message_tp_getattro(PyObject *self, PyObject *attrname)
|
||||
}
|
||||
|
||||
g_object_get (message, "type", &type, NULL);
|
||||
intype = pluma_message_type_lookup (type, name) != G_TYPE_INVALID;
|
||||
pluma_message_type_unref (type);
|
||||
intype = xedit_message_type_lookup (type, name) != G_TYPE_INVALID;
|
||||
xedit_message_type_unref (type);
|
||||
|
||||
exists = pluma_message_has_key (message, name);
|
||||
exists = xedit_message_has_key (message, name);
|
||||
|
||||
if (!intype)
|
||||
{
|
||||
@@ -525,7 +525,7 @@ _wrap_pluma_message_tp_getattro(PyObject *self, PyObject *attrname)
|
||||
else if (exists)
|
||||
{
|
||||
GValue value = { 0, };
|
||||
pluma_message_get_value (message, name, &value);
|
||||
xedit_message_get_value (message, name, &value);
|
||||
ret = pyg_value_as_pyobject(&value, TRUE);
|
||||
g_value_unset (&value);
|
||||
}
|
||||
@@ -539,11 +539,11 @@ _wrap_pluma_message_tp_getattro(PyObject *self, PyObject *attrname)
|
||||
return ret;
|
||||
}
|
||||
%%
|
||||
override-slot PlumaMessage.tp_setattro
|
||||
override-slot XeditMessage.tp_setattro
|
||||
static int
|
||||
_wrap_pluma_message_tp_setattro(PyObject *self, PyObject *attrname, PyObject *value)
|
||||
_wrap_xedit_message_tp_setattro(PyObject *self, PyObject *attrname, PyObject *value)
|
||||
{
|
||||
PlumaMessage *message = PLUMA_MESSAGE(((PyGObject *)self)->obj);
|
||||
XeditMessage *message = XEDIT_MESSAGE(((PyGObject *)self)->obj);
|
||||
|
||||
if (!_helper_wrap_message_set_value(message, attrname, value))
|
||||
{
|
@@ -1,11 +1,11 @@
|
||||
%%
|
||||
headers
|
||||
#include <pluma/pluma-plugin.h>
|
||||
#include <pluma/pluma-window.h>
|
||||
#include <xedit/xedit-plugin.h>
|
||||
#include <xedit/xedit-window.h>
|
||||
%%
|
||||
override pluma_plugin_activate kwargs
|
||||
override xedit_plugin_activate kwargs
|
||||
static PyObject *
|
||||
_wrap_pluma_plugin_activate(PyGObject *self, PyObject *args, PyObject *kwargs)
|
||||
_wrap_xedit_plugin_activate(PyGObject *self, PyObject *args, PyObject *kwargs)
|
||||
{
|
||||
gpointer klass, klass2;
|
||||
static char *kwlist[] = { "window", NULL };
|
||||
@@ -14,27 +14,27 @@ _wrap_pluma_plugin_activate(PyGObject *self, PyObject *args, PyObject *kwargs)
|
||||
|
||||
if (!PyArg_ParseTupleAndKeywords (args,
|
||||
kwargs,
|
||||
"O!:PlumaPlugin.activate",
|
||||
"O!:XeditPlugin.activate",
|
||||
kwlist,
|
||||
&PyPlumaWindow_Type,
|
||||
&PyXeditWindow_Type,
|
||||
&window))
|
||||
return NULL;
|
||||
|
||||
klass = g_type_class_ref (pyg_type_from_object (cls));
|
||||
|
||||
if (PLUMA_IS_PLUGIN_PYTHON_CLASS (klass))
|
||||
if (XEDIT_IS_PLUGIN_PYTHON_CLASS (klass))
|
||||
{
|
||||
klass2 = g_type_class_peek_parent (klass);
|
||||
g_type_class_unref (klass);
|
||||
klass = g_type_class_ref (G_TYPE_FROM_CLASS (klass2));
|
||||
}
|
||||
|
||||
if (PLUMA_PLUGIN_CLASS (klass)->activate)
|
||||
PLUMA_PLUGIN_CLASS (klass)->activate (PLUMA_PLUGIN (self->obj),
|
||||
PLUMA_WINDOW (window->obj));
|
||||
if (XEDIT_PLUGIN_CLASS (klass)->activate)
|
||||
XEDIT_PLUGIN_CLASS (klass)->activate (XEDIT_PLUGIN (self->obj),
|
||||
XEDIT_WINDOW (window->obj));
|
||||
else {
|
||||
PyErr_SetString (PyExc_NotImplementedError,
|
||||
"virtual method PlumaPlugin.activate not implemented");
|
||||
"virtual method XeditPlugin.activate not implemented");
|
||||
g_type_class_unref (klass);
|
||||
return NULL;
|
||||
}
|
||||
@@ -45,9 +45,9 @@ _wrap_pluma_plugin_activate(PyGObject *self, PyObject *args, PyObject *kwargs)
|
||||
}
|
||||
|
||||
%%
|
||||
override pluma_plugin_deactivate kwargs
|
||||
override xedit_plugin_deactivate kwargs
|
||||
static PyObject *
|
||||
_wrap_pluma_plugin_deactivate(PyGObject *self, PyObject *args, PyObject *kwargs)
|
||||
_wrap_xedit_plugin_deactivate(PyGObject *self, PyObject *args, PyObject *kwargs)
|
||||
{
|
||||
gpointer klass, klass2;
|
||||
static char *kwlist[] = {"window", NULL};
|
||||
@@ -56,27 +56,27 @@ _wrap_pluma_plugin_deactivate(PyGObject *self, PyObject *args, PyObject *kwargs)
|
||||
|
||||
if (!PyArg_ParseTupleAndKeywords (args,
|
||||
kwargs,
|
||||
"O!:PlumaPlugin.deactivate",
|
||||
"O!:XeditPlugin.deactivate",
|
||||
kwlist,
|
||||
&PyPlumaWindow_Type,
|
||||
&PyXeditWindow_Type,
|
||||
&window))
|
||||
return NULL;
|
||||
|
||||
klass = g_type_class_ref (pyg_type_from_object (cls));
|
||||
|
||||
if (PLUMA_IS_PLUGIN_PYTHON_CLASS (klass))
|
||||
if (XEDIT_IS_PLUGIN_PYTHON_CLASS (klass))
|
||||
{
|
||||
klass2 = g_type_class_peek_parent (klass);
|
||||
g_type_class_unref (klass);
|
||||
klass = g_type_class_ref (G_TYPE_FROM_CLASS (klass2));
|
||||
}
|
||||
|
||||
if (PLUMA_PLUGIN_CLASS (klass)->deactivate)
|
||||
PLUMA_PLUGIN_CLASS (klass)->deactivate (PLUMA_PLUGIN (self->obj),
|
||||
PLUMA_WINDOW (window->obj));
|
||||
if (XEDIT_PLUGIN_CLASS (klass)->deactivate)
|
||||
XEDIT_PLUGIN_CLASS (klass)->deactivate (XEDIT_PLUGIN (self->obj),
|
||||
XEDIT_WINDOW (window->obj));
|
||||
else {
|
||||
PyErr_SetString (PyExc_NotImplementedError,
|
||||
"virtual method PlumaPlugin.deactivate not implemented");
|
||||
"virtual method XeditPlugin.deactivate not implemented");
|
||||
g_type_class_unref (klass);
|
||||
return NULL;
|
||||
}
|
||||
@@ -87,9 +87,9 @@ _wrap_pluma_plugin_deactivate(PyGObject *self, PyObject *args, PyObject *kwargs)
|
||||
}
|
||||
|
||||
%%
|
||||
override pluma_plugin_update_ui kwargs
|
||||
override xedit_plugin_update_ui kwargs
|
||||
static PyObject *
|
||||
_wrap_pluma_plugin_update_ui (PyGObject *self, PyObject *args, PyObject *kwargs)
|
||||
_wrap_xedit_plugin_update_ui (PyGObject *self, PyObject *args, PyObject *kwargs)
|
||||
{
|
||||
gpointer klass, klass2;
|
||||
static char *kwlist[] = {"window", NULL};
|
||||
@@ -98,27 +98,27 @@ _wrap_pluma_plugin_update_ui (PyGObject *self, PyObject *args, PyObject *kwargs)
|
||||
|
||||
if (!PyArg_ParseTupleAndKeywords (args,
|
||||
kwargs,
|
||||
"O!:PlumaPlugin.update_ui",
|
||||
"O!:XeditPlugin.update_ui",
|
||||
kwlist,
|
||||
&PyPlumaWindow_Type,
|
||||
&PyXeditWindow_Type,
|
||||
&window))
|
||||
return NULL;
|
||||
|
||||
klass = g_type_class_ref (pyg_type_from_object (cls));
|
||||
|
||||
if (PLUMA_IS_PLUGIN_PYTHON_CLASS (klass))
|
||||
if (XEDIT_IS_PLUGIN_PYTHON_CLASS (klass))
|
||||
{
|
||||
klass2 = g_type_class_peek_parent (klass);
|
||||
g_type_class_unref (klass);
|
||||
klass = g_type_class_ref (G_TYPE_FROM_CLASS (klass2));
|
||||
}
|
||||
|
||||
if (PLUMA_PLUGIN_CLASS (klass)->update_ui)
|
||||
PLUMA_PLUGIN_CLASS (klass)->update_ui (PLUMA_PLUGIN (self->obj),
|
||||
PLUMA_WINDOW (window->obj));
|
||||
if (XEDIT_PLUGIN_CLASS (klass)->update_ui)
|
||||
XEDIT_PLUGIN_CLASS (klass)->update_ui (XEDIT_PLUGIN (self->obj),
|
||||
XEDIT_WINDOW (window->obj));
|
||||
else {
|
||||
PyErr_SetString (PyExc_NotImplementedError,
|
||||
"virtual method PlumaPlugin.update_ui not implemented");
|
||||
"virtual method XeditPlugin.update_ui not implemented");
|
||||
g_type_class_unref (klass);
|
||||
return NULL;
|
||||
}
|
||||
@@ -129,9 +129,9 @@ _wrap_pluma_plugin_update_ui (PyGObject *self, PyObject *args, PyObject *kwargs)
|
||||
}
|
||||
|
||||
%%
|
||||
override pluma_plugin_is_configurable
|
||||
override xedit_plugin_is_configurable
|
||||
static PyObject *
|
||||
_wrap_pluma_plugin_is_configurable (PyGObject *self)
|
||||
_wrap_xedit_plugin_is_configurable (PyGObject *self)
|
||||
{
|
||||
int ret;
|
||||
gpointer klass, klass2;
|
||||
@@ -139,18 +139,18 @@ _wrap_pluma_plugin_is_configurable (PyGObject *self)
|
||||
|
||||
klass = g_type_class_ref (pyg_type_from_object (cls));
|
||||
|
||||
if (PLUMA_IS_PLUGIN_PYTHON_CLASS (klass))
|
||||
if (XEDIT_IS_PLUGIN_PYTHON_CLASS (klass))
|
||||
{
|
||||
klass2 = g_type_class_peek_parent (klass);
|
||||
g_type_class_unref (klass);
|
||||
klass = g_type_class_ref (G_TYPE_FROM_CLASS (klass2));
|
||||
}
|
||||
|
||||
if (PLUMA_PLUGIN_CLASS (klass)->is_configurable)
|
||||
ret = PLUMA_PLUGIN_CLASS (klass)->is_configurable (PLUMA_PLUGIN (self->obj));
|
||||
if (XEDIT_PLUGIN_CLASS (klass)->is_configurable)
|
||||
ret = XEDIT_PLUGIN_CLASS (klass)->is_configurable (XEDIT_PLUGIN (self->obj));
|
||||
else {
|
||||
PyErr_SetString (PyExc_NotImplementedError,
|
||||
"virtual method PlumaPlugin.is_configurable not implemented");
|
||||
"virtual method XeditPlugin.is_configurable not implemented");
|
||||
g_type_class_unref (klass);
|
||||
return NULL;
|
||||
}
|
||||
@@ -160,9 +160,9 @@ _wrap_pluma_plugin_is_configurable (PyGObject *self)
|
||||
}
|
||||
|
||||
%%
|
||||
override pluma_plugin_configure_dialog
|
||||
override xedit_plugin_configure_dialog
|
||||
static PyObject *
|
||||
_wrap_pluma_plugin_create_configure_dialog (PyGObject *self)
|
||||
_wrap_xedit_plugin_create_configure_dialog (PyGObject *self)
|
||||
{
|
||||
GtkWidget *ret;
|
||||
gpointer klass, klass2;
|
||||
@@ -170,18 +170,18 @@ _wrap_pluma_plugin_create_configure_dialog (PyGObject *self)
|
||||
|
||||
klass = g_type_class_ref(pyg_type_from_object (cls));
|
||||
|
||||
if (PLUMA_IS_PLUGIN_PYTHON_CLASS (klass))
|
||||
if (XEDIT_IS_PLUGIN_PYTHON_CLASS (klass))
|
||||
{
|
||||
klass2 = g_type_class_peek_parent (klass);
|
||||
g_type_class_unref (klass);
|
||||
klass = g_type_class_ref (G_TYPE_FROM_CLASS (klass2));
|
||||
}
|
||||
|
||||
if (PLUMA_PLUGIN_CLASS (klass)->create_configure_dialog)
|
||||
ret = PLUMA_PLUGIN_CLASS (klass)->create_configure_dialog (PLUMA_PLUGIN (self->obj));
|
||||
if (XEDIT_PLUGIN_CLASS (klass)->create_configure_dialog)
|
||||
ret = XEDIT_PLUGIN_CLASS (klass)->create_configure_dialog (XEDIT_PLUGIN (self->obj));
|
||||
else {
|
||||
PyErr_SetString (PyExc_NotImplementedError,
|
||||
"virtual method PlumaPlugin.create_configure_dialog not implemented");
|
||||
"virtual method XeditPlugin.create_configure_dialog not implemented");
|
||||
g_type_class_unref (klass);
|
||||
return NULL;
|
||||
}
|
@@ -1,9 +1,9 @@
|
||||
;; -*- scheme -*-
|
||||
|
||||
;; From ../../pluma/pluma-utils.h
|
||||
;; From ../../xedit/xedit-utils.h
|
||||
|
||||
(define-function uri_has_writable_scheme
|
||||
(c-name "pluma_utils_uri_has_writable_scheme")
|
||||
(c-name "xedit_utils_uri_has_writable_scheme")
|
||||
(return-type "gboolean")
|
||||
(parameters
|
||||
'("const-gchar*" "uri")
|
||||
@@ -11,7 +11,7 @@
|
||||
)
|
||||
|
||||
(define-function uri_has_file_scheme
|
||||
(c-name "pluma_utils_uri_has_file_scheme")
|
||||
(c-name "xedit_utils_uri_has_file_scheme")
|
||||
(return-type "gboolean")
|
||||
(parameters
|
||||
'("const-gchar*" "uri")
|
||||
@@ -19,7 +19,7 @@
|
||||
)
|
||||
|
||||
(define-function uri_exists
|
||||
(c-name "pluma_utils_uri_exists")
|
||||
(c-name "xedit_utils_uri_exists")
|
||||
(return-type "gboolean")
|
||||
(parameters
|
||||
'("const-gchar*" "text_uri")
|
||||
@@ -27,7 +27,7 @@
|
||||
)
|
||||
|
||||
(define-function uri_is_valid
|
||||
(c-name "pluma_utils_is_valid_uri")
|
||||
(c-name "xedit_utils_is_valid_uri")
|
||||
(return-type "gboolean")
|
||||
(parameters
|
||||
'("const-gchar*" "uri")
|
||||
@@ -35,7 +35,7 @@
|
||||
)
|
||||
|
||||
(define-function uri_get_dirname
|
||||
(c-name "pluma_utils_uri_get_dirname")
|
||||
(c-name "xedit_utils_uri_get_dirname")
|
||||
(return-type "gchar*")
|
||||
(parameters
|
||||
'("const-char*" "uri")
|
||||
@@ -43,7 +43,7 @@
|
||||
)
|
||||
|
||||
(define-function menu_position_under_widget
|
||||
(c-name "pluma_utils_menu_position_under_widget")
|
||||
(c-name "xedit_utils_menu_position_under_widget")
|
||||
(return-type "none")
|
||||
(parameters
|
||||
'("GtkMenu*" "menu")
|
||||
@@ -55,7 +55,7 @@
|
||||
)
|
||||
|
||||
(define-function menu_position_under_tree_view
|
||||
(c-name "pluma_utils_menu_position_under_tree_view")
|
||||
(c-name "xedit_utils_menu_position_under_tree_view")
|
||||
(return-type "none")
|
||||
(parameters
|
||||
'("GtkMenu*" "menu")
|
@@ -5,13 +5,13 @@ headers
|
||||
#include <pygobject.h>
|
||||
#include <pygtk/pygtk.h>
|
||||
|
||||
#include "pluma-utils.h"
|
||||
#include "xedit-utils.h"
|
||||
|
||||
void pyplumautils_register_classes (PyObject *d);
|
||||
void pyplumautils_add_constants (PyObject *module, const gchar *strip_prefix);
|
||||
void pyxeditutils_register_classes (PyObject *d);
|
||||
void pyxeditutils_add_constants (PyObject *module, const gchar *strip_prefix);
|
||||
|
||||
%%
|
||||
modulename pluma.utils
|
||||
modulename xedit.utils
|
||||
%%
|
||||
import gtk.Widget as PyGtkWidget_Type
|
||||
import gtk.TreeView as PyGtkTreeView_Type
|
||||
@@ -20,9 +20,9 @@ import gtk.Menu as PyGtkMenu_Type
|
||||
ignore-glob
|
||||
_*
|
||||
%%
|
||||
override pluma_utils_menu_position_under_widget kwargs
|
||||
override xedit_utils_menu_position_under_widget kwargs
|
||||
static PyObject *
|
||||
_wrap_pluma_utils_menu_position_under_widget (PyObject *self,
|
||||
_wrap_xedit_utils_menu_position_under_widget (PyObject *self,
|
||||
PyObject *args,
|
||||
PyObject *kwargs)
|
||||
{
|
||||
@@ -43,7 +43,7 @@ _wrap_pluma_utils_menu_position_under_widget (PyObject *self,
|
||||
menu = GTK_MENU (pygobject_get (py_menu));
|
||||
widget = GTK_WIDGET (pygobject_get (py_widget));
|
||||
|
||||
pluma_utils_menu_position_under_widget (menu, &x, &y, &push_in, widget);
|
||||
xedit_utils_menu_position_under_widget (menu, &x, &y, &push_in, widget);
|
||||
|
||||
tuple = PyTuple_New (3);
|
||||
PyTuple_SetItem (tuple, 0, PyInt_FromLong (x));
|
||||
@@ -52,9 +52,9 @@ _wrap_pluma_utils_menu_position_under_widget (PyObject *self,
|
||||
return tuple;
|
||||
}
|
||||
%%
|
||||
override pluma_utils_menu_position_under_tree_view kwargs
|
||||
override xedit_utils_menu_position_under_tree_view kwargs
|
||||
static PyObject *
|
||||
_wrap_pluma_utils_menu_position_under_tree_view (PyObject *self,
|
||||
_wrap_xedit_utils_menu_position_under_tree_view (PyObject *self,
|
||||
PyObject *args,
|
||||
PyObject *kwargs)
|
||||
{
|
||||
@@ -75,7 +75,7 @@ _wrap_pluma_utils_menu_position_under_tree_view (PyObject *self,
|
||||
menu = GTK_MENU (pygobject_get (py_menu));
|
||||
view = GTK_TREE_VIEW (pygobject_get (py_view));
|
||||
|
||||
pluma_utils_menu_position_under_widget (menu, &x, &y, &push_in, view);
|
||||
xedit_utils_menu_position_under_widget (menu, &x, &y, &push_in, view);
|
||||
|
||||
tuple = PyTuple_New (3);
|
||||
PyTuple_SetItem (tuple, 0, PyInt_FromLong (x));
|
@@ -1,61 +0,0 @@
|
||||
/*
|
||||
* pluma-plugin-loader-python.h
|
||||
* This file is part of pluma
|
||||
*
|
||||
* Copyright (C) 2008 - Jesse van den Kieboom
|
||||
*
|
||||
* 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., 51 Franklin St, Fifth Floor,
|
||||
* Boston, MA 02110-1301, USA.
|
||||
*/
|
||||
|
||||
#ifndef __PLUMA_PLUGIN_LOADER_PYTHON_H__
|
||||
#define __PLUMA_PLUGIN_LOADER_PYTHON_H__
|
||||
|
||||
#include <pluma/pluma-plugin-loader.h>
|
||||
|
||||
G_BEGIN_DECLS
|
||||
|
||||
#define PLUMA_TYPE_PLUGIN_LOADER_PYTHON (pluma_plugin_loader_python_get_type ())
|
||||
#define PLUMA_PLUGIN_LOADER_PYTHON(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), PLUMA_TYPE_PLUGIN_LOADER_PYTHON, PlumaPluginLoaderPython))
|
||||
#define PLUMA_PLUGIN_LOADER_PYTHON_CONST(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), PLUMA_TYPE_PLUGIN_LOADER_PYTHON, PlumaPluginLoaderPython const))
|
||||
#define PLUMA_PLUGIN_LOADER_PYTHON_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), PLUMA_TYPE_PLUGIN_LOADER_PYTHON, PlumaPluginLoaderPythonClass))
|
||||
#define PLUMA_IS_PLUGIN_LOADER_PYTHON(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), PLUMA_TYPE_PLUGIN_LOADER_PYTHON))
|
||||
#define PLUMA_IS_PLUGIN_LOADER_PYTHON_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), PLUMA_TYPE_PLUGIN_LOADER_PYTHON))
|
||||
#define PLUMA_PLUGIN_LOADER_PYTHON_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), PLUMA_TYPE_PLUGIN_LOADER_PYTHON, PlumaPluginLoaderPythonClass))
|
||||
|
||||
typedef struct _PlumaPluginLoaderPython PlumaPluginLoaderPython;
|
||||
typedef struct _PlumaPluginLoaderPythonClass PlumaPluginLoaderPythonClass;
|
||||
typedef struct _PlumaPluginLoaderPythonPrivate PlumaPluginLoaderPythonPrivate;
|
||||
|
||||
struct _PlumaPluginLoaderPython {
|
||||
GObject parent;
|
||||
|
||||
PlumaPluginLoaderPythonPrivate *priv;
|
||||
};
|
||||
|
||||
struct _PlumaPluginLoaderPythonClass {
|
||||
GObjectClass parent_class;
|
||||
};
|
||||
|
||||
GType pluma_plugin_loader_python_get_type (void) G_GNUC_CONST;
|
||||
PlumaPluginLoaderPython *pluma_plugin_loader_python_new(void);
|
||||
|
||||
/* All the loaders must implement this function */
|
||||
G_MODULE_EXPORT GType register_pluma_plugin_loader (GTypeModule * module);
|
||||
|
||||
G_END_DECLS
|
||||
|
||||
#endif /* __PLUMA_PLUGIN_LOADER_PYTHON_H__ */
|
||||
|
@@ -1,88 +0,0 @@
|
||||
/*
|
||||
* pluma-plugin-python.h
|
||||
* This file is part of pluma
|
||||
*
|
||||
* Copyright (C) 2005 - Raphael Slinckx
|
||||
* Copyright (C) 2008 - Jesse van den Kieboom
|
||||
*
|
||||
* 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., 51 Franklin St, Fifth Floor,
|
||||
* Boston, MA 02110-1301, USA.
|
||||
*/
|
||||
|
||||
#ifndef __PLUMA_PLUGIN_PYTHON_H__
|
||||
#define __PLUMA_PLUGIN_PYTHON_H__
|
||||
|
||||
#define NO_IMPORT_PYGOBJECT
|
||||
|
||||
#include <glib-object.h>
|
||||
#include <pygobject.h>
|
||||
|
||||
#include <pluma/pluma-plugin.h>
|
||||
|
||||
G_BEGIN_DECLS
|
||||
|
||||
/*
|
||||
* Type checking and casting macros
|
||||
*/
|
||||
#define PLUMA_TYPE_PLUGIN_PYTHON (pluma_plugin_python_get_type())
|
||||
#define PLUMA_PLUGIN_PYTHON(obj) (G_TYPE_CHECK_INSTANCE_CAST((obj), PLUMA_TYPE_PLUGIN_PYTHON, PlumaPluginPython))
|
||||
#define PLUMA_PLUGIN_PYTHON_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST((klass), PLUMA_TYPE_PLUGIN_PYTHON, PlumaPluginPythonClass))
|
||||
#define PLUMA_IS_PLUGIN_PYTHON(obj) (G_TYPE_CHECK_INSTANCE_TYPE((obj), PLUMA_TYPE_PLUGIN_PYTHON))
|
||||
#define PLUMA_IS_PLUGIN_PYTHON_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), PLUMA_TYPE_PLUGIN_PYTHON))
|
||||
#define PLUMA_PLUGIN_PYTHON_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS((obj), PLUMA_TYPE_PLUGIN_PYTHON, PlumaPluginPythonClass))
|
||||
|
||||
/* Private structure type */
|
||||
typedef struct _PlumaPluginPythonPrivate PlumaPluginPythonPrivate;
|
||||
|
||||
/*
|
||||
* Main object structure
|
||||
*/
|
||||
typedef struct _PlumaPluginPython PlumaPluginPython;
|
||||
|
||||
struct _PlumaPluginPython
|
||||
{
|
||||
PlumaPlugin parent;
|
||||
|
||||
/*< private > */
|
||||
PlumaPluginPythonPrivate *priv;
|
||||
};
|
||||
|
||||
/*
|
||||
* Class definition
|
||||
*/
|
||||
typedef struct _PlumaPluginPythonClass PlumaPluginPythonClass;
|
||||
|
||||
struct _PlumaPluginPythonClass
|
||||
{
|
||||
PlumaPluginClass parent_class;
|
||||
};
|
||||
|
||||
/*
|
||||
* Public methods
|
||||
*/
|
||||
GType pluma_plugin_python_get_type (void) G_GNUC_CONST;
|
||||
|
||||
|
||||
/*
|
||||
* Private methods
|
||||
*/
|
||||
void _pluma_plugin_python_set_instance (PlumaPluginPython *plugin,
|
||||
PyObject *instance);
|
||||
PyObject *_pluma_plugin_python_get_instance (PlumaPluginPython *plugin);
|
||||
|
||||
G_END_DECLS
|
||||
|
||||
#endif /* __PLUMA_PLUGIN_PYTHON_H__ */
|
||||
|
@@ -1,6 +1,6 @@
|
||||
/*
|
||||
* pluma-plugin-loader-python.c
|
||||
* This file is part of pluma
|
||||
* xedit-plugin-loader-python.c
|
||||
* This file is part of xedit
|
||||
*
|
||||
* Copyright (C) 2008 - Jesse van den Kieboom
|
||||
*
|
||||
@@ -20,9 +20,9 @@
|
||||
* Boston, MA 02110-1301, USA.
|
||||
*/
|
||||
|
||||
#include "pluma-plugin-loader-python.h"
|
||||
#include "pluma-plugin-python.h"
|
||||
#include <pluma/pluma-object-module.h>
|
||||
#include "xedit-plugin-loader-python.h"
|
||||
#include "xedit-plugin-python.h"
|
||||
#include <xedit/xedit-object-module.h>
|
||||
|
||||
#define NO_IMPORT_PYGOBJECT
|
||||
#define NO_IMPORT_PYGTK
|
||||
@@ -39,9 +39,9 @@ typedef int Py_ssize_t;
|
||||
#define PY_SSIZE_T_MIN INT_MIN
|
||||
#endif
|
||||
|
||||
#define PLUMA_PLUGIN_LOADER_PYTHON_GET_PRIVATE(object)(G_TYPE_INSTANCE_GET_PRIVATE((object), PLUMA_TYPE_PLUGIN_LOADER_PYTHON, PlumaPluginLoaderPythonPrivate))
|
||||
#define XEDIT_PLUGIN_LOADER_PYTHON_GET_PRIVATE(object)(G_TYPE_INSTANCE_GET_PRIVATE((object), XEDIT_TYPE_PLUGIN_LOADER_PYTHON, XeditPluginLoaderPythonPrivate))
|
||||
|
||||
struct _PlumaPluginLoaderPythonPrivate
|
||||
struct _XeditPluginLoaderPythonPrivate
|
||||
{
|
||||
GHashTable *loaded_plugins;
|
||||
guint idle_gc;
|
||||
@@ -55,29 +55,29 @@ typedef struct
|
||||
gchar *path;
|
||||
} PythonInfo;
|
||||
|
||||
static void pluma_plugin_loader_iface_init (gpointer g_iface, gpointer iface_data);
|
||||
static void xedit_plugin_loader_iface_init (gpointer g_iface, gpointer iface_data);
|
||||
|
||||
/* Exported by pypluma module */
|
||||
void pypluma_register_classes (PyObject *d);
|
||||
void pypluma_add_constants (PyObject *module, const gchar *strip_prefix);
|
||||
extern PyMethodDef pypluma_functions[];
|
||||
/* Exported by pyxedit module */
|
||||
void pyxedit_register_classes (PyObject *d);
|
||||
void pyxedit_add_constants (PyObject *module, const gchar *strip_prefix);
|
||||
extern PyMethodDef pyxedit_functions[];
|
||||
|
||||
/* Exported by pyplumautils module */
|
||||
void pyplumautils_register_classes (PyObject *d);
|
||||
extern PyMethodDef pyplumautils_functions[];
|
||||
/* Exported by pyxeditutils module */
|
||||
void pyxeditutils_register_classes (PyObject *d);
|
||||
extern PyMethodDef pyxeditutils_functions[];
|
||||
|
||||
/* Exported by pyplumacommands module */
|
||||
void pyplumacommands_register_classes (PyObject *d);
|
||||
extern PyMethodDef pyplumacommands_functions[];
|
||||
/* Exported by pyxeditcommands module */
|
||||
void pyxeditcommands_register_classes (PyObject *d);
|
||||
extern PyMethodDef pyxeditcommands_functions[];
|
||||
|
||||
/* We retreive this to check for correct class hierarchy */
|
||||
static PyTypeObject *PyPlumaPlugin_Type;
|
||||
static PyTypeObject *PyXeditPlugin_Type;
|
||||
|
||||
PLUMA_PLUGIN_LOADER_REGISTER_TYPE (PlumaPluginLoaderPython, pluma_plugin_loader_python, G_TYPE_OBJECT, pluma_plugin_loader_iface_init);
|
||||
XEDIT_PLUGIN_LOADER_REGISTER_TYPE (XeditPluginLoaderPython, xedit_plugin_loader_python, G_TYPE_OBJECT, xedit_plugin_loader_iface_init);
|
||||
|
||||
|
||||
static PyObject *
|
||||
find_python_plugin_type (PlumaPluginInfo *info,
|
||||
find_python_plugin_type (XeditPluginInfo *info,
|
||||
PyObject *pymodule)
|
||||
{
|
||||
PyObject *locals, *key, *value;
|
||||
@@ -90,24 +90,24 @@ find_python_plugin_type (PlumaPluginInfo *info,
|
||||
if (!PyType_Check(value))
|
||||
continue;
|
||||
|
||||
if (PyObject_IsSubclass (value, (PyObject*) PyPlumaPlugin_Type))
|
||||
if (PyObject_IsSubclass (value, (PyObject*) PyXeditPlugin_Type))
|
||||
return value;
|
||||
}
|
||||
|
||||
g_warning ("No PlumaPlugin derivative found in Python plugin '%s'",
|
||||
pluma_plugin_info_get_name (info));
|
||||
g_warning ("No XeditPlugin derivative found in Python plugin '%s'",
|
||||
xedit_plugin_info_get_name (info));
|
||||
return NULL;
|
||||
}
|
||||
|
||||
static PlumaPlugin *
|
||||
new_plugin_from_info (PlumaPluginLoaderPython *loader,
|
||||
PlumaPluginInfo *info)
|
||||
static XeditPlugin *
|
||||
new_plugin_from_info (XeditPluginLoaderPython *loader,
|
||||
XeditPluginInfo *info)
|
||||
{
|
||||
PythonInfo *pyinfo;
|
||||
PyTypeObject *pytype;
|
||||
PyObject *pyobject;
|
||||
PyGObject *pygobject;
|
||||
PlumaPlugin *instance;
|
||||
XeditPlugin *instance;
|
||||
PyObject *emptyarg;
|
||||
|
||||
pyinfo = (PythonInfo *)g_hash_table_lookup (loader->priv->loaded_plugins, info);
|
||||
@@ -126,7 +126,7 @@ new_plugin_from_info (PlumaPluginLoaderPython *loader,
|
||||
|
||||
if (pyobject == NULL)
|
||||
{
|
||||
g_error ("Could not create instance for %s.", pluma_plugin_info_get_name (info));
|
||||
g_error ("Could not create instance for %s.", xedit_plugin_info_get_name (info));
|
||||
return NULL;
|
||||
}
|
||||
|
||||
@@ -135,18 +135,18 @@ new_plugin_from_info (PlumaPluginLoaderPython *loader,
|
||||
if (pygobject->obj != NULL)
|
||||
{
|
||||
Py_DECREF (pyobject);
|
||||
g_error ("Could not create instance for %s (GObject already initialized).", pluma_plugin_info_get_name (info));
|
||||
g_error ("Could not create instance for %s (GObject already initialized).", xedit_plugin_info_get_name (info));
|
||||
return NULL;
|
||||
}
|
||||
|
||||
pygobject_construct (pygobject,
|
||||
"install-dir", pyinfo->path,
|
||||
"data-dir-name", pluma_plugin_info_get_module_name (info),
|
||||
"data-dir-name", xedit_plugin_info_get_module_name (info),
|
||||
NULL);
|
||||
|
||||
if (pygobject->obj == NULL)
|
||||
{
|
||||
g_error ("Could not create instance for %s (GObject not constructed).", pluma_plugin_info_get_name (info));
|
||||
g_error ("Could not create instance for %s (GObject not constructed).", xedit_plugin_info_get_name (info));
|
||||
Py_DECREF (pyobject);
|
||||
|
||||
return NULL;
|
||||
@@ -161,20 +161,20 @@ new_plugin_from_info (PlumaPluginLoaderPython *loader,
|
||||
Py_DECREF (emptyarg);
|
||||
}
|
||||
|
||||
instance = PLUMA_PLUGIN (pygobject->obj);
|
||||
instance = XEDIT_PLUGIN (pygobject->obj);
|
||||
pyinfo->instance = (PyObject *)pygobject;
|
||||
|
||||
/* make sure to register the python instance for the PlumaPluginPython
|
||||
object to it can wrap the virtual pluma plugin funcs back to python */
|
||||
_pluma_plugin_python_set_instance (PLUMA_PLUGIN_PYTHON (instance), (PyObject *)pygobject);
|
||||
/* make sure to register the python instance for the XeditPluginPython
|
||||
object to it can wrap the virtual xedit plugin funcs back to python */
|
||||
_xedit_plugin_python_set_instance (XEDIT_PLUGIN_PYTHON (instance), (PyObject *)pygobject);
|
||||
|
||||
/* we return a reference here because the other is owned by python */
|
||||
return PLUMA_PLUGIN (g_object_ref (instance));
|
||||
return XEDIT_PLUGIN (g_object_ref (instance));
|
||||
}
|
||||
|
||||
static PlumaPlugin *
|
||||
add_python_info (PlumaPluginLoaderPython *loader,
|
||||
PlumaPluginInfo *info,
|
||||
static XeditPlugin *
|
||||
add_python_info (XeditPluginLoaderPython *loader,
|
||||
XeditPluginInfo *info,
|
||||
PyObject *module,
|
||||
const gchar *path,
|
||||
PyObject *type)
|
||||
@@ -193,27 +193,27 @@ add_python_info (PlumaPluginLoaderPython *loader,
|
||||
}
|
||||
|
||||
static const gchar *
|
||||
pluma_plugin_loader_iface_get_id (void)
|
||||
xedit_plugin_loader_iface_get_id (void)
|
||||
{
|
||||
return "Python";
|
||||
}
|
||||
|
||||
static PlumaPlugin *
|
||||
pluma_plugin_loader_iface_load (PlumaPluginLoader *loader,
|
||||
PlumaPluginInfo *info,
|
||||
static XeditPlugin *
|
||||
xedit_plugin_loader_iface_load (XeditPluginLoader *loader,
|
||||
XeditPluginInfo *info,
|
||||
const gchar *path)
|
||||
{
|
||||
PlumaPluginLoaderPython *pyloader = PLUMA_PLUGIN_LOADER_PYTHON (loader);
|
||||
XeditPluginLoaderPython *pyloader = XEDIT_PLUGIN_LOADER_PYTHON (loader);
|
||||
PyObject *main_module, *main_locals, *pytype;
|
||||
PyObject *pymodule, *fromlist;
|
||||
gchar *module_name;
|
||||
PlumaPlugin *result;
|
||||
XeditPlugin *result;
|
||||
|
||||
if (pyloader->priv->init_failed)
|
||||
{
|
||||
g_warning ("Cannot load python plugin Python '%s' since pluma was"
|
||||
g_warning ("Cannot load python plugin Python '%s' since xedit was"
|
||||
"not able to initialize the Python interpreter.",
|
||||
pluma_plugin_info_get_name (info));
|
||||
xedit_plugin_info_get_name (info));
|
||||
return NULL;
|
||||
}
|
||||
|
||||
@@ -223,10 +223,10 @@ pluma_plugin_loader_iface_load (PlumaPluginLoader *loader,
|
||||
if (result != NULL)
|
||||
return result;
|
||||
|
||||
main_module = PyImport_AddModule ("pluma.plugins");
|
||||
main_module = PyImport_AddModule ("xedit.plugins");
|
||||
if (main_module == NULL)
|
||||
{
|
||||
g_warning ("Could not get pluma.plugins.");
|
||||
g_warning ("Could not get xedit.plugins.");
|
||||
return NULL;
|
||||
}
|
||||
|
||||
@@ -247,7 +247,7 @@ pluma_plugin_loader_iface_load (PlumaPluginLoader *loader,
|
||||
/* we need a fromlist to be able to import modules with a '.' in the
|
||||
name. */
|
||||
fromlist = PyTuple_New(0);
|
||||
module_name = g_strdup (pluma_plugin_info_get_module_name (info));
|
||||
module_name = g_strdup (xedit_plugin_info_get_module_name (info));
|
||||
|
||||
pymodule = PyImport_ImportModuleEx (module_name,
|
||||
main_locals,
|
||||
@@ -275,10 +275,10 @@ pluma_plugin_loader_iface_load (PlumaPluginLoader *loader,
|
||||
}
|
||||
|
||||
static void
|
||||
pluma_plugin_loader_iface_unload (PlumaPluginLoader *loader,
|
||||
PlumaPluginInfo *info)
|
||||
xedit_plugin_loader_iface_unload (XeditPluginLoader *loader,
|
||||
XeditPluginInfo *info)
|
||||
{
|
||||
PlumaPluginLoaderPython *pyloader = PLUMA_PLUGIN_LOADER_PYTHON (loader);
|
||||
XeditPluginLoaderPython *pyloader = XEDIT_PLUGIN_LOADER_PYTHON (loader);
|
||||
PythonInfo *pyinfo;
|
||||
PyGILState_STATE state;
|
||||
|
||||
@@ -295,7 +295,7 @@ pluma_plugin_loader_iface_unload (PlumaPluginLoader *loader,
|
||||
}
|
||||
|
||||
static gboolean
|
||||
run_gc (PlumaPluginLoaderPython *loader)
|
||||
run_gc (XeditPluginLoaderPython *loader)
|
||||
{
|
||||
while (PyGC_Collect ())
|
||||
;
|
||||
@@ -305,14 +305,14 @@ run_gc (PlumaPluginLoaderPython *loader)
|
||||
}
|
||||
|
||||
static void
|
||||
pluma_plugin_loader_iface_garbage_collect (PlumaPluginLoader *loader)
|
||||
xedit_plugin_loader_iface_garbage_collect (XeditPluginLoader *loader)
|
||||
{
|
||||
PlumaPluginLoaderPython *pyloader;
|
||||
XeditPluginLoaderPython *pyloader;
|
||||
|
||||
if (!Py_IsInitialized())
|
||||
return;
|
||||
|
||||
pyloader = PLUMA_PLUGIN_LOADER_PYTHON (loader);
|
||||
pyloader = XEDIT_PLUGIN_LOADER_PYTHON (loader);
|
||||
|
||||
/*
|
||||
* We both run the GC right now and we schedule
|
||||
@@ -327,19 +327,19 @@ pluma_plugin_loader_iface_garbage_collect (PlumaPluginLoader *loader)
|
||||
}
|
||||
|
||||
static void
|
||||
pluma_plugin_loader_iface_init (gpointer g_iface,
|
||||
xedit_plugin_loader_iface_init (gpointer g_iface,
|
||||
gpointer iface_data)
|
||||
{
|
||||
PlumaPluginLoaderInterface *iface = (PlumaPluginLoaderInterface *)g_iface;
|
||||
XeditPluginLoaderInterface *iface = (XeditPluginLoaderInterface *)g_iface;
|
||||
|
||||
iface->get_id = pluma_plugin_loader_iface_get_id;
|
||||
iface->load = pluma_plugin_loader_iface_load;
|
||||
iface->unload = pluma_plugin_loader_iface_unload;
|
||||
iface->garbage_collect = pluma_plugin_loader_iface_garbage_collect;
|
||||
iface->get_id = xedit_plugin_loader_iface_get_id;
|
||||
iface->load = xedit_plugin_loader_iface_load;
|
||||
iface->unload = xedit_plugin_loader_iface_unload;
|
||||
iface->garbage_collect = xedit_plugin_loader_iface_garbage_collect;
|
||||
}
|
||||
|
||||
static void
|
||||
pluma_python_shutdown (PlumaPluginLoaderPython *loader)
|
||||
xedit_python_shutdown (XeditPluginLoaderPython *loader)
|
||||
{
|
||||
if (!Py_IsInitialized ())
|
||||
return;
|
||||
@@ -362,7 +362,7 @@ pluma_python_shutdown (PlumaPluginLoaderPython *loader)
|
||||
* pygtk.require ("2.0")
|
||||
*/
|
||||
static gboolean
|
||||
pluma_check_pygtk2 (void)
|
||||
xedit_check_pygtk2 (void)
|
||||
{
|
||||
PyObject *pygtk, *mdict, *require;
|
||||
|
||||
@@ -394,13 +394,13 @@ pluma_check_pygtk2 (void)
|
||||
* It's up to the caller to check the result with PyErr_Occurred()
|
||||
*/
|
||||
static void
|
||||
pluma_init_pygobject (void)
|
||||
xedit_init_pygobject (void)
|
||||
{
|
||||
init_pygobject_check (2, 11, 5); /* FIXME: get from config */
|
||||
}
|
||||
|
||||
static void
|
||||
pluma_init_pygtk (void)
|
||||
xedit_init_pygtk (void)
|
||||
{
|
||||
PyObject *gtk, *mdict, *version, *required_version;
|
||||
|
||||
@@ -439,7 +439,7 @@ old_gtksourceview_init (void)
|
||||
}
|
||||
|
||||
static void
|
||||
pluma_init_pygtksourceview (void)
|
||||
xedit_init_pygtksourceview (void)
|
||||
{
|
||||
PyObject *gtksourceview, *mdict, *version, *required_version;
|
||||
|
||||
@@ -481,13 +481,13 @@ pluma_init_pygtksourceview (void)
|
||||
}
|
||||
|
||||
static gboolean
|
||||
pluma_python_init (PlumaPluginLoaderPython *loader)
|
||||
xedit_python_init (XeditPluginLoaderPython *loader)
|
||||
{
|
||||
PyObject *mdict, *tuple;
|
||||
PyObject *pluma, *plumautils, *plumacommands, *plumaplugins;
|
||||
PyObject *xedit, *xeditutils, *xeditcommands, *xeditplugins;
|
||||
PyObject *gettext, *install, *gettext_args;
|
||||
//char *argv[] = { "pluma", NULL };
|
||||
char *argv[] = { PLUMA_PLUGINS_LIBS_DIR, NULL };
|
||||
//char *argv[] = { "xedit", NULL };
|
||||
char *argv[] = { XEDIT_PLUGINS_LIBS_DIR, NULL };
|
||||
#ifdef HAVE_SIGACTION
|
||||
gint res;
|
||||
struct sigaction old_sigint;
|
||||
@@ -548,14 +548,14 @@ pluma_python_init (PlumaPluginLoaderPython *loader)
|
||||
|
||||
PySys_SetArgv (1, argv);
|
||||
|
||||
if (!pluma_check_pygtk2 ())
|
||||
if (!xedit_check_pygtk2 ())
|
||||
{
|
||||
/* Warning message already printed in check_pygtk2 */
|
||||
goto python_init_error;
|
||||
}
|
||||
|
||||
/* import gobject */
|
||||
pluma_init_pygobject ();
|
||||
xedit_init_pygobject ();
|
||||
if (PyErr_Occurred ())
|
||||
{
|
||||
g_warning ("Error initializing Python interpreter: could not import pygobject.");
|
||||
@@ -564,7 +564,7 @@ pluma_python_init (PlumaPluginLoaderPython *loader)
|
||||
}
|
||||
|
||||
/* import gtk */
|
||||
pluma_init_pygtk ();
|
||||
xedit_init_pygtk ();
|
||||
if (PyErr_Occurred ())
|
||||
{
|
||||
g_warning ("Error initializing Python interpreter: could not import pygtk.");
|
||||
@@ -573,7 +573,7 @@ pluma_python_init (PlumaPluginLoaderPython *loader)
|
||||
}
|
||||
|
||||
/* import gtksourceview */
|
||||
pluma_init_pygtksourceview ();
|
||||
xedit_init_pygtksourceview ();
|
||||
if (PyErr_Occurred ())
|
||||
{
|
||||
PyErr_Print ();
|
||||
@@ -583,47 +583,47 @@ pluma_python_init (PlumaPluginLoaderPython *loader)
|
||||
goto python_init_error;
|
||||
}
|
||||
|
||||
/* import pluma */
|
||||
pluma = Py_InitModule ("pluma", pypluma_functions);
|
||||
mdict = PyModule_GetDict (pluma);
|
||||
/* import xedit */
|
||||
xedit = Py_InitModule ("xedit", pyxedit_functions);
|
||||
mdict = PyModule_GetDict (xedit);
|
||||
|
||||
pypluma_register_classes (mdict);
|
||||
pypluma_add_constants (pluma, "PLUMA_");
|
||||
pyxedit_register_classes (mdict);
|
||||
pyxedit_add_constants (xedit, "XEDIT_");
|
||||
|
||||
/* pluma version */
|
||||
/* xedit version */
|
||||
tuple = Py_BuildValue("(iii)",
|
||||
PLUMA_MAJOR_VERSION,
|
||||
PLUMA_MINOR_VERSION,
|
||||
PLUMA_MICRO_VERSION);
|
||||
XEDIT_MAJOR_VERSION,
|
||||
XEDIT_MINOR_VERSION,
|
||||
XEDIT_MICRO_VERSION);
|
||||
PyDict_SetItemString(mdict, "version", tuple);
|
||||
Py_DECREF(tuple);
|
||||
|
||||
/* Retrieve the Python type for pluma.Plugin */
|
||||
PyPlumaPlugin_Type = (PyTypeObject *) PyDict_GetItemString (mdict, "Plugin");
|
||||
if (PyPlumaPlugin_Type == NULL)
|
||||
/* Retrieve the Python type for xedit.Plugin */
|
||||
PyXeditPlugin_Type = (PyTypeObject *) PyDict_GetItemString (mdict, "Plugin");
|
||||
if (PyXeditPlugin_Type == NULL)
|
||||
{
|
||||
PyErr_Print ();
|
||||
|
||||
goto python_init_error;
|
||||
}
|
||||
|
||||
/* import pluma.utils */
|
||||
plumautils = Py_InitModule ("pluma.utils", pyplumautils_functions);
|
||||
PyDict_SetItemString (mdict, "utils", plumautils);
|
||||
/* import xedit.utils */
|
||||
xeditutils = Py_InitModule ("xedit.utils", pyxeditutils_functions);
|
||||
PyDict_SetItemString (mdict, "utils", xeditutils);
|
||||
|
||||
/* import pluma.commands */
|
||||
plumacommands = Py_InitModule ("pluma.commands", pyplumacommands_functions);
|
||||
PyDict_SetItemString (mdict, "commands", plumacommands);
|
||||
/* import xedit.commands */
|
||||
xeditcommands = Py_InitModule ("xedit.commands", pyxeditcommands_functions);
|
||||
PyDict_SetItemString (mdict, "commands", xeditcommands);
|
||||
|
||||
/* initialize empty pluma.plugins module */
|
||||
plumaplugins = Py_InitModule ("pluma.plugins", NULL);
|
||||
PyDict_SetItemString (mdict, "plugins", plumaplugins);
|
||||
/* initialize empty xedit.plugins module */
|
||||
xeditplugins = Py_InitModule ("xedit.plugins", NULL);
|
||||
PyDict_SetItemString (mdict, "plugins", xeditplugins);
|
||||
|
||||
mdict = PyModule_GetDict (plumautils);
|
||||
pyplumautils_register_classes (mdict);
|
||||
mdict = PyModule_GetDict (xeditutils);
|
||||
pyxeditutils_register_classes (mdict);
|
||||
|
||||
mdict = PyModule_GetDict (plumacommands);
|
||||
pyplumacommands_register_classes (mdict);
|
||||
mdict = PyModule_GetDict (xeditcommands);
|
||||
pyxeditcommands_register_classes (mdict);
|
||||
|
||||
/* i18n support */
|
||||
gettext = PyImport_ImportModule ("gettext");
|
||||
@@ -636,7 +636,7 @@ pluma_python_init (PlumaPluginLoaderPython *loader)
|
||||
|
||||
mdict = PyModule_GetDict (gettext);
|
||||
install = PyDict_GetItemString (mdict, "install");
|
||||
gettext_args = Py_BuildValue ("ss", GETTEXT_PACKAGE, PLUMA_LOCALEDIR);
|
||||
gettext_args = Py_BuildValue ("ss", GETTEXT_PACKAGE, XEDIT_LOCALEDIR);
|
||||
PyObject_CallObject (install, gettext_args);
|
||||
Py_DECREF (gettext_args);
|
||||
|
||||
@@ -648,38 +648,38 @@ pluma_python_init (PlumaPluginLoaderPython *loader)
|
||||
python_init_error:
|
||||
|
||||
g_warning ("Please check the installation of all the Python related packages required "
|
||||
"by pluma and try again.");
|
||||
"by xedit and try again.");
|
||||
|
||||
PyErr_Clear ();
|
||||
|
||||
pluma_python_shutdown (loader);
|
||||
xedit_python_shutdown (loader);
|
||||
|
||||
return FALSE;
|
||||
}
|
||||
|
||||
static void
|
||||
pluma_plugin_loader_python_finalize (GObject *object)
|
||||
xedit_plugin_loader_python_finalize (GObject *object)
|
||||
{
|
||||
PlumaPluginLoaderPython *pyloader = PLUMA_PLUGIN_LOADER_PYTHON (object);
|
||||
XeditPluginLoaderPython *pyloader = XEDIT_PLUGIN_LOADER_PYTHON (object);
|
||||
|
||||
g_hash_table_destroy (pyloader->priv->loaded_plugins);
|
||||
pluma_python_shutdown (pyloader);
|
||||
xedit_python_shutdown (pyloader);
|
||||
|
||||
G_OBJECT_CLASS (pluma_plugin_loader_python_parent_class)->finalize (object);
|
||||
G_OBJECT_CLASS (xedit_plugin_loader_python_parent_class)->finalize (object);
|
||||
}
|
||||
|
||||
static void
|
||||
pluma_plugin_loader_python_class_init (PlumaPluginLoaderPythonClass *klass)
|
||||
xedit_plugin_loader_python_class_init (XeditPluginLoaderPythonClass *klass)
|
||||
{
|
||||
GObjectClass *object_class = G_OBJECT_CLASS (klass);
|
||||
|
||||
object_class->finalize = pluma_plugin_loader_python_finalize;
|
||||
object_class->finalize = xedit_plugin_loader_python_finalize;
|
||||
|
||||
g_type_class_add_private (object_class, sizeof (PlumaPluginLoaderPythonPrivate));
|
||||
g_type_class_add_private (object_class, sizeof (XeditPluginLoaderPythonPrivate));
|
||||
}
|
||||
|
||||
static void
|
||||
pluma_plugin_loader_python_class_finalize (PlumaPluginLoaderPythonClass *klass)
|
||||
xedit_plugin_loader_python_class_finalize (XeditPluginLoaderPythonClass *klass)
|
||||
{
|
||||
}
|
||||
|
||||
@@ -695,25 +695,25 @@ destroy_python_info (PythonInfo *info)
|
||||
}
|
||||
|
||||
static void
|
||||
pluma_plugin_loader_python_init (PlumaPluginLoaderPython *self)
|
||||
xedit_plugin_loader_python_init (XeditPluginLoaderPython *self)
|
||||
{
|
||||
self->priv = PLUMA_PLUGIN_LOADER_PYTHON_GET_PRIVATE (self);
|
||||
self->priv = XEDIT_PLUGIN_LOADER_PYTHON_GET_PRIVATE (self);
|
||||
|
||||
/* initialize python interpreter */
|
||||
pluma_python_init (self);
|
||||
xedit_python_init (self);
|
||||
|
||||
/* loaded_plugins maps PlumaPluginInfo to a PythonInfo */
|
||||
/* loaded_plugins maps XeditPluginInfo to a PythonInfo */
|
||||
self->priv->loaded_plugins = g_hash_table_new_full (g_direct_hash,
|
||||
g_direct_equal,
|
||||
NULL,
|
||||
(GDestroyNotify)destroy_python_info);
|
||||
}
|
||||
|
||||
PlumaPluginLoaderPython *
|
||||
pluma_plugin_loader_python_new ()
|
||||
XeditPluginLoaderPython *
|
||||
xedit_plugin_loader_python_new ()
|
||||
{
|
||||
GObject *loader = g_object_new (PLUMA_TYPE_PLUGIN_LOADER_PYTHON, NULL);
|
||||
GObject *loader = g_object_new (XEDIT_TYPE_PLUGIN_LOADER_PYTHON, NULL);
|
||||
|
||||
return PLUMA_PLUGIN_LOADER_PYTHON (loader);
|
||||
return XEDIT_PLUGIN_LOADER_PYTHON (loader);
|
||||
}
|
||||
|
61
plugin-loaders/python/xedit-plugin-loader-python.h
Normal file
61
plugin-loaders/python/xedit-plugin-loader-python.h
Normal file
@@ -0,0 +1,61 @@
|
||||
/*
|
||||
* xedit-plugin-loader-python.h
|
||||
* This file is part of xedit
|
||||
*
|
||||
* Copyright (C) 2008 - Jesse van den Kieboom
|
||||
*
|
||||
* 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., 51 Franklin St, Fifth Floor,
|
||||
* Boston, MA 02110-1301, USA.
|
||||
*/
|
||||
|
||||
#ifndef __XEDIT_PLUGIN_LOADER_PYTHON_H__
|
||||
#define __XEDIT_PLUGIN_LOADER_PYTHON_H__
|
||||
|
||||
#include <xedit/xedit-plugin-loader.h>
|
||||
|
||||
G_BEGIN_DECLS
|
||||
|
||||
#define XEDIT_TYPE_PLUGIN_LOADER_PYTHON (xedit_plugin_loader_python_get_type ())
|
||||
#define XEDIT_PLUGIN_LOADER_PYTHON(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), XEDIT_TYPE_PLUGIN_LOADER_PYTHON, XeditPluginLoaderPython))
|
||||
#define XEDIT_PLUGIN_LOADER_PYTHON_CONST(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), XEDIT_TYPE_PLUGIN_LOADER_PYTHON, XeditPluginLoaderPython const))
|
||||
#define XEDIT_PLUGIN_LOADER_PYTHON_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), XEDIT_TYPE_PLUGIN_LOADER_PYTHON, XeditPluginLoaderPythonClass))
|
||||
#define XEDIT_IS_PLUGIN_LOADER_PYTHON(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), XEDIT_TYPE_PLUGIN_LOADER_PYTHON))
|
||||
#define XEDIT_IS_PLUGIN_LOADER_PYTHON_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), XEDIT_TYPE_PLUGIN_LOADER_PYTHON))
|
||||
#define XEDIT_PLUGIN_LOADER_PYTHON_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), XEDIT_TYPE_PLUGIN_LOADER_PYTHON, XeditPluginLoaderPythonClass))
|
||||
|
||||
typedef struct _XeditPluginLoaderPython XeditPluginLoaderPython;
|
||||
typedef struct _XeditPluginLoaderPythonClass XeditPluginLoaderPythonClass;
|
||||
typedef struct _XeditPluginLoaderPythonPrivate XeditPluginLoaderPythonPrivate;
|
||||
|
||||
struct _XeditPluginLoaderPython {
|
||||
GObject parent;
|
||||
|
||||
XeditPluginLoaderPythonPrivate *priv;
|
||||
};
|
||||
|
||||
struct _XeditPluginLoaderPythonClass {
|
||||
GObjectClass parent_class;
|
||||
};
|
||||
|
||||
GType xedit_plugin_loader_python_get_type (void) G_GNUC_CONST;
|
||||
XeditPluginLoaderPython *xedit_plugin_loader_python_new(void);
|
||||
|
||||
/* All the loaders must implement this function */
|
||||
G_MODULE_EXPORT GType register_xedit_plugin_loader (GTypeModule * module);
|
||||
|
||||
G_END_DECLS
|
||||
|
||||
#endif /* __XEDIT_PLUGIN_LOADER_PYTHON_H__ */
|
||||
|
@@ -1,6 +1,6 @@
|
||||
/*
|
||||
* pluma-plugin-python.c
|
||||
* This file is part of pluma
|
||||
* xedit-plugin-python.c
|
||||
* This file is part of xedit
|
||||
*
|
||||
* Copyright (C) 2005 Raphael Slinckx
|
||||
* Copyright (C) 2008 Jesse van den Kieboom
|
||||
@@ -23,30 +23,30 @@
|
||||
|
||||
#include <config.h>
|
||||
|
||||
#include "pluma-plugin-python.h"
|
||||
#include "xedit-plugin-python.h"
|
||||
|
||||
#include <pluma/pluma-plugin.h>
|
||||
#include <pluma/pluma-debug.h>
|
||||
#include <xedit/xedit-plugin.h>
|
||||
#include <xedit/xedit-debug.h>
|
||||
#include <pygobject.h>
|
||||
#include <string.h>
|
||||
|
||||
#define PLUMA_PLUGIN_PYTHON_GET_PRIVATE(object)(G_TYPE_INSTANCE_GET_PRIVATE ((object), PLUMA_TYPE_PLUGIN_PYTHON, PlumaPluginPythonPrivate))
|
||||
#define XEDIT_PLUGIN_PYTHON_GET_PRIVATE(object)(G_TYPE_INSTANCE_GET_PRIVATE ((object), XEDIT_TYPE_PLUGIN_PYTHON, XeditPluginPythonPrivate))
|
||||
|
||||
static GObjectClass *parent_class;
|
||||
|
||||
struct _PlumaPluginPythonPrivate
|
||||
struct _XeditPluginPythonPrivate
|
||||
{
|
||||
PyObject *instance;
|
||||
};
|
||||
|
||||
static void pluma_plugin_python_class_init (PlumaPluginPythonClass *klass);
|
||||
static void pluma_plugin_python_init (PlumaPluginPython *plugin);
|
||||
static void xedit_plugin_python_class_init (XeditPluginPythonClass *klass);
|
||||
static void xedit_plugin_python_init (XeditPluginPython *plugin);
|
||||
|
||||
G_DEFINE_TYPE (PlumaPluginPython, pluma_plugin_python, PLUMA_TYPE_PLUGIN)
|
||||
G_DEFINE_TYPE (XeditPluginPython, xedit_plugin_python, XEDIT_TYPE_PLUGIN)
|
||||
|
||||
static PyObject *
|
||||
call_python_method (PlumaPluginPythonPrivate *priv,
|
||||
PlumaWindow *window,
|
||||
call_python_method (XeditPluginPythonPrivate *priv,
|
||||
XeditWindow *window,
|
||||
gchar *method)
|
||||
{
|
||||
PyObject *py_ret = NULL;
|
||||
@@ -101,11 +101,11 @@ check_py_object_is_gtk_widget (PyObject *py_obj)
|
||||
}
|
||||
|
||||
static void
|
||||
impl_update_ui (PlumaPlugin *plugin,
|
||||
PlumaWindow *window)
|
||||
impl_update_ui (XeditPlugin *plugin,
|
||||
XeditWindow *window)
|
||||
{
|
||||
PyGILState_STATE state = pyg_gil_state_ensure ();
|
||||
PlumaPluginPythonPrivate *priv = PLUMA_PLUGIN_PYTHON(plugin)->priv;
|
||||
XeditPluginPythonPrivate *priv = XEDIT_PLUGIN_PYTHON(plugin)->priv;
|
||||
|
||||
if (PyObject_HasAttrString (priv->instance, "update_ui"))
|
||||
{
|
||||
@@ -117,17 +117,17 @@ impl_update_ui (PlumaPlugin *plugin,
|
||||
}
|
||||
}
|
||||
else
|
||||
PLUMA_PLUGIN_CLASS (parent_class)->update_ui (plugin, window);
|
||||
XEDIT_PLUGIN_CLASS (parent_class)->update_ui (plugin, window);
|
||||
|
||||
pyg_gil_state_release (state);
|
||||
}
|
||||
|
||||
static void
|
||||
impl_deactivate (PlumaPlugin *plugin,
|
||||
PlumaWindow *window)
|
||||
impl_deactivate (XeditPlugin *plugin,
|
||||
XeditWindow *window)
|
||||
{
|
||||
PyGILState_STATE state = pyg_gil_state_ensure ();
|
||||
PlumaPluginPythonPrivate *priv = PLUMA_PLUGIN_PYTHON(plugin)->priv;
|
||||
XeditPluginPythonPrivate *priv = XEDIT_PLUGIN_PYTHON(plugin)->priv;
|
||||
|
||||
if (PyObject_HasAttrString (priv->instance, "deactivate"))
|
||||
{
|
||||
@@ -139,17 +139,17 @@ impl_deactivate (PlumaPlugin *plugin,
|
||||
}
|
||||
}
|
||||
else
|
||||
PLUMA_PLUGIN_CLASS (parent_class)->deactivate (plugin, window);
|
||||
XEDIT_PLUGIN_CLASS (parent_class)->deactivate (plugin, window);
|
||||
|
||||
pyg_gil_state_release (state);
|
||||
}
|
||||
|
||||
static void
|
||||
impl_activate (PlumaPlugin *plugin,
|
||||
PlumaWindow *window)
|
||||
impl_activate (XeditPlugin *plugin,
|
||||
XeditWindow *window)
|
||||
{
|
||||
PyGILState_STATE state = pyg_gil_state_ensure ();
|
||||
PlumaPluginPythonPrivate *priv = PLUMA_PLUGIN_PYTHON(plugin)->priv;
|
||||
XeditPluginPythonPrivate *priv = XEDIT_PLUGIN_PYTHON(plugin)->priv;
|
||||
|
||||
if (PyObject_HasAttrString (priv->instance, "activate"))
|
||||
{
|
||||
@@ -161,16 +161,16 @@ impl_activate (PlumaPlugin *plugin,
|
||||
}
|
||||
}
|
||||
else
|
||||
PLUMA_PLUGIN_CLASS (parent_class)->activate (plugin, window);
|
||||
XEDIT_PLUGIN_CLASS (parent_class)->activate (plugin, window);
|
||||
|
||||
pyg_gil_state_release (state);
|
||||
}
|
||||
|
||||
static GtkWidget *
|
||||
impl_create_configure_dialog (PlumaPlugin *plugin)
|
||||
impl_create_configure_dialog (XeditPlugin *plugin)
|
||||
{
|
||||
PyGILState_STATE state = pyg_gil_state_ensure ();
|
||||
PlumaPluginPythonPrivate *priv = PLUMA_PLUGIN_PYTHON(plugin)->priv;
|
||||
XeditPluginPythonPrivate *priv = XEDIT_PLUGIN_PYTHON(plugin)->priv;
|
||||
GtkWidget *ret = NULL;
|
||||
|
||||
if (PyObject_HasAttrString (priv->instance, "create_configure_dialog"))
|
||||
@@ -194,7 +194,7 @@ impl_create_configure_dialog (PlumaPlugin *plugin)
|
||||
}
|
||||
}
|
||||
else
|
||||
ret = PLUMA_PLUGIN_CLASS (parent_class)->create_configure_dialog (plugin);
|
||||
ret = XEDIT_PLUGIN_CLASS (parent_class)->create_configure_dialog (plugin);
|
||||
|
||||
pyg_gil_state_release (state);
|
||||
|
||||
@@ -202,10 +202,10 @@ impl_create_configure_dialog (PlumaPlugin *plugin)
|
||||
}
|
||||
|
||||
static gboolean
|
||||
impl_is_configurable (PlumaPlugin *plugin)
|
||||
impl_is_configurable (XeditPlugin *plugin)
|
||||
{
|
||||
PyGILState_STATE state = pyg_gil_state_ensure ();
|
||||
PlumaPluginPythonPrivate *priv = PLUMA_PLUGIN_PYTHON(plugin)->priv;
|
||||
XeditPluginPythonPrivate *priv = XEDIT_PLUGIN_PYTHON(plugin)->priv;
|
||||
PyObject *dict = priv->instance->ob_type->tp_dict;
|
||||
gboolean result;
|
||||
|
||||
@@ -222,7 +222,7 @@ impl_is_configurable (PlumaPlugin *plugin)
|
||||
}
|
||||
|
||||
void
|
||||
_pluma_plugin_python_set_instance (PlumaPluginPython *plugin,
|
||||
_xedit_plugin_python_set_instance (XeditPluginPython *plugin,
|
||||
PyObject *instance)
|
||||
{
|
||||
PyGILState_STATE state = pyg_gil_state_ensure ();
|
||||
@@ -234,43 +234,43 @@ _pluma_plugin_python_set_instance (PlumaPluginPython *plugin,
|
||||
}
|
||||
|
||||
PyObject *
|
||||
_pluma_plugin_python_get_instance (PlumaPluginPython *plugin)
|
||||
_xedit_plugin_python_get_instance (XeditPluginPython *plugin)
|
||||
{
|
||||
return plugin->priv->instance;
|
||||
}
|
||||
|
||||
static void
|
||||
pluma_plugin_python_init (PlumaPluginPython *plugin)
|
||||
xedit_plugin_python_init (XeditPluginPython *plugin)
|
||||
{
|
||||
plugin->priv = PLUMA_PLUGIN_PYTHON_GET_PRIVATE(plugin);
|
||||
plugin->priv = XEDIT_PLUGIN_PYTHON_GET_PRIVATE(plugin);
|
||||
|
||||
pluma_debug_message (DEBUG_PLUGINS, "Creating Python plugin instance");
|
||||
xedit_debug_message (DEBUG_PLUGINS, "Creating Python plugin instance");
|
||||
plugin->priv->instance = 0;
|
||||
}
|
||||
|
||||
static void
|
||||
pluma_plugin_python_finalize (GObject *object)
|
||||
xedit_plugin_python_finalize (GObject *object)
|
||||
{
|
||||
PyGILState_STATE state;
|
||||
|
||||
pluma_debug_message (DEBUG_PLUGINS, "Finalizing Python plugin instance");
|
||||
xedit_debug_message (DEBUG_PLUGINS, "Finalizing Python plugin instance");
|
||||
|
||||
state = pyg_gil_state_ensure ();
|
||||
Py_XDECREF (PLUMA_PLUGIN_PYTHON(object)->priv->instance);
|
||||
Py_XDECREF (XEDIT_PLUGIN_PYTHON(object)->priv->instance);
|
||||
pyg_gil_state_release (state);
|
||||
|
||||
G_OBJECT_CLASS (parent_class)->finalize (object);
|
||||
}
|
||||
|
||||
static void
|
||||
pluma_plugin_python_class_init (PlumaPluginPythonClass *klass)
|
||||
xedit_plugin_python_class_init (XeditPluginPythonClass *klass)
|
||||
{
|
||||
PlumaPluginClass *plugin_class = PLUMA_PLUGIN_CLASS (klass);
|
||||
XeditPluginClass *plugin_class = XEDIT_PLUGIN_CLASS (klass);
|
||||
|
||||
parent_class = g_type_class_peek_parent (klass);
|
||||
|
||||
g_type_class_add_private (klass, sizeof (PlumaPluginPythonPrivate));
|
||||
G_OBJECT_CLASS (klass)->finalize = pluma_plugin_python_finalize;
|
||||
g_type_class_add_private (klass, sizeof (XeditPluginPythonPrivate));
|
||||
G_OBJECT_CLASS (klass)->finalize = xedit_plugin_python_finalize;
|
||||
|
||||
plugin_class->activate = impl_activate;
|
||||
plugin_class->deactivate = impl_deactivate;
|
88
plugin-loaders/python/xedit-plugin-python.h
Normal file
88
plugin-loaders/python/xedit-plugin-python.h
Normal file
@@ -0,0 +1,88 @@
|
||||
/*
|
||||
* xedit-plugin-python.h
|
||||
* This file is part of xedit
|
||||
*
|
||||
* Copyright (C) 2005 - Raphael Slinckx
|
||||
* Copyright (C) 2008 - Jesse van den Kieboom
|
||||
*
|
||||
* 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., 51 Franklin St, Fifth Floor,
|
||||
* Boston, MA 02110-1301, USA.
|
||||
*/
|
||||
|
||||
#ifndef __XEDIT_PLUGIN_PYTHON_H__
|
||||
#define __XEDIT_PLUGIN_PYTHON_H__
|
||||
|
||||
#define NO_IMPORT_PYGOBJECT
|
||||
|
||||
#include <glib-object.h>
|
||||
#include <pygobject.h>
|
||||
|
||||
#include <xedit/xedit-plugin.h>
|
||||
|
||||
G_BEGIN_DECLS
|
||||
|
||||
/*
|
||||
* Type checking and casting macros
|
||||
*/
|
||||
#define XEDIT_TYPE_PLUGIN_PYTHON (xedit_plugin_python_get_type())
|
||||
#define XEDIT_PLUGIN_PYTHON(obj) (G_TYPE_CHECK_INSTANCE_CAST((obj), XEDIT_TYPE_PLUGIN_PYTHON, XeditPluginPython))
|
||||
#define XEDIT_PLUGIN_PYTHON_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST((klass), XEDIT_TYPE_PLUGIN_PYTHON, XeditPluginPythonClass))
|
||||
#define XEDIT_IS_PLUGIN_PYTHON(obj) (G_TYPE_CHECK_INSTANCE_TYPE((obj), XEDIT_TYPE_PLUGIN_PYTHON))
|
||||
#define XEDIT_IS_PLUGIN_PYTHON_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), XEDIT_TYPE_PLUGIN_PYTHON))
|
||||
#define XEDIT_PLUGIN_PYTHON_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS((obj), XEDIT_TYPE_PLUGIN_PYTHON, XeditPluginPythonClass))
|
||||
|
||||
/* Private structure type */
|
||||
typedef struct _XeditPluginPythonPrivate XeditPluginPythonPrivate;
|
||||
|
||||
/*
|
||||
* Main object structure
|
||||
*/
|
||||
typedef struct _XeditPluginPython XeditPluginPython;
|
||||
|
||||
struct _XeditPluginPython
|
||||
{
|
||||
XeditPlugin parent;
|
||||
|
||||
/*< private > */
|
||||
XeditPluginPythonPrivate *priv;
|
||||
};
|
||||
|
||||
/*
|
||||
* Class definition
|
||||
*/
|
||||
typedef struct _XeditPluginPythonClass XeditPluginPythonClass;
|
||||
|
||||
struct _XeditPluginPythonClass
|
||||
{
|
||||
XeditPluginClass parent_class;
|
||||
};
|
||||
|
||||
/*
|
||||
* Public methods
|
||||
*/
|
||||
GType xedit_plugin_python_get_type (void) G_GNUC_CONST;
|
||||
|
||||
|
||||
/*
|
||||
* Private methods
|
||||
*/
|
||||
void _xedit_plugin_python_set_instance (XeditPluginPython *plugin,
|
||||
PyObject *instance);
|
||||
PyObject *_xedit_plugin_python_get_instance (XeditPluginPython *plugin);
|
||||
|
||||
G_END_DECLS
|
||||
|
||||
#endif /* __XEDIT_PLUGIN_PYTHON_H__ */
|
||||
|
Reference in New Issue
Block a user