plug-ins/Lighting/Makefile.am plug-ins/Lighting/lighting_apply.c

2003-12-14  Sven Neumann  <sven@gimp.org>

	* plug-ins/Lighting/Makefile.am
	* plug-ins/Lighting/lighting_apply.c
	* plug-ins/Lighting/lighting_image.[ch]
	* plug-ins/Lighting/lighting_main.c
	* plug-ins/Lighting/lighting_preview.c
	* plug-ins/Lighting/lighting_shade.c
	* plug-ins/Lighting/lighting_ui.[ch]
	* plug-ins/MapObject/Makefile.am
	* plug-ins/MapObject/mapobject_apply.c
	* plug-ins/MapObject/mapobject_image.[ch]
	* plug-ins/MapObject/mapobject_main.c
	* plug-ins/MapObject/mapobject_preview.c
	* plug-ins/MapObject/mapobject_shade.c
	* plug-ins/MapObject/mapobject_ui.[ch]: removed remaining
	references to libgck. Use GdkRGB functionality instead.

	* configure.in
	* plug-ins/Makefile.am
	* plug-ins/makefile.msc
	* plug-ins/libgck: removed libgck.
This commit is contained in:
Sven Neumann 2003-12-14 17:17:56 +00:00 committed by Sven Neumann
parent 23ddba32ce
commit 7df0e1d462
31 changed files with 166 additions and 1511 deletions

View File

@ -22,6 +22,7 @@ intltool-extract
intltool-extract.in
intltool-merge
intltool-merge.in
intltool-modules
intltool-update
intltool-update.in
libtool

View File

@ -1,3 +1,26 @@
2003-12-14 Sven Neumann <sven@gimp.org>
* plug-ins/Lighting/Makefile.am
* plug-ins/Lighting/lighting_apply.c
* plug-ins/Lighting/lighting_image.[ch]
* plug-ins/Lighting/lighting_main.c
* plug-ins/Lighting/lighting_preview.c
* plug-ins/Lighting/lighting_shade.c
* plug-ins/Lighting/lighting_ui.[ch]
* plug-ins/MapObject/Makefile.am
* plug-ins/MapObject/mapobject_apply.c
* plug-ins/MapObject/mapobject_image.[ch]
* plug-ins/MapObject/mapobject_main.c
* plug-ins/MapObject/mapobject_preview.c
* plug-ins/MapObject/mapobject_shade.c
* plug-ins/MapObject/mapobject_ui.[ch]: removed remaining
references to libgck. Use GdkRGB functionality instead.
* configure.in
* plug-ins/Makefile.am
* plug-ins/makefile.msc
* plug-ins/libgck: removed libgck.
2003-12-14 Sven Neumann <sven@gimp.org>
* libgimp/gimpui.def: removed gimp_plug_in_get_path.

View File

@ -1406,8 +1406,6 @@ app/vectors/Makefile
app/widgets/Makefile
app/xcf/Makefile
plug-ins/Makefile
plug-ins/libgck/Makefile
plug-ins/libgck/gck/Makefile
plug-ins/libgimpoldpreview/Makefile
plug-ins/dbbrowser/Makefile
plug-ins/script-fu/Makefile

View File

@ -35,9 +35,8 @@ Lighting_SOURCES = \
specref2.xpm
INCLUDES = \
-I$(top_srcdir) \
-I$(top_srcdir)/plug-ins/libgck \
$(GTK_CFLAGS) \
-I$(top_srcdir) \
$(GTK_CFLAGS) \
-I$(includedir)
LDADD = \
@ -47,6 +46,5 @@ LDADD = \
$(top_builddir)/libgimpcolor/libgimpcolor-$(LT_RELEASE).la \
$(top_builddir)/libgimpmath/libgimpmath-$(LT_RELEASE).la \
$(top_builddir)/libgimpbase/libgimpbase-$(LT_RELEASE).la \
$(top_builddir)/plug-ins/libgck/gck/libgck.a \
$(GTK_LIBS) \
$(INTLLIBS)

View File

@ -8,8 +8,6 @@
#include <libgimp/gimp.h>
#include <gck/gck.h>
#include "lighting_main.h"
#include "lighting_image.h"
#include "lighting_shade.h"

View File

@ -4,15 +4,16 @@
#include "config.h"
#include <libgimp/gimp.h>
#include <gtk/gtk.h>
#include <gck/gck.h>
#include <libgimp/gimp.h>
#include "lighting_main.h"
#include "lighting_image.h"
#include "lighting_preview.h"
#include "lighting_ui.h"
GimpDrawable *input_drawable,*output_drawable;
GimpPixelRgn source_region, dest_region;
@ -23,7 +24,6 @@ GimpDrawable *env_drawable = NULL;
GimpPixelRgn env_region;
guchar *preview_rgb_data = NULL;
GdkImage *image = NULL;
glong maxcounter;
gint imgtype, width, height, env_width, env_height, in_channels, out_channels;
@ -343,10 +343,8 @@ compute_maps (void)
gint
image_setup (GimpDrawable *drawable,
gint interactive)
gint interactive)
{
glong numbytes;
compute_maps ();
/* Get some useful info on the input drawable */
@ -373,25 +371,9 @@ image_setup (GimpDrawable *drawable,
if (gimp_drawable_has_alpha (input_drawable->drawable_id) == TRUE)
in_channels++;
if (interactive == TRUE)
if (interactive)
{
/* Allocate memory for temp. images */
/* ================================ */
image = gdk_image_new (GDK_IMAGE_FASTEST, visinfo->visual,
PREVIEW_WIDTH, PREVIEW_HEIGHT);
if (image == NULL)
return FALSE;
numbytes = (glong) PREVIEW_WIDTH * (glong) PREVIEW_HEIGHT * 3;
preview_rgb_data = g_new0 (guchar, numbytes);
/* Convert from raw RGB to GdkImage */
/* ================================ */
gck_rgb_to_gdkimage (visinfo, preview_rgb_data, image,
PREVIEW_WIDTH, PREVIEW_HEIGHT);
preview_rgb_data = g_new0 (guchar, PREVIEW_WIDTH * PREVIEW_HEIGHT * 3);
}
return TRUE;

View File

@ -11,7 +11,6 @@ extern GimpDrawable *env_drawable;
extern GimpPixelRgn env_region;
extern guchar *preview_rgb_data;
extern GdkImage *image;
extern glong maxcounter;
extern gint imgtype,width,height,env_width,env_height,in_channels,out_channels;

View File

@ -22,9 +22,9 @@
#include "config.h"
#include <libgimp/gimp.h>
#include <gtk/gtk.h>
#include <gck/gck.h>
#include <libgimp/gimp.h>
#include "lighting_apply.h"
#include "lighting_image.h"
@ -35,6 +35,7 @@
#include "libgimp/stdplugins-intl.h"
LightingValues mapvals;
/******************/

View File

@ -4,11 +4,10 @@
#include "config.h"
#include <libgimp/gimp.h>
#include <gdk/gdkimage.h>
#include <gtk/gtk.h>
#include <gck/gck.h>
#include <libgimpmath/gimpvector.h>
#include <libgimp/gimp.h>
#include <libgimpmath/gimpmath.h>
#include "lighting_main.h"
#include "lighting_ui.h"
@ -194,10 +193,6 @@ compute_preview (gint startx, gint starty, gint w, gint h)
}
}
}
gck_rgb_to_gdkimage (visinfo,
preview_rgb_data,
image, PREVIEW_WIDTH, PREVIEW_HEIGHT);
}
static void
@ -262,16 +257,16 @@ check_handle_hit (gint xpos, gint ypos)
static void
draw_handles ()
draw_handles (void)
{
gdouble dxpos, dypos;
gint startx, starty, pw, ph;
gint startx, starty, pw, ph;
GimpVector3 viewpoint;
GimpVector3 light_position;
gfloat length;
gfloat delta_x = 0.0,
delta_y = 0.0;
gfloat delta_x = 0.0;
gfloat delta_y = 0.0;
/* calculate handle position */
compute_preview_rectangle (&startx, &starty, &pw, &ph);
@ -307,6 +302,8 @@ draw_handles ()
if (mapvals.lightsource.type != NO_LIGHT)
{
GdkColor color;
/* Restore background if it has been saved */
/* ======================================= */
@ -370,9 +367,15 @@ draw_handles ()
backbuf.w, backbuf.h);
}
gck_gc_set_background (visinfo, gc, 0, 0, 0);
gck_gc_set_foreground (visinfo, gc, 0, 50, 255);
color.red = 0x0;
color.green = 0x0;
color.blue = 0x0;
gdk_gc_set_rgb_bg_color (gc, &color);
color.red = 0x0;
color.green = 0x4000;
color.blue = 0xFFFF;
gdk_gc_set_rgb_fg_color (gc, &color);
/* draw circle at light position */
switch (mapvals.lightsource.type)
@ -445,10 +448,19 @@ update_light (gint xpos, gint ypos)
void
draw_preview_image (gboolean recompute)
{
gint startx, starty, pw, ph;
gint startx, starty, pw, ph;
GdkColor color;
color.red = 0x0;
color.green = 0x0;
color.blue = 0x0;
gdk_gc_set_rgb_bg_color (gc, &color);
color.red = 0xFFFF;
color.green = 0xFFFF;
color.blue = 0xFFFF;
gdk_gc_set_rgb_fg_color (gc, &color);
gck_gc_set_foreground (visinfo, gc, 255, 255, 255);
gck_gc_set_background (visinfo, gc, 0, 0, 0);
gdk_gc_set_function (gc, GDK_COPY);
compute_preview_rectangle (&startx, &starty, &pw, &ph);
@ -478,8 +490,10 @@ draw_preview_image (gboolean recompute)
}
}
gdk_draw_image (previewarea->window, gc, image,
0, 0, 0, 0, PREVIEW_WIDTH, PREVIEW_HEIGHT);
gdk_draw_rgb_image (previewarea->window, gc,
0, 0, PREVIEW_WIDTH, PREVIEW_HEIGHT,
GDK_RGB_DITHER_MAX, preview_rgb_data,
3 * PREVIEW_WIDTH);
/* draw symbols if enabled in UI */
if (mapvals.interactive_preview)

View File

@ -6,12 +6,11 @@
#include <libgimp/gimp.h>
#include <gck/gck.h>
#include "lighting_main.h"
#include "lighting_image.h"
#include "lighting_shade.h"
static GimpVector3 *triangle_normals[2] = { NULL, NULL };
static GimpVector3 *vertex_normals[3] = { NULL, NULL, NULL };
static gdouble *heights[3] = { NULL, NULL, NULL };

View File

@ -22,8 +22,6 @@
#include <libgimp/gimp.h>
#include <libgimp/gimpui.h>
#include <gck/gck.h>
#include "lighting_ui.h"
#include "lighting_main.h"
#include "lighting_image.h"
@ -46,8 +44,6 @@
extern LightingValues mapvals;
GckVisualInfo *visinfo = NULL;
static GtkWidget *appwin = NULL;
static GtkNotebook *options_note_book = NULL;
@ -1159,8 +1155,6 @@ main_dialog (GimpDrawable *drawable)
gtk_container_add (GTK_CONTAINER (frame), previewarea);
gtk_widget_show (previewarea);
visinfo = gck_visualinfo_new (gtk_widget_get_screen (previewarea));
/* create preview options, frame and vbox */
hbox = gtk_hbox_new (FALSE, 2);
gtk_widget_show (hbox);
@ -1221,10 +1215,6 @@ main_dialog (GimpDrawable *drawable)
if (preview_rgb_data != NULL)
g_free (preview_rgb_data);
if (image != NULL)
g_object_unref (image);
gck_visualinfo_destroy (visinfo);
gtk_widget_destroy (appwin);
return run;

View File

@ -4,8 +4,6 @@
/* Externally visible variables */
/* ============================ */
extern GckVisualInfo *visinfo;
extern GdkGC *gc;
extern GtkWidget *previewarea;

View File

@ -26,8 +26,7 @@ win32dirs = \
endif
SUBDIRS = \
libgck \
SUBDIRS = \
libgimpoldpreview \
dbbrowser \
script-fu \

View File

@ -37,9 +37,8 @@ MapObject_SOURCES = \
specref2.xpm
INCLUDES = \
-I$(top_srcdir) \
-I$(top_srcdir)/plug-ins/libgck \
$(GTK_CFLAGS) \
-I$(top_srcdir) \
$(GTK_CFLAGS) \
-I$(includedir)
LDADD = \
@ -49,6 +48,5 @@ LDADD = \
$(top_builddir)/libgimpcolor/libgimpcolor-$(LT_RELEASE).la \
$(top_builddir)/libgimpmath/libgimpmath-$(LT_RELEASE).la \
$(top_builddir)/libgimpbase/libgimpbase-$(LT_RELEASE).la \
$(top_builddir)/plug-ins/libgck/gck/libgck.a \
$(GTK_LIBS) \
$(INTLLIBS)

View File

@ -10,8 +10,6 @@
#include <libgimp/gimp.h>
#include <gck/gck.h>
#include "mapobject_main.h"
#include "mapobject_image.h"
#include "mapobject_shade.h"
@ -34,7 +32,7 @@ init_compute (void)
/* Rotate the equator/northpole axis */
/* ================================= */
gimp_vector3_set (&mapvals.firstaxis, 0.0, 0.0, -1.0);
gimp_vector3_set (&mapvals.secondaxis, 0.0, 1.0, 0.0);
@ -60,7 +58,7 @@ init_compute (void)
/* Rotate the plane axis */
/* ===================== */
gimp_vector3_set (&mapvals.firstaxis, 1.0, 0.0, 0.0);
gimp_vector3_set (&mapvals.secondaxis, 0.0, 1.0, 0.0);
gimp_vector3_set (&mapvals.normal, 0.0, 0.0, 1.0);

View File

@ -11,9 +11,9 @@
#include <sys/types.h>
#include <libgimp/gimp.h>
#include <gtk/gtk.h>
#include <gck/gck.h>
#include <libgimp/gimp.h>
#include "mapobject_main.h"
#include "mapobject_preview.h"
@ -31,7 +31,6 @@ GimpDrawable *cylinder_drawables[2];
GimpPixelRgn cylinder_regions[2];
guchar *preview_rgb_data = NULL;
GdkImage *image = NULL;
glong maxcounter,old_depth,max_depth;
gint imgtype,width,height,in_channels,out_channels;
@ -346,14 +345,12 @@ gint
image_setup (GimpDrawable *drawable,
gint interactive)
{
glong numbytes;
/* Set the tile cache size */
/* ======================= */
gimp_tile_cache_ntiles ((drawable->width + gimp_tile_width() - 1) /
gimp_tile_width ());
/* Get some useful info on the input drawable */
/* ========================================== */
@ -390,24 +387,7 @@ image_setup (GimpDrawable *drawable,
if (interactive == TRUE)
{
/* Allocate memory for temp. images */
/* ================================ */
numbytes = PREVIEW_HEIGHT * PREVIEW_WIDTH * 3;
image = gdk_image_new (GDK_IMAGE_FASTEST,
visinfo->visual,
PREVIEW_WIDTH, PREVIEW_HEIGHT);
if (image == NULL)
return FALSE;
preview_rgb_data = g_new0 (guchar, numbytes);
/* Convert from raw RGB to GdkImage */
/* ================================ */
gck_rgb_to_gdkimage (visinfo, preview_rgb_data, image,
PREVIEW_WIDTH, PREVIEW_HEIGHT);
preview_rgb_data = g_new0 (guchar, PREVIEW_HEIGHT * PREVIEW_WIDTH * 3);
}
return TRUE;

View File

@ -14,7 +14,6 @@ extern GimpDrawable *cylinder_drawables[2];
extern GimpPixelRgn cylinder_regions[2];
extern guchar *preview_rgb_data;
extern GdkImage *image;
extern glong maxcounter, old_depth, max_depth;
extern gint imgtype, width,height, in_channels, out_channels;

View File

@ -27,8 +27,6 @@
#include <libgimp/gimp.h>
#include <libgimp/gimpui.h>
#include <gck/gck.h>
#include "arcball.h"
#include "mapobject_ui.h"
#include "mapobject_image.h"

View File

@ -8,8 +8,6 @@
#include <libgimp/gimp.h>
#include <gck/gck.h>
#include "arcball.h"
#include "mapobject_main.h"
#include "mapobject_ui.h"
@ -109,7 +107,7 @@ clip_line (gdouble *x1,
if (*y1 < *y2) *y1 = *y1 + (minx - *x1) * ((*y2 - *y1) / (*x2 - *x1));
else *y1 = *y1 - (minx - *x1) * ((*y1 - *y2) / (*x2 - *x1));
*x1 = minx;
*x1 = minx;
}
if (*x2 > maxx)
@ -149,7 +147,7 @@ clip_line (gdouble *x1,
/**************************************************************/
/* Computes a preview of the rectangle starting at (x,y) with */
/* dimensions (w,h), placing the result in preview_RGB_data. */
/* dimensions (w,h), placing the result in preview_RGB_data. */
/**************************************************************/
void
@ -200,9 +198,9 @@ compute_preview (gint x,
gimp_rgb_set_alpha (&background, 1.0);
}
gimp_rgba_set (&lightcheck,
gimp_rgba_set (&lightcheck,
GIMP_CHECK_LIGHT, GIMP_CHECK_LIGHT, GIMP_CHECK_LIGHT, 1.0);
gimp_rgba_set (&darkcheck,
gimp_rgba_set (&darkcheck,
GIMP_CHECK_DARK, GIMP_CHECK_DARK, GIMP_CHECK_DARK, 1.0);
gimp_vector3_set (&p2, -1.0, -1.0, 0.0);
@ -227,7 +225,7 @@ compute_preview (gint x,
if (color.a == 0.0)
color = lightcheck;
else
gimp_rgb_composite (&color, &lightcheck,
gimp_rgb_composite (&color, &lightcheck,
GIMP_RGB_COMPOSITE_BEHIND);
}
else
@ -235,23 +233,18 @@ compute_preview (gint x,
if (color.a == 0.0)
color = darkcheck;
else
gimp_rgb_composite (&color, &darkcheck,
gimp_rgb_composite (&color, &darkcheck,
GIMP_RGB_COMPOSITE_BEHIND);
}
}
gimp_rgb_get_uchar (&color,
gimp_rgb_get_uchar (&color,
preview_rgb_data + index,
preview_rgb_data + index + 1,
preview_rgb_data + index + 2);
index += 3;
}
}
/* Convert to visual type */
/* ====================== */
gck_rgb_to_gdkimage (visinfo, preview_rgb_data, image, pw, ph);
}
/*************************************************/
@ -288,8 +281,17 @@ static void
draw_light_marker (gint xpos,
gint ypos)
{
gck_gc_set_foreground (visinfo, gc, 0, 50, 255);
gck_gc_set_background (visinfo, gc, 0, 0, 0);
GdkColor color;
color.red = 0x0;
color.green = 0x0;
color.blue = 0x0;
gdk_gc_set_rgb_bg_color (gc, &color);
color.red = 0x0;
color.green = 0x4000;
color.blue = 0xFFFF;
gdk_gc_set_rgb_fg_color (gc, &color);
gdk_gc_set_function (gc, GDK_COPY);
@ -309,7 +311,7 @@ draw_light_marker (gint xpos,
/* X doesn't like images that's outside a window, make sure */
/* we get the backbuffer image from within the boundaries */
/* ======================================================== */
if (backbuf.x < 0)
backbuf.x = 0;
else if ((backbuf.x + backbuf.w) > PREVIEW_WIDTH)
@ -338,10 +340,20 @@ clear_light_marker (void)
if (backbuf.image != NULL)
{
gck_gc_set_foreground (visinfo, gc, 255, 255, 255);
gck_gc_set_background (visinfo, gc, 0, 0, 0);
GdkColor color;
color.red = 0x0;
color.green = 0x0;
color.blue = 0x0;
gdk_gc_set_rgb_bg_color (gc, &color);
color.red = 0xFFFF;
color.green = 0xFFFF;
color.blue = 0xFFFF;
gdk_gc_set_rgb_fg_color (gc, &color);
gdk_gc_set_function (gc, GDK_COPY);
gdk_draw_image (previewarea->window, gc,
backbuf.image,
0, 0,
@ -370,7 +382,8 @@ draw_lights (gint startx,
xpos = RINT (dxpos);
ypos = RINT (dypos);
if (xpos >= 0 && xpos <= PREVIEW_WIDTH && ypos >= 0 && ypos <= PREVIEW_HEIGHT)
if (xpos >= 0 && xpos <= PREVIEW_WIDTH &&
ypos >= 0 && ypos <= PREVIEW_HEIGHT)
draw_light_marker (xpos, ypos);
}
@ -402,9 +415,17 @@ void
draw_preview_image (gint docompute)
{
gint startx, starty, pw, ph;
GdkColor color;
gck_gc_set_foreground (visinfo, gc, 255, 255, 255);
gck_gc_set_background (visinfo, gc, 0, 0, 0);
color.red = 0x0;
color.green = 0x0;
color.blue = 0x0;
gdk_gc_set_rgb_bg_color (gc, &color);
color.red = 0xFFFF;
color.green = 0xFFFF;
color.blue = 0xFFFF;
gdk_gc_set_rgb_fg_color (gc, &color);
gdk_gc_set_function (gc, GDK_COPY);
linetab[0].x1 = -1;
@ -432,10 +453,14 @@ draw_preview_image (gint docompute)
clear_light_marker ();
}
if (pw != PREVIEW_WIDTH)
if (pw != PREVIEW_WIDTH || ph != PREVIEW_HEIGHT)
gdk_window_clear (previewarea->window);
gdk_draw_image (previewarea->window, gc, image, 0, 0, startx, starty, pw, ph);
gdk_draw_rgb_image (previewarea->window, gc,
startx, starty, pw, ph,
GDK_RGB_DITHER_MAX,
preview_rgb_data, 3 * pw);
draw_lights (startx, starty, pw, ph);
}
@ -447,9 +472,17 @@ void
draw_preview_wireframe (void)
{
gint startx, starty, pw, ph;
GdkColor color;
gck_gc_set_foreground (visinfo, gc, 255, 255, 255);
gck_gc_set_background (visinfo, gc, 0, 0, 0);
color.red = 0x0;
color.green = 0x0;
color.blue = 0x0;
gdk_gc_set_rgb_bg_color (gc, &color);
color.red = 0xFFFF;
color.green = 0xFFFF;
color.blue = 0xFFFF;
gdk_gc_set_rgb_fg_color (gc, &color);
gdk_gc_set_function (gc, GDK_INVERT);
@ -612,7 +645,7 @@ draw_wireframe_sphere (gint startx,
/* ======================== */
twopifac = (2.0 * G_PI) / WIRESIZE;
for (cnt = 0; cnt < WIRESIZE; cnt++)
{
p[cnt].x = mapvals.radius * cos ((gdouble) cnt * twopifac);
@ -642,7 +675,7 @@ draw_wireframe_sphere (gint startx,
p[cnt] = p[WIRESIZE+1];
cnt++;
cnt2 = cnt;
/* Find rotated axis */
/* ================= */
@ -684,7 +717,7 @@ draw_wireframe_sphere (gint startx,
&x1, &y1, &mapvals.viewpoint, &p[cnt]);
gimp_vector_3d_to_2d (startx, starty, pw, ph,
&x2, &y2, &mapvals.viewpoint, &p[cnt + 1]);
if (clip_line (&x1, &y1, &x2, &y2, cx1, cy1, cx2, cy2) == TRUE)
{
linetab[n].x1 = (gint) (x1 + 0.5);
@ -873,7 +906,7 @@ draw_wireframe_cylinder (gint startx,
gint n = 0, i;
gdouble cx1, cy1, cx2, cy2;
gfloat m[16], l, angle;
/* Compute wireframe points */
/* ======================== */
@ -889,12 +922,12 @@ draw_wireframe_cylinder (gint startx,
for (i = 0; i < 8; i++)
{
rotatemat (angle, &axis, m);
rotatemat (angle, &axis, m);
gimp_vector3_set (&a, mapvals.cylinder_radius, 0.0, 0.0);
vecmulmat (&p[i], &a, m);
p[i+8] = p[i];
p[i].y += l;
@ -905,7 +938,7 @@ draw_wireframe_cylinder (gint startx,
/* Rotate and translate points */
/* =========================== */
for (i = 0; i < 16; i++)
{
vecmulmat (&a, &p[i], rotmat);

View File

@ -8,8 +8,6 @@
#include <libgimp/gimp.h>
#include <gck/gck.h>
#include "mapobject_apply.h"
#include "mapobject_main.h"
#include "mapobject_image.h"

View File

@ -7,8 +7,6 @@
#include <libgimp/gimp.h>
#include <libgimp/gimpui.h>
#include <gck/gck.h>
#include "arcball.h"
#include "mapobject_ui.h"
#include "mapobject_image.h"
@ -30,7 +28,6 @@
#include "high2.xpm"
GckVisualInfo *visinfo = NULL;
GdkGC *gc = NULL;
GtkWidget *previewarea = NULL;
@ -166,8 +163,17 @@ togglegrid_update (GtkWidget *widget,
}
else if (!mapvals.showgrid && linetab[0].x1 != -1)
{
gck_gc_set_foreground (visinfo, gc, 255, 255, 255);
gck_gc_set_background (visinfo, gc, 0, 0, 0);
GdkColor color;
color.red = 0x0;
color.green = 0x0;
color.blue = 0x0;
gdk_gc_set_rgb_bg_color (gc, &color);
color.red = 0xFFFF;
color.green = 0xFFFF;
color.blue = 0xFFFF;
gdk_gc_set_rgb_fg_color (gc, &color);
gdk_gc_set_function (gc, GDK_INVERT);
@ -221,8 +227,17 @@ mapmenu_callback (GtkWidget *widget,
}
else if (!mapvals.showgrid && linetab[0].x1 != -1)
{
gck_gc_set_foreground (visinfo, gc, 255, 255, 255);
gck_gc_set_background (visinfo, gc, 0, 0, 0);
GdkColor color;
color.red = 0x0;
color.green = 0x0;
color.blue = 0x0;
gdk_gc_set_rgb_bg_color (gc, &color);
color.red = 0xFFFF;
color.green = 0xFFFF;
color.blue = 0xFFFF;
gdk_gc_set_rgb_fg_color (gc, &color);
gdk_gc_set_function (gc, GDK_INVERT);
@ -1408,8 +1423,6 @@ main_dialog (GimpDrawable *drawable)
G_CALLBACK (preview_events),
previewarea);
visinfo = gck_visualinfo_new (gtk_widget_get_screen (previewarea));
hbox = gtk_hbox_new (FALSE, 4);
gtk_box_pack_start (GTK_BOX (vbox), hbox, FALSE, FALSE, 0);
gtk_widget_show (hbox);
@ -1488,7 +1501,6 @@ main_dialog (GimpDrawable *drawable)
gtk_widget_destroy (appwin);
g_free (preview_rgb_data);
gck_visualinfo_destroy (visinfo);
return run;
}

View File

@ -4,8 +4,6 @@
/* Externally visible variables */
/* ============================ */
extern GckVisualInfo *visinfo;
extern GdkGC *gc;
extern GtkWidget *previewarea;

View File

@ -1,6 +0,0 @@
Makefile.in
Makefile
.deps
_libs
.libs
libgck

View File

@ -1,3 +0,0 @@
Tom Bech <tomb@gimp.org>
Federico Mena Quintero <quartic@gimp.org>

View File

@ -1,5 +0,0 @@
## Process this file with automake to produce Makefile.in
SUBDIRS = gck
EXTRA_DIST = docs/html/gckcolor.html

View File

@ -1,126 +0,0 @@
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 3.2//EN">
<HTML>
<HEAD>
<TITLE>GCK - UI releated functions</TITLE>
<META NAME="Author" CONTENT="Tom Bech">
<META NAME="GENERATOR" CONTENT="Mozilla/3.01Gold (X11; I; Linux 2.0.27 i586) [Netscape]">
<META NAME="Description" CONTENT="Overview of the GCK Color functions">
<META NAME="Keywords" CONTENT="GDK, GTK, GCK, GIMP, color, colour">
</HEAD>
<BODY TEXT="#FFFFFF" BGCOLOR="#000000" LINK="#00FFFF" VLINK="#FF00FF" ALINK="#FF0000">
<H1><B>GCK - Color related functions</B>
<HR WIDTH="100%"></H1>
<P>Description..</P>
<P>
<HR WIDTH="100%"></P>
<LI><A HREF="#Visual and colormap handling">Visual and colormap handling
</A></LI>
<LI><A HREF="#RGB to GDK conversions">RGB to GDK conversions </A></LI>
<LI><A HREF="#Interpolation">Interpolation </A></LI>
<LI><A HREF="#Color operations">Color operations </A></LI>
<LI><A HREF="#Colorspace conversions">Colorspace conversions </A></LI>
<LI><A HREF="#Supersampling/antialiasing">Supersampling/antialiasing </A></LI>
<P>
<HR WIDTH="100%"></P>
<P><A NAME="Visual and colormap handling"></A><B>Visual and colormap handling</B></P>
<UL>
<LI>gck_visualinfo_new </LI>
<LI>gck_visualinfo_destroy </LI>
<LI>gck_visualinfo_get_dither </LI>
<LI>gck_visualinfo_set_dither </LI>
</UL>
<P><A NAME="RGB to GDK conversions"></A><B>RGB to GDK conversions</B></P>
<UL>
<LI>gck_rgb_to_gdkimage </LI>
<LI>gck_rgb_to_gdkcolor </LI>
</UL>
<P><A NAME="Interpolation"></A><B>Interpolation</B></P>
<UL>
<LI>gck_bilinear </LI>
<LI>gck_bilinear_8 </LI>
<LI>gck_bilinear_16 </LI>
<LI>gck_bilinear_32 </LI>
<LI>gck_bilinear_rgb </LI>
<LI>gck_bilinear_rgba </LI>
</UL>
<P><A NAME="Color operations"></A><B>Color operations</B></P>
<UL>
<LI>gck_rgb_add </LI>
<LI>gck_rgb_sub </LI>
<LI>gck_rgb_mul </LI>
<LI>gck_rgb_clamp </LI>
<LI>gck_rgb_set </LI>
<LI>gck_rgb_gamma </LI>
</UL>
<UL>
<LI>gck_rgba_add </LI>
<LI>gck_rgba_sub </LI>
<LI>gck_rgba_mul </LI>
<LI>gck_rgba_clamp </LI>
<LI>gck_rgba_set </LI>
<LI>gck_rgba_gamma </LI>
</UL>
<P><A NAME="Colorspace conversions"></A><B>Colorspace conversions</B></P>
<UL>
<LI>gck_rgb_to_hsv </LI>
<LI>gck_rgb_to_hsl </LI>
<LI>gck_hsv_to_rgb </LI>
<LI>gck_hsl_to_rgb </LI>
</UL>
<P><A NAME="Supersampling/antialiasing"></A><B>Supersampling/antialiasing</B></P>
<UL>
<LI>gck_adaptive_supersample_area </LI>
</UL>
<P>
<HR WIDTH="100%"><I><FONT SIZE=-1>Last changed 13-Feb-1997 by <A HREF="http://www.ii.uib.no/~tomb/">Tom
Bech</A> (<A HREF="mailto:tomb@ii.uib.no">tomb@ii.uib.no</A>)</FONT></I><FONT SIZE=-1>
</FONT></P>
</BODY>
</HTML>

View File

@ -1,7 +0,0 @@
Makefile.in
Makefile
.deps
_libs
.libs
*.lo
*.la

View File

@ -1,14 +0,0 @@
## Process this file with automake to produce Makefile.in
noinst_LIBRARIES = libgck.a
libgck_a_SOURCES = \
gckcolor.c \
gck.h
INCLUDES = \
-I.. \
-I$(srcdir)/.. \
-I$(top_srcdir) \
$(GTK_CFLAGS) \
-I$(includedir)

View File

@ -1,73 +0,0 @@
/***************************************************************************/
/* GCK - The General Convenience Kit. Generally useful conveniece routines */
/* for GIMP plug-in writers and users of the GDK/GTK libraries. */
/* Copyright (C) 1996 Tom Bech */
/* */
/* This program is free software; you can redistribute it and/or modify */
/* it under the terms of the GNU General Public License as published by */
/* the Free Software Foundation; either version 2 of the License, or */
/* (at your option) any later version. */
/* */
/* This program is distributed in the hope that it will be useful, */
/* but WITHOUT ANY WARRANTY; without even the implied warranty of */
/* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the */
/* GNU General Public License for more details. */
/* */
/* You should have received a copy of the GNU General Public License */
/* along with this program; if not, write to the Free Software */
/* Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, */
/* USA. */
/***************************************************************************/
#ifndef __GCK_H__
#define __GCK_H__
#include <gtk/gtk.h>
#ifdef __cplusplus
extern "C" {
#endif
typedef enum
{
DITHER_NONE,
DITHER_FLOYD_STEINBERG
} GckDitherType;
typedef struct
{
GdkVisual *visual;
GdkColormap *colormap;
gulong allocedpixels[256];
guint32 colorcube[256];
GdkColor rgbpalette[256];
guchar map_r[256], map_g[256], map_b[256];
guchar indextab[7][7][7];
guchar invmap_r[256], invmap_g[256], invmap_b[256];
gint shades_r, shades_g, shades_b, numcolors;
GckDitherType dithermethod;
} GckVisualInfo;
GckVisualInfo *gck_visualinfo_new (GdkScreen *screen);
void gck_visualinfo_destroy (GckVisualInfo *visinfo);
/* RGB to Gdk routines */
/* =================== */
void gck_rgb_to_gdkimage (GckVisualInfo *visinfo,
guchar *RGB_data,
GdkImage *image,
int width,
int height);
void gck_gc_set_foreground (GckVisualInfo *visinfo,GdkGC *gc,
guchar r, guchar g, guchar b);
void gck_gc_set_background (GckVisualInfo *visinfo,GdkGC *gc,
guchar r, guchar g, guchar b);
#ifdef __cplusplus
}
#endif
#endif /* __GCK_H__ */

File diff suppressed because it is too large Load Diff

View File

@ -72,9 +72,6 @@ libs-clean :
@nmake -nologo -f makefile.msc sub-libs TARGET=clean
sub-libs:
cd libgck\gck
nmake -nologo -f ..\..\makefile.msc GIMPTOP=..\..\.. LIBRARY=gck OBJECTS="gckcolor.obj" $(TARGET)
cd ..\..
cd libgimpoldpreview
nmake -nologo -f ..\makefile.msc GIMPTOP=..\.. LIBRARY=gimpoldpreview OBJECTS="gimpoldpreview.obj" $(TARGET)
cd ..
@ -179,8 +176,6 @@ OBJECTS = \
lighting_preview.obj \
lighting_shade.obj \
lighting_ui.obj
EXTRACFLAGS = -I$(PLUGINDIR)\libgck
EXTRALIBS = $(PLUGINDIR)\libgck\gck\gck.lib
!ENDIF
!IFDEF EXTRA_MapObject
@ -192,8 +187,6 @@ OBJECTS = \
mapobject_preview.obj \
mapobject_shade.obj \
mapobject_ui.obj
EXTRACFLAGS = -I$(PLUGINDIR)\libgck
EXTRALIBS = $(PLUGINDIR)\libgck\gck\gck.lib
OPTIMIZE =
!ENDIF