1999-06-21 Michael Natterer <mitschel@cs.tu-berlin.de> * app/context_manager.c: connect to the user context's "display_changed" and to the image context's "remove" signal to avoid dangling references and to set the menu sensitivity on display change. * app/disp_callbacks.c * app/file_new_dialog.c * app/fileops.c * app/gdisplay.c * app/gdisplay_ops.c * app/gimpcontext.c * app/interface.[ch]: entirely moved the active display stuff to the user context: - The active display is set by any event in the display shell, by File/New and File/Open. - gdisplay_delete() resets the active display to NULL if we deleted the active display. - Reduced gdisplay_active() to a single statement returning the context's active display. Should replace it by a macro. - gdisplay_flush_whenever() sets the menu sensitivity for the active display. - Removed global variable popup_shell since it was only set all the time but never used. I guess it's original job is now done by the context anyway. - gdisplay_set_menu_sensitivity() works with gdisp == NULL. - There are mysterious Gdk-CRITICALs if both <Image> and one of it's sub-menus are teared-off. Probably a gtk+ bug. To do all this stuff at a central place, there needs to be a GimpSet of displays (and ideally, GDisplay should be a GtkObject). * app/commands.c * app/lc_dialog.c: fixed segfaults happening with teared-off menus.
106 lines
3.4 KiB
C
106 lines
3.4 KiB
C
/* 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.
|
|
*/
|
|
#ifndef __INTERFACE_H__
|
|
#define __INTERFACE_H__
|
|
|
|
#include "toolsF.h"
|
|
#include "gdisplayF.h"
|
|
#include "libgimp/gimpunit.h"
|
|
|
|
/* typedefs */
|
|
typedef void (*QueryFunc) (GtkWidget *, gpointer, gpointer);
|
|
|
|
/* externed variables */
|
|
extern GtkWidget * tool_widgets[];
|
|
extern GtkTooltips * tool_tips;
|
|
|
|
/* function declarations */
|
|
GtkWidget * create_pixmap_widget (GdkWindow *parent,
|
|
char **data,
|
|
int width,
|
|
int height);
|
|
|
|
GdkPixmap * create_tool_pixmap (GtkWidget *parent,
|
|
ToolType type);
|
|
|
|
void create_toolbox (void);
|
|
void toolbox_free (void);
|
|
|
|
void toolbox_raise_callback (GtkWidget *widget,
|
|
gpointer client_data);
|
|
|
|
void create_display_shell (GDisplay *gdisp,
|
|
int width,
|
|
int height,
|
|
char *title,
|
|
int type);
|
|
|
|
/* some simple query dialogs
|
|
* if object != NULL then the query boxes will connect their cancel callback
|
|
* to the provided signal of this object
|
|
*/
|
|
GtkWidget * query_string_box (gchar *title,
|
|
gchar *message,
|
|
gchar *initial,
|
|
GtkObject *object,
|
|
gchar *signal,
|
|
QueryFunc callback,
|
|
gpointer data);
|
|
GtkWidget * query_int_box (gchar *title,
|
|
char *message,
|
|
gint initial,
|
|
gint lower,
|
|
gint upper,
|
|
GtkObject *object,
|
|
gchar *signal,
|
|
QueryFunc callback,
|
|
gpointer data);
|
|
GtkWidget * query_double_box (gchar *title,
|
|
gchar *message,
|
|
gdouble initial,
|
|
gdouble lower,
|
|
gdouble upper,
|
|
gint digits,
|
|
GtkObject *object,
|
|
gchar *signal,
|
|
QueryFunc callback,
|
|
gpointer data);
|
|
GtkWidget * query_size_box (gchar *title,
|
|
gchar *message,
|
|
gdouble initial,
|
|
gdouble lower,
|
|
gdouble upper,
|
|
gint digits,
|
|
GUnit unit,
|
|
gdouble resolution,
|
|
gint dot_for_dot,
|
|
GtkObject *object,
|
|
gchar *signal,
|
|
QueryFunc callback,
|
|
gpointer data);
|
|
|
|
/* a simple message box */
|
|
GtkWidget * message_box (char *message,
|
|
GtkCallback callback,
|
|
gpointer data);
|
|
|
|
void tools_push_label (char *label);
|
|
void tools_pop_label (void);
|
|
|
|
#endif /* __INTERFACE_H__ */
|