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

C++ GTK_SOCKET函数代码示例

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

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



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

示例1: gtk_xtbin_realize

static void
gtk_xtbin_realize (GtkWidget *widget)
{
  GtkXtBin     *xtbin;
  GtkAllocation allocation = { 0, 0, 200, 200 };
#if GTK_CHECK_VERSION(2, 18, 0)
  GtkAllocation widget_allocation;
#endif

#ifdef DEBUG_XTBIN
  printf("gtk_xtbin_realize()\n");
#endif

  g_return_if_fail (GTK_IS_XTBIN (widget));

  xtbin = GTK_XTBIN (widget);

  /* caculate the allocation before realize */
#if GTK_CHECK_VERSION(2, 24, 0)
  allocation.width = gdk_window_get_width(xtbin->parent_window);
  allocation.height = gdk_window_get_height(xtbin->parent_window);
#else
  gint  x, y, w, h, d; /* geometry of window */
  gdk_window_get_geometry(xtbin->parent_window, &x, &y, &w, &h, &d);
  allocation.width = w;
  allocation.height = h;
#endif
  gtk_widget_size_allocate (widget, &allocation);

#ifdef DEBUG_XTBIN
  printf("initial allocation %d %d %d %d\n", x, y, w, h);
#endif

#if GTK_CHECK_VERSION(2, 18, 0)
  gtk_widget_get_allocation(widget, &widget_allocation);
  xtbin->width = widget_allocation.width;
  xtbin->height = widget_allocation.height;
#else
  xtbin->width = widget->allocation.width;
  xtbin->height = widget->allocation.height;
#endif

  /* use GtkSocket's realize */
  (*GTK_WIDGET_CLASS(parent_class)->realize)(widget);

  /* create the Xt client widget */
  xt_client_create(&(xtbin->xtclient), 
       gtk_socket_get_id(GTK_SOCKET(xtbin)), 
       xtbin->height, 
       xtbin->width);
  xtbin->xtwindow = XtWindow(xtbin->xtclient.child_widget);

  gdk_flush();

  /* now that we have created the xt client, add it to the socket. */
  gtk_socket_add_id(GTK_SOCKET(widget), xtbin->xtwindow);
}
开发者ID:0omega,项目名称:platform_external_webkit,代码行数:57,代码来源:gtk2xtbin.c


示例2: awn_ua_alignment_add_id

GdkWindow *
awn_ua_alignment_add_id (AwnUAAlignment *self,GdkNativeWindow native_window)
{
  GdkWindow * plugwin;
  AwnUAAlignmentPrivate *priv;

  priv =  AWN_UA_ALIGNMENT_GET_PRIVATE (self); 
  gtk_socket_add_id (GTK_SOCKET(priv->socket), native_window);
  plugwin = gtk_socket_get_plug_window (GTK_SOCKET(priv->socket));
  g_signal_connect (priv->socket,"plug-removed",
                    G_CALLBACK(awn_ua_alignment_plug_removed),self);
  gtk_widget_realize (priv->socket);
  gtk_widget_show_all (priv->socket);
  return plugwin;
}
开发者ID:Sprezzatech,项目名称:avant-window-navigator,代码行数:15,代码来源:awn-ua-alignment.c


示例3: gnoclSocketCmd

/***f* socket/gnoclSocketCmd
 * AUTHOR
 *	PGB
 * SOURCE
 */
int gnoclSocketCmd ( ClientData data, Tcl_Interp *interp,
					 int objc, Tcl_Obj * const objv[] )
{
	int       ret;
	GtkSocket *socket;

	if ( gnoclParseOptions ( interp, objc, objv, socketOptions ) != TCL_OK )
	{
		gnoclClearOptions ( socketOptions );
		return TCL_ERROR;
	}

	socket = GTK_SOCKET ( gtk_socket_new() );

	gtk_widget_show ( GTK_WIDGET ( socket ) );

	ret = gnoclSetOptions ( interp, socketOptions, G_OBJECT ( socket ), -1 );

	if ( ret == TCL_OK )
		ret = configure ( interp, socket, socketOptions );

	gnoclClearOptions ( socketOptions );

	if ( ret != TCL_OK )
	{
		gtk_widget_destroy ( GTK_WIDGET ( socket ) );
		return TCL_ERROR;
	}

	return gnoclRegisterWidget ( interp, GTK_WIDGET ( socket ), socketFunc );
}
开发者ID:zdia,项目名称:gnocl,代码行数:36,代码来源:socket.c


示例4: setup_new_socket_for_plug

void
setup_new_socket_for_plug(struct Gtkabber *gtkabber)
{
	struct ContainerData *cd;
	static int __id;

	{
		cd = malloc( sizeof *cd );
		if (cd == NULL)
		{
			fprintf( stderr, "Can't malloc() *cd\n" );
			exit( EXIT_FAILURE );
		}
		memset( cd, '\0', sizeof *cd );
	}

	cd->id = ++__id;
	cd->socket = gtk_socket_new();

	new_tab_page( gtkabber, GTK_WIDGET(cd->socket) );

	cd->xwin_id = gtk_socket_get_id( GTK_SOCKET( cd->socket ) );
	gtkabber->toplevel.next_socket_id = cd->xwin_id;

	gtkabber->socket_list = g_list_append( gtkabber->socket_list,
			(gpointer)cd );
}
开发者ID:ThomasAdam,项目名称:Gtkabber,代码行数:27,代码来源:gtkabber.c


示例5: g_strdup

UzblInstance::UzblInstance(const char* u, const char* mainfifo, GtkNotebook* n, GtkTreeRowReference* r)
{
    //id = ID++;
    url = g_strdup(u);
    title = g_strdup("...");
        
    /*sprintf(fifopath, "/tmp/uzbl_fifo_%s", fifo);
    sprintf(sockpath, "/tmp/uzbl_socket_%s", fifo);*/
    
    row = r;
    notebook = n;
    children = NULL;
    
    socket = GTK_SOCKET(gtk_socket_new());
    //gtk_widget_set_can_focus(GTK_WIDGET(socket), false);
    gtk_notebook_append_page(notebook, GTK_WIDGET(socket), NULL);
    //gtk_widget_show_all(GTK_WIDGET(notebook));
    gtk_widget_show(GTK_WIDGET(socket));

    int rn = rand();
    sprintf(name, "%d", rn &0x7FFFFFFF);

    char cmd[1024];
    sprintf(cmd, "uzbl-browser tab %d %s %s \"%s\"",
                 gtk_socket_get_id(socket), name, mainfifo, u);
    
    printf("%s\n", cmd);
    g_spawn_command_line_async(cmd, NULL);
}
开发者ID:pawelz,项目名称:uzblstuff,代码行数:29,代码来源:uzblinstance.cpp


示例6: printf

nsresult nsPluginNativeWindowGtk2::CallSetWindow(nsCOMPtr<nsIPluginInstance> &aPluginInstance)
{
  if(aPluginInstance) {
    nsresult rv;
    PRBool val = PR_FALSE;
    if(!mGtkSocket) {
      if (CanGetValueFromPlugin(aPluginInstance))
        rv = aPluginInstance->GetValue
               ((nsPluginInstanceVariable)NPPVpluginNeedsXEmbed, &val);
    }
#ifdef DEBUG
    printf("nsPluginNativeWindowGtk2: NPPVpluginNeedsXEmbed=%d\n", val);
#endif
    if(val) {
      CreateXEmbedWindow();
    }

    if(mGtkSocket) {
      // Make sure to resize and re-place the window if required
      SetAllocation();
      window = (nsPluginPort *)gtk_socket_get_id(GTK_SOCKET(mGtkSocket));
    }
#ifdef DEBUG
    printf("nsPluginNativeWindowGtk2: call SetWindow with xid=%p\n", (void *)window);
#endif
    aPluginInstance->SetWindow(this);
  }
  else if (mPluginInstance)
    mPluginInstance->SetWindow(nsnull);

  SetPluginInstance(aPluginInstance);
  return NS_OK;
}
开发者ID:rn10950,项目名称:RetroZilla,代码行数:33,代码来源:nsPluginNativeWindowGtk2.cpp


示例7: m_plugin

NetscapePluginX11::NetscapePluginX11(NetscapePlugin& plugin, Display* display, uint64_t windowID)
    : m_plugin(plugin)
    , m_pluginDisplay(display)
    , m_windowID(windowID)
{
    // It seems flash needs the socket to be in the same process,
    // I guess it uses gdk_window_lookup(), so we create a new socket here
    // containing a plug with the UI process socket embedded.
    m_platformPluginWidget = gtk_plug_new(static_cast<Window>(windowID));

    // Hide the GtkPlug on delete-event since we assume the widget is valid while the plugin is active.
    // platformDestroy() will be called anyway right after the delete-event.
    g_signal_connect(m_platformPluginWidget, "delete-event", G_CALLBACK(gtk_widget_hide_on_delete), nullptr);

    GtkWidget* socket = gtk_socket_new();
    // Do not show the plug widget until the socket is connected.
    g_signal_connect_swapped(socket, "plug-added", G_CALLBACK(gtk_widget_show), m_platformPluginWidget);
    g_signal_connect(socket, "plug-removed", G_CALLBACK(socketPlugRemovedCallback), nullptr);
    gtk_container_add(GTK_CONTAINER(m_platformPluginWidget), socket);
    gtk_widget_show(socket);

    Display* hostDisplay = x11HostDisplay();
    m_npWindowID = gtk_socket_get_id(GTK_SOCKET(socket));
    GdkWindow* window = gtk_widget_get_window(socket);
    m_setWindowCallbackStruct.display = GDK_WINDOW_XDISPLAY(window);
    m_setWindowCallbackStruct.visual = GDK_VISUAL_XVISUAL(gdk_window_get_visual(window));
    m_setWindowCallbackStruct.depth = gdk_visual_get_depth(gdk_window_get_visual(window));
    m_setWindowCallbackStruct.colormap = XCreateColormap(hostDisplay, GDK_ROOT_WINDOW(), m_setWindowCallbackStruct.visual, AllocNone);

    XFlush(hostDisplay);
}
开发者ID:aShinjiroUrata,项目名称:webkit,代码行数:31,代码来源:NetscapePluginX11.cpp


示例8: egg_tray_manager_handle_dock_request

static void
egg_tray_manager_handle_dock_request (EggTrayManager       *manager,
				      XClientMessageEvent  *xevent)
{
  GtkWidget *socket;
  Window *window;
  
  socket = gtk_socket_new ();
  
  /* We need to set the child window here
   * so that the client can call _get functions
   * in the signal handler
   */
  window = g_new (Window, 1);
  *window = xevent->data.l[2];
      
  g_object_set_data_full (G_OBJECT (socket),
			  "egg-tray-child-window",
			  window, g_free);
  g_signal_emit (manager, manager_signals[TRAY_ICON_ADDED], 0,
		 socket);

  /* Add the socket only if it's been attached */
  if (GTK_IS_WINDOW (gtk_widget_get_toplevel (GTK_WIDGET (socket))))
    {
      g_signal_connect (socket, "plug_removed",
			G_CALLBACK (egg_tray_manager_plug_removed), manager);
      
      gtk_socket_add_id (GTK_SOCKET (socket), xevent->data.l[2]);

      g_hash_table_insert (manager->socket_table, GINT_TO_POINTER (xevent->data.l[2]), socket);
    }
  else
    gtk_widget_destroy (socket);
}
开发者ID:BackupTheBerlios,项目名称:fbpanel-svn,代码行数:35,代码来源:eggtraymanager.c


示例9: gdk_window_lookup

nsresult nsPluginNativeWindowGtk2::CreateXEmbedWindow() {
  if(!mGtkSocket) {
    GdkWindow *win = gdk_window_lookup((XID)window);
    mGtkSocket = gtk_socket_new();

    //attach the socket to the container widget
    gtk_widget_set_parent_window(mGtkSocket, win);

    // Make sure to handle the plug_removed signal.  If we don't the
    // socket will automatically be destroyed when the plug is
    // removed, which means we're destroying it more than once.
    // SYNTAX ERROR.
    g_signal_connect(mGtkSocket, "plug_removed",
                     G_CALLBACK(plug_removed_cb), NULL);

    gpointer user_data = NULL;
    gdk_window_get_user_data(win, &user_data);

    GtkContainer *container = GTK_CONTAINER(user_data);
    gtk_container_add(container, mGtkSocket);
    gtk_widget_realize(mGtkSocket);

    // Resize before we show
    SetAllocation();

    gtk_widget_show(mGtkSocket);

    gdk_flush();
    window = (nsPluginPort *)gtk_socket_get_id(GTK_SOCKET(mGtkSocket));
  }

  return NS_OK;
}
开发者ID:rn10950,项目名称:RetroZilla,代码行数:33,代码来源:nsPluginNativeWindowGtk2.cpp


示例10: na_tray_manager_handle_dock_request

static void
na_tray_manager_handle_dock_request (NaTrayManager       *manager,
				     XClientMessageEvent *xevent)
{
  Window icon_window = xevent->data.l[2];
  GtkWidget *child;

  if (g_hash_table_lookup (manager->socket_table,
                           GINT_TO_POINTER (icon_window)))
    {
      /* We already got this notification earlier, ignore this one */
      return;
    }

  child = na_tray_child_new (manager->screen, icon_window);
  if (child == NULL) /* already gone or other error */
    return;

  g_signal_emit (manager, manager_signals[TRAY_ICON_ADDED], 0,
		 child);

  /* If the child wasn't attached, then destroy it */

  if (!GTK_IS_WINDOW (gtk_widget_get_toplevel (GTK_WIDGET (child))))
    {
      gtk_widget_destroy (child);
      return;
    }

  g_signal_connect (child, "plug_removed",
		    G_CALLBACK (na_tray_manager_plug_removed), manager);

  gtk_socket_add_id (GTK_SOCKET (child), icon_window);

  if (!GTK_SOCKET (child)->plug_window)
    {
      /* Embedding failed, we won't get a plug-removed signal */
      g_signal_emit (manager, manager_signals[TRAY_ICON_REMOVED], 0, child);
      gtk_widget_destroy (child);
      return;
    }

  g_hash_table_insert (manager->socket_table,
                       GINT_TO_POINTER (icon_window), child);
  gtk_widget_show (child);
}
开发者ID:MarkieMark,项目名称:gnome-shell,代码行数:46,代码来源:na-tray-manager.c


示例11: NS_ASSERTION

nsresult nsPluginNativeWindowGtk2::CreateXEmbedWindow() {
  NS_ASSERTION(!mSocketWidget,"Already created a socket widget!");

  GdkWindow *parent_win = gdk_window_lookup((XID)window);
  mSocketWidget = gtk_socket_new();

  //attach the socket to the container widget
  gtk_widget_set_parent_window(mSocketWidget, parent_win);

  // Make sure to handle the plug_removed signal.  If we don't the
  // socket will automatically be destroyed when the plug is
  // removed, which means we're destroying it more than once.
  // SYNTAX ERROR.
  g_signal_connect(mSocketWidget, "plug_removed",
                   G_CALLBACK(plug_removed_cb), NULL);

  g_signal_connect(mSocketWidget, "unrealize",
                   G_CALLBACK(socket_unrealize_cb), NULL);

  g_signal_connect(mSocketWidget, "destroy",
                   G_CALLBACK(gtk_widget_destroyed), &mSocketWidget);

  gpointer user_data = NULL;
  gdk_window_get_user_data(parent_win, &user_data);

  GtkContainer *container = GTK_CONTAINER(user_data);
  gtk_container_add(container, mSocketWidget);
  gtk_widget_realize(mSocketWidget);

  // The GtkSocket has a visible window, but the plugin's XEmbed plug will
  // cover this window.  Normally GtkSockets let the X server paint their
  // background and this would happen immediately (before the plug is
  // created).  Setting the background to None prevents the server from
  // painting this window, avoiding flicker.
  gdk_window_set_back_pixmap(mSocketWidget->window, NULL, FALSE);

  // Resize before we show
  SetAllocation();

  gtk_widget_show(mSocketWidget);

  gdk_flush();
  window = (void*)gtk_socket_get_id(GTK_SOCKET(mSocketWidget));

  // Fill out the ws_info structure.
  // (The windowless case is done in nsObjectFrame.cpp.)
  GdkWindow *gdkWindow = gdk_window_lookup((XID)window);
  if(!gdkWindow)
    return NS_ERROR_FAILURE;

  mWsInfo.display = GDK_WINDOW_XDISPLAY(gdkWindow);
  mWsInfo.colormap = GDK_COLORMAP_XCOLORMAP(gdk_drawable_get_colormap(gdkWindow));
  GdkVisual* gdkVisual = gdk_drawable_get_visual(gdkWindow);
  mWsInfo.visual = GDK_VISUAL_XVISUAL(gdkVisual);
  mWsInfo.depth = gdkVisual->depth;

  return NS_OK;
}
开发者ID:Akin-Net,项目名称:mozilla-central,代码行数:58,代码来源:nsPluginNativeWindowGtk2.cpp


示例12: printf

nsresult nsPluginNativeWindowGtk2::CallSetWindow(nsRefPtr<nsNPAPIPluginInstance> &aPluginInstance)
{
  if (aPluginInstance) {
    if (type == NPWindowTypeWindow) {
      if (!mSocketWidget) {
        nsresult rv;

        PRBool needXEmbed = PR_FALSE;
        rv = aPluginInstance->GetValueFromPlugin(NPPVpluginNeedsXEmbed, &needXEmbed);
        // If the call returned an error code make sure we still use our default value.
        if (NS_FAILED(rv)) {
          needXEmbed = PR_FALSE;
        }
#ifdef DEBUG
        printf("nsPluginNativeWindowGtk2: NPPVpluginNeedsXEmbed=%d\n", needXEmbed);
#endif

        if (needXEmbed) {
          rv = CreateXEmbedWindow();
        }
        else {
          rv = CreateXtWindow();
        }

        if (NS_FAILED(rv)) {
          return NS_ERROR_FAILURE;
        }
      }

      if (!mSocketWidget) {
        return NS_ERROR_FAILURE;
      }

      // Make sure to resize and re-place the window if required.
      // Need to reset "window" each time as nsObjectFrame::DidReflow sets it
      // to the ancestor window.
      if (GTK_IS_XTBIN(mSocketWidget)) {
        gtk_xtbin_resize(mSocketWidget, width, height);
        // Point the NPWindow structures window to the actual X window
        window = (void*)GTK_XTBIN(mSocketWidget)->xtwindow;
      }
      else { // XEmbed
        SetAllocation();
        window = (void*)gtk_socket_get_id(GTK_SOCKET(mSocketWidget));
      }
#ifdef DEBUG
      printf("nsPluginNativeWindowGtk2: call SetWindow with xid=%p\n", (void *)window);
#endif
    } // NPWindowTypeWindow
    aPluginInstance->SetWindow(this);
  }
  else if (mPluginInstance)
    mPluginInstance->SetWindow(nsnull);

  SetPluginInstance(aPluginInstance);
  return NS_OK;
}
开发者ID:Akin-Net,项目名称:mozilla-central,代码行数:57,代码来源:nsPluginNativeWindowGtk2.cpp


示例13: GTK_SOCKET

void MCNativeLayerX11::doAttach()
{
    if (m_socket == NULL)
    {
        // Create a new GTK socket to deal with the XEMBED protocol
        GtkSocket *t_socket;
		t_socket = GTK_SOCKET(gtk_socket_new());
        
        // Create a new GTK window to hold the socket
        MCRectangle t_rect;
        t_rect = m_object->getrect();
        m_child_window = GTK_WINDOW(gtk_window_new(GTK_WINDOW_POPUP));
        gtk_widget_set_parent_window(GTK_WIDGET(m_child_window), getStackGdkWindow());
        gtk_widget_realize(GTK_WIDGET(m_child_window));
        gdk_window_reparent(gtk_widget_get_window(GTK_WIDGET(m_child_window)), getStackGdkWindow(), t_rect.x, t_rect.y);
        
        // Add the socket to the window
        gtk_container_add(GTK_CONTAINER(m_child_window), GTK_WIDGET(t_socket));
        
        // The socket needs to be realised before going any further or any
        // operations on it will fail.
        gtk_widget_realize(GTK_WIDGET(t_socket));
        
        // Show the socket (we'll control visibility at the window level)
        gtk_widget_show(GTK_WIDGET(t_socket));
        
        // Create an empty region to act as an input mask while in edit mode
        m_input_shape = gdk_region_new();

		// Retain a reference to the socket
		m_socket = GTK_SOCKET(g_object_ref(G_OBJECT(t_socket)));
    }
    
    // Attach the X11 window to this socket
    if (gtk_socket_get_plug_window(m_socket) == NULL)
        gtk_socket_add_id(m_socket, m_widget_xid);
    //fprintf(stderr, "XID: %u\n", gtk_socket_get_id(m_socket));
    
    // Act as if there were a re-layer to put the widget in the right place
    doRelayer();
    doSetViewportGeometry(m_viewport_rect);
    doSetGeometry(m_rect);
    doSetVisible(ShouldShowLayer());
}
开发者ID:soapdog,项目名称:livecode,代码行数:44,代码来源:native-layer-x11.cpp


示例14: printf

nsresult nsPluginNativeWindowGtk2::CallSetWindow(nsCOMPtr<nsIPluginInstance> &aPluginInstance)
{
  if(aPluginInstance) {
    if (type == nsPluginWindowType_Window) {
      nsresult rv;
      if(!mSocketWidget) {
        PRBool needXEmbed = PR_FALSE;
        if (CanGetValueFromPlugin(aPluginInstance)) {
          rv = aPluginInstance->GetValue
            ((nsPluginInstanceVariable)NPPVpluginNeedsXEmbed, &needXEmbed);
#ifdef DEBUG
          printf("nsPluginNativeWindowGtk2: NPPVpluginNeedsXEmbed=%d\n", needXEmbed);
#endif
        }
        nsresult rv;
        if(needXEmbed) {
#ifdef MOZ_COMPOSITED_PLUGINS
          rv = CreateXCompositedWindow();
#else
          rv = CreateXEmbedWindow();
#endif
        }
        else {
          rv = CreateXtWindow();
        }
        if(NS_FAILED(rv))
          return NS_ERROR_FAILURE;
      }

      if(!mSocketWidget)
        return NS_ERROR_FAILURE;

      // Make sure to resize and re-place the window if required.
      // Need to reset "window" each time as nsObjectFrame::DidReflow sets it
      // to the ancestor window.
      if(GTK_IS_XTBIN(mSocketWidget)) {
        gtk_xtbin_resize(mSocketWidget, width, height);
        // Point the NPWindow structures window to the actual X window
        window = (nsPluginPort *)GTK_XTBIN(mSocketWidget)->xtwindow;
      }
      else { // XEmbed
        SetAllocation();
        window = (nsPluginPort *)gtk_socket_get_id(GTK_SOCKET(mSocketWidget));
      }
#ifdef DEBUG
      printf("nsPluginNativeWindowGtk2: call SetWindow with xid=%p\n", (void *)window);
#endif
    } // nsPluginWindowType_Window
    aPluginInstance->SetWindow(this);
  }
  else if (mPluginInstance)
    mPluginInstance->SetWindow(nsnull);

  SetPluginInstance(aPluginInstance);
  return NS_OK;
}
开发者ID:amyvmiwei,项目名称:firefox,代码行数:56,代码来源:nsPluginNativeWindowGtk2.cpp


示例15: main

int main(int argc, char **argv)
{
  GtkWidget *window, *button, *textview, *vbox;
  GtkWidget *socket, *plug, *socket_box;

  unsigned long     kb_xid;

  gtk_init (&argc, &argv);

  install_signal_handlers();

  kb_xid = launch_keyboard();

  if (!kb_xid)
    {
      perror ("### 'matchbox-keyboard --xid', failed to return valid window ID. ### ");
      exit(-1);
    }

  /* Window */

  window = gtk_window_new (GTK_WINDOW_TOPLEVEL);

  gtk_window_set_default_size (GTK_WINDOW (window), 640, 480);
  gtk_container_set_border_width (GTK_CONTAINER (window), 10);

  g_signal_connect (G_OBJECT (window), "destroy",
		    G_CALLBACK (widget_destroy), NULL);

  /* Container and textview */

  vbox = gtk_vbox_new(FALSE, 5);
  gtk_container_add (GTK_CONTAINER (window), vbox);
  
  textview = gtk_text_view_new();
  gtk_box_pack_start (GTK_BOX(vbox), textview, TRUE, TRUE, 2);

  /* Socket ( XEMBED ) stuff */

  socket_box = gtk_event_box_new ();
  gtk_widget_show (socket_box);
  
  socket = gtk_socket_new ();

  gtk_container_add (GTK_CONTAINER (socket_box), socket);
  gtk_box_pack_start (GTK_BOX (vbox), GTK_WIDGET(socket_box), TRUE, TRUE, 0);
  gtk_socket_add_id(GTK_SOCKET(socket), kb_xid); 

  /* FIXME: handle "plug-added" & "plug-removed" signals for socket */

  gtk_widget_show_all (window);

  gtk_main ();

  return 0;
}
开发者ID:bfabiszewski,项目名称:matchbox-keyboard,代码行数:56,代码来源:matchbox-keyboard-gtk-embed.c


示例16: luaH_socket_newindex

static gint
luaH_socket_newindex(lua_State *L, luapdf_token_t token)
{
    widget_t *w = luaH_checkwidget(L, 1);
    if (token == L_TK_ID) {
        gint id = luaL_checkint(L, 2);
        gtk_socket_add_id(GTK_SOCKET(w->widget), (GdkNativeWindow) id);
    }
    return 0;
}
开发者ID:karottenreibe,项目名称:luapdf,代码行数:10,代码来源:socket.c


示例17: luaH_socket_index

static gint
luaH_socket_index(lua_State *L, luapdf_token_t token)
{
    widget_t *w = luaH_checkwidget(L, 1);

    switch(token)
    {
      LUAPDF_WIDGET_INDEX_COMMON

      /* push integer methods */
      PI_CASE(ID,      (int) gtk_socket_get_id(GTK_SOCKET(w->widget)))
      /* push boolean methods */
      PB_CASE(PLUGGED, gtk_socket_get_plug_window(GTK_SOCKET(w->widget))!=NULL)

      default:
        break;
    }
    return 0;
}
开发者ID:karottenreibe,项目名称:luapdf,代码行数:19,代码来源:socket.c


示例18: gtk_socket_finalize

static void
gtk_socket_finalize (GObject *object)
{
  GtkSocket *socket = GTK_SOCKET (object);
  GtkSocketPrivate *priv = socket->priv;

  g_object_unref (priv->accel_group);

  G_OBJECT_CLASS (gtk_socket_parent_class)->finalize (object);
}
开发者ID:BYC,项目名称:gtk,代码行数:10,代码来源:gtksocket.c


示例19: add_menubar

static void add_menubar(MacMenu* mmb, WnckWindow* mbarwin)
{
  Window mbar = wnck_window_get_xid(mbarwin);
  GtkWidget* sck = gtk_socket_new();
  g_signal_connect(sck, "destroy", G_CALLBACK(socket_destroyed), mmb);
  gtk_notebook_append_page(mmb->notebook, GTK_WIDGET(sck), NULL);
  gtk_socket_steal(GTK_SOCKET(sck), mbar);
  gtk_widget_show_all(sck);
  g_hash_table_insert(mmb->mbars_scks, (gpointer) mbar, sck);
}
开发者ID:NovaCygni,项目名称:aur-mirror,代码行数:10,代码来源:macmenu-applet.c


示例20: gtk_socket_finalize

static void
gtk_socket_finalize (GObject *object)
{
  GtkSocket *socket = GTK_SOCKET (object);
  
  g_object_unref (socket->accel_group);
  socket->accel_group = NULL;

  G_OBJECT_CLASS (gtk_socket_parent_class)->finalize (object);
}
开发者ID:batman52,项目名称:dingux-code,代码行数:10,代码来源:gtksocket.c



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


鲜花

握手

雷人

路过

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

请发表评论

全部评论

专题导读
上一篇:
C++ GTK_SOURCE_BUFFER函数代码示例发布时间:2022-05-30
下一篇:
C++ GTK_SIGNAL_FUNC函数代码示例发布时间: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