Commit 74e70dc7 authored by John Sullivan's avatar John Sullivan

Put #defines for all metadata keys into new central location.

parent d1404606
2000-01-31 John Sullivan <sullivan@eazel.com>
Put all metadata keys in a central place so we can keep
track of them.
* libnautilus/nautilus-metadata.h: New file, contains
#defines for all the metadata keys currently in use.
* libnautilus/Makefile.am: add nautilus-metadata.h to list of headers.
* src/ntl-index-panel.c:
* src/file-manager/fm-directory-view-icons.c:
* src/file-manager/fm-directory-view-list.c:
Update all non-test callers of nautilus_directory_get_metadata and
nautilus_directory_set_metadata to use new #defines
2000-01-31 John Sullivan <sullivan@eazel.com>
Improved zooming API and made zoom items on item context
......
......@@ -41,6 +41,7 @@ libnautilusinclude_HEADERS= \
nautilus-icons-controller.h \
nautilus-icons-view-icon-item.h \
nautilus-lib-self-check-functions.h \
nautilus-metadata.h \
nautilus-self-checks.h \
nautilus-string.h \
ntl-content-view-frame.h \
......
/* -*- Mode: C; indent-tabs-mode: t; c-basic-offset: 8; tab-width: 8 -*-
nautilus-metadata.h: #defines and other metadata-related info
Copyright (C) 2000 Eazel, Inc.
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.
Author: John Sullivan <sullivan@eazel.com>
*/
#ifndef NAUTILUS_METADATA_H
#define NAUTILUS_METADATA_H
/* Keys for getting/setting Nautilus metadata. All metadata used in Nautilus
* should define its key here, so we can keep track of the whole set easily.
*/
#define ICON_VIEW_BACKGROUND_COLOR_METADATA_KEY "ICON_VIEW_BACKGROUND_COLOR"
#define ICON_VIEW_ICON_POSITION_METADATA_KEY "ICON_POSITION"
#define LIST_VIEW_BACKGROUND_COLOR_METADATA_KEY "LIST_VIEW_BACKGROUND_COLOR"
#define INDEX_PANEL_BACKGROUND_COLOR_METADATA_KEY "INDEX_PANEL_BACKGROUND_COLOR"
#endif /* NAUTILUS_METADATA_H */
......@@ -41,6 +41,7 @@ libnautilusinclude_HEADERS= \
nautilus-icons-controller.h \
nautilus-icons-view-icon-item.h \
nautilus-lib-self-check-functions.h \
nautilus-metadata.h \
nautilus-self-checks.h \
nautilus-string.h \
ntl-content-view-frame.h \
......
/* -*- Mode: C; indent-tabs-mode: t; c-basic-offset: 8; tab-width: 8 -*-
nautilus-metadata.h: #defines and other metadata-related info
Copyright (C) 2000 Eazel, Inc.
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.
Author: John Sullivan <sullivan@eazel.com>
*/
#ifndef NAUTILUS_METADATA_H
#define NAUTILUS_METADATA_H
/* Keys for getting/setting Nautilus metadata. All metadata used in Nautilus
* should define its key here, so we can keep track of the whole set easily.
*/
#define ICON_VIEW_BACKGROUND_COLOR_METADATA_KEY "ICON_VIEW_BACKGROUND_COLOR"
#define ICON_VIEW_ICON_POSITION_METADATA_KEY "ICON_POSITION"
#define LIST_VIEW_BACKGROUND_COLOR_METADATA_KEY "LIST_VIEW_BACKGROUND_COLOR"
#define INDEX_PANEL_BACKGROUND_COLOR_METADATA_KEY "INDEX_PANEL_BACKGROUND_COLOR"
#endif /* NAUTILUS_METADATA_H */
......@@ -41,6 +41,7 @@ libnautilusinclude_HEADERS= \
nautilus-icons-controller.h \
nautilus-icons-view-icon-item.h \
nautilus-lib-self-check-functions.h \
nautilus-metadata.h \
nautilus-self-checks.h \
nautilus-string.h \
ntl-content-view-frame.h \
......
/* -*- Mode: C; indent-tabs-mode: t; c-basic-offset: 8; tab-width: 8 -*-
nautilus-metadata.h: #defines and other metadata-related info
Copyright (C) 2000 Eazel, Inc.
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.
Author: John Sullivan <sullivan@eazel.com>
*/
#ifndef NAUTILUS_METADATA_H
#define NAUTILUS_METADATA_H
/* Keys for getting/setting Nautilus metadata. All metadata used in Nautilus
* should define its key here, so we can keep track of the whole set easily.
*/
#define ICON_VIEW_BACKGROUND_COLOR_METADATA_KEY "ICON_VIEW_BACKGROUND_COLOR"
#define ICON_VIEW_ICON_POSITION_METADATA_KEY "ICON_POSITION"
#define LIST_VIEW_BACKGROUND_COLOR_METADATA_KEY "LIST_VIEW_BACKGROUND_COLOR"
#define INDEX_PANEL_BACKGROUND_COLOR_METADATA_KEY "INDEX_PANEL_BACKGROUND_COLOR"
#endif /* NAUTILUS_METADATA_H */
......@@ -35,6 +35,7 @@
#include <gtk/gtkmenu.h>
#include <gtk/gtkmenuitem.h>
#include <gtk/gtksignal.h>
#include <libnautilus/nautilus-metadata.h>
#include <libnautilus/nautilus-gtk-macros.h>
#include <libnautilus/nautilus-string.h>
#include <libnautilus/nautilus-background.h>
......@@ -232,7 +233,9 @@ add_icon_if_already_positioned (FMDirectoryViewIcons *icon_view,
/* Get the current position of this icon from the metadata. */
directory = fm_directory_view_get_model (FM_DIRECTORY_VIEW (icon_view));
position_string = nautilus_file_get_metadata (file, "ICON_POSITION", "");
position_string = nautilus_file_get_metadata (file,
ICON_VIEW_ICON_POSITION_METADATA_KEY,
"");
position_good = sscanf (position_string, " %d , %d %*s", &x, &y) == 2;
g_free (position_string);
......@@ -282,7 +285,7 @@ fm_directory_view_icons_clear (FMDirectoryView *view)
/* Set up the background color from the metadata. */
background_color = nautilus_directory_get_metadata (fm_directory_view_get_model (view),
"ICON_VIEW_BACKGROUND_COLOR",
ICON_VIEW_BACKGROUND_COLOR_METADATA_KEY,
DEFAULT_BACKGROUND_COLOR);
nautilus_background_set_color (nautilus_get_widget_background (GTK_WIDGET (icon_container)),
background_color);
......@@ -452,7 +455,7 @@ fm_directory_view_icons_background_changed_cb (NautilusBackground *background,
color_spec = nautilus_background_get_color (background);
nautilus_directory_set_metadata (directory,
"ICON_VIEW_BACKGROUND_COLOR",
ICON_VIEW_BACKGROUND_COLOR_METADATA_KEY,
DEFAULT_BACKGROUND_COLOR,
color_spec);
g_free (color_spec);
......@@ -474,6 +477,9 @@ fm_directory_view_icons_icon_moved_cb (GnomeIconContainer *container,
/* Store the new position of the icon in the metadata. */
directory = fm_directory_view_get_model (FM_DIRECTORY_VIEW (icon_view));
position_string = g_strdup_printf ("%d,%d", x, y);
nautilus_file_set_metadata (file, "ICON_POSITION", NULL, position_string);
nautilus_file_set_metadata (file,
ICON_VIEW_ICON_POSITION_METADATA_KEY,
NULL,
position_string);
g_free (position_string);
}
......@@ -38,6 +38,7 @@
#include <libnautilus/gtkflist.h>
#include <libnautilus/nautilus-background.h>
#include <libnautilus/nautilus-icon-factory.h>
#include <libnautilus/nautilus-metadata.h>
struct _FMDirectoryViewListDetails
{
......@@ -555,7 +556,7 @@ fm_directory_view_list_clear (FMDirectoryView *view)
/* Set up the background color from the metadata. */
background_color = nautilus_directory_get_metadata (fm_directory_view_get_model (view),
"LIST_VIEW_BACKGROUND_COLOR",
INDEX_PANEL_BACKGROUND_COLOR_METADATA_KEY,
DEFAULT_BACKGROUND_COLOR);
nautilus_background_set_color (nautilus_get_widget_background (GTK_WIDGET (flist)),
background_color);
......@@ -694,7 +695,7 @@ fm_directory_view_list_background_changed_cb (NautilusBackground *background,
color_spec = nautilus_background_get_color (background);
nautilus_directory_set_metadata (directory,
"LIST_VIEW_BACKGROUND_COLOR",
INDEX_PANEL_BACKGROUND_COLOR_METADATA_KEY,
DEFAULT_BACKGROUND_COLOR,
color_spec);
g_free (color_spec);
......
......@@ -35,6 +35,7 @@
#include <libnautilus/nautilus-background.h>
#include <libnautilus/nautilus-directory.h>
#include <libnautilus/nautilus-gtk-macros.h>
#include <libnautilus/nautilus-metadata.h>
#include <libnautilus/nautilus-string.h>
#include <gnome.h>
......@@ -341,7 +342,7 @@ nautilus_index_panel_background_changed (NautilusIndexPanel *index_panel)
background = nautilus_get_widget_background (GTK_WIDGET (index_panel));
color_spec = nautilus_background_get_color (background);
nautilus_directory_set_metadata (index_panel->details->directory,
"INDEX_PANEL_BACKGROUND_COLOR",
INDEX_PANEL_BACKGROUND_COLOR_METADATA_KEY,
DEFAULT_BACKGROUND_COLOR,
color_spec);
g_free (color_spec);
......@@ -374,7 +375,7 @@ nautilus_index_panel_set_up_info (NautilusIndexPanel *index_panel, const gchar*
/* Set up the background color from the metadata. */
background_color = nautilus_directory_get_metadata (directory,
"INDEX_PANEL_BACKGROUND_COLOR",
INDEX_PANEL_BACKGROUND_COLOR_METADATA_KEY,
DEFAULT_BACKGROUND_COLOR);
nautilus_background_set_color (background, background_color);
g_free (background_color);
......
......@@ -35,6 +35,7 @@
#include <libnautilus/nautilus-background.h>
#include <libnautilus/nautilus-directory.h>
#include <libnautilus/nautilus-gtk-macros.h>
#include <libnautilus/nautilus-metadata.h>
#include <libnautilus/nautilus-string.h>
#include <gnome.h>
......@@ -341,7 +342,7 @@ nautilus_index_panel_background_changed (NautilusIndexPanel *index_panel)
background = nautilus_get_widget_background (GTK_WIDGET (index_panel));
color_spec = nautilus_background_get_color (background);
nautilus_directory_set_metadata (index_panel->details->directory,
"INDEX_PANEL_BACKGROUND_COLOR",
INDEX_PANEL_BACKGROUND_COLOR_METADATA_KEY,
DEFAULT_BACKGROUND_COLOR,
color_spec);
g_free (color_spec);
......@@ -374,7 +375,7 @@ nautilus_index_panel_set_up_info (NautilusIndexPanel *index_panel, const gchar*
/* Set up the background color from the metadata. */
background_color = nautilus_directory_get_metadata (directory,
"INDEX_PANEL_BACKGROUND_COLOR",
INDEX_PANEL_BACKGROUND_COLOR_METADATA_KEY,
DEFAULT_BACKGROUND_COLOR);
nautilus_background_set_color (background, background_color);
g_free (background_color);
......
......@@ -35,6 +35,7 @@
#include <libnautilus/nautilus-background.h>
#include <libnautilus/nautilus-directory.h>
#include <libnautilus/nautilus-gtk-macros.h>
#include <libnautilus/nautilus-metadata.h>
#include <libnautilus/nautilus-string.h>
#include <gnome.h>
......@@ -341,7 +342,7 @@ nautilus_index_panel_background_changed (NautilusIndexPanel *index_panel)
background = nautilus_get_widget_background (GTK_WIDGET (index_panel));
color_spec = nautilus_background_get_color (background);
nautilus_directory_set_metadata (index_panel->details->directory,
"INDEX_PANEL_BACKGROUND_COLOR",
INDEX_PANEL_BACKGROUND_COLOR_METADATA_KEY,
DEFAULT_BACKGROUND_COLOR,
color_spec);
g_free (color_spec);
......@@ -374,7 +375,7 @@ nautilus_index_panel_set_up_info (NautilusIndexPanel *index_panel, const gchar*
/* Set up the background color from the metadata. */
background_color = nautilus_directory_get_metadata (directory,
"INDEX_PANEL_BACKGROUND_COLOR",
INDEX_PANEL_BACKGROUND_COLOR_METADATA_KEY,
DEFAULT_BACKGROUND_COLOR);
nautilus_background_set_color (background, background_color);
g_free (background_color);
......
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