From 70da97726fc2acbb090acbdf027728097ae8ba04 Mon Sep 17 00:00:00 2001 From: Vadim Dashevskiy Date: Thu, 20 Sep 2012 20:24:53 +0000 Subject: TrafficCounter: folder re-structure git-svn-id: http://svn.miranda-ng.org/main/trunk@1615 1316c22d-e87f-b044-9b9b-93d7a3e3ba9c --- plugins/TrafficCounter/src/commonheaders.h | 163 +++++++++++++++++++++++++++++ 1 file changed, 163 insertions(+) create mode 100644 plugins/TrafficCounter/src/commonheaders.h (limited to 'plugins/TrafficCounter/src/commonheaders.h') diff --git a/plugins/TrafficCounter/src/commonheaders.h b/plugins/TrafficCounter/src/commonheaders.h new file mode 100644 index 0000000000..dee13d20c7 --- /dev/null +++ b/plugins/TrafficCounter/src/commonheaders.h @@ -0,0 +1,163 @@ +#ifndef commonheaders_h__ +#define commonheaders_h__ + +/* +Traffic Counter plugin for Miranda IM +Copyright 2007-2011 Mironych. + +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., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. +*/ + +#define MIRANDA_VER 0x0900 +#define MIRANDA_CUSTOM_LP + +#ifndef _WIN64 + #define _USE_32BIT_TIME_T +#endif + +// Standart includes +#include +#include +#include +#include +#include + +#include + +#include "resource.h" + +// Miranda SDK includes +#include +#include +#include +#include +#include +//#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include + +#pragma pack(push) +#pragma pack(1) +typedef struct +{ + BYTE Hour, Day, Month; + WORD Year; + DWORD Incoming, Outgoing; + WORD Time; +} HOURLYSTATS; +#pragma pack(pop) + +typedef struct tagTimer +{ + DWORD TimeAtStart; // Время в момент запуска таймера - в миллисекундах. + DWORD Timer; // Количество секунд со времени запуска таймера. +} TIMER; + +typedef struct +{ + char *name; // Имя аккаунта. + + TIMER Session; // Таймер текущей сессии (протокол в онлайне). + TIMER Total; // Таймер общий. + + DWORD TotalRecvTraffic, // Общий трафик протокола (за выбранный период) + TotalSentTraffic, + CurrentRecvTraffic, // Текущий трафик протокола (за сессию) + CurrentSentTraffic; + union + { + BYTE Flags; + struct + { + unsigned int Reserv0:1; // Активность потеряла смысл - статистика ведётся по всем аккаунтам. + unsigned int Visible:1; // = 1 - аккаунт будет показываться во фрейме счётчиков + unsigned int Enabled:1; // = 1 - аккаунт включен и не прячется + unsigned int State:1; // = 1 - аккаунт сейчас онлайн + unsigned int Reserv1:3; + }; + }; + + // Добавлено в версии 0.1.1.0. + DWORD NumberOfRecords; // Количество часов в общей статистике. + HOURLYSTATS *AllStatistics; // Полная статистика вместе со статистикой онлайна. + HANDLE hFile; // Файл с сохранённой статистикой данного протокола. + + DWORD StartIndex; // Номер записи в статистике, бывший актуальным на момент запуска. + DWORD StartIncoming; // Значение входящего трафика на момент запуска. + DWORD StartOutgoing; // Значение исходящего трафика на момент запуска. + + // 0.1.1.5. + DWORD Shift; // Номер записи в статистике старейшего выбранного аккаунта, + // дата которой соответствует началу статистики данного аккаунта. + + // 0.1.1.6 + TCHAR *tszAccountName; // Человеческое имя аккаунта для использования в графическом интерфейсе. +} PROTOLIST; + +//--------------------------------------------------------------------------------------------- +// Различные флаги +//--------------------------------------------------------------------------------------------- +union +{ + DWORD Flags; + struct + { + unsigned int NotifyBySize:1; //0 + unsigned int DrawCurrentTraffic:1; //1 + unsigned int DrawTotalTraffic:1; //2 + unsigned int DrawCurrentTimeCounter:1; //3 + unsigned int DrawProtoIcon:1; //4 + unsigned int Reserv0:1; //5 + unsigned int DrawProtoName:1; //6 + unsigned int DrawFrmAsSkin:1; //7 + unsigned int ShowSummary:1; //8 + unsigned int ShowTooltip:1; //9 + unsigned int ShowMainMenuItem:1; //10 + unsigned int ShowOverall:1; //11 + unsigned int Stat_Units:2; //12,13 + unsigned int Stat_Tab:3; //14,15,16 + unsigned int NotifyByTime:1; //17 + unsigned int Reserv2:1; //18 + unsigned int PeriodForShow:2; //19,20 + unsigned int FrameIsVisible:1; //21 + unsigned int Reserv1:1; //22 + unsigned int DrawTotalTimeCounter:1; //23 + }; +} unOptions; + +PROTOLIST *ProtoList; // Данные обо всех аккаунтах. +PROTOLIST OverallInfo; // Суммарные данные по видимым аккаунтам. +BYTE NumberOfAccounts; +WORD Stat_SelAcc; // Выбранные аккаунты в окне статистики +HWND TrafficHwnd; +DWORD mirandaVer; + +#include "misc.h" +#include "opttree.h" +#include "vars.h" +#include "statistics.h" +#include "TrafficCounter.h" + +#endif -- cgit v1.2.3