Overview
Examples
Screenshots
Comparisons
Applications
Download
Documentation
Tutorials
Bazaar
Status & Roadmap
FAQ
Authors & License
Forums
Funding Ultimate++
Search on this site
Search in forums












SourceForge.net Logo
Home » Community » U++ community news and announcements » Major Draw refactoring
Major Draw refactoring [message #22349] Tue, 07 July 2009 10:04 Go to next message
mirek is currently offline  mirek
Messages: 12841
Registered: November 2005
Ultimate Member
I am happy to announce that Draw development is getting to its final phase.

Current major step moved all GUI related issues to CtrlCore, leaving Draw "abstract", decoupling X11 (or GDI). Meanwhile, font/text support is still available (in POSIX using raw FontConfig).

Fonts are also much improved:

- new implementation allowed deprecating of FontInfo - you can now get all metrics directly from Font (FontInfo still exists to maintain compatibility).

- new system now supports font replacements - means you can now use CJK glyphs with any font and they will be taken from another font.

- Painter is now able to use both glyph composition and replacements.

Of course, as with any such major redesign, you can expect some issues and bugs...

The last phase should be relatively simple - moving Painter to Draw and fixing POSIX library requirements...

Mirek

[Updated on: Tue, 07 July 2009 13:54]

Report message to a moderator

Re: Major Draw refactoring [message #22351 is a reply to message #22349] Tue, 07 July 2009 11:33 Go to previous messageGo to next message
gxl117 is currently offline  gxl117
Messages: 71
Registered: March 2009
Location: China
Member
luzr wrote on Tue, 07 July 2009 10:04


- new system now supports font replacements - means you can now use CJK glyphs with any font and they will be taken from another font.



Very good news for me! Laughing
Re: Major Draw refactoring [message #22380 is a reply to message #22351] Thu, 09 July 2009 10:03 Go to previous messageGo to next message
cbpporter is currently offline  cbpporter
Messages: 1400
Registered: September 2007
Ultimate Contributor
I'll try out the new Draw with my font replacing/composition system under Linux.
Re: Major Draw refactoring [message #22388 is a reply to message #22380] Thu, 09 July 2009 20:23 Go to previous messageGo to next message
Didier is currently offline  Didier
Messages: 576
Registered: November 2008
Location: France
Contributor
The new version of dran does not compile under linux due to MT issues. There is a mixup indefines for msc and gcc.

I haven't looked at it right now
Re: Major Draw refactoring [message #22391 is a reply to message #22388] Thu, 09 July 2009 21:49 Go to previous messageGo to next message
mirek is currently offline  mirek
Messages: 12841
Registered: November 2005
Ultimate Member
Didier wrote on Thu, 09 July 2009 14:23

The new version of dran does not compile under linux due to MT issues. There is a mixup indefines for msc and gcc.

I haven't looked at it right now



Thank you, the problem was that thread__ variables were not POD.

Hopefully fixed.

Mirek
Re: Major Draw refactoring [message #22399 is a reply to message #22349] Fri, 10 July 2009 09:09 Go to previous messageGo to next message
cocob is currently offline  cocob
Messages: 156
Registered: January 2008
Experienced Member
Does this correction have a link with this ?

http://www.ultimatepp.org/forum/index.php?t=msg&th=4532& amp; amp;start=0&

[Updated on: Fri, 10 July 2009 09:09]

Report message to a moderator

icon14.gif  Re: Major Draw refactoring [message #22408 is a reply to message #22399] Fri, 10 July 2009 20:28 Go to previous messageGo to next message
Didier is currently offline  Didier
Messages: 576
Registered: November 2008
Location: France
Contributor
Thanks,

Perfect hit, compilation of new font is now OK on linux with MT
Re: Major Draw refactoring [message #22412 is a reply to message #22399] Sun, 12 July 2009 09:22 Go to previous messageGo to next message
mirek is currently offline  mirek
Messages: 12841
Registered: November 2005
Ultimate Member
cocob wrote on Fri, 10 July 2009 03:09

Does this correction have a link with this ?

http://www.ultimatepp.org/forum/index.php?t=msg&th=4532& amp; amp; amp;start=0&


Unfortunately, not. Waiting for the testcase.

Mirek
Re: Major Draw refactoring [message #22430 is a reply to message #22412] Tue, 14 July 2009 19:28 Go to previous messageGo to next message
nixnixnix is currently offline  nixnixnix
Messages: 415
Registered: February 2007
Location: Kelowna, British Columbia
Senior Member
I just updated my version of UPP from the SVN and my code appears to be broken.

It wont compile due to the following errors:


Quote:


D:\MyApps\OpenWind\WindMap.cpp(2745) : error C2664: 'Upp::ImageBuffer::ImageBuffer(Upp::Size)' : cannot convert parameter 1 from 'Upp::ImageDraw' to 'Upp::Size'
No user-defined-conversion operator available that can perform this conversion, or the operator cannot be called
D:\MyApps\OpenWind\main.cpp(1080) : error C2039: 'GetPagePixels' : is not a member of 'Upp::Draw'
C:\upp\uppsrc\Draw/Draw.h(412) : see declaration of 'Upp::Draw'
D:\MyApps\OpenWind\main.cpp(1105) : error C2039: 'GetPagePixels' : is not a member of 'Upp::PdfDraw'
C:\upp\uppsrc\PdfDraw/PdfDraw.h(228) : see declaration of 'Upp::PdfDraw'
D:\MyApps\OpenWind\main.cpp(1136) : error C2664: 'Upp::ImageBuffer::ImageBuffer(Upp::Size)' : cannot convert parameter 1 from 'Upp::ImageDraw' to 'Upp::Size'
No user-defined-conversion operator available that can perform this conversion, or the operator cannot be called
D:\MyApps\OpenWind\main.cpp(1163) : error C2664: 'Upp::ImageBuffer::ImageBuffer(Upp::Size)' : cannot convert parameter 1 from 'Upp::ImageDraw' to 'Upp::Size'
No user-defined-conversion operator available that can perform this conversion, or the operator cannot be called
D:\MyApps\OpenWind\main.cpp(1191) : error C2664: 'Upp::ImageBuffer::ImageBuffer(Upp::Size)' : cannot convert parameter 1 from 'Upp::ImageDraw' to 'Upp::Size'
No user-defined-conversion operator available that can perform this conversion, or the operator cannot be called
D:\MyApps\OpenWind\main.cpp(1219) : error C2664: 'Upp::ImageBuffer::ImageBuffer(Upp::Size)' : cannot convert parameter 1 from 'Upp::ImageDraw' to 'Upp::Size'
No user-defined-conversion operator available that can perform this conversion, or the operator cannot be called
D:\MyApps\OpenWind\WRGLayer.cpp(477) : error C2664: 'Upp::ImageBuffer::ImageBuffer(Upp::Size)' : cannot convert parameter 1 from 'Upp::ImageDraw' to 'Upp::Size'
No user-defined-conversion operator available that can perform this conversion, or the operator cannot be called



Is there any documentation on these changes please and are there equivalent replacement functions for those that have been removed? I thought that UPP was mature enough that this wasn't going to happen.

EDIT: ok well Vista was able to restore my previous version of UPP so I can continue working but of course I am now stuck in a limbo between 2008.1 and the latest version. Will these problems be fixed? I take it that there is another function instead of GetPagePixels (although I am not sure what other name could so perfectly sum up the function) but what about ImageDraw to ImageBuffer? How will that be accomplished in the new version?

Nick

[Updated on: Tue, 14 July 2009 19:53]

Report message to a moderator

Re: Major Draw refactoring [message #22431 is a reply to message #22430] Wed, 15 July 2009 02:52 Go to previous messageGo to next message
mirek is currently offline  mirek
Messages: 12841
Registered: November 2005
Ultimate Member
nixnixnix wrote on Tue, 14 July 2009 13:28

I just updated my version of UPP from the SVN and my code appears to be broken.

It wont compile due to the following errors:


Quote:


D:\MyApps\OpenWind\WindMap.cpp(2745) : error C2664: 'Upp::ImageBuffer::ImageBuffer(Upp::Size)' : cannot convert parameter 1 from 'Upp::ImageDraw' to 'Upp::Size'
No user-defined-conversion operator available that can perform this conversion, or the operator cannot be called
D:\MyApps\OpenWind\main.cpp(1080) : error C2039: 'GetPagePixels' : is not a member of 'Upp::Draw'
C:\upp\uppsrc\Draw/Draw.h(412) : see declaration of 'Upp::Draw'
D:\MyApps\OpenWind\main.cpp(1105) : error C2039: 'GetPagePixels' : is not a member of 'Upp::PdfDraw'
C:\upp\uppsrc\PdfDraw/PdfDraw.h(228) : see declaration of 'Upp::PdfDraw'
D:\MyApps\OpenWind\main.cpp(1136) : error C2664: 'Upp::ImageBuffer::ImageBuffer(Upp::Size)' : cannot convert parameter 1 from 'Upp::ImageDraw' to 'Upp::Size'
No user-defined-conversion operator available that can perform this conversion, or the operator cannot be called
D:\MyApps\OpenWind\main.cpp(1163) : error C2664: 'Upp::ImageBuffer::ImageBuffer(Upp::Size)' : cannot convert parameter 1 from 'Upp::ImageDraw' to 'Upp::Size'
No user-defined-conversion operator available that can perform this conversion, or the operator cannot be called
D:\MyApps\OpenWind\main.cpp(1191) : error C2664: 'Upp::ImageBuffer::ImageBuffer(Upp::Size)' : cannot convert parameter 1 from 'Upp::ImageDraw' to 'Upp::Size'
No user-defined-conversion operator available that can perform this conversion, or the operator cannot be called
D:\MyApps\OpenWind\main.cpp(1219) : error C2664: 'Upp::ImageBuffer::ImageBuffer(Upp::Size)' : cannot convert parameter 1 from 'Upp::ImageDraw' to 'Upp::Size'
No user-defined-conversion operator available that can perform this conversion, or the operator cannot be called
D:\MyApps\OpenWind\WRGLayer.cpp(477) : error C2664: 'Upp::ImageBuffer::ImageBuffer(Upp::Size)' : cannot convert parameter 1 from 'Upp::ImageDraw' to 'Upp::Size'
No user-defined-conversion operator available that can perform this conversion, or the operator cannot be called



Is there any documentation on these changes please and are there equivalent replacement functions for those that have been removed? I thought that UPP was mature enough that this wasn't going to happen.

EDIT: ok well Vista was able to restore my previous version of UPP so I can continue working but of course I am now stuck in a limbo between 2008.1 and the latest version. Will these problems be fixed? I take it that there is another function instead of GetPagePixels (although I am not sure what other name could so perfectly sum up the function) but what about ImageDraw to ImageBuffer? How will that be accomplished in the new version?

Nick


I have added "deprecated" backward compatibility version of GetPagePixels.

W.r.t. ImageDraw / ImageBuffer, there was no change. Can you post small code snippet please?

Mirek
Re: Major Draw refactoring [message #22432 is a reply to message #22431] Wed, 15 July 2009 06:56 Go to previous messageGo to next message
nixnixnix is currently offline  nixnixnix
Messages: 415
Registered: February 2007
Location: Kelowna, British Columbia
Senior Member
Hi Mirek,

Here is the code fragment that gives the error at main.cpp(1163).

void OpenWind::PrintTIF()
{
	FileSel fs;
	fs.Type("TIF files", "*.tif").AllFilesType().DefaultExt("tif");
	fs.ActiveDir(GetCurrentDirectory());

	if(!fs.ExecuteSaveAs("Output TIF file"))
		return;
	
	CUtils::SetCurrentDirectory_(fs.GetActiveDir());	

	// drawgrid
	if(m_optionGrid.GetData())
	{
		Size sz = m_rcClient.Size();
		ImageDraw id(sz);
		id.DrawImage(0,0,sz.cx,sz.cy,m_view);
		DrawGrid(id);	
		ImageBuffer ib(id);	// I beleive this is the problem right here
		m_view = Image(ib);
	}
	
	TIFEncoder tif;
	
	tif.SaveFile(~fs,m_view);
	SaveWorldFile(~fs);
}


thanks for taking a look at this.

Nick

[Updated on: Wed, 15 July 2009 06:58]

Report message to a moderator

Re: Major Draw refactoring [message #22433 is a reply to message #22432] Wed, 15 July 2009 10:20 Go to previous messageGo to next message
mirek is currently offline  mirek
Messages: 12841
Registered: November 2005
Ultimate Member
Thanks, I have added (returned) backward compatibility method to Image to solve the issue. I hope it will be OK.

Mirek
Re: Major Draw refactoring [message #22441 is a reply to message #22433] Wed, 15 July 2009 18:25 Go to previous messageGo to next message
nixnixnix is currently offline  nixnixnix
Messages: 415
Registered: February 2007
Location: Kelowna, British Columbia
Senior Member
Hi Mirek,

I just updated again but this time I get different errors


Quote:


FontWin32.cpp
C:\upp\uppsrc\Draw\FontWin32.cpp(171) : error C2039: 'LOCAL' : is not a member of 'Upp::Font'
c:\upp\uppsrc\draw\Draw.h(46) : see declaration of 'Upp::Font'
C:\upp\uppsrc\Draw\FontWin32.cpp(171) : error C2065: 'LOCAL' : undeclared identifier




static int CALLBACK Win32_AddFace(const LOGFONT *logfont, const TEXTMETRIC *, dword type, LPARAM param)
{
#ifdef PLATFORM_WINCE
	const wchar *facename = (const wchar *)param;
	if(facename && _wcsicmp(logfont->lfFaceName, facename))
		return 1;
#else
	const char *facename = (const char *)param;
	if(facename && stricmp(logfont->lfFaceName, facename))
		return 1;
#endif

	dword typ = 0;
	if((logfont->lfPitchAndFamily & 3) == FIXED_PITCH)
		typ |= Font::FIXEDPITCH;
	if(type & TRUETYPE_FONTTYPE)
		typ |= Font::SCALEABLE;
	if(!(logfont->lfCharSet == SYMBOL_CHARSET) && logfont->lfCharSet != 0)
		typ |= Font::LOCAL;
#ifdef PLATFORM_WINCE
	FontFaceInfo& f = sFontFace().Add(WString(logfont->lfFaceName).ToString());
	f.name = FromSystemCharset(logfont->lfFaceName);
#else
	FaceInfo& f = sList->Add();
	f.name = FromSystemCharset(logfont->lfFaceName);
	f.info = typ;
#endif
	return facename ? 0 : 1;
}


I get this error with MSC9 and a similar error with MINGW.

Nick

Re: Major Draw refactoring [message #22442 is a reply to message #22441] Wed, 15 July 2009 18:34 Go to previous messageGo to next message
mirek is currently offline  mirek
Messages: 12841
Registered: November 2005
Ultimate Member
This not what is in svn:

http://code.google.com/p/upp-mirror/source/browse/trunk/upps rc/Draw/FontWin32.cpp

Mirek
Re: Major Draw refactoring [message #22444 is a reply to message #22442] Wed, 15 July 2009 21:08 Go to previous messageGo to next message
nixnixnix is currently offline  nixnixnix
Messages: 415
Registered: February 2007
Location: Kelowna, British Columbia
Senior Member
Ah ok yes. There are several files I needed to manually edit to get things to compile and so these files didn't get updated when I updated from the SVN.

These seem to be mostly fixed now - thanks. Is there any way we can sort out that ScalarProduct and VectorProduct in Bezier2Length please? I have lots of users who compile on either Linux or with MINGW and its the same error on both.

Thanks,

Nick
Re: Major Draw refactoring [message #22448 is a reply to message #22444] Thu, 16 July 2009 02:59 Go to previous messageGo to next message
mirek is currently offline  mirek
Messages: 12841
Registered: November 2005
Ultimate Member
Hopefully patched.

What are you using Geom for?

Mirek
Re: Major Draw refactoring [message #22449 is a reply to message #22448] Thu, 16 July 2009 04:14 Go to previous messageGo to next message
nixnixnix is currently offline  nixnixnix
Messages: 415
Registered: February 2007
Location: Kelowna, British Columbia
Senior Member
Its referenced by the Tomas's geotiff package.

Everything builds now on Linux (64bit) and with MINGW with no alterations.

Thanks Mirek,

Nick

Re: Major Draw refactoring [message #22452 is a reply to message #22448] Thu, 16 July 2009 18:32 Go to previous messageGo to next message
nixnixnix is currently offline  nixnixnix
Messages: 415
Registered: February 2007
Location: Kelowna, British Columbia
Senior Member
When I test my software with the latest UPP, my fonts are messed up (when I reload a workbbok from disk) as well as the drop-downs not working (not readable and not dropping down) and the GridCtrl appears to have its y-dimension squashed.

Also, the message boxes (e.g. PromptOK) don't display properly. They are squashed.

Is this intended behaviour and if so, what do I need to do to fix my software?

Nick

p.s. these appear to be Vista issues. It doesn't happen on Ubuntu64 (I can't test on XP 32 just now). I use Vista 64 as my main development platform just now and believe me, on that UPP is not looking good. It was fine before the refactoring though.

I have had to revert again as I need to be able to show a working version of my software. Could you please post in this thread when its fixed. Mirek, if you don't have Vista 64 and want to see the problem I can show you using showmypc.

[Updated on: Fri, 17 July 2009 00:20]

Report message to a moderator

Re: Major Draw refactoring [message #22456 is a reply to message #22349] Fri, 17 July 2009 11:01 Go to previous messageGo to next message
ncompoop is currently offline  ncompoop
Messages: 4
Registered: July 2009
Junior Member
Just an addition to nixnixnix Vista woes. I appears that UPP can't find any fonts, only STDFONT is available, which is not a pretty sight indeed.

The problem started somewhere after svn.1415.

Re: Major Draw refactoring [message #22459 is a reply to message #22452] Fri, 17 July 2009 13:16 Go to previous messageGo to previous message
mirek is currently offline  mirek
Messages: 12841
Registered: November 2005
Ultimate Member
This should fix the issue with loading fonts:

void Font::Serialize(Stream& s) {
	int version = 1;
	s / version;
	if(version >= 1) {
    	enum {
			OLD_STDFONT, OLD_SCREEN_SERIF, OLD_SCREEN_SANS, OLD_SCREEN_FIXED,
			OLD_ROMAN,
			OLD_ARIAL,
			OLD_COURIER,
		};
		int f = GetFace();
		if(f > COURIER)
			f = -1;
		s / f;
		String name;
		if(f == OLD_ROMAN)
			f = ROMAN;
		if(f == OLD_ARIAL)
			f = ARIAL;
		if(f == OLD_COURIER)
			f = COURIER;
		if(f < 0) {
			name = GetFaceName();
			s % name;
		}
		if(s.IsLoading())
			if(f >= 0)
				Face(f);
			else
				FaceName(name);
	}
	else {
		String name = GetFaceName();
		s % name;
		if(s.IsLoading()) {
			FaceName(name);
			if(IsNull())
				Face(COURIER);
		}
	}
	s % v.flags % v.height % v.width;
}


Now going to look into Vista issue...

Mirek
Previous Topic: sf.net tracker
Next Topic: U++ 1517 released
Goto Forum:
  


Current Time: Thu Oct 29 02:49:54 CET 2020

Total time taken to generate the page: 0.01083 seconds