- add option to list instead of return option.
- HWSupport option is devided to gpu, cpu option.
Change-Id: If4709b8df21c502253da891bb579e9544d04aeb4
Signed-off-by: minkee.lee <minkee.lee@samsung.com>
--- /dev/null
+/* Emulator Manager
+ *
+ * Copyright (C) 2015 Samsung Electronics Co., Ltd. All rights reserved.
+ *
+ * Contact:
+ * Minkee Lee <minkee.lee@samsung.com>
+ * SeokYeon Hwang <syeon.hwang@samsung.com>
+ * Sangho Park <sangho1206.park@samsung.com>
+ *
+ * This program is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU General Public License
+ * as published by the Free Software Foundation; either version 2
+ * of the License, or (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
+ *
+ * Contributors:
+ * - S-Core Co., Ltd
+ *
+ */
+
+
+package org.tizen.emulator.manager.vms.option;
+
+import org.tizen.emulator.manager.job.CheckVT;
+import org.tizen.emulator.manager.vms.VMProperty;
+import org.tizen.emulator.manager.vms.helper.VMLauncherException;
+
+public class CPUSupportOption extends Option {
+
+ @Override
+ public void getLaunchArgument(LaunchConfig config, VMProperty property)
+ throws VMLauncherException {
+ String hwVirtualization = "";
+ if (property.getConfiguration().getUsability().isHwVirtualization()) {
+ hwVirtualization = CheckVT.getVTEnablingCommand();
+ } else {
+ // do nothing...
+ }
+ if (hwVirtualization != null) {
+ config.addQemuOption(hwVirtualization);
+ }
+ }
+}
public abstract class CommonOptionFactroy implements IOptionFactory {
// Override if need.
- public void makeCommonOptionList(List<IOption> list, ItemList itemTemplate) {
+ public void makeCommonOptionList(List<IOption> optionList, ItemList itemTemplate) {
PropertyList propertyList = itemTemplate.getPropertyList();
DeviceList deviceList = itemTemplate.getDeviceList();
- IOption option;
for (Item item : propertyList.getItem()) {
- option = findProeprtyOption(item);
- if (option != null) {
- list.add(option);
- }
+ addPropertyOption(item, optionList);
}
for (Item item : deviceList.getItem()) {
- option = findDeviceOption(item);
- if (option != null) {
- list.add(option);
- }
+ addDeviceOption(item, optionList);
+ }
+ }
+
+ // Plugin developer can override this if needed
+ public void addPropertyOption(Item item, List<IOption> list) {
+ if (item == null) {
+ return;
+ }
+ String name = item.getName();
+ if (name.equals(ItemName.VM_NAME)) {
+ list.add(Option.getInstance(VMNameOption.class));
+
+ } else if (name.equals(ItemName.BASE_IMAGE)) {
+ list.add(Option.getInstance(BaseImageOption.class));
+
+ } else if (name.equals(ItemName.DISPLAY)) {
+ list.add(Option.getInstance(DisplayOption.class));
+
+ } else if (name.equals(ItemName.PROCESSORS)) {
+ list.add(Option.getInstance(ProcessorOption.class));
+
+ } else if (name.equals(ItemName.RAM_SIZE)) {
+ list.add(Option.getInstance(RamSizeOption.class));;
+
+ } else if (name.equals(ItemName.SUSPEND_SUPPORT)) {
+ list.add(Option.getInstance(SuspendSupportOption.class));
+
+ } else if (name.equals(ItemName.FILE_SHARE)) {
+ list.add(Option.getInstance(FileShareOption.class));
+
+ } else if (name.equals(ItemName.HW_SUPPORT)) {
+ list.add(Option.getInstance(CPUSupportOption.class));
+ list.add(Option.getInstance(GPUSupportOption.class));
+ }
+ }
+
+ // Plugin developer can override this if needed
+ public void addDeviceOption(Item item, List<IOption> list) {
+ if (item == null) {
+ return;
+ }
+ String name = item.getName();
+
+ if (name.equals(ItemName.NET_CONFIG)) {
+ list.add(Option.getInstance(NetworkOption.class));
+
+ } else if (name.equals(ItemName.NET_PROXY)) {
+ list.add(Option.getInstance(NetProxyOption.class));
+
+ } else if (name.equals(ItemName.CAMERA)) {
+ list.add(Option.getInstance(CameraOption.class));
}
}
// Override if need
+ @Deprecated
public IOption findProeprtyOption(Item item) {
if (item == null) {
return null;
return Option.getInstance(FileShareOption.class);
} else if (name.equals(ItemName.HW_SUPPORT)) {
- return Option.getInstance(HWSupportOption.class);
+// return Option.getInstance(HWSupportOption.class);
}
}
// Override if need
+ @Deprecated
public IOption findDeviceOption(Item item) {
if (item == null) {
return null;
*
*/
+
package org.tizen.emulator.manager.vms.option;
import org.eclipse.swt.SWT;
import org.tizen.emulator.manager.job.CheckGPU;
-import org.tizen.emulator.manager.job.CheckVT;
import org.tizen.emulator.manager.ui.dialog.MessageDialog;
import org.tizen.emulator.manager.vms.VMProperty;
import org.tizen.emulator.manager.vms.helper.VMLauncherException;
-public class HWSupportOption extends Option {
+public class GPUSupportOption extends Option {
@Override
public void getLaunchArgument(LaunchConfig config, VMProperty property)
throws VMLauncherException {
- // Set CPU option
- String hwVirtualization = "";
- if (property.getConfiguration().getUsability().isHwVirtualization()) {
- hwVirtualization = CheckVT.getVTEnablingCommand();
- } else {
- // do nothing...
- }
- if (hwVirtualization != null) {
- config.addQemuOption(hwVirtualization);
- }
-
- // Set GPU option
if (property.getConfiguration().getUsability().isHwGLAcceleration()) {
config.addQemuOption("-device", "vigs,backend=gl,wsi=vigs_wsi");
config.addQemuOption("-device", "yagl,wsi=vigs_wsi");
}
}
}
-
-}
+}
\ No newline at end of file