当前位置: 首页>>代码示例>>C++>>正文


C++ GTK_WIDGET_MAPPED函数代码示例

本文整理汇总了C++中GTK_WIDGET_MAPPED函数的典型用法代码示例。如果您正苦于以下问题:C++ GTK_WIDGET_MAPPED函数的具体用法?C++ GTK_WIDGET_MAPPED怎么用?C++ GTK_WIDGET_MAPPED使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。


在下文中一共展示了GTK_WIDGET_MAPPED函数的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。

示例1: mate_druid_set_page

/**
 * mate_druid_set_page:
 * @druid: A #MateDruid widget.
 * @page: The #MateDruidPage to be brought to the foreground.
 *
 * Description: This will make @page the currently showing page in the druid.
 * @page must already be in the druid.
 **/
void
mate_druid_set_page (MateDruid *druid,
		      MateDruidPage *page)
{
	GList *list;
	GtkWidget *old = NULL;
	g_return_if_fail (druid != NULL);
	g_return_if_fail (MATE_IS_DRUID (druid));
	g_return_if_fail (page != NULL);
	g_return_if_fail (MATE_IS_DRUID_PAGE (page));

	if (druid->_priv->current == page)
	     return;
	list = g_list_find (druid->_priv->children, page);
	g_return_if_fail (list != NULL);

	if ((druid->_priv->current) && (GTK_WIDGET_VISIBLE (druid->_priv->current)) && (GTK_WIDGET_MAPPED (druid))) {
		old = GTK_WIDGET (druid->_priv->current);
	}
	druid->_priv->current = MATE_DRUID_PAGE (list->data);
	mate_druid_page_prepare (druid->_priv->current);
	if (GTK_WIDGET_VISIBLE (druid->_priv->current) && (GTK_WIDGET_MAPPED (druid))) {
		gtk_widget_map (GTK_WIDGET (druid->_priv->current));
		gtk_widget_set_sensitive (GTK_WIDGET (druid->_priv->current), TRUE);
	}
	if (old && GTK_WIDGET_MAPPED (old)) {
		gtk_widget_unmap (old);
		gtk_widget_set_sensitive (old, FALSE);
	}
}
开发者ID:fatman2021,项目名称:libmateui,代码行数:38,代码来源:mate-druid.c

示例2: gtk_pizza_position_child

static void
gtk_pizza_position_child (GtkPizza      *pizza,
                          GtkPizzaChild *child)
{
    gint x;
    gint y;

    x = child->x - pizza->xoffset;
    y = child->y - pizza->yoffset;

    if (IS_ONSCREEN (x,y))
    {
        if (GTK_WIDGET_MAPPED (pizza) &&
          GTK_WIDGET_VISIBLE (child->widget))
        {
            if (!GTK_WIDGET_MAPPED (child->widget))
                gtk_widget_map (child->widget);
        }

        if (GTK_WIDGET_IS_OFFSCREEN (child->widget))
            GTK_PRIVATE_UNSET_FLAG (child->widget, GTK_IS_OFFSCREEN);
    }
    else
    {
        if (!GTK_WIDGET_IS_OFFSCREEN (child->widget))
            GTK_PRIVATE_SET_FLAG (child->widget, GTK_IS_OFFSCREEN);

        if (GTK_WIDGET_MAPPED (child->widget))
            gtk_widget_unmap (child->widget);
    }
}
开发者ID:CobaltBlues,项目名称:wxWidgets,代码行数:31,代码来源:win_gtk.c

示例3: hildon_remote_texture_set_show_full

/**
 * hildon_remote_texture_set_show_full:
 * @self: A #HildonRemoteTexture
 * @show: A boolean flag setting the visibility of the remote texture.
 * @opacity: Desired opacity setting
 *
 * Send a message to the window manager setting the visibility of
 * the remote texture. This will only affect the visibility of
 * the remote texture set by the compositing window manager in its own
 * rendering pipeline, after X has drawn the window to the off-screen
 * buffer. This setting, naturally, has no effect if the #HildonRemoteTexture
 * widget is not visible in X11 terms (i.e. realized and mapped).
 *
 * Furthermore, if a widget is parented, its final visibility will be
 * affected by that of the parent window.
 *
 * The opacity setting ranges from zero (0), being completely transparent
 * to 255 (0xff) being fully opaque.
 *
 * If the remote texture WM-counterpart is not ready, the show message
 * will be queued until the WM is ready for it.
 *
 * Since: 2.2
 **/
void
hildon_remote_texture_set_show_full (HildonRemoteTexture *self,
				      gint show,
				      gint opacity)
{
    HildonRemoteTexturePrivate
	               *priv = HILDON_REMOTE_TEXTURE_GET_PRIVATE (self);
    GtkWidget          *widget = GTK_WIDGET (self);

    if (opacity > 255)
	opacity = 255;

    if (opacity < 0)
	opacity = 0;

    priv->show = show;
    priv->opacity = opacity;
    priv->set_show = 1;

    if (GTK_WIDGET_MAPPED (widget) && priv->ready)
    {
	/* Defer show messages until the remote texture is parented
	 * and the parent window is mapped */
	if (!priv->parent || !GTK_WIDGET_MAPPED (GTK_WIDGET (priv->parent)))
	    return;
	hildon_remote_texture_send_message (self,
					     show_atom,
					     show, opacity,
					     0, 0, 0);
	priv->set_show = 0;
    }
}
开发者ID:archlinuxarm-n900,项目名称:libhildon,代码行数:56,代码来源:hildon-remote-texture.c

示例4: hildon_remote_texture_set_position

/**
 * hildon_remote_texture_set_position:
 * @self: A #HildonRemoteTexture
 * @x: Desired X coordinate
 * @y: Desired Y coordinate
 * @width: Desired width
 * @height: Desired height
 *
 * Send a message to the window manager setting the offset of the remote
 * texture in the window (in Remote texture's pixels). The texture
 * is also subject to the animation effects rendered by the compositing
 * window manager on that window (like those by task switcher).
 *
 * If the remote texture WM-counterpart is not ready, the show message
 * will be queued until the WM is ready for it.
 *
 * Since: 2.2
 **/
void
hildon_remote_texture_set_position (HildonRemoteTexture *self,
                                        gint x,
                                        gint y,
                                        gint width,
                                        gint height)
{
    HildonRemoteTexturePrivate
                       *priv = HILDON_REMOTE_TEXTURE_GET_PRIVATE (self);
    GtkWidget          *widget = GTK_WIDGET (self);

    priv->x = x;
    priv->y = y;
    priv->width = width;
    priv->height = height;
    priv->set_position = 1;

    if (GTK_WIDGET_MAPPED (widget) && priv->ready)
    {
        /* Defer messages until the remote texture is parented
         * and the parent window is mapped */

        if (!priv->parent || !GTK_WIDGET_MAPPED (GTK_WIDGET (priv->parent)))
            return;
        hildon_remote_texture_send_message (self,
                                            position_atom,
                                            x, y,
                                            width, height, 0);
        priv->set_position = 0;
    }
}
开发者ID:archlinuxarm-n900,项目名称:libhildon,代码行数:49,代码来源:hildon-remote-texture.c

示例5: hildon_remote_texture_set_offset

/**
 * hildon_remote_texture_set_offset:
 * @self: A #HildonRemoteTexture
 * @x: Desired X offset
 * @y: Desired Y offset
 *
 * Send a message to the window manager setting the offset of the remote
 * texture in the window (in Remote texture's pixels). The texture
 * is also subject to the animation effects rendered by the compositing
 * window manager on that window (like those by task switcher).
 *
 * If the remote texture WM-counterpart is not ready, the show message
 * will be queued until the WM is ready for it.
 *
 * Since: 2.2
 **/
void
hildon_remote_texture_set_offset (HildonRemoteTexture *self,
                                    double x,
                                    double y)
{
    HildonRemoteTexturePrivate
	               *priv = HILDON_REMOTE_TEXTURE_GET_PRIVATE (self);
    GtkWidget          *widget = GTK_WIDGET (self);

    priv->offset_x = x;
    priv->offset_y = y;
    priv->set_offset = 1;

    if (GTK_WIDGET_MAPPED (widget) && priv->ready)
    {
        /* Defer messages until the remote texture is parented
         * and the parent window is mapped */

        if (!priv->parent || !GTK_WIDGET_MAPPED (GTK_WIDGET (priv->parent)))
            return;
        hildon_remote_texture_send_message (self,
                                            offset_atom,
                                            (gint)(x*65536), (gint)(y*65536),
                                            0, 0, 0);
        priv->set_offset = 0;
    }
}
开发者ID:archlinuxarm-n900,项目名称:libhildon,代码行数:43,代码来源:hildon-remote-texture.c

示例6: hildon_remote_texture_set_image

/**
 * hildon_remote_texture_set_image:
 * @self: A #HildonRemoteTexture
 * @key: The key that would be used with shmget in hildon-desktop. The key
 * should probably be created with ftok, and the relevant shared memory
 * area should be created before this call.
 * @width: width of image in pixels
 * @height: height of image in pixels
 * @bpp: BYTES per pixel - usually 2,3 or 4
 *
 * Since: 2.2
 */
void
hildon_remote_texture_set_image (HildonRemoteTexture *self,
                                 key_t key,
                                 guint width,
                                 guint height,
                                 guint bpp)
{
  HildonRemoteTexturePrivate
                       *priv = HILDON_REMOTE_TEXTURE_GET_PRIVATE (self);
  GtkWidget          *widget = GTK_WIDGET (self);

  priv->set_shm = 1;
  priv->shm_key = key;
  priv->shm_width = width;
  priv->shm_height = height;
  priv->shm_bpp = bpp;

  if (GTK_WIDGET_MAPPED (widget) && priv->ready)
    {
       /* Defer messages until the remote texture is parented
        * and the parent window is mapped */
        if (!priv->parent || !GTK_WIDGET_MAPPED (GTK_WIDGET (priv->parent)))
            return;
        hildon_remote_texture_send_message (self,
                                            shm_atom,
                                            priv->shm_key,
                                            priv->shm_width,
                                            priv->shm_height,
                                            priv->shm_bpp,
                                            0);
        priv->set_shm = 0;
    }
}
开发者ID:archlinuxarm-n900,项目名称:libhildon,代码行数:45,代码来源:hildon-remote-texture.c

示例7: hildon_remote_texture_set_scale

/**
 * hildon_remote_texture_set_scalex:
 * @self: A #HildonRemoteTexture
 * @x_scale: The scale factor for the memory area to be rendered in the X-axis
 * @y_scale: The scale factor for the memory area to be rendered in the X-axis
 *
 * Since: 2.2
 **/
void
hildon_remote_texture_set_scale (HildonRemoteTexture *self,
                               double x_scale,
                               double y_scale)
{
    HildonRemoteTexturePrivate
	               *priv = HILDON_REMOTE_TEXTURE_GET_PRIVATE (self);
    GtkWidget          *widget = GTK_WIDGET (self);

    priv->scale_x = x_scale;
    priv->scale_y = y_scale;
    priv->set_scale = 1;

    if (GTK_WIDGET_MAPPED (widget) && priv->ready)
    {
        /* Defer messages until the remote texture is parented
         * and the parent window is mapped */
        if (!priv->parent || !GTK_WIDGET_MAPPED (GTK_WIDGET (priv->parent)))
            return;
        hildon_remote_texture_send_message (self,
                                             scale_atom,
                                             priv->scale_x * (1 << 16),
                                             priv->scale_y * (1 << 16),
                                             0, 0, 0);
        priv->set_scale = 0;
    }
}
开发者ID:archlinuxarm-n900,项目名称:libhildon,代码行数:35,代码来源:hildon-remote-texture.c

示例8: gtk_ellipsis_set_expanded

/**
 * gtk_ellipsis_set_expanded:
 * @ellipsis: a #GtkEllipsis
 * @expanded: whether the child widget is revealed
 *
 * Sets the state of the ellipsis. Set to %TRUE, if you want
 * the child widget to be revealed, and %FALSE if you want the
 * child widget to be hidden.
 *
 * Since: 2.4
 **/
void
gtk_ellipsis_set_expanded (GtkEllipsis *ellipsis,
			   gboolean     expanded)
{
  GtkEllipsisPrivate *priv;

  g_return_if_fail (GTK_IS_ELLIPSIS (ellipsis));

  priv = ellipsis->priv;

  expanded = expanded != FALSE;

  if (priv->expanded != expanded)
    {
      GtkWidget *child = GTK_BIN (ellipsis)->child;
      priv->expanded = expanded;

      if (child)
	{
          if (!expanded && GTK_WIDGET_MAPPED (child))
	    gtk_widget_unmap (child);
          if (expanded && GTK_WIDGET_MAPPED (priv->label))
	    {
              if (GTK_WIDGET_REALIZED (ellipsis))
	        gdk_window_hide (priv->event_window);
	      gtk_widget_unmap (priv->ellipsis_label);
	      gtk_widget_unmap (priv->label);
	    }

          if (GTK_WIDGET_MAPPED (ellipsis))
	    {
	      if (expanded && GTK_WIDGET_VISIBLE (child))
		gtk_widget_map (child);
	      if (!expanded && GTK_WIDGET_VISIBLE (priv->label))
		{
		  gtk_widget_map (priv->label);
		  gtk_widget_map (priv->ellipsis_label);
                  if (GTK_WIDGET_REALIZED (ellipsis))
		    gdk_window_show (priv->event_window);
		}
	    }

	  gtk_widget_queue_resize (GTK_WIDGET (ellipsis));
	}

      g_object_notify (G_OBJECT (ellipsis), "expanded");
    }
}
开发者ID:JamesLinus,项目名称:gtk-widgets,代码行数:59,代码来源:gtkellipsis.c

示例9: showMessageBox

//----------------------------- Messages -------------------------------------
// This shows a simple dialog box with a label and an 'OK' button.
void
showMessageBox(const std::string &message,
                GtkMessageType type/*=GTK_MESSAGE_ERROR*/,
                GtkWidget *transient_widget/*=NULL*/)
{
  GtkWidget* dialog;
  GtkWindow* transientParent = NULL;

  // Make transient if necessary
  if(transient_widget) {
    GtkWidget* toplevel = getToplevel(transient_widget);
    if(toplevel                   && 
       GTK_IS_WINDOW(toplevel)    && 
       GTK_WIDGET_MAPPED(toplevel))
      transientParent = GTK_WINDOW(toplevel);
  }

  dialog = gtk_message_dialog_new(transientParent,
				  GTK_DIALOG_MODAL,
				  type,
				  GTK_BUTTONS_OK,
				  "%s", message.c_str());

  gtk_dialog_set_default_response(GTK_DIALOG(dialog), GTK_RESPONSE_OK);
  gtk_window_set_position(GTK_WINDOW(dialog), GTK_WIN_POS_CENTER);

  runModalBox(dialog);
  gtk_widget_destroy(dialog);
}
开发者ID:rducom,项目名称:Heditor,代码行数:31,代码来源:gtkToolsDialogs.cpp

示例10: awt_gtk_panel_add

static void
awt_gtk_panel_add (GtkContainer *container, GtkWidget *widget)
{
       AWTGtkPanel *panel = AWT_GTK_PANEL(container);

       g_return_if_fail (panel != NULL);
       g_return_if_fail (widget != NULL);

       gtk_widget_set_parent (widget, GTK_WIDGET (panel));

       /* Add at start of list using g_list_prepend to ensure widgets are added behind
          other widgets if they are added later. */

       panel->children = g_list_prepend (panel->children, widget);

       if (GTK_WIDGET_REALIZED (panel))
               gtk_widget_realize (widget);

       if (GTK_WIDGET_VISIBLE (panel) && GTK_WIDGET_VISIBLE (widget))
       {
               if (GTK_WIDGET_MAPPED (panel))
                       gtk_widget_map (widget);

               gtk_widget_queue_resize (GTK_WIDGET (panel));
       }
}
开发者ID:AllBinary,项目名称:phoneme-components-cdc,代码行数:26,代码来源:GPanelPeer.c

示例11: gail_select_watcher

static gboolean
gail_select_watcher (GSignalInvocationHint *ihint,
                     guint                  n_param_values,
                     const GValue          *param_values,
                     gpointer               data)
{
  GObject *object;
  GtkWidget *widget;

  object = g_value_get_object (param_values + 0);
  g_return_val_if_fail (GTK_IS_WIDGET(object), FALSE);

  widget = GTK_WIDGET (object);

  if (!GTK_WIDGET_MAPPED (widget))
    {
      g_signal_connect (widget, "map",
                        G_CALLBACK (gail_map_cb),
                        NULL);
    }
  else
    gail_finish_select (widget);

  return TRUE;
}
开发者ID:batman52,项目名称:dingux-code,代码行数:25,代码来源:gail.c

示例12: showAskingBox

// This shows a question dialog box response can be (YES/NO/CANCEL)
gint
showAskingBox(const std::string& message,
	      GtkMessageType type,
              const GtkButtonsType buttonsType,
              GtkWidget* transient_widget)
{
  GtkWidget *dialog;
  GtkWindow *transient_parent(NULL);

  // Make transient if necessary
  if (transient_widget)
  {
    GtkWidget *toplevel = getToplevel(transient_widget);
    if (toplevel && GTK_IS_WINDOW (toplevel) && GTK_WIDGET_MAPPED (toplevel))
        transient_parent=GTK_WINDOW(toplevel);
  }

  dialog = gtk_message_dialog_new (transient_parent,
				   GTK_DIALOG_MODAL,
				   type,
				   buttonsType,
				   "%s", message.c_str());
  //gtk_dialog_set_default_response (GTK_DIALOG(dialog), GTK_RESPONSE_OK);
  gtk_window_set_position(GTK_WINDOW (dialog), GTK_WIN_POS_CENTER);

  // Suspend AReVi Scheduler
  gint result=runModalBox(dialog);
  gtk_widget_destroy (dialog);

  return result;
}
开发者ID:rducom,项目名称:Heditor,代码行数:32,代码来源:gtkToolsDialogs.cpp

示例13: mate_druid_remove

static void
mate_druid_remove (GtkContainer *widget,
		    GtkWidget *child)
{
	MateDruid *druid;
	GList *list;

	g_return_if_fail (widget != NULL);
	g_return_if_fail (MATE_IS_DRUID (widget));
	g_return_if_fail (child != NULL);

	druid = MATE_DRUID (widget);

	list = g_list_find (druid->_priv->children, child);
	/* Is it a page? */
	if (list != NULL) {
		/* If we are mapped and visible, we want to deal with changing the page. */
		if ((GTK_WIDGET_MAPPED (GTK_WIDGET (widget))) &&
		    (list->data == (gpointer) druid->_priv->current)) {
			if (list->next != NULL)
				mate_druid_set_page (druid, MATE_DRUID_PAGE (list->next->data));
			else if (list->prev != NULL)
				mate_druid_set_page (druid, MATE_DRUID_PAGE (list->prev->data));
			else
				/* Removing the only child, just set current to NULL */
				druid->_priv->current = NULL;
		}
	}
	druid->_priv->children = g_list_remove (druid->_priv->children, child);
	gtk_widget_unparent (child);
}
开发者ID:fatman2021,项目名称:libmateui,代码行数:31,代码来源:mate-druid.c

示例14: mate_druid_unmap

static void
mate_druid_unmap (GtkWidget *widget)
{
	MateDruid *druid;

	g_return_if_fail (widget != NULL);
	g_return_if_fail (MATE_IS_DRUID (widget));

	druid = MATE_DRUID (widget);
	GTK_WIDGET_UNSET_FLAGS (druid, GTK_MAPPED);
#if 0
	gtk_widget_unmap (druid->back);
	if (druid->_priv->show_finish)
		gtk_widget_unmap (druid->finish);
	else
		gtk_widget_unmap (druid->next);
	gtk_widget_unmap (druid->cancel);
	if (druid->_priv->show_help)
		gtk_widget_unmap (druid->help);
#endif
	gtk_widget_unmap (druid->_priv->bbox);
	if (druid->_priv->current &&
	    GTK_WIDGET_VISIBLE (druid->_priv->current) &&
	    GTK_WIDGET_MAPPED (druid->_priv->current))
		gtk_widget_unmap (GTK_WIDGET (druid->_priv->current));
}
开发者ID:fatman2021,项目名称:libmateui,代码行数:26,代码来源:mate-druid.c

示例15: showColorBox

//------------------------- Color Selection -----------------------------------
// Open Dlg for color selection return true, if color changed
bool
showColorBox(const std::string &title,
             GdkColor &colorInOut,
             GtkWidget *transient_widget/*=NULL*/)
{
  GtkWidget *dialog;
  GtkColorSelection *colorsel;
  gint response;

  dialog = gtk_color_selection_dialog_new (title.c_str());

  // Make transient if necessary
  if (transient_widget)
  {
    GtkWidget *toplevel = getToplevel(transient_widget);
    if (toplevel && GTK_IS_WINDOW (toplevel) && GTK_WIDGET_MAPPED (toplevel))
        gtk_window_set_transient_for (GTK_WINDOW (dialog),
                                      GTK_WINDOW (toplevel));
  }

  colorsel = GTK_COLOR_SELECTION (GTK_COLOR_SELECTION_DIALOG (dialog)->colorsel);

  gtk_color_selection_set_previous_color (colorsel, &colorInOut);
  gtk_color_selection_set_current_color (colorsel, &colorInOut);
  gtk_color_selection_set_has_palette (colorsel, TRUE);

  response = runModalBox(dialog);

  if (response == GTK_RESPONSE_OK)
  {
    gtk_color_selection_get_current_color (colorsel,&colorInOut);
  }
  gtk_widget_destroy (dialog);
  return (response == GTK_RESPONSE_OK);
}
开发者ID:rducom,项目名称:Heditor,代码行数:37,代码来源:gtkToolsDialogs.cpp


注:本文中的GTK_WIDGET_MAPPED函数示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。