Fixed rather embarrassing function naming conflict with low level RANDR library

git-svn-id: svn://anonsvn.kde.org/home/kde/branches/trinity/kdelibs@1120049 283d02a7-25f6-0310-bc7c-ecb5cbfe19da
v3.5.13-sru
tpearson 15 years ago
parent 3be8f38c82
commit 8949c3abab

@ -26,72 +26,72 @@
ScreenInfo* KRandrSimpleAPI::read_screen_info (Display *display) ScreenInfo* KRandrSimpleAPI::read_screen_info (Display *display)
{ {
return read_screen_info(display); return internal_read_screen_info(display);
} }
int KRandrSimpleAPI::set_screen_size (ScreenInfo *screen_info) int KRandrSimpleAPI::set_screen_size (ScreenInfo *screen_info)
{ {
return set_screen_size(screen_info); return internal_set_screen_size(screen_info);
} }
void KRandrSimpleAPI::output_auto (ScreenInfo *screen_info, OutputInfo *output_info) void KRandrSimpleAPI::output_auto (ScreenInfo *screen_info, OutputInfo *output_info)
{ {
output_auto (screen_info, output_info); internal_output_auto (screen_info, output_info);
} }
void KRandrSimpleAPI::output_off(ScreenInfo *screen_info, OutputInfo *output) void KRandrSimpleAPI::output_off(ScreenInfo *screen_info, OutputInfo *output)
{ {
output_off(screen_info, output); internal_output_off(screen_info, output);
} }
CrtcInfo* KRandrSimpleAPI::auto_find_crtc (ScreenInfo *screen_info, OutputInfo *output_info) CrtcInfo* KRandrSimpleAPI::auto_find_crtc (ScreenInfo *screen_info, OutputInfo *output_info)
{ {
return auto_find_crtc (screen_info, output_info); return internal_auto_find_crtc (screen_info, output_info);
} }
XRRModeInfo *KRandrSimpleAPI::find_mode_by_xid (ScreenInfo *screen_info, RRMode mode_id) XRRModeInfo *KRandrSimpleAPI::find_mode_by_xid (ScreenInfo *screen_info, RRMode mode_id)
{ {
return find_mode_by_xid (screen_info, mode_id); return internal_find_mode_by_xid (screen_info, mode_id);
} }
int KRandrSimpleAPI::mode_height (XRRModeInfo *mode_info, Rotation rotation) int KRandrSimpleAPI::mode_height (XRRModeInfo *mode_info, Rotation rotation)
{ {
return mode_height (mode_info, rotation); return internal_mode_height (mode_info, rotation);
} }
int KRandrSimpleAPI::mode_width (XRRModeInfo *mode_info, Rotation rotation) int KRandrSimpleAPI::mode_width (XRRModeInfo *mode_info, Rotation rotation)
{ {
return mode_width (mode_info, rotation); return internal_mode_width (mode_info, rotation);
} }
int KRandrSimpleAPI::get_width_by_output_id (ScreenInfo *screen_info, RROutput output_id) int KRandrSimpleAPI::get_width_by_output_id (ScreenInfo *screen_info, RROutput output_id)
{ {
return get_width_by_output_id (screen_info, output_id); return internal_get_width_by_output_id (screen_info, output_id);
} }
int KRandrSimpleAPI::get_height_by_output_id (ScreenInfo *screen_info, RROutput output_id) int KRandrSimpleAPI::get_height_by_output_id (ScreenInfo *screen_info, RROutput output_id)
{ {
return get_height_by_output_id (screen_info, output_id); return internal_get_height_by_output_id (screen_info, output_id);
} }
char *KRandrSimpleAPI::get_output_name (ScreenInfo *screen_info, RROutput id) char *KRandrSimpleAPI::get_output_name (ScreenInfo *screen_info, RROutput id)
{ {
return get_output_name (screen_info, id); return internal_get_output_name (screen_info, id);
} }
Status KRandrSimpleAPI::crtc_apply (CrtcInfo *crtc_info) Status KRandrSimpleAPI::crtc_apply (CrtcInfo *crtc_info)
{ {
return crtc_apply (crtc_info); return internal_crtc_apply (crtc_info);
} }
Status KRandrSimpleAPI::crtc_disable (CrtcInfo *crtc) Status KRandrSimpleAPI::crtc_disable (CrtcInfo *crtc)
{ {
return crtc_disable (crtc); return internal_crtc_disable (crtc);
} }
int KRandrSimpleAPI::main_low_apply (ScreenInfo *screen_info) int KRandrSimpleAPI::main_low_apply (ScreenInfo *screen_info)
{ {
return main_low_apply (screen_info); return internal_main_low_apply (screen_info);
} }
bool KRandrSimpleAPI::kRandrHasRandr(void) bool KRandrSimpleAPI::kRandrHasRandr(void)

@ -1,4 +1,5 @@
/* /*
* Copyright © 2010 Raptor Engineering
* Copyright © 2007 Intel Corporation * Copyright © 2007 Intel Corporation
* *
* Permission is hereby granted, free of charge, to any person obtaining a copy * Permission is hereby granted, free of charge, to any person obtaining a copy
@ -24,9 +25,9 @@
#include <stdio.h> #include <stdio.h>
#include <string.h> #include <string.h>
Status crtc_disable (struct CrtcInfo *crtc); Status internal_crtc_disable (struct CrtcInfo *crtc);
char * get_output_name (struct ScreenInfo *screen_info, RROutput id) char * internal_get_output_name (struct ScreenInfo *screen_info, RROutput id)
{ {
char *output_name = NULL; char *output_name = NULL;
int i; int i;
@ -44,7 +45,7 @@ char * get_output_name (struct ScreenInfo *screen_info, RROutput id)
return output_name; return output_name;
} }
XRRModeInfo * find_mode_by_xid (struct ScreenInfo *screen_info, RRMode mode_id) XRRModeInfo * internal_find_mode_by_xid (struct ScreenInfo *screen_info, RRMode mode_id)
{ {
XRRModeInfo *mode_info = NULL; XRRModeInfo *mode_info = NULL;
XRRScreenResources *res; XRRScreenResources *res;
@ -61,7 +62,7 @@ XRRModeInfo * find_mode_by_xid (struct ScreenInfo *screen_info, RRMode mode_id)
return mode_info; return mode_info;
} }
static XRRCrtcInfo * find_crtc_by_xid (struct ScreenInfo *screen_info, RRCrtc crtc_id) static XRRCrtcInfo * internal_find_crtc_by_xid (struct ScreenInfo *screen_info, RRCrtc crtc_id)
{ {
XRRCrtcInfo *crtc_info; XRRCrtcInfo *crtc_info;
Display *dpy; Display *dpy;
@ -75,7 +76,7 @@ static XRRCrtcInfo * find_crtc_by_xid (struct ScreenInfo *screen_info, RRCrtc cr
return crtc_info; return crtc_info;
} }
int get_width_by_output_id (struct ScreenInfo *screen_info, RROutput output_id) int internal_get_width_by_output_id (struct ScreenInfo *screen_info, RROutput output_id)
{ {
struct OutputInfo *output_info; struct OutputInfo *output_info;
struct CrtcInfo *crtc_info; struct CrtcInfo *crtc_info;
@ -92,9 +93,9 @@ int get_width_by_output_id (struct ScreenInfo *screen_info, RROutput output_id)
break; break;
} }
mode_id = crtc_info->cur_mode_id; mode_id = crtc_info->cur_mode_id;
mode_info = find_mode_by_xid (screen_info, mode_id); mode_info = internal_find_mode_by_xid (screen_info, mode_id);
width = mode_width (mode_info, crtc_info->cur_rotation); width = internal_mode_width (mode_info, crtc_info->cur_rotation);
break; break;
} }
@ -103,7 +104,7 @@ int get_width_by_output_id (struct ScreenInfo *screen_info, RROutput output_id)
return width; return width;
} }
int get_height_by_output_id (struct ScreenInfo *screen_info, RROutput output_id) int internal_get_height_by_output_id (struct ScreenInfo *screen_info, RROutput output_id)
{ {
struct OutputInfo *output_info; struct OutputInfo *output_info;
struct CrtcInfo *crtc_info; struct CrtcInfo *crtc_info;
@ -120,9 +121,9 @@ int get_height_by_output_id (struct ScreenInfo *screen_info, RROutput output_id)
break; break;
} }
mode_id = crtc_info->cur_mode_id; mode_id = crtc_info->cur_mode_id;
mode_info = find_mode_by_xid (screen_info, mode_id); mode_info = internal_find_mode_by_xid (screen_info, mode_id);
height = mode_height (mode_info, crtc_info->cur_rotation); height = internal_mode_height (mode_info, crtc_info->cur_rotation);
break; break;
} }
@ -131,7 +132,7 @@ int get_height_by_output_id (struct ScreenInfo *screen_info, RROutput output_id)
return height; return height;
} }
int mode_height (XRRModeInfo *mode_info, Rotation rotation) int internal_mode_height (XRRModeInfo *mode_info, Rotation rotation)
{ {
switch (rotation & 0xf) { switch (rotation & 0xf) {
case RR_Rotate_0: case RR_Rotate_0:
@ -145,7 +146,7 @@ int mode_height (XRRModeInfo *mode_info, Rotation rotation)
} }
} }
int mode_width (XRRModeInfo *mode_info, Rotation rotation) int internal_mode_width (XRRModeInfo *mode_info, Rotation rotation)
{ {
switch (rotation & 0xf) { switch (rotation & 0xf) {
case RR_Rotate_0: case RR_Rotate_0:
@ -160,7 +161,7 @@ int mode_width (XRRModeInfo *mode_info, Rotation rotation)
} }
static struct CrtcInfo * find_crtc (struct ScreenInfo *screen_info, XRROutputInfo *output) static struct CrtcInfo * internal_find_crtc (struct ScreenInfo *screen_info, XRROutputInfo *output)
{ {
struct CrtcInfo *crtc_info = NULL; struct CrtcInfo *crtc_info = NULL;
int i; int i;
@ -175,7 +176,7 @@ static struct CrtcInfo * find_crtc (struct ScreenInfo *screen_info, XRROutputInf
return crtc_info; return crtc_info;
} }
struct CrtcInfo * auto_find_crtc (struct ScreenInfo *screen_info, struct OutputInfo *output_info) struct CrtcInfo * internal_auto_find_crtc (struct ScreenInfo *screen_info, struct OutputInfo *output_info)
{ {
struct CrtcInfo *crtc_info = NULL; struct CrtcInfo *crtc_info = NULL;
int i; int i;
@ -194,7 +195,7 @@ struct CrtcInfo * auto_find_crtc (struct ScreenInfo *screen_info, struct OutputI
return crtc_info; return crtc_info;
} }
int set_screen_size (struct ScreenInfo *screen_info) int internal_set_screen_size (struct ScreenInfo *screen_info)
{ {
Display *dpy; Display *dpy;
int screen; int screen;
@ -214,12 +215,12 @@ int set_screen_size (struct ScreenInfo *screen_info)
if (!crtc->cur_mode_id) { if (!crtc->cur_mode_id) {
continue; continue;
} }
mode_info = find_mode_by_xid (screen_info, crtc->cur_mode_id); mode_info = internal_find_mode_by_xid (screen_info, crtc->cur_mode_id);
cur_x = crtc->cur_x; cur_x = crtc->cur_x;
cur_y = crtc->cur_y; cur_y = crtc->cur_y;
w = mode_width (mode_info, crtc->cur_rotation); w = internal_mode_width (mode_info, crtc->cur_rotation);
h = mode_height (mode_info, crtc->cur_rotation); h = internal_mode_height (mode_info, crtc->cur_rotation);
if (cur_x + w > max_width) { if (cur_x + w > max_width) {
max_width = cur_x + w; max_width = cur_x + w;
@ -272,7 +273,7 @@ int set_screen_size (struct ScreenInfo *screen_info)
return 1; return 1;
} }
void screen_apply (struct ScreenInfo *screen_info) void internal_screen_apply (struct ScreenInfo *screen_info)
{ {
int width, height; int width, height;
int mmWidth, mmHeight; int mmWidth, mmHeight;
@ -301,7 +302,7 @@ void screen_apply (struct ScreenInfo *screen_info)
} }
} }
Status crtc_apply (struct CrtcInfo *crtc_info) Status internal_crtc_apply (struct CrtcInfo *crtc_info)
{ {
struct ScreenInfo *screen_info; struct ScreenInfo *screen_info;
XRRCrtcInfo *rr_crtc_info; XRRCrtcInfo *rr_crtc_info;
@ -333,7 +334,7 @@ Status crtc_apply (struct CrtcInfo *crtc_info)
noutput = crtc_info->cur_noutput; noutput = crtc_info->cur_noutput;
if (0 == noutput) { if (0 == noutput) {
return crtc_disable (crtc_info); return internal_crtc_disable (crtc_info);
} }
outputs = malloc (sizeof (RROutput) * noutput); outputs = malloc (sizeof (RROutput) * noutput);
@ -360,7 +361,7 @@ Status crtc_apply (struct CrtcInfo *crtc_info)
return s; return s;
} }
Status crtc_disable (struct CrtcInfo *crtc) Status internal_crtc_disable (struct CrtcInfo *crtc)
{ {
struct ScreenInfo *screen_info; struct ScreenInfo *screen_info;
@ -370,7 +371,7 @@ Status crtc_disable (struct CrtcInfo *crtc)
0, 0, None, RR_Rotate_0, NULL, 0); 0, 0, None, RR_Rotate_0, NULL, 0);
} }
struct ScreenInfo* read_screen_info (Display *display) struct ScreenInfo* internal_read_screen_info (Display *display)
{ {
struct ScreenInfo *screen_info; struct ScreenInfo *screen_info;
int screen_num; int screen_num;
@ -428,7 +429,7 @@ struct ScreenInfo* read_screen_info (Display *display)
output->id = sr->outputs[i]; output->id = sr->outputs[i];
output->info = XRRGetOutputInfo (display, sr, sr->outputs[i]); output->info = XRRGetOutputInfo (display, sr, sr->outputs[i]);
output->cur_crtc = find_crtc (screen_info, output->info); output->cur_crtc = internal_find_crtc (screen_info, output->info);
output->auto_set = 0; output->auto_set = 0;
if (output->cur_crtc) { if (output->cur_crtc) {
output->off_set = 0; output->off_set = 0;
@ -446,7 +447,7 @@ struct ScreenInfo* read_screen_info (Display *display)
return screen_info; return screen_info;
} }
void free_screen_info (struct ScreenInfo *screen_info) void internal_free_screen_info (struct ScreenInfo *screen_info)
{ {
free (screen_info->outputs); free (screen_info->outputs);
free (screen_info->crtcs); free (screen_info->crtcs);
@ -456,7 +457,7 @@ void free_screen_info (struct ScreenInfo *screen_info)
/*check if other outputs that connected to the same crtc support this mode*/ /*check if other outputs that connected to the same crtc support this mode*/
static int check_mode (struct ScreenInfo *screen_info, struct OutputInfo *output, RRMode mode_id) static int internal_check_mode (struct ScreenInfo *screen_info, struct OutputInfo *output, RRMode mode_id)
{ {
XRRCrtcInfo *crtc_info; XRRCrtcInfo *crtc_info;
/* XRR */ /* XRR */
@ -493,7 +494,7 @@ static int check_mode (struct ScreenInfo *screen_info, struct OutputInfo *output
return mode_ok; return mode_ok;
} }
static RRCrtc get_crtc_id_by_output_id (struct ScreenInfo *screen_info, RROutput output_id) static RRCrtc internal_get_crtc_id_by_output_id (struct ScreenInfo *screen_info, RROutput output_id)
{ {
int i; int i;
RRCrtc crtc_id = -1; RRCrtc crtc_id = -1;
@ -513,7 +514,7 @@ static RRCrtc get_crtc_id_by_output_id (struct ScreenInfo *screen_info, RROutput
} }
static struct CrtcInfo * static struct CrtcInfo *
get_crtc_info_by_xid (struct ScreenInfo *screen_info, RRCrtc crtc_id) internal_get_crtc_info_by_xid (struct ScreenInfo *screen_info, RRCrtc crtc_id)
{ {
struct CrtcInfo *crtc_info = NULL; struct CrtcInfo *crtc_info = NULL;
int i; int i;
@ -529,7 +530,7 @@ get_crtc_info_by_xid (struct ScreenInfo *screen_info, RRCrtc crtc_id)
} }
static XRRModeInfo * static XRRModeInfo *
preferred_mode (struct ScreenInfo *screen_info, struct OutputInfo *output) internal_preferred_mode (struct ScreenInfo *screen_info, struct OutputInfo *output)
{ {
XRROutputInfo *output_info = output->info; XRROutputInfo *output_info = output->info;
Display *dpy; Display *dpy;
@ -543,7 +544,7 @@ preferred_mode (struct ScreenInfo *screen_info, struct OutputInfo *output)
best = NULL; best = NULL;
bestDist = 0; bestDist = 0;
for (m = 0; m < output_info->nmode; m++) { for (m = 0; m < output_info->nmode; m++) {
XRRModeInfo *mode_info = find_mode_by_xid (screen_info, output_info->modes[m]); XRRModeInfo *mode_info = internal_find_mode_by_xid (screen_info, output_info->modes[m]);
int dist; int dist;
if (m < output_info->npreferred) if (m < output_info->npreferred)
@ -563,14 +564,14 @@ preferred_mode (struct ScreenInfo *screen_info, struct OutputInfo *output)
return best; return best;
} }
int main_low_apply (struct ScreenInfo *screen_info) int internal_main_low_apply (struct ScreenInfo *screen_info)
{ {
int i; int i;
struct CrtcInfo *crtc_info; struct CrtcInfo *crtc_info;
/* set_positions (screen_info); */ /* set_positions (screen_info); */
if (!set_screen_size (screen_info)) { if (!internal_set_screen_size (screen_info)) {
printf("Screen Size FAILURE\n\r"); printf("Screen Size FAILURE\n\r");
return 0; return 0;
} }
@ -579,7 +580,7 @@ int main_low_apply (struct ScreenInfo *screen_info)
int old_x, old_y, old_w, old_h; int old_x, old_y, old_w, old_h;
XRRCrtcInfo *crtc_info = XRRGetCrtcInfo (screen_info->dpy, screen_info->res, screen_info->crtcs[i]->id); XRRCrtcInfo *crtc_info = XRRGetCrtcInfo (screen_info->dpy, screen_info->res, screen_info->crtcs[i]->id);
XRRModeInfo *old_mode = find_mode_by_xid (screen_info, crtc_info->mode); XRRModeInfo *old_mode = internal_find_mode_by_xid (screen_info, crtc_info->mode);
if (crtc_info->mode == None) { if (crtc_info->mode == None) {
continue; continue;
@ -587,24 +588,24 @@ int main_low_apply (struct ScreenInfo *screen_info)
old_x = crtc_info->x; old_x = crtc_info->x;
old_y = crtc_info->y; old_y = crtc_info->y;
old_w = mode_width (old_mode, crtc_info->rotation); old_w = internal_mode_width (old_mode, crtc_info->rotation);
old_h = mode_height (old_mode, crtc_info->rotation); old_h = internal_mode_height (old_mode, crtc_info->rotation);
if (old_x + old_w <= screen_info->cur_width && if (old_x + old_w <= screen_info->cur_width &&
old_y + old_h <= screen_info->cur_height ) { old_y + old_h <= screen_info->cur_height ) {
continue; continue;
} else { } else {
crtc_disable (screen_info->crtcs[i]); internal_crtc_disable (screen_info->crtcs[i]);
} }
} }
screen_apply (screen_info); internal_screen_apply (screen_info);
for (i = 0; i < screen_info->n_crtc; i++) { for (i = 0; i < screen_info->n_crtc; i++) {
Status s; Status s;
crtc_info = screen_info->crtcs[i]; crtc_info = screen_info->crtcs[i];
s = crtc_apply (crtc_info); s = internal_crtc_apply (crtc_info);
if (RRSetConfigSuccess != s) { if (RRSetConfigSuccess != s) {
fprintf (stderr, "crtc apply error\n"); fprintf (stderr, "crtc apply error\n");
} }
@ -613,7 +614,7 @@ int main_low_apply (struct ScreenInfo *screen_info)
return 1; return 1;
} }
void output_auto (struct ScreenInfo *screen_info, struct OutputInfo *output_info) void internal_output_auto (struct ScreenInfo *screen_info, struct OutputInfo *output_info)
{ {
XRRModeInfo *mode_info; XRRModeInfo *mode_info;
RRMode mode_id; RRMode mode_id;
@ -627,11 +628,11 @@ void output_auto (struct ScreenInfo *screen_info, struct OutputInfo *output_info
probe_output_info = XRRGetOutputInfo (screen_info->dpy, cur_res, output_info->id); probe_output_info = XRRGetOutputInfo (screen_info->dpy, cur_res, output_info->id);
if (RR_Disconnected != probe_output_info->connection) { if (RR_Disconnected != probe_output_info->connection) {
output_info->info = probe_output_info; output_info->info = probe_output_info;
output_info->cur_crtc = auto_find_crtc (screen_info, output_info); output_info->cur_crtc = internal_auto_find_crtc (screen_info, output_info);
} }
} }
mode_info = preferred_mode (screen_info, output_info); mode_info = internal_preferred_mode (screen_info, output_info);
if (!mode_info) { if (!mode_info) {
return; return;
} }
@ -641,7 +642,7 @@ void output_auto (struct ScreenInfo *screen_info, struct OutputInfo *output_info
if (crtc_info) { if (crtc_info) {
crtc_info->cur_mode_id = mode_id; crtc_info->cur_mode_id = mode_id;
} else { } else {
crtc_info = auto_find_crtc (screen_info, output_info); crtc_info = internal_auto_find_crtc (screen_info, output_info);
if (!crtc_info) { if (!crtc_info) {
#if RANDR_GUI_DEBUG #if RANDR_GUI_DEBUG
fprintf (stderr, "Can not find usable CRTC\n"); fprintf (stderr, "Can not find usable CRTC\n");
@ -659,7 +660,7 @@ void output_auto (struct ScreenInfo *screen_info, struct OutputInfo *output_info
} }
void output_off (struct ScreenInfo *screen_info, struct OutputInfo *output) void internal_output_off (struct ScreenInfo *screen_info, struct OutputInfo *output)
{ {
if (output->cur_crtc) { if (output->cur_crtc) {
output->cur_crtc->cur_noutput--; output->cur_crtc->cur_noutput--;

@ -80,22 +80,22 @@ extern "C" {
#endif #endif
void free_screen_info (struct ScreenInfo *screen_info); void free_screen_info (struct ScreenInfo *screen_info);
struct ScreenInfo* read_screen_info (Display *); struct ScreenInfo* internal_read_screen_info (Display *);
int set_screen_size (struct ScreenInfo *screen_info); int internal_set_screen_size (struct ScreenInfo *screen_info);
void output_auto (struct ScreenInfo *screen_info, struct OutputInfo *output_info); void internal_output_auto (struct ScreenInfo *screen_info, struct OutputInfo *output_info);
void output_off (struct ScreenInfo *screen_info, struct OutputInfo *output); void internal_output_off (struct ScreenInfo *screen_info, struct OutputInfo *output);
struct CrtcInfo* auto_find_crtc (struct ScreenInfo *screen_info, struct OutputInfo *output_info); struct CrtcInfo* internal_auto_find_crtc (struct ScreenInfo *screen_info, struct OutputInfo *output_info);
XRRModeInfo *find_mode_by_xid (struct ScreenInfo *screen_info, RRMode mode_id); XRRModeInfo *internal_find_mode_by_xid (struct ScreenInfo *screen_info, RRMode mode_id);
int mode_height (XRRModeInfo *mode_info, Rotation rotation); int internal_mode_height (XRRModeInfo *mode_info, Rotation rotation);
int mode_width (XRRModeInfo *mode_info, Rotation rotation); int internal_mode_width (XRRModeInfo *mode_info, Rotation rotation);
int get_width_by_output_id (struct ScreenInfo *screen_info, RROutput output_id); int internal_get_width_by_output_id (struct ScreenInfo *screen_info, RROutput output_id);
int get_height_by_output_id (struct ScreenInfo *screen_info, RROutput output_id); int internal_get_height_by_output_id (struct ScreenInfo *screen_info, RROutput output_id);
char *get_output_name (struct ScreenInfo *screen_info, RROutput id); char *internal_get_output_name (struct ScreenInfo *screen_info, RROutput id);
Status crtc_apply (struct CrtcInfo *crtc_info); Status internal_crtc_apply (struct CrtcInfo *crtc_info);
Status crtc_disable (struct CrtcInfo *crtc); Status internal_crtc_disable (struct CrtcInfo *crtc);
int main_low_apply (struct ScreenInfo *screen_info); int internal_main_low_apply (struct ScreenInfo *screen_info);
#ifdef __cplusplus #ifdef __cplusplus
} }

Loading…
Cancel
Save