13
13
* GNU General Public License for more details.
15
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.
20
* GnomeMeeting is licensed under the GPL license and as a special exception,
16
* along with this program; if not, write to the Free Software Foundation,
17
* Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA.
20
* Ekiga is licensed under the GPL license and as a special exception,
21
21
* you have permission to link or otherwise combine this program with the
22
* programs OpenH323 and Pwlib, and distribute the combination, without
23
* applying the requirements of the GNU GPL to the OpenH323 program, as long
24
* as you do follow the requirements of the GNU GPL for all the rest of the
25
* software thus combined.
22
* programs OPAL, OpenH323 and PWLIB, and distribute the combination,
23
* without applying the requirements of the GNU GPL to the OPAL, OpenH323
24
* and PWLIB programs, as long as you do follow the requirements of the
25
* GNU GPL for all the rest of the software thus combined.
1161
1161
gnomemeeting_addressbook_get_contacts (NULL, nbr,
1162
FALSE, NULL, NULL, NULL, "*");
1162
FALSE, NULL, NULL, NULL, NULL, "*");
1163
1163
gm_main_window_speed_dials_menu_update (main_window, glist);
1164
1164
g_slist_foreach (glist, (GFunc) gmcontact_delete, NULL);
1165
1165
g_slist_free (glist);
1462
1462
FALSE, FALSE, 0);
1464
1464
small_vbox = gtk_vbox_new (0, FALSE);
1465
mw->adj_output_volume = gtk_adjustment_new (0, 0.0, 100.0, 1.0, 5.0, 1.0);
1465
mw->adj_output_volume = gtk_adjustment_new (0, 0.0, 101.0, 1.0, 5.0, 1.0);
1466
1466
hscale_play = gtk_hscale_new (GTK_ADJUSTMENT (mw->adj_output_volume));
1467
1467
gtk_range_set_update_policy (GTK_RANGE (hscale_play),
1468
1468
GTK_UPDATE_DELAYED);
1483
1483
FALSE, FALSE, 0);
1485
1485
small_vbox = gtk_vbox_new (0, FALSE);
1486
mw->adj_input_volume = gtk_adjustment_new (0, 0.0, 100.0, 1.0, 5.0, 1.0);
1486
mw->adj_input_volume = gtk_adjustment_new (0, 0.0, 101.0, 1.0, 5.0, 1.0);
1487
1487
hscale_rec = gtk_hscale_new (GTK_ADJUSTMENT (mw->adj_input_volume));
1488
1488
gtk_range_set_update_policy (GTK_RANGE (hscale_rec),
1489
1489
GTK_UPDATE_DELAYED);
2523
2524
int video_frame_rwidth = 0;
2524
2525
int video_frame_rheight = 0;
2526
/* some things for the BOTH_INCRUSTED mode: */
2527
/* BOTH_INCRUSTED config */
2527
2528
/* the small pic's ratio (to the main video frame */
2528
const float incrusted_small_pic_ratio = 0.33;
2529
const float incr_lratio = 0.33;
2529
2530
/* position of the small pic in % of width and height of the main
2531
const float incrusted_small_pic_relative_posx = 0.66;
2532
const float incrusted_small_pic_relative_posy = 0.66;
2531
* video frame (incrusted-relative-localpic-posx/y) */
2532
const float incr_rel_lposx = 0.66;
2533
const float incr_rel_lposy = 0.66;
2533
2534
/* forced minimum distances of the small pic to the main frame border right
2535
const int incrusted_small_pic_forced_border_right = 3;
2536
const int incrusted_small_pic_forced_border_down = 5;
2535
* and down (incrusted-border-localpic-right/down) */
2536
const int incr_brd_lright = 3;
2537
const int incr_brd_ldown = 5;
2537
2538
/* assumed thickness of the small frame for the local video (used to
2538
* calculate scale of the local video image) */
2539
const int incrusted_small_pic_assumed_frame_thickness = 4;
2539
* calculate scale of the local video image)
2540
* (incrusted-localpic-frame-thickness */
2542
const int incr_lfrm_thick = 2;
2541
2544
/* some preinits */
2542
int incrusted_frame_width = 0;
2543
int incrusted_frame_height = 0;
2545
int incr_frame_width = 0;
2546
int incr_frame_height = 0;
2545
2548
int small_frame_absposx = 0;
2546
2549
int small_frame_absposy = 0;
2548
int incrusted_resulting_width = 0;
2549
int incrusted_resulting_height = 0;
2550
int incrusted_max_resulting_width = 0;
2551
int incrusted_max_resulting_height = 0;
2551
int incr_resulting_width = 0;
2552
int incr_resulting_height = 0;
2553
int incr_max_resulting_width = 0;
2554
int incr_max_resulting_height = 0;
2554
2557
/* FULLSCREEN config */
2564
2567
gboolean display_both_side = FALSE;
2565
2568
gboolean display_both_incrusted = FALSE;
2566
2569
gboolean fs_active = FALSE;
2567
/* when the GtkFrame was just created, it has a zero size, but we are
2568
* requested to already render...
2569
* used to prevent drawing when the frame isn't ready built (width,height==0,0) */
2570
gboolean video_frame_ready = TRUE;
2572
2571
/* resize the video frame to the requested size, depending on what we want
2574
2573
switch (display_type) {
2575
2574
case LOCAL_VIDEO:
2576
gtk_widget_set_size_request (GTK_WIDGET (mw->video_frame),
2575
gtk_widget_set_size_request (GTK_WIDGET (mw->main_video_image),
2577
2576
(int) (lf_width * lzoom),
2578
2577
(int) (lf_height * lzoom)); break;
2579
2578
case REMOTE_VIDEO:
2580
gtk_widget_set_size_request (GTK_WIDGET (mw->video_frame),
2579
gtk_widget_set_size_request (GTK_WIDGET (mw->main_video_image),
2581
2580
(int) (rf_width * rzoom),
2582
2581
(int) (rf_height * rzoom)); break;
2583
2582
case BOTH_INCRUSTED:
2584
gtk_widget_set_size_request (GTK_WIDGET (mw->video_frame),
2583
gtk_widget_set_size_request (GTK_WIDGET (mw->main_video_image),
2585
2584
(int) (rf_width * rzoom),
2586
2585
(int) (rf_height * rzoom)); break;
2587
2586
case BOTH_SIDE:
2588
gtk_widget_set_size_request (GTK_WIDGET (mw->video_frame),
2587
gtk_widget_set_size_request (GTK_WIDGET (mw->main_video_image),
2589
2588
(int) (rf_width * rzoom * 2),
2590
2589
(int) (rf_height * rzoom)); break;
2595
2594
if (display_type == FULLSCREEN) fs_active = TRUE;
2597
2596
/* get the actual size of the video frame */
2598
video_frame_width = GTK_WIDGET (mw->main_video_image)->allocation.width;
2599
video_frame_height = GTK_WIDGET (mw->main_video_image)->allocation.height;
2597
video_frame_width = PMAX (GM_QCIF_WIDTH, GTK_WIDGET (mw->main_video_image)->allocation.width);
2598
video_frame_height = PMAX (GM_QCIF_HEIGHT, GTK_WIDGET (mw->main_video_image)->allocation.height);
2600
2599
/* compute reduced values, reductions are fixed,
2601
2600
* we will use THESE values as base to scale the images */
2602
2601
video_frame_rwidth = video_frame_width;
2603
2602
video_frame_rheight = video_frame_height;
2605
if (video_frame_rwidth < 0)
2606
{ video_frame_ready = FALSE; video_frame_rwidth = video_frame_width; };
2607
if (video_frame_rheight < 0)
2608
{ video_frame_ready = FALSE; video_frame_rheight = video_frame_height; };
2610
2604
/* Update the display selection in the main and in the video popup menus */
2611
2605
gtk_radio_menu_select_with_id (mw->main_menu, "local_video", display_type);
2615
2608
if (!fs_active)
2616
2609
gm_mw_destroy_fullscreen_video_window (main_window);
2760
2754
case BOTH_INCRUSTED:
2762
if (zlsrc_pic && zrsrc_pic && video_frame_ready) {
2756
if (zlsrc_pic && zrsrc_pic) {
2764
2758
/* get the frame out of XPM data */
2765
framepixbuf = gdk_pixbuf_new_from_xpm_data ((const char **) gm_both_incrusted_frame_xpm);
2760
gdk_pixbuf_new_from_xpm_data ((const char **) gm_both_incrusted_frame_xpm);
2767
incrusted_frame_width = gdk_pixbuf_get_width (framepixbuf);
2768
incrusted_frame_height = gdk_pixbuf_get_height (framepixbuf);
2762
incr_frame_width = gdk_pixbuf_get_width (framepixbuf);
2763
incr_frame_height = gdk_pixbuf_get_height (framepixbuf);
2770
2765
/* compute the position of the small frame */
2771
2766
small_frame_absposx =
2772
(int) (video_frame_rwidth * incrusted_small_pic_relative_posx);
2767
(int) (video_frame_rwidth * incr_rel_lposx);
2773
2768
small_frame_absposy =
2774
(int) (video_frame_rheight * incrusted_small_pic_relative_posy);
2769
(int) (video_frame_rheight * incr_rel_lposy);
2776
2771
/* scale the local pic down to fit inside the frame */
2778
2773
gdk_pixbuf_scale_simple (zlsrc_pic,
2779
incrusted_frame_width - (2 * incrusted_small_pic_assumed_frame_thickness),
2780
incrusted_frame_height - (2 * incrusted_small_pic_assumed_frame_thickness),
2774
incr_frame_width - (2 * incr_lfrm_thick),
2775
incr_frame_height - (2 * incr_lfrm_thick),
2781
2776
bilinear_filtering?GDK_INTERP_BILINEAR:GDK_INTERP_NEAREST);
2783
2778
/* copy the local pic inside the frame */
2784
2779
gdk_pixbuf_copy_area (nzlsrc_pic,
2786
gdk_pixbuf_get_width (nzlsrc_pic) - incrusted_small_pic_assumed_frame_thickness,
2787
gdk_pixbuf_get_height (nzlsrc_pic) - incrusted_small_pic_assumed_frame_thickness,
2781
gdk_pixbuf_get_width (nzlsrc_pic) - incr_lfrm_thick,
2782
gdk_pixbuf_get_height (nzlsrc_pic) - incr_lfrm_thick,
2789
incrusted_small_pic_assumed_frame_thickness, incrusted_small_pic_assumed_frame_thickness);
2784
incr_lfrm_thick, incr_lfrm_thick);
2791
2786
/* scale the frame plus the picture to the requested size */
2792
2787
tmpframe = gdk_pixbuf_scale_simple (framepixbuf,
2793
(int) (video_frame_rwidth * incrusted_small_pic_ratio),
2794
(int) (video_frame_rheight * incrusted_small_pic_ratio),
2788
(int) (video_frame_rwidth * incr_lratio),
2789
(int) (video_frame_rheight * incr_lratio),
2795
2790
GDK_INTERP_BILINEAR);
2797
2792
/* make sure we're respecting the forced border */
2798
incrusted_resulting_width = small_frame_absposx + gdk_pixbuf_get_width (tmpframe);
2799
incrusted_resulting_height = small_frame_absposy + gdk_pixbuf_get_height (tmpframe);
2801
incrusted_max_resulting_width = video_frame_rwidth - incrusted_small_pic_forced_border_right;
2802
incrusted_max_resulting_height = video_frame_rheight - incrusted_small_pic_forced_border_down;
2804
if ( incrusted_resulting_width > incrusted_max_resulting_width )
2793
incr_resulting_width = small_frame_absposx + gdk_pixbuf_get_width (tmpframe);
2794
incr_resulting_height = small_frame_absposy + gdk_pixbuf_get_height (tmpframe);
2796
incr_max_resulting_width = video_frame_rwidth - incr_brd_lright;
2797
incr_max_resulting_height = video_frame_rheight - incr_brd_ldown;
2799
if ( incr_resulting_width > incr_max_resulting_width )
2805
2800
small_frame_absposx =
2806
video_frame_rwidth - gdk_pixbuf_get_width (tmpframe) - incrusted_small_pic_forced_border_right;
2801
video_frame_rwidth - gdk_pixbuf_get_width (tmpframe) - incr_brd_lright;
2808
if ( incrusted_resulting_height > incrusted_max_resulting_height )
2803
if ( incr_resulting_height > incr_max_resulting_height )
2809
2804
small_frame_absposy =
2810
video_frame_rheight - gdk_pixbuf_get_height (tmpframe) - incrusted_small_pic_forced_border_down;
2805
video_frame_rheight - gdk_pixbuf_get_height (tmpframe) - incr_brd_ldown;
2812
2807
/* copy the small picture into the big one, freshly scaled, positioned
2813
2808
* and polished :-) */
2975
2969
mw = gm_mw_get_mw (main_window);
2978
gtk_widget_size_request (GTK_WIDGET (mw->video_frame), &size_request);
2972
gtk_widget_size_request (GTK_WIDGET (mw->main_video_image), &size_request);
2980
2974
if ((size_request.width != GM_QCIF_WIDTH) ||
2981
2975
(size_request.height != GM_QCIF_HEIGHT)) {
2983
gtk_widget_set_size_request (GTK_WIDGET (mw->video_frame),
2977
gtk_widget_set_size_request (GTK_WIDGET (mw->main_video_image),
2978
GM_QCIF_WIDTH, GM_QCIF_HEIGHT);
2987
2981
text_logo_pix = gdk_pixbuf_new_from_xpm_data ((const char **) text_logo_xpm);
2988
2982
width = gdk_pixbuf_get_width (text_logo_pix);
2989
2983
height = gdk_pixbuf_get_height (text_logo_pix);
2991
tmp = gdk_pixbuf_new (GDK_COLORSPACE_RGB, TRUE, 8, 176, 144);
2992
gdk_pixbuf_fill (tmp, 0x000000FF); /* Opaque black */
2985
tmp = gdk_pixbuf_new (GDK_COLORSPACE_RGB, TRUE, 8,
2986
GM_QCIF_WIDTH, GM_QCIF_HEIGHT);
2987
gdk_pixbuf_fill (tmp, 0xFFFFFFFF);
2994
2989
gdk_pixbuf_copy_area (text_logo_pix, 0, 0,
4062
4050
gtk_container_set_border_width (GTK_CONTAINER (mw->video_frame), 0);
4063
4051
gtk_container_add (GTK_CONTAINER (mw->video_frame), mw->main_video_image);
4065
gtk_widget_set_size_request (GTK_WIDGET (mw->video_frame),
4066
GM_QCIF_WIDTH + GM_FRAME_SIZE,
4067
GM_QCIF_HEIGHT + GM_FRAME_SIZE);
4053
gtk_widget_set_size_request (GTK_WIDGET (mw->main_video_image),
4069
4057
gtk_table_attach (GTK_TABLE (table), GTK_WIDGET (event_box),
4091
4079
g_signal_connect (G_OBJECT (mw->statusbar_ebox), "button-press-event",
4092
4080
GTK_SIGNAL_FUNC (statusbar_clicked_cb), window);
4094
filename = g_build_filename (DATA_DIR, "pixmaps", PACKAGE_NAME ".png", NULL);
4095
pixbuf = gdk_pixbuf_new_from_file (filename, NULL);
4098
gtk_window_set_default_icon (pixbuf);
4082
pixbuf = gtk_widget_render_icon (GTK_WIDGET (window),
4084
GTK_ICON_SIZE_MENU, NULL);
4085
gtk_window_set_default_icon (pixbuf);
4086
g_object_unref (pixbuf);
4100
4088
/* The 2 video window popups */
4101
4089
mw->local_video_window =
4468
4456
/* GnomeMeeting Initialisation */
4469
gnome_program_init ("ekiga", VERSION,
4457
gnome_program_init (PACKAGE_NAME, VERSION,
4470
4458
LIBGNOMEUI_MODULE, argc, argv,
4471
4459
GNOME_PARAM_POPT_TABLE, arguments,
4472
GNOME_PARAM_HUMAN_READABLE_NAME,
4460
GNOME_PARAM_HUMAN_READABLE_NAME, "ekiga",
4474
4461
GNOME_PARAM_APP_DATADIR, DATA_DIR,
4475
4462
(void *) NULL);