Predefined atoms

View: New views
20 Messages — Rating Filter:   Alert me  
< Prev | 1 - 2 | Next >

Predefined atoms

by Rémi Denis-Courmont :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

        Hello,

I have been porting VLC media player to XCB for the last few months. Most
things are now in place. Nevertheless, I was wondering what the recommended
way to get "hard-coded" atom values is?

Currently, I'm using <X11/Xatom.h>. Unfortunately, this depends on the Atom
type, which is part of Xlib (which I manually typedef to xcb_atom_t instead).
Also, this requires the non-XCB x11-proto development package. This seems
rather ugly to me. Is there a "better" method?

--
Rémi Denis-Courmont
http://www.remlab.net/
_______________________________________________
Xcb mailing list
Xcb@...
http://lists.freedesktop.org/mailman/listinfo/xcb

Re: Predefined atoms

by Peter Harris-10 :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

Rémi Denis-Courmont wrote:

> Hello,
>
> I have been porting VLC media player to XCB for the last few months. Most
> things are now in place. Nevertheless, I was wondering what the recommended
> way to get "hard-coded" atom values is?
>
> Currently, I'm using <X11/Xatom.h>. Unfortunately, this depends on the Atom
> type, which is part of Xlib (which I manually typedef to xcb_atom_t instead).
> Also, this requires the non-XCB x11-proto development package. This seems
> rather ugly to me. Is there a "better" method?

<xcb/xcb_atom.h> from the xcb/util package (sometimes split up by
distributions - in package libxcb-atom1-dev on Debian, for example) is
the equivalent for XCB. You will also need to link to libxcb-atom.

Peter Harris
--
               Open Text Connectivity Solutions Group
Peter Harris                    http://connectivity.opentext.com/
Research and Development        Phone: +1 905 762 6001
pharris@...            Toll Free: 1 877 359 4866
_______________________________________________
Xcb mailing list
Xcb@...
http://lists.freedesktop.org/mailman/listinfo/xcb

Re: Predefined atoms

by Rémi Denis-Courmont :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

Le jeudi 29 octobre 2009 21:18:59 Peter Harris, vous avez écrit :

> Rémi Denis-Courmont wrote:
> > Hello,
> >
> > I have been porting VLC media player to XCB for the last few months. Most
> > things are now in place. Nevertheless, I was wondering what the
> > recommended way to get "hard-coded" atom values is?
> >
> > Currently, I'm using <X11/Xatom.h>. Unfortunately, this depends on the
> > Atom type, which is part of Xlib (which I manually typedef to xcb_atom_t
> > instead). Also, this requires the non-XCB x11-proto development package.
> > This seems rather ugly to me. Is there a "better" method?
>
> <xcb/xcb_atom.h> from the xcb/util package (sometimes split up by
> distributions - in package libxcb-atom1-dev on Debian, for example) is
> the equivalent for XCB. You will also need to link to libxcb-atom.

To me, adding another library just to obtain protocol constants sounds worse.
I don't really care about X12 forward compatibility ;)

--
Rémi Denis-Courmont
http://www.remlab.net/
_______________________________________________
Xcb mailing list
Xcb@...
http://lists.freedesktop.org/mailman/listinfo/xcb

Re: Predefined atoms

by Barton C Massey :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

There's definitely some things I don't like about the
current default atom setup in XCB.


For starters, I'm not sure why the default atoms aren't
given values in xcb_atom.h; it seems like

  static const xcb_atom_t PRIMARY = 1;

would be better than

  extern const xcb_atom_t PRIMARY;

Of course, this might mean that we'd want a header
auto-generated from these values, and to put the values in
the XCB protocol description.


I thought we'd killed all the m4, but I just realized that
util/atom still is written in it. :-)  It would be nice to
have it all rewritten to use the XML and Python bits
instead.  It would also be nice to get rid of the gperf
dependency, but this is less crucial and there's at least a
rationale for it.


Since the default atom values are (AFAIK)
part of the protocol description, why are they not in xcb.h
instead of off in the atom util library?


Finally, I note that these default atom names are not
prefixed in any way.  Given that they include a lot of
generic stuff like PRIMARY, this seems like pretty severe
namespace pollution.  XCB_PRIMARY anyone?


All of that said, if you're working with atoms in XCB you
probably want util/xcb_atom for the rest of what it does
anyhow..

        Bart
_______________________________________________
Xcb mailing list
Xcb@...
http://lists.freedesktop.org/mailman/listinfo/xcb

Re: Predefined atoms

by Rémi Denis-Courmont :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message


On Thu, 29 Oct 2009 15:01:32 -0700, Barton C Massey <bart@...>
wrote:

> There's definitely some things I don't like about the
> current default atom setup in XCB.
>
>
> For starters, I'm not sure why the default atoms aren't
> given values in xcb_atom.h; it seems like
>
>   static const xcb_atom_t PRIMARY = 1;
>
> would be better than
>
>   extern const xcb_atom_t PRIMARY;

I wouldn't know, but I guess the rationale was to avoid unused static
warning whenever <xcb_aotm.h> is included. Or does GCC only generate those
for -non-inline- *functions*? Then perhaps, either an enumeration or a set
of #define's would be needed.

> Of course, this might mean that we'd want a header
> auto-generated from these values, and to put the values in
> the XCB protocol description.

Yes.

> Since the default atom values are (AFAIK)
> part of the protocol description, why are they not in xcb.h
> instead of off in the atom util library?

That's what I was wondering.

Thanks,
--
Rémi Denis-Courmont

_______________________________________________
Xcb mailing list
Xcb@...
http://lists.freedesktop.org/mailman/listinfo/xcb

Re: Predefined atoms

by Julien Danjou-2 :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

At 1256888835 time_t, Rémi Denis-Courmont wrote:
> I wouldn't know, but I guess the rationale was to avoid unused static
> warning whenever <xcb_aotm.h> is included. Or does GCC only generate those
> for -non-inline- *functions*? Then perhaps, either an enumeration or a set
> of #define's would be needed.

AFAIK gcc only emits warning for non inline *functions*.

> > Of course, this might mean that we'd want a header
> > auto-generated from these values, and to put the values in
> > the XCB protocol description.
>
> Yes.
>
> > Since the default atom values are (AFAIK)
> > part of the protocol description, why are they not in xcb.h
> > instead of off in the atom util library?

They are part of the protocol description. What looks weird is that the
numeric values are not defined in the protocol description however. But
in practice that's not a problem anyway.

So it seems ok to me to move them to xcb.h or some other header provided
by libxcb directly. I'll try to come up with a patch if no one is faster
than me.

--
Julien Danjou
// ᐰ <julien@...>   http://julien.danjou.info
// 9A0D 5FD9 EB42 22F6 8974  C95C A462 B51E C2FE E5CD
// There is nothing under this line.


_______________________________________________
Xcb mailing list
Xcb@...
http://lists.freedesktop.org/mailman/listinfo/xcb

signature.asc (205 bytes) Download Attachment

Re: Predefined atoms

by Barton C Massey :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

In message <20091105164407.GD21799@...> you wrote:

> > > Since the default atom values are (AFAIK)
> > > part of the protocol description, why are they not in xcb.h
> > > instead of off in the atom util library?
>
> They are part of the protocol description. What looks weird is that the
> numeric values are not defined in the protocol description however. But
> in practice that's not a problem anyway.
>
> So it seems ok to me to move them to xcb.h or some other header provided
> by libxcb directly. I'll try to come up with a patch if no one is faster
> than me.

You go.  Thanks much, Julien!

    Bart
_______________________________________________
Xcb mailing list
Xcb@...
http://lists.freedesktop.org/mailman/listinfo/xcb

Re: Predefined atoms

by Julien Danjou-2 :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

At 1257459056 time_t, Barton C Massey wrote:
> You go.  Thanks much, Julien!

Attached, patch for libxcb and xcb-util.

Tested and works fine AFAICT.

Maybe some other stuff can be moved, but it would be code and function.
Not sure we want that. But until then, the "predef atom list" will be
somehow duplicated. Not sure this is a problem since we are quite sure
it will never change.

--
Julien Danjou
// ᐰ <julien@...>   http://julien.danjou.info
// 9A0D 5FD9 EB42 22F6 8974  C95C A462 B51E C2FE E5CD
// I'm no superman.


From d2284f521d58805f90dc922189052005fdb6694c Mon Sep 17 00:00:00 2001
From: Julien Danjou <julien@...>
Date: Fri, 6 Nov 2009 12:34:48 +0100
Subject: [PATCH] provide protocol pre-defined atoms

Signed-off-by: Julien Danjou <julien@...>
---
 src/Makefile.am    |    3 +-
 src/xcb.h          |    5 +-
 src/xproto-atoms.h |  104 ++++++++++++++++++++++++++++++++++++++++++++++++++++
 3 files changed, 108 insertions(+), 4 deletions(-)
 create mode 100644 src/xproto-atoms.h

diff --git a/src/Makefile.am b/src/Makefile.am
index 8bec613..69f9c34 100644
--- a/src/Makefile.am
+++ b/src/Makefile.am
@@ -2,7 +2,8 @@ lib_LTLIBRARIES = libxcb.la
 
 EXTHEADERS = xproto.h \
  bigreq.h \
- xc_misc.h
+ xc_misc.h \
+ xproto-atoms.h
 EXTSOURCES = xproto.c \
  bigreq.c \
  xc_misc.c
diff --git a/src/xcb.h b/src/xcb.h
index f951276..128fccb 100644
--- a/src/xcb.h
+++ b/src/xcb.h
@@ -159,9 +159,8 @@ typedef struct {
 } xcb_void_cookie_t;
 
 
-/* Include the generated xproto header. */
-#include "xproto.h"
-
+/* Include the protocol pre-defined atoms */
+#include "xproto-atoms.h"
 
 /** XCB_NONE is the universal null resource or null atom parameter value for many core X requests */
 #define XCB_NONE 0L
diff --git a/src/xproto-atoms.h b/src/xproto-atoms.h
new file mode 100644
index 0000000..d54ade1
--- /dev/null
+++ b/src/xproto-atoms.h
@@ -0,0 +1,104 @@
+/*
+ * Copyright (C) 2001-2009 Bart Massey, Jamey Sharp, Josh Triplett
+ * and Julien Danjou.
+ * All Rights Reserved.
+ *
+ * Permission is hereby granted, free of charge, to any person obtaining a
+ * copy of this software and associated documentation files (the "Software"),
+ * to deal in the Software without restriction, including without limitation
+ * the rights to use, copy, modify, merge, publish, distribute, sublicense,
+ * and/or sell copies of the Software, and to permit persons to whom the
+ * Software is furnished to do so, subject to the following conditions:
+ *
+ * The above copyright notice and this permission notice shall be included in
+ * all copies or substantial portions of the Software.
+ *
+ * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+ * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+ * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
+ * AUTHORS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN
+ * ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
+ * CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
+ *
+ * Except as contained in this notice, the names of the authors or their
+ * institutions shall not be used in advertising or otherwise to promote the
+ * sale, use or other dealings in this Software without prior written
+ * authorization from the authors.
+ */
+
+#ifndef __XCB_XPROTO_ATOMS_H__
+#define __XCB_XPROTO_ATOMSH__
+
+/* Include the generated xproto header. */
+#include "xproto.h"
+
+static const xcb_atom_t PRIMARY = 1;
+static const xcb_atom_t SECONDARY = 2;
+static const xcb_atom_t ARC = 3;
+static const xcb_atom_t ATOM = 4;
+static const xcb_atom_t BITMAP = 5;
+static const xcb_atom_t CARDINAL = 6;
+static const xcb_atom_t COLORMAP = 7;
+static const xcb_atom_t CURSOR = 8;
+static const xcb_atom_t CUT_BUFFER0 = 9;
+static const xcb_atom_t CUT_BUFFER1 = 10;
+static const xcb_atom_t CUT_BUFFER2 = 11;
+static const xcb_atom_t CUT_BUFFER3 = 12;
+static const xcb_atom_t CUT_BUFFER4 = 13;
+static const xcb_atom_t CUT_BUFFER5 = 14;
+static const xcb_atom_t CUT_BUFFER6 = 15;
+static const xcb_atom_t CUT_BUFFER7 = 16;
+static const xcb_atom_t DRAWABLE = 17;
+static const xcb_atom_t FONT = 18;
+static const xcb_atom_t INTEGER = 19;
+static const xcb_atom_t PIXMAP = 20;
+static const xcb_atom_t POINT = 21;
+static const xcb_atom_t RECTANGLE = 22;
+static const xcb_atom_t RESOURCE_MANAGER = 23;
+static const xcb_atom_t RGB_COLOR_MAP = 24;
+static const xcb_atom_t RGB_BEST_MAP = 25;
+static const xcb_atom_t RGB_BLUE_MAP = 26;
+static const xcb_atom_t RGB_DEFAULT_MAP = 27;
+static const xcb_atom_t RGB_GRAY_MAP = 28;
+static const xcb_atom_t RGB_GREEN_MAP = 29;
+static const xcb_atom_t RGB_RED_MAP = 30;
+static const xcb_atom_t STRING = 31;
+static const xcb_atom_t VISUALID = 32;
+static const xcb_atom_t WINDOW = 33;
+static const xcb_atom_t WM_COMMAND = 34;
+static const xcb_atom_t WM_HINTS = 35;
+static const xcb_atom_t WM_CLIENT_MACHINE = 36;
+static const xcb_atom_t WM_ICON_NAME = 37;
+static const xcb_atom_t WM_ICON_SIZE = 38;
+static const xcb_atom_t WM_NAME = 39;
+static const xcb_atom_t WM_NORMAL_HINTS = 40;
+static const xcb_atom_t WM_SIZE_HINTS = 41;
+static const xcb_atom_t WM_ZOOM_HINTS = 42;
+static const xcb_atom_t MIN_SPACE = 43;
+static const xcb_atom_t NORM_SPACE = 44;
+static const xcb_atom_t MAX_SPACE = 45;
+static const xcb_atom_t END_SPACE = 46;
+static const xcb_atom_t SUPERSCRIPT_X = 47;
+static const xcb_atom_t SUPERSCRIPT_Y = 48;
+static const xcb_atom_t SUBSCRIPT_X = 49;
+static const xcb_atom_t SUBSCRIPT_Y = 50;
+static const xcb_atom_t UNDERLINE_POSITION = 51;
+static const xcb_atom_t UNDERLINE_THICKNESS = 52;
+static const xcb_atom_t STRIKEOUT_ASCENT = 53;
+static const xcb_atom_t STRIKEOUT_DESCENT = 54;
+static const xcb_atom_t ITALIC_ANGLE = 55;
+static const xcb_atom_t X_HEIGHT = 56;
+static const xcb_atom_t QUAD_WIDTH = 57;
+static const xcb_atom_t WEIGHT = 58;
+static const xcb_atom_t POINT_SIZE = 59;
+static const xcb_atom_t RESOLUTION = 60;
+static const xcb_atom_t COPYRIGHT = 61;
+static const xcb_atom_t NOTICE = 62;
+static const xcb_atom_t FONT_NAME = 63;
+static const xcb_atom_t FAMILY_NAME = 64;
+static const xcb_atom_t FULL_NAME = 65;
+static const xcb_atom_t CAP_HEIGHT = 66;
+static const xcb_atom_t WM_CLASS = 67;
+static const xcb_atom_t WM_TRANSIENT_FOR = 68;
+
+#endif /* __XCB_XPROTO_ATOMS_H__ */
--
1.6.5.2




From 19d574bde53a336e8818b67a47389fb2b2c8590e Mon Sep 17 00:00:00 2001
From: Julien Danjou <julien@...>
Date: Fri, 6 Nov 2009 12:35:22 +0100
Subject: [PATCH] atom: stop providing pre-defined atoms

Signed-off-by: Julien Danjou <julien@...>
---
 atom/atoms.gperf.m4 |    3 ---
 atom/xcb_atom.h.m4  |    3 ---
 2 files changed, 0 insertions(+), 6 deletions(-)

diff --git a/atom/atoms.gperf.m4 b/atom/atoms.gperf.m4
index d26814e..190e395 100644
--- a/atom/atoms.gperf.m4
+++ b/atom/atoms.gperf.m4
@@ -12,9 +12,6 @@
 #include <stdarg.h>
 #include "xcb_atom.h"
 
-define(`COUNT', 0)dnl
-define(`DO', `const xcb_atom_t $1 = define(`COUNT', incr(COUNT))COUNT;')dnl
-include(atomlist.m4)`'dnl
 %}
 
 %readonly-tables
diff --git a/atom/xcb_atom.h.m4 b/atom/xcb_atom.h.m4
index 3579211..ce1473e 100644
--- a/atom/xcb_atom.h.m4
+++ b/atom/xcb_atom.h.m4
@@ -40,9 +40,6 @@ char *xcb_atom_name_by_screen(const char *base, uint8_t screen);
 char *xcb_atom_name_by_resource(const char *base, uint32_t resource);
 char *xcb_atom_name_unique(const char *base, uint32_t id);
 
-define(`DO', `extern const xcb_atom_t $1;')dnl
-include(atomlist.m4)`'dnl
-
 #ifdef __cplusplus
 }
 #endif
--
1.6.5.2




_______________________________________________
Xcb mailing list
Xcb@...
http://lists.freedesktop.org/mailman/listinfo/xcb

signature.asc (205 bytes) Download Attachment

Re: Predefined atoms

by Carsten Meier :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

Am Fri, 6 Nov 2009 12:37:56 +0100
schrieb Julien Danjou <julien@...>:

> At 1257459056 time_t, Barton C Massey wrote:
> > You go.  Thanks much, Julien!
>
> Attached, patch for libxcb and xcb-util.
>
> Tested and works fine AFAICT.
>
> Maybe some other stuff can be moved, but it would be code and
> function. Not sure we want that. But until then, the "predef atom
> list" will be somehow duplicated. Not sure this is a problem since we
> are quite sure it will never change.
>

Hmmm, a prefix would be nice for the atoms. Otherwise some people may
run into problems.

Cheers,
Carsten
_______________________________________________
Xcb mailing list
Xcb@...
http://lists.freedesktop.org/mailman/listinfo/xcb

Re: Predefined atoms

by Julien Cristau-6 :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

On Fri, Nov  6, 2009 at 12:37:56 +0100, Julien Danjou wrote:

> At 1257459056 time_t, Barton C Massey wrote:
> > You go.  Thanks much, Julien!
>
> Attached, patch for libxcb and xcb-util.
>
> Tested and works fine AFAICT.
>
> Maybe some other stuff can be moved, but it would be code and function.
> Not sure we want that. But until then, the "predef atom list" will be
> somehow duplicated. Not sure this is a problem since we are quite sure
> it will never change.
>
Seems sane to me.

Note that libxcb-atom SONAME should be bumped when this lands, AFAICT.

Cheers,
Julien
_______________________________________________
Xcb mailing list
Xcb@...
http://lists.freedesktop.org/mailman/listinfo/xcb

Re: Predefined atoms

by Julien Danjou-2 :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

At 1257513983 time_t, Julien Cristau wrote:
> Note that libxcb-atom SONAME should be bumped when this lands, AFAICT.

Given the crap I usually do with this, would you kind enough to give a
hint/mini-diff ? :)

--
Julien Danjou
// ᐰ <julien@...>   http://julien.danjou.info
// 9A0D 5FD9 EB42 22F6 8974  C95C A462 B51E C2FE E5CD
// Ferns will rule the world.


_______________________________________________
Xcb mailing list
Xcb@...
http://lists.freedesktop.org/mailman/listinfo/xcb

signature.asc (205 bytes) Download Attachment

Re: Predefined atoms

by Julien Danjou-2 :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

At 1257513940 time_t, Carsten Meier wrote:
> Hmmm, a prefix would be nice for the atoms. Otherwise some people may
> run into problems.

Like people mixing Xlib and xcb?
I'm opened to idea.

--
Julien Danjou
// ᐰ <julien@...>   http://julien.danjou.info
// 9A0D 5FD9 EB42 22F6 8974  C95C A462 B51E C2FE E5CD
// In the Sixth Sense, Bruce Willis is dead.


_______________________________________________
Xcb mailing list
Xcb@...
http://lists.freedesktop.org/mailman/listinfo/xcb

signature.asc (205 bytes) Download Attachment

Re: Predefined atoms

by Carsten Meier :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

Am Fri, 6 Nov 2009 14:57:45 +0100
schrieb Julien Danjou <julien@...>:

> At 1257513940 time_t, Carsten Meier wrote:
> > Hmmm, a prefix would be nice for the atoms. Otherwise some people
> > may run into problems.
>
> Like people mixing Xlib and xcb?
> I'm opened to idea.
>

What about XCB_PRIMARY and so on. I really don't like such common
symbols like "BITMAP" to pollute the global namespace.
_______________________________________________
Xcb mailing list
Xcb@...
http://lists.freedesktop.org/mailman/listinfo/xcb

Re: Predefined atoms

by Julien Danjou-2 :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

At 1257516656 time_t, Carsten Meier wrote:
> What about XCB_PRIMARY and so on. I really don't like such common
> symbols like "BITMAP" to pollute the global namespace.

XCB_ATOM_PRIMARY may be even better?

(XCB guys? :)

--
Julien Danjou
// ᐰ <julien@...>   http://julien.danjou.info
// 9A0D 5FD9 EB42 22F6 8974  C95C A462 B51E C2FE E5CD
// There is nothing under this line.


_______________________________________________
Xcb mailing list
Xcb@...
http://lists.freedesktop.org/mailman/listinfo/xcb

signature.asc (205 bytes) Download Attachment

Re: Predefined atoms

by Peter Harris-11 :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

On Fri, Nov 6, 2009 at 8:25 AM, Carsten Meier wrote:

> Am Fri, 6 Nov 2009 12:37:56 +0100
> schrieb Julien Danjou <julien@...>:
>
>> At 1257459056 time_t, Barton C Massey wrote:
>> > You go.  Thanks much, Julien!
>>
>> Attached, patch for libxcb and xcb-util.
>
> Hmmm, a prefix would be nice for the atoms. Otherwise some people may
> run into problems.

Aye. I'm thinking that adding these to the Atom enum in xproto.xml is
the right way to go; then all the other bindings get the predefined
atoms for "free" too.

If nobody beats me to it, and if work is sane for a change (ha!), I'll
try to spin this idea into a patch soon.

Peter Harris
_______________________________________________
Xcb mailing list
Xcb@...
http://lists.freedesktop.org/mailman/listinfo/xcb

Re: Predefined atoms

by Julien Cristau-6 :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

On Fri, Nov  6, 2009 at 14:38:14 +0100, Julien Danjou wrote:

> At 1257513983 time_t, Julien Cristau wrote:
> > Note that libxcb-atom SONAME should be bumped when this lands, AFAICT.
>
> Given the crap I usually do with this, would you kind enough to give a
> hint/mini-diff ? :)
>
diff --git a/atom/Makefile.am b/atom/Makefile.am
index 8be6e60..7c2db87 100644
--- a/atom/Makefile.am
+++ b/atom/Makefile.am
@@ -10,7 +10,7 @@ AM_CFLAGS = $(CWARNFLAGS)
 libxcb_atom_la_SOURCES = atoms.c atomlist.m4 atoms.gperf.m4 xcb_atom.h.m4
 libxcb_atom_la_CPPFLAGS = $(XCB_CFLAGS)
 libxcb_atom_la_LIBADD = $(XCB_LIBS)
-libxcb_atom_la_LDFLAGS = -version-info 1:0:0
+libxcb_atom_la_LDFLAGS = -version-info 2:0:0
 
 pkgconfig_DATA = xcb-atom.pc
 
Cheers,
Julien
_______________________________________________
Xcb mailing list
Xcb@...
http://lists.freedesktop.org/mailman/listinfo/xcb

Re: Predefined atoms

by Julien Danjou-2 :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

At 1257517534 time_t, Peter Harris wrote:
> If nobody beats me to it, and if work is sane for a change (ha!), I'll
> try to spin this idea into a patch soon.

I'd probably prefer that than my currrent patch for sure. :)

--
Julien Danjou
// ᐰ <julien@...>   http://julien.danjou.info
// 9A0D 5FD9 EB42 22F6 8974  C95C A462 B51E C2FE E5CD
// Life is life. Lalalalala.


_______________________________________________
Xcb mailing list
Xcb@...
http://lists.freedesktop.org/mailman/listinfo/xcb

signature.asc (205 bytes) Download Attachment

Re: Predefined atoms

by Barton C Massey :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

Cool.  Looks good. Thanks much.

        Bart

In message <20091106113755.GK21799@...> you wrote:
> Attached, patch for libxcb and xcb-util.
>
> Tested and works fine AFAICT.
>
> Maybe some other stuff can be moved, but it would be code and function.
> Not sure we want that. But until then, the "predef atom list" will be
> somehow duplicated. Not sure this is a problem since we are quite sure
> it will never change.
_______________________________________________
Xcb mailing list
Xcb@...
http://lists.freedesktop.org/mailman/listinfo/xcb

Re: Predefined atoms

by Barton C Massey :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

Oh yeah.  That was in my original bitch list, and then I
forgot to track it.  Thanks for the catch Carsten!

To reply to a future message XCB_ATOM_* seems fine to me.

        Bart

In message <20091106135744.GP21799@...> you wrote:
> At 1257513940 time_t, Carsten Meier wrote:
> > Hmmm, a prefix would be nice for the atoms. Otherwise some people may
> > run into problems.
>
> Like people mixing Xlib and xcb?
> I'm opened to idea.
_______________________________________________
Xcb mailing list
Xcb@...
http://lists.freedesktop.org/mailman/listinfo/xcb

Re: Predefined atoms

by Peter Harris-10 :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

Barton C Massey wrote:
> Oh yeah.  That was in my original bitch list, and then I
> forgot to track it.  Thanks for the catch Carsten!
>
> To reply to a future message XCB_ATOM_* seems fine to me.

Please see the attached.

By defining the atoms in xproto.xml/enum/Atom, we get XCB_ATOM_*
definitions not only for libxcb, but also for any other projects that
use xcb/proto. The pre-defined atoms are part of the protocol, after all.

Instead of outright removing the old names, I've marked them
'deprecated'. We can perhaps remove them after a couple of releases. At
least xcb/util/icccm, awesome, and xlsclients all currently use the old
names from xcb/util/atom.

Notes:
 - altenum="Atom" used to mean "this field may be XCB_ATOM_NONE", and is
now roughly meaningless. Adding (or removing) altenum="Atom" to (from)
every type="ATOM" in xcb/proto can be discussed later.
 - I appear to have used the Canadian/British spelling of favour.

Review welcome.

Peter Harris
--
               Open Text Connectivity Solutions Group
Peter Harris                    http://connectivity.opentext.com/
Research and Development        Phone: +1 905 762 6001
pharris@...            Toll Free: 1 877 359 4866

From 09beaa8043fe94ee47caf5da43fc5e81df5fd9da Mon Sep 17 00:00:00 2001
From: Peter Harris <pharris@...>
Date: Fri, 6 Nov 2009 15:48:00 -0500
Subject: [PATCH] Add pre-defined atoms to Atom enum

Signed-off-by: Peter Harris <pharris@...>
---
 src/xproto.xml |   69 ++++++++++++++++++++++++++++++++++++++++++++++++++++++++
 1 files changed, 69 insertions(+), 0 deletions(-)

diff --git a/src/xproto.xml b/src/xproto.xml
index 5a056e8..b6521c3 100644
--- a/src/xproto.xml
+++ b/src/xproto.xml
@@ -588,6 +588,75 @@ authorization from the authors.
 
   <enum name="Atom">
     <item name="None"> <value>0</value></item>
+    <item name="Any">  <value>0</value></item>
+    <item name="PRIMARY" />
+    <item name="SECONDARY" />
+    <item name="ARC" />
+    <item name="ATOM" />
+    <item name="BITMAP" />
+    <item name="CARDINAL" />
+    <item name="COLORMAP" />
+    <item name="CURSOR" />
+    <item name="CUT_BUFFER0" />
+    <item name="CUT_BUFFER1" />
+    <item name="CUT_BUFFER2" />
+    <item name="CUT_BUFFER3" />
+    <item name="CUT_BUFFER4" />
+    <item name="CUT_BUFFER5" />
+    <item name="CUT_BUFFER6" />
+    <item name="CUT_BUFFER7" />
+    <item name="DRAWABLE" />
+    <item name="FONT" />
+    <item name="INTEGER" />
+    <item name="PIXMAP" />
+    <item name="POINT" />
+    <item name="RECTANGLE" />
+    <item name="RESOURCE_MANAGER" />
+    <item name="RGB_COLOR_MAP" />
+    <item name="RGB_BEST_MAP" />
+    <item name="RGB_BLUE_MAP" />
+    <item name="RGB_DEFAULT_MAP" />
+    <item name="RGB_GRAY_MAP" />
+    <item name="RGB_GREEN_MAP" />
+    <item name="RGB_RED_MAP" />
+    <item name="STRING" />
+    <item name="VISUALID" />
+    <item name="WINDOW" />
+    <item name="WM_COMMAND" />
+    <item name="WM_HINTS" />
+    <item name="WM_CLIENT_MACHINE" />
+    <item name="WM_ICON_NAME" />
+    <item name="WM_ICON_SIZE" />
+    <item name="WM_NAME" />
+    <item name="WM_NORMAL_HINTS" />
+    <item name="WM_SIZE_HINTS" />
+    <item name="WM_ZOOM_HINTS" />
+    <item name="MIN_SPACE" />
+    <item name="NORM_SPACE" />
+    <item name="MAX_SPACE" />
+    <item name="END_SPACE" />
+    <item name="SUPERSCRIPT_X" />
+    <item name="SUPERSCRIPT_Y" />
+    <item name="SUBSCRIPT_X" />
+    <item name="SUBSCRIPT_Y" />
+    <item name="UNDERLINE_POSITION" />
+    <item name="UNDERLINE_THICKNESS" />
+    <item name="STRIKEOUT_ASCENT" />
+    <item name="STRIKEOUT_DESCENT" />
+    <item name="ITALIC_ANGLE" />
+    <item name="X_HEIGHT" />
+    <item name="QUAD_WIDTH" />
+    <item name="WEIGHT" />
+    <item name="POINT_SIZE" />
+    <item name="RESOLUTION" />
+    <item name="COPYRIGHT" />
+    <item name="NOTICE" />
+    <item name="FONT_NAME" />
+    <item name="FAMILY_NAME" />
+    <item name="FULL_NAME" />
+    <item name="CAP_HEIGHT" />
+    <item name="WM_CLASS" />
+    <item name="WM_TRANSIENT_FOR" />
   </enum>
 
   <event name="SelectionRequest" number="30">
--
1.6.5


From 3bcb9ef10f1187e3877154c8aa6acfef1d674b72 Mon Sep 17 00:00:00 2001
From: Peter Harris <pharris@...>
Date: Fri, 6 Nov 2009 15:52:42 -0500
Subject: [PATCH] Deprecate namespaceless pre-defined atoms

Signed-off-by: Peter Harris <pharris@...>
---
 atom/xcb_atom.h.m4 |   12 +++++++++++-
 1 files changed, 11 insertions(+), 1 deletions(-)

diff --git a/atom/xcb_atom.h.m4 b/atom/xcb_atom.h.m4
index 3579211..0eb57d2 100644
--- a/atom/xcb_atom.h.m4
+++ b/atom/xcb_atom.h.m4
@@ -40,7 +40,17 @@ char *xcb_atom_name_by_screen(const char *base, uint8_t screen);
 char *xcb_atom_name_by_resource(const char *base, uint32_t resource);
 char *xcb_atom_name_unique(const char *base, uint32_t id);
 
-define(`DO', `extern const xcb_atom_t $1;')dnl
+#ifndef X_DEPRECATED
+#ifdef __GNUC__
+#define X_DEPRECATED __attribute__((deprecated))
+#else
+#define X_DEPRECATED
+#endif
+#endif
+
+/* These constants are deprecated in favour of XCB_ATOM_*
+   from xproto.h */
+define(`DO', `extern const xcb_atom_t $1 X_DEPRECATED;')dnl
 include(atomlist.m4)`'dnl
 
 #ifdef __cplusplus
--
1.6.5


_______________________________________________
Xcb mailing list
Xcb@...
http://lists.freedesktop.org/mailman/listinfo/xcb
< Prev | 1 - 2 | Next >