mirror of https://github.com/GNOME/gimp.git
Sven Neumann <sven@gimp.org>
2000-05-31 Michael Natterer <mitch@gimp.org> Sven Neumann <sven@gimp.org> * libgimp/Makefile.am * libgimp/gimpchannel_pdb.h * libgimp/gimpdisplay_pdb.h * libgimp/gimpdrawable_pdb.h * libgimp/gimpgradient_pdb.h * libgimp/gimphelp_pdb.h * libgimp/gimpimage_pdb.h * libgimp/gimplayer_pdb.h * libgimp/gimpparasite_pdb.h * libgimp/gimpselection_pdb.h * libgimp/gimpunit_pdb.h * libgimp/gimpdrawable.[ch] * libgimp/gimphelp.c * libgimp/gimppixelrgn.h * libgimp/gimptile.h: new files * libgimp/gimp.[ch] * libgimp/gimpchannel_pdb.c * libgimp/gimpdrawable_pdb.c * libgimp/gimpgradient_pdb.c * libgimp/gimppalette_pdb.c * libgimp/gimpselection_pdb.c * libgimp/gimphelp_pdb.c * libgimp/gimpimage_pdb.c * libgimp/gimplayer_pdb.c * libgimp/gimpgradientmenu.c * libgimp/gimpbrushmenu.c * libgimp/gimpmenu.[ch] * libgimp/gimppatternmenu.c * libgimp/gimppixelrgn.c * libgimp/gimptile.c: part III of the (final) libgimp cleanup Split gimp.h into a bunch of headers. More or less finished the task of moving PDB wrappers into separate files in preparation of the upcoming autogen-it-all-attack. * libgimp/gimpcompat.h: declared the following functions obsolete: gimp_[channel|layer]_[width|height] gimp_layer_[bpp|type] gimp_channel_get_[image|layer]_ID * libgimp/gimptypes.h: new file: GPlugInInfo GTile GDrawable GPixelRgn GParamColor GParamRegion GParamData GParamDef GParam: s/G/Gimp/ * app/gimphelp_cmds.c * app/plug_in_cmds.c * tools/pdbgen/pdb/gimphelp.pdb * tools/pdbgen/pdb/plug_in.pdb: changed help texts.
This commit is contained in:
parent
804af727f6
commit
053af2f1c9
60
ChangeLog
60
ChangeLog
|
@ -1,3 +1,63 @@
|
|||
2000-05-31 Michael Natterer <mitch@gimp.org>
|
||||
Sven Neumann <sven@gimp.org>
|
||||
|
||||
* libgimp/Makefile.am
|
||||
* libgimp/gimpchannel_pdb.h
|
||||
* libgimp/gimpdisplay_pdb.h
|
||||
* libgimp/gimpdrawable_pdb.h
|
||||
* libgimp/gimpgradient_pdb.h
|
||||
* libgimp/gimphelp_pdb.h
|
||||
* libgimp/gimpimage_pdb.h
|
||||
* libgimp/gimplayer_pdb.h
|
||||
* libgimp/gimpparasite_pdb.h
|
||||
* libgimp/gimpselection_pdb.h
|
||||
* libgimp/gimpunit_pdb.h
|
||||
* libgimp/gimpdrawable.[ch]
|
||||
* libgimp/gimphelp.c
|
||||
* libgimp/gimppixelrgn.h
|
||||
* libgimp/gimptile.h: new files
|
||||
|
||||
* libgimp/gimp.[ch]
|
||||
* libgimp/gimpchannel_pdb.c
|
||||
* libgimp/gimpdrawable_pdb.c
|
||||
* libgimp/gimpgradient_pdb.c
|
||||
* libgimp/gimppalette_pdb.c
|
||||
* libgimp/gimpselection_pdb.c
|
||||
* libgimp/gimphelp_pdb.c
|
||||
* libgimp/gimpimage_pdb.c
|
||||
* libgimp/gimplayer_pdb.c
|
||||
* libgimp/gimpgradientmenu.c
|
||||
* libgimp/gimpbrushmenu.c
|
||||
* libgimp/gimpmenu.[ch]
|
||||
* libgimp/gimppatternmenu.c
|
||||
* libgimp/gimppixelrgn.c
|
||||
* libgimp/gimptile.c: part III of the (final) libgimp cleanup
|
||||
|
||||
Split gimp.h into a bunch of headers. More or less finished the
|
||||
task of moving PDB wrappers into separate files in preparation
|
||||
of the upcoming autogen-it-all-attack.
|
||||
|
||||
* libgimp/gimpcompat.h: declared the following functions obsolete:
|
||||
gimp_[channel|layer]_[width|height]
|
||||
gimp_layer_[bpp|type]
|
||||
gimp_channel_get_[image|layer]_ID
|
||||
|
||||
* libgimp/gimptypes.h: new file:
|
||||
GPlugInInfo
|
||||
GTile
|
||||
GDrawable
|
||||
GPixelRgn
|
||||
GParamColor
|
||||
GParamRegion
|
||||
GParamData
|
||||
GParamDef
|
||||
GParam: s/G/Gimp/
|
||||
|
||||
* app/gimphelp_cmds.c
|
||||
* app/plug_in_cmds.c
|
||||
* tools/pdbgen/pdb/gimphelp.pdb
|
||||
* tools/pdbgen/pdb/plug_in.pdb: changed help texts.
|
||||
|
||||
2000-05-31 Michael Natterer <mitch@gimp.org>
|
||||
|
||||
* app/gimpunit.c
|
||||
|
|
|
@ -123,7 +123,7 @@ static ProcRecord plugin_help_register_proc =
|
|||
{
|
||||
"gimp_plugin_help_register",
|
||||
"Register a help path for a plug-in.",
|
||||
"This procedure changes the help rootdir for the plug-in which calls it. All subsequent calls of gimp_help from this plug-in will be interpreted relative to this rootdir.",
|
||||
"This procedure changes the help rootdir for the plug-in which calls it. All subsequent calls of gimp_help from this plug-in will be interpreted relative to this rootdir. This procedure can only be called in the query function of a plug-in and it has to be called before any procedure is installed.",
|
||||
"Michael Natterer <mitch@gimp.org>",
|
||||
"Michael Natterer <mitch@gimp.org>",
|
||||
"2000",
|
||||
|
|
|
@ -437,7 +437,7 @@ static ProcRecord plugin_domain_add_proc =
|
|||
{
|
||||
"gimp_plugin_domain_add",
|
||||
"Adds a textdomain for localisation.",
|
||||
"This procedure adds a textdomain to the list of domains Gimp searches for strings when translating its menu entries. There is no need to call this function for plug-ins that have their strings included in the gimp-std-plugins domain as that is use by default. If the compiled message catalog is not in the standard location, you may specify an absolute path to another location. This procedure can only be called in the query function of a plug-in and it has to be called before a procedure is installed.",
|
||||
"This procedure adds a textdomain to the list of domains Gimp searches for strings when translating its menu entries. There is no need to call this function for plug-ins that have their strings included in the gimp-std-plugins domain as that is used by default. If the compiled message catalog is not in the standard location, you may specify an absolute path to another location. This procedure can only be called in the query function of a plug-in and it has to be called before any procedure is installed.",
|
||||
"Sven Neumann",
|
||||
"Sven Neumann",
|
||||
"2000",
|
||||
|
|
|
@ -31,6 +31,7 @@ libgimpi_a_SOURCES = \
|
|||
gimpchainbutton.h \
|
||||
gimpcolorbutton.c \
|
||||
gimpcolorspace.c \
|
||||
gimpcolorspace.h \
|
||||
gimpdialog.c \
|
||||
gimpdialog.h \
|
||||
gimpfileselection.c \
|
||||
|
@ -78,31 +79,48 @@ endif
|
|||
|
||||
libgimp_la_SOURCES = \
|
||||
gimp.c \
|
||||
gimp.h \
|
||||
gimpchannel_pdb.h \
|
||||
gimpchannel_pdb.c \
|
||||
gimpcolorbutton.h \
|
||||
gimpcolorspace.c \
|
||||
gimpcolorspace.h \
|
||||
gimpdisplay_pdb.c \
|
||||
gimpdisplay_pdb.h \
|
||||
gimpdrawable.c \
|
||||
gimpdrawable.h \
|
||||
gimpdrawable_pdb.c \
|
||||
gimpdrawable_pdb.h \
|
||||
gimpenv.c \
|
||||
gimpenv.h \
|
||||
gimpgradient_pdb.c \
|
||||
gimphelp.c \
|
||||
gimphelp_pdb.c \
|
||||
gimphelp_pdb.h \
|
||||
gimpimage_pdb.c \
|
||||
gimpimage_pdb.h \
|
||||
gimplayer_pdb.c \
|
||||
gimplayer_pdb.h \
|
||||
gimpmatrix.c \
|
||||
gimpmatrix.h \
|
||||
gimppalette_pdb.c \
|
||||
gimpparasite_pdb.c \
|
||||
gimpparasite.c \
|
||||
gimpparasite.h \
|
||||
gimpparasiteio.c \
|
||||
gimpparasiteio.h \
|
||||
gimpparasite_pdb.c \
|
||||
gimpparasite_pdb.h \
|
||||
gimppixelrgn.c \
|
||||
gimppixelrgn.h \
|
||||
gimpprotocol.c \
|
||||
gimpprotocol.h \
|
||||
gimpselection_pdb.c \
|
||||
gimpselection_pdb.h \
|
||||
gimpsignal.c \
|
||||
gimpsignal.h \
|
||||
gimptile.c \
|
||||
gimptile.h \
|
||||
gimpunit_pdb.c \
|
||||
gimpunit_pdb.h \
|
||||
gimpunit.h \
|
||||
gimputils.c \
|
||||
gimputils.h \
|
||||
|
@ -120,6 +138,7 @@ libgimpui_la_SOURCES = \
|
|||
gimppatternmenu.c \
|
||||
gimpchainbutton.c \
|
||||
gimpcolorbutton.c \
|
||||
gimpcolorbutton.h \
|
||||
gimpdialog.c \
|
||||
gimpexport.c \
|
||||
gimpfileselection.c \
|
||||
|
@ -134,6 +153,16 @@ libgimpui_la_SOURCES = \
|
|||
|
||||
gimpinclude_HEADERS = \
|
||||
gimp.h \
|
||||
gimpchannel_pdb.h \
|
||||
gimpdisplay_pdb.h \
|
||||
gimpdrawable_pdb.h \
|
||||
gimpgradient_pdb.h \
|
||||
gimphelp_pdb.h \
|
||||
gimpimage_pdb.h \
|
||||
gimplayer_pdb.h \
|
||||
gimppalette_pdb.h \
|
||||
gimpparasite_pdb.h \
|
||||
gimpselection_pdb.h \
|
||||
gimpchainbutton.h \
|
||||
gimpcolorbutton.h \
|
||||
gimpcolordisplay.h \
|
||||
|
@ -155,18 +184,23 @@ gimpinclude_HEADERS = \
|
|||
gimpparasite.h \
|
||||
gimpparasiteio.h \
|
||||
gimppatheditor.h \
|
||||
gimppixelrgn.h \
|
||||
gimppixmap.h \
|
||||
gimpquerybox.h \
|
||||
gimpsignal.h \
|
||||
gimpsizeentry.h \
|
||||
gimptile.h \
|
||||
gimptypes.h \
|
||||
gimpui.h \
|
||||
gimpunit.h \
|
||||
gimpunitmenu.h \
|
||||
gimputils.h \
|
||||
gimpunit.h \
|
||||
gimpunit_pdb.h \
|
||||
gimpunitmenu.h \
|
||||
gimputils.h \
|
||||
gimpvector.h \
|
||||
gimpwidgets.h \
|
||||
gimpintl.h
|
||||
|
||||
|
||||
libgimp_la_LDFLAGS = \
|
||||
-version-info $(LT_CURRENT):$(LT_REVISION):$(LT_AGE) \
|
||||
-release $(LT_RELEASE)
|
||||
|
|
373
libgimp/gimp.c
373
libgimp/gimp.c
|
@ -21,7 +21,6 @@
|
|||
|
||||
#include <locale.h>
|
||||
#include <errno.h>
|
||||
#include <signal.h>
|
||||
#include <stdarg.h>
|
||||
#include <stdio.h>
|
||||
#include <stdlib.h>
|
||||
|
@ -48,7 +47,7 @@
|
|||
#define WAIT_ANY -1
|
||||
#endif
|
||||
|
||||
#include <gtk/gtk.h>
|
||||
#include <glib.h>
|
||||
|
||||
#ifndef G_OS_WIN32
|
||||
#include "gimpsignal.h"
|
||||
|
@ -86,9 +85,10 @@
|
|||
|
||||
#define WRITE_BUFFER_SIZE 1024
|
||||
|
||||
void gimp_extension_process (guint timeout);
|
||||
void gimp_extension_process (guint timeout);
|
||||
void gimp_extension_ack (void);
|
||||
void gimp_read_expect_msg (WireMessage *msg, gint type);
|
||||
void gimp_read_expect_msg (WireMessage *msg,
|
||||
gint type);
|
||||
|
||||
|
||||
#ifndef G_OS_WIN32
|
||||
|
@ -99,10 +99,10 @@ static gboolean gimp_plugin_io_error_handler (GIOChannel *channel,
|
|||
GIOCondition cond,
|
||||
gpointer data);
|
||||
|
||||
static gint gimp_write (GIOChannel *channel,
|
||||
static gboolean gimp_write (GIOChannel *channel,
|
||||
guint8 *buf,
|
||||
gulong count);
|
||||
static gint gimp_flush (GIOChannel *channel);
|
||||
static gboolean gimp_flush (GIOChannel *channel);
|
||||
static void gimp_loop (void);
|
||||
static void gimp_config (GPConfig *config);
|
||||
static void gimp_proc_run (GPProcRun *proc_run);
|
||||
|
@ -140,19 +140,19 @@ static guint write_buffer_index = 0;
|
|||
static GHashTable *temp_proc_ht = NULL;
|
||||
|
||||
#ifdef G_OS_WIN32
|
||||
static GPlugInInfo *PLUG_IN_INFO_PTR;
|
||||
static GimpPlugInInfo *PLUG_IN_INFO_PTR;
|
||||
#define PLUG_IN_INFO (*PLUG_IN_INFO_PTR)
|
||||
void
|
||||
set_gimp_PLUG_IN_INFO_PTR(GPlugInInfo *p)
|
||||
set_gimp_PLUG_IN_INFO_PTR (GimpPlugInInfo *p)
|
||||
{
|
||||
PLUG_IN_INFO_PTR = p;
|
||||
}
|
||||
#else
|
||||
#ifndef __EMX__
|
||||
extern GPlugInInfo PLUG_IN_INFO;
|
||||
extern GimpPlugInInfo PLUG_IN_INFO;
|
||||
#else
|
||||
static GPlugInInfo PLUG_IN_INFO;
|
||||
void set_gimp_PLUG_IN_INFO(const GPlugInInfo *p)
|
||||
static GimpPlugInInfo PLUG_IN_INFO;
|
||||
void set_gimp_PLUG_IN_INFO (const GimpPlugInInfo *p)
|
||||
{
|
||||
PLUG_IN_INFO = *p;
|
||||
}
|
||||
|
@ -203,7 +203,7 @@ gimp_main (int argc,
|
|||
argc -= i;
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
#endif
|
||||
|
||||
if ((argc < 4) || (strcmp (argv[1], "-gimp") != 0))
|
||||
|
@ -315,7 +315,7 @@ gimp_set_data (gchar *id,
|
|||
gpointer data,
|
||||
guint32 length)
|
||||
{
|
||||
GParam *return_vals;
|
||||
GimpParam *return_vals;
|
||||
int nreturn_vals;
|
||||
|
||||
return_vals = gimp_run_procedure ("gimp_procedural_db_set_data",
|
||||
|
@ -331,7 +331,7 @@ gimp_set_data (gchar *id,
|
|||
guint32
|
||||
gimp_get_data_size (gchar *id)
|
||||
{
|
||||
GParam *return_vals;
|
||||
GimpParam *return_vals;
|
||||
gint nreturn_vals;
|
||||
guint32 length;
|
||||
|
||||
|
@ -354,7 +354,7 @@ void
|
|||
gimp_get_data (gchar *id,
|
||||
gpointer data)
|
||||
{
|
||||
GParam *return_vals;
|
||||
GimpParam *return_vals;
|
||||
gint nreturn_vals;
|
||||
gint length;
|
||||
gchar *returned_data;
|
||||
|
@ -379,7 +379,7 @@ gimp_get_data (gchar *id,
|
|||
void
|
||||
gimp_progress_init (char *message)
|
||||
{
|
||||
GParam *return_vals;
|
||||
GimpParam *return_vals;
|
||||
gint nreturn_vals;
|
||||
|
||||
return_vals = gimp_run_procedure ("gimp_progress_init",
|
||||
|
@ -394,7 +394,7 @@ gimp_progress_init (char *message)
|
|||
void
|
||||
gimp_progress_update (gdouble percentage)
|
||||
{
|
||||
GParam *return_vals;
|
||||
GimpParam *return_vals;
|
||||
gint nreturn_vals;
|
||||
|
||||
return_vals = gimp_run_procedure ("gimp_progress_update",
|
||||
|
@ -415,7 +415,7 @@ gimp_default_display (void)
|
|||
void
|
||||
gimp_message (const gchar *message)
|
||||
{
|
||||
GParam *return_vals;
|
||||
GimpParam *return_vals;
|
||||
gint nreturn_vals;
|
||||
|
||||
return_vals = gimp_run_procedure ("gimp_message",
|
||||
|
@ -444,7 +444,7 @@ gimp_query_database (gchar *name_regexp,
|
|||
gint *nprocs,
|
||||
gchar ***proc_names)
|
||||
{
|
||||
GParam *return_vals;
|
||||
GimpParam *return_vals;
|
||||
gint nreturn_vals;
|
||||
gint i;
|
||||
|
||||
|
@ -475,19 +475,19 @@ gimp_query_database (gchar *name_regexp,
|
|||
}
|
||||
|
||||
gboolean
|
||||
gimp_query_procedure (gchar *proc_name,
|
||||
gchar **proc_blurb,
|
||||
gchar **proc_help,
|
||||
gchar **proc_author,
|
||||
gchar **proc_copyright,
|
||||
gchar **proc_date,
|
||||
gint *proc_type,
|
||||
gint *nparams,
|
||||
gint *nreturn_vals,
|
||||
GParamDef **params,
|
||||
GParamDef **return_vals)
|
||||
gimp_query_procedure (gchar *proc_name,
|
||||
gchar **proc_blurb,
|
||||
gchar **proc_help,
|
||||
gchar **proc_author,
|
||||
gchar **proc_copyright,
|
||||
gchar **proc_date,
|
||||
gint *proc_type,
|
||||
gint *nparams,
|
||||
gint *nreturn_vals,
|
||||
GimpParamDef **params,
|
||||
GimpParamDef **return_vals)
|
||||
{
|
||||
GParam *ret_vals;
|
||||
GimpParam *ret_vals;
|
||||
gint nret_vals;
|
||||
gint i;
|
||||
gboolean success = TRUE;
|
||||
|
@ -499,20 +499,20 @@ gimp_query_procedure (gchar *proc_name,
|
|||
|
||||
if (ret_vals[0].data.d_status == STATUS_SUCCESS)
|
||||
{
|
||||
*proc_blurb = g_strdup (ret_vals[1].data.d_string);
|
||||
*proc_help = g_strdup (ret_vals[2].data.d_string);
|
||||
*proc_author = g_strdup (ret_vals[3].data.d_string);
|
||||
*proc_blurb = g_strdup (ret_vals[1].data.d_string);
|
||||
*proc_help = g_strdup (ret_vals[2].data.d_string);
|
||||
*proc_author = g_strdup (ret_vals[3].data.d_string);
|
||||
*proc_copyright = g_strdup (ret_vals[4].data.d_string);
|
||||
*proc_date = g_strdup (ret_vals[5].data.d_string);
|
||||
*proc_type = ret_vals[6].data.d_int32;
|
||||
*nparams = ret_vals[7].data.d_int32;
|
||||
*nreturn_vals = ret_vals[8].data.d_int32;
|
||||
*params = g_new (GParamDef, *nparams);
|
||||
*return_vals = g_new (GParamDef, *nreturn_vals);
|
||||
*proc_date = g_strdup (ret_vals[5].data.d_string);
|
||||
*proc_type = ret_vals[6].data.d_int32;
|
||||
*nparams = ret_vals[7].data.d_int32;
|
||||
*nreturn_vals = ret_vals[8].data.d_int32;
|
||||
*params = g_new (GimpParamDef, *nparams);
|
||||
*return_vals = g_new (GimpParamDef, *nreturn_vals);
|
||||
|
||||
for (i = 0; i < *nparams; i++)
|
||||
{
|
||||
GParam *rvals;
|
||||
GimpParam *rvals;
|
||||
gint nrvals;
|
||||
|
||||
rvals = gimp_run_procedure ("gimp_procedural_db_proc_arg",
|
||||
|
@ -523,9 +523,9 @@ gimp_query_procedure (gchar *proc_name,
|
|||
|
||||
if (rvals[0].data.d_status == STATUS_SUCCESS)
|
||||
{
|
||||
(*params)[i].type = rvals[1].data.d_int32;
|
||||
(*params)[i].name = g_strdup (rvals[2].data.d_string);
|
||||
(*params)[i].description = g_strdup (rvals[3].data.d_string);
|
||||
(* params) [i].type = rvals[1].data.d_int32;
|
||||
(* params) [i].name = g_strdup (rvals[2].data.d_string);
|
||||
(* params) [i].description = g_strdup (rvals[3].data.d_string);
|
||||
}
|
||||
else
|
||||
{
|
||||
|
@ -540,8 +540,8 @@ gimp_query_procedure (gchar *proc_name,
|
|||
|
||||
for (i = 0; i < *nreturn_vals; i++)
|
||||
{
|
||||
GParam *rvals;
|
||||
int nrvals;
|
||||
GimpParam *rvals;
|
||||
gint nrvals;
|
||||
|
||||
rvals = gimp_run_procedure ("gimp_procedural_db_proc_val",
|
||||
&nrvals,
|
||||
|
@ -551,9 +551,9 @@ gimp_query_procedure (gchar *proc_name,
|
|||
|
||||
if (rvals[0].data.d_status == STATUS_SUCCESS)
|
||||
{
|
||||
(*return_vals)[i].type = rvals[1].data.d_int32;
|
||||
(*return_vals)[i].name = g_strdup (rvals[2].data.d_string);
|
||||
(*return_vals)[i].description = g_strdup (rvals[3].data.d_string);
|
||||
(* return_vals)[i].type = rvals[1].data.d_int32;
|
||||
(* return_vals)[i].name = g_strdup (rvals[2].data.d_string);
|
||||
(* return_vals)[i].description = g_strdup (rvals[3].data.d_string);
|
||||
}
|
||||
else
|
||||
{
|
||||
|
@ -574,10 +574,10 @@ gimp_query_procedure (gchar *proc_name,
|
|||
return success;
|
||||
}
|
||||
|
||||
gint32*
|
||||
gint32 *
|
||||
gimp_query_images (gint *nimages)
|
||||
{
|
||||
GParam *return_vals;
|
||||
GimpParam *return_vals;
|
||||
gint nreturn_vals;
|
||||
gint32 *images;
|
||||
|
||||
|
@ -599,59 +599,64 @@ gimp_query_images (gint *nimages)
|
|||
}
|
||||
|
||||
void
|
||||
gimp_install_procedure (gchar *name,
|
||||
gchar *blurb,
|
||||
gchar *help,
|
||||
gchar *author,
|
||||
gchar *copyright,
|
||||
gchar *date,
|
||||
gchar *menu_path,
|
||||
gchar *image_types,
|
||||
gint type,
|
||||
gint nparams,
|
||||
gint nreturn_vals,
|
||||
GParamDef *params,
|
||||
GParamDef *return_vals)
|
||||
gimp_install_procedure (gchar *name,
|
||||
gchar *blurb,
|
||||
gchar *help,
|
||||
gchar *author,
|
||||
gchar *copyright,
|
||||
gchar *date,
|
||||
gchar *menu_path,
|
||||
gchar *image_types,
|
||||
gint type,
|
||||
gint nparams,
|
||||
gint nreturn_vals,
|
||||
GimpParamDef *params,
|
||||
GimpParamDef *return_vals)
|
||||
{
|
||||
GPProcInstall proc_install;
|
||||
|
||||
proc_install.name = name;
|
||||
proc_install.blurb = blurb;
|
||||
proc_install.help = help;
|
||||
proc_install.author = author;
|
||||
proc_install.copyright = copyright;
|
||||
proc_install.date = date;
|
||||
proc_install.menu_path = menu_path;
|
||||
proc_install.image_types = image_types;
|
||||
proc_install.type = type;
|
||||
proc_install.nparams = nparams;
|
||||
proc_install.name = name;
|
||||
proc_install.blurb = blurb;
|
||||
proc_install.help = help;
|
||||
proc_install.author = author;
|
||||
proc_install.copyright = copyright;
|
||||
proc_install.date = date;
|
||||
proc_install.menu_path = menu_path;
|
||||
proc_install.image_types = image_types;
|
||||
proc_install.type = type;
|
||||
proc_install.nparams = nparams;
|
||||
proc_install.nreturn_vals = nreturn_vals;
|
||||
proc_install.params = (GPParamDef*) params;
|
||||
proc_install.return_vals = (GPParamDef*) return_vals;
|
||||
proc_install.params = (GPParamDef *) params;
|
||||
proc_install.return_vals = (GPParamDef *) return_vals;
|
||||
|
||||
if (!gp_proc_install_write (_writechannel, &proc_install))
|
||||
gimp_quit ();
|
||||
}
|
||||
|
||||
void
|
||||
gimp_install_temp_proc (gchar *name,
|
||||
gchar *blurb,
|
||||
gchar *help,
|
||||
gchar *author,
|
||||
gchar *copyright,
|
||||
gchar *date,
|
||||
gchar *menu_path,
|
||||
gchar *image_types,
|
||||
gint type,
|
||||
gint nparams,
|
||||
gint nreturn_vals,
|
||||
GParamDef *params,
|
||||
GParamDef *return_vals,
|
||||
GRunProc run_proc)
|
||||
gimp_install_temp_proc (gchar *name,
|
||||
gchar *blurb,
|
||||
gchar *help,
|
||||
gchar *author,
|
||||
gchar *copyright,
|
||||
gchar *date,
|
||||
gchar *menu_path,
|
||||
gchar *image_types,
|
||||
gint type,
|
||||
gint nparams,
|
||||
gint nreturn_vals,
|
||||
GimpParamDef *params,
|
||||
GimpParamDef *return_vals,
|
||||
GimpRunProc run_proc)
|
||||
{
|
||||
gimp_install_procedure (name, blurb, help, author, copyright, date,
|
||||
menu_path, image_types, type,
|
||||
nparams, nreturn_vals, params, return_vals);
|
||||
gimp_install_procedure (name,
|
||||
blurb, help,
|
||||
author, copyright, date,
|
||||
menu_path,
|
||||
image_types,
|
||||
type,
|
||||
nparams, nreturn_vals,
|
||||
params, return_vals);
|
||||
|
||||
/* Insert the temp proc run function into the hash table */
|
||||
g_hash_table_insert (temp_proc_ht, g_strdup (name), (gpointer) run_proc);
|
||||
|
@ -670,10 +675,10 @@ gimp_uninstall_temp_proc (gchar *name)
|
|||
|
||||
found = g_hash_table_lookup_extended (temp_proc_ht, name, &hash_name, NULL);
|
||||
if (found)
|
||||
{
|
||||
g_free (hash_name);
|
||||
g_hash_table_remove (temp_proc_ht, (gpointer) name);
|
||||
}
|
||||
{
|
||||
g_free (hash_name);
|
||||
g_hash_table_remove (temp_proc_ht, (gpointer) name);
|
||||
}
|
||||
}
|
||||
|
||||
void
|
||||
|
@ -682,7 +687,7 @@ gimp_register_magic_load_handler (gchar *name,
|
|||
gchar *prefixes,
|
||||
gchar *magics)
|
||||
{
|
||||
GParam *return_vals;
|
||||
GimpParam *return_vals;
|
||||
gint nreturn_vals;
|
||||
|
||||
return_vals = gimp_run_procedure ("gimp_register_magic_load_handler",
|
||||
|
@ -701,7 +706,7 @@ gimp_register_load_handler (gchar *name,
|
|||
gchar *extensions,
|
||||
gchar *prefixes)
|
||||
{
|
||||
GParam *return_vals;
|
||||
GimpParam *return_vals;
|
||||
gint nreturn_vals;
|
||||
|
||||
return_vals = gimp_run_procedure ("gimp_register_load_handler",
|
||||
|
@ -719,7 +724,7 @@ gimp_register_save_handler (gchar *name,
|
|||
gchar *extensions,
|
||||
gchar *prefixes)
|
||||
{
|
||||
GParam *return_vals;
|
||||
GimpParam *return_vals;
|
||||
gint nreturn_vals;
|
||||
|
||||
return_vals = gimp_run_procedure ("gimp_register_save_handler",
|
||||
|
@ -732,26 +737,26 @@ gimp_register_save_handler (gchar *name,
|
|||
gimp_destroy_params (return_vals, nreturn_vals);
|
||||
}
|
||||
|
||||
GParam*
|
||||
GimpParam *
|
||||
gimp_run_procedure (gchar *name,
|
||||
gint *nreturn_vals,
|
||||
...)
|
||||
{
|
||||
GPProcRun proc_run;
|
||||
GPProcReturn *proc_return;
|
||||
WireMessage msg;
|
||||
GParamType param_type;
|
||||
GParam *return_vals;
|
||||
va_list args;
|
||||
guchar *color;
|
||||
gint i;
|
||||
GPProcRun proc_run;
|
||||
GPProcReturn *proc_return;
|
||||
WireMessage msg;
|
||||
GimpPDBArgType param_type;
|
||||
GimpParam *return_vals;
|
||||
va_list args;
|
||||
guchar *color;
|
||||
gint i;
|
||||
|
||||
proc_run.name = name;
|
||||
proc_run.nparams = 0;
|
||||
proc_run.params = NULL;
|
||||
|
||||
va_start (args, nreturn_vals);
|
||||
param_type = va_arg (args, GParamType);
|
||||
param_type = va_arg (args, GimpPDBArgType);
|
||||
|
||||
while (param_type != PARAM_END)
|
||||
{
|
||||
|
@ -767,40 +772,40 @@ gimp_run_procedure (gchar *name,
|
|||
case PARAM_BOUNDARY:
|
||||
case PARAM_PATH:
|
||||
case PARAM_STATUS:
|
||||
(void) va_arg (args, int);
|
||||
(void) va_arg (args, gint);
|
||||
break;
|
||||
case PARAM_INT16:
|
||||
(void) va_arg (args, int);
|
||||
(void) va_arg (args, gint);
|
||||
break;
|
||||
case PARAM_INT8:
|
||||
(void) va_arg (args, int);
|
||||
(void) va_arg (args, gint);
|
||||
break;
|
||||
case PARAM_FLOAT:
|
||||
(void) va_arg (args, double);
|
||||
(void) va_arg (args, gdouble);
|
||||
break;
|
||||
case PARAM_STRING:
|
||||
(void) va_arg (args, gchar*);
|
||||
(void) va_arg (args, gchar *);
|
||||
break;
|
||||
case PARAM_INT32ARRAY:
|
||||
(void) va_arg (args, gint32*);
|
||||
(void) va_arg (args, gint32 *);
|
||||
break;
|
||||
case PARAM_INT16ARRAY:
|
||||
(void) va_arg (args, gint16*);
|
||||
(void) va_arg (args, gint16 *);
|
||||
break;
|
||||
case PARAM_INT8ARRAY:
|
||||
(void) va_arg (args, gint8*);
|
||||
(void) va_arg (args, gint8 *);
|
||||
break;
|
||||
case PARAM_FLOATARRAY:
|
||||
(void) va_arg (args, gdouble*);
|
||||
(void) va_arg (args, gdouble *);
|
||||
break;
|
||||
case PARAM_STRINGARRAY:
|
||||
(void) va_arg (args, gchar**);
|
||||
(void) va_arg (args, gchar **);
|
||||
break;
|
||||
case PARAM_COLOR:
|
||||
(void) va_arg (args, guchar*);
|
||||
(void) va_arg (args, guchar *);
|
||||
break;
|
||||
case PARAM_PARASITE:
|
||||
(void) va_arg (args, GimpParasite*);
|
||||
(void) va_arg (args, GimpParasite *);
|
||||
break;
|
||||
case PARAM_REGION:
|
||||
break;
|
||||
|
@ -809,7 +814,7 @@ gimp_run_procedure (gchar *name,
|
|||
}
|
||||
|
||||
proc_run.nparams += 1;
|
||||
param_type = va_arg (args, GParamType);
|
||||
param_type = va_arg (args, GimpPDBArgType);
|
||||
}
|
||||
|
||||
va_end (args);
|
||||
|
@ -820,45 +825,45 @@ gimp_run_procedure (gchar *name,
|
|||
|
||||
for (i = 0; i < proc_run.nparams; i++)
|
||||
{
|
||||
proc_run.params[i].type = va_arg (args, GParamType);
|
||||
proc_run.params[i].type = va_arg (args, GimpPDBArgType);
|
||||
|
||||
switch (proc_run.params[i].type)
|
||||
{
|
||||
case PARAM_INT32:
|
||||
proc_run.params[i].data.d_int32 = (gint32) va_arg (args, int);
|
||||
proc_run.params[i].data.d_int32 = (gint32) va_arg (args, gint);
|
||||
break;
|
||||
case PARAM_INT16:
|
||||
proc_run.params[i].data.d_int16 = (gint16) va_arg (args, int);
|
||||
proc_run.params[i].data.d_int16 = (gint16) va_arg (args, gint);
|
||||
break;
|
||||
case PARAM_INT8:
|
||||
proc_run.params[i].data.d_int8 = (gint8) va_arg (args, int);
|
||||
proc_run.params[i].data.d_int8 = (gint8) va_arg (args, gint);
|
||||
break;
|
||||
case PARAM_FLOAT:
|
||||
proc_run.params[i].data.d_float = (gdouble) va_arg (args, double);
|
||||
proc_run.params[i].data.d_float = (gdouble) va_arg (args, gdouble);
|
||||
break;
|
||||
case PARAM_STRING:
|
||||
proc_run.params[i].data.d_string = va_arg (args, gchar*);
|
||||
proc_run.params[i].data.d_string = va_arg (args, gchar *);
|
||||
break;
|
||||
case PARAM_INT32ARRAY:
|
||||
proc_run.params[i].data.d_int32array = va_arg (args, gint32*);
|
||||
proc_run.params[i].data.d_int32array = va_arg (args, gint32 *);
|
||||
break;
|
||||
case PARAM_INT16ARRAY:
|
||||
proc_run.params[i].data.d_int16array = va_arg (args, gint16*);
|
||||
proc_run.params[i].data.d_int16array = va_arg (args, gint16 *);
|
||||
break;
|
||||
case PARAM_INT8ARRAY:
|
||||
proc_run.params[i].data.d_int8array = va_arg (args, gint8*);
|
||||
proc_run.params[i].data.d_int8array = va_arg (args, gint8 *);
|
||||
break;
|
||||
case PARAM_FLOATARRAY:
|
||||
proc_run.params[i].data.d_floatarray = va_arg (args, gdouble*);
|
||||
proc_run.params[i].data.d_floatarray = va_arg (args, gdouble *);
|
||||
break;
|
||||
case PARAM_STRINGARRAY:
|
||||
proc_run.params[i].data.d_stringarray = va_arg (args, gchar**);
|
||||
proc_run.params[i].data.d_stringarray = va_arg (args, gchar **);
|
||||
break;
|
||||
case PARAM_COLOR:
|
||||
color = va_arg (args, guchar*);
|
||||
proc_run.params[i].data.d_color.red = color[0];
|
||||
color = va_arg (args, guchar *);
|
||||
proc_run.params[i].data.d_color.red = color[0];
|
||||
proc_run.params[i].data.d_color.green = color[1];
|
||||
proc_run.params[i].data.d_color.blue = color[2];
|
||||
proc_run.params[i].data.d_color.blue = color[2];
|
||||
break;
|
||||
case PARAM_REGION:
|
||||
break;
|
||||
|
@ -888,18 +893,19 @@ gimp_run_procedure (gchar *name,
|
|||
break;
|
||||
case PARAM_PARASITE:
|
||||
{
|
||||
GimpParasite *p = va_arg (args, GimpParasite*);
|
||||
if (p == NULL)
|
||||
GimpParasite *parasite = va_arg (args, GimpParasite *);
|
||||
|
||||
if (parasite == NULL)
|
||||
{
|
||||
proc_run.params[i].data.d_parasite.name = NULL;
|
||||
proc_run.params[i].data.d_parasite.data = NULL;
|
||||
}
|
||||
else
|
||||
{
|
||||
proc_run.params[i].data.d_parasite.name = p->name;
|
||||
proc_run.params[i].data.d_parasite.flags = p->flags;
|
||||
proc_run.params[i].data.d_parasite.size = p->size;
|
||||
proc_run.params[i].data.d_parasite.data = p->data;
|
||||
proc_run.params[i].data.d_parasite.name = parasite->name;
|
||||
proc_run.params[i].data.d_parasite.flags = parasite->flags;
|
||||
proc_run.params[i].data.d_parasite.size = parasite->size;
|
||||
proc_run.params[i].data.d_parasite.data = parasite->data;
|
||||
}
|
||||
}
|
||||
break;
|
||||
|
@ -920,7 +926,7 @@ gimp_run_procedure (gchar *name,
|
|||
|
||||
proc_return = msg.data;
|
||||
*nreturn_vals = proc_return->nparams;
|
||||
return_vals = (GParam*) proc_return->params;
|
||||
return_vals = (GimpParam*) proc_return->params;
|
||||
|
||||
switch (return_vals[0].data.d_status)
|
||||
{
|
||||
|
@ -966,20 +972,20 @@ gimp_read_expect_msg (WireMessage *msg,
|
|||
}
|
||||
|
||||
|
||||
GParam*
|
||||
gimp_run_procedure2 (gchar *name,
|
||||
gint *nreturn_vals,
|
||||
gint nparams,
|
||||
GParam *params)
|
||||
GimpParam *
|
||||
gimp_run_procedure2 (gchar *name,
|
||||
gint *nreturn_vals,
|
||||
gint nparams,
|
||||
GimpParam *params)
|
||||
{
|
||||
GPProcRun proc_run;
|
||||
GPProcRun proc_run;
|
||||
GPProcReturn *proc_return;
|
||||
WireMessage msg;
|
||||
GParam *return_vals;
|
||||
WireMessage msg;
|
||||
GimpParam *return_vals;
|
||||
|
||||
proc_run.name = name;
|
||||
proc_run.name = name;
|
||||
proc_run.nparams = nparams;
|
||||
proc_run.params = (GPParam *) params;
|
||||
proc_run.params = (GPParam *) params;
|
||||
|
||||
if (!gp_proc_run_write (_writechannel, &proc_run))
|
||||
gimp_quit ();
|
||||
|
@ -988,7 +994,7 @@ gimp_run_procedure2 (gchar *name,
|
|||
|
||||
proc_return = msg.data;
|
||||
*nreturn_vals = proc_return->nparams;
|
||||
return_vals = (GParam*) proc_return->params;
|
||||
return_vals = (GimpParam *) proc_return->params;
|
||||
|
||||
switch (return_vals[0].data.d_status)
|
||||
{
|
||||
|
@ -1009,8 +1015,8 @@ gimp_run_procedure2 (gchar *name,
|
|||
}
|
||||
|
||||
void
|
||||
gimp_destroy_params (GParam *params,
|
||||
gint nparams)
|
||||
gimp_destroy_params (GimpParam *params,
|
||||
gint nparams)
|
||||
{
|
||||
extern void _gp_params_destroy (GPParam *params, gint nparams);
|
||||
|
||||
|
@ -1018,15 +1024,15 @@ gimp_destroy_params (GParam *params,
|
|||
}
|
||||
|
||||
void
|
||||
gimp_destroy_paramdefs (GParamDef *paramdefs,
|
||||
gint nparams)
|
||||
gimp_destroy_paramdefs (GimpParamDef *paramdefs,
|
||||
gint nparams)
|
||||
{
|
||||
while (nparams--)
|
||||
{
|
||||
g_free (paramdefs[nparams].name);
|
||||
g_free (paramdefs[nparams].description);
|
||||
}
|
||||
|
||||
|
||||
g_free (paramdefs);
|
||||
}
|
||||
|
||||
|
@ -1113,8 +1119,8 @@ gimp_extension_process (guint timeout)
|
|||
{
|
||||
#ifndef G_OS_WIN32
|
||||
fd_set readfds;
|
||||
gint select_val;
|
||||
struct timeval tv;
|
||||
gint select_val;
|
||||
struct timeval tv;
|
||||
struct timeval *tvp;
|
||||
|
||||
if (timeout)
|
||||
|
@ -1131,7 +1137,7 @@ gimp_extension_process (guint timeout)
|
|||
|
||||
if ((select_val = select (FD_SETSIZE, &readfds, NULL, NULL, tvp)) > 0)
|
||||
{
|
||||
gimp_single_message();
|
||||
gimp_single_message ();
|
||||
}
|
||||
else if (select_val == -1)
|
||||
{
|
||||
|
@ -1168,7 +1174,7 @@ gimp_extension_ack (void)
|
|||
void
|
||||
gimp_run_temp (void)
|
||||
{
|
||||
gimp_single_message();
|
||||
gimp_single_message ();
|
||||
}
|
||||
|
||||
void
|
||||
|
@ -1246,7 +1252,7 @@ gimp_plugin_io_error_handler (GIOChannel *channel,
|
|||
return TRUE;
|
||||
}
|
||||
|
||||
static int
|
||||
static gboolean
|
||||
gimp_write (GIOChannel *channel,
|
||||
guint8 *buf,
|
||||
gulong count)
|
||||
|
@ -1277,7 +1283,7 @@ gimp_write (GIOChannel *channel,
|
|||
return TRUE;
|
||||
}
|
||||
|
||||
static int
|
||||
static gboolean
|
||||
gimp_flush (GIOChannel *channel)
|
||||
{
|
||||
GIOError error;
|
||||
|
@ -1289,12 +1295,14 @@ gimp_flush (GIOChannel *channel)
|
|||
count = 0;
|
||||
while (count != write_buffer_index)
|
||||
{
|
||||
do {
|
||||
bytes = 0;
|
||||
error = g_io_channel_write (channel, &write_buffer[count],
|
||||
(write_buffer_index - count),
|
||||
&bytes);
|
||||
} while (error == G_IO_ERROR_AGAIN);
|
||||
do
|
||||
{
|
||||
bytes = 0;
|
||||
error = g_io_channel_write (channel, &write_buffer[count],
|
||||
(write_buffer_index - count),
|
||||
&bytes);
|
||||
}
|
||||
while (error == G_IO_ERROR_AGAIN);
|
||||
|
||||
if (error != G_IO_ERROR_NONE)
|
||||
return FALSE;
|
||||
|
@ -1400,7 +1408,7 @@ gimp_config (GPConfig *config)
|
|||
* transfering tile data
|
||||
*/
|
||||
gchar fileMapName[128];
|
||||
gint tileByteSize = _gimp_tile_width * _gimp_tile_height * 4;
|
||||
gint tileByteSize = _gimp_tile_width * _gimp_tile_height * 4;
|
||||
|
||||
/* From the id, derive the file map name */
|
||||
g_snprintf (fileMapName, sizeof (fileMapName), "GIMP%d.SHM", _shm_ID);
|
||||
|
@ -1442,14 +1450,14 @@ static void
|
|||
gimp_proc_run (GPProcRun *proc_run)
|
||||
{
|
||||
GPProcReturn proc_return;
|
||||
GParam *return_vals;
|
||||
GimpParam *return_vals;
|
||||
gint nreturn_vals;
|
||||
|
||||
if (PLUG_IN_INFO.run_proc)
|
||||
{
|
||||
(* PLUG_IN_INFO.run_proc) (proc_run->name,
|
||||
proc_run->nparams,
|
||||
(GParam*) proc_run->params,
|
||||
(GimpParam*) proc_run->params,
|
||||
&nreturn_vals,
|
||||
&return_vals);
|
||||
|
||||
|
@ -1465,17 +1473,18 @@ gimp_proc_run (GPProcRun *proc_run)
|
|||
static void
|
||||
gimp_temp_proc_run (GPProcRun *proc_run)
|
||||
{
|
||||
GParam *return_vals;
|
||||
gint nreturn_vals;
|
||||
GRunProc run_proc;
|
||||
GimpParam *return_vals;
|
||||
gint nreturn_vals;
|
||||
GimpRunProc run_proc;
|
||||
|
||||
run_proc = (GRunProc)g_hash_table_lookup (temp_proc_ht, (gpointer) proc_run->name);
|
||||
run_proc = (GimpRunProc)g_hash_table_lookup (temp_proc_ht,
|
||||
(gpointer) proc_run->name);
|
||||
|
||||
if (run_proc)
|
||||
{
|
||||
(* run_proc) (proc_run->name,
|
||||
proc_run->nparams,
|
||||
(GParam*) proc_run->params,
|
||||
(GimpParam*) proc_run->params,
|
||||
&nreturn_vals,
|
||||
&return_vals);
|
||||
|
||||
|
@ -1492,7 +1501,7 @@ gimp_temp_proc_run (GPProcRun *proc_run)
|
|||
void
|
||||
gimp_plugin_domain_add (gchar *domain_name)
|
||||
{
|
||||
GParam *return_vals;
|
||||
GimpParam *return_vals;
|
||||
gint nreturn_vals;
|
||||
|
||||
return_vals = gimp_run_procedure ("gimp_plugin_domain_add",
|
||||
|
@ -1508,7 +1517,7 @@ void
|
|||
gimp_plugin_domain_add_with_path (gchar *domain_name,
|
||||
gchar *domain_path)
|
||||
{
|
||||
GParam *return_vals;
|
||||
GimpParam *return_vals;
|
||||
gint nreturn_vals;
|
||||
|
||||
return_vals = gimp_run_procedure ("gimp_plugin_domain_add",
|
||||
|
|
816
libgimp/gimp.h
816
libgimp/gimp.h
|
@ -23,16 +23,32 @@
|
|||
#include <glib.h>
|
||||
|
||||
#include <libgimp/gimpenums.h>
|
||||
#include <libgimp/gimptypes.h>
|
||||
|
||||
#include <libgimp/gimpcolorspace.h>
|
||||
#include <libgimp/gimpfeatures.h>
|
||||
#include <libgimp/gimpenv.h>
|
||||
#include <libgimp/gimplimits.h>
|
||||
#include <libgimp/gimpmath.h>
|
||||
#include <libgimp/gimpparasite.h>
|
||||
#include <libgimp/gimppixelrgn.h>
|
||||
#include <libgimp/gimptile.h>
|
||||
#include <libgimp/gimpunit.h>
|
||||
#include <libgimp/gimputils.h>
|
||||
#include <libgimp/gimpvector.h>
|
||||
|
||||
#include <libgimp/gimpchannel_pdb.h>
|
||||
#include <libgimp/gimpdisplay_pdb.h>
|
||||
#include <libgimp/gimpdrawable_pdb.h>
|
||||
#include <libgimp/gimpgradient_pdb.h>
|
||||
#include <libgimp/gimphelp_pdb.h>
|
||||
#include <libgimp/gimpimage_pdb.h>
|
||||
#include <libgimp/gimplayer_pdb.h>
|
||||
#include <libgimp/gimppalette_pdb.h>
|
||||
#include <libgimp/gimpparasite_pdb.h>
|
||||
#include <libgimp/gimpselection_pdb.h>
|
||||
#include <libgimp/gimpunit_pdb.h>
|
||||
|
||||
#include <libgimp/gimpcompat.h> /* to be removed in 1.3 */
|
||||
|
||||
#ifdef G_OS_WIN32
|
||||
|
@ -54,97 +70,54 @@ extern "C" {
|
|||
GIMPVAR guint gimp_major_version;
|
||||
GIMPVAR guint gimp_minor_version;
|
||||
GIMPVAR guint gimp_micro_version;
|
||||
|
||||
GIMPVAR GIOChannel *_readchannel;
|
||||
|
||||
typedef struct _GPlugInInfo GPlugInInfo;
|
||||
typedef struct _GTile GTile;
|
||||
typedef struct _GDrawable GDrawable;
|
||||
typedef struct _GPixelRgn GPixelRgn;
|
||||
typedef struct _GParamDef GParamDef;
|
||||
typedef struct _GParamColor GParamColor;
|
||||
typedef struct _GParamRegion GParamRegion;
|
||||
typedef union _GParamData GParamData;
|
||||
typedef struct _GParam GParam;
|
||||
typedef void (* GRunProc) (gchar *name,
|
||||
gint nparams,
|
||||
GParam *param,
|
||||
gint *nreturn_vals,
|
||||
GParam **return_vals);
|
||||
typedef void (* GimpInitProc) (void);
|
||||
typedef void (* GimpQuitProc) (void);
|
||||
typedef void (* GimpQueryProc) (void);
|
||||
typedef void (* GimpRunProc) (gchar *name,
|
||||
gint nparams,
|
||||
GimpParam *param,
|
||||
gint *nreturn_vals,
|
||||
GimpParam **return_vals);
|
||||
|
||||
|
||||
struct _GPlugInInfo
|
||||
struct _GimpPlugInInfo
|
||||
{
|
||||
/* called when the gimp application initially starts up */
|
||||
void (* init_proc) (void);
|
||||
GimpInitProc init_proc;
|
||||
|
||||
/* called when the gimp application exits */
|
||||
void (* quit_proc) (void);
|
||||
GimpQuitProc quit_proc;
|
||||
|
||||
/* called by the gimp so that the plug-in can inform the
|
||||
* gimp of what it does. (ie. installing a procedure database
|
||||
* procedure).
|
||||
*/
|
||||
void (* query_proc) (void);
|
||||
GimpQueryProc query_proc;
|
||||
|
||||
/* called to run a procedure the plug-in installed in the
|
||||
* procedure database.
|
||||
*/
|
||||
GRunProc run_proc;
|
||||
GimpRunProc run_proc;
|
||||
};
|
||||
|
||||
struct _GTile
|
||||
struct _GimpParamDef
|
||||
{
|
||||
guint ewidth; /* the effective width of the tile */
|
||||
guint eheight; /* the effective height of the tile */
|
||||
guint bpp; /* the bytes per pixel (1, 2, 3 or 4 ) */
|
||||
guint tile_num; /* the number of this tile within the drawable */
|
||||
guint16 ref_count; /* reference count for the tile */
|
||||
guint dirty : 1; /* is the tile dirty? has it been modified? */
|
||||
guint shadow: 1; /* is this a shadow tile */
|
||||
guchar *data; /* the pixel data for the tile */
|
||||
GDrawable *drawable; /* the drawable this tile came from */
|
||||
GimpPDBArgType type;
|
||||
gchar *name;
|
||||
gchar *description;
|
||||
};
|
||||
|
||||
struct _GDrawable
|
||||
{
|
||||
gint32 id; /* drawable ID */
|
||||
guint width; /* width of drawble */
|
||||
guint height; /* height of drawble */
|
||||
guint bpp; /* bytes per pixel of drawable */
|
||||
guint ntile_rows; /* # of tile rows */
|
||||
guint ntile_cols; /* # of tile columns */
|
||||
GTile *tiles; /* the normal tiles */
|
||||
GTile *shadow_tiles; /* the shadow tiles */
|
||||
};
|
||||
|
||||
struct _GPixelRgn
|
||||
{
|
||||
guchar *data; /* pointer to region data */
|
||||
GDrawable *drawable; /* pointer to drawable */
|
||||
guint bpp; /* bytes per pixel */
|
||||
guint rowstride; /* bytes per pixel row */
|
||||
guint x, y; /* origin */
|
||||
guint w, h; /* width and height of region */
|
||||
guint dirty : 1; /* will this region be dirtied? */
|
||||
guint shadow : 1; /* will this region use the shadow or normal tiles */
|
||||
guint process_count; /* used internally */
|
||||
};
|
||||
|
||||
struct _GParamDef
|
||||
{
|
||||
GParamType type;
|
||||
gchar *name;
|
||||
gchar *description;
|
||||
};
|
||||
|
||||
struct _GParamColor
|
||||
struct _GimpParamColor
|
||||
{
|
||||
guint8 red;
|
||||
guint8 green;
|
||||
guint8 blue;
|
||||
};
|
||||
|
||||
struct _GParamRegion
|
||||
struct _GimpParamRegion
|
||||
{
|
||||
gint32 x;
|
||||
gint32 y;
|
||||
|
@ -152,36 +125,36 @@ struct _GParamRegion
|
|||
gint32 height;
|
||||
};
|
||||
|
||||
union _GParamData
|
||||
union _GimpParamData
|
||||
{
|
||||
gint32 d_int32;
|
||||
gint16 d_int16;
|
||||
gint8 d_int8;
|
||||
gdouble d_float;
|
||||
gchar *d_string;
|
||||
gint32 *d_int32array;
|
||||
gint16 *d_int16array;
|
||||
gint8 *d_int8array;
|
||||
gdouble *d_floatarray;
|
||||
gchar **d_stringarray;
|
||||
GParamColor d_color;
|
||||
GParamRegion d_region;
|
||||
gint32 d_display;
|
||||
gint32 d_image;
|
||||
gint32 d_layer;
|
||||
gint32 d_channel;
|
||||
gint32 d_drawable;
|
||||
gint32 d_selection;
|
||||
gint32 d_boundary;
|
||||
gint32 d_path;
|
||||
GimpParasite d_parasite;
|
||||
gint32 d_status;
|
||||
gint32 d_int32;
|
||||
gint16 d_int16;
|
||||
gint8 d_int8;
|
||||
gdouble d_float;
|
||||
gchar *d_string;
|
||||
gint32 *d_int32array;
|
||||
gint16 *d_int16array;
|
||||
gint8 *d_int8array;
|
||||
gdouble *d_floatarray;
|
||||
gchar **d_stringarray;
|
||||
GimpParamColor d_color;
|
||||
GimpParamRegion d_region;
|
||||
gint32 d_display;
|
||||
gint32 d_image;
|
||||
gint32 d_layer;
|
||||
gint32 d_channel;
|
||||
gint32 d_drawable;
|
||||
gint32 d_selection;
|
||||
gint32 d_boundary;
|
||||
gint32 d_path;
|
||||
GimpParasite d_parasite;
|
||||
gint32 d_status;
|
||||
};
|
||||
|
||||
struct _GParam
|
||||
struct _GimpParam
|
||||
{
|
||||
GParamType type;
|
||||
GParamData data;
|
||||
GimpPDBArgType type;
|
||||
GimpParamData data;
|
||||
};
|
||||
|
||||
|
||||
|
@ -200,7 +173,7 @@ struct _GParam
|
|||
static int \
|
||||
win32_gimp_main (int argc, char **argv) \
|
||||
{ \
|
||||
extern void set_gimp_PLUG_IN_INFO_PTR(GPlugInInfo *); \
|
||||
extern void set_gimp_PLUG_IN_INFO_PTR(GimpPlugInInfo *); \
|
||||
set_gimp_PLUG_IN_INFO_PTR(&PLUG_IN_INFO); \
|
||||
return gimp_main (argc, argv); \
|
||||
} \
|
||||
|
@ -243,670 +216,203 @@ struct _GParam
|
|||
/* The main procedure that should be called with the
|
||||
* 'argc' and 'argv' that are passed to "main".
|
||||
*/
|
||||
gint gimp_main (gint argc,
|
||||
gchar *argv[]);
|
||||
gint gimp_main (gint argc,
|
||||
gchar *argv[]);
|
||||
|
||||
/* Forcefully causes the gimp library to exit and
|
||||
* close down its connection to main gimp application.
|
||||
*/
|
||||
void G_GNUC_NORETURN gimp_quit (void);
|
||||
void G_GNUC_NORETURN gimp_quit (void);
|
||||
|
||||
/* Specify a range of data to be associated with 'id'.
|
||||
* The data will exist for as long as the main gimp
|
||||
* application is running.
|
||||
*/
|
||||
void gimp_set_data (gchar *id,
|
||||
gpointer data,
|
||||
guint32 length);
|
||||
void gimp_set_data (gchar *id,
|
||||
gpointer data,
|
||||
guint32 length);
|
||||
|
||||
/* Retrieve the piece of data stored within the main
|
||||
* gimp application specified by 'id'. The data is
|
||||
* stored in the supplied buffer. Make sure enough
|
||||
* space is allocated.
|
||||
*/
|
||||
void gimp_get_data (gchar *id,
|
||||
gpointer data);
|
||||
void gimp_get_data (gchar *id,
|
||||
gpointer data);
|
||||
|
||||
/* Get the size in bytes of the data stored by a gimp_get_data
|
||||
* id. As size of zero may indicate that there is no such
|
||||
* identifier in the database.
|
||||
*/
|
||||
guint32 gimp_get_data_size (gchar *id);
|
||||
guint32 gimp_get_data_size (gchar *id);
|
||||
|
||||
/* Initialize the progress bar with "message". If "message"
|
||||
* is NULL, the message displayed in the progress window will
|
||||
* be the name of the plug-in.
|
||||
*/
|
||||
void gimp_progress_init (gchar *message);
|
||||
void gimp_progress_init (gchar *message);
|
||||
|
||||
/* Update the progress bar. If the progress bar has not been
|
||||
* initialized then it will be automatically initialized as if
|
||||
* "gimp_progress_init (NULL)" were called. "percentage" is a
|
||||
* value between 0 and 1.
|
||||
*/
|
||||
void gimp_progress_update (gdouble percentage);
|
||||
void gimp_progress_update (gdouble percentage);
|
||||
|
||||
/* Returns the default gdisplay (given at plug-in config time).
|
||||
*/
|
||||
gint32 gimp_default_display (void);
|
||||
gint32 gimp_default_display (void);
|
||||
|
||||
|
||||
/* Pops up a dialog box with "message". Useful for status and
|
||||
* error reports. If "message" is NULL, do nothing.
|
||||
*/
|
||||
void gimp_message (const gchar *message);
|
||||
void gimp_message (const gchar *message);
|
||||
|
||||
|
||||
/* Query the gimp application's procedural database.
|
||||
* The arguments are regular expressions which select
|
||||
* which procedure names will be returned in 'proc_names'.
|
||||
*/
|
||||
void gimp_query_database (gchar *name_regexp,
|
||||
gchar *blurb_regexp,
|
||||
gchar *help_regexp,
|
||||
gchar *author_regexp,
|
||||
gchar *copyright_regexp,
|
||||
gchar *date_regexp,
|
||||
gchar *proc_type_regexp,
|
||||
gint *nprocs,
|
||||
gchar ***proc_names);
|
||||
void gimp_query_database (gchar *name_regexp,
|
||||
gchar *blurb_regexp,
|
||||
gchar *help_regexp,
|
||||
gchar *author_regexp,
|
||||
gchar *copyright_regexp,
|
||||
gchar *date_regexp,
|
||||
gchar *proc_type_regexp,
|
||||
gint *nprocs,
|
||||
gchar ***proc_names);
|
||||
|
||||
/* Query the gimp application's procedural database
|
||||
* regarding a particular procedure.
|
||||
*/
|
||||
gboolean gimp_query_procedure (gchar *proc_name,
|
||||
gchar **proc_blurb,
|
||||
gchar **proc_help,
|
||||
gchar **proc_author,
|
||||
gchar **proc_copyright,
|
||||
gchar **proc_date,
|
||||
gint *proc_type,
|
||||
gint *nparams,
|
||||
gint *nreturn_vals,
|
||||
GParamDef **params,
|
||||
GParamDef **return_vals);
|
||||
gboolean gimp_query_procedure (gchar *proc_name,
|
||||
gchar **proc_blurb,
|
||||
gchar **proc_help,
|
||||
gchar **proc_author,
|
||||
gchar **proc_copyright,
|
||||
gchar **proc_date,
|
||||
gint *proc_type,
|
||||
gint *nparams,
|
||||
gint *nreturn_vals,
|
||||
GimpParamDef **params,
|
||||
GimpParamDef **return_vals);
|
||||
|
||||
/* Query the gimp application regarding all open images.
|
||||
* The list of open image id's is returned in 'image_ids'.
|
||||
*/
|
||||
gint32 * gimp_query_images (gint *nimages);
|
||||
gint32 * gimp_query_images (gint *nimages);
|
||||
|
||||
|
||||
/* Install a procedure in the procedure database.
|
||||
*/
|
||||
void gimp_install_procedure (gchar *name,
|
||||
gchar *blurb,
|
||||
gchar *help,
|
||||
gchar *author,
|
||||
gchar *copyright,
|
||||
gchar *date,
|
||||
gchar *menu_path,
|
||||
gchar *image_types,
|
||||
gint type,
|
||||
gint nparams,
|
||||
gint nreturn_vals,
|
||||
GParamDef *params,
|
||||
GParamDef *return_vals);
|
||||
void gimp_install_procedure (gchar *name,
|
||||
gchar *blurb,
|
||||
gchar *help,
|
||||
gchar *author,
|
||||
gchar *copyright,
|
||||
gchar *date,
|
||||
gchar *menu_path,
|
||||
gchar *image_types,
|
||||
gint type,
|
||||
gint nparams,
|
||||
gint nreturn_vals,
|
||||
GimpParamDef *params,
|
||||
GimpParamDef *return_vals);
|
||||
|
||||
/* Install a temporary procedure in the procedure database.
|
||||
*/
|
||||
void gimp_install_temp_proc (gchar *name,
|
||||
gchar *blurb,
|
||||
gchar *help,
|
||||
gchar *author,
|
||||
gchar *copyright,
|
||||
gchar *date,
|
||||
gchar *menu_path,
|
||||
gchar *image_types,
|
||||
gint type,
|
||||
gint nparams,
|
||||
gint nreturn_vals,
|
||||
GParamDef *params,
|
||||
GParamDef *return_vals,
|
||||
GRunProc run_proc);
|
||||
void gimp_install_temp_proc (gchar *name,
|
||||
gchar *blurb,
|
||||
gchar *help,
|
||||
gchar *author,
|
||||
gchar *copyright,
|
||||
gchar *date,
|
||||
gchar *menu_path,
|
||||
gchar *image_types,
|
||||
gint type,
|
||||
gint nparams,
|
||||
gint nreturn_vals,
|
||||
GimpParamDef *params,
|
||||
GimpParamDef *return_vals,
|
||||
GimpRunProc run_proc);
|
||||
|
||||
/* Uninstall a temporary procedure
|
||||
*/
|
||||
void gimp_uninstall_temp_proc (gchar *name);
|
||||
void gimp_uninstall_temp_proc (gchar *name);
|
||||
|
||||
/* Install a load file format handler in the procedure database.
|
||||
*/
|
||||
void gimp_register_magic_load_handler (gchar *name,
|
||||
gchar *extensions,
|
||||
gchar *prefixes,
|
||||
gchar *magics);
|
||||
void gimp_register_magic_load_handler (gchar *name,
|
||||
gchar *extensions,
|
||||
gchar *prefixes,
|
||||
gchar *magics);
|
||||
|
||||
/* Install a load file format handler in the procedure database.
|
||||
*/
|
||||
void gimp_register_load_handler (gchar *name,
|
||||
gchar *extensions,
|
||||
gchar *prefixes);
|
||||
void gimp_register_load_handler (gchar *name,
|
||||
gchar *extensions,
|
||||
gchar *prefixes);
|
||||
|
||||
/* Install a save file format handler in the procedure database.
|
||||
*/
|
||||
void gimp_register_save_handler (gchar *name,
|
||||
gchar *extensions,
|
||||
gchar *prefixes);
|
||||
void gimp_register_save_handler (gchar *name,
|
||||
gchar *extensions,
|
||||
gchar *prefixes);
|
||||
|
||||
/* Run a procedure in the procedure database. The parameters are
|
||||
* specified via the variable length argument list. The return
|
||||
* values are returned in the 'GParam*' array.
|
||||
* values are returned in the 'GimpParam*' array.
|
||||
*/
|
||||
GParam * gimp_run_procedure (gchar *name,
|
||||
gint *nreturn_vals,
|
||||
...);
|
||||
GimpParam * gimp_run_procedure (gchar *name,
|
||||
gint *nreturn_vals,
|
||||
...);
|
||||
|
||||
/* Run a procedure in the procedure database. The parameters are
|
||||
* specified as an array of GParam. The return
|
||||
* values are returned in the 'GParam*' array.
|
||||
* specified as an array of GimpParam. The return
|
||||
* values are returned in the 'GimpParam*' array.
|
||||
*/
|
||||
GParam * gimp_run_procedure2 (gchar *name,
|
||||
gint *nreturn_vals,
|
||||
gint nparams,
|
||||
GParam *params);
|
||||
GimpParam * gimp_run_procedure2 (gchar *name,
|
||||
gint *nreturn_vals,
|
||||
gint nparams,
|
||||
GimpParam *params);
|
||||
|
||||
/* Destroy the an array of parameters. This is useful for
|
||||
* destroying the return values returned by a call to
|
||||
* 'gimp_run_procedure'.
|
||||
*/
|
||||
void gimp_destroy_params (GParam *params,
|
||||
gint nparams);
|
||||
void gimp_destroy_params (GimpParam *params,
|
||||
gint nparams);
|
||||
|
||||
/* Destroy the an array of GParamDef's. This is useful for
|
||||
/* Destroy the an array of GimpParamDef's. This is useful for
|
||||
* destroying the return values returned by a call to
|
||||
* 'gimp_query_procedure'.
|
||||
*/
|
||||
void gimp_destroy_paramdefs (GParamDef *paramdefs,
|
||||
gint nparams);
|
||||
void gimp_destroy_paramdefs (GimpParamDef *paramdefs,
|
||||
gint nparams);
|
||||
|
||||
gdouble gimp_gamma (void);
|
||||
gboolean gimp_install_cmap (void);
|
||||
gboolean gimp_use_xshm (void);
|
||||
guchar * gimp_color_cube (void);
|
||||
gint gimp_min_colors (void);
|
||||
void gimp_request_wakeups (void);
|
||||
gdouble gimp_gamma (void);
|
||||
gboolean gimp_install_cmap (void);
|
||||
gboolean gimp_use_xshm (void);
|
||||
guchar * gimp_color_cube (void);
|
||||
gint gimp_min_colors (void);
|
||||
void gimp_request_wakeups (void);
|
||||
|
||||
gchar * gimp_get_progname (void);
|
||||
gchar * gimp_get_progname (void);
|
||||
|
||||
/****************************************
|
||||
* Images *
|
||||
****************************************/
|
||||
|
||||
gint32 gimp_image_new (guint width,
|
||||
guint height,
|
||||
GImageType type);
|
||||
gint32 gimp_image_duplicate (gint32 image_ID);
|
||||
void gimp_image_delete (gint32 image_ID);
|
||||
guint gimp_image_width (gint32 image_ID);
|
||||
guint gimp_image_height (gint32 image_ID);
|
||||
GImageType gimp_image_base_type (gint32 image_ID);
|
||||
gint32 gimp_image_floating_selection (gint32 image_ID);
|
||||
void gimp_image_add_channel (gint32 image_ID,
|
||||
gint32 channel_ID,
|
||||
gint position);
|
||||
void gimp_image_add_layer (gint32 image_ID,
|
||||
gint32 layer_ID,
|
||||
gint position);
|
||||
void gimp_image_add_layer_mask (gint32 image_ID,
|
||||
gint32 layer_ID,
|
||||
gint32 mask_ID);
|
||||
void gimp_image_clean_all (gint32 image_ID);
|
||||
void gimp_image_undo_disable (gint32 image_ID);
|
||||
void gimp_image_undo_enable (gint32 image_ID);
|
||||
void gimp_image_undo_freeze (gint32 image_ID);
|
||||
void gimp_image_undo_thaw (gint32 image_ID);
|
||||
void gimp_undo_push_group_start (gint32 image_ID);
|
||||
void gimp_undo_push_group_end (gint32 image_ID);
|
||||
void gimp_image_clean_all (gint32 image_ID);
|
||||
gint32 gimp_image_flatten (gint32 image_ID);
|
||||
void gimp_image_lower_channel (gint32 image_ID,
|
||||
gint32 channel_ID);
|
||||
void gimp_image_lower_layer (gint32 image_ID,
|
||||
gint32 layer_ID);
|
||||
gint32 gimp_image_merge_visible_layers (gint32 image_ID,
|
||||
GimpMergeType merge_type);
|
||||
gint32 gimp_image_pick_correlate_layer (gint32 image_ID,
|
||||
gint x,
|
||||
gint y);
|
||||
void gimp_image_raise_channel (gint32 image_ID,
|
||||
gint32 channel_ID);
|
||||
void gimp_image_raise_layer (gint32 image_ID,
|
||||
gint32 layer_ID);
|
||||
void gimp_image_remove_channel (gint32 image_ID,
|
||||
gint32 channel_ID);
|
||||
void gimp_image_remove_layer (gint32 image_ID,
|
||||
gint32 layer_ID);
|
||||
void gimp_image_remove_layer_mask (gint32 image_ID,
|
||||
gint32 layer_ID,
|
||||
gint mode);
|
||||
void gimp_image_resize (gint32 image_ID,
|
||||
guint new_width,
|
||||
guint new_height,
|
||||
gint offset_x,
|
||||
gint offset_y);
|
||||
gint32 gimp_image_get_active_channel (gint32 image_ID);
|
||||
gint32 gimp_image_get_active_layer (gint32 image_ID);
|
||||
gint32 * gimp_image_get_channels (gint32 image_ID,
|
||||
gint *nchannels);
|
||||
guchar * gimp_image_get_cmap (gint32 image_ID,
|
||||
gint *ncolors);
|
||||
gboolean gimp_image_get_component_active (gint32 image_ID,
|
||||
gint component);
|
||||
gboolean gimp_image_get_component_visible (gint32 image_ID,
|
||||
gint component);
|
||||
gchar * gimp_image_get_filename (gint32 image_ID);
|
||||
gint32 * gimp_image_get_layers (gint32 image_ID,
|
||||
gint *nlayers);
|
||||
gint32 gimp_image_get_selection (gint32 image_ID);
|
||||
void gimp_image_set_active_channel (gint32 image_ID,
|
||||
gint32 channel_ID);
|
||||
void gimp_image_set_active_layer (gint32 image_ID,
|
||||
gint32 layer_ID);
|
||||
void gimp_image_set_cmap (gint32 image_ID,
|
||||
guchar *cmap,
|
||||
gint ncolors);
|
||||
void gimp_image_set_component_active (gint32 image_ID,
|
||||
gint component,
|
||||
gboolean active);
|
||||
void gimp_image_set_component_visible (gint32 image_ID,
|
||||
gint component,
|
||||
gboolean visible);
|
||||
void gimp_image_set_filename (gint32 image_ID,
|
||||
gchar *name);
|
||||
GimpParasite * gimp_image_parasite_find (gint32 image_ID,
|
||||
const gchar *name);
|
||||
void gimp_image_parasite_attach (gint32 image_ID,
|
||||
const GimpParasite *parasite);
|
||||
void gimp_image_attach_new_parasite (gint32 image_ID,
|
||||
const gchar *name,
|
||||
gint flags,
|
||||
gint size,
|
||||
const gpointer data);
|
||||
void gimp_image_parasite_detach (gint32 image_ID,
|
||||
const gchar *name);
|
||||
void gimp_image_set_resolution (gint32 image_ID,
|
||||
gdouble xresolution,
|
||||
gdouble yresolution);
|
||||
void gimp_image_get_resolution (gint32 image_ID,
|
||||
gdouble *xresolution,
|
||||
gdouble *yresolution);
|
||||
void gimp_image_set_unit (gint32 image_ID,
|
||||
GimpUnit unit);
|
||||
GimpUnit gimp_image_get_unit (gint32 image_ID);
|
||||
gint32 gimp_image_get_layer_by_tattoo (gint32 image_ID,
|
||||
gint32 tattoo);
|
||||
gint32 gimp_image_get_channel_by_tattoo (gint32 image_ID,
|
||||
gint32 tattoo);
|
||||
|
||||
guchar * gimp_image_get_thumbnail_data (gint32 image_ID,
|
||||
gint *width,
|
||||
gint *height,
|
||||
gint *bytes);
|
||||
void gimp_image_convert_rgb (gint32 image_ID);
|
||||
void gimp_image_convert_grayscale (gint32 image_ID);
|
||||
void gimp_image_convert_indexed (gint32 image_ID,
|
||||
GimpConvertDitherType dither_type,
|
||||
GimpConvertPaletteType palette_type,
|
||||
gint num_colors,
|
||||
gint alpha_dither,
|
||||
gint remove_unused,
|
||||
gchar *palette);
|
||||
|
||||
/****************************************
|
||||
* Guides *
|
||||
****************************************/
|
||||
|
||||
gint32 gimp_image_add_hguide (gint32 image_ID,
|
||||
gint32 yposition);
|
||||
gint32 gimp_image_add_vguide (gint32 image_ID,
|
||||
gint32 xposition);
|
||||
void gimp_image_delete_guide (gint32 image_ID,
|
||||
gint32 guide_ID);
|
||||
gint32 gimp_image_find_next_guide (gint32 image_ID,
|
||||
gint32 guide_ID);
|
||||
GOrientation gimp_image_get_guide_orientation (gint32 image_ID,
|
||||
gint32 guide_ID);
|
||||
gint32 gimp_image_get_guide_position (gint32 image_ID,
|
||||
gint32 guide_ID);
|
||||
|
||||
|
||||
/****************************************
|
||||
* Displays *
|
||||
****************************************/
|
||||
|
||||
gint32 gimp_display_new (gint32 image_ID);
|
||||
void gimp_display_delete (gint32 display_ID);
|
||||
void gimp_displays_flush (void);
|
||||
|
||||
|
||||
/****************************************
|
||||
* Layers *
|
||||
****************************************/
|
||||
|
||||
gint32 gimp_layer_new (gint32 image_ID,
|
||||
char *name,
|
||||
guint width,
|
||||
guint height,
|
||||
GDrawableType type,
|
||||
gdouble opacity,
|
||||
GLayerMode mode);
|
||||
gint32 gimp_layer_copy (gint32 layer_ID);
|
||||
void gimp_layer_delete (gint32 layer_ID);
|
||||
guint gimp_layer_width (gint32 layer_ID);
|
||||
guint gimp_layer_height (gint32 layer_ID);
|
||||
guint gimp_layer_bpp (gint32 layer_ID);
|
||||
GDrawableType gimp_layer_type (gint32 layer_ID);
|
||||
void gimp_layer_add_alpha (gint32 layer_ID);
|
||||
gint32 gimp_layer_create_mask (gint32 layer_ID,
|
||||
GimpAddMaskType mask_type);
|
||||
void gimp_layer_resize (gint32 layer_ID,
|
||||
guint new_width,
|
||||
guint new_height,
|
||||
gint offset_x,
|
||||
gint offset_y);
|
||||
void gimp_layer_scale (gint32 layer_ID,
|
||||
guint new_width,
|
||||
guint new_height,
|
||||
gint local_origin);
|
||||
void gimp_layer_translate (gint32 layer_ID,
|
||||
gint offset_x,
|
||||
gint offset_y);
|
||||
gboolean gimp_layer_is_floating_selection (gint32 layer_ID);
|
||||
gint32 gimp_layer_get_image_id (gint32 layer_ID);
|
||||
gint32 gimp_layer_get_mask_id (gint32 layer_ID);
|
||||
gboolean gimp_layer_get_apply_mask (gint32 layer_ID);
|
||||
gboolean gimp_layer_get_edit_mask (gint32 layer_ID);
|
||||
GLayerMode gimp_layer_get_mode (gint32 layer_ID);
|
||||
gchar * gimp_layer_get_name (gint32 layer_ID);
|
||||
gdouble gimp_layer_get_opacity (gint32 layer_ID);
|
||||
gboolean gimp_layer_get_preserve_transparency (gint32 layer_ID);
|
||||
gint gimp_layer_get_show_mask (gint32 layer_ID);
|
||||
gint gimp_layer_get_visible (gint32 layer_ID);
|
||||
void gimp_layer_set_apply_mask (gint32 layer_ID,
|
||||
gboolean apply_mask);
|
||||
void gimp_layer_set_edit_mask (gint32 layer_ID,
|
||||
gboolean edit_mask);
|
||||
void gimp_layer_set_mode (gint32 layer_ID,
|
||||
GLayerMode mode);
|
||||
void gimp_layer_set_name (gint32 layer_ID,
|
||||
gchar *name);
|
||||
void gimp_layer_set_offsets (gint32 layer_ID,
|
||||
gint offset_x,
|
||||
gint offset_y);
|
||||
void gimp_layer_set_opacity (gint32 layer_ID,
|
||||
gdouble opacity);
|
||||
void gimp_layer_set_preserve_transparency (gint32 layer_ID,
|
||||
gboolean preserve_transparency);
|
||||
void gimp_layer_set_show_mask (gint32 layer_ID,
|
||||
gboolean show_mask);
|
||||
void gimp_layer_set_visible (gint32 layer_ID,
|
||||
gboolean visible);
|
||||
gint32 gimp_layer_get_tattoo (gint32 layer_ID);
|
||||
|
||||
|
||||
/****************************************
|
||||
* Channels *
|
||||
****************************************/
|
||||
|
||||
gint32 gimp_channel_new (gint32 image_ID,
|
||||
gchar *name,
|
||||
guint width,
|
||||
guint height,
|
||||
gdouble opacity,
|
||||
guchar *color);
|
||||
gint32 gimp_channel_copy (gint32 channel_ID);
|
||||
void gimp_channel_delete (gint32 channel_ID);
|
||||
guint gimp_channel_width (gint32 channel_ID);
|
||||
guint gimp_channel_height (gint32 channel_ID);
|
||||
gint32 gimp_channel_get_image_id (gint32 channel_ID);
|
||||
gint32 gimp_channel_get_layer_id (gint32 channel_ID);
|
||||
void gimp_channel_get_color (gint32 channel_ID,
|
||||
guchar *red,
|
||||
guchar *green,
|
||||
guchar *blue);
|
||||
gchar * gimp_channel_get_name (gint32 channel_ID);
|
||||
gdouble gimp_channel_get_opacity (gint32 channel_ID);
|
||||
gint gimp_channel_get_show_masked (gint32 channel_ID);
|
||||
gboolean gimp_channel_get_visible (gint32 channel_ID);
|
||||
void gimp_channel_set_color (gint32 channel_ID,
|
||||
guchar red,
|
||||
guchar green,
|
||||
guchar blue);
|
||||
void gimp_channel_set_name (gint32 channel_ID,
|
||||
gchar *name);
|
||||
void gimp_channel_set_opacity (gint32 channel_ID,
|
||||
gdouble opacity);
|
||||
void gimp_channel_set_show_masked (gint32 channel_ID,
|
||||
gint show_masked);
|
||||
void gimp_channel_set_visible (gint32 channel_ID,
|
||||
gboolean visible);
|
||||
gint32 gimp_channel_get_tattoo (gint32 channel_ID);
|
||||
|
||||
|
||||
/****************************************
|
||||
* GDrawables *
|
||||
****************************************/
|
||||
|
||||
GDrawable * gimp_drawable_get (gint32 drawable_ID);
|
||||
void gimp_drawable_detach (GDrawable *drawable);
|
||||
void gimp_drawable_flush (GDrawable *drawable);
|
||||
void gimp_drawable_delete (GDrawable *drawable);
|
||||
void gimp_drawable_update (gint32 drawable_ID,
|
||||
gint x,
|
||||
gint y,
|
||||
guint width,
|
||||
guint height);
|
||||
void gimp_drawable_merge_shadow (gint32 drawable_ID,
|
||||
gboolean undoable);
|
||||
gint32 gimp_drawable_image_id (gint32 drawable_ID);
|
||||
gchar * gimp_drawable_name (gint32 drawable_ID);
|
||||
guint gimp_drawable_width (gint32 drawable_ID);
|
||||
guint gimp_drawable_height (gint32 drawable_ID);
|
||||
guint gimp_drawable_bpp (gint32 drawable_ID);
|
||||
GDrawableType gimp_drawable_type (gint32 drawable_ID);
|
||||
gboolean gimp_drawable_visible (gint32 drawable_ID);
|
||||
gboolean gimp_drawable_is_channel (gint32 drawable_ID);
|
||||
gboolean gimp_drawable_is_rgb (gint32 drawable_ID);
|
||||
gboolean gimp_drawable_is_gray (gint32 drawable_ID);
|
||||
gboolean gimp_drawable_has_alpha (gint32 drawable_ID);
|
||||
gboolean gimp_drawable_is_indexed (gint32 drawable_ID);
|
||||
gboolean gimp_drawable_is_layer (gint32 drawable_ID);
|
||||
gboolean gimp_drawable_is_layer_mask (gint32 drawable_ID);
|
||||
gboolean gimp_drawable_mask_bounds (gint32 drawable_ID,
|
||||
gint *x1,
|
||||
gint *y1,
|
||||
gint *x2,
|
||||
gint *y2);
|
||||
void gimp_drawable_offsets (gint32 drawable_ID,
|
||||
gint *offset_x,
|
||||
gint *offset_y);
|
||||
void gimp_drawable_fill (gint32 drawable_ID,
|
||||
GimpFillType fill_type);
|
||||
void gimp_drawable_set_name (gint32 drawable_ID,
|
||||
gchar *name);
|
||||
void gimp_drawable_set_visible (gint32 drawable_ID,
|
||||
gint visible);
|
||||
GTile * gimp_drawable_get_tile (GDrawable *drawable,
|
||||
gint shadow,
|
||||
gint row,
|
||||
gint col);
|
||||
GTile * gimp_drawable_get_tile2 (GDrawable *drawable,
|
||||
gint shadow,
|
||||
gint x,
|
||||
gint y);
|
||||
GimpParasite * gimp_drawable_parasite_find (gint32 drawable,
|
||||
const gchar *name);
|
||||
void gimp_drawable_parasite_attach (gint32 drawable,
|
||||
const GimpParasite *parasite);
|
||||
void gimp_drawable_attach_new_parasite (gint32 drawable,
|
||||
const gchar *name,
|
||||
gint flags,
|
||||
gint size,
|
||||
const gpointer data);
|
||||
void gimp_drawable_parasite_detach (gint32 drawable,
|
||||
const gchar *name);
|
||||
guchar * gimp_drawable_get_thumbnail_data (gint32 drawable_ID,
|
||||
gint *width,
|
||||
gint *height,
|
||||
gint *bytes);
|
||||
|
||||
|
||||
/****************************************
|
||||
* Selections *
|
||||
****************************************/
|
||||
|
||||
gint32 gimp_selection_bounds (gint32 image_ID,
|
||||
gint32 *non_empty,
|
||||
gint32 *x1,
|
||||
gint32 *y1,
|
||||
gint32 *x2,
|
||||
gint32 *y2);
|
||||
gint32 gimp_selection_float (gint32 image_ID,
|
||||
gint32 drawable_ID,
|
||||
gint32 x_offset,
|
||||
gint32 y_offset);
|
||||
gint32 gimp_selection_is_empty (gint32 image_ID);
|
||||
void gimp_selection_none (gint32 image_ID);
|
||||
|
||||
|
||||
/****************************************
|
||||
* GTiles *
|
||||
****************************************/
|
||||
|
||||
void gimp_tile_ref (GTile *tile);
|
||||
void gimp_tile_ref_zero (GTile *tile);
|
||||
void gimp_tile_unref (GTile *tile,
|
||||
gint dirty);
|
||||
void gimp_tile_flush (GTile *tile);
|
||||
void gimp_tile_cache_size (gulong kilobytes);
|
||||
void gimp_tile_cache_ntiles (gulong ntiles);
|
||||
guint gimp_tile_width (void);
|
||||
guint gimp_tile_height (void);
|
||||
|
||||
|
||||
/****************************************
|
||||
* Pixel Regions *
|
||||
****************************************/
|
||||
|
||||
void gimp_pixel_rgn_init (GPixelRgn *pr,
|
||||
GDrawable *drawable,
|
||||
gint x,
|
||||
gint y,
|
||||
gint width,
|
||||
gint height,
|
||||
gint dirty,
|
||||
gint shadow);
|
||||
void gimp_pixel_rgn_resize (GPixelRgn *pr,
|
||||
gint x,
|
||||
gint y,
|
||||
gint width,
|
||||
gint height);
|
||||
void gimp_pixel_rgn_get_pixel (GPixelRgn *pr,
|
||||
guchar *buf,
|
||||
gint x,
|
||||
gint y);
|
||||
void gimp_pixel_rgn_get_row (GPixelRgn *pr,
|
||||
guchar *buf,
|
||||
gint x,
|
||||
gint y,
|
||||
gint width);
|
||||
void gimp_pixel_rgn_get_col (GPixelRgn *pr,
|
||||
guchar *buf,
|
||||
gint x,
|
||||
gint y,
|
||||
gint height);
|
||||
void gimp_pixel_rgn_get_rect (GPixelRgn *pr,
|
||||
guchar *buf,
|
||||
gint x,
|
||||
gint y,
|
||||
gint width,
|
||||
gint height);
|
||||
void gimp_pixel_rgn_set_pixel (GPixelRgn *pr,
|
||||
guchar *buf,
|
||||
gint x,
|
||||
gint y);
|
||||
void gimp_pixel_rgn_set_row (GPixelRgn *pr,
|
||||
guchar *buf,
|
||||
gint x,
|
||||
gint y,
|
||||
gint width);
|
||||
void gimp_pixel_rgn_set_col (GPixelRgn *pr,
|
||||
guchar *buf,
|
||||
gint x,
|
||||
gint y,
|
||||
gint height);
|
||||
void gimp_pixel_rgn_set_rect (GPixelRgn *pr,
|
||||
guchar *buf,
|
||||
gint x,
|
||||
gint y,
|
||||
gint width,
|
||||
gint height);
|
||||
gpointer gimp_pixel_rgns_register (gint nrgns,
|
||||
...);
|
||||
gpointer gimp_pixel_rgns_register2 (gint nrgns,
|
||||
GPixelRgn **prs);
|
||||
gpointer gimp_pixel_rgns_process (gpointer pri_ptr);
|
||||
|
||||
|
||||
/****************************************
|
||||
* The Palette *
|
||||
****************************************/
|
||||
|
||||
void gimp_palette_get_background (guchar *red,
|
||||
guchar *green,
|
||||
guchar *blue);
|
||||
void gimp_palette_get_foreground (guchar *red,
|
||||
guchar *green,
|
||||
guchar *blue);
|
||||
void gimp_palette_set_background (guchar red,
|
||||
guchar green,
|
||||
guchar blue);
|
||||
void gimp_palette_set_foreground (guchar red,
|
||||
guchar green,
|
||||
guchar blue);
|
||||
|
||||
/****************************************
|
||||
* Gradients *
|
||||
****************************************/
|
||||
|
||||
gchar ** gimp_gradients_get_list (gint *num_gradients);
|
||||
gchar * gimp_gradients_get_active (void);
|
||||
void gimp_gradients_set_active (gchar *name);
|
||||
gdouble * gimp_gradients_sample_uniform (gint num_samples);
|
||||
gdouble * gimp_gradients_sample_custom (gint num_samples,
|
||||
gdouble *positions);
|
||||
|
||||
/****************************************
|
||||
* Parasites *
|
||||
****************************************/
|
||||
|
||||
GimpParasite * gimp_parasite_find (const gchar *name);
|
||||
void gimp_parasite_attach (const GimpParasite *parasite);
|
||||
void gimp_attach_new_parasite (const gchar *name,
|
||||
gint flags,
|
||||
gint size,
|
||||
const gpointer data);
|
||||
void gimp_parasite_detach (const gchar *name);
|
||||
|
||||
/****************************************
|
||||
* Help *
|
||||
****************************************/
|
||||
|
||||
void gimp_help (gchar *prog_name,
|
||||
gchar *help_data);
|
||||
void gimp_plugin_help_register (gchar *help_path);
|
||||
|
||||
/****************************************
|
||||
* Localisation *
|
||||
****************************************/
|
||||
|
||||
void gimp_plugin_domain_add (gchar *domain_name);
|
||||
void gimp_plugin_domain_add_with_path (gchar *domain_name,
|
||||
gchar *domain_path);
|
||||
void gimp_plugin_domain_add (gchar *domain_name);
|
||||
void gimp_plugin_domain_add_with_path (gchar *domain_name,
|
||||
gchar *domain_path);
|
||||
|
||||
|
||||
#ifdef __cplusplus
|
||||
}
|
||||
#endif /* __cplusplus */
|
||||
|
||||
|
||||
#endif /* __GIMP_H__ */
|
||||
|
|
|
@ -1,5 +1,7 @@
|
|||
/* LIBGIMP - The GIMP Library
|
||||
* Copyright (C) 1995-1997 Peter Mattis and Spencer Kimball
|
||||
*
|
||||
* gimpbrushmenu.c
|
||||
* Copyright (C) 1998 Andy Thomas
|
||||
*
|
||||
* This library is free software; you can redistribute it and/or
|
||||
|
@ -28,7 +30,7 @@
|
|||
* completely controls the selection of a brush.
|
||||
* you get a widget returned that you can use in a table say.
|
||||
* In:- Initial brush name. Null means use current selection.
|
||||
* pointer to func to call when brush changes (GRunBrushCallback).
|
||||
* pointer to func to call when brush changes (GimpRunBrushCallback).
|
||||
* Returned:- Pointer to a widget that you can use in UI.
|
||||
*
|
||||
* Widget simply made up of a preview widget (20x20) containing the brush mask
|
||||
|
@ -45,22 +47,22 @@
|
|||
|
||||
struct __brushes_sel
|
||||
{
|
||||
gchar *dname;
|
||||
GRunBrushCallback cback;
|
||||
GtkWidget *brush_preview;
|
||||
GtkWidget *device_brushpopup;
|
||||
GtkWidget *device_brushpreview;
|
||||
GtkWidget *button;
|
||||
GtkWidget *top_hbox;
|
||||
gchar *brush_name; /* Local copy */
|
||||
gdouble opacity;
|
||||
gint spacing;
|
||||
gint paint_mode;
|
||||
gint width;
|
||||
gint height;
|
||||
gchar *mask_data; /* local copy */
|
||||
void *brush_popup_pnt; /* Pointer use to control the popup */
|
||||
gpointer data;
|
||||
gchar *dname;
|
||||
GimpRunBrushCallback cback;
|
||||
GtkWidget *brush_preview;
|
||||
GtkWidget *device_brushpopup;
|
||||
GtkWidget *device_brushpreview;
|
||||
GtkWidget *button;
|
||||
GtkWidget *top_hbox;
|
||||
gchar *brush_name; /* Local copy */
|
||||
gdouble opacity;
|
||||
gint spacing;
|
||||
gint paint_mode;
|
||||
gint width;
|
||||
gint height;
|
||||
gchar *mask_data; /* local copy */
|
||||
void *brush_popup_pnt; /* Pointer use to control the popup */
|
||||
gpointer data;
|
||||
};
|
||||
|
||||
typedef struct __brushes_sel BSelect;
|
||||
|
@ -131,7 +133,7 @@ brush_popup_open (gint x,
|
|||
(guchar *)buf, 0, y, bsel->width);
|
||||
src += bsel->width;
|
||||
}
|
||||
g_free(buf);
|
||||
g_free (buf);
|
||||
|
||||
/* Draw the brush preview */
|
||||
gtk_widget_draw (bsel->device_brushpreview, NULL);
|
||||
|
@ -217,19 +219,21 @@ brush_pre_update(GtkWidget *brush_preview,
|
|||
/* Set buffer to white */
|
||||
memset (buf, 255, CELL_SIZE);
|
||||
for (i = 0; i < CELL_SIZE; i++)
|
||||
gtk_preview_draw_row (GTK_PREVIEW(brush_preview), (guchar *)buf, 0, i, CELL_SIZE);
|
||||
gtk_preview_draw_row (GTK_PREVIEW (brush_preview),
|
||||
(guchar *)buf, 0, i, CELL_SIZE);
|
||||
|
||||
offset_x = ((CELL_SIZE - width) >> 1);
|
||||
offset_y = ((CELL_SIZE - height) >> 1);
|
||||
|
||||
ystart = CLAMP (offset_y, 0, CELL_SIZE);
|
||||
yend = CLAMP (offset_y + height, 0, CELL_SIZE);
|
||||
yend = CLAMP (offset_y + height, 0, CELL_SIZE);
|
||||
|
||||
src = mask_data;
|
||||
|
||||
for (y = ystart; y < yend; y++)
|
||||
{
|
||||
int j;
|
||||
gint j;
|
||||
|
||||
s = src;
|
||||
b = buf;
|
||||
for (j = 0; j < width ; j++)
|
||||
|
@ -257,7 +261,7 @@ brush_select_invoker (gchar *name,
|
|||
gpointer data)
|
||||
{
|
||||
gint mask_d_sz;
|
||||
BSelect *bsel = (BSelect*)data;
|
||||
BSelect *bsel = (BSelect *) data;
|
||||
|
||||
if(bsel->mask_data != NULL)
|
||||
g_free(bsel->mask_data);
|
||||
|
@ -268,16 +272,17 @@ brush_select_invoker (gchar *name,
|
|||
bsel->mask_data = g_malloc (mask_d_sz);
|
||||
g_memmove(bsel->mask_data, mask_data, mask_d_sz);
|
||||
|
||||
brush_pre_update (bsel->brush_preview, bsel->width, bsel->height, bsel->mask_data);
|
||||
brush_pre_update (bsel->brush_preview,
|
||||
bsel->width, bsel->height, bsel->mask_data);
|
||||
bsel->opacity = opacity;
|
||||
bsel->spacing = spacing;
|
||||
bsel->paint_mode = paint_mode;
|
||||
|
||||
if(bsel->cback != NULL)
|
||||
(bsel->cback)(name, opacity, spacing, paint_mode,
|
||||
width, height, mask_data, closing, bsel->data);
|
||||
if (bsel->cback != NULL)
|
||||
(bsel->cback) (name, opacity, spacing, paint_mode,
|
||||
width, height, mask_data, closing, bsel->data);
|
||||
|
||||
if(closing)
|
||||
if (closing)
|
||||
{
|
||||
gtk_widget_set_sensitive (bsel->button, TRUE);
|
||||
bsel->brush_popup_pnt = NULL;
|
||||
|
@ -304,13 +309,13 @@ brush_select_callback (GtkWidget *widget,
|
|||
}
|
||||
|
||||
GtkWidget *
|
||||
gimp_brush_select_widget (gchar *dname,
|
||||
gchar *ibrush,
|
||||
gdouble opacity,
|
||||
gint spacing,
|
||||
gint paint_mode,
|
||||
GRunBrushCallback cback,
|
||||
gpointer data)
|
||||
gimp_brush_select_widget (gchar *dname,
|
||||
gchar *ibrush,
|
||||
gdouble opacity,
|
||||
gint spacing,
|
||||
gint paint_mode,
|
||||
GimpRunBrushCallback cback,
|
||||
gpointer data)
|
||||
{
|
||||
GtkWidget *frame;
|
||||
GtkWidget *hbox;
|
||||
|
@ -369,15 +374,15 @@ gimp_brush_select_widget (gchar *dname,
|
|||
bsel->brush_name = brush_name;
|
||||
bsel->width = width;
|
||||
bsel->height = height;
|
||||
if(opacity != -1)
|
||||
if (opacity != -1)
|
||||
bsel->opacity = opacity;
|
||||
else
|
||||
bsel->opacity = init_opacity;
|
||||
if(spacing != -1)
|
||||
if (spacing != -1)
|
||||
bsel->spacing = spacing;
|
||||
else
|
||||
bsel->spacing = init_spacing;
|
||||
if(paint_mode != -1)
|
||||
if (paint_mode != -1)
|
||||
bsel->paint_mode = paint_mode;
|
||||
else
|
||||
bsel->paint_mode = init_paint_mode;
|
||||
|
@ -394,7 +399,7 @@ gimp_brush_select_widget (gchar *dname,
|
|||
(GtkSignalFunc) brush_select_callback,
|
||||
(gpointer)bsel);
|
||||
|
||||
gtk_object_set_data(GTK_OBJECT(hbox),BSEL_DATA_KEY,(gpointer)bsel);
|
||||
gtk_object_set_data (GTK_OBJECT (hbox), BSEL_DATA_KEY, (gpointer) bsel);
|
||||
|
||||
return hbox;
|
||||
}
|
||||
|
@ -405,8 +410,8 @@ gimp_brush_select_widget_close_popup (GtkWidget *widget)
|
|||
{
|
||||
gboolean ret_val = FALSE;
|
||||
BSelect *bsel;
|
||||
|
||||
bsel = (BSelect*) gtk_object_get_data (GTK_OBJECT (widget), BSEL_DATA_KEY);
|
||||
|
||||
bsel = (BSelect *) gtk_object_get_data (GTK_OBJECT (widget), BSEL_DATA_KEY);
|
||||
|
||||
if (bsel && bsel->brush_popup_pnt)
|
||||
{
|
||||
|
@ -434,7 +439,7 @@ gimp_brush_select_widget_set_popup (GtkWidget *widget,
|
|||
gchar *brush_name;
|
||||
BSelect *bsel;
|
||||
|
||||
bsel = (BSelect*) gtk_object_get_data (GTK_OBJECT (widget), BSEL_DATA_KEY);
|
||||
bsel = (BSelect *) gtk_object_get_data (GTK_OBJECT (widget), BSEL_DATA_KEY);
|
||||
|
||||
if (bsel)
|
||||
{
|
||||
|
|
|
@ -16,6 +16,7 @@
|
|||
* Free Software Foundation, Inc., 59 Temple Place - Suite 330,
|
||||
* Boston, MA 02111-1307, USA.
|
||||
*/
|
||||
|
||||
#include "gimp.h"
|
||||
|
||||
|
||||
|
@ -84,30 +85,6 @@ gimp_channel_delete (gint32 channel_ID)
|
|||
gimp_destroy_params (return_vals, nreturn_vals);
|
||||
}
|
||||
|
||||
guint
|
||||
gimp_channel_width (gint32 channel_ID)
|
||||
{
|
||||
return gimp_drawable_width (channel_ID);
|
||||
}
|
||||
|
||||
guint
|
||||
gimp_channel_height (gint32 channel_ID)
|
||||
{
|
||||
return gimp_drawable_height (channel_ID);
|
||||
}
|
||||
|
||||
gint32
|
||||
gimp_channel_get_image_id (gint32 channel_ID)
|
||||
{
|
||||
return gimp_drawable_image_id (channel_ID);
|
||||
}
|
||||
|
||||
gint32
|
||||
gimp_channel_get_layer_id (gint32 channel_ID)
|
||||
{
|
||||
return -1;
|
||||
}
|
||||
|
||||
void
|
||||
gimp_channel_get_color (gint32 channel_ID,
|
||||
guchar *red,
|
||||
|
|
|
@ -0,0 +1,67 @@
|
|||
/* LIBGIMP - The GIMP Library
|
||||
* Copyright (C) 1995-1997 Peter Mattis and Spencer Kimball
|
||||
*
|
||||
* gimpchannel_pdb.h
|
||||
*
|
||||
* This library is free software; you can redistribute it and/or
|
||||
* modify it under the terms of the GNU Lesser General Public
|
||||
* License as published by the Free Software Foundation; either
|
||||
* version 2 of the License, or (at your option) any later version.
|
||||
*
|
||||
* This library 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
|
||||
* Lesser General Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU Lesser General Public
|
||||
* License along with this library; if not, write to the
|
||||
* Free Software Foundation, Inc., 59 Temple Place - Suite 330,
|
||||
* Boston, MA 02111-1307, USA.
|
||||
*/
|
||||
|
||||
#ifndef __GIMP_CHANNEL_PDB_H__
|
||||
#define __GIMP_CHANNEL_PDB_H__
|
||||
|
||||
#ifdef __cplusplus
|
||||
extern "C" {
|
||||
#endif /* __cplusplus */
|
||||
|
||||
/* For information look into the C source or the html documentation */
|
||||
|
||||
|
||||
gint32 gimp_channel_new (gint32 image_ID,
|
||||
gchar *name,
|
||||
guint width,
|
||||
guint height,
|
||||
gdouble opacity,
|
||||
guchar *color);
|
||||
gint32 gimp_channel_copy (gint32 channel_ID);
|
||||
void gimp_channel_delete (gint32 channel_ID);
|
||||
void gimp_channel_get_color (gint32 channel_ID,
|
||||
guchar *red,
|
||||
guchar *green,
|
||||
guchar *blue);
|
||||
gchar * gimp_channel_get_name (gint32 channel_ID);
|
||||
gdouble gimp_channel_get_opacity (gint32 channel_ID);
|
||||
gint gimp_channel_get_show_masked (gint32 channel_ID);
|
||||
gboolean gimp_channel_get_visible (gint32 channel_ID);
|
||||
void gimp_channel_set_color (gint32 channel_ID,
|
||||
guchar red,
|
||||
guchar green,
|
||||
guchar blue);
|
||||
void gimp_channel_set_name (gint32 channel_ID,
|
||||
gchar *name);
|
||||
void gimp_channel_set_opacity (gint32 channel_ID,
|
||||
gdouble opacity);
|
||||
void gimp_channel_set_show_masked (gint32 channel_ID,
|
||||
gint show_masked);
|
||||
void gimp_channel_set_visible (gint32 channel_ID,
|
||||
gboolean visible);
|
||||
gint32 gimp_channel_get_tattoo (gint32 channel_ID);
|
||||
|
||||
|
||||
#ifdef __cplusplus
|
||||
}
|
||||
#endif /* __cplusplus */
|
||||
|
||||
#endif /* __GIMP_CHANNEL_PDB_H__ */
|
|
@ -37,16 +37,29 @@ extern "C" {
|
|||
#define gimp_drawable_attach_parasite gimp_drawable_parasite_attach
|
||||
#define gimp_drawable_detach_parasite gimp_drawable_parasite_detach
|
||||
#define gimp_drawable_find_parasite gimp_drawable_parasite_find
|
||||
|
||||
#define gimp_drawable_channel gimp_drawable_is_channel
|
||||
#define gimp_drawable_gray gimp_drawable_is_gray
|
||||
#define gimp_drawable_color gimp_drawable_is_rgb
|
||||
#define gimp_drawable_indexed gimp_drawable_is_indexed
|
||||
#define gimp_drawable_layer gimp_drawable_is_layer
|
||||
#define gimp_drawable_layer_mask gimp_drawable_is_layer_mask
|
||||
|
||||
#define gimp_image_disable_undo gimp_image_undo_disable
|
||||
#define gimp_image_enable_undo gimp_image_undo_enable
|
||||
#define gimp_image_freeze_undo gimp_image_undo_freeze
|
||||
#define gimp_image_thaw_undo gimp_image_undo_thaw
|
||||
|
||||
#define gimp_channel_width gimp_drawable_width
|
||||
#define gimp_channel_height gimp_drawable_height
|
||||
#define gimp_channel_get_image_ID gimp_drawable_get_image_ID
|
||||
#define gimp_channel_get_layer_ID -1
|
||||
|
||||
#define gimp_layer_width gimp_drawable_width
|
||||
#define gimp_layer_height gimp_drawable_height
|
||||
#define gimp_layer_bpp gimp_drawable_bpp
|
||||
#define gimp_layer_type gimp_drawable_type
|
||||
|
||||
#define gimp_plugin_help_func gimp_standard_help_func
|
||||
|
||||
#define Parasite GimpParasite
|
||||
|
@ -76,6 +89,16 @@ extern "C" {
|
|||
#define pixpipeparams_parse gimp_pixpipe_params_parse
|
||||
#define pixpipeparams_build gimp_pixpipe_params_build
|
||||
|
||||
#define GPlugInInfo GimpPlugInInfo
|
||||
#define GTile GimpTile
|
||||
#define GDrawable GimpDrawable
|
||||
#define GPixelRgn GimpPixelRgn
|
||||
#define GParamColor GimpParamColor
|
||||
#define GParamRegion GimpParamRegion
|
||||
#define GParamData GimpParamData
|
||||
#define GParamDef GimpParamDef
|
||||
#define GParam GimpParam
|
||||
|
||||
#endif /* GIMP_DISABLE_COMPAT_H */
|
||||
|
||||
|
||||
|
|
|
@ -0,0 +1,41 @@
|
|||
/* LIBGIMP - The GIMP Library
|
||||
* Copyright (C) 1995-1997 Peter Mattis and Spencer Kimball
|
||||
*
|
||||
* gimpdisplay_pdb.h
|
||||
*
|
||||
* This library is free software; you can redistribute it and/or
|
||||
* modify it under the terms of the GNU Lesser General Public
|
||||
* License as published by the Free Software Foundation; either
|
||||
* version 2 of the License, or (at your option) any later version.
|
||||
*
|
||||
* This library 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
|
||||
* Lesser General Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU Lesser General Public
|
||||
* License along with this library; if not, write to the
|
||||
* Free Software Foundation, Inc., 59 Temple Place - Suite 330,
|
||||
* Boston, MA 02111-1307, USA.
|
||||
*/
|
||||
|
||||
#ifndef __GIMP_DISPLAY_PDB_H__
|
||||
#define __GIMP_DISPLAY_PDB_H__
|
||||
|
||||
#ifdef __cplusplus
|
||||
extern "C" {
|
||||
#endif /* __cplusplus */
|
||||
|
||||
/* For information look into the C source or the html documentation */
|
||||
|
||||
|
||||
gint32 gimp_display_new (gint32 image_ID);
|
||||
void gimp_display_delete (gint32 display_ID);
|
||||
void gimp_displays_flush (void);
|
||||
|
||||
|
||||
#ifdef __cplusplus
|
||||
}
|
||||
#endif /* __cplusplus */
|
||||
|
||||
#endif /* __GIMP_DISPLAY_PDB_H__ */
|
|
@ -0,0 +1,230 @@
|
|||
/* LIBGIMP - The GIMP Library
|
||||
* Copyright (C) 1995-1997 Peter Mattis and Spencer Kimball
|
||||
*
|
||||
* gimpdrawable.c
|
||||
*
|
||||
* This library is free software; you can redistribute it and/or
|
||||
* modify it under the terms of the GNU Lesser General Public
|
||||
* License as published by the Free Software Foundation; either
|
||||
* version 2 of the License, or (at your option) any later version.
|
||||
*
|
||||
* This library 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
|
||||
* Library General Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU Lesser General Public
|
||||
* License along with this library; if not, write to the
|
||||
* Free Software Foundation, Inc., 59 Temple Place - Suite 330,
|
||||
* Boston, MA 02111-1307, USA.
|
||||
*/
|
||||
|
||||
#include <string.h>
|
||||
|
||||
#include <glib.h>
|
||||
|
||||
#include "gimp.h"
|
||||
|
||||
#define TILE_WIDTH _gimp_tile_width
|
||||
#define TILE_HEIGHT _gimp_tile_height
|
||||
|
||||
|
||||
extern gint _gimp_tile_width;
|
||||
extern gint _gimp_tile_height;
|
||||
|
||||
|
||||
GimpDrawable *
|
||||
gimp_drawable_get (gint32 drawable_ID)
|
||||
{
|
||||
GimpDrawable *drawable;
|
||||
|
||||
drawable = g_new (GimpDrawable, 1);
|
||||
drawable->id = drawable_ID;
|
||||
drawable->width = gimp_drawable_width (drawable_ID);
|
||||
drawable->height = gimp_drawable_height (drawable_ID);
|
||||
drawable->bpp = gimp_drawable_bpp (drawable_ID);
|
||||
drawable->ntile_rows = (drawable->height + TILE_HEIGHT - 1) / TILE_HEIGHT;
|
||||
drawable->ntile_cols = (drawable->width + TILE_WIDTH - 1) / TILE_WIDTH;
|
||||
drawable->tiles = NULL;
|
||||
drawable->shadow_tiles = NULL;
|
||||
|
||||
return drawable;
|
||||
}
|
||||
|
||||
void
|
||||
gimp_drawable_detach (GimpDrawable *drawable)
|
||||
{
|
||||
if (drawable)
|
||||
{
|
||||
gimp_drawable_flush (drawable);
|
||||
if (drawable->tiles)
|
||||
g_free (drawable->tiles);
|
||||
if (drawable->shadow_tiles)
|
||||
g_free (drawable->shadow_tiles);
|
||||
g_free (drawable);
|
||||
}
|
||||
}
|
||||
|
||||
void
|
||||
gimp_drawable_flush (GimpDrawable *drawable)
|
||||
{
|
||||
GimpTile *tiles;
|
||||
gint ntiles;
|
||||
gint i;
|
||||
|
||||
if (drawable)
|
||||
{
|
||||
if (drawable->tiles)
|
||||
{
|
||||
tiles = drawable->tiles;
|
||||
ntiles = drawable->ntile_rows * drawable->ntile_cols;
|
||||
|
||||
for (i = 0; i < ntiles; i++)
|
||||
if ((tiles[i].ref_count > 0) && tiles[i].dirty)
|
||||
gimp_tile_flush (&tiles[i]);
|
||||
}
|
||||
|
||||
if (drawable->shadow_tiles)
|
||||
{
|
||||
tiles = drawable->shadow_tiles;
|
||||
ntiles = drawable->ntile_rows * drawable->ntile_cols;
|
||||
|
||||
for (i = 0; i < ntiles; i++)
|
||||
if ((tiles[i].ref_count > 0) && tiles[i].dirty)
|
||||
gimp_tile_flush (&tiles[i]);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
void
|
||||
gimp_drawable_delete (GimpDrawable *drawable)
|
||||
{
|
||||
if (drawable)
|
||||
{
|
||||
if (gimp_drawable_is_layer (drawable->id))
|
||||
gimp_layer_delete (drawable->id);
|
||||
else
|
||||
gimp_channel_delete (drawable->id);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
gchar*
|
||||
gimp_drawable_name (gint32 drawable_ID)
|
||||
{
|
||||
if (gimp_drawable_is_layer (drawable_ID))
|
||||
return gimp_layer_get_name (drawable_ID);
|
||||
|
||||
return gimp_channel_get_name (drawable_ID);
|
||||
}
|
||||
|
||||
|
||||
gboolean
|
||||
gimp_drawable_visible (gint32 drawable_ID)
|
||||
{
|
||||
if (gimp_drawable_is_layer (drawable_ID))
|
||||
return gimp_layer_get_visible (drawable_ID);
|
||||
|
||||
return gimp_channel_get_visible (drawable_ID);
|
||||
}
|
||||
|
||||
|
||||
void
|
||||
gimp_drawable_set_name (gint32 drawable_ID,
|
||||
gchar *name)
|
||||
{
|
||||
if (gimp_drawable_is_layer (drawable_ID))
|
||||
gimp_layer_set_name (drawable_ID, name);
|
||||
else
|
||||
gimp_channel_set_name (drawable_ID, name);
|
||||
}
|
||||
|
||||
void
|
||||
gimp_drawable_set_visible (gint32 drawable_ID,
|
||||
gint visible)
|
||||
{
|
||||
if (gimp_drawable_is_layer (drawable_ID))
|
||||
gimp_layer_set_visible (drawable_ID, visible);
|
||||
else
|
||||
gimp_channel_set_visible (drawable_ID, visible);
|
||||
}
|
||||
|
||||
GimpTile *
|
||||
gimp_drawable_get_tile (GimpDrawable *drawable,
|
||||
gboolean shadow,
|
||||
gint row,
|
||||
gint col)
|
||||
{
|
||||
GimpTile *tiles;
|
||||
guint right_tile;
|
||||
guint bottom_tile;
|
||||
gint ntiles;
|
||||
gint tile_num;
|
||||
gint i, j, k;
|
||||
|
||||
if (drawable)
|
||||
{
|
||||
if (shadow)
|
||||
tiles = drawable->shadow_tiles;
|
||||
else
|
||||
tiles = drawable->tiles;
|
||||
|
||||
if (!tiles)
|
||||
{
|
||||
ntiles = drawable->ntile_rows * drawable->ntile_cols;
|
||||
tiles = g_new (GimpTile, ntiles);
|
||||
|
||||
right_tile = drawable->width - ((drawable->ntile_cols - 1) * TILE_WIDTH);
|
||||
bottom_tile = drawable->height - ((drawable->ntile_rows - 1) * TILE_HEIGHT);
|
||||
|
||||
for (i = 0, k = 0; i < drawable->ntile_rows; i++)
|
||||
{
|
||||
for (j = 0; j < drawable->ntile_cols; j++, k++)
|
||||
{
|
||||
tiles[k].bpp = drawable->bpp;
|
||||
tiles[k].tile_num = k;
|
||||
tiles[k].ref_count = 0;
|
||||
tiles[k].dirty = FALSE;
|
||||
tiles[k].shadow = shadow;
|
||||
tiles[k].data = NULL;
|
||||
tiles[k].drawable = drawable;
|
||||
|
||||
if (j == (drawable->ntile_cols - 1))
|
||||
tiles[k].ewidth = right_tile;
|
||||
else
|
||||
tiles[k].ewidth = TILE_WIDTH;
|
||||
|
||||
if (i == (drawable->ntile_rows - 1))
|
||||
tiles[k].eheight = bottom_tile;
|
||||
else
|
||||
tiles[k].eheight = TILE_HEIGHT;
|
||||
}
|
||||
}
|
||||
|
||||
if (shadow)
|
||||
drawable->shadow_tiles = tiles;
|
||||
else
|
||||
drawable->tiles = tiles;
|
||||
}
|
||||
|
||||
tile_num = row * drawable->ntile_cols + col;
|
||||
return &tiles[tile_num];
|
||||
}
|
||||
|
||||
return NULL;
|
||||
}
|
||||
|
||||
GimpTile *
|
||||
gimp_drawable_get_tile2 (GimpDrawable *drawable,
|
||||
gint shadow,
|
||||
gint x,
|
||||
gint y)
|
||||
{
|
||||
gint row;
|
||||
gint col;
|
||||
|
||||
col = x / TILE_WIDTH;
|
||||
row = y / TILE_HEIGHT;
|
||||
|
||||
return gimp_drawable_get_tile (drawable, shadow, row, col);
|
||||
}
|
|
@ -0,0 +1,67 @@
|
|||
/* LIBGIMP - The GIMP Library
|
||||
* Copyright (C) 1995-1997 Peter Mattis and Spencer Kimball
|
||||
*
|
||||
* gimpdrawable.h
|
||||
*
|
||||
* This library is free software; you can redistribute it and/or
|
||||
* modify it under the terms of the GNU Lesser General Public
|
||||
* License as published by the Free Software Foundation; either
|
||||
* version 2 of the License, or (at your option) any later version.
|
||||
*
|
||||
* This library 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
|
||||
* Lesser General Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU Lesser General Public
|
||||
* License along with this library; if not, write to the
|
||||
* Free Software Foundation, Inc., 59 Temple Place - Suite 330,
|
||||
* Boston, MA 02111-1307, USA.
|
||||
*/
|
||||
|
||||
#ifndef __GIMP_DRAWABLE_H__
|
||||
#define __GIMP_DRAWABLE_H__
|
||||
|
||||
#ifdef __cplusplus
|
||||
extern "C" {
|
||||
#endif /* __cplusplus */
|
||||
|
||||
/* For information look into the C source or the html documentation */
|
||||
|
||||
|
||||
struct _GimpDrawable
|
||||
{
|
||||
gint32 id; /* drawable ID */
|
||||
guint width; /* width of drawble */
|
||||
guint height; /* height of drawble */
|
||||
guint bpp; /* bytes per pixel of drawable */
|
||||
guint ntile_rows; /* # of tile rows */
|
||||
guint ntile_cols; /* # of tile columns */
|
||||
GimpTile *tiles; /* the normal tiles */
|
||||
GimpTile *shadow_tiles; /* the shadow tiles */
|
||||
};
|
||||
|
||||
|
||||
GimpDrawable * gimp_drawable_get (gint32 drawable_ID);
|
||||
void gimp_drawable_detach (GimpDrawable *drawable);
|
||||
void gimp_drawable_flush (GimpDrawable *drawable);
|
||||
void gimp_drawable_delete (GimpDrawable *drawable);
|
||||
gchar * gimp_drawable_name (gint32 drawable_ID);
|
||||
gboolean gimp_drawable_visible (gint32 drawable_ID);
|
||||
void gimp_drawable_set_name (gint32 drawable_ID,
|
||||
gchar *name);
|
||||
GimpTile * gimp_drawable_get_tile (GimpDrawable *drawable,
|
||||
gint shadow,
|
||||
gint row,
|
||||
gint col);
|
||||
GimpTile * gimp_drawable_get_tile2 (GimpDrawable *drawable,
|
||||
gint shadow,
|
||||
gint x,
|
||||
gint y);
|
||||
|
||||
|
||||
#ifdef __cplusplus
|
||||
}
|
||||
#endif /* __cplusplus */
|
||||
|
||||
#endif /* __GIMP_DRAWABLE_H__ */
|
|
@ -1,109 +1,28 @@
|
|||
/* LIBGIMP - The GIMP Library
|
||||
* Copyright (C) 1995-1997 Peter Mattis and Spencer Kimball
|
||||
/* LIBGIMP - The GIMP Library
|
||||
* Copyright (C) 1995-1997 Peter Mattis and Spencer Kimball
|
||||
*
|
||||
* gimpdrawable_pdb.c
|
||||
*
|
||||
* This library is free software; you can redistribute it and/or
|
||||
* modify it under the terms of the GNU Lesser General Public
|
||||
* License as published by the Free Software Foundation; either
|
||||
* version 2 of the License, or (at your option) any later version.
|
||||
*
|
||||
* This library 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
|
||||
* version 2 of the License, or (at your option) any later version.
|
||||
*
|
||||
* This library 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
|
||||
* Library General Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU Lesser General Public
|
||||
* License along with this library; if not, write to the
|
||||
* Free Software Foundation, Inc., 59 Temple Place - Suite 330,
|
||||
* Boston, MA 02111-1307, USA.
|
||||
*/
|
||||
*/
|
||||
|
||||
#include <string.h>
|
||||
|
||||
#include "gimp.h"
|
||||
|
||||
|
||||
#define TILE_WIDTH _gimp_tile_width
|
||||
#define TILE_HEIGHT _gimp_tile_height
|
||||
|
||||
|
||||
extern gint _gimp_tile_width;
|
||||
extern gint _gimp_tile_height;
|
||||
|
||||
|
||||
GDrawable*
|
||||
gimp_drawable_get (gint32 drawable_ID)
|
||||
{
|
||||
GDrawable *drawable;
|
||||
|
||||
drawable = g_new (GDrawable, 1);
|
||||
drawable->id = drawable_ID;
|
||||
drawable->width = gimp_drawable_width (drawable_ID);
|
||||
drawable->height = gimp_drawable_height (drawable_ID);
|
||||
drawable->bpp = gimp_drawable_bpp (drawable_ID);
|
||||
drawable->ntile_rows = (drawable->height + TILE_HEIGHT - 1) / TILE_HEIGHT;
|
||||
drawable->ntile_cols = (drawable->width + TILE_WIDTH - 1) / TILE_WIDTH;
|
||||
drawable->tiles = NULL;
|
||||
drawable->shadow_tiles = NULL;
|
||||
|
||||
return drawable;
|
||||
}
|
||||
|
||||
void
|
||||
gimp_drawable_detach (GDrawable *drawable)
|
||||
{
|
||||
if (drawable)
|
||||
{
|
||||
gimp_drawable_flush (drawable);
|
||||
if (drawable->tiles)
|
||||
g_free (drawable->tiles);
|
||||
if (drawable->shadow_tiles)
|
||||
g_free (drawable->shadow_tiles);
|
||||
g_free (drawable);
|
||||
}
|
||||
}
|
||||
|
||||
void
|
||||
gimp_drawable_flush (GDrawable *drawable)
|
||||
{
|
||||
GTile *tiles;
|
||||
gint ntiles;
|
||||
gint i;
|
||||
|
||||
if (drawable)
|
||||
{
|
||||
if (drawable->tiles)
|
||||
{
|
||||
tiles = drawable->tiles;
|
||||
ntiles = drawable->ntile_rows * drawable->ntile_cols;
|
||||
|
||||
for (i = 0; i < ntiles; i++)
|
||||
if ((tiles[i].ref_count > 0) && tiles[i].dirty)
|
||||
gimp_tile_flush (&tiles[i]);
|
||||
}
|
||||
|
||||
if (drawable->shadow_tiles)
|
||||
{
|
||||
tiles = drawable->shadow_tiles;
|
||||
ntiles = drawable->ntile_rows * drawable->ntile_cols;
|
||||
|
||||
for (i = 0; i < ntiles; i++)
|
||||
if ((tiles[i].ref_count > 0) && tiles[i].dirty)
|
||||
gimp_tile_flush (&tiles[i]);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
void
|
||||
gimp_drawable_delete (GDrawable *drawable)
|
||||
{
|
||||
if (drawable)
|
||||
{
|
||||
if (gimp_drawable_is_layer (drawable->id))
|
||||
gimp_layer_delete (drawable->id);
|
||||
else
|
||||
gimp_channel_delete (drawable->id);
|
||||
}
|
||||
}
|
||||
|
||||
void
|
||||
gimp_drawable_update (gint32 drawable_ID,
|
||||
gint x,
|
||||
|
@ -163,14 +82,6 @@ gimp_drawable_image_id (gint32 drawable_ID)
|
|||
return image_ID;
|
||||
}
|
||||
|
||||
gchar*
|
||||
gimp_drawable_name (gint32 drawable_ID)
|
||||
{
|
||||
if (gimp_drawable_is_layer (drawable_ID))
|
||||
return gimp_layer_get_name (drawable_ID);
|
||||
return gimp_channel_get_name (drawable_ID);
|
||||
}
|
||||
|
||||
guint
|
||||
gimp_drawable_width (gint32 drawable_ID)
|
||||
{
|
||||
|
@ -255,15 +166,6 @@ gimp_drawable_type (gint32 drawable_ID)
|
|||
return result;
|
||||
}
|
||||
|
||||
gboolean
|
||||
gimp_drawable_visible (gint32 drawable_ID)
|
||||
{
|
||||
if (gimp_drawable_is_layer (drawable_ID))
|
||||
return gimp_layer_get_visible (drawable_ID);
|
||||
|
||||
return gimp_channel_get_visible (drawable_ID);
|
||||
}
|
||||
|
||||
gboolean
|
||||
gimp_drawable_is_channel (gint32 drawable_ID)
|
||||
{
|
||||
|
@ -480,105 +382,6 @@ gimp_drawable_fill (gint32 drawable_ID,
|
|||
gimp_destroy_params (return_vals, nreturn_vals);
|
||||
}
|
||||
|
||||
void
|
||||
gimp_drawable_set_name (gint32 drawable_ID,
|
||||
gchar *name)
|
||||
{
|
||||
if (gimp_drawable_is_layer (drawable_ID))
|
||||
gimp_layer_set_name (drawable_ID, name);
|
||||
else
|
||||
gimp_channel_set_name (drawable_ID, name);
|
||||
}
|
||||
|
||||
void
|
||||
gimp_drawable_set_visible (gint32 drawable_ID,
|
||||
gint visible)
|
||||
{
|
||||
if (gimp_drawable_is_layer (drawable_ID))
|
||||
gimp_layer_set_visible (drawable_ID, visible);
|
||||
else
|
||||
gimp_channel_set_visible (drawable_ID, visible);
|
||||
}
|
||||
|
||||
GTile*
|
||||
gimp_drawable_get_tile (GDrawable *drawable,
|
||||
gint shadow,
|
||||
gint row,
|
||||
gint col)
|
||||
{
|
||||
GTile *tiles;
|
||||
guint right_tile;
|
||||
guint bottom_tile;
|
||||
gint ntiles;
|
||||
gint tile_num;
|
||||
gint i, j, k;
|
||||
|
||||
if (drawable)
|
||||
{
|
||||
if (shadow)
|
||||
tiles = drawable->shadow_tiles;
|
||||
else
|
||||
tiles = drawable->tiles;
|
||||
|
||||
if (!tiles)
|
||||
{
|
||||
ntiles = drawable->ntile_rows * drawable->ntile_cols;
|
||||
tiles = g_new (GTile, ntiles);
|
||||
|
||||
right_tile = drawable->width - ((drawable->ntile_cols - 1) * TILE_WIDTH);
|
||||
bottom_tile = drawable->height - ((drawable->ntile_rows - 1) * TILE_HEIGHT);
|
||||
|
||||
for (i = 0, k = 0; i < drawable->ntile_rows; i++)
|
||||
{
|
||||
for (j = 0; j < drawable->ntile_cols; j++, k++)
|
||||
{
|
||||
tiles[k].bpp = drawable->bpp;
|
||||
tiles[k].tile_num = k;
|
||||
tiles[k].ref_count = 0;
|
||||
tiles[k].dirty = FALSE;
|
||||
tiles[k].shadow = shadow;
|
||||
tiles[k].data = NULL;
|
||||
tiles[k].drawable = drawable;
|
||||
|
||||
if (j == (drawable->ntile_cols - 1))
|
||||
tiles[k].ewidth = right_tile;
|
||||
else
|
||||
tiles[k].ewidth = TILE_WIDTH;
|
||||
|
||||
if (i == (drawable->ntile_rows - 1))
|
||||
tiles[k].eheight = bottom_tile;
|
||||
else
|
||||
tiles[k].eheight = TILE_HEIGHT;
|
||||
}
|
||||
}
|
||||
|
||||
if (shadow)
|
||||
drawable->shadow_tiles = tiles;
|
||||
else
|
||||
drawable->tiles = tiles;
|
||||
}
|
||||
|
||||
tile_num = row * drawable->ntile_cols + col;
|
||||
return &tiles[tile_num];
|
||||
}
|
||||
|
||||
return NULL;
|
||||
}
|
||||
|
||||
GTile*
|
||||
gimp_drawable_get_tile2 (GDrawable *drawable,
|
||||
gint shadow,
|
||||
gint x,
|
||||
gint y)
|
||||
{
|
||||
gint row, col;
|
||||
|
||||
col = x / TILE_WIDTH;
|
||||
row = y / TILE_HEIGHT;
|
||||
|
||||
return gimp_drawable_get_tile (drawable, shadow, row, col);
|
||||
}
|
||||
|
||||
GimpParasite *
|
||||
gimp_drawable_parasite_find (gint32 drawable_ID,
|
||||
const gchar *name)
|
||||
|
@ -690,5 +493,3 @@ gimp_drawable_get_thumbnail_data (gint32 drawable_ID,
|
|||
|
||||
return drawable_data;
|
||||
}
|
||||
|
||||
|
||||
|
|
|
@ -0,0 +1,113 @@
|
|||
/* LIBGIMP - The GIMP Library
|
||||
* Copyright (C) 1995-1997 Peter Mattis and Spencer Kimball
|
||||
*
|
||||
* gimpdrawable_pdb.h
|
||||
*
|
||||
* This library is free software; you can redistribute it and/or
|
||||
* modify it under the terms of the GNU Lesser General Public
|
||||
* License as published by the Free Software Foundation; either
|
||||
* version 2 of the License, or (at your option) any later version.
|
||||
*
|
||||
* This library 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
|
||||
* Lesser General Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU Lesser General Public
|
||||
* License along with this library; if not, write to the
|
||||
* Free Software Foundation, Inc., 59 Temple Place - Suite 330,
|
||||
* Boston, MA 02111-1307, USA.
|
||||
*/
|
||||
|
||||
#ifndef __GIMP_DRAWABLE_PDB_H__
|
||||
#define __GIMP_DRAWABLE_PDB_H__
|
||||
|
||||
#ifdef __cplusplus
|
||||
extern "C" {
|
||||
#endif /* __cplusplus */
|
||||
|
||||
/* For information look into the C source or the html documentation */
|
||||
|
||||
|
||||
struct _GimpDrawable
|
||||
{
|
||||
gint32 id; /* drawable ID */
|
||||
guint width; /* width of drawble */
|
||||
guint height; /* height of drawble */
|
||||
guint bpp; /* bytes per pixel of drawable */
|
||||
guint ntile_rows; /* # of tile rows */
|
||||
guint ntile_cols; /* # of tile columns */
|
||||
GimpTile *tiles; /* the normal tiles */
|
||||
GimpTile *shadow_tiles; /* the shadow tiles */
|
||||
};
|
||||
|
||||
|
||||
GimpDrawable * gimp_drawable_get (gint32 drawable_ID);
|
||||
void gimp_drawable_detach (GimpDrawable *drawable);
|
||||
void gimp_drawable_flush (GimpDrawable *drawable);
|
||||
void gimp_drawable_delete (GimpDrawable *drawable);
|
||||
void gimp_drawable_update (gint32 drawable_ID,
|
||||
gint x,
|
||||
gint y,
|
||||
guint width,
|
||||
guint height);
|
||||
void gimp_drawable_merge_shadow (gint32 drawable_ID,
|
||||
gboolean undoable);
|
||||
gint32 gimp_drawable_image_id (gint32 drawable_ID);
|
||||
gchar * gimp_drawable_name (gint32 drawable_ID);
|
||||
guint gimp_drawable_width (gint32 drawable_ID);
|
||||
guint gimp_drawable_height (gint32 drawable_ID);
|
||||
guint gimp_drawable_bpp (gint32 drawable_ID);
|
||||
GimpImageType gimp_drawable_type (gint32 drawable_ID);
|
||||
gboolean gimp_drawable_visible (gint32 drawable_ID);
|
||||
gboolean gimp_drawable_is_channel (gint32 drawable_ID);
|
||||
gboolean gimp_drawable_is_rgb (gint32 drawable_ID);
|
||||
gboolean gimp_drawable_is_gray (gint32 drawable_ID);
|
||||
gboolean gimp_drawable_has_alpha (gint32 drawable_ID);
|
||||
gboolean gimp_drawable_is_indexed (gint32 drawable_ID);
|
||||
gboolean gimp_drawable_is_layer (gint32 drawable_ID);
|
||||
gboolean gimp_drawable_is_layer_mask (gint32 drawable_ID);
|
||||
gboolean gimp_drawable_mask_bounds (gint32 drawable_ID,
|
||||
gint *x1,
|
||||
gint *y1,
|
||||
gint *x2,
|
||||
gint *y2);
|
||||
void gimp_drawable_offsets (gint32 drawable_ID,
|
||||
gint *offset_x,
|
||||
gint *offset_y);
|
||||
void gimp_drawable_fill (gint32 drawable_ID,
|
||||
GimpFillType fill_type);
|
||||
void gimp_drawable_set_name (gint32 drawable_ID,
|
||||
gchar *name);
|
||||
void gimp_drawable_set_visible (gint32 drawable_ID,
|
||||
gint visible);
|
||||
GimpTile * gimp_drawable_get_tile (GimpDrawable *drawable,
|
||||
gint shadow,
|
||||
gint row,
|
||||
gint col);
|
||||
GimpTile * gimp_drawable_get_tile2 (GimpDrawable *drawable,
|
||||
gint shadow,
|
||||
gint x,
|
||||
gint y);
|
||||
GimpParasite * gimp_drawable_parasite_find (gint32 drawable_ID,
|
||||
const gchar *name);
|
||||
void gimp_drawable_parasite_attach (gint32 drawable_ID,
|
||||
const GimpParasite *parasite);
|
||||
void gimp_drawable_attach_new_parasite (gint32 drawable_ID,
|
||||
const gchar *name,
|
||||
gint flags,
|
||||
gint size,
|
||||
const gpointer data);
|
||||
void gimp_drawable_parasite_detach (gint32 drawable_ID,
|
||||
const gchar *name);
|
||||
guchar * gimp_drawable_get_thumbnail_data (gint32 drawable_ID,
|
||||
gint *width,
|
||||
gint *height,
|
||||
gint *bytes);
|
||||
|
||||
|
||||
#ifdef __cplusplus
|
||||
}
|
||||
#endif /* __cplusplus */
|
||||
|
||||
#endif /* __GIMP_DRAWABLE_PDB_H__ */
|
|
@ -1,31 +1,34 @@
|
|||
/* LIBGIMP - The GIMP Library
|
||||
* Copyright (C) 1995-1997 Peter Mattis and Spencer Kimball
|
||||
/* LIBGIMP - The GIMP Library
|
||||
* Copyright (C) 1995-1997 Peter Mattis and Spencer Kimball
|
||||
*
|
||||
* gimpgradient_pdb.c
|
||||
*
|
||||
* This library is free software; you can redistribute it and/or
|
||||
* modify it under the terms of the GNU Lesser General Public
|
||||
* License as published by the Free Software Foundation; either
|
||||
* version 2 of the License, or (at your option) any later version.
|
||||
*
|
||||
* This library 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
|
||||
* version 2 of the License, or (at your option) any later version.
|
||||
*
|
||||
* This library 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
|
||||
* Library General Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU Lesser General Public
|
||||
* License along with this library; if not, write to the
|
||||
* Free Software Foundation, Inc., 59 Temple Place - Suite 330,
|
||||
* Boston, MA 02111-1307, USA.
|
||||
*/
|
||||
*/
|
||||
|
||||
#include "gimp.h"
|
||||
|
||||
|
||||
char **
|
||||
gimp_gradients_get_list(gint *num_gradients)
|
||||
gchar **
|
||||
gimp_gradients_get_list (gint *num_gradients)
|
||||
{
|
||||
GParam *return_vals;
|
||||
int nreturn_vals;
|
||||
char **gradient_names;
|
||||
int i;
|
||||
gint nreturn_vals;
|
||||
gchar **gradient_names;
|
||||
gint i;
|
||||
|
||||
return_vals = gimp_run_procedure ("gimp_gradients_get_list",
|
||||
&nreturn_vals,
|
||||
|
@ -47,12 +50,12 @@ gimp_gradients_get_list(gint *num_gradients)
|
|||
}
|
||||
|
||||
|
||||
char *
|
||||
gimp_gradients_get_active(void)
|
||||
gchar *
|
||||
gimp_gradients_get_active (void)
|
||||
{
|
||||
GParam *return_vals;
|
||||
int nreturn_vals;
|
||||
char *result;
|
||||
gint nreturn_vals;
|
||||
gchar *result;
|
||||
|
||||
return_vals = gimp_run_procedure ("gimp_gradients_get_active",
|
||||
&nreturn_vals,
|
||||
|
@ -70,10 +73,10 @@ gimp_gradients_get_active(void)
|
|||
|
||||
|
||||
void
|
||||
gimp_gradients_set_active(char *name)
|
||||
gimp_gradients_set_active (gchar *name)
|
||||
{
|
||||
GParam *return_vals;
|
||||
int nreturn_vals;
|
||||
gint nreturn_vals;
|
||||
|
||||
return_vals = gimp_run_procedure ("gimp_gradients_set_active",
|
||||
&nreturn_vals,
|
||||
|
@ -84,13 +87,13 @@ gimp_gradients_set_active(char *name)
|
|||
|
||||
|
||||
gdouble *
|
||||
gimp_gradients_sample_uniform(gint num_samples)
|
||||
gimp_gradients_sample_uniform (gint num_samples)
|
||||
{
|
||||
GParam *return_vals;
|
||||
int nreturn_vals;
|
||||
gint nreturn_vals;
|
||||
gdouble *result;
|
||||
int nresult;
|
||||
int i;
|
||||
gint nresult;
|
||||
gint i;
|
||||
|
||||
return_vals = gimp_run_procedure ("gimp_gradients_sample_uniform",
|
||||
&nreturn_vals,
|
||||
|
@ -114,13 +117,14 @@ gimp_gradients_sample_uniform(gint num_samples)
|
|||
|
||||
|
||||
gdouble *
|
||||
gimp_gradients_sample_custom(gint num_samples, gdouble *positions)
|
||||
gimp_gradients_sample_custom (gint num_samples,
|
||||
gdouble *positions)
|
||||
{
|
||||
GParam *return_vals;
|
||||
int nreturn_vals;
|
||||
gint nreturn_vals;
|
||||
gdouble *result;
|
||||
int nresult;
|
||||
int i;
|
||||
gint nresult;
|
||||
gint i;
|
||||
|
||||
return_vals = gimp_run_procedure ("gimp_gradients_sample_custom",
|
||||
&nreturn_vals,
|
||||
|
|
|
@ -0,0 +1,44 @@
|
|||
/* LIBGIMP - The GIMP Library
|
||||
* Copyright (C) 1995-1997 Peter Mattis and Spencer Kimball
|
||||
*
|
||||
* gimpgradient_pdb.h
|
||||
*
|
||||
* This library is free software; you can redistribute it and/or
|
||||
* modify it under the terms of the GNU Lesser General Public
|
||||
* License as published by the Free Software Foundation; either
|
||||
* version 2 of the License, or (at your option) any later version.
|
||||
*
|
||||
* This library 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
|
||||
* Lesser General Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU Lesser General Public
|
||||
* License along with this library; if not, write to the
|
||||
* Free Software Foundation, Inc., 59 Temple Place - Suite 330,
|
||||
* Boston, MA 02111-1307, USA.
|
||||
*/
|
||||
|
||||
#ifndef __GIMP_GRADIENT_PDB_H__
|
||||
#define __GIMP_GRADIENT_PDB_H__
|
||||
|
||||
#ifdef __cplusplus
|
||||
extern "C" {
|
||||
#endif /* __cplusplus */
|
||||
|
||||
/* For information look into the C source or the html documentation */
|
||||
|
||||
|
||||
gchar ** gimp_gradients_get_list (gint *num_gradients);
|
||||
gchar * gimp_gradients_get_active (void);
|
||||
void gimp_gradients_set_active (gchar *name);
|
||||
gdouble * gimp_gradients_sample_uniform (gint num_samples);
|
||||
gdouble * gimp_gradients_sample_custom (gint num_samples,
|
||||
gdouble *positions);
|
||||
|
||||
|
||||
#ifdef __cplusplus
|
||||
}
|
||||
#endif /* __cplusplus */
|
||||
|
||||
#endif /* __GIMP_GRADIENT_PDB_H__ */
|
|
@ -1,5 +1,7 @@
|
|||
/* LIBGIMP - The GIMP Library
|
||||
* Copyright (C) 1995-1997 Peter Mattis and Spencer Kimball
|
||||
*
|
||||
* gimpgradientmenu.c
|
||||
* Copyright (C) 1998 Andy Thomas
|
||||
*
|
||||
* This library is free software; you can redistribute it and/or
|
||||
|
@ -28,7 +30,7 @@
|
|||
* completely controls the selection of a gradient.
|
||||
* you get a widget returned that you can use in a table say.
|
||||
* In:- Initial gradient name. Null means use current selection.
|
||||
* pointer to func to call when gradient changes (GRunGradientCallback).
|
||||
* pointer to func to call when gradient changes (GimpRunGradientCallback).
|
||||
* Returned:- Pointer to a widget that you can use in UI.
|
||||
*
|
||||
* Widget simply made up of a preview widget (20x40) containing the gradient
|
||||
|
@ -43,24 +45,24 @@
|
|||
|
||||
struct __gradients_sel
|
||||
{
|
||||
gchar *dname;
|
||||
GRunGradientCallback cback;
|
||||
GtkWidget *gradient_preview;
|
||||
GtkWidget *button;
|
||||
GtkWidget *gradient_popup_pnt;
|
||||
gint width;
|
||||
gchar *gradient_name; /* Local copy */
|
||||
gdouble *grad_data; /* local copy */
|
||||
gint sample_size;
|
||||
gpointer data;
|
||||
};
|
||||
gchar *dname;
|
||||
GimpRunGradientCallback cback;
|
||||
GtkWidget *gradient_preview;
|
||||
GtkWidget *button;
|
||||
GtkWidget *gradient_popup_pnt;
|
||||
gint width;
|
||||
gchar *gradient_name; /* Local copy */
|
||||
gdouble *grad_data; /* local copy */
|
||||
gint sample_size;
|
||||
gpointer data;
|
||||
};
|
||||
|
||||
typedef struct __gradients_sel GSelect;
|
||||
|
||||
static void
|
||||
gradient_pre_update(GtkWidget *gradient_preview,
|
||||
gint width_data,
|
||||
gdouble *grad_data)
|
||||
gradient_pre_update (GtkWidget *gradient_preview,
|
||||
gint width_data,
|
||||
gdouble *grad_data)
|
||||
{
|
||||
gint x;
|
||||
gint y;
|
||||
|
@ -144,7 +146,7 @@ gradient_select_invoker (gchar *name,
|
|||
|
||||
gsel->gradient_name = g_strdup (name);
|
||||
/* one row only each row has four doubles r,g,b,a */
|
||||
gsel->grad_data = g_malloc (width * sizeof (gdouble));
|
||||
gsel->grad_data = g_new (gdouble, width);
|
||||
/* printf("name = %s width = %d\n",name,width);*/
|
||||
g_memmove (gsel->grad_data, grad_data, width * sizeof (gdouble));
|
||||
gradient_pre_update (gsel->gradient_preview, gsel->width, gsel->grad_data);
|
||||
|
@ -175,10 +177,10 @@ gradient_preview_callback (GtkWidget *widget,
|
|||
}
|
||||
|
||||
GtkWidget *
|
||||
gimp_gradient_select_widget (gchar *dname,
|
||||
gchar *igradient,
|
||||
GRunGradientCallback cback,
|
||||
gpointer data)
|
||||
gimp_gradient_select_widget (gchar *dname,
|
||||
gchar *igradient,
|
||||
GimpRunGradientCallback cback,
|
||||
gpointer data)
|
||||
{
|
||||
GtkWidget *button;
|
||||
GtkWidget *hbox;
|
||||
|
|
|
@ -0,0 +1,29 @@
|
|||
/* LIBGIMP - The GIMP Library
|
||||
* Copyright (C) 1995 Spencer Kimball and Peter Mattis
|
||||
*
|
||||
* gimphelp.c
|
||||
* Copyright (C) 2000 Michael Natterer <mitch@gimp.org>
|
||||
*
|
||||
* This library is free software; you can redistribute it and/or
|
||||
* modify it under the terms of the GNU Lesser General Public
|
||||
* License as published by the Free Software Foundation; either
|
||||
* version 2 of the License, or (at your option) any later version.
|
||||
*
|
||||
* This library 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
|
||||
* Library General Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU Lesser General Public
|
||||
* License along with this library; if not, write to the
|
||||
* Free Software Foundation, Inc., 59 Temple Place - Suite 330,
|
||||
* Boston, MA 02111-1307, USA.
|
||||
*/
|
||||
|
||||
#include "gimp.h"
|
||||
|
||||
void
|
||||
gimp_standard_help_func (gchar *help_data)
|
||||
{
|
||||
gimp_help (gimp_get_progname (), help_data);
|
||||
}
|
|
@ -1,4 +1,4 @@
|
|||
/* LIBGIMP - The GIMP Library
|
||||
/* LIBGIMP - The GIMP Library
|
||||
* Copyright (C) 1995 Spencer Kimball and Peter Mattis
|
||||
*
|
||||
* gimphelp_pdb.c
|
||||
|
@ -7,11 +7,11 @@
|
|||
* This library is free software; you can redistribute it and/or
|
||||
* modify it under the terms of the GNU Lesser General Public
|
||||
* License as published by the Free Software Foundation; either
|
||||
* version 2 of the License, or (at your option) any later version.
|
||||
*
|
||||
* This library 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
|
||||
* version 2 of the License, or (at your option) any later version.
|
||||
*
|
||||
* This library 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
|
||||
* Library General Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU Lesser General Public
|
||||
|
@ -19,16 +19,9 @@
|
|||
* Free Software Foundation, Inc., 59 Temple Place - Suite 330,
|
||||
* Boston, MA 02111-1307, USA.
|
||||
*/
|
||||
#include <gtk/gtk.h>
|
||||
|
||||
#include "gimp.h"
|
||||
|
||||
void
|
||||
gimp_standard_help_func (gchar *help_data)
|
||||
{
|
||||
gimp_help (gimp_get_progname (), help_data);
|
||||
}
|
||||
|
||||
void
|
||||
gimp_help (gchar *prog_name,
|
||||
gchar *help_data)
|
||||
|
|
|
@ -0,0 +1,41 @@
|
|||
/* LIBGIMP - The GIMP Library
|
||||
* Copyright (C) 1995-1997 Peter Mattis and Spencer Kimball
|
||||
*
|
||||
* gimphelp_pdb.h
|
||||
*
|
||||
* This library is free software; you can redistribute it and/or
|
||||
* modify it under the terms of the GNU Lesser General Public
|
||||
* License as published by the Free Software Foundation; either
|
||||
* version 2 of the License, or (at your option) any later version.
|
||||
*
|
||||
* This library 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
|
||||
* Lesser General Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU Lesser General Public
|
||||
* License along with this library; if not, write to the
|
||||
* Free Software Foundation, Inc., 59 Temple Place - Suite 330,
|
||||
* Boston, MA 02111-1307, USA.
|
||||
*/
|
||||
|
||||
#ifndef __GIMP_HELP_PDB_H__
|
||||
#define __GIMP_HELP_PDB_H__
|
||||
|
||||
#ifdef __cplusplus
|
||||
extern "C" {
|
||||
#endif /* __cplusplus */
|
||||
|
||||
/* For information look into the C source or the html documentation */
|
||||
|
||||
|
||||
void gimp_help (gchar *prog_name,
|
||||
gchar *help_data);
|
||||
void gimp_plugin_help_register (gchar *help_path);
|
||||
|
||||
|
||||
#ifdef __cplusplus
|
||||
}
|
||||
#endif /* __cplusplus */
|
||||
|
||||
#endif /* __GIMP_HELP_PDB_H__ */
|
|
@ -1,6 +1,8 @@
|
|||
/* LIBGIMP - The GIMP Library
|
||||
/* LIBGIMP - The GIMP Library
|
||||
* Copyright (C) 1995-1997 Peter Mattis and Spencer Kimball
|
||||
*
|
||||
* gimpimage_pdb.c
|
||||
*
|
||||
* This library is free software; you can redistribute it and/or
|
||||
* modify it under the terms of the GNU Lesser General Public
|
||||
* License as published by the Free Software Foundation; either
|
||||
|
@ -18,6 +20,7 @@
|
|||
*/
|
||||
|
||||
#include <string.h>
|
||||
|
||||
#include "gimp.h"
|
||||
|
||||
|
||||
|
@ -154,9 +157,6 @@ gimp_image_get_guide_position (gint32 image_id,
|
|||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
gint32
|
||||
gimp_image_new (guint width,
|
||||
guint height,
|
||||
|
@ -1274,4 +1274,3 @@ gimp_image_convert_indexed (gint32 image_ID,
|
|||
|
||||
gimp_destroy_params (return_vals, nreturn_vals);
|
||||
}
|
||||
|
||||
|
|
|
@ -0,0 +1,174 @@
|
|||
/* LIBGIMP - The GIMP Library
|
||||
* Copyright (C) 1995-1997 Peter Mattis and Spencer Kimball
|
||||
*
|
||||
* gimpimage_pdb.h
|
||||
*
|
||||
* This library is free software; you can redistribute it and/or
|
||||
* modify it under the terms of the GNU Lesser General Public
|
||||
* License as published by the Free Software Foundation; either
|
||||
* version 2 of the License, or (at your option) any later version.
|
||||
*
|
||||
* This library 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
|
||||
* Lesser General Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU Lesser General Public
|
||||
* License along with this library; if not, write to the
|
||||
* Free Software Foundation, Inc., 59 Temple Place - Suite 330,
|
||||
* Boston, MA 02111-1307, USA.
|
||||
*/
|
||||
|
||||
#ifndef __GIMP_IMAGE_PDB_H__
|
||||
#define __GIMP_IMAGE_PDB_H__
|
||||
|
||||
#ifdef __cplusplus
|
||||
extern "C" {
|
||||
#endif /* __cplusplus */
|
||||
|
||||
/* For information look into the C source or the html documentation */
|
||||
|
||||
|
||||
gint32 gimp_image_new (guint width,
|
||||
guint height,
|
||||
GimpImageBaseType type);
|
||||
gint32 gimp_image_duplicate (gint32 image_ID);
|
||||
void gimp_image_delete (gint32 image_ID);
|
||||
guint gimp_image_width (gint32 image_ID);
|
||||
guint gimp_image_height (gint32 image_ID);
|
||||
GimpImageBaseType gimp_image_base_type (gint32 image_ID);
|
||||
gint32 gimp_image_floating_selection (gint32 image_ID);
|
||||
void gimp_image_add_channel (gint32 image_ID,
|
||||
gint32 channel_ID,
|
||||
gint position);
|
||||
void gimp_image_add_layer (gint32 image_ID,
|
||||
gint32 layer_ID,
|
||||
gint position);
|
||||
void gimp_image_add_layer_mask (gint32 image_ID,
|
||||
gint32 layer_ID,
|
||||
gint32 mask_ID);
|
||||
void gimp_image_clean_all (gint32 image_ID);
|
||||
void gimp_image_undo_disable (gint32 image_ID);
|
||||
void gimp_image_undo_enable (gint32 image_ID);
|
||||
void gimp_image_undo_freeze (gint32 image_ID);
|
||||
void gimp_image_undo_thaw (gint32 image_ID);
|
||||
void gimp_undo_push_group_start (gint32 image_ID);
|
||||
void gimp_undo_push_group_end (gint32 image_ID);
|
||||
void gimp_image_clean_all (gint32 image_ID);
|
||||
gint32 gimp_image_flatten (gint32 image_ID);
|
||||
void gimp_image_lower_channel (gint32 image_ID,
|
||||
gint32 channel_ID);
|
||||
void gimp_image_lower_layer (gint32 image_ID,
|
||||
gint32 layer_ID);
|
||||
gint32 gimp_image_merge_visible_layers (gint32 image_ID,
|
||||
GimpMergeType merge_type);
|
||||
gint32 gimp_image_pick_correlate_layer (gint32 image_ID,
|
||||
gint x,
|
||||
gint y);
|
||||
void gimp_image_raise_channel (gint32 image_ID,
|
||||
gint32 channel_ID);
|
||||
void gimp_image_raise_layer (gint32 image_ID,
|
||||
gint32 layer_ID);
|
||||
void gimp_image_remove_channel (gint32 image_ID,
|
||||
gint32 channel_ID);
|
||||
void gimp_image_remove_layer (gint32 image_ID,
|
||||
gint32 layer_ID);
|
||||
void gimp_image_remove_layer_mask (gint32 image_ID,
|
||||
gint32 layer_ID,
|
||||
gint mode);
|
||||
void gimp_image_resize (gint32 image_ID,
|
||||
guint new_width,
|
||||
guint new_height,
|
||||
gint offset_x,
|
||||
gint offset_y);
|
||||
gint32 gimp_image_get_active_channel (gint32 image_ID);
|
||||
gint32 gimp_image_get_active_layer (gint32 image_ID);
|
||||
gint32 * gimp_image_get_channels (gint32 image_ID,
|
||||
gint *nchannels);
|
||||
guchar * gimp_image_get_cmap (gint32 image_ID,
|
||||
gint *ncolors);
|
||||
gboolean gimp_image_get_component_active (gint32 image_ID,
|
||||
gint component);
|
||||
gboolean gimp_image_get_component_visible (gint32 image_ID,
|
||||
gint component);
|
||||
gchar * gimp_image_get_filename (gint32 image_ID);
|
||||
gint32 * gimp_image_get_layers (gint32 image_ID,
|
||||
gint *nlayers);
|
||||
gint32 gimp_image_get_selection (gint32 image_ID);
|
||||
void gimp_image_set_active_channel (gint32 image_ID,
|
||||
gint32 channel_ID);
|
||||
void gimp_image_set_active_layer (gint32 image_ID,
|
||||
gint32 layer_ID);
|
||||
void gimp_image_set_cmap (gint32 image_ID,
|
||||
guchar *cmap,
|
||||
gint ncolors);
|
||||
void gimp_image_set_component_active (gint32 image_ID,
|
||||
gint component,
|
||||
gboolean active);
|
||||
void gimp_image_set_component_visible (gint32 image_ID,
|
||||
gint component,
|
||||
gboolean visible);
|
||||
void gimp_image_set_filename (gint32 image_ID,
|
||||
gchar *name);
|
||||
GimpParasite * gimp_image_parasite_find (gint32 image_ID,
|
||||
const gchar *name);
|
||||
void gimp_image_parasite_attach (gint32 image_ID,
|
||||
const GimpParasite *parasite);
|
||||
void gimp_image_attach_new_parasite (gint32 image_ID,
|
||||
const gchar *name,
|
||||
gint flags,
|
||||
gint size,
|
||||
const gpointer data);
|
||||
void gimp_image_parasite_detach (gint32 image_ID,
|
||||
const gchar *name);
|
||||
void gimp_image_set_resolution (gint32 image_ID,
|
||||
gdouble xresolution,
|
||||
gdouble yresolution);
|
||||
void gimp_image_get_resolution (gint32 image_ID,
|
||||
gdouble *xresolution,
|
||||
gdouble *yresolution);
|
||||
void gimp_image_set_unit (gint32 image_ID,
|
||||
GimpUnit unit);
|
||||
GimpUnit gimp_image_get_unit (gint32 image_ID);
|
||||
gint32 gimp_image_get_layer_by_tattoo (gint32 image_ID,
|
||||
gint32 tattoo);
|
||||
gint32 gimp_image_get_channel_by_tattoo (gint32 image_ID,
|
||||
gint32 tattoo);
|
||||
|
||||
guchar * gimp_image_get_thumbnail_data (gint32 image_ID,
|
||||
gint *width,
|
||||
gint *height,
|
||||
gint *bytes);
|
||||
void gimp_image_convert_rgb (gint32 image_ID);
|
||||
void gimp_image_convert_grayscale (gint32 image_ID);
|
||||
void gimp_image_convert_indexed (gint32 image_ID,
|
||||
GimpConvertDitherType dither_type,
|
||||
GimpConvertPaletteType palette_type,
|
||||
gint num_colors,
|
||||
gint alpha_dither,
|
||||
gint remove_unused,
|
||||
gchar *palette);
|
||||
|
||||
/****************************************
|
||||
* Guides *
|
||||
****************************************/
|
||||
|
||||
gint32 gimp_image_add_hguide (gint32 image_ID,
|
||||
gint32 yposition);
|
||||
gint32 gimp_image_add_vguide (gint32 image_ID,
|
||||
gint32 xposition);
|
||||
void gimp_image_delete_guide (gint32 image_ID,
|
||||
gint32 guide_ID);
|
||||
gint32 gimp_image_find_next_guide (gint32 image_ID,
|
||||
gint32 guide_ID);
|
||||
GOrientation gimp_image_get_guide_orientation (gint32 image_ID,
|
||||
gint32 guide_ID);
|
||||
gint32 gimp_image_get_guide_position (gint32 image_ID,
|
||||
gint32 guide_ID);
|
||||
|
||||
|
||||
#ifdef __cplusplus
|
||||
}
|
||||
#endif /* __cplusplus */
|
||||
|
||||
#endif /* __GIMP_IMAGE_PDB_H__ */
|
|
@ -1,5 +1,7 @@
|
|||
/* LIBGIMP - The GIMP Library
|
||||
* Copyright (C) 1995-1997 Peter Mattis and Spencer Kimball
|
||||
* Copyright (C) 1995-1997 Peter Mattis and Spencer Kimball
|
||||
*
|
||||
* gimplayer_pdb.c
|
||||
*
|
||||
* This library is free software; you can redistribute it and/or
|
||||
* modify it under the terms of the GNU Lesser General Public
|
||||
|
@ -22,15 +24,15 @@
|
|||
|
||||
gint32
|
||||
gimp_layer_new (gint32 image_ID,
|
||||
char *name,
|
||||
gchar *name,
|
||||
guint width,
|
||||
guint height,
|
||||
GDrawableType type,
|
||||
GDrawableType type,
|
||||
gdouble opacity,
|
||||
GLayerMode mode)
|
||||
{
|
||||
GParam *return_vals;
|
||||
int nreturn_vals;
|
||||
gint nreturn_vals;
|
||||
gint32 layer_ID;
|
||||
|
||||
return_vals = gimp_run_procedure ("gimp_layer_new",
|
||||
|
@ -57,7 +59,7 @@ gint32
|
|||
gimp_layer_copy (gint32 layer_ID)
|
||||
{
|
||||
GParam *return_vals;
|
||||
int nreturn_vals;
|
||||
gint nreturn_vals;
|
||||
|
||||
return_vals = gimp_run_procedure ("gimp_layer_copy",
|
||||
&nreturn_vals,
|
||||
|
@ -78,7 +80,7 @@ void
|
|||
gimp_layer_delete (gint32 layer_ID)
|
||||
{
|
||||
GParam *return_vals;
|
||||
int nreturn_vals;
|
||||
gint nreturn_vals;
|
||||
|
||||
return_vals = gimp_run_procedure ("gimp_layer_delete",
|
||||
&nreturn_vals,
|
||||
|
@ -88,35 +90,11 @@ gimp_layer_delete (gint32 layer_ID)
|
|||
gimp_destroy_params (return_vals, nreturn_vals);
|
||||
}
|
||||
|
||||
guint
|
||||
gimp_layer_width (gint32 layer_ID)
|
||||
{
|
||||
return gimp_drawable_width (layer_ID);
|
||||
}
|
||||
|
||||
guint
|
||||
gimp_layer_height (gint32 layer_ID)
|
||||
{
|
||||
return gimp_drawable_height (layer_ID);
|
||||
}
|
||||
|
||||
guint
|
||||
gimp_layer_bpp (gint32 layer_ID)
|
||||
{
|
||||
return gimp_drawable_bpp (layer_ID);
|
||||
}
|
||||
|
||||
GDrawableType
|
||||
gimp_layer_type (gint32 layer_ID)
|
||||
{
|
||||
return gimp_drawable_type (layer_ID);
|
||||
}
|
||||
|
||||
void
|
||||
gimp_layer_add_alpha (gint32 layer_ID)
|
||||
{
|
||||
GParam *return_vals;
|
||||
int nreturn_vals;
|
||||
gint nreturn_vals;
|
||||
|
||||
return_vals = gimp_run_procedure ("gimp_layer_add_alpha",
|
||||
&nreturn_vals,
|
||||
|
@ -131,7 +109,7 @@ gimp_layer_create_mask (gint32 layer_ID,
|
|||
GimpAddMaskType mask_type)
|
||||
{
|
||||
GParam *return_vals;
|
||||
int nreturn_vals;
|
||||
gint nreturn_vals;
|
||||
gint32 mask_ID;
|
||||
|
||||
return_vals = gimp_run_procedure ("gimp_layer_create_mask",
|
||||
|
@ -157,7 +135,7 @@ gimp_layer_resize (gint32 layer_ID,
|
|||
gint offset_y)
|
||||
{
|
||||
GParam *return_vals;
|
||||
int nreturn_vals;
|
||||
gint nreturn_vals;
|
||||
|
||||
return_vals = gimp_run_procedure ("gimp_layer_resize",
|
||||
&nreturn_vals,
|
||||
|
@ -178,7 +156,7 @@ gimp_layer_scale (gint32 layer_ID,
|
|||
gint local_origin)
|
||||
{
|
||||
GParam *return_vals;
|
||||
int nreturn_vals;
|
||||
gint nreturn_vals;
|
||||
|
||||
return_vals = gimp_run_procedure ("gimp_layer_scale",
|
||||
&nreturn_vals,
|
||||
|
@ -197,7 +175,7 @@ gimp_layer_translate (gint32 layer_ID,
|
|||
gint offset_y)
|
||||
{
|
||||
GParam *return_vals;
|
||||
int nreturn_vals;
|
||||
gint nreturn_vals;
|
||||
|
||||
return_vals = gimp_run_procedure ("gimp_layer_translate",
|
||||
&nreturn_vals,
|
||||
|
@ -213,8 +191,8 @@ gint
|
|||
gimp_layer_is_floating_selection (gint32 layer_ID)
|
||||
{
|
||||
GParam *return_vals;
|
||||
int nreturn_vals;
|
||||
int result;
|
||||
gint nreturn_vals;
|
||||
gint result;
|
||||
|
||||
return_vals = gimp_run_procedure ("gimp_layer_is_floating_sel",
|
||||
&nreturn_vals,
|
||||
|
@ -240,7 +218,7 @@ gint32
|
|||
gimp_layer_get_mask_id (gint32 layer_ID)
|
||||
{
|
||||
GParam *return_vals;
|
||||
int nreturn_vals;
|
||||
gint nreturn_vals;
|
||||
gint32 mask_ID;
|
||||
|
||||
return_vals = gimp_run_procedure ("gimp_layer_mask",
|
||||
|
@ -261,8 +239,8 @@ gint
|
|||
gimp_layer_get_apply_mask (gint32 layer_ID)
|
||||
{
|
||||
GParam *return_vals;
|
||||
int nreturn_vals;
|
||||
int result;
|
||||
gint nreturn_vals;
|
||||
gint result;
|
||||
|
||||
return_vals = gimp_run_procedure ("gimp_layer_get_apply_mask",
|
||||
&nreturn_vals,
|
||||
|
@ -282,8 +260,8 @@ gint
|
|||
gimp_layer_get_edit_mask (gint32 layer_ID)
|
||||
{
|
||||
GParam *return_vals;
|
||||
int nreturn_vals;
|
||||
int result;
|
||||
gint nreturn_vals;
|
||||
gint result;
|
||||
|
||||
return_vals = gimp_run_procedure ("gimp_layer_get_edit_mask",
|
||||
&nreturn_vals,
|
||||
|
@ -303,8 +281,8 @@ GLayerMode
|
|||
gimp_layer_get_mode (gint32 layer_ID)
|
||||
{
|
||||
GParam *return_vals;
|
||||
int nreturn_vals;
|
||||
int result;
|
||||
gint nreturn_vals;
|
||||
gint result;
|
||||
|
||||
return_vals = gimp_run_procedure ("gimp_layer_get_mode",
|
||||
&nreturn_vals,
|
||||
|
@ -320,12 +298,12 @@ gimp_layer_get_mode (gint32 layer_ID)
|
|||
return result;
|
||||
}
|
||||
|
||||
char*
|
||||
gchar *
|
||||
gimp_layer_get_name (gint32 layer_ID)
|
||||
{
|
||||
GParam *return_vals;
|
||||
int nreturn_vals;
|
||||
char *result;
|
||||
gint nreturn_vals;
|
||||
gchar *result;
|
||||
|
||||
return_vals = gimp_run_procedure ("gimp_layer_get_name",
|
||||
&nreturn_vals,
|
||||
|
@ -345,7 +323,7 @@ gdouble
|
|||
gimp_layer_get_opacity (gint32 layer_ID)
|
||||
{
|
||||
GParam *return_vals;
|
||||
int nreturn_vals;
|
||||
gint nreturn_vals;
|
||||
gdouble result;
|
||||
|
||||
return_vals = gimp_run_procedure ("gimp_layer_get_opacity",
|
||||
|
@ -366,8 +344,8 @@ gint
|
|||
gimp_layer_get_preserve_transparency (gint32 layer_ID)
|
||||
{
|
||||
GParam *return_vals;
|
||||
int nreturn_vals;
|
||||
int result;
|
||||
gint nreturn_vals;
|
||||
gint result;
|
||||
|
||||
return_vals = gimp_run_procedure ("gimp_layer_get_preserve_trans",
|
||||
&nreturn_vals,
|
||||
|
@ -387,8 +365,8 @@ gint
|
|||
gimp_layer_get_show_mask (gint32 layer_ID)
|
||||
{
|
||||
GParam *return_vals;
|
||||
int nreturn_vals;
|
||||
int result;
|
||||
gint nreturn_vals;
|
||||
gint result;
|
||||
|
||||
return_vals = gimp_run_procedure ("gimp_layer_get_show_mask",
|
||||
&nreturn_vals,
|
||||
|
@ -408,8 +386,8 @@ gint
|
|||
gimp_layer_get_visible (gint32 layer_ID)
|
||||
{
|
||||
GParam *return_vals;
|
||||
int nreturn_vals;
|
||||
int result;
|
||||
gint nreturn_vals;
|
||||
gint result;
|
||||
|
||||
return_vals = gimp_run_procedure ("gimp_layer_get_visible",
|
||||
&nreturn_vals,
|
||||
|
@ -430,7 +408,7 @@ gimp_layer_set_apply_mask (gint32 layer_ID,
|
|||
gint apply_mask)
|
||||
{
|
||||
GParam *return_vals;
|
||||
int nreturn_vals;
|
||||
gint nreturn_vals;
|
||||
|
||||
return_vals = gimp_run_procedure ("gimp_layer_set_apply_mask",
|
||||
&nreturn_vals,
|
||||
|
@ -446,7 +424,7 @@ gimp_layer_set_edit_mask (gint32 layer_ID,
|
|||
gint edit_mask)
|
||||
{
|
||||
GParam *return_vals;
|
||||
int nreturn_vals;
|
||||
gint nreturn_vals;
|
||||
|
||||
return_vals = gimp_run_procedure ("gimp_layer_set_edit_mask",
|
||||
&nreturn_vals,
|
||||
|
@ -462,7 +440,7 @@ gimp_layer_set_mode (gint32 layer_ID,
|
|||
GLayerMode mode)
|
||||
{
|
||||
GParam *return_vals;
|
||||
int nreturn_vals;
|
||||
gint nreturn_vals;
|
||||
|
||||
return_vals = gimp_run_procedure ("gimp_layer_set_mode",
|
||||
&nreturn_vals,
|
||||
|
@ -475,10 +453,10 @@ gimp_layer_set_mode (gint32 layer_ID,
|
|||
|
||||
void
|
||||
gimp_layer_set_name (gint32 layer_ID,
|
||||
char *name)
|
||||
gchar *name)
|
||||
{
|
||||
GParam *return_vals;
|
||||
int nreturn_vals;
|
||||
gint nreturn_vals;
|
||||
|
||||
return_vals = gimp_run_procedure ("gimp_layer_set_name",
|
||||
&nreturn_vals,
|
||||
|
@ -491,11 +469,11 @@ gimp_layer_set_name (gint32 layer_ID,
|
|||
|
||||
void
|
||||
gimp_layer_set_offsets (gint32 layer_ID,
|
||||
int offset_x,
|
||||
int offset_y)
|
||||
gint offset_x,
|
||||
gint offset_y)
|
||||
{
|
||||
GParam *return_vals;
|
||||
int nreturn_vals;
|
||||
gint nreturn_vals;
|
||||
|
||||
return_vals = gimp_run_procedure ("gimp_layer_set_offsets",
|
||||
&nreturn_vals,
|
||||
|
@ -512,7 +490,7 @@ gimp_layer_set_opacity (gint32 layer_ID,
|
|||
gdouble opacity)
|
||||
{
|
||||
GParam *return_vals;
|
||||
int nreturn_vals;
|
||||
gint nreturn_vals;
|
||||
|
||||
return_vals = gimp_run_procedure ("gimp_layer_set_opacity",
|
||||
&nreturn_vals,
|
||||
|
@ -524,11 +502,11 @@ gimp_layer_set_opacity (gint32 layer_ID,
|
|||
}
|
||||
|
||||
void
|
||||
gimp_layer_set_preserve_transparency (gint32 layer_ID,
|
||||
int preserve_transparency)
|
||||
gimp_layer_set_preserve_transparency (gint32 layer_ID,
|
||||
gboolean preserve_transparency)
|
||||
{
|
||||
GParam *return_vals;
|
||||
int nreturn_vals;
|
||||
gint nreturn_vals;
|
||||
|
||||
return_vals = gimp_run_procedure ("gimp_layer_set_preserve_trans",
|
||||
&nreturn_vals,
|
||||
|
@ -540,11 +518,11 @@ gimp_layer_set_preserve_transparency (gint32 layer_ID,
|
|||
}
|
||||
|
||||
void
|
||||
gimp_layer_set_show_mask (gint32 layer_ID,
|
||||
gint show_mask)
|
||||
gimp_layer_set_show_mask (gint32 layer_ID,
|
||||
gboolean show_mask)
|
||||
{
|
||||
GParam *return_vals;
|
||||
int nreturn_vals;
|
||||
gint nreturn_vals;
|
||||
|
||||
return_vals = gimp_run_procedure ("gimp_layer_set_show_mask",
|
||||
&nreturn_vals,
|
||||
|
@ -556,11 +534,11 @@ gimp_layer_set_show_mask (gint32 layer_ID,
|
|||
}
|
||||
|
||||
void
|
||||
gimp_layer_set_visible (gint32 layer_ID,
|
||||
gint visible)
|
||||
gimp_layer_set_visible (gint32 layer_ID,
|
||||
gboolean visible)
|
||||
{
|
||||
GParam *return_vals;
|
||||
int nreturn_vals;
|
||||
gint nreturn_vals;
|
||||
|
||||
return_vals = gimp_run_procedure ("gimp_layer_set_visible",
|
||||
&nreturn_vals,
|
||||
|
@ -575,8 +553,8 @@ gint32
|
|||
gimp_layer_get_tattoo (gint32 layer_ID)
|
||||
{
|
||||
GParam *return_vals;
|
||||
int nreturn_vals;
|
||||
int tattoo;
|
||||
gint nreturn_vals;
|
||||
gint tattoo;
|
||||
|
||||
return_vals = gimp_run_procedure ("gimp_layer_get_tattoo",
|
||||
&nreturn_vals,
|
||||
|
@ -591,4 +569,3 @@ gimp_layer_get_tattoo (gint32 layer_ID)
|
|||
|
||||
return tattoo;
|
||||
}
|
||||
|
||||
|
|
|
@ -0,0 +1,93 @@
|
|||
/* LIBGIMP - The GIMP Library
|
||||
* Copyright (C) 1995-1997 Peter Mattis and Spencer Kimball
|
||||
*
|
||||
* gimplayer_pdb.h
|
||||
*
|
||||
* This library is free software; you can redistribute it and/or
|
||||
* modify it under the terms of the GNU Lesser General Public
|
||||
* License as published by the Free Software Foundation; either
|
||||
* version 2 of the License, or (at your option) any later version.
|
||||
*
|
||||
* This library 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
|
||||
* Lesser General Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU Lesser General Public
|
||||
* License along with this library; if not, write to the
|
||||
* Free Software Foundation, Inc., 59 Temple Place - Suite 330,
|
||||
* Boston, MA 02111-1307, USA.
|
||||
*/
|
||||
|
||||
#ifndef __GIMP_LAYER_PDB_H__
|
||||
#define __GIMP_LAYER_PDB_H__
|
||||
|
||||
#ifdef __cplusplus
|
||||
extern "C" {
|
||||
#endif /* __cplusplus */
|
||||
|
||||
/* For information look into the C source or the html documentation */
|
||||
|
||||
|
||||
gint32 gimp_layer_new (gint32 image_ID,
|
||||
char *name,
|
||||
guint width,
|
||||
guint height,
|
||||
GimpImageType type,
|
||||
gdouble opacity,
|
||||
GLayerMode mode);
|
||||
gint32 gimp_layer_copy (gint32 layer_ID);
|
||||
void gimp_layer_delete (gint32 layer_ID);
|
||||
void gimp_layer_add_alpha (gint32 layer_ID);
|
||||
gint32 gimp_layer_create_mask (gint32 layer_ID,
|
||||
GimpAddMaskType mask_type);
|
||||
void gimp_layer_resize (gint32 layer_ID,
|
||||
guint new_width,
|
||||
guint new_height,
|
||||
gint offset_x,
|
||||
gint offset_y);
|
||||
void gimp_layer_scale (gint32 layer_ID,
|
||||
guint new_width,
|
||||
guint new_height,
|
||||
gint local_origin);
|
||||
void gimp_layer_translate (gint32 layer_ID,
|
||||
gint offset_x,
|
||||
gint offset_y);
|
||||
gboolean gimp_layer_is_floating_selection (gint32 layer_ID);
|
||||
gint32 gimp_layer_get_image_id (gint32 layer_ID);
|
||||
gint32 gimp_layer_get_mask_id (gint32 layer_ID);
|
||||
gboolean gimp_layer_get_apply_mask (gint32 layer_ID);
|
||||
gboolean gimp_layer_get_edit_mask (gint32 layer_ID);
|
||||
GLayerMode gimp_layer_get_mode (gint32 layer_ID);
|
||||
gchar * gimp_layer_get_name (gint32 layer_ID);
|
||||
gdouble gimp_layer_get_opacity (gint32 layer_ID);
|
||||
gboolean gimp_layer_get_preserve_transparency (gint32 layer_ID);
|
||||
gint gimp_layer_get_show_mask (gint32 layer_ID);
|
||||
gint gimp_layer_get_visible (gint32 layer_ID);
|
||||
void gimp_layer_set_apply_mask (gint32 layer_ID,
|
||||
gboolean apply_mask);
|
||||
void gimp_layer_set_edit_mask (gint32 layer_ID,
|
||||
gboolean edit_mask);
|
||||
void gimp_layer_set_mode (gint32 layer_ID,
|
||||
GLayerMode mode);
|
||||
void gimp_layer_set_name (gint32 layer_ID,
|
||||
gchar *name);
|
||||
void gimp_layer_set_offsets (gint32 layer_ID,
|
||||
gint offset_x,
|
||||
gint offset_y);
|
||||
void gimp_layer_set_opacity (gint32 layer_ID,
|
||||
gdouble opacity);
|
||||
void gimp_layer_set_preserve_transparency (gint32 layer_ID,
|
||||
gboolean preserve_transparency);
|
||||
void gimp_layer_set_show_mask (gint32 layer_ID,
|
||||
gboolean show_mask);
|
||||
void gimp_layer_set_visible (gint32 layer_ID,
|
||||
gboolean visible);
|
||||
gint32 gimp_layer_get_tattoo (gint32 layer_ID);
|
||||
|
||||
|
||||
#ifdef __cplusplus
|
||||
}
|
||||
#endif /* __cplusplus */
|
||||
|
||||
#endif /* __GIMP_LAYER_PDB_H__ */
|
|
@ -1,6 +1,8 @@
|
|||
/* LIBGIMP - The GIMP Library
|
||||
* Copyright (C) 1995-1997 Peter Mattis and Spencer Kimball
|
||||
*
|
||||
* gimpmenu.c
|
||||
*
|
||||
* This library is free software; you can redistribute it and/or
|
||||
* modify it under the terms of the GNU Lesser General Public
|
||||
* License as published by the Free Software Foundation; either
|
||||
|
@ -28,17 +30,17 @@
|
|||
/* Copy data from temp_PDB call */
|
||||
struct _GimpBrushData
|
||||
{
|
||||
gboolean busy;
|
||||
gchar *bname;
|
||||
gdouble opacity;
|
||||
gint spacing;
|
||||
gint paint_mode;
|
||||
gint width;
|
||||
gint height;
|
||||
gchar *brush_mask_data;
|
||||
GRunBrushCallback callback;
|
||||
gboolean closing;
|
||||
gpointer data;
|
||||
gboolean busy;
|
||||
gchar *bname;
|
||||
gdouble opacity;
|
||||
gint spacing;
|
||||
gint paint_mode;
|
||||
gint width;
|
||||
gint height;
|
||||
gchar *brush_mask_data;
|
||||
GimpRunBrushCallback callback;
|
||||
gboolean closing;
|
||||
gpointer data;
|
||||
};
|
||||
|
||||
typedef struct _GimpBrushData GimpBrushData;
|
||||
|
@ -46,15 +48,15 @@ typedef struct _GimpBrushData GimpBrushData;
|
|||
/* Copy data from temp_PDB call */
|
||||
struct _GimpPatternData
|
||||
{
|
||||
gboolean busy;
|
||||
gchar *pname;
|
||||
gint width;
|
||||
gint height;
|
||||
gint bytes;
|
||||
gchar *pattern_mask_data;
|
||||
GRunPatternCallback callback;
|
||||
gboolean closing;
|
||||
gpointer data;
|
||||
gboolean busy;
|
||||
gchar *pname;
|
||||
gint width;
|
||||
gint height;
|
||||
gint bytes;
|
||||
gchar *pattern_mask_data;
|
||||
GimpRunPatternCallback callback;
|
||||
gboolean closing;
|
||||
gpointer data;
|
||||
};
|
||||
|
||||
typedef struct _GimpPatternData GimpPatternData;
|
||||
|
@ -62,48 +64,49 @@ typedef struct _GimpPatternData GimpPatternData;
|
|||
/* Copy data from temp_PDB call */
|
||||
struct _GimpGradientData
|
||||
{
|
||||
gboolean busy;
|
||||
gchar *gname;
|
||||
gint width;
|
||||
gdouble *gradient_data;
|
||||
GRunGradientCallback callback;
|
||||
gboolean closing;
|
||||
gpointer data;
|
||||
gboolean busy;
|
||||
gchar *gname;
|
||||
gint width;
|
||||
gdouble *gradient_data;
|
||||
GimpRunGradientCallback callback;
|
||||
gboolean closing;
|
||||
gpointer data;
|
||||
};
|
||||
|
||||
typedef struct _GimpGradientData GimpGradientData;
|
||||
|
||||
static void gimp_menu_callback (GtkWidget *widget,
|
||||
gint32 *id);
|
||||
static void do_brush_callback (GimpBrushData *bdata);
|
||||
static gint idle_test_brush (GimpBrushData *bdata);
|
||||
static gint idle_test_pattern (GimpPatternData *pdata);
|
||||
static gint idle_test_gradient (GimpGradientData *gdata);
|
||||
static void temp_brush_invoker (gchar *name,
|
||||
gint nparams,
|
||||
GParam *param,
|
||||
gint *nreturn_vals,
|
||||
GParam **return_vals);
|
||||
static gboolean input_callback (GIOChannel *channel,
|
||||
GIOCondition condition,
|
||||
gpointer data);
|
||||
static void gimp_menu_callback (GtkWidget *widget,
|
||||
gint32 *id);
|
||||
static void do_brush_callback (GimpBrushData *bdata);
|
||||
static gint idle_test_brush (GimpBrushData *bdata);
|
||||
static gint idle_test_pattern (GimpPatternData *pdata);
|
||||
static gint idle_test_gradient (GimpGradientData *gdata);
|
||||
static void temp_brush_invoker (gchar *name,
|
||||
gint nparams,
|
||||
GimpParam *param,
|
||||
gint *nreturn_vals,
|
||||
GimpParam **return_vals);
|
||||
static gboolean input_callback (GIOChannel *channel,
|
||||
GIOCondition condition,
|
||||
gpointer data);
|
||||
static void gimp_setup_callbacks (void);
|
||||
static gchar* gen_temp_plugin_name (void);
|
||||
static void fill_preview_with_thumb (GtkWidget *widget,
|
||||
gint32 drawable_ID,
|
||||
gint width,
|
||||
gint height);
|
||||
static gchar * gen_temp_plugin_name (void);
|
||||
static void fill_preview_with_thumb (GtkWidget *widget,
|
||||
gint32 drawable_ID,
|
||||
gint width,
|
||||
gint height);
|
||||
|
||||
/* From gimp.c */
|
||||
void gimp_run_temp (void);
|
||||
|
||||
static GHashTable *gbrush_ht = NULL;
|
||||
static GHashTable *gpattern_ht = NULL;
|
||||
static GHashTable *ggradient_ht = NULL;
|
||||
static GimpBrushData *active_brush_pdb = NULL;
|
||||
static GimpPatternData *active_pattern_pdb = NULL;
|
||||
static GHashTable *gbrush_ht = NULL;
|
||||
static GHashTable *gpattern_ht = NULL;
|
||||
static GHashTable *ggradient_ht = NULL;
|
||||
static GimpBrushData *active_brush_pdb = NULL;
|
||||
static GimpPatternData *active_pattern_pdb = NULL;
|
||||
static GimpGradientData *active_gradient_pdb = NULL;
|
||||
|
||||
GtkWidget*
|
||||
GtkWidget *
|
||||
gimp_image_menu_new (GimpConstraintFunc constraint,
|
||||
GimpMenuCallback callback,
|
||||
gpointer data,
|
||||
|
@ -111,11 +114,11 @@ gimp_image_menu_new (GimpConstraintFunc constraint,
|
|||
{
|
||||
GtkWidget *menu;
|
||||
GtkWidget *menuitem;
|
||||
char *filename;
|
||||
char *label;
|
||||
gchar *filename;
|
||||
gchar *label;
|
||||
gint32 *images;
|
||||
int nimages;
|
||||
int i, k;
|
||||
gint nimages;
|
||||
gint i, k;
|
||||
|
||||
menu = gtk_menu_new ();
|
||||
gtk_object_set_user_data (GTK_OBJECT (menu), (gpointer) callback);
|
||||
|
@ -126,8 +129,7 @@ gimp_image_menu_new (GimpConstraintFunc constraint,
|
|||
if (!constraint || (* constraint) (images[i], -1, data))
|
||||
{
|
||||
filename = gimp_image_get_filename (images[i]);
|
||||
label = g_new (char, strlen (filename) + 16);
|
||||
sprintf (label, "%s-%d", g_basename (filename), images[i]);
|
||||
label = g_strdup_printf ("%s-%d", g_basename (filename), images[i]);
|
||||
g_free (filename);
|
||||
|
||||
menuitem = gtk_menu_item_new_with_label (label);
|
||||
|
@ -164,8 +166,7 @@ gimp_image_menu_new (GimpConstraintFunc constraint,
|
|||
}
|
||||
|
||||
|
||||
|
||||
GtkWidget*
|
||||
GtkWidget *
|
||||
gimp_layer_menu_new (GimpConstraintFunc constraint,
|
||||
GimpMenuCallback callback,
|
||||
gpointer data,
|
||||
|
@ -173,15 +174,15 @@ gimp_layer_menu_new (GimpConstraintFunc constraint,
|
|||
{
|
||||
GtkWidget *menu;
|
||||
GtkWidget *menuitem;
|
||||
char *name;
|
||||
char *image_label;
|
||||
char *label;
|
||||
gchar *name;
|
||||
gchar *image_label;
|
||||
gchar *label;
|
||||
gint32 *images;
|
||||
gint32 *layers;
|
||||
gint32 layer;
|
||||
int nimages;
|
||||
int nlayers;
|
||||
int i, j, k;
|
||||
gint nimages;
|
||||
gint nlayers;
|
||||
gint i, j, k;
|
||||
|
||||
menu = gtk_menu_new ();
|
||||
gtk_object_set_user_data (GTK_OBJECT (menu), (gpointer) callback);
|
||||
|
@ -194,8 +195,7 @@ gimp_layer_menu_new (GimpConstraintFunc constraint,
|
|||
if (!constraint || (* constraint) (images[i], -1, data))
|
||||
{
|
||||
name = gimp_image_get_filename (images[i]);
|
||||
image_label = g_new (char, strlen (name) + 16);
|
||||
sprintf (image_label, "%s-%d", g_basename (name), images[i]);
|
||||
image_label = g_strdup_printf ("%s-%d", g_basename (name), images[i]);
|
||||
g_free (name);
|
||||
|
||||
layers = gimp_image_get_layers (images[i], &nlayers);
|
||||
|
@ -208,8 +208,7 @@ gimp_layer_menu_new (GimpConstraintFunc constraint,
|
|||
GtkWidget *wlabel;
|
||||
|
||||
name = gimp_layer_get_name (layers[j]);
|
||||
label = g_new (char, strlen (image_label) + strlen (name) + 2);
|
||||
sprintf (label, "%s/%s", image_label, name);
|
||||
label = g_strdup_printf ("%s/%s", image_label, name);
|
||||
g_free (name);
|
||||
|
||||
menuitem = gtk_menu_item_new();
|
||||
|
@ -228,22 +227,22 @@ gimp_layer_menu_new (GimpConstraintFunc constraint,
|
|||
wcolor_box = gtk_preview_new(GTK_PREVIEW_COLOR);
|
||||
gtk_preview_set_dither (GTK_PREVIEW (wcolor_box), GDK_RGB_DITHER_MAX);
|
||||
|
||||
fill_preview_with_thumb(wcolor_box,
|
||||
layers[j],
|
||||
MENU_THUMBNAIL_WIDTH,
|
||||
MENU_THUMBNAIL_HEIGHT);
|
||||
fill_preview_with_thumb (wcolor_box,
|
||||
layers[j],
|
||||
MENU_THUMBNAIL_WIDTH,
|
||||
MENU_THUMBNAIL_HEIGHT);
|
||||
|
||||
gtk_widget_set_usize( GTK_WIDGET (wcolor_box) ,
|
||||
MENU_THUMBNAIL_WIDTH ,
|
||||
gtk_widget_set_usize (GTK_WIDGET (wcolor_box),
|
||||
MENU_THUMBNAIL_WIDTH,
|
||||
MENU_THUMBNAIL_HEIGHT);
|
||||
|
||||
gtk_container_add(GTK_CONTAINER(vbox), wcolor_box);
|
||||
gtk_widget_show(wcolor_box);
|
||||
gtk_container_add (GTK_CONTAINER (vbox), wcolor_box);
|
||||
gtk_widget_show (wcolor_box);
|
||||
|
||||
wlabel = gtk_label_new(label);
|
||||
gtk_misc_set_alignment(GTK_MISC(wlabel), 0.0, 0.5);
|
||||
gtk_box_pack_start(GTK_BOX(hbox), wlabel, TRUE, TRUE, 4);
|
||||
gtk_widget_show(wlabel);
|
||||
wlabel = gtk_label_new (label);
|
||||
gtk_misc_set_alignment (GTK_MISC (wlabel), 0.0, 0.5);
|
||||
gtk_box_pack_start (GTK_BOX (hbox), wlabel, TRUE, TRUE, 4);
|
||||
gtk_widget_show (wlabel);
|
||||
|
||||
gtk_menu_append (GTK_MENU (menu), menuitem);
|
||||
gtk_widget_show (menuitem);
|
||||
|
@ -279,7 +278,7 @@ gimp_layer_menu_new (GimpConstraintFunc constraint,
|
|||
return menu;
|
||||
}
|
||||
|
||||
GtkWidget*
|
||||
GtkWidget *
|
||||
gimp_channel_menu_new (GimpConstraintFunc constraint,
|
||||
GimpMenuCallback callback,
|
||||
gpointer data,
|
||||
|
@ -287,15 +286,15 @@ gimp_channel_menu_new (GimpConstraintFunc constraint,
|
|||
{
|
||||
GtkWidget *menu;
|
||||
GtkWidget *menuitem;
|
||||
char *name;
|
||||
char *image_label;
|
||||
char *label;
|
||||
gchar *name;
|
||||
gchar *image_label;
|
||||
gchar *label;
|
||||
gint32 *images;
|
||||
gint32 *channels;
|
||||
gint32 channel;
|
||||
int nimages;
|
||||
int nchannels;
|
||||
int i, j, k;
|
||||
gint nimages;
|
||||
gint nchannels;
|
||||
gint i, j, k;
|
||||
|
||||
menu = gtk_menu_new ();
|
||||
gtk_object_set_user_data (GTK_OBJECT (menu), (gpointer) callback);
|
||||
|
@ -308,8 +307,7 @@ gimp_channel_menu_new (GimpConstraintFunc constraint,
|
|||
if (!constraint || (* constraint) (images[i], -1, data))
|
||||
{
|
||||
name = gimp_image_get_filename (images[i]);
|
||||
image_label = g_new (char, strlen (name) + 16);
|
||||
sprintf (image_label, "%s-%d", g_basename (name), images[i]);
|
||||
image_label = g_strdup_printf ("%s-%d", g_basename (name), images[i]);
|
||||
g_free (name);
|
||||
|
||||
channels = gimp_image_get_channels (images[i], &nchannels);
|
||||
|
@ -322,42 +320,42 @@ gimp_channel_menu_new (GimpConstraintFunc constraint,
|
|||
GtkWidget *wlabel;
|
||||
|
||||
name = gimp_channel_get_name (channels[j]);
|
||||
label = g_new (char, strlen (image_label) + strlen (name) + 2);
|
||||
sprintf (label, "%s/%s", image_label, name);
|
||||
label = g_strdup_printf ("%s/%s", image_label, name);
|
||||
g_free (name);
|
||||
|
||||
menuitem = gtk_menu_item_new();
|
||||
menuitem = gtk_menu_item_new ();
|
||||
gtk_signal_connect (GTK_OBJECT (menuitem), "activate",
|
||||
(GtkSignalFunc) gimp_menu_callback,
|
||||
GTK_SIGNAL_FUNC (gimp_menu_callback),
|
||||
&channels[j]);
|
||||
|
||||
hbox = gtk_hbox_new(FALSE, 0);
|
||||
gtk_container_add(GTK_CONTAINER(menuitem), hbox);
|
||||
gtk_widget_show(hbox);
|
||||
hbox = gtk_hbox_new (FALSE, 0);
|
||||
gtk_container_add (GTK_CONTAINER (menuitem), hbox);
|
||||
gtk_widget_show (hbox);
|
||||
|
||||
vbox = gtk_vbox_new(FALSE, 0);
|
||||
gtk_box_pack_start(GTK_BOX(hbox), vbox, FALSE, FALSE, 0);
|
||||
gtk_widget_show(vbox);
|
||||
|
||||
wcolor_box = gtk_preview_new(GTK_PREVIEW_COLOR);
|
||||
gtk_preview_set_dither (GTK_PREVIEW (wcolor_box), GDK_RGB_DITHER_MAX);
|
||||
vbox = gtk_vbox_new (FALSE, 0);
|
||||
gtk_box_pack_start (GTK_BOX (hbox), vbox, FALSE, FALSE, 0);
|
||||
gtk_widget_show (vbox);
|
||||
|
||||
fill_preview_with_thumb(wcolor_box,
|
||||
channels[j],
|
||||
MENU_THUMBNAIL_WIDTH,
|
||||
MENU_THUMBNAIL_HEIGHT);
|
||||
wcolor_box = gtk_preview_new (GTK_PREVIEW_COLOR);
|
||||
gtk_preview_set_dither (GTK_PREVIEW (wcolor_box),
|
||||
GDK_RGB_DITHER_MAX);
|
||||
|
||||
gtk_widget_set_usize( GTK_WIDGET (wcolor_box) ,
|
||||
MENU_THUMBNAIL_WIDTH ,
|
||||
fill_preview_with_thumb (wcolor_box,
|
||||
channels[j],
|
||||
MENU_THUMBNAIL_WIDTH,
|
||||
MENU_THUMBNAIL_HEIGHT);
|
||||
|
||||
gtk_widget_set_usize (GTK_WIDGET (wcolor_box),
|
||||
MENU_THUMBNAIL_WIDTH,
|
||||
MENU_THUMBNAIL_HEIGHT);
|
||||
|
||||
gtk_container_add(GTK_CONTAINER(vbox), wcolor_box);
|
||||
gtk_widget_show(wcolor_box);
|
||||
gtk_container_add (GTK_CONTAINER(vbox), wcolor_box);
|
||||
gtk_widget_show (wcolor_box);
|
||||
|
||||
wlabel = gtk_label_new(label);
|
||||
gtk_misc_set_alignment(GTK_MISC(wlabel), 0.0, 0.5);
|
||||
gtk_box_pack_start(GTK_BOX(hbox), wlabel, TRUE, TRUE, 4);
|
||||
gtk_widget_show(wlabel);
|
||||
wlabel = gtk_label_new (label);
|
||||
gtk_misc_set_alignment (GTK_MISC (wlabel), 0.0, 0.5);
|
||||
gtk_box_pack_start (GTK_BOX (hbox), wlabel, TRUE, TRUE, 4);
|
||||
gtk_widget_show (wlabel);
|
||||
|
||||
gtk_menu_append (GTK_MENU (menu), menuitem);
|
||||
gtk_widget_show (menuitem);
|
||||
|
@ -393,7 +391,7 @@ gimp_channel_menu_new (GimpConstraintFunc constraint,
|
|||
return menu;
|
||||
}
|
||||
|
||||
GtkWidget*
|
||||
GtkWidget *
|
||||
gimp_drawable_menu_new (GimpConstraintFunc constraint,
|
||||
GimpMenuCallback callback,
|
||||
gpointer data,
|
||||
|
@ -425,8 +423,7 @@ gimp_drawable_menu_new (GimpConstraintFunc constraint,
|
|||
if (!constraint || (* constraint) (images[i], -1, data))
|
||||
{
|
||||
name = gimp_image_get_filename (images[i]);
|
||||
image_label = g_new (char, strlen (name) + 16);
|
||||
sprintf (image_label, "%s-%d", g_basename (name), images[i]);
|
||||
image_label = g_strdup_printf ("%s-%d", g_basename (name), images[i]);
|
||||
g_free (name);
|
||||
|
||||
layers = gimp_image_get_layers (images[i], &nlayers);
|
||||
|
@ -440,8 +437,7 @@ gimp_drawable_menu_new (GimpConstraintFunc constraint,
|
|||
GtkWidget *wlabel;
|
||||
|
||||
name = gimp_layer_get_name (layers[j]);
|
||||
label = g_new (gchar, strlen (image_label) + strlen (name) + 2);
|
||||
sprintf (label, "%s/%s", image_label, name);
|
||||
label = g_strdup_printf ("%s/%s", image_label, name);
|
||||
g_free (name);
|
||||
|
||||
menuitem = gtk_menu_item_new ();
|
||||
|
@ -504,13 +500,12 @@ gimp_drawable_menu_new (GimpConstraintFunc constraint,
|
|||
GtkWidget *wlabel;
|
||||
|
||||
name = gimp_channel_get_name (channels[j]);
|
||||
label = g_new (char, strlen (image_label) + strlen (name) + 2);
|
||||
sprintf (label, "%s/%s", image_label, name);
|
||||
label = g_strdup_printf ("%s/%s", image_label, name);
|
||||
g_free (name);
|
||||
|
||||
menuitem = gtk_menu_item_new();
|
||||
menuitem = gtk_menu_item_new ();
|
||||
gtk_signal_connect (GTK_OBJECT (menuitem), "activate",
|
||||
(GtkSignalFunc) gimp_menu_callback,
|
||||
GTK_SIGNAL_FUNC (gimp_menu_callback),
|
||||
&channels[j]);
|
||||
|
||||
hbox = gtk_hbox_new (FALSE, 0);
|
||||
|
@ -522,7 +517,8 @@ gimp_drawable_menu_new (GimpConstraintFunc constraint,
|
|||
gtk_widget_show (vbox);
|
||||
|
||||
wcolor_box = gtk_preview_new (GTK_PREVIEW_COLOR);
|
||||
gtk_preview_set_dither (GTK_PREVIEW (wcolor_box), GDK_RGB_DITHER_MAX);
|
||||
gtk_preview_set_dither (GTK_PREVIEW (wcolor_box),
|
||||
GDK_RGB_DITHER_MAX);
|
||||
|
||||
fill_preview_with_thumb (wcolor_box,
|
||||
channels[j],
|
||||
|
@ -583,8 +579,10 @@ gimp_menu_callback (GtkWidget *widget,
|
|||
GimpMenuCallback callback;
|
||||
gpointer callback_data;
|
||||
|
||||
callback = (GimpMenuCallback) gtk_object_get_user_data (GTK_OBJECT (widget->parent));
|
||||
callback_data = gtk_object_get_data (GTK_OBJECT (widget->parent), "gimp_callback_data");
|
||||
callback =
|
||||
(GimpMenuCallback) gtk_object_get_user_data (GTK_OBJECT (widget->parent));
|
||||
callback_data = gtk_object_get_data (GTK_OBJECT (widget->parent),
|
||||
"gimp_callback_data");
|
||||
|
||||
(* callback) (*id, callback_data);
|
||||
}
|
||||
|
@ -621,30 +619,30 @@ fill_preview_with_thumb (GtkWidget *widget,
|
|||
|
||||
for (x = 0; x < width; x++)
|
||||
{
|
||||
if(bpp == 4)
|
||||
if (bpp == 4)
|
||||
{
|
||||
r = ((gdouble)src[x*4+0])/255.0;
|
||||
g = ((gdouble)src[x*4+1])/255.0;
|
||||
b = ((gdouble)src[x*4+2])/255.0;
|
||||
a = ((gdouble)src[x*4+3])/255.0;
|
||||
r = ((gdouble) src[x*4+0]) / 255.0;
|
||||
g = ((gdouble) src[x*4+1]) / 255.0;
|
||||
b = ((gdouble) src[x*4+2]) / 255.0;
|
||||
a = ((gdouble) src[x*4+3]) / 255.0;
|
||||
}
|
||||
else if(bpp == 3)
|
||||
else if (bpp == 3)
|
||||
{
|
||||
r = ((gdouble)src[x*3+0])/255.0;
|
||||
g = ((gdouble)src[x*3+1])/255.0;
|
||||
b = ((gdouble)src[x*3+2])/255.0;
|
||||
r = ((gdouble) src[x*3+0]) / 255.0;
|
||||
g = ((gdouble) src[x*3+1]) / 255.0;
|
||||
b = ((gdouble) src[x*3+2]) / 255.0;
|
||||
a = 1.0;
|
||||
}
|
||||
else
|
||||
{
|
||||
r = ((gdouble)src[x*bpp+0])/255.0;
|
||||
r = ((gdouble) src[x*bpp+0]) / 255.0;
|
||||
g = b = r;
|
||||
if(bpp == 2)
|
||||
a = ((gdouble)src[x*bpp+1])/255.0;
|
||||
if (bpp == 2)
|
||||
a = ((gdouble) src[x*bpp+1]) / 255.0;
|
||||
else
|
||||
a = 1.0;
|
||||
}
|
||||
|
||||
|
||||
if ((x / GIMP_CHECK_SIZE_SM) & 1)
|
||||
{
|
||||
c0 = GIMP_CHECK_LIGHT;
|
||||
|
@ -659,14 +657,14 @@ fill_preview_with_thumb (GtkWidget *widget,
|
|||
*p0++ = (c0 + (r - c0) * a) * 255.0;
|
||||
*p0++ = (c0 + (g - c0) * a) * 255.0;
|
||||
*p0++ = (c0 + (b - c0) * a) * 255.0;
|
||||
|
||||
|
||||
*p1++ = (c1 + (r - c1) * a) * 255.0;
|
||||
*p1++ = (c1 + (g - c1) * a) * 255.0;
|
||||
*p1++ = (c1 + (b - c1) * a) * 255.0;
|
||||
}
|
||||
|
||||
if ((y / GIMP_CHECK_SIZE_SM) & 1)
|
||||
gtk_preview_draw_row (GTK_PREVIEW (widget), (guchar *)odd, 0, y, width);
|
||||
gtk_preview_draw_row (GTK_PREVIEW (widget), (guchar *)odd, 0, y, width);
|
||||
else
|
||||
gtk_preview_draw_row (GTK_PREVIEW (widget), (guchar *)even, 0, y, width);
|
||||
|
||||
|
@ -791,13 +789,13 @@ idle_test_gradient (GimpGradientData *gdata)
|
|||
}
|
||||
|
||||
static void
|
||||
temp_brush_invoker(gchar *name,
|
||||
gint nparams,
|
||||
GParam *param,
|
||||
gint *nreturn_vals,
|
||||
GParam **return_vals)
|
||||
temp_brush_invoker (gchar *name,
|
||||
gint nparams,
|
||||
GimpParam *param,
|
||||
gint *nreturn_vals,
|
||||
GimpParam **return_vals)
|
||||
{
|
||||
static GParam values[1];
|
||||
static GimpParam values[1];
|
||||
GStatusType status = STATUS_SUCCESS;
|
||||
GimpBrushData *bdata;
|
||||
|
||||
|
@ -832,13 +830,13 @@ temp_brush_invoker(gchar *name,
|
|||
}
|
||||
|
||||
static void
|
||||
temp_pattern_invoker(gchar *name,
|
||||
gint nparams,
|
||||
GParam *param,
|
||||
gint *nreturn_vals,
|
||||
GParam **return_vals)
|
||||
temp_pattern_invoker (gchar *name,
|
||||
gint nparams,
|
||||
GimpParam *param,
|
||||
gint *nreturn_vals,
|
||||
GimpParam **return_vals)
|
||||
{
|
||||
static GParam values[1];
|
||||
static GimpParam values[1];
|
||||
GStatusType status = STATUS_SUCCESS;
|
||||
GimpPatternData *pdata;
|
||||
|
||||
|
@ -871,13 +869,13 @@ temp_pattern_invoker(gchar *name,
|
|||
}
|
||||
|
||||
static void
|
||||
temp_gradient_invoker(gchar *name,
|
||||
gint nparams,
|
||||
GParam *param,
|
||||
gint *nreturn_vals,
|
||||
GParam **return_vals)
|
||||
temp_gradient_invoker (gchar *name,
|
||||
gint nparams,
|
||||
GimpParam *param,
|
||||
gint *nreturn_vals,
|
||||
GimpParam **return_vals)
|
||||
{
|
||||
static GParam values[1];
|
||||
static GimpParam values[1];
|
||||
GStatusType status = STATUS_SUCCESS;
|
||||
GimpGradientData *gdata;
|
||||
|
||||
|
@ -949,7 +947,7 @@ gimp_setup_callbacks (void)
|
|||
static gchar *
|
||||
gen_temp_plugin_name (void)
|
||||
{
|
||||
GParam *return_vals;
|
||||
GimpParam *return_vals;
|
||||
gint nreturn_vals;
|
||||
gchar *result;
|
||||
|
||||
|
@ -970,32 +968,32 @@ gen_temp_plugin_name (void)
|
|||
* selection mech.
|
||||
*/
|
||||
gpointer
|
||||
gimp_interactive_selection_brush(gchar *dialogname,
|
||||
gchar *brush_name,
|
||||
gdouble opacity,
|
||||
gint spacing,
|
||||
gint paint_mode,
|
||||
GRunBrushCallback callback,
|
||||
gpointer data)
|
||||
gimp_interactive_selection_brush (gchar *dialogname,
|
||||
gchar *brush_name,
|
||||
gdouble opacity,
|
||||
gint spacing,
|
||||
gint paint_mode,
|
||||
GimpRunBrushCallback callback,
|
||||
gpointer data)
|
||||
{
|
||||
static GParamDef args[] =
|
||||
static GimpParamDef args[] =
|
||||
{
|
||||
{ PARAM_STRING, "str", "String"},
|
||||
{ PARAM_FLOAT, "opacity", "Opacity"},
|
||||
{ PARAM_INT32, "spacing", "Spacing"},
|
||||
{ PARAM_INT32, "paint mode", "Paint mode"},
|
||||
{ PARAM_INT32, "mask width", "Brush width"},
|
||||
{ PARAM_INT32, "mask height" "Brush heigth"},
|
||||
{ PARAM_INT32, "mask len", "Length of brush mask data"},
|
||||
{ PARAM_INT8ARRAY, "mask data", "The brush mask data"},
|
||||
{ PARAM_STRING, "str", "String" },
|
||||
{ PARAM_FLOAT, "opacity", "Opacity" },
|
||||
{ PARAM_INT32, "spacing", "Spacing" },
|
||||
{ PARAM_INT32, "paint mode", "Paint mode" },
|
||||
{ PARAM_INT32, "mask width", "Brush width" },
|
||||
{ PARAM_INT32, "mask height" "Brush heigth" },
|
||||
{ PARAM_INT32, "mask len", "Length of brush mask data" },
|
||||
{ PARAM_INT8ARRAY, "mask data", "The brush mask data" },
|
||||
{ PARAM_INT32, "dialog status", "Registers if the dialog was closing "
|
||||
"[0 = No, 1 = Yes]"},
|
||||
"[0 = No, 1 = Yes]" },
|
||||
};
|
||||
static GParamDef *return_vals = NULL;
|
||||
static int nargs = sizeof (args) / sizeof (args[0]);
|
||||
static int nreturn_vals = 0;
|
||||
static GimpParamDef *return_vals = NULL;
|
||||
static gint nargs = sizeof (args) / sizeof (args[0]);
|
||||
static gint nreturn_vals = 0;
|
||||
gint bnreturn_vals;
|
||||
GParam *pdbreturn_vals;
|
||||
GimpParam *pdbreturn_vals;
|
||||
gchar *pdbname = gen_temp_plugin_name ();
|
||||
GimpBrushData *bdata;
|
||||
|
||||
|
@ -1015,15 +1013,15 @@ gimp_interactive_selection_brush(gchar *dialogname,
|
|||
temp_brush_invoker);
|
||||
|
||||
pdbreturn_vals =
|
||||
gimp_run_procedure("gimp_brushes_popup",
|
||||
&bnreturn_vals,
|
||||
PARAM_STRING, pdbname,
|
||||
PARAM_STRING, dialogname,
|
||||
PARAM_STRING, brush_name,
|
||||
PARAM_FLOAT, opacity,
|
||||
PARAM_INT32, spacing,
|
||||
PARAM_INT32, paint_mode,
|
||||
PARAM_END);
|
||||
gimp_run_procedure ("gimp_brushes_popup",
|
||||
&bnreturn_vals,
|
||||
PARAM_STRING, pdbname,
|
||||
PARAM_STRING, dialogname,
|
||||
PARAM_STRING, brush_name,
|
||||
PARAM_FLOAT, opacity,
|
||||
PARAM_INT32, spacing,
|
||||
PARAM_INT32, paint_mode,
|
||||
PARAM_END);
|
||||
|
||||
/* if (pdbreturn_vals[0].data.d_status != STATUS_SUCCESS) */
|
||||
/* { */
|
||||
|
@ -1032,7 +1030,7 @@ gimp_interactive_selection_brush(gchar *dialogname,
|
|||
/* else */
|
||||
/* printf("worked = 0x%x\n",bnreturn_vals); */
|
||||
|
||||
gimp_setup_callbacks(); /* New function to allow callbacks to be watched */
|
||||
gimp_setup_callbacks (); /* New function to allow callbacks to be watched */
|
||||
|
||||
gimp_destroy_params (pdbreturn_vals,bnreturn_vals);
|
||||
|
||||
|
@ -1060,7 +1058,7 @@ gimp_brushes_get_brush_data (gchar *bname,
|
|||
gint *height,
|
||||
gchar **mask_data)
|
||||
{
|
||||
GParam *return_vals;
|
||||
GimpParam *return_vals;
|
||||
gint nreturn_vals;
|
||||
gchar *ret_name = NULL;
|
||||
|
||||
|
@ -1090,7 +1088,7 @@ gimp_brushes_get_brush_data (gchar *bname,
|
|||
gint
|
||||
gimp_brush_close_popup (gpointer popup_pnt)
|
||||
{
|
||||
GParam *return_vals;
|
||||
GimpParam *return_vals;
|
||||
gint nreturn_vals;
|
||||
gint retval;
|
||||
|
||||
|
@ -1107,13 +1105,13 @@ gimp_brush_close_popup (gpointer popup_pnt)
|
|||
}
|
||||
|
||||
gint
|
||||
gimp_brush_set_popup(gpointer popup_pnt,
|
||||
gchar *pname,
|
||||
gdouble opacity,
|
||||
gint spacing,
|
||||
gint paint_mode)
|
||||
gimp_brush_set_popup (gpointer popup_pnt,
|
||||
gchar *pname,
|
||||
gdouble opacity,
|
||||
gint spacing,
|
||||
gint paint_mode)
|
||||
{
|
||||
GParam *return_vals;
|
||||
GimpParam *return_vals;
|
||||
gint nreturn_vals;
|
||||
gint retval;
|
||||
|
||||
|
@ -1136,27 +1134,27 @@ gimp_brush_set_popup(gpointer popup_pnt,
|
|||
|
||||
|
||||
gpointer
|
||||
gimp_interactive_selection_pattern (gchar *dialogname,
|
||||
gchar *pattern_name,
|
||||
GRunPatternCallback callback,
|
||||
gpointer data)
|
||||
gimp_interactive_selection_pattern (gchar *dialogname,
|
||||
gchar *pattern_name,
|
||||
GimpRunPatternCallback callback,
|
||||
gpointer data)
|
||||
{
|
||||
static GParamDef args[] =
|
||||
static GimpParamDef args[] =
|
||||
{
|
||||
{ PARAM_STRING, "str", "String"},
|
||||
{ PARAM_INT32, "mask width", "Pattern width"},
|
||||
{ PARAM_INT32, "mask height", "Pattern heigth"},
|
||||
{ PARAM_INT32, "mask bpp", "Pattern bytes per pixel"},
|
||||
{ PARAM_INT32, "mask len", "Length of pattern mask data"},
|
||||
{ PARAM_INT8ARRAY,"mask data", "The pattern mask data"},
|
||||
{ PARAM_STRING, "str", "String" },
|
||||
{ PARAM_INT32, "mask width", "Pattern width" },
|
||||
{ PARAM_INT32, "mask height", "Pattern heigth" },
|
||||
{ PARAM_INT32, "mask bpp", "Pattern bytes per pixel" },
|
||||
{ PARAM_INT32, "mask len", "Length of pattern mask data" },
|
||||
{ PARAM_INT8ARRAY,"mask data", "The pattern mask data" },
|
||||
{ PARAM_INT32, "dialog status", "Registers if the dialog was closing "
|
||||
"[0 = No, 1 = Yes]"},
|
||||
"[0 = No, 1 = Yes]" },
|
||||
};
|
||||
static GParamDef *return_vals = NULL;
|
||||
static int nargs = sizeof (args) / sizeof (args[0]);
|
||||
static int nreturn_vals = 0;
|
||||
static GimpParamDef *return_vals = NULL;
|
||||
static gint nargs = sizeof (args) / sizeof (args[0]);
|
||||
static gint nreturn_vals = 0;
|
||||
gint bnreturn_vals;
|
||||
GParam *pdbreturn_vals;
|
||||
GimpParam *pdbreturn_vals;
|
||||
gchar *pdbname = gen_temp_plugin_name ();
|
||||
GimpPatternData *pdata;
|
||||
|
||||
|
@ -1207,7 +1205,7 @@ gimp_pattern_get_pattern_data (gchar *pname,
|
|||
gint *bytes,
|
||||
gchar **mask_data)
|
||||
{
|
||||
GParam *return_vals;
|
||||
GimpParam *return_vals;
|
||||
gint nreturn_vals;
|
||||
gchar *ret_name = NULL;
|
||||
|
||||
|
@ -1235,7 +1233,7 @@ gimp_pattern_get_pattern_data (gchar *pname,
|
|||
gint
|
||||
gimp_pattern_close_popup (gpointer popup_pnt)
|
||||
{
|
||||
GParam *return_vals;
|
||||
GimpParam *return_vals;
|
||||
gint nreturn_vals;
|
||||
gint retval;
|
||||
|
||||
|
@ -1255,7 +1253,7 @@ gint
|
|||
gimp_pattern_set_popup (gpointer popup_pnt,
|
||||
gchar *pname)
|
||||
{
|
||||
GParam *return_vals;
|
||||
GimpParam *return_vals;
|
||||
gint nreturn_vals;
|
||||
gint retval;
|
||||
|
||||
|
@ -1273,26 +1271,26 @@ gimp_pattern_set_popup (gpointer popup_pnt,
|
|||
}
|
||||
|
||||
gpointer
|
||||
gimp_interactive_selection_gradient (gchar *dialogname,
|
||||
gchar *gradient_name,
|
||||
gint sample_sz,
|
||||
GRunGradientCallback callback,
|
||||
gpointer data)
|
||||
gimp_interactive_selection_gradient (gchar *dialogname,
|
||||
gchar *gradient_name,
|
||||
gint sample_sz,
|
||||
GimpRunGradientCallback callback,
|
||||
gpointer data)
|
||||
{
|
||||
static GParamDef args[] =
|
||||
static GimpParamDef args[] =
|
||||
{
|
||||
{ PARAM_STRING, "str", "String"},
|
||||
{ PARAM_INT32, "grad width", "Gradient width"},
|
||||
{ PARAM_FLOATARRAY,"grad data", "The gradient mask data"},
|
||||
{ PARAM_STRING, "str", "String" },
|
||||
{ PARAM_INT32, "grad width", "Gradient width" },
|
||||
{ PARAM_FLOATARRAY,"grad data", "The gradient mask data" },
|
||||
{ PARAM_INT32, "dialog status", "Registers if the dialog was closing "
|
||||
"[0 = No, 1 = Yes]"},
|
||||
"[0 = No, 1 = Yes]" },
|
||||
};
|
||||
static GParamDef *return_vals = NULL;
|
||||
static int nargs = sizeof (args) / sizeof (args[0]);
|
||||
static int nreturn_vals = 0;
|
||||
gint bnreturn_vals;
|
||||
GParam *pdbreturn_vals;
|
||||
gchar *pdbname = gen_temp_plugin_name();
|
||||
static GimpParamDef *return_vals = NULL;
|
||||
static gint nargs = sizeof (args) / sizeof (args[0]);
|
||||
static gint nreturn_vals = 0;
|
||||
gint bnreturn_vals;
|
||||
GimpParam *pdbreturn_vals;
|
||||
gchar *pdbname = gen_temp_plugin_name();
|
||||
GimpGradientData *gdata;
|
||||
|
||||
gdata = g_new0 (GimpGradientData, 1);
|
||||
|
@ -1341,9 +1339,9 @@ gimp_gradient_get_gradient_data (gchar *gname,
|
|||
gint sample_sz,
|
||||
gdouble **grad_data)
|
||||
{
|
||||
GParam *return_vals;
|
||||
gint nreturn_vals;
|
||||
gchar *ret_name = NULL;
|
||||
GimpParam *return_vals;
|
||||
gint nreturn_vals;
|
||||
gchar *ret_name = NULL;
|
||||
|
||||
return_vals = gimp_run_procedure ("gimp_gradients_get_gradient_data",
|
||||
&nreturn_vals,
|
||||
|
@ -1372,7 +1370,7 @@ gimp_gradient_get_gradient_data (gchar *gname,
|
|||
gint
|
||||
gimp_gradient_close_popup (gpointer popup_pnt)
|
||||
{
|
||||
GParam *return_vals;
|
||||
GimpParam *return_vals;
|
||||
gint nreturn_vals;
|
||||
gint retval;
|
||||
|
||||
|
@ -1392,7 +1390,7 @@ gint
|
|||
gimp_gradient_set_popup (gpointer popup_pnt,
|
||||
gchar *gname)
|
||||
{
|
||||
GParam *return_vals;
|
||||
GimpParam *return_vals;
|
||||
gint nreturn_vals;
|
||||
gint retval;
|
||||
|
||||
|
@ -1408,6 +1406,3 @@ gimp_gradient_set_popup (gpointer popup_pnt,
|
|||
|
||||
return retval;
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
|
|
@ -1,5 +1,7 @@
|
|||
/* LIBGIMP - The GIMP Library
|
||||
* Copyright (C) 1995-1997 Peter Mattis and Spencer Kimball
|
||||
/* LIBGIMP - The GIMP Library
|
||||
* Copyright (C) 1995-1997 Peter Mattis and Spencer Kimball
|
||||
*
|
||||
* gimpmenu.h
|
||||
*
|
||||
* This library is free software; you can redistribute it and/or
|
||||
* modify it under the terms of the GNU Lesser General Public
|
||||
|
@ -33,33 +35,33 @@ typedef void (* GimpMenuCallback) (gint32 id,
|
|||
|
||||
|
||||
/* Popup the brush dialog interactively */
|
||||
typedef void (* GRunBrushCallback) (gchar *name,
|
||||
gdouble opacity,
|
||||
gint spacing,
|
||||
gint paint_mode,
|
||||
gint width,
|
||||
gint height,
|
||||
gchar *mask_data,
|
||||
gboolean dialog_closing,
|
||||
gpointer user_data);
|
||||
typedef void (* GimpRunBrushCallback) (gchar *name,
|
||||
gdouble opacity,
|
||||
gint spacing,
|
||||
gint paint_mode,
|
||||
gint width,
|
||||
gint height,
|
||||
gchar *mask_data,
|
||||
gboolean dialog_closing,
|
||||
gpointer user_data);
|
||||
|
||||
/* Popup the pattern dialog */
|
||||
typedef void (* GRunPatternCallback) (gchar *name,
|
||||
gint width,
|
||||
gint height,
|
||||
gint bpp,
|
||||
gchar *mask_data,
|
||||
gboolean dialog_closing,
|
||||
gpointer user_data);
|
||||
typedef void (* GimpRunPatternCallback) (gchar *name,
|
||||
gint width,
|
||||
gint height,
|
||||
gint bpp,
|
||||
gchar *mask_data,
|
||||
gboolean dialog_closing,
|
||||
gpointer user_data);
|
||||
|
||||
/* Popup the gradient dialog */
|
||||
typedef void (* GRunGradientCallback) (gchar *name,
|
||||
gint width,
|
||||
gdouble *grad_data,
|
||||
gboolean dialog_closing,
|
||||
gpointer user_data);
|
||||
typedef void (* GimpRunGradientCallback) (gchar *name,
|
||||
gint width,
|
||||
gdouble *grad_data,
|
||||
gboolean dialog_closing,
|
||||
gpointer user_data);
|
||||
|
||||
|
||||
|
||||
GtkWidget * gimp_image_menu_new (GimpConstraintFunc constraint,
|
||||
GimpMenuCallback callback,
|
||||
gpointer data,
|
||||
|
@ -78,92 +80,92 @@ GtkWidget * gimp_drawable_menu_new (GimpConstraintFunc constraint,
|
|||
gint32 active_drawable);
|
||||
|
||||
|
||||
gpointer gimp_interactive_selection_brush (gchar *dialogname,
|
||||
gchar *brush_name,
|
||||
gdouble opacity,
|
||||
gint spacing,
|
||||
gint paint_mode,
|
||||
GRunBrushCallback callback,
|
||||
gpointer data);
|
||||
gpointer gimp_interactive_selection_brush (gchar *dialogname,
|
||||
gchar *brush_name,
|
||||
gdouble opacity,
|
||||
gint spacing,
|
||||
gint paint_mode,
|
||||
GimpRunBrushCallback callback,
|
||||
gpointer data);
|
||||
|
||||
GtkWidget * gimp_brush_select_widget (gchar *dname,
|
||||
gchar *ibrush,
|
||||
gdouble opacity,
|
||||
gint spacing,
|
||||
gint paint_mode,
|
||||
GRunBrushCallback cback,
|
||||
gpointer data);
|
||||
GtkWidget * gimp_brush_select_widget (gchar *dname,
|
||||
gchar *ibrush,
|
||||
gdouble opacity,
|
||||
gint spacing,
|
||||
gint paint_mode,
|
||||
GimpRunBrushCallback cback,
|
||||
gpointer data);
|
||||
|
||||
gboolean gimp_brush_select_widget_set_popup (GtkWidget *widget,
|
||||
gchar *pname,
|
||||
gdouble opacity,
|
||||
gint spacing,
|
||||
gint paint_mode);
|
||||
gboolean gimp_brush_select_widget_close_popup (GtkWidget *widget);
|
||||
gboolean gimp_brush_select_widget_set_popup (GtkWidget *widget,
|
||||
gchar *pname,
|
||||
gdouble opacity,
|
||||
gint spacing,
|
||||
gint paint_mode);
|
||||
gboolean gimp_brush_select_widget_close_popup (GtkWidget *widget);
|
||||
|
||||
gchar * gimp_brushes_get_brush_data (gchar *pname,
|
||||
gdouble *opacity,
|
||||
gint *spacing,
|
||||
gint *paint_mode,
|
||||
gint *width,
|
||||
gint *height,
|
||||
gchar **mask_data);
|
||||
gchar * gimp_brushes_get_brush_data (gchar *pname,
|
||||
gdouble *opacity,
|
||||
gint *spacing,
|
||||
gint *paint_mode,
|
||||
gint *width,
|
||||
gint *height,
|
||||
gchar **mask_data);
|
||||
|
||||
gboolean gimp_brush_set_popup (gpointer popup_pnt,
|
||||
gchar *pname,
|
||||
gdouble opacity,
|
||||
gint spacing,
|
||||
gint paint_mode);
|
||||
gboolean gimp_brush_close_popup (gpointer popup_pnt);
|
||||
gboolean gimp_brush_set_popup (gpointer popup_pnt,
|
||||
gchar *pname,
|
||||
gdouble opacity,
|
||||
gint spacing,
|
||||
gint paint_mode);
|
||||
gboolean gimp_brush_close_popup (gpointer popup_pnt);
|
||||
|
||||
|
||||
gpointer gimp_interactive_selection_pattern (gchar *dialogtitle,
|
||||
gchar *pattern_name,
|
||||
GRunPatternCallback callback,
|
||||
gpointer data);
|
||||
gpointer gimp_interactive_selection_pattern (gchar *dialogtitle,
|
||||
gchar *pattern_name,
|
||||
GimpRunPatternCallback callback,
|
||||
gpointer data);
|
||||
|
||||
GtkWidget * gimp_pattern_select_widget (gchar *dname,
|
||||
gchar *ipattern,
|
||||
GRunPatternCallback cback,
|
||||
gpointer data);
|
||||
GtkWidget * gimp_pattern_select_widget (gchar *dname,
|
||||
gchar *ipattern,
|
||||
GimpRunPatternCallback cback,
|
||||
gpointer data);
|
||||
|
||||
gboolean gimp_pattern_select_widget_close_popup (GtkWidget *widget);
|
||||
gboolean gimp_pattern_select_widget_set_popup (GtkWidget *widget,
|
||||
gchar *pname);
|
||||
gboolean gimp_pattern_select_widget_close_popup (GtkWidget *widget);
|
||||
gboolean gimp_pattern_select_widget_set_popup (GtkWidget *widget,
|
||||
gchar *pname);
|
||||
|
||||
gchar * gimp_pattern_get_pattern_data (gchar *pname,
|
||||
gint *width,
|
||||
gint *height,
|
||||
gint *bytes,
|
||||
gchar **mask_data);
|
||||
gchar * gimp_pattern_get_pattern_data (gchar *pname,
|
||||
gint *width,
|
||||
gint *height,
|
||||
gint *bytes,
|
||||
gchar **mask_data);
|
||||
|
||||
gboolean gimp_pattern_set_popup (gpointer popup_pnt,
|
||||
gchar *pname);
|
||||
gboolean gimp_pattern_close_popup (gpointer popup_pnt);
|
||||
gboolean gimp_pattern_set_popup (gpointer popup_pnt,
|
||||
gchar *pname);
|
||||
gboolean gimp_pattern_close_popup (gpointer popup_pnt);
|
||||
|
||||
gpointer gimp_interactive_selection_gradient (gchar *dialogtitle,
|
||||
gchar *gradient_name,
|
||||
gint sample_sz,
|
||||
GRunGradientCallback callback,
|
||||
gpointer data);
|
||||
gpointer gimp_interactive_selection_gradient (gchar *dialogtitle,
|
||||
gchar *gradient_name,
|
||||
gint sample_sz,
|
||||
GimpRunGradientCallback callback,
|
||||
gpointer data);
|
||||
|
||||
GtkWidget * gimp_gradient_select_widget (gchar *gname,
|
||||
gchar *igradient,
|
||||
GRunGradientCallback cback,
|
||||
gpointer data);
|
||||
GtkWidget * gimp_gradient_select_widget (gchar *gname,
|
||||
gchar *igradient,
|
||||
GimpRunGradientCallback cback,
|
||||
gpointer data);
|
||||
|
||||
gboolean gimp_gradient_select_widget_set_popup (GtkWidget *widget,
|
||||
gchar *pname);
|
||||
gboolean gimp_gradient_select_widget_close_popup (GtkWidget *widget);
|
||||
gboolean gimp_gradient_select_widget_set_popup (GtkWidget *widget,
|
||||
gchar *pname);
|
||||
gboolean gimp_gradient_select_widget_close_popup (GtkWidget *widget);
|
||||
|
||||
gchar * gimp_gradient_get_gradient_data (gchar *pname,
|
||||
gint *width,
|
||||
gint sample_sz,
|
||||
gdouble **mask_data);
|
||||
gchar * gimp_gradient_get_gradient_data (gchar *pname,
|
||||
gint *width,
|
||||
gint sample_sz,
|
||||
gdouble **mask_data);
|
||||
|
||||
gboolean gimp_gradient_set_popup (gpointer popup_pnt,
|
||||
gchar *pname);
|
||||
gboolean gimp_gradient_close_popup (gpointer popup_pnt);
|
||||
gboolean gimp_gradient_set_popup (gpointer popup_pnt,
|
||||
gchar *pname);
|
||||
gboolean gimp_gradient_close_popup (gpointer popup_pnt);
|
||||
|
||||
|
||||
#ifdef __cplusplus
|
||||
|
|
|
@ -1,21 +1,24 @@
|
|||
/* LIBGIMP - The GIMP Library
|
||||
* Copyright (C) 1995-1997 Peter Mattis and Spencer Kimball
|
||||
/* LIBGIMP - The GIMP Library
|
||||
* Copyright (C) 1995-1997 Peter Mattis and Spencer Kimball
|
||||
*
|
||||
* gimppalette_pdb.c
|
||||
*
|
||||
* This library is free software; you can redistribute it and/or
|
||||
* modify it under the terms of the GNU Lesser General Public
|
||||
* License as published by the Free Software Foundation; either
|
||||
* version 2 of the License, or (at your option) any later version.
|
||||
*
|
||||
* This library 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
|
||||
* version 2 of the License, or (at your option) any later version.
|
||||
*
|
||||
* This library 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
|
||||
* Library General Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU Lesser General Public
|
||||
* License along with this library; if not, write to the
|
||||
* Free Software Foundation, Inc., 59 Temple Place - Suite 330,
|
||||
* Boston, MA 02111-1307, USA.
|
||||
*/
|
||||
*/
|
||||
|
||||
#include "gimp.h"
|
||||
|
||||
|
||||
|
@ -25,7 +28,7 @@ gimp_palette_get_background (guchar *red,
|
|||
guchar *blue)
|
||||
{
|
||||
GParam *return_vals;
|
||||
int nreturn_vals;
|
||||
gint nreturn_vals;
|
||||
|
||||
return_vals = gimp_run_procedure ("gimp_palette_get_background",
|
||||
&nreturn_vals,
|
||||
|
@ -47,7 +50,7 @@ gimp_palette_get_foreground (guchar *red,
|
|||
guchar *blue)
|
||||
{
|
||||
GParam *return_vals;
|
||||
int nreturn_vals;
|
||||
gint nreturn_vals;
|
||||
|
||||
return_vals = gimp_run_procedure ("gimp_palette_get_foreground",
|
||||
&nreturn_vals,
|
||||
|
@ -69,7 +72,7 @@ gimp_palette_set_background (guchar red,
|
|||
guchar blue)
|
||||
{
|
||||
GParam *return_vals;
|
||||
int nreturn_vals;
|
||||
gint nreturn_vals;
|
||||
guchar color[3];
|
||||
|
||||
color[0] = red;
|
||||
|
@ -90,7 +93,7 @@ gimp_palette_set_foreground (guchar red,
|
|||
guchar blue)
|
||||
{
|
||||
GParam *return_vals;
|
||||
int nreturn_vals;
|
||||
gint nreturn_vals;
|
||||
guchar color[3];
|
||||
|
||||
color[0] = red;
|
||||
|
@ -109,7 +112,7 @@ void
|
|||
gimp_palette_set_default_colors (void)
|
||||
{
|
||||
GParam *return_vals;
|
||||
int nreturn_vals;
|
||||
gint nreturn_vals;
|
||||
|
||||
return_vals = gimp_run_procedure ("gimp_palette_set_default_colors",
|
||||
&nreturn_vals,
|
||||
|
@ -122,7 +125,7 @@ void
|
|||
gimp_palette_swap_colors (void)
|
||||
{
|
||||
GParam *return_vals;
|
||||
int nreturn_vals;
|
||||
gint nreturn_vals;
|
||||
|
||||
return_vals = gimp_run_procedure ("gimp_palette_swap_colors",
|
||||
&nreturn_vals,
|
||||
|
|
|
@ -0,0 +1,50 @@
|
|||
/* LIBGIMP - The GIMP Library
|
||||
* Copyright (C) 1995-1997 Peter Mattis and Spencer Kimball
|
||||
*
|
||||
* gimppalette_pdb.h
|
||||
*
|
||||
* This library is free software; you can redistribute it and/or
|
||||
* modify it under the terms of the GNU Lesser General Public
|
||||
* License as published by the Free Software Foundation; either
|
||||
* version 2 of the License, or (at your option) any later version.
|
||||
*
|
||||
* This library 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
|
||||
* Lesser General Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU Lesser General Public
|
||||
* License along with this library; if not, write to the
|
||||
* Free Software Foundation, Inc., 59 Temple Place - Suite 330,
|
||||
* Boston, MA 02111-1307, USA.
|
||||
*/
|
||||
|
||||
#ifndef __GIMP_PALETTE_PDB_H__
|
||||
#define __GIMP_PALETTE_PDB_H__
|
||||
|
||||
#ifdef __cplusplus
|
||||
extern "C" {
|
||||
#endif /* __cplusplus */
|
||||
|
||||
/* For information look into the C source or the html documentation */
|
||||
|
||||
|
||||
void gimp_palette_get_background (guchar *red,
|
||||
guchar *green,
|
||||
guchar *blue);
|
||||
void gimp_palette_get_foreground (guchar *red,
|
||||
guchar *green,
|
||||
guchar *blue);
|
||||
void gimp_palette_set_background (guchar red,
|
||||
guchar green,
|
||||
guchar blue);
|
||||
void gimp_palette_set_foreground (guchar red,
|
||||
guchar green,
|
||||
guchar blue);
|
||||
|
||||
|
||||
#ifdef __cplusplus
|
||||
}
|
||||
#endif /* __cplusplus */
|
||||
|
||||
#endif /* __GIMP_PALETTE_PDB_H__ */
|
|
@ -1,4 +1,4 @@
|
|||
/* LIBGIMP - The GIMP Library
|
||||
/* LIBGIMP - The GIMP Library
|
||||
* Copyright (C) 1995-1997 Peter Mattis and Spencer Kimball
|
||||
*
|
||||
* gimpparasite.c
|
||||
|
@ -19,6 +19,7 @@
|
|||
* Free Software Foundation, Inc., 59 Temple Place - Suite 330,
|
||||
* Boston, MA 02111-1307, USA.
|
||||
*/
|
||||
|
||||
#include "gimp.h"
|
||||
|
||||
GimpParasite *
|
||||
|
|
|
@ -0,0 +1,45 @@
|
|||
/* LIBGIMP - The GIMP Library
|
||||
* Copyright (C) 1995-1997 Peter Mattis and Spencer Kimball
|
||||
*
|
||||
* gimpparasite_pdb.h
|
||||
*
|
||||
* This library is free software; you can redistribute it and/or
|
||||
* modify it under the terms of the GNU Lesser General Public
|
||||
* License as published by the Free Software Foundation; either
|
||||
* version 2 of the License, or (at your option) any later version.
|
||||
*
|
||||
* This library 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
|
||||
* Lesser General Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU Lesser General Public
|
||||
* License along with this library; if not, write to the
|
||||
* Free Software Foundation, Inc., 59 Temple Place - Suite 330,
|
||||
* Boston, MA 02111-1307, USA.
|
||||
*/
|
||||
|
||||
#ifndef __GIMP_PARASITE_PDB_H__
|
||||
#define __GIMP_PARASITE_PDB_H__
|
||||
|
||||
#ifdef __cplusplus
|
||||
extern "C" {
|
||||
#endif /* __cplusplus */
|
||||
|
||||
/* For information look into the C source or the html documentation */
|
||||
|
||||
|
||||
GimpParasite * gimp_parasite_find (const gchar *name);
|
||||
void gimp_parasite_attach (const GimpParasite *parasite);
|
||||
void gimp_attach_new_parasite (const gchar *name,
|
||||
gint flags,
|
||||
gint size,
|
||||
const gpointer data);
|
||||
void gimp_parasite_detach (const gchar *name);
|
||||
|
||||
|
||||
#ifdef __cplusplus
|
||||
}
|
||||
#endif /* __cplusplus */
|
||||
|
||||
#endif /* __GIMP_PARASITE_PDB_H__ */
|
|
@ -1,5 +1,7 @@
|
|||
/* LIBGIMP - The GIMP Library
|
||||
* Copyright (C) 1995-1997 Peter Mattis and Spencer Kimball
|
||||
*
|
||||
* gimppatternmenu.c
|
||||
* Copyright (C) 1998 Andy Thomas
|
||||
*
|
||||
* This library is free software; you can redistribute it and/or
|
||||
|
@ -27,7 +29,7 @@
|
|||
* completely controls the selection of a pattern.
|
||||
* you get a widget returned that you can use in a table say.
|
||||
* In:- Initial pattern name. Null means use current selection.
|
||||
* pointer to func to call when pattern changes (GRubPatternCallback).
|
||||
* pointer to func to call when pattern changes (GimpRunPatternCallback).
|
||||
* Returned:- Pointer to a widget that you can use in UI.
|
||||
*
|
||||
* Widget simply made up of a preview widget (20x20) containing the pattern
|
||||
|
@ -44,20 +46,20 @@
|
|||
|
||||
struct __patterns_sel
|
||||
{
|
||||
gchar *dname;
|
||||
GRunPatternCallback cback;
|
||||
GtkWidget *pattern_preview;
|
||||
GtkWidget *device_patpopup;
|
||||
GtkWidget *device_patpreview;
|
||||
GtkWidget *button;
|
||||
GtkWidget *top_hbox;
|
||||
gchar *pattern_name; /* Local copy */
|
||||
gint width;
|
||||
gint height;
|
||||
gint bytes;
|
||||
gchar *mask_data; /* local copy */
|
||||
void *pattern_popup_pnt; /* Pointer use to control the popup */
|
||||
gpointer data;
|
||||
gchar *dname;
|
||||
GimpRunPatternCallback cback;
|
||||
GtkWidget *pattern_preview;
|
||||
GtkWidget *device_patpopup;
|
||||
GtkWidget *device_patpreview;
|
||||
GtkWidget *button;
|
||||
GtkWidget *top_hbox;
|
||||
gchar *pattern_name; /* Local copy */
|
||||
gint width;
|
||||
gint height;
|
||||
gint bytes;
|
||||
gchar *mask_data; /* local copy */
|
||||
void *pattern_popup_pnt; /* Pointer use to control the popup */
|
||||
gpointer data;
|
||||
};
|
||||
|
||||
typedef struct __patterns_sel PSelect;
|
||||
|
@ -280,10 +282,10 @@ patterns_select_callback (GtkWidget *widget,
|
|||
}
|
||||
|
||||
GtkWidget *
|
||||
gimp_pattern_select_widget(gchar *dname,
|
||||
gchar *ipattern,
|
||||
GRunPatternCallback cback,
|
||||
gpointer data)
|
||||
gimp_pattern_select_widget (gchar *dname,
|
||||
gchar *ipattern,
|
||||
GimpRunPatternCallback cback,
|
||||
gpointer data)
|
||||
{
|
||||
GtkWidget *frame;
|
||||
GtkWidget *hbox;
|
||||
|
@ -357,12 +359,12 @@ gimp_pattern_select_widget(gchar *dname,
|
|||
|
||||
|
||||
gboolean
|
||||
gimp_pattern_select_widget_close_popup (GtkWidget *w)
|
||||
gimp_pattern_select_widget_close_popup (GtkWidget *widget)
|
||||
{
|
||||
gboolean ret_val = FALSE;
|
||||
PSelect *psel;
|
||||
|
||||
psel = (PSelect*) gtk_object_get_data (GTK_OBJECT (w), PSEL_DATA_KEY);
|
||||
psel = (PSelect *) gtk_object_get_data (GTK_OBJECT (widget), PSEL_DATA_KEY);
|
||||
|
||||
if (psel && psel->pattern_popup_pnt)
|
||||
{
|
||||
|
@ -390,7 +392,8 @@ gimp_pattern_select_widget_set_popup (GtkWidget *widget,
|
|||
if (psel)
|
||||
{
|
||||
pattern_name =
|
||||
gimp_pattern_get_pattern_data (pname, &width, &height, &bytes, &mask_data);
|
||||
gimp_pattern_get_pattern_data (pname,
|
||||
&width, &height, &bytes, &mask_data);
|
||||
|
||||
pattern_select_invoker (pname, width, height, bytes, mask_data, 0, psel);
|
||||
|
||||
|
@ -398,5 +401,6 @@ gimp_pattern_select_widget_set_popup (GtkWidget *widget,
|
|||
gimp_pattern_set_popup (psel->pattern_popup_pnt, pname))
|
||||
ret_val = TRUE;
|
||||
}
|
||||
|
||||
return ret_val;
|
||||
}
|
||||
|
|
|
@ -1,28 +1,32 @@
|
|||
/* LIBGIMP - The GIMP Library
|
||||
* Copyright (C) 1995-1997 Peter Mattis and Spencer Kimball
|
||||
/* LIBGIMP - The GIMP Library
|
||||
* Copyright (C) 1995-1997 Peter Mattis and Spencer Kimball
|
||||
*
|
||||
* gimppixelrgn.c
|
||||
*
|
||||
* This library is free software; you can redistribute it and/or
|
||||
* modify it under the terms of the GNU Lesser General Public
|
||||
* License as published by the Free Software Foundation; either
|
||||
* version 2 of the License, or (at your option) any later version.
|
||||
*
|
||||
* This library 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
|
||||
* version 2 of the License, or (at your option) any later version.
|
||||
*
|
||||
* This library 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
|
||||
* Library General Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU Lesser General Public
|
||||
* License along with this library; if not, write to the
|
||||
* Free Software Foundation, Inc., 59 Temple Place - Suite 330,
|
||||
* Boston, MA 02111-1307, USA.
|
||||
*/
|
||||
*/
|
||||
|
||||
/* Experimental: comment-out the following #define if a memcpy() call is
|
||||
slower than compiler-optimized memory copies for transfers of approx.
|
||||
64-256 bytes.
|
||||
|
||||
FYI this #define is a win on Linux486/libc5. Unbenchmarked on other
|
||||
architectures. --adam */
|
||||
architectures. --adam
|
||||
*/
|
||||
|
||||
#define MEMCPY_IS_NICE
|
||||
|
||||
#ifdef MEMCPY_IS_NICE
|
||||
|
@ -33,42 +37,39 @@
|
|||
#include "gimp.h"
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
#define TILE_WIDTH _gimp_tile_width
|
||||
#define TILE_HEIGHT _gimp_tile_height
|
||||
#define BOUNDS(a,x,y) ((a < x) ? x : ((a > y) ? y : a))
|
||||
|
||||
|
||||
typedef struct _GPixelRgnHolder GPixelRgnHolder;
|
||||
typedef struct _GPixelRgnIterator GPixelRgnIterator;
|
||||
typedef struct _GimpPixelRgnHolder GimpPixelRgnHolder;
|
||||
typedef struct _GimpPixelRgnIterator GimpPixelRgnIterator;
|
||||
|
||||
struct _GPixelRgnHolder
|
||||
struct _GimpPixelRgnHolder
|
||||
{
|
||||
GPixelRgn *pr;
|
||||
guchar *original_data;
|
||||
int startx;
|
||||
int starty;
|
||||
int count;
|
||||
GimpPixelRgn *pr;
|
||||
guchar *original_data;
|
||||
gint startx;
|
||||
gint starty;
|
||||
gint count;
|
||||
};
|
||||
|
||||
struct _GPixelRgnIterator
|
||||
struct _GimpPixelRgnIterator
|
||||
{
|
||||
GSList *pixel_regions;
|
||||
int region_width;
|
||||
int region_height;
|
||||
int portion_width;
|
||||
int portion_height;
|
||||
int process_count;
|
||||
gint region_width;
|
||||
gint region_height;
|
||||
gint portion_width;
|
||||
gint portion_height;
|
||||
gint process_count;
|
||||
};
|
||||
|
||||
|
||||
static int gimp_get_portion_width (GPixelRgnIterator *pri);
|
||||
static int gimp_get_portion_height (GPixelRgnIterator *pri);
|
||||
static gpointer gimp_pixel_rgns_configure (GPixelRgnIterator *pri);
|
||||
static void gimp_pixel_rgn_configure (GPixelRgnHolder *prh,
|
||||
GPixelRgnIterator *pri);
|
||||
static gint gimp_get_portion_width (GimpPixelRgnIterator *pri);
|
||||
static gint gimp_get_portion_height (GimpPixelRgnIterator *pri);
|
||||
static gpointer gimp_pixel_rgns_configure (GimpPixelRgnIterator *pri);
|
||||
static void gimp_pixel_rgn_configure (GimpPixelRgnHolder *prh,
|
||||
GimpPixelRgnIterator *pri);
|
||||
|
||||
|
||||
extern gint _gimp_tile_width;
|
||||
|
@ -76,33 +77,33 @@ extern gint _gimp_tile_height;
|
|||
|
||||
|
||||
void
|
||||
gimp_pixel_rgn_init (GPixelRgn *pr,
|
||||
GDrawable *drawable,
|
||||
int x,
|
||||
int y,
|
||||
int width,
|
||||
int height,
|
||||
int dirty,
|
||||
int shadow)
|
||||
gimp_pixel_rgn_init (GimpPixelRgn *pr,
|
||||
GimpDrawable *drawable,
|
||||
gint x,
|
||||
gint y,
|
||||
gint width,
|
||||
gint height,
|
||||
gboolean dirty,
|
||||
gboolean shadow)
|
||||
{
|
||||
pr->data = NULL;
|
||||
pr->drawable = drawable;
|
||||
pr->bpp = drawable->bpp;
|
||||
pr->data = NULL;
|
||||
pr->drawable = drawable;
|
||||
pr->bpp = drawable->bpp;
|
||||
pr->rowstride = pr->bpp * TILE_WIDTH;
|
||||
pr->x = x;
|
||||
pr->y = y;
|
||||
pr->w = width;
|
||||
pr->h = height;
|
||||
pr->dirty = dirty;
|
||||
pr->shadow = shadow;
|
||||
pr->x = x;
|
||||
pr->y = y;
|
||||
pr->w = width;
|
||||
pr->h = height;
|
||||
pr->dirty = dirty;
|
||||
pr->shadow = shadow;
|
||||
}
|
||||
|
||||
void
|
||||
gimp_pixel_rgn_resize (GPixelRgn *pr,
|
||||
int x,
|
||||
int y,
|
||||
int width,
|
||||
int height)
|
||||
gimp_pixel_rgn_resize (GimpPixelRgn *pr,
|
||||
gint x,
|
||||
gint y,
|
||||
gint width,
|
||||
gint height)
|
||||
{
|
||||
if (pr->data != NULL)
|
||||
pr->data += ((y - pr->y) * pr->rowstride +
|
||||
|
@ -115,14 +116,14 @@ gimp_pixel_rgn_resize (GPixelRgn *pr,
|
|||
}
|
||||
|
||||
void
|
||||
gimp_pixel_rgn_get_pixel (GPixelRgn *pr,
|
||||
guchar *buf,
|
||||
int x,
|
||||
int y)
|
||||
gimp_pixel_rgn_get_pixel (GimpPixelRgn *pr,
|
||||
guchar *buf,
|
||||
gint x,
|
||||
gint y)
|
||||
{
|
||||
GTile *tile;
|
||||
guchar *tile_data;
|
||||
int b;
|
||||
GimpTile *tile;
|
||||
guchar *tile_data;
|
||||
gint b;
|
||||
|
||||
tile = gimp_drawable_get_tile2 (pr->drawable, pr->shadow, x, y);
|
||||
gimp_tile_ref (tile);
|
||||
|
@ -136,19 +137,19 @@ gimp_pixel_rgn_get_pixel (GPixelRgn *pr,
|
|||
}
|
||||
|
||||
void
|
||||
gimp_pixel_rgn_get_row (GPixelRgn *pr,
|
||||
guchar *buf,
|
||||
int x,
|
||||
int y,
|
||||
int width)
|
||||
gimp_pixel_rgn_get_row (GimpPixelRgn *pr,
|
||||
guchar *buf,
|
||||
gint x,
|
||||
gint y,
|
||||
gint width)
|
||||
{
|
||||
GTile *tile;
|
||||
guchar *tile_data;
|
||||
int bpp, inc, min;
|
||||
int end;
|
||||
int boundary;
|
||||
GimpTile *tile;
|
||||
guchar *tile_data;
|
||||
gint bpp, inc, min;
|
||||
gint end;
|
||||
gint boundary;
|
||||
#ifndef MEMCPY_IS_NICE
|
||||
int b;
|
||||
gint b;
|
||||
#endif
|
||||
|
||||
end = x + width;
|
||||
|
@ -165,8 +166,8 @@ gimp_pixel_rgn_get_row (GPixelRgn *pr,
|
|||
#ifdef MEMCPY_IS_NICE
|
||||
memcpy ((void *)buf,
|
||||
(const void *)tile_data,
|
||||
inc = (bpp *
|
||||
( (min = MIN(end,boundary)) -x) ) );
|
||||
inc = (bpp *
|
||||
( (min = MIN (end, boundary)) -x) ) );
|
||||
x = min;;
|
||||
buf += inc;
|
||||
#else
|
||||
|
@ -183,18 +184,18 @@ gimp_pixel_rgn_get_row (GPixelRgn *pr,
|
|||
}
|
||||
|
||||
void
|
||||
gimp_pixel_rgn_get_col (GPixelRgn *pr,
|
||||
guchar *buf,
|
||||
int x,
|
||||
int y,
|
||||
int height)
|
||||
gimp_pixel_rgn_get_col (GimpPixelRgn *pr,
|
||||
guchar *buf,
|
||||
gint x,
|
||||
gint y,
|
||||
gint height)
|
||||
{
|
||||
GTile *tile;
|
||||
guchar *tile_data;
|
||||
int inc;
|
||||
int end;
|
||||
int boundary;
|
||||
int b;
|
||||
GimpTile *tile;
|
||||
guchar *tile_data;
|
||||
gint inc;
|
||||
gint end;
|
||||
gint boundary;
|
||||
gint b;
|
||||
|
||||
end = y + height;
|
||||
|
||||
|
@ -219,24 +220,25 @@ gimp_pixel_rgn_get_col (GPixelRgn *pr,
|
|||
}
|
||||
|
||||
void
|
||||
gimp_pixel_rgn_get_rect (GPixelRgn *pr,
|
||||
guchar *buf,
|
||||
int x,
|
||||
int y,
|
||||
int width,
|
||||
int height)
|
||||
gimp_pixel_rgn_get_rect (GimpPixelRgn *pr,
|
||||
guchar *buf,
|
||||
gint x,
|
||||
gint y,
|
||||
gint width,
|
||||
gint height)
|
||||
{
|
||||
GTile *tile;
|
||||
guchar *src, *dest;
|
||||
gulong bufstride;
|
||||
int xstart, ystart;
|
||||
int xend, yend;
|
||||
int xboundary;
|
||||
int yboundary;
|
||||
int xstep, ystep;
|
||||
int ty, bpp;
|
||||
GimpTile *tile;
|
||||
guchar *src;
|
||||
guchar *dest;
|
||||
gulong bufstride;
|
||||
gint xstart, ystart;
|
||||
gint xend, yend;
|
||||
gint xboundary;
|
||||
gint yboundary;
|
||||
gint xstep, ystep;
|
||||
gint ty, bpp;
|
||||
#ifndef MEMCPY_IS_NICE
|
||||
int b, tx;
|
||||
gint b, tx;
|
||||
#endif
|
||||
|
||||
bpp = pr->bpp;
|
||||
|
@ -289,14 +291,14 @@ gimp_pixel_rgn_get_rect (GPixelRgn *pr,
|
|||
}
|
||||
|
||||
void
|
||||
gimp_pixel_rgn_set_pixel (GPixelRgn *pr,
|
||||
guchar *buf,
|
||||
int x,
|
||||
int y)
|
||||
gimp_pixel_rgn_set_pixel (GimpPixelRgn *pr,
|
||||
guchar *buf,
|
||||
gint x,
|
||||
gint y)
|
||||
{
|
||||
GTile *tile;
|
||||
guchar *tile_data;
|
||||
int b;
|
||||
GimpTile *tile;
|
||||
guchar *tile_data;
|
||||
gint b;
|
||||
|
||||
tile = gimp_drawable_get_tile2 (pr->drawable, pr->shadow, x, y);
|
||||
gimp_tile_ref (tile);
|
||||
|
@ -310,19 +312,19 @@ gimp_pixel_rgn_set_pixel (GPixelRgn *pr,
|
|||
}
|
||||
|
||||
void
|
||||
gimp_pixel_rgn_set_row (GPixelRgn *pr,
|
||||
guchar *buf,
|
||||
int x,
|
||||
int y,
|
||||
int width)
|
||||
gimp_pixel_rgn_set_row (GimpPixelRgn *pr,
|
||||
guchar *buf,
|
||||
gint x,
|
||||
gint y,
|
||||
gint width)
|
||||
{
|
||||
GTile *tile;
|
||||
guchar *tile_data;
|
||||
int inc, min;
|
||||
int end;
|
||||
int boundary;
|
||||
GimpTile *tile;
|
||||
guchar *tile_data;
|
||||
gint inc, min;
|
||||
gint end;
|
||||
gint boundary;
|
||||
#ifndef MEMCPY_IS_NICE
|
||||
int b;
|
||||
gint b;
|
||||
#endif
|
||||
|
||||
end = x + width;
|
||||
|
@ -355,18 +357,18 @@ gimp_pixel_rgn_set_row (GPixelRgn *pr,
|
|||
}
|
||||
|
||||
void
|
||||
gimp_pixel_rgn_set_col (GPixelRgn *pr,
|
||||
guchar *buf,
|
||||
int x,
|
||||
int y,
|
||||
int height)
|
||||
gimp_pixel_rgn_set_col (GimpPixelRgn *pr,
|
||||
guchar *buf,
|
||||
gint x,
|
||||
gint y,
|
||||
gint height)
|
||||
{
|
||||
GTile *tile;
|
||||
guchar *tile_data;
|
||||
int inc;
|
||||
int end;
|
||||
int boundary;
|
||||
int b;
|
||||
GimpTile *tile;
|
||||
guchar *tile_data;
|
||||
gint inc;
|
||||
gint end;
|
||||
gint boundary;
|
||||
gint b;
|
||||
|
||||
end = y + height;
|
||||
|
||||
|
@ -391,24 +393,25 @@ gimp_pixel_rgn_set_col (GPixelRgn *pr,
|
|||
}
|
||||
|
||||
void
|
||||
gimp_pixel_rgn_set_rect (GPixelRgn *pr,
|
||||
guchar *buf,
|
||||
int x,
|
||||
int y,
|
||||
int width,
|
||||
int height)
|
||||
gimp_pixel_rgn_set_rect (GimpPixelRgn *pr,
|
||||
guchar *buf,
|
||||
gint x,
|
||||
gint y,
|
||||
gint width,
|
||||
gint height)
|
||||
{
|
||||
GTile *tile;
|
||||
guchar *src, *dest;
|
||||
gulong bufstride;
|
||||
int xstart, ystart;
|
||||
int xend, yend;
|
||||
int xboundary;
|
||||
int yboundary;
|
||||
int xstep, ystep;
|
||||
int ty, bpp;
|
||||
GimpTile *tile;
|
||||
guchar *src;
|
||||
guchar *dest;
|
||||
gulong bufstride;
|
||||
gint xstart, ystart;
|
||||
gint xend, yend;
|
||||
gint xboundary;
|
||||
gint yboundary;
|
||||
gint xstep, ystep;
|
||||
gint ty, bpp;
|
||||
#ifndef MEMCPY_IS_NICE
|
||||
int b, tx;
|
||||
gint b, tx;
|
||||
#endif
|
||||
|
||||
bpp = pr->bpp;
|
||||
|
@ -460,14 +463,15 @@ gimp_pixel_rgn_set_rect (GPixelRgn *pr,
|
|||
}
|
||||
|
||||
gpointer
|
||||
gimp_pixel_rgns_register2 (int nrgns, GPixelRgn **prs)
|
||||
gimp_pixel_rgns_register2 (gint nrgns,
|
||||
GimpPixelRgn **prs)
|
||||
{
|
||||
GPixelRgn *pr;
|
||||
GPixelRgnHolder *prh;
|
||||
GPixelRgnIterator *pri;
|
||||
int found;
|
||||
GimpPixelRgn *pr;
|
||||
GimpPixelRgnHolder *prh;
|
||||
GimpPixelRgnIterator *pri;
|
||||
gboolean found;
|
||||
|
||||
pri = g_new (GPixelRgnIterator, 1);
|
||||
pri = g_new (GimpPixelRgnIterator, 1);
|
||||
pri->pixel_regions = NULL;
|
||||
pri->process_count = 0;
|
||||
|
||||
|
@ -478,7 +482,7 @@ gimp_pixel_rgns_register2 (int nrgns, GPixelRgn **prs)
|
|||
while (nrgns --)
|
||||
{
|
||||
pr = prs[nrgns];
|
||||
prh = g_new (GPixelRgnHolder, 1);
|
||||
prh = g_new (GimpPixelRgnHolder, 1);
|
||||
prh->pr = pr;
|
||||
|
||||
if (pr != NULL)
|
||||
|
@ -486,15 +490,15 @@ gimp_pixel_rgns_register2 (int nrgns, GPixelRgn **prs)
|
|||
/* If there is a defined value for data, make sure tiles is NULL */
|
||||
if (pr->data)
|
||||
pr->drawable = NULL;
|
||||
prh->original_data = pr->data;
|
||||
prh->startx = pr->x;
|
||||
prh->starty = pr->y;
|
||||
prh->original_data = pr->data;
|
||||
prh->startx = pr->x;
|
||||
prh->starty = pr->y;
|
||||
prh->pr->process_count = 0;
|
||||
|
||||
if (!found)
|
||||
{
|
||||
found = TRUE;
|
||||
pri->region_width = pr->w;
|
||||
pri->region_width = pr->w;
|
||||
pri->region_height = pr->h;
|
||||
}
|
||||
}
|
||||
|
@ -507,25 +511,25 @@ gimp_pixel_rgns_register2 (int nrgns, GPixelRgn **prs)
|
|||
}
|
||||
|
||||
gpointer
|
||||
gimp_pixel_rgns_register (int nrgns,
|
||||
gimp_pixel_rgns_register (gint nrgns,
|
||||
...)
|
||||
{
|
||||
GPixelRgn **prs;
|
||||
GimpPixelRgn **prs;
|
||||
gpointer pri;
|
||||
int n;
|
||||
gint n;
|
||||
va_list ap;
|
||||
|
||||
prs = g_new (GPixelRgn *,nrgns);
|
||||
prs = g_new (GimpPixelRgn *, nrgns);
|
||||
|
||||
va_start (ap, nrgns);
|
||||
|
||||
for (n = nrgns; n--; )
|
||||
prs[n] = va_arg (ap, GPixelRgn *);
|
||||
prs[n] = va_arg (ap, GimpPixelRgn *);
|
||||
|
||||
va_end (ap);
|
||||
|
||||
pri = gimp_pixel_rgns_register2 (nrgns, prs);
|
||||
|
||||
|
||||
g_free (prs);
|
||||
|
||||
return pri;
|
||||
|
@ -535,10 +539,10 @@ gpointer
|
|||
gimp_pixel_rgns_process (gpointer pri_ptr)
|
||||
{
|
||||
GSList *list;
|
||||
GPixelRgnHolder *prh;
|
||||
GPixelRgnIterator *pri;
|
||||
GimpPixelRgnHolder *prh;
|
||||
GimpPixelRgnIterator *pri;
|
||||
|
||||
pri = (GPixelRgnIterator*) pri_ptr;
|
||||
pri = (GimpPixelRgnIterator*) pri_ptr;
|
||||
pri->process_count++;
|
||||
|
||||
/* Unref all referenced tiles and increment the offsets */
|
||||
|
@ -546,7 +550,7 @@ gimp_pixel_rgns_process (gpointer pri_ptr)
|
|||
list = pri->pixel_regions;
|
||||
while (list)
|
||||
{
|
||||
prh = (GPixelRgnHolder*) list->data;
|
||||
prh = (GimpPixelRgnHolder *) list->data;
|
||||
list = list->next;
|
||||
|
||||
if ((prh->pr != NULL) && (prh->pr->process_count != pri->process_count))
|
||||
|
@ -559,7 +563,7 @@ gimp_pixel_rgns_process (gpointer pri_ptr)
|
|||
/* Unref the last referenced tile if the underlying region is a tile manager */
|
||||
if (prh->pr->drawable)
|
||||
{
|
||||
GTile *tile = gimp_drawable_get_tile2 (prh->pr->drawable, prh->pr->shadow,
|
||||
GimpTile *tile = gimp_drawable_get_tile2 (prh->pr->drawable, prh->pr->shadow,
|
||||
prh->pr->x, prh->pr->y);
|
||||
gimp_tile_unref (tile, prh->pr->dirty);
|
||||
}
|
||||
|
@ -578,13 +582,13 @@ gimp_pixel_rgns_process (gpointer pri_ptr)
|
|||
}
|
||||
|
||||
|
||||
static int
|
||||
gimp_get_portion_width (GPixelRgnIterator *pri)
|
||||
static gint
|
||||
gimp_get_portion_width (GimpPixelRgnIterator *pri)
|
||||
{
|
||||
GimpPixelRgnHolder *prh;
|
||||
GSList *list;
|
||||
GPixelRgnHolder *prh;
|
||||
int min_width = G_MAXINT;
|
||||
int width;
|
||||
gint min_width = G_MAXINT;
|
||||
gint width;
|
||||
|
||||
/* Find the minimum width to the next vertical tile (in the case of a tile manager)
|
||||
* or to the end of the pixel region (in the case of no tile manager)
|
||||
|
@ -593,7 +597,7 @@ gimp_get_portion_width (GPixelRgnIterator *pri)
|
|||
list = pri->pixel_regions;
|
||||
while (list)
|
||||
{
|
||||
prh = (GPixelRgnHolder *) list->data;
|
||||
prh = (GimpPixelRgnHolder *) list->data;
|
||||
|
||||
if (prh->pr)
|
||||
{
|
||||
|
@ -620,12 +624,12 @@ gimp_get_portion_width (GPixelRgnIterator *pri)
|
|||
}
|
||||
|
||||
static int
|
||||
gimp_get_portion_height (GPixelRgnIterator *pri)
|
||||
gimp_get_portion_height (GimpPixelRgnIterator *pri)
|
||||
{
|
||||
GimpPixelRgnHolder *prh;
|
||||
GSList *list;
|
||||
GPixelRgnHolder *prh;
|
||||
int min_height = G_MAXINT;
|
||||
int height;
|
||||
gint min_height = G_MAXINT;
|
||||
gint height;
|
||||
|
||||
/* Find the minimum height to the next vertical tile (in the case of a tile manager)
|
||||
* or to the end of the pixel region (in the case of no tile manager)
|
||||
|
@ -634,7 +638,7 @@ gimp_get_portion_height (GPixelRgnIterator *pri)
|
|||
list = pri->pixel_regions;
|
||||
while (list)
|
||||
{
|
||||
prh = (GPixelRgnHolder *) list->data;
|
||||
prh = (GimpPixelRgnHolder *) list->data;
|
||||
|
||||
if (prh->pr)
|
||||
{
|
||||
|
@ -661,10 +665,10 @@ gimp_get_portion_height (GPixelRgnIterator *pri)
|
|||
}
|
||||
|
||||
static gpointer
|
||||
gimp_pixel_rgns_configure (GPixelRgnIterator *pri)
|
||||
gimp_pixel_rgns_configure (GimpPixelRgnIterator *pri)
|
||||
{
|
||||
GPixelRgnHolder *prh;
|
||||
GSList *list;
|
||||
GimpPixelRgnHolder *prh;
|
||||
GSList *list;
|
||||
|
||||
/* Determine the portion width and height */
|
||||
pri->portion_width = gimp_get_portion_width (pri);
|
||||
|
@ -691,26 +695,23 @@ gimp_pixel_rgns_configure (GPixelRgnIterator *pri)
|
|||
|
||||
pri->process_count++;
|
||||
|
||||
list = pri->pixel_regions;
|
||||
while (list)
|
||||
for (list = pri->pixel_regions; list; list = g_slist_next (list))
|
||||
{
|
||||
prh = (GPixelRgnHolder *) list->data;
|
||||
prh = (GimpPixelRgnHolder *) list->data;
|
||||
|
||||
if ((prh->pr != NULL) && (prh->pr->process_count != pri->process_count))
|
||||
{
|
||||
prh->pr->process_count++;
|
||||
gimp_pixel_rgn_configure (prh, pri);
|
||||
}
|
||||
|
||||
list = list->next;
|
||||
}
|
||||
|
||||
return pri;
|
||||
}
|
||||
|
||||
static void
|
||||
gimp_pixel_rgn_configure (GPixelRgnHolder *prh,
|
||||
GPixelRgnIterator *pri)
|
||||
gimp_pixel_rgn_configure (GimpPixelRgnHolder *prh,
|
||||
GimpPixelRgnIterator *pri)
|
||||
{
|
||||
/* Configure the rowstride and data pointer for the pixel region
|
||||
* based on the current offsets into the region and whether the
|
||||
|
@ -718,8 +719,9 @@ gimp_pixel_rgn_configure (GPixelRgnHolder *prh,
|
|||
*/
|
||||
if (prh->pr->drawable)
|
||||
{
|
||||
GTile *tile;
|
||||
int offx, offy;
|
||||
GimpTile *tile;
|
||||
gint offx;
|
||||
gint offy;
|
||||
|
||||
tile = gimp_drawable_get_tile2 (prh->pr->drawable, prh->pr->shadow, prh->pr->x, prh->pr->y);
|
||||
gimp_tile_ref (tile);
|
||||
|
|
|
@ -0,0 +1,110 @@
|
|||
/* LIBGIMP - The GIMP Library
|
||||
* Copyright (C) 1995-1997 Peter Mattis and Spencer Kimball
|
||||
*
|
||||
* gimppixelrgn.h
|
||||
*
|
||||
* This library is free software; you can redistribute it and/or
|
||||
* modify it under the terms of the GNU Lesser General Public
|
||||
* License as published by the Free Software Foundation; either
|
||||
* version 2 of the License, or (at your option) any later version.
|
||||
*
|
||||
* This library 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
|
||||
* Lesser General Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU Lesser General Public
|
||||
* License along with this library; if not, write to the
|
||||
* Free Software Foundation, Inc., 59 Temple Place - Suite 330,
|
||||
* Boston, MA 02111-1307, USA.
|
||||
*/
|
||||
|
||||
#ifndef __GIMP_PIXEL_RGN_H__
|
||||
#define __GIMP_PIXEL_RGN_H__
|
||||
|
||||
#ifdef __cplusplus
|
||||
extern "C" {
|
||||
#endif /* __cplusplus */
|
||||
|
||||
/* For information look into the C source or the html documentation */
|
||||
|
||||
|
||||
struct _GimpPixelRgn
|
||||
{
|
||||
guchar *data; /* pointer to region data */
|
||||
GimpDrawable *drawable; /* pointer to drawable */
|
||||
guint bpp; /* bytes per pixel */
|
||||
guint rowstride; /* bytes per pixel row */
|
||||
guint x, y; /* origin */
|
||||
guint w, h; /* width and height of region */
|
||||
guint dirty : 1; /* will this region be dirtied? */
|
||||
guint shadow : 1; /* will this region use the shadow or normal tiles */
|
||||
guint process_count; /* used internally */
|
||||
};
|
||||
|
||||
|
||||
void gimp_pixel_rgn_init (GimpPixelRgn *pr,
|
||||
GimpDrawable *drawable,
|
||||
gint x,
|
||||
gint y,
|
||||
gint width,
|
||||
gint height,
|
||||
gint dirty,
|
||||
gint shadow);
|
||||
void gimp_pixel_rgn_resize (GimpPixelRgn *pr,
|
||||
gint x,
|
||||
gint y,
|
||||
gint width,
|
||||
gint height);
|
||||
void gimp_pixel_rgn_get_pixel (GimpPixelRgn *pr,
|
||||
guchar *buf,
|
||||
gint x,
|
||||
gint y);
|
||||
void gimp_pixel_rgn_get_row (GimpPixelRgn *pr,
|
||||
guchar *buf,
|
||||
gint x,
|
||||
gint y,
|
||||
gint width);
|
||||
void gimp_pixel_rgn_get_col (GimpPixelRgn *pr,
|
||||
guchar *buf,
|
||||
gint x,
|
||||
gint y,
|
||||
gint height);
|
||||
void gimp_pixel_rgn_get_rect (GimpPixelRgn *pr,
|
||||
guchar *buf,
|
||||
gint x,
|
||||
gint y,
|
||||
gint width,
|
||||
gint height);
|
||||
void gimp_pixel_rgn_set_pixel (GimpPixelRgn *pr,
|
||||
guchar *buf,
|
||||
gint x,
|
||||
gint y);
|
||||
void gimp_pixel_rgn_set_row (GimpPixelRgn *pr,
|
||||
guchar *buf,
|
||||
gint x,
|
||||
gint y,
|
||||
gint width);
|
||||
void gimp_pixel_rgn_set_col (GimpPixelRgn *pr,
|
||||
guchar *buf,
|
||||
gint x,
|
||||
gint y,
|
||||
gint height);
|
||||
void gimp_pixel_rgn_set_rect (GimpPixelRgn *pr,
|
||||
guchar *buf,
|
||||
gint x,
|
||||
gint y,
|
||||
gint width,
|
||||
gint height);
|
||||
gpointer gimp_pixel_rgns_register (gint nrgns,
|
||||
...);
|
||||
gpointer gimp_pixel_rgns_register2 (gint nrgns,
|
||||
GimpPixelRgn **prs);
|
||||
gpointer gimp_pixel_rgns_process (gpointer pri_ptr);
|
||||
|
||||
|
||||
#ifdef __cplusplus
|
||||
}
|
||||
#endif /* __cplusplus */
|
||||
|
||||
#endif /* __GIMP_PIXEL_RGN_H__ */
|
|
@ -1,5 +1,7 @@
|
|||
/* LIBGIMP - The GIMP Library
|
||||
* Copyright (C) 1995-1997 Peter Mattis and Spencer Kimball
|
||||
* Copyright (C) 1995-1997 Peter Mattis and Spencer Kimball
|
||||
*
|
||||
* gimpselection_pdb.c
|
||||
*
|
||||
* This library is free software; you can redistribute it and/or
|
||||
* modify it under the terms of the GNU Lesser General Public
|
||||
|
@ -113,4 +115,3 @@ gimp_selection_none (gint32 image_ID)
|
|||
|
||||
return;
|
||||
}
|
||||
|
||||
|
|
|
@ -0,0 +1,50 @@
|
|||
/* LIBGIMP - The GIMP Library
|
||||
* Copyright (C) 1995-1997 Peter Mattis and Spencer Kimball
|
||||
*
|
||||
* gimpselection_pdb.h
|
||||
*
|
||||
* This library is free software; you can redistribute it and/or
|
||||
* modify it under the terms of the GNU Lesser General Public
|
||||
* License as published by the Free Software Foundation; either
|
||||
* version 2 of the License, or (at your option) any later version.
|
||||
*
|
||||
* This library 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
|
||||
* Lesser General Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU Lesser General Public
|
||||
* License along with this library; if not, write to the
|
||||
* Free Software Foundation, Inc., 59 Temple Place - Suite 330,
|
||||
* Boston, MA 02111-1307, USA.
|
||||
*/
|
||||
|
||||
#ifndef __GIMP_SELECTION_PDB_H__
|
||||
#define __GIMP_SELECTION_PDB_H__
|
||||
|
||||
#ifdef __cplusplus
|
||||
extern "C" {
|
||||
#endif /* __cplusplus */
|
||||
|
||||
/* For information look into the C source or the html documentation */
|
||||
|
||||
|
||||
gint32 gimp_selection_bounds (gint32 image_ID,
|
||||
gint32 *non_empty,
|
||||
gint32 *x1,
|
||||
gint32 *y1,
|
||||
gint32 *x2,
|
||||
gint32 *y2);
|
||||
gint32 gimp_selection_float (gint32 image_ID,
|
||||
gint32 drawable_ID,
|
||||
gint32 x_offset,
|
||||
gint32 y_offset);
|
||||
gint32 gimp_selection_is_empty (gint32 image_ID);
|
||||
void gimp_selection_none (gint32 image_ID);
|
||||
|
||||
|
||||
#ifdef __cplusplus
|
||||
}
|
||||
#endif /* __cplusplus */
|
||||
|
||||
#endif /* __GIMP_SELECTION_PDB_H__ */
|
|
@ -1,55 +1,61 @@
|
|||
/* LIBGIMP - The GIMP Library
|
||||
* Copyright (C) 1995-1997 Peter Mattis and Spencer Kimball
|
||||
/* LIBGIMP - The GIMP Library
|
||||
* Copyright (C) 1995-1997 Peter Mattis and Spencer Kimball
|
||||
*
|
||||
* gimptile.c
|
||||
*
|
||||
* This library is free software; you can redistribute it and/or
|
||||
* modify it under the terms of the GNU Lesser General Public
|
||||
* License as published by the Free Software Foundation; either
|
||||
* version 2 of the License, or (at your option) any later version.
|
||||
*
|
||||
* This library 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
|
||||
* version 2 of the License, or (at your option) any later version.
|
||||
*
|
||||
* This library 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
|
||||
* Library General Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU Lesser General Public
|
||||
* License along with this library; if not, write to the
|
||||
* Free Software Foundation, Inc., 59 Temple Place - Suite 330,
|
||||
* Boston, MA 02111-1307, USA.
|
||||
*/
|
||||
*/
|
||||
|
||||
#include <string.h>
|
||||
|
||||
#include "gimp.h"
|
||||
#include "gimpprotocol.h"
|
||||
#include "gimpwire.h"
|
||||
|
||||
|
||||
/* This is the percentage of the maximum cache size that should be cleared
|
||||
* from the cache when an eviction is necessary
|
||||
/* This is the percentage of the maximum cache size that
|
||||
* should be cleared from the cache when an eviction is
|
||||
* necessary.
|
||||
*/
|
||||
#define FREE_QUANTUM 0.1
|
||||
|
||||
void gimp_read_expect_msg(WireMessage *msg, int type);
|
||||
void gimp_read_expect_msg (WireMessage *msg,
|
||||
gint type);
|
||||
|
||||
static void gimp_tile_get (GTile *tile);
|
||||
static void gimp_tile_put (GTile *tile);
|
||||
static void gimp_tile_cache_insert (GTile *tile);
|
||||
static void gimp_tile_cache_flush (GTile *tile);
|
||||
static void gimp_tile_get (GimpTile *tile);
|
||||
static void gimp_tile_put (GimpTile *tile);
|
||||
static void gimp_tile_cache_insert (GimpTile *tile);
|
||||
static void gimp_tile_cache_flush (GimpTile *tile);
|
||||
static void gimp_tile_cache_zorch (void);
|
||||
static guint gimp_tile_hash (GTile *tile);
|
||||
static guint gimp_tile_hash (GimpTile *tile);
|
||||
|
||||
|
||||
gint _gimp_tile_width = -1;
|
||||
gint _gimp_tile_width = -1;
|
||||
gint _gimp_tile_height = -1;
|
||||
|
||||
static GHashTable *tile_hash_table = NULL;
|
||||
static GList *tile_list_head = NULL;
|
||||
static GList *tile_list_tail = NULL;
|
||||
static gulong max_tile_size = 0;
|
||||
static gulong cur_cache_size = 0;
|
||||
static gulong max_cache_size = 0;
|
||||
static GList *tile_list_head = NULL;
|
||||
static GList *tile_list_tail = NULL;
|
||||
static gulong max_tile_size = 0;
|
||||
static gulong cur_cache_size = 0;
|
||||
static gulong max_cache_size = 0;
|
||||
|
||||
|
||||
void
|
||||
gimp_tile_ref (GTile *tile)
|
||||
gimp_tile_ref (GimpTile *tile)
|
||||
{
|
||||
if (tile)
|
||||
{
|
||||
|
@ -66,7 +72,7 @@ gimp_tile_ref (GTile *tile)
|
|||
}
|
||||
|
||||
void
|
||||
gimp_tile_ref_zero (GTile *tile)
|
||||
gimp_tile_ref_zero (GimpTile *tile)
|
||||
{
|
||||
if (tile)
|
||||
{
|
||||
|
@ -83,8 +89,8 @@ gimp_tile_ref_zero (GTile *tile)
|
|||
}
|
||||
|
||||
void
|
||||
gimp_tile_unref (GTile *tile,
|
||||
int dirty)
|
||||
gimp_tile_unref (GimpTile *tile,
|
||||
gboolean dirty)
|
||||
{
|
||||
if (tile)
|
||||
{
|
||||
|
@ -101,7 +107,7 @@ gimp_tile_unref (GTile *tile,
|
|||
}
|
||||
|
||||
void
|
||||
gimp_tile_flush (GTile *tile)
|
||||
gimp_tile_flush (GimpTile *tile)
|
||||
{
|
||||
if (tile && tile->data && tile->dirty)
|
||||
{
|
||||
|
@ -123,20 +129,20 @@ gimp_tile_cache_ntiles (gulong ntiles)
|
|||
}
|
||||
|
||||
guint
|
||||
gimp_tile_width ()
|
||||
gimp_tile_width (void)
|
||||
{
|
||||
return _gimp_tile_width;
|
||||
}
|
||||
|
||||
guint
|
||||
gimp_tile_height ()
|
||||
gimp_tile_height (void)
|
||||
{
|
||||
return _gimp_tile_height;
|
||||
}
|
||||
|
||||
|
||||
static void
|
||||
gimp_tile_get (GTile *tile)
|
||||
gimp_tile_get (GimpTile *tile)
|
||||
{
|
||||
extern GIOChannel *_writechannel;
|
||||
extern guchar* _shm_addr;
|
||||
|
@ -183,10 +189,10 @@ gimp_tile_get (GTile *tile)
|
|||
}
|
||||
|
||||
static void
|
||||
gimp_tile_put (GTile *tile)
|
||||
gimp_tile_put (GimpTile *tile)
|
||||
{
|
||||
extern GIOChannel *_writechannel;
|
||||
extern guchar* _shm_addr;
|
||||
extern guchar *_shm_addr;
|
||||
|
||||
GPTileReq tile_req;
|
||||
GPTileData tile_data;
|
||||
|
@ -229,7 +235,7 @@ gimp_tile_put (GTile *tile)
|
|||
* in the file 'tile_cache.c' which is part of the main gimp application.
|
||||
*/
|
||||
static void
|
||||
gimp_tile_cache_insert (GTile *tile)
|
||||
gimp_tile_cache_insert (GimpTile *tile)
|
||||
{
|
||||
GList *tmp;
|
||||
|
||||
|
@ -320,7 +326,7 @@ gimp_tile_cache_insert (GTile *tile)
|
|||
}
|
||||
|
||||
static void
|
||||
gimp_tile_cache_flush (GTile *tile)
|
||||
gimp_tile_cache_flush (GimpTile *tile)
|
||||
{
|
||||
GList *tmp;
|
||||
|
||||
|
@ -362,14 +368,14 @@ gimp_tile_cache_flush (GTile *tile)
|
|||
}
|
||||
|
||||
static void
|
||||
gimp_tile_cache_zorch ()
|
||||
gimp_tile_cache_zorch (void)
|
||||
{
|
||||
if (tile_list_head)
|
||||
gimp_tile_cache_flush ((GTile*) tile_list_head->data);
|
||||
gimp_tile_cache_flush ((GimpTile*) tile_list_head->data);
|
||||
}
|
||||
|
||||
static guint
|
||||
gimp_tile_hash (GTile *tile)
|
||||
gimp_tile_hash (GimpTile *tile)
|
||||
{
|
||||
return (gulong) tile;
|
||||
}
|
||||
|
|
|
@ -0,0 +1,61 @@
|
|||
/* LIBGIMP - The GIMP Library
|
||||
* Copyright (C) 1995-1997 Peter Mattis and Spencer Kimball
|
||||
*
|
||||
* gimptile.h
|
||||
*
|
||||
* This library is free software; you can redistribute it and/or
|
||||
* modify it under the terms of the GNU Lesser General Public
|
||||
* License as published by the Free Software Foundation; either
|
||||
* version 2 of the License, or (at your option) any later version.
|
||||
*
|
||||
* This library 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
|
||||
* Lesser General Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU Lesser General Public
|
||||
* License along with this library; if not, write to the
|
||||
* Free Software Foundation, Inc., 59 Temple Place - Suite 330,
|
||||
* Boston, MA 02111-1307, USA.
|
||||
*/
|
||||
|
||||
#ifndef __GIMP_TILE_H__
|
||||
#define __GIMP_TILE_H__
|
||||
|
||||
#ifdef __cplusplus
|
||||
extern "C" {
|
||||
#endif /* __cplusplus */
|
||||
|
||||
/* For information look into the C source or the html documentation */
|
||||
|
||||
|
||||
struct _GimpTile
|
||||
{
|
||||
guint ewidth; /* the effective width of the tile */
|
||||
guint eheight; /* the effective height of the tile */
|
||||
guint bpp; /* the bytes per pixel (1, 2, 3 or 4 ) */
|
||||
guint tile_num; /* the number of this tile within the drawable */
|
||||
guint16 ref_count; /* reference count for the tile */
|
||||
guint dirty : 1; /* is the tile dirty? has it been modified? */
|
||||
guint shadow: 1; /* is this a shadow tile */
|
||||
guchar *data; /* the pixel data for the tile */
|
||||
GimpDrawable *drawable; /* the drawable this tile came from */
|
||||
};
|
||||
|
||||
|
||||
void gimp_tile_ref (GimpTile *tile);
|
||||
void gimp_tile_ref_zero (GimpTile *tile);
|
||||
void gimp_tile_unref (GimpTile *tile,
|
||||
gboolean dirty);
|
||||
void gimp_tile_flush (GimpTile *tile);
|
||||
void gimp_tile_cache_size (gulong kilobytes);
|
||||
void gimp_tile_cache_ntiles (gulong ntiles);
|
||||
guint gimp_tile_width (void);
|
||||
guint gimp_tile_height (void);
|
||||
|
||||
|
||||
#ifdef __cplusplus
|
||||
}
|
||||
#endif /* __cplusplus */
|
||||
|
||||
#endif /* __GIMP_TILE_H__ */
|
|
@ -0,0 +1,47 @@
|
|||
/* LIBGIMP - The GIMP Library
|
||||
* Copyright (C) 1995-1997 Peter Mattis and Spencer Kimball
|
||||
*
|
||||
* gimptypes.h
|
||||
*
|
||||
* This library is free software; you can redistribute it and/or
|
||||
* modify it under the terms of the GNU Lesser General Public
|
||||
* License as published by the Free Software Foundation; either
|
||||
* version 2 of the License, or (at your option) any later version.
|
||||
*
|
||||
* This library 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
|
||||
* Lesser General Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU Lesser General Public
|
||||
* License along with this library; if not, write to the
|
||||
* Free Software Foundation, Inc., 59 Temple Place - Suite 330,
|
||||
* Boston, MA 02111-1307, USA.
|
||||
*/
|
||||
|
||||
#ifndef __GIMP_TYPES_H__
|
||||
#define __GIMP_TYPES_H__
|
||||
|
||||
#ifdef __cplusplus
|
||||
extern "C" {
|
||||
#endif /* __cplusplus */
|
||||
|
||||
/* For information look into the html documentation */
|
||||
|
||||
|
||||
typedef struct _GimpPlugInInfo GimpPlugInInfo;
|
||||
typedef struct _GimpTile GimpTile;
|
||||
typedef struct _GimpDrawable GimpDrawable;
|
||||
typedef struct _GimpPixelRgn GimpPixelRgn;
|
||||
typedef struct _GimpParamDef GimpParamDef;
|
||||
typedef struct _GimpParamColor GimpParamColor;
|
||||
typedef struct _GimpParamRegion GimpParamRegion;
|
||||
typedef union _GimpParamData GimpParamData;
|
||||
typedef struct _GimpParam GimpParam;
|
||||
|
||||
|
||||
#ifdef __cplusplus
|
||||
}
|
||||
#endif /* __cplusplus */
|
||||
|
||||
#endif /* __GIMP_TYPES_H__ */
|
|
@ -0,0 +1,36 @@
|
|||
/* LIBGIMP - The GIMP Library
|
||||
* Copyright (C) 1995-1997 Peter Mattis and Spencer Kimball
|
||||
*
|
||||
* gimpunit_pdb.h
|
||||
*
|
||||
* This library is free software; you can redistribute it and/or
|
||||
* modify it under the terms of the GNU Lesser General Public
|
||||
* License as published by the Free Software Foundation; either
|
||||
* version 2 of the License, or (at your option) any later version.
|
||||
*
|
||||
* This library 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
|
||||
* Lesser General Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU Lesser General Public
|
||||
* License along with this library; if not, write to the
|
||||
* Free Software Foundation, Inc., 59 Temple Place - Suite 330,
|
||||
* Boston, MA 02111-1307, USA.
|
||||
*/
|
||||
|
||||
#ifndef __GIMP_UNIT_PDB_H__
|
||||
#define __GIMP_UNIT_PDB_H__
|
||||
|
||||
#ifdef __cplusplus
|
||||
extern "C" {
|
||||
#endif /* __cplusplus */
|
||||
|
||||
/* For information look into the C source or the html documentation */
|
||||
|
||||
|
||||
#ifdef __cplusplus
|
||||
}
|
||||
#endif /* __cplusplus */
|
||||
|
||||
#endif /* __GIMP_UNIT_PDB_H__ */
|
|
@ -56,7 +56,8 @@ sub plugin_help_register {
|
|||
$help = <<HELP;
|
||||
This procedure changes the help rootdir for the plug-in which calls it. All
|
||||
subsequent calls of gimp_help from this plug-in will be interpreted relative
|
||||
to this rootdir.
|
||||
to this rootdir. This procedure can only be called in the query function of
|
||||
a plug-in and it has to be called before any procedure is installed.
|
||||
HELP
|
||||
|
||||
&pdb_misc;
|
||||
|
|
|
@ -252,10 +252,10 @@ sub plugin_domain_add {
|
|||
This procedure adds a textdomain to the list of domains Gimp searches
|
||||
for strings when translating its menu entries. There is no need to
|
||||
call this function for plug-ins that have their strings included in
|
||||
the gimp-std-plugins domain as that is use by default. If the compiled
|
||||
the gimp-std-plugins domain as that is used by default. If the compiled
|
||||
message catalog is not in the standard location, you may specify an
|
||||
absolute path to another location. This procedure can only be called
|
||||
in the query function of a plug-in and it has to be called before a
|
||||
in the query function of a plug-in and it has to be called before any
|
||||
procedure is installed.
|
||||
HELP
|
||||
|
||||
|
|
Loading…
Reference in New Issue