{
   $Id: gtkpaned.pp,v 1.1.2.1 2000/09/09 18:42:52 peter Exp $
}

{****************************************************************************
                                 Interface
****************************************************************************}

{$ifdef read_interface}

  type
     PGtkPaned = ^TGtkPaned;
     TGtkPaned = record
          container : TGtkContainer;
          child1 : PGtkWidget;
          child2 : PGtkWidget;
          handle : PGdkWindow;
          groove_rectangle : TGdkRectangle;
          xor_gc : PGdkGC;
          handle_size : guint16;
          gutter_size : guint16;
          child1_size : gint;
          last_allocation : gint;
          min_position : gint;
          max_position : gint;
          flag0 : {$ifdef win32}longint{$else}word{$endif};
          handle_xpos : gint16;
          handle_ypos : gint16;
       end;

  const
     bm_TGtkPaned_position_set = $1;
     bp_TGtkPaned_position_set = 0;
     bm_TGtkPaned_in_drag = $2;
     bp_TGtkPaned_in_drag = 1;
     bm_TGtkPaned_child1_shrink = $4;
     bp_TGtkPaned_child1_shrink = 2;
     bm_TGtkPaned_child1_resize = $8;
     bp_TGtkPaned_child1_resize = 3;
     bm_TGtkPaned_child2_shrink = $10;
     bp_TGtkPaned_child2_shrink = 4;
     bm_TGtkPaned_child2_resize = $20;
     bp_TGtkPaned_child2_resize = 5;
function  position_set(var a : TGtkPaned) : guint;
procedure set_position_set(var a : TGtkPaned; __position_set : guint);
function  in_drag(var a : TGtkPaned) : guint;
procedure set_in_drag(var a : TGtkPaned; __in_drag : guint);
function  child1_shrink(var a : TGtkPaned) : guint;
procedure set_child1_shrink(var a : TGtkPaned; __child1_shrink : guint);
function  child1_resize(var a : TGtkPaned) : guint;
procedure set_child1_resize(var a : TGtkPaned; __child1_resize : guint);
function  child2_shrink(var a : TGtkPaned) : guint;
procedure set_child2_shrink(var a : TGtkPaned; __child2_shrink : guint);
function  child2_resize(var a : TGtkPaned) : guint;
procedure set_child2_resize(var a : TGtkPaned; __child2_resize : guint);

  type
     PGtkPanedClass = ^TGtkPanedClass;
     TGtkPanedClass = record
          parent_class : TGtkContainerClass;
       end;

Type
  GTK_PANED=PGtkPaned;
  GTK_PANED_CLASS=PGtkPanedClass;

function  GTK_PANED_TYPE:TGtkType;cdecl;external gtkdll name 'gtk_paned_get_type';
function  GTK_IS_PANED(obj:pointer):boolean;
function  GTK_IS_PANED_CLASS(klass:pointer):boolean;

function  gtk_paned_get_type:TGtkType;cdecl;external gtkdll name 'gtk_paned_get_type';
procedure gtk_paned_add1(paned:PGtkPaned; child:PGtkWidget);cdecl;external gtkdll name 'gtk_paned_add1';
procedure gtk_paned_add2(paned:PGtkPaned; child:PGtkWidget);cdecl;external gtkdll name 'gtk_paned_add2';
procedure gtk_paned_pack1(paned:PGtkPaned; child:PGtkWidget; resize:gboolean; shrink:gboolean);cdecl;external gtkdll name 'gtk_paned_pack1';
procedure gtk_paned_pack2(paned:PGtkPaned; child:PGtkWidget; resize:gboolean; shrink:gboolean);cdecl;external gtkdll name 'gtk_paned_pack2';
procedure gtk_paned_set_position(paned:PGtkPaned; position:gint);cdecl;external gtkdll name 'gtk_paned_set_position';
procedure gtk_paned_set_handle_size(paned:PGtkPaned; size:guint16);cdecl;external gtkdll name 'gtk_paned_set_handle_size';
{$ifndef gtkwin}
procedure gtk_paned_set_gutter_size(paned:PGtkPaned; size:guint16);cdecl;external gtkdll name 'gtk_paned_set_gutter_size';
{$endif}
procedure gtk_paned_compute_position(paned:PGtkPaned; allocation:gint; child1_req:gint; child2_req:gint);cdecl;external gtkdll name 'gtk_paned_compute_position';

{$endif read_interface}


{****************************************************************************
                              Implementation
****************************************************************************}

{$ifdef read_implementation}

function  position_set(var a : TGtkPaned) : guint;
    begin
       position_set:=(a.flag0 and bm_TGtkPaned_position_set) shr bp_TGtkPaned_position_set;
    end;

procedure set_position_set(var a : TGtkPaned; __position_set : guint);
    begin
       a.flag0:=a.flag0 or ((__position_set shl bp_TGtkPaned_position_set) and bm_TGtkPaned_position_set);
    end;

function  in_drag(var a : TGtkPaned) : guint;
    begin
       in_drag:=(a.flag0 and bm_TGtkPaned_in_drag) shr bp_TGtkPaned_in_drag;
    end;

procedure set_in_drag(var a : TGtkPaned; __in_drag : guint);
    begin
       a.flag0:=a.flag0 or ((__in_drag shl bp_TGtkPaned_in_drag) and bm_TGtkPaned_in_drag);
    end;

function  child1_shrink(var a : TGtkPaned) : guint;
    begin
       child1_shrink:=(a.flag0 and bm_TGtkPaned_child1_shrink) shr bp_TGtkPaned_child1_shrink;
    end;

procedure set_child1_shrink(var a : TGtkPaned; __child1_shrink : guint);
    begin
       a.flag0:=a.flag0 or ((__child1_shrink shl bp_TGtkPaned_child1_shrink) and bm_TGtkPaned_child1_shrink);
    end;

function  child1_resize(var a : TGtkPaned) : guint;
    begin
       child1_resize:=(a.flag0 and bm_TGtkPaned_child1_resize) shr bp_TGtkPaned_child1_resize;
    end;

procedure set_child1_resize(var a : TGtkPaned; __child1_resize : guint);
    begin
       a.flag0:=a.flag0 or ((__child1_resize shl bp_TGtkPaned_child1_resize) and bm_TGtkPaned_child1_resize);
    end;

function  child2_shrink(var a : TGtkPaned) : guint;
    begin
       child2_shrink:=(a.flag0 and bm_TGtkPaned_child2_shrink) shr bp_TGtkPaned_child2_shrink;
    end;

procedure set_child2_shrink(var a : TGtkPaned; __child2_shrink : guint);
    begin
       a.flag0:=a.flag0 or ((__child2_shrink shl bp_TGtkPaned_child2_shrink) and bm_TGtkPaned_child2_shrink);
    end;

function  child2_resize(var a : TGtkPaned) : guint;
    begin
       child2_resize:=(a.flag0 and bm_TGtkPaned_child2_resize) shr bp_TGtkPaned_child2_resize;
    end;

procedure set_child2_resize(var a : TGtkPaned; __child2_resize : guint);
    begin
       a.flag0:=a.flag0 or ((__child2_resize shl bp_TGtkPaned_child2_resize) and bm_TGtkPaned_child2_resize);
    end;

function  GTK_IS_PANED(obj:pointer):boolean;
begin
  GTK_IS_PANED:=(obj<>nil) and GTK_IS_PANED_CLASS(PGtkTypeObject(obj)^.klass);
end;

function  GTK_IS_PANED_CLASS(klass:pointer):boolean;
begin
  GTK_IS_PANED_CLASS:=(klass<>nil) and (PGtkTypeClass(klass)^.thetype=GTK_PANED_TYPE);
end;

{$endif read_implementation}


{
  $Log: gtkpaned.pp,v $
  Revision 1.1.2.1  2000/09/09 18:42:52  peter
    * gtk win32 fixes

  Revision 1.1  2000/07/13 06:34:05  michael
  + Initial import

  Revision 1.2  2000/05/02 17:52:16  peter
    * win32 fix

  Revision 1.1  1999/11/24 23:36:36  peter
    * moved to packages dir

  Revision 1.9  1999/10/06 17:42:49  peter
    * external is now only in the interface
    * removed gtk 1.0 support

  Revision 1.8  1999/07/23 16:12:51  peter
    * use packrecords C

  Revision 1.7  1999/05/11 00:39:08  peter
    * win32 fixes

  Revision 1.6  1999/05/10 15:20:01  peter
    * cdecl fixes

  Revision 1.5  1999/05/10 09:03:36  peter
    * gtk 1.2 port working

  Revision 1.4  1998/11/09 10:10:19  peter
    + C type casts are now correctly handled

  Revision 1.3  1998/10/21 20:22:57  peter
    * cdecl, packrecord fixes (from the gtk.tar.gz)
    * win32 support
    * gtk.pp,gdk.pp for an all in one unit

}

