Commit fa2a9d00 authored by Darin Adler's avatar Darin Adler

Port from EelLabel to GtkLabel.

	* components/hardware/nautilus-hardware-view.c:
	(update_uptime_text), (setup_overview_form):
	* components/music/nautilus-music-view.c:
	* src/file-manager/nautilus-indexing-info.c:
	(update_progress_display):
	* src/nautilus-property-browser.c:
	(nautilus_property_browser_init), (labeled_image_configure),
	(labeled_image_new), (make_category),
	(property_browser_category_button_new),
	(nautilus_property_browser_update_contents):
	* test/test.h:
	* src/nautilus-shell.c:
	* src/nautilus-sidebar-title.c: (nautilus_sidebar_title_init):
	Port from EelLabel to GtkLabel.

	* components/news/nautilus-news.c: (do_destroy),
	(draw_rss_logo_image), (draw_rss_title), (draw_rss_items),
	(nautilus_news_set_title), (free_channel),
	(empty_message_size_allocate), (set_up_main_widgets),
	(make_news_view):
	* libnautilus-private/nautilus-icon-private.h:
	* src/nautilus-sidebar-tabs.c:
	(nautilus_sidebar_tabs_load_theme_data),
	(nautilus_sidebar_tabs_init), (nautilus_sidebar_tabs_destroy),
	(draw_one_tab_plain), (draw_one_tab_themed), (get_tab_width),
	(nautilus_sidebar_tabs_add_view):
	Port to Pango text instead of Eel text.

	* libnautilus-private/nautilus-customization-data.c:
	(add_reset_text):
	* libnautilus-private/nautilus-icon-factory.c:
	(embedded_text_font_changed_callback), (embed_text):
	* src/nautilus-about.c: (draw_aa_string), (draw_author_list),
	(nautilus_about_draw_info), (nautilus_about_update_authors):
	Disable Eel text and ifdef with GNOME2_CONVERSION_COMPLETE.

	* libnautilus-private/nautilus-global-preferences.h:
	* libnautilus-private/nautilus-global-preferences.c:
	Turn off font-related preferences. Maybe delete later or
	convert for Pango fonts.

	* libnautilus-private/nautilus-icon-canvas-item.h:
	* libnautilus-private/nautilus-icon-container.h:
	Remove eel-scalable-font.h includes.

	* src/nautilus-component-adapter-factory.c:
	(nautilus_component_adapter_factory_create_adapter):
	Disable the adapter because it was causing problems.
parent 2b4a8d97
2002-01-02 Darin Adler <darin@bentspoon.com>
* components/hardware/nautilus-hardware-view.c:
(update_uptime_text), (setup_overview_form):
* components/music/nautilus-music-view.c:
* src/file-manager/nautilus-indexing-info.c:
(update_progress_display):
* src/nautilus-property-browser.c:
(nautilus_property_browser_init), (labeled_image_configure),
(labeled_image_new), (make_category),
(property_browser_category_button_new),
(nautilus_property_browser_update_contents):
* test/test.h:
* src/nautilus-shell.c:
* src/nautilus-sidebar-title.c: (nautilus_sidebar_title_init):
Port from EelLabel to GtkLabel.
* components/news/nautilus-news.c: (do_destroy),
(draw_rss_logo_image), (draw_rss_title), (draw_rss_items),
(nautilus_news_set_title), (free_channel),
(empty_message_size_allocate), (set_up_main_widgets),
(make_news_view):
* libnautilus-private/nautilus-icon-private.h:
* src/nautilus-sidebar-tabs.c:
(nautilus_sidebar_tabs_load_theme_data),
(nautilus_sidebar_tabs_init), (nautilus_sidebar_tabs_destroy),
(draw_one_tab_plain), (draw_one_tab_themed), (get_tab_width),
(nautilus_sidebar_tabs_add_view):
Port to Pango text instead of Eel text.
* libnautilus-private/nautilus-customization-data.c:
(add_reset_text):
* libnautilus-private/nautilus-icon-factory.c:
(embedded_text_font_changed_callback), (embed_text):
* src/nautilus-about.c: (draw_aa_string), (draw_author_list),
(nautilus_about_draw_info), (nautilus_about_update_authors):
Disable Eel text and ifdef with GNOME2_CONVERSION_COMPLETE.
* libnautilus-private/nautilus-global-preferences.h:
* libnautilus-private/nautilus-global-preferences.c:
Turn off font-related preferences. Maybe delete later or
convert for Pango fonts.
* libnautilus-private/nautilus-icon-canvas-item.h:
* libnautilus-private/nautilus-icon-container.h:
Remove eel-scalable-font.h includes.
* src/nautilus-component-adapter-factory.c:
(nautilus_component_adapter_factory_create_adapter):
Disable the adapter because it was causing problems.
2002-01-02 Frederic Crozat <fcrozat@mandrakesoft.com>
* libnautilus-private/nautilus-directory-background.c:
......
......@@ -42,7 +42,6 @@
#include <eel/eel-gtk-extensions.h>
#include <eel/eel-gtk-macros.h>
#include <eel/eel-image.h>
#include <eel/eel-label.h>
#include <libnautilus-private/nautilus-metadata.h>
#include <eel/eel-string.h>
#include <libnautilus/libnautilus.h>
......@@ -57,7 +56,7 @@ struct _NautilusHardwareViewDetails {
GtkWidget *form;
EelLabel *uptime_label;
GtkLabel *uptime_label;
int timer_task;
int cpu_count;
......@@ -492,7 +491,7 @@ update_uptime_text (gpointer callback_data)
uptime_minutes = (uptime_seconds - (uptime_days * 86400) - (uptime_hours * 3600)) / 60;
uptime_text = g_strdup_printf (_("Uptime is %d days, %d hours, %d minutes"), uptime_days, uptime_hours, uptime_minutes);
eel_label_set_text (NAUTILUS_HARDWARE_VIEW (callback_data)->details->uptime_label, uptime_text);
gtk_label_set_text (NAUTILUS_HARDWARE_VIEW (callback_data)->details->uptime_label, uptime_text);
g_free (uptime_text);
g_free (uptime_data);
......@@ -612,9 +611,11 @@ setup_overview_form (NautilusHardwareView *view)
}
/* allocate the uptime label */
view->details->uptime_label = EEL_LABEL (eel_label_new (""));
view->details->uptime_label = GTK_LABEL (gtk_label_new (""));
#if GNOME2_CONVERSION_COMPLETE
eel_label_make_larger (view->details->uptime_label, 2);
eel_label_set_justify (view->details->uptime_label, GTK_JUSTIFY_LEFT);
#endif
gtk_box_pack_end (GTK_BOX (view->details->form), GTK_WIDGET (view->details->uptime_label), 0, 0, GNOME_PAD);
update_uptime_text (view);
......
......@@ -44,7 +44,6 @@
#include <eel/eel-gtk-extensions.h>
#include <eel/eel-gtk-macros.h>
#include <eel/eel-image.h>
#include <eel/eel-label.h>
#include <eel/eel-list.h>
#include <eel/eel-preferences.h>
#include <libnautilus-private/nautilus-global-preferences.h>
......
......@@ -55,9 +55,6 @@
#include <eel/eel-glib-extensions.h>
#include <eel/eel-graphic-effects.h>
#include <eel/eel-gtk-extensions.h>
#include <eel/eel-label.h>
#include <eel/eel-scalable-font.h>
#include <eel/eel-smooth-text-layout.h>
#include <eel/eel-stock-dialogs.h>
#include <eel/eel-string.h>
#include <eel/eel-vfs-extensions.h>
......@@ -124,9 +121,6 @@ typedef struct {
uint update_interval;
int update_timeout;
EelScalableFont *font;
EelScalableFont *bold_font;
gboolean news_changed;
gboolean always_display_title;
gboolean configure_mode;
......@@ -153,7 +147,7 @@ typedef struct {
char *link_uri;
News *owner;
char *title;
PangoLayout *title;
GdkPixbuf *logo_image;
GList *items;
......@@ -306,14 +300,6 @@ do_destroy (GtkObject *obj, News *news)
{
g_free (news->uri);
if (news->font) {
g_object_unref (news->font);
}
if (news->bold_font) {
g_object_unref (news->bold_font);
}
if (news->timer_task != 0) {
gtk_timeout_remove (news->timer_task);
news->timer_task = 0;
......@@ -448,9 +434,11 @@ draw_rss_logo_image (RSSChannelData *channel_data,
char *time_str;
int logo_width, logo_height;
int v_offset, pixbuf_width;
int time_x_pos, time_y_pos;
GdkPixbuf *mapped_image;
#if GNOME2_CONVERSION_COMPLETE
int time_x_pos, time_y_pos;
EelDimensions time_dimensions;
#endif
v_offset = offset;
......@@ -476,9 +464,11 @@ draw_rss_logo_image (RSSChannelData *channel_data,
if (channel_data->last_update != 0 && !measure_only) {
time_str = eel_strdup_strftime (_("%I:%M %p"), localtime (&channel_data->last_update));
pixbuf_width = gdk_pixbuf_get_width (pixbuf);
#if GNOME2_CONVERSION_COMPLETE
time_dimensions = eel_scalable_font_measure_text (channel_data->owner->font, 9, time_str, strlen (time_str));
pixbuf_width = gdk_pixbuf_get_width (pixbuf);
time_x_pos = pixbuf_width - time_dimensions.width - TIME_MARGIN_OFFSET;
if (time_x_pos >= LOGO_LEFT_OFFSET + logo_width) {
time_y_pos = offset + ((gdk_pixbuf_get_height (channel_data->logo_image) - time_dimensions.height) / 2);
......@@ -489,6 +479,7 @@ draw_rss_logo_image (RSSChannelData *channel_data,
EEL_RGB_COLOR_BLACK, EEL_OPACITY_FULLY_OPAQUE);
}
g_free (time_str);
#endif
}
}
return v_offset;
......@@ -501,19 +492,14 @@ draw_rss_title (RSSChannelData *channel_data,
int v_offset,
gboolean measure_only)
{
EelDimensions title_dimensions;
int label_offset;
gboolean is_prelit;
int height;
if (channel_data->title == NULL || channel_data->owner->font == NULL) {
if (channel_data->title == NULL) {
return v_offset;
}
/* first, measure the text */
title_dimensions = eel_scalable_font_measure_text (channel_data->owner->font,
TITLE_FONT_SIZE,
channel_data->title, strlen (channel_data->title));
/* if there is no image, draw the disclosure triangle */
if (channel_data->logo_image == NULL && !measure_only) {
draw_triangle (pixbuf, channel_data, v_offset);
......@@ -527,16 +513,15 @@ draw_rss_title (RSSChannelData *channel_data,
/* draw the name into the pixbuf using anti-aliased text */
if (!measure_only) {
eel_scalable_font_draw_text (channel_data->owner->font, pixbuf,
label_offset, v_offset,
eel_gdk_pixbuf_whole_pixbuf,
18,
channel_data->title, strlen (channel_data->title),
is_prelit ? EEL_RGBA_COLOR_PACK (0, 0, 128, 255) : EEL_RGB_COLOR_BLACK,
EEL_OPACITY_FULLY_OPAQUE);
eel_gdk_pixbuf_draw_layout (pixbuf,
label_offset, v_offset,
is_prelit ? EEL_RGBA_COLOR_PACK (0, 0, 128, 255) : EEL_RGB_COLOR_BLACK,
channel_data->title);
}
return v_offset + title_dimensions.height;
pango_layout_get_pixel_size (channel_data->title, NULL, &height);
return v_offset + height;
}
/* utility to determine if a uri matches the current one */
......@@ -556,13 +541,14 @@ draw_rss_items (RSSChannelData *channel_data,
GList *current_item;
RSSItemData *item_data;
int bullet_width, bullet_height, font_size;
gboolean bold;
int item_index, bullet_alpha;
int bullet_x_pos, bullet_y_pos;
guint32 text_color;
#if GNOME2_CONVERSION_COMPLETE
int bullet_x_pos, bullet_y_pos;
ArtIRect dest_bounds;
EelSmoothTextLayout *smooth_text_layout;
#endif
EelDimensions text_dimensions;
EelScalableFont *font;
GdkPixbuf *bullet;
if (channel_data->owner->bullet) {
......@@ -596,12 +582,9 @@ draw_rss_items (RSSChannelData *channel_data,
font_size = ITEM_FONT_SIZE;
item_data->item_start_y = v_offset;
if (is_current_uri (channel_data->owner, item_data->item_url)) {
font = channel_data->owner->bold_font;
} else {
font = channel_data->owner->font;
}
bold = is_current_uri (channel_data->owner, item_data->item_url);
#if GNOME2_CONVERSION_COMPLETE
smooth_text_layout = eel_smooth_text_layout_new
(item_data->item_title,
eel_strlen (item_data->item_title),
......@@ -637,6 +620,7 @@ draw_rss_items (RSSChannelData *channel_data,
}
g_object_unref (smooth_text_layout);
#endif
item_data->item_end_y = item_data->item_start_y + text_dimensions.height;
v_offset += text_dimensions.height + 4;
......@@ -940,17 +924,20 @@ nautilus_news_leave_notify_event (GtkWidget *widget, GdkEventMotion *event, News
static void
nautilus_news_set_title (RSSChannelData *channel_data, const char *title)
{
if (eel_strcmp (channel_data->title, title) == 0) {
return;
}
if (channel_data->title) {
g_free (channel_data->title);
}
if (title != NULL) {
channel_data->title = g_strdup (title);
if (channel_data->title == NULL) {
channel_data->title = pango_layout_new (eel_gtk_widget_get_pango_ft2_context (channel_data->owner->news_display));
} else {
if (strcmp (pango_layout_get_text (channel_data->title), title) == 0) {
return;
}
}
pango_layout_set_text (channel_data->title, title, -1);
} else {
channel_data->title = NULL;
if (channel_data->title != NULL) {
g_object_unref (channel_data->title);
}
channel_data->title = NULL;
}
}
......@@ -976,7 +963,10 @@ free_channel (RSSChannelData *channel_data)
g_free (channel_data->name);
g_free (channel_data->uri);
g_free (channel_data->link_uri);
g_free (channel_data->title);
if (channel_data->title != NULL) {
g_object_unref (channel_data->title);
}
if (channel_data->logo_image != NULL) {
g_object_unref (channel_data->logo_image);
......@@ -2202,7 +2192,9 @@ empty_message_size_allocate (GtkWidget *widget, GtkAllocation *allocation, News
wrap_width = allocation->width - 2*EMPTY_MESSAGE_MARGIN;
if (wrap_width > 0) {
#if GNOME2_CONVERSION_COMPLETE
eel_label_set_smooth_line_wrap_width (EEL_LABEL (widget), allocation->width - 2*EMPTY_MESSAGE_MARGIN);
#endif
}
}
......@@ -2422,10 +2414,12 @@ set_up_main_widgets (News *news, GtkWidget *container)
news->news_display_scrolled_window = scrolled_window;
/* add the empty message */
news->empty_message = eel_label_new (_("The News panel displays current headlines from your favorite websites. Click the \'Select Sites\' button to select the sites to display."));
news->empty_message = gtk_label_new (_("The News panel displays current headlines from your favorite websites. Click the \'Select Sites\' button to select the sites to display."));
#if GNOME2_CONVERSION_COMPLETE
eel_label_set_smooth_font_size (EEL_LABEL (news->empty_message), 14);
eel_label_set_justify (EEL_LABEL (news->empty_message), GTK_JUSTIFY_LEFT);
eel_label_set_wrap (EEL_LABEL (news->empty_message), TRUE);
#endif
gtk_box_pack_start (GTK_BOX (news->main_box), news->empty_message, TRUE,
TRUE, 0);
......@@ -2471,10 +2465,6 @@ make_news_view (const char *iid, gpointer callback_data)
set_up_configure_widgets (news, main_container);
set_up_edit_widgets (news, main_container);
/* set up the fonts */
news->font = eel_scalable_font_get_default_font ();
news->bold_font = eel_scalable_font_get_default_bold_font ();
/* get preferences and sanity check them */
news->max_item_count = eel_preferences_get_integer (NAUTILUS_PREFERENCES_NEWS_MAX_ITEMS);
news->update_interval = 60 * eel_preferences_get_integer (NAUTILUS_PREFERENCES_NEWS_UPDATE_INTERVAL);
......
......@@ -42,15 +42,14 @@
#include <stdlib.h>
#include "nautilus-customization-data.h"
#include "nautilus-file-utilities.h"
#include <eel/eel-gdk-extensions.h>
#include <eel/eel-gdk-extensions.h>
#include <eel/eel-gdk-pixbuf-extensions.h>
#include <eel/eel-glib-extensions.h>
#include "nautilus-file-utilities.h"
#include <eel/eel-gdk-extensions.h>
#include <eel/eel-gtk-extensions.h>
#include <eel/eel-scalable-font.h>
#include <eel/eel-xml-extensions.h>
#include <eel/eel-string.h>
#include <eel/eel-xml-extensions.h>
typedef enum {
READ_PUBLIC_CUSTOMIZATIONS,
......@@ -344,19 +343,21 @@ static void
add_reset_text (GdkPixbuf *pixbuf)
{
char *reset_text;
EelScalableFont *font;
EelDimensions title_dimensions;
int width, height;
int font_size, text_len;
int text_len;
#if GNOME2_CONVERSION_COMPLETE
EelDimensions title_dimensions;
int font_size;
int h_offset, v_offset;
#endif
font = eel_scalable_font_get_default_font ();
reset_text = _("reset");
text_len = strlen (reset_text);
width = gdk_pixbuf_get_width (pixbuf);
height = gdk_pixbuf_get_height (pixbuf);
#if GNOME2_CONVERSION_COMPLETE
font_size = eel_scalable_font_largest_fitting_font_size (font, reset_text, width - 12, 12, 36);
title_dimensions = eel_scalable_font_measure_text (font, font_size, reset_text, text_len);
......@@ -373,6 +374,7 @@ add_reset_text (GdkPixbuf *pixbuf)
EEL_OPACITY_FULLY_OPAQUE);
g_object_unref (font);
#endif
}
/* utility to make an attractive pattern image by compositing with a frame */
......
......@@ -34,7 +34,6 @@
#include <eel/eel-font-manager.h>
#include <eel/eel-glib-extensions.h>
#include <eel/eel-gtk-extensions.h>
#include <eel/eel-scalable-font.h>
#include <eel/eel-smooth-widget.h>
#include <eel/eel-stock-dialogs.h>
#include <eel/eel-string.h>
......@@ -909,6 +908,9 @@ default_home_location_callback (int user_level)
/*
* Public functions
*/
#if GNOME2_CONVERSION_COMPLETE
static EelScalableFont *
global_preferences_get_smooth_font (const char *smooth_font_file_name)
{
......@@ -981,6 +983,8 @@ nautilus_global_preferences_get_default_smooth_bold_font (void)
return global_preferences_get_smooth_bold_font (default_smooth_font_auto_value);
}
#endif
/* Let the smooth widget machinery know about smoothness changes */
static void
smooth_graphics_mode_changed_callback (gpointer callback_data)
......
......@@ -23,8 +23,8 @@
Authors: Ramiro Estrugo <ramiro@eazel.com>
*/
#ifndef NAUTILUS_PREFS_GLOBAL_H
#define NAUTILUS_PREFS_GLOBAL_H
#ifndef NAUTILUS_GLOBAL_PREFERENCES_H
#define NAUTILUS_GLOBAL_PREFERENCES_H
#include <eel/eel-preferences.h>
......@@ -187,17 +187,9 @@ typedef enum
/* Gnome session management */
#define NAUTILUS_PREFERENCES_ADD_TO_SESSION "preferences/add_to_session"
void nautilus_global_preferences_init (void);
/* Sidebar */
struct EelScalableFont *nautilus_global_preferences_get_icon_view_smooth_font (void);
struct EelScalableFont *nautilus_global_preferences_get_default_smooth_font (void);
struct EelScalableFont *nautilus_global_preferences_get_default_smooth_bold_font (void);
void nautilus_global_preferences_set_default_folder_viewer (const char *iid);
void nautilus_global_preferences_init (void);
void nautilus_global_preferences_set_default_folder_viewer (const char *iid);
G_END_DECLS
#endif /* NAUTILUS_PREFS_GLOBAL_H */
#endif /* NAUTILUS_GLOBAL_PREFERENCES_H */
......@@ -28,7 +28,6 @@
#include <libgnomecanvas/gnome-canvas.h>
#include <gdk-pixbuf/gdk-pixbuf.h>
#include "nautilus-icon-factory.h"
#include <eel/eel-scalable-font.h>
G_BEGIN_DECLS
......
......@@ -28,7 +28,6 @@
#include <libgnomecanvas/gnome-canvas.h>
#include "nautilus-icon-factory.h"
#include <eel/eel-scalable-font.h>
#define NAUTILUS_ICON_CONTAINER(obj) \
GTK_CHECK_CAST (obj, nautilus_icon_container_get_type (), NautilusIconContainer)
......
......@@ -44,7 +44,6 @@
#include <eel/eel-gdk-pixbuf-extensions.h>
#include <eel/eel-glib-extensions.h>
#include <eel/eel-gtk-macros.h>
#include <eel/eel-scalable-font.h>
#include <eel/eel-string.h>
#include <eel/eel-vfs-extensions.h>
#include <gtk/gtksignal.h>
......@@ -59,12 +58,6 @@
#include <stdio.h>
#include <string.h>
#define USE_EEL_TEXT
#ifdef USE_EEL_TEXT
#include <eel/eel-smooth-text-layout.h>
#endif
#define ICON_NAME_BLOCK_DEVICE "i-blockdev"
#define ICON_NAME_BROKEN_SYMBOLIC_LINK "i-symlink"
#define ICON_NAME_CHARACTER_DEVICE "i-chardev"
......@@ -2235,13 +2228,17 @@ embedded_text_rect_usable (ArtIRect embedded_text_rect)
return TRUE;
}
#if GNOME2_CONVERSION_COMPLETE
static gboolean embedded_text_preferences_callbacks_added = FALSE;
static EelScalableFont *embedded_text_font = NULL;
static void
embedded_text_font_changed_callback (gpointer callback_data)
{
gboolean clear_cache = GPOINTER_TO_INT (callback_data);
gboolean clear_cache;
clear_cache = GPOINTER_TO_INT (callback_data);
embedded_text_font = nautilus_global_preferences_get_default_smooth_font ();
......@@ -2261,12 +2258,13 @@ embedded_text_font_free (void)
embedded_text_font = NULL;
}
#endif
static GdkPixbuf *
embed_text (GdkPixbuf *pixbuf_without_text,
ArtIRect embedded_text_rect,
const char *text)
{
EelSmoothTextLayout *smooth_text_layout;
GdkPixbuf *pixbuf_with_text;
g_return_val_if_fail (pixbuf_without_text != NULL, NULL);
......@@ -2279,7 +2277,8 @@ embed_text (GdkPixbuf *pixbuf_without_text,
}
/* Listen for changes in embedded text (icon text preview) font preferences */
if (embedded_text_preferences_callbacks_added == FALSE) {
#if GNOME2_CONVERSION_COMPLETE
if (!embedded_text_preferences_callbacks_added) {
embedded_text_preferences_callbacks_added = TRUE;
eel_preferences_add_callback (NAUTILUS_PREFERENCES_DEFAULT_SMOOTH_FONT,
......@@ -2300,9 +2299,11 @@ embed_text (GdkPixbuf *pixbuf_without_text,
g_return_val_if_fail (EEL_IS_SMOOTH_TEXT_LAYOUT (smooth_text_layout), NULL);
eel_smooth_text_layout_set_line_spacing (smooth_text_layout, EMBEDDED_TEXT_LINE_SPACING);
eel_smooth_text_layout_set_empty_line_height (smooth_text_layout, EMBEDDED_TEXT_EMPTY_LINE_HEIGHT);
#endif
pixbuf_with_text = gdk_pixbuf_copy (pixbuf_without_text);
#if GNOME2_CONVERSION_COMPLETE
eel_smooth_text_layout_draw_to_pixbuf (smooth_text_layout,
pixbuf_with_text,
0,
......@@ -2314,6 +2315,7 @@ embed_text (GdkPixbuf *pixbuf_without_text,
EEL_OPACITY_FULLY_OPAQUE);
g_object_unref (smooth_text_layout);
#endif
return pixbuf_with_text;
}
......
......@@ -169,10 +169,7 @@ struct NautilusIconContainerDetails {
/* fonts used to draw labels in regular mode */
GdkFont *label_font[NAUTILUS_ZOOM_LEVEL_LARGEST + 1];
/* font used to draw labels in smooth mode */
EelScalableFont *smooth_label_font;
int font_size_table[NAUTILUS_ZOOM_LEVEL_LARGEST + 1];
int font_size_table[NAUTILUS_ZOOM_LEVEL_LARGEST + 1]; /* unused? */
/* pixbuf and color for label highlighting */
GdkPixbuf *highlight_frame;
......
......@@ -35,7 +35,6 @@
#include <eel/eel-gdk-extensions.h>
#include <eel/eel-glib-extensions.h>
#include <eel/eel-gtk-extensions.h>
#include <eel/eel-label.h>
#include <libnautilus-private/nautilus-medusa-support.h>
#include <eel/eel-stock-dialogs.h>
......@@ -49,7 +48,7 @@
#define PROGRESS_UPDATE_INTERVAL 5000
typedef struct {
EelLabel *progress_label;
GtkLabel *progress_label;
GtkProgress *progress_bar;
} ProgressChangeData;
......@@ -91,7 +90,7 @@ get_text_for_progress_label (void)
static gboolean
update_progress_display (gpointer callback_data)
{
EelLabel *progress_label;
GtkLabel *progress_label;
ProgressChangeData *progress_change_data;
char *progress_string;
......
......@@ -32,7 +32,6 @@
#include <eel/eel-gdk-pixbuf-extensions.h>
#include <eel/eel-glib-extensions.h>
#include <eel/eel-gtk-extensions.h>
#include <eel/eel-scalable-font.h>
#include <eel/eel-string.h>
#include <gdk-pixbuf/gdk-pixbuf.h>
#include <gtk/gtkdrawingarea.h>
......@@ -210,29 +209,33 @@ nautilus_about_repaint (GtkWidget *widget,
/* utility routine to draw a string at a position */
static void
draw_aa_string (EelScalableFont *font,
GdkPixbuf *pixbuf,
draw_aa_string (GdkPixbuf *pixbuf,
gboolean bold,
int font_size,
int x_pos,
int y_pos,
guint color,
guint shadow_color,
guint32 color,
guint32 shadow_color,
const char *text,
int shadow_offset)
{
if (shadow_offset != 0) {
#if GNOME2_CONVERSION_COMPLETE
eel_scalable_font_draw_text (font, pixbuf,
x_pos + shadow_offset, y_pos + shadow_offset,
eel_gdk_pixbuf_whole_pixbuf,
font_size,
text, strlen (text),
shadow_color, EEL_OPACITY_FULLY_OPAQUE);
#endif
}
#if GNOME2_CONVERSION_COMPLETE
eel_scalable_font_draw_text (font, pixbuf, x_pos, y_pos,
eel_gdk_pixbuf_whole_pixbuf,
font_size,
text, strlen (text), color, EEL_OPACITY_FULLY_OPAQUE);
#endif
}
/* randomize_authors randomizes the order array so different names get displayed in different positions each time */
......@@ -269,8 +272,7 @@ randomize_authors (NautilusAbout *about)
/* draw the author list */
static void
draw_author_list (NautilusAbout *about,
GdkPixbuf *pixbuf,
EelScalableFont *plain_font)
GdkPixbuf *pixbuf)
{
int index, column_count;
int xpos, ypos;
......@@ -281,7 +283,7 @@ draw_author_list (NautilusAbout *about,
xpos = AUTHOR_LEFT_POS; ypos = AUTHOR_TOP_POS;
while (about->details->authors[about->details->order_array[index]] != NULL) {
draw_aa_string (plain_font, pixbuf, 12, xpos, ypos,
draw_aa_string (pixbuf, FALSE, 12, xpos, ypos,
EEL_RGB_COLOR_BLACK, EEL_RGB_COLOR_BLACK,
about->details->authors[about->details->order_array[index]],
0);
......@@ -313,15 +315,11 @@ nautilus_about_draw_info (NautilusAbout *about,
{
char *display_str, *temp_str;
char **comment_array;
EelScalableFont *plain_font, *bold_font;
GdkPixbuf *pixbuf;
uint black, white, grey;
int xpos, ypos, total_height;
int index;
plain_font = eel_scalable_font_get_default_font ();
bold_font = eel_scalable_font_make_bold (plain_font);
pixbuf = about->details->background_pixbuf;
total_height = gdk_pixbuf_get_height (pixbuf);
......@@ -331,17 +329,17 @@ nautilus_about_draw_info (NautilusAbout *about,
/* draw the name and version */
display_str = g_strdup_printf ("%s %s", title, version);
draw_aa_string (bold_font, pixbuf, 24, 12, 5, white, black, display_str, 1);
draw_aa_string (pixbuf, TRUE, 24, 12, 5, white, black, display_str, 1);
g_free (display_str);
/* draw the copyright notice */
draw_aa_string (bold_font, pixbuf, 11, 12, 40, black, black, copyright, 0);
draw_aa_string (pixbuf, TRUE, 11, 12, 40, black, black, copyright, 0);
/* draw the authors title */
draw_aa_string (bold_font, pixbuf, 20, 184, 64, black, black, _("Authors"), 0);
draw_aa_string (pixbuf, TRUE, 20, 184, 64, black, black, _("Authors"), 0);
/* draw the time stamp */
draw_aa_string (plain_font, pixbuf, 11, 284, total_height - 14, grey, black, time_stamp, 0);
draw_aa_string (pixbuf, FALSE, 11, 284, total_height - 14, grey, black, time_stamp, 0);
/* draw the translator's credit, if necessary */
if (eel_strcmp (translators, "Translator Credits") != 0) {
......@@ -356,7 +354,7 @@ nautilus_about_draw_info (NautilusAbout *about,
index = 0;
while (comment_array[index] != NULL) {
draw_aa_string (plain_font, pixbuf, 11, xpos, ypos, black, black, comment_array[index], 0);
draw_aa_string (pixbuf, FALSE, 11, xpos, ypos, black, black, comment_array[index], 0);
ypos += 14;
index++;
}
......@@ -371,7 +369,7 @@ nautilus_about_draw_info (NautilusAbout *about,
g_free (temp_str);
randomize_authors (about);
draw_author_list (about, pixbuf, plain_font);
draw_author_list (about, pixbuf);
about->details->last_update_time = time (NULL);
/* draw the comment, breaking it up into multiple lines */
......@@ -379,15 +377,11 @@ nautilus_about_draw_info (NautilusAbout *about,
index = 0;
xpos = 6; ypos = 118;
while (comment_array[index] != NULL) {
draw_aa_string (plain_font, pixbuf, 14, xpos, ypos, black, black, comment_array[index], 0);
draw_aa_string (pixbuf, FALSE, 14, xpos, ypos, black, black, comment_array[index], 0);
ypos += 18;
index++;
}
g_strfreev (comment_array);
/* release the fonts */
g_object_unref(plain_font);
g_object_unref(bold_font);
}
/* update authors is called to randomize the author array and redraw it */
......@@ -396,7 +390,6 @@ void
nautilus_about_update_authors (NautilusAbout *about)
{
ArtIRect author_area;
EelScalableFont *plain_font;
/* clear the author area */
author_area = eel_art_irect_assign (AUTHOR_LEFT_POS - 24,
......@@ -413,9 +406,7 @@ nautilus_about_update_authors (NautilusAbout *about)
randomize_authors (about);
/* redraw the authors */
plain_font = eel_scalable_font_get_default_font ();
draw_author_list (about, about->details->background_pixbuf, plain_font);
g_object_unref(plain_font);
draw_author_list (about, about->details->background_pixbuf);
about->details->last_update_time = time (NULL);