mirror of https://github.com/GNOME/gimp.git
app: Change a few GIMP_IS_DOCK to GIMP_IS_DOCK_WINDOW
In many places we are interested in wether or not we have a dock window, not a dock. This is in preparation for making GimpDock a non-GimpDockWindow.
This commit is contained in:
parent
62dde84e43
commit
c9d8aafb68
|
@ -99,24 +99,26 @@ dock_actions_update (GimpActionGroup *group,
|
|||
#define SET_VISIBLE(action,active) \
|
||||
gimp_action_group_set_action_visible (group, action, (active) != 0)
|
||||
|
||||
if (GIMP_IS_MENU_DOCK (toplevel))
|
||||
if (GIMP_IS_DOCK_WINDOW (toplevel))
|
||||
{
|
||||
GimpMenuDock *menu_dock = GIMP_MENU_DOCK (toplevel);
|
||||
GimpDock *dock = gimp_dock_window_get_dock (GIMP_DOCK_WINDOW (toplevel));
|
||||
|
||||
if (GIMP_IS_MENU_DOCK (dock))
|
||||
{
|
||||
GimpMenuDock *menu_dock = GIMP_MENU_DOCK (toplevel);
|
||||
|
||||
SET_VISIBLE ("dock-show-image-menu", TRUE);
|
||||
SET_VISIBLE ("dock-auto-follow-active", TRUE);
|
||||
SET_VISIBLE ("dock-show-image-menu", TRUE);
|
||||
SET_VISIBLE ("dock-auto-follow-active", TRUE);
|
||||
|
||||
SET_ACTIVE ("dock-show-image-menu", menu_dock->show_image_menu);
|
||||
SET_ACTIVE ("dock-auto-follow-active", menu_dock->auto_follow_active);
|
||||
}
|
||||
else
|
||||
{
|
||||
SET_VISIBLE ("dock-show-image-menu", FALSE);
|
||||
SET_VISIBLE ("dock-auto-follow-active", FALSE);
|
||||
}
|
||||
SET_ACTIVE ("dock-show-image-menu", menu_dock->show_image_menu);
|
||||
SET_ACTIVE ("dock-auto-follow-active", menu_dock->auto_follow_active);
|
||||
}
|
||||
else
|
||||
{
|
||||
SET_VISIBLE ("dock-show-image-menu", FALSE);
|
||||
SET_VISIBLE ("dock-auto-follow-active", FALSE);
|
||||
}
|
||||
|
||||
if (GIMP_IS_DOCK (toplevel))
|
||||
{
|
||||
/* update the window actions only in the context of their
|
||||
* own window (not in the context of some display or NULL)
|
||||
* (see view-actions.c)
|
||||
|
|
|
@ -418,7 +418,7 @@ gimp_dialog_factory_dialog_sane (GimpDialogFactory *factory,
|
|||
GtkWidget *widget)
|
||||
{
|
||||
/* Note that GimpDocks don't have any entry */
|
||||
if (! widget_factory || (! widget_entry && ! GIMP_IS_DOCK (widget)))
|
||||
if (! widget_factory || (! widget_entry && ! GIMP_IS_DOCK_WINDOW (widget)))
|
||||
{
|
||||
g_warning ("%s: dialog was not created by a GimpDialogFactory",
|
||||
G_STRFUNC);
|
||||
|
@ -1058,7 +1058,7 @@ gimp_dialog_factory_remove_dialog (GimpDialogFactory *factory,
|
|||
gimp_dialog_factory_dialog_configure,
|
||||
factory);
|
||||
|
||||
if (GIMP_IS_DOCK (dialog))
|
||||
if (GIMP_IS_DOCK_WINDOW (dialog))
|
||||
{
|
||||
/* don't save session info for empty docks */
|
||||
factory->session_infos = g_list_remove (factory->session_infos,
|
||||
|
|
|
@ -30,6 +30,7 @@
|
|||
|
||||
#include "gimpdock.h"
|
||||
#include "gimpdockable.h"
|
||||
#include "gimpdockwindow.h"
|
||||
#include "gimpsessioninfo-aux.h"
|
||||
|
||||
|
||||
|
@ -287,8 +288,8 @@ gimp_session_info_aux_set_list (GtkWidget *dialog,
|
|||
{
|
||||
/* FIXME: make the aux-info stuff generic */
|
||||
|
||||
if (GIMP_IS_DOCK (dialog))
|
||||
gimp_dock_set_aux_info (GIMP_DOCK (dialog), aux_list);
|
||||
if (GIMP_IS_DOCK_WINDOW (dialog))
|
||||
gimp_dock_set_aux_info (gimp_dock_window_get_dock (GIMP_DOCK_WINDOW (dialog)), aux_list);
|
||||
else if (GIMP_IS_DOCKABLE (dialog))
|
||||
gimp_dockable_set_aux_info (GIMP_DOCKABLE (dialog), aux_list);
|
||||
}
|
||||
|
@ -298,8 +299,8 @@ gimp_session_info_aux_get_list (GtkWidget *dialog)
|
|||
{
|
||||
/* FIXME: make the aux-info stuff generic */
|
||||
|
||||
if (GIMP_IS_DOCK (dialog))
|
||||
return gimp_dock_get_aux_info (GIMP_DOCK (dialog));
|
||||
if (GIMP_IS_DOCK_WINDOW (dialog))
|
||||
return gimp_dock_get_aux_info (gimp_dock_window_get_dock (GIMP_DOCK_WINDOW (dialog)));
|
||||
else if (GIMP_IS_DOCKABLE (dialog))
|
||||
return gimp_dockable_get_aux_info (GIMP_DOCKABLE (dialog));
|
||||
|
||||
|
|
|
@ -30,6 +30,7 @@
|
|||
|
||||
#include "gimpdialogfactory.h"
|
||||
#include "gimpdock.h"
|
||||
#include "gimpdockwindow.h"
|
||||
#include "gimpsessioninfo.h"
|
||||
#include "gimpsessioninfo-aux.h"
|
||||
#include "gimpsessioninfo-book.h"
|
||||
|
@ -51,21 +52,18 @@ enum
|
|||
#define DEFAULT_SCREEN -1
|
||||
|
||||
|
||||
static void gimp_session_info_config_iface_init (GimpConfigInterface *iface);
|
||||
|
||||
static void gimp_session_info_finalize (GObject *object);
|
||||
|
||||
static gint64 gimp_session_info_get_memsize (GimpObject *object,
|
||||
gint64 *gui_size);
|
||||
|
||||
static gboolean gimp_session_info_serialize (GimpConfig *config,
|
||||
GimpConfigWriter *writer,
|
||||
gpointer data);
|
||||
static gboolean gimp_session_info_deserialize (GimpConfig *config,
|
||||
GScanner *scanner,
|
||||
gint nest_level,
|
||||
gpointer data);
|
||||
static gboolean gimp_session_info_is_for_dock (GimpSessionInfo *info);
|
||||
static void gimp_session_info_config_iface_init (GimpConfigInterface *iface);
|
||||
static void gimp_session_info_finalize (GObject *object);
|
||||
static gint64 gimp_session_info_get_memsize (GimpObject *object,
|
||||
gint64 *gui_size);
|
||||
static gboolean gimp_session_info_serialize (GimpConfig *config,
|
||||
GimpConfigWriter *writer,
|
||||
gpointer data);
|
||||
static gboolean gimp_session_info_deserialize (GimpConfig *config,
|
||||
GScanner *scanner,
|
||||
gint nest_level,
|
||||
gpointer data);
|
||||
static gboolean gimp_session_info_is_for_dock_window (GimpSessionInfo *info);
|
||||
|
||||
|
||||
G_DEFINE_TYPE_WITH_CODE (GimpSessionInfo, gimp_session_info, GIMP_TYPE_OBJECT,
|
||||
|
@ -319,7 +317,7 @@ gimp_session_info_deserialize (GimpConfig *config,
|
|||
}
|
||||
|
||||
/**
|
||||
* gimp_session_info_is_for_dock:
|
||||
* gimp_session_info_is_for_dock_window:
|
||||
* @info:
|
||||
*
|
||||
* Helper function to determine if the session info is for a dock. It
|
||||
|
@ -329,11 +327,11 @@ gimp_session_info_deserialize (GimpConfig *config,
|
|||
* Returns: %TRUE if session info is for a dock, %FALSE otherwise.
|
||||
**/
|
||||
static gboolean
|
||||
gimp_session_info_is_for_dock (GimpSessionInfo *info)
|
||||
gimp_session_info_is_for_dock_window (GimpSessionInfo *info)
|
||||
{
|
||||
gboolean entry_state_for_dock = info->p->factory_entry == NULL;
|
||||
gboolean widget_state_for_dock = (info->p->widget == NULL ||
|
||||
GIMP_IS_DOCK (info->p->widget));
|
||||
GIMP_IS_DOCK_WINDOW (info->p->widget));
|
||||
|
||||
return entry_state_for_dock && widget_state_for_dock;
|
||||
}
|
||||
|
@ -604,7 +602,13 @@ gimp_session_info_get_info (GimpSessionInfo *info)
|
|||
if (info->p->factory_entry == NULL ||
|
||||
(info->p->factory_entry &&
|
||||
info->p->factory_entry->dockable))
|
||||
info->p->books = gimp_session_info_dock_from_widget (GIMP_DOCK (info->p->widget));
|
||||
{
|
||||
GimpDock *dock = NULL;
|
||||
|
||||
dock = gimp_dock_window_get_dock (GIMP_DOCK_WINDOW (info->p->widget));
|
||||
|
||||
info->p->books = gimp_session_info_dock_from_widget (dock);
|
||||
}
|
||||
}
|
||||
|
||||
void
|
||||
|
@ -634,7 +638,7 @@ gimp_session_info_is_singleton (GimpSessionInfo *info)
|
|||
{
|
||||
g_return_val_if_fail (GIMP_IS_SESSION_INFO (info), FALSE);
|
||||
|
||||
return (! gimp_session_info_is_for_dock (info) &&
|
||||
return (! gimp_session_info_is_for_dock_window (info) &&
|
||||
info->p->factory_entry &&
|
||||
info->p->factory_entry->singleton);
|
||||
}
|
||||
|
@ -644,7 +648,7 @@ gimp_session_info_is_session_managed (GimpSessionInfo *info)
|
|||
{
|
||||
g_return_val_if_fail (GIMP_IS_SESSION_INFO (info), FALSE);
|
||||
|
||||
return (gimp_session_info_is_for_dock (info) ||
|
||||
return (gimp_session_info_is_for_dock_window (info) ||
|
||||
(info->p->factory_entry &&
|
||||
info->p->factory_entry->session_managed));
|
||||
}
|
||||
|
@ -655,7 +659,7 @@ gimp_session_info_get_remember_size (GimpSessionInfo *info)
|
|||
{
|
||||
g_return_val_if_fail (GIMP_IS_SESSION_INFO (info), FALSE);
|
||||
|
||||
return (gimp_session_info_is_for_dock (info) ||
|
||||
return (gimp_session_info_is_for_dock_window (info) ||
|
||||
(info->p->factory_entry &&
|
||||
info->p->factory_entry->remember_size));
|
||||
}
|
||||
|
@ -665,7 +669,7 @@ gimp_session_info_get_remember_if_open (GimpSessionInfo *info)
|
|||
{
|
||||
g_return_val_if_fail (GIMP_IS_SESSION_INFO (info), FALSE);
|
||||
|
||||
return (gimp_session_info_is_for_dock (info) ||
|
||||
return (gimp_session_info_is_for_dock_window (info) ||
|
||||
(info->p->factory_entry &&
|
||||
info->p->factory_entry->remember_if_open));
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue