1997-11-25 06:05:25 +08:00
|
|
|
/* The GIMP -- an image manipulation program
|
|
|
|
* Copyright (C) 1995 Spencer Kimball and Peter Mattis
|
|
|
|
*
|
|
|
|
* This program is free software; you can redistribute it and/or modify
|
|
|
|
* it under the terms of the GNU General Public License as published by
|
|
|
|
* the Free Software Foundation; either version 2 of the License, or
|
|
|
|
* (at your option) any later version.
|
|
|
|
*
|
|
|
|
* This program is distributed in the hope that it will be useful,
|
|
|
|
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
|
|
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
|
|
|
* GNU General Public License for more details.
|
|
|
|
*
|
|
|
|
* You should have received a copy of the GNU General Public License
|
|
|
|
* along with this program; if not, write to the Free Software
|
1998-04-13 13:44:11 +08:00
|
|
|
* Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
|
1997-11-25 06:05:25 +08:00
|
|
|
*/
|
|
|
|
#ifndef __APPENV_H__
|
|
|
|
#define __APPENV_H__
|
|
|
|
|
1998-07-25 02:52:03 +08:00
|
|
|
#include "glib.h"
|
1999-02-21 07:20:54 +08:00
|
|
|
|
|
|
|
/* The GIMP shouldn't need to know much about X11 (or Windows), so
|
|
|
|
* I'll remove this inclusion of gdkx.h. This will speed up compilations
|
|
|
|
* a bit, too. If some source file needs gdkx.h, it can include it.
|
|
|
|
*/
|
|
|
|
#if 0
|
1997-11-25 06:05:25 +08:00
|
|
|
#include "gdk/gdkx.h"
|
1999-02-21 07:20:54 +08:00
|
|
|
#endif
|
|
|
|
|
1997-11-25 06:05:25 +08:00
|
|
|
#include "gtk/gtk.h"
|
1998-07-02 07:06:49 +08:00
|
|
|
#include "gimpsetF.h"
|
1999-01-08 03:53:05 +08:00
|
|
|
#include "colormap_dialog.t.h"
|
1999-02-21 07:20:54 +08:00
|
|
|
|
|
|
|
/* Without gdkx.h no GDK_DISPLAY() */
|
|
|
|
#if 0
|
1997-11-25 06:05:25 +08:00
|
|
|
#define DISPLAY ((Display *) GDK_DISPLAY())
|
1999-02-21 07:20:54 +08:00
|
|
|
#endif
|
1997-11-25 06:05:25 +08:00
|
|
|
|
1998-07-25 02:52:03 +08:00
|
|
|
/* important macros - we reuse the ones from glib */
|
|
|
|
#define BOUNDS(a,x,y) CLAMP(a,x,y)
|
|
|
|
#define MINIMUM(x,y) MIN(x,y)
|
|
|
|
#define MAXIMUM(x,y) MAX(x,y)
|
|
|
|
|
1999-08-05 07:22:29 +08:00
|
|
|
#ifndef G_PI /* G_PI will be in GLib eventually */
|
1999-08-16 11:43:48 +08:00
|
|
|
#define G_PI 3.14159265358979323846
|
|
|
|
#endif
|
|
|
|
#ifndef G_PI_2 /* As will G_PI_2 */
|
|
|
|
#define G_PI_2 1.57079632679489661923
|
1999-08-05 07:22:29 +08:00
|
|
|
#endif
|
|
|
|
#ifndef G_PI_4 /* As will G_PI_4 */
|
|
|
|
#define G_PI_4 0.78539816339744830962
|
|
|
|
#endif
|
1999-08-16 12:59:48 +08:00
|
|
|
#ifndef G_SQRT2 /* As will G_SQRT2 */
|
|
|
|
#define G_SQRT2 1.4142135623730951
|
|
|
|
#endif
|
1999-08-05 07:22:29 +08:00
|
|
|
|
|
|
|
#ifdef HAVE_RINT
|
|
|
|
#define RINT(x) rint(x)
|
|
|
|
#else
|
1999-08-14 06:33:49 +08:00
|
|
|
#define RINT(x) floor ((x) + 0.5)
|
1999-08-05 07:22:29 +08:00
|
|
|
#endif
|
|
|
|
|
1999-08-14 06:33:49 +08:00
|
|
|
#define ROUND(x) ((int) ((x) + 0.5))
|
1999-08-05 07:22:29 +08:00
|
|
|
|
|
|
|
/* Square */
|
1999-08-14 06:33:49 +08:00
|
|
|
#define SQR(x) ((x) * (x))
|
1999-08-05 07:22:29 +08:00
|
|
|
|
1998-07-25 02:52:03 +08:00
|
|
|
/* limit a (0->511) int to 255 */
|
1999-02-23 03:30:06 +08:00
|
|
|
#define MAX255(a) ((a) | (((a) & 256) - (((a) & 256) >> 8)))
|
1998-07-25 02:52:03 +08:00
|
|
|
|
1999-02-08 02:34:16 +08:00
|
|
|
/* clamp a >>int32<<-range int between 0 and 255 inclusive */
|
|
|
|
/* broken! -> #define CLAMP0255(a) ((a & 0xFFFFFF00)? (~(a>>31)) : a) */
|
|
|
|
#define CLAMP0255(a) CLAMP(a,0,255)
|
1998-07-25 02:52:03 +08:00
|
|
|
|
1997-11-25 06:05:25 +08:00
|
|
|
|
1998-06-20 07:45:54 +08:00
|
|
|
typedef enum {
|
|
|
|
MESSAGE_BOX,
|
1998-07-29 05:11:47 +08:00
|
|
|
CONSOLE,
|
|
|
|
ERROR_CONSOLE
|
1998-06-20 07:45:54 +08:00
|
|
|
} MessageHandlerType;
|
|
|
|
|
1997-11-25 06:05:25 +08:00
|
|
|
extern int no_interface;
|
1998-02-18 04:14:29 +08:00
|
|
|
extern int no_splash;
|
|
|
|
extern int no_splash_image;
|
1997-11-25 06:05:25 +08:00
|
|
|
extern int no_data;
|
1998-01-26 06:13:00 +08:00
|
|
|
extern int be_verbose;
|
1998-05-30 15:32:37 +08:00
|
|
|
extern int use_debug_handler;
|
|
|
|
extern int console_messages;
|
1998-07-12 06:23:23 +08:00
|
|
|
extern int restore_session;
|
|
|
|
extern int we_are_exiting; /* this is used in session_get_window_info() */
|
1998-07-02 07:06:49 +08:00
|
|
|
extern GimpSet* image_context;
|
1998-06-20 07:45:54 +08:00
|
|
|
extern MessageHandlerType message_handler;
|
|
|
|
|
Overhaul of pixmap brushes and pipes: No separate pixmap pipe
brush tool any longer. The paintbrush, airbrush and pencil
tools, which already knew how to handle the single-pixmap
brushes now also handle the pipes as well.
* app/pixmapbrush.{h,c}
* app/gimpbrushpixmap.{h,c}: Removed these files.
* app/Makefile.am
* app/makefile.{cygwin,msc}: Remove from here, too.
* app/gimpbrushpipe.{h,c}: Total overhaul.
* app/paint_core.h
* app/apptypes.h: Some more types moved to apptypes.h
* app/context_manager.c
* app/tool_options.c
* app/tools.c
* app/toolsF.h: Remove PIXMAPBRUSH tool.
* app/gimpbrush.h: New method: select_brush. Used to change the
brush in paint_core, for pipe brushes.
* app/gimpbrush.c: Add gimp_brush_select_brush, which is dummy for
the normal brushes (returns the same brush).
* app/paint_core.c: Call the brush's select_brush method to get a
potential new brush before calling the paint_func.
* app/gimpbrushlist.c: Various changes related to the pixmap and
pipe overhaul.
* app/airbrush.c
* app/pencil.c: Reorder code a bit in the tool motion function to
avoid executing unnecessary code in the case of a pixmap brush.
Other changes in the same commit:
* app/install.c: Make quote_spaces extern.
* app/appenv.h: Declare it.
* libgimp/gimpui.def: Add missing entry points.
* libgimp/makefile.{cygwin,msc}: Add missing objects to gimpui.
1999-08-26 08:54:30 +08:00
|
|
|
#ifdef NATIVE_WIN32
|
|
|
|
char *quote_spaces (char *string);
|
|
|
|
#endif
|
|
|
|
|
1997-11-25 06:05:25 +08:00
|
|
|
#endif /* APPENV_H */
|