├── BUILDING-win.md ├── BUILDING.md ├── CMakeLists.txt ├── ChangeLog.md ├── LGPL.txt ├── LICENSE.txt ├── client ├── CMakeLists.txt ├── ClientWin.cpp ├── ClientWin.h ├── GLFrame.cpp ├── GLFrame.h ├── VGLTransReceiver.cpp ├── VGLTransReceiver.h ├── vglclient.cpp └── vglconnect.in ├── cmakescripts ├── BuildPackages.cmake ├── FindTurboJPEG.cmake ├── GNUInstallDirs.cmake └── cmake_uninstall.cmake.in ├── common ├── CMakeLists.txt ├── Frame.cpp ├── Frame.h ├── Profiler.cpp ├── Profiler.h ├── frameut.cpp ├── rr.h └── vgllogo.h ├── demos ├── CMakeLists.txt ├── eglinfo.c ├── eglxspheres.c ├── glinfo_common.c ├── glinfo_common.h ├── glthreads.c ├── glthreadsint.c ├── glxinfo.c ├── glxspheres.c ├── offset.c ├── pbdemo.c ├── pbutil.c ├── pbutil.h ├── testgl5.c └── xfonts.c ├── diags ├── CMakeLists.txt ├── cpustat.c ├── dsimple.c ├── dsimple.h ├── imgdiff.c └── tcbench.cpp ├── doc ├── CMakeLists.txt ├── LGPL.txt ├── LICENSE-FLTK.txt ├── LICENSE.txt ├── advancedconfig.txt ├── advancedopengl.txt ├── apprecipes.txt ├── config.rb ├── configdialog.gif ├── configdialog.txt ├── formatting.txt ├── index.html ├── install.txt ├── legalinfo.txt ├── overview.txt ├── perfmeasurement.txt ├── prefix.txt ├── setuid.txt ├── somerights20.png ├── sshtunnel.png ├── subsampling.gif ├── sysreq.txt ├── transportplugins.txt ├── unixconfig.txt ├── vgltransport.odg ├── vgltransport.png ├── vgltransportservernetwork.odg ├── vgltransportservernetwork.png ├── vgltransportusage.txt ├── virtualbox.txt ├── virtualgl.css ├── virtualgl.txt ├── windowsconfig.txt ├── x11transport.odg ├── x11transport.png ├── x11transportusage.txt └── xvideosupport.txt ├── include ├── Error.h ├── GenericQ.h ├── Log.h ├── Mutex.h ├── Socket.h ├── Thread.h ├── Timer.h ├── bmp.h ├── fbx.h ├── fbxv.h ├── glpf.h ├── keycodetokeysym.h ├── md5.h ├── pf.h ├── vglinline.h.in ├── vglutil.h └── x11err.h ├── release ├── Distribution.xml.in ├── License.rtf ├── ReadMe-MacApp.txt ├── ReadMe.txt ├── Welcome.txt ├── deb-control.in ├── entitlements.plist ├── installer.nsi.in ├── makedpkg.in ├── makemacpkg.in ├── makerpm.in ├── makesrpm.in ├── maketarball.in ├── rpm.spec.in ├── uninstall.applescript.in └── uninstall.in ├── server ├── BufferState.h ├── CMakeLists.txt ├── ContextHash.cpp ├── ContextHash.h ├── ContextHashEGL.cpp ├── ContextHashEGL.h ├── EGLError.h ├── EGLXDisplayHash.cpp ├── EGLXDisplayHash.h ├── EGLXVirtualWin.cpp ├── EGLXVirtualWin.h ├── EGLXWindowHash.cpp ├── EGLXWindowHash.h ├── FakePbuffer.cpp ├── FakePbuffer.h ├── GLXDrawableHash.cpp ├── GLXDrawableHash.h ├── GlobalCriticalSection.cpp ├── GlobalCriticalSection.h ├── Hash.h ├── PbufferHashEGL.cpp ├── PbufferHashEGL.h ├── PixmapHash.cpp ├── PixmapHash.h ├── RBOContext.cpp ├── RBOContext.h ├── TempContext.h ├── TempContextEGL.h ├── TransPlugin.cpp ├── TransPlugin.h ├── VGLTrans.cpp ├── VGLTrans.h ├── VirtualDrawable.cpp ├── VirtualDrawable.h ├── VirtualPixmap.cpp ├── VirtualPixmap.h ├── VirtualWin.cpp ├── VirtualWin.h ├── VisualHash.cpp ├── VisualHash.h ├── WindowHash.cpp ├── WindowHash.h ├── X11Trans.cpp ├── X11Trans.h ├── XCBConnHash.cpp ├── XCBConnHash.h ├── XVTrans.cpp ├── XVTrans.h ├── backend.cpp ├── backend.h ├── dlfaker.c ├── dlfakerut-test.c ├── dlfakerut.c ├── eglxfakerut.cpp ├── faker-egl.cpp ├── faker-gl.cpp ├── faker-glx.cpp ├── faker-mapfile.c ├── faker-ocl.cpp ├── faker-sym.cpp ├── faker-sym.h ├── faker-x11.cpp ├── faker-xcb.cpp ├── faker.cpp ├── faker.h ├── fakerconfig.cpp ├── fakerconfig.h.in ├── fakerut-supplement.c ├── fakerut.cpp ├── fltk │ ├── ANNOUNCEMENT │ ├── CHANGES.txt │ ├── CHANGES_1.0.txt │ ├── CHANGES_1.1.txt │ ├── CHANGES_1.3.txt │ ├── CMakeLists.txt │ ├── COPYING │ ├── CREDITS.txt │ ├── FL │ │ ├── Enumerations.H │ │ ├── Fl.H │ │ ├── Fl_Adjuster.H │ │ ├── Fl_Bitmap.H │ │ ├── Fl_Box.H │ │ ├── Fl_Browser.H │ │ ├── Fl_Browser_.H │ │ ├── Fl_Button.H │ │ ├── Fl_Chart.H │ │ ├── Fl_Check_Browser.H │ │ ├── Fl_Check_Button.H │ │ ├── Fl_Choice.H │ │ ├── Fl_Clock.H │ │ ├── Fl_Color_Chooser.H │ │ ├── Fl_Copy_Surface.H │ │ ├── Fl_Counter.H │ │ ├── Fl_Device.H │ │ ├── Fl_Dial.H │ │ ├── Fl_Double_Window.H │ │ ├── Fl_Export.H │ │ ├── Fl_File_Browser.H │ │ ├── Fl_File_Chooser.H │ │ ├── Fl_File_Icon.H │ │ ├── Fl_File_Input.H │ │ ├── Fl_Fill_Dial.H │ │ ├── Fl_Fill_Slider.H │ │ ├── Fl_Float_Input.H │ │ ├── Fl_Graphics_Driver.H │ │ ├── Fl_Group.H │ │ ├── Fl_Help_View.H │ │ ├── Fl_Hold_Browser.H │ │ ├── Fl_Hor_Fill_Slider.H │ │ ├── Fl_Hor_Nice_Slider.H │ │ ├── Fl_Hor_Slider.H │ │ ├── Fl_Hor_Value_Slider.H │ │ ├── Fl_Image.H │ │ ├── Fl_Image_Surface.H │ │ ├── Fl_Input.H │ │ ├── Fl_Input_.H │ │ ├── Fl_Input_Choice.H │ │ ├── Fl_Int_Input.H │ │ ├── Fl_Light_Button.H │ │ ├── Fl_Line_Dial.H │ │ ├── Fl_Menu_.H │ │ ├── Fl_Menu_Bar.H │ │ ├── Fl_Menu_Button.H │ │ ├── Fl_Menu_Item.H │ │ ├── Fl_Menu_Window.H │ │ ├── Fl_Multi_Browser.H │ │ ├── Fl_Multi_Label.H │ │ ├── Fl_Multiline_Input.H │ │ ├── Fl_Multiline_Output.H │ │ ├── Fl_Nice_Slider.H │ │ ├── Fl_Output.H │ │ ├── Fl_Overlay_Window.H │ │ ├── Fl_PDF_File_Surface.H │ │ ├── Fl_Pack.H │ │ ├── Fl_Paged_Device.H │ │ ├── Fl_Pixmap.H │ │ ├── Fl_Plugin.H │ │ ├── Fl_Positioner.H │ │ ├── Fl_PostScript.H │ │ ├── Fl_Preferences.H │ │ ├── Fl_Printer.H │ │ ├── Fl_Progress.H │ │ ├── Fl_RGB_Image.H │ │ ├── Fl_Radio_Button.H │ │ ├── Fl_Radio_Light_Button.H │ │ ├── Fl_Radio_Round_Button.H │ │ ├── Fl_Rect.H │ │ ├── Fl_Repeat_Button.H │ │ ├── Fl_Return_Button.H │ │ ├── Fl_Roller.H │ │ ├── Fl_Round_Button.H │ │ ├── Fl_Round_Clock.H │ │ ├── Fl_Scroll.H │ │ ├── Fl_Scrollbar.H │ │ ├── Fl_Secret_Input.H │ │ ├── Fl_Select_Browser.H │ │ ├── Fl_Shared_Image.H │ │ ├── Fl_Simple_Counter.H │ │ ├── Fl_Single_Window.H │ │ ├── Fl_Slider.H │ │ ├── Fl_Spinner.H │ │ ├── Fl_Sys_Menu_Bar.H │ │ ├── Fl_Tabs.H │ │ ├── Fl_Text_Buffer.H │ │ ├── Fl_Text_Display.H │ │ ├── Fl_Text_Editor.H │ │ ├── Fl_Tile.H │ │ ├── Fl_Tiled_Image.H │ │ ├── Fl_Toggle_Button.H │ │ ├── Fl_Tooltip.H │ │ ├── Fl_Tree_Prefs.H │ │ ├── Fl_Valuator.H │ │ ├── Fl_Value_Input.H │ │ ├── Fl_Value_Output.H │ │ ├── Fl_Value_Slider.H │ │ ├── Fl_Widget.H │ │ ├── Fl_Widget_Surface.H │ │ ├── Fl_Window.H │ │ ├── Fl_Wizard.H │ │ ├── Fl_XBM_Image.H │ │ ├── Fl_XPM_Image.H │ │ ├── filename.H │ │ ├── fl_ask.H │ │ ├── fl_attr.h │ │ ├── fl_casts.H │ │ ├── fl_config.h │ │ ├── fl_draw.H │ │ ├── fl_show_colormap.H │ │ ├── fl_string_functions.h │ │ ├── fl_types.h │ │ ├── fl_utf8.h │ │ ├── math.h │ │ ├── platform.H │ │ ├── platform_types.h │ │ ├── win32.H │ │ ├── x.H │ │ └── x11.H │ ├── README.md │ ├── README.txt │ └── src │ │ ├── Fl.cxx │ │ ├── Fl_Adjuster.cxx │ │ ├── Fl_Bitmap.cxx │ │ ├── Fl_Box.cxx │ │ ├── Fl_Browser.cxx │ │ ├── Fl_Browser_.cxx │ │ ├── Fl_Browser_load.cxx │ │ ├── Fl_Button.cxx │ │ ├── Fl_Chart.cxx │ │ ├── Fl_Check_Browser.cxx │ │ ├── Fl_Check_Button.cxx │ │ ├── Fl_Choice.cxx │ │ ├── Fl_Clock.cxx │ │ ├── Fl_Color_Chooser.cxx │ │ ├── Fl_Copy_Surface.cxx │ │ ├── Fl_Counter.cxx │ │ ├── Fl_Device.cxx │ │ ├── Fl_Dial.cxx │ │ ├── Fl_Double_Window.cxx │ │ ├── Fl_File_Browser.cxx │ │ ├── Fl_File_Chooser.cxx │ │ ├── Fl_File_Chooser2.cxx │ │ ├── Fl_File_Icon.cxx │ │ ├── Fl_File_Input.cxx │ │ ├── Fl_Graphics_Driver.cxx │ │ ├── Fl_Group.cxx │ │ ├── Fl_Help_View.cxx │ │ ├── Fl_Image.cxx │ │ ├── Fl_Image_Surface.cxx │ │ ├── Fl_Input.cxx │ │ ├── Fl_Input_.cxx │ │ ├── Fl_Int_Vector.H │ │ ├── Fl_Light_Button.cxx │ │ ├── Fl_Menu.cxx │ │ ├── Fl_Menu_.cxx │ │ ├── Fl_Menu_Bar.cxx │ │ ├── Fl_Menu_Button.cxx │ │ ├── Fl_Menu_Window.cxx │ │ ├── Fl_Menu_add.cxx │ │ ├── Fl_Menu_global.cxx │ │ ├── Fl_Message.cxx │ │ ├── Fl_Message.h │ │ ├── Fl_Multi_Label.cxx │ │ ├── Fl_Overlay_Window.cxx │ │ ├── Fl_Pack.cxx │ │ ├── Fl_Paged_Device.cxx │ │ ├── Fl_Pixmap.cxx │ │ ├── Fl_Positioner.cxx │ │ ├── Fl_Preferences.cxx │ │ ├── Fl_Printer.cxx │ │ ├── Fl_Progress.cxx │ │ ├── Fl_Repeat_Button.cxx │ │ ├── Fl_Return_Button.cxx │ │ ├── Fl_Roller.cxx │ │ ├── Fl_Round_Button.cxx │ │ ├── Fl_Screen_Driver.H │ │ ├── Fl_Screen_Driver.cxx │ │ ├── Fl_Scroll.cxx │ │ ├── Fl_Scrollbar.cxx │ │ ├── Fl_Shared_Image.cxx │ │ ├── Fl_Single_Window.cxx │ │ ├── Fl_Slider.cxx │ │ ├── Fl_String.H │ │ ├── Fl_String.cxx │ │ ├── Fl_Sys_Menu_Bar.cxx │ │ ├── Fl_Sys_Menu_Bar_Driver.H │ │ ├── Fl_System_Driver.H │ │ ├── Fl_System_Driver.cxx │ │ ├── Fl_Tabs.cxx │ │ ├── Fl_Text_Buffer.cxx │ │ ├── Fl_Text_Display.cxx │ │ ├── Fl_Text_Editor.cxx │ │ ├── Fl_Tile.cxx │ │ ├── Fl_Tiled_Image.cxx │ │ ├── Fl_Timeout.cxx │ │ ├── Fl_Timeout.h │ │ ├── Fl_Tooltip.cxx │ │ ├── Fl_Tree_Prefs.cxx │ │ ├── Fl_Valuator.cxx │ │ ├── Fl_Value_Input.cxx │ │ ├── Fl_Value_Output.cxx │ │ ├── Fl_Value_Slider.cxx │ │ ├── Fl_Widget.cxx │ │ ├── Fl_Widget_Surface.cxx │ │ ├── Fl_Window.cxx │ │ ├── Fl_Window_Driver.H │ │ ├── Fl_Window_Driver.cxx │ │ ├── Fl_Window_fullscreen.cxx │ │ ├── Fl_Window_hotspot.cxx │ │ ├── Fl_Window_iconize.cxx │ │ ├── Fl_Wizard.cxx │ │ ├── Fl_XBM_Image.cxx │ │ ├── Fl_XColor.H │ │ ├── Fl_XPM_Image.cxx │ │ ├── Fl_abort.cxx │ │ ├── Fl_add_idle.cxx │ │ ├── Fl_arg.cxx │ │ ├── Fl_compose.cxx │ │ ├── Fl_display.cxx │ │ ├── Fl_get_key.cxx │ │ ├── Fl_get_system_colors.cxx │ │ ├── Fl_grab.cxx │ │ ├── Fl_lock.cxx │ │ ├── Fl_own_colormap.cxx │ │ ├── Fl_visual.cxx │ │ ├── Fl_x.cxx │ │ ├── Xutf8.h │ │ ├── config.h │ │ ├── drivers │ │ ├── Posix │ │ │ ├── Fl_Posix_System_Driver.H │ │ │ └── Fl_Posix_System_Driver.cxx │ │ ├── Unix │ │ │ ├── Fl_Unix_Screen_Driver.H │ │ │ ├── Fl_Unix_Screen_Driver.cxx │ │ │ ├── Fl_Unix_System_Driver.H │ │ │ └── Fl_Unix_System_Driver.cxx │ │ ├── X11 │ │ │ ├── Fl_X11_Screen_Driver.H │ │ │ ├── Fl_X11_Screen_Driver.cxx │ │ │ ├── Fl_X11_Window_Driver.H │ │ │ ├── Fl_X11_Window_Driver.cxx │ │ │ └── fl_X11_platform_init.cxx │ │ └── Xlib │ │ │ ├── Fl_Font.H │ │ │ ├── Fl_Xlib_Copy_Surface_Driver.H │ │ │ ├── Fl_Xlib_Copy_Surface_Driver.cxx │ │ │ ├── Fl_Xlib_Graphics_Driver.H │ │ │ ├── Fl_Xlib_Graphics_Driver.cxx │ │ │ ├── Fl_Xlib_Graphics_Driver_arci.cxx │ │ │ ├── Fl_Xlib_Graphics_Driver_color.cxx │ │ │ ├── Fl_Xlib_Graphics_Driver_font_x.cxx │ │ │ ├── Fl_Xlib_Graphics_Driver_image.cxx │ │ │ ├── Fl_Xlib_Graphics_Driver_line_style.cxx │ │ │ ├── Fl_Xlib_Graphics_Driver_rect.cxx │ │ │ ├── Fl_Xlib_Graphics_Driver_vertex.cxx │ │ │ ├── Fl_Xlib_Image_Surface_Driver.H │ │ │ └── Fl_Xlib_Image_Surface_Driver.cxx │ │ ├── fastarrow.h │ │ ├── filename_absolute.cxx │ │ ├── filename_expand.cxx │ │ ├── filename_ext.cxx │ │ ├── filename_isdir.cxx │ │ ├── filename_list.cxx │ │ ├── filename_match.cxx │ │ ├── filename_setext.cxx │ │ ├── fl_arc.cxx │ │ ├── fl_ask.cxx │ │ ├── fl_boxtype.cxx │ │ ├── fl_cmap.h │ │ ├── fl_color.cxx │ │ ├── fl_contrast.cxx │ │ ├── fl_cursor.cxx │ │ ├── fl_cursor_help.xpm │ │ ├── fl_cursor_nesw.xpm │ │ ├── fl_cursor_none.xpm │ │ ├── fl_cursor_nwse.xpm │ │ ├── fl_cursor_wait.xpm │ │ ├── fl_curve.cxx │ │ ├── fl_diamond_box.cxx │ │ ├── fl_dnd_x.cxx │ │ ├── fl_draw.cxx │ │ ├── fl_draw_arrow.cxx │ │ ├── fl_draw_pixmap.cxx │ │ ├── fl_encoding_latin1.cxx │ │ ├── fl_encoding_mac_roman.cxx │ │ ├── fl_engraved_label.cxx │ │ ├── fl_file_dir.cxx │ │ ├── fl_font.cxx │ │ ├── fl_gleam.cxx │ │ ├── fl_gtk.cxx │ │ ├── fl_labeltype.cxx │ │ ├── fl_oval_box.cxx │ │ ├── fl_overlay.cxx │ │ ├── fl_oxy.cxx │ │ ├── fl_oxy.h │ │ ├── fl_plastic.cxx │ │ ├── fl_read_image.cxx │ │ ├── fl_rect.cxx │ │ ├── fl_round_box.cxx │ │ ├── fl_rounded_box.cxx │ │ ├── fl_scroll_area.cxx │ │ ├── fl_set_font.cxx │ │ ├── fl_shadow_box.cxx │ │ ├── fl_shortcut.cxx │ │ ├── fl_show_colormap.cxx │ │ ├── fl_string_functions.cxx │ │ ├── fl_symbols.cxx │ │ ├── fl_utf8.cxx │ │ ├── fl_vertex.cxx │ │ ├── flstring.c │ │ ├── flstring.h │ │ ├── mediumarrow.h │ │ ├── numericsort.c │ │ ├── print_button.cxx │ │ ├── print_button.h │ │ ├── screen_xywh.cxx │ │ ├── slowarrow.h │ │ ├── tile.xpm │ │ ├── utf8_internal.h │ │ ├── vsnprintf.c │ │ └── xutf8 │ │ ├── COPYING │ │ ├── README.txt │ │ ├── Ximint.h │ │ ├── Xlibint.h │ │ ├── case.c │ │ ├── headers │ │ ├── case.h │ │ ├── dingbats_.h │ │ ├── spacing.h │ │ └── symbol_.h │ │ ├── imKStoUCS.c │ │ ├── is_spacing.c │ │ ├── keysym2Ucs.c │ │ ├── lcUniConv │ │ ├── COPYRIGHT │ │ ├── README.txt │ │ ├── big5.h │ │ ├── cp1251.h │ │ ├── cp936ext.h │ │ ├── gb2312.h │ │ ├── iso8859_10.h │ │ ├── iso8859_11.h │ │ ├── iso8859_13.h │ │ ├── iso8859_14.h │ │ ├── iso8859_15.h │ │ ├── iso8859_2.h │ │ ├── iso8859_3.h │ │ ├── iso8859_4.h │ │ ├── iso8859_5.h │ │ ├── iso8859_6.h │ │ ├── iso8859_7.h │ │ ├── iso8859_8.h │ │ ├── iso8859_9.h │ │ ├── jisx0201.h │ │ ├── jisx0208.h │ │ ├── jisx0212.h │ │ ├── koi8_r.h │ │ ├── koi8_u.h │ │ └── ksc5601.h │ │ ├── mk_wcwidth.c │ │ ├── ucs2fontmap.c │ │ ├── utf8Utils.c │ │ └── utf8Wrap.c ├── gefaker.c ├── glxvisual.cpp ├── glxvisual.h ├── libGLdlfakerut.c ├── libdeepbindtest.c ├── rrtransport.h ├── servertest.in ├── testplugin-mapfile ├── testplugin.cpp ├── testplugin2.cpp ├── threadlocal.h ├── vendor.h.in ├── vglconfig.cpp ├── vglconfigLauncher.cpp ├── vglconfigLauncher.h ├── vglgenkey ├── vgllogin ├── vglrun.in ├── vglrun.vars.in ├── vglserver_config ├── vgltransut.cpp ├── x11transut.cpp └── xfonts.c ├── util ├── CMakeLists.txt ├── GenericQ.cpp ├── Log.cpp ├── Mutex.cpp ├── Socket.cpp ├── Thread.cpp ├── bmp.c ├── bmptest.c ├── fbx.c ├── fbxtest.cpp ├── fbxv.c ├── fbxvtest.c ├── glreadtest.cpp ├── md5.c ├── md5hl.c ├── nettest.cpp ├── pf.c ├── pftest.c ├── threadtest.cpp ├── utiltest-win.in └── utiltest.in └── wgldemos ├── CMakeLists.txt └── wglspheres.c /client/CMakeLists.txt: -------------------------------------------------------------------------------- 1 | ############################################################################### 2 | # CLIENT 3 | ############################################################################### 4 | 5 | include_directories(../common) 6 | 7 | add_library(glframe STATIC GLFrame.cpp) 8 | target_link_libraries(glframe ${OPENGL_gl_LIBRARY}) 9 | 10 | add_executable(vglclient vglclient.cpp ClientWin.cpp VGLTransReceiver.cpp) 11 | target_link_libraries(vglclient vglcommon ${FBXLIB} glframe vglsocket) 12 | install(TARGETS vglclient DESTINATION ${CMAKE_INSTALL_BINDIR}) 13 | 14 | configure_file(vglconnect.in ${CMAKE_RUNTIME_OUTPUT_DIRECTORY}/vglconnect 15 | @ONLY) 16 | execute_process(COMMAND chmod +x vglconnect 17 | WORKING_DIRECTORY ${CMAKE_RUNTIME_OUTPUT_DIRECTORY}) 18 | install(PROGRAMS ${CMAKE_RUNTIME_OUTPUT_DIRECTORY}/vglconnect 19 | DESTINATION ${CMAKE_INSTALL_BINDIR}) 20 | -------------------------------------------------------------------------------- /client/ClientWin.h: -------------------------------------------------------------------------------- 1 | // Copyright (C)2004 Landmark Graphics Corporation 2 | // Copyright (C)2005, 2006 Sun Microsystems, Inc. 3 | // Copyright (C)2009, 2011, 2014, 2021 D. R. Commander 4 | // 5 | // This library is free software and may be redistributed and/or modified under 6 | // the terms of the wxWindows Library License, Version 3.1 or (at your option) 7 | // any later version. The full license is in the LICENSE.txt file included 8 | // with this distribution. 9 | // 10 | // This library is distributed in the hope that it will be useful, 11 | // but WITHOUT ANY WARRANTY; without even the implied warranty of 12 | // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 13 | // wxWindows Library License for more details. 14 | 15 | #ifndef __CLIENTWIN_H__ 16 | #define __CLIENTWIN_H__ 17 | 18 | #include "Frame.h" 19 | #include "Thread.h" 20 | #include "GenericQ.h" 21 | 22 | 23 | enum { RR_DRAWAUTO = -1, RR_DRAWX11 = 0, RR_DRAWOGL }; 24 | 25 | 26 | namespace client 27 | { 28 | class ClientWin : public util::Runnable 29 | { 30 | public: 31 | 32 | ClientWin(int dpynum, Window window, int drawMethod, bool stereo); 33 | virtual ~ClientWin(void); 34 | common::Frame *getFrame(bool useXV); 35 | void drawFrame(common::Frame *f); 36 | int match(int dpynum, Window window); 37 | bool isStereo(void) { return stereo; } 38 | 39 | private: 40 | 41 | void initGL(void); 42 | void initX11(void); 43 | 44 | int drawMethod, reqDrawMethod; 45 | static const int NFRAMES = 2; 46 | common::Frame *fb; 47 | common::CompressedFrame cframes[NFRAMES]; int cfindex; 48 | #ifdef USEXV 49 | common::XVFrame *xvframes[NFRAMES]; 50 | #endif 51 | util::GenericQ q; 52 | bool deadYet; 53 | int dpynum; Window window; 54 | void run(void); 55 | util::Thread *thread; 56 | util::CriticalSection cfmutex; 57 | bool stereo; 58 | util::CriticalSection mutex; 59 | }; 60 | } 61 | 62 | #endif // __CLIENTWIN_H__ 63 | -------------------------------------------------------------------------------- /client/GLFrame.h: -------------------------------------------------------------------------------- 1 | // Copyright (C)2005, 2006 Sun Microsystems, Inc. 2 | // Copyright (C)2014, 2021 D. R. Commander 3 | // 4 | // This library is free software and may be redistributed and/or modified under 5 | // the terms of the wxWindows Library License, Version 3.1 or (at your option) 6 | // any later version. The full license is in the LICENSE.txt file included 7 | // with this distribution. 8 | // 9 | // This library is distributed in the hope that it will be useful, 10 | // but WITHOUT ANY WARRANTY; without even the implied warranty of 11 | // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 12 | // wxWindows Library License for more details. 13 | 14 | #ifndef __GLFRAME_H 15 | #define __GLFRAME_H 16 | 17 | // Frame drawn using OpenGL 18 | 19 | #include 20 | #include "Frame.h" 21 | 22 | 23 | namespace common 24 | { 25 | class GLFrame : public Frame 26 | { 27 | public: 28 | 29 | GLFrame(char *dpystring, Window win); 30 | GLFrame(Display *dpy, Window win); 31 | ~GLFrame(void); 32 | void init(rrframeheader &h, bool stereo); 33 | GLFrame &operator= (CompressedFrame &cf); 34 | void redraw(void); 35 | void drawTile(int x, int y, int width, int height); 36 | void sync(void); 37 | 38 | private: 39 | 40 | void init(void); 41 | int glError(void); 42 | 43 | Display *dpy; Window win; 44 | GLXContext ctx; 45 | tjhandle tjhnd; 46 | bool newdpy; 47 | }; 48 | } 49 | 50 | #endif // __GLFRAME_H 51 | -------------------------------------------------------------------------------- /cmakescripts/cmake_uninstall.cmake.in: -------------------------------------------------------------------------------- 1 | # This code is from the CMake FAQ 2 | 3 | if (NOT EXISTS "@CMAKE_CURRENT_BINARY_DIR@/install_manifest.txt") 4 | message(FATAL_ERROR "Cannot find install manifest: \"@CMAKE_CURRENT_BINARY_DIR@/install_manifest.txt\"") 5 | endif(NOT EXISTS "@CMAKE_CURRENT_BINARY_DIR@/install_manifest.txt") 6 | 7 | file(READ "@CMAKE_CURRENT_BINARY_DIR@/install_manifest.txt" files) 8 | string(REGEX REPLACE "\n" ";" files "${files}") 9 | list(REVERSE files) 10 | foreach (file ${files}) 11 | message(STATUS "Uninstalling \"$ENV{DESTDIR}${file}\"") 12 | if (EXISTS "$ENV{DESTDIR}${file}") 13 | execute_process( 14 | COMMAND "@CMAKE_COMMAND@" -E remove "$ENV{DESTDIR}${file}" 15 | OUTPUT_VARIABLE rm_out 16 | RESULT_VARIABLE rm_retval 17 | ) 18 | if(NOT ${rm_retval} EQUAL 0) 19 | message(FATAL_ERROR "Problem when removing \"$ENV{DESTDIR}${file}\"") 20 | endif (NOT ${rm_retval} EQUAL 0) 21 | else (EXISTS "$ENV{DESTDIR}${file}") 22 | message(STATUS "File \"$ENV{DESTDIR}${file}\" does not exist.") 23 | endif (EXISTS "$ENV{DESTDIR}${file}") 24 | endforeach(file) 25 | -------------------------------------------------------------------------------- /common/CMakeLists.txt: -------------------------------------------------------------------------------- 1 | ############################################################################### 2 | # LIBRARIES 3 | ############################################################################### 4 | 5 | include_directories(${CMAKE_CURRENT_SOURCE_DIR}) 6 | 7 | add_library(vglcommon STATIC Frame.cpp Profiler.cpp) 8 | target_link_libraries(vglcommon vglutil ${TJPEG_LIBRARY}) 9 | 10 | 11 | ############################################################################### 12 | # UNIT TESTS 13 | ############################################################################### 14 | 15 | add_executable(frameut frameut.cpp) 16 | target_link_libraries(frameut vglcommon ${FBXLIB} glframe) 17 | -------------------------------------------------------------------------------- /common/Profiler.h: -------------------------------------------------------------------------------- 1 | // Copyright (C)2004 Landmark Graphics Corporation 2 | // Copyright (C)2005, 2006 Sun Microsystems, Inc. 3 | // Copyright (C)2014, 2021 D. R. Commander 4 | // 5 | // This library is free software and may be redistributed and/or modified under 6 | // the terms of the wxWindows Library License, Version 3.1 or (at your option) 7 | // any later version. The full license is in the LICENSE.txt file included 8 | // with this distribution. 9 | // 10 | // This library is distributed in the hope that it will be useful, 11 | // but WITHOUT ANY WARRANTY; without even the implied warranty of 12 | // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 13 | // wxWindows Library License for more details. 14 | 15 | #ifndef __PROFILER_H__ 16 | #define __PROFILER_H__ 17 | 18 | #include "Timer.h" 19 | 20 | 21 | namespace common 22 | { 23 | class Profiler 24 | { 25 | public: 26 | 27 | Profiler(const char *name = "Profiler", double interval = 2.0); 28 | ~Profiler(void); 29 | void setName(char *name); 30 | void setName(const char *name); 31 | void startFrame(void); 32 | void endFrame(long pixels, long bytes, double incFrames); 33 | 34 | private: 35 | 36 | char *name; 37 | double interval; 38 | double mbytes, mpixels, totalTime, start, frames, lastFrame; 39 | bool profile; 40 | util::Timer timer; 41 | bool freestr; 42 | }; 43 | } 44 | 45 | #endif 46 | -------------------------------------------------------------------------------- /demos/pbutil.h: -------------------------------------------------------------------------------- 1 | /* 2 | * OpenGL pbuffers utility functions. 3 | * 4 | * Brian Paul 5 | * April 1997 6 | */ 7 | 8 | 9 | #ifndef PBUTIL_H 10 | #define PBUTIL_H 11 | 12 | 13 | #define GLX_GLXEXT_PROTOTYPES 14 | #include 15 | 16 | 17 | #if defined(GLX_VERSION_1_3) 18 | #define PBUFFER GLXPbuffer 19 | #define FBCONFIG GLXFBConfig 20 | #elif defined(GLX_SGIX_fbconfig) && defined(GLX_SGIX_pbuffer) 21 | #define PBUFFER GLXPbufferSGIX 22 | #define FBCONFIG GLXFBConfigSGIX 23 | #else 24 | #define PBUFFER int 25 | #define FBCONFIG int 26 | #endif 27 | 28 | 29 | extern int 30 | QueryFBConfig(Display *dpy, int screen); 31 | 32 | extern int 33 | QueryPbuffers(Display *dpy, int screen); 34 | 35 | 36 | extern void 37 | PrintFBConfigInfo(Display *dpy, int screen, FBCONFIG config, Bool horizFormat); 38 | 39 | 40 | extern FBCONFIG * 41 | ChooseFBConfig(Display *dpy, int screen, const int attribs[], int *nConfigs); 42 | 43 | 44 | extern FBCONFIG * 45 | GetAllFBConfigs(Display *dpy, int screen, int *nConfigs); 46 | 47 | 48 | extern XVisualInfo * 49 | GetVisualFromFBConfig(Display *dpy, int screen, FBCONFIG config); 50 | 51 | 52 | extern GLXContext 53 | CreateContext(Display *dpy, int screen, FBCONFIG config); 54 | 55 | 56 | extern void 57 | DestroyContext(Display *dpy, GLXContext ctx); 58 | 59 | 60 | extern PBUFFER 61 | CreatePbuffer(Display *dpy, int screen, FBCONFIG config, 62 | int width, int height, Bool preserve, Bool largest); 63 | 64 | 65 | extern void 66 | DestroyPbuffer(Display *dpy, int screen, PBUFFER pbuffer); 67 | 68 | 69 | #endif /*PBUTIL_H*/ 70 | -------------------------------------------------------------------------------- /diags/CMakeLists.txt: -------------------------------------------------------------------------------- 1 | if(CMAKE_SYSTEM_NAME STREQUAL "Linux") 2 | add_executable(cpustat cpustat.c) 3 | install(TARGETS cpustat DESTINATION ${CMAKE_INSTALL_BINDIR}) 4 | endif() 5 | 6 | add_executable(imgdiff imgdiff.c) 7 | target_link_libraries(imgdiff vglutil) 8 | if(UNIX) 9 | target_link_libraries(imgdiff m) 10 | endif() 11 | 12 | if(MINGW) 13 | add_definitions(-DWINVER=0x0600) 14 | endif() 15 | if(WIN32) 16 | add_executable(tcbench tcbench.cpp) 17 | else() 18 | include_directories(${X11_XTest_INCLUDE_PATH}) 19 | add_executable(tcbench tcbench.cpp dsimple.c) 20 | target_link_libraries(tcbench ${X11_XTest_LIB}) 21 | endif() 22 | target_link_libraries(tcbench fbx) 23 | install(TARGETS tcbench DESTINATION ${CMAKE_INSTALL_BINDIR}) 24 | -------------------------------------------------------------------------------- /diags/dsimple.h: -------------------------------------------------------------------------------- 1 | /* $Xorg: dsimple.h,v 1.4 2001/02/09 02:05:54 xorgcvs Exp $ */ 2 | /* 3 | 4 | Copyright 1993, 1998 The Open Group 5 | 6 | Permission to use, copy, modify, distribute, and sell this software and its 7 | documentation for any purpose is hereby granted without fee, provided that 8 | the above copyright notice appear in all copies and that both that 9 | copyright notice and this permission notice appear in supporting 10 | documentation. 11 | 12 | The above copyright notice and this permission notice shall be included 13 | in all copies or substantial portions of the Software. 14 | 15 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS 16 | OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF 17 | MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. 18 | IN NO EVENT SHALL THE OPEN GROUP BE LIABLE FOR ANY CLAIM, DAMAGES OR 19 | OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, 20 | ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR 21 | OTHER DEALINGS IN THE SOFTWARE. 22 | 23 | Except as contained in this notice, the name of The Open Group shall 24 | not be used in advertising or otherwise to promote the sale, use or 25 | other dealings in this Software without prior written authorization 26 | from The Open Group. 27 | 28 | */ 29 | /* $XFree86: xc/programs/xlsfonts/dsimple.h,v 1.8 2002/12/24 17:43:01 tsi Exp $ */ 30 | 31 | /* 32 | * Written by Mark Lillibridge. Last updated 7/1/87 33 | */ 34 | 35 | extern char *program_name; /* Name of this program */ 36 | 37 | Window Select_Window(Display *); 38 | #ifdef __GNUC__ 39 | void Fatal_Error(char *, ...) __attribute__((__noreturn__)); 40 | #else 41 | void Fatal_Error(char *, ...); 42 | #endif 43 | -------------------------------------------------------------------------------- /doc/CMakeLists.txt: -------------------------------------------------------------------------------- 1 | file(GLOB SOURCE_FILES *.gif *.png *.rb [a-z]*.txt virtualgl.css) 2 | 3 | file(GLOB DOC_FILES *.gif *.png LICENSE*.txt LGPL.txt index.html virtualgl.css) 4 | 5 | add_custom_command(OUTPUT ${CMAKE_CURRENT_BINARY_DIR}/stamp 6 | COMMAND deplate -c config.rb -m html-obfuscate-email virtualgl.txt 7 | -D _DOCVERSION=${DOCVERSION} -D _VERSION=${VERSION} -o index.html 8 | COMMAND ${CMAKE_COMMAND} -E touch ${CMAKE_CURRENT_BINARY_DIR}/stamp 9 | WORKING_DIRECTORY ${CMAKE_CURRENT_SOURCE_DIR} 10 | DEPENDS ${SOURCE_FILES} 11 | COMMENT "Generating User's Guide" 12 | ) 13 | 14 | add_custom_target(doc DEPENDS ${CMAKE_CURRENT_BINARY_DIR}/stamp) 15 | 16 | install(FILES ${DOC_FILES} ${CMAKE_SOURCE_DIR}/ChangeLog.md 17 | DESTINATION ${CMAKE_INSTALL_DOCDIR}) 18 | -------------------------------------------------------------------------------- /doc/config.rb: -------------------------------------------------------------------------------- 1 | class Deplate::Core 2 | def self.user_setup(options) 3 | options.disabled_particles << Deplate::HyperLink::Simple 4 | end 5 | end 6 | -------------------------------------------------------------------------------- /doc/configdialog.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/VirtualGL/virtualgl/edc00ae625029af16696a89e735bbfec9b909b15/doc/configdialog.gif -------------------------------------------------------------------------------- /doc/formatting.txt: -------------------------------------------------------------------------------- 1 | * Formatting 2 | 3 | - ''Terminal commands, arguments, and output'' 4 | - ''Executable filenames'' 5 | - ''Function names'' 6 | - ''Environment variable names and values'' 7 | - ''User and group names'' 8 | - ''Configuration file parameters and values'' 9 | - ''X11 and GLX extension names'' 10 | - __''Variable parts of any of the above''__ 11 | {:} 12 | - {file: Non-executable filenames} 13 | - {file: Directory names} 14 | - {file: Application shortcuts} 15 | - {file: __Variable parts of any of the above__} 16 | {:} 17 | #Verb: <<--- 18 | Terminal command sequences 19 | --- 20 | #Pverb: <<--- 21 | __Variable parts of terminal command sequences__ 22 | --- 23 | -------------------------------------------------------------------------------- /doc/legalinfo.txt: -------------------------------------------------------------------------------- 1 | * Legal Information 2 | 3 | {img: somerights20.png} 4 | 5 | This document and all associated illustrations are licensed under the 6 | [[http://creativecommons.org/licenses/by/2.5/][Creative Commons Attribution 2.5 License]]. 7 | Any works that contain material derived from this document must cite The 8 | VirtualGL Project as the source of the material and list the current URL for 9 | the VirtualGL web site. 10 | 11 | The official VirtualGL binaries contain libjpeg-turbo, which is based in part 12 | on the work of the Independent JPEG Group. 13 | 14 | The VirtualGL server components include software developed by the 15 | [[http://www.fltk.org/][FLTK Project]] and distributed under the terms of the 16 | [[LICENSE-FLTK.txt][FLTK License]!]. 17 | 18 | VirtualGL is licensed under the 19 | [[LICENSE.txt][wxWindows Library License, v3.1]!], a derivative of the 20 | [[LGPL.txt][GNU Lesser General Public License (LGPL), v2.1]!]. 21 | -------------------------------------------------------------------------------- /doc/somerights20.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/VirtualGL/virtualgl/edc00ae625029af16696a89e735bbfec9b909b15/doc/somerights20.png -------------------------------------------------------------------------------- /doc/sshtunnel.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/VirtualGL/virtualgl/edc00ae625029af16696a89e735bbfec9b909b15/doc/sshtunnel.png -------------------------------------------------------------------------------- /doc/subsampling.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/VirtualGL/virtualgl/edc00ae625029af16696a89e735bbfec9b909b15/doc/subsampling.gif -------------------------------------------------------------------------------- /doc/transportplugins.txt: -------------------------------------------------------------------------------- 1 | * Transport Plugins 2 | {anchor:Transport_Plugins} 3 | 4 | VirtualGL 2.2 (and later) includes an API that allows you to write your own 5 | image transports. Thus, you can use VirtualGL for doing split rendering and 6 | framebuffer readback but then use your own library for delivering the rendered 7 | frames to the client. 8 | 9 | When the ''VGL_TRANSPORT'' environment variable (or the 10 | ''-trans'' option to ''vglrun'') is set to __''{t}''__, then VirtualGL will 11 | look for a DSO (dynamic shared object) with the name 12 | {file: libvgltrans\___{t}__.so} in the dynamic linker path and will attempt 13 | to access a set of API functions from this library. The functions that the 14 | plugin library must export are defined in 15 | {file: /opt/VirtualGL/include/rrtransport.h}, and an example of their usage can 16 | be found in {file: server/testplugin.cpp} and {file: server/testplugin2.cpp} 17 | in the VirtualGL source distribution. The former wraps the VGL Transport as an 18 | image transport plugin, and the latter does the same for the X11 Transport. 19 | -------------------------------------------------------------------------------- /doc/vgltransport.odg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/VirtualGL/virtualgl/edc00ae625029af16696a89e735bbfec9b909b15/doc/vgltransport.odg -------------------------------------------------------------------------------- /doc/vgltransport.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/VirtualGL/virtualgl/edc00ae625029af16696a89e735bbfec9b909b15/doc/vgltransport.png -------------------------------------------------------------------------------- /doc/vgltransportservernetwork.odg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/VirtualGL/virtualgl/edc00ae625029af16696a89e735bbfec9b909b15/doc/vgltransportservernetwork.odg -------------------------------------------------------------------------------- /doc/vgltransportservernetwork.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/VirtualGL/virtualgl/edc00ae625029af16696a89e735bbfec9b909b15/doc/vgltransportservernetwork.png -------------------------------------------------------------------------------- /doc/virtualgl.txt: -------------------------------------------------------------------------------- 1 | #VAR: css=virtualgl.css 2 | #TITLE: User's Guide for VirtualGL {val: _DOCVERSION} 3 | #MAKETITLE 4 | 5 | #IF: fmt==html 6 | 7 | #DefMacroN id=file args=@body <<--- 8 | {arg: @body} 9 | --- 10 | 11 | #DefMacroN id=pcode args=@body <<--- 12 | {arg: @body} 13 | --- 14 | 15 | #DefMacroN id=bold args=@body <<--- 16 | {arg: @body} 17 | --- 18 | 19 | #DefMacroN id=note args=@body <<--- 20 |

{arg: @body}

21 | --- 22 | 23 | #DefRegionN id=Pverb args=@body <<--- 24 |
{arg: @body}
25 | --- 26 | 27 | #ENDIF 28 | 29 | __Intended audience:__ System Administrators, Graphics Programmers, 30 | Researchers, and others with knowledge of Linux or Unix operating systems, 31 | OpenGL, GLX or EGL, and the X Window System. 32 | 33 | #LIST: contents 34 | {nl} 35 | ----8<-------------- 36 | #INCLUDE: legalinfo.txt 37 | {nl} 38 | ----8<-------------- 39 | #INCLUDE: prefix.txt 40 | {nl} 41 | ----8<-------------- 42 | #INCLUDE: overview.txt 43 | {nl} 44 | ----8<-------------- 45 | #INCLUDE: sysreq.txt 46 | {nl} 47 | ----8<-------------- 48 | #INCLUDE: install.txt 49 | {nl} 50 | ----8<-------------- 51 | #INCLUDE: unixconfig.txt 52 | {nl} 53 | ----8<-------------- 54 | #INCLUDE: windowsconfig.txt 55 | {nl} 56 | ----8<-------------- 57 | #INCLUDE: vgltransportusage.txt 58 | {nl} 59 | ----8<-------------- 60 | #INCLUDE: x11transportusage.txt 61 | {nl} 62 | ----8<-------------- 63 | #INCLUDE: xvideosupport.txt 64 | {nl} 65 | ----8<-------------- 66 | #INCLUDE: transportplugins.txt 67 | {nl} 68 | ----8<-------------- 69 | #INCLUDE: setuid.txt 70 | {nl} 71 | ----8<-------------- 72 | #INCLUDE: virtualbox.txt 73 | {nl} 74 | ----8<-------------- 75 | #INCLUDE: apprecipes.txt 76 | {nl} 77 | ----8<-------------- 78 | #INCLUDE: advancedopengl.txt 79 | {nl} 80 | ----8<-------------- 81 | #INCLUDE: perfmeasurement.txt 82 | {nl} 83 | ----8<-------------- 84 | #INCLUDE: configdialog.txt 85 | {nl} 86 | ----8<-------------- 87 | #INCLUDE: advancedconfig.txt 88 | {nl} 89 | -------------------------------------------------------------------------------- /doc/windowsconfig.txt: -------------------------------------------------------------------------------- 1 | * Configuring a Windows Machine as a VGL Transport Client 2 | 3 | The VirtualGL Client can take advantage of the ''MIT-SHM'' extension in 4 | Cygwin/X to accelerate the compositing of rendered frames into the 3D 5 | application's windows. This can significantly improve the end-to-end 6 | performance of VirtualGL when using the VGL Transport over a local-area 7 | network. 8 | 9 | To enable ''MIT-SHM'' in Cygwin/X: 10 | 11 | #. Open a Cygwin Bash shell 12 | 13 | #. Run ''cygserver-config'' 14 | 15 | #. Answer "yes" when asked ''Do you want to install cygserver as service?'' 16 | 17 | #. From a Windows (not Cygwin) administrator command prompt, run 18 | ''net start cygserver'' 19 | 20 | #. Start or re-start Cygwin/X 21 | 22 | #. Run ''xdpyinfo'' and verify that ''MIT-SHM'' appears in the list of 23 | X extensions 24 | -------------------------------------------------------------------------------- /doc/x11transport.odg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/VirtualGL/virtualgl/edc00ae625029af16696a89e735bbfec9b909b15/doc/x11transport.odg -------------------------------------------------------------------------------- /doc/x11transport.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/VirtualGL/virtualgl/edc00ae625029af16696a89e735bbfec9b909b15/doc/x11transport.png -------------------------------------------------------------------------------- /include/GenericQ.h: -------------------------------------------------------------------------------- 1 | // Copyright (C)2004 Landmark Graphics Corporation 2 | // Copyright (C)2007 Sun Microsystems, Inc. 3 | // Copyright (C)2011, 2014, 2021 D. R. Commander 4 | // 5 | // This library is free software and may be redistributed and/or modified under 6 | // the terms of the wxWindows Library License, Version 3.1 or (at your option) 7 | // any later version. The full license is in the LICENSE.txt file included 8 | // with this distribution. 9 | // 10 | // This library is distributed in the hope that it will be useful, 11 | // but WITHOUT ANY WARRANTY; without even the implied warranty of 12 | // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 13 | // wxWindows Library License for more details. 14 | 15 | // Thread-safe queue implementation using singly-linked lists 16 | 17 | #ifndef __GENERICQ_H__ 18 | #define __GENERICQ_H__ 19 | 20 | #include "Mutex.h" 21 | 22 | 23 | namespace util 24 | { 25 | class GenericQ 26 | { 27 | public: 28 | 29 | typedef void (*SpoilCallback)(void *); 30 | 31 | GenericQ(void); 32 | ~GenericQ(void); 33 | void add(void *item); 34 | void spoil(void *item, SpoilCallback spoilCallback); 35 | void get(void **item, bool nonBlocking = false); 36 | void release(void); 37 | int items(void); 38 | 39 | private: 40 | 41 | typedef struct EntryStruct 42 | { 43 | void *item; struct EntryStruct *next; 44 | } Entry; 45 | 46 | Entry *start, *end; 47 | Semaphore hasItem; 48 | CriticalSection mutex; 49 | int deadYet; 50 | }; 51 | } 52 | 53 | #endif // __GENERICQ_H__ 54 | -------------------------------------------------------------------------------- /include/Log.h: -------------------------------------------------------------------------------- 1 | // Copyright (C)2004 Landmark Graphics Corporation 2 | // Copyright (C)2005, 2006 Sun Microsystems, Inc. 3 | // Copyright (C)2014, 2021 D. R. Commander 4 | // 5 | // This library is free software and may be redistributed and/or modified under 6 | // the terms of the wxWindows Library License, Version 3.1 or (at your option) 7 | // any later version. The full license is in the LICENSE.txt file included 8 | // with this distribution. 9 | // 10 | // This library is distributed in the hope that it will be useful, 11 | // but WITHOUT ANY WARRANTY; without even the implied warranty of 12 | // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 13 | // wxWindows Library License for more details. 14 | 15 | #ifndef __LOG_H__ 16 | #define __LOG_H__ 17 | 18 | #include "Mutex.h" 19 | #include 20 | 21 | 22 | namespace util 23 | { 24 | class Log 25 | { 26 | public: 27 | 28 | static Log *getInstance(void); 29 | void logTo(FILE *logFile); 30 | void logTo(char *logFileName); 31 | void print(const char *format, ...); 32 | // This class assumes that if you yell, you want it now 33 | void PRINT(const char *format, ...); 34 | void println(const char *format, ...); 35 | void PRINTLN(const char *format, ...); 36 | void flush(void) { fflush(logFile); } 37 | FILE *getFile(void) { return logFile; } 38 | 39 | private: 40 | 41 | Log() 42 | { 43 | logFile = stderr; newFile = false; 44 | } 45 | 46 | ~Log() {} 47 | 48 | static Log *instance; 49 | static CriticalSection mutex; 50 | FILE *logFile; 51 | bool newFile; 52 | }; 53 | } 54 | 55 | 56 | #define vglout (*(util::Log::getInstance())) 57 | 58 | #endif // __LOG_H__ 59 | -------------------------------------------------------------------------------- /include/Timer.h: -------------------------------------------------------------------------------- 1 | // Copyright (C)2004 Landmark Graphics Corporation 2 | // Copyright (C)2005 Sun Microsystems, Inc. 3 | // Copyright (C)2014, 2018-2019, 2021 D. R. Commander 4 | // 5 | // This library is free software and may be redistributed and/or modified under 6 | // the terms of the wxWindows Library License, Version 3.1 or (at your option) 7 | // any later version. The full license is in the LICENSE.txt file included 8 | // with this distribution. 9 | // 10 | // This library is distributed in the hope that it will be useful, 11 | // but WITHOUT ANY WARRANTY; without even the implied warranty of 12 | // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 13 | // wxWindows Library License for more details. 14 | 15 | #ifndef __TIMER_H__ 16 | #define __TIMER_H__ 17 | 18 | #ifdef _WIN32 19 | #include 20 | #else 21 | #include 22 | #endif 23 | #include 24 | #include "vglinline.h" 25 | 26 | 27 | namespace util 28 | { 29 | class Timer 30 | { 31 | public: 32 | 33 | Timer(void) : t1(0.0) 34 | { 35 | #ifdef _WIN32 36 | highRes = false; tick = 0.001; 37 | LARGE_INTEGER frequency; 38 | if(QueryPerformanceFrequency(&frequency) != 0) 39 | { 40 | tick = (double)1.0 / (double)(frequency.QuadPart); 41 | highRes = true; 42 | } 43 | #endif 44 | } 45 | 46 | void start(void) 47 | { 48 | t1 = time(); 49 | } 50 | 51 | double time(void) 52 | { 53 | #ifdef _WIN32 54 | 55 | if(highRes) 56 | { 57 | LARGE_INTEGER Time; 58 | QueryPerformanceCounter(&Time); 59 | return (double)(Time.QuadPart) * tick; 60 | } 61 | else 62 | return (double)GetTickCount() * tick; 63 | 64 | #else 65 | 66 | struct timeval tv; 67 | gettimeofday(&tv, (struct timezone *)NULL); 68 | return (double)(tv.tv_sec) + (double)(tv.tv_usec) * 0.000001; 69 | 70 | #endif 71 | } 72 | 73 | double elapsed(void) 74 | { 75 | return time() - t1; 76 | } 77 | 78 | private: 79 | 80 | #ifdef _WIN32 81 | bool highRes; double tick; 82 | #endif 83 | double t1; 84 | }; 85 | } 86 | 87 | #endif // __TIMER_H__ 88 | -------------------------------------------------------------------------------- /include/bmp.h: -------------------------------------------------------------------------------- 1 | /* Copyright (C)2004 Landmark Graphics Corporation 2 | * Copyright (C)2005 Sun Microsystems, Inc. 3 | * Copyright (C)2011, 2014, 2017 D. R. Commander 4 | * 5 | * This library is free software and may be redistributed and/or modified under 6 | * the terms of the wxWindows Library License, Version 3.1 or (at your option) 7 | * any later version. The full license is in the LICENSE.txt file included 8 | * with this distribution. 9 | * 10 | * This library is distributed in the hope that it will be useful, 11 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 12 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 13 | * wxWindows Library License for more details. 14 | */ 15 | 16 | /* This provides rudimentary facilities for loading and saving true color 17 | BMP and PPM files */ 18 | 19 | #ifndef __BMP_H__ 20 | #define __BMP_H__ 21 | 22 | #include "pf.h" 23 | 24 | 25 | #define BMP_NUMORN 2 26 | enum BMPORN { BMPORN_TOPDOWN = 0, BMPORN_BOTTOMUP }; 27 | 28 | #define BMPPAD(width, align) (((width) + ((align) - 1)) & (~((align) - 1))) 29 | 30 | 31 | #ifdef __cplusplus 32 | extern "C" { 33 | #endif 34 | 35 | /* This will load a Windows bitmap from a file and return a buffer with the 36 | specified pixel format, scanline alignment, and orientation. The width and 37 | height are returned in *width and *height. Use free() to free the 38 | buffer once you are finished with it. */ 39 | 40 | int bmp_load(char *filename, unsigned char **buf, int *width, int align, 41 | int *height, int format, enum BMPORN orientation); 42 | 43 | 44 | /* This will save a buffer with the specified pixel format, pitch, orientation, 45 | width, and height as a 24-bit Windows bitmap or PPM (the filename determines 46 | which format to use.) */ 47 | 48 | int bmp_save(char *filename, unsigned char *buf, int width, int pitch, 49 | int height, int format, enum BMPORN orientation); 50 | 51 | 52 | const char *bmp_geterr(void); 53 | 54 | #ifdef __cplusplus 55 | } 56 | #endif 57 | 58 | #endif /* __BMP_H__ */ 59 | -------------------------------------------------------------------------------- /include/keycodetokeysym.h: -------------------------------------------------------------------------------- 1 | /* Copyright (C)2014, 2016 D. R. Commander 2 | * 3 | * This library is free software and may be redistributed and/or modified under 4 | * the terms of the wxWindows Library License, Version 3.1 or (at your option) 5 | * any later version. The full license is in the LICENSE.txt file included 6 | * with this distribution. 7 | * 8 | * This library is distributed in the hope that it will be useful, 9 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 10 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 11 | * wxWindows Library License for more details. 12 | */ 13 | 14 | #ifndef __KEYCODETOKEYSYM_H__ 15 | #define __KEYCODETOKEYSYM_H__ 16 | 17 | #include 18 | 19 | 20 | static KeySym KeycodeToKeysym(Display *dpy, KeyCode keycode, int index) 21 | { 22 | KeySym ks = NoSymbol, *keysyms; int n = 0; 23 | 24 | keysyms = XGetKeyboardMapping(dpy, keycode, 1, &n); 25 | if(keysyms) 26 | { 27 | if(n >= 1 && index >= 0 && index < n) 28 | ks = keysyms[index]; 29 | XFree(keysyms); 30 | } 31 | 32 | return ks; 33 | } 34 | 35 | #endif 36 | -------------------------------------------------------------------------------- /include/pf.h: -------------------------------------------------------------------------------- 1 | /* Copyright (C)2017-2018 D. R. Commander 2 | * 3 | * This library is free software and may be redistributed and/or modified under 4 | * the terms of the wxWindows Library License, Version 3.1 or (at your option) 5 | * any later version. The full license is in the LICENSE.txt file included 6 | * with this distribution. 7 | * 8 | * This library is distributed in the hope that it will be useful, 9 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 10 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 11 | * wxWindows Library License for more details. 12 | */ 13 | 14 | #ifndef __PF_H__ 15 | #define __PF_H__ 16 | 17 | /* Pixel formats */ 18 | #define PIXELFORMATS 11 19 | enum 20 | { 21 | PF_RGB, PF_RGBX, PF_RGB10_X2, PF_BGR, PF_BGRX, PF_BGR10_X2, PF_XBGR, 22 | PF_X2_BGR10, PF_XRGB, PF_X2_RGB10, PF_COMP 23 | }; 24 | 25 | 26 | typedef const struct _PF 27 | { 28 | unsigned char id; 29 | const char *name; 30 | unsigned char size, bpc; 31 | unsigned int rmask, gmask, bmask; 32 | unsigned char rshift, gshift, bshift, rindex, gindex, bindex; 33 | /* These are useful mainly for initializing and comparing test patterns in 34 | unit tests. They are not particularly fast. */ 35 | void (*getRGB)(unsigned char *, int *, int *, int *); 36 | void (*setRGB)(unsigned char *, int, int, int); 37 | /* Optimized pixel conversion */ 38 | void (*convert)(unsigned char *srcBuf, int width, int srcStride, int height, 39 | unsigned char *dstBuf, int dstStride, const struct _PF *dstpf); 40 | } PF; 41 | 42 | 43 | #ifdef __cplusplus 44 | extern "C" { 45 | #endif 46 | 47 | PF *pf_get(int id); 48 | 49 | #ifdef __cplusplus 50 | } 51 | #endif 52 | 53 | #endif /* __PF_H__ */ 54 | -------------------------------------------------------------------------------- /include/vglinline.h.in: -------------------------------------------------------------------------------- 1 | /* Copyright (C)2018 D. R. Commander 2 | * 3 | * This library is free software and may be redistributed and/or modified under 4 | * the terms of the wxWindows Library License, Version 3.1 or (at your option) 5 | * any later version. The full license is in the LICENSE.txt file included 6 | * with this distribution. 7 | * 8 | * This library is distributed in the hope that it will be useful, 9 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 10 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 11 | * wxWindows Library License for more details. 12 | */ 13 | 14 | #ifndef __VGLINLINE_H__ 15 | #define __VGLINLINE_H__ 16 | 17 | #define INLINE @INLINE@ 18 | 19 | #endif /* __VGLINLINE_H__ */ 20 | -------------------------------------------------------------------------------- /include/x11err.h: -------------------------------------------------------------------------------- 1 | /* Copyright (C)2004 Landmark Graphics Corporation 2 | * Copyright (C)2005 Sun Microsystems, Inc. 3 | * Copyright (C)2019 D. R. Commander 4 | * 5 | * This library is free software and may be redistributed and/or modified under 6 | * the terms of the wxWindows Library License, Version 3.1 or (at your option) 7 | * any later version. The full license is in the LICENSE.txt file included 8 | * with this distribution. 9 | * 10 | * This library is distributed in the hope that it will be useful, 11 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 12 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 13 | * wxWindows Library License for more details. 14 | */ 15 | 16 | #define CASE(m) case m: return #m; 17 | 18 | static const char *x11error(int code) 19 | { 20 | if(code >= FirstExtensionError && code <= LastExtensionError) 21 | return "Extension error"; 22 | switch(code) 23 | { 24 | CASE(BadRequest) 25 | CASE(BadValue) 26 | CASE(BadWindow) 27 | CASE(BadPixmap) 28 | CASE(BadAtom) 29 | CASE(BadCursor) 30 | CASE(BadFont) 31 | CASE(BadMatch) 32 | CASE(BadDrawable) 33 | CASE(BadAccess) 34 | CASE(BadAlloc) 35 | CASE(BadColor) 36 | CASE(BadGC) 37 | CASE(BadIDChoice) 38 | CASE(BadName) 39 | CASE(BadLength) 40 | CASE(BadImplementation) 41 | default: return "Unknown error code"; 42 | } 43 | } 44 | -------------------------------------------------------------------------------- /release/Distribution.xml.in: -------------------------------------------------------------------------------- 1 | 2 | 3 | @CMAKE_PROJECT_NAME@ 4 | 5 | 6 | 7 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | 22 | @PKGNAME@.pkg 24 | 25 | -------------------------------------------------------------------------------- /release/ReadMe-MacApp.txt: -------------------------------------------------------------------------------- 1 | The Mac VirtualGL Client is an X program that requires XQuartz. The VirtualGL 2 | Client must be launched from an xterm or Terminal window. Refer to the 3 | VirtualGL User's Guide for usage instructions. 4 | -------------------------------------------------------------------------------- /release/ReadMe.txt: -------------------------------------------------------------------------------- 1 | VirtualGL is a toolkit that allows most Linux/Unix OpenGL applications to be remotely displayed with 3D hardware acceleration to thin clients, regardless of whether the clients have 3D rendering capabilities, and regardless of the size of the 3D data being rendered or the speed of the network. 2 | 3 | Using the vglrun script on a Linux or Unix server, the VirtualGL Faker library is preloaded into an OpenGL application at run time. The faker then intercepts and modifies ("interposes") certain GLX, OpenGL, X11, and XCB function calls in order to seamlessly redirect 3D rendering from the application's windows into corresponding GPU-attached off-screen buffers, read back the rendered frames, and transport the frames to the "2D X Server" (the X server to which the application's GUI is being displayed), where the frames are composited back into the application's windows. 4 | 5 | VirtualGL can be used to give hardware-accelerated 3D rendering capabilities to VNC and other X proxies that either lack OpenGL support or provide it through a software renderer. In a LAN environment, VGL can also be used with its built-in high-performance image transport (the VGL Transport), which sends the rendered frames to the VirtualGL Client application for compositing on a client-side 2D X server. 6 | 7 | This package includes the VirtualGL Client application (vglclient) for Intel-based Macs and the vglconnect script. It is not necessary to install this package when using VirtualGL with VNC and other X proxies. XQuartz must be installed prior to using the VirtualGL Client. 8 | 9 | Refer to the VirtualGL User's Guide (a link to which is provided in the Applications folder) for usage information. 10 | -------------------------------------------------------------------------------- /release/Welcome.txt: -------------------------------------------------------------------------------- 1 | This package will install the VirtualGL Client for Macs with Intel or Apple silicon CPUs. To remove VirtualGL, use the VirtualGL uninstaller application, which can be found in the same archive as this package or in the "VirtualGL" Applications folder. 2 | -------------------------------------------------------------------------------- /release/deb-control.in: -------------------------------------------------------------------------------- 1 | Package: @PKGNAME_LC@ 2 | Version: @VERSION@-@BUILD@ 3 | Section: misc 4 | Priority: optional 5 | Architecture: @DEBARCH@ 6 | Essential: no 7 | Maintainer: @PKGVENDOR@ <@PKGEMAIL@> 8 | Homepage: @PKGURL@ 9 | Installed-Size: {__SIZE} 10 | Depends: libxtst6:@DEBARCH@, libxv1:@DEBARCH@, libglu1-mesa:@DEBARCH@, libegl1:@DEBARCH@ 11 | Description: A toolkit for displaying OpenGL applications to thin clients 12 | VirtualGL is a toolkit that allows most Linux/Unix OpenGL applications to be 13 | remotely displayed with 3D hardware acceleration to thin clients, regardless 14 | of whether the clients have 3D rendering capabilities, and regardless of the 15 | size of the 3D data being rendered or the speed of the network. 16 | . 17 | Using the vglrun script, the VirtualGL Faker library is preloaded into an 18 | OpenGL application at run time. The faker then intercepts and modifies 19 | ("interposes") certain GLX, OpenGL, X11, and XCB function calls in order to 20 | seamlessly redirect 3D rendering from the application's windows into 21 | corresponding GPU-attached off-screen buffers, read back the rendered frames, 22 | and transport the frames to the "2D X Server" (the X server to which the 23 | application's GUI is being displayed), where the frames are composited back 24 | into the application's windows. 25 | . 26 | VirtualGL can be used to give hardware-accelerated 3D rendering capabilities 27 | to VNC and other X proxies that either lack OpenGL support or provide it 28 | through a software renderer. In a LAN environment, VGL can also be used with 29 | its built-in high-performance image transport (the VGL Transport), which sends 30 | the rendered frames to the VirtualGL Client application for compositing on a 31 | client-side 2D X server. VirtualGL also supports image transport plugins, 32 | allowing the rendered frames to be sent or captured using other mechanisms. 33 | . 34 | VirtualGL is based upon ideas presented in various academic papers on this 35 | topic, including "A Generic Solution for Hardware-Accelerated Remote 36 | Visualization" (Stegmaier, Magallon, Ertl 2002) and "A Framework for 37 | Interactive Hardware Accelerated Remote 3D-Visualization" (Engel, Sommer, 38 | Ertl 2000.) 39 | -------------------------------------------------------------------------------- /release/entitlements.plist: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | com.apple.security.cs.disable-library-validation 6 | 7 | 8 | 9 | -------------------------------------------------------------------------------- /release/makerpm.in: -------------------------------------------------------------------------------- 1 | #!/bin/sh 2 | 3 | set -u 4 | set -e 5 | trap onexit INT 6 | trap onexit TERM 7 | trap onexit EXIT 8 | 9 | TMPDIR= 10 | 11 | onexit() 12 | { 13 | if [ ! "$TMPDIR" = "" ]; then 14 | rm -rf $TMPDIR 15 | fi 16 | } 17 | 18 | if [ -f @PKGNAME@-@VERSION@.@RPMARCH@.rpm ]; then 19 | rm -f @PKGNAME@-@VERSION@.@RPMARCH@.rpm 20 | fi 21 | 22 | umask 022 23 | TMPDIR=`mktemp -d /tmp/@CMAKE_PROJECT_NAME@-build.XXXXXX` 24 | 25 | mkdir -p $TMPDIR/RPMS 26 | ln -fs `pwd` $TMPDIR/BUILD 27 | rpmbuild -bb --define "_blddir $TMPDIR/buildroot" --define "_topdir $TMPDIR" \ 28 | --target @RPMARCH@ pkgscripts/rpm.spec; \ 29 | cp $TMPDIR/RPMS/@RPMARCH@/@PKGNAME@-@VERSION@-@BUILD@.@RPMARCH@.rpm \ 30 | @PKGNAME@-@VERSION@.@RPMARCH@.rpm 31 | -------------------------------------------------------------------------------- /release/makesrpm.in: -------------------------------------------------------------------------------- 1 | #!/bin/sh 2 | 3 | set -u 4 | set -e 5 | trap onexit INT 6 | trap onexit TERM 7 | trap onexit EXIT 8 | 9 | TMPDIR= 10 | 11 | onexit() 12 | { 13 | if [ ! "$TMPDIR" = "" ]; then 14 | rm -rf $TMPDIR 15 | fi 16 | } 17 | 18 | PKGNAME=@PKGNAME@ 19 | PROJECT=@CMAKE_PROJECT_NAME@ 20 | VERSION=@VERSION@ 21 | BUILD=@BUILD@ 22 | 23 | if [ -f $PKGNAME-$VERSION.src.rpm ]; then 24 | rm -f $PKGNAME-$VERSION.src.rpm 25 | fi 26 | 27 | umask 022 28 | TMPDIR=`mktemp -d /tmp/$PKGNAME-build.XXXXXX` 29 | 30 | mkdir -p $TMPDIR/RPMS 31 | mkdir -p $TMPDIR/SRPMS 32 | mkdir -p $TMPDIR/BUILD 33 | mkdir -p $TMPDIR/SOURCES 34 | mkdir -p $TMPDIR/SPECS 35 | 36 | if [ ! -f $PROJECT-$VERSION.tar.gz ]; then 37 | echo "ERROR: $PROJECT-$VERSION.tar.gz does not exist." 38 | fi 39 | 40 | cp $PROJECT-$VERSION.tar.gz $TMPDIR/SOURCES/$PROJECT-$VERSION.tar.gz 41 | 42 | cat pkgscripts/rpm.spec | sed s/%{_blddir}/%{_tmppath}/g \ 43 | | sed s/#--\>//g > $TMPDIR/SPECS/$PKGNAME.spec 44 | 45 | rpmbuild -bs --define "_topdir $TMPDIR" $TMPDIR/SPECS/$PKGNAME.spec 46 | mv $TMPDIR/SRPMS/$PKGNAME-$VERSION-$BUILD.src.rpm $PKGNAME-$VERSION.src.rpm 47 | 48 | exit 49 | -------------------------------------------------------------------------------- /release/maketarball.in: -------------------------------------------------------------------------------- 1 | #!/bin/sh 2 | 3 | set -u 4 | set -e 5 | trap onexit INT 6 | trap onexit TERM 7 | trap onexit EXIT 8 | 9 | TMPDIR= 10 | SUDO= 11 | 12 | onexit() 13 | { 14 | if [ ! "$TMPDIR" = "" ]; then 15 | rm -rf $TMPDIR 16 | fi 17 | } 18 | 19 | uid() 20 | { 21 | id | cut -f2 -d = | cut -f1 -d \(; 22 | } 23 | 24 | PKGNAME=@PKGNAME@ 25 | VERSION=@VERSION@ 26 | ARCH=@CPU_TYPE@ 27 | OS=@CMAKE_SYSTEM_NAME@ 28 | PREFIX=@CMAKE_INSTALL_PREFIX@ 29 | 30 | umask 022 31 | rm -f $PKGNAME-$VERSION-$OS-$ARCH.tar.bz2 32 | TMPDIR=`mktemp -d /tmp/$PKGNAME-build.XXXXXX` 33 | mkdir -p $TMPDIR/install 34 | 35 | DESTDIR=$TMPDIR/install @CMAKE_MAKE_PROGRAM@ install 36 | echo tartest >$TMPDIR/tartest 37 | GNUTAR=0 38 | BSDTAR=0 39 | tar cf $TMPDIR/tartest.tar --owner=root --group=root -C $TMPDIR tartest >/dev/null 2>&1 && GNUTAR=1 40 | if [ "$GNUTAR" = "1" ]; then 41 | tar cf - --owner=root --group=root -C $TMPDIR/install .$PREFIX | bzip2 -c >$PKGNAME-$VERSION-$OS-$ARCH.tar.bz2 42 | else 43 | tar cf $TMPDIR/tartest.tar --uid 0 --gid 0 -C $TMPDIR tartest >/dev/null 2>&1 && BSDTAR=1 44 | if [ "$BSDTAR" = "1" ]; then 45 | tar cf - --uid=0 --gid=0 -C $TMPDIR/install .$PREFIX | bzip2 -c >$PKGNAME-$VERSION-$OS-$ARCH.tar.bz2 46 | else 47 | tar cf - -C $TMPDIR/install .$PREFIX | bzip2 -c >$PKGNAME-$VERSION-$OS-$ARCH.tar.bz2 48 | fi 49 | fi 50 | 51 | exit 52 | -------------------------------------------------------------------------------- /server/ContextHash.cpp: -------------------------------------------------------------------------------- 1 | // Copyright (C)2014, 2020-2021 D. R. Commander 2 | // 3 | // This library is free software and may be redistributed and/or modified under 4 | // the terms of the wxWindows Library License, Version 3.1 or (at your option) 5 | // any later version. The full license is in the LICENSE.txt file included 6 | // with this distribution. 7 | // 8 | // This library is distributed in the hope that it will be useful, 9 | // but WITHOUT ANY WARRANTY; without even the implied warranty of 10 | // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 11 | // wxWindows Library License for more details. 12 | 13 | #include "ContextHash.h" 14 | 15 | using namespace faker; 16 | 17 | ContextHash *ContextHash::instance = NULL; 18 | util::CriticalSection ContextHash::instanceMutex; 19 | -------------------------------------------------------------------------------- /server/ContextHashEGL.cpp: -------------------------------------------------------------------------------- 1 | // Copyright (C)2014, 2020-2021 D. R. Commander 2 | // 3 | // This library is free software and may be redistributed and/or modified under 4 | // the terms of the wxWindows Library License, Version 3.1 or (at your option) 5 | // any later version. The full license is in the LICENSE.txt file included 6 | // with this distribution. 7 | // 8 | // This library is distributed in the hope that it will be useful, 9 | // but WITHOUT ANY WARRANTY; without even the implied warranty of 10 | // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 11 | // wxWindows Library License for more details. 12 | 13 | #include "ContextHashEGL.h" 14 | 15 | using namespace backend; 16 | 17 | ContextHashEGL *ContextHashEGL::instance = NULL; 18 | util::CriticalSection ContextHashEGL::instanceMutex; 19 | -------------------------------------------------------------------------------- /server/EGLXDisplayHash.cpp: -------------------------------------------------------------------------------- 1 | // Copyright (C)2015, 2021 D. R. Commander 2 | // 3 | // This library is free software and may be redistributed and/or modified under 4 | // the terms of the wxWindows Library License, Version 3.1 or (at your option) 5 | // any later version. The full license is in the LICENSE.txt file included 6 | // with this distribution. 7 | // 8 | // This library is distributed in the hope that it will be useful, 9 | // but WITHOUT ANY WARRANTY; without even the implied warranty of 10 | // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 11 | // wxWindows Library License for more details. 12 | 13 | #include "EGLXDisplayHash.h" 14 | 15 | using namespace faker; 16 | 17 | EGLXDisplayHash *EGLXDisplayHash::instance = NULL; 18 | util::CriticalSection EGLXDisplayHash::instanceMutex; 19 | -------------------------------------------------------------------------------- /server/EGLXVirtualWin.h: -------------------------------------------------------------------------------- 1 | // Copyright (C)2021 D. R. Commander 2 | // 3 | // This library is free software and may be redistributed and/or modified under 4 | // the terms of the wxWindows Library License, Version 3.1 or (at your option) 5 | // any later version. The full license is in the LICENSE.txt file included 6 | // with this distribution. 7 | // 8 | // This library is distributed in the hope that it will be useful, 9 | // but WITHOUT ANY WARRANTY; without even the implied warranty of 10 | // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 11 | // wxWindows Library License for more details. 12 | 13 | #ifndef __EGLXVIRTUALWIN_H__ 14 | #define __EGLXVIRTUALWIN_H__ 15 | 16 | #include 17 | #include "VirtualWin.h" 18 | 19 | 20 | namespace faker 21 | { 22 | class EGLXVirtualWin : public VirtualWin 23 | { 24 | public: 25 | 26 | EGLXVirtualWin(Display *dpy, Window win, EGLDisplay edpy, 27 | EGLConfig config, const EGLint *pbAttribs); 28 | ~EGLXVirtualWin(void); 29 | GLXDrawable updateGLXDrawable(void); 30 | EGLDisplay getEGLDisplay(void) { return edpy; } 31 | EGLSurface getDummySurface(void) { return dummyPB; } 32 | 33 | private: 34 | 35 | EGLint pbAttribs[MAX_ATTRIBS + 1]; 36 | EGLSurface dummyPB; 37 | }; 38 | } 39 | 40 | #endif // __EGLXVIRTUALWIN_H__ 41 | -------------------------------------------------------------------------------- /server/EGLXWindowHash.cpp: -------------------------------------------------------------------------------- 1 | // Copyright (C)2015, 2021 D. R. Commander 2 | // 3 | // This library is free software and may be redistributed and/or modified under 4 | // the terms of the wxWindows Library License, Version 3.1 or (at your option) 5 | // any later version. The full license is in the LICENSE.txt file included 6 | // with this distribution. 7 | // 8 | // This library is distributed in the hope that it will be useful, 9 | // but WITHOUT ANY WARRANTY; without even the implied warranty of 10 | // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 11 | // wxWindows Library License for more details. 12 | 13 | #include "EGLXWindowHash.h" 14 | 15 | using namespace faker; 16 | 17 | EGLXWindowHash *EGLXWindowHash::instance = NULL; 18 | util::CriticalSection EGLXWindowHash::instanceMutex; 19 | -------------------------------------------------------------------------------- /server/FakePbuffer.h: -------------------------------------------------------------------------------- 1 | // Copyright (C)2019-2022 D. R. Commander 2 | // 3 | // This library is free software and may be redistributed and/or modified under 4 | // the terms of the wxWindows Library License, Version 3.1 or (at your option) 5 | // any later version. The full license is in the LICENSE.txt file included 6 | // with this distribution. 7 | // 8 | // This library is distributed in the hope that it will be useful, 9 | // but WITHOUT ANY WARRANTY; without even the implied warranty of 10 | // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 11 | // wxWindows Library License for more details. 12 | 13 | // This class emulates multi-buffered Pbuffers using RBOs, since EGL doesn't 14 | // support multi-buffered Pbuffers. 15 | 16 | #ifndef __FAKEPBUFFER_H__ 17 | #define __FAKEPBUFFER_H__ 18 | 19 | #include "glxvisual.h" 20 | 21 | 22 | namespace backend 23 | { 24 | class FakePbuffer 25 | { 26 | public: 27 | 28 | FakePbuffer(Display *dpy, VGLFBConfig config, const int *glxAttribs); 29 | ~FakePbuffer(void); 30 | 31 | void createBuffer(bool useRBOContext, bool ignoreReadDrawBufs = false, 32 | bool ignoreDrawFBO = false, bool ignoreReadFBO = false); 33 | Display *getDisplay(void) { return dpy; } 34 | GLXDrawable getID(void) { return id; } 35 | VGLFBConfig getFBConfig(void) { return config; } 36 | GLuint getFBO(void) { return fbo; } 37 | int getWidth(void) { return width; } 38 | int getHeight(void) { return height; } 39 | void setDrawBuffer(GLenum mode, bool deferred); 40 | void setDrawBuffers(GLsizei n, const GLenum *bufs, bool deferred); 41 | void setReadBuffer(GLenum readBuf, bool deferred); 42 | void swap(void); 43 | 44 | private: 45 | 46 | void destroy(bool errorCheck); 47 | 48 | Display *dpy; 49 | VGLFBConfig config; 50 | GLXDrawable id; 51 | // 0 = front left, 1 = back left, 2 = front right, 3 = back right 52 | GLuint fbo, rboc[4], rbod; 53 | int width, height; 54 | static util::CriticalSection idMutex; 55 | static GLXDrawable nextID; 56 | }; 57 | } 58 | 59 | #endif // __FAKEPBUFFER_H__ 60 | -------------------------------------------------------------------------------- /server/GLXDrawableHash.cpp: -------------------------------------------------------------------------------- 1 | // Copyright (C)2014, 2020-2021 D. R. Commander 2 | // 3 | // This library is free software and may be redistributed and/or modified under 4 | // the terms of the wxWindows Library License, Version 3.1 or (at your option) 5 | // any later version. The full license is in the LICENSE.txt file included 6 | // with this distribution. 7 | // 8 | // This library is distributed in the hope that it will be useful, 9 | // but WITHOUT ANY WARRANTY; without even the implied warranty of 10 | // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 11 | // wxWindows Library License for more details. 12 | 13 | #include "GLXDrawableHash.h" 14 | 15 | using namespace faker; 16 | 17 | GLXDrawableHash *GLXDrawableHash::instance = NULL; 18 | util::CriticalSection GLXDrawableHash::instanceMutex; 19 | -------------------------------------------------------------------------------- /server/GlobalCriticalSection.cpp: -------------------------------------------------------------------------------- 1 | // Copyright (C)2015 Open Text SA and/or Open Text ULC (in Canada) 2 | // Copyright (C)2015, 2021 D. R. Commander 3 | // 4 | // This library is free software and may be redistributed and/or modified under 5 | // the terms of the wxWindows Library License, Version 3.1 or (at your option) 6 | // any later version. The full license is in the LICENSE.txt file included 7 | // with this distribution. 8 | // 9 | // This library is distributed in the hope that it will be useful, 10 | // but WITHOUT ANY WARRANTY; without even the implied warranty of 11 | // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 12 | // wxWindows Library License for more details. 13 | 14 | #include "GlobalCriticalSection.h" 15 | 16 | using namespace faker; 17 | 18 | GlobalCriticalSection *GlobalCriticalSection::instance = NULL; 19 | util::CriticalSection GlobalCriticalSection::instanceMutex; 20 | -------------------------------------------------------------------------------- /server/PbufferHashEGL.cpp: -------------------------------------------------------------------------------- 1 | // Copyright (C)2014, 2020-2021 D. R. Commander 2 | // 3 | // This library is free software and may be redistributed and/or modified under 4 | // the terms of the wxWindows Library License, Version 3.1 or (at your option) 5 | // any later version. The full license is in the LICENSE.txt file included 6 | // with this distribution. 7 | // 8 | // This library is distributed in the hope that it will be useful, 9 | // but WITHOUT ANY WARRANTY; without even the implied warranty of 10 | // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 11 | // wxWindows Library License for more details. 12 | 13 | #include "PbufferHashEGL.h" 14 | 15 | using namespace backend; 16 | 17 | PbufferHashEGL *PbufferHashEGL::instance = NULL; 18 | util::CriticalSection PbufferHashEGL::instanceMutex; 19 | -------------------------------------------------------------------------------- /server/PixmapHash.cpp: -------------------------------------------------------------------------------- 1 | // Copyright (C)2014, 2020-2021 D. R. Commander 2 | // 3 | // This library is free software and may be redistributed and/or modified under 4 | // the terms of the wxWindows Library License, Version 3.1 or (at your option) 5 | // any later version. The full license is in the LICENSE.txt file included 6 | // with this distribution. 7 | // 8 | // This library is distributed in the hope that it will be useful, 9 | // but WITHOUT ANY WARRANTY; without even the implied warranty of 10 | // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 11 | // wxWindows Library License for more details. 12 | 13 | #include "PixmapHash.h" 14 | 15 | using namespace faker; 16 | 17 | PixmapHash *PixmapHash::instance = NULL; 18 | util::CriticalSection PixmapHash::instanceMutex; 19 | -------------------------------------------------------------------------------- /server/RBOContext.cpp: -------------------------------------------------------------------------------- 1 | // Copyright (C)2014, 2020-2021, 2023 D. R. Commander 2 | // 3 | // This library is free software and may be redistributed and/or modified under 4 | // the terms of the wxWindows Library License, Version 3.1 or (at your option) 5 | // any later version. The full license is in the LICENSE.txt file included 6 | // with this distribution. 7 | // 8 | // This library is distributed in the hope that it will be useful, 9 | // but WITHOUT ANY WARRANTY; without even the implied warranty of 10 | // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 11 | // wxWindows Library License for more details. 12 | 13 | #include "RBOContext.h" 14 | 15 | using namespace backend; 16 | 17 | RBOContext *RBOContext::instance = NULL; 18 | util::CriticalSection RBOContext::instanceMutex; 19 | -------------------------------------------------------------------------------- /server/TempContextEGL.h: -------------------------------------------------------------------------------- 1 | // Copyright (C)2004 Landmark Graphics Corporation 2 | // Copyright (C)2005, 2006 Sun Microsystems, Inc. 3 | // Copyright (C)2011, 2014-2015, 2018-2021, 2025 D. R. Commander 4 | // 5 | // This library is free software and may be redistributed and/or modified under 6 | // the terms of the wxWindows Library License, Version 3.1 or (at your option) 7 | // any later version. The full license is in the LICENSE.txt file included 8 | // with this distribution. 9 | // 10 | // This library is distributed in the hope that it will be useful, 11 | // but WITHOUT ANY WARRANTY; without even the implied warranty of 12 | // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 13 | // wxWindows Library License for more details. 14 | 15 | // This is exactly like TempContext, except that it uses raw EGL surfaces and 16 | // context handles rather than GLX drawables and context handles. 17 | 18 | #ifndef __TEMPCONTEXTEGL_H__ 19 | #define __TEMPCONTEXTEGL_H__ 20 | 21 | #include "faker-sym.h" 22 | #include "EGLError.h" 23 | 24 | 25 | namespace backend 26 | { 27 | class TempContextEGL 28 | { 29 | public: 30 | 31 | TempContextEGL(EGLContext ctx) : oldctx(_eglGetCurrentContext()), 32 | ctxChanged(false) 33 | { 34 | if(!ctx) THROW("Invalid argument"); 35 | if(oldctx != ctx) 36 | { 37 | if(!_eglBindAPI(EGL_OPENGL_API)) 38 | THROW("Could not enable OpenGL API"); 39 | if(!_eglMakeCurrent(EDPY, EGL_NO_SURFACE, EGL_NO_SURFACE, ctx)) 40 | THROW_EGL("eglMakeCurrent()"); 41 | ctxChanged = true; 42 | } 43 | } 44 | 45 | ~TempContextEGL(void) 46 | { 47 | if(ctxChanged) 48 | { 49 | _eglBindAPI(EGL_OPENGL_API); 50 | _eglMakeCurrent(EDPY, EGL_NO_SURFACE, EGL_NO_SURFACE, oldctx); 51 | if(!oldctx) _eglReleaseThread(); 52 | ctxChanged = false; 53 | } 54 | } 55 | 56 | private: 57 | 58 | EGLContext oldctx; 59 | bool ctxChanged; 60 | }; 61 | } 62 | 63 | #endif // __TEMPCONTEXTEGL_H__ 64 | -------------------------------------------------------------------------------- /server/TransPlugin.h: -------------------------------------------------------------------------------- 1 | // Copyright (C)2009-2011, 2014, 2021 D. R. Commander 2 | // 3 | // This library is free software and may be redistributed and/or modified under 4 | // the terms of the wxWindows Library License, Version 3.1 or (at your option) 5 | // any later version. The full license is in the LICENSE.txt file included 6 | // with this distribution. 7 | // 8 | // This library is distributed in the hope that it will be useful, 9 | // but WITHOUT ANY WARRANTY; without even the implied warranty of 10 | // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 11 | // wxWindows Library License for more details. 12 | 13 | #ifndef __TRANSPLUGIN_H__ 14 | #define __TRANSPLUGIN_H__ 15 | 16 | #define RRTRANS_NOPROTOTYPES 17 | #include "rrtransport.h" 18 | #include "Mutex.h" 19 | 20 | 21 | typedef void *(*_RRTransInitType)(Display *, Window, FakerConfig *); 22 | typedef int (*_RRTransConnectType)(void *, char *, int); 23 | typedef RRFrame *(*_RRTransGetFrameType)(void *, int, int, int, int); 24 | typedef int (*_RRTransReadyType)(void *); 25 | typedef int (*_RRTransSynchronizeType)(void *); 26 | typedef int (*_RRTransSendFrameType)(void *, RRFrame *, int); 27 | typedef int (*_RRTransDestroyType)(void *); 28 | typedef const char *(*_RRTransGetErrorType)(void); 29 | 30 | 31 | namespace server 32 | { 33 | class TransPlugin 34 | { 35 | public: 36 | 37 | TransPlugin(Display *dpy, Window win, char *name); 38 | ~TransPlugin(void); 39 | void connect(char *receiverName, int port); 40 | void destroy(void); 41 | int ready(void); 42 | void synchronize(void); 43 | RRFrame *getFrame(int width, int height, int format, bool stereo); 44 | void sendFrame(RRFrame *frame, bool sync); 45 | 46 | private: 47 | 48 | _RRTransInitType _RRTransInit; 49 | _RRTransConnectType _RRTransConnect; 50 | _RRTransGetFrameType _RRTransGetFrame; 51 | _RRTransReadyType _RRTransReady; 52 | _RRTransSynchronizeType _RRTransSynchronize; 53 | _RRTransSendFrameType _RRTransSendFrame; 54 | _RRTransDestroyType _RRTransDestroy; 55 | _RRTransGetErrorType _RRTransGetError; 56 | util::CriticalSection mutex; 57 | void *dllhnd, *handle; 58 | }; 59 | } 60 | 61 | #endif // __TRANSPLUGIN_H__ 62 | -------------------------------------------------------------------------------- /server/VirtualPixmap.h: -------------------------------------------------------------------------------- 1 | // Copyright (C)2011, 2013-2014, 2019-2021 D. R. Commander 2 | // 3 | // This library is free software and may be redistributed and/or modified under 4 | // the terms of the wxWindows Library License, Version 3.1 or (at your option) 5 | // any later version. The full license is in the LICENSE.txt file included 6 | // with this distribution. 7 | // 8 | // This library is distributed in the hope that it will be useful, 9 | // but WITHOUT ANY WARRANTY; without even the implied warranty of 10 | // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 11 | // wxWindows Library License for more details. 12 | 13 | #ifndef __VIRTUALPIXMAP_H__ 14 | 15 | #include "VirtualDrawable.h" 16 | #include "Frame.h" 17 | 18 | 19 | namespace faker 20 | { 21 | class VirtualPixmap : public VirtualDrawable 22 | { 23 | public: 24 | 25 | VirtualPixmap(Display *dpy, Visual *visual, Pixmap pm); 26 | ~VirtualPixmap(); 27 | int init(int width, int height, int depth, VGLFBConfig config, 28 | const int *attribs); 29 | void readback(void); 30 | Pixmap get3DX11Pixmap(void); 31 | 32 | private: 33 | 34 | common::Profiler profPMBlit; 35 | common::FBXFrame *frame; 36 | }; 37 | } 38 | 39 | #endif // __VIRTUALPIXMAP_H__ 40 | -------------------------------------------------------------------------------- /server/VisualHash.cpp: -------------------------------------------------------------------------------- 1 | // Copyright (C)2014, 2020-2021 D. R. Commander 2 | // 3 | // This library is free software and may be redistributed and/or modified under 4 | // the terms of the wxWindows Library License, Version 3.1 or (at your option) 5 | // any later version. The full license is in the LICENSE.txt file included 6 | // with this distribution. 7 | // 8 | // This library is distributed in the hope that it will be useful, 9 | // but WITHOUT ANY WARRANTY; without even the implied warranty of 10 | // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 11 | // wxWindows Library License for more details. 12 | 13 | #include "VisualHash.h" 14 | 15 | using namespace faker; 16 | 17 | VisualHash *VisualHash::instance = NULL; 18 | util::CriticalSection VisualHash::instanceMutex; 19 | -------------------------------------------------------------------------------- /server/WindowHash.cpp: -------------------------------------------------------------------------------- 1 | // Copyright (C)2014, 2020-2021 D. R. Commander 2 | // 3 | // This library is free software and may be redistributed and/or modified under 4 | // the terms of the wxWindows Library License, Version 3.1 or (at your option) 5 | // any later version. The full license is in the LICENSE.txt file included 6 | // with this distribution. 7 | // 8 | // This library is distributed in the hope that it will be useful, 9 | // but WITHOUT ANY WARRANTY; without even the implied warranty of 10 | // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 11 | // wxWindows Library License for more details. 12 | 13 | #include "WindowHash.h" 14 | 15 | using namespace faker; 16 | 17 | WindowHash *WindowHash::instance = NULL; 18 | util::CriticalSection WindowHash::instanceMutex; 19 | -------------------------------------------------------------------------------- /server/X11Trans.h: -------------------------------------------------------------------------------- 1 | // Copyright (C)2004 Landmark Graphics Corporation 2 | // Copyright (C)2005, 2006 Sun Microsystems, Inc. 3 | // Copyright (C)2010-2011, 2014, 2021, 2024 D. R. Commander 4 | // 5 | // This library is free software and may be redistributed and/or modified under 6 | // the terms of the wxWindows Library License, Version 3.1 or (at your option) 7 | // any later version. The full license is in the LICENSE.txt file included 8 | // with this distribution. 9 | // 10 | // This library is distributed in the hope that it will be useful, 11 | // but WITHOUT ANY WARRANTY; without even the implied warranty of 12 | // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 13 | // wxWindows Library License for more details. 14 | 15 | #ifndef __X11TRANS_H__ 16 | #define __X11TRANS_H__ 17 | 18 | #include "Thread.h" 19 | #include "Frame.h" 20 | #include "GenericQ.h" 21 | #include "Profiler.h" 22 | 23 | 24 | namespace server 25 | { 26 | class X11Trans : public util::Runnable 27 | { 28 | public: 29 | 30 | X11Trans(void); 31 | 32 | virtual ~X11Trans(void) 33 | { 34 | deadYet = true; 35 | q.release(); 36 | if(thread) { thread->stop(); delete thread; thread = NULL; } 37 | for(int i = 0; i < nFrames; i++) 38 | { 39 | delete frames[i]; frames[i] = NULL; 40 | } 41 | } 42 | 43 | bool isReady(void); 44 | void synchronize(void); 45 | void sendFrame(common::FBXFrame *, bool sync = false); 46 | void run(void); 47 | common::FBXFrame *getFrame(Display *dpy, Window win, int width, 48 | int height); 49 | 50 | private: 51 | 52 | int nFrames; 53 | util::CriticalSection mutex; 54 | common::FBXFrame *frames[3]; 55 | util::Event ready; 56 | util::GenericQ q; 57 | util::Thread *thread; 58 | bool deadYet; 59 | common::Profiler profBlit, profTotal; 60 | }; 61 | } 62 | 63 | #endif // __X11TRANS_H__ 64 | -------------------------------------------------------------------------------- /server/XCBConnHash.cpp: -------------------------------------------------------------------------------- 1 | // Copyright (C)2014, 2020-2021 D. R. Commander 2 | // 3 | // This library is free software and may be redistributed and/or modified under 4 | // the terms of the wxWindows Library License, Version 3.1 or (at your option) 5 | // any later version. The full license is in the LICENSE.txt file included 6 | // with this distribution. 7 | // 8 | // This library is distributed in the hope that it will be useful, 9 | // but WITHOUT ANY WARRANTY; without even the implied warranty of 10 | // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 11 | // wxWindows Library License for more details. 12 | 13 | #ifdef FAKEXCB 14 | 15 | #include "XCBConnHash.h" 16 | 17 | using namespace faker; 18 | 19 | XCBConnHash *XCBConnHash::instance = NULL; 20 | util::CriticalSection XCBConnHash::instanceMutex; 21 | 22 | #endif 23 | -------------------------------------------------------------------------------- /server/XVTrans.h: -------------------------------------------------------------------------------- 1 | // Copyright (C)2004 Landmark Graphics Corporation 2 | // Copyright (C)2005, 2006 Sun Microsystems, Inc. 3 | // Copyright (C)2009-2011, 2014, 2021 D. R. Commander 4 | // 5 | // This library is free software and may be redistributed and/or modified under 6 | // the terms of the wxWindows Library License, Version 3.1 or (at your option) 7 | // any later version. The full license is in the LICENSE.txt file included 8 | // with this distribution. 9 | // 10 | // This library is distributed in the hope that it will be useful, 11 | // but WITHOUT ANY WARRANTY; without even the implied warranty of 12 | // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 13 | // wxWindows Library License for more details. 14 | 15 | #ifndef __XVTRANS_H__ 16 | #define __XVTRANS_H__ 17 | 18 | #include "Thread.h" 19 | #include "Frame.h" 20 | #include "GenericQ.h" 21 | #include "Profiler.h" 22 | 23 | 24 | namespace server 25 | { 26 | class XVTrans : public util::Runnable 27 | { 28 | public: 29 | 30 | XVTrans(void); 31 | 32 | virtual ~XVTrans(void) 33 | { 34 | deadYet = true; 35 | q.release(); 36 | if(thread) { thread->stop(); delete thread; thread = NULL; } 37 | for(int i = 0; i < NFRAMES; i++) 38 | { 39 | delete frames[i]; frames[i] = NULL; 40 | } 41 | } 42 | 43 | bool isReady(void); 44 | void synchronize(void); 45 | void sendFrame(common::XVFrame *f, bool sync = false); 46 | void run(void); 47 | common::XVFrame *getFrame(Display *dpy, Window win, int w, int h); 48 | 49 | private: 50 | 51 | static const int NFRAMES = 3; 52 | util::CriticalSection mutex; 53 | common::XVFrame *frames[NFRAMES]; 54 | util::Event ready; 55 | util::GenericQ q; 56 | util::Thread *thread; 57 | bool deadYet; 58 | common::Profiler profXV, profTotal; 59 | }; 60 | } 61 | 62 | #endif // __XVTRANS_H__ 63 | -------------------------------------------------------------------------------- /server/faker-ocl.cpp: -------------------------------------------------------------------------------- 1 | // Copyright (C)2019, 2021 D. R. Commander 2 | // 3 | // This library is free software and may be redistributed and/or modified under 4 | // the terms of the wxWindows Library License, Version 3.1 or (at your option) 5 | // any later version. The full license is in the LICENSE.txt file included 6 | // with this distribution. 7 | // 8 | // This library is distributed in the hope that it will be useful, 9 | // but WITHOUT ANY WARRANTY; without even the implied warranty of 10 | // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 11 | // wxWindows Library License for more details. 12 | 13 | // Interposed OpenCL functions 14 | 15 | #include "faker-sym.h" 16 | 17 | 18 | extern "C" { 19 | 20 | cl_context clCreateContext(const cl_context_properties *properties, 21 | cl_uint num_devices, const cl_device_id *devices, 22 | void pfn_notify(const char *errinfo, const void *private_info, size_t cb, 23 | void *user_data), void *user_data, cl_int *errcode_ret) 24 | { 25 | cl_context_properties oclprops[MAX_ATTRIBS + 1], 26 | *props = (cl_context_properties *)properties; 27 | int j = 0; 28 | 29 | TRY(); 30 | 31 | if(properties) 32 | { 33 | memset(oclprops, 0, sizeof(cl_context_properties) * (MAX_ATTRIBS + 1)); 34 | for(int i = 0; properties[i] != 0 && i < MAX_ATTRIBS; i += 2) 35 | { 36 | oclprops[j++] = properties[i]; 37 | if(properties[i] == CL_GLX_DISPLAY_KHR) 38 | { 39 | Display *dpy = (Display *)properties[i + 1]; 40 | if(dpy && !IS_EXCLUDED(dpy)) 41 | { 42 | if(fconfig.egl) 43 | THROW("OpenCL/OpenGL interoperability requires the GLX back end"); 44 | oclprops[j++] = (cl_context_properties)(DPY3D); 45 | props = oclprops; 46 | } 47 | } 48 | else oclprops[j++] = properties[i + 1]; 49 | } 50 | } 51 | 52 | CATCH(); 53 | 54 | return _clCreateContext(props, num_devices, devices, pfn_notify, user_data, 55 | errcode_ret); 56 | } 57 | 58 | 59 | } // extern "C" 60 | -------------------------------------------------------------------------------- /server/fakerconfig.h.in: -------------------------------------------------------------------------------- 1 | // Copyright (C)2009, 2016, 2018, 2020-2021, 2023 D. R. Commander 2 | // 3 | // This library is free software and may be redistributed and/or modified under 4 | // the terms of the wxWindows Library License, Version 3.1 or (at your option) 5 | // any later version. The full license is in the LICENSE.txt file included 6 | // with this distribution. 7 | // 8 | // This library is distributed in the hope that it will be useful, 9 | // but WITHOUT ANY WARRANTY; without even the implied warranty of 10 | // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 11 | // wxWindows Library License for more details. 12 | 13 | #ifndef __FAKERCONFIG_H__ 14 | #define __FAKERCONFIG_H__ 15 | 16 | #include 17 | #include "rr.h" 18 | #include "Mutex.h" 19 | 20 | #ifndef FCONFIG_USESHM 21 | #define FCONFIG_USESHM 1 22 | #endif 23 | 24 | #define VGLCONFIG_PATH "@CMAKE_INSTALL_FULL_BINDIR@/vglconfig" 25 | 26 | FakerConfig *fconfig_getinstance(void); 27 | void fconfig_deleteinstance(util::CriticalSection *mutex = NULL); 28 | 29 | #define fconfig (*fconfig_getinstance()) 30 | 31 | #if FCONFIG_USESHM == 1 32 | int fconfig_getshmid(void); 33 | #endif 34 | void fconfig_print(FakerConfig &fc); 35 | void fconfig_reloadenv(void); 36 | void fconfig_setcompress(FakerConfig &fc, int i); 37 | void fconfig_setdefaultsfromdpy(Display *dpy); 38 | void fconfig_setprobeglxfromdpy(Display *dpy); 39 | void fconfig_setgamma(FakerConfig &fc, double gamma); 40 | 41 | #endif // __FAKERCONFIG_H__ 42 | -------------------------------------------------------------------------------- /server/fakerut-supplement.c: -------------------------------------------------------------------------------- 1 | /* Copyright (C)2015 D. R. Commander 2 | * 3 | * This library is free software and may be redistributed and/or modified under 4 | * the terms of the wxWindows Library License, Version 3.1 or (at your option) 5 | * any later version. The full license is in the LICENSE.txt file included 6 | * with this distribution. 7 | * 8 | * This library is distributed in the hope that it will be useful, 9 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 10 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 11 | * wxWindows Library License for more details. 12 | */ 13 | 14 | #include 15 | 16 | /* This will cause a crash in VirtualGL 2.4 beta1 and earlier. */ 17 | PFNGLBINDBUFFERPROC glBindBuffer = NULL; 18 | -------------------------------------------------------------------------------- /server/fltk/CREDITS.txt: -------------------------------------------------------------------------------- 1 | CREDITS - Fast Light Tool Kit (FLTK) 2 | ------------------------------------- 3 | 4 | This file lists the people responsible for the toolkit you are 5 | now using. If you've been looking for your name in lights 6 | but we've forgotten you here, please use the report on the 7 | following page, and we'll update this file accordingly: 8 | 9 | https://www.fltk.org/bugs.php 10 | 11 | 12 | CORE DEVELOPERS 13 | 14 | The following people do the day-to-day development of FLTK: 15 | 16 | Greg Ercolano 17 | Manolo Gouy 18 | Ian MacArthur 19 | Matthias Melcher 20 | Albrecht Schlosser 21 | 22 | These people have previously been active developers of FLTK: 23 | 24 | Fabien Costantini 25 | Craig P. Earls 26 | Curtis Edwards 27 | Gustavo Hime 28 | Talbot Hughes 29 | Lauri Kasanen 30 | Robert Kesterson 31 | Pierre Ossman 32 | James Dean Palmer 33 | Vincent Penne 34 | Bill Spitzak 35 | Michael Sweet 36 | Carl Thompson 37 | Nafees Bin Zafar 38 | 39 | 40 | OTHER CONTRIBUTORS 41 | 42 | The following people have contributed fixes or enhancements to FLTK: 43 | 44 | Laszlo Z. Antal (LZA) 45 | Teun Burgers 46 | Paul Chambers 47 | Stephen Davies 48 | Yuri D'Elia 49 | Domingo Alvarez Duarte 50 | Yuri Fedorchenko 51 | George Garvey 52 | Duncan Gibson 53 | Daniel Harding 54 | Mikael Hultgren 55 | Stuart Levy 56 | Jean-Marc Lienher (OksiD) 57 | Howard Lightstone 58 | Mike Lindner 59 | Alexander Mai 60 | Alexander Rabi 61 | James Roth 62 | Ivan Nieto (Mr.Satan) 63 | Jamie Snape 64 | Andrea Suatoni 65 | Michael Surette 66 | Paul Sydney 67 | Aaron Ucko 68 | Emanuele Vicentini 69 | Josef Vitu 70 | Jim Wilson 71 | Ken Yarnall 72 | -------------------------------------------------------------------------------- /server/fltk/FL/Fl_Check_Button.H: -------------------------------------------------------------------------------- 1 | // 2 | // Check button header file for the Fast Light Tool Kit (FLTK). 3 | // 4 | // Copyright 1998-2014 by Bill Spitzak and others. 5 | // 6 | // This library is free software. Distribution and use rights are outlined in 7 | // the file "COPYING" which should have been included with this file. If this 8 | // file is missing or damaged, see the license at: 9 | // 10 | // https://www.fltk.org/COPYING.php 11 | // 12 | // Please see the following page on how to report bugs and issues: 13 | // 14 | // https://www.fltk.org/bugs.php 15 | // 16 | 17 | #ifndef Fl_Check_Button_H 18 | #define Fl_Check_Button_H 19 | 20 | #include "Fl_Light_Button.H" 21 | 22 | /* 23 | class: Fl_Check_Button. 24 | 25 | A button with a "checkmark" to show its status. 26 | */ 27 | 28 | class FL_EXPORT Fl_Check_Button : public Fl_Light_Button { 29 | public: 30 | Fl_Check_Button(int X, int Y, int W, int H, const char *L = 0); 31 | }; 32 | 33 | #endif 34 | -------------------------------------------------------------------------------- /server/fltk/FL/Fl_Double_Window.H: -------------------------------------------------------------------------------- 1 | // 2 | // Double-buffered window header file for the Fast Light Tool Kit (FLTK). 3 | // 4 | // Copyright 1998-2010 by Bill Spitzak and others. 5 | // 6 | // This library is free software. Distribution and use rights are outlined in 7 | // the file "COPYING" which should have been included with this file. If this 8 | // file is missing or damaged, see the license at: 9 | // 10 | // https://www.fltk.org/COPYING.php 11 | // 12 | // Please see the following page on how to report bugs and issues: 13 | // 14 | // https://www.fltk.org/bugs.php 15 | // 16 | 17 | /* \file 18 | Fl_Double_Window widget . */ 19 | 20 | #ifndef Fl_Double_Window_H 21 | #define Fl_Double_Window_H 22 | 23 | #include "Fl_Window.H" 24 | 25 | /** 26 | The Fl_Double_Window provides a double-buffered window. 27 | It will draw the window data into an off-screen pixmap, and then 28 | copy it to the on-screen window. 29 | */ 30 | class FL_EXPORT Fl_Double_Window : public Fl_Window 31 | { 32 | public: 33 | Fl_Double_Window *as_double_window() FL_OVERRIDE {return this; } 34 | void show() FL_OVERRIDE; 35 | /** Same as Fl_Window::show(int a, char **b) */ 36 | void show(int a, char **b) {Fl_Window::show(a,b);} 37 | void resize(int,int,int,int) FL_OVERRIDE; 38 | void hide() FL_OVERRIDE; 39 | void flush() FL_OVERRIDE; 40 | ~Fl_Double_Window(); 41 | 42 | /** 43 | Creates a new Fl_Double_Window widget using the given 44 | position, size, and label (title) string. 45 | */ 46 | Fl_Double_Window(int W, int H, const char *l = 0); 47 | 48 | /** 49 | See Fl_Double_Window::Fl_Double_Window(int w, int h, const char *label = 0) 50 | */ 51 | Fl_Double_Window(int X, int Y, int W, int H, const char *l = 0); 52 | 53 | }; 54 | 55 | #endif 56 | -------------------------------------------------------------------------------- /server/fltk/FL/Fl_Export.H: -------------------------------------------------------------------------------- 1 | /* 2 | * Windows DLL export . 3 | * 4 | * Copyright 1998-2018 by Bill Spitzak and others. 5 | * 6 | * This library is free software. Distribution and use rights are outlined in 7 | * the file "COPYING" which should have been included with this file. If this 8 | * file is missing or damaged, see the license at: 9 | * 10 | * https://www.fltk.org/COPYING.php 11 | * 12 | * Please see the following page on how to report bugs and issues: 13 | * 14 | * https://www.fltk.org/bugs.php 15 | */ 16 | 17 | #ifndef Fl_Export_H 18 | # define Fl_Export_H 19 | 20 | /* 21 | * The following is used when building DLLs under Windows 22 | * and when building .so's under unix/linux. 23 | */ 24 | 25 | # if defined(FL_DLL) 26 | # ifdef FL_LIBRARY 27 | # define FL_EXPORT __declspec(dllexport) 28 | # else 29 | # define FL_EXPORT __declspec(dllimport) 30 | # endif /* FL_LIBRARY */ 31 | # elif __GNUC__ >= 4 32 | # define FL_EXPORT __attribute__ ((visibility ("default"))) 33 | # else 34 | # define FL_EXPORT 35 | # endif /* FL_DLL */ 36 | 37 | #endif /* !Fl_Export_H */ 38 | -------------------------------------------------------------------------------- /server/fltk/FL/Fl_Fill_Dial.H: -------------------------------------------------------------------------------- 1 | // 2 | // Filled dial header file for the Fast Light Tool Kit (FLTK). 3 | // 4 | // Copyright 1998-2010 by Bill Spitzak and others. 5 | // 6 | // This library is free software. Distribution and use rights are outlined in 7 | // the file "COPYING" which should have been included with this file. If this 8 | // file is missing or damaged, see the license at: 9 | // 10 | // https://www.fltk.org/COPYING.php 11 | // 12 | // Please see the following page on how to report bugs and issues: 13 | // 14 | // https://www.fltk.org/bugs.php 15 | // 16 | 17 | /* \file 18 | Fl_Fill_Dial widget . */ 19 | 20 | #ifndef Fl_Fill_Dial_H 21 | #define Fl_Fill_Dial_H 22 | 23 | #include "Fl_Dial.H" 24 | 25 | /** Draws a dial with a filled arc */ 26 | class FL_EXPORT Fl_Fill_Dial : public Fl_Dial { 27 | public: 28 | /** Creates a filled dial, also setting its type to FL_FILL_DIAL. */ 29 | Fl_Fill_Dial(int X,int Y,int W,int H, const char *L = NULL); 30 | }; 31 | 32 | #endif 33 | -------------------------------------------------------------------------------- /server/fltk/FL/Fl_Fill_Slider.H: -------------------------------------------------------------------------------- 1 | // 2 | // Filled slider header file for the Fast Light Tool Kit (FLTK). 3 | // 4 | // Copyright 1998-2010 by Bill Spitzak and others. 5 | // 6 | // This library is free software. Distribution and use rights are outlined in 7 | // the file "COPYING" which should have been included with this file. If this 8 | // file is missing or damaged, see the license at: 9 | // 10 | // https://www.fltk.org/COPYING.php 11 | // 12 | // Please see the following page on how to report bugs and issues: 13 | // 14 | // https://www.fltk.org/bugs.php 15 | // 16 | 17 | /* \file 18 | Fl_Fill_Slider widget . */ 19 | 20 | #ifndef Fl_Fill_Slider_H 21 | #define Fl_Fill_Slider_H 22 | 23 | #include "Fl_Slider.H" 24 | /** Widget that draws a filled horizontal slider, useful as a progress or value meter*/ 25 | class FL_EXPORT Fl_Fill_Slider : public Fl_Slider { 26 | public: 27 | /** Creates the slider from its position,size and optional title. */ 28 | Fl_Fill_Slider(int X,int Y,int W,int H,const char *L=0); 29 | }; 30 | 31 | #endif 32 | -------------------------------------------------------------------------------- /server/fltk/FL/Fl_Float_Input.H: -------------------------------------------------------------------------------- 1 | // 2 | // Floating point input header file for the Fast Light Tool Kit (FLTK). 3 | // 4 | // Copyright 1998-2011 by Bill Spitzak and others. 5 | // 6 | // This library is free software. Distribution and use rights are outlined in 7 | // the file "COPYING" which should have been included with this file. If this 8 | // file is missing or damaged, see the license at: 9 | // 10 | // https://www.fltk.org/COPYING.php 11 | // 12 | // Please see the following page on how to report bugs and issues: 13 | // 14 | // https://www.fltk.org/bugs.php 15 | // 16 | 17 | /* \file 18 | Fl_Float_Input widget . */ 19 | 20 | #ifndef Fl_Float_Input_H 21 | #define Fl_Float_Input_H 22 | 23 | #include "Fl_Input.H" 24 | 25 | /** 26 | The Fl_Float_Input class is a subclass of Fl_Input 27 | that only allows the user to type floating point numbers (sign, 28 | digits, decimal point, more digits, 'E' or 'e', sign, digits). 29 | */ 30 | class FL_EXPORT Fl_Float_Input : public Fl_Input { 31 | public: 32 | /** 33 | Creates a new Fl_Float_Input widget using the given position, 34 | size, and label string. The default boxtype is FL_DOWN_BOX. 35 | 36 | Inherited destructor destroys the widget and any value associated with it. 37 | */ 38 | Fl_Float_Input(int X,int Y,int W,int H,const char *l = 0); 39 | }; 40 | 41 | #endif 42 | -------------------------------------------------------------------------------- /server/fltk/FL/Fl_Hold_Browser.H: -------------------------------------------------------------------------------- 1 | // 2 | // Hold browser header file for the Fast Light Tool Kit (FLTK). 3 | // 4 | // Copyright 1998-2010 by Bill Spitzak and others. 5 | // 6 | // This library is free software. Distribution and use rights are outlined in 7 | // the file "COPYING" which should have been included with this file. If this 8 | // file is missing or damaged, see the license at: 9 | // 10 | // https://www.fltk.org/COPYING.php 11 | // 12 | // Please see the following page on how to report bugs and issues: 13 | // 14 | // https://www.fltk.org/bugs.php 15 | // 16 | 17 | /* \file 18 | Fl_Hold_Browser widget . */ 19 | 20 | #ifndef Fl_Hold_Browser_H 21 | #define Fl_Hold_Browser_H 22 | 23 | #include "Fl_Browser.H" 24 | 25 | /** 26 | The Fl_Hold_Browser is a subclass of Fl_Browser which lets the user 27 | select a single item, or no items by clicking on the empty space. 28 | 29 | \image html fl_hold_browser.png "Fl_Hold_Browser" 30 | \image latex fl_hold_browser.png "Fl_Hold_Browser" width=4cm 31 | 32 | As long as the mouse button is held down the item 33 | pointed to by it is highlighted, and this highlighting remains on when 34 | the mouse button is released. Normally the callback is done when the 35 | user releases the mouse, but you can change this with when(). 36 |

See Fl_Browser for methods to add and remove lines from the browser. 37 | */ 38 | class FL_EXPORT Fl_Hold_Browser : public Fl_Browser { 39 | public: 40 | /** 41 | Creates a new Fl_Hold_Browser widget using the given 42 | position, size, and label string. The default boxtype is FL_DOWN_BOX. 43 | The constructor specializes Fl_Browser() by setting the type to FL_HOLD_BROWSER. 44 | The destructor destroys the widget and frees all memory that has been allocated. 45 | */ 46 | Fl_Hold_Browser(int X,int Y,int W,int H,const char *L=0); 47 | }; 48 | 49 | #endif 50 | -------------------------------------------------------------------------------- /server/fltk/FL/Fl_Hor_Fill_Slider.H: -------------------------------------------------------------------------------- 1 | // 2 | // Horizontal fill slider header file for the Fast Light Tool Kit (FLTK). 3 | // 4 | // Copyright 1998-2010 by Bill Spitzak and others. 5 | // 6 | // This library is free software. Distribution and use rights are outlined in 7 | // the file "COPYING" which should have been included with this file. If this 8 | // file is missing or damaged, see the license at: 9 | // 10 | // https://www.fltk.org/COPYING.php 11 | // 12 | // Please see the following page on how to report bugs and issues: 13 | // 14 | // https://www.fltk.org/bugs.php 15 | // 16 | 17 | /* \file 18 | Fl_Hor_Fill_Slider widget . */ 19 | 20 | #ifndef Fl_Hor_Fill_Slider_H 21 | #define Fl_Hor_Fill_Slider_H 22 | 23 | #include "Fl_Slider.H" 24 | 25 | class FL_EXPORT Fl_Hor_Fill_Slider : public Fl_Slider { 26 | public: 27 | Fl_Hor_Fill_Slider(int X,int Y,int W,int H,const char *L=0); 28 | }; 29 | 30 | #endif 31 | -------------------------------------------------------------------------------- /server/fltk/FL/Fl_Hor_Nice_Slider.H: -------------------------------------------------------------------------------- 1 | // 2 | // Horizontal "nice" slider header file for the Fast Light Tool Kit (FLTK). 3 | // 4 | // Copyright 1998-2010 by Bill Spitzak and others. 5 | // 6 | // This library is free software. Distribution and use rights are outlined in 7 | // the file "COPYING" which should have been included with this file. If this 8 | // file is missing or damaged, see the license at: 9 | // 10 | // https://www.fltk.org/COPYING.php 11 | // 12 | // Please see the following page on how to report bugs and issues: 13 | // 14 | // https://www.fltk.org/bugs.php 15 | // 16 | 17 | /* \file 18 | Fl_Hor_Nice_Slider widget . */ 19 | 20 | #ifndef Fl_Hor_Nice_Slider_H 21 | #define Fl_Hor_Nice_Slider_H 22 | 23 | #include "Fl_Slider.H" 24 | 25 | /** \class Fl_Hor_Nice_Slider 26 | 27 | \brief Single thumb tab slider 28 | 29 | \image html fl_hor_nice_slider.png "Fl_Hor_Nice_Slider with various Fl::scheme() values" 30 | \image latex fl_hor_nice_slider.png "Fl_Hor_Nice_Slider with various Fl::scheme() values" width=6cm 31 | 32 | **/ 33 | 34 | class FL_EXPORT Fl_Hor_Nice_Slider : public Fl_Slider { 35 | public: 36 | Fl_Hor_Nice_Slider(int X,int Y,int W,int H,const char *L=0); 37 | }; 38 | 39 | #endif 40 | -------------------------------------------------------------------------------- /server/fltk/FL/Fl_Hor_Slider.H: -------------------------------------------------------------------------------- 1 | // 2 | // Horizontal slider header file for the Fast Light Tool Kit (FLTK). 3 | // 4 | // Copyright 1998-2011 by Bill Spitzak and others. 5 | // 6 | // This library is free software. Distribution and use rights are outlined in 7 | // the file "COPYING" which should have been included with this file. If this 8 | // file is missing or damaged, see the license at: 9 | // 10 | // https://www.fltk.org/COPYING.php 11 | // 12 | // Please see the following page on how to report bugs and issues: 13 | // 14 | // https://www.fltk.org/bugs.php 15 | // 16 | 17 | /* \file 18 | Fl_Hor_Slider widget . */ 19 | 20 | #ifndef Fl_Hor_Slider_H 21 | #define Fl_Hor_Slider_H 22 | 23 | #include "Fl_Slider.H" 24 | 25 | /** Horizontal Slider class. 26 | 27 | \see class Fl_Slider. 28 | */ 29 | class FL_EXPORT Fl_Hor_Slider : public Fl_Slider { 30 | public: 31 | 32 | /** 33 | Creates a new Fl_Hor_Slider widget using the given position, 34 | size, and label string. 35 | */ 36 | Fl_Hor_Slider(int X,int Y,int W,int H,const char *l=0); 37 | }; 38 | 39 | #endif 40 | -------------------------------------------------------------------------------- /server/fltk/FL/Fl_Hor_Value_Slider.H: -------------------------------------------------------------------------------- 1 | // 2 | // Horizontal value slider header file for the Fast Light Tool Kit (FLTK). 3 | // 4 | // Copyright 1998-2010 by Bill Spitzak and others. 5 | // 6 | // This library is free software. Distribution and use rights are outlined in 7 | // the file "COPYING" which should have been included with this file. If this 8 | // file is missing or damaged, see the license at: 9 | // 10 | // https://www.fltk.org/COPYING.php 11 | // 12 | // Please see the following page on how to report bugs and issues: 13 | // 14 | // https://www.fltk.org/bugs.php 15 | // 16 | 17 | /* \file 18 | Fl_Hor_Value_Slider widget . */ 19 | 20 | #ifndef Fl_Hor_Value_Slider_H 21 | #define Fl_Hor_Value_Slider_H 22 | 23 | #include "Fl_Value_Slider.H" 24 | 25 | class FL_EXPORT Fl_Hor_Value_Slider : public Fl_Value_Slider { 26 | public: 27 | Fl_Hor_Value_Slider(int X,int Y,int W,int H,const char *l=0); 28 | }; 29 | 30 | #endif 31 | -------------------------------------------------------------------------------- /server/fltk/FL/Fl_Int_Input.H: -------------------------------------------------------------------------------- 1 | // 2 | // Integer input header file for the Fast Light Tool Kit (FLTK). 3 | // 4 | // Copyright 1998-2010 by Bill Spitzak and others. 5 | // 6 | // This library is free software. Distribution and use rights are outlined in 7 | // the file "COPYING" which should have been included with this file. If this 8 | // file is missing or damaged, see the license at: 9 | // 10 | // https://www.fltk.org/COPYING.php 11 | // 12 | // Please see the following page on how to report bugs and issues: 13 | // 14 | // https://www.fltk.org/bugs.php 15 | // 16 | 17 | /* \file 18 | Fl_Int_Input widget . */ 19 | 20 | #ifndef Fl_Int_Input_H 21 | #define Fl_Int_Input_H 22 | 23 | #include "Fl_Input.H" 24 | 25 | /** 26 | The Fl_Int_Input class is a subclass of Fl_Input that only allows 27 | the user to type decimal digits (or hex numbers of the form 0xaef). 28 | */ 29 | class FL_EXPORT Fl_Int_Input : public Fl_Input { 30 | public: 31 | /** 32 | Creates a new Fl_Int_Input widget using the given position, 33 | size, and label string. The default boxtype is FL_DOWN_BOX. 34 | 35 | Inherited destructor destroys the widget and any value associated with it. 36 | */ 37 | Fl_Int_Input(int X,int Y,int W,int H,const char *l = 0); 38 | }; 39 | 40 | #endif 41 | -------------------------------------------------------------------------------- /server/fltk/FL/Fl_Light_Button.H: -------------------------------------------------------------------------------- 1 | // 2 | // Lighted button header file for the Fast Light Tool Kit (FLTK). 3 | // 4 | // Copyright 1998-2022 by Bill Spitzak and others. 5 | // 6 | // This library is free software. Distribution and use rights are outlined in 7 | // the file "COPYING" which should have been included with this file. If this 8 | // file is missing or damaged, see the license at: 9 | // 10 | // https://www.fltk.org/COPYING.php 11 | // 12 | // Please see the following page on how to report bugs and issues: 13 | // 14 | // https://www.fltk.org/bugs.php 15 | // 16 | 17 | /* \file 18 | Fl_Light_Button widget . */ 19 | 20 | #ifndef Fl_Light_Button_H 21 | #define Fl_Light_Button_H 22 | 23 | #include "Fl_Button.H" 24 | 25 | /** 26 | This subclass displays the "on" state by turning on a light, 27 | rather than drawing pushed in. The shape of the "light" 28 | is initially set to FL_DOWN_BOX. The color of the light when 29 | on is controlled with selection_color(), which defaults to FL_YELLOW. 30 | 31 | Buttons generate callbacks when they are clicked by the user. You 32 | control exactly when and how by changing the values for type() and when(). 33 | \image html Fl_Light_Button.png 34 | \image latex Fl_Light_Button.png "Fl_Light_Button" width=4cm 35 | */ 36 | class FL_EXPORT Fl_Light_Button : public Fl_Button { 37 | protected: 38 | void draw() FL_OVERRIDE; 39 | public: 40 | int handle(int) FL_OVERRIDE; 41 | Fl_Light_Button(int x,int y,int w,int h,const char *l = 0); 42 | }; 43 | 44 | #endif 45 | -------------------------------------------------------------------------------- /server/fltk/FL/Fl_Line_Dial.H: -------------------------------------------------------------------------------- 1 | // 2 | // Line dial header file for the Fast Light Tool Kit (FLTK). 3 | // 4 | // Copyright 1998-2010 by Bill Spitzak and others. 5 | // 6 | // This library is free software. Distribution and use rights are outlined in 7 | // the file "COPYING" which should have been included with this file. If this 8 | // file is missing or damaged, see the license at: 9 | // 10 | // https://www.fltk.org/COPYING.php 11 | // 12 | // Please see the following page on how to report bugs and issues: 13 | // 14 | // https://www.fltk.org/bugs.php 15 | // 16 | 17 | /* \file 18 | Fl_Line_Dial widget . */ 19 | 20 | #ifndef Fl_Line_Dial_H 21 | #define Fl_Line_Dial_H 22 | 23 | #include "Fl_Dial.H" 24 | 25 | class FL_EXPORT Fl_Line_Dial : public Fl_Dial { 26 | public: 27 | Fl_Line_Dial(int X,int Y,int W,int H, const char *L = 0); 28 | }; 29 | 30 | #endif 31 | -------------------------------------------------------------------------------- /server/fltk/FL/Fl_Menu_Window.H: -------------------------------------------------------------------------------- 1 | // 2 | // Menu window header file for the Fast Light Tool Kit (FLTK). 3 | // 4 | // Copyright 1998-2010 by Bill Spitzak and others. 5 | // 6 | // This library is free software. Distribution and use rights are outlined in 7 | // the file "COPYING" which should have been included with this file. If this 8 | // file is missing or damaged, see the license at: 9 | // 10 | // https://www.fltk.org/COPYING.php 11 | // 12 | // Please see the following page on how to report bugs and issues: 13 | // 14 | // https://www.fltk.org/bugs.php 15 | // 16 | 17 | /* \file 18 | Fl_Menu_Window widget . */ 19 | 20 | #ifndef Fl_Menu_Window_H 21 | #define Fl_Menu_Window_H 22 | 23 | #include "Fl_Single_Window.H" 24 | 25 | /** 26 | The Fl_Menu_Window widget is a window type used for menus. By 27 | default the window is drawn in the hardware overlay planes if they are 28 | available so that the menu don't force the rest of the window to 29 | redraw. 30 | */ 31 | class FL_EXPORT Fl_Menu_Window : public Fl_Single_Window { 32 | public: 33 | ~Fl_Menu_Window(); 34 | /** Creates a new Fl_Menu_Window widget using the given size, and label string. */ 35 | Fl_Menu_Window(int W, int H, const char *l = 0); 36 | /** Creates a new Fl_Menu_Window widget using the given position, size, and label string. */ 37 | Fl_Menu_Window(int X, int Y, int W, int H, const char *l = 0); 38 | }; 39 | 40 | #endif 41 | -------------------------------------------------------------------------------- /server/fltk/FL/Fl_Multi_Browser.H: -------------------------------------------------------------------------------- 1 | // 2 | // Multi browser header file for the Fast Light Tool Kit (FLTK). 3 | // 4 | // Copyright 1998-2010 by Bill Spitzak and others. 5 | // 6 | // This library is free software. Distribution and use rights are outlined in 7 | // the file "COPYING" which should have been included with this file. If this 8 | // file is missing or damaged, see the license at: 9 | // 10 | // https://www.fltk.org/COPYING.php 11 | // 12 | // Please see the following page on how to report bugs and issues: 13 | // 14 | // https://www.fltk.org/bugs.php 15 | // 16 | 17 | /* \file 18 | Fl_Multi_Browser widget . */ 19 | 20 | #ifndef Fl_Multi_Browser_H 21 | #define Fl_Multi_Browser_H 22 | 23 | #include "Fl_Browser.H" 24 | 25 | /** 26 | The Fl_Multi_Browser class is a subclass of Fl_Browser 27 | which lets the user select any set of the lines. 28 | 29 | \image html fl_multi_browser.png "Fl_Multi_Browser" 30 | \image latex fl_multi_browser.png "Fl_Multi_Browser" width=4cm 31 | 32 | The user interface is Macintosh style: clicking an item turns off all the others and 33 | selects that one, dragging selects all the items the mouse moves over, 34 | and ctrl + click (Cmd+click on the Mac OS platform) toggles the items. 35 | Shift + click extends the selection until the clicked item. 36 | This is different from how forms did it. 37 | Normally the callback is done when the user releases the 38 | mouse, but you can change this with when(). 39 |

See Fl_Browser for methods to add and remove lines from the browser. 40 | */ 41 | class FL_EXPORT Fl_Multi_Browser : public Fl_Browser { 42 | public: 43 | /** 44 | Creates a new Fl_Multi_Browser widget using the given 45 | position, size, and label string. The default boxtype is FL_DOWN_BOX. 46 | The constructor specializes Fl_Browser() by setting the type to FL_MULTI_BROWSER. 47 | The destructor destroys the widget and frees all memory that has been allocated. 48 | */ 49 | Fl_Multi_Browser(int X,int Y,int W,int H,const char *L=0); 50 | }; 51 | 52 | #endif 53 | -------------------------------------------------------------------------------- /server/fltk/FL/Fl_Multiline_Input.H: -------------------------------------------------------------------------------- 1 | // 2 | // Multiline input header file for the Fast Light Tool Kit (FLTK). 3 | // 4 | // Copyright 1998-2011 by Bill Spitzak and others. 5 | // 6 | // This library is free software. Distribution and use rights are outlined in 7 | // the file "COPYING" which should have been included with this file. If this 8 | // file is missing or damaged, see the license at: 9 | // 10 | // https://www.fltk.org/COPYING.php 11 | // 12 | // Please see the following page on how to report bugs and issues: 13 | // 14 | // https://www.fltk.org/bugs.php 15 | // 16 | 17 | /* \file 18 | Fl_Multiline_Input widget . */ 19 | 20 | #ifndef Fl_Multiline_Input_H 21 | #define Fl_Multiline_Input_H 22 | 23 | #include "Fl_Input.H" 24 | 25 | /** 26 | This input field displays '\\n' characters as new lines rather than ^J, 27 | and accepts the Return, Tab, and up and down arrow keys. This is for 28 | editing multiline text. 29 | 30 | This is far from the nirvana of text editors, and is probably only 31 | good for small bits of text, 10 lines at most. Note that this widget 32 | does not support scrollbars or per-character color control. 33 | 34 | If you are presenting large amounts of text and need scrollbars 35 | or full color control of characters, you probably want Fl_Text_Editor 36 | instead. 37 | 38 | In FLTK 1.3.x, the default behavior of the 'Tab' key was changed 39 | to support consistent focus navigation. To get the older FLTK 1.1.x 40 | behavior, set Fl_Input_::tab_nav() to 0. Newer programs should consider using 41 | Fl_Text_Editor. 42 | */ 43 | class FL_EXPORT Fl_Multiline_Input : public Fl_Input { 44 | public: 45 | /** 46 | Creates a new Fl_Multiline_Input widget using the given 47 | position, size, and label string. The default boxtype is FL_DOWN_BOX. 48 | 49 | Inherited destructor destroys the widget and any value associated with it. 50 | */ 51 | Fl_Multiline_Input(int X,int Y,int W,int H,const char *l = 0); 52 | }; 53 | 54 | #endif 55 | -------------------------------------------------------------------------------- /server/fltk/FL/Fl_Multiline_Output.H: -------------------------------------------------------------------------------- 1 | // 2 | // Multi line output header file for the Fast Light Tool Kit (FLTK). 3 | // 4 | // Copyright 1998-2011 by Bill Spitzak and others. 5 | // 6 | // This library is free software. Distribution and use rights are outlined in 7 | // the file "COPYING" which should have been included with this file. If this 8 | // file is missing or damaged, see the license at: 9 | // 10 | // https://www.fltk.org/COPYING.php 11 | // 12 | // Please see the following page on how to report bugs and issues: 13 | // 14 | // https://www.fltk.org/bugs.php 15 | // 16 | 17 | /* \file 18 | Fl_Multiline_Output widget . */ 19 | 20 | #ifndef Fl_Multiline_Output_H 21 | #define Fl_Multiline_Output_H 22 | 23 | #include "Fl_Output.H" 24 | 25 | /** 26 | This widget is a subclass of Fl_Output that displays multiple 27 | lines of text. It also displays tab characters as whitespace to the 28 | next column. 29 | 30 | Note that this widget does not support scrollbars, or per-character 31 | color control. 32 | 33 | If you are presenting large amounts of read-only text 34 | and need scrollbars, or full color control of characters, 35 | then use Fl_Text_Display. If you want to display HTML text, 36 | use Fl_Help_View. 37 | 38 | A caret cursor (^) shows the keyboard navigation mark 39 | for keyboard selection of the output text, e.g. Arrow Keys 40 | to move the cursor, Shift + Arrow Keys to create a text 41 | selection, and '^C' to copy the selected text to the paste buffer. 42 | The caret cursor can be disabled by disabling the widget's 43 | "visible focus" using clear_visible_focus(), inherited from the 44 | Fl_Widget base class. Doing this also disables the widget's 45 | keyboard navigation. 46 | */ 47 | class FL_EXPORT Fl_Multiline_Output : public Fl_Output { 48 | public: 49 | 50 | /** 51 | Creates a new Fl_Multiline_Output widget using the given position, 52 | size, and label string. The default boxtype is FL_DOWN_BOX. 53 | 54 | Inherited destructor destroys the widget and any value associated with it. 55 | */ 56 | Fl_Multiline_Output(int X,int Y,int W,int H,const char *l = 0); 57 | }; 58 | 59 | #endif 60 | -------------------------------------------------------------------------------- /server/fltk/FL/Fl_Nice_Slider.H: -------------------------------------------------------------------------------- 1 | // 2 | // "Nice" slider header file for the Fast Light Tool Kit (FLTK). 3 | // 4 | // Copyright 1998-2010 by Bill Spitzak and others. 5 | // 6 | // This library is free software. Distribution and use rights are outlined in 7 | // the file "COPYING" which should have been included with this file. If this 8 | // file is missing or damaged, see the license at: 9 | // 10 | // https://www.fltk.org/COPYING.php 11 | // 12 | // Please see the following page on how to report bugs and issues: 13 | // 14 | // https://www.fltk.org/bugs.php 15 | // 16 | 17 | /* \file 18 | Fl_Nice_Slider widget . */ 19 | 20 | #ifndef Fl_Nice_Slider_H 21 | #define Fl_Nice_Slider_H 22 | 23 | #include "Fl_Slider.H" 24 | 25 | class FL_EXPORT Fl_Nice_Slider : public Fl_Slider { 26 | public: 27 | Fl_Nice_Slider(int X,int Y,int W,int H,const char *L=0); 28 | }; 29 | 30 | #endif 31 | -------------------------------------------------------------------------------- /server/fltk/FL/Fl_Output.H: -------------------------------------------------------------------------------- 1 | // 2 | // Output header file for the Fast Light Tool Kit (FLTK). 3 | // 4 | // Copyright 1998-2022 by Bill Spitzak and others. 5 | // 6 | // This library is free software. Distribution and use rights are outlined in 7 | // the file "COPYING" which should have been included with this file. If this 8 | // file is missing or damaged, see the license at: 9 | // 10 | // https://www.fltk.org/COPYING.php 11 | // 12 | // Please see the following page on how to report bugs and issues: 13 | // 14 | // https://www.fltk.org/bugs.php 15 | // 16 | 17 | /* \file 18 | Fl_Output widget . */ 19 | 20 | #ifndef Fl_Output_H 21 | #define Fl_Output_H 22 | 23 | #include "Fl_Input.H" 24 | /** 25 | This widget displays a piece of text. 26 | 27 | When you set the value() , Fl_Output does a strcpy() to its own storage, 28 | which is useful for program-generated values. The user may select 29 | portions of the text using the mouse and paste the contents into other 30 | fields or programs. 31 | 32 | \image html text.png 33 | \image latex text.png "Fl_Output" width=8cm 34 | 35 | There is a single subclass, Fl_Multiline_Output, which allows you to 36 | display multiple lines of text. Fl_Multiline_Output does not provide 37 | scroll bars. If a more complete text editing widget is needed, use 38 | Fl_Text_Display instead. 39 | 40 | The text may contain any characters except \\0, and will correctly 41 | display anything, using ^X notation for unprintable control characters 42 | and \\nnn notation for unprintable characters with the high bit set. It 43 | assumes the font can draw any characters in the ISO-Latin1 character set. 44 | */ 45 | class FL_EXPORT Fl_Output : public Fl_Input { 46 | public: 47 | /** 48 | Creates a new Fl_Output widget using the given position, 49 | size, and label string. The default boxtype is FL_DOWN_BOX. 50 | 51 | Inherited destructor destroys the widget and any value associated with it. 52 | */ 53 | 54 | Fl_Output(int X,int Y,int W,int H, const char *l = 0); 55 | }; 56 | 57 | #endif 58 | -------------------------------------------------------------------------------- /server/fltk/FL/Fl_Progress.H: -------------------------------------------------------------------------------- 1 | // 2 | // Progress bar widget definitions. 3 | // 4 | // Copyright 2000-2010 by Michael Sweet. 5 | // 6 | // This library is free software. Distribution and use rights are outlined in 7 | // the file "COPYING" which should have been included with this file. If this 8 | // file is missing or damaged, see the license at: 9 | // 10 | // https://www.fltk.org/COPYING.php 11 | // 12 | // Please see the following page on how to report bugs and issues: 13 | // 14 | // https://www.fltk.org/bugs.php 15 | // 16 | 17 | /* \file 18 | Fl_Progress widget . */ 19 | 20 | #ifndef _Fl_Progress_H_ 21 | # define _Fl_Progress_H_ 22 | 23 | // 24 | // Include necessary headers. 25 | // 26 | 27 | #include "Fl_Widget.H" 28 | 29 | 30 | // 31 | // Progress class... 32 | // 33 | /** 34 | Displays a progress bar for the user. 35 | */ 36 | class FL_EXPORT Fl_Progress : public Fl_Widget { 37 | 38 | float value_, 39 | minimum_, 40 | maximum_; 41 | 42 | protected: 43 | 44 | void draw() FL_OVERRIDE; 45 | 46 | public: 47 | 48 | Fl_Progress(int x, int y, int w, int h, const char *l = 0); 49 | 50 | /** Sets the maximum value in the progress widget. */ 51 | void maximum(float v) { maximum_ = v; redraw(); } 52 | /** Gets the maximum value in the progress widget. */ 53 | float maximum() const { return (maximum_); } 54 | 55 | /** Sets the minimum value in the progress widget. */ 56 | void minimum(float v) { minimum_ = v; redraw(); } 57 | /** Gets the minimum value in the progress widget. */ 58 | float minimum() const { return (minimum_); } 59 | 60 | /** Sets the current value in the progress widget. */ 61 | void value(float v) { value_ = v; redraw(); } 62 | /** Gets the current value in the progress widget. */ 63 | float value() const { return (value_); } 64 | }; 65 | 66 | #endif // !_Fl_Progress_H_ 67 | -------------------------------------------------------------------------------- /server/fltk/FL/Fl_RGB_Image.H: -------------------------------------------------------------------------------- 1 | // 2 | // RGB Image header file for the Fast Light Tool Kit (FLTK). 3 | // 4 | // Copyright 1998-2010 by Bill Spitzak and others. 5 | // 6 | // This library is free software. Distribution and use rights are outlined in 7 | // the file "COPYING" which should have been included with this file. If this 8 | // file is missing or damaged, see the license at: 9 | // 10 | // https://www.fltk.org/COPYING.php 11 | // 12 | // Please see the following page on how to report bugs and issues: 13 | // 14 | // https://www.fltk.org/bugs.php 15 | // 16 | 17 | #ifndef Fl_RGB_Image_H 18 | # define Fl_RGB_Image_H 19 | # include "Fl_Image.H" 20 | #endif // !Fl_RGB_Image_H 21 | -------------------------------------------------------------------------------- /server/fltk/FL/Fl_Radio_Button.H: -------------------------------------------------------------------------------- 1 | // 2 | // Radio button header file for the Fast Light Tool Kit (FLTK). 3 | // 4 | // Copyright 1998-2014 by Bill Spitzak and others. 5 | // 6 | // This library is free software. Distribution and use rights are outlined in 7 | // the file "COPYING" which should have been included with this file. If this 8 | // file is missing or damaged, see the license at: 9 | // 10 | // https://www.fltk.org/COPYING.php 11 | // 12 | // Please see the following page on how to report bugs and issues: 13 | // 14 | // https://www.fltk.org/bugs.php 15 | // 16 | 17 | /* \file 18 | Fl_Radio_Button widget . */ 19 | 20 | #ifndef Fl_Radio_Button_H 21 | #define Fl_Radio_Button_H 22 | 23 | #include "Fl_Button.H" 24 | 25 | class FL_EXPORT Fl_Radio_Button : public Fl_Button { 26 | public: 27 | Fl_Radio_Button(int X,int Y,int W,int H,const char *L=0); 28 | }; 29 | 30 | #endif 31 | -------------------------------------------------------------------------------- /server/fltk/FL/Fl_Radio_Light_Button.H: -------------------------------------------------------------------------------- 1 | // 2 | // Radio light button header file for the Fast Light Tool Kit (FLTK). 3 | // 4 | // Copyright 1998-2014 by Bill Spitzak and others. 5 | // 6 | // This library is free software. Distribution and use rights are outlined in 7 | // the file "COPYING" which should have been included with this file. If this 8 | // file is missing or damaged, see the license at: 9 | // 10 | // https://www.fltk.org/COPYING.php 11 | // 12 | // Please see the following page on how to report bugs and issues: 13 | // 14 | // https://www.fltk.org/bugs.php 15 | // 16 | 17 | /* \file 18 | Fl_Radio_Light_Button widget . */ 19 | 20 | #ifndef Fl_Radio_Light_Button_H 21 | #define Fl_Radio_Light_Button_H 22 | 23 | #include "Fl_Light_Button.H" 24 | 25 | class FL_EXPORT Fl_Radio_Light_Button : public Fl_Light_Button { 26 | public: 27 | Fl_Radio_Light_Button(int X,int Y,int W,int H,const char *l=0); 28 | }; 29 | 30 | #endif 31 | -------------------------------------------------------------------------------- /server/fltk/FL/Fl_Radio_Round_Button.H: -------------------------------------------------------------------------------- 1 | // 2 | // Radio round button header file for the Fast Light Tool Kit (FLTK). 3 | // 4 | // Copyright 1998-2014 by Bill Spitzak and others. 5 | // 6 | // This library is free software. Distribution and use rights are outlined in 7 | // the file "COPYING" which should have been included with this file. If this 8 | // file is missing or damaged, see the license at: 9 | // 10 | // https://www.fltk.org/COPYING.php 11 | // 12 | // Please see the following page on how to report bugs and issues: 13 | // 14 | // https://www.fltk.org/bugs.php 15 | // 16 | 17 | /* \file 18 | Fl_Radio_Round_Button widget . */ 19 | 20 | #ifndef Fl_Radio_Round_Button_H 21 | #define Fl_Radio_Round_Button_H 22 | 23 | #include "Fl_Round_Button.H" 24 | 25 | class FL_EXPORT Fl_Radio_Round_Button : public Fl_Round_Button { 26 | public: 27 | Fl_Radio_Round_Button(int X,int Y,int W,int H,const char *L=0); 28 | }; 29 | 30 | #endif 31 | -------------------------------------------------------------------------------- /server/fltk/FL/Fl_Repeat_Button.H: -------------------------------------------------------------------------------- 1 | // 2 | // Repeat button header file for the Fast Light Tool Kit (FLTK). 3 | // 4 | // Copyright 1998-2010 by Bill Spitzak and others. 5 | // 6 | // This library is free software. Distribution and use rights are outlined in 7 | // the file "COPYING" which should have been included with this file. If this 8 | // file is missing or damaged, see the license at: 9 | // 10 | // https://www.fltk.org/COPYING.php 11 | // 12 | // Please see the following page on how to report bugs and issues: 13 | // 14 | // https://www.fltk.org/bugs.php 15 | // 16 | 17 | /* \file 18 | Fl_Repeat_Button widget . */ 19 | 20 | #ifndef Fl_Repeat_Button_H 21 | #define Fl_Repeat_Button_H 22 | #include "Fl.H" 23 | #include "Fl_Button.H" 24 | 25 | /** 26 | The Fl_Repeat_Button is a subclass of Fl_Button that 27 | generates a callback when it is pressed and then repeatedly generates 28 | callbacks as long as it is held down. The speed of the repeat is fixed 29 | and depends on the implementation. 30 | */ 31 | class FL_EXPORT Fl_Repeat_Button : public Fl_Button { 32 | static void repeat_callback(void *); 33 | public: 34 | int handle(int) FL_OVERRIDE; 35 | /** 36 | Creates a new Fl_Repeat_Button widget using the given 37 | position, size, and label string. The default boxtype is FL_UP_BOX. 38 | Deletes the button. 39 | */ 40 | Fl_Repeat_Button(int X,int Y,int W,int H,const char *l=0); 41 | 42 | void deactivate() { 43 | Fl::remove_timeout(repeat_callback,this); 44 | Fl_Button::deactivate(); 45 | } 46 | }; 47 | 48 | #endif 49 | -------------------------------------------------------------------------------- /server/fltk/FL/Fl_Return_Button.H: -------------------------------------------------------------------------------- 1 | // 2 | // Return button header file for the Fast Light Tool Kit (FLTK). 3 | // 4 | // Copyright 1998-2022 by Bill Spitzak and others. 5 | // 6 | // This library is free software. Distribution and use rights are outlined in 7 | // the file "COPYING" which should have been included with this file. If this 8 | // file is missing or damaged, see the license at: 9 | // 10 | // https://www.fltk.org/COPYING.php 11 | // 12 | // Please see the following page on how to report bugs and issues: 13 | // 14 | // https://www.fltk.org/bugs.php 15 | // 16 | 17 | /* \file 18 | Fl_Return_Button widget . */ 19 | 20 | #ifndef Fl_Return_Button_H 21 | #define Fl_Return_Button_H 22 | #include "Fl_Button.H" 23 | 24 | /** 25 | The Fl_Return_Button is a subclass of Fl_Button that 26 | generates a callback when it is pressed or when the user presses the 27 | Enter key. A carriage-return symbol is drawn next to the button label. 28 | \image html Fl_Return_Button.png 29 | \image latex Fl_Return_Button.png "Fl_Return_Button" width=4cm 30 | */ 31 | class FL_EXPORT Fl_Return_Button : public Fl_Button { 32 | protected: 33 | void draw() FL_OVERRIDE; 34 | public: 35 | int handle(int) FL_OVERRIDE; 36 | /** 37 | Creates a new Fl_Return_Button widget using the given 38 | position, size, and label string. The default boxtype is FL_UP_BOX. 39 |

The inherited destructor deletes the button. 40 | */ 41 | Fl_Return_Button(int X, int Y, int W, int H,const char *l=0); 42 | }; 43 | 44 | #endif 45 | -------------------------------------------------------------------------------- /server/fltk/FL/Fl_Roller.H: -------------------------------------------------------------------------------- 1 | // 2 | // Roller header file for the Fast Light Tool Kit (FLTK). 3 | // 4 | // Copyright 1998-2023 by Bill Spitzak and others. 5 | // 6 | // This library is free software. Distribution and use rights are outlined in 7 | // the file "COPYING" which should have been included with this file. If this 8 | // file is missing or damaged, see the license at: 9 | // 10 | // https://www.fltk.org/COPYING.php 11 | // 12 | // Please see the following page on how to report bugs and issues: 13 | // 14 | // https://www.fltk.org/bugs.php 15 | // 16 | 17 | /* \file 18 | Fl_Roller widget . */ 19 | 20 | #ifndef Fl_Roller_H 21 | #define Fl_Roller_H 22 | 23 | #ifndef Fl_Valuator_H 24 | #include "Fl_Valuator.H" 25 | #endif 26 | 27 | /** 28 | The Fl_Roller widget is a "dolly" control commonly used to 29 | move 3D objects. 30 | 31 | The roller can be controlled by clicking and dragging the mouse, by the 32 | corresponding arrow keys when the roller has the keyboard focus, or by the 33 | mouse wheels when the mouse pointer is positioned over the roller widget. 34 | 35 | \image html Fl_Roller.png 36 | \image latex Fl_Roller.png "Fl_Roller" width=4cm 37 | */ 38 | class FL_EXPORT Fl_Roller : public Fl_Valuator { 39 | protected: 40 | void draw() FL_OVERRIDE; 41 | public: 42 | int handle(int) FL_OVERRIDE; 43 | Fl_Roller(int X,int Y,int W,int H,const char* L=0); 44 | }; 45 | 46 | #endif 47 | -------------------------------------------------------------------------------- /server/fltk/FL/Fl_Round_Button.H: -------------------------------------------------------------------------------- 1 | // 2 | // Round button header file for the Fast Light Tool Kit (FLTK). 3 | // 4 | // Copyright 1998-2022 by Bill Spitzak and others. 5 | // 6 | // This library is free software. Distribution and use rights are outlined in 7 | // the file "COPYING" which should have been included with this file. If this 8 | // file is missing or damaged, see the license at: 9 | // 10 | // https://www.fltk.org/COPYING.php 11 | // 12 | // Please see the following page on how to report bugs and issues: 13 | // 14 | // https://www.fltk.org/bugs.php 15 | // 16 | 17 | #ifndef Fl_Round_Button_H 18 | #define Fl_Round_Button_H 19 | 20 | #include "Fl_Light_Button.H" 21 | 22 | /** 23 | Buttons generate callbacks when they are clicked by the user. You 24 | control exactly when and how by changing the values for type() 25 | and when(). 26 | \image html Fl_Round_Button.png 27 | \image latex Fl_Round_Button.png "Fl_Round_Button" width=4cm 28 | The Fl_Round_Button subclass displays the "on" state by 29 | turning on a light, rather than drawing pushed in. The shape of the 30 | "light" is initially set to FL_ROUND_DOWN_BOX. The color of the light 31 | when on is controlled with selection_color(), which defaults to 32 | FL_FOREGROUND_COLOR. 33 | */ 34 | class FL_EXPORT Fl_Round_Button : public Fl_Light_Button { 35 | public: 36 | Fl_Round_Button(int x,int y,int w,int h,const char *l = 0); 37 | }; 38 | 39 | #endif 40 | -------------------------------------------------------------------------------- /server/fltk/FL/Fl_Round_Clock.H: -------------------------------------------------------------------------------- 1 | // 2 | // Round clock header file for the Fast Light Tool Kit (FLTK). 3 | // 4 | // Copyright 1998-2010 by Bill Spitzak and others. 5 | // 6 | // This library is free software. Distribution and use rights are outlined in 7 | // the file "COPYING" which should have been included with this file. If this 8 | // file is missing or damaged, see the license at: 9 | // 10 | // https://www.fltk.org/COPYING.php 11 | // 12 | // Please see the following page on how to report bugs and issues: 13 | // 14 | // https://www.fltk.org/bugs.php 15 | // 16 | 17 | /* \file 18 | Fl_Round_Clock widget . */ 19 | 20 | #ifndef Fl_Round_Clock_H 21 | #define Fl_Round_Clock_H 22 | 23 | #include "Fl_Clock.H" 24 | 25 | /** A clock widget of type FL_ROUND_CLOCK. Has no box. */ 26 | class FL_EXPORT Fl_Round_Clock : public Fl_Clock { 27 | public: 28 | /** Creates the clock widget, setting his type and box. */ 29 | Fl_Round_Clock(int X,int Y,int W,int H, const char *L = 0); 30 | }; 31 | 32 | #endif 33 | -------------------------------------------------------------------------------- /server/fltk/FL/Fl_Secret_Input.H: -------------------------------------------------------------------------------- 1 | // 2 | // Secret input header file for the Fast Light Tool Kit (FLTK). 3 | // 4 | // Copyright 1998-2011 by Bill Spitzak and others. 5 | // 6 | // This library is free software. Distribution and use rights are outlined in 7 | // the file "COPYING" which should have been included with this file. If this 8 | // file is missing or damaged, see the license at: 9 | // 10 | // https://www.fltk.org/COPYING.php 11 | // 12 | // Please see the following page on how to report bugs and issues: 13 | // 14 | // https://www.fltk.org/bugs.php 15 | // 16 | 17 | /* \file 18 | Fl_Secret_Input widget . */ 19 | 20 | #ifndef Fl_Secret_Input_H 21 | #define Fl_Secret_Input_H 22 | 23 | #include "Fl_Input.H" 24 | 25 | /** 26 | The Fl_Secret_Input class is a subclass of Fl_Input that displays its 27 | input as a string of placeholders. Depending on the platform this 28 | placeholder is either the asterisk ('*') or the Unicode bullet 29 | character (U+2022). 30 | 31 | This subclass is usually used to receive passwords and other "secret" information. 32 | */ 33 | class FL_EXPORT Fl_Secret_Input : public Fl_Input { 34 | public: 35 | /** 36 | Creates a new Fl_Secret_Input widget using the given 37 | position, size, and label string. The default boxtype is FL_DOWN_BOX. 38 | 39 | Inherited destructor destroys the widget and any value associated with it. 40 | */ 41 | Fl_Secret_Input(int X,int Y,int W,int H,const char *l = 0); 42 | int handle(int) FL_OVERRIDE; 43 | }; 44 | 45 | #endif 46 | -------------------------------------------------------------------------------- /server/fltk/FL/Fl_Select_Browser.H: -------------------------------------------------------------------------------- 1 | // 2 | // Select browser header file for the Fast Light Tool Kit (FLTK). 3 | // 4 | // Copyright 1998-2010 by Bill Spitzak and others. 5 | // 6 | // This library is free software. Distribution and use rights are outlined in 7 | // the file "COPYING" which should have been included with this file. If this 8 | // file is missing or damaged, see the license at: 9 | // 10 | // https://www.fltk.org/COPYING.php 11 | // 12 | // Please see the following page on how to report bugs and issues: 13 | // 14 | // https://www.fltk.org/bugs.php 15 | // 16 | 17 | /* \file 18 | Fl_Select_Browser widget . */ 19 | 20 | #ifndef Fl_Select_Browser_H 21 | #define Fl_Select_Browser_H 22 | 23 | #include "Fl_Browser.H" 24 | 25 | /** 26 | The class is a subclass of Fl_Browser 27 | which lets the user select a single item, or no items by clicking on 28 | the empty space. As long as the mouse button is held down on an 29 | unselected item it is highlighted. Normally the callback is done when the 30 | user presses the mouse, but you can change this with when(). 31 |

See Fl_Browser for methods to add and remove lines from the browser. 32 | */ 33 | class FL_EXPORT Fl_Select_Browser : public Fl_Browser { 34 | public: 35 | /** 36 | Creates a new Fl_Select_Browser widget using the given 37 | position, size, and label string. The default boxtype is FL_DOWN_BOX. 38 | The constructor specializes Fl_Browser() by setting the type to FL_SELECT_BROWSER. 39 | The destructor destroys the widget and frees all memory that has been allocated. 40 | */ 41 | Fl_Select_Browser(int X,int Y,int W,int H,const char *L=0); 42 | }; 43 | 44 | #endif 45 | -------------------------------------------------------------------------------- /server/fltk/FL/Fl_Simple_Counter.H: -------------------------------------------------------------------------------- 1 | // 2 | // Simple counter header file for the Fast Light Tool Kit (FLTK). 3 | // 4 | // Copyright 1998-2022 by Bill Spitzak and others. 5 | // 6 | // This library is free software. Distribution and use rights are outlined in 7 | // the file "COPYING" which should have been included with this file. If this 8 | // file is missing or damaged, see the license at: 9 | // 10 | // https://www.fltk.org/COPYING.php 11 | // 12 | // Please see the following page on how to report bugs and issues: 13 | // 14 | // https://www.fltk.org/bugs.php 15 | // 16 | 17 | /* \file 18 | Fl_Simple_Counter widget . */ 19 | 20 | #ifndef Fl_Simple_Counter_H 21 | #define Fl_Simple_Counter_H 22 | 23 | #include "Fl_Counter.H" 24 | /** 25 | This widget creates a counter with only 2 arrow buttons 26 | \image html counter.png 27 | \image latex counter.png "Fl_Simple_Counter" width=4cm 28 | */ 29 | class FL_EXPORT Fl_Simple_Counter : public Fl_Counter { 30 | public: 31 | Fl_Simple_Counter(int X,int Y,int W,int H, const char *L = 0); 32 | }; 33 | 34 | #endif 35 | -------------------------------------------------------------------------------- /server/fltk/FL/Fl_Single_Window.H: -------------------------------------------------------------------------------- 1 | // 2 | // Single-buffered window header file for the Fast Light Tool Kit (FLTK). 3 | // 4 | // Copyright 1998-2024 by Bill Spitzak and others. 5 | // 6 | // This library is free software. Distribution and use rights are outlined in 7 | // the file "COPYING" which should have been included with this file. If this 8 | // file is missing or damaged, see the license at: 9 | // 10 | // https://www.fltk.org/COPYING.php 11 | // 12 | // Please see the following page on how to report bugs and issues: 13 | // 14 | // https://www.fltk.org/bugs.php 15 | // 16 | 17 | /* \file 18 | Fl_Single_Window class . */ 19 | 20 | #ifndef Fl_Single_Window_H 21 | #define Fl_Single_Window_H 22 | 23 | #include "Fl_Window.H" 24 | 25 | /** 26 | This is the same as Fl_Window. However, it is possible that 27 | some implementations will provide double-buffered windows by default. 28 | This subclass can be used to force single-buffering. This may be 29 | useful for modifying existing programs that use incremental update, or 30 | for some types of image data, such as a movie flipbook. 31 | */ 32 | class FL_EXPORT Fl_Single_Window : public Fl_Window { 33 | public: 34 | void show() FL_OVERRIDE; 35 | /** Same as Fl_Window::show(int argc, char **argv) */ 36 | void show(int argc, char **argv) { Fl_Window::show(argc, argv);} 37 | 38 | /** 39 | Creates a new Fl_Single_Window widget using the given 40 | size, and label (title) string. 41 | */ 42 | Fl_Single_Window(int W, int H, const char *l=0); 43 | 44 | /** 45 | Creates a new Fl_Single_Window widget using the given 46 | position, size, and label (title) string. 47 | */ 48 | Fl_Single_Window(int X, int Y, int W, int H, const char *l=0); 49 | 50 | /** 51 | Same as Fl_Window::make_current() 52 | */ 53 | void make_current() { Fl_Window::make_current(); } 54 | 55 | /** 56 | Same as Fl_Window::flush() 57 | */ 58 | void flush() FL_OVERRIDE { Fl_Window::flush(); } 59 | }; 60 | 61 | #endif 62 | -------------------------------------------------------------------------------- /server/fltk/FL/Fl_Tiled_Image.H: -------------------------------------------------------------------------------- 1 | // 2 | // Tiled image header file for the Fast Light Tool Kit (FLTK). 3 | // 4 | // Copyright 1998-2015 by Bill Spitzak and others. 5 | // 6 | // This library is free software. Distribution and use rights are outlined in 7 | // the file "COPYING" which should have been included with this file. If this 8 | // file is missing or damaged, see the license at: 9 | // 10 | // https://www.fltk.org/COPYING.php 11 | // 12 | // Please see the following page on how to report bugs and issues: 13 | // 14 | // https://www.fltk.org/bugs.php 15 | // 16 | 17 | /* \file 18 | Fl_Tiled_Image widget . */ 19 | 20 | #ifndef Fl_Tiled_Image_H 21 | # define Fl_Tiled_Image_H 22 | 23 | # include "Fl_Image.H" 24 | 25 | 26 | /** 27 | This class supports tiling of images over a specified area. 28 | 29 | The source (tile) image is \b not copied unless you call the 30 | color_average(), desaturate(), or inactive() methods. 31 | */ 32 | class FL_EXPORT Fl_Tiled_Image : public Fl_Image { 33 | protected: 34 | 35 | Fl_Image *image_; // The image that is tiled 36 | int alloc_image_; // Did we allocate this image? 37 | 38 | public: 39 | Fl_Tiled_Image(Fl_Image *i, int W = 0, int H = 0); 40 | virtual ~Fl_Tiled_Image(); 41 | 42 | Fl_Image *copy(int W, int H) const FL_OVERRIDE; 43 | Fl_Image *copy() const { 44 | return Fl_Image::copy(); 45 | } 46 | void color_average(Fl_Color c, float i) FL_OVERRIDE; 47 | void desaturate() FL_OVERRIDE; 48 | void draw(int X, int Y, int W, int H, int cx = 0, int cy = 0) FL_OVERRIDE; 49 | void draw(int X, int Y) { draw(X, Y, w(), h(), 0, 0); } 50 | /** Gets The image that is tiled */ 51 | Fl_Image *image() { return image_; } 52 | }; 53 | 54 | #endif // !Fl_Tiled_Image_H 55 | -------------------------------------------------------------------------------- /server/fltk/FL/Fl_Toggle_Button.H: -------------------------------------------------------------------------------- 1 | // 2 | // Toggle button header file for the Fast Light Tool Kit (FLTK). 3 | // 4 | // Copyright 1998-2010 by Bill Spitzak and others. 5 | // 6 | // This library is free software. Distribution and use rights are outlined in 7 | // the file "COPYING" which should have been included with this file. If this 8 | // file is missing or damaged, see the license at: 9 | // 10 | // https://www.fltk.org/COPYING.php 11 | // 12 | // Please see the following page on how to report bugs and issues: 13 | // 14 | // https://www.fltk.org/bugs.php 15 | // 16 | 17 | /* \file 18 | Fl_Toggle_Button widget . */ 19 | 20 | #ifndef Fl_Toggle_Button_H 21 | #define Fl_Toggle_Button_H 22 | 23 | #include "Fl_Button.H" 24 | 25 | /** 26 | The toggle button is a push button that needs to be clicked once 27 | to toggle on, and one more time to toggle off. 28 | The Fl_Toggle_Button subclass displays the "on" state by 29 | drawing a pushed-in button.

30 |

Buttons generate callbacks when they are clicked by the user. You 31 | control exactly when and how by changing the values for type() 32 | and when(). 33 | */ 34 | class FL_EXPORT Fl_Toggle_Button : public Fl_Button { 35 | public: 36 | /** 37 | Creates a new Fl_Toggle_Button widget using the given 38 | position, size, and label string. 39 |

The inherited destructor deletes the toggle button. 40 | */ 41 | Fl_Toggle_Button(int X,int Y,int W,int H,const char *l=0); 42 | }; 43 | 44 | #endif 45 | -------------------------------------------------------------------------------- /server/fltk/FL/Fl_Widget_Surface.H: -------------------------------------------------------------------------------- 1 | // 2 | // Drivers code for the Fast Light Tool Kit (FLTK). 3 | // 4 | // Copyright 1998-2016 by Bill Spitzak and others. 5 | // 6 | // This library is free software. Distribution and use rights are outlined in 7 | // the file "COPYING" which should have been included with this file. If this 8 | // file is missing or damaged, see the license at: 9 | // 10 | // https://www.fltk.org/COPYING.php 11 | // 12 | // Please see the following page on how to report bugs and issues: 13 | // 14 | // https://www.fltk.org/bugs.php 15 | // 16 | 17 | #ifndef Fl_Widget_Surface_h 18 | #define Fl_Widget_Surface_h 19 | 20 | #include 21 | #include 22 | 23 | /** A surface on which any FLTK widget can be drawn. 24 | */ 25 | class FL_EXPORT Fl_Widget_Surface : public Fl_Surface_Device { 26 | private: 27 | void traverse(Fl_Widget *widget); // finds subwindows of widget and prints them 28 | protected: 29 | /** \brief horizontal offset to the origin of graphics coordinates */ 30 | int x_offset; 31 | /** \brief vertical offset to the origin of graphics coordinates */ 32 | int y_offset; 33 | Fl_Widget_Surface(Fl_Graphics_Driver *d); 34 | public: 35 | virtual void translate(int x, int y); 36 | virtual void untranslate(); 37 | void draw(Fl_Widget* widget, int delta_x = 0, int delta_y = 0); 38 | void draw_decorated_window(Fl_Window *win, int x_offset = 0, int y_offset = 0); 39 | void print_window_part(Fl_Window *win, int x, int y, int w, int h, int delta_x = 0, int delta_y = 0); 40 | virtual int printable_rect(int *w, int *h); 41 | virtual void origin(int x, int y); 42 | virtual void origin(int *x, int *y); 43 | }; 44 | 45 | #endif /* Fl_Widget_Surface_h */ 46 | -------------------------------------------------------------------------------- /server/fltk/FL/Fl_Wizard.H: -------------------------------------------------------------------------------- 1 | // 2 | // Fl_Wizard widget definitions. 3 | // 4 | // Copyright 1999-2010 by Easy Software Products. 5 | // Copyright 2011-2020 by Bill Spitzak and others. 6 | // 7 | // This library is free software. Distribution and use rights are outlined in 8 | // the file "COPYING" which should have been included with this file. If this 9 | // file is missing or damaged, see the license at: 10 | // 11 | // https://www.fltk.org/COPYING.php 12 | // 13 | // Please see the following page on how to report bugs and issues: 14 | // 15 | // https://www.fltk.org/bugs.php 16 | // 17 | 18 | /* \file 19 | Fl_Wizard widget . */ 20 | 21 | // 22 | // Include necessary header files... 23 | // 24 | 25 | #ifndef _Fl_Wizard_H_ 26 | #define _Fl_Wizard_H_ 27 | 28 | #include 29 | 30 | /** 31 | This widget is based off the Fl_Tabs widget, but instead of 32 | displaying tabs it only changes "tabs" under program control. 33 | 34 | Its primary purpose is to support "wizards" that step a user 35 | through configuration or troubleshooting tasks. 36 | 37 | As with Fl_Tabs, wizard panes are composed of child (usually 38 | Fl_Group) widgets. Navigation buttons must be added separately. 39 | */ 40 | class FL_EXPORT Fl_Wizard : public Fl_Group { 41 | 42 | Fl_Widget *value_; 43 | 44 | protected: 45 | 46 | void draw() FL_OVERRIDE; 47 | 48 | public: 49 | 50 | Fl_Wizard(int, int, int, int, const char * = 0); 51 | 52 | void next(); 53 | void prev(); 54 | Fl_Widget *value(); 55 | void value(Fl_Widget *); 56 | }; 57 | 58 | #endif // !_Fl_Wizard_H_ 59 | -------------------------------------------------------------------------------- /server/fltk/FL/Fl_XBM_Image.H: -------------------------------------------------------------------------------- 1 | // 2 | // XBM image header file for the Fast Light Tool Kit (FLTK). 3 | // 4 | // Copyright 1998-2010 by Bill Spitzak and others. 5 | // 6 | // This library is free software. Distribution and use rights are outlined in 7 | // the file "COPYING" which should have been included with this file. If this 8 | // file is missing or damaged, see the license at: 9 | // 10 | // https://www.fltk.org/COPYING.php 11 | // 12 | // Please see the following page on how to report bugs and issues: 13 | // 14 | // https://www.fltk.org/bugs.php 15 | // 16 | 17 | /* \file 18 | Fl_XBM_Image class . */ 19 | 20 | #ifndef Fl_XBM_Image_H 21 | #define Fl_XBM_Image_H 22 | # include "Fl_Bitmap.H" 23 | 24 | /** 25 | The Fl_XBM_Image class supports loading, caching, 26 | and drawing of X Bitmap (XBM) bitmap files. 27 | */ 28 | class FL_EXPORT Fl_XBM_Image : public Fl_Bitmap { 29 | 30 | public: 31 | 32 | Fl_XBM_Image(const char* filename); 33 | }; 34 | 35 | #endif // !Fl_XBM_Image_H 36 | -------------------------------------------------------------------------------- /server/fltk/FL/Fl_XPM_Image.H: -------------------------------------------------------------------------------- 1 | // 2 | // XPM image header file for the Fast Light Tool Kit (FLTK). 3 | // 4 | // Copyright 1998-2010 by Bill Spitzak and others. 5 | // 6 | // This library is free software. Distribution and use rights are outlined in 7 | // the file "COPYING" which should have been included with this file. If this 8 | // file is missing or damaged, see the license at: 9 | // 10 | // https://www.fltk.org/COPYING.php 11 | // 12 | // Please see the following page on how to report bugs and issues: 13 | // 14 | // https://www.fltk.org/bugs.php 15 | // 16 | 17 | /* \file 18 | 19 | Fl_XPM_Image class . */ 20 | 21 | #ifndef Fl_XPM_Image_H 22 | #define Fl_XPM_Image_H 23 | # include "Fl_Pixmap.H" 24 | 25 | /** 26 | The Fl_XPM_Image class supports loading, caching, 27 | and drawing of X Pixmap (XPM) images, including transparency. 28 | */ 29 | class FL_EXPORT Fl_XPM_Image : public Fl_Pixmap { 30 | 31 | public: 32 | 33 | Fl_XPM_Image(const char* filename); 34 | }; 35 | 36 | #endif // !Fl_XPM_Image 37 | -------------------------------------------------------------------------------- /server/fltk/FL/fl_casts.H: -------------------------------------------------------------------------------- 1 | // 2 | // Experimental inline "cast functions" for the Fast Light Toolkit (FLTK). 3 | // See also issue #109: "VS2017 warnings when building fltk 1.4.x" 4 | // 5 | // Copyright 1998-2021 by Bill Spitzak and others. 6 | // 7 | // This library is free software. Distribution and use rights are outlined in 8 | // the file "COPYING" which should have been included with this file. If this 9 | // file is missing or damaged, see the license at: 10 | // 11 | // https://www.fltk.org/COPYING.php 12 | // 13 | // Please see the following page on how to report bugs and issues: 14 | // 15 | // https://www.fltk.org/bugs.php 16 | // 17 | 18 | #ifndef _FL_fl_casts_H_ 19 | #define _FL_fl_casts_H_ 20 | 21 | #include 22 | 23 | inline char fl_char(void *v) { return (char)(fl_intptr_t)v; } 24 | inline int fl_int(void *v) { return (int)(fl_intptr_t)v; } 25 | inline long fl_long(void *v) { return (long)(fl_intptr_t)v; } 26 | 27 | inline unsigned char fl_uchar(void *v) { return (unsigned char)(fl_uintptr_t)v; } 28 | inline unsigned int fl_uint(void *v) { return (unsigned int)(fl_uintptr_t)v; } 29 | inline unsigned long fl_ulong(void *v) { return (unsigned long)(fl_uintptr_t)v; } 30 | 31 | // the following conversions can be used to silence MSVC warning C4312: 32 | // 'type cast': conversion from '' to 'void *' of greater size 33 | 34 | inline void *fl_voidptr(int v) { return (void *)(fl_intptr_t)v; } 35 | inline void *fl_voidptr(unsigned int v) { return (void *)(fl_uintptr_t)v; } 36 | inline void *fl_voidptr(long v) { return (void *)(fl_intptr_t)v; } 37 | inline void *fl_voidptr(unsigned long v) { return (void *)(fl_uintptr_t)v; } 38 | 39 | #endif /* _FL_fl_casts_H_ */ 40 | -------------------------------------------------------------------------------- /server/fltk/FL/fl_show_colormap.H: -------------------------------------------------------------------------------- 1 | // 2 | // Colormap picker header file for the Fast Light Tool Kit (FLTK). 3 | // 4 | // Copyright 1998-2010 by Bill Spitzak and others. 5 | // 6 | // This library is free software. Distribution and use rights are outlined in 7 | // the file "COPYING" which should have been included with this file. If this 8 | // file is missing or damaged, see the license at: 9 | // 10 | // https://www.fltk.org/COPYING.php 11 | // 12 | // Please see the following page on how to report bugs and issues: 13 | // 14 | // https://www.fltk.org/bugs.php 15 | // 16 | 17 | /** \file 18 | The fl_show_colormap() function hides the implementation classes used 19 | to provide the popup window and color selection mechanism. 20 | */ 21 | 22 | #ifndef fl_show_colormap_H 23 | #define fl_show_colormap_H 24 | 25 | /* doxygen comment here to avoid exposing ColorMenu in fl_show_colormap.cxx 26 | */ 27 | 28 | /** \addtogroup fl_attributes 29 | @{ */ 30 | 31 | /** 32 | \brief Pops up a window to let the user pick a colormap entry. 33 | \image html fl_show_colormap.png 34 | \image latex fl_show_colormap.png "fl_show_colormap" height=10cm 35 | \param[in] oldcol color to be highlighted when grid is shown. 36 | \retval Fl_Color value of the chosen colormap entry. 37 | \see Fl_Color_Chooser 38 | */ 39 | FL_EXPORT Fl_Color fl_show_colormap(Fl_Color oldcol); 40 | 41 | /** @} */ 42 | 43 | #endif 44 | -------------------------------------------------------------------------------- /server/fltk/FL/fl_string_functions.h: -------------------------------------------------------------------------------- 1 | /* 2 | * Platform agnostic string portability functions for the Fast Light Tool Kit (FLTK). 3 | * 4 | * Copyright 2020-2022 by Bill Spitzak and others. 5 | * 6 | * This library is free software. Distribution and use rights are outlined in 7 | * the file "COPYING" which should have been included with this file. If this 8 | * file is missing or damaged, see the license at: 9 | * 10 | * https://www.fltk.org/COPYING.php 11 | * 12 | * Please see the following page on how to report bugs and issues: 13 | * 14 | * https://www.fltk.org/bugs.php 15 | */ 16 | 17 | /** 18 | \file fl_string_functions.h 19 | Public header for FLTK's platform-agnostic string handling. 20 | */ 21 | 22 | #ifndef _FL_fl_string_functions_h_ 23 | #define _FL_fl_string_functions_h_ 24 | 25 | #include "Fl_Export.H" 26 | 27 | #ifdef __cplusplus 28 | extern "C" { 29 | #endif 30 | 31 | #include // size_t 32 | 33 | /** \defgroup fl_string String handling functions 34 | String handling functions declared in 35 | @{ 36 | */ 37 | 38 | FL_EXPORT char* fl_strdup(const char *s); 39 | 40 | FL_EXPORT size_t fl_strlcpy(char *, const char *, size_t); 41 | 42 | /** @} */ 43 | 44 | #ifdef __cplusplus 45 | } 46 | #endif /* __cplusplus */ 47 | 48 | 49 | #endif /* _FL_fl_string_functions_h_ */ 50 | -------------------------------------------------------------------------------- /server/fltk/FL/fl_types.h: -------------------------------------------------------------------------------- 1 | /* 2 | * Simple "C"-style types for the Fast Light Tool Kit (FLTK). 3 | * 4 | * Copyright 1998-2020 by Bill Spitzak and others. 5 | * 6 | * This library is free software. Distribution and use rights are outlined in 7 | * the file "COPYING" which should have been included with this file. If this 8 | * file is missing or damaged, see the license at: 9 | * 10 | * https://www.fltk.org/COPYING.php 11 | * 12 | * Please see the following page on how to report bugs and issues: 13 | * 14 | * https://www.fltk.org/bugs.php 15 | */ 16 | 17 | /** \file 18 | * This file contains simple "C"-style type definitions. 19 | */ 20 | 21 | #ifndef FL_TYPES_H 22 | #define FL_TYPES_H 23 | 24 | #include "fl_attr.h" 25 | 26 | /** \name Miscellaneous */ 27 | /**@{*/ /* group: Miscellaneous */ 28 | 29 | /** unsigned char */ 30 | typedef unsigned char uchar; 31 | /** unsigned long */ 32 | typedef unsigned long ulong; 33 | 34 | /** 16-bit Unicode character + 8-bit indicator for keyboard flags. 35 | 36 | \note This \b should be 24-bit Unicode character + 8-bit indicator for 37 | keyboard flags. The upper 8 bits are currently unused but reserved. 38 | 39 | Due to compatibility issues this type and all FLTK \b shortcuts can only 40 | be used with 16-bit Unicode characters (U+0000 .. U+FFFF) and 41 | not with the full range of unicode characters (U+0000 .. U+10FFFF). 42 | 43 | This is caused by the bit flags \c FL_SHIFT, \c FL_CTRL, \c FL_ALT, and 44 | \c FL_META being all in the range 0x010000 .. 0x400000. 45 | 46 | \todo Discuss and decide whether we can "shift" these special keyboard 47 | flags to the upper byte to enable full 21-bit Unicode characters 48 | (U+0000 .. U+10FFFF) plus the keyboard indicator bits as this 49 | was originally intended. This would be possible if we could rely on \b all 50 | programs being coded with symbolic names and not hard coded bit values. 51 | 52 | \internal Can we do the move for 1.4 or, if not, for any later version 53 | that is allowed to break the ABI? 54 | */ 55 | typedef unsigned int Fl_Shortcut; 56 | 57 | /**@}*/ /* group: Miscellaneous */ 58 | 59 | #endif 60 | -------------------------------------------------------------------------------- /server/fltk/FL/math.h: -------------------------------------------------------------------------------- 1 | // 2 | // Math header file for the Fast Light Tool Kit (FLTK). 3 | // 4 | // Copyright 1998-2020 by Bill Spitzak and others. 5 | // 6 | // This library is free software. Distribution and use rights are outlined in 7 | // the file "COPYING" which should have been included with this file. If this 8 | // file is missing or damaged, see the license at: 9 | // 10 | // https://www.fltk.org/COPYING.php 11 | // 12 | // Please see the following page on how to report bugs and issues: 13 | // 14 | // https://www.fltk.org/bugs.php 15 | // 16 | 17 | // Xcode on macOS includes files by recursing down into directories. 18 | // This code catches the cycle and directly includes the required file. 19 | #ifdef fl_math_h_cyclic_include 20 | # include "/usr/include/math.h" 21 | #endif 22 | 23 | #ifndef fl_math_h 24 | # define fl_math_h 25 | 26 | # define fl_math_h_cyclic_include 27 | # include 28 | # undef fl_math_h_cyclic_include 29 | 30 | # ifndef M_PI 31 | # define M_PI 3.14159265358979323846 32 | # define M_PI_2 1.57079632679489661923 33 | # define M_PI_4 0.78539816339744830962 34 | # define M_1_PI 0.31830988618379067154 35 | # define M_2_PI 0.63661977236758134308 36 | # endif // !M_PI 37 | 38 | # ifndef M_SQRT2 39 | # define M_SQRT2 1.41421356237309504880 40 | # define M_SQRT1_2 0.70710678118654752440 41 | # endif // !M_SQRT2 42 | 43 | # if (defined(_WIN32) || defined(CRAY)) && !defined(__MINGW32__) 44 | 45 | inline double rint(double v) {return floor(v+.5);} 46 | inline double copysign(double a, double b) {return b<0 ? -a : a;} 47 | 48 | # endif // (_WIN32 || CRAY) && !__MINGW32__ 49 | 50 | #endif // !fl_math_h 51 | -------------------------------------------------------------------------------- /server/fltk/FL/x.H: -------------------------------------------------------------------------------- 1 | // 2 | // *Deprecated* platform header file for the Fast Light Tool Kit (FLTK). 3 | // 4 | // Copyright 1998-2018 by Bill Spitzak and others. 5 | // 6 | // This library is free software. Distribution and use rights are outlined in 7 | // the file "COPYING" which should have been included with this file. If this 8 | // file is missing or damaged, see the license at: 9 | // 10 | // https://www.fltk.org/COPYING.php 11 | // 12 | // Please see the following page on how to report bugs and issues: 13 | // 14 | // https://www.fltk.org/bugs.php 15 | // 16 | 17 | // IMPORTANT: This file is deprecated since FLTK 1.4.0. DO NOT include it. 18 | // FL/x.H will be removed in a future FLTK release. 19 | 20 | // Please #include instead if you really need it. See 21 | // documentation in FL/platform.H to decide whether you need that file. 22 | 23 | #if !defined(Fl_X_H) && !defined(FL_DOXYGEN) 24 | # define Fl_X_H 25 | # include 26 | #endif // !Fl_X_H 27 | -------------------------------------------------------------------------------- /server/fltk/README.md: -------------------------------------------------------------------------------- 1 | # README - Fast Light Tool Kit (FLTK) Version 1.4.2 2 | 3 | ## WHAT IS FLTK? 4 | 5 | The Fast Light Tool Kit is a cross-platform C++ GUI toolkit for 6 | UNIX®/Linux® (X11 or Wayland), Microsoft® Windows®, and macOS®. 7 | FLTK provides modern GUI functionality without bloat and 8 | supports 3D graphics via OpenGL® and its built-in GLUT 9 | emulation. It was originally developed by Mr. Bill Spitzak 10 | and is currently maintained by a small group of developers 11 | across the world with a central repository on GitHub. 12 | 13 | https://www.fltk.org/ 14 | https://github.com/fltk/fltk/ 15 | 16 | For more information see README.txt: 17 | https://github.com/fltk/fltk/blob/master/README.txt 18 | 19 | ![Build](https://github.com/fltk/fltk/actions/workflows/build.yml/badge.svg) 20 | 21 | [![Build FLUID User Manual.](https://github.com/Albrecht-S/fltk/actions/workflows/build_fluid_docs.yml/badge.svg)](https://github.com/Albrecht-S/fltk/actions/workflows/build_fluid_docs.yml) 22 | -------------------------------------------------------------------------------- /server/fltk/src/Fl_Box.cxx: -------------------------------------------------------------------------------- 1 | // 2 | // Box widget for the Fast Light Tool Kit (FLTK). 3 | // 4 | // Copyright 1998-2010 by Bill Spitzak and others. 5 | // 6 | // This library is free software. Distribution and use rights are outlined in 7 | // the file "COPYING" which should have been included with this file. If this 8 | // file is missing or damaged, see the license at: 9 | // 10 | // https://www.fltk.org/COPYING.php 11 | // 12 | // Please see the following page on how to report bugs and issues: 13 | // 14 | // https://www.fltk.org/bugs.php 15 | // 16 | 17 | #include 18 | #include 19 | 20 | 21 | Fl_Box::Fl_Box(int X, int Y, int W, int H, const char *l) 22 | : Fl_Widget(X,Y,W,H,l) 23 | { 24 | } 25 | 26 | Fl_Box::Fl_Box(Fl_Boxtype b, int X, int Y, int W, int H, const char *l) 27 | : Fl_Widget(X,Y,W,H,l) 28 | { 29 | box(b); 30 | } 31 | 32 | void Fl_Box::draw() { 33 | draw_box(); 34 | draw_label(); 35 | } 36 | 37 | int Fl_Box::handle(int event) { 38 | if (event == FL_ENTER || event == FL_LEAVE) return 1; 39 | else return 0; 40 | } 41 | -------------------------------------------------------------------------------- /server/fltk/src/Fl_Browser_load.cxx: -------------------------------------------------------------------------------- 1 | // 2 | // File loading routines for the Fast Light Tool Kit (FLTK). 3 | // 4 | // Copyright 1998-2010 by Bill Spitzak and others. 5 | // 6 | // This library is free software. Distribution and use rights are outlined in 7 | // the file "COPYING" which should have been included with this file. If this 8 | // file is missing or damaged, see the license at: 9 | // 10 | // https://www.fltk.org/COPYING.php 11 | // 12 | // Please see the following page on how to report bugs and issues: 13 | // 14 | // https://www.fltk.org/bugs.php 15 | // 16 | 17 | #include 18 | #include 19 | #include 20 | #include 21 | 22 | /** 23 | Clears the browser and reads the file, adding each line from the file 24 | to the browser. If the filename is NULL or a zero-length 25 | string then this just clears the browser. This returns zero if there 26 | was any error in opening or reading the file, in which case errno 27 | is set to the system error. The data() of each line is set 28 | to NULL. 29 | \param[in] filename The filename to load 30 | \returns 1 if OK, 0 on error (errno has reason) 31 | \see add() 32 | */ 33 | int Fl_Browser::load(const char *filename) { 34 | #define MAXFL_BLINE 1024 35 | char newtext[MAXFL_BLINE]; 36 | int c; 37 | int i; 38 | clear(); 39 | if (!filename || !(filename[0])) return 1; 40 | FILE *fl = fl_fopen(filename,"r"); 41 | if (!fl) return 0; 42 | i = 0; 43 | do { 44 | c = getc(fl); 45 | if (c == '\n' || c <= 0 || i>=(MAXFL_BLINE-1)) { 46 | newtext[i] = 0; 47 | add(newtext); 48 | i = 0; 49 | } else { 50 | newtext[i++] = c; 51 | } 52 | } while (c >= 0); 53 | fclose(fl); 54 | return 1; 55 | } 56 | -------------------------------------------------------------------------------- /server/fltk/src/Fl_Check_Button.cxx: -------------------------------------------------------------------------------- 1 | // 2 | // Check button widget for the Fast Light Tool Kit (FLTK). 3 | // 4 | // Copyright 1998-2014 by Bill Spitzak and others. 5 | // 6 | // This library is free software. Distribution and use rights are outlined in 7 | // the file "COPYING" which should have been included with this file. If this 8 | // file is missing or damaged, see the license at: 9 | // 10 | // https://www.fltk.org/COPYING.php 11 | // 12 | // Please see the following page on how to report bugs and issues: 13 | // 14 | // https://www.fltk.org/bugs.php 15 | // 16 | 17 | #include 18 | #include 19 | 20 | /** 21 | \class Fl_Check_Button 22 | \brief A button with a "checkmark" to show its status. 23 | 24 | \image html Fl_Check_Button.png 25 | \image latex Fl_Check_Button.png "Fl_Check_Button" width=4cm 26 | 27 | Buttons generate callbacks when they are clicked by the user. You control 28 | exactly when and how by changing the values for type() and when(). 29 | 30 | The Fl_Check_Button subclass displays its "ON" state by showing a "checkmark" 31 | rather than drawing itself pushed in. 32 | */ 33 | 34 | /** 35 | Creates a new Fl_Check_Button widget using the given position, size, and label string. 36 | 37 | The default box type is FL_NO_BOX, which draws the label w/o a box 38 | right of the checkmark. 39 | 40 | The selection_color() sets the color of the checkmark. 41 | Default is FL_FOREGROUND_COLOR (usually black). 42 | 43 | You can use down_box() to change the box type of the checkmark. 44 | Default is FL_DOWN_BOX. 45 | 46 | \param[in] X, Y, W, H position and size of the widget 47 | \param[in] L widget label, default is no label 48 | */ 49 | Fl_Check_Button::Fl_Check_Button(int X, int Y, int W, int H, const char *L) 50 | : Fl_Light_Button(X, Y, W, H, L) { 51 | box(FL_NO_BOX); 52 | down_box(FL_DOWN_BOX); 53 | selection_color(FL_FOREGROUND_COLOR); 54 | } 55 | -------------------------------------------------------------------------------- /server/fltk/src/Fl_Menu_Bar.cxx: -------------------------------------------------------------------------------- 1 | // 2 | // Menu bar widget for the Fast Light Tool Kit (FLTK). 3 | // 4 | // Copyright 1998-2010 by Bill Spitzak and others. 5 | // 6 | // This library is free software. Distribution and use rights are outlined in 7 | // the file "COPYING" which should have been included with this file. If this 8 | // file is missing or damaged, see the license at: 9 | // 10 | // https://www.fltk.org/COPYING.php 11 | // 12 | // Please see the following page on how to report bugs and issues: 13 | // 14 | // https://www.fltk.org/bugs.php 15 | // 16 | 17 | #include 18 | #include 19 | #include 20 | 21 | void Fl_Menu_Bar::draw() { 22 | draw_box(); 23 | if (!menu() || !menu()->text) return; 24 | const Fl_Menu_Item* m; 25 | int X = x()+6; 26 | for (m=menu()->first(); m->text; m = m->next()) { 27 | int W = m->measure(0,this) + 16; 28 | m->draw(X, y(), W, h(), this); 29 | X += W; 30 | if (m->flags & FL_MENU_DIVIDER) { 31 | int y1 = y() + Fl::box_dy(box()); 32 | int y2 = y1 + h() - Fl::box_dh(box()) - 1; 33 | 34 | // Draw a vertical divider between menus... 35 | fl_color(FL_DARK3); 36 | fl_yxline(X - 6, y1, y2); 37 | fl_color(FL_LIGHT3); 38 | fl_yxline(X - 5, y1, y2); 39 | } 40 | } 41 | } 42 | 43 | int Fl_Menu_Bar::handle(int event) { 44 | const Fl_Menu_Item* v; 45 | if (menu() && menu()->text) switch (event) { 46 | case FL_ENTER: 47 | case FL_LEAVE: 48 | return 1; 49 | case FL_PUSH: 50 | v = 0; 51 | J1: 52 | v = menu()->pulldown(x(), y(), w(), h(), v, this, 0, 1); 53 | picked(v); 54 | return 1; 55 | case FL_SHORTCUT: 56 | if (visible_r()) { 57 | v = menu()->find_shortcut(0, true); 58 | if (v && v->submenu()) goto J1; 59 | } 60 | return test_shortcut() != 0; 61 | } 62 | return 0; 63 | } 64 | 65 | 66 | Fl_Menu_Bar::Fl_Menu_Bar(int X, int Y, int W, int H,const char *l) 67 | : Fl_Menu_(X,Y,W,H,l) 68 | { 69 | } 70 | 71 | 72 | void Fl_Menu_Bar::play_menu(const Fl_Menu_Item *v) { 73 | if (v) { 74 | v = menu()->pulldown(x(), y(), w(), h(), v, this, 0, 1); 75 | picked(v); 76 | } 77 | } 78 | -------------------------------------------------------------------------------- /server/fltk/src/Fl_Menu_Window.cxx: -------------------------------------------------------------------------------- 1 | // 2 | // Menu window code for the Fast Light Tool Kit (FLTK). 3 | // 4 | // Copyright 1998-2016 by Bill Spitzak and others. 5 | // 6 | // This library is free software. Distribution and use rights are outlined in 7 | // the file "COPYING" which should have been included with this file. If this 8 | // file is missing or damaged, see the license at: 9 | // 10 | // https://www.fltk.org/COPYING.php 11 | // 12 | // Please see the following page on how to report bugs and issues: 13 | // 14 | // https://www.fltk.org/bugs.php 15 | // 16 | 17 | // This is the window type used by Fl_Menu to make the pop-ups. 18 | // It draws in the overlay planes if possible. 19 | 20 | // Also here is the implementation of the mouse & keyboard grab, 21 | // which are used so that clicks outside the program's windows 22 | // can be used to dismiss the menus. 23 | 24 | #include 25 | #include "Fl_Window_Driver.H" 26 | 27 | /** Destroys the window and all of its children.*/ 28 | Fl_Menu_Window::~Fl_Menu_Window() { 29 | hide(); 30 | } 31 | 32 | 33 | Fl_Menu_Window::Fl_Menu_Window(int W, int H, const char *l) 34 | : Fl_Single_Window(W,H,l) 35 | { 36 | image(0); 37 | } 38 | 39 | 40 | Fl_Menu_Window::Fl_Menu_Window(int X, int Y, int W, int H, const char *l) 41 | : Fl_Single_Window(X,Y,W,H,l) { 42 | image(0); 43 | } 44 | -------------------------------------------------------------------------------- /server/fltk/src/Fl_Menu_global.cxx: -------------------------------------------------------------------------------- 1 | // 2 | // Global menu shortcut code for the Fast Light Tool Kit (FLTK). 3 | // 4 | // Copyright 1998-2010 by Bill Spitzak and others. 5 | // 6 | // This library is free software. Distribution and use rights are outlined in 7 | // the file "COPYING" which should have been included with this file. If this 8 | // file is missing or damaged, see the license at: 9 | // 10 | // https://www.fltk.org/COPYING.php 11 | // 12 | // Please see the following page on how to report bugs and issues: 13 | // 14 | // https://www.fltk.org/bugs.php 15 | // 16 | 17 | // Make all the shortcuts in this menu global. 18 | // Currently only one menu at a time and you cannot destruct the menu, 19 | // is this sufficient? 20 | 21 | #include 22 | #include 23 | 24 | static Fl_Menu_* the_widget; 25 | 26 | static int handler(int e) { 27 | if (e != FL_SHORTCUT || Fl::modal()) return 0; 28 | Fl::first_window(the_widget->window()); 29 | return the_widget->handle(e); 30 | } 31 | 32 | /** 33 | Make the shortcuts for this menu work no matter what window has the 34 | focus when you type it. This is done by using 35 | Fl::add_handler(). This Fl_Menu_ widget does not 36 | have to be visible (ie the window it is in can be hidden, or it does 37 | not have to be put in a window at all). 38 |

Currently there can be only one global()menu. Setting a new 39 | one will replace the old one. There is no way to remove the 40 | global() setting (so don't destroy the widget!) 41 | */ 42 | void Fl_Menu_::global() { 43 | if (!the_widget) Fl::add_handler(handler); 44 | the_widget = this; 45 | } 46 | -------------------------------------------------------------------------------- /server/fltk/src/Fl_Repeat_Button.cxx: -------------------------------------------------------------------------------- 1 | // 2 | // Repeat button widget for the Fast Light Tool Kit (FLTK). 3 | // 4 | // Copyright 1998-2010 by Bill Spitzak and others. 5 | // 6 | // This library is free software. Distribution and use rights are outlined in 7 | // the file "COPYING" which should have been included with this file. If this 8 | // file is missing or damaged, see the license at: 9 | // 10 | // https://www.fltk.org/COPYING.php 11 | // 12 | // Please see the following page on how to report bugs and issues: 13 | // 14 | // https://www.fltk.org/bugs.php 15 | // 16 | 17 | #include 18 | #include 19 | 20 | #define INITIALREPEAT .5 21 | #define REPEAT .1 22 | 23 | void Fl_Repeat_Button::repeat_callback(void *v) { 24 | Fl_Button *b = (Fl_Button*)v; 25 | Fl::add_timeout(REPEAT,repeat_callback,b); 26 | b->do_callback(FL_REASON_RESELECTED); 27 | } 28 | 29 | int Fl_Repeat_Button::handle(int event) { 30 | int newval; 31 | switch (event) { 32 | case FL_HIDE: 33 | case FL_DEACTIVATE: 34 | case FL_RELEASE: 35 | newval = 0; goto J1; 36 | case FL_PUSH: 37 | case FL_DRAG: 38 | if (Fl::visible_focus()) Fl::focus(this); 39 | newval = Fl::event_inside(this); 40 | J1: 41 | if (!active()) 42 | newval = 0; 43 | if (value(newval)) { 44 | if (newval) { 45 | Fl::add_timeout(INITIALREPEAT,repeat_callback,this); 46 | do_callback(FL_REASON_SELECTED); 47 | } else { 48 | Fl::remove_timeout(repeat_callback,this); 49 | } 50 | } 51 | return 1; 52 | default: 53 | return Fl_Button::handle(event); 54 | } 55 | } 56 | 57 | 58 | Fl_Repeat_Button::Fl_Repeat_Button(int X,int Y,int W,int H,const char *l) 59 | : Fl_Button(X,Y,W,H,l) 60 | { 61 | } 62 | -------------------------------------------------------------------------------- /server/fltk/src/Fl_Return_Button.cxx: -------------------------------------------------------------------------------- 1 | // 2 | // Return button widget for the Fast Light Tool Kit (FLTK). 3 | // 4 | // Copyright 1998-2010 by Bill Spitzak and others. 5 | // 6 | // This library is free software. Distribution and use rights are outlined in 7 | // the file "COPYING" which should have been included with this file. If this 8 | // file is missing or damaged, see the license at: 9 | // 10 | // https://www.fltk.org/COPYING.php 11 | // 12 | // Please see the following page on how to report bugs and issues: 13 | // 14 | // https://www.fltk.org/bugs.php 15 | // 16 | 17 | #include 18 | #include 19 | #include 20 | 21 | int fl_return_arrow(int x, int y, int w, int h) { 22 | int size = w; if (h 24 | 25 | 26 | void Fl_Single_Window::show() 27 | { 28 | Fl_Window::show(); 29 | } 30 | 31 | 32 | Fl_Single_Window::Fl_Single_Window(int W, int H, const char *l) 33 | : Fl_Window(W,H,l) 34 | { 35 | } 36 | 37 | 38 | Fl_Single_Window::Fl_Single_Window(int X, int Y, int W, int H, const char *l) 39 | : Fl_Window(X,Y,W,H,l) 40 | { 41 | } 42 | -------------------------------------------------------------------------------- /server/fltk/src/Fl_Window_hotspot.cxx: -------------------------------------------------------------------------------- 1 | // 2 | // Common hotspot routines for the Fast Light Tool Kit (FLTK). 3 | // 4 | // Copyright 1998-2010 by Bill Spitzak and others. 5 | // 6 | // This library is free software. Distribution and use rights are outlined in 7 | // the file "COPYING" which should have been included with this file. If this 8 | // file is missing or damaged, see the license at: 9 | // 10 | // https://www.fltk.org/COPYING.php 11 | // 12 | // Please see the following page on how to report bugs and issues: 13 | // 14 | // https://www.fltk.org/bugs.php 15 | // 16 | 17 | #include 18 | #include 19 | #include "Fl_Window_Driver.H" 20 | 21 | void Fl_Window::hotspot(int X, int Y, int offscreen) { 22 | int mx,my; 23 | 24 | // Update the screen position based on the mouse position. 25 | Fl::get_mouse(mx,my); 26 | X = mx-X; Y = my-Y; 27 | 28 | // If offscreen is 0 (the default), make sure that the window 29 | // stays on the screen, if possible. 30 | if (!offscreen) { 31 | int scr_x, scr_y, scr_w, scr_h; 32 | Fl::screen_work_area(scr_x, scr_y, scr_w, scr_h); 33 | 34 | int top = 0; 35 | int left = 0; 36 | int right = 0; 37 | int bottom = 0; 38 | 39 | if (border()) { 40 | pWindowDriver->decoration_sizes(&top, &left, &right, &bottom); 41 | } 42 | // now ensure contents are on-screen (more important than border): 43 | if (X+w()+right > scr_w+scr_x) X = scr_w+scr_x-right-w(); 44 | if (X-left < scr_x) X = left + scr_x; 45 | if (Y+h()+bottom > scr_h+scr_y) Y = scr_h+scr_y-bottom-h(); 46 | if (Y-top < scr_y) Y = top + scr_y; 47 | // make sure that we will force this position 48 | if (X==x()) x(X-1); 49 | } 50 | 51 | position(X,Y); 52 | } 53 | 54 | void Fl_Window::hotspot(const Fl_Widget *o, int offscreen) { 55 | int X = o->w()/2; 56 | int Y = o->h()/2; 57 | while (o != this && o) { 58 | X += o->x(); Y += o->y(); 59 | o = o->window(); 60 | } 61 | hotspot(X,Y,offscreen); 62 | } 63 | -------------------------------------------------------------------------------- /server/fltk/src/Fl_Window_iconize.cxx: -------------------------------------------------------------------------------- 1 | // 2 | // Window minification code for the Fast Light Tool Kit (FLTK). 3 | // 4 | // Copyright 1998-2023 by Bill Spitzak and others. 5 | // 6 | // This library is free software. Distribution and use rights are outlined in 7 | // the file "COPYING" which should have been included with this file. If this 8 | // file is missing or damaged, see the license at: 9 | // 10 | // https://www.fltk.org/COPYING.php 11 | // 12 | // Please see the following page on how to report bugs and issues: 13 | // 14 | // https://www.fltk.org/bugs.php 15 | // 16 | 17 | #include 18 | #include "Fl_Window_Driver.H" 19 | 20 | void Fl_Window::iconize() { 21 | if (!shown()) { 22 | show_next_window_iconic(1); 23 | show(); 24 | } else { 25 | pWindowDriver->iconize(); 26 | } 27 | } 28 | -------------------------------------------------------------------------------- /server/fltk/src/Fl_XColor.H: -------------------------------------------------------------------------------- 1 | // 2 | // X-specific color definitions for the Fast Light Tool Kit (FLTK). 3 | // 4 | // Copyright 1998-2010 by Bill Spitzak and others. 5 | // 6 | // This library is free software. Distribution and use rights are outlined in 7 | // the file "COPYING" which should have been included with this file. If this 8 | // file is missing or damaged, see the license at: 9 | // 10 | // https://www.fltk.org/COPYING.php 11 | // 12 | // Please see the following page on how to report bugs and issues: 13 | // 14 | // https://www.fltk.org/bugs.php 15 | // 16 | 17 | #ifndef FL_DOXYGEN 18 | #include 19 | #include 20 | 21 | // one of these for each color in fltk's "colormap": 22 | // if overlays are enabled, another one for the overlay 23 | struct Fl_XColor { 24 | unsigned char r,g,b; // actual color used by X 25 | unsigned char mapped; // true when XAllocColor done 26 | unsigned long pixel; // the X pixel to use 27 | }; 28 | extern Fl_XColor fl_xmap[/*overlay*/][256]; 29 | 30 | // mask & shifts to produce xcolor for truecolor visuals: 31 | extern unsigned char fl_redmask, fl_greenmask, fl_bluemask; 32 | extern int fl_redshift, fl_greenshift, fl_blueshift, fl_extrashift; 33 | #endif // FL_DOXYGEN 34 | -------------------------------------------------------------------------------- /server/fltk/src/Fl_abort.cxx: -------------------------------------------------------------------------------- 1 | // 2 | // Warning/error message code for the Fast Light Tool Kit (FLTK). 3 | // 4 | // Copyright 1998-2011 by Bill Spitzak and others. 5 | // 6 | // This library is free software. Distribution and use rights are outlined in 7 | // the file "COPYING" which should have been included with this file. If this 8 | // file is missing or damaged, see the license at: 9 | // 10 | // https://www.fltk.org/COPYING.php 11 | // 12 | // Please see the following page on how to report bugs and issues: 13 | // 14 | // https://www.fltk.org/bugs.php 15 | // 16 | 17 | // You can also override this by redefining all of these. 18 | 19 | #include 20 | #include "Fl_System_Driver.H" 21 | #include 22 | 23 | void (*Fl::warning)(const char* format, ...) = Fl_System_Driver::warning; 24 | void (*Fl::error)(const char* format, ...) = Fl_System_Driver::error; 25 | void (*Fl::fatal)(const char* format, ...) = Fl_System_Driver::fatal; 26 | -------------------------------------------------------------------------------- /server/fltk/src/Fl_display.cxx: -------------------------------------------------------------------------------- 1 | // 2 | // Display function for the Fast Light Tool Kit (FLTK). 3 | // 4 | // Copyright 1998-2010 by Bill Spitzak and others. 5 | // 6 | // This library is free software. Distribution and use rights are outlined in 7 | // the file "COPYING" which should have been included with this file. If this 8 | // file is missing or damaged, see the license at: 9 | // 10 | // https://www.fltk.org/COPYING.php 11 | // 12 | // Please see the following page on how to report bugs and issues: 13 | // 14 | // https://www.fltk.org/bugs.php 15 | // 16 | 17 | // Startup method to set what display to use. 18 | // Using setenv makes programs that are exec'd use the same display. 19 | 20 | #include 21 | #include "Fl_Screen_Driver.H" 22 | 23 | /** 24 | Sets the X or Wayland display to use for all windows. 25 | 26 | This sets the environment variable $DISPLAY or $WAYLAND_DISPLAY to the passed string, 27 | so this only works before you show() the first window or otherwise open the display. 28 | 29 | This does nothing on other platforms. 30 | */ 31 | void Fl::display(const char *d) 32 | { 33 | screen_driver()->display(d); 34 | } 35 | -------------------------------------------------------------------------------- /server/fltk/src/Fl_get_key.cxx: -------------------------------------------------------------------------------- 1 | // 2 | // Keyboard state routines for the Fast Light Tool Kit (FLTK). 3 | // 4 | // Copyright 1998-2021 by Bill Spitzak and others. 5 | // 6 | // This library is free software. Distribution and use rights are outlined in 7 | // the file "COPYING" which should have been included with this file. If this 8 | // file is missing or damaged, see the license at: 9 | // 10 | // https://www.fltk.org/COPYING.php 11 | // 12 | // Please see the following page on how to report bugs and issues: 13 | // 14 | // https://www.fltk.org/bugs.php 15 | // 16 | 17 | #include 18 | #if !defined(FL_DOXYGEN) 19 | 20 | // Return the current state of a key. This is the X version. I identify 21 | // keys (mostly) by the X keysym. So this turns the keysym into a keycode 22 | // and looks it up in the X key bit vector, which Fl_x.cxx keeps track of. 23 | 24 | #include 25 | #include "drivers/X11/Fl_X11_Screen_Driver.H" 26 | #include // for fl_display 27 | 28 | extern char fl_key_vector[32]; // in Fl_x.cxx 29 | 30 | int Fl_X11_Screen_Driver::event_key(int k) { 31 | if (k > FL_Button && k <= FL_Button+8) 32 | return Fl::event_state(8<<(k-FL_Button)); 33 | int i; 34 | # ifdef __sgi 35 | // get some missing PC keyboard keys: 36 | if (k == FL_Meta_L) i = 147; 37 | else if (k == FL_Meta_R) i = 148; 38 | else if (k == FL_Menu) i = 149; 39 | else 40 | # endif 41 | i = XKeysymToKeycode(fl_display, k); 42 | if (i==0) return 0; 43 | return fl_key_vector[i/8] & (1 << (i%8)); 44 | } 45 | 46 | int Fl_X11_Screen_Driver::get_key(int k) { 47 | fl_open_display(); 48 | XQueryKeymap(fl_display, fl_key_vector); 49 | return event_key(k); 50 | } 51 | 52 | #endif // FL_DOXYGEN 53 | -------------------------------------------------------------------------------- /server/fltk/src/Fl_grab.cxx: -------------------------------------------------------------------------------- 1 | // 2 | // Grab/release code for the Fast Light Tool Kit (FLTK). 3 | // 4 | // Copyright 1998-2018 by Bill Spitzak and others. 5 | // 6 | // This library is free software. Distribution and use rights are outlined in 7 | // the file "COPYING" which should have been included with this file. If this 8 | // file is missing or damaged, see the license at: 9 | // 10 | // https://www.fltk.org/COPYING.php 11 | // 12 | // Please see the following page on how to report bugs and issues: 13 | // 14 | // https://www.fltk.org/bugs.php 15 | // 16 | 17 | #include 18 | #include "Fl_Screen_Driver.H" 19 | 20 | //////////////////////////////////////////////////////////////// 21 | // "Grab" is done while menu systems are up. This has several effects: 22 | // Events are all sent to the "grab window", which does not even 23 | // have to be displayed (and in the case of Fl_Menu.cxx it isn't). 24 | // The system is also told to "grab" events and send them to this app. 25 | // This also modifies how Fl_Window::show() works, on X it turns on 26 | // override_redirect, it does similar things on Windows. 27 | 28 | void Fl::grab(Fl_Window *win) 29 | { 30 | screen_driver()->grab(win); 31 | } 32 | -------------------------------------------------------------------------------- /server/fltk/src/Fl_own_colormap.cxx: -------------------------------------------------------------------------------- 1 | // 2 | // Private colormap support for the Fast Light Tool Kit (FLTK). 3 | // 4 | // Copyright 1998-2021 by Bill Spitzak and others. 5 | // 6 | // This library is free software. Distribution and use rights are outlined in 7 | // the file "COPYING" which should have been included with this file. If this 8 | // file is missing or damaged, see the license at: 9 | // 10 | // https://www.fltk.org/COPYING.php 11 | // 12 | // Please see the following page on how to report bugs and issues: 13 | // 14 | // https://www.fltk.org/bugs.php 15 | // 16 | 17 | // Using the default system colormap can be a bad idea on PseudoColor 18 | // visuals, since typically every application uses the default colormap and 19 | // you can run out of colormap entries easily. 20 | // 21 | // The solution is to always create a new colormap on PseudoColor displays 22 | // and copy the first 16 colors from the default colormap so that we won't 23 | // get huge color changes when switching windows. 24 | 25 | #include 26 | #include "Fl_Screen_Driver.H" 27 | 28 | /** \fn Fl::own_colormap() 29 | Makes FLTK use its own colormap. This may make FLTK display better 30 | and will reduce conflicts with other programs that want lots of colors. 31 | However the colors may flash as you move the cursor between windows. 32 | 33 |

This does nothing if the current visual is not colormapped. 34 | */ 35 | void Fl::own_colormap() { 36 | Fl::screen_driver()->own_colormap(); 37 | } 38 | -------------------------------------------------------------------------------- /server/fltk/src/Fl_visual.cxx: -------------------------------------------------------------------------------- 1 | // 2 | // Visual support for the Fast Light Tool Kit (FLTK). 3 | // 4 | // Copyright 1998-2010 by Bill Spitzak and others. 5 | // 6 | // This library is free software. Distribution and use rights are outlined in 7 | // the file "COPYING" which should have been included with this file. If this 8 | // file is missing or damaged, see the license at: 9 | // 10 | // https://www.fltk.org/COPYING.php 11 | // 12 | // Please see the following page on how to report bugs and issues: 13 | // 14 | // https://www.fltk.org/bugs.php 15 | // 16 | 17 | // Set the default visual according to passed switches: 18 | 19 | #include 20 | #include "Fl_Screen_Driver.H" 21 | 22 | /** \fn Fl::visual(int flags) 23 | Selects a visual so that your graphics are drawn correctly. This is 24 | only allowed before you call show() on any windows. This does nothing 25 | if the default visual satisfies the capabilities, or if no visual 26 | satisfies the capabilities, or on systems that don't have such 27 | brain-dead notions. 28 | 29 |

Only the following combinations do anything useful: 30 | 31 |

    32 |
  • Fl::visual(FL_RGB) 33 |
    Full/true color (if there are several depths FLTK chooses the 34 | largest). Do this if you use fl_draw_image 35 | for much better (non-dithered) output. 36 |
     
  • 37 |
  • Fl::visual(FL_RGB8) 38 |
    Full color with at least 24 bits of color. FL_RGB will 39 | always pick this if available, but if not it will happily return a 40 | less-than-24 bit deep visual. This call fails if 24 bits are not 41 | available. 42 |
     
  • 43 |
44 | 45 |

This returns true if the system has the capabilities by default or 46 | FLTK succeeded in turning them on. Your program will still work even if 47 | this returns false (it just won't look as good). 48 | */ 49 | int Fl::visual(int flags) 50 | { 51 | return screen_driver()->visual(flags); 52 | } 53 | -------------------------------------------------------------------------------- /server/fltk/src/drivers/Unix/Fl_Unix_Screen_Driver.H: -------------------------------------------------------------------------------- 1 | // 2 | // Definition of the part of the screen driver shared by X11 and Wayland platforms 3 | // for the Fast Light Tool Kit (FLTK). 4 | // 5 | // Copyright 2021-2024 by Bill Spitzak and others. 6 | // 7 | // This library is free software. Distribution and use rights are outlined in 8 | // the file "COPYING" which should have been included with this file. If this 9 | // file is missing or damaged, see the license at: 10 | // 11 | // https://www.fltk.org/COPYING.php 12 | // 13 | // Please see the following page on how to report bugs and issues: 14 | // 15 | // https://www.fltk.org/bugs.php 16 | // 17 | 18 | #ifndef FL_UNIX_SCREEN_DRIVER_H 19 | #define FL_UNIX_SCREEN_DRIVER_H 20 | 21 | #include 22 | #include "../../Fl_Screen_Driver.H" 23 | 24 | # if USE_POLL 25 | 26 | # include 27 | static pollfd *pollfds = 0; 28 | 29 | # else 30 | # if HAVE_SYS_SELECT_H 31 | # include 32 | # endif /* HAVE_SYS_SELECT_H */ 33 | 34 | // NetBSD before version 3.0 declares select() in "unistd.h" (#944): 35 | // https://man.netbsd.org/NetBSD-2.1/select.2 36 | 37 | # if defined(__NetBSD__) 38 | # include // For '__NetBSD_Version__' definition 39 | # if defined(__NetBSD_Version__) && (__NetBSD_Version__ < 300000000) 40 | # include 41 | # include 42 | # include 43 | # endif // __NetBSD_Version__ 44 | # endif // __NetBSD__ 45 | 46 | # define POLLIN 1 47 | # define POLLOUT 4 48 | # define POLLERR 8 49 | 50 | # endif /* USE_POLL */ 51 | 52 | 53 | class Fl_Unix_Screen_Driver : public Fl_Screen_Driver { 54 | public: 55 | # if !USE_POLL 56 | static fd_set fdsets[3]; 57 | # endif 58 | static int maxfd; 59 | static int nfds; 60 | static struct FD { 61 | # if !USE_POLL 62 | int fd; 63 | short events; 64 | # endif 65 | void (*cb)(int, void*); 66 | void* arg; 67 | } *fd; 68 | virtual int poll_or_select_with_delay(double time_to_wait); 69 | virtual int poll_or_select(); 70 | virtual void *control_maximize_button(void *) { return NULL; } 71 | }; 72 | 73 | #endif /* FL_UNIX_SCREEN_DRIVER_H */ 74 | -------------------------------------------------------------------------------- /server/fltk/src/drivers/Xlib/Fl_Font.H: -------------------------------------------------------------------------------- 1 | // 2 | // Font definitions for the Fast Light Tool Kit (FLTK). 3 | // 4 | // Copyright 1998-2018 by Bill Spitzak and others. 5 | // 6 | // This library is free software. Distribution and use rights are outlined in 7 | // the file "COPYING" which should have been included with this file. If this 8 | // file is missing or damaged, see the license at: 9 | // 10 | // https://www.fltk.org/COPYING.php 11 | // 12 | // Please see the following page on how to report bugs and issues: 13 | // 14 | // https://www.fltk.org/bugs.php 15 | // 16 | 17 | // Two internal fltk data structures: 18 | // 19 | // Fl_Fontdesc: an entry into the fl_font() table. There is one of these 20 | // for each fltk font number. 21 | // 22 | #ifndef FL_FONT_ 23 | #define FL_FONT_ 24 | 25 | #include 26 | 27 | #if USE_XFT 28 | typedef struct _XftFont XftFont; 29 | #else 30 | # include "../../Xutf8.h" 31 | #endif // USE_XFT 32 | 33 | class Fl_Xlib_Font_Descriptor : public Fl_Font_Descriptor { 34 | public: 35 | # if USE_XFT 36 | # if USE_PANGO 37 | int descent_; 38 | int height_; 39 | int **width; 40 | # else 41 | XftFont* font; 42 | # endif 43 | int angle; 44 | FL_EXPORT Fl_Xlib_Font_Descriptor(const char* xfontname, Fl_Fontsize size, int angle); 45 | # else 46 | XUtf8FontStruct* font; // X UTF-8 font information 47 | FL_EXPORT Fl_Xlib_Font_Descriptor(const char* xfontname); 48 | # if HAVE_GL 49 | char glok[64]; 50 | # endif // HAVE_GL 51 | # endif // USE_XFT 52 | virtual FL_EXPORT ~Fl_Xlib_Font_Descriptor(); 53 | }; 54 | 55 | //extern FL_EXPORT Fl_Font_Descriptor *fl_fontsize; // the currently selected one 56 | 57 | #if !USE_XFT 58 | struct Fl_Xlib_Fontdesc { // replaces Fl_Fontdesc 59 | const char *name; 60 | char fontname[128]; // "Pretty" font name 61 | Fl_Font_Descriptor *first; // linked list of sizes of this style 62 | char **xlist; // matched X font names 63 | int n; // size of xlist, negative = don't free xlist! 64 | }; 65 | #endif 66 | 67 | extern FL_EXPORT Fl_Fontdesc *fl_fonts; // the table 68 | 69 | #endif 70 | -------------------------------------------------------------------------------- /server/fltk/src/drivers/Xlib/Fl_Xlib_Copy_Surface_Driver.H: -------------------------------------------------------------------------------- 1 | // 2 | // Copy-to-clipboard code for the Fast Light Tool Kit (FLTK). 3 | // 4 | // Copyright 2022 by Bill Spitzak and others. 5 | // 6 | // This library is free software. Distribution and use rights are outlined in 7 | // the file "COPYING" which should have been included with this file. If this 8 | // file is missing or damaged, see the license at: 9 | // 10 | // https://www.fltk.org/COPYING.php 11 | // 12 | // Please see the following page on how to report bugs and issues: 13 | // 14 | // https://www.fltk.org/bugs.php 15 | // 16 | 17 | #ifndef FL_XLIB_COPY_SURFACE_DRIVER_H 18 | #define FL_XLIB_COPY_SURFACE_DRIVER_H 19 | 20 | #include 21 | #include 22 | #if FLTK_USE_CAIRO 23 | # include 24 | #endif // FLTK_USE_CAIRO 25 | 26 | class Fl_Image_Surface; 27 | 28 | class Fl_Xlib_Copy_Surface_Driver : public Fl_Copy_Surface_Driver { 29 | friend class Fl_Copy_Surface_Driver; 30 | void end_current() FL_OVERRIDE; 31 | protected: 32 | Fl_Image_Surface *xid; 33 | Window oldwindow; 34 | Fl_Xlib_Copy_Surface_Driver(int w, int h); 35 | ~Fl_Xlib_Copy_Surface_Driver(); 36 | void set_current() FL_OVERRIDE; 37 | void translate(int x, int y) FL_OVERRIDE; 38 | void untranslate() FL_OVERRIDE; 39 | #if FLTK_USE_CAIRO 40 | cairo_t *cairo_; 41 | #endif 42 | }; 43 | 44 | #endif // FL_XLIB_COPY_SURFACE_DRIVER_H 45 | -------------------------------------------------------------------------------- /server/fltk/src/drivers/Xlib/Fl_Xlib_Graphics_Driver_arci.cxx: -------------------------------------------------------------------------------- 1 | // 2 | // Arc (integer) drawing functions for the Fast Light Tool Kit (FLTK). 3 | // 4 | // Copyright 1998-2018 by Bill Spitzak and others. 5 | // 6 | // This library is free software. Distribution and use rights are outlined in 7 | // the file "COPYING" which should have been included with this file. If this 8 | // file is missing or damaged, see the license at: 9 | // 10 | // https://www.fltk.org/COPYING.php 11 | // 12 | // Please see the following page on how to report bugs and issues: 13 | // 14 | // https://www.fltk.org/bugs.php 15 | // 16 | 17 | #include 18 | #include "Fl_Xlib_Graphics_Driver.H" 19 | #include 20 | #include 21 | 22 | /** 23 | \file Fl_Xlib_Graphics_Driver_arci.cxx 24 | \brief Utility functions for drawing circles using integers 25 | */ 26 | 27 | void Fl_Xlib_Graphics_Driver::arc_unscaled(int x, int y, int w, int h, double a1, double a2) { 28 | if (w <= 0 || h <= 0) return; 29 | x += floor(offset_x_); 30 | y += floor(offset_y_); 31 | XDrawArc(fl_display, fl_window, gc_, x, y, w, h, int(a1*64),int((a2-a1)*64)); 32 | } 33 | 34 | void Fl_Xlib_Graphics_Driver::pie_unscaled(int x, int y, int w, int h, double a1,double a2) { 35 | if (w <= 2 || h <= 2) return; 36 | x += floor(offset_x_); 37 | y += floor(offset_y_); 38 | int extra = scale() >= 3 ? 1 : 0; 39 | XDrawArc(fl_display, fl_window, gc_, x+1+extra, y+1+extra, w-2-2*extra, h-2-2*extra, int(a1*64), int((a2-a1)*64)); 40 | XFillArc(fl_display, fl_window, gc_, x+1, y+1, w-2, h-2, int(a1*64), int((a2-a1)*64)); 41 | } 42 | -------------------------------------------------------------------------------- /server/fltk/src/drivers/Xlib/Fl_Xlib_Image_Surface_Driver.H: -------------------------------------------------------------------------------- 1 | // 2 | // Draw-to-image code for the Fast Light Tool Kit (FLTK). 3 | // 4 | // Copyright 2022-2023 by Bill Spitzak and others. 5 | // 6 | // This library is free software. Distribution and use rights are outlined in 7 | // the file "COPYING" which should have been included with this file. If this 8 | // file is missing or damaged, see the license at: 9 | // 10 | // https://www.fltk.org/COPYING.php 11 | // 12 | // Please see the following page on how to report bugs and issues: 13 | // 14 | // https://www.fltk.org/bugs.php 15 | // 16 | 17 | #ifndef FL_XLIB_IMAGE_SURFACE_DRIVER_H 18 | #define FL_XLIB_IMAGE_SURFACE_DRIVER_H 19 | 20 | #include 21 | #if FLTK_USE_CAIRO 22 | # include 23 | #endif // FLTK_USE_CAIRO 24 | 25 | class Fl_Xlib_Image_Surface_Driver : public Fl_Image_Surface_Driver { 26 | void end_current() FL_OVERRIDE; 27 | public: 28 | Window pre_window; 29 | Fl_Xlib_Image_Surface_Driver(int w, int h, int high_res, Fl_Offscreen off); 30 | ~Fl_Xlib_Image_Surface_Driver(); 31 | void set_current() FL_OVERRIDE; 32 | void translate(int x, int y) FL_OVERRIDE; 33 | void untranslate() FL_OVERRIDE; 34 | Fl_RGB_Image *image() FL_OVERRIDE; 35 | void mask(const Fl_RGB_Image *) FL_OVERRIDE; 36 | #if FLTK_USE_CAIRO 37 | cairo_t *cairo_; 38 | struct shape_data_type { 39 | double scale; 40 | cairo_pattern_t *mask_pattern_; 41 | cairo_t *bg_cr; 42 | } *shape_data_; 43 | #else 44 | struct shape_data_type { 45 | Pixmap background; 46 | Fl_RGB_Image* mask; 47 | } *shape_data_; 48 | #endif 49 | }; 50 | 51 | #endif // FL_XLIB_IMAGE_SURFACE_DRIVER_H 52 | -------------------------------------------------------------------------------- /server/fltk/src/fastarrow.h: -------------------------------------------------------------------------------- 1 | #define fastarrow_width 16 2 | #define fastarrow_height 16 3 | static const unsigned char fastarrow_bits[] = { 4 | 0x00, 0x00, 0x00, 0x07, 0xe0, 0x07, 0xfc, 0x03, 0xff, 0xff, 0xfc, 0x03, 5 | 0xe0, 0x07, 0x00, 0x07, 0xe0, 0x00, 0xe0, 0x07, 0xc0, 0x3f, 0xff, 0xff, 6 | 0xc0, 0x3f, 0xe0, 0x07, 0xe0, 0x00, 0x00, 0x00}; 7 | -------------------------------------------------------------------------------- /server/fltk/src/filename_expand.cxx: -------------------------------------------------------------------------------- 1 | // 2 | // Filename expansion routines for the Fast Light Tool Kit (FLTK). 3 | // 4 | // Copyright 1998-2010 by Bill Spitzak and others. 5 | // 6 | // This library is free software. Distribution and use rights are outlined in 7 | // the file "COPYING" which should have been included with this file. If this 8 | // file is missing or damaged, see the license at: 9 | // 10 | // https://www.fltk.org/COPYING.php 11 | // 12 | // Please see the following page on how to report bugs and issues: 13 | // 14 | // https://www.fltk.org/bugs.php 15 | // 16 | 17 | #include "Fl_System_Driver.H" 18 | #include 19 | 20 | /** Expands a filename containing shell variables and tilde (~). 21 | Currently handles these variants: 22 | \code 23 | "~username" // if 'username' does not exist, result will be unchanged 24 | "~/file" 25 | "$VARNAME" // does NOT handle ${VARNAME} 26 | \endcode 27 | 28 | \b Examples: 29 | \code 30 | #include 31 | [..] 32 | putenv("TMPDIR=/var/tmp"); 33 | fl_filename_expand(out, sizeof(out), "~fred/.cshrc"); // out="/usr/fred/.cshrc" 34 | fl_filename_expand(out, sizeof(out), "~/.cshrc"); // out="/usr//.cshrc" 35 | fl_filename_expand(out, sizeof(out), "$TMPDIR/foo.txt"); // out="/var/tmp/foo.txt" 36 | \endcode 37 | \param[out] to resulting expanded filename 38 | \param[in] tolen size of the expanded filename buffer 39 | \param[in] from filename containing shell variables 40 | \return 0 if no change, non zero otherwise 41 | */ 42 | int fl_filename_expand(char *to,int tolen, const char *from) { 43 | return Fl::system_driver()->filename_expand(to, tolen, from); 44 | } 45 | -------------------------------------------------------------------------------- /server/fltk/src/filename_ext.cxx: -------------------------------------------------------------------------------- 1 | // 2 | // Filename extension routines for the Fast Light Tool Kit (FLTK). 3 | // 4 | // Copyright 1998-2010 by Bill Spitzak and others. 5 | // 6 | // This library is free software. Distribution and use rights are outlined in 7 | // the file "COPYING" which should have been included with this file. If this 8 | // file is missing or damaged, see the license at: 9 | // 10 | // https://www.fltk.org/COPYING.php 11 | // 12 | // Please see the following page on how to report bugs and issues: 13 | // 14 | // https://www.fltk.org/bugs.php 15 | // 16 | 17 | #include "Fl_System_Driver.H" 18 | #include 19 | 20 | /** Gets the extension of a filename. 21 | \code 22 | #include 23 | [..] 24 | const char *out; 25 | out = fl_filename_ext("/some/path/foo.txt"); // result: ".txt" 26 | out = fl_filename_ext("/some/path/foo"); // result: NULL 27 | \endcode 28 | \param[in] buf the filename to be parsed 29 | \return a pointer to the extension (including '.') if any or NULL otherwise 30 | */ 31 | const char *fl_filename_ext(const char *buf) { 32 | return Fl::system_driver()->filename_ext(buf); 33 | } 34 | 35 | 36 | /** 37 | \cond DriverDev 38 | \addtogroup DriverDeveloper 39 | \{ 40 | */ 41 | 42 | /** 43 | Finds a filename extension. 44 | 45 | The default implementation assumes that the last `.` character separates 46 | the extension from the basename of a file. 47 | 48 | \see fl_filename_ext(const char*) 49 | */ 50 | const char *Fl_System_Driver::filename_ext(const char *buf) { 51 | const char *q = 0; 52 | const char *p = buf; 53 | for (p=buf; *p; p++) { 54 | if (*p == '/') q = 0; 55 | else if (*p == '.') q = p; 56 | } 57 | return q ? q : p; 58 | } 59 | 60 | /** 61 | \} 62 | \endcond 63 | */ 64 | -------------------------------------------------------------------------------- /server/fltk/src/filename_setext.cxx: -------------------------------------------------------------------------------- 1 | // 2 | // Filename extension routines for the Fast Light Tool Kit (FLTK). 3 | // 4 | // Copyright 1998-2010 by Bill Spitzak and others. 5 | // 6 | // This library is free software. Distribution and use rights are outlined in 7 | // the file "COPYING" which should have been included with this file. If this 8 | // file is missing or damaged, see the license at: 9 | // 10 | // https://www.fltk.org/COPYING.php 11 | // 12 | // Please see the following page on how to report bugs and issues: 13 | // 14 | // https://www.fltk.org/bugs.php 15 | // 16 | 17 | // Replace .ext with new extension 18 | 19 | #include 20 | #include "flstring.h" 21 | 22 | /** 23 | Replaces the extension in \p buf of max.
24 | size \p buflen with the extension in \p ext.
25 | If there's no '.' in \p buf, \p ext is appended.
26 | If \p ext is NULL, behaves as if it were an empty string (""). 27 | 28 | \b Example 29 | \code 30 | #include 31 | [..] 32 | char buf[FL_PATH_MAX] = "/path/myfile.cxx"; 33 | fl_filename_setext(buf, sizeof(buf), ".txt"); // buf[] becomes "/path/myfile.txt" 34 | \endcode 35 | 36 | \return buf itself for calling convenience. 37 | */ 38 | char *fl_filename_setext(char *buf, int buflen, const char *ext) { 39 | char *q = (char *)fl_filename_ext(buf); 40 | if (ext) { 41 | strlcpy(q,ext,buflen - (q - buf)); 42 | } else *q = 0; 43 | return(buf); 44 | } 45 | -------------------------------------------------------------------------------- /server/fltk/src/fl_cursor_help.xpm: -------------------------------------------------------------------------------- 1 | /* XPM */ 2 | static const char * const fl_cursor_help_xpm[] = { 3 | "16 27 9 1", 4 | " c None", 5 | ". c #FFFFFF", 6 | "+ c #DBDBDB", 7 | "@ c #242424", 8 | "# c #000000", 9 | "$ c #494949", 10 | "% c #6D6D6D", 11 | "& c #929292", 12 | "* c #B6B6B6", 13 | " ", 14 | ". ", 15 | ".+ ", 16 | ".@+ ", 17 | ".#@+ ", 18 | ".##@. ", 19 | ".###@. ", 20 | ".####@. ", 21 | ".#####$. ", 22 | ".######$. ", 23 | ".#######$. ", 24 | ".#####@@@%. ", 25 | ".#####+..... ", 26 | ".##$%#%. ", 27 | ".#$..@#. ", 28 | ".$. .&#%. ", 29 | ".. .##. .... ", 30 | ". .&#.+%$%&. ", 31 | " ...*#@##%.", 32 | " ++.*#@.", 33 | " .%#$.", 34 | " .%#@. ", 35 | " .##+ ", 36 | " .++. ", 37 | " +##. ", 38 | " +##. ", 39 | " .... "}; 40 | -------------------------------------------------------------------------------- /server/fltk/src/fl_cursor_nesw.xpm: -------------------------------------------------------------------------------- 1 | /* XPM */ 2 | static const char * const fl_cursor_nesw_xpm[] = { 3 | "15 15 28 1", 4 | " c None", 5 | ". c #FFFFFF", 6 | "+ c #767676", 7 | "@ c #000000", 8 | "# c #4E4E4E", 9 | "$ c #0C0C0C", 10 | "% c #494949", 11 | "& c #4D4D4D", 12 | "* c #1B1B1B", 13 | "= c #515151", 14 | "- c #646464", 15 | "; c #363636", 16 | "> c #6A6A6A", 17 | ", c #545454", 18 | "' c #585858", 19 | ") c #242424", 20 | "! c #797979", 21 | "~ c #2E2E2E", 22 | "{ c #444444", 23 | "] c #3B3B3B", 24 | "^ c #0A0A0A", 25 | "/ c #595959", 26 | "( c #F7F7F7", 27 | "_ c #080808", 28 | ": c #6B6B6B", 29 | "< c #FDFDFD", 30 | "[ c #FCFCFC", 31 | "} c #FEFEFE", 32 | " ..........", 33 | " .+@@@@@@.", 34 | " .#@@@@@.", 35 | " .$@@@@.", 36 | " .%@@@@@.", 37 | ". .&@@@*@@.", 38 | ".. .=@@@-.;@.", 39 | ".>. .,@@@'. .).", 40 | ".@!.'@@@#. ..", 41 | ".@@~@@@{. .", 42 | ".@@@@@]. ", 43 | ".@@@@^. ", 44 | ".@@@@@/( ", 45 | ".______:( ", 46 | "<[[[[[[[[} "}; 47 | -------------------------------------------------------------------------------- /server/fltk/src/fl_cursor_none.xpm: -------------------------------------------------------------------------------- 1 | /* XPM */ 2 | static const char * const fl_cursor_none_xpm[] = { 3 | "15 15 1 1", 4 | " c None", 5 | " ", 6 | " ", 7 | " ", 8 | " ", 9 | " ", 10 | " ", 11 | " ", 12 | " ", 13 | " ", 14 | " ", 15 | " ", 16 | " ", 17 | " ", 18 | " ", 19 | " "}; 20 | -------------------------------------------------------------------------------- /server/fltk/src/fl_cursor_nwse.xpm: -------------------------------------------------------------------------------- 1 | /* XPM */ 2 | static const char * const fl_cursor_nwse_xpm[] = { 3 | "15 15 28 1", 4 | " c None", 5 | ". c #FFFFFF", 6 | "+ c #000000", 7 | "@ c #767676", 8 | "# c #4E4E4E", 9 | "$ c #0C0C0C", 10 | "% c #494949", 11 | "& c #1B1B1B", 12 | "* c #4D4D4D", 13 | "= c #363636", 14 | "- c #646464", 15 | "; c #515151", 16 | "> c #242424", 17 | ", c #585858", 18 | "' c #545454", 19 | ") c #6A6A6A", 20 | "! c #797979", 21 | "~ c #444444", 22 | "{ c #2E2E2E", 23 | "] c #3B3B3B", 24 | "^ c #0A0A0A", 25 | "/ c #F7F7F7", 26 | "( c #595959", 27 | "_ c #6B6B6B", 28 | ": c #080808", 29 | "< c #FEFEFE", 30 | "[ c #FCFCFC", 31 | "} c #FDFDFD", 32 | ".......... ", 33 | ".++++++@. ", 34 | ".+++++#. ", 35 | ".++++$. ", 36 | ".+++++%. ", 37 | ".++&+++*. .", 38 | ".+=.-+++;. ..", 39 | ".>. .,+++'. .).", 40 | ".. .#+++,.!+.", 41 | ". .~+++{++.", 42 | " .]+++++.", 43 | " .^++++.", 44 | " /(+++++.", 45 | " /_::::::.", 46 | " <[[[[[[[[}"}; 47 | -------------------------------------------------------------------------------- /server/fltk/src/fl_cursor_wait.xpm: -------------------------------------------------------------------------------- 1 | /* XPM */ 2 | static const char * const fl_cursor_wait_xpm[] = { 3 | /* width height ncolors chars_per_pixel */ 4 | "13 18 3 1", 5 | /* colors */ 6 | " c None", 7 | ". c #FFFFFF", 8 | "B c #000000", 9 | /* pixels */ 10 | " ........ ", 11 | " .BBBBBB. ", 12 | " .BBBBBB. ", 13 | " .BBBBBB. ", 14 | " .BBBBBB. ", 15 | " .B......B. ", 16 | ".B....B...B. ", 17 | ".B....B...B. ", 18 | ".B....B...BB.", 19 | ".B.BBBB...BB.", 20 | ".B........B. ", 21 | ".B........B. ", 22 | " .B......B. ", 23 | " .BBBBBB. ", 24 | " .BBBBBB. ", 25 | " .BBBBBB. ", 26 | " .BBBBBB. ", 27 | " ........ ", 28 | }; 29 | -------------------------------------------------------------------------------- /server/fltk/src/fl_encoding_latin1.cxx: -------------------------------------------------------------------------------- 1 | // 2 | // Convert Windows-1252 (Latin-1) encoded text to the local encoding. 3 | // 4 | // Copyright 1998-2021 by Bill Spitzak and others. 5 | // 6 | // This library is free software. Distribution and use rights are outlined in 7 | // the file "COPYING" which should have been included with this file. If this 8 | // file is missing or damaged, see the license at: 9 | // 10 | // https://www.fltk.org/COPYING.php 11 | // 12 | // Please see the following page on how to report bugs and issues: 13 | // 14 | // https://www.fltk.org/bugs.php 15 | // 16 | 17 | #include 18 | #include 19 | #include 20 | #include "Fl_System_Driver.H" 21 | #include 22 | #include 23 | #include "flstring.h" 24 | 25 | /** 26 | \cond DriverDev 27 | \addtogroup DriverDeveloper 28 | \{ 29 | */ 30 | 31 | /** 32 | Default implementation of latin-to-local text conversion. 33 | 34 | The default implementation returns the original text. This method should 35 | be reimplemented by drivers for platforms that commonly use latin 36 | text encoding. 37 | 38 | \see fl_latin1_to_local(const char *, int) 39 | */ 40 | const char *Fl_System_Driver::latin1_to_local(const char *t, int) 41 | { 42 | return t; 43 | } 44 | 45 | /** 46 | Default implementation of local-to-latin text conversion. 47 | 48 | The default implementation returns the original text. This method should 49 | be reimplemented by drivers for platforms that commonly use latin 50 | text encoding. 51 | 52 | \see fl_local_to_latin1(const char *, int) 53 | */ 54 | const char *Fl_System_Driver::local_to_latin1(const char *t, int) 55 | { 56 | return t; 57 | } 58 | 59 | /** 60 | \} 61 | \endcond 62 | */ 63 | 64 | const char *fl_latin1_to_local(const char *t, int n) 65 | { 66 | return Fl::system_driver()->latin1_to_local(t, n); 67 | } 68 | 69 | const char *fl_local_to_latin1(const char *t, int n) 70 | { 71 | return Fl::system_driver()->local_to_latin1(t, n); 72 | } 73 | -------------------------------------------------------------------------------- /server/fltk/src/fl_oxy.h: -------------------------------------------------------------------------------- 1 | // 2 | // "Oxy" Scheme drawing routines for the Fast Light Tool Kit (FLTK). 3 | // 4 | // Copyright 2011 by Dmitrij K. aka "kdiman" 5 | // Copyright 2012-2022 by Bill Spitzak and others. 6 | // 7 | // This library is free software. Distribution and use rights are outlined in 8 | // the file "COPYING" which should have been included with this file. If this 9 | // file is missing or damaged, see the license at: 10 | // 11 | // https://www.fltk.org/COPYING.php 12 | // 13 | // Please report all bugs and problems on the following page: 14 | // 15 | // https://www.fltk.org/str.php 16 | // 17 | 18 | #ifndef fl_oxy_h 19 | #define fl_oxy_h 20 | 21 | #include 22 | 23 | // draw an arrow GUI element for the 'oxy' scheme 24 | // 25 | // bb bounding box 26 | // t arrow type 27 | // o orientation 28 | // c arrow color 29 | 30 | extern FL_EXPORT void oxy_arrow(Fl_Rect bb, 31 | Fl_Arrow_Type t, Fl_Orientation o, 32 | Fl_Color col); 33 | 34 | #endif // fl_oxy_h 35 | -------------------------------------------------------------------------------- /server/fltk/src/fl_rect.cxx: -------------------------------------------------------------------------------- 1 | // 2 | // Rectangle drawing routines for the Fast Light Tool Kit (FLTK). 3 | // 4 | // Copyright 1998-2018 by Bill Spitzak and others. 5 | // 6 | // This library is free software. Distribution and use rights are outlined in 7 | // the file "COPYING" which should have been included with this file. If this 8 | // file is missing or damaged, see the license at: 9 | // 10 | // https://www.fltk.org/COPYING.php 11 | // 12 | // Please see the following page on how to report bugs and issues: 13 | // 14 | // https://www.fltk.org/bugs.php 15 | // 16 | 17 | /** 18 | \file fl_rect.cxx 19 | \brief Drawing and clipping routines for rectangles. 20 | */ 21 | 22 | // These routines from fl_draw.H are used by the standard boxtypes 23 | // and thus are always linked into an fltk program. 24 | // Also all fl_clip routines, since they are always linked in so 25 | // that minimal update works. 26 | 27 | #include 28 | #include 29 | 30 | // ----------------------------------------------------------------------------- 31 | // all driver code is now in drivers/XXX/Fl_XXX_Graphics_Driver_xyz.cxx 32 | // ----------------------------------------------------------------------------- 33 | 34 | /** 35 | \cond DriverDev 36 | \addtogroup DriverDeveloper 37 | \{ 38 | */ 39 | 40 | /** see fl_restore_clip() */ 41 | void Fl_Graphics_Driver::restore_clip() { 42 | fl_clip_state_number++; 43 | } 44 | 45 | /** see fl_clip_region(Fl_Region) */ 46 | void Fl_Graphics_Driver::clip_region(Fl_Region r) { 47 | Fl_Region oldr = rstack[rstackptr]; 48 | if (oldr) XDestroyRegion(oldr); 49 | rstack[rstackptr] = r; 50 | restore_clip(); 51 | } 52 | 53 | 54 | /** see fl_clip_region(void) */ 55 | Fl_Region Fl_Graphics_Driver::clip_region() { 56 | return rstack[rstackptr]; 57 | } 58 | 59 | /** 60 | \} 61 | \endcond 62 | */ 63 | -------------------------------------------------------------------------------- /server/fltk/src/fl_shadow_box.cxx: -------------------------------------------------------------------------------- 1 | // 2 | // Shadow box drawing routines for the Fast Light Tool Kit (FLTK). 3 | // 4 | // Copyright 1998-2011 by Bill Spitzak and others. 5 | // 6 | // This library is free software. Distribution and use rights are outlined in 7 | // the file "COPYING" which should have been included with this file. If this 8 | // file is missing or damaged, see the license at: 9 | // 10 | // https://www.fltk.org/COPYING.php 11 | // 12 | // Please see the following page on how to report bugs and issues: 13 | // 14 | // https://www.fltk.org/bugs.php 15 | // 16 | 17 | #include 18 | #include 19 | 20 | // Global parameters for box drawing algorithm: 21 | // 22 | // BW = box shadow width 23 | #define BW (Fl::box_shadow_width()) 24 | 25 | static void fl_shadow_frame(int x, int y, int w, int h, Fl_Color c) { 26 | fl_color(FL_DARK3); 27 | fl_rectf(x+BW, y+h-BW, w - BW, BW); 28 | fl_rectf(x+w-BW, y+BW, BW, h - BW); 29 | Fl::set_box_color(c); 30 | fl_rect(x,y,w-BW,h-BW); 31 | } 32 | 33 | static void fl_shadow_box(int x, int y, int w, int h, Fl_Color c) { 34 | Fl::set_box_color(c); 35 | fl_rectf(x,y,w-BW,h-BW); 36 | fl_shadow_frame(x,y,w,h,FL_GRAY0); 37 | } 38 | 39 | extern void fl_internal_boxtype(Fl_Boxtype, Fl_Box_Draw_F*, Fl_Box_Draw_Focus_F* =NULL); 40 | Fl_Boxtype fl_define_FL_SHADOW_BOX() { 41 | fl_internal_boxtype(_FL_SHADOW_FRAME, fl_shadow_frame); 42 | fl_internal_boxtype(_FL_SHADOW_BOX, fl_shadow_box); 43 | return _FL_SHADOW_BOX; 44 | } 45 | -------------------------------------------------------------------------------- /server/fltk/src/fl_string_functions.cxx: -------------------------------------------------------------------------------- 1 | /* 2 | * Platform agnostic string portability functions for the Fast Light Tool Kit (FLTK). 3 | * 4 | * Copyright 2020 by Bill Spitzak and others. 5 | * 6 | * This library is free software. Distribution and use rights are outlined in 7 | * the file "COPYING" which should have been included with this file. If this 8 | * file is missing or damaged, see the license at: 9 | * 10 | * https://www.fltk.org/COPYING.php 11 | * 12 | * Please see the following page on how to report bugs and issues: 13 | * 14 | * https://www.fltk.org/bugs.php 15 | */ 16 | 17 | #include 18 | #include // strdup/_strdup 19 | #include "Fl_System_Driver.H" 20 | 21 | /** 22 | Cross platform interface to POSIX function strdup(). 23 | 24 | The fl_strdup() function returns a pointer to a new string which is 25 | a duplicate of the string 's'. Memory for the new string is obtained 26 | with malloc(3), and can be freed with free(3). 27 | 28 | Implementation: 29 | - POSIX: strdup() 30 | - WinAPI: _strdup() 31 | */ 32 | char *fl_strdup(const char *s) { 33 | return Fl::system_driver()->strdup(s); 34 | } 35 | 36 | /* 37 | * 'fl_strlcpy()' - Safely copy two strings. 38 | */ 39 | size_t /* O - Length of string */ 40 | fl_strlcpy(char *dst, /* O - Destination string */ 41 | const char *src, /* I - Source string */ 42 | size_t size) { /* I - Size of destination string buffer */ 43 | size_t srclen; /* Length of source string */ 44 | 45 | 46 | /* 47 | * Figure out how much room is needed... 48 | */ 49 | 50 | size --; 51 | 52 | srclen = strlen(src); 53 | 54 | /* 55 | * Copy the appropriate amount... 56 | */ 57 | 58 | if (srclen > size) srclen = size; 59 | 60 | memcpy(dst, src, srclen); 61 | dst[srclen] = '\0'; 62 | 63 | return (srclen); 64 | } 65 | 66 | 67 | -------------------------------------------------------------------------------- /server/fltk/src/mediumarrow.h: -------------------------------------------------------------------------------- 1 | #define mediumarrow_width 16 2 | #define mediumarrow_height 16 3 | static const unsigned char mediumarrow_bits[] = { 4 | 0x40, 0x00, 0x60, 0x00, 0x70, 0x00, 0x78, 0x00, 0xfc, 0x3f, 0x78, 0x00, 5 | 0x70, 0x00, 0x60, 0x02, 0x40, 0x06, 0x00, 0x0e, 0x00, 0x1e, 0xfc, 0x3f, 6 | 0x00, 0x1e, 0x00, 0x0e, 0x00, 0x06, 0x00, 0x02}; 7 | -------------------------------------------------------------------------------- /server/fltk/src/print_button.h: -------------------------------------------------------------------------------- 1 | // 2 | // Header for "Print Window" functions for the Fast Light Tool Kit (FLTK). 3 | // 4 | // Copyright 1998-2022 by Bill Spitzak and others. 5 | // 6 | // This library is free software. Distribution and use rights are outlined in 7 | // the file "COPYING" which should have been included with this file. If this 8 | // file is missing or damaged, see the license at: 9 | // 10 | // https://www.fltk.org/COPYING.php 11 | // 12 | // Please see the following page on how to report bugs and issues: 13 | // 14 | // https://www.fltk.org/bugs.php 15 | // 16 | 17 | #ifndef _SRC_FL_PRINT_BUTTON_H_ 18 | #define _SRC_FL_PRINT_BUTTON_H_ 19 | 20 | #include 21 | 22 | // These are all internal functions, do not FL_EXPORT these functions! 23 | // These functions are mplemented in src/print_button.cxx 24 | 25 | // Create and initialize the "Print/copy front window" dialog window 26 | 27 | int fl_create_print_window(); 28 | 29 | // Print a window or copy its contents to the clipboard. 30 | 31 | int fl_print_or_copy_window(Fl_Window *win, bool grab_decoration, int mode); 32 | 33 | #endif // _SRC_FL_PRINT_BUTTON_H_ 34 | -------------------------------------------------------------------------------- /server/fltk/src/slowarrow.h: -------------------------------------------------------------------------------- 1 | #define slowarrow_width 16 2 | #define slowarrow_height 16 3 | static const unsigned char slowarrow_bits[] = { 4 | 0x40, 0x00, 0x40, 0x00, 0x60, 0x00, 0x60, 0x00, 0xf0, 0x0f, 0x60, 0x00, 5 | 0x60, 0x00, 0x40, 0x02, 0x40, 0x02, 0x00, 0x06, 0x00, 0x06, 0xf0, 0x0f, 6 | 0x00, 0x06, 0x00, 0x06, 0x00, 0x02, 0x00, 0x02}; 7 | -------------------------------------------------------------------------------- /server/fltk/src/utf8_internal.h: -------------------------------------------------------------------------------- 1 | /* 2 | * Internal UTF-8 header file for the Fast Light Tool Kit (FLTK). 3 | * 4 | * Copyright 1998-2016 by Bill Spitzak and others. 5 | * 6 | * This library is free software. Distribution and use rights are outlined in 7 | * the file "COPYING" which should have been included with this file. If this 8 | * file is missing or damaged, see the license at: 9 | * 10 | * https://www.fltk.org/COPYING.php 11 | * 12 | * Please see the following page on how to report bugs and issues: 13 | * 14 | * https://www.fltk.org/bugs.php 15 | */ 16 | 17 | /* 18 | ---------------- 19 | Note to editors: 20 | ---------------- 21 | 22 | This file may only contain common, platform-independent function 23 | declarations used internally in FLTK. It may be #included everywhere 24 | in source files in the library, but not in public header files. 25 | */ 26 | 27 | #ifndef _SRC__FL_UTF8_H 28 | #define _SRC__FL_UTF8_H 29 | 30 | # ifdef __cplusplus 31 | extern "C" { 32 | # endif 33 | 34 | unsigned short 35 | XUtf8IsNonSpacing( 36 | unsigned int ucs); 37 | 38 | unsigned short 39 | XUtf8IsRightToLeft( 40 | unsigned int ucs); 41 | 42 | 43 | int 44 | XUtf8Tolower( 45 | int ucs); 46 | 47 | int 48 | XUtf8Toupper( 49 | int ucs); 50 | 51 | 52 | # ifdef __cplusplus 53 | } 54 | # endif 55 | 56 | #endif /* _SRC__FL_UTF8_H */ 57 | -------------------------------------------------------------------------------- /server/fltk/src/xutf8/COPYING: -------------------------------------------------------------------------------- 1 | * Author: Jean-Marc Lienher ( http://oksid.ch ) 2 | * Copyright 2000-2003 by O'ksi'D. 3 | * 4 | * This library is free software. Distribution and use rights are outlined in 5 | * the file "COPYING" which should have been included with this file. If this 6 | * file is missing or damaged, see the license at: 7 | * 8 | * https://www.fltk.org/COPYING.php 9 | * 10 | * Please see the following page on how to report bugs and issues: 11 | * 12 | * https://www.fltk.org/bugs.php 13 | 14 | 15 | lcUniConv directory: 16 | 17 | Copyright (c) 1999-2000 Free Software Foundation, Inc. 18 | 19 | Permission is hereby granted, free of charge, to any person obtaining a copy 20 | of this software and associated documentation files (the "Software"), to deal 21 | in the Software without restriction, including without limitation the rights 22 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 23 | copies of the Software, and to permit persons to whom the Software is 24 | furnished to do so, subject to the following conditions: 25 | 26 | The above copyright notice and this permission notice shall be included in 27 | all copies or substantial portions of the Software. 28 | 29 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 30 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 31 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 32 | FREE SOFTWARE FOUNDATION BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, 33 | WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR 34 | IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. 35 | 36 | Except as contained in this notice, the name of the Free Software Foundation 37 | shall not be used in advertising or otherwise to promote the sale, use or 38 | other dealings in this Software without prior written authorization from the 39 | Free Software Foundation. 40 | 41 | 42 | -------------------------------------------------------------------------------- /server/fltk/src/xutf8/README.txt: -------------------------------------------------------------------------------- 1 | --------------------------------------------------------------------------- 2 | Important note: this file is outdated (as of FLTK 1.3.x, 2012 and later). 3 | Many things have been changed meanwhile. 4 | Use all information with care! 5 | --------------------------------------------------------------------------- 6 | 7 | 8 | 9 | supported encodings : 10 | --------------------- 11 | iso10646-1 12 | iso8859-1 13 | iso8859-2 14 | iso8859-3 15 | iso8859-4 16 | iso8859-5 17 | iso8859-6 18 | iso8859-7 19 | iso8859-8 20 | iso8859-9 21 | iso8859-10 22 | iso8859-11 23 | iso8859-13 24 | iso8859-14 25 | iso8859-15 26 | koi8-r 27 | koi8-u 28 | big5-0 29 | gbk 30 | gb2312.1980-0 31 | jisx0201.1976-0 32 | jisx0208.1983-0 33 | jisx0212.1990-0 34 | ksc5601.1987-0 35 | symbol 36 | dingbats 37 | 38 | 39 | 40 | ORIGINAL FILES : 41 | ================ 42 | 43 | The directory lcUniConv is copied from the xfree project cvs system. 44 | ( 45 | export CVS_RSH=ssh 46 | export CVSROOT=anoncvs@anoncvs.xfree86.org:/cvs 47 | cvs checkout xc/lib/X11/lcUniConv 48 | password: anoncvs 49 | ) 50 | 51 | The file imKStoUCS.c is copied from the xfree project cvs system. 52 | ( 53 | export CVS_RSH=ssh 54 | export CVSROOT=anoncvs@anoncvs.xfree86.org:/cvs 55 | cvs checkout xc/lib/X11 56 | password: anoncvs 57 | ) 58 | -------------------------------------------------------------------------------- /server/fltk/src/xutf8/Ximint.h: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/VirtualGL/virtualgl/edc00ae625029af16696a89e735bbfec9b909b15/server/fltk/src/xutf8/Ximint.h -------------------------------------------------------------------------------- /server/fltk/src/xutf8/Xlibint.h: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/VirtualGL/virtualgl/edc00ae625029af16696a89e735bbfec9b909b15/server/fltk/src/xutf8/Xlibint.h -------------------------------------------------------------------------------- /server/fltk/src/xutf8/is_spacing.c: -------------------------------------------------------------------------------- 1 | /* 2 | * Author: Jean-Marc Lienher ( http://oksid.ch ) 3 | * Copyright 2000-2010 by O'ksi'D. 4 | * 5 | * This library is free software. Distribution and use rights are outlined in 6 | * the file "COPYING" which should have been included with this file. If this 7 | * file is missing or damaged, see the license at: 8 | * 9 | * https://www.fltk.org/COPYING.php 10 | * 11 | * Please see the following page on how to report bugs and issues: 12 | * 13 | * https://www.fltk.org/bugs.php 14 | */ 15 | 16 | /* 17 | * This file is required on all platforms for UTF-8 support 18 | */ 19 | 20 | #include "../utf8_internal.h" 21 | 22 | /* include UCS tables */ 23 | #include "headers/spacing.h" 24 | 25 | unsigned short 26 | XUtf8IsNonSpacing(unsigned int ucs) { 27 | 28 | if (ucs <= 0x0361) { 29 | if (ucs >= 0x0300) return ucs_table_0300[ucs - 0x0300]; 30 | return 0; 31 | } 32 | 33 | if (ucs <= 0x0486) { 34 | if (ucs >= 0x0483) return ucs_table_0483[ucs - 0x0483]; 35 | return 0; 36 | } 37 | 38 | if (ucs <= 0x05C4) { 39 | if (ucs >= 0x0591) return ucs_table_0591[ucs - 0x0591]; 40 | return 0; 41 | } 42 | 43 | if (ucs <= 0x06ED) { 44 | if (ucs >= 0x064B) return ucs_table_064B[ucs - 0x064B]; 45 | return 0; 46 | } 47 | 48 | if (ucs <= 0x0D4D) { 49 | if (ucs >= 0x0901) return ucs_table_0901[ucs - 0x0901]; 50 | return 0; 51 | } 52 | 53 | if (ucs <= 0x0FB9) { 54 | if (ucs >= 0x0E31) return ucs_table_0E31[ucs - 0x0E31]; 55 | return 0; 56 | } 57 | 58 | if (ucs <= 0x20E1) { 59 | if (ucs >= 0x20D0) return ucs_table_20D0[ucs - 0x20D0]; 60 | return 0; 61 | } 62 | 63 | if (ucs <= 0x309A) { 64 | if (ucs >= 0x302A) return ucs_table_302A[ucs - 0x302A]; 65 | return 0; 66 | } 67 | 68 | if (ucs <= 0xFB1E) { 69 | if (ucs >= 0xFB1E) return ucs_table_FB1E[ucs - 0xFB1E]; 70 | return 0; 71 | } 72 | 73 | if (ucs <= 0xFE23) { 74 | if (ucs >= 0xFE20) return ucs_table_FE20[ucs - 0xFE20]; 75 | return 0; 76 | } 77 | 78 | return 0; 79 | } 80 | -------------------------------------------------------------------------------- /server/fltk/src/xutf8/keysym2Ucs.c: -------------------------------------------------------------------------------- 1 | /* 2 | * Author: Jean-Marc Lienher ( http://oksid.ch ) 3 | * Copyright 2000-2003 by O'ksi'D. 4 | * 5 | * This library is free software. Distribution and use rights are outlined in 6 | * the file "COPYING" which should have been included with this file. If this 7 | * file is missing or damaged, see the license at: 8 | * 9 | * https://www.fltk.org/COPYING.php 10 | * 11 | * Please see the following page on how to report bugs and issues: 12 | * 13 | * https://www.fltk.org/bugs.php 14 | */ 15 | 16 | #include "../Xutf8.h" 17 | #include "imKStoUCS.c" 18 | 19 | long XKeysymToUcs(KeySym keysym) { 20 | return (long) KeySymToUcs4(keysym); 21 | } 22 | -------------------------------------------------------------------------------- /server/fltk/src/xutf8/lcUniConv/COPYRIGHT: -------------------------------------------------------------------------------- 1 | This notice applies to the files in this directory. They are taken from 2 | the libiconv-1.1 package, which is covered by the LGPL license. The files 3 | in this directory have been placed under the following copyright, with 4 | permission from the Free Software Foundation. 5 | 6 | 7 | Copyright (c) 1999-2000 Free Software Foundation, Inc. 8 | 9 | Permission is hereby granted, free of charge, to any person obtaining a copy 10 | of this software and associated documentation files (the "Software"), to deal 11 | in the Software without restriction, including without limitation the rights 12 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 13 | copies of the Software, and to permit persons to whom the Software is 14 | furnished to do so, subject to the following conditions: 15 | 16 | The above copyright notice and this permission notice shall be included in 17 | all copies or substantial portions of the Software. 18 | 19 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 20 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 21 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 22 | FREE SOFTWARE FOUNDATION BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, 23 | WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR 24 | IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. 25 | 26 | Except as contained in this notice, the name of the Free Software Foundation 27 | shall not be used in advertising or otherwise to promote the sale, use or 28 | other dealings in this Software without prior written authorization from the 29 | Free Software Foundation. 30 | 31 | 32 | Notes: 33 | 34 | 1. This copyright applies only to the files in this directory, and not to 35 | the remaining files in libiconv. 36 | 37 | 2. The Free Software Foundation does not encourage the use of the above 38 | license for newly written software. 39 | 40 | -------------------------------------------------------------------------------- /server/fltk/src/xutf8/lcUniConv/README.txt: -------------------------------------------------------------------------------- 1 | $XFree86: xc/lib/X11/lcUniConv/README,v 1.3 2003/10/24 15:34:01 tsi Exp $ 2 | 3 | The files in this directory are taken from the libiconv-1.1 package. 4 | 5 | The *.h files were generated from tables (mostly from ftp.unicode.org) using 6 | the programs '8bit_tab_to_h.c', 'cjk_tab_to_h.c' and 'gbk_tab_to_h.c'. On some of them, further 7 | optimizations were applied by hand. 8 | 9 | If you find a bug in these files, instead of modifying them in XFree86 10 | and let it diverge from libiconv, please notify the libiconv maintainer 11 | (currently ) so he can fix both in synch. 12 | 13 | -------------------------------------------------------------------------------- /server/fltk/src/xutf8/lcUniConv/jisx0201.h: -------------------------------------------------------------------------------- 1 | /* $XFree86: xc/lib/X11/lcUniConv/jisx0201.h,v 1.3 2000/11/29 17:40:33 dawes Exp $ */ 2 | 3 | /* 4 | * JISX0201.1976-0 5 | */ 6 | #ifdef NEED_TOWC 7 | 8 | static int 9 | jisx0201_mbtowc (conv_t conv, ucs4_t *pwc, const unsigned char *s, int n) 10 | { 11 | unsigned char c = *s; 12 | if (c < 0x80) { 13 | if (c == 0x5c) 14 | *pwc = (ucs4_t) 0x00a5; 15 | else if (c == 0x7e) 16 | *pwc = (ucs4_t) 0x203e; 17 | else 18 | *pwc = (ucs4_t) c; 19 | return 1; 20 | } else { 21 | if (c >= 0xa1 && c < 0xe0) { 22 | *pwc = (ucs4_t) c + 0xfec0; 23 | return 1; 24 | } 25 | } 26 | return RET_ILSEQ; 27 | } 28 | #endif /* NEED_TOWC */ 29 | 30 | #ifdef NEED_TOMB 31 | 32 | static int 33 | jisx0201_wctomb (conv_t conv, unsigned char *r, ucs4_t wc, int n) 34 | { 35 | (void)conv; (void)n; 36 | if (wc < 0x0080 && !(wc == 0x005c || wc == 0x007e)) { 37 | *r = wc; 38 | return 1; 39 | } 40 | if (wc == 0x00a5) { 41 | *r = 0x5c; 42 | return 1; 43 | } 44 | if (wc == 0x203e) { 45 | *r = 0x7e; 46 | return 1; 47 | } 48 | if (wc >= 0xff61 && wc < 0xffa0) { 49 | *r = wc - 0xfec0; 50 | return 1; 51 | } 52 | return RET_ILSEQ; 53 | } 54 | #endif /* NEED_TOMB */ 55 | -------------------------------------------------------------------------------- /server/gefaker.c: -------------------------------------------------------------------------------- 1 | /* Copyright (C)2007 Sun Microsystems, Inc. 2 | * Copyright (C)2019 D. R. Commander 3 | * 4 | * This library is free software and may be redistributed and/or modified under 5 | * the terms of the wxWindows Library License, Version 3.1 or (at your option) 6 | * any later version. The full license is in the LICENSE.txt file included 7 | * with this distribution. 8 | * 9 | * This library is distributed in the hope that it will be useful, 10 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 11 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 12 | * wxWindows Library License for more details. 13 | */ 14 | 15 | #include 16 | #include 17 | #include 18 | #include 19 | #include 20 | 21 | 22 | static pthread_mutex_t globalmutex = PTHREAD_MUTEX_INITIALIZER; 23 | 24 | typedef char *(*_getenvType)(const char *); 25 | static _getenvType __getenv = NULL; 26 | 27 | 28 | static void __loadsymbol(void) 29 | { 30 | const char *err = NULL; 31 | pthread_mutex_lock(&globalmutex); 32 | if(__getenv) { pthread_mutex_unlock(&globalmutex); return; } 33 | dlerror(); /* Clear error state */ 34 | __getenv = (_getenvType)dlsym(RTLD_NEXT, "getenv"); 35 | err = dlerror(); 36 | if(err) fprintf(stderr, "[gefaker] %s\n", err); 37 | else if(!__getenv) fprintf(stderr, "[gefaker] Could not load symbol.\n"); 38 | pthread_mutex_unlock(&globalmutex); 39 | } 40 | 41 | 42 | char *getenv(const char *name) 43 | { 44 | char *env = NULL, *tmp; int verbose = 0; 45 | FILE *file = stderr; 46 | 47 | __loadsymbol(); 48 | if(!__getenv) return NULL; 49 | 50 | if((env = __getenv("VGL_VERBOSE")) != NULL && strlen(env) > 0 51 | && !strncmp(env, "1", 1)) verbose = 1; 52 | if((env = __getenv("VGL_LOG")) != NULL && strlen(env) > 0 53 | && !strcasecmp(env, "stdout")) file = stdout; 54 | 55 | tmp = (char *)name; 56 | if(tmp && (!strcmp(name, "LD_PRELOAD") 57 | #ifdef sun 58 | || !strcmp(name, "LD_PRELOAD_32") || !strcmp(name, "LD_PRELOAD_64") 59 | #endif 60 | )) 61 | { 62 | if(verbose) 63 | fprintf(file, "[VGL] NOTICE: Fooling application into thinking that LD_PRELOAD is unset\n"); 64 | return NULL; 65 | } 66 | else return __getenv(name); 67 | } 68 | -------------------------------------------------------------------------------- /server/libGLdlfakerut.c: -------------------------------------------------------------------------------- 1 | /* Copyright (C)2009 D. R. Commander 2 | * 3 | * This library is free software and may be redistributed and/or modified under 4 | * the terms of the wxWindows Library License, Version 3.1 or (at your option) 5 | * any later version. The full license is in the LICENSE.txt file included 6 | * with this distribution. 7 | * 8 | * This library is distributed in the hope that it will be useful, 9 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 10 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 11 | * wxWindows Library License for more details. 12 | */ 13 | 14 | #include 15 | 16 | void myTestFunction(void); 17 | 18 | void myTestFunction(void) 19 | { 20 | fprintf(stderr, "Hello from inside libGLdlfaker.so\n"); 21 | } 22 | -------------------------------------------------------------------------------- /server/testplugin-mapfile: -------------------------------------------------------------------------------- 1 | { 2 | global: 3 | RRTransInit; 4 | RRTransConnect; 5 | RRTransGetFrame; 6 | RRTransReady; 7 | RRTransSynchronize; 8 | RRTransSendFrame; 9 | RRTransDestroy; 10 | RRTransGetError; 11 | 12 | local: 13 | *; 14 | }; 15 | -------------------------------------------------------------------------------- /server/threadlocal.h: -------------------------------------------------------------------------------- 1 | // Copyright (C)2015 Open Text SA and/or Open Text ULC (in Canada) 2 | // Copyright (C)2021 D. R. Commander 3 | // 4 | // This library is free software and may be redistributed and/or modified under 5 | // the terms of the wxWindows Library License, Version 3.1 or (at your option) 6 | // any later version. The full license is in the LICENSE.txt file included 7 | // with this distribution. 8 | // 9 | // This library is distributed in the hope that it will be useful, 10 | // but WITHOUT ANY WARRANTY; without even the implied warranty of 11 | // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 12 | // wxWindows Library License for more details. 13 | 14 | // On Linux, using __thread within position-independent code (all of VirtualGL 15 | // is compiled as PIC) invokes __tls_get_addr(), which is guarded by a mutex. 16 | // This can lead to deadlocks in certain applications. Therefore, this macro 17 | // creates a simple pthreads-based alternative to __thread for the purposes of 18 | // implementing TLS. 19 | 20 | #ifndef __THREADLOCAL_H__ 21 | #define __THREADLOCAL_H__ 22 | 23 | #define VGL_THREAD_LOCAL(name, type, initValue) \ 24 | static pthread_key_t get##name##Key(void) \ 25 | { \ 26 | static pthread_key_t key; \ 27 | static bool init = false; \ 28 | if(!init) \ 29 | { \ 30 | if(pthread_key_create(&key, NULL)) \ 31 | { \ 32 | vglout.println("[VGL] ERROR: pthread_key_create() for " #name " failed.\n"); \ 33 | faker::safeExit(1); \ 34 | } \ 35 | pthread_setspecific(key, (const void *)initValue); \ 36 | init = true; \ 37 | } \ 38 | return key; \ 39 | } \ 40 | \ 41 | type get##name(void) \ 42 | { \ 43 | return (type)pthread_getspecific(get##name##Key()); \ 44 | } \ 45 | \ 46 | void set##name(type value) \ 47 | { \ 48 | pthread_setspecific(get##name##Key(), (const void *)value); \ 49 | } 50 | 51 | #endif // __THREADLOCAL_H__ 52 | -------------------------------------------------------------------------------- /server/vendor.h.in: -------------------------------------------------------------------------------- 1 | #define VGL_FAKER_NAME "@VGL_FAKER_NAME@" 2 | #define VGL_DLFAKER_NAME "@VGL_DLFAKER_NAME@" 3 | #define VGL_GEFAKER_NAME "@VGL_GEFAKER_NAME@" 4 | -------------------------------------------------------------------------------- /server/vglconfigLauncher.cpp: -------------------------------------------------------------------------------- 1 | // Copyright (C)2014, 2020-2021 D. R. Commander 2 | // 3 | // This library is free software and may be redistributed and/or modified under 4 | // the terms of the wxWindows Library License, Version 3.1 or (at your option) 5 | // any later version. The full license is in the LICENSE.txt file included 6 | // with this distribution. 7 | // 8 | // This library is distributed in the hope that it will be useful, 9 | // but WITHOUT ANY WARRANTY; without even the implied warranty of 10 | // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 11 | // wxWindows Library License for more details. 12 | 13 | #include "vglconfigLauncher.h" 14 | 15 | using namespace faker; 16 | 17 | vglconfigLauncher *vglconfigLauncher::instance = NULL; 18 | util::CriticalSection vglconfigLauncher::instanceMutex; 19 | util::CriticalSection vglconfigLauncher::popupMutex; 20 | -------------------------------------------------------------------------------- /server/vglgenkey: -------------------------------------------------------------------------------- 1 | #!/bin/sh 2 | XAUTH=xauth 3 | if [ -x /usr/X11R6/bin/xauth ]; then 4 | XAUTH=/usr/X11R6/bin/xauth 5 | fi 6 | if [ -x /usr/openwin/bin/xauth ]; then 7 | XAUTH=/usr/openwin/bin/xauth 8 | fi 9 | if [ ! -d /etc/opt/VirtualGL ]; then 10 | mkdir -p /etc/opt/VirtualGL 11 | fi 12 | if [ -f /etc/opt/VirtualGL/vgl_xauth_key ]; then 13 | rm /etc/opt/VirtualGL/vgl_xauth_key 14 | fi 15 | $XAUTH -f /etc/opt/VirtualGL/vgl_xauth_key generate $DISPLAY . trusted timeout 0 || 16 | $XAUTH -f /etc/opt/VirtualGL/vgl_xauth_key add $DISPLAY . `$XAUTH list | awk '{print $3}' | uniq` 17 | chmod 644 /etc/opt/VirtualGL/vgl_xauth_key 18 | -------------------------------------------------------------------------------- /server/vgllogin: -------------------------------------------------------------------------------- 1 | #!/bin/sh 2 | 3 | # Copyright (C)2007 Sun Microsystems, Inc. 4 | # Copyright (C)2021 Karl Kleinpaste 5 | # Copyright (C)2022 D. R. Commander 6 | # 7 | # This library is free software and may be redistributed and/or modified under 8 | # the terms of the wxWindows Library License, Version 3.1 or (at your option) 9 | # any later version. The full license is in the LICENSE.txt file included 10 | # with this distribution. 11 | # 12 | # This library is distributed in the hope that it will be useful, 13 | # but WITHOUT ANY WARRANTY; without even the implied warranty of 14 | # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 15 | # wxWindows Library License for more details. 16 | 17 | if [ "$1" = "-check" ]; then exit 0; fi 18 | 19 | VGLRUN= 20 | 21 | usage() 22 | { 23 | echo "USAGE: $0 [-v] -s " 24 | exit 1 25 | } 26 | 27 | if [ "$1" = "" ]; then usage $0; fi 28 | 29 | if [ "$1" = "-v" ]; then 30 | 31 | VGLRUN=vglrun 32 | shift 33 | 34 | fi 35 | 36 | if [ "$1" = "-s" ]; then 37 | 38 | if [ "$2" = "" ]; then usage $0; fi 39 | VGL_CLIENT=localhost 40 | export VGL_CLIENT 41 | VGL_PORT=$2 42 | export VGL_PORT 43 | __VGL_SSHTUNNEL=1 44 | export __VGL_SSHTUNNEL 45 | 46 | else 47 | 48 | usage $0 49 | 50 | fi 51 | 52 | exec $VGLRUN $SHELL -l 53 | -------------------------------------------------------------------------------- /server/vglrun.vars.in: -------------------------------------------------------------------------------- 1 | # Copyright (C)2013, 2015-2016 D. R. Commander 2 | # 3 | # This library is free software and may be redistributed and/or modified under 4 | # the terms of the wxWindows Library License, Version 3.1 or (at your option) 5 | # any later version. The full license is in the LICENSE.txt file included 6 | # with this distribution. 7 | # 8 | # This library is distributed in the hope that it will be useful, 9 | # but WITHOUT ANY WARRANTY; without even the implied warranty of 10 | # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 11 | # wxWindows Library License for more details. 12 | 13 | # If the faker libraries are packaged in a non-system directory, then this 14 | # script adds that directory to VGL_LIBRARY_PATH, which is later added to 15 | # LD_LIBRARY_PATH so that LD_PRELOAD can find the libraries. 16 | 17 | VGL_LIBDIR=@CMAKE_INSTALL_FULL_LIBDIR@ 18 | 19 | if [ -d "$VGL_LIBDIR" -a -f "$VGL_LIBDIR/lib@VGL_FAKER_NAME@.so" ] && \ 20 | [ $__VGL_DL -eq 0 -o -f "$VGL_LIBDIR/lib@VGL_DLFAKER_NAME@.so" ] && \ 21 | [ $__VGL_GE -eq 0 -o -f "$VGL_LIBDIR/lib@VGL_GEFAKER_NAME@.so" ]; then 22 | if [ -z "$VGL_LIBRARY_PATH" ]; then 23 | VGL_LIBRARY_PATH=$VGL_LIBDIR 24 | else 25 | VGL_LIBRARY_PATH=$VGL_LIBRARY_PATH:$VGL_LIBDIR 26 | fi 27 | fi 28 | -------------------------------------------------------------------------------- /util/utiltest-win.in: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | set -e 3 | set -u 4 | trap onexit INT 5 | trap onexit TERM 6 | trap onexit EXIT 7 | 8 | SUCCESS=0 9 | PID=-1 10 | 11 | onexit() 12 | { 13 | if [ $SUCCESS -eq 1 ]; then 14 | echo GREAT SUCCESS! 15 | else 16 | echo Some errors were encountered. 17 | fi 18 | } 19 | 20 | BIN=@CMAKE_RUNTIME_OUTPUT_DIRECTORY@ 21 | IPV6=1 22 | 23 | while [ $# -gt 0 ]; do 24 | case "$1" in 25 | -noipv6) 26 | IPV6=0 27 | ;; 28 | esac 29 | shift 30 | done 31 | 32 | $BIN/bmptest 33 | echo 34 | 35 | $BIN/fbxtest -time 0.2 36 | $BIN/fbxtest -time 0.2 -mt 37 | 38 | $BIN/nettest -server & 39 | echo 40 | sleep 2 41 | $BIN/nettest -client 127.0.0.1 -time 0.2 42 | if [ "$IPV6" = "1" ]; then 43 | $BIN/nettest -server -ipv6 & 44 | echo 45 | sleep 2 46 | $BIN/nettest -client ::1 -time 0.2 47 | fi 48 | 49 | SUCCESS=1 50 | -------------------------------------------------------------------------------- /wgldemos/CMakeLists.txt: -------------------------------------------------------------------------------- 1 | include(FindOpenGL) 2 | 3 | include_directories(${OPENGL_INCLUDE_DIR}) 4 | 5 | add_executable(wglspheres wglspheres.c) 6 | target_link_libraries(wglspheres ${OPENGL_gl_LIBRARY} ${OPENGL_glu_LIBRARY}) 7 | 8 | install(TARGETS wglspheres DESTINATION ${CMAKE_INSTALL_BINDIR}) 9 | --------------------------------------------------------------------------------