/* Do "dir". */ static void apply_dir_call( Reduce *rc, const char *name, HeapNode **arg, PElement *out ) { PElement rhs; PEPOINTRIGHT( arg[0], &rhs ); if( PEISCLASS( &rhs ) ) /* This is more complex than it looks. We have to walk a class * instance generating a list of member names, while not * destroying the instance as we go, in the case that out will * overwrite (rhs) arg[0]. */ reduce_safe_pointer( rc, (reduce_safe_pointer_fn) dir_object, &rhs, out, NULL, NULL ); else if( PEISSYMREF( &rhs ) ) { Symbol *sym = PEGETSYMREF( &rhs ); if( is_scope( sym ) && sym->expr && sym->expr->compile ) { PElement list; list = *out; heap_list_init( &list ); icontainer_map( ICONTAINER( sym->expr->compile ), (icontainer_map_fn) dir_scope, rc, &list ); } } else if( PEISREAL( &rhs ) ) { /* Assume this is a gtype and try to get the children of that * type. */ GType type = PEGETREAL( &rhs ); PElement list; list = *out; heap_list_init( &list ); if( !g_type_name( type ) ) { error_top( _( "No such type" ) ); error_sub( _( "GType %u not found." ), (unsigned int) type ); reduce_throw( rc ); } if( vips_type_map( type, dir_gtype, rc, &list ) ) reduce_throw( rc ); } else if( PEISMANAGEDGOBJECT( &rhs ) ) { guint n_properties; ManagedgobjectClass *class = MANAGEDGOBJECT_GET_CLASS( PEGETMANAGEDGOBJECT( &rhs ) ); GParamSpec **properties; properties = g_object_class_list_properties( G_OBJECT_CLASS( class ), &n_properties ); dir_gobject( rc, properties, n_properties, out ); g_free( properties); }
void CUIWeaponCellItem::OnAfterChild(CUIDragDropListEx* parent_list) { if(is_silencer() && GetIcon(eSilencer)) InitAddon (GetIcon(eSilencer), *object()->GetSilencerName(), m_addon_offset[eSilencer], parent_list->GetVerticalPlacement()); if(is_scope() && GetIcon(eScope)) InitAddon (GetIcon(eScope), *object()->GetScopeName(), m_addon_offset[eScope], parent_list->GetVerticalPlacement()); if(is_launcher() && GetIcon(eLauncher)) InitAddon (GetIcon(eLauncher), *object()->GetGrenadeLauncherName(),m_addon_offset[eLauncher], parent_list->GetVerticalPlacement()); }