2008-07-01 22:57:50 +00:00
|
|
|
|
/* GTK - The GIMP Toolkit
|
1998-09-27 18:32:00 +00:00
|
|
|
|
* 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
|
2011-01-24 02:50:39 +00:00
|
|
|
|
*
|
1998-09-27 18:32:00 +00:00
|
|
|
|
* 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
|
2011-01-24 02:50:39 +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
|
2014-10-01 23:30:12 +00:00
|
|
|
|
* License along with this library. If not, see <http://www.gnu.org/licenses/>.
|
1998-09-27 18:32:00 +00:00
|
|
|
|
*/
|
|
|
|
|
|
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
|
2011-01-24 02:50:39 +00:00
|
|
|
|
* GTK+ at ftp://ftp.gtk.org/pub/gtk/.
|
1999-02-24 07:37:18 +00:00
|
|
|
|
*/
|
|
|
|
|
|
2010-07-06 20:06:34 +00:00
|
|
|
|
/**
|
|
|
|
|
* SECTION:gtkcalendar
|
|
|
|
|
* @Short_description: Displays a calendar and allows the user to select a date
|
|
|
|
|
* @Title: GtkCalendar
|
|
|
|
|
*
|
2011-01-04 16:36:42 +00:00
|
|
|
|
* #GtkCalendar is a widget that displays a Gregorian calendar, one month
|
|
|
|
|
* at a time. It can be created with gtk_calendar_new().
|
2010-07-06 20:06:34 +00:00
|
|
|
|
*
|
|
|
|
|
* The month and year currently displayed can be altered with
|
2011-01-04 16:36:42 +00:00
|
|
|
|
* gtk_calendar_select_month(). The exact day can be selected from the
|
|
|
|
|
* displayed month using gtk_calendar_select_day().
|
2010-07-06 20:06:34 +00:00
|
|
|
|
*
|
2011-01-04 16:36:42 +00:00
|
|
|
|
* To place a visual marker on a particular day, use gtk_calendar_mark_day()
|
|
|
|
|
* and to remove the marker, gtk_calendar_unmark_day(). Alternative, all
|
|
|
|
|
* marks can be cleared with gtk_calendar_clear_marks().
|
2010-07-06 20:06:34 +00:00
|
|
|
|
*
|
|
|
|
|
* The way in which the calendar itself is displayed can be altered using
|
|
|
|
|
* gtk_calendar_set_display_options().
|
|
|
|
|
*
|
|
|
|
|
* The selected date can be retrieved from a #GtkCalendar using
|
|
|
|
|
* gtk_calendar_get_date().
|
2011-01-04 16:36:42 +00:00
|
|
|
|
*
|
2014-01-31 16:11:23 +00:00
|
|
|
|
* Users should be aware that, although the Gregorian calendar is the
|
|
|
|
|
* legal calendar in most countries, it was adopted progressively
|
|
|
|
|
* between 1582 and 1929. Display before these dates is likely to be
|
|
|
|
|
* historically incorrect.
|
2010-07-06 20:06:34 +00:00
|
|
|
|
*/
|
|
|
|
|
|
2008-06-22 14:28:52 +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
|
|
|
|
|
|
1998-09-27 18:32:00 +00:00
|
|
|
|
#include "gtkcalendar.h"
|
2003-08-08 23:01:17 +00:00
|
|
|
|
#include "gtkdnd.h"
|
2015-12-13 23:43:10 +00:00
|
|
|
|
#include "gtkdragdest.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"
|
2016-12-23 11:07:22 +00:00
|
|
|
|
#include "gtkrendericonprivate.h"
|
|
|
|
|
#include "gtksnapshot.h"
|
|
|
|
|
#include "gtkstylecontextprivate.h"
|
2017-06-27 18:48:14 +00:00
|
|
|
|
#include "gtkwidgetprivate.h"
|
2017-09-13 15:37:25 +00:00
|
|
|
|
#include "gtkgesturemultipress.h"
|
2017-12-11 03:15:12 +00:00
|
|
|
|
#include "gtkgesturedrag.h"
|
2017-09-15 12:55:19 +00:00
|
|
|
|
#include "gtkeventcontrollerscroll.h"
|
2018-03-05 13:58:57 +00:00
|
|
|
|
#include "gtkeventcontrollerkey.h"
|
1998-09-27 18:32:00 +00:00
|
|
|
|
|
2013-07-09 20:44:04 +00:00
|
|
|
|
#define TIMEOUT_INITIAL 500
|
|
|
|
|
#define TIMEOUT_REPEAT 50
|
|
|
|
|
|
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
|
|
|
|
};
|
|
|
|
|
|
2011-01-24 02:50:39 +00:00
|
|
|
|
static gboolean
|
2005-12-06 17:07:55 +00:00
|
|
|
|
leap (guint year)
|
1998-09-27 18:32:00 +00:00
|
|
|
|
{
|
2014-12-24 01:28:49 +00:00
|
|
|
|
return ((((year % 4) == 0) && ((year % 100) != 0)) || ((year % 400) == 0));
|
1998-09-27 18:32:00 +00:00
|
|
|
|
}
|
|
|
|
|
|
2011-01-24 02:50:39 +00:00
|
|
|
|
static guint
|
2005-12-06 17:07:55 +00:00
|
|
|
|
day_of_week (guint year, guint mm, guint dd)
|
1998-09-27 18:32:00 +00:00
|
|
|
|
{
|
2014-12-24 01:28:49 +00:00
|
|
|
|
GDateTime *dt;
|
|
|
|
|
guint days;
|
1998-09-27 18:32:00 +00:00
|
|
|
|
|
2014-12-24 01:28:49 +00:00
|
|
|
|
dt = g_date_time_new_local (year, mm, dd, 1, 1, 1);
|
2015-01-02 23:05:29 +00:00
|
|
|
|
if (dt == NULL)
|
|
|
|
|
return 0;
|
|
|
|
|
|
2014-12-24 01:28:49 +00:00
|
|
|
|
days = g_date_time_get_day_of_week (dt);
|
|
|
|
|
g_date_time_unref (dt);
|
1998-09-27 18:32:00 +00:00
|
|
|
|
|
2014-12-24 01:28:49 +00:00
|
|
|
|
return days;
|
1998-09-27 18:32:00 +00:00
|
|
|
|
}
|
|
|
|
|
|
2011-01-24 02:50:39 +00:00
|
|
|
|
static guint
|
2014-12-24 01:28:49 +00:00
|
|
|
|
week_of_year (guint year, guint mm, guint dd)
|
1998-09-27 18:32:00 +00:00
|
|
|
|
{
|
2014-12-24 01:28:49 +00:00
|
|
|
|
GDateTime *dt;
|
|
|
|
|
guint week;
|
1998-09-27 18:32:00 +00:00
|
|
|
|
|
2014-12-24 01:28:49 +00:00
|
|
|
|
dt = g_date_time_new_local (year, mm, dd, 1, 1, 1);
|
2015-01-02 23:05:29 +00:00
|
|
|
|
if (dt == NULL)
|
|
|
|
|
return 1;
|
|
|
|
|
|
2014-12-24 01:28:49 +00:00
|
|
|
|
week = g_date_time_get_week_of_year (dt);
|
|
|
|
|
g_date_time_unref (dt);
|
1998-09-27 18:32:00 +00:00
|
|
|
|
|
2014-12-24 01:28:49 +00:00
|
|
|
|
return week;
|
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 */
|
2011-01-24 02:50:39 +00:00
|
|
|
|
#define CALENDAR_MARGIN 0
|
1998-09-27 18:32:00 +00:00
|
|
|
|
|
2011-01-24 02:50:39 +00:00
|
|
|
|
#define DAY_XSEP 0 /* not really good for small calendar */
|
|
|
|
|
#define DAY_YSEP 0 /* not really good for small calendar */
|
1998-09-27 18:32:00 +00:00
|
|
|
|
|
2006-07-17 12:55:12 +00:00
|
|
|
|
#define SCROLL_DELAY_FACTOR 5
|
|
|
|
|
|
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,
|
2008-05-21 11:30:06 +00:00
|
|
|
|
PROP_DETAIL_HEIGHT_ROWS
|
2003-05-08 00:25:51 +00:00
|
|
|
|
};
|
|
|
|
|
|
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
|
|
|
|
{
|
2010-08-12 15:14:51 +00:00
|
|
|
|
GtkCalendarDisplayOptions display_flags;
|
|
|
|
|
|
|
|
|
|
gchar grow_space [32];
|
|
|
|
|
|
|
|
|
|
gint month;
|
|
|
|
|
gint year;
|
|
|
|
|
gint selected_day;
|
|
|
|
|
|
|
|
|
|
gint day_month[6][7];
|
|
|
|
|
gint day[6][7];
|
|
|
|
|
|
|
|
|
|
gint num_marked_dates;
|
|
|
|
|
gint marked_date[31];
|
|
|
|
|
|
|
|
|
|
gint focus_row;
|
|
|
|
|
gint focus_col;
|
|
|
|
|
|
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
|
|
|
|
|
2011-12-15 01:44:46 +00:00
|
|
|
|
guint arrow_prelight : 4;
|
2011-01-24 02:50:39 +00:00
|
|
|
|
guint arrow_width;
|
|
|
|
|
guint max_month_width;
|
|
|
|
|
guint max_year_width;
|
2010-08-12 15:14:51 +00:00
|
|
|
|
|
1998-10-04 23:07:04 +00:00
|
|
|
|
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;
|
2011-01-24 02:50:39 +00:00
|
|
|
|
|
1998-10-04 23:07:04 +00:00
|
|
|
|
/* 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
|
|
|
|
};
|
|
|
|
|
|
2010-09-18 23:55:42 +00:00
|
|
|
|
static void gtk_calendar_destroy (GtkWidget *widget);
|
2005-05-11 19:16:19 +00:00
|
|
|
|
static void gtk_calendar_set_property (GObject *object,
|
2011-01-24 02:50:39 +00:00
|
|
|
|
guint prop_id,
|
|
|
|
|
const GValue *value,
|
|
|
|
|
GParamSpec *pspec);
|
2005-05-11 19:16:19 +00:00
|
|
|
|
static void gtk_calendar_get_property (GObject *object,
|
2011-01-24 02:50:39 +00:00
|
|
|
|
guint prop_id,
|
|
|
|
|
GValue *value,
|
|
|
|
|
GParamSpec *pspec);
|
2005-05-11 19:16:19 +00:00
|
|
|
|
|
2016-10-22 14:06:14 +00:00
|
|
|
|
static void gtk_calendar_measure (GtkWidget *widget,
|
|
|
|
|
GtkOrientation orientation,
|
|
|
|
|
int for_size,
|
|
|
|
|
int *minimum,
|
|
|
|
|
int *natural,
|
|
|
|
|
int *minimum_baseline,
|
|
|
|
|
int *natural_baseline);
|
2017-07-11 07:58:21 +00:00
|
|
|
|
static void gtk_calendar_size_allocate (GtkWidget *widget,
|
|
|
|
|
const GtkAllocation *allocation,
|
2018-03-31 19:02:28 +00:00
|
|
|
|
int baseline);
|
2016-12-23 11:07:22 +00:00
|
|
|
|
static void gtk_calendar_snapshot (GtkWidget *widget,
|
|
|
|
|
GtkSnapshot *snapshot);
|
2017-09-13 15:37:25 +00:00
|
|
|
|
static void gtk_calendar_button_press (GtkGestureMultiPress *gesture,
|
|
|
|
|
int n_press,
|
|
|
|
|
double x,
|
|
|
|
|
double y,
|
|
|
|
|
gpointer user_data);
|
|
|
|
|
static void gtk_calendar_button_release (GtkGestureMultiPress *gesture,
|
|
|
|
|
int n_press,
|
|
|
|
|
double x,
|
|
|
|
|
double y,
|
|
|
|
|
gpointer user_data);
|
2017-12-11 03:15:12 +00:00
|
|
|
|
static void gtk_calendar_drag_begin (GtkGestureDrag *gesture,
|
|
|
|
|
double x,
|
|
|
|
|
double y,
|
|
|
|
|
gpointer data);
|
|
|
|
|
static void gtk_calendar_drag_update (GtkGestureDrag *gesture,
|
|
|
|
|
double x,
|
|
|
|
|
double y,
|
|
|
|
|
gpointer data);
|
2018-03-05 13:58:57 +00:00
|
|
|
|
static gboolean gtk_calendar_key_controller_key_pressed (GtkEventControllerKey *controller,
|
|
|
|
|
guint keyval,
|
|
|
|
|
guint keycode,
|
|
|
|
|
GdkModifierType state,
|
|
|
|
|
GtkWidget *widget);
|
2018-03-23 15:09:37 +00:00
|
|
|
|
static void gtk_calendar_key_controller_focus (GtkEventControllerKey *controller,
|
|
|
|
|
GtkWidget *widget);
|
2005-05-11 19:16:19 +00:00
|
|
|
|
static void gtk_calendar_grab_notify (GtkWidget *widget,
|
2011-01-24 02:50:39 +00:00
|
|
|
|
gboolean was_grabbed);
|
2011-01-10 19:40:37 +00:00
|
|
|
|
static void gtk_calendar_state_flags_changed (GtkWidget *widget,
|
|
|
|
|
GtkStateFlags previous_state);
|
2007-12-28 09:36:06 +00:00
|
|
|
|
static gboolean gtk_calendar_query_tooltip (GtkWidget *widget,
|
2011-01-24 02:50:39 +00:00
|
|
|
|
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,
|
2011-01-24 02:50:39 +00:00
|
|
|
|
GdkDragContext *context,
|
|
|
|
|
GtkSelectionData *selection_data,
|
|
|
|
|
guint time);
|
2005-05-11 19:16:19 +00:00
|
|
|
|
static void gtk_calendar_drag_data_received (GtkWidget *widget,
|
2011-01-24 02:50:39 +00:00
|
|
|
|
GdkDragContext *context,
|
|
|
|
|
GtkSelectionData *selection_data,
|
|
|
|
|
guint time);
|
2005-05-11 19:16:19 +00:00
|
|
|
|
static gboolean gtk_calendar_drag_motion (GtkWidget *widget,
|
2011-01-24 02:50:39 +00:00
|
|
|
|
GdkDragContext *context,
|
|
|
|
|
gint x,
|
|
|
|
|
gint y,
|
|
|
|
|
guint time);
|
2005-05-11 19:16:19 +00:00
|
|
|
|
static void gtk_calendar_drag_leave (GtkWidget *widget,
|
2011-01-24 02:50:39 +00:00
|
|
|
|
GdkDragContext *context,
|
|
|
|
|
guint time);
|
2005-05-11 19:16:19 +00:00
|
|
|
|
static gboolean gtk_calendar_drag_drop (GtkWidget *widget,
|
2011-01-24 02:50:39 +00:00
|
|
|
|
GdkDragContext *context,
|
|
|
|
|
gint x,
|
|
|
|
|
gint y,
|
|
|
|
|
guint time);
|
2005-05-11 19:16:19 +00:00
|
|
|
|
|
2011-06-27 01:44:42 +00:00
|
|
|
|
|
2005-05-11 19:16:19 +00:00
|
|
|
|
static void calendar_start_spinning (GtkCalendar *calendar,
|
2011-01-24 02:50:39 +00:00
|
|
|
|
gint click_child);
|
2005-05-11 19:16:19 +00:00
|
|
|
|
static void calendar_stop_spinning (GtkCalendar *calendar);
|
|
|
|
|
|
|
|
|
|
static void calendar_invalidate_day (GtkCalendar *widget,
|
2011-01-24 02:50:39 +00:00
|
|
|
|
gint row,
|
|
|
|
|
gint col);
|
2005-05-11 19:16:19 +00:00
|
|
|
|
static void calendar_invalidate_day_num (GtkCalendar *widget,
|
2011-01-24 02:50:39 +00:00
|
|
|
|
gint day);
|
2005-05-11 19:16:19 +00:00
|
|
|
|
|
|
|
|
|
static void calendar_compute_days (GtkCalendar *calendar);
|
2010-08-03 15:45:14 +00:00
|
|
|
|
static gint calendar_get_xsep (GtkCalendar *calendar);
|
|
|
|
|
static gint calendar_get_ysep (GtkCalendar *calendar);
|
2010-10-24 05:22:13 +00:00
|
|
|
|
static gint calendar_get_inner_border (GtkCalendar *calendar);
|
2010-08-03 15:45:14 +00:00
|
|
|
|
|
2017-09-15 12:55:19 +00:00
|
|
|
|
static void gtk_calendar_scroll_controller_scroll (GtkEventControllerScroll *scroll,
|
|
|
|
|
gdouble dx,
|
|
|
|
|
gdouble dy,
|
|
|
|
|
GtkWidget *widget);
|
|
|
|
|
|
1998-09-27 18:32:00 +00:00
|
|
|
|
static char *default_abbreviated_dayname[7];
|
|
|
|
|
static char *default_monthname[12];
|
|
|
|
|
|
2013-06-27 19:02:52 +00:00
|
|
|
|
G_DEFINE_TYPE_WITH_PRIVATE (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;
|
1998-09-27 18:32:00 +00:00
|
|
|
|
GtkWidgetClass *widget_class;
|
2002-02-10 14:33:06 +00:00
|
|
|
|
|
|
|
|
|
gobject_class = (GObjectClass*) class;
|
1998-09-27 18:32:00 +00:00
|
|
|
|
widget_class = (GtkWidgetClass*) class;
|
2011-01-24 02:50:39 +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;
|
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
|
|
|
|
|
2010-09-18 23:55:42 +00:00
|
|
|
|
widget_class->destroy = gtk_calendar_destroy;
|
2016-12-23 11:07:22 +00:00
|
|
|
|
widget_class->snapshot = gtk_calendar_snapshot;
|
2016-10-22 14:06:14 +00:00
|
|
|
|
widget_class->measure = gtk_calendar_measure;
|
1998-09-27 18:32:00 +00:00
|
|
|
|
widget_class->size_allocate = gtk_calendar_size_allocate;
|
2011-01-10 19:40:37 +00:00
|
|
|
|
widget_class->state_flags_changed = gtk_calendar_state_flags_changed;
|
2003-05-20 22:37:57 +00:00
|
|
|
|
widget_class->grab_notify = gtk_calendar_grab_notify;
|
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;
|
2011-01-24 02:50:39 +00:00
|
|
|
|
|
2007-12-28 19:36:16 +00:00
|
|
|
|
/**
|
|
|
|
|
* GtkCalendar:year:
|
|
|
|
|
*
|
2011-01-24 02:50:39 +00:00
|
|
|
|
* The selected year.
|
2007-12-28 19:36:16 +00:00
|
|
|
|
* This property gets initially set to the current year.
|
2011-01-24 02:50:39 +00:00
|
|
|
|
*/
|
2003-05-08 00:25:51 +00:00
|
|
|
|
g_object_class_install_property (gobject_class,
|
|
|
|
|
PROP_YEAR,
|
|
|
|
|
g_param_spec_int ("year",
|
2011-01-24 02:50:39 +00:00
|
|
|
|
P_("Year"),
|
|
|
|
|
P_("The selected year"),
|
|
|
|
|
0, G_MAXINT >> 9, 0,
|
2016-03-20 04:27:19 +00:00
|
|
|
|
GTK_PARAM_READWRITE|G_PARAM_EXPLICIT_NOTIFY));
|
2007-12-28 19:36:16 +00:00
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
|
* GtkCalendar:month:
|
|
|
|
|
*
|
2011-01-24 02:50:39 +00:00
|
|
|
|
* The selected month (as a number between 0 and 11).
|
2007-12-28 19:36:16 +00:00
|
|
|
|
* 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",
|
2011-01-24 02:50:39 +00:00
|
|
|
|
P_("Month"),
|
|
|
|
|
P_("The selected month (as a number between 0 and 11)"),
|
|
|
|
|
0, 11, 0,
|
2014-06-07 18:07:07 +00:00
|
|
|
|
GTK_PARAM_READWRITE|G_PARAM_EXPLICIT_NOTIFY));
|
2007-12-28 19:36:16 +00:00
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
|
* GtkCalendar:day:
|
|
|
|
|
*
|
2011-01-24 02:50:39 +00:00
|
|
|
|
* The selected day (as a number between 1 and 31, or 0
|
2007-12-28 19:36:16 +00:00
|
|
|
|
* 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",
|
2011-01-24 02:50:39 +00:00
|
|
|
|
P_("Day"),
|
|
|
|
|
P_("The selected day (as a number between 1 and 31, or 0 to unselect the currently selected day)"),
|
|
|
|
|
0, 31, 0,
|
2014-06-07 18:07:07 +00:00
|
|
|
|
GTK_PARAM_READWRITE|G_PARAM_EXPLICIT_NOTIFY));
|
2003-06-14 22:27:14 +00:00
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
|
* GtkCalendar:show-heading:
|
|
|
|
|
*
|
|
|
|
|
* Determines whether a heading is displayed.
|
|
|
|
|
*/
|
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",
|
2011-01-24 02:50:39 +00:00
|
|
|
|
P_("Show Heading"),
|
|
|
|
|
P_("If TRUE, a heading is displayed"),
|
|
|
|
|
TRUE,
|
2014-06-07 18:07:07 +00:00
|
|
|
|
GTK_PARAM_READWRITE|G_PARAM_EXPLICIT_NOTIFY));
|
2003-06-14 22:27:14 +00:00
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
|
* GtkCalendar:show-day-names:
|
|
|
|
|
*
|
|
|
|
|
* Determines whether day names are displayed.
|
|
|
|
|
*/
|
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",
|
2011-01-24 02:50:39 +00:00
|
|
|
|
P_("Show Day Names"),
|
|
|
|
|
P_("If TRUE, day names are displayed"),
|
|
|
|
|
TRUE,
|
2014-06-07 18:07:07 +00:00
|
|
|
|
GTK_PARAM_READWRITE|G_PARAM_EXPLICIT_NOTIFY));
|
2003-06-14 22:27:14 +00:00
|
|
|
|
/**
|
|
|
|
|
* GtkCalendar:no-month-change:
|
|
|
|
|
*
|
|
|
|
|
* Determines whether the selected month can be changed.
|
|
|
|
|
*/
|
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",
|
2011-01-24 02:50:39 +00:00
|
|
|
|
P_("No Month Change"),
|
|
|
|
|
P_("If TRUE, the selected month cannot be changed"),
|
|
|
|
|
FALSE,
|
2014-06-07 18:07:07 +00:00
|
|
|
|
GTK_PARAM_READWRITE|G_PARAM_EXPLICIT_NOTIFY));
|
2003-06-14 22:27:14 +00:00
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
|
* GtkCalendar:show-week-numbers:
|
|
|
|
|
*
|
|
|
|
|
* Determines whether week numbers are displayed.
|
|
|
|
|
*/
|
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",
|
2011-01-24 02:50:39 +00:00
|
|
|
|
P_("Show Week Numbers"),
|
|
|
|
|
P_("If TRUE, week numbers are displayed"),
|
|
|
|
|
FALSE,
|
2014-06-07 18:07:07 +00:00
|
|
|
|
GTK_PARAM_READWRITE|G_PARAM_EXPLICIT_NOTIFY));
|
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().
|
|
|
|
|
*/
|
|
|
|
|
g_object_class_install_property (gobject_class,
|
|
|
|
|
PROP_DETAIL_WIDTH_CHARS,
|
|
|
|
|
g_param_spec_int ("detail-width-chars",
|
2011-01-24 02:50:39 +00:00
|
|
|
|
P_("Details Width"),
|
|
|
|
|
P_("Details width in characters"),
|
|
|
|
|
0, 127, 0,
|
2014-06-07 18:07:07 +00:00
|
|
|
|
GTK_PARAM_READWRITE|G_PARAM_EXPLICIT_NOTIFY));
|
2007-12-27 20:41:08 +00:00
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
|
* GtkCalendar:detail-height-rows:
|
|
|
|
|
*
|
|
|
|
|
* Height of a detail cell, in rows.
|
|
|
|
|
* A value of 0 allows any width. See gtk_calendar_set_detail_func().
|
|
|
|
|
*/
|
|
|
|
|
g_object_class_install_property (gobject_class,
|
|
|
|
|
PROP_DETAIL_HEIGHT_ROWS,
|
|
|
|
|
g_param_spec_int ("detail-height-rows",
|
2011-01-24 02:50:39 +00:00
|
|
|
|
P_("Details Height"),
|
|
|
|
|
P_("Details height in rows"),
|
|
|
|
|
0, 127, 0,
|
2014-06-07 18:07:07 +00:00
|
|
|
|
GTK_PARAM_READWRITE|G_PARAM_EXPLICIT_NOTIFY));
|
2007-12-27 20:41:08 +00:00
|
|
|
|
|
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.
|
|
|
|
|
*/
|
|
|
|
|
g_object_class_install_property (gobject_class,
|
|
|
|
|
PROP_SHOW_DETAILS,
|
|
|
|
|
g_param_spec_boolean ("show-details",
|
2011-01-24 02:50:39 +00:00
|
|
|
|
P_("Show Details"),
|
|
|
|
|
P_("If TRUE, details are shown"),
|
|
|
|
|
TRUE,
|
2014-06-07 18:07:07 +00:00
|
|
|
|
GTK_PARAM_READWRITE|G_PARAM_EXPLICIT_NOTIFY));
|
2007-12-28 09:39:34 +00:00
|
|
|
|
|
2010-08-03 15:45:14 +00:00
|
|
|
|
|
2010-07-06 20:06:34 +00:00
|
|
|
|
/**
|
|
|
|
|
* GtkCalendar::month-changed:
|
|
|
|
|
* @calendar: the object which received the signal.
|
|
|
|
|
*
|
|
|
|
|
* Emitted when the user clicks a button to change the selected month on a
|
|
|
|
|
* calendar.
|
|
|
|
|
*/
|
1998-09-27 18:32:00 +00:00
|
|
|
|
gtk_calendar_signals[MONTH_CHANGED_SIGNAL] =
|
2008-08-11 13:07:18 +00:00
|
|
|
|
g_signal_new (I_("month-changed"),
|
2011-01-24 02:50:39 +00:00
|
|
|
|
G_OBJECT_CLASS_TYPE (gobject_class),
|
|
|
|
|
G_SIGNAL_RUN_FIRST,
|
|
|
|
|
G_STRUCT_OFFSET (GtkCalendarClass, month_changed),
|
|
|
|
|
NULL, NULL,
|
2016-08-29 14:00:17 +00:00
|
|
|
|
NULL,
|
2011-01-24 02:50:39 +00:00
|
|
|
|
G_TYPE_NONE, 0);
|
2010-07-06 20:06:34 +00:00
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
|
* GtkCalendar::day-selected:
|
|
|
|
|
* @calendar: the object which received the signal.
|
|
|
|
|
*
|
|
|
|
|
* Emitted when the user selects a day.
|
|
|
|
|
*/
|
1998-09-27 18:32:00 +00:00
|
|
|
|
gtk_calendar_signals[DAY_SELECTED_SIGNAL] =
|
2008-08-11 13:07:18 +00:00
|
|
|
|
g_signal_new (I_("day-selected"),
|
2011-01-24 02:50:39 +00:00
|
|
|
|
G_OBJECT_CLASS_TYPE (gobject_class),
|
|
|
|
|
G_SIGNAL_RUN_FIRST,
|
|
|
|
|
G_STRUCT_OFFSET (GtkCalendarClass, day_selected),
|
|
|
|
|
NULL, NULL,
|
2016-08-29 14:00:17 +00:00
|
|
|
|
NULL,
|
2011-01-24 02:50:39 +00:00
|
|
|
|
G_TYPE_NONE, 0);
|
2010-07-06 20:06:34 +00:00
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
|
* GtkCalendar::day-selected-double-click:
|
|
|
|
|
* @calendar: the object which received the signal.
|
|
|
|
|
*
|
|
|
|
|
* Emitted when the user double-clicks a day.
|
|
|
|
|
*/
|
1998-09-27 18:32:00 +00:00
|
|
|
|
gtk_calendar_signals[DAY_SELECTED_DOUBLE_CLICK_SIGNAL] =
|
2008-08-11 13:07:18 +00:00
|
|
|
|
g_signal_new (I_("day-selected-double-click"),
|
2011-01-24 02:50:39 +00:00
|
|
|
|
G_OBJECT_CLASS_TYPE (gobject_class),
|
|
|
|
|
G_SIGNAL_RUN_FIRST,
|
|
|
|
|
G_STRUCT_OFFSET (GtkCalendarClass, day_selected_double_click),
|
|
|
|
|
NULL, NULL,
|
2016-08-29 14:00:17 +00:00
|
|
|
|
NULL,
|
2011-01-24 02:50:39 +00:00
|
|
|
|
G_TYPE_NONE, 0);
|
2010-07-06 20:06:34 +00:00
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
|
* GtkCalendar::prev-month:
|
|
|
|
|
* @calendar: the object which received the signal.
|
|
|
|
|
*
|
|
|
|
|
* Emitted when the user switched to the previous month.
|
|
|
|
|
*/
|
1998-09-27 18:32:00 +00:00
|
|
|
|
gtk_calendar_signals[PREV_MONTH_SIGNAL] =
|
2008-08-11 13:07:18 +00:00
|
|
|
|
g_signal_new (I_("prev-month"),
|
2011-01-24 02:50:39 +00:00
|
|
|
|
G_OBJECT_CLASS_TYPE (gobject_class),
|
|
|
|
|
G_SIGNAL_RUN_FIRST,
|
|
|
|
|
G_STRUCT_OFFSET (GtkCalendarClass, prev_month),
|
|
|
|
|
NULL, NULL,
|
2016-08-29 14:00:17 +00:00
|
|
|
|
NULL,
|
2011-01-24 02:50:39 +00:00
|
|
|
|
G_TYPE_NONE, 0);
|
2010-07-06 20:06:34 +00:00
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
|
* GtkCalendar::next-month:
|
|
|
|
|
* @calendar: the object which received the signal.
|
|
|
|
|
*
|
|
|
|
|
* Emitted when the user switched to the next month.
|
|
|
|
|
*/
|
1998-09-27 18:32:00 +00:00
|
|
|
|
gtk_calendar_signals[NEXT_MONTH_SIGNAL] =
|
2008-08-11 13:07:18 +00:00
|
|
|
|
g_signal_new (I_("next-month"),
|
2011-01-24 02:50:39 +00:00
|
|
|
|
G_OBJECT_CLASS_TYPE (gobject_class),
|
|
|
|
|
G_SIGNAL_RUN_FIRST,
|
|
|
|
|
G_STRUCT_OFFSET (GtkCalendarClass, next_month),
|
|
|
|
|
NULL, NULL,
|
2016-08-29 14:00:17 +00:00
|
|
|
|
NULL,
|
2011-01-24 02:50:39 +00:00
|
|
|
|
G_TYPE_NONE, 0);
|
2010-07-06 20:06:34 +00:00
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
|
* GtkCalendar::prev-year:
|
|
|
|
|
* @calendar: the object which received the signal.
|
|
|
|
|
*
|
|
|
|
|
* Emitted when user switched to the previous year.
|
|
|
|
|
*/
|
1998-09-27 18:32:00 +00:00
|
|
|
|
gtk_calendar_signals[PREV_YEAR_SIGNAL] =
|
2008-08-11 13:07:18 +00:00
|
|
|
|
g_signal_new (I_("prev-year"),
|
2011-01-24 02:50:39 +00:00
|
|
|
|
G_OBJECT_CLASS_TYPE (gobject_class),
|
|
|
|
|
G_SIGNAL_RUN_FIRST,
|
|
|
|
|
G_STRUCT_OFFSET (GtkCalendarClass, prev_year),
|
|
|
|
|
NULL, NULL,
|
2016-08-29 14:00:17 +00:00
|
|
|
|
NULL,
|
2011-01-24 02:50:39 +00:00
|
|
|
|
G_TYPE_NONE, 0);
|
2010-07-06 20:06:34 +00:00
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
|
* GtkCalendar::next-year:
|
|
|
|
|
* @calendar: the object which received the signal.
|
|
|
|
|
*
|
|
|
|
|
* Emitted when user switched to the next year.
|
|
|
|
|
*/
|
1998-09-27 18:32:00 +00:00
|
|
|
|
gtk_calendar_signals[NEXT_YEAR_SIGNAL] =
|
2008-08-11 13:07:18 +00:00
|
|
|
|
g_signal_new (I_("next-year"),
|
2011-01-24 02:50:39 +00:00
|
|
|
|
G_OBJECT_CLASS_TYPE (gobject_class),
|
|
|
|
|
G_SIGNAL_RUN_FIRST,
|
|
|
|
|
G_STRUCT_OFFSET (GtkCalendarClass, next_year),
|
|
|
|
|
NULL, NULL,
|
2016-08-29 14:00:17 +00:00
|
|
|
|
NULL,
|
2011-01-24 02:50:39 +00:00
|
|
|
|
G_TYPE_NONE, 0);
|
2015-10-28 10:35:33 +00:00
|
|
|
|
|
|
|
|
|
gtk_widget_class_set_accessible_role (widget_class, ATK_ROLE_CALENDAR);
|
2017-11-18 03:49:57 +00:00
|
|
|
|
gtk_widget_class_set_css_name (widget_class, I_("calendar"));
|
1998-09-27 18:32:00 +00:00
|
|
|
|
}
|
|
|
|
|
|
2018-02-17 22:03:49 +00:00
|
|
|
|
#pragma GCC diagnostic push
|
|
|
|
|
#pragma GCC diagnostic ignored "-Wformat-nonliteral"
|
|
|
|
|
|
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);
|
2018-03-10 17:29:57 +00:00
|
|
|
|
GtkEventController *controller;
|
2018-03-09 05:14:59 +00:00
|
|
|
|
GtkGesture *gesture;
|
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
|
2018-02-17 22:03:49 +00:00
|
|
|
|
static const char *month_format = NULL;
|
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
|
|
|
|
|
2013-06-27 19:02:52 +00:00
|
|
|
|
priv = calendar->priv = gtk_calendar_get_instance_private (calendar);
|
2005-05-11 19:16:19 +00:00
|
|
|
|
|
2010-03-02 03:40:38 +00:00
|
|
|
|
gtk_widget_set_can_focus (widget, TRUE);
|
2018-03-20 14:21:12 +00:00
|
|
|
|
gtk_widget_set_has_surface (widget, FALSE);
|
2011-01-24 02:50:39 +00:00
|
|
|
|
|
2017-05-07 12:26:10 +00:00
|
|
|
|
gtk_style_context_add_class (gtk_widget_get_style_context (GTK_WIDGET (calendar)),
|
|
|
|
|
GTK_STYLE_CLASS_VIEW);
|
|
|
|
|
|
2018-03-09 05:14:59 +00:00
|
|
|
|
gesture = gtk_gesture_multi_press_new ();
|
|
|
|
|
g_signal_connect (gesture, "pressed", G_CALLBACK (gtk_calendar_button_press), calendar);
|
|
|
|
|
g_signal_connect (gesture, "released", G_CALLBACK (gtk_calendar_button_release), calendar);
|
|
|
|
|
gtk_widget_add_controller (GTK_WIDGET (calendar), GTK_EVENT_CONTROLLER (gesture));
|
2017-09-13 15:37:25 +00:00
|
|
|
|
|
2018-03-10 17:05:57 +00:00
|
|
|
|
gesture = gtk_gesture_drag_new ();
|
|
|
|
|
g_signal_connect (gesture, "drag-begin", G_CALLBACK (gtk_calendar_drag_begin), calendar);
|
|
|
|
|
g_signal_connect (gesture, "drag-update", G_CALLBACK (gtk_calendar_drag_update), calendar);
|
|
|
|
|
gtk_widget_add_controller (GTK_WIDGET (calendar), GTK_EVENT_CONTROLLER (gesture));
|
2017-12-11 03:15:12 +00:00
|
|
|
|
|
2018-03-10 17:29:57 +00:00
|
|
|
|
controller =
|
|
|
|
|
gtk_event_controller_scroll_new (GTK_EVENT_CONTROLLER_SCROLL_VERTICAL |
|
2017-09-15 12:55:19 +00:00
|
|
|
|
GTK_EVENT_CONTROLLER_SCROLL_DISCRETE);
|
2018-03-10 17:29:57 +00:00
|
|
|
|
g_signal_connect (controller, "scroll",
|
2017-09-15 12:55:19 +00:00
|
|
|
|
G_CALLBACK (gtk_calendar_scroll_controller_scroll),
|
|
|
|
|
calendar);
|
2018-03-10 17:29:57 +00:00
|
|
|
|
gtk_widget_add_controller (GTK_WIDGET (calendar), controller);
|
2017-09-15 12:55:19 +00:00
|
|
|
|
|
2018-04-20 17:58:06 +00:00
|
|
|
|
controller = gtk_event_controller_key_new ();
|
|
|
|
|
g_signal_connect (controller, "key-pressed",
|
2018-03-05 13:58:57 +00:00
|
|
|
|
G_CALLBACK (gtk_calendar_key_controller_key_pressed),
|
|
|
|
|
calendar);
|
2018-04-20 17:58:06 +00:00
|
|
|
|
g_signal_connect (controller, "focus-in",
|
2018-03-23 15:09:37 +00:00
|
|
|
|
G_CALLBACK (gtk_calendar_key_controller_focus),
|
|
|
|
|
calendar);
|
2018-04-20 17:58:06 +00:00
|
|
|
|
g_signal_connect (controller, "focus-out",
|
2018-03-23 15:09:37 +00:00
|
|
|
|
G_CALLBACK (gtk_calendar_key_controller_focus),
|
|
|
|
|
calendar);
|
2018-04-20 17:58:06 +00:00
|
|
|
|
gtk_widget_add_controller (GTK_WIDGET (calendar), controller);
|
2018-03-05 13:58:57 +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
|
2011-01-24 02:50:39 +00:00
|
|
|
|
tmp_time= (i+3)*86400;
|
2018-02-10 13:07:56 +00:00
|
|
|
|
strftime (buffer, sizeof (buffer), "%a", gmtime (&tmp_time));
|
2011-01-24 02:50:39 +00:00
|
|
|
|
default_abbreviated_dayname[i] = g_locale_to_utf8 (buffer, -1, NULL, NULL, NULL);
|
2005-11-28 01:51:08 +00:00
|
|
|
|
#else
|
2011-01-24 02:50:39 +00:00
|
|
|
|
if (!GetLocaleInfoW (GetThreadLocale (), LOCALE_SABBREVDAYNAME1 + (i+6)%7,
|
|
|
|
|
wbuffer, G_N_ELEMENTS (wbuffer)))
|
|
|
|
|
default_abbreviated_dayname[i] = g_strdup_printf ("(%d)", i);
|
|
|
|
|
else
|
|
|
|
|
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
|
|
|
|
}
|
2011-01-24 02:50:39 +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
|
2011-01-24 02:50:39 +00:00
|
|
|
|
tmp_time=i*2764800;
|
2018-02-17 22:03:49 +00:00
|
|
|
|
if (G_UNLIKELY (month_format == NULL))
|
|
|
|
|
{
|
|
|
|
|
buffer[0] = '\0';
|
|
|
|
|
month_format = "%OB";
|
|
|
|
|
strftime (buffer, sizeof (buffer), month_format, gmtime (&tmp_time));
|
|
|
|
|
/* "%OB" is not supported in Linux with glibc < 2.27 */
|
|
|
|
|
if (!strcmp (buffer, "%OB") || !strcmp (buffer, "OB") || !strcmp (buffer, ""))
|
|
|
|
|
{
|
|
|
|
|
month_format = "%B";
|
|
|
|
|
strftime (buffer, sizeof (buffer), month_format, gmtime (&tmp_time));
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
else
|
|
|
|
|
strftime (buffer, sizeof (buffer), month_format, gmtime (&tmp_time));
|
|
|
|
|
|
2011-01-24 02:50:39 +00:00
|
|
|
|
default_monthname[i] = g_locale_to_utf8 (buffer, -1, NULL, NULL, NULL);
|
2005-11-28 01:51:08 +00:00
|
|
|
|
#else
|
2011-01-24 02:50:39 +00:00
|
|
|
|
if (!GetLocaleInfoW (GetThreadLocale (), LOCALE_SMONTHNAME1 + i,
|
|
|
|
|
wbuffer, G_N_ELEMENTS (wbuffer)))
|
|
|
|
|
default_monthname[i] = g_strdup_printf ("(%d)", i);
|
|
|
|
|
else
|
|
|
|
|
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
|
|
|
|
}
|
2011-01-24 02:50:39 +00:00
|
|
|
|
|
1998-09-27 18:32:00 +00:00
|
|
|
|
/* Set defaults */
|
|
|
|
|
secs = time (NULL);
|
|
|
|
|
tm = localtime (&secs);
|
2010-08-12 15:14:51 +00:00
|
|
|
|
priv->month = tm->tm_mon;
|
|
|
|
|
priv->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++)
|
2010-08-12 15:14:51 +00:00
|
|
|
|
priv->marked_date[i] = FALSE;
|
|
|
|
|
priv->num_marked_dates = 0;
|
|
|
|
|
priv->selected_day = tm->tm_mday;
|
2011-01-24 02:50:39 +00:00
|
|
|
|
|
2010-08-12 15:14:51 +00:00
|
|
|
|
priv->display_flags = (GTK_CALENDAR_SHOW_HEADING |
|
2011-01-24 02:50:39 +00:00
|
|
|
|
GTK_CALENDAR_SHOW_DAY_NAMES |
|
|
|
|
|
GTK_CALENDAR_SHOW_DETAILS);
|
|
|
|
|
|
2010-08-12 15:14:51 +00:00
|
|
|
|
priv->focus_row = -1;
|
|
|
|
|
priv->focus_col = -1;
|
1998-10-05 03:52:48 +00:00
|
|
|
|
|
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
|
|
|
|
|
2017-11-14 21:32:23 +00:00
|
|
|
|
gtk_drag_dest_set (widget, 0, NULL, GDK_ACTION_COPY);
|
2004-07-21 16:53:55 +00:00
|
|
|
|
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.
|
|
|
|
|
*
|
2009-07-07 15:37:07 +00:00
|
|
|
|
* Note that the ordering described here is logical order, which is
|
|
|
|
|
* further influenced by BIDI ordering. Thus, if you have a default
|
|
|
|
|
* text direction of RTL and specify "calendar:YM", then the year
|
|
|
|
|
* will appear to the right of the month.
|
2003-08-08 22:17:34 +00:00
|
|
|
|
*/
|
|
|
|
|
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)
|
2016-02-28 16:06:25 +00:00
|
|
|
|
g_warning ("Whoever translated calendar:MY did so wrongly.");
|
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,
|
2011-01-24 02:50:39 +00:00
|
|
|
|
wbuffer, G_N_ELEMENTS (wbuffer)))
|
2006-10-10 21:51:11 +00:00
|
|
|
|
week_start = g_utf16_to_utf8 (wbuffer, -1, NULL, NULL, NULL);
|
2011-01-24 02:50:39 +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
|
2016-02-28 16:06:25 +00:00
|
|
|
|
g_warning ("Unknown value of _NL_TIME_WEEK_1STDAY.");
|
2005-09-09 17:26:14 +00:00
|
|
|
|
|
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.
|
2011-01-24 02:50:39 +00:00
|
|
|
|
*/
|
2004-01-02 01:52:04 +00:00
|
|
|
|
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';
|
2011-01-24 02:50:39 +00:00
|
|
|
|
else
|
2005-05-11 19:16:19 +00:00
|
|
|
|
priv->week_start = -1;
|
2011-01-24 02:50:39 +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
|
|
|
|
{
|
2016-02-28 16:06:25 +00:00
|
|
|
|
g_warning ("Whoever translated calendar:week_start:0 did so wrongly.");
|
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
|
|
|
|
}
|
|
|
|
|
|
2018-02-17 22:03:49 +00:00
|
|
|
|
#pragma GCC diagnostic pop
|
|
|
|
|
|
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)
|
|
|
|
|
{
|
2013-06-27 19:02:52 +00:00
|
|
|
|
GtkCalendarPrivate *priv = calendar->priv;
|
2007-12-28 09:26:38 +00:00
|
|
|
|
|
2007-12-28 09:39:34 +00:00
|
|
|
|
if (!(priv->detail_func) ||
|
2010-08-12 15:14:51 +00:00
|
|
|
|
!(priv->display_flags & GTK_CALENDAR_SHOW_DETAILS) ||
|
2007-12-28 09:39:34 +00:00
|
|
|
|
(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;
|
2010-08-12 15:14:51 +00:00
|
|
|
|
GtkCalendarPrivate *priv = calendar->priv;
|
2008-02-07 15:50:39 +00:00
|
|
|
|
|
2010-08-12 15:14:51 +00:00
|
|
|
|
if (priv->display_flags & GTK_CALENDAR_NO_MONTH_CHANGE)
|
1998-09-27 18:32:00 +00:00
|
|
|
|
return;
|
2010-08-12 15:14:51 +00:00
|
|
|
|
|
|
|
|
|
if (priv->month == 11)
|
1998-09-27 18:32:00 +00:00
|
|
|
|
{
|
2010-08-12 15:14:51 +00:00
|
|
|
|
priv->month = 0;
|
|
|
|
|
priv->year++;
|
|
|
|
|
}
|
|
|
|
|
else
|
|
|
|
|
priv->month++;
|
|
|
|
|
|
2005-05-11 19:16:19 +00:00
|
|
|
|
calendar_compute_days (calendar);
|
2002-10-09 22:11:08 +00:00
|
|
|
|
g_signal_emit (calendar,
|
2011-01-24 02:50:39 +00:00
|
|
|
|
gtk_calendar_signals[NEXT_MONTH_SIGNAL],
|
|
|
|
|
0);
|
2002-10-09 22:11:08 +00:00
|
|
|
|
g_signal_emit (calendar,
|
2011-01-24 02:50:39 +00:00
|
|
|
|
gtk_calendar_signals[MONTH_CHANGED_SIGNAL],
|
|
|
|
|
0);
|
2010-08-12 15:14:51 +00:00
|
|
|
|
|
|
|
|
|
month_len = month_length[leap (priv->year)][priv->month + 1];
|
|
|
|
|
|
|
|
|
|
if (month_len < priv->selected_day)
|
1998-09-27 18:32:00 +00:00
|
|
|
|
{
|
2010-08-12 15:14:51 +00:00
|
|
|
|
priv->selected_day = 0;
|
1998-09-27 18:32:00 +00:00
|
|
|
|
gtk_calendar_select_day (calendar, month_len);
|
|
|
|
|
}
|
|
|
|
|
else
|
2010-08-12 15:14:51 +00:00
|
|
|
|
gtk_calendar_select_day (calendar, priv->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
|
|
|
|
{
|
2010-08-12 15:14:51 +00:00
|
|
|
|
GtkCalendarPrivate *priv = calendar->priv;
|
1998-09-27 18:32:00 +00:00
|
|
|
|
gint month_len;
|
2008-02-07 15:50:39 +00:00
|
|
|
|
|
2010-08-12 15:14:51 +00:00
|
|
|
|
priv->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,
|
2011-01-24 02:50:39 +00:00
|
|
|
|
gtk_calendar_signals[PREV_YEAR_SIGNAL],
|
|
|
|
|
0);
|
2002-10-09 22:11:08 +00:00
|
|
|
|
g_signal_emit (calendar,
|
2011-01-24 02:50:39 +00:00
|
|
|
|
gtk_calendar_signals[MONTH_CHANGED_SIGNAL],
|
|
|
|
|
0);
|
2010-08-12 15:14:51 +00:00
|
|
|
|
|
|
|
|
|
month_len = month_length[leap (priv->year)][priv->month + 1];
|
|
|
|
|
|
|
|
|
|
if (month_len < priv->selected_day)
|
1998-09-27 18:32:00 +00:00
|
|
|
|
{
|
2010-08-12 15:14:51 +00:00
|
|
|
|
priv->selected_day = 0;
|
1998-09-27 18:32:00 +00:00
|
|
|
|
gtk_calendar_select_day (calendar, month_len);
|
|
|
|
|
}
|
|
|
|
|
else
|
2010-08-12 15:14:51 +00:00
|
|
|
|
gtk_calendar_select_day (calendar, priv->selected_day);
|
|
|
|
|
|
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
|
|
|
|
{
|
2010-08-12 15:14:51 +00:00
|
|
|
|
GtkCalendarPrivate *priv = calendar->priv;
|
1998-09-27 18:32:00 +00:00
|
|
|
|
gint month_len;
|
2008-02-07 15:50:39 +00:00
|
|
|
|
|
2010-08-12 15:14:51 +00:00
|
|
|
|
priv->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,
|
2011-01-24 02:50:39 +00:00
|
|
|
|
gtk_calendar_signals[NEXT_YEAR_SIGNAL],
|
|
|
|
|
0);
|
2002-10-09 22:11:08 +00:00
|
|
|
|
g_signal_emit (calendar,
|
2011-01-24 02:50:39 +00:00
|
|
|
|
gtk_calendar_signals[MONTH_CHANGED_SIGNAL],
|
|
|
|
|
0);
|
2010-08-12 15:14:51 +00:00
|
|
|
|
|
|
|
|
|
month_len = month_length[leap (priv->year)][priv->month + 1];
|
|
|
|
|
|
|
|
|
|
if (month_len < priv->selected_day)
|
1998-09-27 18:32:00 +00:00
|
|
|
|
{
|
2010-08-12 15:14:51 +00:00
|
|
|
|
priv->selected_day = 0;
|
1998-09-27 18:32:00 +00:00
|
|
|
|
gtk_calendar_select_day (calendar, month_len);
|
|
|
|
|
}
|
|
|
|
|
else
|
2010-08-12 15:14:51 +00:00
|
|
|
|
gtk_calendar_select_day (calendar, priv->selected_day);
|
|
|
|
|
|
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
|
|
|
|
{
|
2010-08-12 15:14:51 +00:00
|
|
|
|
GtkCalendarPrivate *priv = calendar->priv;
|
2005-05-11 19:16:19 +00:00
|
|
|
|
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
|
|
|
|
|
2010-08-12 15:14:51 +00:00
|
|
|
|
year = priv->year;
|
|
|
|
|
month = priv->month + 1;
|
|
|
|
|
|
2005-05-11 19:16:19 +00:00
|
|
|
|
ndays_in_month = month_length[leap (year)][month];
|
2010-08-12 15:14:51 +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;
|
2014-12-24 02:49:21 +00:00
|
|
|
|
if (first_day == 0)
|
|
|
|
|
first_day = 7;
|
2010-08-12 15:14:51 +00:00
|
|
|
|
|
2005-05-11 19:16:19 +00:00
|
|
|
|
/* Compute days of previous month */
|
|
|
|
|
if (month > 1)
|
2014-12-24 01:28:49 +00:00
|
|
|
|
ndays_in_prev_month = month_length[leap (year)][month - 1];
|
2005-05-11 19:16:19 +00:00
|
|
|
|
else
|
2014-12-24 01:28:49 +00:00
|
|
|
|
ndays_in_prev_month = month_length[leap (year - 1)][12];
|
2014-12-24 02:49:21 +00:00
|
|
|
|
day = ndays_in_prev_month - first_day+ 1;
|
2011-01-24 02:50:39 +00:00
|
|
|
|
|
2014-12-24 02:49:21 +00:00
|
|
|
|
for (col = 0; col < first_day; col++)
|
1998-09-27 18:32:00 +00:00
|
|
|
|
{
|
2014-12-24 02:49:21 +00:00
|
|
|
|
priv->day[0][col] = day;
|
|
|
|
|
priv->day_month[0][col] = MONTH_PREV;
|
|
|
|
|
day++;
|
2005-05-11 19:16:19 +00:00
|
|
|
|
}
|
2011-01-24 02:50:39 +00:00
|
|
|
|
|
2005-05-11 19:16:19 +00:00
|
|
|
|
/* Compute days of current month */
|
2014-12-24 02:49:21 +00:00
|
|
|
|
row = first_day / 7;
|
|
|
|
|
col = first_day % 7;
|
2005-05-11 19:16:19 +00:00
|
|
|
|
for (day = 1; day <= ndays_in_month; day++)
|
|
|
|
|
{
|
2010-08-12 15:14:51 +00:00
|
|
|
|
priv->day[row][col] = day;
|
|
|
|
|
priv->day_month[row][col] = MONTH_CURRENT;
|
|
|
|
|
|
2005-05-11 19:16:19 +00:00
|
|
|
|
col++;
|
|
|
|
|
if (col == 7)
|
2011-01-24 02:50:39 +00:00
|
|
|
|
{
|
|
|
|
|
row++;
|
|
|
|
|
col = 0;
|
|
|
|
|
}
|
2002-03-21 00:50:15 +00:00
|
|
|
|
}
|
2011-01-24 02:50:39 +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++)
|
2011-01-24 02:50:39 +00:00
|
|
|
|
{
|
|
|
|
|
priv->day[row][col] = day;
|
|
|
|
|
priv->day_month[row][col] = MONTH_NEXT;
|
|
|
|
|
day++;
|
|
|
|
|
}
|
2005-05-11 19:16:19 +00:00
|
|
|
|
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,
|
2011-01-24 02:50:39 +00:00
|
|
|
|
guint day)
|
1998-09-27 18:32:00 +00:00
|
|
|
|
{
|
2010-08-12 15:14:51 +00:00
|
|
|
|
GtkCalendarPrivate *priv = calendar->priv;
|
|
|
|
|
gint old_focus_row = priv->focus_row;
|
|
|
|
|
gint old_focus_col = priv->focus_col;
|
2005-05-11 19:16:19 +00:00
|
|
|
|
gint row;
|
|
|
|
|
gint col;
|
2011-01-24 02:50:39 +00:00
|
|
|
|
|
2005-05-11 19:16:19 +00:00
|
|
|
|
for (row = 0; row < 6; row ++)
|
|
|
|
|
for (col = 0; col < 7; col++)
|
|
|
|
|
{
|
2011-01-24 02:50:39 +00:00
|
|
|
|
if (priv->day_month[row][col] == MONTH_CURRENT
|
|
|
|
|
&& priv->day[row][col] == day)
|
|
|
|
|
{
|
|
|
|
|
priv->focus_row = row;
|
|
|
|
|
priv->focus_col = col;
|
|
|
|
|
}
|
2005-05-11 19:16:19 +00:00
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
if (old_focus_row != -1 && old_focus_col != -1)
|
|
|
|
|
calendar_invalidate_day (calendar, old_focus_row, old_focus_col);
|
2011-01-24 02:50:39 +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)
|
|
|
|
|
{
|
2010-08-12 15:14:51 +00:00
|
|
|
|
GtkCalendarPrivate *priv = calendar->priv;
|
|
|
|
|
|
2013-06-27 19:02:52 +00:00
|
|
|
|
return (priv->main_h - CALENDAR_MARGIN
|
2011-01-24 02:50:39 +00:00
|
|
|
|
- ((priv->display_flags & GTK_CALENDAR_SHOW_DAY_NAMES)
|
|
|
|
|
? calendar_get_ysep (calendar) : CALENDAR_MARGIN)) / 6;
|
1998-09-27 18:32:00 +00:00
|
|
|
|
}
|
|
|
|
|
|
2014-05-04 16:41:00 +00:00
|
|
|
|
static void
|
|
|
|
|
get_component_paddings (GtkCalendar *calendar,
|
|
|
|
|
GtkBorder *day_padding,
|
|
|
|
|
GtkBorder *day_name_padding,
|
|
|
|
|
GtkBorder *week_padding)
|
|
|
|
|
{
|
|
|
|
|
GtkStyleContext * context;
|
|
|
|
|
GtkWidget *widget;
|
|
|
|
|
|
|
|
|
|
widget = GTK_WIDGET (calendar);
|
|
|
|
|
context = gtk_widget_get_style_context (widget);
|
|
|
|
|
|
|
|
|
|
if (day_padding)
|
|
|
|
|
{
|
|
|
|
|
gtk_style_context_save (context);
|
2017-11-18 13:18:11 +00:00
|
|
|
|
gtk_style_context_add_class (context, I_("day-number"));
|
2016-10-08 03:07:23 +00:00
|
|
|
|
gtk_style_context_get_padding (context, day_padding);
|
2014-05-04 16:41:00 +00:00
|
|
|
|
gtk_style_context_restore (context);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
if (day_name_padding)
|
|
|
|
|
{
|
|
|
|
|
gtk_style_context_save (context);
|
2017-11-18 13:18:11 +00:00
|
|
|
|
gtk_style_context_add_class (context, I_("day-name"));
|
2016-10-08 03:07:23 +00:00
|
|
|
|
gtk_style_context_get_padding (context, day_name_padding);
|
2014-05-04 16:41:00 +00:00
|
|
|
|
gtk_style_context_restore (context);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
if (week_padding)
|
|
|
|
|
{
|
|
|
|
|
gtk_style_context_save (context);
|
2017-11-18 13:18:11 +00:00
|
|
|
|
gtk_style_context_add_class (context, I_("week-number"));
|
2016-10-08 03:07:23 +00:00
|
|
|
|
gtk_style_context_get_padding (context, week_padding);
|
2014-05-04 16:41:00 +00:00
|
|
|
|
gtk_style_context_restore (context);
|
|
|
|
|
}
|
|
|
|
|
}
|
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,
|
2011-01-24 02:50:39 +00:00
|
|
|
|
gint column)
|
1998-09-27 18:32:00 +00:00
|
|
|
|
{
|
2010-08-12 15:14:51 +00:00
|
|
|
|
GtkCalendarPrivate *priv = calendar->priv;
|
2005-05-11 19:16:19 +00:00
|
|
|
|
gint width;
|
|
|
|
|
gint x_left;
|
2010-10-24 05:22:13 +00:00
|
|
|
|
gint week_width;
|
2010-08-03 15:45:14 +00:00
|
|
|
|
gint calendar_xsep = calendar_get_xsep (calendar);
|
2010-10-24 05:22:13 +00:00
|
|
|
|
gint inner_border = calendar_get_inner_border (calendar);
|
|
|
|
|
|
2017-11-10 13:34:12 +00:00
|
|
|
|
get_component_paddings (calendar, NULL, NULL, NULL);
|
2010-10-24 05:22:13 +00:00
|
|
|
|
|
2017-11-10 13:34:12 +00:00
|
|
|
|
week_width = priv->week_width + inner_border;
|
2010-08-03 15:45:14 +00:00
|
|
|
|
|
2005-05-11 19:16:19 +00:00
|
|
|
|
if (gtk_widget_get_direction (GTK_WIDGET (calendar)) == GTK_TEXT_DIR_RTL)
|
2010-10-24 05:22:13 +00:00
|
|
|
|
{
|
|
|
|
|
column = 6 - column;
|
|
|
|
|
week_width = 0;
|
|
|
|
|
}
|
2005-05-11 19:16:19 +00:00
|
|
|
|
|
2013-06-27 19:02:52 +00:00
|
|
|
|
width = calendar->priv->day_width;
|
2010-08-12 15:14:51 +00:00
|
|
|
|
if (priv->display_flags & GTK_CALENDAR_SHOW_WEEK_NUMBERS)
|
2010-10-24 05:22:13 +00:00
|
|
|
|
x_left = week_width + calendar_xsep + (width + DAY_XSEP) * column;
|
2005-05-11 19:16:19 +00:00
|
|
|
|
else
|
2010-10-24 05:22:13 +00:00
|
|
|
|
x_left = week_width + CALENDAR_MARGIN + (width + DAY_XSEP) * column;
|
2011-01-24 02:50:39 +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,
|
2011-01-24 02:50:39 +00:00
|
|
|
|
gint event_x)
|
2005-05-11 19:16:19 +00:00
|
|
|
|
{
|
|
|
|
|
gint c, column;
|
|
|
|
|
gint x_left, x_right;
|
2011-01-24 02:50:39 +00:00
|
|
|
|
|
2005-05-11 19:16:19 +00:00
|
|
|
|
column = -1;
|
2011-01-24 02:50:39 +00:00
|
|
|
|
|
2005-05-11 19:16:19 +00:00
|
|
|
|
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);
|
2013-06-27 19:02:52 +00:00
|
|
|
|
x_right = x_left + calendar->priv->day_width;
|
2011-01-24 02:50:39 +00:00
|
|
|
|
|
2005-05-11 19:16:19 +00:00
|
|
|
|
if (event_x >= x_left && event_x < x_right)
|
2011-01-24 02:50:39 +00:00
|
|
|
|
{
|
|
|
|
|
column = c;
|
|
|
|
|
break;
|
|
|
|
|
}
|
1998-09-27 18:32:00 +00:00
|
|
|
|
}
|
2011-01-24 02:50:39 +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,
|
2011-01-24 02:50:39 +00:00
|
|
|
|
gint row)
|
1998-09-27 18:32:00 +00:00
|
|
|
|
{
|
2014-10-02 00:09:10 +00:00
|
|
|
|
GtkCalendarPrivate *priv = calendar->priv;
|
|
|
|
|
gint inner_border = calendar_get_inner_border (calendar);
|
2010-10-24 05:22:13 +00:00
|
|
|
|
|
2017-11-10 13:34:12 +00:00
|
|
|
|
return priv->header_h + priv->day_name_h + inner_border
|
2014-10-02 00:09:10 +00:00
|
|
|
|
+ row * calendar_row_height (calendar);
|
2005-05-11 19:16:19 +00:00
|
|
|
|
}
|
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,
|
2010-10-24 05:22:13 +00:00
|
|
|
|
gint event_y)
|
2005-05-11 19:16:19 +00:00
|
|
|
|
{
|
|
|
|
|
gint r, row;
|
|
|
|
|
gint height;
|
|
|
|
|
gint y_top, y_bottom;
|
2011-01-24 02:50:39 +00:00
|
|
|
|
|
2005-05-11 19:16:19 +00:00
|
|
|
|
height = calendar_row_height (calendar);
|
|
|
|
|
row = -1;
|
2011-01-24 02:50:39 +00:00
|
|
|
|
|
2005-05-11 19:16:19 +00:00
|
|
|
|
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;
|
2011-01-24 02:50:39 +00:00
|
|
|
|
|
2005-05-11 19:16:19 +00:00
|
|
|
|
if (event_y >= y_top && event_y < y_bottom)
|
2011-01-24 02:50:39 +00:00
|
|
|
|
{
|
|
|
|
|
row = r;
|
|
|
|
|
break;
|
|
|
|
|
}
|
1998-10-04 23:07:04 +00:00
|
|
|
|
}
|
2011-01-24 02:50:39 +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,
|
2011-01-24 02:50:39 +00:00
|
|
|
|
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);
|
2013-06-27 19:02:52 +00:00
|
|
|
|
GtkCalendarPrivate *priv = calendar->priv;
|
2017-11-10 13:34:12 +00:00
|
|
|
|
int width;
|
2005-05-11 19:16:19 +00:00
|
|
|
|
gboolean year_left;
|
1998-10-04 23:07:04 +00:00
|
|
|
|
|
2017-11-10 13:34:12 +00:00
|
|
|
|
width = gtk_widget_get_width (widget);
|
2010-08-11 21:17:18 +00:00
|
|
|
|
|
2010-10-24 05:22:13 +00:00
|
|
|
|
if (gtk_widget_get_direction (widget) == GTK_TEXT_DIR_LTR)
|
2005-05-11 19:16:19 +00:00
|
|
|
|
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;
|
2010-08-12 15:14:51 +00:00
|
|
|
|
|
2005-05-11 19:16:19 +00:00
|
|
|
|
rect->y = 3;
|
|
|
|
|
rect->width = priv->arrow_width;
|
|
|
|
|
rect->height = priv->header_h - 7;
|
2010-08-12 15:14:51 +00:00
|
|
|
|
|
2005-05-11 19:16:19 +00:00
|
|
|
|
switch (arrow)
|
1998-10-04 23:07:04 +00:00
|
|
|
|
{
|
2005-05-11 19:16:19 +00:00
|
|
|
|
case ARROW_MONTH_LEFT:
|
2010-10-24 05:22:13 +00:00
|
|
|
|
if (year_left)
|
2017-11-10 13:34:12 +00:00
|
|
|
|
rect->x = (width - (3 + 2 * priv->arrow_width + priv->max_month_width));
|
2005-05-11 19:16:19 +00:00
|
|
|
|
else
|
2011-01-24 02:50:39 +00:00
|
|
|
|
rect->x = 3;
|
2005-05-11 19:16:19 +00:00
|
|
|
|
break;
|
|
|
|
|
case ARROW_MONTH_RIGHT:
|
2010-10-24 05:22:13 +00:00
|
|
|
|
if (year_left)
|
2017-11-10 13:34:12 +00:00
|
|
|
|
rect->x = width - 3 - priv->arrow_width;
|
2005-05-11 19:16:19 +00:00
|
|
|
|
else
|
2017-11-10 13:34:12 +00:00
|
|
|
|
rect->x = priv->arrow_width + priv->max_month_width;
|
2005-05-11 19:16:19 +00:00
|
|
|
|
break;
|
|
|
|
|
case ARROW_YEAR_LEFT:
|
2010-10-24 05:22:13 +00:00
|
|
|
|
if (year_left)
|
2011-01-24 02:50:39 +00:00
|
|
|
|
rect->x = 3;
|
2005-05-11 19:16:19 +00:00
|
|
|
|
else
|
2017-11-10 13:34:12 +00:00
|
|
|
|
rect->x = width - (3 + 2 * priv->arrow_width + priv->max_year_width);
|
2005-05-11 19:16:19 +00:00
|
|
|
|
break;
|
|
|
|
|
case ARROW_YEAR_RIGHT:
|
2010-10-24 05:22:13 +00:00
|
|
|
|
if (year_left)
|
2010-08-12 15:14:51 +00:00
|
|
|
|
rect->x = (priv->arrow_width + priv->max_year_width);
|
2005-05-11 19:16:19 +00:00
|
|
|
|
else
|
2017-11-10 13:34:12 +00:00
|
|
|
|
rect->x = width - 3 - priv->arrow_width;
|
2005-05-11 19:16:19 +00:00
|
|
|
|
break;
|
2017-08-01 18:42:17 +00:00
|
|
|
|
|
|
|
|
|
default:
|
|
|
|
|
g_assert_not_reached();
|
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,
|
2011-01-24 02:50:39 +00:00
|
|
|
|
gint row,
|
|
|
|
|
gint col,
|
|
|
|
|
GdkRectangle *rect)
|
1998-09-27 18:32:00 +00:00
|
|
|
|
{
|
2013-06-27 19:02:52 +00:00
|
|
|
|
GtkCalendarPrivate *priv = calendar->priv;
|
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
|
|
|
|
{
|
2010-08-12 15:14:51 +00:00
|
|
|
|
GtkCalendarPrivate *priv = calendar->priv;
|
2005-05-11 19:16:19 +00:00
|
|
|
|
gint month_len;
|
2011-01-24 02:50:39 +00:00
|
|
|
|
|
2010-08-12 15:14:51 +00:00
|
|
|
|
if (priv->display_flags & GTK_CALENDAR_NO_MONTH_CHANGE)
|
2005-05-11 19:16:19 +00:00
|
|
|
|
return;
|
2010-08-12 15:14:51 +00:00
|
|
|
|
|
|
|
|
|
if (priv->month == 0)
|
1998-09-27 18:32:00 +00:00
|
|
|
|
{
|
2010-08-12 15:14:51 +00:00
|
|
|
|
priv->month = 11;
|
|
|
|
|
priv->year--;
|
|
|
|
|
}
|
|
|
|
|
else
|
|
|
|
|
priv->month--;
|
|
|
|
|
|
|
|
|
|
month_len = month_length[leap (priv->year)][priv->month + 1];
|
|
|
|
|
|
2005-05-11 19:16:19 +00:00
|
|
|
|
calendar_compute_days (calendar);
|
2011-01-24 02:50:39 +00:00
|
|
|
|
|
2005-05-11 19:16:19 +00:00
|
|
|
|
g_signal_emit (calendar,
|
2011-01-24 02:50:39 +00:00
|
|
|
|
gtk_calendar_signals[PREV_MONTH_SIGNAL],
|
|
|
|
|
0);
|
2005-05-11 19:16:19 +00:00
|
|
|
|
g_signal_emit (calendar,
|
2011-01-24 02:50:39 +00:00
|
|
|
|
gtk_calendar_signals[MONTH_CHANGED_SIGNAL],
|
|
|
|
|
0);
|
2010-08-12 15:14:51 +00:00
|
|
|
|
|
|
|
|
|
if (month_len < priv->selected_day)
|
1998-09-27 18:32:00 +00:00
|
|
|
|
{
|
2010-08-12 15:14:51 +00:00
|
|
|
|
priv->selected_day = 0;
|
2005-05-11 19:16:19 +00:00
|
|
|
|
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
|
|
|
|
{
|
2010-08-12 15:14:51 +00:00
|
|
|
|
if (priv->selected_day < 0)
|
2011-01-24 02:50:39 +00:00
|
|
|
|
priv->selected_day = priv->selected_day + 1 + month_length[leap (priv->year)][priv->month + 1];
|
2010-08-12 15:14:51 +00:00
|
|
|
|
gtk_calendar_select_day (calendar, priv->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 *
|
|
|
|
|
****************************************/
|
|
|
|
|
|
|
|
|
|
static void
|
2010-09-18 23:55:42 +00:00
|
|
|
|
gtk_calendar_destroy (GtkWidget *widget)
|
2005-05-11 19:16:19 +00:00
|
|
|
|
{
|
2013-06-27 19:02:52 +00:00
|
|
|
|
GtkCalendarPrivate *priv = GTK_CALENDAR (widget)->priv;
|
2007-12-27 20:41:08 +00:00
|
|
|
|
|
2010-09-18 23:55:42 +00:00
|
|
|
|
calendar_stop_spinning (GTK_CALENDAR (widget));
|
2010-08-12 15:14:51 +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;
|
|
|
|
|
}
|
|
|
|
|
|
2010-09-18 23:55:42 +00:00
|
|
|
|
GTK_WIDGET_CLASS (gtk_calendar_parent_class)->destroy (widget);
|
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
|
|
|
|
|
2014-06-07 18:07:07 +00:00
|
|
|
|
static gboolean
|
2005-05-11 19:16:19 +00:00
|
|
|
|
calendar_set_display_option (GtkCalendar *calendar,
|
2011-01-24 02:50:39 +00:00
|
|
|
|
GtkCalendarDisplayOptions flag,
|
|
|
|
|
gboolean setting)
|
2005-05-11 19:16:19 +00:00
|
|
|
|
{
|
2010-08-12 15:14:51 +00:00
|
|
|
|
GtkCalendarPrivate *priv = calendar->priv;
|
2005-05-11 19:16:19 +00:00
|
|
|
|
GtkCalendarDisplayOptions flags;
|
2014-06-07 18:07:07 +00:00
|
|
|
|
gboolean old_setting;
|
|
|
|
|
|
|
|
|
|
old_setting = (priv->display_flags & flag) != 0;
|
|
|
|
|
if (old_setting == setting)
|
|
|
|
|
return FALSE;
|
2010-08-12 15:14:51 +00:00
|
|
|
|
|
|
|
|
|
if (setting)
|
|
|
|
|
flags = priv->display_flags | flag;
|
2005-05-11 19:16:19 +00:00
|
|
|
|
else
|
2010-08-12 15:14:51 +00:00
|
|
|
|
flags = priv->display_flags & ~flag;
|
2014-06-07 18:07:07 +00:00
|
|
|
|
|
2008-08-04 16:12:23 +00:00
|
|
|
|
gtk_calendar_set_display_options (calendar, flags);
|
2014-06-07 18:07:07 +00:00
|
|
|
|
|
|
|
|
|
return TRUE;
|
2005-05-11 19:16:19 +00:00
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
static gboolean
|
|
|
|
|
calendar_get_display_option (GtkCalendar *calendar,
|
2011-01-24 02:50:39 +00:00
|
|
|
|
GtkCalendarDisplayOptions flag)
|
2005-05-11 19:16:19 +00:00
|
|
|
|
{
|
2010-08-12 15:14:51 +00:00
|
|
|
|
GtkCalendarPrivate *priv = calendar->priv;
|
|
|
|
|
|
|
|
|
|
return (priv->display_flags & flag) != 0;
|
2005-05-11 19:16:19 +00:00
|
|
|
|
}
|
|
|
|
|
|
2011-01-24 02:50:39 +00:00
|
|
|
|
static void
|
2005-05-11 19:16:19 +00:00
|
|
|
|
gtk_calendar_set_property (GObject *object,
|
2011-01-24 02:50:39 +00:00
|
|
|
|
guint prop_id,
|
|
|
|
|
const GValue *value,
|
|
|
|
|
GParamSpec *pspec)
|
2005-05-11 19:16:19 +00:00
|
|
|
|
{
|
2010-08-12 15:14:51 +00:00
|
|
|
|
GtkCalendar *calendar = GTK_CALENDAR (object);
|
|
|
|
|
GtkCalendarPrivate *priv = calendar->priv;
|
2005-05-11 19:16:19 +00:00
|
|
|
|
|
2011-01-24 02:50:39 +00:00
|
|
|
|
switch (prop_id)
|
2005-05-11 19:16:19 +00:00
|
|
|
|
{
|
|
|
|
|
case PROP_YEAR:
|
|
|
|
|
gtk_calendar_select_month (calendar,
|
2011-01-24 02:50:39 +00:00
|
|
|
|
priv->month,
|
|
|
|
|
g_value_get_int (value));
|
2005-05-11 19:16:19 +00:00
|
|
|
|
break;
|
|
|
|
|
case PROP_MONTH:
|
|
|
|
|
gtk_calendar_select_month (calendar,
|
2011-01-24 02:50:39 +00:00
|
|
|
|
g_value_get_int (value),
|
|
|
|
|
priv->year);
|
2005-05-11 19:16:19 +00:00
|
|
|
|
break;
|
|
|
|
|
case PROP_DAY:
|
|
|
|
|
gtk_calendar_select_day (calendar,
|
2011-01-24 02:50:39 +00:00
|
|
|
|
g_value_get_int (value));
|
2005-05-11 19:16:19 +00:00
|
|
|
|
break;
|
|
|
|
|
case PROP_SHOW_HEADING:
|
2014-06-07 18:07:07 +00:00
|
|
|
|
if (calendar_set_display_option (calendar,
|
|
|
|
|
GTK_CALENDAR_SHOW_HEADING,
|
|
|
|
|
g_value_get_boolean (value)))
|
|
|
|
|
g_object_notify (object, "show-heading");
|
2005-05-11 19:16:19 +00:00
|
|
|
|
break;
|
|
|
|
|
case PROP_SHOW_DAY_NAMES:
|
2014-06-07 18:07:07 +00:00
|
|
|
|
if (calendar_set_display_option (calendar,
|
|
|
|
|
GTK_CALENDAR_SHOW_DAY_NAMES,
|
|
|
|
|
g_value_get_boolean (value)))
|
|
|
|
|
g_object_notify (object, "show-day-names");
|
2005-05-11 19:16:19 +00:00
|
|
|
|
break;
|
|
|
|
|
case PROP_NO_MONTH_CHANGE:
|
2014-06-07 18:07:07 +00:00
|
|
|
|
if (calendar_set_display_option (calendar,
|
|
|
|
|
GTK_CALENDAR_NO_MONTH_CHANGE,
|
|
|
|
|
g_value_get_boolean (value)))
|
|
|
|
|
g_object_notify (object, "no-month-change");
|
2005-05-11 19:16:19 +00:00
|
|
|
|
break;
|
|
|
|
|
case PROP_SHOW_WEEK_NUMBERS:
|
2014-06-07 18:07:07 +00:00
|
|
|
|
if (calendar_set_display_option (calendar,
|
|
|
|
|
GTK_CALENDAR_SHOW_WEEK_NUMBERS,
|
|
|
|
|
g_value_get_boolean (value)))
|
|
|
|
|
g_object_notify (object, "show-week-numbers");
|
2005-05-11 19:16:19 +00:00
|
|
|
|
break;
|
2007-12-28 09:39:34 +00:00
|
|
|
|
case PROP_SHOW_DETAILS:
|
2014-06-07 18:07:07 +00:00
|
|
|
|
if (calendar_set_display_option (calendar,
|
|
|
|
|
GTK_CALENDAR_SHOW_DETAILS,
|
|
|
|
|
g_value_get_boolean (value)))
|
|
|
|
|
g_object_notify (object, "show-details");
|
2007-12-28 09:39:34 +00:00
|
|
|
|
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;
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
2011-01-24 02:50:39 +00:00
|
|
|
|
static void
|
2005-05-11 19:16:19 +00:00
|
|
|
|
gtk_calendar_get_property (GObject *object,
|
2011-01-24 02:50:39 +00:00
|
|
|
|
guint prop_id,
|
|
|
|
|
GValue *value,
|
|
|
|
|
GParamSpec *pspec)
|
2005-05-11 19:16:19 +00:00
|
|
|
|
{
|
2007-12-27 20:41:08 +00:00
|
|
|
|
GtkCalendar *calendar = GTK_CALENDAR (object);
|
2010-08-12 15:14:51 +00:00
|
|
|
|
GtkCalendarPrivate *priv = calendar->priv;
|
2005-05-11 19:16:19 +00:00
|
|
|
|
|
2011-01-24 02:50:39 +00:00
|
|
|
|
switch (prop_id)
|
2005-05-11 19:16:19 +00:00
|
|
|
|
{
|
|
|
|
|
case PROP_YEAR:
|
2010-08-12 15:14:51 +00:00
|
|
|
|
g_value_set_int (value, priv->year);
|
2005-05-11 19:16:19 +00:00
|
|
|
|
break;
|
|
|
|
|
case PROP_MONTH:
|
2010-08-12 15:14:51 +00:00
|
|
|
|
g_value_set_int (value, priv->month);
|
2005-05-11 19:16:19 +00:00
|
|
|
|
break;
|
|
|
|
|
case PROP_DAY:
|
2010-08-12 15:14:51 +00:00
|
|
|
|
g_value_set_int (value, priv->selected_day);
|
2005-05-11 19:16:19 +00:00
|
|
|
|
break;
|
|
|
|
|
case PROP_SHOW_HEADING:
|
|
|
|
|
g_value_set_boolean (value, calendar_get_display_option (calendar,
|
2011-01-24 02:50:39 +00:00
|
|
|
|
GTK_CALENDAR_SHOW_HEADING));
|
2005-05-11 19:16:19 +00:00
|
|
|
|
break;
|
|
|
|
|
case PROP_SHOW_DAY_NAMES:
|
|
|
|
|
g_value_set_boolean (value, calendar_get_display_option (calendar,
|
2011-01-24 02:50:39 +00:00
|
|
|
|
GTK_CALENDAR_SHOW_DAY_NAMES));
|
2005-05-11 19:16:19 +00:00
|
|
|
|
break;
|
|
|
|
|
case PROP_NO_MONTH_CHANGE:
|
|
|
|
|
g_value_set_boolean (value, calendar_get_display_option (calendar,
|
2011-01-24 02:50:39 +00:00
|
|
|
|
GTK_CALENDAR_NO_MONTH_CHANGE));
|
2005-05-11 19:16:19 +00:00
|
|
|
|
break;
|
|
|
|
|
case PROP_SHOW_WEEK_NUMBERS:
|
|
|
|
|
g_value_set_boolean (value, calendar_get_display_option (calendar,
|
2011-01-24 02:50:39 +00:00
|
|
|
|
GTK_CALENDAR_SHOW_WEEK_NUMBERS));
|
2005-05-11 19:16:19 +00:00
|
|
|
|
break;
|
2007-12-28 09:39:34 +00:00
|
|
|
|
case PROP_SHOW_DETAILS:
|
|
|
|
|
g_value_set_boolean (value, calendar_get_display_option (calendar,
|
2011-01-24 02:50:39 +00:00
|
|
|
|
GTK_CALENDAR_SHOW_DETAILS));
|
2007-12-28 09:39:34 +00:00
|
|
|
|
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;
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
2010-08-03 15:45:14 +00:00
|
|
|
|
static gint
|
|
|
|
|
calendar_get_inner_border (GtkCalendar *calendar)
|
|
|
|
|
{
|
2017-06-18 10:46:30 +00:00
|
|
|
|
return 4;
|
2010-08-03 15:45:14 +00:00
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
static gint
|
|
|
|
|
calendar_get_xsep (GtkCalendar *calendar)
|
|
|
|
|
{
|
2017-06-18 10:46:30 +00:00
|
|
|
|
return 4;
|
2010-08-03 15:45:14 +00:00
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
static gint
|
|
|
|
|
calendar_get_ysep (GtkCalendar *calendar)
|
|
|
|
|
{
|
|
|
|
|
|
2017-06-18 10:46:30 +00:00
|
|
|
|
return 4;
|
2010-08-03 15:45:14 +00:00
|
|
|
|
}
|
|
|
|
|
|
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)
|
|
|
|
|
{
|
2013-06-27 19:02:52 +00:00
|
|
|
|
GtkCalendarPrivate *priv = GTK_CALENDAR (calendar)->priv;
|
2007-12-28 09:26:20 +00:00
|
|
|
|
gint year, month;
|
|
|
|
|
|
2010-02-09 02:18:13 +00:00
|
|
|
|
if (priv->detail_func == NULL)
|
|
|
|
|
return NULL;
|
|
|
|
|
|
2010-08-12 15:14:51 +00:00
|
|
|
|
year = priv->year;
|
|
|
|
|
month = priv->month + priv->day_month[row][column] - MONTH_CURRENT;
|
2007-12-28 09:26:20 +00:00
|
|
|
|
|
|
|
|
|
if (month < 0)
|
|
|
|
|
{
|
|
|
|
|
month += 12;
|
|
|
|
|
year -= 1;
|
|
|
|
|
}
|
|
|
|
|
else if (month > 11)
|
|
|
|
|
{
|
|
|
|
|
month -= 12;
|
|
|
|
|
year += 1;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
return priv->detail_func (calendar,
|
|
|
|
|
year, month,
|
2010-08-12 15:14:51 +00:00
|
|
|
|
priv->day[row][column],
|
2007-12-28 09:26:20 +00:00
|
|
|
|
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)
|
|
|
|
|
{
|
|
|
|
|
GtkCalendar *calendar = GTK_CALENDAR (widget);
|
2013-06-27 19:02:52 +00:00
|
|
|
|
GtkCalendarPrivate *priv = calendar->priv;
|
2008-01-17 16:42:04 +00:00
|
|
|
|
gchar *detail = NULL;
|
2007-12-28 09:36:06 +00:00
|
|
|
|
GdkRectangle day_rect;
|
2010-10-24 05:22:13 +00:00
|
|
|
|
gint row, col;
|
2007-12-28 09:36:06 +00:00
|
|
|
|
|
2010-10-24 05:22:13 +00:00
|
|
|
|
col = calendar_column_from_x (calendar, x);
|
|
|
|
|
row = calendar_row_from_y (calendar, y);
|
2007-12-28 09:36:06 +00:00
|
|
|
|
|
2010-10-24 05:22:13 +00:00
|
|
|
|
if (col != -1 && row != -1 &&
|
|
|
|
|
(0 != (priv->detail_overflow[row] & (1 << col)) ||
|
|
|
|
|
0 == (priv->display_flags & GTK_CALENDAR_SHOW_DETAILS)))
|
|
|
|
|
{
|
|
|
|
|
detail = gtk_calendar_get_detail (calendar, row, col);
|
|
|
|
|
calendar_day_rectangle (calendar, row, col, &day_rect);
|
2007-12-28 09:36:06 +00:00
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
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
|
2011-01-24 02:50:39 +00:00
|
|
|
|
gtk_calendar_size_request (GtkWidget *widget,
|
|
|
|
|
GtkRequisition *requisition)
|
2005-05-11 19:16:19 +00:00
|
|
|
|
{
|
|
|
|
|
GtkCalendar *calendar = GTK_CALENDAR (widget);
|
2013-06-27 19:02:52 +00:00
|
|
|
|
GtkCalendarPrivate *priv = calendar->priv;
|
2017-11-10 13:34:12 +00:00
|
|
|
|
GtkBorder day_padding, day_name_padding, week_padding;
|
2005-05-11 19:16:19 +00:00
|
|
|
|
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;
|
2007-12-28 22:11:35 +00:00
|
|
|
|
gint max_detail_height;
|
2010-08-03 15:45:14 +00:00
|
|
|
|
gint inner_border = calendar_get_inner_border (calendar);
|
|
|
|
|
gint calendar_ysep = calendar_get_ysep (calendar);
|
|
|
|
|
gint calendar_xsep = calendar_get_xsep (calendar);
|
2007-12-28 22:11:35 +00:00
|
|
|
|
|
2014-05-04 16:34:11 +00:00
|
|
|
|
gboolean show_week_numbers = (priv->display_flags & GTK_CALENDAR_SHOW_WEEK_NUMBERS);
|
|
|
|
|
|
2005-05-11 19:16:19 +00:00
|
|
|
|
layout = gtk_widget_create_pango_layout (widget, NULL);
|
2011-01-24 02:50:39 +00:00
|
|
|
|
|
2005-05-11 19:16:19 +00:00
|
|
|
|
/*
|
2011-01-24 02:50:39 +00:00
|
|
|
|
* Calculate the requisition width for the widget.
|
2005-05-11 19:16:19 +00:00
|
|
|
|
*/
|
2011-01-24 02:50:39 +00:00
|
|
|
|
|
2005-05-11 19:16:19 +00:00
|
|
|
|
/* Header width */
|
2011-01-24 02:50:39 +00:00
|
|
|
|
|
2010-08-12 15:14:51 +00:00
|
|
|
|
if (priv->display_flags & GTK_CALENDAR_SHOW_HEADING)
|
2005-05-11 19:16:19 +00:00
|
|
|
|
{
|
|
|
|
|
priv->max_month_width = 0;
|
|
|
|
|
for (i = 0; i < 12; i++)
|
2011-01-24 02:50:39 +00:00
|
|
|
|
{
|
|
|
|
|
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.
|
2008-10-27 01:42:28 +00:00
|
|
|
|
* Translate it to the widest year text
|
2005-06-12 06:59:43 +00:00
|
|
|
|
*
|
|
|
|
|
* If you don't understand this, leave it as "2000"
|
|
|
|
|
*/
|
2011-01-24 02:50:39 +00:00
|
|
|
|
pango_layout_set_text (layout, C_("year measurement template", "2000"), -1);
|
2005-06-12 06:59:43 +00:00
|
|
|
|
pango_layout_get_pixel_extents (layout, NULL, &logical_rect);
|
|
|
|
|
priv->max_year_width = MAX (priv->max_year_width,
|
2011-01-24 02:50:39 +00:00
|
|
|
|
logical_rect.width + 8);
|
|
|
|
|
max_header_height = MAX (max_header_height, logical_rect.height);
|
|
|
|
|
}
|
|
|
|
|
else
|
2005-05-11 19:16:19 +00:00
|
|
|
|
{
|
|
|
|
|
priv->max_month_width = 0;
|
|
|
|
|
priv->max_year_width = 0;
|
|
|
|
|
}
|
2011-01-24 02:50:39 +00:00
|
|
|
|
|
2010-08-12 15:14:51 +00:00
|
|
|
|
if (priv->display_flags & GTK_CALENDAR_NO_MONTH_CHANGE)
|
2011-01-24 02:50:39 +00:00
|
|
|
|
header_width = (priv->max_month_width
|
|
|
|
|
+ priv->max_year_width
|
|
|
|
|
+ 3 * 3);
|
2005-05-11 19:16:19 +00:00
|
|
|
|
else
|
2011-01-24 02:50:39 +00:00
|
|
|
|
header_width = (priv->max_month_width
|
|
|
|
|
+ priv->max_year_width
|
|
|
|
|
+ 4 * priv->arrow_width + 3 * 3);
|
2005-05-11 19:16:19 +00:00
|
|
|
|
|
|
|
|
|
/* Mainwindow labels width */
|
2011-01-24 02:50:39 +00:00
|
|
|
|
|
2005-05-11 19:16:19 +00:00
|
|
|
|
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];
|
2008-10-27 01:42:28 +00:00
|
|
|
|
g_snprintf (buffer, sizeof (buffer), C_("calendar:day:digits", "%d"), i * 11);
|
2011-01-24 02:50:39 +00:00
|
|
|
|
pango_layout_set_text (layout, buffer, -1);
|
2005-05-11 19:16:19 +00:00
|
|
|
|
pango_layout_get_pixel_extents (layout, NULL, &logical_rect);
|
|
|
|
|
priv->min_day_width = MAX (priv->min_day_width,
|
2011-01-24 02:50:39 +00:00
|
|
|
|
logical_rect.width);
|
2005-05-11 19:16:19 +00:00
|
|
|
|
|
2006-01-26 20:40:18 +00:00
|
|
|
|
priv->max_day_char_ascent = MAX (priv->max_day_char_ascent,
|
2011-01-24 02:50:39 +00:00
|
|
|
|
PANGO_ASCENT (logical_rect));
|
|
|
|
|
priv->max_day_char_descent = MAX (priv->max_day_char_descent,
|
|
|
|
|
PANGO_DESCENT (logical_rect));
|
2005-05-11 19:16:19 +00:00
|
|
|
|
}
|
2011-01-24 02:50:39 +00:00
|
|
|
|
|
2006-01-26 20:40:18 +00:00
|
|
|
|
priv->max_label_char_ascent = 0;
|
|
|
|
|
priv->max_label_char_descent = 0;
|
2010-08-12 15:14:51 +00:00
|
|
|
|
if (priv->display_flags & GTK_CALENDAR_SHOW_DAY_NAMES)
|
2005-05-11 19:16:19 +00:00
|
|
|
|
for (i = 0; i < 7; i++)
|
|
|
|
|
{
|
2011-01-24 02:50:39 +00:00
|
|
|
|
pango_layout_set_text (layout, default_abbreviated_dayname[i], -1);
|
|
|
|
|
pango_layout_line_get_pixel_extents (pango_layout_get_lines_readonly (layout)->data, NULL, &logical_rect);
|
|
|
|
|
|
|
|
|
|
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));
|
2005-05-11 19:16:19 +00:00
|
|
|
|
}
|
2011-01-24 02:50:39 +00:00
|
|
|
|
|
2005-05-11 19:16:19 +00:00
|
|
|
|
priv->max_week_char_width = 0;
|
2014-05-04 16:34:11 +00:00
|
|
|
|
if (show_week_numbers)
|
2005-05-11 19:16:19 +00:00
|
|
|
|
for (i = 0; i < 9; i++)
|
|
|
|
|
{
|
2011-01-24 02:50:39 +00:00
|
|
|
|
gchar buffer[32];
|
|
|
|
|
g_snprintf (buffer, sizeof (buffer), C_("calendar:week:digits", "%d"), i * 11);
|
|
|
|
|
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,
|
|
|
|
|
logical_rect.width / 2);
|
2005-05-11 19:16:19 +00:00
|
|
|
|
}
|
2011-01-24 02:50:39 +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
|
|
|
|
|
2010-08-12 15:14:51 +00:00
|
|
|
|
if (priv->detail_func && (priv->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
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
2017-11-10 13:34:12 +00:00
|
|
|
|
get_component_paddings (calendar, &day_padding, &day_name_padding, &week_padding);
|
2014-05-04 16:34:11 +00:00
|
|
|
|
|
|
|
|
|
priv->min_day_width += day_padding.left + day_padding.right;
|
|
|
|
|
if (show_week_numbers)
|
|
|
|
|
priv->max_week_char_width += week_padding.left + week_padding.right;
|
|
|
|
|
|
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;
|
|
|
|
|
|
2014-05-04 17:07:15 +00:00
|
|
|
|
main_width = (7 * (priv->min_day_width) + (DAY_XSEP * 6) + CALENDAR_MARGIN * 2
|
2014-05-04 16:34:11 +00:00
|
|
|
|
+ (show_week_numbers
|
2014-05-04 17:07:15 +00:00
|
|
|
|
? priv->max_week_char_width * 2 + calendar_xsep * 2
|
2011-01-24 02:50:39 +00:00
|
|
|
|
: 0));
|
2010-08-11 21:17:18 +00:00
|
|
|
|
|
2017-11-10 13:34:12 +00:00
|
|
|
|
requisition->width = MAX (header_width, main_width + inner_border * 2);
|
2010-08-11 21:17:18 +00:00
|
|
|
|
|
2005-05-11 19:16:19 +00:00
|
|
|
|
/*
|
|
|
|
|
* Calculate the requisition height for the widget.
|
|
|
|
|
*/
|
2011-01-24 02:50:39 +00:00
|
|
|
|
|
2010-08-12 15:14:51 +00:00
|
|
|
|
if (priv->display_flags & GTK_CALENDAR_SHOW_HEADING)
|
2005-05-11 19:16:19 +00:00
|
|
|
|
{
|
2010-08-03 15:45:14 +00:00
|
|
|
|
priv->header_h = (max_header_height + calendar_ysep * 2);
|
2005-05-11 19:16:19 +00:00
|
|
|
|
}
|
|
|
|
|
else
|
|
|
|
|
{
|
|
|
|
|
priv->header_h = 0;
|
|
|
|
|
}
|
2011-01-24 02:50:39 +00:00
|
|
|
|
|
2010-08-12 15:14:51 +00:00
|
|
|
|
if (priv->display_flags & GTK_CALENDAR_SHOW_DAY_NAMES)
|
2005-05-11 19:16:19 +00:00
|
|
|
|
{
|
|
|
|
|
priv->day_name_h = (priv->max_label_char_ascent
|
2014-05-04 16:34:11 +00:00
|
|
|
|
+ priv->max_label_char_descent
|
|
|
|
|
+ day_name_padding.top + day_name_padding.bottom
|
2014-05-04 17:07:15 +00:00
|
|
|
|
+ calendar_margin);
|
2010-08-03 15:45:14 +00:00
|
|
|
|
calendar_margin = calendar_ysep;
|
2011-01-24 02:50:39 +00:00
|
|
|
|
}
|
2005-05-11 19:16:19 +00:00
|
|
|
|
else
|
|
|
|
|
{
|
|
|
|
|
priv->day_name_h = 0;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
priv->main_h = (CALENDAR_MARGIN + calendar_margin
|
2011-01-24 02:50:39 +00:00
|
|
|
|
+ 6 * (priv->max_day_char_ascent
|
|
|
|
|
+ priv->max_day_char_descent
|
2007-12-28 22:11:35 +00:00
|
|
|
|
+ max_detail_height
|
2014-05-04 17:07:15 +00:00
|
|
|
|
+ day_padding.top + day_padding.bottom)
|
2011-01-24 02:50:39 +00:00
|
|
|
|
+ DAY_YSEP * 5);
|
2010-10-24 05:22:13 +00:00
|
|
|
|
|
|
|
|
|
height = priv->header_h + priv->day_name_h + priv->main_h;
|
2010-08-11 21:17:18 +00:00
|
|
|
|
|
2017-11-10 13:34:12 +00:00
|
|
|
|
requisition->height = height + (inner_border * 2);
|
2005-05-11 19:16:19 +00:00
|
|
|
|
|
|
|
|
|
g_object_unref (layout);
|
|
|
|
|
}
|
2003-08-08 22:17:34 +00:00
|
|
|
|
|
2010-10-27 01:06:40 +00:00
|
|
|
|
static void
|
2016-10-22 14:06:14 +00:00
|
|
|
|
gtk_calendar_measure (GtkWidget *widget,
|
|
|
|
|
GtkOrientation orientation,
|
|
|
|
|
int for_size,
|
|
|
|
|
int *minimum,
|
|
|
|
|
int *natural,
|
|
|
|
|
int *minimum_baseline,
|
|
|
|
|
int *natural_baseline)
|
2010-10-27 01:06:40 +00:00
|
|
|
|
{
|
|
|
|
|
GtkRequisition requisition;
|
|
|
|
|
|
|
|
|
|
gtk_calendar_size_request (widget, &requisition);
|
|
|
|
|
|
2016-10-22 14:06:14 +00:00
|
|
|
|
if (orientation == GTK_ORIENTATION_HORIZONTAL)
|
|
|
|
|
*minimum = *natural = requisition.width;
|
|
|
|
|
else /* VERTICAL */
|
|
|
|
|
*minimum = *natural = requisition.height;
|
2010-10-27 01:06:40 +00:00
|
|
|
|
}
|
|
|
|
|
|
2005-05-11 19:16:19 +00:00
|
|
|
|
static void
|
2017-07-11 07:58:21 +00:00
|
|
|
|
gtk_calendar_size_allocate (GtkWidget *widget,
|
|
|
|
|
const GtkAllocation *allocation,
|
2018-03-31 19:02:28 +00:00
|
|
|
|
int baseline)
|
2005-05-11 19:16:19 +00:00
|
|
|
|
{
|
|
|
|
|
GtkCalendar *calendar = GTK_CALENDAR (widget);
|
2013-06-27 19:02:52 +00:00
|
|
|
|
GtkCalendarPrivate *priv = calendar->priv;
|
2010-08-03 15:45:14 +00:00
|
|
|
|
gint inner_border = calendar_get_inner_border (calendar);
|
|
|
|
|
gint calendar_xsep = calendar_get_xsep (calendar);
|
|
|
|
|
|
2010-08-12 15:14:51 +00:00
|
|
|
|
if (priv->display_flags & GTK_CALENDAR_SHOW_WEEK_NUMBERS)
|
1998-09-27 18:32:00 +00:00
|
|
|
|
{
|
2005-05-11 19:16:19 +00:00
|
|
|
|
priv->day_width = (priv->min_day_width
|
2017-11-10 13:34:12 +00:00
|
|
|
|
* ((allocation->width - (inner_border * 2)
|
2011-01-24 02:50:39 +00:00
|
|
|
|
- (CALENDAR_MARGIN * 2) - (DAY_XSEP * 6) - calendar_xsep * 2))
|
|
|
|
|
/ (7 * priv->min_day_width + priv->max_week_char_width * 2));
|
2017-11-10 13:34:12 +00:00
|
|
|
|
priv->week_width = ((allocation->width - (inner_border * 2)
|
2011-01-24 02:50:39 +00:00
|
|
|
|
- (CALENDAR_MARGIN * 2) - (DAY_XSEP * 6) - calendar_xsep * 2 )
|
|
|
|
|
- priv->day_width * 7 + CALENDAR_MARGIN + calendar_xsep);
|
|
|
|
|
}
|
|
|
|
|
else
|
1998-09-27 18:32:00 +00:00
|
|
|
|
{
|
2005-05-11 19:16:19 +00:00
|
|
|
|
priv->day_width = (allocation->width
|
2011-01-24 02:50:39 +00:00
|
|
|
|
- (inner_border * 2)
|
|
|
|
|
- (CALENDAR_MARGIN * 2)
|
|
|
|
|
- (DAY_XSEP * 6))/7;
|
2005-05-11 19:16:19 +00:00
|
|
|
|
priv->week_width = 0;
|
1998-09-27 18:32:00 +00:00
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
2017-06-27 18:48:14 +00:00
|
|
|
|
|
2005-05-11 19:16:19 +00:00
|
|
|
|
/****************************************
|
|
|
|
|
* Repainting *
|
|
|
|
|
****************************************/
|
|
|
|
|
|
|
|
|
|
static void
|
2016-12-23 11:07:22 +00:00
|
|
|
|
calendar_snapshot_header (GtkCalendar *calendar,
|
|
|
|
|
GtkSnapshot *snapshot)
|
1998-09-27 18:32:00 +00:00
|
|
|
|
{
|
2005-05-11 19:16:19 +00:00
|
|
|
|
GtkWidget *widget = GTK_WIDGET (calendar);
|
2013-06-27 19:02:52 +00:00
|
|
|
|
GtkCalendarPrivate *priv = calendar->priv;
|
2011-01-10 19:40:37 +00:00
|
|
|
|
GtkStyleContext *context;
|
2016-03-11 13:34:01 +00:00
|
|
|
|
GtkStateFlags state;
|
2005-05-11 19:16:19 +00:00
|
|
|
|
char buffer[255];
|
2010-09-23 09:53:54 +00:00
|
|
|
|
gint 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
|
|
|
|
|
2011-01-10 19:40:37 +00:00
|
|
|
|
context = gtk_widget_get_style_context (widget);
|
2010-10-24 05:22:13 +00:00
|
|
|
|
|
|
|
|
|
if (gtk_widget_get_direction (widget) == GTK_TEXT_DIR_LTR)
|
2005-05-11 19:16:19 +00:00
|
|
|
|
year_left = priv->year_before;
|
|
|
|
|
else
|
|
|
|
|
year_left = !priv->year_before;
|
|
|
|
|
|
2017-11-10 13:34:12 +00:00
|
|
|
|
header_width = gtk_widget_get_width (widget);
|
2010-08-11 21:17:18 +00:00
|
|
|
|
|
2005-05-11 19:16:19 +00:00
|
|
|
|
max_month_width = priv->max_month_width;
|
|
|
|
|
max_year_width = priv->max_year_width;
|
2010-08-11 21:17:18 +00:00
|
|
|
|
|
2016-03-11 13:34:01 +00:00
|
|
|
|
state = gtk_style_context_get_state (context);
|
|
|
|
|
state &= ~GTK_STATE_FLAG_DROP_ACTIVE;
|
|
|
|
|
|
2011-01-10 19:40:37 +00:00
|
|
|
|
gtk_style_context_save (context);
|
2016-03-11 13:34:01 +00:00
|
|
|
|
|
|
|
|
|
gtk_style_context_set_state (context, state);
|
2011-01-10 19:40:37 +00:00
|
|
|
|
gtk_style_context_add_class (context, GTK_STYLE_CLASS_HEADER);
|
2010-10-24 05:22:13 +00:00
|
|
|
|
|
2016-12-23 11:07:22 +00:00
|
|
|
|
gtk_snapshot_render_background (snapshot, context, 0, 0, header_width, priv->header_h);
|
|
|
|
|
gtk_snapshot_render_frame (snapshot, context, 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);
|
2010-08-12 15:14:51 +00:00
|
|
|
|
tm->tm_year = priv->year - 1900;
|
2005-06-12 06:59:43 +00:00
|
|
|
|
|
|
|
|
|
/* Translators: This dictates how the year is displayed in
|
|
|
|
|
* gtkcalendar widget. See strftime() manual for the format.
|
|
|
|
|
* Use only ASCII in the translation.
|
|
|
|
|
*
|
2008-10-27 01:42:28 +00:00
|
|
|
|
* Also look for the msgid "2000".
|
2005-06-12 06:59:43 +00:00
|
|
|
|
* Translate that entry to a year with the widest output of this
|
2008-10-27 01:42:28 +00:00
|
|
|
|
* msgid.
|
|
|
|
|
*
|
|
|
|
|
* "%Y" is appropriate for most locales.
|
2005-06-12 06:59:43 +00:00
|
|
|
|
*/
|
2008-10-27 01:42:28 +00:00
|
|
|
|
strftime (buffer, sizeof (buffer), C_("calendar year format", "%Y"), tm);
|
2005-06-12 06:59:43 +00:00
|
|
|
|
str = g_locale_to_utf8 (buffer, -1, NULL, NULL, NULL);
|
|
|
|
|
layout = gtk_widget_create_pango_layout (widget, str);
|
|
|
|
|
g_free (str);
|
2011-01-24 02:50:39 +00:00
|
|
|
|
|
2000-07-02 21:32:56 +00:00
|
|
|
|
pango_layout_get_pixel_extents (layout, NULL, &logical_rect);
|
2011-01-24 02:50:39 +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;
|
2011-01-24 02:50:39 +00:00
|
|
|
|
|
1998-09-27 18:32:00 +00:00
|
|
|
|
/* Draw year and its arrows */
|
2011-01-24 02:50:39 +00:00
|
|
|
|
|
2010-08-12 15:14:51 +00:00
|
|
|
|
if (priv->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
|
2011-01-24 02:50:39 +00:00
|
|
|
|
- (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
|
2011-01-24 02:50:39 +00:00
|
|
|
|
- (max_year_width - logical_rect.width)/2);
|
2005-05-11 19:16:19 +00:00
|
|
|
|
|
2016-12-23 11:07:22 +00:00
|
|
|
|
gtk_snapshot_render_layout (snapshot, context, x, y, layout);
|
2011-01-10 19:40:37 +00:00
|
|
|
|
|
1998-09-27 18:32:00 +00:00
|
|
|
|
/* Draw month */
|
2010-08-12 15:14:51 +00:00
|
|
|
|
g_snprintf (buffer, sizeof (buffer), "%s", default_monthname[priv->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
|
|
|
|
|
2010-08-12 15:14:51 +00:00
|
|
|
|
if (priv->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
|
2011-01-24 02:50:39 +00:00
|
|
|
|
- (max_month_width - logical_rect.width)/2);
|
2003-08-08 22:17:34 +00:00
|
|
|
|
else
|
2017-03-18 06:06:35 +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
|
2011-01-24 02:50:39 +00:00
|
|
|
|
- (max_month_width - logical_rect.width)/2);
|
2003-08-08 22:17:34 +00:00
|
|
|
|
else
|
2017-03-18 06:06:35 +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
|
|
|
|
|
2016-12-23 11:07:22 +00:00
|
|
|
|
gtk_snapshot_render_layout (snapshot, context, x, y, layout);
|
2002-10-09 22:11:08 +00:00
|
|
|
|
g_object_unref (layout);
|
2010-09-04 17:16:26 +00:00
|
|
|
|
|
2011-01-10 19:40:37 +00:00
|
|
|
|
gtk_style_context_restore (context);
|
1998-09-27 18:32:00 +00:00
|
|
|
|
}
|
|
|
|
|
|
1998-10-01 13:24:42 +00:00
|
|
|
|
static void
|
2016-12-23 11:07:22 +00:00
|
|
|
|
calendar_snapshot_day_names (GtkCalendar *calendar,
|
|
|
|
|
GtkSnapshot *snapshot)
|
1998-09-27 18:32:00 +00:00
|
|
|
|
{
|
2005-05-11 19:16:19 +00:00
|
|
|
|
GtkWidget *widget = GTK_WIDGET (calendar);
|
2013-06-27 19:02:52 +00:00
|
|
|
|
GtkCalendarPrivate *priv = calendar->priv;
|
2011-01-10 19:40:37 +00:00
|
|
|
|
GtkStyleContext *context;
|
2016-03-11 13:34:01 +00:00
|
|
|
|
GtkStateFlags state;
|
2017-11-10 13:34:12 +00:00
|
|
|
|
GtkBorder day_name_padding;
|
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;
|
2010-08-03 15:45:14 +00:00
|
|
|
|
gint calendar_ysep = calendar_get_ysep (calendar);
|
|
|
|
|
gint calendar_xsep = calendar_get_xsep (calendar);
|
2010-10-24 05:22:13 +00:00
|
|
|
|
gint inner_border = calendar_get_inner_border (calendar);
|
|
|
|
|
|
2017-11-10 13:34:12 +00:00
|
|
|
|
get_component_paddings (calendar, NULL, &day_name_padding, NULL);
|
2011-01-10 19:40:37 +00:00
|
|
|
|
context = gtk_widget_get_style_context (widget);
|
2010-09-04 17:16:26 +00:00
|
|
|
|
|
2017-01-13 13:36:56 +00:00
|
|
|
|
gtk_snapshot_offset (snapshot,
|
2017-11-10 13:34:12 +00:00
|
|
|
|
inner_border,
|
|
|
|
|
priv->header_h + inner_border);
|
2010-08-11 21:17:18 +00:00
|
|
|
|
|
2005-05-11 19:16:19 +00:00
|
|
|
|
day_width = priv->day_width;
|
2017-11-10 13:34:12 +00:00
|
|
|
|
cal_width = gtk_widget_get_width (widget) - (inner_border * 2);
|
1998-09-27 18:32:00 +00:00
|
|
|
|
day_wid_sep = day_width + DAY_XSEP;
|
2011-01-24 02:50:39 +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
|
|
|
|
|
2016-03-11 13:34:01 +00:00
|
|
|
|
state = gtk_style_context_get_state (context);
|
|
|
|
|
state &= ~GTK_STATE_FLAG_DROP_ACTIVE;
|
|
|
|
|
|
2011-01-10 19:40:37 +00:00
|
|
|
|
gtk_style_context_save (context);
|
2016-03-11 13:34:01 +00:00
|
|
|
|
|
|
|
|
|
gtk_style_context_set_state (context, state);
|
2011-01-10 19:40:37 +00:00
|
|
|
|
gtk_style_context_add_class (context, GTK_STYLE_CLASS_HIGHLIGHT);
|
|
|
|
|
|
2016-12-23 11:07:22 +00:00
|
|
|
|
gtk_snapshot_render_background (snapshot, context,
|
|
|
|
|
CALENDAR_MARGIN, CALENDAR_MARGIN,
|
|
|
|
|
cal_width - CALENDAR_MARGIN * 2,
|
|
|
|
|
priv->day_name_h - CALENDAR_MARGIN);
|
2010-10-24 05:22:13 +00:00
|
|
|
|
|
2010-08-12 15:14:51 +00:00
|
|
|
|
if (priv->display_flags & GTK_CALENDAR_SHOW_WEEK_NUMBERS)
|
2016-12-23 11:07:22 +00:00
|
|
|
|
gtk_snapshot_render_background (snapshot, context,
|
|
|
|
|
CALENDAR_MARGIN,
|
|
|
|
|
priv->day_name_h - calendar_ysep,
|
|
|
|
|
priv->week_width - calendar_ysep - CALENDAR_MARGIN,
|
|
|
|
|
calendar_ysep);
|
2010-10-24 05:22:13 +00:00
|
|
|
|
|
1998-09-27 18:32:00 +00:00
|
|
|
|
/*
|
|
|
|
|
* Write the labels
|
|
|
|
|
*/
|
2000-07-02 22:30:54 +00:00
|
|
|
|
layout = gtk_widget_create_pango_layout (widget, NULL);
|
2005-05-11 19:16:19 +00:00
|
|
|
|
|
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)
|
2011-01-24 02:50:39 +00:00
|
|
|
|
day = 6 - i;
|
2000-11-12 22:15:43 +00:00
|
|
|
|
else
|
2011-01-24 02:50:39 +00:00
|
|
|
|
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
|
|
|
|
|
2016-12-23 11:07:22 +00:00
|
|
|
|
gtk_snapshot_render_layout (snapshot, context,
|
|
|
|
|
(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 + day_name_padding.top + logical_rect.y,
|
|
|
|
|
layout);
|
1998-09-27 18:32:00 +00:00
|
|
|
|
}
|
2010-10-24 05:22:13 +00:00
|
|
|
|
|
2002-10-09 22:11:08 +00:00
|
|
|
|
g_object_unref (layout);
|
2010-09-04 17:16:26 +00:00
|
|
|
|
|
2011-01-10 19:40:37 +00:00
|
|
|
|
gtk_style_context_restore (context);
|
2017-01-13 13:36:56 +00:00
|
|
|
|
gtk_snapshot_offset (snapshot,
|
2017-11-10 13:34:12 +00:00
|
|
|
|
- inner_border,
|
|
|
|
|
- (priv->header_h + inner_border));
|
1998-09-27 18:32:00 +00:00
|
|
|
|
}
|
|
|
|
|
|
1998-10-01 13:24:42 +00:00
|
|
|
|
static void
|
2016-12-23 11:07:22 +00:00
|
|
|
|
calendar_snapshot_week_numbers (GtkCalendar *calendar,
|
|
|
|
|
GtkSnapshot *snapshot)
|
1998-09-27 18:32:00 +00:00
|
|
|
|
{
|
2005-05-11 19:16:19 +00:00
|
|
|
|
GtkWidget *widget = GTK_WIDGET (calendar);
|
2013-06-27 19:02:52 +00:00
|
|
|
|
GtkCalendarPrivate *priv = calendar->priv;
|
2011-01-10 19:40:37 +00:00
|
|
|
|
GtkStyleContext *context;
|
2016-03-11 13:34:01 +00:00
|
|
|
|
GtkStateFlags state;
|
2017-11-10 13:34:12 +00:00
|
|
|
|
GtkBorder week_padding;
|
2007-12-19 22:57:01 +00:00
|
|
|
|
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;
|
2010-08-03 15:45:14 +00:00
|
|
|
|
gint calendar_xsep = calendar_get_xsep (calendar);
|
2010-10-24 05:22:13 +00:00
|
|
|
|
gint inner_border = calendar_get_inner_border (calendar);
|
|
|
|
|
gint x, y;
|
|
|
|
|
|
2017-11-10 13:34:12 +00:00
|
|
|
|
get_component_paddings (calendar, NULL, NULL, &week_padding);
|
2011-01-10 19:40:37 +00:00
|
|
|
|
context = gtk_widget_get_style_context (widget);
|
2010-09-04 17:16:26 +00:00
|
|
|
|
|
2017-11-10 13:34:12 +00:00
|
|
|
|
y = priv->header_h + priv->day_name_h + inner_border;
|
2010-10-24 05:22:13 +00:00
|
|
|
|
if (gtk_widget_get_direction (widget) == GTK_TEXT_DIR_LTR)
|
2017-11-10 13:34:12 +00:00
|
|
|
|
x = inner_border;
|
2010-10-24 05:22:13 +00:00
|
|
|
|
else
|
2017-11-10 13:34:12 +00:00
|
|
|
|
x = gtk_widget_get_width (widget) - priv->week_width - inner_border;
|
2010-08-03 15:45:14 +00:00
|
|
|
|
|
2016-03-11 13:34:01 +00:00
|
|
|
|
state = gtk_style_context_get_state (context);
|
|
|
|
|
state &= ~GTK_STATE_FLAG_DROP_ACTIVE;
|
|
|
|
|
|
2011-01-10 19:40:37 +00:00
|
|
|
|
gtk_style_context_save (context);
|
2016-03-11 13:34:01 +00:00
|
|
|
|
|
|
|
|
|
gtk_style_context_set_state (context, state);
|
2011-01-10 19:40:37 +00:00
|
|
|
|
gtk_style_context_add_class (context, GTK_STYLE_CLASS_HIGHLIGHT);
|
2005-05-11 19:16:19 +00:00
|
|
|
|
|
2010-10-24 05:22:13 +00:00
|
|
|
|
if (priv->display_flags & GTK_CALENDAR_SHOW_DAY_NAMES)
|
2016-12-23 11:07:22 +00:00
|
|
|
|
gtk_snapshot_render_background (snapshot, context,
|
|
|
|
|
x + CALENDAR_MARGIN, y,
|
|
|
|
|
priv->week_width - CALENDAR_MARGIN,
|
|
|
|
|
priv->main_h - CALENDAR_MARGIN);
|
1998-09-27 18:32:00 +00:00
|
|
|
|
else
|
2016-12-23 11:07:22 +00:00
|
|
|
|
gtk_snapshot_render_background (snapshot, context,
|
|
|
|
|
x + CALENDAR_MARGIN,
|
|
|
|
|
y + CALENDAR_MARGIN,
|
|
|
|
|
priv->week_width - CALENDAR_MARGIN,
|
|
|
|
|
priv->main_h - 2 * CALENDAR_MARGIN);
|
2010-10-24 05:22:13 +00:00
|
|
|
|
|
1998-09-27 18:32:00 +00:00
|
|
|
|
/*
|
|
|
|
|
* Write the labels
|
|
|
|
|
*/
|
2010-10-24 05:22:13 +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
|
|
|
|
day_height = calendar_row_height (calendar);
|
2011-01-10 19:40:37 +00:00
|
|
|
|
|
1998-09-27 18:32:00 +00:00
|
|
|
|
for (row = 0; row < 6; row++)
|
|
|
|
|
{
|
2014-12-24 01:28:49 +00:00
|
|
|
|
gint year, month, week;
|
2010-10-24 05:22:13 +00:00
|
|
|
|
|
2010-08-12 15:14:51 +00:00
|
|
|
|
year = priv->year;
|
2014-12-24 01:28:49 +00:00
|
|
|
|
month = priv->month + priv->day_month[row][6] - MONTH_CURRENT;
|
|
|
|
|
|
|
|
|
|
if (month < 0)
|
|
|
|
|
{
|
|
|
|
|
month += 12;
|
|
|
|
|
year -= 1;
|
|
|
|
|
}
|
|
|
|
|
else if (month > 11)
|
|
|
|
|
{
|
|
|
|
|
month -= 12;
|
|
|
|
|
year += 1;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
month += 1;
|
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
|
|
|
|
|
2014-12-24 01:28:49 +00:00
|
|
|
|
week = week_of_year (year, month, priv->day[row][6]);
|
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
|
2008-10-27 01:42:28 +00:00
|
|
|
|
* translate to "%d" otherwise.
|
2006-01-25 16:26:41 +00:00
|
|
|
|
*
|
|
|
|
|
* Note that translating this doesn't guarantee that you get localized
|
2008-10-27 01:42:28 +00:00
|
|
|
|
* digits. That needs support from your system and locale definition
|
2006-01-25 16:26:41 +00:00
|
|
|
|
* too.
|
|
|
|
|
*/
|
2008-10-27 01:42:28 +00:00
|
|
|
|
g_snprintf (buffer, sizeof (buffer), C_("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
|
|
|
|
|
2010-10-24 05:22:13 +00:00
|
|
|
|
x_loc = x + (priv->week_width
|
2011-01-24 02:50:39 +00:00
|
|
|
|
- logical_rect.width
|
2014-05-04 17:07:15 +00:00
|
|
|
|
- calendar_xsep - week_padding.right);
|
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
|
|
|
|
|
2016-12-23 11:07:22 +00:00
|
|
|
|
gtk_snapshot_render_layout (snapshot, context, x_loc, y_loc, layout);
|
1998-09-27 18:32:00 +00:00
|
|
|
|
}
|
2011-01-10 19:40:37 +00:00
|
|
|
|
|
2002-10-09 22:11:08 +00:00
|
|
|
|
g_object_unref (layout);
|
2010-09-04 17:16:26 +00:00
|
|
|
|
|
2011-01-10 19:40:37 +00:00
|
|
|
|
gtk_style_context_restore (context);
|
1998-09-27 18:32:00 +00:00
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
static void
|
2005-05-11 19:16:19 +00:00
|
|
|
|
calendar_invalidate_day_num (GtkCalendar *calendar,
|
2011-01-24 02:50:39 +00:00
|
|
|
|
gint day)
|
1998-09-27 18:32:00 +00:00
|
|
|
|
{
|
2017-06-27 18:48:14 +00:00
|
|
|
|
gtk_widget_queue_draw (GTK_WIDGET (calendar));
|
1998-09-27 18:32:00 +00:00
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
static void
|
2005-05-11 19:16:19 +00:00
|
|
|
|
calendar_invalidate_day (GtkCalendar *calendar,
|
2011-01-24 02:50:39 +00:00
|
|
|
|
gint row,
|
|
|
|
|
gint col)
|
1998-09-27 18:32:00 +00:00
|
|
|
|
{
|
2017-06-27 18:48:14 +00:00
|
|
|
|
gtk_widget_queue_draw (GTK_WIDGET (calendar));
|
2005-05-11 19:16:19 +00:00
|
|
|
|
}
|
|
|
|
|
|
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
|
2016-12-23 11:07:22 +00:00
|
|
|
|
calendar_snapshot_day (GtkCalendar *calendar,
|
|
|
|
|
GtkSnapshot *snapshot,
|
|
|
|
|
gint row,
|
|
|
|
|
gint col)
|
2005-05-11 19:16:19 +00:00
|
|
|
|
{
|
|
|
|
|
GtkWidget *widget = GTK_WIDGET (calendar);
|
2013-06-27 19:02:52 +00:00
|
|
|
|
GtkCalendarPrivate *priv = calendar->priv;
|
2011-01-10 19:40:37 +00:00
|
|
|
|
GtkStyleContext *context;
|
|
|
|
|
GtkStateFlags state = 0;
|
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
|
|
|
|
|
2011-01-10 19:40:37 +00:00
|
|
|
|
context = gtk_widget_get_style_context (widget);
|
2011-12-15 01:39:00 +00:00
|
|
|
|
state = gtk_widget_get_state_flags (widget);
|
2010-08-11 21:17:18 +00:00
|
|
|
|
|
2010-08-12 15:14:51 +00:00
|
|
|
|
day = priv->day[row][col];
|
|
|
|
|
show_details = (priv->display_flags & GTK_CALENDAR_SHOW_DETAILS);
|
2005-05-11 19:16:19 +00:00
|
|
|
|
|
|
|
|
|
calendar_day_rectangle (calendar, row, col, &day_rect);
|
2011-01-10 19:40:37 +00:00
|
|
|
|
|
|
|
|
|
gtk_style_context_save (context);
|
|
|
|
|
|
2016-03-11 13:34:01 +00:00
|
|
|
|
state &= ~(GTK_STATE_FLAG_INCONSISTENT | GTK_STATE_FLAG_ACTIVE | GTK_STATE_FLAG_SELECTED | GTK_STATE_FLAG_DROP_ACTIVE);
|
2011-12-15 01:39:00 +00:00
|
|
|
|
|
|
|
|
|
if (priv->day_month[row][col] == MONTH_PREV ||
|
|
|
|
|
priv->day_month[row][col] == MONTH_NEXT)
|
|
|
|
|
state |= GTK_STATE_FLAG_INCONSISTENT;
|
2011-01-10 19:40:37 +00:00
|
|
|
|
else
|
1998-09-27 18:32:00 +00:00
|
|
|
|
{
|
2011-12-15 01:39:00 +00:00
|
|
|
|
if (priv->marked_date[day-1])
|
|
|
|
|
state |= GTK_STATE_FLAG_ACTIVE;
|
2011-01-10 19:40:37 +00:00
|
|
|
|
|
2011-12-15 01:39:00 +00:00
|
|
|
|
if (priv->selected_day == day)
|
2011-01-10 19:40:37 +00:00
|
|
|
|
{
|
2011-12-15 01:39:00 +00:00
|
|
|
|
state |= GTK_STATE_FLAG_SELECTED;
|
2011-01-10 19:40:37 +00:00
|
|
|
|
|
2011-12-15 01:39:00 +00:00
|
|
|
|
gtk_style_context_set_state (context, state);
|
2016-12-23 11:07:22 +00:00
|
|
|
|
gtk_snapshot_render_background (snapshot, context,
|
|
|
|
|
day_rect.x, day_rect.y,
|
|
|
|
|
day_rect.width, day_rect.height);
|
2011-01-10 19:40:37 +00:00
|
|
|
|
}
|
1998-10-05 03:52:48 +00:00
|
|
|
|
}
|
|
|
|
|
|
2011-01-10 19:40:37 +00:00
|
|
|
|
gtk_style_context_set_state (context, state);
|
|
|
|
|
|
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
|
2008-10-27 01:42:28 +00:00
|
|
|
|
* translate to "%d" otherwise.
|
2006-01-25 16:26:41 +00:00
|
|
|
|
*
|
|
|
|
|
* Note that translating this doesn't guarantee that you get localized
|
2008-10-27 01:42:28 +00:00
|
|
|
|
* digits. That needs support from your system and locale definition
|
2006-01-25 16:26:41 +00:00
|
|
|
|
* too.
|
|
|
|
|
*/
|
2008-10-27 01:42:28 +00:00
|
|
|
|
g_snprintf (buffer, sizeof (buffer), C_("calendar:day:digits", "%d"), day);
|
2007-12-28 09:26:20 +00:00
|
|
|
|
|
|
|
|
|
/* Get extra information to show, if any: */
|
|
|
|
|
|
2010-02-09 02:18:13 +00:00
|
|
|
|
detail = gtk_calendar_get_detail (calendar, row, col);
|
2007-12-28 09:26:20 +00:00
|
|
|
|
|
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);
|
2011-01-24 02:50:39 +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
|
|
|
|
|
2016-12-23 11:07:22 +00:00
|
|
|
|
gtk_snapshot_render_layout (snapshot, context, x_loc, y_loc, layout);
|
2007-12-28 09:39:34 +00:00
|
|
|
|
|
2010-08-12 15:14:51 +00:00
|
|
|
|
if (priv->day_month[row][col] == MONTH_CURRENT &&
|
|
|
|
|
(priv->marked_date[day-1] || (detail && !show_details)))
|
2016-12-23 11:07:22 +00:00
|
|
|
|
gtk_snapshot_render_layout (snapshot, context, x_loc - 1, y_loc, 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
|
|
|
|
{
|
2011-01-10 19:40:37 +00:00
|
|
|
|
GdkRGBA color;
|
|
|
|
|
|
2016-10-08 03:07:23 +00:00
|
|
|
|
gtk_style_context_get_color (context, &color);
|
2007-12-28 09:26:20 +00:00
|
|
|
|
|
2017-01-13 03:46:09 +00:00
|
|
|
|
gtk_snapshot_append_color (snapshot,
|
|
|
|
|
&color,
|
|
|
|
|
&GRAPHENE_RECT_INIT (
|
|
|
|
|
day_rect.x + 2, y_loc,
|
|
|
|
|
day_rect.width - 2, 1
|
2018-04-24 01:17:23 +00:00
|
|
|
|
));
|
2007-12-28 09:36:57 +00:00
|
|
|
|
|
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);
|
|
|
|
|
|
2010-08-12 15:14:51 +00:00
|
|
|
|
if (day == priv->selected_day)
|
2007-12-28 09:26:20 +00:00
|
|
|
|
{
|
|
|
|
|
/* 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
|
|
|
|
|
2016-12-23 11:07:22 +00:00
|
|
|
|
gtk_snapshot_render_layout (snapshot, context, day_rect.x, y_loc, layout);
|
2007-12-28 09:26:20 +00:00
|
|
|
|
}
|
|
|
|
|
|
2011-08-10 14:00:38 +00:00
|
|
|
|
if (gtk_widget_has_visible_focus (widget) &&
|
|
|
|
|
priv->focus_row == row && priv->focus_col == col)
|
2016-12-23 11:07:22 +00:00
|
|
|
|
gtk_snapshot_render_focus (snapshot, context,
|
|
|
|
|
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);
|
|
|
|
|
|
2011-01-10 19:40:37 +00:00
|
|
|
|
gtk_style_context_restore (context);
|
2002-10-09 22:11:08 +00:00
|
|
|
|
g_object_unref (layout);
|
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
|
2016-12-23 11:07:22 +00:00
|
|
|
|
calendar_snapshot_main (GtkCalendar *calendar,
|
|
|
|
|
GtkSnapshot *snapshot)
|
1998-09-27 18:32:00 +00:00
|
|
|
|
{
|
2010-09-23 09:53:54 +00:00
|
|
|
|
gint row, col;
|
2011-01-24 02:50:39 +00:00
|
|
|
|
|
1998-09-27 18:32:00 +00:00
|
|
|
|
for (col = 0; col < 7; col++)
|
|
|
|
|
for (row = 0; row < 6; row++)
|
2016-12-23 11:07:22 +00:00
|
|
|
|
calendar_snapshot_day (calendar, snapshot, row, col);
|
1998-09-27 18:32:00 +00:00
|
|
|
|
}
|
|
|
|
|
|
2005-05-11 19:16:19 +00:00
|
|
|
|
static void
|
2016-12-23 11:07:22 +00:00
|
|
|
|
calendar_snapshot_arrow (GtkCalendar *calendar,
|
|
|
|
|
GtkSnapshot *snapshot,
|
|
|
|
|
guint arrow)
|
2005-05-11 19:16:19 +00:00
|
|
|
|
{
|
|
|
|
|
GtkWidget *widget = GTK_WIDGET (calendar);
|
2013-06-27 19:02:52 +00:00
|
|
|
|
GtkCalendarPrivate *priv = calendar->priv;
|
2016-12-23 11:07:22 +00:00
|
|
|
|
GtkCssImageBuiltinType image_type;
|
2011-01-10 19:40:37 +00:00
|
|
|
|
GtkStyleContext *context;
|
|
|
|
|
GtkStateFlags state;
|
2010-10-24 05:22:13 +00:00
|
|
|
|
GdkRectangle rect;
|
|
|
|
|
|
|
|
|
|
calendar_arrow_rectangle (calendar, arrow, &rect);
|
|
|
|
|
|
2011-01-10 19:40:37 +00:00
|
|
|
|
context = gtk_widget_get_style_context (widget);
|
2011-12-15 01:44:46 +00:00
|
|
|
|
state = gtk_widget_get_state_flags (widget);
|
|
|
|
|
|
|
|
|
|
if (priv->arrow_prelight & (1 << arrow))
|
|
|
|
|
state |= GTK_STATE_FLAG_PRELIGHT;
|
|
|
|
|
else
|
|
|
|
|
state &= ~(GTK_STATE_FLAG_PRELIGHT);
|
2010-08-11 21:17:18 +00:00
|
|
|
|
|
2011-01-10 19:40:37 +00:00
|
|
|
|
gtk_style_context_save (context);
|
|
|
|
|
gtk_style_context_set_state (context, state);
|
|
|
|
|
gtk_style_context_add_class (context, GTK_STYLE_CLASS_BUTTON);
|
|
|
|
|
|
2016-12-23 11:07:22 +00:00
|
|
|
|
gtk_snapshot_render_background (snapshot, context,
|
|
|
|
|
rect.x, rect.y,
|
|
|
|
|
rect.width, rect.height);
|
2005-05-11 19:16:19 +00:00
|
|
|
|
|
2010-10-24 05:22:13 +00:00
|
|
|
|
if (arrow == ARROW_MONTH_LEFT || arrow == ARROW_YEAR_LEFT)
|
2016-12-23 11:07:22 +00:00
|
|
|
|
image_type = GTK_CSS_IMAGE_BUILTIN_ARROW_LEFT;
|
2010-10-24 05:22:13 +00:00
|
|
|
|
else
|
2016-12-23 11:07:22 +00:00
|
|
|
|
image_type = GTK_CSS_IMAGE_BUILTIN_ARROW_RIGHT;
|
|
|
|
|
|
2017-01-13 13:36:56 +00:00
|
|
|
|
gtk_snapshot_offset (snapshot,
|
|
|
|
|
rect.x + (rect.width - 8) / 2,
|
|
|
|
|
rect.y + (rect.height - 8) / 2);
|
2016-12-23 11:07:22 +00:00
|
|
|
|
gtk_css_style_snapshot_icon (gtk_style_context_lookup_style (context),
|
|
|
|
|
snapshot,
|
|
|
|
|
8, 8,
|
|
|
|
|
image_type);
|
2017-01-13 13:36:56 +00:00
|
|
|
|
gtk_snapshot_offset (snapshot,
|
|
|
|
|
- rect.x - (rect.width - 8) / 2,
|
|
|
|
|
- rect.y - (rect.height - 8) / 2);
|
2010-09-04 17:16:26 +00:00
|
|
|
|
|
2011-01-10 19:40:37 +00:00
|
|
|
|
gtk_style_context_restore (context);
|
2005-05-11 19:16:19 +00:00
|
|
|
|
}
|
|
|
|
|
|
2016-12-23 11:07:22 +00:00
|
|
|
|
static void
|
|
|
|
|
gtk_calendar_snapshot (GtkWidget *widget,
|
|
|
|
|
GtkSnapshot *snapshot)
|
2005-05-11 19:16:19 +00:00
|
|
|
|
{
|
|
|
|
|
GtkCalendar *calendar = GTK_CALENDAR (widget);
|
2013-06-27 19:02:52 +00:00
|
|
|
|
GtkCalendarPrivate *priv = calendar->priv;
|
2005-05-11 19:16:19 +00:00
|
|
|
|
int i;
|
|
|
|
|
|
2016-12-23 11:07:22 +00:00
|
|
|
|
calendar_snapshot_main (calendar, snapshot);
|
2010-08-11 21:17:18 +00:00
|
|
|
|
|
2010-10-24 05:22:13 +00:00
|
|
|
|
if (priv->display_flags & GTK_CALENDAR_SHOW_HEADING)
|
|
|
|
|
{
|
2016-12-23 11:07:22 +00:00
|
|
|
|
calendar_snapshot_header (calendar, snapshot);
|
2010-10-24 05:22:13 +00:00
|
|
|
|
for (i = 0; i < 4; i++)
|
2016-12-23 11:07:22 +00:00
|
|
|
|
calendar_snapshot_arrow (calendar, snapshot, i);
|
2010-10-24 05:22:13 +00:00
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
if (priv->display_flags & GTK_CALENDAR_SHOW_DAY_NAMES)
|
2016-12-23 11:07:22 +00:00
|
|
|
|
calendar_snapshot_day_names (calendar, snapshot);
|
2010-10-24 05:22:13 +00:00
|
|
|
|
|
|
|
|
|
if (priv->display_flags & GTK_CALENDAR_SHOW_WEEK_NUMBERS)
|
2016-12-23 11:07:22 +00:00
|
|
|
|
calendar_snapshot_week_numbers (calendar, snapshot);
|
1998-09-27 18:32:00 +00:00
|
|
|
|
}
|
|
|
|
|
|
2010-08-11 21:17:18 +00:00
|
|
|
|
|
2005-05-11 19:16:19 +00:00
|
|
|
|
/****************************************
|
|
|
|
|
* Mouse handling *
|
|
|
|
|
****************************************/
|
|
|
|
|
|
|
|
|
|
static void
|
|
|
|
|
calendar_arrow_action (GtkCalendar *calendar,
|
2011-01-24 02:50:39 +00:00
|
|
|
|
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;
|
2013-06-27 19:02:52 +00:00
|
|
|
|
GtkCalendarPrivate *priv = calendar->priv;
|
2005-05-11 19:16:19 +00:00
|
|
|
|
gboolean retval = FALSE;
|
2011-01-24 02:50:39 +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)
|
2011-01-24 02:50:39 +00:00
|
|
|
|
{
|
|
|
|
|
priv->need_timer = FALSE;
|
2018-02-02 14:51:47 +00:00
|
|
|
|
priv->timer = g_timeout_add_full (G_PRIORITY_DEFAULT_IDLE,
|
2013-07-09 20:44:04 +00:00
|
|
|
|
TIMEOUT_REPEAT * SCROLL_DELAY_FACTOR,
|
2011-01-24 02:50:39 +00:00
|
|
|
|
(GSourceFunc) calendar_timer,
|
2018-02-02 14:51:47 +00:00
|
|
|
|
calendar, NULL);
|
2013-10-22 13:43:43 +00:00
|
|
|
|
g_source_set_name_by_id (priv->timer, "[gtk+] calendar_timer");
|
2011-01-24 02:50:39 +00:00
|
|
|
|
}
|
|
|
|
|
else
|
|
|
|
|
retval = TRUE;
|
2005-05-11 19:16:19 +00:00
|
|
|
|
}
|
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,
|
2011-01-24 02:50:39 +00:00
|
|
|
|
gint click_child)
|
1998-09-27 18:32:00 +00:00
|
|
|
|
{
|
2013-06-27 19:02:52 +00:00
|
|
|
|
GtkCalendarPrivate *priv = calendar->priv;
|
2005-05-11 19:16:19 +00:00
|
|
|
|
|
|
|
|
|
priv->click_child = click_child;
|
2011-01-24 02:50:39 +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
|
|
|
|
priv->need_timer = TRUE;
|
2018-02-02 14:51:47 +00:00
|
|
|
|
priv->timer = g_timeout_add_full (G_PRIORITY_DEFAULT_IDLE,
|
2013-07-09 20:44:04 +00:00
|
|
|
|
TIMEOUT_INITIAL,
|
2011-01-24 02:50:39 +00:00
|
|
|
|
(GSourceFunc) calendar_timer,
|
2018-02-02 14:51:47 +00:00
|
|
|
|
calendar, NULL);
|
2013-10-22 13:43:43 +00:00
|
|
|
|
g_source_set_name_by_id (priv->timer, "[gtk+] calendar_timer");
|
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
|
|
|
|
{
|
2013-06-27 19:02:52 +00:00
|
|
|
|
GtkCalendarPrivate *priv = calendar->priv;
|
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
|
2017-09-13 15:37:25 +00:00
|
|
|
|
calendar_main_button_press (GtkCalendar *calendar,
|
|
|
|
|
double x,
|
|
|
|
|
double y,
|
|
|
|
|
int n_press,
|
|
|
|
|
int button)
|
1998-09-27 18:32:00 +00:00
|
|
|
|
{
|
2005-05-11 19:16:19 +00:00
|
|
|
|
GtkWidget *widget = GTK_WIDGET (calendar);
|
2013-06-27 19:02:52 +00:00
|
|
|
|
GtkCalendarPrivate *priv = calendar->priv;
|
2005-05-11 19:16:19 +00:00
|
|
|
|
gint row, col;
|
|
|
|
|
gint day_month;
|
|
|
|
|
gint day;
|
2010-10-24 05:22:13 +00:00
|
|
|
|
|
2017-06-27 18:48:14 +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;
|
2010-10-24 05:22:13 +00:00
|
|
|
|
|
2010-08-12 15:14:51 +00:00
|
|
|
|
day_month = priv->day_month[row][col];
|
2005-05-11 19:16:19 +00:00
|
|
|
|
|
2017-09-13 15:37:25 +00:00
|
|
|
|
if (n_press == 1)
|
2000-02-26 11:39:07 +00:00
|
|
|
|
{
|
2010-08-12 15:14:51 +00:00
|
|
|
|
day = priv->day[row][col];
|
2010-10-24 05:22:13 +00:00
|
|
|
|
|
2005-05-11 19:16:19 +00:00
|
|
|
|
if (day_month == MONTH_PREV)
|
2010-10-24 05:22:13 +00:00
|
|
|
|
calendar_set_month_prev (calendar);
|
2005-05-11 19:16:19 +00:00
|
|
|
|
else if (day_month == MONTH_NEXT)
|
2010-10-24 05:22:13 +00:00
|
|
|
|
calendar_set_month_next (calendar);
|
|
|
|
|
|
2010-03-01 03:21:41 +00:00
|
|
|
|
if (!gtk_widget_has_focus (widget))
|
2010-10-24 05:22:13 +00:00
|
|
|
|
gtk_widget_grab_focus (widget);
|
|
|
|
|
|
2017-09-13 15:37:25 +00:00
|
|
|
|
if (button == GDK_BUTTON_PRIMARY)
|
2010-10-24 05:22:13 +00:00
|
|
|
|
{
|
|
|
|
|
priv->in_drag = 1;
|
|
|
|
|
priv->drag_start_x = x;
|
|
|
|
|
priv->drag_start_y = y;
|
|
|
|
|
}
|
2005-05-11 19:16:19 +00:00
|
|
|
|
|
|
|
|
|
calendar_select_and_focus_day (calendar, day);
|
2000-02-26 11:39:07 +00:00
|
|
|
|
}
|
2017-09-13 15:37:25 +00:00
|
|
|
|
else if (n_press == 2)
|
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)
|
2010-10-24 05:22:13 +00:00
|
|
|
|
g_signal_emit (calendar,
|
|
|
|
|
gtk_calendar_signals[DAY_SELECTED_DOUBLE_CLICK_SIGNAL],
|
|
|
|
|
0);
|
1998-09-27 18:32:00 +00:00
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
2017-09-13 15:37:25 +00:00
|
|
|
|
|
|
|
|
|
static void
|
|
|
|
|
gtk_calendar_button_press (GtkGestureMultiPress *gesture,
|
|
|
|
|
int n_press,
|
|
|
|
|
double x,
|
|
|
|
|
double y,
|
|
|
|
|
gpointer user_data)
|
1998-09-27 18:32:00 +00:00
|
|
|
|
{
|
2017-09-13 15:37:25 +00:00
|
|
|
|
GtkCalendar *calendar = user_data;
|
|
|
|
|
GtkWidget *widget = GTK_WIDGET (calendar);
|
2013-06-27 19:02:52 +00:00
|
|
|
|
GtkCalendarPrivate *priv = calendar->priv;
|
2017-09-13 15:37:25 +00:00
|
|
|
|
int button = gtk_gesture_single_get_current_button (GTK_GESTURE_SINGLE (gesture));
|
2005-05-11 19:16:19 +00:00
|
|
|
|
gint arrow = -1;
|
2010-10-24 05:22:13 +00:00
|
|
|
|
|
2010-03-01 03:21:41 +00:00
|
|
|
|
if (!gtk_widget_has_focus (widget))
|
2003-05-20 22:37:57 +00:00
|
|
|
|
gtk_widget_grab_focus (widget);
|
1999-02-20 19:09:21 +00:00
|
|
|
|
|
2017-06-27 18:48:14 +00:00
|
|
|
|
if (y > priv->header_h)
|
2017-09-13 15:37:25 +00:00
|
|
|
|
calendar_main_button_press (calendar, x, y, n_press, button);
|
2014-03-07 01:35:30 +00:00
|
|
|
|
|
2003-05-20 22:37:57 +00:00
|
|
|
|
for (arrow = ARROW_YEAR_LEFT; arrow <= ARROW_MONTH_RIGHT; arrow++)
|
|
|
|
|
{
|
2017-06-27 18:48:14 +00:00
|
|
|
|
GdkRectangle arrow_rect;
|
|
|
|
|
|
|
|
|
|
calendar_arrow_rectangle (calendar, arrow, &arrow_rect);
|
2010-10-24 05:22:13 +00:00
|
|
|
|
|
2017-06-27 18:48:14 +00:00
|
|
|
|
if (gdk_rectangle_contains_point (&arrow_rect, (int)x, (int)y))
|
|
|
|
|
{
|
2017-09-13 15:37:25 +00:00
|
|
|
|
if (button == GDK_BUTTON_PRIMARY)
|
|
|
|
|
calendar_start_spinning (calendar, arrow);
|
2004-06-10 04:09:33 +00:00
|
|
|
|
|
2017-09-13 15:37:25 +00:00
|
|
|
|
calendar_arrow_action (calendar, arrow);
|
2001-03-24 06:10:40 +00:00
|
|
|
|
|
2017-09-13 15:37:25 +00:00
|
|
|
|
return;
|
2011-01-24 02:50:39 +00:00
|
|
|
|
}
|
2003-05-20 22:37:57 +00:00
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
2017-09-13 15:37:25 +00:00
|
|
|
|
static void
|
|
|
|
|
gtk_calendar_button_release (GtkGestureMultiPress *gesture,
|
|
|
|
|
int n_press,
|
|
|
|
|
double x,
|
|
|
|
|
double y,
|
|
|
|
|
gpointer user_data)
|
2003-05-20 22:37:57 +00:00
|
|
|
|
{
|
2017-09-13 15:37:25 +00:00
|
|
|
|
GtkCalendar *calendar = user_data;
|
2013-06-27 19:02:52 +00:00
|
|
|
|
GtkCalendarPrivate *priv = calendar->priv;
|
2017-09-13 15:37:25 +00:00
|
|
|
|
int button = gtk_gesture_single_get_current_button (GTK_GESTURE_SINGLE (gesture));
|
2003-08-08 23:01:17 +00:00
|
|
|
|
|
2017-09-13 15:37:25 +00:00
|
|
|
|
if (button == GDK_BUTTON_PRIMARY)
|
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)
|
2011-01-24 02:50:39 +00:00
|
|
|
|
priv->in_drag = 0;
|
2003-08-08 23:01:17 +00:00
|
|
|
|
}
|
1998-09-27 18:32:00 +00:00
|
|
|
|
}
|
|
|
|
|
|
2017-12-11 03:15:12 +00:00
|
|
|
|
static void
|
|
|
|
|
gtk_calendar_drag_begin (GtkGestureDrag *gesture,
|
|
|
|
|
double x,
|
|
|
|
|
double y,
|
|
|
|
|
gpointer data)
|
1998-09-27 18:32:00 +00:00
|
|
|
|
{
|
2017-12-11 03:15:12 +00:00
|
|
|
|
GtkWidget *widget = data;
|
2013-06-27 19:02:52 +00:00
|
|
|
|
GtkCalendarPrivate *priv = GTK_CALENDAR (widget)->priv;
|
2003-08-08 23:01:17 +00:00
|
|
|
|
|
2017-12-11 03:15:12 +00:00
|
|
|
|
priv->in_drag = TRUE;
|
|
|
|
|
}
|
2010-10-24 05:22:13 +00:00
|
|
|
|
|
2017-12-11 03:15:12 +00:00
|
|
|
|
static void
|
|
|
|
|
gtk_calendar_drag_update (GtkGestureDrag *gesture,
|
|
|
|
|
double x,
|
|
|
|
|
double y,
|
|
|
|
|
gpointer data)
|
|
|
|
|
{
|
|
|
|
|
GtkWidget *widget = data;
|
|
|
|
|
GtkCalendarPrivate *priv = GTK_CALENDAR (widget)->priv;
|
|
|
|
|
gdouble start_x, start_y;
|
|
|
|
|
GdkDragContext *context;
|
|
|
|
|
GdkContentFormats *targets;
|
|
|
|
|
|
|
|
|
|
if (!priv->in_drag)
|
|
|
|
|
return;
|
|
|
|
|
|
|
|
|
|
if (!gtk_drag_check_threshold (widget, 0, 0, x, y))
|
|
|
|
|
return;
|
|
|
|
|
|
|
|
|
|
gtk_gesture_drag_get_start_point (gesture, &start_x, &start_y);
|
|
|
|
|
|
|
|
|
|
gtk_event_controller_reset (GTK_EVENT_CONTROLLER (gesture));
|
|
|
|
|
|
|
|
|
|
targets = gdk_content_formats_new (NULL, 0);
|
|
|
|
|
targets = gtk_content_formats_add_text_targets (targets);
|
2017-12-11 21:55:54 +00:00
|
|
|
|
context = gtk_drag_begin_with_coordinates (widget,
|
|
|
|
|
gtk_gesture_get_device (GTK_GESTURE (gesture)),
|
|
|
|
|
targets, GDK_ACTION_COPY,
|
2017-12-11 03:15:12 +00:00
|
|
|
|
start_x, start_y);
|
|
|
|
|
|
|
|
|
|
priv->in_drag = 0;
|
|
|
|
|
gdk_content_formats_unref (targets);
|
|
|
|
|
|
|
|
|
|
gtk_drag_set_icon_default (context);
|
1998-09-27 18:32:00 +00:00
|
|
|
|
}
|
|
|
|
|
|
2017-09-15 12:55:19 +00:00
|
|
|
|
static void
|
|
|
|
|
gtk_calendar_scroll_controller_scroll (GtkEventControllerScroll *scroll,
|
|
|
|
|
gdouble dx,
|
|
|
|
|
gdouble dy,
|
|
|
|
|
GtkWidget *widget)
|
2003-08-08 22:03:25 +00:00
|
|
|
|
{
|
|
|
|
|
GtkCalendar *calendar = GTK_CALENDAR (widget);
|
2017-08-25 14:43:42 +00:00
|
|
|
|
|
2017-09-15 12:55:19 +00:00
|
|
|
|
if (!gtk_widget_has_focus (widget))
|
|
|
|
|
gtk_widget_grab_focus (widget);
|
2003-08-08 22:03:25 +00:00
|
|
|
|
|
2017-09-15 12:55:19 +00:00
|
|
|
|
if (dy < 0)
|
|
|
|
|
calendar_set_month_prev (calendar);
|
|
|
|
|
else if (dy > 0)
|
|
|
|
|
calendar_set_month_next (calendar);
|
2003-08-08 22:03:25 +00:00
|
|
|
|
}
|
|
|
|
|
|
2005-05-11 19:16:19 +00:00
|
|
|
|
|
|
|
|
|
/****************************************
|
|
|
|
|
* Key handling *
|
|
|
|
|
****************************************/
|
|
|
|
|
|
2011-01-24 02:50:39 +00:00
|
|
|
|
static void
|
|
|
|
|
move_focus (GtkCalendar *calendar,
|
|
|
|
|
gint direction)
|
2003-08-08 22:17:34 +00:00
|
|
|
|
{
|
2010-08-12 15:14:51 +00:00
|
|
|
|
GtkCalendarPrivate *priv = calendar->priv;
|
2003-08-08 22:17:34 +00:00
|
|
|
|
GtkTextDirection text_dir = gtk_widget_get_direction (GTK_WIDGET (calendar));
|
2011-01-24 02:50:39 +00:00
|
|
|
|
|
2003-08-08 22:17:34 +00:00
|
|
|
|
if ((text_dir == GTK_TEXT_DIR_LTR && direction == -1) ||
|
2011-01-24 02:50:39 +00:00
|
|
|
|
(text_dir == GTK_TEXT_DIR_RTL && direction == 1))
|
2003-08-08 22:17:34 +00:00
|
|
|
|
{
|
2010-08-12 15:14:51 +00:00
|
|
|
|
if (priv->focus_col > 0)
|
2011-01-24 02:50:39 +00:00
|
|
|
|
priv->focus_col--;
|
2010-08-12 15:14:51 +00:00
|
|
|
|
else if (priv->focus_row > 0)
|
2011-01-24 02:50:39 +00:00
|
|
|
|
{
|
|
|
|
|
priv->focus_col = 6;
|
|
|
|
|
priv->focus_row--;
|
|
|
|
|
}
|
2007-01-19 03:52:03 +00:00
|
|
|
|
|
2010-08-12 15:14:51 +00:00
|
|
|
|
if (priv->focus_col < 0)
|
|
|
|
|
priv->focus_col = 6;
|
|
|
|
|
if (priv->focus_row < 0)
|
|
|
|
|
priv->focus_row = 5;
|
2003-08-08 22:17:34 +00:00
|
|
|
|
}
|
2011-01-24 02:50:39 +00:00
|
|
|
|
else
|
2003-08-08 22:17:34 +00:00
|
|
|
|
{
|
2010-08-12 15:14:51 +00:00
|
|
|
|
if (priv->focus_col < 6)
|
2011-01-24 02:50:39 +00:00
|
|
|
|
priv->focus_col++;
|
2010-08-12 15:14:51 +00:00
|
|
|
|
else if (priv->focus_row < 5)
|
2011-01-24 02:50:39 +00:00
|
|
|
|
{
|
|
|
|
|
priv->focus_col = 0;
|
|
|
|
|
priv->focus_row++;
|
|
|
|
|
}
|
2007-01-19 03:52:03 +00:00
|
|
|
|
|
2010-08-12 15:14:51 +00:00
|
|
|
|
if (priv->focus_col < 0)
|
|
|
|
|
priv->focus_col = 0;
|
|
|
|
|
if (priv->focus_row < 0)
|
|
|
|
|
priv->focus_row = 0;
|
2003-08-08 22:17:34 +00:00
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
2001-03-16 20:12:40 +00:00
|
|
|
|
static gboolean
|
2018-03-05 13:58:57 +00:00
|
|
|
|
gtk_calendar_key_controller_key_pressed (GtkEventControllerKey *controller,
|
|
|
|
|
guint keyval,
|
|
|
|
|
guint keycode,
|
|
|
|
|
GdkModifierType state,
|
|
|
|
|
GtkWidget *widget)
|
1998-09-27 18:32:00 +00:00
|
|
|
|
{
|
2010-08-12 15:14:51 +00:00
|
|
|
|
GtkCalendar *calendar = GTK_CALENDAR (widget);
|
|
|
|
|
GtkCalendarPrivate *priv = calendar->priv;
|
1998-09-27 18:32:00 +00:00
|
|
|
|
gint return_val;
|
1998-10-05 03:52:48 +00:00
|
|
|
|
gint old_focus_row;
|
|
|
|
|
gint old_focus_col;
|
|
|
|
|
gint row, col, day;
|
2010-08-12 15:14:51 +00:00
|
|
|
|
|
1998-09-27 18:32:00 +00:00
|
|
|
|
return_val = FALSE;
|
2010-08-12 15:14:51 +00:00
|
|
|
|
|
|
|
|
|
old_focus_row = priv->focus_row;
|
|
|
|
|
old_focus_col = priv->focus_col;
|
1998-10-05 03:52:48 +00:00
|
|
|
|
|
2017-08-25 14:43:42 +00:00
|
|
|
|
switch (keyval)
|
1998-09-27 18:32:00 +00:00
|
|
|
|
{
|
2010-09-08 17:35:51 +00:00
|
|
|
|
case GDK_KEY_KP_Left:
|
|
|
|
|
case GDK_KEY_Left:
|
1998-09-27 18:32:00 +00:00
|
|
|
|
return_val = TRUE;
|
2017-08-25 14:43:42 +00:00
|
|
|
|
if (state & GDK_CONTROL_MASK)
|
2011-01-24 02:50:39 +00:00
|
|
|
|
calendar_set_month_prev (calendar);
|
1998-09-27 18:32:00 +00:00
|
|
|
|
else
|
2011-01-24 02:50:39 +00:00
|
|
|
|
{
|
|
|
|
|
move_focus (calendar, -1);
|
|
|
|
|
calendar_invalidate_day (calendar, old_focus_row, old_focus_col);
|
|
|
|
|
calendar_invalidate_day (calendar, priv->focus_row,
|
|
|
|
|
priv->focus_col);
|
|
|
|
|
}
|
1998-09-27 18:32:00 +00:00
|
|
|
|
break;
|
2010-09-08 17:35:51 +00:00
|
|
|
|
case GDK_KEY_KP_Right:
|
|
|
|
|
case GDK_KEY_Right:
|
1998-09-27 18:32:00 +00:00
|
|
|
|
return_val = TRUE;
|
2017-08-25 14:43:42 +00:00
|
|
|
|
if (state & GDK_CONTROL_MASK)
|
2011-01-24 02:50:39 +00:00
|
|
|
|
calendar_set_month_next (calendar);
|
1998-09-27 18:32:00 +00:00
|
|
|
|
else
|
2011-01-24 02:50:39 +00:00
|
|
|
|
{
|
|
|
|
|
move_focus (calendar, 1);
|
|
|
|
|
calendar_invalidate_day (calendar, old_focus_row, old_focus_col);
|
|
|
|
|
calendar_invalidate_day (calendar, priv->focus_row,
|
|
|
|
|
priv->focus_col);
|
|
|
|
|
}
|
1998-09-27 18:32:00 +00:00
|
|
|
|
break;
|
2010-09-08 17:35:51 +00:00
|
|
|
|
case GDK_KEY_KP_Up:
|
|
|
|
|
case GDK_KEY_Up:
|
1998-09-27 18:32:00 +00:00
|
|
|
|
return_val = TRUE;
|
2017-08-25 14:43:42 +00:00
|
|
|
|
if (state & GDK_CONTROL_MASK)
|
2011-01-24 02:50:39 +00:00
|
|
|
|
calendar_set_year_prev (calendar);
|
1998-09-27 18:32:00 +00:00
|
|
|
|
else
|
2011-01-24 02:50:39 +00:00
|
|
|
|
{
|
|
|
|
|
if (priv->focus_row > 0)
|
|
|
|
|
priv->focus_row--;
|
2010-08-12 15:14:51 +00:00
|
|
|
|
if (priv->focus_row < 0)
|
|
|
|
|
priv->focus_row = 5;
|
|
|
|
|
if (priv->focus_col < 0)
|
|
|
|
|
priv->focus_col = 6;
|
2011-01-24 02:50:39 +00:00
|
|
|
|
calendar_invalidate_day (calendar, old_focus_row, old_focus_col);
|
|
|
|
|
calendar_invalidate_day (calendar, priv->focus_row,
|
|
|
|
|
priv->focus_col);
|
|
|
|
|
}
|
1998-09-27 18:32:00 +00:00
|
|
|
|
break;
|
2010-09-08 17:35:51 +00:00
|
|
|
|
case GDK_KEY_KP_Down:
|
|
|
|
|
case GDK_KEY_Down:
|
1998-09-27 18:32:00 +00:00
|
|
|
|
return_val = TRUE;
|
2017-08-25 14:43:42 +00:00
|
|
|
|
if (state & GDK_CONTROL_MASK)
|
2011-01-24 02:50:39 +00:00
|
|
|
|
calendar_set_year_next (calendar);
|
1998-09-27 18:32:00 +00:00
|
|
|
|
else
|
2011-01-24 02:50:39 +00:00
|
|
|
|
{
|
|
|
|
|
if (priv->focus_row < 5)
|
|
|
|
|
priv->focus_row++;
|
2010-08-12 15:14:51 +00:00
|
|
|
|
if (priv->focus_col < 0)
|
|
|
|
|
priv->focus_col = 0;
|
2011-01-24 02:50:39 +00:00
|
|
|
|
calendar_invalidate_day (calendar, old_focus_row, old_focus_col);
|
|
|
|
|
calendar_invalidate_day (calendar, priv->focus_row,
|
|
|
|
|
priv->focus_col);
|
|
|
|
|
}
|
1998-09-27 18:32:00 +00:00
|
|
|
|
break;
|
2010-09-08 17:35:51 +00:00
|
|
|
|
case GDK_KEY_KP_Space:
|
|
|
|
|
case GDK_KEY_space:
|
2010-08-12 15:14:51 +00:00
|
|
|
|
row = priv->focus_row;
|
|
|
|
|
col = priv->focus_col;
|
2011-01-24 02:50:39 +00:00
|
|
|
|
|
1998-10-05 03:52:48 +00:00
|
|
|
|
if (row > -1 && col > -1)
|
2011-01-24 02:50:39 +00:00
|
|
|
|
{
|
|
|
|
|
return_val = TRUE;
|
1998-10-05 03:52:48 +00:00
|
|
|
|
|
2010-08-12 15:14:51 +00:00
|
|
|
|
day = priv->day[row][col];
|
2011-01-24 02:50:39 +00:00
|
|
|
|
if (priv->day_month[row][col] == MONTH_PREV)
|
|
|
|
|
calendar_set_month_prev (calendar);
|
|
|
|
|
else if (priv->day_month[row][col] == MONTH_NEXT)
|
|
|
|
|
calendar_set_month_next (calendar);
|
|
|
|
|
|
|
|
|
|
calendar_select_and_focus_day (calendar, day);
|
|
|
|
|
}
|
2017-10-06 19:19:42 +00:00
|
|
|
|
default:
|
|
|
|
|
break;
|
2011-01-24 02:50:39 +00:00
|
|
|
|
}
|
|
|
|
|
|
1998-09-27 18:32:00 +00:00
|
|
|
|
return return_val;
|
|
|
|
|
}
|
2003-05-08 00:25:51 +00:00
|
|
|
|
|
2018-03-23 15:09:37 +00:00
|
|
|
|
static void
|
|
|
|
|
gtk_calendar_key_controller_focus (GtkEventControllerKey *key,
|
|
|
|
|
GtkWidget *widget)
|
|
|
|
|
{
|
|
|
|
|
GtkCalendar *calendar = GTK_CALENDAR (widget);
|
|
|
|
|
|
|
|
|
|
calendar_queue_refresh (calendar);
|
|
|
|
|
calendar_stop_spinning (calendar);
|
|
|
|
|
calendar->priv->in_drag = 0;
|
|
|
|
|
}
|
|
|
|
|
|
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
|
2011-01-10 19:40:37 +00:00
|
|
|
|
gtk_calendar_state_flags_changed (GtkWidget *widget,
|
|
|
|
|
GtkStateFlags previous_state)
|
2005-05-11 19:16:19 +00:00
|
|
|
|
{
|
|
|
|
|
GtkCalendar *calendar = GTK_CALENDAR (widget);
|
2013-06-27 19:02:52 +00:00
|
|
|
|
GtkCalendarPrivate *priv = calendar->priv;
|
2010-10-24 05:22:13 +00:00
|
|
|
|
|
2010-02-27 04:24:24 +00:00
|
|
|
|
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;
|
2010-10-24 05:22:13 +00:00
|
|
|
|
calendar_stop_spinning (calendar);
|
2003-05-08 00:25:51 +00:00
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
2005-05-11 19:16:19 +00:00
|
|
|
|
static void
|
|
|
|
|
gtk_calendar_grab_notify (GtkWidget *widget,
|
2011-01-24 02:50:39 +00:00
|
|
|
|
gboolean was_grabbed)
|
2003-05-08 00:25:51 +00:00
|
|
|
|
{
|
2018-05-14 16:19:44 +00:00
|
|
|
|
GTK_WIDGET_CLASS (gtk_calendar_parent_class)->grab_notify (widget, was_grabbed);
|
|
|
|
|
|
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
|
|
|
|
|
|
|
|
|
/****************************************
|
|
|
|
|
* Drag and Drop *
|
|
|
|
|
****************************************/
|
|
|
|
|
|
2003-08-08 23:01:17 +00:00
|
|
|
|
static void
|
|
|
|
|
gtk_calendar_drag_data_get (GtkWidget *widget,
|
2011-01-24 02:50:39 +00:00
|
|
|
|
GdkDragContext *context,
|
|
|
|
|
GtkSelectionData *selection_data,
|
|
|
|
|
guint time)
|
2003-08-08 23:01:17 +00:00
|
|
|
|
{
|
|
|
|
|
GtkCalendar *calendar = GTK_CALENDAR (widget);
|
2010-08-12 15:14:51 +00:00
|
|
|
|
GtkCalendarPrivate *priv = calendar->priv;
|
2003-08-08 23:01:17 +00:00
|
|
|
|
GDate *date;
|
|
|
|
|
gchar str[128];
|
|
|
|
|
gsize len;
|
|
|
|
|
|
2010-08-12 15:14:51 +00:00
|
|
|
|
date = g_date_new_dmy (priv->selected_day, priv->month + 1, priv->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);
|
2011-01-24 02:50:39 +00:00
|
|
|
|
|
2003-08-08 23:01:17 +00:00
|
|
|
|
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,
|
2014-02-07 18:32:47 +00:00
|
|
|
|
* since the data doesn’t result from a drop.
|
2005-05-11 19:16:19 +00:00
|
|
|
|
*/
|
|
|
|
|
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,
|
2011-01-24 02:50:39 +00:00
|
|
|
|
GdkDragContext *context,
|
|
|
|
|
guint time)
|
2005-05-11 19:16:19 +00:00
|
|
|
|
{
|
2013-06-27 19:02:52 +00:00
|
|
|
|
GtkCalendarPrivate *priv = GTK_CALENDAR (widget)->priv;
|
2005-05-11 19:16:19 +00:00
|
|
|
|
|
|
|
|
|
priv->drag_highlight = 0;
|
|
|
|
|
gtk_drag_unhighlight (widget);
|
2011-01-24 02:50:39 +00:00
|
|
|
|
|
2005-05-11 19:16:19 +00:00
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
static gboolean
|
|
|
|
|
gtk_calendar_drag_motion (GtkWidget *widget,
|
2011-01-24 02:50:39 +00:00
|
|
|
|
GdkDragContext *context,
|
|
|
|
|
gint x,
|
|
|
|
|
gint y,
|
|
|
|
|
guint time)
|
2005-05-11 19:16:19 +00:00
|
|
|
|
{
|
2013-06-27 19:02:52 +00:00
|
|
|
|
GtkCalendarPrivate *priv = GTK_CALENDAR (widget)->priv;
|
2005-05-11 19:16:19 +00:00
|
|
|
|
GdkAtom target;
|
2010-12-10 05:59:07 +00:00
|
|
|
|
|
|
|
|
|
if (!priv->drag_highlight)
|
2005-05-11 19:16:19 +00:00
|
|
|
|
{
|
|
|
|
|
priv->drag_highlight = 1;
|
|
|
|
|
gtk_drag_highlight (widget);
|
|
|
|
|
}
|
2010-12-10 05:59:07 +00:00
|
|
|
|
|
2005-05-11 19:16:19 +00:00
|
|
|
|
target = gtk_drag_dest_find_target (widget, context, NULL);
|
2017-11-15 17:13:31 +00:00
|
|
|
|
if (target == NULL || gdk_drag_context_get_suggested_action (context) == 0)
|
2005-05-11 19:16:19 +00:00
|
|
|
|
gdk_drag_status (context, 0, time);
|
2017-12-10 19:18:08 +00:00
|
|
|
|
else if (get_status_pending (context) == 0)
|
2005-05-11 19:16:19 +00:00
|
|
|
|
{
|
2010-12-10 05:59:07 +00:00
|
|
|
|
set_status_pending (context, gdk_drag_context_get_suggested_action (context));
|
2005-05-11 19:16:19 +00:00
|
|
|
|
gtk_drag_get_data (widget, context, target, time);
|
|
|
|
|
}
|
2011-01-24 02:50:39 +00:00
|
|
|
|
|
2005-05-11 19:16:19 +00:00
|
|
|
|
return TRUE;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
static gboolean
|
|
|
|
|
gtk_calendar_drag_drop (GtkWidget *widget,
|
2011-01-24 02:50:39 +00:00
|
|
|
|
GdkDragContext *context,
|
|
|
|
|
gint x,
|
|
|
|
|
gint y,
|
|
|
|
|
guint time)
|
2005-05-11 19:16:19 +00:00
|
|
|
|
{
|
|
|
|
|
GdkAtom target;
|
|
|
|
|
|
2011-01-24 02:50:39 +00:00
|
|
|
|
target = gtk_drag_dest_find_target (widget, context, NULL);
|
2017-11-15 17:13:31 +00:00
|
|
|
|
if (target != NULL)
|
2005-05-11 19:16:19 +00:00
|
|
|
|
{
|
2011-01-24 02:50:39 +00:00
|
|
|
|
gtk_drag_get_data (widget, context,
|
|
|
|
|
target,
|
|
|
|
|
time);
|
2005-05-11 19:16:19 +00:00
|
|
|
|
return TRUE;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
return FALSE;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
static void
|
|
|
|
|
gtk_calendar_drag_data_received (GtkWidget *widget,
|
2011-01-24 02:50:39 +00:00
|
|
|
|
GdkDragContext *context,
|
|
|
|
|
GtkSelectionData *selection_data,
|
|
|
|
|
guint time)
|
2005-05-11 19:16:19 +00:00
|
|
|
|
{
|
|
|
|
|
GtkCalendar *calendar = GTK_CALENDAR (widget);
|
2010-08-12 15:14:51 +00:00
|
|
|
|
GtkCalendarPrivate *priv = calendar->priv;
|
2005-05-11 19:16:19 +00:00
|
|
|
|
guint day, month, year;
|
|
|
|
|
gchar *str;
|
|
|
|
|
GDate *date;
|
|
|
|
|
GdkDragAction suggested_action;
|
|
|
|
|
|
|
|
|
|
suggested_action = get_status_pending (context);
|
|
|
|
|
|
2011-01-24 02:50:39 +00:00
|
|
|
|
if (suggested_action)
|
2005-05-11 19:16:19 +00:00
|
|
|
|
{
|
|
|
|
|
set_status_pending (context, 0);
|
2011-01-24 02:50:39 +00:00
|
|
|
|
|
2005-05-11 19:16:19 +00:00
|
|
|
|
/* 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);
|
|
|
|
|
|
2011-01-24 02:50:39 +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);
|
|
|
|
|
}
|
2005-05-11 19:16:19 +00:00
|
|
|
|
else
|
2011-01-24 02:50:39 +00:00
|
|
|
|
suggested_action = 0;
|
2005-05-11 19:16:19 +00:00
|
|
|
|
|
|
|
|
|
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);
|
2011-01-24 02:50:39 +00:00
|
|
|
|
if (str)
|
2005-05-11 19:16:19 +00:00
|
|
|
|
{
|
|
|
|
|
g_date_set_parse (date, str);
|
|
|
|
|
g_free (str);
|
|
|
|
|
}
|
2011-01-24 02:50:39 +00:00
|
|
|
|
|
|
|
|
|
if (!g_date_valid (date))
|
2005-05-11 19:16:19 +00:00
|
|
|
|
{
|
2016-02-28 16:06:25 +00:00
|
|
|
|
g_warning ("Received invalid date data");
|
2011-01-24 02:50:39 +00:00
|
|
|
|
g_date_free (date);
|
2017-12-10 00:33:38 +00:00
|
|
|
|
gtk_drag_finish (context, FALSE, time);
|
2005-05-11 19:16:19 +00:00
|
|
|
|
return;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
day = g_date_get_day (date);
|
|
|
|
|
month = g_date_get_month (date);
|
|
|
|
|
year = g_date_get_year (date);
|
2011-01-24 02:50:39 +00:00
|
|
|
|
g_date_free (date);
|
2005-05-11 19:16:19 +00:00
|
|
|
|
|
2017-12-10 00:33:38 +00:00
|
|
|
|
gtk_drag_finish (context, TRUE, time);
|
2005-05-11 19:16:19 +00:00
|
|
|
|
|
2011-01-24 02:50:39 +00:00
|
|
|
|
|
2005-05-11 19:16:19 +00:00
|
|
|
|
g_object_freeze_notify (G_OBJECT (calendar));
|
2010-08-12 15:14:51 +00:00
|
|
|
|
if (!(priv->display_flags & GTK_CALENDAR_NO_MONTH_CHANGE)
|
|
|
|
|
&& (priv->display_flags & GTK_CALENDAR_SHOW_HEADING))
|
2005-05-11 19:16:19 +00:00
|
|
|
|
gtk_calendar_select_month (calendar, month - 1, year);
|
|
|
|
|
gtk_calendar_select_day (calendar, day);
|
2011-01-24 02:50:39 +00:00
|
|
|
|
g_object_thaw_notify (G_OBJECT (calendar));
|
2005-05-11 19:16:19 +00:00
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
/****************************************
|
|
|
|
|
* Public API *
|
|
|
|
|
****************************************/
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
|
* gtk_calendar_new:
|
2011-01-24 02:50:39 +00:00
|
|
|
|
*
|
|
|
|
|
* Creates a new calendar, with the current date being selected.
|
|
|
|
|
*
|
2014-02-19 23:49:43 +00:00
|
|
|
|
* Returns: a newly #GtkCalendar widget
|
2005-05-11 19:16:19 +00:00
|
|
|
|
**/
|
|
|
|
|
GtkWidget*
|
|
|
|
|
gtk_calendar_new (void)
|
|
|
|
|
{
|
|
|
|
|
return g_object_new (GTK_TYPE_CALENDAR, NULL);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
|
* gtk_calendar_get_display_options:
|
|
|
|
|
* @calendar: a #GtkCalendar
|
2011-01-24 02:50:39 +00:00
|
|
|
|
*
|
|
|
|
|
* Returns the current display options of @calendar.
|
|
|
|
|
*
|
2014-02-19 23:49:43 +00:00
|
|
|
|
* Returns: the display options.
|
2005-05-11 19:16:19 +00:00
|
|
|
|
**/
|
2011-01-24 02:50:39 +00:00
|
|
|
|
GtkCalendarDisplayOptions
|
2005-05-11 19:16:19 +00:00
|
|
|
|
gtk_calendar_get_display_options (GtkCalendar *calendar)
|
|
|
|
|
{
|
|
|
|
|
g_return_val_if_fail (GTK_IS_CALENDAR (calendar), 0);
|
|
|
|
|
|
2010-08-12 15:14:51 +00:00
|
|
|
|
return calendar->priv->display_flags;
|
2005-05-11 19:16:19 +00:00
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
|
* gtk_calendar_set_display_options:
|
|
|
|
|
* @calendar: a #GtkCalendar
|
|
|
|
|
* @flags: the display options to set
|
2011-01-24 02:50:39 +00:00
|
|
|
|
*
|
|
|
|
|
* Sets display options (whether to display the heading and the month
|
2005-05-11 19:16:19 +00:00
|
|
|
|
* headings).
|
|
|
|
|
**/
|
|
|
|
|
void
|
2011-01-24 02:50:39 +00:00
|
|
|
|
gtk_calendar_set_display_options (GtkCalendar *calendar,
|
|
|
|
|
GtkCalendarDisplayOptions flags)
|
2005-05-11 19:16:19 +00:00
|
|
|
|
{
|
|
|
|
|
GtkWidget *widget = GTK_WIDGET (calendar);
|
2013-06-27 19:02:52 +00:00
|
|
|
|
GtkCalendarPrivate *priv = calendar->priv;
|
2005-05-11 19:16:19 +00:00
|
|
|
|
gint resize = 0;
|
|
|
|
|
GtkCalendarDisplayOptions old_flags;
|
2011-01-24 02:50:39 +00:00
|
|
|
|
|
2005-05-11 19:16:19 +00:00
|
|
|
|
g_return_if_fail (GTK_IS_CALENDAR (calendar));
|
2011-01-24 02:50:39 +00:00
|
|
|
|
|
2010-08-12 15:14:51 +00:00
|
|
|
|
old_flags = priv->display_flags;
|
2011-01-24 02:50:39 +00:00
|
|
|
|
|
2010-03-02 06:16:02 +00:00
|
|
|
|
if (gtk_widget_get_realized (widget))
|
2005-05-11 19:16:19 +00:00
|
|
|
|
{
|
2010-08-12 15:14:51 +00:00
|
|
|
|
if ((flags ^ priv->display_flags) & GTK_CALENDAR_NO_MONTH_CHANGE)
|
2011-01-24 02:50:39 +00:00
|
|
|
|
{
|
|
|
|
|
resize ++;
|
|
|
|
|
if (! (flags & GTK_CALENDAR_NO_MONTH_CHANGE)
|
2010-10-24 05:22:13 +00:00
|
|
|
|
&& (priv->display_flags & GTK_CALENDAR_SHOW_HEADING))
|
2011-01-24 02:50:39 +00:00
|
|
|
|
{
|
|
|
|
|
priv->display_flags &= ~GTK_CALENDAR_NO_MONTH_CHANGE;
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
2010-08-12 15:14:51 +00:00
|
|
|
|
if ((flags ^ priv->display_flags) & GTK_CALENDAR_SHOW_HEADING)
|
2011-01-24 02:50:39 +00:00
|
|
|
|
{
|
|
|
|
|
resize++;
|
|
|
|
|
|
|
|
|
|
if (flags & GTK_CALENDAR_SHOW_HEADING)
|
2010-10-24 05:22:13 +00:00
|
|
|
|
{
|
2011-01-24 02:50:39 +00:00
|
|
|
|
priv->display_flags |= GTK_CALENDAR_SHOW_HEADING;
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
2010-08-12 15:14:51 +00:00
|
|
|
|
if ((flags ^ priv->display_flags) & GTK_CALENDAR_SHOW_DAY_NAMES)
|
2011-01-24 02:50:39 +00:00
|
|
|
|
{
|
|
|
|
|
resize++;
|
|
|
|
|
|
|
|
|
|
if (flags & GTK_CALENDAR_SHOW_DAY_NAMES)
|
|
|
|
|
priv->display_flags |= GTK_CALENDAR_SHOW_DAY_NAMES;
|
|
|
|
|
}
|
|
|
|
|
|
2010-08-12 15:14:51 +00:00
|
|
|
|
if ((flags ^ priv->display_flags) & GTK_CALENDAR_SHOW_WEEK_NUMBERS)
|
2010-10-24 05:22:13 +00:00
|
|
|
|
{
|
|
|
|
|
resize++;
|
|
|
|
|
|
|
|
|
|
if (flags & GTK_CALENDAR_SHOW_WEEK_NUMBERS)
|
|
|
|
|
priv->display_flags |= GTK_CALENDAR_SHOW_WEEK_NUMBERS;
|
|
|
|
|
}
|
2005-05-11 19:16:19 +00:00
|
|
|
|
|
2010-08-12 15:14:51 +00:00
|
|
|
|
if ((flags ^ priv->display_flags) & GTK_CALENDAR_SHOW_DETAILS)
|
2007-12-28 09:39:34 +00:00
|
|
|
|
resize++;
|
|
|
|
|
|
2010-08-12 15:14:51 +00:00
|
|
|
|
priv->display_flags = flags;
|
2005-05-11 19:16:19 +00:00
|
|
|
|
if (resize)
|
2011-01-24 02:50:39 +00:00
|
|
|
|
gtk_widget_queue_resize (GTK_WIDGET (calendar));
|
2010-08-28 23:09:21 +00:00
|
|
|
|
}
|
2005-05-11 19:16:19 +00:00
|
|
|
|
else
|
2010-08-12 15:14:51 +00:00
|
|
|
|
priv->display_flags = flags;
|
2010-08-28 23:09:21 +00:00
|
|
|
|
|
2005-05-11 19:16:19 +00:00
|
|
|
|
g_object_freeze_notify (G_OBJECT (calendar));
|
2010-08-12 15:14:51 +00:00
|
|
|
|
if ((old_flags ^ priv->display_flags) & GTK_CALENDAR_SHOW_HEADING)
|
2005-05-11 19:16:19 +00:00
|
|
|
|
g_object_notify (G_OBJECT (calendar), "show-heading");
|
2010-08-12 15:14:51 +00:00
|
|
|
|
if ((old_flags ^ priv->display_flags) & GTK_CALENDAR_SHOW_DAY_NAMES)
|
2005-05-11 19:16:19 +00:00
|
|
|
|
g_object_notify (G_OBJECT (calendar), "show-day-names");
|
2010-08-12 15:14:51 +00:00
|
|
|
|
if ((old_flags ^ priv->display_flags) & GTK_CALENDAR_NO_MONTH_CHANGE)
|
2005-05-11 19:16:19 +00:00
|
|
|
|
g_object_notify (G_OBJECT (calendar), "no-month-change");
|
2010-08-12 15:14:51 +00:00
|
|
|
|
if ((old_flags ^ priv->display_flags) & GTK_CALENDAR_SHOW_WEEK_NUMBERS)
|
2005-05-11 19:16:19 +00:00
|
|
|
|
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.
|
2010-06-15 04:00:40 +00:00
|
|
|
|
*
|
2005-05-11 19:16:19 +00:00
|
|
|
|
* Shifts the calendar to a different month.
|
|
|
|
|
**/
|
2010-06-15 04:00:40 +00:00
|
|
|
|
void
|
2005-05-11 19:16:19 +00:00
|
|
|
|
gtk_calendar_select_month (GtkCalendar *calendar,
|
2011-01-24 02:50:39 +00:00
|
|
|
|
guint month,
|
|
|
|
|
guint year)
|
2003-08-08 23:01:17 +00:00
|
|
|
|
{
|
2010-08-12 15:14:51 +00:00
|
|
|
|
GtkCalendarPrivate *priv;
|
|
|
|
|
|
2010-06-15 04:00:40 +00:00
|
|
|
|
g_return_if_fail (GTK_IS_CALENDAR (calendar));
|
|
|
|
|
g_return_if_fail (month <= 11);
|
|
|
|
|
|
2010-08-12 15:14:51 +00:00
|
|
|
|
priv = calendar->priv;
|
|
|
|
|
|
2014-06-07 18:07:07 +00:00
|
|
|
|
g_object_freeze_notify (G_OBJECT (calendar));
|
|
|
|
|
|
|
|
|
|
if (priv->month != month)
|
|
|
|
|
{
|
|
|
|
|
priv->month = month;
|
|
|
|
|
g_object_notify (G_OBJECT (calendar), "month");
|
|
|
|
|
}
|
|
|
|
|
if (priv->year != year)
|
|
|
|
|
{
|
|
|
|
|
priv->year = year;
|
|
|
|
|
g_object_notify (G_OBJECT (calendar), "year");
|
|
|
|
|
}
|
2010-06-15 04:00:40 +00:00
|
|
|
|
|
2005-05-11 19:16:19 +00:00
|
|
|
|
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_thaw_notify (G_OBJECT (calendar));
|
2003-08-08 23:01:17 +00:00
|
|
|
|
|
2014-06-07 18:07:07 +00:00
|
|
|
|
g_signal_emit (calendar, gtk_calendar_signals[MONTH_CHANGED_SIGNAL], 0);
|
2003-08-08 23:01:17 +00:00
|
|
|
|
}
|
|
|
|
|
|
2005-05-11 19:16:19 +00:00
|
|
|
|
/**
|
|
|
|
|
* gtk_calendar_select_day:
|
|
|
|
|
* @calendar: a #GtkCalendar.
|
2011-01-24 02:50:39 +00:00
|
|
|
|
* @day: the day number between 1 and 31, or 0 to unselect
|
2005-05-11 19:16:19 +00:00
|
|
|
|
* the currently selected day.
|
2011-01-24 02:50:39 +00:00
|
|
|
|
*
|
2005-05-11 19:16:19 +00:00
|
|
|
|
* Selects a day from the current month.
|
|
|
|
|
**/
|
|
|
|
|
void
|
|
|
|
|
gtk_calendar_select_day (GtkCalendar *calendar,
|
2011-01-24 02:50:39 +00:00
|
|
|
|
guint day)
|
2003-08-08 23:01:17 +00:00
|
|
|
|
{
|
2010-08-12 15:14:51 +00:00
|
|
|
|
GtkCalendarPrivate *priv;
|
|
|
|
|
|
2005-05-11 19:16:19 +00:00
|
|
|
|
g_return_if_fail (GTK_IS_CALENDAR (calendar));
|
|
|
|
|
g_return_if_fail (day <= 31);
|
2010-08-12 15:14:51 +00:00
|
|
|
|
|
|
|
|
|
priv = calendar->priv;
|
|
|
|
|
|
2014-06-07 18:07:07 +00:00
|
|
|
|
if (priv->selected_day != day)
|
2003-08-08 23:01:17 +00:00
|
|
|
|
{
|
2014-06-07 18:07:07 +00:00
|
|
|
|
/* Deselect the old day */
|
|
|
|
|
if (priv->selected_day > 0)
|
|
|
|
|
{
|
|
|
|
|
if (gtk_widget_is_drawable (GTK_WIDGET (calendar)))
|
|
|
|
|
calendar_invalidate_day_num (calendar, priv->selected_day);
|
|
|
|
|
priv->selected_day = 0;
|
|
|
|
|
}
|
2011-01-24 02:50:39 +00:00
|
|
|
|
|
2014-06-07 18:07:07 +00:00
|
|
|
|
priv->selected_day = day;
|
2011-01-24 02:50:39 +00:00
|
|
|
|
|
2014-06-07 18:07:07 +00:00
|
|
|
|
/* Select the new day */
|
|
|
|
|
if (priv->selected_day > 0)
|
|
|
|
|
{
|
|
|
|
|
if (gtk_widget_is_drawable (GTK_WIDGET (calendar)))
|
|
|
|
|
calendar_invalidate_day_num (calendar, priv->selected_day);
|
|
|
|
|
}
|
2011-01-24 02:50:39 +00:00
|
|
|
|
|
2014-06-07 18:07:07 +00:00
|
|
|
|
g_object_notify (G_OBJECT (calendar), "day");
|
2005-05-11 19:16:19 +00:00
|
|
|
|
}
|
2011-01-24 02:50:39 +00:00
|
|
|
|
|
2014-06-07 18:07:07 +00:00
|
|
|
|
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
|
2011-01-24 02:50:39 +00:00
|
|
|
|
*
|
2005-05-11 19:16:19 +00:00
|
|
|
|
* Remove all visual markers.
|
|
|
|
|
**/
|
|
|
|
|
void
|
|
|
|
|
gtk_calendar_clear_marks (GtkCalendar *calendar)
|
2003-08-08 23:01:17 +00:00
|
|
|
|
{
|
2010-08-12 15:14:51 +00:00
|
|
|
|
GtkCalendarPrivate *priv;
|
2005-05-11 19:16:19 +00:00
|
|
|
|
guint day;
|
2010-08-12 15:14:51 +00:00
|
|
|
|
|
2005-05-11 19:16:19 +00:00
|
|
|
|
g_return_if_fail (GTK_IS_CALENDAR (calendar));
|
2010-08-12 15:14:51 +00:00
|
|
|
|
|
|
|
|
|
priv = calendar->priv;
|
|
|
|
|
|
2005-05-11 19:16:19 +00:00
|
|
|
|
for (day = 0; day < 31; day++)
|
2003-08-08 23:01:17 +00:00
|
|
|
|
{
|
2010-08-12 15:14:51 +00:00
|
|
|
|
priv->marked_date[day] = FALSE;
|
2003-08-08 23:01:17 +00:00
|
|
|
|
}
|
|
|
|
|
|
2010-08-12 15:14:51 +00:00
|
|
|
|
priv->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:
|
2010-06-15 04:00:40 +00:00
|
|
|
|
* @calendar: a #GtkCalendar
|
2005-05-11 19:16:19 +00:00
|
|
|
|
* @day: the day number to mark between 1 and 31.
|
2010-06-15 04:00:40 +00:00
|
|
|
|
*
|
2005-05-11 19:16:19 +00:00
|
|
|
|
* Places a visual marker on a particular day.
|
2010-06-15 04:00:40 +00:00
|
|
|
|
*/
|
|
|
|
|
void
|
2005-05-11 19:16:19 +00:00
|
|
|
|
gtk_calendar_mark_day (GtkCalendar *calendar,
|
2011-01-24 02:50:39 +00:00
|
|
|
|
guint day)
|
2003-08-08 23:01:17 +00:00
|
|
|
|
{
|
2010-08-12 15:14:51 +00:00
|
|
|
|
GtkCalendarPrivate *priv;
|
|
|
|
|
|
2010-06-15 04:00:40 +00:00
|
|
|
|
g_return_if_fail (GTK_IS_CALENDAR (calendar));
|
|
|
|
|
|
2010-08-12 15:14:51 +00:00
|
|
|
|
priv = calendar->priv;
|
|
|
|
|
|
|
|
|
|
if (day >= 1 && day <= 31 && !priv->marked_date[day-1])
|
2003-08-08 23:01:17 +00:00
|
|
|
|
{
|
2010-08-12 15:14:51 +00:00
|
|
|
|
priv->marked_date[day - 1] = TRUE;
|
|
|
|
|
priv->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
|
|
|
|
}
|
2003-08-08 23:01:17 +00:00
|
|
|
|
|
2010-08-29 17:14:24 +00:00
|
|
|
|
/**
|
|
|
|
|
* gtk_calendar_get_day_is_marked:
|
|
|
|
|
* @calendar: a #GtkCalendar
|
|
|
|
|
* @day: the day number between 1 and 31.
|
|
|
|
|
*
|
|
|
|
|
* Returns if the @day of the @calendar is already marked.
|
|
|
|
|
*
|
|
|
|
|
* Returns: whether the day is marked.
|
|
|
|
|
*/
|
|
|
|
|
gboolean
|
|
|
|
|
gtk_calendar_get_day_is_marked (GtkCalendar *calendar,
|
|
|
|
|
guint day)
|
|
|
|
|
{
|
|
|
|
|
GtkCalendarPrivate *priv;
|
|
|
|
|
|
|
|
|
|
g_return_val_if_fail (GTK_IS_CALENDAR (calendar), FALSE);
|
|
|
|
|
|
|
|
|
|
priv = calendar->priv;
|
|
|
|
|
|
|
|
|
|
if (day >= 1 && day <= 31)
|
|
|
|
|
return priv->marked_date[day - 1];
|
|
|
|
|
|
|
|
|
|
return FALSE;
|
|
|
|
|
}
|
|
|
|
|
|
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.
|
2010-06-15 04:00:40 +00:00
|
|
|
|
*
|
2005-05-11 19:16:19 +00:00
|
|
|
|
* Removes the visual marker from a particular day.
|
2010-06-15 04:00:40 +00:00
|
|
|
|
*/
|
|
|
|
|
void
|
2005-05-11 19:16:19 +00:00
|
|
|
|
gtk_calendar_unmark_day (GtkCalendar *calendar,
|
2011-01-24 02:50:39 +00:00
|
|
|
|
guint day)
|
2005-05-11 19:16:19 +00:00
|
|
|
|
{
|
2010-08-12 15:14:51 +00:00
|
|
|
|
GtkCalendarPrivate *priv;
|
|
|
|
|
|
2010-06-15 04:00:40 +00:00
|
|
|
|
g_return_if_fail (GTK_IS_CALENDAR (calendar));
|
|
|
|
|
|
2010-08-12 15:14:51 +00:00
|
|
|
|
priv = calendar->priv;
|
|
|
|
|
|
|
|
|
|
if (day >= 1 && day <= 31 && priv->marked_date[day-1])
|
2003-08-08 23:01:17 +00:00
|
|
|
|
{
|
2010-08-12 15:14:51 +00:00
|
|
|
|
priv->marked_date[day - 1] = FALSE;
|
|
|
|
|
priv->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
|
|
|
|
}
|
2003-08-08 23:01:17 +00:00
|
|
|
|
|
2005-05-11 19:16:19 +00:00
|
|
|
|
/**
|
|
|
|
|
* gtk_calendar_get_date:
|
|
|
|
|
* @calendar: a #GtkCalendar
|
2011-01-18 09:10:30 +00:00
|
|
|
|
* @year: (out) (allow-none): location to store the year as a decimal
|
|
|
|
|
* number (e.g. 2011), or %NULL
|
|
|
|
|
* @month: (out) (allow-none): location to store the month number
|
|
|
|
|
* (between 0 and 11), or %NULL
|
|
|
|
|
* @day: (out) (allow-none): location to store the day number (between
|
|
|
|
|
* 1 and 31), or %NULL
|
2011-01-04 16:44:09 +00:00
|
|
|
|
*
|
2005-05-11 19:16:19 +00:00
|
|
|
|
* Obtains the selected date from a #GtkCalendar.
|
2011-01-04 16:44:09 +00:00
|
|
|
|
*/
|
2005-05-11 19:16:19 +00:00
|
|
|
|
void
|
|
|
|
|
gtk_calendar_get_date (GtkCalendar *calendar,
|
2011-01-24 02:50:39 +00:00
|
|
|
|
guint *year,
|
|
|
|
|
guint *month,
|
|
|
|
|
guint *day)
|
2005-05-11 19:16:19 +00:00
|
|
|
|
{
|
2010-08-12 15:14:51 +00:00
|
|
|
|
GtkCalendarPrivate *priv;
|
|
|
|
|
|
2005-05-11 19:16:19 +00:00
|
|
|
|
g_return_if_fail (GTK_IS_CALENDAR (calendar));
|
2010-08-12 15:14:51 +00:00
|
|
|
|
|
|
|
|
|
priv = calendar->priv;
|
|
|
|
|
|
2005-05-11 19:16:19 +00:00
|
|
|
|
if (year)
|
2010-08-12 15:14:51 +00:00
|
|
|
|
*year = priv->year;
|
|
|
|
|
|
2005-05-11 19:16:19 +00:00
|
|
|
|
if (month)
|
2010-08-12 15:14:51 +00:00
|
|
|
|
*month = priv->month;
|
|
|
|
|
|
2005-05-11 19:16:19 +00:00
|
|
|
|
if (day)
|
2010-08-12 15:14:51 +00:00
|
|
|
|
*day = priv->selected_day;
|
2005-05-11 19:16:19 +00:00
|
|
|
|
}
|
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.
|
|
|
|
|
*/
|
|
|
|
|
void
|
|
|
|
|
gtk_calendar_set_detail_func (GtkCalendar *calendar,
|
|
|
|
|
GtkCalendarDetailFunc func,
|
|
|
|
|
gpointer data,
|
|
|
|
|
GDestroyNotify destroy)
|
|
|
|
|
{
|
|
|
|
|
GtkCalendarPrivate *priv;
|
|
|
|
|
|
|
|
|
|
g_return_if_fail (GTK_IS_CALENDAR (calendar));
|
|
|
|
|
|
2013-06-27 19:02:52 +00:00
|
|
|
|
priv = calendar->priv;
|
2007-12-27 20:41:08 +00:00
|
|
|
|
|
|
|
|
|
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.
|
|
|
|
|
*/
|
|
|
|
|
void
|
|
|
|
|
gtk_calendar_set_detail_width_chars (GtkCalendar *calendar,
|
|
|
|
|
gint chars)
|
|
|
|
|
{
|
|
|
|
|
GtkCalendarPrivate *priv;
|
|
|
|
|
|
|
|
|
|
g_return_if_fail (GTK_IS_CALENDAR (calendar));
|
|
|
|
|
|
2013-06-27 19:02:52 +00:00
|
|
|
|
priv = calendar->priv;
|
2007-12-27 20:41:08 +00:00
|
|
|
|
|
|
|
|
|
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.
|
|
|
|
|
*/
|
|
|
|
|
void
|
|
|
|
|
gtk_calendar_set_detail_height_rows (GtkCalendar *calendar,
|
|
|
|
|
gint rows)
|
|
|
|
|
{
|
|
|
|
|
GtkCalendarPrivate *priv;
|
|
|
|
|
|
|
|
|
|
g_return_if_fail (GTK_IS_CALENDAR (calendar));
|
|
|
|
|
|
2013-06-27 19:02:52 +00:00
|
|
|
|
priv = calendar->priv;
|
2007-12-27 20:41:08 +00:00
|
|
|
|
|
|
|
|
|
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.
|
|
|
|
|
*
|
2014-02-19 23:49:43 +00:00
|
|
|
|
* Returns: The width of detail cells, in characters.
|
2007-12-27 20:41:08 +00:00
|
|
|
|
*/
|
|
|
|
|
gint
|
|
|
|
|
gtk_calendar_get_detail_width_chars (GtkCalendar *calendar)
|
|
|
|
|
{
|
|
|
|
|
g_return_val_if_fail (GTK_IS_CALENDAR (calendar), 0);
|
2013-06-27 19:02:52 +00:00
|
|
|
|
|
|
|
|
|
return calendar->priv->detail_width_chars;
|
2007-12-27 20:41:08 +00:00
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
|
* gtk_calendar_get_detail_height_rows:
|
|
|
|
|
* @calendar: a #GtkCalendar.
|
|
|
|
|
*
|
|
|
|
|
* Queries the height of detail cells, in rows.
|
|
|
|
|
* See #GtkCalendar:detail-width-chars.
|
|
|
|
|
*
|
2014-02-19 23:49:43 +00:00
|
|
|
|
* Returns: The height of detail cells, in rows.
|
2007-12-27 20:41:08 +00:00
|
|
|
|
*/
|
|
|
|
|
gint
|
|
|
|
|
gtk_calendar_get_detail_height_rows (GtkCalendar *calendar)
|
|
|
|
|
{
|
|
|
|
|
g_return_val_if_fail (GTK_IS_CALENDAR (calendar), 0);
|
2013-06-27 19:02:52 +00:00
|
|
|
|
|
|
|
|
|
return calendar->priv->detail_height_rows;
|
2007-12-27 20:41:08 +00:00
|
|
|
|
}
|