Re: [PHP-CVS] cvs: php-src(PHP_5_2) /ext/gd config.w32 gd.c php_gd.h

2007-04-18 Thread Ilia Alshanetsky


On 17-Apr-07, at 11:31 AM, Pierre-Alain Joye wrote:


pajoye  Tue Apr 17 15:31:45 2007 UTC

  Modified files:  (Branch: PHP_5_2)
/php-src/ext/gd config.w32 gd.c php_gd.h
  Log:
  - MFH: add imagegrabwindow and imagegrabscreen (win32 only) [DOC]
capture a window using its handle or a full screen


It is too late for new features for 5.2.2. Please either revert this  
commit or put it into the #ifdef 0 block as Tony had suggested.


Ilia

--
PHP CVS Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



[PHP-CVS] cvs: php-src(PHP_5_2) /ext/gd config.w32 gd.c php_gd.h

2007-04-17 Thread Pierre-Alain Joye
pajoye  Tue Apr 17 15:31:45 2007 UTC

  Modified files:  (Branch: PHP_5_2)
/php-src/ext/gd config.w32 gd.c php_gd.h 
  Log:
  - MFH: add imagegrabwindow and imagegrabscreen (win32 only) [DOC]
capture a window using its handle or a full screen
  
http://cvs.php.net/viewvc.cgi/php-src/ext/gd/config.w32?r1=1.10.4.3r2=1.10.4.4diff_format=u
Index: php-src/ext/gd/config.w32
diff -u php-src/ext/gd/config.w32:1.10.4.3 php-src/ext/gd/config.w32:1.10.4.4
--- php-src/ext/gd/config.w32:1.10.4.3  Wed Apr 11 11:44:20 2007
+++ php-src/ext/gd/config.w32   Tue Apr 17 15:31:45 2007
@@ -1,4 +1,4 @@
-// $Id: config.w32,v 1.10.4.3 2007/04/11 11:44:20 pajoye Exp $
+// $Id: config.w32,v 1.10.4.4 2007/04/17 15:31:45 pajoye Exp $
 // vim:ft=javascript
 
 ARG_WITH(gd, Bundled GD support, yes,shared);
@@ -24,6 +24,9 @@
CHECK_LIB(zlib.lib, gd, PHP_GD);
}
 
+   CHECK_LIB(User32.lib, gd, PHP_GD);
+   CHECK_LIB(Gdi32.lib, gd, PHP_GD);
+
EXTENSION(gd, gd.c gdttf.c, null, -Iext/gd/libgd, 
php_gd2.dll);
ADD_SOURCES(ext/gd/libgd, gd2copypal.c gd_arc_f_buggy.c gd.c 
\
gdcache.c gdfontg.c gdfontl.c gdfontmb.c gdfonts.c 
gdfontt.c \
http://cvs.php.net/viewvc.cgi/php-src/ext/gd/gd.c?r1=1.312.2.20.2.20r2=1.312.2.20.2.21diff_format=u
Index: php-src/ext/gd/gd.c
diff -u php-src/ext/gd/gd.c:1.312.2.20.2.20 php-src/ext/gd/gd.c:1.312.2.20.2.21
--- php-src/ext/gd/gd.c:1.312.2.20.2.20 Fri Apr  6 15:38:35 2007
+++ php-src/ext/gd/gd.c Tue Apr 17 15:31:45 2007
@@ -18,7 +18,7 @@
+--+
  */
 
-/* $Id: gd.c,v 1.312.2.20.2.20 2007/04/06 15:38:35 pajoye Exp $ */
+/* $Id: gd.c,v 1.312.2.20.2.21 2007/04/17 15:31:45 pajoye Exp $ */
 
 /* gd 1.2 is copyright 1994, 1995, Quest Protein Database Center,
Cold Spring Harbor Labs. */
@@ -52,6 +52,9 @@
 #ifdef PHP_WIN32
 # include io.h
 # include fcntl.h
+#include windows.h
+#include Winuser.h
+#include Wingdi.h
 #endif
 
 #if HAVE_LIBGD
@@ -314,6 +317,18 @@
 ZEND_END_ARG_INFO()
 #endif
 
+#ifdef PHP_WIN32
+static
+ZEND_BEGIN_ARG_INFO(arginfo_imagegrabwindow, 0, 0, 1)
+   ZEND_ARG_INFO(0, handle)
+   ZEND_ARG_INFO(0, client_area)
+ZEND_END_ARG_INFO()
+
+static
+ZEND_BEGIN_ARG_INFO(arginfo_imagegrabscreen, 0)
+ZEND_END_ARG_INFO()
+#endif
+
 #ifdef HAVE_GD_BUNDLED
 static
 ZEND_BEGIN_ARG_INFO_EX(arginfo_imagerotate, 0, 0, 3)
@@ -1020,6 +1035,11 @@
PHP_FE(imagecopyresampled,  
arginfo_imagecopyresampled)
 #endif
 
+#ifdef PHP_WIN32
+   PHP_FE(imagegrabwindow, 
arginfo_imagegrabwindow)
+   PHP_FE(imagegrabscreen, 
arginfo_imagegrabscreen)
+#endif
+
 #ifdef HAVE_GD_BUNDLED
PHP_FE(imagerotate, 
arginfo_imagerotate)
PHP_FE(imageantialias,  
arginfo_imageantialias)
@@ -2069,6 +2089,155 @@
 /* }}} */
 #endif
 
+#ifdef PHP_WIN32
+/* {{{ proto resource imagegrabwindow(int window_handle [, int client_area])
+   Grab a window or its client area using a windows handle (HWND property in 
COM instance) */
+PHP_FUNCTION(imagegrabwindow)
+{
+   HWND window;
+   long client_area = 0;
+   RECT rc = {0};
+   RECT rc_win = {0};
+   int Width, Height;
+   HDC hdc;
+   HDC memDC;
+   HBITMAP memBM;
+   HBITMAP hOld;
+   HINSTANCE handle;
+   long lwindow_handle;
+   typedef BOOL (WINAPI *tPrintWindow)(HWND, HDC,UINT);
+   tPrintWindow pPrintWindow = 0;
+   gdImagePtr im;
+
+   if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, l|l, 
lwindow_handle, client_area) == FAILURE) {
+   RETURN_FALSE;
+   }
+
+   window = (HWND) lwindow_handle;
+
+   if (!IsWindow(window)) {
+   php_error_docref(NULL TSRMLS_CC, E_NOTICE, Invalid window 
handle);
+   RETURN_FALSE;
+   }
+
+   hdc = GetDC(0);
+
+   if (client_area) {
+   GetClientRect(window, rc);
+   Width = rc.right;
+   Height = rc.bottom;
+   } else {
+   GetWindowRect(window, rc);
+   Width   = rc.right - rc.left;
+   Height  = rc.bottom - rc.top;
+   }
+
+   Width   = (Width/4)*4;
+
+   memDC   = CreateCompatibleDC(hdc);
+   memBM   = CreateCompatibleBitmap(hdc, Width, Height);
+   hOld= (HBITMAP) SelectObject (memDC, memBM);
+
+
+   handle = LoadLibrary(User32.dll);
+   if ( handle == 0 ) {
+   goto clean;
+   }
+   pPrintWindow = (tPrintWindow) GetProcAddress(handle, PrintWindow);  
+
+   if ( pPrintWindow )  {
+   pPrintWindow(window, memDC, (UINT) client_area);
+   } else {
+   

Re: [PHP-CVS] cvs: php-src(PHP_5_2) /ext/gd config.w32 gd.c php_gd.h

2007-04-17 Thread Antony Dovgal

On 04/17/2007 09:29 PM, Marcus Boerger wrote:

Hello Pierre-Alain,

  since when are we adding major new features to release branches?


Pierre, please leave this function for HEAD only, we don't add new features to 
5.2.
Thanks. 


--
Wbr, 
Antony Dovgal


--
PHP CVS Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



Re: [PHP-CVS] cvs: php-src(PHP_5_2) /ext/gd config.w32 gd.c php_gd.h

2007-04-17 Thread Antony Dovgal

On 04/17/2007 09:53 PM, Pierre Joye wrote:

On 4/17/07, Antony Dovgal [EMAIL PROTECTED] wrote:

On 04/17/2007 09:29 PM, Marcus Boerger wrote:
 Hello Pierre-Alain,

   since when are we adding major new features to release branches?

Pierre, please leave this function for HEAD only, we don't add new features to 
5.2.


Well, do you really see a problem in these two self contained
functions? They don't affect anything else in ext/gd or php and are on
windows only.


Don't get me wrong, it's not about you or the functions.
We have some rules and I believe everybody should abide by them.

--
Wbr, 
Antony Dovgal


--
PHP CVS Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



Re: [PHP-CVS] cvs: php-src(PHP_5_2) /ext/gd config.w32 gd.c php_gd.h

2007-04-17 Thread Edin Kadribasic


On 17/04/2007, at 20.01, Antony Dovgal wrote:


On 04/17/2007 09:53 PM, Pierre Joye wrote:

On 4/17/07, Antony Dovgal [EMAIL PROTECTED] wrote:

On 04/17/2007 09:29 PM, Marcus Boerger wrote:
 Hello Pierre-Alain,

   since when are we adding major new features to release branches?

Pierre, please leave this function for HEAD only, we don't add  
new features to 5.2.

Well, do you really see a problem in these two self contained
functions? They don't affect anything else in ext/gd or php and  
are on

windows only.


Don't get me wrong, it's not about you or the functions.
We have some rules and I believe everybody should abide by them.


Hi Antony, Marcus,

This is simply not true. 5.2.x is not simply bug fix release. Minor  
and major functionality is added all the time. If you're too lazy to  
read the CVS I can list them for you.


So please don't comment on commits based on who is making them.

Edin

--
PHP CVS Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



Re: [PHP-CVS] cvs: php-src(PHP_5_2) /ext/gd config.w32 gd.c php_gd.h

2007-04-17 Thread Marcus Boerger
Hello Edin,

  either way it is ridiculous to add new features in the middle of a releace
process. We are not only in a release branch here. We are even in a middle
of a release. In one that is even security focused.

best regards
marcus

Tuesday, April 17, 2007, 8:27:50 PM, you wrote:

 On 17/04/2007, at 20.01, Antony Dovgal wrote:

 On 04/17/2007 09:53 PM, Pierre Joye wrote:
 On 4/17/07, Antony Dovgal [EMAIL PROTECTED] wrote:
 On 04/17/2007 09:29 PM, Marcus Boerger wrote:
  Hello Pierre-Alain,
 
since when are we adding major new features to release branches?

 Pierre, please leave this function for HEAD only, we don't add  
 new features to 5.2.
 Well, do you really see a problem in these two self contained
 functions? They don't affect anything else in ext/gd or php and  
 are on
 windows only.

 Don't get me wrong, it's not about you or the functions.
 We have some rules and I believe everybody should abide by them.

 Hi Antony, Marcus,

 This is simply not true. 5.2.x is not simply bug fix release. Minor  
 and major functionality is added all the time. If you're too lazy to  
 read the CVS I can list them for you.

 So please don't comment on commits based on who is making them.

 Edin




Best regards,
 Marcus

-- 
PHP CVS Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



Re: [PHP-CVS] cvs: php-src(PHP_5_2) /ext/gd config.w32 gd.c php_gd.h

2007-04-17 Thread Derick Rethans
On Tue, 17 Apr 2007, Antony Dovgal wrote:

 On 04/17/2007 09:29 PM, Marcus Boerger wrote:
  Hello Pierre-Alain,
  
since when are we adding major new features to release branches?
 
 Pierre, please leave this function for HEAD only, we don't add new features to
 5.2.

That's not true - we added many functions. I see no problems with those 
two new functions, but I think it'd be smarter to introduce them in 
5.2.3 as we just released an RC. I don't think we should *then* add more 
functions as with this we need to keep releasing new RCs.

regards,
Derick

-- 
Derick Rethans
http://derickrethans.nl | http://ez.no | http://xdebug.org

-- 
PHP CVS Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



Re: [PHP-CVS] cvs: php-src(PHP_5_2) /ext/gd config.w32 gd.c php_gd.h

2007-04-17 Thread Marcus Boerger
Hello Derick,

Tuesday, April 17, 2007, 8:58:40 PM, you wrote:

 On Tue, 17 Apr 2007, Antony Dovgal wrote:

 On 04/17/2007 09:29 PM, Marcus Boerger wrote:
  Hello Pierre-Alain,
  
since when are we adding major new features to release branches?
 
 Pierre, please leave this function for HEAD only, we don't add new features 
 to
 5.2.

 That's not true - we added many functions. I see no problems with those 
 two new functions, but I think it'd be smarter to introduce them in 
 5.2.3 as we just released an RC. I don't think we should *then* add more 
 functions as with this we need to keep releasing new RCs.

Fine with me. Though personally I hope we create 5.3 from 5.2.2 and avoid
this kind of discussion.

best regards
marcus

-- 
PHP CVS Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



Re: [PHP-CVS] cvs: php-src(PHP_5_2) /ext/gd config.w32 gd.c php_gd.h

2007-04-17 Thread Edin Kadribasic

Hello Marcus,

Did I miss your mail to Dmitry about making *major* engine changes to  
add Win64 support? I must also have lost your mail to Jani for adding  
new features to FastCGI too? I think I need to double check my spam  
filter.


Or was your response more in regard of *who* committed it than *what*  
was committed (major engine change versus two self-contained windows  
only functions)?


Edin



On 17/04/2007, at 20.51, Marcus Boerger wrote:


Hello Edin,

  either way it is ridiculous to add new features in the middle of  
a releace
process. We are not only in a release branch here. We are even in a  
middle

of a release. In one that is even security focused.

best regards
marcus

Tuesday, April 17, 2007, 8:27:50 PM, you wrote:


On 17/04/2007, at 20.01, Antony Dovgal wrote:



On 04/17/2007 09:53 PM, Pierre Joye wrote:

On 4/17/07, Antony Dovgal [EMAIL PROTECTED] wrote:

On 04/17/2007 09:29 PM, Marcus Boerger wrote:

Hello Pierre-Alain,

  since when are we adding major new features to release  
branches?


Pierre, please leave this function for HEAD only, we don't add
new features to 5.2.

Well, do you really see a problem in these two self contained
functions? They don't affect anything else in ext/gd or php and
are on
windows only.


Don't get me wrong, it's not about you or the functions.
We have some rules and I believe everybody should abide by them.



Hi Antony, Marcus,



This is simply not true. 5.2.x is not simply bug fix release. Minor
and major functionality is added all the time. If you're too lazy to
read the CVS I can list them for you.



So please don't comment on commits based on who is making them.



Edin





Best regards,
 Marcus



--
PHP CVS Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



Re: [PHP-CVS] cvs: php-src(PHP_5_2) /ext/gd config.w32 gd.c php_gd.h

2007-04-17 Thread Edin Kadribasic

On 17/04/2007, at 21.08, Marcus Boerger wrote:


Hello Derick,

Tuesday, April 17, 2007, 8:58:40 PM, you wrote:


On Tue, 17 Apr 2007, Antony Dovgal wrote:



On 04/17/2007 09:29 PM, Marcus Boerger wrote:

Hello Pierre-Alain,

  since when are we adding major new features to release branches?


Pierre, please leave this function for HEAD only, we don't add  
new features to

5.2.


That's not true - we added many functions. I see no problems with  
those

two new functions, but I think it'd be smarter to introduce them in
5.2.3 as we just released an RC. I don't think we should *then*  
add more

functions as with this we need to keep releasing new RCs.


Fine with me. Though personally I hope we create 5.3 from 5.2.2 and  
avoid

this kind of discussion.


Another option is to re-release RC1. Give people early chance to test  
win64 release?


Or make 5.2.2 as mostly security release and leave these new features  
for 5.2.3. I don't think we need 5.3.x as long as we can maintain  
binary compatibility.


Edin

--
PHP CVS Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



Re: [PHP-CVS] cvs: php-src(PHP_5_2) /ext/gd config.w32 gd.c php_gd.h

2007-04-17 Thread Marcus Boerger
Hello Edin,

  it appears i should read cvs commits more carefully. I thought that win64
change was a pretty easy one not affecting anything else. Reviewing it again
i get a different opinion. And sorry but I can't care less about FCGI and
whether someone moves stuff from CLI to FCGI. Or did jani do more than we
were discussing?

best regards
marcus

And for the record. The stuff Pierre added is cool and yes I am even a
windows user

Tuesday, April 17, 2007, 9:09:34 PM, you wrote:

 Hello Marcus,

 Did I miss your mail to Dmitry about making *major* engine changes to  
 add Win64 support? I must also have lost your mail to Jani for adding  
 new features to FastCGI too? I think I need to double check my spam  
 filter.

 Or was your response more in regard of *who* committed it than *what*  
 was committed (major engine change versus two self-contained windows  
 only functions)?

 Edin



 On 17/04/2007, at 20.51, Marcus Boerger wrote:

 Hello Edin,

   either way it is ridiculous to add new features in the middle of  
 a releace
 process. We are not only in a release branch here. We are even in a  
 middle
 of a release. In one that is even security focused.

 best regards
 marcus

 Tuesday, April 17, 2007, 8:27:50 PM, you wrote:

 On 17/04/2007, at 20.01, Antony Dovgal wrote:

 On 04/17/2007 09:53 PM, Pierre Joye wrote:
 On 4/17/07, Antony Dovgal [EMAIL PROTECTED] wrote:
 On 04/17/2007 09:29 PM, Marcus Boerger wrote:
 Hello Pierre-Alain,

   since when are we adding major new features to release  
 branches?

 Pierre, please leave this function for HEAD only, we don't add
 new features to 5.2.
 Well, do you really see a problem in these two self contained
 functions? They don't affect anything else in ext/gd or php and
 are on
 windows only.

 Don't get me wrong, it's not about you or the functions.
 We have some rules and I believe everybody should abide by them.

 Hi Antony, Marcus,

 This is simply not true. 5.2.x is not simply bug fix release. Minor
 and major functionality is added all the time. If you're too lazy to
 read the CVS I can list them for you.

 So please don't comment on commits based on who is making them.

 Edin




 Best regards,
  Marcus





Best regards,
 Marcus

-- 
PHP CVS Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



Re: [PHP-CVS] cvs: php-src(PHP_5_2) /ext/gd config.w32 gd.c php_gd.h

2007-04-17 Thread Edin Kadribasic

On 17/04/2007, at 21.24, Marcus Boerger wrote:


Hello Edin,

  it appears i should read cvs commits more carefully. I thought  
that win64
change was a pretty easy one not affecting anything else. Reviewing  
it again
i get a different opinion. And sorry but I can't care less about  
FCGI and
whether someone moves stuff from CLI to FCGI. Or did jani do more  
than we

were discussing?


And yet two self-contained functions inside #ifdef PHP_WIN32 in gd  
module warrant your scrutiny? But never mind. My only goal with my  
post was to promote even-handed application of the principle no new  
features after RC1.


Edin

--
PHP CVS Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php