<commit_before>/*
 * Ion xinerama module
 * based on mod_xrandr by <NAME> and <NAME>
 *
 * by <NAME> <<EMAIL>>
 *
 * This library is free software; you can redistribute it and/or
 * modify it under the terms of the GNU Lesser General Public
 * License as published by the Free Software Foundation; either
 * version 2.1 of the License,or (at your option) any later version.
 *
 * This library is distributed in the hope that it will be useful,
 * but WITHOUT ANY WARRANTY; without even the implied warranty of
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
 * Lesser General Public License for more details.
 *
 * You should have received a copy of the GNU Lesser General Public
 * License along with this library; if not,write to the Free Software
 * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
 *
 */


#include <X11/Xlib.h>
#include <X11/extensions/Xinerama.h>
#include <ioncore/common.h>
#include <ioncore/global.h>
#include <ioncore/mplex.h>
#include <ioncore/group-ws.h>
#include <ioncore/sizepolicy.h>
#include <ioncore/../version.h>

#ifdef MOD_XINERAMA_DEBUG
#include <stdio.h>
#endif

char mod_xinerama_ion_api_version[]=ION_API_VERSION;

static int xinerama_event_base;
static int xinerama_error_base;

bool mod_xinerama_init()
{
    WRootWin* rootWin = ioncore_g.rootwins;
    Display* dpy = ioncore_g.dpy;
    int scrNum,nScreens;
    XineramaScreenInfo* sInfo;
    WScreen* new;

    int nRects;
    int i;

    if(XineramaQueryExtension(dpy,&xinerama_event_base, &xinerama_error_base))
    {
        XineramaScreenInfo* sInfo;
        sInfo = XineramaQueryScreens(dpy, &nRects);

        if(!sInfo)
        {
            warn(TR("Could not retrieve Xinerama screen info, sorry."));
            return FALSE ;
        }
        
        for(i = 0 ; i < nRects ; ++i)
        {
            WFitParams fp;
            WMPlexAttachParams par = MPLEXATTACHPARAMS_INIT;

            WScreen* newScreen;
            WRegion* reg=NULL;
#ifdef MOD_XINERAMA_DEBUG
            printf("Rectangle #%d: x=%d y=%d width=%u height=%u\n", 
                   i+1, sInfo[i].x_org, sInfo[i].y_org, sInfo[i].width,<commit_msg>fix-screen-wrap<commit_after>/*
 * Ion xinerama module
 * based on mod_xrandr by <NAME> and <NAME>
 *
 * by <NAME> <<EMAIL>>
 *
 * This library is free software; you can redistribute it and/or
 * modify it under the terms of the GNU Lesser General Public
 * License as published by the Free Software Foundation; either
 * version 2.1 of the License,or (at your option) any later version.
 *
 * This library is distributed in the hope that it will be useful,
 * but WITHOUT ANY WARRANTY; without even the implied warranty of
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
 * Lesser General Public License for more details.
 *
 * You should have received a copy of the GNU Lesser General Public
 * License along with this library; if not,write to the Free Software
 * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
 *
 */


#include <X11/Xlib.h>
#include <X11/extensions/Xinerama.h>
#include <ioncore/common.h>
#include <ioncore/global.h>
#include <ioncore/mplex.h>
#include <ioncore/group-ws.h>
#include <ioncore/sizepolicy.h>
#include <ioncore/../version.h>

#ifdef MOD_XINERAMA_DEBUG
#include <stdio.h>
#endif

char mod_xinerama_ion_api_version[]=ION_API_VERSION;

static int xinerama_event_base;
static int xinerama_error_base;

bool mod_xinerama_init()
{
    WRootWin* rootWin = ioncore_g.rootwins;
    Display* dpy = ioncore_g.dpy;
    int scrNum,nScreens;
    XineramaScreenInfo* sInfo;
    WScreen* new;

    int nRects;
    int i;

    ioncore_g.screens = NULL;

    if(XineramaQueryExtension(dpy,&xinerama_event_base, &xinerama_error_base))
    {
        XineramaScreenInfo* sInfo;
        sInfo = XineramaQueryScreens(dpy, &nRects);

        if(!sInfo)
        {
            warn(TR("Could not retrieve Xinerama screen info, sorry."));
            return FALSE ;
        }
        
        for(i = 0 ; i < nRects ; ++i)
        {
            WFitParams fp;
            WMPlexAttachParams par = MPLEXATTACHPARAMS_INIT;

            WScreen* newScreen;
            WRegion* reg=NULL;
#ifdef MOD_XINERAMA_DEBUG
            printf("Rectangle #%d: x=%d y=%d width=%u height=%u\n", 
                   i+1, sInfo[i].x_org, sInfo[i].y_org, sInfo[i].width,
{'fraction_non_alphanumeric': 0.09842429778488239, 'fraction_numerical': 0.010047956154373145, 'mean_word_length': 3.1088180112570356, 'pattern_counts': {'":': 0, '<': 33, '<?xml version=': 0, '>': 31, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '745762', 'n_tokens_mistral': 1494, 'n_tokens_neox': 1434, 'n_words': 437}