Commit c86ca2da authored by Michael Natterer's avatar Michael Natterer 😴 Committed by Michael Natterer

app/Makefile.am removed...

2002-05-05  Michael Natterer  <mitch@gimp.org>

	* app/Makefile.am
	* app/gimphelp.[ch]: removed...

	* app/widgets/Makefile.am
	* app/widgets/gimphelp.[ch]: ...and added here.

	* app/widgets/widgets-enums.[ch]: added GimpHelpBrowserType here
	as registered enum. Added an evil hack with GimpCursorType so
	app/config/gimpguiconfig.h can include this file.

	* app/widgets/gimpcursor.c: added an assertion because of the
	changed GimpCursorType.

	* app/config/gimpguiconfig.[ch]: added a property for the help
	browser type.

	* app/gimprc.c
	* app/libgimp_glue.c
	* app/gui/preferences-dialog.c
	* tools/pdbgen/pdb/help.pdb

	* app/pdb/help_cmds.c: regenerated.

	Some nav_window cleanup before chopping:

	* app/nav_window.[ch]: removed the old preview code and use
	GimpNavigationPreviews only. Namespaceified all functions. Speak
	in terms of GimpDisplayShell, not GimpDisplay. Lots of internal
	cleanup.

	* app/gui/gui-types.h: removed NadiagtionDialog here...

	* app/display/display-types.h: ...and added it here.

	* app/display/gimpdisplayshell-callbacks.[ch]: added a callback
	for the navigation button and call nav_window_show_popup() from there.

	* app/display/gimpdisplayshell.c: free shell->nav_dialog
	unconditionally, connect to the new callback.

	* app/display/gimpdisplayshell-scale.c
	* app/display/gimpdisplayshell-scroll.c
	* app/gui/view-commands.c: changed accordingly.

	* app/widgets/gimppreview.c (gimp_preview_set_viewable): the
	assertion introduced recently was too tight, breaking
	GimpNavigationPreview. Changed it to do an "is a" check, not exact
	preview type matching.

	* app/widgets/gimpimagepreview.c: added quick-hack support for
	xres != yres.

	* app/widgets/gimpnavigationpreview.[ch]: made
	gimp_navigation_preview_grab_pointer() public so the nav_window
	can call it.

	Unrelated:

	* app/display/gimpdisplay.c: removed the gui/ dependency from this
	file by removing info_window stuff.

	* app/display/gimpdisplayshell.c (gimp_display_shell_flush): update
	the info_window here.

	* app/gui/dialogs-constructors.c (dialogs_indexed_palette_new): call
	gimp_dockable_set_context() like all other constructors.

	* app/undo.c
	* app/paint/gimppaintcore.h: some more include cleanup.
parent 3c11b8e8
2002-05-05 Michael Natterer <mitch@gimp.org>
* app/Makefile.am
* app/gimphelp.[ch]: removed...
* app/widgets/Makefile.am
* app/widgets/gimphelp.[ch]: ...and added here.
* app/widgets/widgets-enums.[ch]: added GimpHelpBrowserType here
as registered enum. Added an evil hack with GimpCursorType so
app/config/gimpguiconfig.h can include this file.
* app/widgets/gimpcursor.c: added an assertion because of the
changed GimpCursorType.
* app/config/gimpguiconfig.[ch]: added a property for the help
browser type.
* app/gimprc.c
* app/libgimp_glue.c
* app/gui/preferences-dialog.c
* tools/pdbgen/pdb/help.pdb
* app/pdb/help_cmds.c: regenerated.
Some nav_window cleanup before chopping:
* app/nav_window.[ch]: removed the old preview code and use
GimpNavigationPreviews only. Namespaceified all functions. Speak
in terms of GimpDisplayShell, not GimpDisplay. Lots of internal
cleanup.
* app/gui/gui-types.h: removed NadiagtionDialog here...
* app/display/display-types.h: ...and added it here.
* app/display/gimpdisplayshell-callbacks.[ch]: added a callback
for the navigation button and call nav_window_show_popup() from there.
* app/display/gimpdisplayshell.c: free shell->nav_dialog
unconditionally, connect to the new callback.
* app/display/gimpdisplayshell-scale.c
* app/display/gimpdisplayshell-scroll.c
* app/gui/view-commands.c: changed accordingly.
* app/widgets/gimppreview.c (gimp_preview_set_viewable): the
assertion introduced recently was too tight, breaking
GimpNavigationPreview. Changed it to do an "is a" check, not exact
preview type matching.
* app/widgets/gimpimagepreview.c: added quick-hack support for
xres != yres.
* app/widgets/gimpnavigationpreview.[ch]: made
gimp_navigation_preview_grab_pointer() public so the nav_window
can call it.
Unrelated:
* app/display/gimpdisplay.c: removed the gui/ dependency from this
file by removing info_window stuff.
* app/display/gimpdisplayshell.c (gimp_display_shell_flush): update
the info_window here.
* app/gui/dialogs-constructors.c (dialogs_indexed_palette_new): call
gimp_dockable_set_context() like all other constructors.
* app/undo.c
* app/paint/gimppaintcore.h: some more include cleanup.
2002-05-05 Sven Neumann <sven@gimp.org>
* NEWS: updated.
......
......@@ -70,8 +70,6 @@ stuff_sources = \
batch.h \
errors.c \
errors.h \
gimphelp.c \
gimphelp.h \
libgimp_glue.c \
libgimp_glue.h
......
......@@ -139,13 +139,13 @@ view_navigation_window_cmd_callback (GtkWidget *widget,
if (gimprc.nav_window_per_display)
{
if (! shell->nav_dialog)
shell->nav_dialog = nav_dialog_create (gdisp);
shell->nav_dialog = nav_dialog_create (shell);
nav_dialog_popup (shell->nav_dialog);
nav_dialog_show (shell->nav_dialog);
}
else
{
nav_dialog_follow_auto ();
nav_dialog_show_auto (gdisp->gimage->gimp);
}
}
......
......@@ -64,7 +64,8 @@ enum
PROP_MAX_NEW_IMAGE_SIZE,
PROP_THEME_PATH,
PROP_THEME,
PROP_USE_HELP
PROP_USE_HELP,
PROP_HELP_BROWSER
};
static GObjectClass *parent_class = NULL;
......@@ -168,6 +169,10 @@ gimp_gui_config_class_init (GimpGuiConfigClass *klass)
GIMP_CONFIG_INSTALL_PROP_BOOLEAN (object_class, PROP_USE_HELP,
"use-help",
TRUE);
GIMP_CONFIG_INSTALL_PROP_ENUM (object_class, PROP_HELP_BROWSER,
"help-browser",
GIMP_TYPE_HELP_BROWSER_TYPE,
GIMP_HELP_BROWSER_GIMP);
}
static void
......@@ -254,6 +259,9 @@ gimp_gui_config_set_property (GObject *object,
case PROP_USE_HELP:
gui_config->use_help = g_value_get_boolean (value);
break;
case PROP_HELP_BROWSER:
gui_config->help_browser = g_value_get_enum (value);
break;
default:
G_OBJECT_WARN_INVALID_PROPERTY_ID (object, property_id, pspec);
......@@ -330,6 +338,9 @@ gimp_gui_config_get_property (GObject *object,
case PROP_USE_HELP:
g_value_set_boolean (value, gui_config->use_help);
break;
case PROP_HELP_BROWSER:
g_value_set_enum (value, gui_config->help_browser);
break;
default:
G_OBJECT_WARN_INVALID_PROPERTY_ID (object, property_id, pspec);
......
......@@ -22,6 +22,8 @@
#ifndef __GIMP_GUI_CONFIG_H__
#define __GIMP_GUI_CONFIG_H__
#include "widgets/widgets-enums.h"
#include "config/gimpdisplayconfig.h"
......@@ -58,7 +60,7 @@ struct _GimpGuiConfig
gchar *theme_path;
gchar *theme;
gboolean use_help;
gint help_browser; /* FIXME: not yet a property */
GimpHelpBrowserType help_browser;
};
struct _GimpGuiConfigClass
......
......@@ -25,8 +25,7 @@
#include "libgimpbase/gimpbase.h"
#include "core/core-types.h"
#include "libgimptool/gimptooltypes.h"
#include "tools/tools-types.h"
#include "base/pixel-region.h"
#include "base/tile-manager.h"
......@@ -52,8 +51,6 @@
#include "paint/gimppaintcore.h"
#include "tools/gimpbycolorselecttool.h"
/*#include "tools/gimptool.h"*/
#include "tools/gimpdrawtool.h"
#include "tools/gimppainttool.h"
#include "tools/gimptransformtool.h"
#include "tools/tool_manager.h"
......
......@@ -24,9 +24,6 @@
#include "display-types.h"
#include "tools/tools-types.h"
#warning FIXME #include "gui/gui-types.h"
#include "gui/gui-types.h"
#include "core/gimp.h"
#include "core/gimpcontext.h"
#include "core/gimpdrawable.h"
......@@ -37,8 +34,6 @@
#include "tools/tool_manager.h"
#include "gui/info-window.h"
#include "gimpdisplay.h"
#include "gimpdisplay-area.h"
#include "gimpdisplay-handlers.h"
......@@ -566,9 +561,6 @@ gimp_display_flush_whenever (GimpDisplay *gdisp,
/* Next the displays... */
gimp_display_shell_flush (GIMP_DISPLAY_SHELL (gdisp->shell));
/* update the gdisplay's info dialog */
info_window_update (gdisp);
/* ensure the consistency of the tear-off menus */
if (! now && gimp_context_get_display (gimp_get_user_context
(gdisp->gimage->gimp)) == gdisp)
......
......@@ -784,7 +784,7 @@ dialogs_indexed_palette_new (GimpDialogFactory *factory,
NULL,
dialogs_set_indexed_palette_context_func);
dialogs_set_indexed_palette_context_func (GIMP_DOCKABLE (dockable), context);
gimp_dockable_set_context (GIMP_DOCKABLE (dockable), context);
g_signal_connect (G_OBJECT (view), "selected",
G_CALLBACK (dialogs_indexed_palette_selected),
......
......@@ -56,7 +56,6 @@
#include "resolution-calibrate-dialog.h"
#include "session.h"
#include "gimphelp.h"
#include "gimprc.h"
#include "libgimp/gimpintl.h"
......@@ -127,8 +126,8 @@ static gint old_marching_speed;
static gboolean old_resize_windows_on_zoom;
static gboolean old_resize_windows_on_resize;
static gboolean old_auto_save;
static gint old_preview_size;
static gint old_nav_preview_size;
static GimpPreviewSize old_preview_size;
static GimpPreviewSize old_nav_preview_size;
static gboolean old_no_cursor_updating;
static gboolean old_show_tool_tips;
static gboolean old_show_rulers;
......@@ -942,6 +941,7 @@ prefs_cancel_callback (GtkWidget *widget,
/* restore variables which need some magic */
if (gimprc.preview_size != old_preview_size)
{
gimprc.preview_size = old_preview_size;
#ifdef __GNUC__
#warning FIXME: update preview size
#endif
......@@ -1089,12 +1089,13 @@ static void
prefs_preview_size_callback (GtkWidget *widget,
gpointer data)
{
gimp_menu_item_update (widget, data);
#ifdef __GNUC__
#warning FIXME: update preview size
#endif
#if 0
lc_dialog_rebuild ((long) g_object_get_data (G_OBJECT (widget),
"gimp-item-data"));
lc_dialog_rebuild (gimprc.preview_size);
#endif
}
......@@ -1102,8 +1103,7 @@ static void
prefs_nav_preview_size_callback (GtkWidget *widget,
gpointer data)
{
gimprc.nav_preview_size =
GPOINTER_TO_INT (g_object_get_data (G_OBJECT (widget), "gimp-item-data"));
gimp_menu_item_update (widget, data);
gdisplays_nav_preview_resized ();
}
......@@ -2074,9 +2074,14 @@ preferences_dialog_create (Gimp *gimp)
&gimprc.nav_preview_size,
GINT_TO_POINTER (gimprc.nav_preview_size),
_("Small"), GINT_TO_POINTER (48), NULL,
_("Medium"), GINT_TO_POINTER (80), NULL,
_("Large"), GINT_TO_POINTER (112), NULL,
_("Small"),
GINT_TO_POINTER (GIMP_PREVIEW_SIZE_MEDIUM), NULL,
_("Medium"),
GINT_TO_POINTER (GIMP_PREVIEW_SIZE_EXTRA_LARGE), NULL,
_("Large"),
GINT_TO_POINTER (GIMP_PREVIEW_SIZE_HUGE), NULL,
NULL);
......@@ -2156,17 +2161,11 @@ preferences_dialog_create (Gimp *gimp)
table = prefs_table_new (1, GTK_CONTAINER (vbox2), FALSE);
optionmenu = gimp_option_menu_new2
(FALSE,
G_CALLBACK (prefs_toggle_callback),
&gimprc.help_browser,
GINT_TO_POINTER (gimprc.help_browser),
_("Internal"), GINT_TO_POINTER (HELP_BROWSER_GIMP), NULL,
_("Netscape"), GINT_TO_POINTER (HELP_BROWSER_NETSCAPE), NULL,
NULL);
optionmenu = gimp_enum_option_menu_new (GIMP_TYPE_HELP_BROWSER_TYPE,
G_CALLBACK (prefs_toggle_callback),
&gimprc.help_browser);
gimp_option_menu_set_history (GTK_OPTION_MENU (optionmenu),
GINT_TO_POINTER (gimprc.help_browser));
gimp_table_attach_aligned (GTK_TABLE (table), 0, 0,
_("Help Browser to Use:"), 1.0, 0.5,
optionmenu, 1, TRUE);
......
......@@ -31,6 +31,7 @@ typedef struct _GimpDisplayShell GimpDisplayShell;
typedef struct _GimpStatusbar GimpStatusbar; /*< proxy-skip >*/
typedef struct _NavigationDialog NavigationDialog;
typedef struct _Selection Selection;
......
......@@ -24,9 +24,6 @@
#include "display-types.h"
#include "tools/tools-types.h"
#warning FIXME #include "gui/gui-types.h"
#include "gui/gui-types.h"
#include "core/gimp.h"
#include "core/gimpcontext.h"
#include "core/gimpdrawable.h"
......@@ -37,8 +34,6 @@
#include "tools/tool_manager.h"
#include "gui/info-window.h"
#include "gimpdisplay.h"
#include "gimpdisplay-area.h"
#include "gimpdisplay-handlers.h"
......@@ -566,9 +561,6 @@ gimp_display_flush_whenever (GimpDisplay *gdisp,
/* Next the displays... */
gimp_display_shell_flush (GIMP_DISPLAY_SHELL (gdisp->shell));
/* update the gdisplay's info dialog */
info_window_update (gdisp);
/* ensure the consistency of the tear-off menus */
if (! now && gimp_context_get_display (gimp_get_user_context
(gdisp->gimage->gimp)) == gdisp)
......
......@@ -60,6 +60,7 @@
#include "gimpstatusbar.h"
#include "gimprc.h"
#include "nav_window.h"
#include "libgimp/gimpintl.h"
......@@ -1206,14 +1207,10 @@ gimp_display_shell_color_button_default (gpointer callback_data,
gboolean
gimp_display_shell_qmask_button_press (GtkWidget *widget,
GdkEventButton *event,
GdkEventButton *bevent,
GimpDisplayShell *shell)
{
GimpDisplay *gdisp;
gdisp = shell->gdisp;
if ((event->type == GDK_BUTTON_PRESS) && (event->button == 3))
if ((bevent->type == GDK_BUTTON_PRESS) && (bevent->button == 3))
{
GimpItemFactory *factory;
......@@ -1237,6 +1234,19 @@ gimp_display_shell_qmask_toggled (GtkWidget *widget,
gdisplays_flush ();
}
gboolean
gimp_display_shell_nav_button_press (GtkWidget *widget,
GdkEventButton *bevent,
GimpDisplayShell *shell)
{
if ((bevent->type == GDK_BUTTON_PRESS) && (bevent->button == 1))
{
nav_dialog_create_popup (shell, widget, bevent->x, bevent->y);
}
return TRUE;
}
/* private functions */
......
......@@ -75,10 +75,14 @@ void gimp_display_shell_color_button_default (gpointer data,
GtkWidget *widget);
gboolean gimp_display_shell_qmask_button_press (GtkWidget *widget,
GdkEventButton *event,
GdkEventButton *bevent,
GimpDisplayShell *shell);
void gimp_display_shell_qmask_toggled (GtkWidget *widget,
GimpDisplayShell *shell);
gboolean gimp_display_shell_nav_button_press (GtkWidget *widget,
GdkEventButton *bevent,
GimpDisplayShell *shell);
#endif /* __GIMP_DISPLAY_SHELL_CALLBACKS_H__ */
......@@ -336,15 +336,15 @@ gimp_display_shell_destroy (GtkObject *object)
shell->info_dialog = NULL;
}
if (shell->nav_dialog)
{
nav_dialog_free (shell->gdisp, shell->nav_dialog);
shell->nav_dialog = NULL;
}
/* free the nav_dialog unconditionally because nav_dialog_free(shell,NULL)
* acts as notification for the global nav dialog
*/
nav_dialog_free (shell, shell->nav_dialog);
shell->nav_dialog = NULL;
if (shell->nav_popup)
{
nav_dialog_free (shell->gdisp, shell->nav_popup);
nav_dialog_free (shell, shell->nav_popup);
shell->nav_popup = NULL;
}
......@@ -667,8 +667,8 @@ gimp_display_shell_new (GimpDisplay *gdisp)
gtk_widget_show (image);
g_signal_connect (G_OBJECT (nav_ebox), "button_press_event",
G_CALLBACK (nav_popup_click_handler),
gdisp);
G_CALLBACK (gimp_display_shell_nav_button_press),
shell);
gimp_help_set_help_data (nav_ebox, NULL, "#nav_window_button");
......@@ -1337,6 +1337,9 @@ gimp_display_shell_flush (GimpDisplayShell *shell)
shell->title_dirty = FALSE;
}
/* update the gdisplay's info dialog */
info_window_update (shell->gdisp);
if (shell->display_areas)
{
GSList *list;
......
......@@ -150,10 +150,10 @@ gimp_display_shell_scale_setup (GimpDisplayShell *shell)
gtk_widget_queue_draw (GTK_WIDGET (hruler));
gtk_widget_queue_draw (GTK_WIDGET (vruler));
nav_dialog_update_window_marker (shell->nav_dialog);
nav_dialog_update (shell->nav_dialog);
if (shell->nav_popup)
nav_dialog_update_window_marker (shell->nav_popup);
nav_dialog_update (shell->nav_popup);
#if 0
g_print ("offset_x: %d\n"
......
......@@ -127,10 +127,10 @@ gimp_display_shell_scroll (GimpDisplayShell *shell,
gimp_display_flush (shell->gdisp);
}
nav_dialog_update_window_marker (shell->nav_dialog);
nav_dialog_update (shell->nav_dialog);
if (shell->nav_popup)
nav_dialog_update_window_marker (shell->nav_popup);
nav_dialog_update (shell->nav_popup);
/* Make sure graphics expose events are processed before scrolling
* again
......
......@@ -336,15 +336,15 @@ gimp_display_shell_destroy (GtkObject *object)
shell->info_dialog = NULL;
}
if (shell->nav_dialog)
{
nav_dialog_free (shell->gdisp, shell->nav_dialog);
shell->nav_dialog = NULL;
}
/* free the nav_dialog unconditionally because nav_dialog_free(shell,NULL)
* acts as notification for the global nav dialog
*/
nav_dialog_free (shell, shell->nav_dialog);
shell->nav_dialog = NULL;
if (shell->nav_popup)
{
nav_dialog_free (shell->gdisp, shell->nav_popup);
nav_dialog_free (shell, shell->nav_popup);
shell->nav_popup = NULL;
}
......@@ -667,8 +667,8 @@ gimp_display_shell_new (GimpDisplay *gdisp)
gtk_widget_show (image);
g_signal_connect (G_OBJECT (nav_ebox), "button_press_event",
G_CALLBACK (nav_popup_click_handler),
gdisp);
G_CALLBACK (gimp_display_shell_nav_button_press),
shell);
gimp_help_set_help_data (nav_ebox, NULL, "#nav_window_button");
......@@ -1337,6 +1337,9 @@ gimp_display_shell_flush (GimpDisplayShell *shell)
shell->title_dirty = FALSE;
}
/* update the gdisplay's info dialog */
info_window_update (shell->gdisp);
if (shell->display_areas)
{
GSList *list;
......
This diff is collapsed.
This diff is collapsed.
/* The GIMP -- an image manipulation program
* Copyright (C) 1995 Spencer Kimball and Peter Mattis
*
* gimphelp.c
* Copyright (C) 1999-2000 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
* 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"
#ifdef HAVE_UNISTD_H
#include <unistd.h>
#endif
#include <string.h>
#include "sys/types.h"
#include <gtk/gtk.h>
#include "libgimpbase/gimpbase.h"
#include "libgimpwidgets/gimpwidgets.h"
#include "core/core-types.h"
#include "core/gimp.h"
#include "pdb/procedural_db.h"
#include "plug-in/plug-ins.h"
#include "plug-in/plug-in.h"
#include "gimphelp.h"
#include "gimprc.h"
#include "libgimp/gimpintl.h"
#ifndef G_OS_WIN32
#define DEBUG_HELP
#endif
typedef struct _GimpIdleHelp GimpIdleHelp;
struct _GimpIdleHelp
{
Gimp *gimp;
gchar *help_path;
gchar *help_data;
};
/* local function prototypes */
static gint gimp_idle_help (gpointer data);
static gboolean gimp_help_internal (Gimp *gimp,
const gchar *help_path,
const gchar *current_locale,
const gchar *help_data);
static void gimp_help_netscape (Gimp *gimp,
const gchar *help_path,
const gchar *current_locale,
const gchar *help_data);
/* public functions */
void
gimp_help (Gimp *gimp,
const gchar *help_path,
const gchar *help_data)
{
g_return_if_fail (GIMP_IS_GIMP (gimp));
if (gimprc.use_help)
{
GimpIdleHelp *idle_help;
idle_help = g_new0 (GimpIdleHelp, 1);
idle_help->gimp = gimp;
if (help_path && strlen (help_path))
idle_help->help_path = g_strdup (help_path);
if (help_data && strlen (help_data))
idle_help->help_data = g_strdup (help_data);
g_idle_add (gimp_idle_help, idle_help);
}
}
/* private functions */
static gboolean
gimp_idle_help (gpointer data)
{
GimpIdleHelp *idle_help;
static gchar *current_locale = "C";
idle_help = (GimpIdleHelp *) data;
if (idle_help->help_data == NULL && gimprc.help_browser != HELP_BROWSER_GIMP)
idle_help->help_data = g_strdup ("introduction.html");
#ifdef DEBUG_HELP