~ubuntu-branches/ubuntu/hardy/avidemux/hardy

« back to all changes in this revision

Viewing changes to avidemux/ADM_userInterfaces/ADM_GTK/ADM_toolkit_gtk/ADM_tray_gtk.cpp

  • Committer: Bazaar Package Importer
  • Author(s): Matvey Kozhev
  • Date: 2007-12-18 13:53:04 UTC
  • mfrom: (1.1.7 upstream)
  • Revision ID: james.westby@ubuntu.com-20071218135304-cdqec2lg2bglyz15
Tags: 1:2.4~preview3-0.0ubuntu1
* Upload to Ubuntu. (LP: #163287, LP: #126572)
* debian/changelog: re-added Ubuntu releases.
* debian/control:
  - Require debhelper >= 5.0.51 (for dh_icons) and imagemagick.
  - Build-depend on libsdl1.2-dev instead of libsdl-dev.
  - Build against newer libx264-dev. (LP: #138854)
  - Removed libamrnb-dev, not in Ubuntu yet.
* debian/rules:
  - Install all icon sizes, using convert (upstream installs none).
  - Added missing calls to dh_installmenu, dh_installman, dh_icons and
    dh_desktop.
* debian/menu, debian/avidemux-qt.menu:
  - Corrected package and executable names.
* debian/avidemux-common.install: Install icons.
* debian/avidemux.common.manpages: Install man/avidemux.1.
* debian/links, debian/avidemux-cli.links, debian/avidemux-gtk.links:
  - Link manpages to avidemux.1.gz.
* debian/install, debian/avidemux-qt.install, debian/avidemux-gtk.desktop,
  debian/avidemux-qt.desktop: Install desktop files.

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
1
/***************************************************************************
 
2
                          adm_encdivx.cpp  -  description
 
3
                             -------------------
 
4
    begin                : Sun Jul 14 2002
 
5
    copyright            : (C) 2002 by mean
 
6
    email                : fixounet@free.fr
 
7
 
 
8
 
 
9
Derived from MLdonkey systray code
 
10
http://savannah.nongnu.org/cvs/?group=mldonkey
 
11
 ***************************************************************************/
 
12
 
 
13
/***************************************************************************
 
14
 *                                                                         *
 
15
 *   This program is free software; you can redistribute it and/or modify  *
 
16
 *   it under the terms of the GNU General Public License as published by  *
 
17
 *   the Free Software Foundation; either version 2 of the License, or     *
 
18
 *   (at your option) any later version.                                   *
 
19
 *                                                                         *
 
20
 ***************************************************************************/
 
21
 
 
22
#include "config.h"
 
23
 
 
24
#include <string.h>
 
25
#include <stdio.h>
 
26
 
 
27
 
 
28
 
 
29
#include "default.h"
 
30
#include "ADM_toolkit_gtk/toolkit_gtk_include.h"
 
31
#include <ADM_assert.h>
 
32
#include "ADM_tray.h"
 
33
#include "ADM_toolkit_gtk/ADM_gladeSupport.h"
 
34
extern "C"
 
35
{
 
36
#include "systray.h"
 
37
}
 
38
static int nbTray=0;
 
39
static  GdkPixbuf   **pixbuf=NULL;
 
40
 
 
41
extern GdkPixbuf        *create_pixbuf                  (const gchar     *filename);
 
42
/*
 
43
class ADM_tray
 
44
{
 
45
protected:
 
46
 
 
47
public:
 
48
        ADM_tray(char *name);
 
49
        ~ADM_tray();
 
50
        setPercent(int percent);
 
51
        setStatus(int working);
 
52
 
 
53
};*/
 
54
static char *animated[]={
 
55
    "film1.png","film3.png","film5.png","film7.png","film9.png",
 
56
    "film11.png","film13.png","film15.png","film17.png","film19.png",
 
57
    "film21.png","film23.png"};
 
58
ADM_tray::ADM_tray(char *name)
 
59
{
 
60
        ADM_assert(!nbTray);
 
61
        nbTray++;
 
62
 
 
63
 
 
64
  int nb=sizeof(animated)/sizeof(char *);
 
65
  if(!pixbuf)
 
66
  {
 
67
      pixbuf=new GdkPixbuf*[nb];
 
68
      for(int i=0;i<nb;i++)
 
69
      {
 
70
        pixbuf[i]=create_pixbuf(animated[i]);
 
71
        if(!pixbuf[i])
 
72
        {
 
73
          printf("Failed to create <%s>\n",animated[i]);
 
74
          ADM_assert(0);
 
75
        }
 
76
      }
 
77
 
 
78
  }
 
79
  sys=adm_new_systray(pixbuf,nb,name);
 
80
 
 
81
}
 
82
ADM_tray::~ADM_tray()
 
83
{
 
84
        nbTray--;
 
85
        ADM_assert(!nbTray);
 
86
        if(sys)
 
87
                adm_delete_systray(sys);
 
88
        sys=NULL;
 
89
}
 
90
uint8_t ADM_tray::setPercent(int percent)
 
91
{
 
92
char percentS[40];
 
93
        sprintf(percentS,"%d %%",percent);
 
94
        if(sys)
 
95
        {
 
96
                adm_changeIcon_systray();
 
97
                adm_change_tooltip(sys,percentS);
 
98
        }
 
99
        return 1;
 
100
}
 
101
uint8_t ADM_tray::setStatus(int working)
 
102
{
 
103
        return 1;
 
104
}