Compare commits

..

10 Commits

Author SHA1 Message Date
Owen Taylor
7fe1ef80e2 Don't worry about clipping of toplevel windows and their immediate
Thu Feb 24 23:58:21 2000  Owen Taylor  <otaylor@redhat.com>

	* gdk/x11/gdkgeometry-x11.c: Don't worry about clipping of
	toplevel windows and their immediate children by their parents,
	since the size of toplevel windows is out of our immediate
	control and we don't get any real benefit from trying to track
	this size for clipping.

	* gdk/gdkprivate.h (struct _GdkWindowPrivate) gdk/x11/gdkwindow-x11.c : Add a flag
	for input_only windows.

	* gdk/gdkwindow.c gdk/x11/gdkgeometry-x11.c: Use the above flag
	to fix some hacks and make sure that we don't try to set the
	background of input only windows.
2000-02-25 05:01:58 +00:00
Owen Taylor
aee7dfc971 Added long ChangeLog entry for changes in this branch 2000-02-25 03:53:54 +00:00
Owen Taylor
c433c6741d Added new files to branch 2000-02-24 21:31:01 +00:00
Owen Taylor
e94e49b0f7 Commit into branch prior to cleanups and ChangeLog writing 2000-02-24 21:29:10 +00:00
Owen Taylor
eaddaab242 Use gdk_drawable_get_depth instead of gdk_drawable_get_visual. Add some
Sat Feb 19 12:01:53 2000  Owen Taylor  <otaylor@redhat.com>

	* gdk/x11/gdkdrawable-x11.c (gdk_x11_draw_drawable):
	Use gdk_drawable_get_depth instead of gdk_drawable_get_visual.
	Add some more detailed checking.

	* gdk/gdkdraw.c gdk/gdkdrawable.h (gdk_drawable_get_depth):
	New function to retrieve the depth of a drawable.

	* gdk/gdkprivate.h (struct _GdkDrawablePrivate): Add a depth
	field, reorder fields to save memory.
2000-02-19 17:28:41 +00:00
Owen Taylor
f1590246cc Merges of recent stuff from head 2000-02-17 15:50:22 +00:00
Owen Taylor
a1c3579ddd Draw a small portion of the background image instead of scaling the
Mon Dec 13 14:06:03 1999  Owen Taylor  <otaylor@redhat.com>

	* gtk/gtkentry.c (gtk_entry_draw_cursor_on_drawable): Draw a small portion
	of the background image instead of scaling the background down to
	a line.
1999-12-13 20:07:28 +00:00
Owen Taylor
afa6fbd001 added missing file 1999-11-29 21:28:38 +00:00
Owen Taylor
eda0f4cfb5 Syncing weekend changes. Full ChangeLog when I commit to head.
Among other fixes, this adds proper offsetting of ts-origin,
changes the way paints are auto-added in GTK+, and has
some fixes to make-install.
1999-11-29 03:28:38 +00:00
Owen Taylor
0c60dc4ffd code to play with, no changelog, no log, no warranty 1999-11-24 19:51:00 +00:00
305 changed files with 13586 additions and 72950 deletions

1165
ChangeLog

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

View File

@@ -7,8 +7,8 @@ you got this package.
Simple install procedure
========================
% gzip -cd gtk+-1.2.7.tar.gz | tar xvf - # unpack the sources
% cd gtk+-1.2.7 # change to the toplevel directory
% gzip -cd gtk+-1.2.5.tar.gz | tar xvf - # unpack the sources
% cd gtk+-1.2.5 # change to the toplevel directory
% ./configure # run the `configure' script
% make # build GTK
[ Become root if necessary ]
@@ -118,7 +118,7 @@ You can compile GTK+ against a copy of GLIB that you have not
yet installed. To do this, give the --with-glib=DIR options
to ./configure. For instance:
./configure --with-glib=../glib-1.2.7
./configure --with-glib=../glib-1.2.5
This, however, will not work if you built GLIB with different
source and build directories.

View File

@@ -32,7 +32,7 @@ EXTRA_DIST = \
examples/buttons/buttons.c \
examples/buttons/info.xpm \
examples/calendar/Makefile \
examples/calendar/calendar.c \
examples/calendar/gcalendar.c \
examples/clist/Makefile \
examples/clist/clist.c \
examples/entry/Makefile \

8
README
View File

@@ -1,7 +1,7 @@
General Information
===================
This is GTK+ version 1.2.7. GTK+, which stands for the Gimp ToolKit,
This is GTK+ version 1.2.0. GTK+, which stands for the Gimp ToolKit,
is a library for creating graphical user interfaces for the X Window
System. It is designed to be small, efficient, and flexible. GTK+ is
written in C with a very object-oriented approach.
@@ -37,9 +37,9 @@ version number. This should be separated by a blank
line from the actual headers.
Package: gtk+
Version: 1.2.7
Version: 1.2.0
[ Please substitute 1.2.7 with the version of GTK+ that
[ Please substitute 1.2.0 with the version of GTK+ that
you have installed ]
Then describe the bug. Include:
@@ -82,7 +82,7 @@ From: yourname@your.address.org
Subject: handlebox test in testgtk is misnamed.
Package: gtk+
Version: 1.2.7
Version: 1.2.0
When I run gtk/testgtk, the button "handle box"
is misnamed. There are multiple handle boxes in

View File

@@ -1,154 +0,0 @@
Gtk port to nano-X
STATUS
Once upon a time I got a few apps working, then started merging
the new features added by Owen (32 bit sizes for windows and buffering).
Since then I haven't found the time to work on it:-/
TODO
Finish internal window manager abstraction or add proper support in nano-X.
Fix event polling.
Implement GdkImage, GdkRgb stuff.
Put generic region code in generic gdk and/or use the region code from nano-X.
Fix ugly automake stuff for make dist.
TODO in nano-X
We need to be able to clip and change the background of windows at runtime
for apps to not look so ugly!
Fonts: wait for better nano-X font implementation.
Properties on windows.
If you want to work on this port or get additional informnation, get in
touch with me.
To get the beast to compile you also need to apply the patch below
(any auto* wizard here?): the issue of having two gtk libraries in the
system needs to be addressed too, maybe use libgtk-x11-1.4.so and
libgtk-nanox-1.4.so ...
Paolo Molaro
lupus@linuxcare.com
Index: acconfig.h
===================================================================
RCS file: /cvs/gnome/gtk+/acconfig.h,v
retrieving revision 1.16
diff -u -r1.16 acconfig.h
--- acconfig.h 1999/03/20 00:52:29 1.16
+++ acconfig.h 2000/05/06 11:52:38
@@ -49,6 +49,8 @@
/* Most machines will be happy with int or void. IRIX requires '...' */
#undef SIGNAL_ARG_TYPE
+#undef USE_NANOX
+
/* #undef PACKAGE */
/* #undef VERSION */
Index: configure.in
===================================================================
RCS file: /cvs/gnome/gtk+/configure.in,v
retrieving revision 1.142
diff -u -r1.142 configure.in
--- configure.in 2000/05/04 00:29:46 1.142
+++ configure.in 2000/05/06 11:52:38
@@ -99,6 +99,8 @@
AC_ARG_WITH(locale, [ --with-locale=LOCALE locale name you want to use ])
AC_ARG_WITH(xinput, [ --with-xinput=[no/gxi/xfree] support XInput ])
+AC_ARG_ENABLE(nanox, [ --enable-nanox use nano-X instead of X11 [default=no]],
+ , enable_nanox="no")
if test "x$enable_debug" = "xyes"; then
test "$cflags_set" = set || CFLAGS="$CFLAGS -g"
@@ -322,6 +324,8 @@
saved_cflags="$CFLAGS"
saved_ldflags="$LDFLAGS"
+if text "x$enable_nanox" = "xno"; then
+
CFLAGS="$CFLAGS $X_CFLAGS"
LDFLAGS="$LDFLAGS $X_LDFLAGS $X_LIBS"
@@ -465,6 +469,13 @@
GTK_LOCALE_FLAGS="-DX_LOCALE"
fi
+else
+AC_CHECK_LIB(nano-X, GrOpen)
+LIBS="-lnano-X $LIBS"
+ AC_DEFINE(USE_NANOX)
+AM_CONDITIONAL(USE_NANOX, test x$enable_nanox = xyes)
+fi # if enable_nanox
+
# Checks for header files.
AC_HEADER_STDC
@@ -602,8 +613,13 @@
esac
],[
# Currently we always use X11 on those systems where we run configure...
+if test x$enable_nanox = xno; then
gdk_windowing='
#define GDK_WINDOWING_X11'
+else
+gdk_windowing='
+#define GDK_WINDOWING_NANOX'
+fi
if test x$gdk_wchar_h = xyes; then
gdk_wc='
#define GDK_HAVE_WCHAR_H 1'
@@ -629,6 +645,7 @@
docs/Makefile
gdk/Makefile
gdk/x11/Makefile
+gdk/nanox/Makefile
gdk/win32/Makefile
gtk/Makefile
gtk/gtkfeatures.h
Index: gdk/Makefile.am
===================================================================
RCS file: /cvs/gnome/gtk+/gdk/Makefile.am,v
retrieving revision 1.41
diff -u -r1.41 Makefile.am
--- gdk/Makefile.am 2000/04/05 04:11:10 1.41
+++ gdk/Makefile.am 2000/05/06 11:52:38
@@ -1,6 +1,10 @@
## Makefile.am for gtk+/gdk
+if USE_NANOX
+SUBDIRS=win32 nanox
+else
SUBDIRS=x11 win32
+endif
EXTRA_DIST = \
gdkconfig.h.win32 \
@@ -36,8 +40,13 @@
-lm \
@STRIP_END@
+if USE_NANOX
libgdk_la_LIBADD = \
+ nanox/libgdk-nanox.la
+else
+libgdk_la_LIBADD = \
x11/libgdk-x11.la
+endif
#
# setup source file variables
@@ -138,3 +147,8 @@
@files=`ls $(DISTFILES) 2> /dev/null `; for p in $$files; do \
echo $$p; \
done
+
+noinst_PROGRAMS = simple
+simple_DEPENDENCIES = libgdk.la simple.c
+simple_LDADD = libgdk.la
+

View File

@@ -3,18 +3,12 @@ correct as the Unix/X11 version. For more information about the Win32
port, see http://www.gimp.org/tml/gimp/win32/ or
http://www.iki.fi/tml/gimp/win32/ .
The current (CVS) version of the Win32 backend is *not* as stable as it
was before the no-flicker branch was merged. A zipfile with that
version is available from http://www.gimp.org/win32/. That should be
use by "production" code until this CVS version is usable. (But note,
the Win32 backend has never been claimed to be "production quality".)
To build GTk+ on Win32, you need either the Microsoft compiler and
tools, or gcc-2.95 or later. The mingw setup of gcc is preferred, but
you can run gcc also under cygwin-b20.1 or later. Compile in
gdk\win32, gdk and gtk with `nmake -f makefile.msc` or `make -f
makefile.cygwin`. The name makefile.cygwin is misleading, it should
really be called makefile.mingw.
tools, or gcc-2.95 or later running under cygwin-b20.1 or
later. Compile in gdk\win32 and gtk with `nmake -f makefile.msc` or
`make -f makefile.cygwin`. Before doing a install, check the BIN
definition in gdk\win32\makefile.msc (or makefile.cygwin) and
gtk\makefile.msc (or makefile.cygwin).
See the README.win32 file in the GLib distribution for instructions
how to build with gcc.
@@ -40,6 +34,6 @@ config.h.win32 file, and remove references to the gnu-intl library
from the makefiles.
Note that while the GNU gettext package is under the GPL, the "intl"
part of it which is distributed with GNU libc is under the LGPL (like
GTk+ or GLib). We want the LGPL one, even if they are the same, more
or less.
part of it as distributed with GNU libc is under the LGPL (like GTk+
or GLib). We want the LGPL one, even if they are the same, more or
less.

2
TODO
View File

@@ -185,7 +185,7 @@ DND
- Use a cursor instead of an ICON when over Motif windows,
to get rid of the current junk that Motif leaves because
of its XCopyArea stupidity for doing highlighting.
of it's XCopyArea stupidity for doing highlighting.
- Add a GTK_DRAG_VERIFY target flag and a "drag_data_verify"
signal so that apps can easily check if a, say,

739
TODO.xml
View File

@@ -1,739 +0,0 @@
<!-- This is used to generate the online TODO list for GTK+ using
the script docs/make-todo. Whenever a change to this file is
committed to CVS,the file is run through make-todo and the online
version updated. If you modify this file, you should check for
parse errors by running:
$ docs/make-todo TODO.xml > /dev/null
before committing, or you may screw up the online version -->
<todo logourl="gtk-logo-rgb.gif">
<title>GTK+ TODO list</title>
<section>
<title>GDK</title>
<entry size="medium" status="70%" target="1.4">
<title>Add backing store support</title>
<description>
<p>
GTK+'s drawing model involves clearing to a background, and
then drawing widgets on top of this. Without having
backing-store support, this results in flickering in various
situations. Backing store cannot be added widget-by-widget,
because the drawing in a particular window is not confined
to a single widget. Instead it needs to be added per GDK
window.
</p>
<p>
The way this is done is by having
<tt>gdk_window_begin_paint()</tt>
and <tt>gdk_window_end_paint()</tt> functions that
redirect all drawing to a particular window to an offscreen
pixmap, and then copy that offscreen pixmap back onto the
screen when the paint operation is done. The implementation
of this is mostly complete in the <tt>gtk-no-flicker</tt> branch of
GTK+.
</p>
</description>
<url>http://www.gtk.org/~otaylor/gtk/1.4/gdk-drawing.html</url>
<contact>Owen Taylor &lt;otaylor@redhat.com&gt;</contact>
</entry>
<entry size="medium" status="70%" target="1.4">
<title>32 Bit Coordinates</title>
<description>
<p>
GTK+-1.2 and earlier share X's limitation on the
size of coordinates and restrict all dimensions
to 16 bit quantities. By clever use of X it is
possible to lift this restriction and present a
full 32-bit space to the user.
</p>
<p>
There are some difficulties with performance in this
approach - mostly because scrolling can involve mapping and
unmapping lots of widgets, but in general, current
trials in this area seem to work pretty well.
</p>
</description>
<url>http://www.gtk.org/~otaylor/gtk/1.4/gdk-drawing.html</url>
<contact>Owen Taylor &lt;otaylor@redhat.com&gt;</contact>
</entry>
<entry size="small" status="0%" target="1.4">
<title>Customizable double-click timeout</title>
<description>
<p>
The current fixed double-click timeout in GTK+
is too small for some users. This needs to be
customizable
</p>
</description>
<contact>gtk-devel-list@gnome.org</contact>
<bugs>#3958</bugs>
</entry>
<entry size="small" status="0%" target="1.4">
<title>Make color handling more convenient</title>
<description>
<p>
Add some color convenience functions; such as a way to get an
allocated GdkColor from GdkRGB, and export functions from gtkstyle.c
that lighten/darken a given color, and set a color from HSV in
addition to RGB. Also, consider having static variables that contain
preallocated common colors (gdk_blue, gdk_red, etc.), the problem
being colormap issues.
</p>
</description>
<contact>gtk-devel-list@gnome.org</contact>
</entry>
<entry size="small" status="0%" target="1.4">
<title>Cursors</title>
<description>
<p>
Two tasks: 1) move the cursors in the cursor font that people actually
care about to the top of the gdkcursor.h header file, and put a nice
list of the 15 cursors people actually care about in the docs 2) if
the cursor font lacks some commonly-useful cursors (like magnifying
glass), add these cursors to gdkcursor.h and then emulate them in
gdk_cursor_new by transparently creating the cursor from a bitmap.
The list of Qt cursors is worth http://doc.trolltech.com/qcursor.html
looking at for this task.
</p>
</description>
<contact>gtk-devel-list@gnome.org</contact>
</entry>
<entry size="medium" status="0%" target="1.4">
<title>Make GdkRGB work on any visual</title>
<description>
<p>
GdkRGB should be able to render to an arbitrary visual
(i.e. the visual shouldn't be fixed at gdk_rgb_init()
time). This will break gdk_rgb_gc_set_foreground() and
friends, though.
</p>
</description>
<contact>gtk-devel-list@gnome.org</contact>
</entry>
</section> <!-- GDK -->
<section>
<title>Internationalization</title>
<entry size="big" status="70%" target="1.4">
<title>Integrate Pango</title>
<description>
<p>
The purpose of the Pango project is to provide a system for
layout and rendering of internationalized text. It handles
most of the issues necessary to
</p>
</description>
<url>http://www.pango.org</url>
<contact>gtk-i18n-list@redhat.com</contact>
</entry>
<entry size="medium" status="80%" target="1.4">
<title>Switch to using UTF-8</title>
<description>
<p>
This is closely related to Pango integration. Pango deals
with all strings in terms of UTF-8; by switching GTK+ over
to UTF-8 we make it considerably simpler for developers to
support multiple languages properly while still retaining
a large degree of compatibility with existing programs.
</p>
<p>
Some work has already been done on this as part of the Win32
port, since the Win32 port is currently using UTF-8 for all
strings. In general, this should be an easy job; the hardest
parts are places like GtkFileSelection, cut and paste, and
input method support where there is interaction between GTK+
and the operating system.
</p>
</description>
<contact>gtk-i18n-list@redhat.com</contact>
</entry>
<entry size="big" status="40%" target="1.4">
<title>Rewrite Input Method Support</title>
<description>
<p>
Support for Input Methods is GTK+-1.2 is done via XIM, with
supported styles being over-the-spot and the root-window
styles. However, the over-the-spot style is not going to
work well with the Pango integration, since it relies on the
text rendering in the program being done in the standard
Xlib style, so it will be necessary to also support
on-the-spot input. On-the-spot input is done by supplying a
set of callbacks that are invoked by the input methods.
</p>
<p>
GTK+-1.4 will have a new system with loadable input method
modules. These modules can either be implemented using XIM,
or written from scratch.
</p>
</description>
<contact>gtk-i18n-list@redhat.com</contact>
</entry>
</section> <!-- i18n -->
<section>
<title>GTK+ Core</title>
<entry size="big" status="5%" target="1.4">
<title>GLib based object and type system</title>
<description>
<p>
The GTK+ object system is already in use in quite a few different
non-GUI applications; it would be desirable for these uses
to have the object and type systems separated from the GUI portions
of GTK+ and be generalized for non-GUI usage.
</p>
</description>
<contact>Tim Janik &lt;timj@gtk.org&gt;</contact>
</entry>
<entry size="big" status="1%" target="1.4">
<title>Overall callback improvements</title>
<description>
<p>
The GTK+ type and signal systems need significant improvements to
allow signal creation with default handlers from language bindings
and to aid language bindings in deriving new objects.
One aspect of this is the Closure support, recently suggested by
Karl Nelson &lt;kenelson@ece.ucdavis.edu&gt;, but this also
requires a GLib based type and parameter system (ties in with
"GLib based object and type system").
</p>
</description>
<contact>gtk-devel-list@gnome.org</contact>
</entry>
<entry size="big" status="0%" target="1.4">
<title>State change notification</title>
<description>
<p>
GTK+ objects emit various types of signals, some to perform
arbitrary actions, some to allow customization from user code,
and some signals are emitted to notify of certain changes
of an object. For the latter, what really is required is a
gneneric signal that can be used to monitor *any* kind of object
changes. For that, all object changes need to be routed through
a central point (otherwise the signal emissions are spread all
over the object implementation), i.e. an object argument setter.
The state change notification signal doesn't need to be emitted
syncronously, in fact, it's probably most effective to always
emit this asynchronously, so subsequent changes are accumulated.
</p>
</description>
<contact>Tim Janik &lt;timj@gtk.org&gt;</contact>
</entry>
<entry size="big" status="5%" target="1.4">
<title>Widget as sensitivity/grab state machine</title>
<description>
<p>
Maintenance of pointer and keybnoard grabs is currently very
tedious and error-prone, most widget's cook up their own stuff
in this regard.
By moving the general concept of "Grabs" to the GTK+ level as
a widget state, and providing a new signal for alterations of
a widget's state ("visible", "visible+insensitive",
"visible+grab", "hidden", "hidden+insensitive", etc.), things
can be unified and more stabelize. A couple of bugs, such as
insensitive widgets still holding a grab, or buttons that
still think they are depressed when hidden, will be squeezed
automatically with that.
</p>
</description>
<contact>Tim Janik &lt;timj@gtk.org&gt;</contact>
</entry>
<entry size="big" status="0%" target="1.4">
<title>Allow argument customization</title>
<description>
<p>
Many types of object arguments (expander style in the CList,
default padding in button boxes, etc), conceptually go with
the theme, or as user preferences; they should not be set by
a particular program.
</p>
<p>
There needs to be a mechanism for themes to be able to
control these arguments from the RC file.
</p>
</description>
</entry>
<entry size="medium" status="0%" target="1.4">
<title>Allow global customization</title>
<description>
<p>
There are a number of global parameters in GTK+ and GDK that should be
customizable by the user, such as the double-click timeout,
or whether widgets should be backing-stored by default.
</p>
<p>
If we had argument customization from an RC file, it might
be possible to do this simply with a global object with
arguments for the various global parameters that was
customized in the same fashion as object arguments.
</p>
</description>
</entry>
<entry size="small" status="0%" target="1.4">
<title>Gtk+ Modules installation directory</title>
<description>
<p>
Gtk+ needs to support an extra lib/ directory, to search
for dynamically loadable modules, it also needs to support
an environment variable to specify module search paths.
This has quite some cross-platform issues with the GModule
code (especially on AIX).
</p>
</description>
<contact>gtk-devel-list@gnome.org</contact>
</entry>
<entry size="small" status="0%" target="1.4">
<title>Convenient widget setup</title>
<description>
<p>
Make it simpler to set all the basic attributes of a widget. Might
want set_tooltip(), set_accel(), set_color(FOREGROUND, color),
set_min_size() (usize does this, but needs a rename), set_whatsthis(),
etc. set_accel() may not work for all widgets, may need a convenience
API for button and label accelerators specifically.
</p>
<p>
The idea is that it should be easy, out of the box, to set up a widget
with all the nice touches and features the widget really should
have. Users shouldn't need to do their own convenience functions for
this.
</p>
</description>
<contact>gtk-devel-list@gnome.org</contact>
</entry>
<entry size="medium" status="0%" target="> 1.4">
<title>Make selections/clipboard more convenient</title>
<description>
<p>
Make GtkSelectionData more like the MIME blobs in Swing and Qt.
Consider a GtkClipboard object to simplify cut-and-paste handling.
</p>
</description>
<contact>gtk-devel-list@gnome.org</contact>
</entry>
<entry size="small" status="50%" target="1.4">
<title>Stock label/icon system</title>
<description>
<p>
A system like GnomeStock for getting a standard labels/icons
for menus and toolbars. Should be extensible by themes, and
by libgnomeui. Some work already done on this.
</p>
</description>
<contact>hp@redhat.com</contact>
</entry>
<entry size="big" status="0%" target="> 1.4">
<title>Session Management</title>
<description>
<p>
Look in to session management. Consider whether to use
X11R6 SM, or some custom spec shared with KDE. Create
GTK+ API for this.
</p>
</description>
<contact>gtk-devel-list@gnome.org</contact>
</entry>
<entry size="big" status="0%" target="> 1.4">
<title>Online help enhancements</title>
<description>
<p>
Look at a small "What's This" popup widget,
and a What's This system in general (this part
could maybe be done for 1.4). A more difficult, probably
a post-1.4 task, is to integrate a very simple little
help browser gizmo into GTK.
</p>
</description>
<contact>gtk-devel-list@gnome.org</contact>
</entry>
<entry size="medium" status="0%" target="1.4">
<title>GUI-editable means of user configuration</title>
<description>
<p>
Need to be able to set double click time, whether cursors
blink, etc., from a control panel type of deal.
</p>
</description>
<contact>gtk-devel-list@gnome.org</contact>
</entry>
</section> <!-- Core -->
<section>
<title>GTK+ Widgets</title>
<entry size="small" status="50%" target="1.4">
<title>Make GtkFrame use a label</title>
<description>
<p>
The title of a frame should simply be another child widget
which, by default, holds a label widget. This will important
with Pango where proper text behavior will be more complex to
implement, but is also useful for certain user-interface
designs. (It can be useful, for example, to put a checkbutton
in that slot.)
</p>
</description>
<contact>gtk-devel-list@gnome.org</contact>
</entry>
<entry size="big" status="75%" target="1.4">
<title>Replace GtkText Widget</title>
<description>
<p>
The GtkText widget is badly in need of replacement, since it
is buggy and insufficiently feature rich. This is being done
using Havoc Pennington's port of the Tk Text widget.
</p>
<p>
As part of this job <a href="http://www.pango.org">Pango</a>
support is being added to the replacement. The structure of
the Tk text widget port is suited to this as it works
paragraph-by-paragraph, and Pango works at a sub-paragraph
scale. The main remaining tasks here are to implement
incremental reflow to make performance acceptable and to
implement embedded pixmaps and widgets.
</p>
</description>
<contact>gtk-devel-list@gnome.org</contact>
</entry>
<entry size="small" status="0%" target="1.4">
<title>Improve Radio/Checkbutton Look</title>
<description>
<p>
The default look for the radio and checkbuttons is both
unattractive and not friendly to the user . Motif did not
get this one right, and we should not keep on following the
Motif look. The right thing here is probably to copy the
Windows appearance for these controls fairly closely. This
will fit in with well with the rest of the GTK+ look.
</p>
</description>
<contact>gtk-devel-list@gnome.org</contact>
</entry>
<entry size="small" status="0%" target="1.4">
<title>Improve Submenu Navigation</title>
<description>
<p>
Navigating through a deep menu tree in GTK+ is currently
quite tricky, because as soon as one leaves a menu item,
the submenu disappears. The way that the Macintosh is
reputed to handle this is that to pop down the current
submenu, you have to leave the triangle defined by the
upper left hand corner of the menu item and right
side of the submenu.
</p>
</description>
<contact>gtk-devel-list@gnome.org</contact>
</entry>
<entry size="small" status="0%" target="1.4 ?">
<title>Improve Spinbutton Look</title>
<description>
<p>
Spinbuttons currently appear to have lumpy boundaries,
because sides of the arrows aren't at an angle that
meshes well with the pixel grid. However, fixing this
would require making the spinbuttons narrower and
harder to hit. This points out a general problem with
the spinbutton (and the arrows on the scrollbars) - the
target area for clicks actually the bounding box of the
arrows, but the user thinks that they must click on the
arrows themselves. It would probably be more friendly
to use a square button with an arrow drawn on top instead
of a arrow-shaped button, the approach taken by most other
windowing systems.
</p>
</description>
<contact>gtk-devel-list@gnome.org</contact>
</entry>
<entry size="big" status="90%" target="1.4">
<title>Supply horizontable/vertical wrapping boxes</title>
<description>
<p>
An often requested feature are wrapping containers, at this
point, gimp's development version already uses such widgets:
horizontable/vertical wrap boxes, that need to go into 1.4
proper at some point.
</p>
</description>
<contact>Tim Janik &lt;timj@gtk.org&gt;</contact>
</entry>
<entry size="medium" status="90%" target="1.4">
<title>Improved generic combo support</title>
<description>
<p>
Gtk+'s combo box has several drawbacks in design and
implementation. An new attempt at providing the combo box
functionality with improved flexibility has been made with
the GtkClueHunter widget, sitting in the CVS module "gle".
</p>
</description>
<contact>Tim Janik &lt;timj@gtk.org&gt;</contact>
</entry>
<entry size="big" status="0%" target="> 1.4">
<title>Add unified set of List/Tree/Grid widgets</title>
<description>
<p>
Currently, GTK+ has a large number of list and tree widgets
(GtkList, GtkTree, GtkCList, GtkCTree), none of which are
ideal. The GtkList and GtkTree widgets perform badly on large
number of items. (GtkTree widget is also quite buggy.) GtkCList
and GtkCTree mostly solve the size problem, but are quite
complex and, despite that, not very flexible. They are limited to
displaying pixmaps and text, and can neither support arbitrary
widgets nor custom drawing functions.
</p>
<p>
In addition to list and tree widgets, a closely related need
is a sheet widget that displays a (possibly editable) 2-D grid.
It would be desirable to have a complete set of widgets that
could be presented as the one-true-solution for these needs.
Model/View techniques could be used effectively to increase
both the simplicity and power of the interfaces.
</p>
</description>
<contact>gtk-devel-list@gnome.org</contact>
</entry>
<entry size="small" status="0%" target="1.4">
<title>GtkPixbuf</title>
<description>
<p>
gdk-pixbuf is moving to become a GTK+ dependency, a new image-display
widget is thus needed.
</p>
</description>
<contact>hp@redhat.com</contact>
</entry>
<entry size="small" status="0%" target="1.4">
<title>Attempt to fix GtkStatusbar</title>
<description>
<p>
GtkStatusbar is too inconvenient to use.
The only non-breakage-inducing fix we could
come up with is to permit 0 as a context ID, so you
don't have to use gtk_statusbar_get_context_id().
</p>
</description>
<contact>gtk-devel-list@gnome.org</contact>
</entry>
<entry size="small" status="95%" target="1.4">
<title>Decruft GtkProgress, GtkProgressbar</title>
<description>
<p>UPDATE: this is done, just need to apply the patch.
</p>
<p>
This interface is just a disaster of overcomplexity;
it should pretty much just be set_percentage(),
pulse() (to move during activity mode), and set_text().
There's no reason that there are two objects, should
just be one interface. Almost all the functions
that currently exist should be deprecated.
</p>
</description>
<contact>hp@redhat.com</contact>
</entry>
<entry size="small" status="0%" target="1.4">
<title>Entry validation hooks</title>
<description>
<p>
Simple hooks for validation in a GtkEntry. Pretty much just a
"validate" callback which takes a string (current entry contents) and
returns either VALID, INVALID, or COULDBEVALID. Then the
GtkEntry calls this function if it's set, and does the appropriate
UI things. GTK should come with validators for int and float,
see GtkSpinButton where these are already implemented.
</p>
</description>
<contact>gtk-devel-list@gnome.org</contact>
</entry>
<entry size="big" status="0%" target="> 1.4">
<title>pseudo-MDI Widget</title>
<description>
<p>
Add a widget that lets you rearrange various views (similar to many
IDEs, like Visual SlickEdit or JBuilder). Basically there should be a
central slot and 4 slots around the sides; each slot holds one or more
views. If two views are dropped in the same slot, then a notebook is
created displaying both views. If a view is dropped outside the
application window, it becomes a standalone window. It should be
possible to restrict whether a view can be dropped on the sides,
horizontal/vertical sides only, in the central content area, or in
any of those places.
</p>
<p>
(Havoc has a proposed interface for this, mail hp@redhat.com)
</p>
</description>
<contact>gtk-devel-list@gnome.org</contact>
</entry>
<entry size="medium" status="0%" target="> 1.4">
<title>Icon List Widget</title>
<description>
<p>
A simple icon list widget, suitable for creating a file selector or
the like.
</p>
</description>
<contact>gtk-devel-list@gnome.org</contact>
</entry>
<entry size="medium" status="0%" target="> 1.4">
<title>Dock widget</title>
<description>
<p>
Add a widget like GnomeDock (perhaps based on GnomeDock)
that allows people to put rearrangeable toolbars, menubars, etc.
around a central content area. The widget should have hooks for
saving the current positions of the various docked bars.
</p>
</description>
<contact>gtk-devel-list@gnome.org</contact>
</entry>
<entry size="big" status="0%" target="> 1.4">
<title>Canvas widget</title>
<description>
<p>
Figure out how to get GnomeCanvas or a derived work into GTK+ itself.
</p>
</description>
<contact>gtk-devel-list@gnome.org</contact>
</entry>
<entry size="medium" status="0%" target="1.4">
<title>Menu scroll</title>
<description>
<p>
When menus are bigger than the screen, allow scrolling
as on the Mac.
</p>
</description>
<contact>gtk-devel-list@gnome.org</contact>
</entry>
<entry size="medium" status="0%" target="1.4">
<title>Toolbar/menubar wrap</title>
<description>
<p>
When toolbars and menubars are too wide, do some sort of
wrapping or drop-down deal. (See Windows/Mac apps for examples.)
</p>
</description>
<contact>gtk-devel-list@gnome.org</contact>
</entry>
<entry size="small" status="0%" target="1.4">
<title>Blink cursor in GtkEntry</title>
<description>
<p>
Make the cursor optionally blink in GtkEntry. Beware, the entry code
is somewhat in flux; mail Owen and ask.
</p>
</description>
<contact>otaylor@redhat.com</contact>
</entry>
<entry size="small" status="100%" target="1.4">
<title>Don't highlight first menu item when menus come up</title>
<description>
<p>
Keep GtkMenu from prelighting the first menu item.
</p>
</description>
<contact>gtk-devel-list@gnome.org</contact>
</entry>
<entry size="small" status="95%" target="1.4">
<title>Integrate new color selector</title>
<description>
<p>
There's a new color selector in CVS (module gnome-colorsel),
it needs to be folded in to GTK and any remaining issues resolved.
(This new selector is API-compatible with the old one, and
still called GtkColorSelector).
</p>
</description>
<contact>gtk-devel-list@gnome.org</contact>
</entry>
<entry size="medium" status="0%" target="1.4">
<title>Write new font selector</title>
<description>
<p>
Pango introduces a new font handling system,
replacing the XLFD system. Need a font selector for this.
The XLFD selector should probably remain, for apps where
it makes sense (like gnome-terminal probably).
</p>
</description>
<contact>gtk-devel-list@gnome.org</contact>
</entry>
<entry size="small" status="0%" target="1.4">
<title>Stack Widget</title>
<description>
<p>
Jonathan has a widget like a tabless/frameless notebook, used for
something like the GNOME control center where you want to toggle which
widget is visible to the user. Needs to be cleaned up and considered
for GTK.
</p>
</description>
<contact>gtk-devel-list@gnome.org, jrb@redhat.com</contact>
</entry>
<entry size="small" status="0%" target="1.4">
<title>Clean up GtkNotebook</title>
<description>
<p>
GtkNotebook currently breaks GTK invariants about
mapping/visibility/etc., needs fixing.
</p>
</description>
<contact>gtk-devel-list@gnome.org</contact>
</entry>
</section> <!-- GTK+ -->
</todo>

View File

@@ -34,7 +34,7 @@ LD="$LD" LDFLAGS="$LDFLAGS" LIBS="$LIBS" \
LN_S="$LN_S" NM="$NM" RANLIB="$RANLIB" \
DLLTOOL="$DLLTOOL" AS="$AS" OBJDUMP="$OBJDUMP" \
${CONFIG_SHELL-/bin/sh} $ac_aux_dir/ltconfig --no-reexec \
$libtool_flags --no-verify $ac_aux_dir/ltmain.sh $lt_target \
$libtool_flags --no-verify $ac_aux_dir/ltmain.sh $host \
|| AC_MSG_ERROR([libtool configure failed])
# Reload cache, that may have been modified by ltconfig
@@ -66,11 +66,6 @@ AC_REQUIRE([AC_PROG_NM])dnl
AC_REQUIRE([AC_PROG_LN_S])dnl
dnl
case "$target" in
NONE) lt_target="$host" ;;
*) lt_target="$target" ;;
esac
# Check for any special flags to pass to ltconfig.
libtool_flags="--cache-file=$cache_file"
test "$enable_shared" = no && libtool_flags="$libtool_flags --disable-shared"
@@ -89,7 +84,7 @@ test x"$silent" = xyes && libtool_flags="$libtool_flags --silent"
# Some flags need to be propagated to the compiler or linker for good
# libtool support.
case "$lt_target" in
case "$host" in
*-*-irix6*)
# Find out which ABI we are using.
echo '[#]line __oline__ "configure"' > conftest.$ac_ext
@@ -305,6 +300,7 @@ else
AC_MSG_RESULT(no)
fi
test -z "$LD" && AC_MSG_ERROR([no acceptable ld found in \$PATH])
AC_SUBST(LD)
AC_PROG_LD_GNU
])
@@ -350,13 +346,14 @@ else
fi])
NM="$ac_cv_path_NM"
AC_MSG_RESULT([$NM])
AC_SUBST(NM)
])
# AC_CHECK_LIBM - check for math library
AC_DEFUN(AC_CHECK_LIBM,
[AC_REQUIRE([AC_CANONICAL_HOST])dnl
LIBM=
case "$lt_target" in
case "$host" in
*-*-beos* | *-*-cygwin*)
# These system don't have libm
;;
@@ -490,10 +487,6 @@ AC_DEFUN(AM_GTK_WITH_NLS,
gt_cv_func_dgettext_libintl=no)])
fi
if test "$gt_cv_func_dgettext_libintl" = "yes"; then
LIBS="$LIBS -lintl";
fi
if test "$gt_cv_func_dgettext_libc" = "yes" \
|| test "$gt_cv_func_dgettext_libintl" = "yes"; then
AC_DEFINE(HAVE_GETTEXT)

94
config.guess vendored
View File

@@ -24,7 +24,7 @@
# Written by Per Bothner <bothner@cygnus.com>.
# The master version of this file is at the FSF in /home/gd/gnu/lib.
# Please send patches to <autoconf-patches@gnu.org>.
# Please send patches to the Autoconf mailing list <autoconf@gnu.org>.
#
# This script attempts to guess a canonical system name similar to
# config.sub. If it succeeds, it prints the system name on stdout, and
@@ -156,9 +156,6 @@ EOF
wgrisc:OpenBSD:*:*)
echo mipsel-unknown-openbsd${UNAME_RELEASE}
exit 0 ;;
*:OS/390:*:*)
echo i370-ibm-openedition
exit 0 ;;
arm:RISC*:1.[012]*:*|arm:riscix:1.[012]*:*)
echo arm-acorn-riscix${UNAME_RELEASE}
exit 0;;
@@ -331,18 +328,15 @@ EOF
AViiON:dgux:*:*)
# DG/UX returns AViiON for all architectures
UNAME_PROCESSOR=`/usr/bin/uname -p`
if [ $UNAME_PROCESSOR = mc88100 ] || [ $UNAME_PROCESSOR = mc88110]
then
if [ ${TARGET_BINARY_INTERFACE}x = m88kdguxelfx ] || \
[ ${TARGET_BINARY_INTERFACE}x = x ]
then
if [ $UNAME_PROCESSOR = mc88100 -o $UNAME_PROCESSOR = mc88110 ] ; then
if [ ${TARGET_BINARY_INTERFACE}x = m88kdguxelfx \
-o ${TARGET_BINARY_INTERFACE}x = x ] ; then
echo m88k-dg-dgux${UNAME_RELEASE}
else
echo m88k-dg-dguxbcs${UNAME_RELEASE}
fi
else
echo i586-dg-dgux${UNAME_RELEASE}
echo m88k-dg-dguxbcs${UNAME_RELEASE}
fi
else echo i586-dg-dgux${UNAME_RELEASE}
fi
exit 0 ;;
M88*:DolphinOS:*:*) # DolphinOS (SVR3)
echo m88k-dolphin-sysv3
@@ -459,7 +453,7 @@ EOF
exit (0);
}
EOF
(CCOPTS= $CC_FOR_BUILD $dummy.c -o $dummy 2>/dev/null ) && HP_ARCH=`./$dummy`
($CC_FOR_BUILD $dummy.c -o $dummy 2>/dev/null ) && HP_ARCH=`./$dummy`
rm -f $dummy.c $dummy
esac
HPUX_REV=`echo ${UNAME_RELEASE}|sed -e 's/[^.]*.[0B]*//'`
@@ -556,7 +550,7 @@ EOF
echo t90-cray-unicos${UNAME_RELEASE}
exit 0 ;;
CRAY*T3E:*:*:*)
echo alpha-cray-unicosmk${UNAME_RELEASE}
echo t3e-cray-unicosmk${UNAME_RELEASE}
exit 0 ;;
CRAY-2:*:*:*)
echo cray2-cray-unicos
@@ -594,7 +588,7 @@ EOF
echo ${UNAME_MACHINE}-unknown-freebsd`echo ${UNAME_RELEASE}|sed -e 's/[-(].*//'`
exit 0 ;;
*:NetBSD:*:*)
echo ${UNAME_MACHINE}-unknown-netbsd`echo ${UNAME_RELEASE}|sed -e 's/[-_].*//'`
echo ${UNAME_MACHINE}-unknown-netbsd`echo ${UNAME_RELEASE}|sed -e 's/[-_].*/\./'`
exit 0 ;;
*:OpenBSD:*:*)
echo ${UNAME_MACHINE}-unknown-openbsd`echo ${UNAME_RELEASE}|sed -e 's/[-_].*/\./'`
@@ -624,6 +618,12 @@ EOF
echo `echo ${UNAME_MACHINE}|sed -e 's,[-/].*$,,'`-unknown-gnu`echo ${UNAME_RELEASE}|sed -e 's,/.*$,,'`
exit 0 ;;
*:Linux:*:*)
# uname on the ARM produces all sorts of strangeness, and we need to
# filter it out.
case "$UNAME_MACHINE" in
armv*) UNAME_MACHINE=$UNAME_MACHINE ;;
arm* | sa110*) UNAME_MACHINE="arm" ;;
esac
# The BFD linker knows what the default object file format is, so
# first see if it will tell us. cd to the root directory to prevent
@@ -636,38 +636,11 @@ EOF
s/ .*//
p'`
case "$ld_supported_emulations" in
*ia64)
echo "${UNAME_MACHINE}-unknown-linux"
exit 0
;;
i?86linux)
echo "${UNAME_MACHINE}-pc-linux-gnuaout"
exit 0
;;
i?86coff)
echo "${UNAME_MACHINE}-pc-linux-gnucoff"
exit 0
;;
sparclinux)
echo "${UNAME_MACHINE}-unknown-linux-gnuaout"
exit 0
;;
armlinux)
echo "${UNAME_MACHINE}-unknown-linux-gnuaout"
exit 0
;;
elf32arm*)
echo "${UNAME_MACHINE}-unknown-linux-gnu"
exit 0
;;
armelf_linux*)
echo "${UNAME_MACHINE}-unknown-linux-gnu"
exit 0
;;
m68klinux)
echo "${UNAME_MACHINE}-unknown-linux-gnuaout"
exit 0
;;
i?86linux) echo "${UNAME_MACHINE}-pc-linux-gnuaout" ; exit 0 ;;
i?86coff) echo "${UNAME_MACHINE}-pc-linux-gnucoff" ; exit 0 ;;
sparclinux) echo "${UNAME_MACHINE}-unknown-linux-gnuaout" ; exit 0 ;;
armlinux) echo "${UNAME_MACHINE}-unknown-linux-gnuaout" ; exit 0 ;;
m68klinux) echo "${UNAME_MACHINE}-unknown-linux-gnuaout" ; exit 0 ;;
elf32ppc)
# Determine Lib Version
cat >$dummy.c <<EOF
@@ -697,9 +670,7 @@ EOF
fi
fi
rm -f $dummy.c $dummy
echo powerpc-unknown-linux-gnu${LIBC}
exit 0
;;
echo powerpc-unknown-linux-gnu${LIBC} ; exit 0 ;;
esac
if test "${UNAME_MACHINE}" = "alpha" ; then
@@ -826,21 +797,19 @@ EOF
echo ${UNAME_MACHINE}-pc-sysv4.2uw${UNAME_VERSION}
exit 0 ;;
i?86:*:4.*:* | i?86:SYSTEM_V:4.*:*)
UNAME_REL=`echo ${UNAME_RELEASE} | sed 's/\/MP$//'`
if grep Novell /usr/include/link.h >/dev/null 2>/dev/null; then
echo ${UNAME_MACHINE}-univel-sysv${UNAME_REL}
echo ${UNAME_MACHINE}-univel-sysv${UNAME_RELEASE}
else
echo ${UNAME_MACHINE}-pc-sysv${UNAME_REL}
echo ${UNAME_MACHINE}-pc-sysv${UNAME_RELEASE}
fi
exit 0 ;;
i?86:*:5:7*)
# Fixed at (any) Pentium or better
UNAME_MACHINE=i586
if [ ${UNAME_SYSTEM} = "UnixWare" ] ; then
echo ${UNAME_MACHINE}-sco-sysv${UNAME_RELEASE}uw${UNAME_VERSION}
else
echo ${UNAME_MACHINE}-pc-sysv${UNAME_RELEASE}
fi
UNAME_REL=`(/bin/uname -X|egrep Release|sed -e 's/.*= //')`
(/bin/uname -X|egrep i80486 >/dev/null) && UNAME_MACHINE=i486
(/bin/uname -X|egrep '^Machine.*Pentium' >/dev/null) && UNAME_MACHINE=i586
(/bin/uname -X|egrep '^Machine.*Pent.*II' >/dev/null) && UNAME_MACHINE=i686
(/bin/uname -X|egrep '^Machine.*Pentium Pro' >/dev/null) && UNAME_MACHINE=i585
echo ${UNAME_MACHINE}-${UNAME_SYSTEM}${UNAME_VERSION}-sysv${UNAME_RELEASE}
exit 0 ;;
i?86:*:3.2:*)
if test -f /usr/options/cb.name; then
@@ -974,9 +943,6 @@ EOF
*:Rhapsody:*:*)
echo ${UNAME_MACHINE}-apple-rhapsody${UNAME_RELEASE}
exit 0 ;;
*:QNX:*:4*)
echo i386-qnx-qnx${UNAME_VERSION}
exit 0 ;;
esac
#echo '(No uname command or uname output not recognized.)' 1>&2

45
config.sub vendored
View File

@@ -105,7 +105,7 @@ case $os in
-scout)
;;
-wrs)
os=-vxworks
os=vxworks
basic_machine=$1
;;
-hiux*)
@@ -156,17 +156,13 @@ case $os in
-psos*)
os=-psos
;;
-mint | -mint[0-9]*)
basic_machine=m68k-atari
os=-mint
;;
esac
# Decode aliases for certain CPU-COMPANY combinations.
case $basic_machine in
# Recognize the basic CPU types without company name.
# Some are omitted here because they have special meanings below.
tahoe | i860 | ia64 | m32r | m68k | m68000 | m88k | ns32k | arc | arm \
tahoe | i860 | m32r | m68k | m68000 | m88k | ns32k | arc | arm \
| arme[lb] | pyramid | mn10200 | mn10300 | tron | a29k \
| 580 | i960 | h8300 \
| hppa | hppa1.0 | hppa1.1 | hppa2.0 | hppa2.0w | hppa2.0n \
@@ -175,12 +171,12 @@ case $basic_machine in
| 1750a | dsp16xx | pdp11 | mips16 | mips64 | mipsel | mips64el \
| mips64orion | mips64orionel | mipstx39 | mipstx39el \
| mips64vr4300 | mips64vr4300el | mips64vr4100 | mips64vr4100el \
| mips64vr5000 | miprs64vr5000el | mcore \
| mips64vr5000 | miprs64vr5000el \
| sparc | sparclet | sparclite | sparc64 | sparcv9 | v850 | c4x \
| thumb | d10v | fr30)
| thumb | d10v)
basic_machine=$basic_machine-unknown
;;
m88110 | m680[12346]0 | m683?2 | m68360 | m5200 | z8k | v70 | h8500 | w65 | pj | pjl)
m88110 | m680[12346]0 | m683?2 | m68360 | m5200 | z8k | v70 | h8500 | w65)
;;
# We use `pc' rather than `unknown'
@@ -195,8 +191,7 @@ case $basic_machine in
exit 1
;;
# Recognize the basic CPU types with company name.
# FIXME: clean up the formatting here.
vax-* | tahoe-* | i[34567]86-* | i860-* | ia64-* | m32r-* | m68k-* | m68000-* \
vax-* | tahoe-* | i[34567]86-* | i860-* | m32r-* | m68k-* | m68000-* \
| m88k-* | sparc-* | ns32k-* | fx80-* | arc-* | arm-* | c[123]* \
| mips-* | pyramid-* | tron-* | a29k-* | romp-* | rs6000-* \
| power-* | none-* | 580-* | cray2-* | h8300-* | h8500-* | i960-* \
@@ -209,10 +204,10 @@ case $basic_machine in
| sparc64-* | sparcv9-* | sparc86x-* | mips16-* | mips64-* | mipsel-* \
| mips64el-* | mips64orion-* | mips64orionel-* \
| mips64vr4100-* | mips64vr4100el-* | mips64vr4300-* | mips64vr4300el-* \
| mipstx39-* | mipstx39el-* | mcore-* \
| mipstx39-* | mipstx39el-* \
| f301-* | armv*-* | t3e-* \
| m88110-* | m680[01234]0-* | m683?2-* | m68360-* | z8k-* | d10v-* \
| thumb-* | v850-* | d30v-* | tic30-* | c30-* | fr30-* )
| thumb-* | v850-* | d30v-* | tic30-* | c30-* )
;;
# Recognize the various machine names and aliases which stand
# for a CPU type and a company and sometimes even an OS.
@@ -430,6 +425,7 @@ case $basic_machine in
;;
i370-ibm* | ibm*)
basic_machine=i370-ibm
os=-mvs
;;
# I'm not sure what "Sysv32" means. Should this be sysv3.2?
i[34567]86v32)
@@ -464,9 +460,6 @@ case $basic_machine in
basic_machine=i386-unknown
os=-mingw32
;;
i386-qnx | qnx)
basic_machine=i386-qnx
;;
iris | iris4d)
basic_machine=mips-sgi
case $os in
@@ -495,7 +488,7 @@ case $basic_machine in
miniframe)
basic_machine=m68000-convergent
;;
*mint | -mint[0-9]* | *MiNT | *MiNT[0-9]*)
*mint | *MiNT)
basic_machine=m68k-atari
os=-mint
;;
@@ -521,10 +514,6 @@ case $basic_machine in
basic_machine=i386-unknown
os=-msdos
;;
mvs)
basic_machine=i370-ibm
os=-mvs
;;
ncr3000)
basic_machine=i486-ncr
os=-sysv4
@@ -534,7 +523,7 @@ case $basic_machine in
os=-netbsd
;;
netwinder)
basic_machine=armv4l-rebel
basic_machine=armv4l-corel
os=-linux
;;
news | news700 | news800 | news900)
@@ -918,7 +907,7 @@ case $os in
| -udi* | -eabi* | -lites* | -ieee* | -go32* | -aux* \
| -cygwin* | -pe* | -psos* | -moss* | -proelf* | -rtems* \
| -mingw32* | -linux-gnu* | -uxpv* | -beos* | -mpeix* | -udk* \
| -interix* | -uwin* | -rhapsody* | -opened* | -openstep* | -oskit*)
| -interix* | -uwin* | -rhapsody* | -openstep* | -oskit*)
# Remember, each alternative MUST END IN *, to match a version number.
;;
-sim | -es1800* | -hms* | -xray | -os68k* | -none* | -v88r* \
@@ -937,9 +926,6 @@ case $os in
-sunos6*)
os=`echo $os | sed -e 's|sunos6|solaris3|'`
;;
-opened*)
os=-openedition
;;
-osfrose*)
os=-osfrose
;;
@@ -977,9 +963,6 @@ case $os in
-oss*)
os=-sysv3
;;
-qnx)
os=-qnx4
;;
-svr4)
os=-sysv4
;;
@@ -1029,7 +1012,7 @@ case $basic_machine in
*-acorn)
os=-riscix1.2
;;
arm*-rebel)
arm*-corel)
os=-linux
;;
arm*-semi)
@@ -1203,7 +1186,7 @@ case $basic_machine in
-genix*)
vendor=ns
;;
-mvs* | -opened*)
-mvs*)
vendor=ibm
;;
-ptx*)

View File

@@ -171,19 +171,17 @@ AC_MSG_CHECKING(whether make is GNU Make)
STRIP_BEGIN=
STRIP_END=
if $ac_make --version 2>/dev/null | grep '^GNU Make ' >/dev/null ; then
STRIP_BEGIN='$(strip $(STRIP_DUMMY)'
STRIP_BEGIN='$(strip'
STRIP_END=')'
AC_MSG_RESULT(yes)
else
AC_MSG_RESULT(no)
fi
STRIP_DUMMY=
AC_SUBST(STRIP_DUMMY)
AC_SUBST(STRIP_BEGIN)
AC_SUBST(STRIP_END)
# i18n stuff
ALL_LINGUAS="ca cs da de el es et eu fi fr ga gl hr hu it ja ko lt nl no pl pt pt_BR ro ru sk sl sv tr uk wa zh_TW.Big5 zh_CN.GB2312"
ALL_LINGUAS="ca cs da de el es et eu fi fr ga gl hr hu it ja ko lt nl no pl pt pt_BR ru sk sl sv tr uk wa zh_TW.Big5 zh_CN.GB2312"
AM_GTK_GNU_GETTEXT
LIBS="$LIBS $INTLLIBS"
@@ -252,16 +250,16 @@ fi
if test x$with_glib = x ; then
# Look for separately installed glib
AM_PATH_GLIB(1.3.1,,
AM_PATH_GLIB(1.3.0,,
AC_MSG_ERROR([
*** GLIB 1.3.0 or better is required. The latest version of GLIB
*** is always available from ftp://ftp.gtk.org/.]),
gobject gmodule gthread)
gmodule gthread)
# we do not want to make all gtk progs to link to thread libraries.
glib_cflags=`$GLIB_CONFIG glib gobject gmodule --cflags`
glib_cflags=`$GLIB_CONFIG glib gmodule --cflags`
glib_thread_cflags="$GLIB_CFLAGS"
glib_libs=`$GLIB_CONFIG glib gobject gmodule --libs`
glib_libs=`$GLIB_CONFIG glib gmodule --libs`
glib_thread_libs="$GLIB_LIBS"
GLIB_LIBS="$glib_libs"
GLIB_DEPLIBS="$glib_libs"

View File

@@ -1,108 +1,11 @@
Incompatible Changes from GTK+-1.2 to GTK+-1.4:
* The gdk_time* functions have been removed. This functionality
- The gdk_time* functions have been removed. This functionality
has been unused since the main loop was moved into GLib
prior to 1.2.
* The signature for GtkPrintFunc (used for gtk_item_factory_dump_items)
- The signature for GtkPrintFunc (used for gtk_item_factory_dump_items)
has been changed to take a 'const gchar *' instead of 'gchar *', to
match what we do for glib, and other similar cases.
* The detail arguments in the GtkStyleClass structure are now 'const gchar *'.
* gtk_paned_set_gutter_size() has been removed, since the small handle tab
has been changed to include the entire area previously occupied by
the gutter.
* GDK no longer selects OwnerGrabButtonMask for button presses. This means
that the automatic grab that occurs when the user presses a button
will have owner_events = FALSE, so all events are redirected to the
grab window, even events that would normally go to other windows of the
window's owner.
* GtkColorSelectionDialog has now been moved into it's own set of files,
gtkcolorseldialog.c and gtkcolorseldialog.h.
* gtk_widget_shape_combine_mask() now keeps a reference count on the
mask pixmap that is passed in.
* Type system changes:
- GTK_TYPE_OBJECT is not a fundamental type anymore. Type checks of the
style (GTK_FUNDAMENTAL_TYPE (some_type) == GTK_TYPE_OBJECT)
will not work anymore. As a replacement, (GTK_TYPE_IS_OBJECT (some_type))
can be used now.
- The following types vanished: GTK_TYPE_ARGS, GTK_TYPE_CALLBACK,
GTK_TYPE_C_CALLBACK, GTK_TYPE_FOREIGN. The corresponding GtkArg
fields and field access macros are also gone.
- The following type aliases vanished: GTK_TYPE_FLAT_FIRST,
GTK_TYPE_FLAT_LAST, GTK_TYPE_STRUCTURED_FIRST, GTK_TYPE_STRUCTURED_LAST.
- The type macros GTK_TYPE_MAKE() and GTK_TYPE_SEQNO() vanished, use of
GTK_FUNDAMENTAL_TYPE() is discouraged. Instead, the corresponding GType
API should be used: G_TYPE_FUNDAMENTAL(), G_TYPE_DERIVE_ID(),
G_TYPE_BRANCH_SEQNO(). Note that the GLib type system doesn't build new
type ids based on a global incremental sequential number anymore, but
numbers new type ids sequentially per fundamental type branch.
- The following type functions vanished/were replaced:
Old Function Replacement
gtk_type_query() - being investigated -
gtk_type_set_varargs_type() -
gtk_type_get_varargs_type() -
gtk_type_check_object_cast() g_type_check_instance_cast()
gtk_type_check_class_cast() g_type_check_class_cast()
gtk_type_describe_tree() -
gtk_type_describe_heritage() -
gtk_type_free() -
gtk_type_children_types() g_type_children()
gtk_type_set_chunk_alloc() GTypeInfo.n_preallocs
gtk_type_register_enum() g_enum_register_static()
gtk_type_register_flags() g_flags_register_static()
gtk_type_parent_class() g_type_parent() / g_type_class_peek_parent()
Use of g_type_class_ref() / g_type_class_unref() and g_type_class_peek()
is recommended over usage of gtk_type_class().
Use of g_type_register_static() / g_type_register_dynamic() is recommended
over usage of gtk_type_unique().
* Object system changes:
GtkObject derives from GObject, so is not the basic object type anymore.
This imposes the following source incompatible changes:
- GtkObject has no klass field anymore, an object's class can be retrived
with the object's coresponding GTK_<OBJECT>_GET_CLASS (object) macro.
- GtkObjectClass has no type field anymore, a class's type can be retrived
with the GTK_CLASS_TYPE (class) macro.
- GtkObjectClass does not introduce the finalize() and shutdown() methods
anymore. While shutdown() is intended for GTK+ internal use only, finalize()
is required by a variety of object implementations. GObjectClass.finalize
should be overriden here, e.g.:
static void gtk_label_finalize (GObject *gobject)
{
GtkLabel *label = GTK_LABEL (gobject);
G_OBJECT_CLASS (parent_class)->finalize (object);
}
static void gtk_label_class_init (GtkLabelClass *class)
{
GObjectClass *gobject_class = G_OBJECT_CLASS (class);
gobject_class->finalize = gtk_label_finalize;
}
- the GtkObject::destroy signal can now be emitted multiple times on an object.
::destroy implementations should check that make sure that they take this
into account, by checking to make sure that resources are there before
freeing them. For example:
if (object->foo_data)
{
g_free (object->foo_data);
object->foo_data = NULL;
}
Also, ::destroy implementations have to release object references that
the object holds. Code in finalize implementations such as:
if (object->adjustment)
{
gtk_object_unref (object->adjustment);
object->adjustment = NULL;
}
have to be moved into the ::destroy implementations. The reason for doing
this is that all object reference cycles should be broken at destruction
time.
- The detail arguments in the GtkStyleClass structure are now 'const gchar *'.

View File

@@ -1,338 +0,0 @@
The overall syntax is:
(type-of-thing-being-defined name-used-to-refer-to-this-thing
(attribute-name attribute-value-depending-on-the-attribute)
(attribute-name attribute-value-depending-on-the-attribute)
(attribute-name attribute-value-depending-on-the-attribute))
Some definitions can have a c-declaration field that gives the C code
we parsed to arrive at the definition. The c-declaration is a quoted
string because it can contain parentheses and such.
Defined types and their attributes:
===
(module module-name
(submodule-of module-name)) ;; submodule is optional
Ex: (module Gtk)
Ex: (module Rgb
(submodule-of Gdk))
modules are later referred to with a list of module names, like
(Gdk Rgb) or (Gtk)
Object and boxed type definitions automatically create a submodule.
For example, GtkCList creates the module (module CList (submodule-of
(Gtk))) which is referred to as module (Gtk CList).
===
(type
(alias some-unique-identifier)
(in-module module-name) ;; optional, gchar* is not in a module
(gtk-type-id gtk-type-system-id) ;; optional, absent if this is not
;; in the type system
(is-parametric boolean) ;; optional default to #f
(in-c-name name-of-symbol-in-C)
(out-c-name name-of-symbol-in-C)
(inout-c-name name-of-symbol-in-C))
Ex: (type
(alias string)
(gtk-type-id GTK_TYPE_STRING)
(in-c-name "const gchar*")
(out-c-name "gchar**") ;; actually I'm not sure how strings work out/inout
(inout-c-name "gchar*"))
(type
(alias list)
(gtk-type-id GTK_TYPE_POINTER)
(is-parametric #t)
(in-c-name "GList*")
(out-c-name "GList**")
(inout-c-name "GList**"))
;; This one would be implied by the (object) def for GtkWidget I
;; think - (type) is only required for types that are not implied
;; by other definitions, such as int/boolean/etc.
(type
(alias GtkWidget)
(in-module (Gtk))
(gtk-type-id GTK_TYPE_WIDGET)
(in-c-name "GtkWidget*")
(inout-c-name "GtkWidget*")
(out-c-name "GtkWidget**"))
"Type" bindings are automatically assumed for objects, boxed types,
etc. as defined below.
The alias field is used to refer to the type later on.
Whenever a type alias can be used, it is also possible to use the
keyword "native", which implies that the type in question is too
C-specific to represent. Then a c-declaration will typically be
available for use.
C types containing [] or () are function pointers or arrays. For
arrays that don't specify a size, we just treat them as pointers. For
function pointers, we need special (type) syntax/attributes of some
kind, but since there basically aren't any of these right now in the
libs we care about we can just ignore them. For arrays that specify a
size ditto, you would handle them by adding an (array-size) attribute
or something or using the "native" keyword and skipping the (type)
stuff.
===
(object object-name
(in-module module-name-list)
(parent object-name optional-module-name-if-different)
(abstract boolean-is-abstract-class) ;; omit for default of #f
(c-name name-of-the-object-in-C)
(field (type-and-name type-alias-of-struct-field name-of-struct-field)
(access read-or-write-or-readwrite)))
Ex: (object Widget
(in-module (Gtk))
(parent Object) ;; could say (parent Object (Gtk))
(abstract #t)
(c-name GtkWidget)
(field (type-and-name GdkWindow* window) (access read)))
An "object" declaration automatically implies the type definition:
(type
(alias concat-module-elements-and-object-name)
(in-c-name pointer-to-c-name)
(out-c-name pointer-to-pointer-to-c-name)
(inout-c-name pointer-to-c-name))
Ex:
(type (alias GtkWidget)
(in-c-name GtkWidget*)
(out-c-name GtkWidget**)
(inout-c-name GtkWidget*))
It also implies a module that is the name broken into parts:
(module CTree
(submodule-of Gtk))
===
(function function-name
(in-module module-name-list) ;; "static methods" go in their
;; object's module
(is-constructor-of object-type-alias) ;; optional, marks a constructor
(c-name function-name)
(return-type return-value-type) ;; defaults to void
(caller-owns-return boolean-value) ;; defaults to #f
(can-return-null boolean-value) ;; defaults to #t
(parameter in-or-out-or-inout
(type-and-name parameter-type-alias parameter-name)
(type-parameter name-of-contained-type) ;; optional, requires parametric type
(c-declaration "c-type-and-name")) ;; c-declaration only required
;; if the type alias is "native"
(varargs #t) ;; has varargs at the end
)
Ex:
(function init
(in-module (Gdk Rgb)
(c-name gdk_rgb_init)))
Ex:
(function new
(in-module (Gdk Rgb Cmap))
(is-constructor-of GdkRgbCmap)
(c-name gdk_rgb_cmap_new)
(return-type GdkRgbCmap)
(caller-owns-return #t) ;; perhaps this could be implied by is-constructor-of
(parameter in (type-and-name array-of-guint32 colors))
(parameter in (type-and-name gint n_colors)))
Ex:
(function config_set_set_handler
(in-module (Gnome))
(c-name gnome_config_set_set_handler)
(parameter in (type-and-name native func)
(c-declaration "void (*func)(void*)"))
(parameter in (type-and-name gpointer data)))
===
(method method-name
(of-object object-name module-name)
;; retval/arg attributes as for (function), but with first parameter
;; omitted for non-constructors
)
Ex:
(method set_text
(of-object Label (Gtk))
(parameter (type-and-name const-gchar* str)))
===
(object-argument arg-name
(of-object object-we-are-an-argument-of optional-objects-module)
(type-id argument-type) ;; GTK_TYPE_OBJECT etc.
;; flags all default to #f
(readable bool-value)
(writeable bool-value)
(construct-only bool-value))
Ex:
(object-argument label
(of-object Label (Gtk))
(type GTK_TYPE_STRING)
(readable #t)
(writeable #t))
===
(signal signal-name
(run-action bool-value)
(run-first bool-value)
(run-last bool-value)
(of-object object-we-are-a-signal-of optional-objects-module)
;; return value and parameters as for a function, omitting the object
;; and user data parameters
;; what other properties matter for a signal?
)
Ex:
(signal select_row
(of-object CList (Gtk))
(run-first #t)
;; return type defaults to void
(parameter in (type-and-name gint row))
(parameter in (type-and-name gint column))
(parameter in (type-and-name GdkEvent* event)))
===
(enum enum-name
(in-module modname)
(c-name name-in-c)
(value (nick value-name-noprefixes-hyphen-lowercase) (c-name value-c-name)))
Ex:
(enum DirectionType
(in-module Gtk)
(c-name GtkDirectionType)
(value (nick tab-forward) (c-name GTK_DIR_TAB_FORWARD))
(value (nick tab-backward) (c-name GTK_DIR_TAB_BACKWARD))
(value (nick up) (c-name GTK_DIR_UP))
(value (nick down) (c-name GTK_DIR_DOWN))
(value (nick left) (c-name GTK_DIR_LEFT))
(value (nick right) (c-name GTK_DIR_RIGHT)))
(enum Pos
(in-module (Gtk CTree))
(c-name GtkCTreePos)
(value (nick before) (c-name GTK_CTREE_POS_BEFORE))
(value (nick as-child) (c-name GTK_CTREE_POS_AS_CHILD))
(value (nick after) (c-name GTK_CTREE_POS_AFTER)))
===
(flags) is just like enum, but some bindings may wrap enums and flags differently.
===
(boxed boxed-name
(in-module modname)
(c-name c-name)
(ref-func func-to-increase-refcount)
(copy-func func-to-copy)
(release-func func-to-destroy-or-decrement-refcount)
(field (type-and-name type-alias-of-struct-field name-of-struct-field) (access access-rule)))
It is never OK to use memcpy() to copy a boxed type, or use
malloc()/free() to alloc/free one.
Ex:
(boxed Pixmap
(in-module (Gdk))
(c-name GdkPixmap)
(ref-func pixmap_ref)
(release-func pixmap_unref))
An "object" declaration automatically implies the type definition:
(type
(alias concat-module-elements-and-boxed-name)
(in-c-name pointer-to-c-name)
(out-c-name pointer-to-pointer-to-c-name)
(inout-c-name pointer-to-c-name))
Ex:
(type (alias GdkPixmap)
(in-c-name GdkPixmap*)
(out-c-name GdkPixmap**)
(inout-c-name GdkPixmap*))
===
(struct struct-name
(in-module modname)
(c-name c-name)
(field (type-and-name type-alias-of-struct-field name-of-struct-field) (access access-rule)))
Unlike a boxed type, a struct type can be copied with memcpy() and
allocated on the stack or with g_malloc().
Ex:
(struct Rectangle
(in-module (Gdk))
(c-name GdkRectangle)
(field (type-and-name gint16 x) (access readwrite))
(field (type-and-name gint16 y) (access readwrite))
(field (type-and-name guint16 width) (access readwrite))
(field (type-and-name guint16 height) (access readwrite)))
Implies GdkRectangle type alias:
(type (alias GdkRectangle)
(in-c-name GdkRectangle*)
(out-c-name GdkRectangle*) ;; note - not the same as boxed types
(inout-c-name GdkRectangle*))
===
(user-function name
(in-module module)
(c-name c-typedef-name)
;; return-type and parameters as for (function)
)
Ex:
(user-function PrintFunc
(in-module (Gtk))
(parameter in (type-and-name gpointer func_data))
(parameter in (type-and-name gchar* str)))
===
(typedef new-name
(in-module module)
(c-name c-full-name)
(orig-type alias-of-orig-type))
Ex:
(typedef Type
(in-module (Gtk))
(c-name GtkType)
(orig-type guint))

View File

@@ -1,103 +0,0 @@
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 3.2 Final//EN">
<HTML>
<HEAD>
<META NAME="GENERATOR" CONTENT="SGML-Tools 1.0.6">
<TITLE>GTK+ FAQ</TITLE>
<LINK HREF="gtkfaq-es-1.html" REL=next>
</HEAD>
<BODY BGCOLOR="#FFFFFF">
<A HREF="gtkfaq-es-1.html">Next</A>
Previous
Contents
<HR NOSHADE>
<H1>GTK+ FAQ</H1>
<H2>Nathan Froyd, Tony Gale, Shawn T. Amundson.</H2>Seis de Julio de 1998
<P><HR NOSHADE>
<EM>La intención de este documento es dar respuesta a las preguntas
realizadas con más frecuencia por parte de los programadores que utilizan GTK+ o simplemente por personas que desean utilizar GTK+. </EM>
<HR NOSHADE>
<P>
<H2><A NAME="toc1">1.</A> <A HREF="gtkfaq-es-1.html">Información General</A></H2>
<UL>
<LI><A HREF="gtkfaq-es-1.html#ss1.1">1.1 Autores</A>
<LI><A HREF="gtkfaq-es-1.html#ss1.2">1.2 ¿Qué es GTK+?</A>
<LI><A HREF="gtkfaq-es-1.html#ss1.3">1.3 ¿Qué es el + en GTK+?</A>
<LI><A HREF="gtkfaq-es-1.html#ss1.4">1.4 ¿La G en GTK+ significa General, Gimp, o GNU?</A>
<LI><A HREF="gtkfaq-es-1.html#ss1.5">1.5 ¿Dónde está la documentación para GTK?</A>
<LI><A HREF="gtkfaq-es-1.html#ss1.6">1.6 ¿Hay alguna lista de correo (o archivo de lista de correo) para GTK+?</A>
<LI><A HREF="gtkfaq-es-1.html#ss1.7">1.7 ¿La lista gtk-list no ha tenido tráfico alguno por días,</A>
<LI><A HREF="gtkfaq-es-1.html#ss1.8">1.8 Cómo conseguir ayuda con GTK+</A>
<LI><A HREF="gtkfaq-es-1.html#ss1.9">1.9 Cómo reportar errores en GTK+</A>
<LI><A HREF="gtkfaq-es-1.html#ss1.10">1.10 ¿Qué aplicaciones se han escrito con GTK+?</A>
<LI><A HREF="gtkfaq-es-1.html#ss1.11">1.11 Estoy buscando una aplicación que escribir en GTK+. ¿Qué tal un cliente IRC?</A>
</UL>
<P>
<H2><A NAME="toc2">2.</A> <A HREF="gtkfaq-es-2.html">Cómo encontrar, configurar, instalar y comprobar GTK+</A></H2>
<UL>
<LI><A HREF="gtkfaq-es-2.html#ss2.1">2.1 ¿Qué necesito para correr GTK+?</A>
<LI><A HREF="gtkfaq-es-2.html#ss2.2">2.2 ¿Dónde puedo conseguir GTK+?</A>
<LI><A HREF="gtkfaq-es-2.html#ss2.3">2.3 ¿Cómo configuro/compilo GTK+?</A>
<LI><A HREF="gtkfaq-es-2.html#ss2.4">2.4 Cuando compilo GTK+ obtengo un error como: <CODE>make: file `Makefile' line 456: Syntax error</CODE></A>
<LI><A HREF="gtkfaq-es-2.html#ss2.5">2.5 ¡He compilado e instalado GTK+, pero no puedo lograr que los programas se enlacen con él!</A>
<LI><A HREF="gtkfaq-es-2.html#ss2.6">2.6 Cuando compilo programas con GTK+, obtengo mensajes de error del compilador diciendo que no es capaz de encontrar <CODE>"glibconfig.h"</CODE>.</A>
<LI><A HREF="gtkfaq-es-2.html#ss2.7">2.7 Cuando instalo El GIMP, configure reporta que no puede encontrar GTK.</A>
</UL>
<P>
<H2><A NAME="toc3">3.</A> <A HREF="gtkfaq-es-3.html">Desarrollo de GTK+</A></H2>
<UL>
<LI><A HREF="gtkfaq-es-3.html#ss3.1">3.1 ¿Qué es esta cosa CVS de la cual todo el mundo habla, y cómo puedo acceder a ella?</A>
<LI><A HREF="gtkfaq-es-3.html#ss3.2">3.2 ¿Cómo puedo contribuír a GTK+?</A>
<LI><A HREF="gtkfaq-es-3.html#ss3.3">3.3 ¿Cómo averiguo si mi parche fue aplicado, y si no, por qué no?</A>
<LI><A HREF="gtkfaq-es-3.html#ss3.4">3.4 ¿Cuál es la política sobre la incorporación de nuevos <EM>widgets</EM> en la librería?</A>
<LI><A HREF="gtkfaq-es-3.html#ss3.5">3.5 ¿Hay alguien trabajando en atamientos para otros lenguajes distintos a C?</A>
</UL>
<P>
<H2><A NAME="toc4">4.</A> <A HREF="gtkfaq-es-4.html">Desarrollo con GTK+</A></H2>
<UL>
<LI><A HREF="gtkfaq-es-4.html#ss4.1">4.1 ¿Cómo empiezo?</A>
<LI><A HREF="gtkfaq-es-4.html#ss4.2">4.2 ¿Qué <EM>widgets</EM> existen en GTK?</A>
<LI><A HREF="gtkfaq-es-4.html#ss4.3">4.3 ¿GTK+ es seguro ante múltiples hilos?</A>
<LI><A HREF="gtkfaq-es-4.html#ss4.4">4.4 ¿Cómo puedo prevenir el redibujar y reacomodar tamaños mientras cambio múltiples <EM>widgets</EM>?</A>
<LI><A HREF="gtkfaq-es-4.html#ss4.5">4.5 ¿Cómo atrapo un evento de doble tecleo (en un <EM>widget</EM> de lista, por ejemplo)?</A>
<LI><A HREF="gtkfaq-es-4.html#ss4.6">4.6 ¿Cómo puedo averiguar cuál es la selección de un GtkList?</A>
<LI><A HREF="gtkfaq-es-4.html#ss4.7">4.7 ¿Acaso es posible desplegar un texto que se recorte para que quepa dentro del lugar que tenga asignado?</A>
<LI><A HREF="gtkfaq-es-4.html#ss4.8">4.8 ¿Por qué el contenido de un botón no se mueve al presionar el botón? Aquí les envío un parche para que funcione de esa forma...</A>
<LI><A HREF="gtkfaq-es-4.html#ss4.9">4.9 ¿Cómo puedo definir una línea de separación como en un menú?</A>
<LI><A HREF="gtkfaq-es-4.html#ss4.10">4.10 ¿Cómo puedo darle justificación a la derecha a un menú, como Help, cuando utilizo MenuFactory?</A>
<LI><A HREF="gtkfaq-es-4.html#ss4.11">4.11 ¿Cómo hago mi ventana modal? / ¿Cómo hago una sóla ventana activa?</A>
<LI><A HREF="gtkfaq-es-4.html#ss4.12">4.12 ¿Por qué mi <EM>widget</EM> (ej. progressbar) no se actualiza?</A>
</UL>
<P>
<H2><A NAME="toc5">5.</A> <A HREF="gtkfaq-es-5.html">Acerca de gdk</A></H2>
<UL>
<LI><A HREF="gtkfaq-es-5.html#ss5.1">5.1 ¿Qué es gdk?</A>
<LI><A HREF="gtkfaq-es-5.html#ss5.2">5.2 ¿Cómo utilizo la asignación de colores?</A>
</UL>
<P>
<H2><A NAME="toc6">6.</A> <A HREF="gtkfaq-es-6.html">Acerca de glib</A></H2>
<UL>
<LI><A HREF="gtkfaq-es-6.html#ss6.1">6.1 ¿Qué es glib?</A>
<LI><A HREF="gtkfaq-es-6.html#ss6.2">6.2 ¿Por qué utilizar g_print, g_malloc, g_strdup y funciones compañeras de glib?</A>
</UL>
<P>
<H2><A NAME="toc7">7.</A> <A HREF="gtkfaq-es-7.html">Contribuciones al GTK+ FAQ, Mantenedores y Copyright</A></H2>
<UL>
<LI><A HREF="gtkfaq-es-7.html#ss7.1">7.1 Nota del Traductor</A>
</UL>
<HR NOSHADE>
<A HREF="gtkfaq-es-1.html">Next</A>
Previous
Contents
</BODY>
</HTML>

View File

@@ -1,192 +0,0 @@
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 3.2 Final//EN">
<HTML>
<HEAD>
<META NAME="GENERATOR" CONTENT="SGML-Tools 1.0.6">
<TITLE>GTK+ FAQ: Información General</TITLE>
<LINK HREF="gtkfaq-es-2.html" REL=next>
<LINK HREF="gtkfaq-es.html#toc1" REL=contents>
</HEAD>
<BODY BGCOLOR="#FFFFFF">
<A HREF="gtkfaq-es-2.html">Next</A>
Previous
<A HREF="gtkfaq-es.html#toc1">Contents</A>
<HR NOSHADE>
<H2><A NAME="s1">1. Información General</A></H2>
<H2><A NAME="ss1.1">1.1 Autores</A>
</H2>
<P>Los autores de GTK+ son:
<P>
<UL>
<LI>Peter Mattis (petm@xcf.berkeley.edu)</LI>
<LI>Spencer Kimball (spencer@xcf.berkeley.edu)</LI>
<LI>Josh MacDonald (jmacd@xcf.berkeley.edu)</LI>
</UL>
GTK+ se ditribuye bajo la licencia de Librería Pública General de GNU
<P>
<H2><A NAME="ss1.2">1.2 ¿Qué es GTK+?</A>
</H2>
<P>GTK+ es un pequeño y eficiente conjunto de <EM>widgets</EM>, diseñados
con un aspecto y sentir general a Motif. Contiene <EM>widgets</EM> comúnes
y algúnos <EM>widgets</EM> más complejos como una selección de
archivos, y <EM>widgets</EM> de selección de colores.
<P>GTK+ proporciona algunas características únicas. (No tengo conocimiento
de otra librería de <EM>widge>
<HR><H3>Transfer interrupted!</H3>
enos).
Por ejemplo, un botón no contiene una etiqueta, contiene un <EM>widget</EM>
hijo, que en muchas instancias será una etiqueta. Sin embargo, el
<EM>widget</EM> hijo también puede ser un <EM>pixmap</EM> (mapa de pixels),
imagén o cualquier combinación posible que desee el programador. Toda la
librería es así de flexible.
<P>
<H2><A NAME="ss1.3">1.3 ¿Qué es el + en GTK+?</A>
</H2>
<P>Peter Mattis informó a la lista de correo gtk:
<BLOCKQUOTE>
"Escribí originalmente gtk el cual incluía tres librerías,
libglib, libgdk y libgtk. Era caracterizado por una jerarquía de
<EM>widget</EM> plana. O sea, no podías derivar un nuevo
<EM>widget</EM> de uno ya existente. Contenía un mecanismo de
<EM>callback</EM> (llamada) más estándar en lugar del mecanismo
de señales ahora presente en gtk+. El + fue agregado para distinguir
entre la versión original de gtk y la nueva versión. Pueden pensar
en ello como una ampliación al gtk original que agrega características
orientadas o objetos."
</BLOCKQUOTE>
<P>
<H2><A NAME="ss1.4">1.4 ¿La G en GTK+ significa General, Gimp, o GNU?</A>
</H2>
<P>Peter Mattis informó a la lista de correo gtk:
<BLOCKQUOTE>
"Pienso que la última vez que Spencer y yo hablamos al respecto nos
decidimos por GTK = Gimp ToolKit. Pero no estoy seguro. Sin embargo,
definitivamente no es GNU."
</BLOCKQUOTE>
<P>
<H2><A NAME="ss1.5">1.5 ¿Dónde está la documentación para GTK?</A>
</H2>
<P>
En el directorio doc/ de la distribución de GTK+ encontrarás
el material de referencia para GTK y GDK, este FAQ y el tutor de GTK.
<P>Adicionalmente, puedes encontrar enlaces a versiones HTML de estos
documentos al ir a
<A HREF="http://www.gtk.org/">http://www.gtk.org/</A>.
<P>El Tutor y el FAQ también se pueden encontrar en
<A HREF="http://www.geocities.com/ResearchTriangle/Lab/4299/">http://www.geocities.com/ResearchTriangle/Lab/4299/</A>.
<P>
<H2><A NAME="ss1.6">1.6 ¿Hay alguna lista de correo (o archivo de lista de correo) para GTK+?</A>
</H2>
<P>Hay dos listas de correo:
<UL>
<LI>Una lista de correo para la discusión del desarrollo de aplicaciones
basadas en GTK se hospeda en gtk-app-devel-list@redhat.com. Para suscribirse
envíe un correo electrónico a
<A HREF="mailto:gtk-app-devel-list-request@redhat.com">gtk-app-devel-list-request@redhat.com</A> con <EM>subscribe</EM> en el
campo <B>subject</B>.
<P>
</LI>
<LI>Una lista de correo para la discusión del desarrollo de GTK se hospeda
en gtk-list@redhat.com. Para suscribirse envíe un correo electrónico
a
<A HREF="mailto:gtk-list-request@redhat.com">gtk-list-request@redhat.com</A> con <EM>subscribe</EM>
en el campo <B>subject</B>.
<P>Un archivo escudriñable de la lista de correo puede ser encontrado en
<A HREF="http://archive.redhat.com/gtk-list">http://archive.redhat.com/gtk-list</A></LI>
</UL>
<H2><A NAME="ss1.7">1.7 ¿La lista gtk-list no ha tenido tráfico alguno por días,</A>
está muerta?</H2>
<P>No, todos están ocupados codificando.
<P>
<H2><A NAME="ss1.8">1.8 Cómo conseguir ayuda con GTK+</A>
</H2>
<P>Primero, asegúrate que tu pregunta no esté respondida en la
documentación, este FAQ o el tutor. ¿Hecho? ¿Estás seguro de que
lo has hecho, verdad? En ese caso, el mejor lugar para hacer preguntas es
la lista de correo de GTK+.
<P>
<H2><A NAME="ss1.9">1.9 Cómo reportar errores en GTK+</A>
</H2>
<P>Los reportes de errores se deben enviar a la lista de correo de GTK+.
<P>
<H2><A NAME="ss1.10">1.10 ¿Qué aplicaciones se han escrito con GTK+?</A>
</H2>
<P>Algunas aplicaciones que utilizan GTK+ son:
<UL>
<LI>GIMP (
<A HREF="http://www.XCF.Berkeley.EDU/~gimp/">http://www.XCF.Berkeley.EDU/~gimp/</A> ),
un programa de manipulación de imágenes</LI>
<LI>Gsumi (
<A HREF="http://www.msc.cornell.edu/~otaylor/gsumi/gsumi.html">http://www.msc.cornell.edu/~otaylor/gsumi/gsumi.html</A>),
un divertido programa para rayar en blanco y negro con soporte para
XInput.</LI>
<LI>GUBI (
<A HREF="http://www.SoftHome.net/pub/users/timj/gubi/index.htm">http://www.SoftHome.net/pub/users/timj/gubi/index.htm</A>),
un constructor de interface de usuario</LI>
<LI>Gzilla (
<A HREF="http://www.levien.com/gzilla/">http://www.levien.com/gzilla/</A>),
un navegador del web</LI>
<LI>SANE (
<A HREF="http://www.azstarnet.com/~axplinux/sane/">http://www.azstarnet.com/~axplinux/sane/</A> ),
una interface universal para <EM>scanner</EM></LI>
<LI>XQF (
<A HREF="http://www.botik.ru/~roma/quake/">http://www.botik.ru/~roma/quake/</A>),
un lanzador y navegador de servidores de QuakeWorld/Quake2</LI>
<LI>ElectricEyes (
<A HREF="http://www.labs.redhat.com/ee.shtml">http://www.labs.redhat.com/ee.shtml</A>),
un visor de imágenes que se dirige a ser un reemplazo libre de xv</LI>
<LI>GPK - the General Proxy Kit (
<A HREF="http://www.humanfactor.com/gpk/">http://www.humanfactor.com/gpk/</A>),
una librería agregable que permite accesso seguro a GTK+
ante múltiples hilos</LI>
<LI>GCK - the General Convenience Kit (
<A HREF="http://www.ii.uib.no/~tomb/gck.html">http://www.ii.uib.no/~tomb/gck.html</A>),
funciones misceláneas cuya intención es facilitar el manejo de
colores, construcción de IU (interfaces de usuario), operaciones
vectoriales, y funciones matemáticas</LI>
<LI>GDK Imlib (
<A HREF="http://www.labs.redhat.com/imlib/">http://www.labs.redhat.com/imlib/</A>),
una librería de manipulación y carga rápida de imágenes para
GDK </LI>
</UL>
<P>Adicionalmente a lo de arriba, el proyecto GNOME
(
<A HREF="http://www.gnome.org">http://www.gnome.org</A>)
utiliza GTK+ para construír un escritorio libre para Linux. Muchos más
programas pueden ser encontrados ahí.
<P>
<H2><A NAME="ss1.11">1.11 Estoy buscando una aplicación que escribir en GTK+. ¿Qué tal un cliente IRC?</A>
</H2>
<P>
<P>Pregunte en gtk-list para sugerencias. Actualmente hay por lo menos cuatro
clientes IRC endesarrollo.
<P>
<UL>
<LI>girc. (Incluído con GNOME)</LI>
<LI>Bezerk (
<A HREF="http://www.gtk.org/~trog/">http://www.gtk.org/~trog/</A>)</LI>
<LI>gsirc. (¿Localización?)</LI>
<LI>Gnirc. (
<A HREF="http://www.imaginet.fr/~dramboz/gnirc">http://www.imaginet.fr/~dramboz/gnirc</A>)</LI>
</UL>
<P>
<P>
<HR NOSHADE>
<A HREF="gtkfaq-es-2.html">Next</A>
Previous
<A HREF="gtkfaq-es.html#toc1">Contents</A>
</BODY>
</HTML>

View File

@@ -1,195 +0,0 @@
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 3.2 Final//EN">
<HTML>
<HEAD>
<META NAME="GENERATOR" CONTENT="SGML-Tools 1.0.6">
<TITLE>GTK+ FAQ: Cómo encontrar, configurar, instalar y comprobar GTK+</TITLE>
<LINK HREF="gtkfaq-es-3.html" REL=next>
<LINK HREF="gtkfaq-es-1.html" REL=previous>
<LINK HREF="gtkfaq-es.html#toc2" REL=contents>
</HEAD>
<BODY BGCOLOR="#FFFFFF">
<A HREF="gtkfaq-es-3.html">Next</A>
<A HREF="gtkfaq-es-1.html">Previous</A>
<A HREF="gtkfaq-es.html#toc2">Contents</A>
<HR NOSHADE>
<H2><A NAME="s2">2. Cómo encontrar, configurar, instalar y comprobar GTK+</A></H2>
<H2><A NAME="ss2.1">2.1 ¿Qué necesito para correr GTK+?</A>
</H2>
<P>Para compilar GTK+, todo lo que necesita es un compilador de C (gcc) y
el Sistema X Windows y librerías asociadas en su sistema.
<P>
<H2><A NAME="ss2.2">2.2 ¿Dónde puedo conseguir GTK+?</A>
</H2>
<P>El sitio canónico es:
<PRE>
ftp://ftp.gtk.org/pub/gtk
</PRE>
Por supuesto, cualquier espejo de ftp.gtk.org debe tener las últimas
versiones también.
<P>
<H2><A NAME="ss2.3">2.3 ¿Cómo configuro/compilo GTK+?</A>
</H2>
<P>Por lo general, todo lo que necesita es emititir los comandos:
<PRE>
./configure
make
</PRE>
en el directorio gtk+-version/.
<P>
<H2><A NAME="ss2.4">2.4 Cuando compilo GTK+ obtengo un error como: <CODE>make: file `Makefile' line 456: Syntax error</CODE></A>
</H2>
<P>Asegúrese de que utiliza GNU make (verifique con <CODE>make -v</CODE>). Hay
varias versiones extrañas y maravillosas de make por ahí, y no todas
manejan los <EM>Makefiles</EM> generados automáticamente.
<P>
<P>
<H2><A NAME="ss2.5">2.5 ¡He compilado e instalado GTK+, pero no puedo lograr que los programas se enlacen con él!</A>
</H2>
<P>Este problema se encuentra comúnmente cuando las librerías GTK+ no pueden
ser localizadas o tienen la versión incorrecta. Generalmente, el compilador
se quejará de un 'unresolved symbol' (símbolo no resuelto). Hay dos cosas
que necesita verificar:
<P>
<UL>
<LI>Asegúrese de que las librerías pueden ser encontradas. Usted desea editar
/etc/ld.so.conf para incluír los directorios que contienen las librerías
GTK, de manera que luzca como:
<PRE>
/usr/X11R6/lib
/usr/local/lib
</PRE>
Luego necesita correr /sbin/ldconfig como root. Puede encontrar que directorio
utiliza GTK al ejecutar
<PRE>
gtk-config --libs
</PRE>
Si su sitema no utiliza ld.so para encontrar librerías (como Solaris),
entonces tendrá que utilizar la variable de ambiente LD_LIBRARY_PATH
(o compilar el camino en su programa, lo cual no voy a cubrir aquí). Así
que, con un shell tipo Bourne usted puede hacer (si sus librerías GTK
están en /usr/local/lib):
<PRE>
export LD_LIBRARY_PATH=/usr/local/lib
</PRE>
y en un csh, usted puede hacer:
<PRE>
setenv LD_LIBRARY_PATH /usr/local/lib
</PRE>
</LI>
<LI>Asegúrese de que el enlazador está ha encontrado el conjunto correcto de
librerías. Si tiene una distribución de Linux que instala GTK+ (ej.
RedHat 5.0) entonces esta versión anterior puede ser utilizada. Ahora
(asumiendo que tiene un sistema RedHat), emita el comando
<PRE>
rpm -e gtk gtk-devel
</PRE>
También puede querer remover los paquetes que dependen de gtk (rpm le
dirá cuáles son). Si no tiene un sistema Linux RedHat, verifique
para estar seguro que ni
<PRE>
/usr/lib
</PRE>
ni
<PRE>
/usr/local/lib
</PRE>
contengan alguna de las librerías libgtk, libgdk, libglib, or libgck.
Si existen, elimínelas (y cualquier archivo <EM>include</EM>, como
/usr/include/gtk y /usr/include/gdk) y reinstale gtk+.</LI>
</UL>
<P>
<H2><A NAME="ss2.6">2.6 Cuando compilo programas con GTK+, obtengo mensajes de error del compilador diciendo que no es capaz de encontrar <CODE>"glibconfig.h"</CODE>.</A>
</H2>
<P>El archivo de encabezado "glibconfig.h" se movió al directorio
$exec_prefix/lib/glib/include/. $exec_prefix es el directorio que fue
especificado al dar la bandera --exec-prefix a ./configure cuando se
compiló GTK+. Va por omisión a $prefix, (especificado con --prefix),
que en su lugar va por omisión a /usr/local/.
<P>Ésto se hizo asi porque "glibconfig.h" incluye información
dependiente de la arquitectura, y el resto de los archivos <EM>include</EM>
se colocan en $prefix/include, el cual puede ser compartido entre distintas
arquitecturas.
<P>GTK+ incluye un guión para el intérprete de comandos,
<CODE>gtk-config</CODE>, el cual hace fácil
encontrar los caminos correctos de inclusión. El tutor de GTK+ incluye
un ejemplo de como utilizar <CODE>gtk-config</CODE> para una compilación simple
desde la línea de comandos. Para información sobre configuraciones más
complicadas, vea el archivo docs/gtk-config.txt en la distribución de GTK+.
<P>Si está intentando compilar un programa viejo, puede bordear el problema
al configurarlo con una línea de comando como:
<P>
<BLOCKQUOTE><CODE>
<PRE>
CPPFLAGS="-I/usr/local/include/glib/include" ./configure
</PRE>
</CODE></BLOCKQUOTE>
<P>para intérpretes de comandos compatibles con Bourne como bash, o para
variantes csh:
<P>
<BLOCKQUOTE><CODE>
<PRE>
setenv CPPFLAGS "-I/usr/local/include/glib/include"
./configure
</PRE>
</CODE></BLOCKQUOTE>
<P>(Sustituya el valor apropiado de $exec_prefix para /usr/local.)
<P>
<H2><A NAME="ss2.7">2.7 Cuando instalo El GIMP, configure reporta que no puede encontrar GTK.</A>
</H2>
<P>Hay varias razones comúnes para esto:
<UL>
<LI>Usted tiene una versión vieja de GTK instalada en algún lugar.
RedHat 5.0, por ejemplo, instala una copia anterior de GTK que no funcinará
con las últimas veriones de GIMP. Debe eliminar esta copia vieja, pero
observe que en el caso de RedHat 5.0 esto dañará las aplicaciones
<CODE>control-panel</CODE>.
<P>
</LI>
<LI><CODE>gtk-config</CODE> (u otro componente de GTK) no se encuentra en el camino
(<EM>path</EM>),
o hay una versión vieja en su sistema. Teclee:
<PRE>
gtk-config --version
</PRE>
para verificar ambos casos. Ésto debe devolver un valor de por lo menos
0.99.8 para que las cosas funcionen correctamente con GIMP 0.99.23. Si
devuelve un valor distinto a lo que usted espera, entonces tiene una versión
vieja de GTK en su sistema.
<P>
</LI>
<LI>El guión ./configure no puede encontrar las librerías GTK. Como
./configure compila varios programas de prueba, necesita poder encontrar las
librerías GTK. Revise la pregunta anterior para obtener más ayuda al
respecto.</LI>
</UL>
<P>Si nada de lo anterior ayuda, entonces revise config.log, el cual es
generado por ./configure cuando corre. Al final estará la última
acción tomada antes de fallar. Si es una sección de código fuente,
copie el código fuente a un archivo y compilelo con la línea
jústamente arriba de él en config.log. Si la compilación tiene
éxito, intente ejecutarlo.
<P>
<HR NOSHADE>
<A HREF="gtkfaq-es-3.html">Next</A>
<A HREF="gtkfaq-es-1.html">Previous</A>
<A HREF="gtkfaq-es.html#toc2">Contents</A>
</BODY>
</HTML>

View File

@@ -1,198 +0,0 @@
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 3.2 Final//EN">
<HTML>
<HEAD>
<META NAME="GENERATOR" CONTENT="SGML-Tools 1.0.6">
<TITLE>GTK+ FAQ: Desarrollo de GTK+</TITLE>
<LINK HREF="gtkfaq-es-4.html" REL=next>
<LINK HREF="gtkfaq-es-2.html" REL=previous>
<LINK HREF="gtkfaq-es.html#toc3" REL=contents>
</HEAD>
<BODY BGCOLOR="#FFFFFF">
<A HREF="gtkfaq-es-4.html">Next</A>
<A HREF="gtkfaq-es-2.html">Previous</A>
<A HREF="gtkfaq-es.html#toc3">Contents</A>
<HR NOSHADE>
<H2><A NAME="s3">3. Desarrollo de GTK+</A></H2>
<H2><A NAME="ss3.1">3.1 ¿Qué es esta cosa CVS de la cual todo el mundo habla, y cómo puedo acceder a ella?</A>
</H2>
<P>CVS es el Concurrent Version System (Sistema de Versión Concurrente) y es
un medio muy popular de control de versión para proyectos de software.
Está diseñado para permitir que múltiples autores puedan operar de
manera simultánea en el mismo árbol fuente. Este árbol fuente es
mantenido centralizadamente, pero cada desarrollador tiene una réplica local
de este repositorio en el cual hacen sus cambios.
<P>Los desarrolladores de GTK+ utilizan un repositorio CVS para almacenar la
copia maestra de la actual versión en desarrollo de GTK+. Como tal,
la gente que desea contribuír con parches a GTK+ deben generarlos para la
versión del CVS. La gente normal debe utilizar los paquetes liberados.
<P>El conjunto de herramientas CVS está disponible como paquetes RPM en los
sitios usuales de RedHat. La última versión está disponible en
<A HREF="http://download.cyclic.com/pub/">&lt;http://download.cyclic.com/pub/&gt;</A><P>Cualquiera puede bajar la última versión CVS de GTK+ utilizando
acceso anónimo con los siguientes pasos:
<UL>
<LI> En un descendiente del intérprete de comandos bourne (ej. bash)
teclee:
<PRE>
export CVSROOT=':pserver:anonymous@anoncvs.gimp.org:/debian/home/gnomecvs'
</PRE>
</LI>
<LI>Luego, la primera vez que el árbol fuente se retira, se necesita
un <EM>login</EM> cvs.
<PRE>
cvs login
</PRE>
Ésto hará que se le solicite una clave de acceso. No hay clave de
acceso para cvs.gimp.org, así que solo ingrese un retorno de carro.</LI>
<LI>Para conseguir el árbol y colocarlo en un subdirectorio de su
directorio de trabajo actual, emita el comando:
<PRE>
cvs -z3 get gtk+
</PRE>
Observe que con el árbol GTK+ 1.1, glib se ha movido a un módulo CVS
separado, de manera que si no tiene glib instalado necesitará conseguirlo
igualmente:
<PRE>
cvs -z3 get glib
</PRE>
</LI>
</UL>
<H2><A NAME="ss3.2">3.2 ¿Cómo puedo contribuír a GTK+?</A>
</H2>
<P>Es simple. Si algo no funciona en un programa como usted piensa que debería,
revise la documentación para asegurarse de que no ha pasado algo por alto.
Si es un verdadero error o característica perdida, rastréelo en el
fuente de GTK+, cámbielo, y entonces genere un parche en la forma de un
'diff de contexto'. Esto puede hacerse utilizando un comando como
<CODE>diff -ru &lt;oldfile&gt; &lt;newfile&gt;</CODE>. Entonces envíe el archivo
de parche a:
<PRE>
ftp://ftp.gtk.org/incoming
</PRE>
junto a un archivo README. ¡Asegúrese de seguir las convenciones de
asignación de nombres o su parche será borrado! Los archivos deben ser
de esta forma:
<PRE>
gtk-&lt;username>-&lt;date yymmdd-n>.patch.gz
gtk-&lt;username>-&lt;date yymmdd-n>.patch.README
</PRE>
La "n" en la fecha indica un número único (empezando de 0)
de parches que subió ese día. Debe ser 0, a menos que envíe más de
un parche en el mismo día.
<P>Example:
<PRE>
gtk-gale-982701-0.patch.gz
gtk-gale-982701-0.patch.README
</PRE>
Una vez que usted envía <EM>lo que sea</EM>, envíe el README a
ftp-admin@gtk.org
<P>
<H2><A NAME="ss3.3">3.3 ¿Cómo averiguo si mi parche fue aplicado, y si no, por qué no?</A>
</H2>
<P>Los parches enviados se mandarán a
<CODE>ftp://ftp.gtk.org/pub/gtk/patches</CODE>
donde uno del equipo de desarrollo de GTK+ los recogerá. Si son aplicados,
serán movidos a <CODE>/pub/gtk/patches/old</CODE>.
<P>Los parches que no son aplicados, por cualquier razón, se mandarán a
<CODE>/pub/gtk/patches/unapplied</CODE> o <CODE>/pub/gtk/patches/outdated</CODE>.
En este punto puede preguntar en la lista de correo <CODE>gtk-list</CODE> el porqué
su parche no fué aplicado. Hay muchas razones posibles por las cuales un
parche no se aplica, pasando desde que no se puede aplicar limpiamente, hasta
que no es correcto. No se rinda si no logró que su parche se aplicase a la
primera.
<P>
<H2><A NAME="ss3.4">3.4 ¿Cuál es la política sobre la incorporación de nuevos <EM>widgets</EM> en la librería?</A>
</H2>
<P>Esto corresponde a los autores, de manera que tendrá que preguntarles
al terminar su <EM>widget</EM>. Como una guía general, los <EM>widgets</EM>
que por lo general son útiles, funcionan, y no son una desgracia al conjunto
de <EM>widgets</EM> serán incluídos con mucho gusto.
<P>
<H2><A NAME="ss3.5">3.5 ¿Hay alguien trabajando en atamientos para otros lenguajes distintos a C?</A>
</H2>
<P>Sí. Existe
<UL>
<LI>una envoltura de C++ para GTK+ llamada gtk--. Puede encontrar el su
página hogar en:
<A HREF="http://www.cs.tut.fi/~p150650/gtk/gtk--.html">http://www.cs.tut.fi/~p150650/gtk/gtk--.html</A>.
El sitio FTP es
<A HREF="ftp://ftp.gtk.org/pub/gtk/gtk--">ftp://ftp.gtk.org/pub/gtk/gtk--</A>.
<P>
<P>
</LI>
<LI>Hay dos ataduras para Objective-C en desarrollo:
<UL>
<LI>El paquete elegido por el
<A HREF="http://www.gnome.org/">proyecto GNOME</A> es obgtk. Objgtk se basa en la clase Object y es
mantenido por
<A HREF="mailto:sopwith@cuc.edu">Elliot Lee</A>.
Aparentemente, objgtk se está aceptando como el atamiento `estándar'
de Objective-C para GTK+.
</LI>
<LI> Si usted está más inclinado al
<A HREF="http://www.gnustep.org/">proyecto GNUstep</A>,
puede que quiera revisar GTKKit por
<A HREF="mailto:helge@mdlink.de">Helge He&szlig;</A>.
La intención es crear un atamiento GTK+ utilizando FoundationKit.
GTKKit incluye linduras como escribir un archivo con una plantilla tipo
XML para construír una interface GTK+.
</LI>
</UL>
<P>
</LI>
<LI>Atamientos Perl
<A HREF="ftp://ftp.gtk.org/pub/gtk/perl">ftp://ftp.gtk.org/pub/gtk/perl</A>
<P>
</LI>
<LI>Atamientos Guile. La página hogar se encuentra en
<A HREF="http://www.ping.de/sites/zagadka/guile-gtk">http://www.ping.de/sites/zagadka/guile-gtk</A>.
Por cierto, Guile es la implantación del Proyecto GNU de Scheme R4RS (el
estándar). Si le gusta Scheme, querrá darle un vistazo a éste.
<P>
<P>
</LI>
<LI>David Monniaux informa:
<BLOCKQUOTE>
He empezado un sistema de atamiento gtk-O'Caml. Las bases del sistema,
incluyendo <EM>callbacks</EM>, funcionan bien.
El desarrollo actual se encuentra en
<A HREF="http://www.ens-lyon.fr/~dmonniau/arcs">http://www.ens-lyon.fr/~dmonniau/arcs</A></BLOCKQUOTE>
</LI>
<LI>Se han hecho varios atamientos para python:
<P>
<UL>
<LI>pygtk se encuentra en
<A HREF="http://www.daa.com.au/~james/pygtk">http://www.daa.com.au/~james/pygtk</A> y
<A HREF="ftp://ftp.gtk.org/pub/gtk/python">ftp://ftp.gtk.org/pub/gtk/python</A></LI>
<LI>python-gtk se encuentra en
<A HREF="http://www.ucalgary.ca/~nascheme/python-gtk">http://www.ucalgary.ca/~nascheme/python-gtk</A></LI>
</UL>
<P>
</LI>
<LI>Hay un <EM>widget</EM> disponible para GTK+. Agárrelo en
<A HREF="http://www.sakuranet.or.jp/~aozasa/shige/doc/comp/gtk/gtkGL/files-en.html">http://www.sakuranet.or.jp/~aozasa/shige/doc/comp/gtk/gtkGL/files-en.html</A>
</LI>
</UL>
<P>
<HR NOSHADE>
<A HREF="gtkfaq-es-4.html">Next</A>
<A HREF="gtkfaq-es-2.html">Previous</A>
<A HREF="gtkfaq-es.html#toc3">Contents</A>
</BODY>
</HTML>

View File

@@ -1,435 +0,0 @@
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 3.2 Final//EN">
<HTML>
<HEAD>
<META NAME="GENERATOR" CONTENT="SGML-Tools 1.0.6">
<TITLE>GTK+ FAQ: Desarrollo con GTK+</TITLE>
<LINK HREF="gtkfaq-es-5.html" REL=next>
<LINK HREF="gtkfaq-es-3.html" REL=previous>
<LINK HREF="gtkfaq-es.html#toc4" REL=contents>
</HEAD>
<BODY BGCOLOR="#FFFFFF">
<A HREF="gtkfaq-es-5.html">Next</A>
<A HREF="gtkfaq-es-3.html">Previous</A>
<A HREF="gtkfaq-es.html#toc4">Contents</A>
<HR NOSHADE>
<H2><A NAME="s4">4. Desarrollo con GTK+</A></H2>
<H2><A NAME="ss4.1">4.1 ¿Cómo empiezo?</A>
</H2>
<P>Después de que ha instalado GTK+, hay un par de cosas que pueden
facilitarle el desarrollo de aplicaciones con él. Está el Tutor de
GTK+
<A HREF="http://www.gtk.org/tutorial/">&lt;http://www.gtk.org/tutorial/&gt;</A>, el cual está en desarrollo
activo. Este tutorial le introducirá en la escritura de aplicaciones
utilizando C.
<P>El Tutor no contiene (todavía) información sobre todos los
<EM>widgets</EM> que existen en GTK+. Para código de ejemplo sobre la
utilización básica de todos los <EM>widgets</EM> de GTK+, debe ver
el archivo gtk/testgtk.c (y archivos fuentes asociados) en la distribución
GTK+. Ver estos ejemplos le dará una buena base sobre lo que pueden hacer
los <EM>widgets</EM>.
<P>
<H2><A NAME="ss4.2">4.2 ¿Qué <EM>widgets</EM> existen en GTK?</A>
</H2>
<P>El Tutor de GTK+ lista los siguientes <EM>widgets</EM>:
<PRE>
GtkObject
+GtkData
| +GtkAdjustment
| `GtkTooltips
`GtkWidget
+GtkContainer
| +GtkBin
| | +GtkAlignment
| | +GtkEventBox
| | +GtkFrame
| | | `GtkAspectFrame
| | +GtkHandleBox
| | +GtkItem
| | | +GtkListItem
| | | +GtkMenuItem
| | | | `GtkCheckMenuItem
| | | | `GtkRadioMenuItem
| | | `GtkTreeItem
| | +GtkViewport
| | `GtkWindow
| | +GtkColorSelectionDialog
| | +GtkDialog
| | | `GtkInputDialog
| | `GtkFileSelection
| +GtkBox
| | +GtkButtonBox
| | | +GtkHButtonBox
| | | `GtkVButtonBox
| | +GtkHBox
| | | +GtkCombo
| | | `GtkStatusbar
| | `GtkVBox
| | +GtkColorSelection
| | `GtkGammaCurve
| +GtkButton
| | +GtkOptionMenu
| | `GtkToggleButton
| | `GtkCheckButton
| | `GtkRadioButton
| +GtkCList
| `GtkCTree
| +GtkFixed
| +GtkList
| +GtkMenuShell
| | +GtkMenuBar
| | `GtkMenu
| +GtkNotebook
| +GtkPaned
| | +GtkHPaned
| | `GtkVPaned
| +GtkScrolledWindow
| +GtkTable
| +GtkToolbar
| `GtkTree
+GtkDrawingArea
| `GtkCurve
+GtkEditable
| +GtkEntry
| | `GtkSpinButton
| `GtkText
+GtkMisc
| +GtkArrow
| +GtkImage
| +GtkLabel
| | `GtkTipsQuery
| `GtkPixmap
+GtkPreview
+GtkProgressBar
+GtkRange
| +GtkScale
| | +GtkHScale
| | `GtkVScale
| `GtkScrollbar
| +GtkHScrollbar
| `GtkVScrollbar
+GtkRuler
| +GtkHRuler
| `GtkVRuler
`GtkSeparator
+GtkHSeparator
`GtkVSeparator
</PRE>
<P>
<H2><A NAME="ss4.3">4.3 ¿GTK+ es seguro ante múltiples hilos?</A>
</H2>
<P>Aunque GTK+, como la mayoría de los juegos de herramientas para X,
no es seguro ante múltiples hilos, esto no prohibe el desarrollo de
aplicaciones con múltiples hilos con GTK+.
<P>Rob Browning (rlb@cs.utexas.edu) describe técnicas de hilamiento
que pueden utilizarse con GTK+ (levemente modificado):
<P>Básicamente existen dos enfoques principales, el primero es sencillo,
y el segundo complicado. En el primero, simplemente hay que asegurarse
de que todas las interacciones de GTK+ (o X) se manejan por un, y solo un,
hilo. Cualquier otro hilo que desee dibujar algo tiene que notificarlo de
alguna manera al hilo "GTK+", y dejarlo que maneje el trabajo real.
<P>El segundo enfoque le permite llamar funciones de GTK+ (o X) desde cualquier
hilo, pero requiere sincronización cuidadosa. La idea básica es crear
una exclusión mutua de protección para X, de manera que nadie haga
llamadas X sin primero adquirir esta exclusión mutua.
<P>Observe que se trata de un pequeño esfuerzo, pero que le permitirá ser
potencialmente más eficiente que un GTK+ completamente seguro ante
múltiples hilos. Usted decide la granularidad del bloqueo de hilos.
También debe asegurarse que el hilo que llama a gtk_main mantiene la
cerradura cuando llama a gtk_main.
<P>Lo siguiente por lo que hay que preocuparse ya que se tenía agarrada
la exclusión mutua global cuando se entró a gtk_main, es que todos
los <EM>callbacks</EM> también la tendrán. Esto significa que el
<EM>callback</EM> debe soltarla si va a llamar a cualquier otro código
que pueda readquirirla. De otra manera obtendrá un bloqueo mortal.
También hay que tener agarrada la exclusión mutua cuando finalmente
regresa del <EM>callback</EM>.
<P>Para permitir a otros hilos, además del que llama a gtk_main, tener
acceso a la exclusión mutua, necesitamos registrar una función de
trabajo con GTK que nos permita liberar la exclusión mutua
periódicamente.
<P>¿Por qué GTK+ no puede ser seguro ante múltiples hilos de
manera nativa?
<P>Complejidad, sobrecarga, y mano de obra. La proporción de programas
con hilos es todavía razonablemente pequeña, y conseguir seguridad
ante hilos es muy difícil y le quita tiempo valioso al trabajo
principal de obtener una buena librería gráfica terminada. Sería
muy agradable que GTK+ fuera seguro ante hilos "al sacarlo de la caja",
pero no es práctico ahora mismo, y haría a GTK+ sustancialmente menos
eficiente si no se maneja cuidadosamente.
<P>De cualquier manera, no es una prioridad esencial ya que existen remedios
relativamente buenos.
<P>
<H2><A NAME="ss4.4">4.4 ¿Cómo puedo prevenir el redibujar y reacomodar tamaños mientras cambio múltiples <EM>widgets</EM>?</A>
</H2>
<P>
Utilize gtk_container_disable_resize y gtk_container_enable_resize alrededor
del código donde quiere cambiar varias cosas. Esto resultará en mayor
velocidad ya que prevendrá tener que darle el tamaño otra vez a la
jerarquía de <EM>widget</EM> por completo.
<P>
<H2><A NAME="ss4.5">4.5 ¿Cómo atrapo un evento de doble tecleo (en un <EM>widget</EM> de lista, por ejemplo)?</A>
</H2>
<P>Tim Janik escribió a la lista gtk-list (ligeramente modificado):
<P>Defina un manejador de señal:
<P>
<BLOCKQUOTE><CODE>
<PRE>
gint
signal_handler_event(GtkWiget *widget, GdkEvenButton *event, gpointer func_data)
{
if (GTK_IS_LIST_ITEM(widget) &amp;&amp;
(event->type==GDK_2BUTTON_PRESS ||
event->type==GDK_3BUTTON_PRESS) ) {
printf("I feel %s clicked on button %d\",
event->type==GDK_2BUTTON_PRESS ? "double" : "triple",
event->button);
}
return FALSE;
}
</PRE>
</CODE></BLOCKQUOTE>
<P>Y conecte el manejador a su objeto:
<P>
<BLOCKQUOTE><CODE>
<PRE>
{
/* lista, asuntos de inicializacion de articulos de lista */
gtk_signal_connect(GTK_OBJECT(list_item),
"button_press_event",
GTK_SIGNAL_FUNC(signal_handler_event),
NULL);
/* y/o */
gtk_signal_connect(GTK_OBJECT(list_item),
"button_release_event",
GTK_SIGNAL_FUNC(signal_handler_event),
NULL);
/* algo mas */
}
</PRE>
</CODE></BLOCKQUOTE>
<P>y, Owen Taylor escribió:
<P>Observe que se recibirá la pulsación del botón de antemano, y
si está haciendo esto para un botón, también obtendrá una señal
de "tecleado" para el botón. (Esto es cierto para cualquier juego de
herramientas, ya que las computadoras no son buenas para leer la mente de
cada quien.)
<P>
<H2><A NAME="ss4.6">4.6 ¿Cómo puedo averiguar cuál es la selección de un GtkList?</A>
</H2>
<P>
<P>Consiga la selección con algo como esto:
<BLOCKQUOTE><CODE>
<PRE>
GList *sel;
sel = GTK_LIST(list)->selection;
</PRE>
</CODE></BLOCKQUOTE>
<P>Así es como GList está definido (sacado de glist.h):
<BLOCKQUOTE><CODE>
<PRE>
typedef struct _GList GList;
struct _GList
{
gpointer data;
GList *next;
GList *prev;
};
</PRE>
</CODE></BLOCKQUOTE>
<P>Una estructura GList es simplemente una estructura para listas doblemente
enlazadas. Existen varias funciones g_list_*() para modificar una lista
enlazada en glib.h. Sin embargo, la selección GTK_LIST(MyGtkList)->selection
es mantenida por las funciones gtk_list_*() y no deben ser modificadas.
<P>El selection_mode del GtkList determina las facilidades de selección de un
GtkList y por lo tanto los contenidos de GTK_LIST(AnyGtkList)->selection:
<P>
<PRE>
selection_mode GTK_LIST()->selection contents
------------------------------------------------------
GTK_SELECTION_SINGLE) la selección es NULL
o contiene un puntero GList*
para un artículo seleccionado individualmente
GTK_SELECTION_BROWSE) la selección es NULL si la lista
no contiene widgets, de otra manera
contiene un puntero GList*
para una estructura GList.
GTK_SELECTION_MULTIPLE) la selección es NULL si no se seleccionan
listitems para un apuntador GList*
para el primer artículo seleccionado. Eso en
su lugar apunta a una estructura GList para el
segundo artículo seleccionado y continúa
GTK_SELECTION_EXTENDED) la selección es NULL.
</PRE>
<P>El campo data de la estructura GList GTK_LIST(MyGtkList)->selection apunta
al primer GtkListItem que es seleccionado. De manera que si quiere determinar
cuales listitems están seleccionados debe hacer esto:
<P>Durante la in>
<HR><H3>Transfer interrupted!</H3>
>
{
gchar *list_items[]={
"Item0",
"Item1",
"foo",
"last Item",
};
guint nlist_items=sizeof(list_items)/sizeof(list_items[0]);
GtkWidget *list_item;
guint i;
list=gtk_list_new();
gtk_list_set_selection_mode(GTK_LIST(list), GTK_SELECTION_MULTIPLE);
gtk_container_add(GTK_CONTAINER(AnyGtkContainer), list);
gtk_widget_show (list);
for (i = 0; i &lt; nlist_items; i++)
{
list_item=gtk_list_item_new_with_label(list_items[i]);
gtk_object_set_user_data(GTK_OBJECT(list_item), (gpointer)i);
gtk_container_add(GTK_CONTAINER(list), list_item);
gtk_widget_show(list_item);
}
}
</PRE>
</CODE></BLOCKQUOTE>
<P>Para tener conocimiento de la inicialización:
<BLOCKQUOTE><CODE>
<PRE>
{
GList *items;
items=GTK_LIST(list)->selection;
printf("Selected Items: ");
while (items) {
if (GTK_IS_LIST_ITEM(items->data))
printf("%d ", (guint)
gtk_object_get_user_data(items->data));
items=items->next;
}
printf("\n");
}
</PRE>
</CODE></BLOCKQUOTE>
<H2><A NAME="ss4.7">4.7 ¿Acaso es posible desplegar un texto que se recorte para que quepa dentro del lugar que tenga asignado?</A>
</H2>
<P>El comportamiento de GTK+ (sin recorte) es una consecuencia de sus intentos
para conservar recursos de X. Los <EM>widgets</EM> etiqueta (entre otros) no
tienen su propia ventana X - simplemente dibujan su contenido en la ventana
de su padre. Aunque sería posible hacer que ocurran recortes al establecer
la máscara de recorte antes de dibujar el texto, esto podría causar una
penalización substancial en el rendimiento.
<P>Es posible que, a largo plazo, la mejor solución a tales problemas sea
simplemente cambiar gtk para que le de ventanas X a las etiquetas. Un remedio
a corto plazo es poner el <EM>widget</EM> de etiqueta dentro de otro
<EM>widget</EM> que sí obtiene su propia ventana - un candidato posible puede ser el <EM>widget</EM> <EM>viewport</EM>.
<P>
<BLOCKQUOTE><CODE>
<PRE>
viewport = gtk_viewport (NULL, NULL);
gtk_widget_set_usize (viewport, 50, 25);
gtk_viewport_set_shadow_type (GTK_VIEWPORT(viewport), GTK_SHADOW_NONE);
gtk_widget_show(viewport);
label = gtk_label ("a really long label that won't fit");
gtk_container_add (GTK_CONTAINER(viewport), label);
gtk_widget_show (label);
</PRE>
</CODE></BLOCKQUOTE>
<P>Si estuviera haciendo esto para un montón de <EM>widgets</EM>, querrá
copiar gtkviewport.c y arrancar la funcionalidad de sombra y ajuste (tal vez
quiera llamarlo GtkClipper).
<P>
<H2><A NAME="ss4.8">4.8 ¿Por qué el contenido de un botón no se mueve al presionar el botón? Aquí les envío un parche para que funcione de esa forma...</A>
</H2>
<P>De: Peter Mattis
<P>La razón por la cuál los botones no mueven a su hijo abajo y a la derecha
cuando son presionados es porque no me parece que eso es lo que ocurre
visualmente. Mi visión de los botonos es que los miras de manera recta.
O sea, la interface de usuario tiende sobre un plano y tú estás sobre
él observándolo de manera recta. Cuando un botón es presionado se
mueve directamente lejos de tí. Para ser absolutamente correcto supongo
que el hijo debería encojerse un poquito. Pero no veo por qué el hijo
debería moverse abajo y a la izquierda. Recurda, el hijo se supone que
está pegado a la superficie del botón. No es bueno que luzca como si
el hijo se resbala sobre la superficie del botón.
<P>En una nota más práctica, ya implanté esto una vez y determiné
que no se veía bien y lo quité.
<P>
<H2><A NAME="ss4.9">4.9 ¿Cómo puedo definir una línea de separación como en un menú?</A>
</H2>
<P>Revise el
<A HREF="http://www.gtk.org/tutorial/">Tutor</A> para información sobre como crear menús.
<P>Sin embargo, para crear una línea de separación en un menú,
simplemente inserte un artículo de menú vacío:
<P>
<BLOCKQUOTE><CODE>
<PRE>
menuitem = gtk_menu_item_new();
gtk_menu_append(GTK_MENU(menu), menuitem);
gtk_widget_show(menuitem);
</PRE>
</CODE></BLOCKQUOTE>
<P>
<H2><A NAME="ss4.10">4.10 ¿Cómo puedo darle justificación a la derecha a un menú, como Help, cuando utilizo MenuFactory?</A>
</H2>
<P>Utilice algo como lo que sigue:
<P>
<BLOCKQUOTE><CODE>
<PRE>
menu_path = gtk_menu_factory_find (factory, "&lt;MyApp>/Help");
gtk_menu_item_right_justify(menu_path->widget);
</PRE>
</CODE></BLOCKQUOTE>
<H2><A NAME="ss4.11">4.11 ¿Cómo hago mi ventana modal? / ¿Cómo hago una sóla ventana activa?</A>
</H2>
<P>Después de haber creado su ventana, haga gtk_grab_add(my_window). Y
después de cerrar la ventana haga gtk_grab_remove(my_window).
<P>
<H2><A NAME="ss4.12">4.12 ¿Por qué mi <EM>widget</EM> (ej. progressbar) no se actualiza?</A>
</H2>
<P>
<P>Probablemente usted está haciendo todos los cambios dentro de una función
sin devolver el control a gtk_main. La mayoría de las actualizaciones de
dibujo se colocan simplemente en una cola, la cual es procesada dentro de
gtk_main. Puede forzar que se procese la cola de dibujado utilizando algo como:
<P>
<BLOCKQUOTE><CODE>
<PRE>
while (gtk_events_pending())
gtk_main_iteration();
</PRE>
</CODE></BLOCKQUOTE>
<P>dentro de la función que cambia el <EM>widget</EM>.
<P>Lo que el fragmento anterior hace es correr todos los eventos pendientes y
funciones ociosas de alta prioridad, luego regresa de inmediato (el dibujado
se realiza en una función ociosa de alta prioridad).
<P>
<HR NOSHADE>
<A HREF="gtkfaq-es-5.html">Next</A>
<A HREF="gtkfaq-es-3.html">Previous</A>
<A HREF="gtkfaq-es.html#toc4">Contents</A>
</BODY>
</HTML>

View File

@@ -1,92 +0,0 @@
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 3.2 Final//EN">
<HTML>
<HEAD>
<META NAME="GENERATOR" CONTENT="SGML-Tools 1.0.6">
<TITLE>GTK+ FAQ: Acerca de gdk</TITLE>
<LINK HREF="gtkfaq-es-6.html" REL=next>
<LINK HREF="gtkfaq-es-4.html" REL=previous>
<LINK HREF="gtkfaq-es.html#toc5" REL=contents>
</HEAD>
<BODY BGCOLOR="#FFFFFF">
<A HREF="gtkfaq-es-6.html">Next</A>
<A HREF="gtkfaq-es-4.html">Previous</A>
<A HREF="gtkfaq-es.html#toc5">Contents</A>
<HR NOSHADE>
<H2><A NAME="s5">5. Acerca de gdk</A></H2>
<H2><A NAME="ss5.1">5.1 ¿Qué es gdk?</A>
</H2>
<P>gdk es básicamente una envoltura alrededor de las llamadas a funciones
Xlib. Si estás familiarizado con Xlib, muchas de las funciones en gdk
requerirán poco o ningún tiempo para acostumbrarse.
Todas las funciones están escritas para proporcionar una manera fácil de
acceder a las funciones Xlib en una manera un poco más intuitiva.
Adicionalmente, ya que gdk utiliza glib (vea abajo), será más portable
y seguro de utilizar en
múltiples plataformas.
<P>
<P>
<H2><A NAME="ss5.2">5.2 ¿Cómo utilizo la asignación de colores?</A>
</H2>
<P>Una de las cosas agradables de GDK es que está basado sobre Xlib; esto
también es un problema, especialmente en el área de administración
de colores. Si usted quiere utilizar color en su programa (dibujando un
rectángulo o algo por el estilo, su código debe lucir algo así:
<P>
<BLOCKQUOTE><CODE>
<PRE>
{
GdkColor *color;
int width, height;
GtkWidget *widget;
GdkGC *gc;
...
/* primero, cree un GC (contexto grafico) en el cual dibujar */
gc = gdk_gc_new(widget->window);
/* encuentre las dimensiones correctas para el rectangulo */
gdk_window_get_size(widget->window, &amp;width, &amp;height);
/* el color que queremos utilizar */
color = (GdkColor *)malloc(sizeof(GdkColor));
/* rojo, verde y azul son valores pasados, indicando el trio RGB
* del color que queremos dibujar. Note que los valores de los componentes
* RGB dentro de GdkColor son tomados de 0 a 65535, no de 0 a 255.
*/
color->red = red * (65535/255);
color->green = green * (65535/255);
color->blue = blue * (65535/255);
/* el valor de pixel indica el indice en el mapa de colores del color.
* simplemente es una combinacion de los valores RGB colocados anteriormente
*/
color->pixel = (gulong)(red*65536 + green*256 + blue);
/* Sin embargo, el valor de pixel es solo valido en dispositivos de 24-bit
* (color verdadero). Por lo tanto, esta llamada es requerida para que GDK
* y X puedan darnos el color mas cercano disponible en el mapa de colores
*/
gdk_color_alloc(gtk_widget_get_colormap(widget), color);
/* colocar la parte delantera a nuestro color */
gdk_gc_set_foreground(gc, color);
/* dibujar el rectangulo*/
gdk_draw_rectangle(widget->window, gc, 1, 0, 0, width, height);
...
}
</PRE>
</CODE></BLOCKQUOTE>
<P>
<HR NOSHADE>
<A HREF="gtkfaq-es-6.html">Next</A>
<A HREF="gtkfaq-es-4.html">Previous</A>
<A HREF="gtkfaq-es.html#toc5">Contents</A>
</BODY>
</HTML>

View File

@@ -1,64 +0,0 @@
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 3.2 Final//EN">
<HTML>
<HEAD>
<META NAME="GENERATOR" CONTENT="SGML-Tools 1.0.6">
<TITLE>GTK+ FAQ: Acerca de glib</TITLE>
<LINK HREF="gtkfaq-es-7.html" REL=next>
<LINK HREF="gtkfaq-es-5.html" REL=previous>
<LINK HREF="gtkfaq-es.html#toc6" REL=contents>
</HEAD>
<BODY BGCOLOR="#FFFFFF">
<A HREF="gtkfaq-es-7.html">Next</A>
<A HREF="gtkfaq-es-5.html">Previous</A>
<A HREF="gtkfaq-es.html#toc6">Contents</A>
<HR NOSHADE>
<H2><A NAME="s6">6. Acerca de glib</A></H2>
<H2><A NAME="ss6.1">6.1 ¿Qué es glib?</A>
</H2>
<P>glib es una librería de funciones y definiciones útiles disponibles
para ser utilizadas cuando se crean aplicaciones GDK y GTK. Proporciona
reemplazos para algunas funciones estándar de libc, como malloc, las
cuales tienen errores en algunos sistemas.
<P>También proporciona rutinas para manejar:
<UL>
<LI>Listas Doblemente Enlazadas</LI>
<LI>Listas con Enlace Sencillo</LI>
<LI>Cronómetros</LI>
<LI>Manipulación de cadenas</LI>
<LI>Un Analizador Léxico</LI>
<LI>Funciones de Error</LI>
</UL>
<P>
<P>
<H2><A NAME="ss6.2">6.2 ¿Por qué utilizar g_print, g_malloc, g_strdup y funciones compañeras de glib?</A>
</H2>
<P>Gracias a Tim Janik que escribió a gtk-list: (ligeramente modificado)
<BLOCKQUOTE>
Con respecto a g_malloc(), g_free() y hermanos, estas funciones son más
seguras que sus equivalentes en libc. Por ejemplo, g_free() solo regresa si
se llama con NULL. También, si se define USE_DMALLOC, la definición para
estas funciones cambia (en glib.h) para utilizar MALLOC(), FREE() etc... Si
MEM_PROFILE o MEM_CHECK se definen, hay incluso pequeñas estadísticas
realizadas las cuales cuentan los tamaños de los bloques (mostrado por
g_mem_profile() / g_mem_check()).
<P>Considerando el hecho de que glib provee una interface para salvar espacio en
pedazos de memoria si se tiene varios bloques que son siempre del mismo
tamaño y para marcarlos ALLOC_ONLY si es necesario, es sencillo crear
una pequeña envoltura para salvar (revisable para errores) alrededor del
malloc/free normal asimismo - igual que gdk cubre Xlib. ;)
<P>Utilizar g_error() y g_warning() dentro de aplicaciones como GIMP las cuales
utilizan gtk por completo incluso da la oportunidad de hacer saltar una ventana
que muestre los mensajes dentro de una ventana gtk con tu propio handler
(utilizando g_set_error_handler()) con el mismo estilo que gtk_print()
(dentro de gtkmain.c).
</BLOCKQUOTE>
<P>
<HR NOSHADE>
<A HREF="gtkfaq-es-7.html">Next</A>
<A HREF="gtkfaq-es-5.html">Previous</A>
<A HREF="gtkfaq-es.html#toc6">Contents</A>
</BODY>
</HTML>

View File

@@ -1,80 +0,0 @@
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 3.2 Final//EN">
<HTML>
<HEAD>
<META NAME="GENERATOR" CONTENT="SGML-Tools 1.0.6">
<TITLE>GTK+ FAQ: Contribuciones al GTK+ FAQ, Mantenedores y Copyright</TITLE>
<LINK HREF="gtkfaq-es-6.html" REL=previous>
<LINK HREF="gtkfaq-es.html#toc7" REL=contents>
</HEAD>
<BODY BGCOLOR="#FFFFFF">
Next
<A HREF="gtkfaq-es-6.html">Previous</A>
<A HREF="gtkfaq-es.html#toc7">Contents</A>
<HR NOSHADE>
<H2><A NAME="s7">7. Contribuciones al GTK+ FAQ, Mantenedores y Copyright</A></H2>
<P>Si desea hacer una contribución al FAQ, envíe a alguno de nosotros
un mensaje por correo electrónico con el texto exacto que cree que
debería ser incluído (pregunta y respuesta). ¡Con su ayuda, este
documento puede crecer y llegar a ser más útil!
<P>Este documento es mantenido por Nathan Froyd
<A HREF="mailto:maestrox@geocities.com">&lt;maestrox@geocities.com&gt;</A>
y Tony Gale
<A HREF="mailto:gale@gimp.org">&lt;gale@gimp.org&gt;</A>.
Este FAQ fue creado por Shawn T. Amundson
<A HREF="mailto:amundson@gimp.org">&lt;amundson@gimp.org&gt;</A> quien continúa dando soporte.
<P>El GTK+ FAQ está registrado Copyright (C) 1997, 1998 por Shawn T. Amundson,
Nathan Froyd y tony Gale.
<P>Se otorga permiso para hacer y distribuír copias textuales de este manual
siempre y cuando la información de copyright y este permiso se preserven en
todas las copias.
<P>Se otorga permiso para copiar y distribuir versiones modificados de este
documento bajo las condiciones para copiado textual, siempre y cuando esta
noticia de copyright se incluya exáctamente como en el original, y
que el trabajo resultante en su totalidad sea distribuído bajo los
términos de una noticia de permiso idéntica a esta.
<P>Se otorga permiso para copiar y distribuír traducciones de este documento
a otro lenguaje, bajo las condiciones anteriores de versiones modificadas.
<P>Si tiene intenciones de incorporar este documento en un trabajo publicado,
por favor contacte a uno de los mantenedores, y nos aseguraremos de que
obtenga la información más actual posible.
<P>No hay garantía de que este documento logre su propósito. Este documento
se proporciona simplemente como un recurso libre. Como tal, los autores y
mantenedores de la información proporcionada en él no pueden dar
garantía alguna de que la información es precisa.
<P>
<H2><A NAME="ss7.1">7.1 Nota del Traductor</A>
</H2>
<P>Esta traducción fue realizada por
<A HREF="http://www.talisman.com.pa">Ramsés Morales</A>.
He intentado hacer
la mejor adaptación posible de los términos técnicos, si tiene
alguna sugerencia o mejora a estos términos y mi español, o alguna
duda por causa de mi traducción, no dude en comunicármelo a
<A HREF="mailto:ramses@computer.org">&lt;ramses@computer.org&gt;</A><P>Gracias a
<A HREF="mailto: e98cuenc@criens.u-psud.fr">Joaquín Cuenca</A> por todas sus sugerencias para mejorar la
traducción, fueron de gran ayuda.
<P>--------------------------------------
<P>The GTK+ FAQ is Copyright (C) 1997,1998 by Shawn T. Amundson, Nathan Froyd and Tony Gale.
<P>Permission is granted to make and distribute verbatim copies of this manual provided the
copyright notice and this permission notice are preserved on all copies.
<P>Permission is granted to copy and distribute modified versions of this document under the conditions
for verbatim copying, provided that this copyright notice is included exactly as in the original,
and that the entire resulting derived work is distributed under the terms of a permission
notice identical to this one.
<P>Permission is granted to copy and distribute translations of this document into another language,
under the above conditions for modified versions.
<P>If you are intending to incorporate this document into a published work, please contact one of
the maintainers, and we will make an effort to ensure that you have the most up to date
information available.
<P>There is no guarentee that this document lives up to its intended
purpose. This is simply provided as a free resource. As such,
the authors and maintainers of the information provided within can
not make any guarentee that the information is even accurate.
<HR NOSHADE>
Next
<A HREF="gtkfaq-es-6.html">Previous</A>
<A HREF="gtkfaq-es.html#toc7">Contents</A>
</BODY>
</HTML>

View File

@@ -1,103 +0,0 @@
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 3.2 Final//EN">
<HTML>
<HEAD>
<META NAME="GENERATOR" CONTENT="SGML-Tools 1.0.6">
<TITLE>GTK+ FAQ</TITLE>
<LINK HREF="gtkfaq-es-1.html" REL=next>
</HEAD>
<BODY BGCOLOR="#FFFFFF">
<A HREF="gtkfaq-es-1.html">Next</A>
Previous
Contents
<HR NOSHADE>
<H1>GTK+ FAQ</H1>
<H2>Nathan Froyd, Tony Gale, Shawn T. Amundson.</H2>Seis de Julio de 1998
<P><HR NOSHADE>
<EM>La intención de este documento es dar respuesta a las preguntas
realizadas con más frecuencia por parte de los programadores que utilizan GTK+ o simplemente por personas que desean utilizar GTK+. </EM>
<HR NOSHADE>
<P>
<H2><A NAME="toc1">1.</A> <A HREF="gtkfaq-es-1.html">Información General</A></H2>
<UL>
<LI><A HREF="gtkfaq-es-1.html#ss1.1">1.1 Autores</A>
<LI><A HREF="gtkfaq-es-1.html#ss1.2">1.2 ¿Qué es GTK+?</A>
<LI><A HREF="gtkfaq-es-1.html#ss1.3">1.3 ¿Qué es el + en GTK+?</A>
<LI><A HREF="gtkfaq-es-1.html#ss1.4">1.4 ¿La G en GTK+ significa General, Gimp, o GNU?</A>
<LI><A HREF="gtkfaq-es-1.html#ss1.5">1.5 ¿Dónde está la documentación para GTK?</A>
<LI><A HREF="gtkfaq-es-1.html#ss1.6">1.6 ¿Hay alguna lista de correo (o archivo de lista de correo) para GTK+?</A>
<LI><A HREF="gtkfaq-es-1.html#ss1.7">1.7 ¿La lista gtk-list no ha tenido tráfico alguno por días,</A>
<LI><A HREF="gtkfaq-es-1.html#ss1.8">1.8 Cómo conseguir ayuda con GTK+</A>
<LI><A HREF="gtkfaq-es-1.html#ss1.9">1.9 Cómo reportar errores en GTK+</A>
<LI><A HREF="gtkfaq-es-1.html#ss1.10">1.10 ¿Qué aplicaciones se han escrito con GTK+?</A>
<LI><A HREF="gtkfaq-es-1.html#ss1.11">1.11 Estoy buscando una aplicación que escribir en GTK+. ¿Qué tal un cliente IRC?</A>
</UL>
<P>
<H2><A NAME="toc2">2.</A> <A HREF="gtkfaq-es-2.html">Cómo encontrar, configurar, instalar y comprobar GTK+</A></H2>
<UL>
<LI><A HREF="gtkfaq-es-2.html#ss2.1">2.1 ¿Qué necesito para correr GTK+?</A>
<LI><A HREF="gtkfaq-es-2.html#ss2.2">2.2 ¿Dónde puedo conseguir GTK+?</A>
<LI><A HREF="gtkfaq-es-2.html#ss2.3">2.3 ¿Cómo configuro/compilo GTK+?</A>
<LI><A HREF="gtkfaq-es-2.html#ss2.4">2.4 Cuando compilo GTK+ obtengo un error como: <CODE>make: file `Makefile' line 456: Syntax error</CODE></A>
<LI><A HREF="gtkfaq-es-2.html#ss2.5">2.5 ¡He compilado e instalado GTK+, pero no puedo lograr que los programas se enlacen con él!</A>
<LI><A HREF="gtkfaq-es-2.html#ss2.6">2.6 Cuando compilo programas con GTK+, obtengo mensajes de error del compilador diciendo que no es capaz de encontrar <CODE>"glibconfig.h"</CODE>.</A>
<LI><A HREF="gtkfaq-es-2.html#ss2.7">2.7 Cuando instalo El GIMP, configure reporta que no puede encontrar GTK.</A>
</UL>
<P>
<H2><A NAME="toc3">3.</A> <A HREF="gtkfaq-es-3.html">Desarrollo de GTK+</A></H2>
<UL>
<LI><A HREF="gtkfaq-es-3.html#ss3.1">3.1 ¿Qué es esta cosa CVS de la cual todo el mundo habla, y cómo puedo acceder a ella?</A>
<LI><A HREF="gtkfaq-es-3.html#ss3.2">3.2 ¿Cómo puedo contribuír a GTK+?</A>
<LI><A HREF="gtkfaq-es-3.html#ss3.3">3.3 ¿Cómo averiguo si mi parche fue aplicado, y si no, por qué no?</A>
<LI><A HREF="gtkfaq-es-3.html#ss3.4">3.4 ¿Cuál es la política sobre la incorporación de nuevos <EM>widgets</EM> en la librería?</A>
<LI><A HREF="gtkfaq-es-3.html#ss3.5">3.5 ¿Hay alguien trabajando en atamientos para otros lenguajes distintos a C?</A>
</UL>
<P>
<H2><A NAME="toc4">4.</A> <A HREF="gtkfaq-es-4.html">Desarrollo con GTK+</A></H2>
<UL>
<LI><A HREF="gtkfaq-es-4.html#ss4.1">4.1 ¿Cómo empiezo?</A>
<LI><A HREF="gtkfaq-es-4.html#ss4.2">4.2 ¿Qué <EM>widgets</EM> existen en GTK?</A>
<LI><A HREF="gtkfaq-es-4.html#ss4.3">4.3 ¿GTK+ es seguro ante múltiples hilos?</A>
<LI><A HREF="gtkfaq-es-4.html#ss4.4">4.4 ¿Cómo puedo prevenir el redibujar y reacomodar tamaños mientras cambio múltiples <EM>widgets</EM>?</A>
<LI><A HREF="gtkfaq-es-4.html#ss4.5">4.5 ¿Cómo atrapo un evento de doble tecleo (en un <EM>widget</EM> de lista, por ejemplo)?</A>
<LI><A HREF="gtkfaq-es-4.html#ss4.6">4.6 ¿Cómo puedo averiguar cuál es la selección de un GtkList?</A>
<LI><A HREF="gtkfaq-es-4.html#ss4.7">4.7 ¿Acaso es posible desplegar un texto que se recorte para que quepa dentro del lugar que tenga asignado?</A>
<LI><A HREF="gtkfaq-es-4.html#ss4.8">4.8 ¿Por qué el contenido de un botón no se mueve al presionar el botón? Aquí les envío un parche para que funcione de esa forma...</A>
<LI><A HREF="gtkfaq-es-4.html#ss4.9">4.9 ¿Cómo puedo definir una línea de separación como en un menú?</A>
<LI><A HREF="gtkfaq-es-4.html#ss4.10">4.10 ¿Cómo puedo darle justificación a la derecha a un menú, como Help, cuando utilizo MenuFactory?</A>
<LI><A HREF="gtkfaq-es-4.html#ss4.11">4.11 ¿Cómo hago mi ventana modal? / ¿Cómo hago una sóla ventana activa?</A>
<LI><A HREF="gtkfaq-es-4.html#ss4.12">4.12 ¿Por qué mi <EM>widget</EM> (ej. progressbar) no se actualiza?</A>
</UL>
<P>
<H2><A NAME="toc5">5.</A> <A HREF="gtkfaq-es-5.html">Acerca de gdk</A></H2>
<UL>
<LI><A HREF="gtkfaq-es-5.html#ss5.1">5.1 ¿Qué es gdk?</A>
<LI><A HREF="gtkfaq-es-5.html#ss5.2">5.2 ¿Cómo utilizo la asignación de colores?</A>
</UL>
<P>
<H2><A NAME="toc6">6.</A> <A HREF="gtkfaq-es-6.html">Acerca de glib</A></H2>
<UL>
<LI><A HREF="gtkfaq-es-6.html#ss6.1">6.1 ¿Qué es glib?</A>
<LI><A HREF="gtkfaq-es-6.html#ss6.2">6.2 ¿Por qué utilizar g_print, g_malloc, g_strdup y funciones compañeras de glib?</A>
</UL>
<P>
<H2><A NAME="toc7">7.</A> <A HREF="gtkfaq-es-7.html">Contribuciones al GTK+ FAQ, Mantenedores y Copyright</A></H2>
<UL>
<LI><A HREF="gtkfaq-es-7.html#ss7.1">7.1 Nota del Traductor</A>
</UL>
<HR NOSHADE>
<A HREF="gtkfaq-es-1.html">Next</A>
Previous
Contents
</BODY>
</HTML>

File diff suppressed because it is too large Load Diff

View File

@@ -79,7 +79,7 @@ approved by Peter Mattis.
This is edition @value{edition} of the GTK documentation,
@w{@value{update-date}}.
@end ifinfo
@c FIXME: Do an introduction to the GTK?
@c FIXME: Do a introduction to the GTK?
@menu
* Copying:: Your rights.
@@ -288,7 +288,7 @@ form that is easier to parse. Tools for generating bindings of Gtk to
other languages can read these declarations and---because all the
important details are defined---automatically generate the bulk of the
needed glue code. It is also possible to feed these declarations into a
running application (an interface builder, say) and thus make it aware of
running application (a interface builder, say) and thus make it aware of
new widgets and functions without recompiling anything.
The run-time side of the type system is also somewhat introspective.
@@ -320,7 +320,7 @@ inherit these rules from their fundamental type. For example,
derive from @samp{GtkObject} and so the rules for @samp{GtkObject} apply
to all widgets as well.
This derivation defines a type hierarchy, but this hierarchy is not
This derivation defines a type hierachy, but this hierachy is not
completely general. You can't derive from @samp{int} for example, and
you can only have one level of derivation from @samp{enum}. The
fundamental type @samp{GtkObject}, however, is the basis for the large
@@ -382,7 +382,7 @@ to a fundamental type and thus there is no name for it.
@deftp {Data type} GtkType
The type @code{GtkType} holds the run-time representation of a type. It
is an integer of a certain size. The follwing macros are defined to
is a integer of a certain size. The follwing macros are defined to
access the basic properties of a @code{GtkType}:
@deftypefn {Macro} {unsigned int} GTK_TYPE_SEQNO (GtkType type)
@@ -461,7 +461,7 @@ always return @code{NULL}.
@item
The @code{class_init_func} and @code{base_class_init_func} fields are
callbacks which are used by the type mechanism to initialize class
specific fields. The single argument these functions take is a pointer to
specific fields. The single argument these function taks is a pointer to
a class structure. When you do not need one or both of them, set the
corresponding field to @code{NULL}. The @code{class_init_func} will be
called at most once, right after the class structure of size

View File

@@ -11,7 +11,7 @@ Tony Gale <tt><htmlurl url="mailto:gale@gtk.org"
name="&lt;gale@gtk.org&gt;"></tt>,
Ian Main <tt><htmlurl url="mailto:imain@gtk.org"
name="&lt;imain@gtk.org&gt;"></tt>
<date>February 23rd, 2000
<date>November 13th, 1999
<abstract>
This is a tutorial on how to use GTK (the GIMP Toolkit) through its C
interface.
@@ -33,7 +33,7 @@ open software, free software, or even commercial non-free software
using GTK without having to spend anything for licenses or royalties.
It's called the GIMP toolkit because it was originally written for
developing the GNU Image Manipulation Program (GIMP), but GTK has
developing the General Image Manipulation Program (GIMP), but GTK has
now been used in a large number of software projects, including the
GNU Network Object Model Environment (GNOME) project. GTK is built on
top of GDK (GIMP Drawing Kit) which is basically a wrapper around the
@@ -839,32 +839,16 @@ So, by passing in the widget you wish to remove the handler from, and
the tag returned by one of the signal_connect functions, you can
disconnect a signal handler.
You can also temporarily disable signal handlers with the
gtk_signal_handler_block() and gtk_signal_handler_unblock() family of
functions.
Another function to remove all the signal handers from an object is:
<tscreen><verb>
void gtk_signal_handler_block( GtkObject *object,
guint handler_id );
void gtk_signal_handler_block_by_func( GtkObject *object,
GtkSignalFunc func,
gpointer data );
void gtk_signal_handler_block_by_data( GtkObject *object,
gpointer data );
void gtk_signal_handler_unblock( GtkObject *object,
guint handler_id );
void gtk_signal_handler_unblock_by_func( GtkObject *object,
GtkSignalFunc func,
gpointer data );
void gtk_signal_handler_unblock_by_data( GtkObject *object,
gpointer data);
void gtk_signal_handlers_destroy( GtkObject *object );
</verb></tscreen>
This call is fairly self explanatory. It simply removes all the
current signal handlers from the object passed in as the first
argument.
<!-- ----------------------------------------------------------------- -->
<sect1>An Upgraded Hello World
<p>
@@ -4858,7 +4842,6 @@ The following code is an example of using an Entry widget.
<tscreen><verb>
/* example-start entry entry.c */
#include <stdio.h>
#include <gtk/gtk.h>
void enter_callback( GtkWidget *widget,
@@ -5187,7 +5170,6 @@ It's example time again.
<tscreen><verb>
/* example-start spinbutton spinbutton.c */
#include <stdio.h>
#include <gtk/gtk.h>
static GtkWidget *spinner1;
@@ -5583,578 +5565,6 @@ gtk_combo_set_item_string(GtkCombo *combo, GtkItem *item, const gchar
appropriate Item. Frankly, I have no idea how to do that.
-->
<!-- ----------------------------------------------------------------- -->
<sect1> Calendar
<p>
The Calendar widget is an effective way to display and retrieve
monthly date related information. It is a very simple widget to create
and work with.
Creating a GtkCalendar widget is a simple as:
<tscreen><verb>
GtkWidget *gtk_calendar_new();
</verb></tscreen>
There might be times where you need to change a lot of information
within this widget and the following functions allow you to make
multiple change to a Calendar widget without the user seeing multiple
on-screen updates.
<tscreen><verb>
void gtk_calendar_freeze( GtkCalendar *Calendar );
void gtk_calendar_thaw ( GtkCalendar *Calendar );
</verb></tscreen>
They work just like the freeze/thaw functions of every other
widget.
The Calendar widget has a few options that allow you to change the way
the widget both looks and operates by using the function
<tscreen><verb>
void gtk_calendar_display_options( GtkCalendar *calendar,
GtkCalendarDisplayOptions flags );
</verb></tscreen>
The <tt/flags/ argument can be formed by combining either of the
following five options using the logical bitwise OR (|) operation:
<itemize>
<item> GTK_CALENDAR_SHOW_HEADING - this option specifies that
the month and year should be shown when drawing the calendar.
<item> GTK_CALENDAR_SHOW_DAY_NAMES - this option specifies that the
three letter descriptions should be displayed for each day (eg
MON,TUE...).
<item> GTK_CALENDAR_NO_MONTH_CHANGE - this option states that the user
should not and can not change the currently displayed month. This can
be good if you only need to display a particular month such as if you
are displaying 12 calendar widgets for every month in a particular
year.
<item> GTK_CALENDAR_SHOW_WEEK_NUMBERS - this option specifies that the
number for each week should be displayed down the left side of the
calendar. (eg. Jan 1 = Week 1,Dec 31 = Week 52).
<item> GTK_CALENDAR_WEEK_START_MONDAY - this option states that the
calander week will start on Monday instead of Sunday which is the
default. This only affects the order in which days are displayed from
left to right.
</itemize>
The following functions are used to set the the currently displayed
date:
<tscreen><verb>
gint gtk_calendar_select_month( GtkCalendar *calendar,
guint month,
guint year );
void gtk_calendar_select_day( GtkCalendar *calendar,
guint day );
</verb></tscreen>
The return value from <tt/gtk_calendar_select_month()/ is a boolean
value indicating whether the selection was successful.
With <tt/gtk_calendar_select_day()/ the specified day number is
selected within the current month, if that is possible. A
<tt/day/ value of 0 will deselect any current selection.
In addition to having a day selected, any number of days in the month
may be "marked". A marked day is highlighted within the calendar
display. The following functions are provided to manipulate marked
days:
<tscreen><verb>
gint gtk_calendar_mark_day( GtkCalendar *calendar,
guint day);
gint gtk_calendar_unmark_day( GtkCalendar *calendar,
guint day);
void gtk_calendar_clear_marks( GtkCalendar *calendar);
</verb></tscreen>
The currently marked days are stored within an array within the
GtkCalendar structure. This array is 31 elements long so to test
whether a particular day is currently marked, you need to access the
corresponding element of the array (don't forget in C that array
elements are numbered 0 to n-1). For example:
<tscreen><verb>
GtkCalendar *calendar;
calendar = gtk_calendar_new();
...
/* Is day 7 marked? */
if (calendar->marked_date[7-1])
/* day is marked */
</verb></tscreen>
Note that marks are persistent across month and year changes.
The final Calendar widget function is used to retrieve the currently
selected date, month and/or year.
<tscreen><verb>
void gtk_calendar_get_date( GtkCalendar *calendar,
guint *year,
guint *month,
guint *day );
</verb></tscreen>
This function requires you to pass the addresses of <tt/guint/
variables, into which the result will be placed. Passing <tt/NULL/ as
a value will result in the corresponding value not being returned.
The Calendar widget can generate a number of signals indicating date
selection and change. The names of these signals are self explanatory,
and are:
<itemize>
<item> <tt/month_changed/
<item> <tt/day_selected/
<item> <tt/day_selected_double_click/
<item> <tt/prev_month/
<item> <tt/next_month/
<item> <tt/prev_year/
<item> <tt/next_year/
</itemize>
That just leaves us with the need to put all of this together into
example code.
<tscreen><verb>
/* example-start calendar calendar.c */
/*
* Copyright (C) 1998 Cesar Miquel, Shawn T. Amundson, Mattias Grönlund
* Copyright (C) 2000 Tony Gale
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation; either version 2 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program; if not, write to the Free Software
* Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
*/
#include <gtk/gtk.h>
#include <stdio.h>
#include <string.h>
#include <time.h>
#define DEF_PAD 10
#define DEF_PAD_SMALL 5
#define TM_YEAR_BASE 1900
typedef struct _CalendarData {
GtkWidget *flag_checkboxes[5];
gboolean settings[5];
gchar *font;
GtkWidget *font_dialog;
GtkWidget *window;
GtkWidget *prev2_sig;
GtkWidget *prev_sig;
GtkWidget *last_sig;
GtkWidget *month;
} CalendarData;
enum {
calendar_show_header,
calendar_show_days,
calendar_month_change,
calendar_show_week,
calendar_monday_first
};
/*
* GtkCalendar
*/
void calendar_date_to_string( CalendarData *data,
char *buffer,
gint buff_len )
{
struct tm tm;
time_t time;
memset (&amp;tm, 0, sizeof (tm));
gtk_calendar_get_date (GTK_CALENDAR(data->window),
&amp;tm.tm_year, &amp;tm.tm_mon, &amp;tm.tm_mday);
tm.tm_year -= TM_YEAR_BASE;
time = mktime(&amp;tm);
strftime (buffer, buff_len-1, "%x", gmtime(&amp;time));
}
void calendar_set_signal_strings( char *sig_str,
CalendarData *data)
{
gchar *prev_sig;
gtk_label_get (GTK_LABEL (data->prev_sig), &amp;prev_sig);
gtk_label_set (GTK_LABEL (data->prev2_sig), prev_sig);
gtk_label_get (GTK_LABEL (data->last_sig), &amp;prev_sig);
gtk_label_set (GTK_LABEL (data->prev_sig), prev_sig);
gtk_label_set (GTK_LABEL (data->last_sig), sig_str);
}
void calendar_month_changed( GtkWidget *widget,
CalendarData *data )
{
char buffer[256] = "month_changed: ";
calendar_date_to_string (data, buffer+15, 256-15);
calendar_set_signal_strings (buffer, data);
}
void calendar_day_selected( GtkWidget *widget,
CalendarData *data )
{
char buffer[256] = "day_selected: ";
calendar_date_to_string (data, buffer+14, 256-14);
calendar_set_signal_strings (buffer, data);
}
void calendar_day_selected_double_click( GtkWidget *widget,
CalendarData *data )
{
struct tm tm;
char buffer[256] = "day_selected_double_click: ";
calendar_date_to_string (data, buffer+27, 256-27);
calendar_set_signal_strings (buffer, data);
memset (&amp;tm, 0, sizeof (tm));
gtk_calendar_get_date (GTK_CALENDAR(data->window),
&amp;tm.tm_year, &amp;tm.tm_mon, &amp;tm.tm_mday);
tm.tm_year -= TM_YEAR_BASE;
if(GTK_CALENDAR(data->window)->marked_date[tm.tm_mday-1] == 0) {
gtk_calendar_mark_day(GTK_CALENDAR(data->window),tm.tm_mday);
} else {
gtk_calendar_unmark_day(GTK_CALENDAR(data->window),tm.tm_mday);
}
}
void calendar_prev_month( GtkWidget *widget,
CalendarData *data )
{
char buffer[256] = "prev_month: ";
calendar_date_to_string (data, buffer+12, 256-12);
calendar_set_signal_strings (buffer, data);
}
void calendar_next_month( GtkWidget *widget,
CalendarData *data )
{
char buffer[256] = "next_month: ";
calendar_date_to_string (data, buffer+12, 256-12);
calendar_set_signal_strings (buffer, data);
}
void calendar_prev_year( GtkWidget *widget,
CalendarData *data )
{
char buffer[256] = "prev_year: ";
calendar_date_to_string (data, buffer+11, 256-11);
calendar_set_signal_strings (buffer, data);
}
void calendar_next_year( GtkWidget *widget,
CalendarData *data )
{
char buffer[256] = "next_year: ";
calendar_date_to_string (data, buffer+11, 256-11);
calendar_set_signal_strings (buffer, data);
}
void calendar_set_flags( CalendarData *calendar )
{
gint i;
gint options=0;
for (i=0;i<5;i++)
if (calendar->settings[i])
{
options=options + (1<<i);
}
if (calendar->window)
gtk_calendar_display_options (GTK_CALENDAR (calendar->window), options);
}
void calendar_toggle_flag( GtkWidget *toggle,
CalendarData *calendar )
{
gint i;
gint j;
j=0;
for (i=0; i<5; i++)
if (calendar->flag_checkboxes[i] == toggle)
j = i;
calendar->settings[j]=!calendar->settings[j];
calendar_set_flags(calendar);
}
void calendar_font_selection_ok( GtkWidget *button,
CalendarData *calendar )
{
GtkStyle *style;
GdkFont *font;
calendar->font = gtk_font_selection_dialog_get_font_name(
GTK_FONT_SELECTION_DIALOG (calendar->font_dialog));
if (calendar->window)
{
font = gtk_font_selection_dialog_get_font(GTK_FONT_SELECTION_DIALOG(calendar->font_dialog));
if (font)
{
style = gtk_style_copy (gtk_widget_get_style (calendar->window));
gdk_font_unref (style->font);
style->font = font;
gdk_font_ref (style->font);
gtk_widget_set_style (calendar->window, style);
}
}
}
void calendar_select_font( GtkWidget *button,
CalendarData *calendar )
{
GtkWidget *window;
if (!calendar->font_dialog) {
window = gtk_font_selection_dialog_new ("Font Selection Dialog");
g_return_if_fail(GTK_IS_FONT_SELECTION_DIALOG(window));
calendar->font_dialog = window;
gtk_window_position (GTK_WINDOW (window), GTK_WIN_POS_MOUSE);
gtk_signal_connect (GTK_OBJECT (window), "destroy",
GTK_SIGNAL_FUNC (gtk_widget_destroyed),
&amp;calendar->font_dialog);
gtk_signal_connect (GTK_OBJECT (GTK_FONT_SELECTION_DIALOG (window)->ok_button),
"clicked", GTK_SIGNAL_FUNC(calendar_font_selection_ok),
calendar);
gtk_signal_connect_object (GTK_OBJECT (GTK_FONT_SELECTION_DIALOG (window)->cancel_button),
"clicked",
GTK_SIGNAL_FUNC (gtk_widget_destroy),
GTK_OBJECT (calendar->font_dialog));
}
window=calendar->font_dialog;
if (!GTK_WIDGET_VISIBLE (window))
gtk_widget_show (window);
else
gtk_widget_destroy (window);
}
void create_calendar()
{
GtkWidget *window;
GtkWidget *vbox, *vbox2, *vbox3;
GtkWidget *hbox;
GtkWidget *hbbox;
GtkWidget *calendar;
GtkWidget *toggle;
GtkWidget *button;
GtkWidget *frame;
GtkWidget *separator;
GtkWidget *label;
GtkWidget *bbox;
static CalendarData calendar_data;
gint i;
struct {
char *label;
} flags[] =
{
{ "Show Heading" },
{ "Show Day Names" },
{ "No Month Change" },
{ "Show Week Numbers" },
{ "Week Start Monday" }
};
calendar_data.window = NULL;
calendar_data.font = NULL;
calendar_data.font_dialog = NULL;
for (i=0; i<5; i++) {
calendar_data.settings[i]=0;
}
window = gtk_window_new (GTK_WINDOW_TOPLEVEL);
gtk_window_set_title(GTK_WINDOW(window), "GtkCalendar Example");
gtk_container_border_width (GTK_CONTAINER (window), 5);
gtk_signal_connect(GTK_OBJECT(window), "destroy",
GTK_SIGNAL_FUNC(gtk_main_quit),
NULL);
gtk_signal_connect(GTK_OBJECT(window), "delete-event",
GTK_SIGNAL_FUNC(gtk_false),
NULL);
gtk_window_set_policy(GTK_WINDOW(window), FALSE, FALSE, TRUE);
vbox = gtk_vbox_new(FALSE, DEF_PAD);
gtk_container_add (GTK_CONTAINER (window), vbox);
/*
* The top part of the window, Calendar, flags and fontsel.
*/
hbox = gtk_hbox_new(FALSE, DEF_PAD);
gtk_box_pack_start (GTK_BOX(vbox), hbox, TRUE, TRUE, DEF_PAD);
hbbox = gtk_hbutton_box_new();
gtk_box_pack_start(GTK_BOX(hbox), hbbox, FALSE, FALSE, DEF_PAD);
gtk_button_box_set_layout(GTK_BUTTON_BOX(hbbox), GTK_BUTTONBOX_SPREAD);
gtk_button_box_set_spacing(GTK_BUTTON_BOX(hbbox), 5);
/* Calendar widget */
frame = gtk_frame_new("Calendar");
gtk_box_pack_start(GTK_BOX(hbbox), frame, FALSE, TRUE, DEF_PAD);
calendar=gtk_calendar_new();
calendar_data.window = calendar;
calendar_set_flags(&amp;calendar_data);
gtk_calendar_mark_day ( GTK_CALENDAR(calendar), 19);
gtk_container_add( GTK_CONTAINER( frame), calendar);
gtk_signal_connect (GTK_OBJECT (calendar), "month_changed",
GTK_SIGNAL_FUNC (calendar_month_changed),
&amp;calendar_data);
gtk_signal_connect (GTK_OBJECT (calendar), "day_selected",
GTK_SIGNAL_FUNC (calendar_day_selected),
&amp;calendar_data);
gtk_signal_connect (GTK_OBJECT (calendar), "day_selected_double_click",
GTK_SIGNAL_FUNC (calendar_day_selected_double_click),
&amp;calendar_data);
gtk_signal_connect (GTK_OBJECT (calendar), "prev_month",
GTK_SIGNAL_FUNC (calendar_prev_month),
&amp;calendar_data);
gtk_signal_connect (GTK_OBJECT (calendar), "next_month",
GTK_SIGNAL_FUNC (calendar_next_month),
&amp;calendar_data);
gtk_signal_connect (GTK_OBJECT (calendar), "prev_year",
GTK_SIGNAL_FUNC (calendar_prev_year),
&amp;calendar_data);
gtk_signal_connect (GTK_OBJECT (calendar), "next_year",
GTK_SIGNAL_FUNC (calendar_next_year),
&amp;calendar_data);
separator = gtk_vseparator_new ();
gtk_box_pack_start (GTK_BOX (hbox), separator, FALSE, TRUE, 0);
vbox2 = gtk_vbox_new(FALSE, DEF_PAD);
gtk_box_pack_start(GTK_BOX(hbox), vbox2, FALSE, FALSE, DEF_PAD);
/* Build the Right frame with the flags in */
frame = gtk_frame_new("Flags");
gtk_box_pack_start(GTK_BOX(vbox2), frame, TRUE, TRUE, DEF_PAD);
vbox3 = gtk_vbox_new(TRUE, DEF_PAD_SMALL);
gtk_container_add(GTK_CONTAINER(frame), vbox3);
for (i = 0; i < 5; i++)
{
toggle = gtk_check_button_new_with_label(flags[i].label);
gtk_signal_connect (GTK_OBJECT (toggle),
"toggled",
GTK_SIGNAL_FUNC(calendar_toggle_flag),
&amp;calendar_data);
gtk_box_pack_start (GTK_BOX (vbox3), toggle, TRUE, TRUE, 0);
calendar_data.flag_checkboxes[i]=toggle;
}
/* Build the right font-button */
button = gtk_button_new_with_label("Font...");
gtk_signal_connect (GTK_OBJECT (button),
"clicked",
GTK_SIGNAL_FUNC(calendar_select_font),
&amp;calendar_data);
gtk_box_pack_start (GTK_BOX (vbox2), button, FALSE, FALSE, 0);
/*
* Build the Signal-event part.
*/
frame = gtk_frame_new("Signal events");
gtk_box_pack_start(GTK_BOX(vbox), frame, TRUE, TRUE, DEF_PAD);
vbox2 = gtk_vbox_new(TRUE, DEF_PAD_SMALL);
gtk_container_add(GTK_CONTAINER(frame), vbox2);
hbox = gtk_hbox_new (FALSE, 3);
gtk_box_pack_start (GTK_BOX (vbox2), hbox, FALSE, TRUE, 0);
label = gtk_label_new ("Signal:");
gtk_box_pack_start (GTK_BOX (hbox), label, FALSE, TRUE, 0);
calendar_data.last_sig = gtk_label_new ("");
gtk_box_pack_start (GTK_BOX (hbox), calendar_data.last_sig, FALSE, TRUE, 0);
hbox = gtk_hbox_new (FALSE, 3);
gtk_box_pack_start (GTK_BOX (vbox2), hbox, FALSE, TRUE, 0);
label = gtk_label_new ("Previous signal:");
gtk_box_pack_start (GTK_BOX (hbox), label, FALSE, TRUE, 0);
calendar_data.prev_sig = gtk_label_new ("");
gtk_box_pack_start (GTK_BOX (hbox), calendar_data.prev_sig, FALSE, TRUE, 0);
hbox = gtk_hbox_new (FALSE, 3);
gtk_box_pack_start (GTK_BOX (vbox2), hbox, FALSE, TRUE, 0);
label = gtk_label_new ("Second previous signal:");
gtk_box_pack_start (GTK_BOX (hbox), label, FALSE, TRUE, 0);
calendar_data.prev2_sig = gtk_label_new ("");
gtk_box_pack_start (GTK_BOX (hbox), calendar_data.prev2_sig, FALSE, TRUE, 0);
bbox = gtk_hbutton_box_new ();
gtk_box_pack_start (GTK_BOX (vbox), bbox, FALSE, FALSE, 0);
gtk_button_box_set_layout(GTK_BUTTON_BOX(bbox), GTK_BUTTONBOX_END);
button = gtk_button_new_with_label ("Close");
gtk_signal_connect (GTK_OBJECT (button), "clicked",
GTK_SIGNAL_FUNC (gtk_main_quit),
NULL);
gtk_container_add (GTK_CONTAINER (bbox), button);
GTK_WIDGET_SET_FLAGS (button, GTK_CAN_DEFAULT);
gtk_widget_grab_default (button);
gtk_widget_show_all(window);
}
int main(int argc,
char *argv[] )
{
gtk_set_locale ();
gtk_init (&amp;argc, &amp;argv);
create_calendar();
gtk_main();
return(0);
}
/* example-end */
</verb></tscreen>
<!-- ----------------------------------------------------------------- -->
<sect1> Color Selection
<p>
@@ -6654,7 +6064,7 @@ the <ref id="sec_ProgressBar" name="Progress Bar"> widget.
<sect1> Fixed Container
<p>
The Fixed container allows you to place widgets at a fixed position
within its window, relative to its upper left hand corner. The
within it's window, relative to it's upper left hand corner. The
position of the widgets can be changed dynamically.
There are only three functions associated with the fixed widget:
@@ -7095,7 +6505,6 @@ window.
<tscreen><verb>
/* example-start paned paned.c */
#include <stdio.h>
#include <gtk/gtk.h>
/* Create the list of "messages" */
@@ -7342,7 +6751,6 @@ new to you.
<tscreen><verb>
/* example-start scrolledwin scrolledwin.c */
#include <stdio.h>
#include <gtk/gtk.h>
void destroy( GtkWidget *widget,
@@ -8222,7 +7630,6 @@ backward manner, and exit the program.
<tscreen><verb>
/* example-start notebook notebook.c */
#include <stdio.h>
#include <gtk/gtk.h>
/* This function rotates the position of the tabs */
@@ -10143,7 +9550,6 @@ That should about do it. Let's take a look at an example to help clarify.
<tscreen><verb>
/* example-start menu menu.c */
#include <stdio.h>
#include <gtk/gtk.h>
static gint button_press (GtkWidget *, GdkEvent *);
@@ -10852,6 +10258,9 @@ When you do come to understand all the functions of a new undocumented
widget, please consider writing a tutorial on it so others may benefit
from your time.
<!-- ----------------------------------------------------------------- -->
<sect1> Calendar
<p>
<!-- ----------------------------------------------------------------- -->
<sect1> CTree
<p>
@@ -17300,7 +16709,6 @@ gtk_dial_adjustment_value_changed (GtkAdjustment *adjustment,
<sect2> dial_test.c
<p>
<tscreen><verb>
#include <stdio.h>
#include <gtk/gtk.h>
#include "gtkdial.h"

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

View File

@@ -1,350 +0,0 @@
#!/usr/bin/python
import xmllib;
import sys;
import string
import re
def html_subst(s):
if s.group(1) != None:
return s.group(0)
elif s.group(2) != None:
return '<a href="' + s.group(0) + '">' + s.group(0) + '</a>'
elif s.group(3) != None:
return '<a href="mailto:' + s.group(0) + '">' + s.group(0) + '</a>'
def htmlify(str):
return re.sub ("(<[^>]*>)|(http://[~.:/\w-]+)|([\w._!-]+@[\w_-]+).[\w_-]+", html_subst, str)
def bug_subst(s):
if s.group(1) != None:
return s.group(0)
else:
n = s.group(2)
return '<a href="http://bugs.gnome.org/db/%s/%s.html">#%s</a>' % (n[0:2], n, n)
def bugify(str):
str = re.sub ("(<[^>]*>)|#(\d+)", bug_subst, str)
return htmlify(str)
def make_id(str):
return re.sub ("[^a-z]","-", string.lower(str))
class ParseError (Exception):
pass
class Entry:
def __init__(self):
self.description = None
self.title = None
self.url = None
self.contact = None
self.bugs = None
def set_size(self, size):
size = string.lower(size)
if size == "small":
self.size = "Small"
elif size == "medium":
self.size = "Medium"
elif size == "big":
self.size = "Big"
else:
raise ParseError, 'size must be "small", "medium", or "big"'
def output(self):
if self.size == "Big":
bgcolor = "#88bb88"
elif self.size == "Medium":
bgcolor = "#b4d4b4"
else:
bgcolor = "#d0e0d0"
print '''<table cellspacing="0" cellpadding="2" width="97%%" border="0" bgcolor="#000000">
<tbody><tr><td colspan=2>
<table cellspacing="0" cellpadding="5" width="100%%" border="0" bgcolor="#ffffff">
<tbody>
<tr bgcolor="%s">
<td align="left"><font size="+1">%s</font></font></td>
<td align="left" width="20%%"><b>Size</b>: %s</td>
<td align="center" width="20%%"><b>Status</b>: %s</td>
<td align="right" width="20%%"><b>Target Version</b>: %s</td>
</tr>
<tr>
<td colspan=4>
%s
<table cellspacing="0" cellpadding="0">
<tbody>''' % (bgcolor, self.title, self.size, self.status, self.target, htmlify(self.description))
if self.url != None:
print '''<tr><td width="0"><b>More Info</b>:</td>
<td>%s</td>
</tr>''' % htmlify (self.url)
if self.bugs != None:
print '''<tr><td width="0"><b>Bug Reports</b>:</td>
<td>%s</td>
</tr>''' % bugify (self.bugs)
if self.contact != None:
print '''<tr><td width="0"><b>Contact</b>:</td>
<td>%s</td>
</tr>''' % htmlify (self.contact)
print '''</tbody>
</table>
</td>
</tr>
</tbody></table>
</td></tr></tbody></table>
'''
class Section:
def __init__(self):
self.title = None
self.entries = []
def output(self):
print '<h2><a name="%s">%s</a></h2>' % (make_id(self.title), self.title)
first = 1
for entry in self.entries:
if not first:
print "<br>"
first = 0
entry.output()
class TodoParser (xmllib.XMLParser):
def __init__(self):
xmllib.XMLParser.__init__(self)
self.in_todo = 0
self.in_data = 0
self.data = ""
self.section = None
self.entry = None
self.logourl = None
self.title = None
self.sections = []
self.entitydefs = {}
def start_todo(self,attributes):
if self.in_todo:
raise ParseError, "<todo> tags may not be nested"
if attributes.has_key ("logourl"):
self.logourl = attributes["logourl"]
self.in_todo = 1
def end_todo(self):
self.in_todo = 0
def start_section(self,attributes):
if self.section:
raise ParseError, "<section> tags may not be nested"
self.section = Section()
def end_section(self):
if self.section.title == None:
raise ParseError, "<section> requires <title>"
self.sections.append(self.section)
self.section = None
def start_title(self,attributes):
if not self.in_todo:
raise ParseError, "<title> tag must be in <todo>, <section> or <entry>"
if self.in_data:
raise ParseError, "Unexpected <title> tag in content"
self.in_data = 1
def end_title(self):
self.in_data = 0
if self.entry:
self.entry.title = self.data
elif self.section:
self.section.title = self.data
else:
self.title = self.data
self.data = ""
def start_description(self,attributes):
if not self.entry:
raise ParseError, "<description> tag must be in <entry>"
if self.in_data:
raise ParseError, "Unexpected <description> tag in content"
self.in_data = 1
def end_description(self):
self.in_data = 0
self.entry.description = self.data
self.data = ""
def start_url(self,attributes):
if not self.entry:
raise ParseError, "<url> tag must be in <entry>"
if self.in_data:
raise ParseError, "Unexpected <url> tag in content"
self.in_data = 1
def end_url(self):
self.in_data = 0
self.entry.url = self.data
self.data = ""
def start_contact(self,attributes):
if not self.entry:
raise ParseError, "<contact> tag must be in <contact>"
if self.in_data:
raise ParseError, "Unexpected <contact> tag in content"
self.in_data = 1
def end_contact(self):
self.in_data = 0
self.entry.contact = self.data
self.data = ""
def start_bugs(self,attributes):
if not self.entry:
raise ParseError, "<bugs> tag must be in <bugs>"
if self.in_data:
raise ParseError, "Unexpected <bugs> tag in content"
self.in_data = 1
def end_bugs(self):
self.in_data = 0
self.entry.bugs = self.data
self.data = ""
def start_entry(self,attributes):
if not self.section:
raise ParseError, "<entry> tag must be in <section>"
if self.entry:
raise ParseError, "<entry> tags may not be nested"
self.entry = Entry()
if not attributes.has_key("size"):
raise ParseError, '"size" attribute required for entry'
self.entry.set_size(attributes["size"])
if not attributes.has_key("status"):
raise ParseError, '"status" attribute (completion percentage) required for entry'
self.entry.status=attributes["status"]
if not attributes.has_key("target"):
raise ParseError, '"target" attribute (target version) required for entry'
self.entry.target=attributes["target"]
def end_entry(self):
if self.entry.title == None:
raise ParseError, "<entry> requires <title>"
if self.entry.description == None:
raise ParseError, "<entry> requires <description>"
self.section.entries.append(self.entry)
self.entry = None
def handle_data(self,data):
if self.in_data:
self.data = self.data + data
def unknown_starttag(self,tag,attributes):
if not self.in_data:
raise ParseError, "Unexpected start tag: " + tag
else:
self.data = self.data + "<" + tag
for (key,val) in attributes.items():
self.data = self.data + ' %s="%s"' % (key,val)
self.data = self.data + ">"
def unknown_endtag(self,tag):
if not self.in_data:
raise ParseError, "Unexpected end tag: " + tag
else:
self.data = self.data + "</%s>" % tag
def syntax_error(self, err):
if re.match("reference to unknown entity", err):
pass
else:
xmllib.XMLParser.syntax_error (self, err)
def unknown_entityref(self,ref):
if not self.in_data:
raise ParseError, "Unknown entity &" + ref + ";"
else:
self.data = self.data + "&" + ref + ";"
file = open(sys.argv[1])
parser = TodoParser()
lineno = 1
while 1:
line = file.readline()
if line == "":
break
try:
parser.feed(line)
except ParseError, err:
sys.stderr.write("Parse error at line " + `lineno` + ": " + err.__str__() + "\n")
sys.exit(1)
except RuntimeError, err:
sys.stderr.write(err.__str__() + "\n")
sys.exit(1)
lineno = lineno + 1
parser.close()
if parser.title == None:
sys.stderr.write ("<todo> Document must have a <title>\n")
sys.exit (1)
print '''<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0//EN">
<html>
<head>
<title>%s</title>
</head>
<body bgcolor="#ffffff">
<table width="100%%" cellspacing="0" cellpadding="0" border="0">
<tbody>
<tr valign="top">
<td>
<h1>%s</h1>''' % (parser.title, parser.title)
for section in parser.sections:
ntasks = len(section.entries)
id = make_id (section.title)
if ntasks == 1:
print '<a href="#%s">%s</a> (1 item)<br>' % (id,section.title)
else:
print '<a href="#%s">%s</a> (%d items)<br>' % (id,section.title,ntasks)
print '''
</td>'''
if parser.logourl != None:
print ''' <td align="right">
<img src="%s" alt="Logo"></img>
</td>''' % parser.logourl
print '''
</tr>
</tbody>
</table>
'''
first = 1
for section in parser.sections:
if not first:
print "<br><br>"
first = 0
section.output()
print '''</body>
</html>'''

View File

@@ -15,7 +15,7 @@ functions that follow these conventions:
GtkObjects also provide the following functions:
*_destroy: Render an object `unusable', but as long as there are
references to it, its allocated memory will not be freed.
references to it, it's allocated memory will not be freed.
*_sink: Clear a GtkObjects `floating' state and decrement the
reference count by 1.
@@ -248,7 +248,7 @@ widget, it needs to hold a reference to it.
Example code sequences that require reference wraps:
/* gtk_container_remove() will unparent the child and therefore
* cause its reference count to be decremented by one.
* cause it's reference count to be decremented by one.
*/
gtk_widget_ref (widget);
gtk_container_remove (container, widget);

View File

@@ -88,13 +88,13 @@ GtkWidget::style_set
Flag indications:
!GTK_RC_STYLE && !GTK_USER_STYLE:
The widget has its default style set, no rc lookup has been
The widget has it's default style set, no rc lookup has been
performed, the widget has not been size requested yet and is
therefore not yet realized.
GTK_USER_STYLE:
GTK_RC_STYLE is not set.
The widget has a user style assigned, and its default style has been
The widget has a user style assigned, and it's default style has been
saved.
GTK_RC_STYLE:

View File

@@ -398,7 +398,7 @@ according the the tab continuation of the previous line.
Exposure and drawing:
Exposure is handled from the EXPOSE_TEXT function. It assumes that
the LINE_START_CACHE and all its parameters are accurate and simply
the LINE_START_CACHE and all it's parameters are accurate and simply
exposes any line which is in the exposure region. It calls the
CLEAR_AREA function to clear the background and/or lay down a pixmap
background. The text widget has a scrollable pixmap background, which

View File

@@ -11,7 +11,7 @@ Tony Gale <tt><htmlurl url="mailto:gale@gtk.org"
name="&lt;gale@gtk.org&gt;"></tt>,
Ian Main <tt><htmlurl url="mailto:imain@gtk.org"
name="&lt;imain@gtk.org&gt;"></tt>
<date>February 23rd, 2000
<date>November 13th, 1999
<abstract>
This is a tutorial on how to use GTK (the GIMP Toolkit) through its C
interface.
@@ -33,7 +33,7 @@ open software, free software, or even commercial non-free software
using GTK without having to spend anything for licenses or royalties.
It's called the GIMP toolkit because it was originally written for
developing the GNU Image Manipulation Program (GIMP), but GTK has
developing the General Image Manipulation Program (GIMP), but GTK has
now been used in a large number of software projects, including the
GNU Network Object Model Environment (GNOME) project. GTK is built on
top of GDK (GIMP Drawing Kit) which is basically a wrapper around the
@@ -839,32 +839,16 @@ So, by passing in the widget you wish to remove the handler from, and
the tag returned by one of the signal_connect functions, you can
disconnect a signal handler.
You can also temporarily disable signal handlers with the
gtk_signal_handler_block() and gtk_signal_handler_unblock() family of
functions.
Another function to remove all the signal handers from an object is:
<tscreen><verb>
void gtk_signal_handler_block( GtkObject *object,
guint handler_id );
void gtk_signal_handler_block_by_func( GtkObject *object,
GtkSignalFunc func,
gpointer data );
void gtk_signal_handler_block_by_data( GtkObject *object,
gpointer data );
void gtk_signal_handler_unblock( GtkObject *object,
guint handler_id );
void gtk_signal_handler_unblock_by_func( GtkObject *object,
GtkSignalFunc func,
gpointer data );
void gtk_signal_handler_unblock_by_data( GtkObject *object,
gpointer data);
void gtk_signal_handlers_destroy( GtkObject *object );
</verb></tscreen>
This call is fairly self explanatory. It simply removes all the
current signal handlers from the object passed in as the first
argument.
<!-- ----------------------------------------------------------------- -->
<sect1>An Upgraded Hello World
<p>
@@ -4858,7 +4842,6 @@ The following code is an example of using an Entry widget.
<tscreen><verb>
/* example-start entry entry.c */
#include <stdio.h>
#include <gtk/gtk.h>
void enter_callback( GtkWidget *widget,
@@ -5187,7 +5170,6 @@ It's example time again.
<tscreen><verb>
/* example-start spinbutton spinbutton.c */
#include <stdio.h>
#include <gtk/gtk.h>
static GtkWidget *spinner1;
@@ -5583,578 +5565,6 @@ gtk_combo_set_item_string(GtkCombo *combo, GtkItem *item, const gchar
appropriate Item. Frankly, I have no idea how to do that.
-->
<!-- ----------------------------------------------------------------- -->
<sect1> Calendar
<p>
The Calendar widget is an effective way to display and retrieve
monthly date related information. It is a very simple widget to create
and work with.
Creating a GtkCalendar widget is a simple as:
<tscreen><verb>
GtkWidget *gtk_calendar_new();
</verb></tscreen>
There might be times where you need to change a lot of information
within this widget and the following functions allow you to make
multiple change to a Calendar widget without the user seeing multiple
on-screen updates.
<tscreen><verb>
void gtk_calendar_freeze( GtkCalendar *Calendar );
void gtk_calendar_thaw ( GtkCalendar *Calendar );
</verb></tscreen>
They work just like the freeze/thaw functions of every other
widget.
The Calendar widget has a few options that allow you to change the way
the widget both looks and operates by using the function
<tscreen><verb>
void gtk_calendar_display_options( GtkCalendar *calendar,
GtkCalendarDisplayOptions flags );
</verb></tscreen>
The <tt/flags/ argument can be formed by combining either of the
following five options using the logical bitwise OR (|) operation:
<itemize>
<item> GTK_CALENDAR_SHOW_HEADING - this option specifies that
the month and year should be shown when drawing the calendar.
<item> GTK_CALENDAR_SHOW_DAY_NAMES - this option specifies that the
three letter descriptions should be displayed for each day (eg
MON,TUE...).
<item> GTK_CALENDAR_NO_MONTH_CHANGE - this option states that the user
should not and can not change the currently displayed month. This can
be good if you only need to display a particular month such as if you
are displaying 12 calendar widgets for every month in a particular
year.
<item> GTK_CALENDAR_SHOW_WEEK_NUMBERS - this option specifies that the
number for each week should be displayed down the left side of the
calendar. (eg. Jan 1 = Week 1,Dec 31 = Week 52).
<item> GTK_CALENDAR_WEEK_START_MONDAY - this option states that the
calander week will start on Monday instead of Sunday which is the
default. This only affects the order in which days are displayed from
left to right.
</itemize>
The following functions are used to set the the currently displayed
date:
<tscreen><verb>
gint gtk_calendar_select_month( GtkCalendar *calendar,
guint month,
guint year );
void gtk_calendar_select_day( GtkCalendar *calendar,
guint day );
</verb></tscreen>
The return value from <tt/gtk_calendar_select_month()/ is a boolean
value indicating whether the selection was successful.
With <tt/gtk_calendar_select_day()/ the specified day number is
selected within the current month, if that is possible. A
<tt/day/ value of 0 will deselect any current selection.
In addition to having a day selected, any number of days in the month
may be "marked". A marked day is highlighted within the calendar
display. The following functions are provided to manipulate marked
days:
<tscreen><verb>
gint gtk_calendar_mark_day( GtkCalendar *calendar,
guint day);
gint gtk_calendar_unmark_day( GtkCalendar *calendar,
guint day);
void gtk_calendar_clear_marks( GtkCalendar *calendar);
</verb></tscreen>
The currently marked days are stored within an array within the
GtkCalendar structure. This array is 31 elements long so to test
whether a particular day is currently marked, you need to access the
corresponding element of the array (don't forget in C that array
elements are numbered 0 to n-1). For example:
<tscreen><verb>
GtkCalendar *calendar;
calendar = gtk_calendar_new();
...
/* Is day 7 marked? */
if (calendar->marked_date[7-1])
/* day is marked */
</verb></tscreen>
Note that marks are persistent across month and year changes.
The final Calendar widget function is used to retrieve the currently
selected date, month and/or year.
<tscreen><verb>
void gtk_calendar_get_date( GtkCalendar *calendar,
guint *year,
guint *month,
guint *day );
</verb></tscreen>
This function requires you to pass the addresses of <tt/guint/
variables, into which the result will be placed. Passing <tt/NULL/ as
a value will result in the corresponding value not being returned.
The Calendar widget can generate a number of signals indicating date
selection and change. The names of these signals are self explanatory,
and are:
<itemize>
<item> <tt/month_changed/
<item> <tt/day_selected/
<item> <tt/day_selected_double_click/
<item> <tt/prev_month/
<item> <tt/next_month/
<item> <tt/prev_year/
<item> <tt/next_year/
</itemize>
That just leaves us with the need to put all of this together into
example code.
<tscreen><verb>
/* example-start calendar calendar.c */
/*
* Copyright (C) 1998 Cesar Miquel, Shawn T. Amundson, Mattias Grönlund
* Copyright (C) 2000 Tony Gale
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation; either version 2 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program; if not, write to the Free Software
* Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
*/
#include <gtk/gtk.h>
#include <stdio.h>
#include <string.h>
#include <time.h>
#define DEF_PAD 10
#define DEF_PAD_SMALL 5
#define TM_YEAR_BASE 1900
typedef struct _CalendarData {
GtkWidget *flag_checkboxes[5];
gboolean settings[5];
gchar *font;
GtkWidget *font_dialog;
GtkWidget *window;
GtkWidget *prev2_sig;
GtkWidget *prev_sig;
GtkWidget *last_sig;
GtkWidget *month;
} CalendarData;
enum {
calendar_show_header,
calendar_show_days,
calendar_month_change,
calendar_show_week,
calendar_monday_first
};
/*
* GtkCalendar
*/
void calendar_date_to_string( CalendarData *data,
char *buffer,
gint buff_len )
{
struct tm tm;
time_t time;
memset (&amp;tm, 0, sizeof (tm));
gtk_calendar_get_date (GTK_CALENDAR(data->window),
&amp;tm.tm_year, &amp;tm.tm_mon, &amp;tm.tm_mday);
tm.tm_year -= TM_YEAR_BASE;
time = mktime(&amp;tm);
strftime (buffer, buff_len-1, "%x", gmtime(&amp;time));
}
void calendar_set_signal_strings( char *sig_str,
CalendarData *data)
{
gchar *prev_sig;
gtk_label_get (GTK_LABEL (data->prev_sig), &amp;prev_sig);
gtk_label_set (GTK_LABEL (data->prev2_sig), prev_sig);
gtk_label_get (GTK_LABEL (data->last_sig), &amp;prev_sig);
gtk_label_set (GTK_LABEL (data->prev_sig), prev_sig);
gtk_label_set (GTK_LABEL (data->last_sig), sig_str);
}
void calendar_month_changed( GtkWidget *widget,
CalendarData *data )
{
char buffer[256] = "month_changed: ";
calendar_date_to_string (data, buffer+15, 256-15);
calendar_set_signal_strings (buffer, data);
}
void calendar_day_selected( GtkWidget *widget,
CalendarData *data )
{
char buffer[256] = "day_selected: ";
calendar_date_to_string (data, buffer+14, 256-14);
calendar_set_signal_strings (buffer, data);
}
void calendar_day_selected_double_click( GtkWidget *widget,
CalendarData *data )
{
struct tm tm;
char buffer[256] = "day_selected_double_click: ";
calendar_date_to_string (data, buffer+27, 256-27);
calendar_set_signal_strings (buffer, data);
memset (&amp;tm, 0, sizeof (tm));
gtk_calendar_get_date (GTK_CALENDAR(data->window),
&amp;tm.tm_year, &amp;tm.tm_mon, &amp;tm.tm_mday);
tm.tm_year -= TM_YEAR_BASE;
if(GTK_CALENDAR(data->window)->marked_date[tm.tm_mday-1] == 0) {
gtk_calendar_mark_day(GTK_CALENDAR(data->window),tm.tm_mday);
} else {
gtk_calendar_unmark_day(GTK_CALENDAR(data->window),tm.tm_mday);
}
}
void calendar_prev_month( GtkWidget *widget,
CalendarData *data )
{
char buffer[256] = "prev_month: ";
calendar_date_to_string (data, buffer+12, 256-12);
calendar_set_signal_strings (buffer, data);
}
void calendar_next_month( GtkWidget *widget,
CalendarData *data )
{
char buffer[256] = "next_month: ";
calendar_date_to_string (data, buffer+12, 256-12);
calendar_set_signal_strings (buffer, data);
}
void calendar_prev_year( GtkWidget *widget,
CalendarData *data )
{
char buffer[256] = "prev_year: ";
calendar_date_to_string (data, buffer+11, 256-11);
calendar_set_signal_strings (buffer, data);
}
void calendar_next_year( GtkWidget *widget,
CalendarData *data )
{
char buffer[256] = "next_year: ";
calendar_date_to_string (data, buffer+11, 256-11);
calendar_set_signal_strings (buffer, data);
}
void calendar_set_flags( CalendarData *calendar )
{
gint i;
gint options=0;
for (i=0;i<5;i++)
if (calendar->settings[i])
{
options=options + (1<<i);
}
if (calendar->window)
gtk_calendar_display_options (GTK_CALENDAR (calendar->window), options);
}
void calendar_toggle_flag( GtkWidget *toggle,
CalendarData *calendar )
{
gint i;
gint j;
j=0;
for (i=0; i<5; i++)
if (calendar->flag_checkboxes[i] == toggle)
j = i;
calendar->settings[j]=!calendar->settings[j];
calendar_set_flags(calendar);
}
void calendar_font_selection_ok( GtkWidget *button,
CalendarData *calendar )
{
GtkStyle *style;
GdkFont *font;
calendar->font = gtk_font_selection_dialog_get_font_name(
GTK_FONT_SELECTION_DIALOG (calendar->font_dialog));
if (calendar->window)
{
font = gtk_font_selection_dialog_get_font(GTK_FONT_SELECTION_DIALOG(calendar->font_dialog));
if (font)
{
style = gtk_style_copy (gtk_widget_get_style (calendar->window));
gdk_font_unref (style->font);
style->font = font;
gdk_font_ref (style->font);
gtk_widget_set_style (calendar->window, style);
}
}
}
void calendar_select_font( GtkWidget *button,
CalendarData *calendar )
{
GtkWidget *window;
if (!calendar->font_dialog) {
window = gtk_font_selection_dialog_new ("Font Selection Dialog");
g_return_if_fail(GTK_IS_FONT_SELECTION_DIALOG(window));
calendar->font_dialog = window;
gtk_window_position (GTK_WINDOW (window), GTK_WIN_POS_MOUSE);
gtk_signal_connect (GTK_OBJECT (window), "destroy",
GTK_SIGNAL_FUNC (gtk_widget_destroyed),
&amp;calendar->font_dialog);
gtk_signal_connect (GTK_OBJECT (GTK_FONT_SELECTION_DIALOG (window)->ok_button),
"clicked", GTK_SIGNAL_FUNC(calendar_font_selection_ok),
calendar);
gtk_signal_connect_object (GTK_OBJECT (GTK_FONT_SELECTION_DIALOG (window)->cancel_button),
"clicked",
GTK_SIGNAL_FUNC (gtk_widget_destroy),
GTK_OBJECT (calendar->font_dialog));
}
window=calendar->font_dialog;
if (!GTK_WIDGET_VISIBLE (window))
gtk_widget_show (window);
else
gtk_widget_destroy (window);
}
void create_calendar()
{
GtkWidget *window;
GtkWidget *vbox, *vbox2, *vbox3;
GtkWidget *hbox;
GtkWidget *hbbox;
GtkWidget *calendar;
GtkWidget *toggle;
GtkWidget *button;
GtkWidget *frame;
GtkWidget *separator;
GtkWidget *label;
GtkWidget *bbox;
static CalendarData calendar_data;
gint i;
struct {
char *label;
} flags[] =
{
{ "Show Heading" },
{ "Show Day Names" },
{ "No Month Change" },
{ "Show Week Numbers" },
{ "Week Start Monday" }
};
calendar_data.window = NULL;
calendar_data.font = NULL;
calendar_data.font_dialog = NULL;
for (i=0; i<5; i++) {
calendar_data.settings[i]=0;
}
window = gtk_window_new (GTK_WINDOW_TOPLEVEL);
gtk_window_set_title(GTK_WINDOW(window), "GtkCalendar Example");
gtk_container_border_width (GTK_CONTAINER (window), 5);
gtk_signal_connect(GTK_OBJECT(window), "destroy",
GTK_SIGNAL_FUNC(gtk_main_quit),
NULL);
gtk_signal_connect(GTK_OBJECT(window), "delete-event",
GTK_SIGNAL_FUNC(gtk_false),
NULL);
gtk_window_set_policy(GTK_WINDOW(window), FALSE, FALSE, TRUE);
vbox = gtk_vbox_new(FALSE, DEF_PAD);
gtk_container_add (GTK_CONTAINER (window), vbox);
/*
* The top part of the window, Calendar, flags and fontsel.
*/
hbox = gtk_hbox_new(FALSE, DEF_PAD);
gtk_box_pack_start (GTK_BOX(vbox), hbox, TRUE, TRUE, DEF_PAD);
hbbox = gtk_hbutton_box_new();
gtk_box_pack_start(GTK_BOX(hbox), hbbox, FALSE, FALSE, DEF_PAD);
gtk_button_box_set_layout(GTK_BUTTON_BOX(hbbox), GTK_BUTTONBOX_SPREAD);
gtk_button_box_set_spacing(GTK_BUTTON_BOX(hbbox), 5);
/* Calendar widget */
frame = gtk_frame_new("Calendar");
gtk_box_pack_start(GTK_BOX(hbbox), frame, FALSE, TRUE, DEF_PAD);
calendar=gtk_calendar_new();
calendar_data.window = calendar;
calendar_set_flags(&amp;calendar_data);
gtk_calendar_mark_day ( GTK_CALENDAR(calendar), 19);
gtk_container_add( GTK_CONTAINER( frame), calendar);
gtk_signal_connect (GTK_OBJECT (calendar), "month_changed",
GTK_SIGNAL_FUNC (calendar_month_changed),
&amp;calendar_data);
gtk_signal_connect (GTK_OBJECT (calendar), "day_selected",
GTK_SIGNAL_FUNC (calendar_day_selected),
&amp;calendar_data);
gtk_signal_connect (GTK_OBJECT (calendar), "day_selected_double_click",
GTK_SIGNAL_FUNC (calendar_day_selected_double_click),
&amp;calendar_data);
gtk_signal_connect (GTK_OBJECT (calendar), "prev_month",
GTK_SIGNAL_FUNC (calendar_prev_month),
&amp;calendar_data);
gtk_signal_connect (GTK_OBJECT (calendar), "next_month",
GTK_SIGNAL_FUNC (calendar_next_month),
&amp;calendar_data);
gtk_signal_connect (GTK_OBJECT (calendar), "prev_year",
GTK_SIGNAL_FUNC (calendar_prev_year),
&amp;calendar_data);
gtk_signal_connect (GTK_OBJECT (calendar), "next_year",
GTK_SIGNAL_FUNC (calendar_next_year),
&amp;calendar_data);
separator = gtk_vseparator_new ();
gtk_box_pack_start (GTK_BOX (hbox), separator, FALSE, TRUE, 0);
vbox2 = gtk_vbox_new(FALSE, DEF_PAD);
gtk_box_pack_start(GTK_BOX(hbox), vbox2, FALSE, FALSE, DEF_PAD);
/* Build the Right frame with the flags in */
frame = gtk_frame_new("Flags");
gtk_box_pack_start(GTK_BOX(vbox2), frame, TRUE, TRUE, DEF_PAD);
vbox3 = gtk_vbox_new(TRUE, DEF_PAD_SMALL);
gtk_container_add(GTK_CONTAINER(frame), vbox3);
for (i = 0; i < 5; i++)
{
toggle = gtk_check_button_new_with_label(flags[i].label);
gtk_signal_connect (GTK_OBJECT (toggle),
"toggled",
GTK_SIGNAL_FUNC(calendar_toggle_flag),
&amp;calendar_data);
gtk_box_pack_start (GTK_BOX (vbox3), toggle, TRUE, TRUE, 0);
calendar_data.flag_checkboxes[i]=toggle;
}
/* Build the right font-button */
button = gtk_button_new_with_label("Font...");
gtk_signal_connect (GTK_OBJECT (button),
"clicked",
GTK_SIGNAL_FUNC(calendar_select_font),
&amp;calendar_data);
gtk_box_pack_start (GTK_BOX (vbox2), button, FALSE, FALSE, 0);
/*
* Build the Signal-event part.
*/
frame = gtk_frame_new("Signal events");
gtk_box_pack_start(GTK_BOX(vbox), frame, TRUE, TRUE, DEF_PAD);
vbox2 = gtk_vbox_new(TRUE, DEF_PAD_SMALL);
gtk_container_add(GTK_CONTAINER(frame), vbox2);
hbox = gtk_hbox_new (FALSE, 3);
gtk_box_pack_start (GTK_BOX (vbox2), hbox, FALSE, TRUE, 0);
label = gtk_label_new ("Signal:");
gtk_box_pack_start (GTK_BOX (hbox), label, FALSE, TRUE, 0);
calendar_data.last_sig = gtk_label_new ("");
gtk_box_pack_start (GTK_BOX (hbox), calendar_data.last_sig, FALSE, TRUE, 0);
hbox = gtk_hbox_new (FALSE, 3);
gtk_box_pack_start (GTK_BOX (vbox2), hbox, FALSE, TRUE, 0);
label = gtk_label_new ("Previous signal:");
gtk_box_pack_start (GTK_BOX (hbox), label, FALSE, TRUE, 0);
calendar_data.prev_sig = gtk_label_new ("");
gtk_box_pack_start (GTK_BOX (hbox), calendar_data.prev_sig, FALSE, TRUE, 0);
hbox = gtk_hbox_new (FALSE, 3);
gtk_box_pack_start (GTK_BOX (vbox2), hbox, FALSE, TRUE, 0);
label = gtk_label_new ("Second previous signal:");
gtk_box_pack_start (GTK_BOX (hbox), label, FALSE, TRUE, 0);
calendar_data.prev2_sig = gtk_label_new ("");
gtk_box_pack_start (GTK_BOX (hbox), calendar_data.prev2_sig, FALSE, TRUE, 0);
bbox = gtk_hbutton_box_new ();
gtk_box_pack_start (GTK_BOX (vbox), bbox, FALSE, FALSE, 0);
gtk_button_box_set_layout(GTK_BUTTON_BOX(bbox), GTK_BUTTONBOX_END);
button = gtk_button_new_with_label ("Close");
gtk_signal_connect (GTK_OBJECT (button), "clicked",
GTK_SIGNAL_FUNC (gtk_main_quit),
NULL);
gtk_container_add (GTK_CONTAINER (bbox), button);
GTK_WIDGET_SET_FLAGS (button, GTK_CAN_DEFAULT);
gtk_widget_grab_default (button);
gtk_widget_show_all(window);
}
int main(int argc,
char *argv[] )
{
gtk_set_locale ();
gtk_init (&amp;argc, &amp;argv);
create_calendar();
gtk_main();
return(0);
}
/* example-end */
</verb></tscreen>
<!-- ----------------------------------------------------------------- -->
<sect1> Color Selection
<p>
@@ -6654,7 +6064,7 @@ the <ref id="sec_ProgressBar" name="Progress Bar"> widget.
<sect1> Fixed Container
<p>
The Fixed container allows you to place widgets at a fixed position
within its window, relative to its upper left hand corner. The
within it's window, relative to it's upper left hand corner. The
position of the widgets can be changed dynamically.
There are only three functions associated with the fixed widget:
@@ -7095,7 +6505,6 @@ window.
<tscreen><verb>
/* example-start paned paned.c */
#include <stdio.h>
#include <gtk/gtk.h>
/* Create the list of "messages" */
@@ -7342,7 +6751,6 @@ new to you.
<tscreen><verb>
/* example-start scrolledwin scrolledwin.c */
#include <stdio.h>
#include <gtk/gtk.h>
void destroy( GtkWidget *widget,
@@ -8222,7 +7630,6 @@ backward manner, and exit the program.
<tscreen><verb>
/* example-start notebook notebook.c */
#include <stdio.h>
#include <gtk/gtk.h>
/* This function rotates the position of the tabs */
@@ -10143,7 +9550,6 @@ That should about do it. Let's take a look at an example to help clarify.
<tscreen><verb>
/* example-start menu menu.c */
#include <stdio.h>
#include <gtk/gtk.h>
static gint button_press (GtkWidget *, GdkEvent *);
@@ -10852,6 +10258,9 @@ When you do come to understand all the functions of a new undocumented
widget, please consider writing a tutorial on it so others may benefit
from your time.
<!-- ----------------------------------------------------------------- -->
<sect1> Calendar
<p>
<!-- ----------------------------------------------------------------- -->
<sect1> CTree
<p>
@@ -17300,7 +16709,6 @@ gtk_dial_adjustment_value_changed (GtkAdjustment *adjustment,
<sect2> dial_test.c
<p>
<tscreen><verb>
#include <stdio.h>
#include <gtk/gtk.h>
#include "gtkdial.h"

File diff suppressed because it is too large Load Diff

View File

@@ -1,8 +1,8 @@
CC = gcc
calendar: calendar.c
$(CC) `gtk-config --cflags` calendar.c -o calendar `gtk-config --libs`
gcalendar: gcalendar.c
$(CC) `gtk-config --cflags` gcalendar.c -o gcalendar `gtk-config --libs`
clean:
rm -f calendar
rm -f gcalendar

View File

@@ -1,7 +1,5 @@
/* example-start calendar calendar.c */
/*
/* G Calendar
* Copyright (C) 1998 Cesar Miquel, Shawn T. Amundson, Mattias Grönlund
* Copyright (C) 2000 Tony Gale
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
@@ -28,18 +26,84 @@
#define TM_YEAR_BASE 1900
typedef struct _CalendarData {
GtkWidget *flag_checkboxes[5];
gboolean settings[5];
gchar *font;
GtkWidget *font_dialog;
GtkWidget *window;
GtkWidget *prev2_sig;
GtkWidget *prev_sig;
GtkWidget *last_sig;
GtkWidget *selected;
GtkWidget *selected_double_click;
GtkWidget *month;
} CalendarData;
void create_calendar();
gint delete_event(GtkWidget *widget, GdkEvent *event, gpointer data);
void destroy (GtkWidget *widget, gpointer data);
void day_selected_double_click (GtkWidget *widget, gpointer data);
int main(int argc, char *argv[]);
void calendar_month_changed (GtkWidget *widget, CalendarData *data);
void calendar_day_selected (GtkWidget *widget, CalendarData *data);
void calendar_day_selected_double_click (GtkWidget *widget, CalendarData *data);
void calendar_set_flags(CalendarData *calendar);
void calendar_toggle_flag(GtkWidget * toggle, CalendarData *calendar);
void calendar_font_selection_ok(GtkWidget * button, CalendarData *calendar);
void calendar_font_selection_destroy(GtkWidget * button, GtkWidget widget);
void calendar_select_font(GtkWidget * button, CalendarData *calendar);
void calendar_create_window_destroy(GtkWidget * ignore, CalendarData *calendar);
void calendar_create_window(GtkWidget * ignored, CalendarData * calendar);
void calendar_window_destroy(GtkWidget * ignore, CalendarData *calendar);
void create_calendar();
/*
* GtkCalendar
*/
void
calendar_month_changed (GtkWidget *widget, CalendarData *data)
{
char buffer[256];
struct tm tm;
time_t time;
memset (&tm, 0, sizeof (tm));
gtk_calendar_get_date (GTK_CALENDAR(data->window), &tm.tm_year, &tm.tm_mon, &tm.tm_mday);
tm.tm_year -= TM_YEAR_BASE;
time = mktime(&tm);
strftime (buffer, 255, "%x", gmtime(&time));
gtk_label_set (GTK_LABEL (data->month), buffer);
}
void
calendar_day_selected (GtkWidget *widget, CalendarData *data)
{
char buffer[256];
struct tm tm;
time_t time;
memset (&tm, 0, sizeof (tm));
gtk_calendar_get_date (GTK_CALENDAR(data->window), &tm.tm_year, &tm.tm_mon, &tm.tm_mday);
tm.tm_year -= TM_YEAR_BASE;
time = mktime(&tm);
strftime (buffer, 255, "%x", gmtime(&time));
gtk_label_set (GTK_LABEL (data->selected), buffer);
}
void
calendar_day_selected_double_click (GtkWidget *widget, CalendarData *data)
{
char buffer[256];
struct tm tm;
time_t time;
memset (&tm, 0, sizeof (tm));
gtk_calendar_get_date (GTK_CALENDAR(data->window), &tm.tm_year, &tm.tm_mon, &tm.tm_mday);
tm.tm_year -= TM_YEAR_BASE;
time = mktime(&tm);
strftime (buffer, 255, "%x", gmtime(&time));
gtk_label_set (GTK_LABEL (data->selected_double_click), buffer);
}
enum {
calendar_show_header,
calendar_show_days,
@@ -48,115 +112,8 @@ enum {
calendar_monday_first
};
/*
* GtkCalendar
*/
void calendar_date_to_string( CalendarData *data,
char *buffer,
gint buff_len )
{
struct tm tm;
time_t time;
memset (&tm, 0, sizeof (tm));
gtk_calendar_get_date (GTK_CALENDAR(data->window),
&tm.tm_year, &tm.tm_mon, &tm.tm_mday);
tm.tm_year -= TM_YEAR_BASE;
time = mktime(&tm);
strftime (buffer, buff_len-1, "%x", gmtime(&time));
}
void calendar_set_signal_strings( char *sig_str,
CalendarData *data)
{
gchar *prev_sig;
gtk_label_get (GTK_LABEL (data->prev_sig), &prev_sig);
gtk_label_set (GTK_LABEL (data->prev2_sig), prev_sig);
gtk_label_get (GTK_LABEL (data->last_sig), &prev_sig);
gtk_label_set (GTK_LABEL (data->prev_sig), prev_sig);
gtk_label_set (GTK_LABEL (data->last_sig), sig_str);
}
void calendar_month_changed( GtkWidget *widget,
CalendarData *data )
{
char buffer[256] = "month_changed: ";
calendar_date_to_string (data, buffer+15, 256-15);
calendar_set_signal_strings (buffer, data);
}
void calendar_day_selected( GtkWidget *widget,
CalendarData *data )
{
char buffer[256] = "day_selected: ";
calendar_date_to_string (data, buffer+14, 256-14);
calendar_set_signal_strings (buffer, data);
}
void calendar_day_selected_double_click( GtkWidget *widget,
CalendarData *data )
{
struct tm tm;
char buffer[256] = "day_selected_double_click: ";
calendar_date_to_string (data, buffer+27, 256-27);
calendar_set_signal_strings (buffer, data);
memset (&tm, 0, sizeof (tm));
gtk_calendar_get_date (GTK_CALENDAR(data->window),
&tm.tm_year, &tm.tm_mon, &tm.tm_mday);
tm.tm_year -= TM_YEAR_BASE;
if(GTK_CALENDAR(data->window)->marked_date[tm.tm_mday-1] == 0) {
gtk_calendar_mark_day(GTK_CALENDAR(data->window),tm.tm_mday);
} else {
gtk_calendar_unmark_day(GTK_CALENDAR(data->window),tm.tm_mday);
}
}
void calendar_prev_month( GtkWidget *widget,
CalendarData *data )
{
char buffer[256] = "prev_month: ";
calendar_date_to_string (data, buffer+12, 256-12);
calendar_set_signal_strings (buffer, data);
}
void calendar_next_month( GtkWidget *widget,
CalendarData *data )
{
char buffer[256] = "next_month: ";
calendar_date_to_string (data, buffer+12, 256-12);
calendar_set_signal_strings (buffer, data);
}
void calendar_prev_year( GtkWidget *widget,
CalendarData *data )
{
char buffer[256] = "prev_year: ";
calendar_date_to_string (data, buffer+11, 256-11);
calendar_set_signal_strings (buffer, data);
}
void calendar_next_year( GtkWidget *widget,
CalendarData *data )
{
char buffer[256] = "next_year: ";
calendar_date_to_string (data, buffer+11, 256-11);
calendar_set_signal_strings (buffer, data);
}
void calendar_set_flags( CalendarData *calendar )
void
calendar_set_flags(CalendarData *calendar)
{
gint i;
gint options=0;
@@ -169,8 +126,8 @@ void calendar_set_flags( CalendarData *calendar )
gtk_calendar_display_options (GTK_CALENDAR (calendar->window), options);
}
void calendar_toggle_flag( GtkWidget *toggle,
CalendarData *calendar )
void
calendar_toggle_flag(GtkWidget * toggle, CalendarData *calendar)
{
gint i;
gint j;
@@ -183,15 +140,13 @@ void calendar_toggle_flag( GtkWidget *toggle,
calendar_set_flags(calendar);
}
void calendar_font_selection_ok( GtkWidget *button,
CalendarData *calendar )
void
calendar_font_selection_ok(GtkWidget * button, CalendarData *calendar)
{
GtkStyle *style;
GdkFont *font;
calendar->font = gtk_font_selection_dialog_get_font_name(
GTK_FONT_SELECTION_DIALOG (calendar->font_dialog));
calendar->font = gtk_font_selection_dialog_get_font_name (GTK_FONT_SELECTION_DIALOG (calendar->font_dialog));
if (calendar->window)
{
font = gtk_font_selection_dialog_get_font(GTK_FONT_SELECTION_DIALOG(calendar->font_dialog));
@@ -206,8 +161,8 @@ void calendar_font_selection_ok( GtkWidget *button,
}
}
void calendar_select_font( GtkWidget *button,
CalendarData *calendar )
void
calendar_select_font(GtkWidget * button, CalendarData *calendar)
{
GtkWidget *window;
@@ -238,7 +193,8 @@ void calendar_select_font( GtkWidget *button,
}
void create_calendar()
void
create_calendar()
{
GtkWidget *window;
GtkWidget *vbox, *vbox2, *vbox3;
@@ -275,7 +231,6 @@ void create_calendar()
}
window = gtk_window_new (GTK_WINDOW_TOPLEVEL);
gtk_window_set_title(GTK_WINDOW(window), "GtkCalendar Example");
gtk_container_border_width (GTK_CONTAINER (window), 5);
gtk_signal_connect(GTK_OBJECT(window), "destroy",
GTK_SIGNAL_FUNC(gtk_main_quit),
@@ -302,7 +257,7 @@ void create_calendar()
/* Calendar widget */
frame = gtk_frame_new("Calendar");
gtk_box_pack_start(GTK_BOX(hbbox), frame, FALSE, TRUE, DEF_PAD);
gtk_box_pack_start(GTK_BOX(hbbox), frame, TRUE, TRUE, DEF_PAD);
calendar=gtk_calendar_new();
calendar_data.window = calendar;
calendar_set_flags(&calendar_data);
@@ -317,18 +272,6 @@ void create_calendar()
gtk_signal_connect (GTK_OBJECT (calendar), "day_selected_double_click",
GTK_SIGNAL_FUNC (calendar_day_selected_double_click),
&calendar_data);
gtk_signal_connect (GTK_OBJECT (calendar), "prev_month",
GTK_SIGNAL_FUNC (calendar_prev_month),
&calendar_data);
gtk_signal_connect (GTK_OBJECT (calendar), "next_month",
GTK_SIGNAL_FUNC (calendar_next_month),
&calendar_data);
gtk_signal_connect (GTK_OBJECT (calendar), "prev_year",
GTK_SIGNAL_FUNC (calendar_prev_year),
&calendar_data);
gtk_signal_connect (GTK_OBJECT (calendar), "next_year",
GTK_SIGNAL_FUNC (calendar_next_year),
&calendar_data);
separator = gtk_vseparator_new ();
@@ -368,31 +311,30 @@ void create_calendar()
frame = gtk_frame_new("Signal events");
gtk_box_pack_start(GTK_BOX(vbox), frame, TRUE, TRUE, DEF_PAD);
vbox2 = gtk_vbox_new(TRUE, DEF_PAD_SMALL);
gtk_container_add(GTK_CONTAINER(frame), vbox2);
hbox = gtk_hbox_new (FALSE, 3);
hbox = gtk_hbox_new (FALSE, 5);
gtk_box_pack_start (GTK_BOX (vbox2), hbox, FALSE, TRUE, 0);
label = gtk_label_new ("Signal:");
label = gtk_label_new ("Day selected:");
gtk_box_pack_start (GTK_BOX (hbox), label, FALSE, TRUE, 0);
calendar_data.last_sig = gtk_label_new ("");
gtk_box_pack_start (GTK_BOX (hbox), calendar_data.last_sig, FALSE, TRUE, 0);
calendar_data.selected = gtk_label_new ("");
gtk_box_pack_start (GTK_BOX (hbox), calendar_data.selected, FALSE, TRUE, 0);
hbox = gtk_hbox_new (FALSE, 3);
hbox = gtk_hbox_new (FALSE, 5);
gtk_box_pack_start (GTK_BOX (vbox2), hbox, FALSE, TRUE, 0);
label = gtk_label_new ("Previous signal:");
label = gtk_label_new ("Day selected double click:");
gtk_box_pack_start (GTK_BOX (hbox), label, FALSE, TRUE, 0);
calendar_data.prev_sig = gtk_label_new ("");
gtk_box_pack_start (GTK_BOX (hbox), calendar_data.prev_sig, FALSE, TRUE, 0);
calendar_data.selected_double_click = gtk_label_new ("");
gtk_box_pack_start (GTK_BOX (hbox), calendar_data.selected_double_click, FALSE, TRUE, 0);
hbox = gtk_hbox_new (FALSE, 3);
hbox = gtk_hbox_new (FALSE, 5);
gtk_box_pack_start (GTK_BOX (vbox2), hbox, FALSE, TRUE, 0);
label = gtk_label_new ("Second previous signal:");
label = gtk_label_new ("Month change:");
gtk_box_pack_start (GTK_BOX (hbox), label, FALSE, TRUE, 0);
calendar_data.prev2_sig = gtk_label_new ("");
gtk_box_pack_start (GTK_BOX (hbox), calendar_data.prev2_sig, FALSE, TRUE, 0);
calendar_data.month = gtk_label_new ("");
gtk_box_pack_start (GTK_BOX (hbox), calendar_data.month, FALSE, TRUE, 0);
bbox = gtk_hbutton_box_new ();
gtk_box_pack_start (GTK_BOX (vbox), bbox, FALSE, FALSE, 0);
gtk_button_box_set_layout(GTK_BUTTON_BOX(bbox), GTK_BUTTONBOX_END);
@@ -409,16 +351,12 @@ void create_calendar()
}
int main(int argc,
char *argv[] )
int
main(int argc, char *argv[])
{
gtk_set_locale ();
gtk_init (&argc, &argv);
create_calendar();
gtk_main();
return(0);
gtk_main ();
return 0;
}
/* example-end */

View File

@@ -11,7 +11,6 @@ EXTRA_DIST = \
INCLUDES = @STRIP_BEGIN@ \
-DG_LOG_DOMAIN=\"Gdk\" \
-I$(top_srcdir) \
-I$(top_builddir)/gdk \
@GTK_DEBUG_FLAGS@ \
@GTK_XIM_FLAGS@ \
@GTK_LOCALE_FLAGS@ \
@@ -85,7 +84,6 @@ gdk_c_sources = @STRIP_BEGIN@ \
gdkglobals.c \
gdkimage.c \
gdkinternals.h \
gdkpixmap.c \
gdkrgb.c \
gdkrectangle.c \
gdkwindow.c \

View File

@@ -294,7 +294,7 @@ gdk_init_check (int *argc,
{
gchar *d;
d = strrchr((*argv)[0], G_DIR_SEPARATOR);
d = strrchr((*argv)[0],'/');
if (d != NULL)
g_set_prgname (d + 1);
else
@@ -313,8 +313,6 @@ gdk_init_check (int *argc,
}
#endif /* G_ENABLE_DEBUG */
g_type_init ();
arg_context = gdk_arg_context_new (NULL);
gdk_arg_context_add_table (arg_context, gdk_args);
gdk_arg_context_add_table (arg_context, _gdk_windowing_args);
@@ -336,8 +334,8 @@ gdk_init_check (int *argc,
gdk_events_init ();
gdk_visual_init ();
gdk_windowing_window_init ();
gdk_windowing_image_init ();
gdk_window_init ();
gdk_image_init ();
gdk_input_init ();
gdk_dnd_init ();

View File

@@ -223,17 +223,17 @@ EXPORTS
gdk_region_empty
gdk_region_equal
gdk_region_get_clipbox
gdk_region_intersect
gdk_region_new
gdk_region_offset
gdk_region_point_in
gdk_region_polygon
gdk_region_rect_in
gdk_region_shrink
gdk_region_subtract
gdk_region_union
gdk_region_union_with_rect
gdk_region_xor
gdk_regions_intersect
gdk_regions_subtract
gdk_regions_union
gdk_regions_xor
gdk_rgb_cmap_free
gdk_rgb_cmap_new
gdk_rgb_ditherable
@@ -258,7 +258,6 @@ EXPORTS
gdk_selection_send_notify
gdk_set_locale
gdk_set_show_events
gdk_set_sm_client_id
gdk_set_use_xshm
gdk_string_extents
gdk_string_height
@@ -287,12 +286,10 @@ EXPORTS
gdk_wcstombs
gdk_window_add_filter
gdk_window_at_pointer
gdk_window_begin_paint_rect
gdk_window_clear
gdk_window_clear_area
gdk_window_clear_area_e
gdk_window_destroy
gdk_window_end_paint
gdk_window_foreign_new
gdk_window_get_children
gdk_window_get_deskrelative_origin
@@ -307,7 +304,6 @@ EXPORTS
gdk_window_get_toplevels
gdk_window_get_user_data
gdk_window_hide
gdk_window_invalidate_rect
gdk_window_is_viewable
gdk_window_is_visible
gdk_window_lower
@@ -315,8 +311,6 @@ EXPORTS
gdk_window_move
gdk_window_move_resize
gdk_window_new
gdk_window_process_all_updates
gdk_window_process_updates
gdk_window_raise
gdk_window_register_dnd
gdk_window_remove_filter

View File

@@ -70,9 +70,9 @@ void gdk_error_trap_push (void);
gint gdk_error_trap_pop (void);
void gdk_set_use_xshm (gboolean use_xshm);
void gdk_set_use_xshm (gint use_xshm);
gboolean gdk_get_use_xshm (void);
gint gdk_get_use_xshm (void);
gchar* gdk_get_display (void);
gint gdk_input_add_full (gint source,
@@ -86,18 +86,20 @@ gint gdk_input_add (gint source,
gpointer data);
void gdk_input_remove (gint tag);
gint gdk_pointer_grab (GdkWindow *window,
gboolean owner_events,
GdkEventMask event_mask,
GdkWindow *confine_to,
GdkCursor *cursor,
guint32 time);
void gdk_pointer_ungrab (guint32 time);
gint gdk_keyboard_grab (GdkWindow *window,
gboolean owner_events,
guint32 time);
void gdk_keyboard_ungrab (guint32 time);
gboolean gdk_pointer_is_grabbed (void);
gint gdk_pointer_grab (GdkWindow *window,
gint owner_events,
GdkEventMask event_mask,
GdkWindow *confine_to,
GdkCursor *cursor,
guint32 time);
void gdk_pointer_ungrab (guint32 time);
gint gdk_keyboard_grab (GdkWindow *window,
gint owner_events,
guint32 time);
void gdk_keyboard_ungrab (guint32 time);
gint gdk_pointer_is_grabbed (void);
gint gdk_screen_width (void);
gint gdk_screen_height (void);
@@ -113,12 +115,12 @@ void gdk_key_repeat_restore (void);
/* Rectangle utilities
*/
gboolean gdk_rectangle_intersect (GdkRectangle *src1,
GdkRectangle *src2,
GdkRectangle *dest);
void gdk_rectangle_union (GdkRectangle *src1,
GdkRectangle *src2,
GdkRectangle *dest);
gint gdk_rectangle_intersect (GdkRectangle *src1,
GdkRectangle *src2,
GdkRectangle *dest);
void gdk_rectangle_union (GdkRectangle *src1,
GdkRectangle *src2,
GdkRectangle *dest);
/* Conversion functions between wide char and multibyte strings.
*/

View File

@@ -27,26 +27,42 @@
#include <time.h>
#include "gdkcolor.h"
#include "gdkinternals.h"
#include "gdkprivate.h"
GdkColormap*
gdk_colormap_ref (GdkColormap *cmap)
{
return (GdkColormap *) g_object_ref (G_OBJECT (cmap));
GdkColormapPrivate *private = (GdkColormapPrivate *)cmap;
g_return_val_if_fail (cmap != NULL, NULL);
private->ref_count += 1;
return cmap;
}
void
gdk_colormap_unref (GdkColormap *cmap)
{
g_object_unref (G_OBJECT (cmap));
GdkColormapPrivate *private = (GdkColormapPrivate *)cmap;
g_return_if_fail (cmap != NULL);
g_return_if_fail (private->ref_count > 0);
private->ref_count -= 1;
if (private->ref_count == 0)
_gdk_colormap_real_destroy (cmap);
}
GdkVisual *
gdk_colormap_get_visual (GdkColormap *colormap)
{
g_return_val_if_fail (GDK_IS_COLORMAP (colormap), NULL);
GdkColormapPrivate *private;
return colormap->visual;
g_return_val_if_fail (colormap != NULL, NULL);
private = (GdkColormapPrivate *)colormap;
return private->visual;
}
void
@@ -85,7 +101,7 @@ gdk_colors_store (GdkColormap *colormap,
static GMemChunk *color_chunk;
GdkColor*
gdk_color_copy (const GdkColor *color)
gdk_color_copy (GdkColor *color)
{
GdkColor *new_color;
@@ -205,7 +221,7 @@ gdk_color_hash (const GdkColor *colora)
(colora->blue >> 6));
}
gboolean
gint
gdk_color_equal (const GdkColor *colora,
const GdkColor *colorb)
{

View File

@@ -24,41 +24,15 @@ struct _GdkColor
/* The colormap type.
*/
typedef struct _GdkColormapClass GdkColormapClass;
#define GDK_TYPE_COLORMAP (gdk_colormap_get_type ())
#define GDK_COLORMAP(object) (G_TYPE_CHECK_INSTANCE_CAST ((object), GDK_TYPE_COLORMAP, GdkColormap))
#define GDK_COLORMAP_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), GDK_TYPE_COLORMAP, GdkColormapClass))
#define GDK_IS_COLORMAP(object) (G_TYPE_CHECK_INSTANCE_TYPE ((object), GDK_TYPE_COLORMAP))
#define GDK_IS_COLORMAP_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), GDK_TYPE_COLORMAP))
#define GDK_COLORMAP_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), GDK_TYPE_COLORMAP, GdkColormapClass))
struct _GdkColormap
{
GObject parent_instance;
/*< public >*/
gint size;
GdkColor *colors;
/*< private >*/
GdkVisual *visual;
gpointer windowing_data;
};
struct _GdkColormapClass
{
GObjectClass parent_class;
};
GType gdk_colormap_get_type (void);
GdkColormap* gdk_colormap_new (GdkVisual *visual,
gboolean allocate);
gint allocate);
GdkColormap* gdk_colormap_ref (GdkColormap *cmap);
void gdk_colormap_unref (GdkColormap *cmap);
@@ -85,20 +59,22 @@ void gdk_colormap_free_colors (GdkColormap *colormap,
GdkVisual *gdk_colormap_get_visual (GdkColormap *colormap);
GdkColor *gdk_color_copy (const GdkColor *color);
void gdk_color_free (GdkColor *color);
gint gdk_color_parse (const gchar *spec,
GdkColor *color);
guint gdk_color_hash (const GdkColor *colora);
gboolean gdk_color_equal (const GdkColor *colora,
const GdkColor *colorb);
GdkColor *gdk_color_copy (GdkColor *color);
void gdk_color_free (GdkColor *color);
gint gdk_color_parse (const gchar *spec,
GdkColor *color);
guint gdk_color_hash (const GdkColor *colora);
gint gdk_color_equal (const GdkColor *colora,
const GdkColor *colorb);
/* The following functions are deprecated */
void gdk_colors_store (GdkColormap *colormap,
GdkColor *colors,
gint ncolors);
gint gdk_colors_alloc (GdkColormap *colormap,
gboolean contiguous,
gint contiguous,
gulong *planes,
gint nplanes,
gulong *pixels,

View File

@@ -11,12 +11,13 @@ extern "C" {
*/
#ifndef GDK_DISABLE_COMPAT_H
#define GdkWindowType GdkDrawableType
#define gdk_draw_pixmap gdk_draw_drawable
#define gdk_draw_bitmap gdk_draw_drawable
#define gdk_window_get_size gdk_drawable_get_size
/* We can't really be compatible here, due to GObject */
/* #define gdk_window_get_type gdk_drawable_get_type */
#define gdk_window_get_type gdk_drawable_get_type
#define gdk_window_get_colormap gdk_drawable_get_colormap
#define gdk_window_set_colormap gdk_drawable_set_colormap
#define gdk_window_get_visual gdk_drawable_get_visual

View File

@@ -25,7 +25,7 @@
*/
#include "gdkcursor.h"
#include "gdkinternals.h"
#include "gdkprivate.h"
GdkCursor*
gdk_cursor_ref (GdkCursor *cursor)

View File

@@ -9,8 +9,7 @@ extern "C" {
typedef struct _GdkDragContext GdkDragContext;
typedef enum
{
typedef enum {
GDK_ACTION_DEFAULT = 1 << 0,
GDK_ACTION_COPY = 1 << 1,
GDK_ACTION_MOVE = 1 << 2,
@@ -19,35 +18,20 @@ typedef enum
GDK_ACTION_ASK = 1 << 5
} GdkDragAction;
typedef enum
{
typedef enum {
GDK_DRAG_PROTO_MOTIF,
GDK_DRAG_PROTO_XDND,
GDK_DRAG_PROTO_ROOTWIN, /* A root window with nobody claiming
* drags */
GDK_DRAG_PROTO_NONE, /* Not a valid drag window */
GDK_DRAG_PROTO_WIN32_DROPFILES, /* The simple WM_DROPFILES dnd */
GDK_DRAG_PROTO_OLE2 /* The complex OLE2 dnd (not implemented) */
GDK_DRAG_PROTO_OLE2, /* The complex OLE2 dnd (not implemented) */
} GdkDragProtocol;
/* Object that holds information about a drag in progress.
/* Structure that holds information about a drag in progress.
* this is used on both source and destination sides.
*/
typedef struct _GdkDragContextClass GdkDragContextClass;
#define GDK_TYPE_DRAG_CONTEXT (gdk_drag_context_get_type ())
#define GDK_DRAG_CONTEXT(object) (G_TYPE_CHECK_INSTANCE_CAST ((object), GDK_TYPE_DRAG_CONTEXT, GdkDragContext))
#define GDK_DRAG_CONTEXT_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), GDK_TYPE_DRAG_CONTEXT, GdkDragContextClass))
#define GDK_IS_DRAG_CONTEXT(object) (G_TYPE_CHECK_INSTANCE_TYPE ((object), GDK_TYPE_DRAG_CONTEXT))
#define GDK_IS_DRAG_CONTEXT_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), GDK_TYPE_DRAG_CONTEXT))
#define GDK_DRAG_CONTEXT_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), GDK_TYPE_DRAG_CONTEXT, GdkDragContextClass))
struct _GdkDragContext {
GObject parent_instance;
/*< public >*/
GdkDragProtocol protocol;
gboolean is_source;
@@ -61,21 +45,10 @@ struct _GdkDragContext {
GdkDragAction action;
guint32 start_time;
/*< private >*/
gpointer windowing_data;
};
struct _GdkDragContextClass {
GObjectClass parent_class;
};
/* Drag and Drop */
GType gdk_drag_context_get_type (void);
GdkDragContext * gdk_drag_context_new (void);
void gdk_drag_context_ref (GdkDragContext *context);
void gdk_drag_context_unref (GdkDragContext *context);
@@ -118,6 +91,8 @@ void gdk_drag_drop (GdkDragContext *context,
void gdk_drag_abort (GdkDragContext *context,
guint32 time);
GdkAtom gdk_drag_get_selection (GdkDragContext *context);
#ifdef __cplusplus
}
#endif /* __cplusplus */

View File

@@ -25,71 +25,34 @@
*/
#include "gdkdrawable.h"
#include "gdkinternals.h"
#include "gdkprivate.h"
#include "gdkwindow.h"
static void gdk_drawable_init (GdkDrawable *drawable);
static void gdk_drawable_class_init (GdkDrawableClass *klass);
static void gdk_drawable_finalize (GObject *object);
static gpointer parent_class = NULL;
GType
gdk_drawable_get_type (void)
{
static GType object_type = 0;
if (!object_type)
{
static const GTypeInfo object_info =
{
sizeof (GdkDrawableClass),
(GBaseInitFunc) NULL,
(GBaseFinalizeFunc) NULL,
(GClassInitFunc) gdk_drawable_class_init,
NULL, /* class_finalize */
NULL, /* class_data */
sizeof (GdkDrawable),
0, /* n_preallocs */
(GInstanceInitFunc) gdk_drawable_init,
};
object_type = g_type_register_static (G_TYPE_OBJECT,
"GdkDrawable",
&object_info);
}
return object_type;
}
static void
gdk_drawable_init (GdkDrawable *drawable)
{
}
static void
gdk_drawable_class_init (GdkDrawableClass *klass)
{
GObjectClass *object_class = G_OBJECT_CLASS (klass);
parent_class = g_type_class_peek_parent (klass);
object_class->finalize = gdk_drawable_finalize;
}
static void
gdk_drawable_finalize (GObject *object)
{
GdkDrawable *drawable = GDK_DRAWABLE (object);
G_OBJECT_CLASS (parent_class)->finalize (object);
}
/* Manipulation of drawables
*/
GdkDrawable *
gdk_drawable_alloc (void)
{
GdkDrawablePrivate *private = g_new (GdkDrawablePrivate, 1);
GdkDrawable *drawable = (GdkDrawable*) private;
drawable->user_data = NULL;
private->ref_count = 1;
private->destroyed = FALSE;
private->klass = NULL;
private->klass_data = NULL;
private->window_type = GDK_WINDOW_CHILD;
private->width = 1;
private->height = 1;
private->depth = 0;
private->colormap = NULL;
return drawable;
}
void
gdk_drawable_set_data (GdkDrawable *drawable,
@@ -97,22 +60,22 @@ gdk_drawable_set_data (GdkDrawable *drawable,
gpointer data,
GDestroyNotify destroy_func)
{
g_return_if_fail (GDK_IS_DRAWABLE (drawable));
g_object_set_qdata_full (G_OBJECT (drawable),
g_quark_from_string (key),
data,
destroy_func);
g_dataset_set_data_full (drawable, key, data, destroy_func);
}
gpointer
void
gdk_drawable_get_data (GdkDrawable *drawable,
const gchar *key)
{
g_return_val_if_fail (GDK_IS_DRAWABLE (drawable), NULL);
g_dataset_get_data (drawable, key);
}
GdkDrawableType
gdk_drawable_get_type (GdkDrawable *drawable)
{
g_return_val_if_fail (drawable != NULL, (GdkDrawableType) -1);
return g_object_get_qdata (G_OBJECT (drawable),
g_quark_try_string (key));
return GDK_DRAWABLE_TYPE (drawable);
}
void
@@ -120,56 +83,63 @@ gdk_drawable_get_size (GdkDrawable *drawable,
gint *width,
gint *height)
{
g_return_if_fail (GDK_IS_DRAWABLE (drawable));
GDK_DRAWABLE_GET_CLASS (drawable)->get_size (drawable, width, height);
GdkDrawablePrivate *drawable_private;
g_return_if_fail (drawable != NULL);
drawable_private = (GdkDrawablePrivate*) drawable;
if (width)
*width = drawable_private->width;
if (height)
*height = drawable_private->height;
}
GdkVisual*
gdk_drawable_get_visual (GdkDrawable *drawable)
{
g_return_val_if_fail (GDK_IS_DRAWABLE (drawable), NULL);
return GDK_DRAWABLE_GET_CLASS (drawable)->get_visual (drawable);
GdkColormap *colormap;
g_return_val_if_fail (drawable != NULL, NULL);
colormap = gdk_drawable_get_colormap (drawable);
return colormap ? gdk_colormap_get_visual (colormap) : NULL;
}
gint
gdk_drawable_get_depth (GdkDrawable *drawable)
{
g_return_val_if_fail (GDK_IS_DRAWABLE (drawable), 0);
GdkDrawablePrivate *private = (GdkDrawablePrivate *)drawable;
g_return_val_if_fail (drawable != NULL, 0);
return GDK_DRAWABLE_GET_CLASS (drawable)->get_depth (drawable);
}
void
gdk_drawable_set_colormap (GdkDrawable *drawable,
GdkColormap *cmap)
{
g_return_if_fail (GDK_IS_DRAWABLE (drawable));
GDK_DRAWABLE_GET_CLASS (drawable)->set_colormap (drawable, cmap);
}
GdkColormap*
gdk_drawable_get_colormap (GdkDrawable *drawable)
{
g_return_val_if_fail (GDK_IS_DRAWABLE (drawable), NULL);
return GDK_DRAWABLE_GET_CLASS (drawable)->get_colormap (drawable);
return private->depth;
}
GdkDrawable*
gdk_drawable_ref (GdkDrawable *drawable)
{
return (GdkDrawable *) g_object_ref (G_OBJECT (drawable));
GdkDrawablePrivate *private = (GdkDrawablePrivate *)drawable;
g_return_val_if_fail (drawable != NULL, NULL);
private->ref_count += 1;
return drawable;
}
void
gdk_drawable_unref (GdkDrawable *drawable)
{
g_return_if_fail (GDK_IS_DRAWABLE (drawable));
g_object_unref (G_OBJECT (drawable));
GdkDrawablePrivate *private = (GdkDrawablePrivate *)drawable;
g_return_if_fail (drawable != NULL);
g_return_if_fail (private->ref_count > 0);
private->ref_count -= 1;
if (private->ref_count == 0)
{
private->klass->destroy (drawable);
g_dataset_destroy (drawable);
g_free (drawable);
}
}
/* Drawing
@@ -180,15 +150,20 @@ gdk_draw_point (GdkDrawable *drawable,
gint x,
gint y)
{
GdkGCPrivate *gc_private;
GdkPoint point;
g_return_if_fail (GDK_IS_DRAWABLE (drawable));
g_return_if_fail (GDK_IS_GC (gc));
g_return_if_fail (drawable != NULL);
g_return_if_fail (gc != NULL);
if (GDK_DRAWABLE_DESTROYED (drawable))
return;
gc_private = (GdkGCPrivate*) gc;
point.x = x;
point.y = y;
GDK_DRAWABLE_GET_CLASS (drawable)->draw_points (drawable, gc, &point, 1);
((GdkDrawablePrivate *)drawable)->klass->draw_points (drawable, gc, &point, 1);
}
void
@@ -199,16 +174,21 @@ gdk_draw_line (GdkDrawable *drawable,
gint x2,
gint y2)
{
GdkGCPrivate *gc_private;
GdkSegment segment;
g_return_if_fail (GDK_IS_DRAWABLE (drawable));
g_return_if_fail (GDK_IS_GC (gc));
g_return_if_fail (drawable != NULL);
g_return_if_fail (gc != NULL);
if (GDK_DRAWABLE_DESTROYED (drawable))
return;
gc_private = (GdkGCPrivate*) gc;
segment.x1 = x1;
segment.y1 = y1;
segment.x2 = x2;
segment.y2 = y2;
GDK_DRAWABLE_GET_CLASS (drawable)->draw_segments (drawable, gc, &segment, 1);
((GdkDrawablePrivate *)drawable)->klass->draw_segments (drawable, gc, &segment, 1);
}
void
@@ -219,25 +199,23 @@ gdk_draw_rectangle (GdkDrawable *drawable,
gint y,
gint width,
gint height)
{
g_return_if_fail (GDK_IS_DRAWABLE (drawable));
g_return_if_fail (GDK_IS_GC (gc));
{
GdkDrawablePrivate *drawable_private;
if (width < 0 || height < 0)
{
gint real_width;
gint real_height;
gdk_drawable_get_size (drawable, &real_width, &real_height);
g_return_if_fail (drawable != NULL);
g_return_if_fail (gc != NULL);
if (width < 0)
width = real_width;
if (height < 0)
height = real_height;
}
drawable_private = (GdkDrawablePrivate*) drawable;
if (GDK_DRAWABLE_DESTROYED (drawable))
return;
GDK_DRAWABLE_GET_CLASS (drawable)->draw_rectangle (drawable, gc, filled, x, y,
width, height);
if (width < 0)
width = drawable_private->width;
if (height < 0)
height = drawable_private->height;
((GdkDrawablePrivate *)drawable)->klass->draw_rectangle (drawable, gc, filled, x, y,
width, height);
}
void
@@ -250,25 +228,25 @@ gdk_draw_arc (GdkDrawable *drawable,
gint height,
gint angle1,
gint angle2)
{
g_return_if_fail (GDK_IS_DRAWABLE (drawable));
g_return_if_fail (GDK_IS_GC (gc));
{
GdkDrawablePrivate *drawable_private;
GdkGCPrivate *gc_private;
if (width < 0 || height < 0)
{
gint real_width;
gint real_height;
gdk_drawable_get_size (drawable, &real_width, &real_height);
g_return_if_fail (drawable != NULL);
g_return_if_fail (gc != NULL);
if (width < 0)
width = real_width;
if (height < 0)
height = real_height;
}
drawable_private = (GdkDrawablePrivate*) drawable;
if (GDK_DRAWABLE_DESTROYED (drawable))
return;
gc_private = (GdkGCPrivate*) gc;
GDK_DRAWABLE_GET_CLASS (drawable)->draw_arc (drawable, gc, filled,
x, y, width, height, angle1, angle2);
if (width < 0)
width = drawable_private->width;
if (height < 0)
height = drawable_private->height;
((GdkDrawablePrivate *)drawable)->klass->draw_arc (drawable, gc, filled,
x, y, width, height, angle1, angle2);
}
void
@@ -278,10 +256,13 @@ gdk_draw_polygon (GdkDrawable *drawable,
GdkPoint *points,
gint npoints)
{
g_return_if_fail (GDK_IS_DRAWABLE (drawable));
g_return_if_fail (GDK_IS_GC (gc));
g_return_if_fail (drawable != NULL);
g_return_if_fail (gc != NULL);
GDK_DRAWABLE_GET_CLASS (drawable)->draw_polygon (drawable, gc, filled,
if (GDK_DRAWABLE_DESTROYED (drawable))
return;
((GdkDrawablePrivate *)drawable)->klass->draw_polygon (drawable, gc, filled,
points, npoints);
}
@@ -317,12 +298,12 @@ gdk_draw_text (GdkDrawable *drawable,
const gchar *text,
gint text_length)
{
g_return_if_fail (GDK_IS_DRAWABLE (drawable));
g_return_if_fail (drawable != NULL);
g_return_if_fail (font != NULL);
g_return_if_fail (GDK_IS_GC (gc));
g_return_if_fail (gc != NULL);
g_return_if_fail (text != NULL);
GDK_DRAWABLE_GET_CLASS (drawable)->draw_text (drawable, font, gc, x, y, text, text_length);
((GdkDrawablePrivate *)drawable)->klass->draw_text (drawable, font, gc, x, y, text, text_length);
}
void
@@ -334,12 +315,12 @@ gdk_draw_text_wc (GdkDrawable *drawable,
const GdkWChar *text,
gint text_length)
{
g_return_if_fail (GDK_IS_DRAWABLE (drawable));
g_return_if_fail (drawable != NULL);
g_return_if_fail (font != NULL);
g_return_if_fail (GDK_IS_GC (gc));
g_return_if_fail (gc != NULL);
g_return_if_fail (text != NULL);
GDK_DRAWABLE_GET_CLASS (drawable)->draw_text_wc (drawable, font, gc, x, y, text, text_length);
((GdkDrawablePrivate *)drawable)->klass->draw_text_wc (drawable, font, gc, x, y, text, text_length);
}
void
@@ -353,26 +334,21 @@ gdk_draw_drawable (GdkDrawable *drawable,
gint width,
gint height)
{
g_return_if_fail (GDK_IS_DRAWABLE (drawable));
g_return_if_fail (drawable != NULL);
g_return_if_fail (src != NULL);
g_return_if_fail (GDK_IS_GC (gc));
g_return_if_fail (gc != NULL);
if (width < 0 || height < 0)
{
gint real_width;
gint real_height;
gdk_drawable_get_size (drawable, &real_width, &real_height);
if (GDK_DRAWABLE_DESTROYED (drawable) || GDK_DRAWABLE_DESTROYED (src))
return;
if (width < 0)
width = real_width;
if (height < 0)
height = real_height;
}
if (width == -1)
width = ((GdkDrawablePrivate *)src)->width;
if (height == -1)
height = ((GdkDrawablePrivate *)src)->height;
GDK_DRAWABLE_GET_CLASS (drawable)->draw_drawable (drawable, gc, src,
xsrc, ysrc, xdest, ydest,
width, height);
((GdkDrawablePrivate *)drawable)->klass->draw_drawable (drawable, gc, src,
xsrc, ysrc, xdest, ydest,
width, height);
}
void
@@ -386,17 +362,25 @@ gdk_draw_image (GdkDrawable *drawable,
gint width,
gint height)
{
g_return_if_fail (GDK_IS_DRAWABLE (drawable));
GdkImagePrivate *image_private;
g_return_if_fail (drawable != NULL);
g_return_if_fail (image != NULL);
g_return_if_fail (GDK_IS_GC (gc));
g_return_if_fail (gc != NULL);
image_private = (GdkImagePrivate*) image;
if (width == -1)
width = image->width;
if (height == -1)
height = image->height;
GDK_DRAWABLE_GET_CLASS (drawable)->draw_image (drawable, gc, image, xsrc, ysrc,
xdest, ydest, width, height);
if (GDK_IS_WINDOW (drawable))
_gdk_window_draw_image (drawable, gc, image, xsrc, ysrc,
xdest, ydest, width, height);
else
image_private->klass->image_put (image, drawable, gc, xsrc, ysrc,
xdest, ydest, width, height);
}
void
@@ -405,15 +389,18 @@ gdk_draw_points (GdkDrawable *drawable,
GdkPoint *points,
gint npoints)
{
g_return_if_fail (GDK_IS_DRAWABLE (drawable));
g_return_if_fail (drawable != NULL);
g_return_if_fail ((points != NULL) && (npoints > 0));
g_return_if_fail (GDK_IS_GC (gc));
g_return_if_fail (gc != NULL);
g_return_if_fail (npoints >= 0);
if (npoints == 0)
return;
GDK_DRAWABLE_GET_CLASS (drawable)->draw_points (drawable, gc, points, npoints);
if (GDK_DRAWABLE_DESTROYED (drawable))
return;
((GdkDrawablePrivate *)drawable)->klass->draw_points (drawable, gc, points, npoints);
}
void
@@ -422,16 +409,19 @@ gdk_draw_segments (GdkDrawable *drawable,
GdkSegment *segs,
gint nsegs)
{
g_return_if_fail (GDK_IS_DRAWABLE (drawable));
g_return_if_fail (drawable != NULL);
if (nsegs == 0)
return;
g_return_if_fail (segs != NULL);
g_return_if_fail (GDK_IS_GC (gc));
g_return_if_fail (gc != NULL);
g_return_if_fail (nsegs >= 0);
GDK_DRAWABLE_GET_CLASS (drawable)->draw_segments (drawable, gc, segs, nsegs);
if (GDK_DRAWABLE_DESTROYED (drawable))
return;
((GdkDrawablePrivate *)drawable)->klass->draw_segments (drawable, gc, segs, nsegs);
}
void
@@ -441,13 +431,16 @@ gdk_draw_lines (GdkDrawable *drawable,
gint npoints)
{
g_return_if_fail (GDK_IS_DRAWABLE (drawable));
g_return_if_fail (drawable != NULL);
g_return_if_fail (points != NULL);
g_return_if_fail (GDK_IS_GC (gc));
g_return_if_fail (gc != NULL);
g_return_if_fail (npoints >= 0);
if (npoints == 0)
return;
GDK_DRAWABLE_GET_CLASS (drawable)->draw_lines (drawable, gc, points, npoints);
if (GDK_DRAWABLE_DESTROYED (drawable))
return;
((GdkDrawablePrivate *)drawable)->klass->draw_lines (drawable, gc, points, npoints);
}

View File

@@ -10,22 +10,45 @@ extern "C" {
typedef struct _GdkDrawableClass GdkDrawableClass;
#define GDK_TYPE_DRAWABLE (gdk_drawable_get_type ())
#define GDK_DRAWABLE(object) (G_TYPE_CHECK_INSTANCE_CAST ((object), GDK_TYPE_DRAWABLE, GdkDrawable))
#define GDK_DRAWABLE_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), GDK_TYPE_DRAWABLE, GdkDrawableClass))
#define GDK_IS_DRAWABLE(object) (G_TYPE_CHECK_INSTANCE_TYPE ((object), GDK_TYPE_DRAWABLE))
#define GDK_IS_DRAWABLE_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), GDK_TYPE_DRAWABLE))
#define GDK_DRAWABLE_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), GDK_TYPE_DRAWABLE, GdkDrawableClass))
/* Types of windows.
* Root: There is only 1 root window and it is initialized
* at startup. Creating a window of type GDK_WINDOW_ROOT
* is an error.
* Toplevel: Windows which interact with the window manager.
* Child: Windows which are children of some other type of window.
* (Any other type of window). Most windows are child windows.
* Dialog: A special kind of toplevel window which interacts with
* the window manager slightly differently than a regular
* toplevel window. Dialog windows should be used for any
* transient window.
* Pixmap: Pixmaps are really just another kind of window which
* doesn't actually appear on the screen. It can't have
* children, either and is really just a convenience so
* that the drawing functions can work on both windows
* and pixmaps transparently. (ie. You shouldn't pass a
* pixmap to any procedure which accepts a window with the
* exception of the drawing functions).
* Foreign: A window that actually belongs to another application
*/
typedef enum
{
GDK_WINDOW_ROOT,
GDK_WINDOW_TOPLEVEL,
GDK_WINDOW_CHILD,
GDK_WINDOW_DIALOG,
GDK_WINDOW_TEMP,
GDK_DRAWABLE_PIXMAP,
GDK_WINDOW_FOREIGN
} GdkDrawableType;
struct _GdkDrawable
{
GObject parent_instance;
gpointer user_data;
};
struct _GdkDrawableClass
{
GObjectClass parent_class;
void (*destroy) (GdkDrawable *drawable);
GdkGC *(*create_gc) (GdkDrawable *drawable,
GdkGCValues *values,
GdkGCValuesMask mask);
@@ -85,42 +108,22 @@ struct _GdkDrawableClass
GdkGC *gc,
GdkPoint *points,
gint npoints);
void (*draw_image) (GdkDrawable *drawable,
GdkGC *gc,
GdkImage *image,
gint xsrc,
gint ysrc,
gint xdest,
gint ydest,
gint width,
gint height);
gint (*get_depth) (GdkDrawable *drawable);
void (*get_size) (GdkDrawable *drawable,
gint *width,
gint *height);
void (*set_colormap) (GdkDrawable *drawable,
GdkColormap *cmap);
GdkColormap* (*get_colormap) (GdkDrawable *drawable);
GdkVisual* (*get_visual) (GdkDrawable *drawable);
};
GType gdk_drawable_get_type (void);
/* Manipulation of drawables
*/
GdkDrawable * gdk_drawable_alloc (void);
GdkDrawableType gdk_drawable_get_type (GdkDrawable *window);
void gdk_drawable_set_data (GdkDrawable *drawable,
const gchar *key,
gpointer data,
GDestroyNotify destroy_func);
gpointer gdk_drawable_get_data (GdkDrawable *drawable,
void gdk_drawable_get_data (GdkDrawable *drawable,
const gchar *key);
void gdk_drawable_get_size (GdkDrawable *drawable,
void gdk_drawable_get_size (GdkWindow *drawable,
gint *width,
gint *height);
void gdk_drawable_set_colormap (GdkDrawable *drawable,

View File

@@ -410,7 +410,6 @@ gdk_event_get_time (GdkEvent *event)
case GDK_2BUTTON_PRESS:
case GDK_3BUTTON_PRESS:
case GDK_BUTTON_RELEASE:
case GDK_SCROLL:
return event->button.time;
case GDK_KEY_PRESS:
case GDK_KEY_RELEASE:
@@ -462,7 +461,7 @@ gdk_event_get_time (GdkEvent *event)
*/
void
gdk_set_show_events (gboolean show_events)
gdk_set_show_events (gint show_events)
{
if (show_events)
gdk_debug_flags |= GDK_DEBUG_EVENTS;
@@ -470,10 +469,10 @@ gdk_set_show_events (gboolean show_events)
gdk_debug_flags &= ~GDK_DEBUG_EVENTS;
}
gboolean
gint
gdk_get_show_events (void)
{
return (gdk_debug_flags & GDK_DEBUG_EVENTS) != 0;
return gdk_debug_flags & GDK_DEBUG_EVENTS;
}
static void

View File

@@ -17,7 +17,6 @@ typedef struct _GdkEventNoExpose GdkEventNoExpose;
typedef struct _GdkEventVisibility GdkEventVisibility;
typedef struct _GdkEventMotion GdkEventMotion;
typedef struct _GdkEventButton GdkEventButton;
typedef struct _GdkEventScroll GdkEventScroll;
typedef struct _GdkEventKey GdkEventKey;
typedef struct _GdkEventFocus GdkEventFocus;
typedef struct _GdkEventCrossing GdkEventCrossing;
@@ -70,7 +69,6 @@ typedef GdkFilterReturn (*GdkFilterFunc) (GdkXEvent *xevent,
* Map: A window has been mapped. (It is now visible on the screen).
* Unmap: A window has been unmapped. (It is no longer visible on
* the screen).
* Scroll: A mouse wheel was scrolled either up or down.
*/
typedef enum
{
@@ -105,8 +103,7 @@ typedef enum
GDK_DROP_FINISHED = 27,
GDK_CLIENT_EVENT = 28,
GDK_VISIBILITY_NOTIFY = 29,
GDK_NO_EXPOSE = 30,
GDK_SCROLL = 31
GDK_NO_EXPOSE = 30
} GdkEventType;
/* Event masks. (Used to select what types of events a window
@@ -134,25 +131,15 @@ typedef enum
GDK_PROXIMITY_IN_MASK = 1 << 18,
GDK_PROXIMITY_OUT_MASK = 1 << 19,
GDK_SUBSTRUCTURE_MASK = 1 << 20,
GDK_SCROLL_MASK = 1 << 21,
GDK_ALL_EVENTS_MASK = 0x3FFFFE
GDK_ALL_EVENTS_MASK = 0x0FFFFF
} GdkEventMask;
typedef enum
{
typedef enum {
GDK_VISIBILITY_UNOBSCURED,
GDK_VISIBILITY_PARTIAL,
GDK_VISIBILITY_FULLY_OBSCURED
} GdkVisibilityState;
typedef enum
{
GDK_SCROLL_UP,
GDK_SCROLL_DOWN,
GDK_SCROLL_LEFT,
GDK_SCROLL_RIGHT
} GdkScrollDirection;
/* Types of enter/leave notifications.
* Ancestor:
* Virtual:
@@ -257,24 +244,6 @@ struct _GdkEventButton
gdouble x_root, y_root;
};
struct _GdkEventScroll
{
GdkEventType type;
GdkWindow *window;
gint8 send_event;
guint32 time;
gdouble x;
gdouble y;
gdouble pressure;
gdouble xtilt;
gdouble ytilt;
guint state;
GdkScrollDirection direction;
GdkInputSource source;
guint32 deviceid;
gdouble x_root, y_root;
};
struct _GdkEventKey
{
GdkEventType type;
@@ -392,7 +361,6 @@ union _GdkEvent
GdkEventVisibility visibility;
GdkEventMotion motion;
GdkEventButton button;
GdkEventScroll scroll;
GdkEventKey key;
GdkEventCrossing crossing;
GdkEventFocus focus_change;
@@ -419,8 +387,8 @@ void gdk_event_handler_set (GdkEventFunc func,
gpointer data,
GDestroyNotify notify);
void gdk_set_show_events (gboolean show_events);
gboolean gdk_get_show_events (void);
void gdk_set_show_events (gint show_events);
gint gdk_get_show_events (void);
/*
* The following function adds a global filter for all client

View File

@@ -25,7 +25,7 @@
*/
#include "gdkfont.h"
#include "gdkinternals.h"
#include "gdkprivate.h"
GdkFont*
gdk_font_ref (GdkFont *font)

View File

@@ -24,19 +24,12 @@ struct _GdkFont
gint descent;
};
#ifdef GDK_WINDOWING_WIN32
/* Temporary functions, will be replaced by something else for all backends
* eventually. Don't use!
*/
gchar** gdk_font_list_new (const gchar *font_pattern, gint *n_returned);
void gdk_font_list_free (gchar **font_list);
#endif
GdkFont* gdk_font_load (const gchar *font_name);
GdkFont* gdk_fontset_load (const gchar *fontset_name);
GdkFont* gdk_fontset_load (gchar *fontset_name);
GdkFont* gdk_font_ref (GdkFont *font);
void gdk_font_unref (GdkFont *font);
gint gdk_font_id (const GdkFont *font);
gboolean gdk_font_equal (const GdkFont *fonta,
gint gdk_font_equal (const GdkFont *fonta,
const GdkFont *fontb);
gint gdk_string_width (GdkFont *font,
@@ -90,12 +83,6 @@ void gdk_string_extents (GdkFont *font,
gint *ascent,
gint *descent);
#ifdef GDK_WINDOWING_WIN32
/* Ditto temporary */
gchar* gdk_font_full_name_get (GdkFont *font);
void gdk_font_full_name_free (gchar *name);
#endif
#ifdef __cplusplus
}
#endif /* __cplusplus */

View File

@@ -29,62 +29,21 @@
#include "gdkgc.h"
#include "gdkprivate.h"
static void gdk_gc_init (GdkGC *gc);
static void gdk_gc_class_init (GdkGCClass *klass);
static void gdk_gc_finalize (GObject *object);
static gpointer parent_class = NULL;
GType
gdk_gc_get_type (void)
GdkGC*
gdk_gc_alloc (void)
{
static GType object_type = 0;
GdkGCPrivate *private;
if (!object_type)
{
static const GTypeInfo object_info =
{
sizeof (GdkGCClass),
(GBaseInitFunc) NULL,
(GBaseFinalizeFunc) NULL,
(GClassInitFunc) gdk_gc_class_init,
NULL, /* class_finalize */
NULL, /* class_data */
sizeof (GdkGC),
0, /* n_preallocs */
(GInstanceInitFunc) gdk_gc_init,
};
object_type = g_type_register_static (G_TYPE_OBJECT,
"GdkGC",
&object_info);
}
return object_type;
}
private = g_new (GdkGCPrivate, 1);
private->ref_count = 1;
private->klass = NULL;
private->klass_data = NULL;
private->clip_x_origin = 0;
private->clip_y_origin = 0;
private->ts_x_origin = 0;
private->ts_y_origin = 0;
static void
gdk_gc_init (GdkGC *gc)
{
}
static void
gdk_gc_class_init (GdkGCClass *klass)
{
GObjectClass *object_class = G_OBJECT_CLASS (klass);
parent_class = g_type_class_peek_parent (klass);
object_class->finalize = gdk_gc_finalize;
}
static void
gdk_gc_finalize (GObject *object)
{
GdkGC *gc = GDK_GC (object);
G_OBJECT_CLASS (parent_class)->finalize (object);
return (GdkGC *)private;
}
GdkGC*
@@ -92,7 +51,7 @@ gdk_gc_new (GdkDrawable *drawable)
{
g_return_val_if_fail (drawable != NULL, NULL);
if (GDK_IS_WINDOW (drawable) && GDK_WINDOW_DESTROYED (drawable))
if (GDK_DRAWABLE_DESTROYED (drawable))
return NULL;
return gdk_gc_new_with_values (drawable, NULL, 0);
@@ -104,23 +63,26 @@ gdk_gc_new_with_values (GdkDrawable *drawable,
GdkGCValuesMask values_mask)
{
GdkGC *gc;
GdkGCPrivate *private;
g_return_val_if_fail (drawable != NULL, NULL);
if (GDK_IS_WINDOW (drawable) && GDK_WINDOW_DESTROYED (drawable))
if (GDK_DRAWABLE_DESTROYED (drawable))
return NULL;
gc = GDK_DRAWABLE_GET_CLASS (drawable)->create_gc (drawable,
values,
values_mask);
gc = ((GdkDrawablePrivate *)drawable)->klass->create_gc (drawable,
values,
values_mask);
private = (GdkGCPrivate *)gc;
if (values_mask & GDK_GC_CLIP_X_ORIGIN)
gc->clip_x_origin = values->clip_x_origin;
private->clip_x_origin = values->clip_x_origin;
if (values_mask & GDK_GC_CLIP_Y_ORIGIN)
gc->clip_y_origin = values->clip_y_origin;
private->clip_y_origin = values->clip_y_origin;
if (values_mask & GDK_GC_TS_X_ORIGIN)
gc->ts_x_origin = values->ts_x_origin;
private->ts_x_origin = values->ts_x_origin;
if (values_mask & GDK_GC_TS_Y_ORIGIN)
gc->ts_y_origin = values->ts_y_origin;
private->ts_y_origin = values->ts_y_origin;
return gc;
}
@@ -128,23 +90,39 @@ gdk_gc_new_with_values (GdkDrawable *drawable,
GdkGC *
gdk_gc_ref (GdkGC *gc)
{
return (GdkGC *) g_object_ref (G_OBJECT (gc));
GdkGCPrivate *private = (GdkGCPrivate*) gc;
g_return_val_if_fail (gc != NULL, NULL);
private->ref_count += 1;
return gc;
}
void
gdk_gc_unref (GdkGC *gc)
{
g_object_unref (G_OBJECT (gc));
GdkGCPrivate *private = (GdkGCPrivate*) gc;
g_return_if_fail (gc != NULL);
g_return_if_fail (private->ref_count > 0);
private->ref_count--;
if (private->ref_count == 0)
{
private->klass->destroy (gc);
g_free (private);
}
}
void
gdk_gc_get_values (GdkGC *gc,
GdkGCValues *values)
{
g_return_if_fail (GDK_IS_GC (gc));
g_return_if_fail (gc != NULL);
g_return_if_fail (values != NULL);
GDK_GC_GET_CLASS (gc)->get_values (gc, values);
((GdkGCPrivate *)gc)->klass->get_values (gc, values);
}
void
@@ -152,19 +130,21 @@ gdk_gc_set_values (GdkGC *gc,
GdkGCValues *values,
GdkGCValuesMask values_mask)
{
g_return_if_fail (GDK_IS_GC (gc));
GdkGCPrivate *private = (GdkGCPrivate *)gc;
g_return_if_fail (gc != NULL);
g_return_if_fail (values != NULL);
if (values_mask & GDK_GC_CLIP_X_ORIGIN)
gc->clip_x_origin = values->clip_x_origin;
private->clip_x_origin = values->clip_x_origin;
if (values_mask & GDK_GC_CLIP_Y_ORIGIN)
gc->clip_y_origin = values->clip_y_origin;
private->clip_y_origin = values->clip_y_origin;
if (values_mask & GDK_GC_TS_X_ORIGIN)
gc->ts_x_origin = values->ts_x_origin;
private->ts_x_origin = values->ts_x_origin;
if (values_mask & GDK_GC_TS_Y_ORIGIN)
gc->ts_y_origin = values->ts_y_origin;
private->ts_y_origin = values->ts_y_origin;
GDK_GC_GET_CLASS (gc)->set_values (gc, values, values_mask);
private->klass->set_values (gc, values, values_mask);
}
void
@@ -173,7 +153,7 @@ gdk_gc_set_foreground (GdkGC *gc,
{
GdkGCValues values;
g_return_if_fail (GDK_IS_GC (gc));
g_return_if_fail (gc != NULL);
g_return_if_fail (color != NULL);
values.foreground = *color;
@@ -186,7 +166,7 @@ gdk_gc_set_background (GdkGC *gc,
{
GdkGCValues values;
g_return_if_fail (GDK_IS_GC (gc));
g_return_if_fail (gc != NULL);
g_return_if_fail (color != NULL);
values.background = *color;
@@ -199,7 +179,7 @@ gdk_gc_set_font (GdkGC *gc,
{
GdkGCValues values;
g_return_if_fail (GDK_IS_GC (gc));
g_return_if_fail (gc != NULL);
g_return_if_fail (font != NULL);
values.font = font;
@@ -212,7 +192,7 @@ gdk_gc_set_function (GdkGC *gc,
{
GdkGCValues values;
g_return_if_fail (GDK_IS_GC (gc));
g_return_if_fail (gc != NULL);
values.function = function;
gdk_gc_set_values (gc, &values, GDK_GC_FUNCTION);
@@ -224,7 +204,7 @@ gdk_gc_set_fill (GdkGC *gc,
{
GdkGCValues values;
g_return_if_fail (GDK_IS_GC (gc));
g_return_if_fail (gc != NULL);
values.fill = fill;
gdk_gc_set_values (gc, &values, GDK_GC_FILL);
@@ -236,7 +216,7 @@ gdk_gc_set_tile (GdkGC *gc,
{
GdkGCValues values;
g_return_if_fail (GDK_IS_GC (gc));
g_return_if_fail (gc != NULL);
values.tile = tile;
gdk_gc_set_values (gc, &values, GDK_GC_TILE);
@@ -248,7 +228,7 @@ gdk_gc_set_stipple (GdkGC *gc,
{
GdkGCValues values;
g_return_if_fail (GDK_IS_GC (gc));
g_return_if_fail (gc != NULL);
values.stipple = stipple;
gdk_gc_set_values (gc, &values, GDK_GC_STIPPLE);
@@ -261,7 +241,7 @@ gdk_gc_set_ts_origin (GdkGC *gc,
{
GdkGCValues values;
g_return_if_fail (GDK_IS_GC (gc));
g_return_if_fail (gc != NULL);
values.ts_x_origin = x;
values.ts_y_origin = y;
@@ -277,7 +257,7 @@ gdk_gc_set_clip_origin (GdkGC *gc,
{
GdkGCValues values;
g_return_if_fail (GDK_IS_GC (gc));
g_return_if_fail (gc != NULL);
values.clip_x_origin = x;
values.clip_y_origin = y;
@@ -292,7 +272,7 @@ gdk_gc_set_clip_mask (GdkGC *gc,
{
GdkGCValues values;
g_return_if_fail (GDK_IS_GC (gc));
g_return_if_fail (gc != NULL);
values.clip_mask = mask;
gdk_gc_set_values (gc, &values, GDK_GC_CLIP_MASK);
@@ -305,7 +285,7 @@ gdk_gc_set_subwindow (GdkGC *gc,
{
GdkGCValues values;
g_return_if_fail (GDK_IS_GC (gc));
g_return_if_fail (gc != NULL);
values.subwindow_mode = mode;
gdk_gc_set_values (gc, &values, GDK_GC_SUBWINDOW);
@@ -317,7 +297,7 @@ gdk_gc_set_exposures (GdkGC *gc,
{
GdkGCValues values;
g_return_if_fail (GDK_IS_GC (gc));
g_return_if_fail (gc != NULL);
values.graphics_exposures = exposures;
gdk_gc_set_values (gc, &values, GDK_GC_EXPOSURES);
@@ -347,11 +327,11 @@ gdk_gc_set_line_attributes (GdkGC *gc,
void
gdk_gc_set_dashes (GdkGC *gc,
gint dash_offset,
gint8 dash_list[],
gchar dash_list[],
gint n)
{
g_return_if_fail (GDK_IS_GC (gc));
g_return_if_fail (gc != NULL);
g_return_if_fail (dash_list != NULL);
GDK_GC_GET_CLASS (gc)->set_dashes (gc, dash_offset, dash_list, n);
((GdkGCPrivate *)gc)->klass->set_dashes (gc, dash_offset, dash_list, n);
}

View File

@@ -150,27 +150,14 @@ struct _GdkGCValues
GdkJoinStyle join_style;
};
#define GDK_TYPE_GC (gdk_gc_get_type ())
#define GDK_GC(object) (G_TYPE_CHECK_INSTANCE_CAST ((object), GDK_TYPE_GC, GdkGC))
#define GDK_GC_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), GDK_TYPE_GC, GdkGCClass))
#define GDK_IS_GC(object) (G_TYPE_CHECK_INSTANCE_TYPE ((object), GDK_TYPE_GC))
#define GDK_IS_GC_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), GDK_TYPE_GC))
#define GDK_GC_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), GDK_TYPE_GC, GdkGCClass))
struct _GdkGC
{
GObject parent_instance;
gint clip_x_origin;
gint clip_y_origin;
gint ts_x_origin;
gint ts_y_origin;
gint dummy_var;
};
struct _GdkGCClass
{
GObjectClass parent_class;
void (*destroy) (GdkGC *gc);
void (*get_values) (GdkGC *gc,
GdkGCValues *values);
void (*set_values) (GdkGC *gc,
@@ -178,23 +165,23 @@ struct _GdkGCClass
GdkGCValuesMask mask);
void (*set_dashes) (GdkGC *gc,
gint dash_offset,
gint8 dash_list[],
gchar dash_list[],
gint n);
};
GType gdk_gc_get_type (void);
GdkGC *gdk_gc_new (GdkDrawable *drawable);
GdkGC *gdk_gc_alloc (void);
GdkGC *gdk_gc_new_with_values (GdkDrawable *drawable,
GdkGCValues *values,
GdkGCValuesMask values_mask);
void gdk_gc_init (GdkGC *gc,
GdkGCClass *klass);
GdkGC *gdk_gc_ref (GdkGC *gc);
void gdk_gc_unref (GdkGC *gc);
void gdk_gc_get_values (GdkGC *gc,
GdkGCValues *values);
void gdk_gc_set_values (GdkGC *gc,
GdkGCValues *values,
GdkGCValuesMask values_mask);
void gdk_gc_set_foreground (GdkGC *gc,
GdkColor *color);
void gdk_gc_set_background (GdkGC *gc,
@@ -232,7 +219,7 @@ void gdk_gc_set_line_attributes (GdkGC *gc,
GdkJoinStyle join_style);
void gdk_gc_set_dashes (GdkGC *gc,
gint dash_offset,
gint8 dash_list[],
gchar dash_list[],
gint n);
void gdk_gc_copy (GdkGC *dst_gc,
GdkGC *src_gc);

View File

@@ -47,7 +47,6 @@
# define gdk_iswalnum(c) iswalnum(c)
# define gdk_iswspace(c) iswspace(c)
#else
# include <ctype.h>
# define gdk_iswalnum(c) ((wchar_t)(c) <= 0xFF && isalnum(c))
# define gdk_iswspace(c) ((wchar_t)(c) <= 0xFF && isspace(c))
#endif

View File

@@ -96,7 +96,7 @@ struct _GdkICAttr
GdkColormap *status_colormap;
};
gboolean gdk_im_ready (void);
gint gdk_im_ready (void);
void gdk_im_begin (GdkIC *ic,
GdkWindow *window);

View File

@@ -33,13 +33,26 @@
GdkImage *
gdk_image_ref (GdkImage *image)
{
return (GdkImage *) g_object_ref (G_OBJECT (image));
GdkImagePrivate *private = (GdkImagePrivate *)image;
g_return_val_if_fail (image != NULL, NULL);
private->ref_count++;
return image;
}
void
gdk_image_unref (GdkImage *image)
{
g_return_if_fail (GDK_IS_IMAGE (image));
GdkImagePrivate *private = (GdkImagePrivate *)image;
g_return_if_fail (image != NULL);
g_return_if_fail (private->ref_count > 0);
g_object_unref (G_OBJECT (image));
private->ref_count--;
if (private->ref_count == 0)
private->klass->destroy (image);
}

View File

@@ -29,19 +29,8 @@ typedef enum
GDK_IMAGE_SHARED_PIXMAP
} GdkImageType;
typedef struct _GdkImageClass GdkImageClass;
#define GDK_TYPE_IMAGE (gdk_image_get_type ())
#define GDK_IMAGE(object) (G_TYPE_CHECK_INSTANCE_CAST ((object), GDK_TYPE_IMAGE, GdkImage))
#define GDK_IMAGE_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), GDK_TYPE_IMAGE, GdkImageClass))
#define GDK_IS_IMAGE(object) (G_TYPE_CHECK_INSTANCE_TYPE ((object), GDK_TYPE_IMAGE))
#define GDK_IS_IMAGE_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), GDK_TYPE_IMAGE))
#define GDK_IMAGE_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), GDK_TYPE_IMAGE, GdkImageClass))
struct _GdkImage
{
GObject parent_instance;
GdkImageType type;
GdkVisual *visual; /* visual used to create the image */
GdkByteOrder byte_order;
@@ -51,18 +40,9 @@ struct _GdkImage
guint16 bpp; /* bytes per pixel */
guint16 bpl; /* bytes per line */
gpointer mem;
gpointer windowing_data;
};
struct _GdkImageClass
{
GObjectClass parent_class;
};
GType gdk_image_get_type (void);
GdkImage* gdk_image_new_bitmap (GdkVisual *visual,
GdkImage* gdk_image_new_bitmap(GdkVisual *visual,
gpointer data,
gint width,
gint height);
@@ -94,6 +74,7 @@ guint32 gdk_image_get_pixel (GdkImage *image,
gint x,
gint y);
#ifdef __cplusplus
}
#endif /* __cplusplus */

View File

@@ -73,33 +73,33 @@ struct _GdkTimeCoord
gdouble ytilt;
};
GList * gdk_input_list_devices (void);
void gdk_input_set_extension_events (GdkWindow *window,
gint mask,
GdkExtensionMode mode);
void gdk_input_set_source (guint32 deviceid,
GdkInputSource source);
gboolean gdk_input_set_mode (guint32 deviceid,
GdkInputMode mode);
void gdk_input_set_axes (guint32 deviceid,
GdkAxisUse *axes);
void gdk_input_set_key (guint32 deviceid,
guint index,
guint keyval,
GdkModifierType modifiers);
void gdk_input_window_get_pointer (GdkWindow *window,
guint32 deviceid,
gdouble *x,
gdouble *y,
gdouble *pressure,
gdouble *xtilt,
gdouble *ytilt,
GdkModifierType *mask);
GdkTimeCoord *gdk_input_motion_events (GdkWindow *window,
guint32 deviceid,
guint32 start,
guint32 stop,
gint *nevents_return);
GList * gdk_input_list_devices (void);
void gdk_input_set_extension_events (GdkWindow *window,
gint mask,
GdkExtensionMode mode);
void gdk_input_set_source (guint32 deviceid,
GdkInputSource source);
gint gdk_input_set_mode (guint32 deviceid,
GdkInputMode mode);
void gdk_input_set_axes (guint32 deviceid,
GdkAxisUse *axes);
void gdk_input_set_key (guint32 deviceid,
guint index,
guint keyval,
GdkModifierType modifiers);
void gdk_input_window_get_pointer (GdkWindow *window,
guint32 deviceid,
gdouble *x,
gdouble *y,
gdouble *pressure,
gdouble *xtilt,
gdouble *ytilt,
GdkModifierType *mask);
GdkTimeCoord * gdk_input_motion_events (GdkWindow *window,
guint32 deviceid,
guint32 start,
guint32 stop,
gint *nevents_return);
#ifdef __cplusplus
}

View File

@@ -129,10 +129,16 @@ void gdk_im_close (void);
void gdk_ic_cleanup (void);
#endif /* USE_XIM */
void _gdk_window_destroy (GdkWindow *window,
gboolean foreign_destroy);
void _gdk_window_clear_update_area (GdkWindow *window);
GdkWindow* _gdk_window_alloc (void);
void _gdk_window_draw_image (GdkDrawable *drawable,
GdkGC *gc,
GdkImage *image,
gint xsrc,
gint ysrc,
gint xdest,
gint ydest,
gint width,
gint height);
/*****************************************
* Interfaces provided by windowing code *
@@ -146,6 +152,15 @@ void _gdk_colormap_real_destroy (GdkColormap *colormap);
void _gdk_cursor_destroy (GdkCursor *cursor);
/* Class supplied by windowing-system-dependent code for GdkWindow.
*/
extern GdkDrawableClass _gdk_windowing_window_class;
/* Class for covering over windowing-system-dependent and backing-store
* code for GdkWindow
*/
extern GdkDrawableClass _gdk_window_class;
extern GdkArgDesc _gdk_windowing_args[];
gboolean _gdk_windowing_init_check (int argc,
char **argv);
@@ -172,36 +187,15 @@ void _gdk_windowing_window_clear_area_e (GdkWindow *window,
gboolean _gdk_windowing_window_queue_antiexpose (GdkWindow *window,
GdkRegion *area);
/* Called to do the windowing system specific part of gdk_window_destroy(),
*
* window: The window being destroyed
* recursing: If TRUE, then this is being called because a parent
* was destroyed. This generally means that the call to the windowing system
* to destroy the window can be omitted, since it will be destroyed as a result
* of the parent being destroyed. Unless @foreign_destroy
*
* foreign_destroy: If TRUE, the window or a parent was destroyed by some external
* agency. The window has already been destroyed and no windowing
* system calls should be made. (This may never happen for some
* windowing systems.)
*/
void _gdk_windowing_window_destroy (GdkWindow *window,
gboolean recursing,
gboolean foreign_destroy);
/* Implementation types */
GType gdk_window_impl_get_type (void);
GType gdk_pixmap_impl_get_type (void);
/************************************
* Initialization and exit routines *
************************************/
void gdk_windowing_window_init (void);
void gdk_window_init (void);
void gdk_visual_init (void);
void gdk_dnd_init (void);
void gdk_windowing_image_init (void);
void gdk_image_init (void);
void gdk_image_exit (void);
void gdk_input_init (void);

View File

@@ -1,395 +0,0 @@
/* GDK - The GIMP Drawing Kit
* 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.
*/
/*
* Modified by the GTK+ Team and others 1997-1999. See the AUTHORS
* file for a list of people on the GTK+ Team. See the ChangeLog
* files for a list of changes. These files are distributed with
* GTK+ at ftp://ftp.gtk.org/pub/gtk/.
*/
#include "gdkpixmap.h"
#include "gdkinternals.h"
static GdkGC *gdk_pixmap_create_gc (GdkDrawable *drawable,
GdkGCValues *values,
GdkGCValuesMask mask);
static void gdk_pixmap_draw_rectangle (GdkDrawable *drawable,
GdkGC *gc,
gint filled,
gint x,
gint y,
gint width,
gint height);
static void gdk_pixmap_draw_arc (GdkDrawable *drawable,
GdkGC *gc,
gint filled,
gint x,
gint y,
gint width,
gint height,
gint angle1,
gint angle2);
static void gdk_pixmap_draw_polygon (GdkDrawable *drawable,
GdkGC *gc,
gint filled,
GdkPoint *points,
gint npoints);
static void gdk_pixmap_draw_text (GdkDrawable *drawable,
GdkFont *font,
GdkGC *gc,
gint x,
gint y,
const gchar *text,
gint text_length);
static void gdk_pixmap_draw_text_wc (GdkDrawable *drawable,
GdkFont *font,
GdkGC *gc,
gint x,
gint y,
const GdkWChar *text,
gint text_length);
static void gdk_pixmap_draw_drawable (GdkDrawable *drawable,
GdkGC *gc,
GdkPixmap *src,
gint xsrc,
gint ysrc,
gint xdest,
gint ydest,
gint width,
gint height);
static void gdk_pixmap_draw_points (GdkDrawable *drawable,
GdkGC *gc,
GdkPoint *points,
gint npoints);
static void gdk_pixmap_draw_segments (GdkDrawable *drawable,
GdkGC *gc,
GdkSegment *segs,
gint nsegs);
static void gdk_pixmap_draw_lines (GdkDrawable *drawable,
GdkGC *gc,
GdkPoint *points,
gint npoints);
static void gdk_pixmap_draw_image (GdkDrawable *drawable,
GdkGC *gc,
GdkImage *image,
gint xsrc,
gint ysrc,
gint xdest,
gint ydest,
gint width,
gint height);
static void gdk_pixmap_real_get_size (GdkDrawable *drawable,
gint *width,
gint *height);
static GdkVisual* gdk_pixmap_real_get_visual (GdkDrawable *drawable);
static gint gdk_pixmap_real_get_depth (GdkDrawable *drawable);
static void gdk_pixmap_real_set_colormap (GdkDrawable *drawable,
GdkColormap *cmap);
static GdkColormap* gdk_pixmap_real_get_colormap (GdkDrawable *drawable);
static void gdk_pixmap_init (GdkPixmapObject *pixmap);
static void gdk_pixmap_class_init (GdkPixmapObjectClass *klass);
static void gdk_pixmap_finalize (GObject *object);
static gpointer parent_class = NULL;
GType
gdk_pixmap_get_type (void)
{
static GType object_type = 0;
if (!object_type)
{
static const GTypeInfo object_info =
{
sizeof (GdkPixmapObjectClass),
(GBaseInitFunc) NULL,
(GBaseFinalizeFunc) NULL,
(GClassInitFunc) gdk_pixmap_class_init,
NULL, /* class_finalize */
NULL, /* class_data */
sizeof (GdkPixmapObject),
0, /* n_preallocs */
(GInstanceInitFunc) gdk_pixmap_init,
};
object_type = g_type_register_static (GDK_TYPE_DRAWABLE,
"GdkPixmap",
&object_info);
}
return object_type;
}
static void
gdk_pixmap_init (GdkPixmapObject *pixmap)
{
/* 0-initialization is good for all other fields. */
pixmap->impl =
GDK_DRAWABLE (g_type_create_instance (gdk_pixmap_impl_get_type ()));
}
static void
gdk_pixmap_class_init (GdkPixmapObjectClass *klass)
{
GObjectClass *object_class = G_OBJECT_CLASS (klass);
GdkDrawableClass *drawable_class = GDK_DRAWABLE_CLASS (klass);
parent_class = g_type_class_peek_parent (klass);
object_class->finalize = gdk_pixmap_finalize;
drawable_class->create_gc = gdk_pixmap_create_gc;
drawable_class->draw_rectangle = gdk_pixmap_draw_rectangle;
drawable_class->draw_arc = gdk_pixmap_draw_arc;
drawable_class->draw_polygon = gdk_pixmap_draw_polygon;
drawable_class->draw_text = gdk_pixmap_draw_text;
drawable_class->draw_text_wc = gdk_pixmap_draw_text_wc;
drawable_class->draw_drawable = gdk_pixmap_draw_drawable;
drawable_class->draw_points = gdk_pixmap_draw_points;
drawable_class->draw_segments = gdk_pixmap_draw_segments;
drawable_class->draw_lines = gdk_pixmap_draw_lines;
drawable_class->draw_image = gdk_pixmap_draw_image;
drawable_class->get_depth = gdk_pixmap_real_get_depth;
drawable_class->get_size = gdk_pixmap_real_get_size;
drawable_class->set_colormap = gdk_pixmap_real_set_colormap;
drawable_class->get_colormap = gdk_pixmap_real_get_colormap;
drawable_class->get_visual = gdk_pixmap_real_get_visual;
}
static void
gdk_pixmap_finalize (GObject *object)
{
GdkPixmapObject *obj = (GdkPixmapObject *) object;
g_object_unref (G_OBJECT (obj->impl));
obj->impl = NULL;
G_OBJECT_CLASS (parent_class)->finalize (object);
}
static GdkGC *
gdk_pixmap_create_gc (GdkDrawable *drawable,
GdkGCValues *values,
GdkGCValuesMask mask)
{
return gdk_gc_new_with_values (((GdkPixmapObject *) drawable)->impl,
values, mask);
}
static void
gdk_pixmap_draw_rectangle (GdkDrawable *drawable,
GdkGC *gc,
gint filled,
gint x,
gint y,
gint width,
gint height)
{
GdkPixmapObject *private = (GdkPixmapObject *)drawable;
gdk_draw_rectangle (private->impl, gc, filled,
x, y, width, height);
}
static void
gdk_pixmap_draw_arc (GdkDrawable *drawable,
GdkGC *gc,
gint filled,
gint x,
gint y,
gint width,
gint height,
gint angle1,
gint angle2)
{
GdkPixmapObject *private = (GdkPixmapObject *)drawable;
gdk_draw_arc (private->impl, gc, filled,
x, y,
width, height, angle1, angle2);
}
static void
gdk_pixmap_draw_polygon (GdkDrawable *drawable,
GdkGC *gc,
gint filled,
GdkPoint *points,
gint npoints)
{
GdkPixmapObject *private = (GdkPixmapObject *)drawable;
gdk_draw_polygon (private->impl, gc, filled, points, npoints);
}
static void
gdk_pixmap_draw_text (GdkDrawable *drawable,
GdkFont *font,
GdkGC *gc,
gint x,
gint y,
const gchar *text,
gint text_length)
{
GdkPixmapObject *private = (GdkPixmapObject *)drawable;
gdk_draw_text (private->impl, font, gc,
x, y, text, text_length);
}
static void
gdk_pixmap_draw_text_wc (GdkDrawable *drawable,
GdkFont *font,
GdkGC *gc,
gint x,
gint y,
const GdkWChar *text,
gint text_length)
{
GdkPixmapObject *private = (GdkPixmapObject *)drawable;
gdk_draw_text_wc (private->impl, font, gc,
x, y, text, text_length);
}
static void
gdk_pixmap_draw_drawable (GdkDrawable *drawable,
GdkGC *gc,
GdkPixmap *src,
gint xsrc,
gint ysrc,
gint xdest,
gint ydest,
gint width,
gint height)
{
GdkPixmapObject *private = (GdkPixmapObject *)drawable;
gdk_draw_drawable (private->impl, gc, src, xsrc, ysrc,
xdest, ydest,
width, height);
}
static void
gdk_pixmap_draw_points (GdkDrawable *drawable,
GdkGC *gc,
GdkPoint *points,
gint npoints)
{
GdkPixmapObject *private = (GdkPixmapObject *)drawable;
gdk_draw_points (private->impl, gc, points, npoints);
}
static void
gdk_pixmap_draw_segments (GdkDrawable *drawable,
GdkGC *gc,
GdkSegment *segs,
gint nsegs)
{
GdkPixmapObject *private = (GdkPixmapObject *)drawable;
gdk_draw_segments (private->impl, gc, segs, nsegs);
}
static void
gdk_pixmap_draw_lines (GdkDrawable *drawable,
GdkGC *gc,
GdkPoint *points,
gint npoints)
{
GdkPixmapObject *private = (GdkPixmapObject *)drawable;
gdk_draw_lines (private->impl, gc, points, npoints);
}
static void
gdk_pixmap_draw_image (GdkDrawable *drawable,
GdkGC *gc,
GdkImage *image,
gint xsrc,
gint ysrc,
gint xdest,
gint ydest,
gint width,
gint height)
{
GdkPixmapObject *private = (GdkPixmapObject *)drawable;
gdk_draw_image (private->impl, gc, image, xsrc, ysrc, xdest, ydest,
width, height);
}
static void
gdk_pixmap_real_get_size (GdkDrawable *drawable,
gint *width,
gint *height)
{
g_return_if_fail (GDK_IS_PIXMAP (drawable));
gdk_drawable_get_size (GDK_DRAWABLE (((GdkPixmapObject*)drawable)->impl),
width, height);
}
static GdkVisual*
gdk_pixmap_real_get_visual (GdkDrawable *drawable)
{
GdkColormap *colormap;
g_return_val_if_fail (GDK_IS_PIXMAP (drawable), NULL);
colormap = gdk_drawable_get_colormap (drawable);
return colormap ? gdk_colormap_get_visual (colormap) : NULL;
}
static gint
gdk_pixmap_real_get_depth (GdkDrawable *drawable)
{
gint depth;
g_return_val_if_fail (GDK_IS_PIXMAP (drawable), 0);
depth = ((GdkPixmapObject *)GDK_PIXMAP (drawable))->depth;
if (depth == 0)
g_print ("0 depth for type %s\n", g_type_name (G_OBJECT_TYPE (drawable)));
return depth;
}
static void
gdk_pixmap_real_set_colormap (GdkDrawable *drawable,
GdkColormap *cmap)
{
g_return_if_fail (GDK_IS_PIXMAP (drawable));
gdk_drawable_set_colormap (((GdkPixmapObject*)drawable)->impl, cmap);
}
static GdkColormap*
gdk_pixmap_real_get_colormap (GdkDrawable *drawable)
{
g_return_val_if_fail (GDK_IS_PIXMAP (drawable), NULL);
return gdk_drawable_get_colormap (((GdkPixmapObject*)drawable)->impl);
}

View File

@@ -2,39 +2,11 @@
#define __GDK_PIXMAP_H__
#include <gdk/gdktypes.h>
#include <gdk/gdkdrawable.h>
#ifdef __cplusplus
extern "C" {
#endif /* __cplusplus */
typedef struct _GdkPixmapObject GdkPixmapObject;
typedef struct _GdkPixmapObjectClass GdkPixmapObjectClass;
#define GDK_TYPE_PIXMAP (gdk_pixmap_get_type ())
#define GDK_PIXMAP(object) (G_TYPE_CHECK_INSTANCE_CAST ((object), GDK_TYPE_PIXMAP, GdkPixmap))
#define GDK_PIXMAP_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), GDK_TYPE_PIXMAP, GdkPixmapObjectClass))
#define GDK_IS_PIXMAP(object) (G_TYPE_CHECK_INSTANCE_TYPE ((object), GDK_TYPE_PIXMAP))
#define GDK_IS_PIXMAP_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), GDK_TYPE_PIXMAP))
#define GDK_PIXMAP_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), GDK_TYPE_PIXMAP, GdkPixmapClass))
struct _GdkPixmapObject
{
GdkDrawable parent_instance;
GdkDrawable *impl; /* window-system-specific delegate object */
gint depth;
};
struct _GdkPixmapObjectClass
{
GdkDrawableClass parent_class;
};
GType gdk_pixmap_get_type (void);
/* Pixmaps
*/
GdkPixmap* gdk_pixmap_new (GdkWindow *window,

View File

@@ -44,24 +44,112 @@ extern "C" {
#define GDK_PARENT_RELATIVE_BG ((GdkPixmap *)1L)
#define GDK_NO_BG ((GdkPixmap *)2L)
#define GDK_WINDOW_TYPE(d) (((GdkWindowObject*)(GDK_WINDOW (d)))->window_type)
#define GDK_WINDOW_DESTROYED(d) (((GdkWindowObject*)(GDK_WINDOW (d)))->destroyed)
#define GDK_DRAWABLE_TYPE(d) (((GdkDrawablePrivate *)d)->window_type)
#define GDK_IS_WINDOW(d) (GDK_DRAWABLE_TYPE(d) <= GDK_WINDOW_TEMP || \
GDK_DRAWABLE_TYPE(d) == GDK_WINDOW_FOREIGN)
#define GDK_IS_PIXMAP(d) (GDK_DRAWABLE_TYPE(d) == GDK_DRAWABLE_PIXMAP)
#define GDK_DRAWABLE_DESTROYED(d) (((GdkDrawablePrivate *)d)->destroyed)
#define gdk_window_lookup(xid) ((GdkWindow*) gdk_xid_table_lookup (xid))
#define gdk_pixmap_lookup(xid) ((GdkPixmap*) gdk_xid_table_lookup (xid))
#define gdk_font_lookup(xid) ((GdkFont*) gdk_xid_table_lookup (xid))
typedef struct _GdkDrawablePrivate GdkDrawablePrivate;
typedef struct _GdkWindowPrivate GdkWindowPrivate;
typedef struct _GdkImageClass GdkImageClass;
typedef struct _GdkImagePrivate GdkImagePrivate;
typedef struct _GdkGCPrivate GdkGCPrivate;
typedef struct _GdkColormapPrivate GdkColormapPrivate;
typedef struct _GdkColorInfo GdkColorInfo;
typedef struct _GdkFontPrivate GdkFontPrivate;
typedef struct _GdkEventFilter GdkEventFilter;
typedef struct _GdkClientFilter GdkClientFilter;
struct _GdkDrawablePrivate
{
GdkDrawable drawable;
GdkDrawableClass *klass;
gpointer klass_data;
guint ref_count;
gint width;
gint height;
GdkColormap *colormap;
guint8 window_type;
guint8 depth;
guint destroyed : 2;
};
struct _GdkWindowPrivate
{
GdkDrawablePrivate drawable;
GdkWindow *parent;
gint x;
gint y;
guint8 resize_count;
guint mapped : 1;
guint guffaw_gravity : 1;
guint input_only : 1;
gint extension_events;
GList *filters;
GList *children;
GdkColor bg_color;
GdkPixmap *bg_pixmap;
GSList *paint_stack;
GdkRegion *update_area;
guint update_freeze_count;
};
struct _GdkImageClass
{
void (*destroy) (GdkImage *image);
void (*image_put) (GdkImage *image,
GdkDrawable *window,
GdkGC *gc,
gint xsrc,
gint ysrc,
gint xdest,
gint ydest,
gint width,
gint height);
};
struct _GdkImagePrivate
{
GdkImage image;
guint ref_count;
GdkImageClass *klass;
};
struct _GdkFontPrivate
{
GdkFont font;
guint ref_count;
};
struct _GdkGCPrivate
{
guint ref_count;
GdkGCClass *klass;
gpointer klass_data;
gint clip_x_origin;
gint clip_y_origin;
gint ts_x_origin;
gint ts_y_origin;
};
typedef enum {
GDK_COLOR_WRITEABLE = 1 << 0
} GdkColorInfoFlags;
@@ -72,6 +160,14 @@ struct _GdkColorInfo
guint ref_count;
};
struct _GdkColormapPrivate
{
GdkColormap colormap;
GdkVisual *visual;
guint ref_count;
};
struct _GdkEventFilter {
GdkFilterFunc function;
gpointer data;

View File

@@ -14,42 +14,38 @@ typedef enum
GDK_PROP_MODE_APPEND
} GdkPropMode;
GdkAtom gdk_atom_intern (const gchar *atom_name,
gboolean only_if_exists);
gchar* gdk_atom_name (GdkAtom atom);
GdkAtom gdk_atom_intern (const gchar *atom_name,
gboolean only_if_exists);
gchar* gdk_atom_name (GdkAtom atom);
gboolean gdk_property_get (GdkWindow *window,
GdkAtom property,
GdkAtom type,
gulong offset,
gulong length,
gint pdelete,
GdkAtom *actual_property_type,
gint *actual_format,
gint *actual_length,
guchar **data);
gboolean gdk_property_get (GdkWindow *window,
GdkAtom property,
GdkAtom type,
gulong offset,
gulong length,
gint pdelete,
GdkAtom *actual_property_type,
gint *actual_format,
gint *actual_length,
guchar **data);
void gdk_property_change (GdkWindow *window,
GdkAtom property,
GdkAtom type,
gint format,
GdkPropMode mode,
const guchar *data,
gint nelements);
void gdk_property_delete (GdkWindow *window,
GdkAtom property);
void gdk_property_change (GdkWindow *window,
GdkAtom property,
GdkAtom type,
gint format,
GdkPropMode mode,
guchar *data,
gint nelements);
void gdk_property_delete (GdkWindow *window,
GdkAtom property);
gint gdk_text_property_to_text_list (GdkAtom encoding,
gint format,
const guchar *text,
gint length,
gchar ***list);
void gdk_free_text_list (gchar **list);
gint gdk_string_to_compound_text (const gchar *str,
GdkAtom *encoding,
gint *format,
guchar **ctext,
gint *length);
void gdk_free_compound_text (guchar *ctext);
gint gdk_text_property_to_text_list (GdkAtom encoding, gint format,
guchar *text, gint length,
gchar ***list);
void gdk_free_text_list (gchar **list);
gint gdk_string_to_compound_text (gchar *str,
GdkAtom *encoding, gint *format,
guchar **ctext, gint *length);
void gdk_free_compound_text (guchar *ctext);
#ifdef __cplusplus
}

View File

@@ -45,7 +45,7 @@ gdk_rectangle_union (GdkRectangle *src1,
dest->y = dest_y;
}
gboolean
gint
gdk_rectangle_intersect (GdkRectangle *src1,
GdkRectangle *src2,
GdkRectangle *dest)

View File

@@ -42,7 +42,7 @@ typedef enum
gboolean gdk_selection_owner_set (GdkWindow *owner,
GdkAtom selection,
guint32 time,
gboolean send_event);
gint send_event);
GdkWindow* gdk_selection_owner_get (GdkAtom selection);
void gdk_selection_convert (GdkWindow *requestor,
GdkAtom selection,

View File

@@ -30,7 +30,6 @@
/* GDK uses "glib". (And so does GTK).
*/
#include <glib.h>
#include <glib-object.h>
#ifdef G_OS_WIN32
# ifdef GDK_COMPILATION
@@ -164,6 +163,7 @@ struct _GdkSegment
gint y2;
};
#ifdef __cplusplus
}
#endif /* __cplusplus */

File diff suppressed because it is too large Load Diff

View File

@@ -28,35 +28,6 @@ typedef enum
GDK_INPUT_ONLY
} GdkWindowClass;
/* Types of windows.
* Root: There is only 1 root window and it is initialized
* at startup. Creating a window of type GDK_WINDOW_ROOT
* is an error.
* Toplevel: Windows which interact with the window manager.
* Child: Windows which are children of some other type of window.
* (Any other type of window). Most windows are child windows.
* Dialog: A special kind of toplevel window which interacts with
* the window manager slightly differently than a regular
* toplevel window. Dialog windows should be used for any
* transient window.
* Pixmap: Pixmaps are really just another kind of window which
* doesn't actually appear on the screen. It can't have
* children, either and is really just a convenience so
* that the drawing functions can work on both windows
* and pixmaps transparently. (ie. You shouldn't pass a
* pixmap to any procedure which accepts a window with the
* exception of the drawing functions).
* Foreign: A window that actually belongs to another application
*/
typedef enum
{
GDK_WINDOW_ROOT,
GDK_WINDOW_TOPLEVEL,
GDK_WINDOW_CHILD,
GDK_WINDOW_DIALOG,
GDK_WINDOW_TEMP,
GDK_WINDOW_FOREIGN
} GdkWindowType;
/* Window attribute mask values.
* GDK_WA_TITLE: The "title" field is valid.
@@ -126,7 +97,7 @@ struct _GdkWindowAttr
GdkWindowClass wclass;
GdkVisual *visual;
GdkColormap *colormap;
GdkWindowType window_type;
GdkDrawableType window_type;
GdkCursor *cursor;
gchar *wmclass_name;
gchar *wmclass_class;
@@ -147,70 +118,14 @@ struct _GdkGeometry {
/* GdkGravity gravity; */
};
typedef struct _GdkWindowObject GdkWindowObject;
typedef struct _GdkWindowObjectClass GdkWindowObjectClass;
#define GDK_TYPE_WINDOW (gdk_window_get_type ())
#define GDK_WINDOW(object) (G_TYPE_CHECK_INSTANCE_CAST ((object), GDK_TYPE_WINDOW, GdkWindow))
#define GDK_WINDOW_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), GDK_TYPE_WINDOW, GdkWindowObjectClass))
#define GDK_IS_WINDOW(object) (G_TYPE_CHECK_INSTANCE_TYPE ((object), GDK_TYPE_WINDOW))
#define GDK_IS_WINDOW_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), GDK_TYPE_WINDOW))
#define GDK_WINDOW_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), GDK_TYPE_WINDOW, GdkWindowObjectClass))
struct _GdkWindowObject
{
GdkDrawable parent_instance;
gpointer user_data;
GdkDrawable *impl; /* window-system-specific delegate object */
GdkWindowObject *parent;
gint x;
gint y;
gint extension_events;
GList *filters;
GList *children;
GdkColor bg_color;
GdkPixmap *bg_pixmap;
GSList *paint_stack;
GdkRegion *update_area;
guint update_freeze_count;
guint8 window_type;
guint8 depth;
guint8 resize_count;
guint mapped : 1;
guint guffaw_gravity : 1;
guint input_only : 1;
guint destroyed : 2;
};
struct _GdkWindowObjectClass
{
GdkDrawableClass parent_class;
};
/* Windows
*/
GType gdk_window_get_type (void);
GdkWindow* gdk_window_new (GdkWindow *parent,
GdkWindowAttr *attributes,
gint attributes_mask);
void gdk_window_destroy (GdkWindow *window);
GdkWindowType gdk_window_get_window_type (GdkWindow *window);
GdkWindow* gdk_window_at_pointer (gint *win_x,
gint *win_y);
void gdk_window_show (GdkWindow *window);
@@ -286,7 +201,7 @@ void gdk_window_set_child_shapes (GdkWindow *window);
void gdk_window_merge_child_shapes (GdkWindow *window);
/*
* Check if a window has been shown, and whether all its
* Check if a window has been shown, and whether all it's
* parents up to a toplevel have been shown, respectively.
* Note that a window that is_viewable below is not necessarily
* viewable in the X sense.
@@ -371,7 +286,7 @@ void gdk_window_set_icon (GdkWindow *window,
GdkPixmap *pixmap,
GdkBitmap *mask);
void gdk_window_set_icon_name (GdkWindow *window,
const gchar *name);
gchar *name);
void gdk_window_set_group (GdkWindow *window,
GdkWindow *leader);
void gdk_window_set_decorations (GdkWindow *window,

View File

@@ -6,7 +6,7 @@
## There is no install target, you have to decide where and
## how to install for yourself.
OPTIMIZE = -g
OPTIMIZE = -g -O
################################################################
@@ -15,6 +15,7 @@ OPTIMIZE = -g
CC = gcc -mno-cygwin -mpentium -fnative-struct
CP = cp
LD = ld
GLIB_VER=1.3
GTK_VER=1.3

View File

@@ -15,12 +15,10 @@ WTKIT = ..\..\wtkit126
!IFNDEF DEBUG
# Full optimization:
OPTIMIZE = -Ox -MD -Zi
LINKDEBUG = /nodefaultlib:libc.lib
OPTIMIZE = -Ox -MD
!ELSE
# Debugging:
OPTIMIZE = -Zi -MDd
LINKDEBUG = /nodefaultlib:libcd.lib /nodefaultlib:libc.lib /debug
!ENDIF
# cl -? describes the options

View File

@@ -1,51 +0,0 @@
## Process this file with automake to produce Makefile.in
INCLUDES = @STRIP_BEGIN@ \
-DG_LOG_DOMAIN=\"Gdk\" \
-I$(top_srcdir) \
-I$(top_srcdir)/gdk \
@GTK_DEBUG_FLAGS@ \
@GTK_XIM_FLAGS@ \
@GTK_LOCALE_FLAGS@ \
@GLIB_CFLAGS@ \
@x_cflags@ \
@STRIP_END@
LDADDS = @STRIP_BEGIN@ \
@x_ldflags@ \
@x_libs@ \
@GLIB_LIBS@ \
-lm \
@STRIP_END@
noinst_LTLIBRARIES = libgdk-nanox.la
xinput_sources = \
gdkinput-none.c
libgdk_nanox_la_SOURCES = \
gdkcc-nanox.c \
gdkcolor-nanox.c \
gdkcursor-nanox.c \
gdkdnd-nanox.c \
gdkdrawable-nanox.c \
gdkevents-nanox.c \
gdkfont-nanox.c \
gdkgc-nanox.c \
gdkglobals-nanox.c \
gdkim-nanox.c \
gdkimage-nanox.c \
gdkinput.c \
gdkmain-nanox.c \
gdkpixmap-nanox.c \
gdkpolyreg-generic.c \
gdkproperty-nanox.c \
gdkregion-generic.c \
gdkselection-nanox.c \
gdkvisual-nanox.c \
gdkwindow-nanox.c \
gdknanox.h \
gdkprivate-nanox.h \
gdkinput-none.c

View File

@@ -1,119 +0,0 @@
#include "gdk.h"
#include "gdkprivate-nanox.h"
GdkColorContext *
gdk_color_context_new (GdkVisual *visual,
GdkColormap *colormap)
{
g_message("unimplemented %s", __FUNCTION__);
return NULL;
}
GdkColorContext *
gdk_color_context_new_mono (GdkVisual *visual,
GdkColormap *colormap)
{
g_message("unimplemented %s", __FUNCTION__);
return NULL;
}
void
gdk_color_context_free (GdkColorContext *cc)
{
g_message("unimplemented %s", __FUNCTION__);
}
gulong
gdk_color_context_get_pixel (GdkColorContext *cc,
gushort red,
gushort green,
gushort blue,
gint *failed)
{
return RGB2PIXEL(red, green, blue);
}
void
gdk_color_context_get_pixels (GdkColorContext *cc,
gushort *reds,
gushort *greens,
gushort *blues,
gint ncolors,
gulong *colors,
gint *nallocated)
{
g_message("unimplemented %s", __FUNCTION__);
}
void
gdk_color_context_get_pixels_incremental (GdkColorContext *cc,
gushort *reds,
gushort *greens,
gushort *blues,
gint ncolors,
gint *used,
gulong *colors,
gint *nallocated)
{
g_message("unimplemented %s", __FUNCTION__);
}
gint
gdk_color_context_query_color (GdkColorContext *cc,
GdkColor *color)
{
return gdk_color_context_query_colors (cc, color, 1);
}
gint
gdk_color_context_query_colors (GdkColorContext *cc,
GdkColor *colors,
gint num_colors)
{
g_message("unimplemented %s", __FUNCTION__);
return 0;
}
gint
gdk_color_context_add_palette (GdkColorContext *cc,
GdkColor *palette,
gint num_palette)
{
g_message("unimplemented %s", __FUNCTION__);
return 0;
}
void
gdk_color_context_init_dither (GdkColorContext *cc)
{
g_message("unimplemented %s", __FUNCTION__);
}
void
gdk_color_context_free_dither (GdkColorContext *cc)
{
g_message("unimplemented %s", __FUNCTION__);
}
gulong
gdk_color_context_get_pixel_from_palette (GdkColorContext *cc,
gushort *red,
gushort *green,
gushort *blue,
gint *failed)
{
g_message("unimplemented %s", __FUNCTION__);
return 0;
}
guchar
gdk_color_context_get_index_from_palette (GdkColorContext *cc,
gint *red,
gint *green,
gint *blue,
gint *failed)
{
g_message("unimplemented %s", __FUNCTION__);
return 0;
}

View File

@@ -1,238 +0,0 @@
#include "gdk.h"
#include "gdkprivate-nanox.h"
#include <stdlib.h>
#include <string.h>
GdkColormap*
gdk_colormap_new (GdkVisual *visual,
gboolean private_cmap)
{
GdkColormap *colormap;
GdkColormapPrivateX *private;
int size;
int i;
g_return_val_if_fail (visual != NULL, NULL);
private = g_new (GdkColormapPrivateX, 1);
colormap = (GdkColormap*) private;
private->base.visual = visual;
private->base.ref_count = 1;
colormap->size = visual->colormap_size;
colormap->colors = NULL;
return colormap;
}
void
_gdk_colormap_real_destroy (GdkColormap *colormap)
{
}
void
gdk_colormap_sync (GdkColormap *colormap,
gboolean force)
{
g_message("unimplemented %s", __FUNCTION__);
}
GdkColormap*
gdk_colormap_get_system (void)
{
return gdk_colormap_new(gdk_visual_get_system(), 0);
}
gint
gdk_colormap_get_system_size (void)
{
GR_PALETTE palette;
GrGetSystemPalette(&palette);
return palette.count;
}
void
gdk_colormap_change (GdkColormap *colormap,
gint ncolors)
{
g_message("unimplemented %s", __FUNCTION__);
}
gboolean
gdk_colors_alloc (GdkColormap *colormap,
gboolean contiguous,
gulong *planes,
gint nplanes,
gulong *pixels,
gint npixels)
{
g_message("unimplemented %s", __FUNCTION__);
return 1;
}
static struct cspec {
char *name;
int red, green, blue;
} cnames [] = {
{"white", 0xffff, 0xffff, 0xffff},
{"black", 0, 0, 0},
{"red", 0xffff, 0, 0},
{"green", 0, 0xffff, 0},
{"blue", 0, 0, 0xffff},
{NULL}
};
gboolean
gdk_color_parse (const gchar *spec,
GdkColor *color)
{
int size, csize, i, j, shift;
double dval;
gchar *end;
int scale[] = {0, 4096, 256, 16, 1};
int add[] = {0, 4095, 255, 15, 1};
g_return_val_if_fail(spec != NULL, 0);
g_return_val_if_fail(color != NULL, 0);
g_message("color parsing %s", spec);
if (*spec == '#') {
spec++;
size = strlen(spec);
csize = size/3;
shift = 16-csize*4;
if (size > 12 || size % 3)
return 0;
j = spec[csize];
spec[csize] = 0;
color->red = strtol(spec, &end, 16) << shift;
if (end == spec || *end != '\0')
return 0;
spec[csize] = j;
spec += csize;
/* green */
j = spec[csize];
spec[csize] = 0;
color->green = strtol(spec, &end, 16) << shift;
if (end == spec || *end != '\0')
return 0;
spec[csize] = j;
spec += csize;
/* blue */
color->blue = strtol(spec, &end, 16) << shift;
if (end == spec || *end != '\0')
return 0;
return 1;
} else if (!strncmp(spec, "rgb:", 4)) {
spec += 4;
color->red = strtol(spec, &end, 16);
if (end == spec || *end != '/')
return 0;
csize = end-spec;
color->red *= scale[csize];
color->red += add[csize];
spec += csize + 1;
/* green */
color->green = strtol(spec, &end, 16);
if (end == spec || *end != '/')
return 0;
csize = end-spec;
color->green *= scale[csize];
color->green += add[csize];
spec += csize + 1;
/* blue */
color->blue = strtol(spec, &end, 16);
if (end == spec || *end != '\0')
return 0;
csize = end-spec;
color->blue *= scale[csize];
color->blue += add[csize];
return 1;
} else if (!strncmp(spec, "rgbi:", 5)) {
spec += 5;
dval = strtod(spec, &end);
if (end == spec || *end != '/' || dval > 1.0 || dval < 0)
return 0;
color->red = dval*0xffff;
spec += end-spec + 1;
/* green */
dval = strtod(spec, &end);
if (end == spec || *end != '/' || dval > 1.0 || dval < 0)
return 0;
color->green = dval*0xffff;
spec += end-spec + 1;
/* blue */
dval = strtod(spec, &end);
if (end == spec || *end != '0' || dval > 1.0 || dval < 0)
return 0;
color->blue = dval*0xffff;
return 1;
} else {
/* use a cdb database, instead, later */
for (i=0; cnames[i].name; ++i) {
if (strcmp(cnames[i].name, spec))
continue;
color->red = cnames[i].red;
color->green = cnames[i].green;
color->blue = cnames[i].blue;
return 1;
}
if (spec[0] == 'g' && spec[1] == 'r' && (spec[2] == 'a' || spec[2] == 'e') && spec[3] == 'y') {
dval = strtol(spec+4, NULL, 10)/100;
color->red = color->green = color->blue = 255 * dval;
return 1;
}
}
return 0;
}
void
gdk_colors_free (GdkColormap *colormap,
gulong *in_pixels,
gint in_npixels,
gulong planes)
{
g_message("unimplemented %s", __FUNCTION__);
}
void
gdk_colormap_free_colors (GdkColormap *colormap,
GdkColor *colors,
gint ncolors)
{
g_message("unimplemented %s", __FUNCTION__);
}
gint
gdk_colormap_alloc_colors (GdkColormap *colormap,
GdkColor *colors,
gint ncolors,
gboolean writeable,
gboolean best_match,
gboolean *success)
{
int i;
for (i=0; i < ncolors;++i)
colors[i].pixel = RGB2PIXEL(colors[i].red>>8, colors[i].green>>8, colors[i].blue>>8);
success = 1;
return 1;
}
gboolean
gdk_color_change (GdkColormap *colormap,
GdkColor *color)
{
g_message("unimplemented %s", __FUNCTION__);
return 1;
}

View File

@@ -1,26 +0,0 @@
#include "gdk.h"
#include "gdkprivate-nanox.h"
GdkCursor*
gdk_cursor_new (GdkCursorType cursor_type) {
g_message("unimplemented %s", __FUNCTION__);
return NULL;
}
GdkCursor*
gdk_cursor_new_from_pixmap (GdkPixmap *source,
GdkPixmap *mask,
GdkColor *fg,
GdkColor *bg,
gint x,
gint y)
{
g_message("unimplemented %s", __FUNCTION__);
return NULL;
}
void
_gdk_cursor_destroy (GdkCursor *cursor)
{
}

View File

@@ -1,121 +0,0 @@
#include "gdk.h"
#include "gdkprivate-nanox.h"
GdkDragContext *
gdk_drag_context_new (void)
{
g_message("unimplemented %s", __FUNCTION__);
return NULL;
}
void
gdk_drag_context_ref (GdkDragContext *context)
{
}
void
gdk_drag_context_unref (GdkDragContext *context)
{
}
void
gdk_dnd_init (void)
{
}
GdkDragContext *
gdk_drag_begin (GdkWindow *window,
GList *targets)
{
g_message("unimplemented %s", __FUNCTION__);
return NULL;
}
guint32
gdk_drag_get_protocol (guint32 xid,
GdkDragProtocol *protocol)
{
*protocol = GDK_DRAG_PROTO_NONE;
return 0;
}
void
gdk_drag_find_window (GdkDragContext *context,
GdkWindow *drag_window,
gint x_root,
gint y_root,
GdkWindow **dest_window,
GdkDragProtocol *protocol)
{
g_message("unimplemented %s", __FUNCTION__);
}
gboolean
gdk_drag_motion (GdkDragContext *context,
GdkWindow *dest_window,
GdkDragProtocol protocol,
gint x_root,
gint y_root,
GdkDragAction suggested_action,
GdkDragAction possible_actions,
guint32 time)
{
g_message("unimplemented %s", __FUNCTION__);
}
void
gdk_drag_drop (GdkDragContext *context,
guint32 time)
{
g_message("unimplemented %s", __FUNCTION__);
}
void
gdk_drag_abort (GdkDragContext *context,
guint32 time)
{
g_message("unimplemented %s", __FUNCTION__);
}
void
gdk_drag_status (GdkDragContext *context,
GdkDragAction action,
guint32 time)
{
g_message("unimplemented %s", __FUNCTION__);
}
void
gdk_drop_reply (GdkDragContext *context,
gboolean ok,
guint32 time)
{
g_message("unimplemented %s", __FUNCTION__);
}
void
gdk_drop_finish (GdkDragContext *context,
gboolean success,
guint32 time)
{
g_message("unimplemented %s", __FUNCTION__);
}
void
gdk_window_register_dnd (GdkWindow *window)
{
g_message("unimplemented %s", __FUNCTION__);
}
GdkAtom
gdk_drag_get_selection (GdkDragContext *context)
{
return GDK_NONE;
}

View File

@@ -1,271 +0,0 @@
#include "gdk.h"
#include "gdkprivate-nanox.h"
static void gdk_nanox_drawable_destroy (GdkDrawable *drawable);
static void gdk_nanox_draw_rectangle (GdkDrawable *drawable,
GdkGC *gc,
gint filled,
gint x,
gint y,
gint width,
gint height);
static void gdk_nanox_draw_arc (GdkDrawable *drawable,
GdkGC *gc,
gint filled,
gint x,
gint y,
gint width,
gint height,
gint angle1,
gint angle2);
static void gdk_nanox_draw_polygon (GdkDrawable *drawable,
GdkGC *gc,
gint filled,
GdkPoint *points,
gint npoints);
static void gdk_nanox_draw_text (GdkDrawable *drawable,
GdkFont *font,
GdkGC *gc,
gint x,
gint y,
const gchar *text,
gint text_length);
static void gdk_nanox_draw_text_wc (GdkDrawable *drawable,
GdkFont *font,
GdkGC *gc,
gint x,
gint y,
const GdkWChar *text,
gint text_length);
static void gdk_nanox_draw_drawable (GdkDrawable *drawable,
GdkGC *gc,
GdkPixmap *src,
gint xsrc,
gint ysrc,
gint xdest,
gint ydest,
gint width,
gint height);
static void gdk_nanox_draw_points (GdkDrawable *drawable,
GdkGC *gc,
GdkPoint *points,
gint npoints);
static void gdk_nanox_draw_segments (GdkDrawable *drawable,
GdkGC *gc,
GdkSegment *segs,
gint nsegs);
static void gdk_nanox_draw_lines (GdkDrawable *drawable,
GdkGC *gc,
GdkPoint *points,
gint npoints);
GdkDrawableClass _gdk_nanox_drawable_class = {
gdk_nanox_drawable_destroy,
_gdk_nanox_gc_new,
gdk_nanox_draw_rectangle,
gdk_nanox_draw_arc,
gdk_nanox_draw_polygon,
gdk_nanox_draw_text,
gdk_nanox_draw_text_wc,
gdk_nanox_draw_drawable,
gdk_nanox_draw_points,
gdk_nanox_draw_segments,
gdk_nanox_draw_lines
};
GdkColormap*
gdk_drawable_get_colormap (GdkDrawable *drawable)
{
GdkDrawablePrivate *drawable_private;
g_return_val_if_fail (drawable != NULL, NULL);
drawable_private = (GdkDrawablePrivate*) drawable;
if (!GDK_DRAWABLE_DESTROYED (drawable))
{
if (drawable_private->colormap == NULL &&
GDK_IS_WINDOW (drawable))
{
/*XGetWindowAttributes (GDK_DRAWABLE_XDISPLAY (drawable),
GDK_DRAWABLE_XID (drawable),
&window_attributes);
drawable_private->colormap = gdk_colormap_lookup (window_attributes.colormap);*/
}
return drawable_private->colormap;
}
return NULL;
}
void
gdk_drawable_set_colormap (GdkDrawable *drawable,
GdkColormap *colormap)
{
GdkDrawablePrivate *drawable_private;
GdkColormapPrivateX *colormap_private;
g_return_if_fail (drawable != NULL);
g_return_if_fail (colormap != NULL);
drawable_private = (GdkDrawablePrivate *)drawable;
colormap_private = (GdkColormapPrivateX *)colormap;
if (!GDK_DRAWABLE_DESTROYED (drawable))
{
if (GDK_IS_WINDOW (drawable))
{
g_return_if_fail (colormap_private->base.visual !=
((GdkColormapPrivate *)(drawable_private->colormap))->visual);
}
if (drawable_private->colormap)
gdk_colormap_unref (drawable_private->colormap);
drawable_private->colormap = colormap;
gdk_colormap_ref (drawable_private->colormap);
if (GDK_IS_WINDOW (drawable) &&
drawable_private->window_type != GDK_WINDOW_TOPLEVEL)
/*gdk_window_add_colormap_windows (drawable);*/;
}
}
static void
gdk_nanox_drawable_destroy (GdkDrawable *drawable)
{
}
static void
gdk_nanox_draw_rectangle (GdkDrawable *drawable,
GdkGC *gc,
gint filled,
gint x,
gint y,
gint width,
gint height)
{
if (filled)
GrFillRect (GDK_DRAWABLE_XID (drawable), GDK_GC_XGC (gc), x, y, width, height);
else
GrRect (GDK_DRAWABLE_XID (drawable), GDK_GC_XGC (gc), x, y, width, height);
}
static void
gdk_nanox_draw_arc (GdkDrawable *drawable,
GdkGC *gc,
gint filled,
gint x,
gint y,
gint width,
gint height,
gint angle1,
gint angle2)
{
/* this is not an arc, obviously */
if (filled)
GrFillEllipse (GDK_DRAWABLE_XID (drawable), GDK_GC_XGC (gc), x, y, width/2, height/2);
else
GrEllipse (GDK_DRAWABLE_XID (drawable), GDK_GC_XGC (gc), x, y, width/2, height/2);
}
static void
gdk_nanox_draw_polygon (GdkDrawable *drawable,
GdkGC *gc,
gint filled,
GdkPoint *points,
gint npoints)
{
GR_POINT *new_points = g_new(GR_POINT, npoints);
int i;
for (i=0; i < npoints;++i) {
new_points[i].x = points[i].x;
new_points[i].y = points[i].y;
}
if (filled)
{
GrFillPoly (GDK_DRAWABLE_XID (drawable), GDK_GC_XGC (gc), npoints, new_points);
}
else
{
GrPoly (GDK_DRAWABLE_XID (drawable), GDK_GC_XGC (gc), npoints, new_points);
}
g_free(new_points);
}
static void
gdk_nanox_draw_text (GdkDrawable *drawable,
GdkFont *font,
GdkGC *gc,
gint x,
gint y,
const gchar *text,
gint text_length)
{
GrSetGCFont(GDK_GC_XGC(gc), GDK_FONT_XFONT(font));
GrText (GDK_DRAWABLE_XID (drawable), GDK_GC_XGC (gc), x, y, text, text_length, TF_UTF8|TF_BASELINE);
}
static void
gdk_nanox_draw_text_wc (GdkDrawable *drawable,
GdkFont *font,
GdkGC *gc,
gint x,
gint y,
const GdkWChar *text,
gint text_length)
{
GrSetGCFont(GDK_GC_XGC(gc), GDK_FONT_XFONT(font));
GrText (GDK_DRAWABLE_XID (drawable), GDK_GC_XGC (gc), x, y, text, text_length, TF_UC32|TF_BASELINE);
}
static void
gdk_nanox_draw_drawable (GdkDrawable *drawable,
GdkGC *gc,
GdkPixmap *src,
gint xsrc,
gint ysrc,
gint xdest,
gint ydest,
gint width,
gint height)
{
GrCopyArea(GDK_DRAWABLE_XID(drawable), GDK_GC_XGC(gc), xdest, ydest,
width, height, GDK_DRAWABLE_XID(src), xsrc, ysrc, 0);
}
static void
gdk_nanox_draw_points (GdkDrawable *drawable,
GdkGC *gc,
GdkPoint *points,
gint npoints)
{
int i;
for (i=0; i < npoints; ++i)
GrPoint(GDK_DRAWABLE_XID(drawable), GDK_GC_XGC(gc), points[i].x, points[i].y);
}
static void
gdk_nanox_draw_segments (GdkDrawable *drawable,
GdkGC *gc,
GdkSegment *segs,
gint nsegs)
{
int i;
for (i=0; i < nsegs; ++i)
GrLine(GDK_DRAWABLE_XID(drawable), GDK_GC_XGC(gc), segs[i].x1, segs[i].y1, segs[i].x2, segs[i].y2);
}
static void
gdk_nanox_draw_lines (GdkDrawable *drawable,
GdkGC *gc,
GdkPoint *points,
gint npoints)
{
int i;
for (i=0; i < npoints-1; ++i)
GrLine(GDK_DRAWABLE_XID(drawable), GDK_GC_XGC(gc), points[i].x, points[i].y, points[i+1].x, points[i+1].y);
}

View File

@@ -1,441 +0,0 @@
#include "gdk.h"
#include "gdkinternals.h"
#include "gdkprivate-nanox.h"
typedef struct _GdkEventPrivate GdkEventPrivate;
#define DOUBLE_CLICK_TIME 250
#define TRIPLE_CLICK_TIME 500
#define DOUBLE_CLICK_DIST 5
#define TRIPLE_CLICK_DIST 5
#define GR_BUTTON_TO_GDK(b) b&LBUTTON? 1: (b&MBUTTON? 2: (b&RBUTTON? 3: 0))
static guint gr_mod_to_gdk(guint mods, guint buttons) {
guint res=0;
if (mods & GR_MODIFIER_SHIFT)
res |= GDK_SHIFT_MASK;
if (mods & GR_MODIFIER_CTRL)
res |= GDK_CONTROL_MASK;
if (mods & GR_MODIFIER_META)
res |= GDK_MOD1_MASK;
if (buttons & LBUTTON)
res |= GDK_BUTTON1_MASK;
if (buttons & MBUTTON)
res |= GDK_BUTTON2_MASK;
if (buttons & RBUTTON)
res |= GDK_BUTTON3_MASK;
return res;
}
static gboolean gdk_event_prepare (gpointer source_data,
GTimeVal *current_time,
gint *timeout,
gpointer user_data);
static gboolean gdk_event_check (gpointer source_data,
GTimeVal *current_time,
gpointer user_data);
static gboolean gdk_event_dispatch (gpointer source_data,
GTimeVal *current_time,
gpointer user_data);
typedef enum
{
/* Following flag is set for events on the event queue during
* translation and cleared afterwards.
*/
GDK_EVENT_PENDING = 1 << 0
} GdkEventFlags;
struct _GdkEventPrivate
{
GdkEvent event;
guint flags;
};
static GSourceFuncs event_funcs = {
gdk_event_prepare,
gdk_event_check,
gdk_event_dispatch,
(GDestroyNotify)g_free
};
GPollFD event_poll_fd;
extern int sock;
static guint serial_value = 1;
static int
events_idle () {
gdk_events_queue();
return TRUE;
}
void
gdk_events_init (void)
{
g_source_add (GDK_PRIORITY_EVENTS, TRUE, &event_funcs, NULL, NULL, NULL);
event_poll_fd.fd = sock;
event_poll_fd.events = G_IO_IN;
g_main_add_poll (&event_poll_fd, GDK_PRIORITY_EVENTS);
g_idle_add(events_idle, NULL);
}
static gboolean
gdk_event_prepare (gpointer source_data,
GTimeVal *current_time,
gint *timeout,
gpointer user_data)
{
gboolean retval;
GDK_THREADS_ENTER ();
*timeout = -1;
retval = (gdk_event_queue_find_first () != NULL);
GDK_THREADS_LEAVE ();
return retval;
}
static gboolean
gdk_event_check (gpointer source_data,
GTimeVal *current_time,
gpointer user_data)
{
gboolean retval;
GDK_THREADS_ENTER ();
if (event_poll_fd.revents & G_IO_IN)
//retval = (gdk_event_queue_find_first () != NULL);
retval = 1;
else
retval = FALSE;
GDK_THREADS_LEAVE ();
return retval;
}
static gboolean
gdk_event_dispatch (gpointer source_data,
GTimeVal *current_time,
gpointer user_data)
{
GdkEvent *event;
GDK_THREADS_ENTER ();
gdk_events_queue();
event = gdk_event_unqueue();
if (event)
{
if (gdk_event_func)
(*gdk_event_func) (event, gdk_event_data);
gdk_event_free (event);
}
GDK_THREADS_LEAVE ();
return TRUE;
}
gboolean
gdk_events_pending (void)
{
return gdk_event_queue_find_first();
}
GdkEvent*
gdk_event_get_graphics_expose (GdkWindow *window)
{
return NULL;
}
static gint gdk_event_translate (GdkEvent *event, GR_EVENT *xevent) {
GdkWindow *window=NULL;
GdkWindowPrivate *window_private=NULL;
gint return_val = FALSE;
static int lastx=0, lasty=0, lastrootx=0, lastrooty=0;
if (xevent->type == GR_EVENT_TYPE_FDINPUT)
return 0;
window = gdk_window_lookup (xevent->general.wid);
/* FIXME: window might be a GdkPixmap!!! */
window_private = (GdkWindowPrivate *) window;
if (window != NULL)
gdk_window_ref (window);
event->any.window = window;
event->any.send_event = FALSE;
if (window_private && GDK_DRAWABLE_DESTROYED (window))
{
return FALSE;
}
else
{
/* Check for filters for this window
*/
GdkFilterReturn result = GDK_FILTER_CONTINUE;
/*result = gdk_event_apply_filters (xevent, event,
window_private
?window_private->filters
:gdk_default_filters);
*/
if (result != GDK_FILTER_CONTINUE)
{
return (result == GDK_FILTER_TRANSLATE) ? TRUE : FALSE;
}
}
return_val = TRUE;
//g_message("got event (%p) %d", window, xevent->type);
switch (xevent->type)
{
case GR_EVENT_TYPE_KEY_DOWN:
event->key.keyval = xevent->keystroke.ch;
event->key.type = GDK_KEY_PRESS;
event->key.window = window;
event->key.time = serial_value++;
event->key.state = gr_mod_to_gdk(xevent->keystroke.modifiers, xevent->keystroke.buttons);
event->key.string = g_strdup_printf ("%c", xevent->keystroke.ch);
event->key.length = 1;
break;
case GR_EVENT_TYPE_KEY_UP:
event->key.keyval = xevent->keystroke.ch;
event->key.type = GDK_KEY_RELEASE;
event->key.window = window;
event->key.time = serial_value++;
event->key.state = gr_mod_to_gdk(xevent->keystroke.modifiers, xevent->keystroke.buttons)|GDK_RELEASE_MASK;
event->key.string = NULL;
event->key.length = 0;
break;
case GR_EVENT_TYPE_BUTTON_DOWN:
event->button.type = GDK_BUTTON_PRESS;
event->button.window = window;
event->button.time = serial_value++;
event->button.x = xevent->button.x;
event->button.y = xevent->button.y;
event->button.x_root = (gfloat)xevent->button.rootx;
event->button.y_root = (gfloat)xevent->button.rooty;
event->button.pressure = 0.5;
event->button.xtilt = 0;
event->button.ytilt = 0;
event->button.state = gr_mod_to_gdk(xevent->button.modifiers, xevent->button.buttons);
event->button.button = GR_BUTTON_TO_GDK(xevent->button.changebuttons);
event->button.source = GDK_SOURCE_MOUSE;
event->button.deviceid = GDK_CORE_POINTER;
g_message("button down: %d", event->button.button);
gdk_event_button_generate (event);
break;
case GR_EVENT_TYPE_BUTTON_UP:
event->button.type = GDK_BUTTON_RELEASE;
event->button.window = window;
event->button.time = serial_value++;
event->button.x = xevent->button.x;
event->button.y = xevent->button.y;
event->button.x_root = (gfloat)xevent->button.rootx;
event->button.y_root = (gfloat)xevent->button.rooty;
event->button.pressure = 0.5;
event->button.xtilt = 0;
event->button.ytilt = 0;
event->button.state = gr_mod_to_gdk(xevent->button.modifiers, xevent->button.buttons)|GDK_RELEASE_MASK;
event->button.button = GR_BUTTON_TO_GDK(xevent->button.changebuttons);
event->button.source = GDK_SOURCE_MOUSE;
event->button.deviceid = GDK_CORE_POINTER;
g_message("button up: %d", event->button.button);
gdk_event_button_generate (event);
break;
case GR_EVENT_TYPE_MOUSE_MOTION:
event->motion.type = GDK_MOTION_NOTIFY;
event->motion.window = window;
event->motion.time = serial_value++;
event->motion.x = xevent->mouse.x;
event->motion.y = xevent->mouse.y;
event->motion.x_root = (gfloat)xevent->mouse.rootx;
event->motion.y_root = (gfloat)xevent->mouse.rooty;
event->motion.pressure = 0.5;
event->motion.xtilt = 0;
event->motion.ytilt = 0;
event->motion.state = gr_mod_to_gdk(xevent->mouse.modifiers, xevent->mouse.buttons);
event->motion.is_hint = 0;
event->motion.source = GDK_SOURCE_MOUSE;
event->motion.deviceid = GDK_CORE_POINTER;
break;
case GR_EVENT_TYPE_MOUSE_POSITION:
return_val = FALSE;
break;
case GR_EVENT_TYPE_MOUSE_ENTER:
event->crossing.type = GDK_ENTER_NOTIFY;
event->crossing.window = window;
event->crossing.subwindow = NULL;
event->crossing.time = serial_value++;
event->crossing.detail = GDK_NOTIFY_UNKNOWN;
//g_message("subwindow 1: %p", event->crossing.subwindow);
/* other stuff here , x, y, x_root, y_root */
break;
case GR_EVENT_TYPE_MOUSE_EXIT:
event->crossing.type = GDK_LEAVE_NOTIFY;
event->crossing.window = window;
event->crossing.subwindow = NULL;
event->crossing.time = serial_value++;
event->crossing.mode = GDK_CROSSING_NORMAL;
event->crossing.detail = GDK_NOTIFY_UNKNOWN;
//g_message("subwindow 2: %p", event->crossing.subwindow);
/* other stuff here , x, y, x_root, y_root */
break;
case GR_EVENT_TYPE_FOCUS_IN:
case GR_EVENT_TYPE_FOCUS_OUT:
event->focus_change.type = GDK_FOCUS_CHANGE;
event->focus_change.window = window;
event->focus_change.in = (xevent->general.type == GR_EVENT_TYPE_FOCUS_IN);
break;
case GR_EVENT_TYPE_UPDATE:
case GR_EVENT_TYPE_CHLD_UPDATE:
if (xevent->update.utype == GR_UPDATE_MAP) {
event->any.type = GDK_MAP;
event->any.window = window;
} else if (xevent->update.utype == GR_UPDATE_UNMAP) {
event->any.type = GDK_UNMAP;
event->any.window = window;
if (gdk_xgrab_window == window_private)
gdk_xgrab_window = NULL;
} else {
if (!window || GDK_DRAWABLE_TYPE (window) == GDK_WINDOW_CHILD)
return_val = FALSE;
else
{
event->configure.type = GDK_CONFIGURE;
event->configure.window = window;
event->configure.width = xevent->update.width;
event->configure.height = xevent->update.height;
event->configure.x = xevent->update.x;
event->configure.y = xevent->update.y;
window_private->x = event->configure.x;
window_private->y = event->configure.y;
window_private->drawable.width = event->configure.width;
window_private->drawable.height = event->configure.height;
if (window_private->resize_count > 1)
window_private->resize_count -= 1;
}
}
break;
case GR_EVENT_TYPE_EXPOSURE:
event->expose.type = GDK_EXPOSE;
event->expose.window = window;
event->expose.area.x = xevent->exposure.x;
event->expose.area.y = xevent->exposure.y;
event->expose.area.width = xevent->exposure.width;
event->expose.area.height = xevent->exposure.height;
event->expose.count = 0;
break;
case GR_EVENT_TYPE_FDINPUT:
case GR_EVENT_TYPE_NONE:
return_val = FALSE;
break;
default:
return_val = FALSE;
g_message("event %d not handled\n", xevent->type);
}
if (return_val)
{
if (event->any.window)
gdk_window_ref (event->any.window);
if (((event->any.type == GDK_ENTER_NOTIFY) ||
(event->any.type == GDK_LEAVE_NOTIFY)) &&
(event->crossing.subwindow != NULL))
gdk_window_ref (event->crossing.subwindow);
}
else
{
/* Mark this event as having no resources to be freed */
event->any.window = NULL;
event->any.type = GDK_NOTHING;
}
if (window)
gdk_window_unref (window);
return return_val;
}
void
gdk_events_queue (void)
{
GList *node;
GdkEvent *event;
GR_EVENT xevent;
while (!gdk_event_queue_find_first())
{
GrCheckNextEvent (&xevent);
if (!xevent.type)
return;
event = gdk_event_new ();
event->any.type = GDK_NOTHING;
event->any.window = NULL;
event->any.send_event = FALSE;
((GdkEventPrivate *)event)->flags |= GDK_EVENT_PENDING;
gdk_event_queue_append (event);
node = gdk_queued_tail;
if (gdk_event_translate (event, &xevent))
{
((GdkEventPrivate *)event)->flags &= ~GDK_EVENT_PENDING;
//g_message("got event: %d", event->type);
}
else
{
gdk_event_queue_remove_link (node);
g_list_free_1 (node);
gdk_event_free (event);
}
}
}
gboolean
gdk_event_send_client_message (GdkEvent *event, guint32 xid)
{
g_message("unimplemented %s", __FUNCTION__);
return 0;
}
void
gdk_event_send_clientmessage_toall (GdkEvent *event)
{
g_message("unimplemented %s", __FUNCTION__);
}
void
gdk_flush (void)
{
GrFlush();
}

View File

@@ -1,146 +0,0 @@
#include "gdk.h"
#include "gdkprivate-nanox.h"
static GR_GC_ID gc_for_width = 0;
#define ENSURE_GC if (!gc_for_width) gc_for_width = GrNewGC();
GdkFont*
gdk_font_load (const gchar *font_name)
{
GdkFont *font;
GdkFontPrivateX *private;
GR_FONTID xfont;
g_return_val_if_fail (font_name != NULL, NULL);
xfont = GrCreateFont("System", 0, 0);
if (xfont == 0)
return NULL;
{
private = g_new (GdkFontPrivateX, 1);
private->xfont = xfont;
private->base.ref_count = 1;
font = (GdkFont*) private;
font->type = GDK_FONT_FONT;
font->ascent = 8;
font->descent = 4;
}
return font;
}
GdkFont*
gdk_fontset_load (const gchar *fontset_name)
{
return gdk_font_load(fontset_name);
}
void
_gdk_font_destroy (GdkFont *font)
{
GrUnloadFont(GDK_FONT_XFONT(font));
}
gint
_gdk_font_strlen (GdkFont *font,
const gchar *str)
{
return strlen(str);
}
gint
gdk_font_id (const GdkFont *font)
{
return GDK_FONT_XFONT(font);
}
gboolean
gdk_font_equal (const GdkFont *fonta,
const GdkFont *fontb)
{
return GDK_FONT_XFONT(fonta) == GDK_FONT_XFONT(fontb);
}
gint
gdk_text_width (GdkFont *font,
const gchar *text,
gint text_length)
{
gint width, height, base;
ENSURE_GC;
GrSetGCFont(gc_for_width, GDK_FONT_XFONT(font));
GrGetGCTextSize(gc_for_width, text, text_length, TF_UTF8, &width, &height, &base);
return width;
}
gint
gdk_text_width_wc (GdkFont *font,
const GdkWChar *text,
gint text_length)
{
gint width, height, base;
ENSURE_GC;
GrSetGCFont(gc_for_width, GDK_FONT_XFONT(font));
GrGetGCTextSize(gc_for_width, text, text_length, TF_UC32, &width, &height, &base);
return width;
}
void
gdk_text_extents (GdkFont *font,
const gchar *text,
gint text_length,
gint *lbearing,
gint *rbearing,
gint *width,
gint *ascent,
gint *descent)
{
gint mwidth, height, base;
ENSURE_GC;
GrSetGCFont(gc_for_width, GDK_FONT_XFONT(font));
GrGetGCTextSize(gc_for_width, text, text_length, TF_UTF8, &mwidth, &height, &base);
if (width)
*width = mwidth;
if (lbearing)
*lbearing = 0;
if (rbearing)
*rbearing = 0;
if (ascent)
*ascent = base;
if (descent)
*descent = height - base;
}
void
gdk_text_extents_wc (GdkFont *font,
const GdkWChar *text,
gint text_length,
gint *lbearing,
gint *rbearing,
gint *width,
gint *ascent,
gint *descent)
{
gint mwidth, height, base;
ENSURE_GC;
GrSetGCFont(gc_for_width, GDK_FONT_XFONT(font));
GrGetGCTextSize(gc_for_width, text, text_length, TF_UC32, &mwidth, &height, &base);
if (width)
*width = mwidth;
if (lbearing)
*lbearing = 0;
if (rbearing)
*rbearing = 0;
if (ascent)
*ascent = base;
if (descent)
*descent = height - base;
}

View File

@@ -1,103 +0,0 @@
#include "gdkprivate-nanox.h"
static void gdk_nanox_gc_destroy (GdkGC *gc);
static void gdk_nanox_gc_get_values (GdkGC *gc,
GdkGCValues *values);
static void gdk_nanox_gc_set_values (GdkGC *gc,
GdkGCValues *values,
GdkGCValuesMask values_mask);
static void gdk_nanox_gc_set_dashes (GdkGC *gc,
gint dash_offset,
gchar dash_list[],
gint n);
static GdkGCClass gdk_nanox_gc_class = {
gdk_nanox_gc_destroy,
gdk_nanox_gc_get_values,
gdk_nanox_gc_set_values,
gdk_nanox_gc_set_dashes
};
GdkGC *
_gdk_nanox_gc_new (GdkDrawable *drawable,
GdkGCValues *values,
GdkGCValuesMask values_mask)
{
GdkGC *gc;
GdkGCPrivate *private;
gc = gdk_gc_alloc ();
private = (GdkGCPrivate *)gc;
private->klass = &gdk_nanox_gc_class;
private->klass_data = g_new (GdkGCXData, 1);
GDK_GC_XDATA(gc)->xgc = GrNewGC();
GrSetGCUseBackground(GDK_GC_XDATA(gc)->xgc, 0);
GrSetGCForeground(GDK_GC_XDATA(gc)->xgc, RGB2PIXEL(0,0,0));
GrSetGCBackground(GDK_GC_XDATA(gc)->xgc, RGB2PIXEL(0,0,0));
g_message("created GC: %d", GDK_GC_XDATA(gc)->xgc);
return gc;
}
static void
gdk_nanox_gc_destroy (GdkGC *gc)
{
GrDestroyGC (GDK_GC_XGC (gc));
g_free (GDK_GC_XDATA (gc));
}
static void
gdk_nanox_gc_get_values (GdkGC *gc,
GdkGCValues *values)
{
g_message("unimplemented %s", __FUNCTION__);
}
static void
gdk_nanox_gc_set_values (GdkGC *gc,
GdkGCValues *values,
GdkGCValuesMask values_mask)
{
if (values_mask & GDK_GC_FOREGROUND)
GrSetGCForeground(GDK_GC_XGC(gc), values->foreground.pixel);
else if (values_mask & GDK_GC_BACKGROUND)
GrSetGCBackground(GDK_GC_XGC(gc), values->background.pixel);
else if (values_mask & GDK_GC_FONT)
GrSetGCFont(GDK_GC_XGC(gc), GDK_FONT_XFONT(values->font));
}
static void
gdk_nanox_gc_set_dashes (GdkGC *gc,
gint dash_offset,
gchar dash_list[],
gint n)
{
g_message("unimplemented %s", __FUNCTION__);
}
void
gdk_gc_set_clip_rectangle (GdkGC *gc,
GdkRectangle *rectangle)
{
//g_message("unimplemented %s", __FUNCTION__);
}
void
gdk_gc_set_clip_region (GdkGC *gc,
GdkRegion *region)
{
g_message("unimplemented %s", __FUNCTION__);
}
void
gdk_gc_copy (GdkGC *dst_gc, GdkGC *src_gc)
{
GDK_GC_XDATA(dst_gc)->xgc = GrCopyGC(GDK_GC_XGC(src_gc));
}

View File

@@ -1,118 +0,0 @@
#include "gdk.h"
#include "gdkprivate-nanox.h"
static void
gdk_nanox_image_destroy (GdkImage *image);
static void
gdk_image_put_normal (GdkImage *image,
GdkDrawable *drawable,
GdkGC *gc,
gint xsrc,
gint ysrc,
gint xdest,
gint ydest,
gint width,
gint height);
static GdkImageClass image_class_normal = {
gdk_nanox_image_destroy,
gdk_image_put_normal
};
void
gdk_image_exit (void)
{
}
GdkImage *
gdk_image_new_bitmap(GdkVisual *visual, gpointer data, gint w, gint h)
{
g_message("unimplemented %s", __FUNCTION__);
return NULL;
}
void
gdk_image_init (void)
{
}
GdkImage*
gdk_image_new (GdkImageType type,
GdkVisual *visual,
gint width,
gint height)
{
GdkImage *image;
GdkImagePrivateX *private;
private = g_new (GdkImagePrivateX, 1);
image = (GdkImage*) private;
private->base.ref_count = 1;
image->type = type;
image->visual = visual;
image->width = width;
image->height = height;
image->depth = visual->depth;
private->base.klass = &image_class_normal;
//private->ximage = NULL;
/* more: implement as a pixmap? */
return image;
}
GdkImage*
gdk_image_get (GdkWindow *window,
gint x,
gint y,
gint width,
gint height)
{
g_message("unimplemented %s", __FUNCTION__);
return NULL;
}
guint32
gdk_image_get_pixel (GdkImage *image,
gint x,
gint y)
{
g_message("unimplemented %s", __FUNCTION__);
return 0;
}
void
gdk_image_put_pixel (GdkImage *image,
gint x,
gint y,
guint32 pixel)
{
g_message("unimplemented %s", __FUNCTION__);
}
static void
gdk_nanox_image_destroy (GdkImage *image)
{
g_message("unimplemented %s", __FUNCTION__);
}
static void
gdk_image_put_normal (GdkImage *image,
GdkDrawable *drawable,
GdkGC *gc,
gint xsrc,
gint ysrc,
gint xdest,
gint ydest,
gint width,
gint height)
{
g_message("unimplemented %s", __FUNCTION__);
}

View File

@@ -1,79 +0,0 @@
/* GDK - The GIMP Drawing Kit
* 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.
*/
#include "gdkinputprivate.h"
/*
* Modified by the GTK+ Team and others 1997-1999. See the AUTHORS
* file for a list of people on the GTK+ Team. See the ChangeLog
* files for a list of changes. These files are distributed with
* GTK+ at ftp://ftp.gtk.org/pub/gtk/.
*/
static void gdk_input_none_get_pointer (GdkWindow *window,
guint32 deviceid,
gdouble *x,
gdouble *y,
gdouble *pressure,
gdouble *xtilt,
gdouble *ytilt,
GdkModifierType *mask);
void
gdk_input_init (void)
{
gdk_input_vtable.set_mode = NULL;
gdk_input_vtable.set_axes = NULL;
gdk_input_vtable.set_key = NULL;
gdk_input_vtable.motion_events = NULL;
gdk_input_vtable.get_pointer = gdk_input_none_get_pointer;
gdk_input_vtable.grab_pointer = NULL;
gdk_input_vtable.ungrab_pointer = NULL;
gdk_input_vtable.configure_event = NULL;
gdk_input_vtable.enter_event = NULL;
gdk_input_vtable.other_event = NULL;
gdk_input_vtable.window_none_event = NULL;
gdk_input_vtable.enable_window = NULL;
gdk_input_vtable.disable_window = NULL;
gdk_input_devices = g_list_append (NULL, (GdkDeviceInfo *) &gdk_input_core_info);
gdk_input_ignore_core = FALSE;
}
static void
gdk_input_none_get_pointer (GdkWindow *window,
guint32 deviceid,
gdouble *x,
gdouble *y,
gdouble *pressure,
gdouble *xtilt,
gdouble *ytilt,
GdkModifierType *mask)
{
gint x_int, y_int;
gdk_window_get_pointer (window, &x_int, &y_int, mask);
if (x) *x = x_int;
if (y) *y = y_int;
if (pressure) *pressure = 0.5;
if (xtilt) *xtilt = 0;
if (ytilt) *ytilt = 0;
}

View File

@@ -1,282 +0,0 @@
#include "gdk.h"
#include "gdkprivate-nanox.h"
#include "gdkinputprivate.h"
static const GdkAxisUse gdk_input_core_axes[] = { GDK_AXIS_X, GDK_AXIS_Y };
const GdkDeviceInfo gdk_input_core_info =
{
GDK_CORE_POINTER,
"Core Pointer",
GDK_SOURCE_MOUSE,
GDK_MODE_SCREEN,
TRUE,
2,
gdk_input_core_axes
};
/* Global variables */
GdkInputVTable gdk_input_vtable;
/* information about network port and host for gxid daemon */
gchar *gdk_input_gxid_host;
gint gdk_input_gxid_port;
gint gdk_input_ignore_core;
GList *gdk_input_devices;
GList *gdk_input_windows;
GList *
gdk_input_list_devices (void)
{
return gdk_input_devices;
}
void
gdk_input_set_source (guint32 deviceid, GdkInputSource source)
{
GdkDevicePrivate *gdkdev = gdk_input_find_device(deviceid);
g_return_if_fail (gdkdev != NULL);
gdkdev->info.source = source;
}
gboolean
gdk_input_set_mode (guint32 deviceid, GdkInputMode mode)
{
if (deviceid == GDK_CORE_POINTER)
return FALSE;
if (gdk_input_vtable.set_mode)
return gdk_input_vtable.set_mode(deviceid,mode);
else
return FALSE;
}
void
gdk_input_set_axes (guint32 deviceid, GdkAxisUse *axes)
{
if (deviceid != GDK_CORE_POINTER && gdk_input_vtable.set_axes)
gdk_input_vtable.set_axes (deviceid, axes);
}
void gdk_input_set_key (guint32 deviceid,
guint index,
guint keyval,
GdkModifierType modifiers)
{
if (deviceid != GDK_CORE_POINTER && gdk_input_vtable.set_key)
gdk_input_vtable.set_key (deviceid, index, keyval, modifiers);
}
GdkTimeCoord *
gdk_input_motion_events (GdkWindow *window,
guint32 deviceid,
guint32 start,
guint32 stop,
gint *nevents_return)
{
GdkTimeCoord *coords;
int i;
g_return_val_if_fail (window != NULL, NULL);
g_return_val_if_fail (GDK_IS_WINDOW (window), NULL);
if (GDK_DRAWABLE_DESTROYED (window))
return NULL;
if (deviceid == GDK_CORE_POINTER)
{
return NULL;
}
else
{
if (gdk_input_vtable.motion_events)
{
return gdk_input_vtable.motion_events(window,
deviceid, start, stop,
nevents_return);
}
else
{
*nevents_return = 0;
return NULL;
}
}
}
gint
gdk_input_enable_window (GdkWindow *window, GdkDevicePrivate *gdkdev)
{
if (gdk_input_vtable.enable_window)
return gdk_input_vtable.enable_window (window, gdkdev);
else
return TRUE;
}
gint
gdk_input_disable_window (GdkWindow *window, GdkDevicePrivate *gdkdev)
{
if (gdk_input_vtable.disable_window)
return gdk_input_vtable.disable_window(window,gdkdev);
else
return TRUE;
}
GdkInputWindow *
gdk_input_window_find(GdkWindow *window)
{
GList *tmp_list;
for (tmp_list=gdk_input_windows; tmp_list; tmp_list=tmp_list->next)
if (((GdkInputWindow *)(tmp_list->data))->window == window)
return (GdkInputWindow *)(tmp_list->data);
return NULL; /* Not found */
}
/* FIXME: this routine currently needs to be called between creation
and the corresponding configure event (because it doesn't get the
root_relative_geometry). This should work with
gtk_window_set_extension_events, but will likely fail in other
cases */
void
gdk_input_set_extension_events (GdkWindow *window, gint mask,
GdkExtensionMode mode)
{
GdkWindowPrivate *window_private;
GList *tmp_list;
GdkInputWindow *iw;
g_return_if_fail (window != NULL);
g_return_if_fail (GDK_IS_WINDOW (window));
window_private = (GdkWindowPrivate*) window;
if (GDK_DRAWABLE_DESTROYED (window))
return;
if (mode == GDK_EXTENSION_EVENTS_NONE)
mask = 0;
if (mask != 0)
{
iw = g_new(GdkInputWindow,1);
iw->window = window;
iw->mode = mode;
iw->obscuring = NULL;
iw->num_obscuring = 0;
iw->grabbed = FALSE;
gdk_input_windows = g_list_append(gdk_input_windows,iw);
window_private->extension_events = mask;
/* Add enter window events to the event mask */
/* FIXME, this is not needed for XINPUT_NONE */
gdk_window_set_events (window,
gdk_window_get_events (window) |
GDK_ENTER_NOTIFY_MASK);
}
else
{
iw = gdk_input_window_find (window);
if (iw)
{
gdk_input_windows = g_list_remove(gdk_input_windows,iw);
g_free(iw);
}
window_private->extension_events = 0;
}
for (tmp_list = gdk_input_devices; tmp_list; tmp_list = tmp_list->next)
{
GdkDevicePrivate *gdkdev = (GdkDevicePrivate *)(tmp_list->data);
if (gdkdev->info.deviceid != GDK_CORE_POINTER)
{
if (mask != 0 && gdkdev->info.mode != GDK_MODE_DISABLED
&& (gdkdev->info.has_cursor || mode == GDK_EXTENSION_EVENTS_ALL))
gdk_input_enable_window(window,gdkdev);
else
gdk_input_disable_window(window,gdkdev);
}
}
}
void
gdk_input_window_destroy (GdkWindow *window)
{
GdkInputWindow *input_window;
input_window = gdk_input_window_find (window);
g_return_if_fail (input_window != NULL);
gdk_input_windows = g_list_remove (gdk_input_windows,input_window);
g_free(input_window);
}
void
gdk_input_exit (void)
{
GList *tmp_list;
GdkDevicePrivate *gdkdev;
for (tmp_list = gdk_input_devices; tmp_list; tmp_list = tmp_list->next)
{
gdkdev = (GdkDevicePrivate *)(tmp_list->data);
if (gdkdev->info.deviceid != GDK_CORE_POINTER)
{
gdk_input_set_mode(gdkdev->info.deviceid,GDK_MODE_DISABLED);
g_free(gdkdev->info.name);
#ifndef XINPUT_NONE
g_free(gdkdev->axes);
#endif
g_free(gdkdev->info.axes);
g_free(gdkdev->info.keys);
g_free(gdkdev);
}
}
g_list_free(gdk_input_devices);
for (tmp_list = gdk_input_windows; tmp_list; tmp_list = tmp_list->next)
{
g_free(tmp_list->data);
}
g_list_free(gdk_input_windows);
}
GdkDevicePrivate *
gdk_input_find_device(guint32 id)
{
GList *tmp_list = gdk_input_devices;
GdkDevicePrivate *gdkdev;
while (tmp_list)
{
gdkdev = (GdkDevicePrivate *)(tmp_list->data);
if (gdkdev->info.deviceid == id)
return gdkdev;
tmp_list = tmp_list->next;
}
return NULL;
}
void
gdk_input_window_get_pointer (GdkWindow *window,
guint32 deviceid,
gdouble *x,
gdouble *y,
gdouble *pressure,
gdouble *xtilt,
gdouble *ytilt,
GdkModifierType *mask)
{
if (gdk_input_vtable.get_pointer)
gdk_input_vtable.get_pointer (window, deviceid, x, y, pressure,
xtilt, ytilt, mask);
}

View File

@@ -1,250 +0,0 @@
#include "gdk.h"
#include "gdkinternals.h"
#include "gdkprivate-nanox.h"
static GR_SCREEN_INFO screen_info;
static int gdk_use_xshm = 0; /* shm not supported */
guint gdk_selection_property = 0;
gchar* gdk_progclass = NULL;
GdkWindowPrivate* gdk_xgrab_window = NULL;
GdkArgDesc _gdk_windowing_args[] = {
{NULL}
};
gboolean
_gdk_windowing_init_check (int argc, char **argv)
{
int result = GrOpen();
if (result < 0)
return 0;
GrGetScreenInfo(&screen_info);
return 1;
}
gchar*
gdk_set_locale (void)
{
return "";
}
void
gdk_set_use_xshm (gboolean use_xshm)
{
gdk_use_xshm = 0; /* shm not supported */
}
gboolean
gdk_get_use_xshm (void)
{
return gdk_use_xshm;
}
gint
gdk_pointer_grab (GdkWindow * window,
gboolean owner_events,
GdkEventMask event_mask,
GdkWindow * confine_to,
GdkCursor * cursor,
guint32 time)
{
g_message("unimplemented %s", __FUNCTION__);
return 0;
}
void
gdk_pointer_ungrab (guint32 time)
{
g_message("unimplemented %s", __FUNCTION__);
}
gboolean
gdk_pointer_is_grabbed (void)
{
return gdk_xgrab_window != NULL;
}
gint
gdk_keyboard_grab (GdkWindow * window,
gboolean owner_events,
guint32 time)
{
g_message("unimplemented %s", __FUNCTION__);
return 0;
}
void
gdk_keyboard_ungrab (guint32 time)
{
g_message("unimplemented %s", __FUNCTION__);
}
gint
gdk_screen_width (void)
{
return screen_info.cols;
}
gint
gdk_screen_height (void)
{
return screen_info.rows;
}
gint
gdk_screen_width_mm (void)
{
return screen_info.cols*10/screen_info.xdpcm;
}
gint
gdk_screen_height_mm (void)
{
return screen_info.rows*10/screen_info.ydpcm;
}
void
gdk_set_sm_client_id (const gchar* sm_client_id)
{
g_message("unimplemented %s", __FUNCTION__);
}
void
gdk_key_repeat_disable (void)
{
g_message("unimplemented %s", __FUNCTION__);
}
void
gdk_key_repeat_restore (void)
{
g_message("unimplemented %s", __FUNCTION__);
}
void
gdk_beep (void)
{
g_message("unimplemented %s", __FUNCTION__);
}
void
gdk_windowing_exit (void)
{
GrClose();
}
gchar *
gdk_get_display (void)
{
return "nano-X";
}
gchar*
gdk_keyval_name (guint keyval)
{
static gchar buf[64];
g_snprintf(buf, 64, "%c", keyval);
return buf;
}
guint
gdk_keyval_from_name (const gchar *keyval_name)
{
return *keyval_name;
}
/*
void
gdk_keyval_convert_case (guint symbol,
guint *lower,
guint *upper)
{
}
*/
static guint gdk_xid_hash (guint *xid);
static gint gdk_xid_compare (guint *a,
guint *b);
static GHashTable *xid_ht = NULL;
void
gdk_xid_table_insert (guint *xid,
gpointer data)
{
g_return_if_fail (xid != NULL);
if (!xid_ht)
xid_ht = g_hash_table_new ((GHashFunc) gdk_xid_hash,
(GCompareFunc) gdk_xid_compare);
g_hash_table_insert (xid_ht, xid, data);
}
void
gdk_xid_table_remove (guint xid)
{
if (!xid_ht)
xid_ht = g_hash_table_new ((GHashFunc) gdk_xid_hash,
(GCompareFunc) gdk_xid_compare);
g_hash_table_remove (xid_ht, &xid);
}
gpointer
gdk_xid_table_lookup (guint xid)
{
gpointer data = NULL;
if (xid_ht)
data = g_hash_table_lookup (xid_ht, &xid);
return data;
}
static guint
gdk_xid_hash (guint *xid)
{
return *xid;
}
static gint
gdk_xid_compare (guint *a,
guint *b)
{
return (*a == *b);
}
gchar *
gdk_wcstombs (const GdkWChar *src)
{
gchar *mbstr;
gint i, length = 0;
while (src[length] != 0)
length++;
mbstr = g_new (gchar, length + 1);
for (i=0; i <length+1;++i)
mbstr[i] = src[i];
return mbstr;
}
gint
gdk_mbstowcs (GdkWChar *dest, const gchar *src, gint dest_max)
{
gint i;
for (i=0; i < dest_max && src[i]; i++)
dest[i] = src[i];
return i;
}

View File

@@ -1,149 +0,0 @@
#include "gdk.h"
#include "gdkprivate-nanox.h"
GdkDrawableClass _gdk_nanox_pixmap_class;
static void
gdk_nanox_pixmap_destroy (GdkPixmap *pixmap)
{
GrDestroyWindow (GDK_DRAWABLE_XID (pixmap));
gdk_xid_table_remove (GDK_DRAWABLE_XID (pixmap));
g_free (GDK_DRAWABLE_XDATA (pixmap));
}
static GdkDrawable *
gdk_nanox_pixmap_alloc (void)
{
GdkDrawable *drawable;
GdkDrawablePrivate *private;
static GdkDrawableClass klass;
static gboolean initialized = FALSE;
if (!initialized)
{
initialized = TRUE;
klass = _gdk_nanox_drawable_class;
klass.destroy = gdk_nanox_pixmap_destroy;
}
drawable = gdk_drawable_alloc ();
private = (GdkDrawablePrivate *)drawable;
private->klass = &klass;
private->klass_data = g_new (GdkDrawableXData, 1);
private->window_type = GDK_DRAWABLE_PIXMAP;
return drawable;
}
GdkPixmap*
gdk_pixmap_new (GdkWindow *window,
gint width,
gint height,
gint depth)
{
GdkPixmap *pixmap;
GdkDrawablePrivate *private;
g_return_val_if_fail (window == NULL || GDK_IS_WINDOW (window), NULL);
g_return_val_if_fail ((window != NULL) || (depth != -1), NULL);
g_return_val_if_fail ((width != 0) && (height != 0), NULL);
if (!window)
window = gdk_parent_root;
if (GDK_DRAWABLE_DESTROYED (window))
return NULL;
if (depth == -1)
depth = gdk_drawable_get_visual (window)->depth;
pixmap = gdk_nanox_pixmap_alloc ();
private = (GdkDrawablePrivate *)pixmap;
GDK_DRAWABLE_XDATA (private)->xid = GrNewPixmap (width, height, NULL);
private->width = width;
private->height = height;
gdk_xid_table_insert (&GDK_DRAWABLE_XID (pixmap), pixmap);
return pixmap;
}
GdkPixmap *
gdk_bitmap_create_from_data (GdkWindow *window,
const gchar *data,
gint width,
gint height)
{
g_message("unimplemented %s", __FUNCTION__);
return NULL;
}
GdkPixmap*
gdk_pixmap_create_from_data (GdkWindow *window,
const gchar *data,
gint width,
gint height,
gint depth,
GdkColor *fg,
GdkColor *bg)
{
g_message("unimplemented %s", __FUNCTION__);
return NULL;
}
GdkPixmap*
gdk_pixmap_colormap_create_from_xpm (GdkWindow *window,
GdkColormap *colormap,
GdkBitmap **mask,
GdkColor *transparent_color,
const gchar *filename)
{
g_message("unimplemented %s", __FUNCTION__);
return NULL;
}
GdkPixmap*
gdk_pixmap_create_from_xpm (GdkWindow *window,
GdkBitmap **mask,
GdkColor *transparent_color,
const gchar *filename)
{
g_message("unimplemented %s", __FUNCTION__);
return NULL;
}
GdkPixmap*
gdk_pixmap_colormap_create_from_xpm_d (GdkWindow *window,
GdkColormap *colormap,
GdkBitmap **mask,
GdkColor *transparent_color,
gchar **data)
{
g_message("unimplemented %s", __FUNCTION__);
return NULL;
}
GdkPixmap*
gdk_pixmap_create_from_xpm_d (GdkWindow *window,
GdkBitmap **mask,
GdkColor *transparent_color,
gchar **data)
{
g_message("unimplemented %s", __FUNCTION__);
return NULL;
}
GdkPixmap*
gdk_pixmap_foreign_new (guint32 anid)
{
g_message("unimplemented %s", __FUNCTION__);
return NULL;
}

View File

@@ -1,616 +0,0 @@
/* $TOG: PolyReg.c /main/15 1998/02/06 17:47:08 kaleb $ */
/************************************************************************
Copyright 1987, 1998 The Open Group
All Rights Reserved.
The above copyright notice and this permission notice shall be included in
all copies or substantial portions of the Software.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
OPEN GROUP BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN
AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
Except as contained in this notice, the name of The Open Group shall not be
used in advertising or otherwise to promote the sale, use or other dealings
in this Software without prior written authorization from The Open Group.
Copyright 1987 by Digital Equipment Corporation, Maynard, Massachusetts.
All Rights Reserved
Permission to use, copy, modify, and distribute this software and its
documentation for any purpose and without fee is hereby granted,
provided that the above copyright notice appear in all copies and that
both that copyright notice and this permission notice appear in
supporting documentation, and that the name of Digital not be
used in advertising or publicity pertaining to distribution of the
software without specific, written prior permission.
DIGITAL DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE, INCLUDING
ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS, IN NO EVENT SHALL
DIGITAL BE LIABLE FOR ANY SPECIAL, INDIRECT OR CONSEQUENTIAL DAMAGES OR
ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS,
WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION,
ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS
SOFTWARE.
************************************************************************/
/* $XFree86: xc/lib/X11/PolyReg.c,v 1.4 1998/10/03 08:41:21 dawes Exp $ */
#define LARGE_COORDINATE 1000000
#define SMALL_COORDINATE -LARGE_COORDINATE
#include <gdkregion.h>
#include "gdkregion-generic.h"
#include "gdkpoly-generic.h"
/*
* InsertEdgeInET
*
* Insert the given edge into the edge table.
* First we must find the correct bucket in the
* Edge table, then find the right slot in the
* bucket. Finally, we can insert it.
*
*/
static void
InsertEdgeInET(ET, ETE, scanline, SLLBlock, iSLLBlock)
EdgeTable *ET;
EdgeTableEntry *ETE;
int scanline;
ScanLineListBlock **SLLBlock;
int *iSLLBlock;
{
EdgeTableEntry *start, *prev;
ScanLineList *pSLL, *pPrevSLL;
ScanLineListBlock *tmpSLLBlock;
/*
* find the right bucket to put the edge into
*/
pPrevSLL = &ET->scanlines;
pSLL = pPrevSLL->next;
while (pSLL && (pSLL->scanline < scanline))
{
pPrevSLL = pSLL;
pSLL = pSLL->next;
}
/*
* reassign pSLL (pointer to ScanLineList) if necessary
*/
if ((!pSLL) || (pSLL->scanline > scanline))
{
if (*iSLLBlock > SLLSPERBLOCK-1)
{
tmpSLLBlock =
(ScanLineListBlock *)g_malloc(sizeof(ScanLineListBlock));
(*SLLBlock)->next = tmpSLLBlock;
tmpSLLBlock->next = (ScanLineListBlock *)NULL;
*SLLBlock = tmpSLLBlock;
*iSLLBlock = 0;
}
pSLL = &((*SLLBlock)->SLLs[(*iSLLBlock)++]);
pSLL->next = pPrevSLL->next;
pSLL->edgelist = (EdgeTableEntry *)NULL;
pPrevSLL->next = pSLL;
}
pSLL->scanline = scanline;
/*
* now insert the edge in the right bucket
*/
prev = (EdgeTableEntry *)NULL;
start = pSLL->edgelist;
while (start && (start->bres.minor_axis < ETE->bres.minor_axis))
{
prev = start;
start = start->next;
}
ETE->next = start;
if (prev)
prev->next = ETE;
else
pSLL->edgelist = ETE;
}
/*
* CreateEdgeTable
*
* This routine creates the edge table for
* scan converting polygons.
* The Edge Table (ET) looks like:
*
* EdgeTable
* --------
* | ymax | ScanLineLists
* |scanline|-->------------>-------------->...
* -------- |scanline| |scanline|
* |edgelist| |edgelist|
* --------- ---------
* | |
* | |
* V V
* list of ETEs list of ETEs
*
* where ETE is an EdgeTableEntry data structure,
* and there is one ScanLineList per scanline at
* which an edge is initially entered.
*
*/
static void
CreateETandAET(count, pts, ET, AET, pETEs, pSLLBlock)
int count;
GdkPoint *pts;
EdgeTable *ET;
EdgeTableEntry *AET;
EdgeTableEntry *pETEs;
ScanLineListBlock *pSLLBlock;
{
GdkPoint *top, *bottom;
GdkPoint *PrevPt, *CurrPt;
int iSLLBlock = 0;
int dy;
if (count < 2) return;
/*
* initialize the Active Edge Table
*/
AET->next = (EdgeTableEntry *)NULL;
AET->back = (EdgeTableEntry *)NULL;
AET->nextWETE = (EdgeTableEntry *)NULL;
AET->bres.minor_axis = SMALL_COORDINATE;
/*
* initialize the Edge Table.
*/
ET->scanlines.next = (ScanLineList *)NULL;
ET->ymax = SMALL_COORDINATE;
ET->ymin = LARGE_COORDINATE;
pSLLBlock->next = (ScanLineListBlock *)NULL;
PrevPt = &pts[count-1];
/*
* for each vertex in the array of points.
* In this loop we are dealing with two vertices at
* a time -- these make up one edge of the polygon.
*/
while (count--)
{
CurrPt = pts++;
/*
* find out which point is above and which is below.
*/
if (PrevPt->y > CurrPt->y)
{
bottom = PrevPt, top = CurrPt;
pETEs->ClockWise = 0;
}
else
{
bottom = CurrPt, top = PrevPt;
pETEs->ClockWise = 1;
}
/*
* don't add horizontal edges to the Edge table.
*/
if (bottom->y != top->y)
{
pETEs->ymax = bottom->y-1; /* -1 so we don't get last scanline */
/*
* initialize integer edge algorithm
*/
dy = bottom->y - top->y;
BRESINITPGONSTRUCT(dy, top->x, bottom->x, pETEs->bres);
InsertEdgeInET(ET, pETEs, top->y, &pSLLBlock, &iSLLBlock);
if (PrevPt->y > ET->ymax)
ET->ymax = PrevPt->y;
if (PrevPt->y < ET->ymin)
ET->ymin = PrevPt->y;
pETEs++;
}
PrevPt = CurrPt;
}
}
/*
* loadAET
*
* This routine moves EdgeTableEntries from the
* EdgeTable into the Active Edge Table,
* leaving them sorted by smaller x coordinate.
*
*/
static void
loadAET(AET, ETEs)
EdgeTableEntry *AET, *ETEs;
{
EdgeTableEntry *pPrevAET;
EdgeTableEntry *tmp;
pPrevAET = AET;
AET = AET->next;
while (ETEs)
{
while (AET && (AET->bres.minor_axis < ETEs->bres.minor_axis))
{
pPrevAET = AET;
AET = AET->next;
}
tmp = ETEs->next;
ETEs->next = AET;
if (AET)
AET->back = ETEs;
ETEs->back = pPrevAET;
pPrevAET->next = ETEs;
pPrevAET = ETEs;
ETEs = tmp;
}
}
/*
* computeWAET
*
* This routine links the AET by the
* nextWETE (winding EdgeTableEntry) link for
* use by the winding number rule. The final
* Active Edge Table (AET) might look something
* like:
*
* AET
* ---------- --------- ---------
* |ymax | |ymax | |ymax |
* | ... | |... | |... |
* |next |->|next |->|next |->...
* |nextWETE| |nextWETE| |nextWETE|
* --------- --------- ^--------
* | | |
* V-------------------> V---> ...
*
*/
static void
computeWAET(AET)
EdgeTableEntry *AET;
{
EdgeTableEntry *pWETE;
int inside = 1;
int isInside = 0;
AET->nextWETE = (EdgeTableEntry *)NULL;
pWETE = AET;
AET = AET->next;
while (AET)
{
if (AET->ClockWise)
isInside++;
else
isInside--;
if ((!inside && !isInside) ||
( inside && isInside))
{
pWETE->nextWETE = AET;
pWETE = AET;
inside = !inside;
}
AET = AET->next;
}
pWETE->nextWETE = (EdgeTableEntry *)NULL;
}
/*
* InsertionSort
*
* Just a simple insertion sort using
* pointers and back pointers to sort the Active
* Edge Table.
*
*/
static int
InsertionSort(AET)
EdgeTableEntry *AET;
{
EdgeTableEntry *pETEchase;
EdgeTableEntry *pETEinsert;
EdgeTableEntry *pETEchaseBackTMP;
int changed = 0;
AET = AET->next;
while (AET)
{
pETEinsert = AET;
pETEchase = AET;
while (pETEchase->back->bres.minor_axis > AET->bres.minor_axis)
pETEchase = pETEchase->back;
AET = AET->next;
if (pETEchase != pETEinsert)
{
pETEchaseBackTMP = pETEchase->back;
pETEinsert->back->next = AET;
if (AET)
AET->back = pETEinsert->back;
pETEinsert->next = pETEchase;
pETEchase->back->next = pETEinsert;
pETEchase->back = pETEinsert;
pETEinsert->back = pETEchaseBackTMP;
changed = 1;
}
}
return(changed);
}
/*
* Clean up our act.
*/
static void
FreeStorage(pSLLBlock)
ScanLineListBlock *pSLLBlock;
{
ScanLineListBlock *tmpSLLBlock;
while (pSLLBlock)
{
tmpSLLBlock = pSLLBlock->next;
g_free (pSLLBlock);
pSLLBlock = tmpSLLBlock;
}
}
/*
* Create an array of rectangles from a list of points.
* If indeed these things (POINTS, RECTS) are the same,
* then this proc is still needed, because it allocates
* storage for the array, which was allocated on the
* stack by the calling procedure.
*
*/
static int PtsToRegion(numFullPtBlocks, iCurPtBlock, FirstPtBlock, reg)
int numFullPtBlocks, iCurPtBlock;
POINTBLOCK *FirstPtBlock;
GdkRegion *reg;
{
GdkRegionBox *rects;
GdkPoint *pts;
POINTBLOCK *CurPtBlock;
int i;
GdkRegionBox *extents;
int numRects;
extents = &reg->extents;
numRects = ((numFullPtBlocks * NUMPTSTOBUFFER) + iCurPtBlock) >> 1;
reg->rects = g_renew (GdkRegionBox, reg->rects, numRects);
reg->size = numRects;
CurPtBlock = FirstPtBlock;
rects = reg->rects - 1;
numRects = 0;
extents->x1 = G_MAXSHORT, extents->x2 = G_MINSHORT;
for ( ; numFullPtBlocks >= 0; numFullPtBlocks--) {
/* the loop uses 2 points per iteration */
i = NUMPTSTOBUFFER >> 1;
if (!numFullPtBlocks)
i = iCurPtBlock >> 1;
for (pts = CurPtBlock->pts; i--; pts += 2) {
if (pts->x == pts[1].x)
continue;
if (numRects && pts->x == rects->x1 && pts->y == rects->y2 &&
pts[1].x == rects->x2 &&
(numRects == 1 || rects[-1].y1 != rects->y1) &&
(i && pts[2].y > pts[1].y)) {
rects->y2 = pts[1].y + 1;
continue;
}
numRects++;
rects++;
rects->x1 = pts->x; rects->y1 = pts->y;
rects->x2 = pts[1].x; rects->y2 = pts[1].y + 1;
if (rects->x1 < extents->x1)
extents->x1 = rects->x1;
if (rects->x2 > extents->x2)
extents->x2 = rects->x2;
}
CurPtBlock = CurPtBlock->next;
}
if (numRects) {
extents->y1 = reg->rects->y1;
extents->y2 = rects->y2;
} else {
extents->x1 = 0;
extents->y1 = 0;
extents->x2 = 0;
extents->y2 = 0;
}
reg->numRects = numRects;
return(TRUE);
}
/*
* polytoregion
*
* Scan converts a polygon by returning a run-length
* encoding of the resultant bitmap -- the run-length
* encoding is in the form of an array of rectangles.
*/
GdkRegion *
gdk_region_polygon(GdkPoint *Pts, gint Count, GdkFillRule rule)
{
GdkRegion *region;
EdgeTableEntry *pAET; /* Active Edge Table */
int y; /* current scanline */
int iPts = 0; /* number of pts in buffer */
EdgeTableEntry *pWETE; /* Winding Edge Table Entry*/
ScanLineList *pSLL; /* current scanLineList */
GdkPoint *pts; /* output buffer */
EdgeTableEntry *pPrevAET; /* ptr to previous AET */
EdgeTable ET; /* header node for ET */
EdgeTableEntry AET; /* header node for AET */
EdgeTableEntry *pETEs; /* EdgeTableEntries pool */
ScanLineListBlock SLLBlock; /* header for scanlinelist */
int fixWAET = FALSE;
POINTBLOCK FirstPtBlock, *curPtBlock; /* PtBlock buffers */
POINTBLOCK *tmpPtBlock;
int numFullPtBlocks = 0;
region = gdk_region_new ();
/* special case a rectangle */
pts = Pts;
if (((Count == 4) ||
((Count == 5) && (pts[4].x == pts[0].x) && (pts[4].y == pts[0].y))) &&
(((pts[0].y == pts[1].y) &&
(pts[1].x == pts[2].x) &&
(pts[2].y == pts[3].y) &&
(pts[3].x == pts[0].x)) ||
((pts[0].x == pts[1].x) &&
(pts[1].y == pts[2].y) &&
(pts[2].x == pts[3].x) &&
(pts[3].y == pts[0].y)))) {
region->extents.x1 = MIN(pts[0].x, pts[2].x);
region->extents.y1 = MIN(pts[0].y, pts[2].y);
region->extents.x2 = MAX(pts[0].x, pts[2].x);
region->extents.y2 = MAX(pts[0].y, pts[2].y);
if ((region->extents.x1 != region->extents.x2) &&
(region->extents.y1 != region->extents.y2)) {
region->numRects = 1;
*(region->rects) = region->extents;
}
return(region);
}
pETEs = g_new (EdgeTableEntry, Count);
pts = FirstPtBlock.pts;
CreateETandAET(Count, Pts, &ET, &AET, pETEs, &SLLBlock);
pSLL = ET.scanlines.next;
curPtBlock = &FirstPtBlock;
if (rule == GDK_EVEN_ODD_RULE) {
/*
* for each scanline
*/
for (y = ET.ymin; y < ET.ymax; y++) {
/*
* Add a new edge to the active edge table when we
* get to the next edge.
*/
if (pSLL != NULL && y == pSLL->scanline) {
loadAET(&AET, pSLL->edgelist);
pSLL = pSLL->next;
}
pPrevAET = &AET;
pAET = AET.next;
/*
* for each active edge
*/
while (pAET) {
pts->x = pAET->bres.minor_axis, pts->y = y;
pts++, iPts++;
/*
* send out the buffer
*/
if (iPts == NUMPTSTOBUFFER) {
tmpPtBlock = (POINTBLOCK *)g_malloc(sizeof(POINTBLOCK));
curPtBlock->next = tmpPtBlock;
curPtBlock = tmpPtBlock;
pts = curPtBlock->pts;
numFullPtBlocks++;
iPts = 0;
}
EVALUATEEDGEEVENODD(pAET, pPrevAET, y);
}
(void) InsertionSort(&AET);
}
}
else {
/*
* for each scanline
*/
for (y = ET.ymin; y < ET.ymax; y++) {
/*
* Add a new edge to the active edge table when we
* get to the next edge.
*/
if (pSLL != NULL && y == pSLL->scanline) {
loadAET(&AET, pSLL->edgelist);
computeWAET(&AET);
pSLL = pSLL->next;
}
pPrevAET = &AET;
pAET = AET.next;
pWETE = pAET;
/*
* for each active edge
*/
while (pAET) {
/*
* add to the buffer only those edges that
* are in the Winding active edge table.
*/
if (pWETE == pAET) {
pts->x = pAET->bres.minor_axis, pts->y = y;
pts++, iPts++;
/*
* send out the buffer
*/
if (iPts == NUMPTSTOBUFFER) {
tmpPtBlock = (POINTBLOCK *)g_malloc(sizeof(POINTBLOCK));
curPtBlock->next = tmpPtBlock;
curPtBlock = tmpPtBlock;
pts = curPtBlock->pts;
numFullPtBlocks++; iPts = 0;
}
pWETE = pWETE->nextWETE;
}
EVALUATEEDGEWINDING(pAET, pPrevAET, y, fixWAET);
}
/*
* recompute the winding active edge table if
* we just resorted or have exited an edge.
*/
if (InsertionSort(&AET) || fixWAET) {
computeWAET(&AET);
fixWAET = FALSE;
}
}
}
FreeStorage(SLLBlock.next);
(void) PtsToRegion(numFullPtBlocks, iPts, &FirstPtBlock, region);
for (curPtBlock = FirstPtBlock.next; --numFullPtBlocks >= 0;) {
tmpPtBlock = curPtBlock->next;
g_free (curPtBlock);
curPtBlock = tmpPtBlock;
}
g_free (pETEs);
return(region);
}

View File

@@ -1,55 +0,0 @@
#include "gdk.h"
#include "gdkprivate-nanox.h"
GdkAtom
gdk_atom_intern (const gchar *atom_name,
gboolean only_if_exists)
{
g_message("unimplemented %s", __FUNCTION__);
return 0;
}
gchar*
gdk_atom_name (GdkAtom atom)
{
g_message("unimplemented %s", __FUNCTION__);
return NULL;
}
gboolean
gdk_property_get (GdkWindow *window,
GdkAtom property,
GdkAtom type,
gulong offset,
gulong length,
gint pdelete,
GdkAtom *actual_property_type,
gint *actual_format_type,
gint *actual_length,
guchar **data)
{
g_message("unimplemented %s", __FUNCTION__);
return 0;
}
void
gdk_property_change (GdkWindow *window,
GdkAtom property,
GdkAtom type,
gint format,
GdkPropMode mode,
const guchar *data,
gint nelements)
{
g_message("unimplemented %s", __FUNCTION__);
return;
}
void
gdk_property_delete (GdkWindow *window,
GdkAtom property)
{
g_message("unimplemented %s", __FUNCTION__);
return;
}

File diff suppressed because it is too large Load Diff

View File

@@ -1,107 +0,0 @@
#include "gdkprivate-nanox.h"
GdkRegion*
gdk_region_new (void)
{
return NULL;
}
void
gdk_region_destroy (GdkRegion *region)
{
}
gboolean
gdk_region_empty (GdkRegion *region)
{
return 1;
}
gboolean
gdk_region_equal (GdkRegion *region1,
GdkRegion *region2)
{
return 1;
}
void
gdk_region_get_clipbox(GdkRegion *region,
GdkRectangle *rectangle)
{
}
gboolean
gdk_region_point_in (GdkRegion *region,
gint x,
gint y)
{
return 0;
}
GdkOverlapType
gdk_region_rect_in (GdkRegion *region,
GdkRectangle *rect)
{
return 0;
}
GdkRegion *
gdk_region_polygon (GdkPoint *points,
gint npoints,
GdkFillRule fill_rule)
{
return NULL;
}
void
gdk_region_offset (GdkRegion *region,
gint dx,
gint dy)
{
}
void
gdk_region_shrink (GdkRegion *region,
gint dx,
gint dy)
{
}
GdkRegion*
gdk_region_union_with_rect (GdkRegion *region,
GdkRectangle *rect)
{
return NULL;
}
GdkRegion*
gdk_regions_intersect (GdkRegion *source1,
GdkRegion *source2)
{
return NULL;
}
GdkRegion*
gdk_regions_union (GdkRegion *source1,
GdkRegion *source2)
{
return NULL;
}
GdkRegion*
gdk_regions_subtract (GdkRegion *source1,
GdkRegion *source2)
{
return NULL;
}
GdkRegion*
gdk_regions_xor (GdkRegion *source1,
GdkRegion *source2)
{
return NULL;
}

View File

@@ -1,89 +0,0 @@
#include "gdk.h"
#include "gdkprivate-nanox.h"
gboolean
gdk_selection_owner_set (GdkWindow *owner,
GdkAtom selection,
guint32 time,
gboolean send_event)
{
g_message("unimplemented %s", __FUNCTION__);
return 0;
}
GdkWindow*
gdk_selection_owner_get (GdkAtom selection)
{
g_message("unimplemented %s", __FUNCTION__);
return NULL;
}
void
gdk_selection_convert (GdkWindow *requestor,
GdkAtom selection,
GdkAtom target,
guint32 time)
{
g_message("unimplemented %s", __FUNCTION__);
}
gint
gdk_selection_property_get (GdkWindow *requestor,
guchar **data,
GdkAtom *ret_type,
gint *ret_format)
{
g_message("unimplemented %s", __FUNCTION__);
return 0;
}
void
gdk_selection_send_notify (guint32 requestor,
GdkAtom selection,
GdkAtom target,
GdkAtom property,
guint32 time)
{
g_message("unimplemented %s", __FUNCTION__);
}
gint
gdk_text_property_to_text_list (GdkAtom encoding,
gint format,
const guchar *text,
gint length,
gchar ***list)
{
g_message("unimplemented %s", __FUNCTION__);
return 0;
}
void
gdk_free_text_list (gchar **list)
{
g_return_if_fail (list != NULL);
}
gint
gdk_string_to_compound_text (const gchar *str,
GdkAtom *encoding,
gint *format,
guchar **ctext,
gint *length)
{
g_message("unimplemented %s", __FUNCTION__);
return 0;
}
void gdk_free_compound_text (guchar *ctext)
{
/* if (ctext)
g_free (ctext);*/
}

View File

@@ -1,95 +0,0 @@
#include "gdkvisual.h"
#include "gdkprivate-nanox.h"
#include <glib.h>
static GdkVisual system_visual;
void
gdk_visual_init (void)
{
system_visual.type = GDK_VISUAL_TRUE_COLOR;
system_visual.depth = 24;
system_visual.bits_per_rgb = 8;
}
GdkVisual*
gdk_visual_ref (GdkVisual *visual)
{
return visual;
}
void
gdk_visual_unref (GdkVisual *visual)
{
return;
}
gint
gdk_visual_get_best_depth (void)
{
return 24;
}
GdkVisualType
gdk_visual_get_best_type (void)
{
return GDK_VISUAL_TRUE_COLOR;
}
GdkVisual*
gdk_visual_get_system (void)
{
return ((GdkVisual*) &system_visual);
}
GdkVisual*
gdk_visual_get_best (void)
{
return ((GdkVisual*) &system_visual);
}
GdkVisual*
gdk_visual_get_best_with_type (GdkVisualType visual_type)
{
if (visual_type == GDK_VISUAL_TRUE_COLOR)
return &system_visual;
return NULL;
}
GdkVisual*
gdk_visual_get_best_with_both (gint depth,
GdkVisualType visual_type)
{
if (visual_type == GDK_VISUAL_TRUE_COLOR && depth == 24)
return &system_visual;
return NULL;
}
void
gdk_query_depths (gint **depths,
gint *count)
{
if (count)
*count = 1;
if (depths)
*depths[0] = 24;
}
void
gdk_query_visual_types (GdkVisualType **visual_types,
gint *count)
{
if (count)
*count = 1;
if (visual_types)
*visual_types[0] = GDK_VISUAL_TRUE_COLOR;
}
GList*
gdk_list_visuals (void)
{
return g_list_append(NULL, &system_visual);
}

View File

@@ -1,600 +0,0 @@
#include "gdk.h"
#include "config.h"
#include "gdkwindow.h"
#include "gdkprivate-nanox.h"
#include "gdkprivate.h"
static void create_toplevel (GR_WINDOW_ID parent, GR_WINDOW_ID win, int x, int y, int width, int height);
static int manage_event (GR_EVENT *event);
static void set_title (GR_WINDOW_ID win, char* title);
typedef struct {
char * name;
void (*create_toplevel) (GR_WINDOW_ID parent, GR_WINDOW_ID win, int x, int y, int width, int height);
int (*manage_event) (GR_EVENT *event);
void (*set_title) (GR_WINDOW_ID win, char* title);
} GdkWindowManager;
typedef struct {
GR_WINDOW_ID pwin;
GR_WINDOW_ID win;
char *title;
GdkWMFunction functions;
GdkWMDecoration decors;
} WMInfo;
static GdkWindowManager test_wm = {
"test",
create_toplevel,
manage_event,
set_title
};
static GdkWindowManager *default_wm = &test_wm;
static GHashTable * wm_hash = NULL;
GdkDrawableClass _gdk_windowing_window_class;
static void create_toplevel (GR_WINDOW_ID parent, GR_WINDOW_ID win, int x, int y, int width, int height)
{
WMInfo *winfo;
winfo = g_new0(WMInfo, 1);
winfo->pwin = GrNewWindow(parent, x, y-20, width, height+20, 0, RGB(150, 50,150), WHITE);
winfo->win = win;
GrReparentWindow(winfo->pwin, win, 20, 0);
if (!wm_hash)
wm_hash = g_hash_table_new(g_int_hash, g_int_equal);
g_hash_table_insert(wm_hash, winfo->pwin, winfo);
}
static int manage_event (GR_EVENT *event) {
return 0;
}
static void set_title (GR_WINDOW_ID win, char* title) {
}
static void
gdk_nanox_window_destroy (GdkDrawable *drawable)
{
if (!GDK_DRAWABLE_DESTROYED (drawable))
{
if (GDK_DRAWABLE_TYPE (drawable) == GDK_WINDOW_FOREIGN)
gdk_xid_table_remove (GDK_DRAWABLE_XID (drawable));
else
g_warning ("losing last reference to undestroyed window\n");
}
g_free (GDK_DRAWABLE_XDATA (drawable));
}
static GdkWindowPrivate*
gdk_window_nanox_alloc() {
GdkWindow *window;
GdkWindowPrivate *private;
static GdkDrawableClass klass;
static gboolean initialized = FALSE;
if (!initialized)
{
initialized = TRUE;
klass = _gdk_nanox_drawable_class;
klass.destroy = gdk_nanox_window_destroy;
}
window = _gdk_window_alloc ();
private = (GdkWindowPrivate *)window;
private->drawable.klass = &klass;
private->drawable.klass_data = g_new (GdkDrawableXData, 1);
return window;
}
static void
gdk_window_internal_destroy (GdkWindow *window,
gboolean xdestroy,
gboolean our_destroy)
{
}
GR_WINDOW_ID gdk_root_window = GR_ROOT_WINDOW_ID;
void
gdk_window_init (void)
{
GdkWindowPrivate *private;
gdk_parent_root = gdk_window_nanox_alloc ();
private = (GdkWindowPrivate *)gdk_parent_root;
GDK_DRAWABLE_XDATA (gdk_parent_root)->xid = gdk_root_window;
private->drawable.window_type = GDK_WINDOW_ROOT;
private->drawable.width = gdk_screen_width();
private->drawable.height = gdk_screen_height();
gdk_window_set_events(private, -1);
gdk_xid_table_insert (&gdk_root_window, gdk_parent_root);
}
GdkWindow*
gdk_window_new (GdkWindow *parent,
GdkWindowAttr *attributes,
gint attributes_mask)
{
GR_WINDOW_ID new_win;
GdkWindowPrivate *private, *parent_private;
int x, y, width, height;
int border = 1;
if (!parent)
parent = gdk_parent_root;
if (GDK_DRAWABLE_DESTROYED (parent))
return NULL;
private->parent = parent;
parent_private = (GdkWindowPrivate*)parent;
if (attributes_mask & GDK_WA_X)
x = attributes->x;
else
x = 0;
if (attributes_mask & GDK_WA_Y)
y = attributes->y;
else
y = 0;
width = attributes->width;
height = attributes->height;
private = gdk_window_nanox_alloc();
private->x = x;
private->y = y;
private->drawable.width = (attributes->width > 1) ? (attributes->width) : (1);
private->drawable.height = (attributes->height > 1) ? (attributes->height) : (1);
private->drawable.window_type = attributes->window_type;
if (attributes->window_type == GDK_WINDOW_TOPLEVEL || attributes->window_type == GDK_WINDOW_DIALOG)
border = 2;
/* if toplevel reparent to our own window managed window... (check override_redirect) */
if (attributes->wclass == GDK_INPUT_OUTPUT)
new_win = GrNewWindow(GDK_WINDOW_XWINDOW(parent), x, y, width, height, border, RGB(150,150,150), WHITE);
else
new_win = GrNewInputWindow(GDK_WINDOW_XWINDOW(parent), x, y, width, height);
GDK_DRAWABLE_XDATA(private)->xid = new_win;
gdk_drawable_ref(private);
private->drawable.colormap = gdk_colormap_get_system ();
gdk_xid_table_insert (&GDK_DRAWABLE_XID(private), private);
g_message("created window %d %d %d %d %d", new_win, x, y, width, height);
GrSelectEvents(GDK_DRAWABLE_XID(private), -1);
return (GdkWindow*)private;;
}
GdkWindow *
gdk_window_foreign_new (guint32 anid)
{
g_message("unimplemented %s", __FUNCTION__);
return NULL;
}
void
gdk_window_destroy (GdkWindow *window)
{
gdk_window_internal_destroy (window, TRUE, TRUE);
gdk_drawable_unref (window);
}
void
gdk_window_destroy_notify (GdkWindow *window)
{
g_message("unimplemented %s", __FUNCTION__);
}
void
gdk_window_show (GdkWindow *window)
{
GdkWindowPrivate *private;
g_return_if_fail (window != NULL);
private = (GdkWindowPrivate*) window;
if (!private->drawable.destroyed)
{
private->mapped = TRUE;
GrRaiseWindow (GDK_DRAWABLE_XID (window));
GrMapWindow (GDK_DRAWABLE_XID (window));
}
}
void
gdk_window_hide (GdkWindow *window)
{
GdkWindowPrivate *private;
g_return_if_fail (window != NULL);
private = (GdkWindowPrivate*) window;
if (!private->drawable.destroyed)
{
private->mapped = FALSE;
GrUnmapWindow (GDK_DRAWABLE_XID (window));
}
}
void
gdk_window_raise (GdkWindow *window)
{
g_return_if_fail (window != NULL);
g_return_if_fail (GDK_IS_WINDOW (window));
if (!GDK_DRAWABLE_DESTROYED (window))
GrRaiseWindow (GDK_DRAWABLE_XID (window));
}
void
gdk_window_lower (GdkWindow *window)
{
g_return_if_fail (window != NULL);
g_return_if_fail (GDK_IS_WINDOW (window));
if (!GDK_DRAWABLE_DESTROYED (window))
GrLowerWindow (GDK_DRAWABLE_XID (window));
}
void
gdk_window_withdraw (GdkWindow *window)
{
g_message("unimplemented %s", __FUNCTION__);
}
void
gdk_window_move (GdkWindow *window,
gint x,
gint y)
{
GrMoveWindow(GDK_DRAWABLE_XID(window), x, y);
}
void
gdk_window_resize (GdkWindow *window,
gint width,
gint height)
{
GrResizeWindow(GDK_DRAWABLE_XID(window), width, height);
}
void
gdk_window_move_resize (GdkWindow *window,
gint x,
gint y,
gint width,
gint height)
{
GrMoveWindow(GDK_DRAWABLE_XID(window), x, y);
GrResizeWindow(GDK_DRAWABLE_XID(window), width, height);
}
void
gdk_window_reparent (GdkWindow *window,
GdkWindow *new_parent,
gint x,
gint y)
{
GrReparentWindow(GDK_DRAWABLE_XID(window), GDK_DRAWABLE_XID(new_parent), x, y);
}
void
gdk_window_clear (GdkWindow *window)
{
g_return_if_fail (window != NULL);
g_return_if_fail (GDK_IS_WINDOW (window));
if (!GDK_DRAWABLE_DESTROYED (window))
GrClearWindow (GDK_DRAWABLE_XID (window), 0);
}
void
_gdk_windowing_window_clear_area (GdkWindow *window,
gint x,
gint y,
gint width,
gint height)
{
g_return_if_fail (window != NULL);
g_return_if_fail (GDK_IS_WINDOW (window));
if (!GDK_DRAWABLE_DESTROYED (window))
GrClearWindow (GDK_DRAWABLE_XID (window), 0);
}
void
_gdk_windowing_window_clear_area_e (GdkWindow *window,
gint x,
gint y,
gint width,
gint height)
{
g_return_if_fail (window != NULL);
g_return_if_fail (GDK_IS_WINDOW (window));
if (!GDK_DRAWABLE_DESTROYED (window))
GrClearWindow (GDK_DRAWABLE_XID (window), 1);
}
void
gdk_window_set_hints (GdkWindow *window,
gint x,
gint y,
gint min_width,
gint min_height,
gint max_width,
gint max_height,
gint flags)
{
g_message("unimplemented %s", __FUNCTION__);
}
void
gdk_window_set_geometry_hints (GdkWindow *window,
GdkGeometry *geometry,
GdkWindowHints geom_mask)
{
g_message("unimplemented %s", __FUNCTION__);
}
void
gdk_window_set_title (GdkWindow *window,
const gchar *title)
{
g_message("unimplemented %s", __FUNCTION__);
}
void
gdk_window_set_role (GdkWindow *window,
const gchar *role)
{
g_message("unimplemented %s", __FUNCTION__);
}
void
gdk_window_set_transient_for (GdkWindow *window,
GdkWindow *parent)
{
g_message("unimplemented %s", __FUNCTION__);
}
void
gdk_window_set_background (GdkWindow *window,
GdkColor *color)
{
g_return_if_fail (window != NULL);
g_return_if_fail (GDK_IS_WINDOW (window));
g_message("unimplemented %s", __FUNCTION__);
if (GDK_DRAWABLE_DESTROYED (window))
return;
}
void
gdk_window_set_back_pixmap (GdkWindow *window,
GdkPixmap *pixmap,
gboolean parent_relative)
{
g_message("unimplemented %s", __FUNCTION__);
}
void
gdk_window_set_cursor (GdkWindow *window,
GdkCursor *cursor)
{
}
void
gdk_window_get_geometry (GdkWindow *window,
gint *x,
gint *y,
gint *width,
gint *height,
gint *depth)
{
GR_WINDOW_INFO winfo;
g_return_if_fail (window == NULL || GDK_IS_WINDOW (window));
if (!window)
window = gdk_parent_root;
if (!GDK_DRAWABLE_DESTROYED (window))
{
GrGetWindowInfo(GDK_DRAWABLE_XID(window), &winfo);
if (x)
*x = winfo.x;
if (y)
*y = winfo.y;
if (width)
*width = winfo.width;
if (height)
*height = winfo.height;
if (depth)
*depth = 24;
}
}
gint
gdk_window_get_origin (GdkWindow *window,
gint *x,
gint *y)
{
g_message("unimplemented %s", __FUNCTION__);
return 0;
}
gboolean
gdk_window_get_deskrelative_origin (GdkWindow *window,
gint *x,
gint *y)
{
g_message("unimplemented %s", __FUNCTION__);
return 0;
}
void
gdk_window_get_root_origin (GdkWindow *window,
gint *x,
gint *y)
{
g_message("unimplemented %s", __FUNCTION__);
}
GdkWindow*
gdk_window_get_pointer (GdkWindow *window,
gint *x,
gint *y,
GdkModifierType *mask)
{
g_message("unimplemented %s", __FUNCTION__);
return NULL;
}
GdkWindow*
gdk_window_at_pointer (gint *win_x,
gint *win_y)
{
g_message("unimplemented %s", __FUNCTION__);
return NULL;
}
GList*
gdk_window_get_children (GdkWindow *window)
{
g_message("unimplemented %s", __FUNCTION__);
return NULL;
}
GdkEventMask
gdk_window_get_events (GdkWindow *window)
{
return -1;
}
void
gdk_window_set_events (GdkWindow *window,
GdkEventMask event_mask)
{
GrSelectEvents(GDK_DRAWABLE_XID(window), -1);
}
void
gdk_window_shape_combine_mask (GdkWindow *window,
GdkBitmap *mask,
gint x, gint y)
{
g_message("unimplemented %s", __FUNCTION__);
}
void
gdk_window_set_override_redirect (GdkWindow *window,
gboolean override_redirect)
{
g_message("unimplemented %s", __FUNCTION__);
}
void
gdk_window_set_icon (GdkWindow *window,
GdkWindow *icon_window,
GdkPixmap *pixmap,
GdkBitmap *mask)
{
g_message("unimplemented %s", __FUNCTION__);
}
void
gdk_window_set_icon_name (GdkWindow *window,
const gchar *name)
{
g_message("unimplemented %s", __FUNCTION__);
}
void
gdk_window_set_group (GdkWindow *window,
GdkWindow *leader)
{
g_message("unimplemented %s", __FUNCTION__);
}
void
gdk_window_set_decorations (GdkWindow *window,
GdkWMDecoration decorations)
{
g_message("unimplemented %s", __FUNCTION__);
}
void
gdk_window_set_functions (GdkWindow *window,
GdkWMFunction functions)
{
g_message("unimplemented %s", __FUNCTION__);
}
void
gdk_window_set_child_shapes (GdkWindow *window)
{
g_return_if_fail (window != NULL);
g_return_if_fail (GDK_IS_WINDOW (window));
g_message("unimplemented %s", __FUNCTION__);
}
void
gdk_window_merge_child_shapes (GdkWindow *window)
{
g_return_if_fail (window != NULL);
g_return_if_fail (GDK_IS_WINDOW (window));
g_message("unimplemented %s", __FUNCTION__);
}
gboolean
gdk_window_set_static_gravities (GdkWindow *window,
gboolean use_static)
{
g_message("unimplemented %s", __FUNCTION__);
return 0;
}
void
_gdk_windowing_window_get_offsets (GdkWindow *window, gint *x_offset, gint *y_offset) {
*x_offset = *y_offset = 0;
}
gboolean
_gdk_windowing_window_queue_antiexpose (GdkWindow *window, GdkRegion *area) {
return FALSE;
}

View File

@@ -68,7 +68,6 @@
#include "gdkcc.h"
#include "gdkcolor.h"
#include "gdkwin32.h"
#include "gdkinternals.h"
#define MAX_IMAGE_COLORS 256

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