<commit_before>/***************************************************************************

 TextEditor.mcc - Textediting MUI Custom Class
 Copyright (C) 1997-2000 <NAME>
 Copyright (C) 2005 by TextEditor.mcc Open Source Team

 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.

 TextEditor class Support Site:  http://www.sf.net/projects/texteditor-mcc

 $Id$

***************************************************************************/

#include <stdio.h>
#include <string.h>

#include <exec/tasks.h>
#include <libraries/mui.h>
#include <libraries/iffparse.h>
#include <clib/alib_protos.h>
#include <proto/dos.h>
#include <proto/exec.h>
#include <proto/muimaster.h>
#include <proto/intuition.h>
#include <proto/iffparse.h>

#include "TextEditor_mcc.h"
#include "private.h"

#include "SDI_hook.h"

HOOKPROTONHNO(URLHookCode, LONG, struct ClickMessage *cm)
{
  ULONG pos = cm->ClickPosition;

  while(pos && *(cm->LineContents+pos-1) != ' ' && *(cm->LineContents+pos-1) != '<')
  {
    pos--;
  }

  if(strncmp(cm->LineContents+pos, "http:", 5))
  {
    return(FALSE);
  }

  return(TRUE);
}
MakeStaticHook(URLHook, URLHookCode);

Object *editorgad;

HOOKPROTONHNONP(PosHookCode, void)
{
  ULONG x, y, sx, sy;
  struct Rectangle *crsr;
  if(DoMethod(editorgad, MUIM_TextEditor_BlockInfo, &x, &y, &sx, &sy))
  {
    printf("%ld, %ld, %ld, %ld\n", x, y, sx, sy);
  }

  if(get(editorgad, MUIA_TextEditor_CursorPosition, (APTR)&crsr))
    printf("Cursor: (%d, %d) - (%d, %d)\n", crsr->MinX, crsr->MinY, crsr->MaxX, crsr->MaxY);
}
MakeStaticHook(PosHook, PosHookCode);

#if defined(__amigaos4__)
struct Library *DiskfontBase = NULL;
struct Library *GfxBase = NULL;
struct Library *IntuitionBase = NULL;
struct Library *KeymapBase = NULL;
struct Library *LayersBase = NULL;
struct Library *LocaleBase = NULL;
struct Library *MUIMasterBase = NULL;
struct Library *RexxSysBase = NULL;
struct Library *UtilityBase = NULL;
struct Library *WorkbenchBase = NULL;
#elif defined(__MORPHOS__)
struct Library *DiskfontBase = NULL;
struct Library *GfxBase = NULL;
struct IntuitionBase *IntuitionBase = NULL;
struct Library *KeymapBase = NULL;
struct Library *LayersBase = NULL;
struct Library *LocaleBase = NULL;
struct Library *MUIMasterBase = NULL;
struct Library *RexxSysBase = NULL;
struct Library *UtilityBase = NULL;
struct Library *WorkbenchBase = NULL;
#else
struct Library *DiskfontBase = NULL;
struct Library *GfxBase = NULL;
struct IntuitionBase *IntuitionBase = NULL;
struct Library *KeymapBase = NULL;
struct Library *LayersBase = NULL;
struct Library *LocaleBase = NULL;
struct Library *MUIMasterBase = NULL;
struct Library *RexxSysBase = NULL;
struct Library *UtilityBase = NULL;
struct Library *WorkbenchBase = NULL;
#endif

#if defined(__amigaos4__)
struct DiskfontIFace *IDiskfont = NULL;
struct GraphicsIFace *IGraphics = NULL;
struct IntuitionIFace *IIntuition = NULL;
struct KeymapIFace *IKeymap = NULL;
struct LayersIFace *ILayers = NULL;
struct LocaleIFace *ILocale = NULL;
struct MUIMasterIFace *IMUIMaster = NULL;
struct RexxSysIFace *IRexxSys = NULL;
struct UtilityIFace *IUtility = NULL;
struct WorkbenchIFace *IWorkbench = NULL;
#endif

int main(void)
{
  void    *slider;
  long    argarray[6] = {0,0,0,0,0,0};<commit_msg>Fixed MorphOS build<commit_after>/***************************************************************************

 TextEditor.mcc - Textediting MUI Custom Class
 Copyright (C) 1997-2000 <NAME>
 Copyright (C) 2005 by TextEditor.mcc Open Source Team

 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.

 TextEditor class Support Site:  http://www.sf.net/projects/texteditor-mcc

 $Id$

***************************************************************************/

#include <stdio.h>
#include <string.h>

#include <exec/tasks.h>
#include <libraries/mui.h>
#include <libraries/iffparse.h>
#include <clib/alib_protos.h>
#include <proto/dos.h>
#include <proto/exec.h>
#include <proto/muimaster.h>
#include <proto/intuition.h>
#include <proto/iffparse.h>

#include "TextEditor_mcc.h"
#include "private.h"

#include "SDI_hook.h"

HOOKPROTONHNO(URLHookCode, LONG, struct ClickMessage *cm)
{
  ULONG pos = cm->ClickPosition;

  while(pos && *(cm->LineContents+pos-1) != ' ' && *(cm->LineContents+pos-1) != '<')
  {
    pos--;
  }

  if(strncmp(cm->LineContents+pos, "http:", 5))
  {
    return(FALSE);
  }

  return(TRUE);
}
MakeStaticHook(URLHook, URLHookCode);

Object *editorgad;

HOOKPROTONHNONP(PosHookCode, void)
{
  ULONG x, y, sx, sy;
  struct Rectangle *crsr;
  if(DoMethod(editorgad, MUIM_TextEditor_BlockInfo, &x, &y, &sx, &sy))
  {
    printf("%ld, %ld, %ld, %ld\n", x, y, sx, sy);
  }

  if(get(editorgad, MUIA_TextEditor_CursorPosition, (APTR)&crsr))
    printf("Cursor: (%d, %d) - (%d, %d)\n", crsr->MinX, crsr->MinY, crsr->MaxX, crsr->MaxY);
}
MakeStaticHook(PosHook, PosHookCode);

#if defined(__amigaos4__)
struct Library *DiskfontBase = NULL;
struct Library *GfxBase = NULL;
struct Library *IntuitionBase = NULL;
struct Library *KeymapBase = NULL;
struct Library *LayersBase = NULL;
struct Library *LocaleBase = NULL;
struct Library *MUIMasterBase = NULL;
struct Library *RexxSysBase = NULL;
struct Library *UtilityBase = NULL;
struct Library *WorkbenchBase = NULL;
#elif defined(__MORPHOS__)
struct Library *DiskfontBase = NULL;
struct Library *GfxBase = NULL;
struct IntuitionBase *IntuitionBase = NULL;
struct Library *KeymapBase = NULL;
struct Library *LayersBase = NULL;
struct Library *LocaleBase = NULL;
struct Library *MUIMasterBase = NULL;
struct Library *RexxSysBase = NULL;
struct Library *UtilityBase = NULL;
struct Library *WorkbenchBase = NULL;
#else
struct Library *DiskfontBase = NULL;
struct Library *GfxBase = NULL;
struct IntuitionBase *IntuitionBase = NULL;
struct Library *KeymapBase = NULL;
struct Library *LayersBase = NULL;
struct Library *LocaleBase = NULL;
struct Library *MUIMasterBase = NULL;
struct Library *RexxSysBase = NULL;
struct Library *UtilityBase = NULL;
struct Library *WorkbenchBase = NULL;
#endif

#if defined(__amigaos4__)
struct DiskfontIFace *IDiskfont = NULL;
struct GraphicsIFace *IGraphics = NULL;
struct IntuitionIFace *IIntuition = NULL;
struct KeymapIFace *IKeymap = NULL;
struct LayersIFace *ILayers = NULL;
struct LocaleIFace *ILocale = NULL;
struct MUIMasterIFace *IMUIMaster = NULL;
struct RexxSysIFace *IRexxSys = NULL;
struct UtilityIFace *IUtility = NULL;
struct WorkbenchIFace *IWorkbench = NULL;
#endif

#ifdef __MORPHOS__
DISPATCHERPROTO(_Dispatcher);
#endif

int main(void)
{
  void    *slider;
  long    argarray[6] = {0,0,0,0,0,0};
{'fraction_non_alphanumeric': 0.1508139378447464, 'fraction_numerical': 0.006995829409390556, 'mean_word_length': 5.419689119170984, 'pattern_counts': {'":': 0, '<': 29, '<?xml version=': 0, '>': 43, 'https://': 0, 'lorem ipsum': 0, 'www.': 2, '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': '76453', 'n_tokens_mistral': 2516, 'n_tokens_neox': 2429, 'n_words': 741}