/[rdesktop]/sourceforge.net/trunk/rdesktop/xwin.c
This is repository of my old source code which isn't updated any more. Go to git.rot13.org for current projects!
ViewVC logotype

Diff of /sourceforge.net/trunk/rdesktop/xwin.c

Parent Directory Parent Directory | Revision Log Revision Log | View Patch Patch

revision 1223 by astrand, Sun Apr 9 20:11:42 2006 UTC revision 1346 by ossman_, Thu Dec 7 15:23:45 2006 UTC
# Line 147  static int g_move_y_offset = 0; Line 147  static int g_move_y_offset = 0;
147  static BOOL g_using_full_workarea = False;  static BOOL g_using_full_workarea = False;
148    
149  #ifdef WITH_RDPSND  #ifdef WITH_RDPSND
 extern int g_dsp_fd;  
 extern BOOL g_dsp_busy;  
150  extern BOOL g_rdpsnd;  extern BOOL g_rdpsnd;
151  #endif  #endif
152    
# Line 242  seamless_XDrawLines(Drawable d, XPoint * Line 240  seamless_XDrawLines(Drawable d, XPoint *
240                          break; \                          break; \
241                  case 1: /* Filled */ \                  case 1: /* Filled */ \
242                          XFillArc(g_display, g_wnd, g_gc, x, y, cx, cy, 0, 360*64); \                          XFillArc(g_display, g_wnd, g_gc, x, y, cx, cy, 0, 360*64); \
243                          ON_ALL_SEAMLESS_WINDOWS(XCopyArea, (g_display, g_ownbackstore ? g_backstore : g_wnd, sw->wnd, g_gc, \                          ON_ALL_SEAMLESS_WINDOWS(XFillArc, (g_display, sw->wnd, g_gc, x-sw->xoffset, y-sw->yoffset, cx, cy, 0, 360*64)); \
                                                             x, y, cx, cy, x-sw->xoffset, y-sw->yoffset)); \  
244                          if (g_ownbackstore) \                          if (g_ownbackstore) \
245                                  XFillArc(g_display, g_backstore, g_gc, x, y, cx, cy, 0, 360*64); \                                  XFillArc(g_display, g_backstore, g_gc, x, y, cx, cy, 0, 360*64); \
246                          break; \                          break; \
# Line 1314  calculate_mask_weight(uint32 mask) Line 1311  calculate_mask_weight(uint32 mask)
1311  }  }
1312    
1313  static BOOL  static BOOL
1314  select_visual()  select_visual(int screen_num)
1315  {  {
1316          XPixmapFormatValues *pfm;          XPixmapFormatValues *pfm;
1317          int pixmap_formats_count, visuals_count;          int pixmap_formats_count, visuals_count;
# Line 1325  select_visual() Line 1322  select_visual()
1322    
1323          red_weight = blue_weight = green_weight = 0;          red_weight = blue_weight = green_weight = 0;
1324    
1325            if (g_server_depth == -1)
1326            {
1327                    g_server_depth = DisplayPlanes(g_display, DefaultScreen(g_display));
1328            }
1329    
1330          pfm = XListPixmapFormats(g_display, &pixmap_formats_count);          pfm = XListPixmapFormats(g_display, &pixmap_formats_count);
1331          if (pfm == NULL)          if (pfm == NULL)
1332          {          {
# Line 1335  select_visual() Line 1337  select_visual()
1337    
1338          /* Search for best TrueColor visual */          /* Search for best TrueColor visual */
1339          template.class = TrueColor;          template.class = TrueColor;
1340          vmatches = XGetVisualInfo(g_display, VisualClassMask, &template, &visuals_count);          template.screen = screen_num;
1341            vmatches =
1342                    XGetVisualInfo(g_display, VisualClassMask | VisualScreenMask, &template,
1343                                   &visuals_count);
1344          g_visual = NULL;          g_visual = NULL;
1345          g_no_translate_image = False;          g_no_translate_image = False;
1346          g_compatible_arch = False;          g_compatible_arch = False;
# Line 1540  ui_init(void) Line 1545  ui_init(void)
1545          g_screen = ScreenOfDisplay(g_display, screen_num);          g_screen = ScreenOfDisplay(g_display, screen_num);
1546          g_depth = DefaultDepthOfScreen(g_screen);          g_depth = DefaultDepthOfScreen(g_screen);
1547    
1548          if (!select_visual())          if (!select_visual(screen_num))
1549                  return False;                  return False;
1550    
1551          if (g_no_translate_image)          if (g_no_translate_image)
# Line 2261  ui_select(int rdp_socket) Line 2266  ui_select(int rdp_socket)
2266                  FD_SET(rdp_socket, &rfds);                  FD_SET(rdp_socket, &rfds);
2267                  FD_SET(g_x_socket, &rfds);                  FD_SET(g_x_socket, &rfds);
2268    
 #ifdef WITH_RDPSND  
                 /* FIXME: there should be an API for registering fds */  
                 if (g_dsp_busy)  
                 {  
                         FD_SET(g_dsp_fd, &wfds);  
                         n = (g_dsp_fd > n) ? g_dsp_fd : n;  
                 }  
 #endif  
2269                  /* default timeout */                  /* default timeout */
2270                  tv.tv_sec = 60;                  tv.tv_sec = 60;
2271                  tv.tv_usec = 0;                  tv.tv_usec = 0;
2272    
2273    #ifdef WITH_RDPSND
2274                    rdpsnd_add_fds(&n, &rfds, &wfds, &tv);
2275    #endif
2276    
2277                  /* add redirection handles */                  /* add redirection handles */
2278                  rdpdr_add_fds(&n, &rfds, &wfds, &tv, &s_timeout);                  rdpdr_add_fds(&n, &rfds, &wfds, &tv, &s_timeout);
2279                  seamless_select_timeout(&tv);                  seamless_select_timeout(&tv);
# Line 2285  ui_select(int rdp_socket) Line 2286  ui_select(int rdp_socket)
2286                                  error("select: %s\n", strerror(errno));                                  error("select: %s\n", strerror(errno));
2287    
2288                          case 0:                          case 0:
2289    #ifdef WITH_RDPSND
2290                                    rdpsnd_check_fds(&rfds, &wfds);
2291    #endif
2292    
2293                                  /* Abort serial read calls */                                  /* Abort serial read calls */
2294                                  if (s_timeout)                                  if (s_timeout)
2295                                          rdpdr_check_fds(&rfds, &wfds, (BOOL) True);                                          rdpdr_check_fds(&rfds, &wfds, (BOOL) True);
2296                                  continue;                                  continue;
2297                  }                  }
2298    
2299    #ifdef WITH_RDPSND
2300                    rdpsnd_check_fds(&rfds, &wfds);
2301    #endif
2302    
2303                  rdpdr_check_fds(&rfds, &wfds, (BOOL) False);                  rdpdr_check_fds(&rfds, &wfds, (BOOL) False);
2304    
2305                  if (FD_ISSET(rdp_socket, &rfds))                  if (FD_ISSET(rdp_socket, &rfds))
2306                          return 1;                          return 1;
2307    
 #ifdef WITH_RDPSND  
                 if (g_dsp_busy && FD_ISSET(g_dsp_fd, &wfds))  
                         wave_out_play();  
 #endif  
2308          }          }
2309  }  }
2310    
# Line 3185  ui_desktop_save(uint32 offset, int x, in Line 3190  ui_desktop_save(uint32 offset, int x, in
3190          if (g_ownbackstore)          if (g_ownbackstore)
3191          {          {
3192                  image = XGetImage(g_display, g_backstore, x, y, cx, cy, AllPlanes, ZPixmap);                  image = XGetImage(g_display, g_backstore, x, y, cx, cy, AllPlanes, ZPixmap);
3193                    exit_if_null(image);
3194          }          }
3195          else          else
3196          {          {
3197                  pix = XCreatePixmap(g_display, g_wnd, cx, cy, g_depth);                  pix = XCreatePixmap(g_display, g_wnd, cx, cy, g_depth);
3198                  XCopyArea(g_display, g_wnd, pix, g_gc, x, y, cx, cy, 0, 0);                  XCopyArea(g_display, g_wnd, pix, g_gc, x, y, cx, cy, 0, 0);
3199                  image = XGetImage(g_display, pix, 0, 0, cx, cy, AllPlanes, ZPixmap);                  image = XGetImage(g_display, pix, 0, 0, cx, cy, AllPlanes, ZPixmap);
3200                    exit_if_null(image);
3201                  XFreePixmap(g_display, pix);                  XFreePixmap(g_display, pix);
3202          }          }
3203    
# Line 3468  ui_seamless_destroy_window(unsigned long Line 3475  ui_seamless_destroy_window(unsigned long
3475  }  }
3476    
3477    
3478    void
3479    ui_seamless_destroy_group(unsigned long id, unsigned long flags)
3480    {
3481            seamless_window *sw, *sw_next;
3482    
3483            if (!g_seamless_active)
3484                    return;
3485    
3486            for (sw = g_seamless_windows; sw; sw = sw_next)
3487            {
3488                    sw_next = sw->next;
3489    
3490                    if (sw->group->id == id)
3491                    {
3492                            XDestroyWindow(g_display, sw->wnd);
3493                            sw_remove_window(sw);
3494                    }
3495            }
3496    }
3497    
3498    
3499  void  void
3500  ui_seamless_move_window(unsigned long id, int x, int y, int width, int height, unsigned long flags)  ui_seamless_move_window(unsigned long id, int x, int y, int width, int height, unsigned long flags)
3501  {  {

Legend:
Removed from v.1223  
changed lines
  Added in v.1346

  ViewVC Help
Powered by ViewVC 1.1.26