vlcplugin_gtk.h 2.38 KB
Newer Older
1
/*****************************************************************************
2
 * vlcplugin_gtk.h: a VLC plugin for Mozilla (GTK+ interface)
3
 *****************************************************************************
4
 * Copyright (C) 2012 VLC authors and VideoLAN
5 6
 * $Id$
 *
7
 * Authors: Cheng Sun <chengsun9@gmail.com>
8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29
 *
 * This program is free software; you can redistribute it and/or modify
 * it under the terms of the GNU General Public License as published by
 * the Free Software Foundation; either version 2 of the License, or
 * (at your option) any later version.
 *
 * This program 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 General Public License for more details.
 *
 * You should have received a copy of the GNU General Public License
 * along with this program; if not, write to the Free Software
 * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston MA 02110-1301, USA.
 *****************************************************************************/

#ifndef __VLCPLUGIN_GTK_H__
#define __VLCPLUGIN_GTK_H__

#include "vlcplugin_base.h"

#include <gtk/gtk.h>
30
#include <mutex>
31
#include <X11/Xlib.h>
32

33 34
#define VLCPLUGINGTK_MENU_TOOLBAR "Show toolbar"

35 36 37 38
class VlcPluginGtk : public VlcPluginBase
{
public:
    VlcPluginGtk(NPP, NPuint16_t);
39
    virtual ~VlcPluginGtk();
40 41 42 43 44

    bool create_windows();
    bool resize_windows();
    bool destroy_windows();

45 46
    void toggle_fullscreen();
    void set_fullscreen(int);
47
    bool get_fullscreen();
48 49 50 51
    void do_set_fullscreen(bool);

    void set_toolbar_visible(bool);
    bool get_toolbar_visible();
52
    void update_controls();
53 54
    void popup_menu();

55
    void resize_video_xwindow(GdkRectangle *rect);
56 57

    GdkPixbuf *cone_icon;
58

59 60
private:
    void set_player_window();
61
    Display *get_display() { return display; }
62
    static gboolean update_time_slider(gpointer user_data);
63 64

    unsigned int     i_width, i_height;
65 66
    GtkWidget *parent, *parent_vbox, *video_container;
    GtkWidget *fullscreen_win;
67
    GtkWidget *toolbar;
Hugo Beauzée-Luyssen's avatar
Hugo Beauzée-Luyssen committed
68
    GtkWidget *time_slider, *vol_slider;
69 70
    gulong video_container_size_handler_id;

71
    Display *display;
72
    Window video_xwindow;
73
    XColor bg_color;
74
    bool is_fullscreen, is_toolbar_visible;
75 76
    std::mutex m_timer_lock;
    guint m_timer_update_timeout;
77 78 79
};

#endif /* __VLCPLUGIN_GTK_H__ */