ffproperties.c File Reference

#include <stdio.h>
#include <stdlib.h>
#include <X11/Xlib.h>
#include <X11/Xatom.h>
#include <X11/Xmu/WinUtil.h>

Go to the source code of this file.

Functions

int ListWindowProperties (Display *dpy, Window w)
void getWMName (Window w)
int main (int argc, char *argv[])

Variables

Display * dpy
Window NetscapeWindow
Atom XA_MOZILLA_VERSION
Atom XA_MOZILLA_LOCK
Atom XA_MOZILLA_COMMAND
Atom XA_MOZILLA_RESPONSE
Atom XA_WM_CLASS2

Function Documentation

void getWMName ( Window  w  ) 

Definition at line 66 of file ffproperties.c.

00067 {
00068     XTextProperty titleName;
00069 
00070     if( XGetWMName( dpy, w, &titleName ) != 0 )
00071     {
00072         if( titleName.encoding == XA_STRING )
00073             fprintf( stderr, "T�tulo: %s.\n", (char *)titleName.value );
00074         else
00075             fprintf( stderr, "T�tulo: %s.\n", "sem nome" );
00076     }
00077 }

int ListWindowProperties ( Display *  dpy,
Window  w 
)

Definition at line 32 of file ffproperties.c.

00033 {
00034     int  i, qtdAtoms;
00035     int  status;
00036     int  format;
00037     Atom type;
00038 //    Atom mozVersion;
00039     unsigned long nitems, ba;
00040     unsigned char *version;
00041     Atom *bla;
00042 
00043     bla = XListProperties( dpy, w, &qtdAtoms );
00044     if( bla != NULL )
00045     {
00046         for( i = 0; i < qtdAtoms; i++ )
00047         {
00048             fprintf( stderr, "Atom[%02d] = .%s.\n", i, XGetAtomName( dpy, bla[ i ] ) );
00049             if( XGetWindowProperty( dpy, w, bla[ i ], 0, (65535 / sizeof( int )),
00050                                     False, XA_STRING, &type, &format,
00051                                     &nitems, &ba, &version ) == Success )
00052             {
00053                 if( version )
00054                 {
00055                     fprintf( stderr, "\t.%s.\n", version );
00056                     XFree( version );
00057                     status = 1;
00058                 }
00059             }
00060         }
00061     }
00062 
00063     return( status );
00064 }

int main ( int  argc,
char *  argv[] 
)

Definition at line 79 of file ffproperties.c.

00080 {
00081     dpy = XOpenDisplay( NULL );
00082     if( dpy == NULL )
00083         return 0;
00084 
00085 /*
00086  *     XA_MOZILLA_VERSION  = XInternAtom( dpy, MOZILLA_VERSION_PROP,  False );
00087  *     XA_MOZILLA_LOCK     = XInternAtom( dpy, MOZILLA_LOCK_PROP,     False );
00088  *     XA_MOZILLA_COMMAND  = XInternAtom( dpy, MOZILLA_COMMAND_PROP,  False );
00089  *     XA_MOZILLA_RESPONSE = XInternAtom( dpy, MOZILLA_RESPONSE_PROP, False );
00090  *     XA_WM_CLASS2        = XInternAtom( dpy, "WM_CLASS"           , False );
00091  */
00092 
00093     if( argc == 2 )
00094     {
00095         ListWindowProperties( dpy, atoi( argv[ 1 ] ) );
00096         getWMName( atoi( argv[ 1 ] ) );
00097     }
00098 
00099     return( 0 );
00100 }


Variable Documentation

Display* dpy

Definition at line 24 of file ffproperties.c.

Definition at line 25 of file ffproperties.c.

Definition at line 28 of file ffproperties.c.

Definition at line 27 of file ffproperties.c.

Definition at line 29 of file ffproperties.c.

Definition at line 26 of file ffproperties.c.

Definition at line 30 of file ffproperties.c.

Generated on Wed Jul 4 16:03:29 2012 for RIO by  doxygen 1.6.3