RE:Reducing GTK+ footprint



Hi
        May be the following is also a way to strip the foot print.
Instead of glibc, use dietlibc, it will reduce a lot of foot print. I
don't know you are working on embedded devices. Even it is very easy to
use also.


http://www.fefe.de/dietlibc/



With regds,

Shyjumon N 
TTEC
Tel: +91-80-4180-3500 Extn. 3273 
Mobile: +91-9945006965

-----Original Message-----
From: gtk-app-devel-list-bounces gnome org
[mailto:gtk-app-devel-list-bounces gnome org] On Behalf Of
gtk-app-devel-list-request gnome org
Sent: Wednesday, January 24, 2007 6:24 PM
To: gtk-app-devel-list gnome org
Subject: gtk-app-devel-list Digest, Vol 33, Issue 36

Send gtk-app-devel-list mailing list submissions to
        gtk-app-devel-list gnome org

To subscribe or unsubscribe via the World Wide Web, visit
        http://mail.gnome.org/mailman/listinfo/gtk-app-devel-list
or, via email, send a message with subject or body 'help' to
        gtk-app-devel-list-request gnome org

You can reach the person managing the list at
        gtk-app-devel-list-owner gnome org

When replying, please edit your Subject line so it is more specific
than "Re: Contents of gtk-app-devel-list digest..."


Today's Topics:

   1. capture window for printing (Fabian F?rg)
   2. combobox question (Clint Barlow)
   3. gtk_print_operation_run warnings (Micah Carrick)
   4. Reducing GTK+ footprint (richa soc-soft com)
   5. RE: Reducing GTK+ footprint (Madhusudan E)
   6. Re: Reducing GTK+ footprint (Attilio Fiandrotti)
   7. RE: Reducing GTK+ footprint (richa soc-soft com)
   8. Re: Reducing GTK+ footprint (Tor Lillqvist)
   9. Help ( Regarding  Tailoring of GTK+ ) (Tor Lillqvist)


----------------------------------------------------------------------

Message: 1
Date: Tue, 23 Jan 2007 19:40:29 +0100
From: Fabian F?rg <fabian foerg gmx de>
Subject: capture window for printing
To: gtk-app-devel-list gnome org
Message-ID: <45B6569D 8000100 gmx de>
Content-Type: text/plain; charset=ISO-8859-1; format=flowed

Hello,

as the topic suggests, I am trying to capture a window which should be 
printed afterwards.

This is my code:

/* appl_t is a struct created by me which contains "GtkWidget
*print_win",
 * the window I want to print. Moreover, appl_t contains gints for the
 * width and height of the window */

/* callback for my print button */
static void print_cb(appl_t * appl)
{
    values_t *val = &appl->values;
    GtkPrintOperation *op;
    GtkPrintOperationResult res;

    output_print(appl); /* This function creates the window which I want

to print */

    op = gtk_print_operation_new();

    gtk_print_operation_set_n_pages(op, 1);
    gtk_print_operation_set_unit(op, GTK_UNIT_MM);
    g_signal_connect(op, "draw_page", G_CALLBACK(draw_page), appl);
    res =
        gtk_print_operation_run(op,
GTK_PRINT_OPERATION_ACTION_PRINT_DIALOG,
                    NULL, NULL);
    }
}

static void draw_page(GtkPrintOperation * operation,
              GtkPrintContext * print_context, gint page_nr,
              appl_t * appl)
{
    gdouble print_width, print_height, scale;
    cairo_t *cr, *cr_win;
    cairo_surface_t *surface;
    values_t *val = &appl->values;

    /* create a surface of the print window */
    cr_win = gdk_cairo_create(appl->print_win->window);

    /* get width and height of the print window */
    gdk_drawable_get_size(appl->print_win->window, &(val->width), 
&(val->height));

    gtk_widget_hide_all(appl->print_win);

    /* create the cairo surface for cr_win */
    surface = cairo_get_target(cr_win);
    cairo_surface_reference(surface);
    cairo_destroy(cr_win);

    /* get width and heigth of print_context */
    print_width = gtk_print_context_get_width(print_context);
    print_height = gtk_print_context_get_height(print_context);

    /* transform the print_context into a cairo_context */
    cr = gtk_print_context_get_cairo_context(print_context);

    scale = (gdouble) print_width / val->width;

    /* scale, keep aspect ratio */
    cairo_scale(cr, scale, scale);

    cairo_set_source_surface(cr, surface, 0., 0.);
    cairo_surface_destroy(surface);

    cairo_paint(cr);
}

The problem is that the window is often captured with the print dialog.
Furthermore, the window is sometimes "incomplete". The PDF/PS output 
shows just parts of the window - it seems that print_win is captured 
before it is completely rendered.

Questions:
- Are there any better ways to achieve what I want?
- Can I capture the window without showing it?

Regards,
Fabian


------------------------------

Message: 2
Date: Tue, 23 Jan 2007 16:01:32 -0600
From: "Clint Barlow" <ceilingzero gmail com>
Subject: combobox question
To: gtk-app-devel-list gnome org
Message-ID:
        <26eea0960701231401q730d82d4r2758897896cdb274 mail gmail com>
Content-Type: text/plain; charset=ISO-8859-1; format=flowed

Hi everyone,
I have a combobox that I am creating with gtk_combo_box_new_text().  Is
there a way to change the background color to something other than gray?

Thanks-
Clint


------------------------------

Message: 3
Date: Tue, 23 Jan 2007 20:52:16 -0800
From: Micah Carrick <email micahcarrick com>
Subject: gtk_print_operation_run warnings
To: gtk-app-devel-list <gtk-app-devel-list gnome org>
Message-ID: <45B6E600 4050705 micahcarrick com>
Content-Type: text/plain; charset=ISO-8859-1; format=flowed

Can anybody help me with the following errors?

** (printing:10547): WARNING **: Error getting printer list: Too many 
failed attempts

** (printing:10547): WARNING **: Error result: Too many failed attempts

These 2 warning are output whenever the print dialog recieves a mouse 
click on any widget in the window. The dialog returns 
GTK_PRINT_OPERATION_RESULT_APPLY and the print operation is a success, 
but still those warnings have me curious. I do not have a printer 
installed but am using the "Print to file" printer.

Dialog was run using:

res = gtk_print_operation_run (operation, 
GTK_PRINT_OPERATION_ACTION_PRINT_DIALOG, 
                                 GTK_WINDOW (w->window), &error);


-- 
- Micah Carrick
  Developer - http://www.micahcarrick.com | http://www.gtkforums.com
  



------------------------------

Message: 4
Date: Wed, 24 Jan 2007 16:47:48 +0530
From: <richa soc-soft com>
Subject: Reducing GTK+ footprint
To: <gtk-app-devel-list gnome org>
Message-ID:
        <4BF47D56A0DD2346A1B8D622C5C5902C022E4CBA soc-mail soc-soft com>
Content-Type: text/plain; charset="us-ascii"

Greetings, 

 

Can any one tell me or give me some links to know how I can reduce the
footprint of GTK. 

 

Actually I want to remove some widgets (like frame, color selection,
file selection etc) which I am not using in my application. 

 

Also I want to know that if there is any other alternate way to reduce
the GTK footprint.

 

Regards,

 

Richa

 


------------------------------

Message: 5
Date: Wed, 24 Jan 2007 16:56:09 +0530
From: Madhusudan E <madhusudan huawei com>
Subject: RE: Reducing GTK+ footprint
To: richa soc-soft com, gtk-app-devel-list gnome org
Message-ID: <00d601c73faa$72a42a20$3714120a china huawei com>
Content-Type: text/plain; charset=us-ascii

Hi, 
I am not sure, to what level you want to strip the GTK Widgets and also
the
purpose behind it.
To port GTK over Mobile phones LiPS forum is trying to strip the
unwanted
widgets by applying a Patch to GTK.
Maybe you can apply LiPS patch to get rid of most of the unwanted and
redundant widget. 
There is another work around. Just set flags on these widgets in
Makefile
and also on Gtk Code wherever required.
My advice, Follow LiPS patch.

Hope, this helps in some way

Rgds,
Madhu



 
-----Original Message-----
From: gtk-app-devel-list-bounces gnome org
[mailto:gtk-app-devel-list-bounces gnome org] On Behalf Of
richa soc-soft com
Sent: Wednesday, January 24, 2007 4:48 PM
To: gtk-app-devel-list gnome org
Subject: Reducing GTK+ footprint

Greetings, 

 

Can any one tell me or give me some links to know how I can reduce the
footprint of GTK. 

 

Actually I want to remove some widgets (like frame, color selection,
file selection etc) which I am not using in my application. 

 

Also I want to know that if there is any other alternate way to reduce
the GTK footprint.

 

Regards,

 

Richa

 





------------------------------

Message: 6
Date: Wed, 24 Jan 2007 12:38:38 +0100
From: Attilio Fiandrotti <attilio fiandrotti gmail com>
Subject: Re: Reducing GTK+ footprint
To: gtk-app-devel-list gnome org
Message-ID: <45B7453E 9060606 gmail com>
Content-Type: text/plain; charset=us-ascii; format=flowed

richa soc-soft com wrote:
Greetings, 

 

Can any one tell me or give me some links to know how I can reduce the
footprint of GTK. 

 

Actually I want to remove some widgets (like frame, color selection,
file selection etc) which I am not using in my application. 

 

Also I want to know that if there is any other alternate way to reduce
the GTK footprint.

not sure if this is what you mean, but in the debian-installer (hich is 
gtk/dfb based) we provide a set of stripped libraries using the mklibs
tool.
This allows us to save up vakuable space on installation media.

regards

Attilio


------------------------------

Message: 7
Date: Wed, 24 Jan 2007 17:45:24 +0530
From: <richa soc-soft com>
Subject: RE: Reducing GTK+ footprint
To: <attilio fiandrotti gmail com>
Cc: gtk-app-devel-list gnome org
Message-ID:
        <4BF47D56A0DD2346A1B8D622C5C5902C022E4D0A soc-mail soc-soft com>
Content-Type: text/plain;       charset="us-ascii"

Hi...

Ya even our requirement is to save the space on installation media.

Can't we get a copy of mklibs tool for FC5 / FC6 as we cant use that
debian-installer.

Regards,

Richa



-----Original Message-----
From: Attilio Fiandrotti [mailto:attilio fiandrotti gmail com] 
Sent: Wednesday, January 24, 2007 5:09 PM
To: gtk-app-devel-list gnome org
Cc: Richa Mahajan
Subject: Re: Reducing GTK+ footprint

richa soc-soft com wrote:
Greetings, 

 

Can any one tell me or give me some links to know how I can reduce the
footprint of GTK. 

 

Actually I want to remove some widgets (like frame, color selection,
file selection etc) which I am not using in my application. 

 

Also I want to know that if there is any other alternate way to reduce
the GTK footprint.

not sure if this is what you mean, but in the debian-installer (hich is 
gtk/dfb based) we provide a set of stripped libraries using the mklibs
tool.
This allows us to save up vakuable space on installation media.

regards

Attilio


------------------------------

Message: 8
Date: Wed, 24 Jan 2007 14:28:54 +0200
From: Tor Lillqvist <tml iki fi>
Subject: Re: Reducing GTK+ footprint
To: <gtk-app-devel-list gnome org>
Message-ID: <17847 20742 902000 379976 gargle gargle HOWL>
Content-Type: text/plain; charset=us-ascii

richa soc-soft com writes:
Can any one tell me or give me some links to know how I can reduce
the
footprint of GTK. 

Do you mean disk space? Or memory space? On what platform? On most
modern platforms with virtual memory, presumably only those parts of
GTK+ that your code actually uses get paged in.

Anyway, how hard can it be to experiment? Drop stuff you don't want
from the gtk Makefile(.am), try to build gtk+, and see what further
(small?) changes are needed to successfully produce a leaner gtk+
shared library. If you do this and distribute your resulting binaries,
make sure to use a different name for your shared libraries to avoid
confusion!

--tml


------------------------------

Message: 9
Date: Wed, 24 Jan 2007 14:53:36 +0200
From: Tor Lillqvist <tml iki fi>
Subject: Help ( Regarding  Tailoring of GTK+ )
To: <pushpalata patil soc-soft com>
Cc: gtk-app-devel-list gnome org
Message-ID: <17847 22224 90000 338027 gargle gargle HOWL>
Content-Type: text/plain; charset=iso-8859-1

pushpalata patil soc-soft com writes:
We are developing an application (Embedded) using GTK and
Glade(gtk-dev-2.10.6-win32-1), MSYS-1.0.9, MinGW-3.1.0-1.

Please don't send me personal mail about GTK+ on Windows. Use an
appropriate mailing list, gtk-app-devel-list gnome org  (You must be
subscribed in order to post to the list, see
http://mail.gnome.org/mailman/listinfo/gtk-app-devel-list .)

For our embedded application, the memory footprint allowed, maximum
it
can be 2MB.

That sounds awfully tight.

a) We calculated footprint for small application on Windows. It boils
down to around 7.3MB.

DLL                                   |Size (KBs)
--------------------------------------+-----------
libatk-1.0-0.dll????????????????      |138
libglib-2.0-0.dll????????????????     |614
iconv.dll??????????????????????????   |872
intl.dll??????????????????????????????|44
libgobject-2.0-0.dll??????????        |222
libgdk_pixbuf-2.0-0.dll????           |91
libgmodule-2.0-0.dll???????           |17
libgtk-win32-2.0-0.dll?????           |3085
libgdk-win32-2.0-0.dll????            |657
libcairo-2.dll???????????????????     |428
libpng13.dll????????????????????      |199
zlib1.dll??????????????????????????   |80
libpango-1.0-0.dll? ??????            |220
libpangocairo-1.0-0.dll               |38
libpangowin32-1.0-0.dll???????????    |58
GTK Images loaders                    |256
Theme engine                          |~ 300 (max)
--------------------------------------+-----------
TOTAL                                 |~7319

This is not the *memory* footprint you mentioned above. It is the size
on *disk* of the DLLs, which is quite another thing.

b) On Linux it is 5.3MB

.so                                    |Size (KBs)
---------------------------------------+----------
libgtk-x11-2.0 so??????????????        |3100
libgdk-2.0.so???????????               |554.2
libatk-1.0.so??????????????????????????|109.7
libgdk_pixbuf.so                       |92.6
libgobject-2.0.so??????????            |253.1
libgmodule-2.0.so                      |11.3
libpango-1.0.so                        |245.6
libcairo.so?????                       |329.4
libpangocairo-1.0.so????               |32.9
libglib.so???????????????????          |584.2
---------------------------------------+----------
TOTAL                                  |~5310

You forget to include here the png and zlib libraries and image
loaders, if this list is supposed to be comparable. And anyway, just
looking at the DLL and .so sizes is mostly an exercise in futility.

We wanted to remove the widgets which are not required by our
application. Is their any procedure to reduce footprint of GTK+,
where
we can trim down gtk, gdk, glib, pango, Cairo???

You presumably do this as part of your *work*? I mean, like, you get
paid to do this? I don't. Why don't you experiment? Why don't you have
a look at what other companies have done to put gtk+ (and GNOME) on
embedded devices. maemo.org is one place to look at.

--tml


------------------------------

_______________________________________________
gtk-app-devel-list mailing list
gtk-app-devel-list gnome org
http://mail.gnome.org/mailman/listinfo/gtk-app-devel-list

End of gtk-app-devel-list Digest, Vol 33, Issue 36
**************************************************
The information contained in this e-mail message and in any annexure is confidential to the  recipient and 
may contain privileged information. If you are not the intended recipient, please notify the sender and 
delete the message along with any annexure. You should not disclose, copy or otherwise use the information 
contained
in the message or any annexure. Any views expressed in this e-mail are those of the individual sender except 
where the sender specifically states them to be the views of SoCrates Software India Pvt Ltd., Bangalore.


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]