Пример #1
0
void
moz_drawingarea_set_visibility (MozDrawingarea *drawingarea,
                                gboolean visibility)
{
    if (visibility) {
        gdk_window_show_unraised(drawingarea->inner_window);
        gdk_window_show_unraised(drawingarea->clip_window);
    }
    else    {
        gdk_window_hide(drawingarea->clip_window);
        gdk_window_hide(drawingarea->inner_window);
    }
}
Пример #2
0
static void
map (GtkWidget* widget)
{
  GTK_WIDGET_CLASS (gtk_mvc_adaptor_parent_class)->map (widget);

  gdk_window_show_unraised (PRIV (widget)->event_window);
}
static void deepin_workspace_overview_map (GtkWidget *widget)
{
    DeepinWorkspaceOverview *self = DEEPIN_WORKSPACE_OVERVIEW (widget);
    DeepinWorkspaceOverviewPrivate *priv = self->priv;

    GTK_WIDGET_CLASS (deepin_workspace_overview_parent_class)->map (widget);

    if (priv->event_window)
        gdk_window_show_unraised(priv->event_window);
}
Пример #4
0
static void
anjuta_tabber_map (GtkWidget* widget)
{
	AnjutaTabber* tabber = ANJUTA_TABBER (widget);
	gtk_widget_set_mapped (widget, TRUE);

	gdk_window_show_unraised (tabber->priv->event_window);

	GTK_WIDGET_CLASS (anjuta_tabber_parent_class)->map (widget);
}
Пример #5
0
static void
container_map (GtkWidget* widget)
{
  GTK_WIDGET_CLASS (progress_simple_container_parent_class)->map (widget);

  if (PRIV (widget)->input_window)
    {
      gdk_window_show_unraised (PRIV (widget)->input_window);
    }
}
Пример #6
0
void
meta_ui_map_frame   (MetaUI *ui,
                     Window  xwindow)
{
  GdkWindow *window;

  window = gdk_xid_table_lookup (xwindow);

  if (window)
    gdk_window_show_unraised (window);
}
Пример #7
0
static void
display_entry (MetaTabPopup *popup,
               TabEntry     *te)
{
  if (popup->current_selected_entry)
  {
    if (popup->outline)
      meta_select_image_unselect (META_SELECT_IMAGE (popup->current_selected_entry->widget));
    else
      meta_select_workspace_unselect (META_SELECT_WORKSPACE (popup->current_selected_entry->widget));
  }

  gtk_label_set_markup (GTK_LABEL (popup->label), te->title);

  if (popup->outline)
    meta_select_image_select (META_SELECT_IMAGE (te->widget));
  else
    meta_select_workspace_select (META_SELECT_WORKSPACE (te->widget));

  if (popup->outline)
    {
      GdkRectangle rect;
      GdkWindow *window;
      cairo_region_t *region;

      window = gtk_widget_get_window (popup->outline_window);

      /* Do stuff behind gtk's back */
      gdk_window_hide (window);
      meta_core_increment_event_serial (GDK_DISPLAY_XDISPLAY (gdk_display_get_default ()));

      rect = te->rect;
      rect.x = 0;
      rect.y = 0;

      gtk_window_move (GTK_WINDOW (popup->outline_window), te->rect.x, te->rect.y);
      gtk_window_resize (GTK_WINDOW (popup->outline_window), te->rect.width, te->rect.height);

      region = cairo_region_create_rectangle (&rect);
      cairo_region_subtract_rectangle (region, &te->inner_rect);

      gdk_window_shape_combine_region (gtk_widget_get_window (popup->outline_window),
                                       region,
                                       0, 0);

      cairo_region_destroy (region);

      gdk_window_show_unraised (window);
    }

  /* Must be before we handle an expose for the outline window */
  popup->current_selected_entry = te;
}
Пример #8
0
Файл: ui.c Проект: darkxst/mtest
void
meta_ui_map_frame   (MetaUI *ui,
                     Window  xwindow)
{
  GdkWindow *window;
  GdkDisplay *display;

  display = gdk_x11_lookup_xdisplay (ui->xdisplay);
  window = gdk_x11_window_lookup_for_display (display, xwindow);

  if (window)
    gdk_window_show_unraised (window);
}
Пример #9
0
static void
clutter_stage_gdk_show (ClutterStageWindow *stage_window,
                        gboolean            do_raise)
{
  ClutterStageGdk *stage_gdk = CLUTTER_STAGE_GDK (stage_window);

  g_return_if_fail (stage_gdk->window != NULL);

  clutter_actor_map (CLUTTER_ACTOR (CLUTTER_STAGE_COGL (stage_gdk)->wrapper));

  if (do_raise)
    gdk_window_show (stage_gdk->window);
  else
    gdk_window_show_unraised (stage_gdk->window);
}
Пример #10
0
JNIEXPORT void JNICALL
Java_org_gnome_gdk_GdkWindow_gdk_1window_1show_1unraised
(
	JNIEnv* env,
	jclass cls,
	jlong _self
)
{
	GdkWindow* self;

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

	// call function
	gdk_window_show_unraised(self);

	// cleanup parameter self
}
Пример #11
0
gboolean
gd_tagged_entry_insert_tag (GdTaggedEntry    *self,
                            GdTaggedEntryTag *tag,
                            gint              position)
{
    if (g_list_find (self->tags, tag) != NULL)
        return FALSE;

    tag->entry = self;

    self->tags = g_list_insert (self->tags, g_object_ref (tag), position);

    if (gtk_widget_get_realized (GTK_WIDGET (self)))
        gd_tagged_entry_tag_realize (tag, self);

    if (gtk_widget_get_mapped (GTK_WIDGET (self)))
        gdk_window_show_unraised (tag->window);

    gtk_widget_queue_resize (GTK_WIDGET (self));

    return TRUE;
}
Пример #12
0
static VALUE
gdkwin_show_unraised(VALUE self)
{
    gdk_window_show_unraised(_SELF(self));
    return self;
}
Пример #13
0
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 ;
}
Пример #14
0
static void
display_entry (MetaTabPopup *popup,
               TabEntry     *te)
{
  GdkRectangle rect;
  GdkRegion *region;
  GdkRegion *inner_region;
  GdkWindow *window;


  if (popup->current_selected_entry)
  {
    if (popup->outline)
      unselect_image (popup->current_selected_entry->widget);
    else
      unselect_workspace (popup->current_selected_entry->widget);
  }

  gtk_label_set_markup (GTK_LABEL (popup->label), te->title);

  if (popup->outline)
    select_image (te->widget);
  else
    select_workspace (te->widget);

  if (popup->outline)
    {
      /* Do stuff behind gtk's back */
      gdk_window_hide (gtk_widget_get_window(popup->outline_window));
      meta_core_increment_event_serial (GDK_DISPLAY_XDISPLAY (gdk_display_get_default ()));

      rect = te->rect;
      rect.x = 0;
      rect.y = 0;

      window = gtk_widget_get_window(GTK_WIDGET(popup->outline_window));

      gdk_window_move_resize (window,
                              te->rect.x, te->rect.y,
                              te->rect.width, te->rect.height);

      #if GTK_CHECK_VERSION(3, 0, 0)
      GdkRGBA black = { 0.0, 0.0, 0.0, 1.0 };
      gdk_window_set_background_rgba (window, &black);
      #else
      gdk_window_set_background (window,
                                 &popup->outline_window->style->black);
      #endif

      region = gdk_region_rectangle (&rect);
      inner_region = gdk_region_rectangle (&te->inner_rect);
      gdk_region_subtract (region, inner_region);
      gdk_region_destroy (inner_region);

      gdk_window_shape_combine_region (window,
                                       region,
                                       0, 0);

      gdk_region_destroy (region);

      /* This should piss off gtk a bit, but we don't want to raise
       * above the tab popup.  So, instead of calling gtk_widget_show,
       * we manually set the window as mapped and then manually map it
       * with gdk functions.
       */
      #if GTK_CHECK_VERSION(3, 0, 0)
      gtk_widget_set_mapped (popup->outline_window, TRUE);
      #else
      GTK_WIDGET_SET_FLAGS (popup->outline_window, GTK_MAPPED);
      #endif
      gdk_window_show_unraised (window);
    }

  /* Must be before we handle an expose for the outline window */
  popup->current_selected_entry = te;
}
Пример #15
0
static void
anjuta_tabber_size_allocate(GtkWidget* widget, GtkAllocation* allocation)
{
	g_return_if_fail (ANJUTA_IS_TABBER (widget));
	AnjutaTabber* tabber = ANJUTA_TABBER (widget);

	GtkStyleContext* context;
	GList* child;
	gint focus_width;
	gint focus_pad;
	gint tab_curvature;
	gint tab_overlap;
	gint n_children = g_list_length (tabber->priv->children);
	gint x;
	gint focus_space;
	gint tab_space;

	context = gtk_widget_get_style_context (widget);

	gtk_widget_style_get (GTK_WIDGET (tabber),
	                      "focus-line-width", &focus_width,
	                      "focus-padding", &focus_pad,
	                      "tab-curvature", &tab_curvature,
	                      "tab-overlap", &tab_overlap,
	                      NULL);

	focus_space = focus_width + focus_pad;
	tab_space = tab_curvature - tab_overlap;
	
	gtk_widget_set_allocation (widget, allocation);

	switch (gtk_widget_get_direction (widget))
	{
		case GTK_TEXT_DIR_RTL:
			x = allocation->x + allocation->width;
			break;
		case GTK_TEXT_DIR_LTR:
		default:
			x = allocation->x;
	}

	if (gtk_widget_get_realized (widget))
	{
		gdk_window_move_resize (tabber->priv->event_window,
		                        allocation->x, allocation->y,
		                        allocation->width, allocation->height);
		if (gtk_widget_get_mapped (widget))
			gdk_window_show_unraised (tabber->priv->event_window);
	}

	if (n_children > 0)
	{
		gint total_space;
		gint total_width;
		gboolean use_natural = FALSE;
		gint child_equal;
		gint extra_space = 0;
		gint real_width = allocation->width;

		/* Calculate the total space that is used for padding/overlap */
		total_space = 2 * tab_curvature
			+ 2 * tab_space * (n_children - 1)
			+  2 * focus_space * n_children;

		for (child = tabber->priv->children; child != NULL; child = g_list_next (child))
		{
			GtkStateFlags state;
			GtkBorder tab_padding;

			/* Get the padding of the tab */
			gtk_style_context_save (context);
			anjuta_tabber_setup_style_context (tabber, context, child, &state, NULL);
			gtk_style_context_get_padding (context, state, &tab_padding);
			gtk_style_context_restore (context);

			total_space += tab_padding.left + tab_padding.right;
		}

		/* Check if we have enough space for all widgets natural size */
		child_equal = (real_width - total_space) / n_children;

		if (child_equal < 0)
			return;

		/* Calculate the total width of the tabs */
		total_width = total_space;
		for (child = tabber->priv->children; child != NULL; child = g_list_next (child))
		{
			GtkWidget* child_widget = GTK_WIDGET (child->data);
			gint natural;

			gtk_widget_get_preferred_width (child_widget, NULL,
			                                &natural);

			total_width += natural;

			if (natural < child_equal)
				extra_space += child_equal - natural;
		}

		use_natural = (total_width <= real_width);
		child_equal += extra_space / n_children;
		
		for (child = tabber->priv->children; child != NULL; child = g_list_next (child))
		{
			GtkWidget* child_widget = GTK_WIDGET (child->data);
			GtkStateFlags state;
			GtkBorder tab_padding, active_padding;
			GtkAllocation child_alloc;
			gint natural;
			gint minimal;
			gint begin_tab = tab_space;
			gint end_tab = tab_space;

			/* Get the padding of the tab */
			gtk_style_context_save (context);
			anjuta_tabber_setup_style_context (tabber, context, child, &state, NULL);
			gtk_style_context_get_padding (context, state, &tab_padding);
			gtk_style_context_get_padding (context, state | GTK_STATE_ACTIVE, &active_padding);
			gtk_style_context_restore (context);

			if (child->prev == NULL)
				begin_tab = tab_curvature;
			if (child->next == NULL)
				end_tab = tab_curvature;
			
			gtk_widget_get_preferred_width (child_widget, &minimal,
				                            &natural);

			if (use_natural)
			{
				child_alloc.width = natural;
			}
	 		else
			{
				if (natural < child_equal)
					child_alloc.width = natural;
				else
					child_alloc.width = child_equal;
			}
			/* The active pad is by definition at least the same height
			 * as the inactive one. Therefore we always use the padding of the
			 * active tab to calculate the height and y position of the child.
			 */
			child_alloc.height = allocation->height - 2 * focus_space
				- active_padding.top - active_padding.bottom;
			child_alloc.y = allocation->y + focus_space + active_padding.top;

			switch (gtk_widget_get_direction (widget))
			{
				case GTK_TEXT_DIR_RTL:
					child_alloc.x = x - focus_space - tab_padding.right
						- begin_tab - child_alloc.width;
					x = child_alloc.x - focus_space - tab_padding.left - end_tab;
					break;
				case GTK_TEXT_DIR_LTR:
				default:
					child_alloc.x = x + focus_space + tab_padding.left + begin_tab;
					x = child_alloc.x + child_alloc.width + focus_space
						+ tab_padding.right + end_tab;
			}

			gtk_widget_size_allocate (child_widget, &child_alloc);
		}
	}
}
Пример #16
0
static void
anjuta_tabber_size_allocate(GtkWidget* widget, GtkAllocation* allocation)
{
	g_return_if_fail (ANJUTA_IS_TABBER (widget));
	AnjutaTabber* tabber = ANJUTA_TABBER (widget);

	GList* child;
	gint focus_width;
	gint tab_curvature;
	gint tab_overlap;
	gint n_children = g_list_length (tabber->priv->children);
	gint x;
	gint padding;
	gint tab_space;
	
	gtk_widget_style_get (GTK_WIDGET (tabber),
	                      "focus-line-width", &focus_width,
	                      "tab-curvature", &tab_curvature,
	                      "tab-overlap", &tab_overlap,
	                      NULL);

	padding = focus_width + tabber->priv->tab_hborder;
	tab_space = tab_curvature - tab_overlap;
	
	gtk_widget_set_allocation (widget, allocation);

	switch (gtk_widget_get_direction (widget))
	{
		case GTK_TEXT_DIR_RTL:
			x = allocation->x + allocation->width;
			break;
		case GTK_TEXT_DIR_LTR:
		default:
			x = allocation->x;
	}

	if (gtk_widget_get_realized (widget))
	{
		gdk_window_move_resize (tabber->priv->event_window,
		                        allocation->x, allocation->y,
		                        allocation->width, allocation->height);
		if (gtk_widget_get_mapped (widget))
			gdk_window_show_unraised (tabber->priv->event_window);
	}

	if (n_children > 0)
	{
		gint total_width = 2 * tab_overlap;
		gboolean use_natural = FALSE;
		gint child_equal;
		gint extra_space = 0;
		gint real_width = allocation->width;

		/* Check if we have enough space for all widgets natural size */
		child_equal = real_width / n_children - 
			 n_children * 2 * (padding + tab_space) - 2 * tab_overlap;

		if (child_equal < 0)
			return;
		
		for (child = tabber->priv->children; child != NULL; child = g_list_next (child))
		{
			GtkWidget* child_widget = GTK_WIDGET (child->data);
			gint natural;
			gtk_widget_get_preferred_width (child_widget, NULL,
			                                &natural);

			total_width += natural + 2 * (padding + tab_space);
			if (natural < child_equal)
				extra_space += child_equal - natural;
		}
		use_natural = (total_width <= real_width);
		child_equal += extra_space / n_children;
		
		for (child = tabber->priv->children; child != NULL; child = g_list_next (child))
		{
			GtkWidget* child_widget = GTK_WIDGET (child->data);
			GtkAllocation child_alloc;
			gint natural;
			gint minimal;
			gint begin_tab = tab_space;
			gint end_tab = tab_space;

			if (child == g_list_first (tabber->priv->children))
				begin_tab += tab_overlap;
			if (child == g_list_last (tabber->priv->children))
				end_tab += tab_overlap;
			
			gtk_widget_get_preferred_width (child_widget, &minimal,
				                            &natural);

			if (use_natural)
			{
				child_alloc.width = natural;
			}
			else
			{
				if (natural < child_equal)
					child_alloc.width = natural;
				else
					child_alloc.width = child_equal;
			}
			child_alloc.height = allocation->height
				- 2 * (focus_width + tabber->priv->tab_vborder);
			switch (gtk_widget_get_direction (widget))
			{
				case GTK_TEXT_DIR_RTL:
					child_alloc.x = x - padding - begin_tab - child_alloc.width;
					x = child_alloc.x - padding - end_tab;
					break;
				case GTK_TEXT_DIR_LTR:
				default:
					child_alloc.x = x + padding + begin_tab;
					x = child_alloc.x + child_alloc.width + padding + end_tab;
			}
			child_alloc.y = allocation->y +
				tabber->priv->tab_vborder + focus_width;

			gtk_widget_size_allocate (GTK_WIDGET (child->data), &child_alloc);
		}
	}
}