X-Git-Url: https://git.dogcows.com/gitweb?a=blobdiff_plain;f=obt%2Fprop.h;h=b30232e9d8282d455e1ae78ae3d18d6614eebd18;hb=d58ed5c413e052e7ff58aa1ea15b475e9c335e07;hp=128f2dc17f696498d4c61c8bf0870fa846b91ae3;hpb=6c8acc079a9cbb40245e5df4b50b3f8b9c17cf83;p=chaz%2Fopenbox diff --git a/obt/prop.h b/obt/prop.h index 128f2dc1..b30232e9 100644 --- a/obt/prop.h +++ b/obt/prop.h @@ -28,11 +28,13 @@ G_BEGIN_DECLS typedef enum { /* types */ OBT_PROP_CARDINAL, /*!< The atom which represents the Cardinal data type */ - OBT_PROP_WINDOW, /*!< The atom which represents window ids */ - OBT_PROP_PIXMAP, /*!< The atom which represents pixmap ids */ - OBT_PROP_ATOM, /*!< The atom which represents atom values */ - OBT_PROP_STRING, /*!< The atom which represents ascii strings */ - OBT_PROP_UTF8, /*!< The atom which represents utf8-encoded strings */ + OBT_PROP_WINDOW, /*!< The atom which represents window ids */ + OBT_PROP_PIXMAP, /*!< The atom which represents pixmap ids */ + OBT_PROP_ATOM, /*!< The atom which represents atom values */ + OBT_PROP_STRING, /*!< The atom which represents latin1 strings */ + OBT_PROP_COMPOUND_TEXT, /*!< The atom which represents locale-encoded + strings */ + OBT_PROP_UTF8_STRING, /*!< The atom which represents utf8-encoded strings*/ /* selection stuff */ OBT_PROP_MANAGER, @@ -51,7 +53,9 @@ typedef enum { OBT_PROP_WM_CLIENT_MACHINE, OBT_PROP_WM_COMMAND, OBT_PROP_WM_CLIENT_LEADER, + OBT_PROP_WM_TRANSIENT_FOR, OBT_PROP_MOTIF_WM_HINTS, + OBT_PROP_MOTIF_WM_INFO, /* SM atoms */ OBT_PROP_SM_CLIENT_ID, @@ -84,6 +88,21 @@ typedef enum { OBT_PROP_NET_WM_BOTTOMRIGHT, OBT_PROP_NET_WM_BOTTOMLEFT, + OBT_PROP_NET_WM_WINDOW_TYPE_POPUP_MENU, + + OBT_PROP_PRIVATE_PADDING1, + OBT_PROP_PRIVATE_PADDING2, + OBT_PROP_PRIVATE_PADDING3, + OBT_PROP_PRIVATE_PADDING4, + OBT_PROP_PRIVATE_PADDING5, + OBT_PROP_PRIVATE_PADDING6, + OBT_PROP_PRIVATE_PADDING7, + OBT_PROP_PRIVATE_PADDING8, + OBT_PROP_PRIVATE_PADDING9, + OBT_PROP_PRIVATE_PADDING10, + OBT_PROP_PRIVATE_PADDING11, + OBT_PROP_PRIVATE_PADDING12, + /* Everything below here must go in net_supported on the root window */ /* root window properties */ @@ -127,14 +146,15 @@ typedef enum { OBT_PROP_NET_WM_STRUT_PARTIAL, OBT_PROP_NET_WM_ICON, OBT_PROP_NET_WM_ICON_GEOMETRY, -/* OBT_PROP_NET_WM_PID, */ + OBT_PROP_NET_WM_PID, OBT_PROP_NET_WM_ALLOWED_ACTIONS, + OBT_PROP_NET_WM_WINDOW_OPACITY, OBT_PROP_NET_WM_USER_TIME, - OBT_PROP_NET_WM_USER_TIME_WINDOW, +/* OBT_PROP_NET_WM_USER_TIME_WINDOW, */ OBT_PROP_NET_FRAME_EXTENTS, /* application protocols */ -/* OBT_PROP_NET_WM_PING, */ + OBT_PROP_NET_WM_PING, #ifdef SYNC OBT_PROP_NET_WM_SYNC_REQUEST, OBT_PROP_NET_WM_SYNC_REQUEST_COUNTER, @@ -192,64 +212,110 @@ typedef enum { OBT_PROP_OB_WM_STATE_UNDECORATED, OBT_PROP_OPENBOX_PID, /* this is depreecated in favour of ob_control */ OBT_PROP_OB_THEME, + OBT_PROP_OB_CONFIG_FILE, OBT_PROP_OB_CONTROL, + OBT_PROP_OB_VERSION, + OBT_PROP_OB_APP_ROLE, + OBT_PROP_OB_APP_TITLE, + OBT_PROP_OB_APP_NAME, + OBT_PROP_OB_APP_CLASS, + OBT_PROP_OB_APP_TYPE, OBT_PROP_NUM_ATOMS } ObtPropAtom; -#define OB_PROP_NUM_PUBLIC_ATOMS (OB_PROP_NUM_ATOMS - OB_PROP_NET_SUPPORTED) - -void obt_prop_startup(); - Atom obt_prop_atom(ObtPropAtom a); +typedef enum { + /*! STRING is latin1 encoded. It cannot contain control characters except + for tab and line-feed. */ + OBT_PROP_TEXT_STRING = 1, + /*! STRING text restricted to characters in the X Portable Character + Set, which is a subset of latin1. + http://static.cray-cyber.org/Documentation/NEC_SX_R10_1/G1AE02E/CHAP1.HTML + */ + OBT_PROP_TEXT_STRING_XPCS = 2, + /*! STRING text restricted to not allow any control characters to be + present. */ + OBT_PROP_TEXT_STRING_NO_CC = 3, + /* COMPOUND_TEXT is encoded in the current locale setting. */ + OBT_PROP_TEXT_COMPOUND_TEXT = 4, + /* UTF8_STRING is encoded as utf-8. */ + OBT_PROP_TEXT_UTF8_STRING = 5, +} ObtPropTextType; + gboolean obt_prop_get32(Window win, Atom prop, Atom type, guint32 *ret); gboolean obt_prop_get_array32(Window win, Atom prop, Atom type, guint32 **ret, guint *nret); -gboolean obt_prop_get_string_locale(Window win, Atom prop, gchar **ret); -gboolean obt_prop_get_string_utf8(Window win, Atom prop, gchar **ret); -gboolean obt_prop_get_strings_locale(Window win, Atom prop, gchar ***ret); -gboolean obt_prop_get_strings_utf8(Window win, Atom prop, gchar ***ret); + +gboolean obt_prop_get_text(Window win, Atom prop, ObtPropTextType type, + gchar **ret); +gboolean obt_prop_get_array_text(Window win, Atom prop, + ObtPropTextType type, + gchar ***ret); void obt_prop_set32(Window win, Atom prop, Atom type, gulong val); void obt_prop_set_array32(Window win, Atom prop, Atom type, gulong *val, guint num); -void obt_prop_set_string_utf8(Window win, Atom prop, const gchar *val); -void obt_prop_set_strings_utf8(Window win, Atom prop, gchar **strs); +void obt_prop_set_text(Window win, Atom prop, const gchar *str); +void obt_prop_set_array_text(Window win, Atom prop, const gchar *const *strs); void obt_prop_erase(Window win, Atom prop); void obt_prop_message(gint screen, Window about, Atom messagetype, glong data0, glong data1, glong data2, glong data3, glong data4, glong mask); - -#define PROP_GET32(win, prop, type, ret) \ - (prop_get32(win, obt_prop_atom(OB_PROP_##prop), prop_atoms.type, ret)) -#define PROP_GETA32(win, prop, type, ret, nret) \ - (prop_get_array32(win, obt_prop_atom(OB_PROP_##prop), prop_atoms.type, \ - ret, nret)) -#define PROP_GETS(win, prop, type, ret) \ - (prop_get_string_##type(win, obt_prop_atom(OB_PROP_##prop), ret)) -#define PROP_GETSS(win, prop, type, ret) \ - (prop_get_strings_##type(win, obt_prop_atom(OB_PROP_##prop), ret)) - -#define PROP_SET32(win, prop, type, val) \ - prop_set32(win, obt_prop_atom(OB_PROP_##prop), \ - obt_prop_atom(OB_PROP_##type), val) -#define PROP_SETA32(win, prop, type, val, num) \ - prop_set_array32(win, obt_prop_atom(OB_PROP_##prop), \ - obt_prop_atom(OB_PROP_##type), val, num) -#define PROP_SETS(win, prop, val) \ - prop_set_string_utf8(win, obt_prop_atom(OB_PROP_##prop), val) -#define PROP_SETSS(win, prop, strs) \ - prop_set_strings_utf8(win, obt_prop_atom(OB_PROP_##prop), strs) - -#define PROP_ERASE(win, prop) prop_erase(win, obt_prop_atom(OB_PROP_##prop)) - -#define PROP_MSG(screen, about, msgtype, data0, data1, data2, data3, data4) \ - (prop_message(screen, about, obt_prop_atom(OB_PROP_##msgtype), \ - data0, data1, data2, data3, data4, \ - SubstructureNotifyMask | SubstructureRedirectMask)) +void obt_prop_message_to(Window to, Window about, Atom messagetype, + glong data0, glong data1, glong data2, glong data3, + glong data4, glong mask); + +#define OBT_PROP_ATOM(prop) obt_prop_atom(OBT_PROP_##prop) + +#define OBT_PROP_GET32(win, prop, type, ret) \ + (obt_prop_get32(win, OBT_PROP_ATOM(prop), OBT_PROP_ATOM(type), ret)) +#define OBT_PROP_GETA32(win, prop, type, ret, nret) \ + (obt_prop_get_array32(win, OBT_PROP_ATOM(prop), OBT_PROP_ATOM(type), \ + ret, nret)) +#define OBT_PROP_GETS(win, prop, ret) \ + (obt_prop_get_text(win, OBT_PROP_ATOM(prop), 0, ret)) +#define OBT_PROP_GETSS(win, prop, ret) \ + (obt_prop_get_array_text(win, OBT_PROP_ATOM(prop), 0, ret)) + +#define OBT_PROP_GETS_TYPE(win, prop, type, ret) \ + (obt_prop_get_text(win, OBT_PROP_ATOM(prop), OBT_PROP_TEXT_##type, ret)) +#define OBT_PROP_GETSS_TYPE(win, prop, type, ret) \ + (obt_prop_get_array_text(win, OBT_PROP_ATOM(prop), \ + OBT_PROP_TEXT_##type, ret)) + +#define OBT_PROP_GETS_UTF8(win, prop, ret) \ + OBT_PROP_GETS_TYPE(win, prop, UTF8_STRING, ret) +#define OBT_PROP_GETSS_UTF8(win, prop, ret) \ + OBT_PROP_GETSS_TYPE(win, prop, UTF8_STRING, ret) +#define OBT_PROP_GETS_XPCS(win, prop, ret) \ + OBT_PROP_GETS_TYPE(win, prop, STRING_XPCS, ret) + +#define OBT_PROP_SET32(win, prop, type, val) \ + (obt_prop_set32(win, OBT_PROP_ATOM(prop), OBT_PROP_ATOM(type), val)) +#define OBT_PROP_SETA32(win, prop, type, val, num) \ + (obt_prop_set_array32(win, OBT_PROP_ATOM(prop), OBT_PROP_ATOM(type), \ + val, num)) +#define OBT_PROP_SETS(win, prop, val) \ + (obt_prop_set_text(win, OBT_PROP_ATOM(prop), val)) +#define OBT_PROP_SETSS(win, prop, strs) \ + (obt_prop_set_array_text(win, OBT_PROP_ATOM(prop), strs)) + +#define OBT_PROP_ERASE(win, prop) (obt_prop_erase(win, OBT_PROP_ATOM(prop))) + +#define OBT_PROP_MSG(screen, about, msgtype, data0, data1, data2, data3, \ + data4) \ + (obt_prop_message(screen, about, OBT_PROP_ATOM(msgtype), \ + data0, data1, data2, data3, data4, \ + SubstructureNotifyMask | SubstructureRedirectMask)) + +#define OBT_PROP_MSG_TO(to, about, msgtype, data0, data1, data2, data3, \ + data4, mask) \ + (obt_prop_message_to(to, about, OBT_PROP_ATOM(msgtype), \ + data0, data1, data2, data3, data4, mask)) G_END_DECLS