Font corruption

2009-12-28 Thread Jacky Lam
Dear all,


 I am cross compiling the following GTK related libraries on ARM
platform:

 libatk 1.19.1
 cairo 1.8.8
 DirectFB 1.4.2
 glib 2.23
 gtk 2.16.6
 pango 1.26.2
 fontconfig 2.8.0
 freetype 2.3.11
 libexpat 2.0.0
 libpixman 0.17.2

 After finish compiling, I compile the attached program to display
some chinese fonts in a gtk label.

 The chinese font is displayed correctly at first, but after
scrolling, some chinese characters will be corrupted.

 The symptom has some characteristics:
 1) Only happen when the number of different chinese characters used
reached certain number.
 2) Only happen after scrolling.(Or redraw the widget).
 3) When a character is corrupted, lower half of the character is
replaced by the top half of another character.

 Is anyone meet this before or has any suggestion to start debug it?
Please help.

 I am not sure whether it is the correct place to ask for help here.
If I am wrong, please kindly direct me to right place. Thanks.

 Thanks very much.

Best Regards,
Jacky


longtext.c
Description: Binary data
___
gtk-list mailing list
gtk-list@gnome.org
http://mail.gnome.org/mailman/listinfo/gtk-list


check if gtkWindow is maximized

2009-12-28 Thread Andreas Heise
Hi,

how could I query if a GtkWindow is maximized without trigger the
window-state-event?
gdk_window_get_state seems to be not compatible?

thanks,
Andreas
___
gtk-list mailing list
gtk-list@gnome.org
http://mail.gnome.org/mailman/listinfo/gtk-list


Undo stack for GTK+ (was: Re: undo in textview)

2009-12-28 Thread Holger Berndt
Cross-posting to move the discussion to gtk-devel-list. Anybody interested
in the topic, please follow up there.

On Do, 24.09.2009 19:23, A. Walton wrote:

>It's definitely something many developers would love to see in Gtk+,
>but only a few have stepped up to the bat with patches and actually
>discussed the problem,

Why don't we take the opportunity to discuss the problem now, then? I
can start by offering my view on how an undo stack should look like,
and provide a reference implementation as a basis of discussion.

The implementation is a git branch called "undo" based on gtk+
2.19.2, and can be found at git://github.com/hb/gtk.git
I attached a cumulative (squashed) version to this mail for convenience,
to be applied onto 2.19.2.

It consists of 3 parts: A GtkUndo class, a GtkUndoView class, and a tiny
test (demo) program in tests/testundo.

The code attached to https://bugzilla.gnome.org/show_bug.cgi?id=322194
and gundo kind of go into the same direction, but fail on specific, in
my oppinion important points (mainly one or multiple of the following:
taking into account that undo and redo operations can fail, providing
human-readable descriptions, limiting stack size, nesting groups).

At the core, there should be a general undo class that should do the
stack management. Let's call it GtkUndo. This class should be derived
directly from GObject.

Basically, a user of the undo stack registers a set of callback
functions for undo and redo operations. They will get a user_data
argument, and return a true value if the undo/redo operation was
successful, or false if problems occured. If necessary, the
set can also contain a free() function to free resources associated
with the user_data.

Signals:


can-undo(boolean), can-redo(boolean)
Undo/redo changed from possible to impossible, or vice versa. Useful
for modifying e.g. menu item sensitivity according to whether the
undo/redo stacks have at least one entry or not.

changed(void)
undo and/or redo stacks have changed. Useful updating stack
information displays (e.g. a view of the complete stacks, or just
information about top level items in menus)


Properties:
===

max-length
Integer that determins the maximum length of the undo stack.
10 means the stack can have at most 10 items, 0 means the undo stack
can't be filled, -1 means it grows indefinitely.


=

The generic undo class can be regarded as the model in a MVC pattern.
So we could have a view (let's call it GtkUndoView), which is some kind
of GtkWidget, that displays a given undo and/or redo stack, and listens to the
"changed" signal. This would basically provide a journal.

The patch also contains such a view. It currently looks rather clunky, and
is in the current state mainly useful for stack inspection and debugging.


=

Outlook:

GTK+ could have a GtkUndoable interface, that every class or
widget in GTK+ that wants to provide undo/redo capabilities should
implement. The interface should just be used to tell those widgets
which GtkUndo object to use (and if any, at all).

void gtk_buildable_set_undo(GtkUndo *undo);
GtkUndo* gtk_buildable_get_undo(void);

Candidates for that would probably be at least GtkEntry and
GtkTextView (or rather their respective models).

Holger
diff --git a/gtk/Makefile.am b/gtk/Makefile.am
index 8ec9abf..1a83c22 100644
--- a/gtk/Makefile.am
+++ b/gtk/Makefile.am
@@ -335,6 +335,8 @@ gtk_public_h_sources =  \
 	gtktreeviewcolumn.h	\
 	gtktypeutils.h		\
 	gtkuimanager.h		\
+	gtkundo.h		\
+	gtkundoview.h		\
 	gtkvbbox.h		\
 	gtkvbox.h		\
 	gtkviewport.h		\
@@ -615,6 +617,8 @@ gtk_base_c_sources =\
 	gtktypebuiltins.c	\
 	gtktypeutils.c		\
 	gtkuimanager.c		\
+	gtkundo.c		\
+	gtkundoview.c		\
 	gtkvbbox.c		\
 	gtkvbox.c		\
 	gtkvolumebutton.c	\
diff --git a/gtk/gtk.h b/gtk/gtk.h
index 07952be..6986105 100644
--- a/gtk/gtk.h
+++ b/gtk/gtk.h
@@ -203,6 +203,8 @@
 #include 
 #include 
 #include 
+#include 
+#include 
 #include 
 #include 
 #include 
diff --git a/gtk/gtkundo.c b/gtk/gtkundo.c
new file mode 100644
index 000..c51e3a9
--- /dev/null
+++ b/gtk/gtkundo.c
@@ -0,0 +1,888 @@
+/* gtkundo.c
+ * Copyright (C) 2009  Holger Berndt 
+ *
+ * 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, I

Re: Problems with GSocketService

2009-12-28 Thread Ali Polatel
Ali Polatel yazmış:
> I'm trying to implement a server using GSocketService but I faced some
> problems. The code is here¹.
> 
> The binding and listening for connections seem to work fine.
> The problem is when a client connects, the g_input_stream_read_finish()
> function in event_got_data returns error:
> Read failed: Socket is already closed
> 
> I'll be happy if someone can take a look.
> 
> ¹: http://paste.pocoo.org/raw/160099/

Answering myself, I had to call g_object_ref() on the GSocketConnection so
that it doesn't go dead :-]

-- 
Regards,
Ali Polatel


pgpnbdLAe0m5R.pgp
Description: PGP signature
___
gtk-list mailing list
gtk-list@gnome.org
http://mail.gnome.org/mailman/listinfo/gtk-list


Re: What, in detail, the GDK do?

2009-12-28 Thread Artur Galyamov
28.12.09, 12:46, "frederico schardong" :
> >gdk wraps the business of creating a window and getting events
> only a window or all the widgets?

Everything below GTK+ is just to make things cross-platform.

GTK+ widgets do use GDK windows and other primitives. GDK is a
thin layer that provides same interface to windowing system (X11,
GDI, Quartz, etc.) on all platforms supported. Its interface is
very close to Xlib, and wraps some functionality described at
freedesktop.org on platforms that do not conform freedesktop.org
standards.

GDK primitives are: real windows and events, off-screen pixel
buffers, selections (low-level clipboard), drag-n-drop (again,
low-level), keyboard, pointer, other input devices. [1]

Shortly, GTK+ widgets use GDK for interaction, cairo for (custom)
painting, pango for painting text. GLib [2] is extended cross-
platform version of clib, plus ADT, OO, utf-8, io, etc.
GTK+ and GDK do use GLib, pango and cairo do not.

Moreover, GDK, pango and cairo do not form strict hierarchy --
they all have many backends and may cooperate in different ways
on different platforms or applications. (i'm not sure whether
this is true for GTK+ implementation, however)

[1] http://library.gnome.org/devel/gdk/stable/
[2] http://library.gnome.org/devel/glib/stable/

-- 
Artur
___
gtk-list mailing list
gtk-list@gnome.org
http://mail.gnome.org/mailman/listinfo/gtk-list


Benchmark test

2009-12-28 Thread frederico schardong
Hi,

Does anyone know about benchmark testing GTK in C and it
bindings(PyGTK, PHPGtk, etc..)? I've searched but not found nothing.

-- 
Thanks,
Frederico Schardong,
SOLIS - Open source solutions
www.solis.coop.br
Linux registered user #500582
___
gtk-list mailing list
gtk-list@gnome.org
http://mail.gnome.org/mailman/listinfo/gtk-list


Re: What, in detail, the GDK do?

2009-12-28 Thread Ed James
A good book on programming for the X Window System  is "Xlib Programming
Manual" by Adrian Nye (O'Reilly & Associates, Inc").  I've been using it to
try building my own object-oriented "toolkit" using C++.  My stuff will never
be "production quality", but it really helps understand what is happening
at low levels.

Ed James

2009/12/28 David Nečas :
...
> I'm afraid to understand what Gdk does cannot be understood without
> understading the basic X window system concepts.  Because essentially
...
___
gtk-list mailing list
gtk-list@gnome.org
http://mail.gnome.org/mailman/listinfo/gtk-list


Re: Glib cross compilation

2009-12-28 Thread David Nečas
On Mon, Dec 28, 2009 at 06:41:30PM +0530, Niamathullah sharief wrote:
> i am compilaing and glib for my ARM baord and i am getting one error
> see
> 
> *checking for format to printf and scanf a guint64... none
> checking for an ANSI C-conforming const... yes
> checking if malloc() and friends prototypes are gmem.h compatible... yes
> checking for growing stack pointer... configure: error: in
> `/mnt/freescale/sources/glib-2.22.0':
> configure: error: cannot run test program while cross compiling
> See `config.log' for more details.
> Configuration of glib library has failed
> *
> *shar...@sharief-desktop:/mnt/freescale/sources/glib-2.22.0$*
> *
> *
> can anyone help me..what is this? and how to clear that?

This should help you:

http://library.gnome.org/devel/glib/stable/glib-cross-compiling.html

especially the part about glib_cv_stack_grows, but apparently you
haven't read it at all.

Yeti

___
gtk-list mailing list
gtk-list@gnome.org
http://mail.gnome.org/mailman/listinfo/gtk-list


Re: What, in detail, the GDK do?

2009-12-28 Thread David Nečas
On Mon, Dec 28, 2009 at 12:46:36PM -0200, frederico schardong wrote:
> >gdk wraps the business of creating a window and getting events
> 
> only a window or all the widgets?

X (or Gdk) Window is a thing that can receive events and/or can be
drawn on.  Many widgets have their own windows, for instance, text
entries or menus.

I'm afraid to understand what Gdk does cannot be understood without
understading the basic X window system concepts.  Because essentially
all Gdk does is providing platform-independent abstraction of these
concepts (plus some other low-level utilities).

Yeti

___
gtk-list mailing list
gtk-list@gnome.org
http://mail.gnome.org/mailman/listinfo/gtk-list


Re: What, in detail, the GDK do?

2009-12-28 Thread frederico schardong
>gdk wraps the business of creating a window and getting events

only a window or all the widgets?

2009/12/28  :
> 2009/12/28 frederico schardong :
>> So how low level GDK goes? It renders the widgets according the OS?
>> Where GTK+ ends and GDK starts? Where GDK ends and GLib starts?
>
> You can read about it here:
>
> http://www.gtk.org/documentation.html
>
> gdk wraps the business of creating a window and getting events, cairo
> does low-level drawing, glib does data structures, utility functions
> and event loops, gobject is the object model, pango renders text,
> gdkpixbuf loads and transforms images, gtk issues all the drawing
> commands to display widgets, your application does everything else.
>
> John
>



-- 
Thanks,
Frederico Schardong,
SOLIS - Open source solutions
www.solis.coop.br
Linux registered user #500582
___
gtk-list mailing list
gtk-list@gnome.org
http://mail.gnome.org/mailman/listinfo/gtk-list


Glib cross compilation

2009-12-28 Thread Niamathullah sharief
i am compilaing and glib for my ARM baord and i am getting one error
see

*checking for format to printf and scanf a guint64... none
checking for an ANSI C-conforming const... yes
checking if malloc() and friends prototypes are gmem.h compatible... yes
checking for growing stack pointer... configure: error: in
`/mnt/freescale/sources/glib-2.22.0':
configure: error: cannot run test program while cross compiling
See `config.log' for more details.
Configuration of glib library has failed
*
*shar...@sharief-desktop:/mnt/freescale/sources/glib-2.22.0$*
*
*
can anyone help me..what is this? and how to clear that?
___
gtk-list mailing list
gtk-list@gnome.org
http://mail.gnome.org/mailman/listinfo/gtk-list


Re: What, in detail, the GDK do?

2009-12-28 Thread jcupitt
2009/12/28 frederico schardong :
> So how low level GDK goes? It renders the widgets according the OS?
> Where GTK+ ends and GDK starts? Where GDK ends and GLib starts?

You can read about it here:

http://www.gtk.org/documentation.html

gdk wraps the business of creating a window and getting events, cairo
does low-level drawing, glib does data structures, utility functions
and event loops, gobject is the object model, pango renders text,
gdkpixbuf loads and transforms images, gtk issues all the drawing
commands to display widgets, your application does everything else.

John
___
gtk-list mailing list
gtk-list@gnome.org
http://mail.gnome.org/mailman/listinfo/gtk-list


Problems with GSocketService

2009-12-28 Thread Ali Polatel
I'm trying to implement a server using GSocketService but I faced some
problems. The code is here¹.

The binding and listening for connections seem to work fine.
The problem is when a client connects, the g_input_stream_read_finish()
function in event_got_data returns error:
Read failed: Socket is already closed

I'll be happy if someone can take a look.

¹: http://paste.pocoo.org/raw/160099/

-- 
Regards,
Ali Polatel


pgpX4yeUHQW4e.pgp
Description: PGP signature
___
gtk-list mailing list
gtk-list@gnome.org
http://mail.gnome.org/mailman/listinfo/gtk-list