conf.h 11 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291
  1. /*
  2. (c) Copyright 2001-2009 The world wide DirectFB Open Source Community (directfb.org)
  3. (c) Copyright 2000-2004 Convergence (integrated media) GmbH
  4. All rights reserved.
  5. Written by Denis Oliver Kropp <dok@directfb.org>,
  6. Andreas Hundt <andi@fischlustig.de>,
  7. Sven Neumann <neo@directfb.org>,
  8. Ville Syrjälä <syrjala@sci.fi> and
  9. Claudio Ciccani <klan@users.sf.net>.
  10. This library is free software; you can redistribute it and/or
  11. modify it under the terms of the GNU Lesser General Public
  12. License as published by the Free Software Foundation; either
  13. version 2 of the License, or (at your option) any later version.
  14. This library is distributed in the hope that it will be useful,
  15. but WITHOUT ANY WARRANTY; without even the implied warranty of
  16. MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
  17. Lesser General Public License for more details.
  18. You should have received a copy of the GNU Lesser General Public
  19. License along with this library; if not, write to the
  20. Free Software Foundation, Inc., 59 Temple Place - Suite 330,
  21. Boston, MA 02111-1307, USA.
  22. */
  23. #ifndef __CONF_H__
  24. #define __CONF_H__
  25. #include <signal.h>
  26. #include <directfb.h>
  27. #include <fusion/types.h>
  28. #include <fusion/vector.h>
  29. #include <core/coredefs.h>
  30. typedef struct {
  31. bool init;
  32. DFBDisplayLayerConfig config;
  33. DFBColor src_key;
  34. int src_key_index;
  35. struct {
  36. DFBDisplayLayerBackgroundMode mode;
  37. DFBColor color;
  38. int color_index;
  39. char *filename;
  40. } background;
  41. DFBWindowStackingClass stacking;
  42. DFBColor *palette;
  43. bool palette_set;
  44. int rotate;
  45. } DFBConfigLayer;
  46. typedef enum {
  47. DCWF_NONE = 0x00000000,
  48. DCWF_CREATE_SURFACE = 0x00000001,
  49. DCWF_CREATE_WINDOW = 0x00000002,
  50. DCWF_ALLOCATE_BUFFER = 0x00000010,
  51. DCWF_ALL = 0x00000013,
  52. } DFBConfigWarnFlags;
  53. typedef struct
  54. {
  55. bool mouse_motion_compression; /* use motion compression? */
  56. char *mouse_protocol; /* mouse protocol */
  57. char *mouse_source; /* mouse source device name */
  58. bool mouse_gpm_source; /* mouse source is gpm? */
  59. int window_policy; /* swapping policy for the
  60. surface of a window */
  61. int buffer_mode; /* default buffer mode for
  62. primary layer */
  63. bool pollvsync_after;
  64. bool pollvsync_none;
  65. bool software_only; /* disable hardware acceleration */
  66. bool hardware_only; /* disable software fallbacks */
  67. bool mmx; /* mmx support */
  68. bool banner; /* startup banner */
  69. bool force_windowed; /* prohibit exclusive modes */
  70. bool deinit_check;
  71. bool vt_switch; /* allocate a new VT */
  72. int vt_num; /* number of TTY to use or -1
  73. if the default */
  74. bool kd_graphics; /* put terminal into graphics
  75. mode */
  76. DFBScreenEncoderTVStandards matrox_tv_std; /* Matrox TV standard */
  77. int matrox_cable; /* Matrox cable type */
  78. bool matrox_sgram; /* Use Matrox SGRAM features */
  79. bool matrox_crtc2; /* Experimental CRTC2 stuff */
  80. bool sync; /* Do sync() in core_init() */
  81. bool vt_switching; /* Allow VT switching by
  82. pressing Ctrl+Alt+<F?> */
  83. char *fb_device; /* Used framebuffer device,
  84. e.g. "/dev/fb0" */
  85. struct {
  86. int bus; /* PCI Bus */
  87. int dev; /* PCI Device */
  88. int func; /* PCI Function */
  89. } pci;
  90. bool lefty; /* Left handed mouse, swaps
  91. left/right mouse buttons */
  92. bool no_cursor; /* Never create a cursor */
  93. bool translucent_windows; /* Allow translucent
  94. windows */
  95. struct {
  96. int width; /* primary layer width */
  97. int height; /* primary layer height */
  98. int depth; /* primary layer depth */
  99. DFBSurfacePixelFormat format; /* primary layer format */
  100. } mode;
  101. struct {
  102. int width; /* scaled window width */
  103. int height; /* scaled window height */
  104. } scaled;
  105. int videoram_limit; /* limit amount of video
  106. memory used by DirectFB */
  107. char *screenshot_dir; /* dump screen content into
  108. this directory */
  109. char *system; /* FBDev, SDL, etc. */
  110. bool capslock_meta; /* map CapsLock -> Meta */
  111. bool block_all_signals; /* block all signals */
  112. int session; /* select multi app world */
  113. int primary_layer; /* select alternative primary
  114. display layer */
  115. bool force_desktop; /* Desktop background is
  116. the primary surface. */
  117. bool linux_input_ir_only; /* Ignore non-IR devices. */
  118. struct {
  119. char *host; /* Remote host to connect to. */
  120. int port; /* Remote port number. */
  121. } remote;
  122. char *wm; /* Window manager to use. */
  123. bool vt; /* Use VT stuff at all? */
  124. bool decorations; /* Enable window decorations. */
  125. DFBSurfacePixelFormat font_format; /* Preferred font format. */
  126. char *h3600_device; /* H3600 Touchscreen Device */
  127. char *mut_device; /* MuTouch Device */
  128. char *penmount_device; /* PenMount Device */
  129. char *zytronic_device; /* Zytronic Device */
  130. char *elo_device; /* elo Device */
  131. int unichrome_revision; /* Unichrome hardware
  132. revision number override */
  133. bool dma; /* Enable DMA */
  134. int agp; /* AGP mode */
  135. int agpmem_limit; /* Limit of AGP memory
  136. used by DirectFB */
  137. bool i8xx_overlay_pipe_b; /* video overlay output via pixel pipe B */
  138. bool primary_only; /* tell application only about primary layer */
  139. bool thrifty_surface_buffers; /* don't keep system instance while video instance is alive */
  140. bool surface_sentinel;
  141. DFBConfigLayer layers[MAX_LAYERS];
  142. DFBConfigLayer *config_layer;
  143. DFBSurfaceRenderOptions render_options; /* default render options */
  144. bool startstop; /* Issue StartDrawing/StopDrawing to driver */
  145. unsigned long video_phys; /* Physical base address of video memory */
  146. unsigned int video_length; /* Size of video memory */
  147. unsigned long mmio_phys; /* Physical base address of MMIO area */
  148. unsigned int mmio_length; /* Size of MMIO area */
  149. int accelerator; /* Accelerator ID */
  150. bool font_premult; /* Use premultiplied data in case of ARGB glyph images */
  151. FusionVector linux_input_devices;
  152. FusionVector tslib_devices;
  153. bool thread_block_signals; /* Call direct_signals_block_all() in direct_thread_main() startup. */
  154. bool linux_input_grab; /* Grab input devices. */
  155. bool autoflip_window; /* If primary surface is non-flipping, but windowed, flip automatically. */
  156. bool software_warn; /* Show warnings when doing/dropping software operations. */
  157. int surface_shmpool_size; /* Set the size of the shared memory pool used for
  158. shared system memory surfaces. */
  159. bool no_cursor_updates; /* Never show the cursor etc. */
  160. struct {
  161. DFBConfigWarnFlags flags; /* Warn on various actions as window/surface creation. */
  162. struct {
  163. DFBDimension min_size;
  164. } create_surface;
  165. struct {
  166. DFBDimension min_size;
  167. } allocate_buffer;
  168. } warn;
  169. int keep_accumulators; /* Free accumulators above this limit */
  170. bool software_trace;
  171. unsigned int max_axis_rate;
  172. bool cursor_automation;
  173. int max_font_rows;
  174. int max_font_row_width;
  175. bool core_sighandler;
  176. char *resource_manager;
  177. } DFBConfig;
  178. extern DFBConfig *dfb_config;
  179. /*
  180. * Allocate Config struct, fill with defaults and parse command line options
  181. * for overrides. Options identified as DirectFB options are stripped out
  182. * of the array.
  183. */
  184. DFBResult dfb_config_init( int *argc, char *(*argv[]) );
  185. /*
  186. * Read configuration options from file. Called by config_init().
  187. *
  188. * Returns DFB_IO if config file could not be opened.
  189. * Returns DFB_UNSUPPORTED if file contains an invalid option.
  190. * Returns DFB_INVARG if an invalid option assignment is done,
  191. * e.g. "--desktop-buffer-mode=somethingwrong".
  192. */
  193. DFBResult dfb_config_read( const char *filename );
  194. /*
  195. * Set indiviual option. Used by config_init(), config_read() and
  196. * DirectFBSetOption()
  197. */
  198. DFBResult dfb_config_set( const char *name, const char *value );
  199. const char *dfb_config_usage( void );
  200. DFBSurfacePixelFormat dfb_config_parse_pixelformat( const char *format );
  201. #endif