Scott Ellis | 4 Jul 03:13 2007
Picon

GG patch

Hi All,

Been getting lots of complaints about doubled-up message windows when receiving messages over the Gadu-Gadu protocol.

This is due to an error with the db even flag logic that existed in nearly all the other protocols too but has since been fixed.

Attached are two patches to fix this problem in the services.c file of GG. The first patch just fixes the bitwise logic. The second patch uses the new core 'proto recv' service.

Please, someone apply one. Thanks,

Scott

Attachment (services.c.2.patch): application/octet-stream, 1313 bytes
-------------------------------------------------------------------------
This SF.net email is sponsored by DB2 Express
Download DB2 Express C - the FREE version of DB2 express and take
control of your XML. No limits. Just data. Click to get it now.
http://sourceforge.net/powerbar/db2/
_______________________________________________
Miranda-Develop mailing list
Miranda-Develop@...
https://lists.sourceforge.net/lists/listinfo/miranda-develop
Adam Strzelecki | 4 Jul 11:55 2007
Picon

Re: GG patch

Scott,

> Please, someone apply one. Thanks,
I think this would be me.

Thanks a lot,
--

-- 
: nanoANT Adam Strzelecki :
:       nanoant.com       :

-------------------------------------------------------------------------
This SF.net email is sponsored by DB2 Express
Download DB2 Express C - the FREE version of DB2 express and take
control of your XML. No limits. Just data. Click to get it now.
http://sourceforge.net/powerbar/db2/
Adam Strzelecki | 4 Jul 11:57 2007
Picon

Re: GG patch

Scott,

> Attached are two patches to fix this problem in the services.c file of
> GG. The first patch just fixes the bitwise logic. The second patch uses
> the new core 'proto recv' service.
Ouch.. I see only one patch attached. Can you please resend 2nd one?

Cheers,
--

-- 
: nanoANT Adam Strzelecki :
:       nanoant.com       :

-------------------------------------------------------------------------
This SF.net email is sponsored by DB2 Express
Download DB2 Express C - the FREE version of DB2 express and take
control of your XML. No limits. Just data. Click to get it now.
http://sourceforge.net/powerbar/db2/
Scott Ellis | 4 Jul 13:37 2007
Picon

Re: GG patch

oops - i think that was actually the second one, but here's the first one again

thanks Adam

On 7/4/07, Adam Strzelecki < ono-VmbhqvGFtmE@public.gmane.org> wrote:
Scott,

> Attached are two patches to fix this problem in the services.c file of
> GG. The first patch just fixes the bitwise logic. The second patch uses
> the new core 'proto recv' service.
Ouch.. I see only one patch attached. Can you please resend 2nd one?

Cheers,
--
: nanoANT Adam Strzelecki :
:       nanoant.com       :

-------------------------------------------------------------------------
This SF.net email is sponsored by DB2 Express
Download DB2 Express C - the FREE version of DB2 express and take
control of your XML. No limits. Just data. Click to get it now.
http://sourceforge.net/powerbar/db2/
_______________________________________________
Miranda-Develop mailing list
Miranda-Develop-5NWGOfrQmneRv+LV9MX5uipxlwaOVQ5f@public.gmane.org
https://lists.sourceforge.net/lists/listinfo/miranda-develop

Attachment (services.c.patch): application/octet-stream, 705 bytes
-------------------------------------------------------------------------
This SF.net email is sponsored by DB2 Express
Download DB2 Express C - the FREE version of DB2 express and take
control of your XML. No limits. Just data. Click to get it now.
http://sourceforge.net/powerbar/db2/
_______________________________________________
Miranda-Develop mailing list
Miranda-Develop@...
https://lists.sourceforge.net/lists/listinfo/miranda-develop
Adam Strzelecki | 4 Jul 14:06 2007

advaimg (Imgage Service) memory functions reduntant + LoadMem should autodetect format

Hi Devs,

Since I'm moving some parts of GG plugin to use "advaimg" for Image
sending/reception I found out that there're 2 things that bothers me in
this plugin (service):

1) FI_LoadFromMem & FI_SaveToMem are totally useless as since FreeImage
v3 memory read/write is handled directly by FreeImage_OpenMemory,
FreeImage_LoadFromMemory, and etc. which are exactly the same wrappers
for I/O

2) serviceLoadFromMem should try to autodetect format when FIF_UNKNOWN
or -1 is specified as it often happens we receive only binary chunk from
network without format info, also it often happens too that .gif files
are .jpegs etc.
Basically I really need this in order to GG Image reception work
properly, because I don't get file format info at all.

Therefore here's my commit proposal (see attached patch):

1) Removed all FI_LoadFromMem, FI_SaveToMem functions as they're already
in FreeImage v3 (MemoryIO.cpp). I didn't found anybody using those
anyway in Miranda (correct me if I'm wrong).. anyway I think one should
use: FI_OpenMemory, FI_CloseMemory, FI_LoadFromMemory anyway.

2) Changed serviceLoadFromMem function to use FreeImage_OpenMemory,
FreeImage_LoadFromMemory, FreeImage_CloseMemory and
FreeImage_GetFileTypeFromMemory when needed (FIF_UNKNOWN).

I'm aware that this changes m_imgsrvc.h FI_INTERFACE so AvatarService
and anyone else needs to be recompiled in order to make it run properly.

Anyway anybody else than AVS is using FI_INTERFACE ??

Cheers,
-- 
: nanoANT Adam Strzelecki :
:       nanoant.com       :
Index: include/m_imgsrvc.h
===================================================================
--- include/m_imgsrvc.h	(wersja 5802)
+++ include/m_imgsrvc.h	(kopia robocza)
 <at>  <at>  -40,36 +40,7  <at>  <at> 
 
 #define FI_IF_VERSION (PLUGIN_MAKE_VERSION(0, 0, 1, 0))           // interface version - must match
 
-// memory i/o defs
-
 /*
- * this struct defines a memio job.
- * datalen and filename must match and must be populated to the size of the memory buffer (caution)
- * data must point to the buffer.
- * curpos is internal and should be initialized to 0
- */
-
-typedef struct fiio_mem_handle_s {
-	long filelen,datalen,curpos;
-	void *data;
-} fiio_mem_handle;
-
-/* it is up to the user to create a fiio_mem_handle and init datalen and data
- * filelen will be pre-set to 0 by SaveToMem
- * curpos will be pre-set to 0 by SaveToMem and LoadFromMem
- * IMPORTANT: data should be set to NULL and datalen to 0,
- *            unless the user wants to manually malloc a larger buffer
- */
-FIBITMAP *FreeImage_LoadFromMem(FREE_IMAGE_FORMAT fif, fiio_mem_handle *handle, int flags);
-BOOL FreeImage_SaveToMem(FREE_IMAGE_FORMAT fif, FIBITMAP *dib, fiio_mem_handle *handle, int flags);
-
-void SetMemIO(FreeImageIO *io);
-unsigned __stdcall fiio_mem_ReadProc(void *buffer, unsigned size, unsigned count, fi_handle handle);
-unsigned __stdcall fiio_mem_WriteProc(void *buffer, unsigned size, unsigned count, fi_handle handle);
-int __stdcall fiio_mem_SeekProc(fi_handle handle, long offset, int origin);
-long __stdcall fiio_mem_TellProc(fi_handle handle);
-
-/*
  * this interface directly exports most of FreeImage routines
  * you can use them in your plugin after obtaining the interfasce using MS_IMG_GETINTERFACE
  */
 <at>  <at>  -83,7 +54,7  <at>  <at> 
     FIBITMAP *(DLL_CALLCONV *FI_Clone)(FIBITMAP *dib);
     void (DLL_CALLCONV *FI_Unload)(FIBITMAP *dib);
     
-    // Load / Save routines -----------------------------------------------------
+// Load / Save routines -----------------------------------------------------
     
     FIBITMAP *(DLL_CALLCONV *FI_Load)(FREE_IMAGE_FORMAT fif, const char *filename, int flags FI_DEFAULT(0));
     FIBITMAP *(DLL_CALLCONV *FI_LoadU)(FREE_IMAGE_FORMAT fif, const wchar_t *filename, int flags FI_DEFAULT(0));
 <at>  <at>  -324,10 +295,6  <at>  <at> 
 
 // own functions
 
-    // memory I/O
-    FIBITMAP *(*FI_LoadFromMem)(FREE_IMAGE_FORMAT fif, fiio_mem_handle *handle, int flags);
-    BOOL (*FI_SaveToMem)(FREE_IMAGE_FORMAT fif, FIBITMAP *dib, fiio_mem_handle *handle, int flags);
-
     // helpers
     FIBITMAP *(*FI_CreateDIBFromHBITMAP)(HBITMAP hBmp);
     HBITMAP  (*FI_CreateHBITMAPFromDIB)(FIBITMAP *dib);
 <at>  <at>  -402,8 +369,8  <at>  <at> 
 typedef struct _tagIMGSRVC_MEMIO {
     long iLen;					// length of the buffer
     void *pBuf;					// the buffer itself (you are responsible for allocating and free'ing it)
-    FREE_IMAGE_FORMAT fif;		// the FIF_* image format constant. Make sure to provide the right one.
-    UINT flags;                 // flags to pass to FreeImage_LoadFromMem()  (see freeimage docs)
+    FREE_IMAGE_FORMAT fif;		// -1 to detect the format or one of the FIF_* image format constant
+    UINT flags;                 // flags to pass to FreeImage_LoadFromMemory()  (see freeimage docs)
 } IMGSRVC_MEMIO;
 
 // load an image from a memory buffer
Index: plugins/freeimage/Miranda/main.cpp
===================================================================
--- plugins/freeimage/Miranda/main.cpp	(wersja 5802)
+++ plugins/freeimage/Miranda/main.cpp	(kopia robocza)
 <at>  <at>  -351,138 +351,6  <at>  <at> 
 	}
 }
 
-
-/*--------------------------------------------------------------------------*\
-|| fiio_mem.cpp by Ryan Rubley <ryan <at> lostreality.org>                       ||
-||                                                                          ||
-|| (v1.02) 4-28-2004                                                        ||
-|| FreeImageIO to memory                                                    ||
-||                                                                          ||
-\*--------------------------------------------------------------------------*/
-
-FIBITMAP *
-FreeImage_LoadFromMem(FREE_IMAGE_FORMAT fif, fiio_mem_handle *handle, int flags) {
-	FreeImageIO io;
-	SetMemIO(&io);
-
-	if (handle && handle->data) {
-		handle->curpos = 0;
-		return FreeImage_LoadFromHandle(fif, &io, (fi_handle)handle, flags);
-	}
-
-	return NULL;
-}
-
-BOOL
-FreeImage_SaveToMem(FREE_IMAGE_FORMAT fif, FIBITMAP *dib, fiio_mem_handle *handle, int flags) {
-	FreeImageIO io;
-	SetMemIO(&io);
-
-	if (handle) {
-		handle->filelen = 0;
-		handle->curpos = 0;
-		return FreeImage_SaveToHandle(fif, dib, &io, (fi_handle)handle, flags);
-	}
-
-	return FALSE;
-}
-
-// ----------------------------------------------------------
-
-void
-SetMemIO(FreeImageIO *io) {
-	io->read_proc  = fiio_mem_ReadProc;
-	io->seek_proc  = fiio_mem_SeekProc;
-	io->tell_proc  = fiio_mem_TellProc;
-	io->write_proc = fiio_mem_WriteProc;
-}
-
-// ----------------------------------------------------------
-
-#define FIIOMEM(member) (((fiio_mem_handle *)handle)->member)
-
-unsigned __stdcall fiio_mem_ReadProc(void *buffer, unsigned size, unsigned count, fi_handle
handle) {
-	unsigned x;
-	for( x=0; x<count; x++ ) {
-		//if there isnt size bytes left to read, set pos to eof and return a short count
-		if( FIIOMEM(filelen)-FIIOMEM(curpos) < (long)size ) {
-			FIIOMEM(curpos) = FIIOMEM(filelen);
-			break;
-		}
-		//copy size bytes count times
-		memcpy( buffer, (char *)FIIOMEM(data) + FIIOMEM(curpos), size );
-		FIIOMEM(curpos) += size;
-		buffer = (char *)buffer + size;
-	}
-	return x;
-}
-
-unsigned __stdcall fiio_mem_WriteProc(void *buffer, unsigned size, unsigned count, fi_handle
handle) {
-	void *newdata;
-	long newdatalen;
-	//double the data block size if we need to
-	while( FIIOMEM(curpos)+(long)(size*count) >= FIIOMEM(datalen) ) {
-		//if we are at or above 1G, we cant double without going negative
-		if( FIIOMEM(datalen) & 0x40000000 ) {
-			//max 2G
-			if( FIIOMEM(datalen) == 0x7FFFFFFF ) {
-				return 0;
-			}
-			newdatalen = 0x7FFFFFFF;
-		} else if( FIIOMEM(datalen) == 0 ) {
-			//default to 4K if nothing yet
-			newdatalen = 4096;
-		} else {
-			//double size
-			newdatalen = FIIOMEM(datalen) << 1;
-		}
-		newdata = realloc( FIIOMEM(data), newdatalen );
-		if( !newdata ) {
-			return 0;
-		}
-		FIIOMEM(data) = newdata;
-		FIIOMEM(datalen) = newdatalen;
-	}
-	memcpy( (char *)FIIOMEM(data) + FIIOMEM(curpos), buffer, size*count );
-	FIIOMEM(curpos) += size*count;
-	if( FIIOMEM(curpos) > FIIOMEM(filelen) ) {
-		FIIOMEM(filelen) = FIIOMEM(curpos);
-	}
-	return count;
-}
-
-int __stdcall fiio_mem_SeekProc(fi_handle handle, long offset, int origin) {
-	switch(origin) { //0 to filelen-1 are 'inside' the file
-	default:
-	case SEEK_SET: //can fseek() to 0-7FFFFFFF always
-		if( offset >= 0 ) {
-			FIIOMEM(curpos) = offset;
-			return 0;
-		}
-		break;
-
-	case SEEK_CUR:
-		if( FIIOMEM(curpos)+offset >= 0 ) {
-			FIIOMEM(curpos) += offset;
-			return 0;
-		}
-		break;
-
-	case SEEK_END:
-		if( FIIOMEM(filelen)+offset >= 0 ) {
-			FIIOMEM(curpos) = FIIOMEM(filelen)+offset;
-			return 0;
-		}
-		break;
-	}
-
-	return -1;
-}
-
-long __stdcall fiio_mem_TellProc(fi_handle handle) {
-	return FIIOMEM(curpos);
-}
-
 extern "C" DWORD __declspec(dllexport) getver( void )
 {
 	return __VERSION_DWORD;
 <at>  <at>  -649,7 +517,7  <at>  <at> 
 	ppbRowPointers = ( png_bytepp )alloca( iHeight * sizeof( png_bytep ));
 
 	// set the individual row-pointers to point at the correct offsets
-	for ( i = 0; i < iHeight; i++ )
+	for ( i = 0; i < (int)iHeight; i++ )
 		ppbRowPointers[i] = ( png_bytep )&pImageData[ i*ulRowBytes ];
 
 	// now we can go ahead and just read the whole image
 <at>  <at>  -663,7 +531,7  <at>  <at> 
 		png_bytep s = ppbRowPointers[i];
 		BYTE* dest = pbImageData; pbImageData += wDIRowBytes;
 
-		for ( j = 0; j < iWidth; j++ ) {
+		for ( j = 0; j < (int)iWidth; j++ ) {
 			png_byte r = *s++;
 			png_byte g = *s++;
 			png_byte b = *s++;
 <at>  <at>  -893,17 +761,15  <at>  <at> 
 static int serviceLoadFromMem(WPARAM wParam, LPARAM lParam)
 {
 	IMGSRVC_MEMIO *mio = (IMGSRVC_MEMIO *)wParam;
-	fiio_mem_handle fiio;
 
 	if(mio->iLen == 0 || mio->pBuf == NULL)
 		return 0;
 
-	fiio.curpos = 0;
-	fiio.data = mio->pBuf;
-	fiio.datalen = fiio.filelen = mio->iLen;
+	FIMEMORY *hmem = FreeImage_OpenMemory((BYTE *)mio->pBuf, mio->iLen);
+	FREE_IMAGE_FORMAT fif = (mio->fif != FIF_UNKNOWN) ? mio->fif : mio->fif =
FreeImage_GetFileTypeFromMemory(hmem, 0);
+	FIBITMAP *dib = FreeImage_LoadFromMemory(fif, hmem, mio->flags);
+	FreeImage_CloseMemory(hmem);
 
-	FIBITMAP *dib = FreeImage_LoadFromMem(mio->fif, &fiio, mio->flags);
-
 	if(dib == NULL || (lParam & IMGL_RETURNDIB))
 		return (int)dib;
 
 <at>  <at>  -1138,9 +1004,6  <at>  <at> 
 	feif.FI_Composite = FreeImage_Composite;
 	feif.FI_JPEGCrop = FreeImage_JPEGCrop;
 
-	feif.FI_LoadFromMem = FreeImage_LoadFromMem;
-	feif.FI_SaveToMem = FreeImage_SaveToMem;
-
 	feif.FI_CreateDIBFromHBITMAP = FreeImage_CreateDIBFromHBITMAP;
 	feif.FI_CreateHBITMAPFromDIB = FreeImage_CreateHBITMAPFromDIB;
 
-------------------------------------------------------------------------
This SF.net email is sponsored by DB2 Express
Download DB2 Express C - the FREE version of DB2 express and take
control of your XML. No limits. Just data. Click to get it now.
http://sourceforge.net/powerbar/db2/
_______________________________________________
Miranda-Develop mailing list
Miranda-Develop@...
https://lists.sourceforge.net/lists/listinfo/miranda-develop
Adam Strzelecki | 4 Jul 17:57 2007

Re: advaimg (Imgage Service) memory functions reduntant + LoadMem should autodetect format

Hi,

Here goes errata:
I think we need to bump FI_IF_VERSION version for safety...

Updated patch attached.

Waiting for your opinions :)

BTW. I've commited GG changes that are relaying on this patch, so
without that GG is bricked ;P

I've also fixed some 2 signed/unsigned warnings there.

Cheers,
-- 
: nanoANT Adam Strzelecki :
:       nanoant.com       :
Index: miranda/include/m_imgsrvc.h
===================================================================
--- miranda/include/m_imgsrvc.h	(wersja 5802)
+++ miranda/include/m_imgsrvc.h	(kopia robocza)
 <at>  <at>  -38,38 +38,9  <at>  <at> 
 
 #include "..\plugins\freeimage\Miranda\include\m_freeimage.h"
 
-#define FI_IF_VERSION (PLUGIN_MAKE_VERSION(0, 0, 1, 0))           // interface version - must match
+#define FI_IF_VERSION (PLUGIN_MAKE_VERSION(0, 0, 1, 1))           // interface version - must match
 
-// memory i/o defs
-
 /*
- * this struct defines a memio job.
- * datalen and filename must match and must be populated to the size of the memory buffer (caution)
- * data must point to the buffer.
- * curpos is internal and should be initialized to 0
- */
-
-typedef struct fiio_mem_handle_s {
-	long filelen,datalen,curpos;
-	void *data;
-} fiio_mem_handle;
-
-/* it is up to the user to create a fiio_mem_handle and init datalen and data
- * filelen will be pre-set to 0 by SaveToMem
- * curpos will be pre-set to 0 by SaveToMem and LoadFromMem
- * IMPORTANT: data should be set to NULL and datalen to 0,
- *            unless the user wants to manually malloc a larger buffer
- */
-FIBITMAP *FreeImage_LoadFromMem(FREE_IMAGE_FORMAT fif, fiio_mem_handle *handle, int flags);
-BOOL FreeImage_SaveToMem(FREE_IMAGE_FORMAT fif, FIBITMAP *dib, fiio_mem_handle *handle, int flags);
-
-void SetMemIO(FreeImageIO *io);
-unsigned __stdcall fiio_mem_ReadProc(void *buffer, unsigned size, unsigned count, fi_handle handle);
-unsigned __stdcall fiio_mem_WriteProc(void *buffer, unsigned size, unsigned count, fi_handle handle);
-int __stdcall fiio_mem_SeekProc(fi_handle handle, long offset, int origin);
-long __stdcall fiio_mem_TellProc(fi_handle handle);
-
-/*
  * this interface directly exports most of FreeImage routines
  * you can use them in your plugin after obtaining the interfasce using MS_IMG_GETINTERFACE
  */
 <at>  <at>  -83,7 +54,7  <at>  <at> 
     FIBITMAP *(DLL_CALLCONV *FI_Clone)(FIBITMAP *dib);
     void (DLL_CALLCONV *FI_Unload)(FIBITMAP *dib);
     
-    // Load / Save routines -----------------------------------------------------
+// Load / Save routines -----------------------------------------------------
     
     FIBITMAP *(DLL_CALLCONV *FI_Load)(FREE_IMAGE_FORMAT fif, const char *filename, int flags FI_DEFAULT(0));
     FIBITMAP *(DLL_CALLCONV *FI_LoadU)(FREE_IMAGE_FORMAT fif, const wchar_t *filename, int flags FI_DEFAULT(0));
 <at>  <at>  -324,10 +295,6  <at>  <at> 
 
 // own functions
 
-    // memory I/O
-    FIBITMAP *(*FI_LoadFromMem)(FREE_IMAGE_FORMAT fif, fiio_mem_handle *handle, int flags);
-    BOOL (*FI_SaveToMem)(FREE_IMAGE_FORMAT fif, FIBITMAP *dib, fiio_mem_handle *handle, int flags);
-
     // helpers
     FIBITMAP *(*FI_CreateDIBFromHBITMAP)(HBITMAP hBmp);
     HBITMAP  (*FI_CreateHBITMAPFromDIB)(FIBITMAP *dib);
 <at>  <at>  -402,8 +369,8  <at>  <at> 
 typedef struct _tagIMGSRVC_MEMIO {
     long iLen;					// length of the buffer
     void *pBuf;					// the buffer itself (you are responsible for allocating and free'ing it)
-    FREE_IMAGE_FORMAT fif;		// the FIF_* image format constant. Make sure to provide the right one.
-    UINT flags;                 // flags to pass to FreeImage_LoadFromMem()  (see freeimage docs)
+    FREE_IMAGE_FORMAT fif;		// -1 to detect the format or one of the FIF_* image format constant
+    UINT flags;                 // flags to pass to FreeImage_LoadFromMemory()  (see freeimage docs)
 } IMGSRVC_MEMIO;
 
 // load an image from a memory buffer
Index: miranda/plugins/freeimage/Miranda/main.cpp
===================================================================
--- miranda/plugins/freeimage/Miranda/main.cpp	(wersja 5802)
+++ miranda/plugins/freeimage/Miranda/main.cpp	(kopia robocza)
 <at>  <at>  -351,138 +351,6  <at>  <at> 
 	}
 }
 
-
-/*--------------------------------------------------------------------------*\
-|| fiio_mem.cpp by Ryan Rubley <ryan <at> lostreality.org>                       ||
-||                                                                          ||
-|| (v1.02) 4-28-2004                                                        ||
-|| FreeImageIO to memory                                                    ||
-||                                                                          ||
-\*--------------------------------------------------------------------------*/
-
-FIBITMAP *
-FreeImage_LoadFromMem(FREE_IMAGE_FORMAT fif, fiio_mem_handle *handle, int flags) {
-	FreeImageIO io;
-	SetMemIO(&io);
-
-	if (handle && handle->data) {
-		handle->curpos = 0;
-		return FreeImage_LoadFromHandle(fif, &io, (fi_handle)handle, flags);
-	}
-
-	return NULL;
-}
-
-BOOL
-FreeImage_SaveToMem(FREE_IMAGE_FORMAT fif, FIBITMAP *dib, fiio_mem_handle *handle, int flags) {
-	FreeImageIO io;
-	SetMemIO(&io);
-
-	if (handle) {
-		handle->filelen = 0;
-		handle->curpos = 0;
-		return FreeImage_SaveToHandle(fif, dib, &io, (fi_handle)handle, flags);
-	}
-
-	return FALSE;
-}
-
-// ----------------------------------------------------------
-
-void
-SetMemIO(FreeImageIO *io) {
-	io->read_proc  = fiio_mem_ReadProc;
-	io->seek_proc  = fiio_mem_SeekProc;
-	io->tell_proc  = fiio_mem_TellProc;
-	io->write_proc = fiio_mem_WriteProc;
-}
-
-// ----------------------------------------------------------
-
-#define FIIOMEM(member) (((fiio_mem_handle *)handle)->member)
-
-unsigned __stdcall fiio_mem_ReadProc(void *buffer, unsigned size, unsigned count, fi_handle
handle) {
-	unsigned x;
-	for( x=0; x<count; x++ ) {
-		//if there isnt size bytes left to read, set pos to eof and return a short count
-		if( FIIOMEM(filelen)-FIIOMEM(curpos) < (long)size ) {
-			FIIOMEM(curpos) = FIIOMEM(filelen);
-			break;
-		}
-		//copy size bytes count times
-		memcpy( buffer, (char *)FIIOMEM(data) + FIIOMEM(curpos), size );
-		FIIOMEM(curpos) += size;
-		buffer = (char *)buffer + size;
-	}
-	return x;
-}
-
-unsigned __stdcall fiio_mem_WriteProc(void *buffer, unsigned size, unsigned count, fi_handle
handle) {
-	void *newdata;
-	long newdatalen;
-	//double the data block size if we need to
-	while( FIIOMEM(curpos)+(long)(size*count) >= FIIOMEM(datalen) ) {
-		//if we are at or above 1G, we cant double without going negative
-		if( FIIOMEM(datalen) & 0x40000000 ) {
-			//max 2G
-			if( FIIOMEM(datalen) == 0x7FFFFFFF ) {
-				return 0;
-			}
-			newdatalen = 0x7FFFFFFF;
-		} else if( FIIOMEM(datalen) == 0 ) {
-			//default to 4K if nothing yet
-			newdatalen = 4096;
-		} else {
-			//double size
-			newdatalen = FIIOMEM(datalen) << 1;
-		}
-		newdata = realloc( FIIOMEM(data), newdatalen );
-		if( !newdata ) {
-			return 0;
-		}
-		FIIOMEM(data) = newdata;
-		FIIOMEM(datalen) = newdatalen;
-	}
-	memcpy( (char *)FIIOMEM(data) + FIIOMEM(curpos), buffer, size*count );
-	FIIOMEM(curpos) += size*count;
-	if( FIIOMEM(curpos) > FIIOMEM(filelen) ) {
-		FIIOMEM(filelen) = FIIOMEM(curpos);
-	}
-	return count;
-}
-
-int __stdcall fiio_mem_SeekProc(fi_handle handle, long offset, int origin) {
-	switch(origin) { //0 to filelen-1 are 'inside' the file
-	default:
-	case SEEK_SET: //can fseek() to 0-7FFFFFFF always
-		if( offset >= 0 ) {
-			FIIOMEM(curpos) = offset;
-			return 0;
-		}
-		break;
-
-	case SEEK_CUR:
-		if( FIIOMEM(curpos)+offset >= 0 ) {
-			FIIOMEM(curpos) += offset;
-			return 0;
-		}
-		break;
-
-	case SEEK_END:
-		if( FIIOMEM(filelen)+offset >= 0 ) {
-			FIIOMEM(curpos) = FIIOMEM(filelen)+offset;
-			return 0;
-		}
-		break;
-	}
-
-	return -1;
-}
-
-long __stdcall fiio_mem_TellProc(fi_handle handle) {
-	return FIIOMEM(curpos);
-}
-
 extern "C" DWORD __declspec(dllexport) getver( void )
 {
 	return __VERSION_DWORD;
 <at>  <at>  -649,7 +517,7  <at>  <at> 
 	ppbRowPointers = ( png_bytepp )alloca( iHeight * sizeof( png_bytep ));
 
 	// set the individual row-pointers to point at the correct offsets
-	for ( i = 0; i < iHeight; i++ )
+	for ( i = 0; i < (int)iHeight; i++ )
 		ppbRowPointers[i] = ( png_bytep )&pImageData[ i*ulRowBytes ];
 
 	// now we can go ahead and just read the whole image
 <at>  <at>  -663,7 +531,7  <at>  <at> 
 		png_bytep s = ppbRowPointers[i];
 		BYTE* dest = pbImageData; pbImageData += wDIRowBytes;
 
-		for ( j = 0; j < iWidth; j++ ) {
+		for ( j = 0; j < (int)iWidth; j++ ) {
 			png_byte r = *s++;
 			png_byte g = *s++;
 			png_byte b = *s++;
 <at>  <at>  -893,17 +761,15  <at>  <at> 
 static int serviceLoadFromMem(WPARAM wParam, LPARAM lParam)
 {
 	IMGSRVC_MEMIO *mio = (IMGSRVC_MEMIO *)wParam;
-	fiio_mem_handle fiio;
 
 	if(mio->iLen == 0 || mio->pBuf == NULL)
 		return 0;
 
-	fiio.curpos = 0;
-	fiio.data = mio->pBuf;
-	fiio.datalen = fiio.filelen = mio->iLen;
+	FIMEMORY *hmem = FreeImage_OpenMemory((BYTE *)mio->pBuf, mio->iLen);
+	FREE_IMAGE_FORMAT fif = (mio->fif != FIF_UNKNOWN) ? mio->fif : mio->fif =
FreeImage_GetFileTypeFromMemory(hmem, 0);
+	FIBITMAP *dib = FreeImage_LoadFromMemory(fif, hmem, mio->flags);
+	FreeImage_CloseMemory(hmem);
 
-	FIBITMAP *dib = FreeImage_LoadFromMem(mio->fif, &fiio, mio->flags);
-
 	if(dib == NULL || (lParam & IMGL_RETURNDIB))
 		return (int)dib;
 
 <at>  <at>  -1138,9 +1004,6  <at>  <at> 
 	feif.FI_Composite = FreeImage_Composite;
 	feif.FI_JPEGCrop = FreeImage_JPEGCrop;
 
-	feif.FI_LoadFromMem = FreeImage_LoadFromMem;
-	feif.FI_SaveToMem = FreeImage_SaveToMem;
-
 	feif.FI_CreateDIBFromHBITMAP = FreeImage_CreateDIBFromHBITMAP;
 	feif.FI_CreateHBITMAPFromDIB = FreeImage_CreateHBITMAPFromDIB;
 
-------------------------------------------------------------------------
This SF.net email is sponsored by DB2 Express
Download DB2 Express C - the FREE version of DB2 express and take
control of your XML. No limits. Just data. Click to get it now.
http://sourceforge.net/powerbar/db2/
_______________________________________________
Miranda-Develop mailing list
Miranda-Develop@...
https://lists.sourceforge.net/lists/listinfo/miranda-develop
Adam Strzelecki | 4 Jul 17:58 2007
Picon

Re: GG patch

Hi Scott,

> oops - i think that was actually the second one, but here's the first
> one again
I've committed the 2nd one, as all rest proto plugins are using 2nd method.

Thanks for your help,

Cheers,
--

-- 
: nanoANT Adam Strzelecki :
:       nanoant.com       :

-------------------------------------------------------------------------
This SF.net email is sponsored by DB2 Express
Download DB2 Express C - the FREE version of DB2 express and take
control of your XML. No limits. Just data. Click to get it now.
http://sourceforge.net/powerbar/db2/
Artem Shpynov | 5 Jul 11:09 2007
Picon

New face for Miranda

Hi All,

Taking a look on many topics about 'why miranda so complex/hard to setup/ugly looking'  etc.. i think a lot and here my idea...

I meant that if will be compare miranda release package with any other messenger - miranda will lose. why?
cause there is no smiley, no avatars, no skining, no different beautification for dummies and blonds :) .

yes there is a lot of plugins.. but to install it we should at least know what we are need and where to find it and how to set up..

modern messengers much more beauty and simpler.

for miranda... there is a lot of "packs" but it is official.. and constantly "beta and under development". plugins on official page... too. also "unstable 0.7. branch is much more stable than 0.6.8.. remember what do you say to newbie with .6.8 ? corectly "get latest from nightly". Also no icons no skins.. one word: ugly and oldie like Win3.1

So.. what i suggested?

Firstly take a look on winamp distributive.. it is optional to download.. only classic without couple of decoders or more modernistic. also there is payment ability to download modernst and complex version...

so lets do similar. some options to download:
1. Base(classic): only current release,
2. Advanced: Base + per protocols icons + smileys + avatar support
3. Nicer: Advanced + clist_nicer + tabsrmm or scriver
4. Modern: Advanced + clist_modern + tabsrmm or scriver with ieview template preconfigured.

the options 2-4 have to be some marked e.g yellow background with anounsment that they contain third party plugins and miranda team has limit or no guarantee for they stability.

so what it is need to do (except changing web interface).

for 1 - nothing except common (see forward)
for 2-4 - add to distributive: ava from trunk. Also need to add one of iconset proto_*.dll) this can be done after one of competition.. i think it is easy to do and there will be a lot of candidates. Need to include smileyadd module with smiley pack (afaik it is not dead and still supported by author but for sure sources are available and stable enough.
So already at this point miranda will be more modern and functional... especially with some candy preconfigured background image. It will be comparable with other modern messengers like trillian or qip... but few more steps:
3-4. add 4 more plugins from nightly (they are not so bugs free and stable but mostly cause nobody inspect they even at least quickly overview except authors..) Also include some candy skins for they... thats all.. This will allow to have more modernistic look than other modern messengers.. more powerful etc. Of course we should have notices that 3-4 require powerful pc.. let say 1GHz CPU and 256MB RAM with 64bit card... but this is requrement for one of popular OS WinXP so mostly all have it.

Thats about distributive...

Now lets i explain my point of view for settings... they have to be more cutted, very cutted.
frankly speaking i suggest to add new settings mode...
let name it as modern view. and current mode name classic.
the modern will be default and both of they will have button to switch between.
The modern view should me VERY simple... only realy reqired setting shold be there.. let say.. only protocols account setup. and few settings for base functionslity.. mean few checks for clist, some for srmm dialog, option to select smile pack.. also may be skin and icons.. page for event ignore and may be sound...
how it shold look?

please look on firefox options page...
the icons on the top of dialog - switches pages. I suggest to have next pages:
1. Accounts ( with the list of current protocols at left side to setup each protocol login name and password.. each protocol can have only button 'advanced' to show user other setting like option to store list on server etc.
2. Network connections - configure proxy to connect internet...
3. General.. some settings for core.
4. Appearence - page for clist
5. Dialogs - page for srmm's.
6. Smiles, customize or similar to select smiley pack, icon pack etc, skins, may be sounds pack... this page have to be core supported.. and each specific section have to be writed for most popular module.. or module can add simple self strip there themself
7. Events/ignore - page for current 'Ignore'...
8. Status - should combine away messages and status change on idle.
9. page Plugins with the list of plugs withbutton configure. Such betton will open classic view with filtered left tree nly for selected plug...
10. and may be page advanced...
Some screen shots? Main idea is similar to Adium:
http://www.ixbt.com/td/adium.shtml (sorry page on russian but contains screen shots) But some should be reoganized according to miranda organization.

How it should work internaly?

m let say. each page may raise they own event and module should handle it.. e.g. ME_MODERNOPT_PROTOPAGEINIT - will be handled to protocols and protos should reply they own dialogs template.. ME_MODERNOPT_CLISTPAGEINT - showld be handled only clist module. .same for dialog pages...
ME_MODERNOPT_CUSTOMIZEPAGEINIT - should be handled be modules to add small strip to configure some they look related thngs etc.

Yes.. this required from plugin developer write  one more setting page but.. also this will guarantee that plugin developer will write such page only if setting is really required and settings dialog will stay simple as possible 

So this idea will hide almost all setting of miranda.. but they will be very simple.. if user want to set some more detailed - welcome to classic view... but mostly don't want to set anything... welcome to modern view and set only realy required things. 

-------------------------------------------------------------------------
This SF.net email is sponsored by DB2 Express
Download DB2 Express C - the FREE version of DB2 express and take
control of your XML. No limits. Just data. Click to get it now.
http://sourceforge.net/powerbar/db2/
_______________________________________________
Miranda-Develop mailing list
Miranda-Develop@...
https://lists.sourceforge.net/lists/listinfo/miranda-develop
Ygrek | 5 Jul 13:22 2007
Face
Picon

Re: GG patch

After i download latest version of gg from svn with apply this patch, image transfer doesn't work:
from 0.0.4.6 -> 4.5 - work
from 4.5 -> 4.6 - don't work
between 4.6 <-> 4.6 don't work, but:
pc1 send picture A to pc2,[nothing happened]
after this pc2 send picture B(different than A) to pc1, and now pc1 see that receive picture(own) A.

I hope i help :)
-------------------------------------------------------------------------
This SF.net email is sponsored by DB2 Express
Download DB2 Express C - the FREE version of DB2 express and take
control of your XML. No limits. Just data. Click to get it now.
http://sourceforge.net/powerbar/db2/
_______________________________________________
Miranda-Develop mailing list
Miranda-Develop@...
https://lists.sourceforge.net/lists/listinfo/miranda-develop
Adam Strzelecki | 5 Jul 13:51 2007
Picon

Re: GG patch

Hi,

> After i download latest version of gg from svn with apply this patch,
> image transfer doesn't work:
> from 0.0.4.6 -> 4.5 - work
> from 4.5 -> 4.6 - don't work
> between 4.6 <-> 4.6 don't work, but:
> pc1 send picture A to pc2,[nothing happened]
> after this pc2 send picture B(different than A) to pc1, and now pc1 see
> that receive picture(own) *A.
It doesn't work.. because I need FreeImage (AdvaImg) update (patch)
that's posted as a patch at this forum.

After the patch is commited it will work... believe me. Usually I know
what I'm doing. But I need to speak with other dev's first to see if it
doesn't hurt.

Cheers,
--

-- 
: nanoANT Adam Strzelecki :
:       nanoant.com       :

-------------------------------------------------------------------------
This SF.net email is sponsored by DB2 Express
Download DB2 Express C - the FREE version of DB2 express and take
control of your XML. No limits. Just data. Click to get it now.
http://sourceforge.net/powerbar/db2/

Gmane