home *** CD-ROM | disk | FTP | other *** search
/ Geek Gadgets 1 / ADE-1.bin / ade-bin / x11r6.1 / man / cat3 / xallocsizehints.0 < prev    next >
Encoding:
Text File  |  1996-10-17  |  11.0 KB  |  331 lines

  1.  
  2.  
  3.  
  4. XAllocSizeHints(3X11)      XLIB FUNCTIONS    XAllocSizeHints(3X11)
  5.  
  6.  
  7. NNAAMMEE
  8.        XAllocSizeHints, XSetWMNormalHints, XGetWMNormalHints,
  9.        XSetWMSizeHints, XGetWMSizeHints, XSizeHints - allocate
  10.        size hints structure and set or read a window's
  11.        WM_NORMAL_HINTS property
  12.  
  13. SSYYNNTTAAXX
  14.        XSizeHints *XAllocSizeHints()
  15.  
  16.        void XSetWMNormalHints(_d_i_s_p_l_a_y, _w, _h_i_n_t_s)
  17.          Display *_d_i_s_p_l_a_y;
  18.          Window _w;
  19.          XSizeHints *_h_i_n_t_s;
  20.  
  21.        Status XGetWMNormalHints(_d_i_s_p_l_a_y, _w, _h_i_n_t_s___r_e_t_u_r_n,
  22.        _s_u_p_p_l_i_e_d___r_e_t_u_r_n)
  23.          Display *_d_i_s_p_l_a_y;
  24.          Window _w;
  25.          XSizeHints *_h_i_n_t_s___r_e_t_u_r_n;
  26.          long *_s_u_p_p_l_i_e_d___r_e_t_u_r_n;
  27.  
  28.        void XSetWMSizeHints(_d_i_s_p_l_a_y, _w, _h_i_n_t_s, _p_r_o_p_e_r_t_y)
  29.          Display *_d_i_s_p_l_a_y;
  30.          Window _w;
  31.          XSizeHints *_h_i_n_t_s;
  32.          Atom _p_r_o_p_e_r_t_y;
  33.  
  34.        Status XGetWMSizeHints(_d_i_s_p_l_a_y, _w, _h_i_n_t_s___r_e_t_u_r_n, _s_u_p_-
  35.        _p_l_i_e_d___r_e_t_u_r_n, _p_r_o_p_e_r_t_y)
  36.          Display *_d_i_s_p_l_a_y;
  37.          Window _w;
  38.          XSizeHints *_h_i_n_t_s___r_e_t_u_r_n;
  39.          long *_s_u_p_p_l_i_e_d___r_e_t_u_r_n;
  40.          Atom _p_r_o_p_e_r_t_y;
  41.  
  42. AARRGGUUMMEENNTTSS
  43.        _d_i_s_p_l_a_y     Specifies the connection to the X server.
  44.  
  45.        _h_i_n_t_s     Specifies the size hints for the window in its
  46.          normal state.
  47.  
  48.        _h_i_n_t_s     Specifies the _X_S_i_z_e_H_i_n_t_s structure to be used.
  49.  
  50.        _h_i_n_t_s___r_e_t_u_r_n
  51.          Returns the size hints for the window in its
  52.          normal state.
  53.  
  54.        _p_r_o_p_e_r_t_y     Specifies the property name.
  55.  
  56.        _s_u_p_p_l_i_e_d___r_e_t_u_r_n
  57.          Returns the hints that were supplied by the
  58.          user.
  59.  
  60.        _w     Specifies the window.
  61.  
  62.  
  63.  
  64. X Version 11           Release 6.1                1
  65.  
  66.  
  67.  
  68.  
  69.  
  70. XAllocSizeHints(3X11)      XLIB FUNCTIONS    XAllocSizeHints(3X11)
  71.  
  72.  
  73. DDEESSCCRRIIPPTTIIOONN
  74.        The _X_A_l_l_o_c_S_i_z_e_H_i_n_t_s function allocates and returns a
  75.        pointer to a _X_S_i_z_e_H_i_n_t_s structure.  Note that all fields
  76.        in the _X_S_i_z_e_H_i_n_t_s structure are initially set to zero.  If
  77.        insufficient memory is available, _X_A_l_l_o_c_S_i_z_e_H_i_n_t_s returns
  78.        NULL.  To free the memory allocated to this structure, use
  79.        _X_F_r_e_e.
  80.  
  81.        The _X_S_e_t_W_M_N_o_r_m_a_l_H_i_n_t_s function replaces the size hints for
  82.        the WM_NORMAL_HINTS property on the specified window.  If
  83.        the property does not already exist, _X_S_e_t_W_M_N_o_r_m_a_l_H_i_n_t_s
  84.        sets the size hints for the WM_NORMAL_HINTS property on
  85.        the specified window.  The property is stored with a type
  86.        of WM_SIZE_HINTS and a format of 32.
  87.  
  88.        _X_S_e_t_W_M_N_o_r_m_a_l_H_i_n_t_s can generate _B_a_d_A_l_l_o_c and _B_a_d_W_i_n_d_o_w
  89.        errors.
  90.  
  91.        The _X_G_e_t_W_M_N_o_r_m_a_l_H_i_n_t_s function returns the size hints
  92.        stored in the WM_NORMAL_HINTS property on the specified
  93.        window.    If the property is of type WM_SIZE_HINTS, is of
  94.        format 32, and is long enough to contain either an old
  95.        (pre-ICCCM) or new size hints structure, _X_G_e_t_W_M_N_o_r_m_a_l_H_i_n_t_s
  96.        sets the various fields of the _X_S_i_z_e_H_i_n_t_s structure, sets
  97.        the supplied_return argument to the list of fields that
  98.        were supplied by the user (whether or not they contained
  99.        defined values), and returns a nonzero status.  Otherwise,
  100.        it returns a zero status.
  101.  
  102.        If _X_G_e_t_W_M_N_o_r_m_a_l_H_i_n_t_s returns successfully and a pre-ICCCM
  103.        size hints property is read, the supplied_return argument
  104.        will contain the following bits:
  105.  
  106.        (USPosition|USSize|PPosition|PSize|PMinSize|
  107.     PMaxSize|PResizeInc|PAspect)
  108.  
  109.        If the property is large enough to contain the base size
  110.        and window gravity fields as well, the supplied_return
  111.        argument will also contain the following bits:
  112.  
  113.        PBaseSize|PWinGravity
  114.  
  115.        _X_G_e_t_W_M_N_o_r_m_a_l_H_i_n_t_s can generate a PN BadWindow error.
  116.  
  117.        The _X_S_e_t_W_M_S_i_z_e_H_i_n_t_s function replaces the size hints for
  118.        the specified property on the named window.  If the speci-
  119.        fied property does not already exist, _X_S_e_t_W_M_S_i_z_e_H_i_n_t_s sets
  120.        the size hints for the specified property on the named
  121.        window.    The property is stored with a type of
  122.        WM_SIZE_HINTS and a format of 32.  To set a window's nor-
  123.        mal size hints, you can use the _X_S_e_t_W_M_N_o_r_m_a_l_H_i_n_t_s func-
  124.        tion.
  125.  
  126.        _X_S_e_t_W_M_S_i_z_e_H_i_n_t_s can generate _B_a_d_A_l_l_o_c, _B_a_d_A_t_o_m, and
  127.  
  128.  
  129.  
  130. X Version 11           Release 6.1                2
  131.  
  132.  
  133.  
  134.  
  135.  
  136. XAllocSizeHints(3X11)      XLIB FUNCTIONS    XAllocSizeHints(3X11)
  137.  
  138.  
  139.        _B_a_d_W_i_n_d_o_w errors.
  140.  
  141.        The _X_G_e_t_W_M_S_i_z_e_H_i_n_t_s function returns the size hints stored
  142.        in the specified property on the named window.  If the
  143.        property is of type WM_SIZE_HINTS, is of format 32, and is
  144.        long enough to contain either an old (pre-ICCCM) or new
  145.        size hints structure, _X_G_e_t_W_M_S_i_z_e_H_i_n_t_s sets the various
  146.        fields of the _X_S_i_z_e_H_i_n_t_s structure, sets the sup-
  147.        plied_return argument to the list of fields that were sup-
  148.        plied by the user (whether or not they contained defined
  149.        values), and returns a nonzero status.  Otherwise, it
  150.        returns a zero status.  To get a window's normal size
  151.        hints, you can use the _X_G_e_t_W_M_N_o_r_m_a_l_H_i_n_t_s function.
  152.  
  153.        If _X_G_e_t_W_M_S_i_z_e_H_i_n_t_s returns successfully and a pre-ICCCM
  154.        size hints property is read, the supplied_return argument
  155.        will contain the following bits:
  156.  
  157.        (USPosition|USSize|PPosition|PSize|PMinSize|
  158.     PMaxSize|PResizeInc|PAspect)
  159.  
  160.        If the property is large enough to contain the base size
  161.        and window gravity fields as well, the supplied_return
  162.        argument will also contain the following bits:
  163.  
  164.        PBaseSize|PWinGravity
  165.  
  166.        _X_G_e_t_W_M_S_i_z_e_H_i_n_t_s can generate _B_a_d_A_t_o_m and _B_a_d_W_i_n_d_o_w errors.
  167.  
  168. PPRROOPPEERRTTIIEESS
  169.        WM_NORMAL_HINTS
  170.          Size hints for a window in its normal state.
  171.          The C type of this property is _X_S_i_z_e_H_i_n_t_s.
  172.  
  173. SSTTRRUUCCTTUURREESS
  174.        The _X_S_i_z_e_H_i_n_t_s structure contains:
  175.  
  176.        /* Size hints mask bits */
  177.        #define     _U_S_P_o_s_i_t_i_o_n    (1L << 0)      /* user specified x, y */
  178.        #define     _U_S_S_i_z_e           (1L << 1)      /* user specified width, height
  179.                           */
  180.        #define     _P_P_o_s_i_t_i_o_n     (1L << 2)      /* program specified position
  181.                           */
  182.        #define     _P_S_i_z_e           (1L << 3)      /* program specified size */
  183.        #define     _P_M_i_n_S_i_z_e      (1L << 4)      /* program specified minimum
  184.                           size */
  185.        #define     _P_M_a_x_S_i_z_e      (1L << 5)      /* program specified maximum
  186.                           size */
  187.        #define     _P_R_e_s_i_z_e_I_n_c    (1L << 6)      /* program specified resize
  188.                           increments */
  189.        #define     _P_A_s_p_e_c_t       (1L << 7)      /* program specified min and
  190.                           max aspect ratios */
  191.        #define     _P_B_a_s_e_S_i_z_e     (1L << 8)
  192.  
  193.  
  194.  
  195.  
  196. X Version 11           Release 6.1                3
  197.  
  198.  
  199.  
  200.  
  201.  
  202. XAllocSizeHints(3X11)      XLIB FUNCTIONS    XAllocSizeHints(3X11)
  203.  
  204.  
  205.        #define     _P_W_i_n_G_r_a_v_i_t_y   (1L << 9)
  206.        #define     _P_A_l_l_H_i_n_t_s     (PPosi-
  207.                    tion|PSize|
  208.                    PMin-
  209.                    Size|PMaxSize|
  210.                    PRe-
  211.                    sizeInc|PAspect)
  212.        /* Values */
  213.  
  214.        typedef struct {
  215.         long flags;        /* marks which fields in this structure are defined */
  216.         int x, y;        /* Obsolete */
  217.         int width, height;    /* Obsolete */
  218.         int min_width, min_height;
  219.         int max_width, max_height;
  220.         int width_inc, height_inc;
  221.         struct {
  222.            int x;    /* numerator */
  223.            int y;    /* denominator */
  224.         } min_aspect, max_aspect;
  225.         int base_width, base_height;
  226.         int win_gravity;
  227.         /* this structure may be extended in the future */
  228.        } XSizeHints;
  229.  
  230.        The x, y, width, and height members are now obsolete and
  231.        are left solely for compatibility reasons.  The min_width
  232.        and min_height members specify the minimum window size
  233.        that still allows the application to be useful.    The
  234.        max_width and max_height members specify the maximum win-
  235.        dow size.  The width_inc and height_inc members define an
  236.        arithmetic progression of sizes (minimum to maximum) into
  237.        which the window prefers to be resized.    The min_aspect
  238.        and max_aspect members are expressed as ratios of x and y,
  239.        and they allow an application to specify the range of
  240.        aspect ratios it prefers.  The base_width and base_height
  241.        members define the desired size of the window.  The window
  242.        manager will interpret the position of the window and its
  243.        border width to position the point of the outer rectangle
  244.        of the overall window specified by the win_gravity member.
  245.        The outer rectangle of the window includes any borders or
  246.        decorations supplied by the window manager.  In other
  247.        words, if the window manager decides to place the window
  248.        where the client asked, the position on the parent win-
  249.        dow's border named by the win_gravity will be placed where
  250.        the client window would have been placed in the absence of
  251.        a window manager.
  252.  
  253.        Note that use of the _P_A_l_l_H_i_n_t_s macro is highly discour-
  254.        aged.
  255.  
  256. DDIIAAGGNNOOSSTTIICCSS
  257.        _B_a_d_A_l_l_o_c     The server failed to allocate the requested
  258.          resource or server memory.
  259.  
  260.  
  261.  
  262. X Version 11           Release 6.1                4
  263.  
  264.  
  265.  
  266.  
  267.  
  268. XAllocSizeHints(3X11)      XLIB FUNCTIONS    XAllocSizeHints(3X11)
  269.  
  270.  
  271.        _B_a_d_A_t_o_m     A value for an Atom argument does not name a
  272.          defined Atom.
  273.  
  274.        _B_a_d_W_i_n_d_o_w A value for a Window argument does not name a
  275.          defined Window.
  276.  
  277. SSEEEE AALLSSOO
  278.        XAllocClassHint(3X11), XAllocIconSize(3X11), XAl-
  279.        locWMHints(3X11), XFree(3X11), XSetCommand(3X11), XSet-
  280.        TransientForHint(3X11), XSetTextProperty(3X11), XSetWM-
  281.        ClientMachine(3X11), XSetWMColormapWindows(3X11), XSetWMI-
  282.        conName(3X11), XSetWMName(3X11), XSetWMProperties(3X11),
  283.        XSetWMProtocols(3X11), XStringListToTextProperty(3X11)
  284.        _X_l_i_b _- _C _L_a_n_g_u_a_g_e _X _I_n_t_e_r_f_a_c_e
  285.  
  286.  
  287.  
  288.  
  289.  
  290.  
  291.  
  292.  
  293.  
  294.  
  295.  
  296.  
  297.  
  298.  
  299.  
  300.  
  301.  
  302.  
  303.  
  304.  
  305.  
  306.  
  307.  
  308.  
  309.  
  310.  
  311.  
  312.  
  313.  
  314.  
  315.  
  316.  
  317.  
  318.  
  319.  
  320.  
  321.  
  322.  
  323.  
  324.  
  325.  
  326.  
  327.  
  328. X Version 11           Release 6.1                5
  329.  
  330.  
  331.