Commit c473d42d authored by Gustavo Girldez's avatar Gustavo Girldez Committed by Gustavo Giráldez

New files. Object which wraps layout managment stuff for the dock.

2002-01-13  Gustavo Girldez  <gustavo.giraldez@gmx.net>

	* gdl/gdl-dock-layout.[ch]: New files.  Object which wraps layout
	managment stuff for the dock.

	* gdl/layout.glade: Layout manager interface file.

	* gdl/test-dock.c: Removed layout saving/restoring stuff, replaced
	with GdlDockLayout object.

	* configure.in:	Added libglade dependency.

	* gdl/Makefile.am: Added GdlDockLayout.  Added
	GDK_DISABLE_DEPRECATED flag.

	* gdl/gdl-dock-item.c
	  gdl/gdl-dock-paned.c
	  gdl/gdl-dock.c: Replaced GDK deprecated function calls.
parent fb3cd52b
2002-01-13 Gustavo Girldez <gustavo.giraldez@gmx.net>
* gdl/gdl-dock-layout.[ch]: New files. Object which wraps layout
managment stuff for the dock.
* gdl/layout.glade: Layout manager interface file.
* gdl/test-dock.c: Removed layout saving/restoring stuff, replaced
with GdlDockLayout object.
* configure.in: Added libglade dependency.
* gdl/Makefile.am: Added GdlDockLayout. Added
GDK_DISABLE_DEPRECATED flag.
* gdl/gdl-dock-item.c
gdl/gdl-dock-paned.c
gdl/gdl-dock.c: Replaced GDK deprecated function calls.
2002-01-12 Dave Camp <dave@ximian.com>
* configure.in: Changed the version handling to be a bit simpler.
......
......@@ -19,14 +19,18 @@ AC_SUBST(GDL_MINOR_VERSION)
AC_SUBST(GDL_MICRO_VERSION)
AC_SUBST(GDL_VERSION)
AC_PROG_INTLTOOL
GTK_REQUIRED=1.3.9
GNOME_REQUIRED=1.96.0
BONOBOUI_REQUIRED=1.108.1
XML_REQUIRED=2.2.8
LIBGLADE_REQUIRED=1.99.5
AC_SUBST(GTK_REQUIRED)
AC_SUBST(GNOME_REQUIRED)
AC_SUBST(XML_REQUIRED)
AC_SUBST(LIBGLADE_REQUIRED)
AM_MAINTAINER_MODE
......@@ -250,10 +254,15 @@ AC_SUBST(GAL_LIBS)
PKG_CHECK_MODULES(GDL_DEPENDENCIES,
gtk+-2.0 >= $GTK_REQUIRED
libgnome-2.0 >= $GNOME_REQUIRED
libbonoboui-2.0 >= $BONOBOUI_REQUIRED)
libbonoboui-2.0 >= $BONOBOUI_REQUIRED
libglade-2.0 >= $LIBGLADE_REQUIRED)
AC_SUBST(GDL_DEPENDENCIES_CFLAGS)
AC_SUBST(GDL_DEPENDENCIES_LIBS)
# libglade-convert, FIXME: to be removed when glade2 stabilizes
dnl AC_PATH_PROG(LIBGLADE_CONVERT, libglade-convert,
dnl AC_MSG_ERROR(libglade-convert not found))
# orbit-idl
ORBIT_IDL="`$PKG_CONFIG --variable=orbit_idl ORBit-2.0`"
AC_SUBST(ORBIT_IDL)
......
......@@ -12,3 +12,5 @@ test-dock
libgdlmarshal.c
libgdlmarshal.h
libgdltypebuiltins.*
layout.xml
test-dataview
INCLUDES = \
-DGNOMELOCALEDIR=\""$(datadir)/locales"\" \
-DGDL_GLADEDIR=\""$(gladedir)"\" \
-DG_DISABLE_DEPRECATED \
-DGTK_DISABLE_DEPRECATED \
-DGDK_DISABLE_DEPRECATED \
-I$(includedir) -I$(top_srcdir) \
$(WARN_CFLAGS) \
-DPREFIX=\""$(prefix)"\" \
......@@ -47,6 +49,7 @@ libgdl_1_la_SOURCES = \
gdl-dock-notebook.c \
gdl-dock-paned.c \
gdl-dock-tablabel.c \
gdl-dock-layout.c \
gdl-file-selector-util.c \
libgdltypebuiltins.c \
libgdlmarshal.c
......@@ -72,6 +75,7 @@ libgdl_headers = \
gdl-dock-notebook.h \
gdl-dock-paned.h \
gdl-dock-tablabel.h \
gdl-dock-layout.h \
gdl-file-selector-util.h
libgdlincludedir = $(includedir)/libgdl-1.0/gdl
......@@ -80,6 +84,13 @@ libgdlinclude_HEADERS = \
$(libgdl_headers) \
libgdltypebuiltins.h
gladedir = $(datadir)/gdl/glade
glade_DATA = layout.glade
# layout.glade: layout.glade1 $(LIBGLADE_CONVERT)
# $(LIBGLADE_CONVERT) layout.glade1 > layout.glade.tmp && \
# mv layout.glade.tmp layout.glade
test_dataview_SOURCES = \
gdl-data-view.h \
gdl-data-view.c \
......@@ -97,7 +108,7 @@ test_dataview_LDADD = $(GDL_DEPENDENCIES_LIBS)
# enumerations code generation
libgdltypebuiltins.c: Makefile.am $(libgdl_headers)
libgdltypebuiltins.c: $(libgdl_headers)
@GLIB_MKENUMS@ \
--fhead "#include <glib-object.h>\n" \
--fhead "#include \"libgdltypebuiltins.h\"\n\n" \
......@@ -114,7 +125,7 @@ libgdltypebuiltins.c: Makefile.am $(libgdl_headers)
&& cp xgen-gtbec $(@F) \
&& rm -f xgen-gtbec
libgdltypebuiltins.h: Makefile.am $(libgdl_headers)
libgdltypebuiltins.h: $(libgdl_headers)
@GLIB_MKENUMS@ \
--fhead "#ifndef __LIBGDLTYPEBUILTINS_H__\n" \
--fhead "#define __LIBGDLTYPEBUILTINS_H__ 1\n\n" \
......@@ -129,13 +140,13 @@ libgdltypebuiltins.h: Makefile.am $(libgdl_headers)
&& cp xgen-gth $(@F) \
&& rm -f xgen-gth
libgdlmarshal.h: Makefile.am libgdlmarshal.list
libgdlmarshal.h: libgdlmarshal.list
@GLIB_GENMARSHAL@ \
--prefix=gdl_marshal libgdlmarshal.list --header > xgen-gmc \
&& cp xgen-gmc $(@F) \
&& rm -f xgen-gmc
libgdlmarshal.c: Makefile.am libgdlmarshal.h
libgdlmarshal.c: libgdlmarshal.h
echo "#include \"libgdlmarshal.h\"" > xgen-gmc \
&& @GLIB_GENMARSHAL@ \
--prefix=gdl_marshal libgdlmarshal.list --body >> xgen-gmc \
......
......@@ -820,7 +820,7 @@ gdl_dock_item_paint (GtkWidget *widget,
if (gdk_rectangle_intersect (&event->area, &rect, &dest))
draw_textured_frame (widget, item->bin_window, &rect,
GTK_SHADOW_OUT, &event->area);
GTK_SHADOW_OUT, &dest);
}
}
......@@ -1165,7 +1165,7 @@ gdl_dock_item_grab_pointer (GdlDockItem *item)
fleur,
GDK_CURRENT_TIME) != 0);
gdk_cursor_destroy (fleur);
gdk_cursor_unref (fleur);
}
static void
......@@ -1784,8 +1784,7 @@ gdl_dock_item_window_float (GdlDockItem *item)
item->float_width, item->float_height);
gdk_window_reparent (item->bin_window, item->float_window, 0, 0);
gdk_window_set_hints (item->float_window, item->float_x, item->float_y,
0, 0, 0, 0, GDK_HINT_POS);
gdk_window_move (item->float_window, item->float_x, item->float_y);
allocation.x = allocation.y = 0;
allocation.width = item->float_width;
......
This diff is collapsed.
/* -*- Mode: C; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
#ifndef __GDL_DOCK_LAYOUT_H__
#define __GDL_DOCK_LAYOUT_H__
#include <glib.h>
#include <libxml/tree.h>
#include <glade/glade.h>
#include <gdl/gdl-dock.h>
#define GDL_TYPE_DOCK_LAYOUT (gdl_dock_layout_get_type ())
#define GDL_DOCK_LAYOUT(object) (GTK_CHECK_CAST ((object), GDL_TYPE_DOCK_LAYOUT, GdlDockLayout))
#define GDL_DOCK_LAYOUT_CLASS(klass) (GTK_CHECK_CLASS_CAST ((klass), GDL_TYPE_DOCK_LAYOUT, GdlDockLayoutClass))
#define GDL_IS_DOCK_LAYOUT(object) (GTK_CHECK_TYPE ((object), GDL_TYPE_DOCK_LAYOUT))
#define GDL_IS_DOCK_LAYOUT_CLASS(klass) (GTK_CHECK_CLASS_TYPE ((klass), GDL_TYPE_DOCK_LAYOUT))
#define GDL_DOCK_LAYOUT_GET_CLASS(object) (GTK_CHECK_GET_CLASS ((object), GDL_TYPE_DOCK_LAYOUT, GdlDockLayoutClass))
typedef struct _GdlDockLayout GdlDockLayout;
typedef struct _GdlDockLayoutClass GdlDockLayoutClass;
struct _GdlDockLayout {
GObject g_object;
GdlDock *dock;
xmlDocPtr doc;
gboolean dirty;
/* dialog section */
GtkWidget *dialog;
GtkWidget *layout_entry;
GtkTreeSelection *selection;
GtkListStore *items_model;
GtkListStore *layouts_model;
gboolean changed_by_user;
};
struct _GdlDockLayoutClass {
GObjectClass g_object_class;
};
GType gdl_dock_layout_get_type (void);
GdlDockLayout *gdl_dock_layout_new (GdlDock *dock);
void gdl_dock_layout_attach (GdlDockLayout *layout,
GdlDock *dock);
gboolean gdl_dock_layout_load_layout (GdlDockLayout *layout,
const gchar *name);
void gdl_dock_layout_save_layout (GdlDockLayout *layout,
const gchar *name);
void gdl_dock_layout_delete_layout (GdlDockLayout *layout,
const gchar *name);
GList *gdl_dock_layout_get_layouts (GdlDockLayout *layout,
gboolean include_default);
void gdl_dock_layout_run_manager (GdlDockLayout *layout);
gboolean gdl_dock_layout_load_from_file (GdlDockLayout *layout,
const gchar *filename);
gboolean gdl_dock_layout_save_to_file (GdlDockLayout *layout,
const gchar *filename);
gboolean gdl_dock_layout_is_dirty (GdlDockLayout *layout);
#endif
......@@ -302,7 +302,7 @@ gdl_dock_paned_realize (GtkWidget *widget)
paned->handle = gdk_window_new (widget->window,
&attributes, attributes_mask);
gdk_window_set_user_data (paned->handle, paned);
gdk_cursor_destroy (attributes.cursor);
gdk_cursor_unref (attributes.cursor);
widget->style = gtk_style_attach (widget->style, widget->window);
......@@ -381,7 +381,7 @@ gdl_dock_paned_unrealize (GtkWidget *widget)
paned = GDL_DOCK_PANED (widget);
if (paned->xor_gc) {
gdk_gc_destroy (paned->xor_gc);
g_object_unref (paned->xor_gc);
paned->xor_gc = NULL;
}
......@@ -1177,7 +1177,7 @@ gdl_dock_paned_set_orientation (GdlDockItem *item,
cursor = gdk_cursor_new (paned->cursor_type);
gdk_window_set_cursor (paned->handle, cursor);
gdk_cursor_destroy (cursor);
gdk_cursor_unref (cursor);
};
}
......
......@@ -121,12 +121,12 @@ gdl_dock_destroy (GtkObject *object)
/* destroy the xor gc */
if (dock->xor_gc) {
gdk_gc_unref (dock->xor_gc);
g_object_unref (dock->xor_gc);
dock->xor_gc = NULL;
}
if (dock->root_xor_gc) {
gdk_gc_unref (dock->root_xor_gc);
g_object_unref (dock->root_xor_gc);
dock->root_xor_gc = NULL;
}
......@@ -389,13 +389,14 @@ gdl_dock_xor_rect (GdlDock *dock, GdkRectangle *rect, gboolean floating)
values.function = GDK_INVERT;
values.subwindow_mode = GDK_INCLUDE_INFERIORS;
dock->root_xor_gc = gdk_gc_new_with_values
(GDK_ROOT_PARENT (), &values, GDK_GC_FUNCTION | GDK_GC_SUBWINDOW);
(gdk_window_lookup (gdk_x11_get_default_root_xwindow ()),
&values, GDK_GC_FUNCTION | GDK_GC_SUBWINDOW);
} else
return;
};
if (floating) {
window = GDK_ROOT_PARENT ();
window = gdk_window_lookup (gdk_x11_get_default_root_xwindow ());
gc = dock->root_xor_gc;
} else {
window = widget->window;
......
<?xml version="1.0" standalone="no"?> <!--*- mode: xml -*-->
<!DOCTYPE glade-interface SYSTEM "glade-2.0.dtd" >
<glade-interface>
<widget class="GtkDialog" id="layout_dialog">
<property name="border_width">4</property>
<property name="title" translatable="yes">Layout Managment</property>
<property name="type">GTK_WINDOW_DIALOG</property>
<property name="modal">yes</property>
<property name="allow_shrink">no</property>
<property name="allow_grow">yes</property>
<property name="visible">no</property>
<property name="window-position">GTK_WIN_POS_NONE</property>
<child internal-child="vbox">
<widget class="GtkVBox" id="dialog-vbox1">
<property name="homogeneous">no</property>
<property name="spacing">8</property>
<property name="visible">yes</property>
<child internal-child="action_area">
<widget class="GtkHButtonBox" id="dialog-action_area1">
<property name="layout_style">GTK_BUTTONBOX_END</property>
<property name="spacing">0</property>
<property name="visible">yes</property>
</widget>
<packing>
<property name="padding">0</property>
<property name="expand">no</property>
<property name="fill">yes</property>
<property name="pack_type">GTK_PACK_END</property>
</packing>
</child>
<child>
<widget class="GtkNotebook" id="notebook1">
<property name="can_focus">yes</property>
<property name="show_tabs">yes</property>
<property name="show_border">yes</property>
<property name="tab_pos">GTK_POS_TOP</property>
<property name="scrollable">no</property>
<property name="tab_hborder">2</property>
<property name="tab_vborder">2</property>
<property name="enable-popup">no</property>
<property name="visible">yes</property>
<child>
<widget class="GtkVBox" id="vbox2">
<property name="homogeneous">no</property>
<property name="spacing">0</property>
<property name="visible">yes</property>
<child>
<widget class="GtkScrolledWindow" id="dockitems_ph">
<property name="border_width">5</property>
<property name="hscrollbar_policy">GTK_POLICY_NEVER</property>
<property name="vscrollbar_policy">GTK_POLICY_ALWAYS</property>
<property name="visible">yes</property>
<child>
<widget class="GtkViewport" id="viewport2">
<property name="shadow_type">GTK_SHADOW_IN</property>
<property name="visible">yes</property>
<child>
<widget class="GtkTreeView" id="items_list">
<property name="visible">yes</property>
</widget>
</child>
</widget>
</child>
<child internal-child="hscrollbar">
<widget class="GtkHScrollbar" id="convertwidget1">
<property name="update_policy">GTK_UPDATE_CONTINUOUS</property>
<property name="visible">yes</property>
</widget>
</child>
<child internal-child="vscrollbar">
<widget class="GtkVScrollbar" id="convertwidget2">
<property name="update_policy">GTK_UPDATE_CONTINUOUS</property>
<property name="visible">yes</property>
</widget>
</child>
</widget>
<packing>
<property name="padding">0</property>
<property name="expand">yes</property>
<property name="fill">yes</property>
</packing>
</child>
</widget>
</child>
<child>
<widget class="GtkLabel" id="label1">
<property name="label" translatable="yes">Dock items</property>
<property name="justify">GTK_JUSTIFY_CENTER</property>
<property name="wrap">no</property>
<property name="xalign">0.5</property>
<property name="yalign">0.5</property>
<property name="xpad">0</property>
<property name="ypad">0</property>
<property name="visible">yes</property>
</widget>
<packing>
<property name="type">tab</property>
</packing>
</child>
<child>
<widget class="GtkVBox" id="vbox1">
<property name="border_width">5</property>
<property name="homogeneous">no</property>
<property name="spacing">5</property>
<property name="visible">yes</property>
<child>
<widget class="GtkHBox" id="hbox3">
<property name="homogeneous">no</property>
<property name="spacing">0</property>
<property name="visible">yes</property>
<child>
<widget class="GtkEntry" id="newlayout_entry">
<property name="can_focus">yes</property>
<property name="editable">yes</property>
<property name="text" translatable="yes"></property>
<property name="max-length">0</property>
<property name="visibility">yes</property>
<property name="visible">yes</property>
<signal name="activate" handler="on_newlayout_entry_activate" />
</widget>
<packing>
<property name="padding">0</property>
<property name="expand">yes</property>
<property name="fill">yes</property>
</packing>
</child>
<child>
<widget class="GtkButton" id="save_button">
<property name="can_focus">yes</property>
<property name="label" translatable="yes">Save</property>
<property name="relief">GTK_RELIEF_NORMAL</property>
<property name="visible">yes</property>
<signal name="clicked" handler="on_save_button_clicked" />
</widget>
<packing>
<property name="padding">0</property>
<property name="expand">no</property>
<property name="fill">no</property>
</packing>
</child>
</widget>
<packing>
<property name="padding">0</property>
<property name="expand">no</property>
<property name="fill">yes</property>
</packing>
</child>
<child>
<widget class="GtkScrolledWindow" id="scrolledwindow2">
<property name="hscrollbar_policy">GTK_POLICY_NEVER</property>
<property name="vscrollbar_policy">GTK_POLICY_ALWAYS</property>
<property name="visible">yes</property>
<child>
<widget class="GtkViewport" id="viewport1">
<property name="shadow_type">GTK_SHADOW_IN</property>
<property name="visible">yes</property>
<child>
<widget class="GtkTreeView" id="layouts_list">
<property name="visible">yes</property>
</widget>
</child>
</widget>
</child>
<child internal-child="hscrollbar">
<widget class="GtkHScrollbar" id="convertwidget3">
<property name="update_policy">GTK_UPDATE_CONTINUOUS</property>
<property name="visible">yes</property>
</widget>
</child>
<child internal-child="vscrollbar">
<widget class="GtkVScrollbar" id="convertwidget4">
<property name="update_policy">GTK_UPDATE_CONTINUOUS</property>
<property name="visible">yes</property>
</widget>
</child>
</widget>
<packing>
<property name="padding">0</property>
<property name="expand">yes</property>
<property name="fill">yes</property>
</packing>
</child>
<child>
<widget class="GtkHBox" id="hbox2">
<property name="homogeneous">yes</property>
<property name="spacing">10</property>
<property name="visible">yes</property>
<child>
<widget class="GtkButton" id="load_button">
<property name="can_focus">yes</property>
<property name="label" translatable="yes">Load</property>
<property name="relief">GTK_RELIEF_NORMAL</property>
<property name="visible">yes</property>
<signal name="clicked" handler="on_load_button_clicked" />
</widget>
<packing>
<property name="padding">0</property>
<property name="expand">no</property>
<property name="fill">yes</property>
</packing>
</child>
<child>
<widget class="GtkButton" id="delete_button">
<property name="can_focus">yes</property>
<property name="label" translatable="yes">Delete</property>
<property name="relief">GTK_RELIEF_NORMAL</property>
<property name="visible">yes</property>
<signal name="clicked" handler="on_delete_button_clicked" />
</widget>
<packing>
<property name="padding">0</property>
<property name="expand">no</property>
<property name="fill">yes</property>
</packing>
</child>
</widget>
<packing>
<property name="padding">0</property>
<property name="expand">no</property>
<property name="fill">yes</property>
</packing>
</child>
</widget>
</child>
<child>
<widget class="GtkLabel" id="label2">
<property name="label" translatable="yes">Layouts</property>
<property name="justify">GTK_JUSTIFY_CENTER</property>
<property name="wrap">no</property>
<property name="xalign">0.5</property>
<property name="yalign">0.5</property>
<property name="xpad">0</property>
<property name="ypad">0</property>
<property name="visible">yes</property>
</widget>
<packing>
<property name="type">tab</property>
</packing>
</child>
</widget>
<packing>
<property name="padding">0</property>
<property name="expand">yes</property>
<property name="fill">yes</property>
</packing>
</child>
</widget>
<packing>
<property name="padding">4</property>
<property name="expand">yes</property>
<property name="fill">yes</property>
</packing>
</child>
</widget>
</glade-interface>
<?xml version="1.0"?>
<GTK-Interface>
<project>
<name>Layout-mgr</name>
<program_name>layout-mgr</program_name>
<directory></directory>
<source_directory>src</source_directory>
<pixmaps_directory>pixmaps</pixmaps_directory>
<language>C</language>
<gnome_support>True</gnome_support>
<gettext_support>True</gettext_support>
<output_translatable_strings>True</output_translatable_strings>
<translatable_strings_file>layout</translatable_strings_file>
</project>
<widget>
<class>GnomeDialog</class>
<name>layout_dialog</name>
<border_width>4</border_width>
<title>Layout Managment</title>
<type>GTK_WINDOW_DIALOG</type>
<position>GTK_WIN_POS_NONE</position>
<modal>True</modal>
<allow_shrink>False</allow_shrink>
<allow_grow>True</allow_grow>
<auto_shrink>False</auto_shrink>
<auto_close>False</auto_close>
<hide_on_close>False</hide_on_close>
<widget>
<class>GtkVBox</class>
<child_name>GnomeDialog:vbox</child_name>
<name>dialog-vbox1</name>
<homogeneous>False</homogeneous>
<spacing>8</spacing>
<child>
<padding>4</padding>
<expand>True</expand>
<fill>True</fill>
</child>
<widget>
<class>GtkHButtonBox</class>
<child_name>GnomeDialog:action_area</child_name>
<name>dialog-action_area1</name>
<layout_style>GTK_BUTTONBOX_END</layout_style>
<spacing>0</spacing>
<child_min_width>85</child_min_width>
<child_min_height>27</child_min_height>
<child_ipad_x>7</child_ipad_x>
<child_ipad_y>0</child_ipad_y>
<child>
<padding>0</padding>
<expand>False</expand>
<fill>True</fill>
<pack>GTK_PACK_END</pack>
</child>
</widget>
<widget>
<class>GtkNotebook</class>
<name>notebook1</name>
<can_focus>True</can_focus>
<show_tabs>True</show_tabs>
<show_border>True</show_border>
<tab_pos>GTK_POS_TOP</tab_pos>
<scrollable>False</scrollable>
<tab_hborder>2</tab_hborder>
<tab_vborder>2</tab_vborder>
<popup_enable>False</popup_enable>
<child>
<padding>0</padding>
<expand>True</expand>
<fill>True</fill>
</child>
<widget>
<class>GtkVBox</class>
<name>vbox2</name>
<homogeneous>False</homogeneous>
<spacing>0</spacing>
<widget>
<class>GtkScrolledWindow</class>
<name>dockitems_ph</name>
<border_width>5</border_width>
<hscrollbar_policy>GTK_POLICY_NEVER</hscrollbar_policy>
<vscrollbar_policy>GTK_POLICY_ALWAYS</vscrollbar_policy>
<hupdate_policy>GTK_UPDATE_CONTINUOUS</hupdate_policy>
<vupdate_policy>GTK_UPDATE_CONTINUOUS</vupdate_policy>
<child>
<padding>0</padding>
<expand>True</expand>
<fill>True</fill>
</child>
<widget>
<class>GtkViewport</class>
<name>viewport2</name>
<shadow_type>GTK_SHADOW_IN</shadow_type>
<widget>
<class>GtkList</class>
<name>items_list</name>
<selection_mode>GTK_SELECTION_SINGLE</selection_mode>
</widget>
</widget>
</widget>
</widget>
<widget>
<class>GtkLabel</class>
<child_name>Notebook:tab</child_name>
<name>label1</name>
<label>Dock items</label>
<justify>GTK_JUSTIFY_CENTER</justify>
<wrap>False</wrap>
<xalign>0.5</xalign>