1997-11-24 22:37:52 +00:00
|
|
|
/* GTK - The GIMP Toolkit
|
|
|
|
* Copyright (C) 1995-1997 Peter Mattis, Spencer Kimball and Josh MacDonald
|
|
|
|
*
|
|
|
|
* This library is free software; you can redistribute it and/or
|
|
|
|
* modify it under the terms of the GNU Library General Public
|
|
|
|
* License as published by the Free Software Foundation; either
|
|
|
|
* version 2 of the License, or (at your option) any later version.
|
|
|
|
*
|
|
|
|
* This library is distributed in the hope that it will be useful,
|
|
|
|
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
|
|
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
|
|
|
|
* Library General Public License for more details.
|
|
|
|
*
|
|
|
|
* You should have received a copy of the GNU Library General Public
|
1998-04-13 02:02:47 +00:00
|
|
|
* License along with this library; if not, write to the
|
|
|
|
* Free Software Foundation, Inc., 59 Temple Place - Suite 330,
|
|
|
|
* Boston, MA 02111-1307, USA.
|
1997-11-24 22:37:52 +00:00
|
|
|
*/
|
|
|
|
#include <string.h>
|
|
|
|
#include <limits.h>
|
|
|
|
#include "gdk/gdk.h"
|
|
|
|
#include "gdk/gdkkeysyms.h"
|
|
|
|
#include "gdk/gdkx.h"
|
GTK_RESIZE_NEEDED is a private flag now.
Mon Feb 2 04:15:08 1998 Tim Janik <timj@gimp.org>
* gtk/gtkcontainer.h:
* gtk/gtkcontainer.c: GTK_RESIZE_NEEDED is a private flag now.
(gtk_container_register_toplevel): new function.
(gtk_container_unregister_toplevel): new function.
* gtk/gtkmain.c: GTK_LEAVE_PENDING is a private flag now.
* gtk/gtkmenu.c: call gtk_container_register_toplevel in
gtk_menu_class_init instead of this dirty gtk_widget_set_parent(,NULL)
hack. new default handler gtk_menu_destroy for calling
gtk_container_unregister_toplevel. removed GTK_ANCHORED, GTK_UNMAPPED.
* gtk/gtkobject.h: macro cleanups, added GTK_DESTROYED flag.
* gtk/gtkobject.c: only emit DESTROY signal if !GTK_OBJECT_DESTROYED
(object).
* gtk/gtkprivate.h: new file that will not be automatically included.
it holds the private flags for GtkWidget along with it's SET/UNSET
and examination macros.
* gtk/gtkwidget.c: private flags: GTK_RESIZE_NEEDED, GTK_REDRAW_PENDING,
GTK_RESIZE_PENDING, GTK_IN_REPARENT, GTK_USER_STYLE. GTK_ANCHORED is
replaced by GTK_TOPLEVEL. added missing UNSET for GTK_IN_REPARENT.
removed the gtk_widget_set_parent(, NULL) hack for toplevels.
upon destroy free memory for widgets with GTK_WIDGET_HAS_SHAPE_MASK.
* gtk/gtkwidget.h: split up the widget flags into a public and a private
portion. added an extra field private_flags to GtkWidget without making
it bigger by using an alignment gap of 16 bit. macro cleanups.
* gtk/gtkwindow.c: removed GTK_ANCHORED. new function gtk_window_destroy
for calling gtk_container_unregister_toplevel. removed the
gtk_widget_set_parent(,NULL), call gtk_container_register_toplevel
instead. remove GTK_UNMAPPED. GTK_RESIZE_NEEDED is private now.
* gtk/gtksignal.c (gtk_signal_disconnect): removed a bug on
removal that cut off the handler list -> living_objects == 0
with testgtk. made some warnings more descriptive.
new function gtk_signal_connect_object_while_alive, which
will automatically destroy the connection once one of the objects
is destroyed. didn't include this before removal of the above
mentioned bug.
* reflected refcounting revolution in ChangeLog
1998-02-02 04:54:25 +00:00
|
|
|
#include "gtkprivate.h"
|
1998-05-10 02:46:20 +00:00
|
|
|
#include "gtkrc.h"
|
1997-11-24 22:37:52 +00:00
|
|
|
#include "gtksignal.h"
|
|
|
|
#include "gtkwindow.h"
|
fixed an assertment.
Sat Jun 6 06:01:24 1998 Tim Janik <timj@gtk.org>
* gtk/gtksignal.c (gtk_signal_emitv): fixed an assertment.
* gtk/makeenums.awk: a script to generate the GtkEnumValue arrays from,
this should eventually be done by gentypeinfo.el somewhen.
* gtk/gtkenumvalues.c: new generated file to hold GtkEnumValue arrays.
* gtk/gtktypeutils.h: new function gtk_enum_values() to retrive all the
enum values of an enum type.
* gtk/gtk.defs:
* gtk/gtkcurve.h:
* gtk/gtkobject.h:
* gtk/gtkprivate.h:
* gtk/gtkwidget.h:
* gtk/gtkenums.h:
brought enum/flags definitions in sync, added a few more enum
definitions for bindings and pattern matching.
* some more macro and GtkType fixups in various places.
* gdk/gdktypes.h (enum): added a new value GDK_AFTER_MASK, which is used
as a key-release modifier for the binding system.
Fri Jun 5 06:06:06 1998 Tim Janik <timj@gtk.org>
* gtk/gtkmenu.h (struct _GtkMenu): removed GList*children, since it
was a stale list pointer that is already present in GtkMenuShell.
* gtk/gtkmenushell.h (struct _GtkMenuShellClass): added a signal
GtkMenuShell::selection_done which is emitted after the menu shell
poped down again and all possible menu items have been activated.
Thu Jun 4 02:20:42 1998 Tim Janik <timj@gtk.org>
* gtk/gtkmenushell.c (gtk_menu_shell_button_release): flush the x-queue
before activation of the menuitem, so the menu is actually taken off the
screen prior to any menu item activation.
* gtk/gtkctree.c (gtk_ctree_get_row_data): allow function invokation
for NULL nodes.
* gtk/gtkwidget.h:
* gtk/gtkwidget.c: new function gtk_widget_stop_accelerator to stop
the emission of the "add-accelerator" signal on a widget. this is
usefull to prevent accelerator installation on certain widgets.
* gtk/gtknotebook.c (gtk_notebook_menu_item_create): keep the menu
labels left justified, by setting their alignment. stop accelerator
installation for the menu items, since we use dynamic menus.
Wed Jun 3 06:41:22 1998 Tim Janik <timj@gtk.org>
* gtk/gtkmenufactory.c: adaptions to use the new accel groups. people
should *really* use GtkItemFactory. this is only for preserving source
compatibility where possible, use of GtkMenuFactory is deprecated as of
now.
* gtk/gtkobject.h (gtk_object_class_add_user_signal): new function
to create user signals of type GTK_RUN_NO_RECURSE. don't know why i
missed this possibility when i added gtk_object_class_add_user_signal
in late january.
* gtk/gtkmain.c (gtk_init): ignore subsequent function calls.
Sun May 31 07:31:09 1998 Tim Janik <timj@gtk.org>
* gtk/gtkaccelgroup.h:
* gtk/gtkaccelgroup.c: new implementation of the accelerator concept.
* gtk/gtkaccellabel.h:
* gtk/gtkaccellabel.c: new widget derived from GtkLabel whitch features
display of the accelerators associated with a certain widget.
* gtk/gtkitemfactory.h:
* gtk/gtkitemfactory.c: new widget, item factory with automatic rc
parsing and accelerator handling.
* gtk/gtkmenu.c (gtk_menu_reposition): new function to care for
positioning a menu.
(gtk_menu_map): removed the allocation code.
(gtk_menu_size_allocate): care for redrawing of children and resize
our widget->window correctly.
(gtk_menu_key_press): feature the new accelerator groups.
* gtk/gtkmenuitem.c (gtk_menu_item_size_allocate): reposition the
submenu if neccessary.
* gtk/gtkmenuitem.c:
* gtk/gtkcheckmenuitem.c:
* gtk/gtkradiomenuitem.c: use GtkAccelLabel in the *_new_with_label()
function variants.
* gdk/gdk.c:
(gdk_keyval_from_name):
(gdk_keyval_name): new functions for keyval<->key-name associations.
(gdk_keyval_to_upper):
(gdk_keyval_to_lower):
(gdk_keyval_is_upper):
(gdk_keyval_is_lower): new functions to check/translate keyvalues with
regards to their cases.
Wed May 27 00:48:10 1998 Tim Janik <timj@gtk.org>
* gtk/gtkwidget.c (gtk_widget_class_path): new function to calculate a
widget's class path.
(gtk_widget_path): new function to calculate a widget's name path.
* gtk/gtkrc.c: newly introduced GtkPatternSpec structures to speed up
pattern matching, features reversed pattern matches.
1998-06-07 06:48:56 +00:00
|
|
|
#include "gtkbindings.h"
|
1998-08-11 19:06:18 +00:00
|
|
|
#include "gtkmain.h"
|
1997-11-24 22:37:52 +00:00
|
|
|
|
|
|
|
enum {
|
1997-12-18 02:17:14 +00:00
|
|
|
SET_FOCUS,
|
1997-11-24 22:37:52 +00:00
|
|
|
LAST_SIGNAL
|
|
|
|
};
|
1998-01-16 00:49:51 +00:00
|
|
|
enum {
|
|
|
|
ARG_0,
|
|
|
|
ARG_TYPE,
|
|
|
|
ARG_TITLE,
|
|
|
|
ARG_AUTO_SHRINK,
|
|
|
|
ARG_ALLOW_SHRINK,
|
1998-01-18 11:09:04 +00:00
|
|
|
ARG_ALLOW_GROW,
|
|
|
|
ARG_WIN_POS
|
1998-01-16 00:49:51 +00:00
|
|
|
};
|
1997-11-24 22:37:52 +00:00
|
|
|
|
|
|
|
static void gtk_window_class_init (GtkWindowClass *klass);
|
|
|
|
static void gtk_window_init (GtkWindow *window);
|
1998-06-28 07:46:10 +00:00
|
|
|
static void gtk_window_set_arg (GtkObject *object,
|
1998-01-16 00:49:51 +00:00
|
|
|
GtkArg *arg,
|
|
|
|
guint arg_id);
|
1998-06-28 07:46:10 +00:00
|
|
|
static void gtk_window_get_arg (GtkObject *object,
|
1998-01-17 07:52:38 +00:00
|
|
|
GtkArg *arg,
|
|
|
|
guint arg_id);
|
1998-06-24 06:25:14 +00:00
|
|
|
static void gtk_window_shutdown (GtkObject *object);
|
GTK_RESIZE_NEEDED is a private flag now.
Mon Feb 2 04:15:08 1998 Tim Janik <timj@gimp.org>
* gtk/gtkcontainer.h:
* gtk/gtkcontainer.c: GTK_RESIZE_NEEDED is a private flag now.
(gtk_container_register_toplevel): new function.
(gtk_container_unregister_toplevel): new function.
* gtk/gtkmain.c: GTK_LEAVE_PENDING is a private flag now.
* gtk/gtkmenu.c: call gtk_container_register_toplevel in
gtk_menu_class_init instead of this dirty gtk_widget_set_parent(,NULL)
hack. new default handler gtk_menu_destroy for calling
gtk_container_unregister_toplevel. removed GTK_ANCHORED, GTK_UNMAPPED.
* gtk/gtkobject.h: macro cleanups, added GTK_DESTROYED flag.
* gtk/gtkobject.c: only emit DESTROY signal if !GTK_OBJECT_DESTROYED
(object).
* gtk/gtkprivate.h: new file that will not be automatically included.
it holds the private flags for GtkWidget along with it's SET/UNSET
and examination macros.
* gtk/gtkwidget.c: private flags: GTK_RESIZE_NEEDED, GTK_REDRAW_PENDING,
GTK_RESIZE_PENDING, GTK_IN_REPARENT, GTK_USER_STYLE. GTK_ANCHORED is
replaced by GTK_TOPLEVEL. added missing UNSET for GTK_IN_REPARENT.
removed the gtk_widget_set_parent(, NULL) hack for toplevels.
upon destroy free memory for widgets with GTK_WIDGET_HAS_SHAPE_MASK.
* gtk/gtkwidget.h: split up the widget flags into a public and a private
portion. added an extra field private_flags to GtkWidget without making
it bigger by using an alignment gap of 16 bit. macro cleanups.
* gtk/gtkwindow.c: removed GTK_ANCHORED. new function gtk_window_destroy
for calling gtk_container_unregister_toplevel. removed the
gtk_widget_set_parent(,NULL), call gtk_container_register_toplevel
instead. remove GTK_UNMAPPED. GTK_RESIZE_NEEDED is private now.
* gtk/gtksignal.c (gtk_signal_disconnect): removed a bug on
removal that cut off the handler list -> living_objects == 0
with testgtk. made some warnings more descriptive.
new function gtk_signal_connect_object_while_alive, which
will automatically destroy the connection once one of the objects
is destroyed. didn't include this before removal of the above
mentioned bug.
* reflected refcounting revolution in ChangeLog
1998-02-02 04:54:25 +00:00
|
|
|
static void gtk_window_destroy (GtkObject *object);
|
1998-01-30 23:47:09 +00:00
|
|
|
static void gtk_window_finalize (GtkObject *object);
|
1997-11-24 22:37:52 +00:00
|
|
|
static void gtk_window_show (GtkWidget *widget);
|
|
|
|
static void gtk_window_hide (GtkWidget *widget);
|
|
|
|
static void gtk_window_map (GtkWidget *widget);
|
|
|
|
static void gtk_window_unmap (GtkWidget *widget);
|
|
|
|
static void gtk_window_realize (GtkWidget *widget);
|
|
|
|
static void gtk_window_size_request (GtkWidget *widget,
|
|
|
|
GtkRequisition *requisition);
|
|
|
|
static void gtk_window_size_allocate (GtkWidget *widget,
|
|
|
|
GtkAllocation *allocation);
|
|
|
|
static gint gtk_window_expose_event (GtkWidget *widget,
|
|
|
|
GdkEventExpose *event);
|
|
|
|
static gint gtk_window_configure_event (GtkWidget *widget,
|
|
|
|
GdkEventConfigure *event);
|
|
|
|
static gint gtk_window_key_press_event (GtkWidget *widget,
|
|
|
|
GdkEventKey *event);
|
|
|
|
static gint gtk_window_key_release_event (GtkWidget *widget,
|
|
|
|
GdkEventKey *event);
|
|
|
|
static gint gtk_window_enter_notify_event (GtkWidget *widget,
|
|
|
|
GdkEventCrossing *event);
|
|
|
|
static gint gtk_window_leave_notify_event (GtkWidget *widget,
|
|
|
|
GdkEventCrossing *event);
|
|
|
|
static gint gtk_window_focus_in_event (GtkWidget *widget,
|
|
|
|
GdkEventFocus *event);
|
|
|
|
static gint gtk_window_focus_out_event (GtkWidget *widget,
|
|
|
|
GdkEventFocus *event);
|
|
|
|
static gint gtk_window_client_event (GtkWidget *widget,
|
1997-11-27 05:07:48 +00:00
|
|
|
GdkEventClient *event);
|
1998-06-19 01:26:24 +00:00
|
|
|
static void gtk_window_check_resize (GtkContainer *container);
|
1997-12-18 02:17:14 +00:00
|
|
|
static void gtk_real_window_set_focus (GtkWindow *window,
|
|
|
|
GtkWidget *focus);
|
1998-06-19 01:26:24 +00:00
|
|
|
static void gtk_window_move_resize (GtkWindow *window);
|
1997-11-24 22:37:52 +00:00
|
|
|
static void gtk_window_set_hints (GtkWidget *widget,
|
|
|
|
GtkRequisition *requisition);
|
|
|
|
|
1998-05-10 02:46:20 +00:00
|
|
|
static void gtk_window_read_rcfiles (GtkWidget *widget,
|
|
|
|
GdkEventClient *event);
|
|
|
|
|
1997-11-24 22:37:52 +00:00
|
|
|
|
|
|
|
static GtkBinClass *parent_class = NULL;
|
1998-03-09 15:16:28 +00:00
|
|
|
static guint window_signals[LAST_SIGNAL] = { 0 };
|
1997-11-24 22:37:52 +00:00
|
|
|
|
|
|
|
|
1998-05-06 01:43:56 +00:00
|
|
|
GtkType
|
1998-05-03 22:41:32 +00:00
|
|
|
gtk_window_get_type (void)
|
1997-11-24 22:37:52 +00:00
|
|
|
{
|
1998-05-06 01:43:56 +00:00
|
|
|
static GtkType window_type = 0;
|
1997-11-24 22:37:52 +00:00
|
|
|
|
|
|
|
if (!window_type)
|
|
|
|
{
|
|
|
|
GtkTypeInfo window_info =
|
|
|
|
{
|
|
|
|
"GtkWindow",
|
|
|
|
sizeof (GtkWindow),
|
|
|
|
sizeof (GtkWindowClass),
|
|
|
|
(GtkClassInitFunc) gtk_window_class_init,
|
|
|
|
(GtkObjectInitFunc) gtk_window_init,
|
1998-07-04 15:31:30 +00:00
|
|
|
/* reserved_1 */ NULL,
|
|
|
|
/* reserved_2 */ NULL,
|
1998-06-28 07:46:10 +00:00
|
|
|
(GtkClassInitFunc) NULL,
|
1997-11-24 22:37:52 +00:00
|
|
|
};
|
|
|
|
|
|
|
|
window_type = gtk_type_unique (gtk_bin_get_type (), &window_info);
|
|
|
|
}
|
|
|
|
|
|
|
|
return window_type;
|
|
|
|
}
|
|
|
|
|
|
|
|
static void
|
|
|
|
gtk_window_class_init (GtkWindowClass *klass)
|
|
|
|
{
|
|
|
|
GtkObjectClass *object_class;
|
|
|
|
GtkWidgetClass *widget_class;
|
|
|
|
GtkContainerClass *container_class;
|
|
|
|
|
|
|
|
object_class = (GtkObjectClass*) klass;
|
|
|
|
widget_class = (GtkWidgetClass*) klass;
|
|
|
|
container_class = (GtkContainerClass*) klass;
|
|
|
|
|
|
|
|
parent_class = gtk_type_class (gtk_bin_get_type ());
|
|
|
|
|
1998-02-19 07:18:42 +00:00
|
|
|
gtk_object_add_arg_type ("GtkWindow::type", GTK_TYPE_WINDOW_TYPE, GTK_ARG_READWRITE, ARG_TYPE);
|
|
|
|
gtk_object_add_arg_type ("GtkWindow::title", GTK_TYPE_STRING, GTK_ARG_READWRITE, ARG_TITLE);
|
|
|
|
gtk_object_add_arg_type ("GtkWindow::auto_shrink", GTK_TYPE_BOOL, GTK_ARG_READWRITE, ARG_AUTO_SHRINK);
|
|
|
|
gtk_object_add_arg_type ("GtkWindow::allow_shrink", GTK_TYPE_BOOL, GTK_ARG_READWRITE, ARG_ALLOW_SHRINK);
|
|
|
|
gtk_object_add_arg_type ("GtkWindow::allow_grow", GTK_TYPE_BOOL, GTK_ARG_READWRITE, ARG_ALLOW_GROW);
|
1998-06-09 07:11:55 +00:00
|
|
|
gtk_object_add_arg_type ("GtkWindow::window_position", GTK_TYPE_WINDOW_POSITION, GTK_ARG_READWRITE, ARG_WIN_POS);
|
1997-11-24 22:37:52 +00:00
|
|
|
|
1997-12-18 02:17:14 +00:00
|
|
|
window_signals[SET_FOCUS] =
|
|
|
|
gtk_signal_new ("set_focus",
|
|
|
|
GTK_RUN_LAST,
|
|
|
|
object_class->type,
|
|
|
|
GTK_SIGNAL_OFFSET (GtkWindowClass, set_focus),
|
1998-07-21 04:13:42 +00:00
|
|
|
gtk_marshal_NONE__POINTER,
|
1997-12-18 02:17:14 +00:00
|
|
|
GTK_TYPE_NONE, 1,
|
|
|
|
GTK_TYPE_POINTER);
|
|
|
|
|
1997-11-24 22:37:52 +00:00
|
|
|
gtk_object_class_add_signals (object_class, window_signals, LAST_SIGNAL);
|
|
|
|
|
1998-06-28 07:46:10 +00:00
|
|
|
object_class->set_arg = gtk_window_set_arg;
|
|
|
|
object_class->get_arg = gtk_window_get_arg;
|
1998-06-24 06:25:14 +00:00
|
|
|
object_class->shutdown = gtk_window_shutdown;
|
GTK_RESIZE_NEEDED is a private flag now.
Mon Feb 2 04:15:08 1998 Tim Janik <timj@gimp.org>
* gtk/gtkcontainer.h:
* gtk/gtkcontainer.c: GTK_RESIZE_NEEDED is a private flag now.
(gtk_container_register_toplevel): new function.
(gtk_container_unregister_toplevel): new function.
* gtk/gtkmain.c: GTK_LEAVE_PENDING is a private flag now.
* gtk/gtkmenu.c: call gtk_container_register_toplevel in
gtk_menu_class_init instead of this dirty gtk_widget_set_parent(,NULL)
hack. new default handler gtk_menu_destroy for calling
gtk_container_unregister_toplevel. removed GTK_ANCHORED, GTK_UNMAPPED.
* gtk/gtkobject.h: macro cleanups, added GTK_DESTROYED flag.
* gtk/gtkobject.c: only emit DESTROY signal if !GTK_OBJECT_DESTROYED
(object).
* gtk/gtkprivate.h: new file that will not be automatically included.
it holds the private flags for GtkWidget along with it's SET/UNSET
and examination macros.
* gtk/gtkwidget.c: private flags: GTK_RESIZE_NEEDED, GTK_REDRAW_PENDING,
GTK_RESIZE_PENDING, GTK_IN_REPARENT, GTK_USER_STYLE. GTK_ANCHORED is
replaced by GTK_TOPLEVEL. added missing UNSET for GTK_IN_REPARENT.
removed the gtk_widget_set_parent(, NULL) hack for toplevels.
upon destroy free memory for widgets with GTK_WIDGET_HAS_SHAPE_MASK.
* gtk/gtkwidget.h: split up the widget flags into a public and a private
portion. added an extra field private_flags to GtkWidget without making
it bigger by using an alignment gap of 16 bit. macro cleanups.
* gtk/gtkwindow.c: removed GTK_ANCHORED. new function gtk_window_destroy
for calling gtk_container_unregister_toplevel. removed the
gtk_widget_set_parent(,NULL), call gtk_container_register_toplevel
instead. remove GTK_UNMAPPED. GTK_RESIZE_NEEDED is private now.
* gtk/gtksignal.c (gtk_signal_disconnect): removed a bug on
removal that cut off the handler list -> living_objects == 0
with testgtk. made some warnings more descriptive.
new function gtk_signal_connect_object_while_alive, which
will automatically destroy the connection once one of the objects
is destroyed. didn't include this before removal of the above
mentioned bug.
* reflected refcounting revolution in ChangeLog
1998-02-02 04:54:25 +00:00
|
|
|
object_class->destroy = gtk_window_destroy;
|
1998-01-30 23:47:09 +00:00
|
|
|
object_class->finalize = gtk_window_finalize;
|
1997-11-24 22:37:52 +00:00
|
|
|
|
|
|
|
widget_class->show = gtk_window_show;
|
|
|
|
widget_class->hide = gtk_window_hide;
|
|
|
|
widget_class->map = gtk_window_map;
|
|
|
|
widget_class->unmap = gtk_window_unmap;
|
|
|
|
widget_class->realize = gtk_window_realize;
|
|
|
|
widget_class->size_request = gtk_window_size_request;
|
|
|
|
widget_class->size_allocate = gtk_window_size_allocate;
|
|
|
|
widget_class->expose_event = gtk_window_expose_event;
|
|
|
|
widget_class->configure_event = gtk_window_configure_event;
|
|
|
|
widget_class->key_press_event = gtk_window_key_press_event;
|
|
|
|
widget_class->key_release_event = gtk_window_key_release_event;
|
|
|
|
widget_class->enter_notify_event = gtk_window_enter_notify_event;
|
|
|
|
widget_class->leave_notify_event = gtk_window_leave_notify_event;
|
|
|
|
widget_class->focus_in_event = gtk_window_focus_in_event;
|
|
|
|
widget_class->focus_out_event = gtk_window_focus_out_event;
|
|
|
|
widget_class->client_event = gtk_window_client_event;
|
|
|
|
|
1998-06-19 01:26:24 +00:00
|
|
|
container_class->check_resize = gtk_window_check_resize;
|
1997-11-24 22:37:52 +00:00
|
|
|
|
1997-12-18 02:17:14 +00:00
|
|
|
klass->set_focus = gtk_real_window_set_focus;
|
1997-11-24 22:37:52 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
static void
|
|
|
|
gtk_window_init (GtkWindow *window)
|
|
|
|
{
|
|
|
|
GTK_WIDGET_UNSET_FLAGS (window, GTK_NO_WINDOW);
|
GTK_RESIZE_NEEDED is a private flag now.
Mon Feb 2 04:15:08 1998 Tim Janik <timj@gimp.org>
* gtk/gtkcontainer.h:
* gtk/gtkcontainer.c: GTK_RESIZE_NEEDED is a private flag now.
(gtk_container_register_toplevel): new function.
(gtk_container_unregister_toplevel): new function.
* gtk/gtkmain.c: GTK_LEAVE_PENDING is a private flag now.
* gtk/gtkmenu.c: call gtk_container_register_toplevel in
gtk_menu_class_init instead of this dirty gtk_widget_set_parent(,NULL)
hack. new default handler gtk_menu_destroy for calling
gtk_container_unregister_toplevel. removed GTK_ANCHORED, GTK_UNMAPPED.
* gtk/gtkobject.h: macro cleanups, added GTK_DESTROYED flag.
* gtk/gtkobject.c: only emit DESTROY signal if !GTK_OBJECT_DESTROYED
(object).
* gtk/gtkprivate.h: new file that will not be automatically included.
it holds the private flags for GtkWidget along with it's SET/UNSET
and examination macros.
* gtk/gtkwidget.c: private flags: GTK_RESIZE_NEEDED, GTK_REDRAW_PENDING,
GTK_RESIZE_PENDING, GTK_IN_REPARENT, GTK_USER_STYLE. GTK_ANCHORED is
replaced by GTK_TOPLEVEL. added missing UNSET for GTK_IN_REPARENT.
removed the gtk_widget_set_parent(, NULL) hack for toplevels.
upon destroy free memory for widgets with GTK_WIDGET_HAS_SHAPE_MASK.
* gtk/gtkwidget.h: split up the widget flags into a public and a private
portion. added an extra field private_flags to GtkWidget without making
it bigger by using an alignment gap of 16 bit. macro cleanups.
* gtk/gtkwindow.c: removed GTK_ANCHORED. new function gtk_window_destroy
for calling gtk_container_unregister_toplevel. removed the
gtk_widget_set_parent(,NULL), call gtk_container_register_toplevel
instead. remove GTK_UNMAPPED. GTK_RESIZE_NEEDED is private now.
* gtk/gtksignal.c (gtk_signal_disconnect): removed a bug on
removal that cut off the handler list -> living_objects == 0
with testgtk. made some warnings more descriptive.
new function gtk_signal_connect_object_while_alive, which
will automatically destroy the connection once one of the objects
is destroyed. didn't include this before removal of the above
mentioned bug.
* reflected refcounting revolution in ChangeLog
1998-02-02 04:54:25 +00:00
|
|
|
GTK_WIDGET_SET_FLAGS (window, GTK_TOPLEVEL);
|
1997-11-24 22:37:52 +00:00
|
|
|
|
1998-06-24 06:25:14 +00:00
|
|
|
gtk_container_set_resize_mode (GTK_CONTAINER (window), GTK_RESIZE_QUEUE);
|
|
|
|
|
1997-11-24 22:37:52 +00:00
|
|
|
window->title = NULL;
|
1998-08-18 16:58:09 +00:00
|
|
|
window->wmclass_name = g_strdup (g_get_prgname ());
|
1998-03-17 18:29:07 +00:00
|
|
|
window->wmclass_class = g_strdup (gdk_progclass);
|
1997-11-24 22:37:52 +00:00
|
|
|
window->type = GTK_WINDOW_TOPLEVEL;
|
|
|
|
window->focus_widget = NULL;
|
|
|
|
window->default_widget = NULL;
|
|
|
|
window->resize_count = 0;
|
|
|
|
window->allow_shrink = FALSE;
|
|
|
|
window->allow_grow = TRUE;
|
|
|
|
window->auto_shrink = FALSE;
|
|
|
|
window->handling_resize = FALSE;
|
|
|
|
window->position = GTK_WIN_POS_NONE;
|
|
|
|
window->use_uposition = TRUE;
|
1998-08-11 19:06:18 +00:00
|
|
|
window->modal = FALSE;
|
1998-01-30 23:47:09 +00:00
|
|
|
|
GTK_RESIZE_NEEDED is a private flag now.
Mon Feb 2 04:15:08 1998 Tim Janik <timj@gimp.org>
* gtk/gtkcontainer.h:
* gtk/gtkcontainer.c: GTK_RESIZE_NEEDED is a private flag now.
(gtk_container_register_toplevel): new function.
(gtk_container_unregister_toplevel): new function.
* gtk/gtkmain.c: GTK_LEAVE_PENDING is a private flag now.
* gtk/gtkmenu.c: call gtk_container_register_toplevel in
gtk_menu_class_init instead of this dirty gtk_widget_set_parent(,NULL)
hack. new default handler gtk_menu_destroy for calling
gtk_container_unregister_toplevel. removed GTK_ANCHORED, GTK_UNMAPPED.
* gtk/gtkobject.h: macro cleanups, added GTK_DESTROYED flag.
* gtk/gtkobject.c: only emit DESTROY signal if !GTK_OBJECT_DESTROYED
(object).
* gtk/gtkprivate.h: new file that will not be automatically included.
it holds the private flags for GtkWidget along with it's SET/UNSET
and examination macros.
* gtk/gtkwidget.c: private flags: GTK_RESIZE_NEEDED, GTK_REDRAW_PENDING,
GTK_RESIZE_PENDING, GTK_IN_REPARENT, GTK_USER_STYLE. GTK_ANCHORED is
replaced by GTK_TOPLEVEL. added missing UNSET for GTK_IN_REPARENT.
removed the gtk_widget_set_parent(, NULL) hack for toplevels.
upon destroy free memory for widgets with GTK_WIDGET_HAS_SHAPE_MASK.
* gtk/gtkwidget.h: split up the widget flags into a public and a private
portion. added an extra field private_flags to GtkWidget without making
it bigger by using an alignment gap of 16 bit. macro cleanups.
* gtk/gtkwindow.c: removed GTK_ANCHORED. new function gtk_window_destroy
for calling gtk_container_unregister_toplevel. removed the
gtk_widget_set_parent(,NULL), call gtk_container_register_toplevel
instead. remove GTK_UNMAPPED. GTK_RESIZE_NEEDED is private now.
* gtk/gtksignal.c (gtk_signal_disconnect): removed a bug on
removal that cut off the handler list -> living_objects == 0
with testgtk. made some warnings more descriptive.
new function gtk_signal_connect_object_while_alive, which
will automatically destroy the connection once one of the objects
is destroyed. didn't include this before removal of the above
mentioned bug.
* reflected refcounting revolution in ChangeLog
1998-02-02 04:54:25 +00:00
|
|
|
gtk_container_register_toplevel (GTK_CONTAINER (window));
|
1997-11-24 22:37:52 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
static void
|
1998-06-28 07:46:10 +00:00
|
|
|
gtk_window_set_arg (GtkObject *object,
|
1998-01-16 00:49:51 +00:00
|
|
|
GtkArg *arg,
|
|
|
|
guint arg_id)
|
1997-11-24 22:37:52 +00:00
|
|
|
{
|
1998-06-28 07:46:10 +00:00
|
|
|
GtkWindow *window;
|
|
|
|
|
|
|
|
window = GTK_WINDOW (object);
|
|
|
|
|
1998-01-16 00:49:51 +00:00
|
|
|
switch (arg_id)
|
1997-11-24 22:37:52 +00:00
|
|
|
{
|
1998-01-16 00:49:51 +00:00
|
|
|
case ARG_TYPE:
|
1998-01-17 07:52:38 +00:00
|
|
|
window->type = GTK_VALUE_ENUM (*arg);
|
1998-01-16 00:49:51 +00:00
|
|
|
break;
|
|
|
|
case ARG_TITLE:
|
1998-01-18 11:09:04 +00:00
|
|
|
gtk_window_set_title (window, GTK_VALUE_STRING (*arg));
|
1998-01-16 00:49:51 +00:00
|
|
|
break;
|
|
|
|
case ARG_AUTO_SHRINK:
|
1998-01-18 11:09:04 +00:00
|
|
|
window->auto_shrink = (GTK_VALUE_BOOL (*arg) != FALSE);
|
1998-03-18 02:05:27 +00:00
|
|
|
gtk_window_set_hints (GTK_WIDGET (window), >K_WIDGET (window)->requisition);
|
1998-01-16 00:49:51 +00:00
|
|
|
break;
|
|
|
|
case ARG_ALLOW_SHRINK:
|
1998-01-18 11:09:04 +00:00
|
|
|
window->allow_shrink = (GTK_VALUE_BOOL (*arg) != FALSE);
|
1998-03-18 02:05:27 +00:00
|
|
|
gtk_window_set_hints (GTK_WIDGET (window), >K_WIDGET (window)->requisition);
|
1998-01-16 00:49:51 +00:00
|
|
|
break;
|
|
|
|
case ARG_ALLOW_GROW:
|
1998-01-18 11:09:04 +00:00
|
|
|
window->allow_grow = (GTK_VALUE_BOOL (*arg) != FALSE);
|
1998-03-18 02:05:27 +00:00
|
|
|
gtk_window_set_hints (GTK_WIDGET (window), >K_WIDGET (window)->requisition);
|
1998-01-18 11:09:04 +00:00
|
|
|
break;
|
|
|
|
case ARG_WIN_POS:
|
|
|
|
gtk_window_position (window, GTK_VALUE_ENUM (*arg));
|
1998-01-16 00:49:51 +00:00
|
|
|
break;
|
1998-01-21 23:03:11 +00:00
|
|
|
default:
|
|
|
|
break;
|
1997-11-24 22:37:52 +00:00
|
|
|
}
|
|
|
|
}
|
|
|
|
|
1998-01-17 07:52:38 +00:00
|
|
|
static void
|
1998-06-28 07:46:10 +00:00
|
|
|
gtk_window_get_arg (GtkObject *object,
|
1998-01-17 07:52:38 +00:00
|
|
|
GtkArg *arg,
|
|
|
|
guint arg_id)
|
|
|
|
{
|
1998-06-28 07:46:10 +00:00
|
|
|
GtkWindow *window;
|
|
|
|
|
|
|
|
window = GTK_WINDOW (object);
|
|
|
|
|
1998-01-17 07:52:38 +00:00
|
|
|
switch (arg_id)
|
|
|
|
{
|
|
|
|
case ARG_TYPE:
|
1998-01-18 11:09:04 +00:00
|
|
|
GTK_VALUE_ENUM (*arg) = window->type;
|
1998-01-17 07:52:38 +00:00
|
|
|
break;
|
|
|
|
case ARG_TITLE:
|
1998-01-18 11:09:04 +00:00
|
|
|
GTK_VALUE_STRING (*arg) = g_strdup (window->title);
|
1998-01-17 07:52:38 +00:00
|
|
|
break;
|
|
|
|
case ARG_AUTO_SHRINK:
|
1998-01-18 11:09:04 +00:00
|
|
|
GTK_VALUE_BOOL (*arg) = window->auto_shrink;
|
1998-01-17 07:52:38 +00:00
|
|
|
break;
|
|
|
|
case ARG_ALLOW_SHRINK:
|
1998-01-18 11:09:04 +00:00
|
|
|
GTK_VALUE_BOOL (*arg) = window->allow_shrink;
|
1998-01-17 07:52:38 +00:00
|
|
|
break;
|
|
|
|
case ARG_ALLOW_GROW:
|
1998-01-18 11:09:04 +00:00
|
|
|
GTK_VALUE_BOOL (*arg) = window->allow_grow;
|
|
|
|
break;
|
|
|
|
case ARG_WIN_POS:
|
|
|
|
GTK_VALUE_ENUM (*arg) = window->position;
|
1998-01-17 07:52:38 +00:00
|
|
|
break;
|
|
|
|
default:
|
|
|
|
arg->type = GTK_TYPE_INVALID;
|
|
|
|
break;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
1997-11-24 22:37:52 +00:00
|
|
|
GtkWidget*
|
|
|
|
gtk_window_new (GtkWindowType type)
|
|
|
|
{
|
|
|
|
GtkWindow *window;
|
|
|
|
|
|
|
|
window = gtk_type_new (gtk_window_get_type ());
|
|
|
|
|
|
|
|
window->type = type;
|
|
|
|
|
|
|
|
return GTK_WIDGET (window);
|
|
|
|
}
|
|
|
|
|
|
|
|
void
|
|
|
|
gtk_window_set_title (GtkWindow *window,
|
|
|
|
const gchar *title)
|
|
|
|
{
|
|
|
|
g_return_if_fail (window != NULL);
|
|
|
|
g_return_if_fail (GTK_IS_WINDOW (window));
|
|
|
|
|
|
|
|
if (window->title)
|
|
|
|
g_free (window->title);
|
|
|
|
window->title = g_strdup (title);
|
|
|
|
|
|
|
|
if (GTK_WIDGET_REALIZED (window))
|
|
|
|
gdk_window_set_title (GTK_WIDGET (window)->window, window->title);
|
|
|
|
}
|
|
|
|
|
|
|
|
void
|
|
|
|
gtk_window_set_wmclass (GtkWindow *window,
|
1998-05-12 21:30:52 +00:00
|
|
|
const gchar *wmclass_name,
|
|
|
|
const gchar *wmclass_class)
|
1997-11-24 22:37:52 +00:00
|
|
|
{
|
|
|
|
g_return_if_fail (window != NULL);
|
|
|
|
g_return_if_fail (GTK_IS_WINDOW (window));
|
|
|
|
|
1998-02-23 11:14:27 +00:00
|
|
|
g_free (window->wmclass_name);
|
1997-11-24 22:37:52 +00:00
|
|
|
window->wmclass_name = g_strdup (wmclass_name);
|
|
|
|
|
1998-02-23 11:14:27 +00:00
|
|
|
g_free (window->wmclass_class);
|
1997-11-24 22:37:52 +00:00
|
|
|
window->wmclass_class = g_strdup (wmclass_class);
|
|
|
|
|
|
|
|
if (GTK_WIDGET_REALIZED (window))
|
|
|
|
g_warning ("shouldn't set wmclass after window is realized!\n");
|
|
|
|
}
|
|
|
|
|
|
|
|
void
|
|
|
|
gtk_window_set_focus (GtkWindow *window,
|
|
|
|
GtkWidget *focus)
|
|
|
|
{
|
1997-12-18 02:17:14 +00:00
|
|
|
gtk_signal_emit (GTK_OBJECT (window), window_signals[SET_FOCUS], focus);
|
1997-11-24 22:37:52 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
void
|
|
|
|
gtk_window_set_default (GtkWindow *window,
|
1998-04-13 04:42:11 +00:00
|
|
|
GtkWidget *default_widget)
|
1997-11-24 22:37:52 +00:00
|
|
|
{
|
|
|
|
g_return_if_fail (window != NULL);
|
|
|
|
g_return_if_fail (GTK_IS_WINDOW (window));
|
|
|
|
|
1998-04-13 04:42:11 +00:00
|
|
|
if (default_widget)
|
|
|
|
g_return_if_fail (GTK_WIDGET_CAN_DEFAULT (default_widget));
|
|
|
|
|
|
|
|
if (window->default_widget != default_widget)
|
1997-11-24 22:37:52 +00:00
|
|
|
{
|
|
|
|
if (window->default_widget)
|
|
|
|
{
|
|
|
|
GTK_WIDGET_UNSET_FLAGS (window->default_widget, GTK_HAS_DEFAULT);
|
|
|
|
gtk_widget_draw_default (window->default_widget);
|
|
|
|
}
|
|
|
|
|
1998-04-13 04:42:11 +00:00
|
|
|
window->default_widget = default_widget;
|
1997-11-24 22:37:52 +00:00
|
|
|
|
|
|
|
if (window->default_widget)
|
|
|
|
{
|
|
|
|
GTK_WIDGET_SET_FLAGS (window->default_widget, GTK_HAS_DEFAULT);
|
|
|
|
gtk_widget_draw_default (window->default_widget);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
void
|
|
|
|
gtk_window_set_policy (GtkWindow *window,
|
|
|
|
gint allow_shrink,
|
|
|
|
gint allow_grow,
|
|
|
|
gint auto_shrink)
|
|
|
|
{
|
|
|
|
g_return_if_fail (window != NULL);
|
|
|
|
g_return_if_fail (GTK_IS_WINDOW (window));
|
|
|
|
|
|
|
|
window->allow_shrink = (allow_shrink != FALSE);
|
|
|
|
window->allow_grow = (allow_grow != FALSE);
|
|
|
|
window->auto_shrink = (auto_shrink != FALSE);
|
1998-03-18 02:05:27 +00:00
|
|
|
|
|
|
|
gtk_window_set_hints (GTK_WIDGET (window), >K_WIDGET (window)->requisition);
|
1997-11-24 22:37:52 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
void
|
fixed an assertment.
Sat Jun 6 06:01:24 1998 Tim Janik <timj@gtk.org>
* gtk/gtksignal.c (gtk_signal_emitv): fixed an assertment.
* gtk/makeenums.awk: a script to generate the GtkEnumValue arrays from,
this should eventually be done by gentypeinfo.el somewhen.
* gtk/gtkenumvalues.c: new generated file to hold GtkEnumValue arrays.
* gtk/gtktypeutils.h: new function gtk_enum_values() to retrive all the
enum values of an enum type.
* gtk/gtk.defs:
* gtk/gtkcurve.h:
* gtk/gtkobject.h:
* gtk/gtkprivate.h:
* gtk/gtkwidget.h:
* gtk/gtkenums.h:
brought enum/flags definitions in sync, added a few more enum
definitions for bindings and pattern matching.
* some more macro and GtkType fixups in various places.
* gdk/gdktypes.h (enum): added a new value GDK_AFTER_MASK, which is used
as a key-release modifier for the binding system.
Fri Jun 5 06:06:06 1998 Tim Janik <timj@gtk.org>
* gtk/gtkmenu.h (struct _GtkMenu): removed GList*children, since it
was a stale list pointer that is already present in GtkMenuShell.
* gtk/gtkmenushell.h (struct _GtkMenuShellClass): added a signal
GtkMenuShell::selection_done which is emitted after the menu shell
poped down again and all possible menu items have been activated.
Thu Jun 4 02:20:42 1998 Tim Janik <timj@gtk.org>
* gtk/gtkmenushell.c (gtk_menu_shell_button_release): flush the x-queue
before activation of the menuitem, so the menu is actually taken off the
screen prior to any menu item activation.
* gtk/gtkctree.c (gtk_ctree_get_row_data): allow function invokation
for NULL nodes.
* gtk/gtkwidget.h:
* gtk/gtkwidget.c: new function gtk_widget_stop_accelerator to stop
the emission of the "add-accelerator" signal on a widget. this is
usefull to prevent accelerator installation on certain widgets.
* gtk/gtknotebook.c (gtk_notebook_menu_item_create): keep the menu
labels left justified, by setting their alignment. stop accelerator
installation for the menu items, since we use dynamic menus.
Wed Jun 3 06:41:22 1998 Tim Janik <timj@gtk.org>
* gtk/gtkmenufactory.c: adaptions to use the new accel groups. people
should *really* use GtkItemFactory. this is only for preserving source
compatibility where possible, use of GtkMenuFactory is deprecated as of
now.
* gtk/gtkobject.h (gtk_object_class_add_user_signal): new function
to create user signals of type GTK_RUN_NO_RECURSE. don't know why i
missed this possibility when i added gtk_object_class_add_user_signal
in late january.
* gtk/gtkmain.c (gtk_init): ignore subsequent function calls.
Sun May 31 07:31:09 1998 Tim Janik <timj@gtk.org>
* gtk/gtkaccelgroup.h:
* gtk/gtkaccelgroup.c: new implementation of the accelerator concept.
* gtk/gtkaccellabel.h:
* gtk/gtkaccellabel.c: new widget derived from GtkLabel whitch features
display of the accelerators associated with a certain widget.
* gtk/gtkitemfactory.h:
* gtk/gtkitemfactory.c: new widget, item factory with automatic rc
parsing and accelerator handling.
* gtk/gtkmenu.c (gtk_menu_reposition): new function to care for
positioning a menu.
(gtk_menu_map): removed the allocation code.
(gtk_menu_size_allocate): care for redrawing of children and resize
our widget->window correctly.
(gtk_menu_key_press): feature the new accelerator groups.
* gtk/gtkmenuitem.c (gtk_menu_item_size_allocate): reposition the
submenu if neccessary.
* gtk/gtkmenuitem.c:
* gtk/gtkcheckmenuitem.c:
* gtk/gtkradiomenuitem.c: use GtkAccelLabel in the *_new_with_label()
function variants.
* gdk/gdk.c:
(gdk_keyval_from_name):
(gdk_keyval_name): new functions for keyval<->key-name associations.
(gdk_keyval_to_upper):
(gdk_keyval_to_lower):
(gdk_keyval_is_upper):
(gdk_keyval_is_lower): new functions to check/translate keyvalues with
regards to their cases.
Wed May 27 00:48:10 1998 Tim Janik <timj@gtk.org>
* gtk/gtkwidget.c (gtk_widget_class_path): new function to calculate a
widget's class path.
(gtk_widget_path): new function to calculate a widget's name path.
* gtk/gtkrc.c: newly introduced GtkPatternSpec structures to speed up
pattern matching, features reversed pattern matches.
1998-06-07 06:48:56 +00:00
|
|
|
gtk_window_add_accel_group (GtkWindow *window,
|
|
|
|
GtkAccelGroup *accel_group)
|
1997-11-24 22:37:52 +00:00
|
|
|
{
|
|
|
|
g_return_if_fail (window != NULL);
|
|
|
|
g_return_if_fail (GTK_IS_WINDOW (window));
|
fixed an assertment.
Sat Jun 6 06:01:24 1998 Tim Janik <timj@gtk.org>
* gtk/gtksignal.c (gtk_signal_emitv): fixed an assertment.
* gtk/makeenums.awk: a script to generate the GtkEnumValue arrays from,
this should eventually be done by gentypeinfo.el somewhen.
* gtk/gtkenumvalues.c: new generated file to hold GtkEnumValue arrays.
* gtk/gtktypeutils.h: new function gtk_enum_values() to retrive all the
enum values of an enum type.
* gtk/gtk.defs:
* gtk/gtkcurve.h:
* gtk/gtkobject.h:
* gtk/gtkprivate.h:
* gtk/gtkwidget.h:
* gtk/gtkenums.h:
brought enum/flags definitions in sync, added a few more enum
definitions for bindings and pattern matching.
* some more macro and GtkType fixups in various places.
* gdk/gdktypes.h (enum): added a new value GDK_AFTER_MASK, which is used
as a key-release modifier for the binding system.
Fri Jun 5 06:06:06 1998 Tim Janik <timj@gtk.org>
* gtk/gtkmenu.h (struct _GtkMenu): removed GList*children, since it
was a stale list pointer that is already present in GtkMenuShell.
* gtk/gtkmenushell.h (struct _GtkMenuShellClass): added a signal
GtkMenuShell::selection_done which is emitted after the menu shell
poped down again and all possible menu items have been activated.
Thu Jun 4 02:20:42 1998 Tim Janik <timj@gtk.org>
* gtk/gtkmenushell.c (gtk_menu_shell_button_release): flush the x-queue
before activation of the menuitem, so the menu is actually taken off the
screen prior to any menu item activation.
* gtk/gtkctree.c (gtk_ctree_get_row_data): allow function invokation
for NULL nodes.
* gtk/gtkwidget.h:
* gtk/gtkwidget.c: new function gtk_widget_stop_accelerator to stop
the emission of the "add-accelerator" signal on a widget. this is
usefull to prevent accelerator installation on certain widgets.
* gtk/gtknotebook.c (gtk_notebook_menu_item_create): keep the menu
labels left justified, by setting their alignment. stop accelerator
installation for the menu items, since we use dynamic menus.
Wed Jun 3 06:41:22 1998 Tim Janik <timj@gtk.org>
* gtk/gtkmenufactory.c: adaptions to use the new accel groups. people
should *really* use GtkItemFactory. this is only for preserving source
compatibility where possible, use of GtkMenuFactory is deprecated as of
now.
* gtk/gtkobject.h (gtk_object_class_add_user_signal): new function
to create user signals of type GTK_RUN_NO_RECURSE. don't know why i
missed this possibility when i added gtk_object_class_add_user_signal
in late january.
* gtk/gtkmain.c (gtk_init): ignore subsequent function calls.
Sun May 31 07:31:09 1998 Tim Janik <timj@gtk.org>
* gtk/gtkaccelgroup.h:
* gtk/gtkaccelgroup.c: new implementation of the accelerator concept.
* gtk/gtkaccellabel.h:
* gtk/gtkaccellabel.c: new widget derived from GtkLabel whitch features
display of the accelerators associated with a certain widget.
* gtk/gtkitemfactory.h:
* gtk/gtkitemfactory.c: new widget, item factory with automatic rc
parsing and accelerator handling.
* gtk/gtkmenu.c (gtk_menu_reposition): new function to care for
positioning a menu.
(gtk_menu_map): removed the allocation code.
(gtk_menu_size_allocate): care for redrawing of children and resize
our widget->window correctly.
(gtk_menu_key_press): feature the new accelerator groups.
* gtk/gtkmenuitem.c (gtk_menu_item_size_allocate): reposition the
submenu if neccessary.
* gtk/gtkmenuitem.c:
* gtk/gtkcheckmenuitem.c:
* gtk/gtkradiomenuitem.c: use GtkAccelLabel in the *_new_with_label()
function variants.
* gdk/gdk.c:
(gdk_keyval_from_name):
(gdk_keyval_name): new functions for keyval<->key-name associations.
(gdk_keyval_to_upper):
(gdk_keyval_to_lower):
(gdk_keyval_is_upper):
(gdk_keyval_is_lower): new functions to check/translate keyvalues with
regards to their cases.
Wed May 27 00:48:10 1998 Tim Janik <timj@gtk.org>
* gtk/gtkwidget.c (gtk_widget_class_path): new function to calculate a
widget's class path.
(gtk_widget_path): new function to calculate a widget's name path.
* gtk/gtkrc.c: newly introduced GtkPatternSpec structures to speed up
pattern matching, features reversed pattern matches.
1998-06-07 06:48:56 +00:00
|
|
|
g_return_if_fail (accel_group != NULL);
|
1997-11-24 22:37:52 +00:00
|
|
|
|
fixed an assertment.
Sat Jun 6 06:01:24 1998 Tim Janik <timj@gtk.org>
* gtk/gtksignal.c (gtk_signal_emitv): fixed an assertment.
* gtk/makeenums.awk: a script to generate the GtkEnumValue arrays from,
this should eventually be done by gentypeinfo.el somewhen.
* gtk/gtkenumvalues.c: new generated file to hold GtkEnumValue arrays.
* gtk/gtktypeutils.h: new function gtk_enum_values() to retrive all the
enum values of an enum type.
* gtk/gtk.defs:
* gtk/gtkcurve.h:
* gtk/gtkobject.h:
* gtk/gtkprivate.h:
* gtk/gtkwidget.h:
* gtk/gtkenums.h:
brought enum/flags definitions in sync, added a few more enum
definitions for bindings and pattern matching.
* some more macro and GtkType fixups in various places.
* gdk/gdktypes.h (enum): added a new value GDK_AFTER_MASK, which is used
as a key-release modifier for the binding system.
Fri Jun 5 06:06:06 1998 Tim Janik <timj@gtk.org>
* gtk/gtkmenu.h (struct _GtkMenu): removed GList*children, since it
was a stale list pointer that is already present in GtkMenuShell.
* gtk/gtkmenushell.h (struct _GtkMenuShellClass): added a signal
GtkMenuShell::selection_done which is emitted after the menu shell
poped down again and all possible menu items have been activated.
Thu Jun 4 02:20:42 1998 Tim Janik <timj@gtk.org>
* gtk/gtkmenushell.c (gtk_menu_shell_button_release): flush the x-queue
before activation of the menuitem, so the menu is actually taken off the
screen prior to any menu item activation.
* gtk/gtkctree.c (gtk_ctree_get_row_data): allow function invokation
for NULL nodes.
* gtk/gtkwidget.h:
* gtk/gtkwidget.c: new function gtk_widget_stop_accelerator to stop
the emission of the "add-accelerator" signal on a widget. this is
usefull to prevent accelerator installation on certain widgets.
* gtk/gtknotebook.c (gtk_notebook_menu_item_create): keep the menu
labels left justified, by setting their alignment. stop accelerator
installation for the menu items, since we use dynamic menus.
Wed Jun 3 06:41:22 1998 Tim Janik <timj@gtk.org>
* gtk/gtkmenufactory.c: adaptions to use the new accel groups. people
should *really* use GtkItemFactory. this is only for preserving source
compatibility where possible, use of GtkMenuFactory is deprecated as of
now.
* gtk/gtkobject.h (gtk_object_class_add_user_signal): new function
to create user signals of type GTK_RUN_NO_RECURSE. don't know why i
missed this possibility when i added gtk_object_class_add_user_signal
in late january.
* gtk/gtkmain.c (gtk_init): ignore subsequent function calls.
Sun May 31 07:31:09 1998 Tim Janik <timj@gtk.org>
* gtk/gtkaccelgroup.h:
* gtk/gtkaccelgroup.c: new implementation of the accelerator concept.
* gtk/gtkaccellabel.h:
* gtk/gtkaccellabel.c: new widget derived from GtkLabel whitch features
display of the accelerators associated with a certain widget.
* gtk/gtkitemfactory.h:
* gtk/gtkitemfactory.c: new widget, item factory with automatic rc
parsing and accelerator handling.
* gtk/gtkmenu.c (gtk_menu_reposition): new function to care for
positioning a menu.
(gtk_menu_map): removed the allocation code.
(gtk_menu_size_allocate): care for redrawing of children and resize
our widget->window correctly.
(gtk_menu_key_press): feature the new accelerator groups.
* gtk/gtkmenuitem.c (gtk_menu_item_size_allocate): reposition the
submenu if neccessary.
* gtk/gtkmenuitem.c:
* gtk/gtkcheckmenuitem.c:
* gtk/gtkradiomenuitem.c: use GtkAccelLabel in the *_new_with_label()
function variants.
* gdk/gdk.c:
(gdk_keyval_from_name):
(gdk_keyval_name): new functions for keyval<->key-name associations.
(gdk_keyval_to_upper):
(gdk_keyval_to_lower):
(gdk_keyval_is_upper):
(gdk_keyval_is_lower): new functions to check/translate keyvalues with
regards to their cases.
Wed May 27 00:48:10 1998 Tim Janik <timj@gtk.org>
* gtk/gtkwidget.c (gtk_widget_class_path): new function to calculate a
widget's class path.
(gtk_widget_path): new function to calculate a widget's name path.
* gtk/gtkrc.c: newly introduced GtkPatternSpec structures to speed up
pattern matching, features reversed pattern matches.
1998-06-07 06:48:56 +00:00
|
|
|
gtk_accel_group_attach (accel_group, GTK_OBJECT (window));
|
1997-11-24 22:37:52 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
void
|
fixed an assertment.
Sat Jun 6 06:01:24 1998 Tim Janik <timj@gtk.org>
* gtk/gtksignal.c (gtk_signal_emitv): fixed an assertment.
* gtk/makeenums.awk: a script to generate the GtkEnumValue arrays from,
this should eventually be done by gentypeinfo.el somewhen.
* gtk/gtkenumvalues.c: new generated file to hold GtkEnumValue arrays.
* gtk/gtktypeutils.h: new function gtk_enum_values() to retrive all the
enum values of an enum type.
* gtk/gtk.defs:
* gtk/gtkcurve.h:
* gtk/gtkobject.h:
* gtk/gtkprivate.h:
* gtk/gtkwidget.h:
* gtk/gtkenums.h:
brought enum/flags definitions in sync, added a few more enum
definitions for bindings and pattern matching.
* some more macro and GtkType fixups in various places.
* gdk/gdktypes.h (enum): added a new value GDK_AFTER_MASK, which is used
as a key-release modifier for the binding system.
Fri Jun 5 06:06:06 1998 Tim Janik <timj@gtk.org>
* gtk/gtkmenu.h (struct _GtkMenu): removed GList*children, since it
was a stale list pointer that is already present in GtkMenuShell.
* gtk/gtkmenushell.h (struct _GtkMenuShellClass): added a signal
GtkMenuShell::selection_done which is emitted after the menu shell
poped down again and all possible menu items have been activated.
Thu Jun 4 02:20:42 1998 Tim Janik <timj@gtk.org>
* gtk/gtkmenushell.c (gtk_menu_shell_button_release): flush the x-queue
before activation of the menuitem, so the menu is actually taken off the
screen prior to any menu item activation.
* gtk/gtkctree.c (gtk_ctree_get_row_data): allow function invokation
for NULL nodes.
* gtk/gtkwidget.h:
* gtk/gtkwidget.c: new function gtk_widget_stop_accelerator to stop
the emission of the "add-accelerator" signal on a widget. this is
usefull to prevent accelerator installation on certain widgets.
* gtk/gtknotebook.c (gtk_notebook_menu_item_create): keep the menu
labels left justified, by setting their alignment. stop accelerator
installation for the menu items, since we use dynamic menus.
Wed Jun 3 06:41:22 1998 Tim Janik <timj@gtk.org>
* gtk/gtkmenufactory.c: adaptions to use the new accel groups. people
should *really* use GtkItemFactory. this is only for preserving source
compatibility where possible, use of GtkMenuFactory is deprecated as of
now.
* gtk/gtkobject.h (gtk_object_class_add_user_signal): new function
to create user signals of type GTK_RUN_NO_RECURSE. don't know why i
missed this possibility when i added gtk_object_class_add_user_signal
in late january.
* gtk/gtkmain.c (gtk_init): ignore subsequent function calls.
Sun May 31 07:31:09 1998 Tim Janik <timj@gtk.org>
* gtk/gtkaccelgroup.h:
* gtk/gtkaccelgroup.c: new implementation of the accelerator concept.
* gtk/gtkaccellabel.h:
* gtk/gtkaccellabel.c: new widget derived from GtkLabel whitch features
display of the accelerators associated with a certain widget.
* gtk/gtkitemfactory.h:
* gtk/gtkitemfactory.c: new widget, item factory with automatic rc
parsing and accelerator handling.
* gtk/gtkmenu.c (gtk_menu_reposition): new function to care for
positioning a menu.
(gtk_menu_map): removed the allocation code.
(gtk_menu_size_allocate): care for redrawing of children and resize
our widget->window correctly.
(gtk_menu_key_press): feature the new accelerator groups.
* gtk/gtkmenuitem.c (gtk_menu_item_size_allocate): reposition the
submenu if neccessary.
* gtk/gtkmenuitem.c:
* gtk/gtkcheckmenuitem.c:
* gtk/gtkradiomenuitem.c: use GtkAccelLabel in the *_new_with_label()
function variants.
* gdk/gdk.c:
(gdk_keyval_from_name):
(gdk_keyval_name): new functions for keyval<->key-name associations.
(gdk_keyval_to_upper):
(gdk_keyval_to_lower):
(gdk_keyval_is_upper):
(gdk_keyval_is_lower): new functions to check/translate keyvalues with
regards to their cases.
Wed May 27 00:48:10 1998 Tim Janik <timj@gtk.org>
* gtk/gtkwidget.c (gtk_widget_class_path): new function to calculate a
widget's class path.
(gtk_widget_path): new function to calculate a widget's name path.
* gtk/gtkrc.c: newly introduced GtkPatternSpec structures to speed up
pattern matching, features reversed pattern matches.
1998-06-07 06:48:56 +00:00
|
|
|
gtk_window_remove_accel_group (GtkWindow *window,
|
|
|
|
GtkAccelGroup *accel_group)
|
1997-11-24 22:37:52 +00:00
|
|
|
{
|
|
|
|
g_return_if_fail (window != NULL);
|
|
|
|
g_return_if_fail (GTK_IS_WINDOW (window));
|
fixed an assertment.
Sat Jun 6 06:01:24 1998 Tim Janik <timj@gtk.org>
* gtk/gtksignal.c (gtk_signal_emitv): fixed an assertment.
* gtk/makeenums.awk: a script to generate the GtkEnumValue arrays from,
this should eventually be done by gentypeinfo.el somewhen.
* gtk/gtkenumvalues.c: new generated file to hold GtkEnumValue arrays.
* gtk/gtktypeutils.h: new function gtk_enum_values() to retrive all the
enum values of an enum type.
* gtk/gtk.defs:
* gtk/gtkcurve.h:
* gtk/gtkobject.h:
* gtk/gtkprivate.h:
* gtk/gtkwidget.h:
* gtk/gtkenums.h:
brought enum/flags definitions in sync, added a few more enum
definitions for bindings and pattern matching.
* some more macro and GtkType fixups in various places.
* gdk/gdktypes.h (enum): added a new value GDK_AFTER_MASK, which is used
as a key-release modifier for the binding system.
Fri Jun 5 06:06:06 1998 Tim Janik <timj@gtk.org>
* gtk/gtkmenu.h (struct _GtkMenu): removed GList*children, since it
was a stale list pointer that is already present in GtkMenuShell.
* gtk/gtkmenushell.h (struct _GtkMenuShellClass): added a signal
GtkMenuShell::selection_done which is emitted after the menu shell
poped down again and all possible menu items have been activated.
Thu Jun 4 02:20:42 1998 Tim Janik <timj@gtk.org>
* gtk/gtkmenushell.c (gtk_menu_shell_button_release): flush the x-queue
before activation of the menuitem, so the menu is actually taken off the
screen prior to any menu item activation.
* gtk/gtkctree.c (gtk_ctree_get_row_data): allow function invokation
for NULL nodes.
* gtk/gtkwidget.h:
* gtk/gtkwidget.c: new function gtk_widget_stop_accelerator to stop
the emission of the "add-accelerator" signal on a widget. this is
usefull to prevent accelerator installation on certain widgets.
* gtk/gtknotebook.c (gtk_notebook_menu_item_create): keep the menu
labels left justified, by setting their alignment. stop accelerator
installation for the menu items, since we use dynamic menus.
Wed Jun 3 06:41:22 1998 Tim Janik <timj@gtk.org>
* gtk/gtkmenufactory.c: adaptions to use the new accel groups. people
should *really* use GtkItemFactory. this is only for preserving source
compatibility where possible, use of GtkMenuFactory is deprecated as of
now.
* gtk/gtkobject.h (gtk_object_class_add_user_signal): new function
to create user signals of type GTK_RUN_NO_RECURSE. don't know why i
missed this possibility when i added gtk_object_class_add_user_signal
in late january.
* gtk/gtkmain.c (gtk_init): ignore subsequent function calls.
Sun May 31 07:31:09 1998 Tim Janik <timj@gtk.org>
* gtk/gtkaccelgroup.h:
* gtk/gtkaccelgroup.c: new implementation of the accelerator concept.
* gtk/gtkaccellabel.h:
* gtk/gtkaccellabel.c: new widget derived from GtkLabel whitch features
display of the accelerators associated with a certain widget.
* gtk/gtkitemfactory.h:
* gtk/gtkitemfactory.c: new widget, item factory with automatic rc
parsing and accelerator handling.
* gtk/gtkmenu.c (gtk_menu_reposition): new function to care for
positioning a menu.
(gtk_menu_map): removed the allocation code.
(gtk_menu_size_allocate): care for redrawing of children and resize
our widget->window correctly.
(gtk_menu_key_press): feature the new accelerator groups.
* gtk/gtkmenuitem.c (gtk_menu_item_size_allocate): reposition the
submenu if neccessary.
* gtk/gtkmenuitem.c:
* gtk/gtkcheckmenuitem.c:
* gtk/gtkradiomenuitem.c: use GtkAccelLabel in the *_new_with_label()
function variants.
* gdk/gdk.c:
(gdk_keyval_from_name):
(gdk_keyval_name): new functions for keyval<->key-name associations.
(gdk_keyval_to_upper):
(gdk_keyval_to_lower):
(gdk_keyval_is_upper):
(gdk_keyval_is_lower): new functions to check/translate keyvalues with
regards to their cases.
Wed May 27 00:48:10 1998 Tim Janik <timj@gtk.org>
* gtk/gtkwidget.c (gtk_widget_class_path): new function to calculate a
widget's class path.
(gtk_widget_path): new function to calculate a widget's name path.
* gtk/gtkrc.c: newly introduced GtkPatternSpec structures to speed up
pattern matching, features reversed pattern matches.
1998-06-07 06:48:56 +00:00
|
|
|
g_return_if_fail (accel_group != NULL);
|
1997-11-24 22:37:52 +00:00
|
|
|
|
fixed an assertment.
Sat Jun 6 06:01:24 1998 Tim Janik <timj@gtk.org>
* gtk/gtksignal.c (gtk_signal_emitv): fixed an assertment.
* gtk/makeenums.awk: a script to generate the GtkEnumValue arrays from,
this should eventually be done by gentypeinfo.el somewhen.
* gtk/gtkenumvalues.c: new generated file to hold GtkEnumValue arrays.
* gtk/gtktypeutils.h: new function gtk_enum_values() to retrive all the
enum values of an enum type.
* gtk/gtk.defs:
* gtk/gtkcurve.h:
* gtk/gtkobject.h:
* gtk/gtkprivate.h:
* gtk/gtkwidget.h:
* gtk/gtkenums.h:
brought enum/flags definitions in sync, added a few more enum
definitions for bindings and pattern matching.
* some more macro and GtkType fixups in various places.
* gdk/gdktypes.h (enum): added a new value GDK_AFTER_MASK, which is used
as a key-release modifier for the binding system.
Fri Jun 5 06:06:06 1998 Tim Janik <timj@gtk.org>
* gtk/gtkmenu.h (struct _GtkMenu): removed GList*children, since it
was a stale list pointer that is already present in GtkMenuShell.
* gtk/gtkmenushell.h (struct _GtkMenuShellClass): added a signal
GtkMenuShell::selection_done which is emitted after the menu shell
poped down again and all possible menu items have been activated.
Thu Jun 4 02:20:42 1998 Tim Janik <timj@gtk.org>
* gtk/gtkmenushell.c (gtk_menu_shell_button_release): flush the x-queue
before activation of the menuitem, so the menu is actually taken off the
screen prior to any menu item activation.
* gtk/gtkctree.c (gtk_ctree_get_row_data): allow function invokation
for NULL nodes.
* gtk/gtkwidget.h:
* gtk/gtkwidget.c: new function gtk_widget_stop_accelerator to stop
the emission of the "add-accelerator" signal on a widget. this is
usefull to prevent accelerator installation on certain widgets.
* gtk/gtknotebook.c (gtk_notebook_menu_item_create): keep the menu
labels left justified, by setting their alignment. stop accelerator
installation for the menu items, since we use dynamic menus.
Wed Jun 3 06:41:22 1998 Tim Janik <timj@gtk.org>
* gtk/gtkmenufactory.c: adaptions to use the new accel groups. people
should *really* use GtkItemFactory. this is only for preserving source
compatibility where possible, use of GtkMenuFactory is deprecated as of
now.
* gtk/gtkobject.h (gtk_object_class_add_user_signal): new function
to create user signals of type GTK_RUN_NO_RECURSE. don't know why i
missed this possibility when i added gtk_object_class_add_user_signal
in late january.
* gtk/gtkmain.c (gtk_init): ignore subsequent function calls.
Sun May 31 07:31:09 1998 Tim Janik <timj@gtk.org>
* gtk/gtkaccelgroup.h:
* gtk/gtkaccelgroup.c: new implementation of the accelerator concept.
* gtk/gtkaccellabel.h:
* gtk/gtkaccellabel.c: new widget derived from GtkLabel whitch features
display of the accelerators associated with a certain widget.
* gtk/gtkitemfactory.h:
* gtk/gtkitemfactory.c: new widget, item factory with automatic rc
parsing and accelerator handling.
* gtk/gtkmenu.c (gtk_menu_reposition): new function to care for
positioning a menu.
(gtk_menu_map): removed the allocation code.
(gtk_menu_size_allocate): care for redrawing of children and resize
our widget->window correctly.
(gtk_menu_key_press): feature the new accelerator groups.
* gtk/gtkmenuitem.c (gtk_menu_item_size_allocate): reposition the
submenu if neccessary.
* gtk/gtkmenuitem.c:
* gtk/gtkcheckmenuitem.c:
* gtk/gtkradiomenuitem.c: use GtkAccelLabel in the *_new_with_label()
function variants.
* gdk/gdk.c:
(gdk_keyval_from_name):
(gdk_keyval_name): new functions for keyval<->key-name associations.
(gdk_keyval_to_upper):
(gdk_keyval_to_lower):
(gdk_keyval_is_upper):
(gdk_keyval_is_lower): new functions to check/translate keyvalues with
regards to their cases.
Wed May 27 00:48:10 1998 Tim Janik <timj@gtk.org>
* gtk/gtkwidget.c (gtk_widget_class_path): new function to calculate a
widget's class path.
(gtk_widget_path): new function to calculate a widget's name path.
* gtk/gtkrc.c: newly introduced GtkPatternSpec structures to speed up
pattern matching, features reversed pattern matches.
1998-06-07 06:48:56 +00:00
|
|
|
gtk_accel_group_detach (accel_group, GTK_OBJECT (window));
|
1997-11-24 22:37:52 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
void
|
|
|
|
gtk_window_position (GtkWindow *window,
|
|
|
|
GtkWindowPosition position)
|
|
|
|
{
|
|
|
|
g_return_if_fail (window != NULL);
|
|
|
|
g_return_if_fail (GTK_IS_WINDOW (window));
|
|
|
|
|
|
|
|
window->position = position;
|
|
|
|
}
|
|
|
|
|
1998-01-30 23:47:09 +00:00
|
|
|
gint
|
|
|
|
gtk_window_activate_focus (GtkWindow *window)
|
|
|
|
{
|
|
|
|
g_return_val_if_fail (window != NULL, FALSE);
|
|
|
|
g_return_val_if_fail (GTK_IS_WINDOW (window), FALSE);
|
|
|
|
|
|
|
|
if (window->focus_widget)
|
|
|
|
{
|
|
|
|
gtk_widget_activate (window->focus_widget);
|
|
|
|
return TRUE;
|
|
|
|
}
|
|
|
|
|
|
|
|
return FALSE;
|
|
|
|
}
|
|
|
|
|
|
|
|
gint
|
|
|
|
gtk_window_activate_default (GtkWindow *window)
|
|
|
|
{
|
|
|
|
g_return_val_if_fail (window != NULL, FALSE);
|
|
|
|
g_return_val_if_fail (GTK_IS_WINDOW (window), FALSE);
|
|
|
|
|
|
|
|
if (window->default_widget)
|
|
|
|
{
|
|
|
|
gtk_widget_activate (window->default_widget);
|
|
|
|
return TRUE;
|
|
|
|
}
|
|
|
|
|
|
|
|
return FALSE;
|
1997-12-18 02:17:14 +00:00
|
|
|
}
|
|
|
|
|
1998-08-11 19:06:18 +00:00
|
|
|
void
|
|
|
|
gtk_window_set_modal (GtkWindow *window, gboolean modal)
|
|
|
|
{
|
|
|
|
g_return_if_fail (window != NULL);
|
|
|
|
g_return_if_fail (GTK_IS_WINDOW (window));
|
|
|
|
|
|
|
|
/* If the widget was showed already, adjust it's grab state */
|
|
|
|
if (GTK_WIDGET_VISIBLE(GTK_WIDGET(window)))
|
|
|
|
{
|
|
|
|
if (window->modal && !modal)
|
|
|
|
gtk_grab_remove (GTK_WIDGET(window));
|
|
|
|
else if (!window->modal && modal)
|
|
|
|
gtk_grab_add (GTK_WIDGET(window));
|
|
|
|
}
|
|
|
|
|
|
|
|
window->modal = modal;
|
|
|
|
}
|
|
|
|
|
1998-06-24 06:25:14 +00:00
|
|
|
static void
|
|
|
|
gtk_window_shutdown (GtkObject *object)
|
|
|
|
{
|
|
|
|
GtkWindow *window;
|
|
|
|
|
|
|
|
g_return_if_fail (object != NULL);
|
|
|
|
g_return_if_fail (GTK_IS_WINDOW (object));
|
|
|
|
|
|
|
|
window = GTK_WINDOW (object);
|
|
|
|
|
|
|
|
gtk_window_set_focus (window, NULL);
|
|
|
|
gtk_window_set_default (window, NULL);
|
|
|
|
|
|
|
|
GTK_OBJECT_CLASS (parent_class)->shutdown (object);
|
|
|
|
}
|
|
|
|
|
GTK_RESIZE_NEEDED is a private flag now.
Mon Feb 2 04:15:08 1998 Tim Janik <timj@gimp.org>
* gtk/gtkcontainer.h:
* gtk/gtkcontainer.c: GTK_RESIZE_NEEDED is a private flag now.
(gtk_container_register_toplevel): new function.
(gtk_container_unregister_toplevel): new function.
* gtk/gtkmain.c: GTK_LEAVE_PENDING is a private flag now.
* gtk/gtkmenu.c: call gtk_container_register_toplevel in
gtk_menu_class_init instead of this dirty gtk_widget_set_parent(,NULL)
hack. new default handler gtk_menu_destroy for calling
gtk_container_unregister_toplevel. removed GTK_ANCHORED, GTK_UNMAPPED.
* gtk/gtkobject.h: macro cleanups, added GTK_DESTROYED flag.
* gtk/gtkobject.c: only emit DESTROY signal if !GTK_OBJECT_DESTROYED
(object).
* gtk/gtkprivate.h: new file that will not be automatically included.
it holds the private flags for GtkWidget along with it's SET/UNSET
and examination macros.
* gtk/gtkwidget.c: private flags: GTK_RESIZE_NEEDED, GTK_REDRAW_PENDING,
GTK_RESIZE_PENDING, GTK_IN_REPARENT, GTK_USER_STYLE. GTK_ANCHORED is
replaced by GTK_TOPLEVEL. added missing UNSET for GTK_IN_REPARENT.
removed the gtk_widget_set_parent(, NULL) hack for toplevels.
upon destroy free memory for widgets with GTK_WIDGET_HAS_SHAPE_MASK.
* gtk/gtkwidget.h: split up the widget flags into a public and a private
portion. added an extra field private_flags to GtkWidget without making
it bigger by using an alignment gap of 16 bit. macro cleanups.
* gtk/gtkwindow.c: removed GTK_ANCHORED. new function gtk_window_destroy
for calling gtk_container_unregister_toplevel. removed the
gtk_widget_set_parent(,NULL), call gtk_container_register_toplevel
instead. remove GTK_UNMAPPED. GTK_RESIZE_NEEDED is private now.
* gtk/gtksignal.c (gtk_signal_disconnect): removed a bug on
removal that cut off the handler list -> living_objects == 0
with testgtk. made some warnings more descriptive.
new function gtk_signal_connect_object_while_alive, which
will automatically destroy the connection once one of the objects
is destroyed. didn't include this before removal of the above
mentioned bug.
* reflected refcounting revolution in ChangeLog
1998-02-02 04:54:25 +00:00
|
|
|
static void
|
|
|
|
gtk_window_destroy (GtkObject *object)
|
|
|
|
{
|
|
|
|
g_return_if_fail (object != NULL);
|
|
|
|
g_return_if_fail (GTK_IS_WINDOW (object));
|
|
|
|
|
|
|
|
gtk_container_unregister_toplevel (GTK_CONTAINER (object));
|
|
|
|
|
1998-06-24 06:25:14 +00:00
|
|
|
GTK_OBJECT_CLASS (parent_class)->destroy (object);
|
GTK_RESIZE_NEEDED is a private flag now.
Mon Feb 2 04:15:08 1998 Tim Janik <timj@gimp.org>
* gtk/gtkcontainer.h:
* gtk/gtkcontainer.c: GTK_RESIZE_NEEDED is a private flag now.
(gtk_container_register_toplevel): new function.
(gtk_container_unregister_toplevel): new function.
* gtk/gtkmain.c: GTK_LEAVE_PENDING is a private flag now.
* gtk/gtkmenu.c: call gtk_container_register_toplevel in
gtk_menu_class_init instead of this dirty gtk_widget_set_parent(,NULL)
hack. new default handler gtk_menu_destroy for calling
gtk_container_unregister_toplevel. removed GTK_ANCHORED, GTK_UNMAPPED.
* gtk/gtkobject.h: macro cleanups, added GTK_DESTROYED flag.
* gtk/gtkobject.c: only emit DESTROY signal if !GTK_OBJECT_DESTROYED
(object).
* gtk/gtkprivate.h: new file that will not be automatically included.
it holds the private flags for GtkWidget along with it's SET/UNSET
and examination macros.
* gtk/gtkwidget.c: private flags: GTK_RESIZE_NEEDED, GTK_REDRAW_PENDING,
GTK_RESIZE_PENDING, GTK_IN_REPARENT, GTK_USER_STYLE. GTK_ANCHORED is
replaced by GTK_TOPLEVEL. added missing UNSET for GTK_IN_REPARENT.
removed the gtk_widget_set_parent(, NULL) hack for toplevels.
upon destroy free memory for widgets with GTK_WIDGET_HAS_SHAPE_MASK.
* gtk/gtkwidget.h: split up the widget flags into a public and a private
portion. added an extra field private_flags to GtkWidget without making
it bigger by using an alignment gap of 16 bit. macro cleanups.
* gtk/gtkwindow.c: removed GTK_ANCHORED. new function gtk_window_destroy
for calling gtk_container_unregister_toplevel. removed the
gtk_widget_set_parent(,NULL), call gtk_container_register_toplevel
instead. remove GTK_UNMAPPED. GTK_RESIZE_NEEDED is private now.
* gtk/gtksignal.c (gtk_signal_disconnect): removed a bug on
removal that cut off the handler list -> living_objects == 0
with testgtk. made some warnings more descriptive.
new function gtk_signal_connect_object_while_alive, which
will automatically destroy the connection once one of the objects
is destroyed. didn't include this before removal of the above
mentioned bug.
* reflected refcounting revolution in ChangeLog
1998-02-02 04:54:25 +00:00
|
|
|
}
|
|
|
|
|
1997-11-24 22:37:52 +00:00
|
|
|
static void
|
1998-01-30 23:47:09 +00:00
|
|
|
gtk_window_finalize (GtkObject *object)
|
1997-11-24 22:37:52 +00:00
|
|
|
{
|
|
|
|
GtkWindow *window;
|
|
|
|
|
|
|
|
g_return_if_fail (object != NULL);
|
|
|
|
g_return_if_fail (GTK_IS_WINDOW (object));
|
|
|
|
|
|
|
|
window = GTK_WINDOW (object);
|
|
|
|
g_free (window->title);
|
1998-02-23 11:14:27 +00:00
|
|
|
g_free (window->wmclass_name);
|
|
|
|
g_free (window->wmclass_class);
|
1997-11-24 22:37:52 +00:00
|
|
|
|
1998-01-30 23:47:09 +00:00
|
|
|
GTK_OBJECT_CLASS(parent_class)->finalize (object);
|
1997-11-24 22:37:52 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
static void
|
|
|
|
gtk_window_show (GtkWidget *widget)
|
|
|
|
{
|
|
|
|
g_return_if_fail (widget != NULL);
|
|
|
|
g_return_if_fail (GTK_IS_WINDOW (widget));
|
|
|
|
|
|
|
|
GTK_WIDGET_SET_FLAGS (widget, GTK_VISIBLE);
|
1998-06-19 01:26:24 +00:00
|
|
|
gtk_container_check_resize (GTK_CONTAINER (widget));
|
1997-11-24 22:37:52 +00:00
|
|
|
gtk_widget_map (widget);
|
1998-08-11 19:06:18 +00:00
|
|
|
|
|
|
|
if (GTK_WINDOW(widget)->modal)
|
|
|
|
gtk_grab_add(widget);
|
|
|
|
|
1997-11-24 22:37:52 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
static void
|
|
|
|
gtk_window_hide (GtkWidget *widget)
|
|
|
|
{
|
|
|
|
g_return_if_fail (widget != NULL);
|
|
|
|
g_return_if_fail (GTK_IS_WINDOW (widget));
|
|
|
|
|
|
|
|
GTK_WIDGET_UNSET_FLAGS (widget, GTK_VISIBLE);
|
|
|
|
gtk_widget_unmap (widget);
|
1998-08-11 19:06:18 +00:00
|
|
|
|
|
|
|
if (GTK_WINDOW(widget)->modal)
|
|
|
|
gtk_grab_remove(widget);
|
|
|
|
|
1997-11-24 22:37:52 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
static void
|
|
|
|
gtk_window_map (GtkWidget *widget)
|
|
|
|
{
|
|
|
|
GtkWindow *window;
|
|
|
|
|
|
|
|
g_return_if_fail (widget != NULL);
|
|
|
|
g_return_if_fail (GTK_IS_WINDOW (widget));
|
|
|
|
|
|
|
|
GTK_WIDGET_SET_FLAGS (widget, GTK_MAPPED);
|
|
|
|
|
|
|
|
window = GTK_WINDOW (widget);
|
|
|
|
|
|
|
|
if (window->bin.child &&
|
|
|
|
GTK_WIDGET_VISIBLE (window->bin.child) &&
|
|
|
|
!GTK_WIDGET_MAPPED (window->bin.child))
|
|
|
|
gtk_widget_map (window->bin.child);
|
|
|
|
|
1998-04-07 04:17:27 +00:00
|
|
|
gtk_window_set_hints (widget, &widget->requisition);
|
1997-11-24 22:37:52 +00:00
|
|
|
gdk_window_show (widget->window);
|
|
|
|
}
|
|
|
|
|
|
|
|
static void
|
|
|
|
gtk_window_unmap (GtkWidget *widget)
|
|
|
|
{
|
|
|
|
GtkWindow *window;
|
|
|
|
|
|
|
|
g_return_if_fail (widget != NULL);
|
|
|
|
g_return_if_fail (GTK_IS_WINDOW (widget));
|
|
|
|
|
|
|
|
GTK_WIDGET_UNSET_FLAGS (widget, GTK_MAPPED);
|
|
|
|
gdk_window_hide (widget->window);
|
|
|
|
|
|
|
|
window = GTK_WINDOW (widget);
|
|
|
|
window->use_uposition = TRUE;
|
|
|
|
}
|
|
|
|
|
|
|
|
static void
|
|
|
|
gtk_window_realize (GtkWidget *widget)
|
|
|
|
{
|
|
|
|
GtkWindow *window;
|
|
|
|
GdkWindowAttr attributes;
|
|
|
|
gint attributes_mask;
|
|
|
|
|
|
|
|
g_return_if_fail (widget != NULL);
|
|
|
|
g_return_if_fail (GTK_IS_WINDOW (widget));
|
|
|
|
|
|
|
|
GTK_WIDGET_SET_FLAGS (widget, GTK_REALIZED);
|
|
|
|
window = GTK_WINDOW (widget);
|
|
|
|
|
|
|
|
switch (window->type)
|
|
|
|
{
|
|
|
|
case GTK_WINDOW_TOPLEVEL:
|
|
|
|
attributes.window_type = GDK_WINDOW_TOPLEVEL;
|
|
|
|
break;
|
|
|
|
case GTK_WINDOW_DIALOG:
|
|
|
|
attributes.window_type = GDK_WINDOW_DIALOG;
|
|
|
|
break;
|
|
|
|
case GTK_WINDOW_POPUP:
|
|
|
|
attributes.window_type = GDK_WINDOW_TEMP;
|
|
|
|
break;
|
|
|
|
}
|
|
|
|
|
|
|
|
attributes.title = window->title;
|
|
|
|
attributes.wmclass_name = window->wmclass_name;
|
|
|
|
attributes.wmclass_class = window->wmclass_class;
|
|
|
|
attributes.width = widget->allocation.width;
|
|
|
|
attributes.height = widget->allocation.height;
|
|
|
|
attributes.wclass = GDK_INPUT_OUTPUT;
|
|
|
|
attributes.visual = gtk_widget_get_visual (widget);
|
|
|
|
attributes.colormap = gtk_widget_get_colormap (widget);
|
|
|
|
attributes.event_mask = gtk_widget_get_events (widget);
|
|
|
|
attributes.event_mask |= (GDK_EXPOSURE_MASK |
|
|
|
|
GDK_KEY_PRESS_MASK |
|
|
|
|
GDK_ENTER_NOTIFY_MASK |
|
|
|
|
GDK_LEAVE_NOTIFY_MASK |
|
|
|
|
GDK_FOCUS_CHANGE_MASK |
|
|
|
|
GDK_STRUCTURE_MASK);
|
|
|
|
|
|
|
|
attributes_mask = GDK_WA_VISUAL | GDK_WA_COLORMAP;
|
|
|
|
attributes_mask |= (window->title ? GDK_WA_TITLE : 0);
|
|
|
|
attributes_mask |= (window->wmclass_name ? GDK_WA_WMCLASS : 0);
|
|
|
|
|
|
|
|
widget->window = gdk_window_new (NULL, &attributes, attributes_mask);
|
|
|
|
gdk_window_set_user_data (widget->window, window);
|
|
|
|
|
|
|
|
widget->style = gtk_style_attach (widget->style, widget->window);
|
|
|
|
gtk_style_set_background (widget->style, widget->window, GTK_STATE_NORMAL);
|
|
|
|
}
|
|
|
|
|
|
|
|
static void
|
|
|
|
gtk_window_size_request (GtkWidget *widget,
|
|
|
|
GtkRequisition *requisition)
|
|
|
|
{
|
|
|
|
GtkWindow *window;
|
|
|
|
|
|
|
|
g_return_if_fail (widget != NULL);
|
|
|
|
g_return_if_fail (GTK_IS_WINDOW (widget));
|
|
|
|
g_return_if_fail (requisition != NULL);
|
|
|
|
|
|
|
|
window = GTK_WINDOW (widget);
|
|
|
|
|
|
|
|
if (window->bin.child)
|
|
|
|
{
|
|
|
|
requisition->width = GTK_CONTAINER (window)->border_width * 2;
|
|
|
|
requisition->height = GTK_CONTAINER (window)->border_width * 2;
|
|
|
|
|
|
|
|
gtk_widget_size_request (window->bin.child, &window->bin.child->requisition);
|
|
|
|
|
|
|
|
requisition->width += window->bin.child->requisition.width;
|
|
|
|
requisition->height += window->bin.child->requisition.height;
|
|
|
|
}
|
|
|
|
else
|
|
|
|
{
|
|
|
|
if (!GTK_WIDGET_VISIBLE (window))
|
1998-06-19 01:26:24 +00:00
|
|
|
GTK_CONTAINER (window)->need_resize = TRUE;
|
1997-11-24 22:37:52 +00:00
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
static void
|
|
|
|
gtk_window_size_allocate (GtkWidget *widget,
|
|
|
|
GtkAllocation *allocation)
|
|
|
|
{
|
|
|
|
GtkWindow *window;
|
|
|
|
GtkAllocation child_allocation;
|
|
|
|
|
|
|
|
g_return_if_fail (widget != NULL);
|
|
|
|
g_return_if_fail (GTK_IS_WINDOW (widget));
|
|
|
|
g_return_if_fail (allocation != NULL);
|
|
|
|
|
|
|
|
window = GTK_WINDOW (widget);
|
|
|
|
widget->allocation = *allocation;
|
|
|
|
|
|
|
|
if (window->bin.child && GTK_WIDGET_VISIBLE (window->bin.child))
|
|
|
|
{
|
|
|
|
child_allocation.x = GTK_CONTAINER (window)->border_width;
|
|
|
|
child_allocation.y = GTK_CONTAINER (window)->border_width;
|
|
|
|
child_allocation.width = allocation->width - child_allocation.x * 2;
|
|
|
|
child_allocation.height = allocation->height - child_allocation.y * 2;
|
|
|
|
|
|
|
|
gtk_widget_size_allocate (window->bin.child, &child_allocation);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
static gint
|
|
|
|
gtk_window_expose_event (GtkWidget *widget,
|
|
|
|
GdkEventExpose *event)
|
|
|
|
{
|
|
|
|
g_return_val_if_fail (widget != NULL, FALSE);
|
|
|
|
g_return_val_if_fail (GTK_IS_WINDOW (widget), FALSE);
|
|
|
|
g_return_val_if_fail (event != NULL, FALSE);
|
|
|
|
|
|
|
|
if (GTK_WIDGET_DRAWABLE (widget))
|
|
|
|
if (GTK_WIDGET_CLASS (parent_class)->expose_event)
|
|
|
|
return (* GTK_WIDGET_CLASS (parent_class)->expose_event) (widget, event);
|
1998-02-24 13:57:03 +00:00
|
|
|
|
1997-11-24 22:37:52 +00:00
|
|
|
return FALSE;
|
|
|
|
}
|
|
|
|
|
|
|
|
static gint
|
|
|
|
gtk_window_configure_event (GtkWidget *widget,
|
|
|
|
GdkEventConfigure *event)
|
|
|
|
{
|
|
|
|
GtkWindow *window;
|
|
|
|
GtkAllocation allocation;
|
1998-02-24 13:57:03 +00:00
|
|
|
|
1997-11-24 22:37:52 +00:00
|
|
|
g_return_val_if_fail (widget != NULL, FALSE);
|
|
|
|
g_return_val_if_fail (GTK_IS_WINDOW (widget), FALSE);
|
|
|
|
g_return_val_if_fail (event != NULL, FALSE);
|
1998-02-24 13:57:03 +00:00
|
|
|
|
1998-03-15 07:58:10 +00:00
|
|
|
window = GTK_WINDOW (widget);
|
|
|
|
|
1998-02-23 20:54:07 +00:00
|
|
|
/* If the window was merely moved, do nothing */
|
|
|
|
if ((widget->allocation.width == event->width) &&
|
1998-03-14 05:15:16 +00:00
|
|
|
(widget->allocation.height == event->height) &&
|
|
|
|
(window->resize_count == 0))
|
1998-02-23 20:54:07 +00:00
|
|
|
return FALSE;
|
1998-02-24 13:57:03 +00:00
|
|
|
|
1997-11-24 22:37:52 +00:00
|
|
|
window->handling_resize = TRUE;
|
1998-02-24 13:57:03 +00:00
|
|
|
|
1997-11-24 22:37:52 +00:00
|
|
|
allocation.x = 0;
|
|
|
|
allocation.y = 0;
|
|
|
|
allocation.width = event->width;
|
|
|
|
allocation.height = event->height;
|
1998-02-24 13:57:03 +00:00
|
|
|
|
1997-11-24 22:37:52 +00:00
|
|
|
gtk_widget_size_allocate (widget, &allocation);
|
1998-02-24 13:57:03 +00:00
|
|
|
|
1997-11-24 22:37:52 +00:00
|
|
|
if (window->bin.child &&
|
|
|
|
GTK_WIDGET_VISIBLE (window->bin.child) &&
|
|
|
|
!GTK_WIDGET_MAPPED (window->bin.child))
|
|
|
|
gtk_widget_map (window->bin.child);
|
1998-02-24 13:57:03 +00:00
|
|
|
|
1998-02-19 07:18:42 +00:00
|
|
|
if (window->resize_count > 0)
|
1998-04-03 23:17:16 +00:00
|
|
|
window->resize_count -= 1;
|
1998-02-14 05:37:53 +00:00
|
|
|
|
1997-11-24 22:37:52 +00:00
|
|
|
window->handling_resize = FALSE;
|
1998-02-14 05:37:53 +00:00
|
|
|
|
1997-11-24 22:37:52 +00:00
|
|
|
return FALSE;
|
|
|
|
}
|
|
|
|
|
|
|
|
static gint
|
|
|
|
gtk_window_key_press_event (GtkWidget *widget,
|
|
|
|
GdkEventKey *event)
|
|
|
|
{
|
|
|
|
GtkWindow *window;
|
|
|
|
GtkDirectionType direction = 0;
|
fixed an assertment.
Sat Jun 6 06:01:24 1998 Tim Janik <timj@gtk.org>
* gtk/gtksignal.c (gtk_signal_emitv): fixed an assertment.
* gtk/makeenums.awk: a script to generate the GtkEnumValue arrays from,
this should eventually be done by gentypeinfo.el somewhen.
* gtk/gtkenumvalues.c: new generated file to hold GtkEnumValue arrays.
* gtk/gtktypeutils.h: new function gtk_enum_values() to retrive all the
enum values of an enum type.
* gtk/gtk.defs:
* gtk/gtkcurve.h:
* gtk/gtkobject.h:
* gtk/gtkprivate.h:
* gtk/gtkwidget.h:
* gtk/gtkenums.h:
brought enum/flags definitions in sync, added a few more enum
definitions for bindings and pattern matching.
* some more macro and GtkType fixups in various places.
* gdk/gdktypes.h (enum): added a new value GDK_AFTER_MASK, which is used
as a key-release modifier for the binding system.
Fri Jun 5 06:06:06 1998 Tim Janik <timj@gtk.org>
* gtk/gtkmenu.h (struct _GtkMenu): removed GList*children, since it
was a stale list pointer that is already present in GtkMenuShell.
* gtk/gtkmenushell.h (struct _GtkMenuShellClass): added a signal
GtkMenuShell::selection_done which is emitted after the menu shell
poped down again and all possible menu items have been activated.
Thu Jun 4 02:20:42 1998 Tim Janik <timj@gtk.org>
* gtk/gtkmenushell.c (gtk_menu_shell_button_release): flush the x-queue
before activation of the menuitem, so the menu is actually taken off the
screen prior to any menu item activation.
* gtk/gtkctree.c (gtk_ctree_get_row_data): allow function invokation
for NULL nodes.
* gtk/gtkwidget.h:
* gtk/gtkwidget.c: new function gtk_widget_stop_accelerator to stop
the emission of the "add-accelerator" signal on a widget. this is
usefull to prevent accelerator installation on certain widgets.
* gtk/gtknotebook.c (gtk_notebook_menu_item_create): keep the menu
labels left justified, by setting their alignment. stop accelerator
installation for the menu items, since we use dynamic menus.
Wed Jun 3 06:41:22 1998 Tim Janik <timj@gtk.org>
* gtk/gtkmenufactory.c: adaptions to use the new accel groups. people
should *really* use GtkItemFactory. this is only for preserving source
compatibility where possible, use of GtkMenuFactory is deprecated as of
now.
* gtk/gtkobject.h (gtk_object_class_add_user_signal): new function
to create user signals of type GTK_RUN_NO_RECURSE. don't know why i
missed this possibility when i added gtk_object_class_add_user_signal
in late january.
* gtk/gtkmain.c (gtk_init): ignore subsequent function calls.
Sun May 31 07:31:09 1998 Tim Janik <timj@gtk.org>
* gtk/gtkaccelgroup.h:
* gtk/gtkaccelgroup.c: new implementation of the accelerator concept.
* gtk/gtkaccellabel.h:
* gtk/gtkaccellabel.c: new widget derived from GtkLabel whitch features
display of the accelerators associated with a certain widget.
* gtk/gtkitemfactory.h:
* gtk/gtkitemfactory.c: new widget, item factory with automatic rc
parsing and accelerator handling.
* gtk/gtkmenu.c (gtk_menu_reposition): new function to care for
positioning a menu.
(gtk_menu_map): removed the allocation code.
(gtk_menu_size_allocate): care for redrawing of children and resize
our widget->window correctly.
(gtk_menu_key_press): feature the new accelerator groups.
* gtk/gtkmenuitem.c (gtk_menu_item_size_allocate): reposition the
submenu if neccessary.
* gtk/gtkmenuitem.c:
* gtk/gtkcheckmenuitem.c:
* gtk/gtkradiomenuitem.c: use GtkAccelLabel in the *_new_with_label()
function variants.
* gdk/gdk.c:
(gdk_keyval_from_name):
(gdk_keyval_name): new functions for keyval<->key-name associations.
(gdk_keyval_to_upper):
(gdk_keyval_to_lower):
(gdk_keyval_is_upper):
(gdk_keyval_is_lower): new functions to check/translate keyvalues with
regards to their cases.
Wed May 27 00:48:10 1998 Tim Janik <timj@gtk.org>
* gtk/gtkwidget.c (gtk_widget_class_path): new function to calculate a
widget's class path.
(gtk_widget_path): new function to calculate a widget's name path.
* gtk/gtkrc.c: newly introduced GtkPatternSpec structures to speed up
pattern matching, features reversed pattern matches.
1998-06-07 06:48:56 +00:00
|
|
|
gboolean handled;
|
1997-11-24 22:37:52 +00:00
|
|
|
|
|
|
|
g_return_val_if_fail (widget != NULL, FALSE);
|
|
|
|
g_return_val_if_fail (GTK_IS_WINDOW (widget), FALSE);
|
|
|
|
g_return_val_if_fail (event != NULL, FALSE);
|
|
|
|
|
|
|
|
window = GTK_WINDOW (widget);
|
|
|
|
|
fixed an assertment.
Sat Jun 6 06:01:24 1998 Tim Janik <timj@gtk.org>
* gtk/gtksignal.c (gtk_signal_emitv): fixed an assertment.
* gtk/makeenums.awk: a script to generate the GtkEnumValue arrays from,
this should eventually be done by gentypeinfo.el somewhen.
* gtk/gtkenumvalues.c: new generated file to hold GtkEnumValue arrays.
* gtk/gtktypeutils.h: new function gtk_enum_values() to retrive all the
enum values of an enum type.
* gtk/gtk.defs:
* gtk/gtkcurve.h:
* gtk/gtkobject.h:
* gtk/gtkprivate.h:
* gtk/gtkwidget.h:
* gtk/gtkenums.h:
brought enum/flags definitions in sync, added a few more enum
definitions for bindings and pattern matching.
* some more macro and GtkType fixups in various places.
* gdk/gdktypes.h (enum): added a new value GDK_AFTER_MASK, which is used
as a key-release modifier for the binding system.
Fri Jun 5 06:06:06 1998 Tim Janik <timj@gtk.org>
* gtk/gtkmenu.h (struct _GtkMenu): removed GList*children, since it
was a stale list pointer that is already present in GtkMenuShell.
* gtk/gtkmenushell.h (struct _GtkMenuShellClass): added a signal
GtkMenuShell::selection_done which is emitted after the menu shell
poped down again and all possible menu items have been activated.
Thu Jun 4 02:20:42 1998 Tim Janik <timj@gtk.org>
* gtk/gtkmenushell.c (gtk_menu_shell_button_release): flush the x-queue
before activation of the menuitem, so the menu is actually taken off the
screen prior to any menu item activation.
* gtk/gtkctree.c (gtk_ctree_get_row_data): allow function invokation
for NULL nodes.
* gtk/gtkwidget.h:
* gtk/gtkwidget.c: new function gtk_widget_stop_accelerator to stop
the emission of the "add-accelerator" signal on a widget. this is
usefull to prevent accelerator installation on certain widgets.
* gtk/gtknotebook.c (gtk_notebook_menu_item_create): keep the menu
labels left justified, by setting their alignment. stop accelerator
installation for the menu items, since we use dynamic menus.
Wed Jun 3 06:41:22 1998 Tim Janik <timj@gtk.org>
* gtk/gtkmenufactory.c: adaptions to use the new accel groups. people
should *really* use GtkItemFactory. this is only for preserving source
compatibility where possible, use of GtkMenuFactory is deprecated as of
now.
* gtk/gtkobject.h (gtk_object_class_add_user_signal): new function
to create user signals of type GTK_RUN_NO_RECURSE. don't know why i
missed this possibility when i added gtk_object_class_add_user_signal
in late january.
* gtk/gtkmain.c (gtk_init): ignore subsequent function calls.
Sun May 31 07:31:09 1998 Tim Janik <timj@gtk.org>
* gtk/gtkaccelgroup.h:
* gtk/gtkaccelgroup.c: new implementation of the accelerator concept.
* gtk/gtkaccellabel.h:
* gtk/gtkaccellabel.c: new widget derived from GtkLabel whitch features
display of the accelerators associated with a certain widget.
* gtk/gtkitemfactory.h:
* gtk/gtkitemfactory.c: new widget, item factory with automatic rc
parsing and accelerator handling.
* gtk/gtkmenu.c (gtk_menu_reposition): new function to care for
positioning a menu.
(gtk_menu_map): removed the allocation code.
(gtk_menu_size_allocate): care for redrawing of children and resize
our widget->window correctly.
(gtk_menu_key_press): feature the new accelerator groups.
* gtk/gtkmenuitem.c (gtk_menu_item_size_allocate): reposition the
submenu if neccessary.
* gtk/gtkmenuitem.c:
* gtk/gtkcheckmenuitem.c:
* gtk/gtkradiomenuitem.c: use GtkAccelLabel in the *_new_with_label()
function variants.
* gdk/gdk.c:
(gdk_keyval_from_name):
(gdk_keyval_name): new functions for keyval<->key-name associations.
(gdk_keyval_to_upper):
(gdk_keyval_to_lower):
(gdk_keyval_is_upper):
(gdk_keyval_is_lower): new functions to check/translate keyvalues with
regards to their cases.
Wed May 27 00:48:10 1998 Tim Janik <timj@gtk.org>
* gtk/gtkwidget.c (gtk_widget_class_path): new function to calculate a
widget's class path.
(gtk_widget_path): new function to calculate a widget's name path.
* gtk/gtkrc.c: newly introduced GtkPatternSpec structures to speed up
pattern matching, features reversed pattern matches.
1998-06-07 06:48:56 +00:00
|
|
|
handled = FALSE;
|
|
|
|
|
1997-11-24 22:37:52 +00:00
|
|
|
if (window->focus_widget)
|
fixed an assertment.
Sat Jun 6 06:01:24 1998 Tim Janik <timj@gtk.org>
* gtk/gtksignal.c (gtk_signal_emitv): fixed an assertment.
* gtk/makeenums.awk: a script to generate the GtkEnumValue arrays from,
this should eventually be done by gentypeinfo.el somewhen.
* gtk/gtkenumvalues.c: new generated file to hold GtkEnumValue arrays.
* gtk/gtktypeutils.h: new function gtk_enum_values() to retrive all the
enum values of an enum type.
* gtk/gtk.defs:
* gtk/gtkcurve.h:
* gtk/gtkobject.h:
* gtk/gtkprivate.h:
* gtk/gtkwidget.h:
* gtk/gtkenums.h:
brought enum/flags definitions in sync, added a few more enum
definitions for bindings and pattern matching.
* some more macro and GtkType fixups in various places.
* gdk/gdktypes.h (enum): added a new value GDK_AFTER_MASK, which is used
as a key-release modifier for the binding system.
Fri Jun 5 06:06:06 1998 Tim Janik <timj@gtk.org>
* gtk/gtkmenu.h (struct _GtkMenu): removed GList*children, since it
was a stale list pointer that is already present in GtkMenuShell.
* gtk/gtkmenushell.h (struct _GtkMenuShellClass): added a signal
GtkMenuShell::selection_done which is emitted after the menu shell
poped down again and all possible menu items have been activated.
Thu Jun 4 02:20:42 1998 Tim Janik <timj@gtk.org>
* gtk/gtkmenushell.c (gtk_menu_shell_button_release): flush the x-queue
before activation of the menuitem, so the menu is actually taken off the
screen prior to any menu item activation.
* gtk/gtkctree.c (gtk_ctree_get_row_data): allow function invokation
for NULL nodes.
* gtk/gtkwidget.h:
* gtk/gtkwidget.c: new function gtk_widget_stop_accelerator to stop
the emission of the "add-accelerator" signal on a widget. this is
usefull to prevent accelerator installation on certain widgets.
* gtk/gtknotebook.c (gtk_notebook_menu_item_create): keep the menu
labels left justified, by setting their alignment. stop accelerator
installation for the menu items, since we use dynamic menus.
Wed Jun 3 06:41:22 1998 Tim Janik <timj@gtk.org>
* gtk/gtkmenufactory.c: adaptions to use the new accel groups. people
should *really* use GtkItemFactory. this is only for preserving source
compatibility where possible, use of GtkMenuFactory is deprecated as of
now.
* gtk/gtkobject.h (gtk_object_class_add_user_signal): new function
to create user signals of type GTK_RUN_NO_RECURSE. don't know why i
missed this possibility when i added gtk_object_class_add_user_signal
in late january.
* gtk/gtkmain.c (gtk_init): ignore subsequent function calls.
Sun May 31 07:31:09 1998 Tim Janik <timj@gtk.org>
* gtk/gtkaccelgroup.h:
* gtk/gtkaccelgroup.c: new implementation of the accelerator concept.
* gtk/gtkaccellabel.h:
* gtk/gtkaccellabel.c: new widget derived from GtkLabel whitch features
display of the accelerators associated with a certain widget.
* gtk/gtkitemfactory.h:
* gtk/gtkitemfactory.c: new widget, item factory with automatic rc
parsing and accelerator handling.
* gtk/gtkmenu.c (gtk_menu_reposition): new function to care for
positioning a menu.
(gtk_menu_map): removed the allocation code.
(gtk_menu_size_allocate): care for redrawing of children and resize
our widget->window correctly.
(gtk_menu_key_press): feature the new accelerator groups.
* gtk/gtkmenuitem.c (gtk_menu_item_size_allocate): reposition the
submenu if neccessary.
* gtk/gtkmenuitem.c:
* gtk/gtkcheckmenuitem.c:
* gtk/gtkradiomenuitem.c: use GtkAccelLabel in the *_new_with_label()
function variants.
* gdk/gdk.c:
(gdk_keyval_from_name):
(gdk_keyval_name): new functions for keyval<->key-name associations.
(gdk_keyval_to_upper):
(gdk_keyval_to_lower):
(gdk_keyval_is_upper):
(gdk_keyval_is_lower): new functions to check/translate keyvalues with
regards to their cases.
Wed May 27 00:48:10 1998 Tim Janik <timj@gtk.org>
* gtk/gtkwidget.c (gtk_widget_class_path): new function to calculate a
widget's class path.
(gtk_widget_path): new function to calculate a widget's name path.
* gtk/gtkrc.c: newly introduced GtkPatternSpec structures to speed up
pattern matching, features reversed pattern matches.
1998-06-07 06:48:56 +00:00
|
|
|
{
|
|
|
|
handled = gtk_widget_event (window->focus_widget, (GdkEvent*) event);
|
|
|
|
}
|
|
|
|
|
|
|
|
if (!handled)
|
|
|
|
handled = gtk_accel_groups_activate (GTK_OBJECT (window), event->keyval, event->state);
|
1997-11-24 22:37:52 +00:00
|
|
|
|
fixed an assertment.
Sat Jun 6 06:01:24 1998 Tim Janik <timj@gtk.org>
* gtk/gtksignal.c (gtk_signal_emitv): fixed an assertment.
* gtk/makeenums.awk: a script to generate the GtkEnumValue arrays from,
this should eventually be done by gentypeinfo.el somewhen.
* gtk/gtkenumvalues.c: new generated file to hold GtkEnumValue arrays.
* gtk/gtktypeutils.h: new function gtk_enum_values() to retrive all the
enum values of an enum type.
* gtk/gtk.defs:
* gtk/gtkcurve.h:
* gtk/gtkobject.h:
* gtk/gtkprivate.h:
* gtk/gtkwidget.h:
* gtk/gtkenums.h:
brought enum/flags definitions in sync, added a few more enum
definitions for bindings and pattern matching.
* some more macro and GtkType fixups in various places.
* gdk/gdktypes.h (enum): added a new value GDK_AFTER_MASK, which is used
as a key-release modifier for the binding system.
Fri Jun 5 06:06:06 1998 Tim Janik <timj@gtk.org>
* gtk/gtkmenu.h (struct _GtkMenu): removed GList*children, since it
was a stale list pointer that is already present in GtkMenuShell.
* gtk/gtkmenushell.h (struct _GtkMenuShellClass): added a signal
GtkMenuShell::selection_done which is emitted after the menu shell
poped down again and all possible menu items have been activated.
Thu Jun 4 02:20:42 1998 Tim Janik <timj@gtk.org>
* gtk/gtkmenushell.c (gtk_menu_shell_button_release): flush the x-queue
before activation of the menuitem, so the menu is actually taken off the
screen prior to any menu item activation.
* gtk/gtkctree.c (gtk_ctree_get_row_data): allow function invokation
for NULL nodes.
* gtk/gtkwidget.h:
* gtk/gtkwidget.c: new function gtk_widget_stop_accelerator to stop
the emission of the "add-accelerator" signal on a widget. this is
usefull to prevent accelerator installation on certain widgets.
* gtk/gtknotebook.c (gtk_notebook_menu_item_create): keep the menu
labels left justified, by setting their alignment. stop accelerator
installation for the menu items, since we use dynamic menus.
Wed Jun 3 06:41:22 1998 Tim Janik <timj@gtk.org>
* gtk/gtkmenufactory.c: adaptions to use the new accel groups. people
should *really* use GtkItemFactory. this is only for preserving source
compatibility where possible, use of GtkMenuFactory is deprecated as of
now.
* gtk/gtkobject.h (gtk_object_class_add_user_signal): new function
to create user signals of type GTK_RUN_NO_RECURSE. don't know why i
missed this possibility when i added gtk_object_class_add_user_signal
in late january.
* gtk/gtkmain.c (gtk_init): ignore subsequent function calls.
Sun May 31 07:31:09 1998 Tim Janik <timj@gtk.org>
* gtk/gtkaccelgroup.h:
* gtk/gtkaccelgroup.c: new implementation of the accelerator concept.
* gtk/gtkaccellabel.h:
* gtk/gtkaccellabel.c: new widget derived from GtkLabel whitch features
display of the accelerators associated with a certain widget.
* gtk/gtkitemfactory.h:
* gtk/gtkitemfactory.c: new widget, item factory with automatic rc
parsing and accelerator handling.
* gtk/gtkmenu.c (gtk_menu_reposition): new function to care for
positioning a menu.
(gtk_menu_map): removed the allocation code.
(gtk_menu_size_allocate): care for redrawing of children and resize
our widget->window correctly.
(gtk_menu_key_press): feature the new accelerator groups.
* gtk/gtkmenuitem.c (gtk_menu_item_size_allocate): reposition the
submenu if neccessary.
* gtk/gtkmenuitem.c:
* gtk/gtkcheckmenuitem.c:
* gtk/gtkradiomenuitem.c: use GtkAccelLabel in the *_new_with_label()
function variants.
* gdk/gdk.c:
(gdk_keyval_from_name):
(gdk_keyval_name): new functions for keyval<->key-name associations.
(gdk_keyval_to_upper):
(gdk_keyval_to_lower):
(gdk_keyval_is_upper):
(gdk_keyval_is_lower): new functions to check/translate keyvalues with
regards to their cases.
Wed May 27 00:48:10 1998 Tim Janik <timj@gtk.org>
* gtk/gtkwidget.c (gtk_widget_class_path): new function to calculate a
widget's class path.
(gtk_widget_path): new function to calculate a widget's name path.
* gtk/gtkrc.c: newly introduced GtkPatternSpec structures to speed up
pattern matching, features reversed pattern matches.
1998-06-07 06:48:56 +00:00
|
|
|
if (!handled)
|
1997-11-24 22:37:52 +00:00
|
|
|
{
|
|
|
|
switch (event->keyval)
|
|
|
|
{
|
|
|
|
case GDK_space:
|
|
|
|
if (window->focus_widget)
|
|
|
|
{
|
|
|
|
gtk_widget_activate (window->focus_widget);
|
fixed an assertment.
Sat Jun 6 06:01:24 1998 Tim Janik <timj@gtk.org>
* gtk/gtksignal.c (gtk_signal_emitv): fixed an assertment.
* gtk/makeenums.awk: a script to generate the GtkEnumValue arrays from,
this should eventually be done by gentypeinfo.el somewhen.
* gtk/gtkenumvalues.c: new generated file to hold GtkEnumValue arrays.
* gtk/gtktypeutils.h: new function gtk_enum_values() to retrive all the
enum values of an enum type.
* gtk/gtk.defs:
* gtk/gtkcurve.h:
* gtk/gtkobject.h:
* gtk/gtkprivate.h:
* gtk/gtkwidget.h:
* gtk/gtkenums.h:
brought enum/flags definitions in sync, added a few more enum
definitions for bindings and pattern matching.
* some more macro and GtkType fixups in various places.
* gdk/gdktypes.h (enum): added a new value GDK_AFTER_MASK, which is used
as a key-release modifier for the binding system.
Fri Jun 5 06:06:06 1998 Tim Janik <timj@gtk.org>
* gtk/gtkmenu.h (struct _GtkMenu): removed GList*children, since it
was a stale list pointer that is already present in GtkMenuShell.
* gtk/gtkmenushell.h (struct _GtkMenuShellClass): added a signal
GtkMenuShell::selection_done which is emitted after the menu shell
poped down again and all possible menu items have been activated.
Thu Jun 4 02:20:42 1998 Tim Janik <timj@gtk.org>
* gtk/gtkmenushell.c (gtk_menu_shell_button_release): flush the x-queue
before activation of the menuitem, so the menu is actually taken off the
screen prior to any menu item activation.
* gtk/gtkctree.c (gtk_ctree_get_row_data): allow function invokation
for NULL nodes.
* gtk/gtkwidget.h:
* gtk/gtkwidget.c: new function gtk_widget_stop_accelerator to stop
the emission of the "add-accelerator" signal on a widget. this is
usefull to prevent accelerator installation on certain widgets.
* gtk/gtknotebook.c (gtk_notebook_menu_item_create): keep the menu
labels left justified, by setting their alignment. stop accelerator
installation for the menu items, since we use dynamic menus.
Wed Jun 3 06:41:22 1998 Tim Janik <timj@gtk.org>
* gtk/gtkmenufactory.c: adaptions to use the new accel groups. people
should *really* use GtkItemFactory. this is only for preserving source
compatibility where possible, use of GtkMenuFactory is deprecated as of
now.
* gtk/gtkobject.h (gtk_object_class_add_user_signal): new function
to create user signals of type GTK_RUN_NO_RECURSE. don't know why i
missed this possibility when i added gtk_object_class_add_user_signal
in late january.
* gtk/gtkmain.c (gtk_init): ignore subsequent function calls.
Sun May 31 07:31:09 1998 Tim Janik <timj@gtk.org>
* gtk/gtkaccelgroup.h:
* gtk/gtkaccelgroup.c: new implementation of the accelerator concept.
* gtk/gtkaccellabel.h:
* gtk/gtkaccellabel.c: new widget derived from GtkLabel whitch features
display of the accelerators associated with a certain widget.
* gtk/gtkitemfactory.h:
* gtk/gtkitemfactory.c: new widget, item factory with automatic rc
parsing and accelerator handling.
* gtk/gtkmenu.c (gtk_menu_reposition): new function to care for
positioning a menu.
(gtk_menu_map): removed the allocation code.
(gtk_menu_size_allocate): care for redrawing of children and resize
our widget->window correctly.
(gtk_menu_key_press): feature the new accelerator groups.
* gtk/gtkmenuitem.c (gtk_menu_item_size_allocate): reposition the
submenu if neccessary.
* gtk/gtkmenuitem.c:
* gtk/gtkcheckmenuitem.c:
* gtk/gtkradiomenuitem.c: use GtkAccelLabel in the *_new_with_label()
function variants.
* gdk/gdk.c:
(gdk_keyval_from_name):
(gdk_keyval_name): new functions for keyval<->key-name associations.
(gdk_keyval_to_upper):
(gdk_keyval_to_lower):
(gdk_keyval_is_upper):
(gdk_keyval_is_lower): new functions to check/translate keyvalues with
regards to their cases.
Wed May 27 00:48:10 1998 Tim Janik <timj@gtk.org>
* gtk/gtkwidget.c (gtk_widget_class_path): new function to calculate a
widget's class path.
(gtk_widget_path): new function to calculate a widget's name path.
* gtk/gtkrc.c: newly introduced GtkPatternSpec structures to speed up
pattern matching, features reversed pattern matches.
1998-06-07 06:48:56 +00:00
|
|
|
handled = TRUE;
|
1997-11-24 22:37:52 +00:00
|
|
|
}
|
|
|
|
break;
|
|
|
|
case GDK_Return:
|
|
|
|
case GDK_KP_Enter:
|
|
|
|
if (window->default_widget)
|
|
|
|
{
|
|
|
|
gtk_widget_activate (window->default_widget);
|
fixed an assertment.
Sat Jun 6 06:01:24 1998 Tim Janik <timj@gtk.org>
* gtk/gtksignal.c (gtk_signal_emitv): fixed an assertment.
* gtk/makeenums.awk: a script to generate the GtkEnumValue arrays from,
this should eventually be done by gentypeinfo.el somewhen.
* gtk/gtkenumvalues.c: new generated file to hold GtkEnumValue arrays.
* gtk/gtktypeutils.h: new function gtk_enum_values() to retrive all the
enum values of an enum type.
* gtk/gtk.defs:
* gtk/gtkcurve.h:
* gtk/gtkobject.h:
* gtk/gtkprivate.h:
* gtk/gtkwidget.h:
* gtk/gtkenums.h:
brought enum/flags definitions in sync, added a few more enum
definitions for bindings and pattern matching.
* some more macro and GtkType fixups in various places.
* gdk/gdktypes.h (enum): added a new value GDK_AFTER_MASK, which is used
as a key-release modifier for the binding system.
Fri Jun 5 06:06:06 1998 Tim Janik <timj@gtk.org>
* gtk/gtkmenu.h (struct _GtkMenu): removed GList*children, since it
was a stale list pointer that is already present in GtkMenuShell.
* gtk/gtkmenushell.h (struct _GtkMenuShellClass): added a signal
GtkMenuShell::selection_done which is emitted after the menu shell
poped down again and all possible menu items have been activated.
Thu Jun 4 02:20:42 1998 Tim Janik <timj@gtk.org>
* gtk/gtkmenushell.c (gtk_menu_shell_button_release): flush the x-queue
before activation of the menuitem, so the menu is actually taken off the
screen prior to any menu item activation.
* gtk/gtkctree.c (gtk_ctree_get_row_data): allow function invokation
for NULL nodes.
* gtk/gtkwidget.h:
* gtk/gtkwidget.c: new function gtk_widget_stop_accelerator to stop
the emission of the "add-accelerator" signal on a widget. this is
usefull to prevent accelerator installation on certain widgets.
* gtk/gtknotebook.c (gtk_notebook_menu_item_create): keep the menu
labels left justified, by setting their alignment. stop accelerator
installation for the menu items, since we use dynamic menus.
Wed Jun 3 06:41:22 1998 Tim Janik <timj@gtk.org>
* gtk/gtkmenufactory.c: adaptions to use the new accel groups. people
should *really* use GtkItemFactory. this is only for preserving source
compatibility where possible, use of GtkMenuFactory is deprecated as of
now.
* gtk/gtkobject.h (gtk_object_class_add_user_signal): new function
to create user signals of type GTK_RUN_NO_RECURSE. don't know why i
missed this possibility when i added gtk_object_class_add_user_signal
in late january.
* gtk/gtkmain.c (gtk_init): ignore subsequent function calls.
Sun May 31 07:31:09 1998 Tim Janik <timj@gtk.org>
* gtk/gtkaccelgroup.h:
* gtk/gtkaccelgroup.c: new implementation of the accelerator concept.
* gtk/gtkaccellabel.h:
* gtk/gtkaccellabel.c: new widget derived from GtkLabel whitch features
display of the accelerators associated with a certain widget.
* gtk/gtkitemfactory.h:
* gtk/gtkitemfactory.c: new widget, item factory with automatic rc
parsing and accelerator handling.
* gtk/gtkmenu.c (gtk_menu_reposition): new function to care for
positioning a menu.
(gtk_menu_map): removed the allocation code.
(gtk_menu_size_allocate): care for redrawing of children and resize
our widget->window correctly.
(gtk_menu_key_press): feature the new accelerator groups.
* gtk/gtkmenuitem.c (gtk_menu_item_size_allocate): reposition the
submenu if neccessary.
* gtk/gtkmenuitem.c:
* gtk/gtkcheckmenuitem.c:
* gtk/gtkradiomenuitem.c: use GtkAccelLabel in the *_new_with_label()
function variants.
* gdk/gdk.c:
(gdk_keyval_from_name):
(gdk_keyval_name): new functions for keyval<->key-name associations.
(gdk_keyval_to_upper):
(gdk_keyval_to_lower):
(gdk_keyval_is_upper):
(gdk_keyval_is_lower): new functions to check/translate keyvalues with
regards to their cases.
Wed May 27 00:48:10 1998 Tim Janik <timj@gtk.org>
* gtk/gtkwidget.c (gtk_widget_class_path): new function to calculate a
widget's class path.
(gtk_widget_path): new function to calculate a widget's name path.
* gtk/gtkrc.c: newly introduced GtkPatternSpec structures to speed up
pattern matching, features reversed pattern matches.
1998-06-07 06:48:56 +00:00
|
|
|
handled = TRUE;
|
1997-11-24 22:37:52 +00:00
|
|
|
}
|
|
|
|
else if (window->focus_widget)
|
|
|
|
{
|
|
|
|
gtk_widget_activate (window->focus_widget);
|
fixed an assertment.
Sat Jun 6 06:01:24 1998 Tim Janik <timj@gtk.org>
* gtk/gtksignal.c (gtk_signal_emitv): fixed an assertment.
* gtk/makeenums.awk: a script to generate the GtkEnumValue arrays from,
this should eventually be done by gentypeinfo.el somewhen.
* gtk/gtkenumvalues.c: new generated file to hold GtkEnumValue arrays.
* gtk/gtktypeutils.h: new function gtk_enum_values() to retrive all the
enum values of an enum type.
* gtk/gtk.defs:
* gtk/gtkcurve.h:
* gtk/gtkobject.h:
* gtk/gtkprivate.h:
* gtk/gtkwidget.h:
* gtk/gtkenums.h:
brought enum/flags definitions in sync, added a few more enum
definitions for bindings and pattern matching.
* some more macro and GtkType fixups in various places.
* gdk/gdktypes.h (enum): added a new value GDK_AFTER_MASK, which is used
as a key-release modifier for the binding system.
Fri Jun 5 06:06:06 1998 Tim Janik <timj@gtk.org>
* gtk/gtkmenu.h (struct _GtkMenu): removed GList*children, since it
was a stale list pointer that is already present in GtkMenuShell.
* gtk/gtkmenushell.h (struct _GtkMenuShellClass): added a signal
GtkMenuShell::selection_done which is emitted after the menu shell
poped down again and all possible menu items have been activated.
Thu Jun 4 02:20:42 1998 Tim Janik <timj@gtk.org>
* gtk/gtkmenushell.c (gtk_menu_shell_button_release): flush the x-queue
before activation of the menuitem, so the menu is actually taken off the
screen prior to any menu item activation.
* gtk/gtkctree.c (gtk_ctree_get_row_data): allow function invokation
for NULL nodes.
* gtk/gtkwidget.h:
* gtk/gtkwidget.c: new function gtk_widget_stop_accelerator to stop
the emission of the "add-accelerator" signal on a widget. this is
usefull to prevent accelerator installation on certain widgets.
* gtk/gtknotebook.c (gtk_notebook_menu_item_create): keep the menu
labels left justified, by setting their alignment. stop accelerator
installation for the menu items, since we use dynamic menus.
Wed Jun 3 06:41:22 1998 Tim Janik <timj@gtk.org>
* gtk/gtkmenufactory.c: adaptions to use the new accel groups. people
should *really* use GtkItemFactory. this is only for preserving source
compatibility where possible, use of GtkMenuFactory is deprecated as of
now.
* gtk/gtkobject.h (gtk_object_class_add_user_signal): new function
to create user signals of type GTK_RUN_NO_RECURSE. don't know why i
missed this possibility when i added gtk_object_class_add_user_signal
in late january.
* gtk/gtkmain.c (gtk_init): ignore subsequent function calls.
Sun May 31 07:31:09 1998 Tim Janik <timj@gtk.org>
* gtk/gtkaccelgroup.h:
* gtk/gtkaccelgroup.c: new implementation of the accelerator concept.
* gtk/gtkaccellabel.h:
* gtk/gtkaccellabel.c: new widget derived from GtkLabel whitch features
display of the accelerators associated with a certain widget.
* gtk/gtkitemfactory.h:
* gtk/gtkitemfactory.c: new widget, item factory with automatic rc
parsing and accelerator handling.
* gtk/gtkmenu.c (gtk_menu_reposition): new function to care for
positioning a menu.
(gtk_menu_map): removed the allocation code.
(gtk_menu_size_allocate): care for redrawing of children and resize
our widget->window correctly.
(gtk_menu_key_press): feature the new accelerator groups.
* gtk/gtkmenuitem.c (gtk_menu_item_size_allocate): reposition the
submenu if neccessary.
* gtk/gtkmenuitem.c:
* gtk/gtkcheckmenuitem.c:
* gtk/gtkradiomenuitem.c: use GtkAccelLabel in the *_new_with_label()
function variants.
* gdk/gdk.c:
(gdk_keyval_from_name):
(gdk_keyval_name): new functions for keyval<->key-name associations.
(gdk_keyval_to_upper):
(gdk_keyval_to_lower):
(gdk_keyval_is_upper):
(gdk_keyval_is_lower): new functions to check/translate keyvalues with
regards to their cases.
Wed May 27 00:48:10 1998 Tim Janik <timj@gtk.org>
* gtk/gtkwidget.c (gtk_widget_class_path): new function to calculate a
widget's class path.
(gtk_widget_path): new function to calculate a widget's name path.
* gtk/gtkrc.c: newly introduced GtkPatternSpec structures to speed up
pattern matching, features reversed pattern matches.
1998-06-07 06:48:56 +00:00
|
|
|
handled = TRUE;
|
1997-11-24 22:37:52 +00:00
|
|
|
}
|
|
|
|
break;
|
|
|
|
case GDK_Up:
|
|
|
|
case GDK_Down:
|
|
|
|
case GDK_Left:
|
|
|
|
case GDK_Right:
|
|
|
|
case GDK_Tab:
|
1998-03-06 23:17:12 +00:00
|
|
|
case GDK_ISO_Left_Tab:
|
1997-11-24 22:37:52 +00:00
|
|
|
switch (event->keyval)
|
|
|
|
{
|
|
|
|
case GDK_Up:
|
|
|
|
direction = GTK_DIR_UP;
|
|
|
|
break;
|
|
|
|
case GDK_Down:
|
|
|
|
direction = GTK_DIR_DOWN;
|
|
|
|
break;
|
|
|
|
case GDK_Left:
|
|
|
|
direction = GTK_DIR_LEFT;
|
|
|
|
break;
|
|
|
|
case GDK_Right:
|
|
|
|
direction = GTK_DIR_RIGHT;
|
|
|
|
break;
|
|
|
|
case GDK_Tab:
|
1998-03-06 23:17:12 +00:00
|
|
|
case GDK_ISO_Left_Tab:
|
1997-11-24 22:37:52 +00:00
|
|
|
if (event->state & GDK_SHIFT_MASK)
|
|
|
|
direction = GTK_DIR_TAB_BACKWARD;
|
|
|
|
else
|
|
|
|
direction = GTK_DIR_TAB_FORWARD;
|
|
|
|
break;
|
|
|
|
default :
|
|
|
|
direction = GTK_DIR_UP; /* never reached, but makes compiler happy */
|
|
|
|
}
|
|
|
|
|
|
|
|
gtk_container_focus (GTK_CONTAINER (widget), direction);
|
|
|
|
|
|
|
|
if (!GTK_CONTAINER (window)->focus_child)
|
|
|
|
gtk_window_set_focus (GTK_WINDOW (widget), NULL);
|
|
|
|
else
|
fixed an assertment.
Sat Jun 6 06:01:24 1998 Tim Janik <timj@gtk.org>
* gtk/gtksignal.c (gtk_signal_emitv): fixed an assertment.
* gtk/makeenums.awk: a script to generate the GtkEnumValue arrays from,
this should eventually be done by gentypeinfo.el somewhen.
* gtk/gtkenumvalues.c: new generated file to hold GtkEnumValue arrays.
* gtk/gtktypeutils.h: new function gtk_enum_values() to retrive all the
enum values of an enum type.
* gtk/gtk.defs:
* gtk/gtkcurve.h:
* gtk/gtkobject.h:
* gtk/gtkprivate.h:
* gtk/gtkwidget.h:
* gtk/gtkenums.h:
brought enum/flags definitions in sync, added a few more enum
definitions for bindings and pattern matching.
* some more macro and GtkType fixups in various places.
* gdk/gdktypes.h (enum): added a new value GDK_AFTER_MASK, which is used
as a key-release modifier for the binding system.
Fri Jun 5 06:06:06 1998 Tim Janik <timj@gtk.org>
* gtk/gtkmenu.h (struct _GtkMenu): removed GList*children, since it
was a stale list pointer that is already present in GtkMenuShell.
* gtk/gtkmenushell.h (struct _GtkMenuShellClass): added a signal
GtkMenuShell::selection_done which is emitted after the menu shell
poped down again and all possible menu items have been activated.
Thu Jun 4 02:20:42 1998 Tim Janik <timj@gtk.org>
* gtk/gtkmenushell.c (gtk_menu_shell_button_release): flush the x-queue
before activation of the menuitem, so the menu is actually taken off the
screen prior to any menu item activation.
* gtk/gtkctree.c (gtk_ctree_get_row_data): allow function invokation
for NULL nodes.
* gtk/gtkwidget.h:
* gtk/gtkwidget.c: new function gtk_widget_stop_accelerator to stop
the emission of the "add-accelerator" signal on a widget. this is
usefull to prevent accelerator installation on certain widgets.
* gtk/gtknotebook.c (gtk_notebook_menu_item_create): keep the menu
labels left justified, by setting their alignment. stop accelerator
installation for the menu items, since we use dynamic menus.
Wed Jun 3 06:41:22 1998 Tim Janik <timj@gtk.org>
* gtk/gtkmenufactory.c: adaptions to use the new accel groups. people
should *really* use GtkItemFactory. this is only for preserving source
compatibility where possible, use of GtkMenuFactory is deprecated as of
now.
* gtk/gtkobject.h (gtk_object_class_add_user_signal): new function
to create user signals of type GTK_RUN_NO_RECURSE. don't know why i
missed this possibility when i added gtk_object_class_add_user_signal
in late january.
* gtk/gtkmain.c (gtk_init): ignore subsequent function calls.
Sun May 31 07:31:09 1998 Tim Janik <timj@gtk.org>
* gtk/gtkaccelgroup.h:
* gtk/gtkaccelgroup.c: new implementation of the accelerator concept.
* gtk/gtkaccellabel.h:
* gtk/gtkaccellabel.c: new widget derived from GtkLabel whitch features
display of the accelerators associated with a certain widget.
* gtk/gtkitemfactory.h:
* gtk/gtkitemfactory.c: new widget, item factory with automatic rc
parsing and accelerator handling.
* gtk/gtkmenu.c (gtk_menu_reposition): new function to care for
positioning a menu.
(gtk_menu_map): removed the allocation code.
(gtk_menu_size_allocate): care for redrawing of children and resize
our widget->window correctly.
(gtk_menu_key_press): feature the new accelerator groups.
* gtk/gtkmenuitem.c (gtk_menu_item_size_allocate): reposition the
submenu if neccessary.
* gtk/gtkmenuitem.c:
* gtk/gtkcheckmenuitem.c:
* gtk/gtkradiomenuitem.c: use GtkAccelLabel in the *_new_with_label()
function variants.
* gdk/gdk.c:
(gdk_keyval_from_name):
(gdk_keyval_name): new functions for keyval<->key-name associations.
(gdk_keyval_to_upper):
(gdk_keyval_to_lower):
(gdk_keyval_is_upper):
(gdk_keyval_is_lower): new functions to check/translate keyvalues with
regards to their cases.
Wed May 27 00:48:10 1998 Tim Janik <timj@gtk.org>
* gtk/gtkwidget.c (gtk_widget_class_path): new function to calculate a
widget's class path.
(gtk_widget_path): new function to calculate a widget's name path.
* gtk/gtkrc.c: newly introduced GtkPatternSpec structures to speed up
pattern matching, features reversed pattern matches.
1998-06-07 06:48:56 +00:00
|
|
|
handled = TRUE;
|
1997-11-24 22:37:52 +00:00
|
|
|
break;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
1998-06-09 07:11:55 +00:00
|
|
|
if (!handled && GTK_WIDGET_CLASS (parent_class)->key_press_event)
|
|
|
|
handled = GTK_WIDGET_CLASS (parent_class)->key_press_event (widget, event);
|
|
|
|
|
fixed an assertment.
Sat Jun 6 06:01:24 1998 Tim Janik <timj@gtk.org>
* gtk/gtksignal.c (gtk_signal_emitv): fixed an assertment.
* gtk/makeenums.awk: a script to generate the GtkEnumValue arrays from,
this should eventually be done by gentypeinfo.el somewhen.
* gtk/gtkenumvalues.c: new generated file to hold GtkEnumValue arrays.
* gtk/gtktypeutils.h: new function gtk_enum_values() to retrive all the
enum values of an enum type.
* gtk/gtk.defs:
* gtk/gtkcurve.h:
* gtk/gtkobject.h:
* gtk/gtkprivate.h:
* gtk/gtkwidget.h:
* gtk/gtkenums.h:
brought enum/flags definitions in sync, added a few more enum
definitions for bindings and pattern matching.
* some more macro and GtkType fixups in various places.
* gdk/gdktypes.h (enum): added a new value GDK_AFTER_MASK, which is used
as a key-release modifier for the binding system.
Fri Jun 5 06:06:06 1998 Tim Janik <timj@gtk.org>
* gtk/gtkmenu.h (struct _GtkMenu): removed GList*children, since it
was a stale list pointer that is already present in GtkMenuShell.
* gtk/gtkmenushell.h (struct _GtkMenuShellClass): added a signal
GtkMenuShell::selection_done which is emitted after the menu shell
poped down again and all possible menu items have been activated.
Thu Jun 4 02:20:42 1998 Tim Janik <timj@gtk.org>
* gtk/gtkmenushell.c (gtk_menu_shell_button_release): flush the x-queue
before activation of the menuitem, so the menu is actually taken off the
screen prior to any menu item activation.
* gtk/gtkctree.c (gtk_ctree_get_row_data): allow function invokation
for NULL nodes.
* gtk/gtkwidget.h:
* gtk/gtkwidget.c: new function gtk_widget_stop_accelerator to stop
the emission of the "add-accelerator" signal on a widget. this is
usefull to prevent accelerator installation on certain widgets.
* gtk/gtknotebook.c (gtk_notebook_menu_item_create): keep the menu
labels left justified, by setting their alignment. stop accelerator
installation for the menu items, since we use dynamic menus.
Wed Jun 3 06:41:22 1998 Tim Janik <timj@gtk.org>
* gtk/gtkmenufactory.c: adaptions to use the new accel groups. people
should *really* use GtkItemFactory. this is only for preserving source
compatibility where possible, use of GtkMenuFactory is deprecated as of
now.
* gtk/gtkobject.h (gtk_object_class_add_user_signal): new function
to create user signals of type GTK_RUN_NO_RECURSE. don't know why i
missed this possibility when i added gtk_object_class_add_user_signal
in late january.
* gtk/gtkmain.c (gtk_init): ignore subsequent function calls.
Sun May 31 07:31:09 1998 Tim Janik <timj@gtk.org>
* gtk/gtkaccelgroup.h:
* gtk/gtkaccelgroup.c: new implementation of the accelerator concept.
* gtk/gtkaccellabel.h:
* gtk/gtkaccellabel.c: new widget derived from GtkLabel whitch features
display of the accelerators associated with a certain widget.
* gtk/gtkitemfactory.h:
* gtk/gtkitemfactory.c: new widget, item factory with automatic rc
parsing and accelerator handling.
* gtk/gtkmenu.c (gtk_menu_reposition): new function to care for
positioning a menu.
(gtk_menu_map): removed the allocation code.
(gtk_menu_size_allocate): care for redrawing of children and resize
our widget->window correctly.
(gtk_menu_key_press): feature the new accelerator groups.
* gtk/gtkmenuitem.c (gtk_menu_item_size_allocate): reposition the
submenu if neccessary.
* gtk/gtkmenuitem.c:
* gtk/gtkcheckmenuitem.c:
* gtk/gtkradiomenuitem.c: use GtkAccelLabel in the *_new_with_label()
function variants.
* gdk/gdk.c:
(gdk_keyval_from_name):
(gdk_keyval_name): new functions for keyval<->key-name associations.
(gdk_keyval_to_upper):
(gdk_keyval_to_lower):
(gdk_keyval_is_upper):
(gdk_keyval_is_lower): new functions to check/translate keyvalues with
regards to their cases.
Wed May 27 00:48:10 1998 Tim Janik <timj@gtk.org>
* gtk/gtkwidget.c (gtk_widget_class_path): new function to calculate a
widget's class path.
(gtk_widget_path): new function to calculate a widget's name path.
* gtk/gtkrc.c: newly introduced GtkPatternSpec structures to speed up
pattern matching, features reversed pattern matches.
1998-06-07 06:48:56 +00:00
|
|
|
return handled;
|
1997-11-24 22:37:52 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
static gint
|
|
|
|
gtk_window_key_release_event (GtkWidget *widget,
|
|
|
|
GdkEventKey *event)
|
|
|
|
{
|
|
|
|
GtkWindow *window;
|
fixed an assertment.
Sat Jun 6 06:01:24 1998 Tim Janik <timj@gtk.org>
* gtk/gtksignal.c (gtk_signal_emitv): fixed an assertment.
* gtk/makeenums.awk: a script to generate the GtkEnumValue arrays from,
this should eventually be done by gentypeinfo.el somewhen.
* gtk/gtkenumvalues.c: new generated file to hold GtkEnumValue arrays.
* gtk/gtktypeutils.h: new function gtk_enum_values() to retrive all the
enum values of an enum type.
* gtk/gtk.defs:
* gtk/gtkcurve.h:
* gtk/gtkobject.h:
* gtk/gtkprivate.h:
* gtk/gtkwidget.h:
* gtk/gtkenums.h:
brought enum/flags definitions in sync, added a few more enum
definitions for bindings and pattern matching.
* some more macro and GtkType fixups in various places.
* gdk/gdktypes.h (enum): added a new value GDK_AFTER_MASK, which is used
as a key-release modifier for the binding system.
Fri Jun 5 06:06:06 1998 Tim Janik <timj@gtk.org>
* gtk/gtkmenu.h (struct _GtkMenu): removed GList*children, since it
was a stale list pointer that is already present in GtkMenuShell.
* gtk/gtkmenushell.h (struct _GtkMenuShellClass): added a signal
GtkMenuShell::selection_done which is emitted after the menu shell
poped down again and all possible menu items have been activated.
Thu Jun 4 02:20:42 1998 Tim Janik <timj@gtk.org>
* gtk/gtkmenushell.c (gtk_menu_shell_button_release): flush the x-queue
before activation of the menuitem, so the menu is actually taken off the
screen prior to any menu item activation.
* gtk/gtkctree.c (gtk_ctree_get_row_data): allow function invokation
for NULL nodes.
* gtk/gtkwidget.h:
* gtk/gtkwidget.c: new function gtk_widget_stop_accelerator to stop
the emission of the "add-accelerator" signal on a widget. this is
usefull to prevent accelerator installation on certain widgets.
* gtk/gtknotebook.c (gtk_notebook_menu_item_create): keep the menu
labels left justified, by setting their alignment. stop accelerator
installation for the menu items, since we use dynamic menus.
Wed Jun 3 06:41:22 1998 Tim Janik <timj@gtk.org>
* gtk/gtkmenufactory.c: adaptions to use the new accel groups. people
should *really* use GtkItemFactory. this is only for preserving source
compatibility where possible, use of GtkMenuFactory is deprecated as of
now.
* gtk/gtkobject.h (gtk_object_class_add_user_signal): new function
to create user signals of type GTK_RUN_NO_RECURSE. don't know why i
missed this possibility when i added gtk_object_class_add_user_signal
in late january.
* gtk/gtkmain.c (gtk_init): ignore subsequent function calls.
Sun May 31 07:31:09 1998 Tim Janik <timj@gtk.org>
* gtk/gtkaccelgroup.h:
* gtk/gtkaccelgroup.c: new implementation of the accelerator concept.
* gtk/gtkaccellabel.h:
* gtk/gtkaccellabel.c: new widget derived from GtkLabel whitch features
display of the accelerators associated with a certain widget.
* gtk/gtkitemfactory.h:
* gtk/gtkitemfactory.c: new widget, item factory with automatic rc
parsing and accelerator handling.
* gtk/gtkmenu.c (gtk_menu_reposition): new function to care for
positioning a menu.
(gtk_menu_map): removed the allocation code.
(gtk_menu_size_allocate): care for redrawing of children and resize
our widget->window correctly.
(gtk_menu_key_press): feature the new accelerator groups.
* gtk/gtkmenuitem.c (gtk_menu_item_size_allocate): reposition the
submenu if neccessary.
* gtk/gtkmenuitem.c:
* gtk/gtkcheckmenuitem.c:
* gtk/gtkradiomenuitem.c: use GtkAccelLabel in the *_new_with_label()
function variants.
* gdk/gdk.c:
(gdk_keyval_from_name):
(gdk_keyval_name): new functions for keyval<->key-name associations.
(gdk_keyval_to_upper):
(gdk_keyval_to_lower):
(gdk_keyval_is_upper):
(gdk_keyval_is_lower): new functions to check/translate keyvalues with
regards to their cases.
Wed May 27 00:48:10 1998 Tim Janik <timj@gtk.org>
* gtk/gtkwidget.c (gtk_widget_class_path): new function to calculate a
widget's class path.
(gtk_widget_path): new function to calculate a widget's name path.
* gtk/gtkrc.c: newly introduced GtkPatternSpec structures to speed up
pattern matching, features reversed pattern matches.
1998-06-07 06:48:56 +00:00
|
|
|
gint handled;
|
|
|
|
|
1997-11-24 22:37:52 +00:00
|
|
|
g_return_val_if_fail (widget != NULL, FALSE);
|
|
|
|
g_return_val_if_fail (GTK_IS_WINDOW (widget), FALSE);
|
|
|
|
g_return_val_if_fail (event != NULL, FALSE);
|
fixed an assertment.
Sat Jun 6 06:01:24 1998 Tim Janik <timj@gtk.org>
* gtk/gtksignal.c (gtk_signal_emitv): fixed an assertment.
* gtk/makeenums.awk: a script to generate the GtkEnumValue arrays from,
this should eventually be done by gentypeinfo.el somewhen.
* gtk/gtkenumvalues.c: new generated file to hold GtkEnumValue arrays.
* gtk/gtktypeutils.h: new function gtk_enum_values() to retrive all the
enum values of an enum type.
* gtk/gtk.defs:
* gtk/gtkcurve.h:
* gtk/gtkobject.h:
* gtk/gtkprivate.h:
* gtk/gtkwidget.h:
* gtk/gtkenums.h:
brought enum/flags definitions in sync, added a few more enum
definitions for bindings and pattern matching.
* some more macro and GtkType fixups in various places.
* gdk/gdktypes.h (enum): added a new value GDK_AFTER_MASK, which is used
as a key-release modifier for the binding system.
Fri Jun 5 06:06:06 1998 Tim Janik <timj@gtk.org>
* gtk/gtkmenu.h (struct _GtkMenu): removed GList*children, since it
was a stale list pointer that is already present in GtkMenuShell.
* gtk/gtkmenushell.h (struct _GtkMenuShellClass): added a signal
GtkMenuShell::selection_done which is emitted after the menu shell
poped down again and all possible menu items have been activated.
Thu Jun 4 02:20:42 1998 Tim Janik <timj@gtk.org>
* gtk/gtkmenushell.c (gtk_menu_shell_button_release): flush the x-queue
before activation of the menuitem, so the menu is actually taken off the
screen prior to any menu item activation.
* gtk/gtkctree.c (gtk_ctree_get_row_data): allow function invokation
for NULL nodes.
* gtk/gtkwidget.h:
* gtk/gtkwidget.c: new function gtk_widget_stop_accelerator to stop
the emission of the "add-accelerator" signal on a widget. this is
usefull to prevent accelerator installation on certain widgets.
* gtk/gtknotebook.c (gtk_notebook_menu_item_create): keep the menu
labels left justified, by setting their alignment. stop accelerator
installation for the menu items, since we use dynamic menus.
Wed Jun 3 06:41:22 1998 Tim Janik <timj@gtk.org>
* gtk/gtkmenufactory.c: adaptions to use the new accel groups. people
should *really* use GtkItemFactory. this is only for preserving source
compatibility where possible, use of GtkMenuFactory is deprecated as of
now.
* gtk/gtkobject.h (gtk_object_class_add_user_signal): new function
to create user signals of type GTK_RUN_NO_RECURSE. don't know why i
missed this possibility when i added gtk_object_class_add_user_signal
in late january.
* gtk/gtkmain.c (gtk_init): ignore subsequent function calls.
Sun May 31 07:31:09 1998 Tim Janik <timj@gtk.org>
* gtk/gtkaccelgroup.h:
* gtk/gtkaccelgroup.c: new implementation of the accelerator concept.
* gtk/gtkaccellabel.h:
* gtk/gtkaccellabel.c: new widget derived from GtkLabel whitch features
display of the accelerators associated with a certain widget.
* gtk/gtkitemfactory.h:
* gtk/gtkitemfactory.c: new widget, item factory with automatic rc
parsing and accelerator handling.
* gtk/gtkmenu.c (gtk_menu_reposition): new function to care for
positioning a menu.
(gtk_menu_map): removed the allocation code.
(gtk_menu_size_allocate): care for redrawing of children and resize
our widget->window correctly.
(gtk_menu_key_press): feature the new accelerator groups.
* gtk/gtkmenuitem.c (gtk_menu_item_size_allocate): reposition the
submenu if neccessary.
* gtk/gtkmenuitem.c:
* gtk/gtkcheckmenuitem.c:
* gtk/gtkradiomenuitem.c: use GtkAccelLabel in the *_new_with_label()
function variants.
* gdk/gdk.c:
(gdk_keyval_from_name):
(gdk_keyval_name): new functions for keyval<->key-name associations.
(gdk_keyval_to_upper):
(gdk_keyval_to_lower):
(gdk_keyval_is_upper):
(gdk_keyval_is_lower): new functions to check/translate keyvalues with
regards to their cases.
Wed May 27 00:48:10 1998 Tim Janik <timj@gtk.org>
* gtk/gtkwidget.c (gtk_widget_class_path): new function to calculate a
widget's class path.
(gtk_widget_path): new function to calculate a widget's name path.
* gtk/gtkrc.c: newly introduced GtkPatternSpec structures to speed up
pattern matching, features reversed pattern matches.
1998-06-07 06:48:56 +00:00
|
|
|
|
1997-11-24 22:37:52 +00:00
|
|
|
window = GTK_WINDOW (widget);
|
fixed an assertment.
Sat Jun 6 06:01:24 1998 Tim Janik <timj@gtk.org>
* gtk/gtksignal.c (gtk_signal_emitv): fixed an assertment.
* gtk/makeenums.awk: a script to generate the GtkEnumValue arrays from,
this should eventually be done by gentypeinfo.el somewhen.
* gtk/gtkenumvalues.c: new generated file to hold GtkEnumValue arrays.
* gtk/gtktypeutils.h: new function gtk_enum_values() to retrive all the
enum values of an enum type.
* gtk/gtk.defs:
* gtk/gtkcurve.h:
* gtk/gtkobject.h:
* gtk/gtkprivate.h:
* gtk/gtkwidget.h:
* gtk/gtkenums.h:
brought enum/flags definitions in sync, added a few more enum
definitions for bindings and pattern matching.
* some more macro and GtkType fixups in various places.
* gdk/gdktypes.h (enum): added a new value GDK_AFTER_MASK, which is used
as a key-release modifier for the binding system.
Fri Jun 5 06:06:06 1998 Tim Janik <timj@gtk.org>
* gtk/gtkmenu.h (struct _GtkMenu): removed GList*children, since it
was a stale list pointer that is already present in GtkMenuShell.
* gtk/gtkmenushell.h (struct _GtkMenuShellClass): added a signal
GtkMenuShell::selection_done which is emitted after the menu shell
poped down again and all possible menu items have been activated.
Thu Jun 4 02:20:42 1998 Tim Janik <timj@gtk.org>
* gtk/gtkmenushell.c (gtk_menu_shell_button_release): flush the x-queue
before activation of the menuitem, so the menu is actually taken off the
screen prior to any menu item activation.
* gtk/gtkctree.c (gtk_ctree_get_row_data): allow function invokation
for NULL nodes.
* gtk/gtkwidget.h:
* gtk/gtkwidget.c: new function gtk_widget_stop_accelerator to stop
the emission of the "add-accelerator" signal on a widget. this is
usefull to prevent accelerator installation on certain widgets.
* gtk/gtknotebook.c (gtk_notebook_menu_item_create): keep the menu
labels left justified, by setting their alignment. stop accelerator
installation for the menu items, since we use dynamic menus.
Wed Jun 3 06:41:22 1998 Tim Janik <timj@gtk.org>
* gtk/gtkmenufactory.c: adaptions to use the new accel groups. people
should *really* use GtkItemFactory. this is only for preserving source
compatibility where possible, use of GtkMenuFactory is deprecated as of
now.
* gtk/gtkobject.h (gtk_object_class_add_user_signal): new function
to create user signals of type GTK_RUN_NO_RECURSE. don't know why i
missed this possibility when i added gtk_object_class_add_user_signal
in late january.
* gtk/gtkmain.c (gtk_init): ignore subsequent function calls.
Sun May 31 07:31:09 1998 Tim Janik <timj@gtk.org>
* gtk/gtkaccelgroup.h:
* gtk/gtkaccelgroup.c: new implementation of the accelerator concept.
* gtk/gtkaccellabel.h:
* gtk/gtkaccellabel.c: new widget derived from GtkLabel whitch features
display of the accelerators associated with a certain widget.
* gtk/gtkitemfactory.h:
* gtk/gtkitemfactory.c: new widget, item factory with automatic rc
parsing and accelerator handling.
* gtk/gtkmenu.c (gtk_menu_reposition): new function to care for
positioning a menu.
(gtk_menu_map): removed the allocation code.
(gtk_menu_size_allocate): care for redrawing of children and resize
our widget->window correctly.
(gtk_menu_key_press): feature the new accelerator groups.
* gtk/gtkmenuitem.c (gtk_menu_item_size_allocate): reposition the
submenu if neccessary.
* gtk/gtkmenuitem.c:
* gtk/gtkcheckmenuitem.c:
* gtk/gtkradiomenuitem.c: use GtkAccelLabel in the *_new_with_label()
function variants.
* gdk/gdk.c:
(gdk_keyval_from_name):
(gdk_keyval_name): new functions for keyval<->key-name associations.
(gdk_keyval_to_upper):
(gdk_keyval_to_lower):
(gdk_keyval_is_upper):
(gdk_keyval_is_lower): new functions to check/translate keyvalues with
regards to their cases.
Wed May 27 00:48:10 1998 Tim Janik <timj@gtk.org>
* gtk/gtkwidget.c (gtk_widget_class_path): new function to calculate a
widget's class path.
(gtk_widget_path): new function to calculate a widget's name path.
* gtk/gtkrc.c: newly introduced GtkPatternSpec structures to speed up
pattern matching, features reversed pattern matches.
1998-06-07 06:48:56 +00:00
|
|
|
handled = FALSE;
|
1997-11-24 22:37:52 +00:00
|
|
|
if (window->focus_widget)
|
fixed an assertment.
Sat Jun 6 06:01:24 1998 Tim Janik <timj@gtk.org>
* gtk/gtksignal.c (gtk_signal_emitv): fixed an assertment.
* gtk/makeenums.awk: a script to generate the GtkEnumValue arrays from,
this should eventually be done by gentypeinfo.el somewhen.
* gtk/gtkenumvalues.c: new generated file to hold GtkEnumValue arrays.
* gtk/gtktypeutils.h: new function gtk_enum_values() to retrive all the
enum values of an enum type.
* gtk/gtk.defs:
* gtk/gtkcurve.h:
* gtk/gtkobject.h:
* gtk/gtkprivate.h:
* gtk/gtkwidget.h:
* gtk/gtkenums.h:
brought enum/flags definitions in sync, added a few more enum
definitions for bindings and pattern matching.
* some more macro and GtkType fixups in various places.
* gdk/gdktypes.h (enum): added a new value GDK_AFTER_MASK, which is used
as a key-release modifier for the binding system.
Fri Jun 5 06:06:06 1998 Tim Janik <timj@gtk.org>
* gtk/gtkmenu.h (struct _GtkMenu): removed GList*children, since it
was a stale list pointer that is already present in GtkMenuShell.
* gtk/gtkmenushell.h (struct _GtkMenuShellClass): added a signal
GtkMenuShell::selection_done which is emitted after the menu shell
poped down again and all possible menu items have been activated.
Thu Jun 4 02:20:42 1998 Tim Janik <timj@gtk.org>
* gtk/gtkmenushell.c (gtk_menu_shell_button_release): flush the x-queue
before activation of the menuitem, so the menu is actually taken off the
screen prior to any menu item activation.
* gtk/gtkctree.c (gtk_ctree_get_row_data): allow function invokation
for NULL nodes.
* gtk/gtkwidget.h:
* gtk/gtkwidget.c: new function gtk_widget_stop_accelerator to stop
the emission of the "add-accelerator" signal on a widget. this is
usefull to prevent accelerator installation on certain widgets.
* gtk/gtknotebook.c (gtk_notebook_menu_item_create): keep the menu
labels left justified, by setting their alignment. stop accelerator
installation for the menu items, since we use dynamic menus.
Wed Jun 3 06:41:22 1998 Tim Janik <timj@gtk.org>
* gtk/gtkmenufactory.c: adaptions to use the new accel groups. people
should *really* use GtkItemFactory. this is only for preserving source
compatibility where possible, use of GtkMenuFactory is deprecated as of
now.
* gtk/gtkobject.h (gtk_object_class_add_user_signal): new function
to create user signals of type GTK_RUN_NO_RECURSE. don't know why i
missed this possibility when i added gtk_object_class_add_user_signal
in late january.
* gtk/gtkmain.c (gtk_init): ignore subsequent function calls.
Sun May 31 07:31:09 1998 Tim Janik <timj@gtk.org>
* gtk/gtkaccelgroup.h:
* gtk/gtkaccelgroup.c: new implementation of the accelerator concept.
* gtk/gtkaccellabel.h:
* gtk/gtkaccellabel.c: new widget derived from GtkLabel whitch features
display of the accelerators associated with a certain widget.
* gtk/gtkitemfactory.h:
* gtk/gtkitemfactory.c: new widget, item factory with automatic rc
parsing and accelerator handling.
* gtk/gtkmenu.c (gtk_menu_reposition): new function to care for
positioning a menu.
(gtk_menu_map): removed the allocation code.
(gtk_menu_size_allocate): care for redrawing of children and resize
our widget->window correctly.
(gtk_menu_key_press): feature the new accelerator groups.
* gtk/gtkmenuitem.c (gtk_menu_item_size_allocate): reposition the
submenu if neccessary.
* gtk/gtkmenuitem.c:
* gtk/gtkcheckmenuitem.c:
* gtk/gtkradiomenuitem.c: use GtkAccelLabel in the *_new_with_label()
function variants.
* gdk/gdk.c:
(gdk_keyval_from_name):
(gdk_keyval_name): new functions for keyval<->key-name associations.
(gdk_keyval_to_upper):
(gdk_keyval_to_lower):
(gdk_keyval_is_upper):
(gdk_keyval_is_lower): new functions to check/translate keyvalues with
regards to their cases.
Wed May 27 00:48:10 1998 Tim Janik <timj@gtk.org>
* gtk/gtkwidget.c (gtk_widget_class_path): new function to calculate a
widget's class path.
(gtk_widget_path): new function to calculate a widget's name path.
* gtk/gtkrc.c: newly introduced GtkPatternSpec structures to speed up
pattern matching, features reversed pattern matches.
1998-06-07 06:48:56 +00:00
|
|
|
{
|
|
|
|
handled = gtk_widget_event (window->focus_widget, (GdkEvent*) event);
|
|
|
|
}
|
1998-06-09 07:11:55 +00:00
|
|
|
|
|
|
|
if (!handled && GTK_WIDGET_CLASS (parent_class)->key_release_event)
|
|
|
|
handled = GTK_WIDGET_CLASS (parent_class)->key_release_event (widget, event);
|
|
|
|
|
fixed an assertment.
Sat Jun 6 06:01:24 1998 Tim Janik <timj@gtk.org>
* gtk/gtksignal.c (gtk_signal_emitv): fixed an assertment.
* gtk/makeenums.awk: a script to generate the GtkEnumValue arrays from,
this should eventually be done by gentypeinfo.el somewhen.
* gtk/gtkenumvalues.c: new generated file to hold GtkEnumValue arrays.
* gtk/gtktypeutils.h: new function gtk_enum_values() to retrive all the
enum values of an enum type.
* gtk/gtk.defs:
* gtk/gtkcurve.h:
* gtk/gtkobject.h:
* gtk/gtkprivate.h:
* gtk/gtkwidget.h:
* gtk/gtkenums.h:
brought enum/flags definitions in sync, added a few more enum
definitions for bindings and pattern matching.
* some more macro and GtkType fixups in various places.
* gdk/gdktypes.h (enum): added a new value GDK_AFTER_MASK, which is used
as a key-release modifier for the binding system.
Fri Jun 5 06:06:06 1998 Tim Janik <timj@gtk.org>
* gtk/gtkmenu.h (struct _GtkMenu): removed GList*children, since it
was a stale list pointer that is already present in GtkMenuShell.
* gtk/gtkmenushell.h (struct _GtkMenuShellClass): added a signal
GtkMenuShell::selection_done which is emitted after the menu shell
poped down again and all possible menu items have been activated.
Thu Jun 4 02:20:42 1998 Tim Janik <timj@gtk.org>
* gtk/gtkmenushell.c (gtk_menu_shell_button_release): flush the x-queue
before activation of the menuitem, so the menu is actually taken off the
screen prior to any menu item activation.
* gtk/gtkctree.c (gtk_ctree_get_row_data): allow function invokation
for NULL nodes.
* gtk/gtkwidget.h:
* gtk/gtkwidget.c: new function gtk_widget_stop_accelerator to stop
the emission of the "add-accelerator" signal on a widget. this is
usefull to prevent accelerator installation on certain widgets.
* gtk/gtknotebook.c (gtk_notebook_menu_item_create): keep the menu
labels left justified, by setting their alignment. stop accelerator
installation for the menu items, since we use dynamic menus.
Wed Jun 3 06:41:22 1998 Tim Janik <timj@gtk.org>
* gtk/gtkmenufactory.c: adaptions to use the new accel groups. people
should *really* use GtkItemFactory. this is only for preserving source
compatibility where possible, use of GtkMenuFactory is deprecated as of
now.
* gtk/gtkobject.h (gtk_object_class_add_user_signal): new function
to create user signals of type GTK_RUN_NO_RECURSE. don't know why i
missed this possibility when i added gtk_object_class_add_user_signal
in late january.
* gtk/gtkmain.c (gtk_init): ignore subsequent function calls.
Sun May 31 07:31:09 1998 Tim Janik <timj@gtk.org>
* gtk/gtkaccelgroup.h:
* gtk/gtkaccelgroup.c: new implementation of the accelerator concept.
* gtk/gtkaccellabel.h:
* gtk/gtkaccellabel.c: new widget derived from GtkLabel whitch features
display of the accelerators associated with a certain widget.
* gtk/gtkitemfactory.h:
* gtk/gtkitemfactory.c: new widget, item factory with automatic rc
parsing and accelerator handling.
* gtk/gtkmenu.c (gtk_menu_reposition): new function to care for
positioning a menu.
(gtk_menu_map): removed the allocation code.
(gtk_menu_size_allocate): care for redrawing of children and resize
our widget->window correctly.
(gtk_menu_key_press): feature the new accelerator groups.
* gtk/gtkmenuitem.c (gtk_menu_item_size_allocate): reposition the
submenu if neccessary.
* gtk/gtkmenuitem.c:
* gtk/gtkcheckmenuitem.c:
* gtk/gtkradiomenuitem.c: use GtkAccelLabel in the *_new_with_label()
function variants.
* gdk/gdk.c:
(gdk_keyval_from_name):
(gdk_keyval_name): new functions for keyval<->key-name associations.
(gdk_keyval_to_upper):
(gdk_keyval_to_lower):
(gdk_keyval_is_upper):
(gdk_keyval_is_lower): new functions to check/translate keyvalues with
regards to their cases.
Wed May 27 00:48:10 1998 Tim Janik <timj@gtk.org>
* gtk/gtkwidget.c (gtk_widget_class_path): new function to calculate a
widget's class path.
(gtk_widget_path): new function to calculate a widget's name path.
* gtk/gtkrc.c: newly introduced GtkPatternSpec structures to speed up
pattern matching, features reversed pattern matches.
1998-06-07 06:48:56 +00:00
|
|
|
return handled;
|
1997-11-24 22:37:52 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
static gint
|
|
|
|
gtk_window_enter_notify_event (GtkWidget *widget,
|
|
|
|
GdkEventCrossing *event)
|
|
|
|
{
|
|
|
|
g_return_val_if_fail (widget != NULL, FALSE);
|
|
|
|
g_return_val_if_fail (GTK_IS_WINDOW (widget), FALSE);
|
|
|
|
g_return_val_if_fail (event != NULL, FALSE);
|
|
|
|
|
|
|
|
return FALSE;
|
|
|
|
}
|
|
|
|
|
|
|
|
static gint
|
|
|
|
gtk_window_leave_notify_event (GtkWidget *widget,
|
|
|
|
GdkEventCrossing *event)
|
|
|
|
{
|
|
|
|
g_return_val_if_fail (widget != NULL, FALSE);
|
|
|
|
g_return_val_if_fail (GTK_IS_WINDOW (widget), FALSE);
|
|
|
|
g_return_val_if_fail (event != NULL, FALSE);
|
|
|
|
|
|
|
|
return FALSE;
|
|
|
|
}
|
|
|
|
|
|
|
|
static gint
|
|
|
|
gtk_window_focus_in_event (GtkWidget *widget,
|
|
|
|
GdkEventFocus *event)
|
|
|
|
{
|
|
|
|
GtkWindow *window;
|
|
|
|
GdkEventFocus fevent;
|
|
|
|
|
|
|
|
g_return_val_if_fail (widget != NULL, FALSE);
|
|
|
|
g_return_val_if_fail (GTK_IS_WINDOW (widget), FALSE);
|
|
|
|
g_return_val_if_fail (event != NULL, FALSE);
|
|
|
|
|
|
|
|
/* It appears spurious focus in events can occur when
|
|
|
|
* the window is hidden. So we'll just check to see if
|
|
|
|
* the window is visible before actually handling the
|
|
|
|
* event
|
|
|
|
*/
|
|
|
|
if (GTK_WIDGET_VISIBLE (widget))
|
|
|
|
{
|
|
|
|
window = GTK_WINDOW (widget);
|
|
|
|
if (window->focus_widget && !GTK_WIDGET_HAS_FOCUS (window->focus_widget))
|
|
|
|
{
|
|
|
|
fevent.type = GDK_FOCUS_CHANGE;
|
|
|
|
fevent.window = window->focus_widget->window;
|
|
|
|
fevent.in = TRUE;
|
|
|
|
|
|
|
|
gtk_widget_event (window->focus_widget, (GdkEvent*) &fevent);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
return FALSE;
|
|
|
|
}
|
|
|
|
|
|
|
|
static gint
|
|
|
|
gtk_window_focus_out_event (GtkWidget *widget,
|
|
|
|
GdkEventFocus *event)
|
|
|
|
{
|
|
|
|
GtkWindow *window;
|
|
|
|
GdkEventFocus fevent;
|
|
|
|
|
|
|
|
g_return_val_if_fail (widget != NULL, FALSE);
|
|
|
|
g_return_val_if_fail (GTK_IS_WINDOW (widget), FALSE);
|
|
|
|
g_return_val_if_fail (event != NULL, FALSE);
|
|
|
|
|
|
|
|
window = GTK_WINDOW (widget);
|
|
|
|
if (window->focus_widget && GTK_WIDGET_HAS_FOCUS (window->focus_widget))
|
|
|
|
{
|
|
|
|
fevent.type = GDK_FOCUS_CHANGE;
|
|
|
|
fevent.window = window->focus_widget->window;
|
|
|
|
fevent.in = FALSE;
|
|
|
|
|
|
|
|
gtk_widget_event (window->focus_widget, (GdkEvent*) &fevent);
|
|
|
|
}
|
|
|
|
|
|
|
|
return FALSE;
|
|
|
|
}
|
|
|
|
|
|
|
|
static void
|
1998-05-10 02:46:20 +00:00
|
|
|
gtk_window_read_rcfiles (GtkWidget *widget,
|
|
|
|
GdkEventClient *event)
|
1997-11-24 22:37:52 +00:00
|
|
|
{
|
1998-05-10 02:46:20 +00:00
|
|
|
GList *toplevels;
|
1997-11-24 22:37:52 +00:00
|
|
|
|
1998-05-10 02:46:20 +00:00
|
|
|
if (gtk_rc_reparse_all ())
|
|
|
|
{
|
|
|
|
toplevels = gdk_window_get_toplevels();
|
|
|
|
while (toplevels)
|
|
|
|
{
|
1998-08-17 14:48:51 +00:00
|
|
|
gdk_window_get_user_data (toplevels->data, (gpointer*) &widget);
|
1998-05-10 02:46:20 +00:00
|
|
|
|
|
|
|
if (widget)
|
|
|
|
gtk_widget_reset_rc_styles (widget);
|
|
|
|
|
|
|
|
toplevels = toplevels->next;
|
|
|
|
}
|
|
|
|
g_list_free (toplevels);
|
|
|
|
}
|
1997-11-24 22:37:52 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
static gint
|
|
|
|
gtk_window_client_event (GtkWidget *widget,
|
1997-11-27 05:07:48 +00:00
|
|
|
GdkEventClient *event)
|
1997-11-24 22:37:52 +00:00
|
|
|
{
|
1998-05-10 02:46:20 +00:00
|
|
|
static GdkAtom atom_rcfiles = GDK_NONE;
|
1997-11-24 22:37:52 +00:00
|
|
|
g_return_val_if_fail (widget != NULL, FALSE);
|
|
|
|
g_return_val_if_fail (GTK_IS_WINDOW (widget), FALSE);
|
|
|
|
g_return_val_if_fail (event != NULL, FALSE);
|
|
|
|
|
1998-05-10 02:46:20 +00:00
|
|
|
if (!atom_rcfiles)
|
|
|
|
atom_rcfiles = gdk_atom_intern("_GTK_READ_RCFILES", FALSE);
|
|
|
|
|
|
|
|
if(event->message_type == atom_rcfiles)
|
|
|
|
gtk_window_read_rcfiles (widget, event);
|
1997-11-24 22:37:52 +00:00
|
|
|
|
|
|
|
return FALSE;
|
|
|
|
}
|
|
|
|
|
1998-06-19 01:26:24 +00:00
|
|
|
static void
|
|
|
|
gtk_window_check_resize (GtkContainer *container)
|
1997-11-24 22:37:52 +00:00
|
|
|
{
|
|
|
|
GtkWindow *window;
|
|
|
|
|
1998-06-19 01:26:24 +00:00
|
|
|
g_return_if_fail (container != NULL);
|
|
|
|
g_return_if_fail (GTK_IS_WINDOW (container));
|
1997-11-24 22:37:52 +00:00
|
|
|
|
|
|
|
window = GTK_WINDOW (container);
|
1998-06-19 01:26:24 +00:00
|
|
|
if (!window->handling_resize)
|
|
|
|
{
|
|
|
|
if (GTK_WIDGET_VISIBLE (container))
|
|
|
|
gtk_window_move_resize (window);
|
|
|
|
else
|
|
|
|
GTK_CONTAINER (window)->need_resize = TRUE;
|
|
|
|
}
|
1997-11-24 22:37:52 +00:00
|
|
|
}
|
|
|
|
|
1998-06-19 01:26:24 +00:00
|
|
|
/* FIXME: we leave container->resize_widgets set under some
|
|
|
|
circumstances ? */
|
|
|
|
static void
|
|
|
|
gtk_window_move_resize (GtkWindow *window)
|
1997-11-24 22:37:52 +00:00
|
|
|
{
|
1998-06-19 01:26:24 +00:00
|
|
|
GtkWidget *widget;
|
|
|
|
GtkContainer *container;
|
|
|
|
gint x, y;
|
|
|
|
gint width, height;
|
|
|
|
gint screen_width;
|
|
|
|
gint screen_height;
|
1998-05-12 01:02:22 +00:00
|
|
|
gboolean needed_resize;
|
1998-06-19 01:26:24 +00:00
|
|
|
|
|
|
|
g_return_if_fail (window != NULL);
|
|
|
|
g_return_if_fail (GTK_IS_WINDOW (window));
|
1998-05-12 01:02:22 +00:00
|
|
|
|
1997-11-24 22:37:52 +00:00
|
|
|
widget = GTK_WIDGET (window);
|
1998-06-19 01:26:24 +00:00
|
|
|
container = GTK_CONTAINER (widget);
|
|
|
|
|
|
|
|
/* Remember old size, to know if we have to reset hints */
|
|
|
|
width = widget->requisition.width;
|
|
|
|
height = widget->requisition.height;
|
|
|
|
gtk_widget_size_request (widget, &widget->requisition);
|
1998-06-24 17:15:05 +00:00
|
|
|
|
1998-06-19 01:26:24 +00:00
|
|
|
if ((width != widget->requisition.width ||
|
|
|
|
height != widget->requisition.height))
|
1998-06-24 17:15:05 +00:00
|
|
|
{
|
|
|
|
gboolean saved_use_upos;
|
|
|
|
|
|
|
|
saved_use_upos = window->use_uposition;
|
|
|
|
gtk_window_set_hints (widget, &widget->requisition);
|
|
|
|
window->use_uposition = saved_use_upos;
|
|
|
|
}
|
1998-06-19 01:26:24 +00:00
|
|
|
|
|
|
|
x = -1;
|
|
|
|
y = -1;
|
|
|
|
width = widget->requisition.width;
|
|
|
|
height = widget->requisition.height;
|
|
|
|
|
|
|
|
if (window->use_uposition)
|
|
|
|
switch (window->position)
|
|
|
|
{
|
|
|
|
case GTK_WIN_POS_CENTER:
|
|
|
|
x = (gdk_screen_width () - width) / 2;
|
|
|
|
y = (gdk_screen_height () - height) / 2;
|
|
|
|
gtk_widget_set_uposition (widget, x, y);
|
|
|
|
break;
|
|
|
|
case GTK_WIN_POS_MOUSE:
|
|
|
|
gdk_window_get_pointer (NULL, &x, &y, NULL);
|
|
|
|
|
|
|
|
x -= width / 2;
|
|
|
|
y -= height / 2;
|
|
|
|
|
|
|
|
screen_width = gdk_screen_width ();
|
|
|
|
screen_height = gdk_screen_height ();
|
|
|
|
|
|
|
|
if (x < 0)
|
|
|
|
x = 0;
|
|
|
|
else if (x > (screen_width - width))
|
|
|
|
x = screen_width - width;
|
|
|
|
|
|
|
|
if (y < 0)
|
|
|
|
y = 0;
|
|
|
|
else if (y > (screen_height - height))
|
|
|
|
y = screen_height - height;
|
|
|
|
|
|
|
|
gtk_widget_set_uposition (widget, x, y);
|
|
|
|
break;
|
|
|
|
}
|
1998-04-03 23:17:16 +00:00
|
|
|
|
1998-06-19 01:26:24 +00:00
|
|
|
/* Now, do the resizing */
|
|
|
|
|
|
|
|
needed_resize = container->need_resize;
|
|
|
|
container->need_resize = FALSE;
|
1998-05-12 01:02:22 +00:00
|
|
|
|
1997-11-24 22:37:52 +00:00
|
|
|
if ((widget->requisition.width == 0) ||
|
|
|
|
(widget->requisition.height == 0))
|
|
|
|
{
|
|
|
|
widget->requisition.width = 200;
|
|
|
|
widget->requisition.height = 200;
|
|
|
|
}
|
1998-02-24 13:57:03 +00:00
|
|
|
|
1998-04-03 23:17:16 +00:00
|
|
|
if (!GTK_WIDGET_REALIZED (window))
|
|
|
|
{
|
|
|
|
GtkAllocation allocation;
|
|
|
|
|
|
|
|
allocation.x = 0;
|
|
|
|
allocation.y = 0;
|
|
|
|
allocation.width = widget->requisition.width;
|
|
|
|
allocation.height = widget->requisition.height;
|
|
|
|
|
|
|
|
gtk_widget_size_allocate (widget, &allocation);
|
|
|
|
|
1998-06-19 01:26:24 +00:00
|
|
|
return;
|
1998-04-03 23:17:16 +00:00
|
|
|
}
|
|
|
|
|
1997-11-24 22:37:52 +00:00
|
|
|
gdk_window_get_geometry (widget->window, NULL, NULL, &width, &height, NULL);
|
1998-02-24 13:57:03 +00:00
|
|
|
|
1997-11-24 22:37:52 +00:00
|
|
|
if ((window->auto_shrink &&
|
|
|
|
((width != widget->requisition.width) ||
|
|
|
|
(height != widget->requisition.height))) ||
|
|
|
|
(width < widget->requisition.width) ||
|
|
|
|
(height < widget->requisition.height))
|
|
|
|
{
|
1998-03-14 05:15:16 +00:00
|
|
|
window->resize_count += 1;
|
1998-06-19 01:26:24 +00:00
|
|
|
if ((x != -1) && (y != -1))
|
|
|
|
gdk_window_move_resize (widget->window, x, y,
|
1998-04-03 23:17:16 +00:00
|
|
|
widget->requisition.width,
|
|
|
|
widget->requisition.height);
|
|
|
|
else
|
|
|
|
gdk_window_resize (widget->window,
|
|
|
|
widget->requisition.width,
|
|
|
|
widget->requisition.height);
|
1997-11-24 22:37:52 +00:00
|
|
|
}
|
1998-05-12 01:02:22 +00:00
|
|
|
else if (needed_resize)
|
|
|
|
{
|
|
|
|
/* The windows contents changed size while it was not
|
|
|
|
* visible, so reallocate everything, since we didn't
|
|
|
|
* keep track of what changed
|
|
|
|
*/
|
|
|
|
GtkAllocation allocation;
|
|
|
|
|
|
|
|
allocation.x = 0;
|
|
|
|
allocation.y = 0;
|
|
|
|
allocation.width = widget->requisition.width;
|
|
|
|
allocation.height = widget->requisition.height;
|
|
|
|
|
|
|
|
gtk_widget_size_allocate (widget, &allocation);
|
|
|
|
}
|
1997-11-24 22:37:52 +00:00
|
|
|
else
|
|
|
|
{
|
1998-06-19 01:26:24 +00:00
|
|
|
if ((x != -1) && (y != -1))
|
|
|
|
gdk_window_move (widget->window, x, y);
|
1998-04-03 23:17:16 +00:00
|
|
|
|
1998-06-19 01:26:24 +00:00
|
|
|
gtk_container_resize_children (GTK_CONTAINER (window));
|
1997-11-24 22:37:52 +00:00
|
|
|
}
|
|
|
|
}
|
|
|
|
|
1997-12-18 02:17:14 +00:00
|
|
|
static void
|
|
|
|
gtk_real_window_set_focus (GtkWindow *window,
|
|
|
|
GtkWidget *focus)
|
|
|
|
{
|
|
|
|
GdkEventFocus event;
|
|
|
|
|
|
|
|
g_return_if_fail (window != NULL);
|
|
|
|
g_return_if_fail (GTK_IS_WINDOW (window));
|
|
|
|
|
|
|
|
if (focus && !GTK_WIDGET_CAN_FOCUS (focus))
|
|
|
|
return;
|
|
|
|
|
|
|
|
if (window->focus_widget != focus)
|
|
|
|
{
|
|
|
|
if (window->focus_widget)
|
|
|
|
{
|
|
|
|
event.type = GDK_FOCUS_CHANGE;
|
|
|
|
event.window = window->focus_widget->window;
|
|
|
|
event.in = FALSE;
|
|
|
|
|
|
|
|
gtk_widget_event (window->focus_widget, (GdkEvent*) &event);
|
|
|
|
}
|
|
|
|
|
|
|
|
window->focus_widget = focus;
|
|
|
|
|
|
|
|
if (window->focus_widget)
|
|
|
|
{
|
|
|
|
event.type = GDK_FOCUS_CHANGE;
|
|
|
|
event.window = window->focus_widget->window;
|
|
|
|
event.in = TRUE;
|
|
|
|
|
|
|
|
gtk_widget_event (window->focus_widget, (GdkEvent*) &event);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
1997-11-24 22:37:52 +00:00
|
|
|
static void
|
|
|
|
gtk_window_set_hints (GtkWidget *widget,
|
|
|
|
GtkRequisition *requisition)
|
|
|
|
{
|
|
|
|
GtkWindow *window;
|
|
|
|
GtkWidgetAuxInfo *aux_info;
|
|
|
|
gint flags;
|
|
|
|
gint ux, uy;
|
|
|
|
|
|
|
|
g_return_if_fail (widget != NULL);
|
|
|
|
g_return_if_fail (GTK_IS_WINDOW (widget));
|
|
|
|
g_return_if_fail (requisition != NULL);
|
|
|
|
|
|
|
|
if (GTK_WIDGET_REALIZED (widget))
|
|
|
|
{
|
|
|
|
window = GTK_WINDOW (widget);
|
|
|
|
|
|
|
|
flags = 0;
|
|
|
|
ux = 0;
|
|
|
|
uy = 0;
|
|
|
|
|
1998-02-02 14:11:24 +00:00
|
|
|
aux_info = gtk_object_get_data (GTK_OBJECT (widget), "gtk-aux-info");
|
1997-11-24 22:37:52 +00:00
|
|
|
if (aux_info && (aux_info->x != -1) && (aux_info->y != -1))
|
|
|
|
{
|
|
|
|
ux = aux_info->x;
|
|
|
|
uy = aux_info->y;
|
|
|
|
flags |= GDK_HINT_POS;
|
|
|
|
}
|
1998-04-07 23:59:25 +00:00
|
|
|
|
1997-11-24 22:37:52 +00:00
|
|
|
if (!window->allow_shrink)
|
|
|
|
flags |= GDK_HINT_MIN_SIZE;
|
|
|
|
if (!window->allow_grow)
|
|
|
|
flags |= GDK_HINT_MAX_SIZE;
|
|
|
|
|
|
|
|
gdk_window_set_hints (widget->window, ux, uy,
|
|
|
|
requisition->width, requisition->height,
|
|
|
|
requisition->width, requisition->height,
|
|
|
|
flags);
|
|
|
|
|
|
|
|
if (window->use_uposition && (flags & GDK_HINT_POS))
|
|
|
|
{
|
|
|
|
window->use_uposition = FALSE;
|
|
|
|
gdk_window_move (widget->window, ux, uy);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|