1{%MainUnit Gtk2Extra.pp}
2{ $Id$ }
3{
4 *****************************************************************************
5  This file is part of the Lazarus Component Library (LCL)
6
7  See the file COPYING.modifiedLGPL.txt, included in this distribution,
8  for details about the license.
9 *****************************************************************************
10}
11
12function GTK_TYPE_CELL_VIEW: GType;
13begin
14  GTK_TYPE_CELL_VIEW:=gtk_cell_view_get_type;
15end;
16
17function GTK_CELL_VIEW(obj: pointer): PGtkCellView;
18begin
19  GTK_CELL_VIEW:=PGtkCellView(GTK_CHECK_CAST(obj,GTK_TYPE_CELL_VIEW));
20end;
21
22function GTK_IS_CELL_VIEW(obj: pointer): boolean;
23begin
24  GTK_IS_CELL_VIEW:=GTK_CHECK_TYPE(obj,GTK_TYPE_CELL_VIEW);
25end;
26
27function GTK_IS_CELL_VIEW_CLASS(klass: pointer): boolean;
28begin
29  GTK_IS_CELL_VIEW_CLASS:=GTK_CHECK_CLASS_TYPE(klass,GTK_TYPE_CELL_VIEW);
30end;
31
32function gtk_cell_view_get_model(cell_view: PGtkCellView): PGtkTreeModel;
33var
34  Value: TGvalue;
35begin
36  FillByte(Value{%H-},SizeOf(Value),0);
37  g_value_init(@Value,GTK_TYPE_TREE_MODEL);
38  g_object_get_property(PGObject(Cell_View),'model',@Value);
39  Result:=PGtkTreeModel(g_value_get_object(@Value));
40end;
41
42{$ifdef windows}
43procedure gdk_window_copy_area(Dest : PGDKWindow; GC : PGDKGC; DestX,
44  DestY : Longint; SRC : PGDKWindow; XSRC, YSRC, Width, Height : Longint);
45begin
46  gdk_draw_pixmap(Dest, GC, Src, XSrc, YSrc, DestX, DestY, Width, Height);
47end;
48{$endif}
49
50var
51  gtkhandle: tlibhandle;
52  glibhandle: tlibhandle;
53  gdklibhandle: tlibhandle;
54  libIter: Integer;
55
56initialization
57  for libIter := High(GtkLibNames) downto Low(GtkLibNames) do
58  begin
59    gtkhandle := LoadLibrary(GtkLibNames[libIter]);
60    if gtkhandle <> 0 then
61    begin
62      pointer(gtk_window_set_opacity):=GetProcAddress(gtkhandle,'gtk_window_set_opacity');
63      pointer(gtk_tree_view_get_grid_lines):=GetProcAddress(gtkhandle,'gtk_tree_view_get_grid_lines');
64      pointer(gtk_tree_view_set_grid_lines):=GetProcAddress(gtkhandle,'gtk_tree_view_set_grid_lines');
65      pointer(gtk_window_get_group):=GetProcAddress(gtkhandle,'gtk_window_get_group');
66      pointer(gtk_adjustment_configure):=GetProcAddress(gtkhandle,'gtk_adjustment_configure');
67      break;
68    end;
69  end;
70  for libIter := High(GLibNames) downto Low(GLibNames) do
71  begin
72    glibhandle := LoadLibrary(GLibNames[libIter]);
73    if glibhandle <> 0 then
74    begin
75      pointer(g_object_ref_sink):=GetProcAddress(glibhandle,'g_object_ref_sink');
76      break;
77    end;
78  end;
79  gdklibhandle := LoadLibrary(gdklib);
80  if gdklibhandle <> 0 then
81  begin
82   pointer(gdk_window_get_cursor) := GetProcAddress(gdklibhandle,'gdk_window_get_cursor');
83   pointer(gdk_screen_get_primary_monitor) := GetProcAddress(gdklibhandle,'gdk_screen_get_primary_monitor');
84  end;
85
86finalization
87  if gtkhandle <> 0 then
88    FreeLibrary(gtkhandle);
89  if glibhandle <> 0 then
90    FreeLibrary(glibhandle);
91  if gdklibhandle <> 0 then
92    FreeLibrary(gdklibhandle);
93