Ejemplo n.º 1
0
Test *test_new(SpiceCoreInterface *core)
{
    int port = 5912;
    Test *test = spice_new0(Test, 1);
    SpiceServer* server = spice_server_new();

    test->qxl_instance.base.sif = &display_sif.base;
    test->qxl_instance.id = 0;

    test->core = core;
    test->server = server;
    test->wakeup_ms = 1;
    test->cursor_notify = NOTIFY_CURSOR_BATCH;
    // some common initialization for all display tests
    printf("TESTER: listening on port %d (unsecure)\n", port);
    spice_server_set_port(server, port);
    spice_server_set_noauth(server);
    spice_server_init(server, core);

    cursor_init();
    path_init(&path, 0, angle_parts);
    test->has_secondary = 0;
    test->wakeup_timer = core->timer_add(do_wakeup, test);
    return test;
}
Ejemplo n.º 2
0
int			launch_game(char **_tab, int r, t_cursor *cursor)
{
  struct termios	t;
  char			buff[1024];
  int			played;

  played = 0;
  cursor_init(cursor);
  aff_tab(_tab, cursor);
  while (42)
    {
      if (played == 1)
        {
          end_game(_tab, cursor, "IA");
          ia_turn(_tab, r);
          aff_tab(_tab, cursor);
          end_game(_tab, cursor, "Player");
        }
      init_read(&t);
      read(0, buff, 1024);
      played = move_cursor(cursor, r, buff, _tab);
      aff_tab(_tab, cursor);
    }
  return (0);
}
Ejemplo n.º 3
0
static void
constructed(GObject *base)
{
	JoyScreen *self = JOY_SCREEN(base);
	struct Private *priv = GET_PRIVATE(base);
	gint width = joy_screen_get_width(self);
	gint height = joy_screen_get_height(self);
	// create the display
	priv->display = GFX3D_Display_Create(width, height, width, height,
			8, joy_screen_get_id(self));
	if (G_UNLIKELY(!priv->display)) {
		goto exit;
	}
	// disable automatic cache flushing
	GFX3D_Display_Cache_AutoFlush_Set(priv->display, 0);
	// update the screen asynchronously
	GFX3D_Display_Show_Mode_Set(priv->display,
			//GFX3D_DISPLAY_SHOW_MODE_SYNCHRONOUS);
			GFX3D_DISPLAY_SHOW_MODE_ASYNCHRONOUS);
			//GFX3D_DISPLAY_SHOW_MODE_VSYNC_WAIT_ONLY);
	// clear the display
	GFX3D_Rect rect = { 0, 0, width, height };
	GFX3D_Display_ClearAlpha2D(priv->display, NULL, &rect, 0., 0., 0., 0.);
	// show the display
	GFX3D_Display_Visibility_Set(priv->display, 1);
	// set the display location
	GFX3D_Display_Location_Set(priv->display, 0, 0, 0);
	// setup the screen area
	cairo_region_union_rectangle(priv->area, (gpointer)&rect);
	priv->x = (gdouble)width / 2.;
	priv->y = (gdouble)height / 2.;
	// setup devices
	priv->keyboard = joy_gfx3d_keyboard_new(self);
	priv->mouse = joy_gfx3d_mouse_new(self);
	joy_device_keyboard_set_mouse(priv->keyboard, priv->mouse);
	joy_device_mouse_set_keyboard(priv->mouse, priv->keyboard);
	// create the cursor
	cursor_init(self);
exit:
	if (G_OBJECT_CLASS(joy_gfx3d_screen_parent_class)->constructed) {
		G_OBJECT_CLASS(joy_gfx3d_screen_parent_class)->
			constructed(base);
	}
}
Ejemplo n.º 4
0
int xlib_init() {
	scr = DefaultScreen(dpy);
	root = DefaultRootWindow(dpy);
#ifdef module_randr
	randr_init();
#else
	set(presX, 0); set(presY, 0);
	set(presW, DisplayWidth(dpy,scr));
	set(presH, DisplayHeight(dpy,scr));
#endif /* moudle_randr */
	XSetWindowAttributes wa;
	wa.background_pixel = 0x000000;
	wa.backing_store = Always;
	wa.event_mask = ButtonPressMask | KeyPressMask | PointerMotionMask;
	topWin = XCreateWindow(dpy, root, get_d(presX), get_d(presY), get_d(presW),
			get_d(presH), 0, DefaultDepth(dpy,scr), InputOutput,
			DefaultVisual(dpy,scr), CWBackPixel | CWBackingStore | CWEventMask, &wa);
	presWin = XCreateWindow(dpy, topWin, 0, 0, get_d(presW), get_d(presH), 0,
			DefaultDepth(dpy,scr), InputOutput, DefaultVisual(dpy,scr),
			CWBackingStore | CWEventMask, &wa);
	XClassHint hint;
	hint.res_name = "Presentation";
	hint.res_class = "Slider";
	XSetClassHint(dpy, topWin, &hint);
	XStoreName(dpy, topWin, "Slider");
	XMapWindow(dpy, topWin); // TODO where is it?
	XMapWindow(dpy, presWin);
	/* override placement of annoying WMs */
	XMoveWindow(dpy, topWin, get_d(presX), get_d(presY));
	/* other init functions */
	if (command_init()) return xlib_free(1);
	if (render_init(get_s(presFile))) return xlib_free(2);
//	render_init(get_s(noteFile));
#ifdef module_cursor
	if (cursor_init(presWin)) return xlib_free(3);
#endif
#ifdef module_sorter
	if (sorter_init(topWin)) return xlib_free(4);
#endif
	render_set_fader(presWin, 1);
	command(cmdFullscreen, NULL);
	return 0;
}
Ejemplo n.º 5
0
/**
 * 初始化窗口管理器
 * 就不写注释了 函数名写的已经很明白。。
 **/
si_t window_manager_init()
{
	if(0 != terminal_init())
	{
		EGUI_PRINT_ERROR("failed to init terminal");
		return -1;
	}

	if(0 != config_init())
	{
		EGUI_PRINT_ERROR("failed to init config");
		return -1;
	}

	if(0 != event_init("/dev/input/event9", "/dev/input/event10", 1000))
	{
		EGUI_PRINT_ERROR("failed to init event module");
		return -1;
	}

	if(0 != comm_init("/tmp/server"))
	{
		EGUI_PRINT_ERROR("failed to init comm module");
		return -1;
	}

	if(0 != graph_init("/dev/fb0", 0, 0, 0, 0))
	{
		EGUI_PRINT_ERROR("failed to init graph module");
		return -1;
	}

	if(0 != cursor_init("CURSOR_SHAPE_X"))
	{
		EGUI_PRINT_ERROR("failed to init cursor");
		return -1;
	}

	applications_init(3, 30);

	return 0;
}
Ejemplo n.º 6
0
SpiceServer* test_init(SpiceCoreInterface *core)
{
    int port = 5912;
    SpiceServer* server = spice_server_new();
    g_core = core;

    // some common initialization for all display tests
    printf("TESTER: listening on port %d (unsecure)\n", port);
    spice_server_set_port(server, port);
    spice_server_set_noauth(server);
    spice_server_init(server, core);

    cursor_init();
    path_init(&path, 0, angle_parts);
    memset(g_primary_surface, 0, sizeof(g_primary_surface));
    memset(g_secondary_surface, 0, sizeof(g_secondary_surface));
    has_secondary = 0;
    wakeup_timer = core->timer_add(do_wakeup, NULL);
    return server;
}
Ejemplo n.º 7
0
void BgfxPluginUI::create(void* windowHandle, int width, int height) {
    //docksys_set_callbacks(&s_dockSysCallbacks);
	cursor_init();
#ifdef PRODBG_WIN
    bgfx::winSetHwnd((HWND)windowHandle);
#elif PRODBG_MAC
    bgfx::osxSetNSWindow(windowHandle);
#elif PRODBG_UNIX
    bgfx::x11SetDisplayWindow(XOpenDisplay(0), (uint32_t)(uintptr_t)windowHandle);
#endif
    bgfx::init();
    bgfx::reset((uint32_t)width, (uint32_t)height);
    bgfx::setViewSeq(0, true);
    imgui_setup(width, height);

    s_context.width = width;
    s_context.height = height;

    //Service_register(&g_serviceMessageFuncs, PDMESSAGEFUNCS_GLOBAL);
    //Service_register(&g_dialogFuncs, PDDIALOGS_GLOBAL);

    //Cursor_init();
}
Ejemplo n.º 8
0
void cursor_set_special(int type) {
	// Set special cursors
	cursor = cursor_init(crosshair);
	SDL_SetCursor(cursor);
}