[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
master 6a4444aa39: Fix coding style of some Haiku files
From: |
Po Lu |
Subject: |
master 6a4444aa39: Fix coding style of some Haiku files |
Date: |
Tue, 7 Jun 2022 08:14:46 -0400 (EDT) |
branch: master
commit 6a4444aa390f20c195f864a7c1b8114d82ffdeb5
Author: Po Lu <luangruo@yahoo.com>
Commit: Po Lu <luangruo@yahoo.com>
Fix coding style of some Haiku files
* src/haiku_support.cc: (FrameResized):
(class EmacsView, AfterResize): Fix coding and initializer
style.
* src/haiku_support.h (struct haiku_resize_event): Rename
confusingly named fields.
* src/haikuterm.c (haiku_read_socket): Update accordingly.
---
src/haiku_support.cc | 39 ++++++++++++++++++++++++---------------
src/haiku_support.h | 4 ++--
src/haikuterm.c | 4 ++--
3 files changed, 28 insertions(+), 19 deletions(-)
diff --git a/src/haiku_support.cc b/src/haiku_support.cc
index 3b1a2cfcb3..3c8e5dc8c2 100644
--- a/src/haiku_support.cc
+++ b/src/haiku_support.cc
@@ -1103,8 +1103,8 @@ public:
{
struct haiku_resize_event rq;
rq.window = this;
- rq.px_heightf = newHeight + 1.0f;
- rq.px_widthf = newWidth + 1.0f;
+ rq.width = newWidth + 1.0f;
+ rq.height = newHeight + 1.0f;
haiku_write (FRAME_RESIZED, &rq);
BWindow::FrameResized (newWidth, newHeight);
@@ -1492,25 +1492,36 @@ public:
class EmacsView : public BView
{
public:
- uint32_t previous_buttons = 0;
- int looper_locked_count = 0;
+ uint32_t previous_buttons;
+ int looper_locked_count;
BRegion sb_region;
BRegion invalid_region;
- BView *offscreen_draw_view = NULL;
- BBitmap *offscreen_draw_bitmap_1 = NULL;
- BBitmap *copy_bitmap = NULL;
+ BView *offscreen_draw_view;
+ BBitmap *offscreen_draw_bitmap_1;
+ BBitmap *copy_bitmap;
#ifdef USE_BE_CAIRO
- cairo_surface_t *cr_surface = NULL;
- cairo_t *cr_context = NULL;
+ cairo_surface_t *cr_surface;
+ cairo_t *cr_context;
BLocker cr_surface_lock;
#endif
BPoint tt_absl_pos;
- BMessage *wait_for_release_message = NULL;
-
- EmacsView () : BView (BRect (0, 0, 0, 0), "Emacs", B_FOLLOW_NONE,
B_WILL_DRAW)
+ BMessage *wait_for_release_message;
+
+ EmacsView () : BView (BRect (0, 0, 0, 0), "Emacs",
+ B_FOLLOW_NONE, B_WILL_DRAW),
+ previous_buttons (0),
+ looper_locked_count (0),
+ offscreen_draw_view (NULL),
+ offscreen_draw_bitmap_1 (NULL),
+ copy_bitmap (NULL),
+#ifdef USE_BE_CAIRO
+ cr_surface (NULL),
+ cr_context (NULL),
+#endif
+ wait_for_release_message (NULL)
{
}
@@ -1658,9 +1669,7 @@ public:
#endif
if (looper_locked_count)
- {
- offscreen_draw_bitmap_1->Lock ();
- }
+ offscreen_draw_bitmap_1->Lock ();
UnlockLooper ();
}
diff --git a/src/haiku_support.h b/src/haiku_support.h
index 9597c24c5d..a2ad222f85 100644
--- a/src/haiku_support.h
+++ b/src/haiku_support.h
@@ -129,8 +129,8 @@ struct haiku_quit_requested_event
struct haiku_resize_event
{
void *window;
- float px_heightf;
- float px_widthf;
+ float width;
+ float height;
};
struct haiku_expose_event
diff --git a/src/haikuterm.c b/src/haikuterm.c
index 0a994b7e60..55e8640ec2 100644
--- a/src/haikuterm.c
+++ b/src/haikuterm.c
@@ -3143,8 +3143,8 @@ haiku_read_socket (struct terminal *terminal, struct
input_event *hold_quit)
if (!f)
continue;
- int width = lrint (b->px_widthf);
- int height = lrint (b->px_heightf);
+ int width = lrint (b->width);
+ int height = lrint (b->height);
if (FRAME_OUTPUT_DATA (f)->wait_for_event_type
== FRAME_RESIZED)
[Prev in Thread] |
Current Thread |
[Next in Thread] |
- master 6a4444aa39: Fix coding style of some Haiku files,
Po Lu <=