• 设为首页
  • 点击收藏
  • 手机版
    手机扫一扫访问
    迪恩网络手机版
  • 关注官方公众号
    微信扫一扫关注
    公众号

C++ GTK_PLUG函数代码示例

原作者: [db:作者] 来自: [db:来源] 收藏 邀请

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



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

示例1: egg_tray_icon_send_message

guint
egg_tray_icon_send_message (EggTrayIcon *icon,
			    gint         timeout,
			    const gchar *message,
			    gint         len)
{
  guint stamp;
  
  g_return_val_if_fail (EGG_IS_TRAY_ICON (icon), 0);
  g_return_val_if_fail (timeout >= 0, 0);
  g_return_val_if_fail (message != NULL, 0);
		     
  if (icon->manager_window == None)
    return 0;

  if (len < 0)
    len = strlen (message);

  stamp = icon->stamp++;
  
  /* Get ready to send the message */
  egg_tray_icon_send_manager_message (icon, SYSTEM_TRAY_BEGIN_MESSAGE,
				      (Window)gtk_plug_get_id (GTK_PLUG (icon)),
				      timeout, len, stamp);

  /* Now to send the actual message */
  gdk_error_trap_push ();
  while (len > 0)
    {
      XClientMessageEvent ev;
      Display *xdisplay;

      xdisplay = GDK_DISPLAY_XDISPLAY (gtk_widget_get_display (GTK_WIDGET (icon)));
      
      ev.type = ClientMessage;
      ev.window = (Window)gtk_plug_get_id (GTK_PLUG (icon));
      ev.format = 8;
      ev.message_type = XInternAtom (xdisplay,
				     "_NET_SYSTEM_TRAY_MESSAGE_DATA", False);
      if (len > 20)
	{
	  memcpy (&ev.data, message, 20);
	  len -= 20;
	  message += 20;
	}
      else
	{
	  memcpy (&ev.data, message, len);
	  len = 0;
	}

      XSendEvent (xdisplay,
		  icon->manager_window, False, StructureNotifyMask, (XEvent *)&ev);
      XSync (xdisplay, False);
    }
  gdk_error_trap_pop ();

  return stamp;
}
开发者ID:czxxjtu,项目名称:wxPython-1,代码行数:59,代码来源:eggtrayicon.c


示例2: matecomponent_plug_button_event

static gboolean
matecomponent_plug_button_event (GtkWidget      *widget,
			  GdkEventButton *event)
{
#if defined (GDK_WINDOWING_X11)
	XEvent xevent;
#endif

	g_return_val_if_fail (MATECOMPONENT_IS_PLUG (widget), FALSE);

	if (!MATECOMPONENT_PLUG (widget)->priv->forward_events || !GTK_WIDGET_TOPLEVEL (widget))
		return FALSE;

#if defined (GDK_WINDOWING_X11)

	if (event->type == GDK_BUTTON_PRESS) {
		xevent.xbutton.type = ButtonPress;

		/* X does an automatic pointer grab on button press
		 * if we have both button press and release events
		 * selected.
		 * We don't want to hog the pointer on our parent.
		 */
		gdk_display_pointer_ungrab
			(gtk_widget_get_display (widget),
			 GDK_CURRENT_TIME);
	} else
		xevent.xbutton.type = ButtonRelease;
    
	xevent.xbutton.display     = GDK_WINDOW_XDISPLAY (widget->window);
	xevent.xbutton.window      = GDK_WINDOW_XWINDOW (GTK_PLUG (widget)->socket_window);
	xevent.xbutton.root        = GDK_WINDOW_XWINDOW (gdk_screen_get_root_window
							 (gdk_drawable_get_screen (widget->window)));
	/*
	 * FIXME: the following might cause
	 *        big problems for non-GTK apps
	 */
	xevent.xbutton.x           = 0;
	xevent.xbutton.y           = 0;
	xevent.xbutton.x_root      = 0;
	xevent.xbutton.y_root      = 0;
	xevent.xbutton.state       = event->state;
	xevent.xbutton.button      = event->button;
	xevent.xbutton.same_screen = TRUE; /* FIXME ? */

	gdk_error_trap_push ();

	XSendEvent (GDK_WINDOW_XDISPLAY (widget->window),
		    GDK_WINDOW_XWINDOW (GTK_PLUG (widget)->socket_window),
		    False, NoEventMask, &xevent);

	gdk_flush ();
	gdk_error_trap_pop ();

#elif defined (GDK_WINDOWING_WIN32)
	/* FIXME: Need to do something? */
#endif
	return TRUE;
}
开发者ID:TheCoffeMaker,项目名称:Mate-Desktop-Environment,代码行数:59,代码来源:matecomponent-plug.c


示例3: plug_construct

static VALUE
plug_construct(VALUE self, VALUE socket_id)
{
#ifdef GDK_NATIVE_WINDOW_POINTER
    gtk_plug_construct(GTK_PLUG(RVAL2GOBJ(self)), GUINT_TO_POINTER(NUM2ULONG(socket_id)));
#else
    gtk_plug_construct(GTK_PLUG(RVAL2GOBJ(self)), (guint32)NUM2UINT(socket_id));
#endif
    return self;
}
开发者ID:benolee,项目名称:ruby-gnome2,代码行数:10,代码来源:rbgtkplug.c


示例4: egg_tray_icon_new_for_xscreen

EggTrayIcon *
egg_tray_icon_new_for_xscreen (Screen *xscreen, const char *name)
{
  EggTrayIcon *icon;
  char buffer[256];
  GdkWindow *root_window;

  g_return_val_if_fail (xscreen != NULL, NULL);
  
  icon = g_object_new (EGG_TYPE_TRAY_ICON, NULL);
  gtk_window_set_title (GTK_WINDOW (icon), name);

#if HAVE_GTK_MULTIHEAD
  /* FIXME: this code does not compile, screen is undefined. Now try
   * getting the GdkScreen from xscreen (:. Dunno how to solve this
   * (there is prolly some easy way I cant think of right now)
   */
  gtk_plug_construct_for_display (GTK_PLUG (icon),
				  gdk_screen_get_display (screen), 0);
	
#else
  gtk_plug_construct (GTK_PLUG (icon), 0);
#endif
  
  gtk_widget_realize (GTK_WIDGET (icon));
  

  /* Now see if there's a manager window around */
  g_snprintf (buffer, sizeof (buffer),
	      "_NET_SYSTEM_TRAY_S%d",
	      XScreenNumberOfScreen (xscreen));
  
  icon->selection_atom = XInternAtom (DisplayOfScreen (xscreen),
				      buffer, False);
  
  icon->manager_atom = XInternAtom (DisplayOfScreen (xscreen),
				    "MANAGER", False);
  
  icon->system_tray_opcode_atom = XInternAtom (DisplayOfScreen (xscreen),
					       "_NET_SYSTEM_TRAY_OPCODE", False);

  egg_tray_icon_update_manager_window (icon);

#if HAVE_GTK_MULTIHEAD
  root_window = gdk_screen_get_root_window (gtk_widget_get_screen (screen));
#else
  root_window = gdk_window_lookup (gdk_x11_get_default_root_xwindow ());
#endif
  
  /* Add a root window filter so that we get changes on MANAGER */
  gdk_window_add_filter (root_window,
			 egg_tray_icon_manager_filter, icon);
		      
  return icon;
}
开发者ID:voidptr,项目名称:xneur-option,代码行数:55,代码来源:eggtrayicon.c


示例5: totem_interface_set_transient_for

void
totem_interface_set_transient_for (GtkWindow *window, GtkWindow *parent)
{
#ifdef GDK_WINDOWING_X11
	GdkDisplay *display;

	display = gdk_display_get_default ();

	if (GDK_IS_X11_DISPLAY (display) &&
	    GTK_IS_PLUG (parent)) {
		GdkWindow *toplevel;

		gtk_widget_realize (GTK_WIDGET (window));
		toplevel = totem_gtk_plug_get_toplevel (GTK_PLUG (parent));
		if (toplevel != NULL) {
			gdk_window_set_transient_for
				(gtk_widget_get_window (GTK_WIDGET (window)), toplevel);
			g_object_unref (toplevel);
		}
		return;
	}
#endif /* GDK_WINDOWING_X11 */

	gtk_window_set_transient_for (GTK_WINDOW (window),
				      GTK_WINDOW (parent));
}
开发者ID:UIKit0,项目名称:totem,代码行数:26,代码来源:totem-interface.c


示例6: _calendar_embedded

static int _calendar_embedded(void)
{
	GtkWidget * window;
	GtkWidget * widget;
	Calendar * calendar;
	unsigned long id;

	window = gtk_plug_new(0);
	gtk_widget_realize(window);
	g_signal_connect_swapped(window, "embedded", G_CALLBACK(
				_embedded_on_embedded), window);
	if((calendar = calendar_new()) == NULL)
	{
		gtk_widget_destroy(window);
		return -1;
	}
	widget = calendar_get_widget(calendar);
	gtk_container_add(GTK_CONTAINER(window), widget);
	id = gtk_plug_get_id(GTK_PLUG(window));
	printf("%lu\n", id);
	fclose(stdout);
	gtk_main();
	calendar_delete(calendar);
	gtk_widget_destroy(window);
	return 0;
}
开发者ID:DeforaOS,项目名称:Calendar,代码行数:26,代码来源:main.c


示例7: impl_MateComponent_Control_getWindowId

static CORBA_char *
impl_MateComponent_Control_getWindowId (PortableServer_Servant servant,
				 const CORBA_char      *cookie,
				 CORBA_Environment     *ev)
{
	guint32        x11_id;
	MateComponentControl *control = MATECOMPONENT_CONTROL (
		matecomponent_object_from_servant (servant));
	GdkScreen *gdkscreen;
	int        screen_num;

	if (!control->priv->plug)
		create_plug (control);

	g_assert (control->priv->plug != NULL);

	screen_num = parse_cookie (cookie);
	if (screen_num != -1)
		gdkscreen = gdk_display_get_screen (
				gdk_display_get_default (), screen_num);
	else
		gdkscreen = gdk_screen_get_default ();

	gtk_window_set_screen (GTK_WINDOW (control->priv->plug), gdkscreen);

	gtk_widget_show (control->priv->plug);

	x11_id = gtk_plug_get_id (GTK_PLUG (control->priv->plug));
		
	dbgprintf ("plug id %u\n", x11_id);

	return matecomponent_control_window_id_from_x11 (x11_id);
}
开发者ID:TheCoffeMaker,项目名称:Mate-Desktop-Environment,代码行数:33,代码来源:matecomponent-control.c


示例8: egg_tray_icon_send_dock_request

static void egg_tray_icon_send_dock_request (EggTrayIcon *icon) {

	egg_tray_icon_send_manager_message (icon,
			SYSTEM_TRAY_REQUEST_DOCK,
			icon->manager_window,
			gtk_plug_get_id (GTK_PLUG (icon)),
			0, 0);
}
开发者ID:aufau,项目名称:xqf,代码行数:8,代码来源:trayicon.c


示例9: realize_cb

static void
realize_cb (GtkWidget *socket, gpointer user_data)
{
    GtkWidget *plug, *w;

    g_warning ("Realize");

    plug = gtk_plug_new (0);
    w = gtk_button_new_with_label ("Baa");
    gtk_widget_show_all (w);
    gtk_widget_show (plug);
    gtk_container_add (GTK_CONTAINER (plug), w);
    GTK_PLUG (plug)->socket_window = GTK_WIDGET (socket)->window;
    gtk_socket_add_id (GTK_SOCKET (socket),
                       gtk_plug_get_id (GTK_PLUG (plug)));
    gdk_window_show (GTK_WIDGET (plug)->window);
}
开发者ID:TheCoffeMaker,项目名称:Mate-Desktop-Environment,代码行数:17,代码来源:mate-test-control.c


示例10: matecomponent_plug_construct_full

/**
 * matecomponent_plug_construct_full:
 * @plug: The #MateComponentPlug.
 * @socket_id: the XID of the socket's window.
 *
 * Finish the creation of a #MateComponentPlug widget. This function
 * will generally only be used by classes deriving
 * from #MateComponentPlug.
 */
void
matecomponent_plug_construct_full (MateComponentPlug *plug,
			    GdkDisplay *display,
			    guint32     socket_id)
{
	gtk_plug_construct_for_display
		(GTK_PLUG (plug), display, socket_id);
}
开发者ID:TheCoffeMaker,项目名称:Mate-Desktop-Environment,代码行数:17,代码来源:matecomponent-plug.c


示例11: plug_get_id

static VALUE
plug_get_id(VALUE self)
{
    GdkNativeWindow id = gtk_plug_get_id(GTK_PLUG(RVAL2GOBJ(self)));
#ifdef GDK_NATIVE_WINDOW_POINTER
    return UINT2NUM(GPOINTER_TO_UINT(id));
#else
    return UINT2NUM(id);
#endif
}
开发者ID:benolee,项目名称:ruby-gnome2,代码行数:10,代码来源:rbgtkplug.c


示例12: egg_tray_icon_cancel_message

void egg_tray_icon_cancel_message (EggTrayIcon *icon,
			      guint        id)
{
  g_return_if_fail (EGG_IS_TRAY_ICON (icon));
  g_return_if_fail (id > 0);
  
  egg_tray_icon_send_manager_message (icon, SYSTEM_TRAY_CANCEL_MESSAGE,
				      (Window)gtk_plug_get_id (GTK_PLUG (icon)),
				      id, 0, 0);
}
开发者ID:BackupTheBerlios,项目名称:avidemux-svn,代码行数:10,代码来源:eggtrayicon.c


示例13: ASSERT

void NetscapePluginX11::visibilityDidChange()
{
    ASSERT(m_plugin.isWindowed());
    uint64_t windowID = 0;
#if PLATFORM(GTK)
    windowID = static_cast<uint64_t>(GDK_WINDOW_XID(gtk_plug_get_socket_window(GTK_PLUG(m_platformPluginWidget))));
#endif
    m_plugin.controller()->windowedPluginVisibilityDidChange(m_plugin.isVisible(), windowID);
    m_plugin.controller()->windowedPluginGeometryDidChange(m_plugin.frameRectInWindowCoordinates(), m_plugin.clipRect(), windowID);
}
开发者ID:aShinjiroUrata,项目名称:webkit,代码行数:10,代码来源:NetscapePluginX11.cpp


示例14: bacon_video_widget_gst_get_toplevel

static Window
bacon_video_widget_gst_get_toplevel (GtkWidget *widget)
{
	GtkWidget *parent;

	parent = gtk_widget_get_toplevel (GTK_WIDGET (widget));
	if (parent == NULL)
		return 0;

	if (GTK_IS_PLUG (parent))
		return bacon_video_widget_gtk_plug_get_toplevel (GTK_PLUG (parent));
	else
		return GDK_WINDOW_XID(gtk_widget_get_window (parent));
}
开发者ID:Avinashkumarsharma,项目名称:totemplayer,代码行数:14,代码来源:bacon-video-widget-gst-missing-plugins.c


示例15: egg_tray_icon_new_for_xscreen

EggTrayIcon *
egg_tray_icon_new_for_xscreen (Screen *xscreen, const char *name)
{
  EggTrayIcon *icon;
  char buffer[256];
  GdkWindow *root_window;
  GdkDisplay *display;
  GdkScreen *screen;
  
  g_return_val_if_fail (xscreen != NULL, NULL);
  
  icon = g_object_new (EGG_TYPE_TRAY_ICON, NULL);
  gtk_window_set_title (GTK_WINDOW (icon), name);

  display = gdk_x11_lookup_xdisplay (DisplayOfScreen (xscreen));
  screen = gdk_display_get_screen (display, XScreenNumberOfScreen (xscreen));
  
  gtk_plug_construct_for_display (GTK_PLUG (icon),
				  display, 0);

  gtk_window_set_screen (GTK_WINDOW (icon), screen);	 
  
  gtk_widget_realize (GTK_WIDGET (icon));

  /* Now see if there's a manager window around */
  g_snprintf (buffer, sizeof (buffer),
	      "_NET_SYSTEM_TRAY_S%d",
	      XScreenNumberOfScreen (xscreen));
  
  icon->selection_atom = XInternAtom (DisplayOfScreen (xscreen),
				      buffer, False);
  
  icon->manager_atom = XInternAtom (DisplayOfScreen (xscreen),
				    "MANAGER", False);
  
  icon->system_tray_opcode_atom = XInternAtom (DisplayOfScreen (xscreen),
					       "_NET_SYSTEM_TRAY_OPCODE", False);

  egg_tray_icon_update_manager_window (icon);

  root_window = gdk_screen_get_root_window (gtk_widget_get_screen (GTK_WIDGET (icon)));
  
  /* Add a root window filter so that we get changes on MANAGER */
  gdk_window_add_filter (root_window,
			 egg_tray_icon_manager_filter, icon);
		      
  return icon;
}
开发者ID:czxxjtu,项目名称:wxPython-1,代码行数:48,代码来源:eggtrayicon.c


示例16: gdk_threads_enter

JNIEXPORT void JNICALL
Java_gnu_java_awt_peer_gtk_GtkEmbeddedWindowPeer_construct
  (JNIEnv *env, jobject obj, jlong socket_id)
{
  void *ptr;

  gdk_threads_enter ();

  ptr = gtkpeer_get_widget (env, obj);

  if (GTK_WIDGET_REALIZED (GTK_WIDGET (ptr)))
    g_printerr ("ERROR: GtkPlug is already realized\n");

  gtk_plug_construct (GTK_PLUG (ptr), (GdkNativeWindow) socket_id);

  gdk_threads_leave ();
}
开发者ID:0day-ci,项目名称:gcc,代码行数:17,代码来源:gnu_java_awt_peer_gtk_GtkEmbeddedWindowPeer.c


示例17: lmplayer_interface_set_transient_for

void
lmplayer_interface_set_transient_for (GtkWindow *window, GtkWindow *parent)
{
	if (GTK_IS_PLUG (parent)) {
		GdkWindow *toplevel;

		gtk_widget_realize (GTK_WIDGET (window));
		toplevel = lmplayer_gtk_plug_get_toplevel (GTK_PLUG (parent));
		if (toplevel != NULL) {
			gdk_window_set_transient_for
				(GTK_WIDGET (window)->window, toplevel);
			g_object_unref (toplevel);
		}
	} else {
		gtk_window_set_transient_for (GTK_WINDOW (window),
				GTK_WINDOW (parent));
	}
}
开发者ID:kelvenxu,项目名称:littlepudding,代码行数:18,代码来源:lmplayer-interface.c


示例18: PLATFORM

void NetscapePluginX11::geometryDidChange()
{
    if (m_plugin.isWindowed()) {
        uint64_t windowID = 0;
#if PLATFORM(GTK)
        windowID = static_cast<uint64_t>(GDK_WINDOW_XID(gtk_plug_get_socket_window(GTK_PLUG(m_platformPluginWidget))));
#endif
        m_plugin.controller()->windowedPluginGeometryDidChange(m_plugin.frameRectInWindowCoordinates(), m_plugin.clipRect(), windowID);
        return;
    }

    m_drawable.reset();
    if (m_plugin.size().isEmpty())
        return;

    m_drawable = XCreatePixmap(x11HostDisplay(), rootWindowID(), m_plugin.size().width(), m_plugin.size().height(), displayDepth());
    XSync(x11HostDisplay(), false); // Make sure that the server knows about the Drawable.
}
开发者ID:aShinjiroUrata,项目名称:webkit,代码行数:18,代码来源:NetscapePluginX11.cpp


示例19: egg_tray_icon_new

EggTrayIcon * egg_tray_icon_new (const char *name, GdkPixbuf *pix) {
	EggTrayIcon *icon;
	char buffer[256];
	GdkWindow *root_window;
	Screen *xscreen=DefaultScreenOfDisplay (GDK_DISPLAY());

	g_return_val_if_fail  (pix!= NULL, NULL);

	icon = g_object_new (EGG_TYPE_TRAY_ICON, NULL);
	gtk_window_set_title (GTK_WINDOW (icon), name);

	gtk_plug_construct (GTK_PLUG (icon), 0);
	gtk_widget_realize (GTK_WIDGET (icon));

	icon->ready=FALSE;
	icon->default_pix=pix;

	/* Now see if there's a manager window around */
	g_snprintf (buffer, sizeof (buffer), "_NET_SYSTEM_TRAY_S%d",
			XScreenNumberOfScreen (xscreen));

	icon->selection_atom = XInternAtom (DisplayOfScreen (xscreen),
			buffer, False);

	icon->manager_atom = XInternAtom (DisplayOfScreen (xscreen),
			"MANAGER", False);

	icon->system_tray_opcode_atom = XInternAtom (DisplayOfScreen (xscreen),
			"_NET_SYSTEM_TRAY_OPCODE", False);

	gtk_window_present (GTK_WINDOW (icon));
	egg_tray_icon_update_manager_window (icon);
	root_window = gdk_window_lookup (gdk_x11_get_default_root_xwindow ());

	/* Add a root window filter so that we get changes on MANAGER */
	gdk_window_add_filter (root_window, egg_tray_icon_manager_filter, icon);

	return icon;
}
开发者ID:aufau,项目名称:xqf,代码行数:39,代码来源:trayicon.c


示例20: tray_widget_send_dock_request

static void tray_widget_send_dock_request(struct _tray_widget_icon *widget_icon)
{
	XClientMessageEvent ev;
	ev.type = ClientMessage;
	ev.window =  widget_icon->manager_window;
	ev.message_type = widget_icon->system_tray_opcode_atom;
	ev.format = 32;
	ev.data.l[0] = gdk_x11_get_server_time(GTK_WIDGET(widget_icon)->window);
	ev.data.l[1] = 0;
	ev.data.l[2] = gtk_plug_get_id(GTK_PLUG(widget_icon));
	ev.data.l[3] = 0;
	ev.data.l[4] = 0;

	Display *display = GDK_DISPLAY_XDISPLAY(gtk_widget_get_display(GTK_WIDGET(widget_icon)));

	gdk_error_trap_push();

	XSendEvent(display, widget_icon->manager_window, False, NoEventMask, (XEvent *) &ev);
	XSync(display, False);

	gdk_error_trap_pop();
}
开发者ID:voidptr,项目名称:xneur-option,代码行数:22,代码来源:tray_widget.c



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


鲜花

握手

雷人

路过

鸡蛋
该文章已有0人参与评论

请发表评论

全部评论

专题导读
上一篇:
C++ GTK_PROGRESS_BAR函数代码示例发布时间:2022-05-30
下一篇:
C++ GTK_PIZZA函数代码示例发布时间:2022-05-30
热门推荐
阅读排行榜

扫描微信二维码

查看手机版网站

随时了解更新最新资讯

139-2527-9053

在线客服(服务时间 9:00~18:00)

在线QQ客服
地址:深圳市南山区西丽大学城创智工业园
电邮:jeky_zhao#qq.com
移动电话:139-2527-9053

Powered by 互联科技 X3.4© 2001-2213 极客世界.|Sitemap