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 » ide: main.conf
Re: ide: main.conf [message #40721 is a reply to message #40654] Mon, 09 September 2013 06:00 Go to previous messageGo to previous message
Sender Ghost is currently offline  Sender Ghost
Messages: 301
Registered: November 2008
Senior Member
Hello, Mirek and Jan.
mirek wrote on Mon, 26 August 2013 13:57

The purpose of this is to make possible a configuration of common packages (like Draw or CtrlCore) by adding other packages. For example, we can have package that provides custom font subsystem, this package would put "#define CUSTOM_FONTSYS" in its main.conf, which in turn would exclude generic font handling in Draw.

dolik.rce wrote on Sun, 08 September 2013 10:10

Wouldn't it be better to use existing "Add/Remove flags" functionality of Package manager for this? To use your example, the package that wants to include it own font handling could just have "flags CUSTOM_FONTSYS;" in .upp file and Draw package would then turn off the generic font handling based on #ifdef flagCUSTOM_FONTSYS.

I also think, that this is already possible with using current flags system.

The Draw package might accept CUSTOM_FONTSYS flag and check it with following source code:
#include "Draw.h"

#ifndef flagCUSTOM_FONTSYS
// Use generic implementation
Size Draw::GetPixelsPerInch() const
{
	return IsNative() ? GetNativeDpi() : Dots() ? Size(600, 600) : Size(96, 96);
}
// ...
#endif

The DrawCustom package might use Draw package with own implementation:
#include <Draw/Draw.h>

// Use custom implementation
Size Draw::GetPixelsPerInch() const
{
	return Size(96, 96);
}
// ...

Then main application (or some Rainbow package) could use DrawCustom package, when CUSTOM_FONTSYS enabled for main package configuration and its implementation will be active.

I created sample application which prints different Draw package description, when CUSTOM_FONTSYS flag enabled. The Draw and DrawCustom packages has its own implementation of this.

Overall, it depends from concrete implementation and external interface.

Edit: Added example with possible Rainbow configuration (for CustomRainbow nest), which doesn't require CUSTOM_FONTSYS for main package configuration, when using Rainbow package.

[Updated on: Mon, 09 September 2013 07:10]

Report message to a moderator

 
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Previous Topic: New small hidden feature of ArrayCtrl
Next Topic: *Maps syntax sugar
Goto Forum:
  


Current Time: Mon May 06 01:49:18 CEST 2024

Total time taken to generate the page: 0.02767 seconds