本文整理匯總了C++中D_INFO函數的典型用法代碼示例。如果您正苦於以下問題:C++ D_INFO函數的具體用法?C++ D_INFO怎麽用?C++ D_INFO使用的例子?那麽, 這裏精選的函數代碼示例或許可以為您提供幫助。
在下文中一共展示了D_INFO函數的15個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的C++代碼示例。
示例1: driver_open_device
static DFBResult driver_open_device(CoreInputDevice *device,
unsigned int number,
InputDeviceInfo *info,
void **driver_data)
{
int fd;
MuTData *data;
/* open device */
fd = MuTOpenDevice (dfb_config->mut_device);
D_INFO("MuTouch:driver_open_device %s fd %d\n", dfb_config->mut_device,fd);
if (fd < 0) {
return DFB_INIT;
}
data = D_CALLOC (1, sizeof(MuTData));
if (!data) {
close (fd);
return D_OOM ();
}
data->fd = fd;
data->device = device;
/* Must define the correct resolution of screen */
data->screen_width = MuT_SCREENWIDTH;
data->screen_height = MuT_SCREENHEIGHT;
/* The following variable are defined to adjust the orientation of
* the touchscreen. Variables are either max screen height/width or 0.
*/
data->min_x = MuT_MINX;
data->min_y = MuT_MINY;
/* fill device info structure */
snprintf(info->desc.name, DFB_INPUT_DEVICE_DESC_NAME_LENGTH,
"MuTouch");
snprintf(info->desc.vendor, DFB_INPUT_DEVICE_DESC_VENDOR_LENGTH,
"Microtouch");
info->prefered_id = DIDID_MOUSE;
info->desc.type = DIDTF_MOUSE;
info->desc.caps = DICAPS_AXES | DICAPS_BUTTONS;
info->desc.max_axis = DIAI_Y;
info->desc.max_button = DIBI_LEFT;
/* start input thread */
data->thread = direct_thread_create (DTT_INPUT, MuTouchEventThread, data, "MuTouch Input");
/* set private data pointer */
*driver_data = data;
return DFB_OK;
}
示例2: error_handler_shm
static int
error_handler_shm( Display *display, XErrorEvent *event )
{
if (use_shm) {
D_INFO( "X11/Display: Error! Disabling XShm.\n" );
use_shm = false;
}
return 0;
}
示例3: libdirect_init
int __init
libdirect_init(void)
{
DirectResult__ctor();
D_DEBUG_AT( Direct_Module, "%s()\n", __FUNCTION__ );
D_INFO( "Direct/Module: Initializing module...\n" );
return 0;
}
示例4: gGetDriverInfo
void
gGetDriverInfo( GraphicsDriverInfo *info )
{
D_INFO( "DirectFB/Genefx: No software fallbacks supported\n" );
snprintf( info->name, DFB_GRAPHICS_DRIVER_INFO_NAME_LENGTH, "Software Driver" );
snprintf( info->vendor, DFB_GRAPHICS_DRIVER_INFO_VENDOR_LENGTH, "directfb.org" );
info->version.major = 0;
info->version.minor = 0;
}
示例5: Test_RenderElements
static DFBResult
Test_RenderElements( IWater *water, IDirectFBSurface *surface )
{
D_INFO( "Tests/Water: Testing RenderElements( %d )...\n", D_ARRAY_SIZE(m_test_elements) );
/*
* Render elements
*/
_T( water->RenderElements( water, surface, m_test_elements, D_ARRAY_SIZE(m_test_elements) ) );
return DFB_OK;
}
示例6: player_callback
static DirectEnumerationResult
player_callback( void *ctx,
const VoodooPlayInfo *info,
const VoodooPlayVersion *version,
const char *address,
unsigned int ms_since_last_seen )
{
D_INFO( "Voodoo/Play: <%4ums> [ %-30s ] %s%s (vendor: %s, model: %s)\n",
ms_since_last_seen, info->name, address, (info->flags & VPIF_LEVEL2) ? " *" : "",
info->vendor, info->model );
return DENUM_OK;
}
示例7: system_initialize
static DFBResult
system_initialize( CoreDFB *core, void **data )
{
char *driver;
CoreScreen *screen;
D_ASSERT( dfb_sdl == NULL );
dfb_sdl = (DFBSDL*) SHCALLOC( dfb_core_shmpool(core), 1, sizeof(DFBSDL) );
if (!dfb_sdl) {
D_ERROR( "DirectFB/SDL: Couldn't allocate shared memory!\n" );
return D_OOSHM();
}
dfb_sdl_core = core;
dfb_fbdev_read_modes(); /* use same mode list as a fake */
driver = getenv( "SDL_VIDEODRIVER" );
if (driver && !strcasecmp( driver, "directfb" )) {
D_INFO( "DirectFB/SDL: SDL_VIDEODRIVER is 'directfb', unsetting it.\n" );
unsetenv( "SDL_VIDEODRIVER" );
}
/* Initialize SDL */
if ( SDL_Init(SDL_INIT_VIDEO) < 0 ) {
D_ERROR( "DirectFB/SDL: Couldn't initialize SDL: %s\n", SDL_GetError() );
SHFREE( dfb_core_shmpool(core), dfb_sdl );
dfb_sdl = NULL;
return DFB_INIT;
}
fusion_skirmish_init( &dfb_sdl->lock, "SDL System", dfb_core_world(core) );
fusion_call_init( &dfb_sdl->call, dfb_sdl_call_handler, NULL, dfb_core_world(core) );
screen = dfb_screens_register( NULL, NULL, sdlPrimaryScreenFuncs );
dfb_layers_register( screen, NULL, sdlPrimaryLayerFuncs );
fusion_arena_add_shared_field( dfb_core_arena( core ), "sdl", dfb_sdl );
dfb_surface_pool_initialize( core, &sdlSurfacePoolFuncs, &dfb_sdl->sdl_pool );
*data = dfb_sdl;
return DFB_OK;
}
示例8: check_mnt_point
static int check_mnt_point(const char *mpoint)
{
printf("\n\033[34m<<<<check_mnt_point\033[0m\n");
FILE *fp;
struct mntent *ment;
fp = setmntent("/etc/mtab", "r");
if (fp == NULL)
{
D_ERROR("check_mnt_point: Failed to open /etc/mtab\n");
return -1;
}
while (!feof(fp))
{
ment = getmntent(fp);
if (ment != NULL && !strcmp(ment->mnt_dir, mpoint))
{
D_INFO("ment->mnt_opts:%s\n", ment->mnt_opts);
D_INFO("ment->mnt_opts:[%c%c]\n", ment->mnt_opts[0], ment->mnt_opts[1]);
if((ment->mnt_opts[0] == 'r') && (ment->mnt_opts[1] == 'w')) //rw: writable
{
D_INFO("%s\n", ment->mnt_dir);
return 0;
}
else
{
D_INFO("\033[31mRead-only device\033[0m\n");
return -1;
}
}
}
return -1;
}
示例9: Close
static void
Close( VoodooLink *link )
{
Link *l = link->priv;
D_INFO( "Voodoo/Link: Closing connection.\n" );
// FIXME: how to close socket?
direct_mutex_deinit( &l->lock );
WSACloseEvent( l->event );
D_FREE( l );
}
示例10: main
int
main( int argc, char** argv )
{
IDirectFB *dfb = NULL;
ISaWMan *saw = NULL;
pid_t pid;
D_INFO( "SaWMan/TestRun: Initializing...\n" );
CHECK( DirectFBInit( &argc, &argv ) );
CHECK( DirectFBCreate( &dfb ) );
CHECK( SaWManCreate( &saw ) );
CHECK( saw->Start( saw, ((argc > 1) && argv[1]) ? argv[1] : "Test Application", &pid ) );
D_INFO( "SaWMan/TestRun: New process has pid %d.\n", pid );
// sleep( 2 );
// CHECK( saw->Stop( saw, pid ) );
out:
D_INFO( "SaWMan/TestRun: Shutting down...\n" );
if (saw)
saw->Release( saw );
if (dfb)
dfb->Release( dfb );
return 0;
}
示例11: DirectGetInterface
DirectResult
DirectGetInterface( DirectInterfaceFuncs **funcs,
const char *type,
const char *implementation,
DirectInterfaceProbeFunc probe,
void *probe_ctx )
{
#ifdef DYNAMIC_LINKING
int len;
DIR *dir;
char *interface_dir;
struct dirent *entry = NULL;
struct dirent tmp;
#endif
DirectLink *link;
pthread_mutex_lock( &implementations_mutex );
/*
* Check existing implementations first.
*/
direct_list_foreach( link, implementations ) {
DirectInterfaceImplementation *impl = (DirectInterfaceImplementation*) link;
if (type && strcmp( type, impl->type ))
continue;
if (implementation && strcmp( implementation, impl->implementation ))
continue;
if (probe && !probe( impl->funcs, probe_ctx ))
continue;
else {
if (!impl->references) {
D_INFO( "Direct/Interface: Using '%s' implementation of '%s'.\n",
impl->implementation, impl->type );
}
*funcs = impl->funcs;
impl->references++;
pthread_mutex_unlock( &implementations_mutex );
return DFB_OK;
}
}
示例12: Surface
Surface( EGL &egl,
IDirectFB dfb,
int width,
int height,
IDirectFBEventBuffer events )
:
egl( egl )
{
DFBSurfaceDescription desc;
/* Fill description for a shared offscreen surface. */
desc.flags = (DFBSurfaceDescriptionFlags)(DSDESC_CAPS | DSDESC_WIDTH | DSDESC_HEIGHT);
desc.caps = (DFBSurfaceCapabilities)(DSCAPS_SHARED | DSCAPS_TRIPLE);
desc.width = width;
desc.height = height;
/* Create a primary surface. */
surface = dfb.CreateSurface( desc );
surface.MakeClient();
/* Create event buffer */
surface.AttachEventBuffer( events );
surface_id = surface.GetID();
surface.AllowAccess( "*" );
surface.Clear( 0xff, 0xff, 0xff, 0xff );
D_INFO( "DFBTest/EGLCompositor: Created new surface with ID %u\n", surface_id );
image = egl.CreateImage( EGL_NO_CONTEXT, EGL_IMAGE_IDIRECTFBSURFACE_DIRECTFB, (EGLClientBuffer) surface.iface, NULL );
glGenTextures( 1, &tex );
glBindTexture( GL_TEXTURE_2D, tex );
egl.EGLImageTargetTexture2D( GL_TEXTURE_2D, image );
glTexParameteri( GL_TEXTURE_2D, GL_TEXTURE_MAG_FILTER, GL_LINEAR );
glTexParameteri( GL_TEXTURE_2D, GL_TEXTURE_MIN_FILTER, GL_LINEAR );
glDisable( GL_CULL_FACE );
glDisable( GL_DEPTH_TEST );
}
示例13: fusion_ref_down
DirectResult
fusion_ref_down (FusionRef *ref, bool global)
{
D_ASSERT( ref != NULL );
D_DEBUG_AT( Fusion_Ref, "fusion_ref_down( %p [%d]%s )\n", ref, ref->multi.id, global ? " GLOBAL" : "" );
if (ref->multi.id == fusion_config->trace_ref) {
D_INFO( "Fusion/Ref: 0x%08x down (%s)\n", ref->multi.id, global ? "global" : "local" );
direct_trace_print_stack( NULL );
}
fusion_world_flush_calls( _fusion_world( ref->multi.shared ), 1 );
while (ioctl (_fusion_fd( ref->multi.shared ), global ?
FUSION_REF_DOWN_GLOBAL : FUSION_REF_DOWN, &ref->multi.id))
{
switch (errno) {
case EINTR:
continue;
case EINVAL:
D_ERROR ("Fusion/Reference: invalid reference\n");
return DR_DESTROYED;
default:
break;
}
if (global)
D_PERROR ("FUSION_REF_DOWN_GLOBAL");
else
D_PERROR ("FUSION_REF_DOWN");
return DR_FAILURE;
}
// FIMXE: the following had to be commented out as the ref down may cause a ref watcher to free the memory of 'ref' (via ioctl)
#if 0
if (ref->multi.shared)
D_DEBUG_AT( Fusion_Ref, " -> %d references now\n",
ioctl( _fusion_fd( ref->multi.shared ), FUSION_REF_STAT, &ref->multi.id ) );
else
D_DEBUG_AT( Fusion_Ref, " -> destroyed\n" );
#endif
return DR_OK;
}
示例14: driver_get_available
static int driver_get_available( void )
{
int fd;
/* we will only use the ELO device if it has been configured */
if(!dfb_config->elo_device) {
return 0;
}
fd = eloOpenDevice (dfb_config->elo_device);
if (fd < 0) {
D_INFO("Elo:driver_get_available NON OK\n");
return 0;
}
close(fd);
return 1;
}
示例15: Close
static void
Close( VoodooLink *link )
{
Link *l = link->priv;
D_INFO( "Voodoo/Link: Closing connection.\n" );
close( l->fd[0] );
if (l->fd[1] != l->fd[0])
close( l->fd[1] );
close( l->wakeup_fds[0] );
close( l->wakeup_fds[1] );
D_FREE( link->priv );
link->priv = NULL;
}