Commit c73b233f authored by Michael Natterer's avatar Michael Natterer 😴 Committed by Michael Natterer

app/color_select.c app/colormaps.[ch] removed unused global variables

2000-04-26  Michael Natterer  <mitch@gimp.org>

	* app/color_select.c
	* app/colormaps.[ch]
	* app/context_manager.c: removed unused global variables
	[foreground|background]_pixel and [old|new]_color_pixel.

	Initialize the colormap and visual stuff with GdkRGB instead of
	GtkPreview functions (which are deprecated).

	* app/[62 files]: removed #include's (started with colormaps.h and
	couldn't stop). Also ordered them consistently and did some small
	unrelated cleanups.
	Removed variuos <stdlib.h> et.al. but checked the files carefully
	before doing so. If I was too radical and you get warnings on your
	platform, please flame me or just put them back :)
parent f0f4569b
2000-04-26 Michael Natterer <mitch@gimp.org>
* app/color_select.c
* app/colormaps.[ch]
* app/context_manager.c: removed unused global variables
[foreground|background]_pixel and [old|new]_color_pixel.
Initialize the colormap and visual stuff with GdkRGB instead of
GtkPreview functions (which are deprecated).
* app/[62 files]: removed #include's (started with colormaps.h and
couldn't stop). Also ordered them consistently and did some small
unrelated cleanups.
Removed variuos <stdlib.h> et.al. but checked the files carefully
before doing so. If I was too radical and you get warnings on your
platform, please flame me or just put them back :)
2000-04-27 Sven Neumann <sven@gimp.org>
* plug-ins/imagemap/imap_object.c: on request of plug-in author
......
......@@ -15,11 +15,12 @@
* along with this program; if not, write to the Free Software
* Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
*/
#include "config.h"
#include "appenv.h"
#include "about_dialog.h"
#include "app_procs.h"
#include "brush_select.h"
#include "colormaps.h"
#include "colormap_dialog.i.h"
#include "color_area.h"
#include "commands.h"
......@@ -56,8 +57,6 @@
#include "tools.h"
#include "undo.h"
#include "config.h"
#include "libgimp/gimpmath.h"
#include "libgimp/gimpintl.h"
......
......@@ -15,7 +15,6 @@
* along with this program; if not, write to the Free Software
* Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
*/
#include "config.h"
#ifdef HAVE_SYS_PARAM_H
......@@ -68,10 +67,6 @@
#define _P_NOWAIT P_NOWAIT
#endif
#include "libgimp/parasite.h"
#include "libgimp/parasiteP.h" /* ick */
#include "libgimp/gimpenv.h"
#ifdef HAVE_IPC_H
#include <sys/ipc.h>
#endif
......@@ -80,27 +75,28 @@
#include <sys/shm.h>
#endif
#include "libgimp/gimpprotocol.h"
#include "libgimp/gimpwire.h"
#include "app_procs.h"
#include "appenv.h"
#include "brush_select.h" /* Need for closing dialogs */
#include "drawable.h"
#include "datafiles.h"
#include "errors.h"
#include "gdisplay.h"
#include "general.h"
#include "gimage.h"
#include "gimprc.h"
#include "gradient_select.h"
#include "interface.h"
#include "menus.h"
#include "pattern_select.h" /* Needed for closing pattern dialogs */
#include "plug_in.h"
#include "tile.h" /* ick. */
#include "libgimp/gimpenv.h"
#include "libgimp/gimpprotocol.h"
#include "libgimp/gimpwire.h"
#include "libgimp/parasite.h"
#include "libgimp/parasiteP.h" /* ick */
#include "libgimp/gimpintl.h"
......
......@@ -15,12 +15,11 @@
* along with this program; if not, write to the Free Software
* Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
*/
#include <stdlib.h>
#include "config.h"
#include "appenv.h"
#include "airbrush.h"
#include "drawable.h"
#include "errors.h"
#include "gdisplay.h"
#include "gimpbrushpipe.h"
#include "gradient.h"
......@@ -32,9 +31,9 @@
#include "selection.h"
#include "tools.h"
#include "config.h"
#include "libgimp/gimpintl.h"
/* The maximum amount of pressure that can be exerted */
#define MAX_PRESSURE 0.075
......
......@@ -15,8 +15,11 @@
* along with this program; if not, write to the Free Software
* Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
*/
#include "config.h"
#include <stdio.h>
#include "appenv.h"
#include "colormaps.h"
#include "cursorutil.h"
#include "drawable.h"
#include "gdisplay.h"
......@@ -25,11 +28,11 @@
#include "curves.h"
#include "gimplut.h"
#include "config.h"
#include "libgimp/gimpenv.h"
#include "libgimp/gimpintl.h"
#include "libgimp/gimpmath.h"
#include "libgimp/gimpintl.h"
#define GRAPH 0x1
#define XRANGE_TOP 0x2
#define XRANGE_BOTTOM 0x4
......
......@@ -15,24 +15,21 @@
* along with this program; if not, write to the Free Software
* Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
*/
#include <stdlib.h>
#include <string.h>
#include <math.h>
#include "config.h"
#include "appenv.h"
#include "colormaps.h"
#include "drawable.h"
#include "general.h"
#include "gimage_mask.h"
#include "gdisplay.h"
#include "gimpui.h"
#include "hue_saturation.h"
#include "interface.h"
#include "config.h"
#include "libgimp/gimpcolorspace.h"
#include "libgimp/gimpmath.h"
#include "libgimp/gimpintl.h"
#define HUE_PARTITION_MASK GDK_EXPOSURE_MASK | GDK_ENTER_NOTIFY_MASK
#define SLIDER_WIDTH 200
......
......@@ -15,7 +15,6 @@
* along with this program; if not, write to the Free Software
* Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
*/
#include "config.h"
#include <glib.h>
......@@ -37,26 +36,26 @@
#include "appenv.h"
#include "drawable.h"
#include "gdisplay.h"
#include "general.h"
#include "gimprc.h"
#include "paint_funcs.h"
#include "temp_buf.h"
#include "libgimp/gimpcolorspace.h"
static unsigned char * temp_buf_allocate (unsigned int);
static void temp_buf_to_color (TempBuf *, TempBuf *);
static void temp_buf_to_gray (TempBuf *, TempBuf *);
static guchar * temp_buf_allocate (guint);
static void temp_buf_to_color (TempBuf *, TempBuf *);
static void temp_buf_to_gray (TempBuf *, TempBuf *);
/* Memory management */
static unsigned char *
temp_buf_allocate (unsigned int size)
static guchar *
temp_buf_allocate (guint size)
{
unsigned char *data;
guchar *data;
data = (unsigned char *) g_malloc (size);
data = g_new (guchar, size);
return data;
}
......@@ -68,8 +67,8 @@ static void
temp_buf_to_color (TempBuf *src_buf,
TempBuf *dest_buf)
{
unsigned char *src;
unsigned char *dest;
guchar *src;
guchar *dest;
long num_bytes;
src = temp_buf_data (src_buf);
......@@ -79,7 +78,7 @@ temp_buf_to_color (TempBuf *src_buf,
while (num_bytes--)
{
unsigned char tmpch;
guchar tmpch;
*dest++ = *src++; /* alpha channel */
*dest++ = tmpch = *src++;
*dest++ = tmpch;
......@@ -92,8 +91,8 @@ static void
temp_buf_to_gray (TempBuf *src_buf,
TempBuf *dest_buf)
{
unsigned char *src;
unsigned char *dest;
guchar *src;
guchar *dest;
long num_bytes;
float pix;
......@@ -108,25 +107,25 @@ temp_buf_to_gray (TempBuf *src_buf,
pix = INTENSITY (*src++, *src++, *src++);
*dest++ = (unsigned char) pix;
*dest++ = (guchar) pix;
}
}
TempBuf *
temp_buf_new (int width,
int height,
int bytes,
int x,
int y,
unsigned char *col)
temp_buf_new (gint width,
gint height,
gint bytes,
gint x,
gint y,
guchar *col)
{
long i;
int j;
unsigned char * data;
TempBuf * temp;
guchar *data;
TempBuf *temp;
temp = (TempBuf *) g_malloc (sizeof (TempBuf));
temp = g_new (TempBuf, 1);
temp->width = width;
temp->height = height;
......@@ -157,12 +156,12 @@ temp_buf_new (int width,
else
{
/* No, we cannot */
unsigned char * dptr;
guchar * dptr;
/* Fill the first row */
dptr = data;
for (i = width - 1; i >= 0; --i)
{
unsigned char * init;
guchar * init;
j = bytes;
init = col;
while (j--)
......@@ -226,13 +225,13 @@ temp_buf_copy (TempBuf *src,
TempBuf *
temp_buf_resize (TempBuf *buf,
int bytes,
int x,
int y,
int w,
int h)
gint bytes,
gint x,
gint y,
gint w,
gint h)
{
int size;
gint size;
/* calculate the requested size */
size = w * h * bytes;
......@@ -266,16 +265,16 @@ temp_buf_resize (TempBuf *buf,
TempBuf *
temp_buf_copy_area (TempBuf *src,
TempBuf *dest,
int x,
int y,
int w,
int h,
int border)
gint x,
gint y,
gint w,
gint h,
gint border)
{
TempBuf * new;
PixelRegion srcR, destR;
unsigned char empty[MAX_CHANNELS] = { 0, 0, 0, 0 };
int x1, y1, x2, y2;
guchar empty[MAX_CHANNELS] = { 0, 0, 0, 0 };
gint x1, y1, x2, y2;
if (!src)
{
......@@ -339,7 +338,7 @@ temp_buf_free (TempBuf *temp_buf)
}
unsigned char *
guchar *
temp_buf_data (TempBuf *temp_buf)
{
if (temp_buf->swapped)
......@@ -355,10 +354,10 @@ temp_buf_data (TempBuf *temp_buf)
MaskBuf *
mask_buf_new (int width,
int height)
mask_buf_new (gint width,
gint height)
{
static unsigned char empty = 0;
static guchar empty = 0;
return (temp_buf_new (width, height, 1, 0, 0, &empty));
}
......@@ -371,7 +370,7 @@ mask_buf_free (MaskBuf *mask)
}
unsigned char *
guchar *
mask_buf_data (MaskBuf *mask_buf)
{
if (mask_buf->swapped)
......@@ -409,13 +408,13 @@ mask_buf_data (MaskBuf *mask_buf)
/* a static counter for generating unique filenames */
static int swap_index = 0;
static gint swap_index = 0;
/* a static pointer which keeps track of the last request for a swapped buffer */
static TempBuf * cached_in_memory = NULL;
static char *
static gchar *
generate_unique_filename (void)
{
pid_t pid;
......@@ -429,9 +428,9 @@ void
temp_buf_swap (TempBuf *buf)
{
TempBuf * swap;
char * filename;
gchar * filename;
struct stat stat_buf;
int err;
gint err;
FILE * fp;
if (!buf || buf->swapped)
......
......@@ -18,48 +18,48 @@
#ifndef __TEMP_BUF_H__
#define __TEMP_BUF_H__
typedef struct _TempBuf TempBuf;
typedef struct _TempBuf MaskBuf;
typedef struct _temp_buf TempBuf;
typedef struct _temp_buf MaskBuf;
struct _temp_buf
struct _TempBuf
{
int bytes; /* The necessary info */
int width;
int height;
int x, y; /* origin of data source */
gint bytes; /* The necessary info */
gint width;
gint height;
gint x, y; /* origin of data source */
int swapped; /* flag indicating whether buf is cached to disk */
char * filename; /* filename of cached information */
gboolean swapped; /* flag indicating whether buf is cached to disk */
gchar *filename; /* filename of cached information */
unsigned char * data; /* The data buffer */
guchar *data; /* The data buffer */
};
/* The temp buffer functions */
TempBuf * temp_buf_new (int, int, int, int, int, unsigned char *);
TempBuf * temp_buf_copy (TempBuf *, TempBuf *);
TempBuf * temp_buf_resize (TempBuf *, int, int, int, int, int);
TempBuf * temp_buf_copy_area (TempBuf *, TempBuf *, int, int, int, int, int);
void temp_buf_free (TempBuf *);
unsigned char * temp_buf_data (TempBuf *);
TempBuf * temp_buf_new (gint, gint, gint, gint, gint, guchar *);
TempBuf * temp_buf_copy (TempBuf *, TempBuf *);
TempBuf * temp_buf_resize (TempBuf *, gint, gint, gint, gint, gint);
TempBuf * temp_buf_copy_area (TempBuf *, TempBuf *,
gint, gint, gint, gint, gint);
void temp_buf_free (TempBuf *);
guchar * temp_buf_data (TempBuf *);
/* The mask buffer functions */
MaskBuf * mask_buf_new (int, int);
void mask_buf_free (MaskBuf *);
unsigned char * mask_buf_data (MaskBuf *);
MaskBuf * mask_buf_new (gint, gint);
void mask_buf_free (MaskBuf *);
guchar * mask_buf_data (MaskBuf *);
/* The disk caching functions */
void temp_buf_swap (TempBuf *);
void temp_buf_unswap (TempBuf *);
void temp_buf_swap_free (TempBuf *);
void temp_buf_swap (TempBuf *);
void temp_buf_unswap (TempBuf *);
void temp_buf_swap_free (TempBuf *);
/* Called by app_procs:exit to free up the cached undo buffer */
/* Called by app_procs:exit() to free up the cached undo buffer */
void swapping_free (void);
void swapping_free (void);
#endif /* __TEMP_BUF_H__ */
......@@ -15,17 +15,17 @@
* along with this program; if not, write to the Free Software
* Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
*/
#include "config.h"
#include "appenv.h"
#include "drawable.h"
#include "general.h"
#include "gdisplay.h"
#include "gimpui.h"
#include "interface.h"
#include "threshold.h"
#include "config.h"
#include "libgimp/gimpintl.h"
#define HISTOGRAM_WIDTH 256
#define HISTOGRAM_HEIGHT 150
......
......@@ -27,16 +27,16 @@
#include "gdisplay.h"
#include "gimage_mask.h"
#include "rect_select.h"
#include "interface.h"
#include "bezier_select.h"
#include "bezier_selectP.h"
#include "paths_dialogP.h"
#include "selection_options.h"
#include "undo.h"
#include "libgimp/gimpintl.h"
#include "libgimp/gimpmath.h"
#include "libgimp/gimpintl.h"
/* Bezier extensions made by Raphael FRANCOIS (fraph@ibm.net)
BEZIER_EXTENDS VER 1.0
......
......@@ -32,7 +32,6 @@
#include "gimpdnd.h"
#include "gimpui.h"
#include "gradient.h"
#include "interface.h"
#include "paint_options.h"
#include "selection.h"
#include "tools.h"
......@@ -41,9 +40,10 @@
#include "tile.h"
#include "libgimp/gimpcolorspace.h"
#include "libgimp/gimpintl.h"
#include "libgimp/gimpmath.h"
#include "libgimp/gimpintl.h"
/* target size */
#define TARGET_HEIGHT 15
......
......@@ -15,7 +15,7 @@
* along with this program; if not, write to the Free Software
* Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
*/
#include <stdlib.h>
#include "config.h"
#include <gdk/gdkkeysyms.h>
......@@ -28,14 +28,12 @@
#include "gimage_mask.h"
#include "gimprc.h"
#include "gimpui.h"
#include "interface.h"
#include "paint_funcs.h"
#include "paint_options.h"
#include "selection.h"
#include "tools.h"
#include "undo.h"
#include "config.h"
#include "libgimp/gimpintl.h"
/* the bucket fill structures */
......
......@@ -15,12 +15,13 @@
* along with this program; if not, write to the Free Software
* Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
*/
#include "config.h"
#include <gdk/gdkkeysyms.h>
#include "appenv.h"
#include "boundary.h"
#include "by_color_select.h"
#include "colormaps.h"
#include "cursorutil.h"
#include "drawable.h"
#include "draw_core.h"
......@@ -34,7 +35,6 @@
#include "tile.h" /* ick. */
#include "config.h"
#include "libgimp/gimpintl.h"
#define PREVIEW_WIDTH 256
......
......@@ -23,7 +23,6 @@
#include "appenv.h"
#include "channel.h"
#include "drawable.h"
#include "errors.h"
#include "gdisplay.h"
#include "gimage_mask.h"