2 linphone, gtk-glade interface.
3 Copyright (C) 2008 Simon MORLAT (simon.morlat@linphone.org)
5 This program is free software; you can redistribute it and/or
6 modify it under the terms of the GNU General Public License
7 as published by the Free Software Foundation; either version 2
8 of the License, or (at your option) any later version.
10 This program is distributed in the hope that it will be useful,
11 but WITHOUT ANY WARRANTY; without even the implied warranty of
12 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
13 GNU General Public License for more details.
15 You should have received a copy of the GNU General Public License
16 along with this program; if not, write to the Free Software
17 Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
22 static void run_gtk(){
23 while (gtk_events_pending ())
24 gtk_main_iteration ();
28 void *linphone_gtk_wait(LinphoneCore *lc, void *ctx, LinphoneWaitingState ws, const char *purpose, float progress){
31 case LinphoneWaitingStart:
33 w=linphone_gtk_create_window("waiting");
34 gtk_window_set_transient_for(GTK_WINDOW(w),GTK_WINDOW(linphone_gtk_get_main_window()));
35 gtk_window_set_position(GTK_WINDOW(w),GTK_WIN_POS_CENTER_ON_PARENT);
37 gtk_progress_bar_set_text(
38 GTK_PROGRESS_BAR(linphone_gtk_get_widget(w,"progressbar")),
42 /*g_message("Creating waiting window");*/
47 case LinphoneWaitingProgress:
51 gtk_progress_bar_set_fraction(
52 GTK_PROGRESS_BAR(linphone_gtk_get_widget(w,"progressbar")),
57 gtk_progress_bar_pulse(
58 GTK_PROGRESS_BAR(linphone_gtk_get_widget(w,"progressbar"))
61 /*g_message("Updating progress");*/
67 case LinphoneWaitingFinished:
70 gtk_widget_destroy(w);
79 GdkPixbuf *_gdk_pixbuf_new_from_memory_at_scale(const void *data, gint len, gint w, gint h, gboolean preserve_ratio){
80 GInputStream *stream=g_memory_input_stream_new_from_data (data,len,NULL);
83 GdkPixbuf *pbuf=gdk_pixbuf_new_from_stream_at_scale (stream,w,h,preserve_ratio,NULL,&error);
84 g_input_stream_close(stream,NULL,NULL);
85 g_object_unref(G_OBJECT(stream));
87 g_warning("Could not open image from memory");
92 GtkWidget * _gtk_image_new_from_memory_at_scale(const void *data, gint len, gint w, gint h, gboolean preserve_ratio){
94 GdkPixbuf *pbuf=_gdk_pixbuf_new_from_memory_at_scale(data,len,w,h,preserve_ratio);
95 if (pbuf==NULL) return NULL;
96 image=gtk_image_new_from_pixbuf(pbuf);
97 g_object_unref(G_OBJECT(pbuf));