本文整理汇总了C++中CompString::empty方法的典型用法代码示例。如果您正苦于以下问题:C++ CompString::empty方法的具体用法?C++ CompString::empty怎么用?C++ CompString::empty使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类CompString
的用法示例。
在下文中一共展示了CompString::empty方法的5个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: renderText
bool
CompText::renderWindowTitle (Window window,
bool withViewportNumber,
const CompText::Attrib &attrib)
{
CompString text;
TEXT_SCREEN (screen);
if (!ts)
return false;
if (withViewportNumber)
{
CompString title;
CompPoint winViewport;
CompSize viewportSize;
title = ts->getWindowName (window);
if (!title.empty ())
{
CompWindow *w;
w = screen->findWindow (window);
if (w)
{
int viewport;
winViewport = w->defaultViewport ();
viewportSize = screen->vpSize ();
viewport = winViewport.y () * viewportSize.width () +
winViewport.x () + 1;
text = compPrintf ("%s -[%d]-", title.c_str (), viewport);
}
else
{
text = title;
}
}
}
else
{
text = ts->getWindowName (window);
}
if (text.empty ())
return false;
return renderText (text, attrib);
}
示例2: getTextProperty
CompString
PrivateTextScreen::getWindowName (Window id)
{
CompString name;
name = getUtf8Property (id, visibleNameAtom);
if (name.empty ())
name = getUtf8Property (id, wmNameAtom);
if (name.empty ())
name = getTextProperty (id, XA_WM_NAME);
return name;
}
示例3: getFirstArgument
/*
* Add a new fragment offset to the offsets stack from an ADD op string
*/
FragmentParser::FragmentOffset *
FragmentParser::programAddOffsetFromAddOp (const CompString &source)
{
FragmentOffset offset;
CompString op;
size_t pos = 0;
CompString name;
CompString offsetString;
CompString temp;
std::list <FragmentOffset>::iterator it = offsets.begin ();
if (source.size () < 5)
return NULL;
op = source;
pos += 3;
name = getFirstArgument (op, pos);
if (name.empty ())
return NULL;
temp = getFirstArgument (op, pos);
/* If an offset with the same name is
* already registered, skip this one */
if ((!offsets.empty () &&
!programFindOffset (it, name).empty ()) ||
temp.empty ())
return &(*it);
/* Just use the end of the op as the offset */
pos += 1;
offsetString = ltrim (op.substr (pos));
if (offsetString.empty ())
return NULL;
offset.name = name;
offset.offset = offsetString;
offsets.push_back (offset);
return &(offsets.back ());
}
示例4: getCurrentWSName
void
WSNamesScreen::renderNameText ()
{
CompText::Attrib attrib;
CompString name;
textData.clear ();
name = getCurrentWSName ();
if (name.empty ())
return;
/* 75% of the output device as maximum width */
attrib.maxWidth = screen->getCurrentOutputExtents ().width () * 3 / 4;
attrib.maxHeight = 100;
attrib.family = "Sans";
attrib.size = optionGetTextFontSize ();
attrib.color[0] = optionGetFontColorRed ();
attrib.color[1] = optionGetFontColorGreen ();
attrib.color[2] = optionGetFontColorBlue ();
attrib.color[3] = optionGetFontColorAlpha ();
attrib.flags = CompText::WithBackground | CompText::Ellipsized;
if (optionGetBoldText ())
attrib.flags |= CompText::StyleBold;
attrib.bgHMargin = 15;
attrib.bgVMargin = 15;
attrib.bgColor[0] = optionGetBackColorRed ();
attrib.bgColor[1] = optionGetBackColorGreen ();
attrib.bgColor[2] = optionGetBackColorBlue ();
attrib.bgColor[3] = optionGetBackColorAlpha ();
textData.renderText (name, attrib);
}
示例5: programCleanName
/*
* Load a source file and build a Compiz Fragment Function from it
*/
GLFragment::FunctionId
FragmentParser::loadFragmentProgram (const CompString &file,
CompString &name,
int target)
{
CompString source;
GLFragment::FunctionId handle;
/* Clean fragment program name */
programCleanName (name);
/* Read the source file */
source = programReadSource (file);
if (source.empty ())
{
return 0;
}
/* Build the Compiz Fragment Program */
handle = buildFragmentProgram (source,
name, target);
return handle;
}