Compare commits

..

493 Commits

Author SHA1 Message Date
Owen Taylor
131966090f Released 1.2.10.
Sun Apr  1 23:01:31 2001  Owen Taylor  <otaylor@redhat.com>

	* Released 1.2.10.

Sun Apr  1 22:22:47 2001  Owen Taylor  <otaylor@redhat.com>

	[ Addition of safety checks to try to avoid segfaulting
	  on broken setups always. ]

	* gdk/gdkfont.c (_gdk_font_wc_to_glyphs): Add a boolean
	return value to deal with failure of conversion of
	wide characters to glyphs.

	* gtk/gtkentry.c gtk/gtklabel.c: Handle failure of
	mbstowcs/wcstombs a bit better.

	* gdk/gdkfont.c gdk/gdkdraw.c: Deal with failure of
	_gdk_font_wc_to_glyphs() gracefully

	* gdk/gdkim.c (_gdk_wcstombs_len): quietly return NULL on
	failure instead of g_return_if_fail().

Wed Mar 28 16:05:29 2001  Owen Taylor  <otaylor@redhat.com>

	* gtk/gtkfontsel.c (gtk_font_selection_select_size): Fix
	problem where fractional sizes caused infinite loop.
	(bugzilla.redhat.com #33081)

Wed Mar 28 14:52:08 2001  Owen Taylor  <otaylor@redhat.com>

	* docs/Makefile.am: Remove excess rules breaking
	distcheck.
2001-04-02 03:51:01 +00:00
Owen Taylor
9eec86b770 Fix problem where dropping into internal child widgets (such as GtkCList
Wed Mar 28 12:33:20 2001  Owen Taylor  <otaylor@redhat.com>

	* gtk/gtkdnd.c: Fix problem where dropping into
	internal child widgets (such as GtkCList tab labels)
	(#52457, reported by Daniel Erat). Can't use
	gtk_container_children(), so provide a substitute
	which uses gtk_container_forall().
2001-03-28 17:43:08 +00:00
Ole Laursen
d78b20c7a6 Updated Danish translation 2001-03-27 20:12:43 +00:00
Andraz Tori
e64144a00f Updated Slovenian translation 2001-03-25 13:04:59 +00:00
Darin Adler
5dbcf115a9 Fixed #if G_ENABLE_DEBUG that was supposed to be #ifdef G_ENABLE_DEBUG.
* gtk/gtkobject.h: Fixed #if G_ENABLE_DEBUG that
	was supposed to be #ifdef G_ENABLE_DEBUG.
2001-03-23 02:44:31 +00:00
Christian Rose
1c92bad0ee Fixed Swedish translation in some places, thanks to comments from Gran
Uddeborg <goeran@uddeborg.pp.se>.
2001-03-19 13:41:21 +00:00
Fatih Demir
e901ee0e51 Header fix 2001-03-18 19:11:24 +00:00
Fatih Demir
1be9a82cd3 Updated tr.po 2001-03-18 19:04:19 +00:00
Fatih Demir
2e765264e7 Updated tr.po 2001-03-18 15:37:48 +00:00
Owen Taylor
de55adbf46 Updated
Thu Mar 15 15:23:11 2001  Owen Taylor  <otaylor@redhat.com>

	* NEWS: Updated

	* configure.in (GTK_BINARY_AGE): Up micro => 10,
	binary => 10, interface => 1.

	* INSTALL.in: Add some discouraging words about
	--with-xinput=gxi.

	* configure.in (x_ldflags): Make --with-xinput be
	--with-xinput=xfree, and warn for --with-xinput=gxi.

Thu Mar 15 14:29:47 2001  Owen Taylor  <otaylor@redhat.com>

        * gdk/gdkselection.c (sanitize_ctext): Handle
	extended segments, which can contain arbitrary octets,
	properly. (Fixes problems with cut-and-paste and,
	e.g., KOI8-R.)

	* gtk/gtktext.c gtk/gtkeditable.c: Patch from
	Vlad Harchev to avoid using gdk_draw_text_wc()
	on text that is really chars, not wchars. (Cannot
	convert between chars and wide chars with assignment!)
2001-03-15 22:13:21 +00:00
Pablo Saratxaga
832178099c fixed chars 2001-03-15 10:49:58 +00:00
Pablo Saratxaga
e7b447e89d updated Azeri file 2001-03-15 09:12:56 +00:00
Owen Taylor
296abc67a4 Make somewhat more safe on broken libcs, also add a g_return_if_fail() to
Thu Mar 15 01:31:07 2001  Owen Taylor  <otaylor@redhat.com>

	* gdk/gdkim.c (_gdk_wcstombs_len): Make somewhat more
	safe on broken libcs, also add a g_return_if_fail()
	to make the failure case when we somehow get a
	string of invalid wide characters more clear.
	(#51644, Sergey Vlasov)
2001-03-15 06:54:43 +00:00
Owen Taylor
c6351975cd Fix problem in testing the result of g_get_home_dir(), and test the result
Thu Mar 15 01:05:49 2001  Owen Taylor  <otaylor@redhat.com>

	* gtk/gtkrc.c (gtk_rc_add_initial_default_files): Fix
	problem in testing the result of g_get_home_dir(),
	and test the result of g_get_home_dir() in another
	place for consistency. (#51833). Also fix off-by-one
	error in check against GTK_RC_MAX_MODULE_PATHS.
2001-03-15 06:25:54 +00:00
Owen Taylor
560b7a063d head -n 7 ChangeLog 2001-03-15 05:45:28 +00:00
Owen Taylor
f1fd0af53b Fix missed equal_pos => option for --with-xinput=gxi. (Which is broken
Wed Mar 14 23:38:23 2001  Owen Taylor  <otaylor@redhat.com>

        * gdk/gdk.c (gdk_init_check): Fix missed equal_pos => option
        for --with-xinput=gxi. (Which is broken anyways, but
        oh well...) (#51973)

        * gtk/gtkeditable.c (gtk_editable_get_event_time): Fix excess free
        in case where there is no current event. (#51889)

        * gtk/gtkwindow.[ch]: Handle focus for the case of
        PointerRoot (no window manager) by using algorithm taken
        from xterm.
2001-03-15 04:39:32 +00:00
Valek Frob
1b5b657065 Small fix. 2001-03-14 14:26:40 +00:00
Pablo Saratxaga
047ccde819 added Vietnamese file 2001-03-13 01:49:17 +00:00
Andraz Tori
2af348b786 Updated Slovenian translation 2001-03-11 22:10:48 +00:00
Pablo Saratxaga
c38487ceaa Updated Serbian files 2001-03-10 14:26:44 +00:00
Pablo Saratxaga
957ce8e00f converted az.po to 8bit encoding 2001-03-09 16:22:21 +00:00
Christian Meyer
4dd7cd5b52 Revised German translation. 2001-03-08 03:53:09 +00:00
Owen Taylor
4390744d27 Only check the ignore_enter flag for the menu shell that the item is
Mon Mar  5 16:38:15 2001  Owen Taylor  <otaylor@redhat.com>

	* gtk/gtkmenushell.c (gtk_menu_shell_enter_notify): Only
	check the ignore_enter flag for the menu shell that
	the item is actually a child of, not for attached
	submenus. (#51536)
2001-03-05 21:52:22 +00:00
Owen Taylor
91df70d81b Release 1.2.9
Fri Mar  2 12:35:40 2001  Owen Taylor  <otaylor@redhat.com>

	* Release 1.2.9

        * NEWS: Final update for 1.2.9

	* INSTALL INSTALL.in: Add note about the movement of
	the include files.
2001-03-02 20:01:07 +00:00
Fatih Demir
063048efbf Hmm 2001-03-02 18:40:45 +00:00
Fatih Demir
288466d601 Added tr ... 2001-03-02 18:36:42 +00:00
Fatih Demir
5452736fea Added Turkish translation 2001-03-02 18:32:24 +00:00
Andraz Tori
5c168016eb Updated Slovenian translation 2001-03-01 23:03:13 +00:00
Christian Rose
1d95034b88 Updated Swedish translation. 2001-03-01 10:51:56 +00:00
Owen Taylor
97e83dbccb Never make harmless warning fixes! :-(
Thu Mar  1 04:35:51 2001  Owen Taylor  <otaylor@redhat.com>

        * gtk/gtkwidget.c (gtk_widget_class_init): Never make harmless
        warning fixes! :-(
2001-03-01 09:40:38 +00:00
Christophe Merlet
30e80df2f7 Updated French translation. 2001-03-01 09:09:01 +00:00
Owen Taylor
ea0c710884 Fix the .in files, add note about --with-native-locale.
Wed Feb 28 21:14:08 2001  Owen Taylor  <otaylor@redhat.com>

	* README.in INSTALL.in: Fix the .in files, add note
	about --with-native-locale.

	* */po/*: Line-number-creepage.
2001-03-01 02:19:26 +00:00
Owen Taylor
0654fc6064 Patch from ChiDeok Hwang to move call to sync_selection() up a few lines
Wed Feb 28 19:10:43 2001  Owen Taylor  <otaylor@redhat.com>

	* gtk/gtkclist.c (real_remove_row): Patch from ChiDeok
	Hwang to move call to sync_selection() up a few lines
	to before the row list is modified, to fix crash when
	removing rows in the undo_selection list.

	(Test case provided by Daniel Elstner:

        http://mail.gnome.org/archives/gtk-list/2001-February/msg00359.html)

Wed Feb 28 15:40:27 2001  Owen Taylor  <otaylor@redhat.com>

	* gtk/gtkcalender.c gtk/gtkdnd.c gtk/gtkitemfactory.c gtk/gtklayout.c
	  gtk/gtkplug.c gtk/gtksocket.c gtk/gtktypeutils.c
	  gtk/gtkwidget.c genmarshal.pl: Fix implicit casts
	between void * and function pointers.

	* gtk/gtklayout.c: Remove cruft after #endif

	* gtk/gtkdnd.c: Include stdlib.h for abs.
2001-03-01 00:18:22 +00:00
Owen Taylor
51454e8ac6 Redo the focus stuff once more. Keep track of the focus status via an
Tue Feb 27 18:38:27 2001  Owen Taylor  <otaylor@redhat.com>

	* gtk/gtkwindow.c (gtk_window_map): Redo the focus stuff
	once more. Keep track of the focus status via an event
	filter, so we can keep track of whether the window
	or any child has the focus; something that requires
	fields from the XEvent not in the GdkEvent.

	Install this event filter in gtk_window_map() before mapping
	the window, on the guess that this is unlikely to be overriden
	without the overrider chaining up. (fingers crossed)
2001-02-27 23:41:09 +00:00
Owen Taylor
9cad1a8a54 fix messed up commit message from earlier 2001-02-27 09:42:41 +00:00
Owen Taylor
f9c3cfe49f Remove left-over debug-printf.
Tue Feb 27 04:14:21 2001  Owen Taylor  <otaylor@redhat.com>

	* gtk/gtkmain.c (gtk_propagate_event): Remove
	left-over debug-printf.

	* gtk/gtkdnd.c (gtk_drag_find_widget): Don't use
	new_allocation.x/new_allocation.y for coordinate,
	translation since they are clip, use the
	x_offset/y_offset variables we keep for the purpose instead.
2001-02-27 09:19:21 +00:00
Owen Taylor
ce06d6d635 When recursing, get the list of children and ref them all before walking
Tue Feb 27 02:29:20 2001  Owen Taylor  <otaylor@redhat.com>

	* gtk/gtkdnd.c (gtk_drag_find_widget): When recursing,
	get the list of children and ref them all before walking
	through the list, to prevent problems when the widget
	hierarchy changes in ::drag_motion/drop handlers.

	* gtk/gtkmain.c (gtk_propagate_event): Only activate
	special key-press grab handling for widgets within
	GtkWindows. Otherwise, fall through to normal case.

	This prevents key events being sent twice to GtkInvisible
	widgets, which can cause all sorts of mischief.
2001-02-27 07:36:18 +00:00
Owen Taylor
b501a17c8b Add a configuration option --with-native-locale, that greatly speeds up
Tue Feb 27 01:29:34 2001  Owen Taylor  <otaylor@redhat.com>

	* configure.in acconfig.h gdk/gdkfont.c gdk/gdkim.c INSTALL: Add a
	configuration option --with-native-locale, that greatly speeds up
	wide-character/multibyte conversions by dropping the indirection
	through Xlib's property-conversion functions. Off by default due
	to lack of testing for portability, but it should, in general be a
	more correct way of doing things, and should also remove much of
	the speed hit that the recent change to the handling of 8-bit
	fonts may have introduced.
2001-02-27 06:46:08 +00:00
Owen Taylor
8875974d18 Update to describe submitting patches and bug reports to
Mon Feb 26 16:34:33 2001  Owen Taylor  <otaylor@redhat.com>

	* README: Update to describe submitting patches
	and bug reports to bugzilla.gnome.org.

Tue Feb 20 23:48:16 2001  Owen Taylor  <otaylor@redhat.com>

        * gdk/gdkim.c,gdk/gdkprivate.h: Add private function
         _gdk_wcstombs_len() which takes a length.

	* gdk/gdkfont.c,gdk/gdkprivate.h,gdk/gdkdraw.c:
        Consistently handle calls to _wc() font for GDK_FONT_FONT
	routines by:

          a) for 8-bit fonts, converting to chars via wcstombs
              (Will make GtkLabel handle using GDK_FONT_FONT for
             non-iso-8859-1 a wee bit better, though GDK_FONT_FONTSET
             is still the only supported way to get correct i18n.
             #50834)

          b) for 16-bit fonts, assuming each wchar is a glyph
             index. (Broken, but no more broken than anything else)
2001-02-27 04:30:56 +00:00
Owen Taylor
46e0b468ed We can't maintain a flag in gtk_window_focus_in/out, because GtkPlug and
Mon Feb 26 21:36:11 2001  Owen Taylor  <otaylor@redhat.com>

	* gtk/gtkwindow.[ch] (gtk_window_focus_in/out_event): We can't
	maintain a flag in gtk_window_focus_in/out, because
	GtkPlug and cut-and-pastes of GtkPlug override these
	methods and don't chain up. So back out recent change
	adding such a flag, and instead recycle the hack
	GtkPlug uses of making GTK_WIDGET_HAS_FOCUS on the
	top level represent this information
2001-02-27 02:39:28 +00:00
Owen Taylor
a3cf1957cb Do the setting of tree->root_tree in parent_set rather than _map(), fixing
Fri Feb 23 15:06:48 2001  Owen Taylor  <otaylor@redhat.com>

	* gtk/gtktree.c (gtk_tree_class_init): Do the setting
	of tree->root_tree in parent_set rather than _map(),
	fixing #50892 in a bit better manner.
2001-02-26 19:37:29 +00:00
Stano Visnovsky
f10c733cb9 Fixed spelling 2001-02-23 18:00:23 +00:00
Owen Taylor
90a565d677 Change to parent implementation instead of cut-and-paste that was out of
Thu Feb 22 20:50:08 2001  Owen Taylor  <otaylor@redhat.com>

	* gtk/gtkplug.c (gtk_plug_set_focus): Change to parent
	implementation instead of cut-and-paste that was
	out of sync.

	* gtk/gtkwindow.[ch] (gtk_window_set_focus): Only send
	::focus_in_event when the toplevel window actually
	has focus on it. (Fixes #50857, Akira Higuchi)
2001-02-23 02:01:18 +00:00
Owen Taylor
d7a68f63be Grab on a offscreen GtkInvisible so that we can move handle boxes whose
Thu Feb 22 19:53:55 2001  Owen Taylor  <otaylor@redhat.com>

	* gtk/gtkhandlebox.c (gtk_handle_box_button_changed): Grab
	on a offscreen GtkInvisible so that we can move handle boxes
	whose parents are iconified or on another desktop. Also,
	make sure we don't reattach to such parents. (#1923)
2001-02-23 00:55:46 +00:00
Owen Taylor
478449f6cd Don't flip cursor. (#50934)
Thu Feb 22 17:07:58 2001  Owen Taylor  <otaylor@redhat.com>

	* gtk/gtkmenu.c (gtk_menu_popup): Don't flip cursor. (#50934)
2001-02-22 22:50:53 +00:00
Owen Taylor
de78784eb1 Update the current font from the contents of the entry. (#3123)
Thu Feb 22 16:45:17 2001  Owen Taylor  <otaylor@redhat.com>

	* gtk/gtkfontsel.c (gtk_font_selection_get_font[_name]):
	Update the current font from the contents of the entry.
	(#3123)
2001-02-22 22:02:24 +00:00
Jody Goldberg
abba4bdf73 Remove duplicate fwd decl for gtk_default_draw_shadow.
Tue Feb  2 11:22:33 2001  Jody Goldberg <jgoldberg@home.com>

	* gtk/gtkstyle.c : Remove duplicate fwd decl for
	gtk_default_draw_shadow.

Tue Feb 20 11:40:58 2001  Owen Taylor  <otaylor@redhat.com>

	* gdk/gdkimage.c (gdk_image_new): Remove excess
	warning, make warnings more verbose, treat a error
	in shmat as permanent, and don't try again.
	(#51163, Ed Randall.)

Mon Feb 19 20:46:21 2001  Owen Taylor  <otaylor@redhat.com>

	* gtk/gtkentry.c (gtk_entry_key_press): Take key presses
	of GDK_Left/GDK_Right when there is a selection to mean
	"move the cursor to the start/end of the selection".
	(Inspired by #50492, Jay Cox, though the implementation
	is different for GTK+-1.2.)

Mon Feb 19 20:15:28 2001  Owen Taylor  <otaylor@redhat.com>

	* gtk/gtkrange.c (gtk_range_timer_1st_time): Add an initial
	delay for the first click before starting to scroll.
	(based on #51026, gtk-enf-990512-0.patch, Eric Fisher)

	* gtk/gtktext.c: GtkText should have I-beam cursor.
	(based on gtk-enf-990513-1.patch, Eric Fisher.)

Mon Feb 19 18:39:21 2001  Owen Taylor  <otaylor@redhat.com>

	* gdk/gdkselection.c (gdk_string_to_compound_text,gdk_text_property_to_text_list):
	Robustify by stripping control characters not allowed in COMPOUND_TEXT
	out before passing to XmbTextpropertyToTextList(), and from the
	result of XmbTextListToTextProperty(). This is in the spirit
	of "Be lenient in what you receive, strict in what you generate."
	(Fixes #1704)
2001-02-22 20:38:15 +00:00
Andraz Tori
5a22518969 Updated sl translation 2001-02-20 23:57:39 +00:00
Owen Taylor
635105d142 Fix incorrect mask. (#51039, fix from Martin Maierhofer)
Mon Feb 19 14:20:36 2001  Owen Taylor  <otaylor@redhat.com>

	* gdk/gdkrgb.c (gdk_rgb_convert_555_br): Fix incorrect
	mask. (#51039, fix from Martin Maierhofer)

Fri Feb 16 20:09:42 2001  Owen Taylor  <otaylor@redhat.com>

	* gtk/gtkctree.c (gtk_ctree_class_init): Add bindings
	for unshifted + and shifted = for non-us keyboards.
	Make <Control>+ and <Control>- work as well as
	<Control>KP_Plus, <Control>KP_Minus for recursive
	open/close.  (#2682, Ren Seindal)
2001-02-19 21:31:43 +00:00
Owen Taylor
5e6a0c969d Updated (applied gtk-pauls-990307-0.patch)
Sun Feb 18 18:06:11 2001  Owen Taylor  <otaylor@redhat.com>

	* nl.po:	Updated (applied gtk-pauls-990307-0.patch)
2001-02-18 23:06:54 +00:00
Andraz Tori
3883f5a879 Updated Slovenian translation 2001-02-17 14:50:31 +00:00
Owen Taylor
eea850a7c0 Unset the active menu item before deactivating the menu, so
Fri Feb 16 18:50:59 2001  Owen Taylor  <otaylor@redhat.com>

	* gtk/gtkmenushell.c (gtk_real_menu_shell_cancel): Unset
	the active menu item before deactivating the menu,
	so gtk_menu_popdown doesn't change the history. (#50964)
2001-02-17 00:10:31 +00:00
Owen Taylor
f8709339b5 draw lines with text_gc rather than black_gc. (Patch from Vlad Harchev
Fri Feb 16 15:55:22 2001  Owen Taylor  <otaylor@redhat.com>

	       * gtk/gtktreeitem.c (gtk_tree_item_draw_lines):
	       draw lines with text_gc rather than black_gc.
	(Patch from Vlad Harchev <hvv hippo ru>, #50926)
2001-02-16 23:35:04 +00:00
Owen Taylor
92b5545801 1.2.9pre1
Tue Feb 13 15:39:28 2001  Owen Taylor  <otaylor@redhat.com>

        * 1.2.9pre1

	* NEWS: Update.

        * docs/Makefile.am: Remove building of HTML for
	gdk.texi gtk.texi since it doesn't work.
2001-02-16 04:37:42 +00:00
Christopher R. Gabriel
9a0f08fd30 Updated italian translation 2001-02-15 05:11:15 +00:00
Stano Visnovsky
dd5f18bfba Updated Slovak translation 2001-02-14 11:41:18 +00:00
Simos Xenitellis
e75267a55d Minor fixes to Greek translation 2001-02-13 23:13:59 +00:00
Owen Taylor
8c9ce83511 Fix problems with characters < 256 in wide character locales. (Patch from
Tue Feb 13 13:56:58 2001  Owen Taylor  <otaylor@redhat.com>

	* gtk/gtktext.c (find_char_width): Fix problems with
	characters < 256 in wide character locales. (Patch
	from Yoichi Imai.)
2001-02-13 19:58:35 +00:00
Owen Taylor
ec7e8f971e Properly handle passive buttons at button creation time (#50686).
Tue Feb 13 00:58:49 2001  Owen Taylor  <otaylor@redhat.com>

	* gtk/gtkclist.c: Properly handle passive buttons at
	button creation time (#50686).
2001-02-13 15:33:25 +00:00
Owen Taylor
91383ef28e Call gdk_colormap_sync() - fixes #50678.
Mon Feb 12 20:37:32 2001  Owen Taylor  <otaylor@redhat.com>

	* gdk/gdkrgb.c (gdk_rgb_try_colormap): Call gdk_colormap_sync() -
	fixes #50678.

	* gdk/gdk.h: Add missing prototype for gdk_colormap_sync().
2001-02-13 01:53:28 +00:00
Owen Taylor
c17f904633 Fix some cases of implicit casting between void * and function pointers.
Mon Feb 12 20:02:32 2001  Owen Taylor  <otaylor@redhat.com>

	* gtk/gtkmain.c: Fix some cases of implicit casting between
	void * and function pointers.

	* configure.in gtk/gtkmain.c: Add checks for setuid/setgid,
	and refuse to initialize GTK+ if they fail.

	* configure.in (GTK_INTERFACE_AGE): Reset GTK_INTERFACE_AGE
	to zero.
2001-02-13 01:25:28 +00:00
Owen Taylor
58ea26507c [ Enabling patch for better looking theme engines ]
Mon Feb 12 15:55:26 2001  Owen Taylor  <otaylor@redhat.com>

	[ Enabling patch for better looking theme engines ]

	* gtk/gtkstyle.[ch]: Add new API functions for making
	better looking GTK+-1.2.x themes. THESE FUNCTIONS WILL
	NOT BE SUPPORTED IN THE FUTURE. ANY THEMES DEPENDING
	ON THESE FUNCTIONS MUST CHECK FOR GTK+-1.2.x WHERE
	x >= 1.2.9.

	The functions:

	 _gtk_style_set_prop_experimental()
	 _gtk_style_get_prop_experimental()

	are used to allow configuration of assorted geometry
	parameters.

	* gtk/gtkbutton.c: Make DEFAULT_SPACING configurable as
	GtkButton::default_spacing.

	* gtk/gtkcheckbutton.c gtk/gtkradiobutton.c: Make indicator_size
	and indicator_spacing configurable as GtkCheckButton::indicator_size,
	GtkCheckButton::indicator_spacing.

	* gtk/gtkcheckbutton.[ch]: Private function
	_gtk_check_button_get_props().

	* gtk/gtkcheckmenuitem.c (gtk_check_button_menu_item_set_show_toggle):
	Make a noop - turning this on is just a bad idea visually, and
	changing this from a program is just asking a bad idea.

	* gtk/gtk{h,v,}paned.c: Provide configuration parameters
	GtkPaned::handle_full_size, which, if true, will turn
	on GTK+-1.3.2 style full-size paned handles.
	GtkPaned::handle_width, which sets the gutter size for
	paned widgets. (If set, overrides setting via
	gtk_paned_set_gutter_size())

	* gtk/gtkpaned.[ch]: Add private functions
	_gtk_paned_is_handle_full_size(), _gtk_paned_get_handle_rect(),
	_gtk_paned_get_gutter_size().

	* gtk/gtkstyle.c (gtk_default_draw_box): Add handling for details
	"hpaned", "vpaned", used for drawing full-size grips on horizontal
	and vertical paned widgets. (In the style of GTK+-1.3.2)

	* gtk/gtkhscale.c gtk/gtkhscrollbar.c:

	* gtk/gtkoptionmenu.c: Add configurable parameters:

	  GtkOptionMenu::indicator_width
	  GtkOptionMenu::indicator_height
	  GtkOptionMenu::indicator_left_spacing
	  GtkOptionMenu::indicator_right_spacing
	  GtkOptionMenu::indicator_top_spacing
	  GtkOptionMenu::indicator_bottom_spacing

        To control where the indicator is drawn and how big it is.

	* gtk/gtkrange.[ch]: Add configurable parameters:

	  GtkRange::slider_width    - width of trough
	  GtkRange::trough_border   - space to reserve for trough border
	  GtkRange::stepper_size    - size of arrows
	  GtkRange::stepper_spacing - spacing between scrollbar and arrows

	and private accessor _gtk_range_get_props().

	* gtk/gtkwidget.c (gtk_widget_event): Rewrite a bit to
	quiet GCC.

	* gtk/gtkwidget.c (gtk_widget_propagate_state): Fix typo
	in last commit.
2001-02-12 22:40:03 +00:00
Owen Taylor
8005072a91 Don't allow insensitive widgets to have a grab.
Mon Feb  5 12:47:09 2001  Owen Taylor  <otaylor@redhat.com>

	* gtk/gtkwidget.c (gtk_widget_propagate_state)
	  gtk/gtkmain.c (gtk_grab_add): Don't allow insensitive widgets to
	have a grab.
2001-02-12 20:30:03 +00:00
Gustavo Maciel Dias Vieira
e6038b6b2e Updated Brazilian Portuguese translation.
2001-02-12  Gustavo Maciel Dias Vieira  <gdvieira@zaz.com.br>

* pt_BR.po: Updated Brazilian Portuguese translation.
2001-02-12 12:26:42 +00:00
Gediminas Paulauskas
3a5a34e651 Small corrections in Lithuanian translation. 2001-02-12 01:47:22 +00:00
Ian Peters
ded7626eeb use the font->ascent and ->descent to calculate the requisition height,
* gtk/gtkprogressbar.c (gtk_progress_bar_size_request): use the
font->ascent and ->descent to calculate the requisition height,
rather than the gdk_text_height
(gtk_progress_bar_paint): use the font->ascent instead of the
gdk_text_height when calculating the vertical offset of the text
label on the progress bar.  This fixes the baseline of the font on
the widget.
2001-02-11 03:58:55 +00:00
Kjartan Maraas
9f8ce57295 Updated translation. Updated translation.
2001-02-08  Kjartan Maraas  <kmaraas@gnome.org>

	* no.po: Updated translation.
	* nn.po: Updated translation.
2001-02-08 09:53:45 +00:00
Nam SungHyun
04d5567bbf 1.2.9 2001-02-08 02:44:35 +00:00
Christophe Merlet
39c90da92f Updated French translation. 2001-02-05 16:44:49 +00:00
Owen Taylor
4205ca4ff5 Surround additional regions with HAVE_SHAPE_EXT. (#50511, Eric Ding)
Fri Feb  2 19:21:23 2001  Owen Taylor  <otaylor@redhat.com>

	* gdk/gdkwindow.c (gdk_propagate_shapes): Surround additional
	regions with HAVE_SHAPE_EXT. (#50511, Eric Ding)
2001-02-03 00:25:57 +00:00
Owen Taylor
d83929a297 Remove definition of _XOPEN_SOURCE, since it breaks things on BSD. If you
Fri Feb  2 18:31:54 2001  Owen Taylor  <otaylor@redhat.com>

	* gdk/gdkimage.c: Remove definition of _XOPEN_SOURCE, since
	it breaks things on BSD. If you want to compile GTK+ with
	-ansi -pedantic, you should supply CPP_FLAGS=_XOPEN_SOURCE
	when configuring, since GTK+ simply can't be "pure ANSI"
	in the header files it uses. (#8170, Greg Hudson)

	* gdk/gdkrgb.c (gdk_rgb_select_conv): Exit with an informative
	warning message if no converter can be found.
2001-02-02 23:37:19 +00:00
Owen Taylor
73c002cae4 Fix problem with passing signed chars to isupper() / tolower().
Fri Feb  2 15:09:51 2001  Owen Taylor  <otaylor@redhat.com>

	* gtk/fnmatch.c (FOLD): Fix problem with passing signed
	chars to isupper() / tolower().

	* examples/packer/pack.c: Add GINT_TO_POINTER, GPOINTER_TO_INT
	to clear up 64-bit warnings. (#567)
2001-02-02 20:25:13 +00:00
Owen Taylor
9f56908ea3 Fix some reference counting problems problems in last patch.
Fri Feb  2 13:38:21 2001  Owen Taylor  <otaylor@redhat.com>

	* gtk/gtkmain.c (gtk_propagate_event): Fix some reference
	counting problems problems in last patch.
2001-02-02 19:43:00 +00:00
Owen Taylor
c30e743f8e When a grab widget is in effect, give the grab widget a first crack at
Fri Feb  2 13:20:12 2001  Owen Taylor  <otaylor@redhat.com>

	* gtk/gtkmain.c (gtk_propagate_event): When a grab
	widget is in effect, give the grab widget a first
	crack at KEY_PRESS/RELEASE events. (#424)
2001-02-02 18:35:29 +00:00
Owen Taylor
aa4fd35cfa Use $(libdir), not $(exe_prefix), since some people set $(libdir)
Fri Feb  2 12:02:23 2001  Owen Taylor  <otaylor@redhat.com>

	* gtk/gtkrc.c Makefile.am: Use $(libdir), not $(exe_prefix),
	since some people set $(libdir) separately. (#1290, David Kaelbling)
2001-02-02 17:16:12 +00:00
Owen Taylor
e1068cb50d Improve warnings a bit in a fashion similar to the part of
Thu Feb  1 20:32:49 2001  Owen Taylor  <otaylor@redhat.com>

	* gdk/gdk.c: Improve warnings a bit in a fashion similar
	to the part of gtk-enf-990513-0.patch (Eric Fisher) that hasn't
	been superceded.
2001-02-02 01:36:22 +00:00
Owen Taylor
638adacbfc If PATH_MAX and MAXPATHLEN are not defined, define MAXPATHLEN to 2048.
Thu Feb  1 18:25:46 2001  Owen Taylor  <otaylor@redhat.com>

	* gtk/gtkfilesel.c: If PATH_MAX and MAXPATHLEN are not
	defined, define MAXPATHLEN to 2048. (The Hurd doesn't have
	MAXPATHLEN, but the code here depends on a fixed value.)
	(#4524)
2001-02-01 23:32:41 +00:00
Owen Taylor
06c02d4d97 Remove a dependency on bin->child != NULL. (Basically, just a cleanup)
Wed Jan 31 22:01:04 2001  Owen Taylor  <otaylor@redhat.com>

	* gtk/gtkhandlebox.c (gtk_handle_box_draw): Remove a dependency
	on bin->child != NULL. (Basically, just a cleanup)

	* gtk/gtkhandlebox.c (gtk_handle_box_button_changed): Handle the case
	where child == NULL and handle_position == RIGHT or BOTTOM. (#8002)
2001-02-01 15:25:37 +00:00
Owen Taylor
87b9290e56 If the node being moved isn't viewable there is no way that moving the
Wed Jan 31 21:20:39 2001  Owen Taylor  <otaylor@redhat.com>

	* gtk/gtkctree.c (real_tree_move): If the node being moved isn't
	viewable there is no way that moving the node will cause the
	focus row to become not viewable, so omit check on the visibility
	of new_sibling, which is irrelevant. (Fixes #8002, David Helder)
2001-02-01 02:34:36 +00:00
Owen Taylor
6ceae1b5bf Check bounds when setting selection. (#7302)
Wed Jan 31 20:33:35 2001  Owen Taylor  <otaylor@redhat.com>

	* gtk/gtkentry.c (gtk_entry_set_selection): Check bounds
	when setting selection. (#7302)
2001-02-01 01:50:49 +00:00
Tim Janik
c007e30064 avoid regeneration of gtkmarshal.c from stamp file dep, when not
Thu Feb  1 02:26:18 2001  Tim Janik  <timj@gtk.org>

        * gtk/Makefile.am ($(srcdir)/gtkmarshal.c): avoid regeneration
        of gtkmarshal.c from stamp file dep, when not @REBUILD@,
        fixes #11008.
2001-02-01 01:25:43 +00:00
Owen Taylor
8a94a2c795 Apply patch gtk-gharris-000907-0.patch (Guy Harris) fixing problem where
Wed Jan 31 19:23:01 2001  Owen Taylor  <otaylor@redhat.com>

	* gtk/gtkfontsel.c (gtk_font_selection_set_font_name):
	Apply patch gtk-gharris-000907-0.patch (Guy Harris) fixing problem where
	wrong row was selected when filters filtered out some fonts.
2001-02-01 00:26:25 +00:00
Owen Taylor
aff67cd4da Make the sensitivity of the reparented child track that of the original
Wed Jan 31 18:49:33 2001  Owen Taylor  <otaylor@redhat.com>

	* gtk/gtkoptionmenu.c (gtk_option_menu_item_state_changed_cb):
	Make the sensitivity of the reparented child track that of
	the original parent menu item. (#34218, David Hodson)

	* gtk/gtkoptionmenu.c (gtk_option_menu_item_destroy_cb): Handle
	the case where the current item is destroyed properly.

	* gtk/gtkoptionmenu.c: Some additional code cleanups and fix
	some edge cases with child-less menuitems.
2001-01-31 23:53:33 +00:00
Owen Taylor
69871da39f Make Return key pop down window. (#12074, Jon K Hellan)
Wed Jan 31 17:16:13 2001  Owen Taylor  <otaylor@redhat.com>

	* gtk/gtkcombo.c (gtk_combo_window_key_press): Make Return
	key pop down window. (#12074, Jon K Hellan)
2001-01-31 22:21:32 +00:00
Owen Taylor
b1aeb5717d Don't allow toggling of rows off in BROWSE or EXTENDED mode. (#12072, Greg
Wed Jan 31 16:21:42 2001  Owen Taylor  <otaylor@redhat.com>

	* gtk/gtklist.c (gtk_list_signal_item_toggle): Don't allow
	toggling of rows off in BROWSE or EXTENDED mode. (#12072, Greg
	Hudson.) The solution here isn't perfect - you get an extraneous
	emission of "toggle", which could conceivably confuse an app,
	but better than the current situation. LXR search seems to
	indicate that no apps in GNOME CVS connect to "toggle".
2001-01-31 21:28:20 +00:00
Owen Taylor
39f0a2780f Move gtkfeatures.h from gtk_public_h_sources to directly here to avoid
Wed Jan 31 15:46:13 2001  Owen Taylor  <otaylor@redhat.com>

	* gtk/Makefile.am (libgtkinclude_HEADERS): Move gtkfeatures.h from
	gtk_public_h_sources to directly here to avoid warning when
	building srcdir != builddir. (#9656)
2001-01-31 20:48:43 +00:00
Owen Taylor
bebf3ad988 Patch from Kipp Hickman to make the event handlers in gtkrange.c return
Tue Jan 30 19:49:02 2001  Owen Taylor  <otaylor@redhat.com>

	* gtk/gtkrange.c: Patch from Kipp Hickman to make the event
	handlers in gtkrange.c return the proper values (TRUE == handled)
	(#10316).

	This is just the tip of the iceberg, but gtkrange.c is the
	most common place where the propagation is problematical,
	and also a place where it is almost certainly safe to change
	this in the stable branch.

	(You don't want right click popups on a range control or anything...)

Tue Jan 30 19:12:52 2001  Owen Taylor  <otaylor@redhat.com>

	* gtk/gtkwindow.c (gtk_window_unmap): Call gdk_window_withdraw
	rather than gdk_window_hide; this makes things work
	correctly if the window is programmatically hidden while
	iconified. [ Backport from HEAD, hope, hope it doesn't break
	anything since it fixes a bunch of stuff. ] (#14082)
2001-01-31 00:52:37 +00:00
Owen Taylor
61a7c6f865 We need to clear the focus area on focus out, even if a background pixmap
Tue Jan 30 18:57:59 2001  Owen Taylor  <otaylor@redhat.com>

	* gtk/gtktext.c (clear_focus_area): We need to clear the focus
	area on focus out, even if a background pixmap isn't set.
	(#13941)
2001-01-31 00:00:54 +00:00
Owen Taylor
ab36b33b76 Handle the case where bg_pixmap[i] == GDK_PARENT_RELATIVE.
Tue Jan 30 18:31:23 2001  Owen Taylor  <otaylor@redhat.com>

	* gtk/gtkstyle.c (gtk_style_detach): Handle the case where
	bg_pixmap[i] == GDK_PARENT_RELATIVE.
2001-01-30 23:33:04 +00:00
Owen Taylor
20d6a5c3a5 Fix from Sean Cunningham to deal with setting the shape properly when
Tue Jan 30 18:24:10 2001  Owen Taylor  <otaylor@redhat.com>

	* gtk/gtknotebook.c (gtk_notebook_set_shape): Fix from Sean Cunningham
	to deal with setting the shape properly when scrolling arrows are
	turned on, but not visible because there is sufficient space.
	(#13432)
2001-01-30 23:27:58 +00:00
Owen Taylor
7431b6b3d6 For menu items with submenus, destroy the item along with the submenu.
Tue Jan 30 16:39:25 2001  Owen Taylor  <otaylor@redhat.com>

	* gtk/gtkitemfactory.c (gtk_item_factory_delete_item): For menu
	items with submenus, destroy the item along with the submenu.
	(#7841, Brian Masney(?)) Also, handle paths of the form '<foo>/abcd...'
	properly.

	* gtk/testgtk.c (menu_items): Add a dummy branch that we delete
	later.
2001-01-30 21:44:48 +00:00
Owen Taylor
db6d3a0ed7 Fix a problem where the focus widget sometimes wasn't drawn with the
Tue Jan 30 15:51:25 2001  Owen Taylor  <otaylor@redhat.com>

	* gtk/gtkwindow.c (gtk_window_real_set_focus): Fix a problem where
	the focus widget sometimes wasn't drawn with the default if there
	was no default widget.

	* gdk/gdkim.c (gdk_ic_destroy): Don't rely on
	ic->mask, which is completely unreliably set, when
	deciding what items to unref/free. (A bit of a hack,
	but this code will be dead in GTK+-2.0.) (#6739)

	* gtk/gtkstyle.c (gtk_style_detach): free colors,
	unreference pixmaps.

	* gtk/gtkstyle.c (gtk_style_init): Reference colormap
	for some extra safety.
2001-01-30 20:57:15 +00:00
Owen Taylor
765398ca79 [ Backport from HEAD ]
Mon Jan 29 19:44:26 2001  Owen Taylor  <otaylor@redhat.com>

        [ Backport from HEAD ]

	* gtk/gtkmenuitem.c gtk/gtkmenushell.c: Patch from David Santiago
	<mrcooger@cyberverse.com> so that when selecting menus with the
	mouse, the first item will not be selected, but when selecting
	with an accelerator, or navigating left-right on a menubar with
	the menus popped up, the first item will be selected.
2001-01-30 00:46:44 +00:00
Owen Taylor
6596ade0f8 [ Couple of additional tiny cleanup on last commit ]
Mon Jan 29 19:00:01 2001  Owen Taylor  <otaylor@redhat.com>

	* gtk/gtk{ctree.c,clist.c} (set_cell_contents): Handle setting
	the text of a cell to the old pointer value better, by
	copying the new text before freeing the old text. Some code
	cleanup. (#8079, Karl Nelson)
2001-01-30 00:06:03 +00:00
Owen Taylor
9860eb566b Handle setting the text of a cell to the old pointer value better, by
Mon Jan 29 19:00:01 2001  Owen Taylor  <otaylor@redhat.com>

	* gtk/gtk{ctree.c,clist.c} (set_cell_contents): Handle setting
	the text of a cell to the old pointer value better, by
	copying the new text before freeing the old text. Some code
	cleanup. (#8079)
2001-01-30 00:02:49 +00:00
Owen Taylor
4e2ccb69e0 Handle --display= forms of options taking arguments. Fix some memory leaks
Mon Jan 29 18:33:24 2001  Owen Taylor  <otaylor@redhat.com>

	* gdk/gdk.c (gdk_init_check): Handle --display= forms
	of options taking arguments. Fix some memory leaks with
	repeated arguments. (#28842, Sam Hunter)
2001-01-29 23:41:37 +00:00
Owen Taylor
46fd718c6b Return if fontsel->font_index == -1 - that is, if no font is selected.
Mon Jan 29 16:34:28 2001  Owen Taylor  <otaylor@redhat.com>

	* gtk/gtkfontsel.c (gtk_font_selection_select_best_size): Return
	if fontsel->font_index == -1 - that is, if no font is selected.
	(Should fix #50290)
2001-01-29 21:38:10 +00:00
Owen Taylor
ff6120f496 When removing an item from a menu, check to see if it matches
Mon Jan 29 15:22:51 2001  Owen Taylor  <otaylor@redhat.com>

	* gtk/gtkmenu.c (gtk_menu_remove): When removing an
	item from a menu, check to see if it matches
	menu->old_active_menu_item, and if so, unref and clear
	old_active_menu_item (Patch from Pavel Cisler)

	* gtk/gtkmenushell.c (gtk_menu_shell_remove): Unset
	menu_shell->active_menu_item, if it is the child being
	removed. (Patch based on that of Gene Ragan, #50337)
2001-01-29 20:36:55 +00:00
Szabolcs Ban
f2d6ff088b Fixed Hungarian translation 2001-01-25 09:40:44 +00:00
Pablo Saratxaga
ad3a3f4897 updated Azeri file 2001-01-06 22:13:44 +00:00
Alexander Larsson
769cc1b56b Set the colormap of input only windows to the system colormap. The
2001-01-03  Alexander Larsson  <alexl@redhat.com>

	* gdk/gdkwindow.c:
	Set the colormap of input only windows to the system colormap.
	The previous GtkInvisible patch generated a lot of colormap ==
	NULL warnings without this.
2001-01-03 09:42:38 +00:00
Christian Meyer
80383a2b45 Small fix for German translation. 2000-12-22 20:32:36 +00:00
Alexander Larsson
a9efc10c62 Attach the style to the window so that the style it is not leaked when
2000-12-20  Alexander Larsson  <alexl@redhat.com>

        * gtk/gtkinvisible.c (gtk_invisible_realize):
        Attach the style to the window so that the style it is not
        leaked when unrealizing the window.
2000-12-20 16:52:46 +00:00
Ramiro Estrugo
dbd5dc6763 Deal with the possibility that XGetImage() might return NULL. Allocate the
* gdk/gdkimage.c: (gdk_image_get):
	Deal with the possibility that XGetImage() might return NULL.
	Allocate the GdkImagePrivate structure only after XGetImage()
	succeeds in order not to dereference a NULL ximage pointer.  This
	prevents a core dump when XGetImage() fails - which is unlikely,
	but can happen due to race conditions accessing the geometries of
	drawables.  An x error will still be triggered, but the gdk image
	wrapper at least wont seg fault.
2000-12-20 04:39:09 +00:00
Owen Taylor
2c4b96bf9e Fix off-by-one error in checks. (Dave Lambert)
Tue Dec 12 11:52:16 2000  Owen Taylor  <otaylor@redhat.com>

	* gtk/gtkclist.c (gtk_clist_optimal_column_width): Fix
	off-by-one error in checks. (Dave Lambert)
2000-12-12 16:53:43 +00:00
Pablo Saratxaga
2884306517 Fixed charset= line 2000-12-06 15:58:52 +00:00
Pablo Saratxaga
ab08eed58f Added Azeri translation file 2000-12-06 15:46:37 +00:00
Owen Taylor
6d46992454 Strip GDK_RELEASE_MASK out of the state we get from X as a temporary hack
Sun Dec  3 11:44:07 2000  Owen Taylor  <otaylor@redhat.com>

        * gdk/gdkevents.c: Strip GDK_RELEASE_MASK out of
        the state we get from X as a temporary hack to
        deal with the fact that GDK_RELEASE_MASK has the
	same values as bits used by XFree86 to indicate the
	keyboard group. (After patch from Vlad Harchev)
2000-12-03 16:50:04 +00:00
Anders Carlsson
a814d8c82f Make GtkToggleButtons have a correct appearance when disabled and active at the same time. Thanks to Tomas gren for noticing this. 2000-12-02 17:59:00 +00:00
Owen Taylor
eb5bc96b67 Fix some signed/unsigned comparison problems. (#6510, David Kaelbling)
Thu Nov 30 12:39:22 2000  Owen Taylor  <otaylor@redhat.com>

	* gtk/gtkspinbutton.c (gtk_spin_button_insert_text): Fix
	some signed/unsigned comparison problems. (#6510,
	David Kaelbling)
2000-11-30 17:40:52 +00:00
Owen Taylor
2cabfbf0e5 Fix stupid bug causing extra word movement backwards. (#15282, Marco
Thu Nov 30 11:19:56 2000  Owen Taylor  <otaylor@redhat.com>

	* gtk/gtkentry.c (gtk_entry_move_word): Fix stupid
	bug causing extra word movement backwards. (#15282, Marco Goetze)
2000-11-30 16:23:54 +00:00
Owen Taylor
95292e412b [ Backport from 1.3.x ]
Wed Nov 29 21:47:26 2000  Owen Taylor  <otaylor@redhat.com>

        [ Backport from 1.3.x ]

	* gtk/gtktoolbar.c (gtk_toolbar_prepend_widget): Fix to
	prepend not append. (Pointed out by Brett Hall.)
	#11887.
2000-11-30 02:50:07 +00:00
Owen Taylor
f83f73d7d5 Change return type to boolean (Oskar Liljeblad, #18648)
Wed Nov 29 20:56:38 2000  Owen Taylor  <otaylor@redhat.com>

	* gtk/gtkwidget.[ch] (gtk_widget_is_ancestor): Change
	return type to boolean (Oskar Liljeblad, #18648)
2000-11-30 01:59:44 +00:00
Owen Taylor
d102c8eccb Allow mask to be NULL.
Wed Nov 29 20:44:09 2000  Owen Taylor  <otaylor@redhat.com>

	* gtk/gtkclist.c (gtk_clist_get_pixtext): Allow mask to
	be NULL.
2000-11-30 01:45:56 +00:00
Tim Janik
ef30d8a2b9 [ Backport from 1.3 / otaylor, 29 Nov 2000 ]
Thu Oct 26 02:10:32 2000  Tim Janik  <timj@gtk.org>

        [ Backport from 1.3 / otaylor, 29 Nov 2000 ]

	* gtk/Makefile.am: invoke maketypes.awk with LC_ALL=C to avoid
	localization misbehaviour.
2000-11-30 01:22:01 +00:00
Martin Baulig
663a34be8b Make the pkg-config scripts actually work.
2000-11-29  Martin Baulig  <baulig@suse.de>

	* *.pc.in: Make the pkg-config scripts actually work.
2000-11-29 22:00:02 +00:00
Federico Mena Quintero
8ef5b29e80 Connect to the "changed" callback of the adjustment. We need to redraw the
2000-11-27  Federico Mena Quintero  <federico@helixcode.com>

	* gtk/gtkspinbutton.c (gtk_spin_button_set_adjustment): Connect to
	the "changed" callback of the adjustment.  We need to redraw the
	spin button's arrows when the adjustment's range changes.
	(adjustment_changed_cb): Draw the arrows.
	(gtk_spin_button_value_changed): Draw the arrows.
2000-11-27 17:40:47 +00:00
Pablo Saratxaga
857a653824 updated Walloon file 2000-11-25 14:46:36 +00:00
Owen Taylor
4ff5d8fa3e [ backport from 1.3.x ]
Sat Nov 18 11:56:39 2000  Owen Taylor  <otaylor@redhat.com>

	[ backport from 1.3.x ]

	* gdk/gdkrgb.c: If possible, create only a single shm segment and
	use multiple parts of it instead of creating a bunch of separate
	segments, since the maximum number of segments per system is not
	large.

	* gdk/x11/gdkimage-x11.c (gdk_image_new): Don't set gdk_use_xshm
	to False when we get EINVAL from shmget so that the caller of
	gdk_image_new can retry with a smaller segment size.

Sat Nov 18 11:45:09 2000  Owen Taylor  <otaylor@redhat.com>

	* gtk/gtkcalendar.c: Patch from ChiDeok Hwang to fix
	memleaks found by Evan Martin.
2000-11-18 16:59:40 +00:00
Elliot Lee
90ef5b7758 To handle a really weird error case (race condition), check if
* gtk/gtksocket.c: To handle a really weird error case (race condition),
check if socket->plug_window is there before doing things with it.
2000-11-10 21:32:59 +00:00
Richard Hult
015eabfa60 Fixed a stupidly broken Swedish translation. 2000-11-06 07:57:54 +00:00
Pablo Saratxaga
a7db15b98e Added azeri file 2000-11-03 22:41:14 +00:00
Pablo Saratxaga
f777289e65 corrected Big5 support
added fiel for Azeri
2000-11-03 22:40:27 +00:00
Tim Janik
b4c796a043 updates for 1.2.9 2000-10-20 11:04:35 +00:00
Tim Janik
862b8c9481 up version number to 1.2.9, interface 4, binary 9.
Mon Oct 16 11:39:29 2000  Tim Janik  <timj@gtk.org>

        * configure.in: up version number to 1.2.9, interface 4, binary 9.
2000-10-16 10:54:09 +00:00
Yukihiro Nakai
6dddc43586 configure.in: Add zh_CN.GB2312 (Chinese GB2312) to ALL_LINGUAS. 2000-10-13 07:21:07 +00:00
Yukihiro Nakai
958a3bee88 zh_CN.GB2312.po: Initial Chinese(GB2312) translation
from Wu Yulun.
2000-10-13 07:18:36 +00:00
Martin Baulig
8e79f6c56a Use the correct pkg-config syntax in all the *.pc.in files
(the version that comes with the RedHat 7.0 glib-gtkbeta RPM).
2000-09-30 02:09:42 +00:00
Martin Baulig
09dd53db6c Provide pkg-config scripts.
2000-09-30  Martin Baulig  <baulig@suse.de>

	* gtk+.pc.in, gdk.pc.in: Provide pkg-config scripts.

	* configure.in: Create *.pc scripts from the *.pc.in
	templates.
	* Makefile.am (pkgconfig_DATA): Install the *.pc
	scripts in `$(libexecdir)/pkgconfig'.
2000-09-29 22:43:24 +00:00
Owen Taylor
78f80ff726 Move header files to /usr/include/gtk-1.2 to allow safe parallel
Fri Sep  8 21:57:06 2000  Owen Taylor  <otaylor@redhat.com>

	* gtk-config.in gtk/Makefile.am gdk/Makefile.am:
	Move header files to /usr/include/gtk-1.2 to allow
	safe parallel installations with GTK+-2.0.
2000-09-09 01:58:07 +00:00
George Lebl
b6d153b2e2 Backported Nils Barth's patch for submenu navigation with Owen's fixes and
Thu Sep 07 20:50:49 2000  George Lebl <jirka@5z.com>

	* gtk/gtkmenu.c:  Backported Nils Barth's patch for submenu
	  navigation with Owen's fixes and suggestions.  The original
	  ChangeLog from Owen for HEAD goes as folllows:  Apply patch from
          Nils Barth and David Santiago to improve submenu
          navigation. The patch does this by creating a triangular
          region from the point where the pointer leaves the
          menu to the submenu.  While the pointer is in
          that region and a timeout has not expired, events
          that would cause the active submenu to change are
          ignored.
2000-09-08 01:50:35 +00:00
Nam SungHyun
844f8def4d updated 2000-09-07 10:22:58 +00:00
George Lebl
228a23e2ff Add some documenting comments about GTK_CAN_DEFAULT, GTK_HAS_DEFAULT and
Sun Sep 03 00:47:08 2000  George Lebl <jirka@5z.com>

	* gtk/gtkwidget.h:  Add some documenting comments about
	  GTK_CAN_DEFAULT, GTK_HAS_DEFAULT and GTK_RECEIVES_DEFAULT
	  just as owen said on irc.

	* gtk/gtkwindow.c (gtk_window_set_default):  Don't blindly
	  set HAS_DEFAULT.  Only set it if there isn't another window
	  holding it (a focus window which RECEIVES_DEFAULT) and only unset
	  it if the widget is not the focused window with RECEIVES_DEFAULT.
	  This fixes weird double default bugs in dialogs which has things
	  call gtk_window_set_default at times.
2000-09-03 06:20:22 +00:00
Andraz Tori
73d05f5fa0 Updated slovenian translation 2000-08-20 09:30:54 +00:00
Owen Taylor
935faa6b4c Don't leave dangling ->prev fields when merging lists. (Found
Fri Aug 18 17:27:46 2000  Owen Taylor  <otaylor@redhat.com>

	* gtk/gtkclist.c (gtk_clist_merge): Don't leave dangling
	->prev fields when merging lists. (Found simultaneously
	by Pawel Salek and Jakub Jelinek)
2000-08-18 21:37:06 +00:00
Pablo Saratxaga
9e3e202fa9 Added Serbian files 2000-07-30 12:23:33 +00:00
Tim Janik
0d9d12d00c applied patch from Phil Thompson <phil@river-bank.demon.co.uk> that
Thu Jul 27 05:06:29 2000  Tim Janik  <timj@gtk.org>

        * gtk/gtktable.c: applied patch from Phil Thompson
        <phil@river-bank.demon.co.uk> that enables space settings for
        the last row/columns as well.
2000-07-27 03:12:32 +00:00
Sebastian Wilhelmi
b5b621ce5a Include gdk/gdkrgb.h and gtk/gtktypebuiltins.h resp. outside of the extern
2000-07-19  Sebastian Wilhelmi  <wilhelmi@ira.uka.de>

	* gdk/gdk.h, gtk/gtktypeutils.h: Include gdk/gdkrgb.h and
	gtk/gtktypebuiltins.h resp. outside of the extern "C" block. Makes
	some C++ compiler happy. Reported by Denis Vakatov
	<vakatov@peony.nlm.nih.gov>.
2000-07-19 14:12:07 +00:00
Tim Janik
7e8b6c50c9 scratched notion of completely outdated email adress:
Tue Jul 11 20:47:13 2000  Tim Janik  <timj@gtk.org>

        * docs/gtk_tut_it.sgml (name):
        * docs/gtk_tut_fr.sgml (name):
        * docs/gtk_tut.sgml (name): scratched notion of completely
        outdated email adress: s/timj@psynet.net/timj@gtk.org/.
2000-07-11 19:03:27 +00:00
Tim Janik
f969f69af3 eek, i've never seen a bug here, never been here and never fixed anything
Tue Jul 11 08:04:58 2000  Tim Janik  <timj@gtk.org>

        * gtk/gtktree.c (gtk_real_tree_select_child): eek, i've never seen
        a bug here, never been here and never fixed anything ;(
        (don't segfault if tree->root_tree is NULL, which happens prior
        to widget realization, but puke instead).
2000-07-11 06:08:02 +00:00
Jesus Bravo Alvarez
7307991b62 Fixed Galician translation 2000-07-10 22:30:08 +00:00
Jesus Bravo Alvarez
c3cde286c9 Fixed Galician translation 2000-07-10 22:28:57 +00:00
Jesus Bravo Alvarez
3cdc2b5eeb Fixed Galician translation 2000-07-10 21:24:47 +00:00
Pablo Saratxaga
a07c4138b8 movec gtkrc.bg to more generic gtkrc.cp1251 2000-06-18 13:55:15 +00:00
Owen Taylor
2589e32c32 Fix cut and paste typo where wrong pixmap was being unref'ed. (Pointed out
Sun Jun 11 12:46:19 2000  Owen Taylor  <otaylor@redhat.com>

	* gtk/gtkdnd.c (gtk_drag_set_default_icon): Fix
	cut and paste typo where wrong pixmap was being
	unref'ed. (Pointed out by a friend of KUSANO Takayuki.)

Sun Jun 11 10:22:36 2000  Owen Taylor  <otaylor@redhat.com>

	* gtk/gtkselection.c (gtk_selection_bytes_per_item):
	Add helper function to compute format / bytes
	relationship. Use in a couple places to fix up
	errors which assume 8 * format.

	* gtk/gtkselection.c (gtk_selection_request): Use 32
	rather than 8 * sizeof (GdkAtom), to work correctly
	on Alpha.
2000-06-11 18:02:31 +00:00
Ville Hautamaki
2d68dd4799 Minor finnish update to gtk+ gtk-1-2 branch
Ville
2000-05-25 13:43:08 +00:00
Tim Janik
52223d33df released Gtk+-1.2.8.
Thu May 25 03:54:30 2000  Tim Janik  <timj@gtk.org>

        * released Gtk+-1.2.8.


(see? i _can_ get it right the first time ;)
2000-05-25 01:56:23 +00:00
Tim Janik
3a5d4e0087 gtk version 1.2.8, interface age 3, binary age 8.
Thu May 25 02:30:57 2000  Tim Janik  <timj@gtk.org>

        * configure.in: gtk version 1.2.8, interface age 3, binary age 8.
2000-05-25 01:00:26 +00:00
Tim Janik
b055c28254 update corrections ;) 2000-05-24 22:26:59 +00:00
Tim Janik
21d6acdd59 updates 2000-05-24 22:26:41 +00:00
Kjartan Maraas
71112bd2ea Update 2000-05-22 00:27:11 +00:00
Kenneth Christiansen
76014e2a5f update 2000-05-21 23:09:44 +00:00
Kjartan Maraas
5a4b3458f9 Added Norwegian translation (nynorsk dialect).
2000-05-20  Kjartan Maraas  <kmaraas@gnu.org>

	* nn.po: Added Norwegian translation (nynorsk dialect).
2000-05-20 17:41:16 +00:00
Kjartan Maraas
bb255d8d68 Removed obsolete 2000-05-19 10:34:08 +00:00
Tim Janik
90e47067c4 fix mangling of rectangle height with its width, spotted by Justin David
Fri May 19 09:54:53 2000  Tim Janik  <timj@gtk.org>

        * gtk/gtkwidget.c (gtk_widget_clip_rect): fix mangling of rectangle
        height with its width, spotted by Justin David Smith (Ytinasni)
        <justins@velius.chaos2.org>.
2000-05-19 08:20:29 +00:00
Tim Janik
42c524897f handle "(nil)" foundries, patch from Grigorios Magklis.
Fri May 19 06:49:23 2000  Tim Janik  <timj@gtk.org>

        * gtk/gtkfontsel.c (gtk_font_selection_get_font_name): handle
        "(nil)" foundries, patch from Grigorios Magklis.

        * gtk/gtkfontsel.c (gtk_font_selection_load_font): don't crash
        on non-available fonts, based on a patch by Grigorios Magklis
        <maglis@cs.rochester.edu>.

Fri May 19 05:52:08 2000  Tim Janik  <timj@gtk.org>

        * gdk/gdkx.h: wrap contents into extern "C" { }, patch by Leonardo
        Zide (leo@lokigames.com).
2000-05-19 05:42:06 +00:00
Szabolcs Ban
93fe7a1353 Szabolcs BAN <shooby@gnome.hu>
* Finished Hungarian translations...
2000-05-18 13:19:46 +00:00
Ville Hautamaki
3d46b64e3d Minor finnish update
Ville
2000-05-18 11:06:16 +00:00
Pablo Saratxaga
5d1c00802e Updated Spanish and Walloon files
Corrected a syntax error in Dutch file ( s -> %s )
2000-05-17 23:33:45 +00:00
Raph Levien
eda7c00f58 Fixed segfault when gdk_rgb_min_colors exceeds maximum cube size. 2000-05-17 08:04:06 +00:00
Pablo Saratxaga
ab364d726a Added a gtkrc.cp1255 for Yiddish/Hebrew fontset
Added "*-r-*" to all fontsets; as a last resort default.
2000-05-08 18:49:18 +00:00
Pablo Saratxaga
7d622f5328 Updated ca.po (changed mantainer) 2000-05-04 13:09:40 +00:00
Tim Janik
ee76654247 some Make 3.79 $(strip ) versions are broken and require an empty arg,
Thu May  4 02:04:46 2000  Tim Janik  <timj@gtk.org>

        * configure.in (STRIP_DUMMY): some Make 3.79 $(strip ) versions are
        broken and require an empty arg, give it to them.
2000-05-04 00:19:04 +00:00
Pablo Saratxaga
cc4ef5bcdf Updated wa.po 2000-04-30 00:26:02 +00:00
Tim Janik
2e34ce303a when unref-ing the handlers, also invalidate them. bug nailed down by Karl
Sun Mar 26 03:21:28 2000  Tim Janik  <timj@gtk.org>

        * gtk/gtksignal.c (gtk_signal_handlers_destroy): when unref-ing
        the handlers, also invalidate them. bug nailed down by Karl Nelson
        <kenelson@ece.ucdavis.edu>.
2000-03-26 01:30:34 +00:00
Pablo Saratxaga
44e72c4ac1 Updated Lithuanian file 2000-03-20 18:39:46 +00:00
Owen Taylor
74bd7ec0a1 Fix a bunch of cases where XGetWindowProperty() is called without trapping
Mon Mar 13 18:37:55 2000  Owen Taylor  <otaylor@redhat.com>

	* gdk/gdkdnd.c: Fix a bunch of cases where XGetWindowProperty()
	is called without trapping X errors.
2000-03-13 23:41:53 +00:00
Pablo Saratxaga
4078590376 Updated lt.po 2000-03-13 21:14:29 +00:00
GMT 2000 Tony Gale
388e9cc8b1 FAQ Update: - Minor cleanups (Emmanuel, me) - New questions: I need to add
Thu Mar  9 22:10:56 GMT 2000  Tony Gale <gale@gtk.org>

        * docs/gtkfaq.sgml: FAQ Update:
          - Minor cleanups (Emmanuel, me)
          - New questions:
                I need to add a new signal to a GTK+ widget. Any idea? (timj)
                How can I retrieve the text from a GtkMenuItem? (timj)
                How do I validate/limit/filter the input to a GtkEntry? (me)
                Memory does not seem to be released when I free the list
                        nodes I've allocated (timj)
2000-03-10 09:36:09 +00:00
Tim Janik
a24c0e61f6 nothing really 2000-03-01 05:08:59 +00:00
GMT 2000 Tony Gale
877738b90a Spelling/grammar fixes from Martin Buchholz <martin@xemacs.org>
Tue Feb 29 13:10:00 GMT 2000  Tony Gale <gale@gtk.org>

        * gdk/gdkwindow.h gdk/x11/gxid.c gtk/gtkclist.c gtk/gtkclist.h
          gtk/gtkctree.c gtk/gtkmenu.h gtk/gtkwidget.c gtk/testgtk.c
          docs/styles.txt docs/refcounting.txt docs/gtkfaq.sgml
          docs/gtk_tut.sgml docs/gtk.texi TODO:

          Spelling/grammar fixes from Martin Buchholz <martin@xemacs.org>
2000-02-29 13:28:13 +00:00
Owen Taylor
fcfaafd93e Fix problem where stray '"' characters found their way into the fontset
Fri Feb 25 10:48:53 2000  Owen Taylor  <otaylor@redhat.com>

	* gtk/gtkrc.*: Fix problem where stray '"' characters found their
	way into the fontset lists.
2000-02-25 15:49:36 +00:00
GMT 2000 Tony Gale
30cc40d29e Implement num_marked_dates, and don't emit mutiple day_selected signals on
Thu Feb 24 16:12:27 GMT 2000  Tony Gale <gale@gtk.org>

        * gtk/gtkcalendar.c: Implement num_marked_dates,
          and don't emit mutiple day_selected signals on
          month_prev.
2000-02-24 16:16:29 +00:00
GMT 2000 Tony Gale
86171eb551 New section on GtkCalendar Update example code
Wed Feb 23 10:54:14 GMT 2000  Tony Gale <gale@gtk.org>

        * docs/gtk_tut.sgml: New section on GtkCalendar
        * examples/calendar: Update example code
2000-02-23 10:55:56 +00:00
GMT 2000 Tony Gale
8ae8964c9f Get the date on the FAQ right. Grr.
Tue Feb 22 14:02:48 GMT 2000 Tony Gale <gale@gtk.org>

	* Get the date on the FAQ right. Grr.
2000-02-22 13:58:08 +00:00
GMT 2000 Tony Gale
5d4a62a69b FAQ Update
Tue Feb 22 13:54:12 GMT 2000  Tony Gale <gale@gtk.org>

        * docs/gtkfaq.sgml: FAQ Update
2000-02-22 13:52:46 +00:00
Tim Janik
572cec3f4c add extern "C" scope.
Tue Feb 22 08:52:52 2000  Tim Janik  <timj@gtk.org>

        * gtk/gtkthemes.h: add extern "C" scope.
2000-02-22 07:58:50 +00:00
Lars Hamann
a53000aa95 applied patch from Guy Harris <guy@netapp.com> to make appends to the list
Mon Feb 21 20:16:42 2000  Lars Hamann  <lars@gtk.org>

        * gtk/gtkclist.c: applied  patch from Guy Harris <guy@netapp.com>
        to make appends to the list constant. (gtk-guy-990901-0.patch)
2000-02-21 20:19:13 +00:00
Havoc Pennington
ac67b09410 Don't recommend the use of gtk_signal_handlers_destroy, closes bug #6390
2000-02-19  Havoc Pennington  <hp@pobox.com>

	* docs/gtk_tut.sgml: Don't recommend the use of
		gtk_signal_handlers_destroy, closes bug #6390
2000-02-19 19:59:06 +00:00
Tim Janik
e57721e0ba remove extraneous prototypes, patch from Sam O'Connor
Thu Feb 17 02:19:32 2000  Tim Janik  <timj@gtk.org>

        * gdk/gdk.h:
        * gtk/gtkaccelgroup.h:
        * gtk/gtkthemes.h: remove extraneous prototypes, patch from
        Sam O'Connor <oconnor@eiffel.com>.
2000-02-17 01:25:27 +00:00
CST 2000 Shawn T. Amundson
fa77e9551f Released GTK+ 1.2.7
Wed Feb 16 05:22:36 CST 2000 Shawn T. Amundson <amundson@gtk.org>

        * Released GTK+ 1.2.7
2000-02-16 13:04:31 +00:00
SHIRASAKI Yasuhiro
01ae7f9537 Updated Japanese translation.
* ja.po: Updated Japanese translation.

-- yasuhiro
2000-02-15 02:21:38 +00:00
Tim Janik
60aea982b0 use g_str_hash() and g_str_equal() for the typename hash table.
Mon Feb 14 22:50:10 2000  Tim Janik  <timj@gtk.org>

        * gtk/gtktypeutils.c (gtk_type_init): use g_str_hash() and g_str_equal()
        for the typename hash table.
2000-02-14 21:55:04 +00:00
Owen Taylor
5c478e3754 Add some sanity checks to make sure we never divide by zero. (Problem
Mon Feb 14 15:01:23 2000  Owen Taylor  <otaylor@redhat.com>

	* gtk/gtkpaned.c (gtk_paned_compute_position): Add some sanity checks
	to make sure we never divide by zero.
	(Problem pointed out by Michal Jaegermann <michal@ellpspace.math.ualberta.ca>)
2000-02-14 20:03:04 +00:00
Owen Taylor
2853369686 Apply patch from SHIRASAKI Yasuhiro <yasuhiro@awa.tohoku.ac.jp> to make
Mon Feb 14 12:29:38 2000  Owen Taylor  <otaylor@redhat.com>

	* gtk/gtkfontsel.c: Apply patch from
	SHIRASAKI Yasuhiro <yasuhiro@awa.tohoku.ac.jp> to make font selector work a little
	better with 2-byte fonts. (Load a fontset instead of a font for two byte fonts.)

	Also, some cleanups in atom handling.
2000-02-14 19:35:29 +00:00
Tim Janik
a326074438 parent class is GtkContainer, not GtkWidget.
Sun Feb 13 08:02:21 2000  Tim Janik  <timj@gtk.org>

        * gtk/gtksocket.c (gtk_socket_class_init): parent class is GtkContainer,
        not GtkWidget.
2000-02-13 07:03:53 +00:00
Tim Janik
778cb9ab52 had to squeeze some more guint wrap-around bugs before going to bed.
Fri Feb 11 02:19:32 2000  Tim Janik  <timj@gtk.org>

        * gtk/gtkhpaned.c (gtk_hpaned_size_allocate):
        * gtk/gtkvpaned.c (gtk_vpaned_size_allocate):
        * gtk/gtkpaned.c (gtk_paned_compute_position): had to squeeze some
        more guint wrap-around bugs before going to bed.
2000-02-11 06:39:19 +00:00
Tim Janik
3f8d44d715 guard against guint wrap arounds in allocation.width.
Thu Feb 10 16:16:35 2000  Tim Janik  <timj@gtk.org>

        * gtk/gtkspinbutton.c (gtk_spin_button_size_allocate): guard against
        guint wrap arounds in allocation.width.

        * gtk/gtktable.c (gtk_table_size_allocate_pass1): repeat shrinking
        process untill we fit the allocation given.
2000-02-10 21:13:41 +00:00
Tim Janik
c39a5a1c6f guard widget access with ref/unref around signal emission.
Tue Feb  8 09:38:29 2000  Tim Janik  <timj@gtk.org>

        * gtk/gtkwidget.c:
        (gtk_widget_unrealize): guard widget access with ref/unref
        around signal emission.
        (gtk_widget_hide): same here, but also check its destroyed
        state before queueing a resize.
2000-02-08 09:03:51 +00:00
Tim Janik
319b25908b use gtk_default_prelight_bg instead of gtk_default_insensitive_bg as
Tue Feb  8 03:05:55 2000  Tim Janik  <timj@gtk.org>

        * gtk/gtkstyle.c (gtk_style_new): use gtk_default_prelight_bg instead
        of gtk_default_insensitive_bg as insensitive base color.

        * gtk/gtktext.c (gtk_text_style_set): set the background color according
        to the widget's state.
        (gtk_text_realize): same here.
        (gtk_text_state_changed): same here.
        (draw_bg_rect): compare background color against base[] from
        GTK_WIDGET_STATE (text) not GTK_STATE_NORMAL.
2000-02-08 02:09:23 +00:00
Tim Janik
49bc9e0606 ignore delete events when grabs are active, unless a delete event is send
Mon Feb  7 04:01:55 2000  Tim Janik  <timj@gtk.org>

        * gtk/gtkmain.c (gtk_main_do_event): ignore delete events when
        grabs are active, unless a delete event is send to the toplevel
        of the currently grab holding widget.
2000-02-07 05:27:08 +00:00
Owen Taylor
81cb919181 Remove debugging g_print's.
Sun Feb  6 10:13:15 2000  Owen Taylor  <otaylor@redhat.com>

	* gtk/gtkctree.c (gtk_ctree_drag_data_received): Remove
	debugging g_print's.
2000-02-06 15:14:36 +00:00
Tim Janik
1f72a1fd70 up version number to 1.2.7, interface age 2, binary age 7. depend on glib
Fri Feb  4 19:40:50 2000  Tim Janik  <timj@gtk.org>

        * configure.in: up version number to 1.2.7, interface age 2, binary
        age 7. depend on glib 1.2.7.

        * NEWS: updates.
2000-02-04 03:26:10 +00:00
Owen Taylor
5aa2275d8b Feb 4 15:54:54 2000 Owen Taylor <otaylor@redhat.com>
* gtk/gtkscrolledwindow.c (gtk_scrolled_window_size_request): Don't
	ever make the scrolled-window requisition ever depend on the
	visibility state of the scrollbars for the AUTOMATIC policy.
	This breaks the	GTK+ requisition model, and causes loops.
2000-02-03 23:45:12 +00:00
Owen Taylor
ed581c7530 Set the charset explicitely for the default font to avoid problems with
Fri Feb  4 15:09:12 2000  Owen Taylor  <otaylor@redhat.com>

	* gtk/gtkstyle.c (gtk_style_new): Set the charset explicitely for
	the default font to avoid problems with XFree86-4.0 where the
	default charset is iso10646-1, not iso8859-1.
2000-02-03 22:15:44 +00:00
Pablo Saratxaga
84591d622b updated lt.po 2000-02-03 17:32:44 +00:00
Kjartan Maraas
d5c5dba8de Updated translation.
2000-02-04  Kjartan Maraas  <kmaraas@online.no>

	* no.po: Updated translation.
2000-02-03 11:05:58 +00:00
Manish Singh
b40cc444eb acinclude.m4 config.guess config.sub ltconfig upgrade to libtool 1.3.4
* acinclude.m4
* config.guess
* config.sub
* ltconfig
* ltmain.sh: upgrade to libtool 1.3.4 (bugfix only release)

* gtk/Makefile.am: minor cosmetic consistency tweak

-Yosh
2000-02-03 01:07:44 +00:00
Pablo Saratxaga
c299e5d963 updated ca.po 2000-02-03 01:03:10 +00:00
Owen Taylor
7de47cc94b Set the activate_time to 0, so that we handle a quick press/release
Thu Feb  3 14:46:01 2000  Owen Taylor  <otaylor@redhat.com>

	* gtk/gtkmenushell.c (gtk_menu_shell_button_release): Set
	the activate_time to 0, so that we handle a quick
	press/release press/release properly and don't suppress
        the second release. (Red Hat bug #7545)
2000-02-02 22:04:41 +00:00
Tim Janik
cec440f3e4 fixed very evil reentrancy bugs with destruction notifier, *always* update
Wed Feb  2 22:25:17 2000  Tim Janik  <timj@gtk.org>

        * gtk/gtkctree.c (row_delete):
        (gtk_ctree_node_set_row_data_full): fixed very evil reentrancy bugs with
        destruction notifier, *always* update internal structures *before*
        calling user code.
2000-02-01 23:32:26 +00:00
Lars Hamann
255369aecb A few more fixes for bug #5487, #2051, #2677. Reset clist->anchor to -1 if
Sun Jan 30 20:10:52 2000  Lars Hamann  <lars@gtk.org>

        A few more fixes for bug #5487, #2051, #2677.
        * gtk/gtkclist.c :
        (gtk_clist_button_press):  Reset clist->anchor to -1 if event->type is
        not GDK_BUTTON_PRESS.
        (resync_selection): resync only if selection_mode is
        GTK_SELECTION_EXTENDED
        * gtk/gtkctree.c (resync_selection): same here
2000-01-29 23:12:08 +00:00
Owen Taylor
c59f760824 Removed duplicate prototypes for gdk_drag_get_selection() and
Sun Jan 30 12:29:20 2000  Owen Taylor  <otaylor@redhat.com>

	* gdk/gdk.h gtk/gtkmenu.h: Removed duplicate prototypes for
	gdk_drag_get_selection() and gtk_menu_detach().

	[ From Jeroen Ruigrok/Asmodai ]
2000-01-29 20:01:59 +00:00
Owen Taylor
06b6a0f70a page->tab_label can be NULL.
Sat Jan 29 10:11:56 2000  Owen Taylor  <otaylor@redhat.com>

	* gtk/gtknotebook.c (gtk_notebook_size_request):
	page->tab_label can be NULL.
2000-01-28 17:19:02 +00:00
Havoc Pennington
dad7ab1fd6 parent_relative arg is boolean
2000-01-25  Havoc Pennington  <hp@pobox.com>

* gdk/gdkwindow.c (gdk_window_set_back_pixmap): parent_relative
arg is boolean

* gdk/gdkselection.c (gdk_selection_owner_set): return boolean

* gdk/gdkrectangle.c (gdk_rectangle_intersect): return boolean

* gdk/gdkproperty.c (gdk_property_get): return boolean

* gdk/gdkinput.c (gdk_input_set_mode): return boolean

* gdk/gdkim.c (gdk_im_ready): return boolean

* gdk/gdkgc.c (gdk_gc_set_exposures): gboolean arg

* gdk/gdkfont.c (gdk_font_equal): return gboolean (mild
glib clash, should fix glib)

* gdk/gdkevents.c (gdk_set_show_events): take gboolean arg
(gdk_get_show_events): return gboolean, and canonicalize
to TRUE/FALSE

* gdk/gdkcolor.c (gdk_colormap_new): gboolean flag whether the
colormap is private
(gdk_colors_alloc): gboolean whether to be contiguous
(gdk_color_equal): return gboolean since we are a predicate
and not a qsort() (this looks semi-wrong due to glib breakage,
IMO glib should be fixed)

* gdk/gdk.c (gdk_set_use_xshm): take gboolean arg
(gdk_get_use_xshm): return gboolean
(gdk_pointer_is_grabbed): return gboolean

* gdk/gdk.h: Change prototypes to match all the above changes,
and re-run egtk-format-protos as required.
2000-01-27 21:10:44 +00:00
Owen Taylor
bd39b10fc4 Return immediately if clist->drag_pos < 0. This is a workaround for the
Fri Jan 28 12:28:17 2000  Owen Taylor  <otaylor@redhat.com>

	* gtk/gtkctree.c (resync_selection):
	* gtk/gtkclist.c (resync_selection):

	Return immediately if clist->drag_pos < 0. This is a workaround
	for the corrupt state that the clist gets into when a
	GDK_2BUTTON_PRESS occurs. See note in gtk_clist_button_press().

	Bug #5487, #2051, #2677; fix suggested by David Helder and T. Alexander Popiel.

	* gtk/gtknotebook.c (gtk_notebook_size_request): Fix uninitialized
	variable from recent commit.
2000-01-27 19:37:34 +00:00
Pablo Saratxaga
3dad840ffb Added Lithuanian file 2000-01-27 16:29:39 +00:00
Owen Taylor
ef642b7799 Fix stupid typo in last commit.
Thu Jan 27 15:22:09 2000  Owen Taylor  <otaylor@redhat.com>

	* gtk/gtkdnd.c (gtk_drag_begin): Fix stupid typo in last commit.
2000-01-27 02:39:44 +00:00
Tim Janik
958d74e856 prefix all autogenerated source that get build in $(srcdir) with
Thu Jan 27 18:00:55 2000  Tim Janik  <timj@gtk.org>

        * gtk/Makefile.am: prefix all autogenerated source that get build in
        $(srcdir) with $(srcdir)/, so make doesn't assume they got generted
        in builddir. since we subsequently cd into srcdir for autogeneration,
        the paths have to be stripped from the target file names, thusly we
        use $(@F) as target names now.
        put a comment about configure.in's --disable-rebuilds option,
        which can be used for non-writable source directories, for development
        setups though, srcdir has to be *writable*.
2000-01-26 19:20:44 +00:00
Tim Janik
39246639a1 revert change so stuff compiles 2000-01-26 17:11:12 +00:00
Owen Taylor
e5b7ec7e36 Finish the job of allowing event to be NULL. (Fixes bug #4283, reported by
Thu Jan 27 00:15:03 2000  Owen Taylor  <otaylor@redhat.com>

	* gtk/gtkdnd.c (gtk_drag_begin gtk_drag_get_event_actions):
	  Finish the job of allowing event to be NULL.
	  (Fixes bug #4283, reported by Chris Blizzard)

	* gtk/gtkentry.c (entry_adjust_scroll): When calculating
	  things so that the cursor appears on screen, properly
	  take into account INNER_BORDER.
	  (Fixes bug #4754, reported by Antonio Campos)
2000-01-26 05:50:53 +00:00
Owen Taylor
b269eb0874 Don't show the tab_label unless it itself is visible.
Wed Jan 26 23:12:28 2000  Owen Taylor  <otaylor@redhat.com>

	* gtk/gtknotebook.c (gtk_notebook_map): Don't
	  show the tab_label unless it itself is visible.

	  gtk/gtknotebook.c (gtk_notebook_size_request):
	  Do a better job of making sure that the visibility
	  of the tab label corresponds to whether it should
	  be mapped or not.
2000-01-26 04:29:01 +00:00
Owen Taylor
9770128fb9 Use the requisition, not the allocation, since the allocation has not
Wed Jan 26 21:17:03 2000  Owen Taylor  <otaylor@redhat.com>

	* gtk/gtkoptionmenu.c (gtk_option_menu_position):
	  Use the requisition, not the allocation, since the
	  allocation has not necessarily been computed yet.
	  (Pointed out by Eugene Osintsev)
2000-01-26 02:33:04 +00:00
Owen Taylor
c1f4231af6 Dont' set style/base[GTK_STATE_INSENSITIVE] both to
Wed Jan 26 19:44:25 2000  Owen Taylor  <otaylor@redhat.com>

	* gtk/gtkstyle.c (gtk_style_new): Dont' set
	  style/base[GTK_STATE_INSENSITIVE] both to
	  gtk_default_insensitive_bg!
	  (Bug #2187, reported by Jonathan Blandford)

	* gtk/gtkaccelgroup.c (gtk_accelerator_valid):
	  Add Alt_L, Alt_R to list of invalid accelerators.
 	  (Bug #3736, reported by Vlad Harchev)
2000-01-26 01:03:28 +00:00
Owen Taylor
f86f2a2944 Fix several bugs which occured after an attempt to open invalid home
Wed Jan 26 19:01:56 2000  Owen Taylor  <otaylor@redhat.com>

	* gtk/gtkfilesel.c (open_ref_dir): Fix several
	bugs which occured after an attempt to open
	invalid home directory left cmpl_state->reference_dir == NULL.

	 - completion on files in home directory didn't work
	 - completion on an empty string caused  segfault

	 (Bug #3768, reported by Steve Ratcliffe)

	* gtk/gtkscale.c (gtk_scale_get_value_width): Fix
	cut and paste error that was causing scales to
	be incorrectly positioned.
	(Bug #2956,
	 patch from Steve Ratcliffe <steve@parabola.demon.co.uk>)
2000-01-26 00:44:30 +00:00
Shirasaki Yasuhiro
04d6ead184 check dcgettext with libintl, if it's specified.
2000-01-27  Shirasaki Yasuhiro  <yasuhiro@gnome.gr.jp>

        * acinclude.m4 (AM_GTK_WITH_NLS): check dcgettext
        with libintl, if it's specified.
2000-01-26 00:14:43 +00:00
Owen Taylor
4249864c0d Ignore queue_clear on NO_WINDOW widgets during a reparent, since at that
Wed Jan 26 18:06:07 2000  Owen Taylor  <otaylor@redhat.com>

	* gtk/gtkwidget.c (gtk_widget_queue_clear_area): Ignore
	queue_clear on NO_WINDOW widgets during a reparent,
	since at that point the window and widget heirarchies
	are out of sync. This stops crashing in some cases
	(the scrolled window reparent test, for instance), and
	_probably_ won't cause drawing errors.

	* gtk/testgtk.c: Make the reparenting-a-scrolled-window
	test do what it was supposed to do and be robust against
	window closings, etc. (Bug #2443)
2000-01-25 23:48:45 +00:00
Owen Taylor
cc7b995f66 Fix return values on mouse events. (Bug #2686, Sky <seb_sky@yahoo.com>)
Wed Jan 26 16:56:54 2000  Owen Taylor  <otaylor@redhat.com>

	* gtk/gtkentry.c: Fix return values on mouse events.
	(Bug #2686, Sky <seb_sky@yahoo.com>)

	* gtk/genmarshal.pl: Fix up handling of FOREIGN.
	(pointed out by George Lebl)

 	* gdk/gdkcolor.c (gdk_color_copy): Made const-safe.
	(From Ettore Perazzoli  <ettore@helixcode.com>)
2000-01-25 22:20:20 +00:00
Owen Taylor
03fc238e46 Tiny update from Stanislav Brabec <utx@k332.feld.cvut.cz> (closes Bug
Tue Jan 25 16:46:23 2000  Owen Taylor  <otaylor@redhat.com>

	* cs.po: Tiny update from  Stanislav Brabec <utx@k332.feld.cvut.cz>
	(closes Bug #2406)
2000-01-25 21:26:28 +00:00
Owen Taylor
911ced17c2 Handle clicks between rows or outside calender area correctly. (Patch from
Mon Jan 24 10:44:48 2000  Owen Taylor  <otaylor@redhat.com>

	* gtk/gtkcalendar.c (gtk_calendar_main_button): Handle
	clicks between rows or outside calender area correctly.
	(Patch from Damon Chaplin)

	* gtk/gtkclist.c (gtk_clist_set_row_data_full):
	* gtk/gtkctree.c (gtk_ctree_node_set_row_data_full):
	  Call destroy function when overwriting existing data.
	  (Pointed out by Damon Chaplin)
2000-01-25 15:18:19 +00:00
Owen Taylor
67dbd575c2 Remove useless #include of <X11/Xmu/WinUtil.h>, which was causing problems
Tue Jan 25 09:55:41 2000  Owen Taylor  <otaylor@redhat.com>

	* gdk/gdk.c: Remove useless #include of <X11/Xmu/WinUtil.h>,
	  which was causing problems on various systems with Xmu.
	  This hasn't been needed for a very long time.
	  (Fixes #1185 3167)
2000-01-25 14:42:27 +00:00
Owen Taylor
c3bf3122da Include <ctype.h> when defining gdk_isw* in terms of is* as a fallback.
Sun Jan 23 22:27:36 2000  Owen Taylor  <otaylor@redhat.com>

	* gdk/gdki18n.h: Include <ctype.h> when defining
	  gdk_isw* in terms of is* as a fallback.
	  (Bug #4106 - Dan Winship <danw@MIT.EDU>)
2000-01-24 02:58:21 +00:00
Owen Taylor
1175039476 Don't realize the widget when it is size allocated! (old, old bug)
Sun Jan 23 22:12:36 2000  Owen Taylor  <otaylor@redhat.com>

	* gtk/gtkviewport.c (gtk_viewport_size_allocate): Don't
	  realize the widget when it is size allocated!
	  (old, old bug)

	* gtk/gtkviewport.c (gtk_viewport_adjustment_value_changed):
	  Removed unused call to gdk_window_get_size() that
	  showed up when the above was fixed.
2000-01-24 02:41:59 +00:00
Owen Taylor
373c75d574 Added short note about setting LDFLAGS and CPPFLAGS to find libraries not
Sun Jan 23 20:52:40 2000  Owen Taylor  <otaylor@redhat.com>

	* INSTALL: Added short note about setting LDFLAGS
	  and CPPFLAGS to find libraries not in the default
	  install path. Fixed env/setenv confusion for csh.
2000-01-24 01:21:20 +00:00
Owen Taylor
fcd4498506 Correctly fix up widget->window when the widget is a NO_WINDOW container
Sat Jan 22 15:44:30 2000  Owen Taylor  <otaylor@redhat.com>

	* gtk/gtkwidget.c (gtk_widget_reparent): Correctly
	  fix up widget->window when the widget is a
	  NO_WINDOW container widget.
2000-01-22 21:48:49 +00:00
Owen Taylor
7c1abc5f73 Rewrite to account for the fact that feof() does _not_ return TRUE on
Sat Jan 22 12:40:48 2000  Owen Taylor  <otaylor@redhat.com>

	* gdk/gdkpixmap.c (gdk_pixmap_seek_string): Rewrite
	  to account for the fact that feof() does _not_
	  return TRUE on errors, and thus avoid infinite loops
	  when trying to use gdk_pixmap_create_from_xpm()
	  on unreadable values.
2000-01-22 17:43:44 +00:00
Owen Taylor
25b47b88cd s/gint/gboolean/.
Fri Jan 21 18:32:43 2000  Owen Taylor  <otaylor@redhat.com>

	* gtk/gtkaspectframe.h (struct _GtkAspectFrame): s/gint/gboolean/.
2000-01-21 23:34:54 +00:00
Owen Taylor
638080f28a Change from gdk_gc_set_dashes to take gint8 instead of gchar to make it
Fri Jan 21 16:24:08 2000  Owen Taylor  <otaylor@redhat.com>

	* gdk/gdkgc.c (gdk_gc_set_dashes): Change from
	  gdk_gc_set_dashes to take gint8 instead of gchar to
	  make it clearer that it is _not_ a NULL terminated string.

	* gdk/gdk.h gdk/gdkfont.c gdk/gdkgc.c gdk/gdkselection.c
	  gdk/gdkwindow.c gtk/gtkprogress.[ch] gtk/gtkthemes.[ch]
	  gtk/gtktreeitem.[ch] gtk/gtkwidget.[ch]: Constify string
	  arguments.
2000-01-21 23:22:51 +00:00
Elliot Lee
087eed88f3 Add note about gtk_tooltips_set_colors().
2000-01-13 Elliot Lee <sopwith@redhat.com>
	* gtk/gtktooltips.c: Add note about gtk_tooltips_set_colors().
2000-01-13 21:17:40 +00:00
Pablo Saratxaga
ecc7096f83 updated es.po 2000-01-09 17:42:09 +00:00
Jesus Bravo Alvarez
29edc1802f Added Galician to ALL_LINGUAS 2000-01-08 10:11:18 +00:00
Kjartan Maraas
bd063a8f9a And this file too 2000-01-03 23:57:26 +00:00
Kjartan Maraas
bc36a3cdb0 A little script that lets people update the .pot file without makefiles
2000-01-04  Kjartan Maraas  <kmaraas@online.no>

	* update.sh: A little script that lets people
	update the .pot file without makefiles etc.
2000-01-03 23:56:24 +00:00
Jesus Bravo Alvarez
cb0c6a6943 Updated Galician translation 2000-01-03 12:47:22 +00:00
Tim Janik
ddd28f9d4c when calculating the background size relative to our allocation, guard
Thu Dec 30 04:51:05 1999  Tim Janik  <timj@gtk.org>

        * gtk/gtkvscale.c (gtk_vscale_pos_background):
        * gtk/gtkhscale.c (gtk_hscale_pos_background): when calculating the
        background size relative to our allocation, guard against small
        allocations, we may have not yet been size allocated.
1999-12-30 03:57:47 +00:00
Tim Janik
4ff91a04c0 reverted sopwith's changes to Makefile.am, the builddir != srcdir case was
Fri Dec 24 03:41:33 1999  Tim Janik  <timj@gtk.org>

        * gtk/Makefile.am: reverted sopwith's changes to Makefile.am,
        the builddir != srcdir case was already handled fine, and his
        "fix" would produce multiple copies of the built sources.
        for development you just need a writable srcdir.
1999-12-24 02:46:23 +00:00
Elliot Lee
1b1ea194a5 And add .c to a filename, DOH!
And add .c to a filename, DOH!
1999-12-21 23:41:14 +00:00
Elliot Lee
d74b6b56e6 (Tagalong to previous commit) Trailing \'s on previous lines were
(Tagalong to previous commit) Trailing \'s on previous lines were
preventing CWD going back to $builddir
1999-12-21 23:39:31 +00:00
Elliot Lee
822fab280f Fix builddir != srcdir for generation of gtktypebuiltins*.[ch]
* gtk/Makefile.am: Fix builddir != srcdir for
  generation of gtktypebuiltins*.[ch]
1999-12-21 23:36:07 +00:00
Owen Taylor
7b31d00ddf Allow version >= 3, not just version == 3. We implement all 3 + most of 4
Thu Dec  2 10:59:14 1999  Owen Taylor  <otaylor@redhat.com>

	* gdk/gdkdnd.c (xdnd_check_dest): Allow version >= 3,
	not just version == 3. We implement all 3 + most of 4 -
	(we don't support matching text/plain;charset=iso-8859-1
	to a dest that expects text/plain). We'll still advertise
	3 to be safe, but any client implementing version >= 3
	must interoperate with 3.
1999-12-02 17:03:55 +00:00
Owen Taylor
f6e398fa53 Reverted pending mail to developers explaining patch 1999-11-20 14:32:35 +00:00
Dietmar Maurer
6eb684bebc *** empty log message *** 1999-11-20 14:16:34 +00:00
Owen Taylor
d8ebd2d78a If translation does not include a '/', use entire translation instead of
Tue Nov 16 10:15:54 1999  Owen Taylor  <otaylor@redhat.com>

	* gtk/gtkitemfactory.c (gtk_item_factory_parse_path):
	If translation does not include a '/', use entire
	translation instead of crashing.
1999-11-16 15:25:48 +00:00
GMT 1999 Tony Gale
0d4c279b4b s/gtk_main_iteration/g_main_iteration/
Mon Nov 15 17:17:51 GMT 1999 Tony Gale  <gale@gtk.org>

        * docs/gtkfaq.sgml: s/gtk_main_iteration/g_main_iteration/
1999-11-15 17:21:26 +00:00
Pablo Saratxaga
6c70ce7260 updated el.po 1999-11-14 18:48:20 +00:00
GMT 1999 Tony Gale
828b8b8600 New example code files.
Sat Nov 13 23:18:42 GMT 1999  Tony Gale  <gale@gtk.org>

New example code files.
1999-11-13 23:02:30 +00:00
GMT 1999 Tony Gale
bcb86b752f threads example from Erik Mouw. New question on GtkLabel background
Sat Nov 13 22:30:29 GMT 1999 Tony Gale  <gale@gtk.org>

        * docs/gtkfaq.sgml: threads example from Erik Mouw.
        New question on GtkLabel background colors.

        * docs/gtk_tut.sgml:
          - Correct the example code callback
            function definitions.
          - Update the gtkdial example code, from Frans van Schaik.
          - Update setselection.c to current API.
          - Merge the various versions of this document.

        * examples/Makefile examples/*/*.c: Update to code
        listed in tutorial.
1999-11-13 23:01:18 +00:00
Pablo Saratxaga
0a4ea40510 updated danish file 1999-11-13 20:39:28 +00:00
Sven Neumann
43f31b2e7d gdk/gdkinputcommon.h Call XFreeDeviceState() on results of
* gdk/gdkinputcommon.h
        * gdk/gdkinputxfree.h: Call XFreeDeviceState() on results of
        XQueryDeviceState(). (Ported from HEAD)

--Sven
1999-11-12 21:27:10 +00:00
GMT 1999 Tony Gale
10b03b35c0 Fix off-by-one bug in parameter check.
Wed Nov 10 17:26:49 GMT 1999 Tony Gale  <gale@gtk.org>

        * gtk/gtkclist.c: Fix off-by-one bug in parameter
        check.
1999-11-10 17:31:11 +00:00
Pablo Saratxaga
ab3a70ee16 completed the gtkrc (when declaring arial for the native charset it works
better if it is used for iso8859-1 in the fontset too...)
1999-11-09 18:00:27 +00:00
Pablo Saratxaga
b0e81d06c0 added arial to the various gtkrc fontsets; so on systems that have those
fonts installed the can be used (and in some cases they are currently the
only good fonts available at no cost for some charset encodings)
1999-11-09 17:52:45 +00:00
Owen Taylor
6ed6b20570 Remove files that leaked in from head branch due to CVS magic 1999-11-08 20:16:42 +00:00
Tim Janik
9230dc1470 s/gtk_accel_group_attach/gtk_window_add_accel_group/.
Sun Oct 31 22:21:11 1999  Tim Janik  <timj@gtk.org>

        * docs/gtk_tut.sgml:
        s/gtk_accel_group_attach/gtk_window_add_accel_group/.
1999-10-31 22:46:16 +00:00
BST 1999 Tony Gale
47e15bdf5f FAQ update
Sat Oct 30 13:17:18 BST 1999 Tony Gale <gale@gtk.org>

        * docs/gtkfaq.sgml: FAQ update
1999-10-30 12:04:35 +00:00
Owen Taylor
e9c55bc8ce Use g_list_remove_link, not g_list_remove.
Sat Oct 30 09:09:09 1999  Owen Taylor  <otaylor@redhat.com>

	* gtk/gtkselection.c (gtk_target_list_remove): Use
	g_list_remove_link, not g_list_remove.

	[ From Geert Bevin <gbevin@thunderstorms.org> ]
1999-10-25 00:05:26 +00:00
Tim Janik
703f17ec05 commented out g_print() statement upon unselection (how the heck did that
Sun Oct 24 07:41:40 1999  Tim Janik  <timj@gtk.org>

        * gtk/gtkclist.c (real_undo_selection): commented out g_print()
        statement upon unselection (how the heck did that slip in?).
1999-10-24 06:27:11 +00:00
Tim Janik
3b3891191e undraw/draw cursor here to avoid unnecessary scrolling in frozen state
Sat Oct 23 03:03:08 1999  Tim Janik  <timj@gtk.org>

        * gtk/gtktext.c (gtk_text_freeze):
        (gtk_text_thaw): undraw/draw cursor here to avoid unnecessary scrolling
        in frozen state (and aparently crashes). patch provided by Anders
        Melchiorsen <and@kampsax.dtu.dk>.

Sat Oct 23 02:53:20 1999  Tim Janik  <timj@gtk.org>

        * fix insensitive default/focus widget activation,
        reported by Matt Goodall <mgg@isotek.co.uk>.

        * gtk/gtkwindow.c (gtk_window_key_press_event):
        (gtk_window_activate_default):
        (gtk_window_activate_focus):
        return handled=FALSE for actiavtion of insensitive default
        widgets. return handled=TRUE for activation of insensitive
        focus widgets. don't activate in either case.
1999-10-23 01:32:26 +00:00
Owen Taylor
ae1f478285 Switch order of @x_cflags@ and $glib_cflags to match library order and in
Tue Oct 19 09:55:08 1999  Owen Taylor  <otaylor@redhat.com>

	* gtk-config.in (lib_gtk): Switch order of @x_cflags@
	and $glib_cflags to match library order and in the
	theory that an old version of GLib is more likely to
	be in the include directory for X then vice-versa.
	(Bug #2776)
1999-10-19 14:56:55 +00:00
Owen Taylor
1e8e510300 Always use LC_CTYPE to determine the locale for fontsets, not LC_MESSAGES;
Tue Oct 19 09:46:49 1999  Owen Taylor  <otaylor@redhat.com>

	* gtk/gtkrc.c (gtk_rc_init): Always use LC_CTYPE
	to determine the locale for fontsets, not LC_MESSAGES;
	the user may want English messages with a handling
	for non-English languages. (LC_CTYPE=ru_RU LC_MESSAGES=fr_FR
	will still be broken)
1999-10-19 14:49:44 +00:00
Changwoo Ryu
d7e9880433 Fixed the wrong number of "*"'s.
* gtk/gtkrc.ko: Fixed the wrong number of "*"'s.
1999-10-19 11:39:25 +00:00
Changwoo Ryu
23c00ecebe Changed the Korean default fontset.
* gtk/gtkrc.ko: Changed the Korean default fontset.
1999-10-19 03:17:46 +00:00
Sergey I. Panov
6841c77b0c ru.po: Gramm. and Style corrections from Sergey Chernikov
<Sergey_Chernikov@f29.n5051.z2.fidonet.org>
1999-10-15 14:14:32 +00:00
Shawn Amundson
abfd8215f8 release-o-rama 1999-10-08 16:19:38 +00:00
Owen Taylor
e69a498bd5 Fix bug where when scrolling to the left or top double exposes were done,
Fri Oct  8 02:32:47 1999  Owen Taylor  <otaylor@redhat.com>

	* gtk/gtklayout.c (gtk_layout_adjustment_changed): Fix bug
	where when scrolling to the left or top double exposes
	were done, causing major slowdowns.
1999-10-08 14:27:28 +00:00
Yukihiro Nakai
ad246fcf51 ja.po: Update from Shirasaki Yasuhiro
ja.po: Update from Shirasaki Yasuhiro
1999-10-08 08:38:52 +00:00
Owen Taylor
e322f322e2 Always normalize codeset names to lowercase and alphanumeric, before
Thu Oct  7 18:31:55 1999  Owen Taylor  <otaylor@redhat.com>

	* gtk/gtkrc.c (gtk_rc_init): Always normalize codeset
	names to lowercase and alphanumeric, before looking
	them up.

	* gtk/Makefile.am: Install codeset variant gtkrc files
	with normalized names.
1999-10-07 22:38:34 +00:00
Tim Janik
d76955e34b even popup menus when the menu is already visible, but its parent is still
Thu Oct  7 22:52:42 1999  Tim Janik  <timj@gtk.org>

        * gtk/gtkitemfactory.c (gtk_item_factory_popup_with_data): even
        popup menus when the menu is already visible, but its parent
        is still hidden, (happens after tornoff window got hidden).
1999-10-07 21:29:41 +00:00
CDT 1999 Shawn T. Amundson
003c5dccd0 Released GTK+ 1.2.6
Thu Oct  7 12:50:23 CDT 1999 Shawn T. Amundson <amundson@gtk.org>

        * Released GTK+ 1.2.6
1999-10-07 18:28:04 +00:00
Owen Taylor
95a5e5cd09 Fix a typo where gtkrc.vi_VN.tcvn5712 wasn't getting deleted, causing
Thu Oct  7 11:09:55 1999  Owen Taylor  <otaylor@redhat.com>

	* gtk/Makefile.am (install-data-local): Fix
	a typo where gtkrc.vi_VN.tcvn5712 wasn't getting
	deleted, causing error messages on install.

Thu Oct  7 11:03:06 1999  Owen Taylor  <otaylor@redhat.com>

	* gtk/gtk[hv]paned.c (gtk_{h,v}paned_draw): Redraw
	the handle as well, since we now sometimes ignore
	exposes on the handle while resizing.
1999-10-07 15:26:07 +00:00
Jesus Bravo Alvarez
fe725cf7d9 Added Galician .po file 1999-10-06 22:45:46 +00:00
Owen Taylor
4a50847abd Fix stupid extra g_free introduced in one of the last one or two commits.
Wed Oct  6 18:02:31 1999  Owen Taylor  <otaylor@redhat.com>

	* gtk/gtkrc.c (gtk_rc_append_default_pixmap_path): Fix stupid
	extra g_free introduced in one of the last one or two
	commits.
1999-10-06 21:53:32 +00:00
Owen Taylor
83f3b1e8e3 Fix typo from last commit. 1999-10-06 20:33:15 +00:00
Owen Taylor
fd37d2bdb0 Make naming of gtkrc files consistent, put each style that a gtkrc.* file
Wed Oct  6 16:38:36 1999  Owen Taylor  <otaylor@redhat.com>

	* gtk/Makefile.am gtk/gtkrc*: Make naming of gtkrc files
	consistent, put each style that a gtkrc.* file creates
	in a unique namespace, remove old files before installing.
1999-10-06 20:30:11 +00:00
Sergey I. Panov
3b8ecf24f6 ru.po: Updated Russian translation 1999-10-05 18:52:42 +00:00
Manish Singh
91307e5e87 don't list gtkrc in gtkconf_DATA, it totally barfs
-Yosh
1999-10-05 18:42:52 +00:00
Owen Taylor
c2aaaf16f3 Free device->info.axes for core pointer.
Tue Oct  5 02:43:41 1999  Owen Taylor  <otaylor@redhat.com>

	* gdk/gdkinputcommon.h (gdk_input_device_new): Free
	device->info.axes for core pointer.
1999-10-05 16:27:03 +00:00
Pablo Saratxaga
5bfdcc2c3e Added several gtkrc.* fiels for new charset encodings 1999-10-05 12:21:20 +00:00
Pablo Saratxaga
2dc5212004 added several gtkrc.* files 1999-10-05 12:18:22 +00:00
Sergey I. Panov
4478fefd28 ru.po: Updated Russian translation 1999-10-05 05:20:34 +00:00
Nam SungHyun
91da226af7 updated 1999-10-04 18:28:15 +00:00
Kjartan Maraas
f8ca8253f9 Added Ukrainian translation from Yuri Syrota <yuri@renome.rovno.ua>.
1999-09-28  Kjartan Maraas  <kmaraas@online.no>

	* uk.po: Added Ukrainian translation from Yuri
	Syrota <yuri@renome.rovno.ua>.
1999-10-01 22:58:15 +00:00
Owen Taylor
9b98ede875 Rename idle to idle_id, to deal with obsolete, broken C libraries.
Thu Sep 30 13:55:25 1999  Owen Taylor  <otaylor@redhat.com>

	* gtk/testgtk.c (destroy_idle_test): Rename idle to
	idle_id, to deal with obsolete, broken C libraries.
1999-09-30 17:50:50 +00:00
Owen Taylor
a97747dfc7 Get rid of stupid C unsigned integer bug. (Bug #2272)
Wed Sep 29 15:41:08 1999  Owen Taylor  <otaylor@redhat.com>

	* gtk/gtktreeitem.c (gtk_tree_item_size_allocate):
	Get rid of stupid C unsigned integer bug.
	(Bug #2272)
1999-09-29 23:13:01 +00:00
Kjartan Maraas
5739ca8f3b Added Romainan translation from Dan Damian <dand@dnttm.ro>.
1999-09-28  Kjartan Maraas  <kmaraas@online.no>

	* ro.po: Added Romainan translation from Dan
	Damian <dand@dnttm.ro>.
1999-09-28 22:25:29 +00:00
Owen Taylor
9cc3eb8c0d Don't add in allocation->x/y twice!
Mon Sep 27 02:50:15 1999  Owen Taylor  <otaylor@redhat.com>

	* gtk/gtkvscale.c (gtk_vscale_draw): Don't add in
	allocation->x/y twice!

	* gtk/gtkhscale.c: Make usage of gtk_hscale_pos_trough()
	consistent with gtk_vscale_pos_trough().
1999-09-27 14:56:17 +00:00
Owen Taylor
6b5d56e39c We may be queueing a resize on a toplevel container between the time we
Sun Sep 26 19:44:34 1999  Owen Taylor  <otaylor@redhat.com>

	* gtk/gtkcontainer.c (gtk_container_queue_resize): We may
	be queueing a resize on a toplevel container between
	the time we show it and when we map it. So, we need
	to test GTK_WIDGET_VISIBLE() for toplevels, and only
	use GTK_WIDGET_DRAWABLE() for child windows.
1999-09-26 23:46:57 +00:00
Chyla Zbigniew
7a4bc2038f Updated Polish translation 1999-09-26 22:28:48 +00:00
Lauris Kaplinski
6b7f4bb036 updated Estonian tranlation 1999-09-26 20:45:39 +00:00
Elliot Lee
51bae3f9cd Make 'dist-hook' targets, which copy the .spec file into $(distdir),
Make 'dist-hook' targets, which copy the .spec file into $(distdir), depend upon the
.spec file, so that the .spec file will be regenerated when a previously-compiled tree
is 'dist'd with a new version number.
1999-09-24 16:18:02 +00:00
CDT 1999 Shawn T. Amundson
60a7c53123 Released GTK+ 1.2.5
Thu Sep 23 20:11:38 CDT 1999 Shawn T. Amundson <amundson@gtk.org>

        * Released GTK+ 1.2.5
1999-09-24 01:37:05 +00:00
Tim Janik
ee09d2e5da changed version from Gtk+-1.2.5-pre2, to Gtk+-1.2.5, interface age 0,
Fri Sep 24 02:00:21 1999  Tim Janik  <timj@gtk.org>

        * configure.in (GTK_VERSION): changed version from Gtk+-1.2.5-pre2,
        to Gtk+-1.2.5, interface age 0, binary age 5.
1999-09-24 00:12:30 +00:00
Owen Taylor
4eb1338d42 Add GDK_WLIBS to LDADDS (fixes bug #2144)
Thu Sep 23 16:41:03 1999  Owen Taylor  <otaylor@redhat.com>

	* gtk/Makefile.am (LDADDS): Add GDK_WLIBS to LDADDS
	(fixes bug #2144)
1999-09-23 23:19:35 +00:00
Tim Janik
8e8ac56db5 check for container DRAWABLE (instead of VISIBLE), so we don't queue
Fri Sep 24 00:51:45 1999  Tim Janik  <timj@gtk.org>

        * gtk/gtkcontainer.c (gtk_container_queue_resize): check for
        container DRAWABLE (instead of VISIBLE), so we don't queue
        resizes on non-toplevel containers.
1999-09-23 22:59:42 +00:00
Tim Janik
54a90a6c61 updates for real 1.2.5 1999-09-23 20:01:29 +00:00
Tim Janik
fc0117177c grr, even if Gdk doesn't handle CreateNotify itself, still put out a
Thu Sep 23 17:59:59 1999  Tim Janik  <timj@gtk.org>

        * gdk/gdkevents.c (gdk_event_translate): grr, even if Gdk doesn't
        handle CreateNotify itself, still put out a debuging message for
        --gdk-debug=events. made the ReparentNotify debugging message more
        verbose.
        wrap xcoords translation for ConfigureEvents into an error trap,
        a destroy event may already be pending, and in that case, the
        actuall coordinate values are not at all critical.
1999-09-23 19:48:16 +00:00
Vincent Renardias
8a7795d2db Updated for 1.2.5.
* Updated for 1.2.5.
1999-09-21 16:58:33 +00:00
Kjartan Maraas
2a0a33bc35 Updated Danish translation from Kenneth Christiansen <kenneth@ripen.dk>
1999-09-20  Kjartan Maraas  <kmaraas@online.no>

	* da.po: Updated Danish translation from Kenneth
	Christiansen <kenneth@ripen.dk>
1999-09-20 18:30:35 +00:00
Pablo Saratxaga
cd1c6de2ea added pt_BR.po file 1999-09-20 11:34:35 +00:00
Tim Janik
44a04ee211 released Gtk+-1.2.5-pre2, interface age 0, binary age 5.
Mon Sep 20 01:21:53 1999  Tim Janik  <timj@gtk.org>

        * released Gtk+-1.2.5-pre2, interface age 0, binary age 5.
1999-09-19 23:57:12 +00:00
Owen Taylor
b107653636 Make the data argument const guchar *.
Sun Sep 19 18:13:31 1999  Owen Taylor  <otaylor@redhat.com>

	* gtk/gtkselection.[ch]: Make the data argument
	const guchar *.
1999-09-19 22:23:46 +00:00
Owen Taylor
90d2cae68c Stop leaking the color_hash all over the place. Simplify and improve the
Sat Sep 18 22:24:15 1999  Owen Taylor  <otaylor@redhat.com>

	* gdk/gdkcc.c: Stop leaking the color_hash all over
	the place. Simplify and improve the logic.
1999-09-19 02:19:26 +00:00
Owen Taylor
369ea6013d Try to behave sensibly if the focus widget is the window itself. (Should
Sat Sep 18 21:27:40 1999  Owen Taylor  <otaylor@redhat.com>

	* gtk/gtkwindow.c: Try to behave sensibly if
	the focus widget is the window itself. (Should
	we allow this at all?)
1999-09-19 01:43:30 +00:00
Kjartan Maraas
175b04c33d Updated Danish translation from Kenneth Christiansen <kenneth@ripen.dk>.
1999-09-17  Kjartan Maraas  <kmaraas@online.no>

	* da.po: Updated Danish translation from Kenneth
	Christiansen <kenneth@ripen.dk>.
1999-09-17 19:35:50 +00:00
Tim Janik
389f174dad make gboolean args in prototypes and implementations consistent (Tomas
Fri Sep 17 09:57:15 1999  Tim Janik  <timj@gtk.org>

        * gtk/gtkwidget.c (gtk_widget_set_sensitive):
        * gtk/gtknotebook.c (gtk_notebook_set_scrollable):
        * gtk/gtknotebook.c (gtk_notebook_set_show_border):
        * gtk/gtkclist.c (gtk_notebook_set_show_border): make gboolean args
        in prototypes and implementations consistent (Tomas Ogren).

        * gdk/gdk.h, gdk/gdkcolor.c: make return types (gint or gboolean)
        for prototypes and function implementations consistent (reported
        by Tomas Ogren).

        * gtk/gtklayout.c (gtk_layout_remove): unset GTK_IS_OFFSCREEN flag
        before the widget is unparented (reported by damon).

        * gtk/gtkdnd.c: make the cursor and icon data _unsigned_ char,
        since we provide unsigned data anyways.
1999-09-17 09:03:44 +00:00
Owen Taylor
c98ffe744f Delay the call to gtk_tooltips_layout_text() until later.
Thu Sep 16 21:32:01 1999  Owen Taylor  <otaylor@redhat.com>

	* gtk/gtktooltips.c (gtk_tooltips_set_tip): Delay
	the call to gtk_tooltips_layout_text() until later.

	* gtk/gtktooltips.c (gtk_tooltips_draw_tips):
	Call gtk_widget_ensure_style() before using the style.
1999-09-17 01:35:56 +00:00
Owen Taylor
661d0ad067 Added workaround for old widgets that don't propagate draws to all
Wed Sep 15 02:52:19 1999  Owen Taylor  <otaylor@redhat.com>

	* gtk/gtkwidget.c (gtk_widget_event): Added workaround
	for old widgets that don't propagate draws to all
	children. (Namely gnome-dock for gnome-libs <= 1.0.16)
1999-09-16 18:59:24 +00:00
Tim Janik
f04d58dd29 NEWS updates 1999-09-14 17:47:06 +00:00
Tim Janik
0ab9dddc34 slight version increment to 1.2.5-pre2.
Tue Sep 14 19:37:53 1999  Tim Janik  <timj@gtk.org>

        * configure.in (GTK_VERSION): slight version increment to 1.2.5-pre2.

Tue Sep 14 19:22:19 1999  Tim Janik  <timj@gtk.org>

        * gtk/gtkwidget.c (gtk_widget_queue_resize): don't queue the parent
        for a redraw but just the widget that requested the resize.

Tue Sep 14 18:29:47 1999  Tim Janik  <timj@gtk.org>

        * gtk/gtkcontainer.c: added new widget level method
        gtk_container_set_reallocate_redraws() and a GtkContainer flag
        reallocate_redraws : 1 to reflect the setting, exported this through
        the argument system as a boolean ::reallocate_redraws.

        * gtk/gtkwidget.c (gtk_widget_size_allocate): when queueing redraws
        on the widget because the allocation changes, do so as well for
        widget->parent if the parent has reallocate_redraws set to TRUE.
        with that containers requesting reallocation redraws get automatically
        redrawn if their children changed allocation (this unfortunately
        affects also other children that didn't change allocation, but we
        cannot work around that before 1.3).

Tue Sep 14 18:23:01 1999  Tim Janik  <timj@gtk.org>

        * gdk/gdkevents.c (gdk_event_translate): tell if expose events have
        send_event set in debugging output.
        (gdk_compress_exposures): default initialize the event so we don't
        operate on bogus values (namely send_event).

        * gtk/gtkwidget.c (gtk_widget_idle_draw): only emit ::draw if width
        _and_ height are >0 (not _or_).

        * gtk/gtktable.c (gtk_table_remove): use gtk_widget_queue_resize()
        instead of gtk_container_queue_resize(), which is a core gtk internal
        function (must have been on crack when i queued that).

        * gtk/gtkprivate.h: added new private flag GTK_FULLDRAW_PENDING, so
        we can check more reliably if we want to discard expose events.
        * gtk/gtkwidget.c: added setting/unsetting of the GTK_FULLDRAW_PENDING
        flag.

        * gtk/gtkwidget.c (gtk_widget_event): don't discard synthesized exposes,
        we simply trust these events. for deciding whether to discard exposes,
        check GTK_FULLDRAW_PENDING instead of RESIZE_PENDING.
1999-09-14 17:43:56 +00:00
Owen Taylor
7347cd702f Ignore queues of areas that are completely off screen.
Mon Sep 13 15:01:21 1999  Owen Taylor  <otaylor@redhat.com>

	* gtk/gtkwidget.c (gtk_widget_queue_clear_area): Ignore
	queues of areas that are completely off screen.

	* gtk/gtkwidget.c (gtk_widget_idle_draw): Fix broken
	logic for handleboxes.

	* gtk/gtkwidget.c (gtk_widget_queue_draw_data): Add santity
	check on width/height.
1999-09-13 19:01:49 +00:00
Tim Janik
531f44bbdc backed out Raja's recent VPATH build "improvements", we are fine with
Mon Sep 13 02:22:47 1999  Tim Janik  <timj@gtk.org>

        * gtk/Makefile.am: backed out Raja's recent VPATH build "improvements",
        we are fine with using $@ the way we do (if we actually encounter
        brokeness with $@ in VPATH builds because of additional path prefixes,
        we need to use $(@F) actually).
1999-09-13 11:13:07 +00:00
Tim Janik
d807397177 renamed two variables, hopefully didn't introduce short lived bugs, that
Mon Sep 13 01:34:53 1999  Tim Janik  <timj@gtk.org>

        * gtk/gtksignal.c: renamed two variables, hopefully didn't introduce
        short lived bugs, that would allow language bindings to do surgeries
        to our guts.
1999-09-12 23:39:49 +00:00
Raja R Harinath
8014d7db5e Fix AC_DEFINEs.
* configure.in (wctype): Fix AC_DEFINEs.
1999-09-12 21:07:52 +00:00
Pablo Saratxaga
8cf06479ae updated danis hfile 1999-09-11 00:13:53 +00:00
Pablo Saratxaga
123914048c put Greek file from gtk+ HEAD cvs 1999-09-10 23:35:33 +00:00
Pablo Saratxaga
91645584a5 added Estonian language file 1999-09-10 19:45:35 +00:00
Owen Taylor
6362c20b8b Fix typo where comparison was being done against an uninitialized value
Fri Sep 10 15:22:50 1999  Owen Taylor  <otaylor@redhat.com>

	* gtk/gtkwindow.c (gtk_window_size_allocate): Fix typo
	where comparison was being done against an uninitialized
	value causing intermittant results depending on
	compiler flags. Also make it clearer that we aren't
	ever initializing the child as 0x0 (though this will
	be caught in gtk_widget_size_allocate())
1999-09-10 19:19:00 +00:00
Owen Taylor
a88d8fff6d Move gtk_window_unset_transient_for() call after we do checks involving
Fri Sep 10 10:06:56 1999  Owen Taylor  <otaylor@redhat.com>

	* gtk/gtkwindow.c (gtk_window_set_transient_for): Move
	gtk_window_unset_transient_for() call after we do checks
	involving the old transient parent.
	[ From Lance Capser <lmc@cyberhighway.net> ]
1999-09-10 14:00:45 +00:00
Tim Janik
61f9087af4 fixed "GNU Make" check to pass with new make version 3.77.95.
Wed Sep  8 07:13:29 1999  Tim Janik  <timj@gtk.org>

        * configure.in: fixed "GNU Make" check to pass with new make version
        3.77.95.
1999-09-08 07:03:00 +00:00
Raja R Harinath
2b2ee64b60 Go back to using `touch' to create an empty file.
* gtk/Makefile.am (gtk.defs): Go back to using `touch' to create
an empty file.
1999-09-07 18:45:04 +00:00
Pablo Saratxaga
4767c40249 updated da file 1999-09-06 09:42:10 +00:00
Lars Hamann
844cbfb1ba return FALSE if node has no children. (Reported by: Chris Rogers
Mon Sep  6 00:11:56 1999  Lars Hamann  <lars@gtk.org>

        * gtk/gtkctree.c (gtk_ctree_is_ancestor): return FALSE if node has
        no children. (Reported by: Chris Rogers <gandalf@pobox.com>)
1999-09-05 22:22:27 +00:00
Kjartan Maraas
04d23ae07e Updated translation.
1999-09-04  Kjartan Maraas  <kmaraas@fib.hl.no>

	* no.po: Updated translation.
1999-09-04 08:40:46 +00:00
Raja R Harinath
59724766af Improve VPATH builds. `$@' is valid only in the build dir, not after we've
* gtk/Makefile.am (gen_sources): Improve VPATH builds.
`$@' is valid only in the build dir, not after we've done
`cd $srcdir'.  Also use `test -f' instead of less portable
`test -e'.
1999-09-03 22:59:25 +00:00
CDT 1999 Shawn T. Amundson
2c331c9fdf Released GTK+ 1.2.5-pre1 (test release)
Fri Sep  3 17:20:57 CDT 1999 Shawn T. Amundson <amundson@gtk.org>

        * Released GTK+ 1.2.5-pre1  (test release)
1999-09-03 22:47:09 +00:00
Owen Taylor
df57d883b3 Overview of Changes in GTK+ 1.2.5:
* new configure.in option --disable-rebuilds to completely disable
  rebuilds of autogenerated sources.
* check for 5.002 now, to avoid failing autogeneration build rules due
  to old perl versions.
* fonts (and fontsets) are cached now.
* more autogeneration make rules and dependancy fixups, we should be
  save with autogeneration up to make -j12 now ;)
* new window position GTK_WIN_POS_CENTER_ALWAYS, which will recenter the
  GtkWindow on every size change.
* major rework of window manager hints handling code, fixed a bunch of
  races with the new resizing code.
* the new wm hints and resizing code is absolutely perfect and bug free now,
  it only lacks testing ;)
* fixed up various rc style memory prolems.
* gtk_widget_modify_style() now properly changes the style of realized widgets
  and references the style passed into it. if people worked around this bug,
  this will introduce a slight memory leak in their code.
  The code should typically look like:
            GtkRcStyle *rc_style = gtk_rc_style_new ();
            [...]
            gtk_widget_modify_style (widget, rc_style);
            gtk_rc_style_unref (rc_style);
* fix problems with positioning menus offscreen.
* GtkText fixes for some crashes and drawing errors.
* Better handling for unexpected window destroys in GDK and GTK+.
  This should make it possible to use a GtkPlug and catch the
  case where its parent socket is randomly killed.
* FAQ updates.
* FileSelection i18n patches, RadioButton fixups.
* miscellaneous other bugs fixed.
1999-09-03 21:01:15 +00:00
Owen Taylor
c9dec55549 Rewrite for simplicity, and hopefully correctness. (Fixes bug #1322, which
Fri Sep  3 15:59:56 1999  Owen Taylor  <otaylor@redhat.com>

	* gtk/gtktext.c (correct_cache_insert): Rewrite
	 for simplicity, and hopefully correctness.
	 (Fixes bug #1322, which was a segfault when
	  on some insertions with the properties around
	  the insertion set up just wrong.)

	* gtk/gtktext.c (gtk_text_adjustment): When we receive
	 a "changed" signal, clamp the new value to the adjustment
	 bounds to avoid segfaulting if someone tries to change
	 the adjustment to a bogus value. (Bug #1795)
1999-09-03 20:45:35 +00:00
Owen Taylor
22a15408bb When we receive an unexpected destroy notify on one of our windows, don't
Thu Sep  2 16:33:59 1999  Owen Taylor  <otaylor@redhat.com>

	* gdk/gdkwindow.c: When we receive an unexpected
	destroy notify on one of our windows, don't just
	warn about it, also mark our windows as destroyed.

	* gtk/gtkmain.c: Ignore unexpected destroy notifies
	for children, for toplevel windows handle them
	like delete_event.

	* gtk/gtkplug.c: Add an unrealize handler so that
	we unref plug->socket_window when we are done
	with it.
1999-09-03 20:08:13 +00:00
Owen Taylor
3abc634152 Fix stupid signedness problem that was causing background to sometimes be
Fri Sep  3 14:52:54 1999  Owen Taylor  <otaylor@redhat.com>

	* gtk/gtktext.c (clear_area): Fix stupid signedness
	 problem that was causing background to sometimes
	 be misaligned.
1999-09-03 18:54:03 +00:00
Owen Taylor
ad9263ec39 [ Fixes pointed out by Ettore Perazzoli <ettore@comm2000.it> ]
Fri Sep  3 12:26:33 1999  Owen Taylor  <otaylor@redhat.com>

	[ Fixes pointed out by Ettore Perazzoli <ettore@comm2000.it> ]

	* gtk/gtkmenu.c (gtk_menu_position): Make
	 sure we never position menus with negative x, y,
	 since gtk_widget_set_uposition() can't handle that.

	* gtk/gtkmenuitem.c (gtk_menu_item_position_menu):
	 Modify the positioning code a bit so that we always
	 put the top-left corner onscreen. (This is for
	 UI reasons, gtk_menu_position() now takes care of
	 gtk_widet_set_uposition() brokeness.)
1999-09-03 16:51:12 +00:00
Tim Janik
501c87a65d don't echo @GTK_VERSION@, but
Fri Sep  3 16:04:41 1999  Tim Janik  <timj@gtk.org>

        * gtk-config.in (--version): don't echo @GTK_VERSION@, but
        @GTK_MAJOR_VERSION@.@GTK_MINOR_VERSION@.@GTK_MICRO_VERSION@, so the
        AM_PATH_GTK() macros don't get confused by the -pre1.
1999-09-03 14:08:51 +00:00
Tim Janik
f9c868233f changed version number to 1.2.5-pre1, interface age 0, binary age 5. we
Fri Sep  3 03:06:30 1999  Tim Janik  <timj@gtk.org>

        * configure.in: changed version number to 1.2.5-pre1,
        interface age 0, binary age 5. we still require Glib-1.2.4 though.

        * gtk/Makefile.am: fixed up things for -jx, x > 1.

        * NEWS: updates for 1.2.5.
1999-09-03 04:38:55 +00:00
Owen Taylor
0285d26804 Ref the RC style that is passed in. The lack of the ref before was a bug.
Sun Sep  5 08:48:51 1999  Owen Taylor  <otaylor@redhat.com>

	* gtk/gtkwidget.c (gtk_widget_modify_style): Ref the
	  RC style that is passed in. The lack of the ref
	  before was a bug. If people worked around this
	  bug, this will introduce a slight memory leak
	  in their code. The code should typically look like:

	    rc_style = gtk_rc_style_new ();
	    [...]
	    gtk_widget_modify_style (widget, rc_style);
	    gtk_rc_style_unref (rc_style);

	* gtk/gtkwidget.c (gtk_widget_modify_style): Reset
	  the style if it was already set.

	* gtk/gtkwidget.c (gtk_widget_set_name): Only set the
	  style if it was set before.
1999-09-03 03:57:14 +00:00
Owen Taylor
189706f619 Add name => font and name => fontset hashes. The name => fontset hash is a
Sun Sep  5 08:10:53 1999  Owen Taylor  <otaylor@redhat.com>

	* gdk/gdkfont.c (gdk_font_hash_insert): Add
	  name => font and name => fontset hashes. The
	  name => fontset hash is a _big_ win since we
	  weren't previously caching fontsets at all and loading
	  fontsets is expensive. The name => font hash
	  is less of a win, but it does save us from doing
	  repeated XQueryFont calls on the same font.

	* gdk/gdkprivate.h (struct _GdkFontPrivate): Add a names
	  list so we can remove font/fontset from hash.
1999-09-03 03:56:34 +00:00
Chyla Zbigniew
b4def251f8 Updated polish translation 1999-09-03 02:55:23 +00:00
Owen Taylor
ddc6217c32 Remove useless and slightly confusing test. [ XInternAtom (,,TRUE) will
Thu Sep  2 19:02:37 1999  Owen Taylor  <otaylor@redhat.com>

	* gdk/gdkproperty.c (gdk_atom_intern): Remove useless
	  and slightly confusing test. [ XInternAtom (,,TRUE)
	  will never return None ].

	* gtk/testgtk.c (main): Add a check to see if we
	  are being run from the correct directory and
	  to quit nicely if we are not.

	* gtk/gtkrc.c (gtk_rc_slist_remove_all): Make function
	  static.

	* configure.in (REBUILD): Change check for perl5
	  to check explicitely for v >= 5.002. (5.001
	  does not work with our scripts.)
1999-09-02 23:02:14 +00:00
Tim Janik
80ed2661c5 uncomma 1999-09-02 22:31:38 +00:00
Tim Janik
088428655b added GTK_WIN_POS_CENTER_ALWAYS.
Thu Sep  2 23:00:03 1999  Tim Janik  <timj@gtk.org>

        * gtk/gtkenums.h (GtkWindowPosition): added GTK_WIN_POS_CENTER_ALWAYS.

        * gtk/gtkwindow.c:
        queue resizes unconditionally (gtk_widget_queue_resize will figure
        what to do if the window is not realized).
        (gtk_window_move_resize): only recenter the window
        for GTK_WIN_POS_CENTER_ALWAYS.
        (gtk_window_compute_reposition): handle GTK_WIN_POS_CENTER_ALWAYS in
        the same way as GTK_WIN_POS_CENTER.

Thu Sep  2 22:39:27 1999  Tim Janik  <timj@gtk.org>

        * gtk/gtkwindow.c (gtk_window_reposition): check for the last position
        with (!(info->last_flags & GDK_HINT_POS)) instead of
        (!info->last_flags & GDK_HINT_POS).

        * gtk/gtkwindow.c (gtk_window_move_resize): constrain new_width and
        new_height unconditionally, because we use these values even if
        !default_size_changed && !hints_changed.
        comented the (default_size_changed || hints_changed) case with
        respect to resize rejects from the window manager.

        * gtk/gtkwindow.c (gtk_window_move_resize): save info->last values
        in the zvt condition hack, since this includes the window hints, set
        the hints after the handling_resize case.

        * gtk/gtkwindow.c (gtk_window_show): constrain the default size that a
        window is initially shown with to the geometry.
1999-09-02 21:15:01 +00:00
Tim Janik
be326a5a7c s/size_changed/default_size_changed/g so i know what's really going on
Thu Sep  2 07:38:56 1999  Tim Janik  <timj@gtk.org>

        * gtk/gtkwindow.c (gtk_window_move_resize):
        s/size_changed/default_size_changed/g so i know what's
        really going on (frying brain on smaller flame now).
1999-09-02 05:41:57 +00:00
Tim Janik
108d82e785 queue a new resize if we have size_changed upon handling_resize. this is a
Thu Sep  2 05:47:47 1999  Tim Janik  <timj@gtk.org>

        * gtk/gtkwindow.c (gtk_window_move_resize): queue a new resize if
        we have size_changed upon handling_resize. this is a gross
        workaround for the broken zvt widget and should be removed in
        1.3 again (search for FIXME).
        Owen provided an accurate comment for this:

        /* We could be here for two reasons
         *  1) We coincidentally got a resize while handling
         *     another resize.
         *  2) Our computation of size_changed was completely
         *     screwed up, probably because one of our children
         *     is broken. It's probably a zvt widget.
         *
         * For 1), we could just go ahead and ask for the
         * new size right now, but doing that for 2)
         * might well be fighting the user (and can even
         * trigger a loop). Since we really don't want to
         * do that, we requeue a resize in hopes that
         * by the time it gets handled, the child has seen
         * the light and is willing to go along with the
         * new size. (this happens for the zvt widget, since
         * the size_allocate() above will have stored the
         * requisition corresponding to the new size in the
         * zvt widget)
         *
         * This doesn't buy us anything for 1), but it shouldn't
         * hurt us too badly, since it is what would have
         * happened if we had gotten the configure event before
         * the new size had been set.
         */
1999-09-02 04:01:11 +00:00
Owen Taylor
c431108d84 Don't omit setting the properties if flags == 0 - there may be an existing
Sat Sep  4 08:39:26 1999  Owen Taylor  <otaylor@redhat.com>

	* gdk/gdkwindow.c (gdk_window_set_geometry_hints)
	  gdk/gdkwindow.c (gdk_window_set_hints):

	Don't omit setting the properties if flags == 0 -
	there may be an existing set of properties there
	already. (Very old bug. Would it be better to
	delete the property instead?)

	* gdk/gdkselection.c (gdk_selection_property_get): Fix
	  spelling error in comment.
1999-09-02 03:41:41 +00:00
Owen Taylor
bd2194afb1 deal properly with the fact that RC style lists may include rc styles more
Wed Sep  1 20:46:11 1999  Owen Taylor  <otaylor@redhat.com>

	* gtk/gtkrc.c: deal properly with the fact that RC
	  style lists may include rc styles more than once.

	* gtk/gtkrc.c (gtk_rc_append_pixmap_path): Removed
	  unused static function.

	* gtk/gtkrc.c (gtk_rc_find_pixmap_in_path): Keep a
	  stack of directories of RC files currently being
	  parsed and implicitely add them to pixmap path.

	  This fixes a bug where the directory would get
	  appended then overwritten by pixmap_path declarations.

	  (bug #1462, from Peter Wainright <prw@wainpr.demon.co.uk>)

	* gtk/gtkthemes.c (gtk_theme_engine_unref): Call
	  theme's exit function. (Patch from Peter Wainwright,
	  bug #1454)

	* gtk/gtkradiomenuitem.c (gtk_radio_menu_item_destroy):
	  Add a destroy() handler to take care of removing
	  group for menu item. (Fixes bug #1197)

	* gtk/gtkwidget.c (gtk_widget_size_request): Fixed thinko
	  in warning message.
1999-09-02 00:43:37 +00:00
Tim Janik
39fb4797ae don't require a server roundtrip to figure window's width and height,
Wed Sep  1 21:27:42 1999  Tim Janik  <timj@gtk.org>

        * gtk/gtkwindow.c (gtk_window_move_resize): don't require a server
        roundtrip to figure window's width and height, since we know that
        anyways from widget->allocation.
1999-09-01 19:50:58 +00:00
Owen Taylor
10f1fff6ec Use gdk_error_trap_push() to avoid stomping over gdk_error_warnings.
Wed Sep  1 14:05:30 1999  Owen Taylor  <otaylor@redhat.com>

	* gdk/gdkimage.c (gdk_image_new): Use gdk_error_trap_push()
	  to avoid stomping over gdk_error_warnings.

	* gdk/gdkimage.c (gdk_image_new): compute image->bpp
	  as (bits_per_pixel + 7) / 8. This gives the same
	  result as before for multiples of 8, but actually
	  a "reasonable" value for 1bit or 4bit displays.
1999-09-01 17:59:50 +00:00
Owen Taylor
becd87fbd4 Compute the hints after we request the new size.
Wed Sep  1 12:37:44 1999  Owen Taylor  <otaylor@redhat.com>

	* gtk/gtkwindow.c (gtk_window_move_resize): Compute
	  the hints after we request the new size.
1999-09-01 16:32:30 +00:00
Owen Taylor
55c0a94c2c Removed GTK_WIDGET_REALIZED() assertion - we can compute the hints before
Wed Sep  1 10:38:37 1999  Owen Taylor  <otaylor@redhat.com>

	* gtk/gtkwindow.c (gtk_window_compute_hints): Removed
	  GTK_WIDGET_REALIZED() assertion - we can compute the
	  hints before we are realized.

	* gtk/gtkwindow.c (gtk_window_move_resize): Reorder
	  hint changing so that we have a value of hints_changed
	  when we decide whether to constrain the window size.

	* gtk/gtkwindow.c (gtk_window_move_resize): Spelling fix.

	* gtk/gtkwindow.c (gtk_window_constrain_size): cleanups,
	change back to G_MAXINT.
1999-09-01 14:51:02 +00:00
Pablo Saratxaga
c64f52a36c added da file 1999-09-01 12:31:59 +00:00
Tim Janik
b2a084beb4 zero initialize new GtkWindowGeometryInfo, so fields like GdkGeometry
Wed Sep  1 06:54:59 1999  Tim Janik  <timj@gtk.org>

        * gtk/gtkwindow.c (gtk_window_get_geometry_info): zero initialize
        new GtkWindowGeometryInfo, so fields like GdkGeometry geometry
        contain uncluttered values.
        (gtk_window_compute_hints): simply assert that window is realized
        and that geometry_info is valid, since we rely on this anyways.
        (gtk_window_constrain_size): major cleanups to the code.
        if (flags & GDK_HINT_BASE_SIZE) use geometry's base width and height
        for the base size, instead of the minimums. use 32767 as max width
        and height (like in gtkwindow.c) instead of G_MAXINT.
1999-09-01 05:48:55 +00:00
Tim Janik
57485d9029 cleaned up the GtkContainer.need_resize flag handling mess, we only need
Wed Sep  1 04:41:25 1999  Tim Janik  <timj@gtk.org>

        * cleaned up the GtkContainer.need_resize flag handling mess, we
        only need to force resize requests when we were prematurely
        realized, or our widget tree was modified when we were temporarily
        hidden. handling these cases directly upon showing the window (i.e.
        while the GdkWindow is still unmapped) avoids the need to wait for
        a configure event response and therefore makes the GUI more snappier
        and avoids blank windows during the roundtrip.

        * gtk/gtkwidget.c:
        (gtk_widget_hide):
        (gtk_widget_show): don't queue resizes on toplevels, they know how
        to deal with matters.

        * gtk/gtkcontainer.c (gtk_container_queue_resize): set the ->need_resize
        flag directly for not visible resize containers and spare us unecessary
        signal emissions.

        * gtk/gtkwindow.c:
        (gtk_window_realize): if we need to enforce premature size allocation,
        queue a container resize so we are correctly resized later on.
        (gtk_window_init):
        (gtk_window_size_request):
        don't freak around with the ->need_resize flag,
        gtk_container_queue_resize() will care about that.
        (gtk_window_show):
        handle initial resizing issues here, we can handle matters better in
        this place, especially since we know that our GdkWindow is still
        unmapped.
        (gtk_window_move_resize):
        don't care about ->need_resize at all.
        handle size changes properly that occoured while we waited for a
        configure event.
1999-09-01 02:58:05 +00:00
Owen Taylor
92671fe1f6 Move the hint setting code from gtk_widget_set_uposition to here; set the
Tue Aug 31 15:58:46 1999  Owen Taylor  <otaylor@redhat.com>

        * gtk/gtkwidget.c (gtk_widget_set_uposition):
        * gtk/gtkwindow.[hc] (gtk_window_reposition):
        Move the hint setting code from gtk_widget_set_uposition
        to here; set the hints so that we respect any previously
        set geometry hints.

        * gtk/gtkwindow.c (gtk_window_compute_reposition): Don't
        change the window hints here or move the window here,
        let that happen in gtk_window_move_resize().
1999-09-01 01:13:10 +00:00
Tim Janik
5e049110f3 when discarding exposes due to already queued resizes (and therefore
Tue Aug 31 06:58:52 1999  Tim Janik  <timj@gtk.org>

        * gtk/gtkwidget.c (gtk_widget_event): when discarding exposes due
        to already queued resizes (and therefore redraws) on a widget, check
        its anchestry as well.

        * gtk/gtkcontainer.c:
        (gtk_container_queue_resize): clear resize widgets for resize
        containers before aborting prematurely. this is especially important
        for toplevels which may need imemdiate processing or their resize
        handler to be queued.
        (gtk_container_dequeue_resize_handler): added new internal function for
        gtkwindow.c.

        * gtk/gtkwindow.c (gtk_window_move_resize): if we are resizing due to a
        configure event, take possible changes in window position into account
        as well.
        if we request a new window size, queue up a resize handler that will
        last until the configure event response arrives.
        combined the ->need_resize case (initial show) with the general size
        (hints) changed case and added even more comments.
        if !auto_shrink, only revert to the old allocation if the new size
        is smaller than the current allocation.

Tue Aug 31 11:55:20 1999  Owen Taylor  <otaylor@redhat.com>

        * gtk/gtkwindow.c (gtk_window_set_arg, gtk_window_set_policy,
                           gtk_window_set_geometry_hints
                           gtk_window_set_default_size):
        When hints are set, queue a resize so that the hints will
        be eventually reset on the toplevel.

        * gtk/gtkwindow.c (gtk_window_show): Use
        gtk_window_compute_default_size(). Clear the need_resize flag
        on the initail map so that we don't unnecessarily trigger the
        resize code.

        * gtk/gtkwindow.c (gtk_window_move_resize): Split apart
        into separate functions. Compare the hints we are setting
        with what we set last time so that we can accurately
        tell when we need to reset the hints.

        * gtk/gtkwindow.c (gtk_window_compute_default_size): New
        function to figure out the size from requisition
        and default_size.

        * gtk/gtkwindow.c (gtk_window_constrain_size): Function
        from fvwm to constrain a size to the geometry hints.

        * gtk/gtkwindow.c (gtk_window_compare_hints): New functio
        to compare two sets of geometry hints.

        * gtk/gtkwindow.c (gtk_window_compute_hints): Renamed
        from gtk_window_set_hints(), just compute the hints,
        don't set them.

        * gtk/gtkwindow.c (gtk_window_compute_reposition): Move
        code from gtk_window_move_resize() to separate function,
        rationalize a bit.
1999-09-01 00:48:57 +00:00
Owen Taylor
d008fbb84d Missed file from last gtkrc commit. 1999-08-31 21:12:40 +00:00
Owen Taylor
b7fa562427 Move the ref_count member out of the GtkRcStyle structure into a new
Tue Aug 31 13:05:03 1999  Owen Taylor  <otaylor@redhat.com>

	* gtkrc.h: Move the ref_count member out of the GtkRcStyle
	structure into a new private structure.

	* gtkrc.c: Split GtkRcStyle into public/private.
	In the private part, add a list of pointers to the
	RcStyle lists this RcStyle participates in.

	* gtkrc.c: When a RcStyle is free, remove all
	lists referencing it from the
	realized_style_ht hash, and free those lists.

	* gtk/gtkrc.c (gtk_rc_clear_styles): Don't call
	gtk_rc_init(), since that adds the default styles
	to the list of parsed RC files again.

	* gtk/gtkrc.c: Use gtk_rc_style_find() consistently.
1999-08-31 17:13:33 +00:00
Pablo Saratxaga
5bfd32fd64 a little patch to gtk/gtkfontsel.c to add the missing bit of i18n
support (displays font attributes translated)
1999-08-30 17:43:08 +00:00
Pablo Saratxaga
b977baed2b added eu and ga languages
merged with translations of gtk+ 1.3.0 when they were more up to date
1999-08-30 17:12:09 +00:00
BST 1999 Tony Gale
39024c05ae Minor FAQ Update
Sun Aug 29 13:38:59 BST 1999 Tony Gale <gale@gtk.org>

        * docs/gtkfaq.sgml: Minor FAQ Update
1999-08-29 12:30:32 +00:00
Tony Gale
8ec53bf61b Helps to commit the right version
Helps to commit the right version
1999-08-28 13:44:12 +00:00
BST 1999 Tony Gale
b6d42f7eb7 FAQ update
Sat Aug 28 14:34:37 BST 1999 Tony Gale <gale@gtk.org>

        * docs/gtkfaq.sgml: FAQ update
1999-08-28 13:27:40 +00:00
Raph Levien
7a73d7bd4d Comment fix (it was confusing for yosh). 1999-08-27 05:48:39 +00:00
Tim Janik
083941009f reactivated the sanity checks that ensure that a widget's allocation is at
Thu Aug 26 14:14:42 1999  Tim Janik  <timj@gtk.org>

        * gtk/gtkwidget.c (gtk_widget_size_allocate): reactivated the sanity
        checks that ensure that a widget's allocation is at least 1 in width
        and height. (GNOME note: this doesn't affect old panel code anymore,
        because GtkSocket will request width and height of at least 1 since
        Fri Jul 23).

        * gtk/gtkwindow.c (gtk_window_realize): if the widget hasn't been
        allocated yet (happens if the user realizes the window prematurely),
        size request and allocate it.
        (gtk_window_size_allocate): guard against guint underflows.
1999-08-26 12:44:07 +00:00
Lars Hamann
eb0859b277 reordered stamp-gtk.defs in gtk_built_sources, so gtk.defs gets built
Wed Aug 25 19:01:36 1999  Lars Hamann  <lars@gtk.org>

        * gtk/Makefile.am (gtk_built_sources): reordered stamp-gtk.defs
        in gtk_built_sources, so gtk.defs gets built prior to all other
        sources.
1999-08-25 17:08:03 +00:00
Tim Janik
bb2b76689c evaluate $PERL for the perl version check. added --disable-rebuilds to
Wed Aug 25 15:45:46 1999  Tim Janik  <timj@gtk.org>

        * configure.in: evaluate $PERL for the perl version check. added
        --disable-rebuilds to give the user an option to completely disable
        any source autogeneration rules.
1999-08-25 13:52:36 +00:00
CDT 1999 Shawn T. Amundson
65725a25ff Released GTK+ 1.2.4
Mon Aug 23 15:05:17 CDT 1999  Shawn T. Amundson <amundson@gtk.org>

        * Released GTK+ 1.2.4
1999-08-23 22:49:05 +00:00
Tim Janik
bd91541a01 evaluate $ac_make when checking for GNU Make.
Mon Aug 23 23:16:14 1999  Tim Janik  <timj@gtk.org>

        * configure.in: evaluate $ac_make when checking for GNU Make.
1999-08-23 21:20:22 +00:00
Tim Janik
2e6baef994 added some $(srcdir)/ prefixing 1999-08-23 20:39:17 +00:00
Tim Janik
6469f8473e small fix 1999-08-23 20:15:50 +00:00
Tim Janik
40d855bb0c invoke indent on gtkmarshal.*. rewrote source generation rules, use
Mon Aug 23 19:11:17 1999  Tim Janik  <timj@gtk.org>

        * gtk/Makefile.am:
        invoke indent on gtkmarshal.*.
        rewrote source generation rules, use COPYING as oldest source tag for
        a piggyback rule to generate all sources from (don't touch it ;).
        major cleanups, strip spaces on build rules for GNU Make.

        * gtk/genmarshal.pl: don't operate on hardcoded filenames but take
        source and target files from commandline arguments. don't invoke indent.

        * gdk/Makefile.am: minor cleanups, strip spaces on build rules for
        GNU Make.

        * docs/Makefile.am: added generation.txt.

        * Makefile.am: require automake 1.4, build README from README.in and
        INSTALL from INSTALL.in in dist-hook.

        * README.in:
        * INSTALL.in: new files to autogenerate README and INSTALL from.

        * gtk/COPYING:
        * gdk/COPYING: new files containing the GNU LESSER GENERAL PUBLIC
        LICENSE.

        * configure.in: figure wether we have GNU Make, version update to
        Gtk+ 1.2.4, interface age 2, binary age 4.

        * NEWS: updates.

        * docs/generation.txt: minor additions/corrections.
1999-08-23 19:35:22 +00:00
Manish Singh
fb44e1b6df rambopoo commit
-Yosh
1999-08-23 19:21:25 +00:00
Lars Hamann
0ab658cd10 queue_resize notebook after switch to avoid drawing problems. (Bug#856
Sat Aug 21 14:07:36 1999  Lars Hamann  <lars@gtk.org>

	* gtk/gtknotebook.c (gtk_notebook_real_switch_page): queue_resize
	notebook after switch to avoid drawing problems.
	(Bug#856 Reported by: Theodore Roth <troth@netmagic.net>)

	(gtk_notebook_pages_allocate): don't map not visible tab_labels,
	show them instead.
	(Bug#1805 Reported by: Dave Cole <dave@dccs.com.au>)
1999-08-22 12:53:04 +00:00
Tim Janik
f5891aa3bf we use window->need_resize from configure_event now, to indicate that the
Wed Aug 18 09:20:10 1999  Tim Janik  <timj@gtk.org>

        * gtk/gtkwindow.c:
        we use window->need_resize from configure_event now, to indicate that
        the gtkwindow should keep its allocation (e.g. because the user resized
        the window through window manager handles). resize_count is now reliably
        used to figure whether we got the allocation we requested from the
        window manager.
        configure events get queued as resizes now, the real stuff (size
        computation and allocation) now only goes on in gtk_window_move_resize().
        GtkWindow's requisition now contains its *real* requisition (like all
        other widgets), *not* taking usize into account.
        geometry_info->last_{width|height} is now updated from set_hints() only
        so it always contains the last hints we set for the window manager.
        made some event handlers return TRUE instead of FALSE.
        the overall code should be much more straight forward now, and the
        significant code portions are accompanied by comments now.
        (gtk_window_set_hints):
        removed requisition argument and made it
        fetch the requisition through gtk_widget_get_child_requisition.
        we also don't move the gdkwindow here anymore, gtk_window_move_resize()
        does that now.
        (gtk_window_show):
        ensure that the widget is realized before calling
        gtk_container_check_resize() (and thus gtk_window_move_resize()), also
        ensure that we got properly size requested and allocated before
        realization.
        (gtk_window_configure_event):
        ignore plain window moves, or reallocate the widget tree through the
        resize queue otherwise.
        (gtk_window_move_resize):
        mostly rewrote this function to figure window manager hints more
        reliably, coalesce window moves and resizes to reduce configure events
        and do actuall size allocations.

Tue Aug 17 07:43:04 1999  Tim Janik  <timj@gtk.org>

        * gtk/gtkwidget.c (gtk_widget_event): discard expose events for widgets
        that have a resize pending, because a redraw is already queued for them.

        * gdk/gdkevents.c (gdk_event_translate): give a debugging note when
        discarding configure events.

        * gtk/gtkcontainer.c: removed ugly connect_to ::size_allocate signal
        hack to clear resize_widgets.

        * gtk/gtkwidget.c (gtk_widget_size_allocate): call clear_resize_widgets
        for resize containers prior to size allocation. (this is also a bit
        ugly, but avoids side effects for stopped emissions and is thus more
        reliable).
        (gtk_widget_unparent): removed disconnect call for clear_resize_widgets.

        * gtk/gtktooltips.c (gtk_tooltips_paint_window): renamed this
        function from gtk_tooltips_expose, as we connect to ::expose_event
        *and* ::draw now.

Tue Aug 17 07:43:04 1999  Tim Janik  <timj@gtk.org>

        * gtk/gtkwidget.c (gtk_widget_event): discard expose events for widgets
        that have a resize pending, because a redraw is already queued for them.

        * gdk/gdkevents.c (gdk_event_translate): give a debugging note when
        discarding configure events.

        * gtk/gtkcontainer.c: removed ugly connect_to ::size_allocate signal
        hack to clear resize_widgets.

        * gtk/gtkwidget.c (gtk_widget_size_allocate): call clear_resize_widgets
        for resize containers prior to size allocation. (this is also a bit
        ugly, but avoids side effects for stopped emissions and is thus more
        reliable).
        (gtk_widget_unparent): removed disconnect call for clear_resize_widgets.

        * gtk/gtktooltips.c (gtk_tooltips_paint_window): renamed this
        function from gtk_tooltips_expose, as we connect to ::expose_event
        *and* ::draw now.
1999-08-20 02:18:22 +00:00
Federico Mena Quintero
5568346aa2 Added missing sanity checks. (gtk_target_list_unref): Likewise.
1999-08-18  Federico Mena Quintero  <federico@redhat.com>

	* gtk/gtkselection.c (gtk_target_list_ref): Added missing sanity
	checks.
	(gtk_target_list_unref): Likewise.

	* gdk/gdkpixmap.c (gdk_pixmap_unref): g_return_if_fail() the
	refcount is greater than zero.

	* gdk/gdkwindow.c (gdk_window_unref): Likewise.

	* gdk/gdkfont.c (gdk_font_unref): Likewise.

	* gdk/gdkgc.c (gdk_gc_unref): Likewise.

	* gdk/gdkdnd.c (gdk_drag_context_unref): Likewise.

	* gtk/gtkthemes.c (gtk_theme_engine_unref): Likewise.
1999-08-18 20:21:07 +00:00
Owen Taylor
0f8e13ca60 guard against division by zero. (Fixes bug #1339)
Tue Aug 17 15:47:07 1999  Owen Taylor  <otaylor@redhat.com>

	* gtk/gtkcolorsel.c (gtk_color_selection_draw_value_bar):
	guard against division by zero. (Fixes bug #1339)
1999-08-17 19:49:06 +00:00
Owen Taylor
8830e211f8 Prevent the trivial leak of information of allowing word motion when the
Tue Aug 17 10:56:49 1999  Owen Taylor  <otaylor@redhat.com>

	* gtk/gtkentry.c (gtk_move_{forward,backward}_word):
	Prevent the trivial leak of information of allowing
	word motion when the entry is not visible.
1999-08-17 14:58:50 +00:00
Owen Taylor
a6c5f95bac Propagate modality to error dialog as well as confirmation dialogs. (Bug
Tue Aug 17 10:28:52 1999  Owen Taylor  <otaylor@redhat.com>

	* gtk/gtkfilesel.c (gtk_file_selection_fileop_error): Propagate
	modality to error dialog as well as confirmation dialogs.
	(Bug #1803, reported by Rosanna Wing Sze Yuen)
1999-08-17 14:34:33 +00:00
BST 1999 Tony Gale
bae298ea0e FAQ Update
Wed Aug 11 13:38:26 BST 1999 Tony Gale  <gale@gtk.org>
        * docs/gtkfaq.sgml: FAQ Update
1999-08-11 12:39:49 +00:00
Owen Taylor
4139d6fc64 Honor tree->view_lines. (gtk-guy-990611-3.patch: Guy Harris
Wed Aug 11 01:04:57 1999  Owen Taylor  <otaylor@redhat.com>

	* gtk/gtktreeitem.c (gtk_tree_item_draw_lines): Honor
	tree->view_lines.
	(gtk-guy-990611-3.patch: Guy Harris <guy@netapp.com>)

	* gtk/Makefile.am (install-data-local): Solaris apparently
	has various troubles with ln -f; use rm first instead.
	(gtk-guy-990611-2.patch: Guy Harris <guy@netapp.com>)

	* gdk/gdkproperty.c (gdk_property_get): Fix assumption
	that format 32 => sizeof(item) == 4. It really is
	sizeof(long).
1999-08-08 20:31:45 +00:00
Raja R Harinath
54b231b034 Don't mv' from builddir to srcdir, use cp' followed by rm' (the rm'
* gtk/Makefile.am (stamp-m): Don't `mv' from builddir to srcdir,
use `cp' followed by `rm' (the `rm' was already there).
1999-07-30 17:12:48 +00:00
Elliot Lee
0c39d9a4f3 . configure.in: Fix autoconf warnings about cross compilation by trying to
. configure.in: Fix autoconf warnings about cross compilation by trying to
  provide sane defaults for AC_TRY_RUN.
. docs/Makefile.am: Tell distcheck how to generate the .gif files.
. gtk/Makefile.am: If we refer to gtkmarshal.[ch] in $(srcdir), put them into
  $(srcdir) when generated. Also add a dependency of gtksignal.h on gtkmarshal.h
  for -j builds.
. gtk/gtk(dnd,style,gamma).c: Minor warning fixes.
1999-07-30 16:14:09 +00:00
Elliot Lee
263a095543 Allow defining a CUSTOM_RELEASE at RPM build time 1999-07-29 20:09:24 +00:00
Owen Taylor
fe3173bd1a Added missing GDK_THREADS_{LEAVE,ENTER} pair. (From Paul Fisher
Wed Jul 28 09:29:19 1999  Owen Taylor  <otaylor@redhat.com>

	* gtk/gtkmain.c (gtk_main_iteration_do): Added missing
	GDK_THREADS_{LEAVE,ENTER} pair.
	(From Paul Fisher <pnfisher@redhat.com>)
1999-07-28 13:26:40 +00:00
Tim Janik
6eb649146c asure that the requested width and height are always >0 (owen).
Fri Jul 23 01:00:15 1999  Tim Janik  <timj@gtk.org>

        * gtk/gtksocket.c (gtk_socket_size_request): asure that the requested
        width and height are always >0 (owen).
1999-07-23 00:36:33 +00:00
Tim Janik
b7b01fa9d3 typo 1999-07-22 22:15:46 +00:00
Tim Janik
4f490f626a backed out my recent change that assured that a widget's allocated with
Fri Jul 23 00:00:47 1999  Tim Janik  <timj@gtk.org>

        * gtk/gtkwidget.c (gtk_widget_size_allocate): backed out my recent
        change that assured that a widget's allocated with and height are
        always >1, since this breaks *buggy* panel code. unfortunately this
        back-breaks the gimp's color selector.

        * gtk/gtkdrawingarea.c (gtk_drawing_area_size_allocate): asure that our
        allocation is always >0 in width and height, before sending the
        configure event; this is a *gross* hack to get the gimp back to work.

        * maked both cases with TODO-1.3
1999-07-22 22:11:47 +00:00
Owen Taylor
66a7a593e2 Don't display wrap indicators when text is not editable and word wrap is
Wed Jul 21 15:47:39 1999  Owen Taylor  <otaylor@redhat.com>

	* gtk/gtktext.c: Don't display wrap indicators when
	text is not editable and word wrap is on.
1999-07-21 19:45:55 +00:00
Yukihiro Nakai
bd7c5b22be ja.po: Japanese translation update from Shirasaki Yasuhiro.
ja.po: Japanese translation update from Shirasaki Yasuhiro.
1999-07-21 08:52:49 +00:00
Tim Janik
32e24f9f32 special case option menus here as they are not derived from menu shell,
Wed Jul 21 08:21:40 1999  Tim Janik  <timj@gtk.org>

        * gtk/gtkitemfactory.c (gtk_item_factory_create_item): special case
        option menus here as they are not derived from menu shell, assure that
        the option menu has a menu we can add items to.
1999-07-21 06:27:12 +00:00
Tim Janik
f50fed4098 convert allocation-> width/height to (gint) before calculations and check
Tue Jul 20 23:29:48 1999  Tim Janik  <timj@gtk.org>

        * gtk/gtknotebook.c (gtk_notebook_page_allocate): convert allocation->
        width/height to (gint) before calculations and check against < 0 to
        avoid guint wraparounds.
1999-07-20 21:59:11 +00:00
Tim Janik
13aa12ea14 ensure that the allocated width and height is never zero. sanity check
Sun Jul 18 00:35:49 1999  Tim Janik  <timj@gtk.org>

        * gtk/gtkwidget.c (gtk_widget_size_allocate): ensure that the allocated
        width and height is never zero. sanity check both dimensions against
        32767 and issue a warning if the allocation is greater than that.
1999-07-17 22:42:49 +00:00
Manish Singh
ca599d6060 libtool 1.3.3
-Yosh
1999-07-17 05:21:02 +00:00
Yukihiro Nakai
029baff26a ja.po: "Rename file" translation fixed.
ja.po: "Rename file"  translation fixed.
1999-07-13 05:02:51 +00:00
Tomas Ogren
79e872c851 Updated
1999-07-11  Tomas Ogren  <stric@ing.umu.se>

* sv.po: Updated
1999-07-10 22:28:42 +00:00
Owen Taylor
fa80ff6c59 Indicate that the --with-glib= configure time flag is unsupported.
Thu Jul  8 11:30:18 1999  Owen Taylor  <otaylor@redhat.com>

	* INSTALL: Indicate that the --with-glib= configure
	time flag is unsupported.

	* configure.in: Some small fixups for libgno
1999-07-08 15:33:41 +00:00
Stuart Parmenter
58102a49f0 s/,/./ 1999-07-07 22:20:33 +00:00
Owen Taylor
d38f1248d1 Unlock around call to g_main_pending() as well.
Wed Jul  7 15:03:30 1999  Owen Taylor  <otaylor@redhat.com>

	* gtk/gtkmain.c (gtk_events_pending): Unlock around call
	to g_main_pending() as well.
1999-07-07 19:04:09 +00:00
Owen Taylor
8e401114ef Unlock around call to g_main_iteration() - since that will regrab GTK+
Wed Jul  7 14:59:01 1999  Owen Taylor  <otaylor@redhat.com>

	* gtk/gtkmain.c (gtk_main_iteration): Unlock around
	call to g_main_iteration() - since that will regrab
	GTK+ lock to process events.
1999-07-07 18:55:46 +00:00
Owen Taylor
46144b1be4 Added a file that gives documenation about the autogeneration process for
Mon Jul  5 20:36:03 1999  Owen Taylor  <otaylor@redhat.com>

	* docs/generation.txt: Added a file that gives
	documenation about the autogeneration process for
	various autogenerated files.
1999-07-06 00:36:56 +00:00
Owen Taylor
af5243ab71 - Code cleanups - Instantaneously update on modifier key presses - Allow
Wed Jun 30 19:26:36 1999  Owen Taylor  <otaylor@redhat.com>

	* gtk/gtkdnd.c:
	- Code cleanups
	- Instantaneously update on modifier key presses
	- Allow cancellation of the drag with Escape.
1999-06-30 23:35:55 +00:00
Owen Taylor
37ad5eb7c0 Don't core dump at all on X IO errors, only core dump if --enable-debug
Tue Jun 29 23:02:42 1999  Owen Taylor  <otaylor@redhat.com>

	* gdk/gdk.c (gdk_x_error / gdk_x_io_error): Don't
	core dump at all on X IO errors, only core dump
	if --enable-debug for X errors.

Tue Jun 29 17:04:09 1999  Owen Taylor  <otaylor@redhat.com>

	* gtk/testgtk.c (create_handle_box): Set the policy
	to auto_shrink - otherwise the appearance is rather
	strange when flipping between horizontal and vertical.
1999-06-30 21:52:35 +00:00
Owen Taylor
d97fede574 Look for libgmodule in the right location.
Tue Jun 29 15:59:25 1999  Owen Taylor  <otaylor@redhat.com>

	* configure.in (LIBS): Look for libgmodule in the
	right location.
1999-06-29 19:58:24 +00:00
Tim Janik
dc624c4dd8 add ::default_width and ::default_height arguments.
Mon Jun 28 09:29:52 1999  Tim Janik  <timj@gtk.org>

        * gtk/gtkwindow.c: add ::default_width and ::default_height arguments.
        (gtk_window_set_default_size): don't change a value if it's < 0.
        queue a resize.

Sun Jun 27 11:00:33 1999  Tim Janik  <timj@gtk.org>

        * gtk/gtktext.c (gtk_text_insert): don't segfault on NULL inserts.
1999-06-28 23:52:46 +00:00
Owen Taylor
43e80bc87a Don't add an extra "/" when concating "/" + filename. (From Matt Grossman
Mon Jun 28 12:08:25 1999  Owen Taylor  <otaylor@redhat.com>

	* gtk/gtkfilesel.c (cmpl_completion_fullname): Don't
	add an extra "/" when concating "/" + filename.
	(From Matt Grossman <mattg@oz.net>)
1999-06-28 16:08:28 +00:00
Owen Taylor
4c09ae6026 Reset clip mask for fg_gc if we set it for drawing pixmap.
Mon Jun 28 10:57:12 1999  Owen Taylor  <otaylor@redhat.com>

	* gtk/gtkctree.c (draw_cell_pixmap): Reset clip mask
	for fg_gc if we set it for drawing pixmap.
1999-06-28 15:50:44 +00:00
Tim Janik
86e47a1efa removed old ""Got event for unknown window:" message. disabled
Thu Jun 24 17:06:23 1999  Tim Janik  <timj@gtk.org>

        * gdk/gdkevents.c (gdk_event_translate): removed old ""Got event for
        unknown window:" message. disabled ConfigureNotify discarding code,
        because it led to events being processed out of order.

Thu Jun 24 12:22:02 1999  Tim Janik  <timj@gtk.org>

        * gdk/gdkglobals.c: preinitialize gdk_error_code to 0.

        * gdk/gdkevents.c (gdk_event_send_client_message_to_all_recurse): since
        we export this function, supress error warnings and don't reset the
        error code in the first half of this function.

        * gdk/gdk.c (gdk_x_error): set gdk_error_code to the actuall X error
        code (instead of just -1) so gdk_error_trap_pop() reveals something
        actually informative about the error that happened.

        * gdk/*.c:
        don't rely on gdk_error_code being -1 if an error occoured, but just
        gdk_error_code != 0.

Thu Jun 24 11:50:07 1999  Tim Janik  <timj@gtk.org>

        * gdk/gdkevents.c (gdk_event_apply_filters): advance the filter list
        pointer *before* invoking the filter function, so we at least don't
        crash if a filter is removed that is currently executed. window filters
        *really* need to be made truely reentrant at some point.

Wed Jun 16 20:28:34 1999  Tim Janik  <timj@gtk.org>

        * gdk/gdkevents.c (gdk_event_translate): don't segfault for
        window==NULL in ConfigureNotify.

Mon Jun 14 11:10:15 1999  Tim Janik  <timj@gtk.org>

        * gdk/gdkevents.c (gdk_event_translate): print the atom name in the
        PropertyNotify debug messages.
1999-06-25 23:23:07 +00:00
Owen Taylor
b90f0c9ee7 Removed references to code examples in my directory on gtk.org as they
Thu Jun 17 13:57:31 1999  Owen Taylor  <otaylor@redhat.com>

	* docs/gtk_tut.sgml: Removed references to
	code examples in my directory on gtk.org as
	they should all be in the tutorial now.

	* docs/gtk_tut.sgml: Added sources for dial-test
	and scribble-xinput programs that were previously
	missing.
1999-06-17 18:01:14 +00:00
Elliot Lee
e0bc92268b Add maintainers list 1999-06-15 17:20:46 +00:00
Tim Janik
94ba2610fe queue a resize.
Thu Jun 10 17:59:38 1999  Tim Janik  <timj@gtk.org>

        * gtk/gtkdrawingarea.c (gtk_drawing_area_size): queue a resize.
1999-06-11 03:36:07 +00:00
Tim Janik
b39b03d27d small fix 1999-06-09 09:08:22 +00:00
Tim Janik
611e6e20e7 mark certain functions as internal.
Wed Jun  9 15:13:16 1999  Tim Janik  <timj@gtk.org>

        * gtk/gtkaccelgroup.h: mark certain functions as internal.

Wed Jun  9 13:48:28 1999  Tim Janik  <timj@gtk.org>

        * gtk/gtkpreview.c (gtk_preview_set_expand): queue a resize if the
        expand behaviour changed.

        * gtk/gtklabel.c (gtk_label_set_pattern):
        (gtk_label_set_justify):
        (gtk_label_set_line_wrap):
        don't bother invoking queue_clear, the reallocation does
        that for us, always free_words so the upcoming resize will
        relayout the label's contents.

Wed Jun  9 12:50:48 1999  Tim Janik  <timj@gtk.org>

        * applied argument implementation patches from Elena Devdariani
        <elena@cogent.ca>.

        * gtk/gtktoolbar.c: ::orientation, ::toolbar_style, ::space_size,
        ::space_style, ::relief
        * gtk/gtkruler.c: ::lower, ::upper, ::position, ::max_size
        * gtk/gtkpreview.c: ::expand
        * gtk/gtkpaned.c: ::handle_size, ::gutter_size
        * gtk/gtknotebook.c: ::homogeneous
        * gtk/gtklabel.c: ::wrap
        * gtk/gtklist.c: ::selection_mode
        * gtk/gtkhandlebox.c: ::handle_position, ::snap_edge
        * gtk/gtkcurve.c: ::curve_type, ::min_x, ::max_x, ::min_y, ::max_y
        * gtk/gtkcolorsel.c: ::policy, ::use_opacity
        * gtk/gtkcolorsel.c: ::update_policy, ::use_opacity
        * gtk/gtkclist.c: ::sort_type
        * gtk/gtkcheckmenuitem.c: ::active, ::show_toggle
        * gtk/gtkaspectframe.c: ::xalign, ::yalign, ::ratio, ::obey_child
1999-06-09 09:07:42 +00:00
Owen Taylor
852baf9bfe Added entry about menu keyboard navigation, removed some finished items.
Fri Jun  4 00:08:59 1999  Owen Taylor  <otaylor@redhat.com>

	* TODO: Added entry about menu keyboard navigation, removed
	some finished items.
1999-06-04 04:47:27 +00:00
Owen Taylor
2d19ab20f7 Removed ill-thought-out part of last comment.
Tue Jun  1 23:38:38 1999  Owen Taylor  <otaylor@redhat.com>

	* gtk/gtkstyle.c: Removed ill-thought-out part of last
	comment.
1999-06-02 03:35:54 +00:00
Owen Taylor
f9aee08d6e Get the reference counting right when we have to attach a new style for a
Tue Jun  1 23:30:09 1999  Owen Taylor  <otaylor@redhat.com>

	* gtk/gtkstyle.c (gtk_style_attach): Get the reference
	counting right when we have to attach a new style
	for a different visual. (Chi-Deok Hwang <cdhwang@sr.hei.co.kr>)

	* gtk/gtkstyle.c: Documented the refcounting
	peculularities of gtk_style_attach.
1999-06-02 03:29:39 +00:00
1
c084c71294 added return if fail for invalid window types.
1999-06-01    <timj@dhcpd7.redhat.com>

        * gtk/gtkwindow.c (gtk_window_new): added return if fail for invalid
        window types.

        * examples/packer/pack.c (main): use GTK_WINDOW_TOPLEVEL instead
        of GTK_TOPLEVEL for creating the window.
1999-06-01 17:26:26 +00:00
1
c288d2419e don't segfault when --gtk-module is the last argument (reported by Per
1999-06-01    <timj@dhcpd7.redhat.com>

        * gtk/gtkmain.c (gtk_init_check): don't segfault when --gtk-module is
        the last argument (reported by Per Winkvist).
1999-06-01 16:57:02 +00:00
Owen Taylor
8d32617d16 Standardize on func_dgettext not func_gettext, so that the checks for
Mon May 31 00:11:24 1999  Owen Taylor  <otaylor@redhat.com>

	* acinclude.m4: Standardize on func_dgettext
	not func_gettext, so that the checks for dgettext
	actually are paid attention to.
1999-06-01 12:42:56 +00:00
Manish Singh
651a662ba5 blah
-Yosh
1999-05-29 18:19:56 +00:00
Manish Singh
1c2bde024e libtool 1.3.2
add Changes-1.2.txt to EXTRA_DIST

-Yosh
1999-05-29 18:19:22 +00:00
Owen Taylor
3680b735d7 Updates from Stanislav Brabec <utx@k332.feld.cvut.cz>.
Tue May 25 14:11:09 1999  Owen Taylor  <otaylor@redhat.com>

	* cs.po: Updates from Stanislav Brabec <utx@k332.feld.cvut.cz>.
1999-05-25 18:09:26 +00:00
Owen Taylor
9d40a0cd27 Fixes for invisible XOR lines (Frank Loemker
Tue May 25 13:13:12 1999  Owen Taylor  <otaylor@redhat.com>

        Fixes for invisible XOR lines (Frank Loemker
	<floemker@TechFak.Uni-Bielefeld.DE>)

	* gtk/gtkclist.c (gtk_clist_realize): Always use
	a non-zero pixel for GDK_XOR.

	* gtk/gtkvpaned.c gtk/gtkhpaned.c:
	Use GDK_INVERT instead of GDK_XOR.
1999-05-25 17:25:07 +00:00
Lars Hamann
dc9569756e signal emit value_changed signals if h/voffsets differ from adjustment
Wed May 12 21:56:40 1999  Lars Hamann  <lars@gtk.org>

	* gtk/gtkclist.c (adjust_adjustments): signal emit value_changed
	signals if h/voffsets differ from adjustment values.
	Reportet by Jerome Bolliet <bolliet@in2p3.fr>
1999-05-12 20:29:31 +00:00
CDT 1999 Shawn T. Amundson
0ef2295c53 GTK+ is as easy as 1.2.3...
Mon May 10 22:20:06 CDT 1999 Shawn T. Amundson <amundson@gtk.org>

        * GTK+ is as easy as 1.2.3...
1999-05-11 04:50:54 +00:00
Tim Janik
519fed9991 propagate ::selection-done emissions up to the topmost menu shell.
Mon May 10 04:20:41 1999  Tim Janik  <timj@gtk.org>

        * gtk/gtkmenushell.c (gtk_menu_shell_activate_item): propagate
        ::selection-done emissions up to the topmost menu shell.
1999-05-11 02:19:37 +00:00
Owen Taylor
5e52b31fd7 Unset the user data on the window before destroying it.
Fri May  7 10:15:14 1999  Owen Taylor  <otaylor@redhat.com>

	* gtk/gtknotebook.c (gtk_notebook_set_scrollable): Unset
	the user data on the window before destroying it.

	* gtk/gtknotebook.c (gtk_notebook_unrealize): Add an
	unrealize handler to take care of destroying
	notebook->panel properly.
	(Bug #1198 - Morten Welinder <terra@diku.dk>)

	* gtk/gtktext.c (expand_scratch_buffer): Fix reversal
	of g_new and g_realloc to stop memory leak. (Actually,
	we could just use g_realloc(), but I'm not 100% sure
	that is portable).
	(Bug #1196 - Morten Welinder <terra@diku.dk>)
1999-05-07 14:29:04 +00:00
Owen Taylor
bbe8b7ba61 Removed stray GtkPlugButton declaration.
Wed Apr 21 00:42:08 1999  Owen Taylor  <otaylor@redhat.com>

	* gtk/gtkplug.h: Removed stray GtkPlugButton declaration.

	* gdk/gdkfont.c (gdk_text_measure): Fix the return value
        for fontsets.

	* gtk/gtkbutton.c (gtkbutton_expose): Fix warning
	with bin/button confusion.
1999-05-06 03:13:41 +00:00
Owen Taylor
f187c3bb24 Change G_MAXINT to 2^16 to alleviate overflow problems in various window
Wed May  5 22:24:21 1999  Owen Taylor  <otaylor@redhat.com>

	* gdk/gdkwindow.c (gdk_window_set_geometry_hints): Change
	G_MAXINT to 2^16 to alleviate overflow problems in
	various window managers.
1999-05-06 03:12:08 +00:00
Owen Taylor
6227a115be Patch from Sung-Hyun Nam <namsh@lgic.co.kr>
Wed May  5 22:51:06 1999  Owen Taylor  <otaylor@redhat.com>

        Patch from Sung-Hyun Nam <namsh@lgic.co.kr>

	* gdk/gdkim.c: Fix cut-and-paste errors for
	x/y and PreeditAttributes/StatusAttributes.
1999-05-06 03:11:38 +00:00
Tim Janik
2f80acc28e in the ItemFactory test, link radio items together, and show how
Thu May  6 04:53:26 1999  Tim Janik  <timj@gtk.org>

        * gtk/testgtk.c: in the ItemFactory test, link radio items together,
        and show how preselection of radio items is done.

Sun May  2 13:31:14 1999  Tim Janik  <timj@gtk.org>

        * gtk/gtktreeitem.c (gtk_tree_item_set_subtree):
        * gtk/gtktree.c (gtk_tree_add) (gtk_tree_insert):
        * gtk/gtktoolbar.c (gtk_toolbar_insert_element):
        * gtk/gtkpaned.c (gtk_paned_pack2) (gtk_paned_pack1):
        * gtk/gtkscrolledwindow.c (gtk_scrolled_window_add):
        * gtk/gtktable.c (gtk_table_attach):
        * gtk/gtklist.c (gtk_list_insert_items):
        * gtk/gtkmenushell.c (gtk_menu_shell_insert):
        * gtk/gtknotebook.c (gtk_notebook_insert_page_menu):
        * gtk/gtkpacker.c (gtk_packer_add_defaults) (gtk_packer_add):
        * gtk/gtkbin.c (gtk_bin_add):
        * gtk/gtkbox.c (gtk_box_pack_start) (gtk_box_pack_end):
        * gtk/gtkfixed.c (gtk_fixed_put):
        * gtk/gtklayout.c (gtk_layout_put):
        general fixups to container_add logic. always realize child if
        child->parent is realized, only map the child and queue a resize
        if child and child->parent are both visible.

Fri Apr 30 09:02:28 1999  Tim Janik  <timj@gtk.org>

        * gtk/gtkwidget.c (gtk_widget_real_unrealize): use gtk_container_forall
        instead of gtk_container_foreach to walk and unrealize children, so
        composite children get also unrealized.
        (gtk_widget_real_show): don't call gtk_widget_map() if we don't need to.
        (gtk_widget_map): assert that the widget is visible (basic constrain).
        (gtk_widget_real_map): assert that the widget is realized (basic
        constrain).

Fri Apr 29 00:53:20 1999  Tim Janik  <timj@gtk.org>

        * gtk/gtkbindings.c (gtk_pattern_spec_init): plugged a memory leak.
1999-05-06 02:59:18 +00:00
Owen Taylor
30d6a30b01 Initialize size_hints.x and size_hints.y because kwm brokenly pays
Wed May  5 12:42:01 1999  Owen Taylor  <otaylor@redhat.com>

	* gdk/gdkwindow.c (gdk_window_set_geometry_hints):
	Initialize size_hints.x and size_hints.y because kwm
	brokenly pays attention to them.
	(Bug #1181 -  Lars Heete <hel@admin.de>)
1999-05-05 16:46:28 +00:00
Owen Taylor
7f9cb3548b Free the return value of gdk_list_visuals(). (Bug #1193 - Morten Welinder
Wed May  5 11:38:56 1999  Owen Taylor  <otaylor@redhat.com>

	* gdk/gdkrgb.c (gdk_rgb_choose_visual): Free the
	return value of gdk_list_visuals().
	(Bug #1193 - Morten Welinder <terra@diku.dk>)
1999-05-05 15:38:48 +00:00
Owen Taylor
17c8d9cd74 Add $INTLLIBS into $LIBS directly, rather than repeating the checks for
Wed May  5 10:47:54 1999  Owen Taylor  <otaylor@redhat.com>

	* configure.in (LIBS): Add $INTLLIBS into $LIBS
	directly, rather than repeating the checks for
	gettext.

	* INSTALL: Added information about gettext and
	NLS support.

	* acinclude.m4 (LIBM): Check for dgettext, not
	just gettext. This should hopefully fix things wrt
	systems with old versions of GNU gettext installed.
1999-05-05 15:11:36 +00:00
Manish Singh
197950e184 cast the return value of XSetIMValues to (void *) when comparing to NULL,
* gdk/gdkim.c (gdk_im_real_open): cast the return value of
XSetIMValues to (void *) when comparing to NULL, to workaround
the problem of some compilers barfing since older X headers don't
have the prototype for it.

-Yosh
1999-05-04 18:18:06 +00:00
Owen Taylor
bbf7b3a60f Use width,height = 0, 0 to mean - here to edge of window, instead of -1,
Tue May  4 08:44:08 1999  Owen Taylor  <otaylor@redhat.com>

	* gtk/gtkclist.c (gtk_clist_draw, draw_rows): Use
	width,height = 0, 0 to mean - here to edge of window,
	instead of -1, -1, since the former is all we support.

Tue May  4 08:34:43 1999  Owen Taylor  <otaylor@redhat.com>

	* gtk/gtkmain.c (gtk_main): Correctly free list nodes
	when removing from quit_functions list.

Mon Apr 19 10:11:12 1999  Owen Taylor  <otaylor@redhat.com>

	* gdk/gdkcolor.c (gdk_colormap_new): Fix memory leak
	for pseudocolor where colormap->colors was double
	allocated.

	* gdk/gdkcolor.c (gdk_colormap_alloc1): Store the
	color value in the hash table with the pixel filled
	in so when we do later hash table lookups, the color
	value is correct.
1999-05-04 15:00:07 +00:00
Owen Taylor
498b5eca13 Add a gtkrc file for iso-8859-2 locales.
Tue May  4 09:32:08 1999  Owen Taylor  <otaylor@redhat.com>

	* gtk/Makefile.am gtk/gtkrc.iso-8859-2: Add a gtkrc
	file for iso-8859-2 locales.

	* configure.in (ALL_LINGUAS): ALL_LINGUAS update.

Tue Apr 27 16:38:32 1999  Owen Taylor  <otaylor@redhat.com>

	* gtk/Makefile.am: Fix typo of static_sources for static_SOURCES.
	 (Pointed out by andy@rz.uni-karlsruhe.de and others).
	 Remove some suspicious and useless lines.
1999-05-04 13:53:19 +00:00
Owen Taylor
658f736af1 Backmerge from HEAD sk.po sl.po zh_TW.Big5.po: New additions
Tue May  4 09:09:52 1999  Owen Taylor  <otaylor@redhat.com>

	* fi.wa wa.po ca.po: Backmerge from HEAD
	  sk.po sl.po zh_TW.Big5.po: New additions

	* pl.po: Backported updates from HEAD
1999-05-04 13:52:23 +00:00
Manish Singh
edf4aa4bcd check private->destroyed before making the call
* gdk/gdkdraw.c (gdk_draw_lines): check private->destroyed before
making the call

-Yosh
1999-05-02 22:34:49 +00:00
Manish Singh
3046ab9f0f libtool 1.3 upgrade
-Yosh
1999-05-01 18:06:06 +00:00
Tim Janik
a654f96831 remove unused variable.
Tue Apr 27 14:17:16 1999  Tim Janik  <timj@gtk.org>

        * gtk/gtkpacker.c (gtk_packer_size_request): remove unused variable.
1999-04-29 00:21:01 +00:00
Owen Taylor
ff01cccfb9 Fix leak pointed out by Morten Welinder <terra@diku.dk>.
Tue Apr 27 11:17:35 1999  Owen Taylor  <otaylor@redhat.com>

	* gdk/gdkdnd.c (xdnd_set_{targets,actions}): Fix leak
	pointed out by Morten Welinder <terra@diku.dk>.
1999-04-27 22:34:00 +00:00
Owen Taylor
0c177d15d1 When redrawing characters on non-visible entry, use appropriate '*'
Tue Apr 27 18:23:35 1999  Owen Taylor  <otaylor@redhat.com>

	* gtk/gtkentry.c (gtk_entry_draw_cursor_on_drawable):
	 When redrawing characters on non-visible entry, use appropriate
	 '*' character. (Bug #1130 - Jean-Marc Jacquet <jm@littleigloo.org>)
1999-04-27 22:33:02 +00:00
Lars Hamann
be0f11a4d2 compute destination cell from drag coordinates.
Tue Apr 27 01:31:40 1999  Lars Hamann  <lars@gtk.org>

        * gtk/gtkclist.c (drag_dest_cell): compute destination cell
        from drag coordinates.
        (gtk_clist_drag_data_received) (gtk_clist_drag_motion):
        use drag_dest_cell.

        * gtk/gtktree (drag_dest_cell)
        (gtk_ctree_drag_data_received) (gtk_ctree_drag_motion): likewise.
        (Bug #1129)
1999-04-26 23:57:45 +00:00
Changwoo Ryu
ed0db4cd4f Updated.
1999-04-24  Changwoo Ryu  <cwryu@adam.kaist.ac.kr>

	* ko.po: Updated.
1999-04-24 14:42:49 +00:00
Tim Janik
1cc01ceb59 fix (and foxy ;) 1999-04-22 16:05:14 +00:00
Tim Janik
caf95cd161 properly initialize translate_* fields. (gtk_item_factory_finalize):
Wed Apr 21 21:26:11 1999  Tim Janik  <timj@gtk.org>

        * gtk/gtkitemfactory.c (gtk_item_factory_init): properly initialize
        translate_* fields.
        (gtk_item_factory_finalize): invoke translate_notify independant from
        translate_data.
        (gtk_item_factory_set_translate_func): likewise.
        (gtk_item_factory_destroy): only ifactory pointer from those widgets
        that belong to us (stupid me).
1999-04-21 22:25:48 +00:00
George Lebl
83c4021614 correctly remove the default filter from the list
Wed Apr 21 14:20:22 1999  George Lebl  <jirka@5z.com>

        * gdk/gdkwindow.c: (gdk_window_remove_filter) correctly remove the
          default filter from the list
1999-04-21 21:26:46 +00:00
Owen Taylor
fdb8efb35a Fixed leak of rc_style list when lookup succeeeds.
Mon Apr 19 12:05:31 1999  Owen Taylor  <otaylor@redhat.com>

	* gtk/gtkrc.c (gtk_rc_style_init): Fixed leak of
	rc_style list when lookup succeeeds.
1999-04-21 17:12:43 +00:00
Drazen Kacar
9ad66ac6e8 Merged Croatian locale from HEAD. 1999-04-19 01:16:07 +00:00
Tomas Ogren
3834ea83c0 Add a / before the directory name to keep directory names from eachother.
1999-04-18  Tomas Ogren  <stric@ing.umu.se>

        * gtk/gtkrc.c: Add a / before the directory name to keep directory
        names from eachother. (Already fixed in 1.3.x)
1999-04-18 18:21:19 +00:00
Manish Singh
e3b8c8ba92 #include "gdkkeysyms.h" for gdk_XConvertCase #defines
* gdk/gdk.c: #include "gdkkeysyms.h" for gdk_XConvertCase #defines

* gtk/gtkfontsel.c (gtk_font_selection_create_xlfd): use
g_strdup_printf instead of calcing the length separately

-Yosh
1999-04-17 03:49:50 +00:00
Lars Hamann
e6828ec4e4 fixed undo_selection bug. fixed resync_selection bug.
Thu Apr 15 01:11:24 1999  Lars Hamann  <lars@gtk.org>

	* gtk/gtkctree.c (resync_selection):
	* gtk/gtkclist.c (resync_selection): fixed undo_selection bug.
	* gtk/gtkclist.c (gtk_clist_button_release): fixed resync_selection
 	bug.
1999-04-14 23:33:07 +00:00
CDT 1999 Shawn T. Amundson
7ee4ba7781 Released GTK+ 1.2.2
Tue Apr 13 17:14:28 CDT 1999 Shawn T. Amundson <amundson@gtk.org>

        * Released GTK+ 1.2.2
1999-04-13 23:09:16 +00:00
Owen Taylor
3a03678080 removed some silly #ifdef HAVE_CONFIG that we don't do in many other
Tue Apr 13 02:49:33 1999  Owen Taylor  <otaylor@redhat.com>

	* gdk/gdkwindow.c: removed some silly #ifdef HAVE_CONFIG
	that we don't do in many other places. (Fixing duplicate
	#include of config.h)

	* gdk/gdkevents.c: include gdkinput.h _after_ config.h.
	Otherwise, #ifndef XINPUT_NONE check in the latter
	doesn't work. (Bug #546)
1999-04-13 06:55:55 +00:00
Tim Janik
badd841246 bumped version number to Gtk+ 1.2.2, interface 0, binary 2.
Sun Apr 11 15:08:27 1999  Tim Janik  <timj@gtk.org>

        * configure.in: bumped version number to Gtk+ 1.2.2, interface 0,
        binary 2.

        * NEWS: updates.

Sun Apr 11 14:38:03 1999  Tim Janik  <timj@gtk.org>

        * gdk/gdkpixmap.c (_gdk_pixmap_create_from_xpm): check for color
        "None" case insensitive.
1999-04-11 15:01:30 +00:00
Owen Taylor
ffafb164d9 Add some missing GDK_THREADS_ENTER()/LEAVE around timeouts. (Patches from
Fri Apr  9 19:22:19 1999  Owen Taylor  <otaylor@redhat.com>

	* gtk/gtkcolorsel.c gtk/gtkdnd.c gtk/gtkmenuitem.c:
        Add some missing GDK_THREADS_ENTER()/LEAVE around
        timeouts. (Patches from Sebastian Wilhelmi <wilhelmi@ira.uka.de>)
1999-04-09 23:34:05 +00:00
Tim Janik
8286bd2493 use gtk_widget_activate() rather than emit_by_name.
Thu Apr  8 20:10:33 1999  Tim Janik  <timj@gtk.org>

        * gtk/gtkentry.c (gtk_entry_key_press): use gtk_widget_activate()
        rather than emit_by_name.

        * gtk/gtkeditable.c (gtk_editable_insert_text): keep a reference
        on the widget across multiple signal emissions.
        (gtk_editable_delete_text): same here.
        (gtk_editable_class_init): set widget_class->activate_signal after
        editable_signals[ACTIVATE] has been created.
1999-04-08 20:11:42 +00:00
Owen Taylor
ceb0f66e51 Don't clamp position here prematurely -- we might not have the right
Wed Apr  7 22:59:47 1999  Owen Taylor  <otaylor@redhat.com>

	* gtk/gtkpaned.c (gtk_paned_set_position): Don't clamp
	position here prematurely -- we might not have the
	right ->min_position and ->max_position yet.
1999-04-08 03:06:03 +00:00
Owen Taylor
3de957405f Add error traps so if the other end of the connection dies, we survive.
Tue Apr  6 16:38:51 1999  Owen Taylor  <otaylor@redhat.com>

	* gtk/gtkselection.c gdk/gdkselection.c: (gtk_selection_request):
	Add error traps so if the other end of the connection
	dies, we survive.

	* gtk/gtkselection.c (gtk_selection_notify): Clean
	up properly when selection property retrieval fails.

	* gtk/gtkselection.c (gtk_selection_request): Correctly
	reject SelectionRequest notifies where the handler
	returns no data.
1999-04-06 21:00:45 +00:00
Owen Taylor
4361369939 Only unhighlight when we've previously highlighted.
Tue Apr  6 12:24:21 1999  Owen Taylor  <otaylor@redhat.com>

	* gtk/gtkdnd.c (gtk_drag_dest_leave): Only unhighlight
	when we've previously highlighted.

	* gtk/gtkdnd.c (gtk_drag_dest_handle_event): Don't
	emit two "drag_leave" signals for Motif drops.

	* gtk/gtkdnd.c (gtk_drag_source_handle_event): Send
	back the correct status messages when dropping from
	Motif onto a proxy window that is rejecting the
	drop.

	* gdk/gdkdnd.c (gdk_drag_motion): Separate out the
	dest_xid field into two fields - one for the window
	to send in messages, one to indicate the last looked
	up window for caching purposes. This is needed, so
	that Leave messages get the correct window.
1999-04-06 18:50:38 +00:00
Owen Taylor
0d353949e2 Check explicitly for the string "None" - it is in the XPM spec and some
Mon Apr  5 17:11:57 1999  Owen Taylor  <otaylor@redhat.com>

	* gdk/gdkpixmap.c (_gdk_pixmap_create_from_xpm): Check
	explicitly for the string "None" - it is in the XPM
	spec and some servers treat unknown colors in odd ways
	(like asking the user!)
1999-04-05 21:14:25 +00:00
Owen Taylor
80c5ac85d4 Fix warning created by people mucking around with the gsource API.
Mon Apr  5 13:21:30 1999  Owen Taylor  <otaylor@redhat.com>

	* gdk/gdkevents.c (gdk_event_check, gdk_event_prepare):
	Fix warning created by people mucking around
	with the gsource API.

	* gdk/gdkevents.c (gdk_io_invoke, gdk_input_add_full):
	Change mapping between GIOCondition and GdkInputCondition
	to match the way the Linux kernel does it. This should
	fix problems where closed pipes were no longer signalling
	GDK_INPUT_READ on systems with a native poll().
1999-04-05 17:24:41 +00:00
Manish Singh
b44c5d0f0c made "->" into a "." of previous change so it compiles
* gdk/gdkevents.c: made "->" into a "." of previous change so
it compiles

* gtk/gtkfontsel.c: added braces enclosing an if-else construct

* autogen.sh: add --enable-maintainer-mode

* configure.in: set ACLOCAL="$ACLOCAL $ACLOCAL_FLAGS"

-Yosh
1999-04-02 01:17:12 +00:00
Federico Mena Quintero
7ac92e74e8 Set the window field of the event structure before calling user filters.
Thu Apr  1 18:41:25 1999  Owen Taylor  <otaylor@redhat.com>

	* gdk/gdkevents.c (gdk_compress_exposures): Set the
	window field of the event structure before calling
	user filters.

1999-03-31  Federico Mena Quintero  <federico@nuclecu.unam.mx>

	* gdk/gdk.c (gdk_init_check): Use False as the last argument to
	XInternAtom() here.  This is a particularly Old And Nasty(tm) bug.
1999-04-01 23:38:43 +00:00
Federico Mena Quintero
eaa98e5cfc Use False as the last argument to XInternAtom() here. This is a
1999-03-31  Federico Mena Quintero  <federico@nuclecu.unam.mx>

	* gdk/gdk.c (gdk_init_check): Use False as the last argument to
	XInternAtom() here.  This is a particularly Old And Nasty(tm) bug.
1999-04-01 10:42:06 +00:00
Tim Janik
db496116d9 added functions from GLE, gtk_arg_reset() to free the value and reset type
Sat Mar 27 23:32:13 1999  Tim Janik  <timj@gtk.org>

        * gtk/gtkarg.[hc]: added functions from GLE, gtk_arg_reset() to free
        the value and reset type to GTK_TYPE_INVALID, and gtk_arg_values_equal()
        to compare two argument values. added gtk_arg_to_valueloc() to set a
        variable from an arg through its location (pointer).

        * gtk/gtkobject.[hc]: implemented gtk_object_get() in terms of
        gtk_object_arg_get() and gtk_arg_to_valueloc(), floats are collected
        as gfloat*, uchars are collected as guchar*, ints are collected as
        gint*, etc...
1999-03-30 18:28:38 +00:00
Owen Taylor
d32d93cc3c Include <string.h> instead of <strings.h>.
Mon Mar 29 17:45:47 1999  Owen Taylor  <otaylor@redhat.com>

	* gtk/gtkaccelgroup.c gtk/gtkgtkbindings.c:
	Include <string.h> instead of <strings.h>.

	* gtk/gtkstyle.c: Fix double include of gtkthemes.h
	(actually, a lot more duplicate includes occur if
	 you trace through the sequence of #include's)
	gtk-jbb-990320-0: John Bley, jbb6@acpub.duke.edu
1999-03-29 23:44:33 +00:00
Owen Taylor
da74d5d843 Free the value of the intermediate text property - prevents major memory
Mon Mar 29 17:31:52 1999  Owen Taylor  <otaylor@redhat.com>

	* gdk/gdkim.c (gdk_mbstowcs): Free the value of the
	intermediate text property - prevents major memory
        leak when gdk_use_mb.
	gtk-d3august-990311-0: Bj|rn Augustsson <d3august@dtek.chalmers.se>
1999-03-29 22:38:18 +00:00
Owen Taylor
44dd4a430d Patches from Akira Higuchi <a-higuti@math.sci.hokudai.ac.jp>
Mon Mar 29 17:02:58 1999  Owen Taylor  <otaylor@redhat.com>

        Patches from Akira Higuchi <a-higuti@math.sci.hokudai.ac.jp>
	gtk-a-higuti-990322-[0-3]

	* gdk/gdkfont.c (gdk_text_extents_wc): Make  work when
	sizeof(wchar_t) != sizeof (GdkWChar)

	* configure.in: Fix confusion between GTK_LOCALE_[C]FLAGS
	that was causing -DX_LOCALE not	to work.

	* gtk/gtkrc.c (gtk_rc_init):
	X_LOCALE will never have LC_MESSAGES defined

	* gdk/gdk.c (gdk_init_check):
	Remove --xim-preedit and --xim-status from argv properly.

	* gdk/gdkim.c (gdk_ic_real_new): Add a gdk_flush() so
	that the client window is present on the X server
	before we pass it to the input method.
1999-03-29 22:20:41 +00:00
Owen Taylor
fcc38c19d8 Fix bug where if --display is specified on the command line, than the drag
Tue Mar  9 10:46:49 1999  Owen Taylor  <otaylor@redhat.com>

	* gdk/gdkdnd.c (motif_find_drag_window): Fix bug where
	if --display is specified on the command line, than
	the drag window will not be created on that display.

Tue Mar  9 10:38:24 1999  Owen Taylor  <otaylor@redhat.com>

	* gdk/gdkproperty.c (gdk_atom_intern): Fixed bug where
	lookups with only_if_exists == TRUE were inserting
	bogus values into the atom cache.
1999-03-29 20:40:47 +00:00
Manish Singh
737580cc57 Shut up CVS
-Yosh
1999-03-28 01:07:21 +00:00
Kjartan Maraas
db025ebfb0 updated translation
1999-03-27  Kjartan Maraas  <kmaraas@online.no>

		* no.po: updated translation
1999-03-26 23:11:18 +00:00
Tim Janik
0ae73a09dd get $HOME from g_get_home_dir() (gtk-pmc-990123-0.patch.gz).
Thu Mar 25 12:38:31 1999  Tim Janik  <timj@gtk.org>

        * gtk/gtkrc.c (gtk_rc_append_default_module_path): get $HOME from
        g_get_home_dir() (gtk-pmc-990123-0.patch.gz).

        * gtk/gtkwindow.c (gtk_window_key_press_event): feature keypad up/down/
        left/right as well (gtk-michael-980726-0.patch.gz).

        * gtk/gtklabel.[hc]: bunch of miscellaneous cleanups, such as s/0/NULL/
        for pointer values, use gchar instead of char. fixed uline allocation
        leaks, changed the allocation pattern so we use G_ALLOC_AND_FREE mem
        chunks instead of G_ALLOC_ONLY.
        (gtk_label_size_request): always alter requisition as passed and leave
        widget->requisition alone.
        (gtk_label_set_text): allow NULL strings.
        (gtk_label_new): likewise.
1999-03-25 13:39:54 +00:00
CST 1999 Shawn T. Amundson
2c659472e2 Released GTK+ 1.2.1
Wed Mar 24 23:03:49 CST 1999 Shawn T. Amundson <amundson@gtk.org>

        * Released GTK+ 1.2.1

        * INSTALL:
          README:
          sanity_check: Updated.

        * docs/gtk-config.1.in:
          docs/Makefile.am:
          configure.in: gtk-config is now generated.

        * docs/gtk-config.1: Removed, now generated.
1999-03-25 05:55:03 +00:00
Tim Janik
0720955e17 type/macro fixups.
Wed Mar 24 09:24:03 1999  Tim Janik  <timj@gtk.org>

        * gtk/gtkdrawingarea.[hc]: type/macro fixups.
1999-03-24 15:01:55 +00:00
Stefan Jeske
0c90498103 Added missing "%" to "prefix" 1999-03-24 09:43:05 +00:00
Kjartan Maraas
bab8d95583 1112: add missing . after @xref
1999-03-22  Kjartan Maraas  <kmaraas@online.no>

		* gtk.texi:1112: add missing . after @xref
1999-03-22 20:47:19 +00:00
Tim Janik
3f2cd052fd grrr, stupid cvs, try grasp the meaning of "abort"!
Mon Mar 22 05:51:34 1999  Tim Janik  <timj@gtk.org>

        * gtk/gtkbin.c (gtk_bin_draw): only redraw children that are visible
        *and* mapped (i.e. drawable).
        (gtk_bin_expose): only send exposes to drawable children.

        * gtk/gtkbox.c (gtk_box_draw): only redraw children that are drawable.
        (gtk_box_expose): only send exposes to drawable children.

        * gtk/gtkhscale.c (gtk_hscale_draw):
        * gtk/gtkvscale.c (gtk_vscale_draw):
        hm, this is an ugly one. we first compute the size of our trough area
        here (window relative) and then check intersection with the draw_area
        which is parent relative because we're a NO_WINDOW widget, so we need
        to offset the trough area by allocation.x and allocation.y before the
        check. (this must not be done for the background area though, since
        that's already computed parent relative).
1999-03-22 06:46:16 +00:00
Tim Janik
0362058f6e only redraw children that are visible *and* mapped (i.e. drawable).
Mon Mar 22 05:51:34 1999  Tim Janik  <timj@gtk.org>

        * gtk/gtkbin.c (gtk_bin_draw): only redraw children that are visible
        *and* mapped (i.e. drawable).
        (gtk_bin_expose): only send exposes to drawable children.

        * gtk/gtkbox.c (gtk_box_draw): only redraw children that are drawable.
        (gtk_box_expose): only send exposes to drawable children.

        * gtk/gtkhscale.c (gtk_hscale_draw):
        * gtk/gtkvscale.c (gtk_vscale_draw):
        hm, this is an ugly one. we first compute the size of our trough area
        here (window relative) and then check intersection with the draw_area
        which is widget relative, so we need to offset the trough area by
        allocation.x and allocation.y before the check. (this must not be done
        for the background area though, sicne that's already computed parent
        relative).
1999-03-22 06:35:54 +00:00
Lars Hamann
b59eefd649 unmap clist if neccessary, unrealize title buttons.
Mon Mar 22 00:41:39 1999  Lars Hamann  <lars@gtk.org>

	* gtk/gtkclist.c (gtk_clist_unrealize): unmap clist if neccessary,
	unrealize title buttons.
1999-03-21 23:57:07 +00:00
Manish Singh
287624f406 shut up cvs
-Yosh
1999-03-21 02:19:44 +00:00
Manish Singh
d4ecce94c8 acinclude.m4 config.guess config.sub ltconfig upgrade to libtool 1.2f
* acinclude.m4
* config.guess
* config.sub
* ltconfig
* ltmain.sh: upgrade to libtool 1.2f

* autogen.sh: libtool is not required to autogen gtk+

* acconfig.h: remove WITH_SYMBOL_UNDERSCORE (not explictly needed)

-Yosh
1999-03-20 00:48:13 +00:00
Lars Hamann
536673ad38 only connect/disconnect to GtkWidgetClass::event to block mouse events.
Fri Mar 19 00:00:22 1999  Lars Hamann  <lars@gtk.org>

	* gtk/gtkclist.c (gtk_clist_column_title_passive)
	(gtk_clist_column_title_active):
	only connect/disconnect to GtkWidgetClass::event to block mouse events.

	* gtk/gtkclist.c (vertical_timeout) (horizontal_timeout):
	zero initialize event, removed superfluous gdk_window_get_pointer call

	* gtk/gtklist.c (gtk_list_vertical_timeout)
	(gtk_list_horizontal_timeout): removed superfluous
 	gdk_window_get_pointer call
1999-03-19 12:36:22 +00:00
Tim Janik
8b424288ba plugging problems reported by "Bruce Mitchener, Jr." <bruce@puremagic.com>
Wed Mar 17 09:00:00 1999  Tim Janik  <timj@gtk.org>

        * plugging problems reported by "Bruce Mitchener, Jr."
        <bruce@puremagic.com> due to a purify session.

        * gtk/gtkstyle.c:
        (gtk_style_ref):
        (gtk_style_unref): assert ref_count to be > 0.

        * gtk/gtkclist.c (gtk_clist_set_cell_style): { 0 } initilaize
        the requisition.
        (gtk_clist_set_shift): likewise.

        * gtk/gtklayout.c: introduce gtk_layout_finalize() to unref the
        adjustments.

        * gdk/gdkselection.c (gdk_selection_property_get): first XFree(t),
        then reset it to NULL.

        * gtk/gtklist.c (gtk_list_horizontal_timeout): zero initialize the
        event before sending it and set send_event to TRUE (which needs to
        be done for *all* synthesized events).
        (gtk_list_vertical_timeout): likewise.

        * gdk/gdkcolor.c:
        (gdk_colors_free):
        (gdk_colormap_free_colors): use colormap->colors[in_pixels[i]] as the
        key for g_hash_table_remove() in both functions, this prevents us
        from accessing possibly uninitialized portions of a GdkColor structure
        where we are only interested in its pixel value.

        * gtk/gtktipsquery.c (gtk_tips_query_destroy): plug small memory
        leaks.

        * gtk/gtkdrawingarea.c (gtk_drawing_area_send_configure): set send_event
        to TRUE when synthesizing events.
1999-03-17 10:32:33 +00:00
Stuart Parmenter
f880eba7cd make sure gtk_style_copy copies theme information 1999-03-17 03:32:11 +00:00
Tim Janik
ac8d845b3d updates.
* NEWS: updates.
1999-03-17 02:38:38 +00:00
Tim Janik
b691a88e07 bumped version number to Gtk+1.2.1, interface 0, binary 1.
Wed Mar 17 00:44:23 1999  Tim Janik  <timj@gtk.org>

        * configure.in: bumped version number to Gtk+1.2.1, interface 0,
        binary 1.

        * gtk/gtkfeatures.h.in: added GTK_CHECK_VERSION(major,minor,micro)
        macro to test for specific gtk versions, e.g.
        #if GTK_CHECK_VERSION (1,2,1)
            gtk_menu_ensure_uline_accel_group (menu);
        #endif /* Gtk+1.2.1 */
        this macro will return whether the Gtk+ header files are from version
        major.minor.micro or _newer_, as opposed to gtk_check_version() which
        requires an exact match for binary compatibility.
1999-03-17 00:03:10 +00:00
Tim Janik
af138bc287 ensure the item factory class has been created.
Tue Mar 16 17:43:33 1999  Tim Janik  <timj@gtk.org>

	* gtk/gtkitemfactory.c (gtk_item_factory_parse_rc_string): ensure the
	item factory class has been created.
	(gtk_item_factory_parse_rc): likewise.

	* gtk/gtkmenu.c:
	keep proper references for old_active_menu_item.
	(gtk_menu_reparent): unset the usize of the new parent,
	so the menu can sanely be size requested and we don't get nasty screen
	artefacts upon next reparentation.
	(gtk_menu_motion_notify): set send_event to TRUE if we synthesize an
	enter notify. only synthesize enter notifies if the pointer really is
	inside the event window.
	(gtk_menu_popdown): use gtk_menu_shell_deselect().
	(gtk_menu_popup): move the background setting stuff into
	gtk_menu_tearoff_bg_copy() so it can be called from other places as well.

	* gtk/gtkmenushell.c (gtk_menu_shell_button_press): use
	gtk_menu_shell_select_item() to select the new item.
	(gtk_menu_shell_deselect): export this function, so gtkmenu.c can
	do the right thing for deselection as well.

Sat Mar 15 20:10:33 1999  Tim Janik  <timj@gtk.org>

	* gtk/gtkwidget.[hc]:
	(gtk_widget_accelerators_locked): return whether a widget's accelerators
	are locked.

        * gtk/gtkmenu.c (gtk_menu_key_press): don't remove or install new or
	existing accelerators if the widget's accelerators are locked.

Sat Mar 14 19:44:05 1999  Tim Janik  <timj@gtk.org>

	* gtk/gtkitemfactory.[hc]: allow managing of foreign menu items.

	* gtk/gtkmenu.c: truely forward key press and key release events to
	the menu widget from the toplevel or tearoff window. we can't simply
	connect to that, we need to stop further processing of the events as
	well.

Sat Mar 13 13:14:17 1999  Tim Janik  <timj@gtk.org>

	* gtk/gtkmenu.c:
	(gtk_menu_key_press): pass event->keyval, event->state to
	gtk_accelerator_valid, instead of event->keyval twice.
	refuse to install single letter accelerators for menus that use
	single letter shortcuts.

	* gtk/gtkitemfactory.c (gtk_item_factory_create_item): use
	gtk_menu_ensure_uline_accel_group().

	* gtk/gtkmenu.[hc]: added gtk_menu_ensure_uline_accel_group()
	which will always return an uline accel group, made
	gtk_menu_get_uline_accel_group() return NULL if the group isn't
	yet created.
1999-03-16 22:37:32 +00:00
Lars Hamann
29ce61fcf3 added button_passive flag.
Mon Mar 15 01:03:27 1999  Lars Hamann  <lars@gtk.org>

        * gtk/gtkclist.h (struct _GtkCListColumn): added button_passive flag.

        * gtk/gtkclist.c (gtk_clist_column_title_passive):
        Leave button sensitive, trap  button_press, button_release,
        motion_notify, enter_notify and leave_notify events instead.
        (gtk_clist_column_title_active): disconnect event handler.
        (gtk_clist_drag_data_get): fixed memory leak. Reported by
        Guillaume Laurent <glaurent@worldnet.fr>
1999-03-15 22:37:28 +00:00
George Lebl
69d2eba366 swap the gtk_drag_highlight_expose and gtk_drag_highlight_paint since it
Mon Mar 15 03:39:47 1999  George Lebl  <jirka@5z.com>

        * gtk/gtkdnd.c: (gtk_drag_highlight) swap the
          gtk_drag_highlight_expose and gtk_drag_highlight_paint since
          it was connecting a void function to expose_event and the int
          returning function to the draw signal
1999-03-15 11:40:27 +00:00
Lars Hamann
efb837bdb6 fixed a few width/height mixups.
Wed Mar 10 23:49:55 1999  Lars Hamann  <lars@gtk.org>

        * gtk/gtklayout.c (gtk_layout_adjustment_changed): fixed a few
        width/height mixups.

        * gtk/gtkctree.c (tree_delete): emit an tree_unselect_row signal
        if needed.
1999-03-10 23:20:10 +00:00
Federico Mena Quintero
5db63aaa6d Significantly reduced the number of calls to gdk_draw_point() (and thus to
Wed Mar 10 02:07:31 1999  Tim Janik  <timj@gtk.org>

        * merged from 1.3:
1999-03-09  Federico Mena Quintero  <federico@nuclecu.unam.mx>

        * gtk/gtkstyle.c (gtk_default_draw_handle): Significantly reduced
        the number of calls to gdk_draw_point() (and thus to X) by
        clipping the points by hand.

        * gtk/gtkhandlebox.c (draw_textured_frame): Actually make use of
        the clip parameter.
        (gtk_handle_box_paint): Only paint the handle if the expose area
        intersects it.
1999-03-10 01:14:38 +00:00
Tim Janik
7e8d27f327 unref the item factory after window's destruction.
Wed Mar 10 00:11:32 1999  Tim Janik  <timj@gtk.org>

        * gtk/testgtk.c (create_item_factory): unref the item factory after
        window's destruction.

        * gtk/gtkmenushell.c (gtk_menu_shell_activate_item): keep a reference
        count on the menu shell around the menu item's activation, since the
        signal emission may cause menu shell destruction.

        * gtk/gtkitemfactory.c:
        the previous code leaked one accel group per menu. we use
        gtk_menu_get_uline_accel_group() now to fix that, and with that
        also create the underline accelerator group of the menus only if
        required (i.e. an underline accelerator has been specified).
        (gtk_item_factory_construct):
        (gtk_item_factory_create_item): removed code that would create an
        extra accel group for the menu (and leak references).
        (gtk_item_factory_create_item): adapted the underline accelerator
        installation code to properly feature gtk_menu_get_uline_accel_group().

        * gtk/gtkmenu.[hc]: added gtk_menu_get_accel_group() to retrive
        menu->accel_group, this may return NULL if the accelerator group
        hasn't been set yet.
        added gtk_menu_get_uline_accel_group() to retrive the underline
        accelerator group of the menu, this will be created on demand
        and proper care is taken about its reference count.

        * gtk/gtkitemfactory.h:
        * gtk/gtkitemfactory.c:
        dumped the approach of keeping a widgets by action list on the
        factory since the factory<->widget destroy negotiation didn't work
        and would be hard to get going at all. instead we keep a list of
        GtkItemFactoryItem items on the factory (GtkItemFactoryItems are
        persistant throughout a program's life time).
        also, i removed the static const gchar *key_* variables, and made
        them inline strings (they weren't actually used anyways).
        (gtk_item_factory_add_item): update ifactory->items.
        (gtk_item_factory_destroy): destroy ifactory->items (and remove
        the item factory pointer from the remaining ifactory widgets).
        (gtk_item_factory_get_widget_by_action): walk the GtkItemFactoryItem
        list to find the widget.
        (gtk_item_factory_get_item): new function that works around
        gtk_item_factory_get_widget() limitations, this function will only
        return menu items, even for <Branch> entries.
1999-03-10 01:00:04 +00:00
Tim Janik
8556b64654 first lookup the xfont ID in our font hash table, if we have a
Tue Mar  9 01:01:28 1999  Tim Janik  <timj@gtk.org>

        * gdk/gdkfont.c (gdk_font_load): first lookup the xfont ID in our
        font hash table, if we have a GdkFontPrivate entry for this font
        already, simply increment its reference count, provided by Olaf Dietsche
        <olaf.dietsche+list.gtk@netcologne.de>.

        * gtk/gtkstyle.c (gtk_style_copy): plug a GdkFont reference leak, fix
        provided by Olaf Dietsche <olaf.dietsche+list.gtk@netcologne.de>.
1999-03-09 00:21:31 +00:00
Tim Janik
12d38df79e before adding a child to a conatiner, make sure it is (default)
Sun Mar  7 06:13:29 1999  Tim Janik  <timj@gtk.org>

        * gtk/gtkcontainer.c:
        (gtk_container_add_with_args):
        (gtk_container_addv):
        (gtk_container_add): before adding a child to a conatiner, make sure
        it is (default) constructed, this is neccessary because under certain
        circumstances the child will get relized and mapped immediatedly, in
        which case it has to be constructed already.
1999-03-07 06:09:53 +00:00
Tim Janik
7699e34d83 count object_signal values > 1 as TRUE also.
Mon Mar  1 17:58:21 1999  Tim Janik  <timj@gtk.org>

        * gtk/gtksignal.c (gtk_signal_connect_by_type): count object_signal
        values > 1 as TRUE also.
1999-03-01 18:51:07 +00:00
Tim Janik
14ff63b93d minor fix. 1999-02-27 00:35:08 +00:00
5375 changed files with 395989 additions and 2994295 deletions

19
.cvsignore Normal file
View File

@@ -0,0 +1,19 @@
*.lo
config.log
config.h
config.h.in
libtool
config.status
stamp-h
Makefile
Makefile.in
aclocal.m4
configure
gtk-config
config.cache
ABOUT-NLS
intl
stamp-h.in
gtk+.spec
gdk.pc
gtk+.pc

1
.gitignore vendored
View File

@@ -1 +0,0 @@
/subprojects/*/

View File

@@ -1,125 +0,0 @@
stages:
- build
- flatpak
# - deploy
.cache-paths: &cache-paths
paths:
- _ccache/
- subprojects/gdk-pixbuf/
- subprojects/glib/
- subprojects/graphene/
- subprojects/libepoxy/
- subprojects/pango/
fedora-x86_64: &fedora-x86_64-defaults
image: registry.gitlab.gnome.org/gnome/gtk/master:v9
stage: build
script:
- bash -x ./.gitlab-ci/test-docker.sh
artifacts:
when: always
reports:
junit:
- "${CI_PROJECT_DIR}/_build/report.xml"
name: "gtk-${CI_COMMIT_REF_NAME}"
paths:
- "${CI_PROJECT_DIR}/_build/meson-logs"
- "${CI_PROJECT_DIR}/_build/report.xml"
- "${CI_PROJECT_DIR}/_build/report.html"
- "${CI_PROJECT_DIR}/_build/testsuite/reftests/output/*.png"
- "${CI_PROJECT_DIR}/_build/testsuite/gsk/compare/*/*.png"
- "${CI_PROJECT_DIR}/_build/testsuite/css/output/*.syscap"
cache:
key: "$CI_JOB_NAME"
<<: *cache-paths
fedora-x86_64-staticlibs:
variables:
EXTRA_MESON_FLAGS: "-Ddefault_library=both"
<<: *fedora-x86_64-defaults
.mingw-defaults: &mingw-defaults
stage: build
tags:
- win32
script:
- C:\msys64\usr\bin\pacman --noconfirm -Syyuu
- C:\msys64\usr\bin\bash -lc "bash -x ./.gitlab-ci/test-msys2.sh"
cache:
key: "%CI_JOB_NAME%"
<<: *cache-paths
msys2-mingw32:
variables:
MSYSTEM: "MINGW32"
CHERE_INVOKING: "yes"
<<: *mingw-defaults
.flatpak-defaults: &flatpak-defaults
image: registry.gitlab.gnome.org/gnome/gnome-runtime-images/gnome:master
stage: flatpak
artifacts:
paths:
- "${APPID}-dev.flatpak"
expire_in: 1 day
script:
- bash -x ./.gitlab-ci/flatpak-build.sh "${APPID}"
# Manual jobs, for branches and MRs
.flatpak-manual: &flatpak-manual
<<: *flatpak-defaults
when: manual
# Only build Flatpak bundles automatically on master
.flatpak-master: &flatpak-master
<<: *flatpak-defaults
only:
- master
flatpak-manual:demo:
variables:
APPID: org.gtk.Demo4
<<: *flatpak-manual
flatpak-master:demo:
variables:
APPID: org.gtk.Demo4
<<: *flatpak-master
flatpak-manual:widget-factory:
variables:
APPID: org.gtk.WidgetFactory4
<<: *flatpak-manual
flatpak-master:widget-factory:
variables:
APPID: org.gtk.WidgetFactory4
<<: *flatpak-master
flatpak-manual:icon-browser:
variables:
APPID: org.gtk.IconBrowser4
<<: *flatpak-manual
flatpak-master:icon-browser:
variables:
APPID: org.gtk.IconBrowser4
<<: *flatpak-master
#pages:
# image: registry.gitlab.gnome.org/gnome/gtk/master:v6
# stage: deploy
# script:
# - meson -Dgtk_doc=true _build .
# - ninja -C _build
# - ninja -C _build gdk4-doc gsk4-doc gtk4-doc
# - mkdir -p public/
# - mv _build/docs/reference/gtk/html/ public/gtk/
# - mv _build/docs/reference/gdk/html/ public/gdk/
# - mv _build/docs/reference/gsk/html/ public/gsk/
# artifacts:
# paths:
# - public
# only:
# - master

View File

@@ -1,88 +0,0 @@
FROM fedora:31
RUN dnf -y install \
adwaita-icon-theme \
atk-devel \
at-spi2-atk-devel \
avahi-gobject-devel \
cairo-devel \
cairo-gobject-devel \
ccache \
colord-devel \
cups-devel \
dbus-daemon \
dejavu-sans-mono-fonts \
desktop-file-utils \
diffutils \
elfutils-libelf-devel \
fribidi-devel \
gcc \
gcc-c++ \
gdk-pixbuf2-devel \
gdk-pixbuf2-modules \
gettext \
git \
glib2-devel \
glibc-devel \
glibc-headers \
gobject-introspection-devel \
graphene-devel \
gstreamer1-devel \
gstreamer1-plugins-good \
gstreamer1-plugins-bad-free-devel \
gstreamer1-plugins-base-devel \
gtk-doc \
hicolor-icon-theme \
iso-codes \
itstool \
json-glib-devel \
lcov \
libattr-devel \
libepoxy-devel \
libffi-devel \
libmount-devel \
librsvg2 \
libselinux-devel \
libXcomposite-devel \
libXcursor-devel \
libXcursor-devel \
libXdamage-devel \
libXfixes-devel \
libXi-devel \
libXinerama-devel \
libxkbcommon-devel \
libXrandr-devel \
libXrender-devel \
libXtst-devel \
libxslt \
mesa-dri-drivers \
mesa-libEGL-devel \
mesa-libwayland-egl-devel \
ninja-build \
pango-devel \
pcre-devel \
python3 \
python3-jinja2 \
python3-pip \
python3-wheel \
redhat-rpm-config \
sassc \
sysprof-devel \
systemtap-sdt-devel \
vulkan-devel \
wayland-devel \
wayland-protocols-devel \
which \
xorg-x11-server-Xvfb \
&& dnf clean all
RUN pip3 install meson==0.50.1
ARG HOST_USER_ID=5555
ENV HOST_USER_ID ${HOST_USER_ID}
RUN useradd -u $HOST_USER_ID -ms /bin/bash user
USER user
WORKDIR /home/user
ENV LANG C.UTF-8

View File

@@ -1,44 +0,0 @@
#!/bin/bash
set -e
appid=$1
builddir=app
repodir=repo
flatpak-builder \
--stop-at=gtk \
${builddir} \
build-aux/flatpak/${appid}.json
flatpak-builder \
--run ${builddir} build-aux/flatpak/${appid}.json \
meson \
--prefix /app \
--libdir /app/lib \
--buildtype debug \
-Dx11-backend=true \
-Dwayland-backend=true \
-Dprint-backends=file \
-Dbuild-tests=false \
-Dbuild-examples=false \
-Dintrospection=false \
-Ddemos=true \
_build .
flatpak-builder \
--run ${builddir} build-aux/flatpak/${appid}.json \
ninja -C _build install
flatpak-builder \
--finish-only \
--repo=${repodir} \
${builddir} \
build-aux/flatpak/${appid}.json
flatpak build-bundle \
${repodir} \
${appid}-dev.flatpak \
--runtime-repo=https://flathub.org/repo/flathub.flatpakrepo \
${appid}

View File

@@ -1,363 +0,0 @@
#!/usr/bin/env python3
# Turns a Mason testlog.json file into an HTML report
#
# Copyright 2019 GNOME Foundation
#
# SPDX-License-Identifier: LGPL-2.1-or-later
#
# Original author: Emmanuele Bassi
import argparse
import datetime
import json
import os
import sys
from jinja2 import Template
REPORT_TEMPLATE = '''
<!DOCTYPE html>
<html lang="en">
<head>
<title>{{ report.project_name }} Test Report</title>
<meta charset="utf-8" />
<style type="text/css">
body {
background: white;
color: #333;
font-family: 'Cantarell', sans-serif;
}
h1 {
color: #333333;
font-size: 1.9em;
font-weight: normal;
margin-bottom: 1em;
border-bottom: 1px solid #333333;
}
header {
position: fixed;
padding-bottom: 12px;
margin-bottom: 24px;
background: rgba(255, 255, 255, 0.85);
box-shadow: 0 0 1px rgba(0, 0, 0, 0.15);
z-index: 500;
left: 0;
top: 0;
width: 100%;
color: rgba(0, 0, 0, 0.3);
transform: translateY(0px);
transition: .2s background-color, color;
box-sizing: border-box;
display: block;
visibility: visible;
text-align: center;
}
article {
padding-top: 200px;
margin: 2em;
}
div.report-meta {
width: auto;
border: 1px solid #ccc;
padding: .5em 2em;
color: #3c3c3c;
}
span.result {
font-weight: bold;
}
span.pass {
color: rgb(51, 209, 122);
}
span.skip {
color: rgb(255, 163, 72);
}
span.fail {
color: rgb(224, 27, 36);
}
span.xfail {
color: rgb(163, 71, 186);
}
div.result {
border-top: 1px solid #c0c0c0;
padding-top: 1em;
padding-bottom: 1em;
width: 100%;
}
div.result h4 {
border-bottom: 1px solid #c0c0c0;
margin-bottom: 0.7em;
}
pre {
color: #fafafa;
background-color: black;
border-radius: 6px;
box-shadow: 0px 5px 8px 0px rgba(0, 0, 0, 0.25);
font-family: monospace;
line-height: 1.2em;
border: none;
padding: 10px 1em;
font-size: 0.9em;
overflow: auto;
white-space: pre;
word-break: normal;
word-wrap: normal;
}
ul.passed li {
display: inline;
}
ul.passed li:after {
content: ",";
}
ul.passed li:last-child:after {
content: "";
}
ul.images {
padding-bottom: 1em;
}
ul.images li {
display: inline;
}
</style>
</head>
<body>
<header>
<h1>{{ report.project_name }} :: Test Reports</h1>
<div class="report-meta">
<p><strong>Branch:</strong> {{ report.branch_name }}</p>
<p><strong>Date:</strong> <time datetime="{{ report.date.isoformat() }}">{{ report.locale_date }}</time></p>
{% if report.job_id %}<p><strong>Job ID:</strong> {{ report.job_id }}</p>{% endif %}
</div>
</header>
<article>
<section>
<div class="summary">
<h3><a name="summary">Summary</a></h3>
<ul>
<li><strong>Total units:</strong> {{ report.total_units }}</li>
<li><strong>Passed:</strong> <a href="#passed">{{ report.total_successes }}</a></li>
<li><strong>Failed:</strong> <a href="#failures">{{ report.total_failures }}</a></li>
</ul>
</div>
</section>
{% for suite_result in report.results_list %}
<section>
<div class="result">
<h3><a name="results">Suite: {{ suite_result.suite_name }}</a></h3>
<ul>
<li><strong>Units:</strong> {{ suite_result.n_units }}</li>
<li><strong>Passed:</strong> {{ suite_result.n_successes }}</li>
<li><strong>Failed:</strong> {{ suite_result.n_failures }}</li>
</ul>
<div class="successes">
<h4><a name="passed">Passed</a></h4>
<ul class="passed">
{% for success in suite_result.successes if success.result == 'OK' %}
<li>{{ success.name }} - result: <span class="result pass">{{ success.result }}</li>
{% else %}
<li>None</li>
{% endfor %}
</ul>
<h4><a name="skipped">Skipped</a></h4>
<ul>
{% for success in suite_result.successes if success.result == 'SKIP' %}
<li>{{ success.name }} - result: <span class="result skip">{{ success.result }}</li>
{% else %}
<li>None</li>
{% endfor %}
</ul>
<h4><a name="expected-fail">Expected failures</a></h4>
<ul>
{% for success in suite_result.successes if success.result == 'EXPECTEDFAIL' %}
<li><a name="{{ success.name }}">{{ success.name }}</a> - result: <span class="result xfail">{{ success.result }}</span><br/>
{% if success.stdout %}
Output: <pre>{{ success.stdout }}</pre>
{% endif %}
{% if success.image_data is defined %}
<ul class="images">
<li><img alt="ref" src="{{ success.image_data.ref }}" /></li>
<li><img alt="out" src="{{ success.image_data.out }}" /></li>
<li><img alt="diff" src="{{ success.image_data.diff }}" /></li>
</ul>
{% endif %}
</li>
{% else %}
<li>None</li>
{% endfor %}
</ul>
</div>
<div class="failures">
<h4><a name="failed">Failed</a></h4>
<ul class="failed">
{% for failure in suite_result.failures if failure.result == 'FAIL' %}
<li><a name="{{ failure.name }}">{{ failure.name }}</a> - result: <span class="result fail">{{ failure.result }}</span><br/>
{% if failure.stdout %}
Output: <pre>{{ failure.stdout }}</pre>
{% endif %}
{% if failure.image_data is defined %}
<ul class="images">
<li><img alt="ref" src="{{ failure.image_data.ref }}" /></li>
<li><img alt="out" src="{{ failure.image_data.out }}" /></li>
<li><img alt="diff" src="{{ failure.image_data.diff }}" /></li>
</ul>
{% endif %}
</li>
{% else %}
<li>None</li>
{% endfor %}
</ul>
<h4><a name="timed-out">Timed out</a></h4>
<ul class="failed">
{% for failure in suite_result.failures if failure.result == 'TIMEOUT' %}
<li><a name="{{ failure.name }}">{{ failure.name }}</a> - result: <span class="result fail">{{ failure.result }}</span><br/>
{% if failure.stdout %}
Output: <pre>{{ failure.stdout }}</pre>
{% endif %}
</li>
{% else %}
<li>None</li>
{% endfor %}
</ul>
</div>
</div>
</section>
{% endfor %}
</article>
</body>
</html>
'''
aparser = argparse.ArgumentParser(description='Turns a Meson test log into an HTML report')
aparser.add_argument('--project-name', metavar='NAME',
help='The project name',
default='Unknown')
aparser.add_argument('--job-id', metavar='ID',
help='The job ID for the report',
default=None)
aparser.add_argument('--branch', metavar='NAME',
help='Branch of the project being tested',
default='master')
aparser.add_argument('--output', metavar='FILE',
help='The output HTML file, stdout by default',
type=argparse.FileType('w', encoding='UTF-8'),
default=sys.stdout)
aparser.add_argument('--reftest-suite', metavar='NAME',
help='The name of the reftests suite',
default='reftest')
aparser.add_argument('--reftest-output-dir', metavar='DIR',
help='The output directory for reftests data',
default=None)
aparser.add_argument('infile', metavar='FILE',
help='The input testlog.json, stdin by default',
type=argparse.FileType('r', encoding='UTF-8'),
default=sys.stdin)
args = aparser.parse_args()
outfile = args.output
suites = {}
for line in args.infile:
data = json.loads(line)
(full_suite, unit_name) = data['name'].split(' / ')
(project_name, suite_name) = full_suite.split(':')
unit = {
'project-name': project_name,
'suite': suite_name,
'name': unit_name,
'duration': data['duration'],
'returncode': data['returncode'],
'result': data['result'],
'stdout': data['stdout'],
}
if args.reftest_output_dir is not None and suite_name == args.reftest_suite:
filename = unit_name.split(' ')[1]
basename = os.path.splitext(filename)[0]
image_data = {
'ref': os.path.join(args.reftest_output_dir, '{}.ref.png'.format(basename)),
'out': os.path.join(args.reftest_output_dir, '{}.out.png'.format(basename)),
'diff': os.path.join(args.reftest_output_dir, '{}.diff.png'.format(basename)),
}
unit['image_data'] = image_data
units = suites.setdefault(full_suite, [])
units.append(unit)
report = {}
report['date'] = datetime.datetime.utcnow()
report['locale_date'] = report['date'].strftime("%c")
report['project_name'] = args.project_name
report['job_id'] = args.job_id
report['branch_name'] = args.branch
report['total_successes'] = 0
report['total_failures'] = 0
report['total_units'] = 0
report['results_list'] = []
for name, units in suites.items():
(project_name, suite_name) = name.split(':')
print('Processing {} suite {}:'.format(project_name, suite_name))
def if_failed(unit):
if unit['result'] in ['FAIL', 'TIMEOUT']:
return True
return False
def if_succeded(unit):
if unit['result'] in ['OK', 'EXPECTEDFAIL', 'SKIP']:
return True
return False
successes = list(filter(if_succeded, units))
failures = list(filter(if_failed, units))
n_units = len(units)
n_successes = len(successes)
n_failures = len(failures)
report['total_units'] += n_units
report['total_successes'] += n_successes
report['total_failures'] += n_failures
print(' - {}: {} total, {} pass, {} fail'.format(suite_name, n_units, n_successes, n_failures))
suite_report = {
'suite_name': suite_name,
'n_units': n_units,
'successes': successes,
'n_successes': n_successes,
'failures': failures,
'n_failures': n_failures,
}
report['results_list'].append(suite_report)
template = Template(REPORT_TEMPLATE)
outfile.write(template.render({'report': report}))

View File

@@ -1,109 +0,0 @@
#!/usr/bin/env python3
# Turns a Meson testlog.json file into a JUnit XML report
#
# Copyright 2019 GNOME Foundation
#
# SPDX-License-Identifier: LGPL-2.1-or-later
#
# Original author: Emmanuele Bassi
import argparse
import datetime
import json
import os
import sys
import xml.etree.ElementTree as ET
aparser = argparse.ArgumentParser(description='Turns a Meson test log into a JUnit report')
aparser.add_argument('--project-name', metavar='NAME',
help='The project name',
default='unknown')
aparser.add_argument('--job-id', metavar='ID',
help='The job ID for the report',
default='Unknown')
aparser.add_argument('--branch', metavar='NAME',
help='Branch of the project being tested',
default='master')
aparser.add_argument('--output', metavar='FILE',
help='The output file, stdout by default',
type=argparse.FileType('w', encoding='UTF-8'),
default=sys.stdout)
aparser.add_argument('infile', metavar='FILE',
help='The input testlog.json, stdin by default',
type=argparse.FileType('r', encoding='UTF-8'),
default=sys.stdin)
args = aparser.parse_args()
outfile = args.output
testsuites = ET.Element('testsuites')
testsuites.set('id', '{}/{}'.format(args.job_id, args.branch))
testsuites.set('package', args.project_name)
testsuites.set('timestamp', datetime.datetime.utcnow().isoformat(timespec='minutes'))
suites = {}
for line in args.infile:
data = json.loads(line)
(full_suite, unit_name) = data['name'].split(' / ')
(project_name, suite_name) = full_suite.split(':')
duration = data['duration']
return_code = data['returncode']
log = data['stdout']
unit = {
'suite': suite_name,
'name': unit_name,
'duration': duration,
'returncode': return_code,
'stdout': log,
}
units = suites.setdefault(suite_name, [])
units.append(unit)
for name, units in suites.items():
print('Processing suite {} (units: {})'.format(name, len(units)))
def if_failed(unit):
if unit['returncode'] != 0:
return True
return False
def if_succeded(unit):
if unit['returncode'] == 0:
return True
return False
successes = list(filter(if_succeded, units))
failures = list(filter(if_failed, units))
print(' - {}: {} pass, {} fail'.format(name, len(successes), len(failures)))
testsuite = ET.SubElement(testsuites, 'testsuite')
testsuite.set('name', '{}/{}'.format(args.project_name, name))
testsuite.set('tests', str(len(units)))
testsuite.set('errors', str(len(failures)))
testsuite.set('failures', str(len(failures)))
for unit in successes:
testcase = ET.SubElement(testsuite, 'testcase')
testcase.set('classname', '{}/{}'.format(args.project_name, unit['suite']))
testcase.set('name', unit['name'])
testcase.set('time', str(unit['duration']))
for unit in failures:
testcase = ET.SubElement(testsuite, 'testcase')
testcase.set('classname', '{}/{}'.format(args.project_name, unit['suite']))
testcase.set('name', unit['name'])
testcase.set('time', str(unit['duration']))
failure = ET.SubElement(testcase, 'failure')
failure.set('classname', '{}/{}'.format(args.project_name, unit['suite']))
failure.set('name', unit['name'])
failure.set('type', 'error')
failure.text = unit['stdout']
output = ET.tostring(testsuites, encoding='unicode')
outfile.write(output)

View File

@@ -1,11 +0,0 @@
#!/bin/bash
set -e
TAG="registry.gitlab.gnome.org/gnome/gtk/master:v7"
sudo docker build --build-arg HOST_USER_ID="$UID" --tag "${TAG}" \
--file "Dockerfile" .
sudo docker run --rm --security-opt label=disable \
--volume "$(pwd)/..:/home/user/app" --workdir "/home/user/app" \
--tty --interactive "${TAG}" bash

View File

@@ -1,56 +0,0 @@
#!/bin/bash
set -e
srcdir=$(pwd)
mkdir -p _ccache
export CCACHE_BASEDIR="$(pwd)"
export CCACHE_DIR="${CCACHE_BASEDIR}/_ccache"
ccache --zero-stats
ccache --show-stats
export CCACHE_DISABLE=true
meson \
-Dx11-backend=true \
-Dwayland-backend=true \
-Dbroadway-backend=true \
-Dvulkan=yes \
-Dprofiler=true \
--werror \
${EXTRA_MESON_FLAGS:-} \
_build $srcdir
unset CCACHE_DISABLE
cd _build
ninja
ccache --show-stats
set +e
xvfb-run -a -s "-screen 0 1024x768x24" \
meson test \
--timeout-multiplier 2 \
--print-errorlogs \
--suite=gtk \
--no-suite=gtk:a11y
# Save the exit code
exit_code=$?
# We always want to run the report generators
$srcdir/.gitlab-ci/meson-junit-report.py \
--project-name=gtk \
--job-id="${CI_JOB_NAME}" \
--output=report.xml \
meson-logs/testlog.json
$srcdir/.gitlab-ci/meson-html-report.py \
--project-name=GTK \
--job-id="${CI_JOB_NAME}" \
--reftest-output-dir="testsuite/reftests/output" \
--output=report.html \
meson-logs/testlog.json
exit $exit_code

View File

@@ -1,58 +0,0 @@
#!/bin/bash
set -e
if [[ "$MSYSTEM" == "MINGW32" ]]; then
export MSYS2_ARCH="i686"
else
export MSYS2_ARCH="x86_64"
fi
# Update everything
pacman --noconfirm -Suy
# Install the required packages
pacman --noconfirm -S --needed \
base-devel \
git \
mingw-w64-$MSYS2_ARCH-toolchain \
mingw-w64-$MSYS2_ARCH-ccache \
mingw-w64-$MSYS2_ARCH-pkg-config \
mingw-w64-$MSYS2_ARCH-gobject-introspection \
mingw-w64-$MSYS2_ARCH-meson \
mingw-w64-$MSYS2_ARCH-adwaita-icon-theme \
mingw-w64-$MSYS2_ARCH-atk \
mingw-w64-$MSYS2_ARCH-cairo \
mingw-w64-$MSYS2_ARCH-gdk-pixbuf2 \
mingw-w64-$MSYS2_ARCH-glib2 \
mingw-w64-$MSYS2_ARCH-graphene \
mingw-w64-$MSYS2_ARCH-json-glib \
mingw-w64-$MSYS2_ARCH-libepoxy \
mingw-w64-$MSYS2_ARCH-pango \
mingw-w64-$MSYS2_ARCH-fribidi \
mingw-w64-$MSYS2_ARCH-gst-plugins-bad \
mingw-w64-$MSYS2_ARCH-shared-mime-info
# https://gitlab.gnome.org/GNOME/gtk/issues/2243
wget "https://gitlab.gnome.org/creiter/gitlab-ci-win32-runner/raw/master/pango/mingw-w64-$MSYS2_ARCH-pango-1.44.7-1-any.pkg.tar.xz"
pacman --noconfirm -U "mingw-w64-$MSYS2_ARCH-pango-1.44.7-1-any.pkg.tar.xz"
mkdir -p _ccache
export CCACHE_BASEDIR="$(pwd)"
export CCACHE_DIR="${CCACHE_BASEDIR}/_ccache"
# Build
ccache --zero-stats
ccache --show-stats
export CCACHE_DISABLE=true
meson \
-Dx11-backend=false \
-Dwayland-backend=false \
-Dwin32-backend=true \
-Dvulkan=no \
--werror \
_build
unset CCACHE_DISABLE
ninja -C _build
ccache --show-stats

View File

@@ -1,36 +0,0 @@
## Steps to reproduce
1. ...
2. ...
3. ...
<!--
You should try and reproduce with the demos applications available
under the `demos` directory, or the test programs in the `tests` directory.
Alternatively, please attach a *small and self-contained* example
*written in C* that exhibits the issue.
-->
## Current behavior
<!--
Please describe the current behaviour
-->
## Expected outcome
<!--
Please describe the expected outcome
-->
## Version information
<!--
- Which version of GTK you are using
- What operating system and version
- For Linux, which distribution
- If you built GTK yourself, the list of options used to configure the build
-->
## Additional information
<!--
- Screenshots or screen recordings are useful for visual errors
- Please report any warning or message printed on the terminal
-->

View File

@@ -1,34 +0,0 @@
## Steps to reproduce
1. ...
2. ...
3. ...
<!--
You should try and reproduce with the demos applications available
under the `demos` directory, or the test programs in the `tests` directory.
Alternatively, please attach a *small and self-contained* example that
exhibits the issue.
-->
## Version information
<!--
- Which version of GTK you are using
- What operating system and version
- for Linux, which distribution
- If you built GTK yourself, the list of options used to configure the build
-->
## Warnings
<!--
- If the application generates warning messages before crashing please
report them here
-->
## Backtrace
<!--
- Attaching a stack trace obtained using GDB is appreciated; follow the
instructions on the wiki:
https://wiki.gnome.org/Community/GettingInTouch/Bugzilla/GettingTraces
-->

39
AUTHORS
View File

@@ -1,12 +1,12 @@
Please do not mail any of the authors listed here
asking questions about this version of GTK+.
Original Authors
----------------
Peter Mattis <petm@xcf.berkeley.edu>
Spencer Kimball <spencer@xcf.berkeley.edu>
Josh MacDonald <jmacd@xcf.berkeley.edu>
Please do not mail the original authors asking questions about this
version of GTK+.
The GTK+ Team (in alphabetical order)
-------------------------------------
Shawn T. Amundson <amundson@gtk.org>
@@ -30,36 +30,3 @@ Owen Taylor <otaylor@gtk.org>
There are many others who have contributed patches; we thank them,
GTK+ is much better because of them.
Over time, GTK+ has incorporated some pieces of software which
started as independent projects. We list the original authors here:
MS-Windows theme engine
-----------------------
Raymond Penners
Dom Lachowicz
Pixbuf theme engine
-------------------
Owen Taylor
IME input method
----------------
Takuro Ashie
Kazuki IWAMOTO
Mac OS X backend
----------------
Anders Carlsson
DirectFB backend
----------------
Denis Oliver Kropp
Sven Neumann
Mike Emmel

View File

@@ -1,266 +0,0 @@
# Contribution guidelines
Thank you for considering contributing to the GTK project!
These guidelines are meant for new contributors, regardless of their level
of proficiency; following them allows the maintainers of the GTK project to
more effectively evaluate your contribution, and provide prompt feedback to
you. Additionally, by following these guidelines you clearly communicate
that you respect the time and effort that the people developing GTK put into
managing the project.
GTK is a complex free software GUI toolkit, and it would not exist without
contributions from the free and open source software community. There are
many things that we value:
- bug reporting and fixing
- documentation and examples
- tests
- new features
Please, do not use the issue tracker for support questions. If you have
questions on how to use GTK effectively, you can use:
- the `#gtk` IRC channel on irc.gnome.org
- the [gtk](https://mail.gnome.org/mailman/listinfo/gtk-list) mailing list,
for general questions on GTK
- the [gtk-app-devel](https://mail.gnome.org/mailman/listinfo/gtk-app-devel-list)
mailing list, for questions on application development with GTK
- the [gtk-devel](https://mail.gnome.org/mailman/listinfo/gtk-devel-list)
mailing list, for questions on developing GTK itself
You can also look at the GTK tag on [Stack
Overflow](https://stackoverflow.com/questions/tagged/gtk).
The issue tracker is meant to be used for actionable issues only.
## How to report bugs
### Security issues
You should not open a new issue for security related questions.
When in doubt, send an email to the [security](mailto:security@gnome.org)
mailing list.
### Bug reports
If you're reporting a bug make sure to list:
0. which version of GTK are you using?
0. which operating system are you using?
0. the necessary steps to reproduce the issue
0. the expected outcome
0. a description of the behavior; screenshots are also welcome
0. a small, self-contained example exhibiting the behavior; if this
is not available, try reproducing the issue using the GTK examples
or interactive tests
If the issue includes a crash, you should also include:
0. the eventual warnings printed on the terminal
0. a backtrace, obtained with tools such as GDB or LLDB
For small issues, such as:
- spelling/grammar fixes in the documentation
- typo correction
- comment clean ups
- changes to metadata files (CI, `.gitignore`)
- build system changes
- source tree clean ups and reorganizations
You should directly open a merge request instead of filing a new issue.
### Features and enhancements
Feature discussion can be open ended and require high bandwidth channels; if
you are proposing a new feature on the issue tracker, make sure to make
an actionable proposal, and list:
0. what you're trying to achieve
0. prior art, in other toolkits or applications
0. design and theming changes
If you're proposing the integration of new features it helps to have
multiple applications using shared or similar code, especially if they have
iterated over it various times.
Each feature should also come fully documented, and with tests.
## Your first contribution
### Prerequisites
If you want to contribute to the GTK project, you will need to have the
development tools appropriate for your operating system, including:
- Python 3.x
- Meson
- Ninja
- Gettext (19.7 or newer)
- a [C99 compatible compiler](https://wiki.gnome.org/Projects/GLib/CompilerRequirements)
Up-to-date instructions about developing GNOME applications and libraries
can be found on [the GNOME Developer Center](https://developer.gnome.org).
The GTK project uses GitLab for code hosting and for tracking issues. More
information about using GitLab can be found [on the GNOME
wiki](https://wiki.gnome.org/GitLab).
### Dependencies
In order to get GTK from Git installed on your system, you need to have the
required versions of all the software dependencies required by GTK; typically,
this means a recent version of GLib, Cairo, Pango, and ATK, as well as the
platform-specific dependencies for the windowing system you are using (Wayland,
X11, Windows, or macOS).
The core dependencies for GTK are:
- [GLib, GObject, and GIO](https://gitlab.gnome.org/GNOME/glib)
- [Cairo](http://cairographics.org)
- [Pango](https://gitlab.gnome.org/GNOME/pango)
- [GdkPixbuf](https://gitlab.gnome.org/GNOME/gdk-pixbuf)
- [Epoxy](https://github.com/anholt/libepoxy)
- [ATK](https://gitlab.gnome.org/GNOME/atk)
- [Graphene](https://github.com/ebassi/graphene)
GTK will attempt to download and build some of these dependencies if it
cannot find them on your system.
Additionally, you may want to look at projects that create a development
environment for you, like [jhbuild](https://wiki.gnome.org/HowDoI/Jhbuild)
and [gvsbuild](https://github.com/wingtk/gvsbuild).
### Getting started
You should start by forking the GTK repository from the GitLab web UI, and
cloning from your fork:
```sh
$ git clone https://gitlab.gnome.org/yourusername/gtk.git
$ cd gtk
```
**Note**: if you plan to push changes to back to the main repository and
have a GNOME account, you can skip the fork, and use the following instead:
```sh
$ git clone git@gitlab.gnome.org:GNOME/gtk.git
$ cd gtk
```
To compile the Git version of GTK on your system, you will need to
configure your build using Meson:
```sh
$ meson _builddir .
$ cd _builddir
$ ninja
```
Typically, you should work on your own branch:
```sh
$ git checkout -b your-branch
```
Once you've finished working on the bug fix or feature, push the branch
to the Git repository and open a new merge request, to let the GTK
maintainers review your contribution.
### Code reviews
Each contribution is reviewed by the core developers of the GTK project.
The [CODEOWNERS](./docs/CODEOWNERS) document contains the list of core
contributors to GTK and the areas for which they are responsible; you
should ensure to receive their review and signoff on your changes.
### Commit messages
The expected format for git commit messages is as follows:
```plain
Short explanation of the commit
Longer explanation explaining exactly what's changed, whether any
external or private interfaces changed, what bugs were fixed (with bug
tracker reference if applicable) and so forth. Be concise but not too
brief.
Closes #1234
```
- Always add a brief description of the commit to the _first_ line of
the commit and terminate by two newlines (it will work without the
second newline, but that is not nice for the interfaces).
- First line (the brief description) must only be one sentence and
should start with a capital letter unless it starts with a lowercase
symbol or identifier. Don't use a trailing period either. Don't exceed
72 characters.
- The main description (the body) is normal prose and should use normal
punctuation and capital letters where appropriate. Consider the commit
message as an email sent to the developers (or yourself, six months
down the line) detailing **why** you changed something. There's no need
to specify the **how**: the changes can be inlined.
- When committing code on behalf of others use the `--author` option, e.g.
`git commit -a --author "Joe Coder <joe@coder.org>"` and `--signoff`.
- If your commit is addressing an issue, use the
[GitLab syntax](https://docs.gitlab.com/ce/user/project/issues/automatic_issue_closing.html)
to automatically close the issue when merging the commit with the upstream
repository:
```plain
Closes #1234
Fixes #1234
Closes: https://gitlab.gnome.org/GNOME/gtk/issues/1234
```
- If you have a merge request with multiple commits and none of them
completely fixes an issue, you should add a reference to the issue in
the commit message, e.g. `Bug: #1234`, and use the automatic issue
closing syntax in the description of the merge request.
### Commit access to the GTK repository
GTK is part of the GNOME infrastructure. At the current time, any
person with write access to the GNOME repository can merge changes to
GTK. This is a good thing, in that it encourages many people to work
on GTK, and progress can be made quickly. However, GTK is a fairly
large and complicated project on which many other things depend, so to
avoid unnecessary breakage, and to take advantage of the knowledge
about GTK that has been built up over the years, we'd like to ask
people committing to GTK to follow a few rules:
0. Ask first. If your changes are major, or could possibly break existing
code, you should always ask. If your change is minor and you've been
working on GTK for a while it probably isn't necessary to ask. But when
in doubt, ask. Even if your change is correct, somebody may know a
better way to do things. If you are making changes to GTK, you should
be subscribed to the [gtk-devel](https://mail.gnome.org/mailman/listinfo/gtk-devel-list)
mailing list; this is a good place to ask about intended changes.
The `#gtk` IRC channel on irc.gnome.org is also a good place to find GTK
developers to discuss changes, but if you live outside of the EU/US time
zones, an email to the gtk-devel mailing list is the most certain and
preferred method.
0. Ask _first_.
0. Always write a meaningful commit message. Changes without a sufficient
commit message will be reverted.
0. Never push to the `master` branch, or any stable branches, directly; you
should always go through a merge request, to ensure that the code is
tested on the CI infrastructure at the very least. A merge request is
also the proper place to get a comprehensive code review from the core
developers of GTK.
If you have been contributing to GTK for a while and you don't have commit
access to the repository, you may ask to obtain it following the [GNOME account
process](https://wiki.gnome.org/AccountsTeam/NewAccounts).

19
COPYING
View File

@@ -1,15 +1,15 @@
GNU LIBRARY GENERAL PUBLIC LICENSE
Version 2, June 1991
GNU LIBRARY GENERAL PUBLIC LICENSE
Version 2, June 1991
Copyright (C) 1991 Free Software Foundation, Inc.
51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
Everyone is permitted to copy and distribute verbatim copies
of this license document, but changing it is not allowed.
[This is the first released version of the library GPL. It is
numbered 2 because it goes with version 2 of the ordinary GPL.]
Preamble
Preamble
The licenses for most software are designed to take away your
freedom to share and change it. By contrast, the GNU General Public
@@ -99,7 +99,7 @@ works together with the library.
Note that it is possible for a library to be covered by the ordinary
General Public License rather than by this special one.
GNU LIBRARY GENERAL PUBLIC LICENSE
GNU LIBRARY GENERAL PUBLIC LICENSE
TERMS AND CONDITIONS FOR COPYING, DISTRIBUTION AND MODIFICATION
0. This License Agreement applies to any software library which
@@ -411,7 +411,7 @@ decision will be guided by the two goals of preserving the free status
of all derivatives of our free software and of promoting the sharing
and reuse of software generally.
NO WARRANTY
NO WARRANTY
15. BECAUSE THE LIBRARY IS LICENSED FREE OF CHARGE, THERE IS NO
WARRANTY FOR THE LIBRARY, TO THE EXTENT PERMITTED BY APPLICABLE LAW.
@@ -434,7 +434,7 @@ FAILURE OF THE LIBRARY TO OPERATE WITH ANY OTHER SOFTWARE), EVEN IF
SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH
DAMAGES.
END OF TERMS AND CONDITIONS
END OF TERMS AND CONDITIONS
How to Apply These Terms to Your New Libraries
@@ -463,8 +463,9 @@ convey the exclusion of warranty; and each file should have at least the
Library General Public License for more details.
You should have received a copy of the GNU Library General Public
License along with this library; if not, write to the Free Software
Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
License along with this library; if not, write to the
Free Software Foundation, Inc., 59 Temple Place - Suite 330,
Boston, MA 02111-1307 USA.
Also add information on how to contact you by electronic and paper mail.

12613
ChangeLog Normal file

File diff suppressed because it is too large Load Diff

4961
ChangeLog.pre-1-0 Normal file

File diff suppressed because it is too large Load Diff

12613
ChangeLog.pre-2-0 Normal file

File diff suppressed because it is too large Load Diff

12613
ChangeLog.pre-2-10 Normal file

File diff suppressed because it is too large Load Diff

12613
ChangeLog.pre-2-2 Normal file

File diff suppressed because it is too large Load Diff

12613
ChangeLog.pre-2-4 Normal file

File diff suppressed because it is too large Load Diff

12613
ChangeLog.pre-2-6 Normal file

File diff suppressed because it is too large Load Diff

12613
ChangeLog.pre-2-8 Normal file

File diff suppressed because it is too large Load Diff

55
HACKING Normal file
View File

@@ -0,0 +1,55 @@
If you want to hack on the Gtk+ project, it will make you life easier
to have the following packages installed:
- GNU autoconf 2.13
- GNU automake 1.4
(Beta releases are at ftp://ftp.cygnus.com/pub/tromey)
- GNU libtool 1.2d
- indent (GNU indent 1.9.1 is known good)
- GNU gettext 10.35
Available in ftp://alpha.gnu.org/gnu
These should be available by ftp from ftp.gnu.org or any of the
fine GNU mirrors. Beta software can be found at alpha.gnu.org.
In order to get CVS gtk+ installed on your system, you need to have
the most recent CVS version of glib installed as well.
The installation process of glib is similar to that of gtk+, but
needs to be fulfilled prior to installation of gtk+.
To compile a CVS version of gtk+ on your system, you will need to take
several steps to setup the tree for compilation. You can do all these
steps at once by running:
cvsroot/gtk+# ./autogen.sh
Basically this does the following for you:
cvsroot/gtk+# aclocal; automake; autoconf
The above commands create the "configure" script. Now you
can run the configure script in cvsroot/gtk+ to create all
the Makefiles.
Before running autogen.sh or configure, make sure you have libtool
in your path.
Note that autogen.sh runs configure for you. If you wish to pass
options like --prefix=/usr to configure you can give those options
to autogen.sh and they will be passed on to configure.
If at all possible, please use CVS to get the latest development version of
gtk+ and glib. You can do the following to get glib and gtk+ from cvs:
$ export CVSROOT=':pserver:anonymous@cvs.gnome.org:/cvs/gnome'
$ cvs login
(there is no password, just hit return)
$ cvs -z3 checkout glib
$ cvs -z3 checkout gtk+
For information about submitting patches and commiting changes
to CVS, see the README and README.cvs-commits files. In particular,
don't, under any circumstances, commit anything to CVS before
reading and understanding README.cvs-commmits.

218
INSTALL Normal file
View File

@@ -0,0 +1,218 @@
Prerequisites
=============
GTK+ requires the GLIB library, available at the same location as
you got this package.
Simple install procedure
========================
% gzip -cd gtk+-1.2.10.tar.gz | tar xvf - # unpack the sources
% cd gtk+-1.2.10 # change to the toplevel directory
% ./configure # run the `configure' script
% make # build GTK
[ Become root if necessary ]
% rm -rf /install-prefix/include/gtk /install-prefix/include/gdk
% make install # install GTK
Special note for GTK+-1.2.9
===========================
Between GTK+-1.2.8 and GTK+-1.2.9, the include files for GTK+
have been moved to $(includedir)/gtk-1-2/ to allow parallel installations
of GTK+-1.2 and GTK+-2.0 to work correctly. If you are installing
on top of an old installation of GTK+, you should remove the directories:
$(includedir)/gtk/
$(includedir)/gdk/
Before running 'make install'
The Nitty-Gritty
================
The 'configure' script can be given a number of options to enable
and disable various features. For a complete list, type:
./configure --help
A few of the more important ones:
* --prefix=PREFIX install architecture-independent files in PREFIX
[ Defaults to /usr/local ]
* --exec-prefix=EPREFIX install architecture-dependent files in EPREFIX
[ Defaults to the value given to --prefix ]
* --with-xinput=[no/gxi/xfree] support XInput [default=no]
The --with-xinput flag specifies whether to compile with support
for the XInput extension (mainly used for graphics tablets), and
which form of support to use:
no : no support
xfree : Use special features in the Wacom drivers in XFree86 3.3.1
and later.
gxi : Use generic XInput support (not recommended)
The XInput support is not known to work with any other XServer than
XFree86. For more information about XInput, see:
http://www.gtk.org/~otaylor/xinput/howto/index.html
http://www.lepied.com/xfree86/
* --disable-nls do not use Native Language Support
If this flag is not specified, GTK+ will try to find
and use the gettext() set of functions to provide translations
of the strings in the standard dialogs into the
user's native language.
* --enable-xim support XIM [default=yes]
Specifying --disable-xim will disable support for entering
internationalized text using X Input Methods. This will give some
slight savings in speed and memory use and might be necessary
with older versions of X.
* --with-locale=LOCALE locale name you want to use
The --with-locale options is used to determine if your operating
system has support for the locale you will be using. If not, X's
built in locale support will be used.
Because of bugs in autoconf, it is necessary to specify this
option even if your LANG environment variable is correctly set.
This option does not determine which locale GTK will use at
runtime. That will be determined from the usual environment
variables. If you will be using multiple locales with GTK,
specify the one for which your operating system has the worst
support for the --with-locale option.
* --with-native-locale=[yes/no] Use native locale support
If set, GTK+ will use your C library's native locale support,
instead of making conversions between wide characters and
multibyte-strings by going through Xlib's property-conversion
functions. Specifying this flag can speed up some operations
involving text by between 5 and 20 times.
This defaults to no, because it has not extensively been
tested for portability, but should be safe on most modern
systems.
Options can be given to the compiler and linker by setting
environment variables before running configure. A few of the more
important ones:
CC : The C compiler to use
CPPFLAGS : Flags for the C preprocesser such as -I and -D
CFLAGS : C compiler flags
The most important use of this is to set the
optimization/debugging flags. For instance, to compile with no
debugging information at all, run configure as:
CFLAGS=-O2 ./configure # Bourne compatible shells (sh/bash/zsh)
or,
setenv CFLAGS -O2 ; ./configure # csh and variants
Native-Language Support and gettext()
=====================================
To provide native-language support (NLS) GTK+ uses the
gettext() set of functions. These functions are found
in the C library on many systems, such as the Solaris
C library and the GNU C Library, version 2.
If your C library does not provide the necessary functionality,
you may wish to install the GNU gettext package. You'll
need version 0.10.35 or better. Version 0.10.35 is
available from ftp://alpha.gnu.org/pub/gnu
Generally, GTK+ will properly detect what is installed
on your system and enable or disable NLS as appropriate.
However, in rare cases, it may be necessary to disable
NLS manually to get GTK+ to compile. You can do this
by specifying the --disable-nls flag when configuring
GTK+.
Using an uninstalled copy of GLIB [ Unsupported ]
=================================================
You can compile GTK+ against a copy of GLIB that you have not
yet installed. To do this, give the --with-glib=DIR options
to ./configure. For instance:
./configure --with-glib=../glib-1.2.10
This, however, will not work if you built GLIB with different
source and build directories.
It is recommended that you install GLIB before compiling
GTK+. The --with-glib option is not regularly tested
and may not function correctly. In addition,
inter-library dependencies won't be generated when
using --with-glib=.
Installation directories
========================
The location of the installed files is determined by the --prefix
and --exec-prefix options given to configure. There are also more
detailed flags to control individual directories. However, the
use of these flags is not tested.
One particular detail to note, is that the architecture-dependent
include file glibconfig.h is installed in:
$exec_pref/lib/glib/include/
if you have a version in $prefix/include, this is out of date
and should be deleted.
A shell script gtk-config is created during the configure
process, and installed in the bin/ directory
($exec_prefix/bin). This is used to determine the location of GTK
when building applications. If you move GTK after installation,
it will be necessary to edit this file.
For complete details, see the file docs/gtk-config.txt
Notes for using XIM support for Japanese input
==============================================
* There is a bug in older versions of kinput2 that will cause GTK+
to hang when destroying a text entry. The latest versions of
kinput is available from:
ftp://ftp.sra.co.jp/pub/x11/kinput2
* The locale information file for the ja_JP EUC locale
distributed with some recent versions of X11 specifies to use the
C library multibyte functions. Unless your C library has support
for Japanese locales, this is incorrect, and will cause problems
for GTK's internationalization.
(In particular, this occurs with GNU libc 2.0 in which
the multibyte functions always translate to and from UTF-8; but
the problem may occur for other C libraries, and other operating
systems as well.)
To fix this, change the line:
use_stdc_env True
to
use_stdc_env False
in the file /usr/X11R6/lib/X11/locale/ja_JP/XLC_LOCALE.

218
INSTALL.in Normal file
View File

@@ -0,0 +1,218 @@
Prerequisites
=============
GTK+ requires the GLIB library, available at the same location as
you got this package.
Simple install procedure
========================
% gzip -cd gtk+-@GTK_VERSION@.tar.gz | tar xvf - # unpack the sources
% cd gtk+-@GTK_VERSION@ # change to the toplevel directory
% ./configure # run the `configure' script
% make # build GTK
[ Become root if necessary ]
% rm -rf /install-prefix/include/gtk /install-prefix/include/gdk
% make install # install GTK
Special note for GTK+-1.2.9
===========================
Between GTK+-1.2.8 and GTK+-1.2.9, the include files for GTK+
have been moved to $(includedir)/gtk-1-2/ to allow parallel installations
of GTK+-1.2 and GTK+-2.0 to work correctly. If you are installing
on top of an old installation of GTK+, you should remove the directories:
$(includedir)/gtk/
$(includedir)/gdk/
Before running 'make install'
The Nitty-Gritty
================
The 'configure' script can be given a number of options to enable
and disable various features. For a complete list, type:
./configure --help
A few of the more important ones:
* --prefix=PREFIX install architecture-independent files in PREFIX
[ Defaults to /usr/local ]
* --exec-prefix=EPREFIX install architecture-dependent files in EPREFIX
[ Defaults to the value given to --prefix ]
* --with-xinput=[no/gxi/xfree] support XInput [default=no]
The --with-xinput flag specifies whether to compile with support
for the XInput extension (mainly used for graphics tablets), and
which form of support to use:
no : no support
xfree : Use special features in the Wacom drivers in XFree86 3.3.1
and later.
gxi : Use generic XInput support (not recommended)
The XInput support is not known to work with any other XServer than
XFree86. For more information about XInput, see:
http://www.gtk.org/~otaylor/xinput/howto/index.html
http://www.lepied.com/xfree86/
* --disable-nls do not use Native Language Support
If this flag is not specified, GTK+ will try to find
and use the gettext() set of functions to provide translations
of the strings in the standard dialogs into the
user's native language.
* --enable-xim support XIM [default=yes]
Specifying --disable-xim will disable support for entering
internationalized text using X Input Methods. This will give some
slight savings in speed and memory use and might be necessary
with older versions of X.
* --with-locale=LOCALE locale name you want to use
The --with-locale options is used to determine if your operating
system has support for the locale you will be using. If not, X's
built in locale support will be used.
Because of bugs in autoconf, it is necessary to specify this
option even if your LANG environment variable is correctly set.
This option does not determine which locale GTK will use at
runtime. That will be determined from the usual environment
variables. If you will be using multiple locales with GTK,
specify the one for which your operating system has the worst
support for the --with-locale option.
* --with-native-locale=[yes/no] Use native locale support
If set, GTK+ will use your C library's native locale support,
instead of making conversions between wide characters and
multibyte-strings by going through Xlib's property-conversion
functions. Specifying this flag can speed up some operations
involving text by between 5 and 20 times.
This defaults to no, because it has not extensively been
tested for portability, but should be safe on most modern
systems.
Options can be given to the compiler and linker by setting
environment variables before running configure. A few of the more
important ones:
CC : The C compiler to use
CPPFLAGS : Flags for the C preprocesser such as -I and -D
CFLAGS : C compiler flags
The most important use of this is to set the
optimization/debugging flags. For instance, to compile with no
debugging information at all, run configure as:
CFLAGS=-O2 ./configure # Bourne compatible shells (sh/bash/zsh)
or,
setenv CFLAGS -O2 ; ./configure # csh and variants
Native-Language Support and gettext()
=====================================
To provide native-language support (NLS) GTK+ uses the
gettext() set of functions. These functions are found
in the C library on many systems, such as the Solaris
C library and the GNU C Library, version 2.
If your C library does not provide the necessary functionality,
you may wish to install the GNU gettext package. You'll
need version 0.10.35 or better. Version 0.10.35 is
available from ftp://alpha.gnu.org/pub/gnu
Generally, GTK+ will properly detect what is installed
on your system and enable or disable NLS as appropriate.
However, in rare cases, it may be necessary to disable
NLS manually to get GTK+ to compile. You can do this
by specifying the --disable-nls flag when configuring
GTK+.
Using an uninstalled copy of GLIB [ Unsupported ]
=================================================
You can compile GTK+ against a copy of GLIB that you have not
yet installed. To do this, give the --with-glib=DIR options
to ./configure. For instance:
./configure --with-glib=../glib-@GTK_VERSION@
This, however, will not work if you built GLIB with different
source and build directories.
It is recommended that you install GLIB before compiling
GTK+. The --with-glib option is not regularly tested
and may not function correctly. In addition,
inter-library dependencies won't be generated when
using --with-glib=.
Installation directories
========================
The location of the installed files is determined by the --prefix
and --exec-prefix options given to configure. There are also more
detailed flags to control individual directories. However, the
use of these flags is not tested.
One particular detail to note, is that the architecture-dependent
include file glibconfig.h is installed in:
$exec_pref/lib/glib/include/
if you have a version in $prefix/include, this is out of date
and should be deleted.
A shell script gtk-config is created during the configure
process, and installed in the bin/ directory
($exec_prefix/bin). This is used to determine the location of GTK
when building applications. If you move GTK after installation,
it will be necessary to edit this file.
For complete details, see the file docs/gtk-config.txt
Notes for using XIM support for Japanese input
==============================================
* There is a bug in older versions of kinput2 that will cause GTK+
to hang when destroying a text entry. The latest versions of
kinput is available from:
ftp://ftp.sra.co.jp/pub/x11/kinput2
* The locale information file for the ja_JP EUC locale
distributed with some recent versions of X11 specifies to use the
C library multibyte functions. Unless your C library has support
for Japanese locales, this is incorrect, and will cause problems
for GTK's internationalization.
(In particular, this occurs with GNU libc 2.0 in which
the multibyte functions always translate to and from UTF-8; but
the problem may occur for other C libraries, and other operating
systems as well.)
To fix this, change the line:
use_stdc_env True
to
use_stdc_env False
in the file /usr/X11R6/lib/X11/locale/ja_JP/XLC_LOCALE.

1
MAINTAINERS Normal file
View File

@@ -0,0 +1 @@
Email: gtk-bugs@gimp.org

141
Makefile.am Normal file
View File

@@ -0,0 +1,141 @@
## Makefile.am for GTK+
SRC_SUBDIRS = gdk gtk
SUBDIRS = po $(SRC_SUBDIRS) docs
bin_SCRIPTS = gtk-config
# require automake 1.4
AUTOMAKE_OPTIONS = 1.4
EXTRA_DIST = \
HACKING \
gtk+.spec.in \
gtk.m4 \
makecopyright \
TODO \
NEWS.pre-1-0 \
ChangeLog.pre-1-0 \
README.cvs-commits \
intl/libgettext.h \
intl/po2tbl.sed.in \
examples/aspectframe/Makefile \
examples/aspectframe/aspectframe.c \
examples/Makefile \
examples/README.1ST \
examples/extract.awk \
examples/extract.sh \
examples/base/Makefile \
examples/base/base.c \
examples/buttons/Makefile \
examples/buttons/buttons.c \
examples/buttons/info.xpm \
examples/calendar/Makefile \
examples/calendar/calendar.c \
examples/clist/Makefile \
examples/clist/clist.c \
examples/entry/Makefile \
examples/entry/entry.c \
examples/eventbox/Makefile \
examples/eventbox/eventbox.c \
examples/filesel/Makefile \
examples/filesel/filesel.c \
examples/gtkdial/Makefile \
examples/gtkdial/dial_test.c \
examples/gtkdial/gtkdial.c \
examples/gtkdial/gtkdial.h \
examples/helloworld/Makefile \
examples/helloworld/helloworld.c \
examples/helloworld2/Makefile \
examples/helloworld2/helloworld2.c \
examples/list/Makefile \
examples/list/list.c \
examples/menu/Makefile \
examples/menu/menu.c \
examples/menu/itemfactory.c \
examples/notebook/Makefile \
examples/notebook/notebook.c \
examples/packbox/Makefile \
examples/packbox/packbox.c \
examples/packer/Makefile \
examples/packer/pack.c \
examples/paned/Makefile \
examples/paned/paned.c \
examples/pixmap/Makefile \
examples/pixmap/pixmap.c \
examples/progressbar/Makefile \
examples/progressbar/progressbar.c \
examples/radiobuttons/Makefile \
examples/radiobuttons/radiobuttons.c \
examples/rangewidgets/Makefile \
examples/rangewidgets/rangewidgets.c \
examples/rulers/Makefile \
examples/rulers/rulers.c \
examples/scribble-simple/Makefile \
examples/scribble-simple/scribble-simple.c \
examples/scrolledwin/Makefile \
examples/scrolledwin/scrolledwin.c \
examples/selection/Makefile \
examples/selection/gettargets.c \
examples/selection/setselection.c \
examples/statusbar/Makefile \
examples/statusbar/statusbar.c \
examples/table/Makefile \
examples/table/table.c \
examples/text/Makefile \
examples/text/text.c \
examples/tictactoe/Makefile \
examples/tictactoe/tictactoe.c \
examples/tictactoe/tictactoe.h \
examples/tictactoe/ttt_test.c \
examples/tree/Makefile \
examples/tree/tree.c \
examples/wheelbarrow/Makefile \
examples/wheelbarrow/wheelbarrow.c \
examples/fixed/fixed.c \
examples/fixed/Makefile \
examples/frame/frame.c \
examples/frame/Makefile \
examples/spinbutton/spinbutton.c \
examples/spinbutton/Makefile \
examples/find-examples.sh \
gdk.pc.in gtk+.pc.in
pkgconfigdir = $(libdir)/pkgconfig
pkgconfig_DATA= gdk.pc gtk+.pc
dist-hook: gtk+.spec
if test -e $(srcdir)/INSTALL.in && test -e $(srcdir)/README.in ; then \
CONFIG_FILES="INSTALL:$(srcdir)/INSTALL.in README:$(srcdir)/README.in" \
CONFIG_HEADERS= \
$(SHELL) config.status \
&& cp INSTALL README $(distdir) ; \
fi \
&& cp gtk+.spec $(distdir)
m4datadir = $(datadir)/aclocal
m4data_DATA = gtk.m4
.PHONY: files release sanity snapshot
files:
@files=`ls $(DISTFILES) 2> /dev/null `; for p in $$files; do \
echo $$p; \
done
@for subdir in $(SUBDIRS); do \
files=`cd $$subdir; $(MAKE) files | grep -v "make\[[1-9]\]"`; \
for file in $$files; do \
echo $$subdir/$$file; \
done; \
done
release:
rm -rf .deps */.deps
$(MAKE) distcheck
sanity:
./sanity_check $(VERSION)
snapshot:
$(MAKE) dist distdir=$(PACKAGE)`date +"%y%m%d"`

8570
NEWS

File diff suppressed because it is too large Load Diff

View File

@@ -1,903 +0,0 @@
Overview of Changes in GTK+ 2.0.0
=================================
* GtkTreeView fixes [Jonathan Blandford, Kristian Rietveld, Darin Adler]
* Build fixes [Anders Carlsson, Tor Lillqvist, Manish Singh]
* Bug fixes. [Thomas Leonard, Owen Taylor]
Overview of Changes in GTK+ 2.0.0 rc1
=====================================
* GtkTreeView fixes [Kristian Rietveld, Jonathan Blandford, Richard Hult]
* Text widget fixes [Havoc Pennington]
* Efficiency fixes when using Xft [Owen Taylor]
* Key handling fixes and other fixes for Win32 [Hans Breuer, Tor Lillqvist]
* Try to fix key handling without XKEYBOARD extension [Owen]
* Documentation fixes and improvements
[Matthias Clasen, Alexey Malyshev, Akira Tagoh, Vitaly Tishkov]
* Widget drawing improvements [Soeren Sandmann]
* Allow cycling between multiple menu bars with <Control>Tab [Owen]
* Try to build libraries with only shared library dependencies on Xft to
deal with transition to Xft2 [Owen]
* Portability fixes [Owen, Miroslaw Dobrzanski-Neumann]
* Don't use red as the default cursor color [Owen]
* Bug fixes, bug fixes, bug fixes.
Other contributors: Darin Adler, Jacob Berkman, Kevin Breit, Hans Breuer,
Anders Carlsson, Damon Chaplin, Finlay Dobbie, Jody Goldberg,
Andreas J. Guelzow, Scott Guilbeaux, Vlad Harchev, James Henstridge,
Tim Janik, Satyajit Kanungo, Charles Kerr, Sergey Kuzminov, Miles Lane,
Alexander Larsson, Paolo Maggi, Skip Montaro, Jan Mynarik, Sven Neumann,
Padraig O'Briain, Narayani Pattipati, Mark Patton, Havoc Pennington,
Ettore Perazzoli, Guillermo S. Romero, Manish Singh, Morten Welinder
Overview of Changes in GTK+ 1.3.15
==================================
* New stock and improved icon images
[Tuomas Kuosmanen, Jakub Steiner, Anders Carlsson]
* Widget drawing improvements for check and radio buttons,
spinbuttons [Soeren Sandmann]
* Clean up module search path algorithm, use GTK_PATH [Owen Taylor]
* Add GtkSetting for font name. [Richard Hestilow]
* Much improved key matching code, accelerators work independent
of group [Owen]
* Make mnemonics work for embedded GtkPlug widgets [Owen]
* Keynav improvements for GtkTreeView [Kristian Rietveld]
* Fix gtk_tree_view_scroll_to_cell() [Jonathan Blandford]
* Rename gtk_tree_view_get_iter_root() and gtk_tree_path_new_root()
to gtk_tree_view_get_iter_first() and gtk_tree_path_new_first(),
add compatibility macros.
* GtkTreeView bug fixes [Kristian, Anders, Damon Chaplin]
* GtkTextView bug fixes [Havoc Pennington]
* Pad class structures for future binary compatibility [Owen]
* Tutorial improvements [Sven Neumann, Matthias Clasen]
* Fixes for MULTIPLE selection target [Gregory Merchan, Owen]
* Fix problems with initial widget size [Owen]
* AIX compilation fixes [Miroslaw Dobrzanski-Neumann]
* Win32 fixes [Hans Breuer, Tor Lillqvist]
* Miscellaneous bug fixes
Other contributors: David L. Cooper, Eric Fischer, Jody Goldberg,
Satajyit Kanungo, Thomas Leonard, Mark Patton, Manish Singh,
Nicolas Setton
Overview of Changes in GTK+ 1.3.14
==================================
* Keyboard focus improvements [Owen Taylor]
* Code cleanup [Matthias Clasen, Manish Singh, Darin Adler]
* Fix accidentally exported variables [Mark McLoughlin]
* GtkTreeView fixes [Jonathan Blandford, Kristian Rietveld, John Harper, Darin]
* Default to yellow tooltips [Owen]
* RC file fixes for reloading, priorities [Owen, Matthias]
* GtkMenu behavior improvements and bug fixes [Owen, Arnaud Charlet]
* GtkTextView fixes [Havoc Pennington, Daniel Elstner, Dennis Bjorklund]
* Improve keynav for paned widgets, tooltips, spin buttons, notebooks,
scrolled windows [Soeren Sandmann, Padraig, Owen]
* Add Emacs/Default key themes [Owen]
* Win32 fixes [Hans Breuer, Tor Lillqvist]
* Ethiopic input methods [Daniel Yacob]
* Opaque paned window resizing [Soeren]
* Tweak table expansion behavior [Tim Janik]
* Fix GtkCalendar focus drawing [Bill Haneman]
* Allow themeable cursor thickness [Bill]
* Start of fixing of tutorial for GTK+-2.0 [Matthias]
* Add a ::adjust-bounds signal to GtkRange to allow spreadsheet style
scrollbars. [Jody Goldberg]
* Add the ability to turn on multiple selection for GtkFileSel [Manish]
* Bug fixes
Other contributors: Jacob Berkman, Padraig O'Briain, Anders Carlsson,
Johan Dahlin, Richard Hult, Stefan Kost, Alex Larsson, Thomas Leonard,
Paolo Maggi, Alexey Malyshev, Federico Mena Quintero, Skip Montaro,
Sven Neumann, Havoc Pennington, Laszlo Peter, Christian Rose, Joe Shaw,
Kevin Vandersloot, Morten Welinder, Peter Williams
Overview of Changes in GTK+ 1.3.13
==================================
* Tree view fixes. [Kristian Rietveld, Jonathan Blandford, Anders Carlsson]
* Tree view support for low-vision themes [Bill Haneman]
* Text view bug fixes. [Havoc Pennington]
* Win32 fixes and improvements. [Tor Lillqvist, Hans Breuer,
Archaeopteryx Software]
* Documentation improvements [Matthias Clasen, Havoc Pennington]
* Accelerate alpha compositing using RENDER extension if present,
and optimize the non-RENDER case a lot. [Owen Taylor]
* Add support for "optional keybindings" (action signal returns FALSE) [Owen]
* Fixed the infamous changing directory deletes filename bug
[Owen and a cast of thousands]
* Add mouse cursor hiding for text widgets [Anders Carlsson]
* Simple Hangul input module [Yusuke Tabata]
* Removed the scary startup warning.
* GdkPixbuf pixel handling fixes [Owen, Michael Hore, Jim Cape]
* Converted GtkFileSelection and GtkFontSelection to use GtKTreeView widgets
instead of the deprecated GtkCList [Owen]
* gtkhsv.h was installed by mistake, fixed that. [reported by Ross Burton]
* gdk_pixbuf_render_to_drawable() now also handles alpha pixbufs.
* Made Gtkimage draw GtkPixmap, GtkImage, GdkPixbuf insensitive, prelighted,
etc. [Havoc, Owen]
* Marked gtk_item_factory_path_from_widget() G_CONST_RETURN. [Matt Wilson]
* gtk_image_menu_item_new_from_stock() now falls back to
new_with_mnemonic, for consistency with gtk_button_new_from_stock()
[Havoc Pennington]
* GdkModifierType is now consistently used for modifier mask parameters
[Mark Patton]
* gtk_widget_set_accel_path() is now publically exported.
Other contributors: Darin Adler, Jeffrey Baker, Damon Chaplin, Brian Cameron,
Murray Cumming, James Henstridge, Jacob Berkman, Arnaud Charlet, Jeff Franks,
Jeff Garzik, Jody Goldberg, Diego Gonzalez, Melvin Hadasht, Raja Harinath,
Tim Janik, Mike Kestner, Mathieu Lacage, Alex Larsson, Ryan Lovett,
Mark McLoughlin, Sven Neumann, Padraig O'Briain, Xavier Ordoquy, Chris Phelps,
Detlef Reichl, Guillermo S. Romero, Federico Mena Quintero, Manish Singh,
HideToshi Tajima, Vitaly Tishkov, Jon Trowbridge, Sergey Vlasov.
Overview of Changes in GTK+ 1.3.12
==================================
* Fix problems with PNG saving [Michael Natterer]
* Cleanups of deprecated usages [Sebastian Wilhelmi]
* Win32 fixes [Tor Lillqvist]
* Documentation improvements [Matthias Clasen, Havoc Pennington,
Vitaly Tishkov]
* Frame buffer port fixes [Manish Singh]
* GtkTextView bug fixes [Havoc Pennington, Chris Phelps]
* Menu behavior improvements [Kristian Rietveld]
* Make focus line width configurable, focus color work on
dark themes. [Bill Haneman, Owen Taylor]
* Add state argument to gtk_paint_focus() [Bill]
* Added incremental revalidation to tree view, for better apparent speed
[Jonathan Blandford]
* Remove useless gtk_tree_view_column_cell_event() [Jonathan]
* Display XIM status in a separate window [HideToshi Tajima]
* Add GDK_DEBUG=nograbs to disable pointer, keyboard grabs [Jacob Berkman]
* Add menu of Unicode control characters to GtkEntry, GtkTextView
[Dov Grobgeld, Havoc]
* Pass key releases along to input methods [Owen]
* Many bug fixes
Other contributors: Darin Adler, Fabrice Bellet, Chris Blizzard,
Hans Breuer, Anders Carlsson, Damon Chaplin, Murray Cumming, Jeff Franks,
James Henstridge, Tim Janik, Alex Larsson, George Lebl, Kjartan, Maraas,
Sven Neumann, Seth Nickell, Padraig O'Briain, Soeren Sandmann, Manish Singh,
Matt Wilson
Overview of Changes in GTK+ 1.3.11
==================================
* Massive rework of accelerator API and implementation (Tim Janik)
* Major fixes to resizing and redrawing to eliminate hysteresis
and optimize. (Owen Taylor, Soeren Sandmann)
* Make many widgets NO_WINDOW to improve appearance and reduce
drawing overhead (Owen)
* Text view fixes (Havoc Pennington)
* Make child widgets in GtkTextView work (Havoc)
* GtkTreeModelSort fixage (Jonathan Blandford, Kristian Rietveld)
* Clean up GtkTreeView drag and drop support (Owen)
* Misc tree view fixes and improvements (Jonathan, Kristian, Anders, Matt Wilson)
* Add gtk_window_get/set_focus(), gtk_window_set_default() as public
functions (Owen, Damian Ivereigh)
* Fixes to GtkPlug/GtkSocket (Michael Meeks, Owen)
* Change button ordering in standard dialogs to correspond to
GNOME usability project proposal (Gregory Merchan)
* Add support for context sensitivity in input methods (Owen)
* Hook up gtk_im_context_set_use_preedit() (Hidetoshi Tajima)
* Fix gdk_window_scroll() and other aspects of big windows (Owen)
* Remove need for X connection for class initialization (Jacob Berkman)
* Propagate key events to parents of focused widget (Owen)
* Don't export normal GTK+ marshalers, export deprecated compat marshalers (Owen)
* Many Win32 Fixes and improvements (Hans Breuer, Tor Lillqvist)
* Bug and documentation fixing (Matthias Clasen, Anders Carlsson,
Jacob Berkman, others.)
Other Contributors:
Darin Adler, Marius Andreiana, Erwann Chenede, Murray Cumming, Janet Davis,
Daniel Egger, Daniel Elstner, Jeff Franks, Alex Larsson, George Lebl,
Sergey Kuzminov, Eric Lemings, Arkadiusz Miskiewicz, Padraig O'Briain, Sven Neumann,
Kristian Rietveld, Nicolas Setton, Manish Singh, Vitaly Tishkov, Sebastian Wilhelmi,
Michael Natterer
Overview of Changes in GTK+ 1.3.10
==================================
* GtkTextView fixes [Havoc Pennington]
* GtkTreeView fixes and improvements [Jonathan Blandford, Kristian,
Manish Singh, Joshua Pritikin, Oleg Maiboroda, James Henstridge]
* gtkdemo improvements [Kristian Rietveld]
* Drag and drop fixes to generic code and widgets
[Owen Taylor, Damian Ivereigh]
* Documentation improvement [Havoc Pennington, Matthias Clasen]
* Spelling fixes [Jacob Berkman]
* Move signals to the GtkEditable interface [Kristian]
* Further stock image improvements [Jakub Steiner]
* Support text chunks for the PGN loader, add gdk_pixbuf_get_option()
[Sven Neumann]
* Rename gdk_pixbuf_new_from_stream back to new_from_inline [Owen]
* Automatically call setlocale(), unless explicitly disabled [Owen]
* Property addition to various widgets [Michael Meeks, Owen]
* Support building with automake-1.4 [James]
* Make GtkRadioButton groups act as a single focus point [Owen]
* Move gdk_window_lookup etc. to be cross-platform [Matthias]
* Draw spinbuttons variably sized [Kristian]
* Separate GdkAtom out from X atoms for compatibility with future
multihead changes [Owen]
* Require gdk_threads_init() to be explicitly called instead
of piggybacking off of g_thread_init(). [Owen]
* Improvements to text-view/label/entry popup menus [Damian, Jacob, Owen]
* Bug fixes and cleanup [Matthias, others]
Other Contributors:
Mark McLoughin, Mikael Hermansson, Soeren Sandmann, Anders Carlsson,
Tim Janik, Murray Cumming, Hidetoshi Tajima, Padraig O'Briain,
Hans Breuer, Vitaly Tishkov, Dov Grobgeld
Overview of Changes in GTK+ 1.3.9
=================================
* Add editable text cells to GtkTreeView.
Keynav, drawing fixes in GtkTreeView [Jonathan Blandford]
* Text widget no longer always has a \n in it. [Havoc Pennington]
* Text widget bug fixes [Havoc, Dov Grobgeld, Hidetoshi Tajima]
* Allow -1 for width/height in gdk_pixbuf_render_*(). [Matthias Clasen]
* Minor fix for major resizing problems in recent releases [Owen Taylor]
* Restore ability to set _set properties to TRUE for
GtkCellRendererText, GtkTextTag [Owen]
* Cursor drawing improvements [Owen]
* Win32 fixes [Hans Breuer]
* Mark various functions as deprecated or private.
* Misc bug fixes, portability fixes, and cleanups.
Other Contributors:
Vitaly Tishkov, Christian Rose, Frank Belew, Jeff Franks, Sven Neumann,
Kristian Rietveld, Vitaly Tishkov, Joshua N. Pritikin, Matt Wilson,
James Henstridge, Detlef Reichl
Overview of Changes in GTK+ 1.3.8
=================================
* GtkTreeView and GtkTreeModel API cleanups/improvements [Jrb]
* GtkOptionMenu scrollwheel support [Alex]
* GtkModule search paths [Owen]
* Documenatation updates [Havoc,Jrb]
* Major Gdk cleanup [Owen]
* Miscellaneous other fixes/cleanups
Other Contributors:
Joshua N Pritikin, Padraig O'Briain, Jakub Steiner, Matthias Clasen,
Matt Wilson, James Henstridge
Overview of Changes in GTK+ 1.3.7
=================================
* Many Pixbuf (loader) improvements [Matthias Clasen, Soeren Sandmann]
* Added publically installed utility gdk-pixbuf-csource to generate
inlined pixbufs in C source code [Tim Janik]
* Optional movement of button children on press [Soeren, Owen Taylor]
* Interactive searching in GtkTreeView [Kristian Rietveld]
* Sorting/ordering improvements for GtkTreeView [Kris, Jonathan Blandford]
* Animation of expander motion for GtkTreeView [Anders Carlsson]
* Lots of misc GtkTreeView fixes and improvements [Jonathan]
* New/improved stock icons [Jakub Steiner]
* Code and API rework for window resizing [Havoc Pennington]
* Converted accel groups to GObject [James Henstridge]
* More property support improvements
* Add facility for "secondary" buttons in
GtkButtonBox/GtkDialog [Gregory Merchan]
* Disentangled child visability from MAPPED state [Owen]
* Plug/Socket improvements and port to the XEMBED protocol [Owen]
* Added priorities for styles in RC files,
support multiple parse contents [Owen]
* Made GdkVisual and GdkDevice GObjects [Alexander Larsson]
* Key binding improvements [Havoc]
* Added GtkWidget::event-after signal since normal event handling
is now aborted as soon as a handler returned TRUE [Tim]
* Dnd fixes and improved icon support [Owen]
* Removed GtkPacker widget
* Fixing missing paired getters/setters [Kris]
* Nuked remaining GtkArg cruft, implemented container/child properties [Tim]
* Added window grab groups [Owen]
* Many frame buffer improvements [Alex]
* Win32 fixes and improvements [Hans Breuer]
* Warning fixes [Darin Adler]
* Miscellaneous bug and API fixes [Matthias et. al]
Other Contributors:
Joshua N Pritikin, Hidetoshi Tajima, Manish Singh, ERDI Gergo, Jens Finke,
Chema Celorio, Lee Mallabone, Vitaly Tishkov, Sebastian Wilhelmi,
Nicola Girardi, Sven Neumann, Padraig O'Briain, Michael Natterer,
Suresh Chandrasekharan, Jonas Borgström, Jay Cox, Michael Meeks,
Mathias Hasselmann, Peter Williams, Thomas Broyer, Kjartan Maraas,
Joel Becker, Jeff Franks, Brian Cameron, Skip Montanaro
Overview of Changes in GTK+ 1.3.6
=================================
* Properly renders strikethrough text
* win32 fixes
* Added "scale" property to GtkTextTag and GtkCellRendererText to do
relative font scaling
* Added "format_value" signal to GtkScale to reformat value text
* framebuffer fixes
* Property support added to lots of widgets
* Many GtkTreeView new features and API/implementation fixes
* Lots of new_with_mnemonic() convenience functions
* Change GtkImageMenuItem API to be more consistent/useful
* Added lots of new stock items/icons
* Rewrote GtkRange/GtkScale/GtkScrollbar, includes support for
enabling/disabling extra scrollbar stepper arrows in gtkrc so NeXT
themes won't need broken hacks
* Convenience API for GtkRange similar to the one added to GtkSpinButton
a while back
* Make menubar/toolbar work properly with xthickness/ythickness of 1 or 0,
and move some attributes from program settings to user settings.
Allows nice 1-pixel-bevel themes.
* Moved ::focus virtual function from GtkContainer to GtkWidget
* Plenty of bug fixes
Overview of Changes in GTK+ 1.3.5
=================================
* New default theme based on Raleigh theme for 1.2.x.
* Dependency on the ATK library added as a step to
providing accessibility-enabling interfaces
* XEMBED-based GtkPlug/GtkSocket now basically works.
* Drag and drop of column headers in GtkTreeView
* GtkColorSelector work: hooks for saving and propagating palette, UI tweaks,
and API sanitation
* Key binding fixes
* Configurable padding/spacing in a lot of places
* Invisible text in GtkTextView fixed
* SHM segments now created with a mode of 0600
* Bug fixes
Overview of Changes in GTK+ 1.3.4
=================================
* Win32 fixes
* GtkTreeView improvements and fixes
* Fix glib-2.0.m4
* Miscellaneous bug fixes
Overview of Changes in GTK+ 1.3.3
=================================
[ 5600 lines of ChangeLog ]
* API cleanups
* Win32 work (Tor, Hans Breuer)
* Focus improvements (Owen)
* Frame buffer improvements (Alex)
* Work on GtkTextView (Havoc)
* Much work on GtkTreeView (Jonathan)
* Selectable labels (Havoc)
* Converted many arguments to properties (Lee Mallabone, John Margaglione)
* Add exact regions to GdkExposeEvent, propagate it. (Alex)
* Added ability to have resize grips in status bars (etc.) using
_NET_WM_MOVERESIZE protocol. (Havoc)
* Added mnemnonic mechanism to make setting underline accelerators
much easier. (Alex)
* Add per-style property mechanism to allow themes to change
geometry parameters. (Tim)
* Added global settings mechanisms for settings such as double-click
time. (Tim, Owen)
* Various support functions for new and old WM properties (Havoc, Alex)
* Add TRUE-stops-returns for boolean-returning signals (Ron Steinke)
Overview of Changes in GTK+ 1.3.2
=================================
GTK Core:
* New stock-icon and stock-item system. Use themeable pixbufs in
dialogs, buttons, etc. [Havoc]
* Theme engines reworked to use derivation and new object system. [Owen]
* Added GtkClipboard object for simple selection handling. [Owen]
* Make GtkEditable an interface, move implementation to GtkOldEditable for
compat. [Owen]
* Better handling of default directionality. [Robert]
* Use GSignal as backend for GtkSignal and other GObject stuff. [Tim]
* Move theme engines to GTypePlugin. [Owen]
GDK:
* Beginning of implementation of client parts of new window manager spec. [Owen]
* Make gdk_drawable_get_image() work with backing store. [Havoc]
Widgets:
* New text widget [Havoc]
- Adjustable tab handling.
- Ability to have scrolling side areas in new text widget for tabs/line numbers.
- Many cleanups and small improvements.
* Improvements to submenu navigation [Nils Barth/David Santiago] and
scrolling menus. [Alex]
* Simplification of progress bar API. [Havoc]
* Make GtkImage a generic image-display widget. [Havoc]
* New GtkTreeView tree widget. Model/view architecture, flexible rendering,
large datasets, etc. [Jonathan]
* New GtkMessageBox widget for message display. [Havoc]
* Allow labels to have contents set from XML-like markup language. [Havoc]
* Make dialogs derive from GtkDialog and use stock buttons. [Havoc]
Internationalization:
* Proper character set conversion for clipboard/selection. [Owen]
* New input method system via loadable modules; support on-the-spot
preedit in GtkEntry and new text widget; allow switching input methods
on the fly; include modules for XIM and demo Cyrillic-transliteration
module. [Owen]
* VIQR, Thai, and Inuktitut input methods. [Robert]
* Convert po files to UTF-8. [Robert]
gdk-pixbuf:
* Full-alpha compositing for gdk-pixbuf on drawable. [Havoc]
* Add simple saving to gdk-pixbuf. [David Welton/Havoc]
* Add improved error handling with GError to gdk-pixbuf. [Havoc]
Ports:
* Much work on Win32 Port. [Tor/Hans]
* Much work on Linux-FB Port. [Elliot/Alex]
Misc:
* Start of new gtk-demo demo program. [Owen/Jonathan]
* Bug fixes and more bug fixes.
Overview of Changes in GTK+ 1.3.1:
* GTK+ now uses the Pango library for text manipulation. All
strings in GTK+ now are in Unicode, languages written
from right-to-left, and complex-text languages are now supported.
* The gdk-pixbuf library for image loading and manipulation is
has been integrated with GTK+.
* The GTK+ object system has mostly been moved to GLib, separating
it from the GUI code. Many significant enhancements have been
made as part of this.
* A new text widget is now included. This started as a port
of the Tk text widget, and includes such features of the Tk
text widget as tags, marks, and unicode text support. It
has been enhanced to support model-view operation and the
full power of Pango.
* The GDK library has been extensively revised to support multiple
windowing systems. The only fully functional backend in 1.3.1
is the X11 backend, however, ports to Win32, Linux-framebuffer,
Nano-X, BeOS, and MacOS exist in various states of completion,
and at least some of these will be finished and integrated in
before the final GTK+-2.0 release.
* 32-bit coordinates are now supported throughout GDK and GTK+
(they are emulated where not supported by the windowing system.)
* Many minor bug fixes and enhancements. Incompatible changes
are documented in docs/Changes-2.0.txt
Overview of Changes in GTK+ 1.2.8:
* GNU Make 3.79 bug workaround
* FAQ and tutorial updates and improvements
* Miscellaneous bug fixes: CList, Calendar, rc-files, FontSelection
Overview of Changes in GTK+ 1.2.7:
* More header cleanups.
* Fixed activation bug for insensitive widgets.
* Locale fixes to RC file parsing code.
* Miscellaneous bugfixes for Item Factory, CList, CTree, X Selections,
HScale, VScale, Pixmap, Viewport, OptionMenu, Entry and Notebook.
* Upgrade to libtool 1.3.4.
Overview of Changes in GTK+ 1.2.6:
* container queue_resize fixes
* gtk[vh]scale: minor fixups
* rename idle to idle_id in testgtk to avoid conflicts with
broken libs
* More consistent naming of gtkrc files
* Added language support: ro, uk
Overview of Changes in GTK+ 1.2.5:
* more GtkCTree and GtkWindow bug fixes.
* more redraw/resize queue fixes, better expose event
discarding code.
* more miscellaneous bugs fixed
* new configure.in option --disable-rebuilds to completely disable
rebuilds of autogenerated sources.
* check for 5.002 now, to avoid failing autogeneration build rules due
to old perl versions.
* fonts (and fontsets) are cached now.
* more autogeneration make rules and dependency fixups, we should be
save with autogeneration up to make -j12 now ;)
* new window position GTK_WIN_POS_CENTER_ALWAYS, which will recenter the
GtkWindow on every size change.
* major rework of window manager hints handling code, fixed a bunch of
races with the new resizing code.
* the new wm hints and resizing code is absolutely perfect and bug free now,
it only lacks testing ;)
* fixed up various rc style memory problems.
* gtk_widget_modify_style() now properly changes the style of realized widgets
and references the style passed into it. if people worked around this bug,
this will introduce a slight memory leak in their code.
The code should typically look like:
GtkRcStyle *rc_style = gtk_rc_style_new ();
[...]
gtk_widget_modify_style (widget, rc_style);
gtk_rc_style_unref (rc_style);
* fix problems with positioning menus offscreen.
* GtkText fixes for some crashes and drawing errors.
* Better handling for unexpected window destroys in GDK and GTK+.
This should make it possible to use a GtkPlug and catch the
case where its parent socket is randomly killed.
* FAQ updates.
* FileSelection i18n patches, RadioButton fixups.
* many translation improvements.
* miscellaneous other bugs fixed.
Overview of Changes in GTK+ 1.2.4:
* DnD improvements (drags can be canceled with Esc now).
* suppressed configure event reordering in Gdk.
* rewrite of Gtk's configure event handling.
* major improvements for the object argument system (Elena Devdariani).
* major bugfixes for threading, GtkNotebook, GtkItemFactory, GtkCList and
GtkCTree.
* tutorial/FAQ updates, new file generation.txt on autogenerated sources.
* configure's --with-glib= is "officially" unsupported.
* upgrade to libtool 1.3.3.
* various buglets fixed.
Overview of Changes in GTK+ 1.2.3:
* Upgrade to libtool 1.3
* Check for dgettext (for systems with old versions of GNU Gettext)
* Many bug fixes (see ChangeLog for details)
Overview of Changes in GTK+ 1.2.2:
* Improved Dnd behaviour with Motif applications.
* Bug fixes for the Gtk selection code.
* Minor bug fixes to the Gdk Atom cache and Dnd code (with --display option).
* Bug fixes and leak plugs for the Gdk IM code.
* Added gtk_object_get() facility to retrieve object arguments easily.
The var args list expects ("arg-name", &value) pairs.
* Fixed mapping for GdkInputCondition<->GIOCondition, this should fix
problems where closed pipes were no longer signaling GDK_INPUT_READ on
systems with a native poll().
* Some cleanups to GtkLabel's memory allocation code (shouldn't leak memory
anymore).
* We don't attempt to lookup xpm color "None" anymore, this should prevent
eXodus (commercial X windows server) from popping up a color dialog every
time a transparent pixmap is created.
* Fixed bug where Gtk timeout/idle handlers would execute without the global
Gdk lock being held.
* Other minor bug fixes.
Overview of Changes in GTK+ 1.2.1:
* Many Bug fixes have been applied to the menu and accelerator code.
* GtkItemFactory can "adopt" foreign menu items now and manage their
accelerator installation. This is often required to get GtkItemFactory
like accelerator propagation between different windows with the same
menu hierarchy and for centralized parsing and saving of accelerators.
* GtkCList/GtkCTree buttons should always display correctly now.
* Miscellaneous other bug fixes.
What's New in GTK+ 1.2.0 (since 1.0.x):
* New widgets: GtkFontSelector, GtkPacker, GtkItemFactory, GtkCTree,
GtkInvisible, GtkCalendar, GtkLayout, GtkPlug, GtkSocket
* Many new features and robustness for existing widgets
* Theme support
* New DND implementation
* Internationalization of standard dialogs
* New key binding system
* Tearoff menus and menu accelerators
* Wide character support for entry and text
* Resizing code has been overhauled
* Queued redraws of partial areas
* Far better support for object arguments
* Speed optimizations
* Runtime loading of dynamic modules
* Support for GLib log domains
* Tutorial improvements
* A bug fix or two
Overview of Changes in GTK+ 1.1.16:
* Major fixes and improvements for handlebox
* A change to the way widget->requisition works. Now,
widget->requisition is always what the widget requested,
unmodified by the usize. See Changes-1.2.txt for details.
This correct various bugs with gtk_widget_set_usize().
* Fixes for XIM on X11R5 systems
* Don't allow cut-and-paste of text in password-style entries
* --enable-debug is now on by default for the development release.
(When compiling for "production", use --enable-debug=minimum)
* Handle systems where Helvetica is not present more gracefully
* Fixes for memory leaks
* CList and CTree fixes
* Bug fixes for drawing problems.
* Miscellaneous bug fixes to GtkLabel, GtkCList, GtkCTree,
GtkColorsel, Focusing, DND
* Tutorial improvements
Overview of Changes in GTK+ 1.1.15:
* Tutorial Updates
* Added --libs gthread to gtk-config
* Bug fixes
What is new in GTK+ 1.1.14:
* Additions to docs/Changes-1.2.txt
* Just warn when loading theme engine fails
* CLAMP GtkScale digits to a meaningful range
* GTK_LOCALDIR is now defined in a better fashion
* New functions (feature freeze, we know...):
gtk_menu_set_title()
gtk_toggle_button_get_active()
* Some locale fixups in gtkrc code
* Fixes to make gtk_radio_button_set_group() keep only
one radio button in the group active
* Foreign windows are now always treated as viewable; this fixes
a problem where updating didn't occur properly in GtkPlug
* DND fixes for 64 bit architectures, and for specifying operations
with modifier keys.
* Major revisions to GtkLayout: avoid having to create window
for NO_WINDOW children, adjust allocations of children as
scrolled so queued draws work, and a resize is queued instead
of allocating directly in a put() or move()
What is new in GTK+ 1.1.13:
* Dnd and selection bug fixes and memory purification.
* Widget sensitivity fixups.
* Tooltips windows are now named "gtk-tooltips" so rc file rules
can match tooltips windows. Fixed interaction of tooltips and NO_WINDOW
widgets.
* Spin buttons now update their values upon value retrieval.
* Overhaul of the resizing vs. redrawing logic to reduce redrawing needs
a lot. Gtk makes full use of the draw_area coalescing code now, which
got minorly improved as well.
* Containers map their Gdk windows after their children now to reduce
expose event generation.
* Gdk event queue fixups, this solves the double-click problems people were
recently having.
* Account for the fact that GSource's are only properly reentrant from
within dispatch(), thus we don't do Gdk event processing from within
check() or prepare() anymore.
* Rc files feature a bg_pixmap value of "<none>" now.
* Improved session management support in Gdk.
* Automatic disabling of NLS if no gettext is found should work now.
* Removed deprecated functions, docs/Changes-1.2.txt gives an overview.
* Gtk+ development now requires GNU autoconf 2.13, GNU automake 1.4
and GNU libtool 1.2d.
* More bug fixes all over the place.
What is new in GTK+ 1.1.12:
* Korean translation added
* Fixed memory leaks
* A few other bug fixes
What is new in GTK+ 1.1.11:
* Dutch, Japanese, Swedish, Polish, and Norwegian translations
* Removed deprecated _interp variants: gtk_container_foreach_interp,
gtk_idle_add_interp, gtk_timeout_add_interp, gtk_signal_connect_interp
* Lots of cast corrections
* Many fixes
What is new in GTK+ 1.1.9:
* Check for broken glibc 2.0 mb functions and avoid them
* Label and Entry display fixes
* Move main thread back to GDK, for locking when translating events
* Bug fixes
What is new in GTK+ 1.1.8:
* Added support for gettext and the localization of the standard
dialogs.
* Added line-wrapping for the label, and JUSTIFY_FILL
* Support reordering via drag and drop in CList and CTree.
* Replaced GtkDrawWindow widget with a GTK_USER_DRAW flag
* Extended gtkpaned API to support minimum sizes and proportional
resizing.
* Changed the handling of shared memory segments so as to
remove the need for GTK+ to set up signal handlers.
* Re-implemented event loop in terms of the event loop
that has been added to GLib 1.1.8
* Added 'grab_focus' signal to allow keyboard accelerators
for entries.
* Load locale specific RC files if present.
* Bug fixes.
What is new in GTK+ 1.1.7:
* Fixed memory mis-allocation in default files code
* Various event handling fixes
* Wide character support for entry and text
* Destroy widgets _after_ propagating unrealize signals through
widget hierarchy
* Only build XIM-support if available
* Tutorial and examples updates
* Added gtk_drag_source_unset()
What is new in GTK+ 1.1.6:
* The signal system now features emission hooks with special semantics,
refer to the ChangeLog for this.
* Minor? speedups and memory reductions to the emission handling of the
signal system.
* _interp() function variants are deprecated now. the corresponding *_full()
variants are provided for a long time now.
* Dnd abort timeout increased to 10 minutes.
* GtkScrolledWindow inherits from GtkBin now.
* GTK_POLICY_NEVER is implemented for scrolled windows now.
* Lots of API clean ups.
* Incremental freezing abilities.
* Integrated widgets from the GNOME tree: GtkLayout, GtkPlug and GtkSocket.
* New window functions for transient relationship, default size, and
geometry hints
* Default rc files are now read in (<sysconfdir/etc/gtkrc and ~/.gtkrc)
GTK_RC_FILES environment variable and functions are provided to configure
this behavior
* Read doc/Changes-1.2.txt to properly adapt your code.
* Bug Fixes.
What is new in GTK+ 1.1.5:
* Theme integration
* Widget style modification is now handled through GtkRcStyles
* GtkPixmaps now grey out pixmaps when insensitive
* Notebook enhancements
* Shadow configurability for menubars and handleboxes
* DND enhancements
* gtkfilesel now supports automounters better
* Implementation of expose compression
* Queued redraws of partial areas
* Scrolledwindow (+Viewport) source incompatibilities, children that are added
to a scrolled window don't get an automatic viewport anymore. a convenience
function gtk_scrolled_window_add_with_viewport() is supplied for this task
* Deprecated functions will now issue a message, informing the programmer about
the use of this function. These functions will get removed in future versions
* Non-functional functions got removed entirely
* gtk_widget_new() and gtk_object_new() will now auto-construct new objects.
A new function gtk_object_default_construct() is provided now which should
be called after every gtk_type_new() to perform the auto-construction
* Improved argument support of several widgets
* Bug Fixes
What is new in GTK+ 1.1.3:
* GtkCList/GtkCTree now have the ability to:
- hide/show individual columns
- disable/enable column resizing
- set min and max for column widths
- set expander style of the ctree
- set/get row and cell styles
- set spacing between tree expander and cell contents in ctree
- toggle auto_resize for columns
* Must enhanced DND support, removed old DND code
* Idle functions are now implemented via GHook, giving a slight speed
improvement
* An environment variable GTK_MODULES which takes a colon separated
list of module names GTK+ will now automatically load at gtk_init() startup
* GtkFontSel now has support for an extra 'base' filter
* New function gdk_window_set_root_origin to get the real geometry taking
into account window manager offsets
* New function gtk_text_set_line_wrap to toggle line wrapping
* New function gtk_widget_add_events which safely adds additional
events to a widget's event mask
* New function gdk_event_get_time to get the timestamp from a generic
event
* New widget GtkCalendar
* New widget GtkInvisible - InputOnly offscreen windows used for reliable
pointer grabs and selection handling in DND code
* New functions gtk_object_remove_no_notify[_by_id] to remove a certain
data portion without invocation of its destroy notifier
* gtk_spin_button_construct is now deprecated, use gtk_spin_button_configure
instead
* gtk_clist_set_border is now deprecated, use gtk_clist_set_shadow_type
instead
* Removed functions gtk_object_set_data_destroy[_by_id]
* Documentation additions/updates
* HTML and plain text files are now included in the distribution
* Bug fixes, typeness corrections, and general fixups
What is new in GTK+ 1.1.2:
* Gtk+ is now featuring runtime loading of dynamic modules via the
--gtk-modules= command line switch. such modules have to export a
G_MODULE_EXPORT void gtk_module_init (gint *argc, gchar ***argv);
function which will be invoked to initialize the module. since such
modules may create new widget types, they are always resident.
* The tutorial has been updated again.
* Changes to menus including tearoff menus and accelerators.
* Better support for modal dialogs.
* Removed CAN_FOCUS by default from scrollbars and button children of toolbar.
* More improvements and fixes for GtkCList and GtkCTree (i.e. row sorting).
* GtkCTree rows can be unselectable now.
* The GtkCTree API has undergone major renames (see ChangeLog entry from Lars
Hamann on Tue Aug 18 00:29:13 1998).
* A bunch of varargs functions changed to get va_lists working on systems that
implement va_lists as arrays.
* Improvements to the gdkrgb code.
* Improvements to Gdk color handling so we greatly reduce server traffic and
don't leak colors anymore.
* Improved internal widget tree iterators (the GtkContainer::foreach signal
vanished because of this).
* Option menus can have the keyboard focus now.
* More fixups to the text widget.
* GtkFileSelection should behave much more nicely in combination with AFS now.
* Support for label underlining.
* Support for GLib 1.1.3 log domains.
* Documentation improvements.
* Configuration fixes on various platforms.
* Miscellaneous fixes to XInput support.
* Build with shared library dependencies on Linux
* Fix for a major bug in the type systems memory allocation code that could
cause random crashes.
* Libtool update to version 1.2b.
* Lots of bugfixes and cleanups again ;)
What is new in GTK+ 1.1.1:
* Tutorial updates and additions.
* Key binding support for GtkListItems and GtkList.
* Extended selection mode and autoscrolling for GtkLists.
* A GtkCtree now operates on GtkCTreeNode* structures rather than GList*.
* GtkCTreeNodes can now be created from GNode trees.
* Bug fixes for GtkNotebook, GtkCList, GtkCombo and GdkWindow reparentation.
What is new in GTK+ 1.1.0:
* New widget GtkFontSelector.
* New featureful progress bar.
* New container widget GtkPacker.
* New object GtkItemFactory, GtkMenuFactory is deprecated.
* New key binding system, configurable via rcfiles, similar to styles.
* New widget GtkCTree with drag selections and keyboard movement and
and horizontal scrolling. Features also implemented for GtkCList.
* Significant speedups to widget creation and destruction through caching
colormap and visual queries to the XServer.
* Speedups for type creation and especially gtk_type_is_a() checks.
* Speedups in signal lookup, creation and emissions and connection handling.
* Minor speedups with object data allocation and destruction.
* Additions to the signal handling API (e.g. *_emitv).
* Support for rc-file reparsing.
* Resizing logic is now implemented on container widget basis, rather than
for toplevel GtkWindows only.
* Buttons support relief styles now.
* Some widgets are now allocated through memchunks to behave more memory wise.
* Newly included file gtkfeatures.h which defines compatibility macros to
test for certain API features upon program compilation.
* Child arguments support for container widgets.
* Far better support for object arguments, revamp of the underlying
mechanism for speed and reusability. Child/object arguments don't
need to be preceded by the "GtkType::" portion anymore.
* Removed GtkAcceleratorTable in favour of GtkAccelGroup, accelerator display
is now performed by a new widget GtkAccelLabel.
* Overhaul of the resizing code. Resizing behaviour can now be specified
on GtkContainer basis, so the underlying algorithm isn't only available
for GtkWindows.
* GtkTables are now fully resizable.
* The GtkType system now supports an additional base class initialization
function.
* GtkStyles and key bindings can now be looked up depending on the base
types of a widget, through a new keyword `class' in rc files.
* GtkButton derives from GtkBin (finally).
* More descriptive error messages on rc parsing.
* Runtime information is available to query enum/flag definition values.
* Upgrade to libtool-1.2
* Legions of bug fixes, memory leaks, segfaults, of-by-something errors...
including those that already went into the 1.0.x branch.
* A big bunch of features and cosmetic fixups that just got lost in
the masses of changesonfigure problem when cross-compiling

File diff suppressed because it is too large Load Diff

72
README Normal file
View File

@@ -0,0 +1,72 @@
General Information
===================
This is GTK+ version 1.2.10. GTK+, which stands for the Gimp ToolKit,
is a library for creating graphical user interfaces for the X Window
System. It is designed to be small, efficient, and flexible. GTK+ is
written in C with a very object-oriented approach.
The official ftp site is:
ftp://ftp.gtk.org/pub/gtk
The official web site is:
http://www.gtk.org/
Information about mailing lists can be found at
http://www.gtk.org/mailinglists.html
Installation
============
See the file 'INSTALL'
How to report bugs
==================
Bugs should be reported to the GNOME bug tracking system.
(http://bugzilla.gnome.org, product gtk+.) You will need
to create an account for yourself.
In the bug report please include:
* Information about your system. For instance:
- What operating system and version
- What version of X
- For Linux, what version of the C library
And anything else you think is relevant.
* How to reproduce the bug.
If you can reproduce it with the testgtk program that is built
in the gtk/ subdirectory, that will be most convenient. Otherwise,
please include a short test program that exhibits the behavior.
As a last resort, you can also provide a pointer to a larger piece
of software that can be downloaded.
* If the bug was a crash, the exact text that was printed out
when the crash occured.
* Further information such as stack traces may be useful, but
is not necessary. If you do send a stack trace, and the error
is an X error, it will be more useful if the stacktrace
is produced running the test program with the --sync command
line option.
Patches
=======
Patches should also be submitted to bugzilla.gnome.org. If the
patch fixes an existing bug, add the patch as an attachment
to that bug report.
Otherwise, enter a new bug report that describes the patch,
and attach the patch to that bug report.
Bug reports containing patches should include the PATCH keyword
in their keyword fields. If the patch adds to or changes the GTK
programming interface, the API keyword should also be included.
Patches should be in unified diff form. (The -u option to GNU
diff.)

63
README.cvs-commits Normal file
View File

@@ -0,0 +1,63 @@
GTK+ is part of the GNOME CVS repository. At the current time, any
person with write access to the GNOME repository, can make changes to
GTK+. This is a good thing, in that it encourages many people to work
on GTK+, and progress can be made quickly. However, GTK+ is a fairly
large and complicated package that many other things depend on, so to
avoid unnecessary breakage, and to take advantage of the knowledge
about GTK+ that has been built up over the last 18 months, we'd like
to ask people commiting to GTK+ to follow a few rules:
0) Ask first. If your changes are major, or could possibly break existing
code, you should always ask. If your change is minor and you've
been working on GTK+ for a while it probably isn't necessary
to ask. But when in doubt, ask. Even if your change is correct,
somebody may know a better way to do things.
If you are making changes to GTK+, you should be subscribed
to gtk-devel-list@redhat.com. (Subscription address:
gtk-devel-list-request@redhat.com.) This is a good place to ask
about intended changes.
If you just want to make a trivial change, and don't want to subscribe,
you can also mail gtk-bugs@gtk.org. Or, alternatively, you can look in
the ChangeLog for somebody who has been making changes to the file
you want to change and email them.
#gimp on byxnet (irc.gimp.org, irc2.gimp.org, irc3.gimp.org,
irc.germany.gimp.org...)s also a good place to find GTK+ developers to
discuss changes with, however, email to gtk-devel-list is the most
certain and preferred method.
1) Ask _first_.
2) There must be a ChangeLog for every commit. (If you discover that
you only committed half the files you meant to and need to fix that
up, or something, you don't need a new ChangeLog entry. But in general,
ChangeLog entries are mandatory.) Changes with out ChangeLog entries
will be reverted.
3) There _must_ be a ChangeLog for every commit.
Notes:
* If you are going to be changing many files in an experimental fashion,
it probably is a good idea to create a separate branch for your changes.
* The ChangeLog entries should preferrably match in date format
with the existing entries. You can set how emacs does this
by using customize mode:
- M-x customize
- set Programming/Tools/ChangeLog/Add Log Time Format to
'Old Format'
Or, set the add-log-time-format to 'current-time-string in
your .emacs file.
Owen Taylor
13 Aug 1998

72
README.in Normal file
View File

@@ -0,0 +1,72 @@
General Information
===================
This is GTK+ version @GTK_VERSION@. GTK+, which stands for the Gimp ToolKit,
is a library for creating graphical user interfaces for the X Window
System. It is designed to be small, efficient, and flexible. GTK+ is
written in C with a very object-oriented approach.
The official ftp site is:
ftp://ftp.gtk.org/pub/gtk
The official web site is:
http://www.gtk.org/
Information about mailing lists can be found at
http://www.gtk.org/mailinglists.html
Installation
============
See the file 'INSTALL'
How to report bugs
==================
Bugs should be reported to the GNOME bug tracking system.
(http://bugzilla.gnome.org, product gtk+.) You will need
to create an account for yourself.
In the bug report please include:
* Information about your system. For instance:
- What operating system and version
- What version of X
- For Linux, what version of the C library
And anything else you think is relevant.
* How to reproduce the bug.
If you can reproduce it with the testgtk program that is built
in the gtk/ subdirectory, that will be most convenient. Otherwise,
please include a short test program that exhibits the behavior.
As a last resort, you can also provide a pointer to a larger piece
of software that can be downloaded.
* If the bug was a crash, the exact text that was printed out
when the crash occured.
* Further information such as stack traces may be useful, but
is not necessary. If you do send a stack trace, and the error
is an X error, it will be more useful if the stacktrace
is produced running the test program with the --sync command
line option.
Patches
=======
Patches should also be submitted to bugzilla.gnome.org. If the
patch fixes an existing bug, add the patch as an attachment
to that bug report.
Otherwise, enter a new bug report that describes the patch,
and attach the patch to that bug report.
Bug reports containing patches should include the PATCH keyword
in their keyword fields. If the patch adds to or changes the GTK
programming interface, the API keyword should also be included.
Patches should be in unified diff form. (The -u option to GNU
diff.)

159
README.md
View File

@@ -1,159 +0,0 @@
GTK — The GTK toolkit
=====================
[![Build Status](https://gitlab.gnome.org/GNOME/gtk/badges/master/build.svg)](https://gitlab.gnome.org/GNOME/gtk/pipelines)
General information
-------------------
GTK is a multi-platform toolkit for creating graphical user interfaces.
Offering a complete set of widgets, GTK is suitable for projects ranging
from small one-off projects to complete application suites.
GTK is free software and part of the GNU Project. However, the
licensing terms for GTK, the GNU LGPL, allow it to be used by all
developers, including those developing proprietary software, without any
license fees or royalties.
The official download location
- https://download.gnome.org/sources/gtk+
The official web site
- https://www.gtk.org
The official developers blog
- https://blog.gtk.org
Information about mailing lists can be found at
- http://www.gtk.org/mailing-lists.php
Nightly documentation can be found at
- Gtk: https://gnome.pages.gitlab.gnome.org/gtk/gtk/
- Gdk: https://gnome.pages.gitlab.gnome.org/gtk/gdk/
- Gsk: https://gnome.pages.gitlab.gnome.org/gtk/gsk/
Building and installing
-----------------------
In order to build GTK you will need:
- [a C99 compatible compiler](https://wiki.gnome.org/Projects/GLib/CompilerRequirements)
- [Python 3](https://www.python.org/)
- [Meson](http://mesonbuild.com)
- [Ninja](https://ninja-build.org)
You will also need various dependencies, based on the platform you are
building for:
- [GLib](https://download.gnome.org/sources/glib)
- [GdkPixbuf](https://download.gnome.org/sources/gdk-pixbuf)
- [GObject-Introspection](https://download.gnome.org/sources/gobject-introspection)
- [Cairo](https://www.cairographics.org)
- [Pango](https://download.gnome.org/sources/pango)
- [Epoxy](https://github.com/anholt/libepoxy)
- [Graphene](https://github.com/ebassi/graphene)
- [ATK](https://download.gnome.org/sources/atk)
- [Xkb-common](https://github.com/xkbcommon/libxkbcommon)
If you are building the X11 backend, you will also need:
- Xlib, and the following X extensions:
- xrandr
- xrender
- xi
- xext
- xfixes
- xcursor
- xdamage
- xcomposite
- [atk-bridge-2.0](https://download.gnome.org/sources/at-spi2-atk)
If you are building the Wayland backend, you will also need:
- Wayland-client
- Wayland-protocols
- Wayland-cursor
- Wayland-EGL
Once you have all the necessary dependencies, you can build GTK by using
Meson:
```sh
$ meson _build .
$ cd _build
$ ninja
```
You can run the test suite using:
```sh
$ meson test
```
And, finally, you can install GTK using:
```
$ sudo ninja install
```
Complete information about installing GTK+ and related libraries
can be found in the file:
```
docs/reference/gtk/html/gtk-building.html
```
Or [online](https://developer.gnome.org/gtk4/stable/gtk-building.html)
How to report bugs
------------------
Bugs should be reported on the [issues page](https://gitlab.gnome.org/GNOME/gtk/issues/new).
In the bug report please include:
* Information about your system. For instance:
- which version of GTK you are using
- what operating system and version
- for Linux, which distribution
- if you built GTK, the list of options used to configure the build
And anything else you think is relevant.
* How to reproduce the bug.
If you can reproduce it with one of the demo applications that are
built in the demos/ subdirectory, on one of the test programs that
are built in the tests/ subdirectory, that will be most convenient.
Otherwise, please include a short test program that exhibits the
behavior. As a last resort, you can also provide a pointer to a
larger piece of software that can be downloaded.
* If the bug was a crash, the exact text that was printed out
when the crash occurred.
* Further information such as stack traces may be useful, but
is not necessary.
Release notes
-------------
The release notes for GTK are part of the migration guide in the API
reference. See:
- [3.x release notes](https://developer.gnome.org/gtk3/unstable/gtk-migrating-2-to-3.html)
- [4.x release notes](https://developer.gnome.org/gtk4/unstable/gtk-migrating-3-to-4.html)
Licensing terms
---------------
GTK is released under the terms of the GNU Lesser General Public License,
version 2.1 or, at your option, any later version, as published by the Free
Software Foundation.
Please, see the `COPYING` file for further information.

200
TODO Normal file
View File

@@ -0,0 +1,200 @@
Outstanding items:
* focus handling for GtkOptionMenu (needs the previous)
* implement gtk_default_draw_oval and other missing things in gtkstyle.c.
* enforce invariants on *_RESIZE* and *_REDRAW* flags.
* GtkToolTips: allocate GtkTooltipsData from memchunks
* Make all widget attributes configurable after the widget is created (timj).
* Radio buttons need to display CAN/HAS_DEFAULT correctly, if draw_inidicator
is TRUE. (Radio buttons do not need to CAN_DEFAULT! OWT)
* More dialogs: Print, maybe others...
* make the gtk_main callbacks consistent in their add/remove behaviour.
* Check return values on all calls to XIC[Get/Set]Values
* The "--geometry" option should be supported
- Having gdk_init() parse the geometry option. (putting it into
GDK means you can use XParseGeometry() without wrapping it)
- Add a call gdk_get_geometry() that retrieves the results
in a form like that returned by XParseGeometry()
- The application then can modify the results (as would gemvt)
then call a routine gtk_window_set_geometry() on whatever
it considers to be its main window.
- Then in some manner GtkWindow takes that into account when
setting its hints. (Probably it uses the size and position
as the current uposition and usize, and modulates that
be the equivalents of the X flags
XValue, YValue, WidthValue, HeightValue, XNegative, or YNegative
( You'd have to extend gdk_window_set_hints to accept the
window gravity option to get it right. )
* Allow moving the separator for paned widgets by dragging
it directly instead of using the handle.
* Check into XAddConnectionWatch - is this needed for XIM?
* Places where a _full variant is needed:
gtk_init_add
gtk_menu_popup
gtk_toolbar_prepend_element
gtk_toolbar_insert_element
* Try to rationally deal with someone else deleting one of our
windows??? This would mean keeping track of our window heirarchy
ourselves, for one thing, and will never be safe, because of
race conditions.
* Should all the default handlers really return FALSE? This can
cause confusing presses to be sent to containers that actually
want to get events on themselves.
* The menu code should skip separators during keyboard navigation,
whether they are sensitive or insensitive.
* OwnerButtonPressGrab needs to go!
Text/Edit widget:
Bugs:
- Really big font (150 pt), plus lots of editing caused segfault
Improvements:
- Unify the key binding support in some fashion between the
Entry and Text widget widgets, use GtkBindings for this.
- Figure out a way not to recompute the geometry on insertions/deletions
which are large, but not a significant fraction of the
entire text. (e.g., compute the changes as when the widget
is not frozen, but without the actual scrolling)
- Prune the line start cache. But since it is only 68 bytes
per line, and it is a lot faster when lines are in the cache,
it may be better not to, at least for now.
- Show the non-editable state by changing colors. (Use the
style entries for insensitive?)
- Multibyte support for the Text widget.
- Unicode support to do the multi-byte right.
- Support an .inputrc. (The readline one doesn't really work,
unless it is extended because it can't represent X keysyms,
just terminal type input)
- A vi mode
- Word wrap, instead of line folding. (Should the continuation
characters be shown?)
- Horizontal scrolling
- Disable pasting compound text
- When showing background pixmap (not editable) actually set
the background pixmap as the windows bg pixmap, to improve
appearance on exposes. But this would require using another
window to get the origins.
- In word wrap mode, break:
aaaaaaaaaaa bbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbb
as:
| Maximum column
aaaaaaaaaaa bbbbbbbbbbb|
bbbbbbbbbbbbbbbbbbbbbbb|
bbbbbbbbb |
Instead of:
|
aaaaaaaaaaa |
bbbbbbbbbbbbbbbbbbbbbbb|
bbbbbbbbbbbbbbbbbbbb |
- Blinking cursor
- API's : gtk_text_clear, gtk_text_delete_lines (gint start, gint end),
gtk_text_append/prepend, gtk_text_insert_at (gint row, gint column),
some function to get the row/column from the x/y-coordinates of a
mouse click, some function to get the word/line under the mouse pointer
[ From: Stefan Jeske <jeske@braunschweig.netsurf.de> ]
- "changed" emitted when doing deletes on empty Text widget.
- Delete IC in editable->unrealize, not editable->finalize?
Themes
======
- When a scale gets shown/hidden only queue a redraw on the
non-window portion, not the whole area.
- In various places, to avoid shaping windows excessively,
we set parent relative backgrounds. This is an ugly
hack and needs a better solution. Plus, I don't think
these parent-relative backgrounds always persist to
when they are actually needed.
Such calls exist in: GtkButton, GtkHandeBox, GtkItem,
GtkListItem, GtkMenu, GtkMenuItem, GtkMisc,
GtkNoteBook, GtkOptionMenu, GtkPaned, GtkPreview,
GtkSpinButton and GtkTreeItem.
- For menus and for GtkWindow's, the realize() function
calls paint(), so that background pixmaps can be set
ahead of time, and prevent flashing when the window is
shown. This is an ugly hack and needs a better solution.
=======
Calendar Widget:
- The widget should be nicely resizeable vertical too.
- CALENDAR_MARGIN should be removed, uses INNER_BORDER and
style->class->[xy]thickness insted.
- Flag to choose between using standard three letter abbreviated
weekday name or just the first character from it. It looks like
that is what most other calendar-widgets do.
- Arrows should resize with the header-font.
- The keyboard support has to be finished.
DND
===
- Use a cursor instead of an ICON when over Motif windows,
to get rid of the current junk that Motif leaves because
of its XCopyArea stupidity for doing highlighting.
- Add a GTK_DRAG_VERIFY target flag and a "drag_data_verify"
signal so that apps can easily check if a, say,
text/uri-list URL looks OK during the drop.
- Check more for memory leaks.
- Drag and drop for Entry and Text widgets.
- Send synthetic motion events on structure changes so
drag_enter/leave get sent properly. (See the popup
in testdnd)

60
acconfig.h Normal file
View File

@@ -0,0 +1,60 @@
/* acconfig.h
This file is in the public domain.
Descriptive text for the C preprocessor macros that
the distributed Autoconf macros can define.
No software package will use all of them; autoheader copies the ones
your configure.in uses into your configuration header file templates.
The entries are in sort -df order: alphabetical, case insensitive,
ignoring punctuation (such as underscores). Although this order
can split up related entries, it makes it easier to check whether
a given entry is in the file.
Leave the following blank line there!! Autoheader needs it. */
/* Other stuff */
#undef ENABLE_NLS
#undef GTK_COMPILED_WITH_DEBUGGING
#undef HAVE_CATGETS
#undef HAVE_GETTEXT
#undef HAVE_IPC_H
#undef HAVE_LC_MESSAGES
#undef HAVE_SHM_H
#undef HAVE_STPCPY
#undef HAVE_XSHM_H
#undef HAVE_SHAPE_EXT
#undef HAVE_SYS_SELECT_H
#undef HAVE_XCONVERTCASE
#undef NO_FD_SET
#undef RESOURCE_BASE
/* Define to use X11R6 additions to XIM */
#undef USE_X11R6_XIM
/* Define if we should use mbstowcs and friends directly
*/
#undef USE_NATIVE_LOCALE
#undef XINPUT_NONE
#undef XINPUT_GXI
#undef XINPUT_XFREE
/* Define as the return type of signal handlers (int or void). */
#undef RETSIGTYPE
/* Most machines will be happy with int or void. IRIX requires '...' */
#undef SIGNAL_ARG_TYPE
/* #undef PACKAGE */
/* #undef VERSION */
/* Leave that blank line there!! Autoheader needs it.
If you're adding to this file, keep in mind:
The entries are in sort -df order: alphabetical, case insensitive,
ignoring punctuation (such as underscores). */

768
acinclude.m4 Normal file
View File

@@ -0,0 +1,768 @@
## libtool.m4 - Configure libtool for the target system. -*-Shell-script-*-
## Copyright (C) 1996-1999 Free Software Foundation, Inc.
## Originally by Gordon Matzigkeit <gord@gnu.ai.mit.edu>, 1996
##
## This program is free software; you can redistribute it and/or modify
## it under the terms of the GNU General Public License as published by
## the Free Software Foundation; either version 2 of the License, or
## (at your option) any later version.
##
## This program 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
## General Public License for more details.
##
## You should have received a copy of the GNU General Public License
## along with this program; if not, write to the Free Software
## Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
##
## As a special exception to the GNU General Public License, if you
## distribute this file as part of a program that contains a
## configuration script generated by Autoconf, you may include it under
## the same distribution terms that you use for the rest of that program.
# serial 40 AC_PROG_LIBTOOL
AC_DEFUN(AC_PROG_LIBTOOL,
[AC_REQUIRE([AC_LIBTOOL_SETUP])dnl
# Save cache, so that ltconfig can load it
AC_CACHE_SAVE
# Actually configure libtool. ac_aux_dir is where install-sh is found.
CC="$CC" CFLAGS="$CFLAGS" CPPFLAGS="$CPPFLAGS" \
LD="$LD" LDFLAGS="$LDFLAGS" LIBS="$LIBS" \
LN_S="$LN_S" NM="$NM" RANLIB="$RANLIB" \
DLLTOOL="$DLLTOOL" AS="$AS" OBJDUMP="$OBJDUMP" \
${CONFIG_SHELL-/bin/sh} $ac_aux_dir/ltconfig --no-reexec \
$libtool_flags --no-verify $ac_aux_dir/ltmain.sh $lt_target \
|| AC_MSG_ERROR([libtool configure failed])
# Reload cache, that may have been modified by ltconfig
AC_CACHE_LOAD
# This can be used to rebuild libtool when needed
LIBTOOL_DEPS="$ac_aux_dir/ltconfig $ac_aux_dir/ltmain.sh"
# Always use our own libtool.
LIBTOOL='$(SHELL) $(top_builddir)/libtool'
AC_SUBST(LIBTOOL)dnl
# Redirect the config.log output again, so that the ltconfig log is not
# clobbered by the next message.
exec 5>>./config.log
])
AC_DEFUN(AC_LIBTOOL_SETUP,
[AC_PREREQ(2.13)dnl
AC_REQUIRE([AC_ENABLE_SHARED])dnl
AC_REQUIRE([AC_ENABLE_STATIC])dnl
AC_REQUIRE([AC_ENABLE_FAST_INSTALL])dnl
AC_REQUIRE([AC_CANONICAL_HOST])dnl
AC_REQUIRE([AC_CANONICAL_BUILD])dnl
AC_REQUIRE([AC_PROG_RANLIB])dnl
AC_REQUIRE([AC_PROG_CC])dnl
AC_REQUIRE([AC_PROG_LD])dnl
AC_REQUIRE([AC_PROG_NM])dnl
AC_REQUIRE([AC_PROG_LN_S])dnl
dnl
case "$target" in
NONE) lt_target="$host" ;;
*) lt_target="$target" ;;
esac
# Check for any special flags to pass to ltconfig.
libtool_flags="--cache-file=$cache_file"
test "$enable_shared" = no && libtool_flags="$libtool_flags --disable-shared"
test "$enable_static" = no && libtool_flags="$libtool_flags --disable-static"
test "$enable_fast_install" = no && libtool_flags="$libtool_flags --disable-fast-install"
test "$ac_cv_prog_gcc" = yes && libtool_flags="$libtool_flags --with-gcc"
test "$ac_cv_prog_gnu_ld" = yes && libtool_flags="$libtool_flags --with-gnu-ld"
ifdef([AC_PROVIDE_AC_LIBTOOL_DLOPEN],
[libtool_flags="$libtool_flags --enable-dlopen"])
ifdef([AC_PROVIDE_AC_LIBTOOL_WIN32_DLL],
[libtool_flags="$libtool_flags --enable-win32-dll"])
AC_ARG_ENABLE(libtool-lock,
[ --disable-libtool-lock avoid locking (might break parallel builds)])
test "x$enable_libtool_lock" = xno && libtool_flags="$libtool_flags --disable-lock"
test x"$silent" = xyes && libtool_flags="$libtool_flags --silent"
# Some flags need to be propagated to the compiler or linker for good
# libtool support.
case "$lt_target" in
*-*-irix6*)
# Find out which ABI we are using.
echo '[#]line __oline__ "configure"' > conftest.$ac_ext
if AC_TRY_EVAL(ac_compile); then
case "`/usr/bin/file conftest.o`" in
*32-bit*)
LD="${LD-ld} -32"
;;
*N32*)
LD="${LD-ld} -n32"
;;
*64-bit*)
LD="${LD-ld} -64"
;;
esac
fi
rm -rf conftest*
;;
*-*-sco3.2v5*)
# On SCO OpenServer 5, we need -belf to get full-featured binaries.
SAVE_CFLAGS="$CFLAGS"
CFLAGS="$CFLAGS -belf"
AC_CACHE_CHECK([whether the C compiler needs -belf], lt_cv_cc_needs_belf,
[AC_TRY_LINK([],[],[lt_cv_cc_needs_belf=yes],[lt_cv_cc_needs_belf=no])])
if test x"$lt_cv_cc_needs_belf" != x"yes"; then
# this is probably gcc 2.8.0, egcs 1.0 or newer; no need for -belf
CFLAGS="$SAVE_CFLAGS"
fi
;;
ifdef([AC_PROVIDE_AC_LIBTOOL_WIN32_DLL],
[*-*-cygwin* | *-*-mingw*)
AC_CHECK_TOOL(DLLTOOL, dlltool, false)
AC_CHECK_TOOL(AS, as, false)
AC_CHECK_TOOL(OBJDUMP, objdump, false)
;;
])
esac
])
# AC_LIBTOOL_DLOPEN - enable checks for dlopen support
AC_DEFUN(AC_LIBTOOL_DLOPEN, [AC_BEFORE([$0],[AC_LIBTOOL_SETUP])])
# AC_LIBTOOL_WIN32_DLL - declare package support for building win32 dll's
AC_DEFUN(AC_LIBTOOL_WIN32_DLL, [AC_BEFORE([$0], [AC_LIBTOOL_SETUP])])
# AC_ENABLE_SHARED - implement the --enable-shared flag
# Usage: AC_ENABLE_SHARED[(DEFAULT)]
# Where DEFAULT is either `yes' or `no'. If omitted, it defaults to
# `yes'.
AC_DEFUN(AC_ENABLE_SHARED, [dnl
define([AC_ENABLE_SHARED_DEFAULT], ifelse($1, no, no, yes))dnl
AC_ARG_ENABLE(shared,
changequote(<<, >>)dnl
<< --enable-shared[=PKGS] build shared libraries [default=>>AC_ENABLE_SHARED_DEFAULT],
changequote([, ])dnl
[p=${PACKAGE-default}
case "$enableval" in
yes) enable_shared=yes ;;
no) enable_shared=no ;;
*)
enable_shared=no
# Look at the argument we got. We use all the common list separators.
IFS="${IFS= }"; ac_save_ifs="$IFS"; IFS="${IFS}:,"
for pkg in $enableval; do
if test "X$pkg" = "X$p"; then
enable_shared=yes
fi
done
IFS="$ac_save_ifs"
;;
esac],
enable_shared=AC_ENABLE_SHARED_DEFAULT)dnl
])
# AC_DISABLE_SHARED - set the default shared flag to --disable-shared
AC_DEFUN(AC_DISABLE_SHARED, [AC_BEFORE([$0],[AC_LIBTOOL_SETUP])dnl
AC_ENABLE_SHARED(no)])
# AC_ENABLE_STATIC - implement the --enable-static flag
# Usage: AC_ENABLE_STATIC[(DEFAULT)]
# Where DEFAULT is either `yes' or `no'. If omitted, it defaults to
# `yes'.
AC_DEFUN(AC_ENABLE_STATIC, [dnl
define([AC_ENABLE_STATIC_DEFAULT], ifelse($1, no, no, yes))dnl
AC_ARG_ENABLE(static,
changequote(<<, >>)dnl
<< --enable-static[=PKGS] build static libraries [default=>>AC_ENABLE_STATIC_DEFAULT],
changequote([, ])dnl
[p=${PACKAGE-default}
case "$enableval" in
yes) enable_static=yes ;;
no) enable_static=no ;;
*)
enable_static=no
# Look at the argument we got. We use all the common list separators.
IFS="${IFS= }"; ac_save_ifs="$IFS"; IFS="${IFS}:,"
for pkg in $enableval; do
if test "X$pkg" = "X$p"; then
enable_static=yes
fi
done
IFS="$ac_save_ifs"
;;
esac],
enable_static=AC_ENABLE_STATIC_DEFAULT)dnl
])
# AC_DISABLE_STATIC - set the default static flag to --disable-static
AC_DEFUN(AC_DISABLE_STATIC, [AC_BEFORE([$0],[AC_LIBTOOL_SETUP])dnl
AC_ENABLE_STATIC(no)])
# AC_ENABLE_FAST_INSTALL - implement the --enable-fast-install flag
# Usage: AC_ENABLE_FAST_INSTALL[(DEFAULT)]
# Where DEFAULT is either `yes' or `no'. If omitted, it defaults to
# `yes'.
AC_DEFUN(AC_ENABLE_FAST_INSTALL, [dnl
define([AC_ENABLE_FAST_INSTALL_DEFAULT], ifelse($1, no, no, yes))dnl
AC_ARG_ENABLE(fast-install,
changequote(<<, >>)dnl
<< --enable-fast-install[=PKGS] optimize for fast installation [default=>>AC_ENABLE_FAST_INSTALL_DEFAULT],
changequote([, ])dnl
[p=${PACKAGE-default}
case "$enableval" in
yes) enable_fast_install=yes ;;
no) enable_fast_install=no ;;
*)
enable_fast_install=no
# Look at the argument we got. We use all the common list separators.
IFS="${IFS= }"; ac_save_ifs="$IFS"; IFS="${IFS}:,"
for pkg in $enableval; do
if test "X$pkg" = "X$p"; then
enable_fast_install=yes
fi
done
IFS="$ac_save_ifs"
;;
esac],
enable_fast_install=AC_ENABLE_FAST_INSTALL_DEFAULT)dnl
])
# AC_ENABLE_FAST_INSTALL - set the default to --disable-fast-install
AC_DEFUN(AC_DISABLE_FAST_INSTALL, [AC_BEFORE([$0],[AC_LIBTOOL_SETUP])dnl
AC_ENABLE_FAST_INSTALL(no)])
# AC_PROG_LD - find the path to the GNU or non-GNU linker
AC_DEFUN(AC_PROG_LD,
[AC_ARG_WITH(gnu-ld,
[ --with-gnu-ld assume the C compiler uses GNU ld [default=no]],
test "$withval" = no || with_gnu_ld=yes, with_gnu_ld=no)
AC_REQUIRE([AC_PROG_CC])dnl
AC_REQUIRE([AC_CANONICAL_HOST])dnl
AC_REQUIRE([AC_CANONICAL_BUILD])dnl
ac_prog=ld
if test "$ac_cv_prog_gcc" = yes; then
# Check if gcc -print-prog-name=ld gives a path.
AC_MSG_CHECKING([for ld used by GCC])
ac_prog=`($CC -print-prog-name=ld) 2>&5`
case "$ac_prog" in
# Accept absolute paths.
changequote(,)dnl
[\\/]* | [A-Za-z]:[\\/]*)
re_direlt='/[^/][^/]*/\.\./'
changequote([,])dnl
# Canonicalize the path of ld
ac_prog=`echo $ac_prog| sed 's%\\\\%/%g'`
while echo $ac_prog | grep "$re_direlt" > /dev/null 2>&1; do
ac_prog=`echo $ac_prog| sed "s%$re_direlt%/%"`
done
test -z "$LD" && LD="$ac_prog"
;;
"")
# If it fails, then pretend we aren't using GCC.
ac_prog=ld
;;
*)
# If it is relative, then search for the first ld in PATH.
with_gnu_ld=unknown
;;
esac
elif test "$with_gnu_ld" = yes; then
AC_MSG_CHECKING([for GNU ld])
else
AC_MSG_CHECKING([for non-GNU ld])
fi
AC_CACHE_VAL(ac_cv_path_LD,
[if test -z "$LD"; then
IFS="${IFS= }"; ac_save_ifs="$IFS"; IFS="${IFS}${PATH_SEPARATOR-:}"
for ac_dir in $PATH; do
test -z "$ac_dir" && ac_dir=.
if test -f "$ac_dir/$ac_prog" || test -f "$ac_dir/$ac_prog$ac_exeext"; then
ac_cv_path_LD="$ac_dir/$ac_prog"
# Check to see if the program is GNU ld. I'd rather use --version,
# but apparently some GNU ld's only accept -v.
# Break only if it was the GNU/non-GNU ld that we prefer.
if "$ac_cv_path_LD" -v 2>&1 < /dev/null | egrep '(GNU|with BFD)' > /dev/null; then
test "$with_gnu_ld" != no && break
else
test "$with_gnu_ld" != yes && break
fi
fi
done
IFS="$ac_save_ifs"
else
ac_cv_path_LD="$LD" # Let the user override the test with a path.
fi])
LD="$ac_cv_path_LD"
if test -n "$LD"; then
AC_MSG_RESULT($LD)
else
AC_MSG_RESULT(no)
fi
test -z "$LD" && AC_MSG_ERROR([no acceptable ld found in \$PATH])
AC_PROG_LD_GNU
])
AC_DEFUN(AC_PROG_LD_GNU,
[AC_CACHE_CHECK([if the linker ($LD) is GNU ld], ac_cv_prog_gnu_ld,
[# I'd rather use --version here, but apparently some GNU ld's only accept -v.
if $LD -v 2>&1 </dev/null | egrep '(GNU|with BFD)' 1>&5; then
ac_cv_prog_gnu_ld=yes
else
ac_cv_prog_gnu_ld=no
fi])
])
# AC_PROG_NM - find the path to a BSD-compatible name lister
AC_DEFUN(AC_PROG_NM,
[AC_MSG_CHECKING([for BSD-compatible nm])
AC_CACHE_VAL(ac_cv_path_NM,
[if test -n "$NM"; then
# Let the user override the test.
ac_cv_path_NM="$NM"
else
IFS="${IFS= }"; ac_save_ifs="$IFS"; IFS="${IFS}${PATH_SEPARATOR-:}"
for ac_dir in $PATH /usr/ccs/bin /usr/ucb /bin; do
test -z "$ac_dir" && ac_dir=.
if test -f $ac_dir/nm || test -f $ac_dir/nm$ac_exeext ; then
# Check to see if the nm accepts a BSD-compat flag.
# Adding the `sed 1q' prevents false positives on HP-UX, which says:
# nm: unknown option "B" ignored
if ($ac_dir/nm -B /dev/null 2>&1 | sed '1q'; exit 0) | egrep /dev/null >/dev/null; then
ac_cv_path_NM="$ac_dir/nm -B"
break
elif ($ac_dir/nm -p /dev/null 2>&1 | sed '1q'; exit 0) | egrep /dev/null >/dev/null; then
ac_cv_path_NM="$ac_dir/nm -p"
break
else
ac_cv_path_NM=${ac_cv_path_NM="$ac_dir/nm"} # keep the first match, but
continue # so that we can try to find one that supports BSD flags
fi
fi
done
IFS="$ac_save_ifs"
test -z "$ac_cv_path_NM" && ac_cv_path_NM=nm
fi])
NM="$ac_cv_path_NM"
AC_MSG_RESULT([$NM])
])
# AC_CHECK_LIBM - check for math library
AC_DEFUN(AC_CHECK_LIBM,
[AC_REQUIRE([AC_CANONICAL_HOST])dnl
LIBM=
case "$lt_target" in
*-*-beos* | *-*-cygwin*)
# These system don't have libm
;;
*-ncr-sysv4.3*)
AC_CHECK_LIB(mw, _mwvalidcheckl, LIBM="-lmw")
AC_CHECK_LIB(m, main, LIBM="$LIBM -lm")
;;
*)
AC_CHECK_LIB(m, main, LIBM="-lm")
;;
esac
])
# AC_LIBLTDL_CONVENIENCE[(dir)] - sets LIBLTDL to the link flags for
# the libltdl convenience library, adds --enable-ltdl-convenience to
# the configure arguments. Note that LIBLTDL is not AC_SUBSTed, nor
# is AC_CONFIG_SUBDIRS called. If DIR is not provided, it is assumed
# to be `${top_builddir}/libltdl'. Make sure you start DIR with
# '${top_builddir}/' (note the single quotes!) if your package is not
# flat, and, if you're not using automake, define top_builddir as
# appropriate in the Makefiles.
AC_DEFUN(AC_LIBLTDL_CONVENIENCE, [AC_BEFORE([$0],[AC_LIBTOOL_SETUP])dnl
case "$enable_ltdl_convenience" in
no) AC_MSG_ERROR([this package needs a convenience libltdl]) ;;
"") enable_ltdl_convenience=yes
ac_configure_args="$ac_configure_args --enable-ltdl-convenience" ;;
esac
LIBLTDL=ifelse($#,1,$1,['${top_builddir}/libltdl'])/libltdlc.la
INCLTDL=ifelse($#,1,-I$1,['-I${top_builddir}/libltdl'])
])
# AC_LIBLTDL_INSTALLABLE[(dir)] - sets LIBLTDL to the link flags for
# the libltdl installable library, and adds --enable-ltdl-install to
# the configure arguments. Note that LIBLTDL is not AC_SUBSTed, nor
# is AC_CONFIG_SUBDIRS called. If DIR is not provided, it is assumed
# to be `${top_builddir}/libltdl'. Make sure you start DIR with
# '${top_builddir}/' (note the single quotes!) if your package is not
# flat, and, if you're not using automake, define top_builddir as
# appropriate in the Makefiles.
# In the future, this macro may have to be called after AC_PROG_LIBTOOL.
AC_DEFUN(AC_LIBLTDL_INSTALLABLE, [AC_BEFORE([$0],[AC_LIBTOOL_SETUP])dnl
AC_CHECK_LIB(ltdl, main,
[test x"$enable_ltdl_install" != xyes && enable_ltdl_install=no],
[if test x"$enable_ltdl_install" = xno; then
AC_MSG_WARN([libltdl not installed, but installation disabled])
else
enable_ltdl_install=yes
fi
])
if test x"$enable_ltdl_install" = x"yes"; then
ac_configure_args="$ac_configure_args --enable-ltdl-install"
LIBLTDL=ifelse($#,1,$1,['${top_builddir}/libltdl'])/libltdl.la
INCLTDL=ifelse($#,1,-I$1,['-I${top_builddir}/libltdl'])
else
ac_configure_args="$ac_configure_args --enable-ltdl-install=no"
LIBLTDL="-lltdl"
INCLTDL=
fi
])
dnl old names
AC_DEFUN(AM_PROG_LIBTOOL, [indir([AC_PROG_LIBTOOL])])dnl
AC_DEFUN(AM_ENABLE_SHARED, [indir([AC_ENABLE_SHARED], $@)])dnl
AC_DEFUN(AM_ENABLE_STATIC, [indir([AC_ENABLE_STATIC], $@)])dnl
AC_DEFUN(AM_DISABLE_SHARED, [indir([AC_DISABLE_SHARED], $@)])dnl
AC_DEFUN(AM_DISABLE_STATIC, [indir([AC_DISABLE_STATIC], $@)])dnl
AC_DEFUN(AM_PROG_LD, [indir([AC_PROG_LD])])dnl
AC_DEFUN(AM_PROG_NM, [indir([AC_PROG_NM])])dnl
dnl This is just to silence aclocal about the macro not being used
ifelse([AC_DISABLE_FAST_INSTALL])dnl
# Macro to add for using GNU gettext.
# Ulrich Drepper <drepper@cygnus.com>, 1995.
#
# Modified to never use included libintl.
# Owen Taylor <otaylor@redhat.com>, 12/15/1998
#
#
# This file can be copied and used freely without restrictions. It can
# be used in projects which are not available under the GNU Public License
# but which still want to provide support for the GNU gettext functionality.
# Please note that the actual code is *not* freely available.
# serial 5
AC_DEFUN(AM_GTK_WITH_NLS,
[AC_MSG_CHECKING([whether NLS is requested])
dnl Default is enabled NLS
AC_ARG_ENABLE(nls,
[ --disable-nls do not use Native Language Support],
USE_NLS=$enableval, USE_NLS=yes)
AC_MSG_RESULT($USE_NLS)
AC_SUBST(USE_NLS)
USE_INCLUDED_LIBINTL=no
dnl If we use NLS figure out what method
if test "$USE_NLS" = "yes"; then
# AC_DEFINE(ENABLE_NLS)
# AC_MSG_CHECKING([whether included gettext is requested])
# AC_ARG_WITH(included-gettext,
# [ --with-included-gettext use the GNU gettext library included here],
# nls_cv_force_use_gnu_gettext=$withval,
# nls_cv_force_use_gnu_gettext=no)
# AC_MSG_RESULT($nls_cv_force_use_gnu_gettext)
nls_cv_force_use_gnu_gettext="no"
nls_cv_use_gnu_gettext="$nls_cv_force_use_gnu_gettext"
if test "$nls_cv_force_use_gnu_gettext" != "yes"; then
dnl User does not insist on using GNU NLS library. Figure out what
dnl to use. If gettext or catgets are available (in this order) we
dnl use this. Else we have to fall back to GNU NLS library.
dnl catgets is only used if permitted by option --with-catgets.
nls_cv_header_intl=
nls_cv_header_libgt=
CATOBJEXT=NONE
AC_CHECK_HEADER(libintl.h,
[AC_CACHE_CHECK([for dgettext in libc], gt_cv_func_dgettext_libc,
[AC_TRY_LINK([#include <libintl.h>], [return (int) dgettext ("","")],
gt_cv_func_dgettext_libc=yes, gt_cv_func_dgettext_libc=no)])
if test "$gt_cv_func_dgettext_libc" != "yes"; then
AC_CHECK_LIB(intl, bindtextdomain,
[AC_CACHE_CHECK([for dgettext in libintl],
gt_cv_func_dgettext_libintl,
[AC_CHECK_LIB(intl, dgettext,
gt_cv_func_dgettext_libintl=yes,
gt_cv_func_dgettext_libintl=no)],
gt_cv_func_dgettext_libintl=no)])
fi
if test "$gt_cv_func_dgettext_libintl" = "yes"; then
LIBS="$LIBS -lintl";
fi
if test "$gt_cv_func_dgettext_libc" = "yes" \
|| test "$gt_cv_func_dgettext_libintl" = "yes"; then
AC_DEFINE(HAVE_GETTEXT)
AM_PATH_PROG_WITH_TEST(MSGFMT, msgfmt,
[test -z "`$ac_dir/$ac_word -h 2>&1 | grep 'dv '`"], no)dnl
if test "$MSGFMT" != "no"; then
AC_CHECK_FUNCS(dcgettext)
AC_PATH_PROG(GMSGFMT, gmsgfmt, $MSGFMT)
AM_PATH_PROG_WITH_TEST(XGETTEXT, xgettext,
[test -z "`$ac_dir/$ac_word -h 2>&1 | grep '(HELP)'`"], :)
AC_TRY_LINK(, [extern int _nl_msg_cat_cntr;
return _nl_msg_cat_cntr],
[CATOBJEXT=.gmo
DATADIRNAME=share],
[CATOBJEXT=.mo
DATADIRNAME=lib])
INSTOBJEXT=.mo
fi
fi
# Added by Martin Baulig 12/15/98 for libc5 systems
if test "$gt_cv_func_dgettext_libc" != "yes" \
&& test "$gt_cv_func_dgettext_libintl" = "yes"; then
INTLLIBS=-lintl
LIBS=`echo $LIBS | sed -e 's/-lintl//'`
fi
])
if test "$CATOBJEXT" = "NONE"; then
AC_MSG_CHECKING([whether catgets can be used])
AC_ARG_WITH(catgets,
[ --with-catgets use catgets functions if available],
nls_cv_use_catgets=$withval, nls_cv_use_catgets=no)
AC_MSG_RESULT($nls_cv_use_catgets)
if test "$nls_cv_use_catgets" = "yes"; then
dnl No gettext in C library. Try catgets next.
AC_CHECK_LIB(i, main)
AC_CHECK_FUNC(catgets,
[AC_DEFINE(HAVE_CATGETS)
INTLOBJS="\$(CATOBJS)"
AC_PATH_PROG(GENCAT, gencat, no)dnl
# if test "$GENCAT" != "no"; then
# AC_PATH_PROG(GMSGFMT, gmsgfmt, no)
# if test "$GMSGFMT" = "no"; then
# AM_PATH_PROG_WITH_TEST(GMSGFMT, msgfmt,
# [test -z "`$ac_dir/$ac_word -h 2>&1 | grep 'dv '`"], no)
# fi
# AM_PATH_PROG_WITH_TEST(XGETTEXT, xgettext,
# [test -z "`$ac_dir/$ac_word -h 2>&1 | grep '(HELP)'`"], :)
# USE_INCLUDED_LIBINTL=yes
# CATOBJEXT=.cat
# INSTOBJEXT=.cat
# DATADIRNAME=lib
# INTLDEPS='$(top_builddir)/intl/libintl.a'
# INTLLIBS=$INTLDEPS
# LIBS=`echo $LIBS | sed -e 's/-lintl//'`
# nls_cv_header_intl=intl/libintl.h
# nls_cv_header_libgt=intl/libgettext.h
# fi
])
fi
fi
if test "$CATOBJEXT" = "NONE"; then
dnl Neither gettext nor catgets in included in the C library.
dnl Fall back on GNU gettext library.
nls_cv_use_gnu_gettext=yes
fi
fi
if test "$nls_cv_use_gnu_gettext" != "yes"; then
AC_DEFINE(ENABLE_NLS)
else
# Unset this variable since we use the non-zero value as a flag.
CATOBJEXT=
# dnl Mark actions used to generate GNU NLS library.
# INTLOBJS="\$(GETTOBJS)"
# AM_PATH_PROG_WITH_TEST(MSGFMT, msgfmt,
# [test -z "`$ac_dir/$ac_word -h 2>&1 | grep 'dv '`"], msgfmt)
# AC_PATH_PROG(GMSGFMT, gmsgfmt, $MSGFMT)
# AM_PATH_PROG_WITH_TEST(XGETTEXT, xgettext,
# [test -z "`$ac_dir/$ac_word -h 2>&1 | grep '(HELP)'`"], :)
# AC_SUBST(MSGFMT)
# USE_INCLUDED_LIBINTL=yes
# CATOBJEXT=.gmo
# INSTOBJEXT=.mo
# DATADIRNAME=share
# INTLDEPS='$(top_builddir)/intl/libintl.a'
# INTLLIBS=$INTLDEPS
# LIBS=`echo $LIBS | sed -e 's/-lintl//'`
# nls_cv_header_intl=intl/libintl.h
# nls_cv_header_libgt=intl/libgettext.h
fi
dnl Test whether we really found GNU xgettext.
if test "$XGETTEXT" != ":"; then
dnl If it is no GNU xgettext we define it as : so that the
dnl Makefiles still can work.
if $XGETTEXT --omit-header /dev/null 2> /dev/null; then
: ;
else
AC_MSG_RESULT(
[found xgettext program is not GNU xgettext; ignore it])
XGETTEXT=":"
fi
fi
# We need to process the po/ directory.
POSUB=po
else
DATADIRNAME=share
nls_cv_header_intl=intl/libintl.h
nls_cv_header_libgt=intl/libgettext.h
fi
AC_LINK_FILES($nls_cv_header_libgt, $nls_cv_header_intl)
AC_OUTPUT_COMMANDS(
[case "$CONFIG_FILES" in *po/Makefile.in*)
sed -e "/POTFILES =/r po/POTFILES" po/Makefile.in > po/Makefile
esac])
# # If this is used in GNU gettext we have to set USE_NLS to `yes'
# # because some of the sources are only built for this goal.
# if test "$PACKAGE" = gettext; then
# USE_NLS=yes
# USE_INCLUDED_LIBINTL=yes
# fi
dnl These rules are solely for the distribution goal. While doing this
dnl we only have to keep exactly one list of the available catalogs
dnl in configure.in.
for lang in $ALL_LINGUAS; do
GMOFILES="$GMOFILES $lang.gmo"
POFILES="$POFILES $lang.po"
done
dnl Make all variables we use known to autoconf.
AC_SUBST(USE_INCLUDED_LIBINTL)
AC_SUBST(CATALOGS)
AC_SUBST(CATOBJEXT)
AC_SUBST(DATADIRNAME)
AC_SUBST(GMOFILES)
AC_SUBST(INSTOBJEXT)
AC_SUBST(INTLDEPS)
AC_SUBST(INTLLIBS)
AC_SUBST(INTLOBJS)
AC_SUBST(POFILES)
AC_SUBST(POSUB)
])
AC_DEFUN(AM_GTK_GNU_GETTEXT,
[AC_REQUIRE([AC_PROG_MAKE_SET])dnl
AC_REQUIRE([AC_PROG_CC])dnl
AC_REQUIRE([AC_PROG_RANLIB])dnl
AC_REQUIRE([AC_ISC_POSIX])dnl
AC_REQUIRE([AC_HEADER_STDC])dnl
AC_REQUIRE([AC_C_CONST])dnl
AC_REQUIRE([AC_C_INLINE])dnl
AC_REQUIRE([AC_TYPE_OFF_T])dnl
AC_REQUIRE([AC_TYPE_SIZE_T])dnl
AC_REQUIRE([AC_FUNC_ALLOCA])dnl
AC_REQUIRE([AC_FUNC_MMAP])dnl
AC_CHECK_HEADERS([argz.h limits.h locale.h nl_types.h malloc.h string.h \
unistd.h sys/param.h])
AC_CHECK_FUNCS([getcwd munmap putenv setenv setlocale strchr strcasecmp \
strdup __argz_count __argz_stringify __argz_next])
if test "${ac_cv_func_stpcpy+set}" != "set"; then
AC_CHECK_FUNCS(stpcpy)
fi
if test "${ac_cv_func_stpcpy}" = "yes"; then
AC_DEFINE(HAVE_STPCPY)
fi
AM_LC_MESSAGES
AM_GTK_WITH_NLS
if test "x$CATOBJEXT" != "x"; then
if test "x$ALL_LINGUAS" = "x"; then
LINGUAS=
else
AC_MSG_CHECKING(for catalogs to be installed)
NEW_LINGUAS=
for lang in ${LINGUAS=$ALL_LINGUAS}; do
case "$ALL_LINGUAS" in
*$lang*) NEW_LINGUAS="$NEW_LINGUAS $lang" ;;
esac
done
LINGUAS=$NEW_LINGUAS
AC_MSG_RESULT($LINGUAS)
fi
dnl Construct list of names of catalog files to be constructed.
if test -n "$LINGUAS"; then
for lang in $LINGUAS; do CATALOGS="$CATALOGS $lang$CATOBJEXT"; done
fi
fi
dnl The reference to <locale.h> in the installed <libintl.h> file
dnl must be resolved because we cannot expect the users of this
dnl to define HAVE_LOCALE_H.
if test $ac_cv_header_locale_h = yes; then
INCLUDE_LOCALE_H="#include <locale.h>"
else
INCLUDE_LOCALE_H="\
/* The system does not provide the header <locale.h>. Take care yourself. */"
fi
AC_SUBST(INCLUDE_LOCALE_H)
dnl Determine which catalog format we have (if any is needed)
dnl For now we know about two different formats:
dnl Linux libc-5 and the normal X/Open format
test -d intl || mkdir intl
if test "$CATOBJEXT" = ".cat"; then
AC_CHECK_HEADER(linux/version.h, msgformat=linux, msgformat=xopen)
dnl Transform the SED scripts while copying because some dumb SEDs
dnl cannot handle comments.
sed -e '/^#/d' $srcdir/intl/$msgformat-msg.sed > intl/po2msg.sed
fi
dnl po2tbl.sed is always needed.
sed -e '/^#.*[^\\]$/d' -e '/^#$/d' \
$srcdir/intl/po2tbl.sed.in > intl/po2tbl.sed
dnl In the intl/Makefile.in we have a special dependency which makes
dnl only sense for gettext. We comment this out for non-gettext
dnl packages.
if test "$PACKAGE" = "gettext"; then
GT_NO="#NO#"
GT_YES=
else
GT_NO=
GT_YES="#YES#"
fi
AC_SUBST(GT_NO)
AC_SUBST(GT_YES)
dnl If the AC_CONFIG_AUX_DIR macro for autoconf is used we possibly
dnl find the mkinstalldirs script in another subdir but ($top_srcdir).
dnl Try to locate is.
MKINSTALLDIRS=
if test -n "$ac_aux_dir"; then
MKINSTALLDIRS="$ac_aux_dir/mkinstalldirs"
fi
if test -z "$MKINSTALLDIRS"; then
MKINSTALLDIRS="\$(top_srcdir)/mkinstalldirs"
fi
AC_SUBST(MKINSTALLDIRS)
dnl *** For now the libtool support in intl/Makefile is not for real.
l=
AC_SUBST(l)
dnl Generate list of files to be processed by xgettext which will
dnl be included in po/Makefile.
test -d po || mkdir po
if test "x$srcdir" != "x."; then
if test "x`echo $srcdir | sed 's@/.*@@'`" = "x"; then
posrcprefix="$srcdir/"
else
posrcprefix="../$srcdir/"
fi
else
posrcprefix="../"
fi
rm -f po/POTFILES
sed -e "/^#/d" -e "/^\$/d" -e "s,.*, $posrcprefix& \\\\," -e "\$s/\(.*\) \\\\/\1/" \
< $srcdir/po/POTFILES.in > po/POTFILES
])

86
autogen.sh Executable file
View File

@@ -0,0 +1,86 @@
#!/bin/sh
# Run this to generate all the initial makefiles, etc.
srcdir=`dirname $0`
test -z "$srcdir" && srcdir=.
ORIGDIR=`pwd`
cd $srcdir
PROJECT=Gtk+
TEST_TYPE=-d
FILE=gdk
DIE=0
(autoconf --version) < /dev/null > /dev/null 2>&1 || {
echo
echo "You must have autoconf installed to compile $PROJECT."
echo "Download the appropriate package for your distribution,"
echo "or get the source tarball at ftp://ftp.gnu.org/pub/gnu/"
DIE=1
}
(automake --version) < /dev/null > /dev/null 2>&1 || {
echo
echo "You must have automake installed to compile $PROJECT."
echo "Get ftp://ftp.cygnus.com/pub/home/tromey/automake-1.2d.tar.gz"
echo "(or a newer version if it is available)"
DIE=1
}
if test "$DIE" -eq 1; then
exit 1
fi
test $TEST_TYPE $FILE || {
echo "You must run this script in the top-level $PROJECT directory"
exit 1
}
if test -z "$*"; then
echo "I am going to run ./configure with no arguments - if you wish "
echo "to pass any to it, please specify them on the $0 command line."
fi
case $CC in
*xlc | *xlc\ * | *lcc | *lcc\ *) am_opt=--include-deps;;
esac
if test -z "$ACLOCAL_FLAGS"; then
acdir=`aclocal --print-ac-dir`
m4list="glib.m4 gettext.m4"
for file in $m4list
do
if [ ! -f "$acdir/$file" ]; then
echo "WARNING: aclocal's directory is $acdir, but..."
echo " no file $acdir/$file"
echo " You may see fatal macro warnings below."
echo " If these files are installed in /some/dir, set the ACLOCAL_FLAGS "
echo " environment variable to \"-I /some/dir\", or install"
echo " $acdir/$file."
echo ""
fi
done
fi
echo "Running gettextize... Ignore non-fatal messages."
# Hmm, we specify --force here, since otherwise things dont'
# get added reliably, but we don't want to overwrite intl
# while making dist.
echo "no" | gettextize --copy --force
aclocal $ACLOCAL_FLAGS
# optionally feature autoheader
(autoheader --version) < /dev/null > /dev/null 2>&1 && autoheader
automake -a $am_opt
autoconf
cd $ORIGDIR
$srcdir/configure --enable-maintainer-mode "$@"
echo
echo "Now type 'make' to compile $PROJECT."

View File

@@ -1,72 +0,0 @@
{
"app-id": "org.gtk.Demo4",
"runtime": "org.gnome.Platform",
"runtime-version": "master",
"sdk": "org.gnome.Sdk",
"command": "gtk4-demo",
"tags": ["devel", "development", "nightly"],
"desktop-file-name-prefix": "(Development) ",
"finish-args": [
"--device=dri",
"--share=ipc",
"--socket=fallback-x11",
"--socket=wayland",
"--talk-name=org.gtk.vfs", "--talk-name=org.gtk.vfs.*"
],
"cleanup": [
"/include",
"/lib/pkgconfig", "/share/pkgconfig",
"/share/aclocal",
"/man", "/share/man", "/share/gtk-doc",
"*.la", ".a",
"/lib/girepository-1.0",
"/share/gir-1.0",
"/share/doc"
],
"modules": [
{
"name" : "wayland",
"buildsystem" : "autotools",
"builddir" : true,
"config-opts" : [
"--disable-documentation"
],
"sources" : [
{
"type" : "git",
"url" : "https://github.com/wayland-project/wayland.git"
}
]
},
{
"name": "graphene",
"buildsystem": "meson",
"builddir": true,
"config-opts": [
"--libdir=/app/lib",
"-Dtests=false",
"-Dbenchmarks=false"
],
"sources": [
{
"type": "git",
"url": "https://github.com/ebassi/graphene.git"
}
]
},
{
"name": "gtk",
"buildsystem": "meson",
"builddir": true,
"config-opts": [
"--libdir=/app/lib"
],
"sources": [
{
"type": "git",
"url": "https://gitlab.gnome.org/GNOME/gtk.git"
}
]
}
]
}

View File

@@ -1,72 +0,0 @@
{
"app-id": "org.gtk.IconBrowser4",
"runtime": "org.gnome.Platform",
"runtime-version": "master",
"sdk": "org.gnome.Sdk",
"command": "gtk4-icon-browser",
"tags": ["devel", "development", "nightly"],
"desktop-file-name-prefix": "(Development) ",
"finish-args": [
"--device=dri",
"--share=ipc",
"--socket=fallback-x11",
"--socket=wayland",
"--talk-name=org.gtk.vfs", "--talk-name=org.gtk.vfs.*"
],
"cleanup": [
"/include",
"/lib/pkgconfig", "/share/pkgconfig",
"/share/aclocal",
"/man", "/share/man", "/share/gtk-doc",
"*.la", ".a",
"/lib/girepository-1.0",
"/share/gir-1.0",
"/share/doc"
],
"modules": [
{
"name" : "wayland",
"buildsystem" : "autotools",
"builddir" : true,
"config-opts" : [
"--disable-documentation"
],
"sources" : [
{
"type" : "git",
"url" : "https://github.com/wayland-project/wayland.git"
}
]
},
{
"name": "graphene",
"buildsystem": "meson",
"builddir": true,
"config-opts": [
"--libdir=/app/lib",
"-Dtests=false",
"-Dbenchmarks=false"
],
"sources": [
{
"type": "git",
"url": "https://github.com/ebassi/graphene.git"
}
]
},
{
"name": "gtk",
"buildsystem": "meson",
"builddir": true,
"config-opts": [
"--libdir=/app/lib"
],
"sources": [
{
"type": "git",
"url": "https://gitlab.gnome.org/GNOME/gtk.git"
}
]
}
]
}

View File

@@ -1,72 +0,0 @@
{
"app-id": "org.gtk.WidgetFactory4",
"runtime": "org.gnome.Platform",
"runtime-version": "master",
"sdk": "org.gnome.Sdk",
"command": "gtk4-widget-factory",
"tags": ["devel", "development", "nightly"],
"desktop-file-name-prefix": "(Development) ",
"finish-args": [
"--device=dri",
"--share=ipc",
"--socket=fallback-x11",
"--socket=wayland",
"--talk-name=org.gtk.vfs", "--talk-name=org.gtk.vfs.*"
],
"cleanup": [
"/include",
"/lib/pkgconfig", "/share/pkgconfig",
"/share/aclocal",
"/man", "/share/man", "/share/gtk-doc",
"*.la", ".a",
"/lib/girepository-1.0",
"/share/gir-1.0",
"/share/doc"
],
"modules": [
{
"name" : "wayland",
"buildsystem" : "autotools",
"builddir" : true,
"config-opts" : [
"--disable-documentation"
],
"sources" : [
{
"type" : "git",
"url" : "https://github.com/wayland-project/wayland.git"
}
]
},
{
"name": "graphene",
"buildsystem": "meson",
"builddir": true,
"config-opts": [
"--libdir=/app/lib",
"-Dtests=false",
"-Dbenchmarks=false"
],
"sources": [
{
"type": "git",
"url": "https://github.com/ebassi/graphene.git"
}
]
},
{
"name": "gtk",
"buildsystem": "meson",
"builddir": true,
"config-opts": [
"--libdir=/app/lib"
],
"sources": [
{
"type": "git",
"url": "https://gitlab.gnome.org/GNOME/gtk.git"
}
]
}
]
}

View File

@@ -1,31 +0,0 @@
#!/usr/bin/env python3
import os
import sys
import subprocess
if 'DESTDIR' not in os.environ:
gtk_api_version = sys.argv[1]
gtk_abi_version = sys.argv[2]
gtk_libdir = sys.argv[3]
gtk_datadir = sys.argv[4]
gtk_moduledir = os.path.join(gtk_libdir, 'gtk-' + gtk_api_version, gtk_abi_version)
gtk_printmodule_dir = os.path.join(gtk_moduledir, 'printbackends')
gtk_immodule_dir = os.path.join(gtk_moduledir, 'immodules')
print('Compiling GSettings schemas...')
subprocess.call(['glib-compile-schemas',
os.path.join(gtk_datadir, 'glib-2.0', 'schemas')])
print('Updating icon cache...')
subprocess.call(['gtk4-update-icon-cache', '-q', '-t' ,'-f',
os.path.join(gtk_datadir, 'icons', 'hicolor')])
print('Updating module cache for print backends...')
os.makedirs(gtk_printmodule_dir, exist_ok=True)
subprocess.call(['gio-querymodules', gtk_printmodule_dir])
print('Updating module cache for input methods...')
os.makedirs(gtk_immodule_dir, exist_ok=True)
subprocess.call(['gio-querymodules', gtk_immodule_dir])

1121
config.guess vendored Executable file

File diff suppressed because it is too large Load Diff

View File

@@ -1,297 +0,0 @@
/* config.h.in. Generated from configure.ac by autoheader. */
/* always defined to indicate that i18n is enabled */
#define ENABLE_NLS 1
/* The prefix for our gettext translation domains. */
#mesondefine GETTEXT_PACKAGE
/* Disable deprecation warnings from glib */
#mesondefine GLIB_DISABLE_DEPRECATION_WARNINGS
/* Define the location where the catalogs will be installed */
#mesondefine GTK_LOCALEDIR
/* Define to 1 if you have the `bind_textdomain_codeset' function. */
#mesondefine HAVE_BIND_TEXTDOMAIN_CODESET
/* Have the cloudproviders library */
#mesondefine HAVE_CLOUDPROVIDERS
/* define if we have colord */
#mesondefine HAVE_COLORD
/* Define to 1 if you have the <crt_externs.h> header file. */
#mesondefine HAVE_CRT_EXTERNS_H
/* Define to 1 if you have the `dcgettext' function. */
#mesondefine HAVE_DCGETTEXT
/* Define to 1 if you have the declaration of `isinf', and to 0 if you don't.
*/
#mesondefine HAVE_DECL_ISINF
/* Define to 1 if you have the declaration of `isnan', and to 0 if you don't.
*/
#mesondefine HAVE_DECL_ISNAN
/* Define to 1 if you have the <dlfcn.h> header file. */
#mesondefine HAVE_DLFCN_H
/* Have the ffmpeg library */
#mesondefine HAVE_FFMPEG
/* Define to 1 if you have the <ftw.h> header file. */
#mesondefine HAVE_FTW_H
/* Define to 1 if you have the `getpagesize' function. */
#mesondefine HAVE_GETPAGESIZE
/* Define to 1 if you have the `getresuid' function. */
#mesondefine HAVE_GETRESUID
/* Define if gio-unix is available */
#mesondefine HAVE_GIO_UNIX
/* Define if GStreamer support is available */
#mesondefine HAVE_GSTREAMER
/* Define to 1 if you have the <inttypes.h> header file. */
#mesondefine HAVE_INTTYPES_H
/* Define to 1 if the system has the type `IPrintDialogCallback'. */
#mesondefine HAVE_IPRINTDIALOGCALLBACK
/* Define to 1 if you have the <locale.h> header file. */
#mesondefine HAVE_LOCALE_H
/* Define to 1 if you have the `lstat' function. */
#mesondefine HAVE_LSTAT
/* Define to 1 if you have the `mallinfo' function. */
#mesondefine HAVE_MALLINFO
/* Define to 1 if you have the <memory.h> header file. */
#mesondefine HAVE_MEMORY_H
/* Define to 1 if you have the `mkstemp' function. */
#mesondefine HAVE_MKSTEMP
/* Define to 1 if you have a working `mmap' system call. */
#mesondefine HAVE_MMAP
/* Define to 1 if you have the `nearbyint' function. */
#mesondefine HAVE_NEARBYINT
/* Define to 1 if you have the `posix_fallocate' function. */
#mesondefine HAVE_POSIX_FALLOCATE
/* Have the Xrandr extension library */
#mesondefine HAVE_RANDR
/* Have the Xrandr 1.5 extension library */
#mesondefine HAVE_RANDR15
/* Define to 1 if you have the `rint' function. */
#mesondefine HAVE_RINT
/* Define to 1 if you have the `round' function. */
#mesondefine HAVE_ROUND
/* Define to 1 if you have the `sincos' function. */
#mesondefine HAVE_SINCOS
/* Define to 1 if you have the `log2` function */
#mesondefine HAVE_LOG2
/* Define to 1 if you ahve the `exp2` function */
#mesondefine HAVE_EXP2
/* Define to 1 if you have the <stdint.h> header file. */
#mesondefine HAVE_STDINT_H
/* Define to 1 if you have the <stdlib.h> header file. */
#mesondefine HAVE_STDLIB_H
/* Define to 1 if you have the <strings.h> header file. */
#mesondefine HAVE_STRINGS_H
/* Define to 1 if you have the <string.h> header file. */
#mesondefine HAVE_STRING_H
/* Define to 1 if you have the <sys/mman.h> header file. */
#mesondefine HAVE_SYS_MMAN_H
/* Define to 1 if you have the <sys/param.h> header file. */
#mesondefine HAVE_SYS_PARAM_H
/* Have the sysprof-capture library */
#mesondefine HAVE_SYSPROF_CAPTURE
/* Define to 1 if you have the <sys/stat.h> header file. */
#mesondefine HAVE_SYS_STAT_H
/* Define to 1 if you have the <sys/time.h> header file. */
#mesondefine HAVE_SYS_TIME_H
/* Define to 1 if you have the <sys/types.h> header file. */
#mesondefine HAVE_SYS_TYPES_H
/* Define to 1 if you have the <unistd.h> header file. */
#mesondefine HAVE_UNISTD_H
/* Have the XCOMPOSITE X extension */
#mesondefine HAVE_XCOMPOSITE
/* Have the Xcursor library */
#mesondefine HAVE_XCURSOR
/* Have the XDAMAGE X extension */
#mesondefine HAVE_XDAMAGE
/* Have the XFIXES X extension */
#mesondefine HAVE_XFIXES
/* Define to 1 if XFree Xinerama is available */
#mesondefine HAVE_XFREE_XINERAMA
/* Have XGenericEvent */
#mesondefine HAVE_XGENERICEVENTS
/* Define to use XKB extension */
#mesondefine HAVE_XKB
/* Have the SYNC extension library */
#mesondefine HAVE_XSYNC
/* Define to 1 if you have the `_lock_file' function */
#mesondefine HAVE__LOCK_FILE
/* Define to 1 if you have the `flockfile' function */
#mesondefine HAVE_FLOCKFILE
/* Define if _NL_MEASUREMENT_MEASUREMENT is available */
#mesondefine HAVE__NL_MEASUREMENT_MEASUREMENT
/* Define if _NL_PAPER_HEIGHT is available */
#mesondefine HAVE__NL_PAPER_HEIGHT
/* Define if _NL_PAPER_WIDTH is available */
#mesondefine HAVE__NL_PAPER_WIDTH
/* Define if _NL_TIME_FIRST_WEEKDAY is available */
#mesondefine HAVE__NL_TIME_FIRST_WEEKDAY
/* Define to the sub-directory where libtool stores uninstalled libraries. */
#mesondefine LT_OBJDIR
/* Define to 1 if your C compiler doesn't accept -c and -o together. */
#mesondefine NO_MINUS_C_MINUS_O
/* Define to the address where bug reports for this package should be sent. */
#mesondefine PACKAGE_BUGREPORT
/* Define to the full name of this package. */
#mesondefine PACKAGE_NAME
/* Define to the full name and version of this package. */
#mesondefine PACKAGE_STRING
/* Define to the one symbol short name of this package. */
#mesondefine PACKAGE_TARNAME
/* Define to the home page for this package. */
#mesondefine PACKAGE_URL
/* Define to the version of this package. */
#mesondefine PACKAGE_VERSION
/* Use NSBundle functions to determine load paths for libraries, translations,
etc. */
#mesondefine QUARTZ_RELOCATION
/* Define to 1 if you have the ANSI C header files. */
#mesondefine STDC_HEADERS
/* Enable extensions on AIX 3, Interix. */
#ifndef _ALL_SOURCE
# undef _ALL_SOURCE
#endif
/* Enable GNU extensions on systems that have them. */
#ifndef _GNU_SOURCE
# undef _GNU_SOURCE
#endif
/* Enable threading extensions on Solaris. */
#ifndef _POSIX_PTHREAD_SEMANTICS
# undef _POSIX_PTHREAD_SEMANTICS
#endif
/* Enable extensions on HP NonStop. */
#ifndef _TANDEM_SOURCE
# undef _TANDEM_SOURCE
#endif
/* Enable general extensions on Solaris. */
#ifndef __EXTENSIONS__
# undef __EXTENSIONS__
#endif
/* Define to 1 if XInput 2.2 is available */
#mesondefine XINPUT_2_2
/* Define to 1 if the X Window System is missing or not being used. */
#mesondefine X_DISPLAY_MISSING
/* Enable large inode numbers on Mac OS X 10.5. */
#ifndef _DARWIN_USE_64_BIT_INODE
# define _DARWIN_USE_64_BIT_INODE 1
#endif
/* Number of bits in a file offset, on hosts where this is settable. */
#mesondefine _FILE_OFFSET_BITS
/* defines how to decorate public symbols while building */
#mesondefine _GDK_EXTERN
/* Define for large files, on AIX-style hosts. */
#mesondefine _LARGE_FILES
/* Define to 1 if on MINIX. */
#mesondefine _MINIX
/* Define to 2 if the system does not provide POSIX.1 features except with
this defined. */
#mesondefine _POSIX_1_SOURCE
/* Define to 1 if you need to in order for `stat' and other things to work. */
#mesondefine _POSIX_SOURCE
/* Define to `int' if <sys/types.h> doesn't define. */
#mesondefine gid_t
/* Define to `int' if <sys/types.h> doesn't define. */
#mesondefine uid_t
/* Define to 1 if linux/memfd.h exists */
#mesondefine HAVE_LINUX_MEMFD_H
#mesondefine HAVE_LINUX_INPUT_H
#mesondefine HAVE_DEV_EVDEV_INPUT_H
#mesondefine GTK_SYSCONFDIR
#mesondefine GTK_LOCALEDIR
#mesondefine GTK_DATADIR
#mesondefine GTK_LIBDIR
#mesondefine GTK_PRINT_BACKENDS
#mesondefine HAVE_CAIRO_SCRIPT_INTERPRETER
#mesondefine HAVE_HARFBUZZ
#mesondefine HAVE_PANGOFT
#mesondefine ISO_CODES_PREFIX

1232
config.sub vendored Executable file

File diff suppressed because it is too large Load Diff

575
configure.in Normal file
View File

@@ -0,0 +1,575 @@
# Process this file with autoconf to produce a configure script.
AC_INIT(gdk/gdktypes.h)
# In the following, there are a the following variants
# of GLib cflags and libs variables
#
# GLIB_CFLAGS: cflags for compiling libraries and example progs
# GLIB_LIBS: libraries for linking example programs
# GLIB_DEPLIBS: libraries for linking libraries against
# glib_cflags: cflags to store in gtk-config
# glib_libs: libs to store in gtk-config
# glib_thread_cflags: cflags to store in gtk-config for gtk-config gthread
# glib_thread_libs: libs to store in gtk-config for gtk-config gthread
# Save this value here, since automake will set cflags later
cflags_set=${CFLAGS+set}
dnl we need to AC_DIVERT_PUSH/AC_DIVERT_POP these variable definitions so they
dnl are available for $ac_help expansion (don't we all *love* autoconf?)
AC_DIVERT_PUSH(AC_DIVERSION_NOTICE)dnl
#
# Making releases:
# GTK_MICRO_VERSION += 1;
# GTK_INTERFACE_AGE += 1;
# GTK_BINARY_AGE += 1;
# if any functions have been added, set GTK_INTERFACE_AGE to 0.
# if backwards compatibility has been broken,
# set GTK_BINARY_AGE and GTK_INTERFACE_AGE to 0.
#
GTK_MAJOR_VERSION=1
GTK_MINOR_VERSION=2
GTK_MICRO_VERSION=10
GTK_INTERFACE_AGE=1
GTK_BINARY_AGE=10
GTK_VERSION=$GTK_MAJOR_VERSION.$GTK_MINOR_VERSION.$GTK_MICRO_VERSION
dnl
AC_DIVERT_POP()dnl
AC_SUBST(GTK_MAJOR_VERSION)
AC_SUBST(GTK_MINOR_VERSION)
AC_SUBST(GTK_MICRO_VERSION)
AC_SUBST(GTK_INTERFACE_AGE)
AC_SUBST(GTK_BINARY_AGE)
AC_SUBST(GTK_VERSION)
# libtool versioning
LT_RELEASE=$GTK_MAJOR_VERSION.$GTK_MINOR_VERSION
LT_CURRENT=`expr $GTK_MICRO_VERSION - $GTK_INTERFACE_AGE`
LT_REVISION=$GTK_INTERFACE_AGE
LT_AGE=`expr $GTK_BINARY_AGE - $GTK_INTERFACE_AGE`
AC_SUBST(LT_RELEASE)
AC_SUBST(LT_CURRENT)
AC_SUBST(LT_REVISION)
AC_SUBST(LT_AGE)
# For automake.
VERSION=$GTK_VERSION
PACKAGE=gtk+
# Save this value here, since automake will set cflags later
cflags_set=${CFLAGS+set}
dnl Initialize automake stuff
AM_INIT_AUTOMAKE($PACKAGE, $VERSION, no-define)
# Specify a configuration file
AM_CONFIG_HEADER(config.h)
dnl Initialize libtool
AM_PROG_LIBTOOL
dnl Initialize maintainer mode
AM_MAINTAINER_MODE
AC_CANONICAL_HOST
dnl figure debugging default, prior to $ac_help setup
dnl
AC_DIVERT_PUSH(AC_DIVERSION_NOTICE)dnl
if test `expr $GTK_MINOR_VERSION \% 2` = 1 ; then
debug_default=yes
else
debug_default=minimum
fi
AC_DIVERT_POP()dnl
dnl declare --enable-* args and collect ac_help strings
AC_ARG_ENABLE(debug, [ --enable-debug=[no/minimum/yes] turn on debugging [default=$debug_default]],,enable_debug=$debug_default)
AC_ARG_ENABLE(shm, [ --enable-shm support shared memory if available [default=yes]],
echo $enable_shm, enable_shm="yes")
AC_ARG_ENABLE(ansi, [ --enable-ansi turn on strict ansi [default=no]],
, enable_ansi=no)
AC_ARG_WITH(glib, [ --with-glib=DIR Use uninstalled copy of glib])
AC_ARG_ENABLE(xim, [ --enable-xim support XIM [default=yes]],
, enable_xim="yes")
AC_ARG_ENABLE(xim_inst, [ --disable-xim-inst does not use xim instantiate callback],
, enable_xim_inst="maybe")
AC_ARG_ENABLE(rebuilds, [ --disable-rebuilds disable all source autogeneration rules],,enable_rebuilds=yes)
AC_ARG_WITH(locale, [ --with-locale=LOCALE locale name you want to use ])
AC_ARG_WITH(xinput, [ --with-xinput=[no/gxi/xfree] support XInput ])
AC_ARG_WITH(native_locale, [ --with-native-locale=[yes/no] Use native locale support [default=no]],,with_native_locale=no)
if test "x$enable_debug" = "xyes"; then
test "$cflags_set" = set || CFLAGS="$CFLAGS -g"
GTK_DEBUG_FLAGS="-DG_ENABLE_DEBUG"
else
if test "x$enable_debug" = "xno"; then
GTK_DEBUG_FLAGS="-DG_DISABLE_ASSERT -DG_DISABLE_CHECKS -DGTK_NO_CHECK_CASTS"
else
GTK_DEBUG_FLAGS="-DGTK_NO_CHECK_CASTS"
fi
fi
AC_DEFINE_UNQUOTED(GTK_COMPILED_WITH_DEBUGGING, "${enable_debug}")
# Build time sanity check...
AM_SANITY_CHECK
# Checks for programs.
AC_PROG_CC
AC_ISC_POSIX
AM_PROG_CC_STDC
AC_PROG_INSTALL
AC_PROG_MAKE_SET
changequote(,)dnl
if test "x$GCC" = "xyes"; then
case " $CFLAGS " in
*[\ \ ]-Wall[\ \ ]*) ;;
*) CFLAGS="$CFLAGS -Wall" ;;
esac
if test "x$enable_ansi" = "xyes"; then
case " $CFLAGS " in
*[\ \ ]-ansi[\ \ ]*) ;;
*) CFLAGS="$CFLAGS -ansi" ;;
esac
case " $CFLAGS " in
*[\ \ ]-pedantic[\ \ ]*) ;;
*) CFLAGS="$CFLAGS -pedantic" ;;
esac
fi
fi
changequote([,])dnl
# Honor aclocal flags
ACLOCAL="$ACLOCAL $ACLOCAL_FLAGS"
# define a MAINT-like variable REBUILD which is set if Perl
# and awk are found, so autogenerated sources can be rebuilt
AC_PROG_AWK
AC_CHECK_PROGS(PERL, perl5 perl)
# We would like indent, but don't require it.
AC_CHECK_PROG(INDENT, indent, indent)
REBUILD=\#
if test "x$enable_rebuilds" = "xyes" && \
test -n "$PERL" && \
$PERL -e 'exit !($] >= 5.002)' > /dev/null 2>&1 && \
test -n "$AWK" ; then
REBUILD=
fi
AC_SUBST(REBUILD)
AC_MSG_CHECKING(whether make is GNU Make)
STRIP_BEGIN=
STRIP_END=
if $ac_make --version 2>/dev/null | grep '^GNU Make ' >/dev/null ; then
STRIP_BEGIN='$(strip $(STRIP_DUMMY)'
STRIP_END=')'
AC_MSG_RESULT(yes)
else
AC_MSG_RESULT(no)
fi
dnl some Make 3.79 $(strip ) versions are broken and require an empty arg
STRIP_DUMMY=
AC_SUBST(STRIP_DUMMY)
AC_SUBST(STRIP_BEGIN)
AC_SUBST(STRIP_END)
# i18n stuff
ALL_LINGUAS="az ca cs da de el es et eu fi fr ga gl hr hu it ja ko lt nl no nn pl pt pt_BR ro ru sk sl sp sr sv tr uk vi wa zh_CN.GB2312 zh_TW.Big5"
AM_GTK_GNU_GETTEXT
LIBS="$LIBS $INTLLIBS"
# AM_GTK_GNU_GETTEXT above substs $DATADIRNAME
# this is the directory where the *.{mo,gmo} files are installed
gtklocaledir='${prefix}/${DATADIRNAME}/locale'
AC_SUBST(gtklocaledir)
dnl The DU4 header files don't provide library prototypes unless
dnl -std1 is given to the native cc.
AC_MSG_CHECKING([for extra flags to get ANSI library prototypes])
gtk_save_LIBS=$LIBS
LIBS="$LIBS -lm"
AC_TRY_RUN([#include <math.h>
int main (void) { return (log(1) != log(1.)); }],
AC_MSG_RESULT(none needed),
gtk_save_CFLAGS=$CFLAGS
CFLAGS="$CFLAGS -std1"
AC_TRY_RUN([#include <math.h>
int main (void) { return (log(1) != log(1.)); }],
AC_MSG_RESULT(-std1),
AC_MSG_RESULT()
CFLAGS=$gtk_save_CFLAGS
AC_MSG_WARN(
[No ANSI prototypes found in library. (-std1 didn't work.)]),
true
),
AC_MSG_RESULT(none needed)
)
LIBS=$gtk_save_LIBS
dnl NeXTStep cc seems to need this
AC_MSG_CHECKING([for extra flags for POSIX compliance])
AC_TRY_COMPILE([#include <dirent.h>], [DIR *dir;],
AC_MSG_RESULT(none needed),
gtk_save_CFLAGS=$CFLAGS
CFLAGS="$CFLAGS -posix"
AC_TRY_COMPILE([#include <dirent.h>], [DIR *dir;],
AC_MSG_RESULT(-posix),
AC_MSG_RESULT()
CFLAGS=$gtk_save_CFLAGS
AC_MSG_WARN([Could not determine POSIX flag. (-posix didn't work.)])))
if test x$with_glib = xyes ; then
AC_MSG_ERROR([
*** Directory must be specified for --with-glib])
fi
if test x$with_glib = x ; then
# Look for separately installed glib
AM_PATH_GLIB(1.2.8,,
AC_MSG_ERROR([
*** GLIB 1.2.8 or better is required. The latest version of GLIB
*** is always available from ftp://ftp.gtk.org/.]),
gmodule gthread)
# we do not want to make all gtk progs to link to thread libraries.
glib_cflags=`$GLIB_CONFIG glib gmodule --cflags`
glib_thread_cflags="$GLIB_CFLAGS"
glib_libs=`$GLIB_CONFIG glib gmodule --libs`
glib_thread_libs="$GLIB_LIBS"
GLIB_LIBS="$glib_libs"
GLIB_DEPLIBS="$glib_libs"
else
# Use uninstalled glib (assume they got the version right)
GLIB_CONFIG=$with_glib/glib-config
if test -x $GLIB_CONFIG ; then
:
else
AC_MSG_ERROR([GLIB directory ($with_glib) not present or not configured])
fi
# For use in gtk-config
glib_cflags=`$GLIB_CONFIG --cflags gmodule`
glib_thread_cflags=`$GLIB_CONFIG --cflags gmodule gthread`
glib_libs=`$GLIB_CONFIG --libs gmodule`
glib_thread_libs=`$GLIB_CONFIG --libs gmodule gthread`
glib_release=`$GLIB_CONFIG --version | sed 's%\\.[[0-9]]*$%%'`
# canonicalize relative paths
case $with_glib in
/*)
glib_dir=$with_glib
;;
*)
glib_dir="\$(top_builddir)/$with_glib"
;;
esac
GLIB_CFLAGS="-I$glib_dir -I$glib_dir/gmodule"
GLIB_LIBS="$glib_dir/libglib.la $glib_dir/gmodule/libgmodule.la"
GLIB_DEPLIBS=
AC_SUBST(GLIB_CFLAGS)
AC_SUBST(GLIB_LIBS)
fi
AC_SUBST(glib_cflags)
AC_SUBST(glib_libs)
AC_SUBST(glib_thread_cflags)
AC_SUBST(glib_thread_libs)
AC_SUBST(GLIB_DEPLIBS)
# Find the X11 include and library directories
AC_PATH_X
AC_PATH_XTRA
if test "x$x_includes" = "x"; then
x_includes="/usr/include"
fi
saved_cflags="$CFLAGS"
saved_ldflags="$LDFLAGS"
CFLAGS="$CFLAGS $X_CFLAGS"
LDFLAGS="$LDFLAGS $X_LDFLAGS $X_LIBS"
if test "x$no_x" = "xyes"; then
AC_MSG_ERROR([
*** X libraries or include files not found. Check 'config.log' for
*** more details.])
fi
# Checks for libraries.
# Check for the X11 library
AC_CHECK_LIB(X11, XOpenDisplay, x_libs="-lX11 $X_EXTRA_LIBS",
AC_MSG_ERROR([*** libX11 not found. Check 'config.log' for more details.]),
$X_EXTRA_LIBS)
if test "x$enable_shm" = "xyes"; then
# Check for the Xext library (needed for XShm extention)
AC_CHECK_LIB(Xext, XShmAttach,
x_libs="-lXext $x_libs",
# On AIX, it is in XextSam instead, but we still need -lXext
AC_CHECK_LIB(XextSam, XShmAttach,
x_libs="-lXextSam -lXext $x_libs",
no_xext_lib=yes, $x_libs),
$x_libs)
fi
# Check for shaped window extension
AC_CHECK_LIB(Xext, XShapeCombineMask,
if test -z "`echo $x_libs | grep "\-lXext" 2> /dev/null`"; then
x_libs="-lXext $x_libs"
fi
AC_DEFINE(HAVE_SHAPE_EXT),
,
$x_libs)
# Check for XConvertCase (X11R6 specific)
AC_CHECK_LIB(X11, XConvertCase,
AC_DEFINE(HAVE_XCONVERTCASE),
,
$x_libs)
# Check for XIM support.
AC_CHECK_LIB(X11, XUnregisterIMInstantiateCallback,
: ,
enable_xim_inst="no",
$x_libs)
# On Solaris, calling XRegisterIMInstantiateCallback seems to
# cause an immediate segfault, so we disable it, unless
# the user specifically forces it to be on.
if test x$enable_xim_inst = xmaybe ; then
case host in
*-*-solaris*)
enable_xim_inst="no"
;;
*)
enable_xim_inst="yes"
;;
esac
fi
if test "x$enable_xim" = "xyes"; then
GTK_XIM_FLAGS="-DUSE_XIM"
if test "x$enable_xim_inst" = "xyes"; then
AC_DEFINE(USE_X11R6_XIM)
fi
fi
x_cflags="$X_CFLAGS"
x_ldflags="$X_LDFLAGS $X_LIBS"
# set up things for XInput
if test "x$with_xinput" = "xgxi"; then
AC_MSG_WARN([
*** The generic XInput support has not been tested for several years
*** and is not known to work with any currently available X servers])
AC_DEFINE(XINPUT_GXI)
xinput_progs=gxid
x_libs="-lXi $x_libs"
elif test "x$with_xinput" = "xxfree" || test "x$with_xinput" = "xyes"; then
AC_DEFINE(XINPUT_XFREE)
x_libs="-lXi $x_libs"
else
AC_DEFINE(XINPUT_NONE)
fi
CFLAGS="$saved_cflags"
LDFLAGS="$saved_ldflags"
AC_SUBST(x_cflags)
AC_SUBST(x_includes)
AC_SUBST(x_ldflags)
AC_SUBST(x_libs)
AC_SUBST(xinput_progs)
if test "x$enable_shm" = "xyes"; then
# Check for shared memory
AC_CHECK_HEADER(sys/ipc.h, AC_DEFINE(HAVE_IPC_H), no_sys_ipc=yes)
AC_CHECK_HEADER(sys/shm.h, AC_DEFINE(HAVE_SHM_H), no_sys_shm=yes)
# Check for the X shared memory extension header file
AC_MSG_CHECKING(X11/extensions/XShm.h)
if test "x$no_xext_lib" = "xyes"; then
AC_MSG_RESULT(no)
no_xshm=yes
else
if test -f "$x_includes/X11/extensions/XShm.h"; then
AC_MSG_RESULT(yes)
AC_DEFINE(HAVE_XSHM_H)
else
AC_MSG_RESULT(no)
no_xshm=yes
fi
fi
fi
# Check if X_LOCALE definition is necessary
AC_MSG_CHECKING(need -DX_LOCALE)
AC_TRY_RUN([
#include <stdio.h>
#include <locale.h>
int
main ()
{
return setlocale (LC_ALL, "${with_locale}") == NULL;
}],
need_x_locale=no,
need_x_locale=yes,
need_x_locale=no)
AC_MSG_RESULT($need_x_locale)
use_native_locale=no
if test $need_x_locale = yes; then
GTK_LOCALE_FLAGS="-DX_LOCALE"
else
if test x$with_native_locale = xyes ; then
AC_MSG_CHECKING(functioning locale support)
AC_TRY_COMPILE([#include <stdlib.h>],[
char c;
if (MB_CUR_MAX == 1) {
wctomb(&c, 42);
}
],use_native_locale=yes,)
AC_MSG_RESULT($use_native_locale)
fi
fi
if test x$use_native_locale = xyes ; then
AC_MSG_CHECKING(if sizeof(wchar_t) == 4)
AC_TRY_RUN([
#include <stdlib.h>
int
main ()
{
return (sizeof(wchar_t) == 4) ? 0 : 1;
}],
,use_native_locale=no,:)
AC_MSG_RESULT($use_native_locale)
fi
if test $use_native_locale = yes ; then
AC_DEFINE(USE_NATIVE_LOCALE)
fi
# Checks for header files.
AC_HEADER_STDC
# Checks for typedefs, structures, and compiler characteristics.
AC_C_CONST
# Checks for library functions.
AC_TYPE_SIGNAL
AC_FUNC_MMAP
AC_CHECK_FUNCS(getresuid)
AC_TYPE_UID_T
# Check if <sys/select.h> needs to be included for fd_set
AC_MSG_CHECKING([for fd_set])
AC_TRY_COMPILE([#include <sys/types.h>],
[fd_set readMask, writeMask;], gtk_ok=yes, gtk_ok=no)
if test $gtk_ok = yes; then
AC_MSG_RESULT([yes, found in sys/types.h])
else
AC_HEADER_EGREP(fd_mask, sys/select.h, gtk_ok=yes)
if test $gtk_ok = yes; then
AC_DEFINE(HAVE_SYS_SELECT_H)
AC_MSG_RESULT([yes, found in sys/select.h])
else
AC_DEFINE(NO_FD_SET)
AC_MSG_RESULT(no)
fi
fi
# Duplicate `widechar' tests from `glib'.
# Check for wchar.h
AC_MSG_CHECKING(for wchar.h)
AC_TRY_CPP([#include <wchar.h>], gtk_ok=yes, gtk_ok=no)
if test $gtk_ok = yes; then
AC_DEFINE(HAVE_WCHAR_H,1,[Define if wchar.h exists])
fi
AC_MSG_RESULT($gtk_ok)
# Check for wctype.h (for iswalnum)
AC_MSG_CHECKING(for wctype.h)
AC_TRY_CPP([#include <wctype.h>], gtk_ok=yes, gtk_ok=no)
if test $gtk_ok = yes; then
AC_DEFINE(HAVE_WCTYPE_H,1,[Define if wctype.h exists])
fi
AC_MSG_RESULT($gtk_ok)
# in Solaris 2.5, `iswalnum' is in -lw
GDK_WLIBS=
AC_CHECK_FUNC(iswalnum,,[AC_CHECK_LIB(w,iswalnum,GDK_WLIBS=-lw)])
# The following is necessary for Linux libc-5.4.38
oLIBS="$LIBS"
LIBS="$LIBS $GDK_WLIBS"
AC_MSG_CHECKING(if iswalnum() and friends are properly defined)
AC_TRY_LINK([#include <stdlib.h>],[
#if (defined(HAVE_WCTYPE_H) || defined(HAVE_WCHAR_H))
# ifdef HAVE_WCTYPE_H
# include <wctype.h>
# else
# ifdef HAVE_WCHAR_H
# include <wchar.h>
# endif
# endif
#else
# define iswalnum(c) ((wchar_t)(c) <= 0xFF && isalnum(c))
#endif
iswalnum((wchar_t) 0);
], gtk_ok=yes, gtk_ok=no)
LIBS="$oLIBS"
if test $gtk_ok = no; then
AC_DEFINE(HAVE_BROKEN_WCTYPE,1,[Define if the wctype function is broken])
GDK_WLIBS=
fi
AC_MSG_RESULT($gtk_ok)
AC_SUBST(GDK_WLIBS)
AC_SUBST(GTK_DEBUG_FLAGS)
AC_SUBST(GTK_XIM_FLAGS)
AC_SUBST(GTK_LOCALE_FLAGS)
AC_OUTPUT([
gtk+.spec
docs/gtk-config.1
Makefile
gtk-config
po/Makefile.in
docs/Makefile
gdk/Makefile
gtk/Makefile
gtk/gtkfeatures.h
gdk.pc
gtk+.pc
], [chmod +x gtk-config])

18
debian/README.debian vendored Normal file
View File

@@ -0,0 +1,18 @@
libgtk1 for Debian
----------------------
The GIMP Tool Kit (gtk) is a set of widgets to help you program
programs for the X Windowing System easily and powerfully.
gtk is the moving force behind The GNU Image Manipulation Program (The
GIMP) -- the number one freely-available image editing and creation
program available.
gtk is rapidly under development, and the source tree has officially
been separated from The GIMP now, as other teams of programmers
are beginning to write software using its great widget set -- like
GNOME, a desktop interface for X, and gzilla, a freely available
web browser for X.
Ben Gertzfield <che@debian.org>, Mon, 29 Sep 1997 13:11:45 -0700

62
debian/build vendored Executable file
View File

@@ -0,0 +1,62 @@
#!/usr/bin/perl -w
# Adjust debian/changelog and build a new
# Debian package of a CVS archive.
# Written 17 November 1998 by Ben Gertzfield
# <che@debian.org>
# This work is released under the GNU
# General Public License, version 2 or
# later.
use strict;
use diagnostics;
use File::Copy;
my $maintainer = 'Ben Gertzfield <che@debian.org>';
my @date = localtime;
my $datestr = sprintf("%d%.2d%.2d", $date[5] + 1900, $date[4] + 1, $date[3]);
my $revision = '01';
open (CHANGELOG, 'debian/changelog') or die "Couldn't open debian/changelog: $!\n";
$_ = <CHANGELOG>;
chomp;
close CHANGELOG;
my ($package, $last_date, $last_revision) = /^(.*?) \((.*?)\.(.*)?\)/;
if ($last_date eq $datestr) {
$revision = sprintf("%.2d", $last_revision + 1);
}
my $new_version = "$datestr.$revision";
copy('debian/changelog', 'debian/changelog.old') or die "Couldn't copy debian/changelog to debian/changelog.old: $!\n";
open(NEWCHANGELOG, ">debian/changelog") or die "Couldn't open debian/changelog for writing: $!\n";
print NEWCHANGELOG "$package ($new_version) unstable; urgency=low\n\n * CVS snapshot build at " . scalar localtime() . "\n\n -- $maintainer " . `date -R` . "\n";
open(OLDCHANGELOG, "debian/changelog.old") or die "Couldn't open debian/changelog.old: $!\n";
while (<OLDCHANGELOG>) {
print NEWCHANGELOG;
}
close OLDCHANGELOG;
close NEWCHANGELOG;
unlink('debian/changelog.old') or die "Couldn't unlink debian/changelog.old: $!\n";
open(NEWVERSION, '>debian/version') or die "Couldn't open debian/version for writing: $!\n";
print NEWVERSION "$new_version\n";
close NEWVERSION;
system('dpkg-buildpackage -b -rfakeroot -us -uc');
unlink 'debian/version' or die "Couldn't unlink debian/version: $!\n";

10
debian/changelog vendored Normal file
View File

@@ -0,0 +1,10 @@
gtk+-cvs (19981116.01) unstable; urgency=low
* First test build from CVS
-- Ben Gertzfield <che@debian.org> Tue, 17 Nov 1998 12:02:13 -0800
Local variables:
mode: debian-changelog
add-log-mailing-address: "che@debian.org"
End:

81
debian/control vendored Normal file
View File

@@ -0,0 +1,81 @@
Source: gtk+-cvs
Priority: extra
Section: libs
Maintainer: Ben Gertzfield <che@debian.org>
Standards-Version: 2.4.0.0
Package: libgtk-cvs-1.1
Architecture: any
Section: libs
Depends: ${shlibs:Depends}
Conflicts: libgtk-dev (<< 1:1.0.2), libgtk1.1
Description: CVS build of the GIMP Toolkit set of widgets for X
**THIS IS NOT AN OFFICIAL DEBIAN PACKAGE! THIS IS AN AUTOMATED CVS
BUILD OF THE GTK+ LIBRARIES! BEWARE! IT MAY NOT WORK!**
.
The GIMP Toolkit is a freely available set of widgets for X.
GTK is easy to use, and has been implemented in such projects as
The GNU Image Manipulation Program (The GIMP), GNOME, a GNU
desktop set of utilities for X, and gzilla, a GNU web-browser.
.
This is the unstable 1.1 branch of GTK. It is not intended for use
with stable projects!
Package: libgtk-cvs-dev
Architecture: any
Section: devel
Depends: libgtk-cvs-1.1 (=${Source-Version}), libglib-cvs-dev
Suggests: libgtk-cvs-doc
Provides: libgtk1.1-dev
Replaces: libgtk1.1-dev
Conflicts: libgtk-dev, libgtk1 (<< 1:1.0.4), libgtk1.1-dev
Description: CVS build of development files for the GIMP Toolkit
**THIS IS NOT AN OFFICIAL DEBIAN PACKAGE! THIS IS AN AUTOMATED CVS
BUILD OF THE GTK+ LIBRARIES! BEWARE! IT MAY NOT WORK!**
.
This package contains the header files and static libraries for the
GIMP Toolkit set of widgets for X.
.
This is the unstable, 1.1 branch of GTK+. This is not intended for
use with stable releases of programs!
.
Install this package if you wish to develop your own X programs using
the GIMP Toolkit 1.1, or if you wish to compile your own plug-ins for
The GIMP.
Package: libgtk-cvs-doc
Architecture: all
Section: doc
Conflicts: libgtk-dev (<< 1:0.99.4), libgtk-doc, libgtk1.1-doc
Description: CVS build of documentation for the GIMP Toolkit
**THIS IS NOT AN OFFICIAL DEBIAN PACKAGE! THIS IS AN AUTOMATED CVS
BUILD OF THE GTK+ LIBRARIES! BEWARE! IT MAY NOT WORK!**
.
This package contains lots of info-files, HTML docs, FAQs, and
other handy documentation about the GIMP Toolkit set of widgets
for X.
.
This package documents the unstable 1.1 release of the GIMP Toolkit.
.
Install this package if you want to have lots of info about the
GIMP toolkit when you're programming.
Package: libgtk-cvs-dbg
Architecture: any
Section: devel
Depends: libgtk-cvs-1.1 (= ${Source-Version}), libgtk-cvs-dev (= ${Source-Version})
Suggests: libgtk-cvs-doc
Conflicts: libgtk1.1-dbg
Description: CVS build of debugging files for the GIMP Toolkit
**THIS IS NOT AN OFFICIAL DEBIAN PACKAGE! THIS IS AN AUTOMATED CVS
BUILD OF THE GTK+ LIBRARIES! BEWARE! IT MAY NOT WORK!**
.
This package contains the debugging static libraries for the
GIMP Toolkit set of widgets for X.
.
This is the unstable, 1.1 branch of GTK+. This is not intended for
use with stable releases of programs!
.
Install this package if you wish to debug your own X programs using
the GIMP Toolkit 1.1, or if you wish to debug your own plug-ins for
The GIMP.

8
debian/copyright vendored Normal file
View File

@@ -0,0 +1,8 @@
This package was debianized by Ben Gertzfield <che@debian.org> on
Tue, 17 Nov 1998 12:07:17 -0800
It was produced from the CVS repository at cvs.gimp.org.
It may be redistributed under the terms of the GNU LGPL, Version 2 or
later, found on Debian systems in the file /usr/doc/copyright/LGPL.

9
debian/libgtk-cvs-dev.files vendored Normal file
View File

@@ -0,0 +1,9 @@
usr/lib/libgdk.so
usr/lib/libgdk.a
usr/lib/libgtk.so
usr/lib/libgtk.a
usr/include/gdk/
usr/include/gtk/
usr/bin/gtk-config
usr/man/man1/gtk-config.1
usr/share/aclocal/gtk.m4

5
debian/libgtk-cvs-dev.postinst vendored Normal file
View File

@@ -0,0 +1,5 @@
#!/bin/sh
set -e
#DEBHELPER#

6
debian/libgtk-cvs-dev.prerm vendored Normal file
View File

@@ -0,0 +1,6 @@
#!/bin/sh
set -e
install-info --quiet --remove gtk
#DEBHELPER#

8
debian/libgtk-cvs-doc.files vendored Normal file
View File

@@ -0,0 +1,8 @@
usr/info/gdk.info
usr/info/gtk.info
usr/info/gtk.info-1
usr/info/gtk.info-2
usr/info/gtk.info-3
usr/info/gtk.info-4
usr/info/gtk.info-5

11
debian/libgtk-cvs-doc.postinst vendored Normal file
View File

@@ -0,0 +1,11 @@
#!/bin/sh
set -e
install-info --quiet --description="The GIMP Toolkit." \
--section "The GIMP" "The GIMP" /usr/info/gtk.info.gz
install-info --quiet --description="The GIMP Drawing Kit." \
--section "The GIMP" "The GIMP" /usr/info/gdk.info.gz
#DEBHELPER#

7
debian/libgtk-cvs-doc.prerm vendored Normal file
View File

@@ -0,0 +1,7 @@
#!/bin/sh
set -e
install-info --quiet --remove gtk
install-info --quiet --remove gdk
#DEBHELPER#

7
debian/postinst vendored Normal file
View File

@@ -0,0 +1,7 @@
#!/bin/sh
set -e
ldconfig
#DEBHELPER#

160
debian/rules vendored Executable file
View File

@@ -0,0 +1,160 @@
#!/usr/bin/make -f
# debian/rules file for gtk+ Debian package
# written April 1998 by Ben Gertzfield <che@debian.org
build: build-stamp
build-stamp:
dh_testdir
./autogen.sh --prefix=/usr --with-xinput=xfree
$(MAKE)
cd docs && make distdocs
cd ..
touch build-stamp
build-dbg: build-dbg-stamp
build-dbg-stamp:
dh_testdir
./configure --prefix=/usr --with-xinput=xfree --enable-debug=yes
$(MAKE)
touch build-dbg-stamp
clean:
dh_testdir
dh_testroot
rm -f build-stamp build-dbg-stamp install-stamp install-dbg-stamp
# Add here commands to clean up after the build process.
-$(MAKE) clean
cd docs
-$(MAKE) maintainer-clean
cd ..
-$(MAKE) distclean
find . -name '*.o' -o -name '_libs' -o -name '*.lo' -o -name '*.a' -o -name '.deps' | xargs rm -rf
dh_clean
clean-dbg:
dh_testdir
dh_testroot
rm -f build-stamp build-dbg-stamp install-stamp install-dbg-stamp
# Add here commands to clean up after the build process.
-$(MAKE) clean
cd docs
-$(MAKE) maintainer-clean
cd ..
-$(MAKE) distclean
find . -name '*.o' -o -name '_libs' -o -name '*.lo' -o -name '*.a' -o -name '.deps' | xargs rm -rf
dh_clean -k
install: install-stamp
install-stamp: build
dh_testdir
dh_testroot
dh_clean
$(MAKE) prefix=`pwd`/debian/tmp/usr install
touch install-stamp
install-dbg: install-dbg-stamp
install-dbg-stamp: build-dbg
dh_testdir
dh_testroot
dh_clean -k
$(MAKE) prefix=`pwd`/debian/libgtk-cvs-dbg/usr install
touch install-dbg-stamp
# Build architecture-independent files here.
binary-indep: build install libgtk-cvs-doc
# We have nothing to do by default.
# Build architecture-dependent files here.
binary-arch: build install libgtk-cvs-dev libgtk-cvs-1.1 libgtk-cvs-dbg
libgtk-cvs-1.1: build
dh_testdir -plibgtk-cvs-1.1
dh_testroot -plibgtk-cvs-1.1
dh_installdirs -plibgtk-cvs-1.1
# Add here commands to install the files into debian/tmp
rm -rf debian/tmp/usr/bin debian/tmp/usr/include debian/tmp/usr/info debian/tmp/usr/lib/glib debian/tmp/usr/share/aclocal debian/tmp/usr/man debian/tmp/usr/lib/*.la
dh_installdocs -plibgtk-cvs-1.1
dh_installchangelogs -plibgtk-cvs-1.1
dh_strip -plibgtk-cvs-1.1
dh_compress -plibgtk-cvs-1.1
dh_fixperms -plibgtk-cvs-1.1
dh_installdeb -plibgtk-cvs-1.1
dh_shlibdeps -plibgtk-cvs-1.1
dh_gencontrol -plibgtk-cvs-1.1
dh_makeshlibs -plibgtk-cvs-1.1 -V 'libgtk-cvs-1.1 (='`cat debian/version`')'
dh_md5sums -plibgtk-cvs-1.1
dh_builddeb -plibgtk-cvs-1.1
libgtk-cvs-dev: build
dh_testdir -plibgtk-cvs-dev
dh_testroot -plibgtk-cvs-dev
dh_clean -plibgtk-cvs-dev -k
dh_installdirs -plibgtk-cvs-dev
# Add here commands to install the files into debian/tmp
dh_movefiles -plibgtk-cvs-dev
cp gtk-config debian/tmp/usr/bin
dh_installdocs -plibgtk-cvs-dev
dh_installchangelogs -plibgtk-cvs-dev
dh_strip -plibgtk-cvs-dev
dh_compress -plibgtk-cvs-dev
dh_fixperms -plibgtk-cvs-dev
dh_installdeb -plibgtk-cvs-dev
dh_shlibdeps -plibgtk-cvs-dev
dh_gencontrol -plibgtk-cvs-dev
dh_md5sums -plibgtk-cvs-dev
dh_builddeb -plibgtk-cvs-dev
libgtk-cvs-doc:
dh_testdir -plibgtk-cvs-doc
dh_testroot -plibgtk-cvs-doc
dh_clean -plibgtk-cvs-doc -k
dh_installdirs -plibgtk-cvs-doc usr/doc/libgtk-cvs-doc/faq-html \
usr/doc/libgtk-cvs-doc/tutorial-html usr/doc/libgtk-cvs-doc/italian-tutorial-html usr/doc/libgtk-cvs-doc/french-tutorial-html usr/doc/libgtk-cvs-doc/gdk-html
dh_movefiles -plibgtk-cvs-doc
cp docs/html/gtkfaq*.html debian/libgtk-cvs-doc/usr/doc/libgtk-cvs-doc/faq-html
cp docs/html/gtk_tut-*.html debian/libgtk-cvs-doc/usr/doc/libgtk-cvs-doc/tutorial-html
cp docs/html/*.gif debian/libgtk-cvs-doc/usr/doc/libgtk-cvs-doc/tutorial-html
cp docs/html/gtk_tut.html debian/libgtk-cvs-doc/usr/doc/libgtk-cvs-doc/tutorial-html
cp docs/html/gtk_tut_it*.html debian/libgtk-cvs-doc/usr/doc/libgtk-cvs-doc/italian-tutorial-html
cp docs/html/*.gif debian/libgtk-cvs-doc/usr/doc/libgtk-cvs-doc/italian-tutorial-html
cp docs/html/gtk_tut_fr*.html debian/libgtk-cvs-doc/usr/doc/libgtk-cvs-doc/french-tutorial-html
cp docs/html/*.gif debian/libgtk-cvs-doc/usr/doc/libgtk-cvs-doc/french-tutorial-html
cp docs/html/gdk* debian/libgtk-cvs-doc/usr/doc/libgtk-cvs-doc/gdk-html
cp docs/text/*.txt debian/libgtk-cvs-doc/usr/doc/libgtk-cvs-doc/
dh_installdocs -plibgtk-cvs-doc docs/{debugging,developers,styles,text_widget,widget_system,gtk-config,refcounting}.txt TODO NEWS
dh_installchangelogs -plibgtk-cvs-doc
dh_strip -plibgtk-cvs-doc
dh_compress -plibgtk-cvs-doc
dh_fixperms -plibgtk-cvs-doc
dh_installdeb -plibgtk-cvs-doc
dh_shlibdeps -plibgtk-cvs-doc
dh_gencontrol -plibgtk-cvs-doc
dh_md5sums -plibgtk-cvs-doc
dh_builddeb -plibgtk-cvs-doc
libgtk-cvs-dbg: clean-dbg install-dbg
dh_testdir -plibgtk-cvs-dbg
dh_testroot -plibgtk-cvs-dbg
dh_installdirs -plibgtk-cvs-dbg
# Add here commands to install the files into debian/libgtk-cvs-dbg
rm -rf debian/libgtk-cvs-dbg/usr/bin debian/libgtk-cvs-dbg/usr/include debian/libgtk-cvs-dbg/usr/info debian/libgtk-cvs-dbg/usr/lib/glib debian/libgtk-cvs-dbg/usr/man debian/libgtk-cvs-dbg/usr/share debian/libgtk-cvs-dbg/usr/lib/*.{la,so*}
for file in `find debian/libgtk-cvs-dbg/usr/lib -name '*.a'` ; do \
mv $$file debian/libgtk-cvs-dbg/usr/lib/`basename $$file .a`_g.a; \
done
dh_installdocs -plibgtk-cvs-dbg
dh_installchangelogs -plibgtk-cvs-dbg
dh_compress -plibgtk-cvs-dbg
dh_fixperms -plibgtk-cvs-dbg
dh_installdeb -plibgtk-cvs-dbg
dh_shlibdeps -plibgtk-cvs-dbg
dh_gencontrol -plibgtk-cvs-dbg
dh_md5sums -plibgtk-cvs-dbg
dh_builddeb -plibgtk-cvs-dbg
source diff:
@echo >&2 'source and diff are obsolete - use dpkg-source -b'; false
binary: binary-indep binary-arch
.PHONY: build clean binary-indep binary-arch binary

View File

@@ -1,115 +0,0 @@
/*
* Copyright © 2019 Red Hat, Inc.
*
* 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.
*
* You should have received a copy of the GNU Lesser General Public
* License along with this library. If not, see <http://www.gnu.org/licenses/>.
*
* Authors: Matthias Clasen
*/
#include "config.h"
#include "constraint-editor-application.h"
#include "constraint-editor-window.h"
struct _ConstraintEditorApplication
{
GtkApplication parent_instance;
};
G_DEFINE_TYPE(ConstraintEditorApplication, constraint_editor_application, GTK_TYPE_APPLICATION);
static void
constraint_editor_application_init (ConstraintEditorApplication *app)
{
}
static void
quit_activated (GSimpleAction *action,
GVariant *parameter,
gpointer data)
{
g_application_quit (G_APPLICATION (data));
}
static GActionEntry app_entries[] =
{
{ "quit", quit_activated, NULL, NULL, NULL }
};
static void
constraint_editor_application_startup (GApplication *app)
{
const char *quit_accels[2] = { "<Ctrl>Q", NULL };
const char *open_accels[2] = { "<Ctrl>O", NULL };
GtkCssProvider *provider;
G_APPLICATION_CLASS (constraint_editor_application_parent_class)->startup (app);
g_action_map_add_action_entries (G_ACTION_MAP (app),
app_entries, G_N_ELEMENTS (app_entries),
app);
gtk_application_set_accels_for_action (GTK_APPLICATION (app), "app.quit", quit_accels);
gtk_application_set_accels_for_action (GTK_APPLICATION (app), "win.open", open_accels);
provider = gtk_css_provider_new ();
gtk_css_provider_load_from_resource (provider, "/org/gtk/gtk4/constraint-editor/constraint-editor.css");
gtk_style_context_add_provider_for_display (gdk_display_get_default (),
GTK_STYLE_PROVIDER (provider),
GTK_STYLE_PROVIDER_PRIORITY_APPLICATION);
}
static void
constraint_editor_application_activate (GApplication *app)
{
ConstraintEditorWindow *win;
win = constraint_editor_window_new (CONSTRAINT_EDITOR_APPLICATION (app));
gtk_window_present (GTK_WINDOW (win));
}
static void
constraint_editor_application_open (GApplication *app,
GFile **files,
gint n_files,
const gchar *hint)
{
ConstraintEditorWindow *win;
gint i;
for (i = 0; i < n_files; i++)
{
win = constraint_editor_window_new (CONSTRAINT_EDITOR_APPLICATION (app));
constraint_editor_window_load (win, files[i]);
gtk_window_present (GTK_WINDOW (win));
}
}
static void
constraint_editor_application_class_init (ConstraintEditorApplicationClass *class)
{
GApplicationClass *application_class = G_APPLICATION_CLASS (class);
application_class->startup = constraint_editor_application_startup;
application_class->activate = constraint_editor_application_activate;
application_class->open = constraint_editor_application_open;
}
ConstraintEditorApplication *
constraint_editor_application_new (void)
{
return g_object_new (CONSTRAINT_EDITOR_APPLICATION_TYPE,
"application-id", "org.gtk.gtk4.ConstraintEditor",
"flags", G_APPLICATION_HANDLES_OPEN,
NULL);
}

View File

@@ -1,28 +0,0 @@
/*
* Copyright © 2019 Red Hat, Inc.
*
* 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.
*
* You should have received a copy of the GNU Lesser General Public
* License along with this library. If not, see <http://www.gnu.org/licenses/>.
*
* Authors: Matthias Clasen
*/
#pragma once
#include <gtk/gtk.h>
#define CONSTRAINT_EDITOR_APPLICATION_TYPE (constraint_editor_application_get_type ())
G_DECLARE_FINAL_TYPE (ConstraintEditorApplication, constraint_editor_application, CONSTRAINT, EDITOR_APPLICATION, GtkApplication)
ConstraintEditorApplication *constraint_editor_application_new (void);

View File

@@ -1,639 +0,0 @@
/*
* Copyright © 2019 Red Hat, Inc.
*
* 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.
*
* You should have received a copy of the GNU Lesser General Public
* License along with this library. If not, see <http://www.gnu.org/licenses/>.
*
* Authors: Matthias Clasen
*/
#include "config.h"
#include "constraint-editor-window.h"
#include "constraint-view.h"
#include "constraint-editor.h"
#include "guide-editor.h"
struct _ConstraintEditorWindow
{
GtkApplicationWindow parent_instance;
GtkWidget *paned;
GtkWidget *view;
GtkWidget *list;
};
G_DEFINE_TYPE(ConstraintEditorWindow, constraint_editor_window, GTK_TYPE_APPLICATION_WINDOW);
static GtkConstraintTarget *
find_target (GListModel *model,
GtkConstraintTarget *orig)
{
const char *name;
const char *model_name;
gpointer item;
int i;
if (orig == NULL)
return NULL;
if (GTK_IS_LABEL (orig))
name = gtk_label_get_label (GTK_LABEL (orig));
else if (GTK_IS_CONSTRAINT_GUIDE (orig))
name = gtk_constraint_guide_get_name (GTK_CONSTRAINT_GUIDE (orig));
else
{
g_warning ("Don't know how to handle %s targets", G_OBJECT_TYPE_NAME (orig));
return NULL;
}
for (i = 0; i < g_list_model_get_n_items (model); i++)
{
item = g_list_model_get_item (model, i);
g_object_unref (item);
if (GTK_IS_WIDGET (item))
model_name = gtk_widget_get_name (GTK_WIDGET (item));
else
model_name = gtk_constraint_guide_get_name (GTK_CONSTRAINT_GUIDE (item));
if (strcmp (name, model_name) == 0)
return GTK_CONSTRAINT_TARGET (item);
}
g_warning ("Failed to find target '%s'", name);
return NULL;
}
gboolean
constraint_editor_window_load (ConstraintEditorWindow *self,
GFile *file)
{
char *path;
GtkBuilder *builder;
GError *error = NULL;
GtkWidget *view;
GtkLayoutManager *layout;
GtkWidget *child;
const char *name;
gpointer item;
int i;
GListModel *list;
path = g_file_get_path (file);
builder = gtk_builder_new ();
if (!gtk_builder_add_from_file (builder, path, &error))
{
g_print ("Could not load %s: %s", path, error->message);
g_error_free (error);
g_free (path);
g_object_unref (builder);
return FALSE;
}
view = GTK_WIDGET (gtk_builder_get_object (builder, "view"));
if (!GTK_IS_BOX (view))
{
g_print ("Could not load %s: No GtkBox named 'view'", path);
g_free (path);
g_object_unref (builder);
return FALSE;
}
layout = gtk_widget_get_layout_manager (view);
if (!GTK_IS_CONSTRAINT_LAYOUT (layout))
{
g_print ("Could not load %s: Widget 'view' does not use GtkConstraintLayout", path);
g_free (path);
g_object_unref (builder);
return FALSE;
}
for (child = gtk_widget_get_first_child (view);
child;
child = gtk_widget_get_next_sibling (child))
{
if (!GTK_IS_LABEL (child))
{
g_print ("Skipping non-GtkLabel child\n");
continue;
}
name = gtk_label_get_label (GTK_LABEL (child));
constraint_view_add_child (CONSTRAINT_VIEW (self->view), name);
}
list = gtk_constraint_layout_observe_guides (GTK_CONSTRAINT_LAYOUT (layout));
for (i = 0; i < g_list_model_get_n_items (list); i++)
{
GtkConstraintGuide *guide, *clone;
int w, h;
item = g_list_model_get_item (list, i);
guide = GTK_CONSTRAINT_GUIDE (item);
/* need to clone here, to attach to the right targets */
clone = gtk_constraint_guide_new ();
gtk_constraint_guide_set_name (clone, gtk_constraint_guide_get_name (guide));
gtk_constraint_guide_set_strength (clone, gtk_constraint_guide_get_strength (guide));
gtk_constraint_guide_get_min_size (guide, &w, &h);
gtk_constraint_guide_set_min_size (clone, w, h);
gtk_constraint_guide_get_nat_size (guide, &w, &h);
gtk_constraint_guide_set_nat_size (clone, w, h);
gtk_constraint_guide_get_max_size (guide, &w, &h);
gtk_constraint_guide_set_max_size (clone, w, h);
constraint_view_add_guide (CONSTRAINT_VIEW (self->view), clone);
g_object_unref (guide);
g_object_unref (clone);
}
g_object_unref (list);
list = gtk_constraint_layout_observe_constraints (GTK_CONSTRAINT_LAYOUT (layout));
for (i = 0; i < g_list_model_get_n_items (list); i++)
{
GtkConstraint *constraint;
GtkConstraint *clone;
GtkConstraintTarget *target;
GtkConstraintTarget *source;
item = g_list_model_get_item (list, i);
constraint = GTK_CONSTRAINT (item);
target = gtk_constraint_get_target (constraint);
source = gtk_constraint_get_source (constraint);
clone = gtk_constraint_new (find_target (constraint_view_get_model (CONSTRAINT_VIEW (self->view)), target),
gtk_constraint_get_target_attribute (constraint),
gtk_constraint_get_relation (constraint),
find_target (constraint_view_get_model (CONSTRAINT_VIEW (self->view)), source),
gtk_constraint_get_target_attribute (constraint),
gtk_constraint_get_multiplier (constraint),
gtk_constraint_get_constant (constraint),
gtk_constraint_get_strength (constraint));
constraint_view_add_constraint (CONSTRAINT_VIEW (self->view), clone);
g_object_unref (constraint);
g_object_unref (clone);
}
g_object_unref (list);
g_free (path);
g_object_unref (builder);
return TRUE;
}
static void
open_response_cb (GtkNativeDialog *dialog,
gint response,
ConstraintEditorWindow *self)
{
gtk_native_dialog_hide (dialog);
if (response == GTK_RESPONSE_ACCEPT)
{
GFile *file;
file = gtk_file_chooser_get_file (GTK_FILE_CHOOSER (dialog));
constraint_editor_window_load (self, file);
g_object_unref (file);
}
gtk_native_dialog_destroy (dialog);
}
static void
open_cb (GtkWidget *button,
ConstraintEditorWindow *self)
{
GtkFileChooserNative *dialog;
dialog = gtk_file_chooser_native_new ("Open file",
GTK_WINDOW (self),
GTK_FILE_CHOOSER_ACTION_OPEN,
"_Load",
"_Cancel");
gtk_native_dialog_set_modal (GTK_NATIVE_DIALOG (dialog), TRUE);
gtk_file_chooser_set_current_folder (GTK_FILE_CHOOSER (dialog), ".");
g_signal_connect (dialog, "response", G_CALLBACK (open_response_cb), self);
gtk_native_dialog_show (GTK_NATIVE_DIALOG (dialog));
}
static void
serialize_child (GString *str,
int indent,
GtkWidget *child)
{
const char *name;
name = gtk_widget_get_name (child);
g_string_append_printf (str, "%*s<child>\n", indent, "");
g_string_append_printf (str, "%*s <object class=\"GtkLabel\" id=\"%s\">\n", indent, "", name);
g_string_append_printf (str, "%*s <property name=\"label\">%s</property>\n", indent, "", name);
g_string_append_printf (str, "%*s </object>\n", indent, "");
g_string_append_printf (str, "%*s</child>\n", indent, "");
}
static char *
serialize_model (GListModel *list)
{
GString *str = g_string_new ("");
int i;
g_string_append (str, "<interface>\n");
g_string_append (str, " <object class=\"GtkBox\" id=\"view\">\n");
g_string_append (str, " <property name=\"layout-manager\">\n");
g_string_append (str, " <object class=\"GtkConstraintLayout\">\n");
g_string_append (str, " <constraints>\n");
for (i = 0; i < g_list_model_get_n_items (list); i++)
{
gpointer item = g_list_model_get_item (list, i);
g_object_unref (item);
if (GTK_IS_CONSTRAINT (item))
constraint_editor_serialize_constraint (str, 10, GTK_CONSTRAINT (item));
else if (GTK_IS_CONSTRAINT_GUIDE (item))
guide_editor_serialize_guide (str, 10, GTK_CONSTRAINT_GUIDE (item));
}
g_string_append (str, " </constraints>\n");
g_string_append (str, " </object>\n");
g_string_append (str, " </property>\n");
for (i = 0; i < g_list_model_get_n_items (list); i++)
{
gpointer item = g_list_model_get_item (list, i);
g_object_unref (item);
if (GTK_IS_WIDGET (item))
serialize_child (str, 4, GTK_WIDGET (item));
}
g_string_append (str, " </object>\n");
g_string_append (str, "</interface>\n");
return g_string_free (str, FALSE);
}
static void
save_response_cb (GtkNativeDialog *dialog,
gint response,
ConstraintEditorWindow *self)
{
gtk_native_dialog_hide (dialog);
if (response == GTK_RESPONSE_ACCEPT)
{
GListModel *model;
char *text, *filename;
GError *error = NULL;
model = constraint_view_get_model (CONSTRAINT_VIEW (self->view));
text = serialize_model (model);
filename = gtk_file_chooser_get_filename (GTK_FILE_CHOOSER (dialog));
if (!g_file_set_contents (filename, text, -1, &error))
{
GtkWidget *dialog;
dialog = gtk_message_dialog_new (GTK_WINDOW (gtk_widget_get_root (GTK_WIDGET (self))),
GTK_DIALOG_MODAL|GTK_DIALOG_DESTROY_WITH_PARENT,
GTK_MESSAGE_INFO,
GTK_BUTTONS_OK,
"Saving failed");
gtk_message_dialog_format_secondary_text (GTK_MESSAGE_DIALOG (dialog),
"%s", error->message);
g_signal_connect (dialog, "response", G_CALLBACK (gtk_widget_destroy), NULL);
gtk_widget_show (dialog);
g_error_free (error);
}
g_free (filename);
}
gtk_native_dialog_destroy (dialog);
}
static void
save_cb (GtkWidget *button,
ConstraintEditorWindow *self)
{
GtkFileChooserNative *dialog;
dialog = gtk_file_chooser_native_new ("Save constraints",
GTK_WINDOW (gtk_widget_get_root (GTK_WIDGET (button))),
GTK_FILE_CHOOSER_ACTION_SAVE,
"_Save",
"_Cancel");
gtk_native_dialog_set_modal (GTK_NATIVE_DIALOG (dialog), TRUE);
gtk_file_chooser_set_current_folder (GTK_FILE_CHOOSER (dialog), ".");
g_signal_connect (dialog, "response", G_CALLBACK (save_response_cb), self);
gtk_native_dialog_show (GTK_NATIVE_DIALOG (dialog));
}
static void
constraint_editor_window_finalize (GObject *object)
{
//ConstraintEditorWindow *self = (ConstraintEditorWindow *)object;
G_OBJECT_CLASS (constraint_editor_window_parent_class)->finalize (object);
}
static int child_counter;
static int guide_counter;
static void
add_child (ConstraintEditorWindow *win)
{
char *name;
child_counter++;
name = g_strdup_printf ("Child %d", child_counter);
constraint_view_add_child (CONSTRAINT_VIEW (win->view), name);
g_free (name);
}
static void
add_guide (ConstraintEditorWindow *win)
{
char *name;
GtkConstraintGuide *guide;
guide_counter++;
name = g_strdup_printf ("Guide %d", guide_counter);
guide = gtk_constraint_guide_new ();
gtk_constraint_guide_set_name (guide, name);
g_free (name);
constraint_view_add_guide (CONSTRAINT_VIEW (win->view), guide);
}
static void
constraint_editor_done (ConstraintEditor *editor,
GtkConstraint *constraint,
ConstraintEditorWindow *win)
{
GtkConstraint *old_constraint;
g_object_get (editor, "constraint", &old_constraint, NULL);
if (old_constraint)
constraint_view_remove_constraint (CONSTRAINT_VIEW (win->view), old_constraint);
constraint_view_add_constraint (CONSTRAINT_VIEW (win->view), constraint);
g_clear_object (&old_constraint);
gtk_widget_destroy (gtk_widget_get_ancestor (GTK_WIDGET (editor), GTK_TYPE_WINDOW));
}
static void
edit_constraint (ConstraintEditorWindow *win,
GtkConstraint *constraint)
{
GtkWidget *window;
ConstraintEditor *editor;
GListModel *model;
window = gtk_window_new (GTK_WINDOW_TOPLEVEL);
gtk_window_set_transient_for (GTK_WINDOW (window), GTK_WINDOW (win));
gtk_window_set_resizable (GTK_WINDOW (window), FALSE);
if (constraint)
gtk_window_set_title (GTK_WINDOW (window), "Edit Constraint");
else
gtk_window_set_title (GTK_WINDOW (window), "Create Constraint");
model = constraint_view_get_model (CONSTRAINT_VIEW (win->view));
editor = constraint_editor_new (model, constraint);
gtk_container_add (GTK_CONTAINER (window), GTK_WIDGET (editor));
g_signal_connect (editor, "done", G_CALLBACK (constraint_editor_done), win);
gtk_widget_show (window);
}
static void
add_constraint (ConstraintEditorWindow *win)
{
edit_constraint (win, NULL);
}
static void
guide_editor_done (GuideEditor *editor,
GtkConstraintGuide *guide,
ConstraintEditorWindow *win)
{
gtk_widget_destroy (gtk_widget_get_ancestor (GTK_WIDGET (editor), GTK_TYPE_WINDOW));
}
static void
edit_guide (ConstraintEditorWindow *win,
GtkConstraintGuide *guide)
{
GtkWidget *window;
GuideEditor *editor;
window = gtk_window_new (GTK_WINDOW_TOPLEVEL);
gtk_window_set_resizable (GTK_WINDOW (window), FALSE);
gtk_window_set_transient_for (GTK_WINDOW (window), GTK_WINDOW (win));
gtk_window_set_title (GTK_WINDOW (window), "Edit Guide");
editor = guide_editor_new (guide);
gtk_container_add (GTK_CONTAINER (window), GTK_WIDGET (editor));
g_signal_connect (editor, "done", G_CALLBACK (guide_editor_done), win);
gtk_widget_show (window);
}
static void
row_activated (GtkListBox *list,
GtkListBoxRow *row,
ConstraintEditorWindow *win)
{
GObject *item;
item = G_OBJECT (g_object_get_data (G_OBJECT (row), "item"));
if (GTK_IS_CONSTRAINT (item))
edit_constraint (win, GTK_CONSTRAINT (item));
else if (GTK_IS_CONSTRAINT_GUIDE (item))
edit_guide (win, GTK_CONSTRAINT_GUIDE (item));
}
static void
constraint_editor_window_class_init (ConstraintEditorWindowClass *class)
{
GObjectClass *object_class = G_OBJECT_CLASS (class);
GtkWidgetClass *widget_class = GTK_WIDGET_CLASS (class);
g_type_ensure (CONSTRAINT_VIEW_TYPE);
object_class->finalize = constraint_editor_window_finalize;
gtk_widget_class_set_template_from_resource (widget_class,
"/org/gtk/gtk4/constraint-editor/constraint-editor-window.ui");
gtk_widget_class_bind_template_child (widget_class, ConstraintEditorWindow, paned);
gtk_widget_class_bind_template_child (widget_class, ConstraintEditorWindow, view);
gtk_widget_class_bind_template_child (widget_class, ConstraintEditorWindow, list);
gtk_widget_class_bind_template_callback (widget_class, open_cb);
gtk_widget_class_bind_template_callback (widget_class, save_cb);
gtk_widget_class_bind_template_callback (widget_class, add_child);
gtk_widget_class_bind_template_callback (widget_class, add_guide);
gtk_widget_class_bind_template_callback (widget_class, add_constraint);
gtk_widget_class_bind_template_callback (widget_class, row_activated);
}
static void
row_edit (GtkButton *button,
ConstraintEditorWindow *win)
{
GtkWidget *row;
GObject *item;
row = gtk_widget_get_ancestor (GTK_WIDGET (button), GTK_TYPE_LIST_BOX_ROW);
item = (GObject *)g_object_get_data (G_OBJECT (row), "item");
if (GTK_IS_CONSTRAINT (item))
edit_constraint (win, GTK_CONSTRAINT (item));
else if (GTK_IS_CONSTRAINT_GUIDE (item))
edit_guide (win, GTK_CONSTRAINT_GUIDE (item));
}
static void
mark_constraints_invalid (ConstraintEditorWindow *win,
gpointer removed)
{
GtkWidget *child;
GObject *item;
for (child = gtk_widget_get_first_child (win->list);
child;
child = gtk_widget_get_next_sibling (child))
{
item = (GObject *)g_object_get_data (G_OBJECT (child), "item");
if (GTK_IS_CONSTRAINT (item))
{
GtkConstraint *constraint = GTK_CONSTRAINT (item);
if (gtk_constraint_get_target (constraint) == (GtkConstraintTarget *)removed ||
gtk_constraint_get_source (constraint) == (GtkConstraintTarget *)removed)
{
GtkWidget *button;
button = (GtkWidget *)g_object_get_data (G_OBJECT (child), "edit");
gtk_button_set_icon_name (GTK_BUTTON (button), "dialog-warning-symbolic");
gtk_widget_set_tooltip_text (button, "Constraint is invalid");
}
}
}
}
static void
row_delete (GtkButton *button,
ConstraintEditorWindow *win)
{
GtkWidget *row;
GObject *item;
row = gtk_widget_get_ancestor (GTK_WIDGET (button), GTK_TYPE_LIST_BOX_ROW);
item = (GObject *)g_object_get_data (G_OBJECT (row), "item");
if (GTK_IS_CONSTRAINT (item))
constraint_view_remove_constraint (CONSTRAINT_VIEW (win->view),
GTK_CONSTRAINT (item));
else if (GTK_IS_CONSTRAINT_GUIDE (item))
{
mark_constraints_invalid (win, item);
constraint_view_remove_guide (CONSTRAINT_VIEW (win->view),
GTK_CONSTRAINT_GUIDE (item));
}
else if (GTK_IS_WIDGET (item))
{
mark_constraints_invalid (win, item);
constraint_view_remove_child (CONSTRAINT_VIEW (win->view),
GTK_WIDGET (item));
}
}
static GtkWidget *
create_widget_func (gpointer item,
gpointer user_data)
{
ConstraintEditorWindow *win = user_data;
const char *name;
char *freeme = NULL;
GtkWidget *row, *box, *label, *button;
if (GTK_IS_WIDGET (item))
name = gtk_widget_get_name (GTK_WIDGET (item));
else if (GTK_IS_CONSTRAINT_GUIDE (item))
name = gtk_constraint_guide_get_name (GTK_CONSTRAINT_GUIDE (item));
else if (GTK_IS_CONSTRAINT (item))
name = freeme = constraint_editor_constraint_to_string (GTK_CONSTRAINT (item));
else
name = "";
row = gtk_list_box_row_new ();
g_object_set_data_full (G_OBJECT (row), "item", g_object_ref (item), g_object_unref);
box = gtk_box_new (GTK_ORIENTATION_HORIZONTAL, 0);
label = gtk_label_new (name);
if (GTK_IS_WIDGET (item) || GTK_IS_CONSTRAINT_GUIDE (item))
g_object_bind_property (item, "name",
label, "label",
G_BINDING_DEFAULT);
g_object_set (label, "margin", 10, NULL);
gtk_label_set_xalign (GTK_LABEL (label), 0.0);
gtk_widget_set_hexpand (label, TRUE);
gtk_container_add (GTK_CONTAINER (row), box);
gtk_container_add (GTK_CONTAINER (box), label);
if (GTK_IS_CONSTRAINT (item) || GTK_IS_CONSTRAINT_GUIDE (item))
{
button = gtk_button_new_from_icon_name ("document-edit-symbolic");
gtk_button_set_relief (GTK_BUTTON (button), GTK_RELIEF_NONE);
g_signal_connect (button, "clicked", G_CALLBACK (row_edit), win);
g_object_set_data (G_OBJECT (row), "edit", button);
gtk_container_add (GTK_CONTAINER (box), button);
button = gtk_button_new_from_icon_name ("edit-delete-symbolic");
gtk_button_set_relief (GTK_BUTTON (button), GTK_RELIEF_NONE);
g_signal_connect (button, "clicked", G_CALLBACK (row_delete), win);
gtk_container_add (GTK_CONTAINER (box), button);
}
else if (GTK_IS_WIDGET (item))
{
button = gtk_button_new_from_icon_name ("edit-delete-symbolic");
gtk_button_set_relief (GTK_BUTTON (button), GTK_RELIEF_NONE);
g_signal_connect (button, "clicked", G_CALLBACK (row_delete), win);
gtk_container_add (GTK_CONTAINER (box), button);
}
g_free (freeme);
return row;
}
static void
constraint_editor_window_init (ConstraintEditorWindow *self)
{
gtk_widget_init_template (GTK_WIDGET (self));
gtk_list_box_bind_model (GTK_LIST_BOX (self->list),
constraint_view_get_model (CONSTRAINT_VIEW (self->view)),
create_widget_func,
self,
NULL);
}
ConstraintEditorWindow *
constraint_editor_window_new (ConstraintEditorApplication *application)
{
return g_object_new (CONSTRAINT_EDITOR_WINDOW_TYPE,
"application", application,
NULL);
}

View File

@@ -1,34 +0,0 @@
/*
* Copyright © 2019 Red Hat, Inc
*
* 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.
*
* You should have received a copy of the GNU Lesser General Public
* License along with this library. If not, see <http://www.gnu.org/licenses/>.
*
* Authors: Matthias Clasen
*/
#pragma once
#include <gtk/gtk.h>
#include "constraint-editor-application.h"
#define CONSTRAINT_EDITOR_WINDOW_TYPE (constraint_editor_window_get_type ())
G_DECLARE_FINAL_TYPE (ConstraintEditorWindow, constraint_editor_window, CONSTRAINT, EDITOR_WINDOW, GtkApplicationWindow)
ConstraintEditorWindow * constraint_editor_window_new (ConstraintEditorApplication *application);
gboolean constraint_editor_window_load (ConstraintEditorWindow *self,
GFile *file);

View File

@@ -1,82 +0,0 @@
<?xml version="1.0" encoding="UTF-8"?>
<interface>
<template class="ConstraintEditorWindow" parent="GtkApplicationWindow">
<style>
<class name="devel"/>
</style>
<property name="title" translatable="yes">GTK Constraint Editor</property>
<property name="default-width">1024</property>
<property name="default-height">768</property>
<child type="titlebar">
<object class="GtkHeaderBar" id="header">
<property name="title" translatable="yes">GTK Constraint Editor</property>
<property name="show-title-buttons">1</property>
<child type="start">
<object class="GtkButton">
<property name="icon-name">document-open-symbolic</property>
<property name="tooltip-text">Open ui file</property>
<signal name="clicked" handler="open_cb"/>
</object>
</child>
<child type="start">
<object class="GtkButton">
<property name="icon-name">document-save-symbolic</property>
<property name="tooltip-text">Save to ui file</property>
<signal name="clicked" handler="save_cb"/>
</object>
</child>
</object>
</child>
<child>
<object class="GtkPaned" id="paned">
<property name="orientation">horizontal</property>
<child>
<object class="GtkBox">
<property name="orientation">vertical</property>
<child>
<object class="GtkBox">
<property name="orientation">horizontal</property>
<child>
<object class="GtkButton">
<property name="label">Add Child</property>
<signal name="clicked" handler="add_child" swapped="yes"/>
</object>
</child>
<child>
<object class="GtkButton">
<property name="label">Add Guide</property>
<signal name="clicked" handler="add_guide" swapped="yes"/>
</object>
</child>
<child>
<object class="GtkButton">
<property name="label">Add Constraint</property>
<signal name="clicked" handler="add_constraint" swapped="yes"/>
</object>
</child>
</object>
</child>
<child>
<object class="GtkScrolledWindow">
<property name="hscrollbar-policy">never</property>
<property name="vscrollbar-policy">automatic</property>
<property name="vexpand">1</property>
<child>
<object class="GtkListBox" id="list">
<property name="show-separators">1</property>
<property name="selection-mode">none</property>
<signal name="row-activated" handler="row_activated"/>
</object>
</child>
</object>
</child>
</object>
</child>
<child>
<object class="ConstraintView" id="view">
</object>
</child>
</object>
</child>
</template>
</interface>

View File

@@ -1,656 +0,0 @@
/*
* Copyright © 2019 Red Hat, Inc.
*
* 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.
*
* You should have received a copy of the GNU Lesser General Public
* License along with this library. If not, see <http://www.gnu.org/licenses/>.
*
* Authors: Matthias Clasen
*/
#include "config.h"
#include "constraint-editor.h"
struct _ConstraintEditor
{
GtkWidget parent_instance;
GtkWidget *grid;
GtkWidget *target;
GtkWidget *target_attr;
GtkWidget *relation;
GtkWidget *source;
GtkWidget *source_attr;
GtkWidget *multiplier;
GtkWidget *constant;
GtkWidget *strength;
GtkWidget *preview;
GtkWidget *button;
GtkConstraint *constraint;
GListModel *model;
gboolean constructed;
};
enum {
PROP_MODEL = 1,
PROP_CONSTRAINT,
LAST_PROP
};
static GParamSpec *pspecs[LAST_PROP];
enum {
DONE,
LAST_SIGNAL
};
static guint signals[LAST_SIGNAL];
G_DEFINE_TYPE(ConstraintEditor, constraint_editor, GTK_TYPE_WIDGET);
static const char *
get_target_name (GtkConstraintTarget *target)
{
if (target == NULL)
return "super";
else if (GTK_IS_WIDGET (target))
return gtk_widget_get_name (GTK_WIDGET (target));
else if (GTK_IS_CONSTRAINT_GUIDE (target))
return gtk_constraint_guide_get_name (GTK_CONSTRAINT_GUIDE (target));
else
return "";
}
static void
constraint_target_combo (GListModel *model,
GtkWidget *combo,
gboolean is_source)
{
int i;
gtk_combo_box_text_append (GTK_COMBO_BOX_TEXT (combo), "super", "Super");
if (model)
{
for (i = 0; i < g_list_model_get_n_items (model); i++)
{
GObject *item = g_list_model_get_object (model, i);
const char *name;
if (GTK_IS_CONSTRAINT (item))
continue;
name = get_target_name (GTK_CONSTRAINT_TARGET (item));
gtk_combo_box_text_append (GTK_COMBO_BOX_TEXT (combo), name, name);
g_object_unref (item);
}
}
}
static void
constraint_attribute_combo (GtkWidget *combo,
gboolean is_source)
{
if (is_source)
gtk_combo_box_text_append (GTK_COMBO_BOX_TEXT (combo), "none", "None");
gtk_combo_box_text_append (GTK_COMBO_BOX_TEXT (combo), "left", "Left");
gtk_combo_box_text_append (GTK_COMBO_BOX_TEXT (combo), "right", "Right");
gtk_combo_box_text_append (GTK_COMBO_BOX_TEXT (combo), "top", "Top");
gtk_combo_box_text_append (GTK_COMBO_BOX_TEXT (combo), "bottom", "Bottom");
gtk_combo_box_text_append (GTK_COMBO_BOX_TEXT (combo), "start", "Start");
gtk_combo_box_text_append (GTK_COMBO_BOX_TEXT (combo), "end", "End");
gtk_combo_box_text_append (GTK_COMBO_BOX_TEXT (combo), "width", "Width");
gtk_combo_box_text_append (GTK_COMBO_BOX_TEXT (combo), "height", "Height");
gtk_combo_box_text_append (GTK_COMBO_BOX_TEXT (combo), "center-x", "Center X");
gtk_combo_box_text_append (GTK_COMBO_BOX_TEXT (combo), "center-y", "Center Y");
gtk_combo_box_text_append (GTK_COMBO_BOX_TEXT (combo), "baseline", "Baseline");
}
static void
constraint_relation_combo (GtkWidget *combo)
{
gtk_combo_box_text_append (GTK_COMBO_BOX_TEXT (combo), "le", "");
gtk_combo_box_text_append (GTK_COMBO_BOX_TEXT (combo), "eq", "=");
gtk_combo_box_text_append (GTK_COMBO_BOX_TEXT (combo), "ge", "");
}
static void
constraint_strength_combo (GtkWidget *combo)
{
gtk_combo_box_text_append (GTK_COMBO_BOX_TEXT (combo), "weak", "Weak");
gtk_combo_box_text_append (GTK_COMBO_BOX_TEXT (combo), "medium", "Medium");
gtk_combo_box_text_append (GTK_COMBO_BOX_TEXT (combo), "strong", "Strong");
gtk_combo_box_text_append (GTK_COMBO_BOX_TEXT (combo), "required", "Required");
}
static gpointer
get_target (GListModel *model,
const char *id)
{
int i;
if (strcmp ("super", id) == 0)
return NULL;
for (i = 0; i < g_list_model_get_n_items (model); i++)
{
GObject *item = g_list_model_get_object (model, i);
g_object_unref (item);
if (GTK_IS_CONSTRAINT (item))
continue;
else if (GTK_IS_WIDGET (item))
{
if (strcmp (id, gtk_widget_get_name (GTK_WIDGET (item))) == 0)
return item;
}
else if (GTK_IS_CONSTRAINT_GUIDE (item))
{
if (strcmp (id, gtk_constraint_guide_get_name (GTK_CONSTRAINT_GUIDE (item))) == 0)
return item;
}
}
return NULL;
}
static GtkConstraintAttribute
get_target_attr (const char *id)
{
GtkConstraintAttribute attr;
GEnumClass *class = g_type_class_ref (GTK_TYPE_CONSTRAINT_ATTRIBUTE);
GEnumValue *value = g_enum_get_value_by_nick (class, id);
attr = value->value;
g_type_class_unref (class);
return attr;
}
static const char *
get_attr_nick (GtkConstraintAttribute attr)
{
GEnumClass *class = g_type_class_ref (GTK_TYPE_CONSTRAINT_ATTRIBUTE);
GEnumValue *value = g_enum_get_value (class, attr);
const char *nick = value->value_nick;
g_type_class_unref (class);
return nick;
}
static GtkConstraintRelation
get_relation (const char *id)
{
GtkConstraintRelation relation;
GEnumClass *class = g_type_class_ref (GTK_TYPE_CONSTRAINT_RELATION);
GEnumValue *value = g_enum_get_value_by_nick (class, id);
relation = value->value;
g_type_class_unref (class);
return relation;
}
static const char *
get_relation_nick (GtkConstraintRelation relation)
{
GEnumClass *class = g_type_class_ref (GTK_TYPE_CONSTRAINT_RELATION);
GEnumValue *value = g_enum_get_value (class, relation);
const char *nick = value->value_nick;
g_type_class_unref (class);
return nick;
}
static GtkConstraintStrength
get_strength (const char *id)
{
GtkConstraintStrength strength;
GEnumClass *class = g_type_class_ref (GTK_TYPE_CONSTRAINT_STRENGTH);
GEnumValue *value = g_enum_get_value_by_nick (class, id);
strength = value->value;
g_type_class_unref (class);
return strength;
}
static const char *
get_strength_nick (GtkConstraintStrength strength)
{
GEnumClass *class = g_type_class_ref (GTK_TYPE_CONSTRAINT_STRENGTH);
GEnumValue *value = g_enum_get_value (class, strength);
const char *nick = value->value_nick;
g_type_class_unref (class);
return nick;
}
void
constraint_editor_serialize_constraint (GString *str,
int indent,
GtkConstraint *constraint)
{
const char *target;
const char *target_attr;
const char *relation;
const char *source;
const char *source_attr;
double multiplier;
double constant;
const char *strength;
target = get_target_name (gtk_constraint_get_target (constraint));
target_attr = get_attr_nick (gtk_constraint_get_target_attribute (constraint));
relation = get_relation_nick (gtk_constraint_get_relation (constraint));
source = get_target_name (gtk_constraint_get_source (constraint));
source_attr = get_attr_nick (gtk_constraint_get_source_attribute (constraint));
multiplier = gtk_constraint_get_multiplier (constraint);
constant = gtk_constraint_get_constant (constraint);
strength = get_strength_nick (gtk_constraint_get_strength (constraint));
g_string_append_printf (str, "%*s<constraint target=\"%s\" target-attribute=\"%s\"\n", indent, "", target, target_attr);
g_string_append_printf (str, "%*s relation=\"%s\"\n", indent, "", relation);
if (strcmp (source_attr, "none") != 0)
{
g_string_append_printf (str, "%*s source=\"%s\" source-attribute=\"%s\"\n", indent, "", source, source_attr);
g_string_append_printf (str, "%*s multiplier=\"%g\"\n", indent, "", multiplier);
}
g_string_append_printf (str, "%*s constant=\"%g\"\n", indent, "", constant);
g_string_append_printf (str, "%*s strength=\"%s\" />\n", indent, "", strength);
}
static void
create_constraint (GtkButton *button,
ConstraintEditor *editor)
{
const char *id;
gpointer target;
GtkConstraintAttribute target_attr;
gpointer source;
GtkConstraintAttribute source_attr;
GtkConstraintRelation relation;
double multiplier;
double constant;
int strength;
GtkConstraint *constraint;
id = gtk_combo_box_get_active_id (GTK_COMBO_BOX (editor->target));
target = get_target (editor->model, id);
id = gtk_combo_box_get_active_id (GTK_COMBO_BOX (editor->target_attr));
target_attr = get_target_attr (id);
id = gtk_combo_box_get_active_id (GTK_COMBO_BOX (editor->source));
source = get_target (editor->model, id);
id = gtk_combo_box_get_active_id (GTK_COMBO_BOX (editor->source_attr));
source_attr = get_target_attr (id);
id = gtk_combo_box_get_active_id (GTK_COMBO_BOX (editor->relation));
relation = get_relation (id);
multiplier = g_ascii_strtod (gtk_editable_get_text (GTK_EDITABLE (editor->multiplier)), NULL);
constant = g_ascii_strtod (gtk_editable_get_text (GTK_EDITABLE (editor->constant)), NULL);
id = gtk_combo_box_get_active_id (GTK_COMBO_BOX (editor->strength));
strength = get_strength (id);
constraint = gtk_constraint_new (target, target_attr,
relation,
source, source_attr,
multiplier,
constant,
strength);
g_signal_emit (editor, signals[DONE], 0, constraint);
g_object_unref (constraint);
}
static void
source_attr_changed (ConstraintEditor *editor)
{
const char *id;
id = gtk_combo_box_get_active_id (GTK_COMBO_BOX (editor->source_attr));
if (strcmp (id, "none") == 0)
{
gtk_combo_box_set_active (GTK_COMBO_BOX (editor->source), -1);
gtk_editable_set_text (GTK_EDITABLE (editor->multiplier), "");
gtk_widget_set_sensitive (editor->source, FALSE);
gtk_widget_set_sensitive (editor->multiplier, FALSE);
}
else
{
gtk_widget_set_sensitive (editor->source, TRUE);
gtk_widget_set_sensitive (editor->multiplier, TRUE);
}
}
char *
constraint_editor_constraint_to_string (GtkConstraint *constraint)
{
GString *str;
const char *name;
const char *attr;
const char *relation;
double c, m;
str = g_string_new ("");
name = get_target_name (gtk_constraint_get_target (constraint));
attr = get_attr_nick (gtk_constraint_get_target_attribute (constraint));
relation = get_relation_nick (gtk_constraint_get_relation (constraint));
if (name == NULL)
name = "[ ]";
g_string_append_printf (str, "%s.%s %s ", name, attr, relation);
c = gtk_constraint_get_constant (constraint);
attr = get_attr_nick (gtk_constraint_get_source_attribute (constraint));
if (strcmp (attr, "none") != 0)
{
name = get_target_name (gtk_constraint_get_source (constraint));
m = gtk_constraint_get_multiplier (constraint);
if (name == NULL)
name = "[ ]";
g_string_append_printf (str, "%s.%s", name, attr);
if (m != 1.0)
g_string_append_printf (str, " × %g", m);
if (c > 0.0)
g_string_append_printf (str, " + %g", c);
else if (c < 0.0)
g_string_append_printf (str, " - %g", -c);
}
else
g_string_append_printf (str, "%g", c);
return g_string_free (str, FALSE);
}
static void
update_preview (ConstraintEditor *editor)
{
GString *str;
const char *name;
const char *attr;
char *relation;
const char *multiplier;
const char *constant;
double c, m;
if (!editor->constructed)
return;
str = g_string_new ("");
name = gtk_combo_box_get_active_id (GTK_COMBO_BOX (editor->target));
attr = gtk_combo_box_get_active_id (GTK_COMBO_BOX (editor->target_attr));
relation = gtk_combo_box_text_get_active_text (GTK_COMBO_BOX_TEXT (editor->relation));
if (name == NULL)
name = "[ ]";
g_string_append_printf (str, "%s.%s %s ", name, attr, relation);
g_free (relation);
constant = gtk_editable_get_text (GTK_EDITABLE (editor->constant));
c = g_ascii_strtod (constant, NULL);
attr = gtk_combo_box_get_active_id (GTK_COMBO_BOX (editor->source_attr));
if (strcmp (attr, "none") != 0)
{
name = gtk_combo_box_get_active_id (GTK_COMBO_BOX (editor->source));
multiplier = gtk_editable_get_text (GTK_EDITABLE (editor->multiplier));
m = g_ascii_strtod (multiplier, NULL);
if (name == NULL)
name = "[ ]";
g_string_append_printf (str, "%s.%s", name, attr);
if (m != 1.0)
g_string_append_printf (str, " × %g", m);
if (c > 0.0)
g_string_append_printf (str, " + %g", c);
else if (c < 0.0)
g_string_append_printf (str, " - %g", -c);
}
else
g_string_append_printf (str, "%g", c);
gtk_label_set_label (GTK_LABEL (editor->preview), str->str);
g_string_free (str, TRUE);
}
static void
update_button (ConstraintEditor *editor)
{
if (gtk_combo_box_get_active_id (GTK_COMBO_BOX (editor->target)) != NULL &&
gtk_combo_box_get_active_id (GTK_COMBO_BOX (editor->source)) != NULL)
gtk_widget_set_sensitive (editor->button, TRUE);
else
gtk_widget_set_sensitive (editor->button, FALSE);
}
static void
constraint_editor_init (ConstraintEditor *editor)
{
gtk_widget_init_template (GTK_WIDGET (editor));
}
static void
constraint_editor_constructed (GObject *object)
{
ConstraintEditor *editor = CONSTRAINT_EDITOR (object);
constraint_target_combo (editor->model, editor->target, FALSE);
constraint_attribute_combo (editor->target_attr, FALSE);
constraint_relation_combo (editor->relation);
constraint_target_combo (editor->model, editor->source, TRUE);
constraint_attribute_combo (editor->source_attr, TRUE);
constraint_strength_combo (editor->strength);
if (editor->constraint)
{
GtkConstraintTarget *target;
GtkConstraintAttribute attr;
GtkConstraintRelation relation;
GtkConstraintStrength strength;
const char *nick;
char *val;
double multiplier;
double constant;
target = gtk_constraint_get_target (editor->constraint);
nick = get_target_name (target);
gtk_combo_box_set_active_id (GTK_COMBO_BOX (editor->target), nick);
attr = gtk_constraint_get_target_attribute (editor->constraint);
nick = get_attr_nick (attr);
gtk_combo_box_set_active_id (GTK_COMBO_BOX (editor->target_attr), nick);
target = gtk_constraint_get_source (editor->constraint);
nick = get_target_name (target);
gtk_combo_box_set_active_id (GTK_COMBO_BOX (editor->source), nick);
attr = gtk_constraint_get_source_attribute (editor->constraint);
nick = get_attr_nick (attr);
gtk_combo_box_set_active_id (GTK_COMBO_BOX (editor->source_attr), nick);
relation = gtk_constraint_get_relation (editor->constraint);
nick = get_relation_nick (relation);
gtk_combo_box_set_active_id (GTK_COMBO_BOX (editor->relation), nick);
multiplier = gtk_constraint_get_multiplier (editor->constraint);
val = g_strdup_printf ("%g", multiplier);
gtk_editable_set_text (GTK_EDITABLE (editor->multiplier), val);
g_free (val);
constant = gtk_constraint_get_constant (editor->constraint);
val = g_strdup_printf ("%g", constant);
gtk_editable_set_text (GTK_EDITABLE (editor->constant), val);
g_free (val);
strength = gtk_constraint_get_strength (editor->constraint);
nick = get_strength_nick (strength);
gtk_combo_box_set_active_id (GTK_COMBO_BOX (editor->strength), nick);
gtk_button_set_label (GTK_BUTTON (editor->button), "Apply");
}
else
{
gtk_combo_box_set_active_id (GTK_COMBO_BOX (editor->target_attr), "left");
gtk_combo_box_set_active_id (GTK_COMBO_BOX (editor->source_attr), "left");
gtk_combo_box_set_active_id (GTK_COMBO_BOX (editor->relation), "eq");
gtk_combo_box_set_active_id (GTK_COMBO_BOX (editor->strength), "required");
gtk_editable_set_text (GTK_EDITABLE (editor->multiplier), "1.0");
gtk_editable_set_text (GTK_EDITABLE (editor->constant), "0.0");
gtk_button_set_label (GTK_BUTTON (editor->button), "Create");
}
editor->constructed = TRUE;
update_preview (editor);
update_button (editor);
}
static void
constraint_editor_set_property (GObject *object,
guint property_id,
const GValue *value,
GParamSpec *pspec)
{
ConstraintEditor *self = CONSTRAINT_EDITOR (object);
switch (property_id)
{
case PROP_MODEL:
self->model = g_value_dup_object (value);
break;
case PROP_CONSTRAINT:
self->constraint = g_value_dup_object (value);
break;
default:
G_OBJECT_WARN_INVALID_PROPERTY_ID (object, property_id, pspec);
}
}
static void
constraint_editor_get_property (GObject *object,
guint property_id,
GValue *value,
GParamSpec *pspec)
{
ConstraintEditor *self = CONSTRAINT_EDITOR (object);
switch (property_id)
{
case PROP_MODEL:
g_value_set_object (value, self->model);
break;
case PROP_CONSTRAINT:
g_value_set_object (value, self->constraint);
break;
default:
G_OBJECT_WARN_INVALID_PROPERTY_ID (object, property_id, pspec);
}
}
static void
constraint_editor_dispose (GObject *object)
{
ConstraintEditor *self = (ConstraintEditor *)object;
g_clear_pointer (&self->grid, gtk_widget_unparent);
g_clear_object (&self->model);
g_clear_object (&self->constraint);
G_OBJECT_CLASS (constraint_editor_parent_class)->dispose (object);
}
static void
constraint_editor_class_init (ConstraintEditorClass *class)
{
GObjectClass *object_class = G_OBJECT_CLASS (class);
GtkWidgetClass *widget_class = GTK_WIDGET_CLASS (class);
object_class->constructed = constraint_editor_constructed;
object_class->dispose = constraint_editor_dispose;
object_class->set_property = constraint_editor_set_property;
object_class->get_property = constraint_editor_get_property;
pspecs[PROP_CONSTRAINT] =
g_param_spec_object ("constraint", "constraint", "constraint",
GTK_TYPE_CONSTRAINT,
G_PARAM_READWRITE|G_PARAM_CONSTRUCT_ONLY);
pspecs[PROP_MODEL] =
g_param_spec_object ("model", "model", "model",
G_TYPE_LIST_MODEL,
G_PARAM_READWRITE|G_PARAM_CONSTRUCT_ONLY);
g_object_class_install_properties (object_class, LAST_PROP, pspecs);
signals[DONE] =
g_signal_new ("done",
G_TYPE_FROM_CLASS (object_class),
G_SIGNAL_RUN_LAST,
0,
NULL, NULL,
NULL,
G_TYPE_NONE, 1, GTK_TYPE_CONSTRAINT);
gtk_widget_class_set_layout_manager_type (widget_class, GTK_TYPE_BIN_LAYOUT);
gtk_widget_class_set_template_from_resource (widget_class,
"/org/gtk/gtk4/constraint-editor/constraint-editor.ui");
gtk_widget_class_bind_template_child (widget_class, ConstraintEditor, grid);
gtk_widget_class_bind_template_child (widget_class, ConstraintEditor, target);
gtk_widget_class_bind_template_child (widget_class, ConstraintEditor, target_attr);
gtk_widget_class_bind_template_child (widget_class, ConstraintEditor, relation);
gtk_widget_class_bind_template_child (widget_class, ConstraintEditor, source);
gtk_widget_class_bind_template_child (widget_class, ConstraintEditor, source_attr);
gtk_widget_class_bind_template_child (widget_class, ConstraintEditor, multiplier);
gtk_widget_class_bind_template_child (widget_class, ConstraintEditor, constant);
gtk_widget_class_bind_template_child (widget_class, ConstraintEditor, strength);
gtk_widget_class_bind_template_child (widget_class, ConstraintEditor, preview);
gtk_widget_class_bind_template_child (widget_class, ConstraintEditor, button);
gtk_widget_class_bind_template_callback (widget_class, update_preview);
gtk_widget_class_bind_template_callback (widget_class, update_button);
gtk_widget_class_bind_template_callback (widget_class, create_constraint);
gtk_widget_class_bind_template_callback (widget_class, source_attr_changed);
}
ConstraintEditor *
constraint_editor_new (GListModel *model,
GtkConstraint *constraint)
{
return g_object_new (CONSTRAINT_EDITOR_TYPE,
"model", model,
"constraint", constraint,
NULL);
}

View File

@@ -1,12 +0,0 @@
constraintview {
background: black;
color: white;
}
constraintview .child {
background: red;
}
constraintview .guide {
background: blue;
}

View File

@@ -1,9 +0,0 @@
<?xml version="1.0" encoding="UTF-8"?>
<gresources>
<gresource prefix="/org/gtk/gtk4/constraint-editor">
<file preprocess="xml-stripblanks">constraint-editor-window.ui</file>
<file preprocess="xml-stripblanks">constraint-editor.ui</file>
<file preprocess="xml-stripblanks">guide-editor.ui</file>
<file>constraint-editor.css</file>
</gresource>
</gresources>

View File

@@ -1,34 +0,0 @@
/*
* Copyright © 2019 Red Hat, Inc
*
* 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.
*
* You should have received a copy of the GNU Lesser General Public
* License along with this library. If not, see <http://www.gnu.org/licenses/>.
*
* Authors: Matthias Clasen
*/
#pragma once
#include <gtk/gtk.h>
#define CONSTRAINT_EDITOR_TYPE (constraint_editor_get_type ())
G_DECLARE_FINAL_TYPE (ConstraintEditor, constraint_editor, CONSTRAINT, EDITOR, GtkWidget)
ConstraintEditor * constraint_editor_new (GListModel *model,
GtkConstraint *constraint);
void constraint_editor_serialize_constraint (GString *str,
int indent,
GtkConstraint *constraint);
char *constraint_editor_constraint_to_string (GtkConstraint *constraint);

View File

@@ -1,163 +0,0 @@
<?xml version="1.0" encoding="UTF-8"?>
<interface>
<template class="ConstraintEditor" parent="GtkWidget">
<child>
<object class="GtkGrid" id="grid">
<property name="margin">20</property>
<property name="row-spacing">10</property>
<property name="column-spacing">10</property>
<child>
<object class="GtkLabel">
<property name="label">Target</property>
<layout>
<property name="left-attach">0</property>
<property name="top-attach">1</property>
</layout>
</object>
</child>
<child>
<object class="GtkComboBoxText" id="target">
<signal name="changed" handler="update_preview" swapped="yes"/>
<signal name="changed" handler="update_button" swapped="yes"/>
<layout>
<property name="left-attach">1</property>
<property name="top-attach">1</property>
</layout>
</object>
</child>
<child>
<object class="GtkComboBoxText" id="target_attr">
<signal name="changed" handler="update_preview" swapped="yes"/>
<layout>
<property name="left-attach">2</property>
<property name="top-attach">1</property>
</layout>
</object>
</child>
<child>
<object class="GtkLabel">
<property name="label">Relation</property>
<layout>
<property name="left-attach">0</property>
<property name="top-attach">2</property>
</layout>
</object>
</child>
<child>
<object class="GtkComboBoxText" id="relation">
<signal name="changed" handler="update_preview" swapped="yes"/>
<layout>
<property name="left-attach">1</property>
<property name="top-attach">2</property>
</layout>
</object>
</child>
<child>
<object class="GtkLabel">
<property name="label">Source</property>
<layout>
<property name="left-attach">0</property>
<property name="top-attach">3</property>
</layout>
</object>
</child>
<child>
<object class="GtkComboBoxText" id="source">
<signal name="changed" handler="update_preview" swapped="yes"/>
<signal name="changed" handler="update_button" swapped="yes"/>
<layout>
<property name="left-attach">1</property>
<property name="top-attach">3</property>
</layout>
</object>
</child>
<child>
<object class="GtkComboBoxText" id="source_attr">
<signal name="changed" handler="update_preview" swapped="yes"/>
<signal name="changed" handler="source_attr_changed" swapped="yes"/>
<layout>
<property name="left-attach">2</property>
<property name="top-attach">3</property>
</layout>
</object>
</child>
<child>
<object class="GtkLabel">
<property name="label">Multiplier</property>
<layout>
<property name="left-attach">0</property>
<property name="top-attach">4</property>
</layout>
</object>
</child>
<child>
<object class="GtkEntry" id="multiplier">
<signal name="changed" handler="update_preview" swapped="yes"/>
<layout>
<property name="left-attach">1</property>
<property name="top-attach">4</property>
</layout>
</object>
</child>
<child>
<object class="GtkLabel">
<property name="label">Constant</property>
<layout>
<property name="left-attach">0</property>
<property name="top-attach">5</property>
</layout>
</object>
</child>
<child>
<object class="GtkEntry" id="constant">
<signal name="changed" handler="update_preview" swapped="yes"/>
<layout>
<property name="left-attach">1</property>
<property name="top-attach">5</property>
</layout>
</object>
</child>
<child>
<object class="GtkLabel">
<property name="label">Strength</property>
<layout>
<property name="left-attach">0</property>
<property name="top-attach">6</property>
</layout>
</object>
</child>
<child>
<object class="GtkComboBoxText" id="strength">
<layout>
<property name="left-attach">1</property>
<property name="top-attach">6</property>
</layout>
</object>
</child>
<child>
<object class="GtkLabel" id="preview">
<property name="xalign">0</property>
<layout>
<property name="left-attach">1</property>
<property name="top-attach">7</property>
<property name="column-span">2</property>
</layout>
<attributes>
<attribute name="scale" value="1.44"/>
</attributes>
</object>
</child>
<child>
<object class="GtkButton" id="button">
<property name="label">Create</property>
<signal name="clicked" handler="create_constraint"/>
<layout>
<property name="left-attach">2</property>
<property name="top-attach">8</property>
</layout>
</object>
</child>
</object>
</child>
</template>
</interface>

View File

@@ -1,93 +0,0 @@
/*
* Copyright © 2019 Red Hat, Inc
*
* 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.
*
* You should have received a copy of the GNU Lesser General Public
* License along with this library. If not, see <http://www.gnu.org/licenses/>.
*
* Authors: Matthias Clasen
*/
#include "constraint-view-child.h"
struct _ConstraintViewChild
{
GObject parent_instance;
char *name;
};
enum {
PROP_NAME = 1,
LAST_PROP
};
static GParamSpec props[LAST_PROP];
G_DEFINE_TYPE (ConstraintViewChild, constraint_view_child, G_TYPE_OBJECT)
static void
constraint_view_child_init (ConstraintViewChild *child)
{
}
static void
constraint_view_child_finalize (GObject *object)
{
ConstraintViewChild *child = CONSTRAINT_VIEW_CHILD (object);
g_free (child->name);
G_OBJECT_CLASS (constraint_view_child_parent_class)->finalize (object);
}
static void
constraint_view_child_set_property (GObject *object,
static void
constraint_view_child_class_init (ConstraintViewChildClass *class)
{
GObjectClass *object_class = G_OBJECT_CLASS (class);
object_class->finalize = constraint_view_child_finalize;
object_class->get_property = constraint_view_child_get_property;
object_class->set_property = constraint_view_child_set_property;
props[PROP_NAME] =
g_param_spec_string ("name", "name", "name",
NULL,
G_PARAM_READWRITE);
g_object_class_install_properties (object_class, LAST_PROP, props);
}
#define CONSTRAINT_VIEW_CHILD_TYPE (constraint_view_get_type ())
G_DECLARE_TYPE (ConstraintViewChild, constraint_view_child, CONSTRAINT, VIEW_CHILD, GObject)
#define CONSTRAINT_VIEW_WIDGET_TYPE (constraint_view_widget_get_type ())
G_DECLARE_FINAL_TYPE (ConstraintViewWidget, constraint_view_widget, CONSTRAINT, VIEW_WIDGET, ConstraintViewChild)
ConstraintViewWidget * constraint_view_widget_new (void);
#define CONSTRAINT_VIEW_GUIDE_TYPE (constraint_view_guide_get_type ())
G_DECLARE_FINAL_TYPE (ConstraintViewGuide, constraint_view_guide, CONSTRAINT, VIEW_GUIDE, ConstraintViewChild)
ConstraintViewGuide * constraint_view_guide_new (void);
#define CONSTRAINT_VIEW_CONSTRAINT_TYPE (constraint_view_constraint_get_type ())
G_DECLARE_FINAL_TYPE (ConstraintViewConstraint, constraint_view_constraint, CONSTRAINT, VIEW_CONSTRAINT, ConstraintViewChild)
ConstraintViewGuide * constraint_view_constraint_new (void);

View File

@@ -1,44 +0,0 @@
/*
* Copyright © 2019 Red Hat, Inc
*
* 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.
*
* You should have received a copy of the GNU Lesser General Public
* License along with this library. If not, see <http://www.gnu.org/licenses/>.
*
* Authors: Matthias Clasen
*/
#pragma once
#include <gtk/gtk.h>
#define CONSTRAINT_VIEW_CHILD_TYPE (constraint_view_get_type ())
G_DECLARE_TYPE (ConstraintViewChild, constraint_view_child, CONSTRAINT, VIEW_CHILD, GObject)
#define CONSTRAINT_VIEW_WIDGET_TYPE (constraint_view_widget_get_type ())
G_DECLARE_FINAL_TYPE (ConstraintViewWidget, constraint_view_widget, CONSTRAINT, VIEW_WIDGET, ConstraintViewChild)
ConstraintViewWidget * constraint_view_widget_new (void);
#define CONSTRAINT_VIEW_GUIDE_TYPE (constraint_view_guide_get_type ())
G_DECLARE_FINAL_TYPE (ConstraintViewGuide, constraint_view_guide, CONSTRAINT, VIEW_GUIDE, ConstraintViewChild)
ConstraintViewGuide * constraint_view_guide_new (void);
#define CONSTRAINT_VIEW_CONSTRAINT_TYPE (constraint_view_constraint_get_type ())
G_DECLARE_FINAL_TYPE (ConstraintViewConstraint, constraint_view_constraint, CONSTRAINT, VIEW_CONSTRAINT, ConstraintViewChild)
ConstraintViewGuide * constraint_view_constraint_new (void);

View File

@@ -1,343 +0,0 @@
/* Copyright (C) 2019 Red Hat, Inc.
*
* 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 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.
*
* You should have received a copy of the GNU Lesser General Public
* License along with this library. If not, see <http://www.gnu.org/licenses/>.
*/
#include <gtk/gtk.h>
#include "constraint-view.h"
struct _ConstraintView
{
GtkWidget parent;
GListModel *model;
GtkWidget *drag_widget;
};
G_DEFINE_TYPE (ConstraintView, constraint_view, GTK_TYPE_WIDGET);
static void
constraint_view_dispose (GObject *object)
{
ConstraintView *view = CONSTRAINT_VIEW (object);
GtkWidget *child;
while ((child = gtk_widget_get_first_child (GTK_WIDGET (view))) != NULL)
gtk_widget_unparent (child);
g_clear_object (&view->model);
G_OBJECT_CLASS (constraint_view_parent_class)->dispose (object);
}
static void
constraint_view_class_init (ConstraintViewClass *klass)
{
GObjectClass *object_class = G_OBJECT_CLASS (klass);
GtkWidgetClass *widget_class = GTK_WIDGET_CLASS (klass);
object_class->dispose = constraint_view_dispose;
gtk_widget_class_set_css_name (widget_class, "constraintview");
}
static void
update_weak_position (ConstraintView *self,
GtkWidget *child,
double x,
double y)
{
GtkLayoutManager *manager;
GtkConstraint *constraint;
manager = gtk_widget_get_layout_manager (GTK_WIDGET (self));
constraint = (GtkConstraint *)g_object_get_data (G_OBJECT (child), "x-constraint");
if (constraint)
{
gtk_constraint_layout_remove_constraint (GTK_CONSTRAINT_LAYOUT (manager),
constraint);
g_object_set_data (G_OBJECT (child), "x-constraint", NULL);
}
if (x != -100)
{
constraint = gtk_constraint_new_constant (child,
GTK_CONSTRAINT_ATTRIBUTE_CENTER_X,
GTK_CONSTRAINT_RELATION_EQ,
x,
GTK_CONSTRAINT_STRENGTH_WEAK);
g_object_set_data (G_OBJECT (constraint), "internal", "yes");
gtk_constraint_layout_add_constraint (GTK_CONSTRAINT_LAYOUT (manager),
constraint);
g_object_set_data (G_OBJECT (child), "x-constraint", constraint);
}
constraint = (GtkConstraint *)g_object_get_data (G_OBJECT (child), "y-constraint");
if (constraint)
{
gtk_constraint_layout_remove_constraint (GTK_CONSTRAINT_LAYOUT (manager),
constraint);
g_object_set_data (G_OBJECT (child), "y-constraint", NULL);
}
if (y != -100)
{
constraint = gtk_constraint_new_constant (child,
GTK_CONSTRAINT_ATTRIBUTE_CENTER_Y,
GTK_CONSTRAINT_RELATION_EQ,
y,
GTK_CONSTRAINT_STRENGTH_WEAK);
g_object_set_data (G_OBJECT (constraint), "internal", "yes");
gtk_constraint_layout_add_constraint (GTK_CONSTRAINT_LAYOUT (manager),
constraint);
g_object_set_data (G_OBJECT (child), "y-constraint", constraint);
}
}
static void
drag_begin (GtkGestureDrag *drag,
double start_x,
double start_y,
ConstraintView *self)
{
GtkWidget *widget;
widget = gtk_widget_pick (GTK_WIDGET (self), start_x, start_y, GTK_PICK_DEFAULT);
if (GTK_IS_LABEL (widget))
{
widget = gtk_widget_get_ancestor (widget, GTK_TYPE_FRAME);
if (widget &&
gtk_widget_get_parent (widget) == (GtkWidget *)self)
{
self->drag_widget = widget;
}
}
}
static void
drag_update (GtkGestureDrag *drag,
double offset_x,
double offset_y,
ConstraintView *self)
{
double x, y;
if (!self->drag_widget)
return;
gtk_gesture_drag_get_start_point (drag, &x, &y);
update_weak_position (self, self->drag_widget, x + offset_x, y + offset_y);
}
static void
drag_end (GtkGestureDrag *drag,
double offset_x,
double offset_y,
ConstraintView *self)
{
self->drag_widget = NULL;
}
static gboolean
omit_internal (gpointer item, gpointer user_data)
{
if (g_object_get_data (G_OBJECT (item), "internal"))
return FALSE;
return TRUE;
}
static void
constraint_view_init (ConstraintView *self)
{
GtkLayoutManager *manager;
GtkEventController *controller;
GListStore *list;
GListModel *all_children;
GListModel *all_constraints;
GListModel *guides;
GListModel *children;
GListModel *constraints;
manager = gtk_constraint_layout_new ();
gtk_widget_set_layout_manager (GTK_WIDGET (self), manager);
all_children = gtk_widget_observe_children (GTK_WIDGET (self));
all_constraints = gtk_constraint_layout_observe_constraints (GTK_CONSTRAINT_LAYOUT (manager));
guides = gtk_constraint_layout_observe_guides (GTK_CONSTRAINT_LAYOUT (manager));
constraints = (GListModel *)gtk_filter_list_model_new (all_constraints, omit_internal, NULL, NULL);
children = (GListModel *)gtk_filter_list_model_new (all_children, omit_internal, NULL, NULL);
list = g_list_store_new (G_TYPE_LIST_MODEL);
g_list_store_append (list, children);
g_list_store_append (list, guides);
g_list_store_append (list, constraints);
self->model = G_LIST_MODEL (gtk_flatten_list_model_new (G_TYPE_OBJECT, G_LIST_MODEL (list)));
g_object_unref (children);
g_object_unref (guides);
g_object_unref (constraints);
g_object_unref (all_children);
g_object_unref (all_constraints);
g_object_unref (list);
controller = (GtkEventController *)gtk_gesture_drag_new ();
g_signal_connect (controller, "drag-begin", G_CALLBACK (drag_begin), self);
g_signal_connect (controller, "drag-update", G_CALLBACK (drag_update), self);
g_signal_connect (controller, "drag-end", G_CALLBACK (drag_end), self);
gtk_widget_add_controller (GTK_WIDGET (self), controller);
}
ConstraintView *
constraint_view_new (void)
{
return g_object_new (CONSTRAINT_VIEW_TYPE, NULL);
}
void
constraint_view_add_child (ConstraintView *view,
const char *name)
{
GtkWidget *frame;
GtkWidget *label;
label = gtk_label_new (name);
frame = gtk_frame_new (NULL);
gtk_style_context_add_class (gtk_widget_get_style_context (frame), "child");
gtk_widget_set_name (frame, name);
gtk_container_add (GTK_CONTAINER (frame), label);
gtk_widget_set_parent (frame, GTK_WIDGET (view));
update_weak_position (view, frame, 100, 100);
}
void
constraint_view_remove_child (ConstraintView *view,
GtkWidget *child)
{
update_weak_position (view, child, -100, -100);
gtk_widget_unparent (child);
}
void
constraint_view_add_guide (ConstraintView *view,
GtkConstraintGuide *guide)
{
GtkConstraintLayout *layout;
GtkWidget *frame;
GtkWidget *label;
const char *name;
GtkConstraint *constraint;
struct {
const char *name;
GtkConstraintAttribute attr;
} names[] = {
{ "left-constraint", GTK_CONSTRAINT_ATTRIBUTE_LEFT },
{ "top-constraint", GTK_CONSTRAINT_ATTRIBUTE_TOP },
{ "width-constraint", GTK_CONSTRAINT_ATTRIBUTE_WIDTH },
{ "height-constraint", GTK_CONSTRAINT_ATTRIBUTE_HEIGHT },
};
int i;
name = gtk_constraint_guide_get_name (guide);
label = gtk_label_new (name);
g_object_bind_property (guide, "name",
label, "label",
G_BINDING_DEFAULT);
frame = gtk_frame_new (NULL);
gtk_style_context_add_class (gtk_widget_get_style_context (frame), "guide");
g_object_set_data (G_OBJECT (frame), "internal", "yes");
gtk_container_add (GTK_CONTAINER (frame), label);
gtk_widget_insert_after (frame, GTK_WIDGET (view), NULL);
g_object_set_data (G_OBJECT (guide), "frame", frame);
layout = GTK_CONSTRAINT_LAYOUT (gtk_widget_get_layout_manager (GTK_WIDGET (view)));
gtk_constraint_layout_add_guide (layout, g_object_ref (guide));
for (i = 0; i < G_N_ELEMENTS (names); i++)
{
constraint = gtk_constraint_new (frame,
names[i].attr,
GTK_CONSTRAINT_RELATION_EQ,
guide,
names[i].attr,
1.0, 0.0,
GTK_CONSTRAINT_STRENGTH_REQUIRED);
g_object_set_data (G_OBJECT (constraint), "internal", "yes");
gtk_constraint_layout_add_constraint (layout, constraint);
g_object_set_data (G_OBJECT (guide), names[i].name, constraint);
}
update_weak_position (view, frame, 150, 150);
}
void
constraint_view_remove_guide (ConstraintView *view,
GtkConstraintGuide *guide)
{
GtkConstraintLayout *layout;
GtkWidget *frame;
GtkConstraint *constraint;
const char *names[] = {
"left-constraint",
"top-constraint",
"width-constraint",
"height-constraint"
};
int i;
layout = GTK_CONSTRAINT_LAYOUT (gtk_widget_get_layout_manager (GTK_WIDGET (view)));
for (i = 0; i < G_N_ELEMENTS (names); i++)
{
constraint = (GtkConstraint*)g_object_get_data (G_OBJECT (guide), names[i]);
gtk_constraint_layout_remove_constraint (layout, constraint);
}
frame = (GtkWidget *)g_object_get_data (G_OBJECT (guide), "frame");
update_weak_position (view, frame, -100, -100);
gtk_widget_unparent (frame);
gtk_constraint_layout_remove_guide (layout, guide);
}
void
constraint_view_add_constraint (ConstraintView *view,
GtkConstraint *constraint)
{
GtkLayoutManager *manager;
manager = gtk_widget_get_layout_manager (GTK_WIDGET (view));
gtk_constraint_layout_add_constraint (GTK_CONSTRAINT_LAYOUT (manager),
g_object_ref (constraint));
}
void
constraint_view_remove_constraint (ConstraintView *view,
GtkConstraint *constraint)
{
GtkLayoutManager *manager;
manager = gtk_widget_get_layout_manager (GTK_WIDGET (view));
gtk_constraint_layout_remove_constraint (GTK_CONSTRAINT_LAYOUT (manager),
constraint);
}
GListModel *
constraint_view_get_model (ConstraintView *view)
{
return view->model;
}

View File

@@ -1,44 +0,0 @@
/*
* Copyright © 2019 Red Hat, Inc
*
* 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.
*
* You should have received a copy of the GNU Lesser General Public
* License along with this library. If not, see <http://www.gnu.org/licenses/>.
*
* Authors: Matthias Clasen
*/
#pragma once
#include <gtk/gtk.h>
#define CONSTRAINT_VIEW_TYPE (constraint_view_get_type ())
G_DECLARE_FINAL_TYPE (ConstraintView, constraint_view, CONSTRAINT, VIEW, GtkWidget)
ConstraintView * constraint_view_new (void);
void constraint_view_add_child (ConstraintView *view,
const char *name);
void constraint_view_remove_child (ConstraintView *view,
GtkWidget *child);
void constraint_view_add_guide (ConstraintView *view,
GtkConstraintGuide *guide);
void constraint_view_remove_guide (ConstraintView *view,
GtkConstraintGuide *guide);
void constraint_view_guide_changed (ConstraintView *view,
GtkConstraintGuide *guide);
void constraint_view_add_constraint (ConstraintView *view,
GtkConstraint *constraint);
void constraint_view_remove_constraint (ConstraintView *view,
GtkConstraint *constraint);
GListModel * constraint_view_get_model (ConstraintView *view);

View File

@@ -1,411 +0,0 @@
/*
* Copyright © 2019 Red Hat, Inc.
*
* 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.
*
* You should have received a copy of the GNU Lesser General Public
* License along with this library. If not, see <http://www.gnu.org/licenses/>.
*
* Authors: Matthias Clasen
*/
#include "config.h"
#include "guide-editor.h"
struct _GuideEditor
{
GtkWidget parent_instance;
GtkWidget *grid;
GtkWidget *name;
GtkWidget *min_width;
GtkWidget *min_height;
GtkWidget *nat_width;
GtkWidget *nat_height;
GtkWidget *max_width;
GtkWidget *max_height;
GtkWidget *strength;
GtkWidget *button;
GtkConstraintGuide *guide;
gboolean constructed;
};
enum {
PROP_GUIDE = 1,
LAST_PROP
};
static GParamSpec *pspecs[LAST_PROP];
enum {
DONE,
LAST_SIGNAL
};
static guint signals[LAST_SIGNAL];
G_DEFINE_TYPE(GuideEditor, guide_editor, GTK_TYPE_WIDGET);
static void
guide_strength_combo (GtkWidget *combo)
{
gtk_combo_box_text_append (GTK_COMBO_BOX_TEXT (combo), "weak", "Weak");
gtk_combo_box_text_append (GTK_COMBO_BOX_TEXT (combo), "medium", "Medium");
gtk_combo_box_text_append (GTK_COMBO_BOX_TEXT (combo), "strong", "Strong");
gtk_combo_box_text_append (GTK_COMBO_BOX_TEXT (combo), "required", "Required");
}
static GtkConstraintStrength
get_strength (const char *id)
{
GtkConstraintStrength strength;
GEnumClass *class = g_type_class_ref (GTK_TYPE_CONSTRAINT_STRENGTH);
GEnumValue *value = g_enum_get_value_by_nick (class, id);
strength = value->value;
g_type_class_unref (class);
return strength;
}
const char *
get_strength_nick (GtkConstraintStrength strength)
{
GEnumClass *class = g_type_class_ref (GTK_TYPE_CONSTRAINT_STRENGTH);
GEnumValue *value = g_enum_get_value (class, strength);
const char *nick = value->value_nick;
g_type_class_unref (class);
return nick;
}
void
guide_editor_serialize_guide (GString *str,
int indent,
GtkConstraintGuide *guide)
{
int min_width, min_height;
int nat_width, nat_height;
int max_width, max_height;
const char *name;
const char *strength;
gtk_constraint_guide_get_min_size (guide, &min_width, &min_height);
gtk_constraint_guide_get_nat_size (guide, &nat_width, &nat_height);
gtk_constraint_guide_get_max_size (guide, &max_width, &max_height);
name = gtk_constraint_guide_get_name (guide);
strength = get_strength_nick (gtk_constraint_guide_get_strength (guide));
g_string_append_printf (str, "%*s<guide min-width=\"%d\" min-height=\"%d\"\n", indent, "", min_width, min_height);
g_string_append_printf (str, "%*s nat-width=\"%d\" nat-height=\"%d\"\n", indent, "", nat_width, nat_height);
g_string_append_printf (str, "%*s max-width=\"%d\" max-height=\"%d\"\n", indent, "", max_width, max_height);
g_string_append_printf (str, "%*s name=\"%s\" strength=\"%s\" />\n", indent, "", name, strength);
}
static void
create_guide (GtkButton *button,
GuideEditor *editor)
{
const char *id;
int strength;
const char *name;
int w, h;
GtkConstraintGuide *guide;
if (editor->guide)
guide = g_object_ref (editor->guide);
else
guide = gtk_constraint_guide_new ();
name = gtk_editable_get_text (GTK_EDITABLE (editor->name));
gtk_constraint_guide_set_name (guide, name);
w = gtk_spin_button_get_value_as_int (GTK_SPIN_BUTTON (editor->min_width));
h = gtk_spin_button_get_value_as_int (GTK_SPIN_BUTTON (editor->min_height));
gtk_constraint_guide_set_min_size (guide, w, h);
w = gtk_spin_button_get_value_as_int (GTK_SPIN_BUTTON (editor->nat_width));
h = gtk_spin_button_get_value_as_int (GTK_SPIN_BUTTON (editor->nat_height));
gtk_constraint_guide_set_nat_size (guide, w, h);
w = gtk_spin_button_get_value_as_int (GTK_SPIN_BUTTON (editor->max_width));
h = gtk_spin_button_get_value_as_int (GTK_SPIN_BUTTON (editor->max_height));
gtk_constraint_guide_set_max_size (guide, w, h);
id = gtk_combo_box_get_active_id (GTK_COMBO_BOX (editor->strength));
strength = get_strength (id);
gtk_constraint_guide_set_strength (guide, strength);
g_signal_emit (editor, signals[DONE], 0, guide);
g_object_unref (guide);
}
static void
guide_editor_init (GuideEditor *editor)
{
gtk_widget_init_template (GTK_WIDGET (editor));
}
static int guide_counter;
static int
min_input (GtkSpinButton *spin_button,
double *new_val)
{
if (strcmp (gtk_editable_get_text (GTK_EDITABLE (spin_button)), "") == 0)
{
*new_val = 0.0;
return TRUE;
}
return FALSE;
}
static int
max_input (GtkSpinButton *spin_button,
double *new_val)
{
if (strcmp (gtk_editable_get_text (GTK_EDITABLE (spin_button)), "") == 0)
{
*new_val = G_MAXINT;
return TRUE;
}
return FALSE;
}
static gboolean
min_output (GtkSpinButton *spin_button)
{
GtkAdjustment *adjustment;
double value;
GtkWidget *box, *text;
adjustment = gtk_spin_button_get_adjustment (spin_button);
value = gtk_adjustment_get_value (adjustment);
box = gtk_widget_get_first_child (GTK_WIDGET (spin_button));
text = gtk_widget_get_first_child (box);
if (value == 0.0)
{
gtk_editable_set_text (GTK_EDITABLE (spin_button), "");
gtk_text_set_placeholder_text (GTK_TEXT (text), "unset");
return TRUE;
}
else
{
gtk_text_set_placeholder_text (GTK_TEXT (text), "");
return FALSE;
}
}
static gboolean
max_output (GtkSpinButton *spin_button)
{
GtkAdjustment *adjustment;
double value;
GtkWidget *box, *text;
adjustment = gtk_spin_button_get_adjustment (spin_button);
value = gtk_adjustment_get_value (adjustment);
box = gtk_widget_get_first_child (GTK_WIDGET (spin_button));
text = gtk_widget_get_first_child (box);
if (value == (double)G_MAXINT)
{
gtk_editable_set_text (GTK_EDITABLE (spin_button), "");
gtk_text_set_placeholder_text (GTK_TEXT (text), "unset");
return TRUE;
}
else
{
gtk_text_set_placeholder_text (GTK_TEXT (text), "");
return FALSE;
}
}
static void
guide_editor_constructed (GObject *object)
{
GuideEditor *editor = GUIDE_EDITOR (object);
guide_strength_combo (editor->strength);
g_signal_connect (editor->min_width, "input", G_CALLBACK (min_input), NULL);
g_signal_connect (editor->min_width, "output", G_CALLBACK (min_output), NULL);
g_signal_connect (editor->min_height, "input", G_CALLBACK (min_input), NULL);
g_signal_connect (editor->min_height, "output", G_CALLBACK (min_output), NULL);
g_signal_connect (editor->max_width, "input", G_CALLBACK (max_input), NULL);
g_signal_connect (editor->max_width, "output", G_CALLBACK (max_output), NULL);
g_signal_connect (editor->max_height, "input", G_CALLBACK (max_input), NULL);
g_signal_connect (editor->max_height, "output", G_CALLBACK (max_output), NULL);
if (editor->guide)
{
GtkConstraintStrength strength;
const char *nick;
int w, h;
nick = gtk_constraint_guide_get_name (editor->guide);
if (nick)
gtk_editable_set_text (GTK_EDITABLE (editor->name), nick);
gtk_constraint_guide_get_min_size (editor->guide, &w, &h);
gtk_spin_button_set_value (GTK_SPIN_BUTTON (editor->min_width), w);
gtk_spin_button_set_value (GTK_SPIN_BUTTON (editor->min_height), h);
gtk_constraint_guide_get_nat_size (editor->guide, &w, &h);
gtk_spin_button_set_value (GTK_SPIN_BUTTON (editor->nat_width), w);
gtk_spin_button_set_value (GTK_SPIN_BUTTON (editor->nat_height), h);
gtk_constraint_guide_get_max_size (editor->guide, &w, &h);
gtk_spin_button_set_value (GTK_SPIN_BUTTON (editor->max_width), w);
gtk_spin_button_set_value (GTK_SPIN_BUTTON (editor->max_height), h);
strength = gtk_constraint_guide_get_strength (editor->guide);
nick = get_strength_nick (strength);
gtk_combo_box_set_active_id (GTK_COMBO_BOX (editor->strength), nick);
gtk_button_set_label (GTK_BUTTON (editor->button), "Apply");
}
else
{
char *name;
guide_counter++;
name = g_strdup_printf ("Guide %d", guide_counter);
gtk_editable_set_text (GTK_EDITABLE (editor->name), name);
g_free (name);
gtk_spin_button_set_value (GTK_SPIN_BUTTON (editor->min_width), 0.0);
gtk_spin_button_set_value (GTK_SPIN_BUTTON (editor->min_height), 0.0);
gtk_spin_button_set_value (GTK_SPIN_BUTTON (editor->nat_width), 0.0);
gtk_spin_button_set_value (GTK_SPIN_BUTTON (editor->nat_height), 0.0);
gtk_spin_button_set_value (GTK_SPIN_BUTTON (editor->max_width), G_MAXINT);
gtk_spin_button_set_value (GTK_SPIN_BUTTON (editor->max_height), G_MAXINT);
gtk_combo_box_set_active_id (GTK_COMBO_BOX (editor->strength), "medium");
gtk_button_set_label (GTK_BUTTON (editor->button), "Create");
}
editor->constructed = TRUE;
}
static void
guide_editor_set_property (GObject *object,
guint property_id,
const GValue *value,
GParamSpec *pspec)
{
GuideEditor *self = GUIDE_EDITOR (object);
switch (property_id)
{
case PROP_GUIDE:
self->guide = g_value_dup_object (value);
break;
default:
G_OBJECT_WARN_INVALID_PROPERTY_ID (object, property_id, pspec);
}
}
static void
guide_editor_get_property (GObject *object,
guint property_id,
GValue *value,
GParamSpec *pspec)
{
GuideEditor *self = GUIDE_EDITOR (object);
switch (property_id)
{
case PROP_GUIDE:
g_value_set_object (value, self->guide);
break;
default:
G_OBJECT_WARN_INVALID_PROPERTY_ID (object, property_id, pspec);
}
}
static void
guide_editor_dispose (GObject *object)
{
GuideEditor *self = (GuideEditor *)object;
g_clear_pointer (&self->grid, gtk_widget_unparent);
g_clear_object (&self->guide);
G_OBJECT_CLASS (guide_editor_parent_class)->dispose (object);
}
static void
guide_editor_class_init (GuideEditorClass *class)
{
GObjectClass *object_class = G_OBJECT_CLASS (class);
GtkWidgetClass *widget_class = GTK_WIDGET_CLASS (class);
object_class->constructed = guide_editor_constructed;
object_class->dispose = guide_editor_dispose;
object_class->set_property = guide_editor_set_property;
object_class->get_property = guide_editor_get_property;
pspecs[PROP_GUIDE] =
g_param_spec_object ("guide", "guide", "guide",
GTK_TYPE_CONSTRAINT_GUIDE,
G_PARAM_READWRITE|G_PARAM_CONSTRUCT_ONLY);
g_object_class_install_properties (object_class, LAST_PROP, pspecs);
signals[DONE] =
g_signal_new ("done",
G_TYPE_FROM_CLASS (object_class),
G_SIGNAL_RUN_LAST,
0,
NULL, NULL,
NULL,
G_TYPE_NONE, 1, GTK_TYPE_CONSTRAINT_GUIDE);
gtk_widget_class_set_layout_manager_type (widget_class, GTK_TYPE_BIN_LAYOUT);
gtk_widget_class_set_template_from_resource (widget_class,
"/org/gtk/gtk4/constraint-editor/guide-editor.ui");
gtk_widget_class_bind_template_child (widget_class, GuideEditor, grid);
gtk_widget_class_bind_template_child (widget_class, GuideEditor, name);
gtk_widget_class_bind_template_child (widget_class, GuideEditor, min_width);
gtk_widget_class_bind_template_child (widget_class, GuideEditor, min_height);
gtk_widget_class_bind_template_child (widget_class, GuideEditor, nat_width);
gtk_widget_class_bind_template_child (widget_class, GuideEditor, nat_height);
gtk_widget_class_bind_template_child (widget_class, GuideEditor, max_width);
gtk_widget_class_bind_template_child (widget_class, GuideEditor, max_height);
gtk_widget_class_bind_template_child (widget_class, GuideEditor, strength);
gtk_widget_class_bind_template_child (widget_class, GuideEditor, button);
gtk_widget_class_bind_template_callback (widget_class, create_guide);
}
GuideEditor *
guide_editor_new (GtkConstraintGuide *guide)
{
return g_object_new (GUIDE_EDITOR_TYPE,
"guide", guide,
NULL);
}

View File

@@ -1,32 +0,0 @@
/*
* Copyright © 2019 Red Hat, Inc
*
* 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.
*
* You should have received a copy of the GNU Lesser General Public
* License along with this library. If not, see <http://www.gnu.org/licenses/>.
*
* Authors: Matthias Clasen
*/
#pragma once
#include <gtk/gtk.h>
#define GUIDE_EDITOR_TYPE (guide_editor_get_type ())
G_DECLARE_FINAL_TYPE (GuideEditor, guide_editor, GUIDE, EDITOR, GtkWidget)
GuideEditor * guide_editor_new (GtkConstraintGuide *guide);
void guide_editor_serialize_guide (GString *str,
int indent,
GtkConstraintGuide *guide);

View File

@@ -1,188 +0,0 @@
<?xml version="1.0" encoding="UTF-8"?>
<interface>
<object class="GtkAdjustment" id="min_width_adj">
<property name="lower">0</property>
<property name="upper">2147483647</property>
<property name="step-increment">1</property>
<property name="page-increment">10</property>
<property name="page-size">0</property>
</object>
<object class="GtkAdjustment" id="min_height_adj">
<property name="lower">0</property>
<property name="upper">2147483647</property>
<property name="step-increment">1</property>
<property name="page-increment">10</property>
<property name="page-size">0</property>
</object>
<object class="GtkAdjustment" id="nat_width_adj">
<property name="lower">0</property>
<property name="upper">2147483647</property>
<property name="step-increment">1</property>
<property name="page-increment">10</property>
<property name="page-size">0</property>
</object>
<object class="GtkAdjustment" id="nat_height_adj">
<property name="lower">0</property>
<property name="upper">2147483647</property>
<property name="step-increment">1</property>
<property name="page-increment">10</property>
<property name="page-size">0</property>
</object>
<object class="GtkAdjustment" id="max_width_adj">
<property name="lower">0</property>
<property name="upper">2147483647</property>
<property name="step-increment">1</property>
<property name="page-increment">10</property>
<property name="page-size">0</property>
</object>
<object class="GtkAdjustment" id="max_height_adj">
<property name="lower">0</property>
<property name="upper">2147483647</property>
<property name="step-increment">1</property>
<property name="page-increment">10</property>
<property name="page-size">0</property>
</object>
<template class="GuideEditor" parent="GtkWidget">
<child>
<object class="GtkGrid" id="grid">
<property name="margin">20</property>
<property name="row-spacing">10</property>
<property name="column-spacing">10</property>
<child>
<object class="GtkLabel">
<property name="label">Name</property>
<layout>
<property name="left-attach">0</property>
<property name="top-attach">0</property>
</layout>
</object>
</child>
<child>
<object class="GtkEntry" id="name">
<property name="max-width-chars">20</property>
<layout>
<property name="left-attach">1</property>
<property name="top-attach">0</property>
<property name="column-span">2</property>
</layout>
</object>
</child>
<child>
<object class="GtkLabel">
<property name="label">Min Size</property>
<layout>
<property name="left-attach">0</property>
<property name="top-attach">1</property>
</layout>
</object>
</child>
<child>
<object class="GtkSpinButton" id="min_width">
<property name="adjustment">min_width_adj</property>
<property name="max-width-chars">5</property>
<layout>
<property name="left-attach">1</property>
<property name="top-attach">1</property>
</layout>
</object>
</child>
<child>
<object class="GtkSpinButton" id="min_height">
<property name="adjustment">min_height_adj</property>
<property name="max-width-chars">5</property>
<layout>
<property name="left-attach">2</property>
<property name="top-attach">1</property>
</layout>
</object>
</child>
<child>
<object class="GtkLabel">
<property name="label">Nat Size</property>
<layout>
<property name="left-attach">0</property>
<property name="top-attach">2</property>
</layout>
</object>
</child>
<child>
<object class="GtkSpinButton" id="nat_width">
<property name="adjustment">nat_width_adj</property>
<property name="max-width-chars">5</property>
<layout>
<property name="left-attach">1</property>
<property name="top-attach">2</property>
</layout>
</object>
</child>
<child>
<object class="GtkSpinButton" id="nat_height">
<property name="adjustment">nat_height_adj</property>
<property name="max-width-chars">5</property>
<layout>
<property name="left-attach">2</property>
<property name="top-attach">2</property>
</layout>
</object>
</child>
<child>
<object class="GtkLabel">
<property name="label">Max Size</property>
<layout>
<property name="left-attach">0</property>
<property name="top-attach">3</property>
</layout>
</object>
</child>
<child>
<object class="GtkSpinButton" id="max_width">
<property name="adjustment">max_width_adj</property>
<property name="max-width-chars">5</property>
<layout>
<property name="left-attach">1</property>
<property name="top-attach">3</property>
</layout>
</object>
</child>
<child>
<object class="GtkSpinButton" id="max_height">
<property name="adjustment">max_height_adj</property>
<property name="max-width-chars">5</property>
<layout>
<property name="left-attach">2</property>
<property name="top-attach">3</property>
</layout>
</object>
</child>
<child>
<object class="GtkLabel">
<property name="label">Strength</property>
<layout>
<property name="left-attach">0</property>
<property name="top-attach">4</property>
</layout>
</object>
</child>
<child>
<object class="GtkComboBoxText" id="strength">
<layout>
<property name="left-attach">1</property>
<property name="top-attach">4</property>
<property name="column-span">2</property>
</layout>
</object>
</child>
<child>
<object class="GtkButton" id="button">
<property name="label">Create</property>
<signal name="clicked" handler="create_guide"/>
<layout>
<property name="left-attach">2</property>
<property name="top-attach">5</property>
</layout>
</object>
</child>
</object>
</child>
</template>
</interface>

View File

@@ -1,28 +0,0 @@
/*
* Copyright © 2019 Red Hat, Inc.
*
* 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.
*
* You should have received a copy of the GNU Lesser General Public
* License along with this library. If not, see <http://www.gnu.org/licenses/>.
*
* Authors: Matthias Clasen <mclasen@redhat.com>
*/
#include "config.h"
#include <constraint-editor-application.h>
int
main (int argc, char *argv[])
{
return g_application_run (G_APPLICATION (constraint_editor_application_new ()), argc, argv);
}

View File

@@ -1,20 +0,0 @@
constraint_editor_sources = [
'main.c',
'constraint-editor-application.c',
'constraint-editor-window.c',
'constraint-view.c',
'constraint-editor.c',
'guide-editor.c',
]
constraint_editor_resources = gnome.compile_resources('constraint_editor_resources',
'constraint-editor.gresource.xml',
source_dir: '.')
executable('gtk4-constraint-editor',
constraint_editor_sources, constraint_editor_resources,
dependencies: libgtk_dep,
include_directories: confinc,
gui_app: true,
link_args: extra_demo_ldflags,
install: false)

Binary file not shown.

Before

Width:  |  Height:  |  Size: 1.4 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 1.7 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 26 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 3.5 KiB

View File

@@ -1,549 +0,0 @@
#include "config.h"
#include <gtk/gtk.h>
typedef GtkApplication DemoApplication;
typedef GtkApplicationClass DemoApplicationClass;
G_DEFINE_TYPE (DemoApplication, demo_application, GTK_TYPE_APPLICATION)
typedef struct {
GtkApplicationWindow parent_instance;
GtkWidget *message;
GtkWidget *infobar;
GtkWidget *status;
GtkWidget *menutool;
GMenuModel *toolmenu;
GtkTextBuffer *buffer;
int width;
int height;
gboolean maximized;
gboolean fullscreen;
} DemoApplicationWindow;
typedef GtkApplicationWindowClass DemoApplicationWindowClass;
G_DEFINE_TYPE (DemoApplicationWindow, demo_application_window, GTK_TYPE_APPLICATION_WINDOW)
static void create_window (GApplication *app, const char *contents);
static void
show_action_dialog (GSimpleAction *action)
{
const gchar *name;
GtkWidget *dialog;
name = g_action_get_name (G_ACTION (action));
dialog = gtk_message_dialog_new (NULL,
GTK_DIALOG_DESTROY_WITH_PARENT,
GTK_MESSAGE_INFO,
GTK_BUTTONS_CLOSE,
"You activated action: \"%s\"",
name);
g_signal_connect (dialog, "response",
G_CALLBACK (gtk_widget_destroy), NULL);
gtk_widget_show (dialog);
}
static void
show_action_infobar (GSimpleAction *action,
GVariant *parameter,
gpointer data)
{
DemoApplicationWindow *window = data;
gchar *text;
const gchar *name;
const gchar *value;
name = g_action_get_name (G_ACTION (action));
value = g_variant_get_string (parameter, NULL);
text = g_strdup_printf ("You activated radio action: \"%s\".\n"
"Current value: %s", name, value);
gtk_label_set_text (GTK_LABEL (window->message), text);
gtk_widget_show (window->infobar);
g_free (text);
}
static void
activate_action (GSimpleAction *action,
GVariant *parameter,
gpointer user_data)
{
show_action_dialog (action);
}
static void
activate_new (GSimpleAction *action,
GVariant *parameter,
gpointer user_data)
{
GApplication *app = user_data;
create_window (app, NULL);
}
static void
open_response_cb (GtkNativeDialog *dialog,
gint response_id,
gpointer user_data)
{
GtkFileChooserNative *native = user_data;
GApplication *app = g_object_get_data (G_OBJECT (native), "app");
GtkWidget *message_dialog;
GFile *file;
char *contents;
GError *error = NULL;
if (response_id == GTK_RESPONSE_ACCEPT)
{
file = gtk_file_chooser_get_file (GTK_FILE_CHOOSER (native));
if (g_file_load_contents (file, NULL, &contents, NULL, NULL, &error))
{
create_window (app, contents);
g_free (contents);
}
else
{
message_dialog = gtk_message_dialog_new (NULL,
GTK_DIALOG_DESTROY_WITH_PARENT,
GTK_MESSAGE_ERROR,
GTK_BUTTONS_CLOSE,
"Error loading file: \"%s\"",
error->message);
g_signal_connect (message_dialog, "response",
G_CALLBACK (gtk_widget_destroy), NULL);
gtk_widget_show (message_dialog);
g_error_free (error);
}
}
gtk_native_dialog_destroy (GTK_NATIVE_DIALOG (native));
g_object_unref (native);
}
static void
activate_open (GSimpleAction *action,
GVariant *parameter,
gpointer user_data)
{
GApplication *app = user_data;
GtkFileChooserNative *native;
native = gtk_file_chooser_native_new ("Open File",
NULL,
GTK_FILE_CHOOSER_ACTION_OPEN,
"_Open",
"_Cancel");
g_object_set_data_full (G_OBJECT (native), "app", g_object_ref (app), g_object_unref);
g_signal_connect (native,
"response",
G_CALLBACK (open_response_cb),
native);
gtk_native_dialog_show (GTK_NATIVE_DIALOG (native));
}
static void
activate_toggle (GSimpleAction *action,
GVariant *parameter,
gpointer user_data)
{
GVariant *state;
show_action_dialog (action);
state = g_action_get_state (G_ACTION (action));
g_action_change_state (G_ACTION (action), g_variant_new_boolean (!g_variant_get_boolean (state)));
g_variant_unref (state);
}
static void
activate_radio (GSimpleAction *action,
GVariant *parameter,
gpointer user_data)
{
show_action_infobar (action, parameter, user_data);
g_action_change_state (G_ACTION (action), parameter);
}
static void
activate_about (GSimpleAction *action,
GVariant *parameter,
gpointer user_data)
{
GtkWidget *window = user_data;
const gchar *authors[] = {
"Peter Mattis",
"Spencer Kimball",
"Josh MacDonald",
"and many more...",
NULL
};
const gchar *documentors[] = {
"Owen Taylor",
"Tony Gale",
"Matthias Clasen <mclasen@redhat.com>",
"and many more...",
NULL
};
gtk_show_about_dialog (GTK_WINDOW (window),
"program-name", "GTK Code Demos",
"version", g_strdup_printf ("%s,\nRunning against GTK %d.%d.%d",
PACKAGE_VERSION,
gtk_get_major_version (),
gtk_get_minor_version (),
gtk_get_micro_version ()),
"copyright", "(C) 1997-2013 The GTK Team",
"license-type", GTK_LICENSE_LGPL_2_1,
"website", "http://www.gtk.org",
"comments", "Program to demonstrate GTK functions.",
"authors", authors,
"documenters", documentors,
"logo-icon-name", "org.gtk.Demo4",
"title", "About GTK Code Demos",
NULL);
}
static void
activate_quit (GSimpleAction *action,
GVariant *parameter,
gpointer user_data)
{
GtkApplication *app = user_data;
GtkWidget *win;
GList *list, *next;
list = gtk_application_get_windows (app);
while (list)
{
win = list->data;
next = list->next;
gtk_widget_destroy (GTK_WIDGET (win));
list = next;
}
}
static void
update_statusbar (GtkTextBuffer *buffer,
DemoApplicationWindow *window)
{
gchar *msg;
gint row, col;
gint count;
GtkTextIter iter;
/* clear any previous message, underflow is allowed */
gtk_statusbar_pop (GTK_STATUSBAR (window->status), 0);
count = gtk_text_buffer_get_char_count (buffer);
gtk_text_buffer_get_iter_at_mark (buffer,
&iter,
gtk_text_buffer_get_insert (buffer));
row = gtk_text_iter_get_line (&iter);
col = gtk_text_iter_get_line_offset (&iter);
msg = g_strdup_printf ("Cursor at row %d column %d - %d chars in document",
row, col, count);
gtk_statusbar_push (GTK_STATUSBAR (window->status), 0, msg);
g_free (msg);
}
static void
mark_set_callback (GtkTextBuffer *buffer,
const GtkTextIter *new_location,
GtkTextMark *mark,
DemoApplicationWindow *window)
{
update_statusbar (buffer, window);
}
static void
change_theme_state (GSimpleAction *action,
GVariant *state,
gpointer user_data)
{
GtkSettings *settings = gtk_settings_get_default ();
g_object_set (G_OBJECT (settings),
"gtk-application-prefer-dark-theme",
g_variant_get_boolean (state),
NULL);
g_simple_action_set_state (action, state);
}
static void
change_radio_state (GSimpleAction *action,
GVariant *state,
gpointer user_data)
{
g_simple_action_set_state (action, state);
}
static GActionEntry app_entries[] = {
{ "new", activate_new, NULL, NULL, NULL },
{ "open", activate_open, NULL, NULL, NULL },
{ "save", activate_action, NULL, NULL, NULL },
{ "save-as", activate_action, NULL, NULL, NULL },
{ "quit", activate_quit, NULL, NULL, NULL },
{ "dark", activate_toggle, NULL, "false", change_theme_state }
};
static GActionEntry win_entries[] = {
{ "shape", activate_radio, "s", "'oval'", change_radio_state },
{ "bold", activate_toggle, NULL, "false", NULL },
{ "about", activate_about, NULL, NULL, NULL },
{ "file1", activate_action, NULL, NULL, NULL },
{ "logo", activate_action, NULL, NULL, NULL }
};
static void
clicked_cb (GtkWidget *widget, DemoApplicationWindow *window)
{
gtk_widget_hide (window->infobar);
}
static void
startup (GApplication *app)
{
GtkBuilder *builder;
GMenuModel *appmenu;
GMenuModel *menubar;
G_APPLICATION_CLASS (demo_application_parent_class)->startup (app);
builder = gtk_builder_new ();
gtk_builder_add_from_resource (builder, "/application_demo/menus.ui", NULL);
appmenu = (GMenuModel *)gtk_builder_get_object (builder, "appmenu");
menubar = (GMenuModel *)gtk_builder_get_object (builder, "menubar");
gtk_application_set_app_menu (GTK_APPLICATION (app), appmenu);
gtk_application_set_menubar (GTK_APPLICATION (app), menubar);
g_object_unref (builder);
}
static void
create_window (GApplication *app,
const char *content)
{
DemoApplicationWindow *window;
window = (DemoApplicationWindow *)g_object_new (demo_application_window_get_type (),
"application", app,
NULL);
if (content)
gtk_text_buffer_set_text (window->buffer, content, -1);
gtk_window_present (GTK_WINDOW (window));
}
static void
activate (GApplication *app)
{
create_window (app, NULL);
}
static void
demo_application_init (DemoApplication *app)
{
GSettings *settings;
GAction *action;
settings = g_settings_new ("org.gtk.Demo4");
g_action_map_add_action_entries (G_ACTION_MAP (app),
app_entries, G_N_ELEMENTS (app_entries),
app);
action = g_settings_create_action (settings, "color");
g_action_map_add_action (G_ACTION_MAP (app), action);
g_object_unref (settings);
}
static void
demo_application_class_init (DemoApplicationClass *class)
{
GApplicationClass *app_class = G_APPLICATION_CLASS (class);
app_class->startup = startup;
app_class->activate = activate;
}
static void
demo_application_window_store_state (DemoApplicationWindow *win)
{
GSettings *settings;
settings = g_settings_new ("org.gtk.Demo4");
g_settings_set (settings, "window-size", "(ii)", win->width, win->height);
g_settings_set_boolean (settings, "maximized", win->maximized);
g_settings_set_boolean (settings, "fullscreen", win->fullscreen);
g_object_unref (settings);
}
static void
demo_application_window_load_state (DemoApplicationWindow *win)
{
GSettings *settings;
settings = g_settings_new ("org.gtk.Demo4");
g_settings_get (settings, "window-size", "(ii)", &win->width, &win->height);
win->maximized = g_settings_get_boolean (settings, "maximized");
win->fullscreen = g_settings_get_boolean (settings, "fullscreen");
g_object_unref (settings);
}
static void
demo_application_window_init (DemoApplicationWindow *window)
{
GtkWidget *popover;
window->width = -1;
window->height = -1;
window->maximized = FALSE;
window->fullscreen = FALSE;
gtk_widget_init_template (GTK_WIDGET (window));
popover = gtk_popover_menu_new_from_model (window->menutool, window->toolmenu);
gtk_menu_tool_button_set_popover (GTK_MENU_TOOL_BUTTON (window->menutool), popover);
g_action_map_add_action_entries (G_ACTION_MAP (window),
win_entries, G_N_ELEMENTS (win_entries),
window);
}
static void
demo_application_window_constructed (GObject *object)
{
DemoApplicationWindow *window = (DemoApplicationWindow *)object;
demo_application_window_load_state (window);
gtk_window_set_default_size (GTK_WINDOW (window), window->width, window->height);
if (window->maximized)
gtk_window_maximize (GTK_WINDOW (window));
if (window->fullscreen)
gtk_window_fullscreen (GTK_WINDOW (window));
G_OBJECT_CLASS (demo_application_window_parent_class)->constructed (object);
}
static void
demo_application_window_size_allocate (GtkWidget *widget,
int width,
int height,
int baseline)
{
DemoApplicationWindow *window = (DemoApplicationWindow *)widget;
GTK_WIDGET_CLASS (demo_application_window_parent_class)->size_allocate (widget,
width,
height,
baseline);
if (!window->maximized && !window->fullscreen)
gtk_window_get_size (GTK_WINDOW (window), &window->width, &window->height);
}
static void
surface_state_changed (GtkWidget *widget)
{
DemoApplicationWindow *window = (DemoApplicationWindow *)widget;
GdkSurfaceState new_state;
new_state = gdk_surface_get_state (gtk_native_get_surface (GTK_NATIVE (widget)));
window->maximized = (new_state & GDK_SURFACE_STATE_MAXIMIZED) != 0;
window->fullscreen = (new_state & GDK_SURFACE_STATE_FULLSCREEN) != 0;
}
static void
demo_application_window_realize (GtkWidget *widget)
{
GTK_WIDGET_CLASS (demo_application_window_parent_class)->realize (widget);
g_signal_connect_swapped (gtk_native_get_surface (GTK_NATIVE (widget)), "notify::state",
G_CALLBACK (surface_state_changed), widget);
}
static void
demo_application_window_unrealize (GtkWidget *widget)
{
g_signal_handlers_disconnect_by_func (gtk_native_get_surface (GTK_NATIVE (widget)),
surface_state_changed, widget);
GTK_WIDGET_CLASS (demo_application_window_parent_class)->unrealize (widget);
}
static void
demo_application_window_destroy (GtkWidget *widget)
{
DemoApplicationWindow *window = (DemoApplicationWindow *)widget;
demo_application_window_store_state (window);
GTK_WIDGET_CLASS (demo_application_window_parent_class)->destroy (widget);
}
static void
demo_application_window_class_init (DemoApplicationWindowClass *class)
{
GObjectClass *object_class = G_OBJECT_CLASS (class);
GtkWidgetClass *widget_class = GTK_WIDGET_CLASS (class);
object_class->constructed = demo_application_window_constructed;
widget_class->size_allocate = demo_application_window_size_allocate;
widget_class->realize = demo_application_window_realize;
widget_class->unrealize = demo_application_window_unrealize;
widget_class->destroy = demo_application_window_destroy;
gtk_widget_class_set_template_from_resource (widget_class, "/application_demo/application.ui");
gtk_widget_class_bind_template_child (widget_class, DemoApplicationWindow, message);
gtk_widget_class_bind_template_child (widget_class, DemoApplicationWindow, infobar);
gtk_widget_class_bind_template_child (widget_class, DemoApplicationWindow, status);
gtk_widget_class_bind_template_child (widget_class, DemoApplicationWindow, buffer);
gtk_widget_class_bind_template_child (widget_class, DemoApplicationWindow, menutool);
gtk_widget_class_bind_template_child (widget_class, DemoApplicationWindow, toolmenu);
gtk_widget_class_bind_template_callback (widget_class, clicked_cb);
gtk_widget_class_bind_template_callback (widget_class, update_statusbar);
gtk_widget_class_bind_template_callback (widget_class, mark_set_callback);
}
int
main (int argc, char *argv[])
{
GtkApplication *app;
app = GTK_APPLICATION (g_object_new (demo_application_get_type (),
"application-id", "org.gtk.Demo4.App",
"flags", G_APPLICATION_HANDLES_OPEN,
NULL));
return g_application_run (G_APPLICATION (app), 0, NULL);
}

View File

@@ -1,103 +0,0 @@
<?xml version="1.0" encoding="UTF-8"?>
<interface>
<template class="DemoApplicationWindow" parent="GtkApplicationWindow">
<property name="title" translatable="yes">Application Class</property>
<property name="default-width">200</property>
<property name="default-height">200</property>
<property name="icon-name">document-open</property>
<child>
<object class="GtkGrid">
<child>
<object class="GtkToolbar">
<property name="hexpand">1</property>
<style>
<class name="primary-toolbar"/>
</style>
<child>
<object class="GtkMenuToolButton" id="menutool">
<property name="icon-name">document-open</property>
</object>
</child>
<child>
<object class="GtkToolButton">
<property name="icon-name">application-exit</property>
<property name="action-name">app.quit</property>
</object>
</child>
<child>
<object class="GtkSeparatorToolItem"/>
</child>
<child>
<object class="GtkToolButton">
<property name="icon-name">applications-other</property>
<property name="action-name">win.logo</property>
</object>
</child>
<layout>
<property name="left-attach">0</property>
<property name="top-attach">0</property>
</layout>
</object>
</child>
<child>
<object class="GtkInfoBar" id="infobar">
<property name="visible">0</property>
<property name="hexpand">1</property>
<child>
<object class="GtkLabel" id="message">
<property name="hexpand">1</property>
</object>
</child>
<child type="action">
<object class="GtkButton">
<property name="valign">center</property>
<property name="label" translatable="yes">_OK</property>
<property name="use-underline">1</property>
<signal name="clicked" handler="clicked_cb"/>
</object>
</child>
<layout>
<property name="left-attach">0</property>
<property name="top-attach">1</property>
</layout>
</object>
</child>
<child>
<object class="GtkScrolledWindow">
<property name="shadow-type">in</property>
<child>
<object class="GtkTextView">
<property name="hexpand">1</property>
<property name="vexpand">1</property>
<property name="buffer">buffer</property>
</object>
</child>
<layout>
<property name="left-attach">0</property>
<property name="top-attach">2</property>
</layout>
</object>
</child>
<child>
<object class="GtkStatusbar" id="status">
<property name="hexpand">1</property>
<layout>
<property name="left-attach">0</property>
<property name="top-attach">3</property>
</layout>
</object>
</child>
</object>
</child>
</template>
<menu id="toolmenu">
<item>
<attribute name="label">File1</attribute>
<attribute name="action">win.file1</attribute>
</item>
</menu>
<object class="GtkTextBuffer" id="buffer">
<signal name="changed" handler="update_statusbar"/>
<signal name="mark-set" handler="mark_set_callback"/>
</object>
</interface>

View File

@@ -1,95 +0,0 @@
/* Application Class
*
* Demonstrates a simple application.
*
* This example uses GtkApplication, GtkApplicationWindow, GtkBuilder
* as well as GMenu and GResource. Due to the way GtkApplication is structured,
* it is run as a separate process.
*/
#include "config.h"
#include <gtk/gtk.h>
static gboolean name_seen;
static GtkWidget *placeholder;
static void
on_name_appeared (GDBusConnection *connection,
const gchar *name,
const gchar *name_owner,
gpointer user_data)
{
name_seen = TRUE;
}
static void
on_name_vanished (GDBusConnection *connection,
const gchar *name,
gpointer user_data)
{
if (!name_seen)
return;
if (placeholder)
{
gtk_widget_destroy (placeholder);
g_object_unref (placeholder);
placeholder = NULL;
}
}
#ifdef G_OS_WIN32
#define APP_EXTENSION ".exe"
#else
#define APP_EXTENSION
#endif
GtkWidget *
do_application_demo (GtkWidget *toplevel)
{
static guint watch = 0;
if (watch == 0)
watch = g_bus_watch_name (G_BUS_TYPE_SESSION,
"org.gtk.Demo4.App",
0,
on_name_appeared,
on_name_vanished,
NULL, NULL);
if (placeholder == NULL)
{
const gchar *command;
GError *error = NULL;
if (g_file_test ("./gtk4-demo-application" APP_EXTENSION, G_FILE_TEST_IS_EXECUTABLE))
command = "./gtk4-demo-application" APP_EXTENSION;
else
command = "gtk4-demo-application";
if (!g_spawn_command_line_async (command, &error))
{
g_warning ("%s", error->message);
g_error_free (error);
}
placeholder = gtk_label_new ("");
g_object_ref_sink (placeholder);
}
else
{
g_dbus_connection_call_sync (g_bus_get_sync (G_BUS_TYPE_SESSION, NULL, NULL),
"org.gtk.Demo4.App",
"/org/gtk/Demo4/App",
"org.gtk.Actions",
"Activate",
g_variant_new ("(sava{sv})", "quit", NULL, NULL),
NULL,
0,
G_MAXINT,
NULL, NULL);
}
return placeholder;
}

View File

@@ -1,18 +0,0 @@
<?xml version="1.0" encoding="UTF-8"?>
<interface>
<menu id="appmenu">
<section>
<item>
<attribute name="label" translatable="yes">About</attribute>
<attribute name="action">app.about</attribute>
</item>
</section>
<section>
<item>
<attribute name="label" translatable="yes">_Quit</attribute>
<attribute name="action">app.quit</attribute>
<attribute name="accel">&lt;Primary&gt;q</attribute>
</item>
</section>
</menu>
</interface>

View File

@@ -1,203 +0,0 @@
/* Assistant
*
* Demonstrates a sample multi-step assistant. Assistants are used to divide
* an operation into several simpler sequential steps, and to guide the user
* through these steps.
*/
#include <gtk/gtk.h>
static GtkWidget *assistant = NULL;
static GtkWidget *progress_bar = NULL;
static gboolean
apply_changes_gradually (gpointer data)
{
gdouble fraction;
/* Work, work, work... */
fraction = gtk_progress_bar_get_fraction (GTK_PROGRESS_BAR (progress_bar));
fraction += 0.05;
if (fraction < 1.0)
{
gtk_progress_bar_set_fraction (GTK_PROGRESS_BAR (progress_bar), fraction);
return G_SOURCE_CONTINUE;
}
else
{
/* Close automatically once changes are fully applied. */
gtk_widget_destroy (assistant);
assistant = NULL;
return G_SOURCE_REMOVE;
}
}
static void
on_assistant_apply (GtkWidget *widget, gpointer data)
{
/* Start a timer to simulate changes taking a few seconds to apply. */
g_timeout_add (100, apply_changes_gradually, NULL);
}
static void
on_assistant_close_cancel (GtkWidget *widget, gpointer data)
{
GtkWidget **assistant = (GtkWidget **) data;
gtk_widget_destroy (*assistant);
*assistant = NULL;
}
static void
on_assistant_prepare (GtkWidget *widget, GtkWidget *page, gpointer data)
{
gint current_page, n_pages;
gchar *title;
current_page = gtk_assistant_get_current_page (GTK_ASSISTANT (widget));
n_pages = gtk_assistant_get_n_pages (GTK_ASSISTANT (widget));
title = g_strdup_printf ("Sample assistant (%d of %d)", current_page + 1, n_pages);
gtk_window_set_title (GTK_WINDOW (widget), title);
g_free (title);
/* The fourth page (counting from zero) is the progress page. The
* user clicked Apply to get here so we tell the assistant to commit,
* which means the changes up to this point are permanent and cannot
* be cancelled or revisited. */
if (current_page == 3)
gtk_assistant_commit (GTK_ASSISTANT (widget));
}
static void
on_entry_changed (GtkWidget *widget, gpointer data)
{
GtkAssistant *assistant = GTK_ASSISTANT (data);
GtkWidget *current_page;
gint page_number;
const gchar *text;
page_number = gtk_assistant_get_current_page (assistant);
current_page = gtk_assistant_get_nth_page (assistant, page_number);
text = gtk_editable_get_text (GTK_EDITABLE (widget));
if (text && *text)
gtk_assistant_set_page_complete (assistant, current_page, TRUE);
else
gtk_assistant_set_page_complete (assistant, current_page, FALSE);
}
static void
create_page1 (GtkWidget *assistant)
{
GtkWidget *box, *label, *entry;
box = gtk_box_new (GTK_ORIENTATION_HORIZONTAL, 12);
g_object_set (box, "margin", 12, NULL);
label = gtk_label_new ("You must fill out this entry to continue:");
gtk_container_add (GTK_CONTAINER (box), label);
entry = gtk_entry_new ();
gtk_entry_set_activates_default (GTK_ENTRY (entry), TRUE);
gtk_widget_set_valign (entry, GTK_ALIGN_CENTER);
gtk_container_add (GTK_CONTAINER (box), entry);
g_signal_connect (G_OBJECT (entry), "changed",
G_CALLBACK (on_entry_changed), assistant);
gtk_assistant_append_page (GTK_ASSISTANT (assistant), box);
gtk_assistant_set_page_title (GTK_ASSISTANT (assistant), box, "Page 1");
gtk_assistant_set_page_type (GTK_ASSISTANT (assistant), box, GTK_ASSISTANT_PAGE_INTRO);
}
static void
create_page2 (GtkWidget *assistant)
{
GtkWidget *box, *checkbutton;
box = gtk_box_new (GTK_ORIENTATION_HORIZONTAL, 12);
g_object_set (box, "margin", 12, NULL);
checkbutton = gtk_check_button_new_with_label ("This is optional data, you may continue "
"even if you do not check this");
gtk_widget_set_valign (checkbutton, GTK_ALIGN_CENTER);
gtk_container_add (GTK_CONTAINER (box), checkbutton);
gtk_assistant_append_page (GTK_ASSISTANT (assistant), box);
gtk_assistant_set_page_complete (GTK_ASSISTANT (assistant), box, TRUE);
gtk_assistant_set_page_title (GTK_ASSISTANT (assistant), box, "Page 2");
}
static void
create_page3 (GtkWidget *assistant)
{
GtkWidget *label;
label = gtk_label_new ("This is a confirmation page, press 'Apply' to apply changes");
gtk_widget_show (label);
gtk_assistant_append_page (GTK_ASSISTANT (assistant), label);
gtk_assistant_set_page_type (GTK_ASSISTANT (assistant), label, GTK_ASSISTANT_PAGE_CONFIRM);
gtk_assistant_set_page_complete (GTK_ASSISTANT (assistant), label, TRUE);
gtk_assistant_set_page_title (GTK_ASSISTANT (assistant), label, "Confirmation");
}
static void
create_page4 (GtkWidget *assistant)
{
progress_bar = gtk_progress_bar_new ();
gtk_widget_set_halign (progress_bar, GTK_ALIGN_FILL);
gtk_widget_set_valign (progress_bar, GTK_ALIGN_CENTER);
gtk_widget_set_hexpand (progress_bar, TRUE);
gtk_widget_set_margin_start (progress_bar, 40);
gtk_widget_set_margin_end (progress_bar, 40);
gtk_widget_show (progress_bar);
gtk_assistant_append_page (GTK_ASSISTANT (assistant), progress_bar);
gtk_assistant_set_page_type (GTK_ASSISTANT (assistant), progress_bar, GTK_ASSISTANT_PAGE_PROGRESS);
gtk_assistant_set_page_title (GTK_ASSISTANT (assistant), progress_bar, "Applying changes");
/* This prevents the assistant window from being
* closed while we're "busy" applying changes.
*/
gtk_assistant_set_page_complete (GTK_ASSISTANT (assistant), progress_bar, FALSE);
}
GtkWidget*
do_assistant (GtkWidget *do_widget)
{
if (!assistant)
{
assistant = gtk_assistant_new ();
gtk_window_set_default_size (GTK_WINDOW (assistant), -1, 300);
gtk_window_set_display (GTK_WINDOW (assistant),
gtk_widget_get_display (do_widget));
create_page1 (assistant);
create_page2 (assistant);
create_page3 (assistant);
create_page4 (assistant);
g_signal_connect (G_OBJECT (assistant), "cancel",
G_CALLBACK (on_assistant_close_cancel), &assistant);
g_signal_connect (G_OBJECT (assistant), "close",
G_CALLBACK (on_assistant_close_cancel), &assistant);
g_signal_connect (G_OBJECT (assistant), "apply",
G_CALLBACK (on_assistant_apply), NULL);
g_signal_connect (G_OBJECT (assistant), "prepare",
G_CALLBACK (on_assistant_prepare), NULL);
}
if (!gtk_widget_get_visible (assistant))
gtk_widget_show (assistant);
else
{
gtk_widget_destroy (assistant);
assistant = NULL;
}
return assistant;
}

Binary file not shown.

Before

Width:  |  Height:  |  Size: 22 KiB

View File

@@ -1,337 +0,0 @@
<?xml version="1.0" encoding="UTF-8"?>
<interface>
<requires lib="gtk+" version="3.20"/>
<object class="GtkWindow" id="window">
<property name="resizable">0</property>
<property name="title">CSS Blend Modes</property>
<property name="default-width">400</property>
<property name="default-height">300</property>
<child>
<object class="GtkGrid">
<property name="row-spacing">12</property>
<property name="column-spacing">12</property>
<child>
<object class="GtkLabel">
<property name="label" translatable="yes">Blend mode:</property>
<property name="xalign">0</property>
<style>
<class name="dim-label"/>
</style>
<layout>
<property name="left-attach">0</property>
<property name="top-attach">0</property>
</layout>
</object>
</child>
<child>
<object class="GtkScrolledWindow" id="scrolledwindow">
<property name="can-focus">1</property>
<property name="vexpand">1</property>
<property name="shadow-type">in</property>
<property name="min-content-width">150</property>
<layout>
<property name="left-attach">0</property>
<property name="top-attach">1</property>
</layout>
</object>
</child>
<child>
<object class="GtkStackSwitcher">
<property name="halign">center</property>
<property name="hexpand">1</property>
<property name="stack">stack</property>
<layout>
<property name="left-attach">1</property>
<property name="top-attach">0</property>
</layout>
</object>
</child>
<child>
<object class="GtkStack" id="stack">
<property name="hexpand">1</property>
<property name="vexpand">1</property>
<property name="hhomogeneous">0</property>
<property name="vhomogeneous">0</property>
<property name="transition-type">crossfade</property>
<child>
<object class="GtkStackPage">
<property name="name">page0</property>
<property name="title" translatable="yes">Ducky</property>
<property name="child">
<object class="GtkGrid">
<property name="halign">center</property>
<property name="valign">center</property>
<property name="vexpand">1</property>
<property name="row-spacing">12</property>
<property name="column-spacing">12</property>
<child>
<object class="GtkLabel">
<property name="label" translatable="yes">Duck</property>
<layout>
<property name="left-attach">0</property>
<property name="top-attach">0</property>
</layout>
</object>
</child>
<child>
<object class="GtkLabel">
<property name="label" translatable="yes">Background</property>
<layout>
<property name="left-attach">1</property>
<property name="top-attach">0</property>
</layout>
</object>
</child>
<child>
<object class="GtkImage">
<style>
<class name="duck"/>
</style>
<layout>
<property name="left-attach">0</property>
<property name="top-attach">1</property>
</layout>
</object>
</child>
<child>
<object class="GtkImage">
<style>
<class name="gradient"/>
</style>
<layout>
<property name="left-attach">1</property>
<property name="top-attach">1</property>
</layout>
</object>
</child>
<child>
<object class="GtkLabel">
<property name="label" translatable="yes">
Blended picture</property>
<layout>
<property name="left-attach">0</property>
<property name="top-attach">2</property>
<property name="column-span">2</property>
</layout>
</object>
</child>
<child>
<object class="GtkImage">
<property name="halign">center</property>
<style>
<class name="blend0"/>
</style>
<layout>
<property name="left-attach">0</property>
<property name="top-attach">3</property>
<property name="column-span">2</property>
</layout>
</object>
</child>
</object>
</property>
</object>
</child>
<child>
<object class="GtkStackPage">
<property name="name">page1</property>
<property name="title" translatable="yes">Blends</property>
<property name="child">
<object class="GtkGrid">
<property name="halign">center</property>
<property name="valign">center</property>
<property name="vexpand">1</property>
<property name="row-spacing">12</property>
<property name="column-spacing">12</property>
<child>
<object class="GtkLabel">
<property name="label" translatable="yes">Red</property>
<layout>
<property name="left-attach">0</property>
<property name="top-attach">0</property>
</layout>
</object>
</child>
<child>
<object class="GtkLabel">
<property name="label" translatable="yes">Blue</property>
<layout>
<property name="left-attach">1</property>
<property name="top-attach">0</property>
</layout>
</object>
</child>
<child>
<object class="GtkImage">
<style>
<class name="red"/>
</style>
<layout>
<property name="left-attach">0</property>
<property name="top-attach">1</property>
</layout>
</object>
</child>
<child>
<object class="GtkImage">
<style>
<class name="blue"/>
</style>
<layout>
<property name="left-attach">1</property>
<property name="top-attach">1</property>
</layout>
</object>
</child>
<child>
<object class="GtkLabel">
<property name="label" translatable="yes">
Blended picture</property>
<layout>
<property name="left-attach">0</property>
<property name="top-attach">2</property>
<property name="column-span">2</property>
</layout>
</object>
</child>
<child>
<object class="GtkImage">
<property name="halign">center</property>
<style>
<class name="blend1"/>
</style>
<layout>
<property name="left-attach">0</property>
<property name="top-attach">3</property>
<property name="column-span">2</property>
</layout>
</object>
</child>
</object>
</property>
</object>
</child>
<child>
<object class="GtkStackPage">
<property name="name">page2</property>
<property name="title" translatable="yes">CMYK</property>
<property name="child">
<object class="GtkGrid">
<property name="halign">center</property>
<property name="valign">center</property>
<property name="hexpand">1</property>
<property name="vexpand">1</property>
<property name="row-spacing">6</property>
<property name="column-spacing">12</property>
<child>
<object class="GtkImage">
<style>
<class name="cyan"/>
</style>
<layout>
<property name="left-attach">0</property>
<property name="top-attach">1</property>
</layout>
</object>
</child>
<child>
<object class="GtkImage">
<style>
<class name="magenta"/>
</style>
<layout>
<property name="left-attach">1</property>
<property name="top-attach">1</property>
</layout>
</object>
</child>
<child>
<object class="GtkImage">
<style>
<class name="yellow"/>
</style>
<layout>
<property name="left-attach">0</property>
<property name="top-attach">3</property>
</layout>
</object>
</child>
<child>
<object class="GtkImage">
<property name="halign">center</property>
<style>
<class name="blend2"/>
</style>
<layout>
<property name="left-attach">1</property>
<property name="top-attach">3</property>
</layout>
</object>
</child>
<child>
<object class="GtkLabel">
<property name="label" translatable="yes">Cyan</property>
<property name="xalign">0</property>
<style>
<class name="dim-label"/>
</style>
<layout>
<property name="left-attach">0</property>
<property name="top-attach">0</property>
</layout>
</object>
</child>
<child>
<object class="GtkLabel">
<property name="label" translatable="yes">Magenta</property>
<property name="xalign">0</property>
<style>
<class name="dim-label"/>
</style>
<layout>
<property name="left-attach">1</property>
<property name="top-attach">0</property>
</layout>
</object>
</child>
<child>
<object class="GtkLabel">
<property name="label" translatable="yes">Yellow</property>
<property name="xalign">0</property>
<style>
<class name="dim-label"/>
</style>
<layout>
<property name="left-attach">0</property>
<property name="top-attach">2</property>
</layout>
</object>
</child>
<child>
<object class="GtkLabel">
<property name="label" translatable="yes">Blended picture</property>
<property name="xalign">0</property>
<attributes>
<attribute name="weight" value="bold"></attribute>
</attributes>
<layout>
<property name="left-attach">1</property>
<property name="top-attach">2</property>
</layout>
</object>
</child>
</object>
</property>
</object>
</child>
<layout>
<property name="left-attach">1</property>
<property name="top-attach">1</property>
</layout>
</object>
</child>
</object>
</child>
<child type="titlebar"/>
</object>
</interface>

Binary file not shown.

Before

Width:  |  Height:  |  Size: 788 B

View File

@@ -1,481 +0,0 @@
/*
* bluroverlay.c
* This file is part of gtk
*
* Copyright (C) 2011 - Ignacio Casal Quinteiro, Mike Krüger
*
* 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 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.
*
* You should have received a copy of the GNU Lesser General Public
* License along with this library. If not, see <http://www.gnu.org/licenses/>.
*/
#include "bluroverlay.h"
/*
* This is a cut-down copy of gtkoverlay.c with a custom snapshot
* function that support a limited form of blur-under.
*/
typedef struct _BlurOverlayChild BlurOverlayChild;
struct _BlurOverlayChild
{
double blur;
};
enum {
GET_CHILD_POSITION,
LAST_SIGNAL
};
static guint signals[LAST_SIGNAL] = { 0 };
static GQuark child_data_quark = 0;
G_DEFINE_TYPE (BlurOverlay, blur_overlay, GTK_TYPE_BIN)
static void
blur_overlay_set_overlay_child (GtkWidget *widget,
BlurOverlayChild *child_data)
{
g_object_set_qdata_full (G_OBJECT (widget), child_data_quark, child_data, g_free);
}
static BlurOverlayChild *
blur_overlay_get_overlay_child (GtkWidget *widget)
{
return (BlurOverlayChild *) g_object_get_qdata (G_OBJECT (widget), child_data_quark);
}
static void
blur_overlay_measure (GtkWidget *widget,
GtkOrientation orientation,
int for_size,
int *minimum,
int *natural,
int *minimum_baseline,
int *natural_baseline)
{
GtkWidget *child;
for (child = gtk_widget_get_first_child (widget);
child != NULL;
child = gtk_widget_get_next_sibling (child))
{
int child_min, child_nat, child_min_baseline, child_nat_baseline;
gtk_widget_measure (child,
orientation,
for_size,
&child_min, &child_nat,
&child_min_baseline, &child_nat_baseline);
*minimum = MAX (*minimum, child_min);
*natural = MAX (*natural, child_nat);
if (child_min_baseline > -1)
*minimum_baseline = MAX (*minimum_baseline, child_min_baseline);
if (child_nat_baseline > -1)
*natural_baseline = MAX (*natural_baseline, child_nat_baseline);
}
}
static void
blur_overlay_compute_child_allocation (BlurOverlay *overlay,
GtkWidget *widget,
BlurOverlayChild *child,
GtkAllocation *widget_allocation)
{
GtkAllocation allocation;
gboolean result;
g_signal_emit (overlay, signals[GET_CHILD_POSITION],
0, widget, &allocation, &result);
widget_allocation->x = allocation.x;
widget_allocation->y = allocation.y;
widget_allocation->width = allocation.width;
widget_allocation->height = allocation.height;
}
static GtkAlign
effective_align (GtkAlign align,
GtkTextDirection direction)
{
switch (align)
{
case GTK_ALIGN_START:
return direction == GTK_TEXT_DIR_RTL ? GTK_ALIGN_END : GTK_ALIGN_START;
case GTK_ALIGN_END:
return direction == GTK_TEXT_DIR_RTL ? GTK_ALIGN_START : GTK_ALIGN_END;
case GTK_ALIGN_FILL:
case GTK_ALIGN_CENTER:
case GTK_ALIGN_BASELINE:
default:
return align;
}
}
static void
blur_overlay_child_update_style_classes (BlurOverlay *overlay,
GtkWidget *child,
GtkAllocation *child_allocation)
{
int width, height;
GtkAlign valign, halign;
gboolean is_left, is_right, is_top, is_bottom;
gboolean has_left, has_right, has_top, has_bottom;
GtkStyleContext *context;
context = gtk_widget_get_style_context (child);
has_left = gtk_style_context_has_class (context, GTK_STYLE_CLASS_LEFT);
has_right = gtk_style_context_has_class (context, GTK_STYLE_CLASS_RIGHT);
has_top = gtk_style_context_has_class (context, GTK_STYLE_CLASS_TOP);
has_bottom = gtk_style_context_has_class (context, GTK_STYLE_CLASS_BOTTOM);
is_left = is_right = is_top = is_bottom = FALSE;
width = gtk_widget_get_width (GTK_WIDGET (overlay));
height = gtk_widget_get_height (GTK_WIDGET (overlay));
halign = effective_align (gtk_widget_get_halign (child),
gtk_widget_get_direction (child));
if (halign == GTK_ALIGN_START)
is_left = (child_allocation->x == 0);
else if (halign == GTK_ALIGN_END)
is_right = (child_allocation->x + child_allocation->width == width);
valign = gtk_widget_get_valign (child);
if (valign == GTK_ALIGN_START)
is_top = (child_allocation->y == 0);
else if (valign == GTK_ALIGN_END)
is_bottom = (child_allocation->y + child_allocation->height == height);
if (has_left && !is_left)
gtk_style_context_remove_class (context, GTK_STYLE_CLASS_LEFT);
else if (!has_left && is_left)
gtk_style_context_add_class (context, GTK_STYLE_CLASS_LEFT);
if (has_right && !is_right)
gtk_style_context_remove_class (context, GTK_STYLE_CLASS_RIGHT);
else if (!has_right && is_right)
gtk_style_context_add_class (context, GTK_STYLE_CLASS_RIGHT);
if (has_top && !is_top)
gtk_style_context_remove_class (context, GTK_STYLE_CLASS_TOP);
else if (!has_top && is_top)
gtk_style_context_add_class (context, GTK_STYLE_CLASS_TOP);
if (has_bottom && !is_bottom)
gtk_style_context_remove_class (context, GTK_STYLE_CLASS_BOTTOM);
else if (!has_bottom && is_bottom)
gtk_style_context_add_class (context, GTK_STYLE_CLASS_BOTTOM);
}
static void
blur_overlay_child_allocate (BlurOverlay *overlay,
GtkWidget *widget,
BlurOverlayChild *child)
{
GtkAllocation child_allocation;
if (!gtk_widget_get_visible (widget))
return;
blur_overlay_compute_child_allocation (overlay, widget, child, &child_allocation);
blur_overlay_child_update_style_classes (overlay, widget, &child_allocation);
gtk_widget_size_allocate (widget, &child_allocation, -1);
}
static void
blur_overlay_size_allocate (GtkWidget *widget,
int width,
int height,
int baseline)
{
BlurOverlay *overlay = BLUR_OVERLAY (widget);
GtkWidget *child;
GtkWidget *main_widget;
main_widget = gtk_bin_get_child (GTK_BIN (overlay));
if (main_widget && gtk_widget_get_visible (main_widget))
gtk_widget_size_allocate (main_widget,
&(GtkAllocation) {
0, 0,
width, height
}, -1);
for (child = gtk_widget_get_first_child (widget);
child != NULL;
child = gtk_widget_get_next_sibling (child))
{
if (child != main_widget)
{
BlurOverlayChild *child_data = blur_overlay_get_overlay_child (child);
blur_overlay_child_allocate (overlay, child, child_data);
}
}
}
static gboolean
blur_overlay_get_child_position (BlurOverlay *overlay,
GtkWidget *widget,
GtkAllocation *alloc)
{
GtkRequisition min, req;
GtkAlign halign;
GtkTextDirection direction;
int width, height;
gtk_widget_get_preferred_size (widget, &min, &req);
width = gtk_widget_get_width (GTK_WIDGET (overlay));
height = gtk_widget_get_height (GTK_WIDGET (overlay));
alloc->x = 0;
alloc->width = MAX (min.width, MIN (width, req.width));
direction = gtk_widget_get_direction (widget);
halign = gtk_widget_get_halign (widget);
switch (effective_align (halign, direction))
{
case GTK_ALIGN_START:
/* nothing to do */
break;
case GTK_ALIGN_FILL:
alloc->width = MAX (alloc->width, width);
break;
case GTK_ALIGN_CENTER:
alloc->x += width / 2 - alloc->width / 2;
break;
case GTK_ALIGN_END:
alloc->x += width - alloc->width;
break;
case GTK_ALIGN_BASELINE:
default:
g_assert_not_reached ();
break;
}
alloc->y = 0;
alloc->height = MAX (min.height, MIN (height, req.height));
switch (gtk_widget_get_valign (widget))
{
case GTK_ALIGN_START:
/* nothing to do */
break;
case GTK_ALIGN_FILL:
alloc->height = MAX (alloc->height, height);
break;
case GTK_ALIGN_CENTER:
alloc->y += height / 2 - alloc->height / 2;
break;
case GTK_ALIGN_END:
alloc->y += height - alloc->height;
break;
case GTK_ALIGN_BASELINE:
default:
g_assert_not_reached ();
break;
}
return TRUE;
}
static void
blur_overlay_add (GtkContainer *container,
GtkWidget *widget)
{
BlurOverlay *overlay = BLUR_OVERLAY (container);
gtk_widget_insert_after (widget, GTK_WIDGET (container), NULL);
overlay->main_widget = widget;
}
static void
blur_overlay_remove (GtkContainer *container,
GtkWidget *widget)
{
BlurOverlay *overlay = BLUR_OVERLAY (container);
gtk_widget_unparent (widget);
if (overlay->main_widget == widget)
overlay->main_widget = NULL;
}
static void
blur_overlay_forall (GtkContainer *overlay,
GtkCallback callback,
gpointer callback_data)
{
GtkWidget *child;
child = gtk_widget_get_first_child (GTK_WIDGET (overlay));
while (child != NULL)
{
GtkWidget *next = gtk_widget_get_next_sibling (child);
(* callback) (child, callback_data);
child = next;
}
}
static void
blur_overlay_snapshot (GtkWidget *widget,
GtkSnapshot *snapshot)
{
GtkWidget *main_widget;
GskRenderNode *main_widget_node = NULL;
GtkWidget *child;
GtkAllocation main_alloc;
cairo_region_t *clip = NULL;
int i;
main_widget = BLUR_OVERLAY (widget)->main_widget;
gtk_widget_get_allocation (widget, &main_alloc);
for (child = gtk_widget_get_first_child (widget);
child != NULL;
child = gtk_widget_get_next_sibling (child))
{
BlurOverlayChild *child_info = blur_overlay_get_overlay_child (child);
double blur = 0;
if (child_info)
blur = child_info->blur;
if (blur > 0)
{
GtkAllocation alloc;
graphene_rect_t bounds;
if (main_widget_node == NULL)
{
GtkSnapshot *child_snapshot;
child_snapshot = gtk_snapshot_new ();
gtk_widget_snapshot_child (widget, main_widget, child_snapshot);
main_widget_node = gtk_snapshot_free_to_node (child_snapshot);
}
gtk_widget_get_allocation (child, &alloc);
graphene_rect_init (&bounds, alloc.x, alloc.y, alloc.width, alloc.height);
gtk_snapshot_push_blur (snapshot, blur);
gtk_snapshot_push_clip (snapshot, &bounds);
gtk_snapshot_append_node (snapshot, main_widget_node);
gtk_snapshot_pop (snapshot);
gtk_snapshot_pop (snapshot);
if (clip == NULL)
{
cairo_rectangle_int_t rect;
rect.x = rect.y = 0;
rect.width = main_alloc.width;
rect.height = main_alloc.height;
clip = cairo_region_create_rectangle (&rect);
}
cairo_region_subtract_rectangle (clip, (cairo_rectangle_int_t *)&alloc);
}
}
if (clip == NULL)
{
for (child = gtk_widget_get_first_child (widget);
child != NULL;
child = gtk_widget_get_next_sibling (child))
{
gtk_widget_snapshot_child (widget, child, snapshot);
}
return;
}
for (i = 0; i < cairo_region_num_rectangles (clip); i++)
{
cairo_rectangle_int_t rect;
graphene_rect_t bounds;
cairo_region_get_rectangle (clip, i, &rect);
graphene_rect_init (&bounds, rect.x, rect.y, rect.width, rect.height);
gtk_snapshot_push_clip (snapshot, &bounds);
gtk_snapshot_append_node (snapshot, main_widget_node);
gtk_snapshot_pop (snapshot);
}
cairo_region_destroy (clip);
for (child = gtk_widget_get_first_child (widget);
child != NULL;
child = gtk_widget_get_next_sibling (child))
{
if (child != main_widget)
gtk_widget_snapshot_child (widget, child, snapshot);
}
gsk_render_node_unref (main_widget_node);
}
static void
blur_overlay_class_init (BlurOverlayClass *klass)
{
GObjectClass *object_class = G_OBJECT_CLASS (klass);
GtkWidgetClass *widget_class = GTK_WIDGET_CLASS (klass);
GtkContainerClass *container_class = GTK_CONTAINER_CLASS (klass);
widget_class->measure = blur_overlay_measure;
widget_class->size_allocate = blur_overlay_size_allocate;
widget_class->snapshot = blur_overlay_snapshot;
container_class->add = blur_overlay_add;
container_class->remove = blur_overlay_remove;
container_class->forall = blur_overlay_forall;
klass->get_child_position = blur_overlay_get_child_position;
signals[GET_CHILD_POSITION] =
g_signal_new ("get-child-position",
G_TYPE_FROM_CLASS (object_class),
G_SIGNAL_RUN_LAST,
G_STRUCT_OFFSET (BlurOverlayClass, get_child_position),
g_signal_accumulator_true_handled, NULL,
NULL,
G_TYPE_BOOLEAN, 2,
GTK_TYPE_WIDGET,
GDK_TYPE_RECTANGLE | G_SIGNAL_TYPE_STATIC_SCOPE);
child_data_quark = g_quark_from_static_string ("gtk-overlay-child-data");
gtk_widget_class_set_css_name (widget_class, "overlay");
}
static void
blur_overlay_init (BlurOverlay *overlay)
{
}
GtkWidget *
blur_overlay_new (void)
{
return g_object_new (BLUR_TYPE_OVERLAY, NULL);
}
void
blur_overlay_add_overlay (BlurOverlay *overlay,
GtkWidget *widget,
double blur)
{
BlurOverlayChild *child = g_new0 (BlurOverlayChild, 1);
gtk_widget_insert_before (widget, GTK_WIDGET (overlay), NULL);
child->blur = blur;
blur_overlay_set_overlay_child (widget, child);
}

View File

@@ -1,65 +0,0 @@
/*
* bluroverlay.h
* This file is part of gtk
*
* Copyright (C) 2011 - Ignacio Casal Quinteiro, Mike Krüger
*
* 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 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.
*
* You should have received a copy of the GNU Lesser General Public
* License along with this library. If not, see <http://www.gnu.org/licenses/>.
*/
#ifndef __BLUR_OVERLAY_H__
#define __BLUR_OVERLAY_H__
#include <gtk/gtk.h>
G_BEGIN_DECLS
#define BLUR_TYPE_OVERLAY (blur_overlay_get_type ())
#define BLUR_OVERLAY(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), BLUR_TYPE_OVERLAY, BlurOverlay))
#define BLUR_OVERLAY_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), BLUR_TYPE_OVERLAY, BlurOverlayClass))
#define BLUR_IS_OVERLAY(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), BLUR_TYPE_OVERLAY))
#define BLUR_IS_OVERLAY_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), BLUR_TYPE_OVERLAY))
#define BLUR_OVERLAY_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), BLUR_TYPE_OVERLAY, BlurOverlayClass))
typedef struct _BlurOverlay BlurOverlay;
typedef struct _BlurOverlayClass BlurOverlayClass;
struct _BlurOverlay
{
GtkBin parent_instance;
GtkWidget *main_widget;
};
struct _BlurOverlayClass
{
GtkBinClass parent_class;
gboolean (*get_child_position) (BlurOverlay *overlay,
GtkWidget *widget,
GtkAllocation *allocation);
};
GDK_AVAILABLE_IN_ALL
GType blur_overlay_get_type (void) G_GNUC_CONST;
GDK_AVAILABLE_IN_ALL
GtkWidget *blur_overlay_new (void);
GDK_AVAILABLE_IN_ALL
void blur_overlay_add_overlay (BlurOverlay *overlay,
GtkWidget *widget,
double blur);
G_END_DECLS
#endif /* __BLUR_OVERLAY_H__ */

Binary file not shown.

Before

Width:  |  Height:  |  Size: 4.9 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 10 KiB

View File

@@ -1,98 +0,0 @@
/* Builder
*
* Demonstrates an interface loaded from a XML description.
*/
#include <gtk/gtk.h>
static void
quit_activate (GSimpleAction *action,
GVariant *parameter,
gpointer user_data)
{
GtkWidget *window = user_data;
gtk_widget_destroy (window);
}
static void
about_activate (GSimpleAction *action,
GVariant *parameter,
gpointer user_data)
{
GtkWidget *window = user_data;
GtkBuilder *builder;
GtkWidget *about_dlg;
builder = g_object_get_data (G_OBJECT (window), "builder");
about_dlg = GTK_WIDGET (gtk_builder_get_object (builder, "aboutdialog1"));
gtk_dialog_run (GTK_DIALOG (about_dlg));
gtk_widget_hide (about_dlg);
}
static void
help_activate (GSimpleAction *action,
GVariant *parameter,
gpointer user_data)
{
g_print ("Help not available\n");
}
static void
not_implemented (GSimpleAction *action,
GVariant *parameter,
gpointer user_data)
{
g_print ("Action “%s” not implemented\n", g_action_get_name (G_ACTION (action)));
}
static GActionEntry win_entries[] = {
{ "new", not_implemented, NULL, NULL, NULL },
{ "open", not_implemented, NULL, NULL, NULL },
{ "save", not_implemented, NULL, NULL, NULL },
{ "save-as", not_implemented, NULL, NULL, NULL },
{ "copy", not_implemented, NULL, NULL, NULL },
{ "cut", not_implemented, NULL, NULL, NULL },
{ "paste", not_implemented, NULL, NULL, NULL },
{ "quit", quit_activate, NULL, NULL, NULL },
{ "about", about_activate, NULL, NULL, NULL },
{ "help", help_activate, NULL, NULL, NULL }
};
GtkWidget *
do_builder (GtkWidget *do_widget)
{
static GtkWidget *window = NULL;
GtkWidget *toolbar;
GActionGroup *actions;
if (!window)
{
GtkBuilder *builder;
builder = gtk_builder_new_from_resource ("/builder/demo.ui");
window = GTK_WIDGET (gtk_builder_get_object (builder, "window1"));
gtk_window_set_display (GTK_WINDOW (window),
gtk_widget_get_display (do_widget));
g_signal_connect (window, "destroy",
G_CALLBACK (gtk_widget_destroyed), &window);
toolbar = GTK_WIDGET (gtk_builder_get_object (builder, "toolbar1"));
gtk_style_context_add_class (gtk_widget_get_style_context (toolbar),
"primary-toolbar");
actions = (GActionGroup*)g_simple_action_group_new ();
g_action_map_add_action_entries (G_ACTION_MAP (actions),
win_entries, G_N_ELEMENTS (win_entries),
window);
gtk_widget_insert_action_group (window, "win", actions);
g_object_set_data_full (G_OBJECT(window), "builder", builder, g_object_unref);
}
if (!gtk_widget_get_visible (window))
gtk_widget_show (window);
else
gtk_widget_destroy (window);
return window;
}

Binary file not shown.

Before

Width:  |  Height:  |  Size: 1.1 KiB

View File

@@ -1,402 +0,0 @@
/* Clipboard
*
* GdkClipboard is used for clipboard handling. This demo shows how to
* copy and paste text to and from the clipboard.
*
* It also shows how to transfer images via the clipboard or via
* drag-and-drop, and how to make clipboard contents persist after
* the application exits. Clipboard persistence requires a clipboard
* manager to run.
*/
#include <glib/gi18n.h>
#include <gtk/gtk.h>
#include <string.h>
static GtkWidget *window = NULL;
void
copy_button_clicked (GtkWidget *button,
gpointer user_data)
{
GtkWidget *entry;
GdkClipboard *clipboard;
entry = GTK_WIDGET (user_data);
/* Get the clipboard object */
clipboard = gtk_widget_get_clipboard (entry);
/* Set clipboard text */
gdk_clipboard_set_text (clipboard, gtk_editable_get_text (GTK_EDITABLE (entry)));
}
void
paste_received (GObject *source_object,
GAsyncResult *result,
gpointer user_data)
{
GdkClipboard *clipboard;
GtkWidget *entry;
char *text;
GError *error = NULL;
clipboard = GDK_CLIPBOARD (source_object);
entry = GTK_WIDGET (user_data);
/* Get the resulting text of the read operation */
text = gdk_clipboard_read_text_finish (clipboard, result, &error);
if (text)
{
/* Set the entry text */
gtk_editable_set_text (GTK_EDITABLE (entry), text);
g_free (text);
}
else
{
GtkWidget *dialog;
/* Show an error about why pasting failed.
* Usually you probably want to ignore such failures,
* but for demonstration purposes, we show the error.
*/
dialog = gtk_message_dialog_new (GTK_WINDOW (window),
GTK_DIALOG_DESTROY_WITH_PARENT | GTK_DIALOG_MODAL,
GTK_MESSAGE_ERROR,
GTK_BUTTONS_CLOSE,
"Could not paste text: %s",
error->message);
g_signal_connect (dialog, "response",
G_CALLBACK (gtk_widget_destroy), NULL);
gtk_widget_show (dialog);
g_error_free (error);
}
}
void
paste_button_clicked (GtkWidget *button,
gpointer user_data)
{
GtkWidget *entry;
GdkClipboard *clipboard;
entry = GTK_WIDGET (user_data);
/* Get the clipboard object */
clipboard = gtk_widget_get_clipboard (entry);
/* Request the contents of the clipboard, contents_received will be
called when we do get the contents.
*/
gdk_clipboard_read_text_async (clipboard, NULL, paste_received, entry);
}
static GdkPaintable *
get_image_paintable (GtkImage *image)
{
const gchar *icon_name;
GtkIconTheme *icon_theme;
GtkIconInfo *icon_info;
switch (gtk_image_get_storage_type (image))
{
case GTK_IMAGE_PAINTABLE:
return g_object_ref (gtk_image_get_paintable (image));
case GTK_IMAGE_ICON_NAME:
icon_name = gtk_image_get_icon_name (image);
icon_theme = gtk_icon_theme_get_for_display (gtk_widget_get_display (GTK_WIDGET (image)));
icon_info = gtk_icon_theme_lookup_icon (icon_theme, icon_name, 48, GTK_ICON_LOOKUP_GENERIC_FALLBACK);
if (icon_info == NULL)
return NULL;
return gtk_icon_info_load_icon (icon_info, NULL);
default:
g_warning ("Image storage type %d not handled",
gtk_image_get_storage_type (image));
return NULL;
}
}
static void
drag_begin (GtkDragSource *source,
GdkDrag *drag,
GtkWidget *widget)
{
GdkPaintable *paintable;
paintable = get_image_paintable (GTK_IMAGE (widget));
if (paintable)
{
gtk_drag_source_set_icon (source, paintable, -2, -2);
g_object_unref (paintable);
}
}
static void
get_texture (GValue *value,
gpointer data)
{
GdkPaintable *paintable = get_image_paintable (GTK_IMAGE (data));
if (GDK_IS_TEXTURE (paintable))
g_value_set_object (value, paintable);
}
static GdkContentProvider *
prepare_drag (GtkDragSource *source,
double x,
double y,
GtkWidget *image)
{
return gdk_content_provider_new_with_callback (GDK_TYPE_TEXTURE, get_texture, image);
}
static void
got_texture (GObject *source,
GAsyncResult *result,
gpointer data)
{
GdkDrop *drop = GDK_DROP (source);
GtkWidget *image = data;
const GValue *value;
GError *error = NULL;
value = gdk_drop_read_value_finish (drop, result, &error);
if (value)
{
GdkTexture *texture = g_value_get_object (value);
gtk_image_set_from_paintable (GTK_IMAGE (image), GDK_PAINTABLE (texture));
}
else
{
g_print ("Failed to get data: %s\n", error->message);
g_error_free (error);
}
}
static gboolean
drag_drop (GtkDropTarget *dest,
GdkDrop *drop,
int x,
int y,
GtkWidget *widget)
{
if (gdk_drop_has_value (drop, GDK_TYPE_TEXTURE))
{
gdk_drop_read_value_async (drop, GDK_TYPE_TEXTURE, G_PRIORITY_DEFAULT, NULL, got_texture, widget);
return TRUE;
}
return FALSE;
}
static void
copy_image (GSimpleAction *action,
GVariant *value,
gpointer data)
{
GdkClipboard *clipboard = gtk_widget_get_clipboard (GTK_WIDGET (data));
GdkPaintable *paintable = get_image_paintable (GTK_IMAGE (data));
if (GDK_IS_TEXTURE (paintable))
gdk_clipboard_set_texture (clipboard, GDK_TEXTURE (paintable));
if (paintable)
g_object_unref (paintable);
}
static void
paste_image_received (GObject *source,
GAsyncResult *result,
gpointer data)
{
GdkTexture *texture;
texture = gdk_clipboard_read_texture_finish (GDK_CLIPBOARD (source), result, NULL);
if (texture == NULL)
return;
gtk_image_set_from_paintable (GTK_IMAGE (data), GDK_PAINTABLE (texture));
g_object_unref (texture);
}
static void
paste_image (GSimpleAction *action,
GVariant *value,
gpointer data)
{
GdkClipboard *clipboard = gtk_widget_get_clipboard (GTK_WIDGET (data));
gdk_clipboard_read_texture_async (clipboard, NULL, paste_image_received, data);
}
static void
pressed_cb (GtkGesture *gesture,
int n_press,
double x,
double y,
GtkWidget *image)
{
GtkWidget *popover;
GMenu *menu;
GMenuItem *item;
menu = g_menu_new ();
item = g_menu_item_new (_("_Copy"), "clipboard.copy");
g_menu_append_item (menu, item);
item = g_menu_item_new (_("_Paste"), "clipboard.paste");
g_menu_append_item (menu, item);
popover = gtk_popover_menu_new_from_model (image, G_MENU_MODEL (menu));
gtk_popover_set_pointing_to (GTK_POPOVER (popover), &(GdkRectangle) { x, y, 1, 1});
gtk_popover_popup (GTK_POPOVER (popover));
g_object_unref (menu);
}
GtkWidget *
do_clipboard (GtkWidget *do_widget)
{
if (!window)
{
GtkWidget *vbox, *hbox;
GtkWidget *label;
GtkWidget *entry, *button;
GtkWidget *image;
GtkGesture *gesture;
GActionEntry entries[] = {
{ "copy", copy_image, NULL, NULL, NULL },
{ "paste", paste_image, NULL, NULL, NULL },
};
GActionGroup *actions;
GtkDragSource *source;
GtkDropTarget *dest;
GdkContentFormats *formats;
window = gtk_window_new (GTK_WINDOW_TOPLEVEL);
gtk_window_set_display (GTK_WINDOW (window),
gtk_widget_get_display (do_widget));
gtk_window_set_title (GTK_WINDOW (window), "Clipboard");
g_signal_connect (window, "destroy",
G_CALLBACK (gtk_widget_destroyed), &window);
vbox = gtk_box_new (GTK_ORIENTATION_VERTICAL, 0);
g_object_set (vbox, "margin", 8, NULL);
gtk_container_add (GTK_CONTAINER (window), vbox);
label = gtk_label_new ("\"Copy\" will copy the text\nin the entry to the clipboard");
gtk_container_add (GTK_CONTAINER (vbox), label);
hbox = gtk_box_new (GTK_ORIENTATION_HORIZONTAL, 4);
g_object_set (hbox, "margin", 8, NULL);
gtk_container_add (GTK_CONTAINER (vbox), hbox);
/* Create the first entry */
entry = gtk_entry_new ();
gtk_container_add (GTK_CONTAINER (hbox), entry);
/* Create the button */
button = gtk_button_new_with_mnemonic (_("_Copy"));
gtk_container_add (GTK_CONTAINER (hbox), button);
g_signal_connect (button, "clicked",
G_CALLBACK (copy_button_clicked), entry);
label = gtk_label_new ("\"Paste\" will paste the text from the clipboard to the entry");
gtk_container_add (GTK_CONTAINER (vbox), label);
hbox = gtk_box_new (GTK_ORIENTATION_HORIZONTAL, 4);
g_object_set (hbox, "margin", 8, NULL);
gtk_container_add (GTK_CONTAINER (vbox), hbox);
/* Create the second entry */
entry = gtk_entry_new ();
gtk_container_add (GTK_CONTAINER (hbox), entry);
/* Create the button */
button = gtk_button_new_with_mnemonic (_("_Paste"));
gtk_container_add (GTK_CONTAINER (hbox), button);
g_signal_connect (button, "clicked",
G_CALLBACK (paste_button_clicked), entry);
label = gtk_label_new ("Images can be transferred via the clipboard, too");
gtk_container_add (GTK_CONTAINER (vbox), label);
hbox = gtk_box_new (GTK_ORIENTATION_HORIZONTAL, 4);
g_object_set (hbox, "margin", 8, NULL);
gtk_container_add (GTK_CONTAINER (vbox), hbox);
/* Create the first image */
image = gtk_image_new_from_icon_name ("dialog-warning");
gtk_image_set_pixel_size (GTK_IMAGE (image), 48);
gtk_container_add (GTK_CONTAINER (hbox), image);
/* make image a drag source */
source = gtk_drag_source_new ();
g_signal_connect (source, "prepare", G_CALLBACK (prepare_drag), NULL);
g_signal_connect (source, "drag-begin", G_CALLBACK (drag_begin), image);
gtk_widget_add_controller (image, GTK_EVENT_CONTROLLER (source));
/* accept drops on image */
formats = gdk_content_formats_new_for_gtype (GDK_TYPE_TEXTURE);
dest = gtk_drop_target_new (formats, GDK_ACTION_COPY);
gdk_content_formats_unref (formats);
g_signal_connect (dest, "drag-drop", G_CALLBACK (drag_drop), image);
gtk_widget_add_controller (image, GTK_EVENT_CONTROLLER (dest));
/* context menu on image */
gesture = gtk_gesture_click_new ();
gtk_gesture_single_set_button (GTK_GESTURE_SINGLE (gesture), GDK_BUTTON_SECONDARY);
g_signal_connect (gesture, "pressed", G_CALLBACK (pressed_cb), image);
gtk_widget_add_controller (image, GTK_EVENT_CONTROLLER (gesture));
actions = G_ACTION_GROUP (g_simple_action_group_new ());
g_action_map_add_action_entries (G_ACTION_MAP (actions), entries, G_N_ELEMENTS (entries), image);
gtk_widget_insert_action_group (image, "clipboard", actions);
g_object_unref (actions);
/* Create the second image */
image = gtk_image_new_from_icon_name ("process-stop");
gtk_image_set_pixel_size (GTK_IMAGE (image), 48);
gtk_container_add (GTK_CONTAINER (hbox), image);
/* make image a drag source */
source = gtk_drag_source_new ();
g_signal_connect (source, "prepare", G_CALLBACK (prepare_drag), NULL);
g_signal_connect (source, "drag-begin", G_CALLBACK (drag_begin), image);
gtk_widget_add_controller (image, GTK_EVENT_CONTROLLER (source));
/* accept drops on image */
formats = gdk_content_formats_new_for_gtype (GDK_TYPE_TEXTURE);
dest = gtk_drop_target_new (formats, GDK_ACTION_COPY);
gdk_content_formats_unref (formats);
g_signal_connect (dest, "drag-drop", G_CALLBACK (drag_drop), image);
gtk_widget_add_controller (image, GTK_EVENT_CONTROLLER (dest));
/* context menu on image */
gesture = gtk_gesture_click_new ();
gtk_gesture_single_set_button (GTK_GESTURE_SINGLE (gesture), GDK_BUTTON_SECONDARY);
g_signal_connect (gesture, "pressed", G_CALLBACK (pressed_cb), image);
gtk_widget_add_controller (image, GTK_EVENT_CONTROLLER (gesture));
actions = G_ACTION_GROUP (g_simple_action_group_new ());
g_action_map_add_action_entries (G_ACTION_MAP (actions), entries, G_N_ELEMENTS (entries), image);
gtk_widget_insert_action_group (image, "clipboard", actions);
g_object_unref (actions);
}
if (!gtk_widget_get_visible (window))
gtk_widget_show (window);
else
gtk_widget_destroy (window);
return window;
}

Binary file not shown.

Before

Width:  |  Height:  |  Size: 54 KiB

Some files were not shown because too many files have changed in this diff Show More