+ private void on_orientation_changed () {
+ if (orientation.portrait) {
+ Hildon.gtk_window_set_portrait_flags (window, PortraitFlags.REQUEST);
+ } else {
+ Hildon.gtk_window_set_portrait_flags (window, PortraitFlags.SUPPORT);
+ }
+ }
+
+ public void register_plugins (Osso.Context context) {
+ string plugin_path = Config.PKGLIBDIR;
+ try {
+ var directory = File.new_for_path (plugin_path);
+ var enumerator = directory.enumerate_children (FILE_ATTRIBUTE_STANDARD_NAME, 0, null);
+
+ FileInfo file_info;
+ while ((file_info = enumerator.next_file (null)) != null) {
+ string name = file_info.get_name ();
+
+ if (name.has_suffix (".so")) {
+ Plugin plugin;
+ string path = Path.build_filename (plugin_path, name, null);
+
+ var registrar = new PluginRegistrar<Plugin> (path);
+ registrar.load ();
+
+ plugin = registrar.new_object ();
+ plugins.append (plugin);
+ plugin.hello (window, context);
+ }
+ }
+
+ } catch (Error e) {
+ stderr.printf ("Error: %s\n", e.message);
+ }