Commit 5591b7cd authored by Sven Neumann's avatar Sven Neumann Committed by Sven Neumann
Browse files

app/gdisplay.c app/gdisplay_ops.c app/info_window.c app/layer.c

2001-01-22  Sven Neumann  <sven@gimp.org>

	* app/gdisplay.c
	* app/gdisplay_ops.c
	* app/info_window.c
	* app/layer.c
	* app/menus.c
	* app/nav_window.c
	* app/path.c
	* app/scroll.[ch]: removed inclusion of superfluous headers and
	cleaned up the source a little.
parent ae435be2
2001-01-22 Sven Neumann <sven@gimp.org>
* app/gdisplay.c
* app/gdisplay_ops.c
* app/info_window.c
* app/layer.c
* app/menus.c
* app/nav_window.c
* app/path.c
* app/scroll.[ch]: removed inclusion of superfluous headers and
cleaned up the source a little.
2001-01-22 Michael Natterer <mitch@gimp.org>
* app/tools/Makefile.am
......
......@@ -33,13 +33,13 @@
#include "gdisplay.h"
#include "gimage_mask.h"
#include "gimpimage.h"
#include "gimppreviewcache.h"
#include "layer.h"
#include "parasitelist.h"
#include "paint_funcs.h"
#include "pixel_region.h"
#include "temp_buf.h"
#include "parasitelist.h"
#include "undo.h"
#include "gimppreviewcache.h"
#include "temp_buf.h"
#include "tile_manager.h"
#include "tile.h"
......
......@@ -49,7 +49,6 @@
#include "plug_in.h"
#include "qmask.h"
#include "scale.h"
#include "scroll.h"
#include "selection.h"
#include "undo.h"
......@@ -58,7 +57,6 @@
#include "gdisplay_color.h"
#endif /* DISPLAY_FILTERS */
#include "tools/bezier_selectP.h"
#include "tools/tools.h"
#include "libgimp/gimpmath.h"
......
......@@ -23,17 +23,14 @@
#include "apptypes.h"
#include "appenv.h"
#include "apptypes.h"
#include "colormaps.h"
#include "gdisplay.h"
#include "gimpcontext.h"
#include "gimpimage.h"
#include "gimpset.h"
#include "gimpui.h"
#include "gximage.h"
#include "info_dialog.h"
#include "info_window.h"
#include "scroll.h"
#include "tools/tools.h"
......@@ -115,7 +112,7 @@ info_window_page_switch (GtkWidget *widget,
GtkNotebookPage *page,
gint page_num)
{
InfoDialog *info_win;
InfoDialog *info_win;
InfoWinData *iwd;
info_win = (InfoDialog *) gtk_object_get_user_data (GTK_OBJECT (widget));
......@@ -134,13 +131,12 @@ info_window_page_switch (GtkWidget *widget,
static void
info_window_create_extended (InfoDialog *info_win)
{
GtkWidget *hbox;
GtkWidget *frame;
GtkWidget *alignment;
GtkWidget *table;
GtkWidget *label;
GtkWidget *pixmap;
GtkWidget *hbox;
GtkWidget *frame;
GtkWidget *alignment;
GtkWidget *table;
GtkWidget *label;
GtkWidget *pixmap;
InfoWinData *iwd;
iwd = (InfoWinData *) info_win->user_data;
......@@ -245,10 +241,11 @@ info_window_create_extended (InfoDialog *info_win)
InfoDialog *
info_window_create (GDisplay *gdisp)
{
InfoDialog *info_win;
InfoDialog *info_win;
InfoWinData *iwd;
gchar *title, *title_buf;
gint type;
gchar *title;
gchar *title_buf;
gint type;
title = g_basename (gimp_image_filename (gdisp->gimage));
type = gimp_image_base_type (gdisp->gimage);
......@@ -335,9 +332,9 @@ info_window_change_display (GimpContext *context, /* NOT USED */
GDisplay *newdisp,
gpointer data /* Not used */)
{
GDisplay * gdisp = newdisp;
GDisplay * old_gdisp;
GimpImage * gimage;
GDisplay *gdisp = newdisp;
GDisplay *old_gdisp;
GimpImage *gimage;
InfoWinData *iwd;
iwd = (InfoWinData *) info_window_auto->user_data;
......@@ -345,16 +342,14 @@ info_window_change_display (GimpContext *context, /* NOT USED */
old_gdisp = (GDisplay *) iwd->gdisp;
if (!info_window_auto || gdisp == old_gdisp || !gdisp)
{
return;
}
return;
gimage = gdisp->gimage;
if (gimage && gimp_set_have (image_context, gimage))
{
iwd->gdisp = gdisp;
info_window_update(gdisp);
info_window_update (gdisp);
}
}
......@@ -371,9 +366,11 @@ info_window_follow_auto (void)
if(!info_window_auto)
{
info_window_auto = info_window_create ((void *) gdisp);
gtk_signal_connect (GTK_OBJECT (gimp_context_get_user ()), "display_changed",
GTK_SIGNAL_FUNC (info_window_change_display), NULL);
info_window_update(gdisp); /* Update to include the info */
gtk_signal_connect (GTK_OBJECT (gimp_context_get_user ()),
"display_changed",
GTK_SIGNAL_FUNC (info_window_change_display),
NULL);
info_window_update (gdisp); /* Update to include the info */
}
info_dialog_popup (info_window_auto);
......@@ -389,41 +386,38 @@ info_window_update_RGB (GDisplay *gdisp,
gdouble tx,
gdouble ty)
{
InfoWinData *iwd;
gchar buff[4];
guchar *color;
GimpImageType sample_type;
InfoDialog *info_win = gdisp->window_info_dialog;
gboolean force_update = FALSE;
InfoWinData *iwd;
gchar buff[4];
guchar *color;
GimpImageType sample_type;
InfoDialog *info_win = gdisp->window_info_dialog;
gboolean force_update = FALSE;
if (!info_win && info_window_auto != NULL)
{
info_win = info_window_auto;
}
info_win = info_window_auto;
if (!info_win)
return;
iwd = (InfoWinData *) info_win->user_data;
if(iwd->gdisp != gdisp)
if (iwd->gdisp != gdisp)
force_update = TRUE;
iwd->gdisp = gdisp;
if(force_update == TRUE)
if (force_update)
{
gchar *title_buf;
info_window_update(gdisp);
title_buf = info_window_title(gdisp);
gtk_window_set_title (GTK_WINDOW (info_window_auto->shell), title_buf);
g_free (title_buf);
gchar *title;
info_window_update (gdisp);
title = info_window_title (gdisp);
gtk_window_set_title (GTK_WINDOW (info_window_auto->shell), title);
g_free (title);
}
if (!iwd || iwd->showingPreview == FALSE)
if (!iwd || !iwd->showingPreview)
return;
/* gimp_image_active_drawable (gdisp->gimage) */
......@@ -464,7 +458,6 @@ void
info_window_free (InfoDialog *info_win)
{
InfoWinData *iwd;
extern gint gimage_image_count (void);
if (!info_win && info_window_auto)
{
......@@ -491,7 +484,7 @@ info_window_update (GDisplay *gdisp)
gdouble unit_factor;
gint unit_digits;
gchar format_buf[32];
InfoDialog *info_win = gdisp->window_info_dialog;
InfoDialog *info_win = gdisp->window_info_dialog;
if (!info_win && info_window_auto != NULL)
info_win = info_window_auto;
......
......@@ -25,13 +25,9 @@
#include "appenv.h"
#include "colormaps.h"
#include "cursorutil.h"
#include "fileops.h"
#include "gdisplay_ops.h"
#include "gimpimage.h"
#include "gimpui.h"
#include "gximage.h"
#include "menus.h"
#include "scale.h"
#include "gimprc.h"
#include "libgimp/gimphelpui.h"
......
......@@ -41,9 +41,9 @@
/* STATIC variables */
/* These are the values of the initial pointer grab */
static int startx, starty;
static gint startx, starty;
gint
gboolean
scrollbar_vert_update (GtkAdjustment *adjustment,
gpointer data)
{
......@@ -57,7 +57,7 @@ scrollbar_vert_update (GtkAdjustment *adjustment,
}
gint
gboolean
scrollbar_horz_update (GtkAdjustment *adjustment,
gpointer data)
{
......@@ -100,9 +100,7 @@ grab_and_scroll (GDisplay *gdisp,
GdkEventMotion *mevent)
{
if (mevent && mevent->window != gdisp->canvas->window)
{
return;
}
return;
scroll_display (gdisp,
startx - mevent->x - gdisp->offset_x,
......@@ -114,8 +112,8 @@ void
scroll_to_pointer_position (GDisplay *gdisp,
GdkEventMotion *mevent)
{
double child_x, child_y;
int off_x, off_y;
gdouble child_x, child_y;
gint off_x, off_y;
off_x = off_y = 0;
......@@ -124,6 +122,7 @@ scroll_to_pointer_position (GDisplay *gdisp,
off_x = mevent->x;
else if (mevent->x > gdisp->disp_width)
off_x = mevent->x - gdisp->disp_width;
if (mevent->y < 0)
off_y = mevent->y;
else if (mevent->y > gdisp->disp_height)
......@@ -145,15 +144,14 @@ scroll_to_pointer_position (GDisplay *gdisp,
}
}
int
gboolean
scroll_display (GDisplay *gdisp,
gint x_offset,
gint y_offset)
{
int old_x, old_y;
int src_x, src_y;
int dest_x, dest_y;
gint old_x, old_y;
gint src_x, src_y;
gint dest_x, dest_y;
GdkEvent *event;
old_x = gdisp->offset_x;
......@@ -229,16 +227,18 @@ scroll_display (GDisplay *gdisp,
!= NULL)
{
gtk_widget_event (gdisp->canvas, event);
if (event->expose.count == 0)
{
gdk_event_free (event);
break;
}
gdk_event_free (event);
}
return 1;
return TRUE;
}
return 0;
return FALSE;
}
......@@ -21,31 +21,31 @@
/* app init and exit routines */
void init_scrolling (void);
void free_scrolling (void);
void init_scrolling (void);
void free_scrolling (void);
/* routines for scrolling the image via the scrollbars */
void scrollbar_disconnect (GtkAdjustment *adjuatment,
gpointer data);
gint scrollbar_vert_update (GtkAdjustment *adjuatment,
gpointer data);
gint scrollbar_horz_update (GtkAdjustment *adjuatment,
gpointer data);
void scrollbar_disconnect (GtkAdjustment *adjuatment,
gpointer data);
gboolean scrollbar_vert_update (GtkAdjustment *adjuatment,
gpointer data);
gboolean scrollbar_horz_update (GtkAdjustment *adjuatment,
gpointer data);
/* routines for grabbing the image and scrolling via the pointer */
void start_grab_and_scroll (GDisplay *gdisp,
GdkEventButton *bevent);
void end_grab_and_scroll (GDisplay *gdisp,
GdkEventButton *bevent);
void grab_and_scroll (GDisplay *gdisp,
GdkEventMotion *mevent);
void scroll_to_pointer_position (GDisplay *gdisp,
GdkEventMotion *mevent);
void start_grab_and_scroll (GDisplay *gdisp,
GdkEventButton *bevent);
void end_grab_and_scroll (GDisplay *gdisp,
GdkEventButton *bevent);
void grab_and_scroll (GDisplay *gdisp,
GdkEventMotion *mevent);
void scroll_to_pointer_position (GDisplay *gdisp,
GdkEventMotion *mevent);
/* generic scroll-by-offset function */
gint scroll_display (GDisplay *,
gint ,
gint );
gboolean scroll_display (GDisplay *gdisp,
gint x_offset,
gint y_offset);
#endif /* __SCROLL_H__ */
......@@ -49,7 +49,6 @@
#include "plug_in.h"
#include "qmask.h"
#include "scale.h"
#include "scroll.h"
#include "selection.h"
#include "undo.h"
......@@ -58,7 +57,6 @@
#include "gdisplay_color.h"
#endif /* DISPLAY_FILTERS */
#include "tools/bezier_selectP.h"
#include "tools/tools.h"
#include "libgimp/gimpmath.h"
......
......@@ -41,9 +41,9 @@
/* STATIC variables */
/* These are the values of the initial pointer grab */
static int startx, starty;
static gint startx, starty;
gint
gboolean
scrollbar_vert_update (GtkAdjustment *adjustment,
gpointer data)
{
......@@ -57,7 +57,7 @@ scrollbar_vert_update (GtkAdjustment *adjustment,
}
gint
gboolean
scrollbar_horz_update (GtkAdjustment *adjustment,
gpointer data)
{
......@@ -100,9 +100,7 @@ grab_and_scroll (GDisplay *gdisp,
GdkEventMotion *mevent)
{
if (mevent && mevent->window != gdisp->canvas->window)
{
return;
}
return;
scroll_display (gdisp,
startx - mevent->x - gdisp->offset_x,
......@@ -114,8 +112,8 @@ void
scroll_to_pointer_position (GDisplay *gdisp,
GdkEventMotion *mevent)
{
double child_x, child_y;
int off_x, off_y;
gdouble child_x, child_y;
gint off_x, off_y;
off_x = off_y = 0;
......@@ -124,6 +122,7 @@ scroll_to_pointer_position (GDisplay *gdisp,
off_x = mevent->x;
else if (mevent->x > gdisp->disp_width)
off_x = mevent->x - gdisp->disp_width;
if (mevent->y < 0)
off_y = mevent->y;
else if (mevent->y > gdisp->disp_height)
......@@ -145,15 +144,14 @@ scroll_to_pointer_position (GDisplay *gdisp,
}
}
int
gboolean
scroll_display (GDisplay *gdisp,
gint x_offset,
gint y_offset)
{
int old_x, old_y;
int src_x, src_y;
int dest_x, dest_y;
gint old_x, old_y;
gint src_x, src_y;
gint dest_x, dest_y;
GdkEvent *event;
old_x = gdisp->offset_x;
......@@ -229,16 +227,18 @@ scroll_display (GDisplay *gdisp,
!= NULL)
{
gtk_widget_event (gdisp->canvas, event);
if (event->expose.count == 0)
{
gdk_event_free (event);
break;
}
gdk_event_free (event);
}
return 1;
return TRUE;
}
return 0;
return FALSE;
}
......@@ -21,31 +21,31 @@
/* app init and exit routines */
void init_scrolling (void);
void free_scrolling (void);
void init_scrolling (void);
void free_scrolling (void);
/* routines for scrolling the image via the scrollbars */
void scrollbar_disconnect (GtkAdjustment *adjuatment,
gpointer data);
gint scrollbar_vert_update (GtkAdjustment *adjuatment,
gpointer data);
gint scrollbar_horz_update (GtkAdjustment *adjuatment,
gpointer data);
void scrollbar_disconnect (GtkAdjustment *adjuatment,
gpointer data);
gboolean scrollbar_vert_update (GtkAdjustment *adjuatment,
gpointer data);
gboolean scrollbar_horz_update (GtkAdjustment *adjuatment,
gpointer data);
/* routines for grabbing the image and scrolling via the pointer */
void start_grab_and_scroll (GDisplay *gdisp,
GdkEventButton *bevent);
void end_grab_and_scroll (GDisplay *gdisp,
GdkEventButton *bevent);
void grab_and_scroll (GDisplay *gdisp,
GdkEventMotion *mevent);
void scroll_to_pointer_position (GDisplay *gdisp,
GdkEventMotion *mevent);
void start_grab_and_scroll (GDisplay *gdisp,
GdkEventButton *bevent);
void end_grab_and_scroll (GDisplay *gdisp,
GdkEventButton *bevent);
void grab_and_scroll (GDisplay *gdisp,
GdkEventMotion *mevent);
void scroll_to_pointer_position (GDisplay *gdisp,
GdkEventMotion *mevent);
/* generic scroll-by-offset function */
gint scroll_display (GDisplay *,
gint ,
gint );
gboolean scroll_display (GDisplay *gdisp,
gint x_offset,
gint y_offset);
#endif /* __SCROLL_H__ */
......@@ -37,7 +37,6 @@
#include "gimpset.h"
#include "gimprc.h"
#include "gimpui.h"
#include "gximage.h"
#include "nav_window.h"
#include "scroll.h"
#include "scale.h"
......
......@@ -37,7 +37,6 @@
#include "gimpset.h"
#include "gimprc.h"
#include "gimpui.h"
#include "gximage.h"
#include "nav_window.h"
#include "scroll.h"
#include "scale.h"
......
......@@ -49,7 +49,6 @@
#include "plug_in.h"
#include "qmask.h"
#include "scale.h"
#include "scroll.h"
#include "selection.h"
#include "undo.h"
......@@ -58,7 +57,6 @@
#include "gdisplay_color.h"
#endif /* DISPLAY_FILTERS */
#include "tools/bezier_selectP.h"
#include "tools/tools.h"
#include "libgimp/gimpmath.h"
......
......@@ -25,13 +25,9 @@
#include "appenv.h"
#include "colormaps.h"
#include "cursorutil.h"
#include "fileops.h"
#include "gdisplay_ops.h"
#include "gimpimage.h"
#include "gimpui.h"
#include "gximage.h"
#include "menus.h"
#include "scale.h"
#include "gimprc.h"
#include "libgimp/gimphelpui.h"
......
......@@ -33,13 +33,13 @@
#include "gdisplay.h"
#include "gimage_mask.h"
#include "gimpimage.h"
#include "gimppreviewcache.h"
#include "layer.h"
#include "parasitelist.h"
#include "paint_funcs.h"
#include "pixel_region.h"
#include "temp_buf.h"
#include "parasitelist.h"
#include "undo.h"
#include "gimppreviewcache.h"
#include "temp_buf.h"
#include "tile_manager.h"
#include "tile.h"
......
......@@ -23,17 +23,14 @@
#include "apptypes.h"
#include "appenv.h"
#include "apptypes.h"
#include "colormaps.h"
#include "gdisplay.h"
#include "gimpcontext.h"
#include "gimpimage.h"
#include "gimpset.h"
#include "gimpui.h"
#include "gximage.h"
#include "info_dialog.h"
#include "info_window.h"
#include "scroll.h"
#include "tools/tools.h"
......@@ -115,7 +112,7 @@ info_window_page_switch (GtkWidget *widget,
GtkNotebookPage *page,
gint page_num)
{
InfoDialog *info_win;
InfoDialog *info_win;
InfoWinData *iwd;