gnome-commander r2418 - in trunk: . src
- From: epiotr svn gnome org
- To: svn-commits-list gnome org
- Subject: gnome-commander r2418 - in trunk: . src
- Date: Tue, 13 Jan 2009 18:58:48 +0000 (UTC)
Author: epiotr
Date: Tue Jan 13 18:58:47 2009
New Revision: 2418
URL: http://svn.gnome.org/viewvc/gnome-commander?rev=2418&view=rev
Log:
GnomeCmdData: more C++ rework
Modified:
trunk/ChangeLog
trunk/src/gnome-cmd-data.cc
trunk/src/gnome-cmd-data.h
trunk/src/gnome-cmd-file-list.cc
trunk/src/gnome-cmd-options-dialog.cc
trunk/src/gnome-cmd-types.h
trunk/src/imageloader.cc
Modified: trunk/src/gnome-cmd-data.cc
==============================================================================
--- trunk/src/gnome-cmd-data.cc (original)
+++ trunk/src/gnome-cmd-data.cc Tue Jan 13 18:58:47 2009
@@ -52,10 +52,8 @@
GnomeCmdConList *con_list;
GList *fav_apps;
GnomeCmdDateFormat date_format; // NOTE: internally stored as locale (which not always defaults to UTF8), needs converting from/to UTF8 for editing and cfg load/save
- GnomeCmdLayout layout;
GnomeCmdColorTheme color_themes[GNOME_CMD_NUM_COLOR_MODES];
gchar *list_font;
- GdkInterpType icon_scale_quality;
gchar *theme_icon_dir;
gchar *document_icon_dir;
guint bookmark_dialog_col_width[BOOKMARK_DIALOG_NUM_COLUMNS];
@@ -1103,6 +1101,7 @@
filter_settings.backup = TRUE;
case_sens_sort = TRUE;
+ layout = GNOME_CMD_LAYOUT_MIME_ICONS;
ext_disp_mode = GNOME_CMD_EXT_DISP_BOTH;
list_orientation = FALSE;
@@ -1119,6 +1118,7 @@
device_only_icon = FALSE;
list_row_height = 16;
memset(fs_col_width, 0, sizeof(fs_col_width));
+ icon_scale_quality = GDK_INTERP_HYPER;
gui_update_rate = DEFAULT_GUI_UPDATE_RATE;
button_relief = GTK_RELIEF_NONE;
@@ -1260,7 +1260,7 @@
priv->date_format = g_locale_from_utf8 (utf8_date_format, -1, NULL, NULL, NULL);
g_free (utf8_date_format);
- priv->layout = (GnomeCmdLayout) gnome_cmd_data_get_int ("/options/layout", GNOME_CMD_LAYOUT_MIME_ICONS);
+ layout = (GnomeCmdLayout) gnome_cmd_data_get_int ("/options/layout", GNOME_CMD_LAYOUT_MIME_ICONS);
list_row_height = gnome_cmd_data_get_int ("/options/list_row_height", 16);
@@ -1315,7 +1315,7 @@
right_mouse_button_mode = (GnomeCmdData::RightMouseButtonMode) gnome_cmd_data_get_int ("/options/right_mouse_button_mode", GnomeCmdData::RIGHT_BUTTON_POPUPS_MENU);
icon_size = gnome_cmd_data_get_int ("/options/icon_size", 16);
dev_icon_size = gnome_cmd_data_get_int ("/options/dev_icon_size", 16);
- priv->icon_scale_quality = (GdkInterpType) gnome_cmd_data_get_int ("/options/icon_scale_quality", GDK_INTERP_HYPER);
+ icon_scale_quality = (GdkInterpType) gnome_cmd_data_get_int ("/options/icon_scale_quality", GDK_INTERP_HYPER);
priv->theme_icon_dir = gnome_cmd_data_get_string ("/options/theme_icon_dir", theme_icon_dir);
g_free (theme_icon_dir);
priv->document_icon_dir = gnome_cmd_data_get_string ("/options/document_icon_dir", document_icon_dir);
@@ -1659,7 +1659,7 @@
gnome_cmd_data_set_int ("/options/size_disp_mode", size_disp_mode);
gnome_cmd_data_set_int ("/options/perm_disp_mode", perm_disp_mode);
- gnome_cmd_data_set_int ("/options/layout", priv->layout);
+ gnome_cmd_data_set_int ("/options/layout", layout);
gnome_cmd_data_set_int ("/options/list_row_height", list_row_height);
gchar *utf8_date_format = g_locale_to_utf8 (priv->date_format, -1, NULL, NULL, NULL);
@@ -1701,7 +1701,7 @@
gnome_cmd_data_set_int ("/options/right_mouse_button_mode", right_mouse_button_mode);
gnome_cmd_data_set_int ("/options/icon_size", icon_size);
gnome_cmd_data_set_int ("/options/dev_icon_size", dev_icon_size);
- gnome_cmd_data_set_int ("/options/icon_scale_quality", priv->icon_scale_quality);
+ gnome_cmd_data_set_int ("/options/icon_scale_quality", icon_scale_quality);
gnome_cmd_data_set_string ("/options/theme_icon_dir", priv->theme_icon_dir);
gnome_cmd_data_set_string ("/options/document_icon_dir", priv->document_icon_dir);
gnome_cmd_data_set_int ("/options/cmdline_history_length", cmdline_history_length);
@@ -1858,18 +1858,6 @@
}
-GnomeCmdLayout gnome_cmd_data_get_layout ()
-{
- return gnome_cmd_data.priv->layout;
-}
-
-
-void gnome_cmd_data_set_layout (GnomeCmdLayout layout)
-{
- gnome_cmd_data.priv->layout = layout;
-}
-
-
GnomeCmdColorTheme *gnome_cmd_data_get_current_color_theme ()
{
return &gnome_cmd_data.priv->color_themes[gnome_cmd_data.color_mode];
@@ -1947,18 +1935,6 @@
}
-GdkInterpType gnome_cmd_data_get_icon_scale_quality ()
-{
- return gnome_cmd_data.priv->icon_scale_quality;
-}
-
-
-void gnome_cmd_data_set_icon_scale_quality (GdkInterpType quality)
-{
- gnome_cmd_data.priv->icon_scale_quality = quality;
-}
-
-
const gchar *gnome_cmd_data_get_theme_icon_dir ()
{
return gnome_cmd_data.priv->theme_icon_dir;
Modified: trunk/src/gnome-cmd-data.h
==============================================================================
--- trunk/src/gnome-cmd-data.h (original)
+++ trunk/src/gnome-cmd-data.h Tue Jan 13 18:58:47 2009
@@ -159,6 +159,7 @@
IntViewerConfig intviewer_defaults;
gboolean case_sens_sort;
+ GnomeCmdLayout layout;
GnomeCmdExtDispMode ext_disp_mode;
gboolean list_orientation;
@@ -175,6 +176,7 @@
gboolean device_only_icon;
gint list_row_height;
guint fs_col_width[GnomeCmdFileList::NUM_COLUMNS];
+ GdkInterpType icon_scale_quality;
guint gui_update_rate;
GtkReliefStyle button_relief;
@@ -214,9 +216,6 @@
GnomeCmdDateFormat gnome_cmd_data_get_date_format ();
void gnome_cmd_data_set_date_format (GnomeCmdDateFormat format);
-GnomeCmdLayout gnome_cmd_data_get_layout ();
-void gnome_cmd_data_set_layout (GnomeCmdLayout layout);
-
GnomeCmdColorTheme *gnome_cmd_data_get_custom_color_theme ();
GnomeCmdColorTheme *gnome_cmd_data_get_current_color_theme ();
@@ -237,9 +236,6 @@
const gchar *gnome_cmd_data_get_term ();
void gnome_cmd_data_set_term (const gchar *shell);
-GdkInterpType gnome_cmd_data_get_icon_scale_quality ();
-void gnome_cmd_data_set_icon_scale_quality (GdkInterpType quality);
-
const gchar *gnome_cmd_data_get_theme_icon_dir ();
void gnome_cmd_data_set_theme_icon_dir (const gchar *dir);
Modified: trunk/src/gnome-cmd-file-list.cc
==============================================================================
--- trunk/src/gnome-cmd-file-list.cc (original)
+++ trunk/src/gnome-cmd-file-list.cc Tue Jan 13 18:58:47 2009
@@ -213,7 +213,7 @@
inline FileFormatData::FileFormatData(GnomeCmdFile *f, gboolean tree_size)
{
// If the user wants a character instead of icon for filetype set it now
- if (gnome_cmd_data_get_layout () == GNOME_CMD_LAYOUT_TEXT)
+ if (gnome_cmd_data.layout == GNOME_CMD_LAYOUT_TEXT)
text[GnomeCmdFileList::COLUMN_ICON] = (gchar *) gnome_cmd_file_get_type_string (f);
else
text[GnomeCmdFileList::COLUMN_ICON] = NULL;
@@ -1391,7 +1391,7 @@
gtk_clist_set_row_data (clist, row, finfo);
// If the use wants icons to show file types set it now
- if (gnome_cmd_data_get_layout () != GNOME_CMD_LAYOUT_TEXT)
+ if (gnome_cmd_data.layout != GNOME_CMD_LAYOUT_TEXT)
{
gtk_clist_set_pixmap (clist, row, 0,
gnome_cmd_file_get_type_pixmap (finfo),
Modified: trunk/src/gnome-cmd-options-dialog.cc
==============================================================================
--- trunk/src/gnome-cmd-options-dialog.cc (original)
+++ trunk/src/gnome-cmd-options-dialog.cc Tue Jan 13 18:58:47 2009
@@ -557,7 +557,7 @@
spin = create_spin (parent, "iconsize_spin", 8, 64, gnome_cmd_data.icon_size);
table_add (table, spin, 1, 0, (GtkAttachOptions) GTK_FILL);
- scale = create_scale (parent, "iconquality_scale", gnome_cmd_data_get_icon_scale_quality (), 0, 3);
+ scale = create_scale (parent, "iconquality_scale", gnome_cmd_data.icon_scale_quality, 0, 3);
table_add (table, scale, 1, 1, (GtkAttachOptions) GTK_FILL);
entry = create_file_entry (parent, "theme_icondir_entry", gnome_cmd_data_get_theme_icon_dir());
table_add (table, entry, 1, 2, (GtkAttachOptions)0);
@@ -575,7 +575,7 @@
gtk_option_menu_set_history (GTK_OPTION_MENU (fe_optmenu), (gint) gnome_cmd_data.ext_disp_mode);
- gtk_option_menu_set_history (GTK_OPTION_MENU (lm_optmenu), (gint) gnome_cmd_data_get_layout ());
+ gtk_option_menu_set_history (GTK_OPTION_MENU (lm_optmenu), (gint) gnome_cmd_data.layout);
gtk_option_menu_set_history (GTK_OPTION_MENU (cm_optmenu), (gint) gnome_cmd_data.color_mode);
return frame;
@@ -598,8 +598,7 @@
GtkWidget *list_font_picker = lookup_widget (GTK_WIDGET (dialog), "list_font_picker");
gnome_cmd_data.ext_disp_mode = (GnomeCmdExtDispMode) gtk_option_menu_get_history (GTK_OPTION_MENU (fe_optmenu));
- gnome_cmd_data_set_layout (
- (GnomeCmdLayout) gtk_option_menu_get_history (GTK_OPTION_MENU (lm_optmenu)));
+ gnome_cmd_data.layout = (GnomeCmdLayout) gtk_option_menu_get_history (GTK_OPTION_MENU (lm_optmenu));
gnome_cmd_data.color_mode = (GnomeCmdColorMode) gtk_option_menu_get_history (GTK_OPTION_MENU (cm_optmenu));
gnome_cmd_data.use_ls_colors = gtk_toggle_button_get_active (GTK_TOGGLE_BUTTON (use_ls));
@@ -612,7 +611,7 @@
gnome_cmd_data.icon_size = gtk_spin_button_get_value_as_int (GTK_SPIN_BUTTON (iconsize_spin));
GtkAdjustment *adj = gtk_range_get_adjustment (GTK_RANGE (iconquality_scale));
- gnome_cmd_data_set_icon_scale_quality ((GdkInterpType) adj->value);
+ gnome_cmd_data.icon_scale_quality = (GdkInterpType) adj->value;
gnome_cmd_data.list_row_height = gtk_spin_button_get_value_as_int (GTK_SPIN_BUTTON (row_height_spin));
}
Modified: trunk/src/gnome-cmd-types.h
==============================================================================
--- trunk/src/gnome-cmd-types.h (original)
+++ trunk/src/gnome-cmd-types.h Tue Jan 13 18:58:47 2009
@@ -23,39 +23,39 @@
typedef struct _GnomeCmdBookmarkGroup GnomeCmdBookmarkGroup;
typedef gchar *GnomeCmdDateFormat;
-typedef enum
+enum GnomeCmdLayout
{
GNOME_CMD_LAYOUT_TEXT,
GNOME_CMD_LAYOUT_TYPE_ICONS,
GNOME_CMD_LAYOUT_MIME_ICONS
-} GnomeCmdLayout;
+};
-typedef enum
+enum GnomeCmdSizeDispMode
{
GNOME_CMD_SIZE_DISP_MODE_PLAIN,
GNOME_CMD_SIZE_DISP_MODE_LOCALE,
GNOME_CMD_SIZE_DISP_MODE_GROUPED,
GNOME_CMD_SIZE_DISP_MODE_POWERED
-} GnomeCmdSizeDispMode;
+};
-typedef enum
+enum GnomeCmdPermDispMode
{
GNOME_CMD_PERM_DISP_MODE_TEXT,
GNOME_CMD_PERM_DISP_MODE_NUMBER
-} GnomeCmdPermDispMode;
+};
-typedef enum
+enum GnomeCmdExtDispMode
{
GNOME_CMD_EXT_DISP_WITH_FNAME,
GNOME_CMD_EXT_DISP_STRIPPED,
GNOME_CMD_EXT_DISP_BOTH
-} GnomeCmdExtDispMode;
+};
-typedef enum
+enum GnomeCmdColorMode
{
GNOME_CMD_COLOR_NONE,
GNOME_CMD_COLOR_MODERN,
@@ -65,25 +65,25 @@
GNOME_CMD_COLOR_CAFEZINHO,
GNOME_CMD_COLOR_CUSTOM,
GNOME_CMD_NUM_COLOR_MODES
-} GnomeCmdColorMode;
+};
-typedef enum // The (reversed) order of following enums is significant
+enum GnomeCmdConfirmOverwriteMode // The (reversed) order of following enums is significant
{
GNOME_CMD_CONFIRM_OVERWRITE_SKIP_ALL,
GNOME_CMD_CONFIRM_OVERWRITE_QUERY,
GNOME_CMD_CONFIRM_OVERWRITE_SILENTLY
-} GnomeCmdConfirmOverwriteMode;
+};
-typedef struct
+struct GnomeCmdColorTheme
{
gboolean respect_theme;
GdkColor *sel_fg, *sel_bg;
GdkColor *norm_fg, *norm_bg;
GdkColor *curs_fg, *curs_bg;
GdkColor *alt_fg, *alt_bg;
-} GnomeCmdColorTheme;
+};
typedef struct _GnomeCmdCon GnomeCmdCon;
@@ -97,11 +97,11 @@
};
-typedef struct
+struct GnomeCmdBookmark
{
gchar *name;
gchar *path;
GnomeCmdBookmarkGroup *group;
-} GnomeCmdBookmark;
+};
#endif // __GNOME_CMD_TYPES_H__
Modified: trunk/src/imageloader.cc
==============================================================================
--- trunk/src/imageloader.cc (original)
+++ trunk/src/imageloader.cc Tue Jan 13 18:58:47 2009
@@ -318,7 +318,7 @@
scale = (gfloat)h/(gfloat)gdk_pixbuf_get_height (pixbuf);
w = (gint)(scale*(gfloat)gdk_pixbuf_get_width (pixbuf));
- GdkPixbuf *tmp = gdk_pixbuf_scale_simple (pixbuf, w, h, gnome_cmd_data_get_icon_scale_quality());
+ GdkPixbuf *tmp = gdk_pixbuf_scale_simple (pixbuf, w, h, gnome_cmd_data.icon_scale_quality);
gdk_pixbuf_unref (pixbuf);
pixbuf = tmp;
}
@@ -454,7 +454,7 @@
GdkPixmap **pixmap,
GdkBitmap **mask)
{
- switch (gnome_cmd_data_get_layout ())
+ switch (gnome_cmd_data.layout)
{
case GNOME_CMD_LAYOUT_TYPE_ICONS:
return get_type_icon (type, symlink, pixmap, mask);
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]