pkgsrc/multimedia/fxtv/patches/patch-bc

87 lines
3.2 KiB
Text

$NetBSD: patch-bc,v 1.4 2022/04/24 10:57:28 tnn Exp $
Handle always-on-top.
Fix LP64 problems.
--- tvmenu.c.orig 2001-02-12 21:19:33.000000000 +0000
+++ tvmenu.c
@@ -103,7 +103,7 @@ typedef void XT_CB( Widget w, XtPointer
/* ******************** Forward declarations ************** */
-static XT_CB QuitCB, FreezeCB, MuteCB, ZoomCB, InputCB, AfcCB, TModeCB,
+static XT_CB QuitCB, FreezeCB, MuteCB, ZoomCB, InputCB, AfcCB, AotCB, TModeCB,
ChanUpDnCB, AppearCB, AspectCB, AboutCB, ImgSavCB, ImgSavAsCB,
AudSavAsCB, VidSavAsCB, FormatCB, AudInpCB, StationPopupCB;
@@ -160,6 +160,7 @@ static TV_MENUITEM_DEF Menuitem_def[] =
{ TVMI( FORMAT,FORMAT_PALNCOMB ), "palncombFmt" , WC_mcmd , FormatCB },
{ TVMI( OPTIONS,OPTIONS_ASPECT ), "aspectLockCmd" , WC_mcmd , AspectCB },
{ TVMI( OPTIONS,OPTIONS_AFC ), "setAfcCmd", WC_mcmd , AfcCB },
+ { TVMI( OPTIONS,OPTIONS_AOT ), "setAotCmd", WC_mcmd , AotCB },
{ TV_MENU_OPTIONS, -1 , "line" , WC_mline, NULL },
/*
{ TVMI( OPTIONS,OPTIONS_SAVE ), "saveOptionsCmd", WC_mcmd , NULL },
@@ -396,6 +397,16 @@ static void AfcCB( Widget w, XtPointer c
TVMENUSetSelectedAfcMode( p->afc_mode );
}
+/* AotCB - Change the always on top mode */
+static void AotCB( Widget w, XtPointer cl, XtPointer cb )
+{
+ TV_PREFS *p = &G_glob.prefs;
+
+ p->aot_mode = !p->aot_mode;
+ XUTILSetAlwaysOnTop( p->aot_mode );
+ TVMENUSetSelectedAotMode( p->aot_mode );
+}
+
void TVMENUSetSelectedInputFormat( TV_INPUT_FORMAT fmt )
{
TV_MENUITEM_DEF *mi;
@@ -896,7 +907,7 @@ void TVTOOLSSetToggleState( TV_TOOLITEM_
break;
if ( i >= XtNumber( Toolitem_def ) ) {
- fprintf( stderr, "TVTOOLSETSetToggleState: Bad key %ld\n", i );
+ fprintf( stderr, "TVTOOLSETSetToggleState: Bad key %d\n", i );
exit(1);
}
@@ -1008,6 +1019,19 @@ void TVMENUSetSelectedAfcMode( TV_BOOL a
NULL);
}
+void TVMENUSetSelectedAotMode( TV_BOOL aot )
+{
+ TV_MENUITEM_DEF *item = LookupMenuItemByKey( TV_MENUITEM_OPTIONS_AOT );
+ Pixmap pix;
+
+ if ( Select_pixmap == None )
+ TVMENULoadRadioPixmaps();
+
+ pix = aot ? Select_pixmap : Unselect_pixmap;
+ XtVaSetValues( item->wgt , XtNleftBitmap, pix,
+ NULL);
+}
+
void TVMENUSetSelectedAspectLock( TV_BOOL aspect_lock )
{
TV_MENUITEM_DEF *item = LookupMenuItemByKey( TV_MENUITEM_OPTIONS_ASPECT );
@@ -1043,6 +1067,7 @@ void TVMENUResync()
TVMENUSetSelectedAudioInputDevice( aud_input );
TVMENUSetSelectedTunerMode ( p->tuner_mode );
TVMENUSetSelectedAfcMode ( p->afc_mode );
+ TVMENUSetSelectedAotMode ( p->aot_mode );
}
/* TVTOOLSSetStationText - Sets the channel text to the specified */
@@ -1134,7 +1159,7 @@ void TVTOOLSResync()
strncat( chan_str, station->id, sizeof(chan_str)-1 );
}
else if ( s.tuner_chan_active )
- sprintf( chan_str, "%ld", s.tuner_chan );
+ sprintf( chan_str, "%d", s.tuner_chan );
else
sprintf( chan_str, "f%.2f", s.tuner_freq );