ReactOS  0.4.13-dev-479-gec9c8fd
rebar.c File Reference
#include <assert.h>
#include <stdarg.h>
#include <windows.h>
#include <commctrl.h>
#include <uxtheme.h>
#include "wine/heap.h"
#include "wine/test.h"
Include dependency graph for rebar.c:

Go to the source code of this file.

Classes

struct  rbband_result_t
 
struct  rbsize_result_t
 
struct  rbresize_test_result_t
 

Macros

#define _WIN32_WINNT   0x500
 
#define _WIN32_IE   0x500
 
#define check_rect(name, val, exp)
 
#define check_rect_no_top(name, val, exp)
 
#define compare(val, exp, format)   ok((val) == (exp), #val " value " format " expected " format "\n", (val), (exp));
 
#define expect_eq(line, expr, value, type, format)
 
#define rbsize_results_num   27
 
#define check_sizes_todo(todomask)
 
#define check_sizes()   check_sizes_todo(0)
 
#define comment(fmt, arg1)
 
#define check_client()
 
#define expect_band_content(hRebar, uBand, fStyle, clrFore, clrBack, lpText, iImage, hwndChild, cxMinChild, cyMinChild, cx, hbmBack, wID, cyChild, cyMaxChild, cyIntegral, cxIdeal, lParam, cxHeader, cxHeader_broken)
 
#define X(f)   p##f = (void*)GetProcAddress(hComCtl32, #f);
 

Functions

static BOOL (WINAPI *pImageList_Destroy)(HIMAGELIST)
 
static HIMAGELIST (WINAPI *pImageList_LoadImageA)(HINSTANCE
 
static INT CALLBACK is_font_installed_proc (const LOGFONTA *elf, const TEXTMETRICA *ntm, DWORD type, LPARAM lParam)
 
static BOOL is_font_installed (const char *name)
 
static void init_system_font_height (void)
 
static HWND create_rebar_control (void)
 
static HWND build_toolbar (int nr, HWND hParent)
 
static LRESULT CALLBACK parent_wndproc (HWND hWnd, UINT msg, WPARAM wParam, LPARAM lParam)
 
static int string_width (const CHAR *s)
 
static rbsize_result_t rbsize_init (int cleft, int ctop, int cright, int cbottom, int cyBarHeight, int nRows, int nBands)
 
static void rbsize_add_row (rbsize_result_t *rbsr, int rowHeight)
 
static void rbsize_add_band (rbsize_result_t *rbsr, int left, int top, int right, int bottom, DWORD fStyle, UINT cx)
 
static void rbsize_results_init (void)
 
static void rbsize_results_free (void)
 
static void add_band_w (HWND hRebar, LPCSTR lpszText, int cxMinChild, int cx, int cxIdeal)
 
static void test_layout (void)
 
static void test_resize (void)
 
static void expect_band_content_ (int line, HWND hRebar, UINT uBand, INT fStyle, COLORREF clrFore, COLORREF clrBack, LPCSTR lpText, int iImage, HWND hwndChild, INT cxMinChild, INT cyMinChild, INT cx, HBITMAP hbmBack, INT wID, INT cyChild, INT cyMaxChild, INT cyIntegral, INT cxIdeal, LPARAM lParam, UINT cxHeader, UINT cxHeader_broken)
 
static void test_bandinfo (void)
 
static void test_colors (void)
 
static BOOL register_parent_wnd_class (void)
 
static HWND create_parent_window (void)
 
static void test_showband (void)
 
static void test_notification (void)
 
static void init_functions (void)
 
 START_TEST (rebar)
 

Variables

static LPCSTR
 
static int
 
static COLORREF
 
static UINT
 
static RECT height_change_notify_rect
 
static HWND hMainWnd
 
static int system_font_height
 
static int g_parent_measureitem
 
static rbsize_result_trbsize_results
 
static int rbsize_numtests = 0
 
static const rbresize_test_result_t resize_results []
 
static DWORD resize_numtests = 0
 

Macro Definition Documentation

◆ _WIN32_IE

#define _WIN32_IE   0x500

Definition at line 23 of file rebar.c.

◆ _WIN32_WINNT

#define _WIN32_WINNT   0x500

Definition at line 22 of file rebar.c.

◆ check_client

#define check_client ( )
Value:
{ \
RECT r; \
int value; \
GetWindowRect(hRebar, &r); \
MapWindowPoints(HWND_DESKTOP, hMainWnd, (LPPOINT)&r, 2); \
check_rect_no_top("client", r, res->rc); /* the top coordinate changes after every layout and is very implementation-dependent */ \
} else { \
check_rect("client", r, res->rc); \
} \
value = (int)SendMessageA(hRebar, RB_GETROWCOUNT, 0, 0); \
ok(res->iNumRows == value, "RB_GETROWCOUNT expected %d got %d\n", res->iNumRows, value); \
if (res->heightNotify) { \
RECT rcClient; \
GetClientRect(hRebar, &rcClient); \
check_rect("notify", height_change_notify_rect, rcClient); \
} else ok(height_change_notify_rect.top == -1, "Unexpected RBN_HEIGHTCHANGE received\n"); \
SetRect(&height_change_notify_rect, -1, -1, -1, -1); \
}
static HWND hMainWnd
Definition: rebar.c:40
LRESULT WINAPI SendMessageA(_In_ HWND, _In_ UINT, _In_ WPARAM, _In_ LPARAM)
GLdouble GLdouble GLdouble r
Definition: gl.h:2055
LONG top
Definition: windef.h:292
static RECT height_change_notify_rect
Definition: rebar.c:39
#define CCS_NODIVIDER
Definition: commctrl.h:2220
GLsizei GLenum const GLvoid GLsizei GLenum GLbyte GLbyte GLbyte GLdouble GLdouble GLdouble GLfloat GLfloat GLfloat GLint GLint GLint GLshort GLshort GLshort GLubyte GLubyte GLubyte GLuint GLuint GLuint GLushort GLushort GLushort GLbyte GLbyte GLbyte GLbyte GLdouble GLdouble GLdouble GLdouble GLfloat GLfloat GLfloat GLfloat GLint GLint GLint GLint GLshort GLshort GLshort GLshort GLubyte GLubyte GLubyte GLubyte GLuint GLuint GLuint GLuint GLushort GLushort GLushort GLushort GLboolean const GLdouble const GLfloat const GLint const GLshort const GLbyte const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLdouble const GLfloat const GLfloat const GLint const GLint const GLshort const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort GLenum GLenum GLenum GLfloat GLenum GLint GLenum GLenum GLenum GLfloat GLenum GLenum GLint GLenum GLfloat GLenum GLint GLint GLushort GLenum GLenum GLfloat GLenum GLenum GLint GLfloat const GLubyte GLenum GLenum GLenum const GLfloat GLenum GLenum const GLint GLenum GLint GLint GLsizei GLsizei GLint GLenum GLenum const GLvoid GLenum GLenum const GLfloat GLenum GLenum const GLint GLenum GLenum const GLdouble GLenum GLenum const GLfloat GLenum GLenum const GLint GLsizei GLuint GLfloat GLuint GLbitfield GLfloat GLint GLuint GLboolean GLenum GLfloat GLenum GLbitfield GLenum GLfloat GLfloat GLint GLint const GLfloat GLenum GLfloat GLfloat GLint GLint GLfloat GLfloat GLint GLint const GLfloat GLint GLfloat GLfloat GLint GLfloat GLfloat GLint GLfloat GLfloat const GLdouble const GLfloat const GLdouble const GLfloat GLint i
Definition: glfuncs.h:248
#define ok(value,...)
#define CCS_NOPARENTALIGN
Definition: commctrl.h:2218
#define RB_GETROWCOUNT
Definition: commctrl.h:1558
GLsizei const GLfloat * value
Definition: glext.h:6069
static DWORD resize_numtests
Definition: rebar.c:824
#define ARRAY_SIZE(a)
Definition: main.h:24
static int
Definition: rebar.c:37
static const rbresize_test_result_t resize_results[]
Definition: rebar.c:703
#define HWND_DESKTOP
Definition: winuser.h:1195
GLuint res
Definition: glext.h:9613

Definition at line 827 of file rebar.c.

◆ check_rect

#define check_rect (   name,
  val,
  exp 
)
Value:
"invalid rect (" name ") %s - expected %s\n", wine_dbgstr_rect(&val), wine_dbgstr_rect(&exp));
#define ok(value,...)
GLuint GLfloat * val
Definition: glext.h:7180
const char * wine_dbgstr_rect(const RECT *rect)
BOOL WINAPI EqualRect(_In_ LPCRECT, _In_ LPCRECT)
DWORD exp
Definition: msg.c:15681
Definition: name.c:36

Definition at line 44 of file rebar.c.

◆ check_rect_no_top

#define check_rect_no_top (   name,
  val,
  exp 
)
Value:
{ \
ok((val.bottom - val.top == exp.bottom - exp.top) && \
val.left == exp.left && val.right == exp.right, \
"invalid rect (" name ") %s - expected %s, ignoring top\n", \
GLuint GLfloat * val
Definition: glext.h:7180
const char * wine_dbgstr_rect(const RECT *rect)
DWORD exp
Definition: msg.c:15681
Definition: name.c:36

Definition at line 47 of file rebar.c.

◆ check_sizes

#define check_sizes ( )    check_sizes_todo(0)

Definition at line 476 of file rebar.c.

◆ check_sizes_todo

#define check_sizes_todo (   todomask)
Value:
{ \
RECT rc; \
REBARBANDINFOA rbi; \
int count, i/*, mask=(todomask)*/; \
GetClientRect(hRebar, &rc); \
check_rect("client", rc, res->rcClient); \
count = SendMessageA(hRebar, RB_GETROWCOUNT, 0, 0); \
compare(count, res->nRows, "%d"); \
for (i=0; i<min(count, res->nRows); i++) { \
int height = SendMessageA(hRebar, RB_GETROWHEIGHT, 0, 0);\
ok(height == res->cyRowHeights[i], "Height mismatch for row %d - %d vs %d\n", i, res->cyRowHeights[i], height); \
} \
count = SendMessageA(hRebar, RB_GETBANDCOUNT, 0, 0); \
compare(count, res->nBands, "%d"); \
for (i=0; i<min(count, res->nBands); i++) { \
ok(SendMessageA(hRebar, RB_GETRECT, i, (LPARAM)&rc) == 1, "RB_GETRECT\n"); \
if (!(res->bands[i].fStyle & RBBS_HIDDEN)) \
check_rect("band", rc, res->bands[i].rc); \
rbi.cbSize = REBARBANDINFOA_V6_SIZE; \
rbi.fMask = RBBIM_STYLE | RBBIM_SIZE; \
ok(SendMessageA(hRebar, RB_GETBANDINFOA, i, (LPARAM)&rbi) == 1, "RB_GETBANDINFOA\n"); \
compare(rbi.fStyle, res->bands[i].fStyle, "%x"); \
compare(rbi.cx, res->bands[i].cx, "%d"); \
} \
rbsize_numtests++; \
}
#define RB_GETROWHEIGHT
Definition: commctrl.h:1559
LRESULT WINAPI SendMessageA(_In_ HWND, _In_ UINT, _In_ WPARAM, _In_ LPARAM)
GLuint GLuint GLsizei count
Definition: gl.h:1545
#define RBBIM_STYLE
Definition: commctrl.h:1474
#define RBBIM_SIZE
Definition: commctrl.h:1480
#define RB_GETRECT
Definition: commctrl.h:1554
GLsizei GLenum const GLvoid GLsizei GLenum GLbyte GLbyte GLbyte GLdouble GLdouble GLdouble GLfloat GLfloat GLfloat GLint GLint GLint GLshort GLshort GLshort GLubyte GLubyte GLubyte GLuint GLuint GLuint GLushort GLushort GLushort GLbyte GLbyte GLbyte GLbyte GLdouble GLdouble GLdouble GLdouble GLfloat GLfloat GLfloat GLfloat GLint GLint GLint GLint GLshort GLshort GLshort GLshort GLubyte GLubyte GLubyte GLubyte GLuint GLuint GLuint GLuint GLushort GLushort GLushort GLushort GLboolean const GLdouble const GLfloat const GLint const GLshort const GLbyte const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLdouble const GLfloat const GLfloat const GLint const GLint const GLshort const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort GLenum GLenum GLenum GLfloat GLenum GLint GLenum GLenum GLenum GLfloat GLenum GLenum GLint GLenum GLfloat GLenum GLint GLint GLushort GLenum GLenum GLfloat GLenum GLenum GLint GLfloat const GLubyte GLenum GLenum GLenum const GLfloat GLenum GLenum const GLint GLenum GLint GLint GLsizei GLsizei GLint GLenum GLenum const GLvoid GLenum GLenum const GLfloat GLenum GLenum const GLint GLenum GLenum const GLdouble GLenum GLenum const GLfloat GLenum GLenum const GLint GLsizei GLuint GLfloat GLuint GLbitfield GLfloat GLint GLuint GLboolean GLenum GLfloat GLenum GLbitfield GLenum GLfloat GLfloat GLint GLint const GLfloat GLenum GLfloat GLfloat GLint GLint GLfloat GLfloat GLint GLint const GLfloat GLint GLfloat GLfloat GLint GLfloat GLfloat GLint GLfloat GLfloat const GLdouble const GLfloat const GLdouble const GLfloat GLint i
Definition: glfuncs.h:248
#define RB_GETBANDINFOA
Definition: commctrl.h:1582
#define RB_GETBANDCOUNT
Definition: commctrl.h:1557
LONG_PTR LPARAM
Definition: windef.h:208
static rbsize_result_t * rbsize_results
Definition: rebar.c:246
#define RB_GETROWCOUNT
Definition: commctrl.h:1558
GLint GLint GLsizei GLsizei height
Definition: gl.h:1546
static int rbsize_numtests
Definition: rebar.c:446
#define RBBS_HIDDEN
Definition: commctrl.h:1464
#define min(a, b)
Definition: monoChain.cc:55
GLuint res
Definition: glext.h:9613
#define REBARBANDINFOA_V6_SIZE
Definition: commctrl.h:1513

Definition at line 448 of file rebar.c.

◆ comment

#define comment (   fmt,
  arg1 
)

Definition at line 826 of file rebar.c.

◆ compare

#define compare (   val,
  exp,
  format 
)    ok((val) == (exp), #val " value " format " expected " format "\n", (val), (exp));

Definition at line 53 of file rebar.c.

◆ expect_band_content

#define expect_band_content (   hRebar,
  uBand,
  fStyle,
  clrFore,
  clrBack,
  lpText,
  iImage,
  hwndChild,
  cxMinChild,
  cyMinChild,
  cx,
  hbmBack,
  wID,
  cyChild,
  cyMaxChild,
  cyIntegral,
  cxIdeal,
  lParam,
  cxHeader,
  cxHeader_broken 
)
Value:
expect_band_content_(__LINE__, hRebar, uBand, fStyle, clrFore, clrBack,\
lpText, iImage, hwndChild, cxMinChild, cyMinChild, cx, hbmBack, wID,\
cyChild, cyMaxChild, cyIntegral, cxIdeal, lParam, cxHeader, cxHeader_broken)
static void expect_band_content_(int line, HWND hRebar, UINT uBand, INT fStyle, COLORREF clrFore, COLORREF clrBack, LPCSTR lpText, int iImage, HWND hwndChild, INT cxMinChild, INT cyMinChild, INT cx, HBITMAP hbmBack, INT wID, INT cyChild, INT cyMaxChild, INT cyIntegral, INT cxIdeal, LPARAM lParam, UINT cxHeader, UINT cxHeader_broken)
Definition: rebar.c:904
_Out_opt_ int * cx
Definition: commctrl.h:570
LPARAM lParam
Definition: combotst.c:139

Definition at line 942 of file rebar.c.

◆ expect_eq

#define expect_eq (   line,
  expr,
  value,
  type,
  format 
)
Value:
{ type ret = expr;\
ok((value) == ret, #expr " expected " format " got " format " from line %d\n", (value), (ret), line); }
LOCAL int expr(arg_t *ap, int *altp)
Definition: match.c:512
GLuint GLuint GLsizei GLenum type
Definition: gl.h:1545
Definition: query.h:86
GLint GLint GLsizei GLsizei GLsizei GLint GLenum format
Definition: gl.h:1546
Definition: parser.c:48
int ret

Definition at line 55 of file rebar.c.

◆ rbsize_results_num

#define rbsize_results_num   27

Definition at line 248 of file rebar.c.

◆ X

#define X (   f)    p##f = (void*)GetProcAddress(hComCtl32, #f);

Function Documentation

◆ add_band_w()

static void add_band_w ( HWND  hRebar,
LPCSTR  lpszText,
int  cxMinChild,
int  cx,
int  cxIdeal 
)
static

Definition at line 480 of file rebar.c.

481 {
483  REBARBANDINFOA rbi;
484 
485  if (lpszText != NULL)
486  strcpy(buffer, lpszText);
489  rbi.cx = cx;
490  rbi.cxMinChild = cxMinChild;
491  rbi.cxIdeal = cxIdeal;
492  rbi.cyMinChild = 20;
493  rbi.hwndChild = build_toolbar(1, hRebar);
494  rbi.lpText = (lpszText ? buffer : NULL);
495  SendMessageA(hRebar, RB_INSERTBANDA, -1, (LPARAM)&rbi);
496 }
#define RBBIM_CHILD
Definition: commctrl.h:1478
LRESULT WINAPI SendMessageA(_In_ HWND, _In_ UINT, _In_ WPARAM, _In_ LPARAM)
char CHAR
Definition: xmlstorage.h:175
GLuint buffer
Definition: glext.h:5915
#define RBBIM_SIZE
Definition: commctrl.h:1480
#define RB_INSERTBANDA
Definition: commctrl.h:1547
smooth NULL
Definition: ftsmooth.c:416
LONG_PTR LPARAM
Definition: windef.h:208
#define RBBIM_TEXT
Definition: commctrl.h:1476
#define MAX_PATH
Definition: compat.h:26
#define RBBIM_CHILDSIZE
Definition: commctrl.h:1479
static HWND build_toolbar(int nr, HWND hParent)
Definition: rebar.c:99
_Out_opt_ int * cx
Definition: commctrl.h:570
char * strcpy(char *DstString, const char *SrcString)
Definition: utclib.c:388
#define REBARBANDINFOA_V6_SIZE
Definition: commctrl.h:1513
#define RBBIM_IDEALSIZE
Definition: commctrl.h:1483

Referenced by test_colors(), test_layout(), and test_resize().

◆ BOOL()

static BOOL ( WINAPI pImageList_Destroy)
static

◆ build_toolbar()

static HWND build_toolbar ( int  nr,
HWND  hParent 
)
static

Definition at line 99 of file rebar.c.

100 {
101  TBBUTTON btns[8];
104  int iBitmapId = 0;
105  int i;
106 
107  ok(hToolbar != NULL, "Toolbar creation problem\n");
108  ok(SendMessageA(hToolbar, TB_BUTTONSTRUCTSIZE, sizeof(TBBUTTON), 0) == 0, "TB_BUTTONSTRUCTSIZE failed\n");
109  ok(SendMessageA(hToolbar, TB_AUTOSIZE, 0, 0) == 0, "TB_AUTOSIZE failed\n");
110  ok(SendMessageA(hToolbar, WM_SETFONT, (WPARAM)GetStockObject(SYSTEM_FONT), 0)==1, "WM_SETFONT\n");
111 
112  for (i=0; i<5+nr; i++)
113  {
114  btns[i].iBitmap = i;
115  btns[i].idCommand = i;
116  btns[i].fsStyle = BTNS_BUTTON;
117  btns[i].fsState = TBSTATE_ENABLED;
118  btns[i].iString = 0;
119  }
120 
121  switch (nr)
122  {
123  case 0: iBitmapId = IDB_HIST_SMALL_COLOR; break;
124  case 1: iBitmapId = IDB_VIEW_SMALL_COLOR; break;
125  case 2: iBitmapId = IDB_STD_SMALL_COLOR; break;
126  }
127  ok(SendMessageA(hToolbar, TB_LOADIMAGES, iBitmapId, (LPARAM)HINST_COMMCTRL) == 0, "TB_LOADIMAGES failed\n");
128  ok(SendMessageA(hToolbar, TB_ADDBUTTONSA, 5+nr, (LPARAM)btns), "TB_ADDBUTTONSA failed\n");
129  return hToolbar;
130 }
HGDIOBJ WINAPI GetStockObject(_In_ int)
#define TB_BUTTONSTRUCTSIZE
Definition: commctrl.h:1106
ULONG nr
Definition: thread.c:7
LRESULT WINAPI SendMessageA(_In_ HWND, _In_ UINT, _In_ WPARAM, _In_ LPARAM)
#define IDB_STD_SMALL_COLOR
Definition: commctrl.h:1036
UINT_PTR WPARAM
Definition: windef.h:207
#define WS_CHILD
Definition: pedump.c:617
BYTE fsStyle
Definition: commctrl.h:924
GLsizei GLenum const GLvoid GLsizei GLenum GLbyte GLbyte GLbyte GLdouble GLdouble GLdouble GLfloat GLfloat GLfloat GLint GLint GLint GLshort GLshort GLshort GLubyte GLubyte GLubyte GLuint GLuint GLuint GLushort GLushort GLushort GLbyte GLbyte GLbyte GLbyte GLdouble GLdouble GLdouble GLdouble GLfloat GLfloat GLfloat GLfloat GLint GLint GLint GLint GLshort GLshort GLshort GLshort GLubyte GLubyte GLubyte GLubyte GLuint GLuint GLuint GLuint GLushort GLushort GLushort GLushort GLboolean const GLdouble const GLfloat const GLint const GLshort const GLbyte const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLdouble const GLfloat const GLfloat const GLint const GLint const GLshort const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort GLenum GLenum GLenum GLfloat GLenum GLint GLenum GLenum GLenum GLfloat GLenum GLenum GLint GLenum GLfloat GLenum GLint GLint GLushort GLenum GLenum GLfloat GLenum GLenum GLint GLfloat const GLubyte GLenum GLenum GLenum const GLfloat GLenum GLenum const GLint GLenum GLint GLint GLsizei GLsizei GLint GLenum GLenum const GLvoid GLenum GLenum const GLfloat GLenum GLenum const GLint GLenum GLenum const GLdouble GLenum GLenum const GLfloat GLenum GLenum const GLint GLsizei GLuint GLfloat GLuint GLbitfield GLfloat GLint GLuint GLboolean GLenum GLfloat GLenum GLbitfield GLenum GLfloat GLfloat GLint GLint const GLfloat GLenum GLfloat GLfloat GLint GLint GLfloat GLfloat GLint GLint const GLfloat GLint GLfloat GLfloat GLint GLfloat GLfloat GLint GLfloat GLfloat const GLdouble const GLfloat const GLdouble const GLfloat GLint i
Definition: glfuncs.h:248
#define BTNS_BUTTON
Definition: commctrl.h:970
#define TB_AUTOSIZE
Definition: commctrl.h:1109
#define ok(value,...)
smooth NULL
Definition: ftsmooth.c:416
#define SYSTEM_FONT
Definition: wingdi.h:910
LONG_PTR LPARAM
Definition: windef.h:208
INT_PTR iString
Definition: commctrl.h:931
int iBitmap
Definition: commctrl.h:921
#define IDB_VIEW_SMALL_COLOR
Definition: commctrl.h:1038
#define CCS_NORESIZE
Definition: commctrl.h:2217
int idCommand
Definition: commctrl.h:922
const DOCKBAR PVOID HWND hParent
Definition: tooldock.h:22
HMODULE WINAPI DECLSPEC_HOTPATCH GetModuleHandleA(LPCSTR lpModuleName)
Definition: loader.c:819
#define TOOLBARCLASSNAMEA
Definition: commctrl.h:916
#define TB_LOADIMAGES
Definition: commctrl.h:1124
#define TB_ADDBUTTONSA
Definition: commctrl.h:1078
#define WM_SETFONT
Definition: winuser.h:1632
#define HINST_COMMCTRL
Definition: commctrl.h:1035
#define TBSTATE_ENABLED
Definition: commctrl.h:946
HWND WINAPI CreateWindowExA(_In_ DWORD dwExStyle, _In_opt_ LPCSTR lpClassName, _In_opt_ LPCSTR lpWindowName, _In_ DWORD dwStyle, _In_ int X, _In_ int Y, _In_ int nWidth, _In_ int nHeight, _In_opt_ HWND hWndParent, _In_opt_ HMENU hMenu, _In_opt_ HINSTANCE hInstance, _In_opt_ LPVOID lpParam)
BYTE fsState
Definition: commctrl.h:923
#define IDB_HIST_SMALL_COLOR
Definition: commctrl.h:1040
#define WS_VISIBLE
Definition: pedump.c:620
static const CLSID *static CLSID *static const GUID VARIANT VARIANT *static IServiceProvider DWORD *static HMENU
Definition: ordinal.c:60

Referenced by add_band_w(), and test_layout().

◆ create_parent_window()

static HWND create_parent_window ( void  )
static

Definition at line 1075 of file rebar.c.

1076 {
1077  HWND hwnd;
1078 
1079  if (!register_parent_wnd_class()) return NULL;
1080 
1081  hwnd = CreateWindowExA(0, "MyTestWnd", "Blah", WS_OVERLAPPEDWINDOW,
1084  NULL, NULL, GetModuleHandleA(NULL), 0);
1085 
1087  return hwnd;
1088 }
const DOCKBAR PVOID HWND HWND * hwnd
Definition: tooldock.h:22
static BOOL register_parent_wnd_class(void)
Definition: rebar.c:1057
BOOL WINAPI ShowWindow(_In_ HWND, _In_ int)
#define CW_USEDEFAULT
Definition: winuser.h:225
smooth NULL
Definition: ftsmooth.c:416
#define SM_CYSIZEFRAME
Definition: winuser.h:985
#define SW_SHOW
Definition: winuser.h:769
#define SM_CXSIZEFRAME
Definition: winuser.h:983
#define SM_CYCAPTION
Definition: winuser.h:953
int WINAPI GetSystemMetrics(_In_ int)
HMODULE WINAPI DECLSPEC_HOTPATCH GetModuleHandleA(LPCSTR lpModuleName)
Definition: loader.c:819
HWND WINAPI CreateWindowExA(_In_ DWORD dwExStyle, _In_opt_ LPCSTR lpClassName, _In_opt_ LPCSTR lpWindowName, _In_ DWORD dwStyle, _In_ int X, _In_ int Y, _In_ int nWidth, _In_ int nHeight, _In_opt_ HWND hWndParent, _In_opt_ HMENU hMenu, _In_opt_ HINSTANCE hInstance, _In_opt_ LPVOID lpParam)
#define WS_OVERLAPPEDWINDOW
Definition: pedump.c:637

Referenced by START_TEST().

◆ create_rebar_control()

static HWND create_rebar_control ( void  )
static

Definition at line 86 of file rebar.c.

87 {
88  HWND hwnd;
89 
92  ok(hwnd != NULL, "Failed to create Rebar\n");
93 
95 
96  return hwnd;
97 }
HGDIOBJ WINAPI GetStockObject(_In_ int)
const DOCKBAR PVOID HWND HWND * hwnd
Definition: tooldock.h:22
#define REBARCLASSNAMEA
Definition: commctrl.h:1436
static HWND hMainWnd
Definition: rebar.c:40
LRESULT WINAPI SendMessageA(_In_ HWND, _In_ UINT, _In_ WPARAM, _In_ LPARAM)
UINT_PTR WPARAM
Definition: windef.h:207
#define WS_CHILD
Definition: pedump.c:617
#define ok(value,...)
#define CreateWindowA(a, b, c, d, e, f, g, h, i, j, k)
Definition: winuser.h:4184
smooth NULL
Definition: ftsmooth.c:416
#define SYSTEM_FONT
Definition: wingdi.h:910
HMODULE WINAPI DECLSPEC_HOTPATCH GetModuleHandleA(LPCSTR lpModuleName)
Definition: loader.c:819
#define WM_SETFONT
Definition: winuser.h:1632
#define WS_VISIBLE
Definition: pedump.c:620
static const CLSID *static CLSID *static const GUID VARIANT VARIANT *static IServiceProvider DWORD *static HMENU
Definition: ordinal.c:60

Referenced by test_bandinfo(), test_colors(), test_layout(), test_notification(), and test_showband().

◆ expect_band_content_()

static void expect_band_content_ ( int  line,
HWND  hRebar,
UINT  uBand,
INT  fStyle,
COLORREF  clrFore,
COLORREF  clrBack,
LPCSTR  lpText,
int  iImage,
HWND  hwndChild,
INT  cxMinChild,
INT  cyMinChild,
INT  cx,
HBITMAP  hbmBack,
INT  wID,
INT  cyChild,
INT  cyMaxChild,
INT  cyIntegral,
INT  cxIdeal,
LPARAM  lParam,
UINT  cxHeader,
UINT  cxHeader_broken 
)
static

Definition at line 904 of file rebar.c.

909 {
910  CHAR buf[MAX_PATH] = "abc";
911  REBARBANDINFOA rb;
912 
913  memset(&rb, 0xdd, sizeof(rb));
918  rb.lpText = buf;
919  rb.cch = MAX_PATH;
920  ok(SendMessageA(hRebar, RB_GETBANDINFOA, uBand, (LPARAM)&rb), "RB_GETBANDINFOA failed from line %d\n", line);
921  expect_eq(line, rb.fStyle, fStyle, int, "%x");
922  expect_eq(line, rb.clrFore, clrFore, COLORREF, "%x");
923  expect_eq(line, rb.clrBack, clrBack, COLORREF, "%x");
924  expect_eq(line, strcmp(rb.lpText, lpText), 0, int, "%d");
925  expect_eq(line, rb.iImage, iImage, int, "%x");
926  expect_eq(line, rb.hwndChild, hwndChild, HWND, "%p");
927  expect_eq(line, rb.cxMinChild, cxMinChild, int, "%d");
928  expect_eq(line, rb.cyMinChild, cyMinChild, int, "%d");
929  expect_eq(line, rb.cx, cx, int, "%d");
930  expect_eq(line, rb.hbmBack, hbmBack, HBITMAP, "%p");
931  expect_eq(line, rb.wID, wID, int, "%d");
932  /* the values of cyChild, cyMaxChild and cyIntegral can't be read unless the band is RBBS_VARIABLEHEIGHT */
933  expect_eq(line, rb.cyChild, cyChild, int, "%x");
934  expect_eq(line, rb.cyMaxChild, cyMaxChild, int, "%x");
935  expect_eq(line, rb.cyIntegral, cyIntegral, int, "%x");
936  expect_eq(line, rb.cxIdeal, cxIdeal, int, "%d");
937  expect_eq(line, rb.lParam, lParam, LPARAM, "%ld");
938  ok(rb.cxHeader == cxHeader || rb.cxHeader == cxHeader + 1 || broken(rb.cxHeader == cxHeader_broken),
939  "expected %d for %d from line %d\n", cxHeader, rb.cxHeader, line);
940 }
#define RBBIM_CHILD
Definition: commctrl.h:1478
GLenum GLuint GLenum GLsizei const GLchar * buf
Definition: glext.h:7751
LRESULT WINAPI SendMessageA(_In_ HWND, _In_ UINT, _In_ WPARAM, _In_ LPARAM)
char CHAR
Definition: xmlstorage.h:175
#define RBBIM_HEADERSIZE
Definition: commctrl.h:1485
COLORREF clrBack
Definition: commctrl.h:1492
#define RBBIM_ID
Definition: commctrl.h:1482
#define RBBIM_LPARAM
Definition: commctrl.h:1484
#define RBBIM_IMAGE
Definition: commctrl.h:1477
#define RBBIM_STYLE
Definition: commctrl.h:1474
#define RBBIM_SIZE
Definition: commctrl.h:1480
#define RB_GETBANDINFOA
Definition: commctrl.h:1582
#define ok(value,...)
LONG_PTR LPARAM
Definition: windef.h:208
Definition: parser.c:48
#define RBBIM_COLORS
Definition: commctrl.h:1475
#define RBBIM_TEXT
Definition: commctrl.h:1476
DWORD COLORREF
Definition: windef.h:285
#define MAX_PATH
Definition: compat.h:26
#define RBBIM_CHILDSIZE
Definition: commctrl.h:1479
#define broken(x)
Definition: _sntprintf.h:21
COLORREF clrFore
Definition: commctrl.h:1491
#define expect_eq(line, expr, value, type, format)
Definition: rebar.c:55
_Out_opt_ int * cx
Definition: commctrl.h:570
#define REBARBANDINFOA_V6_SIZE
Definition: commctrl.h:1513
int strcmp(const char *String1, const char *String2)
Definition: utclib.c:469
static HBITMAP
Definition: button.c:44
#define memset(x, y, z)
Definition: compat.h:39
LPARAM lParam
Definition: combotst.c:139
#define RBBIM_IDEALSIZE
Definition: commctrl.h:1483
#define RBBIM_BACKGROUND
Definition: commctrl.h:1481

◆ HIMAGELIST()

static HIMAGELIST ( WINAPI pImageList_LoadImageA)
static

◆ init_functions()

static void init_functions ( void  )
static

Definition at line 1134 of file rebar.c.

1135 {
1136  HMODULE hComCtl32 = LoadLibraryA("comctl32.dll");
1137 
1138 #define X(f) p##f = (void*)GetProcAddress(hComCtl32, #f);
1141 #undef X
1142 }
HIMAGELIST WINAPI ImageList_LoadImageA(HINSTANCE hi, LPCSTR lpbmp, INT cx, INT cGrow, COLORREF clrMask, UINT uType, UINT uFlags)
Definition: imagelist.c:2105
BOOL WINAPI ImageList_Destroy(HIMAGELIST himl)
Definition: imagelist.c:925
HINSTANCE WINAPI DECLSPEC_HOTPATCH LoadLibraryA(LPCSTR lpLibFileName)
Definition: loader.c:111
#define X(f)

Referenced by START_TEST().

◆ init_system_font_height()

static void init_system_font_height ( void  )
static

Definition at line 75 of file rebar.c.

75  {
76  HDC hDC;
78 
81  DeleteDC(NULL);
82 
83  system_font_height = tm.tmHeight;
84 }
static int system_font_height
Definition: rebar.c:41
static HDC
Definition: imagelist.c:92
HDC WINAPI CreateCompatibleDC(_In_opt_ HDC hdc)
smooth NULL
Definition: ftsmooth.c:416
BOOL WINAPI GetTextMetricsA(_In_ HDC, _Out_ LPTEXTMETRICA)
Definition: text.c:200
Definition: time.h:76
static HDC hDC
Definition: 3dtext.c:33
BOOL WINAPI DeleteDC(_In_ HDC)

Referenced by START_TEST().

◆ is_font_installed()

static BOOL is_font_installed ( const char name)
static

Definition at line 63 of file rebar.c.

64 {
65  HDC hdc = GetDC(0);
66  BOOL ret = FALSE;
67 
69  ret = TRUE;
70 
71  ReleaseDC(0, hdc);
72  return ret;
73 }
#define TRUE
Definition: types.h:120
HDC WINAPI GetDC(_In_opt_ HWND)
static HDC
Definition: imagelist.c:92
unsigned int BOOL
Definition: ntddk_ex.h:94
int WINAPI EnumFontFamiliesA(_In_ HDC, _In_opt_ LPCSTR, _In_ FONTENUMPROCA, _In_ LPARAM)
int WINAPI ReleaseDC(_In_opt_ HWND, _In_ HDC)
int ret
HDC hdc
Definition: main.c:9
Definition: name.c:36
static INT CALLBACK is_font_installed_proc(const LOGFONTA *elf, const TEXTMETRICA *ntm, DWORD type, LPARAM lParam)
Definition: rebar.c:58

Referenced by START_TEST().

◆ is_font_installed_proc()

static INT CALLBACK is_font_installed_proc ( const LOGFONTA elf,
const TEXTMETRICA ntm,
DWORD  type,
LPARAM  lParam 
)
static

Definition at line 58 of file rebar.c.

59 {
60  return 0;
61 }

Referenced by is_font_installed().

◆ parent_wndproc()

static LRESULT CALLBACK parent_wndproc ( HWND  hWnd,
UINT  msg,
WPARAM  wParam,
LPARAM  lParam 
)
static

Definition at line 134 of file rebar.c.

135 {
136  switch (msg)
137  {
138  case WM_NOTIFY:
139  {
140  NMHDR *lpnm = (NMHDR *)lParam;
141  if (lpnm->code == RBN_HEIGHTCHANGE)
143  }
144  break;
145  case WM_MEASUREITEM:
147  break;
148  }
149  return DefWindowProcA(hWnd, msg, wParam, lParam);
150 }
#define RBN_HEIGHTCHANGE
Definition: commctrl.h:1600
HWND hWnd
Definition: settings.c:17
static RECT height_change_notify_rect
Definition: rebar.c:39
WPARAM wParam
Definition: combotst.c:138
UINT code
Definition: winuser.h:3112
#define WM_MEASUREITEM
Definition: winuser.h:1628
LRESULT WINAPI DefWindowProcA(_In_ HWND, _In_ UINT, _In_ WPARAM, _In_ LPARAM)
HWND hwndFrom
Definition: winuser.h:3110
BOOL WINAPI GetClientRect(_In_ HWND, _Out_ LPRECT)
#define msg(x)
Definition: auth_time.c:54
static int g_parent_measureitem
Definition: rebar.c:132
LPARAM lParam
Definition: combotst.c:139
#define WM_NOTIFY
Definition: richedit.h:61

Referenced by register_parent_wnd_class().

◆ rbsize_add_band()

static void rbsize_add_band ( rbsize_result_t rbsr,
int  left,
int  top,
int  right,
int  bottom,
DWORD  fStyle,
UINT  cx 
)
static

Definition at line 238 of file rebar.c.

239 {
240  SetRect(&(rbsr->bands[rbsr->nBands].rc), left, top, right, bottom);
241  rbsr->bands[rbsr->nBands].fStyle = fStyle;
242  rbsr->bands[rbsr->nBands].cx = cx;
243  rbsr->nBands++;
244 }
rbband_result_t * bands
Definition: rebar.c:216
GLint GLint bottom
Definition: glext.h:7726
GLint left
Definition: glext.h:7726
GLdouble GLdouble right
Definition: glext.h:10859
BOOL WINAPI SetRect(_Out_ LPRECT, _In_ int, _In_ int, _In_ int, _In_ int)
DWORD fStyle
Definition: rebar.c:206
_Out_opt_ int * cx
Definition: commctrl.h:570
GLdouble GLdouble GLdouble GLdouble top
Definition: glext.h:10859

Referenced by rbsize_results_init().

◆ rbsize_add_row()

static void rbsize_add_row ( rbsize_result_t rbsr,
int  rowHeight 
)
static

Definition at line 233 of file rebar.c.

233  {
234  rbsr->cyRowHeights[rbsr->nRows] = rowHeight;
235  rbsr->nRows++;
236 }
int * cyRowHeights
Definition: rebar.c:214

Referenced by rbsize_results_init().

◆ rbsize_init()

static rbsize_result_t rbsize_init ( int  cleft,
int  ctop,
int  cright,
int  cbottom,
int  cyBarHeight,
int  nRows,
int  nBands 
)
static

Definition at line 219 of file rebar.c.

220 {
222 
223  SetRect(&ret.rcClient, cleft, ctop, cright, cbottom);
224  ret.cyBarHeight = cyBarHeight;
225  ret.nRows = 0;
226  ret.cyRowHeights = heap_alloc_zero(nRows * sizeof(int));
227  ret.nBands = 0;
228  ret.bands = heap_alloc_zero(nBands * sizeof(*ret.bands));
229 
230  return ret;
231 }
int ret
BOOL WINAPI SetRect(_Out_ LPRECT, _In_ int, _In_ int, _In_ int, _In_ int)
int nRows
Definition: appswitch.c:56

Referenced by rbsize_results_init().

◆ rbsize_results_free()

static void rbsize_results_free ( void  )
static

Definition at line 434 of file rebar.c.

435 {
436  int i;
437 
438  for (i = 0; i < rbsize_results_num; i++) {
439  heap_free(rbsize_results[i].cyRowHeights);
440  heap_free(rbsize_results[i].bands);
441  }
444 }
GLsizei GLenum const GLvoid GLsizei GLenum GLbyte GLbyte GLbyte GLdouble GLdouble GLdouble GLfloat GLfloat GLfloat GLint GLint GLint GLshort GLshort GLshort GLubyte GLubyte GLubyte GLuint GLuint GLuint GLushort GLushort GLushort GLbyte GLbyte GLbyte GLbyte GLdouble GLdouble GLdouble GLdouble GLfloat GLfloat GLfloat GLfloat GLint GLint GLint GLint GLshort GLshort GLshort GLshort GLubyte GLubyte GLubyte GLubyte GLuint GLuint GLuint GLuint GLushort GLushort GLushort GLushort GLboolean const GLdouble const GLfloat const GLint const GLshort const GLbyte const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLdouble const GLfloat const GLfloat const GLint const GLint const GLshort const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort GLenum GLenum GLenum GLfloat GLenum GLint GLenum GLenum GLenum GLfloat GLenum GLenum GLint GLenum GLfloat GLenum GLint GLint GLushort GLenum GLenum GLfloat GLenum GLenum GLint GLfloat const GLubyte GLenum GLenum GLenum const GLfloat GLenum GLenum const GLint GLenum GLint GLint GLsizei GLsizei GLint GLenum GLenum const GLvoid GLenum GLenum const GLfloat GLenum GLenum const GLint GLenum GLenum const GLdouble GLenum GLenum const GLfloat GLenum GLenum const GLint GLsizei GLuint GLfloat GLuint GLbitfield GLfloat GLint GLuint GLboolean GLenum GLfloat GLenum GLbitfield GLenum GLfloat GLfloat GLint GLint const GLfloat GLenum GLfloat GLfloat GLint GLint GLfloat GLfloat GLint GLint const GLfloat GLint GLfloat GLfloat GLint GLfloat GLfloat GLint GLfloat GLfloat const GLdouble const GLfloat const GLdouble const GLfloat GLint i
Definition: glfuncs.h:248
smooth NULL
Definition: ftsmooth.c:416
static rbsize_result_t * rbsize_results
Definition: rebar.c:246
#define rbsize_results_num
Definition: rebar.c:248
static BOOL heap_free(void *mem)
Definition: appwiz.h:75

Referenced by test_layout().

◆ rbsize_results_init()

static void rbsize_results_init ( void  )
static

Definition at line 250 of file rebar.c.

251 {
253 
254  rbsize_results[0] = rbsize_init(0, 0, 672, 0, 0, 0, 0);
255 
256  rbsize_results[1] = rbsize_init(0, 0, 672, 4, 4, 1, 1);
258  rbsize_add_band(&rbsize_results[1], 0, 0, 672, 4, 0x00, 200);
259 
260  rbsize_results[2] = rbsize_init(0, 0, 672, 4, 4, 1, 2);
262  rbsize_add_band(&rbsize_results[2], 0, 0, 200, 4, 0x00, 200);
263  rbsize_add_band(&rbsize_results[2], 200, 0, 672, 4, 0x04, 200);
264 
265  rbsize_results[3] = rbsize_init(0, 0, 672, 30, 30, 1, 3);
267  rbsize_add_band(&rbsize_results[3], 0, 0, 200, 30, 0x00, 200);
268  rbsize_add_band(&rbsize_results[3], 200, 0, 400, 30, 0x04, 200);
269  rbsize_add_band(&rbsize_results[3], 400, 0, 672, 30, 0x00, 200);
270 
271  rbsize_results[4] = rbsize_init(0, 0, 672, 34, 34, 1, 4);
273  rbsize_add_band(&rbsize_results[4], 0, 0, 200, 34, 0x00, 200);
274  rbsize_add_band(&rbsize_results[4], 200, 0, 400, 34, 0x04, 200);
275  rbsize_add_band(&rbsize_results[4], 400, 0, 604, 34, 0x00, 200);
276  rbsize_add_band(&rbsize_results[4], 604, 0, 672, 34, 0x04, 68);
277 
278  rbsize_results[5] = rbsize_init(0, 0, 672, 34, 34, 1, 4);
280  rbsize_add_band(&rbsize_results[5], 0, 0, 200, 34, 0x00, 200);
281  rbsize_add_band(&rbsize_results[5], 200, 0, 400, 34, 0x04, 200);
282  rbsize_add_band(&rbsize_results[5], 400, 0, 604, 34, 0x00, 200);
283  rbsize_add_band(&rbsize_results[5], 604, 0, 672, 34, 0x04, 68);
284 
285  rbsize_results[6] = rbsize_init(0, 0, 672, 34, 34, 1, 4);
287  rbsize_add_band(&rbsize_results[6], 0, 0, 200, 34, 0x00, 200);
288  rbsize_add_band(&rbsize_results[6], 202, 0, 402, 34, 0x04, 200);
289  rbsize_add_band(&rbsize_results[6], 404, 0, 604, 34, 0x00, 200);
290  rbsize_add_band(&rbsize_results[6], 606, 0, 672, 34, 0x04, 66);
291 
292  rbsize_results[7] = rbsize_init(0, 0, 672, 70, 70, 2, 5);
295  rbsize_add_band(&rbsize_results[7], 0, 0, 142, 34, 0x00, 200);
296  rbsize_add_band(&rbsize_results[7], 144, 0, 557, 34, 0x00, 200);
297  rbsize_add_band(&rbsize_results[7], 559, 0, 672, 34, 0x04, 200);
298  rbsize_add_band(&rbsize_results[7], 0, 36, 200, 70, 0x00, 200);
299  rbsize_add_band(&rbsize_results[7], 202, 36, 672, 70, 0x04, 66);
300 
301  rbsize_results[8] = rbsize_init(0, 0, 672, 34, 34, 1, 5);
303  rbsize_add_band(&rbsize_results[8], 0, 0, 167, 34, 0x00, 200);
304  rbsize_add_band(&rbsize_results[8], 169, 0, 582, 34, 0x00, 200);
305  rbsize_add_band(&rbsize_results[8], 559, 0, 759, 34, 0x08, 200);
306  rbsize_add_band(&rbsize_results[8], 584, 0, 627, 34, 0x00, 200);
307  rbsize_add_band(&rbsize_results[8], 629, 0, 672, 34, 0x04, 66);
308 
309  rbsize_results[9] = rbsize_init(0, 0, 672, 34, 34, 1, 4);
311  rbsize_add_band(&rbsize_results[9], 0, 0, 167, 34, 0x00, 200);
312  rbsize_add_band(&rbsize_results[9], 169, 0, 582, 34, 0x00, 200);
313  rbsize_add_band(&rbsize_results[9], 584, 0, 627, 34, 0x00, 200);
314  rbsize_add_band(&rbsize_results[9], 629, 0, 672, 34, 0x04, 66);
315 
316  rbsize_results[10] = rbsize_init(0, 0, 672, 34, 34, 1, 3);
317  rbsize_add_row(&rbsize_results[10], 34);
318  rbsize_add_band(&rbsize_results[10], 0, 0, 413, 34, 0x00, 200);
319  rbsize_add_band(&rbsize_results[10], 415, 0, 615, 34, 0x00, 200);
320  rbsize_add_band(&rbsize_results[10], 617, 0, 672, 34, 0x04, 66);
321 
322  rbsize_results[11] = rbsize_init(0, 0, 672, 34, 34, 1, 2);
323  rbsize_add_row(&rbsize_results[11], 34);
324  rbsize_add_band(&rbsize_results[11], 0, 0, 604, 34, 0x00, 200);
325  rbsize_add_band(&rbsize_results[11], 606, 0, 672, 34, 0x04, 66);
326 
327  rbsize_results[12] = rbsize_init(0, 0, 672, 8 + 2*system_font_height, 40, 2, 5);
330  rbsize_add_band(&rbsize_results[12], 0, 0, 87 + string_width("ABC"), 4 + system_font_height, 0x00, 40);
331  rbsize_add_band(&rbsize_results[12], 87 + string_width("ABC"), 0, 157 + string_width("ABC"), 4 + system_font_height, 0x00, 70);
332  rbsize_add_band(&rbsize_results[12], 157 + string_width("ABC"), 0, 397 + string_width("ABC"), 4 + system_font_height, 0x00, 240);
333  rbsize_add_band(&rbsize_results[12], 397 + string_width("ABC"), 0, 672, 4 + system_font_height, 0x00, 60);
334  rbsize_add_band(&rbsize_results[12], 0, 4 + system_font_height, 672, 8 + 2*system_font_height, 0x00, 200);
335 
336  rbsize_results[13] = rbsize_init(0, 0, 672, 8 + 2*system_font_height, 40, 2, 5);
339  rbsize_add_band(&rbsize_results[13], 0, 0, 87 + string_width("ABC"), 4 + system_font_height, 0x00, 40);
340  rbsize_add_band(&rbsize_results[13], 87 + string_width("ABC"), 0, 200 + string_width("ABC"), 4 + system_font_height, 0x00, 113);
341  rbsize_add_band(&rbsize_results[13], 200 + string_width("ABC"), 0, 397 + string_width("ABC"), 4 + system_font_height, 0x00, 197);
342  rbsize_add_band(&rbsize_results[13], 397 + string_width("ABC"), 0, 672, 4 + system_font_height, 0x00, 60);
343  rbsize_add_band(&rbsize_results[13], 0, 4 + system_font_height, 672, 8 + 2*system_font_height, 0x00, 200);
344 
345  rbsize_results[14] = rbsize_init(0, 0, 672, 8 + 2*system_font_height, 40, 2, 5);
348  rbsize_add_band(&rbsize_results[14], 0, 0, 87 + string_width("ABC"), 4 + system_font_height, 0x00, 40);
349  rbsize_add_band(&rbsize_results[14], 87 + string_width("ABC"), 0, 412 - string_width("MMMMMMM"), 4 + system_font_height, 0x00, 325 - string_width("ABC") - string_width("MMMMMMM"));
350  rbsize_add_band(&rbsize_results[14], 412 - string_width("MMMMMMM"), 0, 595 - string_width("MMMMMMM"), 4 + system_font_height, 0x00, 183);
351  rbsize_add_band(&rbsize_results[14], 595 - string_width("MMMMMMM"), 0, 672, 4 + system_font_height, 0x00, 77 + string_width("MMMMMMM"));
352  rbsize_add_band(&rbsize_results[14], 0, 4 + system_font_height, 672, 8 + 2*system_font_height, 0x00, 200);
353 
354  rbsize_results[15] = rbsize_init(0, 0, 672, 8 + 2*system_font_height, 40, 2, 5);
357  rbsize_add_band(&rbsize_results[15], 0, 0, 87 + string_width("ABC"), 4 + system_font_height, 0x00, 40);
358  rbsize_add_band(&rbsize_results[15], 87 + string_width("ABC"), 0, 140 + string_width("ABC"), 4 + system_font_height, 0x00, 53);
359  rbsize_add_band(&rbsize_results[15], 140 + string_width("ABC"), 0, 595 - string_width("MMMMMMM"), 4 + system_font_height, 0x00, 455 - string_width("MMMMMMM") - string_width("ABC"));
360  rbsize_add_band(&rbsize_results[15], 595 - string_width("MMMMMMM"), 0, 672, 4 + system_font_height, 0x00, 77 + string_width("MMMMMMM"));
361  rbsize_add_band(&rbsize_results[15], 0, 4 + system_font_height, 672, 8 + 2*system_font_height, 0x00, 200);
362 
363  rbsize_results[16] = rbsize_init(0, 0, 672, 8 + 2*system_font_height, 40, 2, 5);
366  rbsize_add_band(&rbsize_results[16], 0, 0, 87 + string_width("ABC"), 4 + system_font_height, 0x00, 40);
367  rbsize_add_band(&rbsize_results[16], 87 + string_width("ABC"), 0, 412 - string_width("MMMMMMM"), 4 + system_font_height, 0x00, 325 - string_width("ABC") - string_width("MMMMMMM"));
368  rbsize_add_band(&rbsize_results[16], 412 - string_width("MMMMMMM"), 0, 595 - string_width("MMMMMMM"), 4 + system_font_height, 0x00, 183);
369  rbsize_add_band(&rbsize_results[16], 595 - string_width("MMMMMMM"), 0, 672, 4 + system_font_height, 0x00, 77 + string_width("MMMMMMM"));
370  rbsize_add_band(&rbsize_results[16], 0, 4 + system_font_height, 672, 8 + 2*system_font_height, 0x00, 200);
371 
372  rbsize_results[17] = rbsize_init(0, 0, 672, 8 + 2*system_font_height, 40, 2, 5);
375  rbsize_add_band(&rbsize_results[17], 0, 0, 87 + string_width("ABC"), 4 + system_font_height, 0x00, 40);
376  rbsize_add_band(&rbsize_results[17], 87 + string_width("ABC"), 0, 412 - string_width("MMMMMMM"), 4 + system_font_height, 0x00, 325 - string_width("ABC") - string_width("MMMMMMM"));
377  rbsize_add_band(&rbsize_results[17], 412 - string_width("MMMMMMM"), 0, 595 - string_width("MMMMMMM"), 4 + system_font_height, 0x00, 183);
378  rbsize_add_band(&rbsize_results[17], 595 - string_width("MMMMMMM"), 0, 672, 4 + system_font_height, 0x00, 77 + string_width("MMMMMMM"));
379  rbsize_add_band(&rbsize_results[17], 0, 4 + system_font_height, 672, 8 + 2*system_font_height, 0x00, 200);
380 
381  rbsize_results[18] = rbsize_init(0, 0, 672, 56, 56, 2, 5);
382  rbsize_add_row(&rbsize_results[18], 28);
383  rbsize_add_row(&rbsize_results[18], 28);
384  rbsize_add_band(&rbsize_results[18], 0, 0, 87 + string_width("ABC"), 28, 0x00, 40);
385  rbsize_add_band(&rbsize_results[18], 87 + string_width("ABC"), 0, 412 - string_width("MMMMMMM"), 28, 0x00, 325 - string_width("ABC") - string_width("MMMMMMM"));
386  rbsize_add_band(&rbsize_results[18], 412 - string_width("MMMMMMM"), 0, 595 - string_width("MMMMMMM"), 28, 0x00, 183);
387  rbsize_add_band(&rbsize_results[18], 595 - string_width("MMMMMMM"), 0, 672, 28, 0x00, 77 + string_width("MMMMMMM"));
388  rbsize_add_band(&rbsize_results[18], 0, 28, 672, 56, 0x00, 200);
389 
390  rbsize_results[19] = rbsize_init(0, 0, 672, 8 + 2*system_font_height, 40, 2, 5);
393  rbsize_add_band(&rbsize_results[19], 0, 0, 87 + string_width("ABC"), 4 + system_font_height, 0x00, 40);
394  rbsize_add_band(&rbsize_results[19], 87 + string_width("ABC"), 0, 412 - string_width("MMMMMMM"), 4 + system_font_height, 0x00, 325 - string_width("ABC") - string_width("MMMMMMM"));
395  rbsize_add_band(&rbsize_results[19], 412 - string_width("MMMMMMM"), 0, 595 - string_width("MMMMMMM"), 4 + system_font_height, 0x00, 183);
396  rbsize_add_band(&rbsize_results[19], 595 - string_width("MMMMMMM"), 0, 672, 4 + system_font_height, 0x00, 77 + string_width("MMMMMMM"));
397  rbsize_add_band(&rbsize_results[19], 0, 4 + system_font_height, 672, 8 + 2*system_font_height, 0x00, 200);
398 
399  rbsize_results[20] = rbsize_init(0, 0, 672, 56, 56, 2, 5);
400  rbsize_add_row(&rbsize_results[20], 28);
401  rbsize_add_row(&rbsize_results[20], 28);
402  rbsize_add_band(&rbsize_results[20], 0, 0, 87 + string_width("ABC"), 28, 0x00, 40);
403  rbsize_add_band(&rbsize_results[20], 87 + string_width("ABC"), 0, 412 - string_width("MMMMMMM"), 28, 0x00, 325 - string_width("ABC") - string_width("MMMMMMM"));
404  rbsize_add_band(&rbsize_results[20], 412 - string_width("MMMMMMM"), 0, 595 - string_width("MMMMMMM"), 28, 0x00, 183);
405  rbsize_add_band(&rbsize_results[20], 595 - string_width("MMMMMMM"), 0, 672, 28, 0x00, 77 + string_width("MMMMMMM"));
406  rbsize_add_band(&rbsize_results[20], 0, 28, 672, 56, 0x00, 200);
407 
408  rbsize_results[21] = rbsize_init(0, 0, 672, 0, 0, 0, 0);
409 
410  rbsize_results[22] = rbsize_init(0, 0, 672, 65, 56, 1, 3);
411  rbsize_add_row(&rbsize_results[22], 65);
412  rbsize_add_band(&rbsize_results[22], 0, 0, 90, 65, 0x40, 90);
413  rbsize_add_band(&rbsize_results[22], 90, 0, 180, 65, 0x40, 90);
414  rbsize_add_band(&rbsize_results[22], 180, 0, 672, 65, 0x40, 90);
415 
416  rbsize_results[23] = rbsize_init(0, 0, 0, 226, 0, 0, 0);
417 
418  rbsize_results[24] = rbsize_init(0, 0, 65, 226, 65, 1, 1);
419  rbsize_add_row(&rbsize_results[24], 65);
420  rbsize_add_band(&rbsize_results[24], 0, 0, 226, 65, 0x40, 90);
421 
422  rbsize_results[25] = rbsize_init(0, 0, 65, 226, 65, 1, 2);
423  rbsize_add_row(&rbsize_results[25], 65);
424  rbsize_add_band(&rbsize_results[25], 0, 0, 90, 65, 0x40, 90);
425  rbsize_add_band(&rbsize_results[25], 90, 0, 226, 65, 0x40, 90);
426 
427  rbsize_results[26] = rbsize_init(0, 0, 65, 226, 65, 1, 3);
428  rbsize_add_row(&rbsize_results[26], 65);
429  rbsize_add_band(&rbsize_results[26], 0, 0, 90, 65, 0x40, 90);
430  rbsize_add_band(&rbsize_results[26], 90, 0, 163, 65, 0x40, 90);
431  rbsize_add_band(&rbsize_results[26], 163, 0, 226, 65, 0x40, 90);
432 }
static int system_font_height
Definition: rebar.c:41
static rbsize_result_t rbsize_init(int cleft, int ctop, int cright, int cbottom, int cyBarHeight, int nRows, int nBands)
Definition: rebar.c:219
static void * heap_alloc(size_t len)
Definition: appwiz.h:65
static int string_width(const CHAR *s)
Definition: rebar.c:193
static rbsize_result_t * rbsize_results
Definition: rebar.c:246
static void rbsize_add_band(rbsize_result_t *rbsr, int left, int top, int right, int bottom, DWORD fStyle, UINT cx)
Definition: rebar.c:238
#define rbsize_results_num
Definition: rebar.c:248
static void rbsize_add_row(rbsize_result_t *rbsr, int rowHeight)
Definition: rebar.c:233

Referenced by test_layout().

◆ register_parent_wnd_class()

static BOOL register_parent_wnd_class ( void  )
static

Definition at line 1057 of file rebar.c.

1058 {
1059  WNDCLASSA wc;
1060 
1061  wc.style = CS_HREDRAW | CS_VREDRAW;
1062  wc.cbClsExtra = 0;
1063  wc.cbWndExtra = 0;
1065  wc.hIcon = NULL;
1068  wc.lpszMenuName = NULL;
1069  wc.lpszClassName = "MyTestWnd";
1071 
1072  return RegisterClassA(&wc);
1073 }
int cbClsExtra
Definition: winuser.h:3118
#define CS_HREDRAW
Definition: winuser.h:648
LPCSTR lpszMenuName
Definition: winuser.h:3124
HBRUSH hbrBackground
Definition: winuser.h:3123
#define COLOR_WINDOW
Definition: winuser.h:908
#define IDC_IBEAM
Definition: winuser.h:683
int cbWndExtra
Definition: winuser.h:3119
HCURSOR hCursor
Definition: winuser.h:3122
smooth NULL
Definition: ftsmooth.c:416
const char * LPCSTR
Definition: xmlstorage.h:183
#define CS_VREDRAW
Definition: winuser.h:653
HMODULE WINAPI DECLSPEC_HOTPATCH GetModuleHandleA(LPCSTR lpModuleName)
Definition: loader.c:819
LPCSTR lpszClassName
Definition: winuser.h:3125
HCURSOR WINAPI LoadCursorA(_In_opt_ HINSTANCE, _In_ LPCSTR)
Definition: cursoricon.c:2059
UINT style
Definition: winuser.h:3116
HINSTANCE hInstance
Definition: winuser.h:3120
WNDPROC lpfnWndProc
Definition: winuser.h:3117
HBRUSH WINAPI GetSysColorBrush(_In_ int)
static LRESULT CALLBACK parent_wndproc(HWND hWnd, UINT msg, WPARAM wParam, LPARAM lParam)
Definition: rebar.c:134
ATOM WINAPI RegisterClassA(_In_ CONST WNDCLASSA *)
HICON hIcon
Definition: winuser.h:3121

Referenced by create_parent_window().

◆ START_TEST()

START_TEST ( rebar  )

Definition at line 1144 of file rebar.c.

1145 {
1146  MSG msg;
1147 
1149  init_functions();
1150 
1152 
1153  test_bandinfo();
1154  test_colors();
1155  test_showband();
1157 
1158  if(!is_font_installed("System") || !is_font_installed("Tahoma"))
1159  {
1160  skip("Missing System or Tahoma font\n");
1161  goto out;
1162  }
1163 
1164  test_layout();
1165  test_resize();
1166 
1167 out:
1168  PostQuitMessage(0);
1169  while(GetMessageA(&msg,0,0,0)) {
1172  }
1174 }
BOOL WINAPI TranslateMessage(_In_ const MSG *)
LRESULT WINAPI DispatchMessageA(_In_ const MSG *)
static void test_colors(void)
Definition: rebar.c:1009
static void init_system_font_height(void)
Definition: rebar.c:75
static HWND hMainWnd
Definition: rebar.c:40
static void test_showband(void)
Definition: rebar.c:1090
TW_UINT32 TW_UINT16 TW_UINT16 MSG
Definition: twain.h:1827
BOOL WINAPI GetMessageA(_Out_ LPMSG, _In_opt_ HWND, _In_ UINT, _In_ UINT)
static BOOL is_font_installed(const char *name)
Definition: rebar.c:63
BOOL WINAPI DestroyWindow(_In_ HWND)
static void test_bandinfo(void)
Definition: rebar.c:949
static void init_functions(void)
Definition: rebar.c:1134
static FILE * out
Definition: regtests2xml.c:44
static void test_notification(void)
Definition: rebar.c:1120
static HWND create_parent_window(void)
Definition: rebar.c:1075
#define skip(...)
#define msg(x)
Definition: auth_time.c:54
static void test_layout(void)
Definition: rebar.c:498
__analysis_noreturn void WINAPI PostQuitMessage(_In_ int)
static void test_resize(void)
Definition: rebar.c:851

◆ string_width()

static int string_width ( const CHAR s)
static

Definition at line 193 of file rebar.c.

193  {
194  SIZE sz;
195  HDC hdc;
196 
199  DeleteDC(hdc);
200 
201  return sz.cx;
202 }
ACPI_SIZE strlen(const char *String)
Definition: utclib.c:269
static HDC
Definition: imagelist.c:92
HDC WINAPI CreateCompatibleDC(_In_opt_ HDC hdc)
smooth NULL
Definition: ftsmooth.c:416
LONG cx
Definition: windef.h:319
BOOL WINAPI GetTextExtentPoint32A(_In_ HDC hdc, _In_reads_(c) LPCSTR lpString, _In_ int c, _Out_ LPSIZE psizl)
HDC hdc
Definition: main.c:9
GLdouble s
Definition: gl.h:2039
BOOL WINAPI DeleteDC(_In_ HDC)

Referenced by rbsize_results_init().

◆ test_bandinfo()

static void test_bandinfo ( void  )
static

Definition at line 949 of file rebar.c.

950 {
951  REBARBANDINFOA rb;
952  CHAR szABC[] = "ABC";
953  CHAR szABCD[] = "ABCD";
954  HWND hRebar;
955 
956  hRebar = create_rebar_control();
958  rb.fMask = 0;
959  if (!SendMessageA(hRebar, RB_INSERTBANDA, 0, (LPARAM)&rb))
960  {
961  win_skip( "V6 info not supported\n" );
962  DestroyWindow(hRebar);
963  return;
964  }
965  expect_band_content(hRebar, 0, 0, 0, GetSysColor(COLOR_3DFACE), "", -1, NULL, 0, 0, 0, NULL, 0, 0xdddddddd, 0xdddddddd, 0xdddddddd, 0, 0, 0, -1);
966 
967  rb.fMask = RBBIM_CHILDSIZE;
968  rb.cxMinChild = 15;
969  rb.cyMinChild = 20;
970  rb.cyChild = 30;
971  rb.cyMaxChild = 20;
972  rb.cyIntegral = 10;
973  ok(SendMessageA(hRebar, RB_SETBANDINFOA, 0, (LPARAM)&rb), "RB_SETBANDINFOA failed\n");
974  expect_band_content(hRebar, 0, 0, 0, GetSysColor(COLOR_3DFACE), "", -1, NULL, 15, 20, 0, NULL, 0, 0xdddddddd, 0xdddddddd, 0xdddddddd, 0, 0, 0, -1);
975 
976  rb.fMask = RBBIM_TEXT;
977  rb.lpText = szABC;
978  ok(SendMessageA(hRebar, RB_SETBANDINFOA, 0, (LPARAM)&rb), "RB_SETBANDINFOA failed\n");
979  expect_band_content(hRebar, 0, 0, 0, GetSysColor(COLOR_3DFACE), "ABC", -1, NULL, 15, 20, 0, NULL, 0, 0xdddddddd, 0xdddddddd, 0xdddddddd, 0, 0, 3 + 2*system_font_height, -1);
980 
981  rb.cbSize = REBARBANDINFOA_V6_SIZE;
982  rb.fMask = 0;
983  ok(SendMessageA(hRebar, RB_INSERTBANDA, 1, (LPARAM)&rb), "RB_INSERTBANDA failed\n");
984  expect_band_content(hRebar, 1, 0, 0, GetSysColor(COLOR_3DFACE), "", -1, NULL, 0, 0, 0, NULL, 0, 0xdddddddd, 0xdddddddd, 0xdddddddd, 0, 0, 9, -1);
985  expect_band_content(hRebar, 0, 0, 0, GetSysColor(COLOR_3DFACE), "ABC", -1, NULL, 15, 20, 0, NULL, 0, 0xdddddddd, 0xdddddddd, 0xdddddddd, 0, 0, 8 + 2*system_font_height, -1);
986 
987  rb.fMask = RBBIM_HEADERSIZE;
988  rb.cxHeader = 50;
989  ok(SendMessageA(hRebar, RB_SETBANDINFOA, 0, (LPARAM)&rb), "RB_SETBANDINFOA failed\n");
990  expect_band_content(hRebar, 0, 0x40000000, 0, GetSysColor(COLOR_3DFACE), "ABC", -1, NULL, 15, 20, 0, NULL, 0, 0xdddddddd, 0xdddddddd, 0xdddddddd, 0, 0, 50, -1);
991 
992  rb.cxHeader = 5;
993  ok(SendMessageA(hRebar, RB_SETBANDINFOA, 0, (LPARAM)&rb), "RB_SETBANDINFOA failed\n");
994  expect_band_content(hRebar, 0, 0x40000000, 0, GetSysColor(COLOR_3DFACE), "ABC", -1, NULL, 15, 20, 0, NULL, 0, 0xdddddddd, 0xdddddddd, 0xdddddddd, 0, 0, 5, -1);
995 
996  rb.fMask = RBBIM_TEXT;
997  rb.lpText = szABCD;
998  ok(SendMessageA(hRebar, RB_SETBANDINFOA, 0, (LPARAM)&rb), "RB_SETBANDINFOA failed\n");
999  expect_band_content(hRebar, 0, 0x40000000, 0, GetSysColor(COLOR_3DFACE), "ABCD", -1, NULL, 15, 20, 0, NULL, 0, 0xdddddddd, 0xdddddddd, 0xdddddddd, 0, 0, 5, -1);
1000  rb.fMask = RBBIM_STYLE | RBBIM_TEXT;
1001  rb.fStyle = RBBS_VARIABLEHEIGHT;
1002  rb.lpText = szABC;
1003  ok(SendMessageA(hRebar, RB_SETBANDINFOA, 0, (LPARAM)&rb), "RB_SETBANDINFOA failed\n");
1004  expect_band_content(hRebar, 0, RBBS_VARIABLEHEIGHT, 0, GetSysColor(COLOR_3DFACE), "ABC", -1, NULL, 15, 20, 0, NULL, 0, 20, 0x7fffffff, 0, 0, 0, 8 + 2*system_font_height, 5);
1005 
1006  DestroyWindow(hRebar);
1007 }
static int system_font_height
Definition: rebar.c:41
#define RB_SETBANDINFOA
Definition: commctrl.h:1551
LRESULT WINAPI SendMessageA(_In_ HWND, _In_ UINT, _In_ WPARAM, _In_ LPARAM)
char CHAR
Definition: xmlstorage.h:175
#define RBBIM_HEADERSIZE
Definition: commctrl.h:1485
BOOL WINAPI DestroyWindow(_In_ HWND)
DWORD WINAPI GetSysColor(_In_ int)
static HWND create_rebar_control(void)
Definition: rebar.c:86
#define RBBIM_STYLE
Definition: commctrl.h:1474
#define COLOR_3DFACE
Definition: winuser.h:919
#define ok(value,...)
#define RB_INSERTBANDA
Definition: commctrl.h:1547
smooth NULL
Definition: ftsmooth.c:416
LONG_PTR LPARAM
Definition: windef.h:208
#define RBBS_VARIABLEHEIGHT
Definition: commctrl.h:1467
#define RBBIM_TEXT
Definition: commctrl.h:1476
#define RBBIM_CHILDSIZE
Definition: commctrl.h:1479
#define REBARBANDINFOA_V6_SIZE
Definition: commctrl.h:1513
#define expect_band_content(hRebar, uBand, fStyle, clrFore, clrBack, lpText, iImage, hwndChild, cxMinChild, cyMinChild, cx, hbmBack, wID, cyChild, cyMaxChild, cyIntegral, cxIdeal, lParam, cxHeader, cxHeader_broken)
Definition: rebar.c:942
#define win_skip
Definition: test.h:141

Referenced by START_TEST().

◆ test_colors()

static void test_colors ( void  )
static

Definition at line 1009 of file rebar.c.

1010 {
1012  COLORREF clr;
1013  BOOL ret;
1014  HWND hRebar;
1015  REBARBANDINFOA bi;
1016 
1017  hRebar = create_rebar_control();
1018 
1019  /* test default colors */
1020  clr = SendMessageA(hRebar, RB_GETTEXTCOLOR, 0, 0);
1021  compare(clr, CLR_NONE, "%x");
1022  clr = SendMessageA(hRebar, RB_GETBKCOLOR, 0, 0);
1023  compare(clr, CLR_NONE, "%x");
1024 
1025  scheme.dwSize = sizeof(scheme);
1026  scheme.clrBtnHighlight = 0;
1027  scheme.clrBtnShadow = 0;
1028  ret = SendMessageA(hRebar, RB_GETCOLORSCHEME, 0, (LPARAM)&scheme);
1029  if (ret)
1030  {
1031  compare(scheme.clrBtnHighlight, CLR_DEFAULT, "%x");
1032  compare(scheme.clrBtnShadow, CLR_DEFAULT, "%x");
1033  }
1034  else
1035  skip("RB_GETCOLORSCHEME not supported\n");
1036 
1037  /* check default band colors */
1038  add_band_w(hRebar, "", 0, 10, 10);
1040  bi.fMask = RBBIM_COLORS;
1041  bi.clrFore = bi.clrBack = 0xc0ffe;
1042  ret = SendMessageA(hRebar, RB_GETBANDINFOA, 0, (LPARAM)&bi);
1043  ok(ret, "RB_GETBANDINFOA failed\n");
1044  compare(bi.clrFore, RGB(0, 0, 0), "%x");
1046 
1047  SendMessageA(hRebar, RB_SETTEXTCOLOR, 0, RGB(255, 0, 0));
1048  bi.clrFore = bi.clrBack = 0xc0ffe;
1049  ret = SendMessageA(hRebar, RB_GETBANDINFOA, 0, (LPARAM)&bi);
1050  ok(ret, "RB_GETBANDINFOA failed\n");
1051  compare(bi.clrFore, RGB(0, 0, 0), "%x");
1052 
1053  DestroyWindow(hRebar);
1054 }
#define RB_GETCOLORSCHEME
Definition: commctrl.h:1572
#define RB_GETBKCOLOR
Definition: commctrl.h:1564
static void add_band_w(HWND hRebar, LPCSTR lpszText, int cxMinChild, int cx, int cxIdeal)
Definition: rebar.c:480
LRESULT WINAPI SendMessageA(_In_ HWND, _In_ UINT, _In_ WPARAM, _In_ LPARAM)
COLORREF clrBack
Definition: commctrl.h:1492
DWORD scheme
BOOL WINAPI DestroyWindow(_In_ HWND)
DWORD WINAPI GetSysColor(_In_ int)
static HWND create_rebar_control(void)
Definition: rebar.c:86
#define RB_GETBANDINFOA
Definition: commctrl.h:1582
#define COLOR_3DFACE
Definition: winuser.h:919
unsigned int BOOL
Definition: ntddk_ex.h:94
#define ok(value,...)
LONG_PTR LPARAM
Definition: windef.h:208
#define CLR_NONE
Definition: commctrl.h:304
#define RBBIM_COLORS
Definition: commctrl.h:1475
#define RB_SETTEXTCOLOR
Definition: commctrl.h:1565
DWORD COLORREF
Definition: windef.h:285
#define RGB(r, g, b)
Definition: wingdi.h:2918
int ret
#define compare(val, exp, format)
Definition: rebar.c:53
#define RB_GETTEXTCOLOR
Definition: commctrl.h:1566
COLORREF clrFore
Definition: commctrl.h:1491
#define CLR_DEFAULT
Definition: commctrl.h:305
#define skip(...)
#define REBARBANDINFOA_V6_SIZE
Definition: commctrl.h:1513

Referenced by START_TEST().

◆ test_layout()

static void test_layout ( void  )
static

Definition at line 498 of file rebar.c.

499 {
500  HWND hRebar;
501  REBARBANDINFOA rbi;
503  REBARINFO ri;
504 
506 
507  hRebar = create_rebar_control();
508  check_sizes();
511  rbi.cx = 200;
512  rbi.cxMinChild = 100;
513  rbi.cyMinChild = 30;
514  rbi.hwndChild = NULL;
515  SendMessageA(hRebar, RB_INSERTBANDA, -1, (LPARAM)&rbi);
516  check_sizes();
517 
518  rbi.fMask |= RBBIM_STYLE;
519  rbi.fStyle = RBBS_CHILDEDGE;
520  SendMessageA(hRebar, RB_INSERTBANDA, -1, (LPARAM)&rbi);
521  check_sizes();
522 
523  rbi.fStyle = 0;
524  rbi.cx = 200;
525  rbi.cxMinChild = 30;
526  rbi.cyMinChild = 30;
527  rbi.hwndChild = build_toolbar(0, hRebar);
528  SendMessageA(hRebar, RB_INSERTBANDA, -1, (LPARAM)&rbi);
529  check_sizes();
530 
531  rbi.fStyle = RBBS_CHILDEDGE;
532  rbi.cx = 68;
533  rbi.hwndChild = build_toolbar(0, hRebar);
534  SendMessageA(hRebar, RB_INSERTBANDA, -1, (LPARAM)&rbi);
535  check_sizes();
536 
538  check_sizes(); /* a style change won't start a relayout */
539  rbi.fMask = RBBIM_SIZE;
540  rbi.cx = 66;
541  SendMessageA(hRebar, RB_SETBANDINFOA, 3, (LPARAM)&rbi);
542  check_sizes(); /* here it will be relayouted */
543 
544  /* this will force a new row */
546  rbi.cx = 200;
547  rbi.cxMinChild = 400;
548  rbi.cyMinChild = 30;
549  rbi.hwndChild = build_toolbar(0, hRebar);
550  SendMessageA(hRebar, RB_INSERTBANDA, 1, (LPARAM)&rbi);
551  check_sizes();
552 
553  rbi.fMask = RBBIM_STYLE;
554  rbi.fStyle = RBBS_HIDDEN;
555  SendMessageA(hRebar, RB_SETBANDINFOA, 2, (LPARAM)&rbi);
556  check_sizes();
557 
558  SendMessageA(hRebar, RB_DELETEBAND, 2, 0);
559  check_sizes();
560  SendMessageA(hRebar, RB_DELETEBAND, 0, 0);
561  check_sizes();
562  SendMessageA(hRebar, RB_DELETEBAND, 1, 0);
563  check_sizes();
564 
565  DestroyWindow(hRebar);
566 
567  hRebar = create_rebar_control();
568  add_band_w(hRebar, "ABC", 70, 40, 100);
569  add_band_w(hRebar, NULL, 40, 70, 100);
570  add_band_w(hRebar, NULL, 170, 240, 100);
571  add_band_w(hRebar, "MMMMMMM", 60, 60, 100);
572  add_band_w(hRebar, NULL, 200, 200, 100);
573  check_sizes();
574  SendMessageA(hRebar, RB_MAXIMIZEBAND, 1, TRUE);
575  check_sizes();
576  SendMessageA(hRebar, RB_MAXIMIZEBAND, 1, TRUE);
577  check_sizes();
578  SendMessageA(hRebar, RB_MAXIMIZEBAND, 2, FALSE);
579  check_sizes();
580  SendMessageA(hRebar, RB_MINIMIZEBAND, 2, 0);
581  check_sizes();
582  SendMessageA(hRebar, RB_MINIMIZEBAND, 0, 0);
583  check_sizes();
584 
585  /* an image will increase the band height */
586  himl = pImageList_LoadImageA(GetModuleHandleA("comctl32"), MAKEINTRESOURCEA(121), 24, 2,
588  ri.cbSize = sizeof(ri);
589  ri.fMask = RBIM_IMAGELIST;
590  ri.himl = himl;
591  ok(SendMessageA(hRebar, RB_SETBARINFO, 0, (LPARAM)&ri), "RB_SETBARINFO failed\n");
592  rbi.fMask = RBBIM_IMAGE;
593  rbi.iImage = 1;
594  SendMessageA(hRebar, RB_SETBANDINFOA, 1, (LPARAM)&rbi);
595  check_sizes();
596 
597  /* after removing it everything is back to normal*/
598  rbi.iImage = -1;
599  SendMessageA(hRebar, RB_SETBANDINFOA, 1, (LPARAM)&rbi);
600  check_sizes();
601 
602  /* Only -1 means that the image is not present. Other invalid values increase the height */
603  rbi.iImage = -2;
604  SendMessageA(hRebar, RB_SETBANDINFOA, 1, (LPARAM)&rbi);
605  check_sizes();
606 
607  DestroyWindow(hRebar);
608 
609  /* VARHEIGHT resizing test on a horizontal rebar */
610  hRebar = create_rebar_control();
612  check_sizes();
615  rbi.cxMinChild = 50;
616  rbi.cyMinChild = 10;
617  rbi.cyIntegral = 11;
618  rbi.cyChild = 70;
619  rbi.cyMaxChild = 200;
620  rbi.cx = 90;
621  rbi.hwndChild = build_toolbar(0, hRebar);
622  SendMessageA(hRebar, RB_INSERTBANDA, -1, (LPARAM)&rbi);
623 
624  rbi.cyChild = 50;
625  rbi.hwndChild = build_toolbar(0, hRebar);
626  SendMessageA(hRebar, RB_INSERTBANDA, -1, (LPARAM)&rbi);
627 
628  rbi.cyMinChild = 40;
629  rbi.cyChild = 50;
630  rbi.cyIntegral = 5;
631  rbi.hwndChild = build_toolbar(0, hRebar);
632  SendMessageA(hRebar, RB_INSERTBANDA, -1, (LPARAM)&rbi);
633  check_sizes();
634 
635  DestroyWindow(hRebar);
636 
637  /* VARHEIGHT resizing on a vertical rebar */
638  hRebar = create_rebar_control();
640  check_sizes();
643  rbi.cxMinChild = 50;
644  rbi.cyMinChild = 10;
645  rbi.cyIntegral = 11;
646  rbi.cyChild = 70;
647  rbi.cyMaxChild = 90;
648  rbi.cx = 90;
649  rbi.hwndChild = build_toolbar(0, hRebar);
650  SendMessageA(hRebar, RB_INSERTBANDA, -1, (LPARAM)&rbi);
651  check_sizes();
652 
653  rbi.cyChild = 50;
654  rbi.hwndChild = build_toolbar(0, hRebar);
655  SendMessageA(hRebar, RB_INSERTBANDA, -1, (LPARAM)&rbi);
656  check_sizes();
657 
658  rbi.cyMinChild = 40;
659  rbi.cyChild = 50;
660  rbi.cyIntegral = 5;
661  rbi.hwndChild = build_toolbar(0, hRebar);
662  SendMessageA(hRebar, RB_INSERTBANDA, -1, (LPARAM)&rbi);
663  check_sizes();
664 
666  DestroyWindow(hRebar);
667  pImageList_Destroy(himl);
668 }
#define TRUE
Definition: types.h:120
#define RBBIM_CHILD
Definition: commctrl.h:1478
static void add_band_w(HWND hRebar, LPCSTR lpszText, int cxMinChild, int cx, int cxIdeal)
Definition: rebar.c:480
#define RB_SETBANDINFOA
Definition: commctrl.h:1551
LRESULT WINAPI SendMessageA(_In_ HWND, _In_ UINT, _In_ WPARAM, _In_ LPARAM)
#define RBBS_CHILDEDGE
Definition: commctrl.h:1463
#define MAKEINTRESOURCEA(i)
Definition: winuser.h:581
#define check_sizes()
Definition: rebar.c:476
#define RBIM_IMAGELIST
Definition: commctrl.h:1440
HIMAGELIST himl
BOOL WINAPI DestroyWindow(_In_ HWND)
#define RBBIM_IMAGE
Definition: commctrl.h:1477
#define CCS_VERT
Definition: commctrl.h:2221
#define RBS_BANDBORDERS
Definition: commctrl.h:1444
static HWND create_rebar_control(void)
Definition: rebar.c:86
#define RBBIM_STYLE
Definition: commctrl.h:1474
#define RBBIM_SIZE
Definition: commctrl.h:1480
LONG WINAPI GetWindowLongA(_In_ HWND, _In_ int)
#define RB_MINIMIZEBAND
Definition: commctrl.h:1586
#define ok(value,...)
#define RB_INSERTBANDA
Definition: commctrl.h:1547
smooth NULL
Definition: ftsmooth.c:416
LONG_PTR LPARAM
Definition: windef.h:208
#define CLR_NONE
Definition: commctrl.h:304
#define RB_SETBARINFO
Definition: commctrl.h:1550
#define RBBS_VARIABLEHEIGHT
Definition: commctrl.h:1467
#define RBS_AUTOSIZE
Definition: commctrl.h:1447
static void rbsize_results_free(void)
Definition: rebar.c:434
#define RBBIM_CHILDSIZE
Definition: commctrl.h:1479
HMODULE WINAPI DECLSPEC_HOTPATCH GetModuleHandleA(LPCSTR lpModuleName)
Definition: loader.c:819
HIMAGELIST himl
Definition: commctrl.h:1455
static HWND build_toolbar(int nr, HWND hParent)
Definition: rebar.c:99
#define GWL_STYLE
Definition: winuser.h:846
#define RBBS_HIDDEN
Definition: commctrl.h:1464
LONG WINAPI SetWindowLongA(_In_ HWND, _In_ int, _In_ LONG)
#define IMAGE_BITMAP
Definition: winuser.h:211
#define RB_MAXIMIZEBAND
Definition: commctrl.h:1587
#define RB_DELETEBAND
Definition: commctrl.h:1548
#define REBARBANDINFOA_V6_SIZE
Definition: commctrl.h:1513
#define LR_DEFAULTCOLOR
Definition: winuser.h:1077
static void rbsize_results_init(void)
Definition: rebar.c:250

Referenced by START_TEST().

◆ test_notification()

static void test_notification ( void  )
static

Definition at line 1120 of file rebar.c.

1121 {
1122  MEASUREITEMSTRUCT mis;
1123  HWND rebar;
1124 
1125  rebar = create_rebar_control();
1126 
1128  SendMessageA(rebar, WM_MEASUREITEM, 0, (LPARAM)&mis);
1129  ok(g_parent_measureitem == 1, "got %d\n", g_parent_measureitem);
1130 
1131  DestroyWindow(rebar);
1132 }
LRESULT WINAPI SendMessageA(_In_ HWND, _In_ UINT, _In_ WPARAM, _In_ LPARAM)
BOOL WINAPI DestroyWindow(_In_ HWND)
static HWND create_rebar_control(void)
Definition: rebar.c:86
#define ok(value,...)
LONG_PTR LPARAM
Definition: windef.h:208
#define WM_MEASUREITEM
Definition: winuser.h:1628
static int g_parent_measureitem
Definition: rebar.c:132

Referenced by START_TEST().

◆ test_resize()

static void test_resize ( void  )
static

Definition at line 851 of file rebar.c.

852 {
857 
858  const int styles_count = ARRAY_SIZE(dwStyles);
859  int i;
860 
861  for (i = 0; i < styles_count; i++)
862  {
863  HWND hRebar;
864 
865  comment("style %08x", dwStyles[i]);
866  SetRect(&height_change_notify_rect, -1, -1, -1, -1);
867  hRebar = CreateWindowA(REBARCLASSNAMEA, "A", dwStyles[i] | WS_CHILD | WS_VISIBLE, 10, 5, 500, 15, hMainWnd, NULL, GetModuleHandleA(NULL), 0);
868  check_client();
869  add_band_w(hRebar, NULL, 70, 100, 0);
870  if (dwStyles[i] & CCS_NOPARENTALIGN) /* the window drifts downward for CCS_NOPARENTALIGN without CCS_NODIVIDER */
871  check_client();
872  add_band_w(hRebar, NULL, 70, 100, 0);
873  check_client();
874  MoveWindow(hRebar, 10, 10, 100, 100, TRUE);
875  check_client();
876  MoveWindow(hRebar, 0, 0, 0, 0, TRUE);
877  check_client();
878  /* try to fool the rebar by sending invalid width/height - won't work */
879  if (dwStyles[i] & (CCS_NORESIZE | CCS_NOPARENTALIGN))
880  {
881  WINDOWPOS pos;
882  pos.hwnd = hRebar;
883  pos.hwndInsertAfter = NULL;
884  pos.cx = 500;
885  pos.cy = 500;
886  pos.x = 10;
887  pos.y = 10;
888  pos.flags = 0;
891  check_client();
892  SendMessageA(hRebar, WM_SIZE, SIZE_RESTORED, MAKELONG(500, 500));
893  check_client();
894  }
895  SendMessageA(hRebar, RB_DELETEBAND, 0, 0);
896  check_client();
897  SendMessageA(hRebar, RB_DELETEBAND, 0, 0);
898  MoveWindow(hRebar, 0, 0, 100, 100, TRUE);
899  check_client();
900  DestroyWindow(hRebar);
901  }
902 }
#define TRUE
Definition: types.h:120
static void add_band_w(HWND hRebar, LPCSTR lpszText, int cxMinChild, int cx, int cxIdeal)
Definition: rebar.c:480
#define REBARCLASSNAMEA
Definition: commctrl.h:1436
static HWND hMainWnd
Definition: rebar.c:40
LRESULT WINAPI SendMessageA(_In_ HWND, _In_ UINT, _In_ WPARAM, _In_ LPARAM)
#define SIZE_RESTORED
Definition: winuser.h:2459
#define WS_CHILD
Definition: pedump.c:617
#define comment(fmt, arg1)
Definition: rebar.c:826
static RECT height_change_notify_rect
Definition: rebar.c:39
BOOL WINAPI DestroyWindow(_In_ HWND)
#define CCS_VERT
Definition: commctrl.h:2221
#define CCS_NODIVIDER
Definition: commctrl.h:2220
GLsizei GLenum const GLvoid GLsizei GLenum GLbyte GLbyte GLbyte GLdouble GLdouble GLdouble GLfloat GLfloat GLfloat GLint GLint GLint GLshort GLshort GLshort GLubyte GLubyte GLubyte GLuint GLuint GLuint GLushort GLushort GLushort GLbyte GLbyte GLbyte GLbyte GLdouble GLdouble GLdouble GLdouble GLfloat GLfloat GLfloat GLfloat GLint GLint GLint GLint GLshort GLshort GLshort GLshort GLubyte GLubyte GLubyte GLubyte GLuint GLuint GLuint GLuint GLushort GLushort GLushort GLushort GLboolean const GLdouble const GLfloat const GLint const GLshort const GLbyte const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLdouble const GLfloat const GLfloat const GLint const GLint const GLshort const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort GLenum GLenum GLenum GLfloat GLenum GLint GLenum GLenum GLenum GLfloat GLenum GLenum GLint GLenum GLfloat GLenum GLint GLint GLushort GLenum GLenum GLfloat GLenum GLenum GLint GLfloat const GLubyte GLenum GLenum GLenum const GLfloat GLenum GLenum const GLint GLenum GLint GLint GLsizei GLsizei GLint GLenum GLenum const GLvoid GLenum GLenum const GLfloat GLenum GLenum const GLint GLenum GLenum const GLdouble GLenum GLenum const GLfloat GLenum GLenum const GLint GLsizei GLuint GLfloat GLuint GLbitfield GLfloat GLint GLuint GLboolean GLenum GLfloat GLenum GLbitfield GLenum GLfloat GLfloat GLint GLint const GLfloat GLenum GLfloat GLfloat GLint GLint GLfloat GLfloat GLint GLint const GLfloat GLint GLfloat GLfloat GLint GLfloat GLfloat GLint GLfloat GLfloat const GLdouble const GLfloat const GLdouble const GLfloat GLint i
Definition: glfuncs.h:248
#define CreateWindowA(a, b, c, d, e, f, g, h, i, j, k)
Definition: winuser.h:4184
#define MAKELONG(a, b)
Definition: typedefs.h:248
smooth NULL
Definition: ftsmooth.c:416
LONG_PTR LPARAM
Definition: windef.h:208
#define CCS_TOP
Definition: commctrl.h:2214
#define CCS_NOPARENTALIGN
Definition: commctrl.h:2218
#define CCS_BOTTOM
Definition: commctrl.h:2216
#define WM_SIZE
Definition: winuser.h:1593
#define WM_WINDOWPOSCHANGING
Definition: winuser.h:1643
unsigned long DWORD
Definition: ntddk_ex.h:95
#define CCS_NORESIZE
Definition: commctrl.h:2217
HMODULE WINAPI DECLSPEC_HOTPATCH GetModuleHandleA(LPCSTR lpModuleName)
Definition: loader.c:819
BOOL WINAPI MoveWindow(_In_ HWND, _In_ int, _In_ int, _In_ int, _In_ int, _In_ BOOL)
BOOL WINAPI SetRect(_Out_ LPRECT, _In_ int, _In_ int, _In_ int, _In_ int)
#define WS_BORDER
Definition: pedump.c:625
#define ARRAY_SIZE(a)
Definition: main.h:24
#define CCS_RIGHT
Definition: commctrl.h:2223
#define WM_WINDOWPOSCHANGED
Definition: winuser.h:1644
#define CCS_NOMOVEY
Definition: commctrl.h:2215
#define RB_DELETEBAND
Definition: commctrl.h:1548
#define check_client()
Definition: rebar.c:827
#define WS_VISIBLE
Definition: pedump.c:620

Referenced by START_TEST().

◆ test_showband()

static void test_showband ( void  )
static

Definition at line 1090 of file rebar.c.

1091 {
1092  HWND hRebar;
1093  REBARBANDINFOA rbi;
1094  BOOL ret;
1095 
1096  hRebar = create_rebar_control();
1097 
1098  /* no bands */
1099  ret = SendMessageA(hRebar, RB_SHOWBAND, 0, TRUE);
1100  ok(ret == FALSE, "got %d\n", ret);
1101 
1104  rbi.cx = 200;
1105  rbi.cxMinChild = 100;
1106  rbi.cyMinChild = 30;
1107  rbi.hwndChild = NULL;
1108  SendMessageA(hRebar, RB_INSERTBANDA, -1, (LPARAM)&rbi);
1109 
1110  /* index out of range */
1111  ret = SendMessageA(hRebar, RB_SHOWBAND, 1, TRUE);
1112  ok(ret == FALSE, "got %d\n", ret);
1113 
1114  ret = SendMessageA(hRebar, RB_SHOWBAND, 0, TRUE);
1115  ok(ret == TRUE, "got %d\n", ret);
1116 
1117  DestroyWindow(hRebar);
1118 }
#define TRUE
Definition: types.h:120
#define RBBIM_CHILD
Definition: commctrl.h:1478
LRESULT WINAPI SendMessageA(_In_ HWND, _In_ UINT, _In_ WPARAM, _In_ LPARAM)
BOOL WINAPI DestroyWindow(_In_ HWND)
static HWND create_rebar_control(void)
Definition: rebar.c:86
#define RBBIM_SIZE
Definition: commctrl.h:1480
unsigned int BOOL
Definition: ntddk_ex.h:94
#define ok(value,...)
#define RB_INSERTBANDA
Definition: commctrl.h:1547
smooth NULL
Definition: ftsmooth.c:416
LONG_PTR LPARAM
Definition: windef.h:208
#define RBBIM_CHILDSIZE
Definition: commctrl.h:1479
#define RB_SHOWBAND
Definition: commctrl.h:1590
int ret
#define REBARBANDINFOA_V6_SIZE
Definition: commctrl.h:1513

Referenced by START_TEST().

Variable Documentation

◆ COLORREF

Definition at line 37 of file rebar.c.

◆ g_parent_measureitem

int g_parent_measureitem
static

Definition at line 132 of file rebar.c.

Referenced by parent_wndproc(), and test_notification().

◆ height_change_notify_rect

RECT height_change_notify_rect
static

Definition at line 39 of file rebar.c.

Referenced by parent_wndproc(), and test_resize().

◆ hMainWnd

HWND hMainWnd
static

Definition at line 40 of file rebar.c.

Referenced by create_rebar_control(), START_TEST(), and test_resize().

◆ int

int

Definition at line 37 of file rebar.c.

Referenced by REBAR_SizeToHeight().

◆ LPCSTR

Definition at line 37 of file rebar.c.

◆ rbsize_numtests

int rbsize_numtests = 0
static

Definition at line 446 of file rebar.c.

◆ rbsize_results

rbsize_result_t* rbsize_results
static

Definition at line 246 of file rebar.c.

Referenced by rbsize_results_free(), and rbsize_results_init().

◆ resize_numtests

DWORD resize_numtests = 0
static

Definition at line 824 of file rebar.c.

◆ resize_results

const rbresize_test_result_t resize_results[]
static

Definition at line 703 of file rebar.c.

◆ system_font_height

int system_font_height
static

Definition at line 41 of file rebar.c.

Referenced by init_system_font_height(), rbsize_results_init(), and test_bandinfo().

◆ UINT

Definition at line 37 of file rebar.c.

Referenced by REBAR_DeleteBand().