void Initialize()
{
+ Window.Instance.AddAvailableOrientation(Window.WindowOrientation.Portrait);
+ Window.Instance.AddAvailableOrientation(Window.WindowOrientation.PortraitInverse);
+ Window.Instance.AddAvailableOrientation(Window.WindowOrientation.Landscape);
+ Window.Instance.AddAvailableOrientation(Window.WindowOrientation.LandscapeInverse);
+
Window window = NUIApplication.GetDefaultWindow();
Navigator navigator = new Navigator()
{
IseConfig.Instance.ReadIseConfig();
LanguageManager.Instance.SetEnabledLanguages(IseConfig.Instance.EnabledLanguages);
+ SclNuiSetRotation((int)Window.Instance.GetCurrentOrientation());
LanguageInfo currentLanguage = LanguageManager.Instance.GetLanguageInfo(IseConfig.Instance.SelectedLanguage);
SCLNUI SclNui = new SCLNUI(navigator, DirectoryInfo.Resource + "main_entry.xml");
SclNui.SetUpdatePending(true);
[DllImport(Libraries.SclNui, EntryPoint = "scl_nui_set_update_pending")]
internal static extern int SclNuiSetUpdatePending(bool pend);
+ [DllImport(Libraries.SclNui, EntryPoint = "scl_nui_set_rotation")]
+ internal static extern int SclNuiSetRotation(int degree);
+
[DllImport(Libraries.SclNui, EntryPoint = "scl_nui_set_cur_sublayout")]
internal static extern int SclNuiSetCurrentSublayout(string SublayoutName);
Log.Info("NUIIME", "rectangle: x=" + pos_x + ", y=" + pos_y + ", w=" + width + ", h=" + height);
Log.Info("NUIIME", "fill: " + fill + ", r=" + fill_color_r + ", g=" + fill_color_g + ", b=" + fill_color_b + ", a=" + fill_color_a);
- if (width == 720) {
- rectView = draw_rectangle(pos_x, pos_y, width, height, fill, fill_color_r, fill_color_g, fill_color_b, fill_color_a);
- Add(rectView);
- }
+ rectView = draw_rectangle(pos_x, pos_y, width, height, fill, fill_color_r, fill_color_g, fill_color_b, fill_color_a);
+ Add(rectView);
};
SclNuiSetDrawRectangleCb(_draw_rectangle_cb, (IntPtr)null);
SclNuiDragStateChangedCb(_onDragStateChangedEvent);
Window.Instance.TouchEvent += OnWindowTouched;
+ Window.Instance.Resized += OnResized;
BackKeyPressed += (object source, EventArgs args) =>
{
SclNuiUpdateWindowPositionCb(_updateWindowPositionChangedEvent, (IntPtr)null);
}
+ //FIXME: This should use RotationChanged of the Inputmethod.
+ private void OnResized(object sender, Window.ResizedEventArgs e)
+ {
+ SclNuiSetRotation((int)Window.Instance.GetCurrentOrientation());
+ }
+
private void PreviewModeChanged(object sender, PreferenceChangedEventArgs e)
{
IseConfig.Instance.ReadIsePreviewOn();