Example #1
0
ewol::resource::DistanceFieldFont::DistanceFieldFont() :
  ewol::resource::Texture(),
  m_borderSize(10),
  m_textureBorderSize(0,0) {
	addResourceType("ewol::resource::DistanceFieldFont");
	m_font = nullptr;
	m_lastGlyphPos.setValue(1,1);
	m_lastRawHeigh = 0;
	m_sizeRatio = 1.0f;
}
void SelectionDialog:: initSelectors()
{
	connect( resourceSelector, SIGNAL( resourceSelected( QString,
					QString, QString, QString ) ),
			this, SLOT( addConstraint(QString,QString,
					QString,QString) ) );

	connect( resourceSelector, SIGNAL( resourceTypeSelected( QString ) ),
			this, SLOT( addResourceType( QString ) ) );

	// Connect requests for data from the resource selector to
	// the slots in the data server
	connect( resourceSelector, SIGNAL( needResourcesByType( QString,
					QString, void * ) ),
			dataSource, SLOT( findResourcesByType( QString,
					QString, void * ) ) );
	
	connect( resourceSelector, SIGNAL( needAttributesByType( QString,
					QString, void * ) ),
			dataSource, SLOT( findAttributesByType( QString,
					QString, void * ) ) );
	
	connect( resourceSelector, SIGNAL( needResourcesByParent( QString,
					QString, QString,
					SelectionListItem * ) ),
			dataSource, SLOT( findResourcesByParent( QString,
					QString, QString,
					SelectionListItem * ) ) );
	
	connect( resourceSelector, SIGNAL( needAttributesByName( QString,
					QString, SelectionListItem * ) ),
			dataSource, SLOT( findAttributesByName( QString,
					QString, SelectionListItem * ) ) );

	connect( resourceSelector, SIGNAL( needAttributesByResourceName(
					QString, SelectionListItem * ) ),
			dataSource, SLOT( findAttributesByResourceName(
					QString, SelectionListItem * ) ) );
	
	connect( resourceSelector, SIGNAL( needExecutionResourcesByName(
					QString, SelectionListItem * ) ),
			dataSource, SLOT( findExecutionResourcesByName(
					QString, SelectionListItem * ) ) );
	
	// Connect the data coming from the data server to the selector
	connect( dataSource, SIGNAL( foundAttributesByType( QString,
					QStringList, void * ) ),
			resourceSelector, SLOT( setAttributeList( QString,
					QStringList, void * ) ) );

	connect( dataSource, SIGNAL( foundResourcesByType( QString,
					QMap<QString,int>, void * ) ),
			resourceSelector, SLOT( setTopLevelResources( QString,
					QMap<QString,int>, void * ) ) );

	connect( dataSource, SIGNAL( foundResourcesByParent( QString,
					QMap<QString,int>,
					SelectionListItem * ) ),
			resourceSelector, SLOT( setChildResources( QString,
					QMap<QString,int>,
					SelectionListItem * ) ) );

	connect( dataSource, SIGNAL( foundAttributesByName( QString,
					QStringList, SelectionListItem * ) ),
			resourceSelector, SLOT( setAttributeValues( QString,
					QStringList, SelectionListItem * ) ) );

	connect( dataSource, SIGNAL( foundAttributesByResourceName( 
					AttrListMap, SelectionListItem * ) ),
			resourceSelector, SLOT( setItemAttributesMap( 
					AttrListMap, SelectionListItem * ) ) );

	connect( dataSource, SIGNAL( foundExecutionResources(
					Q3ValueList<QPair<QString,QString> >,
					SelectionListItem * ) ),
			resourceSelector, SLOT( setItemExecutionResources(
					Q3ValueList<QPair<QString,QString> >,
					SelectionListItem * ) ) );
}
Example #3
0
bool KStandardDirs::addResourceType( const char *type,
				     const QString& relativename )
{
    return addResourceType(type, relativename, true);
}
Example #4
0
void KStandardDirs::addKDEDefaults()
{
    QStringList kdedirList;

    // begin KDEDIRS
    QString kdedirs = readEnvPath("KDEDIRS");
    if (!kdedirs.isEmpty())
    {
        tokenize(kdedirList, kdedirs, QChar(KPATH_SEPARATOR));
    }
    else
    {
        QString kdedir = readEnvPath("KDEDIR");
        if (!kdedir.isEmpty())
        {
           kdedir = KShell::tildeExpand(kdedir);
           kdedirList.append(kdedir);
        }
    }

#ifndef Q_OS_WIN //no default KDEDIR on win32 defined
    kdedirList.append(KDEDIR);
#endif

#ifdef __KDE_EXECPREFIX
    QString execPrefix(__KDE_EXECPREFIX);
    if (execPrefix!="NONE")
       kdedirList.append(execPrefix);
#endif
#ifdef __linux__
    const QString linuxExecPrefix = executablePrefix();
    if ( !linuxExecPrefix.isEmpty() )
       kdedirList.append( linuxExecPrefix );
#endif

    // We treat root differently to prevent a "su" shell messing up the
    // file permissions in the user's home directory.
    QString localKdeDir = readEnvPath(getuid() ? "KDEHOME" : "KDEROOTHOME");
    if (!localKdeDir.isEmpty())
    {
       if (localKdeDir[localKdeDir.length()-1] != '/')
          localKdeDir += '/';
    }
    else
    {
       localKdeDir =  QDir::homeDirPath() + "/.kde/";
    }

    if (localKdeDir != "-/")
    {
        localKdeDir = KShell::tildeExpand(localKdeDir);
        addPrefix(localKdeDir);
    }

	QStringList::ConstIterator end(kdedirList.end());
    for (QStringList::ConstIterator it = kdedirList.begin();
	 it != end; ++it)
    {
        QString dir = KShell::tildeExpand(*it);
	addPrefix(dir);
    }
    // end KDEDIRS

    // begin XDG_CONFIG_XXX
    QStringList xdgdirList;
    QString xdgdirs = readEnvPath("XDG_CONFIG_DIRS");
    if (!xdgdirs.isEmpty())
    {
	tokenize(xdgdirList, xdgdirs, QChar(KPATH_SEPARATOR));
    }
    else
    {
	xdgdirList.clear();
        xdgdirList.append("/etc/xdg");
#ifdef Q_WS_WIN
        xdgdirList.append(kfsstnd_defaultprefix() + "/etc/xdg");
#else
        xdgdirList.append(KDESYSCONFDIR "/xdg");
#endif
    }

    QString localXdgDir = readEnvPath("XDG_CONFIG_HOME");
    if (!localXdgDir.isEmpty())
    {
       if (localXdgDir[localXdgDir.length()-1] != '/')
          localXdgDir += '/';
    }
    else
    {
       localXdgDir =  QDir::homeDirPath() + "/.config/";
    }

    localXdgDir = KShell::tildeExpand(localXdgDir);
    addXdgConfigPrefix(localXdgDir);

    for (QStringList::ConstIterator it = xdgdirList.begin();
	 it != xdgdirList.end(); ++it)
    {
        QString dir = KShell::tildeExpand(*it);
	addXdgConfigPrefix(dir);
    }
    // end XDG_CONFIG_XXX

    // begin XDG_DATA_XXX
    xdgdirs = readEnvPath("XDG_DATA_DIRS");
    if (!xdgdirs.isEmpty())
    {
	tokenize(xdgdirList, xdgdirs, QChar(KPATH_SEPARATOR));
    }
    else
    {
	xdgdirList.clear();
        for (QStringList::ConstIterator it = kdedirList.begin();
           it != kdedirList.end(); ++it)
        {
           QString dir = *it;
           if (dir[dir.length()-1] != '/')
             dir += '/';
           xdgdirList.append(dir+"share/");
        }

        xdgdirList.append("/usr/local/share/");
        xdgdirList.append("/usr/share/");
    }

    localXdgDir = readEnvPath("XDG_DATA_HOME");
    if (!localXdgDir.isEmpty())
    {
       if (localXdgDir[localXdgDir.length()-1] != '/')
          localXdgDir += '/';
    }
    else
    {
       localXdgDir = QDir::homeDirPath() + "/.local/share/";
    }

    localXdgDir = KShell::tildeExpand(localXdgDir);
    addXdgDataPrefix(localXdgDir);

    for (QStringList::ConstIterator it = xdgdirList.begin();
	 it != xdgdirList.end(); ++it)
    {
        QString dir = KShell::tildeExpand(*it);
	addXdgDataPrefix(dir);
    }
    // end XDG_DATA_XXX


    uint index = 0;
    while (types[index] != 0) {
	addResourceType(types[index], kde_default(types[index]));
	index++;
    }

    addResourceDir("home", QDir::homeDirPath());
}
Example #5
0
ewol::resource::ConfigFile::ConfigFile() :
  gale::Resource() {
	addResourceType("ewol::ConfigFile");
}
Example #6
0
ewol::resource::ColorFile::ColorFile() :
    gale::Resource(),
    m_errorColor(etk::color::orange) {
    addResourceType("ewol::ColorFile");
}
Example #7
0
ewol::resource::TexturedFont::TexturedFont() {
	addResourceType("ewol::resource::TexturedFont");
}
Example #8
0
appl::Highlight::Highlight() {
	addResourceType("appl::Highlight");
}
Example #9
0
ewol::resource::TextureFile::TextureFile() {
	addResourceType("ewol::resource::Image");
	
}
Example #10
0
ewol::resource::Texture::Texture() :
  m_texId(0),
  m_endPointSize(1,1),
  m_loaded(false) {
	addResourceType("ewol::compositing::Texture");
}
Example #11
0
ewol::resource::Colored3DObject::Colored3DObject() :
  m_GLprogram(nullptr) {
	addResourceType("ewol::Colored3DObject");
}