本文整理汇总了C++中IDirectFBDisplayLayer::GetSourceDescriptions方法的典型用法代码示例。如果您正苦于以下问题:C++ IDirectFBDisplayLayer::GetSourceDescriptions方法的具体用法?C++ IDirectFBDisplayLayer::GetSourceDescriptions怎么用?C++ IDirectFBDisplayLayer::GetSourceDescriptions使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类IDirectFBDisplayLayer
的用法示例。
在下文中一共展示了IDirectFBDisplayLayer::GetSourceDescriptions方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: printf
static DFBEnumerationResult
display_layer_callback( DFBDisplayLayerID id,
DFBDisplayLayerDescription desc,
void *arg )
{
int i;
/* Name */
printf( " Layer (%02x) %-30s", id, desc.name );
switch (id) {
case DLID_PRIMARY:
printf( " (primary layer)" );
break;
default:
break;
}
printf( "\n" );
/* Type */
printf( " Type: " );
for (i=0; layer_types[i].type; i++) {
if (desc.type & layer_types[i].type)
printf( "%s ", layer_types[i].name );
}
printf( "\n" );
/* Caps */
printf( " Caps: " );
for (i=0; layer_caps[i].capability; i++) {
if (desc.caps & layer_caps[i].capability)
printf( "%s ", layer_caps[i].name );
}
printf( "\n" );
/* Sources */
if (desc.caps & DLCAPS_SOURCES) {
DFBResult ret;
IDirectFBDisplayLayer *layer;
DFBDisplayLayerSourceDescription descs[desc.sources];
ret = dfb->GetDisplayLayer( dfb, id, &layer );
if (ret) {
DirectFBError( "DirectFB::GetDisplayLayer() failed", ret );
}
else {
ret = layer->GetSourceDescriptions( layer, descs );
if (ret) {
DirectFBError( "DirectFBDisplayLayer::GetSourceDescriptions() failed", ret );
}
else {
printf( " Sources: " );
for (i=0; i<desc.sources; i++) {
if (i > 0)
printf( ", %s", descs[i].name );
else
printf( "%s", descs[i].name );
}
printf( "\n" );
}
layer->Release( layer );
}
}
printf( "\n" );
return DFB_OK;
}