1998-09-27 18:32:00 +00:00
|
|
|
|
/* GTK - The GIMP Toolkit
|
|
|
|
|
* Copyright (C) 1995-1997 Peter Mattis, Spencer Kimball and Josh MacDonald
|
|
|
|
|
*
|
|
|
|
|
* GTK Calendar Widget
|
2004-11-12 17:52:08 +00:00
|
|
|
|
* Copyright (C) 1998 Cesar Miquel, Shawn T. Amundson and Mattias Groenlund
|
1998-09-27 18:32:00 +00:00
|
|
|
|
*
|
|
|
|
|
* lib_date routines
|
|
|
|
|
* Copyright (c) 1995, 1996, 1997, 1998 by Steffen Beyer
|
|
|
|
|
*
|
|
|
|
|
* This library is free software; you can redistribute it and/or
|
2000-07-26 11:33:08 +00:00
|
|
|
|
* modify it under the terms of the GNU Lesser General Public
|
1998-09-27 18:32:00 +00:00
|
|
|
|
* 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
|
1998-10-01 13:24:42 +00:00
|
|
|
|
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
|
2000-07-26 11:33:08 +00:00
|
|
|
|
* Lesser General Public License for more details.
|
1998-09-27 18:32:00 +00:00
|
|
|
|
*
|
2000-07-26 11:33:08 +00:00
|
|
|
|
* You should have received a copy of the GNU Lesser General Public
|
1998-09-27 18:32:00 +00:00
|
|
|
|
* License along with this library; if not, write to the Free
|
|
|
|
|
* Software Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
|
|
|
|
|
*/
|
|
|
|
|
|
1999-02-24 07:37:18 +00:00
|
|
|
|
/*
|
2000-03-14 19:57:25 +00:00
|
|
|
|
* Modified by the GTK+ Team and others 1997-2000. See the AUTHORS
|
1999-02-24 07:37:18 +00:00
|
|
|
|
* file for a list of people on the GTK+ Team. See the ChangeLog
|
|
|
|
|
* files for a list of changes. These files are distributed with
|
|
|
|
|
* GTK+ at ftp://ftp.gtk.org/pub/gtk/.
|
|
|
|
|
*/
|
|
|
|
|
|
2004-03-06 03:38:59 +00:00
|
|
|
|
#include <config.h>
|
This might seem like a large patch, but it isn't that bad, and nothing
should break on Unix/X11.
Win32 merge and general portability stuff:
* acconfig.h,configure.in: Check for <sys/time.h>.
* gdk/win32: New directory (actually, been there for a while).
* gtk/fnmatch.c: Include <glib.h> for G_DIR_SEPARATOR, WIN32 and
NATIVE_WIN32, and use these. Always case fold on Win32. No
backslashed escapes on native Win32.
* gtk/{gtk.def,makefile.msc}: New files.
* gtk/Makefile.am: Add above new files.
* gtk/{gtkaccelgroup,gtkbindings}.c: Include <string.h>
instead of <strings.h>.
* gtk/{gtkcalendar,gtkitemfactory,gtkpreview,gtkrc}.c: Include
config.h. Protect inclusion of <sys/param.h>, <sys/time.h>, and
<unistd.h> appropriately.
* gtk/gtkdnd.c: Merge in Win32 version (which doesn't do much).
Use ABS() (from <glib.h>) instead of abs().
* gtk/gtkfilesel.c: Moved Win32-specific includes after inclusion
of gtk (and thus glib) headers, so that WIN32 will be
defined. With MS C, include <direct.h> for mkdir prototype.
* gtk/gtkitemfactory.c (gtk_item_factory_callback_marshal): Add
some casts, needed by MS C.
* gtk/{gtklayout,gtkplug}.c: Merge in Win32 version (which isn't
implemented).
* gtk/gtkmain.c: Include gdk/gdkx.h for GDK_WINDOWING. Include
<X11/Xlocale.h> only on X11 platform, otherwise <locale.h>. Use
G_SEARCHPATH_SEPARATOR_S and g_module_build_path.
* gtk/gtkmain.h: Mark variables for export/import on Win32.
* gtk/gtkrange.c (gtk_range_motion_notify): Set mods also in case
the event is not a hint, or its window is not the slider. Needed
on Win32, at least.
* gtk/gtkrc.c: Include config.h and gdk/gdkx.h. Use <locale.h>
unless on X11. Skip \r chars, too. Use G_DIR_SEPARATOR and
G_SEARCHPATH_SEPARATOR(_S). Use g_path_is_absolute. On Win32, use
a subdirectory of the Windows directory as gtk system
configuration directory.
* gtk/gtkselection.c: No chunks on Win32.
* gtk/gtksocket.c: Not implemented on Win32.
* gtk/gtkthemes.c (gtk_theme_engine_get): Use g_module_build_path.
* gtk/makeenums.h: Include gdkprivate.h after gdk.h.
* gtk/testrgb.c: Use dynamically allocated buffer. Use GTimers.
1999-03-15 00:03:37 +00:00
|
|
|
|
|
|
|
|
|
#ifdef HAVE_SYS_TIME_H
|
1998-09-27 18:32:00 +00:00
|
|
|
|
#include <sys/time.h>
|
This might seem like a large patch, but it isn't that bad, and nothing
should break on Unix/X11.
Win32 merge and general portability stuff:
* acconfig.h,configure.in: Check for <sys/time.h>.
* gdk/win32: New directory (actually, been there for a while).
* gtk/fnmatch.c: Include <glib.h> for G_DIR_SEPARATOR, WIN32 and
NATIVE_WIN32, and use these. Always case fold on Win32. No
backslashed escapes on native Win32.
* gtk/{gtk.def,makefile.msc}: New files.
* gtk/Makefile.am: Add above new files.
* gtk/{gtkaccelgroup,gtkbindings}.c: Include <string.h>
instead of <strings.h>.
* gtk/{gtkcalendar,gtkitemfactory,gtkpreview,gtkrc}.c: Include
config.h. Protect inclusion of <sys/param.h>, <sys/time.h>, and
<unistd.h> appropriately.
* gtk/gtkdnd.c: Merge in Win32 version (which doesn't do much).
Use ABS() (from <glib.h>) instead of abs().
* gtk/gtkfilesel.c: Moved Win32-specific includes after inclusion
of gtk (and thus glib) headers, so that WIN32 will be
defined. With MS C, include <direct.h> for mkdir prototype.
* gtk/gtkitemfactory.c (gtk_item_factory_callback_marshal): Add
some casts, needed by MS C.
* gtk/{gtklayout,gtkplug}.c: Merge in Win32 version (which isn't
implemented).
* gtk/gtkmain.c: Include gdk/gdkx.h for GDK_WINDOWING. Include
<X11/Xlocale.h> only on X11 platform, otherwise <locale.h>. Use
G_SEARCHPATH_SEPARATOR_S and g_module_build_path.
* gtk/gtkmain.h: Mark variables for export/import on Win32.
* gtk/gtkrange.c (gtk_range_motion_notify): Set mods also in case
the event is not a hint, or its window is not the slider. Needed
on Win32, at least.
* gtk/gtkrc.c: Include config.h and gdk/gdkx.h. Use <locale.h>
unless on X11. Skip \r chars, too. Use G_DIR_SEPARATOR and
G_SEARCHPATH_SEPARATOR(_S). Use g_path_is_absolute. On Win32, use
a subdirectory of the Windows directory as gtk system
configuration directory.
* gtk/gtkselection.c: No chunks on Win32.
* gtk/gtksocket.c: Not implemented on Win32.
* gtk/gtkthemes.c (gtk_theme_engine_get): Use g_module_build_path.
* gtk/makeenums.h: Include gdkprivate.h after gdk.h.
* gtk/testrgb.c: Use dynamically allocated buffer. Use GTimers.
1999-03-15 00:03:37 +00:00
|
|
|
|
#endif
|
2005-01-14 13:43:54 +00:00
|
|
|
|
#ifdef HAVE__NL_TIME_FIRST_WEEKDAY
|
2005-01-13 19:37:54 +00:00
|
|
|
|
#include <langinfo.h>
|
|
|
|
|
#endif
|
1998-09-27 18:32:00 +00:00
|
|
|
|
#include <string.h>
|
|
|
|
|
#include <stdlib.h>
|
|
|
|
|
#include <time.h>
|
2005-11-28 01:51:08 +00:00
|
|
|
|
|
|
|
|
|
#include <glib.h>
|
|
|
|
|
|
|
|
|
|
#ifdef G_OS_WIN32
|
|
|
|
|
#include <windows.h>
|
|
|
|
|
#endif
|
|
|
|
|
|
2005-05-11 19:16:19 +00:00
|
|
|
|
#undef GTK_DISABLE_DEPRECATED
|
1998-09-27 18:32:00 +00:00
|
|
|
|
#include "gtkcalendar.h"
|
2005-05-11 19:16:19 +00:00
|
|
|
|
|
2003-08-08 23:01:17 +00:00
|
|
|
|
#include "gtkdnd.h"
|
2003-05-08 00:25:51 +00:00
|
|
|
|
#include "gtkintl.h"
|
2003-05-20 22:37:57 +00:00
|
|
|
|
#include "gtkmain.h"
|
|
|
|
|
#include "gtkmarshalers.h"
|
2007-12-28 09:36:06 +00:00
|
|
|
|
#include "gtktooltip.h"
|
2005-03-22 02:14:55 +00:00
|
|
|
|
#include "gtkprivate.h"
|
1998-09-27 18:32:00 +00:00
|
|
|
|
#include "gdk/gdkkeysyms.h"
|
2005-03-20 07:01:23 +00:00
|
|
|
|
#include "gtkalias.h"
|
1998-09-27 18:32:00 +00:00
|
|
|
|
|
|
|
|
|
/***************************************************************************/
|
2005-12-06 17:07:55 +00:00
|
|
|
|
/* The following date routines are taken from the lib_date package.
|
|
|
|
|
* They have been minimally edited to avoid conflict with types defined
|
|
|
|
|
* in win32 headers.
|
|
|
|
|
*/
|
1998-09-27 18:32:00 +00:00
|
|
|
|
|
2005-12-06 17:07:55 +00:00
|
|
|
|
static const guint month_length[2][13] =
|
1998-09-27 18:32:00 +00:00
|
|
|
|
{
|
1998-10-01 13:24:42 +00:00
|
|
|
|
{ 0, 31, 28, 31, 30, 31, 30, 31, 31, 30, 31, 30, 31 },
|
|
|
|
|
{ 0, 31, 29, 31, 30, 31, 30, 31, 31, 30, 31, 30, 31 }
|
1998-09-27 18:32:00 +00:00
|
|
|
|
};
|
|
|
|
|
|
2005-12-06 17:07:55 +00:00
|
|
|
|
static const guint days_in_months[2][14] =
|
1998-09-27 18:32:00 +00:00
|
|
|
|
{
|
1998-10-01 13:24:42 +00:00
|
|
|
|
{ 0, 0, 31, 59, 90, 120, 151, 181, 212, 243, 273, 304, 334, 365 },
|
|
|
|
|
{ 0, 0, 31, 60, 91, 121, 152, 182, 213, 244, 274, 305, 335, 366 }
|
1998-09-27 18:32:00 +00:00
|
|
|
|
};
|
|
|
|
|
|
2005-12-06 17:07:55 +00:00
|
|
|
|
static glong calc_days(guint year, guint mm, guint dd);
|
|
|
|
|
static guint day_of_week(guint year, guint mm, guint dd);
|
|
|
|
|
static glong dates_difference(guint year1, guint mm1, guint dd1,
|
|
|
|
|
guint year2, guint mm2, guint dd2);
|
|
|
|
|
static guint weeks_in_year(guint year);
|
1998-09-27 18:32:00 +00:00
|
|
|
|
|
2005-12-06 17:07:55 +00:00
|
|
|
|
static gboolean
|
|
|
|
|
leap (guint year)
|
1998-09-27 18:32:00 +00:00
|
|
|
|
{
|
2005-12-06 17:07:55 +00:00
|
|
|
|
return((((year % 4) == 0) && ((year % 100) != 0)) || ((year % 400) == 0));
|
1998-09-27 18:32:00 +00:00
|
|
|
|
}
|
|
|
|
|
|
2005-12-06 17:07:55 +00:00
|
|
|
|
static guint
|
|
|
|
|
day_of_week (guint year, guint mm, guint dd)
|
1998-09-27 18:32:00 +00:00
|
|
|
|
{
|
2005-12-06 17:07:55 +00:00
|
|
|
|
glong days;
|
1998-10-01 13:24:42 +00:00
|
|
|
|
|
|
|
|
|
days = calc_days(year, mm, dd);
|
|
|
|
|
if (days > 0L)
|
1998-09-27 18:32:00 +00:00
|
|
|
|
{
|
1998-10-01 13:24:42 +00:00
|
|
|
|
days--;
|
|
|
|
|
days %= 7L;
|
|
|
|
|
days++;
|
1998-09-27 18:32:00 +00:00
|
|
|
|
}
|
2005-12-06 17:07:55 +00:00
|
|
|
|
return( (guint) days );
|
1998-09-27 18:32:00 +00:00
|
|
|
|
}
|
|
|
|
|
|
2005-12-06 17:07:55 +00:00
|
|
|
|
static guint weeks_in_year(guint year)
|
1998-09-27 18:32:00 +00:00
|
|
|
|
{
|
2005-12-06 17:07:55 +00:00
|
|
|
|
return(52 + ((day_of_week(year,1,1)==4) || (day_of_week(year,12,31)==4)));
|
1998-09-27 18:32:00 +00:00
|
|
|
|
}
|
|
|
|
|
|
2005-12-06 17:07:55 +00:00
|
|
|
|
static gboolean
|
|
|
|
|
check_date(guint year, guint mm, guint dd)
|
1998-09-27 18:32:00 +00:00
|
|
|
|
{
|
2005-12-06 17:07:55 +00:00
|
|
|
|
if (year < 1) return FALSE;
|
|
|
|
|
if ((mm < 1) || (mm > 12)) return FALSE;
|
|
|
|
|
if ((dd < 1) || (dd > month_length[leap(year)][mm])) return FALSE;
|
|
|
|
|
return TRUE;
|
1998-09-27 18:32:00 +00:00
|
|
|
|
}
|
|
|
|
|
|
2005-12-06 17:07:55 +00:00
|
|
|
|
static guint
|
|
|
|
|
week_number(guint year, guint mm, guint dd)
|
1998-09-27 18:32:00 +00:00
|
|
|
|
{
|
2005-12-06 17:07:55 +00:00
|
|
|
|
guint first;
|
1998-10-01 13:24:42 +00:00
|
|
|
|
|
|
|
|
|
first = day_of_week(year,1,1) - 1;
|
2005-12-06 17:07:55 +00:00
|
|
|
|
return( (guint) ( (dates_difference(year,1,1, year,mm,dd) + first) / 7L ) +
|
1998-10-01 13:24:42 +00:00
|
|
|
|
(first < 4) );
|
1998-09-27 18:32:00 +00:00
|
|
|
|
}
|
|
|
|
|
|
2005-12-06 17:07:55 +00:00
|
|
|
|
static glong
|
|
|
|
|
year_to_days(guint year)
|
1998-09-27 18:32:00 +00:00
|
|
|
|
{
|
1998-10-01 13:24:42 +00:00
|
|
|
|
return( year * 365L + (year / 4) - (year / 100) + (year / 400) );
|
1998-09-27 18:32:00 +00:00
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
2005-12-06 17:07:55 +00:00
|
|
|
|
static glong
|
|
|
|
|
calc_days(guint year, guint mm, guint dd)
|
1998-09-27 18:32:00 +00:00
|
|
|
|
{
|
2005-12-06 17:07:55 +00:00
|
|
|
|
gboolean lp;
|
1998-10-01 13:24:42 +00:00
|
|
|
|
|
|
|
|
|
if (year < 1) return(0L);
|
2005-12-06 17:07:55 +00:00
|
|
|
|
if ((mm < 1) || (mm > 12)) return(0L);
|
|
|
|
|
if ((dd < 1) || (dd > month_length[(lp = leap(year))][mm])) return(0L);
|
1998-10-01 13:24:42 +00:00
|
|
|
|
return( year_to_days(--year) + days_in_months[lp][mm] + dd );
|
1998-09-27 18:32:00 +00:00
|
|
|
|
}
|
|
|
|
|
|
2005-12-06 17:07:55 +00:00
|
|
|
|
static gboolean
|
|
|
|
|
week_of_year(guint *week, guint *year, guint mm, guint dd)
|
1998-09-27 18:32:00 +00:00
|
|
|
|
{
|
1998-10-01 13:24:42 +00:00
|
|
|
|
if (check_date(*year,mm,dd))
|
|
|
|
|
{
|
|
|
|
|
*week = week_number(*year,mm,dd);
|
|
|
|
|
if (*week == 0)
|
|
|
|
|
*week = weeks_in_year(--(*year));
|
|
|
|
|
else if (*week > weeks_in_year(*year))
|
|
|
|
|
{
|
|
|
|
|
*week = 1;
|
|
|
|
|
(*year)++;
|
|
|
|
|
}
|
2005-12-06 17:07:55 +00:00
|
|
|
|
return TRUE;
|
1998-10-01 13:24:42 +00:00
|
|
|
|
}
|
2005-12-06 17:07:55 +00:00
|
|
|
|
return FALSE;
|
1998-09-27 18:32:00 +00:00
|
|
|
|
}
|
|
|
|
|
|
2005-12-06 17:07:55 +00:00
|
|
|
|
static glong
|
|
|
|
|
dates_difference(guint year1, guint mm1, guint dd1,
|
|
|
|
|
guint year2, guint mm2, guint dd2)
|
1998-09-27 18:32:00 +00:00
|
|
|
|
{
|
1998-10-01 13:24:42 +00:00
|
|
|
|
return( calc_days(year2, mm2, dd2) - calc_days(year1, mm1, dd1) );
|
1998-09-27 18:32:00 +00:00
|
|
|
|
}
|
|
|
|
|
|
2000-09-07 18:07:59 +00:00
|
|
|
|
/*** END OF lib_date routines ********************************************/
|
1998-09-27 18:32:00 +00:00
|
|
|
|
|
2002-02-14 05:05:45 +00:00
|
|
|
|
/* Spacing around day/week headers and main area, inside those windows */
|
1998-10-01 13:24:42 +00:00
|
|
|
|
#define CALENDAR_MARGIN 0
|
2002-02-14 05:05:45 +00:00
|
|
|
|
/* Spacing around day/week headers and main area, outside those windows */
|
|
|
|
|
#define INNER_BORDER 4
|
|
|
|
|
/* Separation between day headers and main area */
|
1998-10-01 13:24:42 +00:00
|
|
|
|
#define CALENDAR_YSEP 4
|
2002-02-14 05:05:45 +00:00
|
|
|
|
/* Separation between week headers and main area */
|
1998-10-01 13:24:42 +00:00
|
|
|
|
#define CALENDAR_XSEP 4
|
1998-09-27 18:32:00 +00:00
|
|
|
|
|
1998-10-01 13:24:42 +00:00
|
|
|
|
#define DAY_XSEP 0 /* not really good for small calendar */
|
1998-09-27 18:32:00 +00:00
|
|
|
|
#define DAY_YSEP 0 /* not really good for small calendar */
|
|
|
|
|
|
2006-07-17 12:55:12 +00:00
|
|
|
|
#define SCROLL_DELAY_FACTOR 5
|
|
|
|
|
|
1998-09-27 18:32:00 +00:00
|
|
|
|
/* Color usage */
|
1998-10-01 13:24:42 +00:00
|
|
|
|
#define HEADER_FG_COLOR(widget) (& (widget)->style->fg[GTK_WIDGET_STATE (widget)])
|
|
|
|
|
#define HEADER_BG_COLOR(widget) (& (widget)->style->bg[GTK_WIDGET_STATE (widget)])
|
2002-03-21 00:50:15 +00:00
|
|
|
|
#define SELECTED_BG_COLOR(widget) (& (widget)->style->base[GTK_WIDGET_HAS_FOCUS (widget) ? GTK_STATE_SELECTED : GTK_STATE_ACTIVE])
|
|
|
|
|
#define SELECTED_FG_COLOR(widget) (& (widget)->style->text[GTK_WIDGET_HAS_FOCUS (widget) ? GTK_STATE_SELECTED : GTK_STATE_ACTIVE])
|
2007-11-26 17:42:35 +00:00
|
|
|
|
#define NORMAL_DAY_COLOR(widget) (& (widget)->style->text[GTK_WIDGET_STATE (widget)])
|
1998-10-01 13:24:42 +00:00
|
|
|
|
#define PREV_MONTH_COLOR(widget) (& (widget)->style->mid[GTK_WIDGET_STATE (widget)])
|
|
|
|
|
#define NEXT_MONTH_COLOR(widget) (& (widget)->style->mid[GTK_WIDGET_STATE (widget)])
|
2007-11-26 17:42:35 +00:00
|
|
|
|
#define MARKED_COLOR(widget) (& (widget)->style->text[GTK_WIDGET_STATE (widget)])
|
1998-10-01 13:24:42 +00:00
|
|
|
|
#define BACKGROUND_COLOR(widget) (& (widget)->style->base[GTK_WIDGET_STATE (widget)])
|
|
|
|
|
#define HIGHLIGHT_BACK_COLOR(widget) (& (widget)->style->mid[GTK_WIDGET_STATE (widget)])
|
1998-09-27 18:32:00 +00:00
|
|
|
|
|
|
|
|
|
enum {
|
|
|
|
|
ARROW_YEAR_LEFT,
|
|
|
|
|
ARROW_YEAR_RIGHT,
|
|
|
|
|
ARROW_MONTH_LEFT,
|
|
|
|
|
ARROW_MONTH_RIGHT
|
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
enum {
|
|
|
|
|
MONTH_PREV,
|
|
|
|
|
MONTH_CURRENT,
|
|
|
|
|
MONTH_NEXT
|
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
enum {
|
|
|
|
|
MONTH_CHANGED_SIGNAL,
|
|
|
|
|
DAY_SELECTED_SIGNAL,
|
|
|
|
|
DAY_SELECTED_DOUBLE_CLICK_SIGNAL,
|
|
|
|
|
PREV_MONTH_SIGNAL,
|
|
|
|
|
NEXT_MONTH_SIGNAL,
|
|
|
|
|
PREV_YEAR_SIGNAL,
|
|
|
|
|
NEXT_YEAR_SIGNAL,
|
|
|
|
|
LAST_SIGNAL
|
|
|
|
|
};
|
|
|
|
|
|
2003-05-08 00:25:51 +00:00
|
|
|
|
enum
|
|
|
|
|
{
|
|
|
|
|
PROP_0,
|
|
|
|
|
PROP_YEAR,
|
|
|
|
|
PROP_MONTH,
|
|
|
|
|
PROP_DAY,
|
|
|
|
|
PROP_SHOW_HEADING,
|
|
|
|
|
PROP_SHOW_DAY_NAMES,
|
|
|
|
|
PROP_NO_MONTH_CHANGE,
|
|
|
|
|
PROP_SHOW_WEEK_NUMBERS,
|
2007-12-28 09:39:34 +00:00
|
|
|
|
PROP_SHOW_DETAILS,
|
2007-12-27 20:41:08 +00:00
|
|
|
|
PROP_DETAIL_WIDTH_CHARS,
|
|
|
|
|
PROP_DETAIL_HEIGHT_ROWS,
|
2003-05-08 00:25:51 +00:00
|
|
|
|
PROP_LAST
|
|
|
|
|
};
|
|
|
|
|
|
2005-05-11 19:16:19 +00:00
|
|
|
|
static guint gtk_calendar_signals[LAST_SIGNAL] = { 0 };
|
1998-10-04 23:07:04 +00:00
|
|
|
|
|
2005-05-11 19:16:19 +00:00
|
|
|
|
struct _GtkCalendarPrivate
|
1998-10-04 23:07:04 +00:00
|
|
|
|
{
|
|
|
|
|
GdkWindow *header_win;
|
|
|
|
|
GdkWindow *day_name_win;
|
|
|
|
|
GdkWindow *main_win;
|
|
|
|
|
GdkWindow *week_win;
|
|
|
|
|
GdkWindow *arrow_win[4];
|
|
|
|
|
|
1998-11-28 01:56:09 +00:00
|
|
|
|
guint header_h;
|
|
|
|
|
guint day_name_h;
|
|
|
|
|
guint main_h;
|
1998-10-04 23:07:04 +00:00
|
|
|
|
|
|
|
|
|
guint arrow_state[4];
|
|
|
|
|
guint arrow_width;
|
|
|
|
|
guint max_month_width;
|
|
|
|
|
guint max_year_width;
|
|
|
|
|
|
|
|
|
|
guint day_width;
|
|
|
|
|
guint week_width;
|
|
|
|
|
|
|
|
|
|
guint min_day_width;
|
|
|
|
|
guint max_day_char_width;
|
|
|
|
|
guint max_day_char_ascent;
|
|
|
|
|
guint max_day_char_descent;
|
|
|
|
|
guint max_label_char_ascent;
|
|
|
|
|
guint max_label_char_descent;
|
|
|
|
|
guint max_week_char_width;
|
|
|
|
|
|
|
|
|
|
/* flags */
|
2003-08-08 22:17:34 +00:00
|
|
|
|
guint year_before : 1;
|
|
|
|
|
|
2003-05-20 22:37:57 +00:00
|
|
|
|
guint need_timer : 1;
|
|
|
|
|
|
2003-08-08 23:01:17 +00:00
|
|
|
|
guint in_drag : 1;
|
|
|
|
|
guint drag_highlight : 1;
|
|
|
|
|
|
2003-05-20 22:37:57 +00:00
|
|
|
|
guint32 timer;
|
|
|
|
|
gint click_child;
|
2003-08-08 22:44:14 +00:00
|
|
|
|
|
|
|
|
|
gint week_start;
|
2003-08-08 23:01:17 +00:00
|
|
|
|
|
|
|
|
|
gint drag_start_x;
|
|
|
|
|
gint drag_start_y;
|
2007-12-27 20:41:08 +00:00
|
|
|
|
|
|
|
|
|
/* Optional callback, used to display extra information for each day. */
|
|
|
|
|
GtkCalendarDetailFunc detail_func;
|
|
|
|
|
gpointer detail_func_user_data;
|
|
|
|
|
GDestroyNotify detail_func_destroy;
|
|
|
|
|
|
|
|
|
|
/* Size requistion for details provided by the hook. */
|
|
|
|
|
gint detail_height_rows;
|
|
|
|
|
gint detail_width_chars;
|
2007-12-28 09:36:06 +00:00
|
|
|
|
gint detail_overflow[6];
|
1998-10-04 23:07:04 +00:00
|
|
|
|
};
|
|
|
|
|
|
2005-05-11 19:16:19 +00:00
|
|
|
|
#define GTK_CALENDAR_GET_PRIVATE(widget) (GTK_CALENDAR (widget)->priv)
|
|
|
|
|
|
|
|
|
|
static void gtk_calendar_finalize (GObject *calendar);
|
|
|
|
|
static void gtk_calendar_destroy (GtkObject *calendar);
|
|
|
|
|
static void gtk_calendar_set_property (GObject *object,
|
|
|
|
|
guint prop_id,
|
|
|
|
|
const GValue *value,
|
|
|
|
|
GParamSpec *pspec);
|
|
|
|
|
static void gtk_calendar_get_property (GObject *object,
|
|
|
|
|
guint prop_id,
|
|
|
|
|
GValue *value,
|
|
|
|
|
GParamSpec *pspec);
|
|
|
|
|
|
|
|
|
|
static void gtk_calendar_realize (GtkWidget *widget);
|
|
|
|
|
static void gtk_calendar_unrealize (GtkWidget *widget);
|
|
|
|
|
static void gtk_calendar_size_request (GtkWidget *widget,
|
|
|
|
|
GtkRequisition *requisition);
|
|
|
|
|
static void gtk_calendar_size_allocate (GtkWidget *widget,
|
|
|
|
|
GtkAllocation *allocation);
|
|
|
|
|
static gboolean gtk_calendar_expose (GtkWidget *widget,
|
|
|
|
|
GdkEventExpose *event);
|
|
|
|
|
static gboolean gtk_calendar_button_press (GtkWidget *widget,
|
|
|
|
|
GdkEventButton *event);
|
|
|
|
|
static gboolean gtk_calendar_button_release (GtkWidget *widget,
|
|
|
|
|
GdkEventButton *event);
|
|
|
|
|
static gboolean gtk_calendar_motion_notify (GtkWidget *widget,
|
|
|
|
|
GdkEventMotion *event);
|
|
|
|
|
static gboolean gtk_calendar_enter_notify (GtkWidget *widget,
|
|
|
|
|
GdkEventCrossing *event);
|
|
|
|
|
static gboolean gtk_calendar_leave_notify (GtkWidget *widget,
|
|
|
|
|
GdkEventCrossing *event);
|
|
|
|
|
static gboolean gtk_calendar_scroll (GtkWidget *widget,
|
|
|
|
|
GdkEventScroll *event);
|
|
|
|
|
static gboolean gtk_calendar_key_press (GtkWidget *widget,
|
|
|
|
|
GdkEventKey *event);
|
|
|
|
|
static gboolean gtk_calendar_focus_out (GtkWidget *widget,
|
|
|
|
|
GdkEventFocus *event);
|
|
|
|
|
static void gtk_calendar_grab_notify (GtkWidget *widget,
|
|
|
|
|
gboolean was_grabbed);
|
|
|
|
|
static void gtk_calendar_state_changed (GtkWidget *widget,
|
|
|
|
|
GtkStateType previous_state);
|
|
|
|
|
static void gtk_calendar_style_set (GtkWidget *widget,
|
|
|
|
|
GtkStyle *previous_style);
|
2007-12-28 09:36:06 +00:00
|
|
|
|
static gboolean gtk_calendar_query_tooltip (GtkWidget *widget,
|
|
|
|
|
gint x,
|
|
|
|
|
gint y,
|
|
|
|
|
gboolean keyboard_mode,
|
|
|
|
|
GtkTooltip *tooltip);
|
2005-05-11 19:16:19 +00:00
|
|
|
|
|
|
|
|
|
static void gtk_calendar_drag_data_get (GtkWidget *widget,
|
|
|
|
|
GdkDragContext *context,
|
|
|
|
|
GtkSelectionData *selection_data,
|
|
|
|
|
guint info,
|
|
|
|
|
guint time);
|
|
|
|
|
static void gtk_calendar_drag_data_received (GtkWidget *widget,
|
|
|
|
|
GdkDragContext *context,
|
|
|
|
|
gint x,
|
|
|
|
|
gint y,
|
|
|
|
|
GtkSelectionData *selection_data,
|
|
|
|
|
guint info,
|
|
|
|
|
guint time);
|
|
|
|
|
static gboolean gtk_calendar_drag_motion (GtkWidget *widget,
|
|
|
|
|
GdkDragContext *context,
|
|
|
|
|
gint x,
|
|
|
|
|
gint y,
|
|
|
|
|
guint time);
|
|
|
|
|
static void gtk_calendar_drag_leave (GtkWidget *widget,
|
|
|
|
|
GdkDragContext *context,
|
|
|
|
|
guint time);
|
|
|
|
|
static gboolean gtk_calendar_drag_drop (GtkWidget *widget,
|
|
|
|
|
GdkDragContext *context,
|
|
|
|
|
gint x,
|
|
|
|
|
gint y,
|
|
|
|
|
guint time);
|
|
|
|
|
|
|
|
|
|
static void calendar_start_spinning (GtkCalendar *calendar,
|
|
|
|
|
gint click_child);
|
|
|
|
|
static void calendar_stop_spinning (GtkCalendar *calendar);
|
|
|
|
|
|
|
|
|
|
static void calendar_invalidate_day (GtkCalendar *widget,
|
|
|
|
|
gint row,
|
|
|
|
|
gint col);
|
|
|
|
|
static void calendar_invalidate_day_num (GtkCalendar *widget,
|
|
|
|
|
gint day);
|
|
|
|
|
static void calendar_invalidate_arrow (GtkCalendar *widget,
|
|
|
|
|
guint arrow);
|
|
|
|
|
|
|
|
|
|
static void calendar_compute_days (GtkCalendar *calendar);
|
2003-08-08 23:01:17 +00:00
|
|
|
|
|
1998-09-27 18:32:00 +00:00
|
|
|
|
static char *default_abbreviated_dayname[7];
|
|
|
|
|
static char *default_monthname[12];
|
|
|
|
|
|
2005-05-11 19:16:19 +00:00
|
|
|
|
G_DEFINE_TYPE (GtkCalendar, gtk_calendar, GTK_TYPE_WIDGET)
|
1998-09-27 18:32:00 +00:00
|
|
|
|
|
|
|
|
|
static void
|
|
|
|
|
gtk_calendar_class_init (GtkCalendarClass *class)
|
|
|
|
|
{
|
2002-02-10 14:33:06 +00:00
|
|
|
|
GObjectClass *gobject_class;
|
2003-05-20 22:37:57 +00:00
|
|
|
|
GtkObjectClass *object_class;
|
1998-09-27 18:32:00 +00:00
|
|
|
|
GtkWidgetClass *widget_class;
|
2002-02-10 14:33:06 +00:00
|
|
|
|
|
|
|
|
|
gobject_class = (GObjectClass*) class;
|
2003-05-20 22:37:57 +00:00
|
|
|
|
object_class = (GtkObjectClass*) class;
|
1998-09-27 18:32:00 +00:00
|
|
|
|
widget_class = (GtkWidgetClass*) class;
|
1998-10-01 13:24:42 +00:00
|
|
|
|
|
2003-05-08 00:25:51 +00:00
|
|
|
|
gobject_class->set_property = gtk_calendar_set_property;
|
|
|
|
|
gobject_class->get_property = gtk_calendar_get_property;
|
2002-02-10 14:33:06 +00:00
|
|
|
|
gobject_class->finalize = gtk_calendar_finalize;
|
doh, this was broken beyond believe.
Tue Dec 12 23:46:44 2000 Tim Janik <timj@gtk.org>
* gtk/stock-icons/Makefile.am: doh, this was broken beyond believe.
* gtk/gtkbox.c: change property types from (u)long to (u)int for
::position and ::padding.
* gtk/gtkcontainer.c: make ::border_width an INT property.
* gtk/gtkpacker.c: make ::position an INT property.
* gtk/gtkscrolledwindow.c (gtk_scrolled_window_adjustment_changed):
guard against NULL h/v scrollbars, since this is used at construction
time.
* gtk/gtkclist.[hc]: nuked gtk_clist_construct(), implemented
internal gtk_clist_constructor().
* gtk/gtkctree.[hc]: nuked gtk_ctree_construct(), implemented
gtk_ctree_constructor().
* gtk/gtkprogressbar.c (gtk_progress_bar_class_init): property
::pulse_step should use ARG_PULSE_STEP, not ARG_FRACTION.
* docs/reference/Makefile.am: fun stuff, disabled docs generation
again, gtk-scan.c needs to introspec paramspecs, not GtkAgs.
* gtk/gtkwidget.[hc]:
removed gtk_widget_setv(), gtk_widget_getv(), gtk_widget_newv()
and gtk_widget_get().
(gtk_widget_new): use g_object_new_valist().
(gtk_widget_set): use g_object_set_valist().
* gtk/gtkobject.[hc]:
removed gtk_object_arg_get_info(), gtk_object_getv(),
gtk_object_query_args(), gtk_object_newv(),
gtk_object_class_add_signals(),
gtk_object_class_user_signal_new(),
gtk_object_class_user_signal_newv(),
gtk_object_arg_set(), gtk_object_arg_get(),
gtk_object_args_collect(),
gtk_object_default_construct(),
gtk_object_constructed(),
GTK_CONSTRUCTED and GTK_OBJECT_CONSTRUCTED().
removed nsignals, signals and n_args members from GtkObjectClass.
(gtk_object_new): use g_object_new_valist().
(gtk_object_set): use g_object_set_valist().
(gtk_object_get): use g_object_get_valist().
* gtk/gtkcompat.h: define gtk_object_default_construct().
* gtk/gtktypeutils.c (gtk_type_new): create constructed objects via
g_object_new().
* gtk/*.c: removed gtk_object_class_add_signals() from class_init()
fucntions, cleaned up method assignments (make sure your structures
are setup properly before calling out). removed all GTK_CONSTRUCTED
hacks ;)
2000-12-13 01:34:41 +00:00
|
|
|
|
|
2003-05-20 22:37:57 +00:00
|
|
|
|
object_class->destroy = gtk_calendar_destroy;
|
|
|
|
|
|
1998-09-27 18:32:00 +00:00
|
|
|
|
widget_class->realize = gtk_calendar_realize;
|
|
|
|
|
widget_class->unrealize = gtk_calendar_unrealize;
|
|
|
|
|
widget_class->expose_event = gtk_calendar_expose;
|
|
|
|
|
widget_class->size_request = gtk_calendar_size_request;
|
|
|
|
|
widget_class->size_allocate = gtk_calendar_size_allocate;
|
|
|
|
|
widget_class->button_press_event = gtk_calendar_button_press;
|
2003-05-20 22:37:57 +00:00
|
|
|
|
widget_class->button_release_event = gtk_calendar_button_release;
|
1998-09-27 18:32:00 +00:00
|
|
|
|
widget_class->motion_notify_event = gtk_calendar_motion_notify;
|
|
|
|
|
widget_class->enter_notify_event = gtk_calendar_enter_notify;
|
|
|
|
|
widget_class->leave_notify_event = gtk_calendar_leave_notify;
|
|
|
|
|
widget_class->key_press_event = gtk_calendar_key_press;
|
2003-08-08 22:03:25 +00:00
|
|
|
|
widget_class->scroll_event = gtk_calendar_scroll;
|
1998-09-27 18:32:00 +00:00
|
|
|
|
widget_class->style_set = gtk_calendar_style_set;
|
|
|
|
|
widget_class->state_changed = gtk_calendar_state_changed;
|
2003-05-20 22:37:57 +00:00
|
|
|
|
widget_class->grab_notify = gtk_calendar_grab_notify;
|
2004-06-10 04:09:33 +00:00
|
|
|
|
widget_class->focus_out_event = gtk_calendar_focus_out;
|
2007-12-28 09:36:06 +00:00
|
|
|
|
widget_class->query_tooltip = gtk_calendar_query_tooltip;
|
2003-08-08 23:01:17 +00:00
|
|
|
|
|
|
|
|
|
widget_class->drag_data_get = gtk_calendar_drag_data_get;
|
|
|
|
|
widget_class->drag_motion = gtk_calendar_drag_motion;
|
|
|
|
|
widget_class->drag_leave = gtk_calendar_drag_leave;
|
|
|
|
|
widget_class->drag_drop = gtk_calendar_drag_drop;
|
|
|
|
|
widget_class->drag_data_received = gtk_calendar_drag_data_received;
|
1998-10-01 13:24:42 +00:00
|
|
|
|
|
2007-12-28 19:36:16 +00:00
|
|
|
|
/**
|
|
|
|
|
* GtkCalendar:year:
|
|
|
|
|
*
|
|
|
|
|
* The selected year.
|
|
|
|
|
* This property gets initially set to the current year.
|
|
|
|
|
*/
|
2003-05-08 00:25:51 +00:00
|
|
|
|
g_object_class_install_property (gobject_class,
|
|
|
|
|
PROP_YEAR,
|
|
|
|
|
g_param_spec_int ("year",
|
2004-01-16 23:10:05 +00:00
|
|
|
|
P_("Year"),
|
|
|
|
|
P_("The selected year"),
|
2003-05-08 00:25:51 +00:00
|
|
|
|
0, G_MAXINT, 0,
|
2005-03-22 02:14:55 +00:00
|
|
|
|
GTK_PARAM_READWRITE));
|
2007-12-28 19:36:16 +00:00
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
|
* GtkCalendar:month:
|
|
|
|
|
*
|
|
|
|
|
* The selected month (as a number between 0 and 11).
|
|
|
|
|
* This property gets initially set to the current month.
|
|
|
|
|
*/
|
2003-05-08 00:25:51 +00:00
|
|
|
|
g_object_class_install_property (gobject_class,
|
|
|
|
|
PROP_MONTH,
|
|
|
|
|
g_param_spec_int ("month",
|
2004-01-16 23:10:05 +00:00
|
|
|
|
P_("Month"),
|
|
|
|
|
P_("The selected month (as a number between 0 and 11)"),
|
2003-05-08 00:25:51 +00:00
|
|
|
|
0, 11, 0,
|
2005-03-22 02:14:55 +00:00
|
|
|
|
GTK_PARAM_READWRITE));
|
2007-12-28 19:36:16 +00:00
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
|
* GtkCalendar:day:
|
|
|
|
|
*
|
|
|
|
|
* The selected day (as a number between 1 and 31, or 0
|
|
|
|
|
* to unselect the currently selected day).
|
|
|
|
|
* This property gets initially set to the current day.
|
|
|
|
|
*/
|
2003-05-08 00:25:51 +00:00
|
|
|
|
g_object_class_install_property (gobject_class,
|
|
|
|
|
PROP_DAY,
|
|
|
|
|
g_param_spec_int ("day",
|
2004-01-16 23:10:05 +00:00
|
|
|
|
P_("Day"),
|
|
|
|
|
P_("The selected day (as a number between 1 and 31, or 0 to unselect the currently selected day)"),
|
2003-05-08 00:25:51 +00:00
|
|
|
|
0, 31, 0,
|
2005-03-22 02:14:55 +00:00
|
|
|
|
GTK_PARAM_READWRITE));
|
2003-06-14 22:27:14 +00:00
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
|
* GtkCalendar:show-heading:
|
|
|
|
|
*
|
|
|
|
|
* Determines whether a heading is displayed.
|
|
|
|
|
*
|
|
|
|
|
* Since: 2.4
|
|
|
|
|
*/
|
2003-05-08 00:25:51 +00:00
|
|
|
|
g_object_class_install_property (gobject_class,
|
|
|
|
|
PROP_SHOW_HEADING,
|
2005-03-09 06:15:13 +00:00
|
|
|
|
g_param_spec_boolean ("show-heading",
|
2004-01-16 23:10:05 +00:00
|
|
|
|
P_("Show Heading"),
|
|
|
|
|
P_("If TRUE, a heading is displayed"),
|
2003-05-08 00:25:51 +00:00
|
|
|
|
TRUE,
|
2005-03-22 02:14:55 +00:00
|
|
|
|
GTK_PARAM_READWRITE));
|
2003-06-14 22:27:14 +00:00
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
|
* GtkCalendar:show-day-names:
|
|
|
|
|
*
|
|
|
|
|
* Determines whether day names are displayed.
|
|
|
|
|
*
|
|
|
|
|
* Since: 2.4
|
|
|
|
|
*/
|
2003-05-08 00:25:51 +00:00
|
|
|
|
g_object_class_install_property (gobject_class,
|
|
|
|
|
PROP_SHOW_DAY_NAMES,
|
2005-03-09 06:15:13 +00:00
|
|
|
|
g_param_spec_boolean ("show-day-names",
|
2004-01-16 23:10:05 +00:00
|
|
|
|
P_("Show Day Names"),
|
|
|
|
|
P_("If TRUE, day names are displayed"),
|
2003-05-08 00:25:51 +00:00
|
|
|
|
TRUE,
|
2005-03-22 02:14:55 +00:00
|
|
|
|
GTK_PARAM_READWRITE));
|
2003-06-14 22:27:14 +00:00
|
|
|
|
/**
|
|
|
|
|
* GtkCalendar:no-month-change:
|
|
|
|
|
*
|
|
|
|
|
* Determines whether the selected month can be changed.
|
|
|
|
|
*
|
|
|
|
|
* Since: 2.4
|
|
|
|
|
*/
|
2003-05-08 00:25:51 +00:00
|
|
|
|
g_object_class_install_property (gobject_class,
|
|
|
|
|
PROP_NO_MONTH_CHANGE,
|
2005-03-09 06:15:13 +00:00
|
|
|
|
g_param_spec_boolean ("no-month-change",
|
2004-01-16 23:10:05 +00:00
|
|
|
|
P_("No Month Change"),
|
2004-07-15 23:24:51 +00:00
|
|
|
|
P_("If TRUE, the selected month cannot be changed"),
|
2003-05-08 00:25:51 +00:00
|
|
|
|
FALSE,
|
2005-03-22 02:14:55 +00:00
|
|
|
|
GTK_PARAM_READWRITE));
|
2003-06-14 22:27:14 +00:00
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
|
* GtkCalendar:show-week-numbers:
|
|
|
|
|
*
|
|
|
|
|
* Determines whether week numbers are displayed.
|
|
|
|
|
*
|
|
|
|
|
* Since: 2.4
|
|
|
|
|
*/
|
2003-05-08 00:25:51 +00:00
|
|
|
|
g_object_class_install_property (gobject_class,
|
|
|
|
|
PROP_SHOW_WEEK_NUMBERS,
|
2005-03-09 06:15:13 +00:00
|
|
|
|
g_param_spec_boolean ("show-week-numbers",
|
2004-01-16 23:10:05 +00:00
|
|
|
|
P_("Show Week Numbers"),
|
|
|
|
|
P_("If TRUE, week numbers are displayed"),
|
2003-05-08 00:25:51 +00:00
|
|
|
|
FALSE,
|
2005-03-22 02:14:55 +00:00
|
|
|
|
GTK_PARAM_READWRITE));
|
2003-06-14 22:27:14 +00:00
|
|
|
|
|
2007-12-27 20:41:08 +00:00
|
|
|
|
/**
|
|
|
|
|
* GtkCalendar:detail-width-chars:
|
|
|
|
|
*
|
|
|
|
|
* Width of a detail cell, in characters.
|
|
|
|
|
* A value of 0 allows any width. See gtk_calendar_set_detail_func().
|
|
|
|
|
*
|
2008-02-15 23:42:42 +00:00
|
|
|
|
* Since: 2.14
|
2007-12-27 20:41:08 +00:00
|
|
|
|
*/
|
|
|
|
|
g_object_class_install_property (gobject_class,
|
|
|
|
|
PROP_DETAIL_WIDTH_CHARS,
|
|
|
|
|
g_param_spec_int ("detail-width-chars",
|
|
|
|
|
P_("Details Width"),
|
|
|
|
|
P_("Details width in characters"),
|
|
|
|
|
0, 127, 0,
|
|
|
|
|
GTK_PARAM_READWRITE));
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
|
* GtkCalendar:detail-height-rows:
|
|
|
|
|
*
|
|
|
|
|
* Height of a detail cell, in rows.
|
|
|
|
|
* A value of 0 allows any width. See gtk_calendar_set_detail_func().
|
|
|
|
|
*
|
2008-02-15 23:42:42 +00:00
|
|
|
|
* Since: 2.14
|
2007-12-27 20:41:08 +00:00
|
|
|
|
*/
|
|
|
|
|
g_object_class_install_property (gobject_class,
|
|
|
|
|
PROP_DETAIL_HEIGHT_ROWS,
|
|
|
|
|
g_param_spec_int ("detail-height-rows",
|
|
|
|
|
P_("Details Height"),
|
|
|
|
|
P_("Details height in rows"),
|
|
|
|
|
0, 127, 0,
|
|
|
|
|
GTK_PARAM_READWRITE));
|
|
|
|
|
|
2007-12-28 09:39:34 +00:00
|
|
|
|
/**
|
|
|
|
|
* GtkCalendar:show-details:
|
|
|
|
|
*
|
|
|
|
|
* Determines whether details are shown directly in the widget, or if they are
|
|
|
|
|
* available only as tooltip. When this property is set days with details are
|
|
|
|
|
* marked.
|
|
|
|
|
*
|
2008-02-15 23:42:42 +00:00
|
|
|
|
* Since: 2.14
|
2007-12-28 09:39:34 +00:00
|
|
|
|
*/
|
|
|
|
|
g_object_class_install_property (gobject_class,
|
|
|
|
|
PROP_SHOW_DETAILS,
|
|
|
|
|
g_param_spec_boolean ("show-details",
|
|
|
|
|
P_("Show Details"),
|
|
|
|
|
P_("If TRUE, details are shown"),
|
|
|
|
|
TRUE,
|
|
|
|
|
GTK_PARAM_READWRITE));
|
|
|
|
|
|
1998-09-27 18:32:00 +00:00
|
|
|
|
gtk_calendar_signals[MONTH_CHANGED_SIGNAL] =
|
2005-09-01 05:11:46 +00:00
|
|
|
|
g_signal_new (I_("month_changed"),
|
2002-10-09 22:11:08 +00:00
|
|
|
|
G_OBJECT_CLASS_TYPE (gobject_class),
|
|
|
|
|
G_SIGNAL_RUN_FIRST,
|
|
|
|
|
G_STRUCT_OFFSET (GtkCalendarClass, month_changed),
|
|
|
|
|
NULL, NULL,
|
|
|
|
|
_gtk_marshal_VOID__VOID,
|
|
|
|
|
G_TYPE_NONE, 0);
|
1998-09-27 18:32:00 +00:00
|
|
|
|
gtk_calendar_signals[DAY_SELECTED_SIGNAL] =
|
2005-09-01 05:11:46 +00:00
|
|
|
|
g_signal_new (I_("day_selected"),
|
2002-10-09 22:11:08 +00:00
|
|
|
|
G_OBJECT_CLASS_TYPE (gobject_class),
|
|
|
|
|
G_SIGNAL_RUN_FIRST,
|
|
|
|
|
G_STRUCT_OFFSET (GtkCalendarClass, day_selected),
|
|
|
|
|
NULL, NULL,
|
|
|
|
|
_gtk_marshal_VOID__VOID,
|
|
|
|
|
G_TYPE_NONE, 0);
|
1998-09-27 18:32:00 +00:00
|
|
|
|
gtk_calendar_signals[DAY_SELECTED_DOUBLE_CLICK_SIGNAL] =
|
2005-09-01 05:11:46 +00:00
|
|
|
|
g_signal_new (I_("day_selected_double_click"),
|
2002-10-09 22:11:08 +00:00
|
|
|
|
G_OBJECT_CLASS_TYPE (gobject_class),
|
|
|
|
|
G_SIGNAL_RUN_FIRST,
|
|
|
|
|
G_STRUCT_OFFSET (GtkCalendarClass, day_selected_double_click),
|
|
|
|
|
NULL, NULL,
|
|
|
|
|
_gtk_marshal_VOID__VOID,
|
|
|
|
|
G_TYPE_NONE, 0);
|
1998-09-27 18:32:00 +00:00
|
|
|
|
gtk_calendar_signals[PREV_MONTH_SIGNAL] =
|
2005-09-01 05:11:46 +00:00
|
|
|
|
g_signal_new (I_("prev_month"),
|
2002-10-09 22:11:08 +00:00
|
|
|
|
G_OBJECT_CLASS_TYPE (gobject_class),
|
|
|
|
|
G_SIGNAL_RUN_FIRST,
|
|
|
|
|
G_STRUCT_OFFSET (GtkCalendarClass, prev_month),
|
|
|
|
|
NULL, NULL,
|
|
|
|
|
_gtk_marshal_VOID__VOID,
|
|
|
|
|
G_TYPE_NONE, 0);
|
1998-09-27 18:32:00 +00:00
|
|
|
|
gtk_calendar_signals[NEXT_MONTH_SIGNAL] =
|
2005-09-01 05:11:46 +00:00
|
|
|
|
g_signal_new (I_("next_month"),
|
2002-10-09 22:11:08 +00:00
|
|
|
|
G_OBJECT_CLASS_TYPE (gobject_class),
|
|
|
|
|
G_SIGNAL_RUN_FIRST,
|
|
|
|
|
G_STRUCT_OFFSET (GtkCalendarClass, next_month),
|
|
|
|
|
NULL, NULL,
|
|
|
|
|
_gtk_marshal_VOID__VOID,
|
|
|
|
|
G_TYPE_NONE, 0);
|
1998-09-27 18:32:00 +00:00
|
|
|
|
gtk_calendar_signals[PREV_YEAR_SIGNAL] =
|
2005-09-01 05:11:46 +00:00
|
|
|
|
g_signal_new (I_("prev_year"),
|
2002-10-09 22:11:08 +00:00
|
|
|
|
G_OBJECT_CLASS_TYPE (gobject_class),
|
|
|
|
|
G_SIGNAL_RUN_FIRST,
|
|
|
|
|
G_STRUCT_OFFSET (GtkCalendarClass, prev_year),
|
|
|
|
|
NULL, NULL,
|
|
|
|
|
_gtk_marshal_VOID__VOID,
|
|
|
|
|
G_TYPE_NONE, 0);
|
1998-09-27 18:32:00 +00:00
|
|
|
|
gtk_calendar_signals[NEXT_YEAR_SIGNAL] =
|
2005-09-01 05:11:46 +00:00
|
|
|
|
g_signal_new (I_("next_year"),
|
2002-10-09 22:11:08 +00:00
|
|
|
|
G_OBJECT_CLASS_TYPE (gobject_class),
|
|
|
|
|
G_SIGNAL_RUN_FIRST,
|
|
|
|
|
G_STRUCT_OFFSET (GtkCalendarClass, next_year),
|
|
|
|
|
NULL, NULL,
|
|
|
|
|
_gtk_marshal_VOID__VOID,
|
|
|
|
|
G_TYPE_NONE, 0);
|
2005-05-11 19:16:19 +00:00
|
|
|
|
|
|
|
|
|
g_type_class_add_private (gobject_class, sizeof (GtkCalendarPrivate));
|
1998-09-27 18:32:00 +00:00
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
static void
|
|
|
|
|
gtk_calendar_init (GtkCalendar *calendar)
|
|
|
|
|
{
|
2005-05-11 19:16:19 +00:00
|
|
|
|
GtkWidget *widget = GTK_WIDGET (calendar);
|
1998-09-27 18:32:00 +00:00
|
|
|
|
time_t secs;
|
|
|
|
|
struct tm *tm;
|
|
|
|
|
gint i;
|
2005-11-28 01:51:08 +00:00
|
|
|
|
#ifdef G_OS_WIN32
|
|
|
|
|
wchar_t wbuffer[100];
|
|
|
|
|
#else
|
2006-10-07 21:32:53 +00:00
|
|
|
|
char buffer[255];
|
1998-09-27 18:32:00 +00:00
|
|
|
|
time_t tmp_time;
|
2005-11-28 01:51:08 +00:00
|
|
|
|
#endif
|
2005-05-11 19:16:19 +00:00
|
|
|
|
GtkCalendarPrivate *priv;
|
2003-08-08 22:17:34 +00:00
|
|
|
|
gchar *year_before;
|
2005-10-04 13:42:27 +00:00
|
|
|
|
#ifdef HAVE__NL_TIME_FIRST_WEEKDAY
|
2007-06-08 18:39:29 +00:00
|
|
|
|
union { unsigned int word; char *string; } langinfo;
|
2005-09-30 17:53:19 +00:00
|
|
|
|
gint week_1stday = 0;
|
|
|
|
|
gint first_weekday = 1;
|
2005-09-09 17:26:14 +00:00
|
|
|
|
guint week_origin;
|
2005-10-04 13:42:27 +00:00
|
|
|
|
#else
|
|
|
|
|
gchar *week_start;
|
|
|
|
|
#endif
|
2005-09-09 17:26:14 +00:00
|
|
|
|
|
2005-05-11 19:16:19 +00:00
|
|
|
|
priv = calendar->priv = G_TYPE_INSTANCE_GET_PRIVATE (calendar,
|
|
|
|
|
GTK_TYPE_CALENDAR,
|
|
|
|
|
GtkCalendarPrivate);
|
|
|
|
|
|
1998-09-27 18:32:00 +00:00
|
|
|
|
GTK_WIDGET_SET_FLAGS (widget, GTK_CAN_FOCUS);
|
1998-10-01 13:24:42 +00:00
|
|
|
|
|
1998-09-27 18:32:00 +00:00
|
|
|
|
if (!default_abbreviated_dayname[0])
|
|
|
|
|
for (i=0; i<7; i++)
|
|
|
|
|
{
|
2005-11-28 01:51:08 +00:00
|
|
|
|
#ifndef G_OS_WIN32
|
1998-09-27 18:32:00 +00:00
|
|
|
|
tmp_time= (i+3)*86400;
|
|
|
|
|
strftime ( buffer, sizeof (buffer), "%a", gmtime (&tmp_time));
|
2001-01-05 21:23:53 +00:00
|
|
|
|
default_abbreviated_dayname[i] = g_locale_to_utf8 (buffer, -1, NULL, NULL, NULL);
|
2005-11-28 01:51:08 +00:00
|
|
|
|
#else
|
2006-10-07 21:32:53 +00:00
|
|
|
|
if (!GetLocaleInfoW (GetThreadLocale (), LOCALE_SABBREVDAYNAME1 + (i+6)%7,
|
|
|
|
|
wbuffer, G_N_ELEMENTS (wbuffer)))
|
|
|
|
|
default_abbreviated_dayname[i] = g_strdup_printf ("(%d)", i);
|
2005-11-28 01:51:08 +00:00
|
|
|
|
else
|
2006-10-07 21:32:53 +00:00
|
|
|
|
default_abbreviated_dayname[i] = g_utf16_to_utf8 (wbuffer, -1, NULL, NULL, NULL);
|
2005-11-28 01:51:08 +00:00
|
|
|
|
#endif
|
1998-09-27 18:32:00 +00:00
|
|
|
|
}
|
1998-10-01 13:24:42 +00:00
|
|
|
|
|
1998-09-27 18:32:00 +00:00
|
|
|
|
if (!default_monthname[0])
|
|
|
|
|
for (i=0; i<12; i++)
|
|
|
|
|
{
|
2005-11-28 01:51:08 +00:00
|
|
|
|
#ifndef G_OS_WIN32
|
1998-09-27 18:32:00 +00:00
|
|
|
|
tmp_time=i*2764800;
|
|
|
|
|
strftime ( buffer, sizeof (buffer), "%B", gmtime (&tmp_time));
|
2001-01-05 21:23:53 +00:00
|
|
|
|
default_monthname[i] = g_locale_to_utf8 (buffer, -1, NULL, NULL, NULL);
|
2005-11-28 01:51:08 +00:00
|
|
|
|
#else
|
2006-10-07 21:32:53 +00:00
|
|
|
|
if (!GetLocaleInfoW (GetThreadLocale (), LOCALE_SMONTHNAME1 + i,
|
|
|
|
|
wbuffer, G_N_ELEMENTS (wbuffer)))
|
|
|
|
|
default_monthname[i] = g_strdup_printf ("(%d)", i);
|
2005-11-28 01:51:08 +00:00
|
|
|
|
else
|
2006-10-07 21:32:53 +00:00
|
|
|
|
default_monthname[i] = g_utf16_to_utf8 (wbuffer, -1, NULL, NULL, NULL);
|
2005-11-28 01:51:08 +00:00
|
|
|
|
#endif
|
1998-09-27 18:32:00 +00:00
|
|
|
|
}
|
1998-10-01 13:24:42 +00:00
|
|
|
|
|
1998-09-27 18:32:00 +00:00
|
|
|
|
/* Set defaults */
|
|
|
|
|
secs = time (NULL);
|
|
|
|
|
tm = localtime (&secs);
|
|
|
|
|
calendar->month = tm->tm_mon;
|
|
|
|
|
calendar->year = 1900 + tm->tm_year;
|
2005-05-11 19:16:19 +00:00
|
|
|
|
|
1998-09-27 18:32:00 +00:00
|
|
|
|
for (i=0;i<31;i++)
|
|
|
|
|
calendar->marked_date[i] = FALSE;
|
2005-06-15 03:54:10 +00:00
|
|
|
|
calendar->num_marked_dates = 0;
|
2001-09-20 19:35:08 +00:00
|
|
|
|
calendar->selected_day = tm->tm_mday;
|
1998-10-01 13:24:42 +00:00
|
|
|
|
|
2007-12-28 09:39:34 +00:00
|
|
|
|
calendar->display_flags = (GTK_CALENDAR_SHOW_HEADING |
|
|
|
|
|
GTK_CALENDAR_SHOW_DAY_NAMES |
|
|
|
|
|
GTK_CALENDAR_SHOW_DETAILS);
|
1998-10-01 13:24:42 +00:00
|
|
|
|
|
1998-09-27 18:32:00 +00:00
|
|
|
|
calendar->highlight_row = -1;
|
|
|
|
|
calendar->highlight_col = -1;
|
1998-10-01 13:24:42 +00:00
|
|
|
|
|
1998-10-05 03:52:48 +00:00
|
|
|
|
calendar->focus_row = -1;
|
|
|
|
|
calendar->focus_col = -1;
|
|
|
|
|
|
2005-05-11 19:16:19 +00:00
|
|
|
|
priv->max_year_width = 0;
|
|
|
|
|
priv->max_month_width = 0;
|
|
|
|
|
priv->max_day_char_width = 0;
|
|
|
|
|
priv->max_week_char_width = 0;
|
1998-10-04 23:07:04 +00:00
|
|
|
|
|
2005-05-11 19:16:19 +00:00
|
|
|
|
priv->max_day_char_ascent = 0;
|
|
|
|
|
priv->max_day_char_descent = 0;
|
|
|
|
|
priv->max_label_char_ascent = 0;
|
|
|
|
|
priv->max_label_char_descent = 0;
|
1998-10-04 23:07:04 +00:00
|
|
|
|
|
2005-05-11 19:16:19 +00:00
|
|
|
|
priv->arrow_width = 10;
|
1998-11-28 01:56:09 +00:00
|
|
|
|
|
2005-05-11 19:16:19 +00:00
|
|
|
|
priv->need_timer = 0;
|
|
|
|
|
priv->timer = 0;
|
|
|
|
|
priv->click_child = -1;
|
2003-08-08 22:17:34 +00:00
|
|
|
|
|
2005-05-11 19:16:19 +00:00
|
|
|
|
priv->in_drag = 0;
|
|
|
|
|
priv->drag_highlight = 0;
|
2003-08-08 23:01:17 +00:00
|
|
|
|
|
2004-07-21 16:53:55 +00:00
|
|
|
|
gtk_drag_dest_set (widget, 0, NULL, 0, GDK_ACTION_COPY);
|
|
|
|
|
gtk_drag_dest_add_text_targets (widget);
|
2003-08-08 23:01:17 +00:00
|
|
|
|
|
2005-05-11 19:16:19 +00:00
|
|
|
|
priv->year_before = 0;
|
2003-08-08 22:17:34 +00:00
|
|
|
|
|
|
|
|
|
/* Translate to calendar:YM if you want years to be displayed
|
|
|
|
|
* before months; otherwise translate to calendar:MY.
|
|
|
|
|
* Do *not* translate it to anything else, if it
|
|
|
|
|
* it isn't calendar:YM or calendar:MY it will not work.
|
|
|
|
|
*
|
2006-01-25 16:26:41 +00:00
|
|
|
|
* Note that this flipping is in top of the text direction flipping,
|
2003-08-08 22:17:34 +00:00
|
|
|
|
* so if you have a default text direction of RTL and YM, then
|
|
|
|
|
* the year will appear on the right.
|
|
|
|
|
*/
|
|
|
|
|
year_before = _("calendar:MY");
|
|
|
|
|
if (strcmp (year_before, "calendar:YM") == 0)
|
2005-05-11 19:16:19 +00:00
|
|
|
|
priv->year_before = 1;
|
2003-08-08 22:17:34 +00:00
|
|
|
|
else if (strcmp (year_before, "calendar:MY") != 0)
|
|
|
|
|
g_warning ("Whoever translated calendar:MY did so wrongly.\n");
|
2003-08-08 22:44:14 +00:00
|
|
|
|
|
2006-10-07 21:32:53 +00:00
|
|
|
|
#ifdef G_OS_WIN32
|
2006-10-10 21:51:11 +00:00
|
|
|
|
priv->week_start = 0;
|
|
|
|
|
week_start = NULL;
|
2006-10-07 21:32:53 +00:00
|
|
|
|
|
2006-10-10 21:51:11 +00:00
|
|
|
|
if (GetLocaleInfoW (GetThreadLocale (), LOCALE_IFIRSTDAYOFWEEK,
|
|
|
|
|
wbuffer, G_N_ELEMENTS (wbuffer)))
|
|
|
|
|
week_start = g_utf16_to_utf8 (wbuffer, -1, NULL, NULL, NULL);
|
2006-10-07 21:32:53 +00:00
|
|
|
|
|
2006-10-10 21:51:11 +00:00
|
|
|
|
if (week_start != NULL)
|
2006-10-07 21:32:53 +00:00
|
|
|
|
{
|
2006-10-10 21:51:11 +00:00
|
|
|
|
priv->week_start = (week_start[0] - '0' + 1) % 7;
|
|
|
|
|
g_free(week_start);
|
|
|
|
|
}
|
|
|
|
|
#else
|
2005-01-14 13:43:54 +00:00
|
|
|
|
#ifdef HAVE__NL_TIME_FIRST_WEEKDAY
|
2007-06-08 18:39:29 +00:00
|
|
|
|
langinfo.string = nl_langinfo (_NL_TIME_FIRST_WEEKDAY);
|
|
|
|
|
first_weekday = langinfo.string[0];
|
|
|
|
|
langinfo.string = nl_langinfo (_NL_TIME_WEEK_1STDAY);
|
|
|
|
|
week_origin = langinfo.word;
|
2005-09-30 17:53:19 +00:00
|
|
|
|
if (week_origin == 19971130) /* Sunday */
|
|
|
|
|
week_1stday = 0;
|
|
|
|
|
else if (week_origin == 19971201) /* Monday */
|
|
|
|
|
week_1stday = 1;
|
2005-09-09 17:26:14 +00:00
|
|
|
|
else
|
|
|
|
|
g_warning ("Unknown value of _NL_TIME_WEEK_1STDAY.\n");
|
|
|
|
|
|
2005-09-30 17:53:19 +00:00
|
|
|
|
priv->week_start = (week_1stday + first_weekday - 1) % 7;
|
2005-01-13 19:37:54 +00:00
|
|
|
|
#else
|
2004-01-02 01:52:04 +00:00
|
|
|
|
/* Translate to calendar:week_start:0 if you want Sunday to be the
|
|
|
|
|
* first day of the week to calendar:week_start:1 if you want Monday
|
|
|
|
|
* to be the first day of the week, and so on.
|
|
|
|
|
*/
|
|
|
|
|
week_start = _("calendar:week_start:0");
|
|
|
|
|
|
|
|
|
|
if (strncmp (week_start, "calendar:week_start:", 20) == 0)
|
2005-05-11 19:16:19 +00:00
|
|
|
|
priv->week_start = *(week_start + 20) - '0';
|
2004-01-02 01:52:04 +00:00
|
|
|
|
else
|
2005-05-11 19:16:19 +00:00
|
|
|
|
priv->week_start = -1;
|
2004-01-02 01:52:04 +00:00
|
|
|
|
|
2005-05-11 19:16:19 +00:00
|
|
|
|
if (priv->week_start < 0 || priv->week_start > 6)
|
2004-01-02 01:52:04 +00:00
|
|
|
|
{
|
|
|
|
|
g_warning ("Whoever translated calendar:week_start:0 did so wrongly.\n");
|
2005-05-11 19:16:19 +00:00
|
|
|
|
priv->week_start = 0;
|
2004-01-02 01:52:04 +00:00
|
|
|
|
}
|
2005-01-13 19:37:54 +00:00
|
|
|
|
#endif
|
2006-10-07 21:32:53 +00:00
|
|
|
|
#endif
|
2005-10-04 03:28:36 +00:00
|
|
|
|
|
|
|
|
|
calendar_compute_days (calendar);
|
1998-09-27 18:32:00 +00:00
|
|
|
|
}
|
|
|
|
|
|
2005-05-11 19:16:19 +00:00
|
|
|
|
|
|
|
|
|
/****************************************
|
|
|
|
|
* Utility Functions *
|
|
|
|
|
****************************************/
|
1998-09-27 18:32:00 +00:00
|
|
|
|
|
2007-12-28 09:26:38 +00:00
|
|
|
|
static void
|
|
|
|
|
calendar_queue_refresh (GtkCalendar *calendar)
|
|
|
|
|
{
|
|
|
|
|
GtkCalendarPrivate *priv = GTK_CALENDAR_GET_PRIVATE (calendar);
|
|
|
|
|
|
2007-12-28 09:39:34 +00:00
|
|
|
|
if (!(priv->detail_func) ||
|
|
|
|
|
!(calendar->display_flags & GTK_CALENDAR_SHOW_DETAILS) ||
|
|
|
|
|
(priv->detail_width_chars && priv->detail_height_rows))
|
2007-12-28 09:26:38 +00:00
|
|
|
|
gtk_widget_queue_draw (GTK_WIDGET (calendar));
|
|
|
|
|
else
|
|
|
|
|
gtk_widget_queue_resize (GTK_WIDGET (calendar));
|
|
|
|
|
}
|
|
|
|
|
|
1998-09-27 18:32:00 +00:00
|
|
|
|
static void
|
2005-05-11 19:16:19 +00:00
|
|
|
|
calendar_set_month_next (GtkCalendar *calendar)
|
1998-09-27 18:32:00 +00:00
|
|
|
|
{
|
|
|
|
|
gint month_len;
|
2008-02-07 15:50:39 +00:00
|
|
|
|
|
1998-09-27 18:32:00 +00:00
|
|
|
|
if (calendar->display_flags & GTK_CALENDAR_NO_MONTH_CHANGE)
|
|
|
|
|
return;
|
1998-10-01 13:24:42 +00:00
|
|
|
|
|
|
|
|
|
|
1998-09-27 18:32:00 +00:00
|
|
|
|
if (calendar->month == 11)
|
|
|
|
|
{
|
|
|
|
|
calendar->month = 0;
|
|
|
|
|
calendar->year++;
|
|
|
|
|
}
|
|
|
|
|
else
|
|
|
|
|
calendar->month++;
|
1998-10-01 13:24:42 +00:00
|
|
|
|
|
2005-05-11 19:16:19 +00:00
|
|
|
|
calendar_compute_days (calendar);
|
2002-10-09 22:11:08 +00:00
|
|
|
|
g_signal_emit (calendar,
|
|
|
|
|
gtk_calendar_signals[NEXT_MONTH_SIGNAL],
|
|
|
|
|
0);
|
|
|
|
|
g_signal_emit (calendar,
|
|
|
|
|
gtk_calendar_signals[MONTH_CHANGED_SIGNAL],
|
|
|
|
|
0);
|
1998-10-01 13:24:42 +00:00
|
|
|
|
|
1998-09-27 18:32:00 +00:00
|
|
|
|
month_len = month_length[leap (calendar->year)][calendar->month + 1];
|
1998-10-01 13:24:42 +00:00
|
|
|
|
|
1998-09-27 18:32:00 +00:00
|
|
|
|
if (month_len < calendar->selected_day)
|
|
|
|
|
{
|
|
|
|
|
calendar->selected_day = 0;
|
|
|
|
|
gtk_calendar_select_day (calendar, month_len);
|
|
|
|
|
}
|
|
|
|
|
else
|
|
|
|
|
gtk_calendar_select_day (calendar, calendar->selected_day);
|
2001-12-03 15:24:25 +00:00
|
|
|
|
|
2007-12-28 09:26:38 +00:00
|
|
|
|
calendar_queue_refresh (calendar);
|
1998-09-27 18:32:00 +00:00
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
static void
|
2005-05-11 19:16:19 +00:00
|
|
|
|
calendar_set_year_prev (GtkCalendar *calendar)
|
1998-09-27 18:32:00 +00:00
|
|
|
|
{
|
|
|
|
|
gint month_len;
|
2008-02-07 15:50:39 +00:00
|
|
|
|
|
1998-09-27 18:32:00 +00:00
|
|
|
|
calendar->year--;
|
2005-05-11 19:16:19 +00:00
|
|
|
|
calendar_compute_days (calendar);
|
2002-10-09 22:11:08 +00:00
|
|
|
|
g_signal_emit (calendar,
|
|
|
|
|
gtk_calendar_signals[PREV_YEAR_SIGNAL],
|
|
|
|
|
0);
|
|
|
|
|
g_signal_emit (calendar,
|
|
|
|
|
gtk_calendar_signals[MONTH_CHANGED_SIGNAL],
|
|
|
|
|
0);
|
1998-10-01 13:24:42 +00:00
|
|
|
|
|
1998-09-27 18:32:00 +00:00
|
|
|
|
month_len = month_length[leap (calendar->year)][calendar->month + 1];
|
1998-10-01 13:24:42 +00:00
|
|
|
|
|
1998-09-27 18:32:00 +00:00
|
|
|
|
if (month_len < calendar->selected_day)
|
|
|
|
|
{
|
|
|
|
|
calendar->selected_day = 0;
|
|
|
|
|
gtk_calendar_select_day (calendar, month_len);
|
|
|
|
|
}
|
|
|
|
|
else
|
|
|
|
|
gtk_calendar_select_day (calendar, calendar->selected_day);
|
1998-10-01 13:24:42 +00:00
|
|
|
|
|
2007-12-28 09:26:38 +00:00
|
|
|
|
calendar_queue_refresh (calendar);
|
1998-09-27 18:32:00 +00:00
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
static void
|
2005-05-11 19:16:19 +00:00
|
|
|
|
calendar_set_year_next (GtkCalendar *calendar)
|
1998-09-27 18:32:00 +00:00
|
|
|
|
{
|
|
|
|
|
gint month_len;
|
2008-02-07 15:50:39 +00:00
|
|
|
|
|
1998-09-27 18:32:00 +00:00
|
|
|
|
calendar->year++;
|
2005-05-11 19:16:19 +00:00
|
|
|
|
calendar_compute_days (calendar);
|
2002-10-09 22:11:08 +00:00
|
|
|
|
g_signal_emit (calendar,
|
|
|
|
|
gtk_calendar_signals[NEXT_YEAR_SIGNAL],
|
|
|
|
|
0);
|
|
|
|
|
g_signal_emit (calendar,
|
|
|
|
|
gtk_calendar_signals[MONTH_CHANGED_SIGNAL],
|
|
|
|
|
0);
|
1998-10-01 13:24:42 +00:00
|
|
|
|
|
1998-09-27 18:32:00 +00:00
|
|
|
|
month_len = month_length[leap (calendar->year)][calendar->month + 1];
|
1998-10-01 13:24:42 +00:00
|
|
|
|
|
1998-09-27 18:32:00 +00:00
|
|
|
|
if (month_len < calendar->selected_day)
|
|
|
|
|
{
|
|
|
|
|
calendar->selected_day = 0;
|
|
|
|
|
gtk_calendar_select_day (calendar, month_len);
|
|
|
|
|
}
|
|
|
|
|
else
|
|
|
|
|
gtk_calendar_select_day (calendar, calendar->selected_day);
|
1998-10-01 13:24:42 +00:00
|
|
|
|
|
2007-12-28 09:26:38 +00:00
|
|
|
|
calendar_queue_refresh (calendar);
|
1998-09-27 18:32:00 +00:00
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
static void
|
2005-05-11 19:16:19 +00:00
|
|
|
|
calendar_compute_days (GtkCalendar *calendar)
|
1998-09-27 18:32:00 +00:00
|
|
|
|
{
|
2005-05-11 19:16:19 +00:00
|
|
|
|
GtkCalendarPrivate *priv = GTK_CALENDAR_GET_PRIVATE (GTK_WIDGET (calendar));
|
|
|
|
|
gint month;
|
|
|
|
|
gint year;
|
|
|
|
|
gint ndays_in_month;
|
|
|
|
|
gint ndays_in_prev_month;
|
|
|
|
|
gint first_day;
|
|
|
|
|
gint row;
|
|
|
|
|
gint col;
|
2002-03-21 00:50:15 +00:00
|
|
|
|
gint day;
|
2005-05-11 19:16:19 +00:00
|
|
|
|
|
|
|
|
|
year = calendar->year;
|
|
|
|
|
month = calendar->month + 1;
|
1998-10-01 13:24:42 +00:00
|
|
|
|
|
2005-05-11 19:16:19 +00:00
|
|
|
|
ndays_in_month = month_length[leap (year)][month];
|
1998-10-01 13:24:42 +00:00
|
|
|
|
|
2005-05-11 19:16:19 +00:00
|
|
|
|
first_day = day_of_week (year, month, 1);
|
|
|
|
|
first_day = (first_day + 7 - priv->week_start) % 7;
|
1998-10-01 13:24:42 +00:00
|
|
|
|
|
2005-05-11 19:16:19 +00:00
|
|
|
|
/* Compute days of previous month */
|
|
|
|
|
if (month > 1)
|
|
|
|
|
ndays_in_prev_month = month_length[leap (year)][month-1];
|
|
|
|
|
else
|
|
|
|
|
ndays_in_prev_month = month_length[leap (year)][12];
|
|
|
|
|
day = ndays_in_prev_month - first_day + 1;
|
1998-10-01 13:24:42 +00:00
|
|
|
|
|
2005-05-11 19:16:19 +00:00
|
|
|
|
row = 0;
|
|
|
|
|
if (first_day > 0)
|
1998-09-27 18:32:00 +00:00
|
|
|
|
{
|
2005-05-11 19:16:19 +00:00
|
|
|
|
for (col = 0; col < first_day; col++)
|
|
|
|
|
{
|
|
|
|
|
calendar->day[row][col] = day;
|
|
|
|
|
calendar->day_month[row][col] = MONTH_PREV;
|
|
|
|
|
day++;
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
/* Compute days of current month */
|
|
|
|
|
col = first_day;
|
|
|
|
|
for (day = 1; day <= ndays_in_month; day++)
|
|
|
|
|
{
|
|
|
|
|
calendar->day[row][col] = day;
|
|
|
|
|
calendar->day_month[row][col] = MONTH_CURRENT;
|
2002-03-21 00:50:15 +00:00
|
|
|
|
|
2005-05-11 19:16:19 +00:00
|
|
|
|
col++;
|
|
|
|
|
if (col == 7)
|
2004-09-01 03:25:57 +00:00
|
|
|
|
{
|
2005-05-11 19:16:19 +00:00
|
|
|
|
row++;
|
|
|
|
|
col = 0;
|
2004-09-01 03:25:57 +00:00
|
|
|
|
}
|
2002-03-21 00:50:15 +00:00
|
|
|
|
}
|
2005-05-11 19:16:19 +00:00
|
|
|
|
|
|
|
|
|
/* Compute days of next month */
|
|
|
|
|
day = 1;
|
|
|
|
|
for (; row <= 5; row++)
|
2002-03-21 00:50:15 +00:00
|
|
|
|
{
|
2005-05-11 19:16:19 +00:00
|
|
|
|
for (; col <= 6; col++)
|
|
|
|
|
{
|
|
|
|
|
calendar->day[row][col] = day;
|
|
|
|
|
calendar->day_month[row][col] = MONTH_NEXT;
|
|
|
|
|
day++;
|
|
|
|
|
}
|
|
|
|
|
col = 0;
|
1998-09-27 18:32:00 +00:00
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
static void
|
2005-05-11 19:16:19 +00:00
|
|
|
|
calendar_select_and_focus_day (GtkCalendar *calendar,
|
|
|
|
|
guint day)
|
1998-09-27 18:32:00 +00:00
|
|
|
|
{
|
2005-05-11 19:16:19 +00:00
|
|
|
|
gint old_focus_row = calendar->focus_row;
|
|
|
|
|
gint old_focus_col = calendar->focus_col;
|
|
|
|
|
gint row;
|
|
|
|
|
gint col;
|
1998-10-01 13:24:42 +00:00
|
|
|
|
|
2005-05-11 19:16:19 +00:00
|
|
|
|
for (row = 0; row < 6; row ++)
|
|
|
|
|
for (col = 0; col < 7; col++)
|
|
|
|
|
{
|
|
|
|
|
if (calendar->day_month[row][col] == MONTH_CURRENT
|
|
|
|
|
&& calendar->day[row][col] == day)
|
|
|
|
|
{
|
|
|
|
|
calendar->focus_row = row;
|
|
|
|
|
calendar->focus_col = col;
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
if (old_focus_row != -1 && old_focus_col != -1)
|
|
|
|
|
calendar_invalidate_day (calendar, old_focus_row, old_focus_col);
|
1998-10-01 13:24:42 +00:00
|
|
|
|
|
2005-05-11 19:16:19 +00:00
|
|
|
|
gtk_calendar_select_day (calendar, day);
|
|
|
|
|
}
|
1998-10-04 23:07:04 +00:00
|
|
|
|
|
2005-05-11 19:16:19 +00:00
|
|
|
|
|
|
|
|
|
/****************************************
|
|
|
|
|
* Layout computation utilities *
|
|
|
|
|
****************************************/
|
|
|
|
|
|
|
|
|
|
static gint
|
|
|
|
|
calendar_row_height (GtkCalendar *calendar)
|
|
|
|
|
{
|
|
|
|
|
return (GTK_CALENDAR_GET_PRIVATE (calendar)->main_h - CALENDAR_MARGIN
|
|
|
|
|
- ((calendar->display_flags & GTK_CALENDAR_SHOW_DAY_NAMES)
|
|
|
|
|
? CALENDAR_YSEP : CALENDAR_MARGIN)) / 6;
|
1998-09-27 18:32:00 +00:00
|
|
|
|
}
|
|
|
|
|
|
2005-05-11 19:16:19 +00:00
|
|
|
|
|
|
|
|
|
/* calendar_left_x_for_column: returns the x coordinate
|
|
|
|
|
* for the left of the column */
|
|
|
|
|
static gint
|
|
|
|
|
calendar_left_x_for_column (GtkCalendar *calendar,
|
|
|
|
|
gint column)
|
1998-09-27 18:32:00 +00:00
|
|
|
|
{
|
2005-05-11 19:16:19 +00:00
|
|
|
|
gint width;
|
|
|
|
|
gint x_left;
|
1998-10-01 13:24:42 +00:00
|
|
|
|
|
2005-05-11 19:16:19 +00:00
|
|
|
|
if (gtk_widget_get_direction (GTK_WIDGET (calendar)) == GTK_TEXT_DIR_RTL)
|
|
|
|
|
column = 6 - column;
|
|
|
|
|
|
|
|
|
|
width = GTK_CALENDAR_GET_PRIVATE (calendar)->day_width;
|
|
|
|
|
if (calendar->display_flags & GTK_CALENDAR_SHOW_WEEK_NUMBERS)
|
|
|
|
|
x_left = CALENDAR_XSEP + (width + DAY_XSEP) * column;
|
|
|
|
|
else
|
|
|
|
|
x_left = CALENDAR_MARGIN + (width + DAY_XSEP) * column;
|
1998-10-01 13:24:42 +00:00
|
|
|
|
|
2005-05-11 19:16:19 +00:00
|
|
|
|
return x_left;
|
|
|
|
|
}
|
1998-10-04 23:07:04 +00:00
|
|
|
|
|
2005-05-11 19:16:19 +00:00
|
|
|
|
/* column_from_x: returns the column 0-6 that the
|
|
|
|
|
* x pixel of the xwindow is in */
|
|
|
|
|
static gint
|
|
|
|
|
calendar_column_from_x (GtkCalendar *calendar,
|
|
|
|
|
gint event_x)
|
|
|
|
|
{
|
|
|
|
|
gint c, column;
|
|
|
|
|
gint x_left, x_right;
|
|
|
|
|
|
|
|
|
|
column = -1;
|
|
|
|
|
|
|
|
|
|
for (c = 0; c < 7; c++)
|
1998-09-27 18:32:00 +00:00
|
|
|
|
{
|
2005-05-11 19:16:19 +00:00
|
|
|
|
x_left = calendar_left_x_for_column (calendar, c);
|
|
|
|
|
x_right = x_left + GTK_CALENDAR_GET_PRIVATE (calendar)->day_width;
|
1998-10-01 13:24:42 +00:00
|
|
|
|
|
2005-05-11 19:16:19 +00:00
|
|
|
|
if (event_x >= x_left && event_x < x_right)
|
|
|
|
|
{
|
|
|
|
|
column = c;
|
|
|
|
|
break;
|
|
|
|
|
}
|
1998-09-27 18:32:00 +00:00
|
|
|
|
}
|
2005-05-11 19:16:19 +00:00
|
|
|
|
|
|
|
|
|
return column;
|
1998-09-27 18:32:00 +00:00
|
|
|
|
}
|
|
|
|
|
|
2005-05-11 19:16:19 +00:00
|
|
|
|
/* calendar_top_y_for_row: returns the y coordinate
|
|
|
|
|
* for the top of the row */
|
|
|
|
|
static gint
|
|
|
|
|
calendar_top_y_for_row (GtkCalendar *calendar,
|
|
|
|
|
gint row)
|
1998-09-27 18:32:00 +00:00
|
|
|
|
{
|
1998-10-01 13:24:42 +00:00
|
|
|
|
|
2005-05-11 19:16:19 +00:00
|
|
|
|
return (GTK_CALENDAR_GET_PRIVATE (calendar)->main_h
|
|
|
|
|
- (CALENDAR_MARGIN + (6 - row)
|
|
|
|
|
* calendar_row_height (calendar)));
|
|
|
|
|
}
|
1998-10-04 23:07:04 +00:00
|
|
|
|
|
2005-05-11 19:16:19 +00:00
|
|
|
|
/* row_from_y: returns the row 0-5 that the
|
|
|
|
|
* y pixel of the xwindow is in */
|
|
|
|
|
static gint
|
|
|
|
|
calendar_row_from_y (GtkCalendar *calendar,
|
|
|
|
|
gint event_y)
|
|
|
|
|
{
|
|
|
|
|
gint r, row;
|
|
|
|
|
gint height;
|
|
|
|
|
gint y_top, y_bottom;
|
|
|
|
|
|
|
|
|
|
height = calendar_row_height (calendar);
|
|
|
|
|
row = -1;
|
|
|
|
|
|
|
|
|
|
for (r = 0; r < 6; r++)
|
1998-10-04 23:07:04 +00:00
|
|
|
|
{
|
2005-05-11 19:16:19 +00:00
|
|
|
|
y_top = calendar_top_y_for_row (calendar, r);
|
|
|
|
|
y_bottom = y_top + height;
|
|
|
|
|
|
|
|
|
|
if (event_y >= y_top && event_y < y_bottom)
|
|
|
|
|
{
|
|
|
|
|
row = r;
|
|
|
|
|
break;
|
|
|
|
|
}
|
1998-10-04 23:07:04 +00:00
|
|
|
|
}
|
2005-05-11 19:16:19 +00:00
|
|
|
|
|
|
|
|
|
return row;
|
1998-09-27 18:32:00 +00:00
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
static void
|
2005-05-11 19:16:19 +00:00
|
|
|
|
calendar_arrow_rectangle (GtkCalendar *calendar,
|
|
|
|
|
guint arrow,
|
|
|
|
|
GdkRectangle *rect)
|
1998-09-27 18:32:00 +00:00
|
|
|
|
{
|
2005-05-11 19:16:19 +00:00
|
|
|
|
GtkWidget *widget = GTK_WIDGET (calendar);
|
|
|
|
|
GtkCalendarPrivate *priv = GTK_CALENDAR_GET_PRIVATE (calendar);
|
|
|
|
|
gboolean year_left;
|
1998-10-04 23:07:04 +00:00
|
|
|
|
|
2005-05-11 19:16:19 +00:00
|
|
|
|
if (gtk_widget_get_direction (widget) == GTK_TEXT_DIR_LTR)
|
|
|
|
|
year_left = priv->year_before;
|
1998-09-27 18:32:00 +00:00
|
|
|
|
else
|
2005-05-11 19:16:19 +00:00
|
|
|
|
year_left = !priv->year_before;
|
|
|
|
|
|
|
|
|
|
rect->y = 3;
|
|
|
|
|
rect->width = priv->arrow_width;
|
|
|
|
|
rect->height = priv->header_h - 7;
|
|
|
|
|
|
|
|
|
|
switch (arrow)
|
1998-10-04 23:07:04 +00:00
|
|
|
|
{
|
2005-05-11 19:16:19 +00:00
|
|
|
|
case ARROW_MONTH_LEFT:
|
|
|
|
|
if (year_left)
|
|
|
|
|
rect->x = (widget->allocation.width - 2 * widget->style->xthickness
|
|
|
|
|
- (3 + 2*priv->arrow_width
|
|
|
|
|
+ priv->max_month_width));
|
|
|
|
|
else
|
|
|
|
|
rect->x = 3;
|
|
|
|
|
break;
|
|
|
|
|
case ARROW_MONTH_RIGHT:
|
|
|
|
|
if (year_left)
|
|
|
|
|
rect->x = (widget->allocation.width - 2 * widget->style->xthickness
|
|
|
|
|
- 3 - priv->arrow_width);
|
|
|
|
|
else
|
|
|
|
|
rect->x = (priv->arrow_width
|
|
|
|
|
+ priv->max_month_width);
|
|
|
|
|
break;
|
|
|
|
|
case ARROW_YEAR_LEFT:
|
|
|
|
|
if (year_left)
|
|
|
|
|
rect->x = 3;
|
|
|
|
|
else
|
|
|
|
|
rect->x = (widget->allocation.width - 2 * widget->style->xthickness
|
|
|
|
|
- (3 + 2*priv->arrow_width
|
|
|
|
|
+ priv->max_year_width));
|
|
|
|
|
break;
|
|
|
|
|
case ARROW_YEAR_RIGHT:
|
|
|
|
|
if (year_left)
|
|
|
|
|
rect->x = (priv->arrow_width
|
|
|
|
|
+ priv->max_year_width);
|
|
|
|
|
else
|
|
|
|
|
rect->x = (widget->allocation.width - 2 * widget->style->xthickness
|
|
|
|
|
- 3 - priv->arrow_width);
|
|
|
|
|
break;
|
1998-10-04 23:07:04 +00:00
|
|
|
|
}
|
1998-09-27 18:32:00 +00:00
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
static void
|
2005-05-11 19:16:19 +00:00
|
|
|
|
calendar_day_rectangle (GtkCalendar *calendar,
|
|
|
|
|
gint row,
|
|
|
|
|
gint col,
|
|
|
|
|
GdkRectangle *rect)
|
1998-09-27 18:32:00 +00:00
|
|
|
|
{
|
2005-05-11 19:16:19 +00:00
|
|
|
|
GtkCalendarPrivate *priv = GTK_CALENDAR_GET_PRIVATE (calendar);
|
1998-10-05 03:52:48 +00:00
|
|
|
|
|
2005-05-11 19:16:19 +00:00
|
|
|
|
rect->x = calendar_left_x_for_column (calendar, col);
|
|
|
|
|
rect->y = calendar_top_y_for_row (calendar, row);
|
|
|
|
|
rect->height = calendar_row_height (calendar);
|
|
|
|
|
rect->width = priv->day_width;
|
1998-09-27 18:32:00 +00:00
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
static void
|
2005-05-11 19:16:19 +00:00
|
|
|
|
calendar_set_month_prev (GtkCalendar *calendar)
|
1998-09-27 18:32:00 +00:00
|
|
|
|
{
|
2005-05-11 19:16:19 +00:00
|
|
|
|
gint month_len;
|
1998-10-01 13:24:42 +00:00
|
|
|
|
|
2005-05-11 19:16:19 +00:00
|
|
|
|
if (calendar->display_flags & GTK_CALENDAR_NO_MONTH_CHANGE)
|
|
|
|
|
return;
|
1998-10-01 13:24:42 +00:00
|
|
|
|
|
2005-05-11 19:16:19 +00:00
|
|
|
|
if (calendar->month == 0)
|
1998-09-27 18:32:00 +00:00
|
|
|
|
{
|
2005-05-11 19:16:19 +00:00
|
|
|
|
calendar->month = 11;
|
|
|
|
|
calendar->year--;
|
|
|
|
|
}
|
|
|
|
|
else
|
|
|
|
|
calendar->month--;
|
1998-10-01 13:24:42 +00:00
|
|
|
|
|
2005-05-11 19:16:19 +00:00
|
|
|
|
month_len = month_length[leap (calendar->year)][calendar->month + 1];
|
|
|
|
|
|
|
|
|
|
calendar_compute_days (calendar);
|
|
|
|
|
|
|
|
|
|
g_signal_emit (calendar,
|
|
|
|
|
gtk_calendar_signals[PREV_MONTH_SIGNAL],
|
|
|
|
|
0);
|
|
|
|
|
g_signal_emit (calendar,
|
|
|
|
|
gtk_calendar_signals[MONTH_CHANGED_SIGNAL],
|
|
|
|
|
0);
|
1998-10-01 13:24:42 +00:00
|
|
|
|
|
2005-05-11 19:16:19 +00:00
|
|
|
|
if (month_len < calendar->selected_day)
|
1998-09-27 18:32:00 +00:00
|
|
|
|
{
|
2005-05-11 19:16:19 +00:00
|
|
|
|
calendar->selected_day = 0;
|
|
|
|
|
gtk_calendar_select_day (calendar, month_len);
|
1998-09-27 18:32:00 +00:00
|
|
|
|
}
|
2005-05-11 19:16:19 +00:00
|
|
|
|
else
|
2000-11-18 16:48:39 +00:00
|
|
|
|
{
|
2005-05-11 19:16:19 +00:00
|
|
|
|
if (calendar->selected_day < 0)
|
|
|
|
|
calendar->selected_day = calendar->selected_day + 1 + month_length[leap (calendar->year)][calendar->month + 1];
|
|
|
|
|
gtk_calendar_select_day (calendar, calendar->selected_day);
|
2000-11-18 16:48:39 +00:00
|
|
|
|
}
|
2005-05-11 19:16:19 +00:00
|
|
|
|
|
2007-12-28 09:26:38 +00:00
|
|
|
|
calendar_queue_refresh (calendar);
|
1998-09-27 18:32:00 +00:00
|
|
|
|
}
|
|
|
|
|
|
2005-05-11 19:16:19 +00:00
|
|
|
|
|
|
|
|
|
/****************************************
|
|
|
|
|
* Basic object methods *
|
|
|
|
|
****************************************/
|
|
|
|
|
|
1998-09-27 18:32:00 +00:00
|
|
|
|
static void
|
2005-05-11 19:16:19 +00:00
|
|
|
|
gtk_calendar_finalize (GObject *object)
|
1998-09-27 18:32:00 +00:00
|
|
|
|
{
|
2005-05-11 19:16:19 +00:00
|
|
|
|
(* G_OBJECT_CLASS (gtk_calendar_parent_class)->finalize) (object);
|
|
|
|
|
}
|
1998-10-04 23:07:04 +00:00
|
|
|
|
|
2005-05-11 19:16:19 +00:00
|
|
|
|
static void
|
|
|
|
|
gtk_calendar_destroy (GtkObject *object)
|
|
|
|
|
{
|
2007-12-27 20:41:08 +00:00
|
|
|
|
GtkCalendarPrivate *priv = GTK_CALENDAR_GET_PRIVATE (object);
|
|
|
|
|
|
2005-05-11 19:16:19 +00:00
|
|
|
|
calendar_stop_spinning (GTK_CALENDAR (object));
|
1998-10-01 13:24:42 +00:00
|
|
|
|
|
2007-12-27 20:41:08 +00:00
|
|
|
|
/* Call the destroy function for the extra display callback: */
|
|
|
|
|
if (priv->detail_func_destroy && priv->detail_func_user_data)
|
|
|
|
|
{
|
|
|
|
|
priv->detail_func_destroy (priv->detail_func_user_data);
|
|
|
|
|
priv->detail_func_user_data = NULL;
|
|
|
|
|
priv->detail_func_destroy = NULL;
|
|
|
|
|
}
|
|
|
|
|
|
2005-05-11 19:16:19 +00:00
|
|
|
|
GTK_OBJECT_CLASS (gtk_calendar_parent_class)->destroy (object);
|
|
|
|
|
}
|
Remove all references to offscreen flag which was no longer used.
Thu Jun 1 23:05:13 2000 Owen Taylor <otaylor@redhat.com>
* gtk/gtkwidget.c: Remove all references to
offscreen flag which was no longer used.
* gtk/gtkprivate.h (enum): Remove unused flags and compress.
* gtk/gtkframe.c (gtk_frame_set_label_widget): Check
for non-null label_widget->parent.
* gtk/gtkentry.c: Get rid of code to deal with PangoAttribute
which no longer was used.
* gdk/gdkpango.c (gdk_pango_context_get_info): make static.
* gdk/gdkpango.c (gdk_draw_layout[_line]): Add checks
for null arguments.
* gdk/x11/gdkgeometry-x11.c (gdk_window_scroll): add
check for destroyed windows.
Thu Jun 1 13:48:45 2000 Owen Taylor <otaylor@redhat.com>
* gtk/gtkimmulticontext.c: Add a finalize method and unref
the slave context there.
* gtk/gtkinvisible.[ch]: Make reference counting behavior
identical to GtkWindow.
Thu Jun 1 01:54:11 2000 Owen Taylor <otaylor@redhat.com>
* Makefile.am gdk/gdkpango.c: Copy the layout render function from
pangox to here, so we can write them independent of rendering
system, using GDK primitives.
* gdk/gdkdrawable.h gdk/gdkdraw.c gdk/gdkwindow.c
gdk/x11/gdkdrawable-x11.c: Remove draw_layout() from the vtable,
since we have a rendering-system independent implementation in
terms of draw_glyphs().
* gdk/gdkpango.c gdkdrawable.h (gdk_draw_layout_line): New
function to render a single line.
* gdk/x11/gdkpango.c: Move the guts of this file mostly
into ../gdkpango.c, which simplifies things, since we
don't have to deal with raw X gc's.
Fri May 19 04:28:16 2000 Owen Taylor <otaylor@redhat.com>
* gtk/gtktextlayout.[ch]: Add get_log_attrs() function to
get the logical attributes for a given GtkTextLine.
Tue May 30 16:05:39 2000 Owen Taylor <otaylor@redhat.com>
* gdk/x11/gdkfont-x11.c (gdk_font_charset_for_locale): Track
g_locale_get_codeset() to g_get_codeset() change.
Tue May 30 15:03:19 2000 Owen Taylor <otaylor@redhat.com>
* gtk/testcalendar.c (calendar_font_selection_ok): Use font
descriptions.
* gtk/gtkentry.c (gtk_entry_draw_text): Center text within
the entry.
* gtk/gtkfontsel.c (gtk_font_selection_dialog_init): Start of
redoing (vastly simplifying) for Pango. Still needs quite
a bit of work. (Size selection is currently poor. List of
predefined sizes is not a good idea, since all of these
sizes won't necessarily be distinct.)
Tue May 30 13:50:19 2000 Owen Taylor <otaylor@redhat.com>
* gdk/x11/gdkfont-x11.c (gdk_font_charset_for_locale): Handle
CODESET results for LANG=C.
Mon May 29 15:49:10 2000 Owen Taylor <otaylor@redhat.com>
* gtk/gtkrc.[ch]: Add a 'font_name' declaration to RC
which takes a stringized pango font description;
ignore the older 'font' and 'fontset' declarations.
* gtk/gtkstyle.c gtk/gtkrc.c: Fill in the style->font
field with a GdkFont derived via gdk_font_from_description(),
for compatibility. (Should we just remove it entirely?
Probably too much compatibility breakage, but people
should be migrating to the new Pango stuff as quickly
as possible.)
Mon May 29 15:47:41 2000 Owen Taylor <otaylor@redhat.com>
* gtk/gtkentry.c gtk/gtkclist.c: s/pango_font_unref/g_object_unref/.
Mon May 29 15:44:46 2000 Owen Taylor <otaylor@redhat.com>
* gtk/gtkcalender.c: Roughly pango-ized. Really needs
redoing; there are some bugs in size allocation right
now, the semi-existant distinction between header / day
fonts was removed, but, with Pango, could actually
be made functional in a nice way.
* gtk/testcalender: Move calender from examples into this
directory as a test program. (We really need to restrcture
testgtk into a whole directory full of tests for every
widget or functionality group, separated into multiple .c
files.)
Mon May 29 15:19:56 2000 Owen Taylor <otaylor@redhat.com>
* gtk/testgtk.c (file_exists): Fix stupid typo that
was keeping RC file from being loaded.
* gtk/testgtkrc gtk/testgtkrc2: Test new pango-ized
RC file font code.
Mon May 29 14:31:27 2000 Owen Taylor <otaylor@redhat.com>
* gdk/gdkfont.h gdk/x11/gdkfont-x11.c (gdk_font_from_description):
Add function to load a GdkFont from a PangoFontDescription.
Fri May 26 17:16:40 2000 Owen Taylor <otaylor@redhat.com>
* gtk/frame.[ch] gtkaspectframe.c: Make frame widgets able
to have any widget for the label, use a GtkLabel widget
to display the text. (Based partially on a patch from
Anders Carlson.)
(Quite a bit of code reorganization - strip 90% of the
guts out of gtkaspectframe and add a single virtual
func to GtkFrameClass - compute_child_allocation.)
Fri May 26 12:00:02 2000 Owen Taylor <otaylor@redhat.com>
* gtk/gtkctree.c gtk/gtkclist.[ch]: Pangoized.
(Removed clist->row_center_offset field because caching
it wasn't saving time or code, added private function
_gtk_clist_create_cell_layout()).
Wed May 24 15:59:37 2000 Owen Taylor <otaylor@redhat.com>
* gtk/gtkaccellabel.c: Pangoized.
* gtk/[hv]ruler.c: Pangoized
Mon May 22 19:23:59 2000 Owen Taylor <otaylor@redhat.com>
* gtk/gtkfilesel.c (gtk_file_selection_init):
Use gtk_clist_set_column_auto_resize() to remove need
need for manual column width computations.
Mon May 22 18:50:26 2000 Owen Taylor <otaylor@redhat.com>
* gtk/gtktooltips.[ch]: Replace custom drawing with a GtkLabel,
ensuring Pango correctness, and considerably simplifying the
code.
* gtk/gtklabel.c gtk[hv]scale.c: 1000 => PANGO_SCALE.
* gtk/gtklabel.c (gtk_label_size_request): Fixed incorrect
getting of numbers of lines.
* gtk/gtklabel.c (gtk_label_size_request): Set the requisition
to the actual requested width of the lable, not to the wrap
width we set.
* gtk/gtktextchild.h: Remove extraneous include of gtk/gtk.h.
* gtk/gtktextbtree.c gtk/gtktextbuffer.c gtk/gtktextlayout.c
gtk/gtktextview.c gtk/gtktextview.[ch]: Fix up includes.
* gtk/gtktextview.c: Fix structure inheritance.
* gtk/gtkprogressbar.c: Pangoize.
Mon May 22 15:47:30 2000 Owen Taylor <otaylor@redhat.com>
* gtk/gtktextview.c (gtk_text_view_get_first_para_iter): Encapsulate
in a function.
* gtk/gtktextlayout.c (find_display_line_above): Fixed
bug with computing line tops.
* gtk/gtktextview.c (changed_handler): Fix < , <= confusion.
Thu May 18 18:53:31 2000 Owen Taylor <otaylor@redhat.com>
* gtk/gtktextdisplay.c (gtk_text_layout_draw): Fix up the x_offset
and y_offset coordinates to do what we need now. (The offset between
buffer and layout coordinates has been reintroduced, but is a
bit different than before.)
* gtk/gtktextview.[ch]: No longer inherit from GtkLayout; instead
handle the adjustments ourselves, and scroll as necessary using
the new gdk_window_scroll().
The advantage of this is that when we are incrementally revalidating,
we are essentially rearranging things around the visible portion
of the screen. With the old setup, the visible portion of the
screen was moved around in the layout, so scrolling and redrawing
to track that caused jumping of the display. Since we now
control the scrolling ourselves, we can suppress this and
only redraw when things actually change.
Thu May 18 18:47:25 2000 Owen Taylor <otaylor@redhat.com>
* gtk/gtktextbtree.c (redisplay_mark): We need to invalidate
the region not just redisplay it after-all, since we store the
cursors in the LineDisplay. (Ugly interactions here between
GtkLayout and GtkTextBTree here.)
* gtk/gtktextbtree.c (redisplay_region): Fixed reversed comparison.
Thu May 18 18:43:21 2000 Owen Taylor <otaylor@redhat.com>
* gdk/gdkwindow.h gdk/x11/gdkgeometry-x11.c (gdk_window_scroll):
Added function to scroll contents of a window while keeping the
window constant. Works by XCopyArea or guffaw-scrolling depending
on the details of how the window is set up. (guffaw-scrolling
still needs to be filled in.)
Wed May 17 22:36:53 2000 Owen Taylor <otaylor@redhat.com>
* gtk/gtktextiter.c gtk/gtkmain.c: Add a debug key for the text widget,
move the debugging that was tied to a global variable
to that.
* gtk/gtkmarshal.list: Add NONE:INT,INT,INT
* gtk/gtktextbtree.[ch] gtk/gtktextlayout.c: Keep a separate
validated flag, in line data instead of setting height/width to
-1. This allows us to perform operations with partially invalid
buffer (using the old size for invalid lines) and thus to do
incremental vaidation. Keep height/width aggregates up to date
when deleting text and rebalancing the tree.
* gtk/gtktextbtree.[ch]: Add functions validate a line
(gtk_text_btree_validate_line), and to validate up
to a number of pixels (gtk_text_btree_validate).
* gtk/gtktextlayout.[ch]: Add an ::invalidated signal
that indicates that something is changed and a revalidation
pass is needed. Change ::need_repaint to ::changed, and
make it take old and new yranges instead of a rectangle.
* gtk/gtktextbtree.[ch] gtk/gtktextlayout.[ch]: Move
the line_data_destroy() function from
gtk_text_btree_add_view() to a virtual function in
GtkTextLayout
* gtk/gtktextbtree.[ch]: Remove gtk_text_btree_get_damage_range(),
since we are handling partial repaints in a different fashion
now.
* gtk/gtktextbtree.[ch]: Only repaint the changed portion
of the selection instead of queueing a repaint on the
entire widget.
* gtk/gtktextbuffer.[ch] gtk/gtktextbtree.[ch]: Move
get_selection_bounds() down to btree, make the function
in buffer a wrapper around the btree function.
* gtk/gtktextlayout.[ch]: Add functions to check if the
layout is valid and to recompute either a range of pixels
aroudn a line or a certain total number of pixels.
* gtk/gtktextlayout.[ch]: Cache a single line display;
now that we only redraw the needed portions, the hit rate
for this cache is quite high.
* gtk/gtktextview.[ch]: Keep track of the first paragraph
on the screen so that when re-laying-out the buffer, we can
keep the same place. This requires connecting to ::value_changed
on the adjustments
* gtk/gtktextview.[ch]: Add idle functions to revalidate
the buffer after we receive an ::invalidated signal.
Wed May 17 22:10:47 2000 Owen Taylor <otaylor@redhat.com>
* gtk/gtklayout.c (gtk_layout_size_allocate): Set upper
to max of allocation and layout size, not just to the
layout size.
* gtk/gtk[hv]scrollbar.c (gtk_[hv]scrollbar_calc_slider_size):
Invalidate window so it gets redrawn properly.
* gdk/gdkwindow.c (gdk_window_invalidate_rect): Allow rect == NULL
to mean the entire window.
* gdk/gdkevents.h: Move definition for GDK_PRIORITY_REDRAW
into public header.
Mon May 15 14:51:31 2000 Owen Taylor <otaylor@redhat.com>
* gtk/gtktextmark.c (gtk_text_mark_get_name): Add function
to get the name of a mark.
* gtk/gtktextlayout.c (gtk_text_layout_get_line_at_y): Add a function
to find the paragraph from a y position.
Thu May 11 12:57:20 2000 Owen Taylor <otaylor@redhat.com>
* gtk/gtktextbtree.c (gtk_text_btree_node_invalidate_upward): Valid
nodes have width/height >= 0, not > 0.
Tue May 9 21:29:06 2000 Owen Taylor <otaylor@redhat.com>
* gtk/gtktextlayout.[ch] gtk/gtktextdisplay.c (gtk_text_layout_get_line_display):
Add a size_only flag, so when we only need the size, we don't create
useless appearance attributes.
* gtk/gtktextview.c (gtk_text_view_ensure_layout): Remove
duplicate setting of font description.
* gtk/gtkscale.c: Use PANGO_SCALE instead of 1000
Wed Apr 26 01:53:23 2000 Owen Taylor <otaylor@redhat.com>
* gtk/Makefile.am (EXTRA_DIST): Add OLD_STAMP into
EXTRA_DIST. It does not work well when the file that
everything depends on is not in the tarball.
Wed Apr 26 00:56:14 2000 Owen Taylor <otaylor@redhat.com>
* gtk/testgtk.c: Some hacks and fixes so that it basically
works when not sitting in the GTK+ build tree.
2000-05-03 Havoc Pennington <hp@redhat.com>
* gtk/gtktextbtree.c (gtk_text_line_next_could_contain_tag):
Properly determine the ordering of the tag root and the current
line within the tree. Previous algorithm only worked if the tag
root's immediate parent was the common root of both the current
line and the tag root.
Wed Apr 26 00:43:00 2000 Owen Taylor <otaylor@redhat.com>
* gtk/gtktextlayout.c (set_para_values): Fix some bugs in
alignment.
* gtk/gtktextview.c (gtk_text_view_ensure_layout): Track
the widget text directional dynamically.
* gtk/gtktextview.[ch]: Added functions to get and set default
wrap mode.
Tue Apr 25 23:47:38 2000 Owen Taylor <otaylor@redhat.com>
* gtk/gtktextlayout.c (gtk_text_layout_get_iter_location): Fix bug
in cursor location computation.
Tue Apr 25 23:22:59 2000 Owen Taylor <otaylor@redhat.com>
* gtk/gtklayout.c (gtk_layout_set_size): Clamp hadjustment/
vadjusment values properly when layout gets smaller.
* gtk/gtktextview.c (need_repaint_handler): Areas being
passed in are far completely inaccurate, and sometimes
too small, so, for now, just queue a redraw on the
whole visible region.
2000-04-25 Havoc Pennington <hp@redhat.com>
* gtk/gtktextbtree.c (summary_destroy): new function to
destroy tag summary nodes
(gtk_text_line_next_could_contain_tag): this function was
totally broken if the line passed in wasn't below the tag
root. Fix it.
(gtk_text_btree_first_could_contain_tag): In the tag == NULL
"wildcard" case, we have to do a linear scan. Blah.
(gtk_text_btree_last_could_contain_tag): In tag == NULL case,
we have to do the linear scan
(tag_removed_cb): When a tag is removed from the tag table,
remove the GtkTextTagInfo node from the btree.
(gtk_text_btree_spew): Implement the spew function, for
our debugging pleasure.
Tue Apr 25 19:40:18 2000 Owen Taylor <otaylor@redhat.com>
* gtk/gtktextlayout.c (gtk_text_layout_set_buffer): Fix
a problem with referring to the wrong buffer.
* gtk/gtkentry.c: Fix focus-in/focus-out confusion.
* gtk/gtkrc.c gtk/gtkstyle.c: Moving setting default
font description to gtk_style_new() - otherwise things
don't work without a .gtkrc file.
* gtk/gtktextbuffer.c (gtk_text_buffer_new): Sink the
tags table if we create it ourself, too.
* gdk/gdktypes.h (enum): Move GDK_RELEASE_MASK, since
it was conflicting with XKB modifiers.
* gtk/gtktextview.[ch]: Add simple support for
GtkIMContext.
Mon Apr 24 19:34:18 2000 Owen Taylor <otaylor@redhat.com>
* gtk/gtkentry.c (gtk_entry_move_cursor_visually): Fix problem
with deletion from last commit.
Mon Apr 24 19:29:40 2000 Owen Taylor <otaylor@redhat.com>
* gtk/gtkwidget.c (gtk_widget_create_pango_context): Set the language
in the context from the current locale.
* gtk/gtkentry.c (gtk_entry_size_request): Use language from the
context, not hardcoded value.
* gtk/gtkentry.c (gtk_entry_move_cursor): Make character movement visual,
not logical.
Sun Apr 23 23:39:18 2000 Owen Taylor <otaylor@redhat.com>
* gtk/gtkentry.c gtk/gtktextdisplay.c: Don't handle selections as
attributes - that doesn't handle partial-glyph selection
properly. Instead use new pango_layout_line_get_x_ranges()
functionality to draw the selection.
* gtk/gtkentry.c: Simplify code since pango_layout_line_index_to_x()
now properly handles out-of-range coordinates.
* gtk/gtktextbuffer.c: Emit "mark_set" when the cursor is moved.
* gtk/gtktextiter.h gtk/gtktextiterprivate.h: Make gtk_text_iter_get_line_byte()
public.
* gtk/gtktextlayout.[ch]: Properly set the direction in the PangoContext
for paragraphs opposite to the base direction of the widget.
* gtk/gtktextlayout.[ch] gtk/gtktextdisplay.c: Fixes for alignment.
* gtk/gtktextlayout.c: Don't split segments on marks, since that
causes Arabic words to reshape as you cursor through.
* gtk/gtktextlayout.[ch] gtk/gtktextview.[ch]: Implement virtual
cursor position when moving vertically with the arrow keys and
scrolling with page-up/page-down. (Arrow keys save only the X,
scrolling saves both X and Y.)
This means you can line-up / line-down or page-up / page-down
without losing your place, and also that moving vertically
with the cursor keys keeps the same X position, not the same
character count:
* gtk/gtktextlayout.[ch] gtk/gtktextview.[ch]: Make vertical
arrow keys move by display lines, not paragraphs.
Tue Apr 18 14:16:50 2000 Owen Taylor <otaylor@redhat.com>
* gtk/gtklayout.c: Make sure that the bin window is at least
as big as the allocation. (Should we also make sure that the
bin window is big enough to completely cover widget->window?)
* gtk/gtktextview.c (gtk_text_view_get_visible_rect): Add
function to get the onscreen rectangle.
* gdk/x11/gdkwindow-x11.c (gdk_window_get_pointer): Correctly account
for offsets in window coordinates.
Sun Apr 16 16:13:27 2000 Owen Taylor <otaylor@redhat.com>
* gtk/gtkentry.c (gtk_entry_get_cursor_locations): Fix index/offset
confusion.
* gtk/gtktextview.c (gtk_text_view_ensure_layout): Set the default direction
from the widget direction.
* gtk/gtktexttag.c gtk/gtktexttagprivate.h (gtk_text_tag_set_arg):
Add a "direction" attribute.
* gtk/gtktextview.c: global s/tkxt/text_view/.
* gtk/testtext.c: Added long block of text in Arabic, to test out
the direction attributes. (Some problems with the shaping system
for arabic become obvious - like the fact the cursor splits words
into unjoined pieces.)
Fri Apr 14 12:54:34 2000 Owen Taylor <otaylor@redhat.com>
* gtk/gtktextdisplay.c (render_layout): Add overstrike handling.
* gtk/gtktextlayout.c: Fix up alignment.
* gtk/testtext.c: Add some tests for centering, wrapping.
Fri Apr 14 09:26:22 2000 Owen Taylor <otaylor@redhat.com>
* gdk/gdkdrawable.h gdk/gdkdraw.c gdk/gdkwindow.c gdk/x11/gdkdrawable-x11.c:
Add a draw_glyphs() operation to the drawable vtable and gdk_draw_glyphs().
If we wrote GTK+-specific layout-render function this could just replace
the draw_layout() operation in the vtable.
* gtk/gtkentry.c: Move guts of gtk_entry_get_cursor_locations to
pango_layout_get_cursor_pos() and use that function.
* gtk/gtktextchild.[ch]: add gtk_ onto pixmap_segment_new(), since it
is a non-static symbol.
* gtk/gtktextbtree.[ch]: Replace gtk_text_btree_find_line_data_by_y()
with gtk_text_btree_find_line_by_y()
* gtk/gtktextdisplay.c: Rewrote for Pango - uses a custom layout
renderer that handles GtkTextAppearance attributes.
* gtk/gtktexttag.[ch] gtk/gtktexttagprivate.h:
- Move the values in the style that don't affect geometry into a
GtkTextAppearance structure.
- Change underline to take a PangoUnderline and "font" a string
representation of a font description
- Add a "font_desc" attribute which takes a FontDescription structure.
* gtk/gtktextlayout.[ch]:
- Get rid of the display-line list per each line. Instead, we
generate, on demand, a GtkTextLineDisplay structure which]
contains a PangoLayout * and other necesary information
(offsets, cursor locations) for displaying a paragraph.
- Get rid of the code to wrap lines, create display chunks,
etc. Instead, we just go through a paragraph and convert
it into the necessary inputs to a PangoLayout.
- Implement a new attribute type, GtkTextAttrAppearance. This
holds a GtkTextAppearance, and is used to pass colors,
stipple, etc, through from the layout to the display without
having to use lots and lots of individual attributes.
- Reimplement gtk_layout_get_iter_at_pixel() gtk_layout_get_iter_pos()
in terms of PangoLayout functions.
* gtk/gtktextview.c:
- Handle passing the necessary PangoContext to the layout
- Some fixups in painting to deal with the automatic backing store
and offsetting of GTK+-1.4
- Add a style_set handler so that the default style reacts
properly to theme changes.
* gtk/gtktext?*.[ch]: Random code-style fixes.
* gtk/testtext.c: Substitute in languages that Pango handles now for Thai
Mon Apr 10 10:33:45 2000 Owen Taylor <otaylor@redhat.com>
* gtk/gtktext?*.[ch]: Check in Havoc's port of the Tk text widget,
in original form preparatory to Pango-ization and gdkimcontext-ization.
Thu Apr 6 19:25:39 2000 Owen Taylor <otaylor@redhat.com>
* gtk/gtkimcontext.c: Move default implementations to real_* vfuncs,
so that we can derive from gtkimcontext in language bindings properly.
Thu Apr 6 16:02:52 2000 Owen Taylor <otaylor@redhat.com>
* gtk/gtkimcontextsimple.[ch]: Use gdk_keyval_to_unicode to gdk_unicode_to_keyval.
Add a compose table including (almost) all the compose combinations
from X. This is 6k of static, shared data as opposed to 50k or so of dynamic
data in the XIM implementation.
* gdk/gdk.h gdk/gdkkeyuni.c gdk/win32/gdkevents-win32.c (gdk_keyval_to_unicode, gdk_unicode_to_keyval):
Moved functions to convert keyvalues from and to unicode here from
the win32 port and made them public.
Wed Apr 5 16:37:29 2000 Owen Taylor <otaylor@redhat.com>
* gtk/gtkeditable.c (gtk_editable_insert_text): Allow new_text_length == -1.
Wed Apr 5 16:27:45 2000 Owen Taylor <otaylor@redhat.com>
* gtk/gtkimcontext.[ch]: Base class for new input context system
* gtk/gtkimmulticontext.[ch]: Proxy input context that allows
the real input context implementation to be loaded from modules
and switched on the fly.
* gtk/gtkcontextsimple.[ch]: Simple implementation of an input
context that just does direct keysymbol => unicode translation.
* gtk/gtkentry.[ch]: Start switching editing over to using
GtkInputContext. (No handling of preedit yet.)
Wed Apr 5 15:48:41 2000 Owen Taylor <otaylor@redhat.com>
* gtk/gtktypeutils.h (GTK_CHECK_GET_CLASS): Fix problem with one too
many substitutions. (klass should not be subsituted.)
Wed Apr 5 00:18:14 2000 Owen Taylor <otaylor@redhat.com>
* configure.in: Add checks for Pango
* configure.in docs/Makefile.am: Add test for sgml2html
and allow 'make dist' without building html, but print out
warnings in that case. (For making snapshots)
* gdk/Makefile.am gdk/x11/Makefile.am gtk/Makefile.am:
Add Pango libraries and C flags
* gdk/gdkdraw.c gdk/gdkdrawable.h gdkwindow.c gdk/x11/gdkdrawable-x11.c:
Add function (gdk_draw_layout) to draw a pango layout.
* gdk/gdkpango.h gdk/x11/gdkpango-x11.c: New file with functions
for getting Pango contexts for GDK.
* gtk/gtkeditable.c: Get rid of dead code gtk_editable_parent_set()
* gtk/gtkentry.[ch]: Complete rewrite to use Pango, add bidirectional
editing.
* gtk/gtkentry.c: Hack in simple Hebrew input with direct
keysym => unicode translations. More languages can be added
here, but real input-method support is needed.
* docs/Changes-1.4.txt: Added note about entry behavior.
* gtk/gtkenums.h gtk/gtkwidget.[ch] testgtk.c gtkprivate.h: Add functions
to set the reading direction for a widget and the global direction.
Add test which allows toggling the global direction. Two private
flags are used to store the direction. (GTK_DIRECTION_SET + GTK_DIRECTION_LTR)
* gtk/gtkcheckbutton.c gtk/gtkframe.c gtk/gtkhbbox.c gtk/gtkhbox.c
gtk/gtkradiobutton.c gtk/gtkspinbutton.c gtk/gtktable.c
* gtk/gtk[hv]scale.c gtk/gtkscale.[ch]: Draw numbers using Pango
* gtk/gtklabel.[ch]: Moved to Pango and considerably rewritten. Line breaking,
underlining now handled by Pango.
* gtk/gtkstyle.[ch] gtk/gtkrc.[ch]: Add a PangoFontDescription
to RCStyle and Style. (Having both this and the old font name and GdkFont
is temporary.)
* gtk/gtkwidget.[ch] (gtk_widget_create_pango_{context,layout}): Added
convenience functions for creating contexts and layouts for widgets.
* gtk/testgtk.c: Enhance label tests with multilingual labels.
2000-06-02 03:14:07 +00:00
|
|
|
|
|
2005-05-11 19:16:19 +00:00
|
|
|
|
|
|
|
|
|
static void
|
|
|
|
|
calendar_set_display_option (GtkCalendar *calendar,
|
|
|
|
|
GtkCalendarDisplayOptions flag,
|
|
|
|
|
gboolean setting)
|
|
|
|
|
{
|
|
|
|
|
GtkCalendarDisplayOptions flags;
|
|
|
|
|
if (setting)
|
|
|
|
|
flags = calendar->display_flags | flag;
|
|
|
|
|
else
|
|
|
|
|
flags = calendar->display_flags & ~flag;
|
|
|
|
|
gtk_calendar_display_options (calendar, flags);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
static gboolean
|
|
|
|
|
calendar_get_display_option (GtkCalendar *calendar,
|
|
|
|
|
GtkCalendarDisplayOptions flag)
|
|
|
|
|
{
|
|
|
|
|
return (calendar->display_flags & flag) != 0;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
static void
|
|
|
|
|
gtk_calendar_set_property (GObject *object,
|
|
|
|
|
guint prop_id,
|
|
|
|
|
const GValue *value,
|
|
|
|
|
GParamSpec *pspec)
|
|
|
|
|
{
|
|
|
|
|
GtkCalendar *calendar;
|
|
|
|
|
|
|
|
|
|
calendar = GTK_CALENDAR (object);
|
|
|
|
|
|
|
|
|
|
switch (prop_id)
|
|
|
|
|
{
|
|
|
|
|
case PROP_YEAR:
|
|
|
|
|
gtk_calendar_select_month (calendar,
|
|
|
|
|
calendar->month,
|
|
|
|
|
g_value_get_int (value));
|
|
|
|
|
break;
|
|
|
|
|
case PROP_MONTH:
|
|
|
|
|
gtk_calendar_select_month (calendar,
|
|
|
|
|
g_value_get_int (value),
|
|
|
|
|
calendar->year);
|
|
|
|
|
break;
|
|
|
|
|
case PROP_DAY:
|
|
|
|
|
gtk_calendar_select_day (calendar,
|
|
|
|
|
g_value_get_int (value));
|
|
|
|
|
break;
|
|
|
|
|
case PROP_SHOW_HEADING:
|
|
|
|
|
calendar_set_display_option (calendar,
|
|
|
|
|
GTK_CALENDAR_SHOW_HEADING,
|
|
|
|
|
g_value_get_boolean (value));
|
|
|
|
|
break;
|
|
|
|
|
case PROP_SHOW_DAY_NAMES:
|
|
|
|
|
calendar_set_display_option (calendar,
|
|
|
|
|
GTK_CALENDAR_SHOW_DAY_NAMES,
|
|
|
|
|
g_value_get_boolean (value));
|
|
|
|
|
break;
|
|
|
|
|
case PROP_NO_MONTH_CHANGE:
|
|
|
|
|
calendar_set_display_option (calendar,
|
|
|
|
|
GTK_CALENDAR_NO_MONTH_CHANGE,
|
|
|
|
|
g_value_get_boolean (value));
|
|
|
|
|
break;
|
|
|
|
|
case PROP_SHOW_WEEK_NUMBERS:
|
|
|
|
|
calendar_set_display_option (calendar,
|
|
|
|
|
GTK_CALENDAR_SHOW_WEEK_NUMBERS,
|
|
|
|
|
g_value_get_boolean (value));
|
|
|
|
|
break;
|
2007-12-28 09:39:34 +00:00
|
|
|
|
case PROP_SHOW_DETAILS:
|
|
|
|
|
calendar_set_display_option (calendar,
|
|
|
|
|
GTK_CALENDAR_SHOW_DETAILS,
|
|
|
|
|
g_value_get_boolean (value));
|
|
|
|
|
break;
|
2007-12-27 20:41:08 +00:00
|
|
|
|
case PROP_DETAIL_WIDTH_CHARS:
|
|
|
|
|
gtk_calendar_set_detail_width_chars (calendar,
|
|
|
|
|
g_value_get_int (value));
|
|
|
|
|
break;
|
|
|
|
|
case PROP_DETAIL_HEIGHT_ROWS:
|
|
|
|
|
gtk_calendar_set_detail_height_rows (calendar,
|
|
|
|
|
g_value_get_int (value));
|
|
|
|
|
break;
|
2005-05-11 19:16:19 +00:00
|
|
|
|
default:
|
|
|
|
|
G_OBJECT_WARN_INVALID_PROPERTY_ID (object, prop_id, pspec);
|
|
|
|
|
break;
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
static void
|
|
|
|
|
gtk_calendar_get_property (GObject *object,
|
|
|
|
|
guint prop_id,
|
|
|
|
|
GValue *value,
|
|
|
|
|
GParamSpec *pspec)
|
|
|
|
|
{
|
2007-12-27 20:41:08 +00:00
|
|
|
|
GtkCalendarPrivate *priv = GTK_CALENDAR_GET_PRIVATE (object);
|
|
|
|
|
GtkCalendar *calendar = GTK_CALENDAR (object);
|
2005-05-11 19:16:19 +00:00
|
|
|
|
|
|
|
|
|
switch (prop_id)
|
|
|
|
|
{
|
|
|
|
|
case PROP_YEAR:
|
|
|
|
|
g_value_set_int (value, calendar->year);
|
|
|
|
|
break;
|
|
|
|
|
case PROP_MONTH:
|
|
|
|
|
g_value_set_int (value, calendar->month);
|
|
|
|
|
break;
|
|
|
|
|
case PROP_DAY:
|
|
|
|
|
g_value_set_int (value, calendar->selected_day);
|
|
|
|
|
break;
|
|
|
|
|
case PROP_SHOW_HEADING:
|
|
|
|
|
g_value_set_boolean (value, calendar_get_display_option (calendar,
|
|
|
|
|
GTK_CALENDAR_SHOW_HEADING));
|
|
|
|
|
break;
|
|
|
|
|
case PROP_SHOW_DAY_NAMES:
|
|
|
|
|
g_value_set_boolean (value, calendar_get_display_option (calendar,
|
|
|
|
|
GTK_CALENDAR_SHOW_DAY_NAMES));
|
|
|
|
|
break;
|
|
|
|
|
case PROP_NO_MONTH_CHANGE:
|
|
|
|
|
g_value_set_boolean (value, calendar_get_display_option (calendar,
|
|
|
|
|
GTK_CALENDAR_NO_MONTH_CHANGE));
|
|
|
|
|
break;
|
|
|
|
|
case PROP_SHOW_WEEK_NUMBERS:
|
|
|
|
|
g_value_set_boolean (value, calendar_get_display_option (calendar,
|
|
|
|
|
GTK_CALENDAR_SHOW_WEEK_NUMBERS));
|
|
|
|
|
break;
|
2007-12-28 09:39:34 +00:00
|
|
|
|
case PROP_SHOW_DETAILS:
|
|
|
|
|
g_value_set_boolean (value, calendar_get_display_option (calendar,
|
|
|
|
|
GTK_CALENDAR_SHOW_DETAILS));
|
|
|
|
|
break;
|
2007-12-27 20:41:08 +00:00
|
|
|
|
case PROP_DETAIL_WIDTH_CHARS:
|
|
|
|
|
g_value_set_int (value, priv->detail_width_chars);
|
|
|
|
|
break;
|
|
|
|
|
case PROP_DETAIL_HEIGHT_ROWS:
|
|
|
|
|
g_value_set_int (value, priv->detail_height_rows);
|
|
|
|
|
break;
|
2005-05-11 19:16:19 +00:00
|
|
|
|
default:
|
|
|
|
|
G_OBJECT_WARN_INVALID_PROPERTY_ID (object, prop_id, pspec);
|
|
|
|
|
break;
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
/****************************************
|
|
|
|
|
* Realization *
|
|
|
|
|
****************************************/
|
|
|
|
|
|
|
|
|
|
static void
|
|
|
|
|
calendar_realize_arrows (GtkCalendar *calendar)
|
|
|
|
|
{
|
|
|
|
|
GtkWidget *widget = GTK_WIDGET (calendar);
|
|
|
|
|
GtkCalendarPrivate *priv = GTK_CALENDAR_GET_PRIVATE (calendar);
|
|
|
|
|
GdkWindowAttr attributes;
|
|
|
|
|
gint attributes_mask;
|
|
|
|
|
gint i;
|
1998-10-01 13:24:42 +00:00
|
|
|
|
|
2005-05-11 19:16:19 +00:00
|
|
|
|
/* Arrow windows ------------------------------------- */
|
|
|
|
|
if (! (calendar->display_flags & GTK_CALENDAR_NO_MONTH_CHANGE)
|
|
|
|
|
&& (calendar->display_flags & GTK_CALENDAR_SHOW_HEADING))
|
1998-09-27 18:32:00 +00:00
|
|
|
|
{
|
2005-05-11 19:16:19 +00:00
|
|
|
|
attributes.wclass = GDK_INPUT_OUTPUT;
|
|
|
|
|
attributes.window_type = GDK_WINDOW_CHILD;
|
|
|
|
|
attributes.visual = gtk_widget_get_visual (widget);
|
|
|
|
|
attributes.colormap = gtk_widget_get_colormap (widget);
|
|
|
|
|
attributes.event_mask = (gtk_widget_get_events (widget) | GDK_EXPOSURE_MASK
|
|
|
|
|
| GDK_BUTTON_PRESS_MASK | GDK_BUTTON_RELEASE_MASK
|
|
|
|
|
| GDK_ENTER_NOTIFY_MASK | GDK_LEAVE_NOTIFY_MASK);
|
|
|
|
|
attributes_mask = GDK_WA_X | GDK_WA_Y | GDK_WA_VISUAL | GDK_WA_COLORMAP;
|
|
|
|
|
for (i = 0; i < 4; i++)
|
1998-09-27 18:32:00 +00:00
|
|
|
|
{
|
2005-05-11 19:16:19 +00:00
|
|
|
|
GdkRectangle rect;
|
|
|
|
|
calendar_arrow_rectangle (calendar, i, &rect);
|
|
|
|
|
|
|
|
|
|
attributes.x = rect.x;
|
|
|
|
|
attributes.y = rect.y;
|
|
|
|
|
attributes.width = rect.width;
|
2005-07-13 17:24:02 +00:00
|
|
|
|
attributes.height = rect.height;
|
2005-05-11 19:16:19 +00:00
|
|
|
|
priv->arrow_win[i] = gdk_window_new (priv->header_win,
|
|
|
|
|
&attributes,
|
|
|
|
|
attributes_mask);
|
|
|
|
|
if (GTK_WIDGET_IS_SENSITIVE (widget))
|
|
|
|
|
priv->arrow_state[i] = GTK_STATE_NORMAL;
|
|
|
|
|
else
|
|
|
|
|
priv->arrow_state[i] = GTK_STATE_INSENSITIVE;
|
|
|
|
|
gdk_window_set_background (priv->arrow_win[i],
|
|
|
|
|
HEADER_BG_COLOR (GTK_WIDGET (calendar)));
|
|
|
|
|
gdk_window_show (priv->arrow_win[i]);
|
|
|
|
|
gdk_window_set_user_data (priv->arrow_win[i], widget);
|
1998-09-27 18:32:00 +00:00
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
else
|
|
|
|
|
{
|
2005-05-11 19:16:19 +00:00
|
|
|
|
for (i = 0; i < 4; i++)
|
|
|
|
|
priv->arrow_win[i] = NULL;
|
1998-09-27 18:32:00 +00:00
|
|
|
|
}
|
2005-05-11 19:16:19 +00:00
|
|
|
|
}
|
Remove all references to offscreen flag which was no longer used.
Thu Jun 1 23:05:13 2000 Owen Taylor <otaylor@redhat.com>
* gtk/gtkwidget.c: Remove all references to
offscreen flag which was no longer used.
* gtk/gtkprivate.h (enum): Remove unused flags and compress.
* gtk/gtkframe.c (gtk_frame_set_label_widget): Check
for non-null label_widget->parent.
* gtk/gtkentry.c: Get rid of code to deal with PangoAttribute
which no longer was used.
* gdk/gdkpango.c (gdk_pango_context_get_info): make static.
* gdk/gdkpango.c (gdk_draw_layout[_line]): Add checks
for null arguments.
* gdk/x11/gdkgeometry-x11.c (gdk_window_scroll): add
check for destroyed windows.
Thu Jun 1 13:48:45 2000 Owen Taylor <otaylor@redhat.com>
* gtk/gtkimmulticontext.c: Add a finalize method and unref
the slave context there.
* gtk/gtkinvisible.[ch]: Make reference counting behavior
identical to GtkWindow.
Thu Jun 1 01:54:11 2000 Owen Taylor <otaylor@redhat.com>
* Makefile.am gdk/gdkpango.c: Copy the layout render function from
pangox to here, so we can write them independent of rendering
system, using GDK primitives.
* gdk/gdkdrawable.h gdk/gdkdraw.c gdk/gdkwindow.c
gdk/x11/gdkdrawable-x11.c: Remove draw_layout() from the vtable,
since we have a rendering-system independent implementation in
terms of draw_glyphs().
* gdk/gdkpango.c gdkdrawable.h (gdk_draw_layout_line): New
function to render a single line.
* gdk/x11/gdkpango.c: Move the guts of this file mostly
into ../gdkpango.c, which simplifies things, since we
don't have to deal with raw X gc's.
Fri May 19 04:28:16 2000 Owen Taylor <otaylor@redhat.com>
* gtk/gtktextlayout.[ch]: Add get_log_attrs() function to
get the logical attributes for a given GtkTextLine.
Tue May 30 16:05:39 2000 Owen Taylor <otaylor@redhat.com>
* gdk/x11/gdkfont-x11.c (gdk_font_charset_for_locale): Track
g_locale_get_codeset() to g_get_codeset() change.
Tue May 30 15:03:19 2000 Owen Taylor <otaylor@redhat.com>
* gtk/testcalendar.c (calendar_font_selection_ok): Use font
descriptions.
* gtk/gtkentry.c (gtk_entry_draw_text): Center text within
the entry.
* gtk/gtkfontsel.c (gtk_font_selection_dialog_init): Start of
redoing (vastly simplifying) for Pango. Still needs quite
a bit of work. (Size selection is currently poor. List of
predefined sizes is not a good idea, since all of these
sizes won't necessarily be distinct.)
Tue May 30 13:50:19 2000 Owen Taylor <otaylor@redhat.com>
* gdk/x11/gdkfont-x11.c (gdk_font_charset_for_locale): Handle
CODESET results for LANG=C.
Mon May 29 15:49:10 2000 Owen Taylor <otaylor@redhat.com>
* gtk/gtkrc.[ch]: Add a 'font_name' declaration to RC
which takes a stringized pango font description;
ignore the older 'font' and 'fontset' declarations.
* gtk/gtkstyle.c gtk/gtkrc.c: Fill in the style->font
field with a GdkFont derived via gdk_font_from_description(),
for compatibility. (Should we just remove it entirely?
Probably too much compatibility breakage, but people
should be migrating to the new Pango stuff as quickly
as possible.)
Mon May 29 15:47:41 2000 Owen Taylor <otaylor@redhat.com>
* gtk/gtkentry.c gtk/gtkclist.c: s/pango_font_unref/g_object_unref/.
Mon May 29 15:44:46 2000 Owen Taylor <otaylor@redhat.com>
* gtk/gtkcalender.c: Roughly pango-ized. Really needs
redoing; there are some bugs in size allocation right
now, the semi-existant distinction between header / day
fonts was removed, but, with Pango, could actually
be made functional in a nice way.
* gtk/testcalender: Move calender from examples into this
directory as a test program. (We really need to restrcture
testgtk into a whole directory full of tests for every
widget or functionality group, separated into multiple .c
files.)
Mon May 29 15:19:56 2000 Owen Taylor <otaylor@redhat.com>
* gtk/testgtk.c (file_exists): Fix stupid typo that
was keeping RC file from being loaded.
* gtk/testgtkrc gtk/testgtkrc2: Test new pango-ized
RC file font code.
Mon May 29 14:31:27 2000 Owen Taylor <otaylor@redhat.com>
* gdk/gdkfont.h gdk/x11/gdkfont-x11.c (gdk_font_from_description):
Add function to load a GdkFont from a PangoFontDescription.
Fri May 26 17:16:40 2000 Owen Taylor <otaylor@redhat.com>
* gtk/frame.[ch] gtkaspectframe.c: Make frame widgets able
to have any widget for the label, use a GtkLabel widget
to display the text. (Based partially on a patch from
Anders Carlson.)
(Quite a bit of code reorganization - strip 90% of the
guts out of gtkaspectframe and add a single virtual
func to GtkFrameClass - compute_child_allocation.)
Fri May 26 12:00:02 2000 Owen Taylor <otaylor@redhat.com>
* gtk/gtkctree.c gtk/gtkclist.[ch]: Pangoized.
(Removed clist->row_center_offset field because caching
it wasn't saving time or code, added private function
_gtk_clist_create_cell_layout()).
Wed May 24 15:59:37 2000 Owen Taylor <otaylor@redhat.com>
* gtk/gtkaccellabel.c: Pangoized.
* gtk/[hv]ruler.c: Pangoized
Mon May 22 19:23:59 2000 Owen Taylor <otaylor@redhat.com>
* gtk/gtkfilesel.c (gtk_file_selection_init):
Use gtk_clist_set_column_auto_resize() to remove need
need for manual column width computations.
Mon May 22 18:50:26 2000 Owen Taylor <otaylor@redhat.com>
* gtk/gtktooltips.[ch]: Replace custom drawing with a GtkLabel,
ensuring Pango correctness, and considerably simplifying the
code.
* gtk/gtklabel.c gtk[hv]scale.c: 1000 => PANGO_SCALE.
* gtk/gtklabel.c (gtk_label_size_request): Fixed incorrect
getting of numbers of lines.
* gtk/gtklabel.c (gtk_label_size_request): Set the requisition
to the actual requested width of the lable, not to the wrap
width we set.
* gtk/gtktextchild.h: Remove extraneous include of gtk/gtk.h.
* gtk/gtktextbtree.c gtk/gtktextbuffer.c gtk/gtktextlayout.c
gtk/gtktextview.c gtk/gtktextview.[ch]: Fix up includes.
* gtk/gtktextview.c: Fix structure inheritance.
* gtk/gtkprogressbar.c: Pangoize.
Mon May 22 15:47:30 2000 Owen Taylor <otaylor@redhat.com>
* gtk/gtktextview.c (gtk_text_view_get_first_para_iter): Encapsulate
in a function.
* gtk/gtktextlayout.c (find_display_line_above): Fixed
bug with computing line tops.
* gtk/gtktextview.c (changed_handler): Fix < , <= confusion.
Thu May 18 18:53:31 2000 Owen Taylor <otaylor@redhat.com>
* gtk/gtktextdisplay.c (gtk_text_layout_draw): Fix up the x_offset
and y_offset coordinates to do what we need now. (The offset between
buffer and layout coordinates has been reintroduced, but is a
bit different than before.)
* gtk/gtktextview.[ch]: No longer inherit from GtkLayout; instead
handle the adjustments ourselves, and scroll as necessary using
the new gdk_window_scroll().
The advantage of this is that when we are incrementally revalidating,
we are essentially rearranging things around the visible portion
of the screen. With the old setup, the visible portion of the
screen was moved around in the layout, so scrolling and redrawing
to track that caused jumping of the display. Since we now
control the scrolling ourselves, we can suppress this and
only redraw when things actually change.
Thu May 18 18:47:25 2000 Owen Taylor <otaylor@redhat.com>
* gtk/gtktextbtree.c (redisplay_mark): We need to invalidate
the region not just redisplay it after-all, since we store the
cursors in the LineDisplay. (Ugly interactions here between
GtkLayout and GtkTextBTree here.)
* gtk/gtktextbtree.c (redisplay_region): Fixed reversed comparison.
Thu May 18 18:43:21 2000 Owen Taylor <otaylor@redhat.com>
* gdk/gdkwindow.h gdk/x11/gdkgeometry-x11.c (gdk_window_scroll):
Added function to scroll contents of a window while keeping the
window constant. Works by XCopyArea or guffaw-scrolling depending
on the details of how the window is set up. (guffaw-scrolling
still needs to be filled in.)
Wed May 17 22:36:53 2000 Owen Taylor <otaylor@redhat.com>
* gtk/gtktextiter.c gtk/gtkmain.c: Add a debug key for the text widget,
move the debugging that was tied to a global variable
to that.
* gtk/gtkmarshal.list: Add NONE:INT,INT,INT
* gtk/gtktextbtree.[ch] gtk/gtktextlayout.c: Keep a separate
validated flag, in line data instead of setting height/width to
-1. This allows us to perform operations with partially invalid
buffer (using the old size for invalid lines) and thus to do
incremental vaidation. Keep height/width aggregates up to date
when deleting text and rebalancing the tree.
* gtk/gtktextbtree.[ch]: Add functions validate a line
(gtk_text_btree_validate_line), and to validate up
to a number of pixels (gtk_text_btree_validate).
* gtk/gtktextlayout.[ch]: Add an ::invalidated signal
that indicates that something is changed and a revalidation
pass is needed. Change ::need_repaint to ::changed, and
make it take old and new yranges instead of a rectangle.
* gtk/gtktextbtree.[ch] gtk/gtktextlayout.[ch]: Move
the line_data_destroy() function from
gtk_text_btree_add_view() to a virtual function in
GtkTextLayout
* gtk/gtktextbtree.[ch]: Remove gtk_text_btree_get_damage_range(),
since we are handling partial repaints in a different fashion
now.
* gtk/gtktextbtree.[ch]: Only repaint the changed portion
of the selection instead of queueing a repaint on the
entire widget.
* gtk/gtktextbuffer.[ch] gtk/gtktextbtree.[ch]: Move
get_selection_bounds() down to btree, make the function
in buffer a wrapper around the btree function.
* gtk/gtktextlayout.[ch]: Add functions to check if the
layout is valid and to recompute either a range of pixels
aroudn a line or a certain total number of pixels.
* gtk/gtktextlayout.[ch]: Cache a single line display;
now that we only redraw the needed portions, the hit rate
for this cache is quite high.
* gtk/gtktextview.[ch]: Keep track of the first paragraph
on the screen so that when re-laying-out the buffer, we can
keep the same place. This requires connecting to ::value_changed
on the adjustments
* gtk/gtktextview.[ch]: Add idle functions to revalidate
the buffer after we receive an ::invalidated signal.
Wed May 17 22:10:47 2000 Owen Taylor <otaylor@redhat.com>
* gtk/gtklayout.c (gtk_layout_size_allocate): Set upper
to max of allocation and layout size, not just to the
layout size.
* gtk/gtk[hv]scrollbar.c (gtk_[hv]scrollbar_calc_slider_size):
Invalidate window so it gets redrawn properly.
* gdk/gdkwindow.c (gdk_window_invalidate_rect): Allow rect == NULL
to mean the entire window.
* gdk/gdkevents.h: Move definition for GDK_PRIORITY_REDRAW
into public header.
Mon May 15 14:51:31 2000 Owen Taylor <otaylor@redhat.com>
* gtk/gtktextmark.c (gtk_text_mark_get_name): Add function
to get the name of a mark.
* gtk/gtktextlayout.c (gtk_text_layout_get_line_at_y): Add a function
to find the paragraph from a y position.
Thu May 11 12:57:20 2000 Owen Taylor <otaylor@redhat.com>
* gtk/gtktextbtree.c (gtk_text_btree_node_invalidate_upward): Valid
nodes have width/height >= 0, not > 0.
Tue May 9 21:29:06 2000 Owen Taylor <otaylor@redhat.com>
* gtk/gtktextlayout.[ch] gtk/gtktextdisplay.c (gtk_text_layout_get_line_display):
Add a size_only flag, so when we only need the size, we don't create
useless appearance attributes.
* gtk/gtktextview.c (gtk_text_view_ensure_layout): Remove
duplicate setting of font description.
* gtk/gtkscale.c: Use PANGO_SCALE instead of 1000
Wed Apr 26 01:53:23 2000 Owen Taylor <otaylor@redhat.com>
* gtk/Makefile.am (EXTRA_DIST): Add OLD_STAMP into
EXTRA_DIST. It does not work well when the file that
everything depends on is not in the tarball.
Wed Apr 26 00:56:14 2000 Owen Taylor <otaylor@redhat.com>
* gtk/testgtk.c: Some hacks and fixes so that it basically
works when not sitting in the GTK+ build tree.
2000-05-03 Havoc Pennington <hp@redhat.com>
* gtk/gtktextbtree.c (gtk_text_line_next_could_contain_tag):
Properly determine the ordering of the tag root and the current
line within the tree. Previous algorithm only worked if the tag
root's immediate parent was the common root of both the current
line and the tag root.
Wed Apr 26 00:43:00 2000 Owen Taylor <otaylor@redhat.com>
* gtk/gtktextlayout.c (set_para_values): Fix some bugs in
alignment.
* gtk/gtktextview.c (gtk_text_view_ensure_layout): Track
the widget text directional dynamically.
* gtk/gtktextview.[ch]: Added functions to get and set default
wrap mode.
Tue Apr 25 23:47:38 2000 Owen Taylor <otaylor@redhat.com>
* gtk/gtktextlayout.c (gtk_text_layout_get_iter_location): Fix bug
in cursor location computation.
Tue Apr 25 23:22:59 2000 Owen Taylor <otaylor@redhat.com>
* gtk/gtklayout.c (gtk_layout_set_size): Clamp hadjustment/
vadjusment values properly when layout gets smaller.
* gtk/gtktextview.c (need_repaint_handler): Areas being
passed in are far completely inaccurate, and sometimes
too small, so, for now, just queue a redraw on the
whole visible region.
2000-04-25 Havoc Pennington <hp@redhat.com>
* gtk/gtktextbtree.c (summary_destroy): new function to
destroy tag summary nodes
(gtk_text_line_next_could_contain_tag): this function was
totally broken if the line passed in wasn't below the tag
root. Fix it.
(gtk_text_btree_first_could_contain_tag): In the tag == NULL
"wildcard" case, we have to do a linear scan. Blah.
(gtk_text_btree_last_could_contain_tag): In tag == NULL case,
we have to do the linear scan
(tag_removed_cb): When a tag is removed from the tag table,
remove the GtkTextTagInfo node from the btree.
(gtk_text_btree_spew): Implement the spew function, for
our debugging pleasure.
Tue Apr 25 19:40:18 2000 Owen Taylor <otaylor@redhat.com>
* gtk/gtktextlayout.c (gtk_text_layout_set_buffer): Fix
a problem with referring to the wrong buffer.
* gtk/gtkentry.c: Fix focus-in/focus-out confusion.
* gtk/gtkrc.c gtk/gtkstyle.c: Moving setting default
font description to gtk_style_new() - otherwise things
don't work without a .gtkrc file.
* gtk/gtktextbuffer.c (gtk_text_buffer_new): Sink the
tags table if we create it ourself, too.
* gdk/gdktypes.h (enum): Move GDK_RELEASE_MASK, since
it was conflicting with XKB modifiers.
* gtk/gtktextview.[ch]: Add simple support for
GtkIMContext.
Mon Apr 24 19:34:18 2000 Owen Taylor <otaylor@redhat.com>
* gtk/gtkentry.c (gtk_entry_move_cursor_visually): Fix problem
with deletion from last commit.
Mon Apr 24 19:29:40 2000 Owen Taylor <otaylor@redhat.com>
* gtk/gtkwidget.c (gtk_widget_create_pango_context): Set the language
in the context from the current locale.
* gtk/gtkentry.c (gtk_entry_size_request): Use language from the
context, not hardcoded value.
* gtk/gtkentry.c (gtk_entry_move_cursor): Make character movement visual,
not logical.
Sun Apr 23 23:39:18 2000 Owen Taylor <otaylor@redhat.com>
* gtk/gtkentry.c gtk/gtktextdisplay.c: Don't handle selections as
attributes - that doesn't handle partial-glyph selection
properly. Instead use new pango_layout_line_get_x_ranges()
functionality to draw the selection.
* gtk/gtkentry.c: Simplify code since pango_layout_line_index_to_x()
now properly handles out-of-range coordinates.
* gtk/gtktextbuffer.c: Emit "mark_set" when the cursor is moved.
* gtk/gtktextiter.h gtk/gtktextiterprivate.h: Make gtk_text_iter_get_line_byte()
public.
* gtk/gtktextlayout.[ch]: Properly set the direction in the PangoContext
for paragraphs opposite to the base direction of the widget.
* gtk/gtktextlayout.[ch] gtk/gtktextdisplay.c: Fixes for alignment.
* gtk/gtktextlayout.c: Don't split segments on marks, since that
causes Arabic words to reshape as you cursor through.
* gtk/gtktextlayout.[ch] gtk/gtktextview.[ch]: Implement virtual
cursor position when moving vertically with the arrow keys and
scrolling with page-up/page-down. (Arrow keys save only the X,
scrolling saves both X and Y.)
This means you can line-up / line-down or page-up / page-down
without losing your place, and also that moving vertically
with the cursor keys keeps the same X position, not the same
character count:
* gtk/gtktextlayout.[ch] gtk/gtktextview.[ch]: Make vertical
arrow keys move by display lines, not paragraphs.
Tue Apr 18 14:16:50 2000 Owen Taylor <otaylor@redhat.com>
* gtk/gtklayout.c: Make sure that the bin window is at least
as big as the allocation. (Should we also make sure that the
bin window is big enough to completely cover widget->window?)
* gtk/gtktextview.c (gtk_text_view_get_visible_rect): Add
function to get the onscreen rectangle.
* gdk/x11/gdkwindow-x11.c (gdk_window_get_pointer): Correctly account
for offsets in window coordinates.
Sun Apr 16 16:13:27 2000 Owen Taylor <otaylor@redhat.com>
* gtk/gtkentry.c (gtk_entry_get_cursor_locations): Fix index/offset
confusion.
* gtk/gtktextview.c (gtk_text_view_ensure_layout): Set the default direction
from the widget direction.
* gtk/gtktexttag.c gtk/gtktexttagprivate.h (gtk_text_tag_set_arg):
Add a "direction" attribute.
* gtk/gtktextview.c: global s/tkxt/text_view/.
* gtk/testtext.c: Added long block of text in Arabic, to test out
the direction attributes. (Some problems with the shaping system
for arabic become obvious - like the fact the cursor splits words
into unjoined pieces.)
Fri Apr 14 12:54:34 2000 Owen Taylor <otaylor@redhat.com>
* gtk/gtktextdisplay.c (render_layout): Add overstrike handling.
* gtk/gtktextlayout.c: Fix up alignment.
* gtk/testtext.c: Add some tests for centering, wrapping.
Fri Apr 14 09:26:22 2000 Owen Taylor <otaylor@redhat.com>
* gdk/gdkdrawable.h gdk/gdkdraw.c gdk/gdkwindow.c gdk/x11/gdkdrawable-x11.c:
Add a draw_glyphs() operation to the drawable vtable and gdk_draw_glyphs().
If we wrote GTK+-specific layout-render function this could just replace
the draw_layout() operation in the vtable.
* gtk/gtkentry.c: Move guts of gtk_entry_get_cursor_locations to
pango_layout_get_cursor_pos() and use that function.
* gtk/gtktextchild.[ch]: add gtk_ onto pixmap_segment_new(), since it
is a non-static symbol.
* gtk/gtktextbtree.[ch]: Replace gtk_text_btree_find_line_data_by_y()
with gtk_text_btree_find_line_by_y()
* gtk/gtktextdisplay.c: Rewrote for Pango - uses a custom layout
renderer that handles GtkTextAppearance attributes.
* gtk/gtktexttag.[ch] gtk/gtktexttagprivate.h:
- Move the values in the style that don't affect geometry into a
GtkTextAppearance structure.
- Change underline to take a PangoUnderline and "font" a string
representation of a font description
- Add a "font_desc" attribute which takes a FontDescription structure.
* gtk/gtktextlayout.[ch]:
- Get rid of the display-line list per each line. Instead, we
generate, on demand, a GtkTextLineDisplay structure which]
contains a PangoLayout * and other necesary information
(offsets, cursor locations) for displaying a paragraph.
- Get rid of the code to wrap lines, create display chunks,
etc. Instead, we just go through a paragraph and convert
it into the necessary inputs to a PangoLayout.
- Implement a new attribute type, GtkTextAttrAppearance. This
holds a GtkTextAppearance, and is used to pass colors,
stipple, etc, through from the layout to the display without
having to use lots and lots of individual attributes.
- Reimplement gtk_layout_get_iter_at_pixel() gtk_layout_get_iter_pos()
in terms of PangoLayout functions.
* gtk/gtktextview.c:
- Handle passing the necessary PangoContext to the layout
- Some fixups in painting to deal with the automatic backing store
and offsetting of GTK+-1.4
- Add a style_set handler so that the default style reacts
properly to theme changes.
* gtk/gtktext?*.[ch]: Random code-style fixes.
* gtk/testtext.c: Substitute in languages that Pango handles now for Thai
Mon Apr 10 10:33:45 2000 Owen Taylor <otaylor@redhat.com>
* gtk/gtktext?*.[ch]: Check in Havoc's port of the Tk text widget,
in original form preparatory to Pango-ization and gdkimcontext-ization.
Thu Apr 6 19:25:39 2000 Owen Taylor <otaylor@redhat.com>
* gtk/gtkimcontext.c: Move default implementations to real_* vfuncs,
so that we can derive from gtkimcontext in language bindings properly.
Thu Apr 6 16:02:52 2000 Owen Taylor <otaylor@redhat.com>
* gtk/gtkimcontextsimple.[ch]: Use gdk_keyval_to_unicode to gdk_unicode_to_keyval.
Add a compose table including (almost) all the compose combinations
from X. This is 6k of static, shared data as opposed to 50k or so of dynamic
data in the XIM implementation.
* gdk/gdk.h gdk/gdkkeyuni.c gdk/win32/gdkevents-win32.c (gdk_keyval_to_unicode, gdk_unicode_to_keyval):
Moved functions to convert keyvalues from and to unicode here from
the win32 port and made them public.
Wed Apr 5 16:37:29 2000 Owen Taylor <otaylor@redhat.com>
* gtk/gtkeditable.c (gtk_editable_insert_text): Allow new_text_length == -1.
Wed Apr 5 16:27:45 2000 Owen Taylor <otaylor@redhat.com>
* gtk/gtkimcontext.[ch]: Base class for new input context system
* gtk/gtkimmulticontext.[ch]: Proxy input context that allows
the real input context implementation to be loaded from modules
and switched on the fly.
* gtk/gtkcontextsimple.[ch]: Simple implementation of an input
context that just does direct keysymbol => unicode translation.
* gtk/gtkentry.[ch]: Start switching editing over to using
GtkInputContext. (No handling of preedit yet.)
Wed Apr 5 15:48:41 2000 Owen Taylor <otaylor@redhat.com>
* gtk/gtktypeutils.h (GTK_CHECK_GET_CLASS): Fix problem with one too
many substitutions. (klass should not be subsituted.)
Wed Apr 5 00:18:14 2000 Owen Taylor <otaylor@redhat.com>
* configure.in: Add checks for Pango
* configure.in docs/Makefile.am: Add test for sgml2html
and allow 'make dist' without building html, but print out
warnings in that case. (For making snapshots)
* gdk/Makefile.am gdk/x11/Makefile.am gtk/Makefile.am:
Add Pango libraries and C flags
* gdk/gdkdraw.c gdk/gdkdrawable.h gdkwindow.c gdk/x11/gdkdrawable-x11.c:
Add function (gdk_draw_layout) to draw a pango layout.
* gdk/gdkpango.h gdk/x11/gdkpango-x11.c: New file with functions
for getting Pango contexts for GDK.
* gtk/gtkeditable.c: Get rid of dead code gtk_editable_parent_set()
* gtk/gtkentry.[ch]: Complete rewrite to use Pango, add bidirectional
editing.
* gtk/gtkentry.c: Hack in simple Hebrew input with direct
keysym => unicode translations. More languages can be added
here, but real input-method support is needed.
* docs/Changes-1.4.txt: Added note about entry behavior.
* gtk/gtkenums.h gtk/gtkwidget.[ch] testgtk.c gtkprivate.h: Add functions
to set the reading direction for a widget and the global direction.
Add test which allows toggling the global direction. Two private
flags are used to store the direction. (GTK_DIRECTION_SET + GTK_DIRECTION_LTR)
* gtk/gtkcheckbutton.c gtk/gtkframe.c gtk/gtkhbbox.c gtk/gtkhbox.c
gtk/gtkradiobutton.c gtk/gtkspinbutton.c gtk/gtktable.c
* gtk/gtk[hv]scale.c gtk/gtkscale.[ch]: Draw numbers using Pango
* gtk/gtklabel.[ch]: Moved to Pango and considerably rewritten. Line breaking,
underlining now handled by Pango.
* gtk/gtkstyle.[ch] gtk/gtkrc.[ch]: Add a PangoFontDescription
to RCStyle and Style. (Having both this and the old font name and GdkFont
is temporary.)
* gtk/gtkwidget.[ch] (gtk_widget_create_pango_{context,layout}): Added
convenience functions for creating contexts and layouts for widgets.
* gtk/testgtk.c: Enhance label tests with multilingual labels.
2000-06-02 03:14:07 +00:00
|
|
|
|
|
2005-05-11 19:16:19 +00:00
|
|
|
|
static void
|
|
|
|
|
calendar_realize_header (GtkCalendar *calendar)
|
|
|
|
|
{
|
|
|
|
|
GtkWidget *widget = GTK_WIDGET (calendar);
|
|
|
|
|
GtkCalendarPrivate *priv = GTK_CALENDAR_GET_PRIVATE (calendar);
|
|
|
|
|
GdkWindowAttr attributes;
|
|
|
|
|
gint attributes_mask;
|
1998-10-01 13:24:42 +00:00
|
|
|
|
|
2005-05-11 19:16:19 +00:00
|
|
|
|
/* Header window ------------------------------------- */
|
1998-09-27 18:32:00 +00:00
|
|
|
|
if (calendar->display_flags & GTK_CALENDAR_SHOW_HEADING)
|
1998-10-04 23:07:04 +00:00
|
|
|
|
{
|
2005-05-11 19:16:19 +00:00
|
|
|
|
attributes.wclass = GDK_INPUT_OUTPUT;
|
|
|
|
|
attributes.window_type = GDK_WINDOW_CHILD;
|
|
|
|
|
attributes.visual = gtk_widget_get_visual (widget);
|
|
|
|
|
attributes.colormap = gtk_widget_get_colormap (widget);
|
|
|
|
|
attributes.event_mask = gtk_widget_get_events (widget) | GDK_EXPOSURE_MASK;
|
|
|
|
|
attributes_mask = GDK_WA_X | GDK_WA_Y | GDK_WA_VISUAL | GDK_WA_COLORMAP;
|
|
|
|
|
attributes.x = widget->style->xthickness;
|
|
|
|
|
attributes.y = widget->style->ythickness;
|
|
|
|
|
attributes.width = widget->allocation.width - 2 * attributes.x;
|
2007-12-28 19:46:53 +00:00
|
|
|
|
attributes.height = priv->header_h;
|
2005-05-11 19:16:19 +00:00
|
|
|
|
priv->header_win = gdk_window_new (widget->window,
|
|
|
|
|
&attributes, attributes_mask);
|
|
|
|
|
|
|
|
|
|
gdk_window_set_background (priv->header_win,
|
|
|
|
|
HEADER_BG_COLOR (GTK_WIDGET (calendar)));
|
|
|
|
|
gdk_window_show (priv->header_win);
|
|
|
|
|
gdk_window_set_user_data (priv->header_win, widget);
|
|
|
|
|
|
1998-10-04 23:07:04 +00:00
|
|
|
|
}
|
1998-09-27 18:32:00 +00:00
|
|
|
|
else
|
1998-10-04 23:07:04 +00:00
|
|
|
|
{
|
2005-05-11 19:16:19 +00:00
|
|
|
|
priv->header_win = NULL;
|
1998-10-04 23:07:04 +00:00
|
|
|
|
}
|
2005-05-11 19:16:19 +00:00
|
|
|
|
calendar_realize_arrows (calendar);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
static void
|
|
|
|
|
calendar_realize_day_names (GtkCalendar *calendar)
|
|
|
|
|
{
|
|
|
|
|
GtkWidget *widget = GTK_WIDGET (calendar);
|
|
|
|
|
GtkCalendarPrivate *priv = GTK_CALENDAR_GET_PRIVATE (calendar);
|
|
|
|
|
GdkWindowAttr attributes;
|
|
|
|
|
gint attributes_mask;
|
1998-10-01 13:24:42 +00:00
|
|
|
|
|
2005-05-11 19:16:19 +00:00
|
|
|
|
/* Day names window --------------------------------- */
|
|
|
|
|
if ( calendar->display_flags & GTK_CALENDAR_SHOW_DAY_NAMES)
|
1998-09-27 18:32:00 +00:00
|
|
|
|
{
|
2005-05-11 19:16:19 +00:00
|
|
|
|
attributes.wclass = GDK_INPUT_OUTPUT;
|
|
|
|
|
attributes.window_type = GDK_WINDOW_CHILD;
|
|
|
|
|
attributes.visual = gtk_widget_get_visual (widget);
|
|
|
|
|
attributes.colormap = gtk_widget_get_colormap (widget);
|
|
|
|
|
attributes.event_mask = gtk_widget_get_events (widget) | GDK_EXPOSURE_MASK;
|
|
|
|
|
attributes_mask = GDK_WA_X | GDK_WA_Y | GDK_WA_VISUAL | GDK_WA_COLORMAP;
|
|
|
|
|
attributes.x = (widget->style->xthickness + INNER_BORDER);
|
|
|
|
|
attributes.y = priv->header_h + (widget->style->ythickness
|
|
|
|
|
+ INNER_BORDER);
|
|
|
|
|
attributes.width = (widget->allocation.width
|
|
|
|
|
- (widget->style->xthickness + INNER_BORDER)
|
|
|
|
|
* 2);
|
|
|
|
|
attributes.height = priv->day_name_h;
|
|
|
|
|
priv->day_name_win = gdk_window_new (widget->window,
|
|
|
|
|
&attributes,
|
|
|
|
|
attributes_mask);
|
|
|
|
|
gdk_window_set_background (priv->day_name_win,
|
|
|
|
|
BACKGROUND_COLOR ( GTK_WIDGET ( calendar)));
|
|
|
|
|
gdk_window_show (priv->day_name_win);
|
|
|
|
|
gdk_window_set_user_data (priv->day_name_win, widget);
|
|
|
|
|
}
|
1998-09-27 18:32:00 +00:00
|
|
|
|
else
|
1998-10-04 23:07:04 +00:00
|
|
|
|
{
|
2005-05-11 19:16:19 +00:00
|
|
|
|
priv->day_name_win = NULL;
|
1998-10-04 23:07:04 +00:00
|
|
|
|
}
|
1998-09-27 18:32:00 +00:00
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
static void
|
2005-05-11 19:16:19 +00:00
|
|
|
|
calendar_realize_week_numbers (GtkCalendar *calendar)
|
1998-09-27 18:32:00 +00:00
|
|
|
|
{
|
2005-05-11 19:16:19 +00:00
|
|
|
|
GtkWidget *widget = GTK_WIDGET (calendar);
|
|
|
|
|
GtkCalendarPrivate *priv = GTK_CALENDAR_GET_PRIVATE (calendar);
|
|
|
|
|
GdkWindowAttr attributes;
|
|
|
|
|
gint attributes_mask;
|
1998-10-01 13:24:42 +00:00
|
|
|
|
|
2005-05-11 19:16:19 +00:00
|
|
|
|
/* Week number window -------------------------------- */
|
|
|
|
|
if (calendar->display_flags & GTK_CALENDAR_SHOW_WEEK_NUMBERS)
|
|
|
|
|
{
|
|
|
|
|
attributes.wclass = GDK_INPUT_OUTPUT;
|
|
|
|
|
attributes.window_type = GDK_WINDOW_CHILD;
|
|
|
|
|
attributes.visual = gtk_widget_get_visual (widget);
|
|
|
|
|
attributes.colormap = gtk_widget_get_colormap (widget);
|
|
|
|
|
attributes.event_mask = gtk_widget_get_events (widget) | GDK_EXPOSURE_MASK;
|
|
|
|
|
|
|
|
|
|
attributes_mask = GDK_WA_X | GDK_WA_Y | GDK_WA_VISUAL | GDK_WA_COLORMAP;
|
|
|
|
|
attributes.x = widget->style->xthickness + INNER_BORDER;
|
|
|
|
|
attributes.y = (priv->header_h + priv->day_name_h
|
|
|
|
|
+ (widget->style->ythickness + INNER_BORDER));
|
|
|
|
|
attributes.width = priv->week_width;
|
|
|
|
|
attributes.height = priv->main_h;
|
|
|
|
|
priv->week_win = gdk_window_new (widget->window,
|
|
|
|
|
&attributes, attributes_mask);
|
|
|
|
|
gdk_window_set_background (priv->week_win,
|
|
|
|
|
BACKGROUND_COLOR (GTK_WIDGET (calendar)));
|
|
|
|
|
gdk_window_show (priv->week_win);
|
|
|
|
|
gdk_window_set_user_data (priv->week_win, widget);
|
|
|
|
|
}
|
|
|
|
|
else
|
|
|
|
|
{
|
|
|
|
|
priv->week_win = NULL;
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
static void
|
|
|
|
|
gtk_calendar_realize (GtkWidget *widget)
|
|
|
|
|
{
|
|
|
|
|
GtkCalendar *calendar = GTK_CALENDAR (widget);
|
|
|
|
|
GtkCalendarPrivate *priv = GTK_CALENDAR_GET_PRIVATE (widget);
|
|
|
|
|
GdkWindowAttr attributes;
|
|
|
|
|
gint attributes_mask;
|
|
|
|
|
|
|
|
|
|
GTK_WIDGET_SET_FLAGS (widget, GTK_REALIZED);
|
|
|
|
|
|
|
|
|
|
attributes.x = widget->allocation.x;
|
|
|
|
|
attributes.y = widget->allocation.y;
|
|
|
|
|
attributes.width = widget->allocation.width;
|
|
|
|
|
attributes.height = widget->allocation.height;
|
|
|
|
|
attributes.wclass = GDK_INPUT_OUTPUT;
|
|
|
|
|
attributes.window_type = GDK_WINDOW_CHILD;
|
|
|
|
|
attributes.event_mask = (gtk_widget_get_events (widget)
|
|
|
|
|
| GDK_EXPOSURE_MASK |GDK_KEY_PRESS_MASK | GDK_SCROLL_MASK);
|
|
|
|
|
attributes.visual = gtk_widget_get_visual (widget);
|
|
|
|
|
attributes.colormap = gtk_widget_get_colormap (widget);
|
|
|
|
|
|
|
|
|
|
attributes_mask = GDK_WA_X | GDK_WA_Y | GDK_WA_VISUAL | GDK_WA_COLORMAP;
|
|
|
|
|
widget->window = gdk_window_new (widget->parent->window,
|
|
|
|
|
&attributes, attributes_mask);
|
|
|
|
|
|
|
|
|
|
widget->style = gtk_style_attach (widget->style, widget->window);
|
|
|
|
|
|
|
|
|
|
/* Header window ------------------------------------- */
|
|
|
|
|
calendar_realize_header (calendar);
|
|
|
|
|
/* Day names window --------------------------------- */
|
|
|
|
|
calendar_realize_day_names (calendar);
|
|
|
|
|
/* Week number window -------------------------------- */
|
|
|
|
|
calendar_realize_week_numbers (calendar);
|
|
|
|
|
/* Main Window -------------------------------------- */
|
|
|
|
|
attributes.event_mask = (gtk_widget_get_events (widget) | GDK_EXPOSURE_MASK
|
|
|
|
|
| GDK_BUTTON_PRESS_MASK | GDK_BUTTON_RELEASE_MASK
|
|
|
|
|
| GDK_POINTER_MOTION_MASK | GDK_LEAVE_NOTIFY_MASK);
|
|
|
|
|
|
|
|
|
|
attributes.x = priv->week_width + (widget->style->ythickness + INNER_BORDER);
|
|
|
|
|
attributes.y = (priv->header_h + priv->day_name_h
|
|
|
|
|
+ (widget->style->ythickness + INNER_BORDER));
|
|
|
|
|
attributes.width = (widget->allocation.width - attributes.x
|
|
|
|
|
- (widget->style->xthickness + INNER_BORDER));
|
|
|
|
|
attributes.height = priv->main_h;
|
|
|
|
|
priv->main_win = gdk_window_new (widget->window,
|
|
|
|
|
&attributes, attributes_mask);
|
|
|
|
|
gdk_window_set_background (priv->main_win,
|
|
|
|
|
BACKGROUND_COLOR ( GTK_WIDGET ( calendar)));
|
|
|
|
|
gdk_window_show (priv->main_win);
|
|
|
|
|
gdk_window_set_user_data (priv->main_win, widget);
|
|
|
|
|
gdk_window_set_background (widget->window, BACKGROUND_COLOR (widget));
|
|
|
|
|
gdk_window_show (widget->window);
|
|
|
|
|
gdk_window_set_user_data (widget->window, widget);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
static void
|
|
|
|
|
gtk_calendar_unrealize (GtkWidget *widget)
|
|
|
|
|
{
|
|
|
|
|
GtkCalendarPrivate *priv = GTK_CALENDAR_GET_PRIVATE (widget);
|
|
|
|
|
gint i;
|
|
|
|
|
|
|
|
|
|
if (priv->header_win)
|
|
|
|
|
{
|
|
|
|
|
for (i = 0; i < 4; i++)
|
|
|
|
|
{
|
|
|
|
|
if (priv->arrow_win[i])
|
|
|
|
|
{
|
|
|
|
|
gdk_window_set_user_data (priv->arrow_win[i], NULL);
|
|
|
|
|
gdk_window_destroy (priv->arrow_win[i]);
|
|
|
|
|
priv->arrow_win[i] = NULL;
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
gdk_window_set_user_data (priv->header_win, NULL);
|
|
|
|
|
gdk_window_destroy (priv->header_win);
|
|
|
|
|
priv->header_win = NULL;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
if (priv->week_win)
|
|
|
|
|
{
|
|
|
|
|
gdk_window_set_user_data (priv->week_win, NULL);
|
|
|
|
|
gdk_window_destroy (priv->week_win);
|
|
|
|
|
priv->week_win = NULL;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
if (priv->main_win)
|
|
|
|
|
{
|
|
|
|
|
gdk_window_set_user_data (priv->main_win, NULL);
|
|
|
|
|
gdk_window_destroy (priv->main_win);
|
|
|
|
|
priv->main_win = NULL;
|
|
|
|
|
}
|
|
|
|
|
if (priv->day_name_win)
|
|
|
|
|
{
|
|
|
|
|
gdk_window_set_user_data (priv->day_name_win, NULL);
|
|
|
|
|
gdk_window_destroy (priv->day_name_win);
|
|
|
|
|
priv->day_name_win = NULL;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
if (GTK_WIDGET_CLASS (gtk_calendar_parent_class)->unrealize)
|
|
|
|
|
(* GTK_WIDGET_CLASS (gtk_calendar_parent_class)->unrealize) (widget);
|
|
|
|
|
}
|
|
|
|
|
|
2008-01-17 16:42:04 +00:00
|
|
|
|
static gchar*
|
2007-12-28 09:26:20 +00:00
|
|
|
|
gtk_calendar_get_detail (GtkCalendar *calendar,
|
|
|
|
|
gint row,
|
|
|
|
|
gint column)
|
|
|
|
|
{
|
|
|
|
|
GtkCalendarPrivate *priv = GTK_CALENDAR_GET_PRIVATE (calendar);
|
|
|
|
|
gint year, month;
|
|
|
|
|
|
|
|
|
|
year = calendar->year;
|
|
|
|
|
month = calendar->month + calendar->day_month[row][column] - MONTH_CURRENT;
|
|
|
|
|
|
|
|
|
|
if (month < 0)
|
|
|
|
|
{
|
|
|
|
|
month += 12;
|
|
|
|
|
year -= 1;
|
|
|
|
|
}
|
|
|
|
|
else if (month > 11)
|
|
|
|
|
{
|
|
|
|
|
month -= 12;
|
|
|
|
|
year += 1;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
return priv->detail_func (calendar,
|
|
|
|
|
year, month,
|
|
|
|
|
calendar->day[row][column],
|
|
|
|
|
priv->detail_func_user_data);
|
|
|
|
|
}
|
|
|
|
|
|
2007-12-28 09:36:06 +00:00
|
|
|
|
static gboolean
|
|
|
|
|
gtk_calendar_query_tooltip (GtkWidget *widget,
|
|
|
|
|
gint x,
|
|
|
|
|
gint y,
|
|
|
|
|
gboolean keyboard_mode,
|
|
|
|
|
GtkTooltip *tooltip)
|
|
|
|
|
{
|
|
|
|
|
GtkCalendarPrivate *priv = GTK_CALENDAR_GET_PRIVATE (widget);
|
|
|
|
|
GtkCalendar *calendar = GTK_CALENDAR (widget);
|
2008-01-17 16:42:04 +00:00
|
|
|
|
gchar *detail = NULL;
|
2007-12-28 09:36:06 +00:00
|
|
|
|
GdkRectangle day_rect;
|
|
|
|
|
|
|
|
|
|
if (priv->main_win)
|
|
|
|
|
{
|
|
|
|
|
gint x0, y0, row, col;
|
|
|
|
|
|
|
|
|
|
gdk_window_get_position (priv->main_win, &x0, &y0);
|
|
|
|
|
col = calendar_column_from_x (calendar, x - x0);
|
|
|
|
|
row = calendar_row_from_y (calendar, y - y0);
|
|
|
|
|
|
2007-12-28 09:39:34 +00:00
|
|
|
|
if (0 != (priv->detail_overflow[row] & (1 << col)) ||
|
|
|
|
|
0 == (calendar->display_flags & GTK_CALENDAR_SHOW_DETAILS))
|
2007-12-28 09:36:06 +00:00
|
|
|
|
{
|
|
|
|
|
detail = gtk_calendar_get_detail (calendar, row, col);
|
|
|
|
|
calendar_day_rectangle (calendar, row, col, &day_rect);
|
|
|
|
|
|
|
|
|
|
day_rect.x += x0;
|
|
|
|
|
day_rect.y += y0;
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
if (detail)
|
|
|
|
|
{
|
|
|
|
|
gtk_tooltip_set_tip_area (tooltip, &day_rect);
|
|
|
|
|
gtk_tooltip_set_markup (tooltip, detail);
|
|
|
|
|
|
2008-01-17 16:42:04 +00:00
|
|
|
|
g_free (detail);
|
|
|
|
|
|
2007-12-28 09:36:06 +00:00
|
|
|
|
return TRUE;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
if (GTK_WIDGET_CLASS (gtk_calendar_parent_class)->query_tooltip)
|
|
|
|
|
return GTK_WIDGET_CLASS (gtk_calendar_parent_class)->query_tooltip (widget, x, y, keyboard_mode, tooltip);
|
|
|
|
|
|
|
|
|
|
return FALSE;
|
|
|
|
|
}
|
|
|
|
|
|
2005-05-11 19:16:19 +00:00
|
|
|
|
|
|
|
|
|
/****************************************
|
|
|
|
|
* Size Request and Allocate *
|
|
|
|
|
****************************************/
|
|
|
|
|
|
|
|
|
|
static void
|
|
|
|
|
gtk_calendar_size_request (GtkWidget *widget,
|
|
|
|
|
GtkRequisition *requisition)
|
|
|
|
|
{
|
|
|
|
|
GtkCalendar *calendar = GTK_CALENDAR (widget);
|
|
|
|
|
GtkCalendarPrivate *priv = GTK_CALENDAR_GET_PRIVATE (widget);
|
|
|
|
|
PangoLayout *layout;
|
|
|
|
|
PangoRectangle logical_rect;
|
|
|
|
|
|
|
|
|
|
gint height;
|
2007-12-28 09:26:20 +00:00
|
|
|
|
gint i, r, c;
|
2005-05-11 19:16:19 +00:00
|
|
|
|
gint calendar_margin = CALENDAR_MARGIN;
|
|
|
|
|
gint header_width, main_width;
|
|
|
|
|
gint max_header_height = 0;
|
|
|
|
|
gint focus_width;
|
|
|
|
|
gint focus_padding;
|
2007-12-28 22:11:35 +00:00
|
|
|
|
gint max_detail_height;
|
|
|
|
|
|
2005-05-11 19:16:19 +00:00
|
|
|
|
gtk_widget_style_get (GTK_WIDGET (widget),
|
|
|
|
|
"focus-line-width", &focus_width,
|
|
|
|
|
"focus-padding", &focus_padding,
|
|
|
|
|
NULL);
|
|
|
|
|
|
|
|
|
|
layout = gtk_widget_create_pango_layout (widget, NULL);
|
|
|
|
|
|
|
|
|
|
/*
|
|
|
|
|
* Calculate the requisition width for the widget.
|
|
|
|
|
*/
|
|
|
|
|
|
|
|
|
|
/* Header width */
|
|
|
|
|
|
|
|
|
|
if (calendar->display_flags & GTK_CALENDAR_SHOW_HEADING)
|
|
|
|
|
{
|
|
|
|
|
priv->max_month_width = 0;
|
|
|
|
|
for (i = 0; i < 12; i++)
|
|
|
|
|
{
|
|
|
|
|
pango_layout_set_text (layout, default_monthname[i], -1);
|
|
|
|
|
pango_layout_get_pixel_extents (layout, NULL, &logical_rect);
|
|
|
|
|
priv->max_month_width = MAX (priv->max_month_width,
|
|
|
|
|
logical_rect.width + 8);
|
|
|
|
|
max_header_height = MAX (max_header_height, logical_rect.height);
|
|
|
|
|
}
|
2005-06-12 06:59:43 +00:00
|
|
|
|
|
2005-05-11 19:16:19 +00:00
|
|
|
|
priv->max_year_width = 0;
|
2005-06-12 06:59:43 +00:00
|
|
|
|
/* Translators: This is a text measurement template.
|
|
|
|
|
* Translate it to the widest year text.
|
|
|
|
|
*
|
|
|
|
|
* Don't include the prefix "year measurement template|"
|
|
|
|
|
* in the translation.
|
|
|
|
|
*
|
|
|
|
|
* If you don't understand this, leave it as "2000"
|
|
|
|
|
*/
|
|
|
|
|
pango_layout_set_text (layout, Q_("year measurement template|2000"), -1);
|
|
|
|
|
pango_layout_get_pixel_extents (layout, NULL, &logical_rect);
|
|
|
|
|
priv->max_year_width = MAX (priv->max_year_width,
|
|
|
|
|
logical_rect.width + 8);
|
|
|
|
|
max_header_height = MAX (max_header_height, logical_rect.height);
|
2005-05-11 19:16:19 +00:00
|
|
|
|
}
|
|
|
|
|
else
|
|
|
|
|
{
|
|
|
|
|
priv->max_month_width = 0;
|
|
|
|
|
priv->max_year_width = 0;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
if (calendar->display_flags & GTK_CALENDAR_NO_MONTH_CHANGE)
|
|
|
|
|
header_width = (priv->max_month_width
|
|
|
|
|
+ priv->max_year_width
|
|
|
|
|
+ 3 * 3);
|
|
|
|
|
else
|
|
|
|
|
header_width = (priv->max_month_width
|
|
|
|
|
+ priv->max_year_width
|
|
|
|
|
+ 4 * priv->arrow_width + 3 * 3);
|
|
|
|
|
|
|
|
|
|
/* Mainwindow labels width */
|
|
|
|
|
|
|
|
|
|
priv->max_day_char_width = 0;
|
2006-01-26 20:40:18 +00:00
|
|
|
|
priv->max_day_char_ascent = 0;
|
|
|
|
|
priv->max_day_char_descent = 0;
|
2005-05-11 19:16:19 +00:00
|
|
|
|
priv->min_day_width = 0;
|
|
|
|
|
|
|
|
|
|
for (i = 0; i < 9; i++)
|
|
|
|
|
{
|
2006-01-26 20:40:18 +00:00
|
|
|
|
gchar buffer[32];
|
|
|
|
|
g_snprintf (buffer, sizeof (buffer), Q_("calendar:day:digits|%d"), i * 11);
|
2005-05-11 19:16:19 +00:00
|
|
|
|
pango_layout_set_text (layout, buffer, -1);
|
|
|
|
|
pango_layout_get_pixel_extents (layout, NULL, &logical_rect);
|
|
|
|
|
priv->min_day_width = MAX (priv->min_day_width,
|
|
|
|
|
logical_rect.width);
|
|
|
|
|
|
2006-01-26 20:40:18 +00:00
|
|
|
|
priv->max_day_char_ascent = MAX (priv->max_day_char_ascent,
|
2005-05-11 19:16:19 +00:00
|
|
|
|
PANGO_ASCENT (logical_rect));
|
2006-01-26 20:40:18 +00:00
|
|
|
|
priv->max_day_char_descent = MAX (priv->max_day_char_descent,
|
2005-05-11 19:16:19 +00:00
|
|
|
|
PANGO_DESCENT (logical_rect));
|
|
|
|
|
}
|
|
|
|
|
|
2006-01-26 20:40:18 +00:00
|
|
|
|
priv->max_label_char_ascent = 0;
|
|
|
|
|
priv->max_label_char_descent = 0;
|
2005-05-11 19:16:19 +00:00
|
|
|
|
if (calendar->display_flags & GTK_CALENDAR_SHOW_DAY_NAMES)
|
|
|
|
|
for (i = 0; i < 7; i++)
|
|
|
|
|
{
|
|
|
|
|
pango_layout_set_text (layout, default_abbreviated_dayname[i], -1);
|
Bug 340141 – Update to Pango 1.16 API
2006-12-24 Behdad Esfahbod <behdad@gnome.org>
Bug 340141 – Update to Pango 1.16 API
* gdk/gdkpango.c (layout_iter_get_line_clip_region),
(gdk_pango_layout_line_get_clip_region):
* gtk/gtkcalendar.c (gtk_calendar_size_request):
* gtk/gtkentry.c (gtk_entry_get_pixel_ranges),
(get_layout_position), (gtk_entry_find_position),
(gtk_entry_adjust_scroll):
* gtk/gtkiconview.c (get_pango_text_offsets):
* gtk/gtklabel.c (get_cursor_direction):
* gtk/gtkstyle.c (get_insensitive_layout):
* gtk/gtktextdisplay.c (render_para):
* gtk/gtktextlayout.c (allocate_child_widgets),
(find_display_line_below), (find_display_line_above),
(gtk_text_layout_move_iter_to_previous_line),
(gtk_text_layout_move_iter_to_next_line),
(gtk_text_layout_move_iter_to_line_end),
(gtk_text_layout_iter_starts_line),
(gtk_text_layout_move_iter_to_x):
* gtk/gtktextutil.c (limit_layout_lines):
Use the _readonly version of pango_layout_iter_get_line(),
pango_layout_iter_get_run(), pango_layout_get_line(), and
pango_layout_get_lines().
* gtk/gtkmain.c (gtk_get_default_language): Use
pango_get_default_language().
2006-12-24 05:29:25 +00:00
|
|
|
|
pango_layout_line_get_pixel_extents (pango_layout_get_lines_readonly (layout)->data, NULL, &logical_rect);
|
2005-05-11 19:16:19 +00:00
|
|
|
|
|
|
|
|
|
priv->min_day_width = MAX (priv->min_day_width, logical_rect.width);
|
|
|
|
|
priv->max_label_char_ascent = MAX (priv->max_label_char_ascent,
|
|
|
|
|
PANGO_ASCENT (logical_rect));
|
|
|
|
|
priv->max_label_char_descent = MAX (priv->max_label_char_descent,
|
|
|
|
|
PANGO_DESCENT (logical_rect));
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
priv->max_week_char_width = 0;
|
|
|
|
|
if (calendar->display_flags & GTK_CALENDAR_SHOW_WEEK_NUMBERS)
|
|
|
|
|
for (i = 0; i < 9; i++)
|
|
|
|
|
{
|
2006-01-26 20:40:18 +00:00
|
|
|
|
gchar buffer[32];
|
|
|
|
|
g_snprintf (buffer, sizeof (buffer), Q_("calendar:week:digits|%d"), i * 11);
|
2005-05-11 19:16:19 +00:00
|
|
|
|
pango_layout_set_text (layout, buffer, -1);
|
|
|
|
|
pango_layout_get_pixel_extents (layout, NULL, &logical_rect);
|
|
|
|
|
priv->max_week_char_width = MAX (priv->max_week_char_width,
|
2006-01-26 20:40:18 +00:00
|
|
|
|
logical_rect.width / 2);
|
2005-05-11 19:16:19 +00:00
|
|
|
|
}
|
|
|
|
|
|
2007-12-28 09:26:20 +00:00
|
|
|
|
/* Calculate detail extents. Do this as late as possible since
|
|
|
|
|
* pango_layout_set_markup is called which alters font settings. */
|
2007-12-28 22:11:35 +00:00
|
|
|
|
max_detail_height = 0;
|
2007-12-28 09:26:20 +00:00
|
|
|
|
|
2007-12-28 09:39:34 +00:00
|
|
|
|
if (priv->detail_func && (calendar->display_flags & GTK_CALENDAR_SHOW_DETAILS))
|
2007-12-28 09:26:20 +00:00
|
|
|
|
{
|
|
|
|
|
gchar *markup, *tail;
|
|
|
|
|
|
|
|
|
|
if (priv->detail_width_chars || priv->detail_height_rows)
|
|
|
|
|
{
|
|
|
|
|
gint rows = MAX (1, priv->detail_height_rows) - 1;
|
|
|
|
|
gsize len = priv->detail_width_chars + rows + 16;
|
|
|
|
|
|
|
|
|
|
markup = tail = g_alloca (len);
|
|
|
|
|
|
|
|
|
|
memcpy (tail, "<small>", 7);
|
|
|
|
|
tail += 7;
|
|
|
|
|
|
|
|
|
|
memset (tail, 'm', priv->detail_width_chars);
|
|
|
|
|
tail += priv->detail_width_chars;
|
|
|
|
|
|
|
|
|
|
memset (tail, '\n', rows);
|
|
|
|
|
tail += rows;
|
|
|
|
|
|
|
|
|
|
memcpy (tail, "</small>", 9);
|
|
|
|
|
tail += 9;
|
|
|
|
|
|
|
|
|
|
g_assert (len == (tail - markup));
|
|
|
|
|
|
|
|
|
|
pango_layout_set_markup (layout, markup, -1);
|
|
|
|
|
pango_layout_get_pixel_extents (layout, NULL, &logical_rect);
|
|
|
|
|
|
|
|
|
|
if (priv->detail_width_chars)
|
|
|
|
|
priv->min_day_width = MAX (priv->min_day_width, logical_rect.width);
|
|
|
|
|
if (priv->detail_height_rows)
|
2007-12-28 22:11:35 +00:00
|
|
|
|
max_detail_height = MAX (max_detail_height, logical_rect.height);
|
2007-12-28 09:26:20 +00:00
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
if (!priv->detail_width_chars || !priv->detail_height_rows)
|
|
|
|
|
for (r = 0; r < 6; r++)
|
|
|
|
|
for (c = 0; c < 7; c++)
|
|
|
|
|
{
|
2008-01-17 16:42:04 +00:00
|
|
|
|
gchar *detail = gtk_calendar_get_detail (calendar, r, c);
|
2007-12-28 09:26:20 +00:00
|
|
|
|
|
|
|
|
|
if (detail)
|
|
|
|
|
{
|
|
|
|
|
markup = g_strconcat ("<small>", detail, "</small>", NULL);
|
|
|
|
|
pango_layout_set_markup (layout, markup, -1);
|
|
|
|
|
|
|
|
|
|
if (priv->detail_width_chars)
|
|
|
|
|
{
|
|
|
|
|
pango_layout_set_wrap (layout, PANGO_WRAP_WORD_CHAR);
|
|
|
|
|
pango_layout_set_width (layout, PANGO_SCALE * priv->min_day_width);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
pango_layout_get_pixel_extents (layout, NULL, &logical_rect);
|
|
|
|
|
|
|
|
|
|
if (!priv->detail_width_chars)
|
|
|
|
|
priv->min_day_width = MAX (priv->min_day_width, logical_rect.width);
|
|
|
|
|
if (!priv->detail_height_rows)
|
2007-12-28 22:11:35 +00:00
|
|
|
|
max_detail_height = MAX (max_detail_height, logical_rect.height);
|
2007-12-28 09:26:20 +00:00
|
|
|
|
|
|
|
|
|
g_free (markup);
|
2008-01-17 16:42:04 +00:00
|
|
|
|
g_free (detail);
|
2007-12-28 09:26:20 +00:00
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
/* We add one to max_day_char_width to be able to make the marked day "bold" */
|
|
|
|
|
priv->max_day_char_width = priv->min_day_width / 2 + 1;
|
|
|
|
|
|
2005-05-11 19:16:19 +00:00
|
|
|
|
main_width = (7 * (priv->min_day_width + (focus_padding + focus_width) * 2) + (DAY_XSEP * 6) + CALENDAR_MARGIN * 2
|
|
|
|
|
+ (priv->max_week_char_width
|
|
|
|
|
? priv->max_week_char_width * 2 + (focus_padding + focus_width) * 2 + CALENDAR_XSEP * 2
|
|
|
|
|
: 0));
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
requisition->width = MAX (header_width, main_width + INNER_BORDER * 2) + widget->style->xthickness * 2;
|
|
|
|
|
|
|
|
|
|
/*
|
|
|
|
|
* Calculate the requisition height for the widget.
|
|
|
|
|
*/
|
|
|
|
|
|
|
|
|
|
if (calendar->display_flags & GTK_CALENDAR_SHOW_HEADING)
|
|
|
|
|
{
|
|
|
|
|
priv->header_h = (max_header_height + CALENDAR_YSEP * 2);
|
|
|
|
|
}
|
|
|
|
|
else
|
|
|
|
|
{
|
|
|
|
|
priv->header_h = 0;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
if (calendar->display_flags & GTK_CALENDAR_SHOW_DAY_NAMES)
|
|
|
|
|
{
|
|
|
|
|
priv->day_name_h = (priv->max_label_char_ascent
|
|
|
|
|
+ priv->max_label_char_descent
|
|
|
|
|
+ 2 * (focus_padding + focus_width) + calendar_margin);
|
|
|
|
|
calendar_margin = CALENDAR_YSEP;
|
|
|
|
|
}
|
|
|
|
|
else
|
|
|
|
|
{
|
|
|
|
|
priv->day_name_h = 0;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
priv->main_h = (CALENDAR_MARGIN + calendar_margin
|
|
|
|
|
+ 6 * (priv->max_day_char_ascent
|
|
|
|
|
+ priv->max_day_char_descent
|
2007-12-28 22:11:35 +00:00
|
|
|
|
+ max_detail_height
|
2005-05-11 19:16:19 +00:00
|
|
|
|
+ 2 * (focus_padding + focus_width))
|
|
|
|
|
+ DAY_YSEP * 5);
|
|
|
|
|
|
|
|
|
|
height = (priv->header_h + priv->day_name_h
|
|
|
|
|
+ priv->main_h);
|
|
|
|
|
|
|
|
|
|
requisition->height = height + (widget->style->ythickness + INNER_BORDER) * 2;
|
|
|
|
|
|
|
|
|
|
g_object_unref (layout);
|
|
|
|
|
}
|
2003-08-08 22:17:34 +00:00
|
|
|
|
|
2005-05-11 19:16:19 +00:00
|
|
|
|
static void
|
|
|
|
|
gtk_calendar_size_allocate (GtkWidget *widget,
|
|
|
|
|
GtkAllocation *allocation)
|
|
|
|
|
{
|
|
|
|
|
GtkCalendar *calendar = GTK_CALENDAR (widget);
|
|
|
|
|
GtkCalendarPrivate *priv = GTK_CALENDAR_GET_PRIVATE (widget);
|
|
|
|
|
gint xthickness = widget->style->xthickness;
|
|
|
|
|
gint ythickness = widget->style->xthickness;
|
|
|
|
|
guint i;
|
|
|
|
|
|
|
|
|
|
widget->allocation = *allocation;
|
2005-09-13 19:57:42 +00:00
|
|
|
|
|
1998-09-27 18:32:00 +00:00
|
|
|
|
if (calendar->display_flags & GTK_CALENDAR_SHOW_WEEK_NUMBERS)
|
|
|
|
|
{
|
2005-05-11 19:16:19 +00:00
|
|
|
|
priv->day_width = (priv->min_day_width
|
|
|
|
|
* ((allocation->width - (xthickness + INNER_BORDER) * 2
|
|
|
|
|
- (CALENDAR_MARGIN * 2) - (DAY_XSEP * 6) - CALENDAR_XSEP * 2))
|
|
|
|
|
/ (7 * priv->min_day_width + priv->max_week_char_width * 2));
|
|
|
|
|
priv->week_width = ((allocation->width - (xthickness + INNER_BORDER) * 2
|
|
|
|
|
- (CALENDAR_MARGIN * 2) - (DAY_XSEP * 6) - CALENDAR_XSEP * 2 )
|
|
|
|
|
- priv->day_width * 7 + CALENDAR_MARGIN + CALENDAR_XSEP);
|
1998-09-27 18:32:00 +00:00
|
|
|
|
}
|
|
|
|
|
else
|
|
|
|
|
{
|
2005-05-11 19:16:19 +00:00
|
|
|
|
priv->day_width = (allocation->width
|
|
|
|
|
- (xthickness + INNER_BORDER) * 2
|
|
|
|
|
- (CALENDAR_MARGIN * 2)
|
|
|
|
|
- (DAY_XSEP * 6))/7;
|
|
|
|
|
priv->week_width = 0;
|
1998-09-27 18:32:00 +00:00
|
|
|
|
}
|
1998-10-01 13:24:42 +00:00
|
|
|
|
|
1998-09-27 18:32:00 +00:00
|
|
|
|
if (GTK_WIDGET_REALIZED (widget))
|
|
|
|
|
{
|
|
|
|
|
gdk_window_move_resize (widget->window,
|
|
|
|
|
allocation->x, allocation->y,
|
1998-10-01 13:24:42 +00:00
|
|
|
|
allocation->width, allocation->height);
|
2005-05-11 19:16:19 +00:00
|
|
|
|
if (priv->header_win)
|
|
|
|
|
gdk_window_move_resize (priv->header_win,
|
2002-02-14 05:05:45 +00:00
|
|
|
|
xthickness, ythickness,
|
2005-05-11 19:16:19 +00:00
|
|
|
|
allocation->width - 2 * xthickness, priv->header_h);
|
|
|
|
|
|
|
|
|
|
for (i = 0 ; i < 4 ; i++)
|
2003-08-08 22:17:34 +00:00
|
|
|
|
{
|
2005-05-11 19:16:19 +00:00
|
|
|
|
if (priv->arrow_win[i])
|
|
|
|
|
{
|
|
|
|
|
GdkRectangle rect;
|
|
|
|
|
calendar_arrow_rectangle (calendar, i, &rect);
|
|
|
|
|
|
|
|
|
|
gdk_window_move_resize (priv->arrow_win[i],
|
|
|
|
|
rect.x, rect.y, rect.width, rect.height);
|
|
|
|
|
}
|
2003-08-08 22:17:34 +00:00
|
|
|
|
}
|
2005-05-11 19:16:19 +00:00
|
|
|
|
|
|
|
|
|
if (priv->day_name_win)
|
|
|
|
|
gdk_window_move_resize (priv->day_name_win,
|
2002-02-14 05:05:45 +00:00
|
|
|
|
xthickness + INNER_BORDER,
|
2005-05-11 19:16:19 +00:00
|
|
|
|
priv->header_h + (widget->style->ythickness + INNER_BORDER),
|
2002-02-14 05:05:45 +00:00
|
|
|
|
allocation->width - (xthickness + INNER_BORDER) * 2,
|
2005-05-11 19:16:19 +00:00
|
|
|
|
priv->day_name_h);
|
2003-08-08 22:17:34 +00:00
|
|
|
|
if (gtk_widget_get_direction (widget) == GTK_TEXT_DIR_LTR)
|
|
|
|
|
{
|
2005-05-11 19:16:19 +00:00
|
|
|
|
if (priv->week_win)
|
|
|
|
|
gdk_window_move_resize (priv->week_win,
|
2003-08-08 22:17:34 +00:00
|
|
|
|
(xthickness + INNER_BORDER),
|
2005-05-11 19:16:19 +00:00
|
|
|
|
priv->header_h + priv->day_name_h
|
2003-08-08 22:17:34 +00:00
|
|
|
|
+ (widget->style->ythickness + INNER_BORDER),
|
2005-05-11 19:16:19 +00:00
|
|
|
|
priv->week_width,
|
|
|
|
|
priv->main_h);
|
|
|
|
|
gdk_window_move_resize (priv->main_win,
|
|
|
|
|
priv->week_width + (xthickness + INNER_BORDER),
|
|
|
|
|
priv->header_h + priv->day_name_h
|
2003-08-08 22:17:34 +00:00
|
|
|
|
+ (widget->style->ythickness + INNER_BORDER),
|
|
|
|
|
allocation->width
|
2005-05-11 19:16:19 +00:00
|
|
|
|
- priv->week_width
|
2003-08-08 22:17:34 +00:00
|
|
|
|
- (xthickness + INNER_BORDER) * 2,
|
2005-05-11 19:16:19 +00:00
|
|
|
|
priv->main_h);
|
2003-08-08 22:17:34 +00:00
|
|
|
|
}
|
|
|
|
|
else
|
|
|
|
|
{
|
2005-05-11 19:16:19 +00:00
|
|
|
|
gdk_window_move_resize (priv->main_win,
|
2003-08-08 22:17:34 +00:00
|
|
|
|
(xthickness + INNER_BORDER),
|
2005-05-11 19:16:19 +00:00
|
|
|
|
priv->header_h + priv->day_name_h
|
2003-08-08 22:17:34 +00:00
|
|
|
|
+ (widget->style->ythickness + INNER_BORDER),
|
|
|
|
|
allocation->width
|
2005-05-11 19:16:19 +00:00
|
|
|
|
- priv->week_width
|
2003-08-08 22:17:34 +00:00
|
|
|
|
- (xthickness + INNER_BORDER) * 2,
|
2005-05-11 19:16:19 +00:00
|
|
|
|
priv->main_h);
|
|
|
|
|
if (priv->week_win)
|
|
|
|
|
gdk_window_move_resize (priv->week_win,
|
2003-08-08 22:17:34 +00:00
|
|
|
|
allocation->width
|
2005-05-11 19:16:19 +00:00
|
|
|
|
- priv->week_width
|
2003-08-08 22:17:34 +00:00
|
|
|
|
- (xthickness + INNER_BORDER),
|
2005-05-11 19:16:19 +00:00
|
|
|
|
priv->header_h + priv->day_name_h
|
2003-08-08 22:17:34 +00:00
|
|
|
|
+ (widget->style->ythickness + INNER_BORDER),
|
2005-05-11 19:16:19 +00:00
|
|
|
|
priv->week_width,
|
|
|
|
|
priv->main_h);
|
2003-08-08 22:17:34 +00:00
|
|
|
|
}
|
1998-09-27 18:32:00 +00:00
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
2005-05-11 19:16:19 +00:00
|
|
|
|
|
|
|
|
|
/****************************************
|
|
|
|
|
* Repainting *
|
|
|
|
|
****************************************/
|
|
|
|
|
|
|
|
|
|
static void
|
|
|
|
|
calendar_paint_header (GtkCalendar *calendar)
|
1998-09-27 18:32:00 +00:00
|
|
|
|
{
|
2005-05-11 19:16:19 +00:00
|
|
|
|
GtkWidget *widget = GTK_WIDGET (calendar);
|
|
|
|
|
GtkCalendarPrivate *priv = GTK_CALENDAR_GET_PRIVATE (calendar);
|
|
|
|
|
cairo_t *cr;
|
|
|
|
|
char buffer[255];
|
|
|
|
|
int x, y;
|
2005-09-13 19:57:42 +00:00
|
|
|
|
gint header_width;
|
2005-05-11 19:16:19 +00:00
|
|
|
|
gint max_month_width;
|
|
|
|
|
gint max_year_width;
|
|
|
|
|
PangoLayout *layout;
|
|
|
|
|
PangoRectangle logical_rect;
|
|
|
|
|
gboolean year_left;
|
2005-06-12 06:59:43 +00:00
|
|
|
|
time_t tmp_time;
|
|
|
|
|
struct tm *tm;
|
|
|
|
|
gchar *str;
|
1998-10-04 23:07:04 +00:00
|
|
|
|
|
2005-05-11 19:16:19 +00:00
|
|
|
|
if (gtk_widget_get_direction (widget) == GTK_TEXT_DIR_LTR)
|
|
|
|
|
year_left = priv->year_before;
|
|
|
|
|
else
|
|
|
|
|
year_left = !priv->year_before;
|
|
|
|
|
|
|
|
|
|
cr = gdk_cairo_create (priv->header_win);
|
1998-10-01 13:24:42 +00:00
|
|
|
|
|
2002-02-14 05:05:45 +00:00
|
|
|
|
header_width = widget->allocation.width - 2 * widget->style->xthickness;
|
1998-10-01 13:24:42 +00:00
|
|
|
|
|
2005-05-11 19:16:19 +00:00
|
|
|
|
max_month_width = priv->max_month_width;
|
|
|
|
|
max_year_width = priv->max_year_width;
|
1998-10-01 13:24:42 +00:00
|
|
|
|
|
2005-05-11 19:16:19 +00:00
|
|
|
|
gtk_paint_shadow (widget->style, priv->header_win,
|
2002-10-09 22:11:08 +00:00
|
|
|
|
GTK_STATE_NORMAL, GTK_SHADOW_OUT,
|
|
|
|
|
NULL, widget, "calendar",
|
2005-05-11 19:16:19 +00:00
|
|
|
|
0, 0, header_width, priv->header_h);
|
2005-06-12 06:59:43 +00:00
|
|
|
|
|
|
|
|
|
tmp_time = 1; /* Jan 1 1970, 00:00:01 UTC */
|
|
|
|
|
tm = gmtime (&tmp_time);
|
|
|
|
|
tm->tm_year = calendar->year - 1900;
|
|
|
|
|
|
|
|
|
|
/* Translators: This dictates how the year is displayed in
|
|
|
|
|
* gtkcalendar widget. See strftime() manual for the format.
|
|
|
|
|
* Use only ASCII in the translation.
|
|
|
|
|
*
|
|
|
|
|
* Also look for the msgid "year measurement template|2000".
|
|
|
|
|
* Translate that entry to a year with the widest output of this
|
|
|
|
|
* msgid.
|
|
|
|
|
*
|
|
|
|
|
* Don't include the prefix "calendar year format|" in the
|
|
|
|
|
* translation. "%Y" is appropriate for most locales.
|
|
|
|
|
*/
|
|
|
|
|
strftime (buffer, sizeof (buffer), Q_("calendar year format|%Y"), tm);
|
|
|
|
|
str = g_locale_to_utf8 (buffer, -1, NULL, NULL, NULL);
|
|
|
|
|
layout = gtk_widget_create_pango_layout (widget, str);
|
|
|
|
|
g_free (str);
|
1998-09-27 18:32:00 +00:00
|
|
|
|
|
2000-07-02 21:32:56 +00:00
|
|
|
|
pango_layout_get_pixel_extents (layout, NULL, &logical_rect);
|
Remove all references to offscreen flag which was no longer used.
Thu Jun 1 23:05:13 2000 Owen Taylor <otaylor@redhat.com>
* gtk/gtkwidget.c: Remove all references to
offscreen flag which was no longer used.
* gtk/gtkprivate.h (enum): Remove unused flags and compress.
* gtk/gtkframe.c (gtk_frame_set_label_widget): Check
for non-null label_widget->parent.
* gtk/gtkentry.c: Get rid of code to deal with PangoAttribute
which no longer was used.
* gdk/gdkpango.c (gdk_pango_context_get_info): make static.
* gdk/gdkpango.c (gdk_draw_layout[_line]): Add checks
for null arguments.
* gdk/x11/gdkgeometry-x11.c (gdk_window_scroll): add
check for destroyed windows.
Thu Jun 1 13:48:45 2000 Owen Taylor <otaylor@redhat.com>
* gtk/gtkimmulticontext.c: Add a finalize method and unref
the slave context there.
* gtk/gtkinvisible.[ch]: Make reference counting behavior
identical to GtkWindow.
Thu Jun 1 01:54:11 2000 Owen Taylor <otaylor@redhat.com>
* Makefile.am gdk/gdkpango.c: Copy the layout render function from
pangox to here, so we can write them independent of rendering
system, using GDK primitives.
* gdk/gdkdrawable.h gdk/gdkdraw.c gdk/gdkwindow.c
gdk/x11/gdkdrawable-x11.c: Remove draw_layout() from the vtable,
since we have a rendering-system independent implementation in
terms of draw_glyphs().
* gdk/gdkpango.c gdkdrawable.h (gdk_draw_layout_line): New
function to render a single line.
* gdk/x11/gdkpango.c: Move the guts of this file mostly
into ../gdkpango.c, which simplifies things, since we
don't have to deal with raw X gc's.
Fri May 19 04:28:16 2000 Owen Taylor <otaylor@redhat.com>
* gtk/gtktextlayout.[ch]: Add get_log_attrs() function to
get the logical attributes for a given GtkTextLine.
Tue May 30 16:05:39 2000 Owen Taylor <otaylor@redhat.com>
* gdk/x11/gdkfont-x11.c (gdk_font_charset_for_locale): Track
g_locale_get_codeset() to g_get_codeset() change.
Tue May 30 15:03:19 2000 Owen Taylor <otaylor@redhat.com>
* gtk/testcalendar.c (calendar_font_selection_ok): Use font
descriptions.
* gtk/gtkentry.c (gtk_entry_draw_text): Center text within
the entry.
* gtk/gtkfontsel.c (gtk_font_selection_dialog_init): Start of
redoing (vastly simplifying) for Pango. Still needs quite
a bit of work. (Size selection is currently poor. List of
predefined sizes is not a good idea, since all of these
sizes won't necessarily be distinct.)
Tue May 30 13:50:19 2000 Owen Taylor <otaylor@redhat.com>
* gdk/x11/gdkfont-x11.c (gdk_font_charset_for_locale): Handle
CODESET results for LANG=C.
Mon May 29 15:49:10 2000 Owen Taylor <otaylor@redhat.com>
* gtk/gtkrc.[ch]: Add a 'font_name' declaration to RC
which takes a stringized pango font description;
ignore the older 'font' and 'fontset' declarations.
* gtk/gtkstyle.c gtk/gtkrc.c: Fill in the style->font
field with a GdkFont derived via gdk_font_from_description(),
for compatibility. (Should we just remove it entirely?
Probably too much compatibility breakage, but people
should be migrating to the new Pango stuff as quickly
as possible.)
Mon May 29 15:47:41 2000 Owen Taylor <otaylor@redhat.com>
* gtk/gtkentry.c gtk/gtkclist.c: s/pango_font_unref/g_object_unref/.
Mon May 29 15:44:46 2000 Owen Taylor <otaylor@redhat.com>
* gtk/gtkcalender.c: Roughly pango-ized. Really needs
redoing; there are some bugs in size allocation right
now, the semi-existant distinction between header / day
fonts was removed, but, with Pango, could actually
be made functional in a nice way.
* gtk/testcalender: Move calender from examples into this
directory as a test program. (We really need to restrcture
testgtk into a whole directory full of tests for every
widget or functionality group, separated into multiple .c
files.)
Mon May 29 15:19:56 2000 Owen Taylor <otaylor@redhat.com>
* gtk/testgtk.c (file_exists): Fix stupid typo that
was keeping RC file from being loaded.
* gtk/testgtkrc gtk/testgtkrc2: Test new pango-ized
RC file font code.
Mon May 29 14:31:27 2000 Owen Taylor <otaylor@redhat.com>
* gdk/gdkfont.h gdk/x11/gdkfont-x11.c (gdk_font_from_description):
Add function to load a GdkFont from a PangoFontDescription.
Fri May 26 17:16:40 2000 Owen Taylor <otaylor@redhat.com>
* gtk/frame.[ch] gtkaspectframe.c: Make frame widgets able
to have any widget for the label, use a GtkLabel widget
to display the text. (Based partially on a patch from
Anders Carlson.)
(Quite a bit of code reorganization - strip 90% of the
guts out of gtkaspectframe and add a single virtual
func to GtkFrameClass - compute_child_allocation.)
Fri May 26 12:00:02 2000 Owen Taylor <otaylor@redhat.com>
* gtk/gtkctree.c gtk/gtkclist.[ch]: Pangoized.
(Removed clist->row_center_offset field because caching
it wasn't saving time or code, added private function
_gtk_clist_create_cell_layout()).
Wed May 24 15:59:37 2000 Owen Taylor <otaylor@redhat.com>
* gtk/gtkaccellabel.c: Pangoized.
* gtk/[hv]ruler.c: Pangoized
Mon May 22 19:23:59 2000 Owen Taylor <otaylor@redhat.com>
* gtk/gtkfilesel.c (gtk_file_selection_init):
Use gtk_clist_set_column_auto_resize() to remove need
need for manual column width computations.
Mon May 22 18:50:26 2000 Owen Taylor <otaylor@redhat.com>
* gtk/gtktooltips.[ch]: Replace custom drawing with a GtkLabel,
ensuring Pango correctness, and considerably simplifying the
code.
* gtk/gtklabel.c gtk[hv]scale.c: 1000 => PANGO_SCALE.
* gtk/gtklabel.c (gtk_label_size_request): Fixed incorrect
getting of numbers of lines.
* gtk/gtklabel.c (gtk_label_size_request): Set the requisition
to the actual requested width of the lable, not to the wrap
width we set.
* gtk/gtktextchild.h: Remove extraneous include of gtk/gtk.h.
* gtk/gtktextbtree.c gtk/gtktextbuffer.c gtk/gtktextlayout.c
gtk/gtktextview.c gtk/gtktextview.[ch]: Fix up includes.
* gtk/gtktextview.c: Fix structure inheritance.
* gtk/gtkprogressbar.c: Pangoize.
Mon May 22 15:47:30 2000 Owen Taylor <otaylor@redhat.com>
* gtk/gtktextview.c (gtk_text_view_get_first_para_iter): Encapsulate
in a function.
* gtk/gtktextlayout.c (find_display_line_above): Fixed
bug with computing line tops.
* gtk/gtktextview.c (changed_handler): Fix < , <= confusion.
Thu May 18 18:53:31 2000 Owen Taylor <otaylor@redhat.com>
* gtk/gtktextdisplay.c (gtk_text_layout_draw): Fix up the x_offset
and y_offset coordinates to do what we need now. (The offset between
buffer and layout coordinates has been reintroduced, but is a
bit different than before.)
* gtk/gtktextview.[ch]: No longer inherit from GtkLayout; instead
handle the adjustments ourselves, and scroll as necessary using
the new gdk_window_scroll().
The advantage of this is that when we are incrementally revalidating,
we are essentially rearranging things around the visible portion
of the screen. With the old setup, the visible portion of the
screen was moved around in the layout, so scrolling and redrawing
to track that caused jumping of the display. Since we now
control the scrolling ourselves, we can suppress this and
only redraw when things actually change.
Thu May 18 18:47:25 2000 Owen Taylor <otaylor@redhat.com>
* gtk/gtktextbtree.c (redisplay_mark): We need to invalidate
the region not just redisplay it after-all, since we store the
cursors in the LineDisplay. (Ugly interactions here between
GtkLayout and GtkTextBTree here.)
* gtk/gtktextbtree.c (redisplay_region): Fixed reversed comparison.
Thu May 18 18:43:21 2000 Owen Taylor <otaylor@redhat.com>
* gdk/gdkwindow.h gdk/x11/gdkgeometry-x11.c (gdk_window_scroll):
Added function to scroll contents of a window while keeping the
window constant. Works by XCopyArea or guffaw-scrolling depending
on the details of how the window is set up. (guffaw-scrolling
still needs to be filled in.)
Wed May 17 22:36:53 2000 Owen Taylor <otaylor@redhat.com>
* gtk/gtktextiter.c gtk/gtkmain.c: Add a debug key for the text widget,
move the debugging that was tied to a global variable
to that.
* gtk/gtkmarshal.list: Add NONE:INT,INT,INT
* gtk/gtktextbtree.[ch] gtk/gtktextlayout.c: Keep a separate
validated flag, in line data instead of setting height/width to
-1. This allows us to perform operations with partially invalid
buffer (using the old size for invalid lines) and thus to do
incremental vaidation. Keep height/width aggregates up to date
when deleting text and rebalancing the tree.
* gtk/gtktextbtree.[ch]: Add functions validate a line
(gtk_text_btree_validate_line), and to validate up
to a number of pixels (gtk_text_btree_validate).
* gtk/gtktextlayout.[ch]: Add an ::invalidated signal
that indicates that something is changed and a revalidation
pass is needed. Change ::need_repaint to ::changed, and
make it take old and new yranges instead of a rectangle.
* gtk/gtktextbtree.[ch] gtk/gtktextlayout.[ch]: Move
the line_data_destroy() function from
gtk_text_btree_add_view() to a virtual function in
GtkTextLayout
* gtk/gtktextbtree.[ch]: Remove gtk_text_btree_get_damage_range(),
since we are handling partial repaints in a different fashion
now.
* gtk/gtktextbtree.[ch]: Only repaint the changed portion
of the selection instead of queueing a repaint on the
entire widget.
* gtk/gtktextbuffer.[ch] gtk/gtktextbtree.[ch]: Move
get_selection_bounds() down to btree, make the function
in buffer a wrapper around the btree function.
* gtk/gtktextlayout.[ch]: Add functions to check if the
layout is valid and to recompute either a range of pixels
aroudn a line or a certain total number of pixels.
* gtk/gtktextlayout.[ch]: Cache a single line display;
now that we only redraw the needed portions, the hit rate
for this cache is quite high.
* gtk/gtktextview.[ch]: Keep track of the first paragraph
on the screen so that when re-laying-out the buffer, we can
keep the same place. This requires connecting to ::value_changed
on the adjustments
* gtk/gtktextview.[ch]: Add idle functions to revalidate
the buffer after we receive an ::invalidated signal.
Wed May 17 22:10:47 2000 Owen Taylor <otaylor@redhat.com>
* gtk/gtklayout.c (gtk_layout_size_allocate): Set upper
to max of allocation and layout size, not just to the
layout size.
* gtk/gtk[hv]scrollbar.c (gtk_[hv]scrollbar_calc_slider_size):
Invalidate window so it gets redrawn properly.
* gdk/gdkwindow.c (gdk_window_invalidate_rect): Allow rect == NULL
to mean the entire window.
* gdk/gdkevents.h: Move definition for GDK_PRIORITY_REDRAW
into public header.
Mon May 15 14:51:31 2000 Owen Taylor <otaylor@redhat.com>
* gtk/gtktextmark.c (gtk_text_mark_get_name): Add function
to get the name of a mark.
* gtk/gtktextlayout.c (gtk_text_layout_get_line_at_y): Add a function
to find the paragraph from a y position.
Thu May 11 12:57:20 2000 Owen Taylor <otaylor@redhat.com>
* gtk/gtktextbtree.c (gtk_text_btree_node_invalidate_upward): Valid
nodes have width/height >= 0, not > 0.
Tue May 9 21:29:06 2000 Owen Taylor <otaylor@redhat.com>
* gtk/gtktextlayout.[ch] gtk/gtktextdisplay.c (gtk_text_layout_get_line_display):
Add a size_only flag, so when we only need the size, we don't create
useless appearance attributes.
* gtk/gtktextview.c (gtk_text_view_ensure_layout): Remove
duplicate setting of font description.
* gtk/gtkscale.c: Use PANGO_SCALE instead of 1000
Wed Apr 26 01:53:23 2000 Owen Taylor <otaylor@redhat.com>
* gtk/Makefile.am (EXTRA_DIST): Add OLD_STAMP into
EXTRA_DIST. It does not work well when the file that
everything depends on is not in the tarball.
Wed Apr 26 00:56:14 2000 Owen Taylor <otaylor@redhat.com>
* gtk/testgtk.c: Some hacks and fixes so that it basically
works when not sitting in the GTK+ build tree.
2000-05-03 Havoc Pennington <hp@redhat.com>
* gtk/gtktextbtree.c (gtk_text_line_next_could_contain_tag):
Properly determine the ordering of the tag root and the current
line within the tree. Previous algorithm only worked if the tag
root's immediate parent was the common root of both the current
line and the tag root.
Wed Apr 26 00:43:00 2000 Owen Taylor <otaylor@redhat.com>
* gtk/gtktextlayout.c (set_para_values): Fix some bugs in
alignment.
* gtk/gtktextview.c (gtk_text_view_ensure_layout): Track
the widget text directional dynamically.
* gtk/gtktextview.[ch]: Added functions to get and set default
wrap mode.
Tue Apr 25 23:47:38 2000 Owen Taylor <otaylor@redhat.com>
* gtk/gtktextlayout.c (gtk_text_layout_get_iter_location): Fix bug
in cursor location computation.
Tue Apr 25 23:22:59 2000 Owen Taylor <otaylor@redhat.com>
* gtk/gtklayout.c (gtk_layout_set_size): Clamp hadjustment/
vadjusment values properly when layout gets smaller.
* gtk/gtktextview.c (need_repaint_handler): Areas being
passed in are far completely inaccurate, and sometimes
too small, so, for now, just queue a redraw on the
whole visible region.
2000-04-25 Havoc Pennington <hp@redhat.com>
* gtk/gtktextbtree.c (summary_destroy): new function to
destroy tag summary nodes
(gtk_text_line_next_could_contain_tag): this function was
totally broken if the line passed in wasn't below the tag
root. Fix it.
(gtk_text_btree_first_could_contain_tag): In the tag == NULL
"wildcard" case, we have to do a linear scan. Blah.
(gtk_text_btree_last_could_contain_tag): In tag == NULL case,
we have to do the linear scan
(tag_removed_cb): When a tag is removed from the tag table,
remove the GtkTextTagInfo node from the btree.
(gtk_text_btree_spew): Implement the spew function, for
our debugging pleasure.
Tue Apr 25 19:40:18 2000 Owen Taylor <otaylor@redhat.com>
* gtk/gtktextlayout.c (gtk_text_layout_set_buffer): Fix
a problem with referring to the wrong buffer.
* gtk/gtkentry.c: Fix focus-in/focus-out confusion.
* gtk/gtkrc.c gtk/gtkstyle.c: Moving setting default
font description to gtk_style_new() - otherwise things
don't work without a .gtkrc file.
* gtk/gtktextbuffer.c (gtk_text_buffer_new): Sink the
tags table if we create it ourself, too.
* gdk/gdktypes.h (enum): Move GDK_RELEASE_MASK, since
it was conflicting with XKB modifiers.
* gtk/gtktextview.[ch]: Add simple support for
GtkIMContext.
Mon Apr 24 19:34:18 2000 Owen Taylor <otaylor@redhat.com>
* gtk/gtkentry.c (gtk_entry_move_cursor_visually): Fix problem
with deletion from last commit.
Mon Apr 24 19:29:40 2000 Owen Taylor <otaylor@redhat.com>
* gtk/gtkwidget.c (gtk_widget_create_pango_context): Set the language
in the context from the current locale.
* gtk/gtkentry.c (gtk_entry_size_request): Use language from the
context, not hardcoded value.
* gtk/gtkentry.c (gtk_entry_move_cursor): Make character movement visual,
not logical.
Sun Apr 23 23:39:18 2000 Owen Taylor <otaylor@redhat.com>
* gtk/gtkentry.c gtk/gtktextdisplay.c: Don't handle selections as
attributes - that doesn't handle partial-glyph selection
properly. Instead use new pango_layout_line_get_x_ranges()
functionality to draw the selection.
* gtk/gtkentry.c: Simplify code since pango_layout_line_index_to_x()
now properly handles out-of-range coordinates.
* gtk/gtktextbuffer.c: Emit "mark_set" when the cursor is moved.
* gtk/gtktextiter.h gtk/gtktextiterprivate.h: Make gtk_text_iter_get_line_byte()
public.
* gtk/gtktextlayout.[ch]: Properly set the direction in the PangoContext
for paragraphs opposite to the base direction of the widget.
* gtk/gtktextlayout.[ch] gtk/gtktextdisplay.c: Fixes for alignment.
* gtk/gtktextlayout.c: Don't split segments on marks, since that
causes Arabic words to reshape as you cursor through.
* gtk/gtktextlayout.[ch] gtk/gtktextview.[ch]: Implement virtual
cursor position when moving vertically with the arrow keys and
scrolling with page-up/page-down. (Arrow keys save only the X,
scrolling saves both X and Y.)
This means you can line-up / line-down or page-up / page-down
without losing your place, and also that moving vertically
with the cursor keys keeps the same X position, not the same
character count:
* gtk/gtktextlayout.[ch] gtk/gtktextview.[ch]: Make vertical
arrow keys move by display lines, not paragraphs.
Tue Apr 18 14:16:50 2000 Owen Taylor <otaylor@redhat.com>
* gtk/gtklayout.c: Make sure that the bin window is at least
as big as the allocation. (Should we also make sure that the
bin window is big enough to completely cover widget->window?)
* gtk/gtktextview.c (gtk_text_view_get_visible_rect): Add
function to get the onscreen rectangle.
* gdk/x11/gdkwindow-x11.c (gdk_window_get_pointer): Correctly account
for offsets in window coordinates.
Sun Apr 16 16:13:27 2000 Owen Taylor <otaylor@redhat.com>
* gtk/gtkentry.c (gtk_entry_get_cursor_locations): Fix index/offset
confusion.
* gtk/gtktextview.c (gtk_text_view_ensure_layout): Set the default direction
from the widget direction.
* gtk/gtktexttag.c gtk/gtktexttagprivate.h (gtk_text_tag_set_arg):
Add a "direction" attribute.
* gtk/gtktextview.c: global s/tkxt/text_view/.
* gtk/testtext.c: Added long block of text in Arabic, to test out
the direction attributes. (Some problems with the shaping system
for arabic become obvious - like the fact the cursor splits words
into unjoined pieces.)
Fri Apr 14 12:54:34 2000 Owen Taylor <otaylor@redhat.com>
* gtk/gtktextdisplay.c (render_layout): Add overstrike handling.
* gtk/gtktextlayout.c: Fix up alignment.
* gtk/testtext.c: Add some tests for centering, wrapping.
Fri Apr 14 09:26:22 2000 Owen Taylor <otaylor@redhat.com>
* gdk/gdkdrawable.h gdk/gdkdraw.c gdk/gdkwindow.c gdk/x11/gdkdrawable-x11.c:
Add a draw_glyphs() operation to the drawable vtable and gdk_draw_glyphs().
If we wrote GTK+-specific layout-render function this could just replace
the draw_layout() operation in the vtable.
* gtk/gtkentry.c: Move guts of gtk_entry_get_cursor_locations to
pango_layout_get_cursor_pos() and use that function.
* gtk/gtktextchild.[ch]: add gtk_ onto pixmap_segment_new(), since it
is a non-static symbol.
* gtk/gtktextbtree.[ch]: Replace gtk_text_btree_find_line_data_by_y()
with gtk_text_btree_find_line_by_y()
* gtk/gtktextdisplay.c: Rewrote for Pango - uses a custom layout
renderer that handles GtkTextAppearance attributes.
* gtk/gtktexttag.[ch] gtk/gtktexttagprivate.h:
- Move the values in the style that don't affect geometry into a
GtkTextAppearance structure.
- Change underline to take a PangoUnderline and "font" a string
representation of a font description
- Add a "font_desc" attribute which takes a FontDescription structure.
* gtk/gtktextlayout.[ch]:
- Get rid of the display-line list per each line. Instead, we
generate, on demand, a GtkTextLineDisplay structure which]
contains a PangoLayout * and other necesary information
(offsets, cursor locations) for displaying a paragraph.
- Get rid of the code to wrap lines, create display chunks,
etc. Instead, we just go through a paragraph and convert
it into the necessary inputs to a PangoLayout.
- Implement a new attribute type, GtkTextAttrAppearance. This
holds a GtkTextAppearance, and is used to pass colors,
stipple, etc, through from the layout to the display without
having to use lots and lots of individual attributes.
- Reimplement gtk_layout_get_iter_at_pixel() gtk_layout_get_iter_pos()
in terms of PangoLayout functions.
* gtk/gtktextview.c:
- Handle passing the necessary PangoContext to the layout
- Some fixups in painting to deal with the automatic backing store
and offsetting of GTK+-1.4
- Add a style_set handler so that the default style reacts
properly to theme changes.
* gtk/gtktext?*.[ch]: Random code-style fixes.
* gtk/testtext.c: Substitute in languages that Pango handles now for Thai
Mon Apr 10 10:33:45 2000 Owen Taylor <otaylor@redhat.com>
* gtk/gtktext?*.[ch]: Check in Havoc's port of the Tk text widget,
in original form preparatory to Pango-ization and gdkimcontext-ization.
Thu Apr 6 19:25:39 2000 Owen Taylor <otaylor@redhat.com>
* gtk/gtkimcontext.c: Move default implementations to real_* vfuncs,
so that we can derive from gtkimcontext in language bindings properly.
Thu Apr 6 16:02:52 2000 Owen Taylor <otaylor@redhat.com>
* gtk/gtkimcontextsimple.[ch]: Use gdk_keyval_to_unicode to gdk_unicode_to_keyval.
Add a compose table including (almost) all the compose combinations
from X. This is 6k of static, shared data as opposed to 50k or so of dynamic
data in the XIM implementation.
* gdk/gdk.h gdk/gdkkeyuni.c gdk/win32/gdkevents-win32.c (gdk_keyval_to_unicode, gdk_unicode_to_keyval):
Moved functions to convert keyvalues from and to unicode here from
the win32 port and made them public.
Wed Apr 5 16:37:29 2000 Owen Taylor <otaylor@redhat.com>
* gtk/gtkeditable.c (gtk_editable_insert_text): Allow new_text_length == -1.
Wed Apr 5 16:27:45 2000 Owen Taylor <otaylor@redhat.com>
* gtk/gtkimcontext.[ch]: Base class for new input context system
* gtk/gtkimmulticontext.[ch]: Proxy input context that allows
the real input context implementation to be loaded from modules
and switched on the fly.
* gtk/gtkcontextsimple.[ch]: Simple implementation of an input
context that just does direct keysymbol => unicode translation.
* gtk/gtkentry.[ch]: Start switching editing over to using
GtkInputContext. (No handling of preedit yet.)
Wed Apr 5 15:48:41 2000 Owen Taylor <otaylor@redhat.com>
* gtk/gtktypeutils.h (GTK_CHECK_GET_CLASS): Fix problem with one too
many substitutions. (klass should not be subsituted.)
Wed Apr 5 00:18:14 2000 Owen Taylor <otaylor@redhat.com>
* configure.in: Add checks for Pango
* configure.in docs/Makefile.am: Add test for sgml2html
and allow 'make dist' without building html, but print out
warnings in that case. (For making snapshots)
* gdk/Makefile.am gdk/x11/Makefile.am gtk/Makefile.am:
Add Pango libraries and C flags
* gdk/gdkdraw.c gdk/gdkdrawable.h gdkwindow.c gdk/x11/gdkdrawable-x11.c:
Add function (gdk_draw_layout) to draw a pango layout.
* gdk/gdkpango.h gdk/x11/gdkpango-x11.c: New file with functions
for getting Pango contexts for GDK.
* gtk/gtkeditable.c: Get rid of dead code gtk_editable_parent_set()
* gtk/gtkentry.[ch]: Complete rewrite to use Pango, add bidirectional
editing.
* gtk/gtkentry.c: Hack in simple Hebrew input with direct
keysym => unicode translations. More languages can be added
here, but real input-method support is needed.
* docs/Changes-1.4.txt: Added note about entry behavior.
* gtk/gtkenums.h gtk/gtkwidget.[ch] testgtk.c gtkprivate.h: Add functions
to set the reading direction for a widget and the global direction.
Add test which allows toggling the global direction. Two private
flags are used to store the direction. (GTK_DIRECTION_SET + GTK_DIRECTION_LTR)
* gtk/gtkcheckbutton.c gtk/gtkframe.c gtk/gtkhbbox.c gtk/gtkhbox.c
gtk/gtkradiobutton.c gtk/gtkspinbutton.c gtk/gtktable.c
* gtk/gtk[hv]scale.c gtk/gtkscale.[ch]: Draw numbers using Pango
* gtk/gtklabel.[ch]: Moved to Pango and considerably rewritten. Line breaking,
underlining now handled by Pango.
* gtk/gtkstyle.[ch] gtk/gtkrc.[ch]: Add a PangoFontDescription
to RCStyle and Style. (Having both this and the old font name and GdkFont
is temporary.)
* gtk/gtkwidget.[ch] (gtk_widget_create_pango_{context,layout}): Added
convenience functions for creating contexts and layouts for widgets.
* gtk/testgtk.c: Enhance label tests with multilingual labels.
2000-06-02 03:14:07 +00:00
|
|
|
|
|
1998-09-27 18:32:00 +00:00
|
|
|
|
/* Draw title */
|
2005-05-11 19:16:19 +00:00
|
|
|
|
y = (priv->header_h - logical_rect.height) / 2;
|
1998-10-01 13:24:42 +00:00
|
|
|
|
|
1998-09-27 18:32:00 +00:00
|
|
|
|
/* Draw year and its arrows */
|
Remove all references to offscreen flag which was no longer used.
Thu Jun 1 23:05:13 2000 Owen Taylor <otaylor@redhat.com>
* gtk/gtkwidget.c: Remove all references to
offscreen flag which was no longer used.
* gtk/gtkprivate.h (enum): Remove unused flags and compress.
* gtk/gtkframe.c (gtk_frame_set_label_widget): Check
for non-null label_widget->parent.
* gtk/gtkentry.c: Get rid of code to deal with PangoAttribute
which no longer was used.
* gdk/gdkpango.c (gdk_pango_context_get_info): make static.
* gdk/gdkpango.c (gdk_draw_layout[_line]): Add checks
for null arguments.
* gdk/x11/gdkgeometry-x11.c (gdk_window_scroll): add
check for destroyed windows.
Thu Jun 1 13:48:45 2000 Owen Taylor <otaylor@redhat.com>
* gtk/gtkimmulticontext.c: Add a finalize method and unref
the slave context there.
* gtk/gtkinvisible.[ch]: Make reference counting behavior
identical to GtkWindow.
Thu Jun 1 01:54:11 2000 Owen Taylor <otaylor@redhat.com>
* Makefile.am gdk/gdkpango.c: Copy the layout render function from
pangox to here, so we can write them independent of rendering
system, using GDK primitives.
* gdk/gdkdrawable.h gdk/gdkdraw.c gdk/gdkwindow.c
gdk/x11/gdkdrawable-x11.c: Remove draw_layout() from the vtable,
since we have a rendering-system independent implementation in
terms of draw_glyphs().
* gdk/gdkpango.c gdkdrawable.h (gdk_draw_layout_line): New
function to render a single line.
* gdk/x11/gdkpango.c: Move the guts of this file mostly
into ../gdkpango.c, which simplifies things, since we
don't have to deal with raw X gc's.
Fri May 19 04:28:16 2000 Owen Taylor <otaylor@redhat.com>
* gtk/gtktextlayout.[ch]: Add get_log_attrs() function to
get the logical attributes for a given GtkTextLine.
Tue May 30 16:05:39 2000 Owen Taylor <otaylor@redhat.com>
* gdk/x11/gdkfont-x11.c (gdk_font_charset_for_locale): Track
g_locale_get_codeset() to g_get_codeset() change.
Tue May 30 15:03:19 2000 Owen Taylor <otaylor@redhat.com>
* gtk/testcalendar.c (calendar_font_selection_ok): Use font
descriptions.
* gtk/gtkentry.c (gtk_entry_draw_text): Center text within
the entry.
* gtk/gtkfontsel.c (gtk_font_selection_dialog_init): Start of
redoing (vastly simplifying) for Pango. Still needs quite
a bit of work. (Size selection is currently poor. List of
predefined sizes is not a good idea, since all of these
sizes won't necessarily be distinct.)
Tue May 30 13:50:19 2000 Owen Taylor <otaylor@redhat.com>
* gdk/x11/gdkfont-x11.c (gdk_font_charset_for_locale): Handle
CODESET results for LANG=C.
Mon May 29 15:49:10 2000 Owen Taylor <otaylor@redhat.com>
* gtk/gtkrc.[ch]: Add a 'font_name' declaration to RC
which takes a stringized pango font description;
ignore the older 'font' and 'fontset' declarations.
* gtk/gtkstyle.c gtk/gtkrc.c: Fill in the style->font
field with a GdkFont derived via gdk_font_from_description(),
for compatibility. (Should we just remove it entirely?
Probably too much compatibility breakage, but people
should be migrating to the new Pango stuff as quickly
as possible.)
Mon May 29 15:47:41 2000 Owen Taylor <otaylor@redhat.com>
* gtk/gtkentry.c gtk/gtkclist.c: s/pango_font_unref/g_object_unref/.
Mon May 29 15:44:46 2000 Owen Taylor <otaylor@redhat.com>
* gtk/gtkcalender.c: Roughly pango-ized. Really needs
redoing; there are some bugs in size allocation right
now, the semi-existant distinction between header / day
fonts was removed, but, with Pango, could actually
be made functional in a nice way.
* gtk/testcalender: Move calender from examples into this
directory as a test program. (We really need to restrcture
testgtk into a whole directory full of tests for every
widget or functionality group, separated into multiple .c
files.)
Mon May 29 15:19:56 2000 Owen Taylor <otaylor@redhat.com>
* gtk/testgtk.c (file_exists): Fix stupid typo that
was keeping RC file from being loaded.
* gtk/testgtkrc gtk/testgtkrc2: Test new pango-ized
RC file font code.
Mon May 29 14:31:27 2000 Owen Taylor <otaylor@redhat.com>
* gdk/gdkfont.h gdk/x11/gdkfont-x11.c (gdk_font_from_description):
Add function to load a GdkFont from a PangoFontDescription.
Fri May 26 17:16:40 2000 Owen Taylor <otaylor@redhat.com>
* gtk/frame.[ch] gtkaspectframe.c: Make frame widgets able
to have any widget for the label, use a GtkLabel widget
to display the text. (Based partially on a patch from
Anders Carlson.)
(Quite a bit of code reorganization - strip 90% of the
guts out of gtkaspectframe and add a single virtual
func to GtkFrameClass - compute_child_allocation.)
Fri May 26 12:00:02 2000 Owen Taylor <otaylor@redhat.com>
* gtk/gtkctree.c gtk/gtkclist.[ch]: Pangoized.
(Removed clist->row_center_offset field because caching
it wasn't saving time or code, added private function
_gtk_clist_create_cell_layout()).
Wed May 24 15:59:37 2000 Owen Taylor <otaylor@redhat.com>
* gtk/gtkaccellabel.c: Pangoized.
* gtk/[hv]ruler.c: Pangoized
Mon May 22 19:23:59 2000 Owen Taylor <otaylor@redhat.com>
* gtk/gtkfilesel.c (gtk_file_selection_init):
Use gtk_clist_set_column_auto_resize() to remove need
need for manual column width computations.
Mon May 22 18:50:26 2000 Owen Taylor <otaylor@redhat.com>
* gtk/gtktooltips.[ch]: Replace custom drawing with a GtkLabel,
ensuring Pango correctness, and considerably simplifying the
code.
* gtk/gtklabel.c gtk[hv]scale.c: 1000 => PANGO_SCALE.
* gtk/gtklabel.c (gtk_label_size_request): Fixed incorrect
getting of numbers of lines.
* gtk/gtklabel.c (gtk_label_size_request): Set the requisition
to the actual requested width of the lable, not to the wrap
width we set.
* gtk/gtktextchild.h: Remove extraneous include of gtk/gtk.h.
* gtk/gtktextbtree.c gtk/gtktextbuffer.c gtk/gtktextlayout.c
gtk/gtktextview.c gtk/gtktextview.[ch]: Fix up includes.
* gtk/gtktextview.c: Fix structure inheritance.
* gtk/gtkprogressbar.c: Pangoize.
Mon May 22 15:47:30 2000 Owen Taylor <otaylor@redhat.com>
* gtk/gtktextview.c (gtk_text_view_get_first_para_iter): Encapsulate
in a function.
* gtk/gtktextlayout.c (find_display_line_above): Fixed
bug with computing line tops.
* gtk/gtktextview.c (changed_handler): Fix < , <= confusion.
Thu May 18 18:53:31 2000 Owen Taylor <otaylor@redhat.com>
* gtk/gtktextdisplay.c (gtk_text_layout_draw): Fix up the x_offset
and y_offset coordinates to do what we need now. (The offset between
buffer and layout coordinates has been reintroduced, but is a
bit different than before.)
* gtk/gtktextview.[ch]: No longer inherit from GtkLayout; instead
handle the adjustments ourselves, and scroll as necessary using
the new gdk_window_scroll().
The advantage of this is that when we are incrementally revalidating,
we are essentially rearranging things around the visible portion
of the screen. With the old setup, the visible portion of the
screen was moved around in the layout, so scrolling and redrawing
to track that caused jumping of the display. Since we now
control the scrolling ourselves, we can suppress this and
only redraw when things actually change.
Thu May 18 18:47:25 2000 Owen Taylor <otaylor@redhat.com>
* gtk/gtktextbtree.c (redisplay_mark): We need to invalidate
the region not just redisplay it after-all, since we store the
cursors in the LineDisplay. (Ugly interactions here between
GtkLayout and GtkTextBTree here.)
* gtk/gtktextbtree.c (redisplay_region): Fixed reversed comparison.
Thu May 18 18:43:21 2000 Owen Taylor <otaylor@redhat.com>
* gdk/gdkwindow.h gdk/x11/gdkgeometry-x11.c (gdk_window_scroll):
Added function to scroll contents of a window while keeping the
window constant. Works by XCopyArea or guffaw-scrolling depending
on the details of how the window is set up. (guffaw-scrolling
still needs to be filled in.)
Wed May 17 22:36:53 2000 Owen Taylor <otaylor@redhat.com>
* gtk/gtktextiter.c gtk/gtkmain.c: Add a debug key for the text widget,
move the debugging that was tied to a global variable
to that.
* gtk/gtkmarshal.list: Add NONE:INT,INT,INT
* gtk/gtktextbtree.[ch] gtk/gtktextlayout.c: Keep a separate
validated flag, in line data instead of setting height/width to
-1. This allows us to perform operations with partially invalid
buffer (using the old size for invalid lines) and thus to do
incremental vaidation. Keep height/width aggregates up to date
when deleting text and rebalancing the tree.
* gtk/gtktextbtree.[ch]: Add functions validate a line
(gtk_text_btree_validate_line), and to validate up
to a number of pixels (gtk_text_btree_validate).
* gtk/gtktextlayout.[ch]: Add an ::invalidated signal
that indicates that something is changed and a revalidation
pass is needed. Change ::need_repaint to ::changed, and
make it take old and new yranges instead of a rectangle.
* gtk/gtktextbtree.[ch] gtk/gtktextlayout.[ch]: Move
the line_data_destroy() function from
gtk_text_btree_add_view() to a virtual function in
GtkTextLayout
* gtk/gtktextbtree.[ch]: Remove gtk_text_btree_get_damage_range(),
since we are handling partial repaints in a different fashion
now.
* gtk/gtktextbtree.[ch]: Only repaint the changed portion
of the selection instead of queueing a repaint on the
entire widget.
* gtk/gtktextbuffer.[ch] gtk/gtktextbtree.[ch]: Move
get_selection_bounds() down to btree, make the function
in buffer a wrapper around the btree function.
* gtk/gtktextlayout.[ch]: Add functions to check if the
layout is valid and to recompute either a range of pixels
aroudn a line or a certain total number of pixels.
* gtk/gtktextlayout.[ch]: Cache a single line display;
now that we only redraw the needed portions, the hit rate
for this cache is quite high.
* gtk/gtktextview.[ch]: Keep track of the first paragraph
on the screen so that when re-laying-out the buffer, we can
keep the same place. This requires connecting to ::value_changed
on the adjustments
* gtk/gtktextview.[ch]: Add idle functions to revalidate
the buffer after we receive an ::invalidated signal.
Wed May 17 22:10:47 2000 Owen Taylor <otaylor@redhat.com>
* gtk/gtklayout.c (gtk_layout_size_allocate): Set upper
to max of allocation and layout size, not just to the
layout size.
* gtk/gtk[hv]scrollbar.c (gtk_[hv]scrollbar_calc_slider_size):
Invalidate window so it gets redrawn properly.
* gdk/gdkwindow.c (gdk_window_invalidate_rect): Allow rect == NULL
to mean the entire window.
* gdk/gdkevents.h: Move definition for GDK_PRIORITY_REDRAW
into public header.
Mon May 15 14:51:31 2000 Owen Taylor <otaylor@redhat.com>
* gtk/gtktextmark.c (gtk_text_mark_get_name): Add function
to get the name of a mark.
* gtk/gtktextlayout.c (gtk_text_layout_get_line_at_y): Add a function
to find the paragraph from a y position.
Thu May 11 12:57:20 2000 Owen Taylor <otaylor@redhat.com>
* gtk/gtktextbtree.c (gtk_text_btree_node_invalidate_upward): Valid
nodes have width/height >= 0, not > 0.
Tue May 9 21:29:06 2000 Owen Taylor <otaylor@redhat.com>
* gtk/gtktextlayout.[ch] gtk/gtktextdisplay.c (gtk_text_layout_get_line_display):
Add a size_only flag, so when we only need the size, we don't create
useless appearance attributes.
* gtk/gtktextview.c (gtk_text_view_ensure_layout): Remove
duplicate setting of font description.
* gtk/gtkscale.c: Use PANGO_SCALE instead of 1000
Wed Apr 26 01:53:23 2000 Owen Taylor <otaylor@redhat.com>
* gtk/Makefile.am (EXTRA_DIST): Add OLD_STAMP into
EXTRA_DIST. It does not work well when the file that
everything depends on is not in the tarball.
Wed Apr 26 00:56:14 2000 Owen Taylor <otaylor@redhat.com>
* gtk/testgtk.c: Some hacks and fixes so that it basically
works when not sitting in the GTK+ build tree.
2000-05-03 Havoc Pennington <hp@redhat.com>
* gtk/gtktextbtree.c (gtk_text_line_next_could_contain_tag):
Properly determine the ordering of the tag root and the current
line within the tree. Previous algorithm only worked if the tag
root's immediate parent was the common root of both the current
line and the tag root.
Wed Apr 26 00:43:00 2000 Owen Taylor <otaylor@redhat.com>
* gtk/gtktextlayout.c (set_para_values): Fix some bugs in
alignment.
* gtk/gtktextview.c (gtk_text_view_ensure_layout): Track
the widget text directional dynamically.
* gtk/gtktextview.[ch]: Added functions to get and set default
wrap mode.
Tue Apr 25 23:47:38 2000 Owen Taylor <otaylor@redhat.com>
* gtk/gtktextlayout.c (gtk_text_layout_get_iter_location): Fix bug
in cursor location computation.
Tue Apr 25 23:22:59 2000 Owen Taylor <otaylor@redhat.com>
* gtk/gtklayout.c (gtk_layout_set_size): Clamp hadjustment/
vadjusment values properly when layout gets smaller.
* gtk/gtktextview.c (need_repaint_handler): Areas being
passed in are far completely inaccurate, and sometimes
too small, so, for now, just queue a redraw on the
whole visible region.
2000-04-25 Havoc Pennington <hp@redhat.com>
* gtk/gtktextbtree.c (summary_destroy): new function to
destroy tag summary nodes
(gtk_text_line_next_could_contain_tag): this function was
totally broken if the line passed in wasn't below the tag
root. Fix it.
(gtk_text_btree_first_could_contain_tag): In the tag == NULL
"wildcard" case, we have to do a linear scan. Blah.
(gtk_text_btree_last_could_contain_tag): In tag == NULL case,
we have to do the linear scan
(tag_removed_cb): When a tag is removed from the tag table,
remove the GtkTextTagInfo node from the btree.
(gtk_text_btree_spew): Implement the spew function, for
our debugging pleasure.
Tue Apr 25 19:40:18 2000 Owen Taylor <otaylor@redhat.com>
* gtk/gtktextlayout.c (gtk_text_layout_set_buffer): Fix
a problem with referring to the wrong buffer.
* gtk/gtkentry.c: Fix focus-in/focus-out confusion.
* gtk/gtkrc.c gtk/gtkstyle.c: Moving setting default
font description to gtk_style_new() - otherwise things
don't work without a .gtkrc file.
* gtk/gtktextbuffer.c (gtk_text_buffer_new): Sink the
tags table if we create it ourself, too.
* gdk/gdktypes.h (enum): Move GDK_RELEASE_MASK, since
it was conflicting with XKB modifiers.
* gtk/gtktextview.[ch]: Add simple support for
GtkIMContext.
Mon Apr 24 19:34:18 2000 Owen Taylor <otaylor@redhat.com>
* gtk/gtkentry.c (gtk_entry_move_cursor_visually): Fix problem
with deletion from last commit.
Mon Apr 24 19:29:40 2000 Owen Taylor <otaylor@redhat.com>
* gtk/gtkwidget.c (gtk_widget_create_pango_context): Set the language
in the context from the current locale.
* gtk/gtkentry.c (gtk_entry_size_request): Use language from the
context, not hardcoded value.
* gtk/gtkentry.c (gtk_entry_move_cursor): Make character movement visual,
not logical.
Sun Apr 23 23:39:18 2000 Owen Taylor <otaylor@redhat.com>
* gtk/gtkentry.c gtk/gtktextdisplay.c: Don't handle selections as
attributes - that doesn't handle partial-glyph selection
properly. Instead use new pango_layout_line_get_x_ranges()
functionality to draw the selection.
* gtk/gtkentry.c: Simplify code since pango_layout_line_index_to_x()
now properly handles out-of-range coordinates.
* gtk/gtktextbuffer.c: Emit "mark_set" when the cursor is moved.
* gtk/gtktextiter.h gtk/gtktextiterprivate.h: Make gtk_text_iter_get_line_byte()
public.
* gtk/gtktextlayout.[ch]: Properly set the direction in the PangoContext
for paragraphs opposite to the base direction of the widget.
* gtk/gtktextlayout.[ch] gtk/gtktextdisplay.c: Fixes for alignment.
* gtk/gtktextlayout.c: Don't split segments on marks, since that
causes Arabic words to reshape as you cursor through.
* gtk/gtktextlayout.[ch] gtk/gtktextview.[ch]: Implement virtual
cursor position when moving vertically with the arrow keys and
scrolling with page-up/page-down. (Arrow keys save only the X,
scrolling saves both X and Y.)
This means you can line-up / line-down or page-up / page-down
without losing your place, and also that moving vertically
with the cursor keys keeps the same X position, not the same
character count:
* gtk/gtktextlayout.[ch] gtk/gtktextview.[ch]: Make vertical
arrow keys move by display lines, not paragraphs.
Tue Apr 18 14:16:50 2000 Owen Taylor <otaylor@redhat.com>
* gtk/gtklayout.c: Make sure that the bin window is at least
as big as the allocation. (Should we also make sure that the
bin window is big enough to completely cover widget->window?)
* gtk/gtktextview.c (gtk_text_view_get_visible_rect): Add
function to get the onscreen rectangle.
* gdk/x11/gdkwindow-x11.c (gdk_window_get_pointer): Correctly account
for offsets in window coordinates.
Sun Apr 16 16:13:27 2000 Owen Taylor <otaylor@redhat.com>
* gtk/gtkentry.c (gtk_entry_get_cursor_locations): Fix index/offset
confusion.
* gtk/gtktextview.c (gtk_text_view_ensure_layout): Set the default direction
from the widget direction.
* gtk/gtktexttag.c gtk/gtktexttagprivate.h (gtk_text_tag_set_arg):
Add a "direction" attribute.
* gtk/gtktextview.c: global s/tkxt/text_view/.
* gtk/testtext.c: Added long block of text in Arabic, to test out
the direction attributes. (Some problems with the shaping system
for arabic become obvious - like the fact the cursor splits words
into unjoined pieces.)
Fri Apr 14 12:54:34 2000 Owen Taylor <otaylor@redhat.com>
* gtk/gtktextdisplay.c (render_layout): Add overstrike handling.
* gtk/gtktextlayout.c: Fix up alignment.
* gtk/testtext.c: Add some tests for centering, wrapping.
Fri Apr 14 09:26:22 2000 Owen Taylor <otaylor@redhat.com>
* gdk/gdkdrawable.h gdk/gdkdraw.c gdk/gdkwindow.c gdk/x11/gdkdrawable-x11.c:
Add a draw_glyphs() operation to the drawable vtable and gdk_draw_glyphs().
If we wrote GTK+-specific layout-render function this could just replace
the draw_layout() operation in the vtable.
* gtk/gtkentry.c: Move guts of gtk_entry_get_cursor_locations to
pango_layout_get_cursor_pos() and use that function.
* gtk/gtktextchild.[ch]: add gtk_ onto pixmap_segment_new(), since it
is a non-static symbol.
* gtk/gtktextbtree.[ch]: Replace gtk_text_btree_find_line_data_by_y()
with gtk_text_btree_find_line_by_y()
* gtk/gtktextdisplay.c: Rewrote for Pango - uses a custom layout
renderer that handles GtkTextAppearance attributes.
* gtk/gtktexttag.[ch] gtk/gtktexttagprivate.h:
- Move the values in the style that don't affect geometry into a
GtkTextAppearance structure.
- Change underline to take a PangoUnderline and "font" a string
representation of a font description
- Add a "font_desc" attribute which takes a FontDescription structure.
* gtk/gtktextlayout.[ch]:
- Get rid of the display-line list per each line. Instead, we
generate, on demand, a GtkTextLineDisplay structure which]
contains a PangoLayout * and other necesary information
(offsets, cursor locations) for displaying a paragraph.
- Get rid of the code to wrap lines, create display chunks,
etc. Instead, we just go through a paragraph and convert
it into the necessary inputs to a PangoLayout.
- Implement a new attribute type, GtkTextAttrAppearance. This
holds a GtkTextAppearance, and is used to pass colors,
stipple, etc, through from the layout to the display without
having to use lots and lots of individual attributes.
- Reimplement gtk_layout_get_iter_at_pixel() gtk_layout_get_iter_pos()
in terms of PangoLayout functions.
* gtk/gtktextview.c:
- Handle passing the necessary PangoContext to the layout
- Some fixups in painting to deal with the automatic backing store
and offsetting of GTK+-1.4
- Add a style_set handler so that the default style reacts
properly to theme changes.
* gtk/gtktext?*.[ch]: Random code-style fixes.
* gtk/testtext.c: Substitute in languages that Pango handles now for Thai
Mon Apr 10 10:33:45 2000 Owen Taylor <otaylor@redhat.com>
* gtk/gtktext?*.[ch]: Check in Havoc's port of the Tk text widget,
in original form preparatory to Pango-ization and gdkimcontext-ization.
Thu Apr 6 19:25:39 2000 Owen Taylor <otaylor@redhat.com>
* gtk/gtkimcontext.c: Move default implementations to real_* vfuncs,
so that we can derive from gtkimcontext in language bindings properly.
Thu Apr 6 16:02:52 2000 Owen Taylor <otaylor@redhat.com>
* gtk/gtkimcontextsimple.[ch]: Use gdk_keyval_to_unicode to gdk_unicode_to_keyval.
Add a compose table including (almost) all the compose combinations
from X. This is 6k of static, shared data as opposed to 50k or so of dynamic
data in the XIM implementation.
* gdk/gdk.h gdk/gdkkeyuni.c gdk/win32/gdkevents-win32.c (gdk_keyval_to_unicode, gdk_unicode_to_keyval):
Moved functions to convert keyvalues from and to unicode here from
the win32 port and made them public.
Wed Apr 5 16:37:29 2000 Owen Taylor <otaylor@redhat.com>
* gtk/gtkeditable.c (gtk_editable_insert_text): Allow new_text_length == -1.
Wed Apr 5 16:27:45 2000 Owen Taylor <otaylor@redhat.com>
* gtk/gtkimcontext.[ch]: Base class for new input context system
* gtk/gtkimmulticontext.[ch]: Proxy input context that allows
the real input context implementation to be loaded from modules
and switched on the fly.
* gtk/gtkcontextsimple.[ch]: Simple implementation of an input
context that just does direct keysymbol => unicode translation.
* gtk/gtkentry.[ch]: Start switching editing over to using
GtkInputContext. (No handling of preedit yet.)
Wed Apr 5 15:48:41 2000 Owen Taylor <otaylor@redhat.com>
* gtk/gtktypeutils.h (GTK_CHECK_GET_CLASS): Fix problem with one too
many substitutions. (klass should not be subsituted.)
Wed Apr 5 00:18:14 2000 Owen Taylor <otaylor@redhat.com>
* configure.in: Add checks for Pango
* configure.in docs/Makefile.am: Add test for sgml2html
and allow 'make dist' without building html, but print out
warnings in that case. (For making snapshots)
* gdk/Makefile.am gdk/x11/Makefile.am gtk/Makefile.am:
Add Pango libraries and C flags
* gdk/gdkdraw.c gdk/gdkdrawable.h gdkwindow.c gdk/x11/gdkdrawable-x11.c:
Add function (gdk_draw_layout) to draw a pango layout.
* gdk/gdkpango.h gdk/x11/gdkpango-x11.c: New file with functions
for getting Pango contexts for GDK.
* gtk/gtkeditable.c: Get rid of dead code gtk_editable_parent_set()
* gtk/gtkentry.[ch]: Complete rewrite to use Pango, add bidirectional
editing.
* gtk/gtkentry.c: Hack in simple Hebrew input with direct
keysym => unicode translations. More languages can be added
here, but real input-method support is needed.
* docs/Changes-1.4.txt: Added note about entry behavior.
* gtk/gtkenums.h gtk/gtkwidget.[ch] testgtk.c gtkprivate.h: Add functions
to set the reading direction for a widget and the global direction.
Add test which allows toggling the global direction. Two private
flags are used to store the direction. (GTK_DIRECTION_SET + GTK_DIRECTION_LTR)
* gtk/gtkcheckbutton.c gtk/gtkframe.c gtk/gtkhbbox.c gtk/gtkhbox.c
gtk/gtkradiobutton.c gtk/gtkspinbutton.c gtk/gtktable.c
* gtk/gtk[hv]scale.c gtk/gtkscale.[ch]: Draw numbers using Pango
* gtk/gtklabel.[ch]: Moved to Pango and considerably rewritten. Line breaking,
underlining now handled by Pango.
* gtk/gtkstyle.[ch] gtk/gtkrc.[ch]: Add a PangoFontDescription
to RCStyle and Style. (Having both this and the old font name and GdkFont
is temporary.)
* gtk/gtkwidget.[ch] (gtk_widget_create_pango_{context,layout}): Added
convenience functions for creating contexts and layouts for widgets.
* gtk/testgtk.c: Enhance label tests with multilingual labels.
2000-06-02 03:14:07 +00:00
|
|
|
|
|
1998-09-27 18:32:00 +00:00
|
|
|
|
if (calendar->display_flags & GTK_CALENDAR_NO_MONTH_CHANGE)
|
2003-08-08 22:17:34 +00:00
|
|
|
|
if (year_left)
|
|
|
|
|
x = 3 + (max_year_width - logical_rect.width)/2;
|
|
|
|
|
else
|
|
|
|
|
x = header_width - (3 + max_year_width
|
|
|
|
|
- (max_year_width - logical_rect.width)/2);
|
1998-09-27 18:32:00 +00:00
|
|
|
|
else
|
2003-08-08 22:17:34 +00:00
|
|
|
|
if (year_left)
|
2005-05-11 19:16:19 +00:00
|
|
|
|
x = 3 + priv->arrow_width + (max_year_width - logical_rect.width)/2;
|
2003-08-08 22:17:34 +00:00
|
|
|
|
else
|
2005-05-11 19:16:19 +00:00
|
|
|
|
x = header_width - (3 + priv->arrow_width + max_year_width
|
2003-08-08 22:17:34 +00:00
|
|
|
|
- (max_year_width - logical_rect.width)/2);
|
|
|
|
|
|
2005-05-11 19:16:19 +00:00
|
|
|
|
|
|
|
|
|
gdk_cairo_set_source_color (cr, HEADER_FG_COLOR (GTK_WIDGET (calendar)));
|
|
|
|
|
cairo_move_to (cr, x, y);
|
|
|
|
|
pango_cairo_show_layout (cr, layout);
|
1998-10-01 13:24:42 +00:00
|
|
|
|
|
1998-09-27 18:32:00 +00:00
|
|
|
|
/* Draw month */
|
2002-12-15 01:49:01 +00:00
|
|
|
|
g_snprintf (buffer, sizeof (buffer), "%s", default_monthname[calendar->month]);
|
Remove all references to offscreen flag which was no longer used.
Thu Jun 1 23:05:13 2000 Owen Taylor <otaylor@redhat.com>
* gtk/gtkwidget.c: Remove all references to
offscreen flag which was no longer used.
* gtk/gtkprivate.h (enum): Remove unused flags and compress.
* gtk/gtkframe.c (gtk_frame_set_label_widget): Check
for non-null label_widget->parent.
* gtk/gtkentry.c: Get rid of code to deal with PangoAttribute
which no longer was used.
* gdk/gdkpango.c (gdk_pango_context_get_info): make static.
* gdk/gdkpango.c (gdk_draw_layout[_line]): Add checks
for null arguments.
* gdk/x11/gdkgeometry-x11.c (gdk_window_scroll): add
check for destroyed windows.
Thu Jun 1 13:48:45 2000 Owen Taylor <otaylor@redhat.com>
* gtk/gtkimmulticontext.c: Add a finalize method and unref
the slave context there.
* gtk/gtkinvisible.[ch]: Make reference counting behavior
identical to GtkWindow.
Thu Jun 1 01:54:11 2000 Owen Taylor <otaylor@redhat.com>
* Makefile.am gdk/gdkpango.c: Copy the layout render function from
pangox to here, so we can write them independent of rendering
system, using GDK primitives.
* gdk/gdkdrawable.h gdk/gdkdraw.c gdk/gdkwindow.c
gdk/x11/gdkdrawable-x11.c: Remove draw_layout() from the vtable,
since we have a rendering-system independent implementation in
terms of draw_glyphs().
* gdk/gdkpango.c gdkdrawable.h (gdk_draw_layout_line): New
function to render a single line.
* gdk/x11/gdkpango.c: Move the guts of this file mostly
into ../gdkpango.c, which simplifies things, since we
don't have to deal with raw X gc's.
Fri May 19 04:28:16 2000 Owen Taylor <otaylor@redhat.com>
* gtk/gtktextlayout.[ch]: Add get_log_attrs() function to
get the logical attributes for a given GtkTextLine.
Tue May 30 16:05:39 2000 Owen Taylor <otaylor@redhat.com>
* gdk/x11/gdkfont-x11.c (gdk_font_charset_for_locale): Track
g_locale_get_codeset() to g_get_codeset() change.
Tue May 30 15:03:19 2000 Owen Taylor <otaylor@redhat.com>
* gtk/testcalendar.c (calendar_font_selection_ok): Use font
descriptions.
* gtk/gtkentry.c (gtk_entry_draw_text): Center text within
the entry.
* gtk/gtkfontsel.c (gtk_font_selection_dialog_init): Start of
redoing (vastly simplifying) for Pango. Still needs quite
a bit of work. (Size selection is currently poor. List of
predefined sizes is not a good idea, since all of these
sizes won't necessarily be distinct.)
Tue May 30 13:50:19 2000 Owen Taylor <otaylor@redhat.com>
* gdk/x11/gdkfont-x11.c (gdk_font_charset_for_locale): Handle
CODESET results for LANG=C.
Mon May 29 15:49:10 2000 Owen Taylor <otaylor@redhat.com>
* gtk/gtkrc.[ch]: Add a 'font_name' declaration to RC
which takes a stringized pango font description;
ignore the older 'font' and 'fontset' declarations.
* gtk/gtkstyle.c gtk/gtkrc.c: Fill in the style->font
field with a GdkFont derived via gdk_font_from_description(),
for compatibility. (Should we just remove it entirely?
Probably too much compatibility breakage, but people
should be migrating to the new Pango stuff as quickly
as possible.)
Mon May 29 15:47:41 2000 Owen Taylor <otaylor@redhat.com>
* gtk/gtkentry.c gtk/gtkclist.c: s/pango_font_unref/g_object_unref/.
Mon May 29 15:44:46 2000 Owen Taylor <otaylor@redhat.com>
* gtk/gtkcalender.c: Roughly pango-ized. Really needs
redoing; there are some bugs in size allocation right
now, the semi-existant distinction between header / day
fonts was removed, but, with Pango, could actually
be made functional in a nice way.
* gtk/testcalender: Move calender from examples into this
directory as a test program. (We really need to restrcture
testgtk into a whole directory full of tests for every
widget or functionality group, separated into multiple .c
files.)
Mon May 29 15:19:56 2000 Owen Taylor <otaylor@redhat.com>
* gtk/testgtk.c (file_exists): Fix stupid typo that
was keeping RC file from being loaded.
* gtk/testgtkrc gtk/testgtkrc2: Test new pango-ized
RC file font code.
Mon May 29 14:31:27 2000 Owen Taylor <otaylor@redhat.com>
* gdk/gdkfont.h gdk/x11/gdkfont-x11.c (gdk_font_from_description):
Add function to load a GdkFont from a PangoFontDescription.
Fri May 26 17:16:40 2000 Owen Taylor <otaylor@redhat.com>
* gtk/frame.[ch] gtkaspectframe.c: Make frame widgets able
to have any widget for the label, use a GtkLabel widget
to display the text. (Based partially on a patch from
Anders Carlson.)
(Quite a bit of code reorganization - strip 90% of the
guts out of gtkaspectframe and add a single virtual
func to GtkFrameClass - compute_child_allocation.)
Fri May 26 12:00:02 2000 Owen Taylor <otaylor@redhat.com>
* gtk/gtkctree.c gtk/gtkclist.[ch]: Pangoized.
(Removed clist->row_center_offset field because caching
it wasn't saving time or code, added private function
_gtk_clist_create_cell_layout()).
Wed May 24 15:59:37 2000 Owen Taylor <otaylor@redhat.com>
* gtk/gtkaccellabel.c: Pangoized.
* gtk/[hv]ruler.c: Pangoized
Mon May 22 19:23:59 2000 Owen Taylor <otaylor@redhat.com>
* gtk/gtkfilesel.c (gtk_file_selection_init):
Use gtk_clist_set_column_auto_resize() to remove need
need for manual column width computations.
Mon May 22 18:50:26 2000 Owen Taylor <otaylor@redhat.com>
* gtk/gtktooltips.[ch]: Replace custom drawing with a GtkLabel,
ensuring Pango correctness, and considerably simplifying the
code.
* gtk/gtklabel.c gtk[hv]scale.c: 1000 => PANGO_SCALE.
* gtk/gtklabel.c (gtk_label_size_request): Fixed incorrect
getting of numbers of lines.
* gtk/gtklabel.c (gtk_label_size_request): Set the requisition
to the actual requested width of the lable, not to the wrap
width we set.
* gtk/gtktextchild.h: Remove extraneous include of gtk/gtk.h.
* gtk/gtktextbtree.c gtk/gtktextbuffer.c gtk/gtktextlayout.c
gtk/gtktextview.c gtk/gtktextview.[ch]: Fix up includes.
* gtk/gtktextview.c: Fix structure inheritance.
* gtk/gtkprogressbar.c: Pangoize.
Mon May 22 15:47:30 2000 Owen Taylor <otaylor@redhat.com>
* gtk/gtktextview.c (gtk_text_view_get_first_para_iter): Encapsulate
in a function.
* gtk/gtktextlayout.c (find_display_line_above): Fixed
bug with computing line tops.
* gtk/gtktextview.c (changed_handler): Fix < , <= confusion.
Thu May 18 18:53:31 2000 Owen Taylor <otaylor@redhat.com>
* gtk/gtktextdisplay.c (gtk_text_layout_draw): Fix up the x_offset
and y_offset coordinates to do what we need now. (The offset between
buffer and layout coordinates has been reintroduced, but is a
bit different than before.)
* gtk/gtktextview.[ch]: No longer inherit from GtkLayout; instead
handle the adjustments ourselves, and scroll as necessary using
the new gdk_window_scroll().
The advantage of this is that when we are incrementally revalidating,
we are essentially rearranging things around the visible portion
of the screen. With the old setup, the visible portion of the
screen was moved around in the layout, so scrolling and redrawing
to track that caused jumping of the display. Since we now
control the scrolling ourselves, we can suppress this and
only redraw when things actually change.
Thu May 18 18:47:25 2000 Owen Taylor <otaylor@redhat.com>
* gtk/gtktextbtree.c (redisplay_mark): We need to invalidate
the region not just redisplay it after-all, since we store the
cursors in the LineDisplay. (Ugly interactions here between
GtkLayout and GtkTextBTree here.)
* gtk/gtktextbtree.c (redisplay_region): Fixed reversed comparison.
Thu May 18 18:43:21 2000 Owen Taylor <otaylor@redhat.com>
* gdk/gdkwindow.h gdk/x11/gdkgeometry-x11.c (gdk_window_scroll):
Added function to scroll contents of a window while keeping the
window constant. Works by XCopyArea or guffaw-scrolling depending
on the details of how the window is set up. (guffaw-scrolling
still needs to be filled in.)
Wed May 17 22:36:53 2000 Owen Taylor <otaylor@redhat.com>
* gtk/gtktextiter.c gtk/gtkmain.c: Add a debug key for the text widget,
move the debugging that was tied to a global variable
to that.
* gtk/gtkmarshal.list: Add NONE:INT,INT,INT
* gtk/gtktextbtree.[ch] gtk/gtktextlayout.c: Keep a separate
validated flag, in line data instead of setting height/width to
-1. This allows us to perform operations with partially invalid
buffer (using the old size for invalid lines) and thus to do
incremental vaidation. Keep height/width aggregates up to date
when deleting text and rebalancing the tree.
* gtk/gtktextbtree.[ch]: Add functions validate a line
(gtk_text_btree_validate_line), and to validate up
to a number of pixels (gtk_text_btree_validate).
* gtk/gtktextlayout.[ch]: Add an ::invalidated signal
that indicates that something is changed and a revalidation
pass is needed. Change ::need_repaint to ::changed, and
make it take old and new yranges instead of a rectangle.
* gtk/gtktextbtree.[ch] gtk/gtktextlayout.[ch]: Move
the line_data_destroy() function from
gtk_text_btree_add_view() to a virtual function in
GtkTextLayout
* gtk/gtktextbtree.[ch]: Remove gtk_text_btree_get_damage_range(),
since we are handling partial repaints in a different fashion
now.
* gtk/gtktextbtree.[ch]: Only repaint the changed portion
of the selection instead of queueing a repaint on the
entire widget.
* gtk/gtktextbuffer.[ch] gtk/gtktextbtree.[ch]: Move
get_selection_bounds() down to btree, make the function
in buffer a wrapper around the btree function.
* gtk/gtktextlayout.[ch]: Add functions to check if the
layout is valid and to recompute either a range of pixels
aroudn a line or a certain total number of pixels.
* gtk/gtktextlayout.[ch]: Cache a single line display;
now that we only redraw the needed portions, the hit rate
for this cache is quite high.
* gtk/gtktextview.[ch]: Keep track of the first paragraph
on the screen so that when re-laying-out the buffer, we can
keep the same place. This requires connecting to ::value_changed
on the adjustments
* gtk/gtktextview.[ch]: Add idle functions to revalidate
the buffer after we receive an ::invalidated signal.
Wed May 17 22:10:47 2000 Owen Taylor <otaylor@redhat.com>
* gtk/gtklayout.c (gtk_layout_size_allocate): Set upper
to max of allocation and layout size, not just to the
layout size.
* gtk/gtk[hv]scrollbar.c (gtk_[hv]scrollbar_calc_slider_size):
Invalidate window so it gets redrawn properly.
* gdk/gdkwindow.c (gdk_window_invalidate_rect): Allow rect == NULL
to mean the entire window.
* gdk/gdkevents.h: Move definition for GDK_PRIORITY_REDRAW
into public header.
Mon May 15 14:51:31 2000 Owen Taylor <otaylor@redhat.com>
* gtk/gtktextmark.c (gtk_text_mark_get_name): Add function
to get the name of a mark.
* gtk/gtktextlayout.c (gtk_text_layout_get_line_at_y): Add a function
to find the paragraph from a y position.
Thu May 11 12:57:20 2000 Owen Taylor <otaylor@redhat.com>
* gtk/gtktextbtree.c (gtk_text_btree_node_invalidate_upward): Valid
nodes have width/height >= 0, not > 0.
Tue May 9 21:29:06 2000 Owen Taylor <otaylor@redhat.com>
* gtk/gtktextlayout.[ch] gtk/gtktextdisplay.c (gtk_text_layout_get_line_display):
Add a size_only flag, so when we only need the size, we don't create
useless appearance attributes.
* gtk/gtktextview.c (gtk_text_view_ensure_layout): Remove
duplicate setting of font description.
* gtk/gtkscale.c: Use PANGO_SCALE instead of 1000
Wed Apr 26 01:53:23 2000 Owen Taylor <otaylor@redhat.com>
* gtk/Makefile.am (EXTRA_DIST): Add OLD_STAMP into
EXTRA_DIST. It does not work well when the file that
everything depends on is not in the tarball.
Wed Apr 26 00:56:14 2000 Owen Taylor <otaylor@redhat.com>
* gtk/testgtk.c: Some hacks and fixes so that it basically
works when not sitting in the GTK+ build tree.
2000-05-03 Havoc Pennington <hp@redhat.com>
* gtk/gtktextbtree.c (gtk_text_line_next_could_contain_tag):
Properly determine the ordering of the tag root and the current
line within the tree. Previous algorithm only worked if the tag
root's immediate parent was the common root of both the current
line and the tag root.
Wed Apr 26 00:43:00 2000 Owen Taylor <otaylor@redhat.com>
* gtk/gtktextlayout.c (set_para_values): Fix some bugs in
alignment.
* gtk/gtktextview.c (gtk_text_view_ensure_layout): Track
the widget text directional dynamically.
* gtk/gtktextview.[ch]: Added functions to get and set default
wrap mode.
Tue Apr 25 23:47:38 2000 Owen Taylor <otaylor@redhat.com>
* gtk/gtktextlayout.c (gtk_text_layout_get_iter_location): Fix bug
in cursor location computation.
Tue Apr 25 23:22:59 2000 Owen Taylor <otaylor@redhat.com>
* gtk/gtklayout.c (gtk_layout_set_size): Clamp hadjustment/
vadjusment values properly when layout gets smaller.
* gtk/gtktextview.c (need_repaint_handler): Areas being
passed in are far completely inaccurate, and sometimes
too small, so, for now, just queue a redraw on the
whole visible region.
2000-04-25 Havoc Pennington <hp@redhat.com>
* gtk/gtktextbtree.c (summary_destroy): new function to
destroy tag summary nodes
(gtk_text_line_next_could_contain_tag): this function was
totally broken if the line passed in wasn't below the tag
root. Fix it.
(gtk_text_btree_first_could_contain_tag): In the tag == NULL
"wildcard" case, we have to do a linear scan. Blah.
(gtk_text_btree_last_could_contain_tag): In tag == NULL case,
we have to do the linear scan
(tag_removed_cb): When a tag is removed from the tag table,
remove the GtkTextTagInfo node from the btree.
(gtk_text_btree_spew): Implement the spew function, for
our debugging pleasure.
Tue Apr 25 19:40:18 2000 Owen Taylor <otaylor@redhat.com>
* gtk/gtktextlayout.c (gtk_text_layout_set_buffer): Fix
a problem with referring to the wrong buffer.
* gtk/gtkentry.c: Fix focus-in/focus-out confusion.
* gtk/gtkrc.c gtk/gtkstyle.c: Moving setting default
font description to gtk_style_new() - otherwise things
don't work without a .gtkrc file.
* gtk/gtktextbuffer.c (gtk_text_buffer_new): Sink the
tags table if we create it ourself, too.
* gdk/gdktypes.h (enum): Move GDK_RELEASE_MASK, since
it was conflicting with XKB modifiers.
* gtk/gtktextview.[ch]: Add simple support for
GtkIMContext.
Mon Apr 24 19:34:18 2000 Owen Taylor <otaylor@redhat.com>
* gtk/gtkentry.c (gtk_entry_move_cursor_visually): Fix problem
with deletion from last commit.
Mon Apr 24 19:29:40 2000 Owen Taylor <otaylor@redhat.com>
* gtk/gtkwidget.c (gtk_widget_create_pango_context): Set the language
in the context from the current locale.
* gtk/gtkentry.c (gtk_entry_size_request): Use language from the
context, not hardcoded value.
* gtk/gtkentry.c (gtk_entry_move_cursor): Make character movement visual,
not logical.
Sun Apr 23 23:39:18 2000 Owen Taylor <otaylor@redhat.com>
* gtk/gtkentry.c gtk/gtktextdisplay.c: Don't handle selections as
attributes - that doesn't handle partial-glyph selection
properly. Instead use new pango_layout_line_get_x_ranges()
functionality to draw the selection.
* gtk/gtkentry.c: Simplify code since pango_layout_line_index_to_x()
now properly handles out-of-range coordinates.
* gtk/gtktextbuffer.c: Emit "mark_set" when the cursor is moved.
* gtk/gtktextiter.h gtk/gtktextiterprivate.h: Make gtk_text_iter_get_line_byte()
public.
* gtk/gtktextlayout.[ch]: Properly set the direction in the PangoContext
for paragraphs opposite to the base direction of the widget.
* gtk/gtktextlayout.[ch] gtk/gtktextdisplay.c: Fixes for alignment.
* gtk/gtktextlayout.c: Don't split segments on marks, since that
causes Arabic words to reshape as you cursor through.
* gtk/gtktextlayout.[ch] gtk/gtktextview.[ch]: Implement virtual
cursor position when moving vertically with the arrow keys and
scrolling with page-up/page-down. (Arrow keys save only the X,
scrolling saves both X and Y.)
This means you can line-up / line-down or page-up / page-down
without losing your place, and also that moving vertically
with the cursor keys keeps the same X position, not the same
character count:
* gtk/gtktextlayout.[ch] gtk/gtktextview.[ch]: Make vertical
arrow keys move by display lines, not paragraphs.
Tue Apr 18 14:16:50 2000 Owen Taylor <otaylor@redhat.com>
* gtk/gtklayout.c: Make sure that the bin window is at least
as big as the allocation. (Should we also make sure that the
bin window is big enough to completely cover widget->window?)
* gtk/gtktextview.c (gtk_text_view_get_visible_rect): Add
function to get the onscreen rectangle.
* gdk/x11/gdkwindow-x11.c (gdk_window_get_pointer): Correctly account
for offsets in window coordinates.
Sun Apr 16 16:13:27 2000 Owen Taylor <otaylor@redhat.com>
* gtk/gtkentry.c (gtk_entry_get_cursor_locations): Fix index/offset
confusion.
* gtk/gtktextview.c (gtk_text_view_ensure_layout): Set the default direction
from the widget direction.
* gtk/gtktexttag.c gtk/gtktexttagprivate.h (gtk_text_tag_set_arg):
Add a "direction" attribute.
* gtk/gtktextview.c: global s/tkxt/text_view/.
* gtk/testtext.c: Added long block of text in Arabic, to test out
the direction attributes. (Some problems with the shaping system
for arabic become obvious - like the fact the cursor splits words
into unjoined pieces.)
Fri Apr 14 12:54:34 2000 Owen Taylor <otaylor@redhat.com>
* gtk/gtktextdisplay.c (render_layout): Add overstrike handling.
* gtk/gtktextlayout.c: Fix up alignment.
* gtk/testtext.c: Add some tests for centering, wrapping.
Fri Apr 14 09:26:22 2000 Owen Taylor <otaylor@redhat.com>
* gdk/gdkdrawable.h gdk/gdkdraw.c gdk/gdkwindow.c gdk/x11/gdkdrawable-x11.c:
Add a draw_glyphs() operation to the drawable vtable and gdk_draw_glyphs().
If we wrote GTK+-specific layout-render function this could just replace
the draw_layout() operation in the vtable.
* gtk/gtkentry.c: Move guts of gtk_entry_get_cursor_locations to
pango_layout_get_cursor_pos() and use that function.
* gtk/gtktextchild.[ch]: add gtk_ onto pixmap_segment_new(), since it
is a non-static symbol.
* gtk/gtktextbtree.[ch]: Replace gtk_text_btree_find_line_data_by_y()
with gtk_text_btree_find_line_by_y()
* gtk/gtktextdisplay.c: Rewrote for Pango - uses a custom layout
renderer that handles GtkTextAppearance attributes.
* gtk/gtktexttag.[ch] gtk/gtktexttagprivate.h:
- Move the values in the style that don't affect geometry into a
GtkTextAppearance structure.
- Change underline to take a PangoUnderline and "font" a string
representation of a font description
- Add a "font_desc" attribute which takes a FontDescription structure.
* gtk/gtktextlayout.[ch]:
- Get rid of the display-line list per each line. Instead, we
generate, on demand, a GtkTextLineDisplay structure which]
contains a PangoLayout * and other necesary information
(offsets, cursor locations) for displaying a paragraph.
- Get rid of the code to wrap lines, create display chunks,
etc. Instead, we just go through a paragraph and convert
it into the necessary inputs to a PangoLayout.
- Implement a new attribute type, GtkTextAttrAppearance. This
holds a GtkTextAppearance, and is used to pass colors,
stipple, etc, through from the layout to the display without
having to use lots and lots of individual attributes.
- Reimplement gtk_layout_get_iter_at_pixel() gtk_layout_get_iter_pos()
in terms of PangoLayout functions.
* gtk/gtktextview.c:
- Handle passing the necessary PangoContext to the layout
- Some fixups in painting to deal with the automatic backing store
and offsetting of GTK+-1.4
- Add a style_set handler so that the default style reacts
properly to theme changes.
* gtk/gtktext?*.[ch]: Random code-style fixes.
* gtk/testtext.c: Substitute in languages that Pango handles now for Thai
Mon Apr 10 10:33:45 2000 Owen Taylor <otaylor@redhat.com>
* gtk/gtktext?*.[ch]: Check in Havoc's port of the Tk text widget,
in original form preparatory to Pango-ization and gdkimcontext-ization.
Thu Apr 6 19:25:39 2000 Owen Taylor <otaylor@redhat.com>
* gtk/gtkimcontext.c: Move default implementations to real_* vfuncs,
so that we can derive from gtkimcontext in language bindings properly.
Thu Apr 6 16:02:52 2000 Owen Taylor <otaylor@redhat.com>
* gtk/gtkimcontextsimple.[ch]: Use gdk_keyval_to_unicode to gdk_unicode_to_keyval.
Add a compose table including (almost) all the compose combinations
from X. This is 6k of static, shared data as opposed to 50k or so of dynamic
data in the XIM implementation.
* gdk/gdk.h gdk/gdkkeyuni.c gdk/win32/gdkevents-win32.c (gdk_keyval_to_unicode, gdk_unicode_to_keyval):
Moved functions to convert keyvalues from and to unicode here from
the win32 port and made them public.
Wed Apr 5 16:37:29 2000 Owen Taylor <otaylor@redhat.com>
* gtk/gtkeditable.c (gtk_editable_insert_text): Allow new_text_length == -1.
Wed Apr 5 16:27:45 2000 Owen Taylor <otaylor@redhat.com>
* gtk/gtkimcontext.[ch]: Base class for new input context system
* gtk/gtkimmulticontext.[ch]: Proxy input context that allows
the real input context implementation to be loaded from modules
and switched on the fly.
* gtk/gtkcontextsimple.[ch]: Simple implementation of an input
context that just does direct keysymbol => unicode translation.
* gtk/gtkentry.[ch]: Start switching editing over to using
GtkInputContext. (No handling of preedit yet.)
Wed Apr 5 15:48:41 2000 Owen Taylor <otaylor@redhat.com>
* gtk/gtktypeutils.h (GTK_CHECK_GET_CLASS): Fix problem with one too
many substitutions. (klass should not be subsituted.)
Wed Apr 5 00:18:14 2000 Owen Taylor <otaylor@redhat.com>
* configure.in: Add checks for Pango
* configure.in docs/Makefile.am: Add test for sgml2html
and allow 'make dist' without building html, but print out
warnings in that case. (For making snapshots)
* gdk/Makefile.am gdk/x11/Makefile.am gtk/Makefile.am:
Add Pango libraries and C flags
* gdk/gdkdraw.c gdk/gdkdrawable.h gdkwindow.c gdk/x11/gdkdrawable-x11.c:
Add function (gdk_draw_layout) to draw a pango layout.
* gdk/gdkpango.h gdk/x11/gdkpango-x11.c: New file with functions
for getting Pango contexts for GDK.
* gtk/gtkeditable.c: Get rid of dead code gtk_editable_parent_set()
* gtk/gtkentry.[ch]: Complete rewrite to use Pango, add bidirectional
editing.
* gtk/gtkentry.c: Hack in simple Hebrew input with direct
keysym => unicode translations. More languages can be added
here, but real input-method support is needed.
* docs/Changes-1.4.txt: Added note about entry behavior.
* gtk/gtkenums.h gtk/gtkwidget.[ch] testgtk.c gtkprivate.h: Add functions
to set the reading direction for a widget and the global direction.
Add test which allows toggling the global direction. Two private
flags are used to store the direction. (GTK_DIRECTION_SET + GTK_DIRECTION_LTR)
* gtk/gtkcheckbutton.c gtk/gtkframe.c gtk/gtkhbbox.c gtk/gtkhbox.c
gtk/gtkradiobutton.c gtk/gtkspinbutton.c gtk/gtktable.c
* gtk/gtk[hv]scale.c gtk/gtkscale.[ch]: Draw numbers using Pango
* gtk/gtklabel.[ch]: Moved to Pango and considerably rewritten. Line breaking,
underlining now handled by Pango.
* gtk/gtkstyle.[ch] gtk/gtkrc.[ch]: Add a PangoFontDescription
to RCStyle and Style. (Having both this and the old font name and GdkFont
is temporary.)
* gtk/gtkwidget.[ch] (gtk_widget_create_pango_{context,layout}): Added
convenience functions for creating contexts and layouts for widgets.
* gtk/testgtk.c: Enhance label tests with multilingual labels.
2000-06-02 03:14:07 +00:00
|
|
|
|
pango_layout_set_text (layout, buffer, -1);
|
2000-07-02 21:32:56 +00:00
|
|
|
|
pango_layout_get_pixel_extents (layout, NULL, &logical_rect);
|
Remove all references to offscreen flag which was no longer used.
Thu Jun 1 23:05:13 2000 Owen Taylor <otaylor@redhat.com>
* gtk/gtkwidget.c: Remove all references to
offscreen flag which was no longer used.
* gtk/gtkprivate.h (enum): Remove unused flags and compress.
* gtk/gtkframe.c (gtk_frame_set_label_widget): Check
for non-null label_widget->parent.
* gtk/gtkentry.c: Get rid of code to deal with PangoAttribute
which no longer was used.
* gdk/gdkpango.c (gdk_pango_context_get_info): make static.
* gdk/gdkpango.c (gdk_draw_layout[_line]): Add checks
for null arguments.
* gdk/x11/gdkgeometry-x11.c (gdk_window_scroll): add
check for destroyed windows.
Thu Jun 1 13:48:45 2000 Owen Taylor <otaylor@redhat.com>
* gtk/gtkimmulticontext.c: Add a finalize method and unref
the slave context there.
* gtk/gtkinvisible.[ch]: Make reference counting behavior
identical to GtkWindow.
Thu Jun 1 01:54:11 2000 Owen Taylor <otaylor@redhat.com>
* Makefile.am gdk/gdkpango.c: Copy the layout render function from
pangox to here, so we can write them independent of rendering
system, using GDK primitives.
* gdk/gdkdrawable.h gdk/gdkdraw.c gdk/gdkwindow.c
gdk/x11/gdkdrawable-x11.c: Remove draw_layout() from the vtable,
since we have a rendering-system independent implementation in
terms of draw_glyphs().
* gdk/gdkpango.c gdkdrawable.h (gdk_draw_layout_line): New
function to render a single line.
* gdk/x11/gdkpango.c: Move the guts of this file mostly
into ../gdkpango.c, which simplifies things, since we
don't have to deal with raw X gc's.
Fri May 19 04:28:16 2000 Owen Taylor <otaylor@redhat.com>
* gtk/gtktextlayout.[ch]: Add get_log_attrs() function to
get the logical attributes for a given GtkTextLine.
Tue May 30 16:05:39 2000 Owen Taylor <otaylor@redhat.com>
* gdk/x11/gdkfont-x11.c (gdk_font_charset_for_locale): Track
g_locale_get_codeset() to g_get_codeset() change.
Tue May 30 15:03:19 2000 Owen Taylor <otaylor@redhat.com>
* gtk/testcalendar.c (calendar_font_selection_ok): Use font
descriptions.
* gtk/gtkentry.c (gtk_entry_draw_text): Center text within
the entry.
* gtk/gtkfontsel.c (gtk_font_selection_dialog_init): Start of
redoing (vastly simplifying) for Pango. Still needs quite
a bit of work. (Size selection is currently poor. List of
predefined sizes is not a good idea, since all of these
sizes won't necessarily be distinct.)
Tue May 30 13:50:19 2000 Owen Taylor <otaylor@redhat.com>
* gdk/x11/gdkfont-x11.c (gdk_font_charset_for_locale): Handle
CODESET results for LANG=C.
Mon May 29 15:49:10 2000 Owen Taylor <otaylor@redhat.com>
* gtk/gtkrc.[ch]: Add a 'font_name' declaration to RC
which takes a stringized pango font description;
ignore the older 'font' and 'fontset' declarations.
* gtk/gtkstyle.c gtk/gtkrc.c: Fill in the style->font
field with a GdkFont derived via gdk_font_from_description(),
for compatibility. (Should we just remove it entirely?
Probably too much compatibility breakage, but people
should be migrating to the new Pango stuff as quickly
as possible.)
Mon May 29 15:47:41 2000 Owen Taylor <otaylor@redhat.com>
* gtk/gtkentry.c gtk/gtkclist.c: s/pango_font_unref/g_object_unref/.
Mon May 29 15:44:46 2000 Owen Taylor <otaylor@redhat.com>
* gtk/gtkcalender.c: Roughly pango-ized. Really needs
redoing; there are some bugs in size allocation right
now, the semi-existant distinction between header / day
fonts was removed, but, with Pango, could actually
be made functional in a nice way.
* gtk/testcalender: Move calender from examples into this
directory as a test program. (We really need to restrcture
testgtk into a whole directory full of tests for every
widget or functionality group, separated into multiple .c
files.)
Mon May 29 15:19:56 2000 Owen Taylor <otaylor@redhat.com>
* gtk/testgtk.c (file_exists): Fix stupid typo that
was keeping RC file from being loaded.
* gtk/testgtkrc gtk/testgtkrc2: Test new pango-ized
RC file font code.
Mon May 29 14:31:27 2000 Owen Taylor <otaylor@redhat.com>
* gdk/gdkfont.h gdk/x11/gdkfont-x11.c (gdk_font_from_description):
Add function to load a GdkFont from a PangoFontDescription.
Fri May 26 17:16:40 2000 Owen Taylor <otaylor@redhat.com>
* gtk/frame.[ch] gtkaspectframe.c: Make frame widgets able
to have any widget for the label, use a GtkLabel widget
to display the text. (Based partially on a patch from
Anders Carlson.)
(Quite a bit of code reorganization - strip 90% of the
guts out of gtkaspectframe and add a single virtual
func to GtkFrameClass - compute_child_allocation.)
Fri May 26 12:00:02 2000 Owen Taylor <otaylor@redhat.com>
* gtk/gtkctree.c gtk/gtkclist.[ch]: Pangoized.
(Removed clist->row_center_offset field because caching
it wasn't saving time or code, added private function
_gtk_clist_create_cell_layout()).
Wed May 24 15:59:37 2000 Owen Taylor <otaylor@redhat.com>
* gtk/gtkaccellabel.c: Pangoized.
* gtk/[hv]ruler.c: Pangoized
Mon May 22 19:23:59 2000 Owen Taylor <otaylor@redhat.com>
* gtk/gtkfilesel.c (gtk_file_selection_init):
Use gtk_clist_set_column_auto_resize() to remove need
need for manual column width computations.
Mon May 22 18:50:26 2000 Owen Taylor <otaylor@redhat.com>
* gtk/gtktooltips.[ch]: Replace custom drawing with a GtkLabel,
ensuring Pango correctness, and considerably simplifying the
code.
* gtk/gtklabel.c gtk[hv]scale.c: 1000 => PANGO_SCALE.
* gtk/gtklabel.c (gtk_label_size_request): Fixed incorrect
getting of numbers of lines.
* gtk/gtklabel.c (gtk_label_size_request): Set the requisition
to the actual requested width of the lable, not to the wrap
width we set.
* gtk/gtktextchild.h: Remove extraneous include of gtk/gtk.h.
* gtk/gtktextbtree.c gtk/gtktextbuffer.c gtk/gtktextlayout.c
gtk/gtktextview.c gtk/gtktextview.[ch]: Fix up includes.
* gtk/gtktextview.c: Fix structure inheritance.
* gtk/gtkprogressbar.c: Pangoize.
Mon May 22 15:47:30 2000 Owen Taylor <otaylor@redhat.com>
* gtk/gtktextview.c (gtk_text_view_get_first_para_iter): Encapsulate
in a function.
* gtk/gtktextlayout.c (find_display_line_above): Fixed
bug with computing line tops.
* gtk/gtktextview.c (changed_handler): Fix < , <= confusion.
Thu May 18 18:53:31 2000 Owen Taylor <otaylor@redhat.com>
* gtk/gtktextdisplay.c (gtk_text_layout_draw): Fix up the x_offset
and y_offset coordinates to do what we need now. (The offset between
buffer and layout coordinates has been reintroduced, but is a
bit different than before.)
* gtk/gtktextview.[ch]: No longer inherit from GtkLayout; instead
handle the adjustments ourselves, and scroll as necessary using
the new gdk_window_scroll().
The advantage of this is that when we are incrementally revalidating,
we are essentially rearranging things around the visible portion
of the screen. With the old setup, the visible portion of the
screen was moved around in the layout, so scrolling and redrawing
to track that caused jumping of the display. Since we now
control the scrolling ourselves, we can suppress this and
only redraw when things actually change.
Thu May 18 18:47:25 2000 Owen Taylor <otaylor@redhat.com>
* gtk/gtktextbtree.c (redisplay_mark): We need to invalidate
the region not just redisplay it after-all, since we store the
cursors in the LineDisplay. (Ugly interactions here between
GtkLayout and GtkTextBTree here.)
* gtk/gtktextbtree.c (redisplay_region): Fixed reversed comparison.
Thu May 18 18:43:21 2000 Owen Taylor <otaylor@redhat.com>
* gdk/gdkwindow.h gdk/x11/gdkgeometry-x11.c (gdk_window_scroll):
Added function to scroll contents of a window while keeping the
window constant. Works by XCopyArea or guffaw-scrolling depending
on the details of how the window is set up. (guffaw-scrolling
still needs to be filled in.)
Wed May 17 22:36:53 2000 Owen Taylor <otaylor@redhat.com>
* gtk/gtktextiter.c gtk/gtkmain.c: Add a debug key for the text widget,
move the debugging that was tied to a global variable
to that.
* gtk/gtkmarshal.list: Add NONE:INT,INT,INT
* gtk/gtktextbtree.[ch] gtk/gtktextlayout.c: Keep a separate
validated flag, in line data instead of setting height/width to
-1. This allows us to perform operations with partially invalid
buffer (using the old size for invalid lines) and thus to do
incremental vaidation. Keep height/width aggregates up to date
when deleting text and rebalancing the tree.
* gtk/gtktextbtree.[ch]: Add functions validate a line
(gtk_text_btree_validate_line), and to validate up
to a number of pixels (gtk_text_btree_validate).
* gtk/gtktextlayout.[ch]: Add an ::invalidated signal
that indicates that something is changed and a revalidation
pass is needed. Change ::need_repaint to ::changed, and
make it take old and new yranges instead of a rectangle.
* gtk/gtktextbtree.[ch] gtk/gtktextlayout.[ch]: Move
the line_data_destroy() function from
gtk_text_btree_add_view() to a virtual function in
GtkTextLayout
* gtk/gtktextbtree.[ch]: Remove gtk_text_btree_get_damage_range(),
since we are handling partial repaints in a different fashion
now.
* gtk/gtktextbtree.[ch]: Only repaint the changed portion
of the selection instead of queueing a repaint on the
entire widget.
* gtk/gtktextbuffer.[ch] gtk/gtktextbtree.[ch]: Move
get_selection_bounds() down to btree, make the function
in buffer a wrapper around the btree function.
* gtk/gtktextlayout.[ch]: Add functions to check if the
layout is valid and to recompute either a range of pixels
aroudn a line or a certain total number of pixels.
* gtk/gtktextlayout.[ch]: Cache a single line display;
now that we only redraw the needed portions, the hit rate
for this cache is quite high.
* gtk/gtktextview.[ch]: Keep track of the first paragraph
on the screen so that when re-laying-out the buffer, we can
keep the same place. This requires connecting to ::value_changed
on the adjustments
* gtk/gtktextview.[ch]: Add idle functions to revalidate
the buffer after we receive an ::invalidated signal.
Wed May 17 22:10:47 2000 Owen Taylor <otaylor@redhat.com>
* gtk/gtklayout.c (gtk_layout_size_allocate): Set upper
to max of allocation and layout size, not just to the
layout size.
* gtk/gtk[hv]scrollbar.c (gtk_[hv]scrollbar_calc_slider_size):
Invalidate window so it gets redrawn properly.
* gdk/gdkwindow.c (gdk_window_invalidate_rect): Allow rect == NULL
to mean the entire window.
* gdk/gdkevents.h: Move definition for GDK_PRIORITY_REDRAW
into public header.
Mon May 15 14:51:31 2000 Owen Taylor <otaylor@redhat.com>
* gtk/gtktextmark.c (gtk_text_mark_get_name): Add function
to get the name of a mark.
* gtk/gtktextlayout.c (gtk_text_layout_get_line_at_y): Add a function
to find the paragraph from a y position.
Thu May 11 12:57:20 2000 Owen Taylor <otaylor@redhat.com>
* gtk/gtktextbtree.c (gtk_text_btree_node_invalidate_upward): Valid
nodes have width/height >= 0, not > 0.
Tue May 9 21:29:06 2000 Owen Taylor <otaylor@redhat.com>
* gtk/gtktextlayout.[ch] gtk/gtktextdisplay.c (gtk_text_layout_get_line_display):
Add a size_only flag, so when we only need the size, we don't create
useless appearance attributes.
* gtk/gtktextview.c (gtk_text_view_ensure_layout): Remove
duplicate setting of font description.
* gtk/gtkscale.c: Use PANGO_SCALE instead of 1000
Wed Apr 26 01:53:23 2000 Owen Taylor <otaylor@redhat.com>
* gtk/Makefile.am (EXTRA_DIST): Add OLD_STAMP into
EXTRA_DIST. It does not work well when the file that
everything depends on is not in the tarball.
Wed Apr 26 00:56:14 2000 Owen Taylor <otaylor@redhat.com>
* gtk/testgtk.c: Some hacks and fixes so that it basically
works when not sitting in the GTK+ build tree.
2000-05-03 Havoc Pennington <hp@redhat.com>
* gtk/gtktextbtree.c (gtk_text_line_next_could_contain_tag):
Properly determine the ordering of the tag root and the current
line within the tree. Previous algorithm only worked if the tag
root's immediate parent was the common root of both the current
line and the tag root.
Wed Apr 26 00:43:00 2000 Owen Taylor <otaylor@redhat.com>
* gtk/gtktextlayout.c (set_para_values): Fix some bugs in
alignment.
* gtk/gtktextview.c (gtk_text_view_ensure_layout): Track
the widget text directional dynamically.
* gtk/gtktextview.[ch]: Added functions to get and set default
wrap mode.
Tue Apr 25 23:47:38 2000 Owen Taylor <otaylor@redhat.com>
* gtk/gtktextlayout.c (gtk_text_layout_get_iter_location): Fix bug
in cursor location computation.
Tue Apr 25 23:22:59 2000 Owen Taylor <otaylor@redhat.com>
* gtk/gtklayout.c (gtk_layout_set_size): Clamp hadjustment/
vadjusment values properly when layout gets smaller.
* gtk/gtktextview.c (need_repaint_handler): Areas being
passed in are far completely inaccurate, and sometimes
too small, so, for now, just queue a redraw on the
whole visible region.
2000-04-25 Havoc Pennington <hp@redhat.com>
* gtk/gtktextbtree.c (summary_destroy): new function to
destroy tag summary nodes
(gtk_text_line_next_could_contain_tag): this function was
totally broken if the line passed in wasn't below the tag
root. Fix it.
(gtk_text_btree_first_could_contain_tag): In the tag == NULL
"wildcard" case, we have to do a linear scan. Blah.
(gtk_text_btree_last_could_contain_tag): In tag == NULL case,
we have to do the linear scan
(tag_removed_cb): When a tag is removed from the tag table,
remove the GtkTextTagInfo node from the btree.
(gtk_text_btree_spew): Implement the spew function, for
our debugging pleasure.
Tue Apr 25 19:40:18 2000 Owen Taylor <otaylor@redhat.com>
* gtk/gtktextlayout.c (gtk_text_layout_set_buffer): Fix
a problem with referring to the wrong buffer.
* gtk/gtkentry.c: Fix focus-in/focus-out confusion.
* gtk/gtkrc.c gtk/gtkstyle.c: Moving setting default
font description to gtk_style_new() - otherwise things
don't work without a .gtkrc file.
* gtk/gtktextbuffer.c (gtk_text_buffer_new): Sink the
tags table if we create it ourself, too.
* gdk/gdktypes.h (enum): Move GDK_RELEASE_MASK, since
it was conflicting with XKB modifiers.
* gtk/gtktextview.[ch]: Add simple support for
GtkIMContext.
Mon Apr 24 19:34:18 2000 Owen Taylor <otaylor@redhat.com>
* gtk/gtkentry.c (gtk_entry_move_cursor_visually): Fix problem
with deletion from last commit.
Mon Apr 24 19:29:40 2000 Owen Taylor <otaylor@redhat.com>
* gtk/gtkwidget.c (gtk_widget_create_pango_context): Set the language
in the context from the current locale.
* gtk/gtkentry.c (gtk_entry_size_request): Use language from the
context, not hardcoded value.
* gtk/gtkentry.c (gtk_entry_move_cursor): Make character movement visual,
not logical.
Sun Apr 23 23:39:18 2000 Owen Taylor <otaylor@redhat.com>
* gtk/gtkentry.c gtk/gtktextdisplay.c: Don't handle selections as
attributes - that doesn't handle partial-glyph selection
properly. Instead use new pango_layout_line_get_x_ranges()
functionality to draw the selection.
* gtk/gtkentry.c: Simplify code since pango_layout_line_index_to_x()
now properly handles out-of-range coordinates.
* gtk/gtktextbuffer.c: Emit "mark_set" when the cursor is moved.
* gtk/gtktextiter.h gtk/gtktextiterprivate.h: Make gtk_text_iter_get_line_byte()
public.
* gtk/gtktextlayout.[ch]: Properly set the direction in the PangoContext
for paragraphs opposite to the base direction of the widget.
* gtk/gtktextlayout.[ch] gtk/gtktextdisplay.c: Fixes for alignment.
* gtk/gtktextlayout.c: Don't split segments on marks, since that
causes Arabic words to reshape as you cursor through.
* gtk/gtktextlayout.[ch] gtk/gtktextview.[ch]: Implement virtual
cursor position when moving vertically with the arrow keys and
scrolling with page-up/page-down. (Arrow keys save only the X,
scrolling saves both X and Y.)
This means you can line-up / line-down or page-up / page-down
without losing your place, and also that moving vertically
with the cursor keys keeps the same X position, not the same
character count:
* gtk/gtktextlayout.[ch] gtk/gtktextview.[ch]: Make vertical
arrow keys move by display lines, not paragraphs.
Tue Apr 18 14:16:50 2000 Owen Taylor <otaylor@redhat.com>
* gtk/gtklayout.c: Make sure that the bin window is at least
as big as the allocation. (Should we also make sure that the
bin window is big enough to completely cover widget->window?)
* gtk/gtktextview.c (gtk_text_view_get_visible_rect): Add
function to get the onscreen rectangle.
* gdk/x11/gdkwindow-x11.c (gdk_window_get_pointer): Correctly account
for offsets in window coordinates.
Sun Apr 16 16:13:27 2000 Owen Taylor <otaylor@redhat.com>
* gtk/gtkentry.c (gtk_entry_get_cursor_locations): Fix index/offset
confusion.
* gtk/gtktextview.c (gtk_text_view_ensure_layout): Set the default direction
from the widget direction.
* gtk/gtktexttag.c gtk/gtktexttagprivate.h (gtk_text_tag_set_arg):
Add a "direction" attribute.
* gtk/gtktextview.c: global s/tkxt/text_view/.
* gtk/testtext.c: Added long block of text in Arabic, to test out
the direction attributes. (Some problems with the shaping system
for arabic become obvious - like the fact the cursor splits words
into unjoined pieces.)
Fri Apr 14 12:54:34 2000 Owen Taylor <otaylor@redhat.com>
* gtk/gtktextdisplay.c (render_layout): Add overstrike handling.
* gtk/gtktextlayout.c: Fix up alignment.
* gtk/testtext.c: Add some tests for centering, wrapping.
Fri Apr 14 09:26:22 2000 Owen Taylor <otaylor@redhat.com>
* gdk/gdkdrawable.h gdk/gdkdraw.c gdk/gdkwindow.c gdk/x11/gdkdrawable-x11.c:
Add a draw_glyphs() operation to the drawable vtable and gdk_draw_glyphs().
If we wrote GTK+-specific layout-render function this could just replace
the draw_layout() operation in the vtable.
* gtk/gtkentry.c: Move guts of gtk_entry_get_cursor_locations to
pango_layout_get_cursor_pos() and use that function.
* gtk/gtktextchild.[ch]: add gtk_ onto pixmap_segment_new(), since it
is a non-static symbol.
* gtk/gtktextbtree.[ch]: Replace gtk_text_btree_find_line_data_by_y()
with gtk_text_btree_find_line_by_y()
* gtk/gtktextdisplay.c: Rewrote for Pango - uses a custom layout
renderer that handles GtkTextAppearance attributes.
* gtk/gtktexttag.[ch] gtk/gtktexttagprivate.h:
- Move the values in the style that don't affect geometry into a
GtkTextAppearance structure.
- Change underline to take a PangoUnderline and "font" a string
representation of a font description
- Add a "font_desc" attribute which takes a FontDescription structure.
* gtk/gtktextlayout.[ch]:
- Get rid of the display-line list per each line. Instead, we
generate, on demand, a GtkTextLineDisplay structure which]
contains a PangoLayout * and other necesary information
(offsets, cursor locations) for displaying a paragraph.
- Get rid of the code to wrap lines, create display chunks,
etc. Instead, we just go through a paragraph and convert
it into the necessary inputs to a PangoLayout.
- Implement a new attribute type, GtkTextAttrAppearance. This
holds a GtkTextAppearance, and is used to pass colors,
stipple, etc, through from the layout to the display without
having to use lots and lots of individual attributes.
- Reimplement gtk_layout_get_iter_at_pixel() gtk_layout_get_iter_pos()
in terms of PangoLayout functions.
* gtk/gtktextview.c:
- Handle passing the necessary PangoContext to the layout
- Some fixups in painting to deal with the automatic backing store
and offsetting of GTK+-1.4
- Add a style_set handler so that the default style reacts
properly to theme changes.
* gtk/gtktext?*.[ch]: Random code-style fixes.
* gtk/testtext.c: Substitute in languages that Pango handles now for Thai
Mon Apr 10 10:33:45 2000 Owen Taylor <otaylor@redhat.com>
* gtk/gtktext?*.[ch]: Check in Havoc's port of the Tk text widget,
in original form preparatory to Pango-ization and gdkimcontext-ization.
Thu Apr 6 19:25:39 2000 Owen Taylor <otaylor@redhat.com>
* gtk/gtkimcontext.c: Move default implementations to real_* vfuncs,
so that we can derive from gtkimcontext in language bindings properly.
Thu Apr 6 16:02:52 2000 Owen Taylor <otaylor@redhat.com>
* gtk/gtkimcontextsimple.[ch]: Use gdk_keyval_to_unicode to gdk_unicode_to_keyval.
Add a compose table including (almost) all the compose combinations
from X. This is 6k of static, shared data as opposed to 50k or so of dynamic
data in the XIM implementation.
* gdk/gdk.h gdk/gdkkeyuni.c gdk/win32/gdkevents-win32.c (gdk_keyval_to_unicode, gdk_unicode_to_keyval):
Moved functions to convert keyvalues from and to unicode here from
the win32 port and made them public.
Wed Apr 5 16:37:29 2000 Owen Taylor <otaylor@redhat.com>
* gtk/gtkeditable.c (gtk_editable_insert_text): Allow new_text_length == -1.
Wed Apr 5 16:27:45 2000 Owen Taylor <otaylor@redhat.com>
* gtk/gtkimcontext.[ch]: Base class for new input context system
* gtk/gtkimmulticontext.[ch]: Proxy input context that allows
the real input context implementation to be loaded from modules
and switched on the fly.
* gtk/gtkcontextsimple.[ch]: Simple implementation of an input
context that just does direct keysymbol => unicode translation.
* gtk/gtkentry.[ch]: Start switching editing over to using
GtkInputContext. (No handling of preedit yet.)
Wed Apr 5 15:48:41 2000 Owen Taylor <otaylor@redhat.com>
* gtk/gtktypeutils.h (GTK_CHECK_GET_CLASS): Fix problem with one too
many substitutions. (klass should not be subsituted.)
Wed Apr 5 00:18:14 2000 Owen Taylor <otaylor@redhat.com>
* configure.in: Add checks for Pango
* configure.in docs/Makefile.am: Add test for sgml2html
and allow 'make dist' without building html, but print out
warnings in that case. (For making snapshots)
* gdk/Makefile.am gdk/x11/Makefile.am gtk/Makefile.am:
Add Pango libraries and C flags
* gdk/gdkdraw.c gdk/gdkdrawable.h gdkwindow.c gdk/x11/gdkdrawable-x11.c:
Add function (gdk_draw_layout) to draw a pango layout.
* gdk/gdkpango.h gdk/x11/gdkpango-x11.c: New file with functions
for getting Pango contexts for GDK.
* gtk/gtkeditable.c: Get rid of dead code gtk_editable_parent_set()
* gtk/gtkentry.[ch]: Complete rewrite to use Pango, add bidirectional
editing.
* gtk/gtkentry.c: Hack in simple Hebrew input with direct
keysym => unicode translations. More languages can be added
here, but real input-method support is needed.
* docs/Changes-1.4.txt: Added note about entry behavior.
* gtk/gtkenums.h gtk/gtkwidget.[ch] testgtk.c gtkprivate.h: Add functions
to set the reading direction for a widget and the global direction.
Add test which allows toggling the global direction. Two private
flags are used to store the direction. (GTK_DIRECTION_SET + GTK_DIRECTION_LTR)
* gtk/gtkcheckbutton.c gtk/gtkframe.c gtk/gtkhbbox.c gtk/gtkhbox.c
gtk/gtkradiobutton.c gtk/gtkspinbutton.c gtk/gtktable.c
* gtk/gtk[hv]scale.c gtk/gtkscale.[ch]: Draw numbers using Pango
* gtk/gtklabel.[ch]: Moved to Pango and considerably rewritten. Line breaking,
underlining now handled by Pango.
* gtk/gtkstyle.[ch] gtk/gtkrc.[ch]: Add a PangoFontDescription
to RCStyle and Style. (Having both this and the old font name and GdkFont
is temporary.)
* gtk/gtkwidget.[ch] (gtk_widget_create_pango_{context,layout}): Added
convenience functions for creating contexts and layouts for widgets.
* gtk/testgtk.c: Enhance label tests with multilingual labels.
2000-06-02 03:14:07 +00:00
|
|
|
|
|
1998-09-27 18:32:00 +00:00
|
|
|
|
if (calendar->display_flags & GTK_CALENDAR_NO_MONTH_CHANGE)
|
2003-08-08 22:17:34 +00:00
|
|
|
|
if (year_left)
|
|
|
|
|
x = header_width - (3 + max_month_width
|
|
|
|
|
- (max_month_width - logical_rect.width)/2);
|
|
|
|
|
else
|
2000-07-02 21:32:56 +00:00
|
|
|
|
x = 3 + (max_month_width - logical_rect.width) / 2;
|
1998-09-27 18:32:00 +00:00
|
|
|
|
else
|
2003-08-08 22:17:34 +00:00
|
|
|
|
if (year_left)
|
2005-05-11 19:16:19 +00:00
|
|
|
|
x = header_width - (3 + priv->arrow_width + max_month_width
|
2003-08-08 22:17:34 +00:00
|
|
|
|
- (max_month_width - logical_rect.width)/2);
|
|
|
|
|
else
|
2005-05-11 19:16:19 +00:00
|
|
|
|
x = 3 + priv->arrow_width + (max_month_width - logical_rect.width)/2;
|
Remove all references to offscreen flag which was no longer used.
Thu Jun 1 23:05:13 2000 Owen Taylor <otaylor@redhat.com>
* gtk/gtkwidget.c: Remove all references to
offscreen flag which was no longer used.
* gtk/gtkprivate.h (enum): Remove unused flags and compress.
* gtk/gtkframe.c (gtk_frame_set_label_widget): Check
for non-null label_widget->parent.
* gtk/gtkentry.c: Get rid of code to deal with PangoAttribute
which no longer was used.
* gdk/gdkpango.c (gdk_pango_context_get_info): make static.
* gdk/gdkpango.c (gdk_draw_layout[_line]): Add checks
for null arguments.
* gdk/x11/gdkgeometry-x11.c (gdk_window_scroll): add
check for destroyed windows.
Thu Jun 1 13:48:45 2000 Owen Taylor <otaylor@redhat.com>
* gtk/gtkimmulticontext.c: Add a finalize method and unref
the slave context there.
* gtk/gtkinvisible.[ch]: Make reference counting behavior
identical to GtkWindow.
Thu Jun 1 01:54:11 2000 Owen Taylor <otaylor@redhat.com>
* Makefile.am gdk/gdkpango.c: Copy the layout render function from
pangox to here, so we can write them independent of rendering
system, using GDK primitives.
* gdk/gdkdrawable.h gdk/gdkdraw.c gdk/gdkwindow.c
gdk/x11/gdkdrawable-x11.c: Remove draw_layout() from the vtable,
since we have a rendering-system independent implementation in
terms of draw_glyphs().
* gdk/gdkpango.c gdkdrawable.h (gdk_draw_layout_line): New
function to render a single line.
* gdk/x11/gdkpango.c: Move the guts of this file mostly
into ../gdkpango.c, which simplifies things, since we
don't have to deal with raw X gc's.
Fri May 19 04:28:16 2000 Owen Taylor <otaylor@redhat.com>
* gtk/gtktextlayout.[ch]: Add get_log_attrs() function to
get the logical attributes for a given GtkTextLine.
Tue May 30 16:05:39 2000 Owen Taylor <otaylor@redhat.com>
* gdk/x11/gdkfont-x11.c (gdk_font_charset_for_locale): Track
g_locale_get_codeset() to g_get_codeset() change.
Tue May 30 15:03:19 2000 Owen Taylor <otaylor@redhat.com>
* gtk/testcalendar.c (calendar_font_selection_ok): Use font
descriptions.
* gtk/gtkentry.c (gtk_entry_draw_text): Center text within
the entry.
* gtk/gtkfontsel.c (gtk_font_selection_dialog_init): Start of
redoing (vastly simplifying) for Pango. Still needs quite
a bit of work. (Size selection is currently poor. List of
predefined sizes is not a good idea, since all of these
sizes won't necessarily be distinct.)
Tue May 30 13:50:19 2000 Owen Taylor <otaylor@redhat.com>
* gdk/x11/gdkfont-x11.c (gdk_font_charset_for_locale): Handle
CODESET results for LANG=C.
Mon May 29 15:49:10 2000 Owen Taylor <otaylor@redhat.com>
* gtk/gtkrc.[ch]: Add a 'font_name' declaration to RC
which takes a stringized pango font description;
ignore the older 'font' and 'fontset' declarations.
* gtk/gtkstyle.c gtk/gtkrc.c: Fill in the style->font
field with a GdkFont derived via gdk_font_from_description(),
for compatibility. (Should we just remove it entirely?
Probably too much compatibility breakage, but people
should be migrating to the new Pango stuff as quickly
as possible.)
Mon May 29 15:47:41 2000 Owen Taylor <otaylor@redhat.com>
* gtk/gtkentry.c gtk/gtkclist.c: s/pango_font_unref/g_object_unref/.
Mon May 29 15:44:46 2000 Owen Taylor <otaylor@redhat.com>
* gtk/gtkcalender.c: Roughly pango-ized. Really needs
redoing; there are some bugs in size allocation right
now, the semi-existant distinction between header / day
fonts was removed, but, with Pango, could actually
be made functional in a nice way.
* gtk/testcalender: Move calender from examples into this
directory as a test program. (We really need to restrcture
testgtk into a whole directory full of tests for every
widget or functionality group, separated into multiple .c
files.)
Mon May 29 15:19:56 2000 Owen Taylor <otaylor@redhat.com>
* gtk/testgtk.c (file_exists): Fix stupid typo that
was keeping RC file from being loaded.
* gtk/testgtkrc gtk/testgtkrc2: Test new pango-ized
RC file font code.
Mon May 29 14:31:27 2000 Owen Taylor <otaylor@redhat.com>
* gdk/gdkfont.h gdk/x11/gdkfont-x11.c (gdk_font_from_description):
Add function to load a GdkFont from a PangoFontDescription.
Fri May 26 17:16:40 2000 Owen Taylor <otaylor@redhat.com>
* gtk/frame.[ch] gtkaspectframe.c: Make frame widgets able
to have any widget for the label, use a GtkLabel widget
to display the text. (Based partially on a patch from
Anders Carlson.)
(Quite a bit of code reorganization - strip 90% of the
guts out of gtkaspectframe and add a single virtual
func to GtkFrameClass - compute_child_allocation.)
Fri May 26 12:00:02 2000 Owen Taylor <otaylor@redhat.com>
* gtk/gtkctree.c gtk/gtkclist.[ch]: Pangoized.
(Removed clist->row_center_offset field because caching
it wasn't saving time or code, added private function
_gtk_clist_create_cell_layout()).
Wed May 24 15:59:37 2000 Owen Taylor <otaylor@redhat.com>
* gtk/gtkaccellabel.c: Pangoized.
* gtk/[hv]ruler.c: Pangoized
Mon May 22 19:23:59 2000 Owen Taylor <otaylor@redhat.com>
* gtk/gtkfilesel.c (gtk_file_selection_init):
Use gtk_clist_set_column_auto_resize() to remove need
need for manual column width computations.
Mon May 22 18:50:26 2000 Owen Taylor <otaylor@redhat.com>
* gtk/gtktooltips.[ch]: Replace custom drawing with a GtkLabel,
ensuring Pango correctness, and considerably simplifying the
code.
* gtk/gtklabel.c gtk[hv]scale.c: 1000 => PANGO_SCALE.
* gtk/gtklabel.c (gtk_label_size_request): Fixed incorrect
getting of numbers of lines.
* gtk/gtklabel.c (gtk_label_size_request): Set the requisition
to the actual requested width of the lable, not to the wrap
width we set.
* gtk/gtktextchild.h: Remove extraneous include of gtk/gtk.h.
* gtk/gtktextbtree.c gtk/gtktextbuffer.c gtk/gtktextlayout.c
gtk/gtktextview.c gtk/gtktextview.[ch]: Fix up includes.
* gtk/gtktextview.c: Fix structure inheritance.
* gtk/gtkprogressbar.c: Pangoize.
Mon May 22 15:47:30 2000 Owen Taylor <otaylor@redhat.com>
* gtk/gtktextview.c (gtk_text_view_get_first_para_iter): Encapsulate
in a function.
* gtk/gtktextlayout.c (find_display_line_above): Fixed
bug with computing line tops.
* gtk/gtktextview.c (changed_handler): Fix < , <= confusion.
Thu May 18 18:53:31 2000 Owen Taylor <otaylor@redhat.com>
* gtk/gtktextdisplay.c (gtk_text_layout_draw): Fix up the x_offset
and y_offset coordinates to do what we need now. (The offset between
buffer and layout coordinates has been reintroduced, but is a
bit different than before.)
* gtk/gtktextview.[ch]: No longer inherit from GtkLayout; instead
handle the adjustments ourselves, and scroll as necessary using
the new gdk_window_scroll().
The advantage of this is that when we are incrementally revalidating,
we are essentially rearranging things around the visible portion
of the screen. With the old setup, the visible portion of the
screen was moved around in the layout, so scrolling and redrawing
to track that caused jumping of the display. Since we now
control the scrolling ourselves, we can suppress this and
only redraw when things actually change.
Thu May 18 18:47:25 2000 Owen Taylor <otaylor@redhat.com>
* gtk/gtktextbtree.c (redisplay_mark): We need to invalidate
the region not just redisplay it after-all, since we store the
cursors in the LineDisplay. (Ugly interactions here between
GtkLayout and GtkTextBTree here.)
* gtk/gtktextbtree.c (redisplay_region): Fixed reversed comparison.
Thu May 18 18:43:21 2000 Owen Taylor <otaylor@redhat.com>
* gdk/gdkwindow.h gdk/x11/gdkgeometry-x11.c (gdk_window_scroll):
Added function to scroll contents of a window while keeping the
window constant. Works by XCopyArea or guffaw-scrolling depending
on the details of how the window is set up. (guffaw-scrolling
still needs to be filled in.)
Wed May 17 22:36:53 2000 Owen Taylor <otaylor@redhat.com>
* gtk/gtktextiter.c gtk/gtkmain.c: Add a debug key for the text widget,
move the debugging that was tied to a global variable
to that.
* gtk/gtkmarshal.list: Add NONE:INT,INT,INT
* gtk/gtktextbtree.[ch] gtk/gtktextlayout.c: Keep a separate
validated flag, in line data instead of setting height/width to
-1. This allows us to perform operations with partially invalid
buffer (using the old size for invalid lines) and thus to do
incremental vaidation. Keep height/width aggregates up to date
when deleting text and rebalancing the tree.
* gtk/gtktextbtree.[ch]: Add functions validate a line
(gtk_text_btree_validate_line), and to validate up
to a number of pixels (gtk_text_btree_validate).
* gtk/gtktextlayout.[ch]: Add an ::invalidated signal
that indicates that something is changed and a revalidation
pass is needed. Change ::need_repaint to ::changed, and
make it take old and new yranges instead of a rectangle.
* gtk/gtktextbtree.[ch] gtk/gtktextlayout.[ch]: Move
the line_data_destroy() function from
gtk_text_btree_add_view() to a virtual function in
GtkTextLayout
* gtk/gtktextbtree.[ch]: Remove gtk_text_btree_get_damage_range(),
since we are handling partial repaints in a different fashion
now.
* gtk/gtktextbtree.[ch]: Only repaint the changed portion
of the selection instead of queueing a repaint on the
entire widget.
* gtk/gtktextbuffer.[ch] gtk/gtktextbtree.[ch]: Move
get_selection_bounds() down to btree, make the function
in buffer a wrapper around the btree function.
* gtk/gtktextlayout.[ch]: Add functions to check if the
layout is valid and to recompute either a range of pixels
aroudn a line or a certain total number of pixels.
* gtk/gtktextlayout.[ch]: Cache a single line display;
now that we only redraw the needed portions, the hit rate
for this cache is quite high.
* gtk/gtktextview.[ch]: Keep track of the first paragraph
on the screen so that when re-laying-out the buffer, we can
keep the same place. This requires connecting to ::value_changed
on the adjustments
* gtk/gtktextview.[ch]: Add idle functions to revalidate
the buffer after we receive an ::invalidated signal.
Wed May 17 22:10:47 2000 Owen Taylor <otaylor@redhat.com>
* gtk/gtklayout.c (gtk_layout_size_allocate): Set upper
to max of allocation and layout size, not just to the
layout size.
* gtk/gtk[hv]scrollbar.c (gtk_[hv]scrollbar_calc_slider_size):
Invalidate window so it gets redrawn properly.
* gdk/gdkwindow.c (gdk_window_invalidate_rect): Allow rect == NULL
to mean the entire window.
* gdk/gdkevents.h: Move definition for GDK_PRIORITY_REDRAW
into public header.
Mon May 15 14:51:31 2000 Owen Taylor <otaylor@redhat.com>
* gtk/gtktextmark.c (gtk_text_mark_get_name): Add function
to get the name of a mark.
* gtk/gtktextlayout.c (gtk_text_layout_get_line_at_y): Add a function
to find the paragraph from a y position.
Thu May 11 12:57:20 2000 Owen Taylor <otaylor@redhat.com>
* gtk/gtktextbtree.c (gtk_text_btree_node_invalidate_upward): Valid
nodes have width/height >= 0, not > 0.
Tue May 9 21:29:06 2000 Owen Taylor <otaylor@redhat.com>
* gtk/gtktextlayout.[ch] gtk/gtktextdisplay.c (gtk_text_layout_get_line_display):
Add a size_only flag, so when we only need the size, we don't create
useless appearance attributes.
* gtk/gtktextview.c (gtk_text_view_ensure_layout): Remove
duplicate setting of font description.
* gtk/gtkscale.c: Use PANGO_SCALE instead of 1000
Wed Apr 26 01:53:23 2000 Owen Taylor <otaylor@redhat.com>
* gtk/Makefile.am (EXTRA_DIST): Add OLD_STAMP into
EXTRA_DIST. It does not work well when the file that
everything depends on is not in the tarball.
Wed Apr 26 00:56:14 2000 Owen Taylor <otaylor@redhat.com>
* gtk/testgtk.c: Some hacks and fixes so that it basically
works when not sitting in the GTK+ build tree.
2000-05-03 Havoc Pennington <hp@redhat.com>
* gtk/gtktextbtree.c (gtk_text_line_next_could_contain_tag):
Properly determine the ordering of the tag root and the current
line within the tree. Previous algorithm only worked if the tag
root's immediate parent was the common root of both the current
line and the tag root.
Wed Apr 26 00:43:00 2000 Owen Taylor <otaylor@redhat.com>
* gtk/gtktextlayout.c (set_para_values): Fix some bugs in
alignment.
* gtk/gtktextview.c (gtk_text_view_ensure_layout): Track
the widget text directional dynamically.
* gtk/gtktextview.[ch]: Added functions to get and set default
wrap mode.
Tue Apr 25 23:47:38 2000 Owen Taylor <otaylor@redhat.com>
* gtk/gtktextlayout.c (gtk_text_layout_get_iter_location): Fix bug
in cursor location computation.
Tue Apr 25 23:22:59 2000 Owen Taylor <otaylor@redhat.com>
* gtk/gtklayout.c (gtk_layout_set_size): Clamp hadjustment/
vadjusment values properly when layout gets smaller.
* gtk/gtktextview.c (need_repaint_handler): Areas being
passed in are far completely inaccurate, and sometimes
too small, so, for now, just queue a redraw on the
whole visible region.
2000-04-25 Havoc Pennington <hp@redhat.com>
* gtk/gtktextbtree.c (summary_destroy): new function to
destroy tag summary nodes
(gtk_text_line_next_could_contain_tag): this function was
totally broken if the line passed in wasn't below the tag
root. Fix it.
(gtk_text_btree_first_could_contain_tag): In the tag == NULL
"wildcard" case, we have to do a linear scan. Blah.
(gtk_text_btree_last_could_contain_tag): In tag == NULL case,
we have to do the linear scan
(tag_removed_cb): When a tag is removed from the tag table,
remove the GtkTextTagInfo node from the btree.
(gtk_text_btree_spew): Implement the spew function, for
our debugging pleasure.
Tue Apr 25 19:40:18 2000 Owen Taylor <otaylor@redhat.com>
* gtk/gtktextlayout.c (gtk_text_layout_set_buffer): Fix
a problem with referring to the wrong buffer.
* gtk/gtkentry.c: Fix focus-in/focus-out confusion.
* gtk/gtkrc.c gtk/gtkstyle.c: Moving setting default
font description to gtk_style_new() - otherwise things
don't work without a .gtkrc file.
* gtk/gtktextbuffer.c (gtk_text_buffer_new): Sink the
tags table if we create it ourself, too.
* gdk/gdktypes.h (enum): Move GDK_RELEASE_MASK, since
it was conflicting with XKB modifiers.
* gtk/gtktextview.[ch]: Add simple support for
GtkIMContext.
Mon Apr 24 19:34:18 2000 Owen Taylor <otaylor@redhat.com>
* gtk/gtkentry.c (gtk_entry_move_cursor_visually): Fix problem
with deletion from last commit.
Mon Apr 24 19:29:40 2000 Owen Taylor <otaylor@redhat.com>
* gtk/gtkwidget.c (gtk_widget_create_pango_context): Set the language
in the context from the current locale.
* gtk/gtkentry.c (gtk_entry_size_request): Use language from the
context, not hardcoded value.
* gtk/gtkentry.c (gtk_entry_move_cursor): Make character movement visual,
not logical.
Sun Apr 23 23:39:18 2000 Owen Taylor <otaylor@redhat.com>
* gtk/gtkentry.c gtk/gtktextdisplay.c: Don't handle selections as
attributes - that doesn't handle partial-glyph selection
properly. Instead use new pango_layout_line_get_x_ranges()
functionality to draw the selection.
* gtk/gtkentry.c: Simplify code since pango_layout_line_index_to_x()
now properly handles out-of-range coordinates.
* gtk/gtktextbuffer.c: Emit "mark_set" when the cursor is moved.
* gtk/gtktextiter.h gtk/gtktextiterprivate.h: Make gtk_text_iter_get_line_byte()
public.
* gtk/gtktextlayout.[ch]: Properly set the direction in the PangoContext
for paragraphs opposite to the base direction of the widget.
* gtk/gtktextlayout.[ch] gtk/gtktextdisplay.c: Fixes for alignment.
* gtk/gtktextlayout.c: Don't split segments on marks, since that
causes Arabic words to reshape as you cursor through.
* gtk/gtktextlayout.[ch] gtk/gtktextview.[ch]: Implement virtual
cursor position when moving vertically with the arrow keys and
scrolling with page-up/page-down. (Arrow keys save only the X,
scrolling saves both X and Y.)
This means you can line-up / line-down or page-up / page-down
without losing your place, and also that moving vertically
with the cursor keys keeps the same X position, not the same
character count:
* gtk/gtktextlayout.[ch] gtk/gtktextview.[ch]: Make vertical
arrow keys move by display lines, not paragraphs.
Tue Apr 18 14:16:50 2000 Owen Taylor <otaylor@redhat.com>
* gtk/gtklayout.c: Make sure that the bin window is at least
as big as the allocation. (Should we also make sure that the
bin window is big enough to completely cover widget->window?)
* gtk/gtktextview.c (gtk_text_view_get_visible_rect): Add
function to get the onscreen rectangle.
* gdk/x11/gdkwindow-x11.c (gdk_window_get_pointer): Correctly account
for offsets in window coordinates.
Sun Apr 16 16:13:27 2000 Owen Taylor <otaylor@redhat.com>
* gtk/gtkentry.c (gtk_entry_get_cursor_locations): Fix index/offset
confusion.
* gtk/gtktextview.c (gtk_text_view_ensure_layout): Set the default direction
from the widget direction.
* gtk/gtktexttag.c gtk/gtktexttagprivate.h (gtk_text_tag_set_arg):
Add a "direction" attribute.
* gtk/gtktextview.c: global s/tkxt/text_view/.
* gtk/testtext.c: Added long block of text in Arabic, to test out
the direction attributes. (Some problems with the shaping system
for arabic become obvious - like the fact the cursor splits words
into unjoined pieces.)
Fri Apr 14 12:54:34 2000 Owen Taylor <otaylor@redhat.com>
* gtk/gtktextdisplay.c (render_layout): Add overstrike handling.
* gtk/gtktextlayout.c: Fix up alignment.
* gtk/testtext.c: Add some tests for centering, wrapping.
Fri Apr 14 09:26:22 2000 Owen Taylor <otaylor@redhat.com>
* gdk/gdkdrawable.h gdk/gdkdraw.c gdk/gdkwindow.c gdk/x11/gdkdrawable-x11.c:
Add a draw_glyphs() operation to the drawable vtable and gdk_draw_glyphs().
If we wrote GTK+-specific layout-render function this could just replace
the draw_layout() operation in the vtable.
* gtk/gtkentry.c: Move guts of gtk_entry_get_cursor_locations to
pango_layout_get_cursor_pos() and use that function.
* gtk/gtktextchild.[ch]: add gtk_ onto pixmap_segment_new(), since it
is a non-static symbol.
* gtk/gtktextbtree.[ch]: Replace gtk_text_btree_find_line_data_by_y()
with gtk_text_btree_find_line_by_y()
* gtk/gtktextdisplay.c: Rewrote for Pango - uses a custom layout
renderer that handles GtkTextAppearance attributes.
* gtk/gtktexttag.[ch] gtk/gtktexttagprivate.h:
- Move the values in the style that don't affect geometry into a
GtkTextAppearance structure.
- Change underline to take a PangoUnderline and "font" a string
representation of a font description
- Add a "font_desc" attribute which takes a FontDescription structure.
* gtk/gtktextlayout.[ch]:
- Get rid of the display-line list per each line. Instead, we
generate, on demand, a GtkTextLineDisplay structure which]
contains a PangoLayout * and other necesary information
(offsets, cursor locations) for displaying a paragraph.
- Get rid of the code to wrap lines, create display chunks,
etc. Instead, we just go through a paragraph and convert
it into the necessary inputs to a PangoLayout.
- Implement a new attribute type, GtkTextAttrAppearance. This
holds a GtkTextAppearance, and is used to pass colors,
stipple, etc, through from the layout to the display without
having to use lots and lots of individual attributes.
- Reimplement gtk_layout_get_iter_at_pixel() gtk_layout_get_iter_pos()
in terms of PangoLayout functions.
* gtk/gtktextview.c:
- Handle passing the necessary PangoContext to the layout
- Some fixups in painting to deal with the automatic backing store
and offsetting of GTK+-1.4
- Add a style_set handler so that the default style reacts
properly to theme changes.
* gtk/gtktext?*.[ch]: Random code-style fixes.
* gtk/testtext.c: Substitute in languages that Pango handles now for Thai
Mon Apr 10 10:33:45 2000 Owen Taylor <otaylor@redhat.com>
* gtk/gtktext?*.[ch]: Check in Havoc's port of the Tk text widget,
in original form preparatory to Pango-ization and gdkimcontext-ization.
Thu Apr 6 19:25:39 2000 Owen Taylor <otaylor@redhat.com>
* gtk/gtkimcontext.c: Move default implementations to real_* vfuncs,
so that we can derive from gtkimcontext in language bindings properly.
Thu Apr 6 16:02:52 2000 Owen Taylor <otaylor@redhat.com>
* gtk/gtkimcontextsimple.[ch]: Use gdk_keyval_to_unicode to gdk_unicode_to_keyval.
Add a compose table including (almost) all the compose combinations
from X. This is 6k of static, shared data as opposed to 50k or so of dynamic
data in the XIM implementation.
* gdk/gdk.h gdk/gdkkeyuni.c gdk/win32/gdkevents-win32.c (gdk_keyval_to_unicode, gdk_unicode_to_keyval):
Moved functions to convert keyvalues from and to unicode here from
the win32 port and made them public.
Wed Apr 5 16:37:29 2000 Owen Taylor <otaylor@redhat.com>
* gtk/gtkeditable.c (gtk_editable_insert_text): Allow new_text_length == -1.
Wed Apr 5 16:27:45 2000 Owen Taylor <otaylor@redhat.com>
* gtk/gtkimcontext.[ch]: Base class for new input context system
* gtk/gtkimmulticontext.[ch]: Proxy input context that allows
the real input context implementation to be loaded from modules
and switched on the fly.
* gtk/gtkcontextsimple.[ch]: Simple implementation of an input
context that just does direct keysymbol => unicode translation.
* gtk/gtkentry.[ch]: Start switching editing over to using
GtkInputContext. (No handling of preedit yet.)
Wed Apr 5 15:48:41 2000 Owen Taylor <otaylor@redhat.com>
* gtk/gtktypeutils.h (GTK_CHECK_GET_CLASS): Fix problem with one too
many substitutions. (klass should not be subsituted.)
Wed Apr 5 00:18:14 2000 Owen Taylor <otaylor@redhat.com>
* configure.in: Add checks for Pango
* configure.in docs/Makefile.am: Add test for sgml2html
and allow 'make dist' without building html, but print out
warnings in that case. (For making snapshots)
* gdk/Makefile.am gdk/x11/Makefile.am gtk/Makefile.am:
Add Pango libraries and C flags
* gdk/gdkdraw.c gdk/gdkdrawable.h gdkwindow.c gdk/x11/gdkdrawable-x11.c:
Add function (gdk_draw_layout) to draw a pango layout.
* gdk/gdkpango.h gdk/x11/gdkpango-x11.c: New file with functions
for getting Pango contexts for GDK.
* gtk/gtkeditable.c: Get rid of dead code gtk_editable_parent_set()
* gtk/gtkentry.[ch]: Complete rewrite to use Pango, add bidirectional
editing.
* gtk/gtkentry.c: Hack in simple Hebrew input with direct
keysym => unicode translations. More languages can be added
here, but real input-method support is needed.
* docs/Changes-1.4.txt: Added note about entry behavior.
* gtk/gtkenums.h gtk/gtkwidget.[ch] testgtk.c gtkprivate.h: Add functions
to set the reading direction for a widget and the global direction.
Add test which allows toggling the global direction. Two private
flags are used to store the direction. (GTK_DIRECTION_SET + GTK_DIRECTION_LTR)
* gtk/gtkcheckbutton.c gtk/gtkframe.c gtk/gtkhbbox.c gtk/gtkhbox.c
gtk/gtkradiobutton.c gtk/gtkspinbutton.c gtk/gtktable.c
* gtk/gtk[hv]scale.c gtk/gtkscale.[ch]: Draw numbers using Pango
* gtk/gtklabel.[ch]: Moved to Pango and considerably rewritten. Line breaking,
underlining now handled by Pango.
* gtk/gtkstyle.[ch] gtk/gtkrc.[ch]: Add a PangoFontDescription
to RCStyle and Style. (Having both this and the old font name and GdkFont
is temporary.)
* gtk/gtkwidget.[ch] (gtk_widget_create_pango_{context,layout}): Added
convenience functions for creating contexts and layouts for widgets.
* gtk/testgtk.c: Enhance label tests with multilingual labels.
2000-06-02 03:14:07 +00:00
|
|
|
|
|
2005-05-11 19:16:19 +00:00
|
|
|
|
cairo_move_to (cr, x, y);
|
|
|
|
|
pango_cairo_show_layout (cr, layout);
|
Remove all references to offscreen flag which was no longer used.
Thu Jun 1 23:05:13 2000 Owen Taylor <otaylor@redhat.com>
* gtk/gtkwidget.c: Remove all references to
offscreen flag which was no longer used.
* gtk/gtkprivate.h (enum): Remove unused flags and compress.
* gtk/gtkframe.c (gtk_frame_set_label_widget): Check
for non-null label_widget->parent.
* gtk/gtkentry.c: Get rid of code to deal with PangoAttribute
which no longer was used.
* gdk/gdkpango.c (gdk_pango_context_get_info): make static.
* gdk/gdkpango.c (gdk_draw_layout[_line]): Add checks
for null arguments.
* gdk/x11/gdkgeometry-x11.c (gdk_window_scroll): add
check for destroyed windows.
Thu Jun 1 13:48:45 2000 Owen Taylor <otaylor@redhat.com>
* gtk/gtkimmulticontext.c: Add a finalize method and unref
the slave context there.
* gtk/gtkinvisible.[ch]: Make reference counting behavior
identical to GtkWindow.
Thu Jun 1 01:54:11 2000 Owen Taylor <otaylor@redhat.com>
* Makefile.am gdk/gdkpango.c: Copy the layout render function from
pangox to here, so we can write them independent of rendering
system, using GDK primitives.
* gdk/gdkdrawable.h gdk/gdkdraw.c gdk/gdkwindow.c
gdk/x11/gdkdrawable-x11.c: Remove draw_layout() from the vtable,
since we have a rendering-system independent implementation in
terms of draw_glyphs().
* gdk/gdkpango.c gdkdrawable.h (gdk_draw_layout_line): New
function to render a single line.
* gdk/x11/gdkpango.c: Move the guts of this file mostly
into ../gdkpango.c, which simplifies things, since we
don't have to deal with raw X gc's.
Fri May 19 04:28:16 2000 Owen Taylor <otaylor@redhat.com>
* gtk/gtktextlayout.[ch]: Add get_log_attrs() function to
get the logical attributes for a given GtkTextLine.
Tue May 30 16:05:39 2000 Owen Taylor <otaylor@redhat.com>
* gdk/x11/gdkfont-x11.c (gdk_font_charset_for_locale): Track
g_locale_get_codeset() to g_get_codeset() change.
Tue May 30 15:03:19 2000 Owen Taylor <otaylor@redhat.com>
* gtk/testcalendar.c (calendar_font_selection_ok): Use font
descriptions.
* gtk/gtkentry.c (gtk_entry_draw_text): Center text within
the entry.
* gtk/gtkfontsel.c (gtk_font_selection_dialog_init): Start of
redoing (vastly simplifying) for Pango. Still needs quite
a bit of work. (Size selection is currently poor. List of
predefined sizes is not a good idea, since all of these
sizes won't necessarily be distinct.)
Tue May 30 13:50:19 2000 Owen Taylor <otaylor@redhat.com>
* gdk/x11/gdkfont-x11.c (gdk_font_charset_for_locale): Handle
CODESET results for LANG=C.
Mon May 29 15:49:10 2000 Owen Taylor <otaylor@redhat.com>
* gtk/gtkrc.[ch]: Add a 'font_name' declaration to RC
which takes a stringized pango font description;
ignore the older 'font' and 'fontset' declarations.
* gtk/gtkstyle.c gtk/gtkrc.c: Fill in the style->font
field with a GdkFont derived via gdk_font_from_description(),
for compatibility. (Should we just remove it entirely?
Probably too much compatibility breakage, but people
should be migrating to the new Pango stuff as quickly
as possible.)
Mon May 29 15:47:41 2000 Owen Taylor <otaylor@redhat.com>
* gtk/gtkentry.c gtk/gtkclist.c: s/pango_font_unref/g_object_unref/.
Mon May 29 15:44:46 2000 Owen Taylor <otaylor@redhat.com>
* gtk/gtkcalender.c: Roughly pango-ized. Really needs
redoing; there are some bugs in size allocation right
now, the semi-existant distinction between header / day
fonts was removed, but, with Pango, could actually
be made functional in a nice way.
* gtk/testcalender: Move calender from examples into this
directory as a test program. (We really need to restrcture
testgtk into a whole directory full of tests for every
widget or functionality group, separated into multiple .c
files.)
Mon May 29 15:19:56 2000 Owen Taylor <otaylor@redhat.com>
* gtk/testgtk.c (file_exists): Fix stupid typo that
was keeping RC file from being loaded.
* gtk/testgtkrc gtk/testgtkrc2: Test new pango-ized
RC file font code.
Mon May 29 14:31:27 2000 Owen Taylor <otaylor@redhat.com>
* gdk/gdkfont.h gdk/x11/gdkfont-x11.c (gdk_font_from_description):
Add function to load a GdkFont from a PangoFontDescription.
Fri May 26 17:16:40 2000 Owen Taylor <otaylor@redhat.com>
* gtk/frame.[ch] gtkaspectframe.c: Make frame widgets able
to have any widget for the label, use a GtkLabel widget
to display the text. (Based partially on a patch from
Anders Carlson.)
(Quite a bit of code reorganization - strip 90% of the
guts out of gtkaspectframe and add a single virtual
func to GtkFrameClass - compute_child_allocation.)
Fri May 26 12:00:02 2000 Owen Taylor <otaylor@redhat.com>
* gtk/gtkctree.c gtk/gtkclist.[ch]: Pangoized.
(Removed clist->row_center_offset field because caching
it wasn't saving time or code, added private function
_gtk_clist_create_cell_layout()).
Wed May 24 15:59:37 2000 Owen Taylor <otaylor@redhat.com>
* gtk/gtkaccellabel.c: Pangoized.
* gtk/[hv]ruler.c: Pangoized
Mon May 22 19:23:59 2000 Owen Taylor <otaylor@redhat.com>
* gtk/gtkfilesel.c (gtk_file_selection_init):
Use gtk_clist_set_column_auto_resize() to remove need
need for manual column width computations.
Mon May 22 18:50:26 2000 Owen Taylor <otaylor@redhat.com>
* gtk/gtktooltips.[ch]: Replace custom drawing with a GtkLabel,
ensuring Pango correctness, and considerably simplifying the
code.
* gtk/gtklabel.c gtk[hv]scale.c: 1000 => PANGO_SCALE.
* gtk/gtklabel.c (gtk_label_size_request): Fixed incorrect
getting of numbers of lines.
* gtk/gtklabel.c (gtk_label_size_request): Set the requisition
to the actual requested width of the lable, not to the wrap
width we set.
* gtk/gtktextchild.h: Remove extraneous include of gtk/gtk.h.
* gtk/gtktextbtree.c gtk/gtktextbuffer.c gtk/gtktextlayout.c
gtk/gtktextview.c gtk/gtktextview.[ch]: Fix up includes.
* gtk/gtktextview.c: Fix structure inheritance.
* gtk/gtkprogressbar.c: Pangoize.
Mon May 22 15:47:30 2000 Owen Taylor <otaylor@redhat.com>
* gtk/gtktextview.c (gtk_text_view_get_first_para_iter): Encapsulate
in a function.
* gtk/gtktextlayout.c (find_display_line_above): Fixed
bug with computing line tops.
* gtk/gtktextview.c (changed_handler): Fix < , <= confusion.
Thu May 18 18:53:31 2000 Owen Taylor <otaylor@redhat.com>
* gtk/gtktextdisplay.c (gtk_text_layout_draw): Fix up the x_offset
and y_offset coordinates to do what we need now. (The offset between
buffer and layout coordinates has been reintroduced, but is a
bit different than before.)
* gtk/gtktextview.[ch]: No longer inherit from GtkLayout; instead
handle the adjustments ourselves, and scroll as necessary using
the new gdk_window_scroll().
The advantage of this is that when we are incrementally revalidating,
we are essentially rearranging things around the visible portion
of the screen. With the old setup, the visible portion of the
screen was moved around in the layout, so scrolling and redrawing
to track that caused jumping of the display. Since we now
control the scrolling ourselves, we can suppress this and
only redraw when things actually change.
Thu May 18 18:47:25 2000 Owen Taylor <otaylor@redhat.com>
* gtk/gtktextbtree.c (redisplay_mark): We need to invalidate
the region not just redisplay it after-all, since we store the
cursors in the LineDisplay. (Ugly interactions here between
GtkLayout and GtkTextBTree here.)
* gtk/gtktextbtree.c (redisplay_region): Fixed reversed comparison.
Thu May 18 18:43:21 2000 Owen Taylor <otaylor@redhat.com>
* gdk/gdkwindow.h gdk/x11/gdkgeometry-x11.c (gdk_window_scroll):
Added function to scroll contents of a window while keeping the
window constant. Works by XCopyArea or guffaw-scrolling depending
on the details of how the window is set up. (guffaw-scrolling
still needs to be filled in.)
Wed May 17 22:36:53 2000 Owen Taylor <otaylor@redhat.com>
* gtk/gtktextiter.c gtk/gtkmain.c: Add a debug key for the text widget,
move the debugging that was tied to a global variable
to that.
* gtk/gtkmarshal.list: Add NONE:INT,INT,INT
* gtk/gtktextbtree.[ch] gtk/gtktextlayout.c: Keep a separate
validated flag, in line data instead of setting height/width to
-1. This allows us to perform operations with partially invalid
buffer (using the old size for invalid lines) and thus to do
incremental vaidation. Keep height/width aggregates up to date
when deleting text and rebalancing the tree.
* gtk/gtktextbtree.[ch]: Add functions validate a line
(gtk_text_btree_validate_line), and to validate up
to a number of pixels (gtk_text_btree_validate).
* gtk/gtktextlayout.[ch]: Add an ::invalidated signal
that indicates that something is changed and a revalidation
pass is needed. Change ::need_repaint to ::changed, and
make it take old and new yranges instead of a rectangle.
* gtk/gtktextbtree.[ch] gtk/gtktextlayout.[ch]: Move
the line_data_destroy() function from
gtk_text_btree_add_view() to a virtual function in
GtkTextLayout
* gtk/gtktextbtree.[ch]: Remove gtk_text_btree_get_damage_range(),
since we are handling partial repaints in a different fashion
now.
* gtk/gtktextbtree.[ch]: Only repaint the changed portion
of the selection instead of queueing a repaint on the
entire widget.
* gtk/gtktextbuffer.[ch] gtk/gtktextbtree.[ch]: Move
get_selection_bounds() down to btree, make the function
in buffer a wrapper around the btree function.
* gtk/gtktextlayout.[ch]: Add functions to check if the
layout is valid and to recompute either a range of pixels
aroudn a line or a certain total number of pixels.
* gtk/gtktextlayout.[ch]: Cache a single line display;
now that we only redraw the needed portions, the hit rate
for this cache is quite high.
* gtk/gtktextview.[ch]: Keep track of the first paragraph
on the screen so that when re-laying-out the buffer, we can
keep the same place. This requires connecting to ::value_changed
on the adjustments
* gtk/gtktextview.[ch]: Add idle functions to revalidate
the buffer after we receive an ::invalidated signal.
Wed May 17 22:10:47 2000 Owen Taylor <otaylor@redhat.com>
* gtk/gtklayout.c (gtk_layout_size_allocate): Set upper
to max of allocation and layout size, not just to the
layout size.
* gtk/gtk[hv]scrollbar.c (gtk_[hv]scrollbar_calc_slider_size):
Invalidate window so it gets redrawn properly.
* gdk/gdkwindow.c (gdk_window_invalidate_rect): Allow rect == NULL
to mean the entire window.
* gdk/gdkevents.h: Move definition for GDK_PRIORITY_REDRAW
into public header.
Mon May 15 14:51:31 2000 Owen Taylor <otaylor@redhat.com>
* gtk/gtktextmark.c (gtk_text_mark_get_name): Add function
to get the name of a mark.
* gtk/gtktextlayout.c (gtk_text_layout_get_line_at_y): Add a function
to find the paragraph from a y position.
Thu May 11 12:57:20 2000 Owen Taylor <otaylor@redhat.com>
* gtk/gtktextbtree.c (gtk_text_btree_node_invalidate_upward): Valid
nodes have width/height >= 0, not > 0.
Tue May 9 21:29:06 2000 Owen Taylor <otaylor@redhat.com>
* gtk/gtktextlayout.[ch] gtk/gtktextdisplay.c (gtk_text_layout_get_line_display):
Add a size_only flag, so when we only need the size, we don't create
useless appearance attributes.
* gtk/gtktextview.c (gtk_text_view_ensure_layout): Remove
duplicate setting of font description.
* gtk/gtkscale.c: Use PANGO_SCALE instead of 1000
Wed Apr 26 01:53:23 2000 Owen Taylor <otaylor@redhat.com>
* gtk/Makefile.am (EXTRA_DIST): Add OLD_STAMP into
EXTRA_DIST. It does not work well when the file that
everything depends on is not in the tarball.
Wed Apr 26 00:56:14 2000 Owen Taylor <otaylor@redhat.com>
* gtk/testgtk.c: Some hacks and fixes so that it basically
works when not sitting in the GTK+ build tree.
2000-05-03 Havoc Pennington <hp@redhat.com>
* gtk/gtktextbtree.c (gtk_text_line_next_could_contain_tag):
Properly determine the ordering of the tag root and the current
line within the tree. Previous algorithm only worked if the tag
root's immediate parent was the common root of both the current
line and the tag root.
Wed Apr 26 00:43:00 2000 Owen Taylor <otaylor@redhat.com>
* gtk/gtktextlayout.c (set_para_values): Fix some bugs in
alignment.
* gtk/gtktextview.c (gtk_text_view_ensure_layout): Track
the widget text directional dynamically.
* gtk/gtktextview.[ch]: Added functions to get and set default
wrap mode.
Tue Apr 25 23:47:38 2000 Owen Taylor <otaylor@redhat.com>
* gtk/gtktextlayout.c (gtk_text_layout_get_iter_location): Fix bug
in cursor location computation.
Tue Apr 25 23:22:59 2000 Owen Taylor <otaylor@redhat.com>
* gtk/gtklayout.c (gtk_layout_set_size): Clamp hadjustment/
vadjusment values properly when layout gets smaller.
* gtk/gtktextview.c (need_repaint_handler): Areas being
passed in are far completely inaccurate, and sometimes
too small, so, for now, just queue a redraw on the
whole visible region.
2000-04-25 Havoc Pennington <hp@redhat.com>
* gtk/gtktextbtree.c (summary_destroy): new function to
destroy tag summary nodes
(gtk_text_line_next_could_contain_tag): this function was
totally broken if the line passed in wasn't below the tag
root. Fix it.
(gtk_text_btree_first_could_contain_tag): In the tag == NULL
"wildcard" case, we have to do a linear scan. Blah.
(gtk_text_btree_last_could_contain_tag): In tag == NULL case,
we have to do the linear scan
(tag_removed_cb): When a tag is removed from the tag table,
remove the GtkTextTagInfo node from the btree.
(gtk_text_btree_spew): Implement the spew function, for
our debugging pleasure.
Tue Apr 25 19:40:18 2000 Owen Taylor <otaylor@redhat.com>
* gtk/gtktextlayout.c (gtk_text_layout_set_buffer): Fix
a problem with referring to the wrong buffer.
* gtk/gtkentry.c: Fix focus-in/focus-out confusion.
* gtk/gtkrc.c gtk/gtkstyle.c: Moving setting default
font description to gtk_style_new() - otherwise things
don't work without a .gtkrc file.
* gtk/gtktextbuffer.c (gtk_text_buffer_new): Sink the
tags table if we create it ourself, too.
* gdk/gdktypes.h (enum): Move GDK_RELEASE_MASK, since
it was conflicting with XKB modifiers.
* gtk/gtktextview.[ch]: Add simple support for
GtkIMContext.
Mon Apr 24 19:34:18 2000 Owen Taylor <otaylor@redhat.com>
* gtk/gtkentry.c (gtk_entry_move_cursor_visually): Fix problem
with deletion from last commit.
Mon Apr 24 19:29:40 2000 Owen Taylor <otaylor@redhat.com>
* gtk/gtkwidget.c (gtk_widget_create_pango_context): Set the language
in the context from the current locale.
* gtk/gtkentry.c (gtk_entry_size_request): Use language from the
context, not hardcoded value.
* gtk/gtkentry.c (gtk_entry_move_cursor): Make character movement visual,
not logical.
Sun Apr 23 23:39:18 2000 Owen Taylor <otaylor@redhat.com>
* gtk/gtkentry.c gtk/gtktextdisplay.c: Don't handle selections as
attributes - that doesn't handle partial-glyph selection
properly. Instead use new pango_layout_line_get_x_ranges()
functionality to draw the selection.
* gtk/gtkentry.c: Simplify code since pango_layout_line_index_to_x()
now properly handles out-of-range coordinates.
* gtk/gtktextbuffer.c: Emit "mark_set" when the cursor is moved.
* gtk/gtktextiter.h gtk/gtktextiterprivate.h: Make gtk_text_iter_get_line_byte()
public.
* gtk/gtktextlayout.[ch]: Properly set the direction in the PangoContext
for paragraphs opposite to the base direction of the widget.
* gtk/gtktextlayout.[ch] gtk/gtktextdisplay.c: Fixes for alignment.
* gtk/gtktextlayout.c: Don't split segments on marks, since that
causes Arabic words to reshape as you cursor through.
* gtk/gtktextlayout.[ch] gtk/gtktextview.[ch]: Implement virtual
cursor position when moving vertically with the arrow keys and
scrolling with page-up/page-down. (Arrow keys save only the X,
scrolling saves both X and Y.)
This means you can line-up / line-down or page-up / page-down
without losing your place, and also that moving vertically
with the cursor keys keeps the same X position, not the same
character count:
* gtk/gtktextlayout.[ch] gtk/gtktextview.[ch]: Make vertical
arrow keys move by display lines, not paragraphs.
Tue Apr 18 14:16:50 2000 Owen Taylor <otaylor@redhat.com>
* gtk/gtklayout.c: Make sure that the bin window is at least
as big as the allocation. (Should we also make sure that the
bin window is big enough to completely cover widget->window?)
* gtk/gtktextview.c (gtk_text_view_get_visible_rect): Add
function to get the onscreen rectangle.
* gdk/x11/gdkwindow-x11.c (gdk_window_get_pointer): Correctly account
for offsets in window coordinates.
Sun Apr 16 16:13:27 2000 Owen Taylor <otaylor@redhat.com>
* gtk/gtkentry.c (gtk_entry_get_cursor_locations): Fix index/offset
confusion.
* gtk/gtktextview.c (gtk_text_view_ensure_layout): Set the default direction
from the widget direction.
* gtk/gtktexttag.c gtk/gtktexttagprivate.h (gtk_text_tag_set_arg):
Add a "direction" attribute.
* gtk/gtktextview.c: global s/tkxt/text_view/.
* gtk/testtext.c: Added long block of text in Arabic, to test out
the direction attributes. (Some problems with the shaping system
for arabic become obvious - like the fact the cursor splits words
into unjoined pieces.)
Fri Apr 14 12:54:34 2000 Owen Taylor <otaylor@redhat.com>
* gtk/gtktextdisplay.c (render_layout): Add overstrike handling.
* gtk/gtktextlayout.c: Fix up alignment.
* gtk/testtext.c: Add some tests for centering, wrapping.
Fri Apr 14 09:26:22 2000 Owen Taylor <otaylor@redhat.com>
* gdk/gdkdrawable.h gdk/gdkdraw.c gdk/gdkwindow.c gdk/x11/gdkdrawable-x11.c:
Add a draw_glyphs() operation to the drawable vtable and gdk_draw_glyphs().
If we wrote GTK+-specific layout-render function this could just replace
the draw_layout() operation in the vtable.
* gtk/gtkentry.c: Move guts of gtk_entry_get_cursor_locations to
pango_layout_get_cursor_pos() and use that function.
* gtk/gtktextchild.[ch]: add gtk_ onto pixmap_segment_new(), since it
is a non-static symbol.
* gtk/gtktextbtree.[ch]: Replace gtk_text_btree_find_line_data_by_y()
with gtk_text_btree_find_line_by_y()
* gtk/gtktextdisplay.c: Rewrote for Pango - uses a custom layout
renderer that handles GtkTextAppearance attributes.
* gtk/gtktexttag.[ch] gtk/gtktexttagprivate.h:
- Move the values in the style that don't affect geometry into a
GtkTextAppearance structure.
- Change underline to take a PangoUnderline and "font" a string
representation of a font description
- Add a "font_desc" attribute which takes a FontDescription structure.
* gtk/gtktextlayout.[ch]:
- Get rid of the display-line list per each line. Instead, we
generate, on demand, a GtkTextLineDisplay structure which]
contains a PangoLayout * and other necesary information
(offsets, cursor locations) for displaying a paragraph.
- Get rid of the code to wrap lines, create display chunks,
etc. Instead, we just go through a paragraph and convert
it into the necessary inputs to a PangoLayout.
- Implement a new attribute type, GtkTextAttrAppearance. This
holds a GtkTextAppearance, and is used to pass colors,
stipple, etc, through from the layout to the display without
having to use lots and lots of individual attributes.
- Reimplement gtk_layout_get_iter_at_pixel() gtk_layout_get_iter_pos()
in terms of PangoLayout functions.
* gtk/gtktextview.c:
- Handle passing the necessary PangoContext to the layout
- Some fixups in painting to deal with the automatic backing store
and offsetting of GTK+-1.4
- Add a style_set handler so that the default style reacts
properly to theme changes.
* gtk/gtktext?*.[ch]: Random code-style fixes.
* gtk/testtext.c: Substitute in languages that Pango handles now for Thai
Mon Apr 10 10:33:45 2000 Owen Taylor <otaylor@redhat.com>
* gtk/gtktext?*.[ch]: Check in Havoc's port of the Tk text widget,
in original form preparatory to Pango-ization and gdkimcontext-ization.
Thu Apr 6 19:25:39 2000 Owen Taylor <otaylor@redhat.com>
* gtk/gtkimcontext.c: Move default implementations to real_* vfuncs,
so that we can derive from gtkimcontext in language bindings properly.
Thu Apr 6 16:02:52 2000 Owen Taylor <otaylor@redhat.com>
* gtk/gtkimcontextsimple.[ch]: Use gdk_keyval_to_unicode to gdk_unicode_to_keyval.
Add a compose table including (almost) all the compose combinations
from X. This is 6k of static, shared data as opposed to 50k or so of dynamic
data in the XIM implementation.
* gdk/gdk.h gdk/gdkkeyuni.c gdk/win32/gdkevents-win32.c (gdk_keyval_to_unicode, gdk_unicode_to_keyval):
Moved functions to convert keyvalues from and to unicode here from
the win32 port and made them public.
Wed Apr 5 16:37:29 2000 Owen Taylor <otaylor@redhat.com>
* gtk/gtkeditable.c (gtk_editable_insert_text): Allow new_text_length == -1.
Wed Apr 5 16:27:45 2000 Owen Taylor <otaylor@redhat.com>
* gtk/gtkimcontext.[ch]: Base class for new input context system
* gtk/gtkimmulticontext.[ch]: Proxy input context that allows
the real input context implementation to be loaded from modules
and switched on the fly.
* gtk/gtkcontextsimple.[ch]: Simple implementation of an input
context that just does direct keysymbol => unicode translation.
* gtk/gtkentry.[ch]: Start switching editing over to using
GtkInputContext. (No handling of preedit yet.)
Wed Apr 5 15:48:41 2000 Owen Taylor <otaylor@redhat.com>
* gtk/gtktypeutils.h (GTK_CHECK_GET_CLASS): Fix problem with one too
many substitutions. (klass should not be subsituted.)
Wed Apr 5 00:18:14 2000 Owen Taylor <otaylor@redhat.com>
* configure.in: Add checks for Pango
* configure.in docs/Makefile.am: Add test for sgml2html
and allow 'make dist' without building html, but print out
warnings in that case. (For making snapshots)
* gdk/Makefile.am gdk/x11/Makefile.am gtk/Makefile.am:
Add Pango libraries and C flags
* gdk/gdkdraw.c gdk/gdkdrawable.h gdkwindow.c gdk/x11/gdkdrawable-x11.c:
Add function (gdk_draw_layout) to draw a pango layout.
* gdk/gdkpango.h gdk/x11/gdkpango-x11.c: New file with functions
for getting Pango contexts for GDK.
* gtk/gtkeditable.c: Get rid of dead code gtk_editable_parent_set()
* gtk/gtkentry.[ch]: Complete rewrite to use Pango, add bidirectional
editing.
* gtk/gtkentry.c: Hack in simple Hebrew input with direct
keysym => unicode translations. More languages can be added
here, but real input-method support is needed.
* docs/Changes-1.4.txt: Added note about entry behavior.
* gtk/gtkenums.h gtk/gtkwidget.[ch] testgtk.c gtkprivate.h: Add functions
to set the reading direction for a widget and the global direction.
Add test which allows toggling the global direction. Two private
flags are used to store the direction. (GTK_DIRECTION_SET + GTK_DIRECTION_LTR)
* gtk/gtkcheckbutton.c gtk/gtkframe.c gtk/gtkhbbox.c gtk/gtkhbox.c
gtk/gtkradiobutton.c gtk/gtkspinbutton.c gtk/gtktable.c
* gtk/gtk[hv]scale.c gtk/gtkscale.[ch]: Draw numbers using Pango
* gtk/gtklabel.[ch]: Moved to Pango and considerably rewritten. Line breaking,
underlining now handled by Pango.
* gtk/gtkstyle.[ch] gtk/gtkrc.[ch]: Add a PangoFontDescription
to RCStyle and Style. (Having both this and the old font name and GdkFont
is temporary.)
* gtk/gtkwidget.[ch] (gtk_widget_create_pango_{context,layout}): Added
convenience functions for creating contexts and layouts for widgets.
* gtk/testgtk.c: Enhance label tests with multilingual labels.
2000-06-02 03:14:07 +00:00
|
|
|
|
|
2002-10-09 22:11:08 +00:00
|
|
|
|
g_object_unref (layout);
|
2005-05-11 19:16:19 +00:00
|
|
|
|
cairo_destroy (cr);
|
1998-09-27 18:32:00 +00:00
|
|
|
|
}
|
|
|
|
|
|
1998-10-01 13:24:42 +00:00
|
|
|
|
static void
|
2005-05-11 19:16:19 +00:00
|
|
|
|
calendar_paint_day_names (GtkCalendar *calendar)
|
1998-09-27 18:32:00 +00:00
|
|
|
|
{
|
2005-05-11 19:16:19 +00:00
|
|
|
|
GtkWidget *widget = GTK_WIDGET (calendar);
|
|
|
|
|
GtkCalendarPrivate *priv = GTK_CALENDAR_GET_PRIVATE (calendar);
|
|
|
|
|
cairo_t *cr;
|
1998-09-27 18:32:00 +00:00
|
|
|
|
char buffer[255];
|
|
|
|
|
int day,i;
|
|
|
|
|
int day_width, cal_width;
|
|
|
|
|
int day_wid_sep;
|
Remove all references to offscreen flag which was no longer used.
Thu Jun 1 23:05:13 2000 Owen Taylor <otaylor@redhat.com>
* gtk/gtkwidget.c: Remove all references to
offscreen flag which was no longer used.
* gtk/gtkprivate.h (enum): Remove unused flags and compress.
* gtk/gtkframe.c (gtk_frame_set_label_widget): Check
for non-null label_widget->parent.
* gtk/gtkentry.c: Get rid of code to deal with PangoAttribute
which no longer was used.
* gdk/gdkpango.c (gdk_pango_context_get_info): make static.
* gdk/gdkpango.c (gdk_draw_layout[_line]): Add checks
for null arguments.
* gdk/x11/gdkgeometry-x11.c (gdk_window_scroll): add
check for destroyed windows.
Thu Jun 1 13:48:45 2000 Owen Taylor <otaylor@redhat.com>
* gtk/gtkimmulticontext.c: Add a finalize method and unref
the slave context there.
* gtk/gtkinvisible.[ch]: Make reference counting behavior
identical to GtkWindow.
Thu Jun 1 01:54:11 2000 Owen Taylor <otaylor@redhat.com>
* Makefile.am gdk/gdkpango.c: Copy the layout render function from
pangox to here, so we can write them independent of rendering
system, using GDK primitives.
* gdk/gdkdrawable.h gdk/gdkdraw.c gdk/gdkwindow.c
gdk/x11/gdkdrawable-x11.c: Remove draw_layout() from the vtable,
since we have a rendering-system independent implementation in
terms of draw_glyphs().
* gdk/gdkpango.c gdkdrawable.h (gdk_draw_layout_line): New
function to render a single line.
* gdk/x11/gdkpango.c: Move the guts of this file mostly
into ../gdkpango.c, which simplifies things, since we
don't have to deal with raw X gc's.
Fri May 19 04:28:16 2000 Owen Taylor <otaylor@redhat.com>
* gtk/gtktextlayout.[ch]: Add get_log_attrs() function to
get the logical attributes for a given GtkTextLine.
Tue May 30 16:05:39 2000 Owen Taylor <otaylor@redhat.com>
* gdk/x11/gdkfont-x11.c (gdk_font_charset_for_locale): Track
g_locale_get_codeset() to g_get_codeset() change.
Tue May 30 15:03:19 2000 Owen Taylor <otaylor@redhat.com>
* gtk/testcalendar.c (calendar_font_selection_ok): Use font
descriptions.
* gtk/gtkentry.c (gtk_entry_draw_text): Center text within
the entry.
* gtk/gtkfontsel.c (gtk_font_selection_dialog_init): Start of
redoing (vastly simplifying) for Pango. Still needs quite
a bit of work. (Size selection is currently poor. List of
predefined sizes is not a good idea, since all of these
sizes won't necessarily be distinct.)
Tue May 30 13:50:19 2000 Owen Taylor <otaylor@redhat.com>
* gdk/x11/gdkfont-x11.c (gdk_font_charset_for_locale): Handle
CODESET results for LANG=C.
Mon May 29 15:49:10 2000 Owen Taylor <otaylor@redhat.com>
* gtk/gtkrc.[ch]: Add a 'font_name' declaration to RC
which takes a stringized pango font description;
ignore the older 'font' and 'fontset' declarations.
* gtk/gtkstyle.c gtk/gtkrc.c: Fill in the style->font
field with a GdkFont derived via gdk_font_from_description(),
for compatibility. (Should we just remove it entirely?
Probably too much compatibility breakage, but people
should be migrating to the new Pango stuff as quickly
as possible.)
Mon May 29 15:47:41 2000 Owen Taylor <otaylor@redhat.com>
* gtk/gtkentry.c gtk/gtkclist.c: s/pango_font_unref/g_object_unref/.
Mon May 29 15:44:46 2000 Owen Taylor <otaylor@redhat.com>
* gtk/gtkcalender.c: Roughly pango-ized. Really needs
redoing; there are some bugs in size allocation right
now, the semi-existant distinction between header / day
fonts was removed, but, with Pango, could actually
be made functional in a nice way.
* gtk/testcalender: Move calender from examples into this
directory as a test program. (We really need to restrcture
testgtk into a whole directory full of tests for every
widget or functionality group, separated into multiple .c
files.)
Mon May 29 15:19:56 2000 Owen Taylor <otaylor@redhat.com>
* gtk/testgtk.c (file_exists): Fix stupid typo that
was keeping RC file from being loaded.
* gtk/testgtkrc gtk/testgtkrc2: Test new pango-ized
RC file font code.
Mon May 29 14:31:27 2000 Owen Taylor <otaylor@redhat.com>
* gdk/gdkfont.h gdk/x11/gdkfont-x11.c (gdk_font_from_description):
Add function to load a GdkFont from a PangoFontDescription.
Fri May 26 17:16:40 2000 Owen Taylor <otaylor@redhat.com>
* gtk/frame.[ch] gtkaspectframe.c: Make frame widgets able
to have any widget for the label, use a GtkLabel widget
to display the text. (Based partially on a patch from
Anders Carlson.)
(Quite a bit of code reorganization - strip 90% of the
guts out of gtkaspectframe and add a single virtual
func to GtkFrameClass - compute_child_allocation.)
Fri May 26 12:00:02 2000 Owen Taylor <otaylor@redhat.com>
* gtk/gtkctree.c gtk/gtkclist.[ch]: Pangoized.
(Removed clist->row_center_offset field because caching
it wasn't saving time or code, added private function
_gtk_clist_create_cell_layout()).
Wed May 24 15:59:37 2000 Owen Taylor <otaylor@redhat.com>
* gtk/gtkaccellabel.c: Pangoized.
* gtk/[hv]ruler.c: Pangoized
Mon May 22 19:23:59 2000 Owen Taylor <otaylor@redhat.com>
* gtk/gtkfilesel.c (gtk_file_selection_init):
Use gtk_clist_set_column_auto_resize() to remove need
need for manual column width computations.
Mon May 22 18:50:26 2000 Owen Taylor <otaylor@redhat.com>
* gtk/gtktooltips.[ch]: Replace custom drawing with a GtkLabel,
ensuring Pango correctness, and considerably simplifying the
code.
* gtk/gtklabel.c gtk[hv]scale.c: 1000 => PANGO_SCALE.
* gtk/gtklabel.c (gtk_label_size_request): Fixed incorrect
getting of numbers of lines.
* gtk/gtklabel.c (gtk_label_size_request): Set the requisition
to the actual requested width of the lable, not to the wrap
width we set.
* gtk/gtktextchild.h: Remove extraneous include of gtk/gtk.h.
* gtk/gtktextbtree.c gtk/gtktextbuffer.c gtk/gtktextlayout.c
gtk/gtktextview.c gtk/gtktextview.[ch]: Fix up includes.
* gtk/gtktextview.c: Fix structure inheritance.
* gtk/gtkprogressbar.c: Pangoize.
Mon May 22 15:47:30 2000 Owen Taylor <otaylor@redhat.com>
* gtk/gtktextview.c (gtk_text_view_get_first_para_iter): Encapsulate
in a function.
* gtk/gtktextlayout.c (find_display_line_above): Fixed
bug with computing line tops.
* gtk/gtktextview.c (changed_handler): Fix < , <= confusion.
Thu May 18 18:53:31 2000 Owen Taylor <otaylor@redhat.com>
* gtk/gtktextdisplay.c (gtk_text_layout_draw): Fix up the x_offset
and y_offset coordinates to do what we need now. (The offset between
buffer and layout coordinates has been reintroduced, but is a
bit different than before.)
* gtk/gtktextview.[ch]: No longer inherit from GtkLayout; instead
handle the adjustments ourselves, and scroll as necessary using
the new gdk_window_scroll().
The advantage of this is that when we are incrementally revalidating,
we are essentially rearranging things around the visible portion
of the screen. With the old setup, the visible portion of the
screen was moved around in the layout, so scrolling and redrawing
to track that caused jumping of the display. Since we now
control the scrolling ourselves, we can suppress this and
only redraw when things actually change.
Thu May 18 18:47:25 2000 Owen Taylor <otaylor@redhat.com>
* gtk/gtktextbtree.c (redisplay_mark): We need to invalidate
the region not just redisplay it after-all, since we store the
cursors in the LineDisplay. (Ugly interactions here between
GtkLayout and GtkTextBTree here.)
* gtk/gtktextbtree.c (redisplay_region): Fixed reversed comparison.
Thu May 18 18:43:21 2000 Owen Taylor <otaylor@redhat.com>
* gdk/gdkwindow.h gdk/x11/gdkgeometry-x11.c (gdk_window_scroll):
Added function to scroll contents of a window while keeping the
window constant. Works by XCopyArea or guffaw-scrolling depending
on the details of how the window is set up. (guffaw-scrolling
still needs to be filled in.)
Wed May 17 22:36:53 2000 Owen Taylor <otaylor@redhat.com>
* gtk/gtktextiter.c gtk/gtkmain.c: Add a debug key for the text widget,
move the debugging that was tied to a global variable
to that.
* gtk/gtkmarshal.list: Add NONE:INT,INT,INT
* gtk/gtktextbtree.[ch] gtk/gtktextlayout.c: Keep a separate
validated flag, in line data instead of setting height/width to
-1. This allows us to perform operations with partially invalid
buffer (using the old size for invalid lines) and thus to do
incremental vaidation. Keep height/width aggregates up to date
when deleting text and rebalancing the tree.
* gtk/gtktextbtree.[ch]: Add functions validate a line
(gtk_text_btree_validate_line), and to validate up
to a number of pixels (gtk_text_btree_validate).
* gtk/gtktextlayout.[ch]: Add an ::invalidated signal
that indicates that something is changed and a revalidation
pass is needed. Change ::need_repaint to ::changed, and
make it take old and new yranges instead of a rectangle.
* gtk/gtktextbtree.[ch] gtk/gtktextlayout.[ch]: Move
the line_data_destroy() function from
gtk_text_btree_add_view() to a virtual function in
GtkTextLayout
* gtk/gtktextbtree.[ch]: Remove gtk_text_btree_get_damage_range(),
since we are handling partial repaints in a different fashion
now.
* gtk/gtktextbtree.[ch]: Only repaint the changed portion
of the selection instead of queueing a repaint on the
entire widget.
* gtk/gtktextbuffer.[ch] gtk/gtktextbtree.[ch]: Move
get_selection_bounds() down to btree, make the function
in buffer a wrapper around the btree function.
* gtk/gtktextlayout.[ch]: Add functions to check if the
layout is valid and to recompute either a range of pixels
aroudn a line or a certain total number of pixels.
* gtk/gtktextlayout.[ch]: Cache a single line display;
now that we only redraw the needed portions, the hit rate
for this cache is quite high.
* gtk/gtktextview.[ch]: Keep track of the first paragraph
on the screen so that when re-laying-out the buffer, we can
keep the same place. This requires connecting to ::value_changed
on the adjustments
* gtk/gtktextview.[ch]: Add idle functions to revalidate
the buffer after we receive an ::invalidated signal.
Wed May 17 22:10:47 2000 Owen Taylor <otaylor@redhat.com>
* gtk/gtklayout.c (gtk_layout_size_allocate): Set upper
to max of allocation and layout size, not just to the
layout size.
* gtk/gtk[hv]scrollbar.c (gtk_[hv]scrollbar_calc_slider_size):
Invalidate window so it gets redrawn properly.
* gdk/gdkwindow.c (gdk_window_invalidate_rect): Allow rect == NULL
to mean the entire window.
* gdk/gdkevents.h: Move definition for GDK_PRIORITY_REDRAW
into public header.
Mon May 15 14:51:31 2000 Owen Taylor <otaylor@redhat.com>
* gtk/gtktextmark.c (gtk_text_mark_get_name): Add function
to get the name of a mark.
* gtk/gtktextlayout.c (gtk_text_layout_get_line_at_y): Add a function
to find the paragraph from a y position.
Thu May 11 12:57:20 2000 Owen Taylor <otaylor@redhat.com>
* gtk/gtktextbtree.c (gtk_text_btree_node_invalidate_upward): Valid
nodes have width/height >= 0, not > 0.
Tue May 9 21:29:06 2000 Owen Taylor <otaylor@redhat.com>
* gtk/gtktextlayout.[ch] gtk/gtktextdisplay.c (gtk_text_layout_get_line_display):
Add a size_only flag, so when we only need the size, we don't create
useless appearance attributes.
* gtk/gtktextview.c (gtk_text_view_ensure_layout): Remove
duplicate setting of font description.
* gtk/gtkscale.c: Use PANGO_SCALE instead of 1000
Wed Apr 26 01:53:23 2000 Owen Taylor <otaylor@redhat.com>
* gtk/Makefile.am (EXTRA_DIST): Add OLD_STAMP into
EXTRA_DIST. It does not work well when the file that
everything depends on is not in the tarball.
Wed Apr 26 00:56:14 2000 Owen Taylor <otaylor@redhat.com>
* gtk/testgtk.c: Some hacks and fixes so that it basically
works when not sitting in the GTK+ build tree.
2000-05-03 Havoc Pennington <hp@redhat.com>
* gtk/gtktextbtree.c (gtk_text_line_next_could_contain_tag):
Properly determine the ordering of the tag root and the current
line within the tree. Previous algorithm only worked if the tag
root's immediate parent was the common root of both the current
line and the tag root.
Wed Apr 26 00:43:00 2000 Owen Taylor <otaylor@redhat.com>
* gtk/gtktextlayout.c (set_para_values): Fix some bugs in
alignment.
* gtk/gtktextview.c (gtk_text_view_ensure_layout): Track
the widget text directional dynamically.
* gtk/gtktextview.[ch]: Added functions to get and set default
wrap mode.
Tue Apr 25 23:47:38 2000 Owen Taylor <otaylor@redhat.com>
* gtk/gtktextlayout.c (gtk_text_layout_get_iter_location): Fix bug
in cursor location computation.
Tue Apr 25 23:22:59 2000 Owen Taylor <otaylor@redhat.com>
* gtk/gtklayout.c (gtk_layout_set_size): Clamp hadjustment/
vadjusment values properly when layout gets smaller.
* gtk/gtktextview.c (need_repaint_handler): Areas being
passed in are far completely inaccurate, and sometimes
too small, so, for now, just queue a redraw on the
whole visible region.
2000-04-25 Havoc Pennington <hp@redhat.com>
* gtk/gtktextbtree.c (summary_destroy): new function to
destroy tag summary nodes
(gtk_text_line_next_could_contain_tag): this function was
totally broken if the line passed in wasn't below the tag
root. Fix it.
(gtk_text_btree_first_could_contain_tag): In the tag == NULL
"wildcard" case, we have to do a linear scan. Blah.
(gtk_text_btree_last_could_contain_tag): In tag == NULL case,
we have to do the linear scan
(tag_removed_cb): When a tag is removed from the tag table,
remove the GtkTextTagInfo node from the btree.
(gtk_text_btree_spew): Implement the spew function, for
our debugging pleasure.
Tue Apr 25 19:40:18 2000 Owen Taylor <otaylor@redhat.com>
* gtk/gtktextlayout.c (gtk_text_layout_set_buffer): Fix
a problem with referring to the wrong buffer.
* gtk/gtkentry.c: Fix focus-in/focus-out confusion.
* gtk/gtkrc.c gtk/gtkstyle.c: Moving setting default
font description to gtk_style_new() - otherwise things
don't work without a .gtkrc file.
* gtk/gtktextbuffer.c (gtk_text_buffer_new): Sink the
tags table if we create it ourself, too.
* gdk/gdktypes.h (enum): Move GDK_RELEASE_MASK, since
it was conflicting with XKB modifiers.
* gtk/gtktextview.[ch]: Add simple support for
GtkIMContext.
Mon Apr 24 19:34:18 2000 Owen Taylor <otaylor@redhat.com>
* gtk/gtkentry.c (gtk_entry_move_cursor_visually): Fix problem
with deletion from last commit.
Mon Apr 24 19:29:40 2000 Owen Taylor <otaylor@redhat.com>
* gtk/gtkwidget.c (gtk_widget_create_pango_context): Set the language
in the context from the current locale.
* gtk/gtkentry.c (gtk_entry_size_request): Use language from the
context, not hardcoded value.
* gtk/gtkentry.c (gtk_entry_move_cursor): Make character movement visual,
not logical.
Sun Apr 23 23:39:18 2000 Owen Taylor <otaylor@redhat.com>
* gtk/gtkentry.c gtk/gtktextdisplay.c: Don't handle selections as
attributes - that doesn't handle partial-glyph selection
properly. Instead use new pango_layout_line_get_x_ranges()
functionality to draw the selection.
* gtk/gtkentry.c: Simplify code since pango_layout_line_index_to_x()
now properly handles out-of-range coordinates.
* gtk/gtktextbuffer.c: Emit "mark_set" when the cursor is moved.
* gtk/gtktextiter.h gtk/gtktextiterprivate.h: Make gtk_text_iter_get_line_byte()
public.
* gtk/gtktextlayout.[ch]: Properly set the direction in the PangoContext
for paragraphs opposite to the base direction of the widget.
* gtk/gtktextlayout.[ch] gtk/gtktextdisplay.c: Fixes for alignment.
* gtk/gtktextlayout.c: Don't split segments on marks, since that
causes Arabic words to reshape as you cursor through.
* gtk/gtktextlayout.[ch] gtk/gtktextview.[ch]: Implement virtual
cursor position when moving vertically with the arrow keys and
scrolling with page-up/page-down. (Arrow keys save only the X,
scrolling saves both X and Y.)
This means you can line-up / line-down or page-up / page-down
without losing your place, and also that moving vertically
with the cursor keys keeps the same X position, not the same
character count:
* gtk/gtktextlayout.[ch] gtk/gtktextview.[ch]: Make vertical
arrow keys move by display lines, not paragraphs.
Tue Apr 18 14:16:50 2000 Owen Taylor <otaylor@redhat.com>
* gtk/gtklayout.c: Make sure that the bin window is at least
as big as the allocation. (Should we also make sure that the
bin window is big enough to completely cover widget->window?)
* gtk/gtktextview.c (gtk_text_view_get_visible_rect): Add
function to get the onscreen rectangle.
* gdk/x11/gdkwindow-x11.c (gdk_window_get_pointer): Correctly account
for offsets in window coordinates.
Sun Apr 16 16:13:27 2000 Owen Taylor <otaylor@redhat.com>
* gtk/gtkentry.c (gtk_entry_get_cursor_locations): Fix index/offset
confusion.
* gtk/gtktextview.c (gtk_text_view_ensure_layout): Set the default direction
from the widget direction.
* gtk/gtktexttag.c gtk/gtktexttagprivate.h (gtk_text_tag_set_arg):
Add a "direction" attribute.
* gtk/gtktextview.c: global s/tkxt/text_view/.
* gtk/testtext.c: Added long block of text in Arabic, to test out
the direction attributes. (Some problems with the shaping system
for arabic become obvious - like the fact the cursor splits words
into unjoined pieces.)
Fri Apr 14 12:54:34 2000 Owen Taylor <otaylor@redhat.com>
* gtk/gtktextdisplay.c (render_layout): Add overstrike handling.
* gtk/gtktextlayout.c: Fix up alignment.
* gtk/testtext.c: Add some tests for centering, wrapping.
Fri Apr 14 09:26:22 2000 Owen Taylor <otaylor@redhat.com>
* gdk/gdkdrawable.h gdk/gdkdraw.c gdk/gdkwindow.c gdk/x11/gdkdrawable-x11.c:
Add a draw_glyphs() operation to the drawable vtable and gdk_draw_glyphs().
If we wrote GTK+-specific layout-render function this could just replace
the draw_layout() operation in the vtable.
* gtk/gtkentry.c: Move guts of gtk_entry_get_cursor_locations to
pango_layout_get_cursor_pos() and use that function.
* gtk/gtktextchild.[ch]: add gtk_ onto pixmap_segment_new(), since it
is a non-static symbol.
* gtk/gtktextbtree.[ch]: Replace gtk_text_btree_find_line_data_by_y()
with gtk_text_btree_find_line_by_y()
* gtk/gtktextdisplay.c: Rewrote for Pango - uses a custom layout
renderer that handles GtkTextAppearance attributes.
* gtk/gtktexttag.[ch] gtk/gtktexttagprivate.h:
- Move the values in the style that don't affect geometry into a
GtkTextAppearance structure.
- Change underline to take a PangoUnderline and "font" a string
representation of a font description
- Add a "font_desc" attribute which takes a FontDescription structure.
* gtk/gtktextlayout.[ch]:
- Get rid of the display-line list per each line. Instead, we
generate, on demand, a GtkTextLineDisplay structure which]
contains a PangoLayout * and other necesary information
(offsets, cursor locations) for displaying a paragraph.
- Get rid of the code to wrap lines, create display chunks,
etc. Instead, we just go through a paragraph and convert
it into the necessary inputs to a PangoLayout.
- Implement a new attribute type, GtkTextAttrAppearance. This
holds a GtkTextAppearance, and is used to pass colors,
stipple, etc, through from the layout to the display without
having to use lots and lots of individual attributes.
- Reimplement gtk_layout_get_iter_at_pixel() gtk_layout_get_iter_pos()
in terms of PangoLayout functions.
* gtk/gtktextview.c:
- Handle passing the necessary PangoContext to the layout
- Some fixups in painting to deal with the automatic backing store
and offsetting of GTK+-1.4
- Add a style_set handler so that the default style reacts
properly to theme changes.
* gtk/gtktext?*.[ch]: Random code-style fixes.
* gtk/testtext.c: Substitute in languages that Pango handles now for Thai
Mon Apr 10 10:33:45 2000 Owen Taylor <otaylor@redhat.com>
* gtk/gtktext?*.[ch]: Check in Havoc's port of the Tk text widget,
in original form preparatory to Pango-ization and gdkimcontext-ization.
Thu Apr 6 19:25:39 2000 Owen Taylor <otaylor@redhat.com>
* gtk/gtkimcontext.c: Move default implementations to real_* vfuncs,
so that we can derive from gtkimcontext in language bindings properly.
Thu Apr 6 16:02:52 2000 Owen Taylor <otaylor@redhat.com>
* gtk/gtkimcontextsimple.[ch]: Use gdk_keyval_to_unicode to gdk_unicode_to_keyval.
Add a compose table including (almost) all the compose combinations
from X. This is 6k of static, shared data as opposed to 50k or so of dynamic
data in the XIM implementation.
* gdk/gdk.h gdk/gdkkeyuni.c gdk/win32/gdkevents-win32.c (gdk_keyval_to_unicode, gdk_unicode_to_keyval):
Moved functions to convert keyvalues from and to unicode here from
the win32 port and made them public.
Wed Apr 5 16:37:29 2000 Owen Taylor <otaylor@redhat.com>
* gtk/gtkeditable.c (gtk_editable_insert_text): Allow new_text_length == -1.
Wed Apr 5 16:27:45 2000 Owen Taylor <otaylor@redhat.com>
* gtk/gtkimcontext.[ch]: Base class for new input context system
* gtk/gtkimmulticontext.[ch]: Proxy input context that allows
the real input context implementation to be loaded from modules
and switched on the fly.
* gtk/gtkcontextsimple.[ch]: Simple implementation of an input
context that just does direct keysymbol => unicode translation.
* gtk/gtkentry.[ch]: Start switching editing over to using
GtkInputContext. (No handling of preedit yet.)
Wed Apr 5 15:48:41 2000 Owen Taylor <otaylor@redhat.com>
* gtk/gtktypeutils.h (GTK_CHECK_GET_CLASS): Fix problem with one too
many substitutions. (klass should not be subsituted.)
Wed Apr 5 00:18:14 2000 Owen Taylor <otaylor@redhat.com>
* configure.in: Add checks for Pango
* configure.in docs/Makefile.am: Add test for sgml2html
and allow 'make dist' without building html, but print out
warnings in that case. (For making snapshots)
* gdk/Makefile.am gdk/x11/Makefile.am gtk/Makefile.am:
Add Pango libraries and C flags
* gdk/gdkdraw.c gdk/gdkdrawable.h gdkwindow.c gdk/x11/gdkdrawable-x11.c:
Add function (gdk_draw_layout) to draw a pango layout.
* gdk/gdkpango.h gdk/x11/gdkpango-x11.c: New file with functions
for getting Pango contexts for GDK.
* gtk/gtkeditable.c: Get rid of dead code gtk_editable_parent_set()
* gtk/gtkentry.[ch]: Complete rewrite to use Pango, add bidirectional
editing.
* gtk/gtkentry.c: Hack in simple Hebrew input with direct
keysym => unicode translations. More languages can be added
here, but real input-method support is needed.
* docs/Changes-1.4.txt: Added note about entry behavior.
* gtk/gtkenums.h gtk/gtkwidget.[ch] testgtk.c gtkprivate.h: Add functions
to set the reading direction for a widget and the global direction.
Add test which allows toggling the global direction. Two private
flags are used to store the direction. (GTK_DIRECTION_SET + GTK_DIRECTION_LTR)
* gtk/gtkcheckbutton.c gtk/gtkframe.c gtk/gtkhbbox.c gtk/gtkhbox.c
gtk/gtkradiobutton.c gtk/gtkspinbutton.c gtk/gtktable.c
* gtk/gtk[hv]scale.c gtk/gtkscale.[ch]: Draw numbers using Pango
* gtk/gtklabel.[ch]: Moved to Pango and considerably rewritten. Line breaking,
underlining now handled by Pango.
* gtk/gtkstyle.[ch] gtk/gtkrc.[ch]: Add a PangoFontDescription
to RCStyle and Style. (Having both this and the old font name and GdkFont
is temporary.)
* gtk/gtkwidget.[ch] (gtk_widget_create_pango_{context,layout}): Added
convenience functions for creating contexts and layouts for widgets.
* gtk/testgtk.c: Enhance label tests with multilingual labels.
2000-06-02 03:14:07 +00:00
|
|
|
|
PangoLayout *layout;
|
|
|
|
|
PangoRectangle logical_rect;
|
2002-02-14 05:05:45 +00:00
|
|
|
|
gint focus_padding;
|
|
|
|
|
gint focus_width;
|
|
|
|
|
|
2005-05-11 19:16:19 +00:00
|
|
|
|
cr = gdk_cairo_create (priv->day_name_win);
|
1998-10-01 13:24:42 +00:00
|
|
|
|
|
2002-02-14 05:05:45 +00:00
|
|
|
|
gtk_widget_style_get (GTK_WIDGET (widget),
|
|
|
|
|
"focus-line-width", &focus_width,
|
|
|
|
|
"focus-padding", &focus_padding,
|
|
|
|
|
NULL);
|
1998-10-01 13:24:42 +00:00
|
|
|
|
|
2005-05-11 19:16:19 +00:00
|
|
|
|
day_width = priv->day_width;
|
1998-09-27 18:32:00 +00:00
|
|
|
|
cal_width = widget->allocation.width;
|
|
|
|
|
day_wid_sep = day_width + DAY_XSEP;
|
1998-10-01 13:24:42 +00:00
|
|
|
|
|
1998-09-27 18:32:00 +00:00
|
|
|
|
/*
|
|
|
|
|
* Draw rectangles as inverted background for the labels.
|
|
|
|
|
*/
|
2005-05-11 19:16:19 +00:00
|
|
|
|
|
|
|
|
|
gdk_cairo_set_source_color (cr, SELECTED_BG_COLOR (widget));
|
|
|
|
|
cairo_rectangle (cr,
|
|
|
|
|
CALENDAR_MARGIN, CALENDAR_MARGIN,
|
|
|
|
|
cal_width-CALENDAR_MARGIN * 2,
|
|
|
|
|
priv->day_name_h - CALENDAR_MARGIN);
|
|
|
|
|
cairo_fill (cr);
|
1998-10-01 13:24:42 +00:00
|
|
|
|
|
1998-09-27 18:32:00 +00:00
|
|
|
|
if (calendar->display_flags & GTK_CALENDAR_SHOW_WEEK_NUMBERS)
|
2005-05-11 19:16:19 +00:00
|
|
|
|
{
|
|
|
|
|
cairo_rectangle (cr,
|
|
|
|
|
CALENDAR_MARGIN,
|
|
|
|
|
priv->day_name_h - CALENDAR_YSEP,
|
|
|
|
|
priv->week_width - CALENDAR_YSEP - CALENDAR_MARGIN,
|
|
|
|
|
CALENDAR_YSEP);
|
|
|
|
|
cairo_fill (cr);
|
|
|
|
|
}
|
1998-10-01 13:24:42 +00:00
|
|
|
|
|
1998-09-27 18:32:00 +00:00
|
|
|
|
/*
|
|
|
|
|
* Write the labels
|
|
|
|
|
*/
|
Remove all references to offscreen flag which was no longer used.
Thu Jun 1 23:05:13 2000 Owen Taylor <otaylor@redhat.com>
* gtk/gtkwidget.c: Remove all references to
offscreen flag which was no longer used.
* gtk/gtkprivate.h (enum): Remove unused flags and compress.
* gtk/gtkframe.c (gtk_frame_set_label_widget): Check
for non-null label_widget->parent.
* gtk/gtkentry.c: Get rid of code to deal with PangoAttribute
which no longer was used.
* gdk/gdkpango.c (gdk_pango_context_get_info): make static.
* gdk/gdkpango.c (gdk_draw_layout[_line]): Add checks
for null arguments.
* gdk/x11/gdkgeometry-x11.c (gdk_window_scroll): add
check for destroyed windows.
Thu Jun 1 13:48:45 2000 Owen Taylor <otaylor@redhat.com>
* gtk/gtkimmulticontext.c: Add a finalize method and unref
the slave context there.
* gtk/gtkinvisible.[ch]: Make reference counting behavior
identical to GtkWindow.
Thu Jun 1 01:54:11 2000 Owen Taylor <otaylor@redhat.com>
* Makefile.am gdk/gdkpango.c: Copy the layout render function from
pangox to here, so we can write them independent of rendering
system, using GDK primitives.
* gdk/gdkdrawable.h gdk/gdkdraw.c gdk/gdkwindow.c
gdk/x11/gdkdrawable-x11.c: Remove draw_layout() from the vtable,
since we have a rendering-system independent implementation in
terms of draw_glyphs().
* gdk/gdkpango.c gdkdrawable.h (gdk_draw_layout_line): New
function to render a single line.
* gdk/x11/gdkpango.c: Move the guts of this file mostly
into ../gdkpango.c, which simplifies things, since we
don't have to deal with raw X gc's.
Fri May 19 04:28:16 2000 Owen Taylor <otaylor@redhat.com>
* gtk/gtktextlayout.[ch]: Add get_log_attrs() function to
get the logical attributes for a given GtkTextLine.
Tue May 30 16:05:39 2000 Owen Taylor <otaylor@redhat.com>
* gdk/x11/gdkfont-x11.c (gdk_font_charset_for_locale): Track
g_locale_get_codeset() to g_get_codeset() change.
Tue May 30 15:03:19 2000 Owen Taylor <otaylor@redhat.com>
* gtk/testcalendar.c (calendar_font_selection_ok): Use font
descriptions.
* gtk/gtkentry.c (gtk_entry_draw_text): Center text within
the entry.
* gtk/gtkfontsel.c (gtk_font_selection_dialog_init): Start of
redoing (vastly simplifying) for Pango. Still needs quite
a bit of work. (Size selection is currently poor. List of
predefined sizes is not a good idea, since all of these
sizes won't necessarily be distinct.)
Tue May 30 13:50:19 2000 Owen Taylor <otaylor@redhat.com>
* gdk/x11/gdkfont-x11.c (gdk_font_charset_for_locale): Handle
CODESET results for LANG=C.
Mon May 29 15:49:10 2000 Owen Taylor <otaylor@redhat.com>
* gtk/gtkrc.[ch]: Add a 'font_name' declaration to RC
which takes a stringized pango font description;
ignore the older 'font' and 'fontset' declarations.
* gtk/gtkstyle.c gtk/gtkrc.c: Fill in the style->font
field with a GdkFont derived via gdk_font_from_description(),
for compatibility. (Should we just remove it entirely?
Probably too much compatibility breakage, but people
should be migrating to the new Pango stuff as quickly
as possible.)
Mon May 29 15:47:41 2000 Owen Taylor <otaylor@redhat.com>
* gtk/gtkentry.c gtk/gtkclist.c: s/pango_font_unref/g_object_unref/.
Mon May 29 15:44:46 2000 Owen Taylor <otaylor@redhat.com>
* gtk/gtkcalender.c: Roughly pango-ized. Really needs
redoing; there are some bugs in size allocation right
now, the semi-existant distinction between header / day
fonts was removed, but, with Pango, could actually
be made functional in a nice way.
* gtk/testcalender: Move calender from examples into this
directory as a test program. (We really need to restrcture
testgtk into a whole directory full of tests for every
widget or functionality group, separated into multiple .c
files.)
Mon May 29 15:19:56 2000 Owen Taylor <otaylor@redhat.com>
* gtk/testgtk.c (file_exists): Fix stupid typo that
was keeping RC file from being loaded.
* gtk/testgtkrc gtk/testgtkrc2: Test new pango-ized
RC file font code.
Mon May 29 14:31:27 2000 Owen Taylor <otaylor@redhat.com>
* gdk/gdkfont.h gdk/x11/gdkfont-x11.c (gdk_font_from_description):
Add function to load a GdkFont from a PangoFontDescription.
Fri May 26 17:16:40 2000 Owen Taylor <otaylor@redhat.com>
* gtk/frame.[ch] gtkaspectframe.c: Make frame widgets able
to have any widget for the label, use a GtkLabel widget
to display the text. (Based partially on a patch from
Anders Carlson.)
(Quite a bit of code reorganization - strip 90% of the
guts out of gtkaspectframe and add a single virtual
func to GtkFrameClass - compute_child_allocation.)
Fri May 26 12:00:02 2000 Owen Taylor <otaylor@redhat.com>
* gtk/gtkctree.c gtk/gtkclist.[ch]: Pangoized.
(Removed clist->row_center_offset field because caching
it wasn't saving time or code, added private function
_gtk_clist_create_cell_layout()).
Wed May 24 15:59:37 2000 Owen Taylor <otaylor@redhat.com>
* gtk/gtkaccellabel.c: Pangoized.
* gtk/[hv]ruler.c: Pangoized
Mon May 22 19:23:59 2000 Owen Taylor <otaylor@redhat.com>
* gtk/gtkfilesel.c (gtk_file_selection_init):
Use gtk_clist_set_column_auto_resize() to remove need
need for manual column width computations.
Mon May 22 18:50:26 2000 Owen Taylor <otaylor@redhat.com>
* gtk/gtktooltips.[ch]: Replace custom drawing with a GtkLabel,
ensuring Pango correctness, and considerably simplifying the
code.
* gtk/gtklabel.c gtk[hv]scale.c: 1000 => PANGO_SCALE.
* gtk/gtklabel.c (gtk_label_size_request): Fixed incorrect
getting of numbers of lines.
* gtk/gtklabel.c (gtk_label_size_request): Set the requisition
to the actual requested width of the lable, not to the wrap
width we set.
* gtk/gtktextchild.h: Remove extraneous include of gtk/gtk.h.
* gtk/gtktextbtree.c gtk/gtktextbuffer.c gtk/gtktextlayout.c
gtk/gtktextview.c gtk/gtktextview.[ch]: Fix up includes.
* gtk/gtktextview.c: Fix structure inheritance.
* gtk/gtkprogressbar.c: Pangoize.
Mon May 22 15:47:30 2000 Owen Taylor <otaylor@redhat.com>
* gtk/gtktextview.c (gtk_text_view_get_first_para_iter): Encapsulate
in a function.
* gtk/gtktextlayout.c (find_display_line_above): Fixed
bug with computing line tops.
* gtk/gtktextview.c (changed_handler): Fix < , <= confusion.
Thu May 18 18:53:31 2000 Owen Taylor <otaylor@redhat.com>
* gtk/gtktextdisplay.c (gtk_text_layout_draw): Fix up the x_offset
and y_offset coordinates to do what we need now. (The offset between
buffer and layout coordinates has been reintroduced, but is a
bit different than before.)
* gtk/gtktextview.[ch]: No longer inherit from GtkLayout; instead
handle the adjustments ourselves, and scroll as necessary using
the new gdk_window_scroll().
The advantage of this is that when we are incrementally revalidating,
we are essentially rearranging things around the visible portion
of the screen. With the old setup, the visible portion of the
screen was moved around in the layout, so scrolling and redrawing
to track that caused jumping of the display. Since we now
control the scrolling ourselves, we can suppress this and
only redraw when things actually change.
Thu May 18 18:47:25 2000 Owen Taylor <otaylor@redhat.com>
* gtk/gtktextbtree.c (redisplay_mark): We need to invalidate
the region not just redisplay it after-all, since we store the
cursors in the LineDisplay. (Ugly interactions here between
GtkLayout and GtkTextBTree here.)
* gtk/gtktextbtree.c (redisplay_region): Fixed reversed comparison.
Thu May 18 18:43:21 2000 Owen Taylor <otaylor@redhat.com>
* gdk/gdkwindow.h gdk/x11/gdkgeometry-x11.c (gdk_window_scroll):
Added function to scroll contents of a window while keeping the
window constant. Works by XCopyArea or guffaw-scrolling depending
on the details of how the window is set up. (guffaw-scrolling
still needs to be filled in.)
Wed May 17 22:36:53 2000 Owen Taylor <otaylor@redhat.com>
* gtk/gtktextiter.c gtk/gtkmain.c: Add a debug key for the text widget,
move the debugging that was tied to a global variable
to that.
* gtk/gtkmarshal.list: Add NONE:INT,INT,INT
* gtk/gtktextbtree.[ch] gtk/gtktextlayout.c: Keep a separate
validated flag, in line data instead of setting height/width to
-1. This allows us to perform operations with partially invalid
buffer (using the old size for invalid lines) and thus to do
incremental vaidation. Keep height/width aggregates up to date
when deleting text and rebalancing the tree.
* gtk/gtktextbtree.[ch]: Add functions validate a line
(gtk_text_btree_validate_line), and to validate up
to a number of pixels (gtk_text_btree_validate).
* gtk/gtktextlayout.[ch]: Add an ::invalidated signal
that indicates that something is changed and a revalidation
pass is needed. Change ::need_repaint to ::changed, and
make it take old and new yranges instead of a rectangle.
* gtk/gtktextbtree.[ch] gtk/gtktextlayout.[ch]: Move
the line_data_destroy() function from
gtk_text_btree_add_view() to a virtual function in
GtkTextLayout
* gtk/gtktextbtree.[ch]: Remove gtk_text_btree_get_damage_range(),
since we are handling partial repaints in a different fashion
now.
* gtk/gtktextbtree.[ch]: Only repaint the changed portion
of the selection instead of queueing a repaint on the
entire widget.
* gtk/gtktextbuffer.[ch] gtk/gtktextbtree.[ch]: Move
get_selection_bounds() down to btree, make the function
in buffer a wrapper around the btree function.
* gtk/gtktextlayout.[ch]: Add functions to check if the
layout is valid and to recompute either a range of pixels
aroudn a line or a certain total number of pixels.
* gtk/gtktextlayout.[ch]: Cache a single line display;
now that we only redraw the needed portions, the hit rate
for this cache is quite high.
* gtk/gtktextview.[ch]: Keep track of the first paragraph
on the screen so that when re-laying-out the buffer, we can
keep the same place. This requires connecting to ::value_changed
on the adjustments
* gtk/gtktextview.[ch]: Add idle functions to revalidate
the buffer after we receive an ::invalidated signal.
Wed May 17 22:10:47 2000 Owen Taylor <otaylor@redhat.com>
* gtk/gtklayout.c (gtk_layout_size_allocate): Set upper
to max of allocation and layout size, not just to the
layout size.
* gtk/gtk[hv]scrollbar.c (gtk_[hv]scrollbar_calc_slider_size):
Invalidate window so it gets redrawn properly.
* gdk/gdkwindow.c (gdk_window_invalidate_rect): Allow rect == NULL
to mean the entire window.
* gdk/gdkevents.h: Move definition for GDK_PRIORITY_REDRAW
into public header.
Mon May 15 14:51:31 2000 Owen Taylor <otaylor@redhat.com>
* gtk/gtktextmark.c (gtk_text_mark_get_name): Add function
to get the name of a mark.
* gtk/gtktextlayout.c (gtk_text_layout_get_line_at_y): Add a function
to find the paragraph from a y position.
Thu May 11 12:57:20 2000 Owen Taylor <otaylor@redhat.com>
* gtk/gtktextbtree.c (gtk_text_btree_node_invalidate_upward): Valid
nodes have width/height >= 0, not > 0.
Tue May 9 21:29:06 2000 Owen Taylor <otaylor@redhat.com>
* gtk/gtktextlayout.[ch] gtk/gtktextdisplay.c (gtk_text_layout_get_line_display):
Add a size_only flag, so when we only need the size, we don't create
useless appearance attributes.
* gtk/gtktextview.c (gtk_text_view_ensure_layout): Remove
duplicate setting of font description.
* gtk/gtkscale.c: Use PANGO_SCALE instead of 1000
Wed Apr 26 01:53:23 2000 Owen Taylor <otaylor@redhat.com>
* gtk/Makefile.am (EXTRA_DIST): Add OLD_STAMP into
EXTRA_DIST. It does not work well when the file that
everything depends on is not in the tarball.
Wed Apr 26 00:56:14 2000 Owen Taylor <otaylor@redhat.com>
* gtk/testgtk.c: Some hacks and fixes so that it basically
works when not sitting in the GTK+ build tree.
2000-05-03 Havoc Pennington <hp@redhat.com>
* gtk/gtktextbtree.c (gtk_text_line_next_could_contain_tag):
Properly determine the ordering of the tag root and the current
line within the tree. Previous algorithm only worked if the tag
root's immediate parent was the common root of both the current
line and the tag root.
Wed Apr 26 00:43:00 2000 Owen Taylor <otaylor@redhat.com>
* gtk/gtktextlayout.c (set_para_values): Fix some bugs in
alignment.
* gtk/gtktextview.c (gtk_text_view_ensure_layout): Track
the widget text directional dynamically.
* gtk/gtktextview.[ch]: Added functions to get and set default
wrap mode.
Tue Apr 25 23:47:38 2000 Owen Taylor <otaylor@redhat.com>
* gtk/gtktextlayout.c (gtk_text_layout_get_iter_location): Fix bug
in cursor location computation.
Tue Apr 25 23:22:59 2000 Owen Taylor <otaylor@redhat.com>
* gtk/gtklayout.c (gtk_layout_set_size): Clamp hadjustment/
vadjusment values properly when layout gets smaller.
* gtk/gtktextview.c (need_repaint_handler): Areas being
passed in are far completely inaccurate, and sometimes
too small, so, for now, just queue a redraw on the
whole visible region.
2000-04-25 Havoc Pennington <hp@redhat.com>
* gtk/gtktextbtree.c (summary_destroy): new function to
destroy tag summary nodes
(gtk_text_line_next_could_contain_tag): this function was
totally broken if the line passed in wasn't below the tag
root. Fix it.
(gtk_text_btree_first_could_contain_tag): In the tag == NULL
"wildcard" case, we have to do a linear scan. Blah.
(gtk_text_btree_last_could_contain_tag): In tag == NULL case,
we have to do the linear scan
(tag_removed_cb): When a tag is removed from the tag table,
remove the GtkTextTagInfo node from the btree.
(gtk_text_btree_spew): Implement the spew function, for
our debugging pleasure.
Tue Apr 25 19:40:18 2000 Owen Taylor <otaylor@redhat.com>
* gtk/gtktextlayout.c (gtk_text_layout_set_buffer): Fix
a problem with referring to the wrong buffer.
* gtk/gtkentry.c: Fix focus-in/focus-out confusion.
* gtk/gtkrc.c gtk/gtkstyle.c: Moving setting default
font description to gtk_style_new() - otherwise things
don't work without a .gtkrc file.
* gtk/gtktextbuffer.c (gtk_text_buffer_new): Sink the
tags table if we create it ourself, too.
* gdk/gdktypes.h (enum): Move GDK_RELEASE_MASK, since
it was conflicting with XKB modifiers.
* gtk/gtktextview.[ch]: Add simple support for
GtkIMContext.
Mon Apr 24 19:34:18 2000 Owen Taylor <otaylor@redhat.com>
* gtk/gtkentry.c (gtk_entry_move_cursor_visually): Fix problem
with deletion from last commit.
Mon Apr 24 19:29:40 2000 Owen Taylor <otaylor@redhat.com>
* gtk/gtkwidget.c (gtk_widget_create_pango_context): Set the language
in the context from the current locale.
* gtk/gtkentry.c (gtk_entry_size_request): Use language from the
context, not hardcoded value.
* gtk/gtkentry.c (gtk_entry_move_cursor): Make character movement visual,
not logical.
Sun Apr 23 23:39:18 2000 Owen Taylor <otaylor@redhat.com>
* gtk/gtkentry.c gtk/gtktextdisplay.c: Don't handle selections as
attributes - that doesn't handle partial-glyph selection
properly. Instead use new pango_layout_line_get_x_ranges()
functionality to draw the selection.
* gtk/gtkentry.c: Simplify code since pango_layout_line_index_to_x()
now properly handles out-of-range coordinates.
* gtk/gtktextbuffer.c: Emit "mark_set" when the cursor is moved.
* gtk/gtktextiter.h gtk/gtktextiterprivate.h: Make gtk_text_iter_get_line_byte()
public.
* gtk/gtktextlayout.[ch]: Properly set the direction in the PangoContext
for paragraphs opposite to the base direction of the widget.
* gtk/gtktextlayout.[ch] gtk/gtktextdisplay.c: Fixes for alignment.
* gtk/gtktextlayout.c: Don't split segments on marks, since that
causes Arabic words to reshape as you cursor through.
* gtk/gtktextlayout.[ch] gtk/gtktextview.[ch]: Implement virtual
cursor position when moving vertically with the arrow keys and
scrolling with page-up/page-down. (Arrow keys save only the X,
scrolling saves both X and Y.)
This means you can line-up / line-down or page-up / page-down
without losing your place, and also that moving vertically
with the cursor keys keeps the same X position, not the same
character count:
* gtk/gtktextlayout.[ch] gtk/gtktextview.[ch]: Make vertical
arrow keys move by display lines, not paragraphs.
Tue Apr 18 14:16:50 2000 Owen Taylor <otaylor@redhat.com>
* gtk/gtklayout.c: Make sure that the bin window is at least
as big as the allocation. (Should we also make sure that the
bin window is big enough to completely cover widget->window?)
* gtk/gtktextview.c (gtk_text_view_get_visible_rect): Add
function to get the onscreen rectangle.
* gdk/x11/gdkwindow-x11.c (gdk_window_get_pointer): Correctly account
for offsets in window coordinates.
Sun Apr 16 16:13:27 2000 Owen Taylor <otaylor@redhat.com>
* gtk/gtkentry.c (gtk_entry_get_cursor_locations): Fix index/offset
confusion.
* gtk/gtktextview.c (gtk_text_view_ensure_layout): Set the default direction
from the widget direction.
* gtk/gtktexttag.c gtk/gtktexttagprivate.h (gtk_text_tag_set_arg):
Add a "direction" attribute.
* gtk/gtktextview.c: global s/tkxt/text_view/.
* gtk/testtext.c: Added long block of text in Arabic, to test out
the direction attributes. (Some problems with the shaping system
for arabic become obvious - like the fact the cursor splits words
into unjoined pieces.)
Fri Apr 14 12:54:34 2000 Owen Taylor <otaylor@redhat.com>
* gtk/gtktextdisplay.c (render_layout): Add overstrike handling.
* gtk/gtktextlayout.c: Fix up alignment.
* gtk/testtext.c: Add some tests for centering, wrapping.
Fri Apr 14 09:26:22 2000 Owen Taylor <otaylor@redhat.com>
* gdk/gdkdrawable.h gdk/gdkdraw.c gdk/gdkwindow.c gdk/x11/gdkdrawable-x11.c:
Add a draw_glyphs() operation to the drawable vtable and gdk_draw_glyphs().
If we wrote GTK+-specific layout-render function this could just replace
the draw_layout() operation in the vtable.
* gtk/gtkentry.c: Move guts of gtk_entry_get_cursor_locations to
pango_layout_get_cursor_pos() and use that function.
* gtk/gtktextchild.[ch]: add gtk_ onto pixmap_segment_new(), since it
is a non-static symbol.
* gtk/gtktextbtree.[ch]: Replace gtk_text_btree_find_line_data_by_y()
with gtk_text_btree_find_line_by_y()
* gtk/gtktextdisplay.c: Rewrote for Pango - uses a custom layout
renderer that handles GtkTextAppearance attributes.
* gtk/gtktexttag.[ch] gtk/gtktexttagprivate.h:
- Move the values in the style that don't affect geometry into a
GtkTextAppearance structure.
- Change underline to take a PangoUnderline and "font" a string
representation of a font description
- Add a "font_desc" attribute which takes a FontDescription structure.
* gtk/gtktextlayout.[ch]:
- Get rid of the display-line list per each line. Instead, we
generate, on demand, a GtkTextLineDisplay structure which]
contains a PangoLayout * and other necesary information
(offsets, cursor locations) for displaying a paragraph.
- Get rid of the code to wrap lines, create display chunks,
etc. Instead, we just go through a paragraph and convert
it into the necessary inputs to a PangoLayout.
- Implement a new attribute type, GtkTextAttrAppearance. This
holds a GtkTextAppearance, and is used to pass colors,
stipple, etc, through from the layout to the display without
having to use lots and lots of individual attributes.
- Reimplement gtk_layout_get_iter_at_pixel() gtk_layout_get_iter_pos()
in terms of PangoLayout functions.
* gtk/gtktextview.c:
- Handle passing the necessary PangoContext to the layout
- Some fixups in painting to deal with the automatic backing store
and offsetting of GTK+-1.4
- Add a style_set handler so that the default style reacts
properly to theme changes.
* gtk/gtktext?*.[ch]: Random code-style fixes.
* gtk/testtext.c: Substitute in languages that Pango handles now for Thai
Mon Apr 10 10:33:45 2000 Owen Taylor <otaylor@redhat.com>
* gtk/gtktext?*.[ch]: Check in Havoc's port of the Tk text widget,
in original form preparatory to Pango-ization and gdkimcontext-ization.
Thu Apr 6 19:25:39 2000 Owen Taylor <otaylor@redhat.com>
* gtk/gtkimcontext.c: Move default implementations to real_* vfuncs,
so that we can derive from gtkimcontext in language bindings properly.
Thu Apr 6 16:02:52 2000 Owen Taylor <otaylor@redhat.com>
* gtk/gtkimcontextsimple.[ch]: Use gdk_keyval_to_unicode to gdk_unicode_to_keyval.
Add a compose table including (almost) all the compose combinations
from X. This is 6k of static, shared data as opposed to 50k or so of dynamic
data in the XIM implementation.
* gdk/gdk.h gdk/gdkkeyuni.c gdk/win32/gdkevents-win32.c (gdk_keyval_to_unicode, gdk_unicode_to_keyval):
Moved functions to convert keyvalues from and to unicode here from
the win32 port and made them public.
Wed Apr 5 16:37:29 2000 Owen Taylor <otaylor@redhat.com>
* gtk/gtkeditable.c (gtk_editable_insert_text): Allow new_text_length == -1.
Wed Apr 5 16:27:45 2000 Owen Taylor <otaylor@redhat.com>
* gtk/gtkimcontext.[ch]: Base class for new input context system
* gtk/gtkimmulticontext.[ch]: Proxy input context that allows
the real input context implementation to be loaded from modules
and switched on the fly.
* gtk/gtkcontextsimple.[ch]: Simple implementation of an input
context that just does direct keysymbol => unicode translation.
* gtk/gtkentry.[ch]: Start switching editing over to using
GtkInputContext. (No handling of preedit yet.)
Wed Apr 5 15:48:41 2000 Owen Taylor <otaylor@redhat.com>
* gtk/gtktypeutils.h (GTK_CHECK_GET_CLASS): Fix problem with one too
many substitutions. (klass should not be subsituted.)
Wed Apr 5 00:18:14 2000 Owen Taylor <otaylor@redhat.com>
* configure.in: Add checks for Pango
* configure.in docs/Makefile.am: Add test for sgml2html
and allow 'make dist' without building html, but print out
warnings in that case. (For making snapshots)
* gdk/Makefile.am gdk/x11/Makefile.am gtk/Makefile.am:
Add Pango libraries and C flags
* gdk/gdkdraw.c gdk/gdkdrawable.h gdkwindow.c gdk/x11/gdkdrawable-x11.c:
Add function (gdk_draw_layout) to draw a pango layout.
* gdk/gdkpango.h gdk/x11/gdkpango-x11.c: New file with functions
for getting Pango contexts for GDK.
* gtk/gtkeditable.c: Get rid of dead code gtk_editable_parent_set()
* gtk/gtkentry.[ch]: Complete rewrite to use Pango, add bidirectional
editing.
* gtk/gtkentry.c: Hack in simple Hebrew input with direct
keysym => unicode translations. More languages can be added
here, but real input-method support is needed.
* docs/Changes-1.4.txt: Added note about entry behavior.
* gtk/gtkenums.h gtk/gtkwidget.[ch] testgtk.c gtkprivate.h: Add functions
to set the reading direction for a widget and the global direction.
Add test which allows toggling the global direction. Two private
flags are used to store the direction. (GTK_DIRECTION_SET + GTK_DIRECTION_LTR)
* gtk/gtkcheckbutton.c gtk/gtkframe.c gtk/gtkhbbox.c gtk/gtkhbox.c
gtk/gtkradiobutton.c gtk/gtkspinbutton.c gtk/gtktable.c
* gtk/gtk[hv]scale.c gtk/gtkscale.[ch]: Draw numbers using Pango
* gtk/gtklabel.[ch]: Moved to Pango and considerably rewritten. Line breaking,
underlining now handled by Pango.
* gtk/gtkstyle.[ch] gtk/gtkrc.[ch]: Add a PangoFontDescription
to RCStyle and Style. (Having both this and the old font name and GdkFont
is temporary.)
* gtk/gtkwidget.[ch] (gtk_widget_create_pango_{context,layout}): Added
convenience functions for creating contexts and layouts for widgets.
* gtk/testgtk.c: Enhance label tests with multilingual labels.
2000-06-02 03:14:07 +00:00
|
|
|
|
|
2000-07-02 22:30:54 +00:00
|
|
|
|
layout = gtk_widget_create_pango_layout (widget, NULL);
|
2005-05-11 19:16:19 +00:00
|
|
|
|
|
|
|
|
|
gdk_cairo_set_source_color (cr, SELECTED_FG_COLOR (widget));
|
1998-09-27 18:32:00 +00:00
|
|
|
|
for (i = 0; i < 7; i++)
|
|
|
|
|
{
|
2000-11-12 22:15:43 +00:00
|
|
|
|
if (gtk_widget_get_direction (GTK_WIDGET (calendar)) == GTK_TEXT_DIR_RTL)
|
|
|
|
|
day = 6 - i;
|
|
|
|
|
else
|
|
|
|
|
day = i;
|
2005-05-11 19:16:19 +00:00
|
|
|
|
day = (day + priv->week_start) % 7;
|
2002-12-15 01:49:01 +00:00
|
|
|
|
g_snprintf (buffer, sizeof (buffer), "%s", default_abbreviated_dayname[day]);
|
Remove all references to offscreen flag which was no longer used.
Thu Jun 1 23:05:13 2000 Owen Taylor <otaylor@redhat.com>
* gtk/gtkwidget.c: Remove all references to
offscreen flag which was no longer used.
* gtk/gtkprivate.h (enum): Remove unused flags and compress.
* gtk/gtkframe.c (gtk_frame_set_label_widget): Check
for non-null label_widget->parent.
* gtk/gtkentry.c: Get rid of code to deal with PangoAttribute
which no longer was used.
* gdk/gdkpango.c (gdk_pango_context_get_info): make static.
* gdk/gdkpango.c (gdk_draw_layout[_line]): Add checks
for null arguments.
* gdk/x11/gdkgeometry-x11.c (gdk_window_scroll): add
check for destroyed windows.
Thu Jun 1 13:48:45 2000 Owen Taylor <otaylor@redhat.com>
* gtk/gtkimmulticontext.c: Add a finalize method and unref
the slave context there.
* gtk/gtkinvisible.[ch]: Make reference counting behavior
identical to GtkWindow.
Thu Jun 1 01:54:11 2000 Owen Taylor <otaylor@redhat.com>
* Makefile.am gdk/gdkpango.c: Copy the layout render function from
pangox to here, so we can write them independent of rendering
system, using GDK primitives.
* gdk/gdkdrawable.h gdk/gdkdraw.c gdk/gdkwindow.c
gdk/x11/gdkdrawable-x11.c: Remove draw_layout() from the vtable,
since we have a rendering-system independent implementation in
terms of draw_glyphs().
* gdk/gdkpango.c gdkdrawable.h (gdk_draw_layout_line): New
function to render a single line.
* gdk/x11/gdkpango.c: Move the guts of this file mostly
into ../gdkpango.c, which simplifies things, since we
don't have to deal with raw X gc's.
Fri May 19 04:28:16 2000 Owen Taylor <otaylor@redhat.com>
* gtk/gtktextlayout.[ch]: Add get_log_attrs() function to
get the logical attributes for a given GtkTextLine.
Tue May 30 16:05:39 2000 Owen Taylor <otaylor@redhat.com>
* gdk/x11/gdkfont-x11.c (gdk_font_charset_for_locale): Track
g_locale_get_codeset() to g_get_codeset() change.
Tue May 30 15:03:19 2000 Owen Taylor <otaylor@redhat.com>
* gtk/testcalendar.c (calendar_font_selection_ok): Use font
descriptions.
* gtk/gtkentry.c (gtk_entry_draw_text): Center text within
the entry.
* gtk/gtkfontsel.c (gtk_font_selection_dialog_init): Start of
redoing (vastly simplifying) for Pango. Still needs quite
a bit of work. (Size selection is currently poor. List of
predefined sizes is not a good idea, since all of these
sizes won't necessarily be distinct.)
Tue May 30 13:50:19 2000 Owen Taylor <otaylor@redhat.com>
* gdk/x11/gdkfont-x11.c (gdk_font_charset_for_locale): Handle
CODESET results for LANG=C.
Mon May 29 15:49:10 2000 Owen Taylor <otaylor@redhat.com>
* gtk/gtkrc.[ch]: Add a 'font_name' declaration to RC
which takes a stringized pango font description;
ignore the older 'font' and 'fontset' declarations.
* gtk/gtkstyle.c gtk/gtkrc.c: Fill in the style->font
field with a GdkFont derived via gdk_font_from_description(),
for compatibility. (Should we just remove it entirely?
Probably too much compatibility breakage, but people
should be migrating to the new Pango stuff as quickly
as possible.)
Mon May 29 15:47:41 2000 Owen Taylor <otaylor@redhat.com>
* gtk/gtkentry.c gtk/gtkclist.c: s/pango_font_unref/g_object_unref/.
Mon May 29 15:44:46 2000 Owen Taylor <otaylor@redhat.com>
* gtk/gtkcalender.c: Roughly pango-ized. Really needs
redoing; there are some bugs in size allocation right
now, the semi-existant distinction between header / day
fonts was removed, but, with Pango, could actually
be made functional in a nice way.
* gtk/testcalender: Move calender from examples into this
directory as a test program. (We really need to restrcture
testgtk into a whole directory full of tests for every
widget or functionality group, separated into multiple .c
files.)
Mon May 29 15:19:56 2000 Owen Taylor <otaylor@redhat.com>
* gtk/testgtk.c (file_exists): Fix stupid typo that
was keeping RC file from being loaded.
* gtk/testgtkrc gtk/testgtkrc2: Test new pango-ized
RC file font code.
Mon May 29 14:31:27 2000 Owen Taylor <otaylor@redhat.com>
* gdk/gdkfont.h gdk/x11/gdkfont-x11.c (gdk_font_from_description):
Add function to load a GdkFont from a PangoFontDescription.
Fri May 26 17:16:40 2000 Owen Taylor <otaylor@redhat.com>
* gtk/frame.[ch] gtkaspectframe.c: Make frame widgets able
to have any widget for the label, use a GtkLabel widget
to display the text. (Based partially on a patch from
Anders Carlson.)
(Quite a bit of code reorganization - strip 90% of the
guts out of gtkaspectframe and add a single virtual
func to GtkFrameClass - compute_child_allocation.)
Fri May 26 12:00:02 2000 Owen Taylor <otaylor@redhat.com>
* gtk/gtkctree.c gtk/gtkclist.[ch]: Pangoized.
(Removed clist->row_center_offset field because caching
it wasn't saving time or code, added private function
_gtk_clist_create_cell_layout()).
Wed May 24 15:59:37 2000 Owen Taylor <otaylor@redhat.com>
* gtk/gtkaccellabel.c: Pangoized.
* gtk/[hv]ruler.c: Pangoized
Mon May 22 19:23:59 2000 Owen Taylor <otaylor@redhat.com>
* gtk/gtkfilesel.c (gtk_file_selection_init):
Use gtk_clist_set_column_auto_resize() to remove need
need for manual column width computations.
Mon May 22 18:50:26 2000 Owen Taylor <otaylor@redhat.com>
* gtk/gtktooltips.[ch]: Replace custom drawing with a GtkLabel,
ensuring Pango correctness, and considerably simplifying the
code.
* gtk/gtklabel.c gtk[hv]scale.c: 1000 => PANGO_SCALE.
* gtk/gtklabel.c (gtk_label_size_request): Fixed incorrect
getting of numbers of lines.
* gtk/gtklabel.c (gtk_label_size_request): Set the requisition
to the actual requested width of the lable, not to the wrap
width we set.
* gtk/gtktextchild.h: Remove extraneous include of gtk/gtk.h.
* gtk/gtktextbtree.c gtk/gtktextbuffer.c gtk/gtktextlayout.c
gtk/gtktextview.c gtk/gtktextview.[ch]: Fix up includes.
* gtk/gtktextview.c: Fix structure inheritance.
* gtk/gtkprogressbar.c: Pangoize.
Mon May 22 15:47:30 2000 Owen Taylor <otaylor@redhat.com>
* gtk/gtktextview.c (gtk_text_view_get_first_para_iter): Encapsulate
in a function.
* gtk/gtktextlayout.c (find_display_line_above): Fixed
bug with computing line tops.
* gtk/gtktextview.c (changed_handler): Fix < , <= confusion.
Thu May 18 18:53:31 2000 Owen Taylor <otaylor@redhat.com>
* gtk/gtktextdisplay.c (gtk_text_layout_draw): Fix up the x_offset
and y_offset coordinates to do what we need now. (The offset between
buffer and layout coordinates has been reintroduced, but is a
bit different than before.)
* gtk/gtktextview.[ch]: No longer inherit from GtkLayout; instead
handle the adjustments ourselves, and scroll as necessary using
the new gdk_window_scroll().
The advantage of this is that when we are incrementally revalidating,
we are essentially rearranging things around the visible portion
of the screen. With the old setup, the visible portion of the
screen was moved around in the layout, so scrolling and redrawing
to track that caused jumping of the display. Since we now
control the scrolling ourselves, we can suppress this and
only redraw when things actually change.
Thu May 18 18:47:25 2000 Owen Taylor <otaylor@redhat.com>
* gtk/gtktextbtree.c (redisplay_mark): We need to invalidate
the region not just redisplay it after-all, since we store the
cursors in the LineDisplay. (Ugly interactions here between
GtkLayout and GtkTextBTree here.)
* gtk/gtktextbtree.c (redisplay_region): Fixed reversed comparison.
Thu May 18 18:43:21 2000 Owen Taylor <otaylor@redhat.com>
* gdk/gdkwindow.h gdk/x11/gdkgeometry-x11.c (gdk_window_scroll):
Added function to scroll contents of a window while keeping the
window constant. Works by XCopyArea or guffaw-scrolling depending
on the details of how the window is set up. (guffaw-scrolling
still needs to be filled in.)
Wed May 17 22:36:53 2000 Owen Taylor <otaylor@redhat.com>
* gtk/gtktextiter.c gtk/gtkmain.c: Add a debug key for the text widget,
move the debugging that was tied to a global variable
to that.
* gtk/gtkmarshal.list: Add NONE:INT,INT,INT
* gtk/gtktextbtree.[ch] gtk/gtktextlayout.c: Keep a separate
validated flag, in line data instead of setting height/width to
-1. This allows us to perform operations with partially invalid
buffer (using the old size for invalid lines) and thus to do
incremental vaidation. Keep height/width aggregates up to date
when deleting text and rebalancing the tree.
* gtk/gtktextbtree.[ch]: Add functions validate a line
(gtk_text_btree_validate_line), and to validate up
to a number of pixels (gtk_text_btree_validate).
* gtk/gtktextlayout.[ch]: Add an ::invalidated signal
that indicates that something is changed and a revalidation
pass is needed. Change ::need_repaint to ::changed, and
make it take old and new yranges instead of a rectangle.
* gtk/gtktextbtree.[ch] gtk/gtktextlayout.[ch]: Move
the line_data_destroy() function from
gtk_text_btree_add_view() to a virtual function in
GtkTextLayout
* gtk/gtktextbtree.[ch]: Remove gtk_text_btree_get_damage_range(),
since we are handling partial repaints in a different fashion
now.
* gtk/gtktextbtree.[ch]: Only repaint the changed portion
of the selection instead of queueing a repaint on the
entire widget.
* gtk/gtktextbuffer.[ch] gtk/gtktextbtree.[ch]: Move
get_selection_bounds() down to btree, make the function
in buffer a wrapper around the btree function.
* gtk/gtktextlayout.[ch]: Add functions to check if the
layout is valid and to recompute either a range of pixels
aroudn a line or a certain total number of pixels.
* gtk/gtktextlayout.[ch]: Cache a single line display;
now that we only redraw the needed portions, the hit rate
for this cache is quite high.
* gtk/gtktextview.[ch]: Keep track of the first paragraph
on the screen so that when re-laying-out the buffer, we can
keep the same place. This requires connecting to ::value_changed
on the adjustments
* gtk/gtktextview.[ch]: Add idle functions to revalidate
the buffer after we receive an ::invalidated signal.
Wed May 17 22:10:47 2000 Owen Taylor <otaylor@redhat.com>
* gtk/gtklayout.c (gtk_layout_size_allocate): Set upper
to max of allocation and layout size, not just to the
layout size.
* gtk/gtk[hv]scrollbar.c (gtk_[hv]scrollbar_calc_slider_size):
Invalidate window so it gets redrawn properly.
* gdk/gdkwindow.c (gdk_window_invalidate_rect): Allow rect == NULL
to mean the entire window.
* gdk/gdkevents.h: Move definition for GDK_PRIORITY_REDRAW
into public header.
Mon May 15 14:51:31 2000 Owen Taylor <otaylor@redhat.com>
* gtk/gtktextmark.c (gtk_text_mark_get_name): Add function
to get the name of a mark.
* gtk/gtktextlayout.c (gtk_text_layout_get_line_at_y): Add a function
to find the paragraph from a y position.
Thu May 11 12:57:20 2000 Owen Taylor <otaylor@redhat.com>
* gtk/gtktextbtree.c (gtk_text_btree_node_invalidate_upward): Valid
nodes have width/height >= 0, not > 0.
Tue May 9 21:29:06 2000 Owen Taylor <otaylor@redhat.com>
* gtk/gtktextlayout.[ch] gtk/gtktextdisplay.c (gtk_text_layout_get_line_display):
Add a size_only flag, so when we only need the size, we don't create
useless appearance attributes.
* gtk/gtktextview.c (gtk_text_view_ensure_layout): Remove
duplicate setting of font description.
* gtk/gtkscale.c: Use PANGO_SCALE instead of 1000
Wed Apr 26 01:53:23 2000 Owen Taylor <otaylor@redhat.com>
* gtk/Makefile.am (EXTRA_DIST): Add OLD_STAMP into
EXTRA_DIST. It does not work well when the file that
everything depends on is not in the tarball.
Wed Apr 26 00:56:14 2000 Owen Taylor <otaylor@redhat.com>
* gtk/testgtk.c: Some hacks and fixes so that it basically
works when not sitting in the GTK+ build tree.
2000-05-03 Havoc Pennington <hp@redhat.com>
* gtk/gtktextbtree.c (gtk_text_line_next_could_contain_tag):
Properly determine the ordering of the tag root and the current
line within the tree. Previous algorithm only worked if the tag
root's immediate parent was the common root of both the current
line and the tag root.
Wed Apr 26 00:43:00 2000 Owen Taylor <otaylor@redhat.com>
* gtk/gtktextlayout.c (set_para_values): Fix some bugs in
alignment.
* gtk/gtktextview.c (gtk_text_view_ensure_layout): Track
the widget text directional dynamically.
* gtk/gtktextview.[ch]: Added functions to get and set default
wrap mode.
Tue Apr 25 23:47:38 2000 Owen Taylor <otaylor@redhat.com>
* gtk/gtktextlayout.c (gtk_text_layout_get_iter_location): Fix bug
in cursor location computation.
Tue Apr 25 23:22:59 2000 Owen Taylor <otaylor@redhat.com>
* gtk/gtklayout.c (gtk_layout_set_size): Clamp hadjustment/
vadjusment values properly when layout gets smaller.
* gtk/gtktextview.c (need_repaint_handler): Areas being
passed in are far completely inaccurate, and sometimes
too small, so, for now, just queue a redraw on the
whole visible region.
2000-04-25 Havoc Pennington <hp@redhat.com>
* gtk/gtktextbtree.c (summary_destroy): new function to
destroy tag summary nodes
(gtk_text_line_next_could_contain_tag): this function was
totally broken if the line passed in wasn't below the tag
root. Fix it.
(gtk_text_btree_first_could_contain_tag): In the tag == NULL
"wildcard" case, we have to do a linear scan. Blah.
(gtk_text_btree_last_could_contain_tag): In tag == NULL case,
we have to do the linear scan
(tag_removed_cb): When a tag is removed from the tag table,
remove the GtkTextTagInfo node from the btree.
(gtk_text_btree_spew): Implement the spew function, for
our debugging pleasure.
Tue Apr 25 19:40:18 2000 Owen Taylor <otaylor@redhat.com>
* gtk/gtktextlayout.c (gtk_text_layout_set_buffer): Fix
a problem with referring to the wrong buffer.
* gtk/gtkentry.c: Fix focus-in/focus-out confusion.
* gtk/gtkrc.c gtk/gtkstyle.c: Moving setting default
font description to gtk_style_new() - otherwise things
don't work without a .gtkrc file.
* gtk/gtktextbuffer.c (gtk_text_buffer_new): Sink the
tags table if we create it ourself, too.
* gdk/gdktypes.h (enum): Move GDK_RELEASE_MASK, since
it was conflicting with XKB modifiers.
* gtk/gtktextview.[ch]: Add simple support for
GtkIMContext.
Mon Apr 24 19:34:18 2000 Owen Taylor <otaylor@redhat.com>
* gtk/gtkentry.c (gtk_entry_move_cursor_visually): Fix problem
with deletion from last commit.
Mon Apr 24 19:29:40 2000 Owen Taylor <otaylor@redhat.com>
* gtk/gtkwidget.c (gtk_widget_create_pango_context): Set the language
in the context from the current locale.
* gtk/gtkentry.c (gtk_entry_size_request): Use language from the
context, not hardcoded value.
* gtk/gtkentry.c (gtk_entry_move_cursor): Make character movement visual,
not logical.
Sun Apr 23 23:39:18 2000 Owen Taylor <otaylor@redhat.com>
* gtk/gtkentry.c gtk/gtktextdisplay.c: Don't handle selections as
attributes - that doesn't handle partial-glyph selection
properly. Instead use new pango_layout_line_get_x_ranges()
functionality to draw the selection.
* gtk/gtkentry.c: Simplify code since pango_layout_line_index_to_x()
now properly handles out-of-range coordinates.
* gtk/gtktextbuffer.c: Emit "mark_set" when the cursor is moved.
* gtk/gtktextiter.h gtk/gtktextiterprivate.h: Make gtk_text_iter_get_line_byte()
public.
* gtk/gtktextlayout.[ch]: Properly set the direction in the PangoContext
for paragraphs opposite to the base direction of the widget.
* gtk/gtktextlayout.[ch] gtk/gtktextdisplay.c: Fixes for alignment.
* gtk/gtktextlayout.c: Don't split segments on marks, since that
causes Arabic words to reshape as you cursor through.
* gtk/gtktextlayout.[ch] gtk/gtktextview.[ch]: Implement virtual
cursor position when moving vertically with the arrow keys and
scrolling with page-up/page-down. (Arrow keys save only the X,
scrolling saves both X and Y.)
This means you can line-up / line-down or page-up / page-down
without losing your place, and also that moving vertically
with the cursor keys keeps the same X position, not the same
character count:
* gtk/gtktextlayout.[ch] gtk/gtktextview.[ch]: Make vertical
arrow keys move by display lines, not paragraphs.
Tue Apr 18 14:16:50 2000 Owen Taylor <otaylor@redhat.com>
* gtk/gtklayout.c: Make sure that the bin window is at least
as big as the allocation. (Should we also make sure that the
bin window is big enough to completely cover widget->window?)
* gtk/gtktextview.c (gtk_text_view_get_visible_rect): Add
function to get the onscreen rectangle.
* gdk/x11/gdkwindow-x11.c (gdk_window_get_pointer): Correctly account
for offsets in window coordinates.
Sun Apr 16 16:13:27 2000 Owen Taylor <otaylor@redhat.com>
* gtk/gtkentry.c (gtk_entry_get_cursor_locations): Fix index/offset
confusion.
* gtk/gtktextview.c (gtk_text_view_ensure_layout): Set the default direction
from the widget direction.
* gtk/gtktexttag.c gtk/gtktexttagprivate.h (gtk_text_tag_set_arg):
Add a "direction" attribute.
* gtk/gtktextview.c: global s/tkxt/text_view/.
* gtk/testtext.c: Added long block of text in Arabic, to test out
the direction attributes. (Some problems with the shaping system
for arabic become obvious - like the fact the cursor splits words
into unjoined pieces.)
Fri Apr 14 12:54:34 2000 Owen Taylor <otaylor@redhat.com>
* gtk/gtktextdisplay.c (render_layout): Add overstrike handling.
* gtk/gtktextlayout.c: Fix up alignment.
* gtk/testtext.c: Add some tests for centering, wrapping.
Fri Apr 14 09:26:22 2000 Owen Taylor <otaylor@redhat.com>
* gdk/gdkdrawable.h gdk/gdkdraw.c gdk/gdkwindow.c gdk/x11/gdkdrawable-x11.c:
Add a draw_glyphs() operation to the drawable vtable and gdk_draw_glyphs().
If we wrote GTK+-specific layout-render function this could just replace
the draw_layout() operation in the vtable.
* gtk/gtkentry.c: Move guts of gtk_entry_get_cursor_locations to
pango_layout_get_cursor_pos() and use that function.
* gtk/gtktextchild.[ch]: add gtk_ onto pixmap_segment_new(), since it
is a non-static symbol.
* gtk/gtktextbtree.[ch]: Replace gtk_text_btree_find_line_data_by_y()
with gtk_text_btree_find_line_by_y()
* gtk/gtktextdisplay.c: Rewrote for Pango - uses a custom layout
renderer that handles GtkTextAppearance attributes.
* gtk/gtktexttag.[ch] gtk/gtktexttagprivate.h:
- Move the values in the style that don't affect geometry into a
GtkTextAppearance structure.
- Change underline to take a PangoUnderline and "font" a string
representation of a font description
- Add a "font_desc" attribute which takes a FontDescription structure.
* gtk/gtktextlayout.[ch]:
- Get rid of the display-line list per each line. Instead, we
generate, on demand, a GtkTextLineDisplay structure which]
contains a PangoLayout * and other necesary information
(offsets, cursor locations) for displaying a paragraph.
- Get rid of the code to wrap lines, create display chunks,
etc. Instead, we just go through a paragraph and convert
it into the necessary inputs to a PangoLayout.
- Implement a new attribute type, GtkTextAttrAppearance. This
holds a GtkTextAppearance, and is used to pass colors,
stipple, etc, through from the layout to the display without
having to use lots and lots of individual attributes.
- Reimplement gtk_layout_get_iter_at_pixel() gtk_layout_get_iter_pos()
in terms of PangoLayout functions.
* gtk/gtktextview.c:
- Handle passing the necessary PangoContext to the layout
- Some fixups in painting to deal with the automatic backing store
and offsetting of GTK+-1.4
- Add a style_set handler so that the default style reacts
properly to theme changes.
* gtk/gtktext?*.[ch]: Random code-style fixes.
* gtk/testtext.c: Substitute in languages that Pango handles now for Thai
Mon Apr 10 10:33:45 2000 Owen Taylor <otaylor@redhat.com>
* gtk/gtktext?*.[ch]: Check in Havoc's port of the Tk text widget,
in original form preparatory to Pango-ization and gdkimcontext-ization.
Thu Apr 6 19:25:39 2000 Owen Taylor <otaylor@redhat.com>
* gtk/gtkimcontext.c: Move default implementations to real_* vfuncs,
so that we can derive from gtkimcontext in language bindings properly.
Thu Apr 6 16:02:52 2000 Owen Taylor <otaylor@redhat.com>
* gtk/gtkimcontextsimple.[ch]: Use gdk_keyval_to_unicode to gdk_unicode_to_keyval.
Add a compose table including (almost) all the compose combinations
from X. This is 6k of static, shared data as opposed to 50k or so of dynamic
data in the XIM implementation.
* gdk/gdk.h gdk/gdkkeyuni.c gdk/win32/gdkevents-win32.c (gdk_keyval_to_unicode, gdk_unicode_to_keyval):
Moved functions to convert keyvalues from and to unicode here from
the win32 port and made them public.
Wed Apr 5 16:37:29 2000 Owen Taylor <otaylor@redhat.com>
* gtk/gtkeditable.c (gtk_editable_insert_text): Allow new_text_length == -1.
Wed Apr 5 16:27:45 2000 Owen Taylor <otaylor@redhat.com>
* gtk/gtkimcontext.[ch]: Base class for new input context system
* gtk/gtkimmulticontext.[ch]: Proxy input context that allows
the real input context implementation to be loaded from modules
and switched on the fly.
* gtk/gtkcontextsimple.[ch]: Simple implementation of an input
context that just does direct keysymbol => unicode translation.
* gtk/gtkentry.[ch]: Start switching editing over to using
GtkInputContext. (No handling of preedit yet.)
Wed Apr 5 15:48:41 2000 Owen Taylor <otaylor@redhat.com>
* gtk/gtktypeutils.h (GTK_CHECK_GET_CLASS): Fix problem with one too
many substitutions. (klass should not be subsituted.)
Wed Apr 5 00:18:14 2000 Owen Taylor <otaylor@redhat.com>
* configure.in: Add checks for Pango
* configure.in docs/Makefile.am: Add test for sgml2html
and allow 'make dist' without building html, but print out
warnings in that case. (For making snapshots)
* gdk/Makefile.am gdk/x11/Makefile.am gtk/Makefile.am:
Add Pango libraries and C flags
* gdk/gdkdraw.c gdk/gdkdrawable.h gdkwindow.c gdk/x11/gdkdrawable-x11.c:
Add function (gdk_draw_layout) to draw a pango layout.
* gdk/gdkpango.h gdk/x11/gdkpango-x11.c: New file with functions
for getting Pango contexts for GDK.
* gtk/gtkeditable.c: Get rid of dead code gtk_editable_parent_set()
* gtk/gtkentry.[ch]: Complete rewrite to use Pango, add bidirectional
editing.
* gtk/gtkentry.c: Hack in simple Hebrew input with direct
keysym => unicode translations. More languages can be added
here, but real input-method support is needed.
* docs/Changes-1.4.txt: Added note about entry behavior.
* gtk/gtkenums.h gtk/gtkwidget.[ch] testgtk.c gtkprivate.h: Add functions
to set the reading direction for a widget and the global direction.
Add test which allows toggling the global direction. Two private
flags are used to store the direction. (GTK_DIRECTION_SET + GTK_DIRECTION_LTR)
* gtk/gtkcheckbutton.c gtk/gtkframe.c gtk/gtkhbbox.c gtk/gtkhbox.c
gtk/gtkradiobutton.c gtk/gtkspinbutton.c gtk/gtktable.c
* gtk/gtk[hv]scale.c gtk/gtkscale.[ch]: Draw numbers using Pango
* gtk/gtklabel.[ch]: Moved to Pango and considerably rewritten. Line breaking,
underlining now handled by Pango.
* gtk/gtkstyle.[ch] gtk/gtkrc.[ch]: Add a PangoFontDescription
to RCStyle and Style. (Having both this and the old font name and GdkFont
is temporary.)
* gtk/gtkwidget.[ch] (gtk_widget_create_pango_{context,layout}): Added
convenience functions for creating contexts and layouts for widgets.
* gtk/testgtk.c: Enhance label tests with multilingual labels.
2000-06-02 03:14:07 +00:00
|
|
|
|
|
|
|
|
|
pango_layout_set_text (layout, buffer, -1);
|
2000-07-02 21:32:56 +00:00
|
|
|
|
pango_layout_get_pixel_extents (layout, NULL, &logical_rect);
|
Remove all references to offscreen flag which was no longer used.
Thu Jun 1 23:05:13 2000 Owen Taylor <otaylor@redhat.com>
* gtk/gtkwidget.c: Remove all references to
offscreen flag which was no longer used.
* gtk/gtkprivate.h (enum): Remove unused flags and compress.
* gtk/gtkframe.c (gtk_frame_set_label_widget): Check
for non-null label_widget->parent.
* gtk/gtkentry.c: Get rid of code to deal with PangoAttribute
which no longer was used.
* gdk/gdkpango.c (gdk_pango_context_get_info): make static.
* gdk/gdkpango.c (gdk_draw_layout[_line]): Add checks
for null arguments.
* gdk/x11/gdkgeometry-x11.c (gdk_window_scroll): add
check for destroyed windows.
Thu Jun 1 13:48:45 2000 Owen Taylor <otaylor@redhat.com>
* gtk/gtkimmulticontext.c: Add a finalize method and unref
the slave context there.
* gtk/gtkinvisible.[ch]: Make reference counting behavior
identical to GtkWindow.
Thu Jun 1 01:54:11 2000 Owen Taylor <otaylor@redhat.com>
* Makefile.am gdk/gdkpango.c: Copy the layout render function from
pangox to here, so we can write them independent of rendering
system, using GDK primitives.
* gdk/gdkdrawable.h gdk/gdkdraw.c gdk/gdkwindow.c
gdk/x11/gdkdrawable-x11.c: Remove draw_layout() from the vtable,
since we have a rendering-system independent implementation in
terms of draw_glyphs().
* gdk/gdkpango.c gdkdrawable.h (gdk_draw_layout_line): New
function to render a single line.
* gdk/x11/gdkpango.c: Move the guts of this file mostly
into ../gdkpango.c, which simplifies things, since we
don't have to deal with raw X gc's.
Fri May 19 04:28:16 2000 Owen Taylor <otaylor@redhat.com>
* gtk/gtktextlayout.[ch]: Add get_log_attrs() function to
get the logical attributes for a given GtkTextLine.
Tue May 30 16:05:39 2000 Owen Taylor <otaylor@redhat.com>
* gdk/x11/gdkfont-x11.c (gdk_font_charset_for_locale): Track
g_locale_get_codeset() to g_get_codeset() change.
Tue May 30 15:03:19 2000 Owen Taylor <otaylor@redhat.com>
* gtk/testcalendar.c (calendar_font_selection_ok): Use font
descriptions.
* gtk/gtkentry.c (gtk_entry_draw_text): Center text within
the entry.
* gtk/gtkfontsel.c (gtk_font_selection_dialog_init): Start of
redoing (vastly simplifying) for Pango. Still needs quite
a bit of work. (Size selection is currently poor. List of
predefined sizes is not a good idea, since all of these
sizes won't necessarily be distinct.)
Tue May 30 13:50:19 2000 Owen Taylor <otaylor@redhat.com>
* gdk/x11/gdkfont-x11.c (gdk_font_charset_for_locale): Handle
CODESET results for LANG=C.
Mon May 29 15:49:10 2000 Owen Taylor <otaylor@redhat.com>
* gtk/gtkrc.[ch]: Add a 'font_name' declaration to RC
which takes a stringized pango font description;
ignore the older 'font' and 'fontset' declarations.
* gtk/gtkstyle.c gtk/gtkrc.c: Fill in the style->font
field with a GdkFont derived via gdk_font_from_description(),
for compatibility. (Should we just remove it entirely?
Probably too much compatibility breakage, but people
should be migrating to the new Pango stuff as quickly
as possible.)
Mon May 29 15:47:41 2000 Owen Taylor <otaylor@redhat.com>
* gtk/gtkentry.c gtk/gtkclist.c: s/pango_font_unref/g_object_unref/.
Mon May 29 15:44:46 2000 Owen Taylor <otaylor@redhat.com>
* gtk/gtkcalender.c: Roughly pango-ized. Really needs
redoing; there are some bugs in size allocation right
now, the semi-existant distinction between header / day
fonts was removed, but, with Pango, could actually
be made functional in a nice way.
* gtk/testcalender: Move calender from examples into this
directory as a test program. (We really need to restrcture
testgtk into a whole directory full of tests for every
widget or functionality group, separated into multiple .c
files.)
Mon May 29 15:19:56 2000 Owen Taylor <otaylor@redhat.com>
* gtk/testgtk.c (file_exists): Fix stupid typo that
was keeping RC file from being loaded.
* gtk/testgtkrc gtk/testgtkrc2: Test new pango-ized
RC file font code.
Mon May 29 14:31:27 2000 Owen Taylor <otaylor@redhat.com>
* gdk/gdkfont.h gdk/x11/gdkfont-x11.c (gdk_font_from_description):
Add function to load a GdkFont from a PangoFontDescription.
Fri May 26 17:16:40 2000 Owen Taylor <otaylor@redhat.com>
* gtk/frame.[ch] gtkaspectframe.c: Make frame widgets able
to have any widget for the label, use a GtkLabel widget
to display the text. (Based partially on a patch from
Anders Carlson.)
(Quite a bit of code reorganization - strip 90% of the
guts out of gtkaspectframe and add a single virtual
func to GtkFrameClass - compute_child_allocation.)
Fri May 26 12:00:02 2000 Owen Taylor <otaylor@redhat.com>
* gtk/gtkctree.c gtk/gtkclist.[ch]: Pangoized.
(Removed clist->row_center_offset field because caching
it wasn't saving time or code, added private function
_gtk_clist_create_cell_layout()).
Wed May 24 15:59:37 2000 Owen Taylor <otaylor@redhat.com>
* gtk/gtkaccellabel.c: Pangoized.
* gtk/[hv]ruler.c: Pangoized
Mon May 22 19:23:59 2000 Owen Taylor <otaylor@redhat.com>
* gtk/gtkfilesel.c (gtk_file_selection_init):
Use gtk_clist_set_column_auto_resize() to remove need
need for manual column width computations.
Mon May 22 18:50:26 2000 Owen Taylor <otaylor@redhat.com>
* gtk/gtktooltips.[ch]: Replace custom drawing with a GtkLabel,
ensuring Pango correctness, and considerably simplifying the
code.
* gtk/gtklabel.c gtk[hv]scale.c: 1000 => PANGO_SCALE.
* gtk/gtklabel.c (gtk_label_size_request): Fixed incorrect
getting of numbers of lines.
* gtk/gtklabel.c (gtk_label_size_request): Set the requisition
to the actual requested width of the lable, not to the wrap
width we set.
* gtk/gtktextchild.h: Remove extraneous include of gtk/gtk.h.
* gtk/gtktextbtree.c gtk/gtktextbuffer.c gtk/gtktextlayout.c
gtk/gtktextview.c gtk/gtktextview.[ch]: Fix up includes.
* gtk/gtktextview.c: Fix structure inheritance.
* gtk/gtkprogressbar.c: Pangoize.
Mon May 22 15:47:30 2000 Owen Taylor <otaylor@redhat.com>
* gtk/gtktextview.c (gtk_text_view_get_first_para_iter): Encapsulate
in a function.
* gtk/gtktextlayout.c (find_display_line_above): Fixed
bug with computing line tops.
* gtk/gtktextview.c (changed_handler): Fix < , <= confusion.
Thu May 18 18:53:31 2000 Owen Taylor <otaylor@redhat.com>
* gtk/gtktextdisplay.c (gtk_text_layout_draw): Fix up the x_offset
and y_offset coordinates to do what we need now. (The offset between
buffer and layout coordinates has been reintroduced, but is a
bit different than before.)
* gtk/gtktextview.[ch]: No longer inherit from GtkLayout; instead
handle the adjustments ourselves, and scroll as necessary using
the new gdk_window_scroll().
The advantage of this is that when we are incrementally revalidating,
we are essentially rearranging things around the visible portion
of the screen. With the old setup, the visible portion of the
screen was moved around in the layout, so scrolling and redrawing
to track that caused jumping of the display. Since we now
control the scrolling ourselves, we can suppress this and
only redraw when things actually change.
Thu May 18 18:47:25 2000 Owen Taylor <otaylor@redhat.com>
* gtk/gtktextbtree.c (redisplay_mark): We need to invalidate
the region not just redisplay it after-all, since we store the
cursors in the LineDisplay. (Ugly interactions here between
GtkLayout and GtkTextBTree here.)
* gtk/gtktextbtree.c (redisplay_region): Fixed reversed comparison.
Thu May 18 18:43:21 2000 Owen Taylor <otaylor@redhat.com>
* gdk/gdkwindow.h gdk/x11/gdkgeometry-x11.c (gdk_window_scroll):
Added function to scroll contents of a window while keeping the
window constant. Works by XCopyArea or guffaw-scrolling depending
on the details of how the window is set up. (guffaw-scrolling
still needs to be filled in.)
Wed May 17 22:36:53 2000 Owen Taylor <otaylor@redhat.com>
* gtk/gtktextiter.c gtk/gtkmain.c: Add a debug key for the text widget,
move the debugging that was tied to a global variable
to that.
* gtk/gtkmarshal.list: Add NONE:INT,INT,INT
* gtk/gtktextbtree.[ch] gtk/gtktextlayout.c: Keep a separate
validated flag, in line data instead of setting height/width to
-1. This allows us to perform operations with partially invalid
buffer (using the old size for invalid lines) and thus to do
incremental vaidation. Keep height/width aggregates up to date
when deleting text and rebalancing the tree.
* gtk/gtktextbtree.[ch]: Add functions validate a line
(gtk_text_btree_validate_line), and to validate up
to a number of pixels (gtk_text_btree_validate).
* gtk/gtktextlayout.[ch]: Add an ::invalidated signal
that indicates that something is changed and a revalidation
pass is needed. Change ::need_repaint to ::changed, and
make it take old and new yranges instead of a rectangle.
* gtk/gtktextbtree.[ch] gtk/gtktextlayout.[ch]: Move
the line_data_destroy() function from
gtk_text_btree_add_view() to a virtual function in
GtkTextLayout
* gtk/gtktextbtree.[ch]: Remove gtk_text_btree_get_damage_range(),
since we are handling partial repaints in a different fashion
now.
* gtk/gtktextbtree.[ch]: Only repaint the changed portion
of the selection instead of queueing a repaint on the
entire widget.
* gtk/gtktextbuffer.[ch] gtk/gtktextbtree.[ch]: Move
get_selection_bounds() down to btree, make the function
in buffer a wrapper around the btree function.
* gtk/gtktextlayout.[ch]: Add functions to check if the
layout is valid and to recompute either a range of pixels
aroudn a line or a certain total number of pixels.
* gtk/gtktextlayout.[ch]: Cache a single line display;
now that we only redraw the needed portions, the hit rate
for this cache is quite high.
* gtk/gtktextview.[ch]: Keep track of the first paragraph
on the screen so that when re-laying-out the buffer, we can
keep the same place. This requires connecting to ::value_changed
on the adjustments
* gtk/gtktextview.[ch]: Add idle functions to revalidate
the buffer after we receive an ::invalidated signal.
Wed May 17 22:10:47 2000 Owen Taylor <otaylor@redhat.com>
* gtk/gtklayout.c (gtk_layout_size_allocate): Set upper
to max of allocation and layout size, not just to the
layout size.
* gtk/gtk[hv]scrollbar.c (gtk_[hv]scrollbar_calc_slider_size):
Invalidate window so it gets redrawn properly.
* gdk/gdkwindow.c (gdk_window_invalidate_rect): Allow rect == NULL
to mean the entire window.
* gdk/gdkevents.h: Move definition for GDK_PRIORITY_REDRAW
into public header.
Mon May 15 14:51:31 2000 Owen Taylor <otaylor@redhat.com>
* gtk/gtktextmark.c (gtk_text_mark_get_name): Add function
to get the name of a mark.
* gtk/gtktextlayout.c (gtk_text_layout_get_line_at_y): Add a function
to find the paragraph from a y position.
Thu May 11 12:57:20 2000 Owen Taylor <otaylor@redhat.com>
* gtk/gtktextbtree.c (gtk_text_btree_node_invalidate_upward): Valid
nodes have width/height >= 0, not > 0.
Tue May 9 21:29:06 2000 Owen Taylor <otaylor@redhat.com>
* gtk/gtktextlayout.[ch] gtk/gtktextdisplay.c (gtk_text_layout_get_line_display):
Add a size_only flag, so when we only need the size, we don't create
useless appearance attributes.
* gtk/gtktextview.c (gtk_text_view_ensure_layout): Remove
duplicate setting of font description.
* gtk/gtkscale.c: Use PANGO_SCALE instead of 1000
Wed Apr 26 01:53:23 2000 Owen Taylor <otaylor@redhat.com>
* gtk/Makefile.am (EXTRA_DIST): Add OLD_STAMP into
EXTRA_DIST. It does not work well when the file that
everything depends on is not in the tarball.
Wed Apr 26 00:56:14 2000 Owen Taylor <otaylor@redhat.com>
* gtk/testgtk.c: Some hacks and fixes so that it basically
works when not sitting in the GTK+ build tree.
2000-05-03 Havoc Pennington <hp@redhat.com>
* gtk/gtktextbtree.c (gtk_text_line_next_could_contain_tag):
Properly determine the ordering of the tag root and the current
line within the tree. Previous algorithm only worked if the tag
root's immediate parent was the common root of both the current
line and the tag root.
Wed Apr 26 00:43:00 2000 Owen Taylor <otaylor@redhat.com>
* gtk/gtktextlayout.c (set_para_values): Fix some bugs in
alignment.
* gtk/gtktextview.c (gtk_text_view_ensure_layout): Track
the widget text directional dynamically.
* gtk/gtktextview.[ch]: Added functions to get and set default
wrap mode.
Tue Apr 25 23:47:38 2000 Owen Taylor <otaylor@redhat.com>
* gtk/gtktextlayout.c (gtk_text_layout_get_iter_location): Fix bug
in cursor location computation.
Tue Apr 25 23:22:59 2000 Owen Taylor <otaylor@redhat.com>
* gtk/gtklayout.c (gtk_layout_set_size): Clamp hadjustment/
vadjusment values properly when layout gets smaller.
* gtk/gtktextview.c (need_repaint_handler): Areas being
passed in are far completely inaccurate, and sometimes
too small, so, for now, just queue a redraw on the
whole visible region.
2000-04-25 Havoc Pennington <hp@redhat.com>
* gtk/gtktextbtree.c (summary_destroy): new function to
destroy tag summary nodes
(gtk_text_line_next_could_contain_tag): this function was
totally broken if the line passed in wasn't below the tag
root. Fix it.
(gtk_text_btree_first_could_contain_tag): In the tag == NULL
"wildcard" case, we have to do a linear scan. Blah.
(gtk_text_btree_last_could_contain_tag): In tag == NULL case,
we have to do the linear scan
(tag_removed_cb): When a tag is removed from the tag table,
remove the GtkTextTagInfo node from the btree.
(gtk_text_btree_spew): Implement the spew function, for
our debugging pleasure.
Tue Apr 25 19:40:18 2000 Owen Taylor <otaylor@redhat.com>
* gtk/gtktextlayout.c (gtk_text_layout_set_buffer): Fix
a problem with referring to the wrong buffer.
* gtk/gtkentry.c: Fix focus-in/focus-out confusion.
* gtk/gtkrc.c gtk/gtkstyle.c: Moving setting default
font description to gtk_style_new() - otherwise things
don't work without a .gtkrc file.
* gtk/gtktextbuffer.c (gtk_text_buffer_new): Sink the
tags table if we create it ourself, too.
* gdk/gdktypes.h (enum): Move GDK_RELEASE_MASK, since
it was conflicting with XKB modifiers.
* gtk/gtktextview.[ch]: Add simple support for
GtkIMContext.
Mon Apr 24 19:34:18 2000 Owen Taylor <otaylor@redhat.com>
* gtk/gtkentry.c (gtk_entry_move_cursor_visually): Fix problem
with deletion from last commit.
Mon Apr 24 19:29:40 2000 Owen Taylor <otaylor@redhat.com>
* gtk/gtkwidget.c (gtk_widget_create_pango_context): Set the language
in the context from the current locale.
* gtk/gtkentry.c (gtk_entry_size_request): Use language from the
context, not hardcoded value.
* gtk/gtkentry.c (gtk_entry_move_cursor): Make character movement visual,
not logical.
Sun Apr 23 23:39:18 2000 Owen Taylor <otaylor@redhat.com>
* gtk/gtkentry.c gtk/gtktextdisplay.c: Don't handle selections as
attributes - that doesn't handle partial-glyph selection
properly. Instead use new pango_layout_line_get_x_ranges()
functionality to draw the selection.
* gtk/gtkentry.c: Simplify code since pango_layout_line_index_to_x()
now properly handles out-of-range coordinates.
* gtk/gtktextbuffer.c: Emit "mark_set" when the cursor is moved.
* gtk/gtktextiter.h gtk/gtktextiterprivate.h: Make gtk_text_iter_get_line_byte()
public.
* gtk/gtktextlayout.[ch]: Properly set the direction in the PangoContext
for paragraphs opposite to the base direction of the widget.
* gtk/gtktextlayout.[ch] gtk/gtktextdisplay.c: Fixes for alignment.
* gtk/gtktextlayout.c: Don't split segments on marks, since that
causes Arabic words to reshape as you cursor through.
* gtk/gtktextlayout.[ch] gtk/gtktextview.[ch]: Implement virtual
cursor position when moving vertically with the arrow keys and
scrolling with page-up/page-down. (Arrow keys save only the X,
scrolling saves both X and Y.)
This means you can line-up / line-down or page-up / page-down
without losing your place, and also that moving vertically
with the cursor keys keeps the same X position, not the same
character count:
* gtk/gtktextlayout.[ch] gtk/gtktextview.[ch]: Make vertical
arrow keys move by display lines, not paragraphs.
Tue Apr 18 14:16:50 2000 Owen Taylor <otaylor@redhat.com>
* gtk/gtklayout.c: Make sure that the bin window is at least
as big as the allocation. (Should we also make sure that the
bin window is big enough to completely cover widget->window?)
* gtk/gtktextview.c (gtk_text_view_get_visible_rect): Add
function to get the onscreen rectangle.
* gdk/x11/gdkwindow-x11.c (gdk_window_get_pointer): Correctly account
for offsets in window coordinates.
Sun Apr 16 16:13:27 2000 Owen Taylor <otaylor@redhat.com>
* gtk/gtkentry.c (gtk_entry_get_cursor_locations): Fix index/offset
confusion.
* gtk/gtktextview.c (gtk_text_view_ensure_layout): Set the default direction
from the widget direction.
* gtk/gtktexttag.c gtk/gtktexttagprivate.h (gtk_text_tag_set_arg):
Add a "direction" attribute.
* gtk/gtktextview.c: global s/tkxt/text_view/.
* gtk/testtext.c: Added long block of text in Arabic, to test out
the direction attributes. (Some problems with the shaping system
for arabic become obvious - like the fact the cursor splits words
into unjoined pieces.)
Fri Apr 14 12:54:34 2000 Owen Taylor <otaylor@redhat.com>
* gtk/gtktextdisplay.c (render_layout): Add overstrike handling.
* gtk/gtktextlayout.c: Fix up alignment.
* gtk/testtext.c: Add some tests for centering, wrapping.
Fri Apr 14 09:26:22 2000 Owen Taylor <otaylor@redhat.com>
* gdk/gdkdrawable.h gdk/gdkdraw.c gdk/gdkwindow.c gdk/x11/gdkdrawable-x11.c:
Add a draw_glyphs() operation to the drawable vtable and gdk_draw_glyphs().
If we wrote GTK+-specific layout-render function this could just replace
the draw_layout() operation in the vtable.
* gtk/gtkentry.c: Move guts of gtk_entry_get_cursor_locations to
pango_layout_get_cursor_pos() and use that function.
* gtk/gtktextchild.[ch]: add gtk_ onto pixmap_segment_new(), since it
is a non-static symbol.
* gtk/gtktextbtree.[ch]: Replace gtk_text_btree_find_line_data_by_y()
with gtk_text_btree_find_line_by_y()
* gtk/gtktextdisplay.c: Rewrote for Pango - uses a custom layout
renderer that handles GtkTextAppearance attributes.
* gtk/gtktexttag.[ch] gtk/gtktexttagprivate.h:
- Move the values in the style that don't affect geometry into a
GtkTextAppearance structure.
- Change underline to take a PangoUnderline and "font" a string
representation of a font description
- Add a "font_desc" attribute which takes a FontDescription structure.
* gtk/gtktextlayout.[ch]:
- Get rid of the display-line list per each line. Instead, we
generate, on demand, a GtkTextLineDisplay structure which]
contains a PangoLayout * and other necesary information
(offsets, cursor locations) for displaying a paragraph.
- Get rid of the code to wrap lines, create display chunks,
etc. Instead, we just go through a paragraph and convert
it into the necessary inputs to a PangoLayout.
- Implement a new attribute type, GtkTextAttrAppearance. This
holds a GtkTextAppearance, and is used to pass colors,
stipple, etc, through from the layout to the display without
having to use lots and lots of individual attributes.
- Reimplement gtk_layout_get_iter_at_pixel() gtk_layout_get_iter_pos()
in terms of PangoLayout functions.
* gtk/gtktextview.c:
- Handle passing the necessary PangoContext to the layout
- Some fixups in painting to deal with the automatic backing store
and offsetting of GTK+-1.4
- Add a style_set handler so that the default style reacts
properly to theme changes.
* gtk/gtktext?*.[ch]: Random code-style fixes.
* gtk/testtext.c: Substitute in languages that Pango handles now for Thai
Mon Apr 10 10:33:45 2000 Owen Taylor <otaylor@redhat.com>
* gtk/gtktext?*.[ch]: Check in Havoc's port of the Tk text widget,
in original form preparatory to Pango-ization and gdkimcontext-ization.
Thu Apr 6 19:25:39 2000 Owen Taylor <otaylor@redhat.com>
* gtk/gtkimcontext.c: Move default implementations to real_* vfuncs,
so that we can derive from gtkimcontext in language bindings properly.
Thu Apr 6 16:02:52 2000 Owen Taylor <otaylor@redhat.com>
* gtk/gtkimcontextsimple.[ch]: Use gdk_keyval_to_unicode to gdk_unicode_to_keyval.
Add a compose table including (almost) all the compose combinations
from X. This is 6k of static, shared data as opposed to 50k or so of dynamic
data in the XIM implementation.
* gdk/gdk.h gdk/gdkkeyuni.c gdk/win32/gdkevents-win32.c (gdk_keyval_to_unicode, gdk_unicode_to_keyval):
Moved functions to convert keyvalues from and to unicode here from
the win32 port and made them public.
Wed Apr 5 16:37:29 2000 Owen Taylor <otaylor@redhat.com>
* gtk/gtkeditable.c (gtk_editable_insert_text): Allow new_text_length == -1.
Wed Apr 5 16:27:45 2000 Owen Taylor <otaylor@redhat.com>
* gtk/gtkimcontext.[ch]: Base class for new input context system
* gtk/gtkimmulticontext.[ch]: Proxy input context that allows
the real input context implementation to be loaded from modules
and switched on the fly.
* gtk/gtkcontextsimple.[ch]: Simple implementation of an input
context that just does direct keysymbol => unicode translation.
* gtk/gtkentry.[ch]: Start switching editing over to using
GtkInputContext. (No handling of preedit yet.)
Wed Apr 5 15:48:41 2000 Owen Taylor <otaylor@redhat.com>
* gtk/gtktypeutils.h (GTK_CHECK_GET_CLASS): Fix problem with one too
many substitutions. (klass should not be subsituted.)
Wed Apr 5 00:18:14 2000 Owen Taylor <otaylor@redhat.com>
* configure.in: Add checks for Pango
* configure.in docs/Makefile.am: Add test for sgml2html
and allow 'make dist' without building html, but print out
warnings in that case. (For making snapshots)
* gdk/Makefile.am gdk/x11/Makefile.am gtk/Makefile.am:
Add Pango libraries and C flags
* gdk/gdkdraw.c gdk/gdkdrawable.h gdkwindow.c gdk/x11/gdkdrawable-x11.c:
Add function (gdk_draw_layout) to draw a pango layout.
* gdk/gdkpango.h gdk/x11/gdkpango-x11.c: New file with functions
for getting Pango contexts for GDK.
* gtk/gtkeditable.c: Get rid of dead code gtk_editable_parent_set()
* gtk/gtkentry.[ch]: Complete rewrite to use Pango, add bidirectional
editing.
* gtk/gtkentry.c: Hack in simple Hebrew input with direct
keysym => unicode translations. More languages can be added
here, but real input-method support is needed.
* docs/Changes-1.4.txt: Added note about entry behavior.
* gtk/gtkenums.h gtk/gtkwidget.[ch] testgtk.c gtkprivate.h: Add functions
to set the reading direction for a widget and the global direction.
Add test which allows toggling the global direction. Two private
flags are used to store the direction. (GTK_DIRECTION_SET + GTK_DIRECTION_LTR)
* gtk/gtkcheckbutton.c gtk/gtkframe.c gtk/gtkhbbox.c gtk/gtkhbox.c
gtk/gtkradiobutton.c gtk/gtkspinbutton.c gtk/gtktable.c
* gtk/gtk[hv]scale.c gtk/gtkscale.[ch]: Draw numbers using Pango
* gtk/gtklabel.[ch]: Moved to Pango and considerably rewritten. Line breaking,
underlining now handled by Pango.
* gtk/gtkstyle.[ch] gtk/gtkrc.[ch]: Add a PangoFontDescription
to RCStyle and Style. (Having both this and the old font name and GdkFont
is temporary.)
* gtk/gtkwidget.[ch] (gtk_widget_create_pango_{context,layout}): Added
convenience functions for creating contexts and layouts for widgets.
* gtk/testgtk.c: Enhance label tests with multilingual labels.
2000-06-02 03:14:07 +00:00
|
|
|
|
|
2005-05-11 19:16:19 +00:00
|
|
|
|
cairo_move_to (cr,
|
|
|
|
|
(CALENDAR_MARGIN +
|
|
|
|
|
+ (gtk_widget_get_direction (widget) == GTK_TEXT_DIR_LTR ?
|
|
|
|
|
(priv->week_width + (priv->week_width ? CALENDAR_XSEP : 0))
|
|
|
|
|
: 0)
|
|
|
|
|
+ day_wid_sep * i
|
|
|
|
|
+ (day_width - logical_rect.width)/2),
|
|
|
|
|
CALENDAR_MARGIN + focus_width + focus_padding + logical_rect.y);
|
|
|
|
|
pango_cairo_show_layout (cr, layout);
|
1998-09-27 18:32:00 +00:00
|
|
|
|
}
|
Remove all references to offscreen flag which was no longer used.
Thu Jun 1 23:05:13 2000 Owen Taylor <otaylor@redhat.com>
* gtk/gtkwidget.c: Remove all references to
offscreen flag which was no longer used.
* gtk/gtkprivate.h (enum): Remove unused flags and compress.
* gtk/gtkframe.c (gtk_frame_set_label_widget): Check
for non-null label_widget->parent.
* gtk/gtkentry.c: Get rid of code to deal with PangoAttribute
which no longer was used.
* gdk/gdkpango.c (gdk_pango_context_get_info): make static.
* gdk/gdkpango.c (gdk_draw_layout[_line]): Add checks
for null arguments.
* gdk/x11/gdkgeometry-x11.c (gdk_window_scroll): add
check for destroyed windows.
Thu Jun 1 13:48:45 2000 Owen Taylor <otaylor@redhat.com>
* gtk/gtkimmulticontext.c: Add a finalize method and unref
the slave context there.
* gtk/gtkinvisible.[ch]: Make reference counting behavior
identical to GtkWindow.
Thu Jun 1 01:54:11 2000 Owen Taylor <otaylor@redhat.com>
* Makefile.am gdk/gdkpango.c: Copy the layout render function from
pangox to here, so we can write them independent of rendering
system, using GDK primitives.
* gdk/gdkdrawable.h gdk/gdkdraw.c gdk/gdkwindow.c
gdk/x11/gdkdrawable-x11.c: Remove draw_layout() from the vtable,
since we have a rendering-system independent implementation in
terms of draw_glyphs().
* gdk/gdkpango.c gdkdrawable.h (gdk_draw_layout_line): New
function to render a single line.
* gdk/x11/gdkpango.c: Move the guts of this file mostly
into ../gdkpango.c, which simplifies things, since we
don't have to deal with raw X gc's.
Fri May 19 04:28:16 2000 Owen Taylor <otaylor@redhat.com>
* gtk/gtktextlayout.[ch]: Add get_log_attrs() function to
get the logical attributes for a given GtkTextLine.
Tue May 30 16:05:39 2000 Owen Taylor <otaylor@redhat.com>
* gdk/x11/gdkfont-x11.c (gdk_font_charset_for_locale): Track
g_locale_get_codeset() to g_get_codeset() change.
Tue May 30 15:03:19 2000 Owen Taylor <otaylor@redhat.com>
* gtk/testcalendar.c (calendar_font_selection_ok): Use font
descriptions.
* gtk/gtkentry.c (gtk_entry_draw_text): Center text within
the entry.
* gtk/gtkfontsel.c (gtk_font_selection_dialog_init): Start of
redoing (vastly simplifying) for Pango. Still needs quite
a bit of work. (Size selection is currently poor. List of
predefined sizes is not a good idea, since all of these
sizes won't necessarily be distinct.)
Tue May 30 13:50:19 2000 Owen Taylor <otaylor@redhat.com>
* gdk/x11/gdkfont-x11.c (gdk_font_charset_for_locale): Handle
CODESET results for LANG=C.
Mon May 29 15:49:10 2000 Owen Taylor <otaylor@redhat.com>
* gtk/gtkrc.[ch]: Add a 'font_name' declaration to RC
which takes a stringized pango font description;
ignore the older 'font' and 'fontset' declarations.
* gtk/gtkstyle.c gtk/gtkrc.c: Fill in the style->font
field with a GdkFont derived via gdk_font_from_description(),
for compatibility. (Should we just remove it entirely?
Probably too much compatibility breakage, but people
should be migrating to the new Pango stuff as quickly
as possible.)
Mon May 29 15:47:41 2000 Owen Taylor <otaylor@redhat.com>
* gtk/gtkentry.c gtk/gtkclist.c: s/pango_font_unref/g_object_unref/.
Mon May 29 15:44:46 2000 Owen Taylor <otaylor@redhat.com>
* gtk/gtkcalender.c: Roughly pango-ized. Really needs
redoing; there are some bugs in size allocation right
now, the semi-existant distinction between header / day
fonts was removed, but, with Pango, could actually
be made functional in a nice way.
* gtk/testcalender: Move calender from examples into this
directory as a test program. (We really need to restrcture
testgtk into a whole directory full of tests for every
widget or functionality group, separated into multiple .c
files.)
Mon May 29 15:19:56 2000 Owen Taylor <otaylor@redhat.com>
* gtk/testgtk.c (file_exists): Fix stupid typo that
was keeping RC file from being loaded.
* gtk/testgtkrc gtk/testgtkrc2: Test new pango-ized
RC file font code.
Mon May 29 14:31:27 2000 Owen Taylor <otaylor@redhat.com>
* gdk/gdkfont.h gdk/x11/gdkfont-x11.c (gdk_font_from_description):
Add function to load a GdkFont from a PangoFontDescription.
Fri May 26 17:16:40 2000 Owen Taylor <otaylor@redhat.com>
* gtk/frame.[ch] gtkaspectframe.c: Make frame widgets able
to have any widget for the label, use a GtkLabel widget
to display the text. (Based partially on a patch from
Anders Carlson.)
(Quite a bit of code reorganization - strip 90% of the
guts out of gtkaspectframe and add a single virtual
func to GtkFrameClass - compute_child_allocation.)
Fri May 26 12:00:02 2000 Owen Taylor <otaylor@redhat.com>
* gtk/gtkctree.c gtk/gtkclist.[ch]: Pangoized.
(Removed clist->row_center_offset field because caching
it wasn't saving time or code, added private function
_gtk_clist_create_cell_layout()).
Wed May 24 15:59:37 2000 Owen Taylor <otaylor@redhat.com>
* gtk/gtkaccellabel.c: Pangoized.
* gtk/[hv]ruler.c: Pangoized
Mon May 22 19:23:59 2000 Owen Taylor <otaylor@redhat.com>
* gtk/gtkfilesel.c (gtk_file_selection_init):
Use gtk_clist_set_column_auto_resize() to remove need
need for manual column width computations.
Mon May 22 18:50:26 2000 Owen Taylor <otaylor@redhat.com>
* gtk/gtktooltips.[ch]: Replace custom drawing with a GtkLabel,
ensuring Pango correctness, and considerably simplifying the
code.
* gtk/gtklabel.c gtk[hv]scale.c: 1000 => PANGO_SCALE.
* gtk/gtklabel.c (gtk_label_size_request): Fixed incorrect
getting of numbers of lines.
* gtk/gtklabel.c (gtk_label_size_request): Set the requisition
to the actual requested width of the lable, not to the wrap
width we set.
* gtk/gtktextchild.h: Remove extraneous include of gtk/gtk.h.
* gtk/gtktextbtree.c gtk/gtktextbuffer.c gtk/gtktextlayout.c
gtk/gtktextview.c gtk/gtktextview.[ch]: Fix up includes.
* gtk/gtktextview.c: Fix structure inheritance.
* gtk/gtkprogressbar.c: Pangoize.
Mon May 22 15:47:30 2000 Owen Taylor <otaylor@redhat.com>
* gtk/gtktextview.c (gtk_text_view_get_first_para_iter): Encapsulate
in a function.
* gtk/gtktextlayout.c (find_display_line_above): Fixed
bug with computing line tops.
* gtk/gtktextview.c (changed_handler): Fix < , <= confusion.
Thu May 18 18:53:31 2000 Owen Taylor <otaylor@redhat.com>
* gtk/gtktextdisplay.c (gtk_text_layout_draw): Fix up the x_offset
and y_offset coordinates to do what we need now. (The offset between
buffer and layout coordinates has been reintroduced, but is a
bit different than before.)
* gtk/gtktextview.[ch]: No longer inherit from GtkLayout; instead
handle the adjustments ourselves, and scroll as necessary using
the new gdk_window_scroll().
The advantage of this is that when we are incrementally revalidating,
we are essentially rearranging things around the visible portion
of the screen. With the old setup, the visible portion of the
screen was moved around in the layout, so scrolling and redrawing
to track that caused jumping of the display. Since we now
control the scrolling ourselves, we can suppress this and
only redraw when things actually change.
Thu May 18 18:47:25 2000 Owen Taylor <otaylor@redhat.com>
* gtk/gtktextbtree.c (redisplay_mark): We need to invalidate
the region not just redisplay it after-all, since we store the
cursors in the LineDisplay. (Ugly interactions here between
GtkLayout and GtkTextBTree here.)
* gtk/gtktextbtree.c (redisplay_region): Fixed reversed comparison.
Thu May 18 18:43:21 2000 Owen Taylor <otaylor@redhat.com>
* gdk/gdkwindow.h gdk/x11/gdkgeometry-x11.c (gdk_window_scroll):
Added function to scroll contents of a window while keeping the
window constant. Works by XCopyArea or guffaw-scrolling depending
on the details of how the window is set up. (guffaw-scrolling
still needs to be filled in.)
Wed May 17 22:36:53 2000 Owen Taylor <otaylor@redhat.com>
* gtk/gtktextiter.c gtk/gtkmain.c: Add a debug key for the text widget,
move the debugging that was tied to a global variable
to that.
* gtk/gtkmarshal.list: Add NONE:INT,INT,INT
* gtk/gtktextbtree.[ch] gtk/gtktextlayout.c: Keep a separate
validated flag, in line data instead of setting height/width to
-1. This allows us to perform operations with partially invalid
buffer (using the old size for invalid lines) and thus to do
incremental vaidation. Keep height/width aggregates up to date
when deleting text and rebalancing the tree.
* gtk/gtktextbtree.[ch]: Add functions validate a line
(gtk_text_btree_validate_line), and to validate up
to a number of pixels (gtk_text_btree_validate).
* gtk/gtktextlayout.[ch]: Add an ::invalidated signal
that indicates that something is changed and a revalidation
pass is needed. Change ::need_repaint to ::changed, and
make it take old and new yranges instead of a rectangle.
* gtk/gtktextbtree.[ch] gtk/gtktextlayout.[ch]: Move
the line_data_destroy() function from
gtk_text_btree_add_view() to a virtual function in
GtkTextLayout
* gtk/gtktextbtree.[ch]: Remove gtk_text_btree_get_damage_range(),
since we are handling partial repaints in a different fashion
now.
* gtk/gtktextbtree.[ch]: Only repaint the changed portion
of the selection instead of queueing a repaint on the
entire widget.
* gtk/gtktextbuffer.[ch] gtk/gtktextbtree.[ch]: Move
get_selection_bounds() down to btree, make the function
in buffer a wrapper around the btree function.
* gtk/gtktextlayout.[ch]: Add functions to check if the
layout is valid and to recompute either a range of pixels
aroudn a line or a certain total number of pixels.
* gtk/gtktextlayout.[ch]: Cache a single line display;
now that we only redraw the needed portions, the hit rate
for this cache is quite high.
* gtk/gtktextview.[ch]: Keep track of the first paragraph
on the screen so that when re-laying-out the buffer, we can
keep the same place. This requires connecting to ::value_changed
on the adjustments
* gtk/gtktextview.[ch]: Add idle functions to revalidate
the buffer after we receive an ::invalidated signal.
Wed May 17 22:10:47 2000 Owen Taylor <otaylor@redhat.com>
* gtk/gtklayout.c (gtk_layout_size_allocate): Set upper
to max of allocation and layout size, not just to the
layout size.
* gtk/gtk[hv]scrollbar.c (gtk_[hv]scrollbar_calc_slider_size):
Invalidate window so it gets redrawn properly.
* gdk/gdkwindow.c (gdk_window_invalidate_rect): Allow rect == NULL
to mean the entire window.
* gdk/gdkevents.h: Move definition for GDK_PRIORITY_REDRAW
into public header.
Mon May 15 14:51:31 2000 Owen Taylor <otaylor@redhat.com>
* gtk/gtktextmark.c (gtk_text_mark_get_name): Add function
to get the name of a mark.
* gtk/gtktextlayout.c (gtk_text_layout_get_line_at_y): Add a function
to find the paragraph from a y position.
Thu May 11 12:57:20 2000 Owen Taylor <otaylor@redhat.com>
* gtk/gtktextbtree.c (gtk_text_btree_node_invalidate_upward): Valid
nodes have width/height >= 0, not > 0.
Tue May 9 21:29:06 2000 Owen Taylor <otaylor@redhat.com>
* gtk/gtktextlayout.[ch] gtk/gtktextdisplay.c (gtk_text_layout_get_line_display):
Add a size_only flag, so when we only need the size, we don't create
useless appearance attributes.
* gtk/gtktextview.c (gtk_text_view_ensure_layout): Remove
duplicate setting of font description.
* gtk/gtkscale.c: Use PANGO_SCALE instead of 1000
Wed Apr 26 01:53:23 2000 Owen Taylor <otaylor@redhat.com>
* gtk/Makefile.am (EXTRA_DIST): Add OLD_STAMP into
EXTRA_DIST. It does not work well when the file that
everything depends on is not in the tarball.
Wed Apr 26 00:56:14 2000 Owen Taylor <otaylor@redhat.com>
* gtk/testgtk.c: Some hacks and fixes so that it basically
works when not sitting in the GTK+ build tree.
2000-05-03 Havoc Pennington <hp@redhat.com>
* gtk/gtktextbtree.c (gtk_text_line_next_could_contain_tag):
Properly determine the ordering of the tag root and the current
line within the tree. Previous algorithm only worked if the tag
root's immediate parent was the common root of both the current
line and the tag root.
Wed Apr 26 00:43:00 2000 Owen Taylor <otaylor@redhat.com>
* gtk/gtktextlayout.c (set_para_values): Fix some bugs in
alignment.
* gtk/gtktextview.c (gtk_text_view_ensure_layout): Track
the widget text directional dynamically.
* gtk/gtktextview.[ch]: Added functions to get and set default
wrap mode.
Tue Apr 25 23:47:38 2000 Owen Taylor <otaylor@redhat.com>
* gtk/gtktextlayout.c (gtk_text_layout_get_iter_location): Fix bug
in cursor location computation.
Tue Apr 25 23:22:59 2000 Owen Taylor <otaylor@redhat.com>
* gtk/gtklayout.c (gtk_layout_set_size): Clamp hadjustment/
vadjusment values properly when layout gets smaller.
* gtk/gtktextview.c (need_repaint_handler): Areas being
passed in are far completely inaccurate, and sometimes
too small, so, for now, just queue a redraw on the
whole visible region.
2000-04-25 Havoc Pennington <hp@redhat.com>
* gtk/gtktextbtree.c (summary_destroy): new function to
destroy tag summary nodes
(gtk_text_line_next_could_contain_tag): this function was
totally broken if the line passed in wasn't below the tag
root. Fix it.
(gtk_text_btree_first_could_contain_tag): In the tag == NULL
"wildcard" case, we have to do a linear scan. Blah.
(gtk_text_btree_last_could_contain_tag): In tag == NULL case,
we have to do the linear scan
(tag_removed_cb): When a tag is removed from the tag table,
remove the GtkTextTagInfo node from the btree.
(gtk_text_btree_spew): Implement the spew function, for
our debugging pleasure.
Tue Apr 25 19:40:18 2000 Owen Taylor <otaylor@redhat.com>
* gtk/gtktextlayout.c (gtk_text_layout_set_buffer): Fix
a problem with referring to the wrong buffer.
* gtk/gtkentry.c: Fix focus-in/focus-out confusion.
* gtk/gtkrc.c gtk/gtkstyle.c: Moving setting default
font description to gtk_style_new() - otherwise things
don't work without a .gtkrc file.
* gtk/gtktextbuffer.c (gtk_text_buffer_new): Sink the
tags table if we create it ourself, too.
* gdk/gdktypes.h (enum): Move GDK_RELEASE_MASK, since
it was conflicting with XKB modifiers.
* gtk/gtktextview.[ch]: Add simple support for
GtkIMContext.
Mon Apr 24 19:34:18 2000 Owen Taylor <otaylor@redhat.com>
* gtk/gtkentry.c (gtk_entry_move_cursor_visually): Fix problem
with deletion from last commit.
Mon Apr 24 19:29:40 2000 Owen Taylor <otaylor@redhat.com>
* gtk/gtkwidget.c (gtk_widget_create_pango_context): Set the language
in the context from the current locale.
* gtk/gtkentry.c (gtk_entry_size_request): Use language from the
context, not hardcoded value.
* gtk/gtkentry.c (gtk_entry_move_cursor): Make character movement visual,
not logical.
Sun Apr 23 23:39:18 2000 Owen Taylor <otaylor@redhat.com>
* gtk/gtkentry.c gtk/gtktextdisplay.c: Don't handle selections as
attributes - that doesn't handle partial-glyph selection
properly. Instead use new pango_layout_line_get_x_ranges()
functionality to draw the selection.
* gtk/gtkentry.c: Simplify code since pango_layout_line_index_to_x()
now properly handles out-of-range coordinates.
* gtk/gtktextbuffer.c: Emit "mark_set" when the cursor is moved.
* gtk/gtktextiter.h gtk/gtktextiterprivate.h: Make gtk_text_iter_get_line_byte()
public.
* gtk/gtktextlayout.[ch]: Properly set the direction in the PangoContext
for paragraphs opposite to the base direction of the widget.
* gtk/gtktextlayout.[ch] gtk/gtktextdisplay.c: Fixes for alignment.
* gtk/gtktextlayout.c: Don't split segments on marks, since that
causes Arabic words to reshape as you cursor through.
* gtk/gtktextlayout.[ch] gtk/gtktextview.[ch]: Implement virtual
cursor position when moving vertically with the arrow keys and
scrolling with page-up/page-down. (Arrow keys save only the X,
scrolling saves both X and Y.)
This means you can line-up / line-down or page-up / page-down
without losing your place, and also that moving vertically
with the cursor keys keeps the same X position, not the same
character count:
* gtk/gtktextlayout.[ch] gtk/gtktextview.[ch]: Make vertical
arrow keys move by display lines, not paragraphs.
Tue Apr 18 14:16:50 2000 Owen Taylor <otaylor@redhat.com>
* gtk/gtklayout.c: Make sure that the bin window is at least
as big as the allocation. (Should we also make sure that the
bin window is big enough to completely cover widget->window?)
* gtk/gtktextview.c (gtk_text_view_get_visible_rect): Add
function to get the onscreen rectangle.
* gdk/x11/gdkwindow-x11.c (gdk_window_get_pointer): Correctly account
for offsets in window coordinates.
Sun Apr 16 16:13:27 2000 Owen Taylor <otaylor@redhat.com>
* gtk/gtkentry.c (gtk_entry_get_cursor_locations): Fix index/offset
confusion.
* gtk/gtktextview.c (gtk_text_view_ensure_layout): Set the default direction
from the widget direction.
* gtk/gtktexttag.c gtk/gtktexttagprivate.h (gtk_text_tag_set_arg):
Add a "direction" attribute.
* gtk/gtktextview.c: global s/tkxt/text_view/.
* gtk/testtext.c: Added long block of text in Arabic, to test out
the direction attributes. (Some problems with the shaping system
for arabic become obvious - like the fact the cursor splits words
into unjoined pieces.)
Fri Apr 14 12:54:34 2000 Owen Taylor <otaylor@redhat.com>
* gtk/gtktextdisplay.c (render_layout): Add overstrike handling.
* gtk/gtktextlayout.c: Fix up alignment.
* gtk/testtext.c: Add some tests for centering, wrapping.
Fri Apr 14 09:26:22 2000 Owen Taylor <otaylor@redhat.com>
* gdk/gdkdrawable.h gdk/gdkdraw.c gdk/gdkwindow.c gdk/x11/gdkdrawable-x11.c:
Add a draw_glyphs() operation to the drawable vtable and gdk_draw_glyphs().
If we wrote GTK+-specific layout-render function this could just replace
the draw_layout() operation in the vtable.
* gtk/gtkentry.c: Move guts of gtk_entry_get_cursor_locations to
pango_layout_get_cursor_pos() and use that function.
* gtk/gtktextchild.[ch]: add gtk_ onto pixmap_segment_new(), since it
is a non-static symbol.
* gtk/gtktextbtree.[ch]: Replace gtk_text_btree_find_line_data_by_y()
with gtk_text_btree_find_line_by_y()
* gtk/gtktextdisplay.c: Rewrote for Pango - uses a custom layout
renderer that handles GtkTextAppearance attributes.
* gtk/gtktexttag.[ch] gtk/gtktexttagprivate.h:
- Move the values in the style that don't affect geometry into a
GtkTextAppearance structure.
- Change underline to take a PangoUnderline and "font" a string
representation of a font description
- Add a "font_desc" attribute which takes a FontDescription structure.
* gtk/gtktextlayout.[ch]:
- Get rid of the display-line list per each line. Instead, we
generate, on demand, a GtkTextLineDisplay structure which]
contains a PangoLayout * and other necesary information
(offsets, cursor locations) for displaying a paragraph.
- Get rid of the code to wrap lines, create display chunks,
etc. Instead, we just go through a paragraph and convert
it into the necessary inputs to a PangoLayout.
- Implement a new attribute type, GtkTextAttrAppearance. This
holds a GtkTextAppearance, and is used to pass colors,
stipple, etc, through from the layout to the display without
having to use lots and lots of individual attributes.
- Reimplement gtk_layout_get_iter_at_pixel() gtk_layout_get_iter_pos()
in terms of PangoLayout functions.
* gtk/gtktextview.c:
- Handle passing the necessary PangoContext to the layout
- Some fixups in painting to deal with the automatic backing store
and offsetting of GTK+-1.4
- Add a style_set handler so that the default style reacts
properly to theme changes.
* gtk/gtktext?*.[ch]: Random code-style fixes.
* gtk/testtext.c: Substitute in languages that Pango handles now for Thai
Mon Apr 10 10:33:45 2000 Owen Taylor <otaylor@redhat.com>
* gtk/gtktext?*.[ch]: Check in Havoc's port of the Tk text widget,
in original form preparatory to Pango-ization and gdkimcontext-ization.
Thu Apr 6 19:25:39 2000 Owen Taylor <otaylor@redhat.com>
* gtk/gtkimcontext.c: Move default implementations to real_* vfuncs,
so that we can derive from gtkimcontext in language bindings properly.
Thu Apr 6 16:02:52 2000 Owen Taylor <otaylor@redhat.com>
* gtk/gtkimcontextsimple.[ch]: Use gdk_keyval_to_unicode to gdk_unicode_to_keyval.
Add a compose table including (almost) all the compose combinations
from X. This is 6k of static, shared data as opposed to 50k or so of dynamic
data in the XIM implementation.
* gdk/gdk.h gdk/gdkkeyuni.c gdk/win32/gdkevents-win32.c (gdk_keyval_to_unicode, gdk_unicode_to_keyval):
Moved functions to convert keyvalues from and to unicode here from
the win32 port and made them public.
Wed Apr 5 16:37:29 2000 Owen Taylor <otaylor@redhat.com>
* gtk/gtkeditable.c (gtk_editable_insert_text): Allow new_text_length == -1.
Wed Apr 5 16:27:45 2000 Owen Taylor <otaylor@redhat.com>
* gtk/gtkimcontext.[ch]: Base class for new input context system
* gtk/gtkimmulticontext.[ch]: Proxy input context that allows
the real input context implementation to be loaded from modules
and switched on the fly.
* gtk/gtkcontextsimple.[ch]: Simple implementation of an input
context that just does direct keysymbol => unicode translation.
* gtk/gtkentry.[ch]: Start switching editing over to using
GtkInputContext. (No handling of preedit yet.)
Wed Apr 5 15:48:41 2000 Owen Taylor <otaylor@redhat.com>
* gtk/gtktypeutils.h (GTK_CHECK_GET_CLASS): Fix problem with one too
many substitutions. (klass should not be subsituted.)
Wed Apr 5 00:18:14 2000 Owen Taylor <otaylor@redhat.com>
* configure.in: Add checks for Pango
* configure.in docs/Makefile.am: Add test for sgml2html
and allow 'make dist' without building html, but print out
warnings in that case. (For making snapshots)
* gdk/Makefile.am gdk/x11/Makefile.am gtk/Makefile.am:
Add Pango libraries and C flags
* gdk/gdkdraw.c gdk/gdkdrawable.h gdkwindow.c gdk/x11/gdkdrawable-x11.c:
Add function (gdk_draw_layout) to draw a pango layout.
* gdk/gdkpango.h gdk/x11/gdkpango-x11.c: New file with functions
for getting Pango contexts for GDK.
* gtk/gtkeditable.c: Get rid of dead code gtk_editable_parent_set()
* gtk/gtkentry.[ch]: Complete rewrite to use Pango, add bidirectional
editing.
* gtk/gtkentry.c: Hack in simple Hebrew input with direct
keysym => unicode translations. More languages can be added
here, but real input-method support is needed.
* docs/Changes-1.4.txt: Added note about entry behavior.
* gtk/gtkenums.h gtk/gtkwidget.[ch] testgtk.c gtkprivate.h: Add functions
to set the reading direction for a widget and the global direction.
Add test which allows toggling the global direction. Two private
flags are used to store the direction. (GTK_DIRECTION_SET + GTK_DIRECTION_LTR)
* gtk/gtkcheckbutton.c gtk/gtkframe.c gtk/gtkhbbox.c gtk/gtkhbox.c
gtk/gtkradiobutton.c gtk/gtkspinbutton.c gtk/gtktable.c
* gtk/gtk[hv]scale.c gtk/gtkscale.[ch]: Draw numbers using Pango
* gtk/gtklabel.[ch]: Moved to Pango and considerably rewritten. Line breaking,
underlining now handled by Pango.
* gtk/gtkstyle.[ch] gtk/gtkrc.[ch]: Add a PangoFontDescription
to RCStyle and Style. (Having both this and the old font name and GdkFont
is temporary.)
* gtk/gtkwidget.[ch] (gtk_widget_create_pango_{context,layout}): Added
convenience functions for creating contexts and layouts for widgets.
* gtk/testgtk.c: Enhance label tests with multilingual labels.
2000-06-02 03:14:07 +00:00
|
|
|
|
|
2002-10-09 22:11:08 +00:00
|
|
|
|
g_object_unref (layout);
|
2005-05-11 19:16:19 +00:00
|
|
|
|
cairo_destroy (cr);
|
1998-09-27 18:32:00 +00:00
|
|
|
|
}
|
|
|
|
|
|
1998-10-01 13:24:42 +00:00
|
|
|
|
static void
|
2005-05-11 19:16:19 +00:00
|
|
|
|
calendar_paint_week_numbers (GtkCalendar *calendar)
|
1998-09-27 18:32:00 +00:00
|
|
|
|
{
|
2005-05-11 19:16:19 +00:00
|
|
|
|
GtkWidget *widget = GTK_WIDGET (calendar);
|
|
|
|
|
GtkCalendarPrivate *priv = GTK_CALENDAR_GET_PRIVATE (calendar);
|
|
|
|
|
cairo_t *cr;
|
2007-12-19 22:57:01 +00:00
|
|
|
|
|
|
|
|
|
guint week = 0, year;
|
|
|
|
|
gint row, x_loc, y_loc;
|
|
|
|
|
gint day_height;
|
2006-01-26 20:40:18 +00:00
|
|
|
|
char buffer[32];
|
Remove all references to offscreen flag which was no longer used.
Thu Jun 1 23:05:13 2000 Owen Taylor <otaylor@redhat.com>
* gtk/gtkwidget.c: Remove all references to
offscreen flag which was no longer used.
* gtk/gtkprivate.h (enum): Remove unused flags and compress.
* gtk/gtkframe.c (gtk_frame_set_label_widget): Check
for non-null label_widget->parent.
* gtk/gtkentry.c: Get rid of code to deal with PangoAttribute
which no longer was used.
* gdk/gdkpango.c (gdk_pango_context_get_info): make static.
* gdk/gdkpango.c (gdk_draw_layout[_line]): Add checks
for null arguments.
* gdk/x11/gdkgeometry-x11.c (gdk_window_scroll): add
check for destroyed windows.
Thu Jun 1 13:48:45 2000 Owen Taylor <otaylor@redhat.com>
* gtk/gtkimmulticontext.c: Add a finalize method and unref
the slave context there.
* gtk/gtkinvisible.[ch]: Make reference counting behavior
identical to GtkWindow.
Thu Jun 1 01:54:11 2000 Owen Taylor <otaylor@redhat.com>
* Makefile.am gdk/gdkpango.c: Copy the layout render function from
pangox to here, so we can write them independent of rendering
system, using GDK primitives.
* gdk/gdkdrawable.h gdk/gdkdraw.c gdk/gdkwindow.c
gdk/x11/gdkdrawable-x11.c: Remove draw_layout() from the vtable,
since we have a rendering-system independent implementation in
terms of draw_glyphs().
* gdk/gdkpango.c gdkdrawable.h (gdk_draw_layout_line): New
function to render a single line.
* gdk/x11/gdkpango.c: Move the guts of this file mostly
into ../gdkpango.c, which simplifies things, since we
don't have to deal with raw X gc's.
Fri May 19 04:28:16 2000 Owen Taylor <otaylor@redhat.com>
* gtk/gtktextlayout.[ch]: Add get_log_attrs() function to
get the logical attributes for a given GtkTextLine.
Tue May 30 16:05:39 2000 Owen Taylor <otaylor@redhat.com>
* gdk/x11/gdkfont-x11.c (gdk_font_charset_for_locale): Track
g_locale_get_codeset() to g_get_codeset() change.
Tue May 30 15:03:19 2000 Owen Taylor <otaylor@redhat.com>
* gtk/testcalendar.c (calendar_font_selection_ok): Use font
descriptions.
* gtk/gtkentry.c (gtk_entry_draw_text): Center text within
the entry.
* gtk/gtkfontsel.c (gtk_font_selection_dialog_init): Start of
redoing (vastly simplifying) for Pango. Still needs quite
a bit of work. (Size selection is currently poor. List of
predefined sizes is not a good idea, since all of these
sizes won't necessarily be distinct.)
Tue May 30 13:50:19 2000 Owen Taylor <otaylor@redhat.com>
* gdk/x11/gdkfont-x11.c (gdk_font_charset_for_locale): Handle
CODESET results for LANG=C.
Mon May 29 15:49:10 2000 Owen Taylor <otaylor@redhat.com>
* gtk/gtkrc.[ch]: Add a 'font_name' declaration to RC
which takes a stringized pango font description;
ignore the older 'font' and 'fontset' declarations.
* gtk/gtkstyle.c gtk/gtkrc.c: Fill in the style->font
field with a GdkFont derived via gdk_font_from_description(),
for compatibility. (Should we just remove it entirely?
Probably too much compatibility breakage, but people
should be migrating to the new Pango stuff as quickly
as possible.)
Mon May 29 15:47:41 2000 Owen Taylor <otaylor@redhat.com>
* gtk/gtkentry.c gtk/gtkclist.c: s/pango_font_unref/g_object_unref/.
Mon May 29 15:44:46 2000 Owen Taylor <otaylor@redhat.com>
* gtk/gtkcalender.c: Roughly pango-ized. Really needs
redoing; there are some bugs in size allocation right
now, the semi-existant distinction between header / day
fonts was removed, but, with Pango, could actually
be made functional in a nice way.
* gtk/testcalender: Move calender from examples into this
directory as a test program. (We really need to restrcture
testgtk into a whole directory full of tests for every
widget or functionality group, separated into multiple .c
files.)
Mon May 29 15:19:56 2000 Owen Taylor <otaylor@redhat.com>
* gtk/testgtk.c (file_exists): Fix stupid typo that
was keeping RC file from being loaded.
* gtk/testgtkrc gtk/testgtkrc2: Test new pango-ized
RC file font code.
Mon May 29 14:31:27 2000 Owen Taylor <otaylor@redhat.com>
* gdk/gdkfont.h gdk/x11/gdkfont-x11.c (gdk_font_from_description):
Add function to load a GdkFont from a PangoFontDescription.
Fri May 26 17:16:40 2000 Owen Taylor <otaylor@redhat.com>
* gtk/frame.[ch] gtkaspectframe.c: Make frame widgets able
to have any widget for the label, use a GtkLabel widget
to display the text. (Based partially on a patch from
Anders Carlson.)
(Quite a bit of code reorganization - strip 90% of the
guts out of gtkaspectframe and add a single virtual
func to GtkFrameClass - compute_child_allocation.)
Fri May 26 12:00:02 2000 Owen Taylor <otaylor@redhat.com>
* gtk/gtkctree.c gtk/gtkclist.[ch]: Pangoized.
(Removed clist->row_center_offset field because caching
it wasn't saving time or code, added private function
_gtk_clist_create_cell_layout()).
Wed May 24 15:59:37 2000 Owen Taylor <otaylor@redhat.com>
* gtk/gtkaccellabel.c: Pangoized.
* gtk/[hv]ruler.c: Pangoized
Mon May 22 19:23:59 2000 Owen Taylor <otaylor@redhat.com>
* gtk/gtkfilesel.c (gtk_file_selection_init):
Use gtk_clist_set_column_auto_resize() to remove need
need for manual column width computations.
Mon May 22 18:50:26 2000 Owen Taylor <otaylor@redhat.com>
* gtk/gtktooltips.[ch]: Replace custom drawing with a GtkLabel,
ensuring Pango correctness, and considerably simplifying the
code.
* gtk/gtklabel.c gtk[hv]scale.c: 1000 => PANGO_SCALE.
* gtk/gtklabel.c (gtk_label_size_request): Fixed incorrect
getting of numbers of lines.
* gtk/gtklabel.c (gtk_label_size_request): Set the requisition
to the actual requested width of the lable, not to the wrap
width we set.
* gtk/gtktextchild.h: Remove extraneous include of gtk/gtk.h.
* gtk/gtktextbtree.c gtk/gtktextbuffer.c gtk/gtktextlayout.c
gtk/gtktextview.c gtk/gtktextview.[ch]: Fix up includes.
* gtk/gtktextview.c: Fix structure inheritance.
* gtk/gtkprogressbar.c: Pangoize.
Mon May 22 15:47:30 2000 Owen Taylor <otaylor@redhat.com>
* gtk/gtktextview.c (gtk_text_view_get_first_para_iter): Encapsulate
in a function.
* gtk/gtktextlayout.c (find_display_line_above): Fixed
bug with computing line tops.
* gtk/gtktextview.c (changed_handler): Fix < , <= confusion.
Thu May 18 18:53:31 2000 Owen Taylor <otaylor@redhat.com>
* gtk/gtktextdisplay.c (gtk_text_layout_draw): Fix up the x_offset
and y_offset coordinates to do what we need now. (The offset between
buffer and layout coordinates has been reintroduced, but is a
bit different than before.)
* gtk/gtktextview.[ch]: No longer inherit from GtkLayout; instead
handle the adjustments ourselves, and scroll as necessary using
the new gdk_window_scroll().
The advantage of this is that when we are incrementally revalidating,
we are essentially rearranging things around the visible portion
of the screen. With the old setup, the visible portion of the
screen was moved around in the layout, so scrolling and redrawing
to track that caused jumping of the display. Since we now
control the scrolling ourselves, we can suppress this and
only redraw when things actually change.
Thu May 18 18:47:25 2000 Owen Taylor <otaylor@redhat.com>
* gtk/gtktextbtree.c (redisplay_mark): We need to invalidate
the region not just redisplay it after-all, since we store the
cursors in the LineDisplay. (Ugly interactions here between
GtkLayout and GtkTextBTree here.)
* gtk/gtktextbtree.c (redisplay_region): Fixed reversed comparison.
Thu May 18 18:43:21 2000 Owen Taylor <otaylor@redhat.com>
* gdk/gdkwindow.h gdk/x11/gdkgeometry-x11.c (gdk_window_scroll):
Added function to scroll contents of a window while keeping the
window constant. Works by XCopyArea or guffaw-scrolling depending
on the details of how the window is set up. (guffaw-scrolling
still needs to be filled in.)
Wed May 17 22:36:53 2000 Owen Taylor <otaylor@redhat.com>
* gtk/gtktextiter.c gtk/gtkmain.c: Add a debug key for the text widget,
move the debugging that was tied to a global variable
to that.
* gtk/gtkmarshal.list: Add NONE:INT,INT,INT
* gtk/gtktextbtree.[ch] gtk/gtktextlayout.c: Keep a separate
validated flag, in line data instead of setting height/width to
-1. This allows us to perform operations with partially invalid
buffer (using the old size for invalid lines) and thus to do
incremental vaidation. Keep height/width aggregates up to date
when deleting text and rebalancing the tree.
* gtk/gtktextbtree.[ch]: Add functions validate a line
(gtk_text_btree_validate_line), and to validate up
to a number of pixels (gtk_text_btree_validate).
* gtk/gtktextlayout.[ch]: Add an ::invalidated signal
that indicates that something is changed and a revalidation
pass is needed. Change ::need_repaint to ::changed, and
make it take old and new yranges instead of a rectangle.
* gtk/gtktextbtree.[ch] gtk/gtktextlayout.[ch]: Move
the line_data_destroy() function from
gtk_text_btree_add_view() to a virtual function in
GtkTextLayout
* gtk/gtktextbtree.[ch]: Remove gtk_text_btree_get_damage_range(),
since we are handling partial repaints in a different fashion
now.
* gtk/gtktextbtree.[ch]: Only repaint the changed portion
of the selection instead of queueing a repaint on the
entire widget.
* gtk/gtktextbuffer.[ch] gtk/gtktextbtree.[ch]: Move
get_selection_bounds() down to btree, make the function
in buffer a wrapper around the btree function.
* gtk/gtktextlayout.[ch]: Add functions to check if the
layout is valid and to recompute either a range of pixels
aroudn a line or a certain total number of pixels.
* gtk/gtktextlayout.[ch]: Cache a single line display;
now that we only redraw the needed portions, the hit rate
for this cache is quite high.
* gtk/gtktextview.[ch]: Keep track of the first paragraph
on the screen so that when re-laying-out the buffer, we can
keep the same place. This requires connecting to ::value_changed
on the adjustments
* gtk/gtktextview.[ch]: Add idle functions to revalidate
the buffer after we receive an ::invalidated signal.
Wed May 17 22:10:47 2000 Owen Taylor <otaylor@redhat.com>
* gtk/gtklayout.c (gtk_layout_size_allocate): Set upper
to max of allocation and layout size, not just to the
layout size.
* gtk/gtk[hv]scrollbar.c (gtk_[hv]scrollbar_calc_slider_size):
Invalidate window so it gets redrawn properly.
* gdk/gdkwindow.c (gdk_window_invalidate_rect): Allow rect == NULL
to mean the entire window.
* gdk/gdkevents.h: Move definition for GDK_PRIORITY_REDRAW
into public header.
Mon May 15 14:51:31 2000 Owen Taylor <otaylor@redhat.com>
* gtk/gtktextmark.c (gtk_text_mark_get_name): Add function
to get the name of a mark.
* gtk/gtktextlayout.c (gtk_text_layout_get_line_at_y): Add a function
to find the paragraph from a y position.
Thu May 11 12:57:20 2000 Owen Taylor <otaylor@redhat.com>
* gtk/gtktextbtree.c (gtk_text_btree_node_invalidate_upward): Valid
nodes have width/height >= 0, not > 0.
Tue May 9 21:29:06 2000 Owen Taylor <otaylor@redhat.com>
* gtk/gtktextlayout.[ch] gtk/gtktextdisplay.c (gtk_text_layout_get_line_display):
Add a size_only flag, so when we only need the size, we don't create
useless appearance attributes.
* gtk/gtktextview.c (gtk_text_view_ensure_layout): Remove
duplicate setting of font description.
* gtk/gtkscale.c: Use PANGO_SCALE instead of 1000
Wed Apr 26 01:53:23 2000 Owen Taylor <otaylor@redhat.com>
* gtk/Makefile.am (EXTRA_DIST): Add OLD_STAMP into
EXTRA_DIST. It does not work well when the file that
everything depends on is not in the tarball.
Wed Apr 26 00:56:14 2000 Owen Taylor <otaylor@redhat.com>
* gtk/testgtk.c: Some hacks and fixes so that it basically
works when not sitting in the GTK+ build tree.
2000-05-03 Havoc Pennington <hp@redhat.com>
* gtk/gtktextbtree.c (gtk_text_line_next_could_contain_tag):
Properly determine the ordering of the tag root and the current
line within the tree. Previous algorithm only worked if the tag
root's immediate parent was the common root of both the current
line and the tag root.
Wed Apr 26 00:43:00 2000 Owen Taylor <otaylor@redhat.com>
* gtk/gtktextlayout.c (set_para_values): Fix some bugs in
alignment.
* gtk/gtktextview.c (gtk_text_view_ensure_layout): Track
the widget text directional dynamically.
* gtk/gtktextview.[ch]: Added functions to get and set default
wrap mode.
Tue Apr 25 23:47:38 2000 Owen Taylor <otaylor@redhat.com>
* gtk/gtktextlayout.c (gtk_text_layout_get_iter_location): Fix bug
in cursor location computation.
Tue Apr 25 23:22:59 2000 Owen Taylor <otaylor@redhat.com>
* gtk/gtklayout.c (gtk_layout_set_size): Clamp hadjustment/
vadjusment values properly when layout gets smaller.
* gtk/gtktextview.c (need_repaint_handler): Areas being
passed in are far completely inaccurate, and sometimes
too small, so, for now, just queue a redraw on the
whole visible region.
2000-04-25 Havoc Pennington <hp@redhat.com>
* gtk/gtktextbtree.c (summary_destroy): new function to
destroy tag summary nodes
(gtk_text_line_next_could_contain_tag): this function was
totally broken if the line passed in wasn't below the tag
root. Fix it.
(gtk_text_btree_first_could_contain_tag): In the tag == NULL
"wildcard" case, we have to do a linear scan. Blah.
(gtk_text_btree_last_could_contain_tag): In tag == NULL case,
we have to do the linear scan
(tag_removed_cb): When a tag is removed from the tag table,
remove the GtkTextTagInfo node from the btree.
(gtk_text_btree_spew): Implement the spew function, for
our debugging pleasure.
Tue Apr 25 19:40:18 2000 Owen Taylor <otaylor@redhat.com>
* gtk/gtktextlayout.c (gtk_text_layout_set_buffer): Fix
a problem with referring to the wrong buffer.
* gtk/gtkentry.c: Fix focus-in/focus-out confusion.
* gtk/gtkrc.c gtk/gtkstyle.c: Moving setting default
font description to gtk_style_new() - otherwise things
don't work without a .gtkrc file.
* gtk/gtktextbuffer.c (gtk_text_buffer_new): Sink the
tags table if we create it ourself, too.
* gdk/gdktypes.h (enum): Move GDK_RELEASE_MASK, since
it was conflicting with XKB modifiers.
* gtk/gtktextview.[ch]: Add simple support for
GtkIMContext.
Mon Apr 24 19:34:18 2000 Owen Taylor <otaylor@redhat.com>
* gtk/gtkentry.c (gtk_entry_move_cursor_visually): Fix problem
with deletion from last commit.
Mon Apr 24 19:29:40 2000 Owen Taylor <otaylor@redhat.com>
* gtk/gtkwidget.c (gtk_widget_create_pango_context): Set the language
in the context from the current locale.
* gtk/gtkentry.c (gtk_entry_size_request): Use language from the
context, not hardcoded value.
* gtk/gtkentry.c (gtk_entry_move_cursor): Make character movement visual,
not logical.
Sun Apr 23 23:39:18 2000 Owen Taylor <otaylor@redhat.com>
* gtk/gtkentry.c gtk/gtktextdisplay.c: Don't handle selections as
attributes - that doesn't handle partial-glyph selection
properly. Instead use new pango_layout_line_get_x_ranges()
functionality to draw the selection.
* gtk/gtkentry.c: Simplify code since pango_layout_line_index_to_x()
now properly handles out-of-range coordinates.
* gtk/gtktextbuffer.c: Emit "mark_set" when the cursor is moved.
* gtk/gtktextiter.h gtk/gtktextiterprivate.h: Make gtk_text_iter_get_line_byte()
public.
* gtk/gtktextlayout.[ch]: Properly set the direction in the PangoContext
for paragraphs opposite to the base direction of the widget.
* gtk/gtktextlayout.[ch] gtk/gtktextdisplay.c: Fixes for alignment.
* gtk/gtktextlayout.c: Don't split segments on marks, since that
causes Arabic words to reshape as you cursor through.
* gtk/gtktextlayout.[ch] gtk/gtktextview.[ch]: Implement virtual
cursor position when moving vertically with the arrow keys and
scrolling with page-up/page-down. (Arrow keys save only the X,
scrolling saves both X and Y.)
This means you can line-up / line-down or page-up / page-down
without losing your place, and also that moving vertically
with the cursor keys keeps the same X position, not the same
character count:
* gtk/gtktextlayout.[ch] gtk/gtktextview.[ch]: Make vertical
arrow keys move by display lines, not paragraphs.
Tue Apr 18 14:16:50 2000 Owen Taylor <otaylor@redhat.com>
* gtk/gtklayout.c: Make sure that the bin window is at least
as big as the allocation. (Should we also make sure that the
bin window is big enough to completely cover widget->window?)
* gtk/gtktextview.c (gtk_text_view_get_visible_rect): Add
function to get the onscreen rectangle.
* gdk/x11/gdkwindow-x11.c (gdk_window_get_pointer): Correctly account
for offsets in window coordinates.
Sun Apr 16 16:13:27 2000 Owen Taylor <otaylor@redhat.com>
* gtk/gtkentry.c (gtk_entry_get_cursor_locations): Fix index/offset
confusion.
* gtk/gtktextview.c (gtk_text_view_ensure_layout): Set the default direction
from the widget direction.
* gtk/gtktexttag.c gtk/gtktexttagprivate.h (gtk_text_tag_set_arg):
Add a "direction" attribute.
* gtk/gtktextview.c: global s/tkxt/text_view/.
* gtk/testtext.c: Added long block of text in Arabic, to test out
the direction attributes. (Some problems with the shaping system
for arabic become obvious - like the fact the cursor splits words
into unjoined pieces.)
Fri Apr 14 12:54:34 2000 Owen Taylor <otaylor@redhat.com>
* gtk/gtktextdisplay.c (render_layout): Add overstrike handling.
* gtk/gtktextlayout.c: Fix up alignment.
* gtk/testtext.c: Add some tests for centering, wrapping.
Fri Apr 14 09:26:22 2000 Owen Taylor <otaylor@redhat.com>
* gdk/gdkdrawable.h gdk/gdkdraw.c gdk/gdkwindow.c gdk/x11/gdkdrawable-x11.c:
Add a draw_glyphs() operation to the drawable vtable and gdk_draw_glyphs().
If we wrote GTK+-specific layout-render function this could just replace
the draw_layout() operation in the vtable.
* gtk/gtkentry.c: Move guts of gtk_entry_get_cursor_locations to
pango_layout_get_cursor_pos() and use that function.
* gtk/gtktextchild.[ch]: add gtk_ onto pixmap_segment_new(), since it
is a non-static symbol.
* gtk/gtktextbtree.[ch]: Replace gtk_text_btree_find_line_data_by_y()
with gtk_text_btree_find_line_by_y()
* gtk/gtktextdisplay.c: Rewrote for Pango - uses a custom layout
renderer that handles GtkTextAppearance attributes.
* gtk/gtktexttag.[ch] gtk/gtktexttagprivate.h:
- Move the values in the style that don't affect geometry into a
GtkTextAppearance structure.
- Change underline to take a PangoUnderline and "font" a string
representation of a font description
- Add a "font_desc" attribute which takes a FontDescription structure.
* gtk/gtktextlayout.[ch]:
- Get rid of the display-line list per each line. Instead, we
generate, on demand, a GtkTextLineDisplay structure which]
contains a PangoLayout * and other necesary information
(offsets, cursor locations) for displaying a paragraph.
- Get rid of the code to wrap lines, create display chunks,
etc. Instead, we just go through a paragraph and convert
it into the necessary inputs to a PangoLayout.
- Implement a new attribute type, GtkTextAttrAppearance. This
holds a GtkTextAppearance, and is used to pass colors,
stipple, etc, through from the layout to the display without
having to use lots and lots of individual attributes.
- Reimplement gtk_layout_get_iter_at_pixel() gtk_layout_get_iter_pos()
in terms of PangoLayout functions.
* gtk/gtktextview.c:
- Handle passing the necessary PangoContext to the layout
- Some fixups in painting to deal with the automatic backing store
and offsetting of GTK+-1.4
- Add a style_set handler so that the default style reacts
properly to theme changes.
* gtk/gtktext?*.[ch]: Random code-style fixes.
* gtk/testtext.c: Substitute in languages that Pango handles now for Thai
Mon Apr 10 10:33:45 2000 Owen Taylor <otaylor@redhat.com>
* gtk/gtktext?*.[ch]: Check in Havoc's port of the Tk text widget,
in original form preparatory to Pango-ization and gdkimcontext-ization.
Thu Apr 6 19:25:39 2000 Owen Taylor <otaylor@redhat.com>
* gtk/gtkimcontext.c: Move default implementations to real_* vfuncs,
so that we can derive from gtkimcontext in language bindings properly.
Thu Apr 6 16:02:52 2000 Owen Taylor <otaylor@redhat.com>
* gtk/gtkimcontextsimple.[ch]: Use gdk_keyval_to_unicode to gdk_unicode_to_keyval.
Add a compose table including (almost) all the compose combinations
from X. This is 6k of static, shared data as opposed to 50k or so of dynamic
data in the XIM implementation.
* gdk/gdk.h gdk/gdkkeyuni.c gdk/win32/gdkevents-win32.c (gdk_keyval_to_unicode, gdk_unicode_to_keyval):
Moved functions to convert keyvalues from and to unicode here from
the win32 port and made them public.
Wed Apr 5 16:37:29 2000 Owen Taylor <otaylor@redhat.com>
* gtk/gtkeditable.c (gtk_editable_insert_text): Allow new_text_length == -1.
Wed Apr 5 16:27:45 2000 Owen Taylor <otaylor@redhat.com>
* gtk/gtkimcontext.[ch]: Base class for new input context system
* gtk/gtkimmulticontext.[ch]: Proxy input context that allows
the real input context implementation to be loaded from modules
and switched on the fly.
* gtk/gtkcontextsimple.[ch]: Simple implementation of an input
context that just does direct keysymbol => unicode translation.
* gtk/gtkentry.[ch]: Start switching editing over to using
GtkInputContext. (No handling of preedit yet.)
Wed Apr 5 15:48:41 2000 Owen Taylor <otaylor@redhat.com>
* gtk/gtktypeutils.h (GTK_CHECK_GET_CLASS): Fix problem with one too
many substitutions. (klass should not be subsituted.)
Wed Apr 5 00:18:14 2000 Owen Taylor <otaylor@redhat.com>
* configure.in: Add checks for Pango
* configure.in docs/Makefile.am: Add test for sgml2html
and allow 'make dist' without building html, but print out
warnings in that case. (For making snapshots)
* gdk/Makefile.am gdk/x11/Makefile.am gtk/Makefile.am:
Add Pango libraries and C flags
* gdk/gdkdraw.c gdk/gdkdrawable.h gdkwindow.c gdk/x11/gdkdrawable-x11.c:
Add function (gdk_draw_layout) to draw a pango layout.
* gdk/gdkpango.h gdk/x11/gdkpango-x11.c: New file with functions
for getting Pango contexts for GDK.
* gtk/gtkeditable.c: Get rid of dead code gtk_editable_parent_set()
* gtk/gtkentry.[ch]: Complete rewrite to use Pango, add bidirectional
editing.
* gtk/gtkentry.c: Hack in simple Hebrew input with direct
keysym => unicode translations. More languages can be added
here, but real input-method support is needed.
* docs/Changes-1.4.txt: Added note about entry behavior.
* gtk/gtkenums.h gtk/gtkwidget.[ch] testgtk.c gtkprivate.h: Add functions
to set the reading direction for a widget and the global direction.
Add test which allows toggling the global direction. Two private
flags are used to store the direction. (GTK_DIRECTION_SET + GTK_DIRECTION_LTR)
* gtk/gtkcheckbutton.c gtk/gtkframe.c gtk/gtkhbbox.c gtk/gtkhbox.c
gtk/gtkradiobutton.c gtk/gtkspinbutton.c gtk/gtktable.c
* gtk/gtk[hv]scale.c gtk/gtkscale.[ch]: Draw numbers using Pango
* gtk/gtklabel.[ch]: Moved to Pango and considerably rewritten. Line breaking,
underlining now handled by Pango.
* gtk/gtkstyle.[ch] gtk/gtkrc.[ch]: Add a PangoFontDescription
to RCStyle and Style. (Having both this and the old font name and GdkFont
is temporary.)
* gtk/gtkwidget.[ch] (gtk_widget_create_pango_{context,layout}): Added
convenience functions for creating contexts and layouts for widgets.
* gtk/testgtk.c: Enhance label tests with multilingual labels.
2000-06-02 03:14:07 +00:00
|
|
|
|
PangoLayout *layout;
|
|
|
|
|
PangoRectangle logical_rect;
|
2002-02-14 05:05:45 +00:00
|
|
|
|
gint focus_padding;
|
|
|
|
|
gint focus_width;
|
1998-10-01 13:24:42 +00:00
|
|
|
|
|
2005-05-11 19:16:19 +00:00
|
|
|
|
cr = gdk_cairo_create (priv->week_win);
|
1998-10-01 13:24:42 +00:00
|
|
|
|
|
2002-02-14 05:05:45 +00:00
|
|
|
|
gtk_widget_style_get (GTK_WIDGET (widget),
|
|
|
|
|
"focus-line-width", &focus_width,
|
|
|
|
|
"focus-padding", &focus_padding,
|
|
|
|
|
NULL);
|
|
|
|
|
|
1998-09-27 18:32:00 +00:00
|
|
|
|
/*
|
|
|
|
|
* Draw a rectangle as inverted background for the labels.
|
|
|
|
|
*/
|
2005-05-11 19:16:19 +00:00
|
|
|
|
|
|
|
|
|
gdk_cairo_set_source_color (cr, SELECTED_BG_COLOR (widget));
|
|
|
|
|
if (priv->day_name_win)
|
|
|
|
|
cairo_rectangle (cr,
|
|
|
|
|
CALENDAR_MARGIN,
|
|
|
|
|
0,
|
|
|
|
|
priv->week_width - CALENDAR_MARGIN,
|
|
|
|
|
priv->main_h - CALENDAR_MARGIN);
|
1998-09-27 18:32:00 +00:00
|
|
|
|
else
|
2005-05-11 19:16:19 +00:00
|
|
|
|
cairo_rectangle (cr,
|
|
|
|
|
CALENDAR_MARGIN,
|
|
|
|
|
CALENDAR_MARGIN,
|
|
|
|
|
priv->week_width - CALENDAR_MARGIN,
|
|
|
|
|
priv->main_h - 2 * CALENDAR_MARGIN);
|
|
|
|
|
cairo_fill (cr);
|
1998-10-01 13:24:42 +00:00
|
|
|
|
|
1998-09-27 18:32:00 +00:00
|
|
|
|
/*
|
|
|
|
|
* Write the labels
|
|
|
|
|
*/
|
1998-10-01 13:24:42 +00:00
|
|
|
|
|
2000-07-02 22:30:54 +00:00
|
|
|
|
layout = gtk_widget_create_pango_layout (widget, NULL);
|
Remove all references to offscreen flag which was no longer used.
Thu Jun 1 23:05:13 2000 Owen Taylor <otaylor@redhat.com>
* gtk/gtkwidget.c: Remove all references to
offscreen flag which was no longer used.
* gtk/gtkprivate.h (enum): Remove unused flags and compress.
* gtk/gtkframe.c (gtk_frame_set_label_widget): Check
for non-null label_widget->parent.
* gtk/gtkentry.c: Get rid of code to deal with PangoAttribute
which no longer was used.
* gdk/gdkpango.c (gdk_pango_context_get_info): make static.
* gdk/gdkpango.c (gdk_draw_layout[_line]): Add checks
for null arguments.
* gdk/x11/gdkgeometry-x11.c (gdk_window_scroll): add
check for destroyed windows.
Thu Jun 1 13:48:45 2000 Owen Taylor <otaylor@redhat.com>
* gtk/gtkimmulticontext.c: Add a finalize method and unref
the slave context there.
* gtk/gtkinvisible.[ch]: Make reference counting behavior
identical to GtkWindow.
Thu Jun 1 01:54:11 2000 Owen Taylor <otaylor@redhat.com>
* Makefile.am gdk/gdkpango.c: Copy the layout render function from
pangox to here, so we can write them independent of rendering
system, using GDK primitives.
* gdk/gdkdrawable.h gdk/gdkdraw.c gdk/gdkwindow.c
gdk/x11/gdkdrawable-x11.c: Remove draw_layout() from the vtable,
since we have a rendering-system independent implementation in
terms of draw_glyphs().
* gdk/gdkpango.c gdkdrawable.h (gdk_draw_layout_line): New
function to render a single line.
* gdk/x11/gdkpango.c: Move the guts of this file mostly
into ../gdkpango.c, which simplifies things, since we
don't have to deal with raw X gc's.
Fri May 19 04:28:16 2000 Owen Taylor <otaylor@redhat.com>
* gtk/gtktextlayout.[ch]: Add get_log_attrs() function to
get the logical attributes for a given GtkTextLine.
Tue May 30 16:05:39 2000 Owen Taylor <otaylor@redhat.com>
* gdk/x11/gdkfont-x11.c (gdk_font_charset_for_locale): Track
g_locale_get_codeset() to g_get_codeset() change.
Tue May 30 15:03:19 2000 Owen Taylor <otaylor@redhat.com>
* gtk/testcalendar.c (calendar_font_selection_ok): Use font
descriptions.
* gtk/gtkentry.c (gtk_entry_draw_text): Center text within
the entry.
* gtk/gtkfontsel.c (gtk_font_selection_dialog_init): Start of
redoing (vastly simplifying) for Pango. Still needs quite
a bit of work. (Size selection is currently poor. List of
predefined sizes is not a good idea, since all of these
sizes won't necessarily be distinct.)
Tue May 30 13:50:19 2000 Owen Taylor <otaylor@redhat.com>
* gdk/x11/gdkfont-x11.c (gdk_font_charset_for_locale): Handle
CODESET results for LANG=C.
Mon May 29 15:49:10 2000 Owen Taylor <otaylor@redhat.com>
* gtk/gtkrc.[ch]: Add a 'font_name' declaration to RC
which takes a stringized pango font description;
ignore the older 'font' and 'fontset' declarations.
* gtk/gtkstyle.c gtk/gtkrc.c: Fill in the style->font
field with a GdkFont derived via gdk_font_from_description(),
for compatibility. (Should we just remove it entirely?
Probably too much compatibility breakage, but people
should be migrating to the new Pango stuff as quickly
as possible.)
Mon May 29 15:47:41 2000 Owen Taylor <otaylor@redhat.com>
* gtk/gtkentry.c gtk/gtkclist.c: s/pango_font_unref/g_object_unref/.
Mon May 29 15:44:46 2000 Owen Taylor <otaylor@redhat.com>
* gtk/gtkcalender.c: Roughly pango-ized. Really needs
redoing; there are some bugs in size allocation right
now, the semi-existant distinction between header / day
fonts was removed, but, with Pango, could actually
be made functional in a nice way.
* gtk/testcalender: Move calender from examples into this
directory as a test program. (We really need to restrcture
testgtk into a whole directory full of tests for every
widget or functionality group, separated into multiple .c
files.)
Mon May 29 15:19:56 2000 Owen Taylor <otaylor@redhat.com>
* gtk/testgtk.c (file_exists): Fix stupid typo that
was keeping RC file from being loaded.
* gtk/testgtkrc gtk/testgtkrc2: Test new pango-ized
RC file font code.
Mon May 29 14:31:27 2000 Owen Taylor <otaylor@redhat.com>
* gdk/gdkfont.h gdk/x11/gdkfont-x11.c (gdk_font_from_description):
Add function to load a GdkFont from a PangoFontDescription.
Fri May 26 17:16:40 2000 Owen Taylor <otaylor@redhat.com>
* gtk/frame.[ch] gtkaspectframe.c: Make frame widgets able
to have any widget for the label, use a GtkLabel widget
to display the text. (Based partially on a patch from
Anders Carlson.)
(Quite a bit of code reorganization - strip 90% of the
guts out of gtkaspectframe and add a single virtual
func to GtkFrameClass - compute_child_allocation.)
Fri May 26 12:00:02 2000 Owen Taylor <otaylor@redhat.com>
* gtk/gtkctree.c gtk/gtkclist.[ch]: Pangoized.
(Removed clist->row_center_offset field because caching
it wasn't saving time or code, added private function
_gtk_clist_create_cell_layout()).
Wed May 24 15:59:37 2000 Owen Taylor <otaylor@redhat.com>
* gtk/gtkaccellabel.c: Pangoized.
* gtk/[hv]ruler.c: Pangoized
Mon May 22 19:23:59 2000 Owen Taylor <otaylor@redhat.com>
* gtk/gtkfilesel.c (gtk_file_selection_init):
Use gtk_clist_set_column_auto_resize() to remove need
need for manual column width computations.
Mon May 22 18:50:26 2000 Owen Taylor <otaylor@redhat.com>
* gtk/gtktooltips.[ch]: Replace custom drawing with a GtkLabel,
ensuring Pango correctness, and considerably simplifying the
code.
* gtk/gtklabel.c gtk[hv]scale.c: 1000 => PANGO_SCALE.
* gtk/gtklabel.c (gtk_label_size_request): Fixed incorrect
getting of numbers of lines.
* gtk/gtklabel.c (gtk_label_size_request): Set the requisition
to the actual requested width of the lable, not to the wrap
width we set.
* gtk/gtktextchild.h: Remove extraneous include of gtk/gtk.h.
* gtk/gtktextbtree.c gtk/gtktextbuffer.c gtk/gtktextlayout.c
gtk/gtktextview.c gtk/gtktextview.[ch]: Fix up includes.
* gtk/gtktextview.c: Fix structure inheritance.
* gtk/gtkprogressbar.c: Pangoize.
Mon May 22 15:47:30 2000 Owen Taylor <otaylor@redhat.com>
* gtk/gtktextview.c (gtk_text_view_get_first_para_iter): Encapsulate
in a function.
* gtk/gtktextlayout.c (find_display_line_above): Fixed
bug with computing line tops.
* gtk/gtktextview.c (changed_handler): Fix < , <= confusion.
Thu May 18 18:53:31 2000 Owen Taylor <otaylor@redhat.com>
* gtk/gtktextdisplay.c (gtk_text_layout_draw): Fix up the x_offset
and y_offset coordinates to do what we need now. (The offset between
buffer and layout coordinates has been reintroduced, but is a
bit different than before.)
* gtk/gtktextview.[ch]: No longer inherit from GtkLayout; instead
handle the adjustments ourselves, and scroll as necessary using
the new gdk_window_scroll().
The advantage of this is that when we are incrementally revalidating,
we are essentially rearranging things around the visible portion
of the screen. With the old setup, the visible portion of the
screen was moved around in the layout, so scrolling and redrawing
to track that caused jumping of the display. Since we now
control the scrolling ourselves, we can suppress this and
only redraw when things actually change.
Thu May 18 18:47:25 2000 Owen Taylor <otaylor@redhat.com>
* gtk/gtktextbtree.c (redisplay_mark): We need to invalidate
the region not just redisplay it after-all, since we store the
cursors in the LineDisplay. (Ugly interactions here between
GtkLayout and GtkTextBTree here.)
* gtk/gtktextbtree.c (redisplay_region): Fixed reversed comparison.
Thu May 18 18:43:21 2000 Owen Taylor <otaylor@redhat.com>
* gdk/gdkwindow.h gdk/x11/gdkgeometry-x11.c (gdk_window_scroll):
Added function to scroll contents of a window while keeping the
window constant. Works by XCopyArea or guffaw-scrolling depending
on the details of how the window is set up. (guffaw-scrolling
still needs to be filled in.)
Wed May 17 22:36:53 2000 Owen Taylor <otaylor@redhat.com>
* gtk/gtktextiter.c gtk/gtkmain.c: Add a debug key for the text widget,
move the debugging that was tied to a global variable
to that.
* gtk/gtkmarshal.list: Add NONE:INT,INT,INT
* gtk/gtktextbtree.[ch] gtk/gtktextlayout.c: Keep a separate
validated flag, in line data instead of setting height/width to
-1. This allows us to perform operations with partially invalid
buffer (using the old size for invalid lines) and thus to do
incremental vaidation. Keep height/width aggregates up to date
when deleting text and rebalancing the tree.
* gtk/gtktextbtree.[ch]: Add functions validate a line
(gtk_text_btree_validate_line), and to validate up
to a number of pixels (gtk_text_btree_validate).
* gtk/gtktextlayout.[ch]: Add an ::invalidated signal
that indicates that something is changed and a revalidation
pass is needed. Change ::need_repaint to ::changed, and
make it take old and new yranges instead of a rectangle.
* gtk/gtktextbtree.[ch] gtk/gtktextlayout.[ch]: Move
the line_data_destroy() function from
gtk_text_btree_add_view() to a virtual function in
GtkTextLayout
* gtk/gtktextbtree.[ch]: Remove gtk_text_btree_get_damage_range(),
since we are handling partial repaints in a different fashion
now.
* gtk/gtktextbtree.[ch]: Only repaint the changed portion
of the selection instead of queueing a repaint on the
entire widget.
* gtk/gtktextbuffer.[ch] gtk/gtktextbtree.[ch]: Move
get_selection_bounds() down to btree, make the function
in buffer a wrapper around the btree function.
* gtk/gtktextlayout.[ch]: Add functions to check if the
layout is valid and to recompute either a range of pixels
aroudn a line or a certain total number of pixels.
* gtk/gtktextlayout.[ch]: Cache a single line display;
now that we only redraw the needed portions, the hit rate
for this cache is quite high.
* gtk/gtktextview.[ch]: Keep track of the first paragraph
on the screen so that when re-laying-out the buffer, we can
keep the same place. This requires connecting to ::value_changed
on the adjustments
* gtk/gtktextview.[ch]: Add idle functions to revalidate
the buffer after we receive an ::invalidated signal.
Wed May 17 22:10:47 2000 Owen Taylor <otaylor@redhat.com>
* gtk/gtklayout.c (gtk_layout_size_allocate): Set upper
to max of allocation and layout size, not just to the
layout size.
* gtk/gtk[hv]scrollbar.c (gtk_[hv]scrollbar_calc_slider_size):
Invalidate window so it gets redrawn properly.
* gdk/gdkwindow.c (gdk_window_invalidate_rect): Allow rect == NULL
to mean the entire window.
* gdk/gdkevents.h: Move definition for GDK_PRIORITY_REDRAW
into public header.
Mon May 15 14:51:31 2000 Owen Taylor <otaylor@redhat.com>
* gtk/gtktextmark.c (gtk_text_mark_get_name): Add function
to get the name of a mark.
* gtk/gtktextlayout.c (gtk_text_layout_get_line_at_y): Add a function
to find the paragraph from a y position.
Thu May 11 12:57:20 2000 Owen Taylor <otaylor@redhat.com>
* gtk/gtktextbtree.c (gtk_text_btree_node_invalidate_upward): Valid
nodes have width/height >= 0, not > 0.
Tue May 9 21:29:06 2000 Owen Taylor <otaylor@redhat.com>
* gtk/gtktextlayout.[ch] gtk/gtktextdisplay.c (gtk_text_layout_get_line_display):
Add a size_only flag, so when we only need the size, we don't create
useless appearance attributes.
* gtk/gtktextview.c (gtk_text_view_ensure_layout): Remove
duplicate setting of font description.
* gtk/gtkscale.c: Use PANGO_SCALE instead of 1000
Wed Apr 26 01:53:23 2000 Owen Taylor <otaylor@redhat.com>
* gtk/Makefile.am (EXTRA_DIST): Add OLD_STAMP into
EXTRA_DIST. It does not work well when the file that
everything depends on is not in the tarball.
Wed Apr 26 00:56:14 2000 Owen Taylor <otaylor@redhat.com>
* gtk/testgtk.c: Some hacks and fixes so that it basically
works when not sitting in the GTK+ build tree.
2000-05-03 Havoc Pennington <hp@redhat.com>
* gtk/gtktextbtree.c (gtk_text_line_next_could_contain_tag):
Properly determine the ordering of the tag root and the current
line within the tree. Previous algorithm only worked if the tag
root's immediate parent was the common root of both the current
line and the tag root.
Wed Apr 26 00:43:00 2000 Owen Taylor <otaylor@redhat.com>
* gtk/gtktextlayout.c (set_para_values): Fix some bugs in
alignment.
* gtk/gtktextview.c (gtk_text_view_ensure_layout): Track
the widget text directional dynamically.
* gtk/gtktextview.[ch]: Added functions to get and set default
wrap mode.
Tue Apr 25 23:47:38 2000 Owen Taylor <otaylor@redhat.com>
* gtk/gtktextlayout.c (gtk_text_layout_get_iter_location): Fix bug
in cursor location computation.
Tue Apr 25 23:22:59 2000 Owen Taylor <otaylor@redhat.com>
* gtk/gtklayout.c (gtk_layout_set_size): Clamp hadjustment/
vadjusment values properly when layout gets smaller.
* gtk/gtktextview.c (need_repaint_handler): Areas being
passed in are far completely inaccurate, and sometimes
too small, so, for now, just queue a redraw on the
whole visible region.
2000-04-25 Havoc Pennington <hp@redhat.com>
* gtk/gtktextbtree.c (summary_destroy): new function to
destroy tag summary nodes
(gtk_text_line_next_could_contain_tag): this function was
totally broken if the line passed in wasn't below the tag
root. Fix it.
(gtk_text_btree_first_could_contain_tag): In the tag == NULL
"wildcard" case, we have to do a linear scan. Blah.
(gtk_text_btree_last_could_contain_tag): In tag == NULL case,
we have to do the linear scan
(tag_removed_cb): When a tag is removed from the tag table,
remove the GtkTextTagInfo node from the btree.
(gtk_text_btree_spew): Implement the spew function, for
our debugging pleasure.
Tue Apr 25 19:40:18 2000 Owen Taylor <otaylor@redhat.com>
* gtk/gtktextlayout.c (gtk_text_layout_set_buffer): Fix
a problem with referring to the wrong buffer.
* gtk/gtkentry.c: Fix focus-in/focus-out confusion.
* gtk/gtkrc.c gtk/gtkstyle.c: Moving setting default
font description to gtk_style_new() - otherwise things
don't work without a .gtkrc file.
* gtk/gtktextbuffer.c (gtk_text_buffer_new): Sink the
tags table if we create it ourself, too.
* gdk/gdktypes.h (enum): Move GDK_RELEASE_MASK, since
it was conflicting with XKB modifiers.
* gtk/gtktextview.[ch]: Add simple support for
GtkIMContext.
Mon Apr 24 19:34:18 2000 Owen Taylor <otaylor@redhat.com>
* gtk/gtkentry.c (gtk_entry_move_cursor_visually): Fix problem
with deletion from last commit.
Mon Apr 24 19:29:40 2000 Owen Taylor <otaylor@redhat.com>
* gtk/gtkwidget.c (gtk_widget_create_pango_context): Set the language
in the context from the current locale.
* gtk/gtkentry.c (gtk_entry_size_request): Use language from the
context, not hardcoded value.
* gtk/gtkentry.c (gtk_entry_move_cursor): Make character movement visual,
not logical.
Sun Apr 23 23:39:18 2000 Owen Taylor <otaylor@redhat.com>
* gtk/gtkentry.c gtk/gtktextdisplay.c: Don't handle selections as
attributes - that doesn't handle partial-glyph selection
properly. Instead use new pango_layout_line_get_x_ranges()
functionality to draw the selection.
* gtk/gtkentry.c: Simplify code since pango_layout_line_index_to_x()
now properly handles out-of-range coordinates.
* gtk/gtktextbuffer.c: Emit "mark_set" when the cursor is moved.
* gtk/gtktextiter.h gtk/gtktextiterprivate.h: Make gtk_text_iter_get_line_byte()
public.
* gtk/gtktextlayout.[ch]: Properly set the direction in the PangoContext
for paragraphs opposite to the base direction of the widget.
* gtk/gtktextlayout.[ch] gtk/gtktextdisplay.c: Fixes for alignment.
* gtk/gtktextlayout.c: Don't split segments on marks, since that
causes Arabic words to reshape as you cursor through.
* gtk/gtktextlayout.[ch] gtk/gtktextview.[ch]: Implement virtual
cursor position when moving vertically with the arrow keys and
scrolling with page-up/page-down. (Arrow keys save only the X,
scrolling saves both X and Y.)
This means you can line-up / line-down or page-up / page-down
without losing your place, and also that moving vertically
with the cursor keys keeps the same X position, not the same
character count:
* gtk/gtktextlayout.[ch] gtk/gtktextview.[ch]: Make vertical
arrow keys move by display lines, not paragraphs.
Tue Apr 18 14:16:50 2000 Owen Taylor <otaylor@redhat.com>
* gtk/gtklayout.c: Make sure that the bin window is at least
as big as the allocation. (Should we also make sure that the
bin window is big enough to completely cover widget->window?)
* gtk/gtktextview.c (gtk_text_view_get_visible_rect): Add
function to get the onscreen rectangle.
* gdk/x11/gdkwindow-x11.c (gdk_window_get_pointer): Correctly account
for offsets in window coordinates.
Sun Apr 16 16:13:27 2000 Owen Taylor <otaylor@redhat.com>
* gtk/gtkentry.c (gtk_entry_get_cursor_locations): Fix index/offset
confusion.
* gtk/gtktextview.c (gtk_text_view_ensure_layout): Set the default direction
from the widget direction.
* gtk/gtktexttag.c gtk/gtktexttagprivate.h (gtk_text_tag_set_arg):
Add a "direction" attribute.
* gtk/gtktextview.c: global s/tkxt/text_view/.
* gtk/testtext.c: Added long block of text in Arabic, to test out
the direction attributes. (Some problems with the shaping system
for arabic become obvious - like the fact the cursor splits words
into unjoined pieces.)
Fri Apr 14 12:54:34 2000 Owen Taylor <otaylor@redhat.com>
* gtk/gtktextdisplay.c (render_layout): Add overstrike handling.
* gtk/gtktextlayout.c: Fix up alignment.
* gtk/testtext.c: Add some tests for centering, wrapping.
Fri Apr 14 09:26:22 2000 Owen Taylor <otaylor@redhat.com>
* gdk/gdkdrawable.h gdk/gdkdraw.c gdk/gdkwindow.c gdk/x11/gdkdrawable-x11.c:
Add a draw_glyphs() operation to the drawable vtable and gdk_draw_glyphs().
If we wrote GTK+-specific layout-render function this could just replace
the draw_layout() operation in the vtable.
* gtk/gtkentry.c: Move guts of gtk_entry_get_cursor_locations to
pango_layout_get_cursor_pos() and use that function.
* gtk/gtktextchild.[ch]: add gtk_ onto pixmap_segment_new(), since it
is a non-static symbol.
* gtk/gtktextbtree.[ch]: Replace gtk_text_btree_find_line_data_by_y()
with gtk_text_btree_find_line_by_y()
* gtk/gtktextdisplay.c: Rewrote for Pango - uses a custom layout
renderer that handles GtkTextAppearance attributes.
* gtk/gtktexttag.[ch] gtk/gtktexttagprivate.h:
- Move the values in the style that don't affect geometry into a
GtkTextAppearance structure.
- Change underline to take a PangoUnderline and "font" a string
representation of a font description
- Add a "font_desc" attribute which takes a FontDescription structure.
* gtk/gtktextlayout.[ch]:
- Get rid of the display-line list per each line. Instead, we
generate, on demand, a GtkTextLineDisplay structure which]
contains a PangoLayout * and other necesary information
(offsets, cursor locations) for displaying a paragraph.
- Get rid of the code to wrap lines, create display chunks,
etc. Instead, we just go through a paragraph and convert
it into the necessary inputs to a PangoLayout.
- Implement a new attribute type, GtkTextAttrAppearance. This
holds a GtkTextAppearance, and is used to pass colors,
stipple, etc, through from the layout to the display without
having to use lots and lots of individual attributes.
- Reimplement gtk_layout_get_iter_at_pixel() gtk_layout_get_iter_pos()
in terms of PangoLayout functions.
* gtk/gtktextview.c:
- Handle passing the necessary PangoContext to the layout
- Some fixups in painting to deal with the automatic backing store
and offsetting of GTK+-1.4
- Add a style_set handler so that the default style reacts
properly to theme changes.
* gtk/gtktext?*.[ch]: Random code-style fixes.
* gtk/testtext.c: Substitute in languages that Pango handles now for Thai
Mon Apr 10 10:33:45 2000 Owen Taylor <otaylor@redhat.com>
* gtk/gtktext?*.[ch]: Check in Havoc's port of the Tk text widget,
in original form preparatory to Pango-ization and gdkimcontext-ization.
Thu Apr 6 19:25:39 2000 Owen Taylor <otaylor@redhat.com>
* gtk/gtkimcontext.c: Move default implementations to real_* vfuncs,
so that we can derive from gtkimcontext in language bindings properly.
Thu Apr 6 16:02:52 2000 Owen Taylor <otaylor@redhat.com>
* gtk/gtkimcontextsimple.[ch]: Use gdk_keyval_to_unicode to gdk_unicode_to_keyval.
Add a compose table including (almost) all the compose combinations
from X. This is 6k of static, shared data as opposed to 50k or so of dynamic
data in the XIM implementation.
* gdk/gdk.h gdk/gdkkeyuni.c gdk/win32/gdkevents-win32.c (gdk_keyval_to_unicode, gdk_unicode_to_keyval):
Moved functions to convert keyvalues from and to unicode here from
the win32 port and made them public.
Wed Apr 5 16:37:29 2000 Owen Taylor <otaylor@redhat.com>
* gtk/gtkeditable.c (gtk_editable_insert_text): Allow new_text_length == -1.
Wed Apr 5 16:27:45 2000 Owen Taylor <otaylor@redhat.com>
* gtk/gtkimcontext.[ch]: Base class for new input context system
* gtk/gtkimmulticontext.[ch]: Proxy input context that allows
the real input context implementation to be loaded from modules
and switched on the fly.
* gtk/gtkcontextsimple.[ch]: Simple implementation of an input
context that just does direct keysymbol => unicode translation.
* gtk/gtkentry.[ch]: Start switching editing over to using
GtkInputContext. (No handling of preedit yet.)
Wed Apr 5 15:48:41 2000 Owen Taylor <otaylor@redhat.com>
* gtk/gtktypeutils.h (GTK_CHECK_GET_CLASS): Fix problem with one too
many substitutions. (klass should not be subsituted.)
Wed Apr 5 00:18:14 2000 Owen Taylor <otaylor@redhat.com>
* configure.in: Add checks for Pango
* configure.in docs/Makefile.am: Add test for sgml2html
and allow 'make dist' without building html, but print out
warnings in that case. (For making snapshots)
* gdk/Makefile.am gdk/x11/Makefile.am gtk/Makefile.am:
Add Pango libraries and C flags
* gdk/gdkdraw.c gdk/gdkdrawable.h gdkwindow.c gdk/x11/gdkdrawable-x11.c:
Add function (gdk_draw_layout) to draw a pango layout.
* gdk/gdkpango.h gdk/x11/gdkpango-x11.c: New file with functions
for getting Pango contexts for GDK.
* gtk/gtkeditable.c: Get rid of dead code gtk_editable_parent_set()
* gtk/gtkentry.[ch]: Complete rewrite to use Pango, add bidirectional
editing.
* gtk/gtkentry.c: Hack in simple Hebrew input with direct
keysym => unicode translations. More languages can be added
here, but real input-method support is needed.
* docs/Changes-1.4.txt: Added note about entry behavior.
* gtk/gtkenums.h gtk/gtkwidget.[ch] testgtk.c gtkprivate.h: Add functions
to set the reading direction for a widget and the global direction.
Add test which allows toggling the global direction. Two private
flags are used to store the direction. (GTK_DIRECTION_SET + GTK_DIRECTION_LTR)
* gtk/gtkcheckbutton.c gtk/gtkframe.c gtk/gtkhbbox.c gtk/gtkhbox.c
gtk/gtkradiobutton.c gtk/gtkspinbutton.c gtk/gtktable.c
* gtk/gtk[hv]scale.c gtk/gtkscale.[ch]: Draw numbers using Pango
* gtk/gtklabel.[ch]: Moved to Pango and considerably rewritten. Line breaking,
underlining now handled by Pango.
* gtk/gtkstyle.[ch] gtk/gtkrc.[ch]: Add a PangoFontDescription
to RCStyle and Style. (Having both this and the old font name and GdkFont
is temporary.)
* gtk/gtkwidget.[ch] (gtk_widget_create_pango_{context,layout}): Added
convenience functions for creating contexts and layouts for widgets.
* gtk/testgtk.c: Enhance label tests with multilingual labels.
2000-06-02 03:14:07 +00:00
|
|
|
|
|
2005-05-11 19:16:19 +00:00
|
|
|
|
gdk_cairo_set_source_color (cr, SELECTED_FG_COLOR (widget));
|
|
|
|
|
day_height = calendar_row_height (calendar);
|
1998-09-27 18:32:00 +00:00
|
|
|
|
for (row = 0; row < 6; row++)
|
|
|
|
|
{
|
2005-05-11 19:16:19 +00:00
|
|
|
|
gboolean result;
|
|
|
|
|
|
1998-09-27 18:32:00 +00:00
|
|
|
|
year = calendar->year;
|
|
|
|
|
if (calendar->day[row][6] < 15 && row > 3 && calendar->month == 11)
|
|
|
|
|
year++;
|
Remove all references to offscreen flag which was no longer used.
Thu Jun 1 23:05:13 2000 Owen Taylor <otaylor@redhat.com>
* gtk/gtkwidget.c: Remove all references to
offscreen flag which was no longer used.
* gtk/gtkprivate.h (enum): Remove unused flags and compress.
* gtk/gtkframe.c (gtk_frame_set_label_widget): Check
for non-null label_widget->parent.
* gtk/gtkentry.c: Get rid of code to deal with PangoAttribute
which no longer was used.
* gdk/gdkpango.c (gdk_pango_context_get_info): make static.
* gdk/gdkpango.c (gdk_draw_layout[_line]): Add checks
for null arguments.
* gdk/x11/gdkgeometry-x11.c (gdk_window_scroll): add
check for destroyed windows.
Thu Jun 1 13:48:45 2000 Owen Taylor <otaylor@redhat.com>
* gtk/gtkimmulticontext.c: Add a finalize method and unref
the slave context there.
* gtk/gtkinvisible.[ch]: Make reference counting behavior
identical to GtkWindow.
Thu Jun 1 01:54:11 2000 Owen Taylor <otaylor@redhat.com>
* Makefile.am gdk/gdkpango.c: Copy the layout render function from
pangox to here, so we can write them independent of rendering
system, using GDK primitives.
* gdk/gdkdrawable.h gdk/gdkdraw.c gdk/gdkwindow.c
gdk/x11/gdkdrawable-x11.c: Remove draw_layout() from the vtable,
since we have a rendering-system independent implementation in
terms of draw_glyphs().
* gdk/gdkpango.c gdkdrawable.h (gdk_draw_layout_line): New
function to render a single line.
* gdk/x11/gdkpango.c: Move the guts of this file mostly
into ../gdkpango.c, which simplifies things, since we
don't have to deal with raw X gc's.
Fri May 19 04:28:16 2000 Owen Taylor <otaylor@redhat.com>
* gtk/gtktextlayout.[ch]: Add get_log_attrs() function to
get the logical attributes for a given GtkTextLine.
Tue May 30 16:05:39 2000 Owen Taylor <otaylor@redhat.com>
* gdk/x11/gdkfont-x11.c (gdk_font_charset_for_locale): Track
g_locale_get_codeset() to g_get_codeset() change.
Tue May 30 15:03:19 2000 Owen Taylor <otaylor@redhat.com>
* gtk/testcalendar.c (calendar_font_selection_ok): Use font
descriptions.
* gtk/gtkentry.c (gtk_entry_draw_text): Center text within
the entry.
* gtk/gtkfontsel.c (gtk_font_selection_dialog_init): Start of
redoing (vastly simplifying) for Pango. Still needs quite
a bit of work. (Size selection is currently poor. List of
predefined sizes is not a good idea, since all of these
sizes won't necessarily be distinct.)
Tue May 30 13:50:19 2000 Owen Taylor <otaylor@redhat.com>
* gdk/x11/gdkfont-x11.c (gdk_font_charset_for_locale): Handle
CODESET results for LANG=C.
Mon May 29 15:49:10 2000 Owen Taylor <otaylor@redhat.com>
* gtk/gtkrc.[ch]: Add a 'font_name' declaration to RC
which takes a stringized pango font description;
ignore the older 'font' and 'fontset' declarations.
* gtk/gtkstyle.c gtk/gtkrc.c: Fill in the style->font
field with a GdkFont derived via gdk_font_from_description(),
for compatibility. (Should we just remove it entirely?
Probably too much compatibility breakage, but people
should be migrating to the new Pango stuff as quickly
as possible.)
Mon May 29 15:47:41 2000 Owen Taylor <otaylor@redhat.com>
* gtk/gtkentry.c gtk/gtkclist.c: s/pango_font_unref/g_object_unref/.
Mon May 29 15:44:46 2000 Owen Taylor <otaylor@redhat.com>
* gtk/gtkcalender.c: Roughly pango-ized. Really needs
redoing; there are some bugs in size allocation right
now, the semi-existant distinction between header / day
fonts was removed, but, with Pango, could actually
be made functional in a nice way.
* gtk/testcalender: Move calender from examples into this
directory as a test program. (We really need to restrcture
testgtk into a whole directory full of tests for every
widget or functionality group, separated into multiple .c
files.)
Mon May 29 15:19:56 2000 Owen Taylor <otaylor@redhat.com>
* gtk/testgtk.c (file_exists): Fix stupid typo that
was keeping RC file from being loaded.
* gtk/testgtkrc gtk/testgtkrc2: Test new pango-ized
RC file font code.
Mon May 29 14:31:27 2000 Owen Taylor <otaylor@redhat.com>
* gdk/gdkfont.h gdk/x11/gdkfont-x11.c (gdk_font_from_description):
Add function to load a GdkFont from a PangoFontDescription.
Fri May 26 17:16:40 2000 Owen Taylor <otaylor@redhat.com>
* gtk/frame.[ch] gtkaspectframe.c: Make frame widgets able
to have any widget for the label, use a GtkLabel widget
to display the text. (Based partially on a patch from
Anders Carlson.)
(Quite a bit of code reorganization - strip 90% of the
guts out of gtkaspectframe and add a single virtual
func to GtkFrameClass - compute_child_allocation.)
Fri May 26 12:00:02 2000 Owen Taylor <otaylor@redhat.com>
* gtk/gtkctree.c gtk/gtkclist.[ch]: Pangoized.
(Removed clist->row_center_offset field because caching
it wasn't saving time or code, added private function
_gtk_clist_create_cell_layout()).
Wed May 24 15:59:37 2000 Owen Taylor <otaylor@redhat.com>
* gtk/gtkaccellabel.c: Pangoized.
* gtk/[hv]ruler.c: Pangoized
Mon May 22 19:23:59 2000 Owen Taylor <otaylor@redhat.com>
* gtk/gtkfilesel.c (gtk_file_selection_init):
Use gtk_clist_set_column_auto_resize() to remove need
need for manual column width computations.
Mon May 22 18:50:26 2000 Owen Taylor <otaylor@redhat.com>
* gtk/gtktooltips.[ch]: Replace custom drawing with a GtkLabel,
ensuring Pango correctness, and considerably simplifying the
code.
* gtk/gtklabel.c gtk[hv]scale.c: 1000 => PANGO_SCALE.
* gtk/gtklabel.c (gtk_label_size_request): Fixed incorrect
getting of numbers of lines.
* gtk/gtklabel.c (gtk_label_size_request): Set the requisition
to the actual requested width of the lable, not to the wrap
width we set.
* gtk/gtktextchild.h: Remove extraneous include of gtk/gtk.h.
* gtk/gtktextbtree.c gtk/gtktextbuffer.c gtk/gtktextlayout.c
gtk/gtktextview.c gtk/gtktextview.[ch]: Fix up includes.
* gtk/gtktextview.c: Fix structure inheritance.
* gtk/gtkprogressbar.c: Pangoize.
Mon May 22 15:47:30 2000 Owen Taylor <otaylor@redhat.com>
* gtk/gtktextview.c (gtk_text_view_get_first_para_iter): Encapsulate
in a function.
* gtk/gtktextlayout.c (find_display_line_above): Fixed
bug with computing line tops.
* gtk/gtktextview.c (changed_handler): Fix < , <= confusion.
Thu May 18 18:53:31 2000 Owen Taylor <otaylor@redhat.com>
* gtk/gtktextdisplay.c (gtk_text_layout_draw): Fix up the x_offset
and y_offset coordinates to do what we need now. (The offset between
buffer and layout coordinates has been reintroduced, but is a
bit different than before.)
* gtk/gtktextview.[ch]: No longer inherit from GtkLayout; instead
handle the adjustments ourselves, and scroll as necessary using
the new gdk_window_scroll().
The advantage of this is that when we are incrementally revalidating,
we are essentially rearranging things around the visible portion
of the screen. With the old setup, the visible portion of the
screen was moved around in the layout, so scrolling and redrawing
to track that caused jumping of the display. Since we now
control the scrolling ourselves, we can suppress this and
only redraw when things actually change.
Thu May 18 18:47:25 2000 Owen Taylor <otaylor@redhat.com>
* gtk/gtktextbtree.c (redisplay_mark): We need to invalidate
the region not just redisplay it after-all, since we store the
cursors in the LineDisplay. (Ugly interactions here between
GtkLayout and GtkTextBTree here.)
* gtk/gtktextbtree.c (redisplay_region): Fixed reversed comparison.
Thu May 18 18:43:21 2000 Owen Taylor <otaylor@redhat.com>
* gdk/gdkwindow.h gdk/x11/gdkgeometry-x11.c (gdk_window_scroll):
Added function to scroll contents of a window while keeping the
window constant. Works by XCopyArea or guffaw-scrolling depending
on the details of how the window is set up. (guffaw-scrolling
still needs to be filled in.)
Wed May 17 22:36:53 2000 Owen Taylor <otaylor@redhat.com>
* gtk/gtktextiter.c gtk/gtkmain.c: Add a debug key for the text widget,
move the debugging that was tied to a global variable
to that.
* gtk/gtkmarshal.list: Add NONE:INT,INT,INT
* gtk/gtktextbtree.[ch] gtk/gtktextlayout.c: Keep a separate
validated flag, in line data instead of setting height/width to
-1. This allows us to perform operations with partially invalid
buffer (using the old size for invalid lines) and thus to do
incremental vaidation. Keep height/width aggregates up to date
when deleting text and rebalancing the tree.
* gtk/gtktextbtree.[ch]: Add functions validate a line
(gtk_text_btree_validate_line), and to validate up
to a number of pixels (gtk_text_btree_validate).
* gtk/gtktextlayout.[ch]: Add an ::invalidated signal
that indicates that something is changed and a revalidation
pass is needed. Change ::need_repaint to ::changed, and
make it take old and new yranges instead of a rectangle.
* gtk/gtktextbtree.[ch] gtk/gtktextlayout.[ch]: Move
the line_data_destroy() function from
gtk_text_btree_add_view() to a virtual function in
GtkTextLayout
* gtk/gtktextbtree.[ch]: Remove gtk_text_btree_get_damage_range(),
since we are handling partial repaints in a different fashion
now.
* gtk/gtktextbtree.[ch]: Only repaint the changed portion
of the selection instead of queueing a repaint on the
entire widget.
* gtk/gtktextbuffer.[ch] gtk/gtktextbtree.[ch]: Move
get_selection_bounds() down to btree, make the function
in buffer a wrapper around the btree function.
* gtk/gtktextlayout.[ch]: Add functions to check if the
layout is valid and to recompute either a range of pixels
aroudn a line or a certain total number of pixels.
* gtk/gtktextlayout.[ch]: Cache a single line display;
now that we only redraw the needed portions, the hit rate
for this cache is quite high.
* gtk/gtktextview.[ch]: Keep track of the first paragraph
on the screen so that when re-laying-out the buffer, we can
keep the same place. This requires connecting to ::value_changed
on the adjustments
* gtk/gtktextview.[ch]: Add idle functions to revalidate
the buffer after we receive an ::invalidated signal.
Wed May 17 22:10:47 2000 Owen Taylor <otaylor@redhat.com>
* gtk/gtklayout.c (gtk_layout_size_allocate): Set upper
to max of allocation and layout size, not just to the
layout size.
* gtk/gtk[hv]scrollbar.c (gtk_[hv]scrollbar_calc_slider_size):
Invalidate window so it gets redrawn properly.
* gdk/gdkwindow.c (gdk_window_invalidate_rect): Allow rect == NULL
to mean the entire window.
* gdk/gdkevents.h: Move definition for GDK_PRIORITY_REDRAW
into public header.
Mon May 15 14:51:31 2000 Owen Taylor <otaylor@redhat.com>
* gtk/gtktextmark.c (gtk_text_mark_get_name): Add function
to get the name of a mark.
* gtk/gtktextlayout.c (gtk_text_layout_get_line_at_y): Add a function
to find the paragraph from a y position.
Thu May 11 12:57:20 2000 Owen Taylor <otaylor@redhat.com>
* gtk/gtktextbtree.c (gtk_text_btree_node_invalidate_upward): Valid
nodes have width/height >= 0, not > 0.
Tue May 9 21:29:06 2000 Owen Taylor <otaylor@redhat.com>
* gtk/gtktextlayout.[ch] gtk/gtktextdisplay.c (gtk_text_layout_get_line_display):
Add a size_only flag, so when we only need the size, we don't create
useless appearance attributes.
* gtk/gtktextview.c (gtk_text_view_ensure_layout): Remove
duplicate setting of font description.
* gtk/gtkscale.c: Use PANGO_SCALE instead of 1000
Wed Apr 26 01:53:23 2000 Owen Taylor <otaylor@redhat.com>
* gtk/Makefile.am (EXTRA_DIST): Add OLD_STAMP into
EXTRA_DIST. It does not work well when the file that
everything depends on is not in the tarball.
Wed Apr 26 00:56:14 2000 Owen Taylor <otaylor@redhat.com>
* gtk/testgtk.c: Some hacks and fixes so that it basically
works when not sitting in the GTK+ build tree.
2000-05-03 Havoc Pennington <hp@redhat.com>
* gtk/gtktextbtree.c (gtk_text_line_next_could_contain_tag):
Properly determine the ordering of the tag root and the current
line within the tree. Previous algorithm only worked if the tag
root's immediate parent was the common root of both the current
line and the tag root.
Wed Apr 26 00:43:00 2000 Owen Taylor <otaylor@redhat.com>
* gtk/gtktextlayout.c (set_para_values): Fix some bugs in
alignment.
* gtk/gtktextview.c (gtk_text_view_ensure_layout): Track
the widget text directional dynamically.
* gtk/gtktextview.[ch]: Added functions to get and set default
wrap mode.
Tue Apr 25 23:47:38 2000 Owen Taylor <otaylor@redhat.com>
* gtk/gtktextlayout.c (gtk_text_layout_get_iter_location): Fix bug
in cursor location computation.
Tue Apr 25 23:22:59 2000 Owen Taylor <otaylor@redhat.com>
* gtk/gtklayout.c (gtk_layout_set_size): Clamp hadjustment/
vadjusment values properly when layout gets smaller.
* gtk/gtktextview.c (need_repaint_handler): Areas being
passed in are far completely inaccurate, and sometimes
too small, so, for now, just queue a redraw on the
whole visible region.
2000-04-25 Havoc Pennington <hp@redhat.com>
* gtk/gtktextbtree.c (summary_destroy): new function to
destroy tag summary nodes
(gtk_text_line_next_could_contain_tag): this function was
totally broken if the line passed in wasn't below the tag
root. Fix it.
(gtk_text_btree_first_could_contain_tag): In the tag == NULL
"wildcard" case, we have to do a linear scan. Blah.
(gtk_text_btree_last_could_contain_tag): In tag == NULL case,
we have to do the linear scan
(tag_removed_cb): When a tag is removed from the tag table,
remove the GtkTextTagInfo node from the btree.
(gtk_text_btree_spew): Implement the spew function, for
our debugging pleasure.
Tue Apr 25 19:40:18 2000 Owen Taylor <otaylor@redhat.com>
* gtk/gtktextlayout.c (gtk_text_layout_set_buffer): Fix
a problem with referring to the wrong buffer.
* gtk/gtkentry.c: Fix focus-in/focus-out confusion.
* gtk/gtkrc.c gtk/gtkstyle.c: Moving setting default
font description to gtk_style_new() - otherwise things
don't work without a .gtkrc file.
* gtk/gtktextbuffer.c (gtk_text_buffer_new): Sink the
tags table if we create it ourself, too.
* gdk/gdktypes.h (enum): Move GDK_RELEASE_MASK, since
it was conflicting with XKB modifiers.
* gtk/gtktextview.[ch]: Add simple support for
GtkIMContext.
Mon Apr 24 19:34:18 2000 Owen Taylor <otaylor@redhat.com>
* gtk/gtkentry.c (gtk_entry_move_cursor_visually): Fix problem
with deletion from last commit.
Mon Apr 24 19:29:40 2000 Owen Taylor <otaylor@redhat.com>
* gtk/gtkwidget.c (gtk_widget_create_pango_context): Set the language
in the context from the current locale.
* gtk/gtkentry.c (gtk_entry_size_request): Use language from the
context, not hardcoded value.
* gtk/gtkentry.c (gtk_entry_move_cursor): Make character movement visual,
not logical.
Sun Apr 23 23:39:18 2000 Owen Taylor <otaylor@redhat.com>
* gtk/gtkentry.c gtk/gtktextdisplay.c: Don't handle selections as
attributes - that doesn't handle partial-glyph selection
properly. Instead use new pango_layout_line_get_x_ranges()
functionality to draw the selection.
* gtk/gtkentry.c: Simplify code since pango_layout_line_index_to_x()
now properly handles out-of-range coordinates.
* gtk/gtktextbuffer.c: Emit "mark_set" when the cursor is moved.
* gtk/gtktextiter.h gtk/gtktextiterprivate.h: Make gtk_text_iter_get_line_byte()
public.
* gtk/gtktextlayout.[ch]: Properly set the direction in the PangoContext
for paragraphs opposite to the base direction of the widget.
* gtk/gtktextlayout.[ch] gtk/gtktextdisplay.c: Fixes for alignment.
* gtk/gtktextlayout.c: Don't split segments on marks, since that
causes Arabic words to reshape as you cursor through.
* gtk/gtktextlayout.[ch] gtk/gtktextview.[ch]: Implement virtual
cursor position when moving vertically with the arrow keys and
scrolling with page-up/page-down. (Arrow keys save only the X,
scrolling saves both X and Y.)
This means you can line-up / line-down or page-up / page-down
without losing your place, and also that moving vertically
with the cursor keys keeps the same X position, not the same
character count:
* gtk/gtktextlayout.[ch] gtk/gtktextview.[ch]: Make vertical
arrow keys move by display lines, not paragraphs.
Tue Apr 18 14:16:50 2000 Owen Taylor <otaylor@redhat.com>
* gtk/gtklayout.c: Make sure that the bin window is at least
as big as the allocation. (Should we also make sure that the
bin window is big enough to completely cover widget->window?)
* gtk/gtktextview.c (gtk_text_view_get_visible_rect): Add
function to get the onscreen rectangle.
* gdk/x11/gdkwindow-x11.c (gdk_window_get_pointer): Correctly account
for offsets in window coordinates.
Sun Apr 16 16:13:27 2000 Owen Taylor <otaylor@redhat.com>
* gtk/gtkentry.c (gtk_entry_get_cursor_locations): Fix index/offset
confusion.
* gtk/gtktextview.c (gtk_text_view_ensure_layout): Set the default direction
from the widget direction.
* gtk/gtktexttag.c gtk/gtktexttagprivate.h (gtk_text_tag_set_arg):
Add a "direction" attribute.
* gtk/gtktextview.c: global s/tkxt/text_view/.
* gtk/testtext.c: Added long block of text in Arabic, to test out
the direction attributes. (Some problems with the shaping system
for arabic become obvious - like the fact the cursor splits words
into unjoined pieces.)
Fri Apr 14 12:54:34 2000 Owen Taylor <otaylor@redhat.com>
* gtk/gtktextdisplay.c (render_layout): Add overstrike handling.
* gtk/gtktextlayout.c: Fix up alignment.
* gtk/testtext.c: Add some tests for centering, wrapping.
Fri Apr 14 09:26:22 2000 Owen Taylor <otaylor@redhat.com>
* gdk/gdkdrawable.h gdk/gdkdraw.c gdk/gdkwindow.c gdk/x11/gdkdrawable-x11.c:
Add a draw_glyphs() operation to the drawable vtable and gdk_draw_glyphs().
If we wrote GTK+-specific layout-render function this could just replace
the draw_layout() operation in the vtable.
* gtk/gtkentry.c: Move guts of gtk_entry_get_cursor_locations to
pango_layout_get_cursor_pos() and use that function.
* gtk/gtktextchild.[ch]: add gtk_ onto pixmap_segment_new(), since it
is a non-static symbol.
* gtk/gtktextbtree.[ch]: Replace gtk_text_btree_find_line_data_by_y()
with gtk_text_btree_find_line_by_y()
* gtk/gtktextdisplay.c: Rewrote for Pango - uses a custom layout
renderer that handles GtkTextAppearance attributes.
* gtk/gtktexttag.[ch] gtk/gtktexttagprivate.h:
- Move the values in the style that don't affect geometry into a
GtkTextAppearance structure.
- Change underline to take a PangoUnderline and "font" a string
representation of a font description
- Add a "font_desc" attribute which takes a FontDescription structure.
* gtk/gtktextlayout.[ch]:
- Get rid of the display-line list per each line. Instead, we
generate, on demand, a GtkTextLineDisplay structure which]
contains a PangoLayout * and other necesary information
(offsets, cursor locations) for displaying a paragraph.
- Get rid of the code to wrap lines, create display chunks,
etc. Instead, we just go through a paragraph and convert
it into the necessary inputs to a PangoLayout.
- Implement a new attribute type, GtkTextAttrAppearance. This
holds a GtkTextAppearance, and is used to pass colors,
stipple, etc, through from the layout to the display without
having to use lots and lots of individual attributes.
- Reimplement gtk_layout_get_iter_at_pixel() gtk_layout_get_iter_pos()
in terms of PangoLayout functions.
* gtk/gtktextview.c:
- Handle passing the necessary PangoContext to the layout
- Some fixups in painting to deal with the automatic backing store
and offsetting of GTK+-1.4
- Add a style_set handler so that the default style reacts
properly to theme changes.
* gtk/gtktext?*.[ch]: Random code-style fixes.
* gtk/testtext.c: Substitute in languages that Pango handles now for Thai
Mon Apr 10 10:33:45 2000 Owen Taylor <otaylor@redhat.com>
* gtk/gtktext?*.[ch]: Check in Havoc's port of the Tk text widget,
in original form preparatory to Pango-ization and gdkimcontext-ization.
Thu Apr 6 19:25:39 2000 Owen Taylor <otaylor@redhat.com>
* gtk/gtkimcontext.c: Move default implementations to real_* vfuncs,
so that we can derive from gtkimcontext in language bindings properly.
Thu Apr 6 16:02:52 2000 Owen Taylor <otaylor@redhat.com>
* gtk/gtkimcontextsimple.[ch]: Use gdk_keyval_to_unicode to gdk_unicode_to_keyval.
Add a compose table including (almost) all the compose combinations
from X. This is 6k of static, shared data as opposed to 50k or so of dynamic
data in the XIM implementation.
* gdk/gdk.h gdk/gdkkeyuni.c gdk/win32/gdkevents-win32.c (gdk_keyval_to_unicode, gdk_unicode_to_keyval):
Moved functions to convert keyvalues from and to unicode here from
the win32 port and made them public.
Wed Apr 5 16:37:29 2000 Owen Taylor <otaylor@redhat.com>
* gtk/gtkeditable.c (gtk_editable_insert_text): Allow new_text_length == -1.
Wed Apr 5 16:27:45 2000 Owen Taylor <otaylor@redhat.com>
* gtk/gtkimcontext.[ch]: Base class for new input context system
* gtk/gtkimmulticontext.[ch]: Proxy input context that allows
the real input context implementation to be loaded from modules
and switched on the fly.
* gtk/gtkcontextsimple.[ch]: Simple implementation of an input
context that just does direct keysymbol => unicode translation.
* gtk/gtkentry.[ch]: Start switching editing over to using
GtkInputContext. (No handling of preedit yet.)
Wed Apr 5 15:48:41 2000 Owen Taylor <otaylor@redhat.com>
* gtk/gtktypeutils.h (GTK_CHECK_GET_CLASS): Fix problem with one too
many substitutions. (klass should not be subsituted.)
Wed Apr 5 00:18:14 2000 Owen Taylor <otaylor@redhat.com>
* configure.in: Add checks for Pango
* configure.in docs/Makefile.am: Add test for sgml2html
and allow 'make dist' without building html, but print out
warnings in that case. (For making snapshots)
* gdk/Makefile.am gdk/x11/Makefile.am gtk/Makefile.am:
Add Pango libraries and C flags
* gdk/gdkdraw.c gdk/gdkdrawable.h gdkwindow.c gdk/x11/gdkdrawable-x11.c:
Add function (gdk_draw_layout) to draw a pango layout.
* gdk/gdkpango.h gdk/x11/gdkpango-x11.c: New file with functions
for getting Pango contexts for GDK.
* gtk/gtkeditable.c: Get rid of dead code gtk_editable_parent_set()
* gtk/gtkentry.[ch]: Complete rewrite to use Pango, add bidirectional
editing.
* gtk/gtkentry.c: Hack in simple Hebrew input with direct
keysym => unicode translations. More languages can be added
here, but real input-method support is needed.
* docs/Changes-1.4.txt: Added note about entry behavior.
* gtk/gtkenums.h gtk/gtkwidget.[ch] testgtk.c gtkprivate.h: Add functions
to set the reading direction for a widget and the global direction.
Add test which allows toggling the global direction. Two private
flags are used to store the direction. (GTK_DIRECTION_SET + GTK_DIRECTION_LTR)
* gtk/gtkcheckbutton.c gtk/gtkframe.c gtk/gtkhbbox.c gtk/gtkhbox.c
gtk/gtkradiobutton.c gtk/gtkspinbutton.c gtk/gtktable.c
* gtk/gtk[hv]scale.c gtk/gtkscale.[ch]: Draw numbers using Pango
* gtk/gtklabel.[ch]: Moved to Pango and considerably rewritten. Line breaking,
underlining now handled by Pango.
* gtk/gtkstyle.[ch] gtk/gtkrc.[ch]: Add a PangoFontDescription
to RCStyle and Style. (Having both this and the old font name and GdkFont
is temporary.)
* gtk/gtkwidget.[ch] (gtk_widget_create_pango_{context,layout}): Added
convenience functions for creating contexts and layouts for widgets.
* gtk/testgtk.c: Enhance label tests with multilingual labels.
2000-06-02 03:14:07 +00:00
|
|
|
|
|
2005-05-11 19:16:19 +00:00
|
|
|
|
result = week_of_year (&week, &year,
|
|
|
|
|
((calendar->day[row][6] < 15 && row > 3 ? 1 : 0)
|
|
|
|
|
+ calendar->month) % 12 + 1, calendar->day[row][6]);
|
|
|
|
|
g_return_if_fail (result);
|
Remove all references to offscreen flag which was no longer used.
Thu Jun 1 23:05:13 2000 Owen Taylor <otaylor@redhat.com>
* gtk/gtkwidget.c: Remove all references to
offscreen flag which was no longer used.
* gtk/gtkprivate.h (enum): Remove unused flags and compress.
* gtk/gtkframe.c (gtk_frame_set_label_widget): Check
for non-null label_widget->parent.
* gtk/gtkentry.c: Get rid of code to deal with PangoAttribute
which no longer was used.
* gdk/gdkpango.c (gdk_pango_context_get_info): make static.
* gdk/gdkpango.c (gdk_draw_layout[_line]): Add checks
for null arguments.
* gdk/x11/gdkgeometry-x11.c (gdk_window_scroll): add
check for destroyed windows.
Thu Jun 1 13:48:45 2000 Owen Taylor <otaylor@redhat.com>
* gtk/gtkimmulticontext.c: Add a finalize method and unref
the slave context there.
* gtk/gtkinvisible.[ch]: Make reference counting behavior
identical to GtkWindow.
Thu Jun 1 01:54:11 2000 Owen Taylor <otaylor@redhat.com>
* Makefile.am gdk/gdkpango.c: Copy the layout render function from
pangox to here, so we can write them independent of rendering
system, using GDK primitives.
* gdk/gdkdrawable.h gdk/gdkdraw.c gdk/gdkwindow.c
gdk/x11/gdkdrawable-x11.c: Remove draw_layout() from the vtable,
since we have a rendering-system independent implementation in
terms of draw_glyphs().
* gdk/gdkpango.c gdkdrawable.h (gdk_draw_layout_line): New
function to render a single line.
* gdk/x11/gdkpango.c: Move the guts of this file mostly
into ../gdkpango.c, which simplifies things, since we
don't have to deal with raw X gc's.
Fri May 19 04:28:16 2000 Owen Taylor <otaylor@redhat.com>
* gtk/gtktextlayout.[ch]: Add get_log_attrs() function to
get the logical attributes for a given GtkTextLine.
Tue May 30 16:05:39 2000 Owen Taylor <otaylor@redhat.com>
* gdk/x11/gdkfont-x11.c (gdk_font_charset_for_locale): Track
g_locale_get_codeset() to g_get_codeset() change.
Tue May 30 15:03:19 2000 Owen Taylor <otaylor@redhat.com>
* gtk/testcalendar.c (calendar_font_selection_ok): Use font
descriptions.
* gtk/gtkentry.c (gtk_entry_draw_text): Center text within
the entry.
* gtk/gtkfontsel.c (gtk_font_selection_dialog_init): Start of
redoing (vastly simplifying) for Pango. Still needs quite
a bit of work. (Size selection is currently poor. List of
predefined sizes is not a good idea, since all of these
sizes won't necessarily be distinct.)
Tue May 30 13:50:19 2000 Owen Taylor <otaylor@redhat.com>
* gdk/x11/gdkfont-x11.c (gdk_font_charset_for_locale): Handle
CODESET results for LANG=C.
Mon May 29 15:49:10 2000 Owen Taylor <otaylor@redhat.com>
* gtk/gtkrc.[ch]: Add a 'font_name' declaration to RC
which takes a stringized pango font description;
ignore the older 'font' and 'fontset' declarations.
* gtk/gtkstyle.c gtk/gtkrc.c: Fill in the style->font
field with a GdkFont derived via gdk_font_from_description(),
for compatibility. (Should we just remove it entirely?
Probably too much compatibility breakage, but people
should be migrating to the new Pango stuff as quickly
as possible.)
Mon May 29 15:47:41 2000 Owen Taylor <otaylor@redhat.com>
* gtk/gtkentry.c gtk/gtkclist.c: s/pango_font_unref/g_object_unref/.
Mon May 29 15:44:46 2000 Owen Taylor <otaylor@redhat.com>
* gtk/gtkcalender.c: Roughly pango-ized. Really needs
redoing; there are some bugs in size allocation right
now, the semi-existant distinction between header / day
fonts was removed, but, with Pango, could actually
be made functional in a nice way.
* gtk/testcalender: Move calender from examples into this
directory as a test program. (We really need to restrcture
testgtk into a whole directory full of tests for every
widget or functionality group, separated into multiple .c
files.)
Mon May 29 15:19:56 2000 Owen Taylor <otaylor@redhat.com>
* gtk/testgtk.c (file_exists): Fix stupid typo that
was keeping RC file from being loaded.
* gtk/testgtkrc gtk/testgtkrc2: Test new pango-ized
RC file font code.
Mon May 29 14:31:27 2000 Owen Taylor <otaylor@redhat.com>
* gdk/gdkfont.h gdk/x11/gdkfont-x11.c (gdk_font_from_description):
Add function to load a GdkFont from a PangoFontDescription.
Fri May 26 17:16:40 2000 Owen Taylor <otaylor@redhat.com>
* gtk/frame.[ch] gtkaspectframe.c: Make frame widgets able
to have any widget for the label, use a GtkLabel widget
to display the text. (Based partially on a patch from
Anders Carlson.)
(Quite a bit of code reorganization - strip 90% of the
guts out of gtkaspectframe and add a single virtual
func to GtkFrameClass - compute_child_allocation.)
Fri May 26 12:00:02 2000 Owen Taylor <otaylor@redhat.com>
* gtk/gtkctree.c gtk/gtkclist.[ch]: Pangoized.
(Removed clist->row_center_offset field because caching
it wasn't saving time or code, added private function
_gtk_clist_create_cell_layout()).
Wed May 24 15:59:37 2000 Owen Taylor <otaylor@redhat.com>
* gtk/gtkaccellabel.c: Pangoized.
* gtk/[hv]ruler.c: Pangoized
Mon May 22 19:23:59 2000 Owen Taylor <otaylor@redhat.com>
* gtk/gtkfilesel.c (gtk_file_selection_init):
Use gtk_clist_set_column_auto_resize() to remove need
need for manual column width computations.
Mon May 22 18:50:26 2000 Owen Taylor <otaylor@redhat.com>
* gtk/gtktooltips.[ch]: Replace custom drawing with a GtkLabel,
ensuring Pango correctness, and considerably simplifying the
code.
* gtk/gtklabel.c gtk[hv]scale.c: 1000 => PANGO_SCALE.
* gtk/gtklabel.c (gtk_label_size_request): Fixed incorrect
getting of numbers of lines.
* gtk/gtklabel.c (gtk_label_size_request): Set the requisition
to the actual requested width of the lable, not to the wrap
width we set.
* gtk/gtktextchild.h: Remove extraneous include of gtk/gtk.h.
* gtk/gtktextbtree.c gtk/gtktextbuffer.c gtk/gtktextlayout.c
gtk/gtktextview.c gtk/gtktextview.[ch]: Fix up includes.
* gtk/gtktextview.c: Fix structure inheritance.
* gtk/gtkprogressbar.c: Pangoize.
Mon May 22 15:47:30 2000 Owen Taylor <otaylor@redhat.com>
* gtk/gtktextview.c (gtk_text_view_get_first_para_iter): Encapsulate
in a function.
* gtk/gtktextlayout.c (find_display_line_above): Fixed
bug with computing line tops.
* gtk/gtktextview.c (changed_handler): Fix < , <= confusion.
Thu May 18 18:53:31 2000 Owen Taylor <otaylor@redhat.com>
* gtk/gtktextdisplay.c (gtk_text_layout_draw): Fix up the x_offset
and y_offset coordinates to do what we need now. (The offset between
buffer and layout coordinates has been reintroduced, but is a
bit different than before.)
* gtk/gtktextview.[ch]: No longer inherit from GtkLayout; instead
handle the adjustments ourselves, and scroll as necessary using
the new gdk_window_scroll().
The advantage of this is that when we are incrementally revalidating,
we are essentially rearranging things around the visible portion
of the screen. With the old setup, the visible portion of the
screen was moved around in the layout, so scrolling and redrawing
to track that caused jumping of the display. Since we now
control the scrolling ourselves, we can suppress this and
only redraw when things actually change.
Thu May 18 18:47:25 2000 Owen Taylor <otaylor@redhat.com>
* gtk/gtktextbtree.c (redisplay_mark): We need to invalidate
the region not just redisplay it after-all, since we store the
cursors in the LineDisplay. (Ugly interactions here between
GtkLayout and GtkTextBTree here.)
* gtk/gtktextbtree.c (redisplay_region): Fixed reversed comparison.
Thu May 18 18:43:21 2000 Owen Taylor <otaylor@redhat.com>
* gdk/gdkwindow.h gdk/x11/gdkgeometry-x11.c (gdk_window_scroll):
Added function to scroll contents of a window while keeping the
window constant. Works by XCopyArea or guffaw-scrolling depending
on the details of how the window is set up. (guffaw-scrolling
still needs to be filled in.)
Wed May 17 22:36:53 2000 Owen Taylor <otaylor@redhat.com>
* gtk/gtktextiter.c gtk/gtkmain.c: Add a debug key for the text widget,
move the debugging that was tied to a global variable
to that.
* gtk/gtkmarshal.list: Add NONE:INT,INT,INT
* gtk/gtktextbtree.[ch] gtk/gtktextlayout.c: Keep a separate
validated flag, in line data instead of setting height/width to
-1. This allows us to perform operations with partially invalid
buffer (using the old size for invalid lines) and thus to do
incremental vaidation. Keep height/width aggregates up to date
when deleting text and rebalancing the tree.
* gtk/gtktextbtree.[ch]: Add functions validate a line
(gtk_text_btree_validate_line), and to validate up
to a number of pixels (gtk_text_btree_validate).
* gtk/gtktextlayout.[ch]: Add an ::invalidated signal
that indicates that something is changed and a revalidation
pass is needed. Change ::need_repaint to ::changed, and
make it take old and new yranges instead of a rectangle.
* gtk/gtktextbtree.[ch] gtk/gtktextlayout.[ch]: Move
the line_data_destroy() function from
gtk_text_btree_add_view() to a virtual function in
GtkTextLayout
* gtk/gtktextbtree.[ch]: Remove gtk_text_btree_get_damage_range(),
since we are handling partial repaints in a different fashion
now.
* gtk/gtktextbtree.[ch]: Only repaint the changed portion
of the selection instead of queueing a repaint on the
entire widget.
* gtk/gtktextbuffer.[ch] gtk/gtktextbtree.[ch]: Move
get_selection_bounds() down to btree, make the function
in buffer a wrapper around the btree function.
* gtk/gtktextlayout.[ch]: Add functions to check if the
layout is valid and to recompute either a range of pixels
aroudn a line or a certain total number of pixels.
* gtk/gtktextlayout.[ch]: Cache a single line display;
now that we only redraw the needed portions, the hit rate
for this cache is quite high.
* gtk/gtktextview.[ch]: Keep track of the first paragraph
on the screen so that when re-laying-out the buffer, we can
keep the same place. This requires connecting to ::value_changed
on the adjustments
* gtk/gtktextview.[ch]: Add idle functions to revalidate
the buffer after we receive an ::invalidated signal.
Wed May 17 22:10:47 2000 Owen Taylor <otaylor@redhat.com>
* gtk/gtklayout.c (gtk_layout_size_allocate): Set upper
to max of allocation and layout size, not just to the
layout size.
* gtk/gtk[hv]scrollbar.c (gtk_[hv]scrollbar_calc_slider_size):
Invalidate window so it gets redrawn properly.
* gdk/gdkwindow.c (gdk_window_invalidate_rect): Allow rect == NULL
to mean the entire window.
* gdk/gdkevents.h: Move definition for GDK_PRIORITY_REDRAW
into public header.
Mon May 15 14:51:31 2000 Owen Taylor <otaylor@redhat.com>
* gtk/gtktextmark.c (gtk_text_mark_get_name): Add function
to get the name of a mark.
* gtk/gtktextlayout.c (gtk_text_layout_get_line_at_y): Add a function
to find the paragraph from a y position.
Thu May 11 12:57:20 2000 Owen Taylor <otaylor@redhat.com>
* gtk/gtktextbtree.c (gtk_text_btree_node_invalidate_upward): Valid
nodes have width/height >= 0, not > 0.
Tue May 9 21:29:06 2000 Owen Taylor <otaylor@redhat.com>
* gtk/gtktextlayout.[ch] gtk/gtktextdisplay.c (gtk_text_layout_get_line_display):
Add a size_only flag, so when we only need the size, we don't create
useless appearance attributes.
* gtk/gtktextview.c (gtk_text_view_ensure_layout): Remove
duplicate setting of font description.
* gtk/gtkscale.c: Use PANGO_SCALE instead of 1000
Wed Apr 26 01:53:23 2000 Owen Taylor <otaylor@redhat.com>
* gtk/Makefile.am (EXTRA_DIST): Add OLD_STAMP into
EXTRA_DIST. It does not work well when the file that
everything depends on is not in the tarball.
Wed Apr 26 00:56:14 2000 Owen Taylor <otaylor@redhat.com>
* gtk/testgtk.c: Some hacks and fixes so that it basically
works when not sitting in the GTK+ build tree.
2000-05-03 Havoc Pennington <hp@redhat.com>
* gtk/gtktextbtree.c (gtk_text_line_next_could_contain_tag):
Properly determine the ordering of the tag root and the current
line within the tree. Previous algorithm only worked if the tag
root's immediate parent was the common root of both the current
line and the tag root.
Wed Apr 26 00:43:00 2000 Owen Taylor <otaylor@redhat.com>
* gtk/gtktextlayout.c (set_para_values): Fix some bugs in
alignment.
* gtk/gtktextview.c (gtk_text_view_ensure_layout): Track
the widget text directional dynamically.
* gtk/gtktextview.[ch]: Added functions to get and set default
wrap mode.
Tue Apr 25 23:47:38 2000 Owen Taylor <otaylor@redhat.com>
* gtk/gtktextlayout.c (gtk_text_layout_get_iter_location): Fix bug
in cursor location computation.
Tue Apr 25 23:22:59 2000 Owen Taylor <otaylor@redhat.com>
* gtk/gtklayout.c (gtk_layout_set_size): Clamp hadjustment/
vadjusment values properly when layout gets smaller.
* gtk/gtktextview.c (need_repaint_handler): Areas being
passed in are far completely inaccurate, and sometimes
too small, so, for now, just queue a redraw on the
whole visible region.
2000-04-25 Havoc Pennington <hp@redhat.com>
* gtk/gtktextbtree.c (summary_destroy): new function to
destroy tag summary nodes
(gtk_text_line_next_could_contain_tag): this function was
totally broken if the line passed in wasn't below the tag
root. Fix it.
(gtk_text_btree_first_could_contain_tag): In the tag == NULL
"wildcard" case, we have to do a linear scan. Blah.
(gtk_text_btree_last_could_contain_tag): In tag == NULL case,
we have to do the linear scan
(tag_removed_cb): When a tag is removed from the tag table,
remove the GtkTextTagInfo node from the btree.
(gtk_text_btree_spew): Implement the spew function, for
our debugging pleasure.
Tue Apr 25 19:40:18 2000 Owen Taylor <otaylor@redhat.com>
* gtk/gtktextlayout.c (gtk_text_layout_set_buffer): Fix
a problem with referring to the wrong buffer.
* gtk/gtkentry.c: Fix focus-in/focus-out confusion.
* gtk/gtkrc.c gtk/gtkstyle.c: Moving setting default
font description to gtk_style_new() - otherwise things
don't work without a .gtkrc file.
* gtk/gtktextbuffer.c (gtk_text_buffer_new): Sink the
tags table if we create it ourself, too.
* gdk/gdktypes.h (enum): Move GDK_RELEASE_MASK, since
it was conflicting with XKB modifiers.
* gtk/gtktextview.[ch]: Add simple support for
GtkIMContext.
Mon Apr 24 19:34:18 2000 Owen Taylor <otaylor@redhat.com>
* gtk/gtkentry.c (gtk_entry_move_cursor_visually): Fix problem
with deletion from last commit.
Mon Apr 24 19:29:40 2000 Owen Taylor <otaylor@redhat.com>
* gtk/gtkwidget.c (gtk_widget_create_pango_context): Set the language
in the context from the current locale.
* gtk/gtkentry.c (gtk_entry_size_request): Use language from the
context, not hardcoded value.
* gtk/gtkentry.c (gtk_entry_move_cursor): Make character movement visual,
not logical.
Sun Apr 23 23:39:18 2000 Owen Taylor <otaylor@redhat.com>
* gtk/gtkentry.c gtk/gtktextdisplay.c: Don't handle selections as
attributes - that doesn't handle partial-glyph selection
properly. Instead use new pango_layout_line_get_x_ranges()
functionality to draw the selection.
* gtk/gtkentry.c: Simplify code since pango_layout_line_index_to_x()
now properly handles out-of-range coordinates.
* gtk/gtktextbuffer.c: Emit "mark_set" when the cursor is moved.
* gtk/gtktextiter.h gtk/gtktextiterprivate.h: Make gtk_text_iter_get_line_byte()
public.
* gtk/gtktextlayout.[ch]: Properly set the direction in the PangoContext
for paragraphs opposite to the base direction of the widget.
* gtk/gtktextlayout.[ch] gtk/gtktextdisplay.c: Fixes for alignment.
* gtk/gtktextlayout.c: Don't split segments on marks, since that
causes Arabic words to reshape as you cursor through.
* gtk/gtktextlayout.[ch] gtk/gtktextview.[ch]: Implement virtual
cursor position when moving vertically with the arrow keys and
scrolling with page-up/page-down. (Arrow keys save only the X,
scrolling saves both X and Y.)
This means you can line-up / line-down or page-up / page-down
without losing your place, and also that moving vertically
with the cursor keys keeps the same X position, not the same
character count:
* gtk/gtktextlayout.[ch] gtk/gtktextview.[ch]: Make vertical
arrow keys move by display lines, not paragraphs.
Tue Apr 18 14:16:50 2000 Owen Taylor <otaylor@redhat.com>
* gtk/gtklayout.c: Make sure that the bin window is at least
as big as the allocation. (Should we also make sure that the
bin window is big enough to completely cover widget->window?)
* gtk/gtktextview.c (gtk_text_view_get_visible_rect): Add
function to get the onscreen rectangle.
* gdk/x11/gdkwindow-x11.c (gdk_window_get_pointer): Correctly account
for offsets in window coordinates.
Sun Apr 16 16:13:27 2000 Owen Taylor <otaylor@redhat.com>
* gtk/gtkentry.c (gtk_entry_get_cursor_locations): Fix index/offset
confusion.
* gtk/gtktextview.c (gtk_text_view_ensure_layout): Set the default direction
from the widget direction.
* gtk/gtktexttag.c gtk/gtktexttagprivate.h (gtk_text_tag_set_arg):
Add a "direction" attribute.
* gtk/gtktextview.c: global s/tkxt/text_view/.
* gtk/testtext.c: Added long block of text in Arabic, to test out
the direction attributes. (Some problems with the shaping system
for arabic become obvious - like the fact the cursor splits words
into unjoined pieces.)
Fri Apr 14 12:54:34 2000 Owen Taylor <otaylor@redhat.com>
* gtk/gtktextdisplay.c (render_layout): Add overstrike handling.
* gtk/gtktextlayout.c: Fix up alignment.
* gtk/testtext.c: Add some tests for centering, wrapping.
Fri Apr 14 09:26:22 2000 Owen Taylor <otaylor@redhat.com>
* gdk/gdkdrawable.h gdk/gdkdraw.c gdk/gdkwindow.c gdk/x11/gdkdrawable-x11.c:
Add a draw_glyphs() operation to the drawable vtable and gdk_draw_glyphs().
If we wrote GTK+-specific layout-render function this could just replace
the draw_layout() operation in the vtable.
* gtk/gtkentry.c: Move guts of gtk_entry_get_cursor_locations to
pango_layout_get_cursor_pos() and use that function.
* gtk/gtktextchild.[ch]: add gtk_ onto pixmap_segment_new(), since it
is a non-static symbol.
* gtk/gtktextbtree.[ch]: Replace gtk_text_btree_find_line_data_by_y()
with gtk_text_btree_find_line_by_y()
* gtk/gtktextdisplay.c: Rewrote for Pango - uses a custom layout
renderer that handles GtkTextAppearance attributes.
* gtk/gtktexttag.[ch] gtk/gtktexttagprivate.h:
- Move the values in the style that don't affect geometry into a
GtkTextAppearance structure.
- Change underline to take a PangoUnderline and "font" a string
representation of a font description
- Add a "font_desc" attribute which takes a FontDescription structure.
* gtk/gtktextlayout.[ch]:
- Get rid of the display-line list per each line. Instead, we
generate, on demand, a GtkTextLineDisplay structure which]
contains a PangoLayout * and other necesary information
(offsets, cursor locations) for displaying a paragraph.
- Get rid of the code to wrap lines, create display chunks,
etc. Instead, we just go through a paragraph and convert
it into the necessary inputs to a PangoLayout.
- Implement a new attribute type, GtkTextAttrAppearance. This
holds a GtkTextAppearance, and is used to pass colors,
stipple, etc, through from the layout to the display without
having to use lots and lots of individual attributes.
- Reimplement gtk_layout_get_iter_at_pixel() gtk_layout_get_iter_pos()
in terms of PangoLayout functions.
* gtk/gtktextview.c:
- Handle passing the necessary PangoContext to the layout
- Some fixups in painting to deal with the automatic backing store
and offsetting of GTK+-1.4
- Add a style_set handler so that the default style reacts
properly to theme changes.
* gtk/gtktext?*.[ch]: Random code-style fixes.
* gtk/testtext.c: Substitute in languages that Pango handles now for Thai
Mon Apr 10 10:33:45 2000 Owen Taylor <otaylor@redhat.com>
* gtk/gtktext?*.[ch]: Check in Havoc's port of the Tk text widget,
in original form preparatory to Pango-ization and gdkimcontext-ization.
Thu Apr 6 19:25:39 2000 Owen Taylor <otaylor@redhat.com>
* gtk/gtkimcontext.c: Move default implementations to real_* vfuncs,
so that we can derive from gtkimcontext in language bindings properly.
Thu Apr 6 16:02:52 2000 Owen Taylor <otaylor@redhat.com>
* gtk/gtkimcontextsimple.[ch]: Use gdk_keyval_to_unicode to gdk_unicode_to_keyval.
Add a compose table including (almost) all the compose combinations
from X. This is 6k of static, shared data as opposed to 50k or so of dynamic
data in the XIM implementation.
* gdk/gdk.h gdk/gdkkeyuni.c gdk/win32/gdkevents-win32.c (gdk_keyval_to_unicode, gdk_unicode_to_keyval):
Moved functions to convert keyvalues from and to unicode here from
the win32 port and made them public.
Wed Apr 5 16:37:29 2000 Owen Taylor <otaylor@redhat.com>
* gtk/gtkeditable.c (gtk_editable_insert_text): Allow new_text_length == -1.
Wed Apr 5 16:27:45 2000 Owen Taylor <otaylor@redhat.com>
* gtk/gtkimcontext.[ch]: Base class for new input context system
* gtk/gtkimmulticontext.[ch]: Proxy input context that allows
the real input context implementation to be loaded from modules
and switched on the fly.
* gtk/gtkcontextsimple.[ch]: Simple implementation of an input
context that just does direct keysymbol => unicode translation.
* gtk/gtkentry.[ch]: Start switching editing over to using
GtkInputContext. (No handling of preedit yet.)
Wed Apr 5 15:48:41 2000 Owen Taylor <otaylor@redhat.com>
* gtk/gtktypeutils.h (GTK_CHECK_GET_CLASS): Fix problem with one too
many substitutions. (klass should not be subsituted.)
Wed Apr 5 00:18:14 2000 Owen Taylor <otaylor@redhat.com>
* configure.in: Add checks for Pango
* configure.in docs/Makefile.am: Add test for sgml2html
and allow 'make dist' without building html, but print out
warnings in that case. (For making snapshots)
* gdk/Makefile.am gdk/x11/Makefile.am gtk/Makefile.am:
Add Pango libraries and C flags
* gdk/gdkdraw.c gdk/gdkdrawable.h gdkwindow.c gdk/x11/gdkdrawable-x11.c:
Add function (gdk_draw_layout) to draw a pango layout.
* gdk/gdkpango.h gdk/x11/gdkpango-x11.c: New file with functions
for getting Pango contexts for GDK.
* gtk/gtkeditable.c: Get rid of dead code gtk_editable_parent_set()
* gtk/gtkentry.[ch]: Complete rewrite to use Pango, add bidirectional
editing.
* gtk/gtkentry.c: Hack in simple Hebrew input with direct
keysym => unicode translations. More languages can be added
here, but real input-method support is needed.
* docs/Changes-1.4.txt: Added note about entry behavior.
* gtk/gtkenums.h gtk/gtkwidget.[ch] testgtk.c gtkprivate.h: Add functions
to set the reading direction for a widget and the global direction.
Add test which allows toggling the global direction. Two private
flags are used to store the direction. (GTK_DIRECTION_SET + GTK_DIRECTION_LTR)
* gtk/gtkcheckbutton.c gtk/gtkframe.c gtk/gtkhbbox.c gtk/gtkhbox.c
gtk/gtkradiobutton.c gtk/gtkspinbutton.c gtk/gtktable.c
* gtk/gtk[hv]scale.c gtk/gtkscale.[ch]: Draw numbers using Pango
* gtk/gtklabel.[ch]: Moved to Pango and considerably rewritten. Line breaking,
underlining now handled by Pango.
* gtk/gtkstyle.[ch] gtk/gtkrc.[ch]: Add a PangoFontDescription
to RCStyle and Style. (Having both this and the old font name and GdkFont
is temporary.)
* gtk/gtkwidget.[ch] (gtk_widget_create_pango_{context,layout}): Added
convenience functions for creating contexts and layouts for widgets.
* gtk/testgtk.c: Enhance label tests with multilingual labels.
2000-06-02 03:14:07 +00:00
|
|
|
|
|
2006-01-25 16:26:41 +00:00
|
|
|
|
/* Translators: this defines whether the week numbers should use
|
2006-01-25 17:08:51 +00:00
|
|
|
|
* localized digits or the ones used in English (0123...).
|
2006-01-25 16:26:41 +00:00
|
|
|
|
*
|
2006-03-30 22:56:09 +00:00
|
|
|
|
* Translate to "%Id" if you want to use localized digits, or
|
|
|
|
|
* translate to "%d" otherwise. Don't include the
|
|
|
|
|
* "calendar:week:digits|" part in the translation.
|
2006-01-25 16:26:41 +00:00
|
|
|
|
*
|
|
|
|
|
* Note that translating this doesn't guarantee that you get localized
|
|
|
|
|
* digits. That needs support from your system and locale definition
|
|
|
|
|
* too.
|
|
|
|
|
*/
|
2006-01-25 16:42:37 +00:00
|
|
|
|
g_snprintf (buffer, sizeof (buffer), Q_("calendar:week:digits|%d"), week);
|
Remove all references to offscreen flag which was no longer used.
Thu Jun 1 23:05:13 2000 Owen Taylor <otaylor@redhat.com>
* gtk/gtkwidget.c: Remove all references to
offscreen flag which was no longer used.
* gtk/gtkprivate.h (enum): Remove unused flags and compress.
* gtk/gtkframe.c (gtk_frame_set_label_widget): Check
for non-null label_widget->parent.
* gtk/gtkentry.c: Get rid of code to deal with PangoAttribute
which no longer was used.
* gdk/gdkpango.c (gdk_pango_context_get_info): make static.
* gdk/gdkpango.c (gdk_draw_layout[_line]): Add checks
for null arguments.
* gdk/x11/gdkgeometry-x11.c (gdk_window_scroll): add
check for destroyed windows.
Thu Jun 1 13:48:45 2000 Owen Taylor <otaylor@redhat.com>
* gtk/gtkimmulticontext.c: Add a finalize method and unref
the slave context there.
* gtk/gtkinvisible.[ch]: Make reference counting behavior
identical to GtkWindow.
Thu Jun 1 01:54:11 2000 Owen Taylor <otaylor@redhat.com>
* Makefile.am gdk/gdkpango.c: Copy the layout render function from
pangox to here, so we can write them independent of rendering
system, using GDK primitives.
* gdk/gdkdrawable.h gdk/gdkdraw.c gdk/gdkwindow.c
gdk/x11/gdkdrawable-x11.c: Remove draw_layout() from the vtable,
since we have a rendering-system independent implementation in
terms of draw_glyphs().
* gdk/gdkpango.c gdkdrawable.h (gdk_draw_layout_line): New
function to render a single line.
* gdk/x11/gdkpango.c: Move the guts of this file mostly
into ../gdkpango.c, which simplifies things, since we
don't have to deal with raw X gc's.
Fri May 19 04:28:16 2000 Owen Taylor <otaylor@redhat.com>
* gtk/gtktextlayout.[ch]: Add get_log_attrs() function to
get the logical attributes for a given GtkTextLine.
Tue May 30 16:05:39 2000 Owen Taylor <otaylor@redhat.com>
* gdk/x11/gdkfont-x11.c (gdk_font_charset_for_locale): Track
g_locale_get_codeset() to g_get_codeset() change.
Tue May 30 15:03:19 2000 Owen Taylor <otaylor@redhat.com>
* gtk/testcalendar.c (calendar_font_selection_ok): Use font
descriptions.
* gtk/gtkentry.c (gtk_entry_draw_text): Center text within
the entry.
* gtk/gtkfontsel.c (gtk_font_selection_dialog_init): Start of
redoing (vastly simplifying) for Pango. Still needs quite
a bit of work. (Size selection is currently poor. List of
predefined sizes is not a good idea, since all of these
sizes won't necessarily be distinct.)
Tue May 30 13:50:19 2000 Owen Taylor <otaylor@redhat.com>
* gdk/x11/gdkfont-x11.c (gdk_font_charset_for_locale): Handle
CODESET results for LANG=C.
Mon May 29 15:49:10 2000 Owen Taylor <otaylor@redhat.com>
* gtk/gtkrc.[ch]: Add a 'font_name' declaration to RC
which takes a stringized pango font description;
ignore the older 'font' and 'fontset' declarations.
* gtk/gtkstyle.c gtk/gtkrc.c: Fill in the style->font
field with a GdkFont derived via gdk_font_from_description(),
for compatibility. (Should we just remove it entirely?
Probably too much compatibility breakage, but people
should be migrating to the new Pango stuff as quickly
as possible.)
Mon May 29 15:47:41 2000 Owen Taylor <otaylor@redhat.com>
* gtk/gtkentry.c gtk/gtkclist.c: s/pango_font_unref/g_object_unref/.
Mon May 29 15:44:46 2000 Owen Taylor <otaylor@redhat.com>
* gtk/gtkcalender.c: Roughly pango-ized. Really needs
redoing; there are some bugs in size allocation right
now, the semi-existant distinction between header / day
fonts was removed, but, with Pango, could actually
be made functional in a nice way.
* gtk/testcalender: Move calender from examples into this
directory as a test program. (We really need to restrcture
testgtk into a whole directory full of tests for every
widget or functionality group, separated into multiple .c
files.)
Mon May 29 15:19:56 2000 Owen Taylor <otaylor@redhat.com>
* gtk/testgtk.c (file_exists): Fix stupid typo that
was keeping RC file from being loaded.
* gtk/testgtkrc gtk/testgtkrc2: Test new pango-ized
RC file font code.
Mon May 29 14:31:27 2000 Owen Taylor <otaylor@redhat.com>
* gdk/gdkfont.h gdk/x11/gdkfont-x11.c (gdk_font_from_description):
Add function to load a GdkFont from a PangoFontDescription.
Fri May 26 17:16:40 2000 Owen Taylor <otaylor@redhat.com>
* gtk/frame.[ch] gtkaspectframe.c: Make frame widgets able
to have any widget for the label, use a GtkLabel widget
to display the text. (Based partially on a patch from
Anders Carlson.)
(Quite a bit of code reorganization - strip 90% of the
guts out of gtkaspectframe and add a single virtual
func to GtkFrameClass - compute_child_allocation.)
Fri May 26 12:00:02 2000 Owen Taylor <otaylor@redhat.com>
* gtk/gtkctree.c gtk/gtkclist.[ch]: Pangoized.
(Removed clist->row_center_offset field because caching
it wasn't saving time or code, added private function
_gtk_clist_create_cell_layout()).
Wed May 24 15:59:37 2000 Owen Taylor <otaylor@redhat.com>
* gtk/gtkaccellabel.c: Pangoized.
* gtk/[hv]ruler.c: Pangoized
Mon May 22 19:23:59 2000 Owen Taylor <otaylor@redhat.com>
* gtk/gtkfilesel.c (gtk_file_selection_init):
Use gtk_clist_set_column_auto_resize() to remove need
need for manual column width computations.
Mon May 22 18:50:26 2000 Owen Taylor <otaylor@redhat.com>
* gtk/gtktooltips.[ch]: Replace custom drawing with a GtkLabel,
ensuring Pango correctness, and considerably simplifying the
code.
* gtk/gtklabel.c gtk[hv]scale.c: 1000 => PANGO_SCALE.
* gtk/gtklabel.c (gtk_label_size_request): Fixed incorrect
getting of numbers of lines.
* gtk/gtklabel.c (gtk_label_size_request): Set the requisition
to the actual requested width of the lable, not to the wrap
width we set.
* gtk/gtktextchild.h: Remove extraneous include of gtk/gtk.h.
* gtk/gtktextbtree.c gtk/gtktextbuffer.c gtk/gtktextlayout.c
gtk/gtktextview.c gtk/gtktextview.[ch]: Fix up includes.
* gtk/gtktextview.c: Fix structure inheritance.
* gtk/gtkprogressbar.c: Pangoize.
Mon May 22 15:47:30 2000 Owen Taylor <otaylor@redhat.com>
* gtk/gtktextview.c (gtk_text_view_get_first_para_iter): Encapsulate
in a function.
* gtk/gtktextlayout.c (find_display_line_above): Fixed
bug with computing line tops.
* gtk/gtktextview.c (changed_handler): Fix < , <= confusion.
Thu May 18 18:53:31 2000 Owen Taylor <otaylor@redhat.com>
* gtk/gtktextdisplay.c (gtk_text_layout_draw): Fix up the x_offset
and y_offset coordinates to do what we need now. (The offset between
buffer and layout coordinates has been reintroduced, but is a
bit different than before.)
* gtk/gtktextview.[ch]: No longer inherit from GtkLayout; instead
handle the adjustments ourselves, and scroll as necessary using
the new gdk_window_scroll().
The advantage of this is that when we are incrementally revalidating,
we are essentially rearranging things around the visible portion
of the screen. With the old setup, the visible portion of the
screen was moved around in the layout, so scrolling and redrawing
to track that caused jumping of the display. Since we now
control the scrolling ourselves, we can suppress this and
only redraw when things actually change.
Thu May 18 18:47:25 2000 Owen Taylor <otaylor@redhat.com>
* gtk/gtktextbtree.c (redisplay_mark): We need to invalidate
the region not just redisplay it after-all, since we store the
cursors in the LineDisplay. (Ugly interactions here between
GtkLayout and GtkTextBTree here.)
* gtk/gtktextbtree.c (redisplay_region): Fixed reversed comparison.
Thu May 18 18:43:21 2000 Owen Taylor <otaylor@redhat.com>
* gdk/gdkwindow.h gdk/x11/gdkgeometry-x11.c (gdk_window_scroll):
Added function to scroll contents of a window while keeping the
window constant. Works by XCopyArea or guffaw-scrolling depending
on the details of how the window is set up. (guffaw-scrolling
still needs to be filled in.)
Wed May 17 22:36:53 2000 Owen Taylor <otaylor@redhat.com>
* gtk/gtktextiter.c gtk/gtkmain.c: Add a debug key for the text widget,
move the debugging that was tied to a global variable
to that.
* gtk/gtkmarshal.list: Add NONE:INT,INT,INT
* gtk/gtktextbtree.[ch] gtk/gtktextlayout.c: Keep a separate
validated flag, in line data instead of setting height/width to
-1. This allows us to perform operations with partially invalid
buffer (using the old size for invalid lines) and thus to do
incremental vaidation. Keep height/width aggregates up to date
when deleting text and rebalancing the tree.
* gtk/gtktextbtree.[ch]: Add functions validate a line
(gtk_text_btree_validate_line), and to validate up
to a number of pixels (gtk_text_btree_validate).
* gtk/gtktextlayout.[ch]: Add an ::invalidated signal
that indicates that something is changed and a revalidation
pass is needed. Change ::need_repaint to ::changed, and
make it take old and new yranges instead of a rectangle.
* gtk/gtktextbtree.[ch] gtk/gtktextlayout.[ch]: Move
the line_data_destroy() function from
gtk_text_btree_add_view() to a virtual function in
GtkTextLayout
* gtk/gtktextbtree.[ch]: Remove gtk_text_btree_get_damage_range(),
since we are handling partial repaints in a different fashion
now.
* gtk/gtktextbtree.[ch]: Only repaint the changed portion
of the selection instead of queueing a repaint on the
entire widget.
* gtk/gtktextbuffer.[ch] gtk/gtktextbtree.[ch]: Move
get_selection_bounds() down to btree, make the function
in buffer a wrapper around the btree function.
* gtk/gtktextlayout.[ch]: Add functions to check if the
layout is valid and to recompute either a range of pixels
aroudn a line or a certain total number of pixels.
* gtk/gtktextlayout.[ch]: Cache a single line display;
now that we only redraw the needed portions, the hit rate
for this cache is quite high.
* gtk/gtktextview.[ch]: Keep track of the first paragraph
on the screen so that when re-laying-out the buffer, we can
keep the same place. This requires connecting to ::value_changed
on the adjustments
* gtk/gtktextview.[ch]: Add idle functions to revalidate
the buffer after we receive an ::invalidated signal.
Wed May 17 22:10:47 2000 Owen Taylor <otaylor@redhat.com>
* gtk/gtklayout.c (gtk_layout_size_allocate): Set upper
to max of allocation and layout size, not just to the
layout size.
* gtk/gtk[hv]scrollbar.c (gtk_[hv]scrollbar_calc_slider_size):
Invalidate window so it gets redrawn properly.
* gdk/gdkwindow.c (gdk_window_invalidate_rect): Allow rect == NULL
to mean the entire window.
* gdk/gdkevents.h: Move definition for GDK_PRIORITY_REDRAW
into public header.
Mon May 15 14:51:31 2000 Owen Taylor <otaylor@redhat.com>
* gtk/gtktextmark.c (gtk_text_mark_get_name): Add function
to get the name of a mark.
* gtk/gtktextlayout.c (gtk_text_layout_get_line_at_y): Add a function
to find the paragraph from a y position.
Thu May 11 12:57:20 2000 Owen Taylor <otaylor@redhat.com>
* gtk/gtktextbtree.c (gtk_text_btree_node_invalidate_upward): Valid
nodes have width/height >= 0, not > 0.
Tue May 9 21:29:06 2000 Owen Taylor <otaylor@redhat.com>
* gtk/gtktextlayout.[ch] gtk/gtktextdisplay.c (gtk_text_layout_get_line_display):
Add a size_only flag, so when we only need the size, we don't create
useless appearance attributes.
* gtk/gtktextview.c (gtk_text_view_ensure_layout): Remove
duplicate setting of font description.
* gtk/gtkscale.c: Use PANGO_SCALE instead of 1000
Wed Apr 26 01:53:23 2000 Owen Taylor <otaylor@redhat.com>
* gtk/Makefile.am (EXTRA_DIST): Add OLD_STAMP into
EXTRA_DIST. It does not work well when the file that
everything depends on is not in the tarball.
Wed Apr 26 00:56:14 2000 Owen Taylor <otaylor@redhat.com>
* gtk/testgtk.c: Some hacks and fixes so that it basically
works when not sitting in the GTK+ build tree.
2000-05-03 Havoc Pennington <hp@redhat.com>
* gtk/gtktextbtree.c (gtk_text_line_next_could_contain_tag):
Properly determine the ordering of the tag root and the current
line within the tree. Previous algorithm only worked if the tag
root's immediate parent was the common root of both the current
line and the tag root.
Wed Apr 26 00:43:00 2000 Owen Taylor <otaylor@redhat.com>
* gtk/gtktextlayout.c (set_para_values): Fix some bugs in
alignment.
* gtk/gtktextview.c (gtk_text_view_ensure_layout): Track
the widget text directional dynamically.
* gtk/gtktextview.[ch]: Added functions to get and set default
wrap mode.
Tue Apr 25 23:47:38 2000 Owen Taylor <otaylor@redhat.com>
* gtk/gtktextlayout.c (gtk_text_layout_get_iter_location): Fix bug
in cursor location computation.
Tue Apr 25 23:22:59 2000 Owen Taylor <otaylor@redhat.com>
* gtk/gtklayout.c (gtk_layout_set_size): Clamp hadjustment/
vadjusment values properly when layout gets smaller.
* gtk/gtktextview.c (need_repaint_handler): Areas being
passed in are far completely inaccurate, and sometimes
too small, so, for now, just queue a redraw on the
whole visible region.
2000-04-25 Havoc Pennington <hp@redhat.com>
* gtk/gtktextbtree.c (summary_destroy): new function to
destroy tag summary nodes
(gtk_text_line_next_could_contain_tag): this function was
totally broken if the line passed in wasn't below the tag
root. Fix it.
(gtk_text_btree_first_could_contain_tag): In the tag == NULL
"wildcard" case, we have to do a linear scan. Blah.
(gtk_text_btree_last_could_contain_tag): In tag == NULL case,
we have to do the linear scan
(tag_removed_cb): When a tag is removed from the tag table,
remove the GtkTextTagInfo node from the btree.
(gtk_text_btree_spew): Implement the spew function, for
our debugging pleasure.
Tue Apr 25 19:40:18 2000 Owen Taylor <otaylor@redhat.com>
* gtk/gtktextlayout.c (gtk_text_layout_set_buffer): Fix
a problem with referring to the wrong buffer.
* gtk/gtkentry.c: Fix focus-in/focus-out confusion.
* gtk/gtkrc.c gtk/gtkstyle.c: Moving setting default
font description to gtk_style_new() - otherwise things
don't work without a .gtkrc file.
* gtk/gtktextbuffer.c (gtk_text_buffer_new): Sink the
tags table if we create it ourself, too.
* gdk/gdktypes.h (enum): Move GDK_RELEASE_MASK, since
it was conflicting with XKB modifiers.
* gtk/gtktextview.[ch]: Add simple support for
GtkIMContext.
Mon Apr 24 19:34:18 2000 Owen Taylor <otaylor@redhat.com>
* gtk/gtkentry.c (gtk_entry_move_cursor_visually): Fix problem
with deletion from last commit.
Mon Apr 24 19:29:40 2000 Owen Taylor <otaylor@redhat.com>
* gtk/gtkwidget.c (gtk_widget_create_pango_context): Set the language
in the context from the current locale.
* gtk/gtkentry.c (gtk_entry_size_request): Use language from the
context, not hardcoded value.
* gtk/gtkentry.c (gtk_entry_move_cursor): Make character movement visual,
not logical.
Sun Apr 23 23:39:18 2000 Owen Taylor <otaylor@redhat.com>
* gtk/gtkentry.c gtk/gtktextdisplay.c: Don't handle selections as
attributes - that doesn't handle partial-glyph selection
properly. Instead use new pango_layout_line_get_x_ranges()
functionality to draw the selection.
* gtk/gtkentry.c: Simplify code since pango_layout_line_index_to_x()
now properly handles out-of-range coordinates.
* gtk/gtktextbuffer.c: Emit "mark_set" when the cursor is moved.
* gtk/gtktextiter.h gtk/gtktextiterprivate.h: Make gtk_text_iter_get_line_byte()
public.
* gtk/gtktextlayout.[ch]: Properly set the direction in the PangoContext
for paragraphs opposite to the base direction of the widget.
* gtk/gtktextlayout.[ch] gtk/gtktextdisplay.c: Fixes for alignment.
* gtk/gtktextlayout.c: Don't split segments on marks, since that
causes Arabic words to reshape as you cursor through.
* gtk/gtktextlayout.[ch] gtk/gtktextview.[ch]: Implement virtual
cursor position when moving vertically with the arrow keys and
scrolling with page-up/page-down. (Arrow keys save only the X,
scrolling saves both X and Y.)
This means you can line-up / line-down or page-up / page-down
without losing your place, and also that moving vertically
with the cursor keys keeps the same X position, not the same
character count:
* gtk/gtktextlayout.[ch] gtk/gtktextview.[ch]: Make vertical
arrow keys move by display lines, not paragraphs.
Tue Apr 18 14:16:50 2000 Owen Taylor <otaylor@redhat.com>
* gtk/gtklayout.c: Make sure that the bin window is at least
as big as the allocation. (Should we also make sure that the
bin window is big enough to completely cover widget->window?)
* gtk/gtktextview.c (gtk_text_view_get_visible_rect): Add
function to get the onscreen rectangle.
* gdk/x11/gdkwindow-x11.c (gdk_window_get_pointer): Correctly account
for offsets in window coordinates.
Sun Apr 16 16:13:27 2000 Owen Taylor <otaylor@redhat.com>
* gtk/gtkentry.c (gtk_entry_get_cursor_locations): Fix index/offset
confusion.
* gtk/gtktextview.c (gtk_text_view_ensure_layout): Set the default direction
from the widget direction.
* gtk/gtktexttag.c gtk/gtktexttagprivate.h (gtk_text_tag_set_arg):
Add a "direction" attribute.
* gtk/gtktextview.c: global s/tkxt/text_view/.
* gtk/testtext.c: Added long block of text in Arabic, to test out
the direction attributes. (Some problems with the shaping system
for arabic become obvious - like the fact the cursor splits words
into unjoined pieces.)
Fri Apr 14 12:54:34 2000 Owen Taylor <otaylor@redhat.com>
* gtk/gtktextdisplay.c (render_layout): Add overstrike handling.
* gtk/gtktextlayout.c: Fix up alignment.
* gtk/testtext.c: Add some tests for centering, wrapping.
Fri Apr 14 09:26:22 2000 Owen Taylor <otaylor@redhat.com>
* gdk/gdkdrawable.h gdk/gdkdraw.c gdk/gdkwindow.c gdk/x11/gdkdrawable-x11.c:
Add a draw_glyphs() operation to the drawable vtable and gdk_draw_glyphs().
If we wrote GTK+-specific layout-render function this could just replace
the draw_layout() operation in the vtable.
* gtk/gtkentry.c: Move guts of gtk_entry_get_cursor_locations to
pango_layout_get_cursor_pos() and use that function.
* gtk/gtktextchild.[ch]: add gtk_ onto pixmap_segment_new(), since it
is a non-static symbol.
* gtk/gtktextbtree.[ch]: Replace gtk_text_btree_find_line_data_by_y()
with gtk_text_btree_find_line_by_y()
* gtk/gtktextdisplay.c: Rewrote for Pango - uses a custom layout
renderer that handles GtkTextAppearance attributes.
* gtk/gtktexttag.[ch] gtk/gtktexttagprivate.h:
- Move the values in the style that don't affect geometry into a
GtkTextAppearance structure.
- Change underline to take a PangoUnderline and "font" a string
representation of a font description
- Add a "font_desc" attribute which takes a FontDescription structure.
* gtk/gtktextlayout.[ch]:
- Get rid of the display-line list per each line. Instead, we
generate, on demand, a GtkTextLineDisplay structure which]
contains a PangoLayout * and other necesary information
(offsets, cursor locations) for displaying a paragraph.
- Get rid of the code to wrap lines, create display chunks,
etc. Instead, we just go through a paragraph and convert
it into the necessary inputs to a PangoLayout.
- Implement a new attribute type, GtkTextAttrAppearance. This
holds a GtkTextAppearance, and is used to pass colors,
stipple, etc, through from the layout to the display without
having to use lots and lots of individual attributes.
- Reimplement gtk_layout_get_iter_at_pixel() gtk_layout_get_iter_pos()
in terms of PangoLayout functions.
* gtk/gtktextview.c:
- Handle passing the necessary PangoContext to the layout
- Some fixups in painting to deal with the automatic backing store
and offsetting of GTK+-1.4
- Add a style_set handler so that the default style reacts
properly to theme changes.
* gtk/gtktext?*.[ch]: Random code-style fixes.
* gtk/testtext.c: Substitute in languages that Pango handles now for Thai
Mon Apr 10 10:33:45 2000 Owen Taylor <otaylor@redhat.com>
* gtk/gtktext?*.[ch]: Check in Havoc's port of the Tk text widget,
in original form preparatory to Pango-ization and gdkimcontext-ization.
Thu Apr 6 19:25:39 2000 Owen Taylor <otaylor@redhat.com>
* gtk/gtkimcontext.c: Move default implementations to real_* vfuncs,
so that we can derive from gtkimcontext in language bindings properly.
Thu Apr 6 16:02:52 2000 Owen Taylor <otaylor@redhat.com>
* gtk/gtkimcontextsimple.[ch]: Use gdk_keyval_to_unicode to gdk_unicode_to_keyval.
Add a compose table including (almost) all the compose combinations
from X. This is 6k of static, shared data as opposed to 50k or so of dynamic
data in the XIM implementation.
* gdk/gdk.h gdk/gdkkeyuni.c gdk/win32/gdkevents-win32.c (gdk_keyval_to_unicode, gdk_unicode_to_keyval):
Moved functions to convert keyvalues from and to unicode here from
the win32 port and made them public.
Wed Apr 5 16:37:29 2000 Owen Taylor <otaylor@redhat.com>
* gtk/gtkeditable.c (gtk_editable_insert_text): Allow new_text_length == -1.
Wed Apr 5 16:27:45 2000 Owen Taylor <otaylor@redhat.com>
* gtk/gtkimcontext.[ch]: Base class for new input context system
* gtk/gtkimmulticontext.[ch]: Proxy input context that allows
the real input context implementation to be loaded from modules
and switched on the fly.
* gtk/gtkcontextsimple.[ch]: Simple implementation of an input
context that just does direct keysymbol => unicode translation.
* gtk/gtkentry.[ch]: Start switching editing over to using
GtkInputContext. (No handling of preedit yet.)
Wed Apr 5 15:48:41 2000 Owen Taylor <otaylor@redhat.com>
* gtk/gtktypeutils.h (GTK_CHECK_GET_CLASS): Fix problem with one too
many substitutions. (klass should not be subsituted.)
Wed Apr 5 00:18:14 2000 Owen Taylor <otaylor@redhat.com>
* configure.in: Add checks for Pango
* configure.in docs/Makefile.am: Add test for sgml2html
and allow 'make dist' without building html, but print out
warnings in that case. (For making snapshots)
* gdk/Makefile.am gdk/x11/Makefile.am gtk/Makefile.am:
Add Pango libraries and C flags
* gdk/gdkdraw.c gdk/gdkdrawable.h gdkwindow.c gdk/x11/gdkdrawable-x11.c:
Add function (gdk_draw_layout) to draw a pango layout.
* gdk/gdkpango.h gdk/x11/gdkpango-x11.c: New file with functions
for getting Pango contexts for GDK.
* gtk/gtkeditable.c: Get rid of dead code gtk_editable_parent_set()
* gtk/gtkentry.[ch]: Complete rewrite to use Pango, add bidirectional
editing.
* gtk/gtkentry.c: Hack in simple Hebrew input with direct
keysym => unicode translations. More languages can be added
here, but real input-method support is needed.
* docs/Changes-1.4.txt: Added note about entry behavior.
* gtk/gtkenums.h gtk/gtkwidget.[ch] testgtk.c gtkprivate.h: Add functions
to set the reading direction for a widget and the global direction.
Add test which allows toggling the global direction. Two private
flags are used to store the direction. (GTK_DIRECTION_SET + GTK_DIRECTION_LTR)
* gtk/gtkcheckbutton.c gtk/gtkframe.c gtk/gtkhbbox.c gtk/gtkhbox.c
gtk/gtkradiobutton.c gtk/gtkspinbutton.c gtk/gtktable.c
* gtk/gtk[hv]scale.c gtk/gtkscale.[ch]: Draw numbers using Pango
* gtk/gtklabel.[ch]: Moved to Pango and considerably rewritten. Line breaking,
underlining now handled by Pango.
* gtk/gtkstyle.[ch] gtk/gtkrc.[ch]: Add a PangoFontDescription
to RCStyle and Style. (Having both this and the old font name and GdkFont
is temporary.)
* gtk/gtkwidget.[ch] (gtk_widget_create_pango_{context,layout}): Added
convenience functions for creating contexts and layouts for widgets.
* gtk/testgtk.c: Enhance label tests with multilingual labels.
2000-06-02 03:14:07 +00:00
|
|
|
|
pango_layout_set_text (layout, buffer, -1);
|
2000-07-02 21:32:56 +00:00
|
|
|
|
pango_layout_get_pixel_extents (layout, NULL, &logical_rect);
|
Remove all references to offscreen flag which was no longer used.
Thu Jun 1 23:05:13 2000 Owen Taylor <otaylor@redhat.com>
* gtk/gtkwidget.c: Remove all references to
offscreen flag which was no longer used.
* gtk/gtkprivate.h (enum): Remove unused flags and compress.
* gtk/gtkframe.c (gtk_frame_set_label_widget): Check
for non-null label_widget->parent.
* gtk/gtkentry.c: Get rid of code to deal with PangoAttribute
which no longer was used.
* gdk/gdkpango.c (gdk_pango_context_get_info): make static.
* gdk/gdkpango.c (gdk_draw_layout[_line]): Add checks
for null arguments.
* gdk/x11/gdkgeometry-x11.c (gdk_window_scroll): add
check for destroyed windows.
Thu Jun 1 13:48:45 2000 Owen Taylor <otaylor@redhat.com>
* gtk/gtkimmulticontext.c: Add a finalize method and unref
the slave context there.
* gtk/gtkinvisible.[ch]: Make reference counting behavior
identical to GtkWindow.
Thu Jun 1 01:54:11 2000 Owen Taylor <otaylor@redhat.com>
* Makefile.am gdk/gdkpango.c: Copy the layout render function from
pangox to here, so we can write them independent of rendering
system, using GDK primitives.
* gdk/gdkdrawable.h gdk/gdkdraw.c gdk/gdkwindow.c
gdk/x11/gdkdrawable-x11.c: Remove draw_layout() from the vtable,
since we have a rendering-system independent implementation in
terms of draw_glyphs().
* gdk/gdkpango.c gdkdrawable.h (gdk_draw_layout_line): New
function to render a single line.
* gdk/x11/gdkpango.c: Move the guts of this file mostly
into ../gdkpango.c, which simplifies things, since we
don't have to deal with raw X gc's.
Fri May 19 04:28:16 2000 Owen Taylor <otaylor@redhat.com>
* gtk/gtktextlayout.[ch]: Add get_log_attrs() function to
get the logical attributes for a given GtkTextLine.
Tue May 30 16:05:39 2000 Owen Taylor <otaylor@redhat.com>
* gdk/x11/gdkfont-x11.c (gdk_font_charset_for_locale): Track
g_locale_get_codeset() to g_get_codeset() change.
Tue May 30 15:03:19 2000 Owen Taylor <otaylor@redhat.com>
* gtk/testcalendar.c (calendar_font_selection_ok): Use font
descriptions.
* gtk/gtkentry.c (gtk_entry_draw_text): Center text within
the entry.
* gtk/gtkfontsel.c (gtk_font_selection_dialog_init): Start of
redoing (vastly simplifying) for Pango. Still needs quite
a bit of work. (Size selection is currently poor. List of
predefined sizes is not a good idea, since all of these
sizes won't necessarily be distinct.)
Tue May 30 13:50:19 2000 Owen Taylor <otaylor@redhat.com>
* gdk/x11/gdkfont-x11.c (gdk_font_charset_for_locale): Handle
CODESET results for LANG=C.
Mon May 29 15:49:10 2000 Owen Taylor <otaylor@redhat.com>
* gtk/gtkrc.[ch]: Add a 'font_name' declaration to RC
which takes a stringized pango font description;
ignore the older 'font' and 'fontset' declarations.
* gtk/gtkstyle.c gtk/gtkrc.c: Fill in the style->font
field with a GdkFont derived via gdk_font_from_description(),
for compatibility. (Should we just remove it entirely?
Probably too much compatibility breakage, but people
should be migrating to the new Pango stuff as quickly
as possible.)
Mon May 29 15:47:41 2000 Owen Taylor <otaylor@redhat.com>
* gtk/gtkentry.c gtk/gtkclist.c: s/pango_font_unref/g_object_unref/.
Mon May 29 15:44:46 2000 Owen Taylor <otaylor@redhat.com>
* gtk/gtkcalender.c: Roughly pango-ized. Really needs
redoing; there are some bugs in size allocation right
now, the semi-existant distinction between header / day
fonts was removed, but, with Pango, could actually
be made functional in a nice way.
* gtk/testcalender: Move calender from examples into this
directory as a test program. (We really need to restrcture
testgtk into a whole directory full of tests for every
widget or functionality group, separated into multiple .c
files.)
Mon May 29 15:19:56 2000 Owen Taylor <otaylor@redhat.com>
* gtk/testgtk.c (file_exists): Fix stupid typo that
was keeping RC file from being loaded.
* gtk/testgtkrc gtk/testgtkrc2: Test new pango-ized
RC file font code.
Mon May 29 14:31:27 2000 Owen Taylor <otaylor@redhat.com>
* gdk/gdkfont.h gdk/x11/gdkfont-x11.c (gdk_font_from_description):
Add function to load a GdkFont from a PangoFontDescription.
Fri May 26 17:16:40 2000 Owen Taylor <otaylor@redhat.com>
* gtk/frame.[ch] gtkaspectframe.c: Make frame widgets able
to have any widget for the label, use a GtkLabel widget
to display the text. (Based partially on a patch from
Anders Carlson.)
(Quite a bit of code reorganization - strip 90% of the
guts out of gtkaspectframe and add a single virtual
func to GtkFrameClass - compute_child_allocation.)
Fri May 26 12:00:02 2000 Owen Taylor <otaylor@redhat.com>
* gtk/gtkctree.c gtk/gtkclist.[ch]: Pangoized.
(Removed clist->row_center_offset field because caching
it wasn't saving time or code, added private function
_gtk_clist_create_cell_layout()).
Wed May 24 15:59:37 2000 Owen Taylor <otaylor@redhat.com>
* gtk/gtkaccellabel.c: Pangoized.
* gtk/[hv]ruler.c: Pangoized
Mon May 22 19:23:59 2000 Owen Taylor <otaylor@redhat.com>
* gtk/gtkfilesel.c (gtk_file_selection_init):
Use gtk_clist_set_column_auto_resize() to remove need
need for manual column width computations.
Mon May 22 18:50:26 2000 Owen Taylor <otaylor@redhat.com>
* gtk/gtktooltips.[ch]: Replace custom drawing with a GtkLabel,
ensuring Pango correctness, and considerably simplifying the
code.
* gtk/gtklabel.c gtk[hv]scale.c: 1000 => PANGO_SCALE.
* gtk/gtklabel.c (gtk_label_size_request): Fixed incorrect
getting of numbers of lines.
* gtk/gtklabel.c (gtk_label_size_request): Set the requisition
to the actual requested width of the lable, not to the wrap
width we set.
* gtk/gtktextchild.h: Remove extraneous include of gtk/gtk.h.
* gtk/gtktextbtree.c gtk/gtktextbuffer.c gtk/gtktextlayout.c
gtk/gtktextview.c gtk/gtktextview.[ch]: Fix up includes.
* gtk/gtktextview.c: Fix structure inheritance.
* gtk/gtkprogressbar.c: Pangoize.
Mon May 22 15:47:30 2000 Owen Taylor <otaylor@redhat.com>
* gtk/gtktextview.c (gtk_text_view_get_first_para_iter): Encapsulate
in a function.
* gtk/gtktextlayout.c (find_display_line_above): Fixed
bug with computing line tops.
* gtk/gtktextview.c (changed_handler): Fix < , <= confusion.
Thu May 18 18:53:31 2000 Owen Taylor <otaylor@redhat.com>
* gtk/gtktextdisplay.c (gtk_text_layout_draw): Fix up the x_offset
and y_offset coordinates to do what we need now. (The offset between
buffer and layout coordinates has been reintroduced, but is a
bit different than before.)
* gtk/gtktextview.[ch]: No longer inherit from GtkLayout; instead
handle the adjustments ourselves, and scroll as necessary using
the new gdk_window_scroll().
The advantage of this is that when we are incrementally revalidating,
we are essentially rearranging things around the visible portion
of the screen. With the old setup, the visible portion of the
screen was moved around in the layout, so scrolling and redrawing
to track that caused jumping of the display. Since we now
control the scrolling ourselves, we can suppress this and
only redraw when things actually change.
Thu May 18 18:47:25 2000 Owen Taylor <otaylor@redhat.com>
* gtk/gtktextbtree.c (redisplay_mark): We need to invalidate
the region not just redisplay it after-all, since we store the
cursors in the LineDisplay. (Ugly interactions here between
GtkLayout and GtkTextBTree here.)
* gtk/gtktextbtree.c (redisplay_region): Fixed reversed comparison.
Thu May 18 18:43:21 2000 Owen Taylor <otaylor@redhat.com>
* gdk/gdkwindow.h gdk/x11/gdkgeometry-x11.c (gdk_window_scroll):
Added function to scroll contents of a window while keeping the
window constant. Works by XCopyArea or guffaw-scrolling depending
on the details of how the window is set up. (guffaw-scrolling
still needs to be filled in.)
Wed May 17 22:36:53 2000 Owen Taylor <otaylor@redhat.com>
* gtk/gtktextiter.c gtk/gtkmain.c: Add a debug key for the text widget,
move the debugging that was tied to a global variable
to that.
* gtk/gtkmarshal.list: Add NONE:INT,INT,INT
* gtk/gtktextbtree.[ch] gtk/gtktextlayout.c: Keep a separate
validated flag, in line data instead of setting height/width to
-1. This allows us to perform operations with partially invalid
buffer (using the old size for invalid lines) and thus to do
incremental vaidation. Keep height/width aggregates up to date
when deleting text and rebalancing the tree.
* gtk/gtktextbtree.[ch]: Add functions validate a line
(gtk_text_btree_validate_line), and to validate up
to a number of pixels (gtk_text_btree_validate).
* gtk/gtktextlayout.[ch]: Add an ::invalidated signal
that indicates that something is changed and a revalidation
pass is needed. Change ::need_repaint to ::changed, and
make it take old and new yranges instead of a rectangle.
* gtk/gtktextbtree.[ch] gtk/gtktextlayout.[ch]: Move
the line_data_destroy() function from
gtk_text_btree_add_view() to a virtual function in
GtkTextLayout
* gtk/gtktextbtree.[ch]: Remove gtk_text_btree_get_damage_range(),
since we are handling partial repaints in a different fashion
now.
* gtk/gtktextbtree.[ch]: Only repaint the changed portion
of the selection instead of queueing a repaint on the
entire widget.
* gtk/gtktextbuffer.[ch] gtk/gtktextbtree.[ch]: Move
get_selection_bounds() down to btree, make the function
in buffer a wrapper around the btree function.
* gtk/gtktextlayout.[ch]: Add functions to check if the
layout is valid and to recompute either a range of pixels
aroudn a line or a certain total number of pixels.
* gtk/gtktextlayout.[ch]: Cache a single line display;
now that we only redraw the needed portions, the hit rate
for this cache is quite high.
* gtk/gtktextview.[ch]: Keep track of the first paragraph
on the screen so that when re-laying-out the buffer, we can
keep the same place. This requires connecting to ::value_changed
on the adjustments
* gtk/gtktextview.[ch]: Add idle functions to revalidate
the buffer after we receive an ::invalidated signal.
Wed May 17 22:10:47 2000 Owen Taylor <otaylor@redhat.com>
* gtk/gtklayout.c (gtk_layout_size_allocate): Set upper
to max of allocation and layout size, not just to the
layout size.
* gtk/gtk[hv]scrollbar.c (gtk_[hv]scrollbar_calc_slider_size):
Invalidate window so it gets redrawn properly.
* gdk/gdkwindow.c (gdk_window_invalidate_rect): Allow rect == NULL
to mean the entire window.
* gdk/gdkevents.h: Move definition for GDK_PRIORITY_REDRAW
into public header.
Mon May 15 14:51:31 2000 Owen Taylor <otaylor@redhat.com>
* gtk/gtktextmark.c (gtk_text_mark_get_name): Add function
to get the name of a mark.
* gtk/gtktextlayout.c (gtk_text_layout_get_line_at_y): Add a function
to find the paragraph from a y position.
Thu May 11 12:57:20 2000 Owen Taylor <otaylor@redhat.com>
* gtk/gtktextbtree.c (gtk_text_btree_node_invalidate_upward): Valid
nodes have width/height >= 0, not > 0.
Tue May 9 21:29:06 2000 Owen Taylor <otaylor@redhat.com>
* gtk/gtktextlayout.[ch] gtk/gtktextdisplay.c (gtk_text_layout_get_line_display):
Add a size_only flag, so when we only need the size, we don't create
useless appearance attributes.
* gtk/gtktextview.c (gtk_text_view_ensure_layout): Remove
duplicate setting of font description.
* gtk/gtkscale.c: Use PANGO_SCALE instead of 1000
Wed Apr 26 01:53:23 2000 Owen Taylor <otaylor@redhat.com>
* gtk/Makefile.am (EXTRA_DIST): Add OLD_STAMP into
EXTRA_DIST. It does not work well when the file that
everything depends on is not in the tarball.
Wed Apr 26 00:56:14 2000 Owen Taylor <otaylor@redhat.com>
* gtk/testgtk.c: Some hacks and fixes so that it basically
works when not sitting in the GTK+ build tree.
2000-05-03 Havoc Pennington <hp@redhat.com>
* gtk/gtktextbtree.c (gtk_text_line_next_could_contain_tag):
Properly determine the ordering of the tag root and the current
line within the tree. Previous algorithm only worked if the tag
root's immediate parent was the common root of both the current
line and the tag root.
Wed Apr 26 00:43:00 2000 Owen Taylor <otaylor@redhat.com>
* gtk/gtktextlayout.c (set_para_values): Fix some bugs in
alignment.
* gtk/gtktextview.c (gtk_text_view_ensure_layout): Track
the widget text directional dynamically.
* gtk/gtktextview.[ch]: Added functions to get and set default
wrap mode.
Tue Apr 25 23:47:38 2000 Owen Taylor <otaylor@redhat.com>
* gtk/gtktextlayout.c (gtk_text_layout_get_iter_location): Fix bug
in cursor location computation.
Tue Apr 25 23:22:59 2000 Owen Taylor <otaylor@redhat.com>
* gtk/gtklayout.c (gtk_layout_set_size): Clamp hadjustment/
vadjusment values properly when layout gets smaller.
* gtk/gtktextview.c (need_repaint_handler): Areas being
passed in are far completely inaccurate, and sometimes
too small, so, for now, just queue a redraw on the
whole visible region.
2000-04-25 Havoc Pennington <hp@redhat.com>
* gtk/gtktextbtree.c (summary_destroy): new function to
destroy tag summary nodes
(gtk_text_line_next_could_contain_tag): this function was
totally broken if the line passed in wasn't below the tag
root. Fix it.
(gtk_text_btree_first_could_contain_tag): In the tag == NULL
"wildcard" case, we have to do a linear scan. Blah.
(gtk_text_btree_last_could_contain_tag): In tag == NULL case,
we have to do the linear scan
(tag_removed_cb): When a tag is removed from the tag table,
remove the GtkTextTagInfo node from the btree.
(gtk_text_btree_spew): Implement the spew function, for
our debugging pleasure.
Tue Apr 25 19:40:18 2000 Owen Taylor <otaylor@redhat.com>
* gtk/gtktextlayout.c (gtk_text_layout_set_buffer): Fix
a problem with referring to the wrong buffer.
* gtk/gtkentry.c: Fix focus-in/focus-out confusion.
* gtk/gtkrc.c gtk/gtkstyle.c: Moving setting default
font description to gtk_style_new() - otherwise things
don't work without a .gtkrc file.
* gtk/gtktextbuffer.c (gtk_text_buffer_new): Sink the
tags table if we create it ourself, too.
* gdk/gdktypes.h (enum): Move GDK_RELEASE_MASK, since
it was conflicting with XKB modifiers.
* gtk/gtktextview.[ch]: Add simple support for
GtkIMContext.
Mon Apr 24 19:34:18 2000 Owen Taylor <otaylor@redhat.com>
* gtk/gtkentry.c (gtk_entry_move_cursor_visually): Fix problem
with deletion from last commit.
Mon Apr 24 19:29:40 2000 Owen Taylor <otaylor@redhat.com>
* gtk/gtkwidget.c (gtk_widget_create_pango_context): Set the language
in the context from the current locale.
* gtk/gtkentry.c (gtk_entry_size_request): Use language from the
context, not hardcoded value.
* gtk/gtkentry.c (gtk_entry_move_cursor): Make character movement visual,
not logical.
Sun Apr 23 23:39:18 2000 Owen Taylor <otaylor@redhat.com>
* gtk/gtkentry.c gtk/gtktextdisplay.c: Don't handle selections as
attributes - that doesn't handle partial-glyph selection
properly. Instead use new pango_layout_line_get_x_ranges()
functionality to draw the selection.
* gtk/gtkentry.c: Simplify code since pango_layout_line_index_to_x()
now properly handles out-of-range coordinates.
* gtk/gtktextbuffer.c: Emit "mark_set" when the cursor is moved.
* gtk/gtktextiter.h gtk/gtktextiterprivate.h: Make gtk_text_iter_get_line_byte()
public.
* gtk/gtktextlayout.[ch]: Properly set the direction in the PangoContext
for paragraphs opposite to the base direction of the widget.
* gtk/gtktextlayout.[ch] gtk/gtktextdisplay.c: Fixes for alignment.
* gtk/gtktextlayout.c: Don't split segments on marks, since that
causes Arabic words to reshape as you cursor through.
* gtk/gtktextlayout.[ch] gtk/gtktextview.[ch]: Implement virtual
cursor position when moving vertically with the arrow keys and
scrolling with page-up/page-down. (Arrow keys save only the X,
scrolling saves both X and Y.)
This means you can line-up / line-down or page-up / page-down
without losing your place, and also that moving vertically
with the cursor keys keeps the same X position, not the same
character count:
* gtk/gtktextlayout.[ch] gtk/gtktextview.[ch]: Make vertical
arrow keys move by display lines, not paragraphs.
Tue Apr 18 14:16:50 2000 Owen Taylor <otaylor@redhat.com>
* gtk/gtklayout.c: Make sure that the bin window is at least
as big as the allocation. (Should we also make sure that the
bin window is big enough to completely cover widget->window?)
* gtk/gtktextview.c (gtk_text_view_get_visible_rect): Add
function to get the onscreen rectangle.
* gdk/x11/gdkwindow-x11.c (gdk_window_get_pointer): Correctly account
for offsets in window coordinates.
Sun Apr 16 16:13:27 2000 Owen Taylor <otaylor@redhat.com>
* gtk/gtkentry.c (gtk_entry_get_cursor_locations): Fix index/offset
confusion.
* gtk/gtktextview.c (gtk_text_view_ensure_layout): Set the default direction
from the widget direction.
* gtk/gtktexttag.c gtk/gtktexttagprivate.h (gtk_text_tag_set_arg):
Add a "direction" attribute.
* gtk/gtktextview.c: global s/tkxt/text_view/.
* gtk/testtext.c: Added long block of text in Arabic, to test out
the direction attributes. (Some problems with the shaping system
for arabic become obvious - like the fact the cursor splits words
into unjoined pieces.)
Fri Apr 14 12:54:34 2000 Owen Taylor <otaylor@redhat.com>
* gtk/gtktextdisplay.c (render_layout): Add overstrike handling.
* gtk/gtktextlayout.c: Fix up alignment.
* gtk/testtext.c: Add some tests for centering, wrapping.
Fri Apr 14 09:26:22 2000 Owen Taylor <otaylor@redhat.com>
* gdk/gdkdrawable.h gdk/gdkdraw.c gdk/gdkwindow.c gdk/x11/gdkdrawable-x11.c:
Add a draw_glyphs() operation to the drawable vtable and gdk_draw_glyphs().
If we wrote GTK+-specific layout-render function this could just replace
the draw_layout() operation in the vtable.
* gtk/gtkentry.c: Move guts of gtk_entry_get_cursor_locations to
pango_layout_get_cursor_pos() and use that function.
* gtk/gtktextchild.[ch]: add gtk_ onto pixmap_segment_new(), since it
is a non-static symbol.
* gtk/gtktextbtree.[ch]: Replace gtk_text_btree_find_line_data_by_y()
with gtk_text_btree_find_line_by_y()
* gtk/gtktextdisplay.c: Rewrote for Pango - uses a custom layout
renderer that handles GtkTextAppearance attributes.
* gtk/gtktexttag.[ch] gtk/gtktexttagprivate.h:
- Move the values in the style that don't affect geometry into a
GtkTextAppearance structure.
- Change underline to take a PangoUnderline and "font" a string
representation of a font description
- Add a "font_desc" attribute which takes a FontDescription structure.
* gtk/gtktextlayout.[ch]:
- Get rid of the display-line list per each line. Instead, we
generate, on demand, a GtkTextLineDisplay structure which]
contains a PangoLayout * and other necesary information
(offsets, cursor locations) for displaying a paragraph.
- Get rid of the code to wrap lines, create display chunks,
etc. Instead, we just go through a paragraph and convert
it into the necessary inputs to a PangoLayout.
- Implement a new attribute type, GtkTextAttrAppearance. This
holds a GtkTextAppearance, and is used to pass colors,
stipple, etc, through from the layout to the display without
having to use lots and lots of individual attributes.
- Reimplement gtk_layout_get_iter_at_pixel() gtk_layout_get_iter_pos()
in terms of PangoLayout functions.
* gtk/gtktextview.c:
- Handle passing the necessary PangoContext to the layout
- Some fixups in painting to deal with the automatic backing store
and offsetting of GTK+-1.4
- Add a style_set handler so that the default style reacts
properly to theme changes.
* gtk/gtktext?*.[ch]: Random code-style fixes.
* gtk/testtext.c: Substitute in languages that Pango handles now for Thai
Mon Apr 10 10:33:45 2000 Owen Taylor <otaylor@redhat.com>
* gtk/gtktext?*.[ch]: Check in Havoc's port of the Tk text widget,
in original form preparatory to Pango-ization and gdkimcontext-ization.
Thu Apr 6 19:25:39 2000 Owen Taylor <otaylor@redhat.com>
* gtk/gtkimcontext.c: Move default implementations to real_* vfuncs,
so that we can derive from gtkimcontext in language bindings properly.
Thu Apr 6 16:02:52 2000 Owen Taylor <otaylor@redhat.com>
* gtk/gtkimcontextsimple.[ch]: Use gdk_keyval_to_unicode to gdk_unicode_to_keyval.
Add a compose table including (almost) all the compose combinations
from X. This is 6k of static, shared data as opposed to 50k or so of dynamic
data in the XIM implementation.
* gdk/gdk.h gdk/gdkkeyuni.c gdk/win32/gdkevents-win32.c (gdk_keyval_to_unicode, gdk_unicode_to_keyval):
Moved functions to convert keyvalues from and to unicode here from
the win32 port and made them public.
Wed Apr 5 16:37:29 2000 Owen Taylor <otaylor@redhat.com>
* gtk/gtkeditable.c (gtk_editable_insert_text): Allow new_text_length == -1.
Wed Apr 5 16:27:45 2000 Owen Taylor <otaylor@redhat.com>
* gtk/gtkimcontext.[ch]: Base class for new input context system
* gtk/gtkimmulticontext.[ch]: Proxy input context that allows
the real input context implementation to be loaded from modules
and switched on the fly.
* gtk/gtkcontextsimple.[ch]: Simple implementation of an input
context that just does direct keysymbol => unicode translation.
* gtk/gtkentry.[ch]: Start switching editing over to using
GtkInputContext. (No handling of preedit yet.)
Wed Apr 5 15:48:41 2000 Owen Taylor <otaylor@redhat.com>
* gtk/gtktypeutils.h (GTK_CHECK_GET_CLASS): Fix problem with one too
many substitutions. (klass should not be subsituted.)
Wed Apr 5 00:18:14 2000 Owen Taylor <otaylor@redhat.com>
* configure.in: Add checks for Pango
* configure.in docs/Makefile.am: Add test for sgml2html
and allow 'make dist' without building html, but print out
warnings in that case. (For making snapshots)
* gdk/Makefile.am gdk/x11/Makefile.am gtk/Makefile.am:
Add Pango libraries and C flags
* gdk/gdkdraw.c gdk/gdkdrawable.h gdkwindow.c gdk/x11/gdkdrawable-x11.c:
Add function (gdk_draw_layout) to draw a pango layout.
* gdk/gdkpango.h gdk/x11/gdkpango-x11.c: New file with functions
for getting Pango contexts for GDK.
* gtk/gtkeditable.c: Get rid of dead code gtk_editable_parent_set()
* gtk/gtkentry.[ch]: Complete rewrite to use Pango, add bidirectional
editing.
* gtk/gtkentry.c: Hack in simple Hebrew input with direct
keysym => unicode translations. More languages can be added
here, but real input-method support is needed.
* docs/Changes-1.4.txt: Added note about entry behavior.
* gtk/gtkenums.h gtk/gtkwidget.[ch] testgtk.c gtkprivate.h: Add functions
to set the reading direction for a widget and the global direction.
Add test which allows toggling the global direction. Two private
flags are used to store the direction. (GTK_DIRECTION_SET + GTK_DIRECTION_LTR)
* gtk/gtkcheckbutton.c gtk/gtkframe.c gtk/gtkhbbox.c gtk/gtkhbox.c
gtk/gtkradiobutton.c gtk/gtkspinbutton.c gtk/gtktable.c
* gtk/gtk[hv]scale.c gtk/gtkscale.[ch]: Draw numbers using Pango
* gtk/gtklabel.[ch]: Moved to Pango and considerably rewritten. Line breaking,
underlining now handled by Pango.
* gtk/gtkstyle.[ch] gtk/gtkrc.[ch]: Add a PangoFontDescription
to RCStyle and Style. (Having both this and the old font name and GdkFont
is temporary.)
* gtk/gtkwidget.[ch] (gtk_widget_create_pango_{context,layout}): Added
convenience functions for creating contexts and layouts for widgets.
* gtk/testgtk.c: Enhance label tests with multilingual labels.
2000-06-02 03:14:07 +00:00
|
|
|
|
|
2005-05-11 19:16:19 +00:00
|
|
|
|
y_loc = calendar_top_y_for_row (calendar, row) + (day_height - logical_rect.height) / 2;
|
Remove all references to offscreen flag which was no longer used.
Thu Jun 1 23:05:13 2000 Owen Taylor <otaylor@redhat.com>
* gtk/gtkwidget.c: Remove all references to
offscreen flag which was no longer used.
* gtk/gtkprivate.h (enum): Remove unused flags and compress.
* gtk/gtkframe.c (gtk_frame_set_label_widget): Check
for non-null label_widget->parent.
* gtk/gtkentry.c: Get rid of code to deal with PangoAttribute
which no longer was used.
* gdk/gdkpango.c (gdk_pango_context_get_info): make static.
* gdk/gdkpango.c (gdk_draw_layout[_line]): Add checks
for null arguments.
* gdk/x11/gdkgeometry-x11.c (gdk_window_scroll): add
check for destroyed windows.
Thu Jun 1 13:48:45 2000 Owen Taylor <otaylor@redhat.com>
* gtk/gtkimmulticontext.c: Add a finalize method and unref
the slave context there.
* gtk/gtkinvisible.[ch]: Make reference counting behavior
identical to GtkWindow.
Thu Jun 1 01:54:11 2000 Owen Taylor <otaylor@redhat.com>
* Makefile.am gdk/gdkpango.c: Copy the layout render function from
pangox to here, so we can write them independent of rendering
system, using GDK primitives.
* gdk/gdkdrawable.h gdk/gdkdraw.c gdk/gdkwindow.c
gdk/x11/gdkdrawable-x11.c: Remove draw_layout() from the vtable,
since we have a rendering-system independent implementation in
terms of draw_glyphs().
* gdk/gdkpango.c gdkdrawable.h (gdk_draw_layout_line): New
function to render a single line.
* gdk/x11/gdkpango.c: Move the guts of this file mostly
into ../gdkpango.c, which simplifies things, since we
don't have to deal with raw X gc's.
Fri May 19 04:28:16 2000 Owen Taylor <otaylor@redhat.com>
* gtk/gtktextlayout.[ch]: Add get_log_attrs() function to
get the logical attributes for a given GtkTextLine.
Tue May 30 16:05:39 2000 Owen Taylor <otaylor@redhat.com>
* gdk/x11/gdkfont-x11.c (gdk_font_charset_for_locale): Track
g_locale_get_codeset() to g_get_codeset() change.
Tue May 30 15:03:19 2000 Owen Taylor <otaylor@redhat.com>
* gtk/testcalendar.c (calendar_font_selection_ok): Use font
descriptions.
* gtk/gtkentry.c (gtk_entry_draw_text): Center text within
the entry.
* gtk/gtkfontsel.c (gtk_font_selection_dialog_init): Start of
redoing (vastly simplifying) for Pango. Still needs quite
a bit of work. (Size selection is currently poor. List of
predefined sizes is not a good idea, since all of these
sizes won't necessarily be distinct.)
Tue May 30 13:50:19 2000 Owen Taylor <otaylor@redhat.com>
* gdk/x11/gdkfont-x11.c (gdk_font_charset_for_locale): Handle
CODESET results for LANG=C.
Mon May 29 15:49:10 2000 Owen Taylor <otaylor@redhat.com>
* gtk/gtkrc.[ch]: Add a 'font_name' declaration to RC
which takes a stringized pango font description;
ignore the older 'font' and 'fontset' declarations.
* gtk/gtkstyle.c gtk/gtkrc.c: Fill in the style->font
field with a GdkFont derived via gdk_font_from_description(),
for compatibility. (Should we just remove it entirely?
Probably too much compatibility breakage, but people
should be migrating to the new Pango stuff as quickly
as possible.)
Mon May 29 15:47:41 2000 Owen Taylor <otaylor@redhat.com>
* gtk/gtkentry.c gtk/gtkclist.c: s/pango_font_unref/g_object_unref/.
Mon May 29 15:44:46 2000 Owen Taylor <otaylor@redhat.com>
* gtk/gtkcalender.c: Roughly pango-ized. Really needs
redoing; there are some bugs in size allocation right
now, the semi-existant distinction between header / day
fonts was removed, but, with Pango, could actually
be made functional in a nice way.
* gtk/testcalender: Move calender from examples into this
directory as a test program. (We really need to restrcture
testgtk into a whole directory full of tests for every
widget or functionality group, separated into multiple .c
files.)
Mon May 29 15:19:56 2000 Owen Taylor <otaylor@redhat.com>
* gtk/testgtk.c (file_exists): Fix stupid typo that
was keeping RC file from being loaded.
* gtk/testgtkrc gtk/testgtkrc2: Test new pango-ized
RC file font code.
Mon May 29 14:31:27 2000 Owen Taylor <otaylor@redhat.com>
* gdk/gdkfont.h gdk/x11/gdkfont-x11.c (gdk_font_from_description):
Add function to load a GdkFont from a PangoFontDescription.
Fri May 26 17:16:40 2000 Owen Taylor <otaylor@redhat.com>
* gtk/frame.[ch] gtkaspectframe.c: Make frame widgets able
to have any widget for the label, use a GtkLabel widget
to display the text. (Based partially on a patch from
Anders Carlson.)
(Quite a bit of code reorganization - strip 90% of the
guts out of gtkaspectframe and add a single virtual
func to GtkFrameClass - compute_child_allocation.)
Fri May 26 12:00:02 2000 Owen Taylor <otaylor@redhat.com>
* gtk/gtkctree.c gtk/gtkclist.[ch]: Pangoized.
(Removed clist->row_center_offset field because caching
it wasn't saving time or code, added private function
_gtk_clist_create_cell_layout()).
Wed May 24 15:59:37 2000 Owen Taylor <otaylor@redhat.com>
* gtk/gtkaccellabel.c: Pangoized.
* gtk/[hv]ruler.c: Pangoized
Mon May 22 19:23:59 2000 Owen Taylor <otaylor@redhat.com>
* gtk/gtkfilesel.c (gtk_file_selection_init):
Use gtk_clist_set_column_auto_resize() to remove need
need for manual column width computations.
Mon May 22 18:50:26 2000 Owen Taylor <otaylor@redhat.com>
* gtk/gtktooltips.[ch]: Replace custom drawing with a GtkLabel,
ensuring Pango correctness, and considerably simplifying the
code.
* gtk/gtklabel.c gtk[hv]scale.c: 1000 => PANGO_SCALE.
* gtk/gtklabel.c (gtk_label_size_request): Fixed incorrect
getting of numbers of lines.
* gtk/gtklabel.c (gtk_label_size_request): Set the requisition
to the actual requested width of the lable, not to the wrap
width we set.
* gtk/gtktextchild.h: Remove extraneous include of gtk/gtk.h.
* gtk/gtktextbtree.c gtk/gtktextbuffer.c gtk/gtktextlayout.c
gtk/gtktextview.c gtk/gtktextview.[ch]: Fix up includes.
* gtk/gtktextview.c: Fix structure inheritance.
* gtk/gtkprogressbar.c: Pangoize.
Mon May 22 15:47:30 2000 Owen Taylor <otaylor@redhat.com>
* gtk/gtktextview.c (gtk_text_view_get_first_para_iter): Encapsulate
in a function.
* gtk/gtktextlayout.c (find_display_line_above): Fixed
bug with computing line tops.
* gtk/gtktextview.c (changed_handler): Fix < , <= confusion.
Thu May 18 18:53:31 2000 Owen Taylor <otaylor@redhat.com>
* gtk/gtktextdisplay.c (gtk_text_layout_draw): Fix up the x_offset
and y_offset coordinates to do what we need now. (The offset between
buffer and layout coordinates has been reintroduced, but is a
bit different than before.)
* gtk/gtktextview.[ch]: No longer inherit from GtkLayout; instead
handle the adjustments ourselves, and scroll as necessary using
the new gdk_window_scroll().
The advantage of this is that when we are incrementally revalidating,
we are essentially rearranging things around the visible portion
of the screen. With the old setup, the visible portion of the
screen was moved around in the layout, so scrolling and redrawing
to track that caused jumping of the display. Since we now
control the scrolling ourselves, we can suppress this and
only redraw when things actually change.
Thu May 18 18:47:25 2000 Owen Taylor <otaylor@redhat.com>
* gtk/gtktextbtree.c (redisplay_mark): We need to invalidate
the region not just redisplay it after-all, since we store the
cursors in the LineDisplay. (Ugly interactions here between
GtkLayout and GtkTextBTree here.)
* gtk/gtktextbtree.c (redisplay_region): Fixed reversed comparison.
Thu May 18 18:43:21 2000 Owen Taylor <otaylor@redhat.com>
* gdk/gdkwindow.h gdk/x11/gdkgeometry-x11.c (gdk_window_scroll):
Added function to scroll contents of a window while keeping the
window constant. Works by XCopyArea or guffaw-scrolling depending
on the details of how the window is set up. (guffaw-scrolling
still needs to be filled in.)
Wed May 17 22:36:53 2000 Owen Taylor <otaylor@redhat.com>
* gtk/gtktextiter.c gtk/gtkmain.c: Add a debug key for the text widget,
move the debugging that was tied to a global variable
to that.
* gtk/gtkmarshal.list: Add NONE:INT,INT,INT
* gtk/gtktextbtree.[ch] gtk/gtktextlayout.c: Keep a separate
validated flag, in line data instead of setting height/width to
-1. This allows us to perform operations with partially invalid
buffer (using the old size for invalid lines) and thus to do
incremental vaidation. Keep height/width aggregates up to date
when deleting text and rebalancing the tree.
* gtk/gtktextbtree.[ch]: Add functions validate a line
(gtk_text_btree_validate_line), and to validate up
to a number of pixels (gtk_text_btree_validate).
* gtk/gtktextlayout.[ch]: Add an ::invalidated signal
that indicates that something is changed and a revalidation
pass is needed. Change ::need_repaint to ::changed, and
make it take old and new yranges instead of a rectangle.
* gtk/gtktextbtree.[ch] gtk/gtktextlayout.[ch]: Move
the line_data_destroy() function from
gtk_text_btree_add_view() to a virtual function in
GtkTextLayout
* gtk/gtktextbtree.[ch]: Remove gtk_text_btree_get_damage_range(),
since we are handling partial repaints in a different fashion
now.
* gtk/gtktextbtree.[ch]: Only repaint the changed portion
of the selection instead of queueing a repaint on the
entire widget.
* gtk/gtktextbuffer.[ch] gtk/gtktextbtree.[ch]: Move
get_selection_bounds() down to btree, make the function
in buffer a wrapper around the btree function.
* gtk/gtktextlayout.[ch]: Add functions to check if the
layout is valid and to recompute either a range of pixels
aroudn a line or a certain total number of pixels.
* gtk/gtktextlayout.[ch]: Cache a single line display;
now that we only redraw the needed portions, the hit rate
for this cache is quite high.
* gtk/gtktextview.[ch]: Keep track of the first paragraph
on the screen so that when re-laying-out the buffer, we can
keep the same place. This requires connecting to ::value_changed
on the adjustments
* gtk/gtktextview.[ch]: Add idle functions to revalidate
the buffer after we receive an ::invalidated signal.
Wed May 17 22:10:47 2000 Owen Taylor <otaylor@redhat.com>
* gtk/gtklayout.c (gtk_layout_size_allocate): Set upper
to max of allocation and layout size, not just to the
layout size.
* gtk/gtk[hv]scrollbar.c (gtk_[hv]scrollbar_calc_slider_size):
Invalidate window so it gets redrawn properly.
* gdk/gdkwindow.c (gdk_window_invalidate_rect): Allow rect == NULL
to mean the entire window.
* gdk/gdkevents.h: Move definition for GDK_PRIORITY_REDRAW
into public header.
Mon May 15 14:51:31 2000 Owen Taylor <otaylor@redhat.com>
* gtk/gtktextmark.c (gtk_text_mark_get_name): Add function
to get the name of a mark.
* gtk/gtktextlayout.c (gtk_text_layout_get_line_at_y): Add a function
to find the paragraph from a y position.
Thu May 11 12:57:20 2000 Owen Taylor <otaylor@redhat.com>
* gtk/gtktextbtree.c (gtk_text_btree_node_invalidate_upward): Valid
nodes have width/height >= 0, not > 0.
Tue May 9 21:29:06 2000 Owen Taylor <otaylor@redhat.com>
* gtk/gtktextlayout.[ch] gtk/gtktextdisplay.c (gtk_text_layout_get_line_display):
Add a size_only flag, so when we only need the size, we don't create
useless appearance attributes.
* gtk/gtktextview.c (gtk_text_view_ensure_layout): Remove
duplicate setting of font description.
* gtk/gtkscale.c: Use PANGO_SCALE instead of 1000
Wed Apr 26 01:53:23 2000 Owen Taylor <otaylor@redhat.com>
* gtk/Makefile.am (EXTRA_DIST): Add OLD_STAMP into
EXTRA_DIST. It does not work well when the file that
everything depends on is not in the tarball.
Wed Apr 26 00:56:14 2000 Owen Taylor <otaylor@redhat.com>
* gtk/testgtk.c: Some hacks and fixes so that it basically
works when not sitting in the GTK+ build tree.
2000-05-03 Havoc Pennington <hp@redhat.com>
* gtk/gtktextbtree.c (gtk_text_line_next_could_contain_tag):
Properly determine the ordering of the tag root and the current
line within the tree. Previous algorithm only worked if the tag
root's immediate parent was the common root of both the current
line and the tag root.
Wed Apr 26 00:43:00 2000 Owen Taylor <otaylor@redhat.com>
* gtk/gtktextlayout.c (set_para_values): Fix some bugs in
alignment.
* gtk/gtktextview.c (gtk_text_view_ensure_layout): Track
the widget text directional dynamically.
* gtk/gtktextview.[ch]: Added functions to get and set default
wrap mode.
Tue Apr 25 23:47:38 2000 Owen Taylor <otaylor@redhat.com>
* gtk/gtktextlayout.c (gtk_text_layout_get_iter_location): Fix bug
in cursor location computation.
Tue Apr 25 23:22:59 2000 Owen Taylor <otaylor@redhat.com>
* gtk/gtklayout.c (gtk_layout_set_size): Clamp hadjustment/
vadjusment values properly when layout gets smaller.
* gtk/gtktextview.c (need_repaint_handler): Areas being
passed in are far completely inaccurate, and sometimes
too small, so, for now, just queue a redraw on the
whole visible region.
2000-04-25 Havoc Pennington <hp@redhat.com>
* gtk/gtktextbtree.c (summary_destroy): new function to
destroy tag summary nodes
(gtk_text_line_next_could_contain_tag): this function was
totally broken if the line passed in wasn't below the tag
root. Fix it.
(gtk_text_btree_first_could_contain_tag): In the tag == NULL
"wildcard" case, we have to do a linear scan. Blah.
(gtk_text_btree_last_could_contain_tag): In tag == NULL case,
we have to do the linear scan
(tag_removed_cb): When a tag is removed from the tag table,
remove the GtkTextTagInfo node from the btree.
(gtk_text_btree_spew): Implement the spew function, for
our debugging pleasure.
Tue Apr 25 19:40:18 2000 Owen Taylor <otaylor@redhat.com>
* gtk/gtktextlayout.c (gtk_text_layout_set_buffer): Fix
a problem with referring to the wrong buffer.
* gtk/gtkentry.c: Fix focus-in/focus-out confusion.
* gtk/gtkrc.c gtk/gtkstyle.c: Moving setting default
font description to gtk_style_new() - otherwise things
don't work without a .gtkrc file.
* gtk/gtktextbuffer.c (gtk_text_buffer_new): Sink the
tags table if we create it ourself, too.
* gdk/gdktypes.h (enum): Move GDK_RELEASE_MASK, since
it was conflicting with XKB modifiers.
* gtk/gtktextview.[ch]: Add simple support for
GtkIMContext.
Mon Apr 24 19:34:18 2000 Owen Taylor <otaylor@redhat.com>
* gtk/gtkentry.c (gtk_entry_move_cursor_visually): Fix problem
with deletion from last commit.
Mon Apr 24 19:29:40 2000 Owen Taylor <otaylor@redhat.com>
* gtk/gtkwidget.c (gtk_widget_create_pango_context): Set the language
in the context from the current locale.
* gtk/gtkentry.c (gtk_entry_size_request): Use language from the
context, not hardcoded value.
* gtk/gtkentry.c (gtk_entry_move_cursor): Make character movement visual,
not logical.
Sun Apr 23 23:39:18 2000 Owen Taylor <otaylor@redhat.com>
* gtk/gtkentry.c gtk/gtktextdisplay.c: Don't handle selections as
attributes - that doesn't handle partial-glyph selection
properly. Instead use new pango_layout_line_get_x_ranges()
functionality to draw the selection.
* gtk/gtkentry.c: Simplify code since pango_layout_line_index_to_x()
now properly handles out-of-range coordinates.
* gtk/gtktextbuffer.c: Emit "mark_set" when the cursor is moved.
* gtk/gtktextiter.h gtk/gtktextiterprivate.h: Make gtk_text_iter_get_line_byte()
public.
* gtk/gtktextlayout.[ch]: Properly set the direction in the PangoContext
for paragraphs opposite to the base direction of the widget.
* gtk/gtktextlayout.[ch] gtk/gtktextdisplay.c: Fixes for alignment.
* gtk/gtktextlayout.c: Don't split segments on marks, since that
causes Arabic words to reshape as you cursor through.
* gtk/gtktextlayout.[ch] gtk/gtktextview.[ch]: Implement virtual
cursor position when moving vertically with the arrow keys and
scrolling with page-up/page-down. (Arrow keys save only the X,
scrolling saves both X and Y.)
This means you can line-up / line-down or page-up / page-down
without losing your place, and also that moving vertically
with the cursor keys keeps the same X position, not the same
character count:
* gtk/gtktextlayout.[ch] gtk/gtktextview.[ch]: Make vertical
arrow keys move by display lines, not paragraphs.
Tue Apr 18 14:16:50 2000 Owen Taylor <otaylor@redhat.com>
* gtk/gtklayout.c: Make sure that the bin window is at least
as big as the allocation. (Should we also make sure that the
bin window is big enough to completely cover widget->window?)
* gtk/gtktextview.c (gtk_text_view_get_visible_rect): Add
function to get the onscreen rectangle.
* gdk/x11/gdkwindow-x11.c (gdk_window_get_pointer): Correctly account
for offsets in window coordinates.
Sun Apr 16 16:13:27 2000 Owen Taylor <otaylor@redhat.com>
* gtk/gtkentry.c (gtk_entry_get_cursor_locations): Fix index/offset
confusion.
* gtk/gtktextview.c (gtk_text_view_ensure_layout): Set the default direction
from the widget direction.
* gtk/gtktexttag.c gtk/gtktexttagprivate.h (gtk_text_tag_set_arg):
Add a "direction" attribute.
* gtk/gtktextview.c: global s/tkxt/text_view/.
* gtk/testtext.c: Added long block of text in Arabic, to test out
the direction attributes. (Some problems with the shaping system
for arabic become obvious - like the fact the cursor splits words
into unjoined pieces.)
Fri Apr 14 12:54:34 2000 Owen Taylor <otaylor@redhat.com>
* gtk/gtktextdisplay.c (render_layout): Add overstrike handling.
* gtk/gtktextlayout.c: Fix up alignment.
* gtk/testtext.c: Add some tests for centering, wrapping.
Fri Apr 14 09:26:22 2000 Owen Taylor <otaylor@redhat.com>
* gdk/gdkdrawable.h gdk/gdkdraw.c gdk/gdkwindow.c gdk/x11/gdkdrawable-x11.c:
Add a draw_glyphs() operation to the drawable vtable and gdk_draw_glyphs().
If we wrote GTK+-specific layout-render function this could just replace
the draw_layout() operation in the vtable.
* gtk/gtkentry.c: Move guts of gtk_entry_get_cursor_locations to
pango_layout_get_cursor_pos() and use that function.
* gtk/gtktextchild.[ch]: add gtk_ onto pixmap_segment_new(), since it
is a non-static symbol.
* gtk/gtktextbtree.[ch]: Replace gtk_text_btree_find_line_data_by_y()
with gtk_text_btree_find_line_by_y()
* gtk/gtktextdisplay.c: Rewrote for Pango - uses a custom layout
renderer that handles GtkTextAppearance attributes.
* gtk/gtktexttag.[ch] gtk/gtktexttagprivate.h:
- Move the values in the style that don't affect geometry into a
GtkTextAppearance structure.
- Change underline to take a PangoUnderline and "font" a string
representation of a font description
- Add a "font_desc" attribute which takes a FontDescription structure.
* gtk/gtktextlayout.[ch]:
- Get rid of the display-line list per each line. Instead, we
generate, on demand, a GtkTextLineDisplay structure which]
contains a PangoLayout * and other necesary information
(offsets, cursor locations) for displaying a paragraph.
- Get rid of the code to wrap lines, create display chunks,
etc. Instead, we just go through a paragraph and convert
it into the necessary inputs to a PangoLayout.
- Implement a new attribute type, GtkTextAttrAppearance. This
holds a GtkTextAppearance, and is used to pass colors,
stipple, etc, through from the layout to the display without
having to use lots and lots of individual attributes.
- Reimplement gtk_layout_get_iter_at_pixel() gtk_layout_get_iter_pos()
in terms of PangoLayout functions.
* gtk/gtktextview.c:
- Handle passing the necessary PangoContext to the layout
- Some fixups in painting to deal with the automatic backing store
and offsetting of GTK+-1.4
- Add a style_set handler so that the default style reacts
properly to theme changes.
* gtk/gtktext?*.[ch]: Random code-style fixes.
* gtk/testtext.c: Substitute in languages that Pango handles now for Thai
Mon Apr 10 10:33:45 2000 Owen Taylor <otaylor@redhat.com>
* gtk/gtktext?*.[ch]: Check in Havoc's port of the Tk text widget,
in original form preparatory to Pango-ization and gdkimcontext-ization.
Thu Apr 6 19:25:39 2000 Owen Taylor <otaylor@redhat.com>
* gtk/gtkimcontext.c: Move default implementations to real_* vfuncs,
so that we can derive from gtkimcontext in language bindings properly.
Thu Apr 6 16:02:52 2000 Owen Taylor <otaylor@redhat.com>
* gtk/gtkimcontextsimple.[ch]: Use gdk_keyval_to_unicode to gdk_unicode_to_keyval.
Add a compose table including (almost) all the compose combinations
from X. This is 6k of static, shared data as opposed to 50k or so of dynamic
data in the XIM implementation.
* gdk/gdk.h gdk/gdkkeyuni.c gdk/win32/gdkevents-win32.c (gdk_keyval_to_unicode, gdk_unicode_to_keyval):
Moved functions to convert keyvalues from and to unicode here from
the win32 port and made them public.
Wed Apr 5 16:37:29 2000 Owen Taylor <otaylor@redhat.com>
* gtk/gtkeditable.c (gtk_editable_insert_text): Allow new_text_length == -1.
Wed Apr 5 16:27:45 2000 Owen Taylor <otaylor@redhat.com>
* gtk/gtkimcontext.[ch]: Base class for new input context system
* gtk/gtkimmulticontext.[ch]: Proxy input context that allows
the real input context implementation to be loaded from modules
and switched on the fly.
* gtk/gtkcontextsimple.[ch]: Simple implementation of an input
context that just does direct keysymbol => unicode translation.
* gtk/gtkentry.[ch]: Start switching editing over to using
GtkInputContext. (No handling of preedit yet.)
Wed Apr 5 15:48:41 2000 Owen Taylor <otaylor@redhat.com>
* gtk/gtktypeutils.h (GTK_CHECK_GET_CLASS): Fix problem with one too
many substitutions. (klass should not be subsituted.)
Wed Apr 5 00:18:14 2000 Owen Taylor <otaylor@redhat.com>
* configure.in: Add checks for Pango
* configure.in docs/Makefile.am: Add test for sgml2html
and allow 'make dist' without building html, but print out
warnings in that case. (For making snapshots)
* gdk/Makefile.am gdk/x11/Makefile.am gtk/Makefile.am:
Add Pango libraries and C flags
* gdk/gdkdraw.c gdk/gdkdrawable.h gdkwindow.c gdk/x11/gdkdrawable-x11.c:
Add function (gdk_draw_layout) to draw a pango layout.
* gdk/gdkpango.h gdk/x11/gdkpango-x11.c: New file with functions
for getting Pango contexts for GDK.
* gtk/gtkeditable.c: Get rid of dead code gtk_editable_parent_set()
* gtk/gtkentry.[ch]: Complete rewrite to use Pango, add bidirectional
editing.
* gtk/gtkentry.c: Hack in simple Hebrew input with direct
keysym => unicode translations. More languages can be added
here, but real input-method support is needed.
* docs/Changes-1.4.txt: Added note about entry behavior.
* gtk/gtkenums.h gtk/gtkwidget.[ch] testgtk.c gtkprivate.h: Add functions
to set the reading direction for a widget and the global direction.
Add test which allows toggling the global direction. Two private
flags are used to store the direction. (GTK_DIRECTION_SET + GTK_DIRECTION_LTR)
* gtk/gtkcheckbutton.c gtk/gtkframe.c gtk/gtkhbbox.c gtk/gtkhbox.c
gtk/gtkradiobutton.c gtk/gtkspinbutton.c gtk/gtktable.c
* gtk/gtk[hv]scale.c gtk/gtkscale.[ch]: Draw numbers using Pango
* gtk/gtklabel.[ch]: Moved to Pango and considerably rewritten. Line breaking,
underlining now handled by Pango.
* gtk/gtkstyle.[ch] gtk/gtkrc.[ch]: Add a PangoFontDescription
to RCStyle and Style. (Having both this and the old font name and GdkFont
is temporary.)
* gtk/gtkwidget.[ch] (gtk_widget_create_pango_{context,layout}): Added
convenience functions for creating contexts and layouts for widgets.
* gtk/testgtk.c: Enhance label tests with multilingual labels.
2000-06-02 03:14:07 +00:00
|
|
|
|
|
2005-05-11 19:16:19 +00:00
|
|
|
|
x_loc = (priv->week_width
|
2000-07-02 21:32:56 +00:00
|
|
|
|
- logical_rect.width
|
2002-02-14 05:05:45 +00:00
|
|
|
|
- CALENDAR_XSEP - focus_padding - focus_width);
|
Remove all references to offscreen flag which was no longer used.
Thu Jun 1 23:05:13 2000 Owen Taylor <otaylor@redhat.com>
* gtk/gtkwidget.c: Remove all references to
offscreen flag which was no longer used.
* gtk/gtkprivate.h (enum): Remove unused flags and compress.
* gtk/gtkframe.c (gtk_frame_set_label_widget): Check
for non-null label_widget->parent.
* gtk/gtkentry.c: Get rid of code to deal with PangoAttribute
which no longer was used.
* gdk/gdkpango.c (gdk_pango_context_get_info): make static.
* gdk/gdkpango.c (gdk_draw_layout[_line]): Add checks
for null arguments.
* gdk/x11/gdkgeometry-x11.c (gdk_window_scroll): add
check for destroyed windows.
Thu Jun 1 13:48:45 2000 Owen Taylor <otaylor@redhat.com>
* gtk/gtkimmulticontext.c: Add a finalize method and unref
the slave context there.
* gtk/gtkinvisible.[ch]: Make reference counting behavior
identical to GtkWindow.
Thu Jun 1 01:54:11 2000 Owen Taylor <otaylor@redhat.com>
* Makefile.am gdk/gdkpango.c: Copy the layout render function from
pangox to here, so we can write them independent of rendering
system, using GDK primitives.
* gdk/gdkdrawable.h gdk/gdkdraw.c gdk/gdkwindow.c
gdk/x11/gdkdrawable-x11.c: Remove draw_layout() from the vtable,
since we have a rendering-system independent implementation in
terms of draw_glyphs().
* gdk/gdkpango.c gdkdrawable.h (gdk_draw_layout_line): New
function to render a single line.
* gdk/x11/gdkpango.c: Move the guts of this file mostly
into ../gdkpango.c, which simplifies things, since we
don't have to deal with raw X gc's.
Fri May 19 04:28:16 2000 Owen Taylor <otaylor@redhat.com>
* gtk/gtktextlayout.[ch]: Add get_log_attrs() function to
get the logical attributes for a given GtkTextLine.
Tue May 30 16:05:39 2000 Owen Taylor <otaylor@redhat.com>
* gdk/x11/gdkfont-x11.c (gdk_font_charset_for_locale): Track
g_locale_get_codeset() to g_get_codeset() change.
Tue May 30 15:03:19 2000 Owen Taylor <otaylor@redhat.com>
* gtk/testcalendar.c (calendar_font_selection_ok): Use font
descriptions.
* gtk/gtkentry.c (gtk_entry_draw_text): Center text within
the entry.
* gtk/gtkfontsel.c (gtk_font_selection_dialog_init): Start of
redoing (vastly simplifying) for Pango. Still needs quite
a bit of work. (Size selection is currently poor. List of
predefined sizes is not a good idea, since all of these
sizes won't necessarily be distinct.)
Tue May 30 13:50:19 2000 Owen Taylor <otaylor@redhat.com>
* gdk/x11/gdkfont-x11.c (gdk_font_charset_for_locale): Handle
CODESET results for LANG=C.
Mon May 29 15:49:10 2000 Owen Taylor <otaylor@redhat.com>
* gtk/gtkrc.[ch]: Add a 'font_name' declaration to RC
which takes a stringized pango font description;
ignore the older 'font' and 'fontset' declarations.
* gtk/gtkstyle.c gtk/gtkrc.c: Fill in the style->font
field with a GdkFont derived via gdk_font_from_description(),
for compatibility. (Should we just remove it entirely?
Probably too much compatibility breakage, but people
should be migrating to the new Pango stuff as quickly
as possible.)
Mon May 29 15:47:41 2000 Owen Taylor <otaylor@redhat.com>
* gtk/gtkentry.c gtk/gtkclist.c: s/pango_font_unref/g_object_unref/.
Mon May 29 15:44:46 2000 Owen Taylor <otaylor@redhat.com>
* gtk/gtkcalender.c: Roughly pango-ized. Really needs
redoing; there are some bugs in size allocation right
now, the semi-existant distinction between header / day
fonts was removed, but, with Pango, could actually
be made functional in a nice way.
* gtk/testcalender: Move calender from examples into this
directory as a test program. (We really need to restrcture
testgtk into a whole directory full of tests for every
widget or functionality group, separated into multiple .c
files.)
Mon May 29 15:19:56 2000 Owen Taylor <otaylor@redhat.com>
* gtk/testgtk.c (file_exists): Fix stupid typo that
was keeping RC file from being loaded.
* gtk/testgtkrc gtk/testgtkrc2: Test new pango-ized
RC file font code.
Mon May 29 14:31:27 2000 Owen Taylor <otaylor@redhat.com>
* gdk/gdkfont.h gdk/x11/gdkfont-x11.c (gdk_font_from_description):
Add function to load a GdkFont from a PangoFontDescription.
Fri May 26 17:16:40 2000 Owen Taylor <otaylor@redhat.com>
* gtk/frame.[ch] gtkaspectframe.c: Make frame widgets able
to have any widget for the label, use a GtkLabel widget
to display the text. (Based partially on a patch from
Anders Carlson.)
(Quite a bit of code reorganization - strip 90% of the
guts out of gtkaspectframe and add a single virtual
func to GtkFrameClass - compute_child_allocation.)
Fri May 26 12:00:02 2000 Owen Taylor <otaylor@redhat.com>
* gtk/gtkctree.c gtk/gtkclist.[ch]: Pangoized.
(Removed clist->row_center_offset field because caching
it wasn't saving time or code, added private function
_gtk_clist_create_cell_layout()).
Wed May 24 15:59:37 2000 Owen Taylor <otaylor@redhat.com>
* gtk/gtkaccellabel.c: Pangoized.
* gtk/[hv]ruler.c: Pangoized
Mon May 22 19:23:59 2000 Owen Taylor <otaylor@redhat.com>
* gtk/gtkfilesel.c (gtk_file_selection_init):
Use gtk_clist_set_column_auto_resize() to remove need
need for manual column width computations.
Mon May 22 18:50:26 2000 Owen Taylor <otaylor@redhat.com>
* gtk/gtktooltips.[ch]: Replace custom drawing with a GtkLabel,
ensuring Pango correctness, and considerably simplifying the
code.
* gtk/gtklabel.c gtk[hv]scale.c: 1000 => PANGO_SCALE.
* gtk/gtklabel.c (gtk_label_size_request): Fixed incorrect
getting of numbers of lines.
* gtk/gtklabel.c (gtk_label_size_request): Set the requisition
to the actual requested width of the lable, not to the wrap
width we set.
* gtk/gtktextchild.h: Remove extraneous include of gtk/gtk.h.
* gtk/gtktextbtree.c gtk/gtktextbuffer.c gtk/gtktextlayout.c
gtk/gtktextview.c gtk/gtktextview.[ch]: Fix up includes.
* gtk/gtktextview.c: Fix structure inheritance.
* gtk/gtkprogressbar.c: Pangoize.
Mon May 22 15:47:30 2000 Owen Taylor <otaylor@redhat.com>
* gtk/gtktextview.c (gtk_text_view_get_first_para_iter): Encapsulate
in a function.
* gtk/gtktextlayout.c (find_display_line_above): Fixed
bug with computing line tops.
* gtk/gtktextview.c (changed_handler): Fix < , <= confusion.
Thu May 18 18:53:31 2000 Owen Taylor <otaylor@redhat.com>
* gtk/gtktextdisplay.c (gtk_text_layout_draw): Fix up the x_offset
and y_offset coordinates to do what we need now. (The offset between
buffer and layout coordinates has been reintroduced, but is a
bit different than before.)
* gtk/gtktextview.[ch]: No longer inherit from GtkLayout; instead
handle the adjustments ourselves, and scroll as necessary using
the new gdk_window_scroll().
The advantage of this is that when we are incrementally revalidating,
we are essentially rearranging things around the visible portion
of the screen. With the old setup, the visible portion of the
screen was moved around in the layout, so scrolling and redrawing
to track that caused jumping of the display. Since we now
control the scrolling ourselves, we can suppress this and
only redraw when things actually change.
Thu May 18 18:47:25 2000 Owen Taylor <otaylor@redhat.com>
* gtk/gtktextbtree.c (redisplay_mark): We need to invalidate
the region not just redisplay it after-all, since we store the
cursors in the LineDisplay. (Ugly interactions here between
GtkLayout and GtkTextBTree here.)
* gtk/gtktextbtree.c (redisplay_region): Fixed reversed comparison.
Thu May 18 18:43:21 2000 Owen Taylor <otaylor@redhat.com>
* gdk/gdkwindow.h gdk/x11/gdkgeometry-x11.c (gdk_window_scroll):
Added function to scroll contents of a window while keeping the
window constant. Works by XCopyArea or guffaw-scrolling depending
on the details of how the window is set up. (guffaw-scrolling
still needs to be filled in.)
Wed May 17 22:36:53 2000 Owen Taylor <otaylor@redhat.com>
* gtk/gtktextiter.c gtk/gtkmain.c: Add a debug key for the text widget,
move the debugging that was tied to a global variable
to that.
* gtk/gtkmarshal.list: Add NONE:INT,INT,INT
* gtk/gtktextbtree.[ch] gtk/gtktextlayout.c: Keep a separate
validated flag, in line data instead of setting height/width to
-1. This allows us to perform operations with partially invalid
buffer (using the old size for invalid lines) and thus to do
incremental vaidation. Keep height/width aggregates up to date
when deleting text and rebalancing the tree.
* gtk/gtktextbtree.[ch]: Add functions validate a line
(gtk_text_btree_validate_line), and to validate up
to a number of pixels (gtk_text_btree_validate).
* gtk/gtktextlayout.[ch]: Add an ::invalidated signal
that indicates that something is changed and a revalidation
pass is needed. Change ::need_repaint to ::changed, and
make it take old and new yranges instead of a rectangle.
* gtk/gtktextbtree.[ch] gtk/gtktextlayout.[ch]: Move
the line_data_destroy() function from
gtk_text_btree_add_view() to a virtual function in
GtkTextLayout
* gtk/gtktextbtree.[ch]: Remove gtk_text_btree_get_damage_range(),
since we are handling partial repaints in a different fashion
now.
* gtk/gtktextbtree.[ch]: Only repaint the changed portion
of the selection instead of queueing a repaint on the
entire widget.
* gtk/gtktextbuffer.[ch] gtk/gtktextbtree.[ch]: Move
get_selection_bounds() down to btree, make the function
in buffer a wrapper around the btree function.
* gtk/gtktextlayout.[ch]: Add functions to check if the
layout is valid and to recompute either a range of pixels
aroudn a line or a certain total number of pixels.
* gtk/gtktextlayout.[ch]: Cache a single line display;
now that we only redraw the needed portions, the hit rate
for this cache is quite high.
* gtk/gtktextview.[ch]: Keep track of the first paragraph
on the screen so that when re-laying-out the buffer, we can
keep the same place. This requires connecting to ::value_changed
on the adjustments
* gtk/gtktextview.[ch]: Add idle functions to revalidate
the buffer after we receive an ::invalidated signal.
Wed May 17 22:10:47 2000 Owen Taylor <otaylor@redhat.com>
* gtk/gtklayout.c (gtk_layout_size_allocate): Set upper
to max of allocation and layout size, not just to the
layout size.
* gtk/gtk[hv]scrollbar.c (gtk_[hv]scrollbar_calc_slider_size):
Invalidate window so it gets redrawn properly.
* gdk/gdkwindow.c (gdk_window_invalidate_rect): Allow rect == NULL
to mean the entire window.
* gdk/gdkevents.h: Move definition for GDK_PRIORITY_REDRAW
into public header.
Mon May 15 14:51:31 2000 Owen Taylor <otaylor@redhat.com>
* gtk/gtktextmark.c (gtk_text_mark_get_name): Add function
to get the name of a mark.
* gtk/gtktextlayout.c (gtk_text_layout_get_line_at_y): Add a function
to find the paragraph from a y position.
Thu May 11 12:57:20 2000 Owen Taylor <otaylor@redhat.com>
* gtk/gtktextbtree.c (gtk_text_btree_node_invalidate_upward): Valid
nodes have width/height >= 0, not > 0.
Tue May 9 21:29:06 2000 Owen Taylor <otaylor@redhat.com>
* gtk/gtktextlayout.[ch] gtk/gtktextdisplay.c (gtk_text_layout_get_line_display):
Add a size_only flag, so when we only need the size, we don't create
useless appearance attributes.
* gtk/gtktextview.c (gtk_text_view_ensure_layout): Remove
duplicate setting of font description.
* gtk/gtkscale.c: Use PANGO_SCALE instead of 1000
Wed Apr 26 01:53:23 2000 Owen Taylor <otaylor@redhat.com>
* gtk/Makefile.am (EXTRA_DIST): Add OLD_STAMP into
EXTRA_DIST. It does not work well when the file that
everything depends on is not in the tarball.
Wed Apr 26 00:56:14 2000 Owen Taylor <otaylor@redhat.com>
* gtk/testgtk.c: Some hacks and fixes so that it basically
works when not sitting in the GTK+ build tree.
2000-05-03 Havoc Pennington <hp@redhat.com>
* gtk/gtktextbtree.c (gtk_text_line_next_could_contain_tag):
Properly determine the ordering of the tag root and the current
line within the tree. Previous algorithm only worked if the tag
root's immediate parent was the common root of both the current
line and the tag root.
Wed Apr 26 00:43:00 2000 Owen Taylor <otaylor@redhat.com>
* gtk/gtktextlayout.c (set_para_values): Fix some bugs in
alignment.
* gtk/gtktextview.c (gtk_text_view_ensure_layout): Track
the widget text directional dynamically.
* gtk/gtktextview.[ch]: Added functions to get and set default
wrap mode.
Tue Apr 25 23:47:38 2000 Owen Taylor <otaylor@redhat.com>
* gtk/gtktextlayout.c (gtk_text_layout_get_iter_location): Fix bug
in cursor location computation.
Tue Apr 25 23:22:59 2000 Owen Taylor <otaylor@redhat.com>
* gtk/gtklayout.c (gtk_layout_set_size): Clamp hadjustment/
vadjusment values properly when layout gets smaller.
* gtk/gtktextview.c (need_repaint_handler): Areas being
passed in are far completely inaccurate, and sometimes
too small, so, for now, just queue a redraw on the
whole visible region.
2000-04-25 Havoc Pennington <hp@redhat.com>
* gtk/gtktextbtree.c (summary_destroy): new function to
destroy tag summary nodes
(gtk_text_line_next_could_contain_tag): this function was
totally broken if the line passed in wasn't below the tag
root. Fix it.
(gtk_text_btree_first_could_contain_tag): In the tag == NULL
"wildcard" case, we have to do a linear scan. Blah.
(gtk_text_btree_last_could_contain_tag): In tag == NULL case,
we have to do the linear scan
(tag_removed_cb): When a tag is removed from the tag table,
remove the GtkTextTagInfo node from the btree.
(gtk_text_btree_spew): Implement the spew function, for
our debugging pleasure.
Tue Apr 25 19:40:18 2000 Owen Taylor <otaylor@redhat.com>
* gtk/gtktextlayout.c (gtk_text_layout_set_buffer): Fix
a problem with referring to the wrong buffer.
* gtk/gtkentry.c: Fix focus-in/focus-out confusion.
* gtk/gtkrc.c gtk/gtkstyle.c: Moving setting default
font description to gtk_style_new() - otherwise things
don't work without a .gtkrc file.
* gtk/gtktextbuffer.c (gtk_text_buffer_new): Sink the
tags table if we create it ourself, too.
* gdk/gdktypes.h (enum): Move GDK_RELEASE_MASK, since
it was conflicting with XKB modifiers.
* gtk/gtktextview.[ch]: Add simple support for
GtkIMContext.
Mon Apr 24 19:34:18 2000 Owen Taylor <otaylor@redhat.com>
* gtk/gtkentry.c (gtk_entry_move_cursor_visually): Fix problem
with deletion from last commit.
Mon Apr 24 19:29:40 2000 Owen Taylor <otaylor@redhat.com>
* gtk/gtkwidget.c (gtk_widget_create_pango_context): Set the language
in the context from the current locale.
* gtk/gtkentry.c (gtk_entry_size_request): Use language from the
context, not hardcoded value.
* gtk/gtkentry.c (gtk_entry_move_cursor): Make character movement visual,
not logical.
Sun Apr 23 23:39:18 2000 Owen Taylor <otaylor@redhat.com>
* gtk/gtkentry.c gtk/gtktextdisplay.c: Don't handle selections as
attributes - that doesn't handle partial-glyph selection
properly. Instead use new pango_layout_line_get_x_ranges()
functionality to draw the selection.
* gtk/gtkentry.c: Simplify code since pango_layout_line_index_to_x()
now properly handles out-of-range coordinates.
* gtk/gtktextbuffer.c: Emit "mark_set" when the cursor is moved.
* gtk/gtktextiter.h gtk/gtktextiterprivate.h: Make gtk_text_iter_get_line_byte()
public.
* gtk/gtktextlayout.[ch]: Properly set the direction in the PangoContext
for paragraphs opposite to the base direction of the widget.
* gtk/gtktextlayout.[ch] gtk/gtktextdisplay.c: Fixes for alignment.
* gtk/gtktextlayout.c: Don't split segments on marks, since that
causes Arabic words to reshape as you cursor through.
* gtk/gtktextlayout.[ch] gtk/gtktextview.[ch]: Implement virtual
cursor position when moving vertically with the arrow keys and
scrolling with page-up/page-down. (Arrow keys save only the X,
scrolling saves both X and Y.)
This means you can line-up / line-down or page-up / page-down
without losing your place, and also that moving vertically
with the cursor keys keeps the same X position, not the same
character count:
* gtk/gtktextlayout.[ch] gtk/gtktextview.[ch]: Make vertical
arrow keys move by display lines, not paragraphs.
Tue Apr 18 14:16:50 2000 Owen Taylor <otaylor@redhat.com>
* gtk/gtklayout.c: Make sure that the bin window is at least
as big as the allocation. (Should we also make sure that the
bin window is big enough to completely cover widget->window?)
* gtk/gtktextview.c (gtk_text_view_get_visible_rect): Add
function to get the onscreen rectangle.
* gdk/x11/gdkwindow-x11.c (gdk_window_get_pointer): Correctly account
for offsets in window coordinates.
Sun Apr 16 16:13:27 2000 Owen Taylor <otaylor@redhat.com>
* gtk/gtkentry.c (gtk_entry_get_cursor_locations): Fix index/offset
confusion.
* gtk/gtktextview.c (gtk_text_view_ensure_layout): Set the default direction
from the widget direction.
* gtk/gtktexttag.c gtk/gtktexttagprivate.h (gtk_text_tag_set_arg):
Add a "direction" attribute.
* gtk/gtktextview.c: global s/tkxt/text_view/.
* gtk/testtext.c: Added long block of text in Arabic, to test out
the direction attributes. (Some problems with the shaping system
for arabic become obvious - like the fact the cursor splits words
into unjoined pieces.)
Fri Apr 14 12:54:34 2000 Owen Taylor <otaylor@redhat.com>
* gtk/gtktextdisplay.c (render_layout): Add overstrike handling.
* gtk/gtktextlayout.c: Fix up alignment.
* gtk/testtext.c: Add some tests for centering, wrapping.
Fri Apr 14 09:26:22 2000 Owen Taylor <otaylor@redhat.com>
* gdk/gdkdrawable.h gdk/gdkdraw.c gdk/gdkwindow.c gdk/x11/gdkdrawable-x11.c:
Add a draw_glyphs() operation to the drawable vtable and gdk_draw_glyphs().
If we wrote GTK+-specific layout-render function this could just replace
the draw_layout() operation in the vtable.
* gtk/gtkentry.c: Move guts of gtk_entry_get_cursor_locations to
pango_layout_get_cursor_pos() and use that function.
* gtk/gtktextchild.[ch]: add gtk_ onto pixmap_segment_new(), since it
is a non-static symbol.
* gtk/gtktextbtree.[ch]: Replace gtk_text_btree_find_line_data_by_y()
with gtk_text_btree_find_line_by_y()
* gtk/gtktextdisplay.c: Rewrote for Pango - uses a custom layout
renderer that handles GtkTextAppearance attributes.
* gtk/gtktexttag.[ch] gtk/gtktexttagprivate.h:
- Move the values in the style that don't affect geometry into a
GtkTextAppearance structure.
- Change underline to take a PangoUnderline and "font" a string
representation of a font description
- Add a "font_desc" attribute which takes a FontDescription structure.
* gtk/gtktextlayout.[ch]:
- Get rid of the display-line list per each line. Instead, we
generate, on demand, a GtkTextLineDisplay structure which]
contains a PangoLayout * and other necesary information
(offsets, cursor locations) for displaying a paragraph.
- Get rid of the code to wrap lines, create display chunks,
etc. Instead, we just go through a paragraph and convert
it into the necessary inputs to a PangoLayout.
- Implement a new attribute type, GtkTextAttrAppearance. This
holds a GtkTextAppearance, and is used to pass colors,
stipple, etc, through from the layout to the display without
having to use lots and lots of individual attributes.
- Reimplement gtk_layout_get_iter_at_pixel() gtk_layout_get_iter_pos()
in terms of PangoLayout functions.
* gtk/gtktextview.c:
- Handle passing the necessary PangoContext to the layout
- Some fixups in painting to deal with the automatic backing store
and offsetting of GTK+-1.4
- Add a style_set handler so that the default style reacts
properly to theme changes.
* gtk/gtktext?*.[ch]: Random code-style fixes.
* gtk/testtext.c: Substitute in languages that Pango handles now for Thai
Mon Apr 10 10:33:45 2000 Owen Taylor <otaylor@redhat.com>
* gtk/gtktext?*.[ch]: Check in Havoc's port of the Tk text widget,
in original form preparatory to Pango-ization and gdkimcontext-ization.
Thu Apr 6 19:25:39 2000 Owen Taylor <otaylor@redhat.com>
* gtk/gtkimcontext.c: Move default implementations to real_* vfuncs,
so that we can derive from gtkimcontext in language bindings properly.
Thu Apr 6 16:02:52 2000 Owen Taylor <otaylor@redhat.com>
* gtk/gtkimcontextsimple.[ch]: Use gdk_keyval_to_unicode to gdk_unicode_to_keyval.
Add a compose table including (almost) all the compose combinations
from X. This is 6k of static, shared data as opposed to 50k or so of dynamic
data in the XIM implementation.
* gdk/gdk.h gdk/gdkkeyuni.c gdk/win32/gdkevents-win32.c (gdk_keyval_to_unicode, gdk_unicode_to_keyval):
Moved functions to convert keyvalues from and to unicode here from
the win32 port and made them public.
Wed Apr 5 16:37:29 2000 Owen Taylor <otaylor@redhat.com>
* gtk/gtkeditable.c (gtk_editable_insert_text): Allow new_text_length == -1.
Wed Apr 5 16:27:45 2000 Owen Taylor <otaylor@redhat.com>
* gtk/gtkimcontext.[ch]: Base class for new input context system
* gtk/gtkimmulticontext.[ch]: Proxy input context that allows
the real input context implementation to be loaded from modules
and switched on the fly.
* gtk/gtkcontextsimple.[ch]: Simple implementation of an input
context that just does direct keysymbol => unicode translation.
* gtk/gtkentry.[ch]: Start switching editing over to using
GtkInputContext. (No handling of preedit yet.)
Wed Apr 5 15:48:41 2000 Owen Taylor <otaylor@redhat.com>
* gtk/gtktypeutils.h (GTK_CHECK_GET_CLASS): Fix problem with one too
many substitutions. (klass should not be subsituted.)
Wed Apr 5 00:18:14 2000 Owen Taylor <otaylor@redhat.com>
* configure.in: Add checks for Pango
* configure.in docs/Makefile.am: Add test for sgml2html
and allow 'make dist' without building html, but print out
warnings in that case. (For making snapshots)
* gdk/Makefile.am gdk/x11/Makefile.am gtk/Makefile.am:
Add Pango libraries and C flags
* gdk/gdkdraw.c gdk/gdkdrawable.h gdkwindow.c gdk/x11/gdkdrawable-x11.c:
Add function (gdk_draw_layout) to draw a pango layout.
* gdk/gdkpango.h gdk/x11/gdkpango-x11.c: New file with functions
for getting Pango contexts for GDK.
* gtk/gtkeditable.c: Get rid of dead code gtk_editable_parent_set()
* gtk/gtkentry.[ch]: Complete rewrite to use Pango, add bidirectional
editing.
* gtk/gtkentry.c: Hack in simple Hebrew input with direct
keysym => unicode translations. More languages can be added
here, but real input-method support is needed.
* docs/Changes-1.4.txt: Added note about entry behavior.
* gtk/gtkenums.h gtk/gtkwidget.[ch] testgtk.c gtkprivate.h: Add functions
to set the reading direction for a widget and the global direction.
Add test which allows toggling the global direction. Two private
flags are used to store the direction. (GTK_DIRECTION_SET + GTK_DIRECTION_LTR)
* gtk/gtkcheckbutton.c gtk/gtkframe.c gtk/gtkhbbox.c gtk/gtkhbox.c
gtk/gtkradiobutton.c gtk/gtkspinbutton.c gtk/gtktable.c
* gtk/gtk[hv]scale.c gtk/gtkscale.[ch]: Draw numbers using Pango
* gtk/gtklabel.[ch]: Moved to Pango and considerably rewritten. Line breaking,
underlining now handled by Pango.
* gtk/gtkstyle.[ch] gtk/gtkrc.[ch]: Add a PangoFontDescription
to RCStyle and Style. (Having both this and the old font name and GdkFont
is temporary.)
* gtk/gtkwidget.[ch] (gtk_widget_create_pango_{context,layout}): Added
convenience functions for creating contexts and layouts for widgets.
* gtk/testgtk.c: Enhance label tests with multilingual labels.
2000-06-02 03:14:07 +00:00
|
|
|
|
|
2005-05-11 19:16:19 +00:00
|
|
|
|
cairo_move_to (cr, x_loc, y_loc);
|
|
|
|
|
pango_cairo_show_layout (cr, layout);
|
1998-09-27 18:32:00 +00:00
|
|
|
|
}
|
Remove all references to offscreen flag which was no longer used.
Thu Jun 1 23:05:13 2000 Owen Taylor <otaylor@redhat.com>
* gtk/gtkwidget.c: Remove all references to
offscreen flag which was no longer used.
* gtk/gtkprivate.h (enum): Remove unused flags and compress.
* gtk/gtkframe.c (gtk_frame_set_label_widget): Check
for non-null label_widget->parent.
* gtk/gtkentry.c: Get rid of code to deal with PangoAttribute
which no longer was used.
* gdk/gdkpango.c (gdk_pango_context_get_info): make static.
* gdk/gdkpango.c (gdk_draw_layout[_line]): Add checks
for null arguments.
* gdk/x11/gdkgeometry-x11.c (gdk_window_scroll): add
check for destroyed windows.
Thu Jun 1 13:48:45 2000 Owen Taylor <otaylor@redhat.com>
* gtk/gtkimmulticontext.c: Add a finalize method and unref
the slave context there.
* gtk/gtkinvisible.[ch]: Make reference counting behavior
identical to GtkWindow.
Thu Jun 1 01:54:11 2000 Owen Taylor <otaylor@redhat.com>
* Makefile.am gdk/gdkpango.c: Copy the layout render function from
pangox to here, so we can write them independent of rendering
system, using GDK primitives.
* gdk/gdkdrawable.h gdk/gdkdraw.c gdk/gdkwindow.c
gdk/x11/gdkdrawable-x11.c: Remove draw_layout() from the vtable,
since we have a rendering-system independent implementation in
terms of draw_glyphs().
* gdk/gdkpango.c gdkdrawable.h (gdk_draw_layout_line): New
function to render a single line.
* gdk/x11/gdkpango.c: Move the guts of this file mostly
into ../gdkpango.c, which simplifies things, since we
don't have to deal with raw X gc's.
Fri May 19 04:28:16 2000 Owen Taylor <otaylor@redhat.com>
* gtk/gtktextlayout.[ch]: Add get_log_attrs() function to
get the logical attributes for a given GtkTextLine.
Tue May 30 16:05:39 2000 Owen Taylor <otaylor@redhat.com>
* gdk/x11/gdkfont-x11.c (gdk_font_charset_for_locale): Track
g_locale_get_codeset() to g_get_codeset() change.
Tue May 30 15:03:19 2000 Owen Taylor <otaylor@redhat.com>
* gtk/testcalendar.c (calendar_font_selection_ok): Use font
descriptions.
* gtk/gtkentry.c (gtk_entry_draw_text): Center text within
the entry.
* gtk/gtkfontsel.c (gtk_font_selection_dialog_init): Start of
redoing (vastly simplifying) for Pango. Still needs quite
a bit of work. (Size selection is currently poor. List of
predefined sizes is not a good idea, since all of these
sizes won't necessarily be distinct.)
Tue May 30 13:50:19 2000 Owen Taylor <otaylor@redhat.com>
* gdk/x11/gdkfont-x11.c (gdk_font_charset_for_locale): Handle
CODESET results for LANG=C.
Mon May 29 15:49:10 2000 Owen Taylor <otaylor@redhat.com>
* gtk/gtkrc.[ch]: Add a 'font_name' declaration to RC
which takes a stringized pango font description;
ignore the older 'font' and 'fontset' declarations.
* gtk/gtkstyle.c gtk/gtkrc.c: Fill in the style->font
field with a GdkFont derived via gdk_font_from_description(),
for compatibility. (Should we just remove it entirely?
Probably too much compatibility breakage, but people
should be migrating to the new Pango stuff as quickly
as possible.)
Mon May 29 15:47:41 2000 Owen Taylor <otaylor@redhat.com>
* gtk/gtkentry.c gtk/gtkclist.c: s/pango_font_unref/g_object_unref/.
Mon May 29 15:44:46 2000 Owen Taylor <otaylor@redhat.com>
* gtk/gtkcalender.c: Roughly pango-ized. Really needs
redoing; there are some bugs in size allocation right
now, the semi-existant distinction between header / day
fonts was removed, but, with Pango, could actually
be made functional in a nice way.
* gtk/testcalender: Move calender from examples into this
directory as a test program. (We really need to restrcture
testgtk into a whole directory full of tests for every
widget or functionality group, separated into multiple .c
files.)
Mon May 29 15:19:56 2000 Owen Taylor <otaylor@redhat.com>
* gtk/testgtk.c (file_exists): Fix stupid typo that
was keeping RC file from being loaded.
* gtk/testgtkrc gtk/testgtkrc2: Test new pango-ized
RC file font code.
Mon May 29 14:31:27 2000 Owen Taylor <otaylor@redhat.com>
* gdk/gdkfont.h gdk/x11/gdkfont-x11.c (gdk_font_from_description):
Add function to load a GdkFont from a PangoFontDescription.
Fri May 26 17:16:40 2000 Owen Taylor <otaylor@redhat.com>
* gtk/frame.[ch] gtkaspectframe.c: Make frame widgets able
to have any widget for the label, use a GtkLabel widget
to display the text. (Based partially on a patch from
Anders Carlson.)
(Quite a bit of code reorganization - strip 90% of the
guts out of gtkaspectframe and add a single virtual
func to GtkFrameClass - compute_child_allocation.)
Fri May 26 12:00:02 2000 Owen Taylor <otaylor@redhat.com>
* gtk/gtkctree.c gtk/gtkclist.[ch]: Pangoized.
(Removed clist->row_center_offset field because caching
it wasn't saving time or code, added private function
_gtk_clist_create_cell_layout()).
Wed May 24 15:59:37 2000 Owen Taylor <otaylor@redhat.com>
* gtk/gtkaccellabel.c: Pangoized.
* gtk/[hv]ruler.c: Pangoized
Mon May 22 19:23:59 2000 Owen Taylor <otaylor@redhat.com>
* gtk/gtkfilesel.c (gtk_file_selection_init):
Use gtk_clist_set_column_auto_resize() to remove need
need for manual column width computations.
Mon May 22 18:50:26 2000 Owen Taylor <otaylor@redhat.com>
* gtk/gtktooltips.[ch]: Replace custom drawing with a GtkLabel,
ensuring Pango correctness, and considerably simplifying the
code.
* gtk/gtklabel.c gtk[hv]scale.c: 1000 => PANGO_SCALE.
* gtk/gtklabel.c (gtk_label_size_request): Fixed incorrect
getting of numbers of lines.
* gtk/gtklabel.c (gtk_label_size_request): Set the requisition
to the actual requested width of the lable, not to the wrap
width we set.
* gtk/gtktextchild.h: Remove extraneous include of gtk/gtk.h.
* gtk/gtktextbtree.c gtk/gtktextbuffer.c gtk/gtktextlayout.c
gtk/gtktextview.c gtk/gtktextview.[ch]: Fix up includes.
* gtk/gtktextview.c: Fix structure inheritance.
* gtk/gtkprogressbar.c: Pangoize.
Mon May 22 15:47:30 2000 Owen Taylor <otaylor@redhat.com>
* gtk/gtktextview.c (gtk_text_view_get_first_para_iter): Encapsulate
in a function.
* gtk/gtktextlayout.c (find_display_line_above): Fixed
bug with computing line tops.
* gtk/gtktextview.c (changed_handler): Fix < , <= confusion.
Thu May 18 18:53:31 2000 Owen Taylor <otaylor@redhat.com>
* gtk/gtktextdisplay.c (gtk_text_layout_draw): Fix up the x_offset
and y_offset coordinates to do what we need now. (The offset between
buffer and layout coordinates has been reintroduced, but is a
bit different than before.)
* gtk/gtktextview.[ch]: No longer inherit from GtkLayout; instead
handle the adjustments ourselves, and scroll as necessary using
the new gdk_window_scroll().
The advantage of this is that when we are incrementally revalidating,
we are essentially rearranging things around the visible portion
of the screen. With the old setup, the visible portion of the
screen was moved around in the layout, so scrolling and redrawing
to track that caused jumping of the display. Since we now
control the scrolling ourselves, we can suppress this and
only redraw when things actually change.
Thu May 18 18:47:25 2000 Owen Taylor <otaylor@redhat.com>
* gtk/gtktextbtree.c (redisplay_mark): We need to invalidate
the region not just redisplay it after-all, since we store the
cursors in the LineDisplay. (Ugly interactions here between
GtkLayout and GtkTextBTree here.)
* gtk/gtktextbtree.c (redisplay_region): Fixed reversed comparison.
Thu May 18 18:43:21 2000 Owen Taylor <otaylor@redhat.com>
* gdk/gdkwindow.h gdk/x11/gdkgeometry-x11.c (gdk_window_scroll):
Added function to scroll contents of a window while keeping the
window constant. Works by XCopyArea or guffaw-scrolling depending
on the details of how the window is set up. (guffaw-scrolling
still needs to be filled in.)
Wed May 17 22:36:53 2000 Owen Taylor <otaylor@redhat.com>
* gtk/gtktextiter.c gtk/gtkmain.c: Add a debug key for the text widget,
move the debugging that was tied to a global variable
to that.
* gtk/gtkmarshal.list: Add NONE:INT,INT,INT
* gtk/gtktextbtree.[ch] gtk/gtktextlayout.c: Keep a separate
validated flag, in line data instead of setting height/width to
-1. This allows us to perform operations with partially invalid
buffer (using the old size for invalid lines) and thus to do
incremental vaidation. Keep height/width aggregates up to date
when deleting text and rebalancing the tree.
* gtk/gtktextbtree.[ch]: Add functions validate a line
(gtk_text_btree_validate_line), and to validate up
to a number of pixels (gtk_text_btree_validate).
* gtk/gtktextlayout.[ch]: Add an ::invalidated signal
that indicates that something is changed and a revalidation
pass is needed. Change ::need_repaint to ::changed, and
make it take old and new yranges instead of a rectangle.
* gtk/gtktextbtree.[ch] gtk/gtktextlayout.[ch]: Move
the line_data_destroy() function from
gtk_text_btree_add_view() to a virtual function in
GtkTextLayout
* gtk/gtktextbtree.[ch]: Remove gtk_text_btree_get_damage_range(),
since we are handling partial repaints in a different fashion
now.
* gtk/gtktextbtree.[ch]: Only repaint the changed portion
of the selection instead of queueing a repaint on the
entire widget.
* gtk/gtktextbuffer.[ch] gtk/gtktextbtree.[ch]: Move
get_selection_bounds() down to btree, make the function
in buffer a wrapper around the btree function.
* gtk/gtktextlayout.[ch]: Add functions to check if the
layout is valid and to recompute either a range of pixels
aroudn a line or a certain total number of pixels.
* gtk/gtktextlayout.[ch]: Cache a single line display;
now that we only redraw the needed portions, the hit rate
for this cache is quite high.
* gtk/gtktextview.[ch]: Keep track of the first paragraph
on the screen so that when re-laying-out the buffer, we can
keep the same place. This requires connecting to ::value_changed
on the adjustments
* gtk/gtktextview.[ch]: Add idle functions to revalidate
the buffer after we receive an ::invalidated signal.
Wed May 17 22:10:47 2000 Owen Taylor <otaylor@redhat.com>
* gtk/gtklayout.c (gtk_layout_size_allocate): Set upper
to max of allocation and layout size, not just to the
layout size.
* gtk/gtk[hv]scrollbar.c (gtk_[hv]scrollbar_calc_slider_size):
Invalidate window so it gets redrawn properly.
* gdk/gdkwindow.c (gdk_window_invalidate_rect): Allow rect == NULL
to mean the entire window.
* gdk/gdkevents.h: Move definition for GDK_PRIORITY_REDRAW
into public header.
Mon May 15 14:51:31 2000 Owen Taylor <otaylor@redhat.com>
* gtk/gtktextmark.c (gtk_text_mark_get_name): Add function
to get the name of a mark.
* gtk/gtktextlayout.c (gtk_text_layout_get_line_at_y): Add a function
to find the paragraph from a y position.
Thu May 11 12:57:20 2000 Owen Taylor <otaylor@redhat.com>
* gtk/gtktextbtree.c (gtk_text_btree_node_invalidate_upward): Valid
nodes have width/height >= 0, not > 0.
Tue May 9 21:29:06 2000 Owen Taylor <otaylor@redhat.com>
* gtk/gtktextlayout.[ch] gtk/gtktextdisplay.c (gtk_text_layout_get_line_display):
Add a size_only flag, so when we only need the size, we don't create
useless appearance attributes.
* gtk/gtktextview.c (gtk_text_view_ensure_layout): Remove
duplicate setting of font description.
* gtk/gtkscale.c: Use PANGO_SCALE instead of 1000
Wed Apr 26 01:53:23 2000 Owen Taylor <otaylor@redhat.com>
* gtk/Makefile.am (EXTRA_DIST): Add OLD_STAMP into
EXTRA_DIST. It does not work well when the file that
everything depends on is not in the tarball.
Wed Apr 26 00:56:14 2000 Owen Taylor <otaylor@redhat.com>
* gtk/testgtk.c: Some hacks and fixes so that it basically
works when not sitting in the GTK+ build tree.
2000-05-03 Havoc Pennington <hp@redhat.com>
* gtk/gtktextbtree.c (gtk_text_line_next_could_contain_tag):
Properly determine the ordering of the tag root and the current
line within the tree. Previous algorithm only worked if the tag
root's immediate parent was the common root of both the current
line and the tag root.
Wed Apr 26 00:43:00 2000 Owen Taylor <otaylor@redhat.com>
* gtk/gtktextlayout.c (set_para_values): Fix some bugs in
alignment.
* gtk/gtktextview.c (gtk_text_view_ensure_layout): Track
the widget text directional dynamically.
* gtk/gtktextview.[ch]: Added functions to get and set default
wrap mode.
Tue Apr 25 23:47:38 2000 Owen Taylor <otaylor@redhat.com>
* gtk/gtktextlayout.c (gtk_text_layout_get_iter_location): Fix bug
in cursor location computation.
Tue Apr 25 23:22:59 2000 Owen Taylor <otaylor@redhat.com>
* gtk/gtklayout.c (gtk_layout_set_size): Clamp hadjustment/
vadjusment values properly when layout gets smaller.
* gtk/gtktextview.c (need_repaint_handler): Areas being
passed in are far completely inaccurate, and sometimes
too small, so, for now, just queue a redraw on the
whole visible region.
2000-04-25 Havoc Pennington <hp@redhat.com>
* gtk/gtktextbtree.c (summary_destroy): new function to
destroy tag summary nodes
(gtk_text_line_next_could_contain_tag): this function was
totally broken if the line passed in wasn't below the tag
root. Fix it.
(gtk_text_btree_first_could_contain_tag): In the tag == NULL
"wildcard" case, we have to do a linear scan. Blah.
(gtk_text_btree_last_could_contain_tag): In tag == NULL case,
we have to do the linear scan
(tag_removed_cb): When a tag is removed from the tag table,
remove the GtkTextTagInfo node from the btree.
(gtk_text_btree_spew): Implement the spew function, for
our debugging pleasure.
Tue Apr 25 19:40:18 2000 Owen Taylor <otaylor@redhat.com>
* gtk/gtktextlayout.c (gtk_text_layout_set_buffer): Fix
a problem with referring to the wrong buffer.
* gtk/gtkentry.c: Fix focus-in/focus-out confusion.
* gtk/gtkrc.c gtk/gtkstyle.c: Moving setting default
font description to gtk_style_new() - otherwise things
don't work without a .gtkrc file.
* gtk/gtktextbuffer.c (gtk_text_buffer_new): Sink the
tags table if we create it ourself, too.
* gdk/gdktypes.h (enum): Move GDK_RELEASE_MASK, since
it was conflicting with XKB modifiers.
* gtk/gtktextview.[ch]: Add simple support for
GtkIMContext.
Mon Apr 24 19:34:18 2000 Owen Taylor <otaylor@redhat.com>
* gtk/gtkentry.c (gtk_entry_move_cursor_visually): Fix problem
with deletion from last commit.
Mon Apr 24 19:29:40 2000 Owen Taylor <otaylor@redhat.com>
* gtk/gtkwidget.c (gtk_widget_create_pango_context): Set the language
in the context from the current locale.
* gtk/gtkentry.c (gtk_entry_size_request): Use language from the
context, not hardcoded value.
* gtk/gtkentry.c (gtk_entry_move_cursor): Make character movement visual,
not logical.
Sun Apr 23 23:39:18 2000 Owen Taylor <otaylor@redhat.com>
* gtk/gtkentry.c gtk/gtktextdisplay.c: Don't handle selections as
attributes - that doesn't handle partial-glyph selection
properly. Instead use new pango_layout_line_get_x_ranges()
functionality to draw the selection.
* gtk/gtkentry.c: Simplify code since pango_layout_line_index_to_x()
now properly handles out-of-range coordinates.
* gtk/gtktextbuffer.c: Emit "mark_set" when the cursor is moved.
* gtk/gtktextiter.h gtk/gtktextiterprivate.h: Make gtk_text_iter_get_line_byte()
public.
* gtk/gtktextlayout.[ch]: Properly set the direction in the PangoContext
for paragraphs opposite to the base direction of the widget.
* gtk/gtktextlayout.[ch] gtk/gtktextdisplay.c: Fixes for alignment.
* gtk/gtktextlayout.c: Don't split segments on marks, since that
causes Arabic words to reshape as you cursor through.
* gtk/gtktextlayout.[ch] gtk/gtktextview.[ch]: Implement virtual
cursor position when moving vertically with the arrow keys and
scrolling with page-up/page-down. (Arrow keys save only the X,
scrolling saves both X and Y.)
This means you can line-up / line-down or page-up / page-down
without losing your place, and also that moving vertically
with the cursor keys keeps the same X position, not the same
character count:
* gtk/gtktextlayout.[ch] gtk/gtktextview.[ch]: Make vertical
arrow keys move by display lines, not paragraphs.
Tue Apr 18 14:16:50 2000 Owen Taylor <otaylor@redhat.com>
* gtk/gtklayout.c: Make sure that the bin window is at least
as big as the allocation. (Should we also make sure that the
bin window is big enough to completely cover widget->window?)
* gtk/gtktextview.c (gtk_text_view_get_visible_rect): Add
function to get the onscreen rectangle.
* gdk/x11/gdkwindow-x11.c (gdk_window_get_pointer): Correctly account
for offsets in window coordinates.
Sun Apr 16 16:13:27 2000 Owen Taylor <otaylor@redhat.com>
* gtk/gtkentry.c (gtk_entry_get_cursor_locations): Fix index/offset
confusion.
* gtk/gtktextview.c (gtk_text_view_ensure_layout): Set the default direction
from the widget direction.
* gtk/gtktexttag.c gtk/gtktexttagprivate.h (gtk_text_tag_set_arg):
Add a "direction" attribute.
* gtk/gtktextview.c: global s/tkxt/text_view/.
* gtk/testtext.c: Added long block of text in Arabic, to test out
the direction attributes. (Some problems with the shaping system
for arabic become obvious - like the fact the cursor splits words
into unjoined pieces.)
Fri Apr 14 12:54:34 2000 Owen Taylor <otaylor@redhat.com>
* gtk/gtktextdisplay.c (render_layout): Add overstrike handling.
* gtk/gtktextlayout.c: Fix up alignment.
* gtk/testtext.c: Add some tests for centering, wrapping.
Fri Apr 14 09:26:22 2000 Owen Taylor <otaylor@redhat.com>
* gdk/gdkdrawable.h gdk/gdkdraw.c gdk/gdkwindow.c gdk/x11/gdkdrawable-x11.c:
Add a draw_glyphs() operation to the drawable vtable and gdk_draw_glyphs().
If we wrote GTK+-specific layout-render function this could just replace
the draw_layout() operation in the vtable.
* gtk/gtkentry.c: Move guts of gtk_entry_get_cursor_locations to
pango_layout_get_cursor_pos() and use that function.
* gtk/gtktextchild.[ch]: add gtk_ onto pixmap_segment_new(), since it
is a non-static symbol.
* gtk/gtktextbtree.[ch]: Replace gtk_text_btree_find_line_data_by_y()
with gtk_text_btree_find_line_by_y()
* gtk/gtktextdisplay.c: Rewrote for Pango - uses a custom layout
renderer that handles GtkTextAppearance attributes.
* gtk/gtktexttag.[ch] gtk/gtktexttagprivate.h:
- Move the values in the style that don't affect geometry into a
GtkTextAppearance structure.
- Change underline to take a PangoUnderline and "font" a string
representation of a font description
- Add a "font_desc" attribute which takes a FontDescription structure.
* gtk/gtktextlayout.[ch]:
- Get rid of the display-line list per each line. Instead, we
generate, on demand, a GtkTextLineDisplay structure which]
contains a PangoLayout * and other necesary information
(offsets, cursor locations) for displaying a paragraph.
- Get rid of the code to wrap lines, create display chunks,
etc. Instead, we just go through a paragraph and convert
it into the necessary inputs to a PangoLayout.
- Implement a new attribute type, GtkTextAttrAppearance. This
holds a GtkTextAppearance, and is used to pass colors,
stipple, etc, through from the layout to the display without
having to use lots and lots of individual attributes.
- Reimplement gtk_layout_get_iter_at_pixel() gtk_layout_get_iter_pos()
in terms of PangoLayout functions.
* gtk/gtktextview.c:
- Handle passing the necessary PangoContext to the layout
- Some fixups in painting to deal with the automatic backing store
and offsetting of GTK+-1.4
- Add a style_set handler so that the default style reacts
properly to theme changes.
* gtk/gtktext?*.[ch]: Random code-style fixes.
* gtk/testtext.c: Substitute in languages that Pango handles now for Thai
Mon Apr 10 10:33:45 2000 Owen Taylor <otaylor@redhat.com>
* gtk/gtktext?*.[ch]: Check in Havoc's port of the Tk text widget,
in original form preparatory to Pango-ization and gdkimcontext-ization.
Thu Apr 6 19:25:39 2000 Owen Taylor <otaylor@redhat.com>
* gtk/gtkimcontext.c: Move default implementations to real_* vfuncs,
so that we can derive from gtkimcontext in language bindings properly.
Thu Apr 6 16:02:52 2000 Owen Taylor <otaylor@redhat.com>
* gtk/gtkimcontextsimple.[ch]: Use gdk_keyval_to_unicode to gdk_unicode_to_keyval.
Add a compose table including (almost) all the compose combinations
from X. This is 6k of static, shared data as opposed to 50k or so of dynamic
data in the XIM implementation.
* gdk/gdk.h gdk/gdkkeyuni.c gdk/win32/gdkevents-win32.c (gdk_keyval_to_unicode, gdk_unicode_to_keyval):
Moved functions to convert keyvalues from and to unicode here from
the win32 port and made them public.
Wed Apr 5 16:37:29 2000 Owen Taylor <otaylor@redhat.com>
* gtk/gtkeditable.c (gtk_editable_insert_text): Allow new_text_length == -1.
Wed Apr 5 16:27:45 2000 Owen Taylor <otaylor@redhat.com>
* gtk/gtkimcontext.[ch]: Base class for new input context system
* gtk/gtkimmulticontext.[ch]: Proxy input context that allows
the real input context implementation to be loaded from modules
and switched on the fly.
* gtk/gtkcontextsimple.[ch]: Simple implementation of an input
context that just does direct keysymbol => unicode translation.
* gtk/gtkentry.[ch]: Start switching editing over to using
GtkInputContext. (No handling of preedit yet.)
Wed Apr 5 15:48:41 2000 Owen Taylor <otaylor@redhat.com>
* gtk/gtktypeutils.h (GTK_CHECK_GET_CLASS): Fix problem with one too
many substitutions. (klass should not be subsituted.)
Wed Apr 5 00:18:14 2000 Owen Taylor <otaylor@redhat.com>
* configure.in: Add checks for Pango
* configure.in docs/Makefile.am: Add test for sgml2html
and allow 'make dist' without building html, but print out
warnings in that case. (For making snapshots)
* gdk/Makefile.am gdk/x11/Makefile.am gtk/Makefile.am:
Add Pango libraries and C flags
* gdk/gdkdraw.c gdk/gdkdrawable.h gdkwindow.c gdk/x11/gdkdrawable-x11.c:
Add function (gdk_draw_layout) to draw a pango layout.
* gdk/gdkpango.h gdk/x11/gdkpango-x11.c: New file with functions
for getting Pango contexts for GDK.
* gtk/gtkeditable.c: Get rid of dead code gtk_editable_parent_set()
* gtk/gtkentry.[ch]: Complete rewrite to use Pango, add bidirectional
editing.
* gtk/gtkentry.c: Hack in simple Hebrew input with direct
keysym => unicode translations. More languages can be added
here, but real input-method support is needed.
* docs/Changes-1.4.txt: Added note about entry behavior.
* gtk/gtkenums.h gtk/gtkwidget.[ch] testgtk.c gtkprivate.h: Add functions
to set the reading direction for a widget and the global direction.
Add test which allows toggling the global direction. Two private
flags are used to store the direction. (GTK_DIRECTION_SET + GTK_DIRECTION_LTR)
* gtk/gtkcheckbutton.c gtk/gtkframe.c gtk/gtkhbbox.c gtk/gtkhbox.c
gtk/gtkradiobutton.c gtk/gtkspinbutton.c gtk/gtktable.c
* gtk/gtk[hv]scale.c gtk/gtkscale.[ch]: Draw numbers using Pango
* gtk/gtklabel.[ch]: Moved to Pango and considerably rewritten. Line breaking,
underlining now handled by Pango.
* gtk/gtkstyle.[ch] gtk/gtkrc.[ch]: Add a PangoFontDescription
to RCStyle and Style. (Having both this and the old font name and GdkFont
is temporary.)
* gtk/gtkwidget.[ch] (gtk_widget_create_pango_{context,layout}): Added
convenience functions for creating contexts and layouts for widgets.
* gtk/testgtk.c: Enhance label tests with multilingual labels.
2000-06-02 03:14:07 +00:00
|
|
|
|
|
2002-10-09 22:11:08 +00:00
|
|
|
|
g_object_unref (layout);
|
2005-05-11 19:16:19 +00:00
|
|
|
|
cairo_destroy (cr);
|
1998-09-27 18:32:00 +00:00
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
static void
|
2005-05-11 19:16:19 +00:00
|
|
|
|
calendar_invalidate_day_num (GtkCalendar *calendar,
|
|
|
|
|
gint day)
|
1998-09-27 18:32:00 +00:00
|
|
|
|
{
|
|
|
|
|
gint r, c, row, col;
|
1998-10-01 13:24:42 +00:00
|
|
|
|
|
1998-09-27 18:32:00 +00:00
|
|
|
|
row = -1;
|
|
|
|
|
col = -1;
|
|
|
|
|
for (r = 0; r < 6; r++)
|
|
|
|
|
for (c = 0; c < 7; c++)
|
|
|
|
|
if (calendar->day_month[r][c] == MONTH_CURRENT &&
|
|
|
|
|
calendar->day[r][c] == day)
|
|
|
|
|
{
|
|
|
|
|
row = r;
|
|
|
|
|
col = c;
|
|
|
|
|
}
|
1998-10-01 13:24:42 +00:00
|
|
|
|
|
1998-09-27 18:32:00 +00:00
|
|
|
|
g_return_if_fail (row != -1);
|
|
|
|
|
g_return_if_fail (col != -1);
|
1998-10-01 13:24:42 +00:00
|
|
|
|
|
2005-05-11 19:16:19 +00:00
|
|
|
|
calendar_invalidate_day (calendar, row, col);
|
1998-09-27 18:32:00 +00:00
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
static void
|
2005-05-11 19:16:19 +00:00
|
|
|
|
calendar_invalidate_day (GtkCalendar *calendar,
|
|
|
|
|
gint row,
|
|
|
|
|
gint col)
|
1998-09-27 18:32:00 +00:00
|
|
|
|
{
|
2005-05-11 19:16:19 +00:00
|
|
|
|
GtkCalendarPrivate *priv = GTK_CALENDAR_GET_PRIVATE (calendar);
|
|
|
|
|
|
|
|
|
|
if (priv->main_win)
|
|
|
|
|
{
|
|
|
|
|
GdkRectangle day_rect;
|
|
|
|
|
|
|
|
|
|
calendar_day_rectangle (calendar, row, col, &day_rect);
|
|
|
|
|
gdk_window_invalidate_rect (priv->main_win, &day_rect, FALSE);
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
2007-12-28 09:26:20 +00:00
|
|
|
|
static gboolean
|
|
|
|
|
is_color_attribute (PangoAttribute *attribute,
|
|
|
|
|
gpointer data)
|
|
|
|
|
{
|
|
|
|
|
return (attribute->klass->type == PANGO_ATTR_FOREGROUND ||
|
|
|
|
|
attribute->klass->type == PANGO_ATTR_BACKGROUND);
|
|
|
|
|
}
|
|
|
|
|
|
2005-05-11 19:16:19 +00:00
|
|
|
|
static void
|
|
|
|
|
calendar_paint_day (GtkCalendar *calendar,
|
|
|
|
|
gint row,
|
|
|
|
|
gint col)
|
|
|
|
|
{
|
|
|
|
|
GtkWidget *widget = GTK_WIDGET (calendar);
|
|
|
|
|
GtkCalendarPrivate *priv = GTK_CALENDAR_GET_PRIVATE (calendar);
|
|
|
|
|
cairo_t *cr;
|
|
|
|
|
GdkColor *text_color;
|
2008-01-17 16:42:04 +00:00
|
|
|
|
gchar *detail;
|
2006-01-26 20:40:18 +00:00
|
|
|
|
gchar buffer[32];
|
1998-09-27 18:32:00 +00:00
|
|
|
|
gint day;
|
2005-05-11 19:16:19 +00:00
|
|
|
|
gint x_loc, y_loc;
|
|
|
|
|
GdkRectangle day_rect;
|
2002-02-14 04:05:13 +00:00
|
|
|
|
|
Remove all references to offscreen flag which was no longer used.
Thu Jun 1 23:05:13 2000 Owen Taylor <otaylor@redhat.com>
* gtk/gtkwidget.c: Remove all references to
offscreen flag which was no longer used.
* gtk/gtkprivate.h (enum): Remove unused flags and compress.
* gtk/gtkframe.c (gtk_frame_set_label_widget): Check
for non-null label_widget->parent.
* gtk/gtkentry.c: Get rid of code to deal with PangoAttribute
which no longer was used.
* gdk/gdkpango.c (gdk_pango_context_get_info): make static.
* gdk/gdkpango.c (gdk_draw_layout[_line]): Add checks
for null arguments.
* gdk/x11/gdkgeometry-x11.c (gdk_window_scroll): add
check for destroyed windows.
Thu Jun 1 13:48:45 2000 Owen Taylor <otaylor@redhat.com>
* gtk/gtkimmulticontext.c: Add a finalize method and unref
the slave context there.
* gtk/gtkinvisible.[ch]: Make reference counting behavior
identical to GtkWindow.
Thu Jun 1 01:54:11 2000 Owen Taylor <otaylor@redhat.com>
* Makefile.am gdk/gdkpango.c: Copy the layout render function from
pangox to here, so we can write them independent of rendering
system, using GDK primitives.
* gdk/gdkdrawable.h gdk/gdkdraw.c gdk/gdkwindow.c
gdk/x11/gdkdrawable-x11.c: Remove draw_layout() from the vtable,
since we have a rendering-system independent implementation in
terms of draw_glyphs().
* gdk/gdkpango.c gdkdrawable.h (gdk_draw_layout_line): New
function to render a single line.
* gdk/x11/gdkpango.c: Move the guts of this file mostly
into ../gdkpango.c, which simplifies things, since we
don't have to deal with raw X gc's.
Fri May 19 04:28:16 2000 Owen Taylor <otaylor@redhat.com>
* gtk/gtktextlayout.[ch]: Add get_log_attrs() function to
get the logical attributes for a given GtkTextLine.
Tue May 30 16:05:39 2000 Owen Taylor <otaylor@redhat.com>
* gdk/x11/gdkfont-x11.c (gdk_font_charset_for_locale): Track
g_locale_get_codeset() to g_get_codeset() change.
Tue May 30 15:03:19 2000 Owen Taylor <otaylor@redhat.com>
* gtk/testcalendar.c (calendar_font_selection_ok): Use font
descriptions.
* gtk/gtkentry.c (gtk_entry_draw_text): Center text within
the entry.
* gtk/gtkfontsel.c (gtk_font_selection_dialog_init): Start of
redoing (vastly simplifying) for Pango. Still needs quite
a bit of work. (Size selection is currently poor. List of
predefined sizes is not a good idea, since all of these
sizes won't necessarily be distinct.)
Tue May 30 13:50:19 2000 Owen Taylor <otaylor@redhat.com>
* gdk/x11/gdkfont-x11.c (gdk_font_charset_for_locale): Handle
CODESET results for LANG=C.
Mon May 29 15:49:10 2000 Owen Taylor <otaylor@redhat.com>
* gtk/gtkrc.[ch]: Add a 'font_name' declaration to RC
which takes a stringized pango font description;
ignore the older 'font' and 'fontset' declarations.
* gtk/gtkstyle.c gtk/gtkrc.c: Fill in the style->font
field with a GdkFont derived via gdk_font_from_description(),
for compatibility. (Should we just remove it entirely?
Probably too much compatibility breakage, but people
should be migrating to the new Pango stuff as quickly
as possible.)
Mon May 29 15:47:41 2000 Owen Taylor <otaylor@redhat.com>
* gtk/gtkentry.c gtk/gtkclist.c: s/pango_font_unref/g_object_unref/.
Mon May 29 15:44:46 2000 Owen Taylor <otaylor@redhat.com>
* gtk/gtkcalender.c: Roughly pango-ized. Really needs
redoing; there are some bugs in size allocation right
now, the semi-existant distinction between header / day
fonts was removed, but, with Pango, could actually
be made functional in a nice way.
* gtk/testcalender: Move calender from examples into this
directory as a test program. (We really need to restrcture
testgtk into a whole directory full of tests for every
widget or functionality group, separated into multiple .c
files.)
Mon May 29 15:19:56 2000 Owen Taylor <otaylor@redhat.com>
* gtk/testgtk.c (file_exists): Fix stupid typo that
was keeping RC file from being loaded.
* gtk/testgtkrc gtk/testgtkrc2: Test new pango-ized
RC file font code.
Mon May 29 14:31:27 2000 Owen Taylor <otaylor@redhat.com>
* gdk/gdkfont.h gdk/x11/gdkfont-x11.c (gdk_font_from_description):
Add function to load a GdkFont from a PangoFontDescription.
Fri May 26 17:16:40 2000 Owen Taylor <otaylor@redhat.com>
* gtk/frame.[ch] gtkaspectframe.c: Make frame widgets able
to have any widget for the label, use a GtkLabel widget
to display the text. (Based partially on a patch from
Anders Carlson.)
(Quite a bit of code reorganization - strip 90% of the
guts out of gtkaspectframe and add a single virtual
func to GtkFrameClass - compute_child_allocation.)
Fri May 26 12:00:02 2000 Owen Taylor <otaylor@redhat.com>
* gtk/gtkctree.c gtk/gtkclist.[ch]: Pangoized.
(Removed clist->row_center_offset field because caching
it wasn't saving time or code, added private function
_gtk_clist_create_cell_layout()).
Wed May 24 15:59:37 2000 Owen Taylor <otaylor@redhat.com>
* gtk/gtkaccellabel.c: Pangoized.
* gtk/[hv]ruler.c: Pangoized
Mon May 22 19:23:59 2000 Owen Taylor <otaylor@redhat.com>
* gtk/gtkfilesel.c (gtk_file_selection_init):
Use gtk_clist_set_column_auto_resize() to remove need
need for manual column width computations.
Mon May 22 18:50:26 2000 Owen Taylor <otaylor@redhat.com>
* gtk/gtktooltips.[ch]: Replace custom drawing with a GtkLabel,
ensuring Pango correctness, and considerably simplifying the
code.
* gtk/gtklabel.c gtk[hv]scale.c: 1000 => PANGO_SCALE.
* gtk/gtklabel.c (gtk_label_size_request): Fixed incorrect
getting of numbers of lines.
* gtk/gtklabel.c (gtk_label_size_request): Set the requisition
to the actual requested width of the lable, not to the wrap
width we set.
* gtk/gtktextchild.h: Remove extraneous include of gtk/gtk.h.
* gtk/gtktextbtree.c gtk/gtktextbuffer.c gtk/gtktextlayout.c
gtk/gtktextview.c gtk/gtktextview.[ch]: Fix up includes.
* gtk/gtktextview.c: Fix structure inheritance.
* gtk/gtkprogressbar.c: Pangoize.
Mon May 22 15:47:30 2000 Owen Taylor <otaylor@redhat.com>
* gtk/gtktextview.c (gtk_text_view_get_first_para_iter): Encapsulate
in a function.
* gtk/gtktextlayout.c (find_display_line_above): Fixed
bug with computing line tops.
* gtk/gtktextview.c (changed_handler): Fix < , <= confusion.
Thu May 18 18:53:31 2000 Owen Taylor <otaylor@redhat.com>
* gtk/gtktextdisplay.c (gtk_text_layout_draw): Fix up the x_offset
and y_offset coordinates to do what we need now. (The offset between
buffer and layout coordinates has been reintroduced, but is a
bit different than before.)
* gtk/gtktextview.[ch]: No longer inherit from GtkLayout; instead
handle the adjustments ourselves, and scroll as necessary using
the new gdk_window_scroll().
The advantage of this is that when we are incrementally revalidating,
we are essentially rearranging things around the visible portion
of the screen. With the old setup, the visible portion of the
screen was moved around in the layout, so scrolling and redrawing
to track that caused jumping of the display. Since we now
control the scrolling ourselves, we can suppress this and
only redraw when things actually change.
Thu May 18 18:47:25 2000 Owen Taylor <otaylor@redhat.com>
* gtk/gtktextbtree.c (redisplay_mark): We need to invalidate
the region not just redisplay it after-all, since we store the
cursors in the LineDisplay. (Ugly interactions here between
GtkLayout and GtkTextBTree here.)
* gtk/gtktextbtree.c (redisplay_region): Fixed reversed comparison.
Thu May 18 18:43:21 2000 Owen Taylor <otaylor@redhat.com>
* gdk/gdkwindow.h gdk/x11/gdkgeometry-x11.c (gdk_window_scroll):
Added function to scroll contents of a window while keeping the
window constant. Works by XCopyArea or guffaw-scrolling depending
on the details of how the window is set up. (guffaw-scrolling
still needs to be filled in.)
Wed May 17 22:36:53 2000 Owen Taylor <otaylor@redhat.com>
* gtk/gtktextiter.c gtk/gtkmain.c: Add a debug key for the text widget,
move the debugging that was tied to a global variable
to that.
* gtk/gtkmarshal.list: Add NONE:INT,INT,INT
* gtk/gtktextbtree.[ch] gtk/gtktextlayout.c: Keep a separate
validated flag, in line data instead of setting height/width to
-1. This allows us to perform operations with partially invalid
buffer (using the old size for invalid lines) and thus to do
incremental vaidation. Keep height/width aggregates up to date
when deleting text and rebalancing the tree.
* gtk/gtktextbtree.[ch]: Add functions validate a line
(gtk_text_btree_validate_line), and to validate up
to a number of pixels (gtk_text_btree_validate).
* gtk/gtktextlayout.[ch]: Add an ::invalidated signal
that indicates that something is changed and a revalidation
pass is needed. Change ::need_repaint to ::changed, and
make it take old and new yranges instead of a rectangle.
* gtk/gtktextbtree.[ch] gtk/gtktextlayout.[ch]: Move
the line_data_destroy() function from
gtk_text_btree_add_view() to a virtual function in
GtkTextLayout
* gtk/gtktextbtree.[ch]: Remove gtk_text_btree_get_damage_range(),
since we are handling partial repaints in a different fashion
now.
* gtk/gtktextbtree.[ch]: Only repaint the changed portion
of the selection instead of queueing a repaint on the
entire widget.
* gtk/gtktextbuffer.[ch] gtk/gtktextbtree.[ch]: Move
get_selection_bounds() down to btree, make the function
in buffer a wrapper around the btree function.
* gtk/gtktextlayout.[ch]: Add functions to check if the
layout is valid and to recompute either a range of pixels
aroudn a line or a certain total number of pixels.
* gtk/gtktextlayout.[ch]: Cache a single line display;
now that we only redraw the needed portions, the hit rate
for this cache is quite high.
* gtk/gtktextview.[ch]: Keep track of the first paragraph
on the screen so that when re-laying-out the buffer, we can
keep the same place. This requires connecting to ::value_changed
on the adjustments
* gtk/gtktextview.[ch]: Add idle functions to revalidate
the buffer after we receive an ::invalidated signal.
Wed May 17 22:10:47 2000 Owen Taylor <otaylor@redhat.com>
* gtk/gtklayout.c (gtk_layout_size_allocate): Set upper
to max of allocation and layout size, not just to the
layout size.
* gtk/gtk[hv]scrollbar.c (gtk_[hv]scrollbar_calc_slider_size):
Invalidate window so it gets redrawn properly.
* gdk/gdkwindow.c (gdk_window_invalidate_rect): Allow rect == NULL
to mean the entire window.
* gdk/gdkevents.h: Move definition for GDK_PRIORITY_REDRAW
into public header.
Mon May 15 14:51:31 2000 Owen Taylor <otaylor@redhat.com>
* gtk/gtktextmark.c (gtk_text_mark_get_name): Add function
to get the name of a mark.
* gtk/gtktextlayout.c (gtk_text_layout_get_line_at_y): Add a function
to find the paragraph from a y position.
Thu May 11 12:57:20 2000 Owen Taylor <otaylor@redhat.com>
* gtk/gtktextbtree.c (gtk_text_btree_node_invalidate_upward): Valid
nodes have width/height >= 0, not > 0.
Tue May 9 21:29:06 2000 Owen Taylor <otaylor@redhat.com>
* gtk/gtktextlayout.[ch] gtk/gtktextdisplay.c (gtk_text_layout_get_line_display):
Add a size_only flag, so when we only need the size, we don't create
useless appearance attributes.
* gtk/gtktextview.c (gtk_text_view_ensure_layout): Remove
duplicate setting of font description.
* gtk/gtkscale.c: Use PANGO_SCALE instead of 1000
Wed Apr 26 01:53:23 2000 Owen Taylor <otaylor@redhat.com>
* gtk/Makefile.am (EXTRA_DIST): Add OLD_STAMP into
EXTRA_DIST. It does not work well when the file that
everything depends on is not in the tarball.
Wed Apr 26 00:56:14 2000 Owen Taylor <otaylor@redhat.com>
* gtk/testgtk.c: Some hacks and fixes so that it basically
works when not sitting in the GTK+ build tree.
2000-05-03 Havoc Pennington <hp@redhat.com>
* gtk/gtktextbtree.c (gtk_text_line_next_could_contain_tag):
Properly determine the ordering of the tag root and the current
line within the tree. Previous algorithm only worked if the tag
root's immediate parent was the common root of both the current
line and the tag root.
Wed Apr 26 00:43:00 2000 Owen Taylor <otaylor@redhat.com>
* gtk/gtktextlayout.c (set_para_values): Fix some bugs in
alignment.
* gtk/gtktextview.c (gtk_text_view_ensure_layout): Track
the widget text directional dynamically.
* gtk/gtktextview.[ch]: Added functions to get and set default
wrap mode.
Tue Apr 25 23:47:38 2000 Owen Taylor <otaylor@redhat.com>
* gtk/gtktextlayout.c (gtk_text_layout_get_iter_location): Fix bug
in cursor location computation.
Tue Apr 25 23:22:59 2000 Owen Taylor <otaylor@redhat.com>
* gtk/gtklayout.c (gtk_layout_set_size): Clamp hadjustment/
vadjusment values properly when layout gets smaller.
* gtk/gtktextview.c (need_repaint_handler): Areas being
passed in are far completely inaccurate, and sometimes
too small, so, for now, just queue a redraw on the
whole visible region.
2000-04-25 Havoc Pennington <hp@redhat.com>
* gtk/gtktextbtree.c (summary_destroy): new function to
destroy tag summary nodes
(gtk_text_line_next_could_contain_tag): this function was
totally broken if the line passed in wasn't below the tag
root. Fix it.
(gtk_text_btree_first_could_contain_tag): In the tag == NULL
"wildcard" case, we have to do a linear scan. Blah.
(gtk_text_btree_last_could_contain_tag): In tag == NULL case,
we have to do the linear scan
(tag_removed_cb): When a tag is removed from the tag table,
remove the GtkTextTagInfo node from the btree.
(gtk_text_btree_spew): Implement the spew function, for
our debugging pleasure.
Tue Apr 25 19:40:18 2000 Owen Taylor <otaylor@redhat.com>
* gtk/gtktextlayout.c (gtk_text_layout_set_buffer): Fix
a problem with referring to the wrong buffer.
* gtk/gtkentry.c: Fix focus-in/focus-out confusion.
* gtk/gtkrc.c gtk/gtkstyle.c: Moving setting default
font description to gtk_style_new() - otherwise things
don't work without a .gtkrc file.
* gtk/gtktextbuffer.c (gtk_text_buffer_new): Sink the
tags table if we create it ourself, too.
* gdk/gdktypes.h (enum): Move GDK_RELEASE_MASK, since
it was conflicting with XKB modifiers.
* gtk/gtktextview.[ch]: Add simple support for
GtkIMContext.
Mon Apr 24 19:34:18 2000 Owen Taylor <otaylor@redhat.com>
* gtk/gtkentry.c (gtk_entry_move_cursor_visually): Fix problem
with deletion from last commit.
Mon Apr 24 19:29:40 2000 Owen Taylor <otaylor@redhat.com>
* gtk/gtkwidget.c (gtk_widget_create_pango_context): Set the language
in the context from the current locale.
* gtk/gtkentry.c (gtk_entry_size_request): Use language from the
context, not hardcoded value.
* gtk/gtkentry.c (gtk_entry_move_cursor): Make character movement visual,
not logical.
Sun Apr 23 23:39:18 2000 Owen Taylor <otaylor@redhat.com>
* gtk/gtkentry.c gtk/gtktextdisplay.c: Don't handle selections as
attributes - that doesn't handle partial-glyph selection
properly. Instead use new pango_layout_line_get_x_ranges()
functionality to draw the selection.
* gtk/gtkentry.c: Simplify code since pango_layout_line_index_to_x()
now properly handles out-of-range coordinates.
* gtk/gtktextbuffer.c: Emit "mark_set" when the cursor is moved.
* gtk/gtktextiter.h gtk/gtktextiterprivate.h: Make gtk_text_iter_get_line_byte()
public.
* gtk/gtktextlayout.[ch]: Properly set the direction in the PangoContext
for paragraphs opposite to the base direction of the widget.
* gtk/gtktextlayout.[ch] gtk/gtktextdisplay.c: Fixes for alignment.
* gtk/gtktextlayout.c: Don't split segments on marks, since that
causes Arabic words to reshape as you cursor through.
* gtk/gtktextlayout.[ch] gtk/gtktextview.[ch]: Implement virtual
cursor position when moving vertically with the arrow keys and
scrolling with page-up/page-down. (Arrow keys save only the X,
scrolling saves both X and Y.)
This means you can line-up / line-down or page-up / page-down
without losing your place, and also that moving vertically
with the cursor keys keeps the same X position, not the same
character count:
* gtk/gtktextlayout.[ch] gtk/gtktextview.[ch]: Make vertical
arrow keys move by display lines, not paragraphs.
Tue Apr 18 14:16:50 2000 Owen Taylor <otaylor@redhat.com>
* gtk/gtklayout.c: Make sure that the bin window is at least
as big as the allocation. (Should we also make sure that the
bin window is big enough to completely cover widget->window?)
* gtk/gtktextview.c (gtk_text_view_get_visible_rect): Add
function to get the onscreen rectangle.
* gdk/x11/gdkwindow-x11.c (gdk_window_get_pointer): Correctly account
for offsets in window coordinates.
Sun Apr 16 16:13:27 2000 Owen Taylor <otaylor@redhat.com>
* gtk/gtkentry.c (gtk_entry_get_cursor_locations): Fix index/offset
confusion.
* gtk/gtktextview.c (gtk_text_view_ensure_layout): Set the default direction
from the widget direction.
* gtk/gtktexttag.c gtk/gtktexttagprivate.h (gtk_text_tag_set_arg):
Add a "direction" attribute.
* gtk/gtktextview.c: global s/tkxt/text_view/.
* gtk/testtext.c: Added long block of text in Arabic, to test out
the direction attributes. (Some problems with the shaping system
for arabic become obvious - like the fact the cursor splits words
into unjoined pieces.)
Fri Apr 14 12:54:34 2000 Owen Taylor <otaylor@redhat.com>
* gtk/gtktextdisplay.c (render_layout): Add overstrike handling.
* gtk/gtktextlayout.c: Fix up alignment.
* gtk/testtext.c: Add some tests for centering, wrapping.
Fri Apr 14 09:26:22 2000 Owen Taylor <otaylor@redhat.com>
* gdk/gdkdrawable.h gdk/gdkdraw.c gdk/gdkwindow.c gdk/x11/gdkdrawable-x11.c:
Add a draw_glyphs() operation to the drawable vtable and gdk_draw_glyphs().
If we wrote GTK+-specific layout-render function this could just replace
the draw_layout() operation in the vtable.
* gtk/gtkentry.c: Move guts of gtk_entry_get_cursor_locations to
pango_layout_get_cursor_pos() and use that function.
* gtk/gtktextchild.[ch]: add gtk_ onto pixmap_segment_new(), since it
is a non-static symbol.
* gtk/gtktextbtree.[ch]: Replace gtk_text_btree_find_line_data_by_y()
with gtk_text_btree_find_line_by_y()
* gtk/gtktextdisplay.c: Rewrote for Pango - uses a custom layout
renderer that handles GtkTextAppearance attributes.
* gtk/gtktexttag.[ch] gtk/gtktexttagprivate.h:
- Move the values in the style that don't affect geometry into a
GtkTextAppearance structure.
- Change underline to take a PangoUnderline and "font" a string
representation of a font description
- Add a "font_desc" attribute which takes a FontDescription structure.
* gtk/gtktextlayout.[ch]:
- Get rid of the display-line list per each line. Instead, we
generate, on demand, a GtkTextLineDisplay structure which]
contains a PangoLayout * and other necesary information
(offsets, cursor locations) for displaying a paragraph.
- Get rid of the code to wrap lines, create display chunks,
etc. Instead, we just go through a paragraph and convert
it into the necessary inputs to a PangoLayout.
- Implement a new attribute type, GtkTextAttrAppearance. This
holds a GtkTextAppearance, and is used to pass colors,
stipple, etc, through from the layout to the display without
having to use lots and lots of individual attributes.
- Reimplement gtk_layout_get_iter_at_pixel() gtk_layout_get_iter_pos()
in terms of PangoLayout functions.
* gtk/gtktextview.c:
- Handle passing the necessary PangoContext to the layout
- Some fixups in painting to deal with the automatic backing store
and offsetting of GTK+-1.4
- Add a style_set handler so that the default style reacts
properly to theme changes.
* gtk/gtktext?*.[ch]: Random code-style fixes.
* gtk/testtext.c: Substitute in languages that Pango handles now for Thai
Mon Apr 10 10:33:45 2000 Owen Taylor <otaylor@redhat.com>
* gtk/gtktext?*.[ch]: Check in Havoc's port of the Tk text widget,
in original form preparatory to Pango-ization and gdkimcontext-ization.
Thu Apr 6 19:25:39 2000 Owen Taylor <otaylor@redhat.com>
* gtk/gtkimcontext.c: Move default implementations to real_* vfuncs,
so that we can derive from gtkimcontext in language bindings properly.
Thu Apr 6 16:02:52 2000 Owen Taylor <otaylor@redhat.com>
* gtk/gtkimcontextsimple.[ch]: Use gdk_keyval_to_unicode to gdk_unicode_to_keyval.
Add a compose table including (almost) all the compose combinations
from X. This is 6k of static, shared data as opposed to 50k or so of dynamic
data in the XIM implementation.
* gdk/gdk.h gdk/gdkkeyuni.c gdk/win32/gdkevents-win32.c (gdk_keyval_to_unicode, gdk_unicode_to_keyval):
Moved functions to convert keyvalues from and to unicode here from
the win32 port and made them public.
Wed Apr 5 16:37:29 2000 Owen Taylor <otaylor@redhat.com>
* gtk/gtkeditable.c (gtk_editable_insert_text): Allow new_text_length == -1.
Wed Apr 5 16:27:45 2000 Owen Taylor <otaylor@redhat.com>
* gtk/gtkimcontext.[ch]: Base class for new input context system
* gtk/gtkimmulticontext.[ch]: Proxy input context that allows
the real input context implementation to be loaded from modules
and switched on the fly.
* gtk/gtkcontextsimple.[ch]: Simple implementation of an input
context that just does direct keysymbol => unicode translation.
* gtk/gtkentry.[ch]: Start switching editing over to using
GtkInputContext. (No handling of preedit yet.)
Wed Apr 5 15:48:41 2000 Owen Taylor <otaylor@redhat.com>
* gtk/gtktypeutils.h (GTK_CHECK_GET_CLASS): Fix problem with one too
many substitutions. (klass should not be subsituted.)
Wed Apr 5 00:18:14 2000 Owen Taylor <otaylor@redhat.com>
* configure.in: Add checks for Pango
* configure.in docs/Makefile.am: Add test for sgml2html
and allow 'make dist' without building html, but print out
warnings in that case. (For making snapshots)
* gdk/Makefile.am gdk/x11/Makefile.am gtk/Makefile.am:
Add Pango libraries and C flags
* gdk/gdkdraw.c gdk/gdkdrawable.h gdkwindow.c gdk/x11/gdkdrawable-x11.c:
Add function (gdk_draw_layout) to draw a pango layout.
* gdk/gdkpango.h gdk/x11/gdkpango-x11.c: New file with functions
for getting Pango contexts for GDK.
* gtk/gtkeditable.c: Get rid of dead code gtk_editable_parent_set()
* gtk/gtkentry.[ch]: Complete rewrite to use Pango, add bidirectional
editing.
* gtk/gtkentry.c: Hack in simple Hebrew input with direct
keysym => unicode translations. More languages can be added
here, but real input-method support is needed.
* docs/Changes-1.4.txt: Added note about entry behavior.
* gtk/gtkenums.h gtk/gtkwidget.[ch] testgtk.c gtkprivate.h: Add functions
to set the reading direction for a widget and the global direction.
Add test which allows toggling the global direction. Two private
flags are used to store the direction. (GTK_DIRECTION_SET + GTK_DIRECTION_LTR)
* gtk/gtkcheckbutton.c gtk/gtkframe.c gtk/gtkhbbox.c gtk/gtkhbox.c
gtk/gtkradiobutton.c gtk/gtkspinbutton.c gtk/gtktable.c
* gtk/gtk[hv]scale.c gtk/gtkscale.[ch]: Draw numbers using Pango
* gtk/gtklabel.[ch]: Moved to Pango and considerably rewritten. Line breaking,
underlining now handled by Pango.
* gtk/gtkstyle.[ch] gtk/gtkrc.[ch]: Add a PangoFontDescription
to RCStyle and Style. (Having both this and the old font name and GdkFont
is temporary.)
* gtk/gtkwidget.[ch] (gtk_widget_create_pango_{context,layout}): Added
convenience functions for creating contexts and layouts for widgets.
* gtk/testgtk.c: Enhance label tests with multilingual labels.
2000-06-02 03:14:07 +00:00
|
|
|
|
PangoLayout *layout;
|
|
|
|
|
PangoRectangle logical_rect;
|
2007-12-28 09:36:06 +00:00
|
|
|
|
gboolean overflow = FALSE;
|
2007-12-28 09:39:34 +00:00
|
|
|
|
gboolean show_details;
|
|
|
|
|
|
1998-09-27 18:32:00 +00:00
|
|
|
|
g_return_if_fail (row < 6);
|
|
|
|
|
g_return_if_fail (col < 7);
|
1998-10-04 23:07:04 +00:00
|
|
|
|
|
2005-05-11 19:16:19 +00:00
|
|
|
|
cr = gdk_cairo_create (priv->main_win);
|
2002-02-14 04:05:13 +00:00
|
|
|
|
|
1998-09-27 18:32:00 +00:00
|
|
|
|
day = calendar->day[row][col];
|
2007-12-28 09:39:34 +00:00
|
|
|
|
show_details = (calendar->display_flags & GTK_CALENDAR_SHOW_DETAILS);
|
2005-05-11 19:16:19 +00:00
|
|
|
|
|
|
|
|
|
calendar_day_rectangle (calendar, row, col, &day_rect);
|
1998-10-01 13:24:42 +00:00
|
|
|
|
|
1998-09-27 18:32:00 +00:00
|
|
|
|
if (calendar->day_month[row][col] == MONTH_PREV)
|
|
|
|
|
{
|
2005-05-11 19:16:19 +00:00
|
|
|
|
text_color = PREV_MONTH_COLOR (widget);
|
1998-09-27 18:32:00 +00:00
|
|
|
|
}
|
|
|
|
|
else if (calendar->day_month[row][col] == MONTH_NEXT)
|
|
|
|
|
{
|
2005-05-11 19:16:19 +00:00
|
|
|
|
text_color = NEXT_MONTH_COLOR (widget);
|
1998-09-27 18:32:00 +00:00
|
|
|
|
}
|
|
|
|
|
else
|
|
|
|
|
{
|
2005-09-13 19:57:42 +00:00
|
|
|
|
#if 0
|
1998-09-27 18:32:00 +00:00
|
|
|
|
if (calendar->highlight_row == row && calendar->highlight_col == col)
|
|
|
|
|
{
|
2005-05-11 19:16:19 +00:00
|
|
|
|
cairo_set_source_color (cr, HIGHLIGHT_BG_COLOR (widget));
|
|
|
|
|
gdk_cairo_rectangle (cr, &day_rect);
|
|
|
|
|
cairo_fill (cr);
|
1998-09-27 18:32:00 +00:00
|
|
|
|
}
|
2005-09-13 19:57:42 +00:00
|
|
|
|
#endif
|
1998-09-27 18:32:00 +00:00
|
|
|
|
if (calendar->selected_day == day)
|
|
|
|
|
{
|
2005-05-11 19:16:19 +00:00
|
|
|
|
gdk_cairo_set_source_color (cr, SELECTED_BG_COLOR (widget));
|
|
|
|
|
gdk_cairo_rectangle (cr, &day_rect);
|
|
|
|
|
cairo_fill (cr);
|
1998-09-27 18:32:00 +00:00
|
|
|
|
}
|
1998-10-05 03:52:48 +00:00
|
|
|
|
if (calendar->selected_day == day)
|
2005-05-11 19:16:19 +00:00
|
|
|
|
text_color = SELECTED_FG_COLOR (widget);
|
|
|
|
|
else if (calendar->marked_date[day-1])
|
|
|
|
|
text_color = MARKED_COLOR (widget);
|
1998-10-05 03:52:48 +00:00
|
|
|
|
else
|
2005-05-11 19:16:19 +00:00
|
|
|
|
text_color = NORMAL_DAY_COLOR (widget);
|
1998-10-05 03:52:48 +00:00
|
|
|
|
}
|
|
|
|
|
|
2006-01-25 16:26:41 +00:00
|
|
|
|
/* Translators: this defines whether the day numbers should use
|
2006-01-25 17:08:51 +00:00
|
|
|
|
* localized digits or the ones used in English (0123...).
|
2006-01-25 16:26:41 +00:00
|
|
|
|
*
|
2006-03-30 22:56:09 +00:00
|
|
|
|
* Translate to "%Id" if you want to use localized digits, or
|
|
|
|
|
* translate to "%d" otherwise. Don't include the "calendar:day:digits|"
|
|
|
|
|
* part in the translation.
|
2006-01-25 16:26:41 +00:00
|
|
|
|
*
|
|
|
|
|
* Note that translating this doesn't guarantee that you get localized
|
|
|
|
|
* digits. That needs support from your system and locale definition
|
|
|
|
|
* too.
|
|
|
|
|
*/
|
2006-01-25 16:42:37 +00:00
|
|
|
|
g_snprintf (buffer, sizeof (buffer), Q_("calendar:day:digits|%d"), day);
|
2007-12-28 09:26:20 +00:00
|
|
|
|
|
|
|
|
|
/* Get extra information to show, if any: */
|
|
|
|
|
|
|
|
|
|
if (priv->detail_func)
|
|
|
|
|
detail = gtk_calendar_get_detail (calendar, row, col);
|
|
|
|
|
else
|
|
|
|
|
detail = NULL;
|
|
|
|
|
|
2000-07-02 22:30:54 +00:00
|
|
|
|
layout = gtk_widget_create_pango_layout (widget, buffer);
|
2007-12-28 09:26:20 +00:00
|
|
|
|
pango_layout_set_alignment (layout, PANGO_ALIGN_CENTER);
|
2000-07-02 21:32:56 +00:00
|
|
|
|
pango_layout_get_pixel_extents (layout, NULL, &logical_rect);
|
Remove all references to offscreen flag which was no longer used.
Thu Jun 1 23:05:13 2000 Owen Taylor <otaylor@redhat.com>
* gtk/gtkwidget.c: Remove all references to
offscreen flag which was no longer used.
* gtk/gtkprivate.h (enum): Remove unused flags and compress.
* gtk/gtkframe.c (gtk_frame_set_label_widget): Check
for non-null label_widget->parent.
* gtk/gtkentry.c: Get rid of code to deal with PangoAttribute
which no longer was used.
* gdk/gdkpango.c (gdk_pango_context_get_info): make static.
* gdk/gdkpango.c (gdk_draw_layout[_line]): Add checks
for null arguments.
* gdk/x11/gdkgeometry-x11.c (gdk_window_scroll): add
check for destroyed windows.
Thu Jun 1 13:48:45 2000 Owen Taylor <otaylor@redhat.com>
* gtk/gtkimmulticontext.c: Add a finalize method and unref
the slave context there.
* gtk/gtkinvisible.[ch]: Make reference counting behavior
identical to GtkWindow.
Thu Jun 1 01:54:11 2000 Owen Taylor <otaylor@redhat.com>
* Makefile.am gdk/gdkpango.c: Copy the layout render function from
pangox to here, so we can write them independent of rendering
system, using GDK primitives.
* gdk/gdkdrawable.h gdk/gdkdraw.c gdk/gdkwindow.c
gdk/x11/gdkdrawable-x11.c: Remove draw_layout() from the vtable,
since we have a rendering-system independent implementation in
terms of draw_glyphs().
* gdk/gdkpango.c gdkdrawable.h (gdk_draw_layout_line): New
function to render a single line.
* gdk/x11/gdkpango.c: Move the guts of this file mostly
into ../gdkpango.c, which simplifies things, since we
don't have to deal with raw X gc's.
Fri May 19 04:28:16 2000 Owen Taylor <otaylor@redhat.com>
* gtk/gtktextlayout.[ch]: Add get_log_attrs() function to
get the logical attributes for a given GtkTextLine.
Tue May 30 16:05:39 2000 Owen Taylor <otaylor@redhat.com>
* gdk/x11/gdkfont-x11.c (gdk_font_charset_for_locale): Track
g_locale_get_codeset() to g_get_codeset() change.
Tue May 30 15:03:19 2000 Owen Taylor <otaylor@redhat.com>
* gtk/testcalendar.c (calendar_font_selection_ok): Use font
descriptions.
* gtk/gtkentry.c (gtk_entry_draw_text): Center text within
the entry.
* gtk/gtkfontsel.c (gtk_font_selection_dialog_init): Start of
redoing (vastly simplifying) for Pango. Still needs quite
a bit of work. (Size selection is currently poor. List of
predefined sizes is not a good idea, since all of these
sizes won't necessarily be distinct.)
Tue May 30 13:50:19 2000 Owen Taylor <otaylor@redhat.com>
* gdk/x11/gdkfont-x11.c (gdk_font_charset_for_locale): Handle
CODESET results for LANG=C.
Mon May 29 15:49:10 2000 Owen Taylor <otaylor@redhat.com>
* gtk/gtkrc.[ch]: Add a 'font_name' declaration to RC
which takes a stringized pango font description;
ignore the older 'font' and 'fontset' declarations.
* gtk/gtkstyle.c gtk/gtkrc.c: Fill in the style->font
field with a GdkFont derived via gdk_font_from_description(),
for compatibility. (Should we just remove it entirely?
Probably too much compatibility breakage, but people
should be migrating to the new Pango stuff as quickly
as possible.)
Mon May 29 15:47:41 2000 Owen Taylor <otaylor@redhat.com>
* gtk/gtkentry.c gtk/gtkclist.c: s/pango_font_unref/g_object_unref/.
Mon May 29 15:44:46 2000 Owen Taylor <otaylor@redhat.com>
* gtk/gtkcalender.c: Roughly pango-ized. Really needs
redoing; there are some bugs in size allocation right
now, the semi-existant distinction between header / day
fonts was removed, but, with Pango, could actually
be made functional in a nice way.
* gtk/testcalender: Move calender from examples into this
directory as a test program. (We really need to restrcture
testgtk into a whole directory full of tests for every
widget or functionality group, separated into multiple .c
files.)
Mon May 29 15:19:56 2000 Owen Taylor <otaylor@redhat.com>
* gtk/testgtk.c (file_exists): Fix stupid typo that
was keeping RC file from being loaded.
* gtk/testgtkrc gtk/testgtkrc2: Test new pango-ized
RC file font code.
Mon May 29 14:31:27 2000 Owen Taylor <otaylor@redhat.com>
* gdk/gdkfont.h gdk/x11/gdkfont-x11.c (gdk_font_from_description):
Add function to load a GdkFont from a PangoFontDescription.
Fri May 26 17:16:40 2000 Owen Taylor <otaylor@redhat.com>
* gtk/frame.[ch] gtkaspectframe.c: Make frame widgets able
to have any widget for the label, use a GtkLabel widget
to display the text. (Based partially on a patch from
Anders Carlson.)
(Quite a bit of code reorganization - strip 90% of the
guts out of gtkaspectframe and add a single virtual
func to GtkFrameClass - compute_child_allocation.)
Fri May 26 12:00:02 2000 Owen Taylor <otaylor@redhat.com>
* gtk/gtkctree.c gtk/gtkclist.[ch]: Pangoized.
(Removed clist->row_center_offset field because caching
it wasn't saving time or code, added private function
_gtk_clist_create_cell_layout()).
Wed May 24 15:59:37 2000 Owen Taylor <otaylor@redhat.com>
* gtk/gtkaccellabel.c: Pangoized.
* gtk/[hv]ruler.c: Pangoized
Mon May 22 19:23:59 2000 Owen Taylor <otaylor@redhat.com>
* gtk/gtkfilesel.c (gtk_file_selection_init):
Use gtk_clist_set_column_auto_resize() to remove need
need for manual column width computations.
Mon May 22 18:50:26 2000 Owen Taylor <otaylor@redhat.com>
* gtk/gtktooltips.[ch]: Replace custom drawing with a GtkLabel,
ensuring Pango correctness, and considerably simplifying the
code.
* gtk/gtklabel.c gtk[hv]scale.c: 1000 => PANGO_SCALE.
* gtk/gtklabel.c (gtk_label_size_request): Fixed incorrect
getting of numbers of lines.
* gtk/gtklabel.c (gtk_label_size_request): Set the requisition
to the actual requested width of the lable, not to the wrap
width we set.
* gtk/gtktextchild.h: Remove extraneous include of gtk/gtk.h.
* gtk/gtktextbtree.c gtk/gtktextbuffer.c gtk/gtktextlayout.c
gtk/gtktextview.c gtk/gtktextview.[ch]: Fix up includes.
* gtk/gtktextview.c: Fix structure inheritance.
* gtk/gtkprogressbar.c: Pangoize.
Mon May 22 15:47:30 2000 Owen Taylor <otaylor@redhat.com>
* gtk/gtktextview.c (gtk_text_view_get_first_para_iter): Encapsulate
in a function.
* gtk/gtktextlayout.c (find_display_line_above): Fixed
bug with computing line tops.
* gtk/gtktextview.c (changed_handler): Fix < , <= confusion.
Thu May 18 18:53:31 2000 Owen Taylor <otaylor@redhat.com>
* gtk/gtktextdisplay.c (gtk_text_layout_draw): Fix up the x_offset
and y_offset coordinates to do what we need now. (The offset between
buffer and layout coordinates has been reintroduced, but is a
bit different than before.)
* gtk/gtktextview.[ch]: No longer inherit from GtkLayout; instead
handle the adjustments ourselves, and scroll as necessary using
the new gdk_window_scroll().
The advantage of this is that when we are incrementally revalidating,
we are essentially rearranging things around the visible portion
of the screen. With the old setup, the visible portion of the
screen was moved around in the layout, so scrolling and redrawing
to track that caused jumping of the display. Since we now
control the scrolling ourselves, we can suppress this and
only redraw when things actually change.
Thu May 18 18:47:25 2000 Owen Taylor <otaylor@redhat.com>
* gtk/gtktextbtree.c (redisplay_mark): We need to invalidate
the region not just redisplay it after-all, since we store the
cursors in the LineDisplay. (Ugly interactions here between
GtkLayout and GtkTextBTree here.)
* gtk/gtktextbtree.c (redisplay_region): Fixed reversed comparison.
Thu May 18 18:43:21 2000 Owen Taylor <otaylor@redhat.com>
* gdk/gdkwindow.h gdk/x11/gdkgeometry-x11.c (gdk_window_scroll):
Added function to scroll contents of a window while keeping the
window constant. Works by XCopyArea or guffaw-scrolling depending
on the details of how the window is set up. (guffaw-scrolling
still needs to be filled in.)
Wed May 17 22:36:53 2000 Owen Taylor <otaylor@redhat.com>
* gtk/gtktextiter.c gtk/gtkmain.c: Add a debug key for the text widget,
move the debugging that was tied to a global variable
to that.
* gtk/gtkmarshal.list: Add NONE:INT,INT,INT
* gtk/gtktextbtree.[ch] gtk/gtktextlayout.c: Keep a separate
validated flag, in line data instead of setting height/width to
-1. This allows us to perform operations with partially invalid
buffer (using the old size for invalid lines) and thus to do
incremental vaidation. Keep height/width aggregates up to date
when deleting text and rebalancing the tree.
* gtk/gtktextbtree.[ch]: Add functions validate a line
(gtk_text_btree_validate_line), and to validate up
to a number of pixels (gtk_text_btree_validate).
* gtk/gtktextlayout.[ch]: Add an ::invalidated signal
that indicates that something is changed and a revalidation
pass is needed. Change ::need_repaint to ::changed, and
make it take old and new yranges instead of a rectangle.
* gtk/gtktextbtree.[ch] gtk/gtktextlayout.[ch]: Move
the line_data_destroy() function from
gtk_text_btree_add_view() to a virtual function in
GtkTextLayout
* gtk/gtktextbtree.[ch]: Remove gtk_text_btree_get_damage_range(),
since we are handling partial repaints in a different fashion
now.
* gtk/gtktextbtree.[ch]: Only repaint the changed portion
of the selection instead of queueing a repaint on the
entire widget.
* gtk/gtktextbuffer.[ch] gtk/gtktextbtree.[ch]: Move
get_selection_bounds() down to btree, make the function
in buffer a wrapper around the btree function.
* gtk/gtktextlayout.[ch]: Add functions to check if the
layout is valid and to recompute either a range of pixels
aroudn a line or a certain total number of pixels.
* gtk/gtktextlayout.[ch]: Cache a single line display;
now that we only redraw the needed portions, the hit rate
for this cache is quite high.
* gtk/gtktextview.[ch]: Keep track of the first paragraph
on the screen so that when re-laying-out the buffer, we can
keep the same place. This requires connecting to ::value_changed
on the adjustments
* gtk/gtktextview.[ch]: Add idle functions to revalidate
the buffer after we receive an ::invalidated signal.
Wed May 17 22:10:47 2000 Owen Taylor <otaylor@redhat.com>
* gtk/gtklayout.c (gtk_layout_size_allocate): Set upper
to max of allocation and layout size, not just to the
layout size.
* gtk/gtk[hv]scrollbar.c (gtk_[hv]scrollbar_calc_slider_size):
Invalidate window so it gets redrawn properly.
* gdk/gdkwindow.c (gdk_window_invalidate_rect): Allow rect == NULL
to mean the entire window.
* gdk/gdkevents.h: Move definition for GDK_PRIORITY_REDRAW
into public header.
Mon May 15 14:51:31 2000 Owen Taylor <otaylor@redhat.com>
* gtk/gtktextmark.c (gtk_text_mark_get_name): Add function
to get the name of a mark.
* gtk/gtktextlayout.c (gtk_text_layout_get_line_at_y): Add a function
to find the paragraph from a y position.
Thu May 11 12:57:20 2000 Owen Taylor <otaylor@redhat.com>
* gtk/gtktextbtree.c (gtk_text_btree_node_invalidate_upward): Valid
nodes have width/height >= 0, not > 0.
Tue May 9 21:29:06 2000 Owen Taylor <otaylor@redhat.com>
* gtk/gtktextlayout.[ch] gtk/gtktextdisplay.c (gtk_text_layout_get_line_display):
Add a size_only flag, so when we only need the size, we don't create
useless appearance attributes.
* gtk/gtktextview.c (gtk_text_view_ensure_layout): Remove
duplicate setting of font description.
* gtk/gtkscale.c: Use PANGO_SCALE instead of 1000
Wed Apr 26 01:53:23 2000 Owen Taylor <otaylor@redhat.com>
* gtk/Makefile.am (EXTRA_DIST): Add OLD_STAMP into
EXTRA_DIST. It does not work well when the file that
everything depends on is not in the tarball.
Wed Apr 26 00:56:14 2000 Owen Taylor <otaylor@redhat.com>
* gtk/testgtk.c: Some hacks and fixes so that it basically
works when not sitting in the GTK+ build tree.
2000-05-03 Havoc Pennington <hp@redhat.com>
* gtk/gtktextbtree.c (gtk_text_line_next_could_contain_tag):
Properly determine the ordering of the tag root and the current
line within the tree. Previous algorithm only worked if the tag
root's immediate parent was the common root of both the current
line and the tag root.
Wed Apr 26 00:43:00 2000 Owen Taylor <otaylor@redhat.com>
* gtk/gtktextlayout.c (set_para_values): Fix some bugs in
alignment.
* gtk/gtktextview.c (gtk_text_view_ensure_layout): Track
the widget text directional dynamically.
* gtk/gtktextview.[ch]: Added functions to get and set default
wrap mode.
Tue Apr 25 23:47:38 2000 Owen Taylor <otaylor@redhat.com>
* gtk/gtktextlayout.c (gtk_text_layout_get_iter_location): Fix bug
in cursor location computation.
Tue Apr 25 23:22:59 2000 Owen Taylor <otaylor@redhat.com>
* gtk/gtklayout.c (gtk_layout_set_size): Clamp hadjustment/
vadjusment values properly when layout gets smaller.
* gtk/gtktextview.c (need_repaint_handler): Areas being
passed in are far completely inaccurate, and sometimes
too small, so, for now, just queue a redraw on the
whole visible region.
2000-04-25 Havoc Pennington <hp@redhat.com>
* gtk/gtktextbtree.c (summary_destroy): new function to
destroy tag summary nodes
(gtk_text_line_next_could_contain_tag): this function was
totally broken if the line passed in wasn't below the tag
root. Fix it.
(gtk_text_btree_first_could_contain_tag): In the tag == NULL
"wildcard" case, we have to do a linear scan. Blah.
(gtk_text_btree_last_could_contain_tag): In tag == NULL case,
we have to do the linear scan
(tag_removed_cb): When a tag is removed from the tag table,
remove the GtkTextTagInfo node from the btree.
(gtk_text_btree_spew): Implement the spew function, for
our debugging pleasure.
Tue Apr 25 19:40:18 2000 Owen Taylor <otaylor@redhat.com>
* gtk/gtktextlayout.c (gtk_text_layout_set_buffer): Fix
a problem with referring to the wrong buffer.
* gtk/gtkentry.c: Fix focus-in/focus-out confusion.
* gtk/gtkrc.c gtk/gtkstyle.c: Moving setting default
font description to gtk_style_new() - otherwise things
don't work without a .gtkrc file.
* gtk/gtktextbuffer.c (gtk_text_buffer_new): Sink the
tags table if we create it ourself, too.
* gdk/gdktypes.h (enum): Move GDK_RELEASE_MASK, since
it was conflicting with XKB modifiers.
* gtk/gtktextview.[ch]: Add simple support for
GtkIMContext.
Mon Apr 24 19:34:18 2000 Owen Taylor <otaylor@redhat.com>
* gtk/gtkentry.c (gtk_entry_move_cursor_visually): Fix problem
with deletion from last commit.
Mon Apr 24 19:29:40 2000 Owen Taylor <otaylor@redhat.com>
* gtk/gtkwidget.c (gtk_widget_create_pango_context): Set the language
in the context from the current locale.
* gtk/gtkentry.c (gtk_entry_size_request): Use language from the
context, not hardcoded value.
* gtk/gtkentry.c (gtk_entry_move_cursor): Make character movement visual,
not logical.
Sun Apr 23 23:39:18 2000 Owen Taylor <otaylor@redhat.com>
* gtk/gtkentry.c gtk/gtktextdisplay.c: Don't handle selections as
attributes - that doesn't handle partial-glyph selection
properly. Instead use new pango_layout_line_get_x_ranges()
functionality to draw the selection.
* gtk/gtkentry.c: Simplify code since pango_layout_line_index_to_x()
now properly handles out-of-range coordinates.
* gtk/gtktextbuffer.c: Emit "mark_set" when the cursor is moved.
* gtk/gtktextiter.h gtk/gtktextiterprivate.h: Make gtk_text_iter_get_line_byte()
public.
* gtk/gtktextlayout.[ch]: Properly set the direction in the PangoContext
for paragraphs opposite to the base direction of the widget.
* gtk/gtktextlayout.[ch] gtk/gtktextdisplay.c: Fixes for alignment.
* gtk/gtktextlayout.c: Don't split segments on marks, since that
causes Arabic words to reshape as you cursor through.
* gtk/gtktextlayout.[ch] gtk/gtktextview.[ch]: Implement virtual
cursor position when moving vertically with the arrow keys and
scrolling with page-up/page-down. (Arrow keys save only the X,
scrolling saves both X and Y.)
This means you can line-up / line-down or page-up / page-down
without losing your place, and also that moving vertically
with the cursor keys keeps the same X position, not the same
character count:
* gtk/gtktextlayout.[ch] gtk/gtktextview.[ch]: Make vertical
arrow keys move by display lines, not paragraphs.
Tue Apr 18 14:16:50 2000 Owen Taylor <otaylor@redhat.com>
* gtk/gtklayout.c: Make sure that the bin window is at least
as big as the allocation. (Should we also make sure that the
bin window is big enough to completely cover widget->window?)
* gtk/gtktextview.c (gtk_text_view_get_visible_rect): Add
function to get the onscreen rectangle.
* gdk/x11/gdkwindow-x11.c (gdk_window_get_pointer): Correctly account
for offsets in window coordinates.
Sun Apr 16 16:13:27 2000 Owen Taylor <otaylor@redhat.com>
* gtk/gtkentry.c (gtk_entry_get_cursor_locations): Fix index/offset
confusion.
* gtk/gtktextview.c (gtk_text_view_ensure_layout): Set the default direction
from the widget direction.
* gtk/gtktexttag.c gtk/gtktexttagprivate.h (gtk_text_tag_set_arg):
Add a "direction" attribute.
* gtk/gtktextview.c: global s/tkxt/text_view/.
* gtk/testtext.c: Added long block of text in Arabic, to test out
the direction attributes. (Some problems with the shaping system
for arabic become obvious - like the fact the cursor splits words
into unjoined pieces.)
Fri Apr 14 12:54:34 2000 Owen Taylor <otaylor@redhat.com>
* gtk/gtktextdisplay.c (render_layout): Add overstrike handling.
* gtk/gtktextlayout.c: Fix up alignment.
* gtk/testtext.c: Add some tests for centering, wrapping.
Fri Apr 14 09:26:22 2000 Owen Taylor <otaylor@redhat.com>
* gdk/gdkdrawable.h gdk/gdkdraw.c gdk/gdkwindow.c gdk/x11/gdkdrawable-x11.c:
Add a draw_glyphs() operation to the drawable vtable and gdk_draw_glyphs().
If we wrote GTK+-specific layout-render function this could just replace
the draw_layout() operation in the vtable.
* gtk/gtkentry.c: Move guts of gtk_entry_get_cursor_locations to
pango_layout_get_cursor_pos() and use that function.
* gtk/gtktextchild.[ch]: add gtk_ onto pixmap_segment_new(), since it
is a non-static symbol.
* gtk/gtktextbtree.[ch]: Replace gtk_text_btree_find_line_data_by_y()
with gtk_text_btree_find_line_by_y()
* gtk/gtktextdisplay.c: Rewrote for Pango - uses a custom layout
renderer that handles GtkTextAppearance attributes.
* gtk/gtktexttag.[ch] gtk/gtktexttagprivate.h:
- Move the values in the style that don't affect geometry into a
GtkTextAppearance structure.
- Change underline to take a PangoUnderline and "font" a string
representation of a font description
- Add a "font_desc" attribute which takes a FontDescription structure.
* gtk/gtktextlayout.[ch]:
- Get rid of the display-line list per each line. Instead, we
generate, on demand, a GtkTextLineDisplay structure which]
contains a PangoLayout * and other necesary information
(offsets, cursor locations) for displaying a paragraph.
- Get rid of the code to wrap lines, create display chunks,
etc. Instead, we just go through a paragraph and convert
it into the necessary inputs to a PangoLayout.
- Implement a new attribute type, GtkTextAttrAppearance. This
holds a GtkTextAppearance, and is used to pass colors,
stipple, etc, through from the layout to the display without
having to use lots and lots of individual attributes.
- Reimplement gtk_layout_get_iter_at_pixel() gtk_layout_get_iter_pos()
in terms of PangoLayout functions.
* gtk/gtktextview.c:
- Handle passing the necessary PangoContext to the layout
- Some fixups in painting to deal with the automatic backing store
and offsetting of GTK+-1.4
- Add a style_set handler so that the default style reacts
properly to theme changes.
* gtk/gtktext?*.[ch]: Random code-style fixes.
* gtk/testtext.c: Substitute in languages that Pango handles now for Thai
Mon Apr 10 10:33:45 2000 Owen Taylor <otaylor@redhat.com>
* gtk/gtktext?*.[ch]: Check in Havoc's port of the Tk text widget,
in original form preparatory to Pango-ization and gdkimcontext-ization.
Thu Apr 6 19:25:39 2000 Owen Taylor <otaylor@redhat.com>
* gtk/gtkimcontext.c: Move default implementations to real_* vfuncs,
so that we can derive from gtkimcontext in language bindings properly.
Thu Apr 6 16:02:52 2000 Owen Taylor <otaylor@redhat.com>
* gtk/gtkimcontextsimple.[ch]: Use gdk_keyval_to_unicode to gdk_unicode_to_keyval.
Add a compose table including (almost) all the compose combinations
from X. This is 6k of static, shared data as opposed to 50k or so of dynamic
data in the XIM implementation.
* gdk/gdk.h gdk/gdkkeyuni.c gdk/win32/gdkevents-win32.c (gdk_keyval_to_unicode, gdk_unicode_to_keyval):
Moved functions to convert keyvalues from and to unicode here from
the win32 port and made them public.
Wed Apr 5 16:37:29 2000 Owen Taylor <otaylor@redhat.com>
* gtk/gtkeditable.c (gtk_editable_insert_text): Allow new_text_length == -1.
Wed Apr 5 16:27:45 2000 Owen Taylor <otaylor@redhat.com>
* gtk/gtkimcontext.[ch]: Base class for new input context system
* gtk/gtkimmulticontext.[ch]: Proxy input context that allows
the real input context implementation to be loaded from modules
and switched on the fly.
* gtk/gtkcontextsimple.[ch]: Simple implementation of an input
context that just does direct keysymbol => unicode translation.
* gtk/gtkentry.[ch]: Start switching editing over to using
GtkInputContext. (No handling of preedit yet.)
Wed Apr 5 15:48:41 2000 Owen Taylor <otaylor@redhat.com>
* gtk/gtktypeutils.h (GTK_CHECK_GET_CLASS): Fix problem with one too
many substitutions. (klass should not be subsituted.)
Wed Apr 5 00:18:14 2000 Owen Taylor <otaylor@redhat.com>
* configure.in: Add checks for Pango
* configure.in docs/Makefile.am: Add test for sgml2html
and allow 'make dist' without building html, but print out
warnings in that case. (For making snapshots)
* gdk/Makefile.am gdk/x11/Makefile.am gtk/Makefile.am:
Add Pango libraries and C flags
* gdk/gdkdraw.c gdk/gdkdrawable.h gdkwindow.c gdk/x11/gdkdrawable-x11.c:
Add function (gdk_draw_layout) to draw a pango layout.
* gdk/gdkpango.h gdk/x11/gdkpango-x11.c: New file with functions
for getting Pango contexts for GDK.
* gtk/gtkeditable.c: Get rid of dead code gtk_editable_parent_set()
* gtk/gtkentry.[ch]: Complete rewrite to use Pango, add bidirectional
editing.
* gtk/gtkentry.c: Hack in simple Hebrew input with direct
keysym => unicode translations. More languages can be added
here, but real input-method support is needed.
* docs/Changes-1.4.txt: Added note about entry behavior.
* gtk/gtkenums.h gtk/gtkwidget.[ch] testgtk.c gtkprivate.h: Add functions
to set the reading direction for a widget and the global direction.
Add test which allows toggling the global direction. Two private
flags are used to store the direction. (GTK_DIRECTION_SET + GTK_DIRECTION_LTR)
* gtk/gtkcheckbutton.c gtk/gtkframe.c gtk/gtkhbbox.c gtk/gtkhbox.c
gtk/gtkradiobutton.c gtk/gtkspinbutton.c gtk/gtktable.c
* gtk/gtk[hv]scale.c gtk/gtkscale.[ch]: Draw numbers using Pango
* gtk/gtklabel.[ch]: Moved to Pango and considerably rewritten. Line breaking,
underlining now handled by Pango.
* gtk/gtkstyle.[ch] gtk/gtkrc.[ch]: Add a PangoFontDescription
to RCStyle and Style. (Having both this and the old font name and GdkFont
is temporary.)
* gtk/gtkwidget.[ch] (gtk_widget_create_pango_{context,layout}): Added
convenience functions for creating contexts and layouts for widgets.
* gtk/testgtk.c: Enhance label tests with multilingual labels.
2000-06-02 03:14:07 +00:00
|
|
|
|
|
2007-12-28 09:26:20 +00:00
|
|
|
|
x_loc = day_rect.x + (day_rect.width - logical_rect.width) / 2;
|
|
|
|
|
y_loc = day_rect.y;
|
2007-12-28 09:39:34 +00:00
|
|
|
|
|
2005-05-11 19:16:19 +00:00
|
|
|
|
gdk_cairo_set_source_color (cr, text_color);
|
|
|
|
|
cairo_move_to (cr, x_loc, y_loc);
|
|
|
|
|
pango_cairo_show_layout (cr, layout);
|
2007-12-28 09:39:34 +00:00
|
|
|
|
|
|
|
|
|
if (calendar->day_month[row][col] == MONTH_CURRENT &&
|
|
|
|
|
(calendar->marked_date[day-1] || (detail && !show_details)))
|
2005-05-11 19:16:19 +00:00
|
|
|
|
{
|
|
|
|
|
cairo_move_to (cr, x_loc - 1, y_loc);
|
|
|
|
|
pango_cairo_show_layout (cr, layout);
|
|
|
|
|
}
|
1998-10-05 03:52:48 +00:00
|
|
|
|
|
2007-12-28 09:26:20 +00:00
|
|
|
|
y_loc += priv->max_day_char_descent;
|
|
|
|
|
|
2007-12-28 09:39:34 +00:00
|
|
|
|
if (priv->detail_func && show_details)
|
2007-12-28 09:26:20 +00:00
|
|
|
|
{
|
2007-12-28 09:36:57 +00:00
|
|
|
|
cairo_save (cr);
|
|
|
|
|
|
|
|
|
|
if (calendar->selected_day == day)
|
|
|
|
|
gdk_cairo_set_source_color (cr, &widget->style->text[GTK_STATE_ACTIVE]);
|
|
|
|
|
else if (calendar->day_month[row][col] == MONTH_CURRENT)
|
|
|
|
|
gdk_cairo_set_source_color (cr, &widget->style->base[GTK_STATE_ACTIVE]);
|
|
|
|
|
else
|
|
|
|
|
gdk_cairo_set_source_color (cr, &widget->style->base[GTK_STATE_INSENSITIVE]);
|
|
|
|
|
|
2007-12-28 09:26:20 +00:00
|
|
|
|
cairo_set_line_width (cr, 1);
|
2007-12-28 09:36:57 +00:00
|
|
|
|
cairo_move_to (cr, day_rect.x + 2, y_loc + 0.5);
|
|
|
|
|
cairo_line_to (cr, day_rect.x + day_rect.width - 2, y_loc + 0.5);
|
2007-12-28 09:26:20 +00:00
|
|
|
|
cairo_stroke (cr);
|
|
|
|
|
|
2007-12-28 09:36:57 +00:00
|
|
|
|
cairo_restore (cr);
|
|
|
|
|
|
2007-12-28 09:26:20 +00:00
|
|
|
|
y_loc += 2;
|
|
|
|
|
}
|
|
|
|
|
|
2007-12-28 09:39:34 +00:00
|
|
|
|
if (detail && show_details)
|
2007-12-28 09:26:20 +00:00
|
|
|
|
{
|
|
|
|
|
gchar *markup = g_strconcat ("<small>", detail, "</small>", NULL);
|
|
|
|
|
pango_layout_set_markup (layout, markup, -1);
|
|
|
|
|
g_free (markup);
|
|
|
|
|
|
|
|
|
|
if (day == calendar->selected_day)
|
|
|
|
|
{
|
|
|
|
|
/* Stripping colors as they conflict with selection marking. */
|
|
|
|
|
|
|
|
|
|
PangoAttrList *attrs = pango_layout_get_attributes (layout);
|
|
|
|
|
PangoAttrList *colors = NULL;
|
|
|
|
|
|
|
|
|
|
if (attrs)
|
|
|
|
|
colors = pango_attr_list_filter (attrs, is_color_attribute, NULL);
|
|
|
|
|
if (colors)
|
|
|
|
|
pango_attr_list_unref (colors);
|
|
|
|
|
}
|
|
|
|
|
|
2008-01-22 15:03:03 +00:00
|
|
|
|
pango_layout_set_wrap (layout, PANGO_WRAP_WORD_CHAR);
|
|
|
|
|
pango_layout_set_width (layout, PANGO_SCALE * day_rect.width);
|
2007-12-28 09:26:20 +00:00
|
|
|
|
|
2008-01-22 15:03:03 +00:00
|
|
|
|
if (priv->detail_height_rows)
|
2007-12-28 09:36:06 +00:00
|
|
|
|
{
|
2008-01-22 15:03:03 +00:00
|
|
|
|
gint dy = day_rect.height - (y_loc - day_rect.y);
|
|
|
|
|
pango_layout_set_height (layout, PANGO_SCALE * dy);
|
|
|
|
|
pango_layout_set_ellipsize (layout, PANGO_ELLIPSIZE_END);
|
2007-12-28 09:36:06 +00:00
|
|
|
|
}
|
2007-12-28 09:26:20 +00:00
|
|
|
|
|
2008-01-22 15:03:03 +00:00
|
|
|
|
cairo_move_to (cr, day_rect.x, y_loc);
|
|
|
|
|
pango_cairo_show_layout (cr, layout);
|
2007-12-28 09:26:20 +00:00
|
|
|
|
}
|
|
|
|
|
|
1998-10-05 03:52:48 +00:00
|
|
|
|
if (GTK_WIDGET_HAS_FOCUS (calendar)
|
|
|
|
|
&& calendar->focus_row == row && calendar->focus_col == col)
|
|
|
|
|
{
|
2002-03-21 00:50:15 +00:00
|
|
|
|
GtkStateType state;
|
|
|
|
|
|
|
|
|
|
if (calendar->selected_day == day)
|
|
|
|
|
state = GTK_WIDGET_HAS_FOCUS (widget) ? GTK_STATE_SELECTED : GTK_STATE_ACTIVE;
|
|
|
|
|
else
|
|
|
|
|
state = GTK_STATE_NORMAL;
|
|
|
|
|
|
2002-02-14 04:05:13 +00:00
|
|
|
|
gtk_paint_focus (widget->style,
|
2005-05-11 19:16:19 +00:00
|
|
|
|
priv->main_win,
|
2005-09-09 17:26:14 +00:00
|
|
|
|
state,
|
2002-02-14 04:05:13 +00:00
|
|
|
|
NULL, widget, "calendar-day",
|
2005-05-11 19:16:19 +00:00
|
|
|
|
day_rect.x, day_rect.y,
|
|
|
|
|
day_rect.width, day_rect.height);
|
1998-10-05 03:52:48 +00:00
|
|
|
|
}
|
|
|
|
|
|
2007-12-28 09:36:06 +00:00
|
|
|
|
if (overflow)
|
|
|
|
|
priv->detail_overflow[row] |= (1 << col);
|
|
|
|
|
else
|
|
|
|
|
priv->detail_overflow[row] &= ~(1 << col);
|
|
|
|
|
|
2002-10-09 22:11:08 +00:00
|
|
|
|
g_object_unref (layout);
|
2005-05-11 19:16:19 +00:00
|
|
|
|
cairo_destroy (cr);
|
2008-01-17 16:42:04 +00:00
|
|
|
|
g_free (detail);
|
1998-09-27 18:32:00 +00:00
|
|
|
|
}
|
|
|
|
|
|
1998-10-01 13:24:42 +00:00
|
|
|
|
static void
|
2005-05-11 19:16:19 +00:00
|
|
|
|
calendar_paint_main (GtkCalendar *calendar)
|
1998-09-27 18:32:00 +00:00
|
|
|
|
{
|
|
|
|
|
gint row, col;
|
1998-10-01 13:24:42 +00:00
|
|
|
|
|
1998-09-27 18:32:00 +00:00
|
|
|
|
for (col = 0; col < 7; col++)
|
|
|
|
|
for (row = 0; row < 6; row++)
|
2005-05-11 19:16:19 +00:00
|
|
|
|
calendar_paint_day (calendar, row, col);
|
1998-09-27 18:32:00 +00:00
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
static void
|
2005-05-11 19:16:19 +00:00
|
|
|
|
calendar_invalidate_arrow (GtkCalendar *calendar,
|
|
|
|
|
guint arrow)
|
1998-09-27 18:32:00 +00:00
|
|
|
|
{
|
2005-05-11 19:16:19 +00:00
|
|
|
|
GtkCalendarPrivate *priv = GTK_CALENDAR_GET_PRIVATE (calendar);
|
|
|
|
|
GdkWindow *window;
|
1998-10-01 13:24:42 +00:00
|
|
|
|
|
2005-05-11 19:16:19 +00:00
|
|
|
|
window = priv->arrow_win[arrow];
|
|
|
|
|
if (window)
|
|
|
|
|
gdk_window_invalidate_rect (window, NULL, FALSE);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
static void
|
|
|
|
|
calendar_paint_arrow (GtkCalendar *calendar,
|
|
|
|
|
guint arrow)
|
|
|
|
|
{
|
|
|
|
|
GtkWidget *widget = GTK_WIDGET (calendar);
|
|
|
|
|
GtkCalendarPrivate *priv = GTK_CALENDAR_GET_PRIVATE (widget);
|
|
|
|
|
GdkWindow *window;
|
1998-10-01 13:24:42 +00:00
|
|
|
|
|
2005-05-11 19:16:19 +00:00
|
|
|
|
window = priv->arrow_win[arrow];
|
|
|
|
|
if (window)
|
1998-09-27 18:32:00 +00:00
|
|
|
|
{
|
2005-05-11 19:16:19 +00:00
|
|
|
|
cairo_t *cr = gdk_cairo_create (window);
|
|
|
|
|
gint width, height;
|
|
|
|
|
gint state;
|
|
|
|
|
|
|
|
|
|
state = priv->arrow_state[arrow];
|
|
|
|
|
|
|
|
|
|
gdk_cairo_set_source_color (cr, &widget->style->bg[state]);
|
|
|
|
|
cairo_paint (cr);
|
2005-06-13 07:57:02 +00:00
|
|
|
|
cairo_destroy (cr);
|
2005-05-11 19:16:19 +00:00
|
|
|
|
|
|
|
|
|
gdk_drawable_get_size (window, &width, &height);
|
|
|
|
|
if (arrow == ARROW_MONTH_LEFT || arrow == ARROW_YEAR_LEFT)
|
|
|
|
|
gtk_paint_arrow (widget->style, window, state,
|
|
|
|
|
GTK_SHADOW_OUT, NULL, widget, "calendar",
|
|
|
|
|
GTK_ARROW_LEFT, TRUE,
|
|
|
|
|
width/2 - 3, height/2 - 4, 8, 8);
|
|
|
|
|
else
|
|
|
|
|
gtk_paint_arrow (widget->style, window, state,
|
|
|
|
|
GTK_SHADOW_OUT, NULL, widget, "calendar",
|
|
|
|
|
GTK_ARROW_RIGHT, TRUE,
|
2006-12-14 13:15:13 +00:00
|
|
|
|
width/2 - 4, height/2 - 4, 8, 8);
|
1998-09-27 18:32:00 +00:00
|
|
|
|
}
|
2005-05-11 19:16:19 +00:00
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
static gboolean
|
|
|
|
|
gtk_calendar_expose (GtkWidget *widget,
|
|
|
|
|
GdkEventExpose *event)
|
|
|
|
|
{
|
|
|
|
|
GtkCalendar *calendar = GTK_CALENDAR (widget);
|
|
|
|
|
GtkCalendarPrivate *priv = GTK_CALENDAR_GET_PRIVATE (widget);
|
|
|
|
|
int i;
|
|
|
|
|
|
|
|
|
|
if (GTK_WIDGET_DRAWABLE (widget))
|
1998-09-27 18:32:00 +00:00
|
|
|
|
{
|
2005-05-11 19:16:19 +00:00
|
|
|
|
if (event->window == priv->main_win)
|
|
|
|
|
calendar_paint_main (calendar);
|
1998-10-01 13:24:42 +00:00
|
|
|
|
|
2005-05-11 19:16:19 +00:00
|
|
|
|
if (event->window == priv->header_win)
|
|
|
|
|
calendar_paint_header (calendar);
|
|
|
|
|
|
|
|
|
|
for (i = 0; i < 4; i++)
|
|
|
|
|
if (event->window == priv->arrow_win[i])
|
|
|
|
|
calendar_paint_arrow (calendar, i);
|
|
|
|
|
|
|
|
|
|
if (event->window == priv->day_name_win)
|
|
|
|
|
calendar_paint_day_names (calendar);
|
|
|
|
|
|
|
|
|
|
if (event->window == priv->week_win)
|
|
|
|
|
calendar_paint_week_numbers (calendar);
|
|
|
|
|
if (event->window == widget->window)
|
1998-09-27 18:32:00 +00:00
|
|
|
|
{
|
2005-05-11 19:16:19 +00:00
|
|
|
|
gtk_paint_shadow (widget->style, widget->window, GTK_WIDGET_STATE (widget),
|
|
|
|
|
GTK_SHADOW_IN, NULL, widget, "calendar",
|
|
|
|
|
0, 0, widget->allocation.width, widget->allocation.height);
|
1998-09-27 18:32:00 +00:00
|
|
|
|
}
|
|
|
|
|
}
|
1998-10-01 13:24:42 +00:00
|
|
|
|
|
2005-05-11 19:16:19 +00:00
|
|
|
|
return FALSE;
|
1998-09-27 18:32:00 +00:00
|
|
|
|
}
|
|
|
|
|
|
2005-05-11 19:16:19 +00:00
|
|
|
|
|
|
|
|
|
/****************************************
|
|
|
|
|
* Mouse handling *
|
|
|
|
|
****************************************/
|
|
|
|
|
|
|
|
|
|
static void
|
|
|
|
|
calendar_arrow_action (GtkCalendar *calendar,
|
|
|
|
|
guint arrow)
|
2003-05-08 00:25:51 +00:00
|
|
|
|
{
|
2005-05-11 19:16:19 +00:00
|
|
|
|
switch (arrow)
|
|
|
|
|
{
|
|
|
|
|
case ARROW_YEAR_LEFT:
|
|
|
|
|
calendar_set_year_prev (calendar);
|
|
|
|
|
break;
|
|
|
|
|
case ARROW_YEAR_RIGHT:
|
|
|
|
|
calendar_set_year_next (calendar);
|
|
|
|
|
break;
|
|
|
|
|
case ARROW_MONTH_LEFT:
|
|
|
|
|
calendar_set_month_prev (calendar);
|
|
|
|
|
break;
|
|
|
|
|
case ARROW_MONTH_RIGHT:
|
|
|
|
|
calendar_set_month_next (calendar);
|
|
|
|
|
break;
|
|
|
|
|
default:;
|
|
|
|
|
/* do nothing */
|
|
|
|
|
}
|
2003-05-08 00:25:51 +00:00
|
|
|
|
}
|
|
|
|
|
|
2005-05-11 19:16:19 +00:00
|
|
|
|
static gboolean
|
|
|
|
|
calendar_timer (gpointer data)
|
2003-05-08 00:25:51 +00:00
|
|
|
|
{
|
2005-05-11 19:16:19 +00:00
|
|
|
|
GtkCalendar *calendar = data;
|
|
|
|
|
GtkCalendarPrivate *priv = GTK_CALENDAR_GET_PRIVATE (calendar);
|
|
|
|
|
gboolean retval = FALSE;
|
1998-10-01 13:24:42 +00:00
|
|
|
|
|
2005-05-11 19:16:19 +00:00
|
|
|
|
if (priv->timer)
|
1998-09-27 18:32:00 +00:00
|
|
|
|
{
|
2005-05-11 19:16:19 +00:00
|
|
|
|
calendar_arrow_action (calendar, priv->click_child);
|
|
|
|
|
|
|
|
|
|
if (priv->need_timer)
|
1998-09-27 18:32:00 +00:00
|
|
|
|
{
|
2005-11-22 12:40:15 +00:00
|
|
|
|
GtkSettings *settings;
|
|
|
|
|
guint timeout;
|
|
|
|
|
|
|
|
|
|
settings = gtk_widget_get_settings (GTK_WIDGET (calendar));
|
|
|
|
|
g_object_get (settings, "gtk-timeout-repeat", &timeout, NULL);
|
|
|
|
|
|
2005-05-11 19:16:19 +00:00
|
|
|
|
priv->need_timer = FALSE;
|
2006-12-22 19:10:43 +00:00
|
|
|
|
priv->timer = gdk_threads_add_timeout_full (G_PRIORITY_DEFAULT_IDLE,
|
2006-08-06 04:41:31 +00:00
|
|
|
|
timeout * SCROLL_DELAY_FACTOR,
|
|
|
|
|
(GSourceFunc) calendar_timer,
|
|
|
|
|
(gpointer) calendar, NULL);
|
1998-09-27 18:32:00 +00:00
|
|
|
|
}
|
2005-05-11 19:16:19 +00:00
|
|
|
|
else
|
|
|
|
|
retval = TRUE;
|
|
|
|
|
}
|
2003-08-08 22:44:14 +00:00
|
|
|
|
|
2005-05-11 19:16:19 +00:00
|
|
|
|
return retval;
|
1998-09-27 18:32:00 +00:00
|
|
|
|
}
|
|
|
|
|
|
2005-05-11 19:16:19 +00:00
|
|
|
|
static void
|
|
|
|
|
calendar_start_spinning (GtkCalendar *calendar,
|
|
|
|
|
gint click_child)
|
1998-09-27 18:32:00 +00:00
|
|
|
|
{
|
2005-05-11 19:16:19 +00:00
|
|
|
|
GtkCalendarPrivate *priv = GTK_CALENDAR_GET_PRIVATE (calendar);
|
|
|
|
|
|
|
|
|
|
priv->click_child = click_child;
|
1998-10-01 13:24:42 +00:00
|
|
|
|
|
2005-05-11 19:16:19 +00:00
|
|
|
|
if (!priv->timer)
|
1998-09-27 18:32:00 +00:00
|
|
|
|
{
|
2005-11-22 12:40:15 +00:00
|
|
|
|
GtkSettings *settings;
|
|
|
|
|
guint timeout;
|
|
|
|
|
|
|
|
|
|
settings = gtk_widget_get_settings (GTK_WIDGET (calendar));
|
|
|
|
|
g_object_get (settings, "gtk-timeout-initial", &timeout, NULL);
|
|
|
|
|
|
2005-05-11 19:16:19 +00:00
|
|
|
|
priv->need_timer = TRUE;
|
2006-12-22 19:10:43 +00:00
|
|
|
|
priv->timer = gdk_threads_add_timeout_full (G_PRIORITY_DEFAULT_IDLE,
|
2006-08-06 04:41:31 +00:00
|
|
|
|
timeout,
|
|
|
|
|
(GSourceFunc) calendar_timer,
|
|
|
|
|
(gpointer) calendar, NULL);
|
1998-09-27 18:32:00 +00:00
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
2002-03-21 00:50:15 +00:00
|
|
|
|
static void
|
2005-05-11 19:16:19 +00:00
|
|
|
|
calendar_stop_spinning (GtkCalendar *calendar)
|
2002-03-21 00:50:15 +00:00
|
|
|
|
{
|
2005-05-11 19:16:19 +00:00
|
|
|
|
GtkCalendarPrivate *priv = GTK_CALENDAR_GET_PRIVATE (calendar);
|
2002-03-21 00:50:15 +00:00
|
|
|
|
|
2005-05-11 19:16:19 +00:00
|
|
|
|
if (priv->timer)
|
|
|
|
|
{
|
|
|
|
|
g_source_remove (priv->timer);
|
|
|
|
|
priv->timer = 0;
|
|
|
|
|
priv->need_timer = FALSE;
|
|
|
|
|
}
|
2002-03-21 00:50:15 +00:00
|
|
|
|
}
|
|
|
|
|
|
2005-05-11 19:16:19 +00:00
|
|
|
|
static void
|
|
|
|
|
calendar_main_button_press (GtkCalendar *calendar,
|
|
|
|
|
GdkEventButton *event)
|
1998-09-27 18:32:00 +00:00
|
|
|
|
{
|
2005-05-11 19:16:19 +00:00
|
|
|
|
GtkWidget *widget = GTK_WIDGET (calendar);
|
|
|
|
|
GtkCalendarPrivate *priv = GTK_CALENDAR_GET_PRIVATE (calendar);
|
|
|
|
|
gint x, y;
|
|
|
|
|
gint row, col;
|
|
|
|
|
gint day_month;
|
|
|
|
|
gint day;
|
1998-10-01 13:24:42 +00:00
|
|
|
|
|
2005-05-11 19:16:19 +00:00
|
|
|
|
x = (gint) (event->x);
|
|
|
|
|
y = (gint) (event->y);
|
1998-10-01 13:24:42 +00:00
|
|
|
|
|
2005-05-11 19:16:19 +00:00
|
|
|
|
row = calendar_row_from_y (calendar, y);
|
|
|
|
|
col = calendar_column_from_x (calendar, x);
|
1998-09-27 18:32:00 +00:00
|
|
|
|
|
2005-05-11 19:16:19 +00:00
|
|
|
|
/* If row or column isn't found, just return. */
|
|
|
|
|
if (row == -1 || col == -1)
|
|
|
|
|
return;
|
1998-10-01 13:24:42 +00:00
|
|
|
|
|
2005-05-11 19:16:19 +00:00
|
|
|
|
day_month = calendar->day_month[row][col];
|
|
|
|
|
|
|
|
|
|
if (event->type == GDK_BUTTON_PRESS)
|
2000-02-26 11:39:07 +00:00
|
|
|
|
{
|
2005-05-11 19:16:19 +00:00
|
|
|
|
day = calendar->day[row][col];
|
|
|
|
|
|
|
|
|
|
if (day_month == MONTH_PREV)
|
|
|
|
|
calendar_set_month_prev (calendar);
|
|
|
|
|
else if (day_month == MONTH_NEXT)
|
|
|
|
|
calendar_set_month_next (calendar);
|
|
|
|
|
|
|
|
|
|
if (!GTK_WIDGET_HAS_FOCUS (widget))
|
|
|
|
|
gtk_widget_grab_focus (widget);
|
|
|
|
|
|
|
|
|
|
if (event->button == 1)
|
|
|
|
|
{
|
|
|
|
|
priv->in_drag = 1;
|
|
|
|
|
priv->drag_start_x = x;
|
|
|
|
|
priv->drag_start_y = y;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
calendar_select_and_focus_day (calendar, day);
|
2000-02-26 11:39:07 +00:00
|
|
|
|
}
|
2005-05-11 19:16:19 +00:00
|
|
|
|
else if (event->type == GDK_2BUTTON_PRESS)
|
1998-09-27 18:32:00 +00:00
|
|
|
|
{
|
2005-05-11 19:16:19 +00:00
|
|
|
|
priv->in_drag = 0;
|
|
|
|
|
if (day_month == MONTH_CURRENT)
|
|
|
|
|
g_signal_emit (calendar,
|
|
|
|
|
gtk_calendar_signals[DAY_SELECTED_DOUBLE_CLICK_SIGNAL],
|
|
|
|
|
0);
|
1998-09-27 18:32:00 +00:00
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
2005-05-11 19:16:19 +00:00
|
|
|
|
static gboolean
|
|
|
|
|
gtk_calendar_button_press (GtkWidget *widget,
|
|
|
|
|
GdkEventButton *event)
|
1998-09-27 18:32:00 +00:00
|
|
|
|
{
|
2005-05-11 19:16:19 +00:00
|
|
|
|
GtkCalendar *calendar = GTK_CALENDAR (widget);
|
|
|
|
|
GtkCalendarPrivate *priv = GTK_CALENDAR_GET_PRIVATE (widget);
|
|
|
|
|
gint arrow = -1;
|
1998-10-01 13:24:42 +00:00
|
|
|
|
|
2005-05-11 19:16:19 +00:00
|
|
|
|
if (event->window == priv->main_win)
|
|
|
|
|
calendar_main_button_press (calendar, event);
|
2001-03-24 06:10:40 +00:00
|
|
|
|
|
2003-05-20 22:37:57 +00:00
|
|
|
|
if (!GTK_WIDGET_HAS_FOCUS (widget))
|
|
|
|
|
gtk_widget_grab_focus (widget);
|
1999-02-20 19:09:21 +00:00
|
|
|
|
|
2003-05-20 22:37:57 +00:00
|
|
|
|
for (arrow = ARROW_YEAR_LEFT; arrow <= ARROW_MONTH_RIGHT; arrow++)
|
|
|
|
|
{
|
2005-05-11 19:16:19 +00:00
|
|
|
|
if (event->window == priv->arrow_win[arrow])
|
2003-05-20 22:37:57 +00:00
|
|
|
|
{
|
|
|
|
|
|
|
|
|
|
/* only call the action on single click, not double */
|
|
|
|
|
if (event->type == GDK_BUTTON_PRESS)
|
|
|
|
|
{
|
|
|
|
|
if (event->button == 1)
|
2005-05-11 19:16:19 +00:00
|
|
|
|
calendar_start_spinning (calendar, arrow);
|
2004-06-10 04:09:33 +00:00
|
|
|
|
|
2005-05-11 19:16:19 +00:00
|
|
|
|
calendar_arrow_action (calendar, arrow);
|
2003-05-20 22:37:57 +00:00
|
|
|
|
}
|
2001-03-24 06:10:40 +00:00
|
|
|
|
|
2003-05-20 22:37:57 +00:00
|
|
|
|
return TRUE;
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
return FALSE;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
static gboolean
|
|
|
|
|
gtk_calendar_button_release (GtkWidget *widget,
|
|
|
|
|
GdkEventButton *event)
|
|
|
|
|
{
|
2005-05-11 19:16:19 +00:00
|
|
|
|
GtkCalendar *calendar = GTK_CALENDAR (widget);
|
|
|
|
|
GtkCalendarPrivate *priv = GTK_CALENDAR_GET_PRIVATE (widget);
|
2003-08-08 23:01:17 +00:00
|
|
|
|
|
2003-05-20 22:37:57 +00:00
|
|
|
|
if (event->button == 1)
|
2003-08-08 23:01:17 +00:00
|
|
|
|
{
|
2005-05-11 19:16:19 +00:00
|
|
|
|
calendar_stop_spinning (calendar);
|
2003-08-08 23:01:17 +00:00
|
|
|
|
|
2005-05-11 19:16:19 +00:00
|
|
|
|
if (priv->in_drag)
|
|
|
|
|
priv->in_drag = 0;
|
2003-08-08 23:01:17 +00:00
|
|
|
|
}
|
2003-05-20 22:37:57 +00:00
|
|
|
|
|
|
|
|
|
return TRUE;
|
1998-09-27 18:32:00 +00:00
|
|
|
|
}
|
|
|
|
|
|
2001-03-16 20:12:40 +00:00
|
|
|
|
static gboolean
|
1998-10-01 13:24:42 +00:00
|
|
|
|
gtk_calendar_motion_notify (GtkWidget *widget,
|
1998-09-27 18:32:00 +00:00
|
|
|
|
GdkEventMotion *event)
|
|
|
|
|
{
|
2005-05-11 19:16:19 +00:00
|
|
|
|
GtkCalendar *calendar = GTK_CALENDAR (widget);
|
|
|
|
|
GtkCalendarPrivate *priv = GTK_CALENDAR_GET_PRIVATE (widget);
|
1998-09-27 18:32:00 +00:00
|
|
|
|
gint event_x, event_y;
|
|
|
|
|
gint row, col;
|
|
|
|
|
gint old_row, old_col;
|
1998-10-01 13:24:42 +00:00
|
|
|
|
|
1998-09-27 18:32:00 +00:00
|
|
|
|
event_x = (gint) (event->x);
|
|
|
|
|
event_y = (gint) (event->y);
|
1998-10-01 13:24:42 +00:00
|
|
|
|
|
2005-05-11 19:16:19 +00:00
|
|
|
|
if (event->window == priv->main_win)
|
1998-09-27 18:32:00 +00:00
|
|
|
|
{
|
1998-10-01 13:24:42 +00:00
|
|
|
|
|
2005-05-11 19:16:19 +00:00
|
|
|
|
if (priv->in_drag)
|
1998-09-27 18:32:00 +00:00
|
|
|
|
{
|
2003-08-08 23:01:17 +00:00
|
|
|
|
if (gtk_drag_check_threshold (widget,
|
2005-05-11 19:16:19 +00:00
|
|
|
|
priv->drag_start_x, priv->drag_start_y,
|
2003-08-08 23:01:17 +00:00
|
|
|
|
event->x, event->y))
|
1998-09-27 18:32:00 +00:00
|
|
|
|
{
|
2003-08-08 23:01:17 +00:00
|
|
|
|
GdkDragContext *context;
|
2004-07-21 16:53:55 +00:00
|
|
|
|
GtkTargetList *target_list = gtk_target_list_new (NULL, 0);
|
2004-10-22 17:27:06 +00:00
|
|
|
|
gtk_target_list_add_text_targets (target_list, 0);
|
2003-08-08 23:01:17 +00:00
|
|
|
|
context = gtk_drag_begin (widget, target_list, GDK_ACTION_COPY,
|
|
|
|
|
1, (GdkEvent *)event);
|
|
|
|
|
|
1998-10-01 13:24:42 +00:00
|
|
|
|
|
2005-05-11 19:16:19 +00:00
|
|
|
|
priv->in_drag = 0;
|
2003-08-08 23:01:17 +00:00
|
|
|
|
|
|
|
|
|
gtk_target_list_unref (target_list);
|
|
|
|
|
gtk_drag_set_icon_default (context);
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
else
|
|
|
|
|
{
|
2005-05-11 19:16:19 +00:00
|
|
|
|
row = calendar_row_from_y (calendar, event_y);
|
|
|
|
|
col = calendar_column_from_x (calendar, event_x);
|
1998-10-01 13:24:42 +00:00
|
|
|
|
|
2003-08-08 23:01:17 +00:00
|
|
|
|
if (row != calendar->highlight_row || calendar->highlight_col != col)
|
|
|
|
|
{
|
|
|
|
|
old_row = calendar->highlight_row;
|
|
|
|
|
old_col = calendar->highlight_col;
|
|
|
|
|
if (old_row > -1 && old_col > -1)
|
|
|
|
|
{
|
|
|
|
|
calendar->highlight_row = -1;
|
|
|
|
|
calendar->highlight_col = -1;
|
2005-05-11 19:16:19 +00:00
|
|
|
|
calendar_invalidate_day (calendar, old_row, old_col);
|
2003-08-08 23:01:17 +00:00
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
calendar->highlight_row = row;
|
|
|
|
|
calendar->highlight_col = col;
|
|
|
|
|
|
|
|
|
|
if (row > -1 && col > -1)
|
2005-05-11 19:16:19 +00:00
|
|
|
|
calendar_invalidate_day (calendar, row, col);
|
2003-08-08 23:01:17 +00:00
|
|
|
|
}
|
1998-09-27 18:32:00 +00:00
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
return TRUE;
|
|
|
|
|
}
|
|
|
|
|
|
2001-03-16 20:12:40 +00:00
|
|
|
|
static gboolean
|
1998-10-01 13:24:42 +00:00
|
|
|
|
gtk_calendar_enter_notify (GtkWidget *widget,
|
|
|
|
|
GdkEventCrossing *event)
|
1998-09-27 18:32:00 +00:00
|
|
|
|
{
|
2005-05-11 19:16:19 +00:00
|
|
|
|
GtkCalendar *calendar = GTK_CALENDAR (widget);
|
|
|
|
|
GtkCalendarPrivate *priv = GTK_CALENDAR_GET_PRIVATE (widget);
|
1998-10-01 13:24:42 +00:00
|
|
|
|
|
2005-05-11 19:16:19 +00:00
|
|
|
|
if (event->window == priv->arrow_win[ARROW_MONTH_LEFT])
|
1998-09-27 18:32:00 +00:00
|
|
|
|
{
|
2005-05-11 19:16:19 +00:00
|
|
|
|
priv->arrow_state[ARROW_MONTH_LEFT] = GTK_STATE_PRELIGHT;
|
|
|
|
|
calendar_invalidate_arrow (calendar, ARROW_MONTH_LEFT);
|
1998-09-27 18:32:00 +00:00
|
|
|
|
}
|
1998-10-01 13:24:42 +00:00
|
|
|
|
|
2005-05-11 19:16:19 +00:00
|
|
|
|
if (event->window == priv->arrow_win[ARROW_MONTH_RIGHT])
|
1998-09-27 18:32:00 +00:00
|
|
|
|
{
|
2005-05-11 19:16:19 +00:00
|
|
|
|
priv->arrow_state[ARROW_MONTH_RIGHT] = GTK_STATE_PRELIGHT;
|
|
|
|
|
calendar_invalidate_arrow (calendar, ARROW_MONTH_RIGHT);
|
1998-09-27 18:32:00 +00:00
|
|
|
|
}
|
1998-10-01 13:24:42 +00:00
|
|
|
|
|
2005-05-11 19:16:19 +00:00
|
|
|
|
if (event->window == priv->arrow_win[ARROW_YEAR_LEFT])
|
1998-09-27 18:32:00 +00:00
|
|
|
|
{
|
2005-05-11 19:16:19 +00:00
|
|
|
|
priv->arrow_state[ARROW_YEAR_LEFT] = GTK_STATE_PRELIGHT;
|
|
|
|
|
calendar_invalidate_arrow (calendar, ARROW_YEAR_LEFT);
|
1998-09-27 18:32:00 +00:00
|
|
|
|
}
|
1998-10-01 13:24:42 +00:00
|
|
|
|
|
2005-05-11 19:16:19 +00:00
|
|
|
|
if (event->window == priv->arrow_win[ARROW_YEAR_RIGHT])
|
1998-09-27 18:32:00 +00:00
|
|
|
|
{
|
2005-05-11 19:16:19 +00:00
|
|
|
|
priv->arrow_state[ARROW_YEAR_RIGHT] = GTK_STATE_PRELIGHT;
|
|
|
|
|
calendar_invalidate_arrow (calendar, ARROW_YEAR_RIGHT);
|
1998-09-27 18:32:00 +00:00
|
|
|
|
}
|
1998-10-01 13:24:42 +00:00
|
|
|
|
|
1998-09-27 18:32:00 +00:00
|
|
|
|
return TRUE;
|
|
|
|
|
}
|
|
|
|
|
|
2001-03-16 20:12:40 +00:00
|
|
|
|
static gboolean
|
1998-10-01 13:24:42 +00:00
|
|
|
|
gtk_calendar_leave_notify (GtkWidget *widget,
|
|
|
|
|
GdkEventCrossing *event)
|
1998-09-27 18:32:00 +00:00
|
|
|
|
{
|
2005-05-11 19:16:19 +00:00
|
|
|
|
GtkCalendar *calendar = GTK_CALENDAR (widget);
|
|
|
|
|
GtkCalendarPrivate *priv = GTK_CALENDAR_GET_PRIVATE (widget);
|
1998-09-27 18:32:00 +00:00
|
|
|
|
gint row;
|
|
|
|
|
gint col;
|
1998-10-01 13:24:42 +00:00
|
|
|
|
|
2005-05-11 19:16:19 +00:00
|
|
|
|
if (event->window == priv->main_win)
|
1998-09-27 18:32:00 +00:00
|
|
|
|
{
|
|
|
|
|
row = calendar->highlight_row;
|
|
|
|
|
col = calendar->highlight_col;
|
|
|
|
|
calendar->highlight_row = -1;
|
|
|
|
|
calendar->highlight_col = -1;
|
|
|
|
|
if (row > -1 && col > -1)
|
2005-05-11 19:16:19 +00:00
|
|
|
|
calendar_invalidate_day (calendar, row, col);
|
1998-09-27 18:32:00 +00:00
|
|
|
|
}
|
1998-10-01 13:24:42 +00:00
|
|
|
|
|
2005-05-11 19:16:19 +00:00
|
|
|
|
if (event->window == priv->arrow_win[ARROW_MONTH_LEFT])
|
1998-09-27 18:32:00 +00:00
|
|
|
|
{
|
2005-05-11 19:16:19 +00:00
|
|
|
|
priv->arrow_state[ARROW_MONTH_LEFT] = GTK_STATE_NORMAL;
|
|
|
|
|
calendar_invalidate_arrow (calendar, ARROW_MONTH_LEFT);
|
1998-09-27 18:32:00 +00:00
|
|
|
|
}
|
1998-10-01 13:24:42 +00:00
|
|
|
|
|
2005-05-11 19:16:19 +00:00
|
|
|
|
if (event->window == priv->arrow_win[ARROW_MONTH_RIGHT])
|
1998-09-27 18:32:00 +00:00
|
|
|
|
{
|
2005-05-11 19:16:19 +00:00
|
|
|
|
priv->arrow_state[ARROW_MONTH_RIGHT] = GTK_STATE_NORMAL;
|
|
|
|
|
calendar_invalidate_arrow (calendar, ARROW_MONTH_RIGHT);
|
1998-09-27 18:32:00 +00:00
|
|
|
|
}
|
1998-10-01 13:24:42 +00:00
|
|
|
|
|
2005-05-11 19:16:19 +00:00
|
|
|
|
if (event->window == priv->arrow_win[ARROW_YEAR_LEFT])
|
1998-09-27 18:32:00 +00:00
|
|
|
|
{
|
2005-05-11 19:16:19 +00:00
|
|
|
|
priv->arrow_state[ARROW_YEAR_LEFT] = GTK_STATE_NORMAL;
|
|
|
|
|
calendar_invalidate_arrow (calendar, ARROW_YEAR_LEFT);
|
1998-09-27 18:32:00 +00:00
|
|
|
|
}
|
1998-10-01 13:24:42 +00:00
|
|
|
|
|
2005-05-11 19:16:19 +00:00
|
|
|
|
if (event->window == priv->arrow_win[ARROW_YEAR_RIGHT])
|
1998-09-27 18:32:00 +00:00
|
|
|
|
{
|
2005-05-11 19:16:19 +00:00
|
|
|
|
priv->arrow_state[ARROW_YEAR_RIGHT] = GTK_STATE_NORMAL;
|
|
|
|
|
calendar_invalidate_arrow (calendar, ARROW_YEAR_RIGHT);
|
1998-09-27 18:32:00 +00:00
|
|
|
|
}
|
1998-10-01 13:24:42 +00:00
|
|
|
|
|
1998-09-27 18:32:00 +00:00
|
|
|
|
return TRUE;
|
|
|
|
|
}
|
|
|
|
|
|
2003-08-08 22:03:25 +00:00
|
|
|
|
static gboolean
|
|
|
|
|
gtk_calendar_scroll (GtkWidget *widget,
|
|
|
|
|
GdkEventScroll *event)
|
|
|
|
|
{
|
|
|
|
|
GtkCalendar *calendar = GTK_CALENDAR (widget);
|
|
|
|
|
|
|
|
|
|
if (event->direction == GDK_SCROLL_UP)
|
|
|
|
|
{
|
|
|
|
|
if (!GTK_WIDGET_HAS_FOCUS (widget))
|
|
|
|
|
gtk_widget_grab_focus (widget);
|
2005-05-11 19:16:19 +00:00
|
|
|
|
calendar_set_month_prev (calendar);
|
2003-08-08 22:03:25 +00:00
|
|
|
|
}
|
|
|
|
|
else if (event->direction == GDK_SCROLL_DOWN)
|
|
|
|
|
{
|
|
|
|
|
if (!GTK_WIDGET_HAS_FOCUS (widget))
|
|
|
|
|
gtk_widget_grab_focus (widget);
|
2005-05-11 19:16:19 +00:00
|
|
|
|
calendar_set_month_next (calendar);
|
2003-08-08 22:03:25 +00:00
|
|
|
|
}
|
|
|
|
|
else
|
|
|
|
|
return FALSE;
|
|
|
|
|
|
|
|
|
|
return TRUE;
|
|
|
|
|
}
|
|
|
|
|
|
2005-05-11 19:16:19 +00:00
|
|
|
|
|
|
|
|
|
/****************************************
|
|
|
|
|
* Key handling *
|
|
|
|
|
****************************************/
|
|
|
|
|
|
2003-08-08 22:17:34 +00:00
|
|
|
|
static void
|
|
|
|
|
move_focus (GtkCalendar *calendar,
|
2005-05-11 19:16:19 +00:00
|
|
|
|
gint direction)
|
2003-08-08 22:17:34 +00:00
|
|
|
|
{
|
|
|
|
|
GtkTextDirection text_dir = gtk_widget_get_direction (GTK_WIDGET (calendar));
|
2007-01-19 03:52:03 +00:00
|
|
|
|
|
2003-08-08 22:17:34 +00:00
|
|
|
|
if ((text_dir == GTK_TEXT_DIR_LTR && direction == -1) ||
|
|
|
|
|
(text_dir == GTK_TEXT_DIR_RTL && direction == 1))
|
|
|
|
|
{
|
|
|
|
|
if (calendar->focus_col > 0)
|
|
|
|
|
calendar->focus_col--;
|
|
|
|
|
else if (calendar->focus_row > 0)
|
|
|
|
|
{
|
|
|
|
|
calendar->focus_col = 6;
|
|
|
|
|
calendar->focus_row--;
|
|
|
|
|
}
|
2007-01-19 03:52:03 +00:00
|
|
|
|
|
|
|
|
|
if (calendar->focus_col < 0)
|
|
|
|
|
calendar->focus_col = 6;
|
|
|
|
|
if (calendar->focus_row < 0)
|
|
|
|
|
calendar->focus_row = 5;
|
2003-08-08 22:17:34 +00:00
|
|
|
|
}
|
|
|
|
|
else
|
|
|
|
|
{
|
|
|
|
|
if (calendar->focus_col < 6)
|
|
|
|
|
calendar->focus_col++;
|
|
|
|
|
else if (calendar->focus_row < 5)
|
|
|
|
|
{
|
|
|
|
|
calendar->focus_col = 0;
|
|
|
|
|
calendar->focus_row++;
|
|
|
|
|
}
|
2007-01-19 03:52:03 +00:00
|
|
|
|
|
|
|
|
|
if (calendar->focus_col < 0)
|
|
|
|
|
calendar->focus_col = 0;
|
|
|
|
|
if (calendar->focus_row < 0)
|
|
|
|
|
calendar->focus_row = 0;
|
2003-08-08 22:17:34 +00:00
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
2001-03-16 20:12:40 +00:00
|
|
|
|
static gboolean
|
1998-09-27 18:32:00 +00:00
|
|
|
|
gtk_calendar_key_press (GtkWidget *widget,
|
1998-10-01 13:24:42 +00:00
|
|
|
|
GdkEventKey *event)
|
1998-09-27 18:32:00 +00:00
|
|
|
|
{
|
|
|
|
|
GtkCalendar *calendar;
|
|
|
|
|
gint return_val;
|
1998-10-05 03:52:48 +00:00
|
|
|
|
gint old_focus_row;
|
|
|
|
|
gint old_focus_col;
|
|
|
|
|
gint row, col, day;
|
1998-10-01 13:24:42 +00:00
|
|
|
|
|
1998-09-27 18:32:00 +00:00
|
|
|
|
calendar = GTK_CALENDAR (widget);
|
|
|
|
|
return_val = FALSE;
|
1998-10-01 13:24:42 +00:00
|
|
|
|
|
1998-10-05 03:52:48 +00:00
|
|
|
|
old_focus_row = calendar->focus_row;
|
|
|
|
|
old_focus_col = calendar->focus_col;
|
|
|
|
|
|
1998-09-27 18:32:00 +00:00
|
|
|
|
switch (event->keyval)
|
|
|
|
|
{
|
Clip the retrieved image data to the screen, using a server grab to avoid
2001-06-28 Havoc Pennington <hp@pobox.com>
* gdk/x11/gdkimage-x11.c (_gdk_x11_get_image): Clip the retrieved
image data to the screen, using a server grab to avoid race
conditions.
* gtk/gtkitemfactory.c (gtk_item_factory_create_item): remove
check for NULL return from gtk_image_new_from_stock(), it never
returns NULL.
(gtk_item_factory_create_item): fix bug where we parsed the stock
ID as an inline pixbuf
* gtk/gtktext.c (gtk_text_key_press): numeric keypad support
* gtk/gtkspinbutton.c (gtk_spin_button_key_press): numeric keypad
support (should be using binding set here)
* gtk/gtkoptionmenu.c (gtk_option_menu_key_press): numeric keypad
support (should be using binding set here)
* gtk/gtkmenushell.c (gtk_menu_shell_class_init): numeric keypad
support
* gtk/gtkmenu.c (gtk_menu_class_init): numeric keypad support
* gtk/gtkmenubar.c (gtk_menu_bar_class_init): numeric keypad
* gtk/gtklistitem.c (gtk_list_item_class_init): numeric keypad
* gtk/gtkimcontextsimple.c
(gtk_im_context_simple_filter_keypress): keypad
* gtk/gtkfilesel.c (gtk_file_selection_key_press): keypad
* gtk/gtkentry.c (gtk_entry_class_init): numeric keypad fixes
* gtk/gtkctree.c (gtk_ctree_class_init): numeric keypad support
* gtk/gtkcolorsel.c (palette_activate): keypad support (of course,
should be binding-setted)
* gtk/gtkwindow.c (gtk_window_class_init): numeric keypad fixes
* gtk/gtkclist.c (gtk_clist_class_init): numeric keypad fixes
* gtk/gtkcalendar.c: numeric keypad fixes
* gtk/gtktextview.c (gtk_text_view_class_init): numeric keypad
support
* gdk/gdkwindow.c (gdk_window_get_clip_region): fix infinite loop
screwup
* gdk/gdkpixbuf-render.c (gdk_pixbuf_render_to_drawable_alpha):
clip the render area to the drawable's clip region in advance,
so we don't get data from the server that we don't need.
* gdk/gdkpixbuf-render.c (gdk_pixbuf_render_to_drawable_alpha):
check return value of gdk_pixbuf_get_from_drawable(), fall back
to bilevel alpha if we can't get the pixbuf to composite against.
* gdk/gdkdraw.c (gdk_drawable_get_image): set the image colormap
* gdk/gdkimage.c (gdk_image_get_colormap): add
gdk_image_set_colormap, gdk_image_get_colormap
* gdk/gdkpixbuf-drawable.c (rgbconvert): Change all converters to
take a region of the image, instead of converting the entire
image.
* gtk/gtkwidget.h (struct _GtkWidgetClass): add show_help
keybinding signal. Add default bindings for it. Add default
handler for show_help that shows the tooltip for the widget.
* gtk/gtkdialog.c (gtk_dialog_class_init): add binding set and
"close" keybinding signal, remove key press handler.
* gtk/gtktooltips.c (gtk_tooltips_set_colors): Just remove this,
it's not our usual practice to leave a deprecated function around
with a runtime warning, plus we don't want it to appear in docs,
plus if we make them yellow no one will want to change them
anyhow.
2001-06-29 01:59:02 +00:00
|
|
|
|
case GDK_KP_Left:
|
1998-09-27 18:32:00 +00:00
|
|
|
|
case GDK_Left:
|
|
|
|
|
return_val = TRUE;
|
|
|
|
|
if (event->state & GDK_CONTROL_MASK)
|
2005-05-11 19:16:19 +00:00
|
|
|
|
calendar_set_month_prev (calendar);
|
1998-09-27 18:32:00 +00:00
|
|
|
|
else
|
|
|
|
|
{
|
2003-08-08 22:17:34 +00:00
|
|
|
|
move_focus (calendar, -1);
|
2005-05-11 19:16:19 +00:00
|
|
|
|
calendar_invalidate_day (calendar, old_focus_row, old_focus_col);
|
|
|
|
|
calendar_invalidate_day (calendar, calendar->focus_row,
|
|
|
|
|
calendar->focus_col);
|
1998-09-27 18:32:00 +00:00
|
|
|
|
}
|
|
|
|
|
break;
|
Clip the retrieved image data to the screen, using a server grab to avoid
2001-06-28 Havoc Pennington <hp@pobox.com>
* gdk/x11/gdkimage-x11.c (_gdk_x11_get_image): Clip the retrieved
image data to the screen, using a server grab to avoid race
conditions.
* gtk/gtkitemfactory.c (gtk_item_factory_create_item): remove
check for NULL return from gtk_image_new_from_stock(), it never
returns NULL.
(gtk_item_factory_create_item): fix bug where we parsed the stock
ID as an inline pixbuf
* gtk/gtktext.c (gtk_text_key_press): numeric keypad support
* gtk/gtkspinbutton.c (gtk_spin_button_key_press): numeric keypad
support (should be using binding set here)
* gtk/gtkoptionmenu.c (gtk_option_menu_key_press): numeric keypad
support (should be using binding set here)
* gtk/gtkmenushell.c (gtk_menu_shell_class_init): numeric keypad
support
* gtk/gtkmenu.c (gtk_menu_class_init): numeric keypad support
* gtk/gtkmenubar.c (gtk_menu_bar_class_init): numeric keypad
* gtk/gtklistitem.c (gtk_list_item_class_init): numeric keypad
* gtk/gtkimcontextsimple.c
(gtk_im_context_simple_filter_keypress): keypad
* gtk/gtkfilesel.c (gtk_file_selection_key_press): keypad
* gtk/gtkentry.c (gtk_entry_class_init): numeric keypad fixes
* gtk/gtkctree.c (gtk_ctree_class_init): numeric keypad support
* gtk/gtkcolorsel.c (palette_activate): keypad support (of course,
should be binding-setted)
* gtk/gtkwindow.c (gtk_window_class_init): numeric keypad fixes
* gtk/gtkclist.c (gtk_clist_class_init): numeric keypad fixes
* gtk/gtkcalendar.c: numeric keypad fixes
* gtk/gtktextview.c (gtk_text_view_class_init): numeric keypad
support
* gdk/gdkwindow.c (gdk_window_get_clip_region): fix infinite loop
screwup
* gdk/gdkpixbuf-render.c (gdk_pixbuf_render_to_drawable_alpha):
clip the render area to the drawable's clip region in advance,
so we don't get data from the server that we don't need.
* gdk/gdkpixbuf-render.c (gdk_pixbuf_render_to_drawable_alpha):
check return value of gdk_pixbuf_get_from_drawable(), fall back
to bilevel alpha if we can't get the pixbuf to composite against.
* gdk/gdkdraw.c (gdk_drawable_get_image): set the image colormap
* gdk/gdkimage.c (gdk_image_get_colormap): add
gdk_image_set_colormap, gdk_image_get_colormap
* gdk/gdkpixbuf-drawable.c (rgbconvert): Change all converters to
take a region of the image, instead of converting the entire
image.
* gtk/gtkwidget.h (struct _GtkWidgetClass): add show_help
keybinding signal. Add default bindings for it. Add default
handler for show_help that shows the tooltip for the widget.
* gtk/gtkdialog.c (gtk_dialog_class_init): add binding set and
"close" keybinding signal, remove key press handler.
* gtk/gtktooltips.c (gtk_tooltips_set_colors): Just remove this,
it's not our usual practice to leave a deprecated function around
with a runtime warning, plus we don't want it to appear in docs,
plus if we make them yellow no one will want to change them
anyhow.
2001-06-29 01:59:02 +00:00
|
|
|
|
case GDK_KP_Right:
|
1998-09-27 18:32:00 +00:00
|
|
|
|
case GDK_Right:
|
|
|
|
|
return_val = TRUE;
|
|
|
|
|
if (event->state & GDK_CONTROL_MASK)
|
2005-05-11 19:16:19 +00:00
|
|
|
|
calendar_set_month_next (calendar);
|
1998-09-27 18:32:00 +00:00
|
|
|
|
else
|
|
|
|
|
{
|
2003-08-08 22:17:34 +00:00
|
|
|
|
move_focus (calendar, 1);
|
2005-05-11 19:16:19 +00:00
|
|
|
|
calendar_invalidate_day (calendar, old_focus_row, old_focus_col);
|
|
|
|
|
calendar_invalidate_day (calendar, calendar->focus_row,
|
|
|
|
|
calendar->focus_col);
|
1998-09-27 18:32:00 +00:00
|
|
|
|
}
|
|
|
|
|
break;
|
Clip the retrieved image data to the screen, using a server grab to avoid
2001-06-28 Havoc Pennington <hp@pobox.com>
* gdk/x11/gdkimage-x11.c (_gdk_x11_get_image): Clip the retrieved
image data to the screen, using a server grab to avoid race
conditions.
* gtk/gtkitemfactory.c (gtk_item_factory_create_item): remove
check for NULL return from gtk_image_new_from_stock(), it never
returns NULL.
(gtk_item_factory_create_item): fix bug where we parsed the stock
ID as an inline pixbuf
* gtk/gtktext.c (gtk_text_key_press): numeric keypad support
* gtk/gtkspinbutton.c (gtk_spin_button_key_press): numeric keypad
support (should be using binding set here)
* gtk/gtkoptionmenu.c (gtk_option_menu_key_press): numeric keypad
support (should be using binding set here)
* gtk/gtkmenushell.c (gtk_menu_shell_class_init): numeric keypad
support
* gtk/gtkmenu.c (gtk_menu_class_init): numeric keypad support
* gtk/gtkmenubar.c (gtk_menu_bar_class_init): numeric keypad
* gtk/gtklistitem.c (gtk_list_item_class_init): numeric keypad
* gtk/gtkimcontextsimple.c
(gtk_im_context_simple_filter_keypress): keypad
* gtk/gtkfilesel.c (gtk_file_selection_key_press): keypad
* gtk/gtkentry.c (gtk_entry_class_init): numeric keypad fixes
* gtk/gtkctree.c (gtk_ctree_class_init): numeric keypad support
* gtk/gtkcolorsel.c (palette_activate): keypad support (of course,
should be binding-setted)
* gtk/gtkwindow.c (gtk_window_class_init): numeric keypad fixes
* gtk/gtkclist.c (gtk_clist_class_init): numeric keypad fixes
* gtk/gtkcalendar.c: numeric keypad fixes
* gtk/gtktextview.c (gtk_text_view_class_init): numeric keypad
support
* gdk/gdkwindow.c (gdk_window_get_clip_region): fix infinite loop
screwup
* gdk/gdkpixbuf-render.c (gdk_pixbuf_render_to_drawable_alpha):
clip the render area to the drawable's clip region in advance,
so we don't get data from the server that we don't need.
* gdk/gdkpixbuf-render.c (gdk_pixbuf_render_to_drawable_alpha):
check return value of gdk_pixbuf_get_from_drawable(), fall back
to bilevel alpha if we can't get the pixbuf to composite against.
* gdk/gdkdraw.c (gdk_drawable_get_image): set the image colormap
* gdk/gdkimage.c (gdk_image_get_colormap): add
gdk_image_set_colormap, gdk_image_get_colormap
* gdk/gdkpixbuf-drawable.c (rgbconvert): Change all converters to
take a region of the image, instead of converting the entire
image.
* gtk/gtkwidget.h (struct _GtkWidgetClass): add show_help
keybinding signal. Add default bindings for it. Add default
handler for show_help that shows the tooltip for the widget.
* gtk/gtkdialog.c (gtk_dialog_class_init): add binding set and
"close" keybinding signal, remove key press handler.
* gtk/gtktooltips.c (gtk_tooltips_set_colors): Just remove this,
it's not our usual practice to leave a deprecated function around
with a runtime warning, plus we don't want it to appear in docs,
plus if we make them yellow no one will want to change them
anyhow.
2001-06-29 01:59:02 +00:00
|
|
|
|
case GDK_KP_Up:
|
1998-09-27 18:32:00 +00:00
|
|
|
|
case GDK_Up:
|
|
|
|
|
return_val = TRUE;
|
|
|
|
|
if (event->state & GDK_CONTROL_MASK)
|
2005-05-11 19:16:19 +00:00
|
|
|
|
calendar_set_year_prev (calendar);
|
1998-09-27 18:32:00 +00:00
|
|
|
|
else
|
|
|
|
|
{
|
1998-10-05 03:52:48 +00:00
|
|
|
|
if (calendar->focus_row > 0)
|
2003-08-08 22:17:34 +00:00
|
|
|
|
calendar->focus_row--;
|
2007-01-19 03:52:03 +00:00
|
|
|
|
if (calendar->focus_row < 0)
|
|
|
|
|
calendar->focus_row = 5;
|
|
|
|
|
if (calendar->focus_col < 0)
|
|
|
|
|
calendar->focus_col = 6;
|
2005-05-11 19:16:19 +00:00
|
|
|
|
calendar_invalidate_day (calendar, old_focus_row, old_focus_col);
|
|
|
|
|
calendar_invalidate_day (calendar, calendar->focus_row,
|
|
|
|
|
calendar->focus_col);
|
1998-09-27 18:32:00 +00:00
|
|
|
|
}
|
|
|
|
|
break;
|
Clip the retrieved image data to the screen, using a server grab to avoid
2001-06-28 Havoc Pennington <hp@pobox.com>
* gdk/x11/gdkimage-x11.c (_gdk_x11_get_image): Clip the retrieved
image data to the screen, using a server grab to avoid race
conditions.
* gtk/gtkitemfactory.c (gtk_item_factory_create_item): remove
check for NULL return from gtk_image_new_from_stock(), it never
returns NULL.
(gtk_item_factory_create_item): fix bug where we parsed the stock
ID as an inline pixbuf
* gtk/gtktext.c (gtk_text_key_press): numeric keypad support
* gtk/gtkspinbutton.c (gtk_spin_button_key_press): numeric keypad
support (should be using binding set here)
* gtk/gtkoptionmenu.c (gtk_option_menu_key_press): numeric keypad
support (should be using binding set here)
* gtk/gtkmenushell.c (gtk_menu_shell_class_init): numeric keypad
support
* gtk/gtkmenu.c (gtk_menu_class_init): numeric keypad support
* gtk/gtkmenubar.c (gtk_menu_bar_class_init): numeric keypad
* gtk/gtklistitem.c (gtk_list_item_class_init): numeric keypad
* gtk/gtkimcontextsimple.c
(gtk_im_context_simple_filter_keypress): keypad
* gtk/gtkfilesel.c (gtk_file_selection_key_press): keypad
* gtk/gtkentry.c (gtk_entry_class_init): numeric keypad fixes
* gtk/gtkctree.c (gtk_ctree_class_init): numeric keypad support
* gtk/gtkcolorsel.c (palette_activate): keypad support (of course,
should be binding-setted)
* gtk/gtkwindow.c (gtk_window_class_init): numeric keypad fixes
* gtk/gtkclist.c (gtk_clist_class_init): numeric keypad fixes
* gtk/gtkcalendar.c: numeric keypad fixes
* gtk/gtktextview.c (gtk_text_view_class_init): numeric keypad
support
* gdk/gdkwindow.c (gdk_window_get_clip_region): fix infinite loop
screwup
* gdk/gdkpixbuf-render.c (gdk_pixbuf_render_to_drawable_alpha):
clip the render area to the drawable's clip region in advance,
so we don't get data from the server that we don't need.
* gdk/gdkpixbuf-render.c (gdk_pixbuf_render_to_drawable_alpha):
check return value of gdk_pixbuf_get_from_drawable(), fall back
to bilevel alpha if we can't get the pixbuf to composite against.
* gdk/gdkdraw.c (gdk_drawable_get_image): set the image colormap
* gdk/gdkimage.c (gdk_image_get_colormap): add
gdk_image_set_colormap, gdk_image_get_colormap
* gdk/gdkpixbuf-drawable.c (rgbconvert): Change all converters to
take a region of the image, instead of converting the entire
image.
* gtk/gtkwidget.h (struct _GtkWidgetClass): add show_help
keybinding signal. Add default bindings for it. Add default
handler for show_help that shows the tooltip for the widget.
* gtk/gtkdialog.c (gtk_dialog_class_init): add binding set and
"close" keybinding signal, remove key press handler.
* gtk/gtktooltips.c (gtk_tooltips_set_colors): Just remove this,
it's not our usual practice to leave a deprecated function around
with a runtime warning, plus we don't want it to appear in docs,
plus if we make them yellow no one will want to change them
anyhow.
2001-06-29 01:59:02 +00:00
|
|
|
|
case GDK_KP_Down:
|
1998-09-27 18:32:00 +00:00
|
|
|
|
case GDK_Down:
|
|
|
|
|
return_val = TRUE;
|
|
|
|
|
if (event->state & GDK_CONTROL_MASK)
|
2005-05-11 19:16:19 +00:00
|
|
|
|
calendar_set_year_next (calendar);
|
1998-09-27 18:32:00 +00:00
|
|
|
|
else
|
|
|
|
|
{
|
1998-10-05 03:52:48 +00:00
|
|
|
|
if (calendar->focus_row < 5)
|
2003-08-08 22:17:34 +00:00
|
|
|
|
calendar->focus_row++;
|
2007-01-19 03:52:03 +00:00
|
|
|
|
if (calendar->focus_col < 0)
|
|
|
|
|
calendar->focus_col = 0;
|
2005-05-11 19:16:19 +00:00
|
|
|
|
calendar_invalidate_day (calendar, old_focus_row, old_focus_col);
|
|
|
|
|
calendar_invalidate_day (calendar, calendar->focus_row,
|
|
|
|
|
calendar->focus_col);
|
1998-09-27 18:32:00 +00:00
|
|
|
|
}
|
|
|
|
|
break;
|
Clip the retrieved image data to the screen, using a server grab to avoid
2001-06-28 Havoc Pennington <hp@pobox.com>
* gdk/x11/gdkimage-x11.c (_gdk_x11_get_image): Clip the retrieved
image data to the screen, using a server grab to avoid race
conditions.
* gtk/gtkitemfactory.c (gtk_item_factory_create_item): remove
check for NULL return from gtk_image_new_from_stock(), it never
returns NULL.
(gtk_item_factory_create_item): fix bug where we parsed the stock
ID as an inline pixbuf
* gtk/gtktext.c (gtk_text_key_press): numeric keypad support
* gtk/gtkspinbutton.c (gtk_spin_button_key_press): numeric keypad
support (should be using binding set here)
* gtk/gtkoptionmenu.c (gtk_option_menu_key_press): numeric keypad
support (should be using binding set here)
* gtk/gtkmenushell.c (gtk_menu_shell_class_init): numeric keypad
support
* gtk/gtkmenu.c (gtk_menu_class_init): numeric keypad support
* gtk/gtkmenubar.c (gtk_menu_bar_class_init): numeric keypad
* gtk/gtklistitem.c (gtk_list_item_class_init): numeric keypad
* gtk/gtkimcontextsimple.c
(gtk_im_context_simple_filter_keypress): keypad
* gtk/gtkfilesel.c (gtk_file_selection_key_press): keypad
* gtk/gtkentry.c (gtk_entry_class_init): numeric keypad fixes
* gtk/gtkctree.c (gtk_ctree_class_init): numeric keypad support
* gtk/gtkcolorsel.c (palette_activate): keypad support (of course,
should be binding-setted)
* gtk/gtkwindow.c (gtk_window_class_init): numeric keypad fixes
* gtk/gtkclist.c (gtk_clist_class_init): numeric keypad fixes
* gtk/gtkcalendar.c: numeric keypad fixes
* gtk/gtktextview.c (gtk_text_view_class_init): numeric keypad
support
* gdk/gdkwindow.c (gdk_window_get_clip_region): fix infinite loop
screwup
* gdk/gdkpixbuf-render.c (gdk_pixbuf_render_to_drawable_alpha):
clip the render area to the drawable's clip region in advance,
so we don't get data from the server that we don't need.
* gdk/gdkpixbuf-render.c (gdk_pixbuf_render_to_drawable_alpha):
check return value of gdk_pixbuf_get_from_drawable(), fall back
to bilevel alpha if we can't get the pixbuf to composite against.
* gdk/gdkdraw.c (gdk_drawable_get_image): set the image colormap
* gdk/gdkimage.c (gdk_image_get_colormap): add
gdk_image_set_colormap, gdk_image_get_colormap
* gdk/gdkpixbuf-drawable.c (rgbconvert): Change all converters to
take a region of the image, instead of converting the entire
image.
* gtk/gtkwidget.h (struct _GtkWidgetClass): add show_help
keybinding signal. Add default bindings for it. Add default
handler for show_help that shows the tooltip for the widget.
* gtk/gtkdialog.c (gtk_dialog_class_init): add binding set and
"close" keybinding signal, remove key press handler.
* gtk/gtktooltips.c (gtk_tooltips_set_colors): Just remove this,
it's not our usual practice to leave a deprecated function around
with a runtime warning, plus we don't want it to appear in docs,
plus if we make them yellow no one will want to change them
anyhow.
2001-06-29 01:59:02 +00:00
|
|
|
|
case GDK_KP_Space:
|
1998-10-05 03:52:48 +00:00
|
|
|
|
case GDK_space:
|
|
|
|
|
row = calendar->focus_row;
|
|
|
|
|
col = calendar->focus_col;
|
|
|
|
|
|
|
|
|
|
if (row > -1 && col > -1)
|
|
|
|
|
{
|
2001-03-24 06:10:40 +00:00
|
|
|
|
return_val = TRUE;
|
1998-10-05 03:52:48 +00:00
|
|
|
|
|
2006-04-16 05:01:46 +00:00
|
|
|
|
day = calendar->day[row][col];
|
1998-10-05 03:52:48 +00:00
|
|
|
|
if (calendar->day_month[row][col] == MONTH_PREV)
|
2005-05-11 19:16:19 +00:00
|
|
|
|
calendar_set_month_prev (calendar);
|
1998-10-05 03:52:48 +00:00
|
|
|
|
else if (calendar->day_month[row][col] == MONTH_NEXT)
|
2005-05-11 19:16:19 +00:00
|
|
|
|
calendar_set_month_next (calendar);
|
1998-10-05 03:52:48 +00:00
|
|
|
|
|
2005-05-11 19:16:19 +00:00
|
|
|
|
calendar_select_and_focus_day (calendar, day);
|
1998-10-05 03:52:48 +00:00
|
|
|
|
}
|
1998-10-01 13:24:42 +00:00
|
|
|
|
}
|
|
|
|
|
|
1998-09-27 18:32:00 +00:00
|
|
|
|
return return_val;
|
|
|
|
|
}
|
2003-05-08 00:25:51 +00:00
|
|
|
|
|
2005-05-11 19:16:19 +00:00
|
|
|
|
|
|
|
|
|
/****************************************
|
|
|
|
|
* Misc widget methods *
|
|
|
|
|
****************************************/
|
2003-05-08 00:25:51 +00:00
|
|
|
|
|
2005-05-11 19:16:19 +00:00
|
|
|
|
static void
|
|
|
|
|
calendar_set_background (GtkWidget *widget)
|
2003-05-08 00:25:51 +00:00
|
|
|
|
{
|
2005-05-11 19:16:19 +00:00
|
|
|
|
GtkCalendarPrivate *priv = GTK_CALENDAR_GET_PRIVATE (widget);
|
|
|
|
|
gint i;
|
|
|
|
|
|
|
|
|
|
if (GTK_WIDGET_REALIZED (widget))
|
|
|
|
|
{
|
|
|
|
|
for (i = 0; i < 4; i++)
|
|
|
|
|
{
|
|
|
|
|
if (priv->arrow_win[i])
|
|
|
|
|
gdk_window_set_background (priv->arrow_win[i],
|
|
|
|
|
HEADER_BG_COLOR (widget));
|
|
|
|
|
}
|
|
|
|
|
if (priv->header_win)
|
|
|
|
|
gdk_window_set_background (priv->header_win,
|
|
|
|
|
HEADER_BG_COLOR (widget));
|
|
|
|
|
if (priv->day_name_win)
|
|
|
|
|
gdk_window_set_background (priv->day_name_win,
|
|
|
|
|
BACKGROUND_COLOR (widget));
|
|
|
|
|
if (priv->week_win)
|
|
|
|
|
gdk_window_set_background (priv->week_win,
|
|
|
|
|
BACKGROUND_COLOR (widget));
|
|
|
|
|
if (priv->main_win)
|
|
|
|
|
gdk_window_set_background (priv->main_win,
|
|
|
|
|
BACKGROUND_COLOR (widget));
|
|
|
|
|
if (widget->window)
|
|
|
|
|
gdk_window_set_background (widget->window,
|
|
|
|
|
BACKGROUND_COLOR (widget));
|
|
|
|
|
}
|
|
|
|
|
}
|
2003-05-08 00:25:51 +00:00
|
|
|
|
|
2005-05-11 19:16:19 +00:00
|
|
|
|
static void
|
|
|
|
|
gtk_calendar_style_set (GtkWidget *widget,
|
|
|
|
|
GtkStyle *previous_style)
|
|
|
|
|
{
|
|
|
|
|
if (previous_style && GTK_WIDGET_REALIZED (widget))
|
|
|
|
|
calendar_set_background (widget);
|
|
|
|
|
}
|
2003-05-08 00:25:51 +00:00
|
|
|
|
|
2005-05-11 19:16:19 +00:00
|
|
|
|
static void
|
|
|
|
|
gtk_calendar_state_changed (GtkWidget *widget,
|
|
|
|
|
GtkStateType previous_state)
|
|
|
|
|
{
|
|
|
|
|
GtkCalendar *calendar = GTK_CALENDAR (widget);
|
|
|
|
|
GtkCalendarPrivate *priv = GTK_CALENDAR_GET_PRIVATE (widget);
|
|
|
|
|
int i;
|
|
|
|
|
|
|
|
|
|
if (!GTK_WIDGET_IS_SENSITIVE (widget))
|
2003-05-08 00:25:51 +00:00
|
|
|
|
{
|
2005-05-11 19:16:19 +00:00
|
|
|
|
priv->in_drag = 0;
|
|
|
|
|
calendar_stop_spinning (calendar);
|
2003-05-08 00:25:51 +00:00
|
|
|
|
}
|
2005-05-11 19:16:19 +00:00
|
|
|
|
|
|
|
|
|
for (i = 0; i < 4; i++)
|
|
|
|
|
if (GTK_WIDGET_IS_SENSITIVE (widget))
|
|
|
|
|
priv->arrow_state[i] = GTK_STATE_NORMAL;
|
|
|
|
|
else
|
|
|
|
|
priv->arrow_state[i] = GTK_STATE_INSENSITIVE;
|
|
|
|
|
|
|
|
|
|
calendar_set_background (widget);
|
2003-05-08 00:25:51 +00:00
|
|
|
|
}
|
|
|
|
|
|
2005-05-11 19:16:19 +00:00
|
|
|
|
static void
|
|
|
|
|
gtk_calendar_grab_notify (GtkWidget *widget,
|
|
|
|
|
gboolean was_grabbed)
|
2003-05-08 00:25:51 +00:00
|
|
|
|
{
|
2005-05-11 19:16:19 +00:00
|
|
|
|
if (!was_grabbed)
|
|
|
|
|
calendar_stop_spinning (GTK_CALENDAR (widget));
|
|
|
|
|
}
|
2003-05-08 00:25:51 +00:00
|
|
|
|
|
2005-05-11 19:16:19 +00:00
|
|
|
|
static gboolean
|
|
|
|
|
gtk_calendar_focus_out (GtkWidget *widget,
|
|
|
|
|
GdkEventFocus *event)
|
|
|
|
|
{
|
|
|
|
|
GtkCalendarPrivate *priv = GTK_CALENDAR_GET_PRIVATE (widget);
|
2007-12-28 09:26:38 +00:00
|
|
|
|
GtkCalendar *calendar = GTK_CALENDAR (widget);
|
2003-05-08 00:25:51 +00:00
|
|
|
|
|
2007-12-28 09:26:38 +00:00
|
|
|
|
calendar_queue_refresh (calendar);
|
|
|
|
|
calendar_stop_spinning (calendar);
|
2005-05-11 19:16:19 +00:00
|
|
|
|
|
|
|
|
|
priv->in_drag = 0;
|
2003-05-08 00:25:51 +00:00
|
|
|
|
|
2005-05-11 19:16:19 +00:00
|
|
|
|
return FALSE;
|
2003-05-08 00:25:51 +00:00
|
|
|
|
}
|
2003-08-08 23:01:17 +00:00
|
|
|
|
|
2005-05-11 19:16:19 +00:00
|
|
|
|
|
|
|
|
|
/****************************************
|
|
|
|
|
* Drag and Drop *
|
|
|
|
|
****************************************/
|
|
|
|
|
|
2003-08-08 23:01:17 +00:00
|
|
|
|
static void
|
|
|
|
|
gtk_calendar_drag_data_get (GtkWidget *widget,
|
|
|
|
|
GdkDragContext *context,
|
|
|
|
|
GtkSelectionData *selection_data,
|
|
|
|
|
guint info,
|
|
|
|
|
guint time)
|
|
|
|
|
{
|
|
|
|
|
GtkCalendar *calendar = GTK_CALENDAR (widget);
|
|
|
|
|
GDate *date;
|
|
|
|
|
gchar str[128];
|
|
|
|
|
gsize len;
|
|
|
|
|
|
2004-07-04 05:31:45 +00:00
|
|
|
|
date = g_date_new_dmy (calendar->selected_day, calendar->month + 1, calendar->year);
|
2003-08-08 23:01:17 +00:00
|
|
|
|
len = g_date_strftime (str, 127, "%x", date);
|
|
|
|
|
gtk_selection_data_set_text (selection_data, str, len);
|
|
|
|
|
|
|
|
|
|
g_free (date);
|
|
|
|
|
}
|
|
|
|
|
|
2005-05-11 19:16:19 +00:00
|
|
|
|
/* Get/set whether drag_motion requested the drag data and
|
|
|
|
|
* drag_data_received should thus not actually insert the data,
|
|
|
|
|
* since the data doesn't result from a drop.
|
|
|
|
|
*/
|
|
|
|
|
static void
|
|
|
|
|
set_status_pending (GdkDragContext *context,
|
|
|
|
|
GdkDragAction suggested_action)
|
|
|
|
|
{
|
|
|
|
|
g_object_set_data (G_OBJECT (context),
|
2005-09-01 05:11:46 +00:00
|
|
|
|
I_("gtk-calendar-status-pending"),
|
2005-05-11 19:16:19 +00:00
|
|
|
|
GINT_TO_POINTER (suggested_action));
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
static GdkDragAction
|
|
|
|
|
get_status_pending (GdkDragContext *context)
|
|
|
|
|
{
|
|
|
|
|
return GPOINTER_TO_INT (g_object_get_data (G_OBJECT (context),
|
|
|
|
|
"gtk-calendar-status-pending"));
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
static void
|
|
|
|
|
gtk_calendar_drag_leave (GtkWidget *widget,
|
|
|
|
|
GdkDragContext *context,
|
|
|
|
|
guint time)
|
|
|
|
|
{
|
|
|
|
|
GtkCalendarPrivate *priv = GTK_CALENDAR_GET_PRIVATE (widget);
|
|
|
|
|
|
|
|
|
|
priv->drag_highlight = 0;
|
|
|
|
|
gtk_drag_unhighlight (widget);
|
|
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
static gboolean
|
|
|
|
|
gtk_calendar_drag_motion (GtkWidget *widget,
|
|
|
|
|
GdkDragContext *context,
|
|
|
|
|
gint x,
|
|
|
|
|
gint y,
|
|
|
|
|
guint time)
|
|
|
|
|
{
|
|
|
|
|
GtkCalendarPrivate *priv = GTK_CALENDAR_GET_PRIVATE (widget);
|
|
|
|
|
GdkAtom target;
|
|
|
|
|
|
|
|
|
|
if (!priv->drag_highlight)
|
|
|
|
|
{
|
|
|
|
|
priv->drag_highlight = 1;
|
|
|
|
|
gtk_drag_highlight (widget);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
target = gtk_drag_dest_find_target (widget, context, NULL);
|
2006-05-18 19:26:02 +00:00
|
|
|
|
if (target == GDK_NONE || context->suggested_action == 0)
|
2005-05-11 19:16:19 +00:00
|
|
|
|
gdk_drag_status (context, 0, time);
|
|
|
|
|
else
|
|
|
|
|
{
|
|
|
|
|
set_status_pending (context, context->suggested_action);
|
|
|
|
|
gtk_drag_get_data (widget, context, target, time);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
return TRUE;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
static gboolean
|
|
|
|
|
gtk_calendar_drag_drop (GtkWidget *widget,
|
|
|
|
|
GdkDragContext *context,
|
|
|
|
|
gint x,
|
|
|
|
|
gint y,
|
|
|
|
|
guint time)
|
|
|
|
|
{
|
|
|
|
|
GdkAtom target;
|
|
|
|
|
|
|
|
|
|
target = gtk_drag_dest_find_target (widget, context, NULL);
|
|
|
|
|
if (target != GDK_NONE)
|
|
|
|
|
{
|
|
|
|
|
gtk_drag_get_data (widget, context,
|
|
|
|
|
target,
|
|
|
|
|
time);
|
|
|
|
|
return TRUE;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
return FALSE;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
static void
|
|
|
|
|
gtk_calendar_drag_data_received (GtkWidget *widget,
|
|
|
|
|
GdkDragContext *context,
|
|
|
|
|
gint x,
|
|
|
|
|
gint y,
|
|
|
|
|
GtkSelectionData *selection_data,
|
|
|
|
|
guint info,
|
|
|
|
|
guint time)
|
|
|
|
|
{
|
|
|
|
|
GtkCalendar *calendar = GTK_CALENDAR (widget);
|
|
|
|
|
guint day, month, year;
|
|
|
|
|
gchar *str;
|
|
|
|
|
GDate *date;
|
|
|
|
|
GdkDragAction suggested_action;
|
|
|
|
|
|
|
|
|
|
suggested_action = get_status_pending (context);
|
|
|
|
|
|
|
|
|
|
if (suggested_action)
|
|
|
|
|
{
|
|
|
|
|
set_status_pending (context, 0);
|
|
|
|
|
|
|
|
|
|
/* We are getting this data due to a request in drag_motion,
|
|
|
|
|
* rather than due to a request in drag_drop, so we are just
|
|
|
|
|
* supposed to call drag_status, not actually paste in the
|
|
|
|
|
* data.
|
|
|
|
|
*/
|
2007-12-19 22:57:01 +00:00
|
|
|
|
str = (gchar*) gtk_selection_data_get_text (selection_data);
|
|
|
|
|
|
2005-05-11 19:16:19 +00:00
|
|
|
|
if (str)
|
|
|
|
|
{
|
|
|
|
|
date = g_date_new ();
|
|
|
|
|
g_date_set_parse (date, str);
|
|
|
|
|
if (!g_date_valid (date))
|
|
|
|
|
suggested_action = 0;
|
|
|
|
|
g_date_free (date);
|
|
|
|
|
g_free (str);
|
|
|
|
|
}
|
|
|
|
|
else
|
|
|
|
|
suggested_action = 0;
|
|
|
|
|
|
|
|
|
|
gdk_drag_status (context, suggested_action, time);
|
|
|
|
|
|
|
|
|
|
return;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
date = g_date_new ();
|
2007-12-19 22:57:01 +00:00
|
|
|
|
str = (gchar*) gtk_selection_data_get_text (selection_data);
|
2005-05-11 19:16:19 +00:00
|
|
|
|
if (str)
|
|
|
|
|
{
|
|
|
|
|
g_date_set_parse (date, str);
|
|
|
|
|
g_free (str);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
if (!g_date_valid (date))
|
|
|
|
|
{
|
|
|
|
|
g_warning ("Received invalid date data\n");
|
|
|
|
|
g_date_free (date);
|
|
|
|
|
gtk_drag_finish (context, FALSE, FALSE, time);
|
|
|
|
|
return;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
day = g_date_get_day (date);
|
|
|
|
|
month = g_date_get_month (date);
|
|
|
|
|
year = g_date_get_year (date);
|
|
|
|
|
g_date_free (date);
|
|
|
|
|
|
|
|
|
|
gtk_drag_finish (context, TRUE, FALSE, time);
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
g_object_freeze_notify (G_OBJECT (calendar));
|
|
|
|
|
if (!(calendar->display_flags & GTK_CALENDAR_NO_MONTH_CHANGE)
|
|
|
|
|
&& (calendar->display_flags & GTK_CALENDAR_SHOW_HEADING))
|
|
|
|
|
gtk_calendar_select_month (calendar, month - 1, year);
|
|
|
|
|
gtk_calendar_select_day (calendar, day);
|
|
|
|
|
g_object_thaw_notify (G_OBJECT (calendar));
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
/****************************************
|
|
|
|
|
* Public API *
|
|
|
|
|
****************************************/
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
|
* gtk_calendar_new:
|
|
|
|
|
*
|
|
|
|
|
* Creates a new calendar, with the current date being selected.
|
|
|
|
|
*
|
|
|
|
|
* Return value: a newly #GtkCalendar widget
|
|
|
|
|
**/
|
|
|
|
|
GtkWidget*
|
|
|
|
|
gtk_calendar_new (void)
|
|
|
|
|
{
|
|
|
|
|
return g_object_new (GTK_TYPE_CALENDAR, NULL);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
|
* gtk_calendar_display_options:
|
|
|
|
|
* @calendar: a #GtkCalendar.
|
|
|
|
|
* @flags: the display options to set.
|
|
|
|
|
*
|
|
|
|
|
* Sets display options (whether to display the heading and the month headings).
|
|
|
|
|
*
|
2005-12-20 05:36:10 +00:00
|
|
|
|
* Deprecated: 2.4: Use gtk_calendar_set_display_options() instead
|
2005-05-11 19:16:19 +00:00
|
|
|
|
**/
|
|
|
|
|
void
|
|
|
|
|
gtk_calendar_display_options (GtkCalendar *calendar,
|
|
|
|
|
GtkCalendarDisplayOptions flags)
|
|
|
|
|
{
|
|
|
|
|
gtk_calendar_set_display_options (calendar, flags);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
|
* gtk_calendar_get_display_options:
|
|
|
|
|
* @calendar: a #GtkCalendar
|
|
|
|
|
*
|
|
|
|
|
* Returns the current display options of @calendar.
|
|
|
|
|
*
|
|
|
|
|
* Return value: the display options.
|
|
|
|
|
*
|
|
|
|
|
* Since: 2.4
|
|
|
|
|
**/
|
|
|
|
|
GtkCalendarDisplayOptions
|
|
|
|
|
gtk_calendar_get_display_options (GtkCalendar *calendar)
|
|
|
|
|
{
|
|
|
|
|
g_return_val_if_fail (GTK_IS_CALENDAR (calendar), 0);
|
|
|
|
|
|
|
|
|
|
return calendar->display_flags;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
|
* gtk_calendar_set_display_options:
|
|
|
|
|
* @calendar: a #GtkCalendar
|
|
|
|
|
* @flags: the display options to set
|
|
|
|
|
*
|
|
|
|
|
* Sets display options (whether to display the heading and the month
|
|
|
|
|
* headings).
|
|
|
|
|
*
|
|
|
|
|
* Since: 2.4
|
|
|
|
|
**/
|
|
|
|
|
void
|
|
|
|
|
gtk_calendar_set_display_options (GtkCalendar *calendar,
|
|
|
|
|
GtkCalendarDisplayOptions flags)
|
|
|
|
|
{
|
|
|
|
|
GtkWidget *widget = GTK_WIDGET (calendar);
|
|
|
|
|
GtkCalendarPrivate *priv = GTK_CALENDAR_GET_PRIVATE (calendar);
|
|
|
|
|
gint resize = 0;
|
|
|
|
|
gint i;
|
|
|
|
|
GtkCalendarDisplayOptions old_flags;
|
|
|
|
|
|
|
|
|
|
g_return_if_fail (GTK_IS_CALENDAR (calendar));
|
|
|
|
|
|
|
|
|
|
old_flags = calendar->display_flags;
|
|
|
|
|
|
|
|
|
|
if (GTK_WIDGET_REALIZED (widget))
|
|
|
|
|
{
|
|
|
|
|
if ((flags ^ calendar->display_flags) & GTK_CALENDAR_NO_MONTH_CHANGE)
|
|
|
|
|
{
|
|
|
|
|
resize ++;
|
|
|
|
|
if (! (flags & GTK_CALENDAR_NO_MONTH_CHANGE)
|
|
|
|
|
&& (priv->header_win))
|
|
|
|
|
{
|
|
|
|
|
calendar->display_flags &= ~GTK_CALENDAR_NO_MONTH_CHANGE;
|
|
|
|
|
calendar_realize_arrows (calendar);
|
|
|
|
|
}
|
|
|
|
|
else
|
|
|
|
|
{
|
|
|
|
|
for (i = 0; i < 4; i++)
|
|
|
|
|
{
|
|
|
|
|
if (priv->arrow_win[i])
|
|
|
|
|
{
|
|
|
|
|
gdk_window_set_user_data (priv->arrow_win[i],
|
|
|
|
|
NULL);
|
|
|
|
|
gdk_window_destroy (priv->arrow_win[i]);
|
|
|
|
|
priv->arrow_win[i] = NULL;
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
if ((flags ^ calendar->display_flags) & GTK_CALENDAR_SHOW_HEADING)
|
|
|
|
|
{
|
|
|
|
|
resize++;
|
|
|
|
|
|
|
|
|
|
if (flags & GTK_CALENDAR_SHOW_HEADING)
|
|
|
|
|
{
|
|
|
|
|
calendar->display_flags |= GTK_CALENDAR_SHOW_HEADING;
|
|
|
|
|
calendar_realize_header (calendar);
|
|
|
|
|
}
|
|
|
|
|
else
|
|
|
|
|
{
|
|
|
|
|
for (i = 0; i < 4; i++)
|
|
|
|
|
{
|
|
|
|
|
if (priv->arrow_win[i])
|
|
|
|
|
{
|
|
|
|
|
gdk_window_set_user_data (priv->arrow_win[i],
|
|
|
|
|
NULL);
|
|
|
|
|
gdk_window_destroy (priv->arrow_win[i]);
|
|
|
|
|
priv->arrow_win[i] = NULL;
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
gdk_window_set_user_data (priv->header_win, NULL);
|
|
|
|
|
gdk_window_destroy (priv->header_win);
|
|
|
|
|
priv->header_win = NULL;
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
if ((flags ^ calendar->display_flags) & GTK_CALENDAR_SHOW_DAY_NAMES)
|
|
|
|
|
{
|
|
|
|
|
resize++;
|
|
|
|
|
|
|
|
|
|
if (flags & GTK_CALENDAR_SHOW_DAY_NAMES)
|
|
|
|
|
{
|
|
|
|
|
calendar->display_flags |= GTK_CALENDAR_SHOW_DAY_NAMES;
|
|
|
|
|
calendar_realize_day_names (calendar);
|
|
|
|
|
}
|
|
|
|
|
else
|
|
|
|
|
{
|
|
|
|
|
gdk_window_set_user_data (priv->day_name_win, NULL);
|
|
|
|
|
gdk_window_destroy (priv->day_name_win);
|
|
|
|
|
priv->day_name_win = NULL;
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
if ((flags ^ calendar->display_flags) & GTK_CALENDAR_SHOW_WEEK_NUMBERS)
|
|
|
|
|
{
|
|
|
|
|
resize++;
|
|
|
|
|
|
|
|
|
|
if (flags & GTK_CALENDAR_SHOW_WEEK_NUMBERS)
|
|
|
|
|
{
|
|
|
|
|
calendar->display_flags |= GTK_CALENDAR_SHOW_WEEK_NUMBERS;
|
|
|
|
|
calendar_realize_week_numbers (calendar);
|
|
|
|
|
}
|
|
|
|
|
else
|
|
|
|
|
{
|
|
|
|
|
gdk_window_set_user_data (priv->week_win, NULL);
|
|
|
|
|
gdk_window_destroy (priv->week_win);
|
|
|
|
|
priv->week_win = NULL;
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
if ((flags ^ calendar->display_flags) & GTK_CALENDAR_WEEK_START_MONDAY)
|
|
|
|
|
g_warning ("GTK_CALENDAR_WEEK_START_MONDAY is ignored; the first day of the week is determined from the locale");
|
|
|
|
|
|
2007-12-28 09:39:34 +00:00
|
|
|
|
if ((flags ^ calendar->display_flags) & GTK_CALENDAR_SHOW_DETAILS)
|
|
|
|
|
resize++;
|
|
|
|
|
|
2005-05-11 19:16:19 +00:00
|
|
|
|
calendar->display_flags = flags;
|
|
|
|
|
if (resize)
|
|
|
|
|
gtk_widget_queue_resize (GTK_WIDGET (calendar));
|
|
|
|
|
|
|
|
|
|
}
|
|
|
|
|
else
|
|
|
|
|
calendar->display_flags = flags;
|
|
|
|
|
|
|
|
|
|
g_object_freeze_notify (G_OBJECT (calendar));
|
|
|
|
|
if ((old_flags ^ calendar->display_flags) & GTK_CALENDAR_SHOW_HEADING)
|
|
|
|
|
g_object_notify (G_OBJECT (calendar), "show-heading");
|
|
|
|
|
if ((old_flags ^ calendar->display_flags) & GTK_CALENDAR_SHOW_DAY_NAMES)
|
|
|
|
|
g_object_notify (G_OBJECT (calendar), "show-day-names");
|
|
|
|
|
if ((old_flags ^ calendar->display_flags) & GTK_CALENDAR_NO_MONTH_CHANGE)
|
|
|
|
|
g_object_notify (G_OBJECT (calendar), "no-month-change");
|
|
|
|
|
if ((old_flags ^ calendar->display_flags) & GTK_CALENDAR_SHOW_WEEK_NUMBERS)
|
|
|
|
|
g_object_notify (G_OBJECT (calendar), "show-week-numbers");
|
|
|
|
|
g_object_thaw_notify (G_OBJECT (calendar));
|
2003-08-08 23:01:17 +00:00
|
|
|
|
}
|
|
|
|
|
|
2005-05-11 19:16:19 +00:00
|
|
|
|
/**
|
|
|
|
|
* gtk_calendar_select_month:
|
|
|
|
|
* @calendar: a #GtkCalendar
|
|
|
|
|
* @month: a month number between 0 and 11.
|
|
|
|
|
* @year: the year the month is in.
|
|
|
|
|
*
|
|
|
|
|
* Shifts the calendar to a different month.
|
|
|
|
|
*
|
|
|
|
|
* Return value: %TRUE, always
|
|
|
|
|
**/
|
|
|
|
|
gboolean
|
|
|
|
|
gtk_calendar_select_month (GtkCalendar *calendar,
|
|
|
|
|
guint month,
|
|
|
|
|
guint year)
|
2003-08-08 23:01:17 +00:00
|
|
|
|
{
|
2005-05-11 19:16:19 +00:00
|
|
|
|
g_return_val_if_fail (GTK_IS_CALENDAR (calendar), FALSE);
|
|
|
|
|
g_return_val_if_fail (month <= 11, FALSE);
|
|
|
|
|
|
|
|
|
|
calendar->month = month;
|
|
|
|
|
calendar->year = year;
|
|
|
|
|
|
|
|
|
|
calendar_compute_days (calendar);
|
2007-12-28 09:26:38 +00:00
|
|
|
|
calendar_queue_refresh (calendar);
|
2003-08-08 23:01:17 +00:00
|
|
|
|
|
2005-05-11 19:16:19 +00:00
|
|
|
|
g_object_freeze_notify (G_OBJECT (calendar));
|
|
|
|
|
g_object_notify (G_OBJECT (calendar), "month");
|
|
|
|
|
g_object_notify (G_OBJECT (calendar), "year");
|
|
|
|
|
g_object_thaw_notify (G_OBJECT (calendar));
|
2003-08-08 23:01:17 +00:00
|
|
|
|
|
2005-05-11 19:16:19 +00:00
|
|
|
|
g_signal_emit (calendar,
|
|
|
|
|
gtk_calendar_signals[MONTH_CHANGED_SIGNAL],
|
|
|
|
|
0);
|
|
|
|
|
return TRUE;
|
2003-08-08 23:01:17 +00:00
|
|
|
|
}
|
|
|
|
|
|
2005-05-11 19:16:19 +00:00
|
|
|
|
/**
|
|
|
|
|
* gtk_calendar_select_day:
|
|
|
|
|
* @calendar: a #GtkCalendar.
|
|
|
|
|
* @day: the day number between 1 and 31, or 0 to unselect
|
|
|
|
|
* the currently selected day.
|
|
|
|
|
*
|
|
|
|
|
* Selects a day from the current month.
|
|
|
|
|
**/
|
|
|
|
|
void
|
|
|
|
|
gtk_calendar_select_day (GtkCalendar *calendar,
|
|
|
|
|
guint day)
|
2003-08-08 23:01:17 +00:00
|
|
|
|
{
|
2005-05-11 19:16:19 +00:00
|
|
|
|
g_return_if_fail (GTK_IS_CALENDAR (calendar));
|
|
|
|
|
g_return_if_fail (day <= 31);
|
2003-08-08 23:01:17 +00:00
|
|
|
|
|
2005-05-11 19:16:19 +00:00
|
|
|
|
/* Deselect the old day */
|
|
|
|
|
if (calendar->selected_day > 0)
|
2003-08-08 23:01:17 +00:00
|
|
|
|
{
|
2005-05-11 19:16:19 +00:00
|
|
|
|
gint selected_day;
|
|
|
|
|
|
|
|
|
|
selected_day = calendar->selected_day;
|
|
|
|
|
calendar->selected_day = 0;
|
|
|
|
|
if (GTK_WIDGET_DRAWABLE (GTK_WIDGET (calendar)))
|
|
|
|
|
calendar_invalidate_day_num (calendar, selected_day);
|
2003-08-08 23:01:17 +00:00
|
|
|
|
}
|
|
|
|
|
|
2005-05-11 19:16:19 +00:00
|
|
|
|
calendar->selected_day = day;
|
2003-08-08 23:01:17 +00:00
|
|
|
|
|
2005-05-11 19:16:19 +00:00
|
|
|
|
/* Select the new day */
|
|
|
|
|
if (day != 0)
|
|
|
|
|
{
|
|
|
|
|
if (GTK_WIDGET_DRAWABLE (GTK_WIDGET (calendar)))
|
|
|
|
|
calendar_invalidate_day_num (calendar, day);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
g_object_notify (G_OBJECT (calendar), "day");
|
|
|
|
|
|
|
|
|
|
g_signal_emit (calendar,
|
|
|
|
|
gtk_calendar_signals[DAY_SELECTED_SIGNAL],
|
|
|
|
|
0);
|
2003-08-08 23:01:17 +00:00
|
|
|
|
}
|
|
|
|
|
|
2005-05-11 19:16:19 +00:00
|
|
|
|
/**
|
|
|
|
|
* gtk_calendar_clear_marks:
|
|
|
|
|
* @calendar: a #GtkCalendar
|
|
|
|
|
*
|
|
|
|
|
* Remove all visual markers.
|
|
|
|
|
**/
|
|
|
|
|
void
|
|
|
|
|
gtk_calendar_clear_marks (GtkCalendar *calendar)
|
2003-08-08 23:01:17 +00:00
|
|
|
|
{
|
2005-05-11 19:16:19 +00:00
|
|
|
|
guint day;
|
|
|
|
|
|
|
|
|
|
g_return_if_fail (GTK_IS_CALENDAR (calendar));
|
|
|
|
|
|
|
|
|
|
for (day = 0; day < 31; day++)
|
2003-08-08 23:01:17 +00:00
|
|
|
|
{
|
2005-05-11 19:16:19 +00:00
|
|
|
|
calendar->marked_date[day] = FALSE;
|
2003-08-08 23:01:17 +00:00
|
|
|
|
}
|
|
|
|
|
|
2005-06-15 03:54:10 +00:00
|
|
|
|
calendar->num_marked_dates = 0;
|
2007-12-28 09:26:38 +00:00
|
|
|
|
calendar_queue_refresh (calendar);
|
2003-08-08 23:01:17 +00:00
|
|
|
|
}
|
|
|
|
|
|
2005-05-11 19:16:19 +00:00
|
|
|
|
/**
|
|
|
|
|
* gtk_calendar_mark_day:
|
|
|
|
|
* @calendar: a #GtkCalendar
|
|
|
|
|
* @day: the day number to mark between 1 and 31.
|
|
|
|
|
*
|
|
|
|
|
* Places a visual marker on a particular day.
|
|
|
|
|
*
|
|
|
|
|
* Return value: %TRUE, always
|
|
|
|
|
**/
|
|
|
|
|
gboolean
|
|
|
|
|
gtk_calendar_mark_day (GtkCalendar *calendar,
|
|
|
|
|
guint day)
|
2003-08-08 23:01:17 +00:00
|
|
|
|
{
|
2005-05-11 19:16:19 +00:00
|
|
|
|
g_return_val_if_fail (GTK_IS_CALENDAR (calendar), FALSE);
|
|
|
|
|
|
|
|
|
|
if (day >= 1 && day <= 31 && calendar->marked_date[day-1] == FALSE)
|
2003-08-08 23:01:17 +00:00
|
|
|
|
{
|
2005-05-11 19:16:19 +00:00
|
|
|
|
calendar->marked_date[day - 1] = TRUE;
|
2005-06-15 03:54:10 +00:00
|
|
|
|
calendar->num_marked_dates++;
|
2005-05-11 19:16:19 +00:00
|
|
|
|
calendar_invalidate_day_num (calendar, day);
|
2003-08-08 23:01:17 +00:00
|
|
|
|
}
|
2005-05-11 19:16:19 +00:00
|
|
|
|
|
|
|
|
|
return TRUE;
|
|
|
|
|
}
|
2003-08-08 23:01:17 +00:00
|
|
|
|
|
2005-05-11 19:16:19 +00:00
|
|
|
|
/**
|
|
|
|
|
* gtk_calendar_unmark_day:
|
|
|
|
|
* @calendar: a #GtkCalendar.
|
|
|
|
|
* @day: the day number to unmark between 1 and 31.
|
|
|
|
|
*
|
|
|
|
|
* Removes the visual marker from a particular day.
|
|
|
|
|
*
|
|
|
|
|
* Return value: %TRUE, always
|
|
|
|
|
**/
|
|
|
|
|
gboolean
|
|
|
|
|
gtk_calendar_unmark_day (GtkCalendar *calendar,
|
|
|
|
|
guint day)
|
|
|
|
|
{
|
|
|
|
|
g_return_val_if_fail (GTK_IS_CALENDAR (calendar), FALSE);
|
2003-08-08 23:01:17 +00:00
|
|
|
|
|
2005-05-11 19:16:19 +00:00
|
|
|
|
if (day >= 1 && day <= 31 && calendar->marked_date[day-1] == TRUE)
|
2003-08-08 23:01:17 +00:00
|
|
|
|
{
|
2005-05-11 19:16:19 +00:00
|
|
|
|
calendar->marked_date[day - 1] = FALSE;
|
2005-06-15 03:54:10 +00:00
|
|
|
|
calendar->num_marked_dates--;
|
2005-05-11 19:16:19 +00:00
|
|
|
|
calendar_invalidate_day_num (calendar, day);
|
2003-08-08 23:01:17 +00:00
|
|
|
|
}
|
2005-05-11 19:16:19 +00:00
|
|
|
|
|
|
|
|
|
return TRUE;
|
|
|
|
|
}
|
2003-08-08 23:01:17 +00:00
|
|
|
|
|
2005-05-11 19:16:19 +00:00
|
|
|
|
/**
|
|
|
|
|
* gtk_calendar_get_date:
|
|
|
|
|
* @calendar: a #GtkCalendar
|
|
|
|
|
* @year: location to store the year number, or %NULL
|
|
|
|
|
* @month: location to store the month number (between 0 and 11), or %NULL
|
|
|
|
|
* @day: location to store the day number (between 1 and 31), or %NULL
|
|
|
|
|
*
|
|
|
|
|
* Obtains the selected date from a #GtkCalendar.
|
|
|
|
|
**/
|
|
|
|
|
void
|
|
|
|
|
gtk_calendar_get_date (GtkCalendar *calendar,
|
|
|
|
|
guint *year,
|
|
|
|
|
guint *month,
|
|
|
|
|
guint *day)
|
|
|
|
|
{
|
|
|
|
|
g_return_if_fail (GTK_IS_CALENDAR (calendar));
|
|
|
|
|
|
|
|
|
|
if (year)
|
|
|
|
|
*year = calendar->year;
|
|
|
|
|
|
|
|
|
|
if (month)
|
|
|
|
|
*month = calendar->month;
|
|
|
|
|
|
|
|
|
|
if (day)
|
|
|
|
|
*day = calendar->selected_day;
|
|
|
|
|
}
|
2003-08-08 23:01:17 +00:00
|
|
|
|
|
2007-12-27 20:41:08 +00:00
|
|
|
|
/**
|
|
|
|
|
* gtk_calendar_set_detail_func:
|
|
|
|
|
* @calendar: a #GtkCalendar.
|
|
|
|
|
* @func: a function providing details for each day.
|
|
|
|
|
* @data: data to pass to @func invokations.
|
|
|
|
|
* @destroy: a function for releasing @data.
|
|
|
|
|
*
|
|
|
|
|
* Installs a function which provides Pango markup with detail information
|
|
|
|
|
* for each day. Examples for such details are holidays or appointments. That
|
|
|
|
|
* information is shown below each day when #GtkCalendar:show-details is set.
|
|
|
|
|
* A tooltip containing with full detail information is provided, if the entire
|
|
|
|
|
* text should not fit into the details area, or if #GtkCalendar:show-details
|
|
|
|
|
* is not set.
|
|
|
|
|
*
|
|
|
|
|
* The size of the details area can be restricted by setting the
|
|
|
|
|
* #GtkCalendar:detail-width-chars and #GtkCalendar:detail-height-rows
|
|
|
|
|
* properties.
|
|
|
|
|
*
|
2008-02-15 23:42:42 +00:00
|
|
|
|
* Since: 2.14
|
2007-12-27 20:41:08 +00:00
|
|
|
|
*/
|
|
|
|
|
void
|
|
|
|
|
gtk_calendar_set_detail_func (GtkCalendar *calendar,
|
|
|
|
|
GtkCalendarDetailFunc func,
|
|
|
|
|
gpointer data,
|
|
|
|
|
GDestroyNotify destroy)
|
|
|
|
|
{
|
|
|
|
|
GtkCalendarPrivate *priv;
|
|
|
|
|
|
|
|
|
|
g_return_if_fail (GTK_IS_CALENDAR (calendar));
|
|
|
|
|
|
|
|
|
|
priv = GTK_CALENDAR_GET_PRIVATE (calendar);
|
|
|
|
|
|
|
|
|
|
if (priv->detail_func_destroy)
|
|
|
|
|
priv->detail_func_destroy (priv->detail_func_user_data);
|
|
|
|
|
|
|
|
|
|
priv->detail_func = func;
|
|
|
|
|
priv->detail_func_user_data = data;
|
|
|
|
|
priv->detail_func_destroy = destroy;
|
|
|
|
|
|
|
|
|
|
gtk_widget_set_has_tooltip (GTK_WIDGET (calendar),
|
|
|
|
|
NULL != priv->detail_func);
|
|
|
|
|
gtk_widget_queue_resize (GTK_WIDGET (calendar));
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
|
* gtk_calendar_set_detail_width_chars:
|
|
|
|
|
* @calendar: a #GtkCalendar.
|
|
|
|
|
* @chars: detail width in characters.
|
|
|
|
|
*
|
|
|
|
|
* Updates the width of detail cells.
|
|
|
|
|
* See #GtkCalendar:detail-width-chars.
|
|
|
|
|
*
|
2008-02-15 23:42:42 +00:00
|
|
|
|
* Since: 2.14
|
2007-12-27 20:41:08 +00:00
|
|
|
|
*/
|
|
|
|
|
void
|
|
|
|
|
gtk_calendar_set_detail_width_chars (GtkCalendar *calendar,
|
|
|
|
|
gint chars)
|
|
|
|
|
{
|
|
|
|
|
GtkCalendarPrivate *priv;
|
|
|
|
|
|
|
|
|
|
g_return_if_fail (GTK_IS_CALENDAR (calendar));
|
|
|
|
|
|
|
|
|
|
priv = GTK_CALENDAR_GET_PRIVATE (calendar);
|
|
|
|
|
|
|
|
|
|
if (chars != priv->detail_width_chars)
|
|
|
|
|
{
|
|
|
|
|
priv->detail_width_chars = chars;
|
|
|
|
|
g_object_notify (G_OBJECT (calendar), "detail-width-chars");
|
|
|
|
|
gtk_widget_queue_resize_no_redraw (GTK_WIDGET (calendar));
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
|
* gtk_calendar_set_detail_height_rows:
|
|
|
|
|
* @calendar: a #GtkCalendar.
|
|
|
|
|
* @rows: detail height in rows.
|
|
|
|
|
*
|
|
|
|
|
* Updates the height of detail cells.
|
|
|
|
|
* See #GtkCalendar:detail-height-rows.
|
|
|
|
|
*
|
2008-02-15 23:42:42 +00:00
|
|
|
|
* Since: 2.14
|
2007-12-27 20:41:08 +00:00
|
|
|
|
*/
|
|
|
|
|
void
|
|
|
|
|
gtk_calendar_set_detail_height_rows (GtkCalendar *calendar,
|
|
|
|
|
gint rows)
|
|
|
|
|
{
|
|
|
|
|
GtkCalendarPrivate *priv;
|
|
|
|
|
|
|
|
|
|
g_return_if_fail (GTK_IS_CALENDAR (calendar));
|
|
|
|
|
|
|
|
|
|
priv = GTK_CALENDAR_GET_PRIVATE (calendar);
|
|
|
|
|
|
|
|
|
|
if (rows != priv->detail_height_rows)
|
|
|
|
|
{
|
|
|
|
|
priv->detail_height_rows = rows;
|
|
|
|
|
g_object_notify (G_OBJECT (calendar), "detail-height-rows");
|
|
|
|
|
gtk_widget_queue_resize_no_redraw (GTK_WIDGET (calendar));
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
|
* gtk_calendar_get_detail_width_chars:
|
|
|
|
|
* @calendar: a #GtkCalendar.
|
|
|
|
|
*
|
|
|
|
|
* Queries the width of detail cells, in characters.
|
|
|
|
|
* See #GtkCalendar:detail-width-chars.
|
|
|
|
|
*
|
2008-02-15 23:42:42 +00:00
|
|
|
|
* Since: 2.14
|
2007-12-27 20:41:08 +00:00
|
|
|
|
*
|
|
|
|
|
* Return value: The width of detail cells, in characters.
|
|
|
|
|
*/
|
|
|
|
|
gint
|
|
|
|
|
gtk_calendar_get_detail_width_chars (GtkCalendar *calendar)
|
|
|
|
|
{
|
|
|
|
|
g_return_val_if_fail (GTK_IS_CALENDAR (calendar), 0);
|
|
|
|
|
return GTK_CALENDAR_GET_PRIVATE (calendar)->detail_width_chars;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
|
* gtk_calendar_get_detail_height_rows:
|
|
|
|
|
* @calendar: a #GtkCalendar.
|
|
|
|
|
*
|
|
|
|
|
* Queries the height of detail cells, in rows.
|
|
|
|
|
* See #GtkCalendar:detail-width-chars.
|
|
|
|
|
*
|
2008-02-15 23:42:42 +00:00
|
|
|
|
* Since: 2.14
|
2007-12-27 20:41:08 +00:00
|
|
|
|
*
|
|
|
|
|
* Return value: The height of detail cells, in rows.
|
|
|
|
|
*/
|
|
|
|
|
gint
|
|
|
|
|
gtk_calendar_get_detail_height_rows (GtkCalendar *calendar)
|
|
|
|
|
{
|
|
|
|
|
g_return_val_if_fail (GTK_IS_CALENDAR (calendar), 0);
|
|
|
|
|
return GTK_CALENDAR_GET_PRIVATE (calendar)->detail_height_rows;
|
|
|
|
|
}
|
|
|
|
|
|
2005-05-11 19:16:19 +00:00
|
|
|
|
/**
|
|
|
|
|
* gtk_calendar_freeze:
|
|
|
|
|
* @calendar: a #GtkCalendar
|
|
|
|
|
*
|
|
|
|
|
* Does nothing. Previously locked the display of the calendar until
|
|
|
|
|
* it was thawed with gtk_calendar_thaw().
|
2005-12-20 05:44:07 +00:00
|
|
|
|
*
|
|
|
|
|
* Deprecated: 2.8:
|
2005-05-11 19:16:19 +00:00
|
|
|
|
**/
|
|
|
|
|
void
|
|
|
|
|
gtk_calendar_freeze (GtkCalendar *calendar)
|
|
|
|
|
{
|
|
|
|
|
g_return_if_fail (GTK_IS_CALENDAR (calendar));
|
|
|
|
|
}
|
2003-08-08 23:01:17 +00:00
|
|
|
|
|
2005-05-11 19:16:19 +00:00
|
|
|
|
/**
|
|
|
|
|
* gtk_calendar_thaw:
|
2005-06-10 04:25:33 +00:00
|
|
|
|
* @calendar: a #GtkCalendar
|
2005-05-11 19:16:19 +00:00
|
|
|
|
*
|
|
|
|
|
* Does nothing. Previously defrosted a calendar; all the changes made
|
|
|
|
|
* since the last gtk_calendar_freeze() were displayed.
|
2005-12-20 05:44:07 +00:00
|
|
|
|
*
|
|
|
|
|
* Deprecated: 2.8:
|
2005-05-11 19:16:19 +00:00
|
|
|
|
**/
|
|
|
|
|
void
|
|
|
|
|
gtk_calendar_thaw (GtkCalendar *calendar)
|
|
|
|
|
{
|
|
|
|
|
g_return_if_fail (GTK_IS_CALENDAR (calendar));
|
2003-08-08 23:01:17 +00:00
|
|
|
|
}
|
2005-03-20 07:01:23 +00:00
|
|
|
|
|
|
|
|
|
#define __GTK_CALENDAR_C__
|
|
|
|
|
#include "gtkaliasdef.c"
|