Example #1
0
/*************************************************************************************************
 * roadmap_canvas_new()
 * Memory allocation for the new canvas
 */
EXTERN_C void roadmap_canvas_new ()
{
	int lBytes2Allocate;
	int lStride;

	roadmap_log( ROADMAP_INFO, "Canvas new .... \n" );

	// The gAndrCanvas has to be initialized before calling this function
	if ( !gAndrCanvas.width || !gAndrCanvas.height )
	{
		roadmap_log( ROADMAP_ERROR, "Canvas failed - canvas properties are incorrect or weren't set \n" );
		return;
	}
	// If canvas already allocated - free the memory
	if ( gAndrCanvas.pCanvasBuf )
	{
		free( gAndrCanvas.pCanvasBuf );
		gAndrCanvas.pCanvasBuf = NULL;
	}
	// Allocate the memory for the canvas
	lStride = DEFAULT_BPP * gAndrCanvas.width;
	lBytes2Allocate = lStride * gAndrCanvas.height;
	gAndrCanvas.pCanvasBuf = ( unsigned int * ) calloc( lBytes2Allocate, 1 );

	if ( !gAndrCanvas.pCanvasBuf )
	{
		roadmap_log( ROADMAP_ERROR, "Canvas allocation failed \n" );
		return;
	}
	// There are no alignment problems ....
	roadmap_canvas_agg_configure( ( unsigned char* ) gAndrCanvas.pCanvasBuf, gAndrCanvas.width,
									 gAndrCanvas.height, lStride );
	// Run the configurator
	(*RoadMapCanvasConfigure) ();
	// Notify about system event
	roadmap_device_event_notification( device_event_window_orientation_changed);
	// Restore keyboard if suppposed to be visible
	if ( roadmap_native_keyboard_visible() )
	{
		RMNativeKBParams params;
		roadmap_native_keyboard_get_params( &params );
		roadmap_native_keyboard_show( &params );
	}
}
Example #2
0
static void ssd_dialog_handle_native_kb( SsdDialog dialog )
{
   if ( roadmap_native_keyboard_enabled() )
   {
	   if ( dialog )
	   {
		   if ( dialog->ntv_kb_action == _ntv_kb_action_show )
		   {
			   roadmap_native_keyboard_show( &dialog->ntv_kb_params );
		   }
		   if ( dialog->ntv_kb_action == _ntv_kb_action_hide )
		   {
			   roadmap_native_keyboard_hide();
		   }
	   }
	   else
	   {
		   roadmap_native_keyboard_hide();
	   }
   }
}