• Immutable Page
  • Info
  • Attachments

CompOutput

Each CompOutput represents a physical display attached to the system, managed by TwinView, XRandR, MergedFB or Xinerama. They are also on the same X11 Display and Screen (see Multihead for more information on this).

Each output is drawn separately by the composite and opengl plugins.

Class Definition

/**
 * Represents a phisically attached screen in Compiz, where this
 * phisical screen is part of an X11 screen in a configuration such
 * as Xinerama, XRandR, TwinView or MergedFB
 */
class CompOutput : public CompRect {

    public:
        CompOutput ();

        CompString name () const;

        unsigned int id () const;

        /**
         * Returns a "working area" of the screen, which the geometry
         * which is not covered by strut windows (such as panels)
         */
        const CompRect& workArea () const;

        void setWorkArea (const CompRect&);
        void setGeometry (int x, int y, int width, int height);
        void setId (CompString, unsigned int);

        typedef std::vector<CompOutput> vector;
        typedef std::vector<CompOutput *> ptrVector;
        typedef std::list<CompOutput *> ptrList;

    private:

        CompString   mName;
        unsigned int mId;

        CompRect     mWorkArea;
};

Basic information about an output

Because CompOutput inherits CompRect, you can use all of it's methods to inspect the dimentions of the output.

Compiz also provides some of the information that X11 provides about the output to plugins. For example ::name () returns the name that is given to the output by whatever is managing it, so in some cases this might be "LVDS-1" or "HDMI-1" or "DVI-1". It is very rare that you will need to use this information.

Compiz also provides an ID number for each output, so you can look it up in CompScreen::outputs (); This is access through ::id ()

Usable Area

One of the things plugins will most use on outputs, especially when placing windows, is the output's Work Area. This is a CompRect which represents all of the area in the output not covered by windows such as panels or docks, where windows can actually be placed. Use this to determine where it makes sense to put stuff on the output. The work area can be accessed through the ::workArea () method.

Development/zero-nine/CoreClasses/CompOutput (last edited 2010-07-27 03:52:18 by 124-169-107-122)