当前位置: 首页>>代码示例>>C++>>正文


C++ xcb_change_property函数代码示例

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


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

示例1: xcb_generate_id

void ShellXcb::create_window() {
    win_ = xcb_generate_id(c_);

    uint32_t value_mask, value_list[32];
    value_mask = XCB_CW_BACK_PIXEL | XCB_CW_EVENT_MASK;
    value_list[0] = scr_->black_pixel;
    value_list[1] = XCB_EVENT_MASK_KEY_PRESS | XCB_EVENT_MASK_STRUCTURE_NOTIFY;

    xcb_create_window(c_, XCB_COPY_FROM_PARENT, win_, scr_->root, 0, 0, settings_.initial_width, settings_.initial_height, 0,
                      XCB_WINDOW_CLASS_INPUT_OUTPUT, scr_->root_visual, value_mask, value_list);

    xcb_intern_atom_cookie_t utf8_string_cookie = intern_atom_cookie(c_, "UTF8_STRING");
    xcb_intern_atom_cookie_t _net_wm_name_cookie = intern_atom_cookie(c_, "_NET_WM_NAME");
    xcb_intern_atom_cookie_t wm_protocols_cookie = intern_atom_cookie(c_, "WM_PROTOCOLS");
    xcb_intern_atom_cookie_t wm_delete_window_cookie = intern_atom_cookie(c_, "WM_DELETE_WINDOW");

    // set title
    xcb_atom_t utf8_string = intern_atom(c_, utf8_string_cookie);
    xcb_atom_t _net_wm_name = intern_atom(c_, _net_wm_name_cookie);
    xcb_change_property(c_, XCB_PROP_MODE_REPLACE, win_, _net_wm_name, utf8_string, 8, settings_.name.size(),
                        settings_.name.c_str());

    // advertise WM_DELETE_WINDOW
    wm_protocols_ = intern_atom(c_, wm_protocols_cookie);
    wm_delete_window_ = intern_atom(c_, wm_delete_window_cookie);
    xcb_change_property(c_, XCB_PROP_MODE_REPLACE, win_, wm_protocols_, XCB_ATOM_ATOM, 32, 1, &wm_delete_window_);
}
开发者ID:Nekotekina,项目名称:Vulkan-LoaderAndValidationLayers,代码行数:27,代码来源:ShellXcb.cpp

示例2: _update_struts

static PyObject *
_update_struts(PyObject *self, PyObject *args)
{
    xcb_connection_t *connection;
    xcb_window_t window;
    uint32_t data[12];
    int x, y, w, h, edge;
    memset(data, 0, sizeof(data));

    if (!PyArg_ParseTuple(args, "lIiiiii", &connection, &window, &x, &y, &w, &h, &edge))
        return NULL;

    if (edge == 0)
    {
        data[2] = h;
        data[8] = x;
        data[9] = x+w;
    }
    else if (edge == 1)
    {
        data[3] = h;
        data[10] = x;
        data[11] = x+w;
    }

    xcb_change_property(connection, XCB_PROP_MODE_REPLACE,
            window, atoms[_NET_WM_STRUT], CARDINAL,
            32, 4, data);

    xcb_change_property(connection, XCB_PROP_MODE_REPLACE,
            window, atoms[_NET_WM_STRUT_PARTIAL], CARDINAL,
            32, 12, data);

    Py_RETURN_NONE;
}
开发者ID:Roger,项目名称:caw,代码行数:35,代码来源:cawc.c

示例3: Q_UNUSED

EGLNativeWindowType QEglFSX11Hooks::createNativeWindow(QPlatformWindow *platformWindow,
                                                       const QSize &size,
                                                       const QSurfaceFormat &format)
{
    Q_UNUSED(format);

    m_platformWindow = platformWindow;

    xcb_screen_iterator_t it = xcb_setup_roots_iterator(xcb_get_setup(m_connection));
    m_window = xcb_generate_id(m_connection);
    xcb_create_window(m_connection, XCB_COPY_FROM_PARENT, m_window, it.data->root,
                      0, 0, size.width(), size.height(), 0,
                      XCB_WINDOW_CLASS_INPUT_OUTPUT, it.data->root_visual,
                      0, 0);

    xcb_map_window(m_connection, m_window);

    xcb_intern_atom_cookie_t cookies[Atoms::N_ATOMS];
    static const char *atomNames[Atoms::N_ATOMS] = {
        "_NET_WM_NAME",
        "UTF8_STRING",
        "WM_PROTOCOLS",
        "WM_DELETE_WINDOW",
        "_NET_WM_STATE",
        "_NET_WM_STATE_FULLSCREEN"
    };

    for (int i = 0; i < Atoms::N_ATOMS; ++i) {
        cookies[i] = xcb_intern_atom(m_connection, false, strlen(atomNames[i]), atomNames[i]);
        xcb_intern_atom_reply_t *reply = xcb_intern_atom_reply(m_connection, cookies[i], 0);
        m_atoms[i] = reply->atom;
        free(reply);
    }

    // Set window title
    xcb_change_property(m_connection, XCB_PROP_MODE_REPLACE, m_window,
                        m_atoms[Atoms::_NET_WM_NAME], m_atoms[Atoms::UTF8_STRING], 8, 5, "EGLFS");

    // Enable WM_DELETE_WINDOW
    xcb_change_property(m_connection, XCB_PROP_MODE_REPLACE, m_window,
                        m_atoms[Atoms::WM_PROTOCOLS], XCB_ATOM_ATOM, 32, 1, &m_atoms[Atoms::WM_DELETE_WINDOW]);

    if (qgetenv("EGLFS_X11_FULLSCREEN").toInt()) {
        // Go fullscreen. The QScreen and QWindow size is controlled by EGLFS_X11_SIZE regardless,
        // this is just the native window.
        xcb_change_property(m_connection, XCB_PROP_MODE_REPLACE, m_window,
                            m_atoms[Atoms::_NET_WM_STATE], XCB_ATOM_ATOM, 32, 1, &m_atoms[Atoms::_NET_WM_STATE_FULLSCREEN]);
    }

    xcb_flush(m_connection);

    return m_window;
}
开发者ID:venkatarajasekhar,项目名称:Qt,代码行数:53,代码来源:qeglfshooks_x11.cpp

示例4: x11_transmit_selection

/**
 *  \brief Sends the selection data to the requestor on SelectionRequest
 *
 *  \param [in] cb The clipboard context.
 *  \param [in] e The selection request event.
 *  \return true iff the data was sent (requestor's property was changed)
 *
 *  Not currently ICCCM compliant as MULTIPLE target is unsupported. Also
 *  not compliant because we're not supplying a proper TIMESTAMP value.
 */
static bool x11_transmit_selection(clipboard_c *cb, xcb_selection_request_event_t *e) {
    /* Default location to store data if none specified */
    if (e->property == XCB_NONE) {
        e->property = e->target;
    }

    if (e->target == cb->std_atoms[X_ATOM_TARGETS].atom) {
        xcb_atom_t targets[] = {
            cb->std_atoms[X_ATOM_TIMESTAMP].atom,
            cb->std_atoms[X_ATOM_TARGETS].atom,
            cb->std_atoms[X_ATOM_UTF8_STRING].atom
        };
        xcb_change_property(cb->xc, XCB_PROP_MODE_REPLACE, e->requestor,
                            e->property, XCB_ATOM_ATOM,
                            sizeof(xcb_atom_t) * 8,
                            sizeof(targets) / sizeof(xcb_atom_t), targets);
    } else if (e->target == cb->std_atoms[X_ATOM_TIMESTAMP].atom) {
        xcb_timestamp_t cur = XCB_CURRENT_TIME;
        xcb_change_property(cb->xc, XCB_PROP_MODE_REPLACE, e->requestor,
                            e->property, XCB_ATOM_INTEGER, sizeof(cur) * 8,
                            1, &cur);
    } else if (e->target == cb->std_atoms[X_ATOM_UTF8_STRING].atom) {
        selection_c *sel = NULL;
        if (pthread_mutex_lock(&cb->mu) != 0) {
            return false;
        }

        for (int i = 0; i < LCB_MODE_END; i++) {
            if (cb->selections[i].xmode == e->selection) {
                sel = &cb->selections[i];
                break;
            }
        }

        if (sel == NULL || !sel->has_ownership || sel->data == NULL || sel->target != e->target) {
            pthread_mutex_unlock(&cb->mu);
            return false;
        }

        xcb_change_property(cb->xc, XCB_PROP_MODE_REPLACE, e->requestor,
                            e->property, e->target, 8, sel->length, sel->data);
        pthread_mutex_unlock(&cb->mu);
    } else {
        /* Unknown target */
        return false;
    }

    return true;
}
开发者ID:bmx-ng,项目名称:brl.mod,代码行数:59,代码来源:clipboard_x11.c

示例5: switch

void QXcbWindow::setNetWmWindowTypes(Qt::WindowFlags flags)
{
    // in order of decreasing priority
    QVector<uint> windowTypes;

    Qt::WindowType type = static_cast<Qt::WindowType>(int(flags & Qt::WindowType_Mask));

    switch (type) {
    case Qt::Dialog:
    case Qt::Sheet:
        windowTypes.append(atom(QXcbAtom::_NET_WM_WINDOW_TYPE_DIALOG));
        break;
    case Qt::Tool:
    case Qt::Drawer:
        windowTypes.append(atom(QXcbAtom::_NET_WM_WINDOW_TYPE_UTILITY));
        break;
    case Qt::ToolTip:
        windowTypes.append(atom(QXcbAtom::_NET_WM_WINDOW_TYPE_TOOLTIP));
        break;
    case Qt::SplashScreen:
        windowTypes.append(atom(QXcbAtom::_NET_WM_WINDOW_TYPE_SPLASH));
        break;
    default:
        break;
    }

    if (flags & Qt::FramelessWindowHint)
        windowTypes.append(atom(QXcbAtom::_KDE_NET_WM_WINDOW_TYPE_OVERRIDE));

    windowTypes.append(atom(QXcbAtom::_NET_WM_WINDOW_TYPE_NORMAL));

    Q_XCB_CALL(xcb_change_property(xcb_connection(), XCB_PROP_MODE_REPLACE, m_window,
                                   atom(QXcbAtom::_NET_WM_WINDOW_TYPE), XCB_ATOM_ATOM, 32,
                                   windowTypes.count(), windowTypes.constData()));
}
开发者ID:wpbest,项目名称:copperspice,代码行数:35,代码来源:qxcbwindow.cpp

示例6: create_window

static xcb_window_t create_window(xcb_connection_t *conn, xcb_screen_t *screen, xcb_image_t *background) {
    xcb_window_t window = xcb_generate_id(conn);
    xcb_create_window(conn,
        XCB_COPY_FROM_PARENT,
        window,
        screen->root,
        0, 0,
        screen->width_in_pixels, screen->height_in_pixels,
        0,
        XCB_WINDOW_CLASS_INPUT_OUTPUT,
        screen->root_visual,
        XCB_CW_BACK_PIXMAP | XCB_CW_OVERRIDE_REDIRECT | XCB_CW_EVENT_MASK | XCB_CW_CURSOR,
        (uint32_t[]){
            image_to_pixmap(conn, screen, background),
            1,
            XCB_EVENT_MASK_EXPOSURE | XCB_EVENT_MASK_KEY_PRESS,
            create_empty_cursor(conn, screen)
        });

    const char name[] = "Hamartu";
    xcb_change_property(conn,
        XCB_PROP_MODE_REPLACE,
        window,
        XCB_ATOM_WM_NAME,
        XCB_ATOM_STRING,
        8,
        sizeof(name),
        name);

    xcb_configure_window(conn, window,
        XCB_CONFIG_WINDOW_STACK_MODE,
        (uint32_t[]){ XCB_STACK_MODE_ABOVE });

    return window;
}
开发者ID:siiptuo,项目名称:hamartu,代码行数:35,代码来源:main.c

示例7: ecore_x_icccm_command_set

/**
 * Sets the WM_COMMAND property for @a win.
 *
 * @param win  The window.
 * @param argc Number of arguments.
 * @param argv Arguments.
 */
EAPI void
ecore_x_icccm_command_set(Ecore_X_Window win,
                          int            argc,
                          char         **argv)
{
   void *buf;
   char *b;
   int nbytes, i;

   LOGFN(__FILE__, __LINE__, __FUNCTION__);
   CHECK_XCB_CONN;

   for (i = 0, nbytes = 0; i < argc; i++) 
     if (argv[i]) nbytes += strlen(argv[i]) + 1;

   buf = malloc(sizeof(char) * nbytes);
   if (!buf) return;

   b = (char *)buf;
   for (i = 0; i < argc; i++)
     {
        if (argv[i])
          {
             strcpy(b, argv[i]);
             b += strlen(argv[i]) + 1;
          }
        else
          *b++ = '\0';
     }
   xcb_change_property(_ecore_xcb_conn, XCB_PROP_MODE_REPLACE, win,
                       ECORE_X_ATOM_WM_COMMAND, ECORE_X_ATOM_STRING, 8,
                       nbytes, buf);
   free(buf);
}
开发者ID:Limsik,项目名称:e17,代码行数:41,代码来源:ecore_xcb_icccm.c

示例8: set_title

void
set_title(xcb_connection_t *con, xcb_window_t w, char *name)
{
	xcb_change_property(con, XCB_PROP_MODE_REPLACE, w, XCB_ATOM_WM_NAME,
		XCB_ATOM_STRING, 8, strlen(name), name);
	xcb_flush(con);
}
开发者ID:duckwork,项目名称:wmutils-opt,代码行数:7,代码来源:chwn.c

示例9: window_set_state

/* window_set_state - changes the state of a window {{{
 * @window a window
 * @state the state we want to change it to
 */
void
window_set_state(xcb_window_t window, long state)
{
    long data[] = { state, XCB_NONE };
    xcb_change_property(rootconf.connection, XCB_PROP_MODE_REPLACE, window,
            XCB_WM_HINT_STATE, XCB_WM_HINT_STATE, 32, 2, data);
} /*  }}} */
开发者ID:feler,项目名称:ceres,代码行数:11,代码来源:window.c

示例10: window_state_set

/** Set client state (WM_STATE) property.
 * \param win The window to set state.
 * \param state The state to set.
 */
void
window_state_set(xcb_window_t win, long state)
{
    long data[] = { state, XCB_NONE };
    xcb_change_property(globalconf.connection, XCB_PROP_MODE_REPLACE, win,
                        WM_STATE, WM_STATE, 32, 2, data);
}
开发者ID:jordonwu,项目名称:awesome-3.4.11-kindle,代码行数:11,代码来源:window.c

示例11: systray_draw

static void
systray_draw(widget_t *widget, draw_context_t *ctx,
             area_t geometry, wibox_t *p)
{
    uint32_t orient;

    switch(p->position)
    {
      case Right:
      case Left:
        orient = _NET_SYSTEM_TRAY_ORIENTATION_VERT;
        break;
      default:
        orient = _NET_SYSTEM_TRAY_ORIENTATION_HORZ;
        break;
    }

    systray_data_t *d = widget->data;

    if (p->orientation == East)
        d->height = p->geometry.height;
    else
        d->height = p->geometry.width;

    /* set wibox orientation */
    /** \todo stop setting that property on each redraw */
    xcb_change_property(globalconf.connection, XCB_PROP_MODE_REPLACE,
                        globalconf.screens.tab[p->ctx.phys_screen].systray.window,
                        _NET_SYSTEM_TRAY_ORIENTATION, XCB_ATOM_CARDINAL, 32, 1, &orient);
}
开发者ID:jordonwu,项目名称:awesome-3.4.11-kindle,代码行数:30,代码来源:systray.c

示例12: xwindow_set_state

/** Set client state (WM_STATE) property.
 * \param win The window to set state.
 * \param state The state to set.
 */
void
xwindow_set_state(xcb_window_t win, uint32_t state)
{
    uint32_t data[] = { state, XCB_NONE };
    xcb_change_property(globalconf.connection, XCB_PROP_MODE_REPLACE, win,
                        WM_STATE, WM_STATE, 32, 2, data);
}
开发者ID:AitorATuin,项目名称:awesome,代码行数:11,代码来源:xwindow.c

示例13: set_string

/** Set an X window property from a nul-terminated string */
static inline
void set_string (xcb_connection_t *conn, xcb_window_t window,
                 xcb_atom_t type, xcb_atom_t atom, const char *str)
{
    xcb_change_property (conn, XCB_PROP_MODE_REPLACE, window, atom, type,
                         /* format */ 8, strlen (str), str);
}
开发者ID:CSRedRat,项目名称:vlc,代码行数:8,代码来源:window.c

示例14: strlen

void XWaylandManager::createWindowManager()
{
    static const char name[] = "Green Island the Hawaii compositor";

    m_wmWindow = new Xcb::Window(QRect(0, 0, 10, 10),
                                 XCB_WINDOW_CLASS_INPUT_OUTPUT, 0, Q_NULLPTR);
    xcb_window_t w = m_wmWindow->window();
    m_wmWindow->changeProperty(Xcb::resources()->atoms->net_supporting_wm_check,
                               XCB_ATOM_WINDOW, 32, 1, &w);
    m_wmWindow->changeProperty(Xcb::resources()->atoms->net_wm_name,
                               Xcb::resources()->atoms->utf8_string,
                               8, strlen(name), name);
    xcb_change_property(Xcb::connection(),
                        XCB_PROP_MODE_REPLACE,
                        Xcb::rootWindow(),
                        Xcb::resources()->atoms->net_supporting_wm_check,
                        XCB_ATOM_WINDOW, 32, 1, &w);

    // Claim WM_S0
    xcb_set_selection_owner(Xcb::connection(), w,
                            Xcb::resources()->atoms->wm_s0,
                            XCB_TIME_CURRENT_TIME);
    xcb_set_selection_owner(Xcb::connection(), w,
                            Xcb::resources()->atoms->net_wm_cm_s0,
                            XCB_TIME_CURRENT_TIME);
}
开发者ID:greenisland,项目名称:greenisland,代码行数:26,代码来源:xwaylandmanager.cpp

示例15: switch

bool DesktopWindow::event(QEvent* event) {
    switch(event->type()) {
    case QEvent::WinIdChange: {
        qDebug() << "winid change:" << effectiveWinId();
        if(effectiveWinId() == 0) {
            break;
        }
        // set freedesktop.org EWMH hints properly
        if(QX11Info::isPlatformX11() && QX11Info::connection()) {
            xcb_connection_t* con = QX11Info::connection();
            const char* atom_name = "_NET_WM_WINDOW_TYPE_DESKTOP";
            xcb_atom_t atom = xcb_intern_atom_reply(con, xcb_intern_atom(con, 0, strlen(atom_name), atom_name), nullptr)->atom;
            const char* prop_atom_name = "_NET_WM_WINDOW_TYPE";
            xcb_atom_t prop_atom = xcb_intern_atom_reply(con, xcb_intern_atom(con, 0, strlen(prop_atom_name), prop_atom_name), nullptr)->atom;
            xcb_atom_t XA_ATOM = 4;
            xcb_change_property(con, XCB_PROP_MODE_REPLACE, effectiveWinId(), prop_atom, XA_ATOM, 32, 1, &atom);
        }
        break;
    }
#undef FontChange // FontChange is defined in the headers of XLib and clashes with Qt, let's undefine it.
    case QEvent::StyleChange:
    case QEvent::FontChange:
        queueRelayout();
        break;

    default:
        break;
    }

    return QWidget::event(event);
}
开发者ID:SafaAlfulaij,项目名称:pcmanfm-qt,代码行数:31,代码来源:desktopwindow.cpp


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