Changed the 'gimp' module to folder with a __init__.py so that it is able

2008-05-28  Lars-Peter Clausen  <lars@metafoo.de>

	Changed the 'gimp' module to folder with a __init__.py so that it is
	able to contain submodules. Renamed the C based 'gimp' module to '_gimp'.
	__init__.py imports all symbols from _gimp.

	* plug-ins/pygimp/Makefile.am
	* plug-ins/pygimp/makefile.msc
	* plug-ins/pygimp/gimpmodule.c
	* plug-ins/pygimp/__init__.py

svn path=/branches/soc-2008-python/; revision=25818
This commit is contained in:
Lars-Peter Clausen 2008-05-26 20:20:17 +00:00 committed by Lars-Peter Clausen
parent 3d48dcc119
commit 29e78de25e
5 changed files with 56 additions and 13 deletions

View File

@ -1,3 +1,14 @@
2008-05-28 Lars-Peter Clausen <lars@metafoo.de>
Changed the 'gimp' module to folder with a __init__.py so that it is
able to contain submodules. Renamed the C based 'gimp' module to '_gimp'.
__init__.py imports all symbols from _gimp.
* plug-ins/pygimp/Makefile.am
* plug-ins/pygimp/makefile.msc
* plug-ins/pygimp/gimpmodule.c
* plug-ins/pygimp/__init__.py
2008-05-24 Sven Neumann <sven@gimp.org>
* HACKING: note that we need intltool 0.35.5 or newer.

View File

@ -25,11 +25,14 @@ INCLUDES = -I$(top_srcdir) $(PYTHON_INCLUDES) $(PYGTK_CFLAGS) $(GTK_CFLAGS)
pygimpbase = python
pygimpdir = $(gimpplugindir)/$(pygimpbase)
pygimpmoduledir = $(pygimpdir)/gimp
pygimp_LTLIBRARIES = gimp.la _gimpenums.la gimpcolor.la _gimpui.la \
pygimp_LTLIBRARIES = _gimpenums.la gimpcolor.la _gimpui.la \
gimpthumb.la
gimp_la_SOURCES = \
pygimpmodule_LTLIBRARIES = _gimp.la
_gimp_la_SOURCES = \
gimpmodule.c \
pygimp-display.c \
pygimp-drawable.c \
@ -43,10 +46,10 @@ gimp_la_SOURCES = \
pygimp-intl.h \
pygimp-util.h
gimp_la_LDFLAGS = -module -avoid-version $(no_undefined) \
-export-symbols-regex initgimp
_gimp_la_LDFLAGS = -module -avoid-version $(no_undefined) \
-export-symbols-regex init_gimp
gimp_la_LIBADD = \
_gimp_la_LIBADD = \
$(libgimp) \
$(libgimpcolor) \
$(libgimpbase) \
@ -123,6 +126,9 @@ pygimp_PYTHON = \
pygimp_DATA = pygimp-logo.png
pygimpmodule_PYTHON = \
__init__.py
codegen_files = \
gimpcolor-types.defs \
gimpenums-types.defs \

View File

@ -0,0 +1,26 @@
# -*- Mode: Python; py-indent-offset: 3 -*-
# Gimp-Python - allows the writing of Gimp plugins in Python.
# Copyright (C) 2008 Lars-Peter Clausen <lars@metafoo.de>
#
# This program is free software; you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation; either version 2 of the License, or
# (at your option) any later version.
#
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU General Public License for more details.
#
# You should have received a copy of the GNU General Public License
# along with this program; if not, write to the Free Software
# Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
"""
Initialisation file for pygimp module.
"""
from _gimp import *
from _gimp import _id2image, _id2drawable, _id2vectors, _id2display, _PyGimp_API
import context

View File

@ -1,4 +1,4 @@
/* -*- Mode: C; c-basic-offset: 4 -*-
/* -*- Mode: C; c-basic-offset: 3 -*-
Gimp-Python - allows the writing of Gimp plugins in Python.
Copyright (C) 1997-2002 James Henstridge <james@daa.com.au>
@ -1778,16 +1778,16 @@ static struct _PyGimp_Functions pygimp_api_functions = {
};
/* Initialization function for the module (*must* be called initgimp) */
/* Initialization function for the module (*must* be called init_gimp) */
static char gimp_module_documentation[] =
"This module provides interfaces to allow you to write gimp plugins"
;
void initgimp(void);
void init_gimp(void);
PyMODINIT_FUNC
initgimp(void)
init_gimp(void)
{
PyObject *m;
@ -1883,7 +1883,7 @@ initgimp(void)
PyUnicode_SetDefaultEncoding("utf-8");
/* Create the module and add the functions */
m = Py_InitModule4("gimp", gimp_methods,
m = Py_InitModule4("_gimp", gimp_methods,
gimp_module_documentation,
NULL, PYTHON_API_VERSION);

View File

@ -1,6 +1,6 @@
!IFNDEF MODULE
MODULES = gimp _gimpenums gimpcolor _gimpui
MODULES = _gimp _gimpenums gimpcolor _gimpui
all : sub-all
@ -16,7 +16,7 @@ MODULE=$(MODULE)
#OPTIMIZE = -Od -Op
#DEBUG=1
!IFDEF OBJ_gimp
!IFDEF OBJ__gimp
OBJECTS = \
gimpmodule.obj \
pygimp-image.obj \
@ -84,4 +84,4 @@ clean::
del gimpui.c