Commit 57f7f66a authored by Michael Natterer's avatar Michael Natterer 😴 Committed by Michael Natterer

minor code and formatting cleanup.

2005-08-25  Michael Natterer  <mitch@gimp.org>

	* app/widgets/gimpview.[ch]: minor code and formatting cleanup.
parent dc8bdb4f
2005-08-25 Michael Natterer <mitch@gimp.org>
* app/widgets/gimpview.[ch]: minor code and formatting cleanup.
2005-08-25 Sven Neumann <sven@gimp.org>
* app/base/siox.[ch]
......
......@@ -2,7 +2,7 @@
* Copyright (C) 1995 Spencer Kimball and Peter Mattis
*
* gimpview.c
* Copyright (C) 2001 Michael Natterer <mitch@gimp.org>
* Copyright (C) 2001-2005 Michael Natterer <mitch@gimp.org>
*
* 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
......@@ -289,7 +289,10 @@ gimp_view_unmap (GtkWidget *widget)
GimpView *view = GIMP_VIEW (widget);
if (view->has_grab)
gtk_grab_remove (widget);
{
gtk_grab_remove (widget);
view->has_grab = FALSE;
}
if (view->event_window)
gdk_window_hide (view->event_window);
......@@ -412,15 +415,15 @@ gimp_view_size_allocate (GtkWidget *widget,
static gboolean
gimp_view_expose_event (GtkWidget *widget,
GdkEventExpose *event)
GdkEventExpose *event)
{
if (! GTK_WIDGET_DRAWABLE (widget))
return FALSE;
gimp_view_renderer_draw (GIMP_VIEW (widget)->renderer,
widget->window, widget,
&widget->allocation,
&event->area);
if (GTK_WIDGET_DRAWABLE (widget))
{
gimp_view_renderer_draw (GIMP_VIEW (widget)->renderer,
widget->window, widget,
&widget->allocation,
&event->area);
}
return FALSE;
}
......@@ -513,7 +516,6 @@ gimp_view_button_release_event (GtkWidget *widget,
if (bevent->button == 1)
{
gtk_grab_remove (widget);
view->has_grab = FALSE;
if (view->clickable && view->in_button)
......@@ -623,7 +625,7 @@ gimp_view_real_set_viewable (GimpView *view,
g_object_add_weak_pointer (G_OBJECT (view->viewable),
(gpointer *) &view->viewable);
}
}
}
/* public functions */
......
......@@ -2,7 +2,7 @@
* Copyright (C) 1995 Spencer Kimball and Peter Mattis
*
* gimpview.h
* Copyright (C) 2001 Michael Natterer <mitch@gimp.org>
* Copyright (C) 2001-2005 Michael Natterer <mitch@gimp.org>
*
* 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
......@@ -55,51 +55,51 @@ struct _GimpView
struct _GimpViewClass
{
GtkWidgetClass parent_class;
GtkWidgetClass parent_class;
/* signals */
void (* set_viewable) (GimpView *view,
GimpViewable *old_viewable,
GimpViewable *new_viewable);
void (* clicked) (GimpView *view,
GdkModifierType modifier_state);
void (* double_clicked) (GimpView *view);
void (* context) (GimpView *view);
void (* set_viewable) (GimpView *view,
GimpViewable *old_viewable,
GimpViewable *new_viewable);
void (* clicked) (GimpView *view,
GdkModifierType modifier_state);
void (* double_clicked) (GimpView *view);
void (* context) (GimpView *view);
};
GType gimp_view_get_type (void) G_GNUC_CONST;
GtkWidget * gimp_view_new (GimpViewable *viewable,
gint size,
gint border_width,
gboolean is_popup);
GtkWidget * gimp_view_new_full (GimpViewable *viewable,
gint width,
gint height,
gint border_width,
gboolean is_popup,
gboolean clickable,
gboolean show_popup);
GtkWidget * gimp_view_new_by_types (GType view_type,
GType viewable_type,
gint size,
gint border_width,
gboolean is_popup);
GtkWidget * gimp_view_new_full_by_types (GType view_type,
GType viewable_type,
gint width,
gint height,
gint border_width,
gboolean is_popup,
gboolean clickable,
gboolean show_popup);
GimpViewable * gimp_view_get_viewable (GimpView *view);
void gimp_view_set_viewable (GimpView *view,
GimpViewable *viewable);
void gimp_view_set_expand (GimpView *view,
gboolean expand);
GType gimp_view_get_type (void) G_GNUC_CONST;
GtkWidget * gimp_view_new (GimpViewable *viewable,
gint size,
gint border_width,
gboolean is_popup);
GtkWidget * gimp_view_new_full (GimpViewable *viewable,
gint width,
gint height,
gint border_width,
gboolean is_popup,
gboolean clickable,
gboolean show_popup);
GtkWidget * gimp_view_new_by_types (GType view_type,
GType viewable_type,
gint size,
gint border_width,
gboolean is_popup);
GtkWidget * gimp_view_new_full_by_types (GType view_type,
GType viewable_type,
gint width,
gint height,
gint border_width,
gboolean is_popup,
gboolean clickable,
gboolean show_popup);
GimpViewable * gimp_view_get_viewable (GimpView *view);
void gimp_view_set_viewable (GimpView *view,
GimpViewable *viewable);
void gimp_view_set_expand (GimpView *view,
gboolean expand);
#endif /* __GIMP_VIEW_H__ */
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment