您当前的位置:首页 > IT编程 > C++
| C语言 | Java | VB | VC | python | Android | TensorFlow | C++ | oracle | 学术与代码 | cnn卷积神经网络 | gnn | 图像修复 | Keras | 数据集 | Neo4j | 自然语言处理 | 深度学习 | 医学CAD | 医学影像 | 超参数 | pointnet | pytorch | 异常检测 | Transformers | 情感分类 | 知识图谱 |

自学教程:C++ GDK_WINDOW_XWINDOW函数代码示例

51自学网 2021-06-01 20:50:11
  C++
这篇教程C++ GDK_WINDOW_XWINDOW函数代码示例写得很实用,希望能帮到您。

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

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

示例1: InitGroupLeader

static gbooleanInitGroupLeader(Window *groupLeader,                Window *rootWindow){   Window myGroupLeader;   Window myRootWindow;   XSetWindowAttributes attr;   GdkDisplay *gdkDisplay;   GdkWindow *gdkLeader;   attr.override_redirect = True;   ASSERT(groupLeader);   ASSERT(rootWindow);   gdkDisplay = gdk_display_get_default();   gdkLeader = gdk_display_get_default_group(gdkDisplay);   myGroupLeader = GDK_WINDOW_XWINDOW(gdkLeader);   myRootWindow = GDK_ROOT_WINDOW();   ASSERT(myGroupLeader);   ASSERT(myRootWindow);   /* XXX: With g_set_prgname() being called, this can probably go away. */   XStoreName(GDK_DISPLAY(), myGroupLeader, VMUSER_TITLE);   /*    * Sanity check:  Set the override redirect property on our group leader    * window (not default), then re-parent it to the root window (default).    * This makes sure that (a) a window manager can't re-parent our window,    * and (b) that we remain a top-level window.    */   XChangeWindowAttributes(GDK_DISPLAY(), myGroupLeader, CWOverrideRedirect,                           &attr);   XReparentWindow(GDK_DISPLAY(), myGroupLeader, myRootWindow, 10, 10);   XSync(GDK_DISPLAY(), FALSE);   *groupLeader = myGroupLeader;   *rootWindow = myRootWindow;   return TRUE;}
开发者ID:SvenDowideit,项目名称:open-vm-tools,代码行数:42,


示例2: na_tray_child_force_redraw

/* If we are faking transparency with a window-relative background, force a * redraw of the icon. This should be called if the background changes or if * the child is shifted with respect to the background. */voidna_tray_child_force_redraw (NaTrayChild *child){  GtkWidget *widget = GTK_WIDGET (child);  if (GTK_WIDGET_MAPPED (child) && child->parent_relative_bg)    {#if 1      /* Sending an ExposeEvent might cause redraw problems if the       * icon is expecting the server to clear-to-background before       * the redraw. It should be ok for GtkStatusIcon or EggTrayIcon.       */      Display *xdisplay = GDK_DISPLAY_XDISPLAY (gtk_widget_get_display (widget));      XEvent xev;      xev.xexpose.type = Expose;      xev.xexpose.window = GDK_WINDOW_XWINDOW (GTK_SOCKET (child)->plug_window);      xev.xexpose.x = 0;      xev.xexpose.y = 0;      xev.xexpose.width = widget->allocation.width;      xev.xexpose.height = widget->allocation.height;      xev.xexpose.count = 0;      gdk_error_trap_push ();      XSendEvent (GDK_DISPLAY_XDISPLAY (gtk_widget_get_display (widget)),                  xev.xexpose.window,                  False, ExposureMask,                  &xev);      /* We have to sync to reliably catch errors from the XSendEvent(),       * since that is asynchronous.       */      XSync (xdisplay, False);      gdk_error_trap_pop ();#else      /* Hiding and showing is the safe way to do it, but can result in more       * flickering.       */      gdk_window_hide (widget->window);      gdk_window_show (widget->window);#endif    }}
开发者ID:RainCT,项目名称:gnome-shell,代码行数:46,


示例3: screenAvailableRect

FloatRect screenAvailableRect(Widget* widget){    if (!widget)        return FloatRect();#if PLATFORM(X11)    GtkWidget* container = GTK_WIDGET(widget->root()->hostWindow()->platformPageClient());    if (!container)        return FloatRect();    if (!gtk_widget_get_realized(container))        return screenRect(widget);    GdkDrawable* rootWindow = GDK_DRAWABLE(gtk_widget_get_root_window(container));    GdkDisplay* display = gdk_drawable_get_display(rootWindow);    Atom xproperty = gdk_x11_get_xatom_by_name_for_display(display, "_NET_WORKAREA");    Atom retType;    int retFormat;    long *workAreaPos = NULL;    unsigned long retNItems;    unsigned long retAfter;    int xRes = XGetWindowProperty(GDK_DISPLAY_XDISPLAY(display), GDK_WINDOW_XWINDOW(rootWindow), xproperty,        0, 4, FALSE, XA_CARDINAL, &retType, &retFormat, &retNItems, &retAfter, (guchar**)&workAreaPos);    FloatRect rect;    if (xRes == Success && workAreaPos != NULL && retType == XA_CARDINAL && retNItems == 4 && retFormat == 32) {        rect = FloatRect(workAreaPos[0], workAreaPos[1], workAreaPos[2], workAreaPos[3]);        // rect contains the available space in the whole screen not just in the monitor        // containing the widget, so we intersect it with the monitor rectangle.        rect.intersect(screenRect(widget));    } else        rect = screenRect(widget);    if (workAreaPos)        XFree(workAreaPos);    return rect;#else    return screenRect(widget);#endif}
开发者ID:azrul2202,项目名称:WebKit-Smartphone,代码行数:42,


示例4: wxControl

/* OGLCanvas::OGLCanvas * OGLCanvas class constructor, SFML implementation *******************************************************************/OGLCanvas::OGLCanvas(wxWindow* parent, int id, bool handle_timer): wxControl(parent, id, wxDefaultPosition, wxDefaultSize, wxBORDER_NONE|wxWANTS_CHARS), timer(this) {	init_done = false;	last_time = theApp->runTimer();	if (handle_timer)		timer.Start(100);	// Code taken from SFML wxWidgets integration example	sf::WindowHandle handle;#ifdef __WXGTK__	// GTK implementation requires to go deeper to find the	// low-level X11 identifier of the widget	gtk_widget_realize(m_wxwindow);	gtk_widget_set_double_buffered(m_wxwindow, false);	GdkWindow* Win = gtk_widget_get_window(m_wxwindow);	XFlush(GDK_WINDOW_XDISPLAY(Win));	//sf::RenderWindow::Create(GDK_WINDOW_XWINDOW(Win));	handle = GDK_WINDOW_XWINDOW(Win);#else	handle = GetHandle();#endif#if SFML_VERSION_MAJOR < 2	sf::RenderWindow::Create(handle);#else	// Context settings	sf::ContextSettings settings;	settings.depthBits = 32;	settings.stencilBits = 8;	sf::RenderWindow::create(handle, settings);#endif	// Bind events	Bind(wxEVT_PAINT, &OGLCanvas::onPaint, this);	Bind(wxEVT_ERASE_BACKGROUND, &OGLCanvas::onEraseBackground, this);	//Bind(wxEVT_IDLE, &OGLCanvas::onIdle, this);	if (handle_timer)		Bind(wxEVT_TIMER, &OGLCanvas::onTimer, this);}
开发者ID:doomtech,项目名称:slade,代码行数:44,


示例5: drawPixmap

static voiddrawPixmap(PluginInstance *This){    if (nullPluginGdkPixmap)    {        int pixmap_with, pixmap_height, dest_x, dest_y;        gdk_drawable_get_size((GdkWindow *)nullPluginGdkPixmap, &pixmap_with, &pixmap_height);        dest_x = This->width/2 - pixmap_with/2;        dest_y = This->height/2 - pixmap_height/2;        if (dest_x >= 0 && dest_y >= 0)        {#ifdef MOZ_X11            GC gc;            gc = XCreateGC(This->display, This->window, 0, NULL);            XCopyArea(This->display, GDK_WINDOW_XWINDOW(nullPluginGdkPixmap) , This->window, gc,                0, 0, pixmap_with, pixmap_height, dest_x, dest_y);            XFreeGC(This->display, gc);#endif        }    }}
开发者ID:amyvmiwei,项目名称:firefox,代码行数:21,


示例6: b4_handler

void b4_handler(GtkWidget *widget) {  JVMP_DrawingSurfaceInfo w;  if (!jvmp_context) return;  jint containerWindowID = (jint) GDK_WINDOW_XWINDOW(topLevel->window);  w.window =  (JPluginWindow *)containerWindowID;#ifdef XP_UNIX  gdk_flush();#endif  w.x = 0;  w.y = 0;  w.width  = topLevel->allocation.width;  w.height = topLevel->allocation.height;  if ((jvmp_context->JVMP_RegisterWindow)(ctx, &w, &g_wid) != JNI_TRUE) {    jvmp_context->JVMP_GetLastErrorString(ctx, g_errbuf);    fprintf(stderr, "Can/'t register window: %s/n", g_errbuf);    return;  };  fprintf(stderr, "Registed our GTK window with ID %d/n", (int)g_wid);}
开发者ID:binoc-software,项目名称:mozilla-cvs,代码行数:21,


示例7: gtk_sdl_surface_attach

static void gtk_sdl_surface_attach(GtkSDL *sdl){    gchar SDL_windowhack[32];    /* puts ("before sdl surface attach"); */    /* Attach the SDL_Surface */    /* puts ("attaching the surface"); */    sprintf(SDL_windowhack, "SDL_WINDOWID=%ld",            GDK_WINDOW_XWINDOW( GTK_WIDGET(sdl)->window ) );    /* puts(SDL_windowhack); */    putenv(SDL_windowhack);    SDL_QuitSubSystem(SDL_INIT_VIDEO);    /* puts ("before creating new surface"); */    if ( SDL_InitSubSystem ( SDL_INIT_VIDEO ) < 0) {        fprintf (stderr, "unable to init SDL: %s", SDL_GetError() );        return;    }    /* puts ("after creating new surface"); */    if (sdl->flags &= (SDL_OPENGLBLIT | SDL_DOUBLEBUF)) {        SDL_GL_SetAttribute (SDL_GL_DOUBLEBUFFER, 1);    }    if (sdl->surface) {        /* puts ("TODO: deallocate previus surface"); */        SDL_FreeSurface(sdl->surface);    }    sdl->surface = SDL_SetVideoMode(sdl->width, sdl->height, sdl->bpp, sdl->flags);    if (!sdl->surface) {        fprintf (stderr, "Unable to set the video mode: %s", SDL_GetError() );        return;    }    /* puts ("after sdl surface attach"); */}
开发者ID:zenki2001cn,项目名称:SnippetCode,代码行数:40,


示例8: wxControl

/////////////////////////////////////////////////////////////// Construct the wxSFMLCanvas////////////////////////////////////////////////////////////wxSFMLCanvas::wxSFMLCanvas(wxWindow *Parent,                           wxWindowID Id,                           const wxPoint &Position,                           const wxSize &Size,                           long Style)    : wxControl(Parent, Id, Position, Size, Style) {#ifdef __WXGTK__  // GTK implementation requires to go deeper to find the low-level X11  // identifier of the widget  gtk_widget_realize(m_wxwindow);  gtk_widget_set_double_buffered(m_wxwindow, false);  GtkWidget *privHandle = m_wxwindow;  wxPizza *pizza = WX_PIZZA(privHandle);  GtkWidget *widget = GTK_WIDGET(pizza);// Get the internal gtk window...#if GTK_CHECK_VERSION(3, 0, 0)  GdkWindow *win = gtk_widget_get_window(widget);#else  GdkWindow *win = widget->window;#endif  XFlush(GDK_WINDOW_XDISPLAY(win));//...and pass it to the sf::RenderWindow.#if GTK_CHECK_VERSION(3, 0, 0)  sf::RenderWindow::create(GDK_WINDOW_XID(win));#else  sf::RenderWindow::create(GDK_WINDOW_XWINDOW(win));#endif#else  // Tested under Windows XP only (should work with X11 and other Windows  // versions - no idea about MacOS)  sf::RenderWindow::create(static_cast<sf::WindowHandle>(GetHandle()));#endif}
开发者ID:Lizard-13,项目名称:GD,代码行数:43,


示例9: acam_webcam_bus_sync_handler

static GstBusSyncReplyacam_webcam_bus_sync_handler (GstBus *bus, GstMessage *message, acam_webcam_device_s *acam_webcam_device){	GstXOverlay *overlay;	if (GST_MESSAGE_TYPE (message) != GST_MESSAGE_ELEMENT)		return GST_BUS_PASS;	if (!gst_structure_has_name (message->structure, "prepare-xwindow-id"))		return GST_BUS_PASS;	overlay = GST_X_OVERLAY (GST_MESSAGE_SRC (message));	if (g_object_class_find_property (G_OBJECT_GET_CLASS (overlay), "force-aspect-ratio"))		g_object_set (G_OBJECT (overlay), "force-aspect-ratio", TRUE, NULL);	gst_x_overlay_set_xwindow_id (overlay, GDK_WINDOW_XWINDOW (gtk_widget_get_window (acam_webcam_device->video_screen)));	gst_message_unref (message);	return GST_BUS_DROP;}
开发者ID:andypc,项目名称:aCam,代码行数:22,


示例10: startDaemon

		void startDaemon(int daemonPort, bool fullscreen, bool drawIntoRoot, bool disableVideo, bool disableAudio, bool vdpau, signed long xid) {      if(vdpau) {        LOG(INFO) << "Trying to use VDPAU";        factory.getServerTemplates().videoConvert="vdpauvideopostprocess";        factory.getServerTemplates().videoSink="vdpausink name=vpsink";      } else if(xid == -1) {				if(!disableVideo) {					if(!checkXvExtension())						factory.getServerTemplates().videoSink="ximagesink name=vpsink";					if(!drawIntoRoot) {						GtkWidget* gtkWin = makeGtkWindow(fullscreen);						xid = GDK_WINDOW_XWINDOW(gtkWin->window);					} else {						Display* dis = XOpenDisplay(NULL);						xid = RootWindow(dis,0);					}				}			}			CapsServer server(daemonPort);			while (true) {				LOG(INFO) << "Waiting for incoming connection";				ClientInfo ci = server.accept(disableVideo, disableAudio);				LOG(INFO) << "Accepted connection: " << ci.peerAddress;				if (pipeline != NULL && pipeline->isRunning()) {					pipeline->stop();					delete pipeline;				}				pipeline = factory.createServerPipeline(daemonPort, ci);				if(!disableVideo && !vdpau)					pipeline->setXwindowID(xid);				pipeline->play(false);			}		}
开发者ID:kallaballa,项目名称:Cheesy,代码行数:38,


示例11: wxXGetWindowProperty

static bool wxXGetWindowProperty(GdkWindow* window, Atom& type, int& format, gulong& nitems, guchar*& data){    bool success = false;#if GTK_CHECK_VERSION(2, 2, 0)    if (gtk_check_version(2, 2, 0) == NULL)    {        gulong bytes_after;        success = XGetWindowProperty(            GDK_DISPLAY_XDISPLAY(gdk_drawable_get_display(window)),            GDK_WINDOW_XWINDOW(window),            gdk_x11_get_xatom_by_name_for_display(                gdk_drawable_get_display(window),                "_NET_FRAME_EXTENTS"),            0, // left, right, top, bottom, CARDINAL[4]/32            G_MAXLONG, // size of long            false, // do not delete property            XA_CARDINAL, // 32 bit            &type, &format, &nitems, &bytes_after, &data            ) == Success;    }#endif    return success;}
开发者ID:SCP-682,项目名称:Cities3D,代码行数:23,


示例12: egg_tray_manager_set_orientation_property

static voidegg_tray_manager_set_orientation_property (EggTrayManager *manager){#ifdef GDK_WINDOWING_X11  gulong data[1];  if (!manager->invisible || !manager->invisible->window)    return;  g_assert (manager->orientation_atom != None);  data[0] = manager->orientation == GTK_ORIENTATION_HORIZONTAL ?		SYSTEM_TRAY_ORIENTATION_HORZ :		SYSTEM_TRAY_ORIENTATION_VERT;  XChangeProperty (GDK_WINDOW_XDISPLAY (manager->invisible->window),		   GDK_WINDOW_XWINDOW (manager->invisible->window),		   manager->orientation_atom,		   XA_CARDINAL, 32,		   PropModeReplace,		   (guchar *) &data, 1);#endif}
开发者ID:micove,项目名称:awn-extras,代码行数:23,


示例13: set_desktop_window_id

static voidset_desktop_window_id (CajaDesktopWindow *window,                       GdkWindow             *gdkwindow){    /* Tuck the desktop windows xid in the root to indicate we own the desktop.     */    Window window_xid;    GdkWindow *root_window;    root_window = gdk_screen_get_root_window (                      gtk_window_get_screen (GTK_WINDOW (window)));#if GTK_CHECK_VERSION (3, 0, 0)    window_xid = GDK_WINDOW_XID (gdkwindow);#else    window_xid = GDK_WINDOW_XWINDOW (gdkwindow);#endif    gdk_property_change (root_window,                         gdk_atom_intern ("CAJA_DESKTOP_WINDOW_ID", FALSE),                         gdk_x11_xatom_to_atom (XA_WINDOW), 32,                         GDK_PROP_MODE_REPLACE, (guchar *) &window_xid, 1);}
开发者ID:City-busz,项目名称:caja,代码行数:23,


示例14: init_composite

gbooleaninit_composite (void){  Display *display;  display = gdk_x11_get_default_xdisplay ();  // First, check the Composite extension, then the Render extension.  int error_base;  int event_base;  int version_major;  int version_minor;  if (!XCompositeQueryExtension (display, &event_base, &error_base)) {    return FALSE;  }  // We need at least version 0.2, for XCompositeNameWindowPixmap.  XCompositeQueryVersion (display, &version_major, &version_minor);  if (version_major <= 0 && version_minor < 2) {    return FALSE;  }  if (!XRenderQueryExtension (display, &event_base, &error_base)) {    return FALSE;  }  // We need at least version 0.6, for XRenderSetPictureTransform.  XRenderQueryVersion (display, &version_major, &version_minor);  if (version_major <= 0 && version_minor < 6) {    return FALSE;  }  XCompositeRedirectSubwindows (display,      GDK_WINDOW_XWINDOW (gdk_get_default_root_window ()),      CompositeRedirectAutomatic);  return TRUE;}
开发者ID:fidergo-stephane-gourichon,项目名称:superswitcher,代码行数:37,


示例15: pn_init

/* **************** basic renderer management **************** */voidpn_init (void){  int i;#ifdef FULLSCREEN_HACK  char SDL_windowhack[32];  GdkScreen *screen;#endif  pn_sound_data = g_new0 (struct pn_sound_data, 1);  pn_image_data = g_new0 (struct pn_image_data, 1);#ifdef FULLSCREEN_HACK  screen = gdk_screen_get_default();  sprintf(SDL_windowhack,"SDL_WINDOWID=%d",          GDK_WINDOW_XWINDOW(gdk_screen_get_root_window(screen)));          putenv(SDL_windowhack);#endif  if (SDL_Init (SDL_INIT_VIDEO | SDL_INIT_TIMER | SDL_INIT_NOPARACHUTE) < 0)    pn_fatal_error ("Unable to initialize SDL: %s", SDL_GetError ());#ifndef FULLSCREEN_HACK  resize_video (640, 360);#else  resize_video (1280, 1024);#endif  SDL_WM_SetCaption ("Paranormal Visualization Studio", PACKAGE);  for(i=0; i<360; i++)    {      sin_val[i] = sin(i*(M_PI/180.0));      cos_val[i] = cos(i*(M_PI/180.0));    }}
开发者ID:Starlon,项目名称:FroyVisuals-old,代码行数:37,


示例16: gtk_widget_realize

void OGLCanvas::createSFML(){#ifdef USE_SFML_RENDERWINDOW	// Code taken from SFML wxWidgets integration example	sf::WindowHandle handle;#ifdef __WXGTK__	// GTK implementation requires to go deeper to find the	// low-level X11 identifier of the widget	gtk_widget_realize(m_wxwindow);	gtk_widget_set_double_buffered(m_wxwindow, false);	GdkWindow* Win = gtk_widget_get_window(m_wxwindow);	XFlush(GDK_WINDOW_XDISPLAY(Win));	// sf::RenderWindow::Create(GDK_WINDOW_XWINDOW(Win));	handle = GDK_WINDOW_XWINDOW(Win);#else	handle = GetHandle();#endif	// Context settings	sf::ContextSettings settings;	settings.depthBits   = 24;	settings.stencilBits = 8;	sf::RenderWindow::create(handle, settings);#endif}
开发者ID:SteelTitanium,项目名称:SLADE,代码行数:24,


示例17: GTK_PIZZA

void wxGLCanvas::SwapBuffers(){    GdkWindow *window = GTK_PIZZA(m_wxwindow)->bin_window;    glXSwapBuffers( GDK_DISPLAY(), GDK_WINDOW_XWINDOW( window ) );}
开发者ID:SCP-682,项目名称:Cities3D,代码行数:5,


示例18: GDK_WINDOW_XWINDOW

Window wxGLCanvas::GetXWindow() const{    GdkWindow *window = m_wxwindow->window;    return window ? GDK_WINDOW_XWINDOW(window) : 0;}
开发者ID:jonntd,项目名称:dynamica,代码行数:5,


示例19: GTK_PIZZA

Window wxGLCanvas::GetXWindow() const{    GdkWindow *window = GTK_PIZZA(m_wxwindow)->bin_window;    return window ? GDK_WINDOW_XWINDOW(window) : 0;}
开发者ID:AaronDP,项目名称:wxWidgets,代码行数:5,


示例20: main

intmain (int argc, char **argv){  static const GOptionEntry options[] = {    { "also-trigger-on-caps-lock", 'c', 0, G_OPTION_ARG_NONE,      &also_trigger_on_caps_lock,      "Make the Caps Lock key also switch windows (as well as the Super key)",      NULL },    { "only-trigger-on-caps-lock", 'C', 0, G_OPTION_ARG_NONE,      &only_trigger_on_caps_lock,      "Make only the Caps Lock key switch windows (instead of the Super key)",      NULL },    { "version", 'v', 0, G_OPTION_ARG_NONE, &show_version_and_exit,      "Show the version number and exit", NULL },#ifdef HAVE_XCOMPOSITE    { "show-window-thumbnails", 't', 0, G_OPTION_ARG_NONE,      &show_window_thumbnails,      "EXPERIMENTAL - Show window thumbnails (instead of icons)", NULL },#endif    { NULL }  };  GdkWindow *root;  GOptionContext *context;  GError *error;  gtk_init (&argc, &argv);  context = g_option_context_new ("");  error = NULL;  g_option_context_add_main_entries (context, options, NULL);  g_option_context_parse (context, &argc, &argv, &error);  if (error) {    g_printerr ("%s/n", error->message);    g_error_free (error);    exit (ABNORMAL_EXIT_CODE_UNKNOWN_COMMAND_LINE_OPTION);  }  if (show_version_and_exit) {    // VERSION comes from the Makefile generated by autogen.sh and configure.in.    printf ("SuperSwitcher version %s/n", VERSION);    return 0;  }#ifdef HAVE_DBUS_GLIB  // Note that this may exit(...) if another instance is already running.  init_superswitcher_dbus ();#endif#ifdef HAVE_XCOMPOSITE  if (show_window_thumbnails) {    show_window_thumbnails = init_composite ();  }#endif  root = gdk_get_default_root_window ();  x_root_window = GDK_WINDOW_XWINDOW (root);  gdk_window_add_filter (root, filter_func, NULL);  if (!only_trigger_on_caps_lock) {    grab (XK_Super_L);    grab (XK_Super_R);  }  if (also_trigger_on_caps_lock || only_trigger_on_caps_lock) {    disable_caps_lock_default_behavior ();    grab (XK_Caps_Lock);  }  screen = ss_screen_new (wnck_screen_get_default (),                          GDK_DISPLAY_XDISPLAY (gdk_display_get_default ()),                          x_root_window);  gtk_main ();#ifdef HAVE_XCOMPOSITE  if (show_window_thumbnails) {    uninit_composite ();  }#endif  return 0;}
开发者ID:Frenzie,项目名称:smartswitcher,代码行数:83,


示例21: getFTFace

gintnsFreeTypeXImage::DrawString(nsRenderingContextGTK* aContext,                            nsDrawingSurfaceGTK* aSurface, nscoord aX,                            nscoord aY, const PRUnichar* aString,                            PRUint32 aLength){#if DEBUG_SHOW_GLYPH_BOX  PRUint32 x, y;  // grey shows image size  // red shows character cells  // green box shows text ink#endif  if (aLength < 1) {    return 0;  }  // get the face/size from the FreeType cache  FT_Face face = getFTFace();  NS_ASSERTION(face, "failed to get face/size");  if (!face)    return 0;  nsresult rslt;  PRInt32 leftBearing, rightBearing, ascent, descent, width;  rslt = doGetBoundingMetrics(aString, aLength, &leftBearing, &rightBearing,                              &ascent, &descent, &width);  if (NS_FAILED(rslt))    return 0;  // make sure we bring down enough background for blending  rightBearing = PR_MAX(rightBearing, width+1);  // offset in the ximage to the x origin  PRInt32 x_origin = PR_MAX(0, -leftBearing);  // offset in the ximage to the x origin  PRInt32 y_origin = ascent;  PRInt32 x_pos = x_origin;  int image_width  = x_origin + rightBearing;  int image_height = y_origin + PR_MAX(descent, 0);  if ((image_width<=0) || (image_height<=0)) {    // if we do not have any pixels then no point in trying to draw    // eg: the space char has 0 height    NS_ASSERTION(width>=0, "Negative width");    return width;  }  Display *dpy = GDK_DISPLAY();  Drawable win = GDK_WINDOW_XWINDOW(aSurface->GetDrawable());  GC gc = GDK_GC_XGC(aContext->GetGC());  XGCValues values;  if (!XGetGCValues(dpy, gc, GCForeground, &values)) {    NS_ERROR("failed to get foreground pixel");    return 0;  }  nscolor color = nsX11AlphaBlend::PixelToNSColor(values.foreground);#if DEBUG_SHOW_GLYPH_BOX  // show X/Y origin  XDrawLine(dpy, win, DefaultGC(dpy, 0), aX-2, aY, aX+2, aY);  XDrawLine(dpy, win, DefaultGC(dpy, 0), aX, aY-2, aX, aY+2);  // show width  XDrawLine(dpy, win, DefaultGC(dpy, 0), aX-x_origin,  aY-y_origin-2,                                         aX+rightBearing, aY-y_origin-2);#endif  //  // Get the background  //  XImage *sub_image = nsX11AlphaBlend::GetBackground(dpy, DefaultScreen(dpy),                                 win, aX-x_origin, aY-y_origin,                                 image_width, image_height);  if (sub_image==nsnull) {#ifdef DEBUG    int screen = DefaultScreen(dpy);    // complain if the requested area is not completely off screen    int win_width = DisplayWidth(dpy, screen);    int win_height = DisplayHeight(dpy, screen);    if (((int)(aX-leftBearing+image_width) > 0)  // not hidden to left        && ((int)(aX-leftBearing) < win_width)   // not hidden to right        && ((int)(aY-ascent+image_height) > 0)// not hidden to top        && ((int)(aY-ascent) < win_height))   // not hidden to bottom    {      NS_ASSERTION(sub_image, "failed to get the image");    }#endif    return 0;  }#if DEBUG_SHOW_GLYPH_BOX  DEBUG_AADRAWBOX(sub_image,0,0,image_width,image_height,0,0,0,255/4);  nscolor black NS_RGB(0,255,0);  blendPixel blendPixelFunc = nsX11AlphaBlend::GetBlendPixel();  // x origin  for (x=0; x<(unsigned int)image_height; x++)    if (x%4==0) (*blendPixelFunc)(sub_image, x_origin, x, black, 255/2);  // y origin  for (y=0; y<(unsigned int)image_width; y++)    if (y%4==0) (*blendPixelFunc)(sub_image, y, ascent-1, black, 255/2);//.........这里部分代码省略.........
开发者ID:rn10950,项目名称:RetroZilla,代码行数:101,


示例22: _xim_init_IMdkit

static void_xim_init_IMdkit (){#if 0    XIMStyle ims_styles_overspot [] = {        XIMPreeditPosition  | XIMStatusNothing,        XIMPreeditNothing   | XIMStatusNothing,        XIMPreeditPosition  | XIMStatusCallbacks,        XIMPreeditNothing   | XIMStatusCallbacks,        0    };#endif    XIMStyle ims_styles_onspot [] = {        XIMPreeditPosition  | XIMStatusNothing,        XIMPreeditCallbacks | XIMStatusNothing,        XIMPreeditNothing   | XIMStatusNothing,        XIMPreeditPosition  | XIMStatusCallbacks,        XIMPreeditCallbacks | XIMStatusCallbacks,        XIMPreeditNothing   | XIMStatusCallbacks,        0    };    XIMEncoding ims_encodings[] = {        "COMPOUND_TEXT",        0    };    GdkWindowAttr window_attr = {        .title              = "ibus-xim",        .event_mask         = GDK_KEY_PRESS_MASK | GDK_KEY_RELEASE_MASK,        .wclass             = GDK_INPUT_OUTPUT,        .window_type        = GDK_WINDOW_TOPLEVEL,        .override_redirect   = 1,    };    XIMStyles styles;    XIMEncodings encodings;    GdkWindow *win;    win = gdk_window_new (NULL, &window_attr, GDK_WA_TITLE);    styles.count_styles =        sizeof (ims_styles_onspot)/sizeof (XIMStyle) - 1;    styles.supported_styles = ims_styles_onspot;    encodings.count_encodings =        sizeof (ims_encodings)/sizeof (XIMEncoding) - 1;    encodings.supported_encodings = ims_encodings;    _xims = IMOpenIM(GDK_DISPLAY_XDISPLAY (gdk_display_get_default ()),        IMModifiers, "Xi18n",        IMServerWindow, GDK_WINDOW_XWINDOW(win),        IMServerName, _server_name != NULL ? _server_name : "ibus",        IMLocale, _locale != NULL ? _locale : LOCALES_STRING,        IMServerTransport, "X/",        IMInputStyles, &styles,        IMEncodingList, &encodings,        IMProtocolHandler, ims_protocol_handler,        IMFilterEventMask, KeyPressMask | KeyReleaseMask,        NULL);    _init_ibus ();    if (!ibus_bus_is_connected (_bus)) {        g_warning ("Can not connect to ibus daemon");        exit (EXIT_FAILURE);    }}static void_atexit_cb (){    if (_bus && ibus_bus_is_connected (_bus)) {        ibus_bus_exit(_bus, False);    }}static void_sighandler (int sig){    exit(EXIT_FAILURE);}
开发者ID:Abioy,项目名称:ibus,代码行数:84,


示例23: gtk_xtbin_new

GtkWidget*gtk_xtbin_new (GtkWidget *parent_widget, String *f){  GtkXtBin *xtbin;  gpointer user_data;  GdkScreen *screen;  GdkVisual* visual;  Colormap colormap;  GdkWindow* parent_window = gtk_widget_get_window(parent_widget);  assert(parent_window != NULL);  xtbin = g_object_new (GTK_TYPE_XTBIN, NULL);  if (!xtbin)    return (GtkWidget*)NULL;  if (f)    fallback = f;  /* Initialize the Xt toolkit */  xtbin->parent_window = parent_window;  screen = gtk_widget_get_screen(parent_widget);  visual = gdk_screen_get_system_visual(screen);  colormap = XCreateColormap(GDK_DISPLAY_XDISPLAY(gdk_screen_get_display(screen)),                             GDK_WINDOW_XWINDOW(gdk_screen_get_root_window(screen)),                             GDK_VISUAL_XVISUAL(visual), AllocNone);  xt_client_init(&(xtbin->xtclient),                  GDK_VISUAL_XVISUAL(visual),                 colormap,                 gdk_visual_get_depth(visual));  if (!xtbin->xtclient.xtdisplay) {    /* If XtOpenDisplay failed, we can't go any further.     *  Bail out.     */#ifdef DEBUG_XTBIN    printf("gtk_xtbin_init: XtOpenDisplay() returned NULL./n");#endif    g_free (xtbin);    return (GtkWidget *)NULL;  }  /* If this is the first running widget, hook this display into the     mainloop */  if (0 == num_widgets) {    int           cnumber;    /*     * hook Xt event loop into the glib event loop.     */    /* the assumption is that gtk_init has already been called */    GSource* gs = g_source_new(&xt_event_funcs, sizeof(GSource));      if (!gs) {       return NULL;      }        g_source_set_priority(gs, GDK_PRIORITY_EVENTS);    g_source_set_can_recurse(gs, TRUE);    tag = g_source_attach(gs, (GMainContext*)NULL);#ifdef VMS    cnumber = XConnectionNumber(xtdisplay);#else    cnumber = ConnectionNumber(xtdisplay);#endif    xt_event_poll_fd.fd = cnumber;    xt_event_poll_fd.events = G_IO_IN;     xt_event_poll_fd.revents = 0;    /* hmm... is this correct? */    g_main_context_add_poll ((GMainContext*)NULL,                              &xt_event_poll_fd,                              G_PRIORITY_LOW);    /* add a timer so that we can poll and process Xt timers */    xt_polling_timer_id =      g_timeout_add(25,                      (GSourceFunc)xt_event_polling_timer_callback,                      xtdisplay);  }  /* Bump up our usage count */  num_widgets++;  /* Build the hierachy */  xtbin->xtdisplay = xtbin->xtclient.xtdisplay;  gtk_widget_set_parent_window(GTK_WIDGET(xtbin), parent_window);  gdk_window_get_user_data(xtbin->parent_window, &user_data);  if (user_data)    gtk_container_add(GTK_CONTAINER(user_data), GTK_WIDGET(xtbin));  return GTK_WIDGET (xtbin);}
开发者ID:0omega,项目名称:platform_external_webkit,代码行数:92,


示例24: event_filter_func

GdkFilterReturnevent_filter_func (GdkXEvent *gdkxevent,		   GdkEvent  *event,		   gpointer  data){    GdkDisplay *gdkdisplay;    XEvent     *xevent = gdkxevent;    gulong     xid = 0;    Window     select = 0;    gdkdisplay = gdk_display_get_default ();    switch (xevent->type) {    case CreateNotify:	{	    if (!wnck_window_get (xevent->xcreatewindow.window))	    {		GdkWindow *toplevel = create_foreign_window (xevent->xcreatewindow.window);		if (toplevel)		{		    gdk_window_set_events (toplevel,					   gdk_window_get_events (toplevel) |					   GDK_PROPERTY_CHANGE_MASK);		    /* check if the window is a switcher and update accordingly */		    if (get_window_prop (xevent->xcreatewindow.window, select_window_atom, &select))			update_switcher_window (xevent->xcreatewindow.window, select);		}	    }	}	break;    case ButtonPress:    case ButtonRelease:	xid = (gulong)	    g_hash_table_lookup (frame_table,				 GINT_TO_POINTER (xevent->xbutton.window));	break;    case EnterNotify:    case LeaveNotify:	xid = (gulong)	    g_hash_table_lookup (frame_table,				 GINT_TO_POINTER (xevent->xcrossing.window));	break;    case MotionNotify:	xid = (gulong)	    g_hash_table_lookup (frame_table,				 GINT_TO_POINTER (xevent->xmotion.window));	break;    case PropertyNotify:	if (xevent->xproperty.atom == frame_input_window_atom)	{	    WnckWindow *win;	    xid = xevent->xproperty.window;	    win = wnck_window_get (xid);	    if (win)	    {		Window frame;		if (!get_window_prop (xid, select_window_atom, &select))		{		    if (get_window_prop (xid, frame_input_window_atom, &frame))			add_frame_window (win, frame, FALSE);		    else			remove_frame_window (win);		}	    }	}	if (xevent->xproperty.atom == frame_output_window_atom)	{	    WnckWindow *win;	    xid = xevent->xproperty.window;	    win = wnck_window_get (xid);	    if (win)	    {		Window frame;		if (!get_window_prop (xid, select_window_atom, &select))		{		    if (get_window_prop (xid, frame_output_window_atom, &frame))			add_frame_window (win, frame, TRUE);		    else			remove_frame_window (win);		}	    }	}	else if (xevent->xproperty.atom == compiz_shadow_info_atom ||		 xevent->xproperty.atom == compiz_shadow_color_atom)	{	    GdkScreen  *g_screen = gdk_display_get_default_screen (gdkdisplay);	    Window     root = GDK_WINDOW_XWINDOW (gdk_screen_get_root_window (g_screen));	    WnckScreen *screen;	    screen = wnck_screen_get_for_root (root);//.........这里部分代码省略.........
开发者ID:Jubei-Mitsuyoshi,项目名称:aaa-compiz,代码行数:101,


示例25: defined

void wxOgre::createOgreRenderWindow(){	// See if an Ogre::Root already exists	mRoot = Ogre::Root::getSingletonPtr();  	mRenderWindow = mRoot->initialise(false);	// --------------------	// Create a new parameters list according to compiled OS	Ogre::NameValuePairList params;	Ogre::String handle;#ifdef __WXMSW__	handle = Ogre::StringConverter::toString((size_t)((HWND)GetHandle()));	params["externalWindowHandle"] = handle;#elif defined(__WXGTK__)	SetBackgroundStyle(wxBG_STYLE_CUSTOM);	GtkWidget* privHandle = GetHandle();    	// prevents flickering	gtk_widget_set_double_buffered(privHandle, FALSE);    // this doesn't work w. Ogre 1.6.1 maybe this will fix it?    gtk_widget_realize(privHandle);   	// grab the window object	GdkWindow* gdkWin = GTK_PIZZA(privHandle)->bin_window;	Display* display = GDK_WINDOW_XDISPLAY(gdkWin);	Window wid = GDK_WINDOW_XWINDOW(gdkWin);    XSync(display,wid);	std::stringstream str;	// display	str << (unsigned long)display << ':';	// screen (returns "display.screen")	std::string screenStr = DisplayString(display);	std::string::size_type dotPos = screenStr.find(".");	screenStr = screenStr.substr(dotPos+1, screenStr.size());	str << screenStr << ':';	// XID	str << wid << ':';	// retrieve XVisualInfo	int attrlist[] = { GLX_RGBA, GLX_DOUBLEBUFFER, GLX_DEPTH_SIZE, 16, GLX_STENCIL_SIZE, 8, None };	XVisualInfo* vi = glXChooseVisual(display, DefaultScreen(display), attrlist);	str << (unsigned long)vi;	handle = str.str();        #else#error Not supported on this platform.#endif	// Get wx control window size	int width;	int height;	GetSize(&width, &height);	// Create the render window	mRenderWindow = Ogre::Root::getSingleton().createRenderWindow("OgreRenderWindow", width, height, false, &params);    // line is required, otherwise the screen does not update    mRenderWindow->setActive(true);    	// --------------------	// Create the SceneManager, in this case a generic one	mSceneMgr = mRoot->createSceneManager(Ogre::ST_GENERIC, "ExampleSMInstance");	mSceneMgr->setAmbientLight(Ogre::ColourValue(0.5f, 0.5f, 0.5f));		// --------------------	// Create the camera	mCamera = mSceneMgr->createCamera("EntityCamera");	// Set up the SceneNodes to control the camera	mCameraNode = mSceneMgr->getRootSceneNode()->createChildSceneNode();	mCameraNode->attachObject(mCamera);	mCamera->setNearClipDistance(0.1);	// Set the viewport	mViewPort = mRenderWindow->addViewport(mCamera); 	// Set the background to match the wxWindow background color	mViewPort->setBackgroundColour(Ogre::ColourValue(212.0f/255.0f, 208.0f/255.0f, 200.0f/255.0f, 1.0f)); 	//mLightNode = mCameraNode->createChildSceneNode();    mXLight = mSceneMgr->createLight("XLight");    mXLight->setType(Ogre::Light::LT_DIRECTIONAL);    mXLight->setDiffuseColour(1.0f, 1.0f,1.0f);    mXLight->setDirection(-1.0f, 0.0f, 0.0f);     mYLight = mSceneMgr->createLight("YLight");    mYLight->setType(Ogre::Light::LT_DIRECTIONAL);    mYLight->setDiffuseColour(1.0f, 1.0f,1.0f);    mYLight->setDirection(0.0f, -1.0f, 0.0f);     mZLight = mSceneMgr->createLight("ZLight");//.........这里部分代码省略.........
开发者ID:johnfredcee,项目名称:meshmixer,代码行数:101,


示例26: PyGdkWindow_GetAttr

static PyObject *PyGdkWindow_GetAttr(PyGdkWindow_Object *self, char *key){    GdkWindow *win = PyGdkWindow_Get(self);    gint x, y;    GdkModifierType p_mask;    if (!strcmp(key, "__members__"))	return Py_BuildValue("[sssssssssssss]", "children", "colormap", "depth",			     "height", "parent", "pointer", "pointer_state",			     "toplevel", "type", "width", "x", "xid", "y");    if (!strcmp(key, "width")) {	gdk_drawable_get_size(win, &x, NULL);	return PyInt_FromLong(x);    }    if (!strcmp(key, "height")) {	gdk_drawable_get_size(win, NULL, &y);	return PyInt_FromLong(y);    }    if (!strcmp(key, "x")) {	gdk_window_get_position(win, &x, NULL);	return PyInt_FromLong(x);    }    if (!strcmp(key, "y")) {	gdk_window_get_position(win, NULL, &y);	return PyInt_FromLong(y);    }    if (!strcmp(key, "colormap"))	return PyGdkColormap_New(gdk_drawable_get_colormap(win));    if (!strcmp(key, "pointer")) {	gdk_window_get_pointer(win, &x, &y, NULL);	return Py_BuildValue("(ii)", x, y);    }    if (!strcmp(key, "pointer_state")) {	gdk_window_get_pointer(win, NULL, NULL, &p_mask);	return PyInt_FromLong(p_mask);    }    if (!strcmp(key, "parent")) {	GdkWindow *par = gdk_window_get_parent(win);	if (par)	    return PyGdkWindow_New(par);	Py_INCREF(Py_None);	return Py_None;    }    if (!strcmp(key, "toplevel"))	return PyGdkWindow_New(gdk_window_get_toplevel(win));    if (!strcmp(key, "children")) {	GList *children, *tmp;	PyObject *ret;	children = gdk_window_get_children(win);	if ((ret = PyList_New(0)) == NULL)	    return NULL;	for (tmp = children; tmp != NULL; tmp = tmp->next) {	    PyObject *win = PyGdkWindow_New(tmp->data);	    if (win == NULL) {		Py_DECREF(ret);		return NULL;	    }	    PyList_Append(ret, win);	    Py_DECREF(win);	}	g_list_free(children);	return ret;    }    if (!strcmp(key, "type"))	return PyInt_FromLong(gdk_drawable_get_type(win));    if (!strcmp(key, "depth")) {	gdk_window_get_geometry(win, NULL, NULL, NULL, NULL, &x);	return PyInt_FromLong(x);    }#ifdef WITH_XSTUFF    if (!strcmp(key, "xid"))	return PyInt_FromLong(GDK_WINDOW_XWINDOW(win));#endif    return Py_FindMethod(PyGdkWindow_methods, (PyObject *)self, key);}
开发者ID:Chiheb-Nexus,项目名称:pygtk,代码行数:77,


示例27: na_tray_manager_manage_screen_x11

static gbooleanna_tray_manager_manage_screen_x11 (NaTrayManager *manager,				   GdkScreen     *screen){  GdkDisplay *display;  Screen     *xscreen;  GtkWidget  *invisible;  char       *selection_atom_name;  guint32     timestamp;    g_return_val_if_fail (NA_IS_TRAY_MANAGER (manager), FALSE);  g_return_val_if_fail (manager->screen == NULL, FALSE);  /* If there's already a manager running on the screen   * we can't create another one.   */#if 0  if (na_tray_manager_check_running_screen_x11 (screen))    return FALSE;#endif    manager->screen = screen;  display = gdk_screen_get_display (screen);  xscreen = GDK_SCREEN_XSCREEN (screen);    invisible = gtk_invisible_new_for_screen (screen);  gtk_widget_realize (invisible);    gtk_widget_add_events (invisible,                         GDK_PROPERTY_CHANGE_MASK | GDK_STRUCTURE_MASK);  selection_atom_name = g_strdup_printf ("_NET_SYSTEM_TRAY_S%d",					 gdk_screen_get_number (screen));  manager->selection_atom = gdk_atom_intern (selection_atom_name, FALSE);  g_free (selection_atom_name);  manager->invisible = invisible;  g_object_ref (G_OBJECT (manager->invisible));  na_tray_manager_set_orientation_property (manager);  na_tray_manager_set_visual_property (manager);    timestamp = gdk_x11_get_server_time (invisible->window);  /* Check if we could set the selection owner successfully */  if (gdk_selection_owner_set_for_display (display,                                           invisible->window,                                           manager->selection_atom,                                           timestamp,                                           TRUE))    {      XClientMessageEvent xev;      GdkAtom             opcode_atom;      GdkAtom             message_data_atom;      xev.type = ClientMessage;      xev.window = RootWindowOfScreen (xscreen);      xev.message_type = gdk_x11_get_xatom_by_name_for_display (display,                                                                "MANAGER");      xev.format = 32;      xev.data.l[0] = timestamp;      xev.data.l[1] = gdk_x11_atom_to_xatom_for_display (display,                                                         manager->selection_atom);      xev.data.l[2] = GDK_WINDOW_XWINDOW (invisible->window);      xev.data.l[3] = 0;	/* manager specific data */      xev.data.l[4] = 0;	/* manager specific data */      XSendEvent (GDK_DISPLAY_XDISPLAY (display),		  RootWindowOfScreen (xscreen),		  False, StructureNotifyMask, (XEvent *)&xev);      opcode_atom = gdk_atom_intern ("_NET_SYSTEM_TRAY_OPCODE", FALSE);      manager->opcode_atom = gdk_x11_atom_to_xatom_for_display (display,                                                                opcode_atom);      message_data_atom = gdk_atom_intern ("_NET_SYSTEM_TRAY_MESSAGE_DATA",                                           FALSE);      /* Add a window filter */#if 0      /* This is for when we lose the selection of _NET_SYSTEM_TRAY_Sx */      g_signal_connect (invisible, "selection-clear-event",                        G_CALLBACK (na_tray_manager_selection_clear_event),                        manager);#endif      /* This is for SYSTEM_TRAY_REQUEST_DOCK and SelectionClear */      gdk_window_add_filter (invisible->window,                             na_tray_manager_window_filter, manager);      /* This is for SYSTEM_TRAY_BEGIN_MESSAGE and SYSTEM_TRAY_CANCEL_MESSAGE */      gdk_display_add_client_message_filter (display, opcode_atom,                                             na_tray_manager_handle_client_message_opcode,                                             manager);      /* This is for _NET_SYSTEM_TRAY_MESSAGE_DATA */      gdk_display_add_client_message_filter (display, message_data_atom,                                             na_tray_manager_handle_client_message_message_data,                                             manager);      return TRUE;    }//.........这里部分代码省略.........
开发者ID:MarkieMark,项目名称:gnome-shell,代码行数:101,


示例28: panel_start_gui

voidpanel_start_gui(panel *p){    Atom state[3];    XWMHints wmhints;    guint32 val;         ENTER;    // main toplevel window    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", "fbpanel");    gtk_window_set_title(GTK_WINDOW(p->topgwin), "panel");    gtk_window_set_position(GTK_WINDOW(p->topgwin), GTK_WIN_POS_NONE);    gtk_window_set_decorated(GTK_WINDOW(p->topgwin), FALSE);        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",          (GCallback) panel_size_req, p);    g_signal_connect (G_OBJECT (p->topgwin), "size-allocate",          (GCallback) panel_size_alloc, p);    g_signal_connect (G_OBJECT (p->topgwin), "configure-event",          (GCallback) panel_configure_event, p);    g_signal_connect (G_OBJECT (p->topgwin), "realize",          (GCallback) panel_realize, p);    g_signal_connect (G_OBJECT (p->topgwin), "style-set",          (GCallback) panel_style_set, p);        gtk_widget_realize(p->topgwin);    //gdk_window_set_decorations(p->topgwin->window, 0);    gtk_widget_set_app_paintable(p->topgwin, TRUE);        // background box all over toplevel    p->bbox = gtk_bgbox_new();    gtk_container_add(GTK_CONTAINER(p->topgwin), p->bbox);    gtk_widget_show(p->bbox);    gtk_container_set_border_width(GTK_CONTAINER(p->bbox), 0);    if (p->transparent) {        p->bg = fb_bg_get_for_display();        gtk_bgbox_set_background(p->bbox, BG_ROOT, p->tintcolor, p->alpha);            }    // main layout manager as a single child of background widget box    p->lbox = p->my_box_new(FALSE, 0);    gtk_container_set_border_width(GTK_CONTAINER(p->lbox), 0);    gtk_container_add(GTK_CONTAINER(p->bbox), p->lbox);    gtk_widget_show(p->lbox);    if (p->round_corners)        make_round_corners(p);     p->box = p->my_box_new(FALSE, p->spacing);     gtk_container_set_border_width(GTK_CONTAINER(p->box), 0);    gtk_box_pack_start(GTK_BOX(p->lbox), p->box, TRUE, TRUE, 0);    gtk_widget_show(p->box);          p->topxwin = GDK_WINDOW_XWINDOW(GTK_WIDGET(p->topgwin)->window);    DBG("topxwin = %x/n", p->topxwin);    /* the settings that should be done before window is mapped */    wmhints.flags = InputHint;    wmhints.input = 0;    XSetWMHints (GDK_DISPLAY(), p->topxwin, &wmhints); #define WIN_HINTS_SKIP_FOCUS      (1<<0)	/* "alt-tab" skips this win */    val = WIN_HINTS_SKIP_FOCUS;    XChangeProperty(GDK_DISPLAY(), p->topxwin,          XInternAtom(GDK_DISPLAY(), "_WIN_HINTS", False), XA_CARDINAL, 32,          PropModeReplace, (unsigned char *) &val, 1);    if (p->setdocktype) {        state[0] = a_NET_WM_WINDOW_TYPE_DOCK;        XChangeProperty(GDK_DISPLAY(), p->topxwin, a_NET_WM_WINDOW_TYPE, XA_ATOM,              32, PropModeReplace, (unsigned char *) state, 1);    }    /* window mapping point */    gtk_widget_show_all(p->topgwin);    /* the settings that should be done after window is mapped */    /* send it to running wm */    Xclimsg(p->topxwin, a_NET_WM_DESKTOP, 0xFFFFFFFF, 0, 0, 0, 0);    /* and assign it ourself just for case when wm is not running */    val = 0xFFFFFFFF;    XChangeProperty(GDK_DISPLAY(), p->topxwin, a_NET_WM_DESKTOP, XA_CARDINAL, 32,          PropModeReplace, (unsigned char *) &val, 1);    state[0] = a_NET_WM_STATE_SKIP_PAGER;    state[1] = a_NET_WM_STATE_SKIP_TASKBAR;    state[2] = a_NET_WM_STATE_STICKY;    XChangeProperty(GDK_DISPLAY(), p->topxwin, a_NET_WM_STATE, XA_ATOM,          32, PropModeReplace, (unsigned char *) state, 3);    XSelectInput (GDK_DISPLAY(), GDK_ROOT_WINDOW(), PropertyChangeMask);    gdk_window_add_filter(gdk_get_default_root_window (), (GdkFilterFunc)panel_event_filter, p);//.........这里部分代码省略.........
开发者ID:BackupTheBerlios,项目名称:fbpanel-svn,代码行数:101,



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


C++ GDK_X11_SCREEN函数代码示例
C++ GDK_WINDOW_XID函数代码示例
万事OK自学网:51自学网_软件自学网_CAD自学网自学excel、自学PS、自学CAD、自学C语言、自学css3实例,是一个通过网络自主学习工作技能的自学平台,网友喜欢的软件自学网站。