diff options
author | Perberos <[email protected]> | 2012-08-01 00:13:34 -0700 |
---|---|---|
committer | Perberos <[email protected]> | 2012-08-01 00:13:34 -0700 |
commit | a637e073e5fdf1c0d0d2131fad476d8dfa4adc35 (patch) | |
tree | 2a2dacc9ba341683e4095205fd625fced5f14a25 | |
parent | 2a6227b40b69723d29b30023dc95758871cb3c8f (diff) | |
parent | 0fc24b2b08fd7f13e98a891aa7e4c12414c70297 (diff) | |
download | mate-desktop-a637e073e5fdf1c0d0d2131fad476d8dfa4adc35.tar.bz2 mate-desktop-a637e073e5fdf1c0d0d2131fad476d8dfa4adc35.tar.xz |
Merge pull request #22 from spaghetti2514/master
Added copyleft compatible gnucat
-rw-r--r-- | distro/archlinux/PKGBUILD | 3 | ||||
-rw-r--r-- | mate-about/Makefile.am | 3 | ||||
-rw-r--r-- | mate-about/gnu-cat.gif | bin | 0 -> 7385 bytes | |||
-rw-r--r-- | mate-about/gnu-cat_navideno_v3.png | bin | 0 -> 1354 bytes | |||
-rw-r--r-- | mate-about/mate-about.c | 85 |
5 files changed, 88 insertions, 3 deletions
diff --git a/distro/archlinux/PKGBUILD b/distro/archlinux/PKGBUILD index 3978481..fd7a1ba 100644 --- a/distro/archlinux/PKGBUILD +++ b/distro/archlinux/PKGBUILD @@ -22,7 +22,8 @@ build() { --disable-static \ --disable-scrollkeeper \ --disable-startup-notification \ - --enable-unique || return 1 + --enable-unique \ + --disable-gnucat || return 1 # --with-gtk=3.0 make || return 1 } diff --git a/mate-about/Makefile.am b/mate-about/Makefile.am index e6aae48..314b870 100644 --- a/mate-about/Makefile.am +++ b/mate-about/Makefile.am @@ -11,6 +11,9 @@ INCLUDES = \ @INTLTOOL_DESKTOP_RULE@ +pixmapdir = $(datadir)/pixmaps +pixmap_DATA = gnu-cat_navideno_v3.png gnu-cat.gif + desktopdir = $(datadir)/applications desktop_in_files = mate-about.desktop.in desktop_DATA = $(desktop_in_files:.desktop.in=.desktop) diff --git a/mate-about/gnu-cat.gif b/mate-about/gnu-cat.gif Binary files differnew file mode 100644 index 0000000..e2af35f --- /dev/null +++ b/mate-about/gnu-cat.gif diff --git a/mate-about/gnu-cat_navideno_v3.png b/mate-about/gnu-cat_navideno_v3.png Binary files differnew file mode 100644 index 0000000..802f89f --- /dev/null +++ b/mate-about/gnu-cat_navideno_v3.png diff --git a/mate-about/mate-about.c b/mate-about/mate-about.c index 9dea770..9626542 100644 --- a/mate-about/mate-about.c +++ b/mate-about/mate-about.c @@ -34,6 +34,37 @@ //class mate_about //{ + // what a mess! + #ifndef DISABLE_GNUCAT + + // Thanks! http://www.gtkforums.com/viewtopic.php?t=1639 + typedef struct _iter_arg { + GtkWidget* widget; + GdkPixbufAnimation* animation; + GdkPixbufAnimationIter* iter; + } iter_arg_t; + + gboolean on_animation_frame(iter_arg_t* object) + { + if (object->widget == NULL) + { + return FALSE; + } + + static gint frame = 1; + + if (gdk_pixbuf_animation_iter_advance(object->iter, NULL)) + { + frame++; + + gtk_about_dialog_set_logo((GtkAboutDialog*) object->widget, gdk_pixbuf_animation_iter_get_pixbuf(object->iter)); + } + + return TRUE; + } + + #endif + #if GTK_CHECK_VERSION(3, 0, 0) && !defined(UNIQUE) static void mate_about_on_activate(GtkApplication* app) @@ -76,8 +107,58 @@ gtk_window_set_default_icon_name(icon); - /* logo */ - #if GTK_CHECK_VERSION(3, 0, 0) || GTK_CHECK_VERSION(2, 6, 0) + #ifndef DISABLE_GNUCAT + + /* hacemos una comprovacion de la fecha, para mostrar el gnucat + * version navideƱa. */ + gboolean christmas_is = FALSE; + + GDate* d = g_date_new(); + g_date_set_time_t(d, (time_t) time(NULL)); + + if (g_date_get_month(d) == G_DATE_DECEMBER) + { + GDateDay day = g_date_get_day(d); + + if (day >= 24 && day <=25) + { + christmas_is = TRUE; + } + } + + g_date_free(d); + + + if (christmas_is == TRUE) + { + GdkPixbuf* pixbuf = gdk_pixbuf_new_from_file(PIXMAPS_DIR "gnu-cat_navideno_v3.png", NULL); + gtk_about_dialog_set_logo(mate_about_dialog, pixbuf); + g_object_unref(pixbuf); + } + else + { + iter_arg_t animation_object; + GdkPixbufAnimation* animation; + GdkPixbufAnimationIter *iter; + GtkWidget* image; + + animation = gdk_pixbuf_animation_new_from_file(PIXMAPS_DIR "gnu-cat.gif", NULL); + + if (animation != NULL) + { + iter = gdk_pixbuf_animation_get_iter(animation, NULL); + + animation_object.animation = animation; + animation_object.iter = iter; + animation_object.widget = (GtkWidget*) mate_about_dialog; + + gtk_about_dialog_set_logo(mate_about_dialog, gdk_pixbuf_animation_iter_get_pixbuf(iter)); + + g_timeout_add(gdk_pixbuf_animation_iter_get_delay_time(iter), (GSourceFunc) on_animation_frame, (gpointer) &animation_object); + } + } + + #elif GTK_CHECK_VERSION(3, 0, 0) || GTK_CHECK_VERSION(2, 6, 0) gtk_about_dialog_set_logo_icon_name(mate_about_dialog, icon); |