コード例 #1
0
    def on_close(self):
        # self.qt_window.killTimer(self.qt_window.timer_id)

        # FIXME: In order to clean up resources in the GL thread, we want
        # want to intercept the close event, and close by telling glui to
        # quit, so proper cleanup can be performed there.
        # It may not be a problem though, if the Qt OpenGL context simply
        # releases all resources.
        pass

        ImageLoader.get().stop()
コード例 #2
0
ファイル: window.py プロジェクト: EdwardBetts/fs-uae-launcher
def show():
    global current_menu

    # fade_from is used on init_display, so we initialize this
    # color here. Set alpha to 2.0 to force 1 second of solid
    # color in combination with 2 sec. animation below
    if False and windows and not Settings.fullscreen_menu:
        State.get().fade_from = (1.0, 1.0, 1.0, 2.0)
        State.get().fade_to = (1.0, 1.0, 1.0, 0.0)
    else:
        State.get().fade_from = (0.0, 0.0, 0.0, 2.0)
        State.get().fade_to = (0.0, 0.0, 0.0, 0.0)
    init_display()
    if LIGHTING:
        init_lighting()
    init_textures()
    init_fonts()

    if USE_MENU_TRANSITIONS:
        compile_programs()

    InputHandler.open()

    on_resize((Render.get().display_width, Render.get().display_height))
    image_loader = ImageLoader.get()
    image_loader.start()
    new_menu = create_main_menu()
    State.get().history.append(new_menu)

    for platform_id in PlatformHandler.get_platform_ids():
        if "--" + platform_id in sys.argv:
            platform_menu = ItemMenu()
            platform_menu.parent_menu = new_menu

            platform_item = PlatformItem(platform_id)
            platform_menu.items.append(platform_item)
            # platform_menu.set_selected_index(0, immediate=True)

            new_menu = platform_item.activate(platform_menu)
            print(new_menu)
            State.get().history.append(new_menu)
            break

    set_current_menu(new_menu)
    if len(new_menu) == 1:
        # only n/a item showing, possibly
        if len(AllMenuItem().activate(None)) == 0:
            # no games, initiate game scan
            rescan_games()

    State.get().fade_start = get_current_time()
    State.get().fade_end = get_current_time() + 2.000

    # # make a timer so that update events are sent to modules at least once
    # # every second
    # pygame.time.set_timer(IDLE_EVENT, 1000)

    State.get().start_time = get_current_time()
コード例 #3
0
def main():
    application = Application()
    initialize_application("fs-uae-arcade", version=launcher.version.VERSION)

    # fs_width, fs_height = fsui.get_screen_size()
    # cursor_position = None

    # use_window = False
    # use_window_decorations = True
    # use_fullscreen = True
    # use_fullscreen_window = False
    # use_top_clock = check_argument("top_clock") != "0"
    # use_top_logo = check_argument("top_logo") != "0"

    if System.macos:
        if fullscreen() or maximized():
            if check_argument("system_autohide") == "1":
                os_x_set_system_ui_mode(K_UI_MODE_ALL_HIDDEN,
                                        K_UI_OPTION_AUTO_SHOW_MENU_BAR)
    elif running_in_gnome_3():
        if fullscreen() or maximized():
            # use_fullscreen = False
            # use_window_decorations = False
            # use_window = "maximized"
            if check_argument("system_autohide") == "1":
                handle_gnome_extensions()
                # cursor_position = fs_width - 1, fs_height - 1
                # use_top_clock = False
                # use_top_logo = False
                # app.settings["fs-uae:fullscreen-mode::default"] = "window"
        else:
            # We want a normal window.
            pass

    Settings.set("__arcade", "1")

    # if windows:
    #     pass
    # elif macosx:
    #     # use_fullscreen_window = True
    #     # Settings.instance().set("__fullscreen_mode", "window")
    #     pass
    # else:
    #     # app.settings["fs-uae:fullscreen-mode::default"] = "window"
    #     pass

    # if check_argument("fullscreen"):
    #     use_fullscreen = check_argument("fullscreen") == "1"
    #
    # if "--fullscreen-mode=fullscreen" in sys.argv:
    #     use_fullscreen_window = False
    # elif "--fullscreen-mode=window" in sys.argv:
    #     use_fullscreen_window = True
    #
    # if "--maximize" in sys.argv:
    #     use_window = "maximized"
    #     use_fullscreen = False
    #
    # if "--no-window-decorations" in sys.argv:
    #     use_window_decorations = False

    # app.settings["game-center:fullscreen"] = \
    #     "1" if use_fullscreen else "0"
    # if use_fullscreen_window:
    #     app.settings["game-center:fullscreen-mode"] = "window"
    # else:
    #     app.settings["game-center:fullscreen-mode"] = ""
    # app.settings["game-center:window-decorations"] = \
    #     "1" if use_window_decorations else "0"
    # app.settings["game-center:maximize"] = \
    #     "1" if use_window == "maximized" else "0"
    # app.settings["game-center:top-clock"] = "1" if use_top_clock else "0"
    # app.settings["game-center:top-logo"] = "1" if use_top_logo else "0"

    ArcadeWindow().show_auto()

    # if cursor_position is not None:
    #     os.environ["FSGS_RETURN_CURSOR_TO"] = "{0},{1}".format(
    #         cursor_position[0], cursor_position[1])

    application.run()
    print("application.run returned")

    application.stop()
    ImageLoader.get().stop()

    application.wait()

    print(" --- arcade.arcade_main.main is done ---")
    return
コード例 #4
0
def main():
    print("Fengestad Game System...")
    application = Application()

    # fs_width, fs_height = fsui.get_screen_size()
    # cursor_position = None

    # use_window = False
    # use_window_decorations = True
    # use_fullscreen = True
    # use_fullscreen_window = False
    # use_top_clock = check_argument("top_clock") != "0"
    # use_top_logo = check_argument("top_logo") != "0"

    if macosx:
        if fullscreen() or maximized():
            if check_argument("system_autohide") == "1":
                os_x_set_system_ui_mode(
                    K_UI_MODE_ALL_HIDDEN, K_UI_OPTION_AUTO_SHOW_MENU_BAR)
    elif running_in_gnome_3():
        if fullscreen() or maximized():
            # use_fullscreen = False
            # use_window_decorations = False
            # use_window = "maximized"
            if check_argument("system_autohide") == "1":
                handle_gnome_extensions()
                # cursor_position = fs_width - 1, fs_height - 1
                # use_top_clock = False
                # use_top_logo = False
                # app.settings["fs-uae:fullscreen-mode::default"] = "window"
        else:
            # We want a normal window.
            pass

    # if windows:
    #     pass
    # elif macosx:
    #     # use_fullscreen_window = True
    #     # Settings.instance().set("__fullscreen_mode", "window")
    #     pass
    # else:
    #     # app.settings["fs-uae:fullscreen-mode::default"] = "window"
    #     pass

    # if check_argument("fullscreen"):
    #     use_fullscreen = check_argument("fullscreen") == "1"
    #
    # if "--fullscreen-mode=fullscreen" in sys.argv:
    #     use_fullscreen_window = False
    # elif "--fullscreen-mode=window" in sys.argv:
    #     use_fullscreen_window = True
    #
    # if "--maximize" in sys.argv:
    #     use_window = "maximized"
    #     use_fullscreen = False
    #
    # if "--no-window-decorations" in sys.argv:
    #     use_window_decorations = False

    # app.settings["game-center:fullscreen"] = \
    #     "1" if use_fullscreen else "0"
    # if use_fullscreen_window:
    #     app.settings["game-center:fullscreen-mode"] = "window"
    # else:
    #     app.settings["game-center:fullscreen-mode"] = ""
    # app.settings["game-center:window-decorations"] = \
    #     "1" if use_window_decorations else "0"
    # app.settings["game-center:maximize"] = \
    #     "1" if use_window == "maximized" else "0"
    # app.settings["game-center:top-clock"] = "1" if use_top_clock else "0"
    # app.settings["game-center:top-logo"] = "1" if use_top_logo else "0"

    ArcadeWindow().show_auto()

    # if cursor_position is not None:
    #     os.environ["FSGS_RETURN_CURSOR_TO"] = "{0},{1}".format(
    #         cursor_position[0], cursor_position[1])

    application.run()
    print("application.run returned")

    application.stop()
    ImageLoader.get().stop()

    application.wait()

    print(" --- arcade.arcade_main.main is done ---")
    return