Commit 8dac8949 authored by Michael Natterer's avatar Michael Natterer 😴 Committed by Michael Natterer

app/display/gimpdisplay-marching-ants.h removed...

2001-11-10  Michael Natterer  <mitch@gimp.org>

	* app/display/gimpdisplay-marching-ants.h
	* app/display/gimpdisplay-selection.[ch]: removed...

	* app/display/gimpdisplayshell-marching-ants.h
	* app/display/gimpdisplayshell-selection.[ch]: ...new names.

	* app/display/gimpdisplay.[ch]
	* app/display/gimpdisplayshell.[ch]: moved the Selection stuff
	from GimpDisplay to GimpDisplayShell.

	Renamed all functions which will stay in GimpDisplay from
	gdisplay_foo() to gimp_display_foo(). Added gimp_display_get_ID(),
	cleaned up the idle renderer.

	* app/image_map.c
	* app/plug_in.c
	* app/display/Makefile.am
	* app/display/gimpdisplay-foreach.[ch]
	* app/display/gimpdisplay-handlers.c
	* app/display/gimpdisplayshell-callbacks.c
	* app/display/gimpdisplayshell-handlers.c
	* app/display/gimpdisplayshell-scroll.c
	* app/gui/gui.c
	* app/gui/view-commands.c
	* app/tools/gimpeditselectiontool.c
	* app/tools/gimpinktool.c
	* app/tools/gimpmovetool.c
	* app/tools/gimppainttool.c
	* tools/pdbgen/pdb.pl: changed accordingly, cleanup.

	* app/pdb/display_cmds.c: regenerated.
parent cfeab8bc
2001-11-10 Michael Natterer <mitch@gimp.org>
* app/display/gimpdisplay-marching-ants.h
* app/display/gimpdisplay-selection.[ch]: removed...
* app/display/gimpdisplayshell-marching-ants.h
* app/display/gimpdisplayshell-selection.[ch]: ...new names.
* app/display/gimpdisplay.[ch]
* app/display/gimpdisplayshell.[ch]: moved the Selection stuff
from GimpDisplay to GimpDisplayShell.
Renamed all functions which will stay in GimpDisplay from
gdisplay_foo() to gimp_display_foo(). Added gimp_display_get_ID(),
cleaned up the idle renderer.
* app/image_map.c
* app/plug_in.c
* app/display/Makefile.am
* app/display/gimpdisplay-foreach.[ch]
* app/display/gimpdisplay-handlers.c
* app/display/gimpdisplayshell-callbacks.c
* app/display/gimpdisplayshell-handlers.c
* app/display/gimpdisplayshell-scroll.c
* app/gui/gui.c
* app/gui/view-commands.c
* app/tools/gimpeditselectiontool.c
* app/tools/gimpinktool.c
* app/tools/gimpmovetool.c
* app/tools/gimppainttool.c
* tools/pdbgen/pdb.pl: changed accordingly, cleanup.
* app/pdb/display_cmds.c: regenerated.
2001-11-10 Michael Natterer <mitch@gimp.org>
* Makefile.am
......
......@@ -3612,7 +3612,7 @@ plug_in_progress_init (PlugIn *plug_in,
message = plug_in->args[0];
if (gdisp_ID > 0)
gdisp = gdisplay_get_by_ID (the_gimp, gdisp_ID);
gdisp = gimp_display_get_by_ID (the_gimp, gdisp_ID);
if (plug_in->progress)
plug_in->progress = progress_restart (plug_in->progress, message,
......
......@@ -30,9 +30,9 @@
#include "display/gimpdisplay.h"
#include "display/gimpdisplay-foreach.h"
#include "display/gimpdisplay-selection.h"
#include "display/gimpdisplayshell.h"
#include "display/gimpdisplayshell-scale.h"
#include "display/gimpdisplayshell-selection.h"
#include "info-dialog.h"
#include "info-window.h"
......@@ -150,17 +150,19 @@ void
view_toggle_selection_cmd_callback (GtkWidget *widget,
gpointer data)
{
GimpDisplay *gdisp;
gint new_val;
GimpDisplay *gdisp;
GimpDisplayShell *shell;
gint new_val;
return_if_no_display (gdisp, data);
shell = GIMP_DISPLAY_SHELL (gdisp->shell);
new_val = GTK_CHECK_MENU_ITEM (widget)->active;
/* hidden == TRUE corresponds to the menu toggle being FALSE */
if (new_val == gdisp->select->hidden)
if (new_val == shell->select->hidden)
{
selection_toggle (gdisp->select);
gimp_display_shell_selection_toggle (shell->select);
gdisplays_flush ();
}
......@@ -236,7 +238,7 @@ view_toggle_guides_cmd_callback (GtkWidget *widget,
if ((old_val != gdisp->draw_guides) && gdisp->gimage->guides)
{
gimp_display_shell_expose_full (GIMP_DISPLAY_SHELL (gdisp->shell));
gdisplay_flush (gdisp);
gimp_display_flush (gdisp);
}
}
......
......@@ -418,7 +418,7 @@ image_map_do (gpointer data)
gimp_drawable_update (image_map->drawable,
x, y,
w, h);
gdisplay_flush_now (image_map->gdisp);
gimp_display_flush_now (image_map->gdisp);
}
image_map->PRI = pixel_regions_process (image_map->PRI);
......
This diff is collapsed.
......@@ -57,15 +57,14 @@ typedef struct _IdleRenderStruct IdleRenderStruct;
struct _IdleRenderStruct
{
gint width;
gint height;
gint x;
gint y;
gint basex;
gint basey;
guint idleid;
gboolean active;
GSList *update_areas; /* flushed update areas */
gint width;
gint height;
gint x;
gint y;
gint basex;
gint basey;
guint idle_id;
GSList *update_areas; /* flushed update areas */
};
......@@ -99,8 +98,6 @@ struct _GimpDisplay
gboolean draw_guides; /* should the guides be drawn? */
gboolean snap_to_guides; /* should the guides be snapped to? */
Selection *select; /* Selection object */
GSList *update_areas; /* Update areas list */
IdleRenderStruct idle_render; /* state of this gdisplay's render thread */
......@@ -112,25 +109,32 @@ struct _GimpDisplayClass
};
/* member function declarations */
GType gimp_display_get_type (void);
GimpDisplay * gdisplay_new (GimpImage *gimage,
guint scale);
void gdisplay_delete (GimpDisplay *gdisp);
GimpDisplay * gimp_display_new (GimpImage *gimage,
guint scale);
void gimp_display_delete (GimpDisplay *gdisp);
GimpDisplay * gdisplay_get_by_ID (Gimp *gimp,
gint ID);
gint gimp_display_get_ID (GimpDisplay *gdisp);
GimpDisplay * gimp_display_get_by_ID (Gimp *gimp,
gint ID);
void gdisplay_reconnect (GimpDisplay *gdisp,
GimpImage *gimage);
void gimp_display_reconnect (GimpDisplay *gdisp,
GimpImage *gimage);
void gdisplay_add_update_area (GimpDisplay *gdisp,
gint x,
gint y,
gint w,
gint h);
void gimp_display_add_update_area (GimpDisplay *gdisp,
gint x,
gint y,
gint w,
gint h);
void gimp_display_flush (GimpDisplay *gdisp);
void gimp_display_flush_now (GimpDisplay *gdisp);
void gimp_display_finish_draw (GimpDisplay *gdisp);
/* stuff that will go to GimpDisplayShell */
void gdisplay_transform_coords (GimpDisplay *gdisp,
gint x,
......@@ -158,13 +162,5 @@ void gdisplay_untransform_coords_f (GimpDisplay *gdisp,
gdouble *ny,
gboolean use_offsets);
void gdisplay_selection_visibility (GimpDisplay *gdisp,
GimpSelectionControl control);
void gdisplay_flush (GimpDisplay *gdisp);
void gdisplay_flush_now (GimpDisplay *gdisp);
void gdisplays_finish_draw (void);
#endif /* __GIMP_DISPLAY_H__ */
......@@ -2,53 +2,53 @@
noinst_LIBRARIES = libappdisplay.a
libappdisplay_a_SOURCES = @STRIP_BEGIN@ \
display-types.h \
gimpdisplay.c \
gimpdisplay.h \
gimpdisplay-area.c \
gimpdisplay-area.h \
gimpdisplay-foreach.c \
gimpdisplay-foreach.h \
gimpdisplay-handlers.c \
gimpdisplay-handlers.h \
gimpdisplay-marching-ants.h \
gimpdisplay-selection.c \
gimpdisplay-selection.h \
gimpdisplayshell.c \
gimpdisplayshell.h \
gimpdisplayshell-callbacks.c \
gimpdisplayshell-callbacks.h \
gimpdisplayshell-dnd.c \
gimpdisplayshell-dnd.h \
gimpdisplayshell-handlers.c \
gimpdisplayshell-handlers.h \
gimpdisplayshell-layer-select.c \
gimpdisplayshell-layer-select.h \
gimpdisplayshell-qmask.c \
gimpdisplayshell-qmask.h \
gimpdisplayshell-render.c \
gimpdisplayshell-render.h \
gimpdisplayshell-scale.c \
gimpdisplayshell-scale.h \
gimpdisplayshell-scroll.c \
gimpdisplayshell-scroll.h \
libappdisplay_a_SOURCES = @STRIP_BEGIN@ \
display-types.h \
gimpdisplay.c \
gimpdisplay.h \
gimpdisplay-area.c \
gimpdisplay-area.h \
gimpdisplay-foreach.c \
gimpdisplay-foreach.h \
gimpdisplay-handlers.c \
gimpdisplay-handlers.h \
gimpdisplayshell.c \
gimpdisplayshell.h \
gimpdisplayshell-callbacks.c \
gimpdisplayshell-callbacks.h \
gimpdisplayshell-dnd.c \
gimpdisplayshell-dnd.h \
gimpdisplayshell-handlers.c \
gimpdisplayshell-handlers.h \
gimpdisplayshell-layer-select.c \
gimpdisplayshell-layer-select.h \
gimpdisplayshell-marching-ants.h \
gimpdisplayshell-qmask.c \
gimpdisplayshell-qmask.h \
gimpdisplayshell-render.c \
gimpdisplayshell-render.h \
gimpdisplayshell-scale.c \
gimpdisplayshell-scale.h \
gimpdisplayshell-scroll.c \
gimpdisplayshell-scroll.h \
gimpdisplayshell-selection.c \
gimpdisplayshell-selection.h \
\
gximage.c \
gximage.h \
gximage.c \
gximage.h \
@STRIP_END@
AM_CPPFLAGS = @STRIP_BEGIN@ \
-DG_LOG_DOMAIN=\"Gimp-Display\" \
@GIMP_THREAD_FLAGS@ \
@GIMP_MP_FLAGS@ \
-DG_LOG_DOMAIN=\"Gimp-Display\" \
@GIMP_THREAD_FLAGS@ \
@GIMP_MP_FLAGS@ \
@STRIP_END@
INCLUDES = @STRIP_BEGIN@ \
-I$(top_srcdir) \
-I$(top_srcdir)/app \
$(GTK_CFLAGS) \
-I$(includedir) \
-I$(top_srcdir) \
-I$(top_srcdir)/app \
$(GTK_CFLAGS) \
-I$(includedir) \
@STRIP_END@
.PHONY: files
......
......@@ -120,7 +120,7 @@ gdisplays_delete (void)
{
gdisp = (GimpDisplay *) display_list->data;
gdisplay_delete (gdisp);
gimp_display_delete (gdisp);
}
}
......@@ -172,12 +172,27 @@ gdisplays_flush (void)
{
gdisp = list->data;
gdisplay_flush (gdisp);
gimp_display_flush (gdisp);
}
flushing = FALSE;
}
/* Force all gdisplays to finish their idlerender projection */
void
gdisplays_finish_draw (void)
{
GSList *list;
GimpDisplay *gdisp;
for (list = display_list; list; list = g_slist_next (list))
{
gdisp = (GimpDisplay *) list->data;
gimp_display_finish_draw (gdisp);
}
}
void
gdisplays_reconnect (GimpImage *old,
GimpImage *new)
......@@ -193,7 +208,7 @@ gdisplays_reconnect (GimpImage *old,
gdisp = list->data;
if (gdisp->gimage == old)
gdisplay_reconnect (gdisp, new);
gimp_display_reconnect (gdisp, new);
}
}
......
......@@ -32,6 +32,7 @@ void gdisplays_expose_full (void);
gboolean gdisplays_dirty (void);
void gdisplays_delete (void);
void gdisplays_flush (void);
void gdisplays_finish_draw (void);
void gdisplays_nav_preview_resized (void);
void gdisplays_set_busy (void);
void gdisplays_unset_busy (void);
......
......@@ -30,22 +30,19 @@
/* local function prototypes */
static void gimp_display_update_handler (GimpImage *gimage,
gint x,
gint y,
gint w,
gint h,
GimpDisplay *gdisp);
static void gimp_display_selection_control_handler (GimpImage *gimage,
GimpSelectionControl control,
GimpDisplay *gdisp);
static void gimp_display_mode_changed_handler (GimpImage *gimage,
GimpDisplay *gdisp);
static void gimp_display_colormap_changed_handler (GimpImage *gimage,
gint ncol,
GimpDisplay *gdisp);
static void gimp_display_size_changed_handler (GimpImage *gimage,
GimpDisplay *gdisp);
static void gimp_display_update_handler (GimpImage *gimage,
gint x,
gint y,
gint w,
gint h,
GimpDisplay *gdisp);
static void gimp_display_mode_changed_handler (GimpImage *gimage,
GimpDisplay *gdisp);
static void gimp_display_colormap_changed_handler (GimpImage *gimage,
gint ncol,
GimpDisplay *gdisp);
static void gimp_display_size_changed_handler (GimpImage *gimage,
GimpDisplay *gdisp);
/* public functions */
......@@ -69,9 +66,6 @@ gimp_display_connect (GimpDisplay *gdisp,
g_signal_connect (G_OBJECT (gimage), "update",
G_CALLBACK (gimp_display_update_handler),
gdisp);
g_signal_connect (G_OBJECT (gimage), "selection_control",
G_CALLBACK (gimp_display_selection_control_handler),
gdisp);
g_signal_connect (G_OBJECT (gimage), "mode_changed",
G_CALLBACK (gimp_display_mode_changed_handler),
gdisp);
......@@ -98,9 +92,6 @@ gimp_display_disconnect (GimpDisplay *gdisp)
g_signal_handlers_disconnect_by_func (G_OBJECT (gdisp->gimage),
gimp_display_mode_changed_handler,
gdisp);
g_signal_handlers_disconnect_by_func (G_OBJECT (gdisp->gimage),
gimp_display_selection_control_handler,
gdisp);
g_signal_handlers_disconnect_by_func (G_OBJECT (gdisp->gimage),
gimp_display_update_handler,
gdisp);
......@@ -122,25 +113,17 @@ gimp_display_update_handler (GimpImage *gimage,
gint h,
GimpDisplay *gdisp)
{
gdisplay_add_update_area (gdisp, x, y, w, h);
}
static void
gimp_display_selection_control_handler (GimpImage *gimage,
GimpSelectionControl control,
GimpDisplay *gdisp)
{
gdisplay_selection_visibility (gdisp, control);
gimp_display_add_update_area (gdisp, x, y, w, h);
}
static void
gimp_display_mode_changed_handler (GimpImage *gimage,
GimpDisplay *gdisp)
{
gdisplay_add_update_area (gdisp,
0, 0,
gdisp->gimage->width,
gdisp->gimage->height);
gimp_display_add_update_area (gdisp,
0, 0,
gdisp->gimage->width,
gdisp->gimage->height);
}
static void
......@@ -149,18 +132,18 @@ gimp_display_colormap_changed_handler (GimpImage *gimage,
GimpDisplay *gdisp)
{
if (gimp_image_base_type (gdisp->gimage) == INDEXED)
gdisplay_add_update_area (gdisp,
0, 0,
gdisp->gimage->width,
gdisp->gimage->height);
gimp_display_add_update_area (gdisp,
0, 0,
gdisp->gimage->width,
gdisp->gimage->height);
}
static void
gimp_display_size_changed_handler (GimpImage *gimage,
GimpDisplay *gdisp)
{
gdisplay_add_update_area (gdisp,
0, 0,
gdisp->gimage->width,
gdisp->gimage->height);
gimp_display_add_update_area (gdisp,
0, 0,
gdisp->gimage->width,
gdisp->gimage->height);
}
#ifndef __MARCHING_ANTS_H__
#define __MARCHING_ANTS_H__
/* static variable definitions */
static unsigned char ant_data[8][8] =
{
{
0xF0, /* ####---- */
0xE1, /* ###----# */
0xC3, /* ##----## */
0x87, /* #----### */
0x0F, /* ----#### */
0x1E, /* ---####- */
0x3C, /* --####-- */
0x78, /* -####--- */
},
{
0xE1, /* ###----# */
0xC3, /* ##----## */
0x87, /* #----### */
0x0F, /* ----#### */
0x1E, /* ---####- */
0x3C, /* --####-- */
0x78, /* -####--- */
0xF0, /* ####---- */
},
{
0xC3, /* ##----## */
0x87, /* #----### */
0x0F, /* ----#### */
0x1E, /* ---####- */
0x3C, /* --####-- */
0x78, /* -####--- */
0xF0, /* ####---- */
0xE1, /* ###----# */
},
{
0x87, /* #----### */
0x0F, /* ----#### */
0x1E, /* ---####- */
0x3C, /* --####-- */
0x78, /* -####--- */
0xF0, /* ####---- */
0xE1, /* ###----# */
0xC3, /* ##----## */
},
{
0x0F, /* ----#### */
0x1E, /* ---####- */
0x3C, /* --####-- */
0x78, /* -####--- */
0xF0, /* ####---- */
0xE1, /* ###----# */
0xC3, /* ##----## */
0x87, /* #----### */
},
{
0x1E, /* ---####- */
0x3C, /* --####-- */
0x78, /* -####--- */
0xF0, /* ####---- */
0xE1, /* ###----# */
0xC3, /* ##----## */
0x87, /* #----### */
0x0F, /* ----#### */
},
{
0x3C, /* --####-- */
0x78, /* -####--- */
0xF0, /* ####---- */
0xE1, /* ###----# */
0xC3, /* ##----## */
0x87, /* #----### */
0x0F, /* ----#### */
0x1E, /* ---####- */
},
{
0x78, /* -####--- */
0xF0, /* ####---- */
0xE1, /* ###----# */
0xC3, /* ##----## */
0x87, /* #----### */
0x0F, /* ----#### */
0x1E, /* ---####- */
0x3C, /* --####-- */
},
};
#endif /* __MARCHING_ANTS_H__ */
/* 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
* Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
*/
#include "config.h"
#include <gtk/gtk.h>
#include "display-types.h"
#include "base/boundary.h"
#include "core/gimpimage.h"
#include "core/gimpimage-mask.h"
#include "gimpdisplay.h"
#include "gimpdisplay-marching-ants.h"
#include "gimpdisplay-selection.h"
#include "gimpdisplayshell.h"
#include "colormaps.h"
#include "gimprc.h"
#define USE_XDRAWPOINTS
#undef VERBOSE
/* The possible internal drawing states... */
#define INVISIBLE 0
#define INTRO 1
#define MARCHING 2
#define INITIAL_DELAY 15 /* in milleseconds */
/* local function prototypes */
static GdkPixmap * create_cycled_ants_pixmap (GdkWindow *window,
gint depth);
static void cycle_ant_colors (Selection *select);
static void selection_add_point (GdkPoint *points[8],
gint max_npoints[8],
gint npoints[8],
gint x,
gint y);
static void selection_render_points (Selection *select);
static void selection_draw (Selection *select);
static void selection_transform_segs (Selection *select,
BoundSeg *src_segs,
GdkSegment *dest_segs,
gint num_segs);
static void selection_generate_segs (Selection *select);
static void selection_free_segs (Selection *select);
static gboolean selection_start_marching (gpointer data);
static gboolean selection_march_ants (gpointer data);
GdkPixmap * marching_ants[9] = { NULL };
GdkPixmap * cycled_ants_pixmap = NULL;
/* public functions */
Selection *
selection_create (GdkWindow *win,
GimpDisplay *gdisp,
gint size,
gint width,
gint speed)