Miranda Installer - Installs nightlies and Miranda addons.
Copyright (C) 2002-2003 Goblineye Entertainment
Authors: Saar (Tornado) and Kai (kai_b)
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
*/
#pragma once
// a custom control used to assist in package selection
// it was either this (fun, learning is cool ;P), ownerdrawing the listview control (hate it), or doing tricks with custom draw (not extensible enough)
// if you're reading this to use this control in your project, you're not in luck, hehe :)
// this control isn't customizable at all, and is very specific to its function and what is needed from it (package selection)
// it might be fun to learn how it works though :)
// NOTE that this is a small control (relatively speaking) used for very specific tasks, and that's why error-checking
// is pretty slim in there :)
// NOTE the control used to "support" being disabled, but it was removed
// later on (actually, most of it was commented out)
// since it wasn't needed anymore
// NOTE control doesn't support sizing or moving of itself (but that shouldn't be too hard to add)
#define PSM_SCROLLBAR (WM_USER+13) // makes changes to client area and such in regard to new pos (wParam)
// !!done :)
// ALL info that is returned from the control **MUST** return the same way it was recieved
// no messing around with it
#define PSM_ADDPACKAGE (WM_USER+5) // add a new package. will be inserted at positon given by wParam, lParam is a pointer to a PS_PACKAGEINFO structure that contains info about the new package. returns unique ID of package
#define PSM_ADDFILE (WM_USER+6) // adds a new file (files are added alphabetically). the package it should be put in is identified by wParam, lParam is a pointer to a PS_FILEINFO structure
#define PSM_SELECTPACKAGE (WM_USER+7) // wParam identifies the package, if lParam is true, the package will be selected, if lParam is false, the package will be un-selected :)
#define PSM_GETPACKAGECOUNT (WM_USER+8) // ... :)
#define PSM_GETPACKAGEINFO (WM_USER+9) // wParam is ID of package, return value is a pointer to the package info (PS_PACKAGEINFO) - the caller can make changes if needed.
#define PSM_GETFILECOUNT (WM_USER+10) // wParam is ID of package
#define PSM_GETFILEINFO (WM_USER+11) // wParam is ID of file in package (wait a sec), lParam is a pointer to a PS_PACKAGEINFO structure returned by PSM_GETPACKAGEINFO (now u got it :)). return value is a pointer to a PS_FILEINFO structure
// notifications
// NOTE: PSN_PACKAGESELCHANGE is *NOT* triggered by a PSM_SELECTPACKAGE msg!
#define PSN_PACKAGESELCHANGE (WM_USER+23) // no params. a change in the package selection has happened. sent to parent
// file
typedef struct PS_FILEINFO_TYPE
{
char *lpFilename; // filename (allocated by caller)
DWORD dwFileSize; // in bytes
} PS_FILEINFO;
typedef struct PS_FILELIST_TYPE
{
char *lpDisplayText; // display name
PS_FILEINFO fileInfo; // info
PS_FILELIST_TYPE *next;
} PS_FILELIST;
// package
typedef struct PS_PACKAGEINFO_TYPE
{
char *lpTitle; // title (allocated by caller)
bool fOptional; // is this package optional?
bool fSelected; // selected?
} PS_PACKAGEINFO;
typedef struct PS_PACKAGELIST_TYPE
{
PS_PACKAGEINFO packageInfo; // info
WORD wTotalFiles; // internal list keeps of number of files this package contains (size of linked list, in a way)
DWORD dwTotalSize; // total size (in bytes) of all files
// drawing-related stuff
char *lpDisplayText; // display text. *may* be different than actual display text - needed