コード例 #1
0
static void
hildon_app_menu_realize                         (GtkWidget *widget)
{
    Atom property, window_type;
    Display *xdisplay;
    GdkDisplay *gdkdisplay;
    GdkScreen *screen;

    GTK_WIDGET_CLASS (hildon_app_menu_parent_class)->realize (widget);

    gdk_window_set_decorations (widget->window, GDK_DECOR_BORDER);

    gdkdisplay = gdk_drawable_get_display (widget->window);
    xdisplay = GDK_WINDOW_XDISPLAY (widget->window);

    property = gdk_x11_get_xatom_by_name_for_display (gdkdisplay, "_NET_WM_WINDOW_TYPE");
    window_type = XInternAtom (xdisplay, "_HILDON_WM_WINDOW_TYPE_APP_MENU", False);
    XChangeProperty (xdisplay, GDK_WINDOW_XID (widget->window), property,
                     XA_ATOM, 32, PropModeReplace, (guchar *) &window_type, 1);

    /* Detect any screen changes */
    screen = gtk_widget_get_screen (widget);
    g_signal_connect (screen, "size-changed", G_CALLBACK (screen_size_changed), widget);

    /* Force menu to set the initial layout */
    screen_size_changed (screen, HILDON_APP_MENU (widget));
}
コード例 #2
0
ファイル: ev774.c プロジェクト: yehongbing/Eiffel-Projects
/* {EV_WINDOW_IMP}.internal_disable_border */
void F1123_15417 (EIF_REFERENCE Current)
{
	GTCX
	EIF_INTEGER_32 loc1 = (EIF_INTEGER_32) 0;
	EIF_INTEGER_32 loc2 = (EIF_INTEGER_32) 0;
	EIF_INTEGER_32 loc3 = (EIF_INTEGER_32) 0;
	EIF_POINTER tp1;
	EIF_INTEGER_32 ti4_1;
	EIF_INTEGER_32 ti4_2;
	RTCDT;
	RTLD;
	
	RTLI(1);
	RTLR(0,Current);
	
	RTGC;
	loc2 = F1082_14213(Current);
	loc3 = F1082_14215(Current);
	ti4_1 = (FUNCTION_CAST(EIF_INTEGER_32, (EIF_REFERENCE)) R11042[dtype-1081])(Current);
	ti4_2 = eif_bit_not((EIF_INTEGER_32) GDK_DECOR_BORDER);
	loc1 = eif_bit_and(ti4_1,ti4_2);
	tp1 = *(EIF_POINTER *)(Current + O10979[dtype-1078]);
	tp1 = (EIF_POINTER) (((GtkWidget *)tp1)->window);
	gdk_window_set_decorations((GdkWindow*) tp1, (GdkWMDecoration) loc1);
	F1082_14211(Current, loc2, loc3);
	RTLE;
}
コード例 #3
0
ファイル: GTKWindow.cpp プロジェクト: pontocom/opensdrm
GTKWindow::GTKWindow(Theme *pTheme, string &oName)
          :Window(pTheme, oName)
{
    m_theme = pTheme;
    m_pCanvas = new GTKCanvas(this);
    m_pMindMeldMutex = new Mutex();

    lastDockPos.x = -1;
    lastDockPos.y = -1;

    gdk_threads_enter();
    mainWindow = gtk_window_new(GTK_WINDOW_TOPLEVEL);
    gtk_widget_set_app_paintable(mainWindow, TRUE);
    gtk_window_set_title(GTK_WINDOW(mainWindow), BRANDING);
    gtk_window_set_policy(GTK_WINDOW(mainWindow), TRUE, TRUE, TRUE);
    gtk_widget_set_events(mainWindow, GDK_STRUCTURE_MASK
                          | GDK_POINTER_MOTION_MASK | GDK_BUTTON_MOTION_MASK |
                          GDK_BUTTON_PRESS_MASK | GDK_BUTTON_RELEASE_MASK |
                          GDK_KEY_PRESS_MASK); 
    gtk_widget_realize(mainWindow);
    gdk_window_set_decorations(mainWindow->window, (GdkWMDecoration)0);
    gdk_threads_leave();

    initialized = false;
    m_bMouseInWindow = false;
}
コード例 #4
0
ファイル: toplevel.cpp プロジェクト: raydtang/wxWidgets
void wxTopLevelWindowGTK::GTKHandleRealized()
{
    wxNonOwnedWindow::GTKHandleRealized();

    GdkWindow* window = gtk_widget_get_window(m_widget);

    gdk_window_set_decorations(window, (GdkWMDecoration)m_gdkDecor);
    gdk_window_set_functions(window, (GdkWMFunction)m_gdkFunc);

    const wxIconBundle& icons = GetIcons();
    if (icons.GetIconCount())
        SetIcons(icons);

    GdkCursor* cursor = g_globalCursor.GetCursor();
    if (wxIsBusy() && !gtk_window_get_modal(GTK_WINDOW(m_widget)))
        cursor = g_busyCursor.GetCursor();

    if (cursor)
        gdk_window_set_cursor(window, cursor);

#ifdef __WXGTK3__
    if (gtk_window_get_has_resize_grip(GTK_WINDOW(m_widget)))
    {
        // Grip window can end up obscured, probably due to deferred show.
        // Reset grip to ensure it is visible.
        gtk_window_set_has_resize_grip(GTK_WINDOW(m_widget), false);
        gtk_window_set_has_resize_grip(GTK_WINDOW(m_widget), true);
    }
#endif
}
コード例 #5
0
ファイル: toplevel.cpp プロジェクト: CobaltBlues/wxWidgets
void wxTopLevelWindowGTK::GTKHandleRealized()
{
    wxNonOwnedWindow::GTKHandleRealized();

    gdk_window_set_decorations(gtk_widget_get_window(m_widget),
                               (GdkWMDecoration)m_gdkDecor);
    gdk_window_set_functions(gtk_widget_get_window(m_widget),
                               (GdkWMFunction)m_gdkFunc);

    // GTK's shrinking/growing policy
    if ( !(m_gdkFunc & GDK_FUNC_RESIZE) )
        gtk_window_set_resizable(GTK_WINDOW(m_widget), FALSE);
#ifndef __WXGTK3__
    else
        gtk_window_set_policy(GTK_WINDOW(m_widget), 1, 1, 1);
#endif

    const wxIconBundle& icons = GetIcons();
    if (icons.GetIconCount())
        SetIcons(icons);

#ifdef __WXGTK3__
    if (gtk_window_get_has_resize_grip(GTK_WINDOW(m_widget)))
    {
        // Grip window can end up obscured, probably due to deferred show.
        // Reset grip to ensure it is visible.
        gtk_window_set_has_resize_grip(GTK_WINDOW(m_widget), false);
        gtk_window_set_has_resize_grip(GTK_WINDOW(m_widget), true);
    }
#endif
}
コード例 #6
0
ファイル: gimageview.c プロジェクト: ashie/gimageview
static void
show_splash ()
{
   GtkWidget *window;
   GtkWidget *pixmap;

   pixmap = gimv_icon_stock_get_widget ("gimageview");

   window = gtk_window_new (GTK_WINDOW_POPUP);
   gtk_widget_realize(window);
   gtk_window_set_position (GTK_WINDOW (window), GTK_WIN_POS_CENTER);
   gdk_window_set_decorations(window->window, 0);

   gtk_container_add(GTK_CONTAINER(window), pixmap);
   gimv_icon_stock_free_icon ("gimageview");

   gtk_widget_show(pixmap);
   gtk_widget_show(window);
   gdk_window_raise (window->window);

   while (gtk_events_pending()) gtk_main_iteration();

   splash_timer_id
      = gtk_timeout_add (1500,
                         (GtkFunction) timeout_splash,
                         (gpointer) window);
}
コード例 #7
0
ファイル: toplevel.cpp プロジェクト: CobaltBlues/wxWidgets
static void
gtk_frame_realized_callback( GtkWidget * WXUNUSED(widget),
                             wxTopLevelWindowGTK *win )
{
    if (g_isIdle)
        wxapp_install_idle_handler();

    // All this is for Motif Window Manager "hints" and is supposed to be
    // recognized by other WM as well. Not tested.
    gdk_window_set_decorations(win->m_widget->window,
                               (GdkWMDecoration)win->m_gdkDecor);
    gdk_window_set_functions(win->m_widget->window,
                               (GdkWMFunction)win->m_gdkFunc);

    // GTK's shrinking/growing policy
    if ((win->m_gdkFunc & GDK_FUNC_RESIZE) == 0)
        gtk_window_set_policy(GTK_WINDOW(win->m_widget), 0, 0, 1);
    else
        gtk_window_set_policy(GTK_WINDOW(win->m_widget), 1, 1, 1);

    // reset the icon
    wxIconBundle iconsOld = win->GetIcons();
    if ( !iconsOld.IsEmpty() )
    {
        win->SetIcon( wxNullIcon );
        win->SetIcons( iconsOld );
    }
}
コード例 #8
0
static void
hildon_time_picker_realize                      (GtkWidget *widget)
{
    GTK_WIDGET_CLASS (parent_class)->realize(widget);

    /* We only want the border for the dialog. */
    gdk_window_set_decorations (widget->window, GDK_DECOR_BORDER);
}
コード例 #9
0
ファイル: dialogs.c プロジェクト: aufau/xqf
GtkWidget *dialog_create_modal_transient_window (const char *title,
		int close_on_esc, 
		int allow_resize, 
		GtkSignalFunc on_destroy) {
	GtkWidget *window;
	GtkWidget *parent;

	window = gtk_window_new (GTK_WINDOW_TOPLEVEL);

	gtk_window_set_position (GTK_WINDOW (window), GTK_WIN_POS_CENTER);
	gtk_signal_connect (GTK_OBJECT (window), "delete_event",
			GTK_SIGNAL_FUNC (window_delete_event_callback), NULL);
	if (on_destroy) {
		gtk_signal_connect (GTK_OBJECT (window), "destroy",
				GTK_SIGNAL_FUNC (on_destroy), NULL);
	}
	gtk_signal_connect (GTK_OBJECT (window), "destroy",
			GTK_SIGNAL_FUNC (gtk_main_quit), NULL);

	if (close_on_esc) {
		gtk_signal_connect (GTK_OBJECT (window), "key_press_event",
				GTK_SIGNAL_FUNC (destroy_on_escape), NULL);
	}

	if (title)
		gtk_window_set_title (GTK_WINDOW (window), title);

	gtk_widget_realize (window);

	gdk_window_set_decorations (window->window, (allow_resize)?
			GDK_DECOR_BORDER | GDK_DECOR_TITLE | GDK_DECOR_RESIZEH :
			GDK_DECOR_BORDER | GDK_DECOR_TITLE);

	gdk_window_set_functions (window->window, (allow_resize)?
			GDK_FUNC_MOVE | GDK_FUNC_CLOSE | GDK_FUNC_RESIZE : 
			GDK_FUNC_MOVE | GDK_FUNC_CLOSE);

	gtk_window_set_modal (GTK_WINDOW (window), TRUE);

	parent = top_window ();
	if (parent)
		gtk_window_set_transient_for (GTK_WINDOW (window), GTK_WINDOW (parent));

	register_window (window);

	return window;
}
コード例 #10
0
ファイル: popupwin.cpp プロジェクト: 3v1n0/wxWidgets
static gint
gtk_dialog_realized_callback( GtkWidget * WXUNUSED(widget), wxPopupWindow *win )
{
    if (g_isIdle)
        wxapp_install_idle_handler();

    /* all this is for Motif Window Manager "hints" and is supposed to be
       recognized by other WM as well. not tested. */
    long decor = (long) GDK_DECOR_BORDER;
    long func = (long) GDK_FUNC_MOVE ;

    gdk_window_set_decorations( win->m_widget->window, (GdkWMDecoration)decor);
    gdk_window_set_functions( win->m_widget->window, (GdkWMFunction)func);

    gtk_window_set_policy(GTK_WINDOW(win->m_widget), 0, 0, 1);

    return FALSE;
}
コード例 #11
0
ファイル: window.c プロジェクト: amery/clip-itk
// Set DECORATIONS for window
int
clip_GTK_WINDOWSETDECORATIONS(ClipMachine * cm)
{
	C_widget *cwin = _fetch_cw_arg(cm);
	GdkWMDecoration Decor = _clip_parni(cm, 2);
	CHECKARG(2,NUMERIC_t);

	CHECKCWID(cwin,GTK_IS_WINDOW);
	if (cwin->widget->window)
	{
		gdk_window_set_decorations(cwin->widget->window, Decor);
		_clip_retl(cm, TRUE);
	}
	else
		_clip_retl(cm, FALSE);
	return 0;
err:
	return 1;
}
コード例 #12
0
static void
hildon_calendar_popup_init                      (HildonCalendarPopup *cal)
{
    HildonCalendarPopupPrivate *priv;
    static int set_domain = 1;

    priv = HILDON_CALENDAR_POPUP_GET_PRIVATE(cal);
    g_assert (priv);

    /* set the domain directory for different language */
    /* FIXME I can't exactly figure out why is this here... */
    if (set_domain) {
        (void) bindtextdomain ("hildon-libs", LOCALEDIR);
        set_domain = 0;
    }

    priv->cal = hildon_calendar_new ();

    /* dialog options and packing */
    hildon_calendar_set_display_options (HILDON_CALENDAR (priv->cal),
                                         HILDON_CALENDAR_SHOW_HEADING |
                                         HILDON_CALENDAR_SHOW_DAY_NAMES |
                                         HILDON_CALENDAR_SHOW_WEEK_NUMBERS);

    gtk_box_pack_start (GTK_BOX (GTK_DIALOG (cal)->vbox), priv->cal,
                        TRUE, TRUE, 0);
    gtk_dialog_set_has_separator (GTK_DIALOG (cal), FALSE);
    gtk_dialog_add_button (GTK_DIALOG (cal), _("wdgt_bd_done"), GTK_RESPONSE_OK);
    gtk_widget_show(priv->cal);

    /* Connect signals */
    g_signal_connect (G_OBJECT (priv->cal), "key-press-event",
                      G_CALLBACK (hildon_key_pressed), cal);

    g_signal_connect (G_OBJECT (priv->cal), "selected_date",
                      G_CALLBACK (hildon_calendar_selected_date), cal);

    /* set decorations, needs realizing first */
    /* FIXME That should be moved to on_realize */
    gtk_widget_realize (GTK_WIDGET (cal));
    gdk_window_set_decorations (GTK_WIDGET (cal)->window, GDK_DECOR_BORDER);
}
コード例 #13
0
// Open the main filter dialog and call the handlers
// if needed.
int
GUI_handleVFilter (void)
{

    getLastVideoFilter ();	// expand video to full size

    // sanity check
    if (nb_active_filter == 0)
    {
        nb_active_filter = 1;
        videofilters[0].filter =
        new AVDMVideoStreamNull (video_body, frameStart,
				 frameEnd - frameStart);
    }
        dialog = createFilterDialog();
        GdkWMDecoration decorations=(GdkWMDecoration)0;
        gtk_widget_realize(dialog);
        gdk_window_set_decorations(dialog->window, (GdkWMDecoration)(GDK_DECOR_ALL | GDK_DECOR_MINIMIZE));
        GdkScreen* screen = gdk_screen_get_default();
        gint width = gdk_screen_get_width(screen);
        if(width>=1024)
            gtk_window_set_default_size(GTK_WINDOW(dialog), 900, 600);
        updateFilterList ();
        gtk_register_dialog (dialog);
        //gtk_widget_show (dialog);
        int r;
        while(1)
        {
          r=gtk_dialog_run(GTK_DIALOG(dialog));
          if(r>A_BEGIN && r<A_END)
          {
            on_action((gui_act)r);
          }
          else break;
        };
        gtk_unregister_dialog (dialog);
        gtk_widget_destroy(dialog);
        dialog=NULL;
        
    return 1;
    
}
コード例 #14
0
void wxTopLevelWindowGTK::GTKHandleRealized()
{
    wxNonOwnedWindow::GTKHandleRealized();

    gdk_window_set_decorations(gtk_widget_get_window(m_widget),
                               (GdkWMDecoration)m_gdkDecor);
    gdk_window_set_functions(gtk_widget_get_window(m_widget),
                               (GdkWMFunction)m_gdkFunc);

    // GTK's shrinking/growing policy
    if ( !(m_gdkFunc & GDK_FUNC_RESIZE) )
        gtk_window_set_resizable(GTK_WINDOW(m_widget), FALSE);
#if !GTK_CHECK_VERSION(3,0,0) && !defined(GTK_DISABLE_DEPRECATED)
    else
        gtk_window_set_policy(GTK_WINDOW(m_widget), 1, 1, 1);
#endif

    const wxIconBundle& icons = GetIcons();
    if (icons.GetIconCount())
        SetIcons(icons);
}
コード例 #15
0
ファイル: rbgdkwindow.c プロジェクト: geoffyoungs/ruby-gnome2
static VALUE
gdkwin_set_decorations(VALUE self, VALUE decor)
{
    gdk_window_set_decorations(_SELF(self), RVAL2GFLAGS(decor, GDK_TYPE_WM_DECORATION));
    return self;
}
コード例 #16
0
ファイル: subsongseek.c プロジェクト: Kinglions/modizer
void uade_gui_seek_subsong(int to)
{
    GtkWidget *seek_button_box;
    GtkWidget *prev_next_button_box;
    GtkWidget *seek_button_vbox;
    GtkWidget *seek_slider_box;
    GtkWidget *hscale;

    GtkWidget *prev_button;
    GtkWidget *prev_button_frame;
    GtkWidget *frame;
    GtkWidget *maxsong_label;
    GtkWidget *next_button,*ffwd_button;
    GtkWidget *ffwd_button_frame;

    if (!uade_thread_running) {
	fprintf(stderr, "uade: BUG! Seek not possible.\n");
	return;
    }

    if (seekpopup == NULL) {
	/* uade's subsong popup */
	seekpopup = gtk_window_new(GTK_WINDOW_DIALOG);
	gtk_window_set_title(GTK_WINDOW(seekpopup), "UADE seek subsong");
	gtk_window_set_position(GTK_WINDOW(seekpopup), GTK_WIN_POS_MOUSE);
	gtk_container_set_border_width(GTK_CONTAINER(seekpopup), 0);

	gtk_window_set_policy(GTK_WINDOW(seekpopup), FALSE, FALSE, FALSE);

	gtk_signal_connect(GTK_OBJECT(seekpopup), "destroy",
			   GTK_SIGNAL_FUNC(gtk_widget_destroyed),
			   &seekpopup);

	gtk_signal_connect(GTK_OBJECT(seekpopup), "focus_out_event",
			   GTK_SIGNAL_FUNC(focus_out_event), NULL);

	gtk_widget_realize(seekpopup);
	gdk_window_set_decorations(seekpopup->window, 0);

        /* define Slider code, will be used by all styles of the popup */

	if (uade_get_max_subsong(-1) >= 0) {

	    subsong_adj =
		gtk_adjustment_new(uade_get_cur_subsong(0), uade_get_min_subsong(0),
				   uade_get_max_subsong(0), 1, 0, 0);	/*our scale for the subsong slider */
	    maxsong_label =
		gtk_label_new(g_strdup_printf("%d", uade_get_max_subsong(0))); /* until we can't get the reliable maximum number of subsongs this has to do :-) */
	    gtk_widget_set_usize(maxsong_label, 24, -1);

	} else {
	    subsong_adj =
		gtk_adjustment_new(uade_get_cur_subsong(0), uade_get_min_subsong(0),
				   (uade_get_max_subsong(0)) + 10, 1, 0, 0);	/*our scale for the subsong slider */
	    /*currently: min - min+10  */
	    maxsong_label = gtk_label_new("..."); /* until we can't get the reliable maximum number of subsongs this has to do :-) */
	    gtk_widget_set_usize(maxsong_label, 24, -1);
	}

	hscale = gtk_hscale_new(GTK_ADJUSTMENT(subsong_adj));
	gtk_widget_set_usize(hscale, 160, -1);
	gtk_scale_set_digits(GTK_SCALE(hscale), 0);
	gtk_scale_set_value_pos(GTK_SCALE(hscale), GTK_POS_LEFT);
	gtk_scale_set_draw_value(GTK_SCALE(hscale), TRUE);
	gtk_range_set_update_policy(GTK_RANGE(hscale),
				    GTK_UPDATE_DISCONTINUOUS);
	gtk_signal_connect_object(GTK_OBJECT(subsong_adj), "value_changed",
				  GTK_SIGNAL_FUNC(uade_seek_directly),
				  NULL);


        /* previous subsong button, will be used by all styles of the seek popup*/
	prev_button = gtk_button_new_with_label("<");
	gtk_widget_set_usize(prev_button, 27, -1);
	gtk_signal_connect_object(GTK_OBJECT(prev_button), "clicked",
				  GTK_SIGNAL_FUNC(uade_seek_previous),
				  NULL);

	prev_button_frame = gtk_frame_new(NULL);
	gtk_frame_set_shadow_type(GTK_FRAME(prev_button_frame),
				  GTK_SHADOW_IN);


        /* next subsong button, will be used by all styles of the seek popup*/
	next_button = gtk_button_new_with_label(">");
	gtk_widget_set_usize(next_button, 27, -1);
	gtk_signal_connect_object(GTK_OBJECT(next_button), "clicked",
				  GTK_SIGNAL_FUNC(uade_seek_next), NULL);

	ffwd_button_frame = gtk_frame_new(NULL);
	gtk_frame_set_shadow_type(GTK_FRAME(ffwd_button_frame),
				  GTK_SHADOW_IN);

	ffwd_button = gtk_button_new_with_label("10s fwd");
	gtk_widget_set_usize(ffwd_button, 27, -1);
	gtk_signal_connect_object(GTK_OBJECT(ffwd_button), "clicked",
				  GTK_SIGNAL_FUNC(uade_ffwd), NULL);

	/* with the alternative styles of the subsongseeker,
	 * following suggestions made by David Le Corfec*/
	seek_button_box = gtk_hbox_new(FALSE, 0);
	gtk_container_add(GTK_CONTAINER(seekpopup), seek_button_box);

	frame = gtk_frame_new(NULL);
	gtk_box_pack_start_defaults(GTK_BOX(seek_button_box), frame);
	gtk_frame_set_shadow_type(GTK_FRAME(frame), GTK_SHADOW_OUT);


	seek_button_vbox = gtk_vbox_new(FALSE, 0);
	gtk_container_add(GTK_CONTAINER(frame), seek_button_vbox);
	gtk_signal_connect(GTK_OBJECT(seek_button_vbox), "focus_out_event",
			   GTK_SIGNAL_FUNC(focus_out_event), NULL);

	prev_next_button_box = gtk_hbox_new(FALSE, 0);

	/* use the previous defined buttons here */

	gtk_box_pack_start_defaults(GTK_BOX(seek_button_vbox),
			   prev_button_frame);

	gtk_container_add(GTK_CONTAINER(prev_button_frame),
			   prev_next_button_box);

	gtk_box_pack_start_defaults(GTK_BOX(prev_next_button_box),
			   prev_button);
	gtk_box_pack_start_defaults(GTK_BOX(prev_next_button_box),
			   next_button);



	seek_slider_box = gtk_hbox_new(FALSE, 0);
	gtk_box_pack_start(GTK_BOX(seek_button_vbox), seek_slider_box,
			   FALSE, FALSE, 0);

	/* use the previous defined slider and label here */
	gtk_box_pack_start(GTK_BOX(seek_slider_box), hscale, FALSE, FALSE,
			   0);
	gtk_box_pack_start(GTK_BOX(seek_slider_box), maxsong_label, FALSE,
			   FALSE, 0);

	/* use the previous defined buttons here */
	gtk_box_pack_start_defaults(GTK_BOX(seek_button_vbox),
			   ffwd_button_frame);
	gtk_container_add(GTK_CONTAINER(ffwd_button_frame), 		 
			   ffwd_button);

	gtk_widget_show_all(seekpopup);
	seekpopup_open = 1;

    } else {
	gdk_window_raise(seekpopup->window);
    }
}
コード例 #17
0
ファイル: lnxmplayer.cpp プロジェクト: alilloyd/livecode
bool MPlayer::init(const char * p_filename, MCStack *p_stack, MCRectangle p_rect )
{
	
	// Are we already running a movie? If we are, then stop.
	if ( m_window != DNULL && m_filename != NULL )
		quit();
	
	GdkWindow* w ;
	if ( p_stack == NULL )
		return false ;
	
	// Locate the window for the stack
	GdkWindow* stack_window = p_stack->getwindow();
	if ( stack_window == DNULL)
		return false ;
	
    GdkWindowAttr t_wa;
    t_wa.colormap = ((MCScreenDC*)MCscreen)->getcmapnative();
    t_wa.x = p_rect.x;
    t_wa.y = p_rect.y;
    t_wa.width = p_rect.width;
    t_wa.height = p_rect.height;
    t_wa.event_mask = 0;
    t_wa.wclass = GDK_INPUT_OUTPUT;
    t_wa.visual = ((MCScreenDC*)MCscreen)->getvisual();
    t_wa.window_type = GDK_WINDOW_CHILD;
    
    w = gdk_window_new(stack_window, &t_wa, GDK_WA_X|GDK_WA_Y|GDK_WA_VISUAL);
	
	if ( w == DNULL )
		return False;
	
	// Set-up our hints so that we have NO window decorations.
    gdk_window_set_decorations(w, GdkWMDecoration(0));
	
	// Ensure the newly created window stays above the stack window & map ( show )
    gdk_window_set_transient_for(w, stack_window);
    gdk_window_show_unraised(w);
	
	m_window = w ;
	MClastvideowindow = w ;
	
	if ( m_filename == NULL ) 
		m_filename = strdup(p_filename) ;
	m_player_rect = p_rect ;
	m_stack = p_stack ;

	if ( !launch_player() )
	{
		gdk_window_hide(m_window);
        gdk_window_destroy(m_window);
		m_window = DNULL;
		MClastvideowindow = DNULL ;
		return false;
	}

	// We will be playing at start by default, so mark it as such
	m_playing = true ;
	// Start the media stopped
	pause();

	return true ;
}
コード例 #18
0
void
panel_start_gui(panel *p)
{
    ENTER;
    //gtk_rc_parse_string(transparent_rc);
    p->topgwin      = gtk_window_new(GTK_WINDOW_TOPLEVEL);

    gtk_container_set_border_width(GTK_CONTAINER(p->topgwin), 0);
    gtk_window_set_resizable(GTK_WINDOW(p->topgwin), FALSE);
    gtk_window_set_wmclass(GTK_WINDOW(p->topgwin), "panel", "trayer");
    gtk_window_set_title(GTK_WINDOW(p->topgwin), "panel");
    gtk_window_set_position(GTK_WINDOW(p->topgwin), GTK_WIN_POS_CENTER);
    g_signal_connect ( G_OBJECT(p->topgwin) , "delete-event" , G_CALLBACK(panel_delete_event) , p);
    g_signal_connect ( G_OBJECT(p->topgwin) , "destroy-event", G_CALLBACK(panel_destroy_event), p);
    g_signal_connect ( G_OBJECT (p->topgwin), "size-request" , G_CALLBACK(panel_size_req)  , p);
    g_signal_connect ( G_OBJECT (p->topgwin), "size-allocate", G_CALLBACK(panel_size_alloc), p);

    if (p->transparent) {
      g_signal_connect (G_OBJECT (p->topgwin), "configure-event", G_CALLBACK(panel_configure_event), p);
      g_signal_connect (G_OBJECT (p->topgwin), "style-set", G_CALLBACK( panel_style_set), p);
    }

    if (p->on_primary) {
        GdkDisplay *display = gdk_display_get_default ();
        GdkScreen *screen = gdk_display_get_screen(display, 0);
        g_signal_connect ( screen, "monitors-changed", G_CALLBACK(panel_monitors_changed), (gpointer)p );
        p->monitor = gdk_screen_get_primary_monitor(screen);

    }
    gtk_widget_realize(p->topgwin);
    gdk_window_set_decorations(p->topgwin->window, 0);
    gtk_widget_set_app_paintable(p->topgwin, TRUE);

    p->lbox = p->my_box_new(FALSE, 0);
    gtk_container_set_border_width(GTK_CONTAINER(p->lbox), 0);
    gtk_container_add(GTK_CONTAINER(p->topgwin), p->lbox);
    gtk_widget_show(p->lbox);

    if (p->allign == ALLIGN_RIGHT) {
        GtkWidget * expander = p->my_box_new(FALSE, 0);
        gtk_box_pack_start(GTK_BOX(p->lbox), expander, TRUE, TRUE, 0);
        gtk_widget_show(expander);
    }

    p->box = p->my_box_new(FALSE, 1);
    gtk_container_set_border_width(GTK_CONTAINER(p->box), 1);
    gtk_box_pack_start(GTK_BOX(p->lbox), p->box, FALSE, TRUE, padding);
    gtk_widget_show(p->box);

    // get properties on topgwin
    p->topGdkWindow = gtk_widget_get_window(p->topgwin);
    p->topxwin = GDK_WINDOW_XWINDOW(GTK_WIDGET(p->topgwin)->window);

    bg_init(gdk_helper_display());

    /* make our window unfocusable */
    gdk_window_set_accept_focus(p->topGdkWindow,False);

    if (p->setdocktype) {
        gdk_window_set_type_hint(p->topGdkWindow,GDK_WINDOW_TYPE_HINT_DOCK);
    }

    Xclimsg(p->topxwin, a_NET_WM_DESKTOP, 0xFFFFFFFF, 0, 0, 0, 0);

    /************************/
    /* Window Mapping Point */
    gtk_widget_show_all(p->topgwin);
    Xclimsg(p->topxwin, a_NET_WM_DESKTOP, 0xFFFFFFFF, 0, 0, 0, 0);

    gdk_window_stick                 ( p->topGdkWindow);
    gdk_window_set_skip_pager_hint   ( p->topGdkWindow, True );
    gdk_window_set_skip_taskbar_hint ( p->topGdkWindow, True );

    XSelectInput (gdk_helper_display(), GDK_ROOT_WINDOW(), PropertyChangeMask);
    XSelectInput (gdk_helper_display(), p->topxwin, PropertyChangeMask | FocusChangeMask | StructureNotifyMask);
    gdk_window_add_filter(gdk_get_default_root_window (), (GdkFilterFunc)panel_wm_events, p);

    calculate_position(p, distance,distancefrom);
    gdk_window_move_resize(p->topgwin->window, p->ax, p->ay, p->aw, p->ah);
    if (p->setstrut)
        panel_set_wm_strut(p);
    if (p->lower)
        XLowerWindow(gdk_helper_display(), p->topxwin);

    RET();
}
コード例 #19
0
ファイル: toplevel.cpp プロジェクト: EdgarTx/wx
bool wxTopLevelWindowGTK::ShowFullScreen(bool show, long style )
{
    if (show == m_fsIsShowing)
        return false; // return what?

    if (show)
    {
        // Preserve menubar accelerators during full-screen operation
        wxFrame* frame = wxDynamicCast(this, wxFrame);
        if (frame)
        {
            if (frame->GetMenuBar())
            {
                wxAcceleratorTable table(wxCreateAcceleratorTableForMenuBar(frame->GetMenuBar()));
                if (table.IsOk())
                    SetAcceleratorTable(table);
            }
#if wxUSE_TOOLBAR
            if (frame->GetToolBar() && frame->GetToolBar()->IsShown())
            {
                frame->GetToolBar()->Show(false);
            }
#endif
        }
    }
#if wxUSE_TOOLBAR
    else
    {
        // FIXME: we need to remember whether the toolbar was previously hidden
        wxFrame* frame = wxDynamicCast(this, wxFrame);
        if (frame && frame->GetToolBar())
        {
            frame->GetToolBar()->Show(true);
        }
    }
#endif

    m_fsIsShowing = show;

    wxX11FullScreenMethod method =
        wxGetFullScreenMethodX11((WXDisplay*)GDK_DISPLAY(),
                                 (WXWindow)GDK_ROOT_WINDOW());

#if GTK_CHECK_VERSION(2,2,0)
    // NB: gtk_window_fullscreen() uses freedesktop.org's WMspec extensions
    //     to switch to fullscreen, which is not always available. We must
    //     check if WM supports the spec and use legacy methods if it
    //     doesn't.
    if ( (method == wxX11_FS_WMSPEC) && !gtk_check_version(2,2,0) )
    {
        if (show)
        {
            m_fsSaveFlag = style;
            gtk_window_fullscreen( GTK_WINDOW( m_widget ) );
        }
        else
        {
            m_fsSaveFlag = 0;
            gtk_window_unfullscreen( GTK_WINDOW( m_widget ) );
        }
    }
    else
#endif // GTK+ >= 2.2.0
    {
        GdkWindow *window = m_widget->window;

        if (show)
        {
            m_fsSaveFlag = style;
            GetPosition( &m_fsSaveFrame.x, &m_fsSaveFrame.y );
            GetSize( &m_fsSaveFrame.width, &m_fsSaveFrame.height );

            int screen_width,screen_height;
            wxDisplaySize( &screen_width, &screen_height );

            gint client_x, client_y, root_x, root_y;
            gint width, height;

            if (method != wxX11_FS_WMSPEC)
            {
                // don't do it always, Metacity hates it
                m_fsSaveGdkFunc = m_gdkFunc;
                m_fsSaveGdkDecor = m_gdkDecor;
                m_gdkFunc = m_gdkDecor = 0;
                gdk_window_set_decorations(window, (GdkWMDecoration)0);
                gdk_window_set_functions(window, (GdkWMFunction)0);
            }

            gdk_window_get_origin (m_widget->window, &root_x, &root_y);
            gdk_window_get_geometry (m_widget->window, &client_x, &client_y,
                                     &width, &height, NULL);

            gdk_window_move_resize (m_widget->window, -client_x, -client_y,
                                    screen_width + 1, screen_height + 1);

            wxSetFullScreenStateX11((WXDisplay*)GDK_DISPLAY(),
                                    (WXWindow)GDK_ROOT_WINDOW(),
                                    (WXWindow)GDK_WINDOW_XWINDOW(window),
                                    show, &m_fsSaveFrame, method);
        }
        else // hide
        {
            m_fsSaveFlag = 0;
            if (method != wxX11_FS_WMSPEC)
            {
                // don't do it always, Metacity hates it
                m_gdkFunc = m_fsSaveGdkFunc;
                m_gdkDecor = m_fsSaveGdkDecor;
                gdk_window_set_decorations(window, (GdkWMDecoration)m_gdkDecor);
                gdk_window_set_functions(window, (GdkWMFunction)m_gdkFunc);
            }

            wxSetFullScreenStateX11((WXDisplay*)GDK_DISPLAY(),
                                    (WXWindow)GDK_ROOT_WINDOW(),
                                    (WXWindow)GDK_WINDOW_XWINDOW(window),
                                    show, &m_fsSaveFrame, method);

            SetSize(m_fsSaveFrame.x, m_fsSaveFrame.y,
                    m_fsSaveFrame.width, m_fsSaveFrame.height);
        }
    }

    // documented behaviour is to show the window if it's still hidden when
    // showing it full screen
    if ( show && !IsShown() )
        Show();

    return true;
}
コード例 #20
0
ファイル: juno_gui.C プロジェクト: kmtaylor/juno6
void initGui( JunoControl* _junoControl, 
	      Settings* _settings, 
	      MidiInput* _midiInput, 
	      int numVoices)
{
    junoControl = _junoControl;
    settings    = _settings;
    midiInput   = _midiInput;

    keyboard = new JunoKeyboard(numVoices);
    
    mainMenu = gtk_item_factory_new(GTK_TYPE_MENU, "<Main>", NULL);
    gtk_item_factory_create_items(mainMenu, mainwin_general_menu_entry_count,
				  mainwin_general_menu_entries, NULL);
    GtkStyle* menuStyle = gtk_style_new(); // a default style
    gtk_widget_set_style( mainMenu->widget, menuStyle );

    GtkWidget* mainContainer;

    mainWindow = gtk_window_new( GTK_WINDOW_TOPLEVEL );

    gtk_widget_add_events( GTK_WIDGET( mainWindow ), 
			   GDK_BUTTON_RELEASE_MASK |
			   GDK_POINTER_MOTION_MASK | 
			   GDK_POINTER_MOTION_HINT_MASK |
			   GDK_ENTER_NOTIFY_MASK | 
			   GDK_LEAVE_NOTIFY_MASK | 
			   GDK_KEY_PRESS_MASK | 
			   GDK_KEY_RELEASE_MASK	);

    gtk_window_set_default_size( GTK_WINDOW( mainWindow ), 940, 224 );
    gtk_window_set_policy(GTK_WINDOW(mainWindow), FALSE, FALSE, TRUE);

    gtk_widget_realize( mainWindow );
    gdk_window_set_decorations( mainWindow->window, (GdkWMDecoration)0 );
    gtk_widget_set_app_paintable(mainWindow, TRUE);

    gtk_signal_connect(GTK_OBJECT(mainWindow), "button_press_event", 
		       GTK_SIGNAL_FUNC(mainWindow_press), NULL);
    gtk_signal_connect(GTK_OBJECT(mainWindow), "button_release_event", 
		       GTK_SIGNAL_FUNC(mainWindow_release), NULL);
    gtk_signal_connect(GTK_OBJECT(mainWindow), "motion_notify_event", 
		       GTK_SIGNAL_FUNC(mainWindow_motion), NULL);
    gtk_signal_connect(GTK_OBJECT(mainWindow), "enter_notify_event",
		       GTK_SIGNAL_FUNC(mainWindow_enter), NULL);
    gtk_signal_connect(GTK_OBJECT(mainWindow), "leave_notify_event",
		       GTK_SIGNAL_FUNC(mainWindow_leave), NULL);

    mainContainer = gtk_fixed_new();

    gtk_widget_show( mainWindow );
    gtk_widget_show( mainContainer );

    GdkPixmap* image = gdk_pixmap_create_from_xpm_d( mainWindow->window, 
						     NULL, 
						     NULL, 
						     juno_background_data );
    GtkWidget* pixmap = gtk_pixmap_new( image, NULL );
    gtk_widget_show( pixmap );
    gtk_fixed_put( GTK_FIXED( mainContainer ), pixmap, 0, 0 );

    gtk_container_add( GTK_CONTAINER( mainWindow ), mainContainer );

    init();
    layout( GTK_FIXED( mainContainer ) );

    GdkBitmap* mask = gdk_bitmap_create_from_data( mainWindow->window, 
						   juno_background_mask_bits,
						   juno_background_mask_width,
						   juno_background_mask_height );

    gtk_widget_shape_combine_mask( mainWindow, mask, 0, 0 );
}
コード例 #21
0
ファイル: webbrowser.cpp プロジェクト: vseryakov/lmbox
int WebBrowserObject::BrowserOpen(void)
{
    Lock();
    if (!area.w) {
        area.w = systemObject->configGetInt("video_width", systemObject->GetScreenWidth());
    }
    if (!area.h) {
        area.h = systemObject->configGetInt("video_height", systemObject->GetScreenHeight());
    }
    if (!toplevel) {
        toplevel = gtk_window_new(GTK_WINDOW_TOPLEVEL);
        gtk_widget_realize(toplevel);
        gdk_window_set_decorations(toplevel->window, (GdkWMDecoration)0);
        toplevelVBox = gtk_vbox_new(FALSE, 0);
        gtk_container_add(GTK_CONTAINER(toplevel), toplevelVBox);

        mozilla = gtk_moz_embed_new();
        gtk_moz_embed_set_chrome_mask(GTK_MOZ_EMBED(mozilla), GTK_MOZ_EMBED_FLAG_ALLCHROME);

        toolbarHBox = gtk_hbox_new(FALSE, 0);
        gtk_box_pack_start(GTK_BOX(toplevelVBox), toolbarHBox, FALSE, FALSE, 0);
        toolbar = gtk_toolbar_new();
        g_object_ref(toolbar);
        gtk_toolbar_set_orientation(GTK_TOOLBAR(toolbar), GTK_ORIENTATION_HORIZONTAL);
        gtk_toolbar_set_style(GTK_TOOLBAR(toolbar), GTK_TOOLBAR_BOTH);
        if (toolbar_flag) {
            gtk_box_pack_start(GTK_BOX(toolbarHBox), toolbar, FALSE, FALSE, 0);
        }
        backButton = gtk_toolbar_append_item(GTK_TOOLBAR(toolbar), "Back", "Go Back", "Go Back", 0, GTK_SIGNAL_FUNC(back_clicked_cb), this);
        stopButton = gtk_toolbar_append_item(GTK_TOOLBAR(toolbar), "Stop", "Stop", "Stop", 0, GTK_SIGNAL_FUNC(stop_clicked_cb), this);
        forwardButton = gtk_toolbar_append_item(GTK_TOOLBAR(toolbar), "Forward", "Forward", "Forward", 0, GTK_SIGNAL_FUNC(forward_clicked_cb), this);
        reloadButton = gtk_toolbar_append_item(GTK_TOOLBAR(toolbar), "Reload", "Reload", "Reload", 0, GTK_SIGNAL_FUNC(reload_clicked_cb), this);
        closeButton = gtk_toolbar_append_item(GTK_TOOLBAR(toolbar), "Close", "Close window", "Close window", 0, GTK_SIGNAL_FUNC(close_clicked_cb), this);
        urlEntry = gtk_entry_new();
        g_object_ref(urlEntry);
        if (toolbar_flag) {
            gtk_box_pack_start(GTK_BOX(toolbarHBox), urlEntry, TRUE, TRUE, 0);
        }
        gtk_box_pack_start(GTK_BOX(toplevelVBox), mozilla, TRUE, TRUE, 0);
        progressAreaHBox = gtk_hbox_new(FALSE, 0);
        gtk_box_pack_start(GTK_BOX(toplevelVBox), progressAreaHBox, FALSE, FALSE, 0);
        progressBar = gtk_progress_bar_new();
        gtk_box_pack_start(GTK_BOX(progressAreaHBox), progressBar, FALSE, FALSE, 0);
        statusAlign = gtk_alignment_new(0, 0, 1, 1);
        gtk_widget_set_usize(statusAlign, 1, -1);
        statusBar = gtk_statusbar_new();
        gtk_statusbar_set_has_resize_grip(GTK_STATUSBAR(statusBar), 0);
        gtk_container_add(GTK_CONTAINER(statusAlign), statusBar);
        gtk_box_pack_start(GTK_BOX(progressAreaHBox), statusAlign, TRUE, TRUE, 0);

        gtk_widget_set_sensitive(closeButton, TRUE);
        gtk_widget_set_sensitive(backButton, FALSE);
        gtk_widget_set_sensitive(stopButton, FALSE);
        gtk_widget_set_sensitive(forwardButton, FALSE);
        gtk_widget_set_sensitive(reloadButton, FALSE);

        gtk_signal_connect(GTK_OBJECT(urlEntry), "activate", GTK_SIGNAL_FUNC(url_activate_cb), this);
        
        gtk_signal_connect(GTK_OBJECT(toplevel), "delete_event", GTK_SIGNAL_FUNC(delete_cb), this);
        gtk_signal_connect(GTK_OBJECT(mozilla), "destroy", GTK_SIGNAL_FUNC(destroy_cb), this);
        gtk_signal_connect(GTK_OBJECT(mozilla), "destroy_browser", GTK_SIGNAL_FUNC(destroy_cb), this);
        gtk_signal_connect(GTK_OBJECT(mozilla), "title", GTK_SIGNAL_FUNC(title_changed_cb), this);
        gtk_signal_connect(GTK_OBJECT(mozilla), "new_window", GTK_SIGNAL_FUNC(new_window_cb), this);
        gtk_signal_connect(GTK_OBJECT(mozilla), "visibility", GTK_SIGNAL_FUNC(visibility_cb), this);
        gtk_signal_connect(GTK_OBJECT(mozilla), "size_to", GTK_SIGNAL_FUNC(size_to_cb), this);
        gtk_signal_connect(GTK_OBJECT(mozilla), "location", GTK_SIGNAL_FUNC(location_cb), this);
        gtk_signal_connect(GTK_OBJECT(mozilla), "net_start", GTK_SIGNAL_FUNC(net_start_cb), this);
        gtk_signal_connect(GTK_OBJECT(mozilla), "net_stop", GTK_SIGNAL_FUNC(net_stop_cb), this);
        gtk_signal_connect(GTK_OBJECT(mozilla), "net_state",  GTK_SIGNAL_FUNC(net_state_cb), this);
        gtk_signal_connect(GTK_OBJECT(mozilla), "progress", GTK_SIGNAL_FUNC(progress_cb), this);
        gtk_signal_connect(GTK_OBJECT(mozilla), "link_message", GTK_SIGNAL_FUNC(link_message_cb), this);
        gtk_signal_connect(GTK_OBJECT(mozilla), "js_status", GTK_SIGNAL_FUNC(js_status_cb), this);
        gtk_signal_connect(GTK_OBJECT(mozilla), "open_uri", GTK_SIGNAL_FUNC(open_uri_cb), this);
        gtk_signal_connect(GTK_OBJECT(mozilla), "dom_key_down", GTK_SIGNAL_FUNC(dom_key_down_cb), this);
        gtk_signal_connect(GTK_OBJECT(mozilla), "dom_key_up", GTK_SIGNAL_FUNC(dom_key_up_cb), this);
        gtk_signal_connect(GTK_OBJECT(mozilla), "dom_mouse_down", GTK_SIGNAL_FUNC(dom_mouse_down_cb), this);
        gtk_signal_connect(GTK_OBJECT(mozilla), "dom_mouse_up", GTK_SIGNAL_FUNC(dom_mouse_up_cb), this);
        gtk_signal_connect(GTK_OBJECT(mozilla), "dom_key_press", GTK_SIGNAL_FUNC(dom_key_press_cb), this);
        gtk_signal_connect(GTK_OBJECT(mozilla), "dom_mouse_click", GTK_SIGNAL_FUNC(dom_mouse_click_cb), this);
        gtk_signal_connect(GTK_OBJECT(mozilla), "dom_mouse_dbl_click", GTK_SIGNAL_FUNC(dom_mouse_dbl_click_cb), this);
        gtk_signal_connect(GTK_OBJECT(mozilla), "dom_mouse_over", GTK_SIGNAL_FUNC(dom_mouse_over_cb), this);
        gtk_signal_connect(GTK_OBJECT(mozilla), "dom_mouse_out", GTK_SIGNAL_FUNC(dom_mouse_out_cb), this);
    }
    Unlock();
    SetPosition(area.x, area.y, area.w, area.h);
    SetVisible(1);
    if (location) {
        gtk_moz_embed_load_url(GTK_MOZ_EMBED(mozilla), location);
    }
    systemObject->RegisterExternalEventHandler(this);
    return 0;
}
コード例 #22
0
ファイル: window.cpp プロジェクト: xonotic/netradient
gint window_realize_remove_sysmenu( ui::Widget widget, gpointer data ){
	gdk_window_set_decorations( gtk_widget_get_window(widget), (GdkWMDecoration)( GDK_DECOR_ALL | GDK_DECOR_MENU ) );
	return FALSE;
}
コード例 #23
0
ファイル: window.cpp プロジェクト: xonotic/netradient
gint window_realize_remove_minmax( ui::Widget widget, gpointer data ){
	gdk_window_set_decorations( gtk_widget_get_window(widget), (GdkWMDecoration)( GDK_DECOR_ALL | GDK_DECOR_MINIMIZE | GDK_DECOR_MAXIMIZE ) );
	return FALSE;
}
コード例 #24
0
ファイル: toplevel.cpp プロジェクト: CobaltBlues/wxWidgets
bool wxTopLevelWindowGTK::ShowFullScreen(bool show, long)
{
    if (show == m_fsIsShowing)
        return false; // return what?

    m_fsIsShowing = show;

#ifdef GDK_WINDOWING_X11
    Display* xdpy = GDK_DISPLAY_XDISPLAY(gtk_widget_get_display(m_widget));
    Window xroot = GDK_WINDOW_XID(gtk_widget_get_root_window(m_widget));
    wxX11FullScreenMethod method = wxGetFullScreenMethodX11(xdpy, (WXWindow)xroot);

    // NB: gtk_window_fullscreen() uses freedesktop.org's WMspec extensions
    //     to switch to fullscreen, which is not always available. We must
    //     check if WM supports the spec and use legacy methods if it
    //     doesn't.
    if ( method == wxX11_FS_WMSPEC )
#endif // GDK_WINDOWING_X11
    {
        if (show)
            gtk_window_fullscreen( GTK_WINDOW( m_widget ) );
        else
            gtk_window_unfullscreen( GTK_WINDOW( m_widget ) );
    }
#ifdef GDK_WINDOWING_X11
    else
    {
        GdkWindow* window = gtk_widget_get_window(m_widget);
        Window xid = GDK_WINDOW_XID(window);

        if (show)
        {
            GetPosition( &m_fsSaveFrame.x, &m_fsSaveFrame.y );
            GetSize( &m_fsSaveFrame.width, &m_fsSaveFrame.height );

            GdkScreen* screen = gtk_widget_get_screen(m_widget);
            const int screen_width = gdk_screen_get_width(screen);
            const int screen_height = gdk_screen_get_height(screen);

            gint client_x, client_y, root_x, root_y;
            gint width, height;

            m_fsSaveGdkFunc = m_gdkFunc;
            m_fsSaveGdkDecor = m_gdkDecor;
            m_gdkFunc = m_gdkDecor = 0;
            gdk_window_set_decorations(window, (GdkWMDecoration)0);
            gdk_window_set_functions(window, (GdkWMFunction)0);

            gdk_window_get_origin(window, &root_x, &root_y);
            gdk_window_get_geometry(window, &client_x, &client_y, &width, &height);

            gdk_window_move_resize(
                window, -client_x, -client_y, screen_width + 1, screen_height + 1);

            wxSetFullScreenStateX11(xdpy,
                                    (WXWindow)xroot,
                                    (WXWindow)xid,
                                    show, &m_fsSaveFrame, method);
        }
        else // hide
        {
            m_gdkFunc = m_fsSaveGdkFunc;
            m_gdkDecor = m_fsSaveGdkDecor;
            gdk_window_set_decorations(window, (GdkWMDecoration)m_gdkDecor);
            gdk_window_set_functions(window, (GdkWMFunction)m_gdkFunc);

            wxSetFullScreenStateX11(xdpy,
                                    (WXWindow)xroot,
                                    (WXWindow)xid,
                                    show, &m_fsSaveFrame, method);

            SetSize(m_fsSaveFrame.x, m_fsSaveFrame.y,
                    m_fsSaveFrame.width, m_fsSaveFrame.height);
        }
    }
#endif // GDK_WINDOWING_X11

    // documented behaviour is to show the window if it's still hidden when
    // showing it full screen
    if (show)
        Show();

    return true;
}
コード例 #25
0
ファイル: ev774.c プロジェクト: yehongbing/Eiffel-Projects
/* {EV_WINDOW_IMP}.make */
void F1123_15409 (EIF_REFERENCE Current)
{
	GTCX
	EIF_REFERENCE loc1 = (EIF_REFERENCE) 0;
	EIF_REFERENCE loc2 = (EIF_REFERENCE) 0;
	EIF_POINTER loc3 = (EIF_POINTER) 0;
	EIF_POINTER tp1;
	EIF_REFERENCE tr1 = NULL;
	EIF_REFERENCE tr2 = NULL;
	EIF_REFERENCE tr3 = NULL;
	EIF_REFERENCE tr4 = NULL;
	EIF_REFERENCE tr5 = NULL;
	EIF_REFERENCE tr6 = NULL;
	EIF_INTEGER_32 ti4_1;
	RTCFDT;
	RTCDT;
	RTLD;
	
	RTLI(9);
	RTLR(0,Current);
	RTLR(1,loc1);
	RTLR(2,tr1);
	RTLR(3,loc2);
	RTLR(4,tr2);
	RTLR(5,tr3);
	RTLR(6,tr4);
	RTLR(7,tr5);
	RTLR(8,tr6);
	
	RTGC;
	F1029_13080(Current, (EIF_BOOLEAN) 0);
	loc1 = RTOSCF(14148,F1079_14148,(Current));
	tp1 = (FUNCTION_CAST(EIF_POINTER, (EIF_REFERENCE)) R11929[dtype-1122])(Current);
	F1079_14134(Current, tp1);
	loc3 = *(EIF_POINTER *)(Current + O10979[dtype-1078]);
	{
		static EIF_TYPE_INDEX typarr0[] = {692,934,874,0xFFFF};
		EIF_TYPE_INDEX typres0;
		static EIF_TYPE_INDEX typcache0 = INVALID_DTYPE;
		
		typres0 = (typcache0 != INVALID_DTYPE ? typcache0 : (typcache0 = eif_compound_id(dftype, typarr0)));
		tr1 = RTLNSMART(eif_non_attached_type(typres0));
	}
	F693_6432(RTCV(tr1), ((EIF_INTEGER_32) 10L));
	RTAR(Current, tr1);
	*(EIF_REFERENCE *)(Current + O11864[dtype-1114]) = (EIF_REFERENCE) tr1;
	tr1 = RTLNSMART(eif_non_attached_type(973));
	F930_10736(RTCV(tr1));
	RTAR(Current, tr1);
	*(EIF_REFERENCE *)(Current + O11836[dtype-1114]) = (EIF_REFERENCE) tr1;
	tr1 = RTLNSMART(eif_non_attached_type(973));
	F930_10736(RTCV(tr1));
	RTAR(Current, tr1);
	*(EIF_REFERENCE *)(Current + O11837[dtype-1114]) = (EIF_REFERENCE) tr1;
	*(EIF_INTEGER_32 *)(Current + O11960[dtype-1122]) = (EIF_INTEGER_32) ((EIF_INTEGER_32) 32000L);
	*(EIF_INTEGER_32 *)(Current + O11959[dtype-1122]) = (EIF_INTEGER_32) ((EIF_INTEGER_32) 32000L);
	loc2 = *(EIF_REFERENCE *)(RTCV(loc1) + _REFACS_42_);
	F1123_15444(Current);
	tr1 = RTOSCF(2442,F67_2442,(RTCV(loc1)));
	{
		static EIF_TYPE_INDEX typarr0[] = {0xFFF9,2,841,792,874,0xFFFF};
		EIF_TYPE_INDEX typres0;
		static EIF_TYPE_INDEX typcache0 = INVALID_DTYPE;
		
		typres0 = (typcache0 != INVALID_DTYPE ? typcache0 : (typcache0 = eif_compound_id(dftype, typarr0)));
		tr2 = RTLNTS(typres0, 3, 0);
	}
	((EIF_TYPED_VALUE *)tr2+1)->it_r = loc2;
	RTAR(tr2,loc2);
	ti4_1 = *(EIF_INTEGER_32 *)(Current + O6499[dtype-787]);
	((EIF_TYPED_VALUE *)tr2+2)->it_i4 = ti4_1;
	
	{
		static EIF_TYPE_INDEX typarr0[] = {915,792,0xFFF9,1,841,913,0xFFFF};
		EIF_TYPE_INDEX typres0;
		static EIF_TYPE_INDEX typcache0 = INVALID_DTYPE;
		
		typres0 = (typcache0 != INVALID_DTYPE ? typcache0 : (typcache0 = eif_compound_id(dftype, typarr0)));
		tr5 = RTLNRF(typres0, (EIF_POINTER) __A412_327_3, (EIF_POINTER) _A412_327_3, (EIF_POINTER)(F790_8076),tr2, 1, 1);
	}
	tr6 = RTOSCF(8401,F793_8401,(RTCV(loc2)));
	F793_8399(RTCV(loc2), loc3, tr1, tr5, tr6, (EIF_BOOLEAN) 1);
	gtk_window_set_default_size((GtkWindow*) loc3, (gint) ((EIF_INTEGER_32) 1L), (gint) ((EIF_INTEGER_32) 1L));
	F1119_15323(Current);
	tp1 = (EIF_POINTER) (((GtkWidget *)loc3)->window);
	ti4_1 = (FUNCTION_CAST(EIF_INTEGER_32, (EIF_REFERENCE)) R11042[dtype-1081])(Current);
	gdk_window_set_decorations((GdkWindow*) tp1, (GdkWMDecoration) ti4_1);
	*(EIF_BOOLEAN *)(Current + O11867[dtype-1114]) = (EIF_BOOLEAN) (EIF_BOOLEAN) 1;
	*(EIF_BOOLEAN *)(Current + O11041[dtype-1081]) = (EIF_BOOLEAN) (EIF_BOOLEAN) 1;
	*(EIF_BOOLEAN *)(Current + O11843[dtype-1114]) = (EIF_BOOLEAN) (EIF_BOOLEAN) 1;
	F1029_13080(Current, (EIF_BOOLEAN) 1);
	RTLE;
}
コード例 #26
0
static void
gs_theme_window_real_realize (GtkWidget *widget)
{
	GdkWindow     *window;
	Window         remote_xwindow;
	GtkRequisition requisition;
	GtkAllocation  allocation;
	const char    *preview_xid;
	int            x;
	int            y;
	int            width;
	int            height;
	int            event_mask;

	event_mask = 0;
	window = NULL;
	preview_xid = g_getenv ("XSCREENSAVER_WINDOW");

	if (preview_xid != NULL)
	{
		char *end;

		remote_xwindow = (Window) strtoul (preview_xid, &end, 0);

		if ((remote_xwindow != 0) && (end != NULL) &&
		        ((*end == ' ') || (*end == '\0')) &&
		        ((remote_xwindow < G_MAXULONG) || (errno != ERANGE)))
		{
			window = gdk_x11_window_foreign_new_for_display (gdk_display_get_default (), remote_xwindow);
			if (window != NULL)
			{
				/* This is a kludge; we need to set the same
				 * flags gs-window-x11.c does, to ensure they
				 * don't get unset by gtk_window_map() later.
				 */
				gtk_window_set_decorated (GTK_WINDOW (widget), FALSE);

				gtk_window_set_skip_taskbar_hint (GTK_WINDOW (widget), TRUE);
				gtk_window_set_skip_pager_hint (GTK_WINDOW (widget), TRUE);

				gtk_window_set_keep_above (GTK_WINDOW (widget), TRUE);

				gtk_window_fullscreen (GTK_WINDOW (widget));

				event_mask = GDK_EXPOSURE_MASK | GDK_STRUCTURE_MASK;
				gtk_widget_set_events (widget, gtk_widget_get_events (widget) | event_mask);
			}
		}
	}

	if (window == NULL)
	{
		GtkWidgetClass *parent_class;

		parent_class = GTK_WIDGET_CLASS (gs_theme_window_parent_class);

		if (parent_class->realize != NULL)
			parent_class->realize (widget);

		return;
	}

	gtk_style_context_set_background (gtk_widget_get_style_context (widget),
	                                  window);
	gdk_window_set_decorations (window, (GdkWMDecoration) 0);
	gdk_window_set_events (window, gdk_window_get_events (window) | event_mask);

	gtk_widget_set_window (widget, window);
	gdk_window_set_user_data (window, widget);
	gtk_widget_set_realized (widget, TRUE);

	gdk_window_get_geometry (window, &x, &y, &width, &height);

	if (width < MIN_SIZE || height < MIN_SIZE)
	{
		g_critical ("This window is way too small to use");
		exit (1);
	}

	gtk_widget_get_preferred_size (widget, &requisition, NULL);
	allocation.x = x;
	allocation.y = y;
	allocation.width = width;
	allocation.height = height;
	gtk_widget_size_allocate (widget, &allocation);
	gtk_window_resize (GTK_WINDOW (widget), width, height);
}
コード例 #27
0
ファイル: metacity-window-demo.c プロジェクト: GNOME/metacity
static void
set_gdk_window_border_only (GdkWindow *window)
{
  gdk_window_set_decorations (window, GDK_DECOR_BORDER);
}
コード例 #28
0
ファイル: toplevel.cpp プロジェクト: CobaltBlues/wxWidgets
bool wxTopLevelWindowGTK::ShowFullScreen(bool show, long style )
{
    if (show == m_fsIsShowing)
        return false; // return what?

    m_fsIsShowing = show;

    wxX11FullScreenMethod method =
        wxGetFullScreenMethodX11((WXDisplay*)GDK_DISPLAY(),
                                 (WXWindow)GDK_ROOT_WINDOW());

#if GTK_CHECK_VERSION(2,2,0)
    // NB: gtk_window_fullscreen() uses freedesktop.org's WMspec extensions
    //     to switch to fullscreen, which is not always available. We must
    //     check if WM supports the spec and use legacy methods if it
    //     doesn't.
    if ( (method == wxX11_FS_WMSPEC) && !gtk_check_version(2,2,0) )
    {
        if (show)
            gtk_window_fullscreen( GTK_WINDOW( m_widget ) );
        else
            gtk_window_unfullscreen( GTK_WINDOW( m_widget ) );
    }
    else
#endif // GTK+ >= 2.2.0
    {
        GdkWindow *window = m_widget->window;

        if (show)
        {
            m_fsSaveFlag = style;
            GetPosition( &m_fsSaveFrame.x, &m_fsSaveFrame.y );
            GetSize( &m_fsSaveFrame.width, &m_fsSaveFrame.height );

            int screen_width,screen_height;
            wxDisplaySize( &screen_width, &screen_height );

            gint client_x, client_y, root_x, root_y;
            gint width, height;

            if (method != wxX11_FS_WMSPEC)
            {
                // don't do it always, Metacity hates it
                m_fsSaveGdkFunc = m_gdkFunc;
                m_fsSaveGdkDecor = m_gdkDecor;
                m_gdkFunc = m_gdkDecor = 0;
                gdk_window_set_decorations(window, (GdkWMDecoration)0);
                gdk_window_set_functions(window, (GdkWMFunction)0);
            }

            gdk_window_get_origin (m_widget->window, &root_x, &root_y);
            gdk_window_get_geometry (m_widget->window, &client_x, &client_y,
                         &width, &height, NULL);

            gdk_window_move_resize (m_widget->window, -client_x, -client_y,
                        screen_width + 1, screen_height + 1);

            wxSetFullScreenStateX11((WXDisplay*)GDK_DISPLAY(),
                                    (WXWindow)GDK_ROOT_WINDOW(),
                                    (WXWindow)GDK_WINDOW_XWINDOW(window),
                                    show, &m_fsSaveFrame, method);
        }
        else // hide
        {
            if (method != wxX11_FS_WMSPEC)
            {
                // don't do it always, Metacity hates it
                m_gdkFunc = m_fsSaveGdkFunc;
                m_gdkDecor = m_fsSaveGdkDecor;
                gdk_window_set_decorations(window, (GdkWMDecoration)m_gdkDecor);
                gdk_window_set_functions(window, (GdkWMFunction)m_gdkFunc);
            }

            wxSetFullScreenStateX11((WXDisplay*)GDK_DISPLAY(),
                                    (WXWindow)GDK_ROOT_WINDOW(),
                                    (WXWindow)GDK_WINDOW_XWINDOW(window),
                                    show, &m_fsSaveFrame, method);

            SetSize(m_fsSaveFrame.x, m_fsSaveFrame.y,
                    m_fsSaveFrame.width, m_fsSaveFrame.height);
        }
    }

    // documented behaviour is to show the window if it's still hidden when
    // showing it full screen
    if ( show && !IsShown() )
        Show();

    return true;
}
コード例 #29
0
ファイル: iupgtk_dialog.c プロジェクト: LuaDist/iup
static int gtkDialogMapMethod(Ihandle* ih)
{
  int decorations = 0;
  int functions = 0;
  InativeHandle* parent;
  GtkWidget* fixed;
  int has_titlebar = 0;

#ifdef HILDON
  if (iupAttribGetBoolean(ih, "HILDONWINDOW")) 
  {
    HildonProgram *program = HILDON_PROGRAM(hildon_program_get_instance());
    ih->handle = hildon_window_new();
    if (ih->handle)
      hildon_program_add_window(program, HILDON_WINDOW(ih->handle)); 
  } 
  else 
  {
    iupAttribSetStr(ih, "DIALOGHINT", "YES");  /* otherwise not displayed correctly */ 
    ih->handle = gtk_window_new(GTK_WINDOW_TOPLEVEL);
  }
#else
  ih->handle = gtk_window_new(GTK_WINDOW_TOPLEVEL);
#endif
  if (!ih->handle)
    return IUP_ERROR;

  parent = iupDialogGetNativeParent(ih);
  if (parent)
  {
    gtk_window_set_transient_for((GtkWindow*)ih->handle, (GtkWindow*)parent);

    /* manually remove child windows when parent is destroyed */
    g_signal_connect(G_OBJECT(parent), "destroy", G_CALLBACK(gtkDialogChildDestroyEvent), ih);
  }

  g_signal_connect(G_OBJECT(ih->handle), "focus-in-event",     G_CALLBACK(iupgtkFocusInOutEvent), ih);
  g_signal_connect(G_OBJECT(ih->handle), "focus-out-event",    G_CALLBACK(iupgtkFocusInOutEvent), ih);
  g_signal_connect(G_OBJECT(ih->handle), "enter-notify-event", G_CALLBACK(iupgtkEnterLeaveEvent), ih);
  g_signal_connect(G_OBJECT(ih->handle), "leave-notify-event", G_CALLBACK(iupgtkEnterLeaveEvent), ih);
  g_signal_connect(G_OBJECT(ih->handle), "show-help",          G_CALLBACK(iupgtkShowHelp), ih);

  /* The iupgtkKeyPressEvent of the control with the focus will propagate the key up to the dialog. */
  /* Inside iupgtkKeyPressEvent we test this to avoid duplicate calls. */
  g_signal_connect(G_OBJECT(ih->handle), "key-press-event",    G_CALLBACK(iupgtkKeyPressEvent), ih);

  g_signal_connect(G_OBJECT(ih->handle), "configure-event",    G_CALLBACK(gtkDialogConfigureEvent), ih);
  g_signal_connect(G_OBJECT(ih->handle), "window-state-event", G_CALLBACK(gtkDialogWindowStateEvent), ih);
  g_signal_connect(G_OBJECT(ih->handle), "delete-event",       G_CALLBACK(iupgtkDialogDeleteEvent), ih);
                                    
  gtk_window_set_default_size((GtkWindow*)ih->handle, 100, 100); /* set this to avoid size calculation problems  */

  if (iupAttribGetBoolean(ih, "DIALOGHINT")) 
    gtk_window_set_type_hint(GTK_WINDOW(ih->handle), GDK_WINDOW_TYPE_HINT_DIALOG);

  /* the container that will receive the child element. */
  fixed = gtk_fixed_new();
  gtk_container_add((GtkContainer*)ih->handle, fixed);
  gtk_widget_show(fixed);

  /* initialize the widget */
  gtk_widget_realize(ih->handle);

  if (iupAttribGet(ih, "TITLE"))
    has_titlebar = 1;
  if (iupAttribGetBoolean(ih, "RESIZE")) 
  {
    functions   |= GDK_FUNC_RESIZE;
    decorations |= GDK_DECOR_RESIZEH;

    decorations |= GDK_DECOR_BORDER;  /* has_border */
  }
  else
    iupAttribSetStr(ih, "MAXBOX", "NO");
  if (iupAttribGetBoolean(ih, "MENUBOX")) 
  {
    functions   |= GDK_FUNC_CLOSE;
    decorations |= GDK_DECOR_MENU;
    has_titlebar = 1;
  }
  if (iupAttribGetBoolean(ih, "MAXBOX")) 
  {
    functions   |= GDK_FUNC_MAXIMIZE;
    decorations |= GDK_DECOR_MAXIMIZE;
    has_titlebar = 1;
  }
  if (iupAttribGetBoolean(ih, "MINBOX")) 
  {
    functions   |= GDK_FUNC_MINIMIZE;
    decorations |= GDK_DECOR_MINIMIZE;
    has_titlebar = 1;
  }
  if (has_titlebar)
  {
    functions   |= GDK_FUNC_MOVE;
    decorations |= GDK_DECOR_TITLE;
    gtk_window_set_title((GtkWindow*)ih->handle, "");
  }
  if (iupAttribGetBoolean(ih, "BORDER") || has_titlebar)
    decorations |= GDK_DECOR_BORDER;  /* has_border */

  if (decorations == 0)
    gtk_window_set_decorated((GtkWindow*)ih->handle, FALSE);
  else
  {
    GdkWindow* window = iupgtkGetWindow(ih->handle);
    if (window)
    {
      gdk_window_set_decorations(window, (GdkWMDecoration)decorations);
      gdk_window_set_functions(window, (GdkWMFunction)functions);
    }
  }

  /* configure for DRAG&DROP */
  if (IupGetCallback(ih, "DROPFILES_CB"))
    iupAttribSetStr(ih, "DROPFILESTARGET", "YES");

  {
    /* Reset the DLGBGCOLOR global attribute 
       if it is the first time a dialog is created. 
       The value returned by gtk_style_new is not accurate. */
    GtkStyle* style = gtk_widget_get_style(ih->handle);
    if (style && IupGetGlobal("_IUP_RESET_GLOBALCOLORS"))
    {
      iupgtkUpdateGlobalColors(style);
      IupSetGlobal("_IUP_RESET_GLOBALCOLORS", NULL);
    }
  }

  /* configure the size range */
  gtkDialogSetMinMax(ih, 1, 1, 65535, 65535);  /* MINSIZE and MAXSIZE default values */

  /* Ignore VISIBLE before mapping */
  iupAttribSetStr(ih, "VISIBLE", NULL);

  if (iupStrBoolean(IupGetGlobal("INPUTCALLBACKS")))
    gtk_widget_add_events(ih->handle, GDK_POINTER_MOTION_MASK|GDK_BUTTON_PRESS_MASK|GDK_BUTTON_RELEASE_MASK|GDK_BUTTON_MOTION_MASK);

  return IUP_NOERROR;
}
コード例 #30
0
ファイル: mainframe.cpp プロジェクト: AresAndy/ufoai
static gint window_realize_remove_decoration (GtkWidget* widget, gpointer data)
{
	gdk_window_set_decorations(widget->window, (GdkWMDecoration) (GDK_DECOR_ALL | GDK_DECOR_MENU | GDK_DECOR_MINIMIZE
			| GDK_DECOR_MAXIMIZE));
	return FALSE;
}