Commit 763bd6ab authored by Manish Singh's avatar Manish Singh

great renaming

-Yosh
parent 1c10cb05
......@@ -61,12 +61,12 @@ libgimpi_a_SOURCES = \
gimpwidgets.h \
gimpwire.c \
gimpwire.h \
parasite.c \
parasite.h \
parasiteF.h \
parasiteP.h \
parasiteio.c \
parasiteio.h
gimpparasite.c \
gimpparasite.h \
gimpparasiteF.h \
gimpparasiteP.h \
gimpparasiteio.c \
gimpparasiteio.h
if STATICLIBS
## Evil hack to insure all deps are satisfied on first-run make
......@@ -80,27 +80,27 @@ endif
libgimp_la_SOURCES = \
gimp.c \
gimpchannel.c \
gimpchannel_pdb.c \
gimpcolorbutton.h \
gimpcolorspace.c \
gimpdisplay.c \
gimpdrawable.c \
gimpdisplay_pdb.c \
gimpdrawable_pdb.c \
gimpenv.c \
gimpgradient.c \
gimphelp.c \
gimpimage.c \
gimplayer.c \
gimpgradient_pdb.c \
gimphelp_pdb.c \
gimpimage_pdb.c \
gimplayer_pdb.c \
gimpmatrix.c \
gimpmatrix.h \
gimppalette.c \
gimpparasite.c \
gimppalette_pdb.c \
gimpparasite_pdb.c \
gimppixelrgn.c \
gimpprotocol.c \
gimpprotocol.h \
gimpselection.c \
gimpselection_pdb.c \
gimpsignal.c \
gimptile.c \
gimpunit.c \
gimpunit_pdb.c \
gimpunit.h \
gimputils.c \
gimputils.h \
......
/* The GIMP -- an image manipulation program
* Copyright (C) 1999 Manish Singh <yosh@gimp.org>
*
* This program 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 program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU Lesser General Public License
* along with this program; if not, write to the Free Software
* Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
*/
#ifndef __GIMP_COLOR_DISPLAY_H__
#define __GIMP_COLOR_DISPLAY_H__
#include <glib.h>
#include <gmodule.h>
#include <libgimp/parasiteF.h>
typedef void (* GimpColorDisplayInit) (void);
typedef gpointer (* GimpColorDisplayNew) (gint type);
typedef gpointer (* GimpColorDisplayClone) (gpointer cd_ID);
typedef void (* GimpColorDisplayConvert) (gpointer cd_ID,
guchar *buf,
gint width,
gint height,
gint bpp,
gint bpl);
typedef void (* GimpColorDisplayDestroy) (gpointer cd_ID);
typedef void (* GimpColorDisplayFinalize) (void);
typedef void (* GimpColorDisplayLoadState) (gpointer cd_ID,
GimpParasite *state);
typedef GimpParasite * (* GimpColorDisplaySaveState) (gpointer cd_ID);
typedef void (* GimpColorDisplayConfigure) (gpointer cd_ID,
GFunc ok_func,
gpointer ok_data,
GFunc cancel_func,
gpointer cancel_data);
typedef void (* GimpColorDisplayConfigureCancel) (gpointer cd_ID);
typedef struct _GimpColorDisplayMethods GimpColorDisplayMethods;
struct _GimpColorDisplayMethods
{
GimpColorDisplayInit init;
GimpColorDisplayNew new;
GimpColorDisplayClone clone;
GimpColorDisplayConvert convert;
GimpColorDisplayDestroy destroy;
GimpColorDisplayFinalize finalize;
GimpColorDisplayLoadState load;
GimpColorDisplaySaveState save;
GimpColorDisplayConfigure configure;
GimpColorDisplayConfigureCancel cancel;
};
/*
* The following two functions are implemted and exported by gimp/app
* but need to be marked for it here too ...
*/
G_MODULE_EXPORT
gboolean gimp_color_display_register (const char *name,
GimpColorDisplayMethods *methods);
G_MODULE_EXPORT
gboolean gimp_color_display_unregister (const char *name);
#endif /* __GIMP_COLOR_DISPLAY_H__ */
/* LIBGIMP - The GIMP Library
* Copyright (C) 1995-1997 Peter Mattis and Spencer Kimball
*
* Colour selector module (C) 1999 Austin Donnelly <austin@greenend.org.uk>
*
* This program 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 program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU Lesser General Public License
* along with this program; if not, write to the Free Software
* Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
*/
#ifndef __COLOR_SELECTOR_H__
#define __COLOR_SELECTOR_H__
/********************************/
/* color selector registration */
/* A function of this type should be called by the color selector each
* time the user modifies the selected color. */
typedef void (*GimpColorSelector_Callback)(void *data, int r, int g, int b);
/* A function of this type is called to create a new instance of the
* color selector. The new selector should set its current color to
* the RGB triple given (each component is in the range 0 - 255
* inclusive, with white at 255,255,255 and black at 0,0,0).
*
* The selector should call "cb" with argument "data" each time the
* user modifies the selected color.
*
* The selector must return a GtkWidget which implements the color
* selection UI. The selector can optionally return "selector_data",
* an opaque pointer which will be passed in to subsequent invokations
* on the selector. */
typedef GtkWidget * (*GimpColorSelector_NewFunc)(int r, int g, int b,
GimpColorSelector_Callback cb,
void *data,
void **selector_data);
/* A function of this type is called when the color selector is no
* longer required. This function should not free widgets that are
* containted within the UI widget returned by new(), since they are
* destroyed on behalf of the selector by the caller of this
* function. */
typedef void (*GimpColorSelector_FreeFunc)(void *selector_data);
/* A function of this type is called to change the selector's current
* color. The required color is specified as in the new() function.
* If the "set_current" parameter is FALSE, then only the old color
* should be set - if "set_current" is TRUE, both the old color and
* the current color should be set to the RGB triple given. This
* function merely gives a hint to the color selector; the selector
* can choose to ignore this information. */
typedef void (*GimpColorSelector_SetColorFunc)(void *selector_data,
int r, int g, int b,
int set_current);
typedef struct _GimpColorSelectorMethods GimpColorSelectorMethods;
struct _GimpColorSelectorMethods {
GimpColorSelector_NewFunc new;
GimpColorSelector_FreeFunc free;
GimpColorSelector_SetColorFunc setcolor;
};
typedef void *GimpColorSelectorID;
#ifndef __COLOR_NOTEBOOK_C__ /* Bypass when compiling the source for
* these functions. */
/* Register a color selector. Returns an identifier for the color
* selector on success, or NULL if the name is already in use. Both
* the name and method table are internalised, so may be freed after
* this call. */
GimpColorSelectorID gimp_color_selector_register (const char *name,
const char *help_page,
GimpColorSelectorMethods *methods);
/* Remove the selector "id" from active service. New instances of the
* selector will not be created, but existing ones are allowed to
* continue. If "callback" is non-NULL, it will be called once all
* instances have finished. The callback could be used to unload
* dynamiclly loaded code, for example.
*
* Returns TRUE on success, FALSE if "id" was not found. */
gboolean gimp_color_selector_unregister (GimpColorSelectorID id,
void (*callback)(void *data),
void *data);
#endif /* !__COLOR_NOTEBOOK_C__ */
#endif /* __COLOR_SELECTOR_H__ */
......@@ -28,8 +28,8 @@
#include "libgimp/gimpenv.h"
#include "libgimp/gimplimits.h"
#include "libgimp/gimpmath.h"
#include "libgimp/parasite.h"
#include "libgimp/parasiteP.h"
#include "libgimp/gimpparasite.h"
#include "libgimp/gimpparasiteP.h"
#include "libgimp/gimpunit.h"
#include "libgimp/gimputils.h"
#include "libgimp/gimpvector.h"
......
/* LIBGIMP - The GIMP Library
* Copyright (C) 1995-1997 Peter Mattis and Spencer Kimball
*
* 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"
gint32
gimp_channel_new (gint32 image_ID,
gchar *name,
guint width,
guint height,
gdouble opacity,
guchar *color)
{
GParam *return_vals;
gint nreturn_vals;
gint32 channel_ID;
return_vals = gimp_run_procedure ("gimp_channel_new",
&nreturn_vals,
PARAM_IMAGE, image_ID,
PARAM_INT32, width,
PARAM_INT32, height,
PARAM_STRING, name,
PARAM_FLOAT, opacity,
PARAM_COLOR, color,
PARAM_END);
channel_ID = -1;
if (return_vals[0].data.d_status == STATUS_SUCCESS)
channel_ID = return_vals[1].data.d_channel;
gimp_destroy_params (return_vals, nreturn_vals);
return channel_ID;
}
gint32
gimp_channel_copy (gint32 channel_ID)
{
GParam *return_vals;
gint nreturn_vals;
return_vals = gimp_run_procedure ("gimp_channel_copy",
&nreturn_vals,
PARAM_CHANNEL, channel_ID,
PARAM_END);
channel_ID = -1;
if (return_vals[0].data.d_status == STATUS_SUCCESS)
channel_ID = return_vals[1].data.d_channel;
gimp_destroy_params (return_vals, nreturn_vals);
return channel_ID;
}
void
gimp_channel_delete (gint32 channel_ID)
{
GParam *return_vals;
gint nreturn_vals;
return_vals = gimp_run_procedure ("gimp_channel_delete",
&nreturn_vals,
PARAM_CHANNEL, channel_ID,
PARAM_END);
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,
guchar *green,
guchar *blue)
{
GParam *return_vals;
gint nreturn_vals;
return_vals = gimp_run_procedure ("gimp_channel_get_color",
&nreturn_vals,
PARAM_CHANNEL, channel_ID,
PARAM_END);
if (return_vals[0].data.d_status == STATUS_SUCCESS)
{
*red = return_vals[1].data.d_color.red;
*green = return_vals[1].data.d_color.green;
*blue = return_vals[1].data.d_color.blue;
}
gimp_destroy_params (return_vals, nreturn_vals);
}
gchar*
gimp_channel_get_name (gint32 channel_ID)
{
GParam *return_vals;
gint nreturn_vals;
gchar *name;
return_vals = gimp_run_procedure ("gimp_channel_get_name",
&nreturn_vals,
PARAM_CHANNEL, channel_ID,
PARAM_END);
name = NULL;
if (return_vals[0].data.d_status == STATUS_SUCCESS)
name = g_strdup (return_vals[1].data.d_string);
gimp_destroy_params (return_vals, nreturn_vals);
return name;
}
gdouble
gimp_channel_get_opacity (gint32 channel_ID)
{
GParam *return_vals;
gint nreturn_vals;
gdouble opacity;
return_vals = gimp_run_procedure ("gimp_channel_get_opacity",
&nreturn_vals,
PARAM_CHANNEL, channel_ID,
PARAM_END);
opacity = 0.0;
if (return_vals[0].data.d_status == STATUS_SUCCESS)
opacity = return_vals[1].data.d_float;
gimp_destroy_params (return_vals, nreturn_vals);
return opacity;
}
gboolean
gimp_channel_get_visible (gint32 channel_ID)
{
GParam *return_vals;
gint nreturn_vals;
gboolean visible;
return_vals = gimp_run_procedure ("gimp_channel_get_visible",
&nreturn_vals,
PARAM_CHANNEL, channel_ID,
PARAM_END);
visible = FALSE;
if (return_vals[0].data.d_status == STATUS_SUCCESS)
visible = return_vals[1].data.d_int32;
gimp_destroy_params (return_vals, nreturn_vals);
return visible;
}
void
gimp_channel_set_color (gint32 channel_ID,
guchar red,
guchar green,
guchar blue)
{
GParam *return_vals;
gint nreturn_vals;
guchar color[3];
color[0] = red;
color[1] = green;
color[2] = blue;
return_vals = gimp_run_procedure ("gimp_channel_set_color",
&nreturn_vals,
PARAM_CHANNEL, channel_ID,
PARAM_COLOR, color,
PARAM_END);
gimp_destroy_params (return_vals, nreturn_vals);
}
void
gimp_channel_set_name (gint32 channel_ID,
gchar *name)
{
GParam *return_vals;
gint nreturn_vals;
return_vals = gimp_run_procedure ("gimp_channel_set_name",
&nreturn_vals,
PARAM_CHANNEL, channel_ID,
PARAM_STRING, name,
PARAM_END);
gimp_destroy_params (return_vals, nreturn_vals);
}
void
gimp_channel_set_opacity (gint32 channel_ID,
gdouble opacity)
{
GParam *return_vals;
gint nreturn_vals;
return_vals = gimp_run_procedure ("gimp_channel_set_opacity",
&nreturn_vals,
PARAM_CHANNEL, channel_ID,
PARAM_FLOAT, opacity,
PARAM_END);
gimp_destroy_params (return_vals, nreturn_vals);
}
void
gimp_channel_set_visible (gint32 channel_ID,
gboolean visible)
{
GParam *return_vals;
gint nreturn_vals;
return_vals = gimp_run_procedure ("gimp_channel_set_visible",
&nreturn_vals,
PARAM_CHANNEL, channel_ID,
PARAM_INT32, visible,
PARAM_END);
gimp_destroy_params (return_vals, nreturn_vals);
}
gint
gimp_channel_get_show_masked (gint32 channel_ID)
{
GParam *return_vals;
gint nreturn_vals;
gint show_masked;
return_vals = gimp_run_procedure ("gimp_channel_get_show_masked",
&nreturn_vals,
PARAM_CHANNEL, channel_ID,
PARAM_END);
show_masked = -1;
if (return_vals[0].data.d_status == STATUS_SUCCESS)
show_masked = return_vals[1].data.d_int32;
gimp_destroy_params (return_vals, nreturn_vals);
return show_masked;
}
void
gimp_channel_set_show_masked (gint32 channel_ID,
gint show_masked)
{
GParam *return_vals;
gint nreturn_vals;
return_vals = gimp_run_procedure ("gimp_channel_set_show_masked",
&nreturn_vals,
PARAM_CHANNEL, channel_ID,
PARAM_INT32, show_masked,
PARAM_END);
gimp_destroy_params (return_vals, nreturn_vals);
}
gint32
gimp_channel_get_tattoo (gint32 channel_ID)
{
GParam *return_vals;
gint nreturn_vals;
gint tattoo;
return_vals = gimp_run_procedure ("gimp_channel_get_tattoo",
&nreturn_vals,
PARAM_CHANNEL, channel_ID,
PARAM_END);
tattoo = -1;
if (return_vals[0].data.d_status == STATUS_SUCCESS)
tattoo = return_vals[1].data.d_int32;
gimp_destroy_params (return_vals, nreturn_vals);
return tattoo;
}
/* LIBGIMP - The GIMP Library
* Copyright (C) 1995-1997 Peter Mattis and Spencer Kimball
*
* 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"
gint32
gimp_display_new (gint32 image_ID)
{
GParam *return_vals;
int nreturn_vals;
gint32 display_ID;
return_vals = gimp_run_procedure ("gimp_display_new",
&nreturn_vals,
PARAM_IMAGE, image_ID,
PARAM_END);
display_ID = -1;
if (return_vals[0].data.d_status == STATUS_SUCCESS)
display_ID = return_vals[1].data.d_display;
gimp_destroy_params (return_vals, nreturn_vals);
return display_ID;
}
void
gimp_display_delete (gint32 display_ID)
{
GParam *return_vals;
int nreturn_vals;
return_vals = gimp_run_procedure ("gimp_display_delete",
&nreturn_vals,
PARAM_DISPLAY, display_ID,
PARAM_END);
gimp_destroy_params (return_vals, nreturn_vals);
}
void
gimp_displays_flush ()
{
GParam *return_vals;
int nreturn_vals;
return_vals = gimp_run_procedure ("gimp_displays_flush",
&nreturn_vals,
PARAM_END);
gimp_destroy_params (return_vals, nreturn_vals);
}
/* LIBGIMP - The GIMP Library
* Copyright (C) 1995-1997 Peter Mattis and Spencer Kimball
*
* 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 "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