123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788789790791792793794795796797798799800801802803804805806807808809810811812813814815816817818819820821822823824825826827828829830831832833834835836837838839840841842843844845846847848849850851852853854855856857858859860861862863864865866867868869870871872873874875876877878879880881882883884885886887888889890891892893894895896897898899900901902903904905906907908909910911912913914915916917918919920921922923924925926927928929930931932933934935936937938939940941942943944945946947948949950951952953954955956957958959960961962963964965966967968969970971972973974975976977978979980981982983984985986987988989990991992993994995996997998999100010011002100310041005100610071008100910101011101210131014101510161017101810191020 |
- #ifndef _NULLSOFT_WINAMP_ML_DEVICES_LIST_WIDGET_INTERNAL_HEADER
- #define _NULLSOFT_WINAMP_ML_DEVICES_LIST_WIDGET_INTERNAL_HEADER
- #if defined(_MSC_VER) && (_MSC_VER >= 1020)
- #pragma once
- #endif
- #include <wtypes.h>
- #include <vector>
- #include "./imageCache.h"
- typedef enum ListWidgetItemState
- {
- ListWidgetItemState_Default = (0),
- ListWidgetItemState_Hovered = (1 << 0),
- ListWidgetItemState_Selected = (1 << 1),
- ListWidgetItemState_Interactive = (1 << 2),
- ListWidgetItemState_TextTruncated = (1 << 3),
- ListWidgetItemState_TextEdited = (1 << 4),
- } ListWidgetItemSate;
- DEFINE_ENUM_FLAG_OPERATORS(ListWidgetItemSate);
- #define ListWidgetItem_State(_item) (((ListWidgetItem*)(_item))->state)
- #define ListWidgetItem_SetState(_item, _state) (ListWidgetItem_State(_item) |= (_state))
- #define ListWidgetItem_UnsetState(_item, _state) (ListWidgetItem_State(_item) &= ~(_state))
- #define ListWidgetItem_IsHovered(_item) (0 != (ListWidgetItemState_Hovered & ListWidgetItem_State(_item)))
- #define ListWidgetItem_SetHovered(_item) ListWidgetItem_SetState(_item, ListWidgetItemState_Hovered)
- #define ListWidgetItem_UnsetHovered(_item) ListWidgetItem_UnsetState(_item, ListWidgetItemState_Hovered)
- #define ListWidgetItem_IsSelected(_item) (0 != (ListWidgetItemState_Selected & ListWidgetItem_State(_item)))
- #define ListWidgetItem_SetSelected(_item) ListWidgetItem_SetState(_item, ListWidgetItemState_Selected)
- #define ListWidgetItem_UnsetSelected(_item) ListWidgetItem_UnsetState(_item, ListWidgetItemState_Selected)
- #define ListWidgetItem_IsInteractive(_item) (0 != (ListWidgetItemState_Interactive & ListWidgetItem_State(_item)))
- #define ListWidgetItem_SetInteractive(_item) ListWidgetItem_SetState(_item, ListWidgetItemState_Interactive)
- #define ListWidgetItem_UnsetInteractive(_item) ListWidgetItem_UnsetState(_item, ListWidgetItemState_Interactive)
- #define ListWidgetItem_IsTextTruncated(_item) (0 != (ListWidgetItemState_TextTruncated & ListWidgetItem_State(_item)))
- #define ListWidgetItem_SetTextTruncated(_item) ListWidgetItem_SetState(_item, ListWidgetItemState_TextTruncated)
- #define ListWidgetItem_UnsetTextTruncated(_item) ListWidgetItem_UnsetState(_item, ListWidgetItemState_TextTruncated)
- #define ListWidgetItem_IsTextEdited(_item) (0 != (ListWidgetItemState_TextEdited & ListWidgetItem_State(_item)))
- #define ListWidgetItem_SetTextEdited(_item) ListWidgetItem_SetState(_item, ListWidgetItemState_TextEdited)
- #define ListWidgetItem_UnsetTextEdited(_item) ListWidgetItem_UnsetState(_item, ListWidgetItemState_TextEdited)
- typedef struct ListWidgetConnection ListWidgetConnection;
- typedef std::vector<ListWidgetConnection*> ListWidgetConnectionList;
- typedef struct ListWidgetTooltip ListWidgetTooltip;
- typedef enum ListWidgetCommandState
- {
- ListWidgetCommandState_Normal = (0),
- ListWidgetCommandState_Disabled = (1 << 0),
- ListWidgetCommandState_Primary = (1 << 1),
- ListWidgetCommandState_Pressed = (1 << 2),
- } ListWidgetCommandState;
- DEFINE_ENUM_FLAG_OPERATORS(ListWidgetCommandState);
- typedef struct ListWidgetCommand ListWidgetCommand;
- typedef struct ListWidgetActivity
- {
- unsigned int step;
- unsigned int percent;
- wchar_t *title;
- SIZE titleSize;
- BOOL cancelable;
- }
- ListWidgetActivity;
- typedef struct ListWidgetActivityMetric
- {
- long height;
- long width;
- long progressWidth;
- long progressHeight;
- long percentWidth;
- long percentHeight;
- long titleWidth;
- long titleHeight;
- long fontHeight;
- long offsetLeft;
- long offsetRight;
- long offsetTop;
- long offsetBottom;
- long spacing;
- } ListWidgetActivityMetric;
- typedef enum ListWidgetActivityChange
- {
- ListWidgetActivityChanged_Nothing = 0,
- ListWidgetActivityChanged_Percent = (1 << 0),
- ListWidgetActivityChanged_Title = (1 << 1),
- ListWidgetActivityChanged_Cancelable = (1 << 2),
- ListWidgetActivityChanged_All = (ListWidgetActivityChanged_Percent | ListWidgetActivityChanged_Title | ListWidgetActivityChanged_Cancelable ),
- }
- ListWidtetActivityChange;
- DEFINE_ENUM_FLAG_OPERATORS(ListWidtetActivityChange);
- typedef enum ListWidgetItemPart
- {
- ListWidgetItemPart_None = 0,
- ListWidgetItemPart_Frame = (1 << 0),
- ListWidgetItemPart_Image = (1 << 1),
- ListWidgetItemPart_Title = (1 << 2),
- ListWidgetItemPart_Activity = (1 << 3),
- ListWidgetItemPart_Command = (1 << 4),
- ListWidgetItemPart_Spacebar = (1 << 5),
- ListWidgetItemPart_Connection = (1 << 6),
- }ListWidgetItemPart;
- DEFINE_ENUM_FLAG_OPERATORS(ListWidgetItemPart);
- typedef struct ListWidgetItem
- {
- char *name;
- wchar_t *title;
- RECT rect;
- SIZE titleSize;
- DeviceImage *image;
- uint64_t spaceTotal;
- uint64_t spaceUsed;
- ListWidgetItemState state;
- ListWidgetConnection *connection;
- ListWidgetActivity *activity;
- }ListWidgetItem;
- typedef std::vector<ListWidgetItem*> ListWidgetItemList;
- typedef struct ListWidgetGroup
- {
- char *name;
- wchar_t *title;
- ListWidgetItemList items;
- } ListWidgetGroup;
- typedef std::vector<ListWidgetGroup*> ListWidgetGroupList;
- typedef struct ListWidgetCategory
- {
- char *name;
- wchar_t *title;
- BOOL collapsed;
- ListWidgetGroupList groups;
- RECT rect;
- long titleWidth;
- long countWidth;
- wchar_t *countString;
- wchar_t *emptyText;
- RECT emptyTextRect;
- }ListWidgetCategory;
- typedef std::vector<ListWidgetCategory*> ListWidgetCategoryList;
- typedef enum ListWidgetFlags
- {
- ListWidgetFlag_NoFocusSelect = (1 << 0),
- ListWidgetFlag_LButtonDownOnCommand = (1 << 1),
- } ListWidgetFlags;
- DEFINE_ENUM_FLAG_OPERATORS(ListWidgetFlags);
- typedef struct ListWidget
- {
- ListWidgetFlags flags;
- ListWidgetCategoryList categories;
- ListWidgetConnectionList connections;
- BackBuffer backBuffer;
- ListWidgetItem *hoveredItem;
- ListWidgetItem *selectedItem;
- ListWidgetItem *titleEditItem;
- ListWidgetCategory *pressedCategory;
- SIZE imageSize;
- long itemWidth;
- size_t itemsPerLine;
- size_t deviceHandler;
- ListWidgetCommand **commands;
- size_t commandsCount;
- size_t commandsMax;
- ListWidgetItemList activeItems;
- POINT previousMouse;
-
- HBITMAP spacebarBitmap;
- HBITMAP arrowsBitmap;
-
- HBITMAP hoverBitmap;
- HBITMAP selectBitmap;
- HBITMAP inactiveSelectBitmap;
-
- HBITMAP largeBadgeBitmap;
- HBITMAP smallBadgeBitmap;
-
- SIZE connectionSize;
- SIZE primaryCommandSize;
- SIZE secondaryCommandSize;
- DeviceImage *unknownCommandLargeImage;
- DeviceImage *unknownCommandSmallImage;
-
- ListWidgetActivityMetric activityMetrics;
- HFONT activityFont;
- HBITMAP activityBadgeBitmap;
- DeviceImage *activityProgressImage;
- BOOL activityTimerEnabled;
-
- HMENU activeMenu;
- ListWidgetTooltip *tooltip;
- unsigned int selectionStatus;
- HWND titleEditor;
- } ListWidget;
- typedef struct
- ListWidgetItemMetric
- {
- long titleMinWidth;
- long offsetLeft;
- long offsetTop;
- long offsetRight;
- long offsetBottom;
- long imageOffsetLeft;
- long imageOffsetTop;
- long imageOffsetRight;
- long imageOffsetBottom;
- long titleOffsetTop;
- long spacebarOffsetTop;
- long spacebarHeight;
- } ListWidgetItemMetric;
- typedef struct
- ListWidgetCategoryMetric
- {
- long offsetLeft;
- long offsetTop;
- long offsetRight;
- long offsetBottom;
- long lineHeight;
- long lineOffsetTop;
- long titleOffsetLeft;
- long minHeight;
- long iconWidth;
- long iconHeight;
- } ListWidgetCategoryMetric;
- HBITMAP
- ListWidget_GetSpacebarBitmap(ListWidget *self,
- WidgetStyle *style,
- HWND hwnd,
- long width,
- long height);
- HBITMAP
- ListWidget_GetHoverBitmap(ListWidget *self,
- WidgetStyle *style,
- HWND hwnd,
- long width,
- long height);
- HBITMAP
- ListWidget_GetSelectBitmap(ListWidget *self,
- WidgetStyle *style,
- HWND hwnd,
- long width,
- long height);
- HBITMAP
- ListWidget_GetInactiveSelectBitmap(ListWidget *self,
- WidgetStyle *style,
- HWND hwnd,
- long width,
- long height);
- HBITMAP
- ListWidget_GetLargeBadgeBitmap(ListWidget *self,
- WidgetStyle *style,
- HWND hwnd,
- long width,
- long height);
- HBITMAP
- ListWidget_GetSmallBadgeBitmap(ListWidget *self,
- WidgetStyle *style,
- HWND hwnd,
- long width,
- long height);
- HBITMAP
- ListWidget_GetUnknownCommandSmallBitmap(ListWidget *self,
- WidgetStyle *style,
- long width,
- long height);
- HBITMAP
- ListWidget_GetUnknownCommandLargeBitmap(ListWidget *self,
- WidgetStyle *style,
- long width,
- long height);
- HBITMAP
- ListWidget_GetArrowsBitmap(ListWidget *self,
- WidgetStyle *style,
- HWND hwnd);
- HBITMAP
- ListWidget_GetActivityProgressBitmap(ListWidget *self,
- WidgetStyle *style);
- HBITMAP
- ListWidget_GetActivityBadgeBitmap(ListWidget *self,
- WidgetStyle *style,
- HWND hwnd,
- long width,
- long height);
- BOOL
- ListWidget_GetViewOrigin(HWND hwnd,
- POINT *pt);
- BOOL
- ListWidget_UpdateHoverEx(ListWidget *self,
- HWND hwnd,
- const POINT *cursor);
- BOOL
- ListWidget_UpdateHover(ListWidget *self,
- HWND hwnd);
- BOOL
- ListWidget_RemoveHover(ListWidget *self,
- HWND hwnd,
- BOOL invalidate);
- BOOL
- ListWidget_SelectItem(ListWidget *self,
- HWND hwnd,
- ListWidgetItem *item,
- BOOL ensureVisible);
- BOOL
- ListWidget_SetImageSize(ListWidget *self,
- HWND hwnd,
- int imageWidth,
- int imageHeight,
- BOOL redraw);
- typedef enum ListWidgetLayoutFlags
- {
- ListWidgetLayout_Normal = 0,
- ListWidgetLayout_NoRedraw = (1 << 0),
- ListWidgetLayout_UpdateNow = (1 << 1),
- ListWidgetLayout_KeepStable = (1 << 2),
- }ListWidgetLayoutFlags;
- DEFINE_ENUM_FLAG_OPERATORS(ListWidgetLayoutFlags);
- BOOL
- ListWidget_UpdateLayout(HWND hwnd,
- ListWidgetLayoutFlags flags);
- BOOL
- ListWidget_DisplayContextMenu(ListWidget *self,
- HWND hostWindow,
- POINT pt);
- BOOL
- ListWidget_RegisterActiveItem(ListWidget *self,
- HWND hwnd,
- ListWidgetItem *item);
- BOOL
- ListWidget_UnregisterActiveItem(ListWidget *self,
- HWND hwnd,
- ListWidgetItem *item);
- double
- ListWidget_GetZoomRatio(ListWidget *self);
- void
- ListWidget_UpdateSelectionStatus(ListWidget *self,
- HWND hwnd,
- BOOL ensureVisible);
- void
- ListWidget_UpdateSelectionSpaceStatus(ListWidget *self,
- HWND hwnd,
- BOOL ensureVisible);
- void
- ListWidget_UpdateTitleEditorColors(HWND editor,
- WidgetStyle *style);
- /*
- <<<<<<<<<<<<<<<<<<<<<<<<< Category >>>>>>>>>>>>>>>>>>>>>>>>>
- */
- ListWidgetCategory *
- ListWidget_CreateCategory(const char *name,
- const wchar_t *title,
- BOOL collapsed);
- void
- ListWidget_DestroyCategory(ListWidgetCategory *category);
- ListWidgetCategory *
- ListWidget_GetCategoryFromPoint(ListWidget *self,
- POINT point);
- ListWidgetCategory *
- ListWidget_FindCategory(ListWidget *self,
- const char *name);
- BOOL
- ListWidget_GetCategoryMetrics(WidgetStyle *style,
- ListWidgetCategoryMetric *metrics);
- BOOL
- ListWidget_ToggleCategory(ListWidgetCategory *category,
- HWND hwnd);
- void
- ListWidget_ResetCategoryCounter(ListWidgetCategory *category);
- void
- ListWidget_SortCategory(ListWidgetCategory *category);
- BOOL
- ListWidget_SetCategoryEmptyText(ListWidgetCategory *category, const wchar_t *text);
- /*
- <<<<<<<<<<<<<<<<<<<<<<<<< Group >>>>>>>>>>>>>>>>>>>>>>>>>
- */
- ListWidgetGroup *
- ListWidget_CreateGroup(const char *name);
- ListWidgetGroup *
- ListWidget_CreateGroupEx(const char *name,
- const wchar_t *title);
- void
- ListWidget_DestroyGroup(ListWidgetGroup *group);
- BOOL
- ListWidget_AddGroup(ListWidgetCategory *category,
- ListWidgetGroup *group);
-
- ListWidgetGroup *
- ListWidget_FindGroup(ListWidgetCategory *category,
- const char *name);
- ListWidgetGroup *
- ListWidget_FindGroupEx(ListWidgetCategory *category,
- const char *name,
- size_t max);
- void
- ListWidget_SortGroup(ListWidgetGroup *group);
- /*
- <<<<<<<<<<<<<<<<<<<<<<<<< Item >>>>>>>>>>>>>>>>>>>>>>>>>
- */
- typedef enum ListWidgetVisibleFlags
- {
- VISIBLE_NORMAL = 0,
- VISIBLE_PARTIAL_OK = (1 << 0),
- VISIBLE_ALIGN_BOTTOM =(1 << 1),
- VISIBLE_ALIGN_TOP = (1 << 2),
- VISIBLE_ALIGN_ALWAYS = (1 << 3),
- } ListWidgetVisibleFlags;
- DEFINE_ENUM_FLAG_OPERATORS(ListWidgetVisibleFlags);
- ListWidgetItem*
- ListWidget_CreateItemFromDevice(ListWidget *self,
- ifc_device* device);
- void
- ListWidget_DestroyItem(ListWidgetItem *item);
- BOOL
- ListWidget_CalculateItemBaseSize(ListWidget *self,
- WidgetStyle *style,
- SIZE *baseSize,
- long *itemTextWidth);
- size_t // number of removed items
- ListWidget_RemoveItem(ListWidget *self,
- HWND hwnd,
- const char *name);
- ListWidgetItem *
- ListWidget_GetFirstItem(ListWidget *self);
- ListWidgetItem *
- ListWidget_GetLastItem(ListWidget *self);
- ListWidgetItem *
- ListWidget_GetNextItem(ListWidget *self,
- ListWidgetItem *baseItem);
- ListWidgetItem *
- ListWidget_GetPreviousItem(ListWidget *self,
- ListWidgetItem *baseItem);
- ListWidgetItem *
- ListWidget_GetNextCategoryItem(ListWidget *self,
- ListWidgetCategory *category,
- ListWidgetItem *baseItem);
- ListWidgetItem *
- ListWidget_GetPreviousCategoryItem(ListWidget *self,
- ListWidgetCategory *category,
- ListWidgetItem *baseItem);
- ListWidgetItem *
- ListWidget_GetNextGroupItem(ListWidget *self,
- ListWidgetGroup *group,
- ListWidgetItem *baseItem);
- ListWidgetItem *
- ListWidget_GetPreviousGroupItem(ListWidget *self,
- ListWidgetGroup *group,
- ListWidgetItem *baseItem);
- ListWidgetItem *
- ListWidget_GetNextLineItem(ListWidget *self,
- ListWidgetItem *baseItem);
- ListWidgetItem *
- ListWidget_GetPreviousLineItem(ListWidget *self,
- ListWidgetItem *baseItem);
- ListWidgetItem *
- ListWidget_GetNextPageItem(ListWidget *self,
- HWND hwnd,
- ListWidgetItem *baseItem);
- ListWidgetItem *
- ListWidget_GetPreviousPageItem(ListWidget *self,
- HWND hwnd,
- ListWidgetItem *baseItem);
- BOOL
- ListWidget_EnsureItemVisisble(ListWidget *self,
- HWND hwnd,
- ListWidgetItem *item,
- ListWidgetVisibleFlags flags);
- HBITMAP
- ListWidget_GetItemImage(ListWidget *self,
- WidgetStyle *style,
- ListWidgetItem *item);
- BOOL
- ListWidget_GetItemMetrics(WidgetStyle *style,
- ListWidgetItemMetric *metrics);
- ListWidgetItem *
- ListWidget_GetItemFromPointEx(ListWidget *self,
- POINT point,
- ListWidgetCategory **categoryOut, // optional
- ListWidgetGroup **groupOut); // optional
- ListWidgetItem *
- ListWidget_GetItemFromPoint(ListWidget *self,
- POINT point);
- BOOL
- ListWidget_AddItem(ListWidgetGroup *group,
- ListWidgetItem *item);
- ListWidgetItem *
- ListWidget_FindGroupItem(ListWidgetGroup *group,
- const char *name);
- ListWidgetItem *
- ListWidget_FindGroupItemEx(ListWidgetGroup *group,
- const char *name,
- size_t max);
- ListWidgetGroup *
- ListWidget_GetItemOwner(ListWidget *self,
- ListWidgetItem *baseItem,
- ListWidgetCategory **categoryOut);
- ListWidgetItem *
- ListWidget_FindItem(ListWidget *self,
- const char *name,
- ListWidgetCategory **categoryOut,
- ListWidgetGroup **groupOut);
- BOOL
- ListWidget_FindItemPos(ListWidget *self,
- ListWidgetItem *item,
- size_t *categoryOut,
- size_t *groupOut,
- size_t *itemOut);
- BOOL
- ListWidget_SetItemTitle(ListWidgetItem *item,
- const wchar_t *title);
- BOOL
- ListWidget_DisplayItemContextMenu(ListWidget *self,
- HWND hostWindow,
- ListWidgetItem *item,
- POINT pt);
- size_t
- ListWidget_GetItemCommands(ListWidgetItem *item,
- ListWidgetCommand **buffer,
- size_t bufferMax);
- BOOL
- ListWidget_SendItemCommand(const char *name,
- const char *command,
- HWND hostWindow,
- ULONG_PTR param,
- BOOL enableIntercept);
- BOOL
- ListWidget_CreateItemActivity(ListWidgetItem *item);
- BOOL
- ListWidget_DeleteItemActivity(ListWidgetItem *item);
- ListWidtetActivityChange
- ListWidget_UpdateItemActivity(ListWidgetItem *item,
- ifc_deviceactivity *activity);
- BOOL
- ListWidget_InvalidateItemImage(ListWidget *self,
- HWND hwnd,
- ListWidgetItem *item);
- BOOL
- ListWidget_InvalidateItemActivity(ListWidget *self,
- HWND hwnd,
- ListWidgetItem *item,
- ListWidgetActivityChange changes);
- BOOL
- ListWidget_GetItemFrameRect(ListWidget *self,
- ListWidgetItem *item,
- ListWidgetItemMetric *metrics,
- RECT *rect);
- BOOL
- ListWidget_GetItemImageRect(ListWidget *self,
- ListWidgetItem *item,
- ListWidgetItemMetric *metrics,
- RECT *rect);
- BOOL
- ListWidget_GetItemActivityRect(ListWidget *self,
- ListWidgetItem *item,
- ListWidgetItemMetric *metrics,
- RECT *rect);
- BOOL
- ListWidget_GetItemActivityProgressRect(ListWidget *self,
- HDC hdc,
- ListWidgetItem *item,
- ListWidgetItemMetric *metrics,
- RECT *rect);
- BOOL
- ListWidget_GetItemActivityPercentRect(ListWidget *self,
- HDC hdc,
- ListWidgetItem *item,
- ListWidgetItemMetric *metrics,
- RECT *rect);
- BOOL
- ListWidget_GetItemActivityTitleRect(ListWidget *self,
- HDC hdc,
- ListWidgetItem *item,
- ListWidgetItemMetric *metrics,
- RECT *rect);
- BOOL
- ListWidget_GetItemSpacebarRect(ListWidget *self,
- ListWidgetItem *item,
- ListWidgetItemMetric *metrics,
- RECT *rect);
- BOOL
- ListWidget_GetItemTitleRect(ListWidget *self,
- ListWidgetItem *item,
- ListWidgetItemMetric *metrics,
- BOOL exactSize,
- RECT *rect);
- BOOL
- ListWidget_GetItemConnectionRect(ListWidget *self,
- ListWidgetItem *item,
- ListWidgetItemMetric *metrics,
- RECT *rect);
- ListWidgetItemPart
- ListWidget_GetItemPartFromPoint(ListWidget *self,
- ListWidgetItem *item,
- ListWidgetItemMetric *metrics,
- POINT pt,
- ListWidgetItemPart mask,
- RECT *partRect);
- BOOL
- ListWidget_FormatItemTip(ListWidget *self,
- ListWidgetItem *item,
- wchar_t *buffer,
- size_t bufferMax);
- BOOL
- ListWidget_FormatItemTitleTip(ListWidget *self,
- ListWidgetItem *item,
- wchar_t *buffer,
- size_t bufferMax);
- BOOL
- ListWidget_FormatItemCommandTip(ListWidget *self,
- ListWidgetItem *item,
- const RECT *commandRect,
- wchar_t *buffer,
- size_t bufferMax);
- BOOL
- ListWidget_FormatItemSpaceTip(ListWidget *self,
- ListWidgetItem *item,
- wchar_t *buffer,
- size_t bufferMax);
- BOOL
- ListWidget_FormatItemStatus(ListWidget *self,
- ListWidgetItem *item,
- wchar_t *buffer,
- size_t bufferMax);
- BOOL
- ListWidget_FormatItemSpaceStatus(ListWidget *self,
- ListWidgetItem *item,
- wchar_t *buffer,
- size_t bufferMax);
- HWND
- ListWidget_BeginItemTitleEdit(ListWidget *self,
- HWND hwnd,
- ListWidgetItem *item);
- int
- ListWidget_CompareItemPos(ListWidget *self,
- ListWidgetItem *item1,
- ListWidgetItem *item2);
- BOOL
- ListWidget_GetViewItemPos(HWND hwnd,
- ListWidgetItem *item,
- POINT *pt);
- /*
- <<<<<<<<<<<<<<<<<<<<<<<<< Connection >>>>>>>>>>>>>>>>>>>>>>>>>
- */
- ListWidgetConnection *
- ListWidget_CreateConnection(const char *name);
- void
- ListWidget_DestroyConnection(ListWidgetConnection *connection);
- HBITMAP
- ListWidget_GetConnectionImage(WidgetStyle *style,
- ListWidgetConnection *connection,
- int width,
- int height);
- BOOL
- ListWidget_ConnectionResetColors(WidgetStyle *style,
- ListWidgetConnection *connection);
- void
- ListWidget_ResetConnnectionsColors(ListWidget *self,
- WidgetStyle *style);
- ListWidgetConnection *
- ListWidget_FindConnection(ListWidget *self,
- const char *name);
- BOOL
- ListWidget_AddConnection(ListWidget *self,
- ListWidgetConnection *connection);
- void
- ListWidget_RemoveConnection(ListWidget *self,
- const char *name);
- void
- ListWidget_RemoveAllConnections(ListWidget *self);
- BOOL
- ListWidget_UpdateConnectionImageSize(ListWidgetConnection *connection,
- int width,
- int height);
- /*
- <<<<<<<<<<<<<<<<<<<<<<<<< Command >>>>>>>>>>>>>>>>>>>>>>>>>
- */
- ListWidgetCommand *
- ListWidget_CreateCommand(const char *name,
- BOOL primary,
- BOOL disabled);
- void
- ListWidget_DestroyCommand(ListWidgetCommand *command);
- size_t
- ListWigdet_GetDeviceCommands(ListWidgetCommand **buffer,
- size_t bufferMax,
- ifc_device *device);
- void
- ListWidget_DestroyAllCommands(ListWidgetCommand** buffer,
- size_t bufferMax);
- const wchar_t *
- ListWidget_GetCommandTitle(ListWidgetCommand *command);
- const wchar_t *
- ListWidget_GetCommandDescription(ListWidgetCommand *command);
- HBITMAP
- ListWidget_GetCommandLargeBitmap(WidgetStyle *style,
- ListWidgetCommand *command,
- int width,
- int height);
- HBITMAP
- ListWidget_GetCommandSmallBitmap(WidgetStyle *style,
- ListWidgetCommand *command,
- int width,
- int height);
- BOOL
- ListWidget_ResetCommandImages(ListWidgetCommand *command);
- BOOL
- ListWidget_GetCommandRect(ListWidgetCommand *command,
- RECT *rect);
- BOOL
- ListWidget_SetCommandRect(ListWidgetCommand *command,
- const RECT *rect);
- BOOL
- ListWidget_GetCommandRectEqual(ListWidgetCommand *command,
- const RECT *rect);
- BOOL
- ListWidget_GetCommandPrimary(ListWidgetCommand *command);
- BOOL
- ListWidget_GetCommandDisabled(ListWidgetCommand *command);
- BOOL
- ListWidget_EnableCommand(ListWidgetCommand *command,
- BOOL enable);
- BOOL
- ListWidget_GetCommandPressed(ListWidgetCommand *command);
- BOOL
- ListWidget_SetCommandPressed(ListWidgetCommand *command,
- BOOL pressed);
- const char *
- ListWidget_GetCommandName(ListWidgetCommand *command);
- /*
- <<<<<<<<<<<<<<<<<<<<<<<<< Paint >>>>>>>>>>>>>>>>>>>>>>>>>
- */
- typedef struct ListWidgetPaintSpacebar
- {
- HBITMAP bitmap;
- long width;
- long height;
- long emptyBarOffset;
- long filledBarOffset;
- } ListWidgetPaintSpacebar;
- typedef struct ListWidgetPaintArrow
- {
- HBITMAP bitmap;
- long width;
- long height;
- long collapsedOffset;
- long expandedOffset;
- } ListWidgetPaintArrow;
- typedef struct ListWidgetPaint
- {
- ListWidget *widget;
- WidgetStyle *style;
- HWND hwnd;
- HDC hdc;
- BOOL erase;
- const RECT *paintRect;
- HDC sourceDC;
- ListWidgetPaintSpacebar spacebar;
- ListWidgetItemMetric itemMetrics;
- ListWidgetCategoryMetric categoryMetrics;
- ListWidgetPaintArrow arrow;
- RECT partRect;
- BOOL focused;
- } ListWidgetPaint;
- BOOL
- ListWidgetPaint_Initialize(ListWidgetPaint *self,
- ListWidget *widget,
- WidgetStyle *style,
- HWND hwnd,
- HDC hdc,
- const RECT *paintRect,
- BOOL erase);
- void
- ListWidgetPaint_Uninitialize(ListWidgetPaint *self);
- BOOL
- ListWidgetPaint_DrawItem(ListWidgetPaint *self,
- ListWidgetItem *item);
- BOOL
- ListWidgetPaint_DrawCategory(ListWidgetPaint *self,
- ListWidgetCategory *category);
- BOOL
- ListWidgetPaint_DrawEmptyCategoryText(ListWidgetPaint *self,
- ListWidgetCategory *category);
- /*
- <<<<<<<<<<<<<<<<<<<<<<<<< Tooltip >>>>>>>>>>>>>>>>>>>>>>>>>
- */
- ListWidgetTooltip*
- ListWidget_TooltipCreate(HWND hwnd);
- void
- ListWidget_TooltipDestroy(ListWidgetTooltip *tooltip);
- void
- ListWidget_TooltipFontChanged(ListWidgetTooltip *tooltip);
- BOOL
- ListWidget_TooltipActivate(ListWidgetTooltip *tooltip,
- const RECT *rect);
- BOOL
- ListWidget_TooltipUpdate(ListWidgetTooltip *tooltip,
- ListWidgetItem *item,
- ListWidgetItemPart part,
- const RECT *partRect);
- void
- ListWidget_TooltipHide(ListWidgetTooltip *tooltip);
- void
- ListWidget_TooltipRelayMouseMessage(ListWidgetTooltip *tooltip,
- unsigned int message,
- unsigned int vKeys,
- const POINT *cursor);
- BOOL
- ListWidget_TooltipProcessNotification(ListWidget *self,
- ListWidgetTooltip *tooltip,
- NMHDR *pnmh,
- LRESULT *result);
- ListWidgetItem *
- ListWidget_TooltipGetCurrent(ListWidgetTooltip *tooltip,
- ListWidgetItemPart *part,
- RECT *partRect);
- BOOL
- ListWidget_TooltipGetChanged(ListWidgetTooltip *tooltip,
- ListWidgetItem *item,
- ListWidgetItemPart part,
- const RECT *partRect);
- typedef enum TooltipUpdateReason
- {
- Tooltip_DeviceTitleChanged = 1,
- Tooltip_DeviceSpaceChanged = 2,
- Tooltip_DeviceActivityChanged = 3,
- Tooltip_DeviceModelChanged = 4,
- Tooltip_DeviceStatusChanged = 5,
- } TooltipUpdateReason;
- BOOL
- ListWidget_TooltipUpdateText(ListWidget *self,
- ListWidgetTooltip *tooltip,
- ListWidgetItem *item,
- TooltipUpdateReason reason);
- #endif //_NULLSOFT_WINAMP_ML_DEVICES_LIST_WIDGET_INTERNAL_HEADER
|