示例#1
0
文件: menu.c 项目: DeadNumbers/gosm
/****************************************************************************************************
* toggle fullscreen
****************************************************************************************************/
static gboolean menubar_fullscreen_cb(GtkWidget *widget, gpointer menubar_p)
{
	Menu * menubar = GOSM_MENU(menubar_p);
	if (gtk_check_menu_item_get_active(GTK_CHECK_MENU_ITEM(menubar -> menu_view_fullscreen))){
		gdk_window_fullscreen(GTK_WIDGET(menubar -> main_window) -> window);
	}else{
		gdk_window_unfullscreen(GTK_WIDGET(menubar -> main_window) -> window);
	}
}
示例#2
0
文件: calc.c 项目: debrouxl/tiemu
int hid_switch_fullscreen(void)
{
	if(options.view != VIEW_FULL)
	{
		set_scale(options.view = VIEW_FULL);
		
		hid_exit();
		hid_init();

		gdk_window_fullscreen(main_wnd->window);
	}

	return 0;
}
示例#3
0
JNIEXPORT void JNICALL
Java_org_gnome_gdk_GdkWindow_gdk_1window_1fullscreen
(
	JNIEnv* env,
	jclass cls,
	jlong _self
)
{
	GdkWindow* self;

	// convert parameter self
	self = (GdkWindow*) _self;

	// call function
	gdk_window_fullscreen(self);

	// cleanup parameter self
}
示例#4
0
void click_fullcreen (GtkWidget *widget, gpointer data)
{
	 GtkWidget * window = (GtkWidget *) data;
    if (GTK_TOGGLE_BUTTON (widget)->active) 
    {
        /* If control reaches here, the toggle button is down */
        printf("ok\n");
		 gdk_window_fullscreen(window->window);
		  start = 1;
    } else {
    	  printf("ko\n");
        /* If control reaches here, the toggle button is up */
		  gdk_window_unfullscreen(window->window);
    }
	 //int w, h;
	 //gdk_window_get_size(window->window,&w,&h);
	 //gtk_widget_set_size_request(window,w,h);
}
示例#5
0
static void toggleFullScreen(void)
{
	/* Could happen right after startup ... dunno, better check it. */
	if (win_beamer == NULL)
		return;

	/* We have global reference to the beamer window, so we know exactly
	 * on which object fullscreen must be toggled. */
	if (isFullScreen == FALSE)
	{
		moveBeamerToMouseMonitor();
		gdk_window_fullscreen(gtk_widget_get_window(win_beamer));
		isFullScreen = TRUE;
	}
	else
	{
		gdk_window_unfullscreen(gtk_widget_get_window(win_beamer));
		isFullScreen = FALSE;
	}
}
示例#6
0
static void
clutter_stage_gdk_set_fullscreen (ClutterStageWindow *stage_window,
                                  gboolean            is_fullscreen)
{
  ClutterStageGdk *stage_gdk = CLUTTER_STAGE_GDK (stage_window);
  ClutterStage *stage = CLUTTER_STAGE_COGL (stage_window)->wrapper;

  if (stage == NULL || CLUTTER_ACTOR_IN_DESTRUCTION (stage))
    return;

  if (stage_gdk->window == NULL)
    return;

  CLUTTER_NOTE (BACKEND, "%ssetting fullscreen", is_fullscreen ? "" : "un");

  if (is_fullscreen)
    gdk_window_fullscreen (stage_gdk->window);
  else
    gdk_window_unfullscreen (stage_gdk->window);
}
示例#7
0
/**
 * The function requests toggle of the fullscreen setting of the application
 * window.
 *
 * \param model pointer to generic model structure
 * \param window pointer to the window to toggle
 * \return OK on success
 */
RCode model_app_toggle_fullscreen(ModelGeneric *model, GdkWindow* window) {
    GdkWindowState window_state;

    ASSERT( NULL != model );

    TRACE_MESSAGE(MODL, TL_INFO, "Toggle fullscreen mode (model=%p)", model);

    if ( NULL == window ) {
        ERROR_SET(ERROR.INVALID_PARAM);
        ERROR_NOTE("Pointer to window is NULL");
        return FAIL;
    }

    window_state = gdk_window_get_state(window);
    if ( 0 == (GDK_WINDOW_STATE_FULLSCREEN & window_state) ) {
        gdk_window_fullscreen(window);
    } else {
        gdk_window_unfullscreen(window);
    }

    return OK;
}
示例#8
0
static VALUE
gdkwin_fullscreen(VALUE self)
{
    gdk_window_fullscreen(_SELF(self));
    return self;
}
示例#9
0
文件: gamine.c 项目: btong/gamine
gint
main (gint argc, gchar *argv[])
{
    Window root;
    //gettext
    bindtextdomain( "gamine", LOCALDIR );
    textdomain( "gamine" );
    gamine_t cb;
    GtkWidget *window;
    GdkWindow *gdkwindow;
    GtkWindow *gtkwindow;
    GdkScreen *screen;
    GdkPixbuf *cursor_pixbuf;
    GdkPixbuf *icon_pixbuf;
    GdkCursor *cursor;
    GdkColor bg_color;
    gchar *cursorfile;
    gchar *iconfile;

    cb.is_cairo = FALSE;
    gtk_init (&argc, &argv);
    gst_init (&argc, &argv);
    gconf_init(argc, argv, NULL);
    gst_play_background (cb.bus,
              "BachJSBrandenburgConcertNo2inFMajorBWV1047mvmt1.ogg", TRUE);

    window = gtk_window_new (GTK_WINDOW_TOPLEVEL);
/* Create the drawing area and configuration */
    cb.da = gtk_drawing_area_new ();
    bg_color.red   = 65535;
    bg_color.green = 65535;
    bg_color.blue  = 65535;
    gtk_widget_modify_bg (cb.da, GTK_STATE_NORMAL, &bg_color);
    gtk_container_add (GTK_CONTAINER (window), cb.da);
    cb.gc = gconf_client_get_default();

    gtkwindow = GTK_WINDOW(window);
    gtk_window_set_title (gtkwindow, "Gamine");
    gtk_window_set_wmclass(gtkwindow, "gamine", "Gamine");
    gtk_container_set_border_width (GTK_CONTAINER (gtkwindow), 0);


/* Event signals */
    g_signal_connect (gtkwindow, "destroy",
         G_CALLBACK (gtk_main_quit), &gtkwindow);
    g_signal_connect (G_OBJECT (cb.da), "expose-event",
        G_CALLBACK (display_help), &cb);
    g_signal_connect (cb.da, "motion_notify_event",
        G_CALLBACK (draw_line), &cb);
    g_signal_connect (cb.da, "button_press_event",
        G_CALLBACK (draw_star), &cb);
    g_signal_connect (gtkwindow, "key-press-event",
        G_CALLBACK (gamine_on_key), &cb);
    gtk_widget_set_events (cb.da, gtk_widget_get_events (cb.da)
        | GDK_LEAVE_NOTIFY_MASK
        | GDK_BUTTON_PRESS_MASK
        | GDK_BUTTON_RELEASE_MASK
        | GDK_POINTER_MOTION_MASK
        | GDK_POINTER_MOTION_HINT_MASK);
/* Set fullscreen, grab mouse/keyboard, ...*/
    gtk_widget_show_all (GTK_WIDGET(gtkwindow));
    gdkwindow = GDK_WINDOW(GTK_WIDGET(gtkwindow)->window);
    screen = gtk_widget_get_screen (cb.da);
    gtk_window_present (gtkwindow);
    gtk_window_stick(gtkwindow);

    //gtk_window_set_keep_above (gtkwindow), True);
    //gtk_window_set_transient_for (gtkwindow, NULL);
    //set fullscreen
    gdk_window_fullscreen (gdkwindow);
    gtk_window_fullscreen (gtkwindow);
    gdk_window_raise (gdkwindow);
    //set full screen without window manager
    XMoveResizeWindow(GDK_WINDOW_XDISPLAY(gdkwindow), GDK_WINDOW_XID(gdkwindow),
        0, 0, gdk_screen_get_width (screen), gdk_screen_get_height (screen));
    root = DefaultRootWindow(GDK_WINDOW_XDISPLAY (gdkwindow));
    XGrabPointer(GDK_WINDOW_XDISPLAY (gdkwindow), root, True, PointerMotionMask,
        GrabModeAsync, GrabModeAsync, root, None, CurrentTime); 
    XGrabKeyboard(GDK_WINDOW_XDISPLAY (gdkwindow), root, True,
                    GrabModeAsync, GrabModeAsync, CurrentTime);
    //remove keyboard repeat
    XAutoRepeatOff(GDK_WINDOW_XDISPLAY (gdkwindow));
    gtk_window_has_toplevel_focus (gtkwindow);
/*cursor*/
    cursorfile = g_build_filename(DATADIR, "pencil.png", NULL);
    if (!g_file_test (cursorfile, G_FILE_TEST_EXISTS)) {
        printf(gettext("*** error: %s does not exists***\n"), cursorfile);
    } else {
        cursor_pixbuf = gdk_pixbuf_new_from_file(cursorfile, NULL);
        cursor = gdk_cursor_new_from_pixbuf(gdk_display_get_default(),
            cursor_pixbuf, 0, 38);
        gdk_window_set_cursor(gdkwindow, cursor);
        gdk_cursor_unref(cursor);
        gdk_pixbuf_unref(cursor_pixbuf);
    }
    g_free(cursorfile);
/*Set icon*/
    iconfile = g_build_filename(DATADIR, "gamine.png", NULL);
    if (!g_file_test (iconfile, G_FILE_TEST_EXISTS))
        printf(gettext("*** error: %s does not exists***\n"), iconfile);
    else {
        icon_pixbuf = gdk_pixbuf_new_from_file(iconfile, NULL);
        gtk_window_set_icon (gtkwindow, icon_pixbuf);
        gdk_pixbuf_unref (icon_pixbuf);
    }
    g_free(iconfile);

    load_conf(&cb);
    gtk_main ();
    //set keyboard repeat
    XAutoRepeatOn(GDK_WINDOW_XDISPLAY (gdkwindow));
    XCloseDisplay(GDK_WINDOW_XDISPLAY (gdkwindow));
    return 0;
}
示例#10
0
文件: calc.c 项目: debrouxl/tiemu
int  hid_init(void)
{
    // Found a PC keyboard keymap
    match_keymap(tihw.calc_type);

    // Load kbd keymap
    if(keymap_load(options.keys_file) == -1)
    {
	    gchar *s = g_strdup_printf("unable to load this keymap: <%s>\n", options.keys_file);
	    tiemu_error(0, s);
	    g_free(s);
	    return -1;
    }

    // Found a skin
	match_skin(tihw.calc_type);

    // Load skin (2 parts)
    if(skin_load(&skin_infos, options.skin_file) == -1) 
    {
	    gchar *s = g_strdup_printf("unable to load this skin: <%s>\n", options.skin_file);
	    tiemu_error(0, s);
	    g_free(s);
	    return -1;
    }

	// Allocate the skn pixbuf (if needed)
	skn = skin_infos.image;
  
	// Set skin keymap depending on calculator type
    switch(tihw.calc_type)
    {
    case TI92:
    case TI92p:
    case V200:
        skn_keymap = sknKey92;
        break;
    case TI89:
    case TI89t:
      	skn_keymap = sknKey89;
        break;
    default:
        {
	  	gchar *s = g_strdup_printf("no skin found for this calc\n");
	  	tiemu_error(0, s);
	  	g_free(s);
	  	return -1;
        }
	}

	// Set window/LCD sizes
	set_scale(options.view);
	set_infos();

    // Allocate the TI screen buffer
	lcd_bytmap = (uint32_t *)malloc(LCDMEM_W * LCDMEM_H);

    // Allocate the lcd pixbuf
    lcd = gdk_pixbuf_new(GDK_COLORSPACE_RGB, FALSE, 8, si.t * LCDMEM_W, si.t * LCDMEM_H);
    if(lcd == NULL)
    {
        gchar *s = g_strdup_printf("unable to create LCD pixbuf.\n");
	    tiemu_error(0, s);
	    g_free(s);
	    return -1;
    }

	// Used by TI89 (the LCD view is clipped from memory view)
	si.l = gdk_pixbuf_new_subpixbuf(lcd, 0, 0, tihw.lcd_w, tihw.lcd_h);
    
	// Constants for LCD update (speed-up)
    li.n_channels = gdk_pixbuf_get_n_channels (lcd);
	li.width = gdk_pixbuf_get_width (lcd);
	li.height = gdk_pixbuf_get_height (lcd);
	li.rowstride = gdk_pixbuf_get_rowstride (lcd);
	li.pixels = gdk_pixbuf_get_pixels (lcd);

	// Create main window
	display_main_wnd();

    // Allocate the backing pixmap (used for drawing and refresh)
    pixmap = gdk_pixmap_new(main_wnd->window, wr.w, wr.h, -1);
    if(pixmap == NULL)
    {
        gchar *s = g_strdup_printf("unable to create backing pixbuf.\n");
	    tiemu_error(0, s);
	    g_free(s);
	    return -1;
    }
    
    // Draw the skin and compute grayscale palette
	redraw_skin();
  	compute_grayscale();

    // Init the planar/chunky conversion table for LCD
  	compute_convtable();

    // Install LCD refresh: 100 FPS (10 ms)
    tid = g_timeout_add((params.lcd_rate == -1) ? 50 : params.lcd_rate, 
		(GtkFunction)hid_refresh, NULL);

	gtk_widget_show(main_wnd);	// show wnd here

	if(options.view == VIEW_FULL)
		gdk_window_fullscreen(main_wnd->window);
	
    return 0;
}
示例#11
0
/**
 * keyevents for paint windows thet is show by dataprojector
 **/
static gboolean
event_keypress (GtkWidget     *widget,
				GdkEventKey *event )
{
	unsigned int r,g,b;
	printf("debug color %d %c\n", event->keyval, event->keyval);
	switch(event->keyval){
	// key set color for brush
	case 65438:
	case '0':
		sscanf(color_key[0],"%2X%2X%2X",&r,&g,&b);
		color.b = b/255.0; color.r = r/255.0; color.g = g/255.0;
		break;
	case 65436:
	case '1':
		sscanf(color_key[1],"%2X%2X%2X",&r,&g,&b);
        //printf("%s\n", color_key[1]);
		color.b = b/255.0; color.r = r/255.0; color.g = g/255.0;
		break;
	case 65433:
	case '2':
		sscanf(color_key[2],"%2X%2X%2X",&r,&g,&b);
		color.b = b/255.0; color.r = r/255.0; color.g =  g/255.0;
		break;
	case 65435:
	case '3':
		sscanf(color_key[3],"%2X%2X%2X",&r,&g,&b);
		color.b = b/255.0; color.r = r/255.0; color.g = g/255.0;
		break;
	case 65430:
	case '4':
		sscanf(color_key[4],"%2X%2X%2X",&r,&g,&b);
		color.b = b/255.0; color.r = r/255.0; color.g = g/255.0;
		break;
	case 65437:
	case '5':
		sscanf(color_key[5],"%2X%2X%2X",&r,&g,&b);
		color.b = b/255.0; color.r = r/255.0; color.g = g/255.0;
		break;
	case 65432:
	case '6':
		sscanf(color_key[6],"%2X%2X%2X",&r,&g,&b);
		color.b = b/255.0; color.r = r/255.0; color.g = g/255.0;
		break;
	case 65429:
	case '7':
		sscanf(color_key[7],"%2X%2X%2X",&r,&g,&b);
		color.b = b/255.0; color.r = r/255.0; color.g = g/255.0;
		break;
	case 65431:
	case '8':
		sscanf(color_key[8],"%2X%2X%2X",&r,&g,&b);
		color.b = b/255.0; color.r = r/255.0; color.g = g/255.0;
		break;
	case 65434:
	case '9':
		sscanf(color_key[9],"%2X%2X%2X",&r,&g,&b);
		color.b = b/255.0; color.r = r/255.0; color.g = g/255.0;
		break;

	case 65455:
	case '/':
		brush_type = 0;
		break;
    case 65451:
        brush_type = 3;
        printf("type 3\n");
        break;
	case 65450:
	case '+':
		brush_type = 1;
		break;
	case '*':
	case 65453:
	case 'a':
		brush_type = 2;
		break;
	case 65535:
		SavePaint();
		CleanPaint();
		break;

	case 'r':
		{

        if (record_video == false){
           printf("start record");
//            writter_v = cvCreateVideoWriter(buffer_v, CV_FOURCC('M', 'J', 'P', 'G') , 20, cvSize(640,480),  1);
            writter_v = cvCreateVideoWriter(buffer_v, CV_FOURCC('T','H','E','O') , 20, cvSize(640,480),  1);
            record_video = true;
        } else {
            cvReleaseVideoWriter( &writter_v );
            record_video = false;
        }
		
		}
		break;

	// vymazání plochy
	case 'c':
		{
			SavePaint();
			CleanPaint();
		}
		break;
	// spuštění režimu ve fullsreenmodu
	case 'f':
		isFullSreen = !isFullSreen;
		if(isFullSreen){
			gdk_window_fullscreen(widget->window);
		}
		else {
			gdk_window_unfullscreen(widget->window);
			window_w = DEFAULT_WIDTH;
			window_h = DEFAULT_HEIGHT;
		}
		break;
	/* spuštění programu */
	case 's':
		start = true;
	break;
	/* nastavení treshold pro upravu obrázku */
	case 'm':
		if(treshold<255) treshold++; break;
	/* nastavení treshold pro upravu obrázku */
	case 'n':
		if(treshold>0) treshold--; break;

	//escape
	case 65307:
	case 'q':
		main_quit ();
		break;
	}

	return true;
}