[kazehakase-svn] [3775] 2009-07-25 Hiroyuki Ikezoe <poinc****@ikezo*****>

Zurück zum Archiv-Index

svnno****@sourc***** svnno****@sourc*****
Sat Jul 25 14:54:36 JST 2009


Revision: 3775
          http://sourceforge.jp/projects/kazehakase/svn/view?view=rev&revision=3775
Author:   ikezoe
Date:     2009-07-25 14:54:36 +0900 (Sat, 25 Jul 2009)

Log Message:
-----------
2009-07-25  Hiroyuki Ikezoe  <poinc****@ikezo*****>

	* macros/gecko.m4, module/embed/gecko/*:
	Remove all stuffs concerned to nsICanvasRenderingContext2d.

Modified Paths:
--------------
    kazehakase/trunk/ChangeLog
    kazehakase/trunk/macros/gecko.m4
    kazehakase/trunk/module/embed/gecko/Makefile.am
    kazehakase/trunk/module/embed/gecko/gtkmozembed/MozillaPrivate.h
    kazehakase/trunk/module/embed/gecko/kz-gecko-embed.cpp
    kazehakase/trunk/module/embed/gecko/kz-mozwrapper.cpp
    kazehakase/trunk/module/embed/gecko/kz-mozwrapper.h

Removed Paths:
-------------
    kazehakase/trunk/module/embed/gecko/kz-mozthumbnailer.cpp
    kazehakase/trunk/module/embed/gecko/kz-mozthumbnailer.h

Modified: kazehakase/trunk/ChangeLog
===================================================================
--- kazehakase/trunk/ChangeLog	2009-07-25 05:20:02 UTC (rev 3774)
+++ kazehakase/trunk/ChangeLog	2009-07-25 05:54:36 UTC (rev 3775)
@@ -1,5 +1,10 @@
 2009-07-25  Hiroyuki Ikezoe  <poinc****@ikezo*****>
 
+	* macros/gecko.m4, module/embed/gecko/*:
+	Remove all stuffs concerned to nsICanvasRenderingContext2d.
+
+2009-07-25  Hiroyuki Ikezoe  <poinc****@ikezo*****>
+
 	* module/embed/gecko/kz-mozwrapper.[cpp|h],
 	module/embed/gecko/kz-mozthumbnailer.[cpp|h]:
 	EggPixbufThumbSize -> EggPixbufThumbnailSize

Modified: kazehakase/trunk/macros/gecko.m4
===================================================================
--- kazehakase/trunk/macros/gecko.m4	2009-07-25 05:20:02 UTC (rev 3774)
+++ kazehakase/trunk/macros/gecko.m4	2009-07-25 05:54:36 UTC (rev 3775)
@@ -102,19 +102,6 @@
 
 AC_MSG_RESULT([$result])
 
-AC_MSG_CHECKING([whether nsICanvasRenderingContextInternal has GetInputStream method])
-AC_COMPILE_IFELSE(
-	[AC_LANG_PROGRAM(
-		[[#include <nsICanvasRenderingContextInternal.h>
-		  #include <nsEmbedString.h>]],
-		[[nsICanvasRenderingContextInternal *p;
-		  p->GetInputStream (nsEmbedCString(), nsEmbedString(), nsnull);]]
-	)],
-	[AC_DEFINE([MOZ_NSICANVASRENDERINGCONTEXTINTERNAL_HAVE_GETINPUTSTREAM_],[1],[Define if nsICanvasRenderingContextInternal has GetInputStream]) no_nsicanvasrenderingcontextinternal_have_getinputstream=yes],
-	[no_nsicanvasrenderingcontextinternal_have_getinputstream=no])
-
-AC_MSG_RESULT([$result])
-
 AC_MSG_CHECKING([whether nsIAppShell has Spinup method])
 AC_COMPILE_IFELSE(
 	[AC_LANG_PROGRAM(
@@ -173,9 +160,6 @@
 AC_MSG_RESULT([$result])
 
 
-AC_CHECK_FILE([$MOZILLA_INCLUDE_ROOT/content/nsICanvasRenderingContextInternal.h],
-	[AC_DEFINE([HAVE_NSICANVASRENDERINGCONTEXTINTERNAL_H],[1],[Define if nsICanvasRenderingContextInternal.h exists])])
-
 dnl Not a simple file check due to the header being in the SDK since 1.8a6
 dnl https://bugzilla.mozilla.org/show_bug.cgi?id=271068
 
@@ -322,8 +306,6 @@
 
 AM_CONDITIONAL([HAVE_GECKO_1_8], [test $have_gecko_version_1_8 = "yes"])
 AM_CONDITIONAL([HAVE_GECKO_1_9], [test $have_gecko_version_1_9 = "yes"])
-AM_CONDITIONAL([MOZ_NO_NSICANVASRENDERINGCONTEXTINTERNAL_HAVE_GETINPUTSTREAM_],
-               [test "$no_nsicanvasrenderingcontextinternal_have_getinputstream" = "no"])
 
 AM_CONDITIONAL(HAVE_NSIBADCERTLISTENER_H,
                test "x$have_nsibadcertlistner_h" = "xyes")

Modified: kazehakase/trunk/module/embed/gecko/Makefile.am
===================================================================
--- kazehakase/trunk/module/embed/gecko/Makefile.am	2009-07-25 05:20:02 UTC (rev 3774)
+++ kazehakase/trunk/module/embed/gecko/Makefile.am	2009-07-25 05:54:36 UTC (rev 3775)
@@ -86,7 +86,6 @@
 	kz-mozprogresslistener.cpp kz-mozprogresslistener.h \
 	kz-mozutils.cpp kz-mozutils.h \
 	kz-mozwrapper.cpp kz-mozwrapper.h \
-	kz-mozthumbnailer.cpp kz-mozthumbnailer.h \
 	kz-mozhistorysearch.cpp kz-mozhistorysearch.h \
 	kz-mozcookiepromptservice.cpp kz-mozcookiepromptservice.h
 

Modified: kazehakase/trunk/module/embed/gecko/gtkmozembed/MozillaPrivate.h
===================================================================
--- kazehakase/trunk/module/embed/gecko/gtkmozembed/MozillaPrivate.h	2009-07-25 05:20:02 UTC (rev 3774)
+++ kazehakase/trunk/module/embed/gecko/gtkmozembed/MozillaPrivate.h	2009-07-25 05:54:36 UTC (rev 3775)
@@ -35,9 +35,6 @@
 #include <nsISelection.h>
 #include <nsIDocShell.h>
 #include <nsIBaseWindow.h>
-#ifdef MOZ_NSICANVASRENDERINGCONTEXTINTERNAL_HAVE_GETINPUTSTREAM_
-#include "egg-pixbuf-thumbnail.h"
-#endif
 #ifdef HAVE_CONFIG_H
 #include "config.h"
 #endif

Modified: kazehakase/trunk/module/embed/gecko/kz-gecko-embed.cpp
===================================================================
--- kazehakase/trunk/module/embed/gecko/kz-gecko-embed.cpp	2009-07-25 05:20:02 UTC (rev 3774)
+++ kazehakase/trunk/module/embed/gecko/kz-gecko-embed.cpp	2009-07-25 05:54:36 UTC (rev 3775)
@@ -2807,14 +2807,6 @@
 		last_modified = now.tv_sec;
 	}
 
-#ifdef MOZ_NSICANVASRENDERINGCONTEXTINTERNAL_HAVE_GETINPUTSTREAM_
-	KzGeckoEmbedPrivate *priv = KZ_GECKO_EMBED_GET_PRIVATE (kzembed);
-	KzMozWrapper *wrapper = priv->wrapper;
-	g_return_if_fail (wrapper != NULL);
-
-	wrapper->CreateThumbnail(uri, last_modified, size);
-#else
-
 	GdkDrawable *window;
 	gint width, height;
 	GdkPixbuf *pixbuf, *thumbnail;
@@ -2843,7 +2835,6 @@
 	KZ_CREATE_THUMBNAIL(thumbnail, uri, last_modified, size);
 
 	g_object_unref(thumbnail);
-#endif
 }
 
 

Deleted: kazehakase/trunk/module/embed/gecko/kz-mozthumbnailer.cpp
===================================================================
--- kazehakase/trunk/module/embed/gecko/kz-mozthumbnailer.cpp	2009-07-25 05:20:02 UTC (rev 3774)
+++ kazehakase/trunk/module/embed/gecko/kz-mozthumbnailer.cpp	2009-07-25 05:54:36 UTC (rev 3775)
@@ -1,118 +0,0 @@
-// -*- Mode: C++; tab-width: 8; indent-tabs-mode: t; c-basic-offset: 8 -*-
-//
-//  Copyright (C) 2008 Kouhei Sutou
-//
-//  This program is free software; you can redistribute it and/or modify
-//  it under the terms of the GNU General Public License as published by
-//  the Free Software Foundation; either version 2, or (at your option)
-//  any later version.
-//
-//  This program 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 General Public License for more details.
-//
-//  You should have received a copy of the GNU General Public License
-//  along with this program; if not, write to the Free Software
-//  Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
-//
-
-#ifdef HAVE_CONFIG_H
-#  include "config.h"
-#endif /* HAVE_CONFIG_H */
-
-#include "kazehakase.h"
-
-#define MOZILLA_INTERNAL_API
-#include <nsIComponentManager.h>
-#ifdef MOZ_NSICANVASRENDERINGCONTEXTINTERNAL_HAVE_GETINPUTSTREAM_
-#  include <nsICanvasRenderingContextInternal.h>
-#  include <nsIDOMCanvasRenderingContext2D.h>
-#undef MOZILLA_INTERNAL_API
-
-// MUSE SET HERE that after nsStringAPI included with MOZILLA_INTERNAL_API.
-#include "kz-mozthumbnailer.h"
-
-
-#define KZ_CANVAS_WIDTH 1024
-#define KZ_CANVAS_HEIGHT 800
-
-
-gboolean
-KzMozThumbnailer::CreateThumbnail(nsIDOMWindow *domWindow, const gchar *uri,
-                                  guint last_modified, EggPixbufThumbnailSize size)
-{
-	nsresult rv;
-	
-	nsCOMPtr<nsICanvasRenderingContextInternal> context;
-	context = do_CreateInstance("@mozilla.org/content/canvas-rendering-context;1?id=2d", &rv);
-	if (NS_FAILED(rv) || !context) return FALSE;
-	context->SetDimensions(size, KZ_THUMB_HEIGHT);
-	context->SetCanvasElement(nsnull);
-	nsCOMPtr<nsIDOMCanvasRenderingContext2D> domCanvas = do_QueryInterface(context, &rv);
-	if (NS_FAILED(rv) || !domCanvas) return FALSE;
-
-#if 0
-	nsCOMPtr<nsIDOMDocument> domDoc;
-	domWindow->GetDocument(getter_AddRefs(domDoc));
-#endif
-	float sx = (float) size / KZ_CANVAS_WIDTH;
-	float sy = (float) KZ_THUMB_HEIGHT / KZ_CANVAS_HEIGHT;
-	domCanvas->Scale(sx, sy);
-	rv = domCanvas->DrawWindow(domWindow, 0, 0, KZ_CANVAS_WIDTH, KZ_CANVAS_HEIGHT, nsEmbedString("rgb(0,0,0)")); 
-	if (NS_FAILED(rv)) return FALSE;
-
-	nsCOMPtr<nsIInputStream> imgStream;
-	rv = context->GetInputStream(NS_LITERAL_CSTRING("image/png"), EmptyString(), getter_AddRefs(imgStream));
-	if (NS_FAILED(rv) || !imgStream) return FALSE;
-
-	// this code wa picked from content/html/content/src/nsHTMLCanvasElement.cpp in firefox-2.0b.
-	PRUint32 bufSize;
-	rv = imgStream->Available(&bufSize);
-	if (NS_FAILED(rv)) return FALSE;
-
-	bufSize += 16;
-	PRUint32 imgSize = 0;
-	char* imgData = (char*)g_malloc((gulong)bufSize);
-	if (!imgData) return FALSE;
-
-	PRUint32 numReadThisTime = 0;
-	while ((rv = imgStream->Read(&imgData[imgSize], bufSize - imgSize,
-					&numReadThisTime)) == NS_OK && numReadThisTime > 0)
-	{
-		imgSize += numReadThisTime;
-		if (imgSize == bufSize)
-		{
-			// need a bigger buffer, just double
-			bufSize *= 2;
-			char* newImgData = (char*)g_realloc(imgData, (gulong)bufSize);
-			if (!newImgData)
-			{
-				g_free(imgData);
-				return FALSE;
-			}
-			imgData = newImgData;
-		}
-	}
-
-	GdkPixbufLoader *loader = gdk_pixbuf_loader_new_with_mime_type("image/png", NULL);
-	if (!loader)
-	{
-		g_free(imgData);
-		return FALSE;
-	}
-	gdk_pixbuf_loader_write(loader, (const guchar *)imgData, (gsize)imgSize, NULL);
-	g_free(imgData);
-	GdkPixbuf *thumbnail = gdk_pixbuf_loader_get_pixbuf(loader);
-	gdk_pixbuf_loader_close(loader, NULL);
-
-	if (!thumbnail)
-		return FALSE;
-
-        KZ_CREATE_THUMBNAIL(thumbnail, uri, last_modified, size);
-
-	g_object_unref(thumbnail);
-	
-	return TRUE;
-}
-#endif

Deleted: kazehakase/trunk/module/embed/gecko/kz-mozthumbnailer.h
===================================================================
--- kazehakase/trunk/module/embed/gecko/kz-mozthumbnailer.h	2009-07-25 05:20:02 UTC (rev 3774)
+++ kazehakase/trunk/module/embed/gecko/kz-mozthumbnailer.h	2009-07-25 05:54:36 UTC (rev 3775)
@@ -1,40 +0,0 @@
-// -*- Mode: C++; tab-width: 8; indent-tabs-mode: t; c-basic-offset: 8 -*-
-
-//
-//  Copyright (C) 2008 Kouhei Sutou
-//
-//  This program is free software; you can redistribute it and/or modify
-//  it under the terms of the GNU General Public License as published by
-//  the Free Software Foundation; either version 2, or (at your option)
-//  any later version.
-//
-//  This program 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 General Public License for more details.
-//
-//  You should have received a copy of the GNU General Public License
-//  along with this program; if not, write to the Free Software
-//  Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
-//
-
-
-#ifndef __KZ_MOZTHUMBNAILER_H__
-#define __KZ_MOZTHUMBNAILER_H__
-
-#include <nsIDOMWindow.h>
-#ifdef MOZ_NSICANVASRENDERINGCONTEXTINTERNAL_HAVE_GETINPUTSTREAM_
-#include "egg-pixbuf-thumbnail.h"
-#endif
-
-namespace KzMozThumbnailer
-{
-#ifdef MOZ_NSICANVASRENDERINGCONTEXTINTERNAL_HAVE_GETINPUTSTREAM_
-	gboolean  CreateThumbnail     (nsIDOMWindow *domWindow,
-                                       const gchar *uri,
-                                       guint last_modified,
-                                       EggPixbufThumbnailSize size);
-#endif
-};
-
-#endif

Modified: kazehakase/trunk/module/embed/gecko/kz-mozwrapper.cpp
===================================================================
--- kazehakase/trunk/module/embed/gecko/kz-mozwrapper.cpp	2009-07-25 05:20:02 UTC (rev 3774)
+++ kazehakase/trunk/module/embed/gecko/kz-mozwrapper.cpp	2009-07-25 05:54:36 UTC (rev 3775)
@@ -111,7 +111,6 @@
 #include "kz-mozutils.h"
 #include "utils.h"
 #include "kz-bookmark.h"
-#include "kz-mozthumbnailer.h"
 
 # include <nsISSLStatus.h>
 # include <nsISSLStatusProvider.h>
@@ -2063,23 +2062,6 @@
 	return certDialogs->ViewCert (NULL, serverCert);
 }
 
-#ifdef MOZ_NSICANVASRENDERINGCONTEXTINTERNAL_HAVE_GETINPUTSTREAM_
-nsresult
-KzMozWrapper::CreateThumbnail (const gchar *uri,
-			       guint last_modified,
-			       EggPixbufThumbnailSize size)
-{
-	nsCOMPtr<nsIDOMWindow> domWindow;
-	GetDOMWindow(getter_AddRefs(domWindow));
-
- 	if (!KzMozThumbnailer::CreateThumbnail(domWindow, uri,
-					       last_modified, size))
-		return NS_ERROR_FAILURE;
-
-	return NS_OK;
-}
-#endif
-
 gboolean
 KzMozWrapper::GetRootRange (nsIDOMDocument *domDoc, nsIDOMRange *range)
 {

Modified: kazehakase/trunk/module/embed/gecko/kz-mozwrapper.h
===================================================================
--- kazehakase/trunk/module/embed/gecko/kz-mozwrapper.h	2009-07-25 05:20:02 UTC (rev 3774)
+++ kazehakase/trunk/module/embed/gecko/kz-mozwrapper.h	2009-07-25 05:54:36 UTC (rev 3775)
@@ -34,9 +34,6 @@
 #include "kz-gecko-embed.h"
 #include "kz-mozselectionlistener.h"
 #include "kz-mozeventlistener.h"
-#ifdef MOZ_NSICANVASRENDERINGCONTEXTINTERNAL_HAVE_GETINPUTSTREAM_
-#include "egg-pixbuf-thumbnail.h"
-#endif
 
 class nsISecureBrowserUI;
 class nsISSLStatus;
@@ -149,12 +146,6 @@
 
 	nsresult ShowPageCertificate     (void);
 
-#ifdef MOZ_NSICANVASRENDERINGCONTEXTINTERNAL_HAVE_GETINPUTSTREAM_
-	nsresult CreateThumbnail	 (const gchar *uri,
-					  guint last_modified,
-					  EggPixbufThumbnailSize size);
-#endif
-
 	nsCOMPtr<nsIWebBrowser>    mWebBrowser;
 protected:
 	nsCOMPtr<nsIDOMEventTarget>   mEventTarget;




More information about the Kazehakase-cvs mailing list
Zurück zum Archiv-Index