Commit 9775962a authored by Tim Janik's avatar Tim Janik Committed by Tim Janik

new file used as template for new file to define macros indicating newly

Sat May  9 02:34:41 1998  Tim Janik  <timj@gtk.org>

        * gtk/gtkfeatures.h.in: new file used as template for
        * gtk/gtkfeatures.h: new file to define macros indicating newly
        introduced features, such as GTK_HAVE_SIGNAL_INIT.

        * gtk/gtksignal.c:
        (gtk_signal_emitv_by_name):
        (gtk_signal_emitv):
        new functions to emit signals with an already provided parameter set.
        (provided by Kenneth Albanowski <kjahds@kjahds.com>).
        (gtk_signal_real_emit): prototype changes, so this functions always
        gets its parameters and signal structure as arguments.
        (gtk_signal_emit): provide the signal structure and parameter list for
        gtk_signal_real_emit.
        (gtk_signal_emit_by_name): likewise.
parent 142c8483
Sat May 9 02:34:41 1998 Tim Janik <timj@gtk.org>
* gtk/gtkfeatures.h.in: new file used as template for
* gtk/gtkfeatures.h: new file to define macros indicating newly
introduced features, such as GTK_HAVE_SIGNAL_INIT.
* gtk/gtksignal.c:
(gtk_signal_emitv_by_name):
(gtk_signal_emitv):
new functions to emit signals with an already provided parameter set.
(provided by Kenneth Albanowski <kjahds@kjahds.com>).
(gtk_signal_real_emit): prototype changes, so this functions always
gets its parameters and signal structure as arguments.
(gtk_signal_emit): provide the signal structure and parameter list for
gtk_signal_real_emit.
(gtk_signal_emit_by_name): likewise.
Sat May 9 00:03:12 1998 Tim Janik <timj@gtk.org>
* gtk/gtksignal.c (gtk_signal_handler_unref): reflect the presence of
......
Sat May 9 02:34:41 1998 Tim Janik <timj@gtk.org>
* gtk/gtkfeatures.h.in: new file used as template for
* gtk/gtkfeatures.h: new file to define macros indicating newly
introduced features, such as GTK_HAVE_SIGNAL_INIT.
* gtk/gtksignal.c:
(gtk_signal_emitv_by_name):
(gtk_signal_emitv):
new functions to emit signals with an already provided parameter set.
(provided by Kenneth Albanowski <kjahds@kjahds.com>).
(gtk_signal_real_emit): prototype changes, so this functions always
gets its parameters and signal structure as arguments.
(gtk_signal_emit): provide the signal structure and parameter list for
gtk_signal_real_emit.
(gtk_signal_emit_by_name): likewise.
Sat May 9 00:03:12 1998 Tim Janik <timj@gtk.org>
* gtk/gtksignal.c (gtk_signal_handler_unref): reflect the presence of
......
Sat May 9 02:34:41 1998 Tim Janik <timj@gtk.org>
* gtk/gtkfeatures.h.in: new file used as template for
* gtk/gtkfeatures.h: new file to define macros indicating newly
introduced features, such as GTK_HAVE_SIGNAL_INIT.
* gtk/gtksignal.c:
(gtk_signal_emitv_by_name):
(gtk_signal_emitv):
new functions to emit signals with an already provided parameter set.
(provided by Kenneth Albanowski <kjahds@kjahds.com>).
(gtk_signal_real_emit): prototype changes, so this functions always
gets its parameters and signal structure as arguments.
(gtk_signal_emit): provide the signal structure and parameter list for
gtk_signal_real_emit.
(gtk_signal_emit_by_name): likewise.
Sat May 9 00:03:12 1998 Tim Janik <timj@gtk.org>
* gtk/gtksignal.c (gtk_signal_handler_unref): reflect the presence of
......
Sat May 9 02:34:41 1998 Tim Janik <timj@gtk.org>
* gtk/gtkfeatures.h.in: new file used as template for
* gtk/gtkfeatures.h: new file to define macros indicating newly
introduced features, such as GTK_HAVE_SIGNAL_INIT.
* gtk/gtksignal.c:
(gtk_signal_emitv_by_name):
(gtk_signal_emitv):
new functions to emit signals with an already provided parameter set.
(provided by Kenneth Albanowski <kjahds@kjahds.com>).
(gtk_signal_real_emit): prototype changes, so this functions always
gets its parameters and signal structure as arguments.
(gtk_signal_emit): provide the signal structure and parameter list for
gtk_signal_real_emit.
(gtk_signal_emit_by_name): likewise.
Sat May 9 00:03:12 1998 Tim Janik <timj@gtk.org>
* gtk/gtksignal.c (gtk_signal_handler_unref): reflect the presence of
......
Sat May 9 02:34:41 1998 Tim Janik <timj@gtk.org>
* gtk/gtkfeatures.h.in: new file used as template for
* gtk/gtkfeatures.h: new file to define macros indicating newly
introduced features, such as GTK_HAVE_SIGNAL_INIT.
* gtk/gtksignal.c:
(gtk_signal_emitv_by_name):
(gtk_signal_emitv):
new functions to emit signals with an already provided parameter set.
(provided by Kenneth Albanowski <kjahds@kjahds.com>).
(gtk_signal_real_emit): prototype changes, so this functions always
gets its parameters and signal structure as arguments.
(gtk_signal_emit): provide the signal structure and parameter list for
gtk_signal_real_emit.
(gtk_signal_emit_by_name): likewise.
Sat May 9 00:03:12 1998 Tim Janik <timj@gtk.org>
* gtk/gtksignal.c (gtk_signal_handler_unref): reflect the presence of
......
Sat May 9 02:34:41 1998 Tim Janik <timj@gtk.org>
* gtk/gtkfeatures.h.in: new file used as template for
* gtk/gtkfeatures.h: new file to define macros indicating newly
introduced features, such as GTK_HAVE_SIGNAL_INIT.
* gtk/gtksignal.c:
(gtk_signal_emitv_by_name):
(gtk_signal_emitv):
new functions to emit signals with an already provided parameter set.
(provided by Kenneth Albanowski <kjahds@kjahds.com>).
(gtk_signal_real_emit): prototype changes, so this functions always
gets its parameters and signal structure as arguments.
(gtk_signal_emit): provide the signal structure and parameter list for
gtk_signal_real_emit.
(gtk_signal_emit_by_name): likewise.
Sat May 9 00:03:12 1998 Tim Janik <timj@gtk.org>
* gtk/gtksignal.c (gtk_signal_handler_unref): reflect the presence of
......
Sat May 9 02:34:41 1998 Tim Janik <timj@gtk.org>
* gtk/gtkfeatures.h.in: new file used as template for
* gtk/gtkfeatures.h: new file to define macros indicating newly
introduced features, such as GTK_HAVE_SIGNAL_INIT.
* gtk/gtksignal.c:
(gtk_signal_emitv_by_name):
(gtk_signal_emitv):
new functions to emit signals with an already provided parameter set.
(provided by Kenneth Albanowski <kjahds@kjahds.com>).
(gtk_signal_real_emit): prototype changes, so this functions always
gets its parameters and signal structure as arguments.
(gtk_signal_emit): provide the signal structure and parameter list for
gtk_signal_real_emit.
(gtk_signal_emit_by_name): likewise.
Sat May 9 00:03:12 1998 Tim Janik <timj@gtk.org>
* gtk/gtksignal.c (gtk_signal_handler_unref): reflect the presence of
......
......@@ -21,6 +21,10 @@
#undef HAVE_SHAPE_EXT
#undef HAVE_SYS_SELECT_H
/* some systems do not allow to ipcrm pages prior to
* actual usage, namely: OSF1 V3.2, SunOS 4.1.1, 5.5, 5.5.1, 5.6,
* IRIX 5.2 and 6.2.
*/
#undef IPC_RMID_DEFERRED_RELEASE
#undef NO_FD_SET
......@@ -31,11 +35,6 @@
#undef XINPUT_GXI
#undef XINPUT_XFREE
#undef GTK_MAJOR_VERSION
#undef GTK_MINOR_VERSION
#undef GTK_MICRO_VERSION
#undef GTK_VERSION
/* Define as the return type of signal handlers (int or void). */
#undef RETSIGTYPE
......
......@@ -18,6 +18,9 @@ GTK_MICRO_VERSION=0
GTK_INTERFACE_AGE=0
GTK_BINARY_AGE=0
GTK_VERSION=$GTK_MAJOR_VERSION.$GTK_MINOR_VERSION.$GTK_MICRO_VERSION
AC_SUBST(GTK_MAJOR_VERSION)
AC_SUBST(GTK_MINOR_VERSION)
AC_SUBST(GTK_MICRO_VERSION)
AC_SUBST(GTK_VERSION)
# libtool versioning
......@@ -106,11 +109,6 @@ if test "x$enable_xim" = "xyes"; then
CFLAGS="$CFLAGS -DUSE_XIM"
fi
AC_DEFINE_UNQUOTED(GTK_MAJOR_VERSION, $GTK_MAJOR_VERSION)
AC_DEFINE_UNQUOTED(GTK_MINOR_VERSION, $GTK_MINOR_VERSION)
AC_DEFINE_UNQUOTED(GTK_MICRO_VERSION, $GTK_MICRO_VERSION)
AC_DEFINE_UNQUOTED(GTK_VERSION, "$GTK_VERSION")
# Find the X11 include and library directories
AC_PATH_X
AC_PATH_XTRA
......@@ -296,5 +294,11 @@ if test $gtk_ok = no; then
AC_DEFINE(NO_FD_SET)
fi
AC_OUTPUT([Makefile gtk-config docs/Makefile gdk/Makefile gtk/Makefile],
[chmod +x gtk-config])
AC_OUTPUT([
Makefile
gtk-config
docs/Makefile
gdk/Makefile
gtk/Makefile
gtk/gtkfeatures.h
], [chmod +x gtk-config])
......@@ -124,6 +124,7 @@ gtkinclude_HEADERS = \
gtkentry.h \
gtkenums.h \
gtkeventbox.h \
gtkfeatures.h \
gtkfilesel.h \
gtkfixed.h \
gtkframe.h \
......@@ -207,6 +208,7 @@ EXTRA_DIST = \
testgtkrc \
testgtkrc2 \
gtk.defs \
gtkfeatures.h.in \
runelisp \
gentypeinfo.el \
gtktypebuiltins.c \
......
......@@ -45,6 +45,7 @@
#include <gtk/gtkentry.h>
#include <gtk/gtkenums.h>
#include <gtk/gtkeventbox.h>
#include <gtk/gtkfeatures.h>
#include <gtk/gtkfilesel.h>
#include <gtk/gtkfixed.h>
#include <gtk/gtkframe.h>
......
/* 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
* License along with this library; if not, write to the
* Free Software Foundation, Inc., 59 Temple Place - Suite 330,
* Boston, MA 02111-1307, USA.
*/
#ifndef __GTK_FEATURES_H__
#define __GTK_FEATURES_H__
#ifdef __cplusplus
extern "C" {
#pragma }
#endif /* __cplusplus */
/* compile time version
*/
#define GTK_MAJOR_VERSION (1)
#define GTK_MINOR_VERSION (1)
#define GTK_MICRO_VERSION (0)
/* new functions gtk_container_set_focus_vadjustment() and
* gtk_container_set_focus_hadjustment().
*/
#define GTK_HAVE_CONTAINER_FOCUS_ADJUSTMENTS 1-0-1
/* from now on we export the gtk_signal_init() function
*/
#define GTK_HAVE_SIGNAL_INIT 1-1-0
/* we have a new gtk_signal_emitv*() interface
*/
#define GTK_HAVE_SIGNAL_EMITV 1-1-0
/* "signal-name" is now an alias for "signal_name"
*/
#define GTK_HAVE_SIGNAL_LISP_SYNTAX 1-1-0
#ifdef __cplusplus
}
#endif /* __cplusplus */
#endif /* __GTK_FEATURES_H__ */
/* 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
* License along with this library; if not, write to the
* Free Software Foundation, Inc., 59 Temple Place - Suite 330,
* Boston, MA 02111-1307, USA.
*/
#ifndef __GTK_FEATURES_H__
#define __GTK_FEATURES_H__
#ifdef __cplusplus
extern "C" {
#pragma }
#endif /* __cplusplus */
/* compile time version
*/
#define GTK_MAJOR_VERSION (@GTK_MAJOR_VERSION@)
#define GTK_MINOR_VERSION (@GTK_MAJOR_VERSION@)
#define GTK_MICRO_VERSION (@GTK_MICRO_VERSION@)
/* new functions gtk_container_set_focus_vadjustment() and
* gtk_container_set_focus_hadjustment().
*/
#define GTK_HAVE_CONTAINER_FOCUS_ADJUSTMENTS 1-0-1
/* from now on we export the gtk_signal_init() function
*/
#define GTK_HAVE_SIGNAL_INIT 1-1-0
/* we have a new gtk_signal_emitv*() interface
*/
#define GTK_HAVE_SIGNAL_EMITV 1-1-0
/* "signal-name" is now an alias for "signal_name"
*/
#define GTK_HAVE_SIGNAL_LISP_SYNTAX 1-1-0
#ifdef __cplusplus
}
#endif /* __cplusplus */
#endif /* __GTK_FEATURES_H__ */
......@@ -21,6 +21,7 @@
#include <stdlib.h>
#include <string.h>
#include "gtkbutton.h"
#include "gtkfeatures.h"
#include "gtkhscrollbar.h"
#include "gtkhseparator.h"
#include "gtkmain.h"
......
......@@ -24,7 +24,7 @@
#define HANDLER_BLOCK_SIZE (200)
#define EMISSION_BLOCK_SIZE (100)
#define DISCONNECT_INFO_BLOCK_SIZE (64)
#define GTK_MAX_SIGNAL_PARAMS (32)
#define MAX_SIGNAL_PARAMS (32)
enum
{
......@@ -127,8 +127,8 @@ static void gtk_signal_handler_unref (GtkHandler *handler,
static void gtk_signal_handler_insert (GtkObject *object,
GtkHandler *handler);
static void gtk_signal_real_emit (GtkObject *object,
guint signal_type,
va_list args);
GtkSignal *signal,
GtkArg *params);
static GtkHandler* gtk_signal_get_handlers (GtkObject *object,
guint signal_type);
static guint gtk_signal_connect_by_type (GtkObject *object,
......@@ -274,7 +274,7 @@ gtk_signal_newv (const gchar *r_name,
g_return_val_if_fail (r_name != NULL, 0);
g_return_val_if_fail (marshaller != NULL, 0);
g_return_val_if_fail (nparams <= GTK_MAX_SIGNAL_PARAMS, 0);
g_return_val_if_fail (nparams <= MAX_SIGNAL_PARAMS, 0);
if (nparams)
g_return_val_if_fail (params != NULL, 0);
......@@ -355,7 +355,7 @@ gtk_signal_new (const gchar *name,
va_list args;
guint signal_id;
g_return_val_if_fail (nparams <= GTK_MAX_SIGNAL_PARAMS, 0);
g_return_val_if_fail (nparams <= MAX_SIGNAL_PARAMS, 0);
if (nparams > 0)
{
......@@ -456,21 +456,80 @@ gtk_signal_name (guint signal_id)
return NULL;
}
void
gtk_signal_emitv (GtkObject *object,
guint signal_id,
GtkArg *params)
{
GtkSignal *signal;
g_return_if_fail (object != NULL);
g_return_if_fail (signal_id >= 1);
g_return_if_fail (params != NULL);
signal = LOOKUP_SIGNAL_ID (signal_id);
g_return_if_fail (signal != NULL);
g_return_if_fail (gtk_type_is_a (GTK_OBJECT_TYPE (object), signal->object_type));
gtk_signal_real_emit (object, signal, params);
}
void
gtk_signal_emit (GtkObject *object,
guint signal_id,
guint signal_id,
...)
{
va_list args;
GtkSignal *signal;
va_list args;
GtkArg params[MAX_SIGNAL_PARAMS];
g_return_if_fail (object != NULL);
g_return_if_fail (signal_id >= 1);
signal = LOOKUP_SIGNAL_ID (signal_id);
g_return_if_fail (signal != NULL);
g_return_if_fail (gtk_type_is_a (GTK_OBJECT_TYPE (object), signal->object_type));
va_start (args, signal_id);
gtk_params_get (params,
signal->nparams,
signal->params,
signal->return_val,
args);
va_end (args);
gtk_signal_real_emit (object, signal, params);
}
void
gtk_signal_emitv_by_name (GtkObject *object,
const gchar *name,
GtkArg *params)
{
guint signal_id;
g_return_if_fail (object != NULL);
g_return_if_fail (name != NULL);
g_return_if_fail (params != NULL);
gtk_signal_real_emit (object, signal_id, args);
signal_id = gtk_signal_lookup (name, GTK_OBJECT_TYPE (object));
va_end (args);
if (signal_id >= 1)
{
GtkSignal *signal;
signal = LOOKUP_SIGNAL_ID (signal_id);
g_return_if_fail (signal != NULL);
g_return_if_fail (gtk_type_is_a (GTK_OBJECT_TYPE (object), signal->object_type));
gtk_signal_real_emit (object, signal, params);
}
else
{
g_warning ("gtk_signal_emitv_by_name(): could not find signal \"%s\" in the `%s' class ancestry",
name,
gtk_type_name (GTK_OBJECT_TYPE (object)));
}
}
void
......@@ -479,7 +538,6 @@ gtk_signal_emit_by_name (GtkObject *object,
...)
{
guint signal_id;
va_list args;
g_return_if_fail (object != NULL);
g_return_if_fail (name != NULL);
......@@ -488,11 +546,23 @@ gtk_signal_emit_by_name (GtkObject *object,
if (signal_id >= 1)
{
va_start (args, name);
gtk_signal_real_emit (object, signal_id, args);
GtkSignal *signal;
GtkArg params[MAX_SIGNAL_PARAMS];
va_list args;
signal = LOOKUP_SIGNAL_ID (signal_id);
g_return_if_fail (signal != NULL);
g_return_if_fail (gtk_type_is_a (GTK_OBJECT_TYPE (object), signal->object_type));
va_start (args, name);
gtk_params_get (params,
signal->nparams,
signal->params,
signal->return_val,
args);
va_end (args);
gtk_signal_real_emit (object, signal, params);
}
else
{
......@@ -1263,18 +1333,13 @@ gtk_signal_handler_insert (GtkObject *object,
static void
gtk_signal_real_emit (GtkObject *object,
guint signal_id,
va_list args)
GtkSignal *signal,
GtkArg *params)
{
GtkSignal *signal;
GtkHandler *handlers;
GtkHandlerInfo info;
guchar **signal_func_offset;
GtkArg params[GTK_MAX_SIGNAL_PARAMS];
signal = LOOKUP_SIGNAL_ID (signal_id);
g_return_if_fail (signal != NULL);
g_return_if_fail (gtk_type_is_a (GTK_OBJECT_TYPE (object), signal->object_type));
register guint signal_id = signal->signal_id;
if ((signal->run_type & GTK_RUN_NO_RECURSE) &&
gtk_emission_check (current_emissions, object, signal_id))
......@@ -1283,12 +1348,9 @@ gtk_signal_real_emit (GtkObject *object,
return;
}
gtk_params_get (params, signal->nparams, signal->params,
signal->return_val, args);
gtk_emission_add (&current_emissions, object, signal_id);
gtk_object_ref (object);
gtk_emission_add (&current_emissions, object, signal_id);
emission_restart:
if (GTK_RUN_TYPE (signal->run_type) != GTK_RUN_LAST && signal->function_offset != 0)
......
......@@ -86,6 +86,12 @@ void gtk_signal_emit (GtkObject *object,
void gtk_signal_emit_by_name (GtkObject *object,
const gchar *name,
...);
void gtk_signal_emitv (GtkObject *object,
guint signal_id,
GtkArg *params);
void gtk_signal_emitv_by_name (GtkObject *object,
const gchar *name,
GtkArg *params);
guint gtk_signal_n_emissions (GtkObject *object,
guint signal_id);
guint gtk_signal_n_emissions_by_name (GtkObject *object,
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment