[fpc-pascal] RE: Atom like feature in FreePascal

MAGENTA LTD info at magenta.gr
Mon Mar 27 12:28:55 CEST 2006


Yes, this is what I need. ATOMS are implemented in xlib file which you
have just to include.
Here are a couple of functions to use ATOMs directly for anyone interest
in:

// if exist a specific ATOM
function spExistATOM( cAtomName: string ): boolean;
var
   cDisplay: string;
   Display: PDisplay;

begin
     cDisplay := GetEnvironmentVariable( 'DISPLAY' );
     Display := XOpenDisplay( pchar( cDisplay ) );
     if XInternAtom( Display, cAtomName, true ) > 0 then Result := true
     else Result := false;
end;

// create ATOM
function spCreateATOM( cAtomName: string ): integer;
var
   cDisplay: string;
   Display: PDisplay;

begin
     cDisplay := GetEnvironmentVariable( 'DISPLAY' );
     Display := XOpenDisplay( pchar( cDisplay ) );
     if not spExistATOM( cAtomName ) then Result := XInternAtom(
Display, ATOM_NAME, false )
     else Result := XInternAtom( Display, cAtomName, true );
end;

Regards, Pamagiotis

-----Original Message-----
From: Jeff Pohlmeyer [mailto:yetanothergeek at gmail.com] 
Sent: Friday, March 24, 2006 1:29 PM
To: fpc-pascal at lists.freepascal.org
Cc: info at magenta.gr
Subject: RE: Atom like feature in FreePascal


> I'm interest on an OS independed (or at least Linux and MacOS), 
> Windows ATOM like* feature, supported by FreePascal.

Maybe this?
http://www.xfree86.org/4.0.1/XInternAtom.3.html




More information about the fpc-pascal mailing list