Skip to content

Commit

Permalink
rename function to be more transparent
Browse files Browse the repository at this point in the history
  • Loading branch information
jmalak committed Jun 30, 2021
1 parent 9b9da4f commit 090072e
Show file tree
Hide file tree
Showing 13 changed files with 39 additions and 31 deletions.
5 changes: 3 additions & 2 deletions bld/gui/c/guiscale.c
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@
*
* Open Watcom Project
*
* Copyright (c) 2002-2021 The Open Watcom Contributors. All Rights Reserved.
* Portions Copyright (c) 1983-2002 Sybase, Inc. All Rights Reserved.
*
* ========================================================================
Expand Down Expand Up @@ -139,12 +140,12 @@ bool GUIScreenToScaleR( gui_coord *coord )
return( GUIConvert( SCREEN, SCALE, coord, true ) );
}

void GUIScaleToScreenRPt( gui_point *point )
void GUIScaleToScreenPointR( gui_point *point )
{
GUIConvertPoint( SCALE, SCREEN, point );
}

void GUIScreenToScaleRPt( gui_point *point )
void GUIScreenToScalePointR( gui_point *point )
{
GUIConvertPoint( SCREEN, SCALE, point );
}
12 changes: 6 additions & 6 deletions bld/gui/h/gui.h
Original file line number Diff line number Diff line change
Expand Up @@ -402,18 +402,18 @@ typedef const char *res_name_or_id;
#endif

typedef struct gui_coord {
gui_ord x;
gui_ord y;
gui_ord x;
gui_ord y;
} gui_coord;

typedef struct gui_text_coord {
gui_text_ord x;
gui_text_ord y;
gui_text_ord x;
gui_text_ord y;
} gui_text_coord;

typedef struct gui_point {
int x;
int y;
int x;
int y;
} gui_point;

typedef struct gui_window gui_window;
Expand Down
5 changes: 3 additions & 2 deletions bld/gui/h/guiscale.h
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@
*
* Open Watcom Project
*
* Copyright (c) 2002-2021 The Open Watcom Contributors. All Rights Reserved.
* Portions Copyright (c) 1983-2002 Sybase, Inc. All Rights Reserved.
*
* ========================================================================
Expand Down Expand Up @@ -43,7 +44,7 @@ extern bool GUIScaleToScreenR( gui_coord *coord );
extern bool GUIScreenToScale( gui_coord *coord );
extern bool GUIScreenToScaleR( gui_coord *coord );

extern void GUIScaleToScreenRPt( gui_point *point );
extern void GUIScreenToScaleRPt( gui_point *point );
extern void GUIScaleToScreenPointR( gui_point *point );
extern void GUIScreenToScalePointR( gui_point *point );

#endif // _GUISCALE_H_
6 changes: 3 additions & 3 deletions bld/gui/ui/c/guicursr.c
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
*
* Open Watcom Project
*
* Copyright (c) 2002-2019 The Open Watcom Contributors. All Rights Reserved.
* Copyright (c) 2002-2021 The Open Watcom Contributors. All Rights Reserved.
* Portions Copyright (c) 1983-2002 Sybase, Inc. All Rights Reserved.
*
* ========================================================================
Expand Down Expand Up @@ -45,7 +45,7 @@ bool GUISetCursorPos( gui_window *wnd, gui_point *point )

if( wnd->style & GUI_CURSOR ) {
pt = *point;
GUIScaleToScreenRPt( &pt );
GUIScaleToScreenPointR( &pt );
if( ( wnd->hgadget != NULL ) && !GUI_HSCROLL_EVENTS_SET( wnd ) ) {
pt.x -= wnd->hgadget->pos;
}
Expand Down Expand Up @@ -75,7 +75,7 @@ bool GUIGetCursorPos( gui_window *wnd, gui_point *point )
if( ( wnd->vgadget != NULL ) && !GUI_VSCROLL_EVENTS_SET( wnd ) ) {
point->y += wnd->vgadget->pos;
}
GUIScreenToScaleRPt( point );
GUIScreenToScalePointR( point );
return( true );
}

Expand Down
6 changes: 3 additions & 3 deletions bld/gui/ui/c/guidrawr.c
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
*
* Open Watcom Project
*
* Copyright (c) 2002-2019 The Open Watcom Contributors. All Rights Reserved.
* Copyright (c) 2002-2021 The Open Watcom Contributors. All Rights Reserved.
* Portions Copyright (c) 1983-2002 Sybase, Inc. All Rights Reserved.
*
* ========================================================================
Expand Down Expand Up @@ -159,8 +159,8 @@ bool GUIDrawLine( gui_window *wnd, gui_point *start, gui_point *end,

my_start = *start;
my_end = *end;
GUIScaleToScreenRPt( &my_start );
GUIScaleToScreenRPt( &my_end );
GUIScaleToScreenPointR( &my_start );
GUIScaleToScreenPointR( &my_end );

area.row = my_start.y;
area.height = my_end.y - my_start.y + 1;
Expand Down
4 changes: 2 additions & 2 deletions bld/gui/ui/c/guifloat.c
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
*
* Open Watcom Project
*
* Copyright (c) 2002-2020 The Open Watcom Contributors. All Rights Reserved.
* Copyright (c) 2002-2021 The Open Watcom Contributors. All Rights Reserved.
* Portions Copyright (c) 1983-2002 Sybase, Inc. All Rights Reserved.
*
* ========================================================================
Expand Down Expand Up @@ -61,7 +61,7 @@ static gui_window *MenuWnd = NULL;

static void MapLocation( gui_window *wnd, gui_point *point )
{
GUIScaleToScreenRPt( point );
GUIScaleToScreenPointR( point );
if( ( wnd->hgadget != NULL ) && !GUI_HSCROLL_EVENTS_SET( wnd ) ) {
point->x -= wnd->hgadget->pos;
}
Expand Down
5 changes: 3 additions & 2 deletions bld/gui/ui/c/guigetpt.c
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@
*
* Open Watcom Project
*
* Copyright (c) 2002-2021 The Open Watcom Contributors. All Rights Reserved.
* Portions Copyright (c) 1983-2002 Sybase, Inc. All Rights Reserved.
*
* ========================================================================
Expand Down Expand Up @@ -44,8 +45,8 @@ void GUIGetPoint( gui_window * wnd, gui_ord extent, gui_ord row,

if( point != NULL ) {
point->x = extent;
GUIScaleToScreenRPt( point );
GUIScaleToScreenPointR( point );
point->y = row;
GUIScreenToScaleRPt( point );
GUIScreenToScalePointR( point );
}
}
6 changes: 3 additions & 3 deletions bld/gui/ui/c/guigetrc.c
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
*
* Open Watcom Project
*
* Copyright (c) 2018-2018 The Open Watcom Contributors. All Rights Reserved.
* Copyright (c) 2018-2021 The Open Watcom Contributors. All Rights Reserved.
* Portions Copyright (c) 1983-2002 Sybase, Inc. All Rights Reserved.
*
* ========================================================================
Expand Down Expand Up @@ -46,7 +46,7 @@ gui_ord GUIGetRow( gui_window * wnd, gui_point * in_pt )
/* unused parameters */ (void)wnd;

pt = *in_pt;
GUIScaleToScreenRPt( &pt );
GUIScaleToScreenPointR( &pt );
if( pt.y >=0 ) {
return( (gui_ord) pt.y );
} else {
Expand All @@ -65,7 +65,7 @@ gui_ord GUIGetCol( gui_window *wnd, const char *text, gui_point *in_pt )
/* unused parameters */ (void)wnd; (void)text;

pt = *in_pt;
GUIScaleToScreenRPt( &pt );
GUIScaleToScreenPointR( &pt );
if( pt.x >=0 ) {
return( (gui_ord) pt.x );
} else {
Expand Down
5 changes: 3 additions & 2 deletions bld/gui/win/c/guidrawr.c
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@
*
* Open Watcom Project
*
* Copyright (c) 2002-2021 The Open Watcom Contributors. All Rights Reserved.
* Portions Copyright (c) 1983-2002 Sybase, Inc. All Rights Reserved.
*
* ========================================================================
Expand Down Expand Up @@ -138,8 +139,8 @@ static bool DrawLine( gui_window *wnd, gui_point *start, gui_point *end,

my_start = *start;
my_end = *end;
GUIScaleToScreenRPt( &my_start );
GUIScaleToScreenRPt( &my_end );
GUIScaleToScreenPointR( &my_start );
GUIScaleToScreenPointR( &my_end );
if( GUI_DO_VSCROLL( wnd ) ) {
vscroll = GUIGetScrollPos( wnd, SB_VERT );
} else {
Expand Down
3 changes: 2 additions & 1 deletion bld/gui/win/c/guifloat.c
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@
*
* Open Watcom Project
*
* Copyright (c) 2002-2021 The Open Watcom Contributors. All Rights Reserved.
* Portions Copyright (c) 1983-2002 Sybase, Inc. All Rights Reserved.
*
* ========================================================================
Expand Down Expand Up @@ -56,7 +57,7 @@ bool GUITrackFloatingPopup( gui_window *wnd, gui_point *location,
return( false );
}

GUIScaleToScreenRPt( location );
GUIScaleToScreenPointR( location );
_wpi_getrectvalues( wnd->hwnd_client_rect, &left, &top, &right, &bottom );
location->x += left;
location->y += top;
Expand Down
5 changes: 3 additions & 2 deletions bld/gui/win/c/guigetpt.c
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@
*
* Open Watcom Project
*
* Copyright (c) 2002-2021 The Open Watcom Contributors. All Rights Reserved.
* Portions Copyright (c) 1983-2002 Sybase, Inc. All Rights Reserved.
*
* ========================================================================
Expand Down Expand Up @@ -44,8 +45,8 @@ void GUIGetPoint( gui_window * wnd, gui_ord extent, gui_ord row, gui_point *poin
return;
}
point->x = extent;
GUIScaleToScreenRPt( point );
GUIScaleToScreenPointR( point );
GUIGetMetrics( wnd );
point->y = row * AVGYCHAR( GUItm );
GUIScreenToScaleRPt( point );
GUIScreenToScalePointR( point );
}
5 changes: 3 additions & 2 deletions bld/gui/win/c/guigetrc.c
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@
*
* Open Watcom Project
*
* Copyright (c) 2002-2021 The Open Watcom Contributors. All Rights Reserved.
* Portions Copyright (c) 1983-2002 Sybase, Inc. All Rights Reserved.
*
* ========================================================================
Expand Down Expand Up @@ -48,7 +49,7 @@ gui_ord GUIGetRow( gui_window * wnd, gui_point * in_pos )
GUIGetMetrics( wnd );
height = AVGYCHAR( GUItm );

GUIScaleToScreenRPt( &pos );
GUIScaleToScreenPointR( &pos );
row = pos.y / height;
return( row );
}
Expand All @@ -62,7 +63,7 @@ gui_ord GUIGetCol( gui_window *wnd, const char *text, gui_point *in_pos )
got_new = GUIGetTheDC( wnd );
GUIGetMetrics( wnd );
pos = *in_pos;
GUIScaleToScreenRPt( &pos );
GUIScaleToScreenPointR( &pos );
width = pos.x / MAXXCHAR( GUItm );
while( ( width < strlen( text ) ) && ( GUIGetTextExtentX( wnd, text, width ) <= pos.x ) ) {
width++ ;
Expand Down
3 changes: 2 additions & 1 deletion bld/gui/win/c/guixutil.c
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@
*
* Open Watcom Project
*
* Copyright (c) 2002-2021 The Open Watcom Contributors. All Rights Reserved.
* Portions Copyright (c) 1983-2002 Sybase, Inc. All Rights Reserved.
*
* ========================================================================
Expand Down Expand Up @@ -478,7 +479,7 @@ void GUIMakeRelative( gui_window *wnd, WPI_POINT *pt, gui_point *point )
point->y += GUIGetScrollPos( wnd, SB_VERT );
}
}
GUIScreenToScaleRPt( point );
GUIScreenToScalePointR( point );
}

HWND GUIGetScrollHWND( gui_window *wnd )
Expand Down

0 comments on commit 090072e

Please sign in to comment.