mirror of
https://gitlab.gnome.org/GNOME/nautilus
synced 2024-08-25 02:36:07 +00:00
Rename NautilusGraphic to NautilusImage everywhere.
* components/services/install/nautilus-view/nautilus-service-install- view.c: (generate_install_form), (create_image_widget), (create_title_widget), (create_middle_title_widget): * components/services/login/nautilus-view/nautilus-login-view.c: (generate_login_form), (create_image_widget), (create_title_widget): * components/services/startup/nautilus-view/nautilus-service-startup- view.c: (generate_startup_form), (create_image_widget), (generate_form_logo): * libnautilus-extensions/Makefile.am: * libnautilus-extensions/nautilus-graphic.c: * libnautilus-extensions/nautilus-graphic.h: * libnautilus-extensions/nautilus-image.c: (nautilus_image_initialize_class), (nautilus_image_initialize), (nautilus_image_destroy), (nautilus_image_set_arg), (nautilus_image_get_arg), (nautilus_image_realize), (nautilus_image_unrealize), (nautilus_image_draw), (nautilus_image_size_allocate), (nautilus_image_size_request), (nautilus_image_map), (nautilus_image_unmap), (nautilus_image_expose), (ensure_buffer_size), (create_child_window), (nautilus_gdk_create_copy_area_gc), (nautilus_gdk_pixbuf_render_to_drawable), (nautilus_gdk_pixbuf_render_to_pixbuf), (nautilus_gdk_pixbuf_render_to_pixbuf_alpha), (gdk_string_dimensions), (nautilus_gdk_pixbuf_set_to_color), (nautilus_gdk_pixbuf_tile), (nautilus_gdk_pixbuf_tile_alpha), (nautilus_image_new), (nautilus_image_set_background_pixbuf), (nautilus_image_get_background_pixbuf), (nautilus_image_set_background_type), (nautilus_image_get_background_type), (nautilus_image_set_background_color), (nautilus_image_get_background_color), (nautilus_image_set_placement_type), (nautilus_image_get_placement_type), (nautilus_image_set_pixbuf), (nautilus_image_get_pixbuf), (nautilus_image_set_overall_alpha), (nautilus_image_set_label_text), (nautilus_image_get_label_text), (nautilus_image_set_label_font), (nautilus_image_get_label_font), (nautilus_image_set_left_offset), (nautilus_image_set_right_offset), (nautilus_image_set_top_offset), (nautilus_image_set_bottom_offset), (nautilus_image_set_extra_width), (nautilus_image_set_extra_height): * libnautilus-extensions/nautilus-image.h: * test/.cvsignore: * test/Makefile.am: * test/test-nautilus-graphic.c: * test/test-nautilus-image.c: (create_background), (create_pixbuf), (create_image), (alpha_scale_value_changed), (red_color_value_changed), (green_color_value_changed), (blue_color_value_changed), (toggle_background_type_callback), (create_color_scale), (main): Rename NautilusGraphic to NautilusImage everywhere.
This commit is contained in:
parent
a757095647
commit
f7263fbde7
58
ChangeLog
58
ChangeLog
|
@ -1,3 +1,61 @@
|
|||
2000-07-14 Ramiro Estrugo <ramiro@eazel.com>
|
||||
|
||||
*
|
||||
components/services/install/nautilus-view/nautilus-service-install-
|
||||
view.c: (generate_install_form), (create_image_widget),
|
||||
(create_title_widget), (create_middle_title_widget):
|
||||
* components/services/login/nautilus-view/nautilus-login-view.c:
|
||||
(generate_login_form), (create_image_widget),
|
||||
(create_title_widget):
|
||||
*
|
||||
components/services/startup/nautilus-view/nautilus-service-startup-
|
||||
view.c: (generate_startup_form), (create_image_widget),
|
||||
(generate_form_logo):
|
||||
* libnautilus-extensions/Makefile.am:
|
||||
* libnautilus-extensions/nautilus-graphic.c:
|
||||
* libnautilus-extensions/nautilus-graphic.h:
|
||||
* libnautilus-extensions/nautilus-image.c:
|
||||
(nautilus_image_initialize_class), (nautilus_image_initialize),
|
||||
(nautilus_image_destroy), (nautilus_image_set_arg),
|
||||
(nautilus_image_get_arg), (nautilus_image_realize),
|
||||
(nautilus_image_unrealize), (nautilus_image_draw),
|
||||
(nautilus_image_size_allocate), (nautilus_image_size_request),
|
||||
(nautilus_image_map), (nautilus_image_unmap),
|
||||
(nautilus_image_expose), (ensure_buffer_size),
|
||||
(create_child_window), (nautilus_gdk_create_copy_area_gc),
|
||||
(nautilus_gdk_pixbuf_render_to_drawable),
|
||||
(nautilus_gdk_pixbuf_render_to_pixbuf),
|
||||
(nautilus_gdk_pixbuf_render_to_pixbuf_alpha),
|
||||
(gdk_string_dimensions), (nautilus_gdk_pixbuf_set_to_color),
|
||||
(nautilus_gdk_pixbuf_tile), (nautilus_gdk_pixbuf_tile_alpha),
|
||||
(nautilus_image_new), (nautilus_image_set_background_pixbuf),
|
||||
(nautilus_image_get_background_pixbuf),
|
||||
(nautilus_image_set_background_type),
|
||||
(nautilus_image_get_background_type),
|
||||
(nautilus_image_set_background_color),
|
||||
(nautilus_image_get_background_color),
|
||||
(nautilus_image_set_placement_type),
|
||||
(nautilus_image_get_placement_type), (nautilus_image_set_pixbuf),
|
||||
(nautilus_image_get_pixbuf), (nautilus_image_set_overall_alpha),
|
||||
(nautilus_image_set_label_text), (nautilus_image_get_label_text),
|
||||
(nautilus_image_set_label_font), (nautilus_image_get_label_font),
|
||||
(nautilus_image_set_left_offset),
|
||||
(nautilus_image_set_right_offset), (nautilus_image_set_top_offset),
|
||||
(nautilus_image_set_bottom_offset),
|
||||
(nautilus_image_set_extra_width),
|
||||
(nautilus_image_set_extra_height):
|
||||
* libnautilus-extensions/nautilus-image.h:
|
||||
* test/.cvsignore:
|
||||
* test/Makefile.am:
|
||||
* test/test-nautilus-graphic.c:
|
||||
* test/test-nautilus-image.c: (create_background), (create_pixbuf),
|
||||
(create_image), (alpha_scale_value_changed),
|
||||
(red_color_value_changed), (green_color_value_changed),
|
||||
(blue_color_value_changed), (toggle_background_type_callback),
|
||||
(create_color_scale), (main):
|
||||
|
||||
Rename NautilusGraphic to NautilusImage everywhere.
|
||||
|
||||
2000-07-14 Ramiro Estrugo <ramiro@eazel.com>
|
||||
|
||||
* src/nautilus-main.c: (main):
|
||||
|
|
|
@ -38,7 +38,7 @@
|
|||
#include <libnautilus-extensions/nautilus-file-utilities.h>
|
||||
#include <libnautilus-extensions/nautilus-string.h>
|
||||
#include <libnautilus-extensions/nautilus-font-factory.h>
|
||||
#include <libnautilus-extensions/nautilus-graphic.h>
|
||||
#include <libnautilus-extensions/nautilus-image.h>
|
||||
#include <libnautilus-extensions/nautilus-gdk-extensions.h>
|
||||
#include <stdio.h>
|
||||
#include <fcntl.h>
|
||||
|
@ -51,34 +51,34 @@
|
|||
#define SERVICE_DOMAIN_NAME "testmachine.eazel.com"
|
||||
#define NEXT_VIEW "http://eazel1.eazel.com/services/control2.html"
|
||||
|
||||
static void nautilus_service_install_view_initialize_class (NautilusServiceInstallViewClass *klass);
|
||||
static void nautilus_service_install_view_initialize (NautilusServiceInstallView *view);
|
||||
static void nautilus_service_install_view_destroy (GtkObject *object);
|
||||
static void service_install_load_location_callback (NautilusView *nautilus_view,
|
||||
const char *location,
|
||||
NautilusServiceInstallView *view);
|
||||
static void generate_install_form (NautilusServiceInstallView *view);
|
||||
static void fake_overall_install_progress (NautilusServiceInstallView *view);
|
||||
static void generate_current_progress (NautilusServiceInstallView *view,
|
||||
char *progress_message);
|
||||
static void nautilus_service_install_view_update_from_uri (NautilusServiceInstallView *view,
|
||||
const char *uri);
|
||||
static void show_overall_feedback (NautilusServiceInstallView *view,
|
||||
char *progress_message);
|
||||
static GtkWidget* create_title_widget (const char *title_text);
|
||||
static GtkWidget* create_middle_title_widget (const char *left_text,
|
||||
const char *right_text);
|
||||
static GtkWidget* create_graphic_widget (const char *icon_name,
|
||||
const char *background_color_spec,
|
||||
NautilusGraphicPlacementType placement);
|
||||
static void go_to_uri (NautilusServiceInstallView *view,
|
||||
char *uri);
|
||||
static void nautilus_service_install_view_initialize_class (NautilusServiceInstallViewClass *klass);
|
||||
static void nautilus_service_install_view_initialize (NautilusServiceInstallView *view);
|
||||
static void nautilus_service_install_view_destroy (GtkObject *object);
|
||||
static void service_install_load_location_callback (NautilusView *nautilus_view,
|
||||
const char *location,
|
||||
NautilusServiceInstallView *view);
|
||||
static void generate_install_form (NautilusServiceInstallView *view);
|
||||
static void fake_overall_install_progress (NautilusServiceInstallView *view);
|
||||
static void generate_current_progress (NautilusServiceInstallView *view,
|
||||
char *progress_message);
|
||||
static void nautilus_service_install_view_update_from_uri (NautilusServiceInstallView *view,
|
||||
const char *uri);
|
||||
static void show_overall_feedback (NautilusServiceInstallView *view,
|
||||
char *progress_message);
|
||||
static GtkWidget* create_title_widget (const char *title_text);
|
||||
static GtkWidget* create_middle_title_widget (const char *left_text,
|
||||
const char *right_text);
|
||||
static GtkWidget* create_image_widget (const char *icon_name,
|
||||
const char *background_color_spec,
|
||||
NautilusImagePlacementType placement);
|
||||
static void go_to_uri (NautilusServiceInstallView *view,
|
||||
char *uri);
|
||||
|
||||
NAUTILUS_DEFINE_CLASS_BOILERPLATE (NautilusServiceInstallView, nautilus_service_install_view, GTK_TYPE_EVENT_BOX)
|
||||
|
||||
static void
|
||||
generate_install_form (NautilusServiceInstallView *view) {
|
||||
|
||||
generate_install_form (NautilusServiceInstallView *view)
|
||||
{
|
||||
GdkFont *font;
|
||||
GtkWidget *temp_box;
|
||||
GtkWidget *title;
|
||||
|
@ -152,19 +152,19 @@ generate_install_form (NautilusServiceInstallView *view) {
|
|||
}
|
||||
|
||||
static GtkWidget*
|
||||
create_graphic_widget (const char *icon_name,
|
||||
const char *background_color_spec,
|
||||
NautilusGraphicPlacementType placement)
|
||||
create_image_widget (const char *icon_name,
|
||||
const char *background_color_spec,
|
||||
NautilusImagePlacementType placement)
|
||||
{
|
||||
char *path;
|
||||
GtkWidget *graphic;
|
||||
GtkWidget *image;
|
||||
GdkPixbuf *pixbuf;
|
||||
guint32 background_rgb;
|
||||
|
||||
g_return_val_if_fail (icon_name != NULL, NULL);
|
||||
g_return_val_if_fail (background_color_spec != NULL, NULL);
|
||||
|
||||
graphic = nautilus_graphic_new();
|
||||
image = nautilus_image_new();
|
||||
|
||||
path = nautilus_pixmap_file (icon_name);
|
||||
|
||||
|
@ -172,68 +172,68 @@ create_graphic_widget (const char *icon_name,
|
|||
g_free (path);
|
||||
|
||||
if (pixbuf != NULL) {
|
||||
nautilus_graphic_set_pixbuf (NAUTILUS_GRAPHIC (graphic), pixbuf);
|
||||
nautilus_image_set_pixbuf (NAUTILUS_IMAGE (image), pixbuf);
|
||||
gdk_pixbuf_unref (pixbuf);
|
||||
}
|
||||
else {
|
||||
g_warning ("Could not find the requested icon.");
|
||||
}
|
||||
|
||||
nautilus_graphic_set_background_type (NAUTILUS_GRAPHIC (graphic),
|
||||
NAUTILUS_GRAPHIC_BACKGROUND_SOLID);
|
||||
nautilus_image_set_background_type (NAUTILUS_IMAGE (image),
|
||||
NAUTILUS_IMAGE_BACKGROUND_SOLID);
|
||||
|
||||
background_rgb = nautilus_parse_rgb_with_white_default (background_color_spec);
|
||||
|
||||
nautilus_graphic_set_background_color (NAUTILUS_GRAPHIC (graphic),
|
||||
background_rgb);
|
||||
nautilus_image_set_background_color (NAUTILUS_IMAGE (image),
|
||||
background_rgb);
|
||||
|
||||
nautilus_graphic_set_placement_type (NAUTILUS_GRAPHIC (graphic), placement);
|
||||
nautilus_image_set_placement_type (NAUTILUS_IMAGE (image), placement);
|
||||
|
||||
return graphic;
|
||||
return image;
|
||||
}
|
||||
|
||||
static GtkWidget*
|
||||
create_title_widget (const char *title_text)
|
||||
{
|
||||
GtkWidget *title_hbox;
|
||||
GtkWidget *logo_graphic;
|
||||
GtkWidget *filler_graphic;
|
||||
GtkWidget *text_graphic;
|
||||
GtkWidget *logo_image;
|
||||
GtkWidget *filler_image;
|
||||
GtkWidget *text_image;
|
||||
GdkFont *font;
|
||||
|
||||
g_assert (title_text != NULL);
|
||||
|
||||
title_hbox = gtk_hbox_new (FALSE, 0);
|
||||
|
||||
logo_graphic = create_graphic_widget ("eazel-services-logo.png",
|
||||
logo_image = create_image_widget ("eazel-services-logo.png",
|
||||
SERVICE_VIEW_DEFAULT_BACKGROUND_COLOR,
|
||||
NAUTILUS_GRAPHIC_PLACEMENT_CENTER);
|
||||
NAUTILUS_IMAGE_PLACEMENT_CENTER);
|
||||
|
||||
filler_graphic = create_graphic_widget ("eazel-services-logo-tile.png",
|
||||
filler_image = create_image_widget ("eazel-services-logo-tile.png",
|
||||
SERVICE_VIEW_DEFAULT_BACKGROUND_COLOR,
|
||||
NAUTILUS_GRAPHIC_PLACEMENT_TILE);
|
||||
NAUTILUS_IMAGE_PLACEMENT_TILE);
|
||||
|
||||
text_graphic = create_graphic_widget ("eazel-services-logo-tile.png",
|
||||
text_image = create_image_widget ("eazel-services-logo-tile.png",
|
||||
SERVICE_VIEW_DEFAULT_BACKGROUND_COLOR,
|
||||
NAUTILUS_GRAPHIC_PLACEMENT_TILE);
|
||||
NAUTILUS_IMAGE_PLACEMENT_TILE);
|
||||
|
||||
font = nautilus_font_factory_get_font_by_family ("helvetica", 20);
|
||||
|
||||
nautilus_graphic_set_label_text (NAUTILUS_GRAPHIC (text_graphic), title_text);
|
||||
nautilus_graphic_set_label_font (NAUTILUS_GRAPHIC (text_graphic), font);
|
||||
nautilus_graphic_set_extra_width (NAUTILUS_GRAPHIC (text_graphic), 8);
|
||||
nautilus_graphic_set_right_offset (NAUTILUS_GRAPHIC (text_graphic), 8);
|
||||
nautilus_graphic_set_top_offset (NAUTILUS_GRAPHIC (text_graphic), 3);
|
||||
nautilus_image_set_label_text (NAUTILUS_IMAGE (text_image), title_text);
|
||||
nautilus_image_set_label_font (NAUTILUS_IMAGE (text_image), font);
|
||||
nautilus_image_set_extra_width (NAUTILUS_IMAGE (text_image), 8);
|
||||
nautilus_image_set_right_offset (NAUTILUS_IMAGE (text_image), 8);
|
||||
nautilus_image_set_top_offset (NAUTILUS_IMAGE (text_image), 3);
|
||||
|
||||
gdk_font_unref (font);
|
||||
|
||||
gtk_widget_show (logo_graphic);
|
||||
gtk_widget_show (filler_graphic);
|
||||
gtk_widget_show (text_graphic);
|
||||
gtk_widget_show (logo_image);
|
||||
gtk_widget_show (filler_image);
|
||||
gtk_widget_show (text_image);
|
||||
|
||||
gtk_box_pack_start (GTK_BOX (title_hbox), logo_graphic, FALSE, FALSE, 0);
|
||||
gtk_box_pack_start (GTK_BOX (title_hbox), filler_graphic, TRUE, TRUE, 0);
|
||||
gtk_box_pack_end (GTK_BOX (title_hbox), text_graphic, FALSE, FALSE, 0);
|
||||
gtk_box_pack_start (GTK_BOX (title_hbox), logo_image, FALSE, FALSE, 0);
|
||||
gtk_box_pack_start (GTK_BOX (title_hbox), filler_image, TRUE, TRUE, 0);
|
||||
gtk_box_pack_end (GTK_BOX (title_hbox), text_image, FALSE, FALSE, 0);
|
||||
|
||||
return title_hbox;
|
||||
}
|
||||
|
@ -243,9 +243,9 @@ create_middle_title_widget (const char *left_text,
|
|||
const char *right_text)
|
||||
{
|
||||
GtkWidget *title_hbox;
|
||||
GtkWidget *left_graphic;
|
||||
GtkWidget *right_graphic;
|
||||
GtkWidget *filler_graphic;
|
||||
GtkWidget *left_image;
|
||||
GtkWidget *right_image;
|
||||
GtkWidget *filler_image;
|
||||
GdkFont *font;
|
||||
|
||||
g_assert (left_text != NULL);
|
||||
|
@ -253,43 +253,43 @@ create_middle_title_widget (const char *left_text,
|
|||
|
||||
title_hbox = gtk_hbox_new (FALSE, 0);
|
||||
|
||||
left_graphic = create_graphic_widget ("eazel-services-logo-tile.png",
|
||||
SERVICE_VIEW_DEFAULT_BACKGROUND_COLOR,
|
||||
NAUTILUS_GRAPHIC_PLACEMENT_TILE);
|
||||
left_image = create_image_widget ("eazel-services-logo-tile.png",
|
||||
SERVICE_VIEW_DEFAULT_BACKGROUND_COLOR,
|
||||
NAUTILUS_IMAGE_PLACEMENT_TILE);
|
||||
|
||||
filler_image = create_image_widget ("eazel-services-logo-tile.png",
|
||||
SERVICE_VIEW_DEFAULT_BACKGROUND_COLOR,
|
||||
NAUTILUS_IMAGE_PLACEMENT_TILE);
|
||||
|
||||
filler_graphic = create_graphic_widget ("eazel-services-logo-tile.png",
|
||||
SERVICE_VIEW_DEFAULT_BACKGROUND_COLOR,
|
||||
NAUTILUS_GRAPHIC_PLACEMENT_TILE);
|
||||
|
||||
right_graphic = create_graphic_widget ("eazel-services-logo-tile.png",
|
||||
SERVICE_VIEW_DEFAULT_BACKGROUND_COLOR,
|
||||
NAUTILUS_GRAPHIC_PLACEMENT_TILE);
|
||||
right_image = create_image_widget ("eazel-services-logo-tile.png",
|
||||
SERVICE_VIEW_DEFAULT_BACKGROUND_COLOR,
|
||||
NAUTILUS_IMAGE_PLACEMENT_TILE);
|
||||
|
||||
font = nautilus_font_factory_get_font_by_family ("helvetica", 18);
|
||||
|
||||
nautilus_graphic_set_label_text (NAUTILUS_GRAPHIC (left_graphic), left_text);
|
||||
nautilus_graphic_set_label_font (NAUTILUS_GRAPHIC (left_graphic), font);
|
||||
nautilus_image_set_label_text (NAUTILUS_IMAGE (left_image), left_text);
|
||||
nautilus_image_set_label_font (NAUTILUS_IMAGE (left_image), font);
|
||||
|
||||
nautilus_graphic_set_extra_width (NAUTILUS_GRAPHIC (left_graphic), 8);
|
||||
nautilus_graphic_set_left_offset (NAUTILUS_GRAPHIC (left_graphic), 8);
|
||||
nautilus_graphic_set_top_offset (NAUTILUS_GRAPHIC (left_graphic), 1);
|
||||
nautilus_image_set_extra_width (NAUTILUS_IMAGE (left_image), 8);
|
||||
nautilus_image_set_left_offset (NAUTILUS_IMAGE (left_image), 8);
|
||||
nautilus_image_set_top_offset (NAUTILUS_IMAGE (left_image), 1);
|
||||
|
||||
nautilus_graphic_set_label_text (NAUTILUS_GRAPHIC (right_graphic), right_text);
|
||||
nautilus_graphic_set_label_font (NAUTILUS_GRAPHIC (right_graphic), font);
|
||||
nautilus_image_set_label_text (NAUTILUS_IMAGE (right_image), right_text);
|
||||
nautilus_image_set_label_font (NAUTILUS_IMAGE (right_image), font);
|
||||
|
||||
nautilus_graphic_set_extra_width (NAUTILUS_GRAPHIC (right_graphic), 8);
|
||||
nautilus_graphic_set_right_offset (NAUTILUS_GRAPHIC (right_graphic), 8);
|
||||
nautilus_graphic_set_top_offset (NAUTILUS_GRAPHIC (right_graphic), 1);
|
||||
nautilus_image_set_extra_width (NAUTILUS_IMAGE (right_image), 8);
|
||||
nautilus_image_set_right_offset (NAUTILUS_IMAGE (right_image), 8);
|
||||
nautilus_image_set_top_offset (NAUTILUS_IMAGE (right_image), 1);
|
||||
|
||||
gdk_font_unref (font);
|
||||
|
||||
gtk_widget_show (left_graphic);
|
||||
gtk_widget_show (filler_graphic);
|
||||
gtk_widget_show (right_graphic);
|
||||
gtk_widget_show (left_image);
|
||||
gtk_widget_show (filler_image);
|
||||
gtk_widget_show (right_image);
|
||||
|
||||
gtk_box_pack_start (GTK_BOX (title_hbox), left_graphic, FALSE, FALSE, 0);
|
||||
gtk_box_pack_start (GTK_BOX (title_hbox), filler_graphic, TRUE, TRUE, 0);
|
||||
gtk_box_pack_end (GTK_BOX (title_hbox), right_graphic, FALSE, FALSE, 0);
|
||||
gtk_box_pack_start (GTK_BOX (title_hbox), left_image, FALSE, FALSE, 0);
|
||||
gtk_box_pack_start (GTK_BOX (title_hbox), filler_image, TRUE, TRUE, 0);
|
||||
gtk_box_pack_end (GTK_BOX (title_hbox), right_image, FALSE, FALSE, 0);
|
||||
|
||||
return title_hbox;
|
||||
}
|
||||
|
|
|
@ -38,7 +38,7 @@
|
|||
#include <libnautilus-extensions/nautilus-file-utilities.h>
|
||||
#include <libnautilus-extensions/nautilus-string.h>
|
||||
#include <libnautilus-extensions/nautilus-font-factory.h>
|
||||
#include <libnautilus-extensions/nautilus-graphic.h>
|
||||
#include <libnautilus-extensions/nautilus-image.h>
|
||||
#include <libnautilus-extensions/nautilus-gdk-extensions.h>
|
||||
#include <stdio.h>
|
||||
#include <fcntl.h>
|
||||
|
@ -51,34 +51,34 @@
|
|||
#define SERVICE_DOMAIN_NAME "testmachine.eazel.com"
|
||||
#define NEXT_VIEW "http://eazel1.eazel.com/services/control2.html"
|
||||
|
||||
static void nautilus_service_install_view_initialize_class (NautilusServiceInstallViewClass *klass);
|
||||
static void nautilus_service_install_view_initialize (NautilusServiceInstallView *view);
|
||||
static void nautilus_service_install_view_destroy (GtkObject *object);
|
||||
static void service_install_load_location_callback (NautilusView *nautilus_view,
|
||||
const char *location,
|
||||
NautilusServiceInstallView *view);
|
||||
static void generate_install_form (NautilusServiceInstallView *view);
|
||||
static void fake_overall_install_progress (NautilusServiceInstallView *view);
|
||||
static void generate_current_progress (NautilusServiceInstallView *view,
|
||||
char *progress_message);
|
||||
static void nautilus_service_install_view_update_from_uri (NautilusServiceInstallView *view,
|
||||
const char *uri);
|
||||
static void show_overall_feedback (NautilusServiceInstallView *view,
|
||||
char *progress_message);
|
||||
static GtkWidget* create_title_widget (const char *title_text);
|
||||
static GtkWidget* create_middle_title_widget (const char *left_text,
|
||||
const char *right_text);
|
||||
static GtkWidget* create_graphic_widget (const char *icon_name,
|
||||
const char *background_color_spec,
|
||||
NautilusGraphicPlacementType placement);
|
||||
static void go_to_uri (NautilusServiceInstallView *view,
|
||||
char *uri);
|
||||
static void nautilus_service_install_view_initialize_class (NautilusServiceInstallViewClass *klass);
|
||||
static void nautilus_service_install_view_initialize (NautilusServiceInstallView *view);
|
||||
static void nautilus_service_install_view_destroy (GtkObject *object);
|
||||
static void service_install_load_location_callback (NautilusView *nautilus_view,
|
||||
const char *location,
|
||||
NautilusServiceInstallView *view);
|
||||
static void generate_install_form (NautilusServiceInstallView *view);
|
||||
static void fake_overall_install_progress (NautilusServiceInstallView *view);
|
||||
static void generate_current_progress (NautilusServiceInstallView *view,
|
||||
char *progress_message);
|
||||
static void nautilus_service_install_view_update_from_uri (NautilusServiceInstallView *view,
|
||||
const char *uri);
|
||||
static void show_overall_feedback (NautilusServiceInstallView *view,
|
||||
char *progress_message);
|
||||
static GtkWidget* create_title_widget (const char *title_text);
|
||||
static GtkWidget* create_middle_title_widget (const char *left_text,
|
||||
const char *right_text);
|
||||
static GtkWidget* create_image_widget (const char *icon_name,
|
||||
const char *background_color_spec,
|
||||
NautilusImagePlacementType placement);
|
||||
static void go_to_uri (NautilusServiceInstallView *view,
|
||||
char *uri);
|
||||
|
||||
NAUTILUS_DEFINE_CLASS_BOILERPLATE (NautilusServiceInstallView, nautilus_service_install_view, GTK_TYPE_EVENT_BOX)
|
||||
|
||||
static void
|
||||
generate_install_form (NautilusServiceInstallView *view) {
|
||||
|
||||
generate_install_form (NautilusServiceInstallView *view)
|
||||
{
|
||||
GdkFont *font;
|
||||
GtkWidget *temp_box;
|
||||
GtkWidget *title;
|
||||
|
@ -152,19 +152,19 @@ generate_install_form (NautilusServiceInstallView *view) {
|
|||
}
|
||||
|
||||
static GtkWidget*
|
||||
create_graphic_widget (const char *icon_name,
|
||||
const char *background_color_spec,
|
||||
NautilusGraphicPlacementType placement)
|
||||
create_image_widget (const char *icon_name,
|
||||
const char *background_color_spec,
|
||||
NautilusImagePlacementType placement)
|
||||
{
|
||||
char *path;
|
||||
GtkWidget *graphic;
|
||||
GtkWidget *image;
|
||||
GdkPixbuf *pixbuf;
|
||||
guint32 background_rgb;
|
||||
|
||||
g_return_val_if_fail (icon_name != NULL, NULL);
|
||||
g_return_val_if_fail (background_color_spec != NULL, NULL);
|
||||
|
||||
graphic = nautilus_graphic_new();
|
||||
image = nautilus_image_new();
|
||||
|
||||
path = nautilus_pixmap_file (icon_name);
|
||||
|
||||
|
@ -172,68 +172,68 @@ create_graphic_widget (const char *icon_name,
|
|||
g_free (path);
|
||||
|
||||
if (pixbuf != NULL) {
|
||||
nautilus_graphic_set_pixbuf (NAUTILUS_GRAPHIC (graphic), pixbuf);
|
||||
nautilus_image_set_pixbuf (NAUTILUS_IMAGE (image), pixbuf);
|
||||
gdk_pixbuf_unref (pixbuf);
|
||||
}
|
||||
else {
|
||||
g_warning ("Could not find the requested icon.");
|
||||
}
|
||||
|
||||
nautilus_graphic_set_background_type (NAUTILUS_GRAPHIC (graphic),
|
||||
NAUTILUS_GRAPHIC_BACKGROUND_SOLID);
|
||||
nautilus_image_set_background_type (NAUTILUS_IMAGE (image),
|
||||
NAUTILUS_IMAGE_BACKGROUND_SOLID);
|
||||
|
||||
background_rgb = nautilus_parse_rgb_with_white_default (background_color_spec);
|
||||
|
||||
nautilus_graphic_set_background_color (NAUTILUS_GRAPHIC (graphic),
|
||||
background_rgb);
|
||||
nautilus_image_set_background_color (NAUTILUS_IMAGE (image),
|
||||
background_rgb);
|
||||
|
||||
nautilus_graphic_set_placement_type (NAUTILUS_GRAPHIC (graphic), placement);
|
||||
nautilus_image_set_placement_type (NAUTILUS_IMAGE (image), placement);
|
||||
|
||||
return graphic;
|
||||
return image;
|
||||
}
|
||||
|
||||
static GtkWidget*
|
||||
create_title_widget (const char *title_text)
|
||||
{
|
||||
GtkWidget *title_hbox;
|
||||
GtkWidget *logo_graphic;
|
||||
GtkWidget *filler_graphic;
|
||||
GtkWidget *text_graphic;
|
||||
GtkWidget *logo_image;
|
||||
GtkWidget *filler_image;
|
||||
GtkWidget *text_image;
|
||||
GdkFont *font;
|
||||
|
||||
g_assert (title_text != NULL);
|
||||
|
||||
title_hbox = gtk_hbox_new (FALSE, 0);
|
||||
|
||||
logo_graphic = create_graphic_widget ("eazel-services-logo.png",
|
||||
logo_image = create_image_widget ("eazel-services-logo.png",
|
||||
SERVICE_VIEW_DEFAULT_BACKGROUND_COLOR,
|
||||
NAUTILUS_GRAPHIC_PLACEMENT_CENTER);
|
||||
NAUTILUS_IMAGE_PLACEMENT_CENTER);
|
||||
|
||||
filler_graphic = create_graphic_widget ("eazel-services-logo-tile.png",
|
||||
filler_image = create_image_widget ("eazel-services-logo-tile.png",
|
||||
SERVICE_VIEW_DEFAULT_BACKGROUND_COLOR,
|
||||
NAUTILUS_GRAPHIC_PLACEMENT_TILE);
|
||||
NAUTILUS_IMAGE_PLACEMENT_TILE);
|
||||
|
||||
text_graphic = create_graphic_widget ("eazel-services-logo-tile.png",
|
||||
text_image = create_image_widget ("eazel-services-logo-tile.png",
|
||||
SERVICE_VIEW_DEFAULT_BACKGROUND_COLOR,
|
||||
NAUTILUS_GRAPHIC_PLACEMENT_TILE);
|
||||
NAUTILUS_IMAGE_PLACEMENT_TILE);
|
||||
|
||||
font = nautilus_font_factory_get_font_by_family ("helvetica", 20);
|
||||
|
||||
nautilus_graphic_set_label_text (NAUTILUS_GRAPHIC (text_graphic), title_text);
|
||||
nautilus_graphic_set_label_font (NAUTILUS_GRAPHIC (text_graphic), font);
|
||||
nautilus_graphic_set_extra_width (NAUTILUS_GRAPHIC (text_graphic), 8);
|
||||
nautilus_graphic_set_right_offset (NAUTILUS_GRAPHIC (text_graphic), 8);
|
||||
nautilus_graphic_set_top_offset (NAUTILUS_GRAPHIC (text_graphic), 3);
|
||||
nautilus_image_set_label_text (NAUTILUS_IMAGE (text_image), title_text);
|
||||
nautilus_image_set_label_font (NAUTILUS_IMAGE (text_image), font);
|
||||
nautilus_image_set_extra_width (NAUTILUS_IMAGE (text_image), 8);
|
||||
nautilus_image_set_right_offset (NAUTILUS_IMAGE (text_image), 8);
|
||||
nautilus_image_set_top_offset (NAUTILUS_IMAGE (text_image), 3);
|
||||
|
||||
gdk_font_unref (font);
|
||||
|
||||
gtk_widget_show (logo_graphic);
|
||||
gtk_widget_show (filler_graphic);
|
||||
gtk_widget_show (text_graphic);
|
||||
gtk_widget_show (logo_image);
|
||||
gtk_widget_show (filler_image);
|
||||
gtk_widget_show (text_image);
|
||||
|
||||
gtk_box_pack_start (GTK_BOX (title_hbox), logo_graphic, FALSE, FALSE, 0);
|
||||
gtk_box_pack_start (GTK_BOX (title_hbox), filler_graphic, TRUE, TRUE, 0);
|
||||
gtk_box_pack_end (GTK_BOX (title_hbox), text_graphic, FALSE, FALSE, 0);
|
||||
gtk_box_pack_start (GTK_BOX (title_hbox), logo_image, FALSE, FALSE, 0);
|
||||
gtk_box_pack_start (GTK_BOX (title_hbox), filler_image, TRUE, TRUE, 0);
|
||||
gtk_box_pack_end (GTK_BOX (title_hbox), text_image, FALSE, FALSE, 0);
|
||||
|
||||
return title_hbox;
|
||||
}
|
||||
|
@ -243,9 +243,9 @@ create_middle_title_widget (const char *left_text,
|
|||
const char *right_text)
|
||||
{
|
||||
GtkWidget *title_hbox;
|
||||
GtkWidget *left_graphic;
|
||||
GtkWidget *right_graphic;
|
||||
GtkWidget *filler_graphic;
|
||||
GtkWidget *left_image;
|
||||
GtkWidget *right_image;
|
||||
GtkWidget *filler_image;
|
||||
GdkFont *font;
|
||||
|
||||
g_assert (left_text != NULL);
|
||||
|
@ -253,43 +253,43 @@ create_middle_title_widget (const char *left_text,
|
|||
|
||||
title_hbox = gtk_hbox_new (FALSE, 0);
|
||||
|
||||
left_graphic = create_graphic_widget ("eazel-services-logo-tile.png",
|
||||
SERVICE_VIEW_DEFAULT_BACKGROUND_COLOR,
|
||||
NAUTILUS_GRAPHIC_PLACEMENT_TILE);
|
||||
left_image = create_image_widget ("eazel-services-logo-tile.png",
|
||||
SERVICE_VIEW_DEFAULT_BACKGROUND_COLOR,
|
||||
NAUTILUS_IMAGE_PLACEMENT_TILE);
|
||||
|
||||
filler_image = create_image_widget ("eazel-services-logo-tile.png",
|
||||
SERVICE_VIEW_DEFAULT_BACKGROUND_COLOR,
|
||||
NAUTILUS_IMAGE_PLACEMENT_TILE);
|
||||
|
||||
filler_graphic = create_graphic_widget ("eazel-services-logo-tile.png",
|
||||
SERVICE_VIEW_DEFAULT_BACKGROUND_COLOR,
|
||||
NAUTILUS_GRAPHIC_PLACEMENT_TILE);
|
||||
|
||||
right_graphic = create_graphic_widget ("eazel-services-logo-tile.png",
|
||||
SERVICE_VIEW_DEFAULT_BACKGROUND_COLOR,
|
||||
NAUTILUS_GRAPHIC_PLACEMENT_TILE);
|
||||
right_image = create_image_widget ("eazel-services-logo-tile.png",
|
||||
SERVICE_VIEW_DEFAULT_BACKGROUND_COLOR,
|
||||
NAUTILUS_IMAGE_PLACEMENT_TILE);
|
||||
|
||||
font = nautilus_font_factory_get_font_by_family ("helvetica", 18);
|
||||
|
||||
nautilus_graphic_set_label_text (NAUTILUS_GRAPHIC (left_graphic), left_text);
|
||||
nautilus_graphic_set_label_font (NAUTILUS_GRAPHIC (left_graphic), font);
|
||||
nautilus_image_set_label_text (NAUTILUS_IMAGE (left_image), left_text);
|
||||
nautilus_image_set_label_font (NAUTILUS_IMAGE (left_image), font);
|
||||
|
||||
nautilus_graphic_set_extra_width (NAUTILUS_GRAPHIC (left_graphic), 8);
|
||||
nautilus_graphic_set_left_offset (NAUTILUS_GRAPHIC (left_graphic), 8);
|
||||
nautilus_graphic_set_top_offset (NAUTILUS_GRAPHIC (left_graphic), 1);
|
||||
nautilus_image_set_extra_width (NAUTILUS_IMAGE (left_image), 8);
|
||||
nautilus_image_set_left_offset (NAUTILUS_IMAGE (left_image), 8);
|
||||
nautilus_image_set_top_offset (NAUTILUS_IMAGE (left_image), 1);
|
||||
|
||||
nautilus_graphic_set_label_text (NAUTILUS_GRAPHIC (right_graphic), right_text);
|
||||
nautilus_graphic_set_label_font (NAUTILUS_GRAPHIC (right_graphic), font);
|
||||
nautilus_image_set_label_text (NAUTILUS_IMAGE (right_image), right_text);
|
||||
nautilus_image_set_label_font (NAUTILUS_IMAGE (right_image), font);
|
||||
|
||||
nautilus_graphic_set_extra_width (NAUTILUS_GRAPHIC (right_graphic), 8);
|
||||
nautilus_graphic_set_right_offset (NAUTILUS_GRAPHIC (right_graphic), 8);
|
||||
nautilus_graphic_set_top_offset (NAUTILUS_GRAPHIC (right_graphic), 1);
|
||||
nautilus_image_set_extra_width (NAUTILUS_IMAGE (right_image), 8);
|
||||
nautilus_image_set_right_offset (NAUTILUS_IMAGE (right_image), 8);
|
||||
nautilus_image_set_top_offset (NAUTILUS_IMAGE (right_image), 1);
|
||||
|
||||
gdk_font_unref (font);
|
||||
|
||||
gtk_widget_show (left_graphic);
|
||||
gtk_widget_show (filler_graphic);
|
||||
gtk_widget_show (right_graphic);
|
||||
gtk_widget_show (left_image);
|
||||
gtk_widget_show (filler_image);
|
||||
gtk_widget_show (right_image);
|
||||
|
||||
gtk_box_pack_start (GTK_BOX (title_hbox), left_graphic, FALSE, FALSE, 0);
|
||||
gtk_box_pack_start (GTK_BOX (title_hbox), filler_graphic, TRUE, TRUE, 0);
|
||||
gtk_box_pack_end (GTK_BOX (title_hbox), right_graphic, FALSE, FALSE, 0);
|
||||
gtk_box_pack_start (GTK_BOX (title_hbox), left_image, FALSE, FALSE, 0);
|
||||
gtk_box_pack_start (GTK_BOX (title_hbox), filler_image, TRUE, TRUE, 0);
|
||||
gtk_box_pack_end (GTK_BOX (title_hbox), right_image, FALSE, FALSE, 0);
|
||||
|
||||
return title_hbox;
|
||||
}
|
||||
|
|
|
@ -35,7 +35,7 @@
|
|||
#include <libnautilus-extensions/nautilus-file-utilities.h>
|
||||
#include <libnautilus-extensions/nautilus-string.h>
|
||||
#include <libnautilus-extensions/nautilus-font-factory.h>
|
||||
#include <libnautilus-extensions/nautilus-graphic.h>
|
||||
#include <libnautilus-extensions/nautilus-image.h>
|
||||
#include <libnautilus-extensions/nautilus-gdk-extensions.h>
|
||||
#include <stdio.h>
|
||||
#include <unistd.h>
|
||||
|
@ -62,33 +62,33 @@ struct _NautilusLoginViewDetails {
|
|||
#define SERVICE_SUMMARY_LOCATION "http://eazel1.eazel.com/services/control1.html"
|
||||
#define SERVICE_HELP_LOCATION "http://www.eazel.com"
|
||||
|
||||
static void nautilus_login_view_initialize_class (NautilusLoginViewClass *klass);
|
||||
static void nautilus_login_view_initialize (NautilusLoginView *view);
|
||||
static void nautilus_login_view_destroy (GtkObject *object);
|
||||
static void login_load_location_callback (NautilusView *nautilus_view,
|
||||
const char *location,
|
||||
NautilusLoginView *view);
|
||||
static void show_feedback (NautilusLoginView *view,
|
||||
char *error_message);
|
||||
static void generate_login_form (NautilusLoginView *view);
|
||||
static void entry_changed_cb (GtkWidget *entry,
|
||||
NautilusLoginView *view);
|
||||
static void login_button_cb (GtkWidget *button,
|
||||
NautilusLoginView *view);
|
||||
static void maintenance_button_cb (GtkWidget *button,
|
||||
NautilusLoginView *view);
|
||||
static void go_to_uri (NautilusLoginView *view,
|
||||
char *uri);
|
||||
static GtkWidget* create_title_widget (const char *title_text);
|
||||
static GtkWidget* create_graphic_widget (const char *icon_name,
|
||||
const char *background_color_spec,
|
||||
NautilusGraphicPlacementType placement);
|
||||
static void nautilus_login_view_initialize_class (NautilusLoginViewClass *klass);
|
||||
static void nautilus_login_view_initialize (NautilusLoginView *view);
|
||||
static void nautilus_login_view_destroy (GtkObject *object);
|
||||
static void login_load_location_callback (NautilusView *nautilus_view,
|
||||
const char *location,
|
||||
NautilusLoginView *view);
|
||||
static void show_feedback (NautilusLoginView *view,
|
||||
char *error_message);
|
||||
static void generate_login_form (NautilusLoginView *view);
|
||||
static void entry_changed_cb (GtkWidget *entry,
|
||||
NautilusLoginView *view);
|
||||
static void login_button_cb (GtkWidget *button,
|
||||
NautilusLoginView *view);
|
||||
static void maintenance_button_cb (GtkWidget *button,
|
||||
NautilusLoginView *view);
|
||||
static void go_to_uri (NautilusLoginView *view,
|
||||
char *uri);
|
||||
static GtkWidget* create_title_widget (const char *title_text);
|
||||
static GtkWidget* create_image_widget (const char *icon_name,
|
||||
const char *background_color_spec,
|
||||
NautilusImagePlacementType placement);
|
||||
|
||||
NAUTILUS_DEFINE_CLASS_BOILERPLATE (NautilusLoginView, nautilus_login_view, GTK_TYPE_EVENT_BOX)
|
||||
|
||||
static void
|
||||
generate_login_form (NautilusLoginView *view) {
|
||||
|
||||
generate_login_form (NautilusLoginView *view)
|
||||
{
|
||||
GtkTable *table;
|
||||
GtkWidget *temp_widget;
|
||||
GtkWidget *temp_box;
|
||||
|
@ -339,24 +339,24 @@ login_load_location_callback (NautilusView *nautilus_view,
|
|||
}
|
||||
|
||||
/* FIXME bugzilla.eazel.com xxxx:
|
||||
* create_graphic_widget() and create_title_widget() are cut-n-pasted from
|
||||
* create_image_widget() and create_title_widget() are cut-n-pasted from
|
||||
* components/services/install/nautilus-view/nautilus-service-install-view.c
|
||||
* These should be put in a common place.
|
||||
*/
|
||||
static GtkWidget*
|
||||
create_graphic_widget (const char *icon_name,
|
||||
const char *background_color_spec,
|
||||
NautilusGraphicPlacementType placement)
|
||||
create_image_widget (const char *icon_name,
|
||||
const char *background_color_spec,
|
||||
NautilusImagePlacementType placement)
|
||||
{
|
||||
char *path;
|
||||
GtkWidget *graphic;
|
||||
GtkWidget *image;
|
||||
GdkPixbuf *pixbuf;
|
||||
guint32 background_rgb;
|
||||
|
||||
g_return_val_if_fail (icon_name != NULL, NULL);
|
||||
g_return_val_if_fail (background_color_spec != NULL, NULL);
|
||||
|
||||
graphic = nautilus_graphic_new();
|
||||
image = nautilus_image_new();
|
||||
|
||||
path = nautilus_pixmap_file (icon_name);
|
||||
|
||||
|
@ -364,68 +364,68 @@ create_graphic_widget (const char *icon_name,
|
|||
g_free (path);
|
||||
|
||||
if (pixbuf != NULL) {
|
||||
nautilus_graphic_set_pixbuf (NAUTILUS_GRAPHIC (graphic), pixbuf);
|
||||
nautilus_image_set_pixbuf (NAUTILUS_IMAGE (image), pixbuf);
|
||||
gdk_pixbuf_unref (pixbuf);
|
||||
}
|
||||
else {
|
||||
g_warning ("Could not find the requested icon.");
|
||||
}
|
||||
|
||||
nautilus_graphic_set_background_type (NAUTILUS_GRAPHIC (graphic),
|
||||
NAUTILUS_GRAPHIC_BACKGROUND_SOLID);
|
||||
nautilus_image_set_background_type (NAUTILUS_IMAGE (image),
|
||||
NAUTILUS_IMAGE_BACKGROUND_SOLID);
|
||||
|
||||
background_rgb = nautilus_parse_rgb_with_white_default (background_color_spec);
|
||||
|
||||
nautilus_graphic_set_background_color (NAUTILUS_GRAPHIC (graphic),
|
||||
background_rgb);
|
||||
nautilus_image_set_background_color (NAUTILUS_IMAGE (image),
|
||||
background_rgb);
|
||||
|
||||
nautilus_graphic_set_placement_type (NAUTILUS_GRAPHIC (graphic), placement);
|
||||
nautilus_image_set_placement_type (NAUTILUS_IMAGE (image), placement);
|
||||
|
||||
return graphic;
|
||||
return image;
|
||||
}
|
||||
|
||||
static GtkWidget*
|
||||
create_title_widget (const char *title_text)
|
||||
{
|
||||
GtkWidget *title_hbox;
|
||||
GtkWidget *logo_graphic;
|
||||
GtkWidget *filler_graphic;
|
||||
GtkWidget *text_graphic;
|
||||
GtkWidget *logo_image;
|
||||
GtkWidget *filler_image;
|
||||
GtkWidget *text_image;
|
||||
GdkFont *font;
|
||||
|
||||
g_assert (title_text != NULL);
|
||||
|
||||
title_hbox = gtk_hbox_new (FALSE, 0);
|
||||
|
||||
logo_graphic = create_graphic_widget ("eazel-services-logo.png",
|
||||
SERVICE_VIEW_DEFAULT_BACKGROUND_COLOR,
|
||||
NAUTILUS_GRAPHIC_PLACEMENT_CENTER);
|
||||
logo_image = create_image_widget ("eazel-services-logo.png",
|
||||
SERVICE_VIEW_DEFAULT_BACKGROUND_COLOR,
|
||||
NAUTILUS_IMAGE_PLACEMENT_CENTER);
|
||||
|
||||
filler_graphic = create_graphic_widget ("eazel-services-logo-tile.png",
|
||||
SERVICE_VIEW_DEFAULT_BACKGROUND_COLOR,
|
||||
NAUTILUS_GRAPHIC_PLACEMENT_TILE);
|
||||
|
||||
text_graphic = create_graphic_widget ("eazel-services-logo-tile.png",
|
||||
SERVICE_VIEW_DEFAULT_BACKGROUND_COLOR,
|
||||
NAUTILUS_GRAPHIC_PLACEMENT_TILE);
|
||||
filler_image = create_image_widget ("eazel-services-logo-tile.png",
|
||||
SERVICE_VIEW_DEFAULT_BACKGROUND_COLOR,
|
||||
NAUTILUS_IMAGE_PLACEMENT_TILE);
|
||||
|
||||
text_image = create_image_widget ("eazel-services-logo-tile.png",
|
||||
SERVICE_VIEW_DEFAULT_BACKGROUND_COLOR,
|
||||
NAUTILUS_IMAGE_PLACEMENT_TILE);
|
||||
|
||||
font = nautilus_font_factory_get_font_by_family ("helvetica", 20);
|
||||
|
||||
nautilus_graphic_set_label_text (NAUTILUS_GRAPHIC (text_graphic), title_text);
|
||||
nautilus_graphic_set_label_font (NAUTILUS_GRAPHIC (text_graphic), font);
|
||||
nautilus_graphic_set_extra_width (NAUTILUS_GRAPHIC (text_graphic), 8);
|
||||
nautilus_graphic_set_right_offset (NAUTILUS_GRAPHIC (text_graphic), 8);
|
||||
nautilus_graphic_set_top_offset (NAUTILUS_GRAPHIC (text_graphic), 3);
|
||||
nautilus_image_set_label_text (NAUTILUS_IMAGE (text_image), title_text);
|
||||
nautilus_image_set_label_font (NAUTILUS_IMAGE (text_image), font);
|
||||
nautilus_image_set_extra_width (NAUTILUS_IMAGE (text_image), 8);
|
||||
nautilus_image_set_right_offset (NAUTILUS_IMAGE (text_image), 8);
|
||||
nautilus_image_set_top_offset (NAUTILUS_IMAGE (text_image), 3);
|
||||
|
||||
gdk_font_unref (font);
|
||||
|
||||
gtk_widget_show (logo_graphic);
|
||||
gtk_widget_show (filler_graphic);
|
||||
gtk_widget_show (text_graphic);
|
||||
gtk_widget_show (logo_image);
|
||||
gtk_widget_show (filler_image);
|
||||
gtk_widget_show (text_image);
|
||||
|
||||
gtk_box_pack_start (GTK_BOX (title_hbox), logo_graphic, FALSE, FALSE, 0);
|
||||
gtk_box_pack_start (GTK_BOX (title_hbox), filler_graphic, TRUE, TRUE, 0);
|
||||
gtk_box_pack_end (GTK_BOX (title_hbox), text_graphic, FALSE, FALSE, 0);
|
||||
gtk_box_pack_start (GTK_BOX (title_hbox), logo_image, FALSE, FALSE, 0);
|
||||
gtk_box_pack_start (GTK_BOX (title_hbox), filler_image, TRUE, TRUE, 0);
|
||||
gtk_box_pack_end (GTK_BOX (title_hbox), text_image, FALSE, FALSE, 0);
|
||||
|
||||
return title_hbox;
|
||||
}
|
||||
|
|
|
@ -43,7 +43,7 @@
|
|||
#include <libnautilus-extensions/nautilus-string.h>
|
||||
#include <libnautilus-extensions/nautilus-icon-factory.h>
|
||||
#include <libnautilus-extensions/nautilus-font-factory.h>
|
||||
#include <libnautilus-extensions/nautilus-graphic.h>
|
||||
#include <libnautilus-extensions/nautilus-image.h>
|
||||
#include <stdio.h>
|
||||
|
||||
#include "nautilus-service-startup-view.h"
|
||||
|
@ -60,31 +60,32 @@ struct _NautilusServiceStartupViewDetails {
|
|||
#define SERVICE_VIEW_DEFAULT_BACKGROUND_COLOR "rgb:0000/6666/6666"
|
||||
#define SERVICE_DOMAIN_NAME "testmachine.eazel.com"
|
||||
|
||||
static void nautilus_service_startup_view_initialize_class (NautilusServiceStartupViewClass *klass);
|
||||
static void nautilus_service_startup_view_initialize (NautilusServiceStartupView *view);
|
||||
static void nautilus_service_startup_view_destroy (GtkObject *object);
|
||||
|
||||
|
||||
static void nautilus_service_startup_view_initialize_class (NautilusServiceStartupViewClass *klass);
|
||||
static void nautilus_service_startup_view_initialize (NautilusServiceStartupView *view);
|
||||
static void nautilus_service_startup_view_destroy (GtkObject *object);
|
||||
static void service_load_location_callback (NautilusView *view,
|
||||
const char *location,
|
||||
NautilusServiceStartupView *services);
|
||||
static gboolean is_location (char *document_str,
|
||||
const char *place_str);
|
||||
static void generate_form_logo (NautilusServiceStartupView *view);
|
||||
static void set_widget_color (GtkWidget *widget,
|
||||
const char *color_spec);
|
||||
static void go_to_uri (NautilusServiceStartupView *view,
|
||||
char *uri);
|
||||
static void show_feedback (NautilusServiceStartupView *view,
|
||||
char *error_message);
|
||||
static GtkWidget* create_image_widget (const char *name,
|
||||
const char *background_color_spec);
|
||||
|
||||
NAUTILUS_DEFINE_CLASS_BOILERPLATE (NautilusServiceStartupView, nautilus_service_startup_view, GTK_TYPE_EVENT_BOX)
|
||||
|
||||
static void service_load_location_callback (NautilusView *view,
|
||||
const char *location,
|
||||
NautilusServiceStartupView *services);
|
||||
static gboolean is_location (char *document_str,
|
||||
const char *place_str);
|
||||
static void generate_form_logo (NautilusServiceStartupView *view);
|
||||
static void set_widget_color (GtkWidget *widget,
|
||||
const char *color_spec);
|
||||
static void go_to_uri (NautilusServiceStartupView *view,
|
||||
char *uri);
|
||||
static void show_feedback (NautilusServiceStartupView *view,
|
||||
char *error_message);
|
||||
static GtkWidget* create_graphic_widget (const char *name,
|
||||
const char *background_color_spec);
|
||||
|
||||
/* create the startup view */
|
||||
static void
|
||||
generate_startup_form (NautilusServiceStartupView *view) {
|
||||
|
||||
generate_startup_form (NautilusServiceStartupView *view)
|
||||
{
|
||||
GtkWidget *temp_widget;
|
||||
GtkWidget *temp_box;
|
||||
GtkWidget *align;
|
||||
|
@ -110,7 +111,7 @@ generate_startup_form (NautilusServiceStartupView *view) {
|
|||
gtk_box_pack_start (GTK_BOX (view->details->form), temp_box, 0, 0, 40);
|
||||
gtk_widget_show (temp_box);
|
||||
|
||||
temp_widget = create_graphic_widget ("service-watch.png", SERVICE_VIEW_DEFAULT_BACKGROUND_COLOR);
|
||||
temp_widget = create_image_widget ("service-watch.png", SERVICE_VIEW_DEFAULT_BACKGROUND_COLOR);
|
||||
g_assert (temp_widget != NULL);
|
||||
|
||||
gtk_box_pack_start (GTK_BOX (temp_box), temp_widget, 0, 0, 8);
|
||||
|
@ -213,10 +214,10 @@ set_widget_color (GtkWidget *widget, const char* color_spec) {
|
|||
/* shared utility to allocate a title for a form */
|
||||
|
||||
static GtkWidget*
|
||||
create_graphic_widget (const char *name, const char *background_color_spec)
|
||||
create_image_widget (const char *name, const char *background_color_spec)
|
||||
{
|
||||
char *path;
|
||||
GtkWidget *graphic;
|
||||
GtkWidget *image;
|
||||
GdkPixbuf *pixbuf;
|
||||
guint32 background_rgb;
|
||||
|
||||
|
@ -232,20 +233,20 @@ create_graphic_widget (const char *name, const char *background_color_spec)
|
|||
return NULL;
|
||||
}
|
||||
|
||||
graphic = nautilus_graphic_new();
|
||||
image = nautilus_image_new();
|
||||
|
||||
nautilus_graphic_set_background_type (NAUTILUS_GRAPHIC (graphic),
|
||||
NAUTILUS_GRAPHIC_BACKGROUND_SOLID);
|
||||
nautilus_image_set_background_type (NAUTILUS_IMAGE (image),
|
||||
NAUTILUS_IMAGE_BACKGROUND_SOLID);
|
||||
|
||||
background_rgb = nautilus_parse_rgb_with_white_default (background_color_spec);
|
||||
|
||||
nautilus_image_set_background_color (NAUTILUS_IMAGE (image),
|
||||
background_rgb);
|
||||
|
||||
nautilus_graphic_set_background_color (NAUTILUS_GRAPHIC (graphic),
|
||||
background_rgb);
|
||||
|
||||
nautilus_graphic_set_pixbuf (NAUTILUS_GRAPHIC (graphic), pixbuf);
|
||||
nautilus_image_set_pixbuf (NAUTILUS_IMAGE (image), pixbuf);
|
||||
gdk_pixbuf_unref (pixbuf);
|
||||
|
||||
return graphic;
|
||||
return image;
|
||||
}
|
||||
|
||||
static void
|
||||
|
@ -257,7 +258,7 @@ generate_form_logo (NautilusServiceStartupView *view) {
|
|||
logo_container = gtk_hbox_new (TRUE, 0);
|
||||
gtk_box_pack_start (GTK_BOX (view->details->form), logo_container, 0, 0, 4);
|
||||
|
||||
logo_widget = create_graphic_widget ("startup-logo.png", SERVICE_VIEW_DEFAULT_BACKGROUND_COLOR);
|
||||
logo_widget = create_image_widget ("startup-logo.png", SERVICE_VIEW_DEFAULT_BACKGROUND_COLOR);
|
||||
g_assert (logo_widget != NULL);
|
||||
|
||||
gtk_box_pack_start (GTK_BOX(logo_container), logo_widget, 0, 0, 4);
|
||||
|
|
|
@ -54,7 +54,6 @@ libnautilus_extensions_la_SOURCES = \
|
|||
nautilus-glib-extensions.c \
|
||||
nautilus-global-preferences.c \
|
||||
nautilus-gnome-extensions.c \
|
||||
nautilus-graphic.c \
|
||||
nautilus-graphic-effects.c \
|
||||
nautilus-gtk-extensions.c \
|
||||
nautilus-horizontal-splitter.c \
|
||||
|
@ -63,6 +62,7 @@ libnautilus_extensions_la_SOURCES = \
|
|||
nautilus-icon-dnd.c \
|
||||
nautilus-icon-factory.c \
|
||||
nautilus-icon-text-item.c \
|
||||
nautilus-image.c \
|
||||
nautilus-keep-last-vertical-box.c \
|
||||
nautilus-lib-self-check-functions.c \
|
||||
nautilus-link-set.c \
|
||||
|
@ -128,7 +128,6 @@ noinst_HEADERS = \
|
|||
nautilus-global-preferences.h \
|
||||
nautilus-gnome-extensions.h \
|
||||
nautilus-graphic-effects.h \
|
||||
nautilus-graphic.h \
|
||||
nautilus-gtk-extensions.h \
|
||||
nautilus-gtk-macros.h \
|
||||
nautilus-horizontal-splitter.h \
|
||||
|
@ -138,6 +137,7 @@ noinst_HEADERS = \
|
|||
nautilus-icon-factory.h \
|
||||
nautilus-icon-private.h \
|
||||
nautilus-icon-text-item.h \
|
||||
nautilus-image.h \
|
||||
nautilus-keep-last-vertical-box.h \
|
||||
nautilus-lib-self-check-functions.h \
|
||||
nautilus-link-set.h \
|
||||
|
|
|
@ -1,129 +0,0 @@
|
|||
/* -*- Mode: C; indent-tabs-mode: t; c-basic-offset: 8; tab-width: 8 -*- */
|
||||
|
||||
/* nautilus-graphic.h - A widget to display a composited pixbuf.
|
||||
|
||||
Copyright (C) 1999, 2000 Eazel, Inc.
|
||||
|
||||
The Gnome Library is free software; you can redistribute it and/or
|
||||
modify it under the terms of the GNU Library General Public License as
|
||||
published by the Free Software Foundation; either version 2 of the
|
||||
License, or (at your option) any later version.
|
||||
|
||||
The Gnome Library 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
|
||||
Library General Public License for more details.
|
||||
|
||||
You should have received a copy of the GNU Library General Public
|
||||
License along with the Gnome Library; see the file COPYING.LIB. If not,
|
||||
write to the Free Software Foundation, Inc., 59 Temple Place - Suite 330,
|
||||
Boston, MA 02111-1307, USA.
|
||||
|
||||
Authors: Ramiro Estrugo <ramiro@eazel.com>
|
||||
*/
|
||||
|
||||
#ifndef NAUTILUS_GRAPHIC_H
|
||||
#define NAUTILUS_GRAPHIC_H
|
||||
|
||||
#include <gtk/gtkwidget.h>
|
||||
#include <libgnome/gnome-defs.h>
|
||||
#include <gdk-pixbuf/gdk-pixbuf.h>
|
||||
|
||||
/* NautilusGraphic is GtkWidget that can display a GdkPixbuf. This pixbuf
|
||||
* will be composited with full alpha support on wither a solid background
|
||||
* or a background pixbuf.
|
||||
*/
|
||||
|
||||
BEGIN_GNOME_DECLS
|
||||
|
||||
#define NAUTILUS_TYPE_GRAPHIC (nautilus_graphic_get_type ())
|
||||
#define NAUTILUS_GRAPHIC(obj) (GTK_CHECK_CAST ((obj), NAUTILUS_TYPE_GRAPHIC, NautilusGraphic))
|
||||
#define NAUTILUS_GRAPHIC_CLASS(klass) (GTK_CHECK_CLASS_CAST ((klass), NAUTILUS_TYPE_GRAPHIC, NautilusGraphicClass))
|
||||
#define NAUTILUS_IS_GRAPHIC(obj) (GTK_CHECK_TYPE ((obj), NAUTILUS_TYPE_GRAPHIC))
|
||||
#define NAUTILUS_IS_GRAPHIC_CLASS(klass) (GTK_CHECK_CLASS_TYPE ((klass), NAUTILUS_TYPE_GRAPHIC))
|
||||
|
||||
typedef struct _NautilusGraphic NautilusGraphic;
|
||||
typedef struct _NautilusGraphicClass NautilusGraphicClass;
|
||||
typedef struct _NautilusGraphicDetail NautilusGraphicDetail;
|
||||
|
||||
struct _NautilusGraphic
|
||||
{
|
||||
/* Superclass */
|
||||
GtkWidget widget;
|
||||
|
||||
/* Private things */
|
||||
NautilusGraphicDetail *detail;
|
||||
};
|
||||
|
||||
struct _NautilusGraphicClass
|
||||
{
|
||||
GtkWidgetClass parent_class;
|
||||
};
|
||||
|
||||
typedef enum
|
||||
{
|
||||
NAUTILUS_GRAPHIC_PLACEMENT_TILE,
|
||||
NAUTILUS_GRAPHIC_PLACEMENT_CENTER
|
||||
} NautilusGraphicPlacementType;
|
||||
|
||||
typedef enum
|
||||
{
|
||||
NAUTILUS_GRAPHIC_BACKGROUND_PIXBUF,
|
||||
NAUTILUS_GRAPHIC_BACKGROUND_SOLID,
|
||||
} NautilusGraphicBackgroundType;
|
||||
|
||||
/* Pack RGBA components */
|
||||
#define NAUTILUS_RGBA_COLOR_PACK(_r, _g, _b, _a) \
|
||||
( ((_a) << 24) | \
|
||||
((_r) << 16) | \
|
||||
((_g) << 8) | \
|
||||
((_b) << 0) )
|
||||
|
||||
/* Access RGBA components */
|
||||
#define NAUTILUS_RGBA_COLOR_GET_R(_color) (((_color) >> 16) & 0xff)
|
||||
#define NAUTILUS_RGBA_COLOR_GET_G(_color) (((_color) >> 8) & 0xff)
|
||||
#define NAUTILUS_RGBA_COLOR_GET_B(_color) (((_color) >> 0) & 0xff)
|
||||
#define NAUTILUS_RGBA_COLOR_GET_A(_color) (((_color) >> 24) & 0xff)
|
||||
|
||||
GtkType nautilus_graphic_get_type (void);
|
||||
GtkWidget * nautilus_graphic_new (void);
|
||||
void nautilus_graphic_set_background_pixbuf (NautilusGraphic *graphic,
|
||||
GdkPixbuf *background);
|
||||
GdkPixbuf* nautilus_graphic_get_background_pixbuf (const NautilusGraphic *graphic);
|
||||
void nautilus_graphic_set_background_type (NautilusGraphic *graphic,
|
||||
NautilusGraphicBackgroundType background_type);
|
||||
NautilusGraphicBackgroundType nautilus_graphic_get_background_type (const NautilusGraphic *graphic);
|
||||
void nautilus_graphic_set_placement_type (NautilusGraphic *graphic,
|
||||
NautilusGraphicPlacementType placement);
|
||||
NautilusGraphicPlacementType nautilus_graphic_get_placement_type (const NautilusGraphic *graphic);
|
||||
void nautilus_graphic_set_background_color (NautilusGraphic *graphic,
|
||||
guint32 color);
|
||||
guint32 nautilus_graphic_get_background_color (const NautilusGraphic *graphic);
|
||||
void nautilus_graphic_set_pixbuf (NautilusGraphic *graphic,
|
||||
GdkPixbuf *pixbuf);
|
||||
GdkPixbuf* nautilus_graphic_get_pixbuf (const NautilusGraphic *graphic);
|
||||
void nautilus_graphic_set_overall_alpha (NautilusGraphic *graphic,
|
||||
guchar pixbuf_alpha);
|
||||
void nautilus_graphic_set_label_text (NautilusGraphic *graphic,
|
||||
const gchar *text);
|
||||
gchar* nautilus_graphic_get_label_text (NautilusGraphic *graphic);
|
||||
void nautilus_graphic_set_label_font (NautilusGraphic *graphic,
|
||||
GdkFont *font);
|
||||
GdkFont* nautilus_graphic_get_label_font (NautilusGraphic *graphic);
|
||||
void nautilus_graphic_set_left_offset (NautilusGraphic *graphic,
|
||||
guint left_offset);
|
||||
void nautilus_graphic_set_right_offset (NautilusGraphic *graphic,
|
||||
guint right_offset);
|
||||
void nautilus_graphic_set_top_offset (NautilusGraphic *graphic,
|
||||
guint top_offset);
|
||||
void nautilus_graphic_set_bottom_offset (NautilusGraphic *graphic,
|
||||
guint bottom_offset);
|
||||
void nautilus_graphic_set_extra_width (NautilusGraphic *graphic,
|
||||
guint extra_width);
|
||||
void nautilus_graphic_set_extra_height (NautilusGraphic *graphic,
|
||||
guint extra_width);
|
||||
END_GNOME_DECLS
|
||||
|
||||
#endif /* NAUTILUS_GRAPHIC_H */
|
||||
|
||||
|
File diff suppressed because it is too large
Load diff
131
libnautilus-extensions/nautilus-image.h
Normal file
131
libnautilus-extensions/nautilus-image.h
Normal file
|
@ -0,0 +1,131 @@
|
|||
/* -*- Mode: C; indent-tabs-mode: t; c-basic-offset: 8; tab-width: 8 -*- */
|
||||
|
||||
/* nautilus-image.h - A widget to display a composited pixbuf.
|
||||
|
||||
Copyright (C) 1999, 2000 Eazel, Inc.
|
||||
|
||||
The Gnome Library is free software; you can redistribute it and/or
|
||||
modify it under the terms of the GNU Library General Public License as
|
||||
published by the Free Software Foundation; either version 2 of the
|
||||
License, or (at your option) any later version.
|
||||
|
||||
The Gnome Library 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
|
||||
Library General Public License for more details.
|
||||
|
||||
You should have received a copy of the GNU Library General Public
|
||||
License along with the Gnome Library; see the file COPYING.LIB. If not,
|
||||
write to the Free Software Foundation, Inc., 59 Temple Place - Suite 330,
|
||||
Boston, MA 02111-1307, USA.
|
||||
|
||||
Authors: Ramiro Estrugo <ramiro@eazel.com>
|
||||
*/
|
||||
|
||||
#ifndef NAUTILUS_IMAGE_H
|
||||
#define NAUTILUS_IMAGE_H
|
||||
|
||||
#include <gtk/gtkwidget.h>
|
||||
#include <libgnome/gnome-defs.h>
|
||||
#include <gdk-pixbuf/gdk-pixbuf.h>
|
||||
|
||||
/* NautilusImage is GtkWidget that can display a GdkPixbuf. This pixbuf
|
||||
* will be composited with full alpha support on wither a solid background
|
||||
* or a background pixbuf.
|
||||
*/
|
||||
|
||||
BEGIN_GNOME_DECLS
|
||||
|
||||
#define NAUTILUS_TYPE_IMAGE (nautilus_image_get_type ())
|
||||
#define NAUTILUS_IMAGE(obj) (GTK_CHECK_CAST ((obj), NAUTILUS_TYPE_IMAGE, NautilusImage))
|
||||
#define NAUTILUS_IMAGE_CLASS(klass) (GTK_CHECK_CLASS_CAST ((klass), NAUTILUS_TYPE_IMAGE, NautilusImageClass))
|
||||
#define NAUTILUS_IS_IMAGE(obj) (GTK_CHECK_TYPE ((obj), NAUTILUS_TYPE_IMAGE))
|
||||
#define NAUTILUS_IS_IMAGE_CLASS(klass) (GTK_CHECK_CLASS_TYPE ((klass), NAUTILUS_TYPE_IMAGE))
|
||||
|
||||
typedef struct _NautilusImage NautilusImage;
|
||||
typedef struct _NautilusImageClass NautilusImageClass;
|
||||
typedef struct _NautilusImageDetail NautilusImageDetail;
|
||||
|
||||
struct _NautilusImage
|
||||
{
|
||||
/* Superclass */
|
||||
GtkWidget widget;
|
||||
|
||||
/* Private things */
|
||||
NautilusImageDetail *detail;
|
||||
};
|
||||
|
||||
struct _NautilusImageClass
|
||||
{
|
||||
GtkWidgetClass parent_class;
|
||||
};
|
||||
|
||||
typedef enum
|
||||
{
|
||||
NAUTILUS_IMAGE_PLACEMENT_TILE,
|
||||
NAUTILUS_IMAGE_PLACEMENT_CENTER
|
||||
} NautilusImagePlacementType;
|
||||
|
||||
typedef enum
|
||||
{
|
||||
NAUTILUS_IMAGE_BACKGROUND_PIXBUF,
|
||||
NAUTILUS_IMAGE_BACKGROUND_SOLID,
|
||||
} NautilusImageBackgroundType;
|
||||
|
||||
/* Pack RGBA components */
|
||||
#define NAUTILUS_RGBA_COLOR_PACK(_r, _g, _b, _a) \
|
||||
( ((_a) << 24) | \
|
||||
((_r) << 16) | \
|
||||
((_g) << 8) | \
|
||||
((_b) << 0) )
|
||||
|
||||
/* Access RGBA components */
|
||||
#define NAUTILUS_RGBA_COLOR_GET_R(_color) (((_color) >> 16) & 0xff)
|
||||
#define NAUTILUS_RGBA_COLOR_GET_G(_color) (((_color) >> 8) & 0xff)
|
||||
#define NAUTILUS_RGBA_COLOR_GET_B(_color) (((_color) >> 0) & 0xff)
|
||||
#define NAUTILUS_RGBA_COLOR_GET_A(_color) (((_color) >> 24) & 0xff)
|
||||
|
||||
GtkType nautilus_image_get_type (void);
|
||||
GtkWidget * nautilus_image_new (void);
|
||||
void nautilus_image_set_background_pixbuf (NautilusImage *image,
|
||||
GdkPixbuf *background);
|
||||
GdkPixbuf* nautilus_image_get_background_pixbuf (const NautilusImage *image);
|
||||
void nautilus_image_set_background_type (NautilusImage *image,
|
||||
NautilusImageBackgroundType background_type);
|
||||
NautilusImageBackgroundType nautilus_image_get_background_type (const NautilusImage *image);
|
||||
void nautilus_image_set_placement_type (NautilusImage *image,
|
||||
NautilusImagePlacementType placement);
|
||||
NautilusImagePlacementType nautilus_image_get_placement_type (const NautilusImage *image);
|
||||
void nautilus_image_set_background_color (NautilusImage *image,
|
||||
guint32 color);
|
||||
guint32 nautilus_image_get_background_color (const NautilusImage *image);
|
||||
void nautilus_image_set_pixbuf (NautilusImage *image,
|
||||
GdkPixbuf *pixbuf);
|
||||
GdkPixbuf* nautilus_image_get_pixbuf (const NautilusImage *image);
|
||||
void nautilus_image_set_overall_alpha (NautilusImage *image,
|
||||
guchar pixbuf_alpha);
|
||||
void nautilus_image_set_label_text (NautilusImage *image,
|
||||
const gchar *text);
|
||||
gchar* nautilus_image_get_label_text (NautilusImage *image);
|
||||
void nautilus_image_set_label_font (NautilusImage *image,
|
||||
GdkFont *font);
|
||||
GdkFont* nautilus_image_get_label_font (NautilusImage *image);
|
||||
void nautilus_image_set_left_offset (NautilusImage *image,
|
||||
guint left_offset);
|
||||
void nautilus_image_set_right_offset (NautilusImage *image,
|
||||
guint right_offset);
|
||||
void nautilus_image_set_top_offset (NautilusImage *image,
|
||||
guint top_offset);
|
||||
void nautilus_image_set_bottom_offset (NautilusImage *image,
|
||||
guint bottom_offset);
|
||||
void nautilus_image_set_extra_width (NautilusImage *image,
|
||||
guint extra_width);
|
||||
void nautilus_image_set_extra_height (NautilusImage *image,
|
||||
guint extra_width);
|
||||
|
||||
|
||||
END_GNOME_DECLS
|
||||
|
||||
#endif /* NAUTILUS_IMAGE_H */
|
||||
|
||||
|
|
@ -54,7 +54,6 @@ libnautilus_extensions_la_SOURCES = \
|
|||
nautilus-glib-extensions.c \
|
||||
nautilus-global-preferences.c \
|
||||
nautilus-gnome-extensions.c \
|
||||
nautilus-graphic.c \
|
||||
nautilus-graphic-effects.c \
|
||||
nautilus-gtk-extensions.c \
|
||||
nautilus-horizontal-splitter.c \
|
||||
|
@ -63,6 +62,7 @@ libnautilus_extensions_la_SOURCES = \
|
|||
nautilus-icon-dnd.c \
|
||||
nautilus-icon-factory.c \
|
||||
nautilus-icon-text-item.c \
|
||||
nautilus-image.c \
|
||||
nautilus-keep-last-vertical-box.c \
|
||||
nautilus-lib-self-check-functions.c \
|
||||
nautilus-link-set.c \
|
||||
|
@ -128,7 +128,6 @@ noinst_HEADERS = \
|
|||
nautilus-global-preferences.h \
|
||||
nautilus-gnome-extensions.h \
|
||||
nautilus-graphic-effects.h \
|
||||
nautilus-graphic.h \
|
||||
nautilus-gtk-extensions.h \
|
||||
nautilus-gtk-macros.h \
|
||||
nautilus-horizontal-splitter.h \
|
||||
|
@ -138,6 +137,7 @@ noinst_HEADERS = \
|
|||
nautilus-icon-factory.h \
|
||||
nautilus-icon-private.h \
|
||||
nautilus-icon-text-item.h \
|
||||
nautilus-image.h \
|
||||
nautilus-keep-last-vertical-box.h \
|
||||
nautilus-lib-self-check-functions.h \
|
||||
nautilus-link-set.h \
|
||||
|
|
|
@ -1,129 +0,0 @@
|
|||
/* -*- Mode: C; indent-tabs-mode: t; c-basic-offset: 8; tab-width: 8 -*- */
|
||||
|
||||
/* nautilus-graphic.h - A widget to display a composited pixbuf.
|
||||
|
||||
Copyright (C) 1999, 2000 Eazel, Inc.
|
||||
|
||||
The Gnome Library is free software; you can redistribute it and/or
|
||||
modify it under the terms of the GNU Library General Public License as
|
||||
published by the Free Software Foundation; either version 2 of the
|
||||
License, or (at your option) any later version.
|
||||
|
||||
The Gnome Library 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
|
||||
Library General Public License for more details.
|
||||
|
||||
You should have received a copy of the GNU Library General Public
|
||||
License along with the Gnome Library; see the file COPYING.LIB. If not,
|
||||
write to the Free Software Foundation, Inc., 59 Temple Place - Suite 330,
|
||||
Boston, MA 02111-1307, USA.
|
||||
|
||||
Authors: Ramiro Estrugo <ramiro@eazel.com>
|
||||
*/
|
||||
|
||||
#ifndef NAUTILUS_GRAPHIC_H
|
||||
#define NAUTILUS_GRAPHIC_H
|
||||
|
||||
#include <gtk/gtkwidget.h>
|
||||
#include <libgnome/gnome-defs.h>
|
||||
#include <gdk-pixbuf/gdk-pixbuf.h>
|
||||
|
||||
/* NautilusGraphic is GtkWidget that can display a GdkPixbuf. This pixbuf
|
||||
* will be composited with full alpha support on wither a solid background
|
||||
* or a background pixbuf.
|
||||
*/
|
||||
|
||||
BEGIN_GNOME_DECLS
|
||||
|
||||
#define NAUTILUS_TYPE_GRAPHIC (nautilus_graphic_get_type ())
|
||||
#define NAUTILUS_GRAPHIC(obj) (GTK_CHECK_CAST ((obj), NAUTILUS_TYPE_GRAPHIC, NautilusGraphic))
|
||||
#define NAUTILUS_GRAPHIC_CLASS(klass) (GTK_CHECK_CLASS_CAST ((klass), NAUTILUS_TYPE_GRAPHIC, NautilusGraphicClass))
|
||||
#define NAUTILUS_IS_GRAPHIC(obj) (GTK_CHECK_TYPE ((obj), NAUTILUS_TYPE_GRAPHIC))
|
||||
#define NAUTILUS_IS_GRAPHIC_CLASS(klass) (GTK_CHECK_CLASS_TYPE ((klass), NAUTILUS_TYPE_GRAPHIC))
|
||||
|
||||
typedef struct _NautilusGraphic NautilusGraphic;
|
||||
typedef struct _NautilusGraphicClass NautilusGraphicClass;
|
||||
typedef struct _NautilusGraphicDetail NautilusGraphicDetail;
|
||||
|
||||
struct _NautilusGraphic
|
||||
{
|
||||
/* Superclass */
|
||||
GtkWidget widget;
|
||||
|
||||
/* Private things */
|
||||
NautilusGraphicDetail *detail;
|
||||
};
|
||||
|
||||
struct _NautilusGraphicClass
|
||||
{
|
||||
GtkWidgetClass parent_class;
|
||||
};
|
||||
|
||||
typedef enum
|
||||
{
|
||||
NAUTILUS_GRAPHIC_PLACEMENT_TILE,
|
||||
NAUTILUS_GRAPHIC_PLACEMENT_CENTER
|
||||
} NautilusGraphicPlacementType;
|
||||
|
||||
typedef enum
|
||||
{
|
||||
NAUTILUS_GRAPHIC_BACKGROUND_PIXBUF,
|
||||
NAUTILUS_GRAPHIC_BACKGROUND_SOLID,
|
||||
} NautilusGraphicBackgroundType;
|
||||
|
||||
/* Pack RGBA components */
|
||||
#define NAUTILUS_RGBA_COLOR_PACK(_r, _g, _b, _a) \
|
||||
( ((_a) << 24) | \
|
||||
((_r) << 16) | \
|
||||
((_g) << 8) | \
|
||||
((_b) << 0) )
|
||||
|
||||
/* Access RGBA components */
|
||||
#define NAUTILUS_RGBA_COLOR_GET_R(_color) (((_color) >> 16) & 0xff)
|
||||
#define NAUTILUS_RGBA_COLOR_GET_G(_color) (((_color) >> 8) & 0xff)
|
||||
#define NAUTILUS_RGBA_COLOR_GET_B(_color) (((_color) >> 0) & 0xff)
|
||||
#define NAUTILUS_RGBA_COLOR_GET_A(_color) (((_color) >> 24) & 0xff)
|
||||
|
||||
GtkType nautilus_graphic_get_type (void);
|
||||
GtkWidget * nautilus_graphic_new (void);
|
||||
void nautilus_graphic_set_background_pixbuf (NautilusGraphic *graphic,
|
||||
GdkPixbuf *background);
|
||||
GdkPixbuf* nautilus_graphic_get_background_pixbuf (const NautilusGraphic *graphic);
|
||||
void nautilus_graphic_set_background_type (NautilusGraphic *graphic,
|
||||
NautilusGraphicBackgroundType background_type);
|
||||
NautilusGraphicBackgroundType nautilus_graphic_get_background_type (const NautilusGraphic *graphic);
|
||||
void nautilus_graphic_set_placement_type (NautilusGraphic *graphic,
|
||||
NautilusGraphicPlacementType placement);
|
||||
NautilusGraphicPlacementType nautilus_graphic_get_placement_type (const NautilusGraphic *graphic);
|
||||
void nautilus_graphic_set_background_color (NautilusGraphic *graphic,
|
||||
guint32 color);
|
||||
guint32 nautilus_graphic_get_background_color (const NautilusGraphic *graphic);
|
||||
void nautilus_graphic_set_pixbuf (NautilusGraphic *graphic,
|
||||
GdkPixbuf *pixbuf);
|
||||
GdkPixbuf* nautilus_graphic_get_pixbuf (const NautilusGraphic *graphic);
|
||||
void nautilus_graphic_set_overall_alpha (NautilusGraphic *graphic,
|
||||
guchar pixbuf_alpha);
|
||||
void nautilus_graphic_set_label_text (NautilusGraphic *graphic,
|
||||
const gchar *text);
|
||||
gchar* nautilus_graphic_get_label_text (NautilusGraphic *graphic);
|
||||
void nautilus_graphic_set_label_font (NautilusGraphic *graphic,
|
||||
GdkFont *font);
|
||||
GdkFont* nautilus_graphic_get_label_font (NautilusGraphic *graphic);
|
||||
void nautilus_graphic_set_left_offset (NautilusGraphic *graphic,
|
||||
guint left_offset);
|
||||
void nautilus_graphic_set_right_offset (NautilusGraphic *graphic,
|
||||
guint right_offset);
|
||||
void nautilus_graphic_set_top_offset (NautilusGraphic *graphic,
|
||||
guint top_offset);
|
||||
void nautilus_graphic_set_bottom_offset (NautilusGraphic *graphic,
|
||||
guint bottom_offset);
|
||||
void nautilus_graphic_set_extra_width (NautilusGraphic *graphic,
|
||||
guint extra_width);
|
||||
void nautilus_graphic_set_extra_height (NautilusGraphic *graphic,
|
||||
guint extra_width);
|
||||
END_GNOME_DECLS
|
||||
|
||||
#endif /* NAUTILUS_GRAPHIC_H */
|
||||
|
||||
|
File diff suppressed because it is too large
Load diff
131
libnautilus-private/nautilus-image.h
Normal file
131
libnautilus-private/nautilus-image.h
Normal file
|
@ -0,0 +1,131 @@
|
|||
/* -*- Mode: C; indent-tabs-mode: t; c-basic-offset: 8; tab-width: 8 -*- */
|
||||
|
||||
/* nautilus-image.h - A widget to display a composited pixbuf.
|
||||
|
||||
Copyright (C) 1999, 2000 Eazel, Inc.
|
||||
|
||||
The Gnome Library is free software; you can redistribute it and/or
|
||||
modify it under the terms of the GNU Library General Public License as
|
||||
published by the Free Software Foundation; either version 2 of the
|
||||
License, or (at your option) any later version.
|
||||
|
||||
The Gnome Library 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
|
||||
Library General Public License for more details.
|
||||
|
||||
You should have received a copy of the GNU Library General Public
|
||||
License along with the Gnome Library; see the file COPYING.LIB. If not,
|
||||
write to the Free Software Foundation, Inc., 59 Temple Place - Suite 330,
|
||||
Boston, MA 02111-1307, USA.
|
||||
|
||||
Authors: Ramiro Estrugo <ramiro@eazel.com>
|
||||
*/
|
||||
|
||||
#ifndef NAUTILUS_IMAGE_H
|
||||
#define NAUTILUS_IMAGE_H
|
||||
|
||||
#include <gtk/gtkwidget.h>
|
||||
#include <libgnome/gnome-defs.h>
|
||||
#include <gdk-pixbuf/gdk-pixbuf.h>
|
||||
|
||||
/* NautilusImage is GtkWidget that can display a GdkPixbuf. This pixbuf
|
||||
* will be composited with full alpha support on wither a solid background
|
||||
* or a background pixbuf.
|
||||
*/
|
||||
|
||||
BEGIN_GNOME_DECLS
|
||||
|
||||
#define NAUTILUS_TYPE_IMAGE (nautilus_image_get_type ())
|
||||
#define NAUTILUS_IMAGE(obj) (GTK_CHECK_CAST ((obj), NAUTILUS_TYPE_IMAGE, NautilusImage))
|
||||
#define NAUTILUS_IMAGE_CLASS(klass) (GTK_CHECK_CLASS_CAST ((klass), NAUTILUS_TYPE_IMAGE, NautilusImageClass))
|
||||
#define NAUTILUS_IS_IMAGE(obj) (GTK_CHECK_TYPE ((obj), NAUTILUS_TYPE_IMAGE))
|
||||
#define NAUTILUS_IS_IMAGE_CLASS(klass) (GTK_CHECK_CLASS_TYPE ((klass), NAUTILUS_TYPE_IMAGE))
|
||||
|
||||
typedef struct _NautilusImage NautilusImage;
|
||||
typedef struct _NautilusImageClass NautilusImageClass;
|
||||
typedef struct _NautilusImageDetail NautilusImageDetail;
|
||||
|
||||
struct _NautilusImage
|
||||
{
|
||||
/* Superclass */
|
||||
GtkWidget widget;
|
||||
|
||||
/* Private things */
|
||||
NautilusImageDetail *detail;
|
||||
};
|
||||
|
||||
struct _NautilusImageClass
|
||||
{
|
||||
GtkWidgetClass parent_class;
|
||||
};
|
||||
|
||||
typedef enum
|
||||
{
|
||||
NAUTILUS_IMAGE_PLACEMENT_TILE,
|
||||
NAUTILUS_IMAGE_PLACEMENT_CENTER
|
||||
} NautilusImagePlacementType;
|
||||
|
||||
typedef enum
|
||||
{
|
||||
NAUTILUS_IMAGE_BACKGROUND_PIXBUF,
|
||||
NAUTILUS_IMAGE_BACKGROUND_SOLID,
|
||||
} NautilusImageBackgroundType;
|
||||
|
||||
/* Pack RGBA components */
|
||||
#define NAUTILUS_RGBA_COLOR_PACK(_r, _g, _b, _a) \
|
||||
( ((_a) << 24) | \
|
||||
((_r) << 16) | \
|
||||
((_g) << 8) | \
|
||||
((_b) << 0) )
|
||||
|
||||
/* Access RGBA components */
|
||||
#define NAUTILUS_RGBA_COLOR_GET_R(_color) (((_color) >> 16) & 0xff)
|
||||
#define NAUTILUS_RGBA_COLOR_GET_G(_color) (((_color) >> 8) & 0xff)
|
||||
#define NAUTILUS_RGBA_COLOR_GET_B(_color) (((_color) >> 0) & 0xff)
|
||||
#define NAUTILUS_RGBA_COLOR_GET_A(_color) (((_color) >> 24) & 0xff)
|
||||
|
||||
GtkType nautilus_image_get_type (void);
|
||||
GtkWidget * nautilus_image_new (void);
|
||||
void nautilus_image_set_background_pixbuf (NautilusImage *image,
|
||||
GdkPixbuf *background);
|
||||
GdkPixbuf* nautilus_image_get_background_pixbuf (const NautilusImage *image);
|
||||
void nautilus_image_set_background_type (NautilusImage *image,
|
||||
NautilusImageBackgroundType background_type);
|
||||
NautilusImageBackgroundType nautilus_image_get_background_type (const NautilusImage *image);
|
||||
void nautilus_image_set_placement_type (NautilusImage *image,
|
||||
NautilusImagePlacementType placement);
|
||||
NautilusImagePlacementType nautilus_image_get_placement_type (const NautilusImage *image);
|
||||
void nautilus_image_set_background_color (NautilusImage *image,
|
||||
guint32 color);
|
||||
guint32 nautilus_image_get_background_color (const NautilusImage *image);
|
||||
void nautilus_image_set_pixbuf (NautilusImage *image,
|
||||
GdkPixbuf *pixbuf);
|
||||
GdkPixbuf* nautilus_image_get_pixbuf (const NautilusImage *image);
|
||||
void nautilus_image_set_overall_alpha (NautilusImage *image,
|
||||
guchar pixbuf_alpha);
|
||||
void nautilus_image_set_label_text (NautilusImage *image,
|
||||
const gchar *text);
|
||||
gchar* nautilus_image_get_label_text (NautilusImage *image);
|
||||
void nautilus_image_set_label_font (NautilusImage *image,
|
||||
GdkFont *font);
|
||||
GdkFont* nautilus_image_get_label_font (NautilusImage *image);
|
||||
void nautilus_image_set_left_offset (NautilusImage *image,
|
||||
guint left_offset);
|
||||
void nautilus_image_set_right_offset (NautilusImage *image,
|
||||
guint right_offset);
|
||||
void nautilus_image_set_top_offset (NautilusImage *image,
|
||||
guint top_offset);
|
||||
void nautilus_image_set_bottom_offset (NautilusImage *image,
|
||||
guint bottom_offset);
|
||||
void nautilus_image_set_extra_width (NautilusImage *image,
|
||||
guint extra_width);
|
||||
void nautilus_image_set_extra_height (NautilusImage *image,
|
||||
guint extra_width);
|
||||
|
||||
|
||||
END_GNOME_DECLS
|
||||
|
||||
#endif /* NAUTILUS_IMAGE_H */
|
||||
|
||||
|
|
@ -4,7 +4,7 @@
|
|||
*.lo
|
||||
Makefile
|
||||
Makefile.in
|
||||
test-nautilus-graphic
|
||||
test-nautilus-image
|
||||
test-nautilus-mime-actions
|
||||
test-nautilus-mime-actions-set
|
||||
test-nautilus-password-dialog
|
||||
|
|
|
@ -30,7 +30,7 @@ LDADD =\
|
|||
$(NULL)
|
||||
|
||||
noinst_PROGRAMS =\
|
||||
test-nautilus-graphic \
|
||||
test-nautilus-image \
|
||||
test-nautilus-mime-actions \
|
||||
test-nautilus-mime-actions-set \
|
||||
test-nautilus-password-dialog \
|
||||
|
@ -46,7 +46,7 @@ test_nautilus_widgets_SOURCES = test-nautilus-widgets.c
|
|||
|
||||
test_nautilus_preferences_SOURCES = test-nautilus-preferences.c
|
||||
|
||||
test_nautilus_graphic_SOURCES = test-nautilus-graphic.c
|
||||
test_nautilus_image_SOURCES = test-nautilus-image.c
|
||||
|
||||
test_nautilus_password_dialog_SOURCES = test-nautilus-password-dialog.c
|
||||
|
||||
|
|
|
@ -2,7 +2,7 @@
|
|||
#include <config.h>
|
||||
|
||||
#include <gtk/gtk.h>
|
||||
#include <libnautilus-extensions/nautilus-graphic.h>
|
||||
#include <libnautilus-extensions/nautilus-image.h>
|
||||
#include <libnautilus-extensions/nautilus-icon-factory.h>
|
||||
#include <libnautilus-extensions/nautilus-file-utilities.h>
|
||||
#include <libnautilus-extensions/nautilus-font-factory.h>
|
||||
|
@ -40,175 +40,175 @@ create_pixbuf (const char *name)
|
|||
}
|
||||
|
||||
static GtkWidget*
|
||||
create_graphic (const char *name, GdkPixbuf *background)
|
||||
create_image (const char *name, GdkPixbuf *background)
|
||||
{
|
||||
GtkWidget *graphic;
|
||||
GtkWidget *image;
|
||||
GdkPixbuf *pixbuf;
|
||||
|
||||
g_assert (background != NULL);
|
||||
|
||||
graphic = nautilus_graphic_new ();
|
||||
g_assert (graphic != NULL);
|
||||
image = nautilus_image_new ();
|
||||
g_assert (image != NULL);
|
||||
|
||||
nautilus_graphic_set_background_type (NAUTILUS_GRAPHIC (graphic), NAUTILUS_GRAPHIC_BACKGROUND_PIXBUF);
|
||||
nautilus_graphic_set_background_pixbuf (NAUTILUS_GRAPHIC (graphic), background);
|
||||
nautilus_image_set_background_type (NAUTILUS_IMAGE (image), NAUTILUS_IMAGE_BACKGROUND_PIXBUF);
|
||||
nautilus_image_set_background_pixbuf (NAUTILUS_IMAGE (image), background);
|
||||
|
||||
if (name != NULL)
|
||||
{
|
||||
pixbuf = create_pixbuf (name);
|
||||
g_assert (pixbuf != NULL);
|
||||
|
||||
nautilus_graphic_set_pixbuf (NAUTILUS_GRAPHIC (graphic), pixbuf);
|
||||
nautilus_image_set_pixbuf (NAUTILUS_IMAGE (image), pixbuf);
|
||||
|
||||
gdk_pixbuf_unref (pixbuf);
|
||||
}
|
||||
|
||||
return graphic;
|
||||
return image;
|
||||
}
|
||||
|
||||
static void
|
||||
alpha_scale_value_changed (GtkAdjustment *adjustment, gpointer client_data)
|
||||
{
|
||||
GList *graphic_list;
|
||||
GList *image_list;
|
||||
|
||||
g_return_if_fail (adjustment != NULL);
|
||||
g_return_if_fail (GTK_IS_ADJUSTMENT (adjustment));
|
||||
g_return_if_fail (client_data != NULL);
|
||||
|
||||
graphic_list = (GList *) client_data;
|
||||
image_list = (GList *) client_data;
|
||||
|
||||
while (graphic_list)
|
||||
while (image_list)
|
||||
{
|
||||
g_assert (graphic_list->data != NULL);
|
||||
g_assert (NAUTILUS_IS_GRAPHIC (graphic_list->data));
|
||||
g_assert (image_list->data != NULL);
|
||||
g_assert (NAUTILUS_IS_IMAGE (image_list->data));
|
||||
|
||||
nautilus_graphic_set_overall_alpha (NAUTILUS_GRAPHIC (graphic_list->data), (guchar) adjustment->value);
|
||||
nautilus_image_set_overall_alpha (NAUTILUS_IMAGE (image_list->data), (guchar) adjustment->value);
|
||||
|
||||
graphic_list = graphic_list->next;
|
||||
image_list = image_list->next;
|
||||
}
|
||||
}
|
||||
|
||||
static void
|
||||
red_color_value_changed (GtkAdjustment *adjustment, gpointer client_data)
|
||||
{
|
||||
GList *graphic_list;
|
||||
GList *image_list;
|
||||
|
||||
g_return_if_fail (adjustment != NULL);
|
||||
g_return_if_fail (GTK_IS_ADJUSTMENT (adjustment));
|
||||
g_return_if_fail (client_data != NULL);
|
||||
|
||||
graphic_list = (GList *) client_data;
|
||||
image_list = (GList *) client_data;
|
||||
|
||||
while (graphic_list)
|
||||
while (image_list)
|
||||
{
|
||||
NautilusGraphic *graphic;
|
||||
NautilusImage *image;
|
||||
guint32 color;
|
||||
|
||||
g_assert (graphic_list->data != NULL);
|
||||
g_assert (NAUTILUS_IS_GRAPHIC (graphic_list->data));
|
||||
g_assert (image_list->data != NULL);
|
||||
g_assert (NAUTILUS_IS_IMAGE (image_list->data));
|
||||
|
||||
graphic = NAUTILUS_GRAPHIC (graphic_list->data);
|
||||
image = NAUTILUS_IMAGE (image_list->data);
|
||||
|
||||
color = nautilus_graphic_get_background_color (graphic);
|
||||
color = nautilus_image_get_background_color (image);
|
||||
|
||||
color = NAUTILUS_RGBA_COLOR_PACK ((guchar) adjustment->value,
|
||||
NAUTILUS_RGBA_COLOR_GET_G (color),
|
||||
NAUTILUS_RGBA_COLOR_GET_B (color),
|
||||
NAUTILUS_RGBA_COLOR_GET_A (color));
|
||||
|
||||
nautilus_graphic_set_background_color (graphic, color);
|
||||
nautilus_image_set_background_color (image, color);
|
||||
|
||||
graphic_list = graphic_list->next;
|
||||
image_list = image_list->next;
|
||||
}
|
||||
}
|
||||
|
||||
static void
|
||||
green_color_value_changed (GtkAdjustment *adjustment, gpointer client_data)
|
||||
{
|
||||
GList *graphic_list;
|
||||
GList *image_list;
|
||||
|
||||
g_return_if_fail (adjustment != NULL);
|
||||
g_return_if_fail (GTK_IS_ADJUSTMENT (adjustment));
|
||||
g_return_if_fail (client_data != NULL);
|
||||
|
||||
graphic_list = (GList *) client_data;
|
||||
image_list = (GList *) client_data;
|
||||
|
||||
while (graphic_list)
|
||||
while (image_list)
|
||||
{
|
||||
NautilusGraphic *graphic;
|
||||
NautilusImage *image;
|
||||
guint32 color;
|
||||
|
||||
g_assert (graphic_list->data != NULL);
|
||||
g_assert (NAUTILUS_IS_GRAPHIC (graphic_list->data));
|
||||
g_assert (image_list->data != NULL);
|
||||
g_assert (NAUTILUS_IS_IMAGE (image_list->data));
|
||||
|
||||
graphic = NAUTILUS_GRAPHIC (graphic_list->data);
|
||||
image = NAUTILUS_IMAGE (image_list->data);
|
||||
|
||||
color = nautilus_graphic_get_background_color (graphic);
|
||||
color = nautilus_image_get_background_color (image);
|
||||
|
||||
color = NAUTILUS_RGBA_COLOR_PACK (NAUTILUS_RGBA_COLOR_GET_R (color),
|
||||
(guchar) adjustment->value,
|
||||
NAUTILUS_RGBA_COLOR_GET_B (color),
|
||||
NAUTILUS_RGBA_COLOR_GET_A (color));
|
||||
|
||||
nautilus_graphic_set_background_color (graphic, color);
|
||||
nautilus_image_set_background_color (image, color);
|
||||
|
||||
graphic_list = graphic_list->next;
|
||||
image_list = image_list->next;
|
||||
}
|
||||
}
|
||||
|
||||
static void
|
||||
blue_color_value_changed (GtkAdjustment *adjustment, gpointer client_data)
|
||||
{
|
||||
GList *graphic_list;
|
||||
GList *image_list;
|
||||
|
||||
g_return_if_fail (adjustment != NULL);
|
||||
g_return_if_fail (GTK_IS_ADJUSTMENT (adjustment));
|
||||
g_return_if_fail (client_data != NULL);
|
||||
|
||||
graphic_list = (GList *) client_data;
|
||||
image_list = (GList *) client_data;
|
||||
|
||||
while (graphic_list)
|
||||
while (image_list)
|
||||
{
|
||||
NautilusGraphic *graphic;
|
||||
NautilusImage *image;
|
||||
guint32 color;
|
||||
|
||||
g_assert (graphic_list->data != NULL);
|
||||
g_assert (NAUTILUS_IS_GRAPHIC (graphic_list->data));
|
||||
g_assert (image_list->data != NULL);
|
||||
g_assert (NAUTILUS_IS_IMAGE (image_list->data));
|
||||
|
||||
graphic = NAUTILUS_GRAPHIC (graphic_list->data);
|
||||
image = NAUTILUS_IMAGE (image_list->data);
|
||||
|
||||
color = nautilus_graphic_get_background_color (graphic);
|
||||
color = nautilus_image_get_background_color (image);
|
||||
|
||||
color = NAUTILUS_RGBA_COLOR_PACK (NAUTILUS_RGBA_COLOR_GET_R (color),
|
||||
NAUTILUS_RGBA_COLOR_GET_G (color),
|
||||
(guchar) adjustment->value,
|
||||
NAUTILUS_RGBA_COLOR_GET_A (color));
|
||||
|
||||
nautilus_graphic_set_background_color (graphic, color);
|
||||
nautilus_image_set_background_color (image, color);
|
||||
|
||||
graphic_list = graphic_list->next;
|
||||
image_list = image_list->next;
|
||||
}
|
||||
}
|
||||
|
||||
static void
|
||||
toggle_background_type_callback (GtkWidget *widget, gpointer client_data)
|
||||
{
|
||||
NautilusGraphic *graphic;
|
||||
NautilusImage *image;
|
||||
|
||||
g_return_if_fail (widget != NULL);
|
||||
g_return_if_fail (GTK_IS_BUTTON (widget));
|
||||
g_return_if_fail (client_data != NULL);
|
||||
g_return_if_fail (NAUTILUS_IS_GRAPHIC (client_data));
|
||||
g_return_if_fail (NAUTILUS_IS_IMAGE (client_data));
|
||||
|
||||
graphic = NAUTILUS_GRAPHIC (client_data);
|
||||
image = NAUTILUS_IMAGE (client_data);
|
||||
|
||||
if (nautilus_graphic_get_background_type (graphic) == NAUTILUS_GRAPHIC_BACKGROUND_PIXBUF)
|
||||
if (nautilus_image_get_background_type (image) == NAUTILUS_IMAGE_BACKGROUND_PIXBUF)
|
||||
{
|
||||
nautilus_graphic_set_background_type (graphic, NAUTILUS_GRAPHIC_BACKGROUND_SOLID);
|
||||
nautilus_image_set_background_type (image, NAUTILUS_IMAGE_BACKGROUND_SOLID);
|
||||
}
|
||||
else
|
||||
{
|
||||
nautilus_graphic_set_background_type (graphic, NAUTILUS_GRAPHIC_BACKGROUND_PIXBUF);
|
||||
nautilus_image_set_background_type (image, NAUTILUS_IMAGE_BACKGROUND_PIXBUF);
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -242,7 +242,7 @@ main (int argc, char* argv[])
|
|||
{
|
||||
GtkWidget *window;
|
||||
GtkWidget *main_box;
|
||||
GtkWidget *graphic_box;
|
||||
GtkWidget *image_box;
|
||||
GtkWidget *tool_box;
|
||||
GtkWidget *toggle_background_type;
|
||||
|
||||
|
@ -254,13 +254,13 @@ main (int argc, char* argv[])
|
|||
|
||||
GdkPixbuf *background;
|
||||
|
||||
GtkWidget *graphic1;
|
||||
GtkWidget *graphic2;
|
||||
GtkWidget *graphic3;
|
||||
GtkWidget *image1;
|
||||
GtkWidget *image2;
|
||||
GtkWidget *image3;
|
||||
|
||||
GtkWidget *background_graphic;
|
||||
GtkWidget *background_image;
|
||||
|
||||
GList *graphic_list = NULL;
|
||||
GList *image_list = NULL;
|
||||
|
||||
const char *file_name1 = "eazel-services-logo.png";
|
||||
const char *file_name2 = "eazel-services-logo-tile.png";
|
||||
|
@ -270,7 +270,7 @@ main (int argc, char* argv[])
|
|||
gdk_rgb_init ();
|
||||
|
||||
window = gtk_window_new (GTK_WINDOW_TOPLEVEL);
|
||||
gtk_window_set_title (GTK_WINDOW (window), "Graphic Test");
|
||||
gtk_window_set_title (GTK_WINDOW (window), "Image Test");
|
||||
gtk_container_set_border_width (GTK_CONTAINER (window), 10);
|
||||
|
||||
main_box = gtk_vbox_new (FALSE, 0);
|
||||
|
@ -278,51 +278,51 @@ main (int argc, char* argv[])
|
|||
|
||||
background = create_background ();
|
||||
|
||||
graphic1 = create_graphic (file_name1, background);
|
||||
graphic2 = create_graphic (file_name2, background);
|
||||
graphic3 = create_graphic (file_name3, background);
|
||||
background_graphic = create_graphic (NULL, background);
|
||||
image1 = create_image (file_name1, background);
|
||||
image2 = create_image (file_name2, background);
|
||||
image3 = create_image (file_name3, background);
|
||||
background_image = create_image (NULL, background);
|
||||
|
||||
graphic_list = g_list_append (graphic_list, graphic1);
|
||||
graphic_list = g_list_append (graphic_list, graphic2);
|
||||
graphic_list = g_list_append (graphic_list, graphic3);
|
||||
graphic_list = g_list_append (graphic_list, background_graphic);
|
||||
image_list = g_list_append (image_list, image1);
|
||||
image_list = g_list_append (image_list, image2);
|
||||
image_list = g_list_append (image_list, image3);
|
||||
image_list = g_list_append (image_list, background_image);
|
||||
|
||||
nautilus_graphic_set_placement_type (NAUTILUS_GRAPHIC (graphic2), NAUTILUS_GRAPHIC_PLACEMENT_TILE);
|
||||
nautilus_graphic_set_placement_type (NAUTILUS_GRAPHIC (graphic3), NAUTILUS_GRAPHIC_PLACEMENT_TILE);
|
||||
nautilus_image_set_placement_type (NAUTILUS_IMAGE (image2), NAUTILUS_IMAGE_PLACEMENT_TILE);
|
||||
nautilus_image_set_placement_type (NAUTILUS_IMAGE (image3), NAUTILUS_IMAGE_PLACEMENT_TILE);
|
||||
|
||||
{
|
||||
GdkFont *font;
|
||||
|
||||
font = nautilus_font_factory_get_font_by_family ("helvetica", 20);
|
||||
|
||||
nautilus_graphic_set_label_text (NAUTILUS_GRAPHIC (graphic3), "Welcome Back, Arlo!");
|
||||
nautilus_graphic_set_label_font (NAUTILUS_GRAPHIC (graphic3), font);
|
||||
nautilus_image_set_label_text (NAUTILUS_IMAGE (image3), "Welcome Back, Arlo!");
|
||||
nautilus_image_set_label_font (NAUTILUS_IMAGE (image3), font);
|
||||
|
||||
gdk_font_unref (font);
|
||||
|
||||
nautilus_graphic_set_extra_width (NAUTILUS_GRAPHIC (graphic3), 8);
|
||||
nautilus_graphic_set_right_offset (NAUTILUS_GRAPHIC (graphic3), 8);
|
||||
nautilus_graphic_set_top_offset (NAUTILUS_GRAPHIC (graphic3), 3);
|
||||
nautilus_image_set_extra_width (NAUTILUS_IMAGE (image3), 8);
|
||||
nautilus_image_set_right_offset (NAUTILUS_IMAGE (image3), 8);
|
||||
nautilus_image_set_top_offset (NAUTILUS_IMAGE (image3), 3);
|
||||
}
|
||||
|
||||
graphic_box = gtk_hbox_new (FALSE, 0);
|
||||
image_box = gtk_hbox_new (FALSE, 0);
|
||||
tool_box = gtk_hbox_new (FALSE, 0);
|
||||
|
||||
gtk_box_pack_start (GTK_BOX (main_box), graphic_box, FALSE, FALSE, 0);
|
||||
gtk_box_pack_start (GTK_BOX (main_box), background_graphic, TRUE, TRUE, 0);
|
||||
gtk_box_pack_start (GTK_BOX (main_box), image_box, FALSE, FALSE, 0);
|
||||
gtk_box_pack_start (GTK_BOX (main_box), background_image, TRUE, TRUE, 0);
|
||||
gtk_box_pack_end (GTK_BOX (main_box), tool_box, FALSE, FALSE, 10);
|
||||
|
||||
gtk_box_pack_start (GTK_BOX (graphic_box), graphic1, FALSE, FALSE, 0);
|
||||
gtk_box_pack_start (GTK_BOX (graphic_box), graphic2, TRUE, TRUE, 0);
|
||||
gtk_box_pack_start (GTK_BOX (graphic_box), graphic3, FALSE, FALSE, 0);
|
||||
gtk_box_pack_start (GTK_BOX (image_box), image1, FALSE, FALSE, 0);
|
||||
gtk_box_pack_start (GTK_BOX (image_box), image2, TRUE, TRUE, 0);
|
||||
gtk_box_pack_start (GTK_BOX (image_box), image3, FALSE, FALSE, 0);
|
||||
|
||||
alpha_scale = create_color_scale (255, alpha_scale_value_changed, graphic_list);
|
||||
alpha_scale = create_color_scale (255, alpha_scale_value_changed, image_list);
|
||||
|
||||
toggle_background_type = gtk_button_new_with_label ("Toggle Background Type");
|
||||
red_scale = create_color_scale (255, red_color_value_changed, graphic_list);
|
||||
green_scale = create_color_scale (255, green_color_value_changed, graphic_list);
|
||||
blue_scale = create_color_scale (255, blue_color_value_changed, graphic_list);
|
||||
red_scale = create_color_scale (255, red_color_value_changed, image_list);
|
||||
green_scale = create_color_scale (255, green_color_value_changed, image_list);
|
||||
blue_scale = create_color_scale (255, blue_color_value_changed, image_list);
|
||||
|
||||
gtk_box_pack_start (GTK_BOX (tool_box), alpha_scale, FALSE, FALSE, 5);
|
||||
gtk_box_pack_start (GTK_BOX (tool_box), toggle_background_type, FALSE, FALSE, 5);
|
||||
|
@ -333,21 +333,21 @@ main (int argc, char* argv[])
|
|||
gtk_signal_connect (GTK_OBJECT (toggle_background_type),
|
||||
"clicked",
|
||||
GTK_SIGNAL_FUNC (toggle_background_type_callback),
|
||||
(gpointer) graphic1);
|
||||
(gpointer) image1);
|
||||
|
||||
gtk_signal_connect (GTK_OBJECT (toggle_background_type),
|
||||
"clicked",
|
||||
GTK_SIGNAL_FUNC (toggle_background_type_callback),
|
||||
(gpointer) graphic2);
|
||||
(gpointer) image2);
|
||||
gtk_signal_connect (GTK_OBJECT (toggle_background_type),
|
||||
"clicked",
|
||||
GTK_SIGNAL_FUNC (toggle_background_type_callback),
|
||||
(gpointer) graphic3);
|
||||
(gpointer) image3);
|
||||
|
||||
gtk_signal_connect (GTK_OBJECT (toggle_background_type),
|
||||
"clicked",
|
||||
GTK_SIGNAL_FUNC (toggle_background_type_callback),
|
||||
(gpointer) background_graphic);
|
||||
(gpointer) background_image);
|
||||
|
||||
gtk_widget_show_all (window);
|
||||
|
Loading…
Reference in a new issue