Skip to content

Commit

Permalink
aui: cleanup resource handling code
Browse files Browse the repository at this point in the history
  • Loading branch information
jmalak committed May 16, 2024
1 parent 1a6cf3f commit 6d9b527
Show file tree
Hide file tree
Showing 8 changed files with 27 additions and 25 deletions.
6 changes: 3 additions & 3 deletions bld/aui/c/dlgnew.c
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
*
* Open Watcom Project
*
* Copyright (c) 2002-2021 The Open Watcom Contributors. All Rights Reserved.
* Copyright (c) 2002-2024 The Open Watcom Contributors. All Rights Reserved.
* Portions Copyright (c) 1983-2002 Sybase, Inc. All Rights Reserved.
*
* ========================================================================
Expand Down Expand Up @@ -129,8 +129,8 @@ bool DlgNew( const char *title, char *buff, size_t buff_len )
{
bool rc;

Controls[OK_IDX].text = WndLoadString( LITERAL_New_OK );
Controls[CANCEL_IDX].text = WndLoadString( LITERAL_New_Cancel );
Controls[OK_IDX].text = WndLoadString( LIT( New_OK ) );
Controls[CANCEL_IDX].text = WndLoadString( LIT( New_Cancel ) );
rc = DlgNewWithCtl( title, buff, buff_len, Controls, ArraySize( Controls ), dlgNewGUIEventProc, DLG_SIZE_DATA );
WndFree( (void *)Controls[OK_IDX].text );
WndFree( (void *)Controls[CANCEL_IDX].text );
Expand Down
4 changes: 2 additions & 2 deletions bld/aui/c/guimain.c
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
*
* Open Watcom Project
*
* Copyright (c) 2002-2021 The Open Watcom Contributors. All Rights Reserved.
* Copyright (c) 2002-2024 The Open Watcom Contributors. All Rights Reserved.
* Portions Copyright (c) 1983-2002 Sybase, Inc. All Rights Reserved.
*
* ========================================================================
Expand Down Expand Up @@ -545,7 +545,7 @@ gui_mcursor_handle WndHourCursor( void )
{
if( !GUIIsGUI() ) {
if( BusyString == NULL ) {
BusyString = WndLoadString( LITERAL_Busy );
BusyString = WndLoadString( LIT( Busy ) );
}
WndInternalStatusText( BusyString );
}
Expand Down
4 changes: 2 additions & 2 deletions bld/aui/c/wndchoos.c
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
*
* Open Watcom Project
*
* Copyright (c) 2002-2021 The Open Watcom Contributors. All Rights Reserved.
* Copyright (c) 2002-2024 The Open Watcom Contributors. All Rights Reserved.
* Portions Copyright (c) 1983-2002 Sybase, Inc. All Rights Reserved.
*
* ========================================================================
Expand Down Expand Up @@ -93,7 +93,7 @@ void WndSayMatchMode( a_window wnd )
char *match;
size_t match_len;

match = WndLoadString( LITERAL_Match_Mode );
match = WndLoadString( LIT( Match_Mode ) );
match_len = strlen( match );
if( WndSwitchOn( wnd, WSW_CHOOSING ) ) {
sofar_buff = alloca( match_len + MAX_KEY_SIZE + 1 );
Expand Down
10 changes: 5 additions & 5 deletions bld/aui/c/wndsrch.c
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
*
* Open Watcom Project
*
* Copyright (c) 2002-2021 The Open Watcom Contributors. All Rights Reserved.
* Copyright (c) 2002-2024 The Open Watcom Contributors. All Rights Reserved.
* Portions Copyright (c) 1983-2002 Sybase, Inc. All Rights Reserved.
*
* ========================================================================
Expand Down Expand Up @@ -164,10 +164,10 @@ bool WndSearch( a_window wnd, bool from_top, int direction )
rx = WndCompileRX( wnd->searchitem );
if( rx == NULL )
return( false );
not_found = WndLoadString( LITERAL_Not_Found );
top_of_window = WndLoadString( LITERAL_Top_Of_Window );
end_of_window = WndLoadString( LITERAL_End_Of_Window );
search_wrapped = WndLoadString( LITERAL_Search_Wrapped );
not_found = WndLoadString( LIT( Not_Found ) );
top_of_window = WndLoadString( LIT( Top_Of_Window ) );
end_of_window = WndLoadString( LIT( End_Of_Window ) );
search_wrapped = WndLoadString( LIT( Search_Wrapped ) );
wrap = false;
starting_pos.piece = 0;
starting_pos.colidx = ( direction > 0 ) ? -1 : WND_MAX_COLIDX;
Expand Down
6 changes: 4 additions & 2 deletions bld/aui/h/aui.rh
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
*
* Open Watcom Project
*
* Copyright (c) 2002-2021 The Open Watcom Contributors. All Rights Reserved.
* Copyright (c) 2002-2024 The Open Watcom Contributors. All Rights Reserved.
* Portions Copyright (c) 1983-2002 Sybase, Inc. All Rights Reserved.
*
* ========================================================================
Expand Down Expand Up @@ -31,7 +31,9 @@
****************************************************************************/


#define AUI_LITERAL_BASE 400
#define AUI_LITERAL_BASE 400

#define LIT(s) AUI_LITERAL_ ##s

#include "gui.rh"
#include "aui.grh"
Expand Down
2 changes: 1 addition & 1 deletion bld/aui/master.mif
Original file line number Diff line number Diff line change
Expand Up @@ -158,4 +158,4 @@ japsrcha.dlg : ../res/dlgs/japsrcha.dlg

aui.grh : ../res/aui.msg
@%make echo_awk
$(noecho)*awk -v base=AUI_LITERAL_BASE -f $(build_dir)/makemsg.awk -v OUTFILE=$^. $[@
$(noecho)*awk -v prefix=AUI_LITERAL_ -v base=AUI_LITERAL_BASE -f $(build_dir)/makemsg.awk -v OUTFILE=$^. $[@
16 changes: 8 additions & 8 deletions bld/aui/res/aui.msg
Original file line number Diff line number Diff line change
@@ -1,33 +1,33 @@
/* UTF-8 encoding, ¥ */

pick( LITERAL_Busy,
pick( Busy,
"Busy ...",
"jBusy ..." )

pick( LITERAL_Not_Found,
pick( Not_Found,
"Not Found",
"jNot Found" )

pick( LITERAL_Search_Wrapped,
pick( Search_Wrapped,
"Search Wrapped",
"jSearch Wrapped" )

pick( LITERAL_End_Of_Window,
pick( End_Of_Window,
"End of Window Reached",
"jEnd of Window Reached" )

pick( LITERAL_Top_Of_Window,
pick( Top_Of_Window,
"Top of Window Reached",
"jTop of Window Reached" )

pick( LITERAL_Match_Mode,
pick( Match_Mode,
"Match Mode: ",
"jMatch Mode: " )

pick( LITERAL_New_OK,
pick( New_OK,
"OK",
"jOK" )

pick( LITERAL_New_Cancel,
pick( New_Cancel,
"Cancel",
"jCancel" )
4 changes: 2 additions & 2 deletions bld/aui/res/aui.rc
Original file line number Diff line number Diff line change
Expand Up @@ -5,9 +5,9 @@
STRINGTABLE
BEGIN
#ifdef JAPANESE
#define pick( a,b,c ) a, [ c ]
#define pick( a,b,c ) AUI_LITERAL_ ##a, [ c ]
#else
#define pick( a,b,c ) a, [ b ]
#define pick( a,b,c ) AUI_LITERAL_ ##a, [ b ]
#endif
#include "aui.msg"
#undef pick
Expand Down

0 comments on commit 6d9b527

Please sign in to comment.