~swem/totem/assignment

« back to all changes in this revision

Viewing changes to src/totem-object.c

  • Committer: Bazaar Package Importer
  • Author(s): Sebastian Dröge
  • Date: 2010-02-25 19:11:33 UTC
  • mfrom: (1.4.3 upstream)
  • Revision ID: james.westby@ubuntu.com-20100225191133-7bonpywglovrzohq
Tags: 2.29.91-1
* New upstream development release:
  + debian/patches/90_autotools.patch:
    - Refreshed for the new version.
  + debian/control.in:
    - Update build dependencies and dependencies.
* debian/patches/99_gst-bus_flush.patch:
  + Patch from upstream GIT to fix automatic codec installation
    and random errors showing up from previous tracks.
* debian/control.in:
  + Add ATK build dependency to allow buildds to actually install
    the correct version instead of producing an error.

Show diffs side-by-side

added added

removed removed

Lines of Context:
427
427
char *
428
428
totem_get_version (void)
429
429
{
 
430
        /* Translators: %s is the totem version number */
430
431
        return g_strdup_printf (_("Totem %s"), VERSION);
431
432
}
432
433
 
1716
1717
                else
1717
1718
                        bacon_video_widget_set_user_agent (totem->bvw, NULL);
1718
1719
 
1719
 
                totem_gdk_window_set_waiting_cursor (totem->win->window);
 
1720
                totem_gdk_window_set_waiting_cursor (gtk_widget_get_window (totem->win));
1720
1721
                totem_try_restore_position (totem, mrl);
1721
1722
                retval = bacon_video_widget_open (totem->bvw, mrl, subtitle ? subtitle : autoload_sub, &err);
1722
1723
                g_free (autoload_sub);
1723
 
                gdk_window_set_cursor (totem->win->window, NULL);
 
1724
                gdk_window_set_cursor (gtk_widget_get_window (totem->win), NULL);
1724
1725
                totem->mrl = g_strdup (mrl);
1725
1726
 
1726
1727
                /* Play/Pause */
2152
2153
        GList *p, *file_list;
2153
2154
        gboolean cleared = FALSE;
2154
2155
 
2155
 
        list = g_uri_list_extract_uris ((const char *)data->data);
 
2156
        list = g_uri_list_extract_uris ((const char *) gtk_selection_data_get_data (data));
2156
2157
        file_list = NULL;
2157
2158
 
2158
2159
        for (i = 0; list[i] != NULL; i++) {
2170
2171
        if (file_list == NULL)
2171
2172
                return FALSE;
2172
2173
 
2173
 
        totem_gdk_window_set_waiting_cursor (totem->win->window);
 
2174
        totem_gdk_window_set_waiting_cursor (gtk_widget_get_window (totem->win));
2174
2175
 
2175
2176
        if (drop_type != 1)
2176
2177
                file_list = g_list_sort (file_list, (GCompareFunc) strcmp);
2221
2222
bail:
2222
2223
        g_list_foreach (file_list, (GFunc) g_free, NULL);
2223
2224
        g_list_free (file_list);
2224
 
        gdk_window_set_cursor (totem->win->window, NULL);
 
2225
        gdk_window_set_cursor (gtk_widget_get_window (totem->win), NULL);
2225
2226
 
2226
2227
        /* ... and reconnect because we're nice people */
2227
2228
        if (cleared != FALSE)
2288
2289
{
2289
2290
        GdkModifierType mask;
2290
2291
 
2291
 
        gdk_window_get_pointer (widget->window, NULL, NULL, &mask);
 
2292
        gdk_window_get_pointer (gtk_widget_get_window (widget), NULL, NULL, &mask);
2292
2293
        if (mask & GDK_CONTROL_MASK) {
2293
2294
                gdk_drag_status (context, GDK_ACTION_COPY, _time);
2294
2295
        } else if (mask & GDK_MOD1_MASK || context->suggested_action == GDK_ACTION_ASK) {
2334
2335
{
2335
2336
        GdkModifierType mask;
2336
2337
 
2337
 
        gdk_window_get_pointer (widget->window, NULL, NULL, &mask);
 
2338
        gdk_window_get_pointer (gtk_widget_get_window (widget), NULL, NULL, &mask);
2338
2339
 
2339
2340
        if (mask & GDK_MOD1_MASK || context->suggested_action == GDK_ACTION_ASK) {
2340
2341
                gdk_drag_status (context, GDK_ACTION_ASK, _time);
2367
2368
 
2368
2369
        len = strlen (text);
2369
2370
 
2370
 
        gtk_selection_data_set (selection_data, selection_data->target,
 
2371
        gtk_selection_data_set (selection_data, gtk_selection_data_get_target (selection_data),
2371
2372
                                8, (guchar *) text, len);
2372
2373
 
2373
2374
        g_free (text);
2401
2402
 
2402
2403
        bacon_video_widget_close (totem->bvw);
2403
2404
        totem_file_closed (totem);
2404
 
        totem_gdk_window_set_waiting_cursor (totem->win->window);
 
2405
        totem_gdk_window_set_waiting_cursor (gtk_widget_get_window (totem->win));
2405
2406
        bacon_video_widget_open (totem->bvw, new_mrl ? new_mrl : mrl, NULL, NULL);
2406
2407
        totem_file_opened (totem, new_mrl ? new_mrl : mrl);
2407
 
        gdk_window_set_cursor (totem->win->window, NULL);
 
2408
        gdk_window_set_cursor (gtk_widget_get_window (totem->win), NULL);
2408
2409
        bacon_video_widget_play (bvw, NULL);
2409
2410
        g_free (new_mrl);
2410
2411
}
2727
2728
        if (list == NULL)
2728
2729
                return changed;
2729
2730
 
2730
 
        totem_gdk_window_set_waiting_cursor (totem->win->window);
 
2731
        totem_gdk_window_set_waiting_cursor (gtk_widget_get_window (totem->win));
2731
2732
 
2732
2733
        for (l = list ; l != NULL; l = l->next)
2733
2734
        {
2781
2782
                g_free (filename);
2782
2783
        }
2783
2784
 
2784
 
        gdk_window_set_cursor (totem->win->window, NULL);
 
2785
        gdk_window_set_cursor (gtk_widget_get_window (totem->win), NULL);
2785
2786
 
2786
2787
        /* ... and reconnect because we're nice people */
2787
2788
        if (cleared != FALSE)
2799
2800
{
2800
2801
        GtkAction *action;
2801
2802
        GtkWidget *menubar, *controlbar, *statusbar, *bvw_box, *widget;
 
2803
        GtkAllocation allocation;
2802
2804
        int width = 0, height = 0;
2803
2805
 
2804
2806
        if (totem->bvw == NULL)
2812
2814
 
2813
2815
        action = gtk_action_group_get_action (totem->main_action_group, "show-controls");
2814
2816
        gtk_action_set_sensitive (action, !totem_is_fullscreen (totem));
 
2817
        gtk_widget_get_allocation (widget, &allocation);
2815
2818
 
2816
2819
        if (totem->controls_visibility == TOTEM_CONTROLS_VISIBLE) {
2817
2820
                if (was_fullscreen == FALSE) {
2818
 
                        height = widget->allocation.height;
2819
 
                        width = widget->allocation.width;
 
2821
                        height = allocation.height;
 
2822
                        width = allocation.width;
2820
2823
                }
2821
2824
 
2822
2825
                gtk_widget_set_sensitive (menubar, TRUE);
2830
2833
                           */
2831
2834
                        GValue value = { 0, };
2832
2835
                        GtkWidget *pane;
 
2836
                        GtkAllocation allocation_sidebar;
2833
2837
                        int handle_size;
2834
2838
 
2835
2839
                        g_value_init (&value, G_TYPE_INT);
2841
2845
                        g_value_unset (&value);
2842
2846
                        
2843
2847
                        gtk_widget_show (totem->sidebar);
2844
 
                        width += totem->sidebar->allocation.width
2845
 
                                + handle_size;
 
2848
                        gtk_widget_get_allocation (totem->sidebar, &allocation_sidebar);
 
2849
                        width += allocation_sidebar.width + handle_size;
2846
2850
                } else {
2847
2851
                        gtk_widget_hide (totem->sidebar);
2848
2852
                }
2851
2855
                                BVW_VBOX_BORDER_WIDTH);
2852
2856
 
2853
2857
                if (was_fullscreen == FALSE) {
2854
 
                        height += menubar->allocation.height
2855
 
                                + controlbar->allocation.height
2856
 
                                + statusbar->allocation.height
 
2858
                        GtkAllocation allocation_menubar;
 
2859
                        GtkAllocation allocation_controlbar;
 
2860
                        GtkAllocation allocation_statusbar;
 
2861
 
 
2862
                        gtk_widget_get_allocation (menubar, &allocation_menubar);
 
2863
                        gtk_widget_get_allocation (controlbar, &allocation_controlbar);
 
2864
                        gtk_widget_get_allocation (statusbar, &allocation_statusbar);
 
2865
                        height += allocation.height
 
2866
                                + allocation.height
 
2867
                                + allocation.height
2857
2868
                                + 2 * BVW_VBOX_BORDER_WIDTH;
2858
2869
                        width += 2 * BVW_VBOX_BORDER_WIDTH;
2859
2870
                        gtk_window_resize (GTK_WINDOW(totem->win),
2861
2872
                }
2862
2873
        } else {
2863
2874
                if (totem->controls_visibility == TOTEM_CONTROLS_HIDDEN) {
2864
 
                        width = widget->allocation.width;
2865
 
                        height = widget->allocation.height;
 
2875
                        width = allocation.width;
 
2876
                        height = allocation.height;
2866
2877
                }
2867
2878
 
2868
2879
                /* Hide and make the menubar unsensitive */
3889
3900
{
3890
3901
        gulong handler_id;
3891
3902
 
3892
 
        if (!totem->maximised || GTK_WIDGET_MAPPED (totem->win)) {
 
3903
        if (!totem->maximised || gtk_widget_get_mapped (totem->win)) {
3893
3904
                handler_id = g_signal_handler_find (main_pane, 
3894
3905
                                G_SIGNAL_MATCH_FUNC | G_SIGNAL_MATCH_DATA,
3895
3906
                                0, 0, NULL,