gnash-commit
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Gnash-commit] gnash ChangeLog gui/Makefile.am gui/gtk.cpp gui...


From: Rob Savoye
Subject: [Gnash-commit] gnash ChangeLog gui/Makefile.am gui/gtk.cpp gui...
Date: Thu, 31 Aug 2006 18:58:44 +0000

CVSROOT:        /sources/gnash
Module name:    gnash
Changes by:     Rob Savoye <rsavoye>    06/08/31 18:58:44

Modified files:
        .              : ChangeLog 
        gui            : Makefile.am gtk.cpp gtksup.h 

Log message:
                * gui/images: New directory for images. Patch #5346.
                * gui/images/gnash_128_96.ico: New icon for GTK executable. 
Patch
                #5346.
                * gui/Makefile.am: Install icon image. Patch #5346.
                * gui/gtk.cpp: Add icon to GTK executable. Patch #5346.
                * gui/gtksup.h: Add methods for adding and finding pixmaps. 
Patch
                #5346.
                * plugin/Makefile.am: For OpenBSD, copy the actual shared libary
                when installing since libtool doesn't appear to do this. Baswed 
on
                patch #5345.

CVSWeb URLs:
http://cvs.savannah.gnu.org/viewcvs/gnash/ChangeLog?cvsroot=gnash&r1=1.796&r2=1.797
http://cvs.savannah.gnu.org/viewcvs/gnash/gui/Makefile.am?cvsroot=gnash&r1=1.15&r2=1.16
http://cvs.savannah.gnu.org/viewcvs/gnash/gui/gtk.cpp?cvsroot=gnash&r1=1.19&r2=1.20
http://cvs.savannah.gnu.org/viewcvs/gnash/gui/gtksup.h?cvsroot=gnash&r1=1.13&r2=1.14

Patches:
Index: ChangeLog
===================================================================
RCS file: /sources/gnash/gnash/ChangeLog,v
retrieving revision 1.796
retrieving revision 1.797
diff -u -b -r1.796 -r1.797
--- ChangeLog   31 Aug 2006 02:50:25 -0000      1.796
+++ ChangeLog   31 Aug 2006 18:58:44 -0000      1.797
@@ -1,3 +1,16 @@
+2006-08-31  Rob Savoye  <address@hidden>
+
+       * gui/images: New directory for images. Patch #5346.
+       * gui/images/gnash_128_96.ico: New icon for GTK executable. Patch
+       #5346.
+        * gui/Makefile.am: Install icon image. Patch #5346.
+        * gui/gtk.cpp: Add icon to GTK executable. Patch #5346.
+        * gui/gtksup.h: Add methods for adding and finding pixmaps. Patch
+       #5346.
+       * plugin/Makefile.am: For OpenBSD, copy the actual shared libary
+       when installing since libtool doesn't appear to do this. Baswed on
+       patch #5345.
+
 2006-08-31 Sandro Santilli  <address@hidden>
 
        * server/swf/tag_loaders.cpp (frame_label_loader): added

Index: gui/Makefile.am
===================================================================
RCS file: /sources/gnash/gnash/gui/Makefile.am,v
retrieving revision 1.15
retrieving revision 1.16
diff -u -b -r1.15 -r1.16
--- gui/Makefile.am     24 Aug 2006 00:57:20 -0000      1.15
+++ gui/Makefile.am     31 Aug 2006 18:58:44 -0000      1.16
@@ -110,7 +110,11 @@
         $(MP3_CFLAGS) \
         $(OGG_CFLAGS)
 
-AM_CPPFLAGS = $(INCLUDES)
+AM_CPPFLAGS = $(INCLUDES) -DPKGDATADIR=\"$(pkgdatadir)\"
+
+#dist_data_DATA = images/gnash_128_96.ico
+dist_images_DATA = images/gnash_128_96.ico
+imagesdir = $(pkgdatadir)
 
 ## WARNING: make sure GLIB_LIBS appears first
 ## See: http://lists.gnu.org/archive/html/gnash-dev/2006-07/msg00076.html
@@ -174,7 +178,12 @@
        ../libbase/libgnashbase.la
 
 gnash_SOURCES = gnash.cpp # $(libgnashgui_la_SOURCES)
+if USE_GUI_GTK
 gnash_CPPFLAGS = -DUSE_GTK
+endif
+if USE_GUI_SDL
+gnash_CPPFLAGS = -DUSE_SDL
+endif
 gnash_LDFLAGS = -module -avoid-version -no-undefined
 gnash_LDADD = \
        $(GNASH_LIBS)

Index: gui/gtk.cpp
===================================================================
RCS file: /sources/gnash/gnash/gui/gtk.cpp,v
retrieving revision 1.19
retrieving revision 1.20
diff -u -b -r1.19 -r1.20
--- gui/gtk.cpp 25 Aug 2006 18:40:33 -0000      1.19
+++ gui/gtk.cpp 31 Aug 2006 18:58:44 -0000      1.20
@@ -79,6 +79,8 @@
 
     glue.init (argc, argv);
 
+    add_pixmap_directory (PKGDATADIR);
+
     return true;
 }
 
@@ -95,6 +97,67 @@
     return ret;
 }
 
+static GList *pixmaps_directories = NULL;
+
+/* Use this function to set the directory containing installed pixmaps. */
+void
+GtkGui::add_pixmap_directory                   (const gchar     *directory)
+{
+    pixmaps_directories = g_list_prepend (pixmaps_directories, g_strdup 
(directory));
+}
+
+
+/* This is an internally used function to find pixmap files. */
+gchar*
+GtkGui::find_pixmap_file                       (const gchar     *filename)
+{
+    GList *elem;
+
+    /* We step through each of the pixmaps directory to find it. */
+    elem = pixmaps_directories;
+    while (elem) {
+        gchar *pathname = g_strdup_printf ("%s%s%s", (gchar*)elem->data,
+                G_DIR_SEPARATOR_S, filename);
+        if (g_file_test (pathname, G_FILE_TEST_EXISTS))
+            return pathname;
+        g_free (pathname);
+        elem = elem->next;
+    }
+    return NULL;
+}
+
+
+
+/* This is an internally used function to create pixmaps. */
+GdkPixbuf*
+GtkGui::create_pixbuf                          (const gchar     *filename)
+{
+    gchar *pathname = NULL;
+    GdkPixbuf *pixbuf;
+    GError *error = NULL;
+
+    if (!filename || !filename[0])
+       return NULL;
+
+    pathname = find_pixmap_file (filename);
+
+    if (!pathname) {
+        dbglogfile << "Couldn't find pixmap file: " << filename << endl;
+        g_warning ("Couldn't find pixmap file: %s", filename);
+        return NULL;
+    }
+
+    pixbuf = gdk_pixbuf_new_from_file (pathname, &error);
+    if (!pixbuf) {
+        dbglogfile << "Failed to load pixbuf file: " <<pathname << 
error->message << endl;
+        //fprintf (stderr, "Failed to load pixbuf file: %s: %s\n", pathname, 
error->message);
+        g_error_free (error);
+    }
+    g_free (pathname);
+    return pixbuf;
+}
+
+
 bool
 GtkGui::createWindow(int width, int height)
 {
@@ -111,6 +174,11 @@
     // XXXbjacques: why do we need this?
     gtk_container_set_reallocate_redraws(GTK_CONTAINER (_window), TRUE);
 
+    _window_icon_pixbuf = create_pixbuf ("gnash_128_96.ico");
+    if (_window_icon_pixbuf) {
+        gtk_window_set_icon (GTK_WINDOW (_window), _window_icon_pixbuf);
+       gdk_pixbuf_unref (_window_icon_pixbuf);
+    }
     _drawing_area = gtk_drawing_area_new();
 
     if (!_xid) {

Index: gui/gtksup.h
===================================================================
RCS file: /sources/gnash/gnash/gui/gtksup.h,v
retrieving revision 1.13
retrieving revision 1.14
diff -u -b -r1.13 -r1.14
--- gui/gtksup.h        26 Aug 2006 13:09:52 -0000      1.13
+++ gui/gtksup.h        31 Aug 2006 18:58:44 -0000      1.14
@@ -119,8 +119,15 @@
     static gboolean motion_notify_event(GtkWidget *widget, GdkEventMotion 
*event,
                                         gpointer data);
     static gint popup_handler(GtkWidget *widget, GdkEvent *event);    
+
+    void add_pixmap_directory(const gchar *directory);
+
+    gchar* find_pixmap_file(const gchar *filename);
+
+    GdkPixbuf* create_pixbuf(const gchar     *filename);
  private:
     GtkWidget   *_window;
+    GdkPixbuf *_window_icon_pixbuf;
     GtkWidget   *_drawing_area;    
     GtkMenu     *_popup_menu;
 #ifdef RENDERER_CAIRO




reply via email to

[Prev in Thread] Current Thread [Next in Thread]