src/node_editor/gui.c
Widget *ui_get_widget_at( Widget *w, int abs_x, int abs_y, int com_mask, int com_bits )
{
	for( ; !w->is_terminator; w=NEXT_WIDGET(w) )
	{
		if ( w->com & UI_DISABLED )
			continue;
		
		if ( w->son && ( w->tree_com & com_mask ) == com_bits ) {
			Widget *c = ui_get_widget_at( w->son, abs_x, abs_y, com_mask, com_bits );
			if ( c && ( c->com & com_mask ) == com_bits )
				return c;
		}
		
		if ( ( w->com & com_mask ) != com_bits )
			continue;
		
		if ( point_in_box( &w->bounds, abs_x, abs_y ) || ( w->com & UI_ALWAYS_INSIDE ) )
			return w;
	}
	
	return NULL;
}
/* Finds the widget that contains the given point
assumes w != NULL */
Finds the widget that contains the given point
assumes w != NULL
Finds the widget that contains the given point assumes w ! = NULL
Widget *ui_get_widget_at( Widget *w, int abs_x, int abs_y, int com_mask, int com_bits )
{
	for( ; !w->is_terminator; w=NEXT_WIDGET(w) )
	{
		if ( w->com & UI_DISABLED )
			continue;
		if ( w->son && ( w->tree_com & com_mask ) == com_bits ) {
			Widget *c = ui_get_widget_at( w->son, abs_x, abs_y, com_mask, com_bits );
			if ( c && ( c->com & com_mask ) == com_bits )
				return c;
		}
		if ( ( w->com & com_mask ) != com_bits )
			continue;
		if ( point_in_box( &w->bounds, abs_x, abs_y ) || ( w->com & UI_ALWAYS_INSIDE ) )
			return w;
	}
	return NULL;
}
Widget * ui_get_widget_at ( Widget * w , int abs_x , int abs_y , int com_mask , int com_bits ) { for ( ; ! w -> is_terminator ; w = NEXT_WIDGET ( w ) ) { if ( w -> com & UI_DISABLED ) continue ; if ( w -> son && ( w -> tree_com & com_mask ) == com_bits ) { Widget * c = ui_get_widget_at ( w -> son , abs_x , abs_y , com_mask , com_bits ) ; if ( c && ( c -> com & com_mask ) == com_bits ) return c ; } if ( ( w -> com & com_mask ) != com_bits ) continue ; if ( point_in_box ( & w -> bounds , abs_x , abs_y ) || ( w -> com & UI_ALWAYS_INSIDE ) ) return w ; } return NULL ; }
Finds the widget that contains the given point
assumes w != NULL
Finds the widget that contains the given point assumes w ! = NULL