/*
(c) Copyright 1988-1994 Microsoft Corporation.

Microsoft Bars&Pipes Professional Source Code License

This License governs use of the accompanying Software.  
Microsoft hopes you find this Software useful.

You are licensed to do anything you want with the Software. 

In return, we simply require that you agree:

1.	Not to remove any copyright notices from the Software.

2.	That the Software comes "as is", with no warranties.  
	None whatsoever. This means no implied warranty of merchantability or 
	fitness for a particular purpose or any warranty of non-infringement.  
	Also, you must pass this disclaimer on whenever you distribute the Software.

3.	That we will not be liable for any of those types of damages known as indirect, 
	special, consequential, or incidental related to the Software or this License, 
	to the maximum extent the law permits. Also, you must pass this limitation of 
	liability on whenever you distribute the Software.

4.	That if you sue anyone over patents that you think may apply to the Software 
	for that person’s use of the Software, your license to the Software ends automatically.

5.	That the patent rights Microsoft is licensing only apply to the Software, 
	not to any derivatives you make.

6.	That your rights under the License end automatically if you breach this in any way.
*/
#include <graphics/text.h>
#include <intuition/intuition.h>

/* none of these flags are supported yet except ROPE_ACTIVE which is
   internal
*/

#define ROPE_LONGINT     0x0001
#define ROPE_CENTER      0x0002
#define ROPE_RIGHT       0x0004
#define ROPE_LEFT        0x0000
#define ROPE_ACTIVE      0x8000
#define ROPE_USERTOGGLE1 0x1000
#define ROPE_USERTOGGLE2 0x2000
#define ROPE_LENGTH	 0x0008 /* 1 if this is a length, 0 if it is a position */

/* Never change anything before long flags or else Reeses Pieces might
stop working!
*/

typedef struct RopeGadget
{
  void *UserData;
  char  onbackcolor, ontextcolor;
  char  offbackcolor,offtextcolor;
  short maxchars;
  short next_gad, prev_gad;
  char *buffer,*undobuffer;
  long  flags;

/* this stuff below is internal only */

  struct TextFont *font;
  short disppos,bufferpos;
  long  longint;
} RopeGadget;

void RefreshRopeGadget(struct Window *win,struct Gadget *gad);
int  HandleRopeGadget(struct Window *win,struct Gadget *gad,short x,short y);
void InitRopeGadget(struct Window *win,struct Gadget *gad,short next_gad,short prev_gad);
void InitRopeLengthGadget(struct Window *win,struct Gadget *gad,short next_gad,short prev_gad);
