Commit ccc2ccf2 authored by Eric Warmenhoven's avatar Eric Warmenhoven Committed by Eric Warmenhoven

implement maximize for linux-fb

Thu Oct  3 16:40:18 2002 Eric Warmenhoven <eric@warmenhoven.org>

        * gdk/gdkevents.c, gdk/linux-fb/gdkwindow-fb.c,
        gtk/gtkwindow-decorate.c: implement maximize for linux-fb

        * gdk/linux-fb/gdkkeyboard-fb.c: implement raw keyboard mode

        * gdk/linux-fb/Makefile.am, gdk/linux-fb/gdkdnd-fb.c,
        gdk/linux-fb/gdkmain-fb.c, gdk/linux-fb/gdkselection-fb.c,
        gdk/linux-fb/miarc.c, gdk/linux-fb/mifpolycon.c,
        gdk/linux-fb/miwideline.c, gdk/linux-fb/mizerclip.c,
        gdk/linux-fb/mizerline.c: small cleanups
parent 92fa2231
Thu Oct 3 16:40:18 2002 Eric Warmenhoven <eric@warmenhoven.org>
* gdk/gdkevents.c, gdk/linux-fb/gdkwindow-fb.c,
gtk/gtkwindow-decorate.c: implement maximize for linux-fb
* gdk/linux-fb/gdkkeyboard-fb.c: implement raw keyboard mode
* gdk/linux-fb/Makefile.am, gdk/linux-fb/gdkdnd-fb.c,
gdk/linux-fb/gdkmain-fb.c, gdk/linux-fb/gdkselection-fb.c,
gdk/linux-fb/miarc.c, gdk/linux-fb/mifpolycon.c,
gdk/linux-fb/miwideline.c, gdk/linux-fb/mizerclip.c,
gdk/linux-fb/mizerline.c: small cleanups
Thu Oct 3 19:00:55 2002 Owen Taylor <otaylor@redhat.com>
* gdk/x11/gdkselection-x11.c (gdk_selection_property_get):
......
Thu Oct 3 16:40:18 2002 Eric Warmenhoven <eric@warmenhoven.org>
* gdk/gdkevents.c, gdk/linux-fb/gdkwindow-fb.c,
gtk/gtkwindow-decorate.c: implement maximize for linux-fb
* gdk/linux-fb/gdkkeyboard-fb.c: implement raw keyboard mode
* gdk/linux-fb/Makefile.am, gdk/linux-fb/gdkdnd-fb.c,
gdk/linux-fb/gdkmain-fb.c, gdk/linux-fb/gdkselection-fb.c,
gdk/linux-fb/miarc.c, gdk/linux-fb/mifpolycon.c,
gdk/linux-fb/miwideline.c, gdk/linux-fb/mizerclip.c,
gdk/linux-fb/mizerline.c: small cleanups
Thu Oct 3 19:00:55 2002 Owen Taylor <otaylor@redhat.com>
* gdk/x11/gdkselection-x11.c (gdk_selection_property_get):
......
Thu Oct 3 16:40:18 2002 Eric Warmenhoven <eric@warmenhoven.org>
* gdk/gdkevents.c, gdk/linux-fb/gdkwindow-fb.c,
gtk/gtkwindow-decorate.c: implement maximize for linux-fb
* gdk/linux-fb/gdkkeyboard-fb.c: implement raw keyboard mode
* gdk/linux-fb/Makefile.am, gdk/linux-fb/gdkdnd-fb.c,
gdk/linux-fb/gdkmain-fb.c, gdk/linux-fb/gdkselection-fb.c,
gdk/linux-fb/miarc.c, gdk/linux-fb/mifpolycon.c,
gdk/linux-fb/miwideline.c, gdk/linux-fb/mizerclip.c,
gdk/linux-fb/mizerline.c: small cleanups
Thu Oct 3 19:00:55 2002 Owen Taylor <otaylor@redhat.com>
* gdk/x11/gdkselection-x11.c (gdk_selection_property_get):
......
Thu Oct 3 16:40:18 2002 Eric Warmenhoven <eric@warmenhoven.org>
* gdk/gdkevents.c, gdk/linux-fb/gdkwindow-fb.c,
gtk/gtkwindow-decorate.c: implement maximize for linux-fb
* gdk/linux-fb/gdkkeyboard-fb.c: implement raw keyboard mode
* gdk/linux-fb/Makefile.am, gdk/linux-fb/gdkdnd-fb.c,
gdk/linux-fb/gdkmain-fb.c, gdk/linux-fb/gdkselection-fb.c,
gdk/linux-fb/miarc.c, gdk/linux-fb/mifpolycon.c,
gdk/linux-fb/miwideline.c, gdk/linux-fb/mizerclip.c,
gdk/linux-fb/mizerline.c: small cleanups
Thu Oct 3 19:00:55 2002 Owen Taylor <otaylor@redhat.com>
* gdk/x11/gdkselection-x11.c (gdk_selection_property_get):
......
Thu Oct 3 16:40:18 2002 Eric Warmenhoven <eric@warmenhoven.org>
* gdk/gdkevents.c, gdk/linux-fb/gdkwindow-fb.c,
gtk/gtkwindow-decorate.c: implement maximize for linux-fb
* gdk/linux-fb/gdkkeyboard-fb.c: implement raw keyboard mode
* gdk/linux-fb/Makefile.am, gdk/linux-fb/gdkdnd-fb.c,
gdk/linux-fb/gdkmain-fb.c, gdk/linux-fb/gdkselection-fb.c,
gdk/linux-fb/miarc.c, gdk/linux-fb/mifpolycon.c,
gdk/linux-fb/miwideline.c, gdk/linux-fb/mizerclip.c,
gdk/linux-fb/mizerline.c: small cleanups
Thu Oct 3 19:00:55 2002 Owen Taylor <otaylor@redhat.com>
* gdk/x11/gdkselection-x11.c (gdk_selection_property_get):
......
Thu Oct 3 16:40:18 2002 Eric Warmenhoven <eric@warmenhoven.org>
* gdk/gdkevents.c, gdk/linux-fb/gdkwindow-fb.c,
gtk/gtkwindow-decorate.c: implement maximize for linux-fb
* gdk/linux-fb/gdkkeyboard-fb.c: implement raw keyboard mode
* gdk/linux-fb/Makefile.am, gdk/linux-fb/gdkdnd-fb.c,
gdk/linux-fb/gdkmain-fb.c, gdk/linux-fb/gdkselection-fb.c,
gdk/linux-fb/miarc.c, gdk/linux-fb/mifpolycon.c,
gdk/linux-fb/miwideline.c, gdk/linux-fb/mizerclip.c,
gdk/linux-fb/mizerline.c: small cleanups
Thu Oct 3 19:00:55 2002 Owen Taylor <otaylor@redhat.com>
* gdk/x11/gdkselection-x11.c (gdk_selection_property_get):
......
......@@ -1053,10 +1053,10 @@ gdk_synthesize_window_state (GdkWindow *window,
old = ((GdkWindowObject*) temp_event.window_state.window)->state;
temp_event.window_state.changed_mask = (unset_flags | set_flags) ^ old;
temp_event.window_state.new_window_state = old;
temp_event.window_state.new_window_state |= set_flags;
temp_event.window_state.new_window_state &= ~unset_flags;
temp_event.window_state.changed_mask = temp_event.window_state.new_window_state ^ old;
if (temp_event.window_state.new_window_state == old)
return; /* No actual work to do, nothing changed. */
......
......@@ -29,9 +29,11 @@ libgdkinclude_HEADERS= \
libgdk_linux_fb_la_SOURCES = \
gdkcolor-fb.c \
gdkcursor-fb.c \
gdkdnd-fb.c \
gdkdisplay-fb.c \
gdkdnd-fb.c \
gdkdrawable-fb2.c \
gdkevents-fb.c \
gdkfbmanager.h \
gdkfont-fb.c \
gdkgc-fb.c \
gdkgeometry-fb.c \
......@@ -39,19 +41,19 @@ libgdk_linux_fb_la_SOURCES = \
gdkim-fb.c \
gdkimage-fb.c \
gdkinput.c \
gdkinputprivate.h \
gdkkeyboard-fb.c \
gdkmain-fb.c \
gdkmouse-fb.c \
gdkpango-fb.c \
gdkpixmap-fb.c \
gdkprivate-fb.h \
gdkproperty-fb.c \
gdkselection-fb.c \
gdkrender-fb.c \
gdkscreen-fb.c \
gdkselection-fb.c \
gdkvisual-fb.c \
gdkwindow-fb.c \
gdkprivate-fb.h \
gdkinputprivate.h \
gdkkeyboard-fb.c \
gdkmouse-fb.c \
gdkevents-fb.c \
gdkrender-fb.c \
mi.h \
miarc.c \
midash.c \
......@@ -65,16 +67,14 @@ libgdk_linux_fb_la_SOURCES = \
mipolygen.c \
mipolyutil.c \
miscanfill.h \
mispans.h \
mispans.c \
mispans.h \
mistruct.h \
mitypes.h \
miwideline.c \
miwideline.h \
mizerclip.c \
mizerline.c \
gdkpango-fb.c \
gdkfbmanager.h
mizerline.c
gdkfbmanager_sources = gdkfbmanager.c
gdkfbmanager_LDFLAGS = $(GLIB_LIBS)
......
......@@ -383,7 +383,7 @@ gdk_drag_get_protocol (guint32 xid,
{
GdkWindow *window;
window = gdk_window_lookup (xid);
window = gdk_window_lookup ((GdkNativeWindow) xid);
if (GPOINTER_TO_INT (gdk_drawable_get_data (window, "gdk-dnd-registered")))
{
......@@ -392,7 +392,7 @@ gdk_drag_get_protocol (guint32 xid,
}
*protocol = GDK_DRAG_PROTO_NONE;
return GDK_NONE;
return 0;
}
static GdkWindow *
......@@ -466,7 +466,7 @@ gdk_drag_find_window (GdkDragContext *context,
/* Check if new destination accepts drags, and which protocol */
if ((recipient = gdk_drag_get_protocol ((guint32)dest, protocol)))
{
*dest_window = gdk_window_lookup (recipient);
*dest_window = gdk_window_lookup ((GdkNativeWindow) recipient);
gdk_window_ref (*dest_window);
}
else
......
......@@ -817,6 +817,10 @@ xlate_io (GIOChannel *gioc,
gdk_fb_set_rotation (deg);
}
if ((xlate_codes[j].code == GDK_F8) &&
(xlate_codes[j].modifier & GDK_SHIFT_MASK))
exit (1);
gdk_fb_handle_key (xlate_codes[j].code,
xlate_codes[j].code,
......@@ -1140,16 +1144,16 @@ static const guint trans_table[256][3] = {
{0, 0, 0},
{0, 0, 0},
{0, 0, 0},
{0, 0, 0},
{0, 0, 0},
{0, 0, 0},
{0, 0, 0},
{0, 0, 0},
{0, 0, 0},
{0, 0, 0},
{0, 0, 0},
{0, 0, 0},
{0, 0, 0},
{GDK_Home, 0, 0},
{GDK_Up, 0, 0},
{GDK_Page_Up, 0, 0},
{GDK_Left, 0, 0},
{GDK_Right, 0, 0},
{GDK_End, 0, 0},
{GDK_Down, 0, 0},
{GDK_Page_Down, 0, 0},
{GDK_Insert, 0, 0},
{GDK_Delete, 0, 0},
/* 0x70 */
{0, 0, 0},
......@@ -1456,7 +1460,7 @@ raw_open (GdkFBKeyboard *kb)
if (ioctl (gdk_display->tty_fd, KDSKBMODE, K_MEDIUMRAW) < 0)
{
g_warning ("setting tty to K_MEDIUMRAW failed");
g_warning ("setting tty to K_MEDIUMRAW failed (are you root?)");
return FALSE;
}
......@@ -1491,47 +1495,185 @@ raw_close (GdkFBKeyboard *kb)
static guint
raw_lookup (GdkFBKeyboard *kb,
const GdkKeymapKey *key)
const GdkKeymapKey *key)
{
g_warning ("raw_lookup() NIY");
return FALSE;
if (key->group != 0)
return 0;
if ((key->keycode < 0) || (key->keycode >= 256))
return 0;
if ((key->level < 0) || (key->level >= 3))
return 0;
return trans_table[key->keycode][key->level];
}
static gboolean
raw_translate (GdkFBKeyboard *kb,
guint hardware_keycode,
GdkModifierType state,
gint group,
guint *keyval,
gint *effective_group,
gint *level,
GdkModifierType *consumed_modifiers)
guint hardware_keycode,
GdkModifierType state,
gint group,
guint *keyval,
gint *effective_group,
gint *level,
GdkModifierType *consumed_modifiers)
{
g_warning ("raw_translate() NIY");
return FALSE;
guint tmp_keyval;
gint tmp_level;
if (keyval)
*keyval = 0;
if (effective_group)
*effective_group = 0;
if (level)
*level = 0;
if (consumed_modifiers)
*consumed_modifiers = 0;
if ((hardware_keycode < 0) || (hardware_keycode >= 256))
return FALSE;
if (group != 0)
return FALSE;
if (state & GDK_CONTROL_MASK)
tmp_level = 2;
else if (state & GDK_SHIFT_MASK)
tmp_level = 1;
else
tmp_level = 0;
do {
tmp_keyval = trans_table[hardware_keycode][tmp_level --];
} while (!tmp_keyval && (tmp_level >= 0));
if (keyval)
*keyval = tmp_keyval;
if (level)
*level = tmp_level;
return TRUE;
}
static gboolean
raw_get_for_keyval (GdkFBKeyboard *kb,
guint keyval,
GdkKeymapKey **keys,
gint *n_keys)
guint keyval,
GdkKeymapKey **keys,
gint *n_keys)
{
g_warning ("raw_get_for_keyval() NIY");
if (keys) *keys=NULL;
if (n_keys) *n_keys=0;
return FALSE;
GArray *retval;
int i, j;
retval = g_array_new (FALSE, FALSE, sizeof (GdkKeymapKey));
for (i = 0; i < 256; i++)
for (j = 0; j < 3; j++)
if (trans_table[i][j] == keyval)
{
GdkKeymapKey key;
key.keycode = i;
key.group = 0;
key.level = j;
g_array_append_val (retval, key);
}
if (retval->len > 0)
{
*keys = (GdkKeymapKey*) retval->data;
*n_keys = retval->len;
}
else
{
*keys = NULL;
*n_keys = 0;
}
g_array_free (retval, retval->len > 0 ? FALSE : TRUE);
return *n_keys > 0;
}
static gboolean
raw_get_for_keycode (GdkFBKeyboard *kb,
guint hardware_keycode,
GdkKeymapKey **keys,
guint **keyvals,
gint *n_entries)
guint hardware_keycode,
GdkKeymapKey **keys,
guint **keyvals,
gint *n_entries)
{
g_warning ("raw_get_for_keycode() NIY");
if (keys) *keys=NULL;
if (n_entries) *n_entries=0;
return FALSE;
GArray *key_array;
GArray *keyval_array;
int i;
if (hardware_keycode <= 0 ||
hardware_keycode >= 256)
{
if (keys)
*keys = NULL;
if (keyvals)
*keyvals = NULL;
*n_entries = 0;
return FALSE;
}
if (keys)
key_array = g_array_new (FALSE, FALSE, sizeof (GdkKeymapKey));
else
key_array = NULL;
if (keyvals)
keyval_array = g_array_new (FALSE, FALSE, sizeof (guint));
else
keyval_array = NULL;
for (i = 0; i < 3; i++)
{
if (key_array)
{
GdkKeymapKey key;
key.keycode = hardware_keycode;
key.group = 0;
key.level = i;
g_array_append_val (key_array, key);
}
if (keyval_array)
{
g_array_append_val (keyval_array, trans_table[hardware_keycode][i]);
}
}
if ((key_array && key_array->len > 0) ||
(keyval_array && keyval_array->len > 0))
{
if (keys)
*keys = (GdkKeymapKey*) key_array->data;
if (keyvals)
*keyvals = (guint*) keyval_array->data;
if (key_array)
*n_entries = key_array->len;
else
*n_entries = keyval_array->len;
}
else
{
if (keys)
*keys = NULL;
if (keyvals)
*keyvals = NULL;
*n_entries = 0;
}
if (key_array)
g_array_free (key_array, key_array->len > 0 ? FALSE : TRUE);
if (keyval_array)
g_array_free (keyval_array, keyval_array->len > 0 ? FALSE : TRUE);
return *n_entries > 0;
}
......@@ -409,7 +409,7 @@ gdk_fb_setup_mode_from_name (struct fb_var_screeninfo *modeinfo,
scanner->input_name = filename;
for (i = 0; i < sizeof(fb_modes_keywords)/sizeof(fb_modes_keywords[0]); i++)
g_scanner_add_symbol (scanner, fb_modes_keywords[i], GINT_TO_POINTER (i));
g_scanner_scope_add_symbol (scanner, 0, fb_modes_keywords[i], GINT_TO_POINTER (i));
g_scanner_input_file (scanner, fd);
......
......@@ -216,7 +216,7 @@ gdk_selection_send_notify_for_display (GdkDisplay *display,
GdkEvent *event;
GdkWindow *event_window;
event_window = gdk_fb_other_event_window (gdk_window_lookup (requestor), GDK_SELECTION_NOTIFY);
event_window = gdk_fb_other_event_window (gdk_window_lookup ((GdkNativeWindow) requestor), GDK_SELECTION_NOTIFY);
if (event_window)
{
event = gdk_event_make (event_window, GDK_SELECTION_NOTIFY, TRUE);
......
......@@ -2154,7 +2154,9 @@ gdk_window_maximize (GdkWindow *window)
{
g_return_if_fail (GDK_IS_WINDOW (window));
g_warning ("gdk_window_maximize() not implemented.\n");
gdk_synthesize_window_state (window,
0,
GDK_WINDOW_STATE_MAXIMIZED);
}
void
......@@ -2162,7 +2164,9 @@ gdk_window_unmaximize (GdkWindow *window)
{
g_return_if_fail (GDK_IS_WINDOW (window));
/* g_warning ("gdk_window_unmaximize() not implemented.\n");*/
gdk_synthesize_window_state (window,
GDK_WINDOW_STATE_MAXIMIZED,
0);
}
void
......
......@@ -401,8 +401,8 @@ miComputeCircleSpans(int lw, miArc *parc, miArcSpanData *spdata)
register int x, y, e;
int xk, yk, xm, ym, dx, dy;
register int slw, inslw;
int inx, iny, ine;
int inxk, inyk, inxm, inym;
int inx = 0, iny, ine = 0;
int inxk = 0, inyk = 0, inxm = 0, inym = 0;
doinner = -lw;
slw = parc->width - doinner;
......@@ -464,7 +464,7 @@ miComputeEllipseSpans(int lw, miArc *parc, miArcSpanData *spdata)
register miArcSpan *span;
double w, h, r, xorg;
double Hs, Hf, WH, K, Vk, Nk, Fk, Vr, N, Nc, Z, rs;
double A, T, b, d, x, y, t, inx, outx, hepp, hepm;
double A, T, b, d, x, y, t, inx, outx = 0.0, hepp, hepm;
int flip, solution;
w = (double)parc->width / 2.0;
......@@ -986,8 +986,8 @@ miPolyArc(GdkDrawable *pDraw, GdkGC *pGC, int narcs, miArc *parcs)
register int i;
miArc *parc;
int xMin, xMax, yMin, yMax;
int pixmapWidth, pixmapHeight;
int xOrg, yOrg;
int pixmapWidth = 0, pixmapHeight = 0;
int xOrg = 0, yOrg = 0;
int width;
gboolean fTricky;
GdkDrawable* pDrawTo;
......@@ -1243,7 +1243,7 @@ miArcJoin (GdkDrawable *pDraw, GdkGC *pGC, miArcFacePtr pLeft, miArcFacePtr pRig
int cpt;
SppArcRec arc;
miArcFaceRec Right, Left;
int polyLen;
int polyLen = 0;
int xOrg, yOrg;
double xFtrans, yFtrans;
double a;
......@@ -1746,7 +1746,7 @@ computeDashMap (arcp, map)
dashMap *map;
{
int di;
double a, x, y, prevx, prevy, dist;
double a, x, y, prevx = 0.0, prevy = 0.0, dist;
for (di = 0; di < DASH_MAP_SIZE; di++) {
a = dashIndexToAngle (di);
......@@ -1773,7 +1773,7 @@ miComputeArcs (miArc *parcs, int narcs, GdkGC *pGC)
int isDashed, isDoubleDash;
int dashOffset;
miPolyArcPtr arcs;
int start, i, j, k, nexti, nextk;
int start, i, j, k = 0, nexti, nextk = 0;
int joinSize[2];
int capSize[2];
int arcSize[2];
......@@ -1782,13 +1782,13 @@ miComputeArcs (miArc *parcs, int narcs, GdkGC *pGC)
struct arcData *data;
miArcDataPtr arc;
miArc xarc;
int iphase, prevphase, joinphase;
int iphase, prevphase = 0, joinphase;
int arcsJoin;
int selfJoin;
int iDash, dashRemaining;
int iDashStart, dashRemainingStart, iphaseStart;
int startAngle, spanAngle, endAngle, backwards;
int iDash = 0, dashRemaining;
int iDashStart = 0, dashRemainingStart = 0, iphaseStart;
int startAngle, spanAngle, endAngle, backwards = 0;
int prevDashAngle, dashAngle;
dashMap map;
......@@ -2330,7 +2330,7 @@ drawZeroArc (pDraw, pGC, tarc, lw, left, right)
int lw;
miArcFacePtr right, left;
{
double x0, y0, x1, y1, w, h, x, y;
double x0 = 0.0, y0 = 0.0, x1 = 0.0, y1 = 0.0, w, h, x, y;
double xmax, ymax, xmin, ymin;
int a0, a1;
double a, startAngle, endAngle;
......@@ -3222,9 +3222,9 @@ drawArc (miArc *tarc, int l, int a0, int a1, miArcFacePtr right, miArcFacePtr le
struct arc_def def;
struct accelerators acc;
int startq, endq, curq;
int rightq, leftq, righta, lefta;
int rightq, leftq = 0, righta = 0, lefta = 0;
miArcFacePtr passRight, passLeft;
int q0, q1, mask;
int q0 = 0, q1 = 0, mask;
struct band {
int a0, a1;
int mask;
......
......@@ -79,9 +79,9 @@ miFillSppPoly(GdkDrawable *dst, GdkGC *pgc, int count, SppPointPtr ptsIn, int xT
*/
#endif
{
double xl, xr, /* x vals of left and right edges */
ml, /* left edge slope */
mr, /* right edge slope */
double xl = 0.0, xr = 0.0, /* x vals of left and right edges */
ml = 0.0, /* left edge slope */
mr = 0.0, /* right edge slope */
dy, /* delta y */
i; /* loop counter */
int y, /* current scanline */
......
......@@ -81,7 +81,7 @@ miFillPolyHelper (pDrawable, pGC, pixel, spanData, y, overall_height,
int left_height = 0, right_height = 0;